Show More
Commit Description:
select2, ace, moment now work....
Commit Description:
select2, ace, moment now work. converting navbar
File last commit:
Show/Diff file:
Action:
vendor/javascript/datatables/Editor-2.0.9/js/dataTables.editor.min.js | 1 line | 71.7 KiB | application/javascript | JavascriptLexer |
!function(i){"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return i(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,(e=e||("undefined"!=typeof window?require("jquery"):require("jquery")(t))).fn.dataTable||require("datatables.net")(t,e),i(e,t,t.document)}:i(jQuery,window,document)}(function(w,c,y,E){"use strict";var t=w.fn.dataTable,e={buttons:!0,drawType:!1,focus:0,message:!0,nest:!1,onBackground:"blur",onBlur:"close",onComplete:"close",onEsc:"close",onFieldError:"focus",onReturn:"submit",scope:"row",submit:"all",submitHtml:"▶",submitTrigger:null,title:!0},N={actionName:"action",ajax:null,display:"lightbox",events:{},fields:[],formOptions:{bubble:w.extend({},e,{buttons:"_basic",message:!1,submit:"changed",title:!1}),inline:w.extend({},e,{buttons:!1,submit:"changed"}),main:w.extend({},e)},i18n:{close:"Close",create:{button:"New",submit:"Create",title:"Create new entry"},datetime:{amPm:["am","pm"],hours:"Hour",minutes:"Minute",months:["January","February","March","April","May","June","July","August","September","October","November","December"],next:"Next",previous:"Previous",seconds:"Second",unknown:"-",weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},edit:{button:"Edit",submit:"Update",title:"Edit entry"},error:{system:'A system error has occurred (<a target="_blank" href="//datatables.net/tn/12">More information</a>).'},multi:{info:"The selected items contain different values for this input. To edit and set all items for this input to the same value, click or tap here, otherwise they will retain their individual values.",noMulti:"This input can be edited individually, but not part of a group.",restore:"Undo changes",title:"Multiple values"},remove:{button:"Delete",confirm:{1:"Are you sure you wish to delete 1 row?",_:"Are you sure you wish to delete %d rows?"},submit:"Delete",title:"Delete"}},idSrc:"DT_RowId",table:null},B={action:null,actionName:"action",ajax:null,bubbleNodes:[],closeCb:null,closeIcb:null,dataSource:null,displayController:null,displayed:!1,editCount:0,editData:{},editFields:{},editOpts:{},fields:{},formOptions:{bubble:w.extend({},e),inline:w.extend({},e),main:w.extend({},e)},globalError:"",id:-1,idSrc:null,includeFields:[],mode:null,modifier:null,opts:null,order:[],processing:!1,setFocus:null,table:null,template:null,unique:0},i=w.fn.dataTable.ext.oApi;function L(t){var e,i=[];for(e in t)t.hasOwnProperty(e)&&i.push(e);return i}function a(t,e){return w('*[data-dte-e="'+t+'"]',e=e===E?y:e)}function f(t,e){return void 0===e&&(e="#"),"string"==typeof t?e+t.replace(/(:|\.|\[|\]|,)/g,"\\$1"):e+t}function u(t){return i._fnGetObjectDataFn(t)}function _(t){return i._fnSetObjectDataFn(t)}var d=i._fnExtend;function p(t,i){var n=[];return w.each(t,function(t,e){n.push(e[i])}),n}function M(t,e){if("object"!=typeof t||"object"!=typeof e)return t==e;var i=L(t),n=L(e);if(i.length!==n.length)return!1;for(var s=0,o=i.length;s<o;s++){var r=i[s];if("object"==typeof t[r]){if(!M(t[r],e[r]))return!1}else if(t[r]!=e[r])return!1}return!0}function U(t,e){return t.settings()[0].oFeatures.bServerSide&&"none"!==e.s.editOpts.drawType}function h(t){return t instanceof w.fn.dataTable.Api?t:w(t).DataTable()}function V(t){t=w(t),setTimeout(function(){t.addClass("highlight"),setTimeout(function(){t.addClass("noHighlight").removeClass("highlight"),setTimeout(function(){t.removeClass("noHighlight")},550)},500)},20)}function H(l,d,u,c,f,p){void 0===p&&(p=null);var h=d.cells(u);h.indexes().each(function(t){var e,i,n,s=d.cell(t),o=d.row(t.row).data(),o=f(o),r=p||W(d,c,t.column,1<h.count()),a="object"==typeof u&&u.nodeName||u instanceof w;Object.keys(r).length&&(l[o]&&(i=l[o].attach,n=l[o].attachFields,e=l[o].displayFields),q(l,d,t.row,c,f),l[o].attachFields=n||[],l[o].attachFields.push(Object.keys(r)),l[o].attach=i||[],l[o].attach.push(a?w(u).get(0):s.fixedNode?s.fixedNode():s.node()),l[o].displayFields=e||{},w.extend(l[o].displayFields,r))})}var q=function(n,s,t,o,r){s.rows(t).indexes().each(function(t){var t=s.row(t),e=t.data(),i=r(e);i===E&&P.error("Unable to find row identifier",14),n[i]={data:e,fields:o,idSrc:i,node:t.node(),type:"row"}})},W=function(t,e,i,n){function o(t,e){t.name()===e&&(s[t.name()]=t)}var t=t.settings()[0].aoColumns[i],r=t.editField!==E?t.editField:t.mData,s={};return w.each(e,function(t,e){if(Array.isArray(r))for(var i=0,n=r;i<n.length;i++){var s=n[i];o(e,s)}else o(e,r)}),w.isEmptyObject(s)&&!n&&P.error("Unable to automatically determine field from source. Please specify the field name.",11),s},m={commit:function(t,e,i,n){var s=this,o=h(this.s.table),r=o.settings()[0].oFeatures.bServerSide,a=n.rowIds;if(!U(o,this)&&"edit"===t&&n.rowIds.length)for(var l=void 0,d=0,u=a.length;d<u;d++){try{l=o.row(f(a[d]))}catch(t){l=o}(l=l.any()?l:o.row(function(n){return function(t,e,i){return n==m.id.call(s,e)}}(a[d]))).any()&&!r&&l.remove()}t=this.s.editOpts.drawType;"none"!==t&&(n=o,r&&a&&a.length&&o.one("draw",function(){for(var t=0,e=a.length;t<e;t++){var i=o.row(f(a[t]));i.any()&&V(i.node())}}),o.draw(t),n.responsive&&n.responsive.recalc(),"function"!=typeof n.searchPanes||r||n.searchPanes.rebuildPane(E,!0),n.searchBuilder===E||"function"!=typeof n.searchBuilder.rebuild||r||n.searchBuilder.rebuild(n.searchBuilder.getDetails()))},create:function(t,e){var i=h(this.s.table);U(i,this)||(i=i.row.add(e),V(i.node()))},edit:function(t,e,i,n){var s=this,o=h(this.s.table);if(!U(o,this)||"none"===this.s.editOpts.drawType){var r,a=m.id.call(this,i),l=void 0;try{l=o.row(f(a))}catch(t){l=o}(l=l.any()?l:o.row(function(t,e,i){return a==m.id.call(s,e)})).any()?(r=d({},l.data(),!0),r=d(r,i,!0),l.data(r),r=w.inArray(a,n.rowIds),n.rowIds.splice(r,1)):l=o.row.add(i),V(l.node())}},fakeRow:function(t){for(var e=h(this.s.table),i=w('<tr class="dte-inlineAdd">'),n=[],s=[],o={},r=0,a=e.columns(":visible").count();r<a;r++){var l=e.column(r+":visible").index(),d=w("<td>").appendTo(i),u=W(e,this.s.fields,l,!0),l=e.cell(":eq(0)",l).node();l&&d.addClass(l.className),Object.keys(u).length&&(n.push(Object.keys(u)),s.push(d[0]),w.extend(o,u))}function c(){i["end"===t?"appendTo":"prependTo"](e.table(E).body())}return this.__dtFakeRow=i,c(),e.on("draw.dte-createInline",function(){c()}),{0:{attach:s,attachFields:n,displayFields:o,fields:this.s.fields,type:"row"}}},fakeRowEnd:function(){h(this.s.table).off("draw.dte-createInline"),this.__dtFakeRow.remove(),this.__dtFakeRow=null},fields:function(t){var e,i,n,s,o,r=u(this.s.idSrc),a=h(this.s.table),l=this.s.fields,d={};return!w.isPlainObject(t)||t.rows===E&&t.columns===E&&t.cells===E?q(d,a,t,l,r):(t.rows!==E&&q(d,a,t.rows,l,r),t.columns!==E&&(e=d,i=a,n=t.columns,s=l,o=r,i.cells(null,n).indexes().each(function(t){H(e,i,t,s,o)})),t.cells!==E&&H(d,a,t.cells,l,r)),d},id:function(t){return u(this.s.idSrc)(t)},individual:function(t,e){var i,n=u(this.s.idSrc),s=h(this.s.table),o=this.s.fields,r={};return e&&(Array.isArray(e)||(e=[e]),i={},w.each(e,function(t,e){i[e]=o[e]})),H(r,s,t,o,n,i),r},prep:function(t,e,i,n,s){var o,r=this;"create"===t&&(s.rowIds=w.map(n.data,function(t){return m.id.call(r,t)})),"edit"===t?(o=n.cancelled||[],s.rowIds=w.map(i.data,function(t,e){return w.isEmptyObject(i.data[e])||-1!==w.inArray(e,o)?E:e})):"remove"===t&&(s.cancelled=n.cancelled||[])},refresh:function(){h(this.s.table).ajax.reload(null,!1)},remove:function(t,e,i){var n,s=this,o=h(this.s.table),r=i.cancelled;(0===r.length?o.rows(t):(n=[],o.rows(t).every(function(){var t=m.id.call(s,this.data());-1===w.inArray(t,r)&&n.push(this.index())}),o.rows(n))).remove()}};function z(t){if("keyless"===t)return w(y);var e=w('[data-editor-id="'+t+'"]');if(0===(e=0===e.length?w("string"==typeof t?f(t):t):e).length)throw new Error("Could not find an element with `data-editor-id` or `id` of: "+t);return e}function G(t,e){t=z(t);return w('[data-editor-field="'+e+'"]',t)}function J(n,t,s){w.each(t,function(t,e){var i=e.valFromData(s);i!==E&&((e=G(n,e.dataSrc())).filter("[data-editor-value]").length?e.attr("data-editor-value",i):e.each(function(){for(;this.childNodes.length;)this.removeChild(this.firstChild)}).html(i))})}var l={create:function(t,e){if(e){var i=l.id.call(this,e);try{z(i).length&&J(i,t,e)}catch(t){}}},edit:function(t,e,i){J(l.id.call(this,i)||"keyless",e,i)},fields:function(s){var t={};if(Array.isArray(s))for(var e=0,i=s.length;e<i;e++){var n=l.fields.call(this,s[e]);t[s[e]]=n[s[e]]}else{var o={},r=this.s.fields;s=s||"keyless",w.each(r,function(t,e){i=s,n=e.dataSrc();var i,n=(i=G(i,n)).filter("[data-editor-value]").length?i.attr("data-editor-value"):i.html();e.valToData(o,null===n?E:n)}),t[s]={data:o,fields:r,idSrc:s,node:y,type:"row"}}return t},id:function(t){return u(this.s.idSrc)(t)},individual:function(i,n){var s,t,o,r;if((i instanceof w||i.nodeName)&&(s=i,n=n||[w(i).attr("data-editor-field")],t=w.fn.addBack?"addBack":"andSelf",i=w(i).parents("[data-editor-id]")[t]().data("editor-id")),i=i||"keyless",(n=n&&!Array.isArray(n)?[n]:n)&&0!==n.length)return t=l.fields.call(this,i),o=this.s.fields,r={},w.each(n,function(t,e){r[e]=o[e]}),w.each(t,function(t,e){e.type="cell",e.attachFields=[n],e.attach=s?w(s):function(t,e){for(var i=w(),n=0,s=e.length;n<s;n++)i=i.add(G(t,e[n]));return i}(i,n).toArray(),e.fields=o,e.displayFields=r}),t;throw new Error("Cannot automatically determine field name from data source")},initField:function(t){var e=w('[data-editor-label="'+(t.data||t.name)+'"]');!t.label&&e.length&&(t.label=e.html())},remove:function(t,e){z(t).remove()}},X={actions:{create:"DTE_Action_Create",edit:"DTE_Action_Edit",remove:"DTE_Action_Remove"},body:{content:"DTE_Body_Content",wrapper:"DTE_Body"},bubble:{bg:"DTE_Bubble_Background",close:"icon close",liner:"DTE_Bubble_Liner",pointer:"DTE_Bubble_Triangle",table:"DTE_Bubble_Table",wrapper:"DTE DTE_Bubble"},field:{disabled:"disabled",error:"DTE_Field_StateError",input:"DTE_Field_Input",inputControl:"DTE_Field_InputControl",label:"DTE_Label","msg-error":"DTE_Field_Error","msg-info":"DTE_Field_Info","msg-label":"DTE_Label_Info","msg-message":"DTE_Field_Message",multiInfo:"multi-info",multiNoEdit:"multi-noEdit",multiRestore:"multi-restore",multiValue:"multi-value",namePrefix:"DTE_Field_Name_",processing:"DTE_Processing_Indicator",typePrefix:"DTE_Field_Type_",wrapper:"DTE_Field"},footer:{content:"DTE_Footer_Content",wrapper:"DTE_Footer"},form:{button:"btn",buttonInternal:"btn",buttons:"DTE_Form_Buttons",content:"DTE_Form_Content",error:"DTE_Form_Error",info:"DTE_Form_Info",tag:"",wrapper:"DTE_Form"},header:{content:"DTE_Header_Content",wrapper:"DTE_Header"},inline:{buttons:"DTE_Inline_Buttons",liner:"DTE_Inline_Field",wrapper:"DTE DTE_Inline"},processing:{active:"processing",indicator:"DTE_Processing_Indicator"},wrapper:"DTE"},v=!1,$=1,b={background:w('<div class="DTED_Envelope_Background"><div></div></div>')[0],close:w('<div class="DTED_Envelope_Close"></div>')[0],content:null,wrapper:w('<div class="DTED DTED_Envelope_Wrapper"><div class="DTED_Envelope_Shadow"></div><div class="DTED_Envelope_Container"></div></div>')[0]};function Q(t){var e=w("div.DTE_Header",b.wrapper).outerHeight(),i=w("div.DTE_Footer",b.wrapper).outerHeight(),e=w(c).height()-2*g.conf.windowPadding-e-i;return w("div.DTE_Body_Content",b.wrapper).css("maxHeight",e),w(t.dom.wrapper).outerHeight()}function Z(t,e){e=e||function(){},v&&(w(b.content).animate({top:-(b.content.offsetHeight+50)},600,function(){w([b.wrapper,b.background]).fadeOut("normal",function(){w(this).detach(),e()})}),v=!1)}function K(e,t){var i,n,s,o,r;t=t||function(){},w("body").append(b.background).append(b.wrapper),b.content.style.height="auto",v||((i=b.wrapper.style).opacity="0",i.display="block",n=Q(e),s=e,o=g.conf.attach,r=new w.fn.dataTable.Api(s.s.table),r=(o="head"===o||"create"===s.s.action?r.table(E).header():r.row(s.s.modifier).node()).offsetWidth,i.display="none",i.opacity="1",b.wrapper.style.width=r+"px",b.wrapper.style.marginLeft=-r/2+"px",b.wrapper.style.top=w(o).offset().top+o.offsetHeight+"px",b.content.style.top=-1*n-20+"px",b.background.style.opacity="0",b.background.style.display="block",w(b.background).animate({opacity:$},"normal"),w(b.wrapper).fadeIn(),w(b.content).animate({top:0},600,t)),w(b.close).attr("title",e.i18n.close).off("click.DTED_Envelope").on("click.DTED_Envelope",function(t){e.close()}),w(b.background).off("click.DTED_Envelope").on("click.DTED_Envelope",function(t){e.background()}),w("div.DTED_Lightbox_Content_Wrapper",b.wrapper).off("click.DTED_Envelope").on("click.DTED_Envelope",function(t){w(t.target).hasClass("DTED_Envelope_Content_Wrapper")&&e.background()}),w(c).off("resize.DTED_Envelope").on("resize.DTED_Envelope",function(){Q(e)}),v=!0}var g={close:function(t,e){Z(0,e)},conf:{attach:"row",windowPadding:50},destroy:function(t){Z()},init:function(t){return b.content=w("div.DTED_Envelope_Container",b.wrapper)[0],$=w(b.background).css("opacity"),g},node:function(t){return b.wrapper[0]},open:function(t,e,i){w(b.content).children().detach(),b.content.appendChild(e),b.content.appendChild(b.close),K(t,i)}};function Y(){return void 0!==c.orientation&&c.outerWidth<=576}var o=!1,tt=!1,et=0,r={background:w('<div class="DTED_Lightbox_Background"><div></div></div>'),close:w('<div class="DTED_Lightbox_Close"></div>'),content:null,wrapper:w('<div class="DTED DTED_Lightbox_Wrapper"><div class="DTED_Lightbox_Container"><div class="DTED_Lightbox_Content_Wrapper"><div class="DTED_Lightbox_Content"></div></div></div></div>')};function it(){var t=w("div.DTE_Header",r.wrapper).outerHeight()+w("div.DTE_Footer",r.wrapper).outerHeight();Y()?w("div.DTE_Body_Content",r.wrapper).css("maxHeight","calc(100vh - "+t+"px)"):(t=w(c).height()-2*x.conf.windowPadding-t,w("div.DTE_Body_Content",r.wrapper).css("maxHeight",t))}function nt(t,e){e=e||function(){},w("body").scrollTop(et),t._animate(r.wrapper,{opacity:0,top:x.conf.offsetAni},function(){w(this).detach(),e()}),t._animate(r.background,{opacity:0},function(){w(this).detach()}),o=!1,w(c).off("resize.DTED_Lightbox")}var x={close:function(t,e){nt(t,e)},conf:{offsetAni:25,windowPadding:25},destroy:function(t){o&&nt(t)},init:function(t){return tt||(r.content=w("div.DTED_Lightbox_Content",r.wrapper),r.wrapper.css("opacity",0),r.background.css("opacity",0),tt=!0),x},node:function(t){return r.wrapper[0]},open:function(t,e,i){var n,s=r.content;s.children().detach(),s.append(e).append(r.close),n=t,s=i,Y()&&w("body").addClass("DTED_Lightbox_Mobile"),w("body").append(r.background).append(r.wrapper),it(),o||(o=!0,r.content.css("height","auto"),r.wrapper.css({top:-x.conf.offsetAni}),n._animate(r.wrapper,{opacity:1,top:0},s),n._animate(r.background,{opacity:1}),w(c).on("resize.DTED_Lightbox",function(){it()}),et=w("body").scrollTop()),r.close.attr("title",n.i18n.close).off("click.DTED_Lightbox").on("click.DTED_Lightbox",function(t){n.close()}),r.background.off("click.DTED_Lightbox").on("click.DTED_Lightbox",function(t){t.stopImmediatePropagation(),n.background()}),w("div.DTED_Lightbox_Content_Wrapper",r.wrapper).off("click.DTED_Lightbox").on("click.DTED_Lightbox",function(t){w(t.target).hasClass("DTED_Lightbox_Content_Wrapper")&&(t.stopImmediatePropagation(),n.background())})}},st=w.fn.dataTable;function ot(t,e,i){if(void 0===i&&(i=!0),Array.isArray(t)){e!==E&&t.reverse();for(var n=0,s=t;n<s.length;n++){var o=s[n];this.add(o,e,!1)}this._displayReorder(this.order())}else{var r=t.name;if(r===E)throw new Error("Error adding field. The field requires a `name` option");if(this.s.fields[r])throw new Error("Error adding field '"+r+"'. A field already exists with this name");this._dataSource("initField",t);var a=new P.Field(t,this.classes.field,this);this.s.mode&&(t=this.s.editFields,a.multiReset(),w.each(t,function(t,e){var i;e.data&&(i=a.valFromData(e.data)),a.multiSet(t,i!==E?i:a.def())})),this.s.fields[r]=a,e===E?this.s.order.push(r):null===e?this.s.order.unshift(r):(t=w.inArray(e,this.s.order),this.s.order.splice(t+1,0,r)),!1!==i&&this._displayReorder(this.order())}return this}function rt(t){return t?(this.s.ajax=t,this):this.s.ajax}function at(){var t=this.s.editOpts.onBackground;return"function"==typeof t?t(this):"blur"===t?this.blur():"close"===t?this.close():"submit"===t&&this.submit(),this}function lt(){return this._blur(),this}function dt(t,e,a,l){var d,u=this,i=this;return this._tidy(function(){i.bubble(t,e,l)})||(w.isPlainObject(e)?(l=e,e=E,a=!0):"boolean"==typeof e&&(a=e,l=e=E),w.isPlainObject(a)&&(l=a,a=!0),a===E&&(a=!0),l=w.extend({},this.s.formOptions.bubble,l),d=this._dataSource("individual",t,e),this._edit(t,d,"bubble",l,function(){var e=u._formOptions(l);if(!u._preopen("bubble"))return u;w(c).on("resize."+e,function(){u.bubblePosition()});var t=[],t=(u.s.bubbleNodes=t.concat.apply(t,p(d,"attach")),u.classes.bubble),i=w('<div class="'+t.bg+'"><div></div></div>'),n=w('<div class="'+t.wrapper+'"><div class="'+t.liner+'"><div class="'+t.table+'"><div class="'+t.close+'" title="'+u.i18n.close+'"></div><div class="DTE_Processing_Indicator"><span></div></div></div><div class="'+t.pointer+'"></div></div>'),t=(a&&(n.appendTo("body"),i.appendTo("body")),n.children().eq(0)),s=t.children(),o=s.children(),r=(t.append(u.dom.formError),s.prepend(u.dom.form),l.message&&t.prepend(u.dom.formInfo),l.title&&t.prepend(u.dom.header),l.buttons&&s.append(u.dom.buttons),w().add(n).add(i));u._closeReg(function(t){u._animate(r,{opacity:0},function(){this===n[0]&&(r.detach(),w(c).off("resize."+e),u._clearDynamicInfo(),u._event("closed",["bubble"]))})}),i.on("click",function(){u.blur()}),o.on("click",function(){u._close()}),u.bubblePosition(),u._postopen("bubble",!1);u._animate(r,{opacity:1},function(){this===n[0]&&(u._focus(u.s.includeFields,l.focus),u._event("opened",["bubble",u.s.action]))})})),this}function ut(){var t=w("div.DTE_Bubble"),e=w("div.DTE_Bubble_Liner"),i=this.s.bubbleNodes,n={bottom:0,left:0,right:0,top:0},i=(w.each(i,function(t,e){var i=w(e).offset();e=w(e).get(0),n.top+=i.top,n.left+=i.left,n.right+=i.left+e.offsetWidth,n.bottom+=i.top+e.offsetHeight}),n.top/=i.length,n.left/=i.length,n.right/=i.length,n.bottom/=i.length,n.top),s=(n.left+n.right)/2,o=e.outerWidth(),r=s-o/2,o=r+o,a=w(c).width();return this.classes.bubble,t.css({left:s,top:i}),e.length&&e.offset().top<0?t.css("top",n.bottom).addClass("below"):t.removeClass("below"),a<o+15?e.css("left",r<15?-(r-15):-(15+(o-a))):e.css("left",r<15?-(r-15):0),this}function ct(t){var o=this;return"_basic"===t?t=[{action:function(){this.submit()},text:this.i18n[this.s.action].submit}]:Array.isArray(t)||(t=[t]),w(this.dom.buttons).empty(),w.each(t,function(t,e){var i=(e="string"==typeof e?{action:function(){this.submit()},text:e}:e).text||e.label,n=e.action||e.fn,s=e.attr||{};w("<button></button>",{class:o.classes.form.button+(e.className?" "+e.className:"")}).html("function"==typeof i?i(o):i||"").attr("tabindex",e.tabIndex!==E?e.tabIndex:0).attr(s).on("keyup",function(t){13===t.which&&n&&n.call(o)}).on("keypress",function(t){13===t.which&&t.preventDefault()}).on("click",function(t){t.preventDefault(),n&&n.call(o,t)}).appendTo(o.dom.buttons)}),this}function ft(t){var i=this,e=this.s.fields;return"string"==typeof t?(i.field(t).destroy(),delete e[t],e=w.inArray(t,this.s.order),this.s.order.splice(e,1),-1!==(e=w.inArray(t,this.s.includeFields))&&this.s.includeFields.splice(e,1)):w.each(this._fieldNames(t),function(t,e){i.clear(e)}),this}function pt(){return this._close(!1),this}function ht(t,e,i,n){var s=this,o=this,r=this.s.fields,a=1;if(!this._tidy(function(){o.create(t,e,i,n)})){"number"==typeof t&&(a=t,t=e,e=i),this.s.editFields={};for(var l=0;l<a;l++)this.s.editFields[l]={fields:this.s.fields};var d=this._crudArgs(t,e,i,n);this.s.mode="main",this.s.action="create",this.s.modifier=null,this.dom.form.style.display="block",this._actionClass(),this._displayReorder(this.fields()),w.each(r,function(t,e){e.multiReset();for(var i=0;i<a;i++)e.multiSet(i,e.def());e.set(e.def())}),this._event("initCreate",null,function(){s._assembleMain(),s._formOptions(d.opts),d.maybeOpen()})}return this}function mt(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;e++)this.undependent(t[e]);else w(this.field(t).node()).off(".edep");return this}function vt(t,n,s){var o=this;if(Array.isArray(t))for(var e=0,i=t.length;e<i;e++)this.dependent(t[e],n,s);else{var r=this,a=this.field(t),l={dataType:"json",type:"POST"},d=(s=w.extend({data:null,event:"change",postUpdate:null,preUpdate:null},s),function(n){s.preUpdate&&s.preUpdate(n),w.each({errors:"error",labels:"label",messages:"message",options:"update",values:"val"},function(t,i){n[t]&&w.each(n[t],function(t,e){r.field(t)[i](e)})}),w.each(["hide","show","enable","disable"],function(t,e){n[e]&&r[e](n[e],n.animate)}),s.postUpdate&&s.postUpdate(n),a.processing(!1)});w(a.node()).on(s.event+".edep",function(t){var e,i;0!==w(a.node()).find(t.target).length&&(a.processing(!0),(e={}).rows=o.s.editFields?p(o.s.editFields,"data"):null,e.row=e.rows?e.rows[0]:null,e.values=o.val(),s.data&&(i=s.data(e))&&(s.data=i),"function"==typeof n?(i=n.call(o,a.val(),e,d,t))&&("object"==typeof i&&"function"==typeof i.then?i.then(function(t){t&&d(t)}):d(i)):(w.isPlainObject(n)?w.extend(l,n):l.url=n,w.ajax(w.extend(l,{data:e,success:d}))))})}return this}function bt(){this.s.displayed&&this.close(),this.clear(),this.s.template&&w("body").append(this.s.template);var t=this.s.displayController;t.destroy&&t.destroy(this),w(y).off(".dte"+this.s.unique),this.dom=null,this.s=null}function _t(t){var i=this;return w.each(this._fieldNames(t),function(t,e){i.field(e).disable()}),this}function yt(t){return t===E?this.s.displayed:this[t?"open":"close"]()}function gt(){return w.map(this.s.fields,function(t,e){return t.displayed()?e:null})}function wt(){return this.s.displayController.node(this)}function Et(t,e,i,n,s){var o,r=this,a=this;return this._tidy(function(){a.edit(t,e,i,n,s)})||(o=this._crudArgs(e,i,n,s),this._edit(t,this._dataSource("fields",t),"main",o.opts,function(){r._assembleMain(),r._formOptions(o.opts),o.maybeOpen()})),this}function xt(t){var i=this;return w.each(this._fieldNames(t),function(t,e){i.field(e).enable()}),this}function Dt(t,e){var i=w(this.dom.wrapper);return e===E?(this._message(this.dom.formError,t,!0,function(){i.toggleClass("inFormError",t!==E&&""!==t)}),this.s.globalError=t):this.field(t).error(e),this}function Tt(t){var e=this.s.fields;if(e[t])return e[t];throw new Error("Unknown field name - "+t)}function Ct(){return w.map(this.s.fields,function(t,e){return e})}function kt(t,e){var i=this.files(t);if(i[e])return i[e];throw new Error("Unknown file id "+e+" in table "+t)}function Ft(t){if(!t)return P.files;var e=P.files[t];if(e)return e;throw new Error("Unknown file table name: "+t)}function Ot(t){var i,n=this;return t=t||this.fields(),Array.isArray(t)?(i={},w.each(t,function(t,e){i[e]=n.field(e).get()}),i):this.field(t).get()}function At(t,i){var n=this;return w.each(this._fieldNames(t),function(t,e){n.field(e).hide(i)}),this}function St(i){return void 0===i&&(i=!1),w.map(this.s.editFields,function(t,e){return!0===i?"#"+e:e})}function It(t){if(w(this.dom.formError),this.s.globalError)return!0;for(var e=this._fieldNames(t),i=0,n=e.length;i<n;i++)if(this.field(e[i]).inError())return!0;return!1}function jt(t,e,i){var n=this,s=this,o=(w.isPlainObject(e)&&(i=e,e=E),i=w.extend({},this.s.formOptions.inline,i),this._dataSource("individual",t,e)),r=Object.keys(o);if(1<r.length)throw new Error("Cannot edit more than one row inline at a time");for(var a=[],l=0,d=o[r[0]].attach;l<d.length;l++){var u=d[l];a.push(u)}return w("div.DTE_Field",a).length||this._tidy(function(){s.inline(t,e,i)})||this._edit(t,o,"inline",i,function(){n._inline(o,i)}),this}function Pt(t,e){var i=this;return w.isPlainObject(t)&&(e=t,t=null),this._tidy(function(){i.inlineCreate(t,e)})||(w.each(this.s.fields,function(t,e){e.multiReset(),e.multiSet(0,e.def()),e.set(e.def())}),this.s.mode="main",this.s.action="create",this.s.modifier=null,this.s.editFields=this._dataSource("fakeRow",t),e=w.extend({},this.s.formOptions.inline,e),this._actionClass(),this._inline(this.s.editFields,e,function(){i._dataSource("fakeRowEnd")}),this._event("initCreate",null)),this}function Rt(t,e){return e===E?this._message(this.dom.formInfo,t):this.field(t).message(e),this}function Nt(t){if(!t)return this.s.action;if(!this.s.action)throw new Error("Not currently in an editing mode");if("create"===this.s.action&&"create"!==t)throw new Error("Changing from create mode is not supported");return this.s.action=t,this}function Bt(){return this.s.modifier}function Lt(t){var i,n=this;return t===E&&(t=this.fields()),Array.isArray(t)?(i={},w.each(t,function(t,e){i[e]=n.field(e).multiGet()}),i):this.field(t).multiGet()}function Mt(t,e){var i=this;return w.isPlainObject(t)&&e===E?w.each(t,function(t,e){i.field(t).multiSet(e)}):this.field(t).multiSet(e),this}function Ut(t){var e=this;return t=t||this.order(),Array.isArray(t)?w.map(t,function(t){return e.field(t).node()}):this.field(t).node()}function Vt(t,e){return w(this).off(this._eventName(t),e),this}function Ht(t,e){return w(this).on(this._eventName(t),e),this}function qt(t,e){return w(this).one(this._eventName(t),e),this}function Wt(){var e=this;return this._displayReorder(),this._closeReg(function(){e._nestedClose(function(){e._clearDynamicInfo(),e._event("closed",["main"])})}),this._preopen("main")&&(this._nestedOpen(function(){e._focus(w.map(e.s.order,function(t){return e.s.fields[t]}),e.s.editOpts.focus),e._event("opened",["main",e.s.action])},this.s.editOpts.nest),this._postopen("main",!1)),this}function zt(t){if(!t)return this.s.order;if(arguments.length&&!Array.isArray(t)&&(t=Array.prototype.slice.call(arguments)),this.s.order.slice().sort().join("-")!==t.slice().sort().join("-"))throw new Error("All fields, and no additional fields, must be provided for ordering.");return w.extend(this.s.order,t),this._displayReorder(),this}function Gt(t,e,i,n,s){var o,r,a=this,l=this;return this._tidy(function(){l.remove(t,e,i,n,s)})||(t.length===E&&(t=[t]),o=this._crudArgs(e,i,n,s),r=this._dataSource("fields",t),this.s.action="remove",this.s.modifier=t,this.s.editFields=r,this.dom.form.style.display="none",this._actionClass(),this._event("initRemove",[p(r,"node"),p(r,"data"),t],function(){a._event("initMultiRemove",[r,t],function(){a._assembleMain(),a._formOptions(o.opts),o.maybeOpen();var t=a.s.editOpts;null!==t.focus&&w("button",a.dom.buttons).eq(t.focus).focus()})})),this}function Jt(t,e){var i,n=this;return w.isPlainObject(t)||((i={})[t]=e,t=i),w.each(t,function(t,e){n.field(t).set(e)}),this}function Xt(t,i){var n=this;return w.each(this._fieldNames(t),function(t,e){n.field(e).show(i)}),this}function $t(e,i,n,s){var o,r=this,a=this.s.fields,l=[],d=0,u=!1;return!this.s.processing&&this.s.action&&(this._processing(!0),o=function(){l.length!==d||u||r._event("initSubmit",[r.s.action],function(t){!1===t?r._processing(!1):(u=!0,r._submit(e,i,n,s))})},this.error(),w.each(a,function(t,e){e.inError()&&l.push(t)}),w.each(l,function(t,e){a[e].error("",function(){d++,o()})}),o()),this}function Qt(t){return t===E?this.s.table:(this.s.table=t,this)}function Zt(t){return t===E?this.s.template:(this.s.template=null===t?null:w(t),this)}function Kt(t){var e=w(this.dom.header).children("div."+this.classes.header.content);return t===E?e.html():("function"==typeof t&&(t=t(this,new st.Api(this.s.table))),e.html(t),this)}function Yt(t,e){return e!==E||w.isPlainObject(t)?this.set(t,e):this.get(t)}function te(t,e,i){e=e?t+" For more information, please refer to https://datatables.net/tn/"+e:t;if(i=void 0===i?!0:i)throw e;console.warn(e)}function ee(t,e,i){var n,s,o;if(e=w.extend({label:"label",value:"value"},e),Array.isArray(t))for(n=0,s=t.length;n<s;n++)o=t[n],w.isPlainObject(o)?i(o[e.value]===E?o[e.label]:o[e.value],o[e.label],n,o.attr):i(o,o,n);else n=0,w.each(t,function(t,e){i(e,t,n),n++})}function ie(o,r,a,l,d){var u=new FileReader,c=0,f=[],p="A server error occurred while uploading the file";o.error(r.name,""),"function"==typeof r.ajax?r.ajax(a,function(t){d.call(o,t)}):(l(r,r.fileReadText||"<i>Uploading file</i>"),u.onload=function(e){var i,n=new FormData;if(n.append("action","upload"),n.append("uploadField",r.name),n.append("upload",a[c]),r.ajaxData&&r.ajaxData(n,a[c],c),r.ajax?i=r.ajax:w.isPlainObject(o.s.ajax)?i=o.s.ajax.upload||o.s.ajax:"string"==typeof o.s.ajax&&(i=o.s.ajax),!i)throw new Error("No Ajax option specified for upload plug-in");if("function"==typeof(i="string"==typeof i?{url:i}:i).data){var t={},s=i.data(t);w.each(t=s!==E&&"string"!=typeof s?s:t,function(t,e){n.append(t,e)})}else if(w.isPlainObject(i.data))throw new Error("Upload feature cannot use `ajax.data` with an object. Please use it as a function instead.");o._event("preUpload",[r.name,a[c],n],function(t){var s;!1===t?c<a.length-1?(c++,u.readAsDataURL(a[c])):d.call(o,f):(s=!1,o.on("preSubmit.DTE_Upload",function(){return!(s=!0)}),w.ajax(w.extend({},i,{contentType:!1,data:n,dataType:"json",error:function(t){o.error(r.name,p),o._event("uploadXhrError",[r.name,t]),l(r)},processData:!1,success:function(t){if(o.off("preSubmit.DTE_Upload"),o._event("uploadXhrSuccess",[r.name,t]),t.fieldErrors&&t.fieldErrors.length)for(var e=t.fieldErrors,i=0,n=e.length;i<n;i++)o.error(e[i].name,e[i].status);else t.error?o.error(t.error):t.upload&&t.upload.id?(t.files&&w.each(t.files,function(t,e){P.files[t]||(P.files[t]={}),w.extend(P.files[t],e)}),f.push(t.upload.id),c<a.length-1?(c++,u.readAsDataURL(a[c])):(d.call(o,f),s&&o.submit())):o.error(r.name,p);l(r)},type:"post",xhr:function(){var t=w.ajaxSettings.xhr();return t.upload&&(t.upload.onprogress=function(){var t;e.lengthComputable&&(t=(e.loaded/e.total*100).toFixed(0)+"%",l(r,1===a.length?t:c+":"+a.length+" "+t))},t.upload.onloadend=function(){l(r,r.processingText||"Processing")}),t}})))})},a=w.map(a,function(t){return t}),r._limitLeft!==E&&a.splice(r._limitLeft,a.length),u.readAsDataURL(a[0]))}var ne=w.fn.dataTable,se=0;function oe(){var t=this.classes.actions,e=this.s.action,i=w(this.dom.wrapper);i.removeClass([t.create,t.edit,t.remove].join(" ")),"create"===e?i.addClass(t.create):"edit"===e?i.addClass(t.edit):"remove"===e&&i.addClass(t.remove)}function re(i,n,s,t){var o,e,r=this.s.action,a={complete:[function(t,e){var i=null;if(204===t.status||"null"===t.responseText)i={};else try{i=t.responseJSON||JSON.parse(t.responseText)}catch(t){}w.isPlainObject(i)||Array.isArray(i)?n(i,400<=t.status,t):s(t,e,o)}],data:null,dataType:"json",error:[function(t,e,i){o=i}],success:[],type:"POST"},l=this.s.ajax,d="edit"===r||"remove"===r?p(this.s.editFields,"idSrc").join(","):null;"function"==typeof(l=w.isPlainObject(l)&&l[r]?l[r]:l)?l(null,null,i,n,s):("string"==typeof l?-1!==l.indexOf(" ")?(e=l.split(" "),a.type=e[0],a.url=e[1]):a.url=l:((e=w.extend({},l||{})).complete&&(a.complete.unshift(e.complete),delete e.complete),e.error&&(a.error.unshift(e.error),delete e.error),a=w.extend({},a,e)),a.replacements&&w.each(a.replacements,function(t,e){a.url=a.url.replace("{"+t+"}",e.call(this,t,d,r,i))}),a.url=a.url.replace(/_id_/,d).replace(/{id}/,d),a.data&&(e=(l="function"==typeof a.data)?a.data(i):a.data,i=l&&e?e:w.extend(!0,i,e)),a.data=i,"DELETE"!==a.type||a.deleteBody!==E&&!0!==a.deleteBody||(l=w.param(a.data),a.url+=-1===a.url.indexOf("?")?"?"+l:"&"+l,delete a.data),w.ajax(a))}function ae(t,e,i,n){w.fn.animate?t.stop().animate(e,i,n):(t.css(e),"function"==typeof i?i.call(t):n&&n.call(t))}function le(){var t=this.dom;w(t.wrapper).prepend(t.header),w(t.footer).append(t.formError).append(t.buttons),w(t.bodyContent).append(t.formInfo).append(t.form)}function de(){var t=this.s.editOpts.onBlur;!1!==this._event("preBlur")&&("function"==typeof t?t(this):"submit"===t?this.submit():"close"===t&&this._close())}function ue(i){var t,e;void 0===i&&(i=!1),this.s&&(t=this.classes.field.error,e=this.s.fields,w("div."+t,this.dom.wrapper).removeClass(t),w.each(e,function(t,e){e.error(""),i||e.message("")}),this.error(""),i||this.message(""))}function ce(t,e){var i;!1!==this._event("preClose")&&(this.s.closeCb&&(i=this.s.closeCb(t,e),this.s.closeCb=null),this.s.closeIcb&&(this.s.closeIcb(),this.s.closeIcb=null),w("body").off("focus.editor-focus"),this.s.displayed=!1,this._event("close"),i&&this._event("closed",[i]))}function fe(t){this.s.closeCb=t}function pe(t,e,i,n){var s,o,r,a=this,t=w.isPlainObject(t)?t:"boolean"==typeof t?(r=t,e):(s=t,o=e,r=i,n);return r===E&&(r=!0),s&&a.title(s),o&&a.buttons(o),{maybeOpen:function(){r&&a.open()},opts:w.extend({},this.s.formOptions.main,t)}}function he(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];t=(this.s.table?P.dataSources.dataTable:P.dataSources.html)[t];if(t)return t.apply(this,e)}function me(i){var n=this,s=w(this.dom.formContent),o=this.s.fields,t=this.s.order,r=this.s.template,a=this.s.mode||"main";i?this.s.includeFields=i:i=this.s.includeFields,s.children().detach(),w.each(t,function(t,e){-1!==n._weakInArray(e,i)&&(r&&"main"===a?(r.find('editor-field[name="'+e+'"]').after(o[e].node()),r.find('[data-editor-template="'+e+'"]')):s).append(o[e].node())}),r&&"main"===a&&r.appendTo(s),this._event("displayOrder",[this.s.displayed,this.s.action,s])}function ve(t,e,i,r,n){for(var a,s=this,o=this.s.fields,l=[],d={},u=(this.s.editFields=e,this.s.editData=d,this.s.modifier=t,this.s.action="edit",this.dom.form.style.display="block",this.s.mode=i,this._actionClass(),w.each(o,function(s,o){o.multiReset(),a=!1,d[s]={},w.each(e,function(t,e){var i,n;e.fields[s]&&(i=o.valFromData(e.data),n=o.nullDefault(),d[s][t]=null===i?"":Array.isArray(i)?i.slice():i,r&&"row"!==r.scope?e.displayFields&&!e.displayFields[s]||(o.multiSet(t,i===E||n&&null===i?o.def():i,!1),a=!0):(o.multiSet(t,i===E||n&&null===i?o.def():i,!1),e.displayFields&&!e.displayFields[s]||(a=!0)))}),o._multiValueCheck(),0!==o.multiIds().length&&a&&l.push(s)}),this.order().slice()),c=u.length-1;0<=c;c--)-1===w.inArray(u[c].toString(),l)&&u.splice(c,1);this._displayReorder(u),this._event("initEdit",[p(e,"node")[0],p(e,"data")[0],t,i],function(){s._event("initMultiEdit",[e,t,i],function(){n()})})}function be(t,e,i){var n;if(void 0===e&&(e=[]),void 0===i&&(i=E),!Array.isArray(t))return n=w.Event(t),w(this).triggerHandler(n,e),n=n.result,0===t.indexOf("pre")&&!1===n&&w(this).triggerHandler(w.Event(t+"Cancelled"),e),i&&(n&&"object"==typeof n&&n.then?n.then(i):i(n)),n;for(var s=0,o=t.length;s<o;s++)this._event(t[s],e)}function _e(t){for(var e=t.split(" "),i=0,n=e.length;i<n;i++){var s,o=(s=e[i]).match(/^on([A-Z])/);o&&(s=o[1].toLowerCase()+s.substring(3)),e[i]=s}return e.join(" ")}function ye(i){var n=null;return w.each(this.s.fields,function(t,e){w(e.node()).find(i).length&&(n=e)}),n}function ge(t){return t===E?this.fields():Array.isArray(t)?t:[t]}function we(t,e){var i,n=this;"remove"!==this.s.action&&(t=w.map(t,function(t){return"string"==typeof t?n.s.fields[t]:t}),"number"==typeof e?i=t[e]:e?i=0===e.indexOf("jq:")?w("div.DTE "+e.replace(/^jq:/,"")):this.s.fields[e]:y.activeElement.blur(),(this.s.setFocus=i)&&i.focus())}function Ee(n){var s=this,o=this,t=se++,e=".dteInline"+t;return this.s.editOpts=n,this.s.editCount=t,"string"!=typeof n.title&&"function"!=typeof n.title||(this.title(n.title),n.title=!0),"string"!=typeof n.message&&"function"!=typeof n.message||(this.message(n.message),n.message=!0),"boolean"!=typeof n.buttons&&(this.buttons(n.buttons),n.buttons=!0),w(y).on("keydown"+e,function(t){var e,i;13===t.which&&s.s.displayed&&(e=w(y.activeElement))&&(i=s._fieldFromNode(e))&&"function"==typeof i.canReturnSubmit&&i.canReturnSubmit(e)&&t.preventDefault()}),w(y).on("keyup"+e,function(t){var e,i=w(y.activeElement);13===t.which&&s.s.displayed?(e=s._fieldFromNode(i))&&"function"==typeof e.canReturnSubmit&&e.canReturnSubmit(i)&&("submit"===n.onReturn?(t.preventDefault(),s.submit()):"function"==typeof n.onReturn&&(t.preventDefault(),n.onReturn(s,t))):27===t.which?(t.preventDefault(),"function"==typeof n.onEsc?n.onEsc(o,t):"blur"===n.onEsc?o.blur():"close"===n.onEsc?o.close():"submit"===n.onEsc&&o.submit()):i.parents(".DTE_Form_Buttons").length&&(37===t.which?i.prev("button").trigger("focus"):39===t.which&&i.next("button").trigger("focus"))}),this.s.closeIcb=function(){w(y).off("keydown"+e),w(y).off("keyup"+e)},e}function xe(t,e,i){for(var n,a=this,s=(void 0===i&&(i=null),!1),o=this.classes.inline,r=t[Object.keys(t)[0]],l=null,d=[],u=0;u<r.attach.length;u++){var c=r.attachFields[u][0];d.push({field:this.s.fields[c],name:c,node:w(r.attach[u])})}var f=this._formOptions(e);if(!this._preopen("inline"))return this;for(var p=0,h=d;p<h.length;p++){var m=h[p],v=m.node,b=(m.children=v.contents().detach(),-1!==navigator.userAgent.indexOf("Edge/")?'style="width:'+v.width()+'px"':"");v.append(w('<div class="'+o.wrapper+'"><div class="'+o.liner+'" '+b+'><div class="DTE_Processing_Indicator"><span></span></div></div><div class="'+o.buttons+'"></div></div>')),v.find("div."+o.liner.replace(/ /g,".")).append(m.field.node()).append(this.dom.formError),n=m.field.node(),e.buttons&&v.find("div."+o.buttons.replace(/ /g,".")).append(this.dom.buttons)}var _=e.submitTrigger;null!==_&&("number"==typeof _&&(t=w(n).closest("tr").children(),_=_<0?t[t.length+_]:t[_]),l=Array.prototype.slice.call(w(_)[0].childNodes),w(l).detach(),w(_).on("click.dte-submit",function(t){t.stopImmediatePropagation(),a.submit()}).append(e.submitHtml)),this._closeReg(function(t,e){return s=!0,w(y).off("click"+f),t&&"edit"===e||d.forEach(function(t){t.node.contents().detach(),t.node.append(t.children)}),_&&w(_).off("click.dte-submit").empty().append(l),a._clearDynamicInfo(),i&&i(),"inline"}),setTimeout(function(){var o,r;s||(o=w.fn.addBack?"addBack":"andSelf",w(y).on("mousedown"+f,function(t){r=t.target}).on("keydown"+f,function(t){r=t.target}).on("click"+f,function(t){for(var e=!1,i=0,n=d;i<n.length;i++){var s=n[i];!s.field._typeFn("owns",r)&&-1===w.inArray(s.node[0],w(r).parents()[o]())||(e=!0)}e||a.blur()}))},0),this._focus(w.map(d,function(t){return t.field}),e.focus),this._postopen("inline",!0)}function De(n){var s=this;n.options&&w.each(this.s.fields,function(t,e){var i;n.options[t]!==E&&(i=s.field(t))&&i.update&&i.update(n.options[t])})}function Te(t,e,i,n){var s=!!w.fn.animate;i===E&&(i=!1),n=n||function(){},"function"==typeof e&&(e=e(this,new ne.Api(this.s.table))),t=w(t),s&&t.stop(),e?(n(),this.s.displayed&&s?t.html(e).fadeIn():t.html(e).css("display","block"),i&&t.attr("title",e)):(this.s.displayed&&s?t.fadeOut(function(){t.html(""),n()}):(t.html("").css("display","none"),n()),i&&t.removeAttr("title"))}function Ce(){var t,e=this.s.fields,i=this.s.includeFields,n=!0;if(i)for(var s=0,o=i.length;s<o;s++){var r=e[i[s]],a=r.multiEditable();r.isMultiValue()&&a&&n?n=!(t=!0):t=!(!r.isMultiValue()||a),e[i[s]].multiInfoShown(t)}}function ke(t){var e,i=this.s.displayController._show;i&&i.length?1<i.length?(i.pop(),e=i[i.length-1],t&&t(),this.s.displayController.open(e.dte,e.append,e.callback)):(this.s.displayController.close(this,t),i.length=0):t&&t()}function Fe(t,e){var i=this.s.displayController;i._show||(i._show=[]),e||(i._show.length=0),i._show.push({append:this.dom.wrapper,callback:t,dte:this}),this.s.displayController.open(this,this.dom.wrapper,t)}function Oe(t,e){var i=this,n=this.s.displayController.captureFocus;return n===E&&(n=!0),w(this.dom.form).off("submit.editor-internal").on("submit.editor-internal",function(t){t.preventDefault()}),!n||"main"!==t&&"bubble"!==t||w("body").on("focus.editor-focus",function(){0===w(y.activeElement).parents(".DTE").length&&0===w(y.activeElement).parents(".DTED").length&&i.s.setFocus&&i.s.setFocus.focus()}),this._multiInfo(),this._event("open",[t,this.s.action]),e&&this._event("opened",[t,this.s.action]),!0}function Ae(t){return!1===this._event("preOpen",[t,this.s.action])?(this._clearDynamicInfo(),this._event("cancelOpen",[t,this.s.action]),"inline"!==this.s.mode&&"bubble"!==this.s.mode||!this.s.closeIcb||this.s.closeIcb(),this.s.closeIcb=null,!1):(this._clearDynamicInfo(!0),this.s.displayed=t,!0)}function Se(t){var e=this.classes.processing.active;w(["div.DTE",this.dom.wrapper]).toggleClass(e,t),this.s.processing=t,this._event("processing",[t])}function Ie(t){var i=!1;return w.each(this.s.fields,function(t,e){e.processing()&&(i=!0)}),i&&this.one("processing-field",function(){!0===this._noProcessing(t)&&this._submit.apply(this,t)}),!i}function je(n,s,t,o){var r,a=this,d=!1,e={},i={},u=_,c=this.s.fields,l=this.s.editCount,f=this.s.editFields,p=this.s.editData,h=this.s.editOpts,m=h.submit;if(!1===this._noProcessing(arguments))P.error("Field is still processing",16,!1);else{var v=this.s.action,b={data:{}};if("create"===(b[this.s.actionName]=v)||"edit"===v)if(w.each(f,function(o,r){var a={},l={};w.each(c,function(t,e){var i,n,s;r.fields[t]&&e.submittable()&&(s=e.multiGet(),i=u(t),s[o]===E?(n=e.valFromData(r.data),i(a,n)):(n=s[o],s=Array.isArray(n)&&"string"==typeof t&&-1!==t.indexOf("[]")?u(t.replace(/\[.*$/,"")+"-many-count"):null,i(a,n),s&&s(a,n.length),"edit"!==v||p[t]&&e.compare(n,p[t][o])||(i(l,n),d=!0,s&&s(l,n.length))))}),w.isEmptyObject(a)||(e[o]=a),w.isEmptyObject(l)||(i[o]=l)}),"create"===v||"all"===m||"allIfChanged"===m&&d)b.data=e;else{if("changed"!==m||!d)return this.s.action=null,"close"!==h.onComplete||o!==E&&!o?"function"==typeof h.onComplete&&h.onComplete(this):this._close(!1),n&&n.call(this),this._processing(!1),void this._event("submitComplete");b.data=i}else"remove"===v&&w.each(f,function(t,e){b.data[t]=e.data});r=w.extend(!0,{},b),t&&t(b),this._event("preSubmit",[b,v],function(t){!1===t?a._processing(!1):(a.s.ajax?a._ajax:a._submitTable).call(a,b,function(t,e,i){a._submitSuccess(t,e,b,r,a.s.action,l,o,n,s,i)},function(t,e,i){a._submitError(t,e,i,s,b,a.s.action)},b)})}}function Pe(t,e,i,n){var s,o=t.action,r={data:[]},a=u(this.s.idSrc),l=_(this.s.idSrc);"remove"!==o&&(s="main"===this.s.mode?this._dataSource("fields",this.modifier()):this._dataSource("individual",this.modifier()),w.each(t.data,function(t,e){var i,n=d,n=(i="edit"===o?(i=n({},s[t].data,!0),n(i,e,!0)):n({},e,!0),a(i));l(i,"create"===o&&n===E?+new Date+t.toString():n),r.data.push(i)})),e(r)}function Re(t,e,i,n,s,o,r,a,l,d){var u=this,c=this.s.fields,f=this.s.editOpts,p=this.s.modifier;if(this._event("postSubmit",[t,i,s,d]),t.error||(t.error=""),t.fieldErrors||(t.fieldErrors=[]),e||t.error||t.fieldErrors.length){var h=[];t.error&&h.push(t.error),w.each(t.fieldErrors,function(t,e){var i=c[e.name];if(!i)throw new Error("Unknown field: "+e.name);i.displayed()?(i.error(e.status||"Error"),0===t&&("focus"===f.onFieldError?(u._animate(w(u.dom.bodyContent),{scrollTop:w(i.node()).position().top},500),i.focus()):"function"==typeof f.onFieldError&&f.onFieldError(u,e))):h.push(i.name()+": "+(e.status||"Error"))}),this.error(h.join("<br>")),this._event("submitUnsuccessful",[t]),l&&l.call(this,t)}else{var m={};if(!t.data||"create"!==s&&"edit"!==s)"remove"===s&&(this._dataSource("prep",s,p,n,t,m),this._event("preRemove",[t,this.ids()]),this._dataSource("remove",p,c,m),this._event(["remove","postRemove"],[t,this.ids()]),this._dataSource("commit",s,p,t.data,m));else{this._dataSource("prep",s,p,n,t,m);for(var v=0,b=t.data;v<b.length;v++){var _=b[v],y=_,g=this._dataSource("id",_);this._event("setData",[t,_,s]),"create"===s?(this._event("preCreate",[t,_,g]),this._dataSource("create",c,_,m),this._event(["create","postCreate"],[t,_,g])):"edit"===s&&(this._event("preEdit",[t,_,g]),this._dataSource("edit",p,c,_,m),this._event(["edit","postEdit"],[t,_,g]))}this._dataSource("commit",s,p,t.data,m)}o===this.s.editCount&&(i=this.s.action,this.s.action=null,"close"!==f.onComplete||r!==E&&!r?"function"==typeof f.onComplete&&f.onComplete(this):this._close(!!t.data,i)),a&&a.call(this,t),this._event("submitSuccess",[t,y,s])}this._processing(!1),this._event("submitComplete",[t,y,s])}function Ne(t,e,i,n,s,o){this._event("postSubmit",[null,s,o,t]),this.error(this.i18n.error.system),this._processing(!1),n&&n.call(this,t,e,i),this._event(["submitError","submitComplete"],[t,e,i,s])}function Be(i){var n=this,s=this.s.table?new w.fn.dataTable.Api(this.s.table):null,o=!1;return s&&(o=s.settings()[0].oFeatures.bServerSide),this.s.processing?(this.one("submitComplete",function(){o?s.one("draw",i):setTimeout(function(){i()},10)}),!0):("inline"===this.display()||"bubble"===this.display())&&(this.one("close",function(){n.s.processing?n.one("submitComplete",function(t,e){o&&e?s.one("draw",i):setTimeout(function(){n.s&&i()},10)}):setTimeout(function(){n.s&&i()},10)}).blur(),!0)}function Le(t,e){for(var i=0,n=e.length;i<n;i++)if(t==e[i])return i;return-1}var Me={create:function(){},disable:function(){},enable:function(){},get:function(){},set:function(){}},s=w.fn.dataTable;function Ue(t,e){null!==e&&e!==E||(e=t.uploadText||"Choose file..."),t._input.find("div.upload button").html(e)}function Ve(e,i,n,t){var s,o=e.classes.form.buttonInternal,r=w('<div class="editor_upload"><div class="eu_table"><div class="row"><div class="cell upload limitHide"><button class="'+o+'"></button><input type="file" '+((t=void 0===t?!1:t)?"multiple":"")+'></input></div><div class="cell clearValue"><button class="'+o+'"></button></div></div><div class="row second"><div class="cell limitHide"><div class="drop"><span></span></div></div><div class="cell"><div class="rendered"></div></div></div></div></div>');return i._input=r,i._enabled=!0,i.id&&r.find("input[type=file]").attr("id",P.safeId(i.id)),i.attr&&r.find("input[type=file]").attr(i.attr),Ue(i),c.FileReader&&!1!==i.dragDrop?(r.find("div.drop span").text(i.dragDropText||"Drag and drop a file here to upload"),(s=r.find("div.drop")).on("drop",function(t){return i._enabled&&(P.upload(e,i,t.originalEvent.dataTransfer.files,Ue,n),s.removeClass("over")),!1}).on("dragleave dragexit",function(t){return i._enabled&&s.removeClass("over"),!1}).on("dragover",function(t){return i._enabled&&s.addClass("over"),!1}),e.on("open",function(){w("body").on("dragover.DTE_Upload drop.DTE_Upload",function(t){return!1})}).on("close",function(){w("body").off("dragover.DTE_Upload drop.DTE_Upload")})):(r.addClass("noDrop"),r.append(r.find("div.rendered"))),r.find("div.clearValue button").on("click",function(t){t.preventDefault(),i._enabled&&Xe.set.call(e,i,"")}),r.find("input[type=file]").on("input",function(){P.upload(e,i,this.files,Ue,function(t){n.call(e,t),r.find("input[type=file]")[0].value=""})}),r}function D(t){setTimeout(function(){t.trigger("change",{editor:!0,editorSet:!0})},0)}var n=w.extend(!0,{},Me,{canReturnSubmit:function(t,e){return!0},disable:function(t){t._input.prop("disabled",!0)},enable:function(t){t._input.prop("disabled",!1)},get:function(t){return t._input.val()},set:function(t,e){t._input.val(e),D(t._input)}}),He={create:function(t){return t._val=t.value,null},get:function(t){return t._val},set:function(t,e){t._val=e}},qe=w.extend(!0,{},n,{create:function(t){return t._input=w("<input/>").attr(w.extend({id:P.safeId(t.id),readonly:"readonly",type:"text"},t.attr||{})),t._input[0]}}),We=w.extend(!0,{},n,{create:function(t){return t._input=w("<input/>").attr(w.extend({id:P.safeId(t.id),type:"text"},t.attr||{})),t._input[0]}}),ze=w.extend(!0,{},n,{create:function(t){return t._input=w("<input/>").attr(w.extend({id:P.safeId(t.id),type:"password"},t.attr||{})),t._input[0]}}),Ge=w.extend(!0,{},n,{canReturnSubmit:function(t,e){return!1},create:function(t){return t._input=w("<textarea></textarea>").attr(w.extend({id:P.safeId(t.id)},t.attr||{})),t._input[0]}}),T=w.extend(!0,{},n,{_addOptions:function(t,e,i){var n,s=t._input[0].options,o=0;(i=void 0===i?!1:i)?o=s.length:(s.length=0,t.placeholder!==E&&(i=t.placeholderValue!==E?t.placeholderValue:"",o+=1,s[0]=new Option(t.placeholder,i),n=t.placeholderDisabled===E||t.placeholderDisabled,s[0].hidden=n,s[0].disabled=n,s[0]._editor_val=i)),e&&P.pairs(e,t.optionsPair,function(t,e,i,n){e=new Option(e,t);e._editor_val=t,n&&w(e).attr(n),s[i+o]=e})},create:function(i){return i._input=w("<select></select>").attr(w.extend({id:P.safeId(i.id),multiple:!0===i.multiple},i.attr||{})).on("change.dte",function(t,e){e&&e.editor||(i._lastSet=T.get(i))}),T._addOptions(i,i.options||i.ipOpts),i._input[0]},destroy:function(t){t._input.off("change.dte")},get:function(t){var e=t._input.find("option:selected").map(function(){return this._editor_val}).toArray();return t.multiple?t.separator?e.join(t.separator):e:e.length?e[0]:null},set:function(t,e,i){i||(t._lastSet=e),t.multiple&&t.separator&&!Array.isArray(e)?e="string"==typeof e?e.split(t.separator):[]:Array.isArray(e)||(e=[e]);var n,s,o=e.length,r=!1,a=t._input.find("option");return t._input.find("option").each(function(){for(s=!1,n=0;n<o;n++)if(this._editor_val==e[n]){r=s=!0;break}this.selected=s}),t.placeholder&&!r&&!t.multiple&&a.length&&(a[0].selected=!0),i||D(t._input),r},update:function(t,e,i){T._addOptions(t,e,i);e=t._lastSet;e!==E&&T.set(t,e,!0),D(t._input)}}),C=w.extend(!0,{},n,{_addOptions:function(s,t,e){var o=s._input,r=0;(e=void 0===e?!1:e)?r=w("input",o).length:o.empty(),t&&P.pairs(t,s.optionsPair,function(t,e,i,n){o.append('<div><input id="'+P.safeId(s.id)+"_"+(i+r)+'" type="checkbox" /><label for="'+P.safeId(s.id)+"_"+(i+r)+'">'+e+"</label></div>"),w("input:last",o).attr("value",t)[0]._editor_val=t,n&&w("input:last",o).attr(n)})},create:function(t){return t._input=w("<div></div>"),C._addOptions(t,t.options||t.ipOpts),t._input[0]},disable:function(t){t._input.find("input").prop("disabled",!0)},enable:function(t){t._input.find("input").prop("disabled",!1)},get:function(t){var e=[],i=t._input.find("input:checked");return i.length?i.each(function(){e.push(this._editor_val)}):t.unselectedValue!==E&&e.push(t.unselectedValue),t.separator===E||null===t.separator?e:e.join(t.separator)},set:function(t,e){var i,n,s=t._input.find("input"),o=(Array.isArray(e)||"string"!=typeof e?Array.isArray(e)||(e=[e]):e=e.split(t.separator||"|"),e.length);s.each(function(){for(n=!1,i=0;i<o;i++)if(this._editor_val==e[i]){n=!0;break}this.checked=n}),D(s)},update:function(t,e,i){var n=C.get(t);C._addOptions(t,e,i),C.set(t,n)}}),k=w.extend(!0,{},n,{_addOptions:function(s,t,e){var o=s._input,r=0;(e=void 0===e?!1:e)?r=w("input",o).length:o.empty(),t&&P.pairs(t,s.optionsPair,function(t,e,i,n){o.append('<div><input id="'+P.safeId(s.id)+"_"+(i+r)+'" type="radio" name="'+s.name+'" /><label for="'+P.safeId(s.id)+"_"+(i+r)+'">'+e+"</label></div>"),w("input:last",o).attr("value",t)[0]._editor_val=t,n&&w("input:last",o).attr(n)})},create:function(t){return t._input=w("<div />"),k._addOptions(t,t.options||t.ipOpts),this.on("open",function(){t._input.find("input").each(function(){this._preChecked&&(this.checked=!0)})}),t._input[0]},disable:function(t){t._input.find("input").prop("disabled",!0)},enable:function(t){t._input.find("input").prop("disabled",!1)},get:function(t){var e=t._input.find("input:checked");return e.length?e[0]._editor_val:t.unselectedValue!==E?t.unselectedValue:E},set:function(t,e){t._input.find("input").each(function(){this._preChecked=!1,this._editor_val==e?(this.checked=!0,this._preChecked=!0):(this.checked=!1,this._preChecked=!1)}),D(t._input.find("input:checked"))},update:function(t,e,i){var n=k.get(t),e=(k._addOptions(t,e,i),t._input.find("input"));k.set(t,e.filter('[value="'+n+'"]').length?n:e.eq(0).attr("value"))}}),Je=w.extend(!0,{},n,{create:function(t){return t._input=w("<input />").attr(w.extend(!0,{id:P.safeId(t.id),type:"text"},t.attr)),s.DateTime||P.error("DateTime library is required",15),t._picker=new s.DateTime(t._input,w.extend({format:t.displayFormat||t.format,i18n:this.i18n.datetime},t.opts)),!(t._closeFn=function(){t._picker.hide()})===t.keyInput&&t._input.on("keydown",function(t){t.preventDefault()}),this.on("close",t._closeFn),t._input[0]},destroy:function(t){this.off("close",t._closeFn),t._input.off("keydown"),t._picker.destroy()},errorMessage:function(t,e){t._picker.errorMsg(e)},get:function(t){var e=t._input.val(),i=t._picker.c,n=c.moment;return e&&t.wireFormat&&n?n(e,i.format,i.momentLocale,i.momentStrict).format(t.wireFormat):e},maxDate:function(t,e){t._picker.max(e)},minDate:function(t,e){t._picker.min(e)},owns:function(t,e){return t._picker.owns(e)},set:function(t,e){var i=t._picker.c,n=c.moment;t._picker.val("string"==typeof e&&e&&0!==e.indexOf("--")&&t.wireFormat&&n?n(e,t.wireFormat,i.momentLocale,i.momentStrict).format(i.format):e),D(t._input)}}),Xe=w.extend(!0,{},n,{canReturnSubmit:function(t,e){return!1},create:function(e){var i=this;return Ve(i,e,function(t){Xe.set.call(i,e,t[0]),i._event("postUpload",[e.name,t[0]])})},disable:function(t){t._input.find("input").prop("disabled",!0),t._enabled=!1},enable:function(t){t._input.find("input").prop("disabled",!1),t._enabled=!0},get:function(t){return t._val},set:function(t,e){t._val=e,t._input.val("");var i=t._input,n=(t.display&&(n=i.find("div.rendered"),t._val?n.html(t.display(t._val)):n.empty().append("<span>"+(t.noFileText||"No file")+"</span>")),i.find("div.clearValue button"));e&&t.clearText?(n.html(t.clearText),i.removeClass("noClear")):i.addClass("noClear"),t._input.find("input").triggerHandler("upload.editor",[t._val])}}),F=w.extend(!0,{},n,{_showHide:function(t){t.limit&&(t._container.find("div.limitHide").css("display",t._val.length>=t.limit?"none":"block"),t._limitLeft=t.limit-t._val.length)},canReturnSubmit:function(t,e){return!1},create:function(e){var i=this,t=Ve(i,e,function(t){e._val=e._val.concat(t),F.set.call(i,e,e._val),i._event("postUpload",[e.name,e._val])},!0);return t.addClass("multi").on("click","button.remove",function(t){t.stopPropagation(),e._enabled&&(t=w(this).data("idx"),e._val.splice(t,1),F.set.call(i,e,e._val))}),e._container=t},disable:function(t){t._input.find("input").prop("disabled",!0),t._enabled=!1},enable:function(t){t._input.find("input").prop("disabled",!1),t._enabled=!0},get:function(t){return t._val},set:function(i,t){if(t=t||[],!Array.isArray(t))throw new Error("Upload collections must have an array as a value");i._val=t,i._input.val("");var n,s=this,e=i._input;i.display&&(e=e.find("div.rendered").empty(),t.length?(n=w("<ul></ul>").appendTo(e),w.each(t,function(t,e){e=i.display(e,t);null!==e&&n.append("<li>"+e+' <button class="'+s.classes.form.button+' remove" data-idx="'+t+'">&times;</button></li>')})):e.append("<span>"+(i.noFileText||"No files")+"</span>")),F._showHide(i),i._input.find("input").triggerHandler("upload.editor",[i._val])}}),O=w.extend(!0,{},n,{_addOptions:function(t,e,i){t=t.dt;(i=void 0===i?!1:i)||t.clear(),t.rows.add(e).draw()},_jumpToFirst:function(t){var e,i=t.dt.row({order:"applied",selected:!0}).index(),n=0;"number"==typeof i&&(e=t.dt.page.info().length,i=t.dt.rows({order:"applied"}).indexes().indexOf(i),n=0<e?Math.floor(i/e):0),t.dt.page(n).draw(!1)},create:function(r){var a=this,t=(r.optionsPair=w.extend({label:"label",value:"value"},r.optionsPair),w("<table>")),e=w("<div>").append(t),n=w('<div class="DTE_Field_Type_datatable_info">'),l=(r.footer&&w("<tfoot>").append(Array.isArray(r.footer)?w("<tr>").append(w.map(r.footer,function(t){return w("<th>").html(t)})):r.footer).appendTo(t),t.addClass(O.tableClass).width("100%").on("init.dt",function(t,e){var e=new s.Api(e),i=w(e.table(E).container());s.select.init(e),n.append(i.find("div.dataTables_filter")).append(i.find("div.dt-buttons")).append(i.find("div.dataTables_info"))}).DataTable(w.extend({buttons:[],columns:[{data:r.optionsPair.label,title:"Label"}],deferRender:!0,dom:"fiBtp",language:{paginate:{next:">",previous:"<"},search:"",searchPlaceholder:"Search"},lengthChange:!1,select:{style:r.multiple?"os":"single"}},r.config)));return this.on("open",function(){l.search()&&l.search("").draw(),l.columns.adjust()}),l.on("user-select",function(){D(w(r.dt.table().container()))}),r.editor&&(r.editor.table(l),r.editor.on("submitComplete",function(t,e,i,n){if("create"===n)for(var s=0,o=e.data;s<o.length;s++)!function(i){l.rows(function(t,e){return e===i}).select()}(o[s]);else"edit"!==n&&"remove"!==n||a._dataSource("refresh");O._jumpToFirst(r)})),r.dt=l,O._addOptions(r,r.options||[]),{input:e,side:n}},disable:function(t){t.dt.select.style("api"),t.dt.buttons().container().css("display","none")},dt:function(t){return t.dt},enable:function(t){t.dt.select.style(t.multiple?"os":"single"),t.dt.buttons().container().css("display","block")},get:function(t){var e=t.dt.rows({selected:!0}).data().pluck(t.optionsPair.value).toArray();return t.separator||!t.multiple?e.join(t.separator||","):e},set:function(t,n,e){t.multiple&&t.separator&&!Array.isArray(n)?n="string"==typeof n?n.split(t.separator):[]:Array.isArray(n)||(n=[n]);var s=u(t.optionsPair.value);t.dt.rows({selected:!0}).deselect(),t.dt.rows(function(t,e,i){return-1!==n.indexOf(s(e))}).select(),O._jumpToFirst(t),e||D(w(t.dt.table().container()))},tableClass:"",update:function(t,e,i){O._addOptions(t,e,i);e=t._lastSet;e!==E&&O.set(t,e,!0),D(w(t.dt.table().container()))}}),n={className:"",compare:null,data:"",def:"",entityDecode:!0,fieldInfo:"",getFormatter:null,id:"",label:"",labelInfo:"",message:"",multiEditable:!0,name:null,nullDefault:!1,setFormatter:null,submit:!0,type:"text"},$e=w.fn.dataTable,n=(A.prototype.def=function(t){var e,i=this.s.opts;return t===E?"function"==typeof(e=i.default!==E?i.default:i.def)?e():e:(i.def=t,this)},A.prototype.disable=function(){return this.dom.container.addClass(this.s.classes.disabled),this._typeFn("disable"),this},A.prototype.displayed=function(){var t=this.dom.container;return!(!t.parents("body").length||"none"===t.css("display"))},A.prototype.enable=function(t){return!1===(t=void 0===t?!0:t)?this.disable():(this.dom.container.removeClass(this.s.classes.disabled),this._typeFn("enable"),this)},A.prototype.enabled=function(){return!1===this.dom.container.hasClass(this.s.classes.disabled)},A.prototype.error=function(t,e){var i=this.s.classes;return t?this.dom.container.addClass(i.error):this.dom.container.removeClass(i.error),this._typeFn("errorMessage",t),this._msg(this.dom.fieldError,t,e)},A.prototype.fieldInfo=function(t){return this._msg(this.dom.fieldInfo,t)},A.prototype.isMultiValue=function(){return this.s.multiValue&&1!==this.s.multiIds.length},A.prototype.inError=function(){return this.dom.container.hasClass(this.s.classes.error)},A.prototype.input=function(){return this.s.type.input?this._typeFn("input"):w("input, select, textarea",this.dom.container)},A.prototype.focus=function(){return this.s.type.focus?this._typeFn("focus"):w("input, select, textarea",this.dom.container).focus(),this},A.prototype.get=function(){return this.isMultiValue()?E:this._format(this._typeFn("get"),this.s.opts.getFormatter)},A.prototype.hide=function(t){var e=this.dom.container;return t===E&&(t=!0),this.s.host.display()&&t&&w.fn.slideUp?e.slideUp():e.css("display","none"),this},A.prototype.label=function(t){var e=this.dom.label,i=this.dom.labelInfo.detach();return t===E?e.html():(e.html(t),e.append(i),this)},A.prototype.labelInfo=function(t){return this._msg(this.dom.labelInfo,t)},A.prototype.message=function(t,e){return this._msg(this.dom.fieldMessage,t,e)},A.prototype.multiGet=function(t){var e=this.s.multiValues,i=this.s.multiIds,n=this.isMultiValue();if(t===E)for(var s=this.val(),o={},r=0,a=i;r<a.length;r++){var l=a[r];o[l]=n?e[l]:s}else o=n?e[t]:this.val();return o},A.prototype.multiRestore=function(){this.s.multiValue=!0,this._multiValueCheck()},A.prototype.multiSet=function(t,i,e){void 0===e&&(e=!0);function n(t,e){-1===w.inArray(t,r)&&r.push(t),o[t]=s._format(e,s.s.opts.setFormatter)}var s=this,o=this.s.multiValues,r=this.s.multiIds;i===E&&(i=t,t=E);return w.isPlainObject(i)&&t===E?w.each(i,function(t,e){n(t,e)}):t===E?w.each(r,function(t,e){n(e,i)}):n(t,i),this.s.multiValue=!0,e&&this._multiValueCheck(),this},A.prototype.name=function(){return this.s.opts.name},A.prototype.node=function(){return this.dom.container[0]},A.prototype.nullDefault=function(){return this.s.opts.nullDefault},A.prototype.processing=function(t){return t===E?this.s.processing:(this.dom.processing.css("display",t?"block":"none"),this.s.processing=t,this.s.host.internalEvent("processing-field",[t]),this)},A.prototype.set=function(t,e){void 0===e&&(e=!0);function i(t){return"string"!=typeof t?t:t.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#163;/g,"£").replace(/&#39;/g,"'").replace(/&#10;/g,"\n")}this.s.multiValue=!1;var n=this.s.opts.entityDecode;if(n===E||!0===n)if(Array.isArray(t))for(var s=0,o=t.length;s<o;s++)t[s]=i(t[s]);else t=i(t);return!0===e?(t=this._format(t,this.s.opts.setFormatter),this._typeFn("set",t),this._multiValueCheck()):this._typeFn("set",t),this},A.prototype.show=function(t,e){return void 0===t&&(t=!0),!1===(e=void 0===e?!0:e)?this.hide(t):(e=this.dom.container,this.s.host.display()&&t&&w.fn.slideDown?e.slideDown():e.css("display",""),this)},A.prototype.update=function(t,e){return void 0===e&&(e=!1),this.s.type.update&&this._typeFn("update",t,e),this},A.prototype.val=function(t){return t===E?this.get():this.set(t)},A.prototype.compare=function(t,e){return(this.s.opts.compare||M)(t,e)},A.prototype.dataSrc=function(){return this.s.opts.data},A.prototype.destroy=function(){return this.dom.container.remove(),this._typeFn("destroy"),this},A.prototype.multiEditable=function(){return this.s.opts.multiEditable},A.prototype.multiIds=function(){return this.s.multiIds},A.prototype.multiInfoShown=function(t){this.dom.multiInfo.css({display:t?"block":"none"})},A.prototype.multiReset=function(){this.s.multiIds=[],this.s.multiValues={}},A.prototype.submittable=function(){return this.s.opts.submit},A.prototype._msg=function(t,e,i){var n;return e===E?t.html():("function"==typeof e&&(e=e(n=this.s.host,new $e.Api(n.internalSettings().table))),t.parent().is(":visible")&&w.fn.animate?(t.html(e),e?t.slideDown(i):t.slideUp(i)):(t.html(e||"").css("display",e?"block":"none"),i&&i()),this)},A.prototype._multiValueCheck=function(){var t,e,i=this.s.multiIds,n=this.s.multiValues,s=this.s.multiValue,o=this.s.opts.multiEditable,r=!1;if(i)for(var a=0;a<i.length;a++){if(e=n[i[a]],0<a&&!M(e,t)){r=!0;break}t=e}r&&s||!o&&this.isMultiValue()?(this.dom.inputControl.css({display:"none"}),this.dom.multi.css({display:"block"})):(this.dom.inputControl.css({display:"block"}),this.dom.multi.css({display:"none"}),s&&!r&&this.set(t,!1)),this.dom.multiReturn.css({display:i&&1<i.length&&r&&!s?"block":"none"});s=this.s.host.internalI18n().multi;return this.dom.multiInfo.html(o?s.info:s.noMulti),this.dom.multi.toggleClass(this.s.classes.multiNoEdit,!o),this.s.host.internalMultiInfo(),!0},A.prototype._typeFn=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];e.unshift(this.s.opts);t=this.s.type[t];if(t)return t.apply(this.s.host,e)},A.prototype._errorNode=function(){return this.dom.fieldError},A.prototype._format=function(t,e){var i,n;return e?(Array.isArray(e)&&(n=(i=e.slice()).shift(),e=A.formatters[n].apply(this,i)),e.call(this.s.host,t,this)):t},A.defaults=n,A.formatters={},A);function A(t,e,i){var n=this,s=i.internalI18n().multi,o=w.extend(!0,{},A.defaults,t);if(!P.fieldTypes[o.type])throw new Error("Error adding field - unknown field type "+o.type);this.s={classes:e,host:i,multiIds:[],multiValue:!1,multiValues:{},name:o.name,opts:o,processing:!1,type:P.fieldTypes[o.type]},o.id||(o.id="DTE_Field_"+o.name),""===o.data&&(o.data=o.name),this.valFromData=function(t){return u(o.data)(t,"editor")},this.valToData=_(o.data);var r=w('<div class="'+e.wrapper+" "+e.typePrefix+o.type+" "+e.namePrefix+o.name+" "+o.className+'"><label data-dte-e="label" class="'+e.label+'" for="'+P.safeId(o.id)+'">'+o.label+'<div data-dte-e="msg-label" class="'+e["msg-label"]+'">'+o.labelInfo+'</div></label><div data-dte-e="input" class="'+e.input+'"><div data-dte-e="input-control" class="'+e.inputControl+'"></div><div data-dte-e="multi-value" class="'+e.multiValue+'">'+s.title+'<span data-dte-e="multi-info" class="'+e.multiInfo+'">'+s.info+'</span></div><div data-dte-e="msg-multi" class="'+e.multiRestore+'">'+s.restore+'</div><div data-dte-e="msg-error" class="'+e["msg-error"]+'"></div><div data-dte-e="msg-message" class="'+e["msg-message"]+'">'+o.message+'</div><div data-dte-e="msg-info" class="'+e["msg-info"]+'">'+o.fieldInfo+'</div></div><div data-dte-e="field-processing" class="'+e.processing+'"><span></span></div></div>'),t=this._typeFn("create",o),i=null;t&&t.side&&(i=t.side,t=t.input),null!==t?a("input-control",r).prepend(t):r.css("display","none"),this.dom={container:r,fieldError:a("msg-error",r),fieldInfo:a("msg-info",r),fieldMessage:a("msg-message",r),inputControl:a("input-control",r),label:a("label",r).append(i),labelInfo:a("msg-label",r),multi:a("multi-value",r),multiInfo:a("multi-info",r),multiReturn:a("msg-multi",r),processing:a("field-processing",r)},this.dom.multi.on("click",function(){n.s.opts.multiEditable&&!r.hasClass(e.disabled)&&"readonly"!==o.type&&(n.val(""),n.focus())}),this.dom.multiReturn.on("click",function(){n.multiRestore()}),w.each(this.s.type,function(e,t){"function"==typeof t&&n[e]===E&&(n[e]=function(){var t=Array.prototype.slice.call(arguments),t=(t.unshift(e),n._typeFn.apply(n,t));return t===E?n:t})})}var Qe={action:null,className:null,tabIndex:0,text:null},Ze={close:function(){},init:function(){},node:function(){},open:function(){}},S=w.fn.dataTable.Api.register;function I(t){t=t.context[0];return t.oInit.editor||t._editor}function j(t,e,i,n){return(e=e||{}).buttons===E&&(e.buttons="_basic"),e.title===E&&(e.title=t.i18n[i].title),e.message===E&&("remove"===i?(t=t.i18n[i].confirm,e.message=1!==n?t._.replace(/%d/,n):t[1]):e.message=""),e}S("editor()",function(){return I(this)}),S("row.create()",function(t){var e=I(this);return e.create(j(e,t,"create")),this}),S("row().edit()",function(t){var e=I(this);return e.edit(this[0][0],j(e,t,"edit")),this}),S("rows().edit()",function(t){var e=I(this);return e.edit(this[0],j(e,t,"edit")),this}),S("row().delete()",function(t){var e=I(this);return e.remove(this[0][0],j(e,t,"remove",1)),this}),S("rows().delete()",function(t){var e=I(this);return e.remove(this[0],j(e,t,"remove",this[0].length)),this}),S("cell().edit()",function(t,e){return t?w.isPlainObject(t)&&(e=t,t="inline"):t="inline",I(this)[t](this[0][0],e),this}),S("cells().edit()",function(t){return I(this).bubble(this[0],t),this}),S("file()",kt),S("files()",Ft),w(y).on("xhr.dt",function(t,e,i){"dt"===t.namespace&&i&&i.files&&w.each(i.files,function(t,e){P.files[t]||(P.files[t]={}),w.extend(P.files[t],e)})});var P,S=w.fn.dataTable.ext.buttons;if(w.extend(S,{create:{action:function(t,e,i,n){var s=this,o=n.editor;this.processing(!0),o.one("preOpen",function(){s.processing(!1)}).create(w.extend({buttons:n.formButtons,message:n.formMessage||o.i18n.create.message,nest:!0,title:n.formTitle||o.i18n.create.title},n.formOptions))},className:"buttons-create",editor:null,formButtons:{action:function(t){this.submit()},text:function(t){return t.i18n.create.submit}},formMessage:null,formOptions:{},formTitle:null,text:function(t,e,i){return t.i18n("buttons.create",i.editor.i18n.create.button)}},createInline:{action:function(t,e,i,n){n.editor.inlineCreate(n.position,n.formOptions)},className:"buttons-create",editor:null,formButtons:{action:function(t){this.submit()},text:function(t){return t.i18n.create.submit}},formOptions:{},position:"start",text:function(t,e,i){return t.i18n("buttons.create",i.editor.i18n.create.button)}},edit:{action:function(t,e,i,n){var s=this,o=n.editor,r=e.rows({selected:!0}).indexes(),a=e.columns({selected:!0}).indexes(),e=e.cells({selected:!0}).indexes(),e=a.length||e.length?{cells:e,columns:a,rows:r}:r;this.processing(!0),o.one("preOpen",function(){s.processing(!1)}).edit(e,w.extend({buttons:n.formButtons,message:n.formMessage||o.i18n.edit.message,nest:!0,title:n.formTitle||o.i18n.edit.title},n.formOptions))},className:"buttons-edit",editor:null,extend:"selected",formButtons:{action:function(t){this.submit()},text:function(t){return t.i18n.edit.submit}},formMessage:null,formOptions:{},formTitle:null,text:function(t,e,i){return t.i18n("buttons.edit",i.editor.i18n.edit.button)}},remove:{action:function(t,e,i,n){var s=this,o=n.editor;this.processing(!0),o.one("preOpen",function(){s.processing(!1)}).remove(e.rows({selected:!0}).indexes(),w.extend({buttons:n.formButtons,message:n.formMessage,nest:!0,title:n.formTitle||o.i18n.remove.title},n.formOptions))},className:"buttons-remove",editor:null,extend:"selected",formButtons:{action:function(t){this.submit()},text:function(t){return t.i18n.remove.submit}},formMessage:function(t,e){e=e.rows({selected:!0}).indexes(),t=t.i18n.remove;return("string"==typeof t.confirm?t.confirm:t.confirm[e.length]||t.confirm._).replace(/%d/g,e.length)},formOptions:{},formTitle:null,limitTo:["rows"],text:function(t,e,i){return t.i18n("buttons.remove",i.editor.i18n.remove.button)}}}),S.editSingle=w.extend({},S.edit),S.editSingle.extend="selectedSingle",S.removeSingle=w.extend({},S.remove),S.removeSingle.extend="selectedSingle",t&&t.versionCheck&&t.versionCheck("1.10.20"))return R.prototype.internalEvent=function(t,e){this._event(t,e)},R.prototype.internalI18n=function(){return this.i18n},R.prototype.internalMultiInfo=function(){return this._multiInfo()},R.prototype.internalSettings=function(){return this.s},R.fieldTypes={checkbox:C,datatable:O,datetime:Je,hidden:He,password:ze,radio:k,readonly:qe,select:T,text:We,textarea:Ge,upload:Xe,uploadMany:F},R.files={},R.version="2.0.9",R.classes=X,R.Field=n,R.DateTime=null,R.error=te,R.pairs=ee,R.upload=ie,R.defaults=N,R.models={button:Qe,displayController:Ze,fieldType:Me,formOptions:e,settings:B},R.dataSources={dataTable:m,html:l},R.display={envelope:g,lightbox:x},R.safeId=function(t){return void 0===(e="")&&(e="#"),"string"==typeof(t=t)?e+t.replace(/\./g,"-"):e+t;var e},P=R,t.Editor=P,w.fn.dataTable.Editor=P,t.DateTime&&(P.DateTime=t.DateTime),t.ext.editorFields&&w.extend(P.fieldTypes,t.ext.editorFields),t.ext.editorFields=P.fieldTypes,P;throw new Error("Editor requires DataTables 1.10.20 or newer");function R(t){var n=this,s=(this.add=ot,this.ajax=rt,this.background=at,this.blur=lt,this.bubble=dt,this.bubblePosition=ut,this.buttons=ct,this.clear=ft,this.close=pt,this.create=ht,this.undependent=mt,this.dependent=vt,this.destroy=bt,this.disable=_t,this.display=yt,this.displayed=gt,this.displayNode=wt,this.edit=Et,this.enable=xt,this.error=Dt,this.field=Tt,this.fields=Ct,this.file=kt,this.files=Ft,this.get=Ot,this.hide=At,this.ids=St,this.inError=It,this.inline=jt,this.inlineCreate=Pt,this.message=Rt,this.mode=Nt,this.modifier=Bt,this.multiGet=Lt,this.multiSet=Mt,this.node=Ut,this.off=Vt,this.on=Ht,this.one=qt,this.open=Wt,this.order=zt,this.remove=Gt,this.set=Jt,this.show=Xt,this.submit=$t,this.table=Qt,this.template=Zt,this.title=Kt,this.val=Yt,this._actionClass=oe,this._ajax=re,this._animate=ae,this._assembleMain=le,this._blur=de,this._clearDynamicInfo=ue,this._close=ce,this._closeReg=fe,this._crudArgs=pe,this._dataSource=he,this._displayReorder=me,this._edit=ve,this._event=be,this._eventName=_e,this._fieldFromNode=ye,this._fieldNames=ge,this._focus=we,this._formOptions=Ee,this._inline=xe,this._optionsUpdate=De,this._message=Te,this._multiInfo=Ce,this._nestedClose=ke,this._nestedOpen=Fe,this._postopen=Oe,this._preopen=Ae,this._processing=Se,this._noProcessing=Ie,this._submit=je,this._submitTable=Pe,this._submitSuccess=Re,this._submitError=Ne,this._tidy=Be,this._weakInArray=Le,this instanceof R||alert("DataTables Editor must be initialised as a 'new' instance"),t=w.extend(!0,{},R.defaults,t),this.s=w.extend(!0,{},R.models.settings,{actionName:t.actionName,ajax:t.ajax,formOptions:t.formOptions,idSrc:t.idSrc,table:t.domTable||t.table,template:t.template?w(t.template).detach():null}),this.classes=w.extend(!0,{},R.classes),this.i18n=t.i18n,R.models.settings.unique++,this),e=this.classes,i=w('<div class="'+e.wrapper+'"><div data-dte-e="processing" class="'+e.processing.indicator+'"><span></span></div><div data-dte-e="body" class="'+e.body.wrapper+'"><div data-dte-e="body_content" class="'+e.body.content+'"></div></div><div data-dte-e="foot" class="'+e.footer.wrapper+'"><div class="'+e.footer.content+'"></div></div></div>'),o=w('<form data-dte-e="form" class="'+e.form.tag+'"><div data-dte-e="form_content" class="'+e.form.content+'"></div></form>'),r=(this.dom={body:a("body",i)[0],bodyContent:a("body_content",i)[0],buttons:w('<div data-dte-e="form_buttons" class="'+e.form.buttons+'"></div>')[0],footer:a("foot",i)[0],form:o[0],formContent:a("form_content",o)[0],formError:w('<div data-dte-e="form_error" class="'+e.form.error+'"></div>')[0],formInfo:w('<div data-dte-e="form_info" class="'+e.form.info+'"></div>')[0],header:w('<div data-dte-e="head" class="'+e.header.wrapper+'"><div class="'+e.header.content+'"></div></div>')[0],processing:a("processing",i)[0],wrapper:i[0]},w.each(t.events,function(t,i){s.on(t,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.apply(s,t)})}),this.dom,this.s.table);if(t.fields&&this.add(t.fields),w(y).on("init.dt.dte"+this.s.unique,function(t,e,i){n.s.table&&e.nTable===w(r)[0]&&(e._editor=n)}).on("i18n.dt.dte"+this.s.unique,function(t,e){n.s.table&&e.nTable===w(r)[0]&&e.oLanguage.editor&&w.extend(!0,n.i18n,e.oLanguage.editor)}).on("xhr.dt.dte"+this.s.unique,function(t,e,i){i&&n.s.table&&e.nTable===w(r)[0]&&n._optionsUpdate(i)}),!R.display[t.display])throw new Error("Cannot find display controller "+t.display);this.s.displayController=R.display[t.display].init(this),this._event("initComplete",[]),w(y).trigger("initEditor",[this])}});