!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 (More information).'},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'),n=[],s=[],o={},r=0,a=e.columns(":visible").count();r").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')[0],close:w('')[0],content:null,wrapper:w('')[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(''),close:w(''),content:null,wrapper:w('')};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'),n=w(''),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",{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;lUploading file"),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')),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")),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');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("").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("").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("").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("").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("").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"),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(""),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"),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(""),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("").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(""+(t.noFileText||"No file")+"")),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("").appendTo(e),w.each(t,function(t,e){e=i.display(e,t);null!==e&&n.append(""+e+' ')})):e.append(""+(i.noFileText||"No files")+"")),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=w("").append(t),n=w('
'),l=(r.footer&&w("
").append(Array.isArray(r.footer)?w("").append(w.map(r.footer,function(t){return w("").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").replace(/</g,"<").replace(/&/g,"&").replace(/"/g,'"').replace(/£/g,"£").replace(/'/g,"'").replace(/
/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 '),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(''),o=w(''),r=(this.dom={body:a("body",i)[0],bodyContent:a("body_content",i)[0],buttons:w('')[0],footer:a("foot",i)[0],form:o[0],formContent:a("form_content",o)[0],formError:w('')[0],formInfo:w('')[0],header:w('')[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 |