jquery.dgtable 0.6.5 → 0.6.6

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.
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * jquery.dgtable 0.6.5
2
+ * jquery.dgtable 0.6.6
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=x,N=W,T=function(e){if("Function"===H(e))return N(e)},P=s,F=x,A=Object,M=T("".split),O=P((function(){return!A("z").propertyIsEnumerable(0)}))?function(e){return"String"==F(e)?M(e,""):A(e)}:A,z=function(e){return null==e},k=z,L=TypeError,$=function(e){if(k(e))throw L("Can't call method on "+e);return e},B=O,V=$,D=function(e){return B(V(e))},j="object"==typeof document&&document.all,U={all:j,IS_HTMLDDA:void 0===j&&void 0!==j},q=U.all,X=U.IS_HTMLDDA?function(e){return"function"==typeof e||e===q}:function(e){return"function"==typeof e},Y=X,G=U.all,J=U.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:Y(e)||e===G}:function(e){return"object"==typeof e?null!==e:Y(e)},K=n,Q=X,Z=function(e){return Q(e)?e:void 0},ee=function(e,t){return arguments.length<2?Z(K[e]):K[e]&&K[e][t]},te=T({}.isPrototypeOf),re=ee("navigator","userAgent")||"",oe=n,ie=re,ne=oe.process,le=oe.Deno,se=ne&&ne.versions||le&&le.version,ae=se&&se.v8;ae&&(v=(b=ae.split("."))[0]>0&&b[0]<4?1:+(b[0]+b[1])),!v&&ie&&(!(b=ie.match(/Edge\/(\d+)/))||b[1]>=74)&&(b=ie.match(/Chrome\/(\d+)/))&&(v=+b[1]);var de=v,ue=de,he=s,ce=!!Object.getOwnPropertySymbols&&!he((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ue&&ue<41})),pe=ce&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,me=ee,fe=X,ge=te,be=Object,ve=pe?function(e){return"symbol"==typeof e}:function(e){var t=me("Symbol");return fe(t)&&ge(t.prototype,be(e))},Ce=String,ye=function(e){try{return Ce(e)}catch(e){return"Object"}},we=X,_e=ye,Ee=TypeError,We=function(e){if(we(e))return e;throw Ee(_e(e)+" is not a function")},Ie=We,Re=z,Se=c,xe=X,He=J,Ne=TypeError,Te={exports:{}},Pe=n,Fe=Object.defineProperty,Ae=function(e,t){try{Fe(Pe,e,{value:t,configurable:!0,writable:!0})}catch(r){Pe[e]=t}return t},Me=Ae,Oe=n["__core-js_shared__"]||Me("__core-js_shared__",{}),ze=Oe;(Te.exports=function(e,t){return ze[e]||(ze[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"});var ke=$,Le=Object,$e=function(e){return Le(ke(e))},Be=$e,Ve=T({}.hasOwnProperty),De=Object.hasOwn||function(e,t){return Ve(Be(e),t)},je=T,Ue=0,qe=Math.random(),Xe=je(1..toString),Ye=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Xe(++Ue+qe,36)},Ge=n,Je=Te.exports,Ke=De,Qe=Ye,Ze=ce,et=pe,tt=Je("wks"),rt=Ge.Symbol,ot=rt&&rt.for,it=et?rt:rt&&rt.withoutSetter||Qe,nt=function(e){if(!Ke(tt,e)||!Ze&&"string"!=typeof tt[e]){var t="Symbol."+e;Ze&&Ke(rt,e)?tt[e]=rt[e]:tt[e]=et&&ot?ot(t):it(t)}return tt[e]},lt=c,st=J,at=ve,dt=TypeError,ut=nt("toPrimitive"),ht=function(e,t){if(!st(e)||at(e))return e;var r,o,i=(o=e[ut],Re(o)?void 0:Ie(o));if(i){if(void 0===t&&(t="default"),r=lt(i,e,t),!st(r)||at(r))return r;throw dt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,o;if("string"===t&&xe(r=e.toString)&&!He(o=Se(r,e)))return o;if(xe(r=e.valueOf)&&!He(o=Se(r,e)))return o;if("string"!==t&&xe(r=e.toString)&&!He(o=Se(r,e)))return o;throw Ne("Can't convert object to primitive value")}(e,t)},ct=ve,pt=function(e){var t=ht(e,"string");return ct(t)?t:t+""},mt=J,ft=n.document,gt=mt(ft)&&mt(ft.createElement),bt=!a&&!s((function(){return 7!=Object.defineProperty((e="div",gt?ft.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),vt=a,Ct=c,yt=p,wt=C,_t=D,Et=pt,Wt=De,It=bt,Rt=Object.getOwnPropertyDescriptor;l.f=vt?Rt:function(e,t){if(e=_t(e),t=Et(t),It)try{return Rt(e,t)}catch(e){}if(Wt(e,t))return wt(!Ct(yt.f,e,t),e[t])};var St={},xt=a&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ht=J,Nt=String,Tt=TypeError,Pt=function(e){if(Ht(e))return e;throw Tt(Nt(e)+" is not an object")},Ft=a,At=bt,Mt=xt,Ot=Pt,zt=pt,kt=TypeError,Lt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor;St.f=Ft?Mt?function(e,t,r){if(Ot(e),t=zt(t),Ot(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var o=$t(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 Lt(e,t,r)}:Lt:function(e,t,r){if(Ot(e),t=zt(t),Ot(r),At)try{return Lt(e,t,r)}catch(e){}if("get"in r||"set"in r)throw kt("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Bt=St,Vt=C,Dt=a?function(e,t,r){return Bt.f(e,t,Vt(1,r))}:function(e,t,r){return e[t]=r,e},jt={exports:{}},Ut=a,qt=De,Xt=Function.prototype,Yt=Ut&&Object.getOwnPropertyDescriptor,Gt=qt(Xt,"name"),Jt={EXISTS:Gt,PROPER:Gt&&"something"===function(){}.name,CONFIGURABLE:Gt&&(!Ut||Ut&&Yt(Xt,"name").configurable)},Kt=X,Qt=Oe,Zt=T(Function.toString);Kt(Qt.inspectSource)||(Qt.inspectSource=function(e){return Zt(e)});var er,tr,rr,or,ir=Qt.inspectSource,nr=X,lr=n.WeakMap,sr=nr(lr)&&/native code/.test(String(lr)),ar=Te.exports,dr=Ye,ur=ar("keys"),hr={},cr=sr,pr=n,mr=J,fr=Dt,gr=De,br=Oe,vr=hr,Cr=pr.TypeError,yr=pr.WeakMap;if(cr||br.state){var wr=br.state||(br.state=new yr);wr.get=wr.get,wr.has=wr.has,wr.set=wr.set,er=function(e,t){if(wr.has(e))throw Cr("Object already initialized");return t.facade=e,wr.set(e,t),t},tr=function(e){return wr.get(e)||{}},rr=function(e){return wr.has(e)}}else{var _r=ur[or="state"]||(ur[or]=dr(or));vr[_r]=!0,er=function(e,t){if(gr(e,_r))throw Cr("Object already initialized");return t.facade=e,fr(e,_r,t),t},tr=function(e){return gr(e,_r)?e[_r]:{}},rr=function(e){return gr(e,_r)}}var Er={set:er,get:tr,has:rr,enforce:function(e){return rr(e)?tr(e):er(e,{})},getterFor:function(e){return function(t){var r;if(!mr(t)||(r=tr(t)).type!==e)throw Cr("Incompatible receiver, "+e+" required");return r}}},Wr=s,Ir=X,Rr=De,Sr=a,xr=Jt.CONFIGURABLE,Hr=ir,Nr=Er.enforce,Tr=Er.get,Pr=Object.defineProperty,Fr=Sr&&!Wr((function(){return 8!==Pr((function(){}),"length",{value:8}).length})),Ar=String(String).split("String"),Mr=jt.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),(!Rr(e,"name")||xr&&e.name!==t)&&(Sr?Pr(e,"name",{value:t,configurable:!0}):e.name=t),Fr&&r&&Rr(r,"arity")&&e.length!==r.arity&&Pr(e,"length",{value:r.arity});try{r&&Rr(r,"constructor")&&r.constructor?Sr&&Pr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var o=Nr(e);return Rr(o,"source")||(o.source=Ar.join("string"==typeof t?t:"")),e};Function.prototype.toString=Mr((function(){return Ir(this)&&Tr(this).source||Hr(this)}),"toString");var Or=X,zr=St,kr=jt.exports,Lr=Ae,$r={},Br=Math.ceil,Vr=Math.floor,Dr=Math.trunc||function(e){var t=+e;return(t>0?Vr:Br)(t)},jr=function(e){var t=+e;return t!=t||0===t?0:Dr(t)},Ur=jr,qr=Math.max,Xr=Math.min,Yr=function(e,t){var r=Ur(e);return r<0?qr(r+t,0):Xr(r,t)},Gr=jr,Jr=Math.min,Kr=function(e){return(t=e.length)>0?Jr(Gr(t),9007199254740991):0;var t},Qr=D,Zr=Yr,eo=Kr,to=function(e){return function(t,r,o){var i,n=Qr(t),l=eo(n),s=Zr(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}},ro={includes:to(!0),indexOf:to(!1)},oo=De,io=D,no=ro.indexOf,lo=hr,so=T([].push),ao=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");$r.f=Object.getOwnPropertyNames||function(e){return function(e,t){var r,o=io(e),i=0,n=[];for(r in o)!oo(lo,r)&&oo(o,r)&&so(n,r);for(;t.length>i;)oo(o,r=t[i++])&&(~no(n,r)||so(n,r));return n}(e,ao)};var uo={};uo.f=Object.getOwnPropertySymbols;var ho=ee,co=$r,po=uo,mo=Pt,fo=T([].concat),go=ho("Reflect","ownKeys")||function(e){var t=co.f(mo(e)),r=po.f;return r?fo(t,r(e)):t},bo=De,vo=go,Co=l,yo=St,wo=function(e,t,r){for(var o=vo(t),i=yo.f,n=Co.f,l=0;l<o.length;l++){var s=o[l];bo(e,s)||r&&bo(r,s)||i(e,s,n(t,s))}},_o=s,Eo=X,Wo=/#|\.prototype\./,Io=function(e,t){var r=So[Ro(e)];return r==Ho||r!=xo&&(Eo(t)?_o(t):!!t)},Ro=Io.normalize=function(e){return String(e).replace(Wo,".").toLowerCase()},So=Io.data={},xo=Io.NATIVE="N",Ho=Io.POLYFILL="P",No=Io,To=n,Po=l.f,Fo=Dt,Ao=function(e,t,r,o){o||(o={});var i=o.enumerable,n=void 0!==o.name?o.name:t;if(Or(r)&&kr(r,n,o),o.global)i?e[t]=r:Lr(t,r);else{try{o.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:zr.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e},Mo=Ae,Oo=wo,zo=No,ko=function(e,t){var r,o,i,n,l,s=e.target,a=e.global,d=e.stat;if(r=a?To:d?To[s]||Mo(s,{}):(To[s]||{}).prototype)for(o in t){if(n=t[o],i=e.dontCallGetSet?(l=Po(r,o))&&l.value:r[o],!zo(a?o:s+(d?".":"#")+o,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;Oo(n,i)}(e.sham||i&&i.sham)&&Fo(n,"sham",!0),Ao(r,o,n,e)}},Lo={};Lo[nt("toStringTag")]="z";var $o="[object z]"===String(Lo),Bo=X,Vo=x,Do=nt("toStringTag"),jo=Object,Uo="Arguments"==Vo(function(){return arguments}()),qo=$o?Vo: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=jo(e),Do))?r:Uo?Vo(t):"Object"==(o=Vo(t))&&Bo(t.callee)?"Arguments":o},Xo=String,Yo=function(e){if("Symbol"===qo(e))throw TypeError("Cannot convert a Symbol value to a string");return Xo(e)},Go=ko,Jo=a,Ko=n,Qo=T,Zo=De,ei=X,ti=te,ri=Yo,oi=St.f,ii=wo,ni=Ko.Symbol,li=ni&&ni.prototype;if(Jo&&ei(ni)&&(!("description"in li)||void 0!==ni().description)){var si={},ai=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:ri(arguments[0]),t=ti(li,this)?new ni(e):void 0===e?ni():ni(e);return""===e&&(si[t]=!0),t};ii(ai,ni),ai.prototype=li,li.constructor=ai;var di="Symbol(test)"==String(ni("test")),ui=Qo(li.valueOf),hi=Qo(li.toString),ci=/^Symbol\((.*)\)[^)]+$/,pi=Qo("".replace),mi=Qo("".slice);oi(li,"description",{configurable:!0,get:function(){var e=ui(this);if(Zo(si,e))return"";var t=hi(e),r=di?mi(t,7,-1):pi(t,ci,"$1");return""===r?void 0:r}}),Go({global:!0,constructor:!0,forced:!0},{Symbol:ai})}var fi,gi,bi=ye,vi=TypeError,Ci=pt,yi=St,wi=C,_i=Yr,Ei=Kr,Wi=function(e,t,r){var o=Ci(t);o in e?yi.f(e,o,wi(0,r)):e[o]=r},Ii=Array,Ri=Math.max,Si=function(e,t,r){for(var o=Ei(e),i=_i(t,o),n=_i(void 0===r?o:r,o),l=Ii(Ri(n-i,0)),s=0;i<n;i++,s++)Wi(l,s,e[i]);return l.length=s,l},xi=Math.floor,Hi=function(e,t){var r=e.length,o=xi(r/2);return r<8?Ni(e,t):Ti(e,Hi(Si(e,0,o),t),Hi(Si(e,o),t),t)},Ni=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},Ti=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},Pi=Hi,Fi=s,Ai=re.match(/firefox\/(\d+)/i),Mi=!!Ai&&+Ai[1],Oi=/MSIE|Trident/.test(re),zi=re.match(/AppleWebKit\/(\d+)\./),ki=!!zi&&+zi[1],Li=ko,$i=T,Bi=We,Vi=$e,Di=Kr,ji=function(e,t){if(!delete e[t])throw vi("Cannot delete property "+bi(t)+" of "+bi(e))},Ui=Yo,qi=s,Xi=Pi,Yi=Mi,Gi=Oi,Ji=de,Ki=ki,Qi=[],Zi=$i(Qi.sort),en=$i(Qi.push),tn=qi((function(){Qi.sort(void 0)})),rn=qi((function(){Qi.sort(null)})),on=!!(gi=[]["sort"])&&Fi((function(){gi.call(null,fi||function(){return 1},1)})),nn=!qi((function(){if(Ji)return Ji<70;if(!(Yi&&Yi>3)){if(Gi)return!0;if(Ki)return Ki<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++)Qi.push({k:t+o,v:r})}for(Qi.sort((function(e,t){return t.v-e.v})),o=0;o<Qi.length;o++)t=Qi[o].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));Li({target:"Array",proto:!0,forced:tn||!rn||!on||!nn},{sort:function(e){void 0!==e&&Bi(e);var t=Vi(this);if(nn)return void 0===e?Zi(t):Zi(t,e);var r,o,i=[],n=Di(t);for(o=0;o<n;o++)o in t&&en(i,t[o]);for(Xi(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:Ui(t)>Ui(r)?1:-1}}(e)),r=Di(i),o=0;o<r;)t[o]=i[o++];for(;o<n;)ji(t,o++);return t}});const ln=Array.prototype.indexOf,sn=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]},an=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")};function dn(){let e=[];return Object.assign(e,dn.prototype),e.initialize.apply(e,arguments),e}dn.prototype=[],dn.prototype.initialize=function(e){e=e||{},this.sortColumn=null==e.sortColumn?[]:e.sortColumn},dn.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)},dn.prototype.reset=function(e){this.length=0,e&&this.add(e)},dn.prototype.filteredCollection=function(e,t){if(e&&t){let r=new dn({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},dn.prototype.onComparatorRequired=null,dn.prototype.onSort=null;let un=dn.prototype.sort;function hn(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 cn(){let e=[];return Object.assign(e,cn.prototype),e.initialize.apply(e,arguments),e}dn.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=hn(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],un.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},un.call(this,t)}e||this.onSort&&this.onSort(t)}return t},cn.prototype=[],cn.prototype.initialize=function(){},cn.prototype.get=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].name===e)return this[t];return null},cn.prototype.indexOf=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].name===e)return t;return-1},cn.prototype.getByOrder=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].order===e)return this[t];return null},cn.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},cn.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},cn.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},cn.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},cn.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 pn{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 mn=Object.prototype.hasOwnProperty,fn=void 0!==Element.prototype.insertAdjacentElement;function gn(e,t,r){t?!1===fn||e instanceof DocumentFragment?r.insertBefore(e,t):t.insertAdjacentElement("beforebegin",e):r.appendChild(e)}function bn(e,t,r,o){return e.parentNode!==o?(t||(t=document.createDocumentFragment()),t.appendChild(e)):(t&&t.childNodes.length>0&&(gn(t,r,o),t=null),e.nextSibling!==r&&gn(e,r,o)),t}class vn{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:wn,onItemRender:null,onItemUnrender:null,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||wn,this}setOnItemRender(e){return this._p.onItemRender=e,this}setOnItemUnrender(e){return this._p.onItemUnrender=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[Cn]&&(t&&t(o),delete o[Cn])}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][yn]=!0;this._calculateItemPosition(e.count-1);let d=this._getExistingElsRange(),c=_n(e.cachedItemPositions,n),p=Math.max(0,c-a),m=p,f=this._calculateItemPosition(m),g=a,b=Math.max(m,_n(e.cachedItemPositions,l-1)+1+a),v=[],C=null,y=o.childNodes[0];const w=function(e){let t;return-1!==d.firstIndex&&e>=d.firstIndex&&e<=d.lastIndex&&(t=u.find((t=>t[Cn]===e&&!0===t[yn]))),void 0===t&&(t=(d.firstIndex<p||d.firstValidArrayIndex>0?u.find((e=>(e[Cn]<p||!1===mn.call(e,Cn))&&!0===e[yn])):void 0)||Wn(u,(e=>!0===e[yn]))),void 0!==t&&delete t[yn],t};for(;m<s&&m<b;m++){let e=w(m);y&&y===e&&(y=y.nextSibling);const t=this._dequeueElementForIndex(e,m,y,!0);v.push([t,m]),C=bn(t,C,y,i)}C&&C.childNodes.length>0&&gn(C,y,i);for(let t of v){const r=t[1];this._insertItemAndFlow(t[0],r,!1),f=e.cachedItemPositions[r]+e.cachedItemHeights[r]}if(f<l)for(;(f<l||g-- >0)&&m<s;m++){let t=w(m);y&&y===t&&(y=y.nextSibling),this._dequeueElementForIndex(t,m,y,!1),f=e.cachedItemPositions[m]+e.cachedItemHeights[m]}let _=this.estimateFullHeight();e.virtualWrapper.style.height=_+"px",r!==t.clientWidth&&this.render()}else if(s!==u.length){for(let e=0;e<h;e++)u[e][yn]=!0;let e=i.childNodes[0],t=null;for(let r=0;r<s;r++){let o=u.find((e=>e[Cn]===r&&!0===e[yn]));void 0!==o&&delete o[yn],e&&e===o&&(e=e.nextSibling),t=bn(this._dequeueElementForIndex(o,r,e,!0),t,e,i)}t&&t.childNodes.length>0&&gn(t,e,i)}h=u.length;for(let e=0;e<h;e++){const t=u[e];if(!0!==t[yn])continue;let r=t.parentNode;r&&r.removeChild(t),d&&void 0!==t[Cn]&&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=bn(this._dequeueElementForIndex(void 0,r,s,!0),a,s,n);a&&a.childNodes.length>0&&gn(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[Cn]&&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[Cn],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[Cn]: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=_n(e.cachedItemPositions,i),o=_n(e.cachedItemPositions,i+n,r);else{const t=e=>{let t=this.getItemPosition(e);return void 0===t&&(t=1/0),t};r=En(e.count,t,i),o=En(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[Cn]&&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][Cn]}_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][Cn]+=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[Cn];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[Cn]=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||gn(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=Rn();!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!==mn.call(e[r],Cn)){t=r;break}for(let t=e.length-1;t>=0;t--)if(!1!==mn.call(e[t],Cn)){r=t;break}return{firstValidArrayIndex:t,lastValidArrayIndex:r,firstIndex:-1!==t?e[t][Cn]:-1,lastIndex:-1!==r?e[r][Cn]:-1}}}const Cn=Symbol("index"),yn=Symbol("reuse"),wn=()=>document.createElement("li"),_n=(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},En=(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 In=null;const Rn=()=>{if(null===In){let e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],t=document.createElement("div");In=!1;for(let r of e)if(t&&void 0!==t.style[r]){In=r;break}}return In};function Sn(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 xn=Array.prototype.indexOf,Hn=e;let Nn=navigator.userAgent,Tn=-1!==Nn.indexOf("MSIE ")?parseFloat(Nn.substr(Nn.indexOf("MSIE ")+5)):null,Pn=Tn&&Tn<10,Fn=document.createElement.bind(document);const An=Object.prototype.hasOwnProperty,Mn=Symbol("safe"),On=Symbol("hover_in"),zn=Symbol("hover_out"),kn=Symbol("row_click");function Ln(e){var t,r;t=["relative","absolute","fixed"],r=e.css("position"),ln.call(t,r)>=0||e.css("position","relative")}const $n=e=>/^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(e.target.tagName);let Bn=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)};Bn.VERSION="@@VERSION",Bn.prototype.VERSION=Bn.VERSION,Bn.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=Hn(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?Bn.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 dn({sortColumn:n}),o.rows.onComparatorRequired=(e,t,o)=>{if(r.onComparatorRequired)return r.onComparatorRequired(e,t,o)},o.filteredRows=null,this._setupHovers()},Bn.prototype._setupHovers=function(){const e=this,t=e.p;let r=function(t){let r=t.fromElement||t.relatedTarget;r===this||Hn.contains(this,r)||this.__previewCell&&(r===this.__previewCell||Hn.contains(this.__previewCell,r))||e._cellMouseOverEvent.call(e,this)},o=function(t){let r=(t=t||event).toElement||t.relatedTarget;r===this||Hn.contains(this,r)||this.__previewCell&&(r===this.__previewCell||Hn.contains(this.__previewCell,r))||e._cellMouseOutEvent.call(e,this)};t._bindCellHoverIn=function(e){e[On]||e.addEventListener("mouseover",e[On]=r.bind(e))},t._unbindCellHoverIn=function(e){e[On]&&(e.removeEventListener("mouseover",e[On]),e[On]=null)},t._bindCellHoverOut=function(e){return e[zn]||e.addEventListener("mouseout",e[zn]=o.bind(e.__cell||e)),this},t._unbindCellHoverOut=function(e){return e[zn]&&(e.removeEventListener("mouseout",e[zn]),e[zn]=null),this}},Bn.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 vn({list:r.table,itemsParent:r.tbody,autoVirtualWrapperWidth:!1,virtual:o.virtualTable,buffer:o.rowsBufferSize,estimatedItemHeight:o.estimatedRowHeight?o.estimatedRowHeight:r.virtualRowHeight||40,itemElementCreatorFn:()=>Fn("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=Fn("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(Fn("div")).innerHTML=this._getHtmlForCell(p,o),e.appendChild(i)}e.addEventListener("click",e[kn]=r=>{t.trigger("rowclick",r,i,m,e,p)}),t.trigger("rowcreate",i,m,e,p)},onItemUnrender:e=>{e[kn]&&e.removeEventListener("click",e[kn]),t._unbindCellEventsForRow(e),t.trigger("rowdestroy",e)}}),r.virtualListHelper.setCount((null!==(e=r.filteredRows)&&void 0!==e?e:r.rows).length),r.notifyRendererOfColumnsConfig()},Bn.prototype.on=function(e,t){let r=this.p.events;return"function"!=typeof t||(An.call(r,e)||(r[e]=[]),r[e].push({cb:t,once:!1})),this},Bn.prototype.once=function(e,t){let r=this.p.events;return"function"!=typeof t||(An.call(r,e)||(r[e]=[]),r[e].push({cb:t,once:!0})),this},Bn.prototype.off=function(e,t){let r=this.p.events;if(!An.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},Bn.prototype.trigger=function(e){const t=this.p;if(!t)return;let r=t.events;if(An.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},Bn.prototype._parseColumnWidth=function(e,t){let r=Math.max(0,parseFloat(e)),o=Vn.AUTO;return r>0&&(e===r+"%"?(o=Vn.RELATIVE,r/=100):r>0&&r<1?o=Vn.RELATIVE:(r<t&&(r=t),o=Vn.ABSOLUTE)),{width:r,mode:o}},Bn.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},Bn.prototype.close=Bn.prototype.remove=Bn.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.virtualListHelper.destroy(),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)An.call(t,e)&&(t[e]=null);return t.__removed=!0,o&&o.remove(),this},Bn.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},Bn.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},Bn.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===Bn.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._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},Bn.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},Bn.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=Hn("<div>").addClass(l).css("float","left"),h=0;for(o=0;o<d;o++)i=a[o],t=Fn("div"),t.className=s,t.style.width=i.actualWidth+"px",i.cellClasses&&(t.className+=" "+i.cellClasses),t.appendChild(Fn("div")),u.append(t),h+=i.actualWidth;let c=Hn("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",float:"left",width:"1px",overflow:"hidden"}).append(Hn("<div>").addClass(n).append(Hn("<div>").addClass(n+"-body").css("width",h+1e4).append(u)));c.appendTo(document.body);let p=Hn('<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},Bn.prototype.setColumns=function(e,t){const r=this.p;e=e||[];let o=new cn;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},Bn.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},Bn.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},Bn.prototype.setCellFormatter=function(e){return e||((e=e=>"string"==typeof e?an(e):e)[Mn]=!0),this.o.cellFormatter=e,this},Bn.prototype.setHeaderCellFormatter=function(e){return this.o.headerCellFormatter=e||function(e){return"string"==typeof e?an(e):e},this},Bn.prototype.setFilter=function(e){return this.o.filter=e,this},Bn.prototype.filter=function(e){const t=this.p;let r=this.o.filter||Sn;"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:Hn.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},Bn.prototype.clearFilter=function(){const e=this.p;return e.filteredRows&&(e.filterArgs=null,e.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},Bn.prototype._refilter=function(){const e=this.p;if(e.filteredRows&&e.filterArgs){let t=this.o.filter||Sn;e.filteredRows=e.rows.filteredCollection(t,e.filterArgs)}return this},Bn.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},Bn.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()._updateLastCellWidthFromScrollbar(!0);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},Bn.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},Bn.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},Bn.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},Bn.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},Bn.prototype.isColumnVisible=function(e){let t=this.p.columns.get(e);return!!t&&t.visible},Bn.prototype.setMinColumnWidth=function(e){let t=this.o;return e=Math.max(e,0),t.minColumnWidth!==e&&(t.minColumnWidth=e,this.tableWidthChanged(!0)),this},Bn.prototype.getMinColumnWidth=function(){return this.o.minColumnWidth},Bn.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++)Hn(e[0])[r.sortableColumns>0&&t.visibleColumns[o].sortable?"addClass":"removeClass"]("sortable")}return this},Bn.prototype.getSortableColumns=function(){return this.o.sortableColumns},Bn.prototype.setMovableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.movableColumns!==e&&(t.movableColumns=e),this},Bn.prototype.getMovableColumns=function(){return this.o.movableColumns},Bn.prototype.setResizableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.resizableColumns!==e&&(t.resizableColumns=e),this},Bn.prototype.getResizableColumns=function(){return this.o.resizableColumns},Bn.prototype.setComparatorCallback=function(e){let t=this.o;return t.onComparatorRequired!==e&&(t.onComparatorRequired=e),this},Bn.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},Bn.prototype.getColumnWidth=function(e){let t=this.p.columns.get(e);return t?this._serializeColumnWidth(t):null},Bn.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},Bn.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},Bn.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},Bn.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)},Bn.prototype.getHtmlForRowDataCell=function(e,t){let r=this.p.columns.get(t);return r?this._getHtmlForCell(e,r):null},Bn.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[Mn])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},Bn.prototype.getRowYPos=function(e){return this.p.virtualListHelper.getItemPosition(e)||null},Bn.prototype.getDataForRow=function(e){const t=this.p;return e<0||e>t.rows.length-1?null:t.rows[e]},Bn.prototype.getRowCount=function(){const e=this.p;return e.rows?e.rows.length:0},Bn.prototype.getIndexForRow=function(e){return this.p.rows.indexOf(e)},Bn.prototype.getFilteredRowCount=function(){const e=this.p;return(e.filteredRows||e.rows).length},Bn.prototype.getIndexForFilteredRow=function(e){const t=this.p;return(t.filteredRows||t.rows).indexOf(e)},Bn.prototype.getDataForFilteredRow=function(e){const t=this.p;return e<0||e>(t.filteredRows||t.rows).length-1?null:(t.filteredRows||t.rows)[e]},Bn.prototype.getHeaderRowElement=function(){return this.p.headerRow},Bn.prototype._horizontalPadding=function(e){return(parseFloat(Hn.css(e,"padding-left"))||0)+(parseFloat(Hn.css(e,"padding-right"))||0)},Bn.prototype._horizontalBorderWidth=function(e){return(parseFloat(Hn.css(e,"border-left"))||0)+(parseFloat(Hn.css(e,"border-right"))||0)},Bn.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=Hn("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px"}),d=Hn("<div>").addClass(s+"-header").appendTo(a),u=Hn("<div>").addClass(s+"-header-row").appendTo(d);for(let e=0;e<t.visibleColumns.length;e++)u.append(Hn("<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=Hn(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)},Bn.prototype.tableWidthChanged=function(){let e=function(e){let t,o=this.o.tableClassName,i=Hn("<div>").addClass(this.$el).append(Hn("<div>").addClass(o+"-header").append(Hn("<div>").addClass(o+"-header-row").append(t=Hn("<div>").addClass(o+"-header-cell").append(Hn("<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===Vn.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===Vn.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===Vn.RELATIVE&&(c+=o.width,a++)}if(i.convertColumnWidthsToRelative)for(let e=0;e<n.visibleColumns.length;e++){let t=n.visibleColumns[e];t.widthMode===Vn.AUTO&&(t.widthMode=Vn.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===Vn.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===Vn.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===Vn.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!==Vn.ABSOLUTE||(e+=o.width),o.widthMode===Vn.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!==Vn.ABSOLUTE)if(t.widthMode===Vn.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===Vn.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}}(),Bn.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},Bn.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},Bn.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},Bn.prototype.removeRow=function(e,t){return this.removeRows(e,1,t)},Bn.prototype.refreshRow=function(e){let t=this.p;if(e<0||e>t.rows.length-1)return this;let r=-1;return t.filteredRows&&-1===(r=t.filteredRows.indexOf(t.rows[e]))||(-1===r&&(r=e),t.virtualListHelper.refreshItemAt(r)),this},Bn.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)},Bn.prototype.refreshAllVirtualRows=function(){return this.p.virtualListHelper.invalidate().render(),this},Bn.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},Bn.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},Bn.prototype.isWorkerSupported=function(){return window.Worker instanceof Function},Bn.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},Bn.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},Bn.prototype.abortCellPreview=function(){return this.hideCellPreview(),this},Bn.prototype.cancelColumnResize=function(){const e=this.p;return e.$resizer&&(e.$resizer.remove(),e.$resizer=null,Hn(document).off("mousemove.dgtable",e.onMouseMoveResizeAreaBound).off("mouseup.dgtable",e.onEndDragColumnHeaderBound)),this},Bn.prototype._onTableScrolledHorizontally=function(){const e=this.p;e.header.scrollLeft=e.table.scrollLeft},Bn.prototype._getColumnByResizePosition=function(e){let t=this.o,o=this._isTableRtl(),i=Hn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),n=i[0];n.__cell&&(n=n.__cell,i=Hn(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},Bn.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=Hn(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=Hn.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=>{$n(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=sn(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));r&&(s(),$n(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=sn(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}))))}))},Bn.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&&Hn(o.$resizer).remove(),o.$resizer=Hn("<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===Tn&&(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){}Hn(document).on("mousemove.dgtable",o.onMouseMoveResizeAreaBound),Hn(document).on("mouseup.dgtable",o.onEndDragColumnHeaderBound),e.preventDefault()}},Bn.prototype._onMouseMoveColumnHeader=function(e){let t=this.o,r=this.p;if(t.resizableColumns){let o=this._getColumnByResizePosition(e),i=Hn(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=""}},Bn.prototype._onMouseUpColumnHeader=function(e){if(3===e.which){let t=this.o,o=Hn(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},Bn.prototype._onMouseLeaveColumnHeader=function(e){let t=this.o;Hn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0].style.cursor=""},Bn.prototype._onClickColumnHeader=function(e){if(!$n(e)&&!this._getColumnByResizePosition(e)){let t=this,r=t.o,o=t.p,i=Hn(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()}}},Bn.prototype._onStartDragColumnHeader=function(e){let t=this.o,r=this.p;if(t.movableColumns){let o=Hn(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()},Bn.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")},Bn.prototype._onEndDragColumnHeader=function(e){let t=this.o,o=this.p;if(o.$resizer){Hn(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===Vn.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===Vn.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},Bn.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=Hn(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])&&Hn(i).addClass("drag-over")}}},Bn.prototype._onDragOverColumnHeader=function(e){e.preventDefault()},Bn.prototype._onDragLeaveColumnHeader=function(e){let t=this.o,r=Hn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);Hn(r[0].firstChild).has(e.originalEvent.relatedTarget).length||r.removeClass("drag-over")},Bn.prototype._onDropColumnHeader=function(e){e.preventDefault();let t=this.o,r=this.p,o=JSON.parse(e.originalEvent.dataTransfer.getData("text")),i=Hn(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)}Hn(i).removeClass("drag-over")},Bn.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},Bn.prototype._showSortArrow=function(e,t){let r=this.p.columns.get(e);if(!r)return!1;let o=Fn("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!==Vn.RELATIVE&&this.o.adjustColumnWidthForSortArrow&&(r.arrowProposedWidth=o.scrollWidth+(parseFloat(Hn(o).css("margin-right"))||0)+(parseFloat(Hn(o).css("margin-left"))||0)),this},Bn.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},Bn.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},Bn.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=Fn("div"),s=Hn(l),a=Fn("div"),d=Hn(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),Ln(t.$el),i.width===Bn.Width.SCROLL?this.el.style.overflow="hidden":this.el.style.overflow="",!i.height&&i.virtualTable&&(i.height=r.getElementHeight(this.$el[0],!0)),this},Bn.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;Pn&&(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=Fn("div"),c=Hn(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=Fn("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),Hn(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)),Pn&&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},Bn.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=Fn("div"),t=e.appendChild(Fn("div")),r=t.appendChild(Fn("div"));return e.className=i+"-row",t.className=i+"-cell",r.innerHTML="0",e.style.visibility="hidden",e.style.position="absolute",e},l=Hn("<div>").addClass(e.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",width:"1px",overflow:"hidden"}).append(Hn("<div>").addClass(i).append(o=Hn("<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=Fn("div"),s=Hn(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===Bn.Width.SCROLL?"auto":"hidden",n.appendChild(l);let d=Fn("div"),u=Hn(d);d.className=o.tableClassName+"-body",d.style.minHeight="1px",t.table=l,t.tbody=d,t.$table=s,t.$tbody=u,Ln(u),Ln(s),l.appendChild(d),e.el.appendChild(n),this._setupVirtualTable()}return this},Bn.prototype._renderSkeleton=function(){return this},Bn.prototype._updateVirtualHeight=function(){const e=this.o,t=this.p;return t.tbody?(e.virtualTable?t.tbody.style.height=t.virtualListHelper.estimateFullHeight()+"px":t.tbody.style.height="",this):this},Bn.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},Bn.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===Bn.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===Bn.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},Bn.prototype._isTableRtl=function(){return"rtl"===this.p.$table.css("direction")},Bn.prototype._serializeColumnWidth=function(e){return e.widthMode===Vn.AUTO?"auto":e.widthMode===Vn.RELATIVE?100*e.width+"%":e.width},Bn.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=Hn(e),l=Hn(i);const s=e.parentNode;let a=Fn("div"),d=Hn(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,Hn(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()})),Hn(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)),Pn&&Hn(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(Hn(e).css("border-top-width"))||0)),!o.transparentBgColor1){let e=document.createElement("div");e.style.backgroundColor="transparent",o.transparentBgColor1=Hn(e).css("background-color"),e.style.backgroundColor="rgba(0,0,0,0)",o.transparentBgColor2=Hn(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=Hn(e).css("background-color");t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t=Hn(s).css("background-color")),t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t="#fff"),b["background-color"]=t}d.css(b),this.el.appendChild(a),Hn(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[xn.call(s.childNodes,e)].name;try{let t=pn.saveSelection(e);t&&pn.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?Hn(document):C,w=n.offset(),_=C.offset(),E="right"===n.css("float"),W=E?"right":"left";if(E){let e=Hn(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(Hn(e).css("border-"+W+"-width"))||0,w.top+=parseFloat(Hn(e).css("border-top-width"))||parseFloat(Hn(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()}))}},Bn.prototype._cellMouseOutEvent=function(e){this.hideCellPreview()},Bn.prototype.hideCellPreview=function(){const e=this.p;if(e.$cellPreviewCell){let t,r=e.$cellPreviewCell[0],o=r.__cell;try{t=pn.saveSelection(r)}catch(e){}e.$cellPreviewCell.remove(),e._unbindCellHoverOut(o),e._unbindCellHoverOut(r);try{t&&pn.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 Vn={AUTO:0,ABSOLUTE:1,RELATIVE:2};Bn.Width={NONE:"none",AUTO:"auto",SCROLL:"scroll"},Hn.controls||(Hn.controls={}),Hn.controls.dgtable=Bn,module.exports=Bn;
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=x,N=W,T=function(e){if("Function"===H(e))return N(e)},P=s,F=x,A=Object,M=T("".split),O=P((function(){return!A("z").propertyIsEnumerable(0)}))?function(e){return"String"==F(e)?M(e,""):A(e)}:A,z=function(e){return null==e},L=z,k=TypeError,$=function(e){if(L(e))throw k("Can't call method on "+e);return e},B=O,V=$,D=function(e){return B(V(e))},j="object"==typeof document&&document.all,U={all:j,IS_HTMLDDA:void 0===j&&void 0!==j},q=U.all,X=U.IS_HTMLDDA?function(e){return"function"==typeof e||e===q}:function(e){return"function"==typeof e},Y=X,G=U.all,J=U.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:Y(e)||e===G}:function(e){return"object"==typeof e?null!==e:Y(e)},K=n,Q=X,Z=function(e){return Q(e)?e:void 0},ee=function(e,t){return arguments.length<2?Z(K[e]):K[e]&&K[e][t]},te=T({}.isPrototypeOf),re=ee("navigator","userAgent")||"",oe=n,ie=re,ne=oe.process,le=oe.Deno,se=ne&&ne.versions||le&&le.version,ae=se&&se.v8;ae&&(v=(b=ae.split("."))[0]>0&&b[0]<4?1:+(b[0]+b[1])),!v&&ie&&(!(b=ie.match(/Edge\/(\d+)/))||b[1]>=74)&&(b=ie.match(/Chrome\/(\d+)/))&&(v=+b[1]);var de=v,ue=de,he=s,ce=!!Object.getOwnPropertySymbols&&!he((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ue&&ue<41})),pe=ce&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,me=ee,fe=X,ge=te,be=Object,ve=pe?function(e){return"symbol"==typeof e}:function(e){var t=me("Symbol");return fe(t)&&ge(t.prototype,be(e))},Ce=String,ye=function(e){try{return Ce(e)}catch(e){return"Object"}},we=X,_e=ye,Ee=TypeError,We=function(e){if(we(e))return e;throw Ee(_e(e)+" is not a function")},Ie=We,Re=z,Se=c,xe=X,He=J,Ne=TypeError,Te={exports:{}},Pe=n,Fe=Object.defineProperty,Ae=function(e,t){try{Fe(Pe,e,{value:t,configurable:!0,writable:!0})}catch(r){Pe[e]=t}return t},Me=Ae,Oe=n["__core-js_shared__"]||Me("__core-js_shared__",{}),ze=Oe;(Te.exports=function(e,t){return ze[e]||(ze[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Le=$,ke=Object,$e=function(e){return ke(Le(e))},Be=$e,Ve=T({}.hasOwnProperty),De=Object.hasOwn||function(e,t){return Ve(Be(e),t)},je=T,Ue=0,qe=Math.random(),Xe=je(1..toString),Ye=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Xe(++Ue+qe,36)},Ge=n,Je=Te.exports,Ke=De,Qe=Ye,Ze=ce,et=pe,tt=Je("wks"),rt=Ge.Symbol,ot=rt&&rt.for,it=et?rt:rt&&rt.withoutSetter||Qe,nt=function(e){if(!Ke(tt,e)||!Ze&&"string"!=typeof tt[e]){var t="Symbol."+e;Ze&&Ke(rt,e)?tt[e]=rt[e]:tt[e]=et&&ot?ot(t):it(t)}return tt[e]},lt=c,st=J,at=ve,dt=TypeError,ut=nt("toPrimitive"),ht=function(e,t){if(!st(e)||at(e))return e;var r,o,i=(o=e[ut],Re(o)?void 0:Ie(o));if(i){if(void 0===t&&(t="default"),r=lt(i,e,t),!st(r)||at(r))return r;throw dt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,o;if("string"===t&&xe(r=e.toString)&&!He(o=Se(r,e)))return o;if(xe(r=e.valueOf)&&!He(o=Se(r,e)))return o;if("string"!==t&&xe(r=e.toString)&&!He(o=Se(r,e)))return o;throw Ne("Can't convert object to primitive value")}(e,t)},ct=ve,pt=function(e){var t=ht(e,"string");return ct(t)?t:t+""},mt=J,ft=n.document,gt=mt(ft)&&mt(ft.createElement),bt=!a&&!s((function(){return 7!=Object.defineProperty((e="div",gt?ft.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),vt=a,Ct=c,yt=p,wt=C,_t=D,Et=pt,Wt=De,It=bt,Rt=Object.getOwnPropertyDescriptor;l.f=vt?Rt:function(e,t){if(e=_t(e),t=Et(t),It)try{return Rt(e,t)}catch(e){}if(Wt(e,t))return wt(!Ct(yt.f,e,t),e[t])};var St={},xt=a&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ht=J,Nt=String,Tt=TypeError,Pt=function(e){if(Ht(e))return e;throw Tt(Nt(e)+" is not an object")},Ft=a,At=bt,Mt=xt,Ot=Pt,zt=pt,Lt=TypeError,kt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor;St.f=Ft?Mt?function(e,t,r){if(Ot(e),t=zt(t),Ot(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var o=$t(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 kt(e,t,r)}:kt:function(e,t,r){if(Ot(e),t=zt(t),Ot(r),At)try{return kt(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Lt("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Bt=St,Vt=C,Dt=a?function(e,t,r){return Bt.f(e,t,Vt(1,r))}:function(e,t,r){return e[t]=r,e},jt={exports:{}},Ut=a,qt=De,Xt=Function.prototype,Yt=Ut&&Object.getOwnPropertyDescriptor,Gt=qt(Xt,"name"),Jt={EXISTS:Gt,PROPER:Gt&&"something"===function(){}.name,CONFIGURABLE:Gt&&(!Ut||Ut&&Yt(Xt,"name").configurable)},Kt=X,Qt=Oe,Zt=T(Function.toString);Kt(Qt.inspectSource)||(Qt.inspectSource=function(e){return Zt(e)});var er,tr,rr,or,ir=Qt.inspectSource,nr=X,lr=n.WeakMap,sr=nr(lr)&&/native code/.test(String(lr)),ar=Te.exports,dr=Ye,ur=ar("keys"),hr={},cr=sr,pr=n,mr=J,fr=Dt,gr=De,br=Oe,vr=hr,Cr=pr.TypeError,yr=pr.WeakMap;if(cr||br.state){var wr=br.state||(br.state=new yr);wr.get=wr.get,wr.has=wr.has,wr.set=wr.set,er=function(e,t){if(wr.has(e))throw Cr("Object already initialized");return t.facade=e,wr.set(e,t),t},tr=function(e){return wr.get(e)||{}},rr=function(e){return wr.has(e)}}else{var _r=ur[or="state"]||(ur[or]=dr(or));vr[_r]=!0,er=function(e,t){if(gr(e,_r))throw Cr("Object already initialized");return t.facade=e,fr(e,_r,t),t},tr=function(e){return gr(e,_r)?e[_r]:{}},rr=function(e){return gr(e,_r)}}var Er={set:er,get:tr,has:rr,enforce:function(e){return rr(e)?tr(e):er(e,{})},getterFor:function(e){return function(t){var r;if(!mr(t)||(r=tr(t)).type!==e)throw Cr("Incompatible receiver, "+e+" required");return r}}},Wr=s,Ir=X,Rr=De,Sr=a,xr=Jt.CONFIGURABLE,Hr=ir,Nr=Er.enforce,Tr=Er.get,Pr=Object.defineProperty,Fr=Sr&&!Wr((function(){return 8!==Pr((function(){}),"length",{value:8}).length})),Ar=String(String).split("String"),Mr=jt.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),(!Rr(e,"name")||xr&&e.name!==t)&&(Sr?Pr(e,"name",{value:t,configurable:!0}):e.name=t),Fr&&r&&Rr(r,"arity")&&e.length!==r.arity&&Pr(e,"length",{value:r.arity});try{r&&Rr(r,"constructor")&&r.constructor?Sr&&Pr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var o=Nr(e);return Rr(o,"source")||(o.source=Ar.join("string"==typeof t?t:"")),e};Function.prototype.toString=Mr((function(){return Ir(this)&&Tr(this).source||Hr(this)}),"toString");var Or=X,zr=St,Lr=jt.exports,kr=Ae,$r={},Br=Math.ceil,Vr=Math.floor,Dr=Math.trunc||function(e){var t=+e;return(t>0?Vr:Br)(t)},jr=function(e){var t=+e;return t!=t||0===t?0:Dr(t)},Ur=jr,qr=Math.max,Xr=Math.min,Yr=function(e,t){var r=Ur(e);return r<0?qr(r+t,0):Xr(r,t)},Gr=jr,Jr=Math.min,Kr=function(e){return(t=e.length)>0?Jr(Gr(t),9007199254740991):0;var t},Qr=D,Zr=Yr,eo=Kr,to=function(e){return function(t,r,o){var i,n=Qr(t),l=eo(n),s=Zr(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}},ro={includes:to(!0),indexOf:to(!1)},oo=De,io=D,no=ro.indexOf,lo=hr,so=T([].push),ao=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");$r.f=Object.getOwnPropertyNames||function(e){return function(e,t){var r,o=io(e),i=0,n=[];for(r in o)!oo(lo,r)&&oo(o,r)&&so(n,r);for(;t.length>i;)oo(o,r=t[i++])&&(~no(n,r)||so(n,r));return n}(e,ao)};var uo={};uo.f=Object.getOwnPropertySymbols;var ho=ee,co=$r,po=uo,mo=Pt,fo=T([].concat),go=ho("Reflect","ownKeys")||function(e){var t=co.f(mo(e)),r=po.f;return r?fo(t,r(e)):t},bo=De,vo=go,Co=l,yo=St,wo=function(e,t,r){for(var o=vo(t),i=yo.f,n=Co.f,l=0;l<o.length;l++){var s=o[l];bo(e,s)||r&&bo(r,s)||i(e,s,n(t,s))}},_o=s,Eo=X,Wo=/#|\.prototype\./,Io=function(e,t){var r=So[Ro(e)];return r==Ho||r!=xo&&(Eo(t)?_o(t):!!t)},Ro=Io.normalize=function(e){return String(e).replace(Wo,".").toLowerCase()},So=Io.data={},xo=Io.NATIVE="N",Ho=Io.POLYFILL="P",No=Io,To=n,Po=l.f,Fo=Dt,Ao=function(e,t,r,o){o||(o={});var i=o.enumerable,n=void 0!==o.name?o.name:t;if(Or(r)&&Lr(r,n,o),o.global)i?e[t]=r:kr(t,r);else{try{o.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:zr.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e},Mo=Ae,Oo=wo,zo=No,Lo=function(e,t){var r,o,i,n,l,s=e.target,a=e.global,d=e.stat;if(r=a?To:d?To[s]||Mo(s,{}):(To[s]||{}).prototype)for(o in t){if(n=t[o],i=e.dontCallGetSet?(l=Po(r,o))&&l.value:r[o],!zo(a?o:s+(d?".":"#")+o,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;Oo(n,i)}(e.sham||i&&i.sham)&&Fo(n,"sham",!0),Ao(r,o,n,e)}},ko={};ko[nt("toStringTag")]="z";var $o="[object z]"===String(ko),Bo=X,Vo=x,Do=nt("toStringTag"),jo=Object,Uo="Arguments"==Vo(function(){return arguments}()),qo=$o?Vo: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=jo(e),Do))?r:Uo?Vo(t):"Object"==(o=Vo(t))&&Bo(t.callee)?"Arguments":o},Xo=String,Yo=function(e){if("Symbol"===qo(e))throw TypeError("Cannot convert a Symbol value to a string");return Xo(e)},Go=Lo,Jo=a,Ko=n,Qo=T,Zo=De,ei=X,ti=te,ri=Yo,oi=St.f,ii=wo,ni=Ko.Symbol,li=ni&&ni.prototype;if(Jo&&ei(ni)&&(!("description"in li)||void 0!==ni().description)){var si={},ai=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:ri(arguments[0]),t=ti(li,this)?new ni(e):void 0===e?ni():ni(e);return""===e&&(si[t]=!0),t};ii(ai,ni),ai.prototype=li,li.constructor=ai;var di="Symbol(test)"==String(ni("test")),ui=Qo(li.valueOf),hi=Qo(li.toString),ci=/^Symbol\((.*)\)[^)]+$/,pi=Qo("".replace),mi=Qo("".slice);oi(li,"description",{configurable:!0,get:function(){var e=ui(this);if(Zo(si,e))return"";var t=hi(e),r=di?mi(t,7,-1):pi(t,ci,"$1");return""===r?void 0:r}}),Go({global:!0,constructor:!0,forced:!0},{Symbol:ai})}var fi,gi,bi=ye,vi=TypeError,Ci=pt,yi=St,wi=C,_i=Yr,Ei=Kr,Wi=function(e,t,r){var o=Ci(t);o in e?yi.f(e,o,wi(0,r)):e[o]=r},Ii=Array,Ri=Math.max,Si=function(e,t,r){for(var o=Ei(e),i=_i(t,o),n=_i(void 0===r?o:r,o),l=Ii(Ri(n-i,0)),s=0;i<n;i++,s++)Wi(l,s,e[i]);return l.length=s,l},xi=Math.floor,Hi=function(e,t){var r=e.length,o=xi(r/2);return r<8?Ni(e,t):Ti(e,Hi(Si(e,0,o),t),Hi(Si(e,o),t),t)},Ni=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},Ti=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},Pi=Hi,Fi=s,Ai=re.match(/firefox\/(\d+)/i),Mi=!!Ai&&+Ai[1],Oi=/MSIE|Trident/.test(re),zi=re.match(/AppleWebKit\/(\d+)\./),Li=!!zi&&+zi[1],ki=Lo,$i=T,Bi=We,Vi=$e,Di=Kr,ji=function(e,t){if(!delete e[t])throw vi("Cannot delete property "+bi(t)+" of "+bi(e))},Ui=Yo,qi=s,Xi=Pi,Yi=Mi,Gi=Oi,Ji=de,Ki=Li,Qi=[],Zi=$i(Qi.sort),en=$i(Qi.push),tn=qi((function(){Qi.sort(void 0)})),rn=qi((function(){Qi.sort(null)})),on=!!(gi=[]["sort"])&&Fi((function(){gi.call(null,fi||function(){return 1},1)})),nn=!qi((function(){if(Ji)return Ji<70;if(!(Yi&&Yi>3)){if(Gi)return!0;if(Ki)return Ki<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++)Qi.push({k:t+o,v:r})}for(Qi.sort((function(e,t){return t.v-e.v})),o=0;o<Qi.length;o++)t=Qi[o].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));ki({target:"Array",proto:!0,forced:tn||!rn||!on||!nn},{sort:function(e){void 0!==e&&Bi(e);var t=Vi(this);if(nn)return void 0===e?Zi(t):Zi(t,e);var r,o,i=[],n=Di(t);for(o=0;o<n;o++)o in t&&en(i,t[o]);for(Xi(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:Ui(t)>Ui(r)?1:-1}}(e)),r=Di(i),o=0;o<r;)t[o]=i[o++];for(;o<n;)ji(t,o++);return t}});const ln=Array.prototype.indexOf,sn=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]},an=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")};function dn(){let e=[];return Object.assign(e,dn.prototype),e.initialize.apply(e,arguments),e}dn.prototype=[],dn.prototype.initialize=function(e){e=e||{},this.sortColumn=null==e.sortColumn?[]:e.sortColumn},dn.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)},dn.prototype.reset=function(e){this.length=0,e&&this.add(e)},dn.prototype.filteredCollection=function(e,t){if(e&&t){let r=new dn({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},dn.prototype.onComparatorRequired=null,dn.prototype.onSort=null;let un=dn.prototype.sort;function hn(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 cn(){let e=[];return Object.assign(e,cn.prototype),e.initialize.apply(e,arguments),e}dn.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=hn(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],un.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},un.call(this,t)}e||this.onSort&&this.onSort(t)}return t},cn.prototype=[],cn.prototype.initialize=function(){},cn.prototype.get=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].name===e)return this[t];return null},cn.prototype.indexOf=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].name===e)return t;return-1},cn.prototype.getByOrder=function(e){for(let t=0,r=this.length;t<r;t++)if(this[t].order===e)return this[t];return null},cn.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},cn.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},cn.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},cn.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},cn.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 pn{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 mn=Object.prototype.hasOwnProperty,fn=void 0!==Element.prototype.insertAdjacentElement;function gn(e,t,r){t?!1===fn||e instanceof DocumentFragment?r.insertBefore(e,t):t.insertAdjacentElement("beforebegin",e):r.appendChild(e)}function bn(e,t,r,o){return e.parentNode!==o?(t||(t=document.createDocumentFragment()),t.appendChild(e)):(t&&t.childNodes.length>0&&(gn(t,r,o),t=null),e.nextSibling!==r&&gn(e,r,o)),t}class vn{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:wn,onItemRender:null,onItemUnrender:null,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||wn,this}setOnItemRender(e){return this._p.onItemRender=e,this}setOnItemUnrender(e){return this._p.onItemUnrender=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[Cn]&&(t&&t(o),delete o[Cn])}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][yn]=!0;this._calculateItemPosition(e.count-1);let d=this._getExistingElsRange(),c=_n(e.cachedItemPositions,n),p=Math.max(0,c-a),m=p,f=this._calculateItemPosition(m),g=a,b=Math.max(m,_n(e.cachedItemPositions,l-1)+1+a),v=[],C=null,y=o.childNodes[0];const w=function(e){let t;return-1!==d.firstIndex&&e>=d.firstIndex&&e<=d.lastIndex&&(t=u.find((t=>t[Cn]===e&&!0===t[yn]))),void 0===t&&(t=(d.firstIndex<p||d.firstValidArrayIndex>0?u.find((e=>(e[Cn]<p||!1===mn.call(e,Cn))&&!0===e[yn])):void 0)||Wn(u,(e=>!0===e[yn]))),void 0!==t&&delete t[yn],t};for(;m<s&&m<b;m++){let e=w(m);y&&y===e&&(y=y.nextSibling);const t=this._dequeueElementForIndex(e,m,y,!0);v.push([t,m]),C=bn(t,C,y,i)}C&&C.childNodes.length>0&&gn(C,y,i);for(let t of v){const r=t[1];this._insertItemAndFlow(t[0],r,!1),f=e.cachedItemPositions[r]+e.cachedItemHeights[r]}if(f<l)for(;(f<l||g-- >0)&&m<s;m++){let t=w(m);y&&y===t&&(y=y.nextSibling),this._dequeueElementForIndex(t,m,y,!1),f=e.cachedItemPositions[m]+e.cachedItemHeights[m]}let _=this.estimateFullHeight();e.virtualWrapper.style.height=_+"px",r!==t.clientWidth&&this.render()}else if(s!==u.length){for(let e=0;e<h;e++)u[e][yn]=!0;let e=i.childNodes[0],t=null;for(let r=0;r<s;r++){let o=u.find((e=>e[Cn]===r&&!0===e[yn]));void 0!==o&&delete o[yn],e&&e===o&&(e=e.nextSibling),t=bn(this._dequeueElementForIndex(o,r,e,!0),t,e,i)}t&&t.childNodes.length>0&&gn(t,e,i)}h=u.length;for(let e=0;e<h;e++){const t=u[e];if(!0!==t[yn])continue;let r=t.parentNode;r&&r.removeChild(t),d&&void 0!==t[Cn]&&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=bn(this._dequeueElementForIndex(void 0,r,s,!0),a,s,n);a&&a.childNodes.length>0&&gn(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[Cn]&&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[Cn],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[Cn]: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=_n(e.cachedItemPositions,i),o=_n(e.cachedItemPositions,i+n,r);else{const t=e=>{let t=this.getItemPosition(e);return void 0===t&&(t=1/0),t};r=En(e.count,t,i),o=En(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[Cn]&&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][Cn]}_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][Cn]+=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[Cn];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[Cn]=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||gn(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=Rn();!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!==mn.call(e[r],Cn)){t=r;break}for(let t=e.length-1;t>=0;t--)if(!1!==mn.call(e[t],Cn)){r=t;break}return{firstValidArrayIndex:t,lastValidArrayIndex:r,firstIndex:-1!==t?e[t][Cn]:-1,lastIndex:-1!==r?e[r][Cn]:-1}}}const Cn=Symbol("index"),yn=Symbol("reuse"),wn=()=>document.createElement("li"),_n=(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},En=(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 In=null;const Rn=()=>{if(null===In){let e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],t=document.createElement("div");In=!1;for(let r of e)if(t&&void 0!==t.style[r]){In=r;break}}return In};function Sn(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 xn=Array.prototype.indexOf,Hn=e;let Nn=navigator.userAgent,Tn=-1!==Nn.indexOf("MSIE ")?parseFloat(Nn.substr(Nn.indexOf("MSIE ")+5)):null,Pn=Tn&&Tn<10,Fn=document.createElement.bind(document);const An=Object.prototype.hasOwnProperty,Mn=Symbol("safe"),On=Symbol("hover_in"),zn=Symbol("hover_out"),Ln=Symbol("row_click");function kn(e){var t,r;t=["relative","absolute","fixed"],r=e.css("position"),ln.call(t,r)>=0||e.css("position","relative")}const $n=e=>/^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(e.target.tagName);let Bn=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)};Bn.VERSION="@@VERSION",Bn.prototype.VERSION=Bn.VERSION,Bn.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=Hn(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?Bn.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 dn({sortColumn:n}),o.rows.onComparatorRequired=(e,t,o)=>{if(r.onComparatorRequired)return r.onComparatorRequired(e,t,o)},o.filteredRows=null,this._setupHovers()},Bn.prototype._setupHovers=function(){const e=this,t=e.p;let r=function(t){let r=t.fromElement||t.relatedTarget;r===this||Hn.contains(this,r)||this.__previewCell&&(r===this.__previewCell||Hn.contains(this.__previewCell,r))||e._cellMouseOverEvent.call(e,this)},o=function(t){let r=(t=t||event).toElement||t.relatedTarget;r===this||Hn.contains(this,r)||this.__previewCell&&(r===this.__previewCell||Hn.contains(this.__previewCell,r))||e._cellMouseOutEvent.call(e,this)};t._bindCellHoverIn=function(e){e[On]||e.addEventListener("mouseover",e[On]=r.bind(e))},t._unbindCellHoverIn=function(e){e[On]&&(e.removeEventListener("mouseover",e[On]),e[On]=null)},t._bindCellHoverOut=function(e){return e[zn]||e.addEventListener("mouseout",e[zn]=o.bind(e.__cell||e)),this},t._unbindCellHoverOut=function(e){return e[zn]&&(e.removeEventListener("mouseout",e[zn]),e[zn]=null),this}},Bn.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 vn({list:r.table,itemsParent:r.tbody,autoVirtualWrapperWidth:!1,virtual:o.virtualTable,buffer:o.rowsBufferSize,estimatedItemHeight:o.estimatedRowHeight?o.estimatedRowHeight:r.virtualRowHeight||40,itemElementCreatorFn:()=>Fn("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=Fn("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(Fn("div")).innerHTML=this._getHtmlForCell(p,o),e.appendChild(i)}e.addEventListener("click",e[Ln]=r=>{t.trigger("rowclick",r,i,m,e,p)}),t.trigger("rowcreate",i,m,e,p)},onItemUnrender:e=>{e[Ln]&&e.removeEventListener("click",e[Ln]),t._unbindCellEventsForRow(e),t.trigger("rowdestroy",e)}}),r.virtualListHelper.setCount((null!==(e=r.filteredRows)&&void 0!==e?e:r.rows).length),r.notifyRendererOfColumnsConfig()},Bn.prototype.on=function(e,t){let r=this.p.events;return"function"!=typeof t||(An.call(r,e)||(r[e]=[]),r[e].push({cb:t,once:!1})),this},Bn.prototype.once=function(e,t){let r=this.p.events;return"function"!=typeof t||(An.call(r,e)||(r[e]=[]),r[e].push({cb:t,once:!0})),this},Bn.prototype.off=function(e,t){let r=this.p.events;if(!An.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},Bn.prototype.trigger=function(e){const t=this.p;if(!t)return;let r=t.events;if(An.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},Bn.prototype._parseColumnWidth=function(e,t){let r=Math.max(0,parseFloat(e)),o=Vn.AUTO;return r>0&&(e===r+"%"?(o=Vn.RELATIVE,r/=100):r>0&&r<1?o=Vn.RELATIVE:(r<t&&(r=t),o=Vn.ABSOLUTE)),{width:r,mode:o}},Bn.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},Bn.prototype.close=Bn.prototype.remove=Bn.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.virtualListHelper.destroy(),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)An.call(t,e)&&(t[e]=null);return t.__removed=!0,o&&o.remove(),this},Bn.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},Bn.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},Bn.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===Bn.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._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},Bn.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},Bn.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=Hn("<div>").addClass(l).css("float","left"),h=0;for(o=0;o<d;o++)i=a[o],t=Fn("div"),t.className=s,t.style.width=i.actualWidth+"px",i.cellClasses&&(t.className+=" "+i.cellClasses),t.appendChild(Fn("div")),u.append(t),h+=i.actualWidth;let c=Hn("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",float:"left",width:"1px",overflow:"hidden"}).append(Hn("<div>").addClass(n).append(Hn("<div>").addClass(n+"-body").css("width",h+1e4).append(u)));c.appendTo(document.body);let p=Hn('<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},Bn.prototype.setColumns=function(e,t){const r=this.p;e=e||[];let o=new cn;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},Bn.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},Bn.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},Bn.prototype.setCellFormatter=function(e){return e||((e=e=>"string"==typeof e?an(e):e)[Mn]=!0),this.o.cellFormatter=e,this},Bn.prototype.setHeaderCellFormatter=function(e){return this.o.headerCellFormatter=e||function(e){return"string"==typeof e?an(e):e},this},Bn.prototype.setFilter=function(e){return this.o.filter=e,this},Bn.prototype.filter=function(e){const t=this.p;let r=this.o.filter||Sn;"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:Hn.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},Bn.prototype.clearFilter=function(){const e=this.p;return e.filteredRows&&(e.filterArgs=null,e.filteredRows=null,this.clearAndRender(),this.trigger("filterclear",{})),this},Bn.prototype._refilter=function(){const e=this.p;if(e.filteredRows&&e.filterArgs){let t=this.o.filter||Sn;e.filteredRows=e.rows.filteredCollection(t,e.filterArgs)}return this},Bn.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},Bn.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()._updateLastCellWidthFromScrollbar(!0);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},Bn.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},Bn.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},Bn.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},Bn.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},Bn.prototype.isColumnVisible=function(e){let t=this.p.columns.get(e);return!!t&&t.visible},Bn.prototype.setMinColumnWidth=function(e){let t=this.o;return e=Math.max(e,0),t.minColumnWidth!==e&&(t.minColumnWidth=e,this.tableWidthChanged(!0)),this},Bn.prototype.getMinColumnWidth=function(){return this.o.minColumnWidth},Bn.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++)Hn(e[0])[r.sortableColumns>0&&t.visibleColumns[o].sortable?"addClass":"removeClass"]("sortable")}return this},Bn.prototype.getSortableColumns=function(){return this.o.sortableColumns},Bn.prototype.setMovableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.movableColumns!==e&&(t.movableColumns=e),this},Bn.prototype.getMovableColumns=function(){return this.o.movableColumns},Bn.prototype.setResizableColumns=function(e){let t=this.o;return e=void 0===e||!!e,t.resizableColumns!==e&&(t.resizableColumns=e),this},Bn.prototype.getResizableColumns=function(){return this.o.resizableColumns},Bn.prototype.setComparatorCallback=function(e){let t=this.o;return t.onComparatorRequired!==e&&(t.onComparatorRequired=e),this},Bn.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},Bn.prototype.getColumnWidth=function(e){let t=this.p.columns.get(e);return t?this._serializeColumnWidth(t):null},Bn.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},Bn.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},Bn.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},Bn.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)},Bn.prototype.getHtmlForRowDataCell=function(e,t){let r=this.p.columns.get(t);return r?this._getHtmlForCell(e,r):null},Bn.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[Mn])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},Bn.prototype.getRowYPos=function(e){return this.p.virtualListHelper.getItemPosition(e)||null},Bn.prototype.getDataForRow=function(e){const t=this.p;return e<0||e>t.rows.length-1?null:t.rows[e]},Bn.prototype.getRowCount=function(){const e=this.p;return e.rows?e.rows.length:0},Bn.prototype.getIndexForRow=function(e){return this.p.rows.indexOf(e)},Bn.prototype.getFilteredRowCount=function(){const e=this.p;return(e.filteredRows||e.rows).length},Bn.prototype.getIndexForFilteredRow=function(e){const t=this.p;return(t.filteredRows||t.rows).indexOf(e)},Bn.prototype.getDataForFilteredRow=function(e){const t=this.p;return e<0||e>(t.filteredRows||t.rows).length-1?null:(t.filteredRows||t.rows)[e]},Bn.prototype.getHeaderRowElement=function(){return this.p.headerRow},Bn.prototype._horizontalPadding=function(e){return(parseFloat(Hn.css(e,"padding-left"))||0)+(parseFloat(Hn.css(e,"padding-right"))||0)},Bn.prototype._horizontalBorderWidth=function(e){return(parseFloat(Hn.css(e,"border-left"))||0)+(parseFloat(Hn.css(e,"border-right"))||0)},Bn.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=Hn("<div>").addClass(this.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px"}),d=Hn("<div>").addClass(s+"-header").appendTo(a),u=Hn("<div>").addClass(s+"-header-row").appendTo(d);for(let e=0;e<t.visibleColumns.length;e++)u.append(Hn("<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=Hn(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)},Bn.prototype.tableWidthChanged=function(){let e=function(e){let t,o=this.o.tableClassName,i=Hn("<div>").addClass(this.$el).append(Hn("<div>").addClass(o+"-header").append(Hn("<div>").addClass(o+"-header-row").append(t=Hn("<div>").addClass(o+"-header-cell").append(Hn("<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===Vn.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===Vn.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===Vn.RELATIVE&&(c+=o.width,a++)}if(i.convertColumnWidthsToRelative)for(let e=0;e<n.visibleColumns.length;e++){let t=n.visibleColumns[e];t.widthMode===Vn.AUTO&&(t.widthMode=Vn.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===Vn.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===Vn.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===Vn.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!==Vn.ABSOLUTE||(e+=o.width),o.widthMode===Vn.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!==Vn.ABSOLUTE)if(t.widthMode===Vn.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===Vn.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}}(),Bn.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},Bn.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},Bn.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},Bn.prototype.removeRow=function(e,t){return this.removeRows(e,1,t)},Bn.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},Bn.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)},Bn.prototype.refreshAllVirtualRows=function(){return this.p.virtualListHelper.invalidate().render(),this},Bn.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},Bn.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},Bn.prototype.isWorkerSupported=function(){return window.Worker instanceof Function},Bn.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},Bn.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},Bn.prototype.abortCellPreview=function(){return this.hideCellPreview(),this},Bn.prototype.cancelColumnResize=function(){const e=this.p;return e.$resizer&&(e.$resizer.remove(),e.$resizer=null,Hn(document).off("mousemove.dgtable",e.onMouseMoveResizeAreaBound).off("mouseup.dgtable",e.onEndDragColumnHeaderBound)),this},Bn.prototype._onTableScrolledHorizontally=function(){const e=this.p;e.header.scrollLeft=e.table.scrollLeft},Bn.prototype._getColumnByResizePosition=function(e){let t=this.o,o=this._isTableRtl(),i=Hn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName),n=i[0];n.__cell&&(n=n.__cell,i=Hn(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},Bn.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=Hn(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=Hn.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=>{$n(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=sn(e.originalEvent.changedTouches,(e=>e.identifier===t.currentTouchId));r&&(s(),$n(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=sn(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}))))}))},Bn.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&&Hn(o.$resizer).remove(),o.$resizer=Hn("<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===Tn&&(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){}Hn(document).on("mousemove.dgtable",o.onMouseMoveResizeAreaBound),Hn(document).on("mouseup.dgtable",o.onEndDragColumnHeaderBound),e.preventDefault()}},Bn.prototype._onMouseMoveColumnHeader=function(e){let t=this.o,r=this.p;if(t.resizableColumns){let o=this._getColumnByResizePosition(e),i=Hn(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=""}},Bn.prototype._onMouseUpColumnHeader=function(e){if(3===e.which){let t=this.o,o=Hn(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},Bn.prototype._onMouseLeaveColumnHeader=function(e){let t=this.o;Hn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName)[0].style.cursor=""},Bn.prototype._onClickColumnHeader=function(e){if(!$n(e)&&!this._getColumnByResizePosition(e)){let t=this,r=t.o,o=t.p,i=Hn(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()}}},Bn.prototype._onStartDragColumnHeader=function(e){let t=this.o,r=this.p;if(t.movableColumns){let o=Hn(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()},Bn.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")},Bn.prototype._onEndDragColumnHeader=function(e){let t=this.o,o=this.p;if(o.$resizer){Hn(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===Vn.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===Vn.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},Bn.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=Hn(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])&&Hn(i).addClass("drag-over")}}},Bn.prototype._onDragOverColumnHeader=function(e){e.preventDefault()},Bn.prototype._onDragLeaveColumnHeader=function(e){let t=this.o,r=Hn(e.target).closest("div."+t.tableClassName+"-header-cell,div."+t.cellPreviewClassName);Hn(r[0].firstChild).has(e.originalEvent.relatedTarget).length||r.removeClass("drag-over")},Bn.prototype._onDropColumnHeader=function(e){e.preventDefault();let t=this.o,r=this.p,o=JSON.parse(e.originalEvent.dataTransfer.getData("text")),i=Hn(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)}Hn(i).removeClass("drag-over")},Bn.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},Bn.prototype._showSortArrow=function(e,t){let r=this.p.columns.get(e);if(!r)return!1;let o=Fn("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!==Vn.RELATIVE&&this.o.adjustColumnWidthForSortArrow&&(r.arrowProposedWidth=o.scrollWidth+(parseFloat(Hn(o).css("margin-right"))||0)+(parseFloat(Hn(o).css("margin-left"))||0)),this},Bn.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},Bn.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},Bn.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=Fn("div"),s=Hn(l),a=Fn("div"),d=Hn(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),kn(t.$el),i.width===Bn.Width.SCROLL?this.el.style.overflow="hidden":this.el.style.overflow="",!i.height&&i.virtualTable&&(i.height=r.getElementHeight(this.$el[0],!0)),this},Bn.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;Pn&&(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=Fn("div"),c=Hn(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=Fn("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),Hn(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)),Pn&&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},Bn.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=Fn("div"),t=e.appendChild(Fn("div")),r=t.appendChild(Fn("div"));return e.className=i+"-row",t.className=i+"-cell",r.innerHTML="0",e.style.visibility="hidden",e.style.position="absolute",e},l=Hn("<div>").addClass(e.el.className).css({"z-index":-1,position:"absolute",left:"0",top:"-9999px",width:"1px",overflow:"hidden"}).append(Hn("<div>").addClass(i).append(o=Hn("<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=Fn("div"),s=Hn(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===Bn.Width.SCROLL?"auto":"hidden",n.appendChild(l);let d=Fn("div"),u=Hn(d);d.className=o.tableClassName+"-body",d.style.minHeight="1px",t.table=l,t.tbody=d,t.$table=s,t.$tbody=u,kn(u),kn(s),l.appendChild(d),e.el.appendChild(n),this._setupVirtualTable()}return this},Bn.prototype._renderSkeleton=function(){return this},Bn.prototype._updateVirtualHeight=function(){const e=this.o,t=this.p;return t.tbody?(e.virtualTable?t.tbody.style.height=t.virtualListHelper.estimateFullHeight()+"px":t.tbody.style.height="",this):this},Bn.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},Bn.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===Bn.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===Bn.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},Bn.prototype._isTableRtl=function(){return"rtl"===this.p.$table.css("direction")},Bn.prototype._serializeColumnWidth=function(e){return e.widthMode===Vn.AUTO?"auto":e.widthMode===Vn.RELATIVE?100*e.width+"%":e.width},Bn.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=Hn(e),l=Hn(i);const s=e.parentNode;let a=Fn("div"),d=Hn(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,Hn(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()})),Hn(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)),Pn&&Hn(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(Hn(e).css("border-top-width"))||0)),!o.transparentBgColor1){let e=document.createElement("div");e.style.backgroundColor="transparent",o.transparentBgColor1=Hn(e).css("background-color"),e.style.backgroundColor="rgba(0,0,0,0)",o.transparentBgColor2=Hn(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=Hn(e).css("background-color");t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t=Hn(s).css("background-color")),t!==o.transparentBgColor1&&t!==o.transparentBgColor2||(t="#fff"),b["background-color"]=t}d.css(b),this.el.appendChild(a),Hn(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[xn.call(s.childNodes,e)].name;try{let t=pn.saveSelection(e);t&&pn.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?Hn(document):C,w=n.offset(),_=C.offset(),E="right"===n.css("float"),W=E?"right":"left";if(E){let e=Hn(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(Hn(e).css("border-"+W+"-width"))||0,w.top+=parseFloat(Hn(e).css("border-top-width"))||parseFloat(Hn(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()}))}},Bn.prototype._cellMouseOutEvent=function(e){this.hideCellPreview()},Bn.prototype.hideCellPreview=function(){const e=this.p;if(e.$cellPreviewCell){let t,r=e.$cellPreviewCell[0],o=r.__cell;try{t=pn.saveSelection(r)}catch(e){}e.$cellPreviewCell.remove(),e._unbindCellHoverOut(o),e._unbindCellHoverOut(r);try{t&&pn.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 Vn={AUTO:0,ABSOLUTE:1,RELATIVE:2};Bn.Width={NONE:"none",AUTO:"auto",SCROLL:"scroll"},Hn.controls||(Hn.controls={}),Hn.controls.dgtable=Bn,module.exports=Bn;
6
6
 
7
7
  //# sourceMappingURL=jquery.dgtable.cjs.min.js.map