/*! StateRestore 1.4.1 * © SpryMedia Ltd - datatables.net/license */ !function(s){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return s(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),i(e,t),s(t,0,e.document)}:(i(window,o),module.exports=s(o,window,window.document))):s(jQuery,window,document)}(function(y,e,g){"use strict";var u,m,p,a,k,s,t,c=y.fn.dataTable;function n(e,t,s,o,i,a){if(void 0===o&&(o=void 0),void 0===i&&(i=!1),void 0===a&&(a=function(){return null}),!m||!m.versionCheck||!m.versionCheck("1.10.0"))throw new Error("StateRestore requires DataTables 1.10 or newer");if(!m.Buttons)throw new Error("StateRestore requires Buttons");e=new m.Api(e);this.classes=u.extend(!0,{},n.classes),this.c=u.extend(!0,{},n.defaults,t),this.s={dt:e,identifier:s,isPreDefined:i,savedState:null,tableId:o&&o.stateRestore?o.stateRestore.tableId:void 0},this.dom={background:u('
'),closeButton:u('
×
'),confirmation:u('
'),confirmationButton:u('
"),creation:p('
'),creationForm:p('
'),creationTitle:p('

'+this.s.dt.i18n("stateRestore.creationModal.title",this.c.i18n.creationModal.title)+"

"),dtContainer:p(this.s.dt.table().container()),duplicateError:p(''+this.s.dt.i18n("stateRestore.duplicateError",this.c.i18n.duplicateError)+""),emptyError:p(''+this.s.dt.i18n("stateRestore.emptyError",this.c.i18n.emptyError)+""),lengthToggle:p('
'+this.s.dt.i18n("stateRestore.creationModal.length",this.c.i18n.creationModal.length)+"
"),nameInputRow:p('
'),orderToggle:p('
'+this.s.dt.i18n("stateRestore.creationModal.order",this.c.i18n.creationModal.order)+"
"),pagingToggle:p('
'+this.s.dt.i18n("stateRestore.creationModal.paging",this.c.i18n.creationModal.paging)+"
"),removeContents:p('
'),removeTitle:p('

'+this.s.dt.i18n("stateRestore.removeTitle",this.c.i18n.removeTitle)+"

"),scrollerToggle:p('
'+this.s.dt.i18n("stateRestore.creationModal.scroller",this.c.i18n.creationModal.scroller)+"
"),searchBuilderToggle:p('
'+this.s.dt.i18n("stateRestore.creationModal.searchBuilder",this.c.i18n.creationModal.searchBuilder)+"
"),searchPanesToggle:p('
'+this.s.dt.i18n("stateRestore.creationModal.searchPanes",this.c.i18n.creationModal.searchPanes)+"
"),searchToggle:p('
'+this.s.dt.i18n("stateRestore.creationModal.search",this.c.i18n.creationModal.search)+"
"),selectToggle:p('
'+this.s.dt.i18n("stateRestore.creationModal.select",this.c.i18n.creationModal.select)+"
")},(e.settings()[0]._stateRestore=this)._searchForStates(),this._addPreDefined(this.c.preDefined),i={action:"load"},"function"==typeof this.c.ajax?s=function(){"function"==typeof o.c.ajax&&o.c.ajax.call(o.s.dt,i,function(e){return o._addPreDefined(e)})}:"string"==typeof this.c.ajax&&(s=function(){p.ajax({data:i,success:function(e){o._addPreDefined(e)},type:"POST",url:o.c.ajax})}),"function"==typeof s&&(this.s.dt.settings()[0]._bInitComplete?s():this.s.dt.one("preInit.dtsr",function(){s()})),this.s.dt.on("destroy.dtsr",function(){o.destroy()}),this.s.dt.on("draw.dtsr buttons-action.dtsr",function(){return o.findActive()}),this}function o(e,t){l(e,new c.StateRestoreCollection(e,t.config))}function l(e,t){var s=e.stateRestore.states(),o=e.button("SaveStateRestore:name"),i=[];if(o[0])for(var a=o.index().split("-"),i=o[0].inst.c.buttons,n=0;n'+e.i18n("stateRestore.emptyStates",t.c.i18n.emptyStates)+"");else for(var c=0,l=s;c'+i.s.dt.i18n("stateRestore.removeConfirm",i.c.i18n.removeConfirm).replace(/%s/g,i.s.identifier)+"
"),i.dom.confirmation.trigger("dtsr-rename"),i.dom.background.click(),i.dom.confirmation.remove(),u(g).unbind("keyup",function(e){return i._keyupFunction(e)}),i.dom.confirmationButton.off("click")}e={action:"rename",stateRestore:((e={})[i.s.identifier]=s,e)};if(i.c.ajax)"string"==typeof i.c.ajax&&i.s.dt.settings()[0]._bInitComplete?u.ajax({data:e,success:t,type:"POST",url:i.c.ajax}):"function"==typeof i.c.ajax&&i.c.ajax.call(i.s.dt,e,t);else try{localStorage.removeItem("DataTables_stateRestore_"+i.s.identifier+"_"+location.pathname+(i.s.tableId?"_"+i.s.tableId:"")),t()}catch(e){return i.dom.confirmation.children("."+i.classes.modalError).remove(),i.dom.confirmation.append(i.dom.removeError),!1}return!0};if(null!==s){if(o.includes(s))throw new Error(this.s.dt.i18n("stateRestore.duplicateError",this.c.i18n.duplicateError));if(0===s.length)throw new Error(this.s.dt.i18n("stateRestore.emptyError",this.c.i18n.emptyError));this.dom.confirmation.appendTo(this.dom.dtContainer),u(this.s.dt.table().node()).trigger("dtsr-modal-inserted"),e(),this.dom.confirmation.remove()}else this.dom.renameInput.val(this.s.identifier),this.dom.renameContents.append(this.dom.renameInput),this._newModal(this.dom.renameTitle,this.s.dt.i18n("stateRestore.renameButton",this.c.i18n.renameButton),e,this.dom.renameContents)}},n.prototype.save=function(e,t,s){var o,i,a,n=this;if(void 0===s&&(s=!0),this.c.save){if(this.s.dt.state.save(),void 0===e)o=this.s.dt.state();else{if("object"!=typeof e)return;o=e}if(o.stateRestore?(o.stateRestore.isPreDefined=this.s.isPreDefined,o.stateRestore.state=this.s.identifier,o.stateRestore.tableId=this.s.tableId):o.stateRestore={isPreDefined:this.s.isPreDefined,state:this.s.identifier,tableId:this.s.tableId},this.s.savedState=o,this.c.saveState.order||(this.s.savedState.order=void 0),this.c.saveState.search||(this.s.savedState.search=void 0),this.c.saveState.columns&&this.s.savedState.columns)for(var r=0,c=this.s.savedState.columns.length;r/g,">").replace(/"/g,"""):e},n.prototype._deepCompare=function(e,t){var s,o,i=[e,t],a=[Object.keys(e).sort(),Object.keys(t).sort()];for(a[0].includes("scroller")&&(s=a[0].indexOf("start"))&&a[0].splice(s,1),a[1].includes("scroller")&&(s=a[1].indexOf("start"))&&a[1].splice(s,1),o=0;o
').append(this.dom.confirmationButton)).appendTo(this.dom.dtContainer),u(this.s.dt.table().node()).trigger("dtsr-modal-inserted"),o.children("input")),a=((0'+this.s.dt.i18n("stateRestore.emptyStates",this.c.i18n.emptyStates)+"";if(0===this.s.states.length)t.includes(i)||t.push(i);else{for(;t.includes(i);)t.splice(t.indexOf(i),1);this.s.states=this.s.states.sort(function(e,t){e=e.s.identifier,t=t.s.identifier;return t'+t+"")),e=(this.dom.confirmation.empty().append(this.dom.confirmationTitleRow).append(o).append(p('
').append(n)).appendTo(this.dom.dtContainer),p(this.s.dt.table().node()).trigger("dtsr-modal-inserted"),o.children("input")),r=((0