visual-grid
Version:
JavaScript Data Table
1 lines • 62.9 kB
JavaScript
var e,t,n=Object.defineProperty,s=Object.defineProperties,i=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,a=(e,t,s)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,h=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))l.call(t,n)&&a(e,n,t[n]);return e},u=(e,t)=>s(e,i(t));class c{}class d extends c{}class p extends c{isPopup(){return!1}}class f{}var _,m,g,v,y,C,w,b={},x=[],R=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function E(e,t){for(var n in t)e[n]=t[n];return e}function M(e){var t=e.parentNode;t&&t.removeChild(e)}function k(e,t,n){var s,i,o,r={};for(o in t)"key"==o?s=t[o]:"ref"==o?i=t[o]:r[o]=t[o];if(arguments.length>2&&(r.children=arguments.length>3?_.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===r[o]&&(r[o]=e.defaultProps[o]);return S(e,r,s,i,null)}function S(e,t,n,s,i){var o={type:e,props:t,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++g:i};return null!=m.vnode&&m.vnode(o),o}function O(e){return e.children}function L(e,t){this.props=e,this.context=t}function N(e,t){if(null==t)return e.__?N(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?N(e):null}function I(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return I(e)}}function D(e){(!e.__d&&(e.__d=!0)&&v.push(e)&&!z.__r++||C!==m.debounceRendering)&&((C=m.debounceRendering)||y)(z)}function z(){for(var e;z.__r=v.length;)e=v.sort((function(e,t){return e.__v.__b-t.__v.__b})),v=[],e.some((function(e){var t,n,s,i,o,r;e.__d&&(o=(i=(t=e).__v).__e,(r=t.__P)&&(n=[],(s=E({},i)).__v=i.__v+1,U(r,i,s,t.__n,void 0!==r.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?N(i):o,i.__h),W(n,i),i.__e!=o&&I(i)))}))}function $(e,t,n,s,i,o,r,l,a,h){var u,c,d,p,f,_,m,g=s&&s.__k||x,v=g.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(p=n.__k[u]=null==(p=t[u])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?S(null,p,null,null,p):Array.isArray(p)?S(O,{children:p},null,null,null):p.__b>0?S(p.type,p.props,p.key,null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(d=g[u])||d&&p.key==d.key&&p.type===d.type)g[u]=void 0;else for(c=0;c<v;c++){if((d=g[c])&&p.key==d.key&&p.type===d.type){g[c]=void 0;break}d=null}U(e,p,d=d||b,i,o,r,l,a,h),f=p.__e,(c=p.ref)&&d.ref!=c&&(m||(m=[]),d.ref&&m.push(d.ref,null,p),m.push(c,p.__c||f,p)),null!=f?(null==_&&(_=f),"function"==typeof p.type&&null!=p.__k&&p.__k===d.__k?p.__d=a=H(p,a,e):a=B(e,p,d,g,f,a),h||"option"!==n.type?"function"==typeof n.type&&(n.__d=a):e.value=""):a&&d.__e==a&&a.parentNode!=e&&(a=N(d))}for(n.__e=_,u=v;u--;)null!=g[u]&&("function"==typeof n.type&&null!=g[u].__e&&g[u].__e==n.__d&&(n.__d=N(s,u+1)),X(g[u],g[u]));if(m)for(u=0;u<m.length;u++)T(m[u],m[++u],m[++u])}function H(e,t,n){var s,i;for(s=0;s<e.__k.length;s++)(i=e.__k[s])&&(i.__=e,t="function"==typeof i.type?H(i,t,n):B(n,i,i,e.__k,i.__e,t));return t}function V(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){V(e,t)})):t.push(e)),t}function B(e,t,n,s,i,o){var r,l,a;if(void 0!==t.__d)r=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),r=null;else{for(l=o,a=0;(l=l.nextSibling)&&a<s.length;a+=2)if(l==i)break e;e.insertBefore(i,o),r=o}return void 0!==r?r:i.nextSibling}function j(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||R.test(t)?n:n+"px"}function P(e,t,n,s,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof s&&(e.style.cssText=s=""),s)for(t in s)n&&t in n||j(e.style,t,"");if(n)for(t in n)s&&n[t]===s[t]||j(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?s||e.addEventListener(t,o?F:A,o):e.removeEventListener(t,o?F:A,o);else if("dangerouslySetInnerHTML"!==t){if(i)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==n?"":n;break e}catch(r){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function A(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 U(e,t,n,s,i,o,r,l,a){var h,u,c,d,p,f,g,v,y,C,w,x=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(a=n.__h,l=t.__e=n.__e,t.__h=null,o=[l]),(h=m.__b)&&h(t);try{e:if("function"==typeof x){if(v=t.props,y=(h=x.contextType)&&s[h.__c],C=h?y?y.props.value:h.__:s,n.__c?g=(u=t.__c=n.__c).__=u.__E:("prototype"in x&&x.prototype.render?t.__c=u=new x(v,C):(t.__c=u=new L(v,C),u.constructor=x,u.render=Y),y&&y.sub(u),u.props=v,u.state||(u.state={}),u.context=C,u.__n=s,c=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=x.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=E({},u.__s)),E(u.__s,x.getDerivedStateFromProps(v,u.__s))),d=u.props,p=u.state,c)null==x.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==x.getDerivedStateFromProps&&v!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(v,C),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(v,u.__s,C)||t.__v===n.__v){u.props=v,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),u.__h.length&&r.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(v,u.__s,C),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,p,f)}))}u.context=C,u.props=v,u.state=u.__s,(h=m.__r)&&h(t),u.__d=!1,u.__v=t,u.__P=e,h=u.render(u.props,u.state,u.context),u.state=u.__s,null!=u.getChildContext&&(s=E(E({},s),u.getChildContext())),c||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(d,p)),w=null!=h&&h.type===O&&null==h.key?h.props.children:h,$(e,Array.isArray(w)?w:[w],t,n,s,i,o,r,l,a),u.base=t.__e,t.__h=null,u.__h.length&&r.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,s,i,o,r,l){var a,h,u,c=n.props,d=t.props,p=t.type,f=0;if("svg"===p&&(i=!0),null!=o)for(;f<o.length;f++)if((a=o[f])&&(a===e||(p?a.localName==p:3==a.nodeType))){e=a,o[f]=null;break}if(null==e){if(null===p)return document.createTextNode(d);e=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,d.is&&d),o=null,l=!1}if(null===p)c===d||l&&e.data===d||(e.data=d);else{if(o=o&&_.call(e.childNodes),h=(c=n.props||b).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!l){if(null!=o)for(c={},f=0;f<e.attributes.length;f++)c[e.attributes[f].name]=e.attributes[f].value;(u||h)&&(u&&(h&&u.__html==h.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,s,i){var o;for(o in n)"children"===o||"key"===o||o in t||P(e,o,null,n[o],s);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||P(e,o,t[o],n[o],s)}(e,d,c,i,l),u)t.__k=[];else if(f=t.props.children,$(e,Array.isArray(f)?f:[f],t,n,s,i&&"foreignObject"!==p,o,r,o?o[0]:n.__k&&N(n,0),l),null!=o)for(f=o.length;f--;)null!=o[f]&&M(o[f]);l||("value"in d&&void 0!==(f=d.value)&&(f!==e.value||"progress"===p&&!f)&&P(e,"value",f,c.value,!1),"checked"in d&&void 0!==(f=d.checked)&&f!==e.checked&&P(e,"checked",f,c.checked,!1))}return e}(n.__e,t,n,s,i,o,r,a);(h=m.diffed)&&h(t)}catch(R){t.__v=null,(a||null!=o)&&(t.__e=l,t.__h=!!a,o[o.indexOf(l)]=null),m.__e(R,t,n)}}function W(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(n){m.__e(n,t.__v)}}))}function T(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(s){m.__e(s,n)}}function X(e,t,n){var s,i;if(m.unmount&&m.unmount(e),(s=e.ref)&&(s.current&&s.current!==e.__e||T(s,null,t)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(o){m.__e(o,t)}s.base=s.__P=null}if(s=e.__k)for(i=0;i<s.length;i++)s[i]&&X(s[i],t,"function"!=typeof e.type);n||null==e.__e||M(e.__e),e.__e=e.__d=void 0}function Y(e,t,n){return this.constructor(e,n)}function q(e,t){var n,s,i,o,r,l;n=e,s=t,i=q,m.__&&m.__(n,s),r=(o="function"==typeof i)?null:i&&i.__k||s.__k,l=[],U(s,n=(!o&&i||s).__k=k(O,null,[n]),r||b,b,void 0!==s.ownerSVGElement,!o&&i?[i]:r?null:s.firstChild?_.call(s.childNodes):null,l,!o&&i?i:r?r.__e:s.firstChild,o),W(l,n)}_=x.slice,m={__e:function(e,t){for(var n,s,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(o){e=o}throw e}},g=0,L.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=E({},this.state),"function"==typeof e&&(e=e(E({},n),this.props)),e&&E(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),D(this))},L.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),D(this))},L.prototype.render=O,v=[],y="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,z.__r=0,w=0;const K=(Z={__c:G="__cC"+w++,__:void 0,Consumer:function(e,t){return e.children(t)},Provider:function(e){var t,n;return this.getChildContext||(t=[],(n={})[G]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(D)},this.sub=function(e){t.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),n&&n.call(e)}}),e.children}}).Provider.__=Z.Consumer.contextType=Z;var G,Z;function J(e){return k(K.Provider,{value:e.grid},e.children)}var Q,ee,te,ne=0,se=[],ie=m.__b,oe=m.__r,re=m.diffed,le=m.__c,ae=m.unmount;function he(e,t){m.__h&&m.__h(ee,e,ne||t),ne=0;var n=ee.__H||(ee.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ue(e){return ne=1,function(e,t,n){var s=he(Q++,2);return s.t=e,s.__c||(s.__=[n?n(t):we(void 0,t),function(e){var t=s.t(s.__[0],e);s.__[0]!==t&&(s.__=[t,s.__[1]],s.__c.setState({}))}],s.__c=ee),s.__}(we,e)}function ce(e,t){var n=he(Q++,4);!m.__s&&function(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}(n.__H,t)&&(n.__=e,n.__H=t,ee.__h.push(n))}function de(e){var t=ee.context[e.__c],n=he(Q++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ee)),t.props.value):e.__}function pe(){se.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(ye),e.__H.__h.forEach(Ce),e.__H.__h=[]}catch(Z){e.__H.__h=[],m.__e(Z,e.__v)}})),se=[]}m.__b=function(e){ee=null,ie&&ie(e)},m.__r=function(e){oe&&oe(e),Q=0;var t=(ee=e.__c).__H;t&&(t.__h.forEach(ye),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!==se.push(t)&&te===m.requestAnimationFrame||((te=m.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(s),ve&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(n,100);ve&&(t=requestAnimationFrame(n))})(pe)),ee=void 0},m.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ye),e.__h=e.__h.filter((function(e){return!e.__||Ce(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],m.__e(n,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(ye)}catch(n){m.__e(n,t.__v)}};var fe,_e,me,ge,ve="function"==typeof requestAnimationFrame;function ye(e){var t=ee;"function"==typeof e.__c&&e.__c(),ee=t}function Ce(e){var t=ee;e.__c=e.__(),ee=t}function we(e,t){return"function"==typeof t?t(e):t}(_e=fe||(fe={}))[_e.Left=0]="Left",_e[_e.Middle=1]="Middle",_e[_e.Right=2]="Right",(ge=me||(me={})).clean=function(e){e.innerHTML=""},ge.appendClassName=function(e,t){const n=e.className.split(" ");-1===n.findIndex((e=>e===t))&&(n.push(t),e.className=n.join(" "))},ge.removeClassName=function(e,t){const n=e.className.split(" "),s=n.findIndex((e=>e===t));-1!==s&&(n.splice(s,1),e.className=n.join(" "))},ge.setClassNames=function(e,t){e.className=ke(t)},ge.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 be="undefined"==typeof navigator?void 0:navigator,xe=null==be?void 0:be.clipboard,Re=null==(e=null==xe?void 0:xe.readText)?void 0:e.bind(xe),Ee=null==(t=null==xe?void 0:xe.writeText)?void 0:t.bind(xe);function Me(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function ke(e){if(Array.isArray(e))return e.join(" ");if("object"==typeof e){const t=[];for(let n in e)!0===e[n]&&t.push(n);return t.join(" ")}return e}function Se(e,t,n,s){const i={state:t(e.getState(),s),getState:()=>i.state,cancel:()=>{}};return i.cancel=e.subscribeAny((()=>{const o=t(e.getState(),s);(function(e,t){if(Me(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!Me(e[n[i]],t[n[i]]))return!1;return!0})(o,i.state)||(i.state=o,n(i.state))})),i}function Oe(e,t){return function(n){return function(s){const i=de(K),[o,r]=ue(e(i.getState(),{grid:i,props:s})),l=t?t(i):void 0;return ce((()=>Se(i.api(),e,(e=>{r(e)}),{grid:i,props:s}).cancel),[]),k(n,h(h(h({},o),s),l))}}}function Le(e){return function(t){const n=de(K);return k(e,h({grid:n},t))}}class Ne extends L{constructor(){super(...arguments),this.refs={}}createRef(e){const t={current:null};return this.refs[e]=t,t}}var Ie="v-grid-list-container",De="v-grid-list-view";class ze extends Ne{constructor(e){super(e),this.timer=null,this.componentDidMount=()=>{this.update(),this.io.observe(this.refs.start.current),this.io.observe(this.refs.end.current)},this.componentWillUnmount=()=>{this.io.disconnect()},this.update=()=>{this.setState({})},this.handleScroll=()=>{clearTimeout(this.timer),setTimeout(this.update,100)},this.io=new IntersectionObserver((e=>{this.update()}))}render(){var e,t;const n=this.props.items.length*this.props.itemHeight,s=null==(e=this.refs.container)?void 0:e.current.clientHeight,i=null==(t=this.refs.container)?void 0:t.current.scrollTop,o=this.props.itemHeight,r=Math.ceil(s/o),l=Math.floor(i/o),a=l+r,h=Math.max(0,l-this.props.preLoadCount),u=Math.min(this.props.items.length,a+this.props.preLoadCount),c=h*o;return k("div",{ref:this.createRef("container"),className:Ie,onScroll:this.handleScroll},k("div",{style:{height:n}}),k("div",{style:{top:c},className:De},k("div",{ref:this.createRef("start")}),this.props.render(this.props.items.slice(h,u)),k("div",{ref:this.createRef("end")})))}}function $e(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var s in t)if("__source"!==s&&e[s]!==t[s])return!0;return!1}function He(e){this.props=e}(He.prototype=new L).isPureReactComponent=!0,He.prototype.shouldComponentUpdate=function(e,t){return $e(this.props,e)||$e(this.state,t)};var Ve=m.__b;m.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ve&&Ve(e)};var Be=m.__e;m.__e=function(e,t,n){if(e.then)for(var s,i=t;i=i.__;)if((s=i.__c)&&s.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),s.__c(e,t);Be(e,t,n)};var je=m.unmount;function Pe(){this.__u=0,this.t=null,this.__b=null}function Ae(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Fe(){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)},(Pe.prototype=new L).__c=function(e,t){var n=t.__c,s=this;null==s.t&&(s.t=[]),s.t.push(n);var i=Ae(s.__v),o=!1,r=function(){o||(o=!0,n.__R=null,i?i(l):l())};n.__R=r;var l=function(){if(!--s.__u){if(s.state.__e){var e=s.state.__e;s.__v.__k[0]=function e(t,n,s){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,s)})),t.__c&&t.__c.__P===n&&(t.__e&&s.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=s)),t}(e,e.__c.__P,e.__c.__O)}var t;for(s.setState({__e:s.__b=null});t=s.t.pop();)t.forceUpdate()}},a=!0===t.__h;s.__u++||a||s.setState({__e:s.__b=s.__v.__k[0]}),e.then(r,r)},Pe.prototype.componentWillUnmount=function(){this.t=[]},Pe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,s){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 n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===s&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,s)}))),t}(this.__b,n,s.__O=s.__P)}this.__b=null}var i=t.__e&&k(O,null,e.fallback);return i&&(i.__h=null),[k(O,null,t.__e?null:e.children),i]};var Ue=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(Fe.prototype=new L).__e=function(e){var t=this,n=Ae(t.__v),s=t.o.get(e);return s[0]++,function(i){var o=function(){t.props.revealOrder?(s.push(i),Ue(t,e,s)):i()};n?n(o):o()}},Fe.prototype.render=function(e){this.u=null,this.o=new Map;var t=V(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Fe.prototype.componentDidUpdate=Fe.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Ue(e,n,t)}))};var We="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Te=/^(?: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]/,Xe=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};L.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(L.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Ye=m.event;function qe(){}function Ke(){return this.cancelBubble}function Ge(){return this.defaultPrevented}m.event=function(e){return Ye&&(e=Ye(e)),e.persist=qe,e.isPropagationStopped=Ke,e.isDefaultPrevented=Ge,e.nativeEvent=e};var Ze={configurable:!0,get:function(){return this.class}},Je=m.vnode;m.vnode=function(e){var t=e.type,n=e.props,s=n;if("string"==typeof t){for(var i in s={},n){var o=n[i];"value"===i&&"defaultValue"in n&&null==o||("defaultValue"===i&&"value"in n&&null==n.value?i="value":"download"===i&&!0===o?o="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!Xe(n.type)?i="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(i)?i=i.toLowerCase():Te.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),s[i]=o)}"select"==t&&s.multiple&&Array.isArray(s.value)&&(s.value=V(n.children).forEach((function(e){e.props.selected=-1!=s.value.indexOf(e.props.value)}))),"select"==t&&null!=s.defaultValue&&(s.value=V(n.children).forEach((function(e){e.props.selected=s.multiple?-1!=s.defaultValue.indexOf(e.props.value):s.defaultValue==e.props.value}))),e.props=s}t&&n.class!=n.className&&(Ze.enumerable="className"in n,null!=n.className&&(s.class=n.className),Object.defineProperty(s,"className",Ze)),e.$$typeof=We,Je&&Je(e)};var Qe=m.__r;m.__r=function(e){Qe&&Qe(e)};class et extends He{constructor(){super(...arguments),this.refs={}}createRef(e){const t={current:null};return this.refs[e]=t,t}}var tt="v-grid-header-column",nt="v-grid-column-resize-holder";var st=Oe(((e,{props:t})=>({options:e.column.columns[t.value]})))(class extends et{constructor(){super(...arguments),this.handleMouseDown=e=>{this.props.onResize&&this.props.onResize(this.options.field,this.refs.column.current.offsetWidth,e)}}get options(){return this.props.options}render(){const e={width:this.options.width};return this.options.flex&&(e.flexGrow=this.options.flex),k("div",{ref:this.createRef("column"),className:tt,style:e},k("span",null,this.options.headerName),void 0===this.options.flex&&this.options.resizable&&k("div",{ref:this.createRef("resizer"),onMouseDown:this.handleMouseDown,className:nt}))}});var it="v-grid-cell",ot="v-grid-cell-content",rt="v-grid-cell-editing",lt="v-grid-cell-selected",at="v-grid-cell-filling",ht="v-grid-cell-filling-left-boundary",ut="v-grid-cell-filling-right-boundary",ct="v-grid-cell-filling-top-boundary",dt="v-grid-cell-filling-bottom-boundary",pt="v-grid-cell-left-boundary",ft="v-grid-cell-right-boundary",_t="v-grid-cell-top-boundary",mt="v-grid-cell-bottom-boundary",gt="v-grid-cell-editing-wrapper",vt="v-grid-cell-editing-popup",yt="v-grid-cell-fill-handler";var Ct=Oe(((e,{grid:t,props:n})=>{const s=e.column.columns[n.column],i=null==s?void 0:s.readonly,o=i?void 0:t.getSelectBoundary(n.row,n.column),r=i?void 0:t.getFillingBoundary(n.row,n.column);return{rawValue:t.getRawCellValue(n.row,n.column),isSelected:void 0!==o,isLeftSelected:o&&o.left,isRightSelected:o&&o.right,isTopSelected:o&&o.top,isBottomSelected:o&&o.bottom,isFilling:void 0!==r,isLeftFilling:r&&r.left,isRightFilling:r&&r.right,isTopFilling:r&&r.top,isBottomFilling:r&&r.bottom,options:s,fillable:e.grid.fillable}}))(Le(class extends et{constructor(e){super(e),this.cell={current:null},this.cellContent={current:null},this.isEditing=!1,this.timer=null,this.componentDidMount=()=>{this.io.observe(this.cell.current),this.options.cellEditor&&!this.options.readonly&&(this.unsubscribeEditing=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.unsubscribeEditing&&this.unsubscribeEditing(),this.io.disconnect(),this.timer&&(clearTimeout(this.timer),this.timer=null)},this.componentDidUpdate=()=>{this.doRender()},this.handleMouseDown=e=>{this.isEditing||this.props.onMouseDown&&this.props.onMouseDown(e,this.props.row,this.props.column)},this.handleMouseMove=e=>{this.isEditing||this.props.onMouseMove&&this.props.onMouseMove(e,this.props.row,this.props.column)},this.handleMouseUp=e=>{this.isEditing||this.props.onMouseUp&&this.props.onMouseUp(e,this.props.row,this.props.column)},this.handleDbClick=e=>{this.props.onDbClick&&this.props.onDbClick(e,this.props.row,this.props.column)},this.handleFillerMouseDown=e=>{e.stopPropagation(),this.props.onFillerMouseDown&&this.props.onFillerMouseDown(e,this.props.row,this.props.column)},this.handleCellEditing=()=>{if(!this.isEditing)return void(this.editor&&(me.setClassNames(this.cellContent.current,[ot]),this.setValue(this.editor.getValue()),this.doRender()));const e=document.createElement("div");me.clean(this.cellContent.current),me.appendClassName(this.cellContent.current,rt),this.editor||(this.editor=new this.options.cellEditor),this.editor.isPopup()?e.className=`${gt} ${vt}`:e.className=gt,this.editor.init&&this.editor.init({props:this.options.cellParams,value:this.getValue(!0),column:this.options,row:this.props.row,gird:this.props.grid}),e.appendChild(this.editor.gui()),this.cellContent.current.appendChild(e),this.editor.afterAttached&&this.editor.afterAttached()},this.io=new IntersectionObserver((e=>{e[0].isIntersecting&&(this.doRender(),this.io.disconnect())}),{threshold:1e-6})}get options(){return this.props.options}getValue(e=!1){return e?this.props.rawValue: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.timer=setTimeout((()=>{if(this.props.options.cellRender){const e=new this.props.options.cellRender;if(e.init&&e.init({props:this.props.options.cellParams,value:this.getValue(!0),column:this.props.options,row:this.props.row,gird:this.props.grid}),this.timer=null,!this.cellContent.current)return;me.clean(this.cellContent.current),this.cellContent.current.appendChild(e.gui()),e.afterAttached&&e.afterAttached()}else this.cellContent.current&&(this.cellContent.current.textContent=this.getValue())}),0))}render(){const e=ke({[it]:!0,[lt]:this.props.isSelected,[pt]:this.props.isLeftSelected,[ft]:this.props.isRightSelected,[_t]:this.props.isTopSelected,[mt]:this.props.isBottomSelected,[at]:this.props.isFilling,[ht]:this.props.isLeftFilling,[ut]:this.props.isRightFilling,[ct]:this.props.isTopFilling,[dt]:this.props.isBottomFilling}),t={width:this.options.width};this.options.flex&&(t.flexGrow=this.options.flex);const n=void 0!==this.props.fillable&&this.props.isBottomSelected&&this.props.isRightSelected;return k("div",{ref:this.cell,className:e,style:t,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,onDblClick:this.handleDbClick},k("div",{ref:this.cellContent,className:ot}),n&&k("div",{onMouseDown:this.handleFillerMouseDown,className:yt}))}}));var wt="v-grid-row-cells",bt="v-grid-row-stripe-cells",xt="v-grid-row-cells-hover",Rt="v-grid-row-cells-select";var Et=Le(class extends et{constructor(){super(...arguments),this.self={current:null}}componentDidMount(){this.unsubscribe=this.props.grid.store("row").subscribeAny((()=>{if(!this.self.current)return;const e=this.props.grid.state("row").hoveredRow===this.props.value,t=-1!==this.props.grid.state("row").selectedRows.indexOf(this.props.value);e?me.appendClassName(this.self.current,xt):me.removeClassName(this.self.current,xt),t?me.appendClassName(this.self.current,Rt):me.removeClassName(this.self.current,Rt)}))}componentWillUnmount(){this.unsubscribe()}render(){const e={height:this.props.baseHeight,minHeight:this.props.baseHeight},t=this.props.grid.state("row").rowIndexes[this.props.value],n=ke({[wt]:!0,[bt]:t%2==0});return k("div",{ref:this.self,className:n,style:e},this.props.columns.map((e=>k(Ct,{key:e,row:this.props.value,column:e,onDbClick:this.props.onCellDbClick,onMouseDown:this.props.onCellMouseDown,onMouseMove:this.props.onCellMouseMove,onMouseUp:this.props.onCellMouseUp,onFillerMouseDown:this.props.onCellFillerMouseDown}))))}});class Mt{each(e){for(let t=this.minY;t<=this.maxY;t++)for(let n=this.minX;n<=this.maxX;n++)if(!1===e({x:n,y:t},{x:n-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}}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 kt extends Mt{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 St extends Mt{constructor(e,t,n){super(),this.ref=e,this.current=t,this.limit=n,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(),n=this.ref.getEndCoord(),s=this.minX<t.x||this.minY<t.y;let i=[],o=n.y-t.y,r=s?this.minY:this.maxY,l=s?this.maxY:this.minY;for("x"===this.limit&&(o=n.x-t.x,r=s?this.minX:this.maxX,l=s?this.maxX:this.minX);;){const e="x"===this.limit?{x:l,y:this.minY}:{x:this.minX,y:l};l=s?Math.max(l-o,r):Math.min(l+o,r);const t="x"===this.limit?{x:l,y:this.maxY}:{x:this.maxX,y:l};if(i.push(new kt(e,t)),l==r)break;l+=s?-1:1}i.forEach((t=>{e(t)}))}}var Ot="v-grid-menu",Lt="v-grid-menu-separator",Nt="v-grid-menu-item",It="v-grid-menu-disabled-item",Dt="v-grid-menu-item-icon",zt="v-grid-menu-item-title";class $t extends Ne{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(),n={x:t.x+e.offsetWidth-2,y:t.y};this.setState({subMenuCoord:n,subMenuVisible:!0})},this.hideSubMenus=()=>{this.setState({subMenuVisible:!1})}}get hasSubMenus(){return this.props.subMenus&&!this.props.disabled}render(){return this.props.separator?k("div",{className:Lt}):k("div",{className:this.props.disabled?It:Nt,onClick:this.handleClick,onMouseOver:this.hasSubMenus?this.showSubMenus:void 0,onMouseLeave:this.hasSubMenus?this.hideSubMenus:void 0,ref:this.createRef("self")},k("span",{className:Dt},k("span",{className:this.props.icon})),k("span",{className:zt},this.props.name),this.hasSubMenus&&k("span",{className:"vg-cheveron-right"}),this.state.subMenuVisible&&k(Ht,{onMenuItemClicked:this.props.onClick,coord:this.state.subMenuCoord,items:this.props.subMenus}))}}class Ht extends Ne{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)&&this.props.onClickOutside()}}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 k("div",{ref:this.createRef("self"),style:{left:this.coord.x,top:this.coord.y},className:Ot},this.props.items.map((e=>k($t,h({onClick:this.props.onMenuItemClicked},e)))))}}var Vt={root:"v-grid-root",header:"v-grid-header",headerColumns:"v-grid-header-columns",headerContainer:"v-grid-header-container",normalCells:"v-grid-normal-cells",normalCellsViewPort:"v-grid-normal-cells-view-port",normalColumns:"v-grid-normal-columns",pinnedRightCells:"v-grid-pinned-right-cells",pinnedRightColumns:"v-grid-pinned-right-columns",pinnedLeftCells:"v-grid-pinned-left-cells",pinnedLeftColumns:"v-grid-pinned-left-columns",normalCellsContainer:"v-grid-normal-cells-container",body:"v-grid-body",horizontalScroll:"v-grid-horizontal-scroll",horizontalRightSpacer:"v-grid-horizontal-right-spacer",horizontalLeftSpacer:"v-grid-horizontal-left-spacer",horizontalScrollView:"v-grid-horizontal-scroll-view",horizontalScrollContainer:"v-grid-horizontal-scroll-container",columnResizer:"v-grid-column-resizer",loading:"v-grid-loading",dot:"v-grid-dot",slide:"v-grid-slide"};var Bt=Oe((e=>({pinnedLeftColumns:e.column.pinnedLeftColumns,pinnedRightColumns:e.column.pinnedRightColumns,normalColumns:e.column.normalColumns,rowHeight:e.row.height})),(e=>({getCoordinate:(t,n)=>e.getCoordinate(t,n),getCoordLocatedRange:t=>e.getCoordLocatedRange(t),hoverRow:t=>e.store("row").dispatch("setHoveredRow",t),selectRows:t=>e.store("row").dispatch("selectRows",t),selectCells:(t,n)=>e.store("cell").dispatch("selectCells",{start:t,end:n}),setEditing:t=>e.setEditing(t),setFilling:t=>e.store("cell").dispatch("setFilling",t)})))(Le(class extends Ne{constructor(){super(...arguments),this.componentDidMount=()=>{document.addEventListener("mouseup",this.handleMouseUp)},this.componentWillUnmount=()=>{document.removeEventListener("mouseup",this.handleMouseUp)},this.componentDidUpdate=()=>{this.refs.normalCellsWrapper.current.style.height=this.props.normalCellsRef.current.clientHeight+"px"},this.handleKeyDown=e=>"c"===e.key&&(e.ctrlKey||e.metaKey)?this.props.grid.copySelection():"v"===e.key&&(e.ctrlKey||e.metaKey)?this.props.grid.pasteFromClipboard():void 0,this.handleCellDbClick=(e,t,n)=>{this.props.setEditing({row:t,column:n})},this.handleCellMouseDown=(e,t,n)=>{e.stopPropagation(),this.props.setEditing();const s=this.props.getCoordinate(t,n);if(e.button===fe.Right){const i=this.props.grid.getContextMenuItems({row:t,column:n});if(0===i.length)return;if(this.setState({isMenuVisible:!0,contextMenuItems:i,contextMenuCoord:{x:e.clientX,y:e.clientY}}),this.props.grid.getCoordLocatedRange(s))return}else this.hideContextMenu();e.button!==fe.Left&&e.button!==fe.Right||(this.props.selectRows([t]),this.selectionStart=this.selectionEnd=s,this.isSelecting=!0,this.handleSelectionChanged())},this.handleCellMouseMove=(e,t,n)=>{this.props.hoverRow(t);const s=this.props.getCoordinate(t,n);if(this.isSelecting){if(this.selectionEnd&&this.selectionEnd.x==s.x&&this.selectionEnd.y==s.y)return;this.selectionEnd=s,this.handleSelectionChanged()}if(this.isFilling){if(this.fillingEnd&&this.fillingEnd.x==s.x&&this.fillingEnd.y==s.y)return;this.fillingEnd=s,this.handleFillRangeChanged()}},this.handleMouseUp=()=>{this.isSelecting&&(this.isSelecting=!1),this.isFilling&&(this.isFilling=!1,this.handleFill(new St(this.fillingRef,this.fillingEnd,this.props.grid.state("grid").fillable)),this.fillingRef=this.fillingEnd=null,this.handleFillRangeChanged())},this.handleCellFillerMouseDown=(e,t,n)=>{if(e.button!==fe.Left)return;const s=this.props.getCoordinate(t,n),i=this.props.getCoordLocatedRange(s);i&&(this.fillingRef=i,this.fillingEnd=s,this.isFilling=!0,this.handleFillRangeChanged())},this.handleBlur=()=>{this.props.selectRows([]),this.selectionStart=this.selectionEnd=null,this.handleSelectionChanged()},this.handleSelectionChanged=()=>{this.props.selectCells(this.selectionStart,this.selectionEnd)},this.handleFillRangeChanged=()=>{this.props.setFilling(new St(this.fillingRef,this.fillingEnd,this.props.grid.state("grid").fillable))},this.hideContextMenu=()=>{this.state.isMenuVisible&&this.setState({isMenuVisible:!1})},this.handleFill=e=>{const t=e.getReference();e.chunk((e=>{e.each(((e,n)=>{const s=t.getGlobalCoord(n);this.props.grid.setCellValueByCoord(e,this.props.grid.getCellValueByCoord(s))}))}))},this.renderRows=e=>this.props.items.map((t=>k(Et,{key:t,value:t,baseHeight:this.props.rowHeight,columns:e,onCellDbClick:this.handleCellDbClick,onCellMouseDown:this.handleCellMouseDown,onCellMouseMove:this.handleCellMouseMove,onCellFillerMouseDown:this.handleCellFillerMouseDown})))}render(){const e=this.props.grid.state("grid").getContextMenuItems?e=>{e.preventDefault()}:void 0;return k("div",{onKeyDown:this.handleKeyDown,onBlur:this.handleBlur,tabIndex:0,style:{display:"flex",outline:"none",position:"relative",minHeight:"100%"},onMouseLeave:()=>this.props.hoverRow(void 0),onContextMenu:e},this.state.isMenuVisible&&k(Ht,{onMenuItemClicked:this.hideContextMenu,onClickOutside:this.hideContextMenu,coord:this.state.contextMenuCoord,items:this.state.contextMenuItems}),this.props.pinnedLeftColumns.length>0&&k("div",{className:Vt.pinnedLeftCells},this.renderRows(this.props.pinnedLeftColumns)),k("div",{ref:this.createRef("normalCellsWrapper"),className:Vt.normalCells},k("div",{ref:this.props.normalCellsRef,className:Vt.normalCellsViewPort,onScroll:this.props.handleHorizontalScroll},k("div",{ref:this.props.normalCellsContainerRef,className:Vt.normalCellsContainer},this.renderRows(this.props.normalColumns)))),this.props.pinnedRightColumns.length>0&&k("div",{className:Vt.pinnedRightCells},this.renderRows(this.props.pinnedRightColumns)))}}));var jt=Oe((e=>({loading:e.grid.loading,width:e.grid.width,height:e.grid.height,preloadRowCount:e.grid.preloadRowCount,headerHeight:e.column.height,pinnedLeftColumns:e.column.pinnedLeftColumns,pinnedRightColumns:e.column.pinnedRightColumns,normalColumns:e.column.normalColumns,rowHeight:e.row.height,rows:e.row.rowIndexes})))(Le(class extends Ne{constructor(){super(...arguments),this.unsubscribes=[],this.ignoreScrollEvents=!1,this.componentDidMount=()=>{this.unsubscribes.push(this.props.grid.store("grid").subscribeAny((()=>{const e=this.props.grid.state("grid").horizontalScrollLeft;this.refs.headerContainer.current.style.transform=`translateX(-${e}px)`}))),this.unsubscribes.push(this.props.grid.subscribe((()=>{this.resize()}))),this.resize()},this.componentWillUnmount=()=>{this.unsubscribes.forEach((e=>e()))},this.getColumnOptions=e=>this.props.grid.getColumnOptions(e),this.handleColumnResizeStart=(e,t,n)=>{document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("mousemove",this.handleMouseMove);const s=n.pageX-this.refs.root.current.offsetLeft;this.refs.columnResizer.current.style.left=s+"px",this.refs.columnResizer.current.style.width="2px",this.resizingColumn={field:e,width:t,pos:n.clientX}},this.handleMouseUp=e=>{if(document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("mousemove",this.handleMouseMove),this.refs.columnResizer.current.style.left="0px",this.refs.columnResizer.current.style.width="0px",this.resizingColumn){const t=e.clientX-this.resizingColumn.pos+this.resizingColumn.width,n=this.getColumnOptions(this.resizingColumn.field).minWidth;this.props.grid.store("column").dispatch("updateColumnWidth",{field:this.resizingColumn.field,width:Math.max(t,n)})}},this.handleMouseMove=e=>{const t=e.pageX-this.refs.root.current.offsetLeft;this.refs.columnResizer.current.style.left=t+"px"},this.handleHorizontalScroll=e=>{if(this.ignoreScrollEvents)return void(this.ignoreScrollEvents=!1);this.ignoreScrollEvents=!0;const t=e.target.scrollLeft;e.target!=this.refs.normalCells.current&&(this.refs.normalCells.current.scrollLeft=t),e.target!=this.refs.horizontalScroll.current&&(this.refs.horizontalScroll.current.scrollLeft=t),this.props.grid.store("grid").dispatch("setHorizontalScrollLeft",t)},this.listRender=e=>k(Bt,{items:e,handleHorizontalScroll:this.handleHorizontalScroll,normalCellsRef:this.createRef("normalCells"),normalCellsContainerRef:this.createRef("normalCellsContainer")}),this.renderColumns=e=>e.map((e=>k(st,{key:e,value:e,onResize:this.handleColumnResizeStart})))}resize(){var e,t,n,s,i,o;const r=this.refs.list.current.base,l=r.offsetWidth-r.clientWidth;let a=0;this.refs.headerContainer.current.scrollWidth>this.refs.normalColumns.current.clientWidth&&(a=this.refs.horizontalScrollContainer.current.offsetHeight);const h=(null==(t=null==(e=this.refs.headerContainer)?void 0:e.current)?void 0:t.scrollWidth)||0;this.refs.header.current.style.paddingRight=l+"px",this.refs.horizontalScrollWrapper.current.style.height=a+"px",this.refs.normalCellsContainer.current.style.width=h+"px",this.refs.horizontalScrollContainer.current.style.width=h+"px",this.refs.horizontalLeftSpacer.current.style.width=((null==(s=null==(n=this.refs.pinnedLeftColumns)?void 0:n.current)?void 0:s.scrollWidth)||0)+"px",this.refs.horizontalRightSpacer.current.style.width=((null==(o=null==(i=this.refs.pinnedRightColumns)?void 0:i.current)?void 0:o.offsetWidth)||0)+l+"px"}render(){const e={width:this.props.width,height:this.props.height},t={height:this.props.headerHeight,minHeight:this.props.headerHeight};return k("div",{ref:this.createRef("root"),className:Vt.root,style:e},k("div",{ref:this.createRef("header"),className:Vt.header,style:t},this.props.pinnedLeftColumns.length>0&&k("div",{ref:this.createRef("pinnedLeftColumns"),className:ke([Vt.pinnedLeftColumns,Vt.headerColumns])},this.renderColumns(this.props.pinnedLeftColumns)),k("div",{ref:this.createRef("normalColumns"),className:Vt.normalColumns},k("div",{ref:this.createRef("headerContainer"),className:ke([Vt.headerContainer,Vt.headerColumns])},this.renderColumns(this.props.normalColumns))),this.props.pinnedRightColumns.length>0&&k("div",{ref:this.createRef("pinnedRightColumns"),className:ke([Vt.pinnedRightColumns,Vt.headerColumns])},this.renderColumns(this.props.pinnedRightColumns))),k("div",{className:Vt.body},k(ze,{ref:this.createRef("list"),items:this.props.grid.store("row").getRowIds(),itemHeight:this.props.rowHeight,preLoadCount:this.props.preloadRowCount,render:this.listRender})),k("div",{ref:this.createRef("horizontalScrollWrapper"),className:Vt.horizontalScroll},k("div",{ref:this.createRef("horizontalLeftSpacer"),className:Vt.horizontalLeftSpacer}),k("div",{ref:this.createRef("horizontalScroll"),className:Vt.horizontalScrollView,onScroll:this.handleHorizontalScroll},k("div",{ref:this.createRef("horizontalScrollContainer"),className:Vt.horizontalScrollContainer})),k("div",{ref:this.createRef("horizontalRightSpacer"),className:Vt.horizontalRightSpacer})),k("div",{ref:this.createRef("columnResizer"),className:Vt.columnResizer}),this.props.loading&&k("div",{className:Vt.loading},k("div",{className:Vt.spinner},k("div",{className:Vt.dot}),k("div",{className:Vt.dot}),k("div",{className:Vt.dot}),k("div",{className:Vt.dot}),k("div",{className:Vt.dot}))))}}));function Pt(e){const[t,n]=ue({destroyed:!1});return ce((()=>e.grid.store("grid").subscribe("destroy",(()=>{n({destroyed:!0})}))),[]),!t.destroyed&&k(J,{grid:e.grid},k(jt,null))}function At(e,t){q(k(Pt,{grid:e}),t)}class Ft{constructor(e,t){this._listeners=e,this._actions={},this._anyListeners=[],this._state=t||{}}getState(){return this._state}subscribeAny(e){return this._anyListeners.push(e),()=>{this._anyListeners.splice(this._anyListeners.indexOf(e),1)}}subscribe(e,t){return this._listeners[e].push(t),()=>{this._listeners[e].splice(this._listeners[e].indexOf(t),1)}}handle(e,t){return this._actions[e]=t,this}dispatch(e,t){const n=this._actions[e];if(!n)return;const s=n(this._state,t);if(s!==this._state){const n=this._state;this._state=s,this._listeners[e].forEach((e=>e(t,s,n))),this._anyListeners.forEach((e=>e(t,s,n)))}}}class Ut extends Ft{constructor(e){super(Object.keys(e).reduce(((e,t)=>(e[t]=[],e)),{}),Object.keys(e).reduce(((t,n)=>(t[n]=e[n].getState(),t)),{})),this.stores=e,Object.keys(e).forEach((t=>{e[t].subscribeAny((()=>{this.dispatch(t,void 0)})),this.handle(t,(n=>(n[t]=e[t].getState(),h({},n))))}))}store(e){return this.stores[e]}state(e){return this._state[e]}}function Wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tt={exports:{}};!function(e,t){function n(e){return"object"!=typeof e||"toString"in e?e:Object.prototype.toString.call(e).slice(8,-1)}Object.defineProperty(t,"__esModule",{value:!0});var s="object"==typeof process&&!0;function i(e,t){if(!e){if(s)throw new Error("Invariant failed");throw new Error(t())}}t.invariant=i;var o=Object.prototype.hasOwnProperty,r=Array.prototype.splice,l=Object.prototype.toString;function a(e){return l.call(e).slice(8,-1)}var h=Object.assign||function(e,t){return u(t).forEach((function(n){o.call(t,n)&&(e[n]=t[n])})),e},u="function"==typeof Object.getOwnPropertySymbols?function(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.keys(e)};function c(e){return Array.isArray(e)?h(e.constructor(e.length),e):"Map"===a(e)?new Map(e):"Set"===a(e)?new Set(e):e&&"object"==typeof e?h(Object.create(Object.getPrototypeOf(e)),e):e}var d=function(){function e(){this.commands=h({},p),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(e,t){return e===t},this.update.newContext=function(){return(new e).update}}return Object.defineProperty(e.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(e){this.update.isEquals=e},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,t){this.commands[e]=t},e.prototype.update=function(e,t){var n=this,s="function"==typeof t?{$apply:t}:t;Array.isArray(e)&&Array.isArray(s)||i(!Array.isArray(s),(function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."})),i("object"==typeof s&&null!==s,(function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the following commands: "+Object.keys(n.commands).join(", ")+"."}));var r=e;return u(s).forEach((function(t){if(o.call(n.commands,t)){var i=e===r;r=n.commands[t](s[t],r,s,e),i&&n.isEquals(r,e)&&(r=e)}else{var l="Map"===a(e)?n.update(e.get(t),s[t]):n.update(e[t],s[t]),h="Map"===a(r)?r.get(t):r[t];n.isEquals(l,h)&&(void 0!==l||o.call(e,t))||(r===e&&(r=c(e)),"Map"===a(r)?r.set(t,l):r[t]=l)}})),r},e}();t.Context=d;var p={$push:function(e,t,n){return _(t,n,"$push"),e.length?t.concat(e):t},$unshift:function(e,t,n){return _(t,n,"$unshift"),e.length?e.concat(t):t},$splice:function(e,t,s,o){return function(e,t){i(Array.isArray(e),(function(){return"Expected $splice target to be an array; got "+n(e)})),g(t.$splice)}(t,s),e.forEach((function(e){g(e),t===o&&e.length&&(t=c(o)),r.apply(t,e)})),t},$set:function(e,t,n){return function(e){i(1===Object.keys(e).length,(function(){return"Cannot have more than one key in an object with $set"}))}(n),e},$toggle:function(e,t){m(e,"$toggle");var n=e.length?c(t):t;return e.forEach((function(e){n[e]=!t[e]})),n},$unset:function(e,t,n,s){return m(e,"$unset"),e.forEach((function(e){Object.hasOwnProperty.call(t,e)&&(t===s&&(t=c(s)),delete t[e])})),t},$add:function(e,t,n,s){return v(t,"$add"),m(e,"$add"),"Map"===a(t)?e.forEach((function(e){var n=e[0],i=e[1];t===s&&t.get(n)!==i&&(t=c(s)),t.set(n,i)})):e.forEach((function(e){t!==s||t.has(e)||(t=c(s)),t.add(e)})),t},$remove:function(e,t,n,s){return v(t,"$remove"),m(e,"$remove"),e.forEach((function(e){t===s&&t.has(e)&&(t=c(s)),t.delete(e)})),t},$merge:function(e,t,s,o){var r,l;return r=t,i((l=e)&&"object"==typeof l,(function(){return"update(): $merge expects a spec of type 'object'; got "+n(l)})),i(r&&"object"==typeof r,(function(){return"update(): $merge expects a target of type 'object'; got "+n(r)})),u(e).forEach((function(n){e[n]!==t[n]&&(t===o&&(t=c(o)),t[n]=e[n])})),t},$apply:function(e,t){var s;return i("function"==typeof(s=e),(function(){return"update(): expected spec of $apply to be a function; got "+n(s)+"."})),e(t)}},f=new d;function _(e,t,s){i(Array.isArray(e),(function(){return"update(): expected target of "+n(s)+" to be an array; got "+n(e)+"."})),m(t[s],s)}function m(e,t){i(Array.isArray(e),(function(){return"update(): expected spec of "+n(t)+" to be an array; got "+n(e)+". Did you forget to wrap your parameter in an array?"}))}function g(e){i(Array.isArray(e),(function(){return"update(): expected spec of $splice to be an array of arrays; got "+n(e)+". Did you forget to wrap your parameters in an array?"}))}function v(e,t){var s=a(e);i("Map"===s||"Set"===s,(function(){return"update(): "+n(t)+" expects a target of type Set or Map; got "+n(s)}))}t.isEquals=f.update.isEquals,t.extend=f.extend,t.default=f.update,t.default.default=e.exports=h(t.default,t)}(Tt,Tt.exports);var Xt=Wt(Tt.exports);const Yt={width:"100%",height:"100%",preloadRowCount:20};class qt extends Ft{constructor(e){super({setHorizontalScrollLeft:[],setLoading:[],destroy:[]},Object.assign({},Yt,e)),this.handle("setHorizontalScrollLeft",((e,t)=>u(h({},e),{horizontalScrollLeft:t}))),this.handle("setLoading",((e,t)=>Xt(e,{loading:{$set:t}}))),this.handle("destroy",(e=>Xt(e,{destroyed:{$set:!0}})))}destroy(){this.dispatch("destroy",void 0)}}const Kt={rows:[],rowIndexes:{},selectedRows:[],height:28};class Gt extends Ft{constructor(e){super({setCellValue:[],setHoveredRow:[],selectRows:[],appendRowsBefore:[],takeRows:[],clear:[],setBaseHeight:[]},Object.assign({},Kt,e)),this.handle("setCellValue",((e,{row:t,column:n,value:s})=>{const i=e.rowIndexes[t];return void 0===i?e:Xt(e,{rows:{[i]:{[n]:{$set:s}}}})})),this.handle("appendRowsBefore",((e,{index:t,rows:n})=>{n=n.filter((t=>{const n=e.rowIndexes[t.id];return void 0===n||(e.rows[n]=t,!1)})),t=Math.max(t,0),n=[...e.rows.slice(0,t),...n,...e.rows.slice(t,e.rows.length)];const s={};return n.forEach(((e,t)=>{s[e.id]=t})),u(h({},e),{rows:n,rowIndexes:s})})),this.handle("takeRows",((e,t)=>{t=t.filter((t=>void 0!==e.rowIndexes[t]));const n=e.rows.filter((e=>-1===t.indexOf(e.id))),s={};return n.forEach(((e,t)=>{s[e.id]=t})),Xt(e,{rowIndexes:{$set:s},rows:{$set:n}})})),this.handle("setHoveredRow",((e,t)=>void 0===t||void 0!==e.rowIndexes[t]?Xt(e,{hoveredRow:{$set:t}}):e)),this.handle("selectRows",((e,t)=>(t=t.filter(((n,s)=>void 0!==e.rowIndexes[n]&&t.indexOf(n,0)===s)),Xt(e,{selectedRows:{$set:t}})))),this.handle("clear",(e=>Xt(e,{rowIndexes:{$set:{}},rows:{$set:[]},hoveredRow:{$set:void 0},selectedRows:{$set:[]}}))),this.handle("setBaseHeight",((e,t)=>Xt(e,{height:{$set:t}})))}appendRowsBefore(e,t){return this.dispatch("appendRowsBefore",{index:e,rows:t})}appendRows(e){return this.dispatch("appendRowsBefore",{index:this._state.rows.length,rows:e})}selectRows(e){return this.dispatch("selectRows",e)}appendSelectRows(e){return e=[...this._state.selectedRows,...e],this.dispatch("selectRows",e)}takeSelectRow(e){const t=this._state.selectedRows.indexOf(e);if(-1!==t)return this.dispatch("selectRows",Xt(this._state.selectedRows,{$splice:[[t,1]]}))}getRowIds(){return this._state.rows.map((e=>e.id))}getRowIdByIndex(e){return this._state.rows[e].id}getRowIndex(e){return this._state.rowIndexes[e]}getRowDataByIndex(e){return this._state.rows[e]}getRowData(e){return this.getRowDataByIndex(this.getRowIndex(e))}getRawCellValue(