import{V as rt}from"./vue.esm.ad4a16fe.js";import{E as W}from"./Error.20e0c905.js";import{n as K}from"./plugin-vue2_normalizer.ed7092a9.js";import{r as it,b as ot,d as lt,a as ut}from"./dataTables.bootstrap4.84a65926.js";import"./_commonjsHelpers.04e31c8c.js";const ct={props:["pg_host","pg_port","pg_data","pg_version_summary","cpu","mem_gb"]};var dt=function(){var n=this,s=n._self._c;return s("div",{staticClass:"alert alert-light mx-auto pa-6"},[s("h2",{staticClass:"text-center"},[s("span",{domProps:{innerHTML:n._s(n.pg_host)}}),n._v(":"),s("span",{domProps:{innerHTML:n._s(n.pg_port)}})]),s("p",{staticClass:"text-center"},[n.cpu&&n.mem_gb?s("span",[s("span",{domProps:{innerHTML:n._s(n.cpu)}}),n._v(" CPU - "),s("span",{domProps:{innerHTML:n._s(n.mem_gb)}}),n._v(" GB memory"),s("br")]):n._e(),n.pg_version_summary&&n.pg_data?s("strong",[s("span",{domProps:{innerHTML:n._s(n.pg_version_summary)}}),n._v(" serving "),s("span",{domProps:{innerHTML:n._s(n.pg_data)}}),n._v(".")]):n._e(),s("br")])])},pt=[],ft=K(ct,dt,pt,!1,null,null,null,null);const Z=ft.exports,mt={props:["id","title"],mounted(){$(this.$el).on("hidden.bs.modal",()=>{this.$emit("closed")})}};var gt=function(){var n=this,s=n._self._c;return s("div",{staticClass:"modal fade",attrs:{id:n.id,role:"dialog",tabindex:"-1","aria-hidden":"true"}},[s("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[s("div",{staticClass:"modal-content"},[s("div",{staticClass:"modal-header"},[s("h4",{staticClass:"modal-title"},[n._v(n._s(n.title))]),n._m(0)]),n._t("default")],2)])])},ht=[function(){var o=this,n=o._self._c;return n("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[n("span",{attrs:{"aria-hidden":"true"}},[o._v("\xD7")])])}],_t=K(mt,gt,ht,!1,null,null,null,null);const J=_t.exports,vt={components:{error:W,"instance-details":Z,"modal-dialog":J},data(){return{waiting:!1,agent_address:null,agent_port:null,pg_host:null,pg_port:null,pg_data:null,pg_version_summary:null,cpu:null,mem_gb:null}},methods:{fetch_current_data(){return $.ajax({url:["/json/settings/instance",this.agent_address,this.agent_port].join("/")}).fail(o=>{this.waiting=!1,this.$refs.error.fromXHR(o)}).done(o=>{this.pg_host=o.hostname,this.pg_port=o.pg_port,this.pg_data=o.pg_data,this.pg_version_summary=o.pg_version_summary,this.cpu=o.cpu;var n=o.memory_size/1024/1024/1024;this.mem_gb=n.toFixed(2)})},open(o,n){this.agent_address=o,this.agent_port=n,$(this.$el).modal("show"),this.fetch_current_data().done(()=>{this.waiting=!1})},delete_(){this.waiting=!0,$.ajax({url:"/json/settings/delete/instance",type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify({agent_address:this.agent_address,agent_port:this.agent_port})}).fail(o=>{this.waiting=!1,this.$refs.error.fromXHR(o)}).done(()=>{window.location.reload()})}}};var bt=function(){var n=this,s=n._self._c;return s("modal-dialog",{attrs:{id:"modalDeleteInstance",title:"Delete Instance"}},[s("div",{staticClass:"modal-body"},[s("error",{ref:"error",attrs:{showTitle:!1}}),s("p",{staticClass:"text-center"},[s("strong",[n._v("Please confirm the deletion of the following instance:")])]),s("instance-details",{attrs:{pg_host:n.pg_host,pg_port:n.pg_port,pg_version_summary:n.pg_version_summary,pg_data:n.pg_data,cpu:n.cpu,mem_gb:n.mem_gb}})],1),s("div",{staticClass:"modal-footer"},[s("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button","data-dismiss":"modal"}},[n._v("Cancel")]),s("button",{staticClass:"btn btn-danger ml-auto",attrs:{id:"buttonDelete",type:"button",disabled:n.waiting},on:{click:n.delete_}},[n._v(" Yes, delete this instance "),n.waiting?s("i",{staticClass:"fa fa-spinner fa-spin loader"}):n._e()])])])},yt=[],xt=K(vt,bt,yt,!1,null,null,null,null);const wt=xt.exports,Ct={components:{"instance-details":Z},props:["submit_text","waiting","pg_host","pg_port","pg_data","pg_version_summary","cpu","mem_gb","signature_status","agent_key","comment","notify","groups","plugins"],updated(){$('[data-toggle="tooltip"]',this.$el).tooltip(),$("#selectGroups").data("multiselect")&&($("#selectGroups").multiselect(this.waiting?"disable":"enable"),$("#selectPlugins").multiselect(this.waiting?"disable":"enable"))},methods:{setup_multiselects(){var o={templates:{button:`
            <button type="button"
                    class="multiselect dropdown-toggle border-secondary"
                    data-toggle="dropdown">
              <span class="multiselect-selected-text"></span> <b class="caret"></b>
            </button>
            `,li:`
            <li class="dropdown-item">
              <label class="w-100"></label>
            </li>
            `},numberDisplayed:1};$("#selectGroups").multiselect(o),$("#selectPlugins").multiselect(o)},teardown_multiselects(){$("#selectGroups").multiselect("destroy"),$("#selectPlugins").multiselect("destroy")},submit(){var o={agent_key:this.agent_key,groups:$("#selectGroups").val(),plugins:$("#selectPlugins").val(),notify:this.notify,comment:this.comment};this.$emit("submit",o)}}};var kt=function(){var n=this,s=n._self._c;return s("form",{on:{submit:function(p){return p.preventDefault(),n.submit.apply(null,arguments)}}},[s("div",{staticClass:"modal-body p-3"},[s("div",{staticClass:"row"},[s("instance-details",{attrs:{pg_host:n.pg_host,pg_port:n.pg_port,pg_version_summary:n.pg_version_summary,pg_data:n.pg_data,cpu:n.cpu,mem_gb:n.mem_gb}})],1),n.$slots.default?s("div",{staticClass:"row"},[s("div",{staticClass:"col"},[n._t("default")],2)]):n._e(),n.signature_status==="unchecked"?s("div",{staticClass:"row"},[s("div",{staticClass:"form-group col-sm-12"},[n._m(0),s("input",{directives:[{name:"model",rawName:"v-model",value:n.agent_key,expression:"agent_key"}],staticClass:"form-control",attrs:{id:"inputAgentKey",placeholder:"Find it in agent configuration file.",required:"",disabled:n.waiting},domProps:{value:n.agent_key},on:{input:function(p){p.target.composing||(n.agent_key=p.target.value)}}})])]):n._e(),s("div",{staticClass:"row"},[n.groups.length>0?s("div",{staticClass:"form-group col-sm-6",attrs:{id:"divGroups"}},[s("label",{attrs:{for:"selectGroups"}},[n._v("Groups")]),s("select",{attrs:{id:"selectGroups",disabled:n.waiting,multiple:"",required:""}},n._l(n.groups,function(p){return s("option",{key:p.name,domProps:{selected:p.selected?"selected":null,value:p.name}},[n._v(n._s(p.name))])}),0),s("div",{attrs:{id:"tooltip-container"}})]):n._e(),n.plugins.length>0?s("div",{staticClass:"form-group col-sm-6",attrs:{id:"divPlugins"}},[s("label",{staticClass:"control-label",attrs:{for:"selectPlugins"}},[n._v("Plugins")]),s("select",{attrs:{id:"selectPlugins",disabled:n.waiting,multiple:"multiple"}},n._l(n.plugins,function(p){return s("option",{key:p.name,class:{disabled:p.disabled},attrs:{disabled:p.disabled?"disabled":null,title:p.disabled?"Plugin disabled by agent.":null},domProps:{value:p.name,selected:p.selected}},[n._v(n._s(p.name))])}),0)]):n._e()]),s("div",{staticClass:"row"},[s("div",{staticClass:"col-sm-12"},[s("div",{staticClass:"form-check"},[s("input",{directives:[{name:"model",rawName:"v-model",value:n.notify,expression:"notify"}],staticClass:"form-check-input",attrs:{id:"inputNotify",type:"checkbox",disabled:n.waiting},domProps:{checked:Array.isArray(n.notify)?n._i(n.notify,null)>-1:n.notify},on:{change:function(p){var v=n.notify,m=p.target,w=!!m.checked;if(Array.isArray(v)){var G=null,F=n._i(v,G);m.checked?F<0&&(n.notify=v.concat([G])):F>-1&&(n.notify=v.slice(0,F).concat(v.slice(F+1)))}else n.notify=w}}}),s("label",{staticClass:"control-label",attrs:{for:"inputNotify"}},[n._v("Notify users of any status alert.")])])])]),s("div",{staticClass:"row"},[s("div",{staticClass:"form-group col-sm-12"},[s("label",{staticClass:"control-label",attrs:{for:"inputComment"}},[n._v("Comment")]),s("textarea",{directives:[{name:"model",rawName:"v-model",value:n.comment,expression:"comment"}],staticClass:"form-control",attrs:{id:"inputComment",rows:"3",disabled:n.waiting},domProps:{value:n.comment},on:{input:function(p){p.target.composing||(n.comment=p.target.value)}}})])])]),s("div",{staticClass:"modal-footer"},[s("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button","data-dismiss":"modal"}},[n._v("Cancel")]),s("button",{staticClass:"btn btn-success ml-auto",attrs:{id:"buttonSubmit",type:"submit",disabled:n.waiting}},[n._v(" "+n._s(n.submit_text)+" "),n.waiting?s("i",{staticClass:"fa fa-spinner fa-spin loader"}):n._e()])])])},Tt=[function(){var o=this,n=o._self._c;return n("label",{staticClass:"control-label",attrs:{for:"inputAgentKey"}},[o._v(" Agent secret key "),n("i",{staticClass:"fa fa-info-circle text-muted",attrs:{id:"cpu-info","data-toggle":"tooltip",title:"Using agent secret key is deprecated. You should upgrade agent to version 8."}})])}],At=K(Ct,kt,Tt,!1,null,null,null,null);const z=At.exports,Nt={components:{error:W,"instance-form":z,"modal-dialog":J},data(){return{wizard_step:"discover",waiting:!1,agent_address:null,agent_port:null,agent_key:"",comment:"",notify:!0,cpu:null,discover_data:null,discover_etag:null,mem_gb:null,pg_data:null,pg_host:null,pg_port:null,pg_version_summary:null,server_groups:[],server_plugins:[],signature_status:null}},computed:{groups(){return Array.from(this.server_groups,o=>({name:o.name,disabled:!1,selected:!1}))},plugins(){return Array.from(this.server_plugins,o=>({name:o,disabled:this.discover_data.temboard.plugins.indexOf(o)===-1,selected:this.discover_data.temboard.plugins.indexOf(o)!==-1}))}},updated(){$('[data-toggle="tooltip"]',this.$el).tooltip(),this.wizard_step==="register"&&this.plugins&&!$("#selectGroups").data("multiselect")&&this.$nextTick(this.$refs.form.setup_multiselects),this.wizard_step==="register"&&$("#selectGroups").data("multiselect")&&($("#selectGroups").multiselect(this.waiting?"disable":"enable"),$("#selectPlugins").multiselect(this.waiting?"disable":"enable"))},methods:{discover(){this.waiting=!0,$.ajax({url:["/json/discover/instance",this.agent_address,this.agent_port].join("/"),type:"get",contentType:"application/json",dataType:"json"}).fail(o=>{this.waiting=!1,this.$refs.error.fromXHR(o)}).done((o,n,s)=>{if(o.signature_status=="invalid"){this.$refs.error.setHTML(`
              <p><strong>Signature missmatch !</strong></p>

              <p>Agent is not configured for this UI. You must accept
              <strong>this</strong> UI signing key in agent configuration. See
              installation documentation.</p>
            `),this.waiting=!1;return}this.discover_data=o,this.discover_etag=s.getResponseHeader("ETag"),this.cpu=o.system.cpu_count;var p=o.system.memory/1024/1024/1024;this.mem_gb=p.toFixed(2),this.pg_version_summary=o.postgres.version_summary,this.pg_data=o.postgres.data_directory,this.pg_host=o.system.fqdn,this.pg_port=o.postgres.port,this.signature_status=o.signature_status,$.ajax({url:"/json/settings/all/group/instance"}).fail(v=>{this.waiting=!1,this.$refs.error.fromXHR(v)}).done(v=>{this.server_groups=v.groups,this.server_plugins=v.loaded_plugins,this.waiting=!1,this.wizard_step="register"})})},register(o){this.waiting=!0,$.ajax({url:"/json/settings/instance",method:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify({...o,new_agent_address:this.agent_address,new_agent_port:this.agent_port,discover:this.discover_data,discover_etag:this.discover_etag})}).fail(n=>{this.waiting=!1,this.$refs.error.fromXHR(n)}).done(()=>{window.location.reload()})},reset(){Object.assign(this.$data,this.$options.data()),this.$refs.form&&this.$refs.form.teardown_multiselects()}}};var Dt=function(){var n=this,s=n._self._c;return s("modal-dialog",{attrs:{id:"modalNewInstance",title:"Register New Instance"},on:{closed:n.reset}},[n.wizard_step=="discover"?s("div",{},[s("form",{on:{submit:function(p){return p.preventDefault(),n.discover.apply(null,arguments)}}},[s("div",{staticClass:"modal-body"},[s("p",{staticClass:"alert alert-info"},[n._v("temBoard requires an agent to manage a PostgreSQL instance. Follow documentation to setup the agent next to your PostgreSQL instance. Set here agent address and port, not PostgreSQL.")]),s("error",{ref:"error",attrs:{showTitle:!1}}),s("div",{staticClass:"row"},[s("div",{staticClass:"form-group col-sm-6"},[s("label",{staticClass:"control-label",attrs:{for:"inputAgentAddress"}},[n._v("Agent address")]),s("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:n.agent_address,expression:"agent_address",modifiers:{lazy:!0,trim:!0}}],staticClass:"form-control",attrs:{disabled:n.waiting,id:"inputAgentAddress",type:"text",placeholder:"ex: db.entreprise.lan"},domProps:{value:n.agent_address},on:{change:function(p){n.agent_address=p.target.value.trim()},blur:function(p){return n.$forceUpdate()}}})]),s("div",{staticClass:"form-group col-sm-6"},[s("label",{staticClass:"control-label",attrs:{for:"inputAgentPort"}},[n._v("Agent port")]),s("input",{directives:[{name:"model",rawName:"v-model.lazy.number.trim",value:n.agent_port,expression:"agent_port",modifiers:{lazy:!0,number:!0,trim:!0}}],staticClass:"form-control",attrs:{disabled:n.waiting,id:"inputAgentPort",type:"text",placeholder:"ex: 2345"},domProps:{value:n.agent_port},on:{change:function(p){n.agent_port=n._n(p.target.value.trim())},blur:function(p){return n.$forceUpdate()}}})])])],1),s("div",{staticClass:"modal-footer"},[s("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button","data-dismiss":"modal"}},[n._v("Cancel")]),s("button",{staticClass:"btn btn-success ml-auto",attrs:{id:"buttonDiscover",type:"submit",disabled:n.waiting}},[n._v(" Discover "),n.waiting?s("i",{staticClass:"fa fa-spinner fa-spin loader"}):n._e()])])])]):n._e(),n.wizard_step=="register"?s("div",{},[s("instance-form",{ref:"form",attrs:{submit_text:"Register",pg_host:n.pg_host,pg_port:n.pg_port,pg_data:n.pg_data,pg_version_summary:n.pg_version_summary,cpu:n.cpu,mem_gb:n.mem_gb,signature_status:n.signature_status,groups:n.groups,plugins:n.plugins,notify:n.notify,comment:n.comment,agent_key:n.agent_key,waiting:n.waiting},on:{submit:n.register}},[s("error",{ref:"error",attrs:{showTitle:!1}})],1)],1):n._e()])},Ht=[],Lt=K(Nt,Dt,Ht,!1,null,null,null,null);const Pt=Lt.exports,jt={components:{error:W,"instance-form":z,"modal-dialog":J},data(){return{waiting:!1,agent_address:null,agent_port:null,agent_key:"",comment:"",notify:!0,current_data:null,discover_data:null,discover_etag:null,cpu:null,server_groups:[],current_groups:[],mem_gb:null,pg_data:null,pg_host:null,pg_port:null,pg_version_summary:null,server_plugins:[],current_plugins:[],agent_plugins:[],signature_status:null}},computed:{plugins(){return Array.from(this.server_plugins,o=>({name:o,disabled:this.agent_plugins.length>0&&this.agent_plugins.indexOf(o)===-1,selected:this.current_plugins.indexOf(o)!==-1}))},groups(){return Array.from(this.server_groups,o=>({name:o.name,selected:this.current_groups.indexOf(o.name)!==-1}))}},updated(){$('[data-toggle="tooltip"]',this.$el).tooltip(),$("#selectGroups").data("multiselect")&&($("#selectGroups").multiselect(this.waiting?"disable":"enable"),$("#selectPlugins").multiselect(this.waiting?"disable":"enable"))},methods:{discover_agent(){return $.ajax({url:["/json/discover/instance",this.agent_address,this.agent_port].join("/"),type:"get",contentType:"application/json",dataType:"json"}).fail(o=>{this.waiting=!1,this.$refs.error.fromXHR(o)}).done((o,n,s)=>{if(o.signature_status=="invalid"){this.$refs.error.setHTML(`
              <p><strong>Signature missmatch !</strong></p>

              <p>Agent is not configured for this UI. You must accept
              <strong>this</strong> UI signing key in agent configuration. See
              installation documentation.</p>
            `),this.waiting=!1;return}this.discover_data=o,this.discover_etag=s.getResponseHeader("ETag"),this.agent_plugins=o.temboard.plugins,this.cpu=o.system.cpu_count;var p=o.system.memory/1024/1024/1024;this.mem_gb=p.toFixed(2),this.pg_version_summary=o.postgres.version_summary,this.pg_data=o.postgres.data_directory,this.pg_host=o.system.fqdn,this.pg_port=o.postgres.port,this.signature_status=o.signature_status})},open(o,n){this.$refs.error.clear(),this.waiting=!0,this.agent_address=o,this.agent_port=n,$(this.$el).modal("show"),this.fetch_current_data().done(()=>{this.$nextTick(this.$refs.form.setup_multiselects),this.discover_agent().done(()=>{this.waiting=!1})})},fetch_current_data(){return $.ajax({url:["/json/settings/instance",this.agent_address,this.agent_port].join("/")}).fail(o=>{this.waiting=!1,this.$refs.error.fromXHR(o)}).done(o=>{this.notify=o.notify,this.comment=o.comment,this.agent_key=o.agent_key,this.pg_host=o.hostname,this.pg_port=o.pg_port,this.server_groups=o.server_groups,this.server_plugins=o.server_plugins,this.current_data=o,this.current_plugins=o.plugins,this.current_groups=o.groups})},update(o){this.waiting=!0,$.ajax({url:["/json/settings/instance",this.agent_address,this.agent_port].join("/"),method:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify({...o,new_agent_address:this.agent_address,new_agent_port:this.agent_port,discover:this.discover_data,discover_etag:this.discover_etag})}).fail(n=>{this.waiting=!1,this.$refs.error.fromXHR(n)}).done(()=>{window.location.reload()})},reset(){Object.assign(this.$data,this.$options.data()),this.$refs.form.teardown_multiselects()}}};var Ot=function(){var n=this,s=n._self._c;return s("modal-dialog",{attrs:{id:"modalUpdateInstance",title:"Update Instance"},on:{closed:n.reset}},[s("instance-form",{ref:"form",attrs:{submit_text:"Update",pg_host:n.pg_host,pg_port:n.pg_port,pg_data:n.pg_data,pg_version_summary:n.pg_version_summary,cpu:n.cpu,mem_gb:n.mem_gb,signature_status:n.signature_status,groups:n.groups,plugins:n.plugins,notify:n.notify,comment:n.comment,agent_key:n.agent_key,waiting:n.waiting},on:{submit:n.update}},[s("error",{ref:"error"})],1)],1)},Bt=[],It=K(jt,Ot,Bt,!1,null,null,null,null);const Rt=It.exports;var tt={exports:{}},X={exports:{}};/*! Buttons for DataTables 2.2.3
 * ©2016-2022 SpryMedia Ltd - datatables.net/license
 */var S;function Ft(){return S||(S=1,function(o,n){(function(s){o.exports=function(p,v){return p||(p=window),(!v||!v.fn.dataTable)&&(v=it()(p,v).$),s(v,p,p.document)}})(function(s,p,v,m){var w=s.fn.dataTable,G=0,F=0,j=w.ext.buttons;function M(t,e,a){s.fn.animate?t.stop().fadeIn(e,a):(t.css("display","block"),a&&a.call(t))}function E(t,e,a){s.fn.animate?t.stop().fadeOut(e,a):(t.css("display","none"),a&&a.call(t))}var T=function(t,e){if(!(this instanceof T))return function(a){return new T(a,t).container()};typeof e>"u"&&(e={}),e===!0&&(e={}),Array.isArray(e)&&(e={buttons:e}),this.c=s.extend(!0,{},T.defaults,e),e.buttons&&(this.c.buttons=e.buttons),this.s={dt:new w.Api(t),buttons:[],listenKeys:"",namespace:"dtb"+G++},this.dom={container:s("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)},this._constructor()};s.extend(T.prototype,{action:function(t,e){var a=this._nodeToButton(t);return e===m?a.conf.action:(a.conf.action=e,this)},active:function(t,e){var a=this._nodeToButton(t),r=this.c.dom.button.active,i=s(a.node);return e===m?i.hasClass(r):(i.toggleClass(r,e===m?!0:e),this)},add:function(t,e,a){var r=this.s.buttons;if(typeof e=="string"){for(var i=e.split("-"),l=this.s,h=0,d=i.length-1;h<d;h++)l=l.buttons[i[h]*1];r=l.buttons,e=i[i.length-1]*1}return this._expandButton(r,t,t!==m?t.split:m,(t===m||t.split===m||t.split.length===0)&&l!==m,!1,e),(a===m||a===!0)&&this._draw(),this},collectionRebuild:function(t,e){var a=this._nodeToButton(t);if(e!==m){var r;for(r=a.buttons.length-1;r>=0;r--)this.remove(a.buttons[r].node);for(r=0;r<e.length;r++){var i=e[r];this._expandButton(a.buttons,i,i!==m&&i.config!==m&&i.config.split!==m,!0,i.parentConf!==m&&i.parentConf.split!==m,r,i.parentConf)}}this._draw(a.collection,a.buttons)},container:function(){return this.dom.container},disable:function(t){var e=this._nodeToButton(t);return s(e.node).addClass(this.c.dom.button.disabled).attr("disabled",!0),this},destroy:function(){s("body").off("keyup."+this.s.namespace);var t=this.s.buttons.slice(),e,a;for(e=0,a=t.length;e<a;e++)this.remove(t[e].node);this.dom.container.remove();var r=this.s.dt.settings()[0];for(e=0,a=r.length;e<a;e++)if(r.inst===this){r.splice(e,1);break}return this},enable:function(t,e){if(e===!1)return this.disable(t);var a=this._nodeToButton(t);return s(a.node).removeClass(this.c.dom.button.disabled).removeAttr("disabled"),this},index:function(t,e,a){e||(e="",a=this.s.buttons);for(var r=0,i=a.length;r<i;r++){var l=a[r].buttons;if(a[r].node===t)return e+r;if(l&&l.length){var h=this.index(t,r+"-",l);if(h!==null)return h}}return null},name:function(){return this.c.name},node:function(t){if(!t)return this.dom.container;var e=this._nodeToButton(t);return s(e.node)},processing:function(t,e){var a=this.s.dt,r=this._nodeToButton(t);return e===m?s(r.node).hasClass("processing"):(s(r.node).toggleClass("processing",e),s(a.table().node()).triggerHandler("buttons-processing.dt",[e,a.button(t),a,s(t),r.conf]),this)},remove:function(t){var e=this._nodeToButton(t),a=this._nodeToHost(t),r=this.s.dt;if(e.buttons.length)for(var i=e.buttons.length-1;i>=0;i--)this.remove(e.buttons[i].node);e.conf.destroying=!0,e.conf.destroy&&e.conf.destroy.call(r.button(t),r,s(t),e.conf),this._removeKey(e.conf),s(e.node).remove();var l=s.inArray(e,a);return a.splice(l,1),this},text:function(t,e){var a=this._nodeToButton(t),r=this.c.dom.collection.buttonLiner,i=a.inCollection&&r&&r.tag?r.tag:this.c.dom.buttonLiner.tag,l=this.s.dt,h=s(a.node),d=function(c){return typeof c=="function"?c(l,h,a.conf):c};return e===m?d(a.conf.text):(a.conf.text=e,i?h.children(i).eq(0).filter(":not(.dt-down-arrow)").html(d(e)):h.html(d(e)),this)},_constructor:function(){var t=this,e=this.s.dt,a=e.settings()[0],r=this.c.buttons;a._buttons||(a._buttons=[]),a._buttons.push({inst:this,name:this.c.name});for(var i=0,l=r.length;i<l;i++)this.add(r[i]);e.on("destroy",function(h,d){d===a&&t.destroy()}),s("body").on("keyup."+this.s.namespace,function(h){if(!v.activeElement||v.activeElement===v.body){var d=String.fromCharCode(h.keyCode).toLowerCase();t.s.listenKeys.toLowerCase().indexOf(d)!==-1&&t._keypress(d,h)}})},_addKey:function(t){t.key&&(this.s.listenKeys+=s.isPlainObject(t.key)?t.key.key:t.key)},_draw:function(t,e){t||(t=this.dom.container,e=this.s.buttons),t.children().detach();for(var a=0,r=e.length;a<r;a++)t.append(e[a].inserter),t.append(" "),e[a].buttons&&e[a].buttons.length&&this._draw(e[a].collection,e[a].buttons)},_expandButton:function(t,e,a,r,i,l,h){var d=this.s.dt,c=!1,_=Array.isArray(e)?e:[e];e===m&&(_=Array.isArray(a)?a:[a]),e!==m&&e.split!==m&&(c=!0);for(var f=0,x=_.length;f<x;f++){var g=this._resolveExtends(_[f]);if(!!g){if(g.config!==m&&g.config.split?c=!0:c=!1,Array.isArray(g)){this._expandButton(t,g,u!==m&&u.conf!==m?u.conf.split:m,r,h!==m&&h.split!==m,l,h);continue}var u=this._buildButton(g,r,g.split!==m||g.config!==m&&g.config.split!==m,i);if(!!u){if(l!==m&&l!==null?(t.splice(l,0,u),l++):t.push(u),u.conf.buttons||u.conf.split){if(u.collection=s("<"+(c?this.c.dom.splitCollection.tag:this.c.dom.collection.tag)+"/>"),u.conf._collection=u.collection,u.conf.split)for(var k=0;k<u.conf.split.length;k++)typeof u.conf.split[k]=="object"&&(u.conf.split[k].parent=h,u.conf.split[k].collectionLayout===m&&(u.conf.split[k].collectionLayout=u.conf.collectionLayout),u.conf.split[k].dropup===m&&(u.conf.split[k].dropup=u.conf.dropup),u.conf.split[k].fade===m&&(u.conf.split[k].fade=u.conf.fade));else s(u.node).append(s('<span class="dt-down-arrow">'+this.c.dom.splitDropdown.text+"</span>"));this._expandButton(u.buttons,u.conf.buttons,u.conf.split,!c,c,l,u.conf)}u.conf.parent=h,g.init&&g.init.call(d.button(u.node),d,s(u.node),g)}}}},_buildButton:function(t,e,a,r){var i=this.c.dom.button,l=this.c.dom.buttonLiner,h=this.c.dom.collection;this.c.dom.split;var d=this.c.dom.splitCollection,c=this.c.dom.splitDropdownButton,_=this.s.dt,f=function(b){return typeof b=="function"?b(_,g,t):b};if(t.spacer){var x=s("<span></span>").addClass("dt-button-spacer "+t.style+" "+i.spacerClass).html(f(t.text));return{conf:t,node:x,inserter:x,buttons:[],inCollection:e,isSplit:a,inSplit:r,collection:null}}if(!a&&r&&d?i=c:!a&&e&&h.button&&(i=h.button),!a&&r&&d.buttonLiner?l=d.buttonLiner:!a&&e&&h.buttonLiner&&(l=h.buttonLiner),t.available&&!t.available(_,t)&&!t.hasOwnProperty("html"))return!1;var g;if(t.hasOwnProperty("html"))g=s(t.html);else{var u=function(b,y,A,D){D.action.call(y.button(A),b,y,A,D),s(y.table().node()).triggerHandler("buttons-action.dt",[y.button(A),y,A,D])},k=t.tag||i.tag,B=t.clickBlurs===m?!0:t.clickBlurs;if(g=s("<"+k+"/>").addClass(i.className).addClass(r?this.c.dom.splitDropdownButton.className:"").attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(b){b.preventDefault(),!g.hasClass(i.disabled)&&t.action&&u(b,_,g,t),B&&g.trigger("blur")}).on("keypress.dtb",function(b){b.keyCode===13&&(b.preventDefault(),!g.hasClass(i.disabled)&&t.action&&u(b,_,g,t))}),k.toLowerCase()==="a"&&g.attr("href","#"),k.toLowerCase()==="button"&&g.attr("type","button"),l.tag){var O=s("<"+l.tag+"/>").html(f(t.text)).addClass(l.className);l.tag.toLowerCase()==="a"&&O.attr("href","#"),g.append(O)}else g.html(f(t.text));t.enabled===!1&&g.addClass(i.disabled),t.className&&g.addClass(t.className),t.titleAttr&&g.attr("title",f(t.titleAttr)),t.attr&&g.attr(t.attr),t.namespace||(t.namespace=".dt-button-"+F++),t.config!==m&&t.config.split&&(t.split=t.config.split)}var N=this.c.dom.buttonContainer,L;N&&N.tag?L=s("<"+N.tag+"/>").addClass(N.className).append(g):L=g,this._addKey(t),this.c.buttonCreated&&(L=this.c.buttonCreated(t,L));var C;if(a){C=s("<div/>").addClass(this.c.dom.splitWrapper.className),C.append(g);var H=s.extend(t,{text:this.c.dom.splitDropdown.text,className:this.c.dom.splitDropdown.className,closeButton:!1,attr:{"aria-haspopup":"dialog","aria-expanded":!1},align:this.c.dom.splitDropdown.align,splitAlignClass:this.c.dom.splitDropdown.splitAlignClass});this._addKey(H);var R=function(b,y,A,D){j.split.action.call(y.button(s("div.dt-btn-split-wrapper")[0]),b,y,A,D),s(y.table().node()).triggerHandler("buttons-action.dt",[y.button(A),y,A,D]),A.attr("aria-expanded",!0)},P=s('<button class="'+this.c.dom.splitDropdown.className+' dt-button"><span class="dt-btn-split-drop-arrow">'+this.c.dom.splitDropdown.text+"</span></button>").on("click.dtb",function(b){b.preventDefault(),b.stopPropagation(),P.hasClass(i.disabled)||R(b,_,P,H),B&&P.trigger("blur")}).on("keypress.dtb",function(b){b.keyCode===13&&(b.preventDefault(),P.hasClass(i.disabled)||R(b,_,P,H))});t.split.length===0&&P.addClass("dtb-hide-drop"),C.append(P).attr(H.attr)}return{conf:t,node:a?C.get(0):g.get(0),inserter:a?C:L,buttons:[],inCollection:e,isSplit:a,inSplit:r,collection:null}},_nodeToButton:function(t,e){e||(e=this.s.buttons);for(var a=0,r=e.length;a<r;a++){if(e[a].node===t)return e[a];if(e[a].buttons.length){var i=this._nodeToButton(t,e[a].buttons);if(i)return i}}},_nodeToHost:function(t,e){e||(e=this.s.buttons);for(var a=0,r=e.length;a<r;a++){if(e[a].node===t)return e;if(e[a].buttons.length){var i=this._nodeToHost(t,e[a].buttons);if(i)return i}}},_keypress:function(t,e){if(!e._buttonsHandled){var a=function(i,l){if(!!i.key){if(i.key===t)e._buttonsHandled=!0,s(l).click();else if(s.isPlainObject(i.key)){if(i.key.key!==t||i.key.shiftKey&&!e.shiftKey||i.key.altKey&&!e.altKey||i.key.ctrlKey&&!e.ctrlKey||i.key.metaKey&&!e.metaKey)return;e._buttonsHandled=!0,s(l).click()}}},r=function(i){for(var l=0,h=i.length;l<h;l++)a(i[l].conf,i[l].node),i[l].buttons.length&&r(i[l].buttons)};r(this.s.buttons)}},_removeKey:function(t){if(t.key){var e=s.isPlainObject(t.key)?t.key.key:t.key,a=this.s.listenKeys.split(""),r=s.inArray(e,a);a.splice(r,1),this.s.listenKeys=a.join("")}},_resolveExtends:function(t){var e=this,a=this.s.dt,r,i,l=function(f){for(var x=0;!s.isPlainObject(f)&&!Array.isArray(f);){if(f===m)return;if(typeof f=="function"){if(f=f.call(e,a,t),!f)return!1}else if(typeof f=="string"){if(!j[f])return{html:f};f=j[f]}if(x++,x>30)throw"Buttons: Too many iterations"}return Array.isArray(f)?f:s.extend({},f)};for(t=l(t);t&&t.extend;){if(!j[t.extend])throw"Cannot extend unknown button type: "+t.extend;var h=l(j[t.extend]);if(Array.isArray(h))return h;if(!h)return!1;var d=h.className;t.config!==m&&h.config!==m&&(t.config=s.extend({},h.config,t.config)),t=s.extend({},h,t),d&&t.className!==d&&(t.className=d+" "+t.className);var c=t.postfixButtons;if(c){for(t.buttons||(t.buttons=[]),r=0,i=c.length;r<i;r++)t.buttons.push(c[r]);t.postfixButtons=null}var _=t.prefixButtons;if(_){for(t.buttons||(t.buttons=[]),r=0,i=_.length;r<i;r++)t.buttons.splice(r,0,_[r]);t.prefixButtons=null}t.extend=h.extend}return t},_popover:function(t,e,a,r){var i=e,l=this.c,h=!1,d=s.extend({align:"button-left",autoClose:!1,background:!0,backgroundClassName:"dt-button-background",closeButton:!0,contentClassName:l.dom.collection.className,collectionLayout:"",collectionTitle:"",dropup:!1,fade:400,popoverTitle:"",rightAlignClassName:"dt-button-right",tag:l.dom.collection.tag},a),c=e.node(),_=function(){h=!0,E(s(".dt-button-collection"),d.fade,function(){s(this).detach()}),s(i.buttons('[aria-haspopup="dialog"][aria-expanded="true"]').nodes()).attr("aria-expanded","false"),s("div.dt-button-background").off("click.dtb-collection"),T.background(!1,d.backgroundClassName,d.fade,c),s(p).off("resize.resize.dtb-collection"),s("body").off(".dtb-collection"),i.off("buttons-action.b-internal"),i.off("destroy")};if(t===!1){_();return}var f=s(i.buttons('[aria-haspopup="dialog"][aria-expanded="true"]').nodes());f.length&&(c.closest("div.dt-button-collection").length&&(c=f.eq(0)),_());var x=s(".dt-button",t).length,g="";x===3?g="dtb-b3":x===2?g="dtb-b2":x===1&&(g="dtb-b1");var u=s("<div/>").addClass("dt-button-collection").addClass(d.collectionLayout).addClass(d.splitAlignClass).addClass(g).css("display","none").attr({"aria-modal":!0,role:"dialog"});t=s(t).addClass(d.contentClassName).attr("role","menu").appendTo(u),c.attr("aria-expanded","true"),c.parents("body")[0]!==v.body&&(c=v.body.lastChild),d.popoverTitle?u.prepend('<div class="dt-button-collection-title">'+d.popoverTitle+"</div>"):d.collectionTitle&&u.prepend('<div class="dt-button-collection-title">'+d.collectionTitle+"</div>"),d.closeButton&&u.prepend('<div class="dtb-popover-close">x</div>').addClass("dtb-collection-closeable"),M(u.insertAfter(c),d.fade);var k=s(e.table().container()),B=u.css("position");if((d.span==="container"||d.align==="dt-container")&&(c=c.parent(),u.css("width",k.width())),B==="absolute"){var O=s(c[0].offsetParent),N=c.position(),L=c.offset(),C=O.offset(),H=O.position(),R=p.getComputedStyle(O[0]);C.height=O.outerHeight(),C.width=O.width()+parseFloat(R.paddingLeft),C.right=C.left+C.width,C.bottom=C.top+C.height;var P=N.top+c.outerHeight(),b=N.left;u.css({top:P,left:b}),R=p.getComputedStyle(u[0]);var y=u.offset();y.height=u.outerHeight(),y.width=u.outerWidth(),y.right=y.left+y.width,y.bottom=y.top+y.height,y.marginTop=parseFloat(R.marginTop),y.marginBottom=parseFloat(R.marginBottom),d.dropup&&(P=N.top-y.height-y.marginTop-y.marginBottom),(d.align==="button-right"||u.hasClass(d.rightAlignClassName))&&(b=N.left-y.width+c.outerWidth()),(d.align==="dt-container"||d.align==="container")&&(b<N.left&&(b=-N.left),b+y.width>C.width&&(b=C.width-y.width)),H.left+b+y.width>s(p).width()&&(b=s(p).width()-y.width-H.left),L.left+b<0&&(b=-L.left),H.top+P+y.height>s(p).height()+s(p).scrollTop()&&(P=N.top-y.height-y.marginTop-y.marginBottom),H.top+P<s(p).scrollTop()&&(P=N.top+c.outerHeight()),u.css({top:P,left:b})}else{var B=function(){var D=s(p).height()/2,I=u.height()/2;I>D&&(I=D),u.css("marginTop",I*-1)};B(),s(p).on("resize.dtb-collection",function(){B()})}d.background&&T.background(!0,d.backgroundClassName,d.fade,d.backgroundHost||c),s("div.dt-button-background").on("click.dtb-collection",function(){}),d.autoClose&&setTimeout(function(){i.on("buttons-action.b-internal",function(A,D,I,at){at[0]!==c[0]&&_()})},0),s(u).trigger("buttons-popover.dt"),i.on("destroy",_),setTimeout(function(){h=!1,s("body").on("click.dtb-collection",function(A){if(!h){var D=s.fn.addBack?"addBack":"andSelf",I=s(A.target).parent()[0];(!s(A.target).parents()[D]().filter(t).length&&!s(I).hasClass("dt-buttons")||s(A.target).hasClass("dt-button-background"))&&_()}}).on("keyup.dtb-collection",function(A){A.keyCode===27&&_()}).on("keydown.dtb-collection",function(A){var D=s("a, button",t),I=v.activeElement;A.keyCode===9&&(D.index(I)===-1?(D.first().focus(),A.preventDefault()):A.shiftKey?I===D[0]&&(D.last().focus(),A.preventDefault()):I===D.last()[0]&&(D.first().focus(),A.preventDefault()))})},0)}}),T.background=function(t,e,a,r){a===m&&(a=400),r||(r=v.body),t?M(s("<div/>").addClass(e).css("display","none").insertAfter(r),a):E(s("div."+e),a,function(){s(this).removeClass(e).remove()})},T.instanceSelector=function(t,e){if(t===m||t===null)return s.map(e,function(l){return l.inst});var a=[],r=s.map(e,function(l){return l.name}),i=function(l){if(Array.isArray(l)){for(var h=0,d=l.length;h<d;h++)i(l[h]);return}if(typeof l=="string")if(l.indexOf(",")!==-1)i(l.split(","));else{var c=s.inArray(l.trim(),r);c!==-1&&a.push(e[c].inst)}else typeof l=="number"?a.push(e[l].inst):typeof l=="object"&&a.push(l)};return i(t),a},T.buttonSelector=function(t,e){for(var a=[],r=function(c,_,f){for(var x,g,u=0,k=_.length;u<k;u++)x=_[u],x&&(g=f!==m?f+u:u+"",c.push({node:x.node,name:x.conf.name,idx:g}),x.buttons&&r(c,x.buttons,g+"-"))},i=function(c,_){var f,x,g=[];r(g,_.s.buttons);var u=s.map(g,function(L){return L.node});if(Array.isArray(c)||c instanceof s){for(f=0,x=c.length;f<x;f++)i(c[f],_);return}if(c===null||c===m||c==="*")for(f=0,x=g.length;f<x;f++)a.push({inst:_,node:g[f].node});else if(typeof c=="number")_.s.buttons[c]&&a.push({inst:_,node:_.s.buttons[c].node});else if(typeof c=="string")if(c.indexOf(",")!==-1){var k=c.split(",");for(f=0,x=k.length;f<x;f++)i(k[f].trim(),_)}else if(c.match(/^\d+(\-\d+)*$/)){var B=s.map(g,function(L){return L.idx});a.push({inst:_,node:g[s.inArray(c,B)].node})}else if(c.indexOf(":name")!==-1){var O=c.replace(":name","");for(f=0,x=g.length;f<x;f++)g[f].name===O&&a.push({inst:_,node:g[f].node})}else s(u).filter(c).each(function(){a.push({inst:_,node:this})});else if(typeof c=="object"&&c.nodeName){var N=s.inArray(c,u);N!==-1&&a.push({inst:_,node:u[N]})}},l=0,h=t.length;l<h;l++){var d=t[l];i(e,d)}return a},T.stripData=function(t,e){return typeof t!="string"||(t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),t=t.replace(/<!\-\-.*?\-\->/g,""),(!e||e.stripHtml)&&(t=t.replace(/<[^>]*>/g,"")),(!e||e.trim)&&(t=t.replace(/^\s+|\s+$/g,"")),(!e||e.stripNewlines)&&(t=t.replace(/\n/g," ")),(!e||e.decodeEntities)&&(Q.innerHTML=t,t=Q.value)),t},T.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:""},button:{tag:"button",className:"dt-button",active:"active",disabled:"disabled",spacerClass:""},buttonLiner:{tag:"span",className:""},split:{tag:"div",className:"dt-button-split"},splitWrapper:{tag:"div",className:"dt-btn-split-wrapper"},splitDropdown:{tag:"button",text:"&#x25BC;",className:"dt-btn-split-drop",align:"split-right",splitAlignClass:"dt-button-split-left"},splitDropdownButton:{tag:"button",className:"dt-btn-split-drop-button dt-button"},splitCollection:{tag:"div",className:"dt-button-split-collection"}}},T.version="2.2.3",s.extend(j,{collection:{text:function(t){return t.i18n("buttons.collection","Collection")},className:"buttons-collection",closeButton:!1,init:function(t,e,a){e.attr("aria-expanded",!1)},action:function(t,e,a,r){r._collection.parents("body").length?this.popover(!1,r):this.popover(r._collection,r),t.type==="keypress"&&s("a, button",r._collection).eq(0).focus()},attr:{"aria-haspopup":"dialog"}},split:{text:function(t){return t.i18n("buttons.split","Split")},className:"buttons-split",closeButton:!1,init:function(t,e,a){return e.attr("aria-expanded",!1)},action:function(t,e,a,r){this.popover(r._collection,r)},attr:{"aria-haspopup":"dialog"}},copy:function(t,e){if(j.copyHtml5)return"copyHtml5"},csv:function(t,e){if(j.csvHtml5&&j.csvHtml5.available(t,e))return"csvHtml5"},excel:function(t,e){if(j.excelHtml5&&j.excelHtml5.available(t,e))return"excelHtml5"},pdf:function(t,e){if(j.pdfHtml5&&j.pdfHtml5.available(t,e))return"pdfHtml5"},pageLength:function(t){var e=t.settings()[0].aLengthMenu,a=[],r=[],i=function(d){return d.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},d.page.len())};if(Array.isArray(e[0]))a=e[0],r=e[1];else for(var l=0;l<e.length;l++){var h=e[l];s.isPlainObject(h)?(a.push(h.value),r.push(h.label)):(a.push(h),r.push(h))}return{extend:"collection",text:i,className:"buttons-page-length",autoClose:!0,buttons:s.map(a,function(d,c){return{text:r[c],className:"button-page-length",action:function(_,f){f.page.len(d).draw()},init:function(_,f,x){var g=this,u=function(){g.active(_.page.len()===d)};_.on("length.dt"+x.namespace,u),u()},destroy:function(_,f,x){_.off("length.dt"+x.namespace)}}}),init:function(d,c,_){var f=this;d.on("length.dt"+_.namespace,function(){f.text(_.text)})},destroy:function(d,c,_){d.off("length.dt"+_.namespace)}}},spacer:{style:"empty",spacer:!0,text:function(t){return t.i18n("buttons.spacer","")}}}),w.Api.register("buttons()",function(t,e){e===m&&(e=t,t=m),this.selector.buttonGroup=t;var a=this.iterator(!0,"table",function(r){if(r._buttons)return T.buttonSelector(T.instanceSelector(t,r._buttons),e)},!0);return a._groupSelector=t,a}),w.Api.register("button()",function(t,e){var a=this.buttons(t,e);return a.length>1&&a.splice(1,a.length),a}),w.Api.registerPlural("buttons().active()","button().active()",function(t){return t===m?this.map(function(e){return e.inst.active(e.node)}):this.each(function(e){e.inst.active(e.node,t)})}),w.Api.registerPlural("buttons().action()","button().action()",function(t){return t===m?this.map(function(e){return e.inst.action(e.node)}):this.each(function(e){e.inst.action(e.node,t)})}),w.Api.registerPlural("buttons().collectionRebuild()","button().collectionRebuild()",function(t){return this.each(function(e){for(var a=0;a<t.length;a++)typeof t[a]=="object"&&(t[a].parentConf=e);e.inst.collectionRebuild(e.node,t)})}),w.Api.register(["buttons().enable()","button().enable()"],function(t){return this.each(function(e){e.inst.enable(e.node,t)})}),w.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(t){t.inst.disable(t.node)})}),w.Api.register("button().index()",function(){var t=null;return this.each(function(e){var a=e.inst.index(e.node);a!==null&&(t=a)}),t}),w.Api.registerPlural("buttons().nodes()","button().node()",function(){var t=s();return s(this.each(function(e){t=t.add(e.inst.node(e.node))})),t}),w.Api.registerPlural("buttons().processing()","button().processing()",function(t){return t===m?this.map(function(e){return e.inst.processing(e.node)}):this.each(function(e){e.inst.processing(e.node,t)})}),w.Api.registerPlural("buttons().text()","button().text()",function(t){return t===m?this.map(function(e){return e.inst.text(e.node)}):this.each(function(e){e.inst.text(e.node,t)})}),w.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(t){t.inst.node(t.node).trigger("click")})}),w.Api.register("button().popover()",function(t,e){return this.map(function(a){return a.inst._popover(t,this.button(this[0].node),e)})}),w.Api.register("buttons().containers()",function(){var t=s(),e=this._groupSelector;return this.iterator(!0,"table",function(a){if(a._buttons)for(var r=T.instanceSelector(e,a._buttons),i=0,l=r.length;i<l;i++)t=t.add(r[i].container())}),t}),w.Api.register("buttons().container()",function(){return this.containers().eq(0)}),w.Api.register("button().add()",function(t,e,a){var r=this.context;if(r.length){var i=T.instanceSelector(this._groupSelector,r[0]._buttons);i.length&&i[0].add(e,t,a)}return this.button(this._groupSelector,t)}),w.Api.register("buttons().destroy()",function(){return this.pluck("inst").unique().each(function(t){t.destroy()}),this}),w.Api.registerPlural("buttons().remove()","buttons().remove()",function(){return this.each(function(t){t.inst.remove(t.node)}),this});var q;w.Api.register("buttons.info()",function(t,e,a){var r=this;return t===!1?(this.off("destroy.btn-info"),E(s("#datatables_buttons_info"),400,function(){s(this).remove()}),clearTimeout(q),q=null,this):(q&&clearTimeout(q),s("#datatables_buttons_info").length&&s("#datatables_buttons_info").remove(),t=t?"<h2>"+t+"</h2>":"",M(s('<div id="datatables_buttons_info" class="dt-button-info"/>').html(t).append(s("<div/>")[typeof e=="string"?"html":"append"](e)).css("display","none").appendTo("body")),a!==m&&a!==0&&(q=setTimeout(function(){r.buttons.info(!1)},a)),this.on("destroy.btn-info",function(){r.buttons.info(!1)}),this)}),w.Api.register("buttons.exportData()",function(t){if(this.context.length)return nt(new w.Api(this.context[0]),t)}),w.Api.register("buttons.exportInfo()",function(t){return t||(t={}),{filename:et(t),title:st(t),messageTop:Y(this,t.message||t.messageTop,"top"),messageBottom:Y(this,t.messageBottom,"bottom")}});var et=function(t){var e=t.filename==="*"&&t.title!=="*"&&t.title!==m&&t.title!==null&&t.title!==""?t.title:t.filename;if(typeof e=="function"&&(e=e()),e===m||e===null)return null;e.indexOf("*")!==-1&&(e=e.replace("*",s("head > title").text()).trim()),e=e.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,"");var a=U(t.extension);return a||(a=""),e+a},U=function(t){return t===null||t===m?null:typeof t=="function"?t():t},st=function(t){var e=U(t.title);return e===null?null:e.indexOf("*")!==-1?e.replace("*",s("head > title").text()||"Exported data"):e},Y=function(t,e,a){var r=U(e);if(r===null)return null;var i=s("caption",t.table().container()).eq(0);if(r==="*"){var l=i.css("caption-side");return l!==a?null:i.length?i.text():""}return r},Q=s("<textarea/>")[0],nt=function(t,e){var a=s.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(C){return T.stripData(C,a)},footer:function(C){return T.stripData(C,a)},body:function(C){return T.stripData(C,a)}},customizeData:null},e),r=t.columns(a.columns).indexes().map(function(C){var H=t.column(C).header();return a.format.header(H.innerHTML,C,H)}).toArray(),i=t.table().footer()?t.columns(a.columns).indexes().map(function(C){var H=t.column(C).footer();return a.format.footer(H?H.innerHTML:"",C,H)}).toArray():null,l=s.extend({},a.modifier);t.select&&typeof t.select.info=="function"&&l.selected===m&&t.rows(a.rows,s.extend({selected:!0},l)).any()&&s.extend(l,{selected:!0});for(var h=t.rows(a.rows,l).indexes().toArray(),d=t.cells(h,a.columns),c=d.render(a.orthogonal).toArray(),_=d.nodes().toArray(),f=r.length,x=f>0?c.length/f:0,g=[],u=0,k=0,B=x;k<B;k++){for(var O=[f],N=0;N<f;N++)O[N]=a.format.body(c[u],k,N,_[u]),u++;g[k]=O}var L={header:r,footer:i,body:g};return a.customizeData&&a.customizeData(L),L};s.fn.dataTable.Buttons=T,s.fn.DataTable.Buttons=T,s(v).on("init.dt plugin-init.dt",function(t,e){if(t.namespace==="dt"){var a=e.oInit.buttons||w.defaults.buttons;a&&!e._buttons&&new T(e,a).container()}});function V(t,e){var a=new w.Api(t),r=e||a.init().buttons||w.defaults.buttons;return new T(a,r).container()}return w.ext.feature.push({fnInit:V,cFeature:"B"}),w.ext.features&&w.ext.features.register("buttons",V),T})}(X)),X.exports}/*! DataTables styling wrapper for Buttons
 * ©2018 SpryMedia Ltd - datatables.net/license
 */(function(o,n){(function(s){o.exports=function(p,v){return p||(p=window),(!v||!v.fn.dataTable)&&(v=ot.exports(p,v).$),v.fn.dataTable.Buttons||Ft()(p,v),s(v,p,p.document)}})(function(s,p,v,m){return s.fn.dataTable})})(tt);const Kt=tt.exports;lt(window,$);Kt(window,$);ut(window,$);window.app=new rt({el:"#vue-app",components:{"delete-instance-dialog":wt,"new-instance-wizard":Pt,"update-instance-dialog":Rt},created(){this.$nextTick(()=>{var o=$("#tableInstances").DataTable({lengthChange:!1,pageLength:50,buttons:[{attr:{title:"Download inventory as CSV",id:"buttonDownload","data-toggle":"tooltip"},className:"btn btn-sm btn-secondary mx-1",text:'<i class="fa fa-download"></i>',action:function(){var n=$("#tableInstances_filter input").val(),s=new URLSearchParams({filter:n});window.location.replace("/settings/instances.csv?"+s.toString())}}],stateSave:!0});o.buttons().container().appendTo($("#tableInstances_filter"))})}});
