jquery.dgtable 0.6.8 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jquery.dgtable.cjs.js +15 -6
- package/dist/jquery.dgtable.cjs.js.map +1 -1
- package/dist/jquery.dgtable.cjs.min.js +2 -2
- package/dist/jquery.dgtable.cjs.min.js.map +1 -1
- package/dist/jquery.dgtable.es6.js +15 -6
- package/dist/jquery.dgtable.es6.js.map +1 -1
- package/dist/jquery.dgtable.es6.min.js +2 -2
- package/dist/jquery.dgtable.es6.min.js.map +1 -1
- package/dist/jquery.dgtable.umd.js +35 -26
- package/dist/jquery.dgtable.umd.js.map +1 -1
- package/dist/jquery.dgtable.umd.min.js +2 -2
- package/dist/jquery.dgtable.umd.min.js.map +1 -1
- package/package.json +7 -7
- package/src/index.js +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* jquery.dgtable 0.6.
|
|
2
|
+
* jquery.dgtable 0.6.9
|
|
3
3
|
* git://github.com/danielgindi/jquery.dgtable.git
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var e=require("jquery"),t=require("@danielgindi/dom-utils/lib/ScrollHelper"),r=require("@danielgindi/dom-utils/lib/Css"),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=function(e){return e&&e.Math==Math&&e},n=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof o&&o)||function(){return this}()||Function("return this")(),l={},s=function(e){try{return!!e()}catch(e){return!0}},a=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),d=!s((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),u=d,h=Function.prototype.call,c=u?h.bind(h):function(){return h.apply(h,arguments)},p={},m={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,g=f&&!m.call({1:2},1);p.f=g?function(e){var t=f(this,e);return!!t&&t.enumerable}:m;var b,v,C=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},y=d,w=Function.prototype,_=w.call,E=y&&w.bind.bind(_,_),W=y?E:function(e){return function(){return _.apply(e,arguments)}},I=W,R=I({}.toString),S=I("".slice),x=function(e){return S(R(e),8,-1)},H=s,N=x,T=Object,P=W("".split),F=H((function(){return!T("z").propertyIsEnumerable(0)}))?function(e){return"String"==N(e)?P(e,""):T(e)}:T,A=function(e){return null==e},M=A,O=TypeError,z=function(e){if(M(e))throw O("Can't call method on "+e);return e},k=F,L=z,$=function(e){return k(L(e))},V="object"==typeof document&&document.all,B={all:V,IS_HTMLDDA:void 0===V&&void 0!==V},D=B.all,j=B.IS_HTMLDDA?function(e){return"function"==typeof e||e===D}:function(e){return"function"==typeof e},U=j,q=B.all,X=B.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:U(e)||e===q}:function(e){return"object"==typeof e?null!==e:U(e)},Y=n,G=j,J=function(e){return G(e)?e:void 0},K=function(e,t){return arguments.length<2?J(Y[e]):Y[e]&&Y[e][t]},Q=W({}.isPrototypeOf),Z=K("navigator","userAgent")||"",ee=n,te=Z,re=ee.process,oe=ee.Deno,ie=re&&re.versions||oe&&oe.version,ne=ie&&ie.v8;ne&&(v=(b=ne.split("."))[0]>0&&b[0]<4?1:+(b[0]+b[1])),!v&&te&&(!(b=te.match(/Edge\/(\d+)/))||b[1]>=74)&&(b=te.match(/Chrome\/(\d+)/))&&(v=+b[1]);var le=v,se=le,ae=s,de=!!Object.getOwnPropertySymbols&&!ae((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&se&&se<41})),ue=de&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,he=K,ce=j,pe=Q,me=Object,fe=ue?function(e){return"symbol"==typeof e}:function(e){var t=he("Symbol");return ce(t)&&pe(t.prototype,me(e))},ge=String,be=function(e){try{return ge(e)}catch(e){return"Object"}},ve=j,Ce=be,ye=TypeError,we=function(e){if(ve(e))return e;throw ye(Ce(e)+" is not a function")},_e=we,Ee=A,We=c,Ie=j,Re=X,Se=TypeError,xe={exports:{}},He=n,Ne=Object.defineProperty,Te=function(e,t){try{Ne(He,e,{value:t,configurable:!0,writable:!0})}catch(r){He[e]=t}return t},Pe=Te,Fe=n["__core-js_shared__"]||Pe("__core-js_shared__",{}),Ae=Fe;(xe.exports=function(e,t){return Ae[e]||(Ae[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Me=z,Oe=Object,ze=function(e){return Oe(Me(e))},ke=ze,Le=W({}.hasOwnProperty),$e=Object.hasOwn||function(e,t){return Le(ke(e),t)},Ve=W,Be=0,De=Math.random(),je=Ve(1..toString),Ue=function(e){return"Symbol("+(void 0===e?"":e)+")_"+je(++Be+De,36)},qe=n,Xe=xe.exports,Ye=$e,Ge=Ue,Je=de,Ke=ue,Qe=Xe("wks"),Ze=qe.Symbol,et=Ze&&Ze.for,tt=Ke?Ze:Ze&&Ze.withoutSetter||Ge,rt=function(e){if(!Ye(Qe,e)||!Je&&"string"!=typeof Qe[e]){var t="Symbol."+e;Je&&Ye(Ze,e)?Qe[e]=Ze[e]:Qe[e]=Ke&&et?et(t):tt(t)}return Qe[e]},ot=c,it=X,nt=fe,lt=TypeError,st=rt("toPrimitive"),at=function(e,t){if(!it(e)||nt(e))return e;var r,o,i=(o=e[st],Ee(o)?void 0:_e(o));if(i){if(void 0===t&&(t="default"),r=ot(i,e,t),!it(r)||nt(r))return r;throw lt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,o;if("string"===t&&Ie(r=e.toString)&&!Re(o=We(r,e)))return o;if(Ie(r=e.valueOf)&&!Re(o=We(r,e)))return o;if("string"!==t&&Ie(r=e.toString)&&!Re(o=We(r,e)))return o;throw Se("Can't convert object to primitive value")}(e,t)},dt=fe,ut=function(e){var t=at(e,"string");return dt(t)?t:t+""},ht=X,ct=n.document,pt=ht(ct)&&ht(ct.createElement),mt=!a&&!s((function(){return 7!=Object.defineProperty((e="div",pt?ct.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),ft=a,gt=c,bt=p,vt=C,Ct=$,yt=ut,wt=$e,_t=mt,Et=Object.getOwnPropertyDescriptor;l.f=ft?Et:function(e,t){if(e=Ct(e),t=yt(t),_t)try{return Et(e,t)}catch(e){}if(wt(e,t))return vt(!gt(bt.f,e,t),e[t])};var Wt={},It=a&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Rt=X,St=String,xt=TypeError,Ht=function(e){if(Rt(e))return e;throw xt(St(e)+" is not an object")},Nt=a,Tt=mt,Pt=It,Ft=Ht,At=ut,Mt=TypeError,Ot=Object.defineProperty,zt=Object.getOwnPropertyDescriptor;Wt.f=Nt?Pt?function(e,t,r){if(Ft(e),t=At(t),Ft(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var o=zt(e,t);o&&o.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:o.configurable,enumerable:"enumerable"in r?r.enumerable:o.enumerable,writable:!1})}return Ot(e,t,r)}:Ot:function(e,t,r){if(Ft(e),t=At(t),Ft(r),Tt)try{return Ot(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Mt("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var kt=Wt,Lt=C,$t=a?function(e,t,r){return kt.f(e,t,Lt(1,r))}:function(e,t,r){return e[t]=r,e},Vt={exports:{}},Bt=a,Dt=$e,jt=Function.prototype,Ut=Bt&&Object.getOwnPropertyDescriptor,qt=Dt(jt,"name"),Xt={EXISTS:qt,PROPER:qt&&"something"===function(){}.name,CONFIGURABLE:qt&&(!Bt||Bt&&Ut(jt,"name").configurable)},Yt=j,Gt=Fe,Jt=W(Function.toString);Yt(Gt.inspectSource)||(Gt.inspectSource=function(e){return Jt(e)});var Kt,Qt,Zt,er,tr=Gt.inspectSource,rr=j,or=n.WeakMap,ir=rr(or)&&/native code/.test(String(or)),nr=xe.exports,lr=Ue,sr=nr("keys"),ar={},dr=ir,ur=n,hr=X,cr=$t,pr=$e,mr=Fe,fr=ar,gr=ur.TypeError,br=ur.WeakMap;if(dr||mr.state){var vr=mr.state||(mr.state=new br);vr.get=vr.get,vr.has=vr.has,vr.set=vr.set,Kt=function(e,t){if(vr.has(e))throw gr("Object already initialized");return t.facade=e,vr.set(e,t),t},Qt=function(e){return vr.get(e)||{}},Zt=function(e){return vr.has(e)}}else{var Cr=sr[er="state"]||(sr[er]=lr(er));fr[Cr]=!0,Kt=function(e,t){if(pr(e,Cr))throw gr("Object already initialized");return t.facade=e,cr(e,Cr,t),t},Qt=function(e){return pr(e,Cr)?e[Cr]:{}},Zt=function(e){return pr(e,Cr)}}var yr={set:Kt,get:Qt,has:Zt,enforce:function(e){return Zt(e)?Qt(e):Kt(e,{})},getterFor:function(e){return function(t){var r;if(!hr(t)||(r=Qt(t)).type!==e)throw gr("Incompatible receiver, "+e+" required");return r}}},wr=s,_r=j,Er=$e,Wr=a,Ir=Xt.CONFIGURABLE,Rr=tr,Sr=yr.enforce,xr=yr.get,Hr=Object.defineProperty,Nr=Wr&&!wr((function(){return 8!==Hr((function(){}),"length",{value:8}).length})),Tr=String(String).split("String"),Pr=Vt.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Er(e,"name")||Ir&&e.name!==t)&&(Wr?Hr(e,"name",{value:t,configurable:!0}):e.name=t),Nr&&r&&Er(r,"arity")&&e.length!==r.arity&&Hr(e,"length",{value:r.arity});try{r&&Er(r,"constructor")&&r.constructor?Wr&&Hr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var o=Sr(e);return Er(o,"source")||(o.source=Tr.join("string"==typeof t?t:"")),e};Function.prototype.toString=Pr((function(){return _r(this)&&xr(this).source||Rr(this)}),"toString");var Fr=j,Ar=Wt,Mr=Vt.exports,Or=Te,zr={},kr=Math.ceil,Lr=Math.floor,$r=Math.trunc||function(e){var t=+e;return(t>0?Lr:kr)(t)},Vr=function(e){var t=+e;return t!=t||0===t?0:$r(t)},Br=Vr,Dr=Math.max,jr=Math.min,Ur=function(e,t){var r=Br(e);return r<0?Dr(r+t,0):jr(r,t)},qr=Vr,Xr=Math.min,Yr=function(e){return(t=e.length)>0?Xr(qr(t),9007199254740991):0;var t},Gr=$,Jr=Ur,Kr=Yr,Qr=function(e){return function(t,r,o){var i,n=Gr(t),l=Kr(n),s=Jr(o,l);if(e&&r!=r){for(;l>s;)if((i=n[s++])!=i)return!0}else for(;l>s;s++)if((e||s in n)&&n[s]===r)return e||s||0;return!e&&-1}},Zr={includes:Qr(!0),indexOf:Qr(!1)},eo=$e,to=$,ro=Zr.indexOf,oo=ar,io=W([].push),no=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");zr.f=Object.getOwnPropertyNames||function(e){return function(e,t){var r,o=to(e),i=0,n=[];for(r in o)!eo(oo,r)&&eo(o,r)&&io(n,r);for(;t.length>i;)eo(o,r=t[i++])&&(~ro(n,r)||io(n,r));return n}(e,no)};var lo={};lo.f=Object.getOwnPropertySymbols;var so=K,ao=zr,uo=lo,ho=Ht,co=W([].concat),po=so("Reflect","ownKeys")||function(e){var t=ao.f(ho(e)),r=uo.f;return r?co(t,r(e)):t},mo=$e,fo=po,go=l,bo=Wt,vo=function(e,t,r){for(var o=fo(t),i=bo.f,n=go.f,l=0;l<o.length;l++){var s=o[l];mo(e,s)||r&&mo(r,s)||i(e,s,n(t,s))}},Co=s,yo=j,wo=/#|\.prototype\./,_o=function(e,t){var r=Wo[Eo(e)];return r==Ro||r!=Io&&(yo(t)?Co(t):!!t)},Eo=_o.normalize=function(e){return String(e).replace(wo,".").toLowerCase()},Wo=_o.data={},Io=_o.NATIVE="N",Ro=_o.POLYFILL="P",So=_o,xo=n,Ho=l.f,No=$t,To=function(e,t,r,o){o||(o={});var i=o.enumerable,n=void 0!==o.name?o.name:t;if(Fr(r)&&Mr(r,n,o),o.global)i?e[t]=r:Or(t,r);else{try{o.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:Ar.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e},Po=Te,Fo=vo,Ao=So,Mo=function(e,t){var r,o,i,n,l,s=e.target,a=e.global,d=e.stat;if(r=a?xo:d?xo[s]||Po(s,{}):(xo[s]||{}).prototype)for(o in t){if(n=t[o],i=e.dontCallGetSet?(l=Ho(r,o))&&l.value:r[o],!Ao(a?o:s+(d?".":"#")+o,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;Fo(n,i)}(e.sham||i&&i.sham)&&No(n,"sham",!0),To(r,o,n,e)}},Oo={};Oo[rt("toStringTag")]="z";var zo="[object z]"===String(Oo),ko=j,Lo=x,$o=rt("toStringTag"),Vo=Object,Bo="Arguments"==Lo(function(){return arguments}()),Do=zo?Lo:function(e){var t,r,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Vo(e),$o))?r:Bo?Lo(t):"Object"==(o=Lo(t))&&ko(t.callee)?"Arguments":o},jo=String,Uo=function(e){if("Symbol"===Do(e))throw TypeError("Cannot convert a Symbol value to a string");return jo(e)},qo=Mo,Xo=a,Yo=n,Go=W,Jo=$e,Ko=j,Qo=Q,Zo=Uo,ei=Wt.f,ti=vo,ri=Yo.Symbol,oi=ri&&ri.prototype;if(Xo&&Ko(ri)&&(!("description"in oi)||void 0!==ri().description)){var ii={},ni=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:Zo(arguments[0]),t=Qo(oi,this)?new ri(e):void 0===e?ri():ri(e);return""===e&&(ii[t]=!0),t};ti(ni,ri),ni.prototype=oi,oi.constructor=ni;var li="Symbol(test)"==String(ri("test")),si=Go(oi.valueOf),ai=Go(oi.toString),di=/^Symbol\((.*)\)[^)]+$/,ui=Go("".replace),hi=Go("".slice);ei(oi,"description",{configurable:!0,get:function(){var e=si(this);if(Jo(ii,e))return"";var t=ai(e),r=li?hi(t,7,-1):ui(t,di,"$1");return""===r?void 0:r}}),qo({global:!0,constructor:!0,forced:!0},{Symbol:ni})}var ci,pi,mi=be,fi=TypeError,gi=ut,bi=Wt,vi=C,Ci=Ur,yi=Yr,wi=function(e,t,r){var o=gi(t);o in e?bi.f(e,o,vi(0,r)):e[o]=r},_i=Array,Ei=Math.max,Wi=function(e,t,r){for(var o=yi(e),i=Ci(t,o),n=Ci(void 0===r?o:r,o),l=_i(Ei(n-i,0)),s=0;i<n;i++,s++)wi(l,s,e[i]);return l.length=s,l},Ii=Math.floor,Ri=function(e,t){var r=e.length,o=Ii(r/2);return r<8?Si(e,t):xi(e,Ri(Wi(e,0,o),t),Ri(Wi(e,o),t),t)},Si=function(e,t){for(var r,o,i=e.length,n=1;n<i;){for(o=n,r=e[n];o&&t(e[o-1],r)>0;)e[o]=e[--o];o!==n++&&(e[o]=r)}return e},xi=function(e,t,r,o){for(var i=t.length,n=r.length,l=0,s=0;l<i||s<n;)e[l+s]=l<i&&s<n?o(t[l],r[s])<=0?t[l++]:r[s++]:l<i?t[l++]:r[s++];return e},Hi=Ri,Ni=s,Ti=Z.match(/firefox\/(\d+)/i),Pi=!!Ti&&+Ti[1],Fi=/MSIE|Trident/.test(Z),Ai=Z.match(/AppleWebKit\/(\d+)\./),Mi=!!Ai&&+Ai[1],Oi=Mo,zi=W,ki=we,Li=ze,$i=Yr,Vi=function(e,t){if(!delete e[t])throw fi("Cannot delete property "+mi(t)+" of "+mi(e))},Bi=Uo,Di=s,ji=Hi,Ui=Pi,qi=Fi,Xi=le,Yi=Mi,Gi=[],Ji=zi(Gi.sort),Ki=zi(Gi.push),Qi=Di((function(){Gi.sort(void 0)})),Zi=Di((function(){Gi.sort(null)})),en=!!(pi=[]["sort"])&&Ni((function(){pi.call(null,ci||function(){return 1},1)})),tn=!Di((function(){if(Xi)return Xi<70;if(!(Ui&&Ui>3)){if(qi)return!0;if(Yi)return Yi<603;var e,t,r,o,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(o=0;o<47;o++)Gi.push({k:t+o,v:r})}for(Gi.sort((function(e,t){return t.v-e.v})),o=0;o<Gi.length;o++)t=Gi[o].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));Oi({target:"Array",proto:!0,forced:Qi||!Zi||!en||!tn},{sort:function(e){void 0!==e&&ki(e);var t=Li(this);if(tn)return void 0===e?Ji(t):Ji(t,e);var r,o,i=[],n=$i(t);for(o=0;o<n;o++)o in t&&Ki(i,t[o]);for(ji(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:Bi(t)>Bi(r)?1:-1}}(e)),r=$i(i),o=0;o<r;)t[o]=i[o++];for(;o<n;)Vi(t,o++);return t}});const rn=Array.prototype.indexOf,on=function(e,t){for(let r=0,o=e.length;r>=0&&r<o;r+=1)if(t(e[r],r,e))return e[r]},nn=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")};function ln(){let e=[];return Object.assign(e,ln.prototype),e.initialize.apply(e,arguments),e}ln.prototype=[],ln.prototype.initialize=function(e){e=e||{},this.sortColumn=null==e.sortColumn?[]:e.sortColumn},ln.prototype.add=function(e,t){let r,o;if("splice"in e&&"length"in e)if("number"==typeof t)for(r=0,o=e.length;r<o;r++)this.splice(t++,0,e[r]);else for(r=0,o=e.length;r<o;r++)this.push(e[r]);else"number"==typeof t?this.splice(t,0,e):this.push(e)},ln.prototype.reset=function(e){this.length=0,e&&this.add(e)},ln.prototype.filteredCollection=function(e,t){if(e&&t){let r=new ln({sortColumn:this.sortColumn});for(let o,i=0,n=this.length;i<n;i++)o=this[i],e(o,t)&&(o.__i=i,r.push(o));return r}return null},ln.prototype.onComparatorRequired=null,ln.prototype.onSort=null;let sn=ln.prototype.sort;function an(e,t){let r=e.column,o=e.comparePath||r;"string"==typeof o&&(o=o.split("."));let i,n=o.length,l=n>1,s=t?1:-1,a=t?-1:1;return function(e,t){let r=e[o[0]],d=t[o[0]];if(l)for(i=1;i<n;i++)r=r&&r[o[i]],d=d&&d[o[i]];return r===d?0:null==r?s:null==d?a:r<d?s:a}}function dn(){let e=[];return Object.assign(e,dn.prototype),e.initialize.apply(e,arguments),e}ln.prototype.sort=function(e){let t;if(this.sortColumn.length){let r=[];for(let e=0;e<this.sortColumn.length;e++){t=null;const o=an(this.sortColumn[e],this.sortColumn[e].descending);this.onComparatorRequired&&(t=this.onComparatorRequired(this.sortColumn[e].column,this.sortColumn[e].descending,o)),t||(t=o),r.push(t.bind(this))}if(1===r.length)t=r[0],sn.call(this,t);else{let e,o=r.length;t=function(t,i){for(let n=0;n<o;n++)if(e=r[n](t,i),0!==e)return e;return e},sn.call(this,t)}e||this.onSort&&this.onSort(t)}return t},dn.prototype=[],dn.prototype.initialize=function(){},dn.prototype.get=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].name===e)return this[t];return null},dn.prototype.indexOf=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].name===e)return t;return-1},dn.prototype.getByOrder=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].order===e)return this[t];return null},dn.prototype.normalizeOrder=function(){let e,t=[];for(e=0;e<this.length;e++)t.push(this[e]);for(t.sort((function(e,t){return e.order<t.order?-1:e.order>t.order?1:0})),e=0;e<t.length;e++)t[e].order=e;return this},dn.prototype.getColumns=function(){let e=[];for(let t,r=0;r<this.length;r++)t=this[r],e.push(t);return e.sort(((e,t)=>e.order<t.order?-1:e.order>t.order?1:0)),e},dn.prototype.getVisibleColumns=function(){let e=[];for(let t,r=0;r<this.length;r++)t=this[r],t.visible&&e.push(t);return e.sort(((e,t)=>e.order<t.order?-1:e.order>t.order?1:0)),e},dn.prototype.getMaxOrder=function(){let e=0;for(let t,r=0;r<this.length;r++)t=this[r],t.order>e&&(e=t.order);return e},dn.prototype.moveColumn=function(e,t){if(e&&t){let r,o,i=e.order,n=t.order;if(i<n)for(r=i+1;r<=n;r++)o=this.getByOrder(r),o.order--;else for(r=i-1;r>=n;r--)o=this.getByOrder(r),o.order++;e.order=n}return this};class un{static saveSelection(e){let t=window.getSelection().getRangeAt(0);if(e!==t.commonAncestorContainer&&!function(e,t){for(;(e=e.parentNode)&&e!==t;);return!!e}(t.commonAncestorContainer,e))return null;let r=t.cloneRange();r.selectNodeContents(e),r.setEnd(t.startContainer,t.startOffset);let o=r.toString().length;return{start:o,end:o+t.toString().length}}static restoreSelection(e,t){let r,o=0,i=[e],n=!1,l=!1,s=document.createRange();for(s.setStart(e,0),s.collapse(!0);!l&&(r=i.pop());)if(3===r.nodeType){let e=o+r.length;!n&&t.start>=o&&t.start<=e&&(s.setStart(r,t.start-o),n=!0),n&&t.end>=o&&t.end<=e&&(s.setEnd(r,t.end-o),l=!0),o=e}else{let e=r.childNodes.length;for(;e--;)i.push(r.childNodes[e])}let a=window.getSelection();a.removeAllRanges(),a.addRange(s)}}const hn=Object.prototype.hasOwnProperty,cn=void 0!==Element.prototype.insertAdjacentElement;function pn(e,t,r){t?!1===cn||e instanceof DocumentFragment?r.insertBefore(e,t):t.insertAdjacentElement("beforebegin",e):r.appendChild(e)}function mn(e,t,r,o){return e.parentNode!==o?(t||(t=document.createDocumentFragment()),t.appendChild(e)):(t&&t.childNodes.length>0&&(pn(t,r,o),t=null),e.nextSibling!==r&&pn(e,r,o)),t}class fn{constructor(e){var t;const r=this._p={list:e.list||null,hookScrollEvent:void 0===e.hookScrollEvent||!!e.hookScrollEvent,count:e.count||0,virtual:void 0===e.virtual||!!e.virtual,userItemsParent:e.itemsParent||null,setVirtualWrapperWidth:null===(t=e.autoVirtualWrapperWidth)||void 0===t||t,estimatedItemHeight:20,buffer:5,itemHeightEstimatorFn:null,itemElementCreatorFn:vn,onItemRender:null,onItemUnrender:null,onScrollHeightChange:e.onScrollHeightChange,virtualWrapper:null,currentItemsParent:null,cachedItemHeights:[],cachedItemEstimatedHeights:[],cachedItemPositions:[],itemPositionsNeedsUpdate:0,boundRender:this.render.bind(this),existingEls:[]};r.currentItemsParent=r.userItemsParent||r.list,"boolean"==typeof e.hookScrollEvent?this.setHookScrollEvent(e.hookScrollEvent):this._hookEvents(),"number"==typeof e.count&&this.setCount(e.count),"boolean"==typeof e.virtual&&this.setVirtual(e.virtual),"number"==typeof e.estimatedItemHeight&&this.setEstimatedItemHeight(e.estimatedItemHeight),"number"==typeof e.buffer&&this.setBuffer(e.buffer),"function"==typeof e.itemHeightEstimatorFn&&this.setItemHeightEstimatorFn(e.itemHeightEstimatorFn),"function"==typeof e.itemElementCreatorFn&&this.setItemElementCreatorFn(e.itemElementCreatorFn),"function"==typeof e.onItemRender&&this.setOnItemRender(e.onItemRender),"function"==typeof e.onItemUnrender&&this.setOnItemUnrender(e.onItemUnrender)}destroy(){this._unhookEvents().invalidate()._destroyElements()}setHookScrollEvent(e){const t=this._p;return e=void 0===e||!!e,t.hookScrollEvent===e||(t.hookScrollEvent=e,this._unhookEvents()._hookEvents()),this}isHookScrollEventEnabled(){return this._p.hookScrollEvent}setCount(e){return this._p.count=e,this.invalidatePositions()}getCount(){return this._p.count}setVirtual(e){const t=this._p;return e=void 0===e||!!e,t.virtual===e||(t.virtual=e,this._hookEvents().invalidate()._destroyElements()),this}isVirtual(){return this._p.virtual}setEstimatedItemHeight(e){return this._p.estimatedItemHeight=Math.abs(("number"==typeof e?e:Number(e))||20),this}getEstimatedItemHeight(){return this._p.estimatedItemHeight}setAutoVirtualWrapperWidth(e){const t=this._p;return t.autoVirtualWrapperWidth=void 0===e||!!e,t.virtualWrapper&&t.autoVirtualWrapperWidth!==t.virtualWrapperWidthWasSet&&(t.virtualWrapper.style.width=t.autoVirtualWrapperWidth?"100%":"",t.virtualWrapperWidthWasSet=t.autoVirtualWrapperWidth),this}isAutoVirtualWrapperWidth(){return this._p.autoVirtualWrapperWidth}setBuffer(e){return this._p.buffer=Math.abs("number"==typeof e?e:Number(e)||5),this}getBuffer(){return this._p.buffer}setItemHeightEstimatorFn(e){return this._p.itemHeightEstimatorFn=e,this}setItemElementCreatorFn(e){return this._p.itemElementCreatorFn=e||vn,this}setOnItemRender(e){return this._p.onItemRender=e,this}setOnItemUnrender(e){return this._p.onItemUnrender=e,this}setOnScrollHeightChange(e){return this._p.onScrollHeightChange=e,this}estimateFullHeight(){const e=this._p;if(0===e.count)return 0;if(e.virtual)return this._calculateItemPosition(e.count)||0;{const t=e.existingEls;if(e.count===t.length){let e=t[0].getBoundingClientRect(),r=t[t.length-1].getBoundingClientRect();return r.top-e.top+r.height}return this._calculateItemPosition(e.count)||0}}invalidatePositions(){const e=this._p;return e.itemPositionsNeedsUpdate=0,e.cachedItemHeights=[],e.cachedItemEstimatedHeights=[],e.cachedItemPositions=[],e.cachedItemHeights.length=e.count,e.cachedItemEstimatedHeights.length=e.count,e.cachedItemPositions.length=e.count,this}invalidate(){const e=this._p;this.invalidatePositions();const t=e.onItemUnrender,r=e.existingEls;for(let e=0;e<r.length;e++){const o=r[e];void 0!==o[gn]&&(t&&t(o),delete o[gn])}return this}render(){const e=this._p,t=e.list,r=e.virtual;let o=e.virtualWrapper,i=e.currentItemsParent,n=t.scrollTop,l=n+t.clientHeight,s=e.count,a=e.buffer,d=e.onItemUnrender,u=e.existingEls,h=u.length;if(r){const r=t.clientWidth;o||(o=e.virtualWrapper=e.userItemsParent,o||(o=e.virtualWrapper=document.createElement("div"),t.appendChild(o)),this._resetCurrentItemsParent(),i=e.currentItemsParent,e.autoVirtualWrapperWidth?(o.style.width="100%",e.virtualWrapperWidthWasSet=!0):e.virtualWrapperWidthWasSet=!1);for(let e=0;e<h;e++)u[e][bn]=!0;this._calculateItemPosition(e.count-1);let d=this._getExistingElsRange(),p=Cn(e.cachedItemPositions,n),m=Math.max(0,p-a),f=m,g=this._calculateItemPosition(f),b=a,v=Math.max(f,Cn(e.cachedItemPositions,l-1)+1+a),C=[],y=null,w=o.childNodes[0];const _=function(e){let t;return-1!==d.firstIndex&&e>=d.firstIndex&&e<=d.lastIndex&&(t=u.find((t=>t[gn]===e&&!0===t[bn]))),void 0===t&&(t=(d.firstIndex<m||d.firstValidArrayIndex>0?u.find((e=>(e[gn]<m||!1===hn.call(e,gn))&&!0===e[bn])):void 0)||wn(u,(e=>!0===e[bn]))),void 0!==t&&delete t[bn],t};for(;f<s&&f<v;f++){let e=_(f);w&&w===e&&(w=w.nextSibling);const t=this._dequeueElementForIndex(e,f,w,!0);C.push([t,f]),y=mn(t,y,w,i)}y&&y.childNodes.length>0&&pn(y,w,i);for(let t of C){const r=t[1];this._insertItemAndFlow(t[0],r,!1),g=e.cachedItemPositions[r]+e.cachedItemHeights[r]}if(g<l)for(;(g<l||b-- >0)&&f<s;f++){let t=_(f);w&&w===t&&(w=w.nextSibling),this._dequeueElementForIndex(t,f,w,!1),g=e.cachedItemPositions[f]+e.cachedItemHeights[f]}let E=this.estimateFullHeight(),W=E+"px";var c;o.style.height!==W&&(e.virtualWrapper.style.height=W,null===(c=e.onScrollHeightChange)||void 0===c||c.call(e,E)),r!==t.clientWidth&&this.render()}else if(s!==u.length){for(let e=0;e<h;e++)u[e][bn]=!0;let e=i.childNodes[0],t=null;for(let r=0;r<s;r++){let o=u.find((e=>e[gn]===r&&!0===e[bn]));void 0!==o&&delete o[bn],e&&e===o&&(e=e.nextSibling),t=mn(this._dequeueElementForIndex(o,r,e,!0),t,e,i)}t&&t.childNodes.length>0&&pn(t,e,i)}h=u.length;for(let e=0;e<h;e++){const t=u[e];if(!0!==t[bn])continue;let r=t.parentNode;r&&r.removeChild(t),d&&void 0!==t[gn]&&d(t),u.splice(e,1),e--,h--}}addItemsAt(e,t=-1){if("number"!=typeof e||e<=0)return this;const r=this._p;if((t<-1||t>=r.count)&&(t=r.count),r.count+=e,r.virtual)t>=0&&t<r.count&&this._invalidateItemIndexesAt(t,-1);else{let o=r.existingEls;if(o.length!==r.count-e)return this;let i=this._getExistingElsRange();if(-1===i.firstValidArrayIndex)return this;const n=r.currentItemsParent;let l=i.firstValidArrayIndex+t-i.firstIndex;this._pushItemIndexesAt(t,e);let s=o[l-1]?o[l-1].nextSibling:o[0],a=null;for(let r=t,o=t+e;r<o;r++)a=mn(this._dequeueElementForIndex(void 0,r,s,!0),a,s,n);a&&a.childNodes.length>0&&pn(a,s,n)}return this}removeItemsAt(e,t){const r=this._p;if("number"!=typeof e||"number"!=typeof t||e<=0||t<0||t>=r.count)return this;if(r.count-=Math.min(e,r.count-t),r.virtual)this._invalidateItemIndexesAt(t,-1);else{let o=r.existingEls;if(o.length!==r.count+e)return this;let i=this._getExistingElsRange();if(-1===i.firstValidArrayIndex)return this;this._pushItemIndexesAt(t+e,-e);const n=r.onItemUnrender;let l=i.firstValidArrayIndex+t-i.firstIndex;if(l<o.length){for(let t=0;t<e;t++){let e=o[l+t],r=e.parentNode;r&&r.removeChild(e),n&&void 0!==e[gn]&&n(e)}o.splice(l,e)}}return this}refreshItemAt(e){const t=this._p;if("number"!=typeof e||e<0||e>=t.count)return this;if(t.virtual)this._invalidateItemIndexesAt(e,1);else{let r=t.existingEls;if(r.length!==t.count)return this;let o=this._getExistingElsRange();if(e>=o.firstIndex&&e<=o.lastIndex){let t=r[o.firstValidArrayIndex+e-o.firstIndex];delete t[gn],this._dequeueElementForIndex(t,e,t.nextSibling,!1)}}return this}isItemRendered(e){const t=this._p;if("number"!=typeof e||e<0||e>=t.count)return!1;let r=this._getExistingElsRange();return e>=r.firstIndex&&e<=r.lastIndex}getItemElementAt(e){const t=this._p;if("number"!=typeof e||e<0||e>=t.count)return;let r=t.existingEls,o=this._getExistingElsRange();return e>=o.firstIndex&&e<=o.lastIndex?r[o.firstValidArrayIndex+e-o.firstIndex]:void 0}getItemPosition(e){const t=this._p;if(!("number"!=typeof e||e<0||e>=t.count)){if(t.virtual)return this._calculateItemPosition(e);{let o=this.getItemElementAt(e);if(void 0===o)return;const i=t.list;return r.getElementOffset(o).top-r.getElementOffset(i).top+i.scrollTop}}}getItemIndexFromElement(e){return e?e[gn]:void 0}getItemSize(e){const t=this._p;if("number"!=typeof e||e<0||e>=t.count)return;let r=t.cachedItemHeights[e-1];return void 0===r&&(r=t.itemHeightEstimatorFn?t.itemHeightEstimatorFn(e-1):null,"number"!=typeof r&&(r=t.estimatedItemHeight),t.cachedItemEstimatedHeights[e-1]=r),r}getVisibleItemCount(){const e=this._p,t=e.list;let r,o,i=t.scrollTop,n=t.clientHeight;if(e.virtual)r=Cn(e.cachedItemPositions,i),o=Cn(e.cachedItemPositions,i+n,r);else{const t=e=>{let t=this.getItemPosition(e);return void 0===t&&(t=1/0),t};r=yn(e.count,t,i),o=yn(e.count,t,i+n,r)}return this.getItemPosition(o)===i+n&&o--,o-r+1}createGhostItemElement(e,t,r){const o=this._p;let i=this._dequeueElementForIndex(null,e,!1,!0);try{t&&o.currentItemsParent.appendChild(i),r(i)}finally{if(t){let e=i.parentNode;e&&e.removeChild(i)}o.onItemUnrender&&o.onItemUnrender(i)}}_resetCurrentItemsParent(){var e,t;const r=this._p;r.currentItemsParent=null!==(e=null!==(t=r.virtualWrapper)&&void 0!==t?t:r.userItemsParent)&&void 0!==e?e:r.list}_destroyElements(){const e=this._p,t=e.onItemUnrender,r=e.existingEls;for(let e=0;e<r.length;e++){const o=r[e];let i=o.parentNode;i&&i.removeChild(o),t&&void 0!==o[gn]&&t(o)}return r.length=0,e.virtualWrapper&&(e.virtualWrapper!==e.userItemsParent&&e.virtualWrapper.parentNode&&e.virtualWrapper.parentNode.removeChild(e.virtualWrapper),e.virtualWrapper=null,this._resetCurrentItemsParent()),this}_invalidateItemIndexesAt(e,t){const r=this._p;this._setItemPositionsNeedsUpdate(e);let o=r.existingEls,i=o.length,n=this._getExistingElsRange();if(-1!==n.firstValidArrayIndex&&(-1===t&&(t=o.length),e>=n.firstIndex&&e<=n.lastIndex))for(let r=n.firstValidArrayIndex+e-n.firstIndex,l=0;r<i&&l<t;r++,l++)delete o[r][gn]}_pushItemIndexesAt(e,t){let r=this._p.existingEls,o=r.length,i=this._getExistingElsRange();if(-1!==i.firstValidArrayIndex&&e>=i.firstIndex&&e<=i.lastIndex)for(let n=i.firstValidArrayIndex+e-i.firstIndex;n<o;n++)r[n][gn]+=t}_hookEvents(){const e=this._p;return this._unhookEvents(),e.virtual&&e.hookScrollEvent&&e.list&&e.list.addEventListener("scroll",e.boundRender),this}_unhookEvents(){const e=this._p;return e.list&&e.list.removeEventListener("scroll",e.boundRender),this}_setItemPositionsNeedsUpdate(e){const t=this._p;e<t.itemPositionsNeedsUpdate&&(t.itemPositionsNeedsUpdate=e)}_calculateItemPosition(e){const t=this._p,r=t.cachedItemPositions;if(e>=t.itemPositionsNeedsUpdate){const o=t.count,i=t.cachedItemHeights,n=t.cachedItemEstimatedHeights,l=t.estimatedItemHeight,s=t.itemHeightEstimatorFn;i.length!==o&&(i.length=o,n.length=o,r.length=o);let a=t.itemPositionsNeedsUpdate,d=Math.min(e,o),u=0;a>0&&(u=r[a-1]);for(let e=a;e<=d;e++){if(0===e){r[e]=u;continue}const t=e-1;let o=i[t];void 0===o&&(o=s?s(t):null,"number"!=typeof o&&(o=l),n[t]=o),u+=o,r[e]=u}t.itemPositionsNeedsUpdate=d+1}if(e>0&&e===t.count){let o=t.cachedItemHeights[e-1];return void 0===o&&(o=t.itemHeightEstimatorFn?t.itemHeightEstimatorFn(e-1):null,"number"!=typeof o&&(o=t.estimatedItemHeight),t.cachedItemEstimatedHeights[e-1]=o),r[e-1]+o}return r[e]}_dequeueElementForIndex(e,t,r,o){const i=this._p,n=i.virtualWrapper;i.currentItemsParent;const l=i.existingEls,s=i.onItemRender,a=i.onItemUnrender,d=!e,u=d||t!==e[gn];if(e?a&&u&&a(e):(e=i.itemElementCreatorFn(),n&&!1!==r&&(e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.right="0")),u&&(e.innerHTML="",s&&s(e,t)),!1!==r){if(r instanceof Node||(r=null),!d){let t=l.indexOf(e);-1!==t&&l.splice(t,1)}let i=r?l.indexOf(r):-1;-1===i?l.push(e):l.splice(i,0,e),o||this._insertItemAndFlow(e,t,r)}return e[gn]=t,e}_insertItemAndFlow(e,t,r){const o=this._p,i=o.virtualWrapper,n=o.currentItemsParent;if(!1!==r&&(r instanceof Node||(r=null),e.parentNode===n&&e.nextSibling===r||pn(e,r,n)),i){let r=e.getBoundingClientRect().height,i=o.cachedItemHeights[t];i!==r&&(o.cachedItemHeights[t]=r),(void 0!==i&&r!==i||void 0===i&&r!==o.cachedItemEstimatedHeights[t])&&this._setItemPositionsNeedsUpdate(t+1);let n=this._calculateItemPosition(t);const l=En();!1===l?e.style.top=`${n}px`:e.style[l]=`translateY(${n}px)`}}_getExistingElsRange(){const e=this._p.existingEls;let t=-1,r=-1;for(let r=0,o=e.length;r<o;r++)if(!1!==hn.call(e[r],gn)){t=r;break}for(let t=e.length-1;t>=0;t--)if(!1!==hn.call(e[t],gn)){r=t;break}return{firstValidArrayIndex:t,lastValidArrayIndex:r,firstIndex:-1!==t?e[t][gn]:-1,lastIndex:-1!==r?e[r][gn]:-1}}}const gn=Symbol("index"),bn=Symbol("reuse"),vn=()=>document.createElement("li"),Cn=(e,t,r=0,o=-1)=>{let i=e.length;if(o<0&&(o+=i),o<=r)return o;for(;r<=o;){let n=Math.floor(r+(o-r)/2),l=e[n];if(l===t||l<=t&&n<i&&e[n+1]>t){for(;n>0&&e[n-1]===l;)n--;return n}l<t?r=n+1:o=n-1}return-1===o?0:i-1},yn=(e,t,r,o=0,i=-1)=>{if(i<0&&(i+=e),i<=o)return i;for(;o<=i;){let n=Math.floor(o+(i-o)/2),l=t(n);if(l===r||l<=r&&n<e&&t(n+1)>r){for(;n>0&&t(n-1)===l;)n--;return n}l<r?o=n+1:i=n-1}return-1===i?0:t(e-1)},wn=(e,t)=>{for(let r=e.length-1;r>=0;r--)if(t(e[r]))return e[r]};let _n=null;const En=()=>{if(null===_n){let e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],t=document.createElement("div");_n=!1;for(let r of e)if(t&&void 0!==t.style[r]){_n=r;break}}return _n};function Wn(e,t){let r=t.column,o=null==t.keyword?"":t.keyword.toString();if(!o||!r)return!0;let i=e[r];return null!=i&&(i=i.toString(),t.caseSensitive||(i=i.toLowerCase(),o=o.toLowerCase()),-1!==i.indexOf(o))}const In=Array.prototype.indexOf,Rn=e;let Sn=navigator.userAgent,xn=-1!==Sn.indexOf("MSIE ")?parseFloat(Sn.substr(Sn.indexOf("MSIE ")+5)):null,Hn=xn&&xn<10,Nn=document.createElement.bind(document);const Tn=Object.prototype.hasOwnProperty,Pn=Symbol("safe"),Fn=Symbol("hover_in"),An=Symbol("hover_out"),Mn=Symbol("row_click");function On(e){var t,r;t=["relative","absolute","fixed"],r=e.css("position"),rn.call(t,r)>=0||e.css("position","relative")}const zn=e=>/^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(e.target.tagName);let kn=function e(){if(!(this instanceof e))return new(Function.prototype.bind.apply(e,[e].concat(Array.prototype.slice.call(arguments,0))));this.initialize.apply(this,arguments)};kn.VERSION="@@VERSION",kn.prototype.VERSION=kn.VERSION,kn.prototype.initialize=function(e){let t=this;e=e||{};let r=t.o={},o=t.p={};o.events={},t.el=e.el&&e.el instanceof Element?e.el:document.createElement("div");let i=t.$el=Rn(t.el);t.el!==e.el&&i.addClass(e.className||"dgtable-wrapper"),i.data("control",t).data("dgtable",t),i.on("remove",(()=>t.destroy())),o.onMouseMoveResizeAreaBound=this._onMouseMoveResizeArea.bind(this),o.onEndDragColumnHeaderBound=this._onEndDragColumnHeader.bind(this),o.onTableScrolledHorizontallyBound=this._onTableScrolledHorizontally.bind(this),this.$el.on("dragend",o.onEndDragColumnHeaderBound),o.tableSkeletonNeedsRendering=!0,r.virtualTable=void 0===e.virtualTable||!!e.virtualTable,r.estimatedRowHeight=e.estimatedRowHeight||void 0,r.rowsBufferSize=e.rowsBufferSize||3,r.minColumnWidth=Math.max(e.minColumnWidth||35,0),r.resizeAreaWidth=e.resizeAreaWidth||8,r.resizableColumns=void 0===e.resizableColumns||!!e.resizableColumns,r.movableColumns=void 0===e.movableColumns||!!e.movableColumns,r.sortableColumns=void 0===e.sortableColumns?1:parseInt(e.sortableColumns,10)||1,r.adjustColumnWidthForSortArrow=void 0===e.adjustColumnWidthForSortArrow||!!e.adjustColumnWidthForSortArrow,r.convertColumnWidthsToRelative=void 0!==e.convertColumnWidthsToRelative&&!!e.convertColumnWidthsToRelative,r.autoFillTableWidth=void 0!==e.autoFillTableWidth&&!!e.autoFillTableWidth,r.cellClasses=void 0===e.cellClasses?"":e.cellClasses,r.resizerClassName=void 0===e.resizerClassName?"dgtable-resize":e.resizerClassName,r.tableClassName=void 0===e.tableClassName?"dgtable":e.tableClassName,r.allowCellPreview=void 0===e.allowCellPreview||e.allowCellPreview,r.allowHeaderCellPreview=void 0===e.allowHeaderCellPreview||e.allowHeaderCellPreview,r.cellPreviewClassName=void 0===e.cellPreviewClassName?"dgtable-cell-preview":e.cellPreviewClassName,r.cellPreviewAutoBackground=void 0===e.cellPreviewAutoBackground||e.cellPreviewAutoBackground,r.onComparatorRequired=void 0===e.onComparatorRequired?null:e.onComparatorRequired,r.onComparatorRequired||"function"!=typeof e.comparatorCallback||(r.onComparatorRequired=e.comparatorCallback),r.width=void 0===e.width?kn.Width.NONE:e.width,r.relativeWidthGrowsToFillWidth=void 0===e.relativeWidthGrowsToFillWidth||!!e.relativeWidthGrowsToFillWidth,r.relativeWidthShrinksToFillWidth=void 0!==e.relativeWidthShrinksToFillWidth&&!!e.relativeWidthShrinksToFillWidth,this.setCellFormatter(e.cellFormatter),this.setHeaderCellFormatter(e.headerCellFormatter),this.setFilter(e.filter),r.height=e.height,t.setColumns(e.columns||[],!1);let n=[];if(e.sortColumn){let t=e.sortColumn;if(t&&!Array.isArray(t)&&(t=[t]),t)for(let e=0,r=t.length;e<r;e++){let r=t[e];"string"==typeof r&&(r={column:r,descending:!1});let i=o.columns.get(r.column);i&&n.push({column:r.column,comparePath:i.comparePath||i.dataPath,descending:r.descending})}}o.rows=new ln({sortColumn:n}),o.rows.onComparatorRequired=(e,t,o)=>{if(r.onComparatorRequired)return r.onComparatorRequired(e,t,o)},o.filteredRows=null,o.scrollbarWidth=0,o.lastVirtualScrollHeight=0,this._setupHovers()},kn.prototype._setupHovers=function(){const e=this,t=e.p;let r=function(t){let r=t.fromElement||t.relatedTarget;r===this||Rn.contains(this,r)||this.__previewCell&&(r===this.__previewCell||Rn.contains(this.__previewCell,r))||e._cellMouseOverEvent.call(e,this)},o=function(t){let r=(t=t||event).toElement||t.relatedTarget;r===this||Rn.contains(this,r)||this.__previewCell&&(r===this.__previewCell||Rn.contains(this.__previewCell,r))||e._cellMouseOutEvent.call(e,this)};t._bindCellHoverIn=function(e){e[Fn]||e.addEventListener("mouseover",e[Fn]=r.bind(e))},t._unbindCellHoverIn=function(e){e[Fn]&&(e.removeEventListener("mouseover",e[Fn]),e[Fn]=null)},t._bindCellHoverOut=function(e){return e[An]||e.addEventListener("mouseout",e[An]=o.bind(e.__cell||e)),this},t._unbindCellHoverOut=function(e){return e[An]&&(e.removeEventListener("mouseout",e[An]),e[An]=null),this}},kn.prototype._setupVirtualTable=function(){var e;const t=this,r=t.p,o=t.o,i=o.tableClassName,n=i+"-row",l=i+"-row-alt",s=i+"-cell";let a=r.visibleColumns,d=a.length;r.notifyRendererOfColumnsConfig=()=>{a=r.visibleColumns,d=a.length;for(let e,t=0;t<d;t++)e=a[t],e._finalWidth=e.actualWidthConsideringScrollbarWidth||e.actualWidth},r.virtualListHelper=new fn({list:r.table,itemsParent:r.tbody,autoVirtualWrapperWidth:!1,virtual:o.virtualTable,buffer:o.rowsBufferSize,estimatedItemHeight:o.estimatedRowHeight?o.estimatedRowHeight:r.virtualRowHeight||40,itemElementCreatorFn:()=>Nn("div"),onItemRender:(e,i)=>{const u=r.filteredRows||r.rows,h=!!r.filteredRows,c=o.allowCellPreview;e.className=n,i%2==1&&(e.className+=" "+l);let p=u[i],m=h?p.__i:i;e.rowIndex=i,e.physicalRowIndex=m;for(let t=0;t<d;t++){let o=a[t],i=Nn("div");i.columnName=o.name,i.setAttribute("data-column",o.name),i.className=s,i.style.width=o._finalWidth+"px",o.cellClasses&&(i.className+=" "+o.cellClasses),c&&r._bindCellHoverIn(i),i.appendChild(Nn("div")).innerHTML=this._getHtmlForCell(p,o),e.appendChild(i)}e.addEventListener("click",e[Mn]=r=>{t.trigger("rowclick",r,i,m,e,p)}),t.trigger("rowcreate",i,m,e,p)},onItemUnrender:e=>{e[Mn]&&e.removeEventListener("click",e[Mn]),t._unbindCellEventsForRow(e),t.trigger("rowdestroy",e)},onScrollHeightChange:e=>{e>r._lastVirtualScrollHeight&&!r.scrollbarWidth&&this._updateLastCellWidthFromScrollbar(),r._lastVirtualScrollHeight=e}}),r.virtualListHelper.setCount((null!==(e=r.filteredRows)&&void 0!==e?e:r.rows).length),r.notifyRendererOfColumnsConfig()},kn.prototype.on=function(e,t){let r=this.p.events;return"function"!=typeof t||(Tn.call(r,e)||(r[e]=[]),r[e].push({cb:t,once:!1})),this},kn.prototype.once=function(e,t){let r=this.p.events;return"function"!=typeof t||(Tn.call(r,e)||(r[e]=[]),r[e].push({cb:t,once:!0})),this},kn.prototype.off=function(e,t){let r=this.p.events;if(!Tn.call(r,e))return this;let o=r[e];for(let e=0;e<o.length;e++){let r=o[e];t&&r.cb!==t||o.splice(e--,1)}return this},kn.prototype.trigger=function(e){const t=this.p;if(!t)return;let r=t.events;if(Tn.call(r,e)){let t=r[e];for(let e=0;e<t.length;e++){let r=t[e];r.once&&t.splice(e--,1),r.cb.apply(this,Array.prototype.slice.call(arguments,1))}}return this},kn.prototype._parseColumnWidth=function(e,t){let r=Math.max(0,parseFloat(e)),o=Ln.AUTO;return r>0&&(e===r+"%"?(o=Ln.RELATIVE,r/=100):r>0&&r<1?o=Ln.RELATIVE:(r<t&&(r=t),o=Ln.ABSOLUTE)),{width:r,mode:o}},kn.prototype._initColumnFromData=function(e){let t=this._parseColumnWidth(e.width,e.ignoreMin?0:this.o.minColumnWidth),r={name:e.name,label:void 0===e.label?e.name:e.label,width:t.width,widthMode:t.mode,resizable:void 0===e.resizable||e.resizable,sortable:void 0===e.sortable||e.sortable,movable:void 0===e.movable||e.movable,visible:void 0===e.visible||e.visible,cellClasses:void 0===e.cellClasses?this.o.cellClasses:e.cellClasses,ignoreMin:void 0!==e.ignoreMin&&!!e.ignoreMin};return r.dataPath=void 0===e.dataPath?r.name:e.dataPath,r.comparePath=void 0===e.comparePath?r.dataPath:e.comparePath,"string"==typeof r.dataPath&&(r.dataPath=r.dataPath.split(".")),"string"==typeof r.comparePath&&(r.comparePath=r.comparePath.split(".")),r},kn.prototype.close=kn.prototype.remove=kn.prototype.destroy=function(){var e;let t=this,r=t.p||{},o=t.$el;if(t.__removed)return t;if(r.$resizer&&(r.$resizer.remove(),r.$resizer=null),null===(e=r.virtualListHelper)||void 0===e||e.destroy(),r.virtualListHelper=null,this._destroyHeaderCells(),r.$table&&r.$table.empty(),r.$tbody&&r.$tbody.empty(),r.workerListeners){for(let e=0;e<r.workerListeners.length;e++){let t=r.workerListeners[e];t.worker.removeEventListener("message",t.listener,!1)}r.workerListeners.length=0}r.rows.length=r.columns.length=0,r._deferredRender&&clearTimeout(r._deferredRender);for(let e in t)Tn.call(t,e)&&(t[e]=null);return t.__removed=!0,o&&o.remove(),this},kn.prototype._unbindCellEventsForTable=function(){const e=this.p;if(e.headerRow)for(let t=0,r=e.headerRow.childNodes,o=r.length;t<o;t++)for(let o=0,i=r[t].childNodes,n=i.length;o<n;o++)e._unbindCellHoverIn(i[o]);return this},kn.prototype._unbindCellEventsForRow=function(e){const t=this.p;for(let r=0,o=e.childNodes,i=o.length;r<i;r++)t._unbindCellHoverIn(o[r]);return this},kn.prototype.render=function(){const e=this.o,r=this.p;if(!this.el.offsetParent)return r._deferredRender||(r._deferredRender=setTimeout((()=>{r._deferredRender=null,!this.__removed&&this.el.offsetParent&&this.render()}))),this;if(!0===r.tableSkeletonNeedsRendering){var o;r.tableSkeletonNeedsRendering=!1,e.width===kn.Width.AUTO&&this._clearSortArrows();let i=r.table&&r.table.parentNode?r.table.scrollTop:NaN,n=r.table&&r.table.parentNode?t.getScrollHorz(r.table):NaN;this._renderSkeletonBase()._renderSkeletonBody().tableWidthChanged(!0,!1)._renderSkeletonHeaderCells(),r.virtualListHelper.setCount((null!==(o=r.filteredRows)&&void 0!==o?o:r.rows).length),this._updateVirtualHeight(),this._updateLastCellWidthFromScrollbar(!0),this._updateTableWidth(!0);for(let e=0;e<r.rows.sortColumn.length;e++)this._showSortArrow(r.rows.sortColumn[e].column,r.rows.sortColumn[e].descending);e.adjustColumnWidthForSortArrow&&r.rows.sortColumn.length?this.tableWidthChanged(!0):e.virtualTable||this.tableWidthChanged(),isNaN(i)||(r.table.scrollTop=i),isNaN(n)||(t.setScrollHorz(r.table,n),t.setScrollHorz(r.header,n)),this.trigger("renderskeleton")}return r.virtualListHelper.render(),this.trigger("render"),this},kn.prototype.clearAndRender=function(e){var t;let r=this.p;return r.tableSkeletonNeedsRendering=!0,null===(t=r.notifyRendererOfColumnsConfig)||void 0===t||t.call(r),(void 0===e||e)&&this.render(),this},kn.prototype._calculateTbodyWidth=function(){const e=this.p;let t,o,i,n=this.o.tableClassName,l=n+"-row",s=n+"-cell",a=e.visibleColumns,d=a.length,u=Rn("<div>").addClass(l).css("float","left"),h=0;for(o=0;o<d;o++)i=a[o],t=Nn("div"),t.className=s,t.style.width=i.actualWidth+"px",i.cellClasses&&(t.className+=" "+i.cellClasses),t.appendChild(Nn("div")),u.append(t),h+=i.actualWidth;let c=Rn("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",float:"left",width:"1px",overflow:"hidden"}).append(Rn("<div>").addClass(n).append(Rn("<div>").addClass(n+"-body").css("width",h+1e4).append(u)));c.appendTo(document.body);let p=Rn('<div style="border:1.5px solid #000;width:0;height:0;position:absolute;left:0;top:-9999px">').appendTo(document.body),m=parseFloat(p.css("border-width")),f=Math.round(m)!==m;p.remove();let g=r.getElementWidth(u[0],!0,!0,!0);return g-=e.scrollbarWidth||0,f&&g++,c.remove(),g},kn.prototype.setColumns=function(e,t){const r=this.p;e=e||[];let o=new dn;for(let t=0,r=0;t<e.length;t++){let i=e[t],n=this._initColumnFromData(i);void 0!==i.order?(i.order>r&&(r=i.order+1),n.order=i.order):n.order=r++,o.push(n)}return o.normalizeOrder(),r.columns=o,r.visibleColumns=o.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(t),this},kn.prototype.addColumn=function(e,t,r){const o=this.p;let i=o.columns;if(e&&!i.get(e.name)){let n=null;void 0!==t&&(n=i.get(t)||i.getByOrder(t));let l=this._initColumnFromData(e);l.order=n?n.order:i.getMaxOrder()+1;for(let e=i.getMaxOrder(),t=l.order;e>=t;e--){let t=i.getByOrder(e);t&&t.order++}i.push(l),i.normalizeOrder(),o.visibleColumns=i.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(r),this.trigger("addcolumn",l.name)}return this},kn.prototype.removeColumn=function(e,t){const r=this.p;let o=r.columns,i=o.indexOf(e);return i>-1&&(o.splice(i,1),o.normalizeOrder(),r.visibleColumns=o.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(t),this.trigger("removecolumn",e)),this},kn.prototype.setCellFormatter=function(e){return e||((e=e=>"string"==typeof e?nn(e):e)[Pn]=!0),this.o.cellFormatter=e,this},kn.prototype.setHeaderCellFormatter=function(e){return this.o.headerCellFormatter=e||function(e){return"string"==typeof e?nn(e):e},this},kn.prototype.setFilter=function(e){return this.o.filter=e,this},kn.prototype.filter=function(e){const t=this.p;let r=this.o.filter||Wn;"string"==typeof arguments[0]&&"string"==typeof arguments[1]&&(e={column:arguments[0],keyword:arguments[1],caseSensitive:arguments[2]});let o=!!t.filteredRows;return t.filteredRows&&(t.filteredRows=null),t.filterArgs=null==e?null:"object"!=typeof e||Array.isArray(e)?e:Rn.extend({},e),null!==t.filterArgs?(t.filteredRows=t.rows.filteredCollection(r,t.filterArgs),(o||t.filteredRows)&&(this.clearAndRender(),this.trigger("filter",e))):(t.filterArgs=null,t.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},kn.prototype.clearFilter=function(){const e=this.p;return e.filteredRows&&(e.filterArgs=null,e.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},kn.prototype._refilter=function(){const e=this.p;if(e.filteredRows&&e.filterArgs){let t=this.o.filter||Wn;e.filteredRows=e.rows.filteredCollection(t,e.filterArgs)}return this},kn.prototype.setColumnLabel=function(e,t){let r=this.p.columns.get(e);if(r&&(r.label=void 0===t?r.name:t,r.element))for(let e=0;e<r.element[0].firstChild.childNodes.length;e++){let t=r.element[0].firstChild.childNodes[e];if(3===t.nodeType){t.textContent=r.label;break}}return this},kn.prototype.moveColumn=function(e,t,r=!0){const o=this.o,i=this.p;let n,l,s=i.columns,a=r?i.visibleColumns:s.getColumns();if("string"==typeof e?n=s.get(e):"number"==typeof e&&(n=a[e]),"string"==typeof t?l=s.get(t):"number"==typeof t&&(l=a[t]),n&&l&&e!==t){let e=n.order,t=l.order,r=s.moveColumn(n,l).getVisibleColumns();if(i.visibleColumns.length!==r.length||i.visibleColumns.some(((e,t)=>e!==r[t])))if(i.visibleColumns=r,this._ensureVisibleColumns(),o.virtualTable)this.clearAndRender();else{let r=i.$headerRow.find(">div."+o.tableClassName+"-header-cell"),n=e<t?t+1:t,l=e;r[0].parentNode.insertBefore(r[l],r[n]);let s=i.visibleColumns[e];s=(s.actualWidthConsideringScrollbarWidth||s.actualWidth)+"px";let a=i.visibleColumns[t];a=(a.actualWidthConsideringScrollbarWidth||a.actualWidth)+"px";let d=i.tbody.childNodes;for(let r=0,o=d.length;r<o;r++){let o=d[r];1===o.nodeType&&(o.insertBefore(o.childNodes[l],o.childNodes[n]),o.childNodes[t].firstChild.style.width=a,o.childNodes[e].firstChild.style.width=s)}}this.trigger("movecolumn",n.name,e,t)}return this},kn.prototype.sort=function(e,t,r){const o=this.o,i=this.p;let n,l=i.columns.get(e),s=i.rows.sortColumn;if(l){if(s.length&&s[s.length-1].column===e&&(t=void 0===t?!s[s.length-1].descending:t),r){for(let e=0;e<s.length;e++)if(s[e].column===l.name){e<s.length-1?s.length=0:s.splice(s.length-1,1);break}(o.sortableColumns>0&&s.length>=o.sortableColumns||s.length>=i.visibleColumns.length)&&(s.length=0)}else s.length=0;t=void 0!==t&&t,s.push({column:l.name,comparePath:l.comparePath||l.dataPath,descending:!!t})}else s.length=0;this._clearSortArrows();for(let e=0;e<s.length;e++)this._showSortArrow(s[e].column,s[e].descending);o.adjustColumnWidthForSortArrow&&!i.tableSkeletonNeedsRendering&&this.tableWidthChanged(!0),i.rows.sortColumn=s,s.length&&(n=i.rows.sort(!!i.filteredRows),i.filteredRows&&i.filteredRows.sort(!!i.filteredRows)),i.virtualListHelper.invalidate().render();let a=[];for(let e=0;e<s.length;e++)a.push({column:s[e].column,descending:s[e].descending});return this.trigger("sort",a,!0,n),this},kn.prototype.resort=function(){const e=this.p;let t=e.columns,r=e.rows.sortColumn;if(r.length){for(let e=0;e<r.length;e++)t.get(r[e].column)||r.splice(e--,1);let o;e.rows.sortColumn=r,r.length&&(o=e.rows.sort(!!e.filteredRows),e.filteredRows&&e.filteredRows.sort(!!e.filteredRows));let i=[];for(let e=0;e<r.length;e++)i.push({column:r[e].column,descending:r[e].descending});this.trigger("sort",i,!1,o)}return this},kn.prototype._ensureVisibleColumns=function(){const e=this.p;return 0===e.visibleColumns.length&&e.columns.length&&(e.columns[0].visible=!0,e.visibleColumns.push(e.columns[0]),this.trigger("showcolumn",e.columns[0].name)),this},kn.prototype.setColumnVisible=function(e,t){const r=this.p;let o=r.columns.get(e);return t=!!t,o&&!!o.visible!==t&&(o.visible=t,r.visibleColumns=r.columns.getVisibleColumns(),this.trigger(t?"showcolumn":"hidecolumn",e),this._ensureVisibleColumns(),this.clearAndRender()),this},kn.prototype.isColumnVisible=function(e){let t=this.p.columns.get(e);return!!t&&t.visible},kn.prototype.setMinColumnWidth=function(e){let t=this.o;return e=Math.max(e,0),t.minColumnWidth!==e&&(t.minColumnWidth=e,this.tableWidthChanged(!0)),this},kn.prototype.getMinColumnWidth=function(){return this.o.minColumnWidth},kn.prototype.setSortableColumns=function(e){const t=this.p,r=this.o;if(r.sortableColumns!==e&&(r.sortableColumns=e,t.$table)){let e=t.$headerRow.find(">div."+r.tableClassName+"-header-cell");for(let o=0;o<e.length;o++)Rn(e[0])[r.sortableColumns>0&&t.visibleColumns[o].sortable?"addClass":"removeClass"]("sortable")}return this},kn.prototype.getSortableColumns=function(){return this.o.sortableColumns},kn.prototype.setMovableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.movableColumns!==e&&(t.movableColumns=e),this},kn.prototype.getMovableColumns=function(){return this.o.movableColumns},kn.prototype.setResizableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.resizableColumns!==e&&(t.resizableColumns=e),this},kn.prototype.getResizableColumns=function(){return this.o.resizableColumns},kn.prototype.setComparatorCallback=function(e){let t=this.o;return t.onComparatorRequired!==e&&(t.onComparatorRequired=e),this},kn.prototype.setColumnWidth=function(e,t){let r=this.p.columns.get(e),o=this._parseColumnWidth(t,r.ignoreMin?0:this.o.minColumnWidth);if(r){let e=this._serializeColumnWidth(r);r.width=o.width,r.widthMode=o.mode;let t=this._serializeColumnWidth(r);e!==t&&this.tableWidthChanged(!0),this.trigger("columnwidth",r.name,e,t)}return this},kn.prototype.getColumnWidth=function(e){let t=this.p.columns.get(e);return t?this._serializeColumnWidth(t):null},kn.prototype.getColumnConfig=function(e){let t=this.p.columns.get(e);return t?{order:t.order,width:this._serializeColumnWidth(t),visible:t.visible,label:t.label}:null},kn.prototype.getColumnsConfig=function(){const e=this.p;let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r].name]=this.getColumnConfig(e.columns[r].name);return t},kn.prototype.getSortedColumns=function(){const e=this.p;let t=[];for(let r=0;r<e.rows.sortColumn.length;r++){let o=e.rows.sortColumn[r];t.push({column:o.column,descending:o.descending})}return t},kn.prototype.getHtmlForRowCell=function(e,t){const r=this.p;if(e<0||e>r.rows.length-1)return null;let o=r.columns.get(t);if(!o)return null;let i=r.rows[e];return this._getHtmlForCell(i,o)},kn.prototype.getHtmlForRowDataCell=function(e,t){let r=this.p.columns.get(t);return r?this._getHtmlForCell(e,r):null},kn.prototype._getHtmlForCell=function(e,t){let r=t.dataPath,o=e[r[0]];for(let e=1;e<r.length&&null!=o;e++)o=o&&o[r[e]];const i=this.o.cellFormatter;let n;if(i[Pn])n=i(o,t.name,e);else try{n=i(o,t.name,e)}catch(e){n="[ERROR]",console.error("Failed to generate content for cell "+t.name,e)}return null==n&&(n=""),n},kn.prototype.getRowYPos=function(e){return this.p.virtualListHelper.getItemPosition(e)||null},kn.prototype.getDataForRow=function(e){const t=this.p;return e<0||e>t.rows.length-1?null:t.rows[e]},kn.prototype.getRowCount=function(){const e=this.p;return e.rows?e.rows.length:0},kn.prototype.getIndexForRow=function(e){return this.p.rows.indexOf(e)},kn.prototype.getFilteredRowCount=function(){const e=this.p;return(e.filteredRows||e.rows).length},kn.prototype.getIndexForFilteredRow=function(e){const t=this.p;return(t.filteredRows||t.rows).indexOf(e)},kn.prototype.getDataForFilteredRow=function(e){const t=this.p;return e<0||e>(t.filteredRows||t.rows).length-1?null:(t.filteredRows||t.rows)[e]},kn.prototype.getHeaderRowElement=function(){return this.p.headerRow},kn.prototype._horizontalPadding=function(e){return(parseFloat(Rn.css(e,"padding-left"))||0)+(parseFloat(Rn.css(e,"padding-right"))||0)},kn.prototype._horizontalBorderWidth=function(e){return(parseFloat(Rn.css(e,"border-left"))||0)+(parseFloat(Rn.css(e,"border-right"))||0)},kn.prototype._calculateWidthAvailableForColumns=function(){const e=this.o,t=this.p;let o,i,n;t.table&&(i=t.table?t.table.scrollTop:0,n=t.table?t.table.scrollLeft:0,e.virtualTable&&(o=t.table.style.display,t.table.style.display="none"));let l=r.getElementWidth(this.$el[0]);t.table&&(e.virtualTable&&(t.table.style.display=o),t.table.scrollTop=i,t.table.scrollLeft=n,t.header.scrollLeft=n);let s=e.tableClassName,a=Rn("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px"}),d=Rn("<div>").addClass(s+"-header").appendTo(a),u=Rn("<div>").addClass(s+"-header-row").appendTo(d);for(let e=0;e<t.visibleColumns.length;e++)u.append(Rn("<div><div></div></div>").addClass(s+"-header-cell").addClass(t.visibleColumns[e].cellClasses||""));a.appendTo(document.body),l-=this._horizontalBorderWidth(u[0]);let h=u.find(">div."+s+"-header-cell");for(let e=0;e<h.length;e++){let t=Rn(h[e]);"border-box"===t.css("boxSizing")||(l-=(parseFloat(t.css("border-right-width"))||0)+(parseFloat(t.css("border-left-width"))||0)+this._horizontalPadding(t[0]))}return a&&a.remove(),Math.max(0,l)},kn.prototype.tableWidthChanged=function(){let e=function(e){let t,o=this.o.tableClassName,i=Rn("<div>").addClass(this.$el).append(Rn("<div>").addClass(o+"-header").append(Rn("<div>").addClass(o+"-header-row").append(t=Rn("<div>").addClass(o+"-header-cell").append(Rn("<div>").text(e))))).css({position:"absolute",top:"-9999px",visibility:"hidden"});i.appendTo(document.body);let n=r.getElementWidth(t[0]);return i.remove(),n},t=null;return function(r,o){let i=this.o,n=this.p,l=this._calculateWidthAvailableForColumns(),s=l,a=0;if(!n.$table)return this;o=void 0===o||o;let d=0;if(n.tbody||(o=!1),o&&(d=parseFloat(n.tbody.style.minWidth)||0),s!==t||r){var u;t=l;let r=0,h=[],c=0;for(let e=0;e<n.columns.length;e++)n.columns[e].actualWidthConsideringScrollbarWidth=null;for(let t=0;t<n.visibleColumns.length;t++){let o=n.visibleColumns[t];if(o.widthMode===Ln.ABSOLUTE){let e=o.width;e+=o.arrowProposedWidth||0,!o.ignoreMin&&e<i.minColumnWidth&&(e=i.minColumnWidth),s-=e,r+=e,e!==o.actualWidth&&(o.actualWidth=e,h.push(t))}else if(o.widthMode===Ln.AUTO){let n=e.call(this,o.label)+20;n+=o.arrowProposedWidth||0,!o.ignoreMin&&n<i.minColumnWidth&&(n=i.minColumnWidth),s-=n,r+=n,n!==o.actualWidth&&(o.actualWidth=n,i.convertColumnWidthsToRelative||h.push(t))}else o.widthMode===Ln.RELATIVE&&(c+=o.width,a++)}if(i.convertColumnWidthsToRelative)for(let e=0;e<n.visibleColumns.length;e++){let t=n.visibleColumns[e];t.widthMode===Ln.AUTO&&(t.widthMode=Ln.RELATIVE,s+=t.actualWidth,t.width=t.actualWidth/r,c+=t.width,a++)}if(a&&(c<1&&i.relativeWidthGrowsToFillWidth||c>1&&i.relativeWidthShrinksToFillWidth))for(let e=0;e<n.visibleColumns.length;e++){let t=n.visibleColumns[e];t.widthMode===Ln.RELATIVE&&(t.width/=c)}let p=Math.max(0,s);0===p&&(p=n.table.clientWidth);let m=i.minColumnWidth/p;if(isNaN(m)&&(m=0),m>0){let e,t=0;for(let e=0;e<n.visibleColumns.length;e++){let r=n.visibleColumns[e];r.widthMode===Ln.RELATIVE&&!r.ignoreMin&&r.width<m&&(t+=m-r.width,r.width=m)}for(let r=0;r<n.visibleColumns.length;r++){let o=n.visibleColumns[r];o.widthMode===Ln.RELATIVE&&!o.ignoreMin&&o.width>m&&t>0&&(e=Math.min(t,o.width-m),o.width-=e,t-=e)}}if(i.autoFillTableWidth&&s>0){let e=0,t=s;for(let r=0;r<n.visibleColumns.length;r++){let o=n.visibleColumns[r];o.resizable||o.widthMode!==Ln.ABSOLUTE||(e+=o.width),o.widthMode===Ln.RELATIVE&&(t-=Math.round(p*o.width))}let r=(l-e)/(l-t-e)||NaN;for(let e=0;e<n.visibleColumns.length&&t>0;e++){let t=n.visibleColumns[e];if(t.resizable||t.widthMode!==Ln.ABSOLUTE)if(t.widthMode===Ln.RELATIVE)t.width*=r;else{let o=t.actualWidth*r;t.actualWidth!==o&&(t.actualWidth=o,-1===h.indexOf(e)&&h.push(e))}}}for(let e=0;e<n.visibleColumns.length;e++){let t=n.visibleColumns[e];if(t.widthMode===Ln.RELATIVE){let r=Math.round(p*t.width);s-=r,a--,0===a&&1===s&&(r++,s--),-1===s&&(r--,s++),r!==t.actualWidth&&(t.actualWidth=r,h.push(e))}}if(n.visibleColumns.length&&(n.visibleColumns[n.visibleColumns.length-1].actualWidthConsideringScrollbarWidth=n.visibleColumns[n.visibleColumns.length-1].actualWidth-(n.scrollbarWidth||0)),null===(u=n.notifyRendererOfColumnsConfig)||void 0===u||u.call(n),o){let e=this._calculateTbodyWidth();d<e&&this._updateTableWidth(!1);for(let e=0;e<h.length;e++)this._resizeColumnElements(h[e]);d>e&&this._updateTableWidth(!1)}}return this}}(),kn.prototype.tableHeightChanged=function(){let e=this,t=e.o,o=e.p;if(!o.$table)return e;let i=r.getElementHeight(e.$el[0],!0)-(parseFloat(o.$table.css("border-top-width"))||0)-(parseFloat(o.$table.css("border-bottom-width"))||0);return i!==t.height&&(t.height=i,o.tbody&&(o.tbody.style.height=Math.max(t.height-r.getElementHeight(o.$headerRow[0],!0,!0,!0),1)+"px"),t.virtualTable&&e.clearAndRender()),e},kn.prototype.addRows=function(e,t,r,o){let i=this.p;return"boolean"==typeof t&&(o=r,r=t,t=-1),"number"!=typeof t&&(t=-1),(t<0||t>i.rows.length)&&(t=i.rows.length),o=void 0===o||!!o,e&&(i.rows.add(e,t),i.filteredRows||r&&i.rows.sortColumn.length?(r&&i.rows.sortColumn.length?this.resort():this._refilter(),i.tableSkeletonNeedsRendering=!0,o&&this.render()):o&&(i.virtualListHelper.addItemsAt(e.length,t),this.o.virtualTable?this._updateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(!1):i.tbody&&this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(!0)),this.trigger("addrows",e.length,!1)),this},kn.prototype.removeRows=function(e,t,r){let o=this.p;return"number"!=typeof t||t<=0||e<0||e>o.rows.length-1||(o.rows.splice(e,t),r=void 0===r||!!r,o.filteredRows?(this._refilter(),o.tableSkeletonNeedsRendering=!0,r&&this.render()):r&&(o.virtualListHelper.removeItemsAt(t,e),this.o.virtualTable?this._updateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(!1):this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(!0))),this},kn.prototype.removeRow=function(e,t){return this.removeRows(e,1,t)},kn.prototype.refreshRow=function(e,t=!0){let r=this.p;if(e<0||e>r.rows.length-1)return this;let o=-1;return r.filteredRows&&-1===(o=r.filteredRows.indexOf(r.rows[e]))||(-1===o&&(o=e),r.virtualListHelper.refreshItemAt(o),t&&r.virtualListHelper.render()),this},kn.prototype.getRowElement=function(e){let t=this.p;if(e<0||e>t.rows.length-1)return null;let r=-1;return t.filteredRows&&-1===(r=t.filteredRows.indexOf(t.rows[e]))?this:(-1===r&&(r=e),t.virtualListHelper.getItemElementAt(r)||null)},kn.prototype.refreshAllVirtualRows=function(){return this.p.virtualListHelper.invalidate().render(),this},kn.prototype.setRows=function(e,t){let r=this.p;return r.rows.reset(e),t&&r.rows.sortColumn.length?this.resort():this._refilter(),this.clearAndRender().trigger("addrows",e.length,!0),this},kn.prototype.getUrlForElementContent=function(e){let t,r=document.getElementById(e);if(r){let e=r.textContent;if("function"==typeof Blob)t=new Blob([e]);else{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(!r)return null;let o=new r;o.append(e),t=o.getBlob()}return(window.URL||window.webkitURL).createObjectURL(t)}return null},kn.prototype.isWorkerSupported=function(){return window.Worker instanceof Function},kn.prototype.createWebWorker=function(e,t,r){if(this.isWorkerSupported()){let o=this,i=o.p,n=new Worker(e),l=function(e){e.data.append?o.addRows(e.data.rows,r):o.setRows(e.data.rows,r)};return n.addEventListener("message",l,!1),i.workerListeners||(i.workerListeners=[]),i.workerListeners.push({worker:n,listener:l}),(t||void 0===t)&&n.postMessage(null),n}return null},kn.prototype.unbindWebWorker=function(e){let t=this.p;if(t.workerListeners)for(let r=0;r<t.workerListeners.length;r++)t.workerListeners[r].worker===e&&(e.removeEventListener("message",t.workerListeners[r].listener,!1),t.workerListeners.splice(r,1),r--);return this},kn.prototype.abortCellPreview=function(){return this.hideCellPreview(),this},kn.prototype.cancelColumnResize=function(){const e=this.p;return e.$resizer&&(e.$resizer.remove(),e.$resizer=null,Rn(document).off("mousemove.dgtable",e.onMouseMoveResizeAreaBound).off("mouseup.dgtable",e.onEndDragColumnHeaderBound)),this},kn.prototype._onTableScrolledHorizontally=function(){const e=this.p;e.header.scrollLeft=e.table.scrollLeft},kn.prototype._getColumnByResizePosition=function(e){let t=this.o,o=this._isTableRtl(),i=Rn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),n=i[0];n.__cell&&(n=n.__cell,i=Rn(n));let l=i[0].previousSibling;for(;l&&1!==l.nodeType;)l=l.previousSibling;let s=!l,a=((null!=e.pageX?e.pageX:e.originalEvent.pageX)||e.originalEvent.clientX)-i.offset().left;if(o){if(!s&&r.getElementWidth(i[0],!0,!0,!0)-a<=t.resizeAreaWidth/2)return l.columnName;if(a<=t.resizeAreaWidth/2)return n.columnName}else{if(!s&&a<=t.resizeAreaWidth/2)return l.columnName;if(r.getElementWidth(i[0],!0,!0,!0)-a<=t.resizeAreaWidth/2)return n.columnName}return null},kn.prototype._onTouchStartColumnHeader=function(e){const t=this.p;if(t.currentTouchId)return;let r=e.originalEvent.changedTouches[0];t.currentTouchId=r.identifier;let o,i=Rn(e.currentTarget),n={x:r.pageX,y:r.pageY},l=n,s=function(){t.currentTouchId=null,i.off("touchend").off("touchcancel"),clearTimeout(o)},a=function(t){let r=Rn.Event(t),o=Array.prototype.slice.call(arguments,1);for(let t of["target","clientX","clientY","offsetX","offsetY","screenX","screenY","pageX","pageY","which"]){r[t]=e[t];for(let e=0;e<o.length;e++)null!=o[e][t]&&(r[t]=o[e][t])}return r};i.trigger(a("mousedown",e.originalEvent.changedTouches[0],{which:1,target:e.target})),o=setTimeout((()=>{s(),i.one("touchend",(e=>{zn(e)||e.preventDefault(),i.off("touchend").off("touchcancel")})).one("touchcancel",(e=>{i.off("touchend").off("touchcancel")})),Math.sqrt(Math.pow(Math.abs(l.x-n.x),2)+Math.pow(Math.abs(l.y-n.y),2))<9&&(this.cancelColumnResize(),i.trigger(a("mouseup",e.originalEvent.changedTouches[0],{which:3,target:e.target})))}),500),i.on("touchend",(e=>{let r=on(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));r&&(s(),zn(e)||e.preventDefault(),l={x:r.pageX,y:r.pageY},(Math.sqrt(Math.pow(Math.abs(l.x-n.x),2)+Math.pow(Math.abs(l.y-n.y),2))<9||t.$resizer)&&(i.trigger(a("mouseup",r,{which:1,target:e.target})),i.trigger(a("click",r,{which:1,target:e.target}))))})).on("touchcancel",(()=>{s()})).on("touchmove",(e=>{let r=on(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));r&&(l={x:r.pageX,y:r.pageY},t.$resizer&&(e.preventDefault(),i.trigger(a("mousemove",r,{target:e.target}))))}))},kn.prototype._onMouseDownColumnHeader=function(e){if(1!==e.which)return this;let t=this.o,o=this.p,i=this._getColumnByResizePosition(e);if(i){let n=o.columns.get(i);if(!t.resizableColumns||!n||!n.resizable)return!1;let l=this._isTableRtl();o.$resizer&&Rn(o.$resizer).remove(),o.$resizer=Rn("<div></div>").addClass(t.resizerClassName).css({position:"absolute",display:"block","z-index":-1,visibility:"hidden",width:"2px",background:"#000",opacity:.7}).appendTo(this.$el);let s=n.element,a=o.$resizer.parent(),d=s.offset(),u=a.offset();8===xn&&(d=s.offset()),u.left+=parseFloat(a.css("border-left-width"))||0,u.top+=parseFloat(a.css("border-top-width"))||0,d.left-=u.left,d.top-=u.top,d.top-=parseFloat(s.css("border-top-width"))||0;let h=r.getElementWidth(o.$resizer[0],!0,!0,!0);l?(d.left-=Math.ceil((parseFloat(s.css("border-left-width"))||0)/2),d.left-=Math.ceil(h/2)):(d.left+=r.getElementWidth(s[0],!0,!0,!0),d.left+=Math.ceil((parseFloat(s.css("border-right-width"))||0)/2),d.left-=Math.ceil(h/2)),o.$resizer.css({"z-index":"10",visibility:"visible",left:d.left,top:d.top,height:r.getElementHeight(this.$el[0])})[0].columnName=s[0].columnName;try{o.$resizer[0].style.zIndex=""}catch(e){}Rn(document).on("mousemove.dgtable",o.onMouseMoveResizeAreaBound),Rn(document).on("mouseup.dgtable",o.onEndDragColumnHeaderBound),e.preventDefault()}},kn.prototype._onMouseMoveColumnHeader=function(e){let t=this.o,r=this.p;if(t.resizableColumns){let o=this._getColumnByResizePosition(e),i=Rn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0];o&&r.columns.get(o).resizable?i.style.cursor="e-resize":i.style.cursor=""}},kn.prototype._onMouseUpColumnHeader=function(e){if(3===e.which){let t=this.o,o=Rn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),i=o.offset();i.width=r.getElementWidth(o[0],!0,!0,!0),i.height=r.getElementHeight(o[0],!0,!0,!0),this.trigger("headercontextmenu",o[0].columnName,e.pageX,e.pageY,i)}return this},kn.prototype._onMouseLeaveColumnHeader=function(e){let t=this.o;Rn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0].style.cursor=""},kn.prototype._onClickColumnHeader=function(e){if(!zn(e)&&!this._getColumnByResizePosition(e)){let t=this,r=t.o,o=t.p,i=Rn(e.target).closest("div."+r.tableClassName+"-header-cell,div."+r.cellPreviewClassName)[0];if(r.sortableColumns){let e=o.columns.get(i.columnName);e&&e.sortable&&this.sort(i.columnName,void 0,!0).render()}}},kn.prototype._onStartDragColumnHeader=function(e){let t=this.o,r=this.p;if(t.movableColumns){let o=Rn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),i=r.columns.get(o[0].columnName);i&&i.movable?(o[0].style.opacity=.35,r.dragId=161061273*Math.random(),e.originalEvent.dataTransfer.setData("text",JSON.stringify({dragId:r.dragId,column:i.name}))):e.preventDefault()}else e.preventDefault()},kn.prototype._onMouseMoveResizeArea=function(e){let t=this.p,o=t.columns.get(t.$resizer[0].columnName),i=this._isTableRtl(),n=o.element,l=t.$resizer.parent(),s=n.offset(),a=l.offset();a.left+=parseFloat(l.css("border-left-width"))||0,s.left-=a.left;let d=r.getElementWidth(t.$resizer[0],!0,!0,!0),u="border-box"===n.css("box-sizing"),h=e.pageX-a.left,c=s.left;c-=Math.ceil(d/2),i?(c+=r.getElementWidth(n[0],!0,!0,!0),c-=o.ignoreMin?0:this.o.minColumnWidth,u||(c-=Math.ceil((parseFloat(n.css("border-left-width"))||0)/2),c-=this._horizontalPadding(n[0])),h>c&&(h=c)):(c+=o.ignoreMin?0:this.o.minColumnWidth,u||(c+=Math.ceil((parseFloat(n.css("border-right-width"))||0)/2),c+=this._horizontalPadding(n[0])),h<c&&(h=c)),t.$resizer.css("left",h+"px")},kn.prototype._onEndDragColumnHeader=function(e){let t=this.o,o=this.p;if(o.$resizer){Rn(document).off("mousemove.dgtable",o.onMouseMoveResizeAreaBound).off("mouseup.dgtable",o.onEndDragColumnHeaderBound);let i=o.columns.get(o.$resizer[0].columnName),n=this._isTableRtl(),l=i.element,s=o.$resizer.parent(),a=l.offset(),d=s.offset();d.left+=parseFloat(s.css("border-left-width"))||0,a.left-=d.left;let u=r.getElementWidth(o.$resizer[0],!0,!0,!0),h="border-box"===l.css("box-sizing"),c=e.pageX-d.left,p=a.left,m=a.left,f=0;p-=Math.ceil(u/2),n?(h||(c+=this._horizontalPadding(l[0]),c+=parseFloat(l.css("border-left-width"))||0,c+=parseFloat(l.css("border-right-width"))||0),p+=r.getElementWidth(l[0],!0,!0,!0),m=p-(i.ignoreMin?0:this.o.minColumnWidth),c>m&&(c=m),f=p-c):(h||(c-=this._horizontalPadding(l[0]),c-=parseFloat(l.css("border-left-width"))||0,c-=parseFloat(l.css("border-right-width"))||0),m=p+(i.ignoreMin?0:this.o.minColumnWidth),c<m&&(c=m),f=c-p),o.$resizer.remove(),o.$resizer=null;let g=f;if(i.widthMode===Ln.RELATIVE){let e=this._calculateWidthAvailableForColumns(),r=0,n=0;for(let t=0;t<o.visibleColumns.length;t++){let l=o.visibleColumns[t];l.name!==i.name&&(l.widthMode===Ln.RELATIVE?(r+=l.width,n++):e-=l.actualWidth)}if(e=Math.max(1,e),g=f/e,n>0){let e=g/((1-g)/r);r+=g,(r<1&&t.relativeWidthGrowsToFillWidth||r>1&&t.relativeWidthShrinksToFillWidth)&&(g=e)}g*=100,g+="%"}this.setColumnWidth(i.name,g)}else e.target.style.opacity=null},kn.prototype._onDragEnterColumnHeader=function(e){let t=this.o,r=this.p;if(t.movableColumns){let o=e.originalEvent.dataTransfer.getData("text");o=o?JSON.parse(o):null;let i=Rn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);if(!o||r.dragId===o.dragId&&i.columnName!==o.column){let e=r.columns.get(i[0].columnName);e&&(e.movable||e!==r.visibleColumns[0])&&Rn(i).addClass("drag-over")}}},kn.prototype._onDragOverColumnHeader=function(e){e.preventDefault()},kn.prototype._onDragLeaveColumnHeader=function(e){let t=this.o,r=Rn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);Rn(r[0].firstChild).has(e.originalEvent.relatedTarget).length||r.removeClass("drag-over")},kn.prototype._onDropColumnHeader=function(e){e.preventDefault();let t=this.o,r=this.p,o=JSON.parse(e.originalEvent.dataTransfer.getData("text")),i=Rn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);if(t.movableColumns&&o.dragId===r.dragId){let e=o.column,t=i[0].columnName,n=r.columns.get(e),l=r.columns.get(t);n&&l&&n.movable&&(l.movable||l!==r.visibleColumns[0])&&this.moveColumn(e,t)}Rn(i).removeClass("drag-over")},kn.prototype._clearSortArrows=function(){let e=this.p;if(e.$table){let t=this.o.tableClassName,r=e.$headerRow.find(">div."+t+"-header-cell.sorted"),o=r.find(">div>.sort-arrow");o.each(((t,r)=>{let o=e.columns.get(r.parentNode.parentNode.columnName);o&&(o.arrowProposedWidth=0)})),o.remove(),r.removeClass("sorted").removeClass("desc")}return this},kn.prototype._showSortArrow=function(e,t){let r=this.p.columns.get(e);if(!r)return!1;let o=Nn("span");return o.className="sort-arrow",r.element&&(r.element.addClass(t?"sorted desc":"sorted"),r.element[0].firstChild.insertBefore(o,r.element[0].firstChild.firstChild)),r.widthMode!==Ln.RELATIVE&&this.o.adjustColumnWidthForSortArrow&&(r.arrowProposedWidth=o.scrollWidth+(parseFloat(Rn(o).css("margin-right"))||0)+(parseFloat(Rn(o).css("margin-left"))||0)),this},kn.prototype._resizeColumnElements=function(e){let t=this.p,r=t.$headerRow.find("div."+this.o.tableClassName+"-header-cell"),o=t.columns.get(r[e].columnName);if(o){r[e].style.width=(o.actualWidthConsideringScrollbarWidth||o.actualWidth)+"px";let i=(o.actualWidthConsideringScrollbarWidth||o.actualWidth)+"px",n=t.tbody.childNodes;for(let t=0,r=n.length;t<r;t++){let r=n[t];1===r.nodeType&&(r.childNodes[e].style.width=i)}}return this},kn.prototype._destroyHeaderCells=function(){let e=this.o,t=this.p;return t.$headerRow&&(this.trigger("headerrowdestroy",t.headerRow),t.$headerRow.find("div."+e.tableClassName+"-header-cell").remove(),t.$headerRow=null,t.headerRow=null),this},kn.prototype._renderSkeletonBase=function(){var e;let t=this,o=t.p,i=t.o;null===(e=o.virtualListHelper)||void 0===e||e.destroy(),o.virtualListHelper=null,o.$table&&i.virtualTable&&(o.$table.remove(),o.$table=o.table=o.$tbody=o.tbody=null),t._destroyHeaderCells(),o.currentTouchId=null,o.$header&&o.$header.remove();let n=i.tableClassName,l=Nn("div"),s=Rn(l),a=Nn("div"),d=Rn(a);return l.className=n+"-header",a.className=n+"-header-row",o.$header=s,o.header=l,o.$headerRow=d,o.headerRow=a,d.appendTo(o.$header),s.prependTo(this.$el),On(t.$el),i.width===kn.Width.SCROLL?this.el.style.overflow="hidden":this.el.style.overflow="",!i.height&&i.virtualTable&&(i.height=r.getElementHeight(this.$el[0],!0)),this},kn.prototype._renderSkeletonHeaderCells=function(){let e,t=this,r=t.p,o=t.o,i=o.allowCellPreview,n=o.allowHeaderCellPreview,l=o.tableClassName+"-header-cell",s=r.headerRow;Hn&&(e=function(e){return e.preventDefault(),this.dragDrop(),!1});let a=function(e){e.preventDefault()};for(let d=0;d<r.visibleColumns.length;d++){let u=r.visibleColumns[d];if(u.visible){let h=Nn("div"),c=Rn(h);h.draggable=!0,h.className=l,h.style.width=u.actualWidth+"px",o.sortableColumns&&u.sortable&&(h.className+=" sortable"),h.columnName=u.name,h.setAttribute("data-column",u.name);let p=Nn("div");p.innerHTML=o.headerCellFormatter(u.label,u.name),h.appendChild(p),i&&n&&r._bindCellHoverIn(h),s.appendChild(h),r.visibleColumns[d].element=c,c.on("mousedown.dgtable",t._onMouseDownColumnHeader.bind(t)).on("mousemove.dgtable",t._onMouseMoveColumnHeader.bind(t)).on("mouseup.dgtable",t._onMouseUpColumnHeader.bind(t)).on("mouseleave.dgtable",t._onMouseLeaveColumnHeader.bind(t)).on("touchstart.dgtable",t._onTouchStartColumnHeader.bind(t)).on("dragstart.dgtable",t._onStartDragColumnHeader.bind(t)).on("click.dgtable",t._onClickColumnHeader.bind(t)).on("contextmenu.dgtable",a),Rn(p).on("dragenter.dgtable",t._onDragEnterColumnHeader.bind(t)).on("dragover.dgtable",t._onDragOverColumnHeader.bind(t)).on("dragleave.dgtable",t._onDragLeaveColumnHeader.bind(t)).on("drop.dgtable",t._onDropColumnHeader.bind(t)),Hn&&c.on("selectstart.dgtable",e.bind(h)),c.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"})}}return this.trigger("headerrowcreate",s),this},kn.prototype._renderSkeletonBody=function(){let e=this,t=e.p,o=e.o,i=o.tableClassName;if(o.virtualTable&&!t.virtualRowHeight){let o,n=function(){let e=Nn("div"),t=e.appendChild(Nn("div")),r=t.appendChild(Nn("div"));return e.className=i+"-row",t.className=i+"-cell",r.innerHTML="0",e.style.visibility="hidden",e.style.position="absolute",e},l=Rn("<div>").addClass(e.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",width:"1px",overflow:"hidden"}).append(Rn("<div>").addClass(i).append(o=Rn("<div>").addClass(i+"-body").css("width",99999)));l.appendTo(document.body);let s=n(),a=n(),d=n();o.append(s,a,d),t.virtualRowHeightFirst=r.getElementHeight(s,!0,!0,!0),t.virtualRowHeight=r.getElementHeight(a,!0,!0,!0),t.virtualRowHeightLast=r.getElementHeight(d,!0,!0,!0),l.remove()}if(!t.$table){let n=document.createDocumentFragment(),l=Nn("div"),s=Rn(l);l.className=i,o.virtualTable&&(l.className+=" virtual");let a=o.height-r.getElementHeight(t.$headerRow[0],!0,!0,!0);"border-box"!==s.css("box-sizing")&&(a-=parseFloat(s.css("border-top-width"))||0,a-=parseFloat(s.css("border-bottom-width"))||0,a-=parseFloat(s.css("padding-top"))||0,a-=parseFloat(s.css("padding-bottom"))||0),t.visibleHeight=a,l.style.height=o.height?a+"px":"auto",l.style.display="block",l.style.overflowY="auto",l.style.overflowX=o.width===kn.Width.SCROLL?"auto":"hidden",n.appendChild(l);let d=Nn("div"),u=Rn(d);d.className=o.tableClassName+"-body",d.style.minHeight="1px",t.table=l,t.tbody=d,t.$table=s,t.$tbody=u,On(u),On(s),l.appendChild(d),e.el.appendChild(n),this._setupVirtualTable()}return this},kn.prototype._renderSkeleton=function(){return this},kn.prototype._updateVirtualHeight=function(){const e=this.o,t=this.p;if(!t.tbody)return this;if(e.virtualTable){const e=t.virtualListHelper.estimateFullHeight();t.lastVirtualScrollHeight=e,t.tbody.style.height=e+"px"}else t.tbody.style.height="";return this},kn.prototype._updateLastCellWidthFromScrollbar=function(e){const t=this.p;let r=t.table.offsetWidth-t.table.clientWidth;if(r!==t.scrollbarWidth||e){var o;t.scrollbarWidth=r;for(let e=0;e<t.columns.length;e++)t.columns[e].actualWidthConsideringScrollbarWidth=null;if(t.scrollbarWidth>0&&t.visibleColumns.length>0){let e=t.visibleColumns.length-1;t.visibleColumns[e].actualWidthConsideringScrollbarWidth=t.visibleColumns[e].actualWidth-t.scrollbarWidth;let r=t.visibleColumns[e].actualWidthConsideringScrollbarWidth+"px",o=t.tbody.childNodes;for(let t=0,i=o.length;t<i;t++){let i=o[t];1===i.nodeType&&(i.childNodes[e].style.width=r)}t.headerRow.childNodes[e].style.width=r}null===(o=t.notifyRendererOfColumnsConfig)||void 0===o||o.call(t)}return this},kn.prototype._updateTableWidth=function(e){const t=this.o,o=this.p;let i=this._calculateTbodyWidth();if(o.tbody.style.minWidth=i+"px",o.headerRow.style.minWidth=i+(o.scrollbarWidth||0)+"px",o.$table.off("scroll",o.onTableScrolledHorizontallyBound),t.width===kn.Width.AUTO)r.setElementWidth(o.$table[0],r.getElementWidth(o.tbody,!0,!0,!0)),r.setElementWidth(this.$el[0],r.getElementWidth(o.$table[0],!0,!0,!0));else if(t.width===kn.Width.SCROLL){if(e){let e=o.table?o.table.scrollTop:0,t=o.table?o.table.scrollLeft:0;!function(e){let t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}(this.el),o.table.scrollTop=e,o.table.scrollLeft=t,o.header.scrollLeft=t}o.$table.on("scroll",o.onTableScrolledHorizontallyBound)}return this},kn.prototype._isTableRtl=function(){return"rtl"===this.p.$table.css("direction")},kn.prototype._serializeColumnWidth=function(e){return e.widthMode===Ln.AUTO?"auto":e.widthMode===Ln.RELATIVE?100*e.width+"%":e.width},kn.prototype._cellMouseOverEvent=function(e){const t=this.o,o=this.p;let i=e.firstChild;if(i.scrollWidth-i.clientWidth>1||i.scrollHeight-i.clientHeight>1){this.hideCellPreview(),o.abortCellPreview=!1;let n=Rn(e),l=Rn(i);const s=e.parentNode;let a=Nn("div"),d=Rn(a);a.innerHTML=e.innerHTML,a.className=t.cellPreviewClassName;let u=n.hasClass(t.tableClassName+"-header-cell");u&&(a.className+=" header",n.hasClass("sortable")&&(a.className+=" sortable"),a.draggable=!0,Rn(a).on("mousedown",this._onMouseDownColumnHeader.bind(this)).on("mousemove",this._onMouseMoveColumnHeader.bind(this)).on("mouseup",this._onMouseUpColumnHeader.bind(this)).on("mouseleave",this._onMouseLeaveColumnHeader.bind(this)).on("touchstart",this._onTouchStartColumnHeader.bind(this)).on("dragstart",this._onStartDragColumnHeader.bind(this)).on("click",this._onClickColumnHeader.bind(this)).on("contextmenu.dgtable",(function(e){e.preventDefault()})),Rn(a.firstChild).on("dragenter",this._onDragEnterColumnHeader.bind(this)).on("dragover",this._onDragOverColumnHeader.bind(this)).on("dragleave",this._onDragLeaveColumnHeader.bind(this)).on("drop",this._onDropColumnHeader.bind(this)),Hn&&Rn(a).on("selectstart",function(e){return e.preventDefault(),this.dragDrop(),!1}.bind(a)));let h=parseFloat(n.css("padding-left"))||0,c=parseFloat(n.css("padding-right"))||0,p=parseFloat(n.css("padding-top"))||0,m=parseFloat(n.css("padding-bottom"))||0,f=i.scrollWidth+(e.clientWidth-i.offsetWidth),g="border-box"===n.css("box-sizing");if(g?d.css("box-sizing","border-box"):(f-=h+c,d.css("margin-top",parseFloat(Rn(e).css("border-top-width"))||0)),!o.transparentBgColor1){let e=document.createElement("div");e.style.backgroundColor="transparent",o.transparentBgColor1=Rn(e).css("background-color"),e.style.backgroundColor="rgba(0,0,0,0)",o.transparentBgColor2=Rn(e).css("background-color")}let b={"box-sizing":g?"border-box":"content-box",width:f,"min-height":r.getElementHeight(n[0]),"padding-left":h,"padding-right":c,"padding-top":p,"padding-bottom":m,overflow:"hidden",position:"absolute","z-index":"-1",left:"0",top:"0",cursor:n.css("cursor")};if(b){let t=Rn(e).css("background-color");t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t=Rn(s).css("background-color")),t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t="#fff"),b["background-color"]=t}d.css(b),this.el.appendChild(a),Rn(a.firstChild).css({direction:l.css("direction"),"white-space":l.css("white-space")}),u&&d.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"}),a.rowIndex=s.rowIndex;let v=a.physicalRowIndex=s.physicalRowIndex;a.columnName=o.visibleColumns[In.call(s.childNodes,e)].name;try{let t=un.saveSelection(e);t&&un.restoreSelection(a,t)}catch(e){}if(this.trigger("cellpreview",a.firstChild,null==v?null:v,a.columnName,null==v?null:o.rows[v],e),o.abortCellPreview)return void d.remove();null!=v&&a.addEventListener("click",(e=>{this.trigger("rowclick",e,s.rowIndex,v,s,o.rows[v])}));let C=this.$el,y=C[0]===window?Rn(document):C,w=n.offset(),_=C.offset(),E="right"===n.css("float"),W=E?"right":"left";if(E){let e=Rn(window).width();w.right=e-(w.left+r.getElementWidth(n[0],!0,!0,!0)),_.right=e-(_.left+r.getElementWidth(C[0],!0,!0,!0))}w.left-=parseFloat(C.css("border-left-width"))||0,w.right-=parseFloat(C.css("border-right-width"))||0,w.top-=parseFloat(C.css("border-top-width"))||0,w[W]+=parseFloat(Rn(e).css("border-"+W+"-width"))||0,w.top+=parseFloat(Rn(e).css("border-top-width"))||parseFloat(Rn(e).css("border-bottom-width"))||0,w.left-=_.left,w.right-=_.right,w.top-=_.top;let I=0,R=C-r.getElementWidth(d[0],!0,!0,!0);w[W]=w[W]<I?I:w[W]>R?R:w[W];let S=r.getElementHeight(n[0],!0,!0,!0),x=y.scrollTop()+r.getElementHeight(C[0],!0)-S;w.top>x&&(w.top=Math.max(0,x));let H={top:w.top,"z-index":9999};H[W]=w[W],d.css(H),a.__cell=e,o.$cellPreviewCell=d,e.__previewCell=a,o._bindCellHoverOut(e),o._bindCellHoverOut(a),d.on("wheel",(()=>{this.hideCellPreview()}))}},kn.prototype._cellMouseOutEvent=function(e){this.hideCellPreview()},kn.prototype.hideCellPreview=function(){const e=this.p;if(e.$cellPreviewCell){let t,r=e.$cellPreviewCell[0],o=r.__cell;try{t=un.saveSelection(r)}catch(e){}e.$cellPreviewCell.remove(),e._unbindCellHoverOut(o),e._unbindCellHoverOut(r);try{t&&un.restoreSelection(o,t)}catch(e){}this.trigger("cellpreviewdestroy",r.firstChild,r.physicalRowIndex,r.columnName,o),o.__previewCell=null,r.__cell=null,e.$cellPreviewCell=null,e.abortCellPreview=!1}else e.abortCellPreview=!0;return this};const Ln={AUTO:0,ABSOLUTE:1,RELATIVE:2};kn.Width={NONE:"none",AUTO:"auto",SCROLL:"scroll"},Rn.controls||(Rn.controls={}),Rn.controls.dgtable=kn,module.exports=kn;
|
|
5
|
+
"use strict";var e=require("jquery"),t=require("@danielgindi/dom-utils/lib/ScrollHelper"),r=require("@danielgindi/dom-utils/lib/Css"),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=function(e){return e&&e.Math==Math&&e},n=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof o&&o)||function(){return this}()||Function("return this")(),l={},s=function(e){try{return!!e()}catch(e){return!0}},a=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),d=!s((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),u=d,h=Function.prototype.call,c=u?h.bind(h):function(){return h.apply(h,arguments)},p={},m={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,g=f&&!m.call({1:2},1);p.f=g?function(e){var t=f(this,e);return!!t&&t.enumerable}:m;var v,b,C=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},y=d,w=Function.prototype,_=w.call,E=y&&w.bind.bind(_,_),W=y?E:function(e){return function(){return _.apply(e,arguments)}},I=W,R=I({}.toString),S=I("".slice),H=function(e){return S(R(e),8,-1)},x=s,N=H,T=Object,P=W("".split),F=x((function(){return!T("z").propertyIsEnumerable(0)}))?function(e){return"String"==N(e)?P(e,""):T(e)}:T,A=function(e){return null==e},M=A,O=TypeError,z=function(e){if(M(e))throw O("Can't call method on "+e);return e},L=F,k=z,$=function(e){return L(k(e))},V="object"==typeof document&&document.all,B={all:V,IS_HTMLDDA:void 0===V&&void 0!==V},D=B.all,j=B.IS_HTMLDDA?function(e){return"function"==typeof e||e===D}:function(e){return"function"==typeof e},U=j,q=B.all,X=B.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:U(e)||e===q}:function(e){return"object"==typeof e?null!==e:U(e)},Y=n,G=j,J=function(e){return G(e)?e:void 0},K=function(e,t){return arguments.length<2?J(Y[e]):Y[e]&&Y[e][t]},Q=W({}.isPrototypeOf),Z=K("navigator","userAgent")||"",ee=n,te=Z,re=ee.process,oe=ee.Deno,ie=re&&re.versions||oe&&oe.version,ne=ie&&ie.v8;ne&&(b=(v=ne.split("."))[0]>0&&v[0]<4?1:+(v[0]+v[1])),!b&&te&&(!(v=te.match(/Edge\/(\d+)/))||v[1]>=74)&&(v=te.match(/Chrome\/(\d+)/))&&(b=+v[1]);var le=b,se=le,ae=s,de=!!Object.getOwnPropertySymbols&&!ae((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&se&&se<41})),ue=de&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,he=K,ce=j,pe=Q,me=Object,fe=ue?function(e){return"symbol"==typeof e}:function(e){var t=he("Symbol");return ce(t)&&pe(t.prototype,me(e))},ge=String,ve=function(e){try{return ge(e)}catch(e){return"Object"}},be=j,Ce=ve,ye=TypeError,we=function(e){if(be(e))return e;throw ye(Ce(e)+" is not a function")},_e=we,Ee=A,We=c,Ie=j,Re=X,Se=TypeError,He={},xe={get exports(){return He},set exports(e){He=e}},Ne=n,Te=Object.defineProperty,Pe=function(e,t){try{Te(Ne,e,{value:t,configurable:!0,writable:!0})}catch(r){Ne[e]=t}return t},Fe=Pe,Ae="__core-js_shared__",Me=n[Ae]||Fe(Ae,{}),Oe=Me;(xe.exports=function(e,t){return Oe[e]||(Oe[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ze=z,Le=Object,ke=function(e){return Le(ze(e))},$e=ke,Ve=W({}.hasOwnProperty),Be=Object.hasOwn||function(e,t){return Ve($e(e),t)},De=W,je=0,Ue=Math.random(),qe=De(1..toString),Xe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+qe(++je+Ue,36)},Ye=n,Ge=Be,Je=Xe,Ke=de,Qe=ue,Ze=He("wks"),et=Ye.Symbol,tt=et&&et.for,rt=Qe?et:et&&et.withoutSetter||Je,ot=function(e){if(!Ge(Ze,e)||!Ke&&"string"!=typeof Ze[e]){var t="Symbol."+e;Ke&&Ge(et,e)?Ze[e]=et[e]:Ze[e]=Qe&&tt?tt(t):rt(t)}return Ze[e]},it=c,nt=X,lt=fe,st=TypeError,at=ot("toPrimitive"),dt=function(e,t){if(!nt(e)||lt(e))return e;var r,o,i=(o=e[at],Ee(o)?void 0:_e(o));if(i){if(void 0===t&&(t="default"),r=it(i,e,t),!nt(r)||lt(r))return r;throw st("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,o;if("string"===t&&Ie(r=e.toString)&&!Re(o=We(r,e)))return o;if(Ie(r=e.valueOf)&&!Re(o=We(r,e)))return o;if("string"!==t&&Ie(r=e.toString)&&!Re(o=We(r,e)))return o;throw Se("Can't convert object to primitive value")}(e,t)},ut=fe,ht=function(e){var t=dt(e,"string");return ut(t)?t:t+""},ct=X,pt=n.document,mt=ct(pt)&&ct(pt.createElement),ft=!a&&!s((function(){return 7!=Object.defineProperty((e="div",mt?pt.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),gt=a,vt=c,bt=p,Ct=C,yt=$,wt=ht,_t=Be,Et=ft,Wt=Object.getOwnPropertyDescriptor;l.f=gt?Wt:function(e,t){if(e=yt(e),t=wt(t),Et)try{return Wt(e,t)}catch(e){}if(_t(e,t))return Ct(!vt(bt.f,e,t),e[t])};var It={},Rt=a&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),St=X,Ht=String,xt=TypeError,Nt=function(e){if(St(e))return e;throw xt(Ht(e)+" is not an object")},Tt=a,Pt=ft,Ft=Rt,At=Nt,Mt=ht,Ot=TypeError,zt=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,kt="enumerable",$t="configurable",Vt="writable";It.f=Tt?Ft?function(e,t,r){if(At(e),t=Mt(t),At(r),"function"==typeof e&&"prototype"===t&&"value"in r&&Vt in r&&!r[Vt]){var o=Lt(e,t);o&&o[Vt]&&(e[t]=r.value,r={configurable:$t in r?r[$t]:o[$t],enumerable:kt in r?r[kt]:o[kt],writable:!1})}return zt(e,t,r)}:zt:function(e,t,r){if(At(e),t=Mt(t),At(r),Pt)try{return zt(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Ot("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Bt=It,Dt=C,jt=a?function(e,t,r){return Bt.f(e,t,Dt(1,r))}:function(e,t,r){return e[t]=r,e},Ut={},qt={get exports(){return Ut},set exports(e){Ut=e}},Xt=a,Yt=Be,Gt=Function.prototype,Jt=Xt&&Object.getOwnPropertyDescriptor,Kt=Yt(Gt,"name"),Qt={EXISTS:Kt,PROPER:Kt&&"something"===function(){}.name,CONFIGURABLE:Kt&&(!Xt||Xt&&Jt(Gt,"name").configurable)},Zt=j,er=Me,tr=W(Function.toString);Zt(er.inspectSource)||(er.inspectSource=function(e){return tr(e)});var rr,or,ir,nr,lr=er.inspectSource,sr=j,ar=n.WeakMap,dr=sr(ar)&&/native code/.test(String(ar)),ur=Xe,hr=He("keys"),cr={},pr=dr,mr=n,fr=X,gr=jt,vr=Be,br=Me,Cr=cr,yr="Object already initialized",wr=mr.TypeError,_r=mr.WeakMap;if(pr||br.state){var Er=br.state||(br.state=new _r);Er.get=Er.get,Er.has=Er.has,Er.set=Er.set,rr=function(e,t){if(Er.has(e))throw wr(yr);return t.facade=e,Er.set(e,t),t},or=function(e){return Er.get(e)||{}},ir=function(e){return Er.has(e)}}else{var Wr=hr[nr="state"]||(hr[nr]=ur(nr));Cr[Wr]=!0,rr=function(e,t){if(vr(e,Wr))throw wr(yr);return t.facade=e,gr(e,Wr,t),t},or=function(e){return vr(e,Wr)?e[Wr]:{}},ir=function(e){return vr(e,Wr)}}var Ir={set:rr,get:or,has:ir,enforce:function(e){return ir(e)?or(e):rr(e,{})},getterFor:function(e){return function(t){var r;if(!fr(t)||(r=or(t)).type!==e)throw wr("Incompatible receiver, "+e+" required");return r}}},Rr=s,Sr=j,Hr=Be,xr=a,Nr=Qt.CONFIGURABLE,Tr=lr,Pr=Ir.enforce,Fr=Ir.get,Ar=Object.defineProperty,Mr=xr&&!Rr((function(){return 8!==Ar((function(){}),"length",{value:8}).length})),Or=String(String).split("String"),zr=qt.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Hr(e,"name")||Nr&&e.name!==t)&&(xr?Ar(e,"name",{value:t,configurable:!0}):e.name=t),Mr&&r&&Hr(r,"arity")&&e.length!==r.arity&&Ar(e,"length",{value:r.arity});try{r&&Hr(r,"constructor")&&r.constructor?xr&&Ar(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var o=Pr(e);return Hr(o,"source")||(o.source=Or.join("string"==typeof t?t:"")),e};Function.prototype.toString=zr((function(){return Sr(this)&&Fr(this).source||Tr(this)}),"toString");var Lr=j,kr=It,$r=Ut,Vr=Pe,Br={},Dr=Math.ceil,jr=Math.floor,Ur=Math.trunc||function(e){var t=+e;return(t>0?jr:Dr)(t)},qr=function(e){var t=+e;return t!=t||0===t?0:Ur(t)},Xr=qr,Yr=Math.max,Gr=Math.min,Jr=function(e,t){var r=Xr(e);return r<0?Yr(r+t,0):Gr(r,t)},Kr=qr,Qr=Math.min,Zr=function(e){return(t=e.length)>0?Qr(Kr(t),9007199254740991):0;var t},eo=$,to=Jr,ro=Zr,oo=function(e){return function(t,r,o){var i,n=eo(t),l=ro(n),s=to(o,l);if(e&&r!=r){for(;l>s;)if((i=n[s++])!=i)return!0}else for(;l>s;s++)if((e||s in n)&&n[s]===r)return e||s||0;return!e&&-1}},io={includes:oo(!0),indexOf:oo(!1)},no=Be,lo=$,so=io.indexOf,ao=cr,uo=W([].push),ho=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Br.f=Object.getOwnPropertyNames||function(e){return function(e,t){var r,o=lo(e),i=0,n=[];for(r in o)!no(ao,r)&&no(o,r)&&uo(n,r);for(;t.length>i;)no(o,r=t[i++])&&(~so(n,r)||uo(n,r));return n}(e,ho)};var co={};co.f=Object.getOwnPropertySymbols;var po=K,mo=Br,fo=co,go=Nt,vo=W([].concat),bo=po("Reflect","ownKeys")||function(e){var t=mo.f(go(e)),r=fo.f;return r?vo(t,r(e)):t},Co=Be,yo=bo,wo=l,_o=It,Eo=function(e,t,r){for(var o=yo(t),i=_o.f,n=wo.f,l=0;l<o.length;l++){var s=o[l];Co(e,s)||r&&Co(r,s)||i(e,s,n(t,s))}},Wo=s,Io=j,Ro=/#|\.prototype\./,So=function(e,t){var r=xo[Ho(e)];return r==To||r!=No&&(Io(t)?Wo(t):!!t)},Ho=So.normalize=function(e){return String(e).replace(Ro,".").toLowerCase()},xo=So.data={},No=So.NATIVE="N",To=So.POLYFILL="P",Po=So,Fo=n,Ao=l.f,Mo=jt,Oo=function(e,t,r,o){o||(o={});var i=o.enumerable,n=void 0!==o.name?o.name:t;if(Lr(r)&&$r(r,n,o),o.global)i?e[t]=r:Vr(t,r);else{try{o.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:kr.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e},zo=Pe,Lo=Eo,ko=Po,$o=function(e,t){var r,o,i,n,l,s=e.target,a=e.global,d=e.stat;if(r=a?Fo:d?Fo[s]||zo(s,{}):(Fo[s]||{}).prototype)for(o in t){if(n=t[o],i=e.dontCallGetSet?(l=Ao(r,o))&&l.value:r[o],!ko(a?o:s+(d?".":"#")+o,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;Lo(n,i)}(e.sham||i&&i.sham)&&Mo(n,"sham",!0),Oo(r,o,n,e)}},Vo={};Vo[ot("toStringTag")]="z";var Bo="[object z]"===String(Vo),Do=j,jo=H,Uo=ot("toStringTag"),qo=Object,Xo="Arguments"==jo(function(){return arguments}()),Yo=Bo?jo:function(e){var t,r,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=qo(e),Uo))?r:Xo?jo(t):"Object"==(o=jo(t))&&Do(t.callee)?"Arguments":o},Go=String,Jo=function(e){if("Symbol"===Yo(e))throw TypeError("Cannot convert a Symbol value to a string");return Go(e)},Ko=$o,Qo=a,Zo=n,ei=W,ti=Be,ri=j,oi=Q,ii=Jo,ni=It.f,li=Eo,si=Zo.Symbol,ai=si&&si.prototype;if(Qo&&ri(si)&&(!("description"in ai)||void 0!==si().description)){var di={},ui=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:ii(arguments[0]),t=oi(ai,this)?new si(e):void 0===e?si():si(e);return""===e&&(di[t]=!0),t};li(ui,si),ui.prototype=ai,ai.constructor=ui;var hi="Symbol(test)"==String(si("test")),ci=ei(ai.valueOf),pi=ei(ai.toString),mi=/^Symbol\((.*)\)[^)]+$/,fi=ei("".replace),gi=ei("".slice);ni(ai,"description",{configurable:!0,get:function(){var e=ci(this);if(ti(di,e))return"";var t=pi(e),r=hi?gi(t,7,-1):fi(t,mi,"$1");return""===r?void 0:r}}),Ko({global:!0,constructor:!0,forced:!0},{Symbol:ui})}var vi,bi,Ci=ve,yi=TypeError,wi=ht,_i=It,Ei=C,Wi=Jr,Ii=Zr,Ri=function(e,t,r){var o=wi(t);o in e?_i.f(e,o,Ei(0,r)):e[o]=r},Si=Array,Hi=Math.max,xi=function(e,t,r){for(var o=Ii(e),i=Wi(t,o),n=Wi(void 0===r?o:r,o),l=Si(Hi(n-i,0)),s=0;i<n;i++,s++)Ri(l,s,e[i]);return l.length=s,l},Ni=Math.floor,Ti=function(e,t){var r=e.length,o=Ni(r/2);return r<8?Pi(e,t):Fi(e,Ti(xi(e,0,o),t),Ti(xi(e,o),t),t)},Pi=function(e,t){for(var r,o,i=e.length,n=1;n<i;){for(o=n,r=e[n];o&&t(e[o-1],r)>0;)e[o]=e[--o];o!==n++&&(e[o]=r)}return e},Fi=function(e,t,r,o){for(var i=t.length,n=r.length,l=0,s=0;l<i||s<n;)e[l+s]=l<i&&s<n?o(t[l],r[s])<=0?t[l++]:r[s++]:l<i?t[l++]:r[s++];return e},Ai=Ti,Mi=s,Oi=Z.match(/firefox\/(\d+)/i),zi=!!Oi&&+Oi[1],Li=/MSIE|Trident/.test(Z),ki=Z.match(/AppleWebKit\/(\d+)\./),$i=!!ki&&+ki[1],Vi=$o,Bi=W,Di=we,ji=ke,Ui=Zr,qi=function(e,t){if(!delete e[t])throw yi("Cannot delete property "+Ci(t)+" of "+Ci(e))},Xi=Jo,Yi=s,Gi=Ai,Ji=zi,Ki=Li,Qi=le,Zi=$i,en=[],tn=Bi(en.sort),rn=Bi(en.push),on=Yi((function(){en.sort(void 0)})),nn=Yi((function(){en.sort(null)})),ln=!!(bi=[]["sort"])&&Mi((function(){bi.call(null,vi||function(){return 1},1)})),sn=!Yi((function(){if(Qi)return Qi<70;if(!(Ji&&Ji>3)){if(Ki)return!0;if(Zi)return Zi<603;var e,t,r,o,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(o=0;o<47;o++)en.push({k:t+o,v:r})}for(en.sort((function(e,t){return t.v-e.v})),o=0;o<en.length;o++)t=en[o].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));Vi({target:"Array",proto:!0,forced:on||!nn||!ln||!sn},{sort:function(e){void 0!==e&&Di(e);var t=ji(this);if(sn)return void 0===e?tn(t):tn(t,e);var r,o,i=[],n=Ui(t);for(o=0;o<n;o++)o in t&&rn(i,t[o]);for(Gi(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:Xi(t)>Xi(r)?1:-1}}(e)),r=Ui(i),o=0;o<r;)t[o]=i[o++];for(;o<n;)qi(t,o++);return t}});const an=Array.prototype.indexOf,dn=function(e,t){for(let r=0,o=e.length;r>=0&&r<o;r+=1)if(t(e[r],r,e))return e[r]},un=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")};function hn(){let e=[];return Object.assign(e,hn.prototype),e.initialize.apply(e,arguments),e}hn.prototype=[],hn.prototype.initialize=function(e){e=e||{},this.sortColumn=null==e.sortColumn?[]:e.sortColumn},hn.prototype.add=function(e,t){let r,o;if("splice"in e&&"length"in e)if("number"==typeof t)for(r=0,o=e.length;r<o;r++)this.splice(t++,0,e[r]);else for(r=0,o=e.length;r<o;r++)this.push(e[r]);else"number"==typeof t?this.splice(t,0,e):this.push(e)},hn.prototype.reset=function(e){this.length=0,e&&this.add(e)},hn.prototype.filteredCollection=function(e,t){if(e&&t){let r=new hn({sortColumn:this.sortColumn});for(let o,i=0,n=this.length;i<n;i++)o=this[i],e(o,t)&&(o.__i=i,r.push(o));return r}return null},hn.prototype.onComparatorRequired=null,hn.prototype.onSort=null;let cn=hn.prototype.sort;function pn(e,t){let r=e.column,o=e.comparePath||r;"string"==typeof o&&(o=o.split("."));let i,n=o.length,l=n>1,s=t?1:-1,a=t?-1:1;return function(e,t){let r=e[o[0]],d=t[o[0]];if(l)for(i=1;i<n;i++)r=r&&r[o[i]],d=d&&d[o[i]];return r===d?0:null==r?s:null==d?a:r<d?s:a}}function mn(){let e=[];return Object.assign(e,mn.prototype),e.initialize.apply(e,arguments),e}hn.prototype.sort=function(e){let t;if(this.sortColumn.length){let r=[];for(let e=0;e<this.sortColumn.length;e++){t=null;const o=pn(this.sortColumn[e],this.sortColumn[e].descending);this.onComparatorRequired&&(t=this.onComparatorRequired(this.sortColumn[e].column,this.sortColumn[e].descending,o)),t||(t=o),r.push(t.bind(this))}if(1===r.length)t=r[0],cn.call(this,t);else{let e,o=r.length;t=function(t,i){for(let n=0;n<o;n++)if(e=r[n](t,i),0!==e)return e;return e},cn.call(this,t)}e||this.onSort&&this.onSort(t)}return t},mn.prototype=[],mn.prototype.initialize=function(){},mn.prototype.get=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].name===e)return this[t];return null},mn.prototype.indexOf=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].name===e)return t;return-1},mn.prototype.getByOrder=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].order===e)return this[t];return null},mn.prototype.normalizeOrder=function(){let e,t=[];for(e=0;e<this.length;e++)t.push(this[e]);for(t.sort((function(e,t){return e.order<t.order?-1:e.order>t.order?1:0})),e=0;e<t.length;e++)t[e].order=e;return this},mn.prototype.getColumns=function(){let e=[];for(let t,r=0;r<this.length;r++)t=this[r],e.push(t);return e.sort(((e,t)=>e.order<t.order?-1:e.order>t.order?1:0)),e},mn.prototype.getVisibleColumns=function(){let e=[];for(let t,r=0;r<this.length;r++)t=this[r],t.visible&&e.push(t);return e.sort(((e,t)=>e.order<t.order?-1:e.order>t.order?1:0)),e},mn.prototype.getMaxOrder=function(){let e=0;for(let t,r=0;r<this.length;r++)t=this[r],t.order>e&&(e=t.order);return e},mn.prototype.moveColumn=function(e,t){if(e&&t){let r,o,i=e.order,n=t.order;if(i<n)for(r=i+1;r<=n;r++)o=this.getByOrder(r),o.order--;else for(r=i-1;r>=n;r--)o=this.getByOrder(r),o.order++;e.order=n}return this};class fn{static saveSelection(e){let t=window.getSelection().getRangeAt(0);if(e!==t.commonAncestorContainer&&!function(e,t){for(;(e=e.parentNode)&&e!==t;);return!!e}(t.commonAncestorContainer,e))return null;let r=t.cloneRange();r.selectNodeContents(e),r.setEnd(t.startContainer,t.startOffset);let o=r.toString().length;return{start:o,end:o+t.toString().length}}static restoreSelection(e,t){let r,o=0,i=[e],n=!1,l=!1,s=document.createRange();for(s.setStart(e,0),s.collapse(!0);!l&&(r=i.pop());)if(3===r.nodeType){let e=o+r.length;!n&&t.start>=o&&t.start<=e&&(s.setStart(r,t.start-o),n=!0),n&&t.end>=o&&t.end<=e&&(s.setEnd(r,t.end-o),l=!0),o=e}else{let e=r.childNodes.length;for(;e--;)i.push(r.childNodes[e])}let a=window.getSelection();a.removeAllRanges(),a.addRange(s)}}const gn=Object.prototype.hasOwnProperty,vn=void 0!==Element.prototype.insertAdjacentElement;function bn(e,t,r){t?!1===vn||e instanceof DocumentFragment?r.insertBefore(e,t):t.insertAdjacentElement("beforebegin",e):r.appendChild(e)}function Cn(e,t,r,o){return e.parentNode!==o?(t||(t=document.createDocumentFragment()),t.appendChild(e)):(t&&t.childNodes.length>0&&(bn(t,r,o),t=null),e.nextSibling!==r&&bn(e,r,o)),t}class yn{constructor(e){var t;const r=this._p={list:e.list||null,hookScrollEvent:void 0===e.hookScrollEvent||!!e.hookScrollEvent,count:e.count||0,virtual:void 0===e.virtual||!!e.virtual,userItemsParent:e.itemsParent||null,setVirtualWrapperWidth:null===(t=e.autoVirtualWrapperWidth)||void 0===t||t,estimatedItemHeight:20,buffer:5,itemHeightEstimatorFn:null,itemElementCreatorFn:En,onItemRender:null,onItemUnrender:null,onScrollHeightChange:e.onScrollHeightChange,virtualWrapper:null,currentItemsParent:null,cachedItemHeights:[],cachedItemEstimatedHeights:[],cachedItemPositions:[],itemPositionsNeedsUpdate:0,boundRender:this.render.bind(this),existingEls:[]};r.currentItemsParent=r.userItemsParent||r.list,"boolean"==typeof e.hookScrollEvent?this.setHookScrollEvent(e.hookScrollEvent):this._hookEvents(),"number"==typeof e.count&&this.setCount(e.count),"boolean"==typeof e.virtual&&this.setVirtual(e.virtual),"number"==typeof e.estimatedItemHeight&&this.setEstimatedItemHeight(e.estimatedItemHeight),"number"==typeof e.buffer&&this.setBuffer(e.buffer),"function"==typeof e.itemHeightEstimatorFn&&this.setItemHeightEstimatorFn(e.itemHeightEstimatorFn),"function"==typeof e.itemElementCreatorFn&&this.setItemElementCreatorFn(e.itemElementCreatorFn),"function"==typeof e.onItemRender&&this.setOnItemRender(e.onItemRender),"function"==typeof e.onItemUnrender&&this.setOnItemUnrender(e.onItemUnrender)}destroy(){this._unhookEvents().invalidate()._destroyElements()}setHookScrollEvent(e){const t=this._p;return e=void 0===e||!!e,t.hookScrollEvent===e||(t.hookScrollEvent=e,this._unhookEvents()._hookEvents()),this}isHookScrollEventEnabled(){return this._p.hookScrollEvent}setCount(e){return this._p.count=e,this.invalidatePositions()}getCount(){return this._p.count}setVirtual(e){const t=this._p;return e=void 0===e||!!e,t.virtual===e||(t.virtual=e,this._hookEvents().invalidate()._destroyElements()),this}isVirtual(){return this._p.virtual}setEstimatedItemHeight(e){return this._p.estimatedItemHeight=Math.abs(("number"==typeof e?e:Number(e))||20),this}getEstimatedItemHeight(){return this._p.estimatedItemHeight}setAutoVirtualWrapperWidth(e){const t=this._p;return t.autoVirtualWrapperWidth=void 0===e||!!e,t.virtualWrapper&&t.autoVirtualWrapperWidth!==t.virtualWrapperWidthWasSet&&(t.virtualWrapper.style.width=t.autoVirtualWrapperWidth?"100%":"",t.virtualWrapperWidthWasSet=t.autoVirtualWrapperWidth),this}isAutoVirtualWrapperWidth(){return this._p.autoVirtualWrapperWidth}setBuffer(e){return this._p.buffer=Math.abs("number"==typeof e?e:Number(e)||5),this}getBuffer(){return this._p.buffer}setItemHeightEstimatorFn(e){return this._p.itemHeightEstimatorFn=e,this}setItemElementCreatorFn(e){return this._p.itemElementCreatorFn=e||En,this}setOnItemRender(e){return this._p.onItemRender=e,this}setOnItemUnrender(e){return this._p.onItemUnrender=e,this}setOnScrollHeightChange(e){return this._p.onScrollHeightChange=e,this}estimateFullHeight(){const e=this._p;if(0===e.count)return 0;if(e.virtual)return this._calculateItemPosition(e.count)||0;{const t=e.existingEls;if(e.count===t.length){let e=t[0].getBoundingClientRect(),r=t[t.length-1].getBoundingClientRect();return r.top-e.top+r.height}return this._calculateItemPosition(e.count)||0}}invalidatePositions(){const e=this._p;return e.itemPositionsNeedsUpdate=0,e.cachedItemHeights=[],e.cachedItemEstimatedHeights=[],e.cachedItemPositions=[],e.cachedItemHeights.length=e.count,e.cachedItemEstimatedHeights.length=e.count,e.cachedItemPositions.length=e.count,this}invalidate(){const e=this._p;this.invalidatePositions();const t=e.onItemUnrender,r=e.existingEls;for(let e=0;e<r.length;e++){const o=r[e];void 0!==o[wn]&&(t&&t(o),delete o[wn])}return this}render(){const e=this._p,t=e.list,r=e.virtual;let o=e.virtualWrapper,i=e.currentItemsParent,n=t.scrollTop,l=n+t.clientHeight,s=e.count,a=e.buffer,d=e.onItemUnrender,u=e.existingEls,h=u.length;if(r){const r=t.clientWidth;o||(o=e.virtualWrapper=e.userItemsParent,o||(o=e.virtualWrapper=document.createElement("div"),t.appendChild(o)),this._resetCurrentItemsParent(),i=e.currentItemsParent,e.autoVirtualWrapperWidth?(o.style.width="100%",e.virtualWrapperWidthWasSet=!0):e.virtualWrapperWidthWasSet=!1);for(let e=0;e<h;e++)u[e][_n]=!0;this._calculateItemPosition(e.count-1);let d=this._getExistingElsRange(),p=Wn(e.cachedItemPositions,n),m=Math.max(0,p-a),f=m,g=this._calculateItemPosition(f),v=a,b=Math.max(f,Wn(e.cachedItemPositions,l-1)+1+a),C=[],y=null,w=o.childNodes[0];const _=function(e){let t;return-1!==d.firstIndex&&e>=d.firstIndex&&e<=d.lastIndex&&(t=u.find((t=>t[wn]===e&&!0===t[_n]))),void 0===t&&(t=(d.firstIndex<m||d.firstValidArrayIndex>0?u.find((e=>(e[wn]<m||!1===gn.call(e,wn))&&!0===e[_n])):void 0)||Rn(u,(e=>!0===e[_n]))),void 0!==t&&delete t[_n],t};for(;f<s&&f<b;f++){let e=_(f);w&&w===e&&(w=w.nextSibling);const t=this._dequeueElementForIndex(e,f,w,!0);C.push([t,f]),y=Cn(t,y,w,i)}y&&y.childNodes.length>0&&bn(y,w,i);for(let t of C){const r=t[1];this._insertItemAndFlow(t[0],r,!1),g=e.cachedItemPositions[r]+e.cachedItemHeights[r]}if(g<l)for(;(g<l||v-- >0)&&f<s;f++){let t=_(f);w&&w===t&&(w=w.nextSibling),this._dequeueElementForIndex(t,f,w,!1),g=e.cachedItemPositions[f]+e.cachedItemHeights[f]}let E=this.estimateFullHeight(),W=E+"px";var c;o.style.height!==W&&(e.virtualWrapper.style.height=W,null===(c=e.onScrollHeightChange)||void 0===c||c.call(e,E)),r!==t.clientWidth&&this.render()}else if(s!==u.length){for(let e=0;e<h;e++)u[e][_n]=!0;let e=i.childNodes[0],t=null;for(let r=0;r<s;r++){let o=u.find((e=>e[wn]===r&&!0===e[_n]));void 0!==o&&delete o[_n],e&&e===o&&(e=e.nextSibling),t=Cn(this._dequeueElementForIndex(o,r,e,!0),t,e,i)}t&&t.childNodes.length>0&&bn(t,e,i)}h=u.length;for(let e=0;e<h;e++){const t=u[e];if(!0!==t[_n])continue;let r=t.parentNode;r&&r.removeChild(t),d&&void 0!==t[wn]&&d(t),u.splice(e,1),e--,h--}}addItemsAt(e,t=-1){if("number"!=typeof e||e<=0)return this;const r=this._p;if((t<-1||t>=r.count)&&(t=r.count),r.count+=e,r.virtual)t>=0&&t<r.count&&this._invalidateItemIndexesAt(t,-1);else{let o=r.existingEls;if(o.length!==r.count-e)return this;let i=this._getExistingElsRange();if(-1===i.firstValidArrayIndex)return this;const n=r.currentItemsParent;let l=i.firstValidArrayIndex+t-i.firstIndex;this._pushItemIndexesAt(t,e);let s=o[l-1]?o[l-1].nextSibling:o[0],a=null;for(let r=t,o=t+e;r<o;r++)a=Cn(this._dequeueElementForIndex(void 0,r,s,!0),a,s,n);a&&a.childNodes.length>0&&bn(a,s,n)}return this}removeItemsAt(e,t){const r=this._p;if("number"!=typeof e||"number"!=typeof t||e<=0||t<0||t>=r.count)return this;if(r.count-=Math.min(e,r.count-t),r.virtual)this._invalidateItemIndexesAt(t,-1);else{let o=r.existingEls;if(o.length!==r.count+e)return this;let i=this._getExistingElsRange();if(-1===i.firstValidArrayIndex)return this;this._pushItemIndexesAt(t+e,-e);const n=r.onItemUnrender;let l=i.firstValidArrayIndex+t-i.firstIndex;if(l<o.length){for(let t=0;t<e;t++){let e=o[l+t],r=e.parentNode;r&&r.removeChild(e),n&&void 0!==e[wn]&&n(e)}o.splice(l,e)}}return this}refreshItemAt(e){const t=this._p;if("number"!=typeof e||e<0||e>=t.count)return this;if(t.virtual)this._invalidateItemIndexesAt(e,1);else{let r=t.existingEls;if(r.length!==t.count)return this;let o=this._getExistingElsRange();if(e>=o.firstIndex&&e<=o.lastIndex){let t=r[o.firstValidArrayIndex+e-o.firstIndex];delete t[wn],this._dequeueElementForIndex(t,e,t.nextSibling,!1)}}return this}isItemRendered(e){const t=this._p;if("number"!=typeof e||e<0||e>=t.count)return!1;let r=this._getExistingElsRange();return e>=r.firstIndex&&e<=r.lastIndex}getItemElementAt(e){const t=this._p;if("number"!=typeof e||e<0||e>=t.count)return;let r=t.existingEls,o=this._getExistingElsRange();return e>=o.firstIndex&&e<=o.lastIndex?r[o.firstValidArrayIndex+e-o.firstIndex]:void 0}getItemPosition(e){const t=this._p;if(!("number"!=typeof e||e<0||e>=t.count)){if(t.virtual)return this._calculateItemPosition(e);{let o=this.getItemElementAt(e);if(void 0===o)return;const i=t.list;return r.getElementOffset(o).top-r.getElementOffset(i).top+i.scrollTop}}}getItemIndexFromElement(e){return e?e[wn]:void 0}getItemSize(e){const t=this._p;if("number"!=typeof e||e<0||e>=t.count)return;let r=t.cachedItemHeights[e-1];return void 0===r&&(r=t.itemHeightEstimatorFn?t.itemHeightEstimatorFn(e-1):null,"number"!=typeof r&&(r=t.estimatedItemHeight),t.cachedItemEstimatedHeights[e-1]=r),r}getVisibleItemCount(){const e=this._p,t=e.list;let r,o,i=t.scrollTop,n=t.clientHeight;if(e.virtual)r=Wn(e.cachedItemPositions,i),o=Wn(e.cachedItemPositions,i+n,r);else{const t=e=>{let t=this.getItemPosition(e);return void 0===t&&(t=1/0),t};r=In(e.count,t,i),o=In(e.count,t,i+n,r)}return this.getItemPosition(o)===i+n&&o--,o-r+1}createGhostItemElement(e,t,r){const o=this._p;let i=this._dequeueElementForIndex(null,e,!1,!0);try{t&&o.currentItemsParent.appendChild(i),r(i)}finally{if(t){let e=i.parentNode;e&&e.removeChild(i)}o.onItemUnrender&&o.onItemUnrender(i)}}_resetCurrentItemsParent(){var e,t;const r=this._p;r.currentItemsParent=null!==(e=null!==(t=r.virtualWrapper)&&void 0!==t?t:r.userItemsParent)&&void 0!==e?e:r.list}_destroyElements(){const e=this._p,t=e.onItemUnrender,r=e.existingEls;for(let e=0;e<r.length;e++){const o=r[e];let i=o.parentNode;i&&i.removeChild(o),t&&void 0!==o[wn]&&t(o)}return r.length=0,e.virtualWrapper&&(e.virtualWrapper!==e.userItemsParent&&e.virtualWrapper.parentNode&&e.virtualWrapper.parentNode.removeChild(e.virtualWrapper),e.virtualWrapper=null,this._resetCurrentItemsParent()),this}_invalidateItemIndexesAt(e,t){const r=this._p;this._setItemPositionsNeedsUpdate(e);let o=r.existingEls,i=o.length,n=this._getExistingElsRange();if(-1!==n.firstValidArrayIndex&&(-1===t&&(t=o.length),e>=n.firstIndex&&e<=n.lastIndex))for(let r=n.firstValidArrayIndex+e-n.firstIndex,l=0;r<i&&l<t;r++,l++)delete o[r][wn]}_pushItemIndexesAt(e,t){let r=this._p.existingEls,o=r.length,i=this._getExistingElsRange();if(-1!==i.firstValidArrayIndex&&e>=i.firstIndex&&e<=i.lastIndex)for(let n=i.firstValidArrayIndex+e-i.firstIndex;n<o;n++)r[n][wn]+=t}_hookEvents(){const e=this._p;return this._unhookEvents(),e.virtual&&e.hookScrollEvent&&e.list&&e.list.addEventListener("scroll",e.boundRender),this}_unhookEvents(){const e=this._p;return e.list&&e.list.removeEventListener("scroll",e.boundRender),this}_setItemPositionsNeedsUpdate(e){const t=this._p;e<t.itemPositionsNeedsUpdate&&(t.itemPositionsNeedsUpdate=e)}_calculateItemPosition(e){const t=this._p,r=t.cachedItemPositions;if(e>=t.itemPositionsNeedsUpdate){const o=t.count,i=t.cachedItemHeights,n=t.cachedItemEstimatedHeights,l=t.estimatedItemHeight,s=t.itemHeightEstimatorFn;i.length!==o&&(i.length=o,n.length=o,r.length=o);let a=t.itemPositionsNeedsUpdate,d=Math.min(e,o),u=0;a>0&&(u=r[a-1]);for(let e=a;e<=d;e++){if(0===e){r[e]=u;continue}const t=e-1;let o=i[t];void 0===o&&(o=s?s(t):null,"number"!=typeof o&&(o=l),n[t]=o),u+=o,r[e]=u}t.itemPositionsNeedsUpdate=d+1}if(e>0&&e===t.count){let o=t.cachedItemHeights[e-1];return void 0===o&&(o=t.itemHeightEstimatorFn?t.itemHeightEstimatorFn(e-1):null,"number"!=typeof o&&(o=t.estimatedItemHeight),t.cachedItemEstimatedHeights[e-1]=o),r[e-1]+o}return r[e]}_dequeueElementForIndex(e,t,r,o){const i=this._p,n=i.virtualWrapper;i.currentItemsParent;const l=i.existingEls,s=i.onItemRender,a=i.onItemUnrender,d=!e,u=d||t!==e[wn];if(e?a&&u&&a(e):(e=i.itemElementCreatorFn(),n&&!1!==r&&(e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.right="0")),u&&(e.innerHTML="",s&&s(e,t)),!1!==r){if(r instanceof Node||(r=null),!d){let t=l.indexOf(e);-1!==t&&l.splice(t,1)}let i=r?l.indexOf(r):-1;-1===i?l.push(e):l.splice(i,0,e),o||this._insertItemAndFlow(e,t,r)}return e[wn]=t,e}_insertItemAndFlow(e,t,r){const o=this._p,i=o.virtualWrapper,n=o.currentItemsParent;if(!1!==r&&(r instanceof Node||(r=null),e.parentNode===n&&e.nextSibling===r||bn(e,r,n)),i){let r=e.getBoundingClientRect().height,i=o.cachedItemHeights[t];i!==r&&(o.cachedItemHeights[t]=r),(void 0!==i&&r!==i||void 0===i&&r!==o.cachedItemEstimatedHeights[t])&&this._setItemPositionsNeedsUpdate(t+1);let n=this._calculateItemPosition(t);const l=Hn();!1===l?e.style.top=`${n}px`:e.style[l]=`translateY(${n}px)`}}_getExistingElsRange(){const e=this._p.existingEls;let t=-1,r=-1;for(let r=0,o=e.length;r<o;r++)if(!1!==gn.call(e[r],wn)){t=r;break}for(let t=e.length-1;t>=0;t--)if(!1!==gn.call(e[t],wn)){r=t;break}return{firstValidArrayIndex:t,lastValidArrayIndex:r,firstIndex:-1!==t?e[t][wn]:-1,lastIndex:-1!==r?e[r][wn]:-1}}}const wn=Symbol("index"),_n=Symbol("reuse"),En=()=>document.createElement("li"),Wn=(e,t,r=0,o=-1)=>{let i=e.length;if(o<0&&(o+=i),o<=r)return o;for(;r<=o;){let n=Math.floor(r+(o-r)/2),l=e[n];if(l===t||l<=t&&n<i&&e[n+1]>t){for(;n>0&&e[n-1]===l;)n--;return n}l<t?r=n+1:o=n-1}return-1===o?0:i-1},In=(e,t,r,o=0,i=-1)=>{if(i<0&&(i+=e),i<=o)return i;for(;o<=i;){let n=Math.floor(o+(i-o)/2),l=t(n);if(l===r||l<=r&&n<e&&t(n+1)>r){for(;n>0&&t(n-1)===l;)n--;return n}l<r?o=n+1:i=n-1}return-1===i?0:t(e-1)},Rn=(e,t)=>{for(let r=e.length-1;r>=0;r--)if(t(e[r]))return e[r]};let Sn=null;const Hn=()=>{if(null===Sn){let e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],t=document.createElement("div");Sn=!1;for(let r of e)if(t&&void 0!==t.style[r]){Sn=r;break}}return Sn};function xn(e,t){let r=t.column,o=null==t.keyword?"":t.keyword.toString();if(!o||!r)return!0;let i=e[r];return null!=i&&(i=i.toString(),t.caseSensitive||(i=i.toLowerCase(),o=o.toLowerCase()),-1!==i.indexOf(o))}const Nn=Array.prototype.indexOf,Tn=e;let Pn=navigator.userAgent,Fn=-1!==Pn.indexOf("MSIE ")?parseFloat(Pn.substr(Pn.indexOf("MSIE ")+5)):null,An=Fn&&Fn<10,Mn=document.createElement.bind(document);const On=Object.prototype.hasOwnProperty,zn=Symbol("safe"),Ln=Symbol("hover_in"),kn=Symbol("hover_out"),$n=Symbol("row_click");function Vn(e){var t,r;t=["relative","absolute","fixed"],r=e.css("position"),an.call(t,r)>=0||e.css("position","relative")}const Bn=e=>/^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(e.target.tagName);let Dn=function e(){if(!(this instanceof e))return new(Function.prototype.bind.apply(e,[e].concat(Array.prototype.slice.call(arguments,0))));this.initialize.apply(this,arguments)};Dn.VERSION="@@VERSION",Dn.prototype.VERSION=Dn.VERSION,Dn.prototype.initialize=function(e){let t=this;e=e||{};let r=t.o={},o=t.p={};o.events={},t.el=e.el&&e.el instanceof Element?e.el:document.createElement("div");let i=t.$el=Tn(t.el);t.el!==e.el&&i.addClass(e.className||"dgtable-wrapper"),i.data("control",t).data("dgtable",t),i.on("remove",(()=>t.destroy())),o.onMouseMoveResizeAreaBound=this._onMouseMoveResizeArea.bind(this),o.onEndDragColumnHeaderBound=this._onEndDragColumnHeader.bind(this),o.onTableScrolledHorizontallyBound=this._onTableScrolledHorizontally.bind(this),this.$el.on("dragend",o.onEndDragColumnHeaderBound),o.tableSkeletonNeedsRendering=!0,r.virtualTable=void 0===e.virtualTable||!!e.virtualTable,r.estimatedRowHeight=e.estimatedRowHeight||void 0,r.rowsBufferSize=e.rowsBufferSize||3,r.minColumnWidth=Math.max(e.minColumnWidth||35,0),r.resizeAreaWidth=e.resizeAreaWidth||8,r.resizableColumns=void 0===e.resizableColumns||!!e.resizableColumns,r.movableColumns=void 0===e.movableColumns||!!e.movableColumns,r.sortableColumns=void 0===e.sortableColumns?1:parseInt(e.sortableColumns,10)||1,r.adjustColumnWidthForSortArrow=void 0===e.adjustColumnWidthForSortArrow||!!e.adjustColumnWidthForSortArrow,r.convertColumnWidthsToRelative=void 0!==e.convertColumnWidthsToRelative&&!!e.convertColumnWidthsToRelative,r.autoFillTableWidth=void 0!==e.autoFillTableWidth&&!!e.autoFillTableWidth,r.cellClasses=void 0===e.cellClasses?"":e.cellClasses,r.resizerClassName=void 0===e.resizerClassName?"dgtable-resize":e.resizerClassName,r.tableClassName=void 0===e.tableClassName?"dgtable":e.tableClassName,r.allowCellPreview=void 0===e.allowCellPreview||e.allowCellPreview,r.allowHeaderCellPreview=void 0===e.allowHeaderCellPreview||e.allowHeaderCellPreview,r.cellPreviewClassName=void 0===e.cellPreviewClassName?"dgtable-cell-preview":e.cellPreviewClassName,r.cellPreviewAutoBackground=void 0===e.cellPreviewAutoBackground||e.cellPreviewAutoBackground,r.onComparatorRequired=void 0===e.onComparatorRequired?null:e.onComparatorRequired,r.onComparatorRequired||"function"!=typeof e.comparatorCallback||(r.onComparatorRequired=e.comparatorCallback),r.width=void 0===e.width?Dn.Width.NONE:e.width,r.relativeWidthGrowsToFillWidth=void 0===e.relativeWidthGrowsToFillWidth||!!e.relativeWidthGrowsToFillWidth,r.relativeWidthShrinksToFillWidth=void 0!==e.relativeWidthShrinksToFillWidth&&!!e.relativeWidthShrinksToFillWidth,this.setCellFormatter(e.cellFormatter),this.setHeaderCellFormatter(e.headerCellFormatter),this.setFilter(e.filter),r.height=e.height,t.setColumns(e.columns||[],!1);let n=[];if(e.sortColumn){let t=e.sortColumn;if(t&&!Array.isArray(t)&&(t=[t]),t)for(let e=0,r=t.length;e<r;e++){let r=t[e];"string"==typeof r&&(r={column:r,descending:!1});let i=o.columns.get(r.column);i&&n.push({column:r.column,comparePath:i.comparePath||i.dataPath,descending:r.descending})}}o.rows=new hn({sortColumn:n}),o.rows.onComparatorRequired=(e,t,o)=>{if(r.onComparatorRequired)return r.onComparatorRequired(e,t,o)},o.filteredRows=null,o.scrollbarWidth=0,o.lastVirtualScrollHeight=0,this._setupHovers()},Dn.prototype._setupHovers=function(){const e=this,t=e.p;let r=function(t){let r=t.fromElement||t.relatedTarget;r===this||Tn.contains(this,r)||this.__previewCell&&(r===this.__previewCell||Tn.contains(this.__previewCell,r))||e._cellMouseOverEvent.call(e,this)},o=function(t){let r=(t=t||event).toElement||t.relatedTarget;r===this||Tn.contains(this,r)||this.__previewCell&&(r===this.__previewCell||Tn.contains(this.__previewCell,r))||e._cellMouseOutEvent.call(e,this)};t._bindCellHoverIn=function(e){e[Ln]||e.addEventListener("mouseover",e[Ln]=r.bind(e))},t._unbindCellHoverIn=function(e){e[Ln]&&(e.removeEventListener("mouseover",e[Ln]),e[Ln]=null)},t._bindCellHoverOut=function(e){return e[kn]||e.addEventListener("mouseout",e[kn]=o.bind(e.__cell||e)),this},t._unbindCellHoverOut=function(e){return e[kn]&&(e.removeEventListener("mouseout",e[kn]),e[kn]=null),this}},Dn.prototype._setupVirtualTable=function(){var e;const t=this,r=t.p,o=t.o,i=o.tableClassName,n=i+"-row",l=i+"-row-alt",s=i+"-cell";let a=r.visibleColumns,d=a.length;r.notifyRendererOfColumnsConfig=()=>{a=r.visibleColumns,d=a.length;for(let e,t=0;t<d;t++)e=a[t],e._finalWidth=e.actualWidthConsideringScrollbarWidth||e.actualWidth},r.virtualListHelper=new yn({list:r.table,itemsParent:r.tbody,autoVirtualWrapperWidth:!1,virtual:o.virtualTable,buffer:o.rowsBufferSize,estimatedItemHeight:o.estimatedRowHeight?o.estimatedRowHeight:r.virtualRowHeight||40,itemElementCreatorFn:()=>Mn("div"),onItemRender:(e,i)=>{const u=r.filteredRows||r.rows,h=!!r.filteredRows,c=o.allowCellPreview;e.className=n,i%2==1&&(e.className+=" "+l);let p=u[i],m=h?p.__i:i;e.rowIndex=i,e.physicalRowIndex=m;for(let t=0;t<d;t++){let o=a[t],i=Mn("div");i.columnName=o.name,i.setAttribute("data-column",o.name),i.className=s,i.style.width=o._finalWidth+"px",o.cellClasses&&(i.className+=" "+o.cellClasses),c&&r._bindCellHoverIn(i),i.appendChild(Mn("div")).innerHTML=this._getHtmlForCell(p,o),e.appendChild(i)}e.addEventListener("click",e[$n]=r=>{t.trigger("rowclick",r,i,m,e,p)}),t.trigger("rowcreate",i,m,e,p)},onItemUnrender:e=>{e[$n]&&e.removeEventListener("click",e[$n]),t._unbindCellEventsForRow(e),t.trigger("rowdestroy",e)},onScrollHeightChange:e=>{e>r._lastVirtualScrollHeight&&!r.scrollbarWidth&&this._updateLastCellWidthFromScrollbar(),r._lastVirtualScrollHeight=e}}),r.virtualListHelper.setCount((null!==(e=r.filteredRows)&&void 0!==e?e:r.rows).length),r.notifyRendererOfColumnsConfig()},Dn.prototype.on=function(e,t){let r=this.p.events;return"function"!=typeof t||(On.call(r,e)||(r[e]=[]),r[e].push({cb:t,once:!1})),this},Dn.prototype.once=function(e,t){let r=this.p.events;return"function"!=typeof t||(On.call(r,e)||(r[e]=[]),r[e].push({cb:t,once:!0})),this},Dn.prototype.off=function(e,t){let r=this.p.events;if(!On.call(r,e))return this;let o=r[e];for(let e=0;e<o.length;e++){let r=o[e];t&&r.cb!==t||o.splice(e--,1)}return this},Dn.prototype.trigger=function(e){const t=this.p;if(!t)return;let r=t.events;if(On.call(r,e)){let t=r[e];for(let e=0;e<t.length;e++){let r=t[e];r.once&&t.splice(e--,1),r.cb.apply(this,Array.prototype.slice.call(arguments,1))}}return this},Dn.prototype._parseColumnWidth=function(e,t){let r=Math.max(0,parseFloat(e)),o=jn.AUTO;return r>0&&(e===r+"%"?(o=jn.RELATIVE,r/=100):r>0&&r<1?o=jn.RELATIVE:(r<t&&(r=t),o=jn.ABSOLUTE)),{width:r,mode:o}},Dn.prototype._initColumnFromData=function(e){let t=this._parseColumnWidth(e.width,e.ignoreMin?0:this.o.minColumnWidth),r={name:e.name,label:void 0===e.label?e.name:e.label,width:t.width,widthMode:t.mode,resizable:void 0===e.resizable||e.resizable,sortable:void 0===e.sortable||e.sortable,movable:void 0===e.movable||e.movable,visible:void 0===e.visible||e.visible,cellClasses:void 0===e.cellClasses?this.o.cellClasses:e.cellClasses,ignoreMin:void 0!==e.ignoreMin&&!!e.ignoreMin};return r.dataPath=void 0===e.dataPath?r.name:e.dataPath,r.comparePath=void 0===e.comparePath?r.dataPath:e.comparePath,"string"==typeof r.dataPath&&(r.dataPath=r.dataPath.split(".")),"string"==typeof r.comparePath&&(r.comparePath=r.comparePath.split(".")),r},Dn.prototype.close=Dn.prototype.remove=Dn.prototype.destroy=function(){var e;let t=this,r=t.p||{},o=t.$el;if(t.__removed)return t;if(r.$resizer&&(r.$resizer.remove(),r.$resizer=null),null===(e=r.virtualListHelper)||void 0===e||e.destroy(),r.virtualListHelper=null,this._destroyHeaderCells(),r.$table&&r.$table.empty(),r.$tbody&&r.$tbody.empty(),r.workerListeners){for(let e=0;e<r.workerListeners.length;e++){let t=r.workerListeners[e];t.worker.removeEventListener("message",t.listener,!1)}r.workerListeners.length=0}r.rows.length=r.columns.length=0,r._deferredRender&&clearTimeout(r._deferredRender);for(let e in t)On.call(t,e)&&(t[e]=null);return t.__removed=!0,o&&o.remove(),this},Dn.prototype._unbindCellEventsForTable=function(){const e=this.p;if(e.headerRow)for(let t=0,r=e.headerRow.childNodes,o=r.length;t<o;t++)for(let o=0,i=r[t].childNodes,n=i.length;o<n;o++)e._unbindCellHoverIn(i[o]);return this},Dn.prototype._unbindCellEventsForRow=function(e){const t=this.p;for(let r=0,o=e.childNodes,i=o.length;r<i;r++)t._unbindCellHoverIn(o[r]);return this},Dn.prototype.render=function(){const e=this.o,r=this.p;if(!this.el.offsetParent)return r._deferredRender||(r._deferredRender=setTimeout((()=>{r._deferredRender=null,!this.__removed&&this.el.offsetParent&&this.render()}))),this;if(!0===r.tableSkeletonNeedsRendering){var o;r.tableSkeletonNeedsRendering=!1,e.width===Dn.Width.AUTO&&this._clearSortArrows();let i=r.table&&r.table.parentNode?r.table.scrollTop:NaN,n=r.table&&r.table.parentNode?t.getScrollHorz(r.table):NaN;this._renderSkeletonBase()._renderSkeletonBody().tableWidthChanged(!0,!1)._renderSkeletonHeaderCells(),r.virtualListHelper.setCount((null!==(o=r.filteredRows)&&void 0!==o?o:r.rows).length),this._updateVirtualHeight(),this._updateLastCellWidthFromScrollbar(!0),this._updateTableWidth(!0);for(let e=0;e<r.rows.sortColumn.length;e++)this._showSortArrow(r.rows.sortColumn[e].column,r.rows.sortColumn[e].descending);e.adjustColumnWidthForSortArrow&&r.rows.sortColumn.length?this.tableWidthChanged(!0):e.virtualTable||this.tableWidthChanged(),isNaN(i)||(r.table.scrollTop=i),isNaN(n)||(t.setScrollHorz(r.table,n),t.setScrollHorz(r.header,n)),this.trigger("renderskeleton")}return r.virtualListHelper.render(),this.trigger("render"),this},Dn.prototype.clearAndRender=function(e){var t;let r=this.p;return r.tableSkeletonNeedsRendering=!0,null===(t=r.notifyRendererOfColumnsConfig)||void 0===t||t.call(r),(void 0===e||e)&&this.render(),this},Dn.prototype._calculateTbodyWidth=function(){const e=this.p;let t,o,i,n=this.o.tableClassName,l=n+"-row",s=n+"-cell",a=e.visibleColumns,d=a.length,u=Tn("<div>").addClass(l).css("float","left"),h=0;for(o=0;o<d;o++)i=a[o],t=Mn("div"),t.className=s,t.style.width=i.actualWidth+"px",i.cellClasses&&(t.className+=" "+i.cellClasses),t.appendChild(Mn("div")),u.append(t),h+=i.actualWidth;let c=Tn("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",float:"left",width:"1px",overflow:"hidden"}).append(Tn("<div>").addClass(n).append(Tn("<div>").addClass(n+"-body").css("width",h+1e4).append(u)));c.appendTo(document.body);let p=Tn('<div style="border:1.5px solid #000;width:0;height:0;position:absolute;left:0;top:-9999px">').appendTo(document.body),m=parseFloat(p.css("border-width")),f=Math.round(m)!==m;p.remove();let g=r.getElementWidth(u[0],!0,!0,!0);return g-=e.scrollbarWidth||0,f&&g++,c.remove(),g},Dn.prototype.setColumns=function(e,t){const r=this.p;e=e||[];let o=new mn;for(let t=0,r=0;t<e.length;t++){let i=e[t],n=this._initColumnFromData(i);void 0!==i.order?(i.order>r&&(r=i.order+1),n.order=i.order):n.order=r++,o.push(n)}return o.normalizeOrder(),r.columns=o,r.visibleColumns=o.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(t),this},Dn.prototype.addColumn=function(e,t,r){const o=this.p;let i=o.columns;if(e&&!i.get(e.name)){let n=null;void 0!==t&&(n=i.get(t)||i.getByOrder(t));let l=this._initColumnFromData(e);l.order=n?n.order:i.getMaxOrder()+1;for(let e=i.getMaxOrder(),t=l.order;e>=t;e--){let t=i.getByOrder(e);t&&t.order++}i.push(l),i.normalizeOrder(),o.visibleColumns=i.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(r),this.trigger("addcolumn",l.name)}return this},Dn.prototype.removeColumn=function(e,t){const r=this.p;let o=r.columns,i=o.indexOf(e);return i>-1&&(o.splice(i,1),o.normalizeOrder(),r.visibleColumns=o.getVisibleColumns(),this._ensureVisibleColumns().clearAndRender(t),this.trigger("removecolumn",e)),this},Dn.prototype.setCellFormatter=function(e){return e||((e=e=>"string"==typeof e?un(e):e)[zn]=!0),this.o.cellFormatter=e,this},Dn.prototype.setHeaderCellFormatter=function(e){return this.o.headerCellFormatter=e||function(e){return"string"==typeof e?un(e):e},this},Dn.prototype.setFilter=function(e){return this.o.filter=e,this},Dn.prototype.filter=function(e){const t=this.p;let r=this.o.filter||xn;"string"==typeof arguments[0]&&"string"==typeof arguments[1]&&(e={column:arguments[0],keyword:arguments[1],caseSensitive:arguments[2]});let o=!!t.filteredRows;return t.filteredRows&&(t.filteredRows=null),t.filterArgs=null==e?null:"object"!=typeof e||Array.isArray(e)?e:Tn.extend({},e),null!==t.filterArgs?(t.filteredRows=t.rows.filteredCollection(r,t.filterArgs),(o||t.filteredRows)&&(this.clearAndRender(),this.trigger("filter",e))):(t.filterArgs=null,t.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},Dn.prototype.clearFilter=function(){const e=this.p;return e.filteredRows&&(e.filterArgs=null,e.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},Dn.prototype._refilter=function(){const e=this.p;if(e.filteredRows&&e.filterArgs){let t=this.o.filter||xn;e.filteredRows=e.rows.filteredCollection(t,e.filterArgs)}return this},Dn.prototype.setColumnLabel=function(e,t){let r=this.p.columns.get(e);if(r&&(r.label=void 0===t?r.name:t,r.element))for(let e=0;e<r.element[0].firstChild.childNodes.length;e++){let t=r.element[0].firstChild.childNodes[e];if(3===t.nodeType){t.textContent=r.label;break}}return this},Dn.prototype.moveColumn=function(e,t,r=!0){const o=this.o,i=this.p;let n,l,s=i.columns,a=r?i.visibleColumns:s.getColumns();if("string"==typeof e?n=s.get(e):"number"==typeof e&&(n=a[e]),"string"==typeof t?l=s.get(t):"number"==typeof t&&(l=a[t]),n&&l&&e!==t){let e=n.order,t=l.order,r=s.moveColumn(n,l).getVisibleColumns();if(i.visibleColumns.length!==r.length||i.visibleColumns.some(((e,t)=>e!==r[t])))if(i.visibleColumns=r,this._ensureVisibleColumns(),o.virtualTable)this.clearAndRender();else{let r=i.$headerRow.find(">div."+o.tableClassName+"-header-cell"),n=e<t?t+1:t,l=e;r[0].parentNode.insertBefore(r[l],r[n]);let s=i.visibleColumns[e];s=(s.actualWidthConsideringScrollbarWidth||s.actualWidth)+"px";let a=i.visibleColumns[t];a=(a.actualWidthConsideringScrollbarWidth||a.actualWidth)+"px";let d=i.tbody.childNodes;for(let r=0,o=d.length;r<o;r++){let o=d[r];1===o.nodeType&&(o.insertBefore(o.childNodes[l],o.childNodes[n]),o.childNodes[t].firstChild.style.width=a,o.childNodes[e].firstChild.style.width=s)}}this.trigger("movecolumn",n.name,e,t)}return this},Dn.prototype.sort=function(e,t,r){const o=this.o,i=this.p;let n,l=i.columns.get(e),s=i.rows.sortColumn;if(l){if(s.length&&s[s.length-1].column===e&&(t=void 0===t?!s[s.length-1].descending:t),r){for(let e=0;e<s.length;e++)if(s[e].column===l.name){e<s.length-1?s.length=0:s.splice(s.length-1,1);break}(o.sortableColumns>0&&s.length>=o.sortableColumns||s.length>=i.visibleColumns.length)&&(s.length=0)}else s.length=0;t=void 0!==t&&t,s.push({column:l.name,comparePath:l.comparePath||l.dataPath,descending:!!t})}else s.length=0;this._clearSortArrows();for(let e=0;e<s.length;e++)this._showSortArrow(s[e].column,s[e].descending);o.adjustColumnWidthForSortArrow&&!i.tableSkeletonNeedsRendering&&this.tableWidthChanged(!0),i.rows.sortColumn=s,s.length&&(n=i.rows.sort(!!i.filteredRows),i.filteredRows&&i.filteredRows.sort(!!i.filteredRows)),i.virtualListHelper&&i.virtualListHelper.invalidate().render();let a=[];for(let e=0;e<s.length;e++)a.push({column:s[e].column,descending:s[e].descending});return this.trigger("sort",a,!0,n),this},Dn.prototype.resort=function(){const e=this.p;let t=e.columns,r=e.rows.sortColumn;if(r.length){for(let e=0;e<r.length;e++)t.get(r[e].column)||r.splice(e--,1);let o;e.rows.sortColumn=r,r.length&&(o=e.rows.sort(!!e.filteredRows),e.filteredRows&&e.filteredRows.sort(!!e.filteredRows));let i=[];for(let e=0;e<r.length;e++)i.push({column:r[e].column,descending:r[e].descending});this.trigger("sort",i,!1,o)}return this},Dn.prototype._ensureVisibleColumns=function(){const e=this.p;return 0===e.visibleColumns.length&&e.columns.length&&(e.columns[0].visible=!0,e.visibleColumns.push(e.columns[0]),this.trigger("showcolumn",e.columns[0].name)),this},Dn.prototype.setColumnVisible=function(e,t){const r=this.p;let o=r.columns.get(e);return t=!!t,o&&!!o.visible!==t&&(o.visible=t,r.visibleColumns=r.columns.getVisibleColumns(),this.trigger(t?"showcolumn":"hidecolumn",e),this._ensureVisibleColumns(),this.clearAndRender()),this},Dn.prototype.isColumnVisible=function(e){let t=this.p.columns.get(e);return!!t&&t.visible},Dn.prototype.setMinColumnWidth=function(e){let t=this.o;return e=Math.max(e,0),t.minColumnWidth!==e&&(t.minColumnWidth=e,this.tableWidthChanged(!0)),this},Dn.prototype.getMinColumnWidth=function(){return this.o.minColumnWidth},Dn.prototype.setSortableColumns=function(e){const t=this.p,r=this.o;if(r.sortableColumns!==e&&(r.sortableColumns=e,t.$table)){let e=t.$headerRow.find(">div."+r.tableClassName+"-header-cell");for(let o=0;o<e.length;o++)Tn(e[0])[r.sortableColumns>0&&t.visibleColumns[o].sortable?"addClass":"removeClass"]("sortable")}return this},Dn.prototype.getSortableColumns=function(){return this.o.sortableColumns},Dn.prototype.setMovableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.movableColumns!==e&&(t.movableColumns=e),this},Dn.prototype.getMovableColumns=function(){return this.o.movableColumns},Dn.prototype.setResizableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.resizableColumns!==e&&(t.resizableColumns=e),this},Dn.prototype.getResizableColumns=function(){return this.o.resizableColumns},Dn.prototype.setComparatorCallback=function(e){let t=this.o;return t.onComparatorRequired!==e&&(t.onComparatorRequired=e),this},Dn.prototype.setColumnWidth=function(e,t){let r=this.p.columns.get(e),o=this._parseColumnWidth(t,r.ignoreMin?0:this.o.minColumnWidth);if(r){let e=this._serializeColumnWidth(r);r.width=o.width,r.widthMode=o.mode;let t=this._serializeColumnWidth(r);e!==t&&this.tableWidthChanged(!0),this.trigger("columnwidth",r.name,e,t)}return this},Dn.prototype.getColumnWidth=function(e){let t=this.p.columns.get(e);return t?this._serializeColumnWidth(t):null},Dn.prototype.getColumnConfig=function(e){let t=this.p.columns.get(e);return t?{order:t.order,width:this._serializeColumnWidth(t),visible:t.visible,label:t.label}:null},Dn.prototype.getColumnsConfig=function(){const e=this.p;let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r].name]=this.getColumnConfig(e.columns[r].name);return t},Dn.prototype.getSortedColumns=function(){const e=this.p;let t=[];for(let r=0;r<e.rows.sortColumn.length;r++){let o=e.rows.sortColumn[r];t.push({column:o.column,descending:o.descending})}return t},Dn.prototype.getHtmlForRowCell=function(e,t){const r=this.p;if(e<0||e>r.rows.length-1)return null;let o=r.columns.get(t);if(!o)return null;let i=r.rows[e];return this._getHtmlForCell(i,o)},Dn.prototype.getHtmlForRowDataCell=function(e,t){let r=this.p.columns.get(t);return r?this._getHtmlForCell(e,r):null},Dn.prototype._getHtmlForCell=function(e,t){let r=t.dataPath,o=e[r[0]];for(let e=1;e<r.length&&null!=o;e++)o=o&&o[r[e]];const i=this.o.cellFormatter;let n;if(i[zn])n=i(o,t.name,e);else try{n=i(o,t.name,e)}catch(e){n="[ERROR]",console.error("Failed to generate content for cell "+t.name,e)}return null==n&&(n=""),n},Dn.prototype.getRowYPos=function(e){return this.p.virtualListHelper.getItemPosition(e)||null},Dn.prototype.getDataForRow=function(e){const t=this.p;return e<0||e>t.rows.length-1?null:t.rows[e]},Dn.prototype.getRowCount=function(){const e=this.p;return e.rows?e.rows.length:0},Dn.prototype.getIndexForRow=function(e){return this.p.rows.indexOf(e)},Dn.prototype.getFilteredRowCount=function(){const e=this.p;return(e.filteredRows||e.rows).length},Dn.prototype.getIndexForFilteredRow=function(e){const t=this.p;return(t.filteredRows||t.rows).indexOf(e)},Dn.prototype.getDataForFilteredRow=function(e){const t=this.p;return e<0||e>(t.filteredRows||t.rows).length-1?null:(t.filteredRows||t.rows)[e]},Dn.prototype.getHeaderRowElement=function(){return this.p.headerRow},Dn.prototype._horizontalPadding=function(e){return(parseFloat(Tn.css(e,"padding-left"))||0)+(parseFloat(Tn.css(e,"padding-right"))||0)},Dn.prototype._horizontalBorderWidth=function(e){return(parseFloat(Tn.css(e,"border-left"))||0)+(parseFloat(Tn.css(e,"border-right"))||0)},Dn.prototype._calculateWidthAvailableForColumns=function(){const e=this.o,t=this.p;let o,i,n;t.table&&(i=t.table?t.table.scrollTop:0,n=t.table?t.table.scrollLeft:0,e.virtualTable&&(o=t.table.style.display,t.table.style.display="none"));let l=r.getElementWidth(this.$el[0]);t.table&&(e.virtualTable&&(t.table.style.display=o),t.table.scrollTop=i,t.table.scrollLeft=n,t.header.scrollLeft=n);let s=e.tableClassName,a=Tn("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px"}),d=Tn("<div>").addClass(s+"-header").appendTo(a),u=Tn("<div>").addClass(s+"-header-row").appendTo(d);for(let e=0;e<t.visibleColumns.length;e++)u.append(Tn("<div><div></div></div>").addClass(s+"-header-cell").addClass(t.visibleColumns[e].cellClasses||""));a.appendTo(document.body),l-=this._horizontalBorderWidth(u[0]);let h=u.find(">div."+s+"-header-cell");for(let e=0;e<h.length;e++){let t=Tn(h[e]);"border-box"===t.css("boxSizing")||(l-=(parseFloat(t.css("border-right-width"))||0)+(parseFloat(t.css("border-left-width"))||0)+this._horizontalPadding(t[0]))}return a&&a.remove(),Math.max(0,l)},Dn.prototype.tableWidthChanged=function(){let e=function(e){let t,o=this.o.tableClassName,i=Tn("<div>").addClass(this.$el).append(Tn("<div>").addClass(o+"-header").append(Tn("<div>").addClass(o+"-header-row").append(t=Tn("<div>").addClass(o+"-header-cell").append(Tn("<div>").text(e))))).css({position:"absolute",top:"-9999px",visibility:"hidden"});i.appendTo(document.body);let n=r.getElementWidth(t[0]);return i.remove(),n},t=null;return function(r,o){let i=this.o,n=this.p,l=this._calculateWidthAvailableForColumns(),s=l,a=0;if(!n.$table)return this;o=void 0===o||o;let d=0;if(n.tbody||(o=!1),o&&(d=parseFloat(n.tbody.style.minWidth)||0),s!==t||r){var u;t=l;let r=0,h=[],c=0;for(let e=0;e<n.columns.length;e++)n.columns[e].actualWidthConsideringScrollbarWidth=null;for(let t=0;t<n.visibleColumns.length;t++){let o=n.visibleColumns[t];if(o.widthMode===jn.ABSOLUTE){let e=o.width;e+=o.arrowProposedWidth||0,!o.ignoreMin&&e<i.minColumnWidth&&(e=i.minColumnWidth),s-=e,r+=e,e!==o.actualWidth&&(o.actualWidth=e,h.push(t))}else if(o.widthMode===jn.AUTO){let n=e.call(this,o.label)+20;n+=o.arrowProposedWidth||0,!o.ignoreMin&&n<i.minColumnWidth&&(n=i.minColumnWidth),s-=n,r+=n,n!==o.actualWidth&&(o.actualWidth=n,i.convertColumnWidthsToRelative||h.push(t))}else o.widthMode===jn.RELATIVE&&(c+=o.width,a++)}if(i.convertColumnWidthsToRelative)for(let e=0;e<n.visibleColumns.length;e++){let t=n.visibleColumns[e];t.widthMode===jn.AUTO&&(t.widthMode=jn.RELATIVE,s+=t.actualWidth,t.width=t.actualWidth/r,c+=t.width,a++)}if(a&&(c<1&&i.relativeWidthGrowsToFillWidth||c>1&&i.relativeWidthShrinksToFillWidth))for(let e=0;e<n.visibleColumns.length;e++){let t=n.visibleColumns[e];t.widthMode===jn.RELATIVE&&(t.width/=c)}let p=Math.max(0,s);0===p&&(p=n.table.clientWidth);let m=i.minColumnWidth/p;if(isNaN(m)&&(m=0),m>0){let e,t=0;for(let e=0;e<n.visibleColumns.length;e++){let r=n.visibleColumns[e];r.widthMode===jn.RELATIVE&&!r.ignoreMin&&r.width<m&&(t+=m-r.width,r.width=m)}for(let r=0;r<n.visibleColumns.length;r++){let o=n.visibleColumns[r];o.widthMode===jn.RELATIVE&&!o.ignoreMin&&o.width>m&&t>0&&(e=Math.min(t,o.width-m),o.width-=e,t-=e)}}if(i.autoFillTableWidth&&s>0){let e=0,t=s;for(let r=0;r<n.visibleColumns.length;r++){let o=n.visibleColumns[r];o.resizable||o.widthMode!==jn.ABSOLUTE||(e+=o.width),o.widthMode===jn.RELATIVE&&(t-=Math.round(p*o.width))}let r=(l-e)/(l-t-e)||NaN;for(let e=0;e<n.visibleColumns.length&&t>0;e++){let t=n.visibleColumns[e];if(t.resizable||t.widthMode!==jn.ABSOLUTE)if(t.widthMode===jn.RELATIVE)t.width*=r;else{let o=t.actualWidth*r;t.actualWidth!==o&&(t.actualWidth=o,-1===h.indexOf(e)&&h.push(e))}}}for(let e=0;e<n.visibleColumns.length;e++){let t=n.visibleColumns[e];if(t.widthMode===jn.RELATIVE){let r=Math.round(p*t.width);s-=r,a--,0===a&&1===s&&(r++,s--),-1===s&&(r--,s++),r!==t.actualWidth&&(t.actualWidth=r,h.push(e))}}if(n.visibleColumns.length&&(n.visibleColumns[n.visibleColumns.length-1].actualWidthConsideringScrollbarWidth=n.visibleColumns[n.visibleColumns.length-1].actualWidth-(n.scrollbarWidth||0)),null===(u=n.notifyRendererOfColumnsConfig)||void 0===u||u.call(n),o){let e=this._calculateTbodyWidth();d<e&&this._updateTableWidth(!1);for(let e=0;e<h.length;e++)this._resizeColumnElements(h[e]);d>e&&this._updateTableWidth(!1)}}return this}}(),Dn.prototype.tableHeightChanged=function(){let e=this,t=e.o,o=e.p;if(!o.$table)return e;let i=r.getElementHeight(e.$el[0],!0)-(parseFloat(o.$table.css("border-top-width"))||0)-(parseFloat(o.$table.css("border-bottom-width"))||0);return i!==t.height&&(t.height=i,o.tbody&&(o.tbody.style.height=Math.max(t.height-r.getElementHeight(o.$headerRow[0],!0,!0,!0),1)+"px"),t.virtualTable&&e.clearAndRender()),e},Dn.prototype.addRows=function(e,t,r,o){let i=this.p;return"boolean"==typeof t&&(o=r,r=t,t=-1),"number"!=typeof t&&(t=-1),(t<0||t>i.rows.length)&&(t=i.rows.length),o=void 0===o||!!o,e&&(i.rows.add(e,t),i.filteredRows||r&&i.rows.sortColumn.length?(r&&i.rows.sortColumn.length?this.resort():this._refilter(),i.tableSkeletonNeedsRendering=!0,o&&this.render()):o&&(i.virtualListHelper.addItemsAt(e.length,t),this.o.virtualTable?this._updateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(!1):i.tbody&&this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(!0)),this.trigger("addrows",e.length,!1)),this},Dn.prototype.removeRows=function(e,t,r){let o=this.p;return"number"!=typeof t||t<=0||e<0||e>o.rows.length-1||(o.rows.splice(e,t),r=void 0===r||!!r,o.filteredRows?(this._refilter(),o.tableSkeletonNeedsRendering=!0,r&&this.render()):r&&(o.virtualListHelper.removeItemsAt(t,e),this.o.virtualTable?this._updateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(!1):this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(!0))),this},Dn.prototype.removeRow=function(e,t){return this.removeRows(e,1,t)},Dn.prototype.refreshRow=function(e,t=!0){let r=this.p;if(e<0||e>r.rows.length-1)return this;let o=-1;return r.filteredRows&&-1===(o=r.filteredRows.indexOf(r.rows[e]))||(-1===o&&(o=e),r.virtualListHelper.refreshItemAt(o),t&&r.virtualListHelper.render()),this},Dn.prototype.getRowElement=function(e){let t=this.p;if(e<0||e>t.rows.length-1)return null;let r=-1;return t.filteredRows&&-1===(r=t.filteredRows.indexOf(t.rows[e]))?this:(-1===r&&(r=e),t.virtualListHelper.getItemElementAt(r)||null)},Dn.prototype.refreshAllVirtualRows=function(){return this.p.virtualListHelper.invalidate().render(),this},Dn.prototype.setRows=function(e,t){let r=this.p;return r.rows.reset(e),t&&r.rows.sortColumn.length?this.resort():this._refilter(),this.clearAndRender().trigger("addrows",e.length,!0),this},Dn.prototype.getUrlForElementContent=function(e){let t,r=document.getElementById(e);if(r){let e=r.textContent;if("function"==typeof Blob)t=new Blob([e]);else{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(!r)return null;let o=new r;o.append(e),t=o.getBlob()}return(window.URL||window.webkitURL).createObjectURL(t)}return null},Dn.prototype.isWorkerSupported=function(){return window.Worker instanceof Function},Dn.prototype.createWebWorker=function(e,t,r){if(this.isWorkerSupported()){let o=this,i=o.p,n=new Worker(e),l=function(e){e.data.append?o.addRows(e.data.rows,r):o.setRows(e.data.rows,r)};return n.addEventListener("message",l,!1),i.workerListeners||(i.workerListeners=[]),i.workerListeners.push({worker:n,listener:l}),(t||void 0===t)&&n.postMessage(null),n}return null},Dn.prototype.unbindWebWorker=function(e){let t=this.p;if(t.workerListeners)for(let r=0;r<t.workerListeners.length;r++)t.workerListeners[r].worker===e&&(e.removeEventListener("message",t.workerListeners[r].listener,!1),t.workerListeners.splice(r,1),r--);return this},Dn.prototype.abortCellPreview=function(){return this.hideCellPreview(),this},Dn.prototype.cancelColumnResize=function(){const e=this.p;return e.$resizer&&(e.$resizer.remove(),e.$resizer=null,Tn(document).off("mousemove.dgtable",e.onMouseMoveResizeAreaBound).off("mouseup.dgtable",e.onEndDragColumnHeaderBound)),this},Dn.prototype._onTableScrolledHorizontally=function(){const e=this.p;e.header.scrollLeft=e.table.scrollLeft},Dn.prototype._getColumnByResizePosition=function(e){let t=this.o,o=this._isTableRtl(),i=Tn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),n=i[0];n.__cell&&(n=n.__cell,i=Tn(n));let l=i[0].previousSibling;for(;l&&1!==l.nodeType;)l=l.previousSibling;let s=!l,a=((null!=e.pageX?e.pageX:e.originalEvent.pageX)||e.originalEvent.clientX)-i.offset().left;if(o){if(!s&&r.getElementWidth(i[0],!0,!0,!0)-a<=t.resizeAreaWidth/2)return l.columnName;if(a<=t.resizeAreaWidth/2)return n.columnName}else{if(!s&&a<=t.resizeAreaWidth/2)return l.columnName;if(r.getElementWidth(i[0],!0,!0,!0)-a<=t.resizeAreaWidth/2)return n.columnName}return null},Dn.prototype._onTouchStartColumnHeader=function(e){const t=this.p;if(t.currentTouchId)return;let r=e.originalEvent.changedTouches[0];t.currentTouchId=r.identifier;let o,i=Tn(e.currentTarget),n={x:r.pageX,y:r.pageY},l=n,s=function(){t.currentTouchId=null,i.off("touchend").off("touchcancel"),clearTimeout(o)},a=function(t){let r=Tn.Event(t),o=Array.prototype.slice.call(arguments,1);for(let t of["target","clientX","clientY","offsetX","offsetY","screenX","screenY","pageX","pageY","which"]){r[t]=e[t];for(let e=0;e<o.length;e++)null!=o[e][t]&&(r[t]=o[e][t])}return r};i.trigger(a("mousedown",e.originalEvent.changedTouches[0],{which:1,target:e.target})),o=setTimeout((()=>{s(),i.one("touchend",(e=>{Bn(e)||e.preventDefault(),i.off("touchend").off("touchcancel")})).one("touchcancel",(e=>{i.off("touchend").off("touchcancel")})),Math.sqrt(Math.pow(Math.abs(l.x-n.x),2)+Math.pow(Math.abs(l.y-n.y),2))<9&&(this.cancelColumnResize(),i.trigger(a("mouseup",e.originalEvent.changedTouches[0],{which:3,target:e.target})))}),500),i.on("touchend",(e=>{let r=dn(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));r&&(s(),Bn(e)||e.preventDefault(),l={x:r.pageX,y:r.pageY},(Math.sqrt(Math.pow(Math.abs(l.x-n.x),2)+Math.pow(Math.abs(l.y-n.y),2))<9||t.$resizer)&&(i.trigger(a("mouseup",r,{which:1,target:e.target})),i.trigger(a("click",r,{which:1,target:e.target}))))})).on("touchcancel",(()=>{s()})).on("touchmove",(e=>{let r=dn(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));r&&(l={x:r.pageX,y:r.pageY},t.$resizer&&(e.preventDefault(),i.trigger(a("mousemove",r,{target:e.target}))))}))},Dn.prototype._onMouseDownColumnHeader=function(e){if(1!==e.which)return this;let t=this.o,o=this.p,i=this._getColumnByResizePosition(e);if(i){let n=o.columns.get(i);if(!t.resizableColumns||!n||!n.resizable)return!1;let l=this._isTableRtl();o.$resizer&&Tn(o.$resizer).remove(),o.$resizer=Tn("<div></div>").addClass(t.resizerClassName).css({position:"absolute",display:"block","z-index":-1,visibility:"hidden",width:"2px",background:"#000",opacity:.7}).appendTo(this.$el);let s=n.element,a=o.$resizer.parent(),d=s.offset(),u=a.offset();8===Fn&&(d=s.offset()),u.left+=parseFloat(a.css("border-left-width"))||0,u.top+=parseFloat(a.css("border-top-width"))||0,d.left-=u.left,d.top-=u.top,d.top-=parseFloat(s.css("border-top-width"))||0;let h=r.getElementWidth(o.$resizer[0],!0,!0,!0);l?(d.left-=Math.ceil((parseFloat(s.css("border-left-width"))||0)/2),d.left-=Math.ceil(h/2)):(d.left+=r.getElementWidth(s[0],!0,!0,!0),d.left+=Math.ceil((parseFloat(s.css("border-right-width"))||0)/2),d.left-=Math.ceil(h/2)),o.$resizer.css({"z-index":"10",visibility:"visible",left:d.left,top:d.top,height:r.getElementHeight(this.$el[0])})[0].columnName=s[0].columnName;try{o.$resizer[0].style.zIndex=""}catch(e){}Tn(document).on("mousemove.dgtable",o.onMouseMoveResizeAreaBound),Tn(document).on("mouseup.dgtable",o.onEndDragColumnHeaderBound),e.preventDefault()}},Dn.prototype._onMouseMoveColumnHeader=function(e){let t=this.o,r=this.p;if(t.resizableColumns){let o=this._getColumnByResizePosition(e),i=Tn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0];o&&r.columns.get(o).resizable?i.style.cursor="e-resize":i.style.cursor=""}},Dn.prototype._onMouseUpColumnHeader=function(e){if(3===e.which){let t=this.o,o=Tn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),i=o.offset();i.width=r.getElementWidth(o[0],!0,!0,!0),i.height=r.getElementHeight(o[0],!0,!0,!0),this.trigger("headercontextmenu",o[0].columnName,e.pageX,e.pageY,i)}return this},Dn.prototype._onMouseLeaveColumnHeader=function(e){let t=this.o;Tn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0].style.cursor=""},Dn.prototype._onClickColumnHeader=function(e){if(!Bn(e)&&!this._getColumnByResizePosition(e)){let t=this,r=t.o,o=t.p,i=Tn(e.target).closest("div."+r.tableClassName+"-header-cell,div."+r.cellPreviewClassName)[0];if(r.sortableColumns){let e=o.columns.get(i.columnName);e&&e.sortable&&this.sort(i.columnName,void 0,!0).render()}}},Dn.prototype._onStartDragColumnHeader=function(e){let t=this.o,r=this.p;if(t.movableColumns){let o=Tn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),i=r.columns.get(o[0].columnName);i&&i.movable?(o[0].style.opacity=.35,r.dragId=161061273*Math.random(),e.originalEvent.dataTransfer.setData("text",JSON.stringify({dragId:r.dragId,column:i.name}))):e.preventDefault()}else e.preventDefault()},Dn.prototype._onMouseMoveResizeArea=function(e){let t=this.p,o=t.columns.get(t.$resizer[0].columnName),i=this._isTableRtl(),n=o.element,l=t.$resizer.parent(),s=n.offset(),a=l.offset();a.left+=parseFloat(l.css("border-left-width"))||0,s.left-=a.left;let d=r.getElementWidth(t.$resizer[0],!0,!0,!0),u="border-box"===n.css("box-sizing"),h=e.pageX-a.left,c=s.left;c-=Math.ceil(d/2),i?(c+=r.getElementWidth(n[0],!0,!0,!0),c-=o.ignoreMin?0:this.o.minColumnWidth,u||(c-=Math.ceil((parseFloat(n.css("border-left-width"))||0)/2),c-=this._horizontalPadding(n[0])),h>c&&(h=c)):(c+=o.ignoreMin?0:this.o.minColumnWidth,u||(c+=Math.ceil((parseFloat(n.css("border-right-width"))||0)/2),c+=this._horizontalPadding(n[0])),h<c&&(h=c)),t.$resizer.css("left",h+"px")},Dn.prototype._onEndDragColumnHeader=function(e){let t=this.o,o=this.p;if(o.$resizer){Tn(document).off("mousemove.dgtable",o.onMouseMoveResizeAreaBound).off("mouseup.dgtable",o.onEndDragColumnHeaderBound);let i=o.columns.get(o.$resizer[0].columnName),n=this._isTableRtl(),l=i.element,s=o.$resizer.parent(),a=l.offset(),d=s.offset();d.left+=parseFloat(s.css("border-left-width"))||0,a.left-=d.left;let u=r.getElementWidth(o.$resizer[0],!0,!0,!0),h="border-box"===l.css("box-sizing"),c=e.pageX-d.left,p=a.left,m=a.left,f=0;p-=Math.ceil(u/2),n?(h||(c+=this._horizontalPadding(l[0]),c+=parseFloat(l.css("border-left-width"))||0,c+=parseFloat(l.css("border-right-width"))||0),p+=r.getElementWidth(l[0],!0,!0,!0),m=p-(i.ignoreMin?0:this.o.minColumnWidth),c>m&&(c=m),f=p-c):(h||(c-=this._horizontalPadding(l[0]),c-=parseFloat(l.css("border-left-width"))||0,c-=parseFloat(l.css("border-right-width"))||0),m=p+(i.ignoreMin?0:this.o.minColumnWidth),c<m&&(c=m),f=c-p),o.$resizer.remove(),o.$resizer=null;let g=f;if(i.widthMode===jn.RELATIVE){let e=this._calculateWidthAvailableForColumns(),r=0,n=0;for(let t=0;t<o.visibleColumns.length;t++){let l=o.visibleColumns[t];l.name!==i.name&&(l.widthMode===jn.RELATIVE?(r+=l.width,n++):e-=l.actualWidth)}if(e=Math.max(1,e),g=f/e,n>0){let e=g/((1-g)/r);r+=g,(r<1&&t.relativeWidthGrowsToFillWidth||r>1&&t.relativeWidthShrinksToFillWidth)&&(g=e)}g*=100,g+="%"}this.setColumnWidth(i.name,g)}else e.target.style.opacity=null},Dn.prototype._onDragEnterColumnHeader=function(e){let t=this.o,r=this.p;if(t.movableColumns){let o=e.originalEvent.dataTransfer.getData("text");o=o?JSON.parse(o):null;let i=Tn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);if(!o||r.dragId===o.dragId&&i.columnName!==o.column){let e=r.columns.get(i[0].columnName);e&&(e.movable||e!==r.visibleColumns[0])&&Tn(i).addClass("drag-over")}}},Dn.prototype._onDragOverColumnHeader=function(e){e.preventDefault()},Dn.prototype._onDragLeaveColumnHeader=function(e){let t=this.o,r=Tn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);Tn(r[0].firstChild).has(e.originalEvent.relatedTarget).length||r.removeClass("drag-over")},Dn.prototype._onDropColumnHeader=function(e){e.preventDefault();let t=this.o,r=this.p,o=JSON.parse(e.originalEvent.dataTransfer.getData("text")),i=Tn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);if(t.movableColumns&&o.dragId===r.dragId){let e=o.column,t=i[0].columnName,n=r.columns.get(e),l=r.columns.get(t);n&&l&&n.movable&&(l.movable||l!==r.visibleColumns[0])&&this.moveColumn(e,t)}Tn(i).removeClass("drag-over")},Dn.prototype._clearSortArrows=function(){let e=this.p;if(e.$table){let t=this.o.tableClassName,r=e.$headerRow.find(">div."+t+"-header-cell.sorted"),o=r.find(">div>.sort-arrow");o.each(((t,r)=>{let o=e.columns.get(r.parentNode.parentNode.columnName);o&&(o.arrowProposedWidth=0)})),o.remove(),r.removeClass("sorted").removeClass("desc")}return this},Dn.prototype._showSortArrow=function(e,t){let r=this.p.columns.get(e);if(!r)return!1;let o=Mn("span");return o.className="sort-arrow",r.element&&(r.element.addClass(t?"sorted desc":"sorted"),r.element[0].firstChild.insertBefore(o,r.element[0].firstChild.firstChild)),r.widthMode!==jn.RELATIVE&&this.o.adjustColumnWidthForSortArrow&&(r.arrowProposedWidth=o.scrollWidth+(parseFloat(Tn(o).css("margin-right"))||0)+(parseFloat(Tn(o).css("margin-left"))||0)),this},Dn.prototype._resizeColumnElements=function(e){let t=this.p,r=t.$headerRow.find("div."+this.o.tableClassName+"-header-cell"),o=t.columns.get(r[e].columnName);if(o){r[e].style.width=(o.actualWidthConsideringScrollbarWidth||o.actualWidth)+"px";let i=(o.actualWidthConsideringScrollbarWidth||o.actualWidth)+"px",n=t.tbody.childNodes;for(let t=0,r=n.length;t<r;t++){let r=n[t];1===r.nodeType&&(r.childNodes[e].style.width=i)}}return this},Dn.prototype._destroyHeaderCells=function(){let e=this.o,t=this.p;return t.$headerRow&&(this.trigger("headerrowdestroy",t.headerRow),t.$headerRow.find("div."+e.tableClassName+"-header-cell").remove(),t.$headerRow=null,t.headerRow=null),this},Dn.prototype._renderSkeletonBase=function(){var e;let t=this,o=t.p,i=t.o;null===(e=o.virtualListHelper)||void 0===e||e.destroy(),o.virtualListHelper=null,o.$table&&i.virtualTable&&(o.$table.remove(),o.$table=o.table=o.$tbody=o.tbody=null),t._destroyHeaderCells(),o.currentTouchId=null,o.$header&&o.$header.remove();let n=i.tableClassName,l=Mn("div"),s=Tn(l),a=Mn("div"),d=Tn(a);return l.className=n+"-header",a.className=n+"-header-row",o.$header=s,o.header=l,o.$headerRow=d,o.headerRow=a,d.appendTo(o.$header),s.prependTo(this.$el),Vn(t.$el),i.width===Dn.Width.SCROLL?this.el.style.overflow="hidden":this.el.style.overflow="",!i.height&&i.virtualTable&&(i.height=r.getElementHeight(this.$el[0],!0)),this},Dn.prototype._renderSkeletonHeaderCells=function(){let e,t=this,r=t.p,o=t.o,i=o.allowCellPreview,n=o.allowHeaderCellPreview,l=o.tableClassName+"-header-cell",s=r.headerRow;An&&(e=function(e){return e.preventDefault(),this.dragDrop(),!1});let a=function(e){e.preventDefault()};for(let d=0;d<r.visibleColumns.length;d++){let u=r.visibleColumns[d];if(u.visible){let h=Mn("div"),c=Tn(h);h.draggable=!0,h.className=l,h.style.width=u.actualWidth+"px",o.sortableColumns&&u.sortable&&(h.className+=" sortable"),h.columnName=u.name,h.setAttribute("data-column",u.name);let p=Mn("div");p.innerHTML=o.headerCellFormatter(u.label,u.name),h.appendChild(p),i&&n&&r._bindCellHoverIn(h),s.appendChild(h),r.visibleColumns[d].element=c,c.on("mousedown.dgtable",t._onMouseDownColumnHeader.bind(t)).on("mousemove.dgtable",t._onMouseMoveColumnHeader.bind(t)).on("mouseup.dgtable",t._onMouseUpColumnHeader.bind(t)).on("mouseleave.dgtable",t._onMouseLeaveColumnHeader.bind(t)).on("touchstart.dgtable",t._onTouchStartColumnHeader.bind(t)).on("dragstart.dgtable",t._onStartDragColumnHeader.bind(t)).on("click.dgtable",t._onClickColumnHeader.bind(t)).on("contextmenu.dgtable",a),Tn(p).on("dragenter.dgtable",t._onDragEnterColumnHeader.bind(t)).on("dragover.dgtable",t._onDragOverColumnHeader.bind(t)).on("dragleave.dgtable",t._onDragLeaveColumnHeader.bind(t)).on("drop.dgtable",t._onDropColumnHeader.bind(t)),An&&c.on("selectstart.dgtable",e.bind(h)),c.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"})}}return this.trigger("headerrowcreate",s),this},Dn.prototype._renderSkeletonBody=function(){let e=this,t=e.p,o=e.o,i=o.tableClassName;if(o.virtualTable&&!t.virtualRowHeight){let o,n=function(){let e=Mn("div"),t=e.appendChild(Mn("div")),r=t.appendChild(Mn("div"));return e.className=i+"-row",t.className=i+"-cell",r.innerHTML="0",e.style.visibility="hidden",e.style.position="absolute",e},l=Tn("<div>").addClass(e.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",width:"1px",overflow:"hidden"}).append(Tn("<div>").addClass(i).append(o=Tn("<div>").addClass(i+"-body").css("width",99999)));l.appendTo(document.body);let s=n(),a=n(),d=n();o.append(s,a,d),t.virtualRowHeightFirst=r.getElementHeight(s,!0,!0,!0),t.virtualRowHeight=r.getElementHeight(a,!0,!0,!0),t.virtualRowHeightLast=r.getElementHeight(d,!0,!0,!0),l.remove()}if(!t.$table){let n=document.createDocumentFragment(),l=Mn("div"),s=Tn(l);l.className=i,o.virtualTable&&(l.className+=" virtual");let a=o.height-r.getElementHeight(t.$headerRow[0],!0,!0,!0);"border-box"!==s.css("box-sizing")&&(a-=parseFloat(s.css("border-top-width"))||0,a-=parseFloat(s.css("border-bottom-width"))||0,a-=parseFloat(s.css("padding-top"))||0,a-=parseFloat(s.css("padding-bottom"))||0),t.visibleHeight=a,l.style.height=o.height?a+"px":"auto",l.style.display="block",l.style.overflowY="auto",l.style.overflowX=o.width===Dn.Width.SCROLL?"auto":"hidden",n.appendChild(l);let d=Mn("div"),u=Tn(d);d.className=o.tableClassName+"-body",d.style.minHeight="1px",t.table=l,t.tbody=d,t.$table=s,t.$tbody=u,Vn(u),Vn(s),l.appendChild(d),e.el.appendChild(n),this._setupVirtualTable()}return this},Dn.prototype._renderSkeleton=function(){return this},Dn.prototype._updateVirtualHeight=function(){const e=this.o,t=this.p;if(!t.tbody)return this;if(e.virtualTable){const e=t.virtualListHelper.estimateFullHeight();t.lastVirtualScrollHeight=e,t.tbody.style.height=e+"px"}else t.tbody.style.height="";return this},Dn.prototype._updateLastCellWidthFromScrollbar=function(e){const t=this.p;let r=t.table.offsetWidth-t.table.clientWidth;if(r!==t.scrollbarWidth||e){var o;t.scrollbarWidth=r;for(let e=0;e<t.columns.length;e++)t.columns[e].actualWidthConsideringScrollbarWidth=null;if(t.scrollbarWidth>0&&t.visibleColumns.length>0){let e=t.visibleColumns.length-1;t.visibleColumns[e].actualWidthConsideringScrollbarWidth=t.visibleColumns[e].actualWidth-t.scrollbarWidth;let r=t.visibleColumns[e].actualWidthConsideringScrollbarWidth+"px",o=t.tbody.childNodes;for(let t=0,i=o.length;t<i;t++){let i=o[t];1===i.nodeType&&(i.childNodes[e].style.width=r)}t.headerRow.childNodes[e].style.width=r}null===(o=t.notifyRendererOfColumnsConfig)||void 0===o||o.call(t)}return this},Dn.prototype._updateTableWidth=function(e){const t=this.o,o=this.p;let i=this._calculateTbodyWidth();if(o.tbody.style.minWidth=i+"px",o.headerRow.style.minWidth=i+(o.scrollbarWidth||0)+"px",o.$table.off("scroll",o.onTableScrolledHorizontallyBound),t.width===Dn.Width.AUTO)r.setElementWidth(o.$table[0],r.getElementWidth(o.tbody,!0,!0,!0)),r.setElementWidth(this.$el[0],r.getElementWidth(o.$table[0],!0,!0,!0));else if(t.width===Dn.Width.SCROLL){if(e){let e=o.table?o.table.scrollTop:0,t=o.table?o.table.scrollLeft:0;!function(e){let t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}(this.el),o.table.scrollTop=e,o.table.scrollLeft=t,o.header.scrollLeft=t}o.$table.on("scroll",o.onTableScrolledHorizontallyBound)}return this},Dn.prototype._isTableRtl=function(){return"rtl"===this.p.$table.css("direction")},Dn.prototype._serializeColumnWidth=function(e){return e.widthMode===jn.AUTO?"auto":e.widthMode===jn.RELATIVE?100*e.width+"%":e.width},Dn.prototype._cellMouseOverEvent=function(e){const t=this.o,o=this.p;let i=e.firstChild;if(i.scrollWidth-i.clientWidth>1||i.scrollHeight-i.clientHeight>1){this.hideCellPreview(),o.abortCellPreview=!1;let n=Tn(e),l=Tn(i);const s=e.parentNode;let a=Mn("div"),d=Tn(a);a.innerHTML=e.innerHTML,a.className=t.cellPreviewClassName;let u=n.hasClass(t.tableClassName+"-header-cell");u&&(a.className+=" header",n.hasClass("sortable")&&(a.className+=" sortable"),a.draggable=!0,Tn(a).on("mousedown",this._onMouseDownColumnHeader.bind(this)).on("mousemove",this._onMouseMoveColumnHeader.bind(this)).on("mouseup",this._onMouseUpColumnHeader.bind(this)).on("mouseleave",this._onMouseLeaveColumnHeader.bind(this)).on("touchstart",this._onTouchStartColumnHeader.bind(this)).on("dragstart",this._onStartDragColumnHeader.bind(this)).on("click",this._onClickColumnHeader.bind(this)).on("contextmenu.dgtable",(function(e){e.preventDefault()})),Tn(a.firstChild).on("dragenter",this._onDragEnterColumnHeader.bind(this)).on("dragover",this._onDragOverColumnHeader.bind(this)).on("dragleave",this._onDragLeaveColumnHeader.bind(this)).on("drop",this._onDropColumnHeader.bind(this)),An&&Tn(a).on("selectstart",function(e){return e.preventDefault(),this.dragDrop(),!1}.bind(a)));let h=parseFloat(n.css("padding-left"))||0,c=parseFloat(n.css("padding-right"))||0,p=parseFloat(n.css("padding-top"))||0,m=parseFloat(n.css("padding-bottom"))||0,f=i.scrollWidth+(e.clientWidth-i.offsetWidth),g="border-box"===n.css("box-sizing");if(g?d.css("box-sizing","border-box"):(f-=h+c,d.css("margin-top",parseFloat(Tn(e).css("border-top-width"))||0)),!o.transparentBgColor1){let e=document.createElement("div");e.style.backgroundColor="transparent",o.transparentBgColor1=Tn(e).css("background-color"),e.style.backgroundColor="rgba(0,0,0,0)",o.transparentBgColor2=Tn(e).css("background-color")}let v={"box-sizing":g?"border-box":"content-box",width:f,"min-height":r.getElementHeight(n[0]),"padding-left":h,"padding-right":c,"padding-top":p,"padding-bottom":m,overflow:"hidden",position:"absolute","z-index":"-1",left:"0",top:"0",cursor:n.css("cursor")};if(v){let t=Tn(e).css("background-color");t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t=Tn(s).css("background-color")),t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t="#fff"),v["background-color"]=t}d.css(v),this.el.appendChild(a),Tn(a.firstChild).css({direction:l.css("direction"),"white-space":l.css("white-space")}),u&&d.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-o-user-select":"none","user-select":"none"}),a.rowIndex=s.rowIndex;let b=a.physicalRowIndex=s.physicalRowIndex;a.columnName=o.visibleColumns[Nn.call(s.childNodes,e)].name;try{let t=fn.saveSelection(e);t&&fn.restoreSelection(a,t)}catch(e){}if(this.trigger("cellpreview",a.firstChild,null==b?null:b,a.columnName,null==b?null:o.rows[b],e),o.abortCellPreview)return void d.remove();null!=b&&a.addEventListener("click",(e=>{this.trigger("rowclick",e,s.rowIndex,b,s,o.rows[b])}));let C=this.$el,y=C[0]===window?Tn(document):C,w=n.offset(),_=C.offset(),E="right"===n.css("float"),W=E?"right":"left";if(E){let e=Tn(window).width();w.right=e-(w.left+r.getElementWidth(n[0],!0,!0,!0)),_.right=e-(_.left+r.getElementWidth(C[0],!0,!0,!0))}w.left-=parseFloat(C.css("border-left-width"))||0,w.right-=parseFloat(C.css("border-right-width"))||0,w.top-=parseFloat(C.css("border-top-width"))||0,w[W]+=parseFloat(Tn(e).css("border-"+W+"-width"))||0,w.top+=parseFloat(Tn(e).css("border-top-width"))||parseFloat(Tn(e).css("border-bottom-width"))||0,w.left-=_.left,w.right-=_.right,w.top-=_.top;let I=0,R=C-r.getElementWidth(d[0],!0,!0,!0);w[W]=w[W]<I?I:w[W]>R?R:w[W];let S=r.getElementHeight(n[0],!0,!0,!0),H=y.scrollTop()+r.getElementHeight(C[0],!0)-S;w.top>H&&(w.top=Math.max(0,H));let x={top:w.top,"z-index":9999};x[W]=w[W],d.css(x),a.__cell=e,o.$cellPreviewCell=d,e.__previewCell=a,o._bindCellHoverOut(e),o._bindCellHoverOut(a),d.on("wheel",(()=>{this.hideCellPreview()}))}},Dn.prototype._cellMouseOutEvent=function(e){this.hideCellPreview()},Dn.prototype.hideCellPreview=function(){const e=this.p;if(e.$cellPreviewCell){let t,r=e.$cellPreviewCell[0],o=r.__cell;try{t=fn.saveSelection(r)}catch(e){}e.$cellPreviewCell.remove(),e._unbindCellHoverOut(o),e._unbindCellHoverOut(r);try{t&&fn.restoreSelection(o,t)}catch(e){}this.trigger("cellpreviewdestroy",r.firstChild,r.physicalRowIndex,r.columnName,o),o.__previewCell=null,r.__cell=null,e.$cellPreviewCell=null,e.abortCellPreview=!1}else e.abortCellPreview=!0;return this};const jn={AUTO:0,ABSOLUTE:1,RELATIVE:2};Dn.Width={NONE:"none",AUTO:"auto",SCROLL:"scroll"},Tn.controls||(Tn.controls={}),Tn.controls.dgtable=Dn,module.exports=Dn;
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=jquery.dgtable.cjs.min.js.map
|