UNPKG

@visualjs/grid

Version:
1 lines 109 kB
var e,t,s=Object.defineProperty,o=Object.defineProperties,n=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,a=(e,t,o)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,h=(e,t)=>{for(var s in t||(t={}))r.call(t,s)&&a(e,s,t[s]);if(i)for(var s of i(t))l.call(t,s)&&a(e,s,t[s]);return e},d=(e,t)=>o(e,n(t));class u{}class c extends u{}class p extends u{isPopup(){return!1}}class g{}var f,m,_,w,v,C,y,R={},b=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function S(e,t){for(var s in t)e[s]=t[s];return e}function M(e){var t=e.parentNode;t&&t.removeChild(e)}function E(e,t,s){var o,n,i,r={};for(i in t)"key"==i?o=t[i]:"ref"==i?n=t[i]:r[i]=t[i];if(arguments.length>2&&(r.children=arguments.length>3?f.call(arguments,2):s),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===r[i]&&(r[i]=e.defaultProps[i]);return D(e,r,o,n,null)}function D(e,t,s,o,n){var i={type:e,props:t,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==n?++_:n};return null!=m.vnode&&m.vnode(i),i}function N(e){return e.children}function z(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__.__k.indexOf(e)+1):null;for(var s;t<e.__k.length;t++)if(null!=(s=e.__k[t])&&null!=s.__e)return s.__e;return"function"==typeof e.type?k(e):null}function I(e){var t,s;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(s=e.__k[t])&&null!=s.__e){e.__e=e.__c.base=s.__e;break}return I(e)}}function O(e){(!e.__d&&(e.__d=!0)&&w.push(e)&&!T.__r++||C!==m.debounceRendering)&&((C=m.debounceRendering)||v)(T)}function T(){for(var e;T.__r=w.length;)e=w.sort((function(e,t){return e.__v.__b-t.__v.__b})),w=[],e.some((function(e){var t,s,o,n,i,r;e.__d&&(i=(n=(t=e).__v).__e,(r=t.__P)&&(s=[],(o=S({},n)).__v=n.__v+1,W(r,n,o,t.__n,void 0!==r.ownerSVGElement,null!=n.__h?[i]:null,s,null==i?k(n):i,n.__h),X(s,n),n.__e!=i&&I(n)))}))}function P(e,t,s,o,n,i,r,l,a,h){var d,u,c,p,g,f,m,_=o&&o.__k||b,w=_.length;for(s.__k=[],d=0;d<t.length;d++)if(null!=(p=s.__k[d]=null==(p=t[d])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?D(null,p,null,null,p):Array.isArray(p)?D(N,{children:p},null,null,null):p.__b>0?D(p.type,p.props,p.key,null,p.__v):p)){if(p.__=s,p.__b=s.__b+1,null===(c=_[d])||c&&p.key==c.key&&p.type===c.type)_[d]=void 0;else for(u=0;u<w;u++){if((c=_[u])&&p.key==c.key&&p.type===c.type){_[u]=void 0;break}c=null}W(e,p,c=c||R,n,i,r,l,a,h),g=p.__e,(u=p.ref)&&c.ref!=u&&(m||(m=[]),c.ref&&m.push(c.ref,null,p),m.push(u,p.__c||g,p)),null!=g?(null==f&&(f=g),"function"==typeof p.type&&null!=p.__k&&p.__k===c.__k?p.__d=a=L(p,a,e):a=H(e,p,c,_,g,a),h||"option"!==s.type?"function"==typeof s.type&&(s.__d=a):e.value=""):a&&c.__e==a&&a.parentNode!=e&&(a=k(c))}for(s.__e=f,d=w;d--;)null!=_[d]&&("function"==typeof s.type&&null!=_[d].__e&&_[d].__e==s.__d&&(s.__d=k(o,d+1)),U(_[d],_[d]));if(m)for(d=0;d<m.length;d++)j(m[d],m[++d],m[++d])}function L(e,t,s){var o,n;for(o=0;o<e.__k.length;o++)(n=e.__k[o])&&(n.__=e,t="function"==typeof n.type?L(n,t,s):H(s,n,n,e.__k,n.__e,t));return t}function B(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){B(e,t)})):t.push(e)),t}function H(e,t,s,o,n,i){var r,l,a;if(void 0!==t.__d)r=t.__d,t.__d=void 0;else if(null==s||n!=i||null==n.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(n),r=null;else{for(l=i,a=0;(l=l.nextSibling)&&a<o.length;a+=2)if(l==n)break e;e.insertBefore(n,i),r=i}return void 0!==r?r:n.nextSibling}function A(e,t,s){"-"===t[0]?e.setProperty(t,s):e[t]=null==s?"":"number"!=typeof s||x.test(t)?s:s+"px"}function $(e,t,s,o,n){var i;e:if("style"===t)if("string"==typeof s)e.style.cssText=s;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)s&&t in s||A(e.style,t,"");if(s)for(t in s)o&&s[t]===o[t]||A(e.style,t,s[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=s,s?o||e.addEventListener(t,i?F:V,i):e.removeEventListener(t,i?F:V,i);else if("dangerouslySetInnerHTML"!==t){if(n)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==s?"":s;break e}catch(r){}"function"==typeof s||(null!=s&&(!1!==s||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,s):e.removeAttribute(t))}}function V(e){this.l[e.type+!1](m.event?m.event(e):e)}function F(e){this.l[e.type+!0](m.event?m.event(e):e)}function W(e,t,s,o,n,i,r,l,a){var h,d,u,c,p,g,_,w,v,C,y,b=t.type;if(void 0!==t.constructor)return null;null!=s.__h&&(a=s.__h,l=t.__e=s.__e,t.__h=null,i=[l]),(h=m.__b)&&h(t);try{e:if("function"==typeof b){if(w=t.props,v=(h=b.contextType)&&o[h.__c],C=h?v?v.props.value:h.__:o,s.__c?_=(d=t.__c=s.__c).__=d.__E:("prototype"in b&&b.prototype.render?t.__c=d=new b(w,C):(t.__c=d=new z(w,C),d.constructor=b,d.render=Y),v&&v.sub(d),d.props=w,d.state||(d.state={}),d.context=C,d.__n=o,u=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=b.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=S({},d.__s)),S(d.__s,b.getDerivedStateFromProps(w,d.__s))),c=d.props,p=d.state,u)null==b.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==b.getDerivedStateFromProps&&w!==c&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(w,C),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(w,d.__s,C)||t.__v===s.__v){d.props=w,d.state=d.__s,t.__v!==s.__v&&(d.__d=!1),d.__v=t,t.__e=s.__e,t.__k=s.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&r.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(w,d.__s,C),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(c,p,g)}))}d.context=C,d.props=w,d.state=d.__s,(h=m.__r)&&h(t),d.__d=!1,d.__v=t,d.__P=e,h=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(o=S(S({},o),d.getChildContext())),u||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(c,p)),y=null!=h&&h.type===N&&null==h.key?h.props.children:h,P(e,Array.isArray(y)?y:[y],t,s,o,n,i,r,l,a),d.base=t.__e,t.__h=null,d.__h.length&&r.push(d),_&&(d.__E=d.__=null),d.__e=!1}else null==i&&t.__v===s.__v?(t.__k=s.__k,t.__e=s.__e):t.__e=function(e,t,s,o,n,i,r,l){var a,h,d,u=s.props,c=t.props,p=t.type,g=0;if("svg"===p&&(n=!0),null!=i)for(;g<i.length;g++)if((a=i[g])&&(a===e||(p?a.localName==p:3==a.nodeType))){e=a,i[g]=null;break}if(null==e){if(null===p)return document.createTextNode(c);e=n?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,c.is&&c),i=null,l=!1}if(null===p)u===c||l&&e.data===c||(e.data=c);else{if(i=i&&f.call(e.childNodes),h=(u=s.props||R).dangerouslySetInnerHTML,d=c.dangerouslySetInnerHTML,!l){if(null!=i)for(u={},g=0;g<e.attributes.length;g++)u[e.attributes[g].name]=e.attributes[g].value;(d||h)&&(d&&(h&&d.__html==h.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(function(e,t,s,o,n){var i;for(i in s)"children"===i||"key"===i||i in t||$(e,i,null,s[i],o);for(i in t)n&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||s[i]===t[i]||$(e,i,t[i],s[i],o)}(e,c,u,n,l),d)t.__k=[];else if(g=t.props.children,P(e,Array.isArray(g)?g:[g],t,s,o,n&&"foreignObject"!==p,i,r,i?i[0]:s.__k&&k(s,0),l),null!=i)for(g=i.length;g--;)null!=i[g]&&M(i[g]);l||("value"in c&&void 0!==(g=c.value)&&(g!==e.value||"progress"===p&&!g)&&$(e,"value",g,u.value,!1),"checked"in c&&void 0!==(g=c.checked)&&g!==e.checked&&$(e,"checked",g,u.checked,!1))}return e}(s.__e,t,s,o,n,i,r,a);(h=m.diffed)&&h(t)}catch(x){t.__v=null,(a||null!=i)&&(t.__e=l,t.__h=!!a,i[i.indexOf(l)]=null),m.__e(x,t,s)}}function X(e,t){m.__c&&m.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(s){m.__e(s,t.__v)}}))}function j(e,t,s){try{"function"==typeof e?e(t):e.current=t}catch(o){m.__e(o,s)}}function U(e,t,s){var o,n;if(m.unmount&&m.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||j(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){m.__e(i,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&U(o[n],t,"function"!=typeof e.type);s||null==e.__e||M(e.__e),e.__e=e.__d=void 0}function Y(e,t,s){return this.constructor(e,s)}function G(e,t){var s,o,n,i,r,l;s=e,o=t,n=G,m.__&&m.__(s,o),r=(i="function"==typeof n)?null:n&&n.__k||o.__k,l=[],W(o,s=(!i&&n||o).__k=E(N,null,[s]),r||R,R,void 0!==o.ownerSVGElement,!i&&n?[n]:r?null:o.firstChild?f.call(o.childNodes):null,l,!i&&n?n:r?r.__e:o.firstChild,i),X(l,s)}f=b.slice,m={__e:function(e,t){for(var s,o,n;t=t.__;)if((s=t.__c)&&!s.__)try{if((o=s.constructor)&&null!=o.getDerivedStateFromError&&(s.setState(o.getDerivedStateFromError(e)),n=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e),n=s.__d),n)return s.__E=s}catch(i){e=i}throw e}},_=0,z.prototype.setState=function(e,t){var s;s=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=S({},this.state),"function"==typeof e&&(e=e(S({},s),this.props)),e&&S(s,e),null!=e&&this.__v&&(t&&this.__h.push(t),O(this))},z.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},z.prototype.render=N,w=[],v="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,T.__r=0,y=0;const K=(Q={__c:q="__cC"+y++,__:void 0,Consumer:function(e,t){return e.children(t)},Provider:function(e){var t,s;return this.getChildContext||(t=[],(s={})[q]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(O)},this.sub=function(e){t.push(e);var s=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),s&&s.call(e)}}),e.children}}).Provider.__=Q.Consumer.contextType=Q;var q,Q;function Z(e){return E(K.Provider,{value:e.grid},e.children)}var J,ee,te,se=0,oe=[],ne=m.__b,ie=m.__r,re=m.diffed,le=m.__c,ae=m.unmount;function he(e,t){m.__h&&m.__h(ee,e,se||t),se=0;var s=ee.__H||(ee.__H={__:[],__h:[]});return e>=s.__.length&&s.__.push({}),s.__[e]}function de(e){return se=1,function(e,t,s){var o=he(J++,2);return o.t=e,o.__c||(o.__=[s?s(t):ye(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=ee),o.__}(ye,e)}function ue(e,t){var s=he(J++,4);!m.__s&&function(e,t){return!e||e.length!==t.length||t.some((function(t,s){return t!==e[s]}))}(s.__H,t)&&(s.__=e,s.__H=t,ee.__h.push(s))}function ce(e){var t=ee.context[e.__c],s=he(J++,9);return s.c=e,t?(null==s.__&&(s.__=!0,t.sub(ee)),t.props.value):e.__}function pe(){oe.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(ve),e.__H.__h.forEach(Ce),e.__H.__h=[]}catch(Q){e.__H.__h=[],m.__e(Q,e.__v)}})),oe=[]}m.__b=function(e){ee=null,ne&&ne(e)},m.__r=function(e){ie&&ie(e),J=0;var t=(ee=e.__c).__H;t&&(t.__h.forEach(ve),t.__h.forEach(Ce),t.__h=[])},m.diffed=function(e){re&&re(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==oe.push(t)&&te===m.requestAnimationFrame||((te=m.requestAnimationFrame)||function(e){var t,s=function(){clearTimeout(o),we&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(s,100);we&&(t=requestAnimationFrame(s))})(pe)),ee=void 0},m.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ve),e.__h=e.__h.filter((function(e){return!e.__||Ce(e)}))}catch(s){t.some((function(e){e.__h&&(e.__h=[])})),t=[],m.__e(s,e.__v)}})),le&&le(e,t)},m.unmount=function(e){ae&&ae(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(ve)}catch(s){m.__e(s,t.__v)}};var ge,fe,me,_e,we="function"==typeof requestAnimationFrame;function ve(e){var t=ee;"function"==typeof e.__c&&e.__c(),ee=t}function Ce(e){var t=ee;e.__c=e.__(),ee=t}function ye(e,t){return"function"==typeof t?t(e):t}function Re(e){var t,s,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(s=Re(e[t]))&&(o&&(o+=" "),o+=s);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function be(){for(var e,t,s=0,o="";s<arguments.length;)(e=arguments[s++])&&(t=Re(e))&&(o&&(o+=" "),o+=t);return o}let xe;function Se(){return null==xe&&function(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let s=t.offsetWidth-t.clientWidth;0===s&&0===t.clientWidth&&(s=null),t.parentNode&&t.parentNode.removeChild(t),null!=s&&(xe=0===s)}(),xe}(fe=ge||(ge={}))[fe.Left=0]="Left",fe[fe.Middle=1]="Middle",fe[fe.Right=2]="Right",(_e=me||(me={})).clean=function(e){e.innerHTML=""},_e.appendClassName=function(e,t){const s=e.className.split(" ");-1===s.findIndex((e=>e===t))&&(s.push(t),e.className=s.join(" "))},_e.removeClassName=function(e,t){const s=e.className.split(" "),o=s.findIndex((e=>e===t));-1!==o&&(s.splice(o,1),e.className=s.join(" "))},_e.setClassNames=function(e,t){e.className=ke(t)},_e.isInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)};const Me="undefined"==typeof navigator?void 0:navigator,Ee=null==Me?void 0:Me.clipboard,De=null==(e=null==Ee?void 0:Ee.readText)?void 0:e.bind(Ee),Ne=null==(t=null==Ee?void 0:Ee.writeText)?void 0:t.bind(Ee);function ze(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function ke(...e){return be(...e)}function Ie(){var e=0;return function(){return e++}}function Oe(e,...t){return e.filter((e=>t.every((t=>t.indexOf(e)<0))))}function Te(e,...t){return e.filter((e=>t.every((t=>-1!==t.indexOf(e)))))}function Pe(e){return e.filter(((t,s)=>e.indexOf(t,0)===s))}function Le(e,t,s){const o=t<0?e.length+t:t;if(o>=0&&o<e.length){const o=s<0?e.length+s:s,[n]=e.splice(t,1);e.splice(o,0,n)}}function Be(e,t,s,o){const n={state:t(e.getState(),o),getState:()=>n.state,cancel:()=>{}};return n.cancel=e.subscribeAny((()=>{const i=t(e.getState(),o);(function(e,t){if(ze(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(let n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(t,s[n])||!ze(e[s[n]],t[s[n]]))return!1;return!0})(i,n.state)||(n.state=i,s(n.state))})),n}function He(e,t){return function(s){return function(o){const n=ce(K),[i,r]=de(e(n.getState(),{grid:n,props:o})),l=t?t(n):void 0;return ue((()=>Be(n.getRoot(),e,(e=>{r(e)}),{grid:n,props:o}).cancel),[]),E(s,h(h(h({},i),o),l))}}}function Ae(e){return function(t){const s=ce(K);return E(e,h({grid:s},t))}}class $e extends z{constructor(){super(...arguments),this.refs={}}createRef(e){const t={current:null};return this.refs[e]=t,t}}function Ve(e,t){for(var s in e)if("__source"!==s&&!(s in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Fe(e){this.props=e}(Fe.prototype=new z).isPureReactComponent=!0,Fe.prototype.shouldComponentUpdate=function(e,t){return Ve(this.props,e)||Ve(this.state,t)};var We=m.__b;m.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),We&&We(e)};var Xe=m.__e;m.__e=function(e,t,s){if(e.then)for(var o,n=t;n=n.__;)if((o=n.__c)&&o.__c)return null==t.__e&&(t.__e=s.__e,t.__k=s.__k),o.__c(e,t);Xe(e,t,s)};var je=m.unmount;function Ue(){this.__u=0,this.t=null,this.__b=null}function Ye(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Ge(){this.u=null,this.o=null}m.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),je&&je(e)},(Ue.prototype=new z).__c=function(e,t){var s=t.__c,o=this;null==o.t&&(o.t=[]),o.t.push(s);var n=Ye(o.__v),i=!1,r=function(){i||(i=!0,s.__R=null,n?n(l):l())};s.__R=r;var l=function(){if(!--o.__u){if(o.state.__e){var e=o.state.__e;o.__v.__k[0]=function e(t,s,o){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,s,o)})),t.__c&&t.__c.__P===s&&(t.__e&&o.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=o)),t}(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__e:o.__b=null});t=o.t.pop();)t.forceUpdate()}},a=!0===t.__h;o.__u++||a||o.setState({__e:o.__b=o.__v.__k[0]}),e.then(r,r)},Ue.prototype.componentWillUnmount=function(){this.t=[]},Ue.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var s=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,s,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=function(e,t){for(var s in t)e[s]=t[s];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=s),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,s,o)}))),t}(this.__b,s,o.__O=o.__P)}this.__b=null}var n=t.__e&&E(N,null,e.fallback);return n&&(n.__h=null),[E(N,null,t.__e?null:e.children),n]};var Ke=function(e,t,s){if(++s[1]===s[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(s=e.u;s;){for(;s.length>3;)s.pop()();if(s[1]<s[0])break;e.u=s=s[2]}};(Ge.prototype=new z).__e=function(e){var t=this,s=Ye(t.__v),o=t.o.get(e);return o[0]++,function(n){var i=function(){t.props.revealOrder?(o.push(n),Ke(t,e,o)):n()};s?s(i):i()}},Ge.prototype.render=function(e){this.u=null,this.o=new Map;var t=B(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var s=t.length;s--;)this.o.set(t[s],this.u=[1,0,this.u]);return e.children},Ge.prototype.componentDidUpdate=Ge.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,s){Ke(e,s,t)}))};var qe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Qe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ze=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};z.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(z.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Je=m.event;function et(){}function tt(){return this.cancelBubble}function st(){return this.defaultPrevented}m.event=function(e){return Je&&(e=Je(e)),e.persist=et,e.isPropagationStopped=tt,e.isDefaultPrevented=st,e.nativeEvent=e};var ot={configurable:!0,get:function(){return this.class}},nt=m.vnode;m.vnode=function(e){var t=e.type,s=e.props,o=s;if("string"==typeof t){for(var n in o={},s){var i=s[n];"value"===n&&"defaultValue"in s&&null==i||("defaultValue"===n&&"value"in s&&null==s.value?n="value":"download"===n&&!0===i?i="":/ondoubleclick/i.test(n)?n="ondblclick":/^onchange(textarea|input)/i.test(n+t)&&!Ze(s.type)?n="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(n)?n=n.toLowerCase():Qe.test(n)?n=n.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===i&&(i=void 0),o[n]=i)}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=B(s.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==t&&null!=o.defaultValue&&(o.value=B(s.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o}t&&s.class!=s.className&&(ot.enumerable="className"in s,null!=s.className&&(o.class=s.className),Object.defineProperty(o,"className",ot)),e.$$typeof=qe,nt&&nt(e)};var it=m.__r;m.__r=function(e){it&&it(e)};class rt extends Fe{constructor(){super(...arguments),this.refs={}}createRef(e){const t={current:null};return this.refs[e]=t,t}}var lt="v-grid-menu",at="v-grid-menu-separator",ht="v-grid-menu-item",dt="v-grid-menu-disabled-item",ut="v-grid-menu-item-icon",ct="v-grid-menu-item-title";class pt extends $e{constructor(){super(...arguments),this.handleClick=e=>{this.props.disabled||this.props.subMenus||(this.props.action&&this.props.action(),this.props.onClick&&this.props.onClick(e))},this.showSubMenus=()=>{const e=this.refs.self.current,t=e.getBoundingClientRect(),s={x:t.left+e.offsetWidth-2,y:t.top};this.setState({subMenuCoord:s,subMenuVisible:!0})},this.hideSubMenus=()=>{this.setState({subMenuVisible:!1})}}get hasSubMenus(){return this.props.subMenus&&!this.props.disabled}render(){return this.props.separator?E("div",{className:at}):E("div",{className:this.props.disabled?dt:ht,onClick:this.handleClick,onMouseOver:this.hasSubMenus?this.showSubMenus:void 0,onMouseLeave:this.hasSubMenus?this.hideSubMenus:void 0,ref:this.createRef("self")},E("span",{className:ut},E("span",{className:this.props.icon})),E("span",{className:ct},this.props.name),this.hasSubMenus&&E("span",{className:"vg-cheveron-right"}),this.state.subMenuVisible&&E(gt,{onMenuItemClicked:this.props.onClick,coord:this.state.subMenuCoord,items:this.props.subMenus}))}}class gt extends $e{constructor(){super(...arguments),this.componentDidMount=()=>{document.addEventListener("click",this.handleClickoutside),this.edgeCheck()},this.componentWillUnmount=()=>{document.removeEventListener("click",this.handleClickoutside)},this.componentDidUpdate=()=>{this.edgeCheck()},this.handleClickoutside=e=>{this.props.onClickOutside&&!this.refs.self.current.contains(e.target)&&setTimeout((()=>{this.props.onClickOutside()}),0)},this.handleMenuItemClicked=e=>{this.props.onMenuItemClicked&&setTimeout((()=>{this.props.onMenuItemClicked(e)}),0)}}get coord(){return this.props.coord?this.props.coord:{x:0,y:0}}edgeCheck(){if(!me.isInViewport(this.refs.self.current)){const e=this.coord.x-this.refs.self.current.offsetWidth+"px";this.refs.self.current.style.left=e}if(!me.isInViewport(this.refs.self.current)){const e=this.coord.y-this.refs.self.current.offsetHeight+"px";this.refs.self.current.style.top=e}}render(){return E("div",{ref:this.createRef("self"),style:{left:this.coord.x,top:this.coord.y},className:lt},this.props.items.map((e=>E(pt,h({onClick:this.handleMenuItemClicked},e)))))}}var ft="v-grid-header-column",mt="v-grid-header-column-content",_t="v-grid-header-name",wt="v-grid-column-icon",vt="v-grid-column-drag-handle",Ct="v-grid-column-resize-holder";var yt=He(((e,{props:t})=>({options:e.column.columns,data:e.column.groupsData[t.value]})))(Ae(class extends rt{constructor(){super(...arguments),this.toggleCollapsed=()=>{this.props.grid.toggleGroupCollapsed(this.props.value)}}get data(){return this.props.data}render(){const e=this.props.grid.store("column").getGroupWidth(this.props.value,this.props.columns);if(0===e.width)return null;const t={width:e.width};e.flex&&(t.flexGrow=e.flex);const s=ke([wt,this.data.collapsed?"vg-cheveron-right":"vg-cheveron-left"]);return E("div",{className:ft,style:t},E("div",{className:mt},E("span",null,this.data.headerName),this.data.collapsible&&E("span",{onClick:this.toggleCollapsed,className:s})))}}));var Rt=He(((e,{props:t})=>({options:e.column.columns[t.value]})))(Ae(class extends rt{constructor(){super(...arguments),this.bindMetaData=()=>{this.self.__isColumn=!0,this.self.__field=this.options.field},this.handleDragStart=e=>{this.props.onDragStart&&this.props.onDragStart(this.options.field,this.self,e)},this.handleMouseDown=e=>{this.props.onResize&&this.props.onResize(this.options.field,this.self.offsetWidth,e)},this.handleContextMenu=e=>{this.props.onContextMenu&&this.props.onContextMenu(this.props.value,e)}}get options(){return this.props.options}componentDidMount(){this.bindMetaData()}componentDidUpdate(){this.bindMetaData()}render(){const e={width:this.options.width,minWidth:this.options.minWidth};this.options.flex&&(e.flexGrow=this.options.flex);const t={column:this.props.value,grid:this.props.grid},s=be(mt,this.options.headerClass||[],this.options.getHeaderClass?this.options.getHeaderClass(t):[]),o=h(h({},this.options.headerStyle),this.options.getHeaderStyle?this.options.getHeaderStyle(t):{});return E("div",{ref:e=>this.self=e,className:ft,style:e},E("div",{className:s,style:o},this.options.sortable&&E("span",{onMouseDown:this.handleDragStart,className:be(["vg-move",wt,vt])}),E("span",{className:_t},this.options.headerName),this.props.onContextMenu&&E("span",{onClick:this.handleContextMenu,className:`${wt} vg-menu`}),!this.options.flex&&this.options.resizable&&E("div",{ref:this.createRef("resizer"),onMouseDown:this.handleMouseDown,className:Ct})))}}));var bt="v-grid-header",xt="v-grid-header-columns",St="v-grid-header-container",Mt="v-grid-normal-columns",Et="v-grid-pinned-right-columns",Dt="v-grid-pinned-left-columns",Nt="v-grid-column-drag-indicator",zt="v-grid-column-drag-ghost",kt="v-grid-ghost-icon";var It=He((e=>({height:e.column.height,groups:e.column.groups,groupsData:e.column.groupsData})))(Ae(class extends z{constructor(){super(...arguments),this.getActiveColumn=e=>{let t,s=e.target;for(;s!=this.columnsRoot&&s;){if(s.__field&&!0===s.__isColumn){t=s.__field;break}s=s.parentElement}if(t)return s},this.handleDragStart=(e,t,s)=>{var o;if(!this.props.grid.trigger("beforeColumnDragStart",e))return;this.ghost||(this.ghost=document.createElement("div"),this.ghost.className=zt);const n=(null==(o=this.props.grid.getColumnOptions(e))?void 0:o.headerName)||"";this.ghost.innerHTML=`\n <span class="vg-move ${kt}"></span>\n <span>${n}</span>\n `,this.props.grid.appendChild(this.ghost),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd),this.currentDragStartField=e,this.dragIndicator.style.display="block",this.updateDragEndField(t),this.updateDragGhost(s),this.props.grid.trigger("afterColumnDragStart",e)},this.handleDragMove=e=>{this.updateDragGhost(e),this.updateDragEndField(this.getActiveColumn(e))},this.handleDragEnd=()=>{document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd),this.props.grid.removeChild(this.ghost),this.dragIndicator.style.display="none";const e=this.currentDragStartField,t=this.currentDragEndField;this.currentDragStartField=this.currentDragEndField=void 0,this.props.grid.trigger("beforeColumnDragEnd",e,t)&&(this.props.grid.store("column").moveColumn(e,t),this.props.grid.trigger("afterColumnDragEnd",e,t))},this.updateDragGhost=e=>{if(!this.ghost)return;const t=this.props.grid.getRootElement().getBoundingClientRect();this.ghost.style.left=e.clientX-t.left+10+"px",this.ghost.style.top=e.clientY-t.top+10+"px"},this.updateDragEndField=e=>{if(!e)return;const t=this.columnsRoot.getBoundingClientRect(),s=e.getBoundingClientRect();this.currentDragEndField=e.__field,this.dragIndicator.style.left=s.left-t.left+"px",this.dragIndicator.style.height=s.height+"px",this.dragIndicator.style.width=s.width+"px"}}render(){const{columns:e,groups:t}=this.props,s={height:this.props.height,minHeight:this.props.height};return E(N,null,t.map((t=>E("div",{className:xt,style:s},t.map(((t,s)=>E(yt,{key:t+String(s),value:t,columns:e})))))),E("div",{ref:e=>this.columnsRoot=e,className:xt,style:s},E("div",{ref:e=>this.dragIndicator=e,className:Nt}),e.map((e=>{const t=this.props.grid.getColumnMenuItems(e).length>0;return E(Rt,{key:e,value:e,onResize:this.props.onColumnResizeStart,onDragStart:this.handleDragStart,onContextMenu:t?this.props.onColumnContextMenu:void 0})}))))}}));var Ot=He((e=>({pinnedLeftColumns:e.column.pinnedLeftColumns,pinnedRightColumns:e.column.pinnedRightColumns,normalColumns:e.column.normalColumns})))(Ae(class extends rt{constructor(){super(...arguments),this.componentDidMount=()=>{this.resize()},this.componentDidUpdate=()=>{this.resize()},this.resize=()=>{this.props.headerContainerRef.current.style.width="",this.props.headerContainerRef.current.style.width=this.props.headerContainerRef.current.scrollWidth+"px"},this.handleColumnContextMenu=(e,t)=>{const s=this.props.grid.getColumnMenuItems(e);0!==s.length&&(this.setState({isMenuVisible:!0,contextMenuItems:s,contextMenuCoord:{x:t.clientX,y:t.clientY}}),t.stopPropagation())},this.hideContextMenu=()=>{this.state.isMenuVisible&&this.setState({isMenuVisible:!1})}}render(){return E("div",{ref:this.props.headerRef,className:bt},this.props.pinnedLeftColumns.length>0&&E("div",{ref:this.props.pinnedLeftColumnsRef,className:ke([Dt])},E(It,{columns:this.props.pinnedLeftColumns,onColumnResizeStart:this.props.handleColumnResizeStart,onColumnContextMenu:this.handleColumnContextMenu})),E("div",{ref:this.props.normalColumnsRef,className:Mt},E("div",{ref:this.props.headerContainerRef,className:ke([St])},E(It,{columns:this.props.normalColumns,onColumnResizeStart:this.props.handleColumnResizeStart,onColumnContextMenu:this.handleColumnContextMenu}))),this.props.pinnedRightColumns.length>0&&E("div",{ref:this.props.pinnedRightColumnsRef,className:ke([Et])},E(It,{columns:this.props.pinnedRightColumns,onColumnResizeStart:this.props.handleColumnResizeStart,onColumnContextMenu:this.handleColumnContextMenu})),this.state.isMenuVisible&&E(gt,{onMenuItemClicked:this.hideContextMenu,onClickOutside:this.hideContextMenu,coord:this.state.contextMenuCoord,items:this.state.contextMenuItems}))}}));class Tt{each(e){for(let t=this.minY;t<=this.maxY;t++)for(let s=this.minX;s<=this.maxX;s++)if(!1===e({x:s,y:t},{x:s-this.minX,y:t-this.minY}))return}eachRow(e){for(let t=this.minY;t<=this.maxY;t++)if(!1===e(t,t-this.minY))return}getStartCoord(){return{x:this.minX,y:this.minY}}getEndCoord(){return{x:this.maxX,y:this.maxY}}getGlobalCoord(e){return{x:this.minX+e.x,y:this.minY+e.y}}getCellCount(){return(this.maxX-this.minX+1)*(this.maxY-this.minY+1)}contains(e){return!this.isEmpty()&&(e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY)}isLeft(e){return!this.isEmpty()&&e.x==this.minX}isRight(e){return!this.isEmpty()&&e.x==this.maxX}isTop(e){return!this.isEmpty()&&e.y==this.minY}isBottom(e){return!this.isEmpty()&&e.y==this.maxY}}class Pt extends Tt{constructor(e,t){super(),this.start=e,this.end=t,e&&t&&(this.minX=Math.min(e.x,t.x),this.minY=Math.min(e.y,t.y),this.maxX=Math.max(e.x,t.x),this.maxY=Math.max(e.y,t.y))}isEmpty(){return!this.start||!this.end}}class Lt extends Tt{constructor(e,t,s){super(),this.ref=e,this.current=t,this.limit=s,void 0!==this.limit&&e&&t&&!e.contains(t)&&("xy"===this.limit&&(this.limit=Math.abs(t.x-e.end.x)>Math.abs(t.y-e.end.y)?"x":"y"),this.start=e.getStartCoord(),this.end=t,"x"===this.limit?(this.end.y=e.end.y,this.start.x=t.x<e.start.x?e.start.x-1:e.end.x+1):(this.end.x=e.end.x,this.start.y=t.y<e.start.y?e.start.y-1:e.end.y+1),this.minX=Math.min(this.start.x,this.end.x),this.minY=Math.min(this.start.y,this.end.y),this.maxX=Math.max(this.start.x,this.end.x),this.maxY=Math.max(this.start.y,this.end.y))}isEmpty(){return!this.start||!this.end}getReference(){return this.ref}chunk(e){if(this.isEmpty())return;const t=this.ref.getStartCoord(),s=this.ref.getEndCoord(),o=this.minX<t.x||this.minY<t.y;let n=[],i=s.y-t.y,r=o?this.minY:this.maxY,l=o?this.maxY:this.minY;for("x"===this.limit&&(i=s.x-t.x,r=o?this.minX:this.maxX,l=o?this.maxX:this.minX);;){const e="x"===this.limit?{x:l,y:this.minY}:{x:this.minX,y:l};l=o?Math.max(l-i,r):Math.min(l+i,r);const t="x"===this.limit?{x:l,y:this.maxY}:{x:this.maxX,y:l};if(n.push(new Pt(e,t)),l==r)break;l+=o?-1:1}n.forEach((t=>{e(t)}))}}var Bt="v-grid-row-cells",Ht="v-grid-row-stripe-cells",At="v-grid-row-cells-hover",$t="v-grid-row-cells-select";var Vt=Ae(class extends rt{constructor(){super(...arguments),this.self={current:null},this.updateState=()=>{if(!this.self.current)return;const e=this.props.grid.store("row").getRowIndex(this.props.value),t=this.props.grid.state("row").hoveredRow===this.props.value,s=-1!==this.props.grid.state("row").selectedRows.indexOf(this.props.value);e%2==0?me.appendClassName(this.self.current,Ht):me.removeClassName(this.self.current,Ht),t?me.appendClassName(this.self.current,At):me.removeClassName(this.self.current,At),s?me.appendClassName(this.self.current,$t):me.removeClassName(this.self.current,$t)}}componentDidMount(){this.unsubscribe=this.props.grid.store("row").subscribeAny(this.updateState),this.updateState()}componentWillUnmount(){this.unsubscribe()}render(){const e={row:this.props.value,grid:this.props.grid};let t=h(h({},this.props.grid.state("row").rowStyle),this.props.style);this.props.grid.state("row").getRowStyle&&(t=Object.assign({},t,this.props.grid.state("row").getRowStyle(e)));let s=this.props.grid.state("row").rowClass||[];return s.push(Bt),this.props.grid.state("row").getRowClass&&(s=s.concat(this.props.grid.state("row").getRowClass(e))),s=Pe(s),E("div",{ref:this.self,style:t,className:be(s)},this.props.children)}});var Ft="v-grid-cell",Wt="v-grid-cell-content",Xt="v-grid-cell-editing",jt="v-grid-cell-selected",Ut="v-grid-cell-filling",Yt="v-grid-cell-filling-left-boundary",Gt="v-grid-cell-filling-right-boundary",Kt="v-grid-cell-filling-top-boundary",qt="v-grid-cell-filling-bottom-boundary",Qt="v-grid-cell-left-boundary",Zt="v-grid-cell-right-boundary",Jt="v-grid-cell-top-boundary",es="v-grid-cell-bottom-boundary",ts="v-grid-cell-editing-wrapper",ss="v-grid-cell-popup-container",os="v-grid-cell-drag-handle",ns="v-grid-cell-fill-handler",is="v-grid-row-resize-holder";var rs,ls,as,hs,ds,us,cs,ps,gs=Ae(class extends rt{constructor(){super(...arguments),this.cellContent={current:null},this.popup=null,this.isEditing=!1,this.unsubscribes=[],this.componentDidMount=()=>{this.bindMetaData(),this.doRender(),this.unsubscribes.push(this.props.grid.store("cell").subscribeAny((()=>{var e;const t=this.grid.getSelectBoundary(this.props.row,this.props.column),s=(null==(e=this.options)?void 0:e.readonly)?void 0:this.grid.getFillingBoundary(this.props.row,this.props.column);this.setState({fillable:this.grid.state("grid").fillable,isSelected:void 0!==t,isLeftSelected:t&&t.left,isRightSelected:t&&t.right,isTopSelected:t&&t.top,isBottomSelected:t&&t.bottom,isFilling:void 0!==s,isLeftFilling:s&&s.left,isRightFilling:s&&s.right,isTopFilling:s&&s.top,isBottomFilling:s&&s.bottom})}))),this.options.cellEditor&&!this.options.readonly&&this.unsubscribes.push(this.props.grid.store("cell").subscribeAny((()=>{const e=this.props.grid.state("cell").editing,t=Boolean(e&&e.row===this.props.row&&e.column===this.props.column);this.isEditing!==t&&(this.isEditing=t,this.handleCellEditing())})))},this.componentWillUnmount=()=>{this.unsubscribes.forEach((e=>e())),this.props.grid.removeChild(this.popup),this.cellRender&&this.cellRender.beforeDestroy&&this.cellRender.beforeDestroy(),this.cellEditor&&this.cellEditor.beforeDestroy&&this.cellEditor.beforeDestroy()},this.componentDidUpdate=()=>{this.doRender(),this.bindMetaData()},this.bindMetaData=()=>{this.cell.__isCell=!0,this.cell.__column=this.props.column,this.cell.__row=this.props.row,this.dragHandle&&(this.dragHandle.__dragHandle=!0,this.dragHandle.__column=this.props.column,this.dragHandle.__row=this.props.row),this.filler&&(this.filler.__filler=!0,this.filler.__column=this.props.column,this.filler.__row=this.props.row),this.resizer&&(this.resizer.__resizer=!0,this.resizer.__column=this.props.column,this.resizer.__row=this.props.row)},this.handleCellEditing=()=>{if(!this.isEditing)return void(this.cellEditor&&(me.setClassNames(this.cellContent.current,[Wt]),this.setValue(this.cellEditor.getValue()),this.doRender()));const e=document.createElement("div");me.clean(this.cellContent.current),me.appendClassName(this.cellContent.current,Xt),this.cellEditor&&this.cellEditor.beforeDestroy&&this.cellEditor.beforeDestroy(),this.cellEditor=new this.options.cellEditor,this.cellEditor.init&&this.cellEditor.init({props:this.options.cellParams,value:this.getValue(!0),column:this.options,row:this.props.row,gird:this.props.grid}),e.appendChild(this.cellEditor.gui()),e.className=ts,this.cellEditor.isPopup()?this.createPopup(e):this.cellContent.current.appendChild(e),this.cellEditor.afterAttached&&this.cellEditor.afterAttached()},this.createPopup=e=>{this.popup||(this.popup=document.createElement("div"),this.popup.className=ss),me.clean(this.popup);const t=this.props.grid.getRootElement().getBoundingClientRect(),s=this.cell.getBoundingClientRect();this.popup.style.left=s.left-t.left+"px",this.popup.style.top=s.top-t.top+"px",this.popup.style.minWidth=s.width+"px",this.popup.style.minHeight=s.height+"px",this.popup.appendChild(e),this.props.grid.appendChild(this.popup)}}get grid(){return this.props.grid}get options(){return this.grid.getColumnOptions(this.props.column,this.props.row)}getValue(e=!1){return e?this.grid.getRawCellValue(this.props.row,this.props.column):this.props.grid.getCellValue(this.props.row,this.props.column)}setValue(e){this.props.grid.setCellValue(this.props.row,this.props.column,e)}doRender(){this.isEditing||(this.options.cellRender?(this.cellRender&&this.cellRender.beforeDestroy&&this.cellRender.beforeDestroy(),this.cellRender=new this.options.cellRender,this.cellRender.init&&this.cellRender.init({props:this.options.cellParams,value:this.getValue(!0),column:this.options,row:this.props.row,gird:this.props.grid}),this.cellContent.current&&(this.props.grid.removeChild(this.popup),me.clean(this.cellContent.current),this.cellContent.current.appendChild(this.cellRender.gui()),this.cellRender.afterAttached&&this.cellRender.afterAttached())):this.cellContent.current&&(this.cellContent.current.textContent=this.getValue()))}render(){let e=!0===this.options.rowDragable;"function"==typeof this.options.rowDragable&&(e=this.options.rowDragable({row:this.props.row,column:this.props.column,grid:this.props.grid}));const t={column:this.props.column,row:this.props.row,grid:this.props.grid},s=ke(this.options.cellClass||[],this.options.getCellClass?this.options.getCellClass(t):[],{[Ft]:!0,[jt]:this.state.isSelected,[Qt]:this.state.isLeftSelected,[Zt]:this.state.isRightSelected,[Jt]:this.state.isTopSelected,[es]:this.state.isBottomSelected,[Ut]:this.state.isFilling,[Yt]:this.state.isLeftFilling,[Gt]:this.state.isRightFilling,[Kt]:this.state.isTopFilling,[qt]:this.state.isBottomFilling});let o=h({},this.props.style);this.options.cellStyle&&(o=Object.assign({},o,this.options.cellStyle)),this.options.getCellStyle&&(o=Object.assign({},o,this.options.getCellStyle(t))),this.options.flex&&(o.flexGrow=this.options.flex);const n=void 0!==this.state.fillable&&this.state.isBottomSelected&&this.state.isRightSelected;let i=this.grid.state("grid").rowResizable;return"function"==typeof i&&(i=i(this.props.row)),E("div",{ref:e=>this.cell=e,className:s,style:o},e&&E("div",{ref:e=>this.dragHandle=e,className:os},E("span",{className:"vg-move"})),E("div",{ref:this.cellContent,className:Wt}),!!i&&E("div",{ref:e=>this.resizer=e,className:is}),n&&E("div",{ref:e=>this.filler=e,className:ns}))}});(ls=rs||(rs={})).AUTO="auto",ls.START="start",ls.CENTER="center",ls.END="end",(hs=as||(as={})).OBSERVED="observed",hs.REQUESTED="requested",(us=ds||(ds={})).Horizontal="horizontal",us.Vertical="vertical",(ps=cs||(cs={})).Vertical="onScrollVertical",ps.Horizontal="onScrollHorizontal";const fs={[ds.Vertical]:cs.Vertical,[ds.Horizontal]:cs.Horizontal};var ms,_s,ws,vs;(_s=ms||(ms={})).Vertical="scrollTop",_s.Horizontal="scrollLeft",ds.Vertical,ms.Vertical,ds.Horizontal,ms.Horizontal,(vs=ws||(ws={})).Vertical="top",vs.Horizontal="left";const Cs={[ds.Vertical]:ws.Vertical,[ds.Horizontal]:ws.Horizontal};var ys,Rs;(Rs=ys||(ys={})).Vertical="offsetTop",Rs.Horizontal="offsetLeft";const bs={[ds.Vertical]:ys.Vertical,[ds.Horizontal]:ys.Horizontal};var xs,Ss;(Ss=xs||(xs={})).Vertical="scrollYNode",Ss.Horizontal="scrollXNode";const Ms={[ds.Vertical]:xs.Vertical,[ds.Horizontal]:xs.Horizontal};class Es{constructor({itemCount:e,itemSizeGetter:t}){this.itemSizeGetter=t,this.itemCount=e,this.itemSizeAndPositionData={},this.lastMeasuredIndex=-1}updateConfig({itemCount:e,itemSizeGetter:t}){null!=e&&(this.itemCount=e),null!=t&&(this.itemSizeGetter=t)}getLastMeasuredIndex(){return this.lastMeasuredIndex}getSizeAndPositionForIndex(e){if(e<0||e>=this.itemCount){if(0===this.itemCount)return{offset:0,size:0};throw Error(`Requested index ${e} is outside of range 0..${this.itemCount}`)}if(e>this.lastMeasuredIndex){const t=this.getSizeAndPositionOfLastMeasuredItem();let s=t.offset+t.size;for(let o=this.lastMeasuredIndex+1;o<=e;o++){const e=this.itemSizeGetter(o);if(null==e||isNaN(e))throw Error(`Invalid size returned for index ${o} of value ${e}`);this.itemSizeAndPositionData[o]={offset:s,size:e},s+=e}this.lastMeasuredIndex=e}return this.itemSizeAndPositionData[e]}getSizeAndPositionOfLastMeasuredItem(){return this.lastMeasuredIndex>=0?this.itemSizeAndPositionData[this.lastMeasuredIndex]:{offset:0,size:0}}getTotalSize(){const e=this.getSizeAndPositionForIndex(Math.max(this.itemCount-1,0));return e.offset+e.size}getUpdatedOffsetForIndex({align:e=rs.START,containerSize:t,currentOffset:s,targetIndex:o}){if(t<=0)return 0;const n=this.getSizeAndPositionForIndex(o),i=n.offset,r=i-t+n.size;let l;switch(e){case rs.END:l=r;break;case rs.CENTER:l=i-(t-n.size)/2;break;case rs.START:l=i;break;default:l=Math.max(r,Math.min(i,s))}const a=this.getTotalSize();return Math.max(0,Math.min(a-t,l))}getVisibleRange({containerSize:e,offset:t,overscanCount:s}){if(0===this.getTotalSize())return{};const o=t+e;let n=this.findNearestItem(t);if(void 0===n)throw Error(`Invalid offset ${t} specified`);const i=this.getSizeAndPositionForIndex(n);t=i.offset+i.size;let r=n;for(;t<o&&r<this.itemCount-1;)r++,t+=this.getSizeAndPositionForIndex(r).size;return s&&(n=Math.max(0,n-s),r=Math.min(r+s,this.itemCount-1)),{start:n,stop:r}}resetItem(e){this.lastMeasuredIndex=Math.min(this.lastMeasuredIndex,e-1)}findNearestItem(e){if(isNaN(e))throw Error(`Invalid offset ${e} specified`);e=Math.max(0,e);const t=this.getSizeAndPositionOfLastMeasuredItem(),s=Math.max(0,this.lastMeasuredIndex);return t.offset>=e?this.binarySearch({high:s,low:0,offset:e}):this.exponentialSearch({index:s,offset:e})}binarySearch({low:e,high:t,offset:s}){let o=0,n=0;for(;e<=t;){if(o=e+Math.floor((t-e)/2),n=this.getSizeAndPositionForIndex(o).offset,n===s)return o;n<s?e=o+1:n>s&&(t=o-1)}return e>0?e-1:0}exponentialSearch({index:e,offset:t}){let s=1;for(;e<this.itemCount&&this.getSizeAndPositionForIndex(e).offset<t;)e+=s,s*=2;return this.binarySearch({high:Math.min(e,this.itemCount-1),low:Math.floor(e/2),offset:t})}}function Ds(e,t,s,...o){let n,i=new Date;return function(...r){let l=new Date;clearTimeout(n),l.getTime()-i.getTime()>=s?(e(...r,...o),i=l):n=setTimeout((()=>{e(...r,...o)}),t)}}const Ns={width:"100%",height:"100%"},zs={overflowY:"auto",overflowX:"hidden",width:"100%",height:"100%",display:"flex"},ks={position:"relative",overflowX:"auto",overflowY:"hidden",flexGrow:1,minHeight:"100%"},Is={position:"relative",height:"100%"},Os={position:"relative",flexShrink:0,boxSizing:"content-box"},Ts={height:"100%",width:"100%"},Ps={position:"absolute",top:0,left:0,height:"100%",width:"100%"},Ls=100,Bs=100,Hs=3,As=1;class $s extends Fe{constructor(){super(...arguments),this.itemSizeGetter=(e,t)=>s=>this.getSize(t(s),e),this.rowManager=new Es({itemCount:this.props.rows.length,itemSizeGetter:this.itemSizeGetter(this.props.rowHeight,(e=>this.props.rows[e]))}),this.columnManager=new Es({itemCount:this.props.columns.length,itemSizeGetter:this.itemSizeGetter(this.props.columnWidth,(e=>this.props.columns[e]))}),this.rowStyleCache={},this.columnStyleCache={},this.state={offsetLeft:this.props.scrollLeftOffset||null!=this.props.scrollToColumnIndex&&this.getOffsetForColumn(this.props.scrollToColumnIndex)||0,offsetTop:this.props.scrollTopOffset||null!=this.props.scrollToRowIndex&&this.getOffsetForRow(this.props.scrollToRowIndex)||0,scrollChangeReason:as.REQUESTED},this.handleMouseWheel=e=>{0!=e.deltaX&&(e.preventDefault(),0==e.deltaY&&this.props.onWheelHorizontal&&this.props.onWheelHorizontal(e))},this.handleScroll=(e,t)=>{"function"==typeof this.props[fs[t]]&&this.props[fs[t]](e);const s=this.getNodeOffset();s[Cs[t]]<0||e.target!==this[Ms[t]]||this.state[bs[t]]===s[Cs[t]]||this.setState({[bs[t]]:s[Cs[t]],scrollChangeReason:as.OBSERVED})},this.getRootRef=e=>{this.rootNode=e},this.getScrollYRef=e=>{this.scrollYNode=e,this.props.getScrollYNode&&this.props.getScrollYNode(e)},this.getScrollXRef=e=>{this.scrollXNode=e,this.props.getScrollXNode&&this.props.getScrollXNode(e)},this.getPinnedLeftWidth=()=>this.props.pinnedLeftColumns.reduce(((e,t)=>e+this.getSize(t,this.props.columnWidth)),0),this.getPinnedRightWidth=()=>this.props.pinnedRightColumns.reduce(((e,t)=>e+this.getSize(t,this.props.columnWidth)),0)}componentDidMount(){var e,t,s;const{throttleRate:o=Ls,throttleTimeout:n=Bs,scrollLeftOffset:i,scrollToColumnIndex:r,scrollTopOffset:l,scrollToRowIndex:a}=this.props;let h,d;this.onScrollVertical=Ds(this.handleScroll,n,o,ds.Vertical),this.onScrollHorizontal=Ds(this.handleScroll,n,o,ds.Horizontal),null==(e=this.scrollYNode)||e.addEventListener("scroll",this.onScrollVertical,{passive:!0}),null==(t=this.scrollXNode)||t.addEventListener("scroll",this.onScrollHorizontal,{passive:!0}),null==(s=this.scrollXNode)||s.addEventListener("wheel",this.handleMouseWheel,{passive:!1}),null!=i?h=i:null!=r&&(h=this.getOffsetForColumn(r)),null!=l?d=l:null!=a&&(d=this.getOffsetForRow(a)),this.scrollTo({left:h,top:d}),this.forceUpdate()}componentWillReceiveProps(e){const{rows:t,columns:s,rowHeight:o,columnWidth:n,scrollTopOffset:i,scrollLeftOffset:r,scrollToRowAlignment:l,scrollToColumnAlignment:a,scrollToRowIndex:h,scrollToColumnIndex:d}=this.props,u=e.scrollToRowIndex!==h||e.scrollToColumnIndex!==d||e.scrollToRowAlignment!==l||e.scrollToColumnAlignment!==a,c=e.rows!==t||e.columns!==s||e.rowHeight!==o||e.columnWidth!==n;e.rowHeight!==o&&this.rowManager.updateConfig({itemSizeGetter:this.itemSizeGetter(e.rowHeight,(t=>e.rows[t]))}),e.columnWidth!==n&&this.columnManager.updateConfig({itemSizeGetter:this.itemSizeGetter(e.columnWidth,(t=>e.columns[t]))}),e.rows!==t&&this.rowManager.updateConfig({itemCount:e.rows.length}),e.columns!==s&&this.columnManager.updateConfig({itemCount:e.columns.length}),c&&this.recomputeSizes(),e.scrollLeftOffset!==r||e.scrollTopOffset!=i?this.setState({offsetLeft:e.scrollLeftOffset||0,offsetTop:e.scrollTopOffset||0,scrollChangeReason:as.REQUESTED}):u?this.setState({offsetLeft:this.getOffsetForColumn(e.scrollToColumnIndex||0,e.scrollToColumnAlignment,e.columns.length),offsetTop:this.getOffsetForRow(e.scrollToRowIndex||0,e.scrollToRowAlignment,e.rows.length),scrollChangeReason:as.REQUESTED}):c&&this.forceUpdate()}componentDidUpdate(e,t){const s=this.scrollXNode.parentNode,o=Math.max(this.scrollXNode.offsetHeight-this.scrollXNode.clientHeight,17);this.scrollXNode.style.height=s.offsetHeight+o+"px";const{offsetLeft:n,offsetTop:i,scrollChangeReason:r}=this.state;t.offsetLeft===n&&t.offsetTop==i||r!==as.REQUESTED||this.scrollTo({left:n,top:i})}componentWillUnmount(){var e,t,s;null==(e=this.scrollYNode)||e.removeEventListener("scroll",this.onScrollVertical),null==(t=this.scrollXNode)||t.removeEventListener("scroll",this.onScrollHorizontal),null==(s=this.scrollXNode)||s.removeEventListener("wheel",this.handleMouseWheel)}scrollTo({top:e,left:t}){null!=e&&this.scrollYNode&&(this.scrollYNode.scrollTop=e),null!=t&&this.scrollXNode&&(this.scrollXNode.scrollLeft=t)}getOffsetForColumn(e,t=this.props.scrollToColumnAlignment,s=this.props.columns.length){var o;return(e<0||e>=s)&&(e=0),this.columnManager.getUpdatedOffsetForIndex({align:t,containerSize:(null==(o=this.scrollXNode)?void 0:o.offsetWidth)||0,currentOffset:this.state&&this.state.offsetLeft||0,targetIndex:e})}getOffsetForRow(e,t=this.props.scrollToRowAlignment,s=this.props.rows.length){var o;return(e<0||e>=s)&&(e=0),this.rowManager.getUpdatedOffsetForIndex({align:t,containerSize:(null==(o=this.rootNode)?void 0:o.offsetHeight)||0,currentOffset:this.state&&this.state.offsetTop||0,targetIndex:e})}recomputeSizes(e=0,t=0){this.rowStyleCache={},this.columnStyleCache={},this.rowManager.resetItem(e),this.columnManager.resetItem(t)}getSize(e,t){return"function"==typeof t?t(e):"number"==typeof t?t:t[e]}getRowStyle(e){const t=this.props.rows[e],s=this.rowStyleCache[t];if(s)return s;const{size:o,offset:n}=this.rowManager.getSizeAndPositionForIndex(e);return this.rowStyleCache[t]=d(h({},Ps),{height:o,transform:`translateY(${n}px)`})}getColumnStyle(e){const t=this.props.columns[e],s=this.columnStyleCache[t];if(s)return s;const{size:o,offset:n}=this.columnManager.getSizeAndPositionForIndex(e);return this.columnStyleCache[t]=d(h({},Ps),{width:o,left:n})}getPinnedColumnStyle(e){const t=this.columnStyleCache[e];if(t)return t;const s=this.getSize(e,this.props.columnWidth);return this.columnStyleCache[e]=d(h({},Ts),{width:s})}getNodeOffset(){var e,t;return{top:(null==(e=this.scrollYNode)?void 0:e.scrollTop)||0,left:(null==(t=this.scrollXNode)?void 0:t.scrollLeft)||0}}render(){var e,t;const{style:s,pinnedLeftColumns:o=[],pinnedRightColumns:n=[],overscanRowCount:i=Hs,overscanColumnCount:r=As,renderRow:l,renderCell:a}=this.props,u={className:this.props.className,children:this.props.children},{offsetLeft:c,offsetTop:p}=this.state,g=this.rowManager.getVisibleRange({containerSize:(null==(e=this.rootNode)?void 0:e.offsetHeight)||0,offset:p,overscanCount:i}),f=this.columnManager.getVisibleRange({containerSize:(null==(t=this.scrollXNode)?void 0:t.offsetWidth)||0,offset:c,overscanCount:r}),m=this.columnManager.getTotalSize(),_=this.rowManager.getTotalSize(),w=this.getPinnedLeftWidth(),v=this.getPinnedRightWidth(),C=[],y=[],R=[];if(null!=g.start&&null!=g.stop)for(let b=g.start;b<=g.stop;b++){const e=this.props.rows[b],t=[],s=o.map((t=>a({style:this.getPinnedColumnStyle(t),column:t,row:e}))),i=n.map((t=>a({style:this.getPinnedColumnStyle(t),column:t,row:e})));if(null!=f.start&&null!=f.stop)for(let o=f.start;o<=f.stop;o++){const s=this.props.columns[o];t.push(a({style:this.getColumnStyle(o),row:e,column:s}))}const r=this.getRowStyle(b);s.length>0&&y.push(l({style:d(h({},r),{display:"flex"}),row:e,cells:s})),i.length>0&&R