/*!
 DataTables Editor v1.9.5

 Â©2012-2020 SpryMedia Ltd, all rights reserved.
 License: editor.datatables.net/license
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(e,y,z){e instanceof String&&(e=String(e));for(var u=e.length,C=0;C<u;C++){var H=e[C];if(y.call(z,H,C,e))return{i:C,v:H}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,y,z){if(e==Array.prototype||e==Object.prototype)return e;e[y]=z.value;return e};$jscomp.getGlobal=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var y=0;y<e.length;++y){var z=e[y];if(z&&z.Math==Math)return z}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(e,y){var z=$jscomp.propertyToPolyfillSymbol[y];if(null==z)return e[y];z=e[z];return void 0!==z?z:e[y]};
$jscomp.polyfill=function(e,y,z,u){y&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(e,y,z,u):$jscomp.polyfillUnisolated(e,y,z,u))};$jscomp.polyfillUnisolated=function(e,y,z,u){z=$jscomp.global;e=e.split(".");for(u=0;u<e.length-1;u++){var C=e[u];if(!(C in z))return;z=z[C]}e=e[e.length-1];u=z[e];y=y(u);y!=u&&null!=y&&$jscomp.defineProperty(z,e,{configurable:!0,writable:!0,value:y})};
$jscomp.polyfillIsolated=function(e,y,z,u){var C=e.split(".");e=1===C.length;u=C[0];u=!e&&u in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var H=0;H<C.length-1;H++){var E=C[H];if(!(E in u))return;u=u[E]}C=C[C.length-1];z=$jscomp.IS_SYMBOL_NATIVE&&"es6"===z?u[C]:null;y=y(z);null!=y&&(e?$jscomp.defineProperty($jscomp.polyfills,C,{configurable:!0,writable:!0,value:y}):y!==z&&($jscomp.propertyToPolyfillSymbol[C]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(C):$jscomp.POLYFILL_PREFIX+C,C=
$jscomp.propertyToPolyfillSymbol[C],$jscomp.defineProperty(u,C,{configurable:!0,writable:!0,value:y})))};$jscomp.polyfill("Array.prototype.find",function(e){return e?e:function(y,z){return $jscomp.findInternal(this,y,z).v}},"es6","es3");
(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(y){return e(y,window,document)}):"object"===typeof exports?module.exports=function(y,z){y||(y=window);z&&z.fn.dataTable||(z=require("datatables.net")(y,z).$);return e(z,y,y.document)}:e(jQuery,window,document)})(function(e,y,z,u){function C(a){a=a.context[0];return a.oInit.editor||a._editor}function H(a,b,d,f){b||(b={});b.buttons===u&&(b.buttons="_basic");b.title===u&&(b.title=a.i18n[d].title);b.message===
u&&("remove"===d?(a=a.i18n[d].confirm,b.message=1!==f?a._.replace(/%d/,f):a["1"]):b.message="");return b}var E=e.fn.dataTable;if(!E||!E.versionCheck||!E.versionCheck("1.10.7"))throw Error("Editor requires DataTables 1.10.7 or newer");var m=function(a){this instanceof m||alert("DataTables Editor must be initialised as a 'new' instance'");this._constructor(a)};E.Editor=m;e.fn.DataTable.Editor=m;var G=function(a,b){b===u&&(b=z);return e('*[data-dte-e="'+a+'"]',b)},U=0,M=function(a,b){var d=[];e.each(a,
function(f,h){d.push(h[b])});return d},R=function(a,b){var d=this.files(a);if(!d[b])throw"Unknown file id "+b+" in table "+a;return d[b]},S=function(a){if(!a)return m.files;var b=m.files[a];if(!b)throw"Unknown file table name: "+a;return b},T=function(a){var b=[],d;for(d in a)a.hasOwnProperty(d)&&b.push(d);return b},P=function(a,b){if("object"!==typeof a||"object"!==typeof b)return a==b;var d=T(a),f=T(b);if(d.length!==f.length)return!1;f=0;for(var h=d.length;f<h;f++){var c=d[f];if("object"===typeof a[c]){if(!P(a[c],
b[c]))return!1}else if(a[c]!=b[c])return!1}return!0};m.Field=function(a,b,d){var f=this,h=d.i18n.multi;a=e.extend(!0,{},m.Field.defaults,a);if(!m.fieldTypes[a.type])throw"Error adding field - unknown field type "+a.type;this.s=e.extend({},m.Field.settings,{type:m.fieldTypes[a.type],name:a.name,classes:b,host:d,opts:a,multiValue:!1});a.id||(a.id="DTE_Field_"+a.name);a.dataProp&&(a.data=a.dataProp);""===a.data&&(a.data=a.name);var c=E.ext.oApi;this.valFromData=function(p){return c._fnGetObjectDataFn(a.data)(p,
"editor")};this.valToData=c._fnSetObjectDataFn(a.data);var g=e('<div class="'+b.wrapper+" "+b.typePrefix+a.type+" "+b.namePrefix+a.name+" "+a.className+'"><label data-dte-e="label" class="'+b.label+'" for="'+m.safeId(a.id)+'">'+a.label+'<div data-dte-e="msg-label" class="'+b["msg-label"]+'">'+a.labelInfo+'</div></label><div data-dte-e="input" class="'+b.input+'"><div data-dte-e="input-control" class="'+b.inputControl+'"></div><div data-dte-e="multi-value" class="'+b.multiValue+'">'+h.title+'<span data-dte-e="multi-info" class="'+
b.multiInfo+'">'+h.info+'</span></div><div data-dte-e="msg-multi" class="'+b.multiRestore+'">'+h.restore+'</div><div data-dte-e="msg-error" class="'+b["msg-error"]+'"></div><div data-dte-e="msg-message" class="'+b["msg-message"]+'">'+a.message+'</div><div data-dte-e="msg-info" class="'+b["msg-info"]+'">'+a.fieldInfo+'</div></div><div data-dte-e="field-processing" class="'+b.processing+'"><span></span></div></div>');d=this._typeFn("create",a);null!==d?G("input-control",g).prepend(d):g.css("display",
"none");this.dom=e.extend(!0,{},m.Field.models.dom,{container:g,inputControl:G("input-control",g),label:G("label",g),fieldInfo:G("msg-info",g),labelInfo:G("msg-label",g),fieldError:G("msg-error",g),fieldMessage:G("msg-message",g),multi:G("multi-value",g),multiReturn:G("msg-multi",g),multiInfo:G("multi-info",g),processing:G("field-processing",g)});this.dom.multi.on("click",function(){f.s.opts.multiEditable&&!g.hasClass(b.disabled)&&"readonly"!==a.type&&(f.val(""),f.focus())});this.dom.multiReturn.on("click",
function(){f.multiRestore()});e.each(this.s.type,function(p,n){"function"===typeof n&&f[p]===u&&(f[p]=function(){var r=Array.prototype.slice.call(arguments);r.unshift(p);r=f._typeFn.apply(f,r);return r===u?f:r})})};m.Field.prototype={def:function(a){var b=this.s.opts;if(a===u)return a=b["default"]!==u?b["default"]:b.def,"function"===typeof a?a():a;b.def=a;return this},disable:function(){this.dom.container.addClass(this.s.classes.disabled);this._typeFn("disable");return this},displayed:function(){var a=
this.dom.container;return a.parents("body").length&&"none"!=a.css("display")?!0:!1},enable:function(){this.dom.container.removeClass(this.s.classes.disabled);this._typeFn("enable");return this},enabled:function(){return!1===this.dom.container.hasClass(this.s.classes.disabled)},error:function(a,b){var d=this.s.classes;a?this.dom.container.addClass(d.error):this.dom.container.removeClass(d.error);this._typeFn("errorMessage",a);return this._msg(this.dom.fieldError,a,b)},fieldInfo:function(a){return this._msg(this.dom.fieldInfo,
a)},isMultiValue:function(){return this.s.multiValue&&1!==this.s.multiIds.length},inError:function(){return this.dom.container.hasClass(this.s.classes.error)},input:function(){return this.s.type.input?this._typeFn("input"):e("input, select, textarea",this.dom.container)},focus:function(){this.s.type.focus?this._typeFn("focus"):e("input, select, textarea",this.dom.container).focus();return this},get:function(){if(this.isMultiValue())return u;var a=this._typeFn("get");return a!==u?a:this.def()},hide:function(a){var b=
this.dom.container;a===u&&(a=!0);this.s.host.display()&&a&&e.fn.slideUp?b.slideUp():b.css("display","none");return this},label:function(a){var b=this.dom.label,d=this.dom.labelInfo.detach();if(a===u)return b.html();b.html(a);b.append(d);return this},labelInfo:function(a){return this._msg(this.dom.labelInfo,a)},message:function(a,b){return this._msg(this.dom.fieldMessage,a,b)},multiGet:function(a){var b=this.s.multiValues,d=this.s.multiIds,f=this.isMultiValue();if(a===u){var h=this.val();a={};for(var c=
0;c<d.length;c++)a[d[c]]=f?b[d[c]]:h}else a=f?b[a]:this.val();return a},multiRestore:function(){this.s.multiValue=!0;this._multiValueCheck()},multiSet:function(a,b){var d=this.s.multiValues,f=this.s.multiIds;b===u&&(b=a,a=u);var h=function(c,g){-1===e.inArray(f)&&f.push(c);d[c]=g};e.isPlainObject(b)&&a===u?e.each(b,function(c,g){h(c,g)}):a===u?e.each(f,function(c,g){h(g,b)}):h(a,b);this.s.multiValue=!0;this._multiValueCheck();return this},name:function(){return this.s.opts.name},node:function(){return this.dom.container[0]},
processing:function(a){if(a===u)return"block"===this.dom.processing.css("display");this.dom.processing.css("display",a?"block":"none");this.s.host._event("processing-field",[a]);return this},set:function(a,b){var d=function(c){return"string"!==typeof c?c:c.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 f=this.s.opts.entityDecode;if(f===u||!0===f)if(Array.isArray(a)){f=
0;for(var h=a.length;f<h;f++)a[f]=d(a[f])}else a=d(a);this._typeFn("set",a);b!==u&&!0!==b||this._multiValueCheck();return this},show:function(a){var b=this.dom.container;a===u&&(a=!0);this.s.host.display()&&a&&e.fn.slideDown?b.slideDown():b.css("display","");return this},val:function(a){return a===u?this.get():this.set(a)},compare:function(a,b){return(this.s.opts.compare||P)(a,b)},dataSrc:function(){return this.s.opts.data},destroy:function(){this.dom.container.remove();this._typeFn("destroy");return this},
multiEditable:function(){return this.s.opts.multiEditable},multiIds:function(){return this.s.multiIds},multiInfoShown:function(a){this.dom.multiInfo.css({display:a?"block":"none"})},multiReset:function(){this.s.multiIds=[];this.s.multiValues={}},submittable:function(){return this.s.opts.submit},valFromData:null,valToData:null,_errorNode:function(){return this.dom.fieldError},_msg:function(a,b,d){if(b===u)return a.html();if("function"===typeof b){var f=this.s.host;b=b(f,new E.Api(f.s.table))}a.parent().is(":visible")&&
e.fn.animate?(a.html(b),b?a.slideDown(d):a.slideUp(d)):(a.html(b||"").css("display",b?"block":"none"),d&&d());return this},_multiValueCheck:function(){var a=this.s.multiIds,b=this.s.multiValues,d=this.s.multiValue,f=this.s.opts.multiEditable,h=!1;if(a)for(var c=0;c<a.length;c++){var g=b[a[c]];if(0<c&&!P(g,p)){h=!0;break}var p=g}h&&d||!f&&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"}),
d&&!h&&this.set(p,!1));this.dom.multiReturn.css({display:a&&1<a.length&&h&&!d?"block":"none"});p=this.s.host.i18n.multi;this.dom.multiInfo.html(f?p.info:p.noMulti);this.dom.multi.toggleClass(this.s.classes.multiNoEdit,!f);this.s.host._multiInfo();return!0},_typeFn:function(a){var b=Array.prototype.slice.call(arguments);b.shift();b.unshift(this.s.opts);var d=this.s.type[a];if(d)return d.apply(this.s.host,b)}};m.Field.models={};m.Field.defaults={className:"",data:"",def:"",fieldInfo:"",id:"",label:"",
labelInfo:"",name:null,type:"text",message:"",multiEditable:!0,submit:!0};m.Field.models.settings={type:null,name:null,classes:null,opts:null,host:null};m.Field.models.dom={container:null,label:null,labelInfo:null,fieldInfo:null,fieldError:null,fieldMessage:null};m.models={};m.models.displayController={init:function(a){},open:function(a,b,d){},close:function(a,b){}};m.models.fieldType={create:function(a){},get:function(a){},set:function(a,b){},enable:function(a){},disable:function(a){}};m.models.settings=
{ajaxUrl:null,ajax:null,dataSource:null,domTable:null,opts:null,displayController:null,fields:{},order:[],id:-1,displayed:!1,processing:!1,modifier:null,action:null,idSrc:null,unique:0};m.models.button={label:null,fn:null,className:null};m.models.formOptions={onReturn:"submit",onBlur:"close",onBackground:"blur",onComplete:"close",onEsc:"close",onFieldError:"focus",submit:"all",focus:0,buttons:!0,title:!0,message:!0,drawType:!1,scope:"row"};m.display={};(function(){m.display.lightbox=e.extend(!0,{},
m.models.displayController,{init:function(b){a._init();return a},open:function(b,d,f){a._shown?f&&f():(a._dte=b,b=a._dom.content,b.children().detach(),b.append(d).append(a._dom.close),a._shown=!0,a._show(f))},close:function(b,d){a._shown?(a._dte=b,a._hide(d),a._shown=!1):d&&d()},node:function(b){return a._dom.wrapper[0]},_init:function(){if(!a._ready){var b=a._dom;b.content=e("div.DTED_Lightbox_Content",a._dom.wrapper);b.wrapper.css("opacity",0);b.background.css("opacity",0)}},_show:function(b){var d=
a._dom;y.orientation!==u&&e("body").addClass("DTED_Lightbox_Mobile");d.content.css("height","auto");d.wrapper.css({top:-a.conf.offsetAni});e("body").append(a._dom.background).append(a._dom.wrapper);a._heightCalc();a._dte._animate(d.wrapper,{opacity:1,top:0},b);a._dte._animate(d.background,{opacity:1});setTimeout(function(){e("div.DTE_Footer").css("text-indent",-1)},10);d.close.attr("title",a._dte.i18n.close).bind("click.DTED_Lightbox",function(f){a._dte.close()});d.background.bind("click.DTED_Lightbox",
function(f){f.stopImmediatePropagation();a._dte.background()});e("div.DTED_Lightbox_Content_Wrapper",d.wrapper).bind("click.DTED_Lightbox",function(f){e(f.target).hasClass("DTED_Lightbox_Content_Wrapper")&&(f.stopImmediatePropagation(),a._dte.background())});e(y).bind("resize.DTED_Lightbox",function(){a._heightCalc()});a._scrollTop=e("body").scrollTop();y.orientation!==u&&(b=e("body").children().not(d.background).not(d.wrapper),e("body").append('<div class="DTED_Lightbox_Shown"></div>'),e("div.DTED_Lightbox_Shown").append(b))},
_heightCalc:function(){var b=a._dom,d=e(y).height()-2*a.conf.windowPadding-e("div.DTE_Header",b.wrapper).outerHeight()-e("div.DTE_Footer",b.wrapper).outerHeight();e("div.DTE_Body_Content",b.wrapper).css("maxHeight",d)},_hide:function(b){var d=a._dom;b||(b=function(){});if(y.orientation!==u){var f=e("div.DTED_Lightbox_Shown");f.children().appendTo("body");f.remove()}e("body").removeClass("DTED_Lightbox_Mobile").scrollTop(a._scrollTop);a._dte._animate(d.wrapper,{opacity:0,top:a.conf.offsetAni},function(){e(this).detach();
b()});a._dte._animate(d.background,{opacity:0},function(){e(this).detach()});d.close.unbind("click.DTED_Lightbox");d.background.unbind("click.DTED_Lightbox");e("div.DTED_Lightbox_Content_Wrapper",d.wrapper).unbind("click.DTED_Lightbox");e(y).unbind("resize.DTED_Lightbox")},_dte:null,_ready:!1,_shown:!1,_dom:{wrapper:e('<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>'),
background:e('<div class="DTED_Lightbox_Background"><div></div></div>'),close:e('<div class="DTED_Lightbox_Close"></div>'),content:null}});var a=m.display.lightbox;a.conf={offsetAni:25,windowPadding:25}})();(function(){m.display.envelope=e.extend(!0,{},m.models.displayController,{init:function(b){a._dte=b;a._init();return a},open:function(b,d,f){a._dte=b;e(a._dom.content).children().detach();a._dom.content.appendChild(d);a._dom.content.appendChild(a._dom.close);a._show(f)},close:function(b,d){a._dte=
b;a._hide(d)},node:function(b){return a._dom.wrapper[0]},_init:function(){a._ready||(a._dom.content=e("div.DTED_Envelope_Container",a._dom.wrapper)[0],a._dom.background.style.visbility="hidden",a._dom.background.style.display="block",a._cssBackgroundOpacity=e(a._dom.background).css("opacity"),a._dom.background.style.display="none",a._dom.background.style.visbility="visible")},_show:function(b){b||(b=function(){});z.body.appendChild(a._dom.background);z.body.appendChild(a._dom.wrapper);a._dom.content.style.height=
"auto";var d=a._dom.wrapper.style;d.opacity=0;d.display="block";var f=a._findAttachRow(),h=a._heightCalc(),c=f.offsetWidth;d.display="none";d.opacity=1;a._dom.wrapper.style.width=c+"px";a._dom.wrapper.style.marginLeft=-(c/2)+"px";a._dom.wrapper.style.top=e(f).offset().top+f.offsetHeight+"px";a._dom.content.style.top=-1*h-20+"px";a._dom.background.style.opacity=0;a._dom.background.style.display="block";e(a._dom.background).animate({opacity:a._cssBackgroundOpacity},"normal");e(a._dom.wrapper).fadeIn();
a.conf.windowScroll?e("html,body").animate({scrollTop:e(f).offset().top+f.offsetHeight-a.conf.windowPadding},function(){e(a._dom.content).animate({top:0},600,b)}):e(a._dom.content).animate({top:0},600,b);e(a._dom.close).attr("title",a._dte.i18n.close).bind("click.DTED_Envelope",function(g){a._dte.close()});e(a._dom.background).bind("click.DTED_Envelope",function(g){a._dte.background()});e("div.DTED_Lightbox_Content_Wrapper",a._dom.wrapper).bind("click.DTED_Envelope",function(g){e(g.target).hasClass("DTED_Envelope_Content_Wrapper")&&
a._dte.background()});e(y).bind("resize.DTED_Envelope",function(){a._heightCalc()})},_heightCalc:function(){a.conf.heightCalc?a.conf.heightCalc(a._dom.wrapper):e(a._dom.content).children().height();var b=e(y).height()-2*a.conf.windowPadding-e("div.DTE_Header",a._dom.wrapper).outerHeight()-e("div.DTE_Footer",a._dom.wrapper).outerHeight();e("div.DTE_Body_Content",a._dom.wrapper).css("maxHeight",b);return e(a._dte.dom.wrapper).outerHeight()},_hide:function(b){b||(b=function(){});e(a._dom.content).animate({top:-(a._dom.content.offsetHeight+
50)},600,function(){e([a._dom.wrapper,a._dom.background]).fadeOut("normal",function(){e(this).remove();b()})});e(a._dom.close).unbind("click.DTED_Lightbox");e(a._dom.background).unbind("click.DTED_Lightbox");e("div.DTED_Lightbox_Content_Wrapper",a._dom.wrapper).unbind("click.DTED_Lightbox");e(y).unbind("resize.DTED_Lightbox")},_findAttachRow:function(){var b=new e.fn.dataTable.Api(a._dte.s.table);return"head"===a.conf.attach?b.table().header():"create"===a._dte.s.action?b.table().header():b.row(a._dte.s.modifier).node()},
_dte:null,_ready:!1,_cssBackgroundOpacity:1,_dom:{wrapper:e('<div class="DTED DTED_Envelope_Wrapper"><div class="DTED_Envelope_Shadow"></div><div class="DTED_Envelope_Container"></div></div>')[0],background:e('<div class="DTED_Envelope_Background"><div></div></div>')[0],close:e('<div class="DTED_Envelope_Close">&times;</div>')[0],content:null}});var a=m.display.envelope;a.conf={windowPadding:50,heightCalc:null,attach:"row",windowScroll:!0}})();m.prototype.add=function(a,b){if(Array.isArray(a)){b!==
u&&a.reverse();for(var d=0;d<a.length;d++)this.add(a[d],b)}else{d=a.name;if(d===u)throw"Error adding field. The field requires a `name` option";if(this.s.fields[d])throw"Error adding field '"+d+"'. A field already exists with this name";this._dataSource("initField",a);var f=new m.Field(a,this.classes.field,this);this.s.mode&&(a=this.s.editFields,f.multiReset(),e.each(a,function(h,c){var g;c.data&&(g=f.valFromData(c.data));f.multiSet(h,g!==u?g:f.def())}));this.s.fields[d]=f;b===u?this.s.order.push(d):
null===b?this.s.order.unshift(d):(b=e.inArray(b,this.s.order),this.s.order.splice(b+1,0,d))}this._displayReorder(this.order());return this};m.prototype.ajax=function(a){return a?(this.s.ajax=a,this):this.s.ajax};m.prototype.background=function(){var a=this.s.editOpts.onBackground;"function"===typeof a?a(this):"blur"===a?this.blur():"close"===a?this.close():"submit"===a&&this.submit();return this};m.prototype.blur=function(){this._blur();return this};m.prototype.bubble=function(a,b,d,f){var h=this;
if(this._tidy(function(){h.bubble(a,b,f)}))return this;e.isPlainObject(b)?(f=b,b=u,d=!0):"boolean"===typeof b&&(d=b,f=b=u);e.isPlainObject(d)&&(f=d,d=!0);d===u&&(d=!0);f=e.extend({},this.s.formOptions.bubble,f);var c=this._dataSource("individual",a,b);this._edit(a,c,"bubble",f,function(){var g=h._formOptions(f);if(!h._preopen("bubble"))return h;e(y).on("resize."+g,function(){h.bubblePosition()});var p=[];h.s.bubbleNodes=p.concat.apply(p,M(c,"attach"));var n=h.classes.bubble;p=e('<div class="'+n.bg+
'"><div></div></div>');var r=e('<div class="'+n.wrapper+'"><div class="'+n.liner+'"><div class="'+n.table+'"><div class="'+n.close+'" title="'+h.i18n.close+'"></div><div class="DTE_Processing_Indicator"><span></div></div></div><div class="'+n.pointer+'"></div></div>');d&&(r.appendTo("body"),p.appendTo("body"));n=r.children().eq(0);var q=n.children(),k=q.children();n.append(h.dom.formError);q.prepend(h.dom.form);f.message&&n.prepend(h.dom.formInfo);f.title&&n.prepend(h.dom.header);f.buttons&&q.append(h.dom.buttons);
var l=e().add(r).add(p);h._closeReg(function(t){h._animate(l,{opacity:0},function(){this===r[0]&&(l.detach(),e(y).off("resize."+g),h._clearDynamicInfo(),h._event("closed",["bubble"]))})});p.click(function(){h.blur()});k.click(function(){h._close()});h.bubblePosition();h._animate(l,{opacity:1});h._focus(h.s.includeFields,f.focus);h._postopen("bubble",!0)});return this};m.prototype.bubblePosition=function(){var a=e("div.DTE_Bubble"),b=e("div.DTE_Bubble_Liner"),d=this.s.bubbleNodes,f=0,h=0,c=0,g=0;e.each(d,
function(k,l){k=e(l).offset();l=e(l).get(0);f+=k.top;h+=k.left;c+=k.left+l.offsetWidth;g+=k.top+l.offsetHeight});f/=d.length;h/=d.length;c/=d.length;g/=d.length;d=f;var p=(h+c)/2,n=b.outerWidth(),r=p-n/2;n=r+n;var q=e(y).width();a.css({top:d,left:p});b.length&&0>b.offset().top?a.css("top",g).addClass("below"):a.removeClass("below");n+15>q?b.css("left",15>r?-(r-15):-(n-q+15)):b.css("left",15>r?-(r-15):0);return this};m.prototype.buttons=function(a){var b=this;"_basic"===a?a=[{text:this.i18n[this.s.action].submit,
action:function(){this.submit()}}]:Array.isArray(a)||(a=[a]);e(this.dom.buttons).empty();e.each(a,function(d,f){"string"===typeof f&&(f={text:f,action:function(){this.submit()}});d=f.text||f.label;var h=f.action||f.fn;e("<button></button>",{"class":b.classes.form.button+(f.className?" "+f.className:"")}).html("function"===typeof d?d(b):d||"").attr("tabindex",f.tabIndex!==u?f.tabIndex:0).on("keyup",function(c){13===c.keyCode&&h&&h.call(b)}).on("keypress",function(c){13===c.keyCode&&c.preventDefault()}).on("click",
function(c){c.preventDefault();h&&h.call(b,c)}).appendTo(b.dom.buttons)});return this};m.prototype.clear=function(a){var b=this,d=this.s.fields;"string"===typeof a?(b.field(a).destroy(),delete d[a],d=e.inArray(a,this.s.order),this.s.order.splice(d,1),a=e.inArray(a,this.s.includeFields),-1!==a&&this.s.includeFields.splice(a,1)):e.each(this._fieldNames(a),function(f,h){b.clear(h)});return this};m.prototype.close=function(){this._close(!1);return this};m.prototype.create=function(a,b,d,f){var h=this,
c=this.s.fields,g=1;if(this._tidy(function(){h.create(a,b,d,f)}))return this;"number"===typeof a&&(g=a,a=b,b=d);this.s.editFields={};for(var p=0;p<g;p++)this.s.editFields[p]={fields:this.s.fields};var n=this._crudArgs(a,b,d,f);this.s.mode="main";this.s.action="create";this.s.modifier=null;this.dom.form.style.display="block";this._actionClass();this._displayReorder(this.fields());e.each(c,function(r,q){q.multiReset();for(r=0;r<g;r++)q.multiSet(r,q.def());q.set(q.def())});this._event("initCreate",null,
function(){h._assembleMain();h._formOptions(n.opts);n.maybeOpen()});return this};m.prototype.undependent=function(a){if(Array.isArray(a)){for(var b=0,d=a.length;b<d;b++)this.undependent(a[b]);return this}a=this.field(a);e(a.node()).off(".edep");return this};m.prototype.dependent=function(a,b,d){if(Array.isArray(a)){for(var f=0,h=a.length;f<h;f++)this.dependent(a[f],b,d);return this}var c=this,g=this.field(a),p={type:"POST",dataType:"json"};d=e.extend({event:"change",data:null,preUpdate:null,postUpdate:null},
d);var n=function(r){d.preUpdate&&d.preUpdate(r);e.each({labels:"label",options:"update",values:"val",messages:"message",errors:"error"},function(q,k){r[q]&&e.each(r[q],function(l,t){c.field(l)[k](t)})});e.each(["hide","show","enable","disable"],function(q,k){if(r[k])c[k](r[k],r.animate)});d.postUpdate&&d.postUpdate(r);g.processing(!1)};e(g.node()).on(d.event+".edep",function(r){if(0!==e(g.node()).find(r.target).length){g.processing(!0);r={};r.rows=c.s.editFields?M(c.s.editFields,"data"):null;r.row=
r.rows?r.rows[0]:null;r.values=c.val();if(d.data){var q=d.data(r);q&&(d.data=q)}"function"===typeof b?(r=b.call(c,g.val(),r,n))&&("object"===typeof r&&"function"===typeof r.then?r.then(function(k){k&&n(k)}):n(r)):(e.isPlainObject(b)?e.extend(p,b):p.url=b,e.ajax(e.extend(p,{url:b,data:r,success:n})))}});return this};m.prototype.destroy=function(){this.s.displayed&&this.close();this.clear();this.s.template&&e("body").append(this.s.template);var a=this.s.displayController;a.destroy&&a.destroy(this);
e(z).off(".dte"+this.s.unique);this.s=this.dom=null};m.prototype.disable=function(a){var b=this;e.each(this._fieldNames(a),function(d,f){b.field(f).disable()});return this};m.prototype.display=function(a){return a===u?this.s.displayed:this[a?"open":"close"]()};m.prototype.displayed=function(){return e.map(this.s.fields,function(a,b){return a.displayed()?b:null})};m.prototype.displayNode=function(){return this.s.displayController.node(this)};m.prototype.edit=function(a,b,d,f,h){var c=this;if(this._tidy(function(){c.edit(a,
b,d,f,h)}))return this;var g=this._crudArgs(b,d,f,h);this._edit(a,this._dataSource("fields",a),"main",g.opts,function(){c._assembleMain();c._formOptions(g.opts);g.maybeOpen()});return this};m.prototype.enable=function(a){var b=this;e.each(this._fieldNames(a),function(d,f){b.field(f).enable()});return this};m.prototype.error=function(a,b){var d=e(this.dom.wrapper);b===u?(this._message(this.dom.formError,a,!0,function(){d.toggleClass("inFormError",a!==u&&""!==a)}),this.s.globalError=a):this.field(a).error(b);
return this};m.prototype.field=function(a){var b=this.s.fields;if(!b[a])throw"Unknown field name - "+a;return b[a]};m.prototype.fields=function(){return e.map(this.s.fields,function(a,b){return b})};m.prototype.file=R;m.prototype.files=S;m.prototype.get=function(a){var b=this;a||(a=this.fields());if(Array.isArray(a)){var d={};e.each(a,function(f,h){d[h]=b.field(h).get()});return d}return this.field(a).get()};m.prototype.hide=function(a,b){var d=this;e.each(this._fieldNames(a),function(f,h){d.field(h).hide(b)});
return this};m.prototype.ids=function(a){return e.map(this.s.editFields,function(b,d){return!0===a?"#"+d:d})};m.prototype.inError=function(a){e(this.dom.formError);if(this.s.globalError)return!0;a=this._fieldNames(a);for(var b=0,d=a.length;b<d;b++)if(this.field(a[b]).inError())return!0;return!1};m.prototype.inline=function(a,b,d){var f=this;e.isPlainObject(b)&&(d=b,b=u);d=e.extend({},this.s.formOptions.inline,d);var h=this._dataSource("individual",a,b),c,g,p=0,n,r=!1,q=this.classes.inline;e.each(h,
function(k,l){if(0<p)throw"Cannot edit more than one row inline at a time";c=e(l.attach[0]);n=0;e.each(l.displayFields,function(t,v){if(0<n)throw"Cannot edit more than one field inline at a time";g=v;n++});p++});if(e("div.DTE_Field",c).length||this._tidy(function(){f.inline(a,b,d)}))return this;this._edit(a,h,"inline",d,function(){var k=f._formOptions(d);if(!f._preopen("inline"))return f;var l=c.contents().detach(),t=-1!==navigator.userAgent.indexOf("Edge/")?'style="width:'+c.width()+'px"':"";c.append(e('<div class="'+
q.wrapper+'"><div class="'+q.liner+'" '+t+'><div class="DTE_Processing_Indicator"><span></span></div></div><div class="'+q.buttons+'"></div></div>'));c.find("div."+q.liner.replace(/ /g,".")).append(g.node()).append(f.dom.formError);d.buttons&&c.find("div."+q.buttons.replace(/ /g,".")).append(f.dom.buttons);f._closeReg(function(v,w){r=!0;e(z).off("click"+k);v&&"edit"===w||(c.contents().detach(),c.append(l));f._clearDynamicInfo();return"inline"});setTimeout(function(){if(!r)e(z).on("click"+k,function(v){var w=
e.fn.addBack?"addBack":"andSelf";g._typeFn("owns",v.target)||-1!==e.inArray(c[0],e(v.target).parents()[w]())||f.blur()})},0);f._focus([g],d.focus);f._postopen("inline",!0)});return this};m.prototype.message=function(a,b){b===u?this._message(this.dom.formInfo,a):this.field(a).message(b);return this};m.prototype.mode=function(a){if(!a)return this.s.action;if(!this.s.action)throw Error("Not currently in an editing mode");if("create"===this.s.action&&"create"!==a)throw Error("Changing from create mode is not supported");
this.s.action=a;return this};m.prototype.modifier=function(){return this.s.modifier};m.prototype.multiGet=function(a){var b=this;a===u&&(a=this.fields());if(Array.isArray(a)){var d={};e.each(a,function(f,h){d[h]=b.field(h).multiGet()});return d}return this.field(a).multiGet()};m.prototype.multiSet=function(a,b){var d=this;e.isPlainObject(a)&&b===u?e.each(a,function(f,h){d.field(f).multiSet(h)}):this.field(a).multiSet(b);return this};m.prototype.node=function(a){var b=this;a||(a=this.order());return Array.isArray(a)?
e.map(a,function(d){return b.field(d).node()}):this.field(a).node()};m.prototype.off=function(a,b){e(this).off(this._eventName(a),b);return this};m.prototype.on=function(a,b){e(this).on(this._eventName(a),b);return this};m.prototype.one=function(a,b){e(this).one(this._eventName(a),b);return this};m.prototype.open=function(){var a=this;this._displayReorder();this._closeReg(function(){a.s.displayController.close(a,function(){a._clearDynamicInfo();a._event("closed",["main"])})});if(!this._preopen("main"))return this;
this.s.displayController.open(this,this.dom.wrapper,function(){a._focus(e.map(a.s.order,function(b){return a.s.fields[b]}),a.s.editOpts.focus);a._event("opened",["main",a.s.action])});this._postopen("main",!1);return this};m.prototype.order=function(a){if(!a)return this.s.order;arguments.length&&!Array.isArray(a)&&(a=Array.prototype.slice.call(arguments));if(this.s.order.slice().sort().join("-")!==a.slice().sort().join("-"))throw"All fields, and no additional fields, must be provided for ordering.";
e.extend(this.s.order,a);this._displayReorder();return this};m.prototype.remove=function(a,b,d,f,h){var c=this;if(this._tidy(function(){c.remove(a,b,d,f,h)}))return this;a.length===u&&(a=[a]);var g=this._crudArgs(b,d,f,h),p=this._dataSource("fields",a);this.s.action="remove";this.s.modifier=a;this.s.editFields=p;this.dom.form.style.display="none";this._actionClass();this._event("initRemove",[M(p,"node"),M(p,"data"),a],function(){c._event("initMultiRemove",[p,a],function(){c._assembleMain();c._formOptions(g.opts);
g.maybeOpen();var n=c.s.editOpts;null!==n.focus&&e("button",c.dom.buttons).eq(n.focus).focus()})});return this};m.prototype.set=function(a,b){var d=this;if(!e.isPlainObject(a)){var f={};f[a]=b;a=f}e.each(a,function(h,c){d.field(h).set(c)});return this};m.prototype.show=function(a,b){var d=this;e.each(this._fieldNames(a),function(f,h){d.field(h).show(b)});return this};m.prototype.submit=function(a,b,d,f){var h=this,c=this.s.fields,g=[],p=0,n=!1;if(this.s.processing||!this.s.action)return this;this._processing(!0);
var r=function(){g.length!==p||n||h._event("initSubmit",[h.s.action],function(q){!1===q?h._processing(!1):(n=!0,h._submit(a,b,d,f))})};this.error();e.each(c,function(q,k){k.inError()&&g.push(q)});e.each(g,function(q,k){c[k].error("",function(){p++;r()})});r();return this};m.prototype.template=function(a){if(a===u)return this.s.template;this.s.template=null===a?null:e(a);return this};m.prototype.title=function(a){var b=e(this.dom.header).children("div."+this.classes.header.content);if(a===u)return b.html();
"function"===typeof a&&(a=a(this,new E.Api(this.s.table)));b.html(a);return this};m.prototype.val=function(a,b){return b!==u||e.isPlainObject(a)?this.set(a,b):this.get(a)};var K=E.Api.register;K("editor()",function(){return C(this)});K("row.create()",function(a){var b=C(this);b.create(H(b,a,"create"));return this});K("row().edit()",function(a){var b=C(this);b.edit(this[0][0],H(b,a,"edit"));return this});K("rows().edit()",function(a){var b=C(this);b.edit(this[0],H(b,a,"edit"));return this});K("row().delete()",
function(a){var b=C(this);b.remove(this[0][0],H(b,a,"remove",1));return this});K("rows().delete()",function(a){var b=C(this);b.remove(this[0],H(b,a,"remove",this[0].length));return this});K("cell().edit()",function(a,b){a?e.isPlainObject(a)&&(b=a,a="inline"):a="inline";C(this)[a](this[0][0],b);return this});K("cells().edit()",function(a){C(this).bubble(this[0],a);return this});K("file()",R);K("files()",S);e(z).on("xhr.dt",function(a,b,d){"dt"===a.namespace&&d&&d.files&&e.each(d.files,function(f,h){m.files[f]||
(m.files[f]={});e.extend(m.files[f],h)})});m.error=function(a,b){throw b?a+" For more information, please refer to https://datatables.net/tn/"+b:a;};m.pairs=function(a,b,d){var f;b=e.extend({label:"label",value:"value"},b);if(Array.isArray(a)){var h=0;for(f=a.length;h<f;h++){var c=a[h];e.isPlainObject(c)?d(c[b.value]===u?c[b.label]:c[b.value],c[b.label],h,c.attr):d(c,c,h)}}else h=0,e.each(a,function(g,p){d(p,g,h);h++})};m.safeId=function(a){return a.replace(/\./g,"-")};m.upload=function(a,b,d,f,h){var c=
new FileReader,g=0,p=[];a.error(b.name,"");"function"===typeof b.ajax?b.ajax(d,function(n){h.call(a,n)}):(f(b,b.fileReadText||"<i>Uploading file</i>"),c.onload=function(n){var r=new FormData;r.append("action","upload");r.append("uploadField",b.name);r.append("upload",d[g]);b.ajaxData&&b.ajaxData(r,d[g],g);if(b.ajax)var q=b.ajax;else e.isPlainObject(a.s.ajax)?q=a.s.ajax.upload?a.s.ajax.upload:a.s.ajax:"string"===typeof a.s.ajax&&(q=a.s.ajax);if(!q)throw Error("No Ajax option specified for upload plug-in");
"string"===typeof q&&(q={url:q});if("function"===typeof q.data){n={};var k=q.data(n);k!==u&&"string"!==typeof k&&(n=k);e.each(n,function(t,v){r.append(t,v)})}else if(e.isPlainObject(q.data))throw Error("Upload feature cannot use `ajax.data` with an object. Please use it as a function instead.");if(!1===a._event("preUpload",[b.name,d[g],r]))g<d.length-1?(g++,c.readAsDataURL(d[g])):h.call(a,p);else{var l=!1;a.on("preSubmit.DTE_Upload",function(){l=!0;return!1});e.ajax(e.extend({},q,{type:"post",data:r,
dataType:"json",contentType:!1,processData:!1,xhr:function(){var t=e.ajaxSettings.xhr();t.upload&&(t.upload.onprogress=function(v){v.lengthComputable&&(v=(v.loaded/v.total*100).toFixed(0)+"%",f(b,1===d.length?v:g+":"+d.length+" "+v))},t.upload.onloadend=function(v){f(b,b.processingText||"Processing")});return t},success:function(t){a.off("preSubmit.DTE_Upload");a._event("uploadXhrSuccess",[b.name,t]);if(t.fieldErrors&&t.fieldErrors.length){t=t.fieldErrors;for(var v=0,w=t.length;v<w;v++)a.error(t[v].name,
t[v].status)}else t.error?a.error(t.error):t.upload&&t.upload.id?(t.files&&e.each(t.files,function(A,x){m.files[A]||(m.files[A]={});e.extend(m.files[A],x)}),p.push(t.upload.id),g<d.length-1?(g++,c.readAsDataURL(d[g])):(h.call(a,p),l&&a.submit())):a.error(b.name,"A server error occurred while uploading the file");f(b)},error:function(t){a.error(b.name,"A server error occurred while uploading the file");a._event("uploadXhrError",[b.name,t]);f(b)}}))}},d=e.map(d,function(n){return n}),b._limitLeft!==
u&&d.splice(b._limitLeft,d.length),c.readAsDataURL(d[0]))};m.prototype._constructor=function(a){a=e.extend(!0,{},m.defaults,a);this.s=e.extend(!0,{},m.models.settings,{actionName:a.actionName,table:a.domTable||a.table,dbTable:a.dbTable||null,ajaxUrl:a.ajaxUrl,ajax:a.ajax,idSrc:a.idSrc,dataSource:a.domTable||a.table?m.dataSources.dataTable:m.dataSources.html,formOptions:a.formOptions,legacyAjax:a.legacyAjax,template:a.template?e(a.template).detach():null});this.classes=e.extend(!0,{},m.classes);this.i18n=
a.i18n;m.models.settings.unique++;var b=this,d=this.classes;this.dom={wrapper:e('<div class="'+d.wrapper+'"><div data-dte-e="processing" class="'+d.processing.indicator+'"><span></span></div><div data-dte-e="body" class="'+d.body.wrapper+'"><div data-dte-e="body_content" class="'+d.body.content+'"></div></div><div data-dte-e="foot" class="'+d.footer.wrapper+'"><div class="'+d.footer.content+'"></div></div></div>')[0],form:e('<form data-dte-e="form" class="'+d.form.tag+'"><div data-dte-e="form_content" class="'+
d.form.content+'"></div></form>')[0],formError:e('<div data-dte-e="form_error" class="'+d.form.error+'"></div>')[0],formInfo:e('<div data-dte-e="form_info" class="'+d.form.info+'"></div>')[0],header:e('<div data-dte-e="head" class="'+d.header.wrapper+'"><div class="'+d.header.content+'"></div></div>')[0],buttons:e('<div data-dte-e="form_buttons" class="'+d.form.buttons+'"></div>')[0]};if(e.fn.dataTable.TableTools){var f=e.fn.dataTable.TableTools.BUTTONS,h=this.i18n;e.each(["create","edit","remove"],
function(g,p){f["editor_"+p].sButtonText=h[p].button})}e.each(a.events,function(g,p){b.on(g,function(){var n=Array.prototype.slice.call(arguments);n.shift();p.apply(b,n)})});d=this.dom;var c=d.wrapper;d.formContent=G("form_content",d.form)[0];d.footer=G("foot",c)[0];d.body=G("body",c)[0];d.bodyContent=G("body_content",c)[0];d.processing=G("processing",c)[0];a.fields&&this.add(a.fields);e(z).on("init.dt.dte"+this.s.unique,function(g,p,n){b.s.table&&p.nTable===e(b.s.table).get(0)&&(p._editor=b)}).on("xhr.dt.dte"+
this.s.unique,function(g,p,n){n&&b.s.table&&p.nTable===e(b.s.table).get(0)&&b._optionsUpdate(n)});try{this.s.displayController=m.display[a.display].init(this)}catch(g){throw"Cannot find display controller "+a.display;}this._event("initComplete",[]);e(z).trigger("initEditor",[this])};m.prototype._actionClass=function(){var a=this.classes.actions,b=this.s.action,d=e(this.dom.wrapper);d.removeClass([a.create,a.edit,a.remove].join(" "));"create"===b?d.addClass(a.create):"edit"===b?d.addClass(a.edit):
"remove"===b&&d.addClass(a.remove)};m.prototype._ajax=function(a,b,d,f){var h=this.s.action,c;f={type:"POST",dataType:"json",data:null,error:[function(q,k,l){c=l}],success:[],complete:[function(q,k){var l=null;if(204===q.status||"null"===q.responseText)l={};else try{l=q.responseJSON?q.responseJSON:e.parseJSON(q.responseText)}catch(t){}e.isPlainObject(l)||Array.isArray(l)?b(l,400<=q.status,q):d(q,k,c)}]};var g=this.s.ajax||this.s.ajaxUrl,p="edit"===h||"remove"===h?M(this.s.editFields,"idSrc"):null;
Array.isArray(p)&&(p=p.join(","));e.isPlainObject(g)&&g[h]&&(g=g[h]);if("function"===typeof g){var n=null;f=null;if(this.s.ajaxUrl){var r=this.s.ajaxUrl;r.create&&(n=r[h]);-1!==n.indexOf(" ")&&(h=n.split(" "),f=h[0],n=h[1]);n=n.replace(/_id_/,p)}g(f,n,a,b,d)}else"string"===typeof g?-1!==g.indexOf(" ")?(h=g.split(" "),f.type=h[0],f.url=h[1]):f.url=g:(g=e.extend({},g||{}),g.complete&&(f.complete.unshift(g.complete),delete g.complete),g.error&&(f.error.unshift(g.error),delete g.error),f=e.extend({},
f,g)),f.url=f.url.replace(/_id_/,p),f.data&&(g=(p="function"===typeof f.data)?f.data(a):f.data,a=p&&g?g:e.extend(!0,a,g)),f.data=a,"DELETE"!==f.type||f.deleteBody!==u&&!0!==f.deleteBody||(a=e.param(f.data),f.url+=-1===f.url.indexOf("?")?"?"+a:"&"+a,delete f.data),e.ajax(f)};m.prototype._animate=function(a,b,d,f){e.fn.animate?a.stop().animate(b,d,f):(a.css(b),"function"===typeof d?d.call(a):f&&f.call(a))};m.prototype._assembleMain=function(){var a=this.dom;e(a.wrapper).prepend(a.header);e(a.footer).append(a.formError).append(a.buttons);
e(a.bodyContent).append(a.formInfo).append(a.form)};m.prototype._blur=function(){var a=this.s.editOpts.onBlur;!1!==this._event("preBlur")&&("function"===typeof a?a(this):"submit"===a?this.submit():"close"===a&&this._close())};m.prototype._clearDynamicInfo=function(a){if(this.s){var b=this.classes.field.error,d=this.s.fields;a===u&&(a=!1);e("div."+b,this.dom.wrapper).removeClass(b);e.each(d,function(f,h){h.error("");a||h.message("")});this.error("");a||this.message("")}};m.prototype._close=function(a,
b){if(!1!==this._event("preClose")){if(this.s.closeCb){var d=this.s.closeCb(a,b);this.s.closeCb=null}this.s.closeIcb&&(this.s.closeIcb(),this.s.closeIcb=null);e("body").off("focus.editor-focus");this.s.displayed=!1;this._event("close");d&&this._event("closed",[d])}};m.prototype._closeReg=function(a){this.s.closeCb=a};m.prototype._crudArgs=function(a,b,d,f){var h=this;if(!e.isPlainObject(a))if("boolean"===typeof a){var c=a;a=b}else{var g=a;var p=b;c=d;a=f}c===u&&(c=!0);g&&h.title(g);p&&h.buttons(p);
return{opts:e.extend({},this.s.formOptions.main,a),maybeOpen:function(){c&&h.open()}}};m.prototype._dataSource=function(a){var b=Array.prototype.slice.call(arguments);b.shift();var d=this.s.dataSource[a];if(d)return d.apply(this,b)};m.prototype._displayReorder=function(a){var b=this,d=e(this.dom.formContent),f=this.s.fields,h=this.s.order,c=this.s.template,g=this.s.mode||"main";a?this.s.includeFields=a:a=this.s.includeFields;d.children().detach();e.each(h,function(p,n){p=n instanceof m.Field?n.name():
n;-1!==b._weakInArray(p,a)&&(c&&"main"===g?(c.find('editor-field[name="'+p+'"]').after(f[p].node()),c.find('[data-editor-template="'+p+'"]').append(f[p].node())):d.append(f[p].node()))});c&&"main"===g&&c.appendTo(d);this._event("displayOrder",[this.s.displayed,this.s.action,d])};m.prototype._edit=function(a,b,d,f,h){var c=this,g=this.s.fields,p=[],n,r={};this.s.editFields=b;this.s.editData=r;this.s.modifier=a;this.s.action="edit";this.dom.form.style.display="block";this.s.mode=d;this._actionClass();
e.each(g,function(k,l){l.multiReset();n=!1;r[k]={};e.each(b,function(t,v){if(v.fields[k]){var w=l.valFromData(v.data);r[k][t]=null===w?"":Array.isArray(w)?w.slice():w;if(!f||"row"===f.scope){if(l.multiSet(t,w!==u?w:l.def()),!v.displayFields||v.displayFields[k])n=!0}else if(!v.displayFields||v.displayFields[k])l.multiSet(t,w!==u?w:l.def()),n=!0}});0!==l.multiIds().length&&n&&p.push(k)});g=this.order().slice();for(var q=g.length-1;0<=q;q--)-1===e.inArray(g[q].toString(),p)&&g.splice(q,1);this._displayReorder(g);
this._event("initEdit",[M(b,"node")[0],M(b,"data")[0],a,d],function(){c._event("initMultiEdit",[b,a,d],function(){h()})})};m.prototype._event=function(a,b,d){b||(b=[]);if(Array.isArray(a)){d=0;for(var f=a.length;d<f;d++)this._event(a[d],b)}else return f=e.Event(a),e(this).triggerHandler(f,b),0===a.indexOf("pre")&&!1===f.result&&e(this).triggerHandler(e.Event(a+"Cancelled"),b),d&&(f.result&&"object"===typeof f.result&&f.result.then?f.result.then(d):d(f.result)),f.result};m.prototype._eventName=function(a){for(var b=
a.split(" "),d=0,f=b.length;d<f;d++){a=b[d];var h=a.match(/^on([A-Z])/);h&&(a=h[1].toLowerCase()+a.substring(3));b[d]=a}return b.join(" ")};m.prototype._fieldFromNode=function(a){var b=null;e.each(this.s.fields,function(d,f){e(f.node()).find(a).length&&(b=f)});return b};m.prototype._fieldNames=function(a){return a===u?this.fields():Array.isArray(a)?a:[a]};m.prototype._focus=function(a,b){var d=this,f;a=e.map(a,function(h){return"string"===typeof h?d.s.fields[h]:h});"number"===typeof b?f=a[b]:b?f=
0===b.indexOf("jq:")?e("div.DTE "+b.replace(/^jq:/,"")):this.s.fields[b]:z.activeElement.blur();(this.s.setFocus=f)&&f.focus()};m.prototype._formOptions=function(a){var b=this,d=U++,f=".dteInline"+d;a.closeOnComplete!==u&&(a.onComplete=a.closeOnComplete?"close":"none");a.submitOnBlur!==u&&(a.onBlur=a.submitOnBlur?"submit":"close");a.submitOnReturn!==u&&(a.onReturn=a.submitOnReturn?"submit":"none");a.blurOnBackground!==u&&(a.onBackground=a.blurOnBackground?"blur":"none");this.s.editOpts=a;this.s.editCount=
d;if("string"===typeof a.title||"function"===typeof a.title)this.title(a.title),a.title=!0;if("string"===typeof a.message||"function"===typeof a.message)this.message(a.message),a.message=!0;"boolean"!==typeof a.buttons&&(this.buttons(a.buttons),a.buttons=!0);e(z).on("keydown"+f,function(h){if(13===h.keyCode&&b.s.displayed){var c=e(z.activeElement);if(c){var g=b._fieldFromNode(c);g&&"function"===typeof g.canReturnSubmit&&g.canReturnSubmit(c)&&h.preventDefault()}}});e(z).on("keyup"+f,function(h){var c=
e(z.activeElement);if(13===h.keyCode&&b.s.displayed){var g=b._fieldFromNode(c);g&&"function"===typeof g.canReturnSubmit&&g.canReturnSubmit(c)&&("submit"===a.onReturn?(h.preventDefault(),b.submit()):"function"===typeof a.onReturn&&(h.preventDefault(),a.onReturn(b,h)))}else if(27===h.keyCode)if(h.preventDefault(),"function"===typeof a.onEsc)a.onEsc(b,h);else"blur"===a.onEsc?b.blur():"close"===a.onEsc?b.close():"submit"===a.onEsc&&b.submit();else c.parents(".DTE_Form_Buttons").length&&(37===h.keyCode?
c.prev("button").focus():39===h.keyCode&&c.next("button").focus())});this.s.closeIcb=function(){e(z).off("keydown"+f);e(z).off("keyup"+f)};return f};m.prototype._legacyAjax=function(a,b,d){if(this.s.legacyAjax&&d)if("send"===a)if("create"===b||"edit"===b){var f;e.each(d.data,function(h,c){if(f!==u)throw"Editor: Multi-row editing is not supported by the legacy Ajax data format";f=h});d.data=d.data[f];"edit"===b&&(d.id=f)}else d.id=e.map(d.data,function(h,c){return c}),delete d.data;else!d.data&&d.row?
d.data=[d.row]:d.data||(d.data=[])};m.prototype._optionsUpdate=function(a){var b=this;a.options&&e.each(this.s.fields,function(d,f){a.options[d]!==u&&(f=b.field(d))&&f.update&&f.update(a.options[d])})};m.prototype._message=function(a,b,d,f){var h=e.fn.animate?!0:!1;d===u&&(d=!1);f||(f=function(){});"function"===typeof b&&(b=b(this,new E.Api(this.s.table)));a=e(a);h&&a.stop();b?(f(),this.s.displayed&&h?a.html(b).fadeIn():a.html(b).css("display","block"),d&&a.attr("title",b)):(this.s.displayed&&h?a.fadeOut(function(){a.html("");
f()}):(a.html("").css("display","none"),f()),d&&a.removeAttr("title"))};m.prototype._multiInfo=function(){var a=this.s.fields,b=this.s.includeFields,d=!0;if(b)for(var f=0,h=b.length;f<h;f++){var c=a[b[f]];var g=c.multiEditable();c.isMultiValue()&&g&&d?(c=!0,d=!1):c=c.isMultiValue()&&!g?!0:!1;a[b[f]].multiInfoShown(c)}};m.prototype._postopen=function(a,b){var d=this,f=this.s.displayController.captureFocus;f===u&&(f=!0);e(this.dom.form).off("submit.editor-internal").on("submit.editor-internal",function(h){h.preventDefault()});
if(f&&("main"===a||"bubble"===a))e("body").on("focus.editor-focus",function(){0===e(z.activeElement).parents(".DTE").length&&0===e(z.activeElement).parents(".DTED").length&&d.s.setFocus&&d.s.setFocus.focus()});this._multiInfo();this._event("open",[a,this.s.action]);b&&this._event("opened",[a,this.s.action]);return!0};m.prototype._preopen=function(a){if(!1===this._event("preOpen",[a,this.s.action]))return this._clearDynamicInfo(),this._event("cancelOpen",[a,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=a;return!0};m.prototype._processing=function(a){var b=this.classes.processing.active;e(["div.DTE",this.dom.wrapper]).toggleClass(b,a);this.s.processing=a;this._event("processing",[a])};m.prototype._noProcessing=function(a){var b=!1;e.each(this.s.fields,function(d,f){f.processing()&&(b=!0)});if(b)this.one("processing-field",function(){!0===this._noProcessing(a)&&this._submit.apply(this,
a)});return!b};m.prototype._submit=function(a,b,d,f){var h=this,c=!1,g={},p={},n=E.ext.oApi._fnSetObjectDataFn,r=this.s.fields,q=this.s.editCount,k=this.s.editFields,l=this.s.editData,t=this.s.editOpts,v=t.submit;if(!1!==this._noProcessing(arguments)){var w=this.s.action,A={data:{}};A[this.s.actionName]=w;this.s.dbTable&&(A.table=this.s.dbTable);if("create"===w||"edit"===w)if(e.each(k,function(B,D){var F={},J={};e.each(r,function(I,N){if(D.fields[I]&&N.submittable()){var L=N.multiGet(),Q=n(I);if(L[B]===
u)I=N.valFromData(D.data),Q(F,I);else{L=L[B];var O=Array.isArray(L)&&-1!==I.indexOf("[]")?n(I.replace(/\[.*$/,"")+"-many-count"):null;Q(F,L);O&&O(F,L.length);"edit"!==w||l[I]&&N.compare(L,l[I][B])||(Q(J,L),c=!0,O&&O(J,L.length))}}});e.isEmptyObject(F)||(g[B]=F);e.isEmptyObject(J)||(p[B]=J)}),"create"===w||"all"===v||"allIfChanged"===v&&c)A.data=g;else if("changed"===v&&c)A.data=p;else{this.s.action=null;if("close"===t.onComplete&&(f===u||f))this._close(!1);else if("function"===typeof t.onComplete)t.onComplete(this);
a&&a.call(this);this._processing(!1);this._event("submitComplete");return}else"remove"===w&&e.each(k,function(B,D){A.data[B]=D.data});this._legacyAjax("send",w,A);var x=e.extend(!0,{},A);d&&d(A);!1===this._event("preSubmit",[A,w])?this._processing(!1):(this.s.ajax||this.s.ajaxUrl?this._ajax:this._submitTable).call(this,A,function(B,D,F){h._submitSuccess(B,D,A,x,h.s.action,q,f,a,b,F)},function(B,D,F){h._submitError(B,D,F,b,A,h.s.action)},A)}};m.prototype._submitTable=function(a,b,d,f){var h=a.action,
c={data:[]},g=E.ext.oApi._fnGetObjectDataFn(this.s.idSrc),p=E.ext.oApi._fnSetObjectDataFn(this.s.idSrc);if("remove"!==h){var n="main"===this.s.mode?this._dataSource("fields",this.modifier()):this._dataSource("individual",this.modifier());e.each(a.data,function(r,q){var k=e.fn.dataTableExt.oApi._fnExtend;if("edit"===h){var l=k({},n[r].data,!0);l=k(l,q,!0)}else l=k({},q,!0);q=g(l);"create"===h&&q===u?p(l,+new Date+""+r):p(l,q);c.data.push(l)})}b(c)};m.prototype._submitSuccess=function(a,b,d,f,h,c,g,
p,n,r){var q=this,k=this.s.fields,l=this.s.editOpts,t=this.s.modifier;this._legacyAjax("receive",h,a);this._event("postSubmit",[a,d,h,r]);a.error||(a.error="");a.fieldErrors||(a.fieldErrors=[]);if(b||a.error||a.fieldErrors.length){var v=[];a.error&&v.push(a.error);e.each(a.fieldErrors,function(A,x){var B=k[x.name];if(B)if(B.displayed()){if(B.error(x.status||"Error"),0===A)if("focus"===l.onFieldError)q._animate(e(q.dom.bodyContent,q.s.wrapper),{scrollTop:e(B.node()).position().top},500),B.focus();
else if("function"===typeof l.onFieldError)l.onFieldError(q,x)}else v.push(B.name()+": "+(x.status||"Error"));else throw Error("Unknown field: "+x.name);});this.error(v.join("<br>"));this._event("submitUnsuccessful",[a]);n&&n.call(q,a)}else{b={};if(!a.data||"create"!==h&&"edit"!==h)"remove"===h&&(this._dataSource("prep",h,t,f,a,b),this._event("preRemove",[a,this.ids()]),this._dataSource("remove",t,k,b),this._event(["remove","postRemove"],[a,this.ids()]),this._dataSource("commit",h,t,a.data,b));else{this._dataSource("prep",
h,t,f,a,b);for(f=0;f<a.data.length;f++){var w=a.data[f];d=this._dataSource("id",w);this._event("setData",[a,w,h]);"create"===h?(this._event("preCreate",[a,w,d]),this._dataSource("create",k,w,b),this._event(["create","postCreate"],[a,w,d])):"edit"===h&&(this._event("preEdit",[a,w,d]),this._dataSource("edit",t,k,w,b),this._event(["edit","postEdit"],[a,w,d]))}this._dataSource("commit",h,t,a.data,b)}if(c===this.s.editCount)if(h=this.s.action,this.s.action=null,"close"===l.onComplete&&(g===u||g))this._close(a.data?
!0:!1,h);else if("function"===typeof l.onComplete)l.onComplete(this);p&&p.call(q,a);this._event("submitSuccess",[a,w,h])}this._processing(!1);this._event("submitComplete",[a,w,h])};m.prototype._submitError=function(a,b,d,f,h,c){this._event("postSubmit",[null,h,c,a]);this.error(this.i18n.error.system);this._processing(!1);f&&f.call(this,a,b,d);this._event(["submitError","submitComplete"],[a,b,d,h])};m.prototype._tidy=function(a){var b=this,d=this.s.table?new e.fn.dataTable.Api(this.s.table):null,f=
!1;d&&(f=d.settings()[0].oFeatures.bServerSide);return this.s.processing?(this.one("submitComplete",function(){if(f)d.one("draw",a);else setTimeout(function(){a()},10)}),!0):"inline"===this.display()||"bubble"===this.display()?(this.one("close",function(){if(b.s.processing)b.one("submitComplete",function(h,c){if(f&&c)d.one("draw",a);else setTimeout(function(){b.s&&a()},10)});else setTimeout(function(){b.s&&a()},10)}).blur(),!0):!1};m.prototype._weakInArray=function(a,b){for(var d=0,f=b.length;d<f;d++)if(a==
b[d])return d;return-1};m.defaults={table:null,ajaxUrl:null,fields:[],display:"lightbox",ajax:null,idSrc:"DT_RowId",events:{},i18n:{close:"Close",create:{button:"New",title:"Create new entry",submit:"Create"},edit:{button:"Edit",title:"Edit entry",submit:"Update"},remove:{button:"Delete",title:"Delete",submit:"Delete",confirm:{_:"Are you sure you wish to delete %d rows?",1:"Are you sure you wish to delete 1 row?"}},error:{system:'A system error has occurred (<a target="_blank" href="//datatables.net/tn/12">More information</a>).'},
multi:{title:"Multiple values",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.",restore:"Undo changes",noMulti:"This input can be edited individually, but not part of a group."},datetime:{previous:"Previous",next:"Next",months:"January February March April May June July August September October November December".split(" "),weekdays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),
amPm:["am","pm"],hours:"Hour",minutes:"Minute",seconds:"Second",unknown:"-"}},formOptions:{bubble:e.extend({},m.models.formOptions,{title:!1,message:!1,buttons:"_basic",submit:"changed"}),inline:e.extend({},m.models.formOptions,{buttons:!1,submit:"changed"}),main:e.extend({},m.models.formOptions)},legacyAjax:!1,actionName:"action"};(function(){function a(k){var l=z;if("keyless"!==k&&(l=e('[data-editor-id="'+k+'"]'),0===l.length&&(l="string"===typeof k?e(q(k)):e(k)),0===l.length))throw"Could not find an element with `data-editor-id` or `id` of: "+
k;return l}function b(k,l){k=a(k);return e('[data-editor-field="'+l+'"]',k)}function d(k,l,t){e.each(l,function(v,w){v=w.valFromData(t);v!==u&&(w=b(k,w.dataSrc()),w.filter("[data-editor-value]").length?w.attr("data-editor-value",v):w.each(function(){for(;this.childNodes.length;)this.removeChild(this.firstChild)}).html(v))})}var f=m.dataSources={},h=function(k,l){return k.settings()[0].oFeatures.bServerSide&&"none"!==l.s.editOpts.drawType},c=function(k){k=e(k);setTimeout(function(){k.addClass("highlight");
setTimeout(function(){k.addClass("noHighlight").removeClass("highlight");setTimeout(function(){k.removeClass("noHighlight")},550)},500)},20)},g=function(k,l,t,v,w){l.rows(t).indexes().each(function(A){A=l.row(A);var x=A.data(),B=w(x);B===u&&m.error("Unable to find row identifier",14);k[B]={idSrc:B,data:x,node:A.node(),fields:v,type:"row"}})},p=function(k,l,t){k=k.settings()[0].aoColumns[t];var v=k.editField!==u?k.editField:k.mData,w={};e.each(l,function(A,x){if(Array.isArray(v))for(A=0;A<v.length;A++){var B=
x,D=v[A];B.name()===D&&(w[B.name()]=B)}else x.name()===v&&(w[x.name()]=x)});e.isEmptyObject(w)&&m.error("Unable to automatically determine field from source. Please specify the field name.",11);return w},n=function(k,l,t,v,w,A){l.cells(t).indexes().each(function(x){var B=l.cell(x),D=l.row(x.row).data();D=w(D);var F=A||p(l,v,x.column),J="object"===typeof t&&t.nodeName||t instanceof e;if(k[D]){var I=k[D].attach;var N=k[D].displayFields}g(k,l,x.row,v,w);k[D].attach=I||[];k[D].attach.push(J?e(t).get(0):
B.fixedNode?B.fixedNode():B.node());k[D].displayFields=N||{};e.extend(k[D].displayFields,F)})},r=function(k,l,t,v,w){l.cells(null,t).indexes().each(function(A){n(k,l,A,v,w)})},q=function(k){return"string"===typeof k?"#"+k.replace(/(:|\.|\[|\]|,)/g,"\\$1"):"#"+k};f.dataTable={id:function(k){return E.ext.oApi._fnGetObjectDataFn(this.s.idSrc)(k)},individual:function(k,l){var t=E.ext.oApi._fnGetObjectDataFn(this.s.idSrc),v=e(this.s.table).DataTable(),w=this.s.fields,A={};if(l){Array.isArray(l)||(l=[l]);
var x={};e.each(l,function(B,D){x[D]=w[D]})}n(A,v,k,w,t,x);return A},fields:function(k){var l=E.ext.oApi._fnGetObjectDataFn(this.s.idSrc),t=e(this.s.table).DataTable(),v=this.s.fields,w={};!e.isPlainObject(k)||k.rows===u&&k.columns===u&&k.cells===u?g(w,t,k,v,l):(k.rows!==u&&g(w,t,k.rows,v,l),k.columns!==u&&r(w,t,k.columns,v,l),k.cells!==u&&n(w,t,k.cells,v,l));return w},create:function(k,l){k=e(this.s.table).DataTable();h(k,this)||(l=k.row.add(l),c(l.node()))},edit:function(k,l,t,v){var w=this;k=e(this.s.table).DataTable();
if(!h(k,this)||"none"===this.s.editOpts.drawType){var A=f.dataTable.id.call(this,t);try{var x=k.row(q(A))}catch(B){x=k}x.any()||(x=k.row(function(B,D,F){return A==f.dataTable.id.call(w,D)}));x.any()?(k=e.fn.dataTableExt.oApi._fnExtend,l=k({},x.data(),!0),l=k(l,t,!0),x.data(l),t=e.inArray(A,v.rowIds),v.rowIds.splice(t,1)):x=k.row.add(t);c(x.node())}},remove:function(k,l,t){var v=this;l=e(this.s.table).DataTable();var w=t.cancelled;if(0===w.length)l.rows(k).remove();else{var A=[];l.rows(k).every(function(){var x=
f.dataTable.id.call(v,this.data());-1===e.inArray(x,w)&&A.push(this.index())});l.rows(A).remove()}},prep:function(k,l,t,v,w){if("edit"===k){var A=v.cancelled||[];w.rowIds=e.map(t.data,function(x,B){return e.isEmptyObject(t.data[B])||-1!==e.inArray(B,A)?u:B})}else"remove"===k&&(w.cancelled=v.cancelled||[])},commit:function(k,l,t,v){var w=this;l=e(this.s.table).DataTable();if(!h(l,this)&&"edit"===k&&v.rowIds.length){k=v.rowIds;v=function(B){return function(D,F,J){return B==f.dataTable.id.call(w,F)}};
t=0;for(var A=k.length;t<A;t++){try{var x=l.row(q(k[t]))}catch(B){x=l}x.any()||(x=l.row(v(k[t])));x.any()&&!l.settings()[0].oFeatures.bServerSide&&x.remove()}}x=this.s.editOpts.drawType;"none"!==x&&(l.draw(x),l.responsive&&l.responsive.recalc(),"function"!==typeof l.searchPanes||l.settings()[0].oFeatures.bServerSide||l.searchPanes.rebuildPane(u,!0))}};f.html={id:function(k){return E.ext.oApi._fnGetObjectDataFn(this.s.idSrc)(k)},initField:function(k){var l=e('[data-editor-label="'+(k.data||k.name)+
'"]');!k.label&&l.length&&(k.label=l.html())},individual:function(k,l){if(k instanceof e||k.nodeName){var t=k;l||(l=[e(k).attr("data-editor-field")]);var v=e.fn.addBack?"addBack":"andSelf";k=e(k).parents("[data-editor-id]")[v]().data("editor-id")}k||(k="keyless");l&&!Array.isArray(l)&&(l=[l]);if(!l||0===l.length)throw"Cannot automatically determine field name from data source";v=f.html.fields.call(this,k);var w=this.s.fields,A={};e.each(l,function(x,B){A[B]=w[B]});e.each(v,function(x,B){B.type="cell";
if(t)x=e(t);else{x=k;for(var D=l,F=e(),J=0,I=D.length;J<I;J++)F=F.add(b(x,D[J]));x=F.toArray()}B.attach=x;B.fields=w;B.displayFields=A});return v},fields:function(k){var l={},t=f.html;if(Array.isArray(k)){for(var v=0,w=k.length;v<w;v++){var A=t.fields.call(this,k[v]);l[k[v]]=A[k[v]]}return l}var x={};t=this.s.fields;k||(k="keyless");e.each(t,function(B,D){B=D.dataSrc();B=b(k,B);B=B.filter("[data-editor-value]").length?B.attr("data-editor-value"):B.html();D.valToData(x,null===B?u:B)});l[k]={idSrc:k,
data:x,node:z,fields:t,type:"row"};return l},create:function(k,l){if(l){var t=f.html.id.call(this,l);try{a(t).length&&d(t,k,l)}catch(v){}}},edit:function(k,l,t){k=f.html.id.call(this,t)||"keyless";d(k,l,t)},remove:function(k,l){a(k).remove()}}})();m.classes={wrapper:"DTE",processing:{indicator:"DTE_Processing_Indicator",active:"processing"},header:{wrapper:"DTE_Header",content:"DTE_Header_Content"},body:{wrapper:"DTE_Body",content:"DTE_Body_Content"},footer:{wrapper:"DTE_Footer",content:"DTE_Footer_Content"},
form:{wrapper:"DTE_Form",content:"DTE_Form_Content",tag:"",info:"DTE_Form_Info",error:"DTE_Form_Error",buttons:"DTE_Form_Buttons",button:"btn",buttonInternal:"btn"},field:{wrapper:"DTE_Field",typePrefix:"DTE_Field_Type_",namePrefix:"DTE_Field_Name_",label:"DTE_Label",input:"DTE_Field_Input",inputControl:"DTE_Field_InputControl",error:"DTE_Field_StateError","msg-label":"DTE_Label_Info","msg-error":"DTE_Field_Error","msg-message":"DTE_Field_Message","msg-info":"DTE_Field_Info",multiValue:"multi-value",
multiInfo:"multi-info",multiRestore:"multi-restore",multiNoEdit:"multi-noEdit",disabled:"disabled",processing:"DTE_Processing_Indicator"},actions:{create:"DTE_Action_Create",edit:"DTE_Action_Edit",remove:"DTE_Action_Remove"},inline:{wrapper:"DTE DTE_Inline",liner:"DTE_Inline_Field",buttons:"DTE_Inline_Buttons"},bubble:{wrapper:"DTE DTE_Bubble",liner:"DTE_Bubble_Liner",table:"DTE_Bubble_Table",close:"icon close",pointer:"DTE_Bubble_Triangle",bg:"DTE_Bubble_Background"}};(function(){if(E.TableTools){var a=
E.TableTools.BUTTONS,b={sButtonText:null,editor:null,formTitle:null};a.editor_create=e.extend(!0,a.text,b,{formButtons:[{label:null,fn:function(d){this.submit()}}],fnClick:function(d,f){d=f.editor;var h=d.i18n.create;f=f.formButtons;f[0].label||(f[0].label=h.submit);d.create({title:h.title,buttons:f})}});a.editor_edit=e.extend(!0,a.select_single,b,{formButtons:[{label:null,fn:function(d){this.submit()}}],fnClick:function(d,f){d=this.fnGetSelectedIndexes();if(1===d.length){var h=f.editor,c=h.i18n.edit;
f=f.formButtons;f[0].label||(f[0].label=c.submit);h.edit(d[0],{title:c.title,buttons:f})}}});a.editor_remove=e.extend(!0,a.select,b,{question:null,formButtons:[{label:null,fn:function(d){var f=this;this.submit(function(h){e.fn.dataTable.TableTools.fnGetInstance(e(f.s.table).DataTable().table().node()).fnSelectNone()})}}],fnClick:function(d,f){d=this.fnGetSelectedIndexes();if(0!==d.length){var h=f.editor,c=h.i18n.remove;f=f.formButtons;var g="string"===typeof c.confirm?c.confirm:c.confirm[d.length]?
c.confirm[d.length]:c.confirm._;f[0].label||(f[0].label=c.submit);h.remove(d,{message:g.replace(/%d/g,d.length),title:c.title,buttons:f})}}})}a=E.ext.buttons;e.extend(a,{create:{text:function(d,f,h){return d.i18n("buttons.create",h.editor.i18n.create.button)},className:"buttons-create",editor:null,formButtons:{text:function(d){return d.i18n.create.submit},action:function(d){this.submit()}},formMessage:null,formTitle:null,action:function(d,f,h,c){var g=this;d=c.editor;this.processing(!0);d.one("preOpen",
function(){g.processing(!1)}).create({buttons:c.formButtons,message:c.formMessage||d.i18n.create.message,title:c.formTitle||d.i18n.create.title})}},edit:{extend:"selected",text:function(d,f,h){return d.i18n("buttons.edit",h.editor.i18n.edit.button)},className:"buttons-edit",editor:null,formButtons:{text:function(d){return d.i18n.edit.submit},action:function(d){this.submit()}},formMessage:null,formTitle:null,action:function(d,f,h,c){var g=this;d=c.editor;h=f.rows({selected:!0}).indexes();var p=f.columns({selected:!0}).indexes();
f=f.cells({selected:!0}).indexes();f=p.length||f.length?{rows:h,columns:p,cells:f}:h;this.processing(!0);d.one("preOpen",function(){g.processing(!1)}).edit(f,{buttons:c.formButtons,message:c.formMessage||d.i18n.edit.message,title:c.formTitle||d.i18n.edit.title})}},remove:{extend:"selected",limitTo:["rows"],text:function(d,f,h){return d.i18n("buttons.remove",h.editor.i18n.remove.button)},className:"buttons-remove",editor:null,formButtons:{text:function(d){return d.i18n.remove.submit},action:function(d){this.submit()}},
formMessage:function(d,f){f=f.rows({selected:!0}).indexes();d=d.i18n.remove;return("string"===typeof d.confirm?d.confirm:d.confirm[f.length]?d.confirm[f.length]:d.confirm._).replace(/%d/g,f.length)},formTitle:null,action:function(d,f,h,c){var g=this;d=c.editor;this.processing(!0);d.one("preOpen",function(){g.processing(!1)}).remove(f.rows({selected:!0}).indexes(),{buttons:c.formButtons,message:c.formMessage,title:c.formTitle||d.i18n.remove.title})}}});a.editSingle=e.extend({},a.edit);a.editSingle.extend=
"selectedSingle";a.removeSingle=e.extend({},a.remove);a.removeSingle.extend="selectedSingle"})();m.fieldTypes={};m.DateTime=function(a,b){this.c=e.extend(!0,{},m.DateTime.defaults,b);b=this.c.classPrefix;var d=this.c.i18n;if(!y.moment&&"YYYY-MM-DD"!==this.c.format)throw"Editor datetime: Without momentjs only the format 'YYYY-MM-DD' can be used";d=e('<div class="'+b+'"><div class="'+b+'-date"><div class="'+b+'-title"><div class="'+b+'-iconLeft"><button>'+d.previous+'</button></div><div class="'+b+
'-iconRight"><button>'+d.next+'</button></div><div class="'+b+'-label"><span></span><select class="'+b+'-month"></select></div><div class="'+b+'-label"><span></span><select class="'+b+'-year"></select></div></div><div class="'+b+'-calendar"></div></div><div class="'+b+'-time"><div class="'+b+'-hours"></div><div class="'+b+'-minutes"></div><div class="'+b+'-seconds"></div></div><div class="'+b+'-error"></div></div>');this.dom={container:d,date:d.find("."+b+"-date"),title:d.find("."+b+"-title"),calendar:d.find("."+
b+"-calendar"),time:d.find("."+b+"-time"),error:d.find("."+b+"-error"),input:e(a)};this.s={d:null,display:null,minutesRange:null,secondsRange:null,namespace:"editor-dateime-"+m.DateTime._instance++,parts:{date:null!==this.c.format.match(/[YMD]|L(?!T)|l/),time:null!==this.c.format.match(/[Hhm]|LT|LTS/),seconds:-1!==this.c.format.indexOf("s"),hours12:null!==this.c.format.match(/[haA]/)}};this.dom.container.append(this.dom.date).append(this.dom.time).append(this.dom.error);this.dom.date.append(this.dom.title).append(this.dom.calendar);
this._constructor()};e.extend(m.DateTime.prototype,{destroy:function(){this._hide();this.dom.container.off().empty();this.dom.input.off(".editor-datetime")},errorMsg:function(a){var b=this.dom.error;a?b.html(a):b.empty()},hide:function(){this._hide()},max:function(a){this.c.maxDate=a;this._optionsTitle();this._setCalander()},min:function(a){this.c.minDate=a;this._optionsTitle();this._setCalander()},owns:function(a){return 0<e(a).parents().filter(this.dom.container).length},val:function(a,b){if(a===
u)return this.s.d;if(a instanceof Date)this.s.d=this._dateToUtc(a);else if(null===a||""===a)this.s.d=null;else if("--now"===a)this.s.d=new Date;else if("string"===typeof a)if(y.moment){var d=y.moment.utc(a,this.c.format,this.c.momentLocale,this.c.momentStrict);this.s.d=d.isValid()?d.toDate():null}else d=a.match(/(\d{4})\-(\d{2})\-(\d{2})/),this.s.d=d?new Date(Date.UTC(d[1],d[2]-1,d[3])):null;if(b||b===u)this.s.d?this._writeOutput():this.dom.input.val(a);this.s.d||(this.s.d=this._dateToUtc(new Date));
this.s.display=new Date(this.s.d.toString());this.s.display.setUTCDate(1);this._setTitle();this._setCalander();this._setTime()},_constructor:function(){var a=this,b=this.c.classPrefix,d=function(){a.c.onChange.call(a,a.dom.input.val(),a.s.d,a.dom.input)};this.s.parts.date||this.dom.date.css("display","none");this.s.parts.time||this.dom.time.css("display","none");this.s.parts.seconds||(this.dom.time.children("div."+b+"-seconds").remove(),this.dom.time.children("span").eq(1).remove());this._optionsTitle();
this.dom.input.attr("autocomplete","off").on("focus.editor-datetime click.editor-datetime",function(){a.dom.container.is(":visible")||a.dom.input.is(":disabled")||(a.val(a.dom.input.val(),!1),a._show())}).on("keyup.editor-datetime",function(){a.dom.container.is(":visible")&&a.val(a.dom.input.val(),!1)});this.dom.container.on("change","select",function(){var f=e(this),h=f.val();f.hasClass(b+"-month")?(a._correctMonth(a.s.display,h),a._setTitle(),a._setCalander()):f.hasClass(b+"-year")?(a.s.display.setUTCFullYear(h),
a._setTitle(),a._setCalander()):f.hasClass(b+"-hours")||f.hasClass(b+"-ampm")?(a.s.parts.hours12?(f=1*e(a.dom.container).find("."+b+"-hours").val(),h="pm"===e(a.dom.container).find("."+b+"-ampm").val(),a.s.d.setUTCHours(12!==f||h?h&&12!==f?f+12:f:0)):a.s.d.setUTCHours(h),a._setTime(),a._writeOutput(!0),d()):f.hasClass(b+"-minutes")?(a.s.d.setUTCMinutes(h),a._setTime(),a._writeOutput(!0),d()):f.hasClass(b+"-seconds")&&(a.s.d.setSeconds(h),a._setTime(),a._writeOutput(!0),d());a.dom.input.focus();a._position()}).on("click",
function(f){var h=a.s.d,c=f.target.nodeName.toLowerCase(),g="span"===c?f.target.parentNode:f.target;c=g.nodeName.toLowerCase();if("select"!==c)if(f.stopPropagation(),"button"===c)if(g=e(g),f=g.parent(),f.hasClass("disabled")&&!f.hasClass("range"))g.blur();else if(f.hasClass(b+"-iconLeft"))a.s.display.setUTCMonth(a.s.display.getUTCMonth()-1),a._setTitle(),a._setCalander(),a.dom.input.focus();else if(f.hasClass(b+"-iconRight"))a._correctMonth(a.s.display,a.s.display.getUTCMonth()+1),a._setTitle(),a._setCalander(),
a.dom.input.focus();else{if(g.parents("."+b+"-time").length){c=g.data("value");g=g.data("unit");if("minutes"===g){if(f.hasClass("disabled")&&f.hasClass("range")){a.s.minutesRange=c;a._setTime();return}a.s.minutesRange=null}if("seconds"===g){if(f.hasClass("disabled")&&f.hasClass("range")){a.s.secondsRange=c;a._setTime();return}a.s.secondsRange=null}if("am"===c)if(12<=h.getUTCHours())c=h.getUTCHours()-12;else return;else if("pm"===c)if(12>h.getUTCHours())c=h.getUTCHours()+12;else return;h["hours"===
g?"setUTCHours":"minutes"===g?"setUTCMinutes":"setSeconds"](c);a._setTime();a._writeOutput(!0)}else h||(h=a._dateToUtc(new Date)),h.setUTCDate(1),h.setUTCFullYear(g.data("year")),h.setUTCMonth(g.data("month")),h.setUTCDate(g.data("day")),a._writeOutput(!0),a.s.parts.time?a._setCalander():setTimeout(function(){a._hide()},10);d()}else a.dom.input.focus()})},_compareDates:function(a,b){return this._dateToUtcString(a)===this._dateToUtcString(b)},_correctMonth:function(a,b){var d=this._daysInMonth(a.getUTCFullYear(),
b),f=a.getUTCDate()>d;a.setUTCMonth(b);f&&(a.setUTCDate(d),a.setUTCMonth(b))},_daysInMonth:function(a,b){return[31,0!==a%4||0===a%100&&0!==a%400?28:29,31,30,31,30,31,31,30,31,30,31][b]},_dateToUtc:function(a){return new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds()))},_dateToUtcString:function(a){return a.getUTCFullYear()+"-"+this._pad(a.getUTCMonth()+1)+"-"+this._pad(a.getUTCDate())},_hide:function(){var a=this.s.namespace;this.dom.container.detach();
e(y).off("."+a);e(z).off("keydown."+a);e("div.dataTables_scrollBody").off("scroll."+a);e("div.DTE_Body_Content").off("scroll."+a);e("body").off("click."+a)},_hours24To12:function(a){return 0===a?12:12<a?a-12:a},_htmlDay:function(a){if(a.empty)return'<td class="empty"></td>';var b=["selectable"],d=this.c.classPrefix;a.disabled&&b.push("disabled");a.today&&b.push("now");a.selected&&b.push("selected");return'<td data-day="'+a.day+'" class="'+b.join(" ")+'"><button class="'+d+"-button "+d+'-day" type="button" data-year="'+
a.year+'" data-month="'+a.month+'" data-day="'+a.day+'"><span>'+a.day+"</span></button></td>"},_htmlMonth:function(a,b){var d=this._dateToUtc(new Date),f=this._daysInMonth(a,b),h=(new Date(Date.UTC(a,b,1))).getUTCDay(),c=[],g=[];0<this.c.firstDay&&(h-=this.c.firstDay,0>h&&(h+=7));for(var p=f+h,n=p;7<n;)n-=7;p+=7-n;var r=this.c.minDate;n=this.c.maxDate;r&&(r.setUTCHours(0),r.setUTCMinutes(0),r.setSeconds(0));n&&(n.setUTCHours(23),n.setUTCMinutes(59),n.setSeconds(59));for(var q=0,k=0;q<p;q++){var l=
new Date(Date.UTC(a,b,1+(q-h))),t=this.s.d?this._compareDates(l,this.s.d):!1,v=this._compareDates(l,d),w=q<h||q>=f+h,A=r&&l<r||n&&l>n,x=this.c.disableDays;Array.isArray(x)&&-1!==e.inArray(l.getUTCDay(),x)?A=!0:"function"===typeof x&&!0===x(l)&&(A=!0);g.push(this._htmlDay({day:1+(q-h),month:b,year:a,selected:t,today:v,disabled:A,empty:w}));7===++k&&(this.c.showWeekNumber&&g.unshift(this._htmlWeekOfYear(q-h,b,a)),c.push("<tr>"+g.join("")+"</tr>"),g=[],k=0)}d=this.c.classPrefix;f=d+"-table";this.c.showWeekNumber&&
(f+=" weekNumber");r&&(r=r>=new Date(Date.UTC(a,b,1,0,0,0)),this.dom.title.find("div."+d+"-iconLeft").css("display",r?"none":"block"));n&&(a=n<new Date(Date.UTC(a,b+1,1,0,0,0)),this.dom.title.find("div."+d+"-iconRight").css("display",a?"none":"block"));return'<table class="'+f+'"><thead>'+this._htmlMonthHead()+"</thead><tbody>"+c.join("")+"</tbody></table>"},_htmlMonthHead:function(){var a=[],b=this.c.firstDay,d=this.c.i18n,f=function(c){for(c+=b;7<=c;)c-=7;return d.weekdays[c]};this.c.showWeekNumber&&
a.push("<th></th>");for(var h=0;7>h;h++)a.push("<th>"+f(h)+"</th>");return a.join("")},_htmlWeekOfYear:function(a,b,d){a=new Date(d,b,a,0,0,0,0);a.setDate(a.getDate()+4-(a.getDay()||7));return'<td class="'+this.c.classPrefix+'-week">'+Math.ceil(((a-new Date(d,0,1))/864E5+1)/7)+"</td>"},_options:function(a,b,d){d||(d=b);a=this.dom.container.find("select."+this.c.classPrefix+"-"+a);a.empty();for(var f=0,h=b.length;f<h;f++)a.append('<option value="'+b[f]+'">'+d[f]+"</option>")},_optionSet:function(a,
b){var d=this.dom.container.find("select."+this.c.classPrefix+"-"+a);a=d.parent().children("span");d.val(b);b=d.find("option:selected");a.html(0!==b.length?b.text():this.c.i18n.unknown)},_optionsTime:function(a,b,d,f,h){var c=this.c.classPrefix,g=this.dom.container.find("div."+c+"-"+a),p=12===b?function(v){return v}:this._pad;c=this.c.classPrefix;var n=c+"-table",r=this.c.i18n;if(g.length){var q="";var k=10;var l=function(v,w,A){12===b&&"number"===typeof v&&(12<=d&&(v+=12),12==v?v=0:24==v&&(v=12));
var x=d===v||"am"===v&&12>d||"pm"===v&&12<=d?"selected":"";f&&-1===e.inArray(v,f)&&(x+=" disabled");A&&(x+=" "+A);return'<td class="selectable '+x+'"><button class="'+c+"-button "+c+'-day" type="button" data-unit="'+a+'" data-value="'+v+'"><span>'+w+"</span></button></td>"};if(12===b){q+="<tr>";for(h=1;6>=h;h++)q+=l(h,p(h));q+=l("am",r.amPm[0]);q+="</tr><tr>";for(h=7;12>=h;h++)q+=l(h,p(h));q+=l("pm",r.amPm[1]);q+="</tr>";k=7}else{if(24===b){var t=0;for(k=0;4>k;k++){q+="<tr>";for(h=0;6>h;h++)q+=l(t,
p(t)),t++;q+="</tr>"}}else{q+="<tr>";for(k=0;60>k;k+=10)q+=l(k,p(k),"range");h=null!==h?h:10*Math.floor(d/10);q=q+'</tr></tbody></thead><table class="'+(n+" "+n+'-nospace"><tbody><tr>');for(k=h+1;k<h+10;k++)q+=l(k,p(k));q+="</tr>"}k=6}g.empty().append('<table class="'+n+'"><thead><tr><th colspan="'+k+'">'+r[a]+"</th></tr></thead><tbody>"+q+"</tbody></table>")}},_optionsTitle:function(){var a=this.c.i18n,b=this.c.minDate,d=this.c.maxDate;b=b?b.getFullYear():null;d=d?d.getFullYear():null;b=null!==b?
b:(new Date).getFullYear()-this.c.yearRange;d=null!==d?d:(new Date).getFullYear()+this.c.yearRange;this._options("month",this._range(0,11),a.months);this._options("year",this._range(b,d))},_pad:function(a){return 10>a?"0"+a:a},_position:function(){var a=this.dom.input.offset(),b=this.dom.container,d=this.dom.input.outerHeight();this.s.parts.date&&this.s.parts.time&&550<e(y).width()?b.addClass("horizontal"):b.removeClass("horizontal");b.css({top:a.top+d,left:a.left}).appendTo("body");var f=b.outerHeight(),
h=b.outerWidth(),c=e(y).scrollTop();a.top+d+f-c>e(y).height()&&(d=a.top-f,b.css("top",0>d?0:d));h+a.left>e(y).width()&&(a=e(y).width()-h,b.css("left",0>a?0:a))},_range:function(a,b,d){var f=[];for(d||(d=1);a<=b;a+=d)f.push(a);return f},_setCalander:function(){this.s.display&&this.dom.calendar.empty().append(this._htmlMonth(this.s.display.getUTCFullYear(),this.s.display.getUTCMonth()))},_setTitle:function(){this._optionSet("month",this.s.display.getUTCMonth());this._optionSet("year",this.s.display.getUTCFullYear())},
_setTime:function(){var a=this,b=this.s.d,d=b?b.getUTCHours():0,f=function(h){return a.c[h+"Available"]?a.c[h+"Available"]:a._range(0,59,a.c[h+"Increment"])};this._optionsTime("hours",this.s.parts.hours12?12:24,d,this.c.hoursAvailable);this._optionsTime("minutes",60,b?b.getUTCMinutes():0,f("minutes"),this.s.minutesRange);this._optionsTime("seconds",60,b?b.getSeconds():0,f("seconds"),this.s.secondsRange)},_show:function(){var a=this,b=this.s.namespace;this._position();e(y).on("scroll."+b+" resize."+
b,function(){a._hide()});e("div.DTE_Body_Content").on("scroll."+b,function(){a._hide()});e("div.dataTables_scrollBody").on("scroll."+b,function(){a._hide()});e(z).on("keydown."+b,function(d){9!==d.keyCode&&27!==d.keyCode&&13!==d.keyCode||a._hide()});setTimeout(function(){e("body").on("click."+b,function(d){e(d.target).parents().filter(a.dom.container).length||d.target===a.dom.input[0]||a._hide()})},10)},_writeOutput:function(a){var b=this.s.d,d=y.moment?y.moment.utc(b,u,this.c.momentLocale,this.c.momentStrict).format(this.c.format):
b.getUTCFullYear()+"-"+this._pad(b.getUTCMonth()+1)+"-"+this._pad(b.getUTCDate());this.dom.input.val(d).trigger("change",{write:b});a&&this.dom.input.focus()}});m.DateTime._instance=0;m.DateTime.defaults={classPrefix:"editor-datetime",disableDays:null,firstDay:1,format:"YYYY-MM-DD",hoursAvailable:null,i18n:m.defaults.i18n.datetime,maxDate:null,minDate:null,minutesAvailable:null,minutesIncrement:1,momentStrict:!0,momentLocale:"en",onChange:function(){},secondsAvailable:null,secondsIncrement:1,showWeekNumber:!1,
yearRange:25};(function(){function a(c,g){if(null===g||g===u)g=c.uploadText||"Choose file...";c._input.find("div.upload button").html(g)}function b(c,g,p,n){var r=c.classes.form.buttonInternal,q=e('<div class="editor_upload"><div class="eu_table"><div class="row"><div class="cell upload limitHide"><button class="'+r+'"></button><input type="file" '+(n?"multiple":"")+'></input></div><div class="cell clearValue"><button class="'+r+'"></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>');
g._input=q;g._enabled=!0;g.id&&q.find("input[type=file]").attr("id",m.safeId(g.id));g.attr&&q.find("input[type=file]").attr(g.attr);a(g);if(y.FileReader&&!1!==g.dragDrop){q.find("div.drop span").text(g.dragDropText||"Drag and drop a file here to upload");var k=q.find("div.drop");k.on("drop",function(l){g._enabled&&(m.upload(c,g,l.originalEvent.dataTransfer.files,a,p),k.removeClass("over"));return!1}).on("dragleave dragexit",function(l){g._enabled&&k.removeClass("over");return!1}).on("dragover",function(l){g._enabled&&
k.addClass("over");return!1});c.on("open",function(){e("body").on("dragover.DTE_Upload drop.DTE_Upload",function(l){return!1})}).on("close",function(){e("body").off("dragover.DTE_Upload drop.DTE_Upload")})}else q.addClass("noDrop"),q.append(q.find("div.rendered"));q.find("div.clearValue button").on("click",function(l){l.preventDefault();g._enabled&&m.fieldTypes.upload.set.call(c,g,"")});q.find("input[type=file]").on("input",function(){m.upload(c,g,this.files,a,function(l){p.call(c,l);q.find("input[type=file]")[0].value=
null})});return q}function d(c){setTimeout(function(){c.trigger("change",{editor:!0,editorSet:!0})},0)}var f=m.fieldTypes,h=e.extend(!0,{},m.models.fieldType,{get:function(c){return c._input.val()},set:function(c,g){c._input.val(g);d(c._input)},enable:function(c){c._input.prop("disabled",!1)},disable:function(c){c._input.prop("disabled",!0)},canReturnSubmit:function(c,g){return!0}});f.hidden={create:function(c){c._val=c.value;return null},get:function(c){return c._val},set:function(c,g){c._val=g}};
f.readonly=e.extend(!0,{},h,{create:function(c){c._input=e("<input/>").attr(e.extend({id:m.safeId(c.id),type:"text",readonly:"readonly"},c.attr||{}));return c._input[0]}});f.text=e.extend(!0,{},h,{create:function(c){c._input=e("<input/>").attr(e.extend({id:m.safeId(c.id),type:"text"},c.attr||{}));return c._input[0]}});f.password=e.extend(!0,{},h,{create:function(c){c._input=e("<input/>").attr(e.extend({id:m.safeId(c.id),type:"password"},c.attr||{}));return c._input[0]}});f.textarea=e.extend(!0,{},
h,{create:function(c){c._input=e("<textarea></textarea>").attr(e.extend({id:m.safeId(c.id)},c.attr||{}));return c._input[0]},canReturnSubmit:function(c,g){return!1}});f.select=e.extend(!0,{},h,{_addOptions:function(c,g,p){var n=c._input[0].options,r=0;if(p)r=n.length;else if(n.length=0,c.placeholder!==u){p=c.placeholderValue!==u?c.placeholderValue:"";r+=1;n[0]=new Option(c.placeholder,p);var q=c.placeholderDisabled!==u?c.placeholderDisabled:!0;n[0].hidden=q;n[0].disabled=q;n[0]._editor_val=p}g&&m.pairs(g,
c.optionsPair,function(k,l,t,v){l=new Option(l,k);l._editor_val=k;v&&e(l).attr(v);n[t+r]=l})},create:function(c){c._input=e("<select></select>").attr(e.extend({id:m.safeId(c.id),multiple:!0===c.multiple},c.attr||{})).on("change.dte",function(g,p){p&&p.editor||(c._lastSet=f.select.get(c))});f.select._addOptions(c,c.options||c.ipOpts);return c._input[0]},update:function(c,g,p){f.select._addOptions(c,g,p);g=c._lastSet;g!==u&&f.select.set(c,g,!0);d(c._input)},get:function(c){var g=c._input.find("option:selected").map(function(){return this._editor_val}).toArray();
return c.multiple?c.separator?g.join(c.separator):g:g.length?g[0]:null},set:function(c,g,p){p||(c._lastSet=g);c.multiple&&c.separator&&!Array.isArray(g)?g="string"===typeof g?g.split(c.separator):[]:Array.isArray(g)||(g=[g]);var n,r=g.length,q,k=!1,l=c._input.find("option");c._input.find("option").each(function(){q=!1;for(n=0;n<r;n++)if(this._editor_val==g[n]){k=q=!0;break}this.selected=q});c.placeholder&&!k&&!c.multiple&&l.length&&(l[0].selected=!0);p||d(c._input);return k},destroy:function(c){c._input.off("change.dte")}});
f.checkbox=e.extend(!0,{},h,{_addOptions:function(c,g,p){var n=c._input,r=0;p?r=e("input",n).length:n.empty();g&&m.pairs(g,c.optionsPair,function(q,k,l,t){n.append('<div><input id="'+m.safeId(c.id)+"_"+(l+r)+'" type="checkbox" /><label for="'+m.safeId(c.id)+"_"+(l+r)+'">'+k+"</label></div>");e("input:last",n).attr("value",q)[0]._editor_val=q;t&&e("input:last",n).attr(t)})},create:function(c){c._input=e("<div></div>");f.checkbox._addOptions(c,c.options||c.ipOpts);return c._input[0]},get:function(c){var g=
[],p=c._input.find("input:checked");p.length?p.each(function(){g.push(this._editor_val)}):c.unselectedValue!==u&&g.push(c.unselectedValue);return c.separator===u||null===c.separator?g:g.join(c.separator)},set:function(c,g){var p=c._input.find("input");Array.isArray(g)||"string"!==typeof g?Array.isArray(g)||(g=[g]):g=g.split(c.separator||"|");var n,r=g.length,q;p.each(function(){q=!1;for(n=0;n<r;n++)if(this._editor_val==g[n]){q=!0;break}this.checked=q});d(p)},enable:function(c){c._input.find("input").prop("disabled",
!1)},disable:function(c){c._input.find("input").prop("disabled",!0)},update:function(c,g,p){var n=f.checkbox,r=n.get(c);n._addOptions(c,g,p);n.set(c,r)}});f.radio=e.extend(!0,{},h,{_addOptions:function(c,g,p){var n=c._input,r=0;p?r=e("input",n).length:n.empty();g&&m.pairs(g,c.optionsPair,function(q,k,l,t){n.append('<div><input id="'+m.safeId(c.id)+"_"+(l+r)+'" type="radio" name="'+c.name+'" /><label for="'+m.safeId(c.id)+"_"+(l+r)+'">'+k+"</label></div>");e("input:last",n).attr("value",q)[0]._editor_val=
q;t&&e("input:last",n).attr(t)})},create:function(c){c._input=e("<div />");f.radio._addOptions(c,c.options||c.ipOpts);this.on("open",function(){c._input.find("input").each(function(){this._preChecked&&(this.checked=!0)})});return c._input[0]},get:function(c){c=c._input.find("input:checked");return c.length?c[0]._editor_val:u},set:function(c,g){c._input.find("input").each(function(){this._preChecked=!1;this._preChecked=this._editor_val==g?this.checked=!0:this.checked=!1});d(c._input.find("input:checked"))},
enable:function(c){c._input.find("input").prop("disabled",!1)},disable:function(c){c._input.find("input").prop("disabled",!0)},update:function(c,g,p){var n=f.radio,r=n.get(c);n._addOptions(c,g,p);g=c._input.find("input");n.set(c,g.filter('[value="'+r+'"]').length?r:g.eq(0).attr("value"))}});f.date=e.extend(!0,{},h,{create:function(c){c._input=e("<input />").attr(e.extend({id:m.safeId(c.id),type:"text"},c.attr));e.datepicker?(c._input.addClass("jqueryui"),c.dateFormat||(c.dateFormat=e.datepicker.RFC_2822),
setTimeout(function(){e(c._input).datepicker(e.extend({dateFormat:c.dateFormat,buttonImage:c.dateImage,buttonImageOnly:!0,onSelect:function(){c._input.focus().click()}},c.opts));e("#ui-datepicker-div").css("display","none")},10)):c._input.attr("type","date");return c._input[0]},set:function(c,g){e.datepicker&&c._input.hasClass("hasDatepicker")?c._input.datepicker("setDate",g).change():e(c._input).val(g)},enable:function(c){e.datepicker?c._input.datepicker("enable"):e(c._input).prop("disabled",!1)},
disable:function(c){e.datepicker?c._input.datepicker("disable"):e(c._input).prop("disabled",!0)},owns:function(c,g){return e(g).parents("div.ui-datepicker").length||e(g).parents("div.ui-datepicker-header").length?!0:!1}});f.datetime=e.extend(!0,{},h,{create:function(c){c._input=e("<input />").attr(e.extend(!0,{id:m.safeId(c.id),type:"text"},c.attr));c._picker=new m.DateTime(c._input,e.extend({format:c.displayFormat||c.format,i18n:this.i18n.datetime},c.opts));c._closeFn=function(){c._picker.hide()};
if(!1===c.keyInput)c._input.on("keydown",function(g){g.preventDefault()});this.on("close",c._closeFn);return c._input[0]},get:function(c){var g=c._input.val(),p=c._picker.c;return g&&c.wireFormat&&moment?moment(g,p.format,p.momentLocale,p.momentStrict).format(c.wireFormat):g},set:function(c,g){var p=c._picker.c;c._picker.val(g&&c.wireFormat&&moment?moment(g,c.wireFormat,p.momentLocale,p.momentStrict).format(p.format):g);d(c._input)},owns:function(c,g){return c._picker.owns(g)},errorMessage:function(c,
g){c._picker.errorMsg(g)},destroy:function(c){this.off("close",c._closeFn);c._input.off("keydown");c._picker.destroy()},minDate:function(c,g){c._picker.min(g)},maxDate:function(c,g){c._picker.max(g)}});f.upload=e.extend(!0,{},h,{create:function(c){var g=this;return b(g,c,function(p){m.fieldTypes.upload.set.call(g,c,p[0]);g._event("postUpload",[c.name,p[0]])})},get:function(c){return c._val},set:function(c,g){c._val=g;var p=c._input;if(c.display){var n=p.find("div.rendered");c._val?n.html(c.display(c._val)):
n.empty().append("<span>"+(c.noFileText||"No file")+"</span>")}n=p.find("div.clearValue button");g&&c.clearText?(n.html(c.clearText),p.removeClass("noClear")):p.addClass("noClear");c._input.find("input").triggerHandler("upload.editor",[c._val])},enable:function(c){c._input.find("input").prop("disabled",!1);c._enabled=!0},disable:function(c){c._input.find("input").prop("disabled",!0);c._enabled=!1},canReturnSubmit:function(c,g){return!1}});f.uploadMany=e.extend(!0,{},h,{_showHide:function(c){c.limit&&
(c._container.find("div.limitHide").css("display",c._val.length>=c.limit?"none":"block"),c._limitLeft=c.limit-c._val.length)},create:function(c){var g=this,p=b(g,c,function(n){c._val=c._val.concat(n);m.fieldTypes.uploadMany.set.call(g,c,c._val);g._event("postUpload",[c.name,c._val])},!0);p.addClass("multi").on("click","button.remove",function(n){n.stopPropagation();c._enabled&&(n=e(this).data("idx"),c._val.splice(n,1),m.fieldTypes.uploadMany.set.call(g,c,c._val))});return c._container=p},get:function(c){return c._val},
set:function(c,g){g||(g=[]);if(!Array.isArray(g))throw"Upload collections must have an array as a value";c._val=g;var p=this,n=c._input;if(c.display)if(n=n.find("div.rendered").empty(),g.length){var r=e("<ul></ul>").appendTo(n);e.each(g,function(q,k){r.append("<li>"+c.display(k,q)+' <button class="'+p.classes.form.button+' remove" data-idx="'+q+'">&times;</button></li>')})}else n.append("<span>"+(c.noFileText||"No files")+"</span>");m.fieldTypes.uploadMany._showHide(c);c._input.find("input").triggerHandler("upload.editor",
[c._val])},enable:function(c){c._input.find("input").prop("disabled",!1);c._enabled=!0},disable:function(c){c._input.find("input").prop("disabled",!0);c._enabled=!1},canReturnSubmit:function(c,g){return!1}})})();E.ext.editorFields&&e.extend(m.fieldTypes,E.ext.editorFields);E.ext.editorFields=m.fieldTypes;m.files={};m.prototype.CLASS="Editor";m.version="1.9.5";return m});