go-xcel-interpret 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/go-xcel-interpret.cjs +839 -0
- package/dist/go-xcel-interpret.css +59 -0
- package/dist/go-xcel-interpret.esm.mjs +63430 -0
- package/dist/go-xcel-interpret.umd.js +839 -0
- package/dist/src/components/BodyCssVar.d.ts +5 -0
- package/dist/src/components/GoXcelInterpret.d.ts +4 -0
- package/dist/src/components/constants.d.ts +1 -0
- package/dist/src/components/interpret/InterpretForm.d.ts +2 -0
- package/dist/src/components/interpret/InterpretTable.d.ts +2 -0
- package/dist/src/components/interpret/TabsInterpret.d.ts +24 -0
- package/dist/src/components/interpret/interpret.d.ts +14 -0
- package/dist/src/components/ui/Card.d.ts +7 -0
- package/dist/src/components/ui/Form.d.ts +23 -0
- package/dist/src/components/ui/FormOptions.d.ts +14 -0
- package/dist/src/components/ui/Layout.d.ts +19 -0
- package/dist/src/components/ui/Loading.d.ts +9 -0
- package/dist/src/components/ui/Tabs.d.ts +19 -0
- package/dist/src/components/ui/Typography.d.ts +25 -0
- package/dist/src/components/ui/form/Checkbox.d.ts +23 -0
- package/dist/src/components/ui/form/DatePicker.d.ts +15 -0
- package/dist/src/components/ui/form/Input.d.ts +21 -0
- package/dist/src/components/ui/form/InputNumber.d.ts +19 -0
- package/dist/src/components/ui/form/Radio.d.ts +30 -0
- package/dist/src/components/ui/form/Select.d.ts +18 -0
- package/dist/src/error.d.ts +5 -0
- package/dist/src/hook/useBounce.d.ts +1 -0
- package/dist/src/hook/useTemplateTabs.d.ts +12 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/services.d.ts +11 -0
- package/dist/src/types/config.d.ts +62 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/types/services.d.ts +6 -0
- package/dist/src/types/template.d.ts +75 -0
- package/dist/src/utils/base64.d.ts +7 -0
- package/dist/src/utils/theme.d.ts +8 -0
- package/dist/src/utils/websocket.d.ts +9 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +63 -0
|
@@ -0,0 +1,839 @@
|
|
|
1
|
+
"use strict";var xB=Object.defineProperty;var AB=(t,e,r)=>e in t?xB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var tP=(t,e,r)=>AB(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("react"),FE=require("react-dom");var rP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ok(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Of={exports:{}},zc={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var nP;function HB(){if(nP)return zc;nP=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:t,type:n,key:s,ref:i!==void 0?i:null,props:o}}return zc.Fragment=e,zc.jsx=r,zc.jsxs=r,zc}var Yc={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var iP;function NB(){return iP||(iP=1,process.env.NODE_ENV!=="production"&&function(){function t(z){if(z==null)return null;if(typeof z=="function")return z.$$typeof===A?null:z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case w:return"Fragment";case b:return"Profiler";case v:return"StrictMode";case T:return"Suspense";case M:return"SuspenseList";case j:return"Activity"}if(typeof z=="object")switch(typeof z.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),z.$$typeof){case g:return"Portal";case _:return(z.displayName||"Context")+".Provider";case p:return(z._context.displayName||"Context")+".Consumer";case O:var $=z.render;return z=z.displayName,z||(z=$.displayName||$.name||"",z=z!==""?"ForwardRef("+z+")":"ForwardRef"),z;case P:return $=z.displayName||null,$!==null?$:t(z.type)||"Memo";case G:$=z._payload,z=z._init;try{return t(z($))}catch{}}return null}function e(z){return""+z}function r(z){try{e(z);var $=!1}catch{$=!0}if($){$=console;var m=$.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object";return m.call($,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(z)}}function n(z){if(z===w)return"<>";if(typeof z=="object"&&z!==null&&z.$$typeof===G)return"<...>";try{var $=t(z);return $?"<"+$+">":"<...>"}catch{return"<...>"}}function i(){var z=q.A;return z===null?null:z.getOwner()}function o(){return Error("react-stack-top-frame")}function s(z){if(Q.call(z,"key")){var $=Object.getOwnPropertyDescriptor(z,"key").get;if($&&$.isReactWarning)return!1}return z.key!==void 0}function a(z,$){function m(){Z||(Z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",$))}m.isReactWarning=!0,Object.defineProperty(z,"key",{get:m,configurable:!0})}function l(){var z=t(this.type);return ne[z]||(ne[z]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),z=this.props.ref,z!==void 0?z:null}function u(z,$,m,C,y,I,x,N){return m=I.ref,z={$$typeof:f,type:z,key:$,props:I,_owner:y},(m!==void 0?m:null)!==null?Object.defineProperty(z,"ref",{enumerable:!1,get:l}):Object.defineProperty(z,"ref",{enumerable:!1,value:null}),z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:x}),Object.defineProperty(z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:N}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z}function c(z,$,m,C,y,I,x,N){var B=$.children;if(B!==void 0)if(C)if(ue(B)){for(C=0;C<B.length;C++)h(B[C]);Object.freeze&&Object.freeze(B)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(B);if(Q.call($,"key")){B=t(z);var Y=Object.keys($).filter(function(E){return E!=="key"});C=0<Y.length?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}",ae[B+C]||(Y=0<Y.length?"{"+Y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,C,B,Y,B),ae[B+C]=!0)}if(B=null,m!==void 0&&(r(m),B=""+m),s($)&&(r($.key),B=""+$.key),"key"in $){m={};for(var R in $)R!=="key"&&(m[R]=$[R])}else m=$;return B&&a(m,typeof z=="function"?z.displayName||z.name||"Unknown":z),u(z,B,I,y,i(),m,x,N)}function h(z){typeof z=="object"&&z!==null&&z.$$typeof===f&&z._store&&(z._store.validated=1)}var d=oe,f=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),q=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Object.prototype.hasOwnProperty,ue=Array.isArray,J=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(z){return z()}};var Z,ne={},ee=d["react-stack-bottom-frame"].bind(d,o)(),te=J(n(o)),ae={};Yc.Fragment=w,Yc.jsx=function(z,$,m,C,y){var I=1e4>q.recentlyCreatedOwnerStacks++;return c(z,$,m,!1,C,y,I?Error("react-stack-top-frame"):ee,I?J(n(z)):te)},Yc.jsxs=function(z,$,m,C,y){var I=1e4>q.recentlyCreatedOwnerStacks++;return c(z,$,m,!0,C,y,I?Error("react-stack-top-frame"):ee,I?J(n(z)):te)}}()),Yc}var oP;function DB(){return oP||(oP=1,process.env.NODE_ENV==="production"?Of.exports=HB():Of.exports=NB()),Of.exports}var he=DB(),nv={},Pn={},iv={},sP;function Io(){return sP||(sP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isEventSourceSupported=t.isReactNative=t.ReadyState=t.DEFAULT_HEARTBEAT=t.UNPARSABLE_JSON_OBJECT=t.DEFAULT_RECONNECT_INTERVAL_MS=t.DEFAULT_RECONNECT_LIMIT=t.SOCKET_IO_PING_CODE=t.SOCKET_IO_PATH=t.SOCKET_IO_PING_INTERVAL=t.DEFAULT_EVENT_SOURCE_OPTIONS=t.EMPTY_EVENT_HANDLERS=t.DEFAULT_OPTIONS=void 0;var e=1,r=1e3*e;t.DEFAULT_OPTIONS={},t.EMPTY_EVENT_HANDLERS={},t.DEFAULT_EVENT_SOURCE_OPTIONS={withCredentials:!1,events:t.EMPTY_EVENT_HANDLERS},t.SOCKET_IO_PING_INTERVAL=25*r,t.SOCKET_IO_PATH="/socket.io/?EIO=3&transport=websocket",t.SOCKET_IO_PING_CODE="2",t.DEFAULT_RECONNECT_LIMIT=20,t.DEFAULT_RECONNECT_INTERVAL_MS=5e3,t.UNPARSABLE_JSON_OBJECT={},t.DEFAULT_HEARTBEAT={message:"ping",timeout:6e4,interval:25e3};var n;(function(o){o[o.UNINSTANTIATED=-1]="UNINSTANTIATED",o[o.CONNECTING=0]="CONNECTING",o[o.OPEN=1]="OPEN",o[o.CLOSING=2]="CLOSING",o[o.CLOSED=3]="CLOSED"})(n||(t.ReadyState=n={}));var i=function(){try{return"EventSource"in globalThis}catch{return!1}};t.isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",t.isEventSourceSupported=!t.isReactNative&&i()}(iv)),iv}var Gc={},ov={},aP;function VE(){return aP||(aP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetWebSockets=t.sharedWebSockets=void 0,t.sharedWebSockets={};var e=function(r){if(r&&t.sharedWebSockets.hasOwnProperty(r))delete t.sharedWebSockets[r];else for(var n in t.sharedWebSockets)t.sharedWebSockets.hasOwnProperty(n)&&delete t.sharedWebSockets[n]};t.resetWebSockets=e}(ov)),ov}var Ia={},$o={},lP;function WE(){if(lP)return $o;lP=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.setUpSocketIOPing=$o.appendQueryParams=$o.parseSocketIOUrl=void 0;var t=Io(),e=function(i){if(i){var o=/^https|wss/.test(i),s=i.replace(/^(https?|wss?)(:\/\/)?/,""),a=s.replace(/\/$/,""),l=o?"wss":"ws";return"".concat(l,"://").concat(a).concat(t.SOCKET_IO_PATH)}else if(i===""){var o=/^https/.test(window.location.protocol),l=o?"wss":"ws",u=window.location.port?":".concat(window.location.port):"";return"".concat(l,"://").concat(window.location.hostname).concat(u).concat(t.SOCKET_IO_PATH)}return i};$o.parseSocketIOUrl=e;var r=function(i,o){o===void 0&&(o={});var s=/\?([\w]+=[\w]+)/,a=s.test(i),l="".concat(Object.entries(o).reduce(function(u,c){var h=c[0],d=c[1];return u+"".concat(h,"=").concat(d,"&")},"").slice(0,-1));return"".concat(i).concat(a?"&":"?").concat(l)};$o.appendQueryParams=r;var n=function(i,o){o===void 0&&(o=t.SOCKET_IO_PING_INTERVAL);var s=function(){return i(t.SOCKET_IO_PING_CODE)};return window.setInterval(s,o)};return $o.setUpSocketIOPing=n,$o}var xf={},uP;function sk(){if(uP)return xf;uP=1,Object.defineProperty(xf,"__esModule",{value:!0}),xf.heartbeat=r;var t=Io();function e(n){return Array.isArray(n)?n.reduce(function(i,o){return i.current>o.current?i:o}).current:n.current}function r(n,i,o){var s=o||{},a=s.interval,l=a===void 0?t.DEFAULT_HEARTBEAT.interval:a,u=s.timeout,c=u===void 0?t.DEFAULT_HEARTBEAT.timeout:u,h=s.message,d=h===void 0?t.DEFAULT_HEARTBEAT.message:h,f=Math.max(100,l/10),g=Date.now(),w=setInterval(function(){var v=Date.now(),b=e(i);if(b+c<=v)console.warn("Heartbeat timed out, closing connection, last message received ".concat(v-b,"ms ago, last ping sent ").concat(v-g,"ms ago")),n.close();else if(b+l<=v&&g+l<=v)try{typeof d=="function"?n.send(d()):n.send(d),g=v}catch(p){console.error("Heartbeat failed, closing connection",p instanceof Error?p.message:p),n.close()}},f);return n.addEventListener("close",function(){clearInterval(w)}),function(){}}return xf}var qc={},sv={},cP;function BE(){return cP||(cP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetSubscribers=t.removeSubscriber=t.addSubscriber=t.hasSubscribers=t.getSubscribers=void 0;var e={},r=[],n=function(l){return(0,t.hasSubscribers)(l)?Array.from(e[l]):r};t.getSubscribers=n;var i=function(l){var u;return((u=e[l])===null||u===void 0?void 0:u.size)>0};t.hasSubscribers=i;var o=function(l,u){e[l]=e[l]||new Set,e[l].add(u)};t.addSubscriber=o;var s=function(l,u){e[l].delete(u)};t.removeSubscriber=s;var a=function(l){if(l&&e.hasOwnProperty(l))delete e[l];else for(var u in e)e.hasOwnProperty(u)&&delete e[u]};t.resetSubscribers=a}(sv)),sv}var hP;function jE(){if(hP)return qc;hP=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.assertIsWebSocket=r,qc.resetGlobalState=n;var t=VE(),e=BE();function r(i,o){if(!o&&!(i instanceof WebSocket))throw new Error("")}function n(i){(0,e.resetSubscribers)(i),(0,t.resetWebSockets)(i)}return qc}var dP;function kB(){if(dP)return Ia;dP=1;var t=Ia&&Ia.__assign||function(){return t=Object.assign||function(c){for(var h,d=1,f=arguments.length;d<f;d++){h=arguments[d];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(c[g]=h[g])}return c},t.apply(this,arguments)};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.attachListeners=void 0;var e=WE(),r=sk(),n=Io(),i=jE(),o=function(c,h,d,f){c.onmessage=function(g){var w;h.current.onMessage&&h.current.onMessage(g),typeof(f==null?void 0:f.current)=="number"&&(f.current=Date.now()),!(typeof h.current.filter=="function"&&h.current.filter(g)!==!0)&&(h.current.heartbeat&&typeof h.current.heartbeat!="boolean"&&((w=h.current.heartbeat)===null||w===void 0?void 0:w.returnMessage)===g.data||d(g))}},s=function(c,h,d,f,g){c.onopen=function(w){if(h.current.onOpen&&h.current.onOpen(w),f.current=0,d(n.ReadyState.OPEN),h.current.heartbeat&&c instanceof WebSocket){var v=typeof h.current.heartbeat=="boolean"?void 0:h.current.heartbeat;g.current=Date.now(),(0,r.heartbeat)(c,g,v)}}},a=function(c,h,d,f,g){if(n.isEventSourceSupported&&c instanceof EventSource)return function(){};(0,i.assertIsWebSocket)(c,h.current.skipAssert);var w;return c.onclose=function(v){var b;if(h.current.onClose&&h.current.onClose(v),d(n.ReadyState.CLOSED),h.current.shouldReconnect&&h.current.shouldReconnect(v)){var p=(b=h.current.reconnectAttempts)!==null&&b!==void 0?b:n.DEFAULT_RECONNECT_LIMIT;if(g.current<p){var _=typeof h.current.reconnectInterval=="function"?h.current.reconnectInterval(g.current):h.current.reconnectInterval;w=window.setTimeout(function(){g.current++,f()},_??n.DEFAULT_RECONNECT_INTERVAL_MS)}else h.current.onReconnectStop&&h.current.onReconnectStop(p),console.warn("Max reconnect attempts of ".concat(p," exceeded"))}},function(){return w&&window.clearTimeout(w)}},l=function(c,h,d,f,g){var w;return c.onerror=function(v){var b;if(h.current.onError&&h.current.onError(v),n.isEventSourceSupported&&c instanceof EventSource&&(h.current.onClose&&h.current.onClose(t(t({},v),{code:1006,reason:"An error occurred with the EventSource: ".concat(v),wasClean:!1})),d(n.ReadyState.CLOSED),c.close()),h.current.retryOnError)if(g.current<((b=h.current.reconnectAttempts)!==null&&b!==void 0?b:n.DEFAULT_RECONNECT_LIMIT)){var p=typeof h.current.reconnectInterval=="function"?h.current.reconnectInterval(g.current):h.current.reconnectInterval;w=window.setTimeout(function(){g.current++,f()},p??n.DEFAULT_RECONNECT_INTERVAL_MS)}else h.current.onReconnectStop&&h.current.onReconnectStop(h.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(h.current.reconnectAttempts," exceeded"))},function(){return w&&window.clearTimeout(w)}},u=function(c,h,d,f,g,w,v){var b=h.setLastMessage,p=h.setReadyState,_,O,T;return d.current.fromSocketIO&&(_=(0,e.setUpSocketIOPing)(v)),o(c,d,b,w),s(c,d,p,g,w),O=a(c,d,p,f,g),T=l(c,d,p,f,g),function(){p(n.ReadyState.CLOSING),O(),T(),c.close(),_&&clearInterval(_)}};return Ia.attachListeners=u,Ia}var Oa={},fP;function LB(){if(fP)return Oa;fP=1;var t=Oa&&Oa.__assign||function(){return t=Object.assign||function(h){for(var d,f=1,g=arguments.length;f<g;f++){d=arguments[f];for(var w in d)Object.prototype.hasOwnProperty.call(d,w)&&(h[w]=d[w])}return h},t.apply(this,arguments)};Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.attachSharedListeners=void 0;var e=VE(),r=Io(),n=BE(),i=WE(),o=sk(),s=function(h,d,f){h.onmessage=function(g){(0,n.getSubscribers)(d).forEach(function(w){var v;w.optionsRef.current.onMessage&&w.optionsRef.current.onMessage(g),typeof((v=w==null?void 0:w.lastMessageTime)===null||v===void 0?void 0:v.current)=="number"&&(w.lastMessageTime.current=Date.now()),!(typeof w.optionsRef.current.filter=="function"&&w.optionsRef.current.filter(g)!==!0)&&(f&&typeof f!="boolean"&&(f==null?void 0:f.returnMessage)===g.data||w.setLastMessage(g))})}},a=function(h,d,f){h.onopen=function(g){var w=(0,n.getSubscribers)(d);w.forEach(function(v){v.reconnectCount.current=0,v.optionsRef.current.onOpen&&v.optionsRef.current.onOpen(g),v.setReadyState(r.ReadyState.OPEN),f&&h instanceof WebSocket&&(v.lastMessageTime.current=Date.now())}),f&&h instanceof WebSocket&&(0,o.heartbeat)(h,w.map(function(v){return v.lastMessageTime}),typeof f=="boolean"?void 0:f)}},l=function(h,d){h instanceof WebSocket&&(h.onclose=function(f){(0,n.getSubscribers)(d).forEach(function(g){g.optionsRef.current.onClose&&g.optionsRef.current.onClose(f),g.setReadyState(r.ReadyState.CLOSED)}),delete e.sharedWebSockets[d],(0,n.getSubscribers)(d).forEach(function(g){var w;if(g.optionsRef.current.shouldReconnect&&g.optionsRef.current.shouldReconnect(f)){var v=(w=g.optionsRef.current.reconnectAttempts)!==null&&w!==void 0?w:r.DEFAULT_RECONNECT_LIMIT;if(g.reconnectCount.current<v){var b=typeof g.optionsRef.current.reconnectInterval=="function"?g.optionsRef.current.reconnectInterval(g.reconnectCount.current):g.optionsRef.current.reconnectInterval;setTimeout(function(){g.reconnectCount.current++,g.reconnect.current()},b??r.DEFAULT_RECONNECT_INTERVAL_MS)}else g.optionsRef.current.onReconnectStop&&g.optionsRef.current.onReconnectStop(g.optionsRef.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(v," exceeded"))}})})},u=function(h,d){h.onerror=function(f){(0,n.getSubscribers)(d).forEach(function(g){g.optionsRef.current.onError&&g.optionsRef.current.onError(f),r.isEventSourceSupported&&h instanceof EventSource&&(g.optionsRef.current.onClose&&g.optionsRef.current.onClose(t(t({},f),{code:1006,reason:"An error occurred with the EventSource: ".concat(f),wasClean:!1})),g.setReadyState(r.ReadyState.CLOSED))}),r.isEventSourceSupported&&h instanceof EventSource&&h.close()}},c=function(h,d,f,g){var w;return f.current.fromSocketIO&&(w=(0,i.setUpSocketIOPing)(g)),s(h,d,f.current.heartbeat),l(h,d),a(h,d,f.current.heartbeat),u(h,d),function(){w&&clearInterval(w)}};return Oa.attachSharedListeners=c,Oa}var gP;function $B(){if(gP)return Gc;gP=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.createOrJoinSocket=void 0;var t=VE(),e=Io(),r=kB(),n=LB(),i=BE(),o=function(a,l,u,c,h){return function(){if((0,i.removeSubscriber)(a,l),!(0,i.hasSubscribers)(a)){try{var d=t.sharedWebSockets[a];d instanceof WebSocket&&(d.onclose=function(f){u.current.onClose&&u.current.onClose(f),c(e.ReadyState.CLOSED)}),d.close()}catch{}h&&h(),delete t.sharedWebSockets[a]}}},s=function(a,l,u,c,h,d,f,g,w){if(!e.isEventSourceSupported&&c.current.eventSourceOptions)throw e.isReactNative?new Error("EventSource is not supported in ReactNative"):new Error("EventSource is not supported");if(c.current.share){var v=null;t.sharedWebSockets[l]===void 0?(t.sharedWebSockets[l]=c.current.eventSourceOptions?new EventSource(l,c.current.eventSourceOptions):new WebSocket(l,c.current.protocols),a.current=t.sharedWebSockets[l],u(e.ReadyState.CONNECTING),v=(0,n.attachSharedListeners)(t.sharedWebSockets[l],l,c,w)):(a.current=t.sharedWebSockets[l],u(t.sharedWebSockets[l].readyState));var b={setLastMessage:h,setReadyState:u,optionsRef:c,reconnectCount:f,lastMessageTime:g,reconnect:d};return(0,i.addSubscriber)(l,b),o(l,b,c,u,v)}else{if(a.current=c.current.eventSourceOptions?new EventSource(l,c.current.eventSourceOptions):new WebSocket(l,c.current.protocols),u(e.ReadyState.CONNECTING),!a.current)throw new Error("WebSocket failed to be created");return(0,r.attachListeners)(a.current,{setLastMessage:h,setReadyState:u},c,d.current,f,g,w)}};return Gc.createOrJoinSocket=s,Gc}var Fo={},mP;function FB(){return mP||(mP=1,function(t){var e=Fo&&Fo.__awaiter||function(l,u,c,h){function d(f){return f instanceof c?f:new c(function(g){g(f)})}return new(c||(c=Promise))(function(f,g){function w(p){try{b(h.next(p))}catch(_){g(_)}}function v(p){try{b(h.throw(p))}catch(_){g(_)}}function b(p){p.done?f(p.value):d(p.value).then(w,v)}b((h=h.apply(l,u||[])).next())})},r=Fo&&Fo.__generator||function(l,u){var c={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},h,d,f,g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=w(0),g.throw=w(1),g.return=w(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function w(b){return function(p){return v([b,p])}}function v(b){if(h)throw new TypeError("Generator is already executing.");for(;g&&(g=0,b[0]&&(c=0)),c;)try{if(h=1,d&&(f=b[0]&2?d.return:b[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,b[1])).done)return f;switch(d=0,f&&(b=[b[0]&2,f.value]),b[0]){case 0:case 1:f=b;break;case 4:return c.label++,{value:b[1],done:!1};case 5:c.label++,d=b[1],b=[0];continue;case 7:b=c.ops.pop(),c.trys.pop();continue;default:if(f=c.trys,!(f=f.length>0&&f[f.length-1])&&(b[0]===6||b[0]===2)){c=0;continue}if(b[0]===3&&(!f||b[1]>f[0]&&b[1]<f[3])){c.label=b[1];break}if(b[0]===6&&c.label<f[1]){c.label=f[1],f=b;break}if(f&&c.label<f[2]){c.label=f[2],c.ops.push(b);break}f[2]&&c.ops.pop(),c.trys.pop();continue}b=u.call(l,c)}catch(p){b=[6,p],d=0}finally{h=f=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},n=Fo&&Fo.__spreadArray||function(l,u,c){if(c||arguments.length===2)for(var h=0,d=u.length,f;h<d;h++)(f||!(h in u))&&(f||(f=Array.prototype.slice.call(u,0,h)),f[h]=u[h]);return l.concat(f||Array.prototype.slice.call(u))};Object.defineProperty(t,"__esModule",{value:!0}),t.getUrl=void 0;var i=WE(),o=Io(),s=function(l){return new Promise(function(u){return window.setTimeout(u,l)})},a=function(l,u){for(var c=[],h=2;h<arguments.length;h++)c[h-2]=arguments[h];return e(void 0,n([l,u],c,!0),void 0,function(d,f,g){var w,v,b,p,_,O,T,M;return g===void 0&&(g=0),r(this,function(P){switch(P.label){case 0:if(typeof d!="function")return[3,10];P.label=1;case 1:return P.trys.push([1,3,,9]),[4,d()];case 2:return w=P.sent(),[3,9];case 3:return P.sent(),f.current.retryOnError?(v=(O=f.current.reconnectAttempts)!==null&&O!==void 0?O:o.DEFAULT_RECONNECT_LIMIT,g<v?(b=typeof f.current.reconnectInterval=="function"?f.current.reconnectInterval(g):f.current.reconnectInterval,[4,s(b??o.DEFAULT_RECONNECT_INTERVAL_MS)]):[3,5]):[3,7];case 4:return P.sent(),[2,(0,t.getUrl)(d,f,g+1)];case 5:return(M=(T=f.current).onReconnectStop)===null||M===void 0||M.call(T,g),[2,null];case 6:return[3,8];case 7:return[2,null];case 8:return[3,9];case 9:return[3,11];case 10:w=d,P.label=11;case 11:return p=f.current.fromSocketIO?(0,i.parseSocketIOUrl)(w):w,_=f.current.queryParams?(0,i.appendQueryParams)(p,f.current.queryParams):p,[2,_]}})})};t.getUrl=a}(Fo)),Fo}var av={},pP;function VB(){return pP||(pP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.websocketWrapper=void 0;var e=function(r,n){return new Proxy(r,{get:function(i,o){var s=i[o];return o==="reconnect"?n:typeof s=="function"?(console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."),function(){}):s},set:function(i,o,s){return/^on/.test(o)?(console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."),!1):(i[o]=s,!0)}})};t.websocketWrapper=e,t.default=t.websocketWrapper}(av)),av}var wP;function UE(){if(wP)return Pn;wP=1;var t=Pn&&Pn.__assign||function(){return t=Object.assign||function(d){for(var f,g=1,w=arguments.length;g<w;g++){f=arguments[g];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(d[v]=f[v])}return d},t.apply(this,arguments)},e=Pn&&Pn.__awaiter||function(d,f,g,w){function v(b){return b instanceof g?b:new g(function(p){p(b)})}return new(g||(g=Promise))(function(b,p){function _(M){try{T(w.next(M))}catch(P){p(P)}}function O(M){try{T(w.throw(M))}catch(P){p(P)}}function T(M){M.done?b(M.value):v(M.value).then(_,O)}T((w=w.apply(d,f||[])).next())})},r=Pn&&Pn.__generator||function(d,f){var g={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},w,v,b,p=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return p.next=_(0),p.throw=_(1),p.return=_(2),typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function _(T){return function(M){return O([T,M])}}function O(T){if(w)throw new TypeError("Generator is already executing.");for(;p&&(p=0,T[0]&&(g=0)),g;)try{if(w=1,v&&(b=T[0]&2?v.return:T[0]?v.throw||((b=v.return)&&b.call(v),0):v.next)&&!(b=b.call(v,T[1])).done)return b;switch(v=0,b&&(T=[T[0]&2,b.value]),T[0]){case 0:case 1:b=T;break;case 4:return g.label++,{value:T[1],done:!1};case 5:g.label++,v=T[1],T=[0];continue;case 7:T=g.ops.pop(),g.trys.pop();continue;default:if(b=g.trys,!(b=b.length>0&&b[b.length-1])&&(T[0]===6||T[0]===2)){g=0;continue}if(T[0]===3&&(!b||T[1]>b[0]&&T[1]<b[3])){g.label=T[1];break}if(T[0]===6&&g.label<b[1]){g.label=b[1],b=T;break}if(b&&g.label<b[2]){g.label=b[2],g.ops.push(T);break}b[2]&&g.ops.pop(),g.trys.pop();continue}T=f.call(d,g)}catch(M){T=[6,M],v=0}finally{w=b=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},n=Pn&&Pn.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.useWebSocket=void 0;var i=oe,o=FE,s=Io(),a=$B(),l=FB(),u=n(VB()),c=jE(),h=function(d,f,g){f===void 0&&(f=s.DEFAULT_OPTIONS),g===void 0&&(g=!0);var w=(0,i.useState)(null),v=w[0],b=w[1],p=(0,i.useState)({}),_=p[0],O=p[1],T=(0,i.useMemo)(function(){if(!f.disableJson&&v)try{return JSON.parse(v.data)}catch{return s.UNPARSABLE_JSON_OBJECT}return null},[v,f.disableJson]),M=(0,i.useRef)(null),P=(0,i.useRef)(null),G=(0,i.useRef)(function(){}),j=(0,i.useRef)(0),A=(0,i.useRef)(Date.now()),q=(0,i.useRef)([]),Q=(0,i.useRef)(null),ue=(0,i.useRef)(f);ue.current=f;var J=M.current&&_[M.current]!==void 0?_[M.current]:d!==null&&g===!0?s.ReadyState.CONNECTING:s.ReadyState.UNINSTANTIATED,Z=f.queryParams?JSON.stringify(f.queryParams):null,ne=(0,i.useCallback)(function(ae,z){var $;if(z===void 0&&(z=!0),s.isEventSourceSupported&&P.current instanceof EventSource){console.warn("Unable to send a message from an eventSource");return}(($=P.current)===null||$===void 0?void 0:$.readyState)===s.ReadyState.OPEN?((0,c.assertIsWebSocket)(P.current,ue.current.skipAssert),P.current.send(ae)):z&&q.current.push(ae)},[]),ee=(0,i.useCallback)(function(ae,z){z===void 0&&(z=!0),ne(JSON.stringify(ae),z)},[ne]),te=(0,i.useCallback)(function(){return ue.current.share!==!0||s.isEventSourceSupported&&P.current instanceof EventSource?P.current:(Q.current===null&&P.current&&((0,c.assertIsWebSocket)(P.current,ue.current.skipAssert),Q.current=(0,u.default)(P.current,G)),Q.current)},[]);return(0,i.useEffect)(function(){if(d!==null&&g===!0){var ae,z=!1,$=!0,m=function(){return e(void 0,void 0,void 0,function(){var C,y,I;return r(this,function(x){switch(x.label){case 0:return C=M,[4,(0,l.getUrl)(d,ue)];case 1:return C.current=x.sent(),M.current===null?(console.error("Failed to get a valid URL. WebSocket connection aborted."),M.current="ABORTED",(0,o.flushSync)(function(){return O(function(N){return t(t({},N),{ABORTED:s.ReadyState.CLOSED})})}),[2]):(y=function(N){z||(0,o.flushSync)(function(){return b(N)})},I=function(N){z||(0,o.flushSync)(function(){return O(function(B){var Y;return t(t({},B),M.current&&(Y={},Y[M.current]=N,Y))})})},$&&(ae=(0,a.createOrJoinSocket)(P,M.current,I,ue,y,G,j,A,ne)),[2])}})})};return G.current=function(){z||(Q.current&&(Q.current=null),ae==null||ae(),m())},m(),function(){z=!0,$=!1,Q.current&&(Q.current=null),ae==null||ae(),b(null)}}else(d===null||g===!1)&&(j.current=0,O(function(C){var y;return t(t({},C),M.current&&(y={},y[M.current]=s.ReadyState.CLOSED,y))}))},[d,g,Z,ne]),(0,i.useEffect)(function(){J===s.ReadyState.OPEN&&q.current.splice(0).forEach(function(ae){ne(ae)})},[J]),{sendMessage:ne,sendJsonMessage:ee,lastMessage:v,lastJsonMessage:T,readyState:J,getWebSocket:te}};return Pn.useWebSocket=h,Pn}var xa={},vP;function WB(){if(vP)return xa;vP=1;var t=xa&&xa.__assign||function(){return t=Object.assign||function(a){for(var l,u=1,c=arguments.length;u<c;u++){l=arguments[u];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(a[h]=l[h])}return a},t.apply(this,arguments)};Object.defineProperty(xa,"__esModule",{value:!0}),xa.useSocketIO=void 0;var e=oe,r=UE(),n=Io(),i={type:"empty",payload:null},o=function(a){if(!a||!a.data)return i;var l=a.data.match(/\[.*]/);if(!l)return i;var u=JSON.parse(l);return!Array.isArray(u)||!u[1]?i:{type:u[0],payload:u[1]}},s=function(a,l,u){l===void 0&&(l=n.DEFAULT_OPTIONS),u===void 0&&(u=!0);var c=(0,e.useMemo)(function(){return t(t({},l),{fromSocketIO:!0})},[]),h=(0,r.useWebSocket)(a,c,u),d=h.sendMessage,f=h.sendJsonMessage,g=h.lastMessage,w=h.readyState,v=h.getWebSocket,b=(0,e.useMemo)(function(){return o(g)},[g]);return{sendMessage:d,sendJsonMessage:f,lastMessage:b,lastJsonMessage:b,readyState:w,getWebSocket:v}};return xa.useSocketIO=s,xa}var Vo={},yP;function BB(){if(yP)return Vo;yP=1;var t=Vo&&Vo.__assign||function(){return t=Object.assign||function(s){for(var a,l=1,u=arguments.length;l<u;l++){a=arguments[l];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(s[c]=a[c])}return s},t.apply(this,arguments)},e=Vo&&Vo.__rest||function(s,a){var l={};for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&a.indexOf(u)<0&&(l[u]=s[u]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,u=Object.getOwnPropertySymbols(s);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(s,u[c])&&(l[u[c]]=s[u[c]]);return l};Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.useEventSource=void 0;var r=oe,n=UE(),i=Io(),o=function(s,a,l){a===void 0&&(a=i.DEFAULT_EVENT_SOURCE_OPTIONS);var u=a.withCredentials,c=a.events,h=e(a,["withCredentials","events"]);l===void 0&&(l=!0);var d=t(t({},h),{eventSourceOptions:{withCredentials:u}}),f=(0,r.useRef)(i.EMPTY_EVENT_HANDLERS);c&&(f.current=c);var g=(0,n.useWebSocket)(s,d,l),w=g.lastMessage,v=g.readyState,b=g.getWebSocket;return(0,r.useEffect)(function(){w!=null&&w.type&&Object.entries(f.current).forEach(function(p){var _=p[0],O=p[1];_===w.type&&O(w)})},[w]),{lastEvent:w,readyState:v,getEventSource:b}};return Vo.useEventSource=o,Vo}var CP;function jB(){return CP||(CP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetGlobalState=t.useEventSource=t.ReadyState=t.useSocketIO=t.default=void 0;var e=UE();Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.useWebSocket}});var r=WB();Object.defineProperty(t,"useSocketIO",{enumerable:!0,get:function(){return r.useSocketIO}});var n=Io();Object.defineProperty(t,"ReadyState",{enumerable:!0,get:function(){return n.ReadyState}});var i=BB();Object.defineProperty(t,"useEventSource",{enumerable:!0,get:function(){return i.useEventSource}});var o=jE();Object.defineProperty(t,"resetGlobalState",{enumerable:!0,get:function(){return o.resetGlobalState}})}(nv)),nv}var UB=jB();const zB=ok(UB);var Ur=function(){return Ur=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ur.apply(this,arguments)};function va(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function YB(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var GB=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,qB=YB(function(t){return GB.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),At="-ms-",ld="-moz-",dt="-webkit-",ak="comm",Xp="rule",zE="decl",KB="@import",lk="@keyframes",XB="@layer",uk=Math.abs,YE=String.fromCharCode,SR=Object.assign;function ZB(t,e){return Pr(t,0)^45?(((e<<2^Pr(t,0))<<2^Pr(t,1))<<2^Pr(t,2))<<2^Pr(t,3):0}function ck(t){return t.trim()}function ss(t,e){return(t=e.exec(t))?t[0]:t}function $e(t,e,r){return t.replace(e,r)}function Cm(t,e,r){return t.indexOf(e,r)}function Pr(t,e){return t.charCodeAt(e)|0}function fc(t,e,r){return t.slice(e,r)}function Co(t){return t.length}function hk(t){return t.length}function ed(t,e){return e.push(t),t}function JB(t,e){return t.map(e).join("")}function bP(t,e){return t.filter(function(r){return!ss(r,e)})}var Zp=1,gc=1,dk=0,ui=0,hr=0,Tc="";function Jp(t,e,r,n,i,o,s,a){return{value:t,root:e,parent:r,type:n,props:i,children:o,line:Zp,column:gc,length:s,return:"",siblings:a}}function Ks(t,e){return SR(Jp("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function ou(t){for(;t.root;)t=Ks(t.root,{children:[t]});ed(t,t.siblings)}function QB(){return hr}function ej(){return hr=ui>0?Pr(Tc,--ui):0,gc--,hr===10&&(gc=1,Zp--),hr}function Li(){return hr=ui<dk?Pr(Tc,ui++):0,gc++,hr===10&&(gc=1,Zp++),hr}function Al(){return Pr(Tc,ui)}function bm(){return ui}function Qp(t,e){return fc(Tc,t,e)}function RR(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tj(t){return Zp=gc=1,dk=Co(Tc=t),ui=0,[]}function rj(t){return Tc="",t}function lv(t){return ck(Qp(ui-1,ER(t===91?t+2:t===40?t+1:t)))}function nj(t){for(;(hr=Al())&&hr<33;)Li();return RR(t)>2||RR(hr)>3?"":" "}function ij(t,e){for(;--e&&Li()&&!(hr<48||hr>102||hr>57&&hr<65||hr>70&&hr<97););return Qp(t,bm()+(e<6&&Al()==32&&Li()==32))}function ER(t){for(;Li();)switch(hr){case t:return ui;case 34:case 39:t!==34&&t!==39&&ER(hr);break;case 40:t===41&&ER(t);break;case 92:Li();break}return ui}function oj(t,e){for(;Li()&&t+hr!==57;)if(t+hr===84&&Al()===47)break;return"/*"+Qp(e,ui-1)+"*"+YE(t===47?t:Li())}function sj(t){for(;!RR(Al());)Li();return Qp(t,ui)}function aj(t){return rj(Sm("",null,null,null,[""],t=tj(t),0,[0],t))}function Sm(t,e,r,n,i,o,s,a,l){for(var u=0,c=0,h=s,d=0,f=0,g=0,w=1,v=1,b=1,p=0,_="",O=i,T=o,M=n,P=_;v;)switch(g=p,p=Li()){case 40:if(g!=108&&Pr(P,h-1)==58){Cm(P+=$e(lv(p),"&","&\f"),"&\f",uk(u?a[u-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:P+=lv(p);break;case 9:case 10:case 13:case 32:P+=nj(g);break;case 92:P+=ij(bm()-1,7);continue;case 47:switch(Al()){case 42:case 47:ed(lj(oj(Li(),bm()),e,r,l),l);break;default:P+="/"}break;case 123*w:a[u++]=Co(P)*b;case 125*w:case 59:case 0:switch(p){case 0:case 125:v=0;case 59+c:b==-1&&(P=$e(P,/\f/g,"")),f>0&&Co(P)-h&&ed(f>32?RP(P+";",n,r,h-1,l):RP($e(P," ","")+";",n,r,h-2,l),l);break;case 59:P+=";";default:if(ed(M=SP(P,e,r,u,c,i,a,_,O=[],T=[],h,o),o),p===123)if(c===0)Sm(P,e,M,M,O,o,h,a,T);else switch(d===99&&Pr(P,3)===110?100:d){case 100:case 108:case 109:case 115:Sm(t,M,M,n&&ed(SP(t,M,M,0,0,i,a,_,i,O=[],h,T),T),i,T,h,a,n?O:T);break;default:Sm(P,M,M,M,[""],T,0,a,T)}}u=c=f=0,w=b=1,_=P="",h=s;break;case 58:h=1+Co(P),f=g;default:if(w<1){if(p==123)--w;else if(p==125&&w++==0&&ej()==125)continue}switch(P+=YE(p),p*w){case 38:b=c>0?1:(P+="\f",-1);break;case 44:a[u++]=(Co(P)-1)*b,b=1;break;case 64:Al()===45&&(P+=lv(Li())),d=Al(),c=h=Co(_=P+=sj(bm())),p++;break;case 45:g===45&&Co(P)==2&&(w=0)}}return o}function SP(t,e,r,n,i,o,s,a,l,u,c,h){for(var d=i-1,f=i===0?o:[""],g=hk(f),w=0,v=0,b=0;w<n;++w)for(var p=0,_=fc(t,d+1,d=uk(v=s[w])),O=t;p<g;++p)(O=ck(v>0?f[p]+" "+_:$e(_,/&\f/g,f[p])))&&(l[b++]=O);return Jp(t,e,r,i===0?Xp:a,l,u,c,h)}function lj(t,e,r,n){return Jp(t,e,r,ak,YE(QB()),fc(t,2,-2),0,n)}function RP(t,e,r,n,i){return Jp(t,e,r,zE,fc(t,0,n),fc(t,n+1,-1),n,i)}function fk(t,e,r){switch(ZB(t,e)){case 5103:return dt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return dt+t+t;case 4789:return ld+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return dt+t+ld+t+At+t+t;case 5936:switch(Pr(t,e+11)){case 114:return dt+t+At+$e(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return dt+t+At+$e(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return dt+t+At+$e(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return dt+t+At+t+t;case 6165:return dt+t+At+"flex-"+t+t;case 5187:return dt+t+$e(t,/(\w+).+(:[^]+)/,dt+"box-$1$2"+At+"flex-$1$2")+t;case 5443:return dt+t+At+"flex-item-"+$e(t,/flex-|-self/g,"")+(ss(t,/flex-|baseline/)?"":At+"grid-row-"+$e(t,/flex-|-self/g,""))+t;case 4675:return dt+t+At+"flex-line-pack"+$e(t,/align-content|flex-|-self/g,"")+t;case 5548:return dt+t+At+$e(t,"shrink","negative")+t;case 5292:return dt+t+At+$e(t,"basis","preferred-size")+t;case 6060:return dt+"box-"+$e(t,"-grow","")+dt+t+At+$e(t,"grow","positive")+t;case 4554:return dt+$e(t,/([^-])(transform)/g,"$1"+dt+"$2")+t;case 6187:return $e($e($e(t,/(zoom-|grab)/,dt+"$1"),/(image-set)/,dt+"$1"),t,"")+t;case 5495:case 3959:return $e(t,/(image-set\([^]*)/,dt+"$1$`$1");case 4968:return $e($e(t,/(.+:)(flex-)?(.*)/,dt+"box-pack:$3"+At+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+dt+t+t;case 4200:if(!ss(t,/flex-|baseline/))return At+"grid-column-align"+fc(t,e)+t;break;case 2592:case 3360:return At+$e(t,"template-","")+t;case 4384:case 3616:return r&&r.some(function(n,i){return e=i,ss(n.props,/grid-\w+-end/)})?~Cm(t+(r=r[e].value),"span",0)?t:At+$e(t,"-start","")+t+At+"grid-row-span:"+(~Cm(r,"span",0)?ss(r,/\d+/):+ss(r,/\d+/)-+ss(t,/\d+/))+";":At+$e(t,"-start","")+t;case 4896:case 4128:return r&&r.some(function(n){return ss(n.props,/grid-\w+-start/)})?t:At+$e($e(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return $e(t,/(.+)-inline(.+)/,dt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Co(t)-1-e>6)switch(Pr(t,e+1)){case 109:if(Pr(t,e+4)!==45)break;case 102:return $e(t,/(.+:)(.+)-([^]+)/,"$1"+dt+"$2-$3$1"+ld+(Pr(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Cm(t,"stretch",0)?fk($e(t,"stretch","fill-available"),e,r)+t:t}break;case 5152:case 5920:return $e(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,i,o,s,a,l,u){return At+i+":"+o+u+(s?At+i+"-span:"+(a?l:+l-+o)+u:"")+t});case 4949:if(Pr(t,e+6)===121)return $e(t,":",":"+dt)+t;break;case 6444:switch(Pr(t,Pr(t,14)===45?18:11)){case 120:return $e(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+dt+(Pr(t,14)===45?"inline-":"")+"box$3$1"+dt+"$2$3$1"+At+"$2box$3")+t;case 100:return $e(t,":",":"+At)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return $e(t,"scroll-","scroll-snap-")+t}return t}function Km(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function uj(t,e,r,n){switch(t.type){case XB:if(t.children.length)break;case KB:case zE:return t.return=t.return||t.value;case ak:return"";case lk:return t.return=t.value+"{"+Km(t.children,n)+"}";case Xp:if(!Co(t.value=t.props.join(",")))return""}return Co(r=Km(t.children,n))?t.return=t.value+"{"+r+"}":""}function cj(t){var e=hk(t);return function(r,n,i,o){for(var s="",a=0;a<e;a++)s+=t[a](r,n,i,o)||"";return s}}function hj(t){return function(e){e.root||(e=e.return)&&t(e)}}function dj(t,e,r,n){if(t.length>-1&&!t.return)switch(t.type){case zE:t.return=fk(t.value,t.length,r);return;case lk:return Km([Ks(t,{value:$e(t.value,"@","@"+dt)})],n);case Xp:if(t.length)return JB(r=t.props,function(i){switch(ss(i,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":ou(Ks(t,{props:[$e(i,/:(read-\w+)/,":"+ld+"$1")]})),ou(Ks(t,{props:[i]})),SR(t,{props:bP(r,n)});break;case"::placeholder":ou(Ks(t,{props:[$e(i,/:(plac\w+)/,":"+dt+"input-$1")]})),ou(Ks(t,{props:[$e(i,/:(plac\w+)/,":"+ld+"$1")]})),ou(Ks(t,{props:[$e(i,/:(plac\w+)/,At+"input-$1")]})),ou(Ks(t,{props:[i]})),SR(t,{props:bP(r,n)});break}return""})}}var fj={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},kl=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",gk="active",mk="data-styled-version",ew="6.1.18",GE=`/*!sc*/
|
|
23
|
+
`,Xm=typeof window<"u"&&typeof document<"u",gj=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),mj={},EP=/invalid hook call/i,Af=new Set,pk=function(t,e){if(process.env.NODE_ENV!=="production"){var r=e?' with the id of "'.concat(e,'"'):"",n="The component ".concat(t).concat(r,` has been created dynamically.
|
|
24
|
+
`)+`You may see this warning because you've called styled inside another component.
|
|
25
|
+
To resolve this only create new StyledComponents outside of any render method and function component.
|
|
26
|
+
See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
|
|
27
|
+
`,i=console.error;try{var o=!0;console.error=function(s){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];EP.test(s)?(o=!1,Af.delete(n)):i.apply(void 0,va([s],a,!1))},oe.useRef(),o&&!Af.has(n)&&(console.warn(n),Af.add(n))}catch(s){EP.test(s.message)&&Af.delete(n)}finally{console.error=i}}},tw=Object.freeze([]),mc=Object.freeze({});function wk(t,e,r){return r===void 0&&(r=mc),t.theme!==r.theme&&t.theme||e||r.theme}var TR=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),pj=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,wj=/(^-|-$)/g;function TP(t){return t.replace(pj,"-").replace(wj,"")}var vj=/(a)(d)/gi,Hf=52,_P=function(t){return String.fromCharCode(t+(t>25?39:97))};function _R(t){var e,r="";for(e=Math.abs(t);e>Hf;e=e/Hf|0)r=_P(e%Hf)+r;return(_P(e%Hf)+r).replace(vj,"$1-$2")}var uv,vk=5381,bl=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},yk=function(t){return bl(vk,t)};function qE(t){return _R(yk(t)>>>0)}function Ck(t){return process.env.NODE_ENV!=="production"&&typeof t=="string"&&t||t.displayName||t.name||"Component"}function cv(t){return typeof t=="string"&&(process.env.NODE_ENV==="production"||t.charAt(0)===t.charAt(0).toLowerCase())}var bk=typeof Symbol=="function"&&Symbol.for,Sk=bk?Symbol.for("react.memo"):60115,yj=bk?Symbol.for("react.forward_ref"):60112,Cj={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},bj={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Rk={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Sj=((uv={})[yj]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},uv[Sk]=Rk,uv);function MP(t){return("type"in(e=t)&&e.type.$$typeof)===Sk?Rk:"$$typeof"in t?Sj[t.$$typeof]:Cj;var e}var Rj=Object.defineProperty,Ej=Object.getOwnPropertyNames,PP=Object.getOwnPropertySymbols,Tj=Object.getOwnPropertyDescriptor,_j=Object.getPrototypeOf,IP=Object.prototype;function Ek(t,e,r){if(typeof e!="string"){if(IP){var n=_j(e);n&&n!==IP&&Ek(t,n,r)}var i=Ej(e);PP&&(i=i.concat(PP(e)));for(var o=MP(t),s=MP(e),a=0;a<i.length;++a){var l=i[a];if(!(l in bj||r&&r[l]||s&&l in s||o&&l in o)){var u=Tj(e,l);try{Rj(t,l,u)}catch{}}}}return t}function pc(t){return typeof t=="function"}function KE(t){return typeof t=="object"&&"styledComponentId"in t}function Tl(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function Zm(t,e){if(t.length===0)return"";for(var r=t[0],n=1;n<t.length;n++)r+=t[n];return r}function wc(t){return t!==null&&typeof t=="object"&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function MR(t,e,r){if(r===void 0&&(r=!1),!r&&!wc(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var n=0;n<e.length;n++)t[n]=MR(t[n],e[n]);else if(wc(e))for(var n in e)t[n]=MR(t[n],e[n]);return t}function XE(t,e){Object.defineProperty(t,"toString",{value:e})}var Mj=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
28
|
+
|
|
29
|
+
`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
|
|
30
|
+
|
|
31
|
+
- Are you trying to reuse it across renders?
|
|
32
|
+
- Are you accidentally calling collectStyles twice?
|
|
33
|
+
|
|
34
|
+
`,3:`Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
|
|
35
|
+
|
|
36
|
+
`,4:`The \`StyleSheetManager\` expects a valid target or sheet prop!
|
|
37
|
+
|
|
38
|
+
- Does this error occur on the client and is your target falsy?
|
|
39
|
+
- Does this error occur on the server and is the sheet falsy?
|
|
40
|
+
|
|
41
|
+
`,5:`The clone method cannot be used on the client!
|
|
42
|
+
|
|
43
|
+
- Are you running in a client-like environment on the server?
|
|
44
|
+
- Are you trying to run SSR on the client?
|
|
45
|
+
|
|
46
|
+
`,6:`Trying to insert a new style tag, but the given Node is unmounted!
|
|
47
|
+
|
|
48
|
+
- Are you using a custom target that isn't mounted?
|
|
49
|
+
- Does your document not have a valid head element?
|
|
50
|
+
- Have you accidentally removed a style tag manually?
|
|
51
|
+
|
|
52
|
+
`,7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:`ThemeProvider: Please make your "theme" prop an object.
|
|
53
|
+
|
|
54
|
+
`,9:"Missing document `<head>`\n\n",10:`Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
|
|
55
|
+
|
|
56
|
+
`,11:`_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
|
|
57
|
+
|
|
58
|
+
`,12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:`%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
|
|
59
|
+
|
|
60
|
+
`,14:`ThemeProvider: "theme" prop is required.
|
|
61
|
+
|
|
62
|
+
`,15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:`Reached the limit of how many styled components may be created at group %s.
|
|
63
|
+
You may only create up to 1,073,741,824 components. If you're creating components dynamically,
|
|
64
|
+
as for instance in your render method then you may be running into this limitation.
|
|
65
|
+
|
|
66
|
+
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
|
|
67
|
+
Has styled-components' style tag been unmounted or altered by another script?
|
|
68
|
+
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function Pj(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=t[0],n=[],i=1,o=t.length;i<o;i+=1)n.push(t[i]);return n.forEach(function(s){r=r.replace(/%[a-z]/,s)}),r}function _c(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):"")):new Error(Pj.apply(void 0,va([Mj[t]],e,!1)).trim())}var Ij=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var r=0,n=0;n<e;n++)r+=this.groupSizes[n];return r},t.prototype.insertRules=function(e,r){if(e>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,o=i;e>=o;)if((o<<=1)<0)throw _c(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=i;s<o;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(e+1),l=(s=0,r.length);s<l;s++)this.tag.insertRule(a,r[s])&&(this.groupSizes[e]++,a++)},t.prototype.clearGroup=function(e){if(e<this.length){var r=this.groupSizes[e],n=this.indexOfGroup(e),i=n+r;this.groupSizes[e]=0;for(var o=n;o<i;o++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(e){var r="";if(e>=this.length||this.groupSizes[e]===0)return r;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),o=i+n,s=i;s<o;s++)r+="".concat(this.tag.getRule(s)).concat(GE);return r},t}(),Oj=1<<30,Rm=new Map,Jm=new Map,Em=1,Nf=function(t){if(Rm.has(t))return Rm.get(t);for(;Jm.has(Em);)Em++;var e=Em++;if(process.env.NODE_ENV!=="production"&&((0|e)<0||e>Oj))throw _c(16,"".concat(e));return Rm.set(t,e),Jm.set(e,t),e},xj=function(t,e){Em=e+1,Rm.set(t,e),Jm.set(e,t)},Aj="style[".concat(kl,"][").concat(mk,'="').concat(ew,'"]'),Hj=new RegExp("^".concat(kl,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Nj=function(t,e,r){for(var n,i=r.split(","),o=0,s=i.length;o<s;o++)(n=i[o])&&t.registerName(e,n)},Dj=function(t,e){for(var r,n=((r=e.textContent)!==null&&r!==void 0?r:"").split(GE),i=[],o=0,s=n.length;o<s;o++){var a=n[o].trim();if(a){var l=a.match(Hj);if(l){var u=0|parseInt(l[1],10),c=l[2];u!==0&&(xj(c,u),Nj(t,c,l[3]),t.getTag().insertRules(u,i)),i.length=0}else i.push(a)}}},OP=function(t){for(var e=document.querySelectorAll(Aj),r=0,n=e.length;r<n;r++){var i=e[r];i&&i.getAttribute(kl)!==gk&&(Dj(t,i),i.parentNode&&i.parentNode.removeChild(i))}};function kj(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Tk=function(t){var e=document.head,r=t||e,n=document.createElement("style"),i=function(a){var l=Array.from(a.querySelectorAll("style[".concat(kl,"]")));return l[l.length-1]}(r),o=i!==void 0?i.nextSibling:null;n.setAttribute(kl,gk),n.setAttribute(mk,ew);var s=kj();return s&&n.setAttribute("nonce",s),r.insertBefore(n,o),n},Lj=function(){function t(e){this.element=Tk(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(r){if(r.sheet)return r.sheet;for(var n=document.styleSheets,i=0,o=n.length;i<o;i++){var s=n[i];if(s.ownerNode===r)return s}throw _c(17)}(this.element),this.length=0}return t.prototype.insertRule=function(e,r){try{return this.sheet.insertRule(r,e),this.length++,!0}catch{return!1}},t.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.prototype.getRule=function(e){var r=this.sheet.cssRules[e];return r&&r.cssText?r.cssText:""},t}(),$j=function(){function t(e){this.element=Tk(e),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(e,r){if(e<=this.length&&e>=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},t}(),Fj=function(){function t(e){this.rules=[],this.length=0}return t.prototype.insertRule=function(e,r){return e<=this.length&&(this.rules.splice(e,0,r),this.length++,!0)},t.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},t}(),xP=Xm,Vj={isServer:!Xm,useCSSOMInjection:!gj},Qm=function(){function t(e,r,n){e===void 0&&(e=mc),r===void 0&&(r={});var i=this;this.options=Ur(Ur({},Vj),e),this.gs=r,this.names=new Map(n),this.server=!!e.isServer,!this.server&&Xm&&xP&&(xP=!1,OP(this)),XE(this,function(){return function(o){for(var s=o.getTag(),a=s.length,l="",u=function(h){var d=function(b){return Jm.get(b)}(h);if(d===void 0)return"continue";var f=o.names.get(d),g=s.getGroup(h);if(f===void 0||!f.size||g.length===0)return"continue";var w="".concat(kl,".g").concat(h,'[id="').concat(d,'"]'),v="";f!==void 0&&f.forEach(function(b){b.length>0&&(v+="".concat(b,","))}),l+="".concat(g).concat(w,'{content:"').concat(v,'"}').concat(GE)},c=0;c<a;c++)u(c);return l}(i)})}return t.registerId=function(e){return Nf(e)},t.prototype.rehydrate=function(){!this.server&&Xm&&OP(this)},t.prototype.reconstructWithOptions=function(e,r){return r===void 0&&(r=!0),new t(Ur(Ur({},this.options),e),this.gs,r&&this.names||void 0)},t.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(e=function(r){var n=r.useCSSOMInjection,i=r.target;return r.isServer?new Fj(i):n?new Lj(i):new $j(i)}(this.options),new Ij(e)));var e},t.prototype.hasNameForId=function(e,r){return this.names.has(e)&&this.names.get(e).has(r)},t.prototype.registerName=function(e,r){if(Nf(e),this.names.has(e))this.names.get(e).add(r);else{var n=new Set;n.add(r),this.names.set(e,n)}},t.prototype.insertRules=function(e,r,n){this.registerName(e,r),this.getTag().insertRules(Nf(e),n)},t.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.prototype.clearRules=function(e){this.getTag().clearGroup(Nf(e)),this.clearNames(e)},t.prototype.clearTag=function(){this.tag=void 0},t}(),Wj=/&/g,Bj=/^\s*\/\/.*$/gm;function _k(t,e){return t.map(function(r){return r.type==="rule"&&(r.value="".concat(e," ").concat(r.value),r.value=r.value.replaceAll(",",",".concat(e," ")),r.props=r.props.map(function(n){return"".concat(e," ").concat(n)})),Array.isArray(r.children)&&r.type!=="@keyframes"&&(r.children=_k(r.children,e)),r})}function jj(t){var e,r,n,i=mc,o=i.options,s=o===void 0?mc:o,a=i.plugins,l=a===void 0?tw:a,u=function(d,f,g){return g.startsWith(r)&&g.endsWith(r)&&g.replaceAll(r,"").length>0?".".concat(e):d},c=l.slice();c.push(function(d){d.type===Xp&&d.value.includes("&")&&(d.props[0]=d.props[0].replace(Wj,r).replace(n,u))}),s.prefix&&c.push(dj),c.push(uj);var h=function(d,f,g,w){f===void 0&&(f=""),g===void 0&&(g=""),w===void 0&&(w="&"),e=w,r=f,n=new RegExp("\\".concat(r,"\\b"),"g");var v=d.replace(Bj,""),b=aj(g||f?"".concat(g," ").concat(f," { ").concat(v," }"):v);s.namespace&&(b=_k(b,s.namespace));var p=[];return Km(b,cj(c.concat(hj(function(_){return p.push(_)})))),p};return h.hash=l.length?l.reduce(function(d,f){return f.name||_c(15),bl(d,f.name)},vk).toString():"",h}var Uj=new Qm,PR=jj(),Mk=oe.createContext({shouldForwardProp:void 0,styleSheet:Uj,stylis:PR});Mk.Consumer;oe.createContext(void 0);function IR(){return oe.useContext(Mk)}var OR=function(){function t(e,r){var n=this;this.inject=function(i,o){o===void 0&&(o=PR);var s=n.name+o.hash;i.hasNameForId(n.id,s)||i.insertRules(n.id,s,o(n.rules,s,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=r,XE(this,function(){throw _c(12,String(n.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=PR),this.name+e.hash},t}(),zj=function(t){return t>="A"&&t<="Z"};function AP(t){for(var e="",r=0;r<t.length;r++){var n=t[r];if(r===1&&n==="-"&&t[0]==="-")return t;zj(n)?e+="-"+n.toLowerCase():e+=n}return e.startsWith("ms-")?"-"+e:e}var Pk=function(t){return t==null||t===!1||t===""},Ik=function(t){var e,r,n=[];for(var i in t){var o=t[i];t.hasOwnProperty(i)&&!Pk(o)&&(Array.isArray(o)&&o.isCss||pc(o)?n.push("".concat(AP(i),":"),o,";"):wc(o)?n.push.apply(n,va(va(["".concat(i," {")],Ik(o),!1),["}"],!1)):n.push("".concat(AP(i),": ").concat((e=i,(r=o)==null||typeof r=="boolean"||r===""?"":typeof r!="number"||r===0||e in fj||e.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return n};function fa(t,e,r,n){if(Pk(t))return[];if(KE(t))return[".".concat(t.styledComponentId)];if(pc(t)){if(!pc(o=t)||o.prototype&&o.prototype.isReactComponent||!e)return[t];var i=t(e);return process.env.NODE_ENV==="production"||typeof i!="object"||Array.isArray(i)||i instanceof OR||wc(i)||i===null||console.error("".concat(Ck(t)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),fa(i,e,r,n)}var o;return t instanceof OR?r?(t.inject(r,n),[t.getName(n)]):[t]:wc(t)?Ik(t):Array.isArray(t)?Array.prototype.concat.apply(tw,t.map(function(s){return fa(s,e,r,n)})):[t.toString()]}function Ok(t){for(var e=0;e<t.length;e+=1){var r=t[e];if(pc(r)&&!KE(r))return!1}return!0}var Yj=yk(ew),Gj=function(){function t(e,r,n){this.rules=e,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(n===void 0||n.isStatic)&&Ok(e),this.componentId=r,this.baseHash=bl(Yj,r),this.baseStyle=n,Qm.registerId(r)}return t.prototype.generateAndInjectStyles=function(e,r,n){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,r,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(this.componentId,this.staticRulesId))i=Tl(i,this.staticRulesId);else{var o=Zm(fa(this.rules,e,r,n)),s=_R(bl(this.baseHash,o)>>>0);if(!r.hasNameForId(this.componentId,s)){var a=n(o,".".concat(s),void 0,this.componentId);r.insertRules(this.componentId,s,a)}i=Tl(i,s),this.staticRulesId=s}else{for(var l=bl(this.baseHash,n.hash),u="",c=0;c<this.rules.length;c++){var h=this.rules[c];if(typeof h=="string")u+=h,process.env.NODE_ENV!=="production"&&(l=bl(l,h));else if(h){var d=Zm(fa(h,e,r,n));l=bl(l,d+c),u+=d}}if(u){var f=_R(l>>>0);r.hasNameForId(this.componentId,f)||r.insertRules(this.componentId,f,n(u,".".concat(f),void 0,this.componentId)),i=Tl(i,f)}}return i},t}(),ZE=oe.createContext(void 0);ZE.Consumer;var hv={},HP=new Set;function qj(t,e,r){var n=KE(t),i=t,o=!cv(t),s=e.attrs,a=s===void 0?tw:s,l=e.componentId,u=l===void 0?function(O,T){var M=typeof O!="string"?"sc":TP(O);hv[M]=(hv[M]||0)+1;var P="".concat(M,"-").concat(qE(ew+M+hv[M]));return T?"".concat(T,"-").concat(P):P}(e.displayName,e.parentComponentId):l,c=e.displayName,h=c===void 0?function(O){return cv(O)?"styled.".concat(O):"Styled(".concat(Ck(O),")")}(t):c,d=e.displayName&&e.componentId?"".concat(TP(e.displayName),"-").concat(e.componentId):e.componentId||u,f=n&&i.attrs?i.attrs.concat(a).filter(Boolean):a,g=e.shouldForwardProp;if(n&&i.shouldForwardProp){var w=i.shouldForwardProp;if(e.shouldForwardProp){var v=e.shouldForwardProp;g=function(O,T){return w(O,T)&&v(O,T)}}else g=w}var b=new Gj(r,d,n?i.componentStyle:void 0);function p(O,T){return function(M,P,G){var j=M.attrs,A=M.componentStyle,q=M.defaultProps,Q=M.foldedComponentIds,ue=M.styledComponentId,J=M.target,Z=oe.useContext(ZE),ne=IR(),ee=M.shouldForwardProp||ne.shouldForwardProp;process.env.NODE_ENV!=="production"&&oe.useDebugValue(ue);var te=wk(P,Z,q)||mc,ae=function(I,x,N){for(var B,Y=Ur(Ur({},x),{className:void 0,theme:N}),R=0;R<I.length;R+=1){var E=pc(B=I[R])?B(Y):B;for(var S in E)Y[S]=S==="className"?Tl(Y[S],E[S]):S==="style"?Ur(Ur({},Y[S]),E[S]):E[S]}return x.className&&(Y.className=Tl(Y.className,x.className)),Y}(j,P,te),z=ae.as||J,$={};for(var m in ae)ae[m]===void 0||m[0]==="$"||m==="as"||m==="theme"&&ae.theme===te||(m==="forwardedAs"?$.as=ae.forwardedAs:ee&&!ee(m,z)||($[m]=ae[m],ee||process.env.NODE_ENV!=="development"||qB(m)||HP.has(m)||!TR.has(z)||(HP.add(m),console.warn('styled-components: it looks like an unknown prop "'.concat(m,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var C=function(I,x){var N=IR(),B=I.generateAndInjectStyles(x,N.styleSheet,N.stylis);return process.env.NODE_ENV!=="production"&&oe.useDebugValue(B),B}(A,ae);process.env.NODE_ENV!=="production"&&M.warnTooManyClasses&&M.warnTooManyClasses(C);var y=Tl(Q,ue);return C&&(y+=" "+C),ae.className&&(y+=" "+ae.className),$[cv(z)&&!TR.has(z)?"class":"className"]=y,G&&($.ref=G),oe.createElement(z,$)}(_,O,T)}p.displayName=h;var _=oe.forwardRef(p);return _.attrs=f,_.componentStyle=b,_.displayName=h,_.shouldForwardProp=g,_.foldedComponentIds=n?Tl(i.foldedComponentIds,i.styledComponentId):"",_.styledComponentId=d,_.target=n?i.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(O){this._foldedDefaultProps=n?function(T){for(var M=[],P=1;P<arguments.length;P++)M[P-1]=arguments[P];for(var G=0,j=M;G<j.length;G++)MR(T,j[G],!0);return T}({},i.defaultProps,O):O}}),process.env.NODE_ENV!=="production"&&(pk(h,d),_.warnTooManyClasses=function(O,T){var M={},P=!1;return function(G){if(!P&&(M[G]=!0,Object.keys(M).length>=200)){var j=T?' with the id of "'.concat(T,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(O).concat(j,`.
|
|
69
|
+
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
|
|
70
|
+
Example:
|
|
71
|
+
const Component = styled.div.attrs(props => ({
|
|
72
|
+
style: {
|
|
73
|
+
background: props.background,
|
|
74
|
+
},
|
|
75
|
+
}))\`width: 100%;\`
|
|
76
|
+
|
|
77
|
+
<Component />`),P=!0,M={}}}}(h,d)),XE(_,function(){return".".concat(_.styledComponentId)}),o&&Ek(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function NP(t,e){for(var r=[t[0]],n=0,i=e.length;n<i;n+=1)r.push(e[n],t[n+1]);return r}var DP=function(t){return Object.assign(t,{isCss:!0})};function bo(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(pc(t)||wc(t))return DP(fa(NP(tw,va([t],e,!0))));var n=t;return e.length===0&&n.length===1&&typeof n[0]=="string"?fa(n):DP(fa(NP(n,e)))}function xR(t,e,r){if(r===void 0&&(r=mc),!e)throw _c(1,e);var n=function(i){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return t(e,r,bo.apply(void 0,va([i],o,!1)))};return n.attrs=function(i){return xR(t,e,Ur(Ur({},r),{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},n.withConfig=function(i){return xR(t,e,Ur(Ur({},r),i))},n}var xk=function(t){return xR(qj,t)},Ze=xk;TR.forEach(function(t){Ze[t]=xk(t)});var Kj=function(){function t(e,r){this.rules=e,this.componentId=r,this.isStatic=Ok(e),Qm.registerId(this.componentId+1)}return t.prototype.createStyles=function(e,r,n,i){var o=i(Zm(fa(this.rules,r,n,i)),""),s=this.componentId+e;n.insertRules(s,s,o)},t.prototype.removeStyles=function(e,r){r.clearRules(this.componentId+e)},t.prototype.renderStyles=function(e,r,n,i){e>2&&Qm.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,r,n,i)},t}();function Xj(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=bo.apply(void 0,va([t],e,!1)),i="sc-global-".concat(qE(JSON.stringify(n))),o=new Kj(n,i);process.env.NODE_ENV!=="production"&&pk(i);var s=function(l){var u=IR(),c=oe.useContext(ZE),h=oe.useRef(u.styleSheet.allocateGSInstance(i)).current;return process.env.NODE_ENV!=="production"&&oe.Children.count(l.children)&&console.warn("The global style component ".concat(i," was given child JSX. createGlobalStyle does not render children.")),process.env.NODE_ENV!=="production"&&n.some(function(d){return typeof d=="string"&&d.indexOf("@import")!==-1})&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),u.styleSheet.server&&a(h,l,u.styleSheet,c,u.stylis),oe.useLayoutEffect(function(){if(!u.styleSheet.server)return a(h,l,u.styleSheet,c,u.stylis),function(){return o.removeStyles(h,u.styleSheet)}},[h,l,u.styleSheet,c,u.stylis]),null};function a(l,u,c,h,d){if(o.isStatic)o.renderStyles(l,mj,c,d);else{var f=Ur(Ur({},u),{theme:wk(u,h,s.defaultProps)});o.renderStyles(l,f,c,d)}}return oe.memo(s)}function Zj(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var n=Zm(bo.apply(void 0,va([t],e,!1))),i=qE(n);return new OR(i,n)}process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
|
|
78
|
+
Perhaps you're looking to import 'styled-components/native'?
|
|
79
|
+
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var Df="__sc-".concat(kl,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[Df]||(window[Df]=0),window[Df]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
|
|
80
|
+
|
|
81
|
+
See https://s-c.sh/2BAXzed for more info.`),window[Df]+=1);let Kc;function Jj(t,e){return[(...i)=>{const o=()=>{Kc=void 0,t(...i)};clearTimeout(Kc),Kc=setTimeout(o,e)},()=>{Kc&&clearTimeout(Kc)}]}const Qj=t=>(t==null?void 0:t.map(e=>({sheet:e.sheet,items:e.items.map(r=>({alias:r.alias,type:r.type,row_num:r.row_num,row_start:r.row_start,items:r.items.map(n=>({alias:n.alias,type:n.type,cell:n.cell,column:n.column,action_type:n.action_type,option:n.option,cell_type:n.cell_type,value:n.value}))}))})))??[],kP=[{alias:"",type:"form",items:[{alias:"",type:"input",cell:"",action_type:[]}]}],eU=()=>{const[t,e]=oe.useState([{sheet:"Hoja 1",items:kP}]),[r,n]=oe.useState("0");return{tabs:t,activeKey:r,setActiveKey:n,addTab:()=>{const a=t.length;e([...t,{sheet:`Hoja ${a+1}`,items:kP}]),n(a.toString())},setTabs:a=>e(Qj(a)),removeTab:a=>{const l=parseInt(a),u=t.filter((c,h)=>h!==l);e(u),l===parseInt(r)&&n("0")},updateTab:(a,l)=>{const u=[...t];return u[a]={...u[a],...l},e(u),u}}};class LP extends Error{constructor(r,n){super(r);tP(this,"response");this.name="ResponseError",this.response=n}}const ud={API_GO_XCEL_HOST:null,async readTemplateIdentity(t,e){const r=await fetch(`${ud.API_GO_XCEL_HOST}/templates/identity/${e}/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!r.ok)throw new LP(`HTTP error! status: ${r.status}`,r);return await r.json()},async applyAction(t,e){const r=await fetch(`${ud.API_GO_XCEL_HOST}/excel/apply-actions/`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!r.ok)throw new LP(`HTTP error! status: ${r.status}`,r);return await r.json()}},tU=t=>new URL(t);var Ak=(t=>(t.applyActions="ws/apply-actions/",t))(Ak||{});const rU=(t,e)=>`${e.protocol??"wss"}://${tU(e.apiBaseUrl).host}/${t}`,Mr="#25cc89",nU=({primary:t})=>(oe.useEffect(()=>{if(!(typeof document>"u"))return document.body.style.setProperty("--hot-primary",t??Mr),()=>{document.body.style.removeProperty("--hot-primary")}},[t]),null),$P=(t,e)=>{const r=t.replace("#",""),n=parseInt(r.length===3?r.split("").map(a=>a+a).join(""):r,16),i=n>>16&255,o=n>>8&255,s=n&255;return`rgba(${i}, ${o}, ${s}, ${e})`},_t=t=>(t==null?void 0:t.primaryColor)??Mr,ef=t=>{const e=t==null?void 0:t.focusShadowColor;return e?e.startsWith("#")?$P(e,.2):e:$P((t==null?void 0:t.primaryColor)??_t(),.2)},iU=Zj`
|
|
82
|
+
0% {
|
|
83
|
+
transform: rotate(0deg);
|
|
84
|
+
}
|
|
85
|
+
100% {
|
|
86
|
+
transform: rotate(360deg);
|
|
87
|
+
}
|
|
88
|
+
`,oU=Ze.div`
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
padding: 20px;
|
|
94
|
+
`,sU=Ze.div`
|
|
95
|
+
border: 4px solid rgba(0, 0, 0, 0.1);
|
|
96
|
+
border-left-color: ${t=>_t(t.theme)};
|
|
97
|
+
|
|
98
|
+
border-radius: 50%;
|
|
99
|
+
width: 30px;
|
|
100
|
+
height: 30px;
|
|
101
|
+
animation: ${iU} 1s linear infinite;
|
|
102
|
+
`,aU=Ze.div`
|
|
103
|
+
margin-top: 16px;
|
|
104
|
+
color: rgba(0, 0, 0, 0.85);
|
|
105
|
+
font-size: 14px;
|
|
106
|
+
`,lU=({theme:t,text:e,className:r})=>he.jsxs(oU,{className:r,children:[he.jsx(sU,{theme:t}),e&&he.jsx(aU,{children:e})]});var JE=(t=>(t.ADD="ADD",t.READ="READ",t.EDIT="EDIT",t))(JE||{});const uU=Ze.div`
|
|
107
|
+
background-color: #fff;
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
box-shadow:
|
|
110
|
+
0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
|
111
|
+
0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
|
112
|
+
0 2px 4px 0 rgba(0, 0, 0, 0.02);
|
|
113
|
+
margin-bottom: 16px;
|
|
114
|
+
padding: 24px;
|
|
115
|
+
transition: all 0.3s;
|
|
116
|
+
|
|
117
|
+
&:hover {
|
|
118
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
|
|
119
|
+
}
|
|
120
|
+
`,cU=({children:t,className:e})=>he.jsx(uU,{className:e,children:t}),QE=bo`
|
|
121
|
+
margin: 0;
|
|
122
|
+
padding: 0;
|
|
123
|
+
color: rgba(0, 0, 0, 0.85);
|
|
124
|
+
`,hU=Ze.div`
|
|
125
|
+
${QE}
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
margin-bottom: 0.5em;
|
|
128
|
+
|
|
129
|
+
${t=>{switch(t.$level){case 1:return bo`
|
|
130
|
+
font-size: 38px;
|
|
131
|
+
line-height: 1.23;
|
|
132
|
+
`;case 2:return bo`
|
|
133
|
+
font-size: 30px;
|
|
134
|
+
line-height: 1.35;
|
|
135
|
+
`;case 3:return bo`
|
|
136
|
+
font-size: 24px;
|
|
137
|
+
line-height: 1.35;
|
|
138
|
+
`;case 4:return bo`
|
|
139
|
+
font-size: 20px;
|
|
140
|
+
line-height: 1.4;
|
|
141
|
+
`;case 5:return bo`
|
|
142
|
+
font-size: 16px;
|
|
143
|
+
line-height: 1.5;
|
|
144
|
+
`;default:return bo`
|
|
145
|
+
font-size: 24px;
|
|
146
|
+
line-height: 1.35;
|
|
147
|
+
`}}}
|
|
148
|
+
|
|
149
|
+
&:hover {
|
|
150
|
+
color: ${t=>t.theme.primaryColor??Mr};
|
|
151
|
+
}
|
|
152
|
+
`,dU=({theme:t,level:e=1,children:r,className:n})=>{const i=e===1?"h1":e===2?"h2":e===3?"h3":e===4?"h4":"h5";return he.jsx(hU,{theme:t,as:i,$level:e,className:n,children:r})},fU=Ze.span`
|
|
153
|
+
${QE}
|
|
154
|
+
font-size: 14px;
|
|
155
|
+
line-height: 1.5715;
|
|
156
|
+
`,gU=({theme:t,children:e,className:r,style:n})=>he.jsx(fU,{style:n,theme:t,className:r,children:e});Ze.p`
|
|
157
|
+
${QE}
|
|
158
|
+
font-size: 14px;
|
|
159
|
+
line-height: 1.5715;
|
|
160
|
+
margin-bottom: 1em;
|
|
161
|
+
`;const AR={Title:dU,Text:gU},mU=Ze.select`
|
|
162
|
+
width: 100%;
|
|
163
|
+
padding: ${t=>t.size==="small"?"7.25px 11px":t.size==="large"?"11.577px 11px":"9.25px 11px"};
|
|
164
|
+
font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
|
|
165
|
+
line-height: 1.5715;
|
|
166
|
+
background-color: #fff;
|
|
167
|
+
background-image: none;
|
|
168
|
+
border: 1px solid #d9d9d9;
|
|
169
|
+
border-radius: ${t=>(t==null?void 0:t.$borderRadius)??"2px"};
|
|
170
|
+
transition: all 0.3s;
|
|
171
|
+
box-sizing: border-box;
|
|
172
|
+
|
|
173
|
+
&:hover {
|
|
174
|
+
border-color: ${t=>_t(t.theme)};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&:focus {
|
|
178
|
+
border-color: ${t=>_t(t.theme)};
|
|
179
|
+
box-shadow: 0 0 0 2px
|
|
180
|
+
${t=>ef({primaryColor:_t(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??_t(t.theme)})};
|
|
181
|
+
outline: 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&:disabled {
|
|
185
|
+
background-color: #f5f5f5;
|
|
186
|
+
cursor: not-allowed;
|
|
187
|
+
opacity: 1;
|
|
188
|
+
}
|
|
189
|
+
`,HR=({id:t,value:e,disabled:r,onChange:n,options:i=[],borderRadius:o,focusShadowColor:s,...a})=>he.jsxs(mU,{...a,$borderRadius:o,$focusShadowColor:s,id:t,value:e,disabled:r,onChange:l=>n==null?void 0:n(l.target.value),children:[he.jsx("option",{value:"",children:"Select an option"}),i.map((l,u)=>he.jsx("option",{value:l.value,children:l.label},u))]}),pU=({config:t,size:e,onSizeChange:r,span:n,onSpanChange:i,languageConfig:o})=>{var l,u,c;const s=(l=o==null?void 0:o.languageOptions)==null?void 0:l[(o==null?void 0:o.language)||"es"],a=h=>h==="small"?"14px":h==="large"?"16px":"14px";return he.jsxs("div",{children:[he.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"10px",alignItems:"start"},children:[he.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[he.jsx(AR.Text,{style:{fontSize:a(e)},children:(s==null?void 0:s.formSize)??"Form size"}),he.jsx(HR,{size:e,theme:t==null?void 0:t.theme,...(u=t==null?void 0:t.components)==null?void 0:u.Select,id:"form-size",value:e,onChange:h=>r(h),options:[{value:"small",label:(s==null?void 0:s.small)??"Small"},{value:"middle",label:(s==null?void 0:s.middle)??"Middle"},{value:"large",label:(s==null?void 0:s.large)??"Large"}]})]}),he.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[he.jsx(AR.Text,{style:{fontSize:a(e)},children:(s==null?void 0:s.fieldWidthPerRow)??"Field widths (per row)"}),he.jsx(HR,{size:e,theme:t==null?void 0:t.theme,...(c=t==null?void 0:t.components)==null?void 0:c.Select,id:"field-span",value:String(n),onChange:h=>i(Number(h)),options:[{value:"8",label:(s==null?void 0:s.oneThirdRow)??"1/3 de fila"},{value:"12",label:(s==null?void 0:s.halfRow)??"Media fila"},{value:"16",label:(s==null?void 0:s.twoThirdsRow)??"2/3 de fila"},{value:"24",label:(s==null?void 0:s.fullRow)??"Fila completa"}]})]})]}),he.jsx("hr",{style:{margin:"16px 0",border:0,borderTop:"1px solid #f0f0f0"}})]})},wU=Ze.div`
|
|
190
|
+
display: flex;
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
width: 100%;
|
|
193
|
+
`,vU=Ze.div`
|
|
194
|
+
display: flex;
|
|
195
|
+
border-bottom: ${t=>t.$position==="top"?"1px solid #f0f0f0":"none"};
|
|
196
|
+
border-top: ${t=>t.$position==="bottom"?"1px solid #f0f0f0":"none"};
|
|
197
|
+
order: ${t=>t.$position==="bottom"?1:0};
|
|
198
|
+
overflow-x: auto;
|
|
199
|
+
scrollbar-width: thin;
|
|
200
|
+
|
|
201
|
+
&::-webkit-scrollbar {
|
|
202
|
+
height: 4px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&::-webkit-scrollbar-thumb {
|
|
206
|
+
background-color: #d9d9d9;
|
|
207
|
+
border-radius: 4px;
|
|
208
|
+
}
|
|
209
|
+
`,yU=Ze.button`
|
|
210
|
+
padding: 8px 16px;
|
|
211
|
+
border: none;
|
|
212
|
+
background-color: ${t=>t.$active?_t(t.theme):"transparent"};
|
|
213
|
+
color: ${t=>t.$active?"white":"rgba(0, 0, 0, 0.85)"};
|
|
214
|
+
cursor: pointer;
|
|
215
|
+
border-radius: 4px;
|
|
216
|
+
margin: 4px;
|
|
217
|
+
transition: all 0.3s;
|
|
218
|
+
font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
|
|
219
|
+
|
|
220
|
+
&:hover {
|
|
221
|
+
color: ${t=>t.$active?"white":_t(t.theme)};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
&:focus {
|
|
225
|
+
outline: none;
|
|
226
|
+
}
|
|
227
|
+
`,CU=Ze.div`
|
|
228
|
+
padding: 16px;
|
|
229
|
+
order: ${t=>t.$tabPosition==="bottom"?0:1};
|
|
230
|
+
`,bU=({items:t,activeKey:e,onChange:r,tabPosition:n="top",type:i="line",theme:o,size:s="middle"})=>{const[a,l]=oe.useState(e||(t.length>0?t[0].key:"")),u=h=>{l(h),r&&r(h)},c=t.find(h=>h.key===a);return he.jsxs(wU,{children:[he.jsx(vU,{$position:n,children:t.map(h=>he.jsx(yU,{size:s,theme:o,$active:h.key===a,onClick:()=>u(h.key),children:h.label},h.key))}),he.jsx(CU,{$tabPosition:n,children:c==null?void 0:c.children})]})};var Tm={exports:{}},SU=Tm.exports,FP;function RU(){return FP||(FP=1,function(t,e){(function(r,n){t.exports=n()})(SU,function(){var r=1e3,n=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",c="week",h="month",d="quarter",f="year",g="date",w="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(J){var Z=["th","st","nd","rd"],ne=J%100;return"["+J+(Z[(ne-20)%10]||Z[ne]||Z[0])+"]"}},_=function(J,Z,ne){var ee=String(J);return!ee||ee.length>=Z?J:""+Array(Z+1-ee.length).join(ne)+J},O={s:_,z:function(J){var Z=-J.utcOffset(),ne=Math.abs(Z),ee=Math.floor(ne/60),te=ne%60;return(Z<=0?"+":"-")+_(ee,2,"0")+":"+_(te,2,"0")},m:function J(Z,ne){if(Z.date()<ne.date())return-J(ne,Z);var ee=12*(ne.year()-Z.year())+(ne.month()-Z.month()),te=Z.clone().add(ee,h),ae=ne-te<0,z=Z.clone().add(ee+(ae?-1:1),h);return+(-(ee+(ne-te)/(ae?te-z:z-te))||0)},a:function(J){return J<0?Math.ceil(J)||0:Math.floor(J)},p:function(J){return{M:h,y:f,w:c,d:u,D:g,h:l,m:a,s,ms:o,Q:d}[J]||String(J||"").toLowerCase().replace(/s$/,"")},u:function(J){return J===void 0}},T="en",M={};M[T]=p;var P="$isDayjsObject",G=function(J){return J instanceof Q||!(!J||!J[P])},j=function J(Z,ne,ee){var te;if(!Z)return T;if(typeof Z=="string"){var ae=Z.toLowerCase();M[ae]&&(te=ae),ne&&(M[ae]=ne,te=ae);var z=Z.split("-");if(!te&&z.length>1)return J(z[0])}else{var $=Z.name;M[$]=Z,te=$}return!ee&&te&&(T=te),te||!ee&&T},A=function(J,Z){if(G(J))return J.clone();var ne=typeof Z=="object"?Z:{};return ne.date=J,ne.args=arguments,new Q(ne)},q=O;q.l=j,q.i=G,q.w=function(J,Z){return A(J,{locale:Z.$L,utc:Z.$u,x:Z.$x,$offset:Z.$offset})};var Q=function(){function J(ne){this.$L=j(ne.locale,null,!0),this.parse(ne),this.$x=this.$x||ne.x||{},this[P]=!0}var Z=J.prototype;return Z.parse=function(ne){this.$d=function(ee){var te=ee.date,ae=ee.utc;if(te===null)return new Date(NaN);if(q.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var z=te.match(v);if(z){var $=z[2]-1||0,m=(z[7]||"0").substring(0,3);return ae?new Date(Date.UTC(z[1],$,z[3]||1,z[4]||0,z[5]||0,z[6]||0,m)):new Date(z[1],$,z[3]||1,z[4]||0,z[5]||0,z[6]||0,m)}}return new Date(te)}(ne),this.init()},Z.init=function(){var ne=this.$d;this.$y=ne.getFullYear(),this.$M=ne.getMonth(),this.$D=ne.getDate(),this.$W=ne.getDay(),this.$H=ne.getHours(),this.$m=ne.getMinutes(),this.$s=ne.getSeconds(),this.$ms=ne.getMilliseconds()},Z.$utils=function(){return q},Z.isValid=function(){return this.$d.toString()!==w},Z.isSame=function(ne,ee){var te=A(ne);return this.startOf(ee)<=te&&te<=this.endOf(ee)},Z.isAfter=function(ne,ee){return A(ne)<this.startOf(ee)},Z.isBefore=function(ne,ee){return this.endOf(ee)<A(ne)},Z.$g=function(ne,ee,te){return q.u(ne)?this[ee]:this.set(te,ne)},Z.unix=function(){return Math.floor(this.valueOf()/1e3)},Z.valueOf=function(){return this.$d.getTime()},Z.startOf=function(ne,ee){var te=this,ae=!!q.u(ee)||ee,z=q.p(ne),$=function(Y,R){var E=q.w(te.$u?Date.UTC(te.$y,R,Y):new Date(te.$y,R,Y),te);return ae?E:E.endOf(u)},m=function(Y,R){return q.w(te.toDate()[Y].apply(te.toDate("s"),(ae?[0,0,0,0]:[23,59,59,999]).slice(R)),te)},C=this.$W,y=this.$M,I=this.$D,x="set"+(this.$u?"UTC":"");switch(z){case f:return ae?$(1,0):$(31,11);case h:return ae?$(1,y):$(0,y+1);case c:var N=this.$locale().weekStart||0,B=(C<N?C+7:C)-N;return $(ae?I-B:I+(6-B),y);case u:case g:return m(x+"Hours",0);case l:return m(x+"Minutes",1);case a:return m(x+"Seconds",2);case s:return m(x+"Milliseconds",3);default:return this.clone()}},Z.endOf=function(ne){return this.startOf(ne,!1)},Z.$set=function(ne,ee){var te,ae=q.p(ne),z="set"+(this.$u?"UTC":""),$=(te={},te[u]=z+"Date",te[g]=z+"Date",te[h]=z+"Month",te[f]=z+"FullYear",te[l]=z+"Hours",te[a]=z+"Minutes",te[s]=z+"Seconds",te[o]=z+"Milliseconds",te)[ae],m=ae===u?this.$D+(ee-this.$W):ee;if(ae===h||ae===f){var C=this.clone().set(g,1);C.$d[$](m),C.init(),this.$d=C.set(g,Math.min(this.$D,C.daysInMonth())).$d}else $&&this.$d[$](m);return this.init(),this},Z.set=function(ne,ee){return this.clone().$set(ne,ee)},Z.get=function(ne){return this[q.p(ne)]()},Z.add=function(ne,ee){var te,ae=this;ne=Number(ne);var z=q.p(ee),$=function(y){var I=A(ae);return q.w(I.date(I.date()+Math.round(y*ne)),ae)};if(z===h)return this.set(h,this.$M+ne);if(z===f)return this.set(f,this.$y+ne);if(z===u)return $(1);if(z===c)return $(7);var m=(te={},te[a]=n,te[l]=i,te[s]=r,te)[z]||1,C=this.$d.getTime()+ne*m;return q.w(C,this)},Z.subtract=function(ne,ee){return this.add(-1*ne,ee)},Z.format=function(ne){var ee=this,te=this.$locale();if(!this.isValid())return te.invalidDate||w;var ae=ne||"YYYY-MM-DDTHH:mm:ssZ",z=q.z(this),$=this.$H,m=this.$m,C=this.$M,y=te.weekdays,I=te.months,x=te.meridiem,N=function(R,E,S,D){return R&&(R[E]||R(ee,ae))||S[E].slice(0,D)},B=function(R){return q.s($%12||12,R,"0")},Y=x||function(R,E,S){var D=R<12?"AM":"PM";return S?D.toLowerCase():D};return ae.replace(b,function(R,E){return E||function(S){switch(S){case"YY":return String(ee.$y).slice(-2);case"YYYY":return q.s(ee.$y,4,"0");case"M":return C+1;case"MM":return q.s(C+1,2,"0");case"MMM":return N(te.monthsShort,C,I,3);case"MMMM":return N(I,C);case"D":return ee.$D;case"DD":return q.s(ee.$D,2,"0");case"d":return String(ee.$W);case"dd":return N(te.weekdaysMin,ee.$W,y,2);case"ddd":return N(te.weekdaysShort,ee.$W,y,3);case"dddd":return y[ee.$W];case"H":return String($);case"HH":return q.s($,2,"0");case"h":return B(1);case"hh":return B(2);case"a":return Y($,m,!0);case"A":return Y($,m,!1);case"m":return String(m);case"mm":return q.s(m,2,"0");case"s":return String(ee.$s);case"ss":return q.s(ee.$s,2,"0");case"SSS":return q.s(ee.$ms,3,"0");case"Z":return z}return null}(R)||z.replace(":","")})},Z.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Z.diff=function(ne,ee,te){var ae,z=this,$=q.p(ee),m=A(ne),C=(m.utcOffset()-this.utcOffset())*n,y=this-m,I=function(){return q.m(z,m)};switch($){case f:ae=I()/12;break;case h:ae=I();break;case d:ae=I()/3;break;case c:ae=(y-C)/6048e5;break;case u:ae=(y-C)/864e5;break;case l:ae=y/i;break;case a:ae=y/n;break;case s:ae=y/r;break;default:ae=y}return te?ae:q.a(ae)},Z.daysInMonth=function(){return this.endOf(h).$D},Z.$locale=function(){return M[this.$L]},Z.locale=function(ne,ee){if(!ne)return this.$L;var te=this.clone(),ae=j(ne,ee,!0);return ae&&(te.$L=ae),te},Z.clone=function(){return q.w(this.$d,this)},Z.toDate=function(){return new Date(this.valueOf())},Z.toJSON=function(){return this.isValid()?this.toISOString():null},Z.toISOString=function(){return this.$d.toISOString()},Z.toString=function(){return this.$d.toUTCString()},J}(),ue=Q.prototype;return A.prototype=ue,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",h],["$y",f],["$D",g]].forEach(function(J){ue[J[1]]=function(Z){return this.$g(Z,J[0],J[1])}}),A.extend=function(J,Z){return J.$i||(J(Z,Q,A),J.$i=!0),A},A.locale=j,A.isDayjs=G,A.unix=function(J){return A(1e3*J)},A.en=M[T],A.Ls=M,A.p={},A})}(Tm)),Tm.exports}var EU=RU();const NR=ok(EU),Hk=oe.createContext({values:{},setFieldValue:()=>{},size:"middle"}),TU=Ze.form`
|
|
231
|
+
width: 100%;
|
|
232
|
+
`,VP=Ze.div`
|
|
233
|
+
margin-bottom: 24px;
|
|
234
|
+
`,WP=Ze.label`
|
|
235
|
+
font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
|
|
236
|
+
display: block;
|
|
237
|
+
margin-bottom: 8px;
|
|
238
|
+
color: rgba(0, 0, 0, 0.85);
|
|
239
|
+
`;Ze.div`
|
|
240
|
+
color: #ff4d4f;
|
|
241
|
+
font-size: 14px;
|
|
242
|
+
margin-top: 4px;
|
|
243
|
+
`;const _U=({label:t,labelProps:e,name:r,children:n,valuePropName:i="value",className:o})=>{var c,h,d;const{values:s,setFieldValue:a,size:l}=oe.useContext(Hk),u=oe.Children.only(n);if(oe.isValidElement(u)&&r){const f=s[r],g=(c=u.props)==null?void 0:c.onChange,w=p=>{g&&g(p);const _=p&&p.target?i==="checked"?p.target.checked:p.target.value:p;a(r,_)},v={...u.props,[i]:f!==void 0?f:(h=u.props)==null?void 0:h[i],onChange:w,size:l||((d=u.props)==null?void 0:d.size)},b=oe.cloneElement(u,v);return he.jsxs(VP,{className:o,children:[t&&he.jsx(WP,{size:l,...e,children:t}),b]})}return he.jsxs(VP,{className:o,children:[t&&he.jsx(WP,{...e,children:t}),n]})},MU=({children:t,layout:e="horizontal",initialValues:r={},onValuesChange:n,size:i="middle",className:o,autoComplete:s})=>{const[a,l]=oe.useState(r);oe.useEffect(()=>{l(r)},[r]);const u=(c,h)=>{const d={...a,[c]:h};l(d),n&&n({[c]:h},d)};return he.jsx(Hk.Provider,{value:{values:a,setFieldValue:u,size:i},children:he.jsx(TU,{className:o,autoComplete:s,children:t})})},DR=MU;DR.Item=_U;const PU=Ze.div`
|
|
244
|
+
display: flex;
|
|
245
|
+
flex-wrap: wrap;
|
|
246
|
+
margin-left: ${t=>t.$gutter?`-${t.$gutter[0]/2}px`:"0"};
|
|
247
|
+
margin-right: ${t=>t.$gutter?`-${t.$gutter[0]/2}px`:"0"};
|
|
248
|
+
margin-top: ${t=>t.$gutter&&t.$gutter[1]?`-${t.$gutter[1]/2}px`:"0"};
|
|
249
|
+
margin-bottom: ${t=>t.$gutter&&t.$gutter[1]?`-${t.$gutter[1]/2}px`:"0"};
|
|
250
|
+
`,BP=({children:t,gutter:e,className:r})=>he.jsx(PU,{$gutter:e,className:r,children:oe.Children.map(t,n=>{var i;return oe.isValidElement(n)&&e?oe.cloneElement(n,{style:{paddingLeft:e[0]/2,paddingRight:e[0]/2,paddingTop:e[1]?e[1]/2:0,paddingBottom:e[1]?e[1]/2:0,...(i=n.props)==null?void 0:i.style}}):n})}),ut=t=>`${t/24*100}%`,IU=Ze.div`
|
|
251
|
+
box-sizing: border-box;
|
|
252
|
+
min-width: 0;
|
|
253
|
+
flex: 0 0 ${t=>t.$span?ut(t.$span):"100%"};
|
|
254
|
+
max-width: ${t=>t.$span?ut(t.$span):"100%"};
|
|
255
|
+
|
|
256
|
+
@media (min-width: 576px) {
|
|
257
|
+
flex: 0 0
|
|
258
|
+
${t=>t.$sm?ut(t.$sm):t.$span?ut(t.$span):"100%"};
|
|
259
|
+
max-width: ${t=>t.$sm?ut(t.$sm):t.$span?ut(t.$span):"100%"};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@media (min-width: 768px) {
|
|
263
|
+
flex: 0 0
|
|
264
|
+
${t=>t.$md?ut(t.$md):t.$sm?ut(t.$sm):t.$span?ut(t.$span):"100%"};
|
|
265
|
+
max-width: ${t=>t.$md?ut(t.$md):t.$sm?ut(t.$sm):t.$span?ut(t.$span):"100%"};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@media (min-width: 992px) {
|
|
269
|
+
flex: 0 0
|
|
270
|
+
${t=>t.$lg?ut(t.$lg):t.$md?ut(t.$md):t.$sm?ut(t.$sm):t.$span?ut(t.$span):"100%"};
|
|
271
|
+
max-width: ${t=>t.$lg?ut(t.$lg):t.$md?ut(t.$md):t.$sm?ut(t.$sm):t.$span?ut(t.$span):"100%"};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
@media (min-width: 1200px) {
|
|
275
|
+
flex: 0 0
|
|
276
|
+
${t=>t.$xl?ut(t.$xl):t.$lg?ut(t.$lg):t.$md?ut(t.$md):t.$sm?ut(t.$sm):t.$span?ut(t.$span):"100%"};
|
|
277
|
+
max-width: ${t=>t.$xl?ut(t.$xl):t.$lg?ut(t.$lg):t.$md?ut(t.$md):t.$sm?ut(t.$sm):t.$span?ut(t.$span):"100%"};
|
|
278
|
+
}
|
|
279
|
+
`,jP=({children:t,span:e,sm:r,md:n,lg:i,xl:o,className:s,style:a})=>he.jsx(IU,{$span:e,$sm:r,$md:n,$lg:i,$xl:o,className:s,style:a,children:t}),OU=Ze.div`
|
|
280
|
+
display: flex;
|
|
281
|
+
align-items: center;
|
|
282
|
+
margin-bottom: 8px;
|
|
283
|
+
`,xU=Ze.input`
|
|
284
|
+
margin-right: ${t=>t.size==="small"?"6px":t.size==="large"?"10px":"8px"};
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
accent-color: ${t=>_t(t.theme)};
|
|
287
|
+
/* Escala del checkbox nativo según size */
|
|
288
|
+
transform: ${t=>t.size==="small"?"scale(0.9)":t.size==="large"?"scale(1.1)":"scale(1)"};
|
|
289
|
+
transform-origin: left center;
|
|
290
|
+
|
|
291
|
+
&:disabled {
|
|
292
|
+
cursor: not-allowed;
|
|
293
|
+
}
|
|
294
|
+
`,AU=Ze.label`
|
|
295
|
+
cursor: pointer;
|
|
296
|
+
font-size: ${t=>t.size==="small"?"13px":t.size==="large"?"15px":"14px"};
|
|
297
|
+
line-height: 1.5715;
|
|
298
|
+
|
|
299
|
+
&:disabled {
|
|
300
|
+
cursor: not-allowed;
|
|
301
|
+
color: rgba(0, 0, 0, 0.25);
|
|
302
|
+
}
|
|
303
|
+
`,Nk=({id:t,checked:e,disabled:r,onChange:n,children:i,...o})=>he.jsxs(OU,{children:[he.jsx(xU,{...o,id:t,type:"checkbox",checked:e,disabled:r,onChange:n}),he.jsx(AU,{size:o==null?void 0:o.size,htmlFor:t,children:i})]}),HU=({id:t,value:e=[],disabled:r,onChange:n,children:i,style:o})=>{const s=(l,u)=>{const c=u?[...e,l]:e.filter(h=>h!==l);n==null||n(c)},a=oe.Children.map(i,(l,u)=>{if(oe.isValidElement(l)){const c=l.props;return oe.cloneElement(l,{...c,id:t,onCheckboxChange:s,groupValue:e,disabled:r||(c==null?void 0:c.disabled)})}return l});return he.jsx("div",{style:o,children:a})},NU=Ze.input`
|
|
304
|
+
width: 100%;
|
|
305
|
+
padding: ${t=>t.size==="small"?"4px 11px":t.size==="large"?"8px 11px":"6px 11px"};
|
|
306
|
+
font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
|
|
307
|
+
line-height: 1.5715;
|
|
308
|
+
background-color: #fff;
|
|
309
|
+
background-image: none;
|
|
310
|
+
border: 1px solid #d9d9d9;
|
|
311
|
+
border-radius: 2px;
|
|
312
|
+
transition: all 0.3s;
|
|
313
|
+
box-sizing: border-box;
|
|
314
|
+
|
|
315
|
+
&:hover {
|
|
316
|
+
border-color: ${t=>_t(t.theme)};
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
&:focus {
|
|
320
|
+
border-color: ${t=>_t(t.theme)};
|
|
321
|
+
box-shadow: 0 0 0 2px
|
|
322
|
+
${t=>ef({primaryColor:_t(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??_t(t.theme)})};
|
|
323
|
+
outline: 0;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
&:disabled {
|
|
327
|
+
background-color: #f5f5f5;
|
|
328
|
+
cursor: not-allowed;
|
|
329
|
+
opacity: 1;
|
|
330
|
+
}
|
|
331
|
+
`,DU=({value:t,disabled:e,showTime:r,onChange:n,borderRadius:i,focusShadowColor:o,...s})=>{const a=l=>{l.target.value&&n&&n(NR(l.target.value))};return he.jsx(NU,{...s,$borderRadius:i,$focusShadowColor:o,type:r?"datetime-local":"date",value:typeof t!="string"?NR(t).format(r?"YYYY-MM-DDTHH:mm":"YYYY-MM-DD"):t,disabled:e,onChange:a})},kU=Ze.input`
|
|
332
|
+
width: 100%;
|
|
333
|
+
padding: ${t=>t.size==="small"?"5px 11px":t.size==="large"?"9px 11px":"7px 11px"};
|
|
334
|
+
font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
|
|
335
|
+
line-height: 1.5715;
|
|
336
|
+
background-color: #fff;
|
|
337
|
+
background-image: none;
|
|
338
|
+
border: 1px solid #d9d9d9;
|
|
339
|
+
border-radius: ${t=>(t==null?void 0:t.$borderRadius)??"2px"};
|
|
340
|
+
transition: all 0.3s;
|
|
341
|
+
box-sizing: border-box;
|
|
342
|
+
|
|
343
|
+
&:hover {
|
|
344
|
+
border-color: ${t=>_t(t.theme)};
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
&:focus {
|
|
348
|
+
border-color: ${t=>_t(t.theme)};
|
|
349
|
+
box-shadow: 0 0 0 2px
|
|
350
|
+
${t=>ef({primaryColor:_t(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??_t(t.theme)})};
|
|
351
|
+
outline: 0;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
&:disabled,
|
|
355
|
+
&[readonly] {
|
|
356
|
+
background-color: #f5f5f5;
|
|
357
|
+
cursor: not-allowed;
|
|
358
|
+
opacity: 1;
|
|
359
|
+
}
|
|
360
|
+
`,LU=Ze.textarea`
|
|
361
|
+
width: 100%;
|
|
362
|
+
padding: ${t=>t.size==="small"?"4px 11px":t.size==="large"?"8px 11px":"6px 11px"};
|
|
363
|
+
font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
|
|
364
|
+
line-height: 1.5715;
|
|
365
|
+
background-color: #fff;
|
|
366
|
+
background-image: none;
|
|
367
|
+
border: 1px solid #d9d9d9;
|
|
368
|
+
border-radius: ${t=>(t==null?void 0:t.$borderRadius)??"2px"};
|
|
369
|
+
transition: all 0.3s;
|
|
370
|
+
min-height: 100px;
|
|
371
|
+
resize: vertical;
|
|
372
|
+
box-sizing: border-box;
|
|
373
|
+
|
|
374
|
+
&:hover {
|
|
375
|
+
border-color: ${t=>_t(t.theme)};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
&:focus {
|
|
379
|
+
border-color: ${t=>_t(t.theme)};
|
|
380
|
+
box-shadow: 0 0 0 2px
|
|
381
|
+
${t=>ef({primaryColor:_t(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??_t(t.theme)})};
|
|
382
|
+
outline: 0;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
&:disabled,
|
|
386
|
+
&[readonly] {
|
|
387
|
+
background-color: #f5f5f5;
|
|
388
|
+
cursor: not-allowed;
|
|
389
|
+
opacity: 1;
|
|
390
|
+
}
|
|
391
|
+
`,$U=({id:t,value:e,readOnly:r,onChange:n,borderRadius:i,focusShadowColor:o,...s})=>he.jsx(kU,{...s,$borderRadius:i,$focusShadowColor:o,type:"text",id:t,value:e,readOnly:r,onChange:n}),FU=({id:t,value:e,readOnly:r,onChange:n,borderRadius:i,focusShadowColor:o,...s})=>he.jsx(LU,{...s,$borderRadius:i,$focusShadowColor:o,id:t,value:e,readOnly:r,onChange:n}),VU=Ze.div`
|
|
392
|
+
display: inline-flex;
|
|
393
|
+
width: 100%;
|
|
394
|
+
position: relative;
|
|
395
|
+
`,WU=Ze.input`
|
|
396
|
+
width: 100%;
|
|
397
|
+
padding: ${t=>t.size==="small"?"5px 11px":t.size==="large"?"9px 11px":"7px 11px"};
|
|
398
|
+
font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
|
|
399
|
+
line-height: 1.5715;
|
|
400
|
+
background-color: #fff;
|
|
401
|
+
background-image: none;
|
|
402
|
+
border: 1px solid #d9d9d9;
|
|
403
|
+
border-radius: ${t=>(t==null?void 0:t.$borderRadius)??"2px"};
|
|
404
|
+
transition: all 0.3s;
|
|
405
|
+
box-sizing: border-box;
|
|
406
|
+
|
|
407
|
+
&:hover {
|
|
408
|
+
border-color: ${t=>_t(t.theme)};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
&:focus {
|
|
412
|
+
border-color: ${t=>_t(t.theme)};
|
|
413
|
+
box-shadow: 0 0 0 2px
|
|
414
|
+
${t=>ef({primaryColor:_t(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??_t(t.theme)})};
|
|
415
|
+
outline: 0;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
&:disabled {
|
|
419
|
+
background-color: #f5f5f5;
|
|
420
|
+
cursor: not-allowed;
|
|
421
|
+
opacity: 1;
|
|
422
|
+
}
|
|
423
|
+
`,BU=Ze.div`
|
|
424
|
+
position: absolute;
|
|
425
|
+
right: 0;
|
|
426
|
+
top: 0;
|
|
427
|
+
height: 100%;
|
|
428
|
+
display: flex;
|
|
429
|
+
flex-direction: column;
|
|
430
|
+
width: 22px;
|
|
431
|
+
border-left: 1px solid #d9d9d9;
|
|
432
|
+
`,UP=Ze.button`
|
|
433
|
+
height: 50%;
|
|
434
|
+
width: 100%;
|
|
435
|
+
display: flex;
|
|
436
|
+
align-items: center;
|
|
437
|
+
justify-content: center;
|
|
438
|
+
border: none;
|
|
439
|
+
background: #fafafa;
|
|
440
|
+
cursor: ${t=>t.disabled?"not-allowed":"pointer"};
|
|
441
|
+
opacity: ${t=>t.disabled?.5:1};
|
|
442
|
+
|
|
443
|
+
&:hover {
|
|
444
|
+
background-color: ${t=>t.disabled?"#fafafa":"#f0f0f0"};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
&:first-child {
|
|
448
|
+
border-bottom: 1px solid #d9d9d9;
|
|
449
|
+
}
|
|
450
|
+
`,jU=({id:t,value:e,defaultValue:r,min:n,max:i,step:o=1,disabled:s=!1,onChange:a,className:l,borderRadius:u,focusShadowColor:c,...h})=>{const[d,f]=oe.useState(e!==void 0?e:r);oe.useEffect(()=>{e!==void 0&&f(e)},[e]);const g=p=>{const _=p.target.value===""?void 0:parseFloat(p.target.value);(_===void 0||!isNaN(_))&&(f(_),a&&_!==void 0&&a(_))},w=()=>{if(d!==void 0){let p=d;n!==void 0&&d<n&&(p=n),i!==void 0&&d>i&&(p=i),p!==d&&(f(p),a&&a(p))}},v=()=>{if(s||i!==void 0&&d!==void 0&&d>=i)return;const p=(d||0)+o;f(p),a&&a(p)},b=()=>{if(s||n!==void 0&&d!==void 0&&d<=n)return;const p=(d||0)-o;f(p),a&&a(p)};return he.jsxs(VU,{className:l,children:[he.jsx(WU,{...h,$borderRadius:u,$focusShadowColor:c,id:t,type:"number",value:d===void 0?"":d,onChange:g,onBlur:w,min:n,max:i,step:o,disabled:s}),he.jsxs(BU,{children:[he.jsx(UP,{onClick:v,disabled:s||i!==void 0&&d!==void 0&&d>=i,children:"▲"}),he.jsx(UP,{onClick:b,disabled:s||n!==void 0&&d!==void 0&&d<=n,children:"▼"})]})]})},UU=Ze.div`
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
`,zU=Ze.div`
|
|
454
|
+
display: flex;
|
|
455
|
+
align-items: center;
|
|
456
|
+
margin-bottom: 8px;
|
|
457
|
+
`,YU=Ze.input`
|
|
458
|
+
margin-right: ${t=>t.size==="small"?"6px":t.size==="large"?"10px":"8px"};
|
|
459
|
+
cursor: pointer;
|
|
460
|
+
accent-color: ${t=>_t(t.theme)};
|
|
461
|
+
/* Escala del checkbox nativo según size */
|
|
462
|
+
transform: ${t=>t.size==="small"?"scale(0.9)":t.size==="large"?"scale(1.1)":"scale(1)"};
|
|
463
|
+
transform-origin: left center;
|
|
464
|
+
|
|
465
|
+
&:disabled {
|
|
466
|
+
cursor: not-allowed;
|
|
467
|
+
}
|
|
468
|
+
`,GU=Ze.label`
|
|
469
|
+
cursor: pointer;
|
|
470
|
+
font-size: ${t=>t.size==="small"?"13px":t.size==="large"?"15px":"14px"};
|
|
471
|
+
line-height: 1.5715;
|
|
472
|
+
|
|
473
|
+
&:disabled {
|
|
474
|
+
cursor: not-allowed;
|
|
475
|
+
color: rgba(0, 0, 0, 0.25);
|
|
476
|
+
}
|
|
477
|
+
`,Dk=({id:t,value:e,checked:r,disabled:n,onChange:i,children:o,...s})=>he.jsxs(zU,{children:[he.jsx(YU,{...s,id:t,type:"radio",value:e,checked:r,disabled:n,onChange:i}),he.jsx(GU,{size:s.size,htmlFor:t,children:o})]}),qU=({id:t,value:e,disabled:r,onChange:n,options:i=[],...o})=>{const s=a=>{n==null||n({target:{value:a.target.value}})};return he.jsx(UU,{children:i.map((a,l)=>oe.createElement(Dk,{...o,id:`${t}-${l}`,key:l,value:a.value,checked:e===a.value,disabled:r,onChange:s},a.label))})},KU={input:$U,check:HU,radio:qU,textarea:FU,datetime:DU,select:HR,number:jU},XU={check:Nk,radio:Dk},ZU=t=>{var n,i;const{type:e,value:r}=t;if(r==null||r==="")switch(e){case"check":return(n=t.option)!=null&&n.length?[]:!1;case"radio":return;case"number":return;case"datetime":return;case"select":return;case"input":case"textarea":default:return""}switch(e){case"check":return(i=t.option)!=null&&i.length?typeof r=="string"?r.split(", ").filter(o=>o.trim()!==""):Array.isArray(r)?r:[r].filter(Boolean):typeof r=="boolean"?r:typeof r=="string"?r.toLowerCase()==="true"||r==="1":!!r;case"radio":case"select":return r;case"number":if(typeof r=="number")return r;if(typeof r=="string"){const o=parseFloat(r);return isNaN(o)?void 0:o}return;case"datetime":if(typeof r=="string"&&r.trim()!==""){const o=NR(r);return o.isValid()?o:void 0}return;case"input":case"textarea":default:return String(r)}};function JU({config:t,itemOptions:e,...r}){const n=(l,u)=>{const c=[...r.item.items];c[l]=u,r.onUpdate({...r.item,items:c})},i=({id:l,item:u,onCheckboxChange:c,groupValue:h=[],disabled:d,...f})=>{var g;return he.jsx(he.Fragment,{children:he.jsx(BP,{children:(g=u.option)==null?void 0:g.map((w,v)=>{const b=w.value??w.alias,p=h.includes(b);return he.jsx(jP,{span:24,sm:12,md:10,lg:8,xl:6,children:he.jsx(Nk,{id:`${l}-${v}`,...f,checked:p,disabled:d,onChange:_=>{c==null||c(b,_.target.checked)},children:w.alias})},v)})})})},o=(l,u,c)=>{n(l,{...u,value:c.join(", ")})},s=(l,u)=>{var j;const c=`item${l}`,h={label:u.alias,labelProps:{htmlFor:c},name:u.cell},d=!u.action_type.includes("write"),f=!((j=u.option)!=null&&j.length)&&["check","radio"].includes(u.type)?"item1":"item",P={item:{select:()=>{var A,q;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Select,id:c,disabled:d,onChange:Q=>n(l,{...u,value:Q}),options:(q=u.option)==null?void 0:q.map(Q=>({value:Q.value??Q.alias,label:Q.alias}))}}},input:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Input,id:c,readOnly:d,onChange:q=>{n(l,{...u,value:q.target.value})}}}},check:()=>{var A;return{formItem:{labelProps:{htmlFor:void 0}},item:{id:c,children:he.jsx(i,{...(A=t==null?void 0:t.components)==null?void 0:A.Checkbox,size:e==null?void 0:e.size,theme:t==null?void 0:t.theme,item:u}),style:{width:"100%"},disabled:d,onChange:q=>{o(l,u,q)}}}},radio:()=>{var A,q;return{formItem:{labelProps:{htmlFor:void 0}},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Radio,id:c,disabled:d,onChange:Q=>n(l,{...u,value:Q.target.value}),options:(q=u.option)==null?void 0:q.map(Q=>({value:Q.value??Q.alias,label:Q.alias}))}}},textarea:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.TextArea,id:c,readOnly:d,onChange:q=>n(l,{...u,value:q.target.value})}}},datetime:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.DataPicker,id:c,disabled:d,showTime:!0,onChange:q=>n(l,{...u,value:(q==null?void 0:q.format())||""})}}},number:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.InputNumber,id:c,className:"w-full",disabled:d,onChange:q=>n(l,{...u,value:q})}}}},item1:{check:()=>{var A;return{formItem:{name:u.cell,valuePropName:"checked"},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Checkbox,id:c,disabled:d,children:u.alias,onChange:q=>n(l,{...u,value:q.target.checked})}}},radio:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Radio,disabled:d,onChange:q=>n(l,{...u,value:q.target.value})}}}}}[f][u.type],G=P==null?void 0:P();return{Component:f==="item"?KU[u.type]:XU[u.type],props:G,formItemProps:h}},a=r.item.items.reduce((l,u,c)=>(l[`item${c}`]=ZU(u),l),{});return he.jsx(DR,{layout:"vertical",className:"w-full mb-6",autoComplete:"off",initialValues:{...e,...a},size:(e==null?void 0:e.size)??"middle",children:he.jsx(BP,{gutter:[16,16],children:r.item.items.map((l,u)=>{const{Component:c,props:h,formItemProps:d}=s(u,l);return he.jsx(jP,{span:(e==null?void 0:e.span)??24,children:he.jsx(DR.Item,{...d,...h==null?void 0:h.formItem,name:`item${u}`,children:he.jsx(c,{...h==null?void 0:h.item})})},u)})})})}var zP={},Xc,YP;function ir(){if(YP)return Xc;YP=1;var t=function(e){return e&&e.Math===Math&&e};return Xc=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof rP=="object"&&rP)||t(typeof Xc=="object"&&Xc)||function(){return this}()||Function("return this")(),Xc}var dv={},fv,GP;function mr(){return GP||(GP=1,fv=function(t){try{return!!t()}catch{return!0}}),fv}var gv,qP;function hi(){if(qP)return gv;qP=1;var t=mr();return gv=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),gv}var mv,KP;function rw(){if(KP)return mv;KP=1;var t=mr();return mv=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),mv}var pv,XP;function pr(){if(XP)return pv;XP=1;var t=rw(),e=Function.prototype.call;return pv=t?e.bind(e):function(){return e.apply(e,arguments)},pv}var wv={},ZP;function QU(){if(ZP)return wv;ZP=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return wv.f=r?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,wv}var vv,JP;function nw(){return JP||(JP=1,vv=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),vv}var yv,QP;function or(){if(QP)return yv;QP=1;var t=rw(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return yv=t?n:function(i){return function(){return r.apply(i,arguments)}},yv}var Cv,eI;function Gl(){if(eI)return Cv;eI=1;var t=or(),e=t({}.toString),r=t("".slice);return Cv=function(n){return r(e(n),8,-1)},Cv}var bv,tI;function ez(){if(tI)return bv;tI=1;var t=or(),e=mr(),r=Gl(),n=Object,i=t("".split);return bv=e(function(){return!n("z").propertyIsEnumerable(0)})?function(o){return r(o)==="String"?i(o,""):n(o)}:n,bv}var Sv,rI;function e0(){return rI||(rI=1,Sv=function(t){return t==null}),Sv}var Rv,nI;function tf(){if(nI)return Rv;nI=1;var t=e0(),e=TypeError;return Rv=function(r){if(t(r))throw new e("Can't call method on "+r);return r},Rv}var Ev,iI;function rf(){if(iI)return Ev;iI=1;var t=ez(),e=tf();return Ev=function(r){return t(e(r))},Ev}var Tv,oI;function wr(){if(oI)return Tv;oI=1;var t=typeof document=="object"&&document.all;return Tv=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Tv}var _v,sI;function di(){if(sI)return _v;sI=1;var t=wr();return _v=function(e){return typeof e=="object"?e!==null:t(e)},_v}var Mv,aI;function Mc(){if(aI)return Mv;aI=1;var t=ir(),e=wr(),r=function(n){return e(n)?n:void 0};return Mv=function(n,i){return arguments.length<2?r(t[n]):t[n]&&t[n][i]},Mv}var Pv,lI;function nf(){if(lI)return Pv;lI=1;var t=or();return Pv=t({}.isPrototypeOf),Pv}var Iv,uI;function iw(){if(uI)return Iv;uI=1;var t=ir(),e=t.navigator,r=e&&e.userAgent;return Iv=r?String(r):"",Iv}var Ov,cI;function tz(){if(cI)return Ov;cI=1;var t=ir(),e=iw(),r=t.process,n=t.Deno,i=r&&r.versions||n&&n.version,o=i&&i.v8,s,a;return o&&(s=o.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),Ov=a,Ov}var xv,hI;function t0(){if(hI)return xv;hI=1;var t=tz(),e=mr(),r=ir(),n=r.String;return xv=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!n(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),xv}var Av,dI;function kk(){if(dI)return Av;dI=1;var t=t0();return Av=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Av}var Hv,fI;function r0(){if(fI)return Hv;fI=1;var t=Mc(),e=wr(),r=nf(),n=kk(),i=Object;return Hv=n?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&r(s.prototype,i(o))},Hv}var Nv,gI;function ow(){if(gI)return Nv;gI=1;var t=String;return Nv=function(e){try{return t(e)}catch{return"Object"}},Nv}var Dv,mI;function Tn(){if(mI)return Dv;mI=1;var t=wr(),e=ow(),r=TypeError;return Dv=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Dv}var kv,pI;function of(){if(pI)return kv;pI=1;var t=Tn(),e=e0();return kv=function(r,n){var i=r[n];return e(i)?void 0:t(i)},kv}var Lv,wI;function rz(){if(wI)return Lv;wI=1;var t=pr(),e=wr(),r=di(),n=TypeError;return Lv=function(i,o){var s,a;if(o==="string"&&e(s=i.toString)&&!r(a=t(s,i))||e(s=i.valueOf)&&!r(a=t(s,i))||o!=="string"&&e(s=i.toString)&&!r(a=t(s,i)))return a;throw new n("Can't convert object to primitive value")},Lv}var $v={exports:{}},Fv,vI;function ba(){return vI||(vI=1,Fv=!1),Fv}var Vv,yI;function n0(){if(yI)return Vv;yI=1;var t=ir(),e=Object.defineProperty;return Vv=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},Vv}var CI;function i0(){if(CI)return $v.exports;CI=1;var t=ba(),e=ir(),r=n0(),n="__core-js_shared__",i=$v.exports=e[n]||r(n,{});return(i.versions||(i.versions=[])).push({version:"3.43.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",source:"https://github.com/zloirock/core-js"}),$v.exports}var Wv,bI;function Lk(){if(bI)return Wv;bI=1;var t=i0();return Wv=function(e,r){return t[e]||(t[e]=r||{})},Wv}var Bv,SI;function Pc(){if(SI)return Bv;SI=1;var t=tf(),e=Object;return Bv=function(r){return e(t(r))},Bv}var jv,RI;function fi(){if(RI)return jv;RI=1;var t=or(),e=Pc(),r=t({}.hasOwnProperty);return jv=Object.hasOwn||function(i,o){return r(e(i),o)},jv}var Uv,EI;function $k(){if(EI)return Uv;EI=1;var t=or(),e=0,r=Math.random(),n=t(1.1.toString);return Uv=function(i){return"Symbol("+(i===void 0?"":i)+")_"+n(++e+r,36)},Uv}var zv,TI;function Ui(){if(TI)return zv;TI=1;var t=ir(),e=Lk(),r=fi(),n=$k(),i=t0(),o=kk(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||n;return zv=function(u){return r(a,u)||(a[u]=i&&r(s,u)?s[u]:l("Symbol."+u)),a[u]},zv}var Yv,_I;function nz(){if(_I)return Yv;_I=1;var t=pr(),e=di(),r=r0(),n=of(),i=rz(),o=Ui(),s=TypeError,a=o("toPrimitive");return Yv=function(l,u){if(!e(l)||r(l))return l;var c=n(l,a),h;if(c){if(u===void 0&&(u="default"),h=t(c,l,u),!e(h)||r(h))return h;throw new s("Can't convert object to primitive value")}return u===void 0&&(u="number"),i(l,u)},Yv}var Gv,MI;function Fk(){if(MI)return Gv;MI=1;var t=nz(),e=r0();return Gv=function(r){var n=t(r,"string");return e(n)?n:n+""},Gv}var qv,PI;function o0(){if(PI)return qv;PI=1;var t=ir(),e=di(),r=t.document,n=e(r)&&e(r.createElement);return qv=function(i){return n?r.createElement(i):{}},qv}var Kv,II;function Vk(){if(II)return Kv;II=1;var t=hi(),e=mr(),r=o0();return Kv=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),Kv}var OI;function Wk(){if(OI)return dv;OI=1;var t=hi(),e=pr(),r=QU(),n=nw(),i=rf(),o=Fk(),s=fi(),a=Vk(),l=Object.getOwnPropertyDescriptor;return dv.f=t?l:function(c,h){if(c=i(c),h=o(h),a)try{return l(c,h)}catch{}if(s(c,h))return n(!e(r.f,c,h),c[h])},dv}var Xv={},Zv,xI;function Bk(){if(xI)return Zv;xI=1;var t=hi(),e=mr();return Zv=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Zv}var Jv,AI;function vr(){if(AI)return Jv;AI=1;var t=di(),e=String,r=TypeError;return Jv=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},Jv}var HI;function Sa(){if(HI)return Xv;HI=1;var t=hi(),e=Vk(),r=Bk(),n=vr(),i=Fk(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",c="writable";return Xv.f=t?r?function(d,f,g){if(n(d),f=i(f),n(g),typeof d=="function"&&f==="prototype"&&"value"in g&&c in g&&!g[c]){var w=a(d,f);w&&w[c]&&(d[f]=g.value,g={configurable:u in g?g[u]:w[u],enumerable:l in g?g[l]:w[l],writable:!1})}return s(d,f,g)}:s:function(d,f,g){if(n(d),f=i(f),n(g),e)try{return s(d,f,g)}catch{}if("get"in g||"set"in g)throw new o("Accessors not supported");return"value"in g&&(d[f]=g.value),d},Xv}var Qv,NI;function Ic(){if(NI)return Qv;NI=1;var t=hi(),e=Sa(),r=nw();return Qv=t?function(n,i,o){return e.f(n,i,r(1,o))}:function(n,i,o){return n[i]=o,n},Qv}var ey={exports:{}},ty,DI;function iz(){if(DI)return ty;DI=1;var t=hi(),e=fi(),r=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,i=e(r,"name"),o=i&&(function(){}).name==="something",s=i&&(!t||t&&n(r,"name").configurable);return ty={EXISTS:i,PROPER:o,CONFIGURABLE:s},ty}var ry,kI;function oz(){if(kI)return ry;kI=1;var t=or(),e=wr(),r=i0(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(i){return n(i)}),ry=r.inspectSource,ry}var ny,LI;function sz(){if(LI)return ny;LI=1;var t=ir(),e=wr(),r=t.WeakMap;return ny=e(r)&&/native code/.test(String(r)),ny}var iy,$I;function s0(){if($I)return iy;$I=1;var t=Lk(),e=$k(),r=t("keys");return iy=function(n){return r[n]||(r[n]=e(n))},iy}var oy,FI;function a0(){return FI||(FI=1,oy={}),oy}var sy,VI;function jk(){if(VI)return sy;VI=1;var t=sz(),e=ir(),r=di(),n=Ic(),i=fi(),o=i0(),s=s0(),a=a0(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,g=function(p){return f(p)?d(p):h(p,{})},w=function(p){return function(_){var O;if(!r(_)||(O=d(_)).type!==p)throw new u("Incompatible receiver, "+p+" required");return O}};if(t||o.state){var v=o.state||(o.state=new c);v.get=v.get,v.has=v.has,v.set=v.set,h=function(p,_){if(v.has(p))throw new u(l);return _.facade=p,v.set(p,_),_},d=function(p){return v.get(p)||{}},f=function(p){return v.has(p)}}else{var b=s("state");a[b]=!0,h=function(p,_){if(i(p,b))throw new u(l);return _.facade=p,n(p,b,_),_},d=function(p){return i(p,b)?p[b]:{}},f=function(p){return i(p,b)}}return sy={set:h,get:d,has:f,enforce:g,getterFor:w},sy}var WI;function Uk(){if(WI)return ey.exports;WI=1;var t=or(),e=mr(),r=wr(),n=fi(),i=hi(),o=iz().CONFIGURABLE,s=oz(),a=jk(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),g=t([].join),w=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),v=String(String).split("String"),b=ey.exports=function(p,_,O){d(c(_),0,7)==="Symbol("&&(_="["+f(c(_),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),O&&O.getter&&(_="get "+_),O&&O.setter&&(_="set "+_),(!n(p,"name")||o&&p.name!==_)&&(i?h(p,"name",{value:_,configurable:!0}):p.name=_),w&&O&&n(O,"arity")&&p.length!==O.arity&&h(p,"length",{value:O.arity});try{O&&n(O,"constructor")&&O.constructor?i&&h(p,"prototype",{writable:!1}):p.prototype&&(p.prototype=void 0)}catch{}var T=l(p);return n(T,"source")||(T.source=g(v,typeof _=="string"?_:"")),p};return Function.prototype.toString=b(function(){return r(this)&&u(this).source||s(this)},"toString"),ey.exports}var ay,BI;function l0(){if(BI)return ay;BI=1;var t=wr(),e=Sa(),r=Uk(),n=n0();return ay=function(i,o,s,a){a||(a={});var l=a.enumerable,u=a.name!==void 0?a.name:o;if(t(s)&&r(s,u,a),a.global)l?i[o]=s:n(o,s);else{try{a.unsafe?i[o]&&(l=!0):delete i[o]}catch{}l?i[o]=s:e.f(i,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i},ay}var ly={},uy,jI;function az(){if(jI)return uy;jI=1;var t=Math.ceil,e=Math.floor;return uy=Math.trunc||function(n){var i=+n;return(i>0?e:t)(i)},uy}var cy,UI;function sf(){if(UI)return cy;UI=1;var t=az();return cy=function(e){var r=+e;return r!==r||r===0?0:t(r)},cy}var hy,zI;function lz(){if(zI)return hy;zI=1;var t=sf(),e=Math.max,r=Math.min;return hy=function(n,i){var o=t(n);return o<0?e(o+i,0):r(o,i)},hy}var dy,YI;function uz(){if(YI)return dy;YI=1;var t=sf(),e=Math.min;return dy=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},dy}var fy,GI;function Oc(){if(GI)return fy;GI=1;var t=uz();return fy=function(e){return t(e.length)},fy}var gy,qI;function cz(){if(qI)return gy;qI=1;var t=rf(),e=lz(),r=Oc(),n=function(i){return function(o,s,a){var l=t(o),u=r(l);if(u===0)return!i&&-1;var c=e(a,u),h;if(i&&s!==s){for(;u>c;)if(h=l[c++],h!==h)return!0}else for(;u>c;c++)if((i||c in l)&&l[c]===s)return i||c||0;return!i&&-1}};return gy={includes:n(!0),indexOf:n(!1)},gy}var my,KI;function zk(){if(KI)return my;KI=1;var t=or(),e=fi(),r=rf(),n=cz().indexOf,i=a0(),o=t([].push);return my=function(s,a){var l=r(s),u=0,c=[],h;for(h in l)!e(i,h)&&e(l,h)&&o(c,h);for(;a.length>u;)e(l,h=a[u++])&&(~n(c,h)||o(c,h));return c},my}var py,XI;function u0(){return XI||(XI=1,py=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),py}var ZI;function hz(){if(ZI)return ly;ZI=1;var t=zk(),e=u0(),r=e.concat("length","prototype");return ly.f=Object.getOwnPropertyNames||function(i){return t(i,r)},ly}var wy={},JI;function dz(){return JI||(JI=1,wy.f=Object.getOwnPropertySymbols),wy}var vy,QI;function fz(){if(QI)return vy;QI=1;var t=Mc(),e=or(),r=hz(),n=dz(),i=vr(),o=e([].concat);return vy=t("Reflect","ownKeys")||function(a){var l=r.f(i(a)),u=n.f;return u?o(l,u(a)):l},vy}var yy,eO;function Yk(){if(eO)return yy;eO=1;var t=fi(),e=fz(),r=Wk(),n=Sa();return yy=function(i,o,s){for(var a=e(o),l=n.f,u=r.f,c=0;c<a.length;c++){var h=a[c];!t(i,h)&&!(s&&t(s,h))&&l(i,h,u(o,h))}},yy}var Cy,tO;function gz(){if(tO)return Cy;tO=1;var t=mr(),e=wr(),r=/#|\.prototype\./,n=function(l,u){var c=o[i(l)];return c===a?!0:c===s?!1:e(u)?t(u):!!u},i=n.normalize=function(l){return String(l).replace(r,".").toLowerCase()},o=n.data={},s=n.NATIVE="N",a=n.POLYFILL="P";return Cy=n,Cy}var by,rO;function St(){if(rO)return by;rO=1;var t=ir(),e=Wk().f,r=Ic(),n=l0(),i=n0(),o=Yk(),s=gz();return by=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,g,w,v,b;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(g in l){if(v=l[g],a.dontCallGetSet?(b=e(f,g),w=b&&b.value):w=f[g],d=s(c?g:u+(h?".":"#")+g,a.forced),!d&&w!==void 0){if(typeof v==typeof w)continue;o(v,w)}(a.sham||w&&w.sham)&&r(v,"sham",!0),n(f,g,v,a)}},by}var Sy,nO;function af(){if(nO)return Sy;nO=1;var t=rw(),e=Function.prototype,r=e.apply,n=e.call;return Sy=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),Sy}var Ry,iO;function Gk(){if(iO)return Ry;iO=1;var t=or(),e=Tn();return Ry=function(r,n,i){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[i]))}catch{}},Ry}var Ey,oO;function mz(){if(oO)return Ey;oO=1;var t=di();return Ey=function(e){return t(e)||e===null},Ey}var Ty,sO;function pz(){if(sO)return Ty;sO=1;var t=mz(),e=String,r=TypeError;return Ty=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},Ty}var _y,aO;function qk(){if(aO)return _y;aO=1;var t=Gk(),e=di(),r=tf(),n=pz();return _y=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,o={},s;try{s=t(Object.prototype,"__proto__","set"),s(o,[]),i=o instanceof Array}catch{}return function(l,u){return r(l),n(u),e(l)&&(i?s(l,u):l.__proto__=u),l}}():void 0),_y}var My,lO;function wz(){if(lO)return My;lO=1;var t=Sa().f;return My=function(e,r,n){n in e||t(e,n,{configurable:!0,get:function(){return r[n]},set:function(i){r[n]=i}})},My}var Py,uO;function vz(){if(uO)return Py;uO=1;var t=wr(),e=di(),r=qk();return Py=function(n,i,o){var s,a;return r&&t(s=i.constructor)&&s!==o&&e(a=s.prototype)&&a!==o.prototype&&r(n,a),n},Py}var Iy,cO;function yz(){if(cO)return Iy;cO=1;var t=Ui(),e=t("toStringTag"),r={};return r[e]="z",Iy=String(r)==="[object z]",Iy}var Oy,hO;function Kk(){if(hO)return Oy;hO=1;var t=yz(),e=wr(),r=Gl(),n=Ui(),i=n("toStringTag"),o=Object,s=r(function(){return arguments}())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return Oy=t?r:function(l){var u,c,h;return l===void 0?"Undefined":l===null?"Null":typeof(c=a(u=o(l),i))=="string"?c:s?r(u):(h=r(u))==="Object"&&e(u.callee)?"Arguments":h},Oy}var xy,dO;function sw(){if(dO)return xy;dO=1;var t=Kk(),e=String;return xy=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},xy}var Ay,fO;function Cz(){if(fO)return Ay;fO=1;var t=sw();return Ay=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},Ay}var Hy,gO;function bz(){if(gO)return Hy;gO=1;var t=di(),e=Ic();return Hy=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},Hy}var Ny,mO;function Sz(){if(mO)return Ny;mO=1;var t=or(),e=Error,r=t("".replace),n=function(s){return String(new e(s).stack)}("zxcasd"),i=/\n\s*at [^:]*:[^\n]*/,o=i.test(n);return Ny=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=r(s,i,"");return s},Ny}var Dy,pO;function Rz(){if(pO)return Dy;pO=1;var t=mr(),e=nw();return Dy=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),Dy}var ky,wO;function Ez(){if(wO)return ky;wO=1;var t=Ic(),e=Sz(),r=Rz(),n=Error.captureStackTrace;return ky=function(i,o,s,a){r&&(n?n(i,o):t(i,"stack",e(s,a)))},ky}var Ly,vO;function Tz(){if(vO)return Ly;vO=1;var t=Mc(),e=fi(),r=Ic(),n=nf(),i=qk(),o=Yk(),s=wz(),a=vz(),l=Cz(),u=bz(),c=Ez(),h=hi(),d=ba();return Ly=function(f,g,w,v){var b="stackTraceLimit",p=v?2:1,_=f.split("."),O=_[_.length-1],T=t.apply(null,_);if(T){var M=T.prototype;if(!d&&e(M,"cause")&&delete M.cause,!w)return T;var P=t("Error"),G=g(function(j,A){var q=l(v?A:j,void 0),Q=v?new T(j):new T;return q!==void 0&&r(Q,"message",q),c(Q,G,Q.stack,2),this&&n(M,this)&&a(Q,this,G),arguments.length>p&&u(Q,arguments[p]),Q});if(G.prototype=M,O!=="Error"?i?i(G,P):o(G,P,{name:!0}):h&&b in T&&(s(G,T,b),s(G,T,"prepareStackTrace")),o(G,T),!d)try{M.name!==O&&r(M,"name",O),M.constructor=G}catch{}return G}},Ly}var yO;function _z(){if(yO)return zP;yO=1;var t=St(),e=ir(),r=af(),n=Tz(),i="WebAssembly",o=e[i],s=new Error("e",{cause:7}).cause!==7,a=function(u,c){var h={};h[u]=n(u,c,s),t({global:!0,constructor:!0,arity:1,forced:s},h)},l=function(u,c){if(o&&o[u]){var h={};h[u]=n(i+"."+u,c,s),t({target:i,stat:!0,constructor:!0,arity:1,forced:s},h)}};return a("Error",function(u){return function(h){return r(u,this,arguments)}}),a("EvalError",function(u){return function(h){return r(u,this,arguments)}}),a("RangeError",function(u){return function(h){return r(u,this,arguments)}}),a("ReferenceError",function(u){return function(h){return r(u,this,arguments)}}),a("SyntaxError",function(u){return function(h){return r(u,this,arguments)}}),a("TypeError",function(u){return function(h){return r(u,this,arguments)}}),a("URIError",function(u){return function(h){return r(u,this,arguments)}}),l("CompileError",function(u){return function(h){return r(u,this,arguments)}}),l("LinkError",function(u){return function(h){return r(u,this,arguments)}}),l("RuntimeError",function(u){return function(h){return r(u,this,arguments)}}),zP}_z();var CO={},$y,bO;function Xk(){if(bO)return $y;bO=1;var t=Gl();return $y=Array.isArray||function(r){return t(r)==="Array"},$y}var Fy,SO;function Zk(){if(SO)return Fy;SO=1;var t=hi(),e=Xk(),r=TypeError,n=Object.getOwnPropertyDescriptor,i=t&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}}();return Fy=i?function(o,s){if(e(o)&&!n(o,"length").writable)throw new r("Cannot set read only .length");return o.length=s}:function(o,s){return o.length=s},Fy}var Vy,RO;function Jk(){if(RO)return Vy;RO=1;var t=TypeError,e=9007199254740991;return Vy=function(r){if(r>e)throw t("Maximum allowed index exceeded");return r},Vy}var EO;function Mz(){if(EO)return CO;EO=1;var t=St(),e=Pc(),r=Oc(),n=Zk(),i=Jk(),o=mr(),s=o(function(){return[].push.call({length:4294967296},1)!==4294967297}),a=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{push:function(c){var h=e(this),d=r(h),f=arguments.length;i(d+f);for(var g=0;g<f;g++)h[d]=arguments[g],d++;return n(h,d),d}}),CO}Mz();var TO={},Wy,_O;function Pz(){if(_O)return Wy;_O=1;var t=Gl(),e=or();return Wy=function(r){if(t(r)==="Function")return e(r)},Wy}var By,MO;function Qk(){if(MO)return By;MO=1;var t=Pz(),e=Tn(),r=rw(),n=t(t.bind);return By=function(i,o){return e(i),o===void 0?i:r?n(i,o):function(){return i.apply(o,arguments)}},By}var jy,PO;function eL(){return PO||(PO=1,jy={}),jy}var Uy,IO;function Iz(){if(IO)return Uy;IO=1;var t=Ui(),e=eL(),r=t("iterator"),n=Array.prototype;return Uy=function(i){return i!==void 0&&(e.Array===i||n[r]===i)},Uy}var zy,OO;function c0(){if(OO)return zy;OO=1;var t=Kk(),e=of(),r=e0(),n=eL(),i=Ui(),o=i("iterator");return zy=function(s){if(!r(s))return e(s,o)||e(s,"@@iterator")||n[t(s)]},zy}var Yy,xO;function Oz(){if(xO)return Yy;xO=1;var t=pr(),e=Tn(),r=vr(),n=ow(),i=c0(),o=TypeError;return Yy=function(s,a){var l=arguments.length<2?i(s):a;if(e(l))return r(t(l,s));throw new o(n(s)+" is not iterable")},Yy}var Gy,AO;function _n(){if(AO)return Gy;AO=1;var t=pr(),e=vr(),r=of();return Gy=function(n,i,o){var s,a;e(n);try{if(s=r(n,"return"),!s){if(i==="throw")throw o;return o}s=t(s,n)}catch(l){a=!0,s=l}if(i==="throw")throw o;if(a)throw s;return e(s),o},Gy}var qy,HO;function xc(){if(HO)return qy;HO=1;var t=Qk(),e=pr(),r=vr(),n=ow(),i=Iz(),o=Oc(),s=nf(),a=Oz(),l=c0(),u=_n(),c=TypeError,h=function(f,g){this.stopped=f,this.result=g},d=h.prototype;return qy=function(f,g,w){var v=w&&w.that,b=!!(w&&w.AS_ENTRIES),p=!!(w&&w.IS_RECORD),_=!!(w&&w.IS_ITERATOR),O=!!(w&&w.INTERRUPTED),T=t(g,v),M,P,G,j,A,q,Q,ue=function(Z){return M&&u(M,"normal"),new h(!0,Z)},J=function(Z){return b?(r(Z),O?T(Z[0],Z[1],ue):T(Z[0],Z[1])):O?T(Z,ue):T(Z)};if(p)M=f.iterator;else if(_)M=f;else{if(P=l(f),!P)throw new c(n(f)+" is not iterable");if(i(P)){for(G=0,j=o(f);j>G;G++)if(A=J(f[G]),A&&s(d,A))return A;return new h(!1)}M=a(f,P)}for(q=p?f.next:M.next;!(Q=e(q,M)).done;){try{A=J(Q.value)}catch(Z){u(M,"throw",Z)}if(typeof A=="object"&&A&&s(d,A))return A}return new h(!1)},qy}var Ky,NO;function tL(){if(NO)return Ky;NO=1;var t=hi(),e=Sa(),r=nw();return Ky=function(n,i,o){t?e.f(n,i,r(0,o)):n[i]=o},Ky}var DO;function xz(){if(DO)return TO;DO=1;var t=St(),e=xc(),r=tL();return t({target:"Object",stat:!0},{fromEntries:function(i){var o={};return e(i,function(s,a){r(o,s,a)},{AS_ENTRIES:!0}),o}}),TO}xz();var kO={},Xy,LO;function Oo(){if(LO)return Xy;LO=1;var t=or(),e=Set.prototype;return Xy={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},Xy}var Zy,$O;function ql(){if($O)return Zy;$O=1;var t=Oo().has;return Zy=function(e){return t(e),e},Zy}var Jy,FO;function Kl(){if(FO)return Jy;FO=1;var t=pr();return Jy=function(e,r,n){for(var i=n?e:e.iterator,o=e.next,s,a;!(s=t(o,i)).done;)if(a=r(s.value),a!==void 0)return a},Jy}var Qy,VO;function lf(){if(VO)return Qy;VO=1;var t=or(),e=Kl(),r=Oo(),n=r.Set,i=r.proto,o=t(i.forEach),s=t(i.keys),a=s(new n).next;return Qy=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},Qy}var eC,WO;function h0(){if(WO)return eC;WO=1;var t=Oo(),e=lf(),r=t.Set,n=t.add;return eC=function(i){var o=new r;return e(i,function(s){n(o,s)}),o},eC}var tC,BO;function uf(){if(BO)return tC;BO=1;var t=Gk(),e=Oo();return tC=t(e.proto,"size","get")||function(r){return r.size},tC}var rC,jO;function xo(){return jO||(jO=1,rC=function(t){return{iterator:t,next:t.next,done:!1}}),rC}var nC,UO;function Xl(){if(UO)return nC;UO=1;var t=Tn(),e=vr(),r=pr(),n=sf(),i=xo(),o="Invalid size",s=RangeError,a=TypeError,l=Math.max,u=function(c,h){this.set=c,this.size=l(h,0),this.has=t(c.has),this.keys=t(c.keys)};return u.prototype={getIterator:function(){return i(e(r(this.keys,this.set)))},includes:function(c){return r(this.has,this.set,c)}},nC=function(c){e(c);var h=+c.size;if(h!==h)throw new a(o);var d=n(h);if(d<0)throw new s(o);return new u(c,d)},nC}var iC,zO;function Az(){if(zO)return iC;zO=1;var t=ql(),e=Oo(),r=h0(),n=uf(),i=Xl(),o=lf(),s=Kl(),a=e.has,l=e.remove;return iC=function(c){var h=t(this),d=i(c),f=r(h);return n(h)<=d.size?o(h,function(g){d.includes(g)&&l(f,g)}):s(d.getIterator(),function(g){a(f,g)&&l(f,g)}),f},iC}var oC,YO;function Zl(){if(YO)return oC;YO=1;var t=Mc(),e=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},r=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};return oC=function(n,i){var o=t("Set");try{new o()[n](e(0));try{return new o()[n](e(-1)),!1}catch{if(!i)return!0;try{return new o()[n](r(-1/0)),!1}catch{var s=new o;return s.add(1),s.add(2),i(s[n](r(1/0)))}}}catch{return!1}},oC}var GO;function Hz(){if(GO)return kO;GO=1;var t=St(),e=Az(),r=mr(),n=Zl(),i=!n("difference",function(s){return s.size===0}),o=i||r(function(){var s={size:1,has:function(){return!0},keys:function(){var l=0;return{next:function(){var u=l++>1;return a.has(1)&&a.clear(),{done:u,value:2}}}}},a=new Set([1,2,3,4]);return a.difference(s).size!==3});return t({target:"Set",proto:!0,real:!0,forced:o},{difference:e}),kO}Hz();var qO={},sC,KO;function Nz(){if(KO)return sC;KO=1;var t=ql(),e=Oo(),r=uf(),n=Xl(),i=lf(),o=Kl(),s=e.Set,a=e.add,l=e.has;return sC=function(c){var h=t(this),d=n(c),f=new s;return r(h)>d.size?o(d.getIterator(),function(g){l(h,g)&&a(f,g)}):i(h,function(g){d.includes(g)&&a(f,g)}),f},sC}var XO;function Dz(){if(XO)return qO;XO=1;var t=St(),e=mr(),r=Nz(),n=Zl(),i=!n("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||e(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});return t({target:"Set",proto:!0,real:!0,forced:i},{intersection:r}),qO}Dz();var ZO={},aC,JO;function kz(){if(JO)return aC;JO=1;var t=ql(),e=Oo().has,r=uf(),n=Xl(),i=lf(),o=Kl(),s=_n();return aC=function(l){var u=t(this),c=n(l);if(r(u)<=c.size)return i(u,function(d){if(c.includes(d))return!1},!0)!==!1;var h=c.getIterator();return o(h,function(d){if(e(u,d))return s(h,"normal",!1)})!==!1},aC}var QO;function Lz(){if(QO)return ZO;QO=1;var t=St(),e=kz(),r=Zl(),n=!r("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:n},{isDisjointFrom:e}),ZO}Lz();var ex={},lC,tx;function $z(){if(tx)return lC;tx=1;var t=ql(),e=uf(),r=lf(),n=Xl();return lC=function(o){var s=t(this),a=n(o);return e(s)>a.size?!1:r(s,function(l){if(!a.includes(l))return!1},!0)!==!1},lC}var rx;function Fz(){if(rx)return ex;rx=1;var t=St(),e=$z(),r=Zl(),n=!r("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:n},{isSubsetOf:e}),ex}Fz();var nx={},uC,ix;function Vz(){if(ix)return uC;ix=1;var t=ql(),e=Oo().has,r=uf(),n=Xl(),i=Kl(),o=_n();return uC=function(a){var l=t(this),u=n(a);if(r(l)<u.size)return!1;var c=u.getIterator();return i(c,function(h){if(!e(l,h))return o(c,"normal",!1)})!==!1},uC}var ox;function Wz(){if(ox)return nx;ox=1;var t=St(),e=Vz(),r=Zl(),n=!r("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:n},{isSupersetOf:e}),nx}Wz();var sx={},cC,ax;function Bz(){if(ax)return cC;ax=1;var t=ql(),e=Oo(),r=h0(),n=Xl(),i=Kl(),o=e.add,s=e.has,a=e.remove;return cC=function(u){var c=t(this),h=n(u).getIterator(),d=r(c);return i(h,function(f){s(c,f)?a(d,f):o(d,f)}),d},cC}var hC,lx;function rL(){return lx||(lx=1,hC=function(t){try{var e=new Set,r={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},n=e[t](r);return n.size!==1||n.values().next().value!==4}catch{return!1}}),hC}var ux;function jz(){if(ux)return sx;ux=1;var t=St(),e=Bz(),r=rL(),n=Zl(),i=!n("symmetricDifference")||!r("symmetricDifference");return t({target:"Set",proto:!0,real:!0,forced:i},{symmetricDifference:e}),sx}jz();var cx={},dC,hx;function Uz(){if(hx)return dC;hx=1;var t=ql(),e=Oo().add,r=h0(),n=Xl(),i=Kl();return dC=function(s){var a=t(this),l=n(s).getIterator(),u=r(a);return i(l,function(c){e(u,c)}),u},dC}var dx;function zz(){if(dx)return cx;dx=1;var t=St(),e=Uz(),r=rL(),n=Zl(),i=!n("union")||!r("union");return t({target:"Set",proto:!0,real:!0,forced:i},{union:e}),cx}zz();var fx={},gx={},fC,mx;function Yz(){if(mx)return fC;mx=1;var t=nf(),e=TypeError;return fC=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},fC}var gC,px;function Gz(){if(px)return gC;px=1;var t=mr();return gC=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),gC}var mC,wx;function nL(){if(wx)return mC;wx=1;var t=fi(),e=wr(),r=Pc(),n=s0(),i=Gz(),o=n("IE_PROTO"),s=Object,a=s.prototype;return mC=i?s.getPrototypeOf:function(l){var u=r(l);if(t(u,o))return u[o];var c=u.constructor;return e(c)&&u instanceof c?c.prototype:u instanceof s?a:null},mC}var pC,vx;function qz(){if(vx)return pC;vx=1;var t=Uk(),e=Sa();return pC=function(r,n,i){return i.get&&t(i.get,n,{getter:!0}),i.set&&t(i.set,n,{setter:!0}),e.f(r,n,i)},pC}var wC={},vC,yx;function Kz(){if(yx)return vC;yx=1;var t=zk(),e=u0();return vC=Object.keys||function(n){return t(n,e)},vC}var Cx;function Xz(){if(Cx)return wC;Cx=1;var t=hi(),e=Bk(),r=Sa(),n=vr(),i=rf(),o=Kz();return wC.f=t&&!e?Object.defineProperties:function(a,l){n(a);for(var u=i(l),c=o(l),h=c.length,d=0,f;h>d;)r.f(a,f=c[d++],u[f]);return a},wC}var yC,bx;function iL(){if(bx)return yC;bx=1;var t=Mc();return yC=t("document","documentElement"),yC}var CC,Sx;function d0(){if(Sx)return CC;Sx=1;var t=vr(),e=Xz(),r=u0(),n=a0(),i=iL(),o=o0(),s=s0(),a=">",l="<",u="prototype",c="script",h=s("IE_PROTO"),d=function(){},f=function(p){return l+c+a+p+l+"/"+c+a},g=function(p){p.write(f("")),p.close();var _=p.parentWindow.Object;return p=null,_},w=function(){var p=o("iframe"),_="java"+c+":",O;return p.style.display="none",i.appendChild(p),p.src=String(_),O=p.contentWindow.document,O.open(),O.write(f("document.F=Object")),O.close(),O.F},v,b=function(){try{v=new ActiveXObject("htmlfile")}catch{}b=typeof document<"u"?document.domain&&v?g(v):w():g(v);for(var p=r.length;p--;)delete b[u][r[p]];return b()};return n[h]=!0,CC=Object.create||function(_,O){var T;return _!==null?(d[u]=t(_),T=new d,d[u]=null,T[h]=_):T=b(),O===void 0?T:e.f(T,O)},CC}var bC,Rx;function oL(){if(Rx)return bC;Rx=1;var t=mr(),e=wr(),r=di(),n=d0(),i=nL(),o=l0(),s=Ui(),a=ba(),l=s("iterator"),u=!1,c,h,d;[].keys&&(d=[].keys(),"next"in d?(h=i(i(d)),h!==Object.prototype&&(c=h)):u=!0);var f=!r(c)||t(function(){var g={};return c[l].call(g)!==g});return f?c={}:a&&(c=n(c)),e(c[l])||o(c,l,function(){return this}),bC={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},bC}var Ex;function Zz(){if(Ex)return gx;Ex=1;var t=St(),e=ir(),r=Yz(),n=vr(),i=wr(),o=nL(),s=qz(),a=tL(),l=mr(),u=fi(),c=Ui(),h=oL().IteratorPrototype,d=hi(),f=ba(),g="constructor",w="Iterator",v=c("toStringTag"),b=TypeError,p=e[w],_=f||!i(p)||p.prototype!==h||!l(function(){p({})}),O=function(){if(r(this,h),o(this)===h)throw new b("Abstract class Iterator not directly constructable")},T=function(M,P){d?s(h,M,{configurable:!0,get:function(){return P},set:function(G){if(n(this),this===h)throw new b("You can't redefine this property");u(this,M)?this[M]=G:a(this,M,G)}}):h[M]=P};return u(h,v)||T(v,w),(_||!u(h,g)||h[g]===Object)&&T(g,O),O.prototype=h,t({global:!0,constructor:!0,forced:_},{Iterator:O}),gx}var Tx;function Jz(){return Tx||(Tx=1,Zz()),fx}Jz();var _x={},Mx={},SC,Px;function Qz(){if(Px)return SC;Px=1;var t=l0();return SC=function(e,r,n){for(var i in r)t(e,i,r[i],n);return e},SC}var RC,Ix;function eY(){return Ix||(Ix=1,RC=function(t,e){return{value:t,done:e}}),RC}var EC,Ox;function tY(){if(Ox)return EC;Ox=1;var t=_n();return EC=function(e,r,n){for(var i=e.length-1;i>=0;i--)if(e[i]!==void 0)try{n=t(e[i].iterator,r,n)}catch(o){r="throw",n=o}if(r==="throw")throw n;return n},EC}var TC,xx;function f0(){if(xx)return TC;xx=1;var t=pr(),e=d0(),r=Ic(),n=Qz(),i=Ui(),o=jk(),s=of(),a=oL().IteratorPrototype,l=eY(),u=_n(),c=tY(),h=i("toStringTag"),d="IteratorHelper",f="WrapForValidIterator",g="normal",w="throw",v=o.set,b=function(O){var T=o.getterFor(O?f:d);return n(e(a),{next:function(){var P=T(this);if(O)return P.nextHandler();if(P.done)return l(void 0,!0);try{var G=P.nextHandler();return P.returnHandlerResult?G:l(G,P.done)}catch(j){throw P.done=!0,j}},return:function(){var M=T(this),P=M.iterator;if(M.done=!0,O){var G=s(P,"return");return G?t(G,P):l(void 0,!0)}if(M.inner)try{u(M.inner.iterator,g)}catch(j){return u(P,w,j)}if(M.openIters)try{c(M.openIters,g)}catch(j){return u(P,w,j)}return P&&u(P,g),l(void 0,!0)}})},p=b(!0),_=b(!1);return r(_,h,"Iterator Helper"),TC=function(O,T,M){var P=function(j,A){A?(A.iterator=j.iterator,A.next=j.next):A=j,A.type=T?f:d,A.returnHandlerResult=!!M,A.nextHandler=O,A.counter=0,A.done=!1,v(this,A)};return P.prototype=T?p:_,P},TC}var _C,Ax;function sL(){if(Ax)return _C;Ax=1;var t=vr(),e=_n();return _C=function(r,n,i,o){try{return o?n(t(i)[0],i[1]):n(i)}catch(s){e(r,"throw",s)}},_C}var MC,Hx;function g0(){return Hx||(Hx=1,MC=function(t,e){var r=typeof Iterator=="function"&&Iterator.prototype[t];if(r)try{r.call({next:null},e).next()}catch{return!0}}),MC}var PC,Nx;function Ra(){if(Nx)return PC;Nx=1;var t=ir();return PC=function(e,r){var n=t.Iterator,i=n&&n.prototype,o=i&&i[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(a){a instanceof r||(s=!1)}if(!s)return o},PC}var Dx;function rY(){if(Dx)return Mx;Dx=1;var t=St(),e=pr(),r=Tn(),n=vr(),i=xo(),o=f0(),s=sL(),a=ba(),l=_n(),u=g0(),c=Ra(),h=!a&&!u("filter",function(){}),d=!a&&!h&&c("filter",TypeError),f=a||h||d,g=o(function(){for(var w=this.iterator,v=this.predicate,b=this.next,p,_,O;;){if(p=n(e(b,w)),_=this.done=!!p.done,_)return;if(O=p.value,s(w,v,[O,this.counter++],!0))return O}});return t({target:"Iterator",proto:!0,real:!0,forced:f},{filter:function(v){n(this);try{r(v)}catch(b){l(this,"throw",b)}return d?e(d,this,v):new g(i(this),{predicate:v})}}),Mx}var kx;function nY(){return kx||(kx=1,rY()),_x}nY();var Lx={},$x={},Fx;function iY(){if(Fx)return $x;Fx=1;var t=St(),e=pr(),r=xc(),n=Tn(),i=vr(),o=xo(),s=_n(),a=Ra(),l=a("forEach",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function(c){i(this);try{n(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;r(h,function(f){c(f,d++)},{IS_RECORD:!0})}}),$x}var Vx;function oY(){return Vx||(Vx=1,iY()),Lx}oY();var Wx={},Bx={},jx;function sY(){if(jx)return Bx;jx=1;var t=St(),e=pr(),r=Tn(),n=vr(),i=xo(),o=f0(),s=sL(),a=_n(),l=g0(),u=Ra(),c=ba(),h=!c&&!l("map",function(){}),d=!c&&!h&&u("map",TypeError),f=c||h||d,g=o(function(){var w=this.iterator,v=n(e(this.next,w)),b=this.done=!!v.done;if(!b)return s(w,this.mapper,[v.value,this.counter++],!0)});return t({target:"Iterator",proto:!0,real:!0,forced:f},{map:function(v){n(this);try{r(v)}catch(b){a(this,"throw",b)}return d?e(d,this,v):new g(i(this),{mapper:v})}}),Bx}var Ux;function aY(){return Ux||(Ux=1,sY()),Wx}aY();var zx={},Yx={},IC,Gx;function m0(){if(Gx)return IC;Gx=1;var t=or();return IC=t([].slice),IC}var OC,qx;function aL(){if(qx)return OC;qx=1;var t=TypeError;return OC=function(e,r){if(e<r)throw new t("Not enough arguments");return e},OC}var xC,Kx;function lY(){if(Kx)return xC;Kx=1;var t=iw();return xC=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),xC}var AC,Xx;function lL(){if(Xx)return AC;Xx=1;var t=ir(),e=iw(),r=Gl(),n=function(i){return e.slice(0,i.length)===i};return AC=function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":r(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"}(),AC}var HC,Zx;function uY(){if(Zx)return HC;Zx=1;var t=lL();return HC=t==="NODE",HC}var NC,Jx;function uL(){if(Jx)return NC;Jx=1;var t=ir(),e=af(),r=Qk(),n=wr(),i=fi(),o=mr(),s=iL(),a=m0(),l=o0(),u=aL(),c=lY(),h=uY(),d=t.setImmediate,f=t.clearImmediate,g=t.process,w=t.Dispatch,v=t.Function,b=t.MessageChannel,p=t.String,_=0,O={},T="onreadystatechange",M,P,G,j;o(function(){M=t.location});var A=function(J){if(i(O,J)){var Z=O[J];delete O[J],Z()}},q=function(J){return function(){A(J)}},Q=function(J){A(J.data)},ue=function(J){t.postMessage(p(J),M.protocol+"//"+M.host)};return(!d||!f)&&(d=function(Z){u(arguments.length,1);var ne=n(Z)?Z:v(Z),ee=a(arguments,1);return O[++_]=function(){e(ne,void 0,ee)},P(_),_},f=function(Z){delete O[Z]},h?P=function(J){g.nextTick(q(J))}:w&&w.now?P=function(J){w.now(q(J))}:b&&!c?(G=new b,j=G.port2,G.port1.onmessage=Q,P=r(j.postMessage,j)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&M&&M.protocol!=="file:"&&!o(ue)?(P=ue,t.addEventListener("message",Q,!1)):T in l("script")?P=function(J){s.appendChild(l("script"))[T]=function(){s.removeChild(this),A(J)}}:P=function(J){setTimeout(q(J),0)}),NC={set:d,clear:f},NC}var Qx;function cY(){if(Qx)return Yx;Qx=1;var t=St(),e=ir(),r=uL().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==r},{clearImmediate:r}),Yx}var e1={},DC,t1;function hY(){if(t1)return DC;t1=1;var t=ir(),e=af(),r=wr(),n=lL(),i=iw(),o=m0(),s=aL(),a=t.Function,l=/MSIE .\./.test(i)||n==="BUN"&&function(){var u=t.Bun.version.split(".");return u.length<3||u[0]==="0"&&(u[1]<3||u[1]==="3"&&u[2]==="0")}();return DC=function(u,c){var h=c?2:1;return l?function(d,f){var g=s(arguments.length,1)>h,w=r(d)?d:a(d),v=g?o(arguments,h):[],b=g?function(){e(w,this,v)}:w;return c?u(b,f):u(b)}:u},DC}var r1;function dY(){if(r1)return e1;r1=1;var t=St(),e=ir(),r=uL().set,n=hY(),i=e.setImmediate?n(r,!1):r;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),e1}var n1;function fY(){return n1||(n1=1,cY(),dY()),zx}fY();/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:cL,setPrototypeOf:i1,isFrozen:gY,getPrototypeOf:mY,getOwnPropertyDescriptor:pY}=Object;let{freeze:rn,seal:ci,create:hL}=Object,{apply:kR,construct:LR}=typeof Reflect<"u"&&Reflect;rn||(rn=function(e){return e});ci||(ci=function(e){return e});kR||(kR=function(e,r,n){return e.apply(r,n)});LR||(LR=function(e,r){return new e(...r)});const kf=nn(Array.prototype.forEach),wY=nn(Array.prototype.lastIndexOf),o1=nn(Array.prototype.pop),Zc=nn(Array.prototype.push),vY=nn(Array.prototype.splice),_m=nn(String.prototype.toLowerCase),kC=nn(String.prototype.toString),s1=nn(String.prototype.match),Jc=nn(String.prototype.replace),yY=nn(String.prototype.indexOf),CY=nn(String.prototype.trim),Pi=nn(Object.prototype.hasOwnProperty),Yr=nn(RegExp.prototype.test),Qc=bY(TypeError);function nn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return kR(t,e,n)}}function bY(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return LR(t,r)}}function ze(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_m;i1&&i1(t,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const o=r(i);o!==i&&(gY(e)||(e[n]=o),i=o)}t[i]=!0}return t}function SY(t){for(let e=0;e<t.length;e++)Pi(t,e)||(t[e]=null);return t}function ts(t){const e=hL(null);for(const[r,n]of cL(t))Pi(t,r)&&(Array.isArray(n)?e[r]=SY(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=ts(n):e[r]=n);return e}function eh(t,e){for(;t!==null;){const n=pY(t,e);if(n){if(n.get)return nn(n.get);if(typeof n.value=="function")return nn(n.value)}t=mY(t)}function r(){return null}return r}const a1=rn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),LC=rn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),$C=rn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),RY=rn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),FC=rn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),EY=rn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),l1=rn(["#text"]),u1=rn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),VC=rn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),c1=rn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Lf=rn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),TY=ci(/\{\{[\w\W]*|[\w\W]*\}\}/gm),_Y=ci(/<%[\w\W]*|[\w\W]*%>/gm),MY=ci(/\$\{[\w\W]*/gm),PY=ci(/^data-[\-\w.\u00B7-\uFFFF]+$/),IY=ci(/^aria-[\-\w]+$/),dL=ci(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),OY=ci(/^(?:\w+script|data):/i),xY=ci(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fL=ci(/^html$/i),AY=ci(/^[a-z][.\w]*(-[.\w]+)+$/i);var h1=Object.freeze({__proto__:null,ARIA_ATTR:IY,ATTR_WHITESPACE:xY,CUSTOM_ELEMENT:AY,DATA_ATTR:PY,DOCTYPE_NAME:fL,ERB_EXPR:_Y,IS_ALLOWED_URI:dL,IS_SCRIPT_OR_DATA:OY,MUSTACHE_EXPR:TY,TMPLIT_EXPR:MY});const th={element:1,text:3,progressingInstruction:7,comment:8,document:9},HY=function(){return typeof window>"u"?null:window},NY=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},d1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gL(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:HY();const e=Te=>gL(Te);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==th.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,g=l.prototype,w=eh(g,"cloneNode"),v=eh(g,"remove"),b=eh(g,"nextSibling"),p=eh(g,"childNodes"),_=eh(g,"parentNode");if(typeof s=="function"){const Te=r.createElement("template");Te.content&&Te.content.ownerDocument&&(r=Te.content.ownerDocument)}let O,T="";const{implementation:M,createNodeIterator:P,createDocumentFragment:G,getElementsByTagName:j}=r,{importNode:A}=n;let q=d1();e.isSupported=typeof cL=="function"&&typeof _=="function"&&M&&M.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Q,ERB_EXPR:ue,TMPLIT_EXPR:J,DATA_ATTR:Z,ARIA_ATTR:ne,IS_SCRIPT_OR_DATA:ee,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:ae}=h1;let{IS_ALLOWED_URI:z}=h1,$=null;const m=ze({},[...a1,...LC,...$C,...FC,...l1]);let C=null;const y=ze({},[...u1,...VC,...c1,...Lf]);let I=Object.seal(hL(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),x=null,N=null,B=!0,Y=!0,R=!1,E=!0,S=!1,D=!0,H=!1,F=!1,X=!1,L=!1,W=!1,K=!1,U=!0,re=!1;const me="user-content-";let ve=!0,Oe=!1,Be={},Ge=null;const Ie=ze({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const Mt=ze({},["audio","video","img","source","image","track"]);let wi=null;const Do=ze({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),zn="http://www.w3.org/1998/Math/MathML",Pt="http://www.w3.org/2000/svg",ar="http://www.w3.org/1999/xhtml";let Rt=ar,It=!1,Ue=null;const Yn=ze({},[zn,Pt,ar],kC);let Ma=ze({},["mi","mo","mn","ms","mtext"]),Pa=ze({},["annotation-xml"]);const TB=ze({},["title","style","font","a","script"]);let jc=null;const _B=["application/xhtml+xml","text/html"],MB="text/html";let Er=null,nu=null;const PB=r.createElement("form"),jM=function(V){return V instanceof RegExp||V instanceof Function},ev=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(nu&&nu===V)){if((!V||typeof V!="object")&&(V={}),V=ts(V),jc=_B.indexOf(V.PARSER_MEDIA_TYPE)===-1?MB:V.PARSER_MEDIA_TYPE,Er=jc==="application/xhtml+xml"?kC:_m,$=Pi(V,"ALLOWED_TAGS")?ze({},V.ALLOWED_TAGS,Er):m,C=Pi(V,"ALLOWED_ATTR")?ze({},V.ALLOWED_ATTR,Er):y,Ue=Pi(V,"ALLOWED_NAMESPACES")?ze({},V.ALLOWED_NAMESPACES,kC):Yn,wi=Pi(V,"ADD_URI_SAFE_ATTR")?ze(ts(Do),V.ADD_URI_SAFE_ATTR,Er):Do,je=Pi(V,"ADD_DATA_URI_TAGS")?ze(ts(Mt),V.ADD_DATA_URI_TAGS,Er):Mt,Ge=Pi(V,"FORBID_CONTENTS")?ze({},V.FORBID_CONTENTS,Er):Ie,x=Pi(V,"FORBID_TAGS")?ze({},V.FORBID_TAGS,Er):ts({}),N=Pi(V,"FORBID_ATTR")?ze({},V.FORBID_ATTR,Er):ts({}),Be=Pi(V,"USE_PROFILES")?V.USE_PROFILES:!1,B=V.ALLOW_ARIA_ATTR!==!1,Y=V.ALLOW_DATA_ATTR!==!1,R=V.ALLOW_UNKNOWN_PROTOCOLS||!1,E=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,S=V.SAFE_FOR_TEMPLATES||!1,D=V.SAFE_FOR_XML!==!1,H=V.WHOLE_DOCUMENT||!1,L=V.RETURN_DOM||!1,W=V.RETURN_DOM_FRAGMENT||!1,K=V.RETURN_TRUSTED_TYPE||!1,X=V.FORCE_BODY||!1,U=V.SANITIZE_DOM!==!1,re=V.SANITIZE_NAMED_PROPS||!1,ve=V.KEEP_CONTENT!==!1,Oe=V.IN_PLACE||!1,z=V.ALLOWED_URI_REGEXP||dL,Rt=V.NAMESPACE||ar,Ma=V.MATHML_TEXT_INTEGRATION_POINTS||Ma,Pa=V.HTML_INTEGRATION_POINTS||Pa,I=V.CUSTOM_ELEMENT_HANDLING||{},V.CUSTOM_ELEMENT_HANDLING&&jM(V.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(I.tagNameCheck=V.CUSTOM_ELEMENT_HANDLING.tagNameCheck),V.CUSTOM_ELEMENT_HANDLING&&jM(V.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(I.attributeNameCheck=V.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),V.CUSTOM_ELEMENT_HANDLING&&typeof V.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(I.allowCustomizedBuiltInElements=V.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),S&&(Y=!1),W&&(L=!0),Be&&($=ze({},l1),C=[],Be.html===!0&&(ze($,a1),ze(C,u1)),Be.svg===!0&&(ze($,LC),ze(C,VC),ze(C,Lf)),Be.svgFilters===!0&&(ze($,$C),ze(C,VC),ze(C,Lf)),Be.mathMl===!0&&(ze($,FC),ze(C,c1),ze(C,Lf))),V.ADD_TAGS&&($===m&&($=ts($)),ze($,V.ADD_TAGS,Er)),V.ADD_ATTR&&(C===y&&(C=ts(C)),ze(C,V.ADD_ATTR,Er)),V.ADD_URI_SAFE_ATTR&&ze(wi,V.ADD_URI_SAFE_ATTR,Er),V.FORBID_CONTENTS&&(Ge===Ie&&(Ge=ts(Ge)),ze(Ge,V.FORBID_CONTENTS,Er)),ve&&($["#text"]=!0),H&&ze($,["html","head","body"]),$.table&&(ze($,["tbody"]),delete x.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=V.TRUSTED_TYPES_POLICY,T=O.createHTML("")}else O===void 0&&(O=NY(f,i)),O!==null&&typeof T=="string"&&(T=O.createHTML(""));rn&&rn(V),nu=V}},UM=ze({},[...LC,...$C,...RY]),zM=ze({},[...FC,...EY]),IB=function(V){let ce=_(V);(!ce||!ce.tagName)&&(ce={namespaceURI:Rt,tagName:"template"});const Se=_m(V.tagName),kt=_m(ce.tagName);return Ue[V.namespaceURI]?V.namespaceURI===Pt?ce.namespaceURI===ar?Se==="svg":ce.namespaceURI===zn?Se==="svg"&&(kt==="annotation-xml"||Ma[kt]):!!UM[Se]:V.namespaceURI===zn?ce.namespaceURI===ar?Se==="math":ce.namespaceURI===Pt?Se==="math"&&Pa[kt]:!!zM[Se]:V.namespaceURI===ar?ce.namespaceURI===Pt&&!Pa[kt]||ce.namespaceURI===zn&&!Ma[kt]?!1:!zM[Se]&&(TB[Se]||!UM[Se]):!!(jc==="application/xhtml+xml"&&Ue[V.namespaceURI]):!1},qi=function(V){Zc(e.removed,{element:V});try{_(V).removeChild(V)}catch{v(V)}},iu=function(V,ce){try{Zc(e.removed,{attribute:ce.getAttributeNode(V),from:ce})}catch{Zc(e.removed,{attribute:null,from:ce})}if(ce.removeAttribute(V),V==="is")if(L||W)try{qi(ce)}catch{}else try{ce.setAttribute(V,"")}catch{}},YM=function(V){let ce=null,Se=null;if(X)V="<remove></remove>"+V;else{const yr=s1(V,/^[\r\n\t ]+/);Se=yr&&yr[0]}jc==="application/xhtml+xml"&&Rt===ar&&(V='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+V+"</body></html>");const kt=O?O.createHTML(V):V;if(Rt===ar)try{ce=new d().parseFromString(kt,jc)}catch{}if(!ce||!ce.documentElement){ce=M.createDocument(Rt,"template",null);try{ce.documentElement.innerHTML=It?T:kt}catch{}}const Nr=ce.body||ce.documentElement;return V&&Se&&Nr.insertBefore(r.createTextNode(Se),Nr.childNodes[0]||null),Rt===ar?j.call(ce,H?"html":"body")[0]:H?ce.documentElement:Nr},GM=function(V){return P.call(V.ownerDocument||V,V,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},tv=function(V){return V instanceof h&&(typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||!(V.attributes instanceof c)||typeof V.removeAttribute!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function")},qM=function(V){return typeof a=="function"&&V instanceof a};function ko(Te,V,ce){kf(Te,Se=>{Se.call(e,V,ce,nu)})}const KM=function(V){let ce=null;if(ko(q.beforeSanitizeElements,V,null),tv(V))return qi(V),!0;const Se=Er(V.nodeName);if(ko(q.uponSanitizeElement,V,{tagName:Se,allowedTags:$}),D&&V.hasChildNodes()&&!qM(V.firstElementChild)&&Yr(/<[/\w!]/g,V.innerHTML)&&Yr(/<[/\w!]/g,V.textContent)||V.nodeType===th.progressingInstruction||D&&V.nodeType===th.comment&&Yr(/<[/\w]/g,V.data))return qi(V),!0;if(!$[Se]||x[Se]){if(!x[Se]&&ZM(Se)&&(I.tagNameCheck instanceof RegExp&&Yr(I.tagNameCheck,Se)||I.tagNameCheck instanceof Function&&I.tagNameCheck(Se)))return!1;if(ve&&!Ge[Se]){const kt=_(V)||V.parentNode,Nr=p(V)||V.childNodes;if(Nr&&kt){const yr=Nr.length;for(let an=yr-1;an>=0;--an){const Lo=w(Nr[an],!0);Lo.__removalCount=(V.__removalCount||0)+1,kt.insertBefore(Lo,b(V))}}}return qi(V),!0}return V instanceof l&&!IB(V)||(Se==="noscript"||Se==="noembed"||Se==="noframes")&&Yr(/<\/no(script|embed|frames)/i,V.innerHTML)?(qi(V),!0):(S&&V.nodeType===th.text&&(ce=V.textContent,kf([Q,ue,J],kt=>{ce=Jc(ce,kt," ")}),V.textContent!==ce&&(Zc(e.removed,{element:V.cloneNode()}),V.textContent=ce)),ko(q.afterSanitizeElements,V,null),!1)},XM=function(V,ce,Se){if(U&&(ce==="id"||ce==="name")&&(Se in r||Se in PB))return!1;if(!(Y&&!N[ce]&&Yr(Z,ce))){if(!(B&&Yr(ne,ce))){if(!C[ce]||N[ce]){if(!(ZM(V)&&(I.tagNameCheck instanceof RegExp&&Yr(I.tagNameCheck,V)||I.tagNameCheck instanceof Function&&I.tagNameCheck(V))&&(I.attributeNameCheck instanceof RegExp&&Yr(I.attributeNameCheck,ce)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(ce))||ce==="is"&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&Yr(I.tagNameCheck,Se)||I.tagNameCheck instanceof Function&&I.tagNameCheck(Se))))return!1}else if(!wi[ce]){if(!Yr(z,Jc(Se,te,""))){if(!((ce==="src"||ce==="xlink:href"||ce==="href")&&V!=="script"&&yY(Se,"data:")===0&&je[V])){if(!(R&&!Yr(ee,Jc(Se,te,"")))){if(Se)return!1}}}}}}return!0},ZM=function(V){return V!=="annotation-xml"&&s1(V,ae)},JM=function(V){ko(q.beforeSanitizeAttributes,V,null);const{attributes:ce}=V;if(!ce||tv(V))return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0};let kt=ce.length;for(;kt--;){const Nr=ce[kt],{name:yr,namespaceURI:an,value:Lo}=Nr,Uc=Er(yr),rv=Lo;let Dr=yr==="value"?rv:CY(rv);if(Se.attrName=Uc,Se.attrValue=Dr,Se.keepAttr=!0,Se.forceKeepAttr=void 0,ko(q.uponSanitizeAttribute,V,Se),Dr=Se.attrValue,re&&(Uc==="id"||Uc==="name")&&(iu(yr,V),Dr=me+Dr),D&&Yr(/((--!?|])>)|<\/(style|title)/i,Dr)){iu(yr,V);continue}if(Se.forceKeepAttr)continue;if(!Se.keepAttr){iu(yr,V);continue}if(!E&&Yr(/\/>/i,Dr)){iu(yr,V);continue}S&&kf([Q,ue,J],eP=>{Dr=Jc(Dr,eP," ")});const QM=Er(V.nodeName);if(!XM(QM,Uc,Dr)){iu(yr,V);continue}if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!an)switch(f.getAttributeType(QM,Uc)){case"TrustedHTML":{Dr=O.createHTML(Dr);break}case"TrustedScriptURL":{Dr=O.createScriptURL(Dr);break}}if(Dr!==rv)try{an?V.setAttributeNS(an,yr,Dr):V.setAttribute(yr,Dr),tv(V)?qi(V):o1(e.removed)}catch{iu(yr,V)}}ko(q.afterSanitizeAttributes,V,null)},OB=function Te(V){let ce=null;const Se=GM(V);for(ko(q.beforeSanitizeShadowDOM,V,null);ce=Se.nextNode();)ko(q.uponSanitizeShadowNode,ce,null),KM(ce),JM(ce),ce.content instanceof o&&Te(ce.content);ko(q.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(Te){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ce=null,Se=null,kt=null,Nr=null;if(It=!Te,It&&(Te="<!-->"),typeof Te!="string"&&!qM(Te))if(typeof Te.toString=="function"){if(Te=Te.toString(),typeof Te!="string")throw Qc("dirty is not a string, aborting")}else throw Qc("toString is not a function");if(!e.isSupported)return Te;if(F||ev(V),e.removed=[],typeof Te=="string"&&(Oe=!1),Oe){if(Te.nodeName){const Lo=Er(Te.nodeName);if(!$[Lo]||x[Lo])throw Qc("root node is forbidden and cannot be sanitized in-place")}}else if(Te instanceof a)ce=YM("<!---->"),Se=ce.ownerDocument.importNode(Te,!0),Se.nodeType===th.element&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?ce=Se:ce.appendChild(Se);else{if(!L&&!S&&!H&&Te.indexOf("<")===-1)return O&&K?O.createHTML(Te):Te;if(ce=YM(Te),!ce)return L?null:K?T:""}ce&&X&&qi(ce.firstChild);const yr=GM(Oe?Te:ce);for(;kt=yr.nextNode();)KM(kt),JM(kt),kt.content instanceof o&&OB(kt.content);if(Oe)return Te;if(L){if(W)for(Nr=G.call(ce.ownerDocument);ce.firstChild;)Nr.appendChild(ce.firstChild);else Nr=ce;return(C.shadowroot||C.shadowrootmode)&&(Nr=A.call(n,Nr,!0)),Nr}let an=H?ce.outerHTML:ce.innerHTML;return H&&$["!doctype"]&&ce.ownerDocument&&ce.ownerDocument.doctype&&ce.ownerDocument.doctype.name&&Yr(fL,ce.ownerDocument.doctype.name)&&(an="<!DOCTYPE "+ce.ownerDocument.doctype.name+`>
|
|
478
|
+
`+an),S&&kf([Q,ue,J],Lo=>{an=Jc(an,Lo," ")}),O&&K?O.createHTML(an):an},e.setConfig=function(){let Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ev(Te),F=!0},e.clearConfig=function(){nu=null,F=!1},e.isValidAttribute=function(Te,V,ce){nu||ev({});const Se=Er(Te),kt=Er(V);return XM(Se,kt,ce)},e.addHook=function(Te,V){typeof V=="function"&&Zc(q[Te],V)},e.removeHook=function(Te,V){if(V!==void 0){const ce=wY(q[Te],V);return ce===-1?void 0:vY(q[Te],ce,1)[0]}return o1(q[Te])},e.removeHooks=function(Te){q[Te]=[]},e.removeAllHooks=function(){q=d1()},e}var DY=gL();//! moment.js
|
|
479
|
+
//! version : 2.30.1
|
|
480
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
481
|
+
//! license : MIT
|
|
482
|
+
//! momentjs.com
|
|
483
|
+
var mL;function se(){return mL.apply(null,arguments)}function kY(t){mL=t}function Vi(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Hl(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function ot(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function p0(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(ot(t,e))return!1;return!0}function wn(t){return t===void 0}function Es(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function cf(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function pL(t,e){var r=[],n,i=t.length;for(n=0;n<i;++n)r.push(e(t[n],n));return r}function sa(t,e){for(var r in e)ot(e,r)&&(t[r]=e[r]);return ot(e,"toString")&&(t.toString=e.toString),ot(e,"valueOf")&&(t.valueOf=e.valueOf),t}function Ao(t,e,r,n){return FL(t,e,r,n,!0).utc()}function LY(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function ke(t){return t._pf==null&&(t._pf=LY()),t._pf}var $R;Array.prototype.some?$R=Array.prototype.some:$R=function(t){var e=Object(this),r=e.length>>>0,n;for(n=0;n<r;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};function w0(t){var e=null,r=!1,n=t._d&&!isNaN(t._d.getTime());if(n&&(e=ke(t),r=$R.call(e.parsedDateParts,function(i){return i!=null}),n=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&r),t._strict&&(n=n&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=n;else return n;return t._isValid}function aw(t){var e=Ao(NaN);return t!=null?sa(ke(e),t):ke(e).userInvalidated=!0,e}var f1=se.momentProperties=[],WC=!1;function v0(t,e){var r,n,i,o=f1.length;if(wn(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),wn(e._i)||(t._i=e._i),wn(e._f)||(t._f=e._f),wn(e._l)||(t._l=e._l),wn(e._strict)||(t._strict=e._strict),wn(e._tzm)||(t._tzm=e._tzm),wn(e._isUTC)||(t._isUTC=e._isUTC),wn(e._offset)||(t._offset=e._offset),wn(e._pf)||(t._pf=ke(e)),wn(e._locale)||(t._locale=e._locale),o>0)for(r=0;r<o;r++)n=f1[r],i=e[n],wn(i)||(t[n]=i);return t}function hf(t){v0(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),WC===!1&&(WC=!0,se.updateOffset(this),WC=!1)}function Wi(t){return t instanceof hf||t!=null&&t._isAMomentObject!=null}function wL(t){se.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function gi(t,e){var r=!0;return sa(function(){if(se.deprecationHandler!=null&&se.deprecationHandler(null,t),r){var n=[],i,o,s,a=arguments.length;for(o=0;o<a;o++){if(i="",typeof arguments[o]=="object"){i+=`
|
|
484
|
+
[`+o+"] ";for(s in arguments[0])ot(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];n.push(i)}wL(t+`
|
|
485
|
+
Arguments: `+Array.prototype.slice.call(n).join("")+`
|
|
486
|
+
`+new Error().stack),r=!1}return e.apply(this,arguments)},e)}var g1={};function vL(t,e){se.deprecationHandler!=null&&se.deprecationHandler(t,e),g1[t]||(wL(e),g1[t]=!0)}se.suppressDeprecationWarnings=!1;se.deprecationHandler=null;function Ho(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function $Y(t){var e,r;for(r in t)ot(t,r)&&(e=t[r],Ho(e)?this[r]=e:this["_"+r]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function FR(t,e){var r=sa({},t),n;for(n in e)ot(e,n)&&(Hl(t[n])&&Hl(e[n])?(r[n]={},sa(r[n],t[n]),sa(r[n],e[n])):e[n]!=null?r[n]=e[n]:delete r[n]);for(n in t)ot(t,n)&&!ot(e,n)&&Hl(t[n])&&(r[n]=sa({},r[n]));return r}function y0(t){t!=null&&this.set(t)}var VR;Object.keys?VR=Object.keys:VR=function(t){var e,r=[];for(e in t)ot(t,e)&&r.push(e);return r};var FY={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function VY(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return Ho(n)?n.call(e,r):n}function Mo(t,e,r){var n=""+Math.abs(t),i=e-n.length,o=t>=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var C0=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,$f=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,BC={},oc={};function Me(t,e,r,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),t&&(oc[t]=i),e&&(oc[e[0]]=function(){return Mo(i.apply(this,arguments),e[1],e[2])}),r&&(oc[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function WY(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function BY(t){var e=t.match(C0),r,n;for(r=0,n=e.length;r<n;r++)oc[e[r]]?e[r]=oc[e[r]]:e[r]=WY(e[r]);return function(i){var o="",s;for(s=0;s<n;s++)o+=Ho(e[s])?e[s].call(i,t):e[s];return o}}function Mm(t,e){return t.isValid()?(e=yL(e,t.localeData()),BC[e]=BC[e]||BY(e),BC[e](t)):t.localeData().invalidDate()}function yL(t,e){var r=5;function n(i){return e.longDateFormat(i)||i}for($f.lastIndex=0;r>=0&&$f.test(t);)t=t.replace($f,n),$f.lastIndex=0,r-=1;return t}var jY={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function UY(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(C0).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[t])}var zY="Invalid date";function YY(){return this._invalidDate}var GY="%d",qY=/\d{1,2}/;function KY(t){return this._ordinal.replace("%d",t)}var XY={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ZY(t,e,r,n){var i=this._relativeTime[r];return Ho(i)?i(t,e,r,n):i.replace(/%d/i,t)}function JY(t,e){var r=this._relativeTime[t>0?"future":"past"];return Ho(r)?r(e):r.replace(/%s/i,e)}var m1={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function mi(t){return typeof t=="string"?m1[t]||m1[t.toLowerCase()]:void 0}function b0(t){var e={},r,n;for(n in t)ot(t,n)&&(r=mi(n),r&&(e[r]=t[n]));return e}var QY={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function e2(t){var e=[],r;for(r in t)ot(t,r)&&e.push({unit:r,priority:QY[r]});return e.sort(function(n,i){return n.priority-i.priority}),e}var CL=/\d/,Un=/\d\d/,bL=/\d{3}/,S0=/\d{4}/,lw=/[+-]?\d{6}/,Dt=/\d\d?/,SL=/\d\d\d\d?/,RL=/\d\d\d\d\d\d?/,uw=/\d{1,3}/,R0=/\d{1,4}/,cw=/[+-]?\d{1,6}/,Ac=/\d+/,hw=/[+-]?\d+/,t2=/Z|[+-]\d\d:?\d\d/gi,dw=/Z|[+-]\d\d(?::?\d\d)?/gi,r2=/[+-]?\d+(\.\d{1,3})?/,df=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Hc=/^[1-9]\d?/,E0=/^([1-9]\d|\d)/,ep;ep={};function we(t,e,r){ep[t]=Ho(e)?e:function(n,i){return n&&r?r:e}}function n2(t,e){return ot(ep,t)?ep[t](e._strict,e._locale):new RegExp(i2(t))}function i2(t){return bs(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,r,n,i,o){return r||n||i||o}))}function bs(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function oi(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Ke(t){var e=+t,r=0;return e!==0&&isFinite(e)&&(r=oi(e)),r}var WR={};function Ct(t,e){var r,n=e,i;for(typeof t=="string"&&(t=[t]),Es(e)&&(n=function(o,s){s[e]=Ke(o)}),i=t.length,r=0;r<i;r++)WR[t[r]]=n}function ff(t,e){Ct(t,function(r,n,i,o){i._w=i._w||{},e(r,i._w,i,o)})}function o2(t,e,r){e!=null&&ot(WR,t)&&WR[t](e,r._a,r,t)}function fw(t){return t%4===0&&t%100!==0||t%400===0}var zr=0,fs=1,So=2,Rr=3,ki=4,gs=5,_l=6,s2=7,a2=8;Me("Y",0,0,function(){var t=this.year();return t<=9999?Mo(t,4):"+"+t});Me(0,["YY",2],0,function(){return this.year()%100});Me(0,["YYYY",4],0,"year");Me(0,["YYYYY",5],0,"year");Me(0,["YYYYYY",6,!0],0,"year");we("Y",hw);we("YY",Dt,Un);we("YYYY",R0,S0);we("YYYYY",cw,lw);we("YYYYYY",cw,lw);Ct(["YYYYY","YYYYYY"],zr);Ct("YYYY",function(t,e){e[zr]=t.length===2?se.parseTwoDigitYear(t):Ke(t)});Ct("YY",function(t,e){e[zr]=se.parseTwoDigitYear(t)});Ct("Y",function(t,e){e[zr]=parseInt(t,10)});function cd(t){return fw(t)?366:365}se.parseTwoDigitYear=function(t){return Ke(t)+(Ke(t)>68?1900:2e3)};var EL=Nc("FullYear",!0);function l2(){return fw(this.year())}function Nc(t,e){return function(r){return r!=null?(TL(this,t,r),se.updateOffset(this,e),this):Hd(this,t)}}function Hd(t,e){if(!t.isValid())return NaN;var r=t._d,n=t._isUTC;switch(e){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function TL(t,e,r){var n,i,o,s,a;if(!(!t.isValid()||isNaN(r))){switch(n=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(i?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(i?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(i?n.setUTCHours(r):n.setHours(r));case"Date":return void(i?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,s=t.month(),a=t.date(),a=a===29&&s===1&&!fw(o)?28:a,i?n.setUTCFullYear(o,s,a):n.setFullYear(o,s,a)}}function u2(t){return t=mi(t),Ho(this[t])?this[t]():this}function c2(t,e){if(typeof t=="object"){t=b0(t);var r=e2(t),n,i=r.length;for(n=0;n<i;n++)this[r[n].unit](t[r[n].unit])}else if(t=mi(t),Ho(this[t]))return this[t](e);return this}function h2(t,e){return(t%e+e)%e}var rr;Array.prototype.indexOf?rr=Array.prototype.indexOf:rr=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function T0(t,e){if(isNaN(t)||isNaN(e))return NaN;var r=h2(e,12);return t+=(e-r)/12,r===1?fw(t)?29:28:31-r%7%2}Me("M",["MM",2],"Mo",function(){return this.month()+1});Me("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Me("MMMM",0,0,function(t){return this.localeData().months(this,t)});we("M",Dt,Hc);we("MM",Dt,Un);we("MMM",function(t,e){return e.monthsShortRegex(t)});we("MMMM",function(t,e){return e.monthsRegex(t)});Ct(["M","MM"],function(t,e){e[fs]=Ke(t)-1});Ct(["MMM","MMMM"],function(t,e,r,n){var i=r._locale.monthsParse(t,n,r._strict);i!=null?e[fs]=i:ke(r).invalidMonth=t});var d2="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),_L="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ML=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,f2=df,g2=df;function m2(t,e){return t?Vi(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||ML).test(e)?"format":"standalone"][t.month()]:Vi(this._months)?this._months:this._months.standalone}function p2(t,e){return t?Vi(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[ML.test(e)?"format":"standalone"][t.month()]:Vi(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function w2(t,e,r){var n,i,o,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)o=Ao([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(o,"").toLocaleLowerCase();return r?e==="MMM"?(i=rr.call(this._shortMonthsParse,s),i!==-1?i:null):(i=rr.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=rr.call(this._shortMonthsParse,s),i!==-1?i:(i=rr.call(this._longMonthsParse,s),i!==-1?i:null)):(i=rr.call(this._longMonthsParse,s),i!==-1?i:(i=rr.call(this._shortMonthsParse,s),i!==-1?i:null))}function v2(t,e,r){var n,i,o;if(this._monthsParseExact)return w2.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=Ao([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!r&&!this._monthsParse[n]&&(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(o.replace(".",""),"i")),r&&e==="MMMM"&&this._longMonthsParse[n].test(t))return n;if(r&&e==="MMM"&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}}function PL(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=Ke(e);else if(e=t.localeData().monthsParse(e),!Es(e))return t}var r=e,n=t.date();return n=n<29?n:Math.min(n,T0(t.year(),r)),t._isUTC?t._d.setUTCMonth(r,n):t._d.setMonth(r,n),t}function IL(t){return t!=null?(PL(this,t),se.updateOffset(this,!0),this):Hd(this,"Month")}function y2(){return T0(this.year(),this.month())}function C2(t){return this._monthsParseExact?(ot(this,"_monthsRegex")||OL.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(ot(this,"_monthsShortRegex")||(this._monthsShortRegex=f2),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function b2(t){return this._monthsParseExact?(ot(this,"_monthsRegex")||OL.call(this),t?this._monthsStrictRegex:this._monthsRegex):(ot(this,"_monthsRegex")||(this._monthsRegex=g2),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function OL(){function t(l,u){return u.length-l.length}var e=[],r=[],n=[],i,o,s,a;for(i=0;i<12;i++)o=Ao([2e3,i]),s=bs(this.monthsShort(o,"")),a=bs(this.months(o,"")),e.push(s),r.push(a),n.push(a),n.push(s);e.sort(t),r.sort(t),n.sort(t),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function S2(t,e,r,n,i,o,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,r,n,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,r,n,i,o,s),a}function Nd(t){var e,r;return t<100&&t>=0?(r=Array.prototype.slice.call(arguments),r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function tp(t,e,r){var n=7+e-r,i=(7+Nd(t,0,n).getUTCDay()-e)%7;return-i+n-1}function xL(t,e,r,n,i){var o=(7+r-n)%7,s=tp(t,n,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=cd(l)+a):a>cd(t)?(l=t+1,u=a-cd(t)):(l=t,u=a),{year:l,dayOfYear:u}}function Dd(t,e,r){var n=tp(t.year(),e,r),i=Math.floor((t.dayOfYear()-n-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+Ss(s,e,r)):i>Ss(t.year(),e,r)?(o=i-Ss(t.year(),e,r),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function Ss(t,e,r){var n=tp(t,e,r),i=tp(t+1,e,r);return(cd(t)-n+i)/7}Me("w",["ww",2],"wo","week");Me("W",["WW",2],"Wo","isoWeek");we("w",Dt,Hc);we("ww",Dt,Un);we("W",Dt,Hc);we("WW",Dt,Un);ff(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=Ke(t)});function R2(t){return Dd(t,this._week.dow,this._week.doy).week}var E2={dow:0,doy:6};function T2(){return this._week.dow}function _2(){return this._week.doy}function M2(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function P2(t){var e=Dd(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Me("d",0,"do","day");Me("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Me("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Me("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Me("e",0,0,"weekday");Me("E",0,0,"isoWeekday");we("d",Dt);we("e",Dt);we("E",Dt);we("dd",function(t,e){return e.weekdaysMinRegex(t)});we("ddd",function(t,e){return e.weekdaysShortRegex(t)});we("dddd",function(t,e){return e.weekdaysRegex(t)});ff(["dd","ddd","dddd"],function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);i!=null?e.d=i:ke(r).invalidWeekday=t});ff(["d","e","E"],function(t,e,r,n){e[n]=Ke(t)});function I2(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function O2(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function _0(t,e){return t.slice(e,7).concat(t.slice(0,e))}var x2="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),AL="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),A2="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),H2=df,N2=df,D2=df;function k2(t,e){var r=Vi(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?_0(r,this._week.dow):t?r[t.day()]:r}function L2(t){return t===!0?_0(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function $2(t){return t===!0?_0(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function F2(t,e,r){var n,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=Ao([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?e==="dddd"?(i=rr.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=rr.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=rr.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=rr.call(this._weekdaysParse,s),i!==-1||(i=rr.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=rr.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=rr.call(this._shortWeekdaysParse,s),i!==-1||(i=rr.call(this._weekdaysParse,s),i!==-1)?i:(i=rr.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=rr.call(this._minWeekdaysParse,s),i!==-1||(i=rr.call(this._weekdaysParse,s),i!==-1)?i:(i=rr.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function V2(t,e,r){var n,i,o;if(this._weekdaysParseExact)return F2.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=Ao([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&e==="dddd"&&this._fullWeekdaysParse[n].test(t))return n;if(r&&e==="ddd"&&this._shortWeekdaysParse[n].test(t))return n;if(r&&e==="dd"&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function W2(t){if(!this.isValid())return t!=null?this:NaN;var e=Hd(this,"Day");return t!=null?(t=I2(t,this.localeData()),this.add(t-e,"d")):e}function B2(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function j2(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=O2(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function U2(t){return this._weekdaysParseExact?(ot(this,"_weekdaysRegex")||M0.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(ot(this,"_weekdaysRegex")||(this._weekdaysRegex=H2),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function z2(t){return this._weekdaysParseExact?(ot(this,"_weekdaysRegex")||M0.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ot(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=N2),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Y2(t){return this._weekdaysParseExact?(ot(this,"_weekdaysRegex")||M0.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ot(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=D2),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function M0(){function t(c,h){return h.length-c.length}var e=[],r=[],n=[],i=[],o,s,a,l,u;for(o=0;o<7;o++)s=Ao([2e3,1]).day(o),a=bs(this.weekdaysMin(s,"")),l=bs(this.weekdaysShort(s,"")),u=bs(this.weekdays(s,"")),e.push(a),r.push(l),n.push(u),i.push(a),i.push(l),i.push(u);e.sort(t),r.sort(t),n.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function P0(){return this.hours()%12||12}function G2(){return this.hours()||24}Me("H",["HH",2],0,"hour");Me("h",["hh",2],0,P0);Me("k",["kk",2],0,G2);Me("hmm",0,0,function(){return""+P0.apply(this)+Mo(this.minutes(),2)});Me("hmmss",0,0,function(){return""+P0.apply(this)+Mo(this.minutes(),2)+Mo(this.seconds(),2)});Me("Hmm",0,0,function(){return""+this.hours()+Mo(this.minutes(),2)});Me("Hmmss",0,0,function(){return""+this.hours()+Mo(this.minutes(),2)+Mo(this.seconds(),2)});function HL(t,e){Me(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}HL("a",!0);HL("A",!1);function NL(t,e){return e._meridiemParse}we("a",NL);we("A",NL);we("H",Dt,E0);we("h",Dt,Hc);we("k",Dt,Hc);we("HH",Dt,Un);we("hh",Dt,Un);we("kk",Dt,Un);we("hmm",SL);we("hmmss",RL);we("Hmm",SL);we("Hmmss",RL);Ct(["H","HH"],Rr);Ct(["k","kk"],function(t,e,r){var n=Ke(t);e[Rr]=n===24?0:n});Ct(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t});Ct(["h","hh"],function(t,e,r){e[Rr]=Ke(t),ke(r).bigHour=!0});Ct("hmm",function(t,e,r){var n=t.length-2;e[Rr]=Ke(t.substr(0,n)),e[ki]=Ke(t.substr(n)),ke(r).bigHour=!0});Ct("hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[Rr]=Ke(t.substr(0,n)),e[ki]=Ke(t.substr(n,2)),e[gs]=Ke(t.substr(i)),ke(r).bigHour=!0});Ct("Hmm",function(t,e,r){var n=t.length-2;e[Rr]=Ke(t.substr(0,n)),e[ki]=Ke(t.substr(n))});Ct("Hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[Rr]=Ke(t.substr(0,n)),e[ki]=Ke(t.substr(n,2)),e[gs]=Ke(t.substr(i))});function q2(t){return(t+"").toLowerCase().charAt(0)==="p"}var K2=/[ap]\.?m?\.?/i,X2=Nc("Hours",!0);function Z2(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}var DL={calendar:FY,longDateFormat:jY,invalidDate:zY,ordinal:GY,dayOfMonthOrdinalParse:qY,relativeTime:XY,months:d2,monthsShort:_L,week:E2,weekdays:x2,weekdaysMin:A2,weekdaysShort:AL,meridiemParse:K2},Lt={},rh={},kd;function J2(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r+=1)if(t[r]!==e[r])return r;return n}function p1(t){return t&&t.toLowerCase().replace("_","-")}function Q2(t){for(var e=0,r,n,i,o;e<t.length;){for(o=p1(t[e]).split("-"),r=o.length,n=p1(t[e+1]),n=n?n.split("-"):null;r>0;){if(i=gw(o.slice(0,r).join("-")),i)return i;if(n&&n.length>=r&&J2(o,n)>=r-1)break;r--}e++}return kd}function eG(t){return!!(t&&t.match("^[^/\\\\]*$"))}function gw(t){var e=null,r;if(Lt[t]===void 0&&typeof module<"u"&&module&&module.exports&&eG(t))try{e=kd._abbr,r=require,r("./locale/"+t),ga(e)}catch{Lt[t]=null}return Lt[t]}function ga(t,e){var r;return t&&(wn(e)?r=Is(t):r=I0(t,e),r?kd=r:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),kd._abbr}function I0(t,e){if(e!==null){var r,n=DL;if(e.abbr=t,Lt[t]!=null)vL("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Lt[t]._config;else if(e.parentLocale!=null)if(Lt[e.parentLocale]!=null)n=Lt[e.parentLocale]._config;else if(r=gw(e.parentLocale),r!=null)n=r._config;else return rh[e.parentLocale]||(rh[e.parentLocale]=[]),rh[e.parentLocale].push({name:t,config:e}),null;return Lt[t]=new y0(FR(n,e)),rh[t]&&rh[t].forEach(function(i){I0(i.name,i.config)}),ga(t),Lt[t]}else return delete Lt[t],null}function tG(t,e){if(e!=null){var r,n,i=DL;Lt[t]!=null&&Lt[t].parentLocale!=null?Lt[t].set(FR(Lt[t]._config,e)):(n=gw(t),n!=null&&(i=n._config),e=FR(i,e),n==null&&(e.abbr=t),r=new y0(e),r.parentLocale=Lt[t],Lt[t]=r),ga(t)}else Lt[t]!=null&&(Lt[t].parentLocale!=null?(Lt[t]=Lt[t].parentLocale,t===ga()&&ga(t)):Lt[t]!=null&&delete Lt[t]);return Lt[t]}function Is(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return kd;if(!Vi(t)){if(e=gw(t),e)return e;t=[t]}return Q2(t)}function rG(){return VR(Lt)}function O0(t){var e,r=t._a;return r&&ke(t).overflow===-2&&(e=r[fs]<0||r[fs]>11?fs:r[So]<1||r[So]>T0(r[zr],r[fs])?So:r[Rr]<0||r[Rr]>24||r[Rr]===24&&(r[ki]!==0||r[gs]!==0||r[_l]!==0)?Rr:r[ki]<0||r[ki]>59?ki:r[gs]<0||r[gs]>59?gs:r[_l]<0||r[_l]>999?_l:-1,ke(t)._overflowDayOfYear&&(e<zr||e>So)&&(e=So),ke(t)._overflowWeeks&&e===-1&&(e=s2),ke(t)._overflowWeekday&&e===-1&&(e=a2),ke(t).overflow=e),t}var nG=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,iG=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,oG=/Z|[+-]\d\d(?::?\d\d)?/,Ff=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],jC=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],sG=/^\/?Date\((-?\d+)/i,aG=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,lG={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function kL(t){var e,r,n=t._i,i=nG.exec(n)||iG.exec(n),o,s,a,l,u=Ff.length,c=jC.length;if(i){for(ke(t).iso=!0,e=0,r=u;e<r;e++)if(Ff[e][1].exec(i[1])){s=Ff[e][0],o=Ff[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,r=c;e<r;e++)if(jC[e][1].exec(i[3])){a=(i[2]||" ")+jC[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(oG.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),A0(t)}else t._isValid=!1}function uG(t,e,r,n,i,o){var s=[cG(t),_L.indexOf(e),parseInt(r,10),parseInt(n,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function cG(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function hG(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function dG(t,e,r){if(t){var n=AL.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(n!==i)return ke(r).weekdayMismatch=!0,r._isValid=!1,!1}return!0}function fG(t,e,r){if(t)return lG[t];if(e)return 0;var n=parseInt(r,10),i=n%100,o=(n-i)/100;return o*60+i}function LL(t){var e=aG.exec(hG(t._i)),r;if(e){if(r=uG(e[4],e[3],e[2],e[5],e[6],e[7]),!dG(e[1],r,t))return;t._a=r,t._tzm=fG(e[8],e[9],e[10]),t._d=Nd.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),ke(t).rfc2822=!0}else t._isValid=!1}function gG(t){var e=sG.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(kL(t),t._isValid===!1)delete t._isValid;else return;if(LL(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:se.createFromInputFallback(t)}se.createFromInputFallback=gi("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function Uu(t,e,r){return t??e??r}function mG(t){var e=new Date(se.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function x0(t){var e,r,n=[],i,o,s;if(!t._d){for(i=mG(t),t._w&&t._a[So]==null&&t._a[fs]==null&&pG(t),t._dayOfYear!=null&&(s=Uu(t._a[zr],i[zr]),(t._dayOfYear>cd(s)||t._dayOfYear===0)&&(ke(t)._overflowDayOfYear=!0),r=Nd(s,0,t._dayOfYear),t._a[fs]=r.getUTCMonth(),t._a[So]=r.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=n[e]=i[e];for(;e<7;e++)t._a[e]=n[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[Rr]===24&&t._a[ki]===0&&t._a[gs]===0&&t._a[_l]===0&&(t._nextDay=!0,t._a[Rr]=0),t._d=(t._useUTC?Nd:S2).apply(null,n),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Rr]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(ke(t).weekdayMismatch=!0)}}function pG(t){var e,r,n,i,o,s,a,l,u;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(o=1,s=4,r=Uu(e.GG,t._a[zr],Dd(Nt(),1,4).year),n=Uu(e.W,1),i=Uu(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=Dd(Nt(),o,s),r=Uu(e.gg,t._a[zr],u.year),n=Uu(e.w,u.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),n<1||n>Ss(r,o,s)?ke(t)._overflowWeeks=!0:l!=null?ke(t)._overflowWeekday=!0:(a=xL(r,n,i,o,s),t._a[zr]=a.year,t._dayOfYear=a.dayOfYear)}se.ISO_8601=function(){};se.RFC_2822=function(){};function A0(t){if(t._f===se.ISO_8601){kL(t);return}if(t._f===se.RFC_2822){LL(t);return}t._a=[],ke(t).empty=!0;var e=""+t._i,r,n,i,o,s,a=e.length,l=0,u,c;for(i=yL(t._f,t._locale).match(C0)||[],c=i.length,r=0;r<c;r++)o=i[r],n=(e.match(n2(o,t))||[])[0],n&&(s=e.substr(0,e.indexOf(n)),s.length>0&&ke(t).unusedInput.push(s),e=e.slice(e.indexOf(n)+n.length),l+=n.length),oc[o]?(n?ke(t).empty=!1:ke(t).unusedTokens.push(o),o2(o,n,t)):t._strict&&!n&&ke(t).unusedTokens.push(o);ke(t).charsLeftOver=a-l,e.length>0&&ke(t).unusedInput.push(e),t._a[Rr]<=12&&ke(t).bigHour===!0&&t._a[Rr]>0&&(ke(t).bigHour=void 0),ke(t).parsedDateParts=t._a.slice(0),ke(t).meridiem=t._meridiem,t._a[Rr]=wG(t._locale,t._a[Rr],t._meridiem),u=ke(t).era,u!==null&&(t._a[zr]=t._locale.erasConvertYear(u,t._a[zr])),x0(t),O0(t)}function wG(t,e,r){var n;return r==null?e:t.meridiemHour!=null?t.meridiemHour(e,r):(t.isPM!=null&&(n=t.isPM(r),n&&e<12&&(e+=12),!n&&e===12&&(e=0)),e)}function vG(t){var e,r,n,i,o,s,a=!1,l=t._f.length;if(l===0){ke(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=v0({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],A0(e),w0(e)&&(s=!0),o+=ke(e).charsLeftOver,o+=ke(e).unusedTokens.length*10,ke(e).score=o,a?o<n&&(n=o,r=e):(n==null||o<n||s)&&(n=o,r=e,s&&(a=!0));sa(t,r||e)}function yG(t){if(!t._d){var e=b0(t._i),r=e.day===void 0?e.date:e.day;t._a=pL([e.year,e.month,r,e.hour,e.minute,e.second,e.millisecond],function(n){return n&&parseInt(n,10)}),x0(t)}}function CG(t){var e=new hf(O0($L(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function $L(t){var e=t._i,r=t._f;return t._locale=t._locale||Is(t._l),e===null||r===void 0&&e===""?aw({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Wi(e)?new hf(O0(e)):(cf(e)?t._d=e:Vi(r)?vG(t):r?A0(t):bG(t),w0(t)||(t._d=null),t))}function bG(t){var e=t._i;wn(e)?t._d=new Date(se.now()):cf(e)?t._d=new Date(e.valueOf()):typeof e=="string"?gG(t):Vi(e)?(t._a=pL(e.slice(0),function(r){return parseInt(r,10)}),x0(t)):Hl(e)?yG(t):Es(e)?t._d=new Date(e):se.createFromInputFallback(t)}function FL(t,e,r,n,i){var o={};return(e===!0||e===!1)&&(n=e,e=void 0),(r===!0||r===!1)&&(n=r,r=void 0),(Hl(t)&&p0(t)||Vi(t)&&t.length===0)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=r,o._i=t,o._f=e,o._strict=n,CG(o)}function Nt(t,e,r,n){return FL(t,e,r,n,!1)}var SG=gi("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:aw()}),RG=gi("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:aw()});function VL(t,e){var r,n;if(e.length===1&&Vi(e[0])&&(e=e[0]),!e.length)return Nt();for(r=e[0],n=1;n<e.length;++n)(!e[n].isValid()||e[n][t](r))&&(r=e[n]);return r}function EG(){var t=[].slice.call(arguments,0);return VL("isBefore",t)}function TG(){var t=[].slice.call(arguments,0);return VL("isAfter",t)}var _G=function(){return Date.now?Date.now():+new Date},nh=["year","quarter","month","week","day","hour","minute","second","millisecond"];function MG(t){var e,r=!1,n,i=nh.length;for(e in t)if(ot(t,e)&&!(rr.call(nh,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(n=0;n<i;++n)if(t[nh[n]]){if(r)return!1;parseFloat(t[nh[n]])!==Ke(t[nh[n]])&&(r=!0)}return!0}function PG(){return this._isValid}function IG(){return zi(NaN)}function mw(t){var e=b0(t),r=e.year||0,n=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=MG(e),this._milliseconds=+c+u*1e3+l*6e4+a*1e3*60*60,this._days=+s+o*7,this._months=+i+n*3+r*12,this._data={},this._locale=Is(),this._bubble()}function Pm(t){return t instanceof mw}function BR(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function OG(t,e,r){var n=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0,s;for(s=0;s<n;s++)Ke(t[s])!==Ke(e[s])&&o++;return o+i}function WL(t,e){Me(t,0,0,function(){var r=this.utcOffset(),n="+";return r<0&&(r=-r,n="-"),n+Mo(~~(r/60),2)+e+Mo(~~r%60,2)})}WL("Z",":");WL("ZZ","");we("Z",dw);we("ZZ",dw);Ct(["Z","ZZ"],function(t,e,r){r._useUTC=!0,r._tzm=H0(dw,t)});var xG=/([\+\-]|\d\d)/gi;function H0(t,e){var r=(e||"").match(t),n,i,o;return r===null?null:(n=r[r.length-1]||[],i=(n+"").match(xG)||["-",0,0],o=+(i[1]*60)+Ke(i[2]),o===0?0:i[0]==="+"?o:-o)}function N0(t,e){var r,n;return e._isUTC?(r=e.clone(),n=(Wi(t)||cf(t)?t.valueOf():Nt(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),se.updateOffset(r,!1),r):Nt(t).local()}function jR(t){return-Math.round(t._d.getTimezoneOffset())}se.updateOffset=function(){};function AG(t,e,r){var n=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=H0(dw,t),t===null)return this}else Math.abs(t)<16&&!r&&(t=t*60);return!this._isUTC&&e&&(i=jR(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==t&&(!e||this._changeInProgress?UL(this,zi(t-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,se.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:jR(this)}function HG(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function NG(t){return this.utcOffset(0,t)}function DG(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(jR(this),"m")),this}function kG(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=H0(t2,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function LG(t){return this.isValid()?(t=t?Nt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function $G(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function FG(){if(!wn(this._isDSTShifted))return this._isDSTShifted;var t={},e;return v0(t,this),t=$L(t),t._a?(e=t._isUTC?Ao(t._a):Nt(t._a),this._isDSTShifted=this.isValid()&&OG(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function VG(){return this.isValid()?!this._isUTC:!1}function WG(){return this.isValid()?this._isUTC:!1}function BL(){return this.isValid()?this._isUTC&&this._offset===0:!1}var BG=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,jG=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function zi(t,e){var r=t,n=null,i,o,s;return Pm(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:Es(t)||!isNaN(+t)?(r={},e?r[e]=+t:r.milliseconds=+t):(n=BG.exec(t))?(i=n[1]==="-"?-1:1,r={y:0,d:Ke(n[So])*i,h:Ke(n[Rr])*i,m:Ke(n[ki])*i,s:Ke(n[gs])*i,ms:Ke(BR(n[_l]*1e3))*i}):(n=jG.exec(t))?(i=n[1]==="-"?-1:1,r={y:Aa(n[2],i),M:Aa(n[3],i),w:Aa(n[4],i),d:Aa(n[5],i),h:Aa(n[6],i),m:Aa(n[7],i),s:Aa(n[8],i)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(s=UG(Nt(r.from),Nt(r.to)),r={},r.ms=s.milliseconds,r.M=s.months),o=new mw(r),Pm(t)&&ot(t,"_locale")&&(o._locale=t._locale),Pm(t)&&ot(t,"_isValid")&&(o._isValid=t._isValid),o}zi.fn=mw.prototype;zi.invalid=IG;function Aa(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function w1(t,e){var r={};return r.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function UG(t,e){var r;return t.isValid()&&e.isValid()?(e=N0(e,t),t.isBefore(e)?r=w1(t,e):(r=w1(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function jL(t,e){return function(r,n){var i,o;return n!==null&&!isNaN(+n)&&(vL(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),i=zi(r,n),UL(this,i,t),this}}function UL(t,e,r,n){var i=e._milliseconds,o=BR(e._days),s=BR(e._months);t.isValid()&&(n=n??!0,s&&PL(t,Hd(t,"Month")+s*r),o&&TL(t,"Date",Hd(t,"Date")+o*r),i&&t._d.setTime(t._d.valueOf()+i*r),n&&se.updateOffset(t,o||s))}var zG=jL(1,"add"),YG=jL(-1,"subtract");function zL(t){return typeof t=="string"||t instanceof String}function GG(t){return Wi(t)||cf(t)||zL(t)||Es(t)||KG(t)||qG(t)||t===null||t===void 0}function qG(t){var e=Hl(t)&&!p0(t),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=n.length;for(i=0;i<s;i+=1)o=n[i],r=r||ot(t,o);return e&&r}function KG(t){var e=Vi(t),r=!1;return e&&(r=t.filter(function(n){return!Es(n)&&zL(t)}).length===0),e&&r}function XG(t){var e=Hl(t)&&!p0(t),r=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<n.length;i+=1)o=n[i],r=r||ot(t,o);return e&&r}function ZG(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function JG(t,e){arguments.length===1&&(arguments[0]?GG(arguments[0])?(t=arguments[0],e=void 0):XG(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var r=t||Nt(),n=N0(r,this).startOf("day"),i=se.calendarFormat(this,n)||"sameElse",o=e&&(Ho(e[i])?e[i].call(this,r):e[i]);return this.format(o||this.localeData().calendar(i,this,Nt(r)))}function QG(){return new hf(this)}function eq(t,e){var r=Wi(t)?t:Nt(t);return this.isValid()&&r.isValid()?(e=mi(e)||"millisecond",e==="millisecond"?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(e).valueOf()):!1}function tq(t,e){var r=Wi(t)?t:Nt(t);return this.isValid()&&r.isValid()?(e=mi(e)||"millisecond",e==="millisecond"?this.valueOf()<r.valueOf():this.clone().endOf(e).valueOf()<r.valueOf()):!1}function rq(t,e,r,n){var i=Wi(t)?t:Nt(t),o=Wi(e)?e:Nt(e);return this.isValid()&&i.isValid()&&o.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,r):!this.isBefore(i,r))&&(n[1]===")"?this.isBefore(o,r):!this.isAfter(o,r))):!1}function nq(t,e){var r=Wi(t)?t:Nt(t),n;return this.isValid()&&r.isValid()?(e=mi(e)||"millisecond",e==="millisecond"?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf())):!1}function iq(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function oq(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function sq(t,e,r){var n,i,o;if(!this.isValid())return NaN;if(n=N0(t,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,e=mi(e),e){case"year":o=Im(this,n)/12;break;case"month":o=Im(this,n);break;case"quarter":o=Im(this,n)/3;break;case"second":o=(this-n)/1e3;break;case"minute":o=(this-n)/6e4;break;case"hour":o=(this-n)/36e5;break;case"day":o=(this-n-i)/864e5;break;case"week":o=(this-n-i)/6048e5;break;default:o=this-n}return r?o:oi(o)}function Im(t,e){if(t.date()<e.date())return-Im(e,t);var r=(e.year()-t.year())*12+(e.month()-t.month()),n=t.clone().add(r,"months"),i,o;return e-n<0?(i=t.clone().add(r-1,"months"),o=(e-n)/(n-i)):(i=t.clone().add(r+1,"months"),o=(e-n)/(i-n)),-(r+o)||0}se.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";se.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function aq(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lq(t){if(!this.isValid())return null;var e=t!==!0,r=e?this.clone().utc():this;return r.year()<0||r.year()>9999?Mm(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ho(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Mm(r,"Z")):Mm(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function uq(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",r,n,i,o;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",o=e+'[")]',this.format(r+n+i+o)}function cq(t){t||(t=this.isUtc()?se.defaultFormatUtc:se.defaultFormat);var e=Mm(this,t);return this.localeData().postformat(e)}function hq(t,e){return this.isValid()&&(Wi(t)&&t.isValid()||Nt(t).isValid())?zi({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function dq(t){return this.from(Nt(),t)}function fq(t,e){return this.isValid()&&(Wi(t)&&t.isValid()||Nt(t).isValid())?zi({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function gq(t){return this.to(Nt(),t)}function YL(t){var e;return t===void 0?this._locale._abbr:(e=Is(t),e!=null&&(this._locale=e),this)}var GL=gi("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function qL(){return this._locale}var rp=1e3,sc=60*rp,np=60*sc,KL=(365*400+97)*24*np;function ac(t,e){return(t%e+e)%e}function XL(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-KL:new Date(t,e,r).valueOf()}function ZL(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-KL:Date.UTC(t,e,r)}function mq(t){var e,r;if(t=mi(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?ZL:XL,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=ac(e+(this._isUTC?0:this.utcOffset()*sc),np);break;case"minute":e=this._d.valueOf(),e-=ac(e,sc);break;case"second":e=this._d.valueOf(),e-=ac(e,rp);break}return this._d.setTime(e),se.updateOffset(this,!0),this}function pq(t){var e,r;if(t=mi(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?ZL:XL,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=np-ac(e+(this._isUTC?0:this.utcOffset()*sc),np)-1;break;case"minute":e=this._d.valueOf(),e+=sc-ac(e,sc)-1;break;case"second":e=this._d.valueOf(),e+=rp-ac(e,rp)-1;break}return this._d.setTime(e),se.updateOffset(this,!0),this}function wq(){return this._d.valueOf()-(this._offset||0)*6e4}function vq(){return Math.floor(this.valueOf()/1e3)}function yq(){return new Date(this.valueOf())}function Cq(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function bq(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Sq(){return this.isValid()?this.toISOString():null}function Rq(){return w0(this)}function Eq(){return sa({},ke(this))}function Tq(){return ke(this).overflow}function _q(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Me("N",0,0,"eraAbbr");Me("NN",0,0,"eraAbbr");Me("NNN",0,0,"eraAbbr");Me("NNNN",0,0,"eraName");Me("NNNNN",0,0,"eraNarrow");Me("y",["y",1],"yo","eraYear");Me("y",["yy",2],0,"eraYear");Me("y",["yyy",3],0,"eraYear");Me("y",["yyyy",4],0,"eraYear");we("N",D0);we("NN",D0);we("NNN",D0);we("NNNN",Lq);we("NNNNN",$q);Ct(["N","NN","NNN","NNNN","NNNNN"],function(t,e,r,n){var i=r._locale.erasParse(t,n,r._strict);i?ke(r).era=i:ke(r).invalidEra=t});we("y",Ac);we("yy",Ac);we("yyy",Ac);we("yyyy",Ac);we("yo",Fq);Ct(["y","yy","yyy","yyyy"],zr);Ct(["yo"],function(t,e,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[zr]=r._locale.eraYearOrdinalParse(t,i):e[zr]=parseInt(t,10)});function Mq(t,e){var r,n,i,o=this._eras||Is("en")._eras;for(r=0,n=o.length;r<n;++r){switch(typeof o[r].since){case"string":i=se(o[r].since).startOf("day"),o[r].since=i.valueOf();break}switch(typeof o[r].until){case"undefined":o[r].until=1/0;break;case"string":i=se(o[r].until).startOf("day").valueOf(),o[r].until=i.valueOf();break}}return o}function Pq(t,e,r){var n,i,o=this.eras(),s,a,l;for(t=t.toUpperCase(),n=0,i=o.length;n<i;++n)if(s=o[n].name.toUpperCase(),a=o[n].abbr.toUpperCase(),l=o[n].narrow.toUpperCase(),r)switch(e){case"N":case"NN":case"NNN":if(a===t)return o[n];break;case"NNNN":if(s===t)return o[n];break;case"NNNNN":if(l===t)return o[n];break}else if([s,a,l].indexOf(t)>=0)return o[n]}function Iq(t,e){var r=t.since<=t.until?1:-1;return e===void 0?se(t.since).year():se(t.since).year()+(e-t.offset)*r}function Oq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].name;return""}function xq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].narrow;return""}function Aq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].abbr;return""}function Hq(){var t,e,r,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(r=i[t].since<=i[t].until?1:-1,n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until||i[t].until<=n&&n<=i[t].since)return(this.year()-se(i[t].since).year())*r+i[t].offset;return this.year()}function Nq(t){return ot(this,"_erasNameRegex")||k0.call(this),t?this._erasNameRegex:this._erasRegex}function Dq(t){return ot(this,"_erasAbbrRegex")||k0.call(this),t?this._erasAbbrRegex:this._erasRegex}function kq(t){return ot(this,"_erasNarrowRegex")||k0.call(this),t?this._erasNarrowRegex:this._erasRegex}function D0(t,e){return e.erasAbbrRegex(t)}function Lq(t,e){return e.erasNameRegex(t)}function $q(t,e){return e.erasNarrowRegex(t)}function Fq(t,e){return e._eraYearOrdinalRegex||Ac}function k0(){var t=[],e=[],r=[],n=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=bs(u[i].name),a=bs(u[i].abbr),l=bs(u[i].narrow),e.push(s),t.push(a),r.push(l),n.push(s),n.push(a),n.push(l);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}Me(0,["gg",2],0,function(){return this.weekYear()%100});Me(0,["GG",2],0,function(){return this.isoWeekYear()%100});function pw(t,e){Me(0,[t,t.length],0,e)}pw("gggg","weekYear");pw("ggggg","weekYear");pw("GGGG","isoWeekYear");pw("GGGGG","isoWeekYear");we("G",hw);we("g",hw);we("GG",Dt,Un);we("gg",Dt,Un);we("GGGG",R0,S0);we("gggg",R0,S0);we("GGGGG",cw,lw);we("ggggg",cw,lw);ff(["gggg","ggggg","GGGG","GGGGG"],function(t,e,r,n){e[n.substr(0,2)]=Ke(t)});ff(["gg","GG"],function(t,e,r,n){e[n]=se.parseTwoDigitYear(t)});function Vq(t){return JL.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Wq(t){return JL.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Bq(){return Ss(this.year(),1,4)}function jq(){return Ss(this.isoWeekYear(),1,4)}function Uq(){var t=this.localeData()._week;return Ss(this.year(),t.dow,t.doy)}function zq(){var t=this.localeData()._week;return Ss(this.weekYear(),t.dow,t.doy)}function JL(t,e,r,n,i){var o;return t==null?Dd(this,n,i).year:(o=Ss(t,n,i),e>o&&(e=o),Yq.call(this,t,e,r,n,i))}function Yq(t,e,r,n,i){var o=xL(t,e,r,n,i),s=Nd(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Me("Q",0,"Qo","quarter");we("Q",CL);Ct("Q",function(t,e){e[fs]=(Ke(t)-1)*3});function Gq(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Me("D",["DD",2],"Do","date");we("D",Dt,Hc);we("DD",Dt,Un);we("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Ct(["D","DD"],So);Ct("Do",function(t,e){e[So]=Ke(t.match(Dt)[0])});var QL=Nc("Date",!0);Me("DDD",["DDDD",3],"DDDo","dayOfYear");we("DDD",uw);we("DDDD",bL);Ct(["DDD","DDDD"],function(t,e,r){r._dayOfYear=Ke(t)});function qq(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Me("m",["mm",2],0,"minute");we("m",Dt,E0);we("mm",Dt,Un);Ct(["m","mm"],ki);var Kq=Nc("Minutes",!1);Me("s",["ss",2],0,"second");we("s",Dt,E0);we("ss",Dt,Un);Ct(["s","ss"],gs);var Xq=Nc("Seconds",!1);Me("S",0,0,function(){return~~(this.millisecond()/100)});Me(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Me(0,["SSS",3],0,"millisecond");Me(0,["SSSS",4],0,function(){return this.millisecond()*10});Me(0,["SSSSS",5],0,function(){return this.millisecond()*100});Me(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Me(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Me(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Me(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});we("S",uw,CL);we("SS",uw,Un);we("SSS",uw,bL);var aa,e$;for(aa="SSSS";aa.length<=9;aa+="S")we(aa,Ac);function Zq(t,e){e[_l]=Ke(("0."+t)*1e3)}for(aa="S";aa.length<=9;aa+="S")Ct(aa,Zq);e$=Nc("Milliseconds",!1);Me("z",0,0,"zoneAbbr");Me("zz",0,0,"zoneName");function Jq(){return this._isUTC?"UTC":""}function Qq(){return this._isUTC?"Coordinated Universal Time":""}var le=hf.prototype;le.add=zG;le.calendar=JG;le.clone=QG;le.diff=sq;le.endOf=pq;le.format=cq;le.from=hq;le.fromNow=dq;le.to=fq;le.toNow=gq;le.get=u2;le.invalidAt=Tq;le.isAfter=eq;le.isBefore=tq;le.isBetween=rq;le.isSame=nq;le.isSameOrAfter=iq;le.isSameOrBefore=oq;le.isValid=Rq;le.lang=GL;le.locale=YL;le.localeData=qL;le.max=RG;le.min=SG;le.parsingFlags=Eq;le.set=c2;le.startOf=mq;le.subtract=YG;le.toArray=Cq;le.toObject=bq;le.toDate=yq;le.toISOString=lq;le.inspect=uq;typeof Symbol<"u"&&Symbol.for!=null&&(le[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});le.toJSON=Sq;le.toString=aq;le.unix=vq;le.valueOf=wq;le.creationData=_q;le.eraName=Oq;le.eraNarrow=xq;le.eraAbbr=Aq;le.eraYear=Hq;le.year=EL;le.isLeapYear=l2;le.weekYear=Vq;le.isoWeekYear=Wq;le.quarter=le.quarters=Gq;le.month=IL;le.daysInMonth=y2;le.week=le.weeks=M2;le.isoWeek=le.isoWeeks=P2;le.weeksInYear=Uq;le.weeksInWeekYear=zq;le.isoWeeksInYear=Bq;le.isoWeeksInISOWeekYear=jq;le.date=QL;le.day=le.days=W2;le.weekday=B2;le.isoWeekday=j2;le.dayOfYear=qq;le.hour=le.hours=X2;le.minute=le.minutes=Kq;le.second=le.seconds=Xq;le.millisecond=le.milliseconds=e$;le.utcOffset=AG;le.utc=NG;le.local=DG;le.parseZone=kG;le.hasAlignedHourOffset=LG;le.isDST=$G;le.isLocal=VG;le.isUtcOffset=WG;le.isUtc=BL;le.isUTC=BL;le.zoneAbbr=Jq;le.zoneName=Qq;le.dates=gi("dates accessor is deprecated. Use date instead.",QL);le.months=gi("months accessor is deprecated. Use month instead",IL);le.years=gi("years accessor is deprecated. Use year instead",EL);le.zone=gi("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",HG);le.isDSTShifted=gi("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",FG);function eK(t){return Nt(t*1e3)}function tK(){return Nt.apply(null,arguments).parseZone()}function t$(t){return t}var st=y0.prototype;st.calendar=VY;st.longDateFormat=UY;st.invalidDate=YY;st.ordinal=KY;st.preparse=t$;st.postformat=t$;st.relativeTime=ZY;st.pastFuture=JY;st.set=$Y;st.eras=Mq;st.erasParse=Pq;st.erasConvertYear=Iq;st.erasAbbrRegex=Dq;st.erasNameRegex=Nq;st.erasNarrowRegex=kq;st.months=m2;st.monthsShort=p2;st.monthsParse=v2;st.monthsRegex=b2;st.monthsShortRegex=C2;st.week=R2;st.firstDayOfYear=_2;st.firstDayOfWeek=T2;st.weekdays=k2;st.weekdaysMin=$2;st.weekdaysShort=L2;st.weekdaysParse=V2;st.weekdaysRegex=U2;st.weekdaysShortRegex=z2;st.weekdaysMinRegex=Y2;st.isPM=q2;st.meridiem=Z2;function ip(t,e,r,n){var i=Is(),o=Ao().set(n,e);return i[r](o,t)}function r$(t,e,r){if(Es(t)&&(e=t,t=void 0),t=t||"",e!=null)return ip(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=ip(t,n,r,"month");return i}function L0(t,e,r,n){typeof t=="boolean"?(Es(e)&&(r=e,e=void 0),e=e||""):(e=t,r=e,t=!1,Es(e)&&(r=e,e=void 0),e=e||"");var i=Is(),o=t?i._week.dow:0,s,a=[];if(r!=null)return ip(e,(r+o)%7,n,"day");for(s=0;s<7;s++)a[s]=ip(e,(s+o)%7,n,"day");return a}function rK(t,e){return r$(t,e,"months")}function nK(t,e){return r$(t,e,"monthsShort")}function iK(t,e,r){return L0(t,e,r,"weekdays")}function oK(t,e,r){return L0(t,e,r,"weekdaysShort")}function sK(t,e,r){return L0(t,e,r,"weekdaysMin")}ga("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,r=Ke(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+r}});se.lang=gi("moment.lang is deprecated. Use moment.locale instead.",ga);se.langData=gi("moment.langData is deprecated. Use moment.localeData instead.",Is);var Wo=Math.abs;function aK(){var t=this._data;return this._milliseconds=Wo(this._milliseconds),this._days=Wo(this._days),this._months=Wo(this._months),t.milliseconds=Wo(t.milliseconds),t.seconds=Wo(t.seconds),t.minutes=Wo(t.minutes),t.hours=Wo(t.hours),t.months=Wo(t.months),t.years=Wo(t.years),this}function n$(t,e,r,n){var i=zi(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function lK(t,e){return n$(this,t,e,1)}function uK(t,e){return n$(this,t,e,-1)}function v1(t){return t<0?Math.floor(t):Math.ceil(t)}function cK(){var t=this._milliseconds,e=this._days,r=this._months,n=this._data,i,o,s,a,l;return t>=0&&e>=0&&r>=0||t<=0&&e<=0&&r<=0||(t+=v1(UR(r)+e)*864e5,e=0,r=0),n.milliseconds=t%1e3,i=oi(t/1e3),n.seconds=i%60,o=oi(i/60),n.minutes=o%60,s=oi(o/60),n.hours=s%24,e+=oi(s/24),l=oi(i$(e)),r+=l,e-=v1(UR(l)),a=oi(r/12),r%=12,n.days=e,n.months=r,n.years=a,this}function i$(t){return t*4800/146097}function UR(t){return t*146097/4800}function hK(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if(t=mi(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+n/864e5,r=this._months+i$(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(UR(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return e*24+n/36e5;case"minute":return e*1440+n/6e4;case"second":return e*86400+n/1e3;case"millisecond":return Math.floor(e*864e5)+n;default:throw new Error("Unknown unit "+t)}}function Os(t){return function(){return this.as(t)}}var o$=Os("ms"),dK=Os("s"),fK=Os("m"),gK=Os("h"),mK=Os("d"),pK=Os("w"),wK=Os("M"),vK=Os("Q"),yK=Os("y"),CK=o$;function bK(){return zi(this)}function SK(t){return t=mi(t),this.isValid()?this[t+"s"]():NaN}function Jl(t){return function(){return this.isValid()?this._data[t]:NaN}}var RK=Jl("milliseconds"),EK=Jl("seconds"),TK=Jl("minutes"),_K=Jl("hours"),MK=Jl("days"),PK=Jl("months"),IK=Jl("years");function OK(){return oi(this.days()/7)}var as=Math.round,Qu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function xK(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function AK(t,e,r,n){var i=zi(t).abs(),o=as(i.as("s")),s=as(i.as("m")),a=as(i.as("h")),l=as(i.as("d")),u=as(i.as("M")),c=as(i.as("w")),h=as(i.as("y")),d=o<=r.ss&&["s",o]||o<r.s&&["ss",o]||s<=1&&["m"]||s<r.m&&["mm",s]||a<=1&&["h"]||a<r.h&&["hh",a]||l<=1&&["d"]||l<r.d&&["dd",l];return r.w!=null&&(d=d||c<=1&&["w"]||c<r.w&&["ww",c]),d=d||u<=1&&["M"]||u<r.M&&["MM",u]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=n,xK.apply(null,d)}function HK(t){return t===void 0?as:typeof t=="function"?(as=t,!0):!1}function NK(t,e){return Qu[t]===void 0?!1:e===void 0?Qu[t]:(Qu[t]=e,t==="s"&&(Qu.ss=e-1),!0)}function DK(t,e){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Qu,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(r=t),typeof e=="object"&&(n=Object.assign({},Qu,e),e.s!=null&&e.ss==null&&(n.ss=e.s-1)),i=this.localeData(),o=AK(this,!r,n,i),r&&(o=i.pastFuture(+this,o)),i.postformat(o)}var UC=Math.abs;function su(t){return(t>0)-(t<0)||+t}function ww(){if(!this.isValid())return this.localeData().invalidDate();var t=UC(this._milliseconds)/1e3,e=UC(this._days),r=UC(this._months),n,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(n=oi(t/60),i=oi(n/60),t%=60,n%=60,o=oi(r/12),r%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=su(this._months)!==su(a)?"-":"",c=su(this._days)!==su(a)?"-":"",h=su(this._milliseconds)!==su(a)?"-":"",l+"P"+(o?u+o+"Y":"")+(r?u+r+"M":"")+(e?c+e+"D":"")+(i||n||t?"T":"")+(i?h+i+"H":"")+(n?h+n+"M":"")+(t?h+s+"S":"")):"P0D"}var tt=mw.prototype;tt.isValid=PG;tt.abs=aK;tt.add=lK;tt.subtract=uK;tt.as=hK;tt.asMilliseconds=o$;tt.asSeconds=dK;tt.asMinutes=fK;tt.asHours=gK;tt.asDays=mK;tt.asWeeks=pK;tt.asMonths=wK;tt.asQuarters=vK;tt.asYears=yK;tt.valueOf=CK;tt._bubble=cK;tt.clone=bK;tt.get=SK;tt.milliseconds=RK;tt.seconds=EK;tt.minutes=TK;tt.hours=_K;tt.days=MK;tt.weeks=OK;tt.months=PK;tt.years=IK;tt.humanize=DK;tt.toISOString=ww;tt.toString=ww;tt.toJSON=ww;tt.locale=YL;tt.localeData=qL;tt.toIsoString=gi("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ww);tt.lang=GL;Me("X",0,0,"unix");Me("x",0,0,"valueOf");we("x",hw);we("X",r2);Ct("X",function(t,e,r){r._d=new Date(parseFloat(t)*1e3)});Ct("x",function(t,e,r){r._d=new Date(Ke(t))});//! moment.js
|
|
487
|
+
se.version="2.30.1";kY(Nt);se.fn=le;se.min=EG;se.max=TG;se.now=_G;se.utc=Ao;se.unix=eK;se.months=rK;se.isDate=cf;se.locale=ga;se.invalid=aw;se.duration=zi;se.isMoment=Wi;se.weekdays=iK;se.parseZone=tK;se.localeData=Is;se.isDuration=Pm;se.monthsShort=nK;se.weekdaysMin=sK;se.defineLocale=I0;se.updateLocale=tG;se.locales=rG;se.weekdaysShort=oK;se.normalizeUnits=mi;se.relativeTimeRounding=HK;se.relativeTimeThreshold=NK;se.calendarFormat=ZG;se.prototype=le;se.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function kK(t){const e=t.length;let r=0;for(;r<e;)t[r]=[t[r]],r+=1}function y1(t,e){const r=e.length;let n=0;for(;n<r;)t.push(e[n]),n+=1}function Om(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const r=t.length,n=t[0].length;for(let i=0;i<r;i++)for(let o=0;o<n;o++)e[o]||(e[o]=[]),e[o][i]=t[i][o];return e}function Mn(t,e,r,n){let i=-1,o=t,s=r;Array.isArray(t)||(o=Array.from(t));const a=o.length;for(i+=1;i<a;)s=e(s,o[i],i,o),i+=1;return s}function Ll(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length,o=[];let s=-1;for(;r<i;){const a=n[r];e(a,r,n)&&(s+=1,o[s]=a),r+=1}return o}function qe(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length,o=[];let s=-1;for(;r<i;){const a=n[r];s+=1,o[s]=e(a,r,n),r+=1}return o}function k(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length;for(;r<i&&e(n[r],r,n)!==!1;)r+=1;return t}function LK(t){const e=[];return k(t,r=>{e.indexOf(r)===-1&&e.push(r)}),e}function C1(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const[n,...i]=[...e];let o=n;return k(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function b1(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function lt(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return Mn(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=r[a]?r[a]:"";return o+l+u},"").trim()}function Ft(t){let e;switch(typeof t){case"string":case"number":e=`${t}`;break;case"object":e=t===null?"":t.toString();break;case"undefined":e="";break;default:e=t.toString();break}return e}function pe(t){return typeof t<"u"}function $t(t){return typeof t>"u"}function Qt(t){return t===null||t===""||$t(t)}function $K(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const td="length",hd=t=>parseInt(t,16),S1=t=>parseInt(t,10),op=(t,e,r)=>t.substr(e,r),dd=t=>t.codePointAt(0)-65,zR=t=>`${t}`.replace(/\-/g,""),FK=t=>hd(op(zR(t),hd("12"),dd("F")))/(hd(op(zR(t),dd("B"),~~![][td]))||9),VK=()=>typeof location<"u"&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let R1=!1;const E1={invalid:()=>lt`
|
|
488
|
+
The license key for Handsontable is invalid.\x20
|
|
489
|
+
If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:r}=t;return lt`
|
|
490
|
+
The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
|
|
491
|
+
version ${r}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
|
|
492
|
+
to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>lt`
|
|
493
|
+
The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
|
|
494
|
+
Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
|
|
495
|
+
passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
|
|
496
|
+
us at support@handsontable.com.`,non_commercial:()=>""},T1={invalid:()=>lt`
|
|
497
|
+
The license key for Handsontable is invalid.\x20
|
|
498
|
+
<a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
|
|
499
|
+
install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:r}=t;return lt`
|
|
500
|
+
The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
|
|
501
|
+
version ${r}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
|
|
502
|
+
license key or downgrade to a version released prior to ${e}. If you need any\x20
|
|
503
|
+
help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>lt`
|
|
504
|
+
The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
|
|
505
|
+
Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
|
|
506
|
+
passing the key: 'non-commercial-and-evaluation'.\x20
|
|
507
|
+
<a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
|
|
508
|
+
the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function WK(t,e){const r=!Qt(t),n=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.3.0";let o,s="invalid",a="invalid";t=zR(t||"");const l=BK(t);if(r||n||l)if(l){const u=se("29/04/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=FK(t);o=se((h+1)*864e5,"x").format("MMMM DD, YYYY"),c>h?(s="expired",a="expired"):(s="valid",a="valid")}else n?(s="non_commercial",a="valid"):(s="invalid",a="invalid");else s="missing",a="missing";if(VK()&&(s="valid",a="valid"),!R1&&s!=="valid"&&(E1[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](E1[s]({keyValidityDate:o,hotVersion:i})),R1=!0),a!=="valid"&&e.parentNode&&T1[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=T1[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function BK(t){let e=[][td],r=e;if(t[td]!==dd("Z"))return!1;for(let n="",i="B<H4P+".split(""),o=dd(i.shift());o;o=dd(i.shift()||"A"))--o<""[td]?r=r|(S1(`${S1(hd(n)+(hd(op(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:n=op(t,o,o?i[td]===1?9:8:6);return r===e}function Bi(t){return t[0].toUpperCase()+t.substr(1)}function s$(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function a$(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function l$(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(r,n)=>r.charAt(0)==="\\"?r.substr(1,r.length-1):e[n]===void 0?"":e[n])}function _1(t){return $0(`${t}`,{ALLOWED_TAGS:[]})}function $0(t,e){return DY.sanitize(t,e)}const Ql=t=>["tabindex",t],jK=()=>["role","treegrid"],ms=()=>["role","presentation"],UK=()=>["role","gridcell"],zK=()=>["role","rowheader"],u$=()=>["role","rowgroup"],YK=()=>["role","columnheader"],YR=()=>["role","row"],GK=()=>["role","menu"],qK=()=>["role","menuitem"],KK=()=>["role","menuitemcheckbox"],XK=()=>["role","combobox"],c$=()=>["role","listbox"],ZK=()=>["role","option"],JK=()=>["role","checkbox"],QK=()=>["scope","col"],e3=()=>["scope","row"],t3=()=>["type","text"],Ld=t=>["aria-label",t],eu=()=>["aria-hidden","true"],r3=()=>["aria-disabled","true"],n3=()=>["aria-multiselectable","true"],h$=t=>["aria-haspopup",t],d$=t=>["aria-rowcount",t],vw=t=>["aria-colcount",t],f$=t=>["aria-rowindex",t],F0=t=>["aria-colindex",t],li=t=>["aria-expanded",t],i3=t=>["aria-sort",t],M1=()=>["aria-readonly","true"],P1=()=>["aria-invalid","true"],g$=t=>["aria-checked",t],V0=()=>["aria-selected","true"],o3=()=>["aria-autocomplete","list"],s3=t=>["aria-controls",t],a3=t=>["aria-activedescendant",t],l3=t=>["aria-live",t],u3=t=>["aria-relevant",t],c3=t=>["aria-setsize",t],h3=t=>["aria-posinset",t];function d3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=null,i=t;for(;i!==null;){if(r===e){n=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(r+=1,i=i.parentNode)}return n}function xm(t,e){const r=t.closest(".handsontable");return!!r&&(r.parentNode===e||r===e)}function f3(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function vc(t){return f3(t)&&t.parent}function $l(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:n,DOCUMENT_FRAGMENT_NODE:i}=Node;let o=t;for(;o!=null&&o!==r;){const{nodeType:s,nodeName:a}=o;if(s===n&&(e.includes(a)||e.includes(o)))return o;const{host:l}=o;l&&s===i?o=l:o=o.parentNode}return null}function Vf(t,e,r){const n=[];let i=t;for(;i&&(i=$l(i,e,r),!(!i||r&&!r.contains(i)));)n.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const o=n.length;return o?n[o-1]:null}function g3(t,e){const r={element:void 0,classNames:[]};let n=t;for(;n!==null&&n!==t.ownerDocument.documentElement&&!r.element;){if(typeof e=="string"&&n.classList.contains(e))r.element=n,r.classNames.push(e);else if(e instanceof RegExp){const i=Array.from(n.classList).filter(o=>e.test(o));i.length&&(r.element=n,r.classNames.push(...i))}n=n.parentElement}return r}function Nl(t,e){let r=t.parentNode,n=[];for(typeof e=="string"?t.defaultView?n=Array.prototype.slice.call(t.querySelectorAll(e),0):n=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):n.push(e);r!==null;){if(n.indexOf(r)>-1)return!0;r=r.parentNode}return!1}function m3(t){let e=0,r=t;if(r.previousSibling)for(;r=r.previousSibling;)e+=1;return e}function Ha(t,e,r){const n=r.parentElement.querySelector(`.ht_clone_${t}`);return n?n.contains(e):null}function m$(t){return!t||!t.length?[]:t.filter(e=>!!e)}function p$(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const r=[],n=[];return n.push(...t.filter(i=>{const o=i instanceof RegExp;return o&&e&&r.push(i),!o})),{regexFree:n,regexes:r}}function _e(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function ie(t,e){typeof e=="string"&&(e=e.split(" ")),e=m$(e),e.length>0&&t.classList.add(...e)}function Ee(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:r,regexes:n}=p$(e,!0);r=m$(r),r.length>0&&t.classList.remove(...r),n.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function Pe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,r]]),e.forEach(n=>{Array.isArray(n)&&n[0]!==""&&t.setAttribute(...n)})}function Dc(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);const{regexFree:r,regexes:n}=p$(e,!0);r.forEach(i=>{i!==""&&t.removeAttribute(i)}),n.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function w$(t){if(t.nodeType===3)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const e=t.childNodes;for(let r=e.length-1;r>=0;r--)w$(e[r])}}function Ts(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const p3=/(<(.*)>|&(.*);)/;function kc(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;p3.test(e)?t.innerHTML=r?$0(e):e:Fl(t,e)}function Fl(t,e){const r=t.firstChild;r&&r.nodeType===3&&r.nextSibling===null?r.textContent=e:(Ts(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function yc(t){const e=t.ownerDocument.documentElement,r=t.ownerDocument.defaultView;let n=t;for(;n!==e;){if(n===null)return!1;if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(n.host){if(n.host.impl)return yc(n.host.impl);if(n.host)return yc(n.host);throw new Error("Lost in Web Components world")}else return!1;else if(r.getComputedStyle(n).display==="none")return!1;n=n.parentNode}return!0}function w3(t){const r=t.ownerDocument.defaultView;let n=t;for(;n.parentNode;){if(n.style.height==="0px"||n.style.height==="0")return r.getComputedStyle(n).overflow==="hidden";n=n.parentNode}return!1}function jr(t){const e=t.ownerDocument,r=e.defaultView,n=e.documentElement;let i=t,o,s,a;for(o=i.offsetLeft,s=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)o+=i.offsetLeft,s+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(o+=r.pageXOffset||n.scrollLeft,s+=r.pageYOffset||n.scrollTop),{left:o,top:s}}function v$(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function W0(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function B0(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?v$(e):t.scrollTop}function y$(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?W0(e):t.scrollLeft}function sp(t){let e=t.ownerDocument,r=e?e.defaultView:void 0;e||(e=t.document?t.document:t,r=e.defaultView);const n=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:o,overflowX:s,overflowY:a}=i.style;if([o,s,a].includes("scroll"))return i;if({overflow:o,overflowX:s,overflowY:a}=r.getComputedStyle(i),n.includes(o)||n.includes(s)||n.includes(a)||i.clientHeight<=i.scrollHeight+1&&(n.includes(a)||n.includes(o))||i.clientWidth<=i.scrollWidth+1&&(n.includes(s)||n.includes(o)))return i;i=i.parentNode}return r}function v3(t){return t.scrollHeight-t.clientHeight}function y3(t){return t.scrollWidth-t.clientWidth}function $d(t){const e=t.ownerDocument,r=e.defaultView;let n=t.parentNode;for(;n&&n.style&&e.body!==n;){if(n.style.overflow!=="visible"&&n.style.overflow!=="")return n;const i=r.getComputedStyle(n),o=["scroll","hidden","auto"],s=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(o.includes(s)||o.includes(a)||o.includes(l))return n;n=n.parentNode}return r}function ap(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===r)return e==="width"?`${r.innerWidth}px`:e==="height"?`${r.innerHeight}px`:void 0}else return;const n=t.style[e];if(n!==""&&n!==void 0)return n;const i=r.getComputedStyle(t);if(i[e]!==""&&i[e]!==void 0)return i[e]}function nr(t){return t.offsetWidth}function fr(t){return t.offsetHeight}function fd(t){return t.clientHeight||t.innerHeight}function C$(t){return t.clientWidth||t.innerWidth}function b$(t){return t.selectionStart?t.selectionStart:0}function C3(t){return t.selectionEnd?t.selectionEnd:0}function I1(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;t.getSelection&&(t.getSelection().empty?t.getSelection().empty():t.getSelection().removeAllRanges&&t.getSelection().removeAllRanges())}function yw(t,e,r){if(r===void 0&&(r=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,r)}catch{const i=t.parentNode,o=i.style.display;i.style.display="block",t.setSelectionRange(e,r),i.style.display=o}}}let zC;function b3(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=t.createElement("div");e.style.height="200px",e.style.width="100%";const r=t.createElement("div");r.style.boxSizing="content-box",r.style.height="150px",r.style.left="0px",r.style.overflow="hidden",r.style.position="absolute",r.style.top="0px",r.style.width="200px",r.style.visibility="hidden",r.appendChild(e),(t.body||t.documentElement).appendChild(r);const n=e.offsetWidth;r.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=r.clientWidth),(t.body||t.documentElement).removeChild(r),n-i}function Or(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return zC===void 0&&(zC=b3(t)),zC}function S$(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function R$(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function j0(t,e,r){t.style.transform=`translate3d(${e},${r},0)`}function Cw(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Am(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function E$(t){return Am(t)&&t.hasAttribute("data-hot-input")===!1}function T$(t){return!t.parentNode}function S3(t,e){new IntersectionObserver((n,i)=>{n.forEach(o=>{o.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function _$(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const n=t.ownerDocument,i=n.createRange(),o=n.defaultView.getSelection();Pe(t,"contenteditable",!0),r&&Pe(t,...eu()),e&&ie(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function M$(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),r.removeAllRanges(),e&&Ee(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function R3(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;_$(t,r),e(),M$(t,r)}function Rs(t){var e;const r=t==null||(e=t.ownerDocument)===null||e===void 0?void 0:e.defaultView.Element;return!!(r&&r!==null&&t instanceof r)}function mt(t){return typeof t=="function"}function bw(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,r=null,n;function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return r&&clearTimeout(r),r=setTimeout(()=>{n=t.apply(this,s)},e),n}return i}function P$(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return t.apply(this,r.concat(s))}}function E3(t){const e=t.length;function r(n){return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=n.concat(s);let u;return l.length>=e?u=t.apply(this,l):u=r(l),u}}return r([])}function GR(t,e,r,n,i,o,s,a){return pe(a)?t.call(e,r,n,i,o,s,a):pe(s)?t.call(e,r,n,i,o,s):pe(o)?t.call(e,r,n,i,o):pe(i)?t.call(e,r,n,i):pe(n)?t.call(e,r,n):pe(r)?t.call(e,r):t.call(e)}var O1={},YC,x1;function T3(){if(x1)return YC;x1=1;var t=or(),e=Xk(),r=wr(),n=Gl(),i=sw(),o=t([].push);return YC=function(s){if(r(s))return s;if(e(s)){for(var a=s.length,l=[],u=0;u<a;u++){var c=s[u];typeof c=="string"?o(l,c):(typeof c=="number"||n(c)==="Number"||n(c)==="String")&&o(l,i(c))}var h=l.length,d=!0;return function(f,g){if(d)return d=!1,g;if(e(this))return g;for(var w=0;w<h;w++)if(l[w]===f)return g}}},YC}var A1;function _3(){if(A1)return O1;A1=1;var t=St(),e=Mc(),r=af(),n=pr(),i=or(),o=mr(),s=wr(),a=r0(),l=m0(),u=T3(),c=t0(),h=String,d=e("JSON","stringify"),f=i(/./.exec),g=i("".charAt),w=i("".charCodeAt),v=i("".replace),b=i(1.1.toString),p=/[\uD800-\uDFFF]/g,_=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,T=!c||o(function(){var j=e("Symbol")("stringify detection");return d([j])!=="[null]"||d({a:j})!=="{}"||d(Object(j))!=="{}"}),M=o(function(){return d("\uDF06\uD834")!=='"\\udf06\\ud834"'||d("\uDEAD")!=='"\\udead"'}),P=function(j,A){var q=l(arguments),Q=u(A);if(!(!s(Q)&&(j===void 0||a(j))))return q[1]=function(ue,J){if(s(Q)&&(J=n(Q,this,h(ue),J)),!a(J))return J},r(d,null,q)},G=function(j,A,q){var Q=g(q,A-1),ue=g(q,A+1);return f(_,j)&&!f(O,ue)||f(O,j)&&!f(_,Q)?"\\u"+b(w(j,0),16):j};return d&&t({target:"JSON",stat:!0,arity:3,forced:T||M},{stringify:function(A,q,Q){var ue=l(arguments),J=r(T?P:d,null,ue);return M&&typeof J=="string"?v(J,p,G):J}}),O1}_3();function Fd(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},We(t,(r,n)=>{n!=="__children"&&(r&&typeof r=="object"&&!Array.isArray(r)?e[n]=Fd(r):Array.isArray(r)?r.length&&typeof r[0]=="object"&&!Array.isArray(r[0])?e[n]=[Fd(r[0])]:e[n]=[]:e[n]=null)})),e}function M3(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function gr(t,e,r){const n=Array.isArray(r);return We(e,(i,o)=>{(n===!1||r.includes(o))&&(t[o]=i)}),t}function Sw(t,e){We(e,(r,n)=>{e[n]&&typeof e[n]=="object"?(t[n]||(Array.isArray(e[n])?t[n]=[]:Object.prototype.toString.call(e[n])==="[object Date]"?t[n]=e[n]:t[n]={}),Sw(t[n],e[n])):t[n]=e[n]})}function on(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function Po(t){const e={};return We(t,(r,n)=>{e[n]=r}),e}function yt(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return k(r,i=>{t.MIXINS.push(i.MIXIN_NAME),We(i,(o,s)=>{if(t.prototype[s]!==void 0)throw new Error(`Mixin conflict. Property '${s}' already exist and cannot be overwritten.`);if(typeof o=="function")t.prototype[s]=o;else{const a=function(c,h){const d=`_${c}`,f=g=>{let w=g;return(Array.isArray(w)||Ve(w))&&(w=on(w)),w};return function(){return this[d]===void 0&&(this[d]=f(h)),this[d]}},l=function(c){const h=`_${c}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,s,{get:a(s,o),set:l(s),configurable:!0})}})}),t}function U0(t,e){return JSON.stringify(t)===JSON.stringify(e)}function Ve(t){return Object.prototype.toString.call(t)==="[object Object]"}function xs(t,e,r,n){n.value=r,n.writable=n.writable!==!1,n.enumerable=n.enumerable!==!1,n.configurable=n.configurable!==!1,Object.defineProperty(t,e,n)}function We(t,e){for(const r in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,r))&&e(t[r],r,t)===!1)break;return t}function P3(t,e){const r=e.split(".");let n=t;return We(r,i=>{if(n=n[i],n===void 0)return n=void 0,!1}),n}function GC(t,e,r){if(typeof e!="string")return;const n=e.split(".");let i=t;n.forEach((o,s)=>{o==="__proto__"||o==="constructor"||o==="prototype"||(s!==n.length-1?(dr(i,o)||(i[o]={}),i=i[o]):i[o]=r)})}function z0(t){if(!Ve(t))return 0;const e=function(r){let n=0;return Ve(r)?We(r,(i,o)=>{o!=="__children"&&(n+=e(i))}):n+=1,n};return e(t)}function Bn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const r=`_${e}`,n={_touched:!1,[r]:t,isTouched(){return this._touched}};return Object.defineProperty(n,e,{get(){return this[r]},set(i){this._touched=!0,this[r]=i},enumerable:!0,configurable:!0}),n}function dr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function lp(t){return window.requestAnimationFrame(t)}function up(t){window.cancelAnimationFrame(t)}function I$(){return"ontouchstart"in window}function I3(){return typeof window<"u"}let au;function O3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return au||(typeof Intl=="object"?au=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?au=(r,n)=>`${r}`.localeCompare(n):au=(r,n)=>r===n?0:r>n?-1:1,au)}const ei=t=>{const e={value:!1};return e.test=(r,n)=>{e.value=t(r,n)},e},Ea={chrome:ei((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:ei(t=>/CriOS/.test(t)),edge:ei(t=>/Edge/.test(t)),edgeWebKit:ei(t=>/EdgiOS/.test(t)),firefox:ei(t=>/Firefox/.test(t)),firefoxWebKit:ei(t=>/FxiOS/.test(t)),mobile:ei(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:ei((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},gf={mac:ei(t=>/^Mac/.test(t)),win:ei(t=>/^Win/.test(t)),linux:ei(t=>/^Linux/.test(t)),ios:ei(t=>/iPhone|iPad|iPod/i.test(t))};function x3(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};We(Ea,r=>{let{test:n}=r;return void n(t,e)})}function A3(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};We(gf,e=>{let{test:r}=e;return void r(t)})}I3()&&(x3(),A3());function O$(){return Ea.chrome.value}function H3(){return Ea.chromeWebKit.value}function qC(){return Ea.firefox.value}function N3(){return Ea.firefoxWebKit.value}function cp(){return Ea.safari.value}function D3(){return Ea.edge.value}function ps(){return Ea.mobile.value}function x$(){return gf.ios.value}function A$(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&gf.mac.value}function H1(){return gf.win.value}function N1(){return gf.mac.value}const Re={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:qC()?182:174,AUDIO_MUTE:qC()?181:173,AUDIO_UP:qC()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},k3=[Re.ALT,Re.ARROW_DOWN,Re.ARROW_LEFT,Re.ARROW_RIGHT,Re.ARROW_UP,Re.AUDIO_DOWN,Re.AUDIO_MUTE,Re.AUDIO_UP,Re.BACKSPACE,Re.CAPS_LOCK,Re.DELETE,Re.END,Re.ENTER,Re.ESCAPE,Re.F1,Re.F2,Re.F3,Re.F4,Re.F5,Re.F6,Re.F7,Re.F8,Re.F9,Re.F10,Re.F11,Re.F12,Re.F13,Re.F14,Re.F15,Re.F16,Re.F17,Re.F18,Re.F19,Re.HOME,Re.INSERT,Re.MEDIA_NEXT,Re.MEDIA_PLAY_PAUSE,Re.MEDIA_PREV,Re.MEDIA_STOP,Re.NULL,Re.NUM_LOCK,Re.PAGE_DOWN,Re.PAGE_UP,Re.PAUSE,Re.SCROLL_LOCK,Re.SHIFT,Re.TAB];function L3(t){return t===32||t>=48&&t<=57||t>=96&&t<=111||t>=186&&t<=192||t>=219&&t<=222||t>=226||t>=65&&t<=90}function H$(t){return k3.includes(t)}function $3(t){return[Re.CONTROL,Re.COMMAND_LEFT,Re.COMMAND_RIGHT,Re.COMMAND_FIREFOX].includes(t)}function mf(t,e){const r=e.split("|");let n=!1;return k(r,i=>{if(t===Re[i])return n=!0,!1}),n}function Yi(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function Sl(t){return t.isImmediatePropagationEnabled===!1}function Vl(t){return t.button===2}function Y0(t){return t.button===0}function F3(t){return t instanceof TouchEvent}function V3(t,e){const r={x:t.offsetX,y:t.offsetY};let n=t.target;if(!Rs(e)||n!==e&&n.contains(e))return r;for(;n!==e;)r.x+=n.offsetLeft,r.y+=n.offsetTop,n=n.offsetParent;return r}function it(){pe(console)&&console.warn(...arguments)}function G0(){pe(console)&&console.error(...arguments)}const Rl=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],KC=new Map([["modifyRow","8.0.0"],["modifyCol","8.0.0"],["unmodifyRow","8.0.0"],["unmodifyCol","8.0.0"],["skipLengthCache","8.0.0"],["hiddenColumn","8.0.0"],["hiddenRow","8.0.0"]]),XC=new Map([[]]);var D1={},ZC,k1;function W3(){if(k1)return ZC;k1=1;var t=Oc();return ZC=function(e,r,n){for(var i=0,o=arguments.length>2?n:t(r),s=new e(o);o>i;)s[i]=r[i++];return s},ZC}var JC,L1;function B3(){if(L1)return JC;L1=1;var t=ir();return JC=function(e,r){var n=t[e],i=n&&n.prototype;return i&&i[r]},JC}var QC,$1;function Rw(){if($1)return QC;$1=1;var t=Ui(),e=d0(),r=Sa().f,n=t("unscopables"),i=Array.prototype;return i[n]===void 0&&r(i,n,{configurable:!0,value:e(null)}),QC=function(o){i[n][o]=!0},QC}var F1;function j3(){if(F1)return D1;F1=1;var t=St(),e=or(),r=Tn(),n=rf(),i=W3(),o=B3(),s=Rw(),a=Array,l=e(o("Array","sort"));return t({target:"Array",proto:!0},{toSorted:function(c){c!==void 0&&r(c);var h=n(this),d=i(a,h);return l(d,c)}}),s("toSorted"),D1}j3();var V1={},W1={},B1;function U3(){if(B1)return W1;B1=1;var t=St(),e=pr(),r=xc(),n=Tn(),i=vr(),o=xo(),s=_n(),a=Ra(),l=a("find",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{find:function(c){i(this);try{n(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return r(h,function(f,g){if(c(f,d++))return g(f)},{IS_RECORD:!0,INTERRUPTED:!0}).result}}),W1}var j1;function z3(){return j1||(j1=1,U3()),V1}z3();function Y3(t,e){N$(t,e),e.add(t)}function eb(t,e,r){N$(t,e),e.set(t,r)}function N$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function U1(t,e,r){return t.set(hp(t,e),r),r}function Ar(t,e){return t.get(hp(t,e))}function hp(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const G3=100;var Hn=new WeakMap,zu=new WeakMap,tb=new WeakMap,rb=new WeakSet;class z1{constructor(){Y3(this,rb),eb(this,Hn,new Map),eb(this,zu,new Map),eb(this,tb,new Set),Rl.forEach(e=>hp(rb,this,Y1).call(this,e))}getHooks(e){var r;return(r=Ar(Hn,this).get(e))!==null&&r!==void 0?r:[]}add(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Ar(Hn,this).has(e)||(hp(rb,this,Y1).call(this,e),Rl.push(e));const i=Ar(Hn,this).get(e);if(i.find(u=>u.callback===r))return;const o=Number.isInteger(n.orderIndex)?n.orderIndex:0,s=!!n.runOnce,a=!!n.initialHook;let l=!1;if(a){const u=i.find(c=>c.initialHook);u&&(u.callback=r,l=!0)}if(!l){i.push({callback:r,orderIndex:o,runOnce:s,initialHook:a,skip:!1});let u=Ar(tb,this).has(e);!u&&o!==0&&(u=!0,Ar(tb,this).add(e)),u&&i.length>1&&Ar(Hn,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return Ar(Hn,this).has(e)&&Ar(Hn,this).get(e).length>0}remove(e,r){if(!Ar(Hn,this).has(e))return!1;const n=Ar(Hn,this).get(e),i=n.find(o=>o.callback===r);if(i){let o=Ar(zu,this).get(e);return i.skip=!0,o+=1,o>G3&&(Ar(Hn,this).set(e,n.filter(s=>!s.skip)),o=0),Ar(zu,this).set(e,o),!0}return!1}destroy(){Ar(Hn,this).clear(),Ar(zu,this).clear(),U1(Hn,this,null),U1(zu,this,null)}}function Y1(t){Ar(Hn,this).set(t,[]),Ar(zu,this).set(t,0)}function q3(t,e,r){return(e=K3(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K3(t){var e=X3(t,"string");return typeof e=="symbol"?e:e+""}function X3(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Z3=lt`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
|
|
509
|
+
Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
|
|
510
|
+
learn about the migration path.`;class fe{constructor(){q3(this,"globalBucket",new z1)}static getSingleton(){return Q3()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new z1),e.pluginHookBucket):this.globalBucket}add(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(r)?k(r,o=>this.add(e,o,n)):(KC.has(e)&&it(l$(Z3,{hookName:e,removedInVersion:KC.get(e)})),XC.has(e)&&it(XC.get(e)),this.getBucket(n).add(e,r,{orderIndex:i,runOnce:!1})),this}once(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(r)?k(r,o=>this.once(e,o,n)):this.getBucket(n).add(e,r,{orderIndex:i,runOnce:!0}),this}addAsFixed(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return Array.isArray(r)?k(r,i=>this.addAsFixed(e,i,n)):this.getBucket(n).add(e,r,{initialHook:!0}),this}remove(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this.getBucket(n).remove(e,r)}has(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.getBucket(r).has(e)}run(e,r,n,i,o,s,a,l){{const u=this.getBucket().getHooks(r),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=GR(u[h].callback,e,n,i,o,s,a,l);d!==void 0&&(n=d),u[h]&&u[h].runOnce&&this.remove(r,u[h].callback),h+=1}}{const u=this.getBucket(e).getHooks(r),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=GR(u[h].callback,e,n,i,o,s,a,l);d!==void 0&&(n=d),u[h]&&u[h].runOnce&&this.remove(r,u[h].callback,e),h+=1}}return n}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||Rl.push(e)}deregister(e){this.isRegistered(e)&&Rl.splice(Rl.indexOf(e),1)}isDeprecated(e){return XC.has(e)||KC.has(e)}isRegistered(e){return Rl.indexOf(e)>=0}getRegistered(){return Rl}}const J3=new fe;function Q3(){return J3}const nb=new Map;function Gi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";nb.has(t)||nb.set(t,new Map);const e=nb.get(t);function r(a,l){e.set(a,l)}function n(a){return e.get(a)}function i(a){return e.has(a)}function o(){return[...e.keys()]}function s(){return[...e.values()]}return{register:r,getItem:n,hasItem:i,getNames:o,getValues:s}}const qR=new WeakMap,{register:e4,getItem:D$,hasItem:k$,getNames:pme,getValues:wme}=Gi("editors");function t4(t){const e={},r=t;this.getConstructor=function(){return t},this.getInstance=function(n){return n.guid in e||(e[n.guid]=new r(n)),e[n.guid]},fe.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function L$(t,e){let r;if(typeof t=="function")qR.get(t)||Dn(null,t),r=qR.get(t);else if(typeof t=="string")r=D$(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!r)throw Error(`No editor registered under name "${t}"`);return r.getInstance(e)}function KR(t){if(typeof t=="function")return t;if(!k$(t))throw Error(`No registered editor found under "${t}" name`);return D$(t).getConstructor()}function Dn(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const r=new t4(e);typeof t=="string"&&e4(t,r),qR.set(e,r)}function r4(t,e,r){return(e=n4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n4(t){var e=i4(t,"string");return typeof e=="symbol"?e:e+""}function i4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ji{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;r4(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function o(s){n.call(this,o4(s))}return this.context.eventListeners.push({element:e,event:r,callback:n,callbackProxy:o,options:i,eventManager:this}),e.addEventListener(r,o,i),()=>{this.removeEventListener(e,r,n)}}removeEventListener(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=this.context.eventListeners.length,s;for(;o;)if(o-=1,s=this.context.eventListeners[o],s.event===r&&s.element===e){if(n&&n!==s.callback||i&&s.eventManager!==this)continue;this.context.eventListeners.splice(o,1),s.element.removeEventListener(s.event,s.callbackProxy,s.options)}}clearEvents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.context)return;let r=this.context.eventListeners.length;for(;r;){r-=1;const n=this.context.eventListeners[r];e&&n.eventManager!==this||(this.context.eventListeners.splice(r,1),n.element.removeEventListener(n.event,n.callbackProxy,n.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,r){let n=e.document,i=e;n||(n=e.ownerDocument?e.ownerDocument:e,i=n.defaultView);const o={bubbles:!0,cancelable:r!=="mousemove",view:i,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0};let s;n.createEvent?(s=n.createEvent("MouseEvents"),s.initMouseEvent(r,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,n.body.parentNode)):s=n.createEventObject(),e.dispatchEvent?e.dispatchEvent(s):e.fireEvent(`on${r}`,s)}}function o4(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),Yi(this)},t}function s4(t,e){a4(t,e),e.add(t)}function a4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Na(t,e,r){return(e=l4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l4(t){var e=u4(t,"string");return typeof e=="symbol"?e:e+""}function u4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ib(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Wf=new WeakSet;class XR{constructor(e,r,n){s4(this,Wf),Na(this,"hot",void 0),Na(this,"tableMeta",void 0),Na(this,"selection",void 0),Na(this,"eventManager",void 0),Na(this,"destroyed",!1),Na(this,"activeEditor",void 0),Na(this,"cellProperties",void 0),this.hot=e,this.tableMeta=r,this.selection=n,this.eventManager=new ji(e),this.hot.addHook("afterDocumentKeyDown",i=>ib(Wf,this,G1).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>ib(Wf,this,G1).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>ib(Wf,this,c4).call(this,i,o,s))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,u=>{u&&this.prepareEditor()});return}const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!r||r.isHeader())return;const{row:n,col:i}=r,o=this.hot.runHooks("modifyGetCellCoords",n,i,!1,"meta");let s=n,a=i;if(Array.isArray(o)&&([s,a]=o),this.cellProperties=this.hot.getCellMeta(s,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(n,i,!0);if(l){const u=this.hot.getCellEditor(this.cellProperties),c=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),a);this.activeEditor=L$(u,this.hot),this.activeEditor.prepare(n,i,c,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeLast();let o=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,r,n);if(r instanceof MouseEvent&&typeof o!="boolean"&&(o=this.hot.selection.getLayerLevel()===0&&i.isSingle()),o===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(n&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,r))}closeEditor(e,r,n){this.activeEditor?this.activeEditor.finishEditing(e,r,n):n&&n(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const r=this.hot.getCellEditor(this.cellProperties),{row:n,col:i}=e.highlight,{rowIndexMapper:o,columnIndexMapper:s}=this.hot,a=o.isHidden(this.hot.toPhysicalRow(n))||s.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!r||a)}moveSelectionAfterEnter(e){const r={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(r.row=-r.row,r.col=-r.col),this.hot.selection.isMultiple()?this.selection.transformFocus(r.row,r.col):this.selection.transformStart(r.row,r.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function G1(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||Sl(t))return;const{keyCode:r}=t,n=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!H$(r)&&!$3(r)&&!n&&!this.isEditorOpened()&&this.openEditor("",t)}function c4(t,e){e.isCell()&&this.openEditor(null,t,!0)}const q1=new WeakMap;XR.getInstance=function(t,e,r){let n=q1.get(t);return n||(n=new XR(t,e,r),q1.set(t,n)),n};function h4(t,e){$$(t,e),e.add(t)}function ih(t,e,r){$$(t,e),e.set(t,r)}function $$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Et(t,e){return t.get(hs(t,e))}function oh(t,e,r){return t.set(hs(t,e),r),r}function hs(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const lc=Object.freeze({CELL:"cell",MIXED:"mixed"});var cr=new WeakMap,Bf=new WeakMap,jf=new WeakMap,Uf=new WeakMap,zf=new WeakMap,Js=new WeakSet;class d4{constructor(e){var r=this;h4(this,Js),ih(this,cr,void 0),ih(this,Bf,void 0),ih(this,jf,1),ih(this,Uf,null),ih(this,zf,new Map);const n=e.getSettings();oh(cr,this,e),oh(Bf,this,n.imeFastEdit?lc.MIXED:lc.CELL),Et(cr,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return hs(Js,r,g4).call(r,...o)}),Et(cr,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return hs(Js,r,K1).call(r,...o)}),Et(cr,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return hs(Js,r,K1).call(r,...o)}),Et(cr,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return hs(Js,r,f4).call(r,...o)})}getFocusMode(){return Et(Bf,this)}setFocusMode(e){Object.values(lc).includes(e)?oh(Bf,this,e):it(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return Et(jf,this)}setRefocusDelay(e){oh(jf,this,e)}setRefocusElementGetter(e){oh(Uf,this,e)}getRefocusElement(){var e;return typeof Et(Uf,this)=="function"?Et(Uf,this).call(this):(e=Et(cr,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const r=n=>{var i,o;const s=(i=Et(cr,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=Et(cr,this).runHooks("modifyFocusedElement",s.row,s.col,n);Rs(a)||(a=n),a&&!((o=Et(cr,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?r(e):hs(Js,this,q0).call(this,n=>r(n))}refocusToEditorTextarea(){var e;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Et(jf,this);if(Et(cr,this).getSettings().imeFastEdit&&!((e=Et(cr,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var n,i;(n=Et(cr,this).getActiveEditor())===null||n===void 0||(i=n.refreshValue)===null||i===void 0||i.call(n),Et(zf,this).has(r)||Et(zf,this).set(r,bw(()=>{if(!Et(cr,this).isDestroyed){var o;(o=this.getRefocusElement())===null||o===void 0||o.select()}},r)),Et(zf,this).get(r)()}}}function q0(t){var e;const r=(e=Et(cr,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!r||!Et(cr,this).selection.isCellVisible(r)){t(null);return}const n=Et(cr,this).getCell(r.row,r.col,!0);n===null?Et(cr,this).addHookOnce("afterScroll",()=>{t(Et(cr,this).getCell(r.row,r.col,!0))}):t(n)}function K1(){hs(Js,this,q0).call(this,t=>{const{activeElement:e}=Et(cr,this).rootDocument;e&&E$(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function f4(){hs(Js,this,q0).call(this,t=>{this.getFocusMode()===lc.MIXED&&(t==null?void 0:t.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function g4(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?lc.MIXED:lc.CELL)}var X1={},ob,Z1;function m4(){if(Z1)return ob;Z1=1;var t=di(),e=Gl(),r=Ui(),n=r("match");return ob=function(i){var o;return t(i)&&((o=i[n])!==void 0?!!o:e(i)==="RegExp")},ob}var sb,J1;function p4(){if(J1)return sb;J1=1;var t=ir(),e=mr(),r=t.RegExp,n=!e(function(){var i=!0;try{r(".","d")}catch{i=!1}var o={},s="",a=i?"dgimsy":"gimsy",l=function(d,f){Object.defineProperty(o,d,{get:function(){return s+=f,!0}})},u={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};i&&(u.hasIndices="d");for(var c in u)l(c,u[c]);var h=Object.getOwnPropertyDescriptor(r.prototype,"flags").get.call(o);return h!==a||s!==a});return sb={correct:n},sb}var ab,Q1;function w4(){if(Q1)return ab;Q1=1;var t=vr();return ab=function(){var e=t(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},ab}var lb,eA;function v4(){if(eA)return lb;eA=1;var t=pr(),e=fi(),r=nf(),n=p4(),i=w4(),o=RegExp.prototype;return lb=n.correct?function(s){return s.flags}:function(s){return!n.correct&&r(o,s)&&!e(s,"flags")?t(i,s):s.flags},lb}var ub,tA;function y4(){if(tA)return ub;tA=1;var t=or(),e=Pc(),r=Math.floor,n=t("".charAt),i=t("".replace),o=t("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return ub=function(l,u,c,h,d,f){var g=c+l.length,w=h.length,v=a;return d!==void 0&&(d=e(d),v=s),i(f,v,function(b,p){var _;switch(n(p,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,g);case"<":_=d[o(p,1,-1)];break;default:var O=+p;if(O===0)return b;if(O>w){var T=r(O/10);return T===0?b:T<=w?h[T-1]===void 0?n(p,1):h[T-1]+n(p,1):b}_=h[O-1]}return _===void 0?"":_})},ub}var rA;function C4(){if(rA)return X1;rA=1;var t=St(),e=pr(),r=or(),n=tf(),i=wr(),o=di(),s=m4(),a=sw(),l=of(),u=v4(),c=y4(),h=Ui(),d=ba(),f=h("replace"),g=TypeError,w=r("".indexOf),v=r("".replace),b=r("".slice),p=Math.max;return t({target:"String",proto:!0},{replaceAll:function(O,T){var M=n(this),P,G,j,A,q,Q,ue,J,Z,ne,ee=0,te="";if(o(O)){if(P=s(O),P&&(G=a(n(u(O))),!~w(G,"g")))throw new g("`.replaceAll` does not allow non-global regexes");if(j=l(O,f),j)return e(j,O,M,T);if(d&&P)return v(a(M),O,T)}for(A=a(M),q=a(O),Q=i(T),Q||(T=a(T)),ue=q.length,J=p(1,ue),Z=w(A,q);Z!==-1;)ne=Q?a(T(q,Z,A)):c(q,A,Z,[],void 0,T),te+=b(A,ee,Z)+ne,ee=Z+ue,Z=Z+J>A.length?-1:w(A,q,Z+J);return ee<A.length&&(te+=b(A,ee)),te}}),X1}C4();var nA={},iA={},oA;function b4(){if(oA)return iA;oA=1;var t=St(),e=xc(),r=Tn(),n=vr(),i=xo(),o=_n(),s=Ra(),a=af(),l=mr(),u=TypeError,c=l(function(){[].keys().reduce(function(){},void 0)}),h=!c&&s("reduce",u);return t({target:"Iterator",proto:!0,real:!0,forced:c||h},{reduce:function(f){n(this);try{r(f)}catch(p){o(this,"throw",p)}var g=arguments.length<2,w=g?void 0:arguments[1];if(h)return a(h,this,g?[f]:[f,w]);var v=i(this),b=0;if(e(v,function(p){g?(g=!1,w=p):w=f(w,p,b),b++},{IS_RECORD:!0}),g)throw new u("Reduce of empty iterator with no initial value");return w}}),iA}var sA;function S4(){return sA||(sA=1,b4()),nA}S4();const F$={" ":" ","&":"&","<":"<",">":">"},R4=new RegExp(Object.keys(F$).map(t=>`(${t})`).join("|"),"gi");function E4(t){return(t&&t.nodeName||"")==="TABLE"}function aA(t){const e=t.hasColHeaders(),r=t.hasRowHeaders(),n=[e?-1:0,r?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...n),o=i.length,s=o>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],u=["<tbody>","</tbody>"],c=r?1:0,h=e?1:0;for(let d=0;d<o;d+=1){const f=e&&d===0,g=[];for(let v=0;v<s;v+=1){const b=!f&&r&&v===0;let p="";if(f)p=`<th>${t.getColHeader(v-c)}</th>`;else if(b)p=`<th>${t.getRowHeader(d-h)}</th>`;else{const _=i[d][v],{hidden:O,rowspan:T,colspan:M}=t.getCellMeta(d-h,v-c);if(!O){const P=[];if(T&&P.push(`rowspan="${T}"`),M&&P.push(`colspan="${M}"`),Qt(_))p=`<td ${P.join(" ")}></td>`;else{const G=_.toString().replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
511
|
+
`).replace(/\x20/gi," ").replace(/\t/gi,"	");p=`<td ${P.join(" ")}>${G}</td>`}}}g.push(p)}const w=["<tr>",...g,"</tr>"].join("");f?l.splice(1,0,w):u.splice(-1,0,w)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function lA(t){const e=t.length,r=["<table>"];for(let n=0;n<e;n+=1){const i=t[n],o=i.length,s=[];n===0&&r.push("<tbody>");for(let a=0;a<o;a+=1){const l=i[a],u=Qt(l)?"":l.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
512
|
+
`).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${" ".repeat(c.length-1)} </span>`).replace(/\t/gi,"	");s.push(`<td>${u}</td>`)}r.push("<tr>",...s,"</tr>"),n+1===e&&r.push("</tbody>")}return r.push("</table>"),r.join("")}function T4(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const r={},n=e.createDocumentFragment(),i=e.createElement("div");n.appendChild(i);let o=t;if(typeof o=="string"){const _=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,O=>{const T=O.match(/<td\b[^>]*?>/g)[0],M=/<p.*?>/g,P=O.substring(T.length,O.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(M,`
|
|
513
|
+
`).replace(`
|
|
514
|
+
`,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/mg,"");return`${T}${P}</td>`});i.insertAdjacentHTML("afterbegin",`${_}`),o=i.querySelector("table")}if(!o||!E4(o))return;const s=i.querySelector('meta[name$="enerator"]'),a=o.querySelector("tbody th")!==null,l=o.querySelector("tr"),u=l?Array.from(l.cells).reduce((_,O)=>_+O.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,f=0,g=0;if(o.tHead){const _=Array.from(o.tHead.rows).filter(O=>{const T=O.querySelector("td")!==null;return T&&h.push(O),!T});f=_.length,d=f>0,f>1?r.nestedHeaders=Array.from(_).reduce((O,T)=>{const M=Array.from(T.cells).reduce((P,G,j)=>{if(a&&j===0)return P;const{colSpan:A,innerHTML:q}=G,Q=A>1?{label:q,colspan:A}:q;return P.push(Q),P},[]);return O.push(M),O},[]):d&&(r.colHeaders=Array.from(_[0].children).reduce((O,T,M)=>(a&&M===0||O.push(T.innerHTML),O),[]))}h.length&&(r.fixedRowsTop=h.length),c.length&&(r.fixedRowsBottom=c.length);const w=[...h,...Array.from(o.tBodies).reduce((_,O)=>(_.push(...Array.from(O.rows)),_),[]),...c];g=w.length;const v=new Array(g);for(let _=0;_<g;_++)v[_]=new Array(u);const b=[],p=[];for(let _=0;_<g;_++){const O=w[_],T=Array.from(O.cells),M=T.length;for(let P=0;P<M;P++){const G=T[P],{nodeName:j,innerHTML:A,rowSpan:q,colSpan:Q}=G,ue=v[_].findIndex(J=>J===void 0);if(j==="TD"){if(q>1||Q>1){for(let ee=_;ee<_+q;ee++)if(ee<g)for(let te=ue;te<ue+Q;te++)v[ee][te]=null;const Z=G.getAttribute("style");Z&&Z.includes("mso-ignore:colspan")||b.push({col:ue,row:_,rowspan:q,colspan:Q})}let J="";s&&/excel/gi.test(s.content)?J=A.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
|
|
515
|
+
`):J=A.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
|
|
516
|
+
`),v[_][ue]=J.replace(R4,Z=>F$[Z])}else p.push(A)}}return b.length&&(r.mergeCells=b),p.length&&(r.rowHeaders=p),v.length&&(r.data=v),r}function tn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=typeof t;if(r==="number")return!isNaN(t)&&isFinite(t);if(r==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const n=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${n})?\\d+((${n})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(r==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function _4(t){return tn(t,[","])}function Ce(t,e,r){let n=-1;for(typeof e=="function"?(r=e,e=t):n=t-1;++n<=e&&r(n)!==!1;);}function uA(t,e,r){let n=t+1;for(typeof e=="function"&&(r=e,e=0);--n>=e&&r(n)!==!1;);}function V$(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function Xe(t,e,r){return Math.min(t,e)===t?e:Math.max(t,r)===t?r:t}const ZR="asc",M4="desc",cA=new Map([[ZR,[-1,1]],[M4,[1,-1]]]),P4=t=>`The priority '${t}' is already declared in a map.`,I4=t=>`The priority '${t}' is not a number.`;function O4(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=new Map;t=mt(t)?t:P4,e=mt(e)?e:I4;function n(o,s){if(!tn(o))throw new Error(e(o));if(r.has(o))throw new Error(t(o));r.set(o,s)}function i(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZR;const[s,a]=cA.get(o)||cA.get(ZR);return[...r].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:n,getItems:i}}const x4=t=>`The id '${t}' is already declared in a map.`;function Ew(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=mt(t)?t:x4;function r(u,c){if(l(u))throw new Error(t(u));e.set(u,c)}function n(u){return e.delete(u)}function i(){e.clear()}function o(u){const[c]=a().find(h=>{let[d,f]=h;return u===f?d:!1})||[null];return c}function s(u){return e.get(u)}function a(){return[...e]}function l(u){return e.has(u)}return{addItem:r,clear:i,getId:o,getItem:s,getItems:a,hasItem:l,removeItem:n}}const A4=t=>`'${t}' value is already declared in a unique set.`;function H4(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=mt(t)?t:A4;function r(o){if(e.has(o))throw new Error(t(o));e.add(o)}function n(){return[...e]}function i(){e.clear()}return{addItem:r,clear:i,getItems:n}}const K0=t=>`There is already registered "${t}" plugin.`,N4=t=>`There is already registered plugin on priority "${t}".`,D4=t=>`The priority "${t}" is not a number.`,W$=O4({errorPriorityExists:N4,errorPriorityNaN:D4}),B$=H4({errorItemExists:K0}),JR=Ew({errorIdExists:K0});function j$(){return[...W$.getItems(),...B$.getItems()]}function X0(t){const e=Bi(t);return JR.getItem(e)}function k4(t){return!!X0(t)}function Je(t,e,r){[t,e,r]=$4(t,e,r),X0(t)===void 0&&L4(t,e,r)}function L4(t,e,r){const n=Bi(t);if(JR.hasItem(n))throw new Error(K0(n));r===void 0?B$.addItem(n):W$.addItem(r,n),JR.addItem(n,e)}function $4(t,e,r){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,r=e.PLUGIN_PRIORITY),[t,e,r]}const{register:F4,getItem:V4,hasItem:U$,getNames:vme,getValues:yme}=Gi("renderers");function QR(t){if(typeof t=="function")return t;if(!U$(t))throw Error(`No registered renderer found under "${t}" name`);return V4(t)}function Jn(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),F4(t,e)}const{register:W4,getItem:B4,hasItem:z$,getNames:Cme,getValues:bme}=Gi("validators");function j4(t){if(typeof t=="function")return t;if(!z$(t))throw Error(`No registered validator found under "${t}" name`);return B4(t)}function Yu(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),W4(t,e)}var hA={},dA;function U4(){if(dA)return hA;dA=1;var t=St(),e=Pc(),r=Oc(),n=sf(),i=Rw();return t({target:"Array",proto:!0},{at:function(s){var a=e(this),l=r(a),u=n(s),c=u>=0?u:l+u;return c<0||c>=l?void 0:a[c]}}),i("at"),hA}U4();var fA={},gA;function z4(){if(gA)return fA;gA=1;var t=St(),e=or(),r=tf(),n=sf(),i=sw(),o=mr(),s=e("".charAt),a=o(function(){return"𠮷".at(-2)!=="\uD842"});return t({target:"String",proto:!0,forced:a},{at:function(u){var c=i(r(this)),h=c.length,d=n(u),f=d>=0?d:h+d;return f<0||f>=h?void 0:s(c,f)}}),fA}z4();function sh(t,e,r){return(e=Y4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y4(t){var e=G4(t,"string");return typeof e=="symbol"?e:e+""}function G4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class q4{constructor(){sh(this,"count",0),sh(this,"startColumn",null),sh(this,"endColumn",null),sh(this,"startPosition",null),sh(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,r){const{totalCalculatedWidth:n,zeroBasedScrollOffset:i,viewportWidth:o,columnWidth:s}=r,a=i>0?o+1:o;n>=i&&n+s<=i+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e)}finalize(e){var r;const{scrollOffset:n,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const g=u[this.endColumn]+c-u[this.startColumn-1];if(g<=i&&(this.startColumn-=1),g>=i)break}this.startPosition=(r=u[this.startColumn])!==null&&r!==void 0?r:null;const h=s>0?i+1:i,d=n+i-h,f=this.startColumn===null?0:e.getColumnWidth(this.startColumn);d<-1*o||n>u.at(-1)||-1*n-i>-1*f?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function ah(t,e,r){return(e=K4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K4(t){var e=X4(t,"string");return typeof e=="symbol"?e:e+""}function X4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Z4{constructor(){ah(this,"count",0),ah(this,"startRow",null),ah(this,"endRow",null),ah(this,"startPosition",null),ah(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,r){const{totalCalculatedHeight:n,zeroBasedScrollOffset:i,innerViewportHeight:o,rowHeight:s}=r;n>=i&&n+s<=o&&(this.startRow===null&&(this.startRow=e),this.endRow=e)}finalize(e){var r;const{scrollOffset:n,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const d=l[this.endRow]+u-l[this.startRow-1];if(d<=i-o&&(this.startRow-=1),d>=i-o)break}this.startPosition=(r=l[this.startRow])!==null&&r!==void 0?r:null;const c=n+i-o,h=this.startRow===null?0:e.getRowHeight(this.startRow);c<h||n>l.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function lh(t,e,r){return(e=J4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J4(t){var e=Q4(t,"string");return typeof e=="symbol"?e:e+""}function Q4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Y${constructor(){lh(this,"count",0),lh(this,"startColumn",null),lh(this,"endColumn",null),lh(this,"startPosition",null),lh(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,r){const{totalCalculatedWidth:n,zeroBasedScrollOffset:i,viewportWidth:o}=r;n<=i&&(this.startColumn=e);const s=i>0?o+1:o;n>=i&&n<=i+s&&(this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e}finalize(e){var r;const{scrollOffset:n,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const f=u[this.endColumn]+c-u[this.startColumn-1];if(this.startColumn-=1,f>i)break}this.startPosition=(r=u[this.startColumn])!==null&&r!==void 0?r:null;const h=s>0?i+1:i;n+i-h<-1*o||n>u.at(-1)+c||-1*n-i>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function uh(t,e,r){return(e=eX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eX(t){var e=tX(t,"string");return typeof e=="symbol"?e:e+""}function tX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class G${constructor(){uh(this,"count",0),uh(this,"startRow",null),uh(this,"endRow",null),uh(this,"startPosition",null),uh(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,r){const{totalCalculatedHeight:n,zeroBasedScrollOffset:i,innerViewportHeight:o}=r;n<=i&&(this.startRow=e),n>=i&&n<=o&&this.startRow===null&&(this.startRow=e),this.endRow=e}finalize(e){var r;const{scrollOffset:n,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const h=l[this.endRow]+u-l[this.startRow-1];if(this.startRow-=1,h>=i-o)break}this.startPosition=(r=l[this.startRow])!==null&&r!==void 0?r:null,n+i-o<0||n>l.at(-1)+u?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function ch(t,e,r){return(e=rX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rX(t){var e=nX(t,"string");return typeof e=="symbol"?e:e+""}function nX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class iX{constructor(){ch(this,"count",0),ch(this,"startColumn",0),ch(this,"endColumn",0),ch(this,"startPosition",0),ch(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:r}=e;this.count=r,this.endColumn=this.count-1}process(){}finalize(){}}function hh(t,e,r){return(e=oX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oX(t){var e=sX(t,"string");return typeof e=="symbol"?e:e+""}function sX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class aX{constructor(){hh(this,"count",0),hh(this,"startRow",0),hh(this,"endRow",0),hh(this,"startPosition",0),hh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:r}=e;this.count=r,this.endRow=this.count-1}process(){}finalize(){}}function mA(t,e,r){return(e=lX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lX(t){var e=uX(t,"string");return typeof e=="symbol"?e:e+""}function uX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cX extends Y${constructor(){super(...arguments),mA(this,"columnStartOffset",0),mA(this,"columnEndOffset",0)}finalize(e){var r;super.finalize(e);const{overrideFn:n,totalColumns:i,startPositions:o}=e;if(this.startColumn!==null&&typeof n=="function"){const s=this.startColumn,a=this.endColumn;n(this),this.columnStartOffset=s-this.startColumn,this.columnEndOffset=this.endColumn-a}this.startColumn<0&&(this.startColumn=0),this.startPosition=(r=o[this.startColumn])!==null&&r!==void 0?r:null,i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function pA(t,e,r){return(e=hX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hX(t){var e=dX(t,"string");return typeof e=="symbol"?e:e+""}function dX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class fX extends G${constructor(){super(...arguments),pA(this,"rowStartOffset",0),pA(this,"rowEndOffset",0)}finalize(e){var r;super.finalize(e);const{overrideFn:n,totalRows:i,startPositions:o}=e;if(this.startRow!==null&&typeof n=="function"){const s=this.startRow,a=this.endRow;n(this),this.rowStartOffset=s-this.startRow,this.rowEndOffset=this.endRow-a}this.startRow<0&&(this.startRow=0),this.startPosition=(r=o[this.startRow])!==null&&r!==void 0?r:null,i<this.endRow&&(this.endRow=i-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function wA(t,e,r){return(e=gX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gX(t){var e=mX(t,"string");return typeof e=="symbol"?e:e+""}function mX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class q${constructor(e){wA(this,"calculationTypes",[]),wA(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach(r=>{let[n,i]=r;this.calculationResults.set(n,i),i.initialize(e)})}_process(e,r){this.calculationTypes.forEach(n=>{let[,i]=n;return i.process(e,r)})}_finalize(e){this.calculationTypes.forEach(r=>{let[,n]=r;return n.finalize(e)})}getResultsFor(e){return this.calculationResults.get(e)}}function vi(t,e,r){return(e=pX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pX(t){var e=wX(t,"string");return typeof e=="symbol"?e:e+""}function wX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Cc=50;class vX extends q${constructor(e){let{calculationTypes:r,viewportWidth:n,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(r),vi(this,"viewportWidth",0),vi(this,"scrollOffset",0),vi(this,"zeroBasedScrollOffset",0),vi(this,"totalColumns",0),vi(this,"columnWidthFn",null),vi(this,"columnWidth",0),vi(this,"overrideFn",null),vi(this,"inlineStartOffset",0),vi(this,"totalCalculatedWidth",0),vi(this,"startPositions",[]),vi(this,"needReverse",!0),this.viewportWidth=n,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalColumns=o,this.columnWidthFn=s,this.overrideFn=a,this.inlineStartOffset=l,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalColumns;e++)if(this.columnWidth=this.getColumnWidth(e),this._process(e,this),this.startPositions.push(this.totalCalculatedWidth),this.totalCalculatedWidth+=this.columnWidth,this.totalCalculatedWidth>=this.zeroBasedScrollOffset+this.viewportWidth){this.needReverse=!1;break}this._finalize(this)}getColumnWidth(e){const r=this.columnWidthFn(e);return isNaN(r)?Cc:r}}function Gn(t,e,r){return(e=yX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yX(t){var e=CX(t,"string");return typeof e=="symbol"?e:e+""}function CX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bX extends q${constructor(e){let{calculationTypes:r,viewportHeight:n,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(r),Gn(this,"viewportHeight",0),Gn(this,"scrollOffset",0),Gn(this,"zeroBasedScrollOffset",0),Gn(this,"totalRows",0),Gn(this,"rowHeightFn",null),Gn(this,"rowHeight",0),Gn(this,"overrideFn",null),Gn(this,"horizontalScrollbarHeight",0),Gn(this,"innerViewportHeight",0),Gn(this,"totalCalculatedHeight",0),Gn(this,"startPositions",[]),Gn(this,"needReverse",!0),this.defaultHeight=s,this.viewportHeight=n,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalRows=o,this.rowHeightFn=a,this.overrideFn=l,this.horizontalScrollbarHeight=u??0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalRows;e++)if(this.rowHeight=this.getRowHeight(e),this._process(e,this),this.startPositions.push(this.totalCalculatedHeight),this.totalCalculatedHeight+=this.rowHeight,this.totalCalculatedHeight>=this.innerViewportHeight){this.needReverse=!1;break}this._finalize(this)}getRowHeight(e){const r=this.rowHeightFn(e);return isNaN(r)?this.defaultHeight:r}}function SX(t,e,r){RX(t,e),e.set(t,r)}function RX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vA(t,e,r){return(e=EX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EX(t){var e=TX(t,"string");return typeof e=="symbol"?e:e+""}function TX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lu(t,e){return t.get(K$(t,e))}function yA(t,e,r){return t.set(K$(t,e),r),r}function K$(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Bo=new WeakMap;class Wl{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;vA(this,"row",null),vA(this,"col",null),SX(this,Bo,!1),yA(Bo,this,n),typeof e<"u"&&typeof r<"u"&&(this.row=e,this.col=r)}isValid(e){const{countRows:r,countCols:n,countRowHeaders:i,countColHeaders:o}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-o||this.col<-i||this.row>=r||this.col>=n)}isEqual(e){return e===this?!0:this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return lu(Bo,this)}isSouthEastOf(e){return this.row>=e.row&&(lu(Bo,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(lu(Bo,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(lu(Bo,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(lu(Bo,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=this.row===null?this.row:Math.max(this.row,0),this.col=this.col===null?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(e==null?void 0:e.row)&&(this.row=e.row),Number.isInteger(e==null?void 0:e.col)&&(this.col=e.col),e instanceof Wl&&yA(Bo,this,e.isRtl()),this}clone(){return new Wl(this.row,this.col,lu(Bo,this))}toObject(){return{row:this.row,col:this.col}}}function _X(t,e,r){MX(t,e),e.set(t,r)}function MX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cb(t,e,r){return(e=PX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PX(t){var e=IX(t,"string");return typeof e=="symbol"?e:e+""}function IX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qn(t,e){return t.get(X$(t,e))}function OX(t,e,r){return t.set(X$(t,e),r),r}function X$(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var ln=new WeakMap;class pf{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;cb(this,"highlight",null),cb(this,"from",null),cb(this,"to",null),_X(this,ln,!1),this.highlight=e.clone(),this.from=r.clone(),this.to=n.clone(),OX(ln,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}normalize(){return this.highlight.normalize(),this.from.normalize(),this.to.normalize(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return this.from.isHeader()&&this.to.isHeader()?!0:this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),r=Math.max(this.to.row,0);return Math.max(e,r)-Math.min(e,r)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),r=Math.max(this.to.col,0);return Math.max(e,r)-Math.min(e,r)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:r,col:n}=e,i=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();return i.row<=r&&o.row>=r&&i.col<=n&&o.col>=n}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();return e.row<r.row||e.col<r.col||e.row>n.row||e.col>n.col?(this.from=this._createCellCoords(Math.min(r.row,e.row),Math.min(r.col,e.col)),this.to=this._createCellCoords(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1}expandByRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const n=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),o=this.getDirection(),s=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(n.row,s.row),u=Math.min(n.col,s.col),c=Math.max(i.row,a.row),h=Math.max(i.col,a.col),d=this._createCellCoords(l,u),f=this._createCellCoords(c,h);return this.from=d,this.to=f,this.setDirection(o),r&&(this.highlight.row===this.getOuterBottomRightCorner().row&&this.getVerticalDirection()==="N-S"&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&this.getHorizontalDirection()==="W-E"&&this.flipDirectionHorizontally()),!0}getDirection(){if(this.from.isNorthWestOf(this.to))return"NW-SE";if(this.from.isNorthEastOf(this.to))return"NE-SW";if(this.from.isSouthEastOf(this.to))return"SE-NW";if(this.from.isSouthWestOf(this.to))return"SW-NE"}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return qn(ln,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return qn(ln,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return qn(ln,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return qn(ln,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return qn(ln,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return qn(ln,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return qn(ln,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return qn(ln,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){if(!(e instanceof Wl))return!1;if(e.isEqual(this.getOuterBottomEndCorner()))return this.getOuterTopStartCorner();if(e.isEqual(this.getOuterTopStartCorner()))return this.getOuterBottomEndCorner();if(e.isEqual(this.getOuterTopEndCorner()))return this.getOuterBottomStartCorner();if(e.isEqual(this.getOuterBottomStartCorner()))return this.getOuterTopEndCorner()}getBordersSharedWith(e){if(!this.includesRange(e))return[];const r={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return r.top===n.top&&i.push("top"),r.right===n.right&&i.push(qn(ln,this)?"left":"right"),r.bottom===n.bottom&&i.push("bottom"),r.left===n.left&&i.push(qn(ln,this)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),n=[];for(let i=e.row;i<=r.row;i++)for(let o=e.col;o<=r.col;o++)!(this.from.row===i&&this.from.col===o)&&!(this.to.row===i&&this.to.col===o)&&n.push(this._createCellCoords(i,o));return n}getAll(){const e=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),n=[];for(let i=e.row;i<=r.row;i++)for(let o=e.col;o<=r.col;o++)e.row===i&&e.col===o?n.push(e):r.row===i&&r.col===o?n.push(r):n.push(this._createCellCoords(i,o));return n}forAll(e){const r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();for(let i=r.row;i<=n.row;i++)for(let o=r.col;o<=n.col;o++)if(e(i,o)===!1)return}clone(){return new pf(this.highlight,this.from,this.to,qn(ln,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,r){return new Wl(e,r,qn(ln,this))}}function Ki(t,e,r){xX(t,e),e.set(t,r)}function xX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function be(t,e){return t.get(Z$(t,e))}function Ns(t,e,r){return t.set(Z$(t,e),r),r}function Z$(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Kn=new WeakMap,hb=new WeakMap,Tr=new WeakMap,uu=new WeakMap,Yf=new WeakMap,yi=new WeakMap,db=new WeakMap,dh=new WeakMap,Da=new WeakMap,Xi=new WeakMap;let J$=class{constructor(e,r,n,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Ki(this,Kn,void 0),Ki(this,hb,void 0),Ki(this,Tr,void 0),Ki(this,uu,void 0),Ki(this,Yf,void 0),Ki(this,yi,void 0),Ki(this,db,void 0),Ki(this,dh,void 0),Ki(this,Da,[null,null]),Ki(this,Xi,[null,null]),Ns(Kn,this,n),Ns(hb,this,r),Ns(Tr,this,o),Ns(uu,this,s),Ns(Yf,this,a),Ns(yi,this,i),Ns(db,this,e),this.registerEvents()}registerEvents(){be(yi,this).addEventListener(be(Tr,this).holder,"contextmenu",n=>this.onContextMenu(n)),be(yi,this).addEventListener(be(Tr,this).TABLE,"mouseover",n=>this.onMouseOver(n)),be(yi,this).addEventListener(be(Tr,this).TABLE,"mouseout",n=>this.onMouseOut(n));const e=()=>{be(yi,this).addEventListener(be(Tr,this).holder,"touchstart",n=>this.onTouchStart(n)),be(yi,this).addEventListener(be(Tr,this).holder,"touchend",n=>this.onTouchEnd(n)),this.momentumScrolling||(this.momentumScrolling={}),be(yi,this).addEventListener(be(Tr,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||be(Kn,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,be(Kn,this).getSetting("onAfterMomentumScroll"))},200)})},r=()=>{be(yi,this).addEventListener(be(Tr,this).holder,"mouseup",n=>this.onMouseUp(n)),be(yi,this).addEventListener(be(Tr,this).holder,"mousedown",n=>this.onMouseDown(n))};ps()?e():(I$()&&e(),r())}selectedCellWasTouched(e){const n=this.parentCell(e).coords;if(be(dh,this)&&n){const[i,o]=[n.row,be(dh,this).from.row],[s,a]=[n.col,be(dh,this).from.col];return i===o&&s===a}return!1}parentCell(e){const r={},n=be(Tr,this).TABLE,i=Vf(e,["TD","TH"],n);return i?(r.coords=be(Tr,this).getCoords(i),r.TD=i):_e(e,"wtBorder")&&_e(e,"current")?(r.coords=be(uu,this).getFocusSelection().cellRange.highlight,r.TD=be(Tr,this).getCell(r.coords)):_e(e,"wtBorder")&&_e(e,"area")&&be(uu,this).getAreaSelection().cellRange&&(r.coords=be(uu,this).getAreaSelection().cellRange.to,r.TD=be(Tr,this).getCell(r.coords)),r}onMouseDown(e){const r=be(hb,this).rootDocument.activeElement,n=P$(d3,e.target),i=e.target;if(!["TD","TH"].includes(r.nodeName)&&(i===r||n(0)===r||n(1)===r))return;const o=this.parentCell(i);_e(i,"corner")?be(Kn,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&be(Kn,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(be(Xi,this)[0]=o.TD,clearTimeout(be(Da,this)[0]),be(Da,this)[0]=setTimeout(()=>{be(Xi,this)[0]=null},1e3))}onContextMenu(e){if(be(Kn,this).has("onCellContextMenu")){const r=this.parentCell(e.target);r.TD&&this.callListener("onCellContextMenu",e,r.coords,r.TD)}}onMouseOver(e){if(!be(Kn,this).has("onCellMouseOver"))return;const r=be(Tr,this).TABLE,n=Vf(e.target,["TD","TH"],r),i=be(Yf,this)||this;n&&n!==i.lastMouseOver&&Nl(n,r)&&(i.lastMouseOver=n,this.callListener("onCellMouseOver",e,be(Tr,this).getCoords(n),n))}onMouseOut(e){if(!be(Kn,this).has("onCellMouseOut"))return;const r=be(Tr,this).TABLE,n=Vf(e.target,["TD","TH"],r),i=Vf(e.relatedTarget,["TD","TH"],r),o=be(Yf,this)||this;n&&n!==i&&Nl(n,r)&&(this.callListener("onCellMouseOut",e,be(Tr,this).getCoords(n),n),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const r=this.parentCell(e.target);r.TD&&be(Kn,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,r.coords,r.TD),!(e.button!==0&&!this.touchApplied)&&(r.TD===be(Xi,this)[0]&&r.TD===be(Xi,this)[1]?(_e(e.target,"corner")?this.callListener("onCellCornerDblClick",e,r.coords,r.TD):this.callListener("onCellDblClick",e,r.coords,r.TD),be(Xi,this)[0]=null,be(Xi,this)[1]=null):r.TD===be(Xi,this)[0]&&(be(Xi,this)[1]=r.TD,clearTimeout(be(Da,this)[1]),be(Da,this)[1]=setTimeout(()=>{be(Xi,this)[1]=null},500)))}onTouchStart(e){Ns(dh,this,be(uu,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var r;const n=e.target,i=(r=this.parentCell(n))===null||r===void 0?void 0:r.coords,o=pe(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&be(Kn,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];x$()&&(H3()||N3())&&this.selectedCellWasTouched(n)&&!a.includes(n.tagName)?e.preventDefault():this.selectedCellWasTouched(n)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,r,n,i){const o=be(Kn,this).getSettingPure(e);o&&o(r,n,i,be(db,this).call(this))}destroy(){clearTimeout(be(Da,this)[0]),clearTimeout(be(Da,this)[1]),be(yi,this).destroy()}};function fb(t,e,r){return(e=AX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AX(t){var e=HX(t,"string");return typeof e=="symbol"?e:e+""}function HX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class NX{constructor(e,r,n){fb(this,"offset",void 0),fb(this,"total",void 0),fb(this,"countTH",void 0),this.offset=e,this.total=r,this.countTH=n}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function gb(t,e,r){return(e=DX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function DX(t){var e=kX(t,"string");return typeof e=="symbol"?e:e+""}function kX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class LX{constructor(e,r,n){gb(this,"offset",void 0),gb(this,"total",void 0),gb(this,"countTH",void 0),this.offset=e,this.total=r,this.countTH=n}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function Gf(t,e,r){return(e=$X(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $X(t){var e=FX(t,"string");return typeof e=="symbol"?e:e+""}function FX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class VX{constructor(){Gf(this,"currentSize",0),Gf(this,"nextSize",0),Gf(this,"currentOffset",0),Gf(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const WX=0,CA=1,eE=2;function mb(t,e,r){return(e=BX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function BX(t){var e=jX(t,"string");return typeof e=="symbol"?e:e+""}function jX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class UX{constructor(){mb(this,"size",new VX),mb(this,"workingSpace",WX),mb(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize!==null}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=CA,e.workingSpace=eE,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=eE,e.workingSpace=CA,this.sharedSize=e.getViewSize()}}var bA={},pb,SA;function zX(){if(SA)return pb;SA=1;var t=ow(),e=TypeError;return pb=function(r,n){if(!delete r[n])throw new e("Cannot delete property "+t(n)+" of "+t(r))},pb}var RA;function YX(){if(RA)return bA;RA=1;var t=St(),e=Pc(),r=Oc(),n=Zk(),i=zX(),o=Jk(),s=[].unshift(0)!==1,a=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{unshift:function(c){var h=e(this),d=r(h),f=arguments.length;if(f){o(d+f);for(var g=d;g--;){var w=g+f;g in h?h[w]=h[g]:i(h,w)}for(var v=0;v<f;v++)h[v]=arguments[v]}return n(h,d+f)}}),bA}YX();function GX(t,e,r){return(e=qX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qX(t){var e=KX(t,"string");return typeof e=="symbol"?e:e+""}function KX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class EA{constructor(e,r){GX(this,"order",[]),this.order=[...Array(r).keys()].map(n=>e+n)}get length(){return this.order.length}has(e){return this.order.indexOf(e)>-1}get(e){return e<this.order.length?this.order[e]:-1}remove(e){this.order.splice(this.order.indexOf(e),1)}prepend(e){return this.order.unshift(e),this.order.pop()}}function XX(t,e,r){return(e=ZX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ZX(t){var e=JX(t,"string");return typeof e=="symbol"?e:e+""}function JX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class QX{constructor(e){XX(this,"sizeSet",void 0),this.sizeSet=e}diff(){const{sizeSet:e}=this,{currentSize:r,nextSize:n}=e.getViewSize();let i=Math.max(n,r);if(i===0)return[];const{currentOffset:o,nextOffset:s}=e.getViewSize(),a=new EA(o,r),l=new EA(s,n),u=[];for(let c=0;c<i;c++){const h=a.get(c),d=l.get(c);if(d===-1)u.push(["remove",h]);else if(h===-1)!e.isShared()||e.isShared()&&e.isPlaceOn(eE)?u.push(["append",d]):u.push(["prepend",d]);else if(d>h)a.has(d)&&(a.remove(d),n<=a.length&&(i-=1)),u.push(["replace",d,h]);else if(d<h){const f=a.prepend(d);u.push(["insert_before",d,h,f])}else u.push(["none",d])}return u}}function cu(t,e,r){return(e=e6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e6(t){var e=t6(t,"string");return typeof e=="symbol"?e:e+""}function t6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Q${constructor(e,r){cu(this,"rootNode",void 0),cu(this,"nodesPool",void 0),cu(this,"sizeSet",new UX),cu(this,"collectedNodes",[]),cu(this,"viewDiffer",new QX(this.sizeSet)),cu(this,"leads",[]),this.rootNode=e,this.nodesPool=r}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e<this.collectedNodes.length?this.collectedNodes[e]:null}getCurrentNode(){const e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}applyCommand(e){const{rootNode:r}=this,[n,i,o,s]=e,a=this.nodesPool(i);switch(this.collectedNodes.push(a),n){case"prepend":r.insertBefore(a,r.firstChild);break;case"append":r.appendChild(a);break;case"insert_before":r.insertBefore(a,this.nodesPool(o)),r.removeChild(this.nodesPool(s));break;case"replace":r.replaceChild(a,this.nodesPool(o));break;case"remove":r.removeChild(a);break}}start(){this.collectedNodes.length=0,this.leads=this.viewDiffer.diff()}render(){this.leads.length>0&&this.applyCommand(this.leads.shift())}end(){for(;this.leads.length>0;)this.applyCommand(this.leads.shift())}}class eF extends Q${prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}function TA(t,e,r){return(e=r6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r6(t){var e=n6(t,"string");return typeof e=="symbol"?e:e+""}function n6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class i6{constructor(e){TA(this,"nodeType",void 0),TA(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,r){const i=typeof r=="number"?`${e}x${r}`:e.toString();if(this.pool.has(i))return this.pool.get(i);const o=this.rootDocument.createElement(this.nodeType);return this.pool.set(i,o),o}}function fh(t,e,r){return(e=o6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o6(t){var e=s6(t,"string");return typeof e=="symbol"?e:e+""}function s6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wf{constructor(e,r){fh(this,"nodesPool",null),fh(this,"nodeType",void 0),fh(this,"rootNode",void 0),fh(this,"table",null),fh(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new i6(e):null,this.nodeType=e,this.rootNode=r}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function _A(t,e,r){return(e=a6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a6(t){var e=l6(t,"string");return typeof e=="symbol"?e:e+""}function l6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class u6 extends wf{constructor(){super("TH"),_A(this,"orderViews",new WeakMap),_A(this,"sourceRowIndex",0)}obtainOrderView(e){let r;return this.orderViews.has(e)?r=this.orderViews.get(e):(r=new eF(e,n=>this.nodesPool.obtain(this.sourceRowIndex,n)),this.orderViews.set(e,r)),r}render(){const{rowsToRender:e,rowHeaderFunctions:r,rowHeadersCount:n,rows:i,cells:o}=this.table;for(let s=0;s<e;s++){const a=this.table.renderedRowToSource(s),l=i.getRenderedNode(s);this.sourceRowIndex=a;const u=this.obtainOrderView(l),c=o.obtainOrderView(l);u.appendView(c).setSize(n).setOffset(0).start();for(let h=n-1;h>=0;h--){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),Dc(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Pe(d,[zK(),e3(),F0(h+1),Ql(-1)]),r[h](a,d,h)}u.end()}}}class c6 extends wf{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:r}=this.table;let n=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,o=i+r;for(let a=0,l=e;a<l;a++){for(n=this.rootNode.childNodes[a],n||(n=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(n)),this.renderedNodes=n.childNodes.length;this.renderedNodes<o;)n.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>o;)n.removeChild(n.lastChild),this.renderedNodes-=1}const s=this.rootNode.childNodes.length;if(s>e)for(let a=e;a<s;a++)this.rootNode.removeChild(this.rootNode.lastChild)}else n&&Ts(n)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Pe(this.rootNode,[u$()]);for(let r=0;r<e;r+=1){const{columnHeaderFunctions:n,columnsToRender:i,rowHeadersCount:o}=this.table,s=this.rootNode.childNodes[r];this.table.isAriaEnabled()&&Pe(s,[YR(),f$(r+1)]);for(let a=-1*o;a<i;a+=1){const l=this.table.renderedColumnToSource(a),u=s.childNodes[a+o];u.className="",u.removeAttribute("style"),Dc(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Pe(u,[F0(a+1+this.table.rowHeadersCount),Ql(-1),YK(),...a>=0?[QK()]:[YR()]]),n[r](l,u,r)}}}}let MA=!1;class h6 extends wf{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:r}=this.table,n=e+r;for(;this.renderedNodes<n;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>n;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:r}=this.table;!MA&&e>1e3&&(MA=!0,it(lt`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
|
|
517
|
+
Consider limiting the number of rendered columns by specifying the table width and/or\x20
|
|
518
|
+
turning off the "renderAllColumns" option.`));for(let i=0;i<r;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getHeaderWidth(o);this.rootNode.childNodes[i].style.width=`${s}px`}for(let i=0;i<e;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getWidth(o);this.rootNode.childNodes[i+r].style.width=`${s}px`}const n=this.rootNode.firstChild;n&&ie(n,"rowHeader")}}function d6(t,e,r){return(e=f6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f6(t){var e=g6(t,"string");return typeof e=="symbol"?e:e+""}function g6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const hu={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let PA=!1;class m6 extends wf{constructor(e){super("TR",e),d6(this,"orderView",void 0),this.orderView=new Q$(e,r=>this.nodesPool.obtain(r))}getRenderedNode(e){return this.orderView.getNode(e)}hasStaleContent(e){return this.orderView.hasStaleContent(e)}render(){const{rowsToRender:e}=this.table;!PA&&e>1e3&&(PA=!0,it(lt`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
|
|
519
|
+
Consider limiting the number of rendered rows by specifying the table height and/or\x20
|
|
520
|
+
turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&Pe(this.rootNode,[u$()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const o=this.orderView.getCurrentNode(),s=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var r,n;Pe(o,[YR(),f$(s+((r=(n=this.table.rowUtils)===null||n===void 0||(n=n.dataAccessObject)===null||n===void 0?void 0:n.columnHeaders.length)!==null&&r!==void 0?r:0)+1)])}(s+1)%2===0?_e(o,hu.rowEven)||(Ee(o,hu.rowOdd),ie(o,hu.rowEven)):_e(o,hu.rowOdd)||(Ee(o,hu.rowEven),ie(o,hu.rowOdd))}this.orderView.end()}}function IA(t,e,r){return(e=p6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p6(t){var e=w6(t,"string");return typeof e=="symbol"?e:e+""}function w6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class v6 extends wf{constructor(){super("TD"),IA(this,"orderViews",new WeakMap),IA(this,"sourceRowIndex",0)}obtainOrderView(e){let r;return this.orderViews.has(e)?r=this.orderViews.get(e):(r=new eF(e,n=>this.nodesPool.obtain(this.sourceRowIndex,n),this.nodeType),this.orderViews.set(e,r)),r}render(){const{rowsToRender:e,columnsToRender:r,rows:n,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),u=n.getRenderedNode(a);this.sourceRowIndex=l;const c=this.obtainOrderView(u),h=i.obtainOrderView(u);c.prependView(h).setSize(r).setOffset(0).start();for(let d=0;d<r;d++){c.render();const f=this.table.renderedColumnToSource(d),g=c.getCurrentNode();if(_e(g,"hide")||(g.className=""),g.removeAttribute("style"),g.removeAttribute("dir"),Dc(g,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,g),this.table.isAriaEnabled()){var o,s;Pe(g,[...g.hasAttribute("role")?[]:[UK()],Ql(-1),F0(f+((o=(s=this.table.rowUtils)===null||s===void 0||(s=s.dataAccessObject)===null||s===void 0?void 0:s.rowHeaders.length)!==null&&o!==void 0?o:0)+1)])}}c.end()}}}function lr(t,e,r){return(e=y6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y6(t){var e=C6(t,"string");return typeof e=="symbol"?e:e+""}function C6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b6{constructor(e){let{cellRenderer:r,stylesHandler:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};lr(this,"rootNode",void 0),lr(this,"rootDocument",void 0),lr(this,"rowHeaders",null),lr(this,"columnHeaders",null),lr(this,"colGroup",null),lr(this,"rows",null),lr(this,"cells",null),lr(this,"rowFilter",null),lr(this,"columnFilter",null),lr(this,"rowUtils",null),lr(this,"columnUtils",null),lr(this,"rowsToRender",0),lr(this,"columnsToRender",0),lr(this,"rowHeaderFunctions",[]),lr(this,"rowHeadersCount",0),lr(this,"columnHeaderFunctions",[]),lr(this,"columnHeadersCount",0),lr(this,"cellRenderer",void 0),lr(this,"activeOverlayName",void 0),lr(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=r,this.stylesHandler=n}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,r){this.rowUtils=e,this.columnUtils=r}setViewportSize(e,r){this.rowsToRender=e,this.columnsToRender=r}setFilters(e,r){this.rowFilter=e,this.columnFilter=r}setHeaderContentRenderers(e,r){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=r,this.columnHeadersCount=r.length}setRenderers(){let{rowHeaders:e,columnHeaders:r,colGroup:n,rows:i,cells:o}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),r.setTable(this),n.setTable(this),i.setTable(this),o.setTable(this),this.rowHeaders=e,this.columnHeaders=r,this.colGroup=n,this.rows=i,this.cells=o}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:r}=this;for(let n=0;n<e;n++){const i=r.getRenderedNode(n),o=this.rowUtils;if(i.firstChild){const s=this.renderedRowToSource(n),a=o.getHeightByOverlayName(s,this.activeOverlayName),u=this.stylesHandler.areCellsBorderBox()?0:1;a?i.firstChild.style.height=`${a-u}px`:i.firstChild.style.height=""}}}}class S6{constructor(){let{TABLE:e,THEAD:r,COLGROUP:n,TBODY:i,rowUtils:o,columnUtils:s,cellRenderer:a,stylesHandler:l}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new b6(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new u6,columnHeaders:new c6(r),colGroup:new h6(n),rows:new m6(i),cells:new v6}),this.renderer.setAxisUtils(o,s)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,r){return this.renderer.setFilters(e,r),this}setViewportSize(e,r){return this.renderer.setViewportSize(e,r),this}setHeaderContentRenderers(e,r){return this.renderer.setHeaderContentRenderers(e,r),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function wb(t,e,r){return(e=R6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function R6(t){var e=E6(t,"string");return typeof e=="symbol"?e:e+""}function E6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class T6{constructor(e,r){wb(this,"dataAccessObject",void 0),wb(this,"wtSettings",void 0),wb(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=r}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let r=this.dataAccessObject.stylesHandler.getDefaultRowHeight();const n=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return n!==void 0&&(r=r?Math.max(r,n):n),r}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let r=e.getSetting("rowHeaderWidth");if(r=e.getSetting("onModifyRowHeaderWidth",r),r!=null){const n=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let o=0;o<n;o++){let s=Array.isArray(r)?r[o]:r;s=s??i,this.headerWidths.set(o,s)}}}}function OA(t,e,r){return(e=_6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _6(t){var e=M6(t,"string");return typeof e=="symbol"?e:e+""}function M6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class P6{constructor(e,r){OA(this,"dataAccessObject",void 0),OA(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=r}getHeight(e){let r=this.wtSettings.getSetting("rowHeight",e);const n=this.dataAccessObject.wtViewport.oversizedRows[e];return n!==void 0&&(r=r===void 0?n:Math.max(r,n)),r}getHeightByOverlayName(e,r){let n=this.wtSettings.getSetting("rowHeightByOverlayName",e,r);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(n=n===void 0?i:Math.max(n,i)),n}}function Zi(t,e,r){return(e=I6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I6(t){var e=O6(t,"string");return typeof e=="symbol"?e:e+""}function O6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Lc{constructor(e,r,n,i,o){Zi(this,"wtSettings",null),Zi(this,"domBindings",void 0),Zi(this,"TBODY",null),Zi(this,"THEAD",null),Zi(this,"COLGROUP",null),Zi(this,"hasTableHeight",!0),Zi(this,"hasTableWidth",!0),Zi(this,"isTableVisible",!1),Zi(this,"tableOffset",0),Zi(this,"holderOffset",0),this.domBindings=n,this.isMaster=o==="master",this.name=o,this.dataAccessObject=e,this.facadeGetter=r,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=n.rootTable,w$(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const s=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(s)),this.rowUtils=new P6(this.dataAccessObject,this.wtSettings),this.columnUtils=new T6(this.dataAccessObject,this.wtSettings),this.tableRenderer=new S6({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer"),stylesHandler:this.dataAccessObject.stylesHandler})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!_e(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.className="wtSpreader",r&&r.insertBefore(n,e),n.appendChild(e)),n.style.position="relative",this.wtSettings.getSetting("ariaTags")&&Pe(n,[ms()]),n}createHider(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!_e(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.className="wtHider",r&&r.insertBefore(n,e),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Pe(n,[ms()]),n}createHolder(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!_e(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.style.position="relative",n.className="wtHolder",Pe(n,[Ql(-1)]),r&&r.insertBefore(n,e),this.isMaster&&(n.parentNode.className+="ht_master handsontable",n.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&Pe(n.parentNode,[ms()])),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Pe(n,[ms()]),n}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:r}=this,{wtOverlays:n,wtViewport:i}=this.dataAccessObject,o=r.getSetting("totalRows"),s=r.getSetting("totalColumns"),a=r.getSetting("rowHeaders"),l=a.length,u=r.getSetting("columnHeaders"),c=u.length;let h=e;if(this.isMaster&&(n.beforeDraw(),this.holderOffset=jr(this.holder),h=i.createCalculators(h),l&&!r.getSetting("fixedColumnsStart"))){const f=n.inlineStartOverlay.getScrollPosition(),g=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,g!==this.correctHeaderWidth&&(h=!1)}if(h)this.isMaster&&n.refresh(!0);else{this.isMaster?this.tableOffset=jr(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=Math.max(this.getFirstRenderedRow(),0),g=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new LX(f,o,c),this.columnFilter=new NX(g,s,l);let w=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const v={};this.wtSettings.getSetting("beforeDraw",!0,v),w=v.skipRender!==!0}w&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(Ro)||this.is(ma))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&this.markOversizedColumnHeaders(),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(Ro))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),n.refresh(!1),n.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(Ro)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let d=!1;return this.isMaster&&(d=n.topOverlay.resetFixedPosition(),n.bottomOverlay.clone&&(d=n.bottomOverlay.resetFixedPosition()||d),d=n.inlineStartOverlay.resetFixedPosition()||d,n.topInlineStartCornerOverlay&&n.topInlineStartCornerOverlay.resetFixedPosition(),n.bottomInlineStartCornerOverlay&&n.bottomInlineStartCornerOverlay.clone&&n.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(n.refreshAll(),n.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(h),this.isMaster&&n.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const r=this.columnFilter.renderedToSource(e);let n=this.wtSettings.getSetting("columnHeaders").length;const i=this.dataAccessObject.stylesHandler.getDefaultRowHeight();let o,s,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;n;)n-=1,o=this.getColumnHeaderHeight(n),s=this.getColumnHeader(r,n),s&&(a=fd(s),(!o&&i<a||o<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=a),Array.isArray(l)?l[n]!==null&&l[n]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]<(l[n]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,r=this.THEAD.childNodes,n=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let o=0,s=i.length;o<s;o++)if(n[o]){if(!r[o]||r[o].childNodes.length===0)return;r[o].childNodes[0].style.height=`${n[o]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:r}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(Ro))&&!e.getSetting("externalRowCalculator")){const n=this.getRenderedRowsCount();for(let i=0;i<n;i++){const o=this.rowFilter.renderedToSource(i);r.oversizedRows&&r.oversizedRows[o]&&(r.oversizedRows[o]=void 0)}}}getCell(e){let r=e.row,n=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",r,n,!this.isMaster,"render");if(i&&Array.isArray(i)&&([r,n]=i),this.isRowBeforeRenderedRows(r))return-1;if(this.isRowAfterRenderedRows(r))return-2;if(this.isColumnBeforeRenderedColumns(n))return-3;if(this.isColumnAfterRenderedColumns(n))return-4;const o=this.getRow(r);if(!o&&r>=0)throw new Error("TR was expected to be rendered but is not");const s=o.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(n)];if(!s&&n>=0)throw new Error("TD or TH was expected to be rendered but is not");return s}getRow(e){let r=null,n=null;if(e<0){var i;r=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),n=this.THEAD}else{var o;r=(o=this.rowFilter)===null||o===void 0?void 0:o.sourceToRendered(e),n=this.TBODY}return r!==void 0&&n!==void 0?n.childNodes.length<r+1?!1:n.childNodes[r]:!1}getColumnHeader(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.THEAD.childNodes[r];return n==null?void 0:n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const r=[],n=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const o=i.childNodes[n];o&&r.push(o)}),r}getRowHeader(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.wtSettings.getSetting("rowHeaders").length;if(r>=n)return;const i=this.rowFilter.sourceToRendered(e),o=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,a=(i<0?this.THEAD:this.TBODY).childNodes[o];return a==null?void 0:a.childNodes[r]}getRowHeaders(e){const r=[],n=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<n;i++){const o=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],s=o==null?void 0:o.childNodes[i];s&&r.push(s)}return r}getCoords(e){let r=e;if(r.nodeName!=="TD"&&r.nodeName!=="TH"&&(r=$l(r,["TD","TH"])),r===null)return null;const n=r.parentNode;if(!n)return null;const i=n.parentNode;let o=m3(n),s=r.cellIndex;Ha(Ul,r,this.wtRootElement)||Ha(Bl,r,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):Ha(ma,r,this.wtRootElement)||Ha(Ro,r,this.wtRootElement)?o=this.wtSettings.getSetting("totalRows")-i.childNodes.length+o:i===this.THEAD?o=this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter&&(o=this.rowFilter.renderedToSource(o)),Ha(Ul,r,this.wtRootElement)||Ha(jl,r,this.wtRootElement)||Ha(ma,r,this.wtRootElement)?s=this.columnFilter.offsettedTH(s):this.columnFilter&&(s=this.columnFilter.visibleRowHeadedColumnToSourceColumn(s));const a=this.wtSettings.getSetting("onModifyGetCoordsElement",o,s);return a&&Array.isArray(a)&&([o,s]=a),this.wot.createCellCoords(o,s)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const r=e*this.dataAccessObject.stylesHandler.getDefaultRowHeight(),n=fd(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?fr:fd,s=i?0:1,a=i?1:0;let l,u,c,h,d;if(!(r===n&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;){e-=1,c=this.rowFilter.renderedToSource(e),l=this.getRowHeight(c),h=this.getTrForRow(c),d=h.querySelector("th");const f=c===0?a:0;d?u=o(d):u=o(h)-s,(!l&&this.dataAccessObject.stylesHandler.getDefaultRowHeight()<u-f||l<u)&&(i||(u+=1),this.dataAccessObject.wtViewport.oversizedRows[c]=u)}}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const n=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=n}isRowHeaderRendered(e){if(e>=0)return!1;const n=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=n}isRowBeforeRenderedRows(e){const r=this.getFirstRenderedRow();return e<0&&r<=0?!this.isRowHeaderRendered(e):e<r}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const r=this.getFirstRenderedColumn();return e<0&&r<=0?!this.isColumnHeaderRendered(e):e<r}isColumnAfterRenderedColumns(e){return this.columnFilter&&e>this.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return nr(this.TABLE)}getHeight(){return fr(this.TABLE)}getTotalWidth(){const e=nr(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=fr(this.hider);return e!==0?e:this.getHeight()}isVisible(){return yc(this.TABLE)}_modifyRowHeaderWidth(e){let r=mt(e)?e():null;return Array.isArray(r)?(r=[...r],r[r.length-1]=this._correctRowHeaderWidth(r[r.length-1])):r=this._correctRowHeaderWidth(r),r}_correctRowHeaderWidth(e){let r=e;return typeof e!="number"&&(r=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(r+=1),r}}const x6="stickyRowsBottom",Z0={getFirstRenderedRow(){const t=this.getRenderedRowsCount();return t===0?-1:this.wtSettings.getSetting("totalRows")-t},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()===0?-1:this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsBottom"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};xs(Z0,"MIXIN_NAME",x6,{writable:!1,enumerable:!1});const A6="stickyColumnsStart",Tw={getFirstRenderedColumn(){return this.getRenderedColumnsCount()===0?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){return Math.min(this.wtSettings.getSetting("totalColumns"),this.wtSettings.getSetting("fixedColumnsStart"))},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};xs(Tw,"MIXIN_NAME",A6,{writable:!1,enumerable:!1});class J0 extends Lc{constructor(e,r,n,i){super(e,r,n,i,ma)}}yt(J0,Z0);yt(J0,Tw);const Bl="top",Ro="bottom",jl="inline_start",Ul="top_inline_start_corner",ma="bottom_inline_start_corner",tF=[Bl,Ro,jl,Ul,ma],H6=new Map([[Bl,`ht_clone_${Bl}`],[Ro,`ht_clone_${Ro}`],[jl,`ht_clone_${jl} ht_clone_left`],[Ul,`ht_clone_${Ul} ht_clone_top_left_corner`],[ma,`ht_clone_${ma} ht_clone_bottom_left_corner`]]);function N6(t,e){D6(t,e),e.add(t)}function D6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function k6(t,e,r){return(e=L6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L6(t){var e=$6(t,"string");return typeof e=="symbol"?e:e+""}function $6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qf(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var gh=new WeakSet;class F6{constructor(e){N6(this,gh),k6(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,r,n){if(e.col<0||e.row<0)return!1;const i=this.scrollViewportHorizontally(e.col,r),o=this.scrollViewportVertically(e.row,n);return i||o}scrollViewportHorizontally(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:n,totalColumns:i}=this.dataAccessObject;if(!n)return!1;const o=Bn(r);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,o),!Number.isInteger(e)||e<0||e>i)return!1;r=o.value;const{fixedColumnsStart:s,inlineStartOverlay:a}=this.dataAccessObject,l=r==="auto";if(l&&e<s)return!1;const u=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let h=!1;return(l&&(e<u||e>c)||!l)&&(h=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleColumn():r==="end")),h}scrollViewportVertically(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:n,totalRows:i}=this.dataAccessObject;if(!n)return!1;const o=Bn(r);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,o),!Number.isInteger(e)||e<0||e>i)return!1;r=o.value;const{fixedRowsBottom:s,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject,u=r==="auto";if(u&&(e<a||e>i-s-1))return!1;const c=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let d=!1;return(u&&(e<c||e>h)||!u)&&(d=l.scrollTo(e,u?e>=this.getLastPartiallyVisibleRow():r==="bottom")),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return qf(gh,this,AA).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return qf(gh,this,AA).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return qf(gh,this,xA).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return qf(gh,this,xA).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function xA(t){const{wtSettings:e,inlineStartOverlay:r,wtTable:n,wtViewport:i,totalColumns:o,rootWindow:s}=this.dataAccessObject;if(r.mainTableScrollableElement===s){const a=e.getSetting("rtlMode");let l=null;if(a){const c=n.TABLE.getBoundingClientRect(),d=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(c.right-d)}else l=jr(n.wtRootElement).left;const u=Math.abs(y$(s,s));if(l>u){const c=C$(s);let h=i.getRowHeaderWidth();for(let d=1;d<=o;d++)if(h+=r.sumCellSizes(d-1,d),l+h-u>=c){t=d-2;break}}}return t}function AA(t){const{topOverlay:e,wtTable:r,wtViewport:n,totalRows:i,rootWindow:o}=this.dataAccessObject;if(e.mainTableScrollableElement===o){const s=jr(r.wtRootElement),a=B0(o,o);if(s.top>a){const l=fd(o);let u=n.getColumnHeaderHeight();for(let c=1;c<=i;c++)if(u+=e.sumCellSizes(c-1,c),s.top+u-a>=l){t=c-2;break}}}return t}function Xn(t,e,r){return(e=V6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function V6(t){var e=W6(t,"string");return typeof e=="symbol"?e:e+""}function W6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Q0{get eventManager(){return new ji(this)}constructor(e,r){Xn(this,"wtTable",void 0),Xn(this,"wtScroll",void 0),Xn(this,"wtViewport",void 0),Xn(this,"wtOverlays",void 0),Xn(this,"selectionManager",void 0),Xn(this,"wtEvent",void 0),Xn(this,"guid",`wt_${s$()}`),Xn(this,"drawInterrupted",!1),Xn(this,"drawn",!1),Xn(this,"activeOverlayName","master"),Xn(this,"domBindings",void 0),Xn(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=r,this.wtScroll=new F6(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let r=0,n=this.wtTable.THEAD.childNodes[0].childNodes.length;r<n;r++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[r].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(r,n){Fl(n,e[r])}])}}createCellCoords(e,r){return new Wl(e,r,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,r,n){return new pf(e,r,n,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,!this.wtTable.isVisible()||w3(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const n=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),o=this.wtSettings.getSetting("fixedRowsBottom"),s=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<s)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<s&&e.row>=n-o){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<s)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<n&&e.row>=n-o&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,r,n){return this.wtScroll.scrollViewport(e,r,n)}scrollViewportHorizontally(e,r){return this.wtScroll.scrollViewportHorizontally(e,r)}scrollViewportVertically(e,r){return this.wtScroll.scrollViewportVertically(e,r)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get stylesHandler(){return e.stylesHandler},get drawn(){return e.drawn},set drawn(r){e.drawn=r},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function HA(t,e,r){return(e=B6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B6(t){var e=j6(t,"string");return typeof e=="symbol"?e:e+""}function j6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class U6 extends Q0{constructor(e,r,n){super(e,r),HA(this,"cloneSource",void 0),HA(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=n.source,this.cloneOverlay=n.overlay,this.stylesHandler=n.stylesHandler,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=n.viewport,this.selectionManager=n.selectionManager,this.wtEvent=new J$(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,n.event),this.findOriginalHeaders()}}function z6(t,e,r){return(e=Y6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y6(t){var e=G6(t,"string");return typeof e=="symbol"?e:e+""}function G6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vf{constructor(e,r,n,i,o){z6(this,"wtSettings",null),xs(this,"wot",e,{writable:!1}),this.domBindings=o,this.facadeGetter=r,this.wtSettings=i;const{TABLE:s,hider:a,spreader:l,holder:u,wtRootElement:c}=this.wot.wtTable;this.instance=this.wot,this.type=n,this.mainTableScrollableElement=null,this.TABLE=s,this.hider=a,this.spreader=l,this.holder=u,this.wtRootElement=c,this.trimmingContainer=$d(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){e==="before"&&this.shouldBeRendered()?this.needFullRender=!0:e==="after"&&!this.shouldBeRendered()&&(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=$d(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:r}=this.domBindings;r.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=sp(e.TABLE)}getRelativeCellPosition(e,r,n){if(this.clone.wtTable.holder.contains(e)===!1){it(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,o=n<this.wtSettings.getSetting("fixedColumnsStart"),s=r<this.wtSettings.getSetting("fixedRowsTop"),a=r>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,u={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(s,o,c,u):h=this.getRelativeCellPositionWithinHolder(s,a,o,c,u),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,r,n,i){const o=this.wot.wtTable.wtRootElement.getBoundingClientRect();let s=0,a=0;if(!r)s=i.start;else{let l=o.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(o.left+o.width+Or())),s=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-o.top:a=i.top,{start:n.start+s,top:n.top+a}}getRelativeCellPositionWithinHolder(e,r,n,i,o){const s={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(n||(a=s.horizontal-o.start),r){const u=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+u.top}else e||(l=s.vertical-o.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(tF.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,o=n.createElement("div"),s=n.createElement("table"),a=e.wtRootElement.parentNode;o.className=`${H6.get(this.type)} handsontable`,o.setAttribute("dir",this.isRtl()?"rtl":"ltr"),o.style.position="absolute",o.style.top=0,o.style.overflow="visible",this.isRtl()?o.style.right=0:o.style.left=0,r.getSetting("ariaTags")&&Pe(o,[ms()]),s.className=e.TABLE.className,e.TABLE.getAttribute("role")&&s.setAttribute("role",e.TABLE.getAttribute("role")),o.appendChild(s),a.appendChild(o);const u=this.wtSettings.getSetting("preventOverflow");return u===!0||u==="horizontal"&&this.type===Bl||u==="vertical"&&this.type===jl?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=sp(e.TABLE),new U6(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager,stylesHandler:this.wot.stylesHandler})}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.needFullRender){const r=this.clone.cloneSource;r.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),r.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,r=this.clone.wtTable.hider,n=e.style,i=r.style,o=e.parentNode.style;[n,i,o].forEach(s=>{s.width="",s.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class q6 extends vf{constructor(e,r,n,i,o,s){super(e,r,ma,n,i),this.bottomOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new J0(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;const r=this.clone.wtTable.holder.parentNode;if(r.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const o=this.inlineStartOverlay.getOverlayOffset(),s=this.bottomOverlay.getOverlayOffset();r.style[this.isRtl()?"right":"left"]=`${o}px`,r.style.bottom=`${s}px`}else Cw(r),this.repositionOverlay();let n=fr(this.clone.wtTable.TABLE);const i=nr(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),r.style.height=`${n}px`,r.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;r.hasVerticalScroll()||(o+=r.getWorkspaceHeight()-e.getTotalHeight()),r.hasVerticalScroll()&&r.hasHorizontalScroll()&&(o+=Or(n)),i.style.bottom=`${o}px`}}const K6="calculatedColumns",_w={getFirstRenderedColumn(){const t=this.dataAccessObject.startColumnRendered;return t===null?-1:t},getFirstVisibleColumn(){const t=this.dataAccessObject.startColumnVisible;return t===null?-1:t},getFirstPartiallyVisibleColumn(){const t=this.dataAccessObject.startColumnPartiallyVisible;return t===null?-1:t},getLastRenderedColumn(){const t=this.dataAccessObject.endColumnRendered;return t===null?-1:t},getLastVisibleColumn(){const t=this.dataAccessObject.endColumnVisible;return t===null?-1:t},getLastPartiallyVisibleColumn(){const t=this.dataAccessObject.endColumnPartiallyVisible;return t===null?-1:t},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};xs(_w,"MIXIN_NAME",K6,{writable:!1,enumerable:!1});class eT extends Lc{constructor(e,r,n,i){super(e,r,n,i,Ro)}}yt(eT,Z0);yt(eT,_w);function X6(t,e,r){return(e=Z6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z6(t){var e=J6(t,"string");return typeof e=="symbol"?e:e+""}function J6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Q6 extends vf{constructor(e,r,n,i){super(e,r,Ro,n,i),X6(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new eT(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,r=this.clone.wtTable.holder.parentNode;r.style.top="";let n=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(n=this.getOverlayOffset(),r.style.bottom=`${n}px`):(n=this.getScrollPosition(),this.repositionOverlay());const o=this.adjustHeaderBordersPosition(n);return this.adjustElementsSize(),o}repositionOverlay(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;r.hasVerticalScroll()||(o+=r.getWorkspaceHeight()-e.getTotalHeight()),r.hasVerticalScroll()&&r.hasHorizontalScroll()&&(o+=Or(n)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:r}=this.domBindings,n=this.mainTableScrollableElement;let i=!1;if(n===r&&e!==r.scrollY){const o=r.scrollY;r.scrollTo(W0(r),top),i=o!==r.scrollY}else if(e!==n.scrollTop){const o=n.scrollTop;n.scrollTop=e,i=o!==n.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,r){const{wtTable:n,stylesHandler:i}=this.wot,o=i.getDefaultRowHeight();let s=e,a=0;for(;s<r;){const l=n.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=r.getWorkspaceWidth();r.hasVerticalScroll()&&(u-=Or(n)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=fr(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:r}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?r.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:r.style[e]=""}scrollTo(e,r){let n=this.getTableParentOffset();const o=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let s=0;r&&o.offsetHeight!==o.clientHeight&&(s=Or(this.domBindings.rootDocument)),r?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight(),n+=1):n+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),n+=s,this.setScrollPosition(n)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return B0(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o,a=this.domBindings.rootDocument.documentElement.clientHeight;n=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),n>s&&(n=0)}return n}adjustHeaderBordersPosition(e){const r=this.wtSettings.getSetting("fixedRowsBottom"),n=this.cachedFixedRowsBottom!==r,i=this.wtSettings.getSetting("columnHeaders");let o=!1;if((n||r===0)&&i.length>0){const s=this.wot.wtTable.holder.parentNode,a=_e(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(ie(s,"innerBorderBottom"),o=!a):(Ee(s,"innerBorderBottom"),o=a)}return o}}const e5="calculatedRows",tT={getFirstRenderedRow(){const t=this.dataAccessObject.startRowRendered;return t===null?-1:t},getFirstVisibleRow(){const t=this.dataAccessObject.startRowVisible;return t===null?-1:t},getFirstPartiallyVisibleRow(){const t=this.dataAccessObject.startRowPartiallyVisible;return t===null?-1:t},getLastRenderedRow(){const t=this.dataAccessObject.endRowRendered;return t===null?-1:t},getLastVisibleRow(){const t=this.dataAccessObject.endRowVisible;return t===null?-1:t},getLastPartiallyVisibleRow(){const t=this.dataAccessObject.endRowPartiallyVisible;return t===null?-1:t},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};xs(tT,"MIXIN_NAME",e5,{writable:!1,enumerable:!1});class rT extends Lc{constructor(e,r,n,i){super(e,r,n,i,jl)}}yt(rT,tT);yt(rT,Tw);const t5="localHooks",Hr={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,r,n,i,o,s){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)GR(this._localHooks[t][l],this,e,r,n,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};xs(Hr,"MIXIN_NAME",t5,{writable:!1,enumerable:!1});let rF=class{constructor(e,r){this.settings=e,this.cellRange=r||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,r){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=r,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=r,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),r=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,r.row,r.col]}destroy(){this.runLocalHooks("destroy")}};yt(rF,Hr);const nF="active-header",nT="header",iT="area",gd="focus",r5="fill",n5="row",i5="column",o5="custom-selection",oT=t=>{const e=t.stylesHandler;if(e.isClassicTheme())return Object.freeze({width:6,height:6,borderWidth:1,borderStyle:"solid",borderColor:"#FFF"});const r=e.getCSSVariableValue("cell-autofill-size"),n=e.getCSSVariableValue("cell-autofill-border-width"),i=e.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:r,height:r,borderWidth:n,borderStyle:"solid",borderColor:i})};var NA={},DA;function s5(){if(DA)return NA;DA=1;var t=Rw();return t("flat"),NA}s5();function a5(t,e){iF(t,e),e.add(t)}function kA(t,e,r){iF(t,e),e.set(t,r)}function iF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jt(t,e){return t.get(md(t,e))}function LA(t,e,r){return t.set(md(t,e),r),r}function md(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ti=new WeakMap,Fr=new WeakMap,Kf=new WeakSet;class l5{constructor(){a5(this,Kf),kA(this,Ti,void 0),kA(this,Fr,void 0)}setActiveOverlay(e){return LA(Fr,this,e),this}setActiveSelection(e){return LA(Ti,this,e),this}scan(){const e=jt(Ti,this).settings.selectionType,r=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n))):e==="area"?this.scanCellsRange(n=>r.add(n)):e==="focus"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n)),this.scanCellsRange(n=>r.add(n))):e==="fill"?this.scanCellsRange(n=>r.add(n)):e==="header"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n))):e==="row"?(this.scanRowsInHeadersRange(n=>r.add(n)),this.scanRowsInCellsRange(n=>r.add(n))):e==="column"&&(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanColumnsInCellsRange(n=>r.add(n))),r}scanColumnsInHeadersRange(e){const[r,n,i,o]=jt(Ti,this).getCorners(),{wtTable:s}=jt(Fr,this),a=s.getRenderedColumnsCount(),l=s.getColumnHeadersCount();let u=0;for(let c=-s.getRowHeadersCount();c<a;c++){const h=s.columnFilter.renderedToSource(c);if(!(h<n||h>o)){for(let d=-l;d<0;d++){if(d<r||d>i)continue;const f=d+l;let g=s.getColumnHeader(h,f);const w=jt(Fr,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:jt(Ti,this).settings.selectionType,columnCursor:u,selectionWidth:o-n+1});w!==null&&(w!==h&&(g=s.getColumnHeader(w,f)),e(g))}u+=1}}}scanRowsInHeadersRange(e){const[r,n,i,o]=jt(Ti,this).getCorners(),{wtTable:s}=jt(Fr,this),a=s.getRenderedRowsCount(),l=s.getRowHeadersCount();let u=0;for(let c=-s.getColumnHeadersCount();c<a;c++){const h=s.rowFilter.renderedToSource(c);if(!(h<r||h>i)){for(let d=-l;d<0;d++){if(d<n||d>o)continue;const f=d+l;let g=s.getRowHeader(h,f);const w=jt(Fr,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:jt(Ti,this).settings.selectionType,rowCursor:u,selectionHeight:i-r+1});w!==null&&(w!==h&&(g=s.getRowHeader(w,f)),e(g))}u+=1}}}scanCellsRange(e){const{wtTable:r}=jt(Fr,this);md(Kf,this,u5).call(this,(n,i)=>{const o=r.getCell(jt(Fr,this).createCellCoords(n,i)),s=jt(Fr,this).getSetting("onAfterDrawSelection",n,i,jt(Ti,this).settings.layerLevel);typeof s=="string"&&ie(o,s),e(o)})}scanRowsInCellsRange(e){const[r,,n]=jt(Ti,this).getCorners(),{wtTable:i}=jt(Fr,this);md(Kf,this,$A).call(this,(o,s)=>{if(o>=r&&o<=n){const a=i.getCell(jt(Fr,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,r,,n]=jt(Ti,this).getCorners(),{wtTable:i}=jt(Fr,this);md(Kf,this,$A).call(this,(o,s)=>{if(s>=r&&s<=n){const a=i.getCell(jt(Fr,this).createCellCoords(o,s));e(a)}})}}function u5(t){let[e,r,n,i]=jt(Ti,this).getCorners();if(e<0&&n<0||r<0&&i<0)return;const{wtTable:o}=jt(Fr,this),s=e!==n||r!==i;if(r=Math.max(r,0),i=Math.max(i,0),e=Math.max(e,0),n=Math.max(n,0),s){if(r=Math.max(r,o.getFirstRenderedColumn()),i=Math.min(i,o.getLastRenderedColumn()),e=Math.max(e,o.getFirstRenderedRow()),n=Math.min(n,o.getLastRenderedRow()),i<r||n<e)return}else{const a=o.getCell(jt(Fr,this).createCellCoords(e,r));if(!Rs(a))return}for(let a=e;a<=n;a+=1)for(let l=r;l<=i;l+=1)t(a,l)}function $A(t){const{wtTable:e}=jt(Fr,this),r=e.getRenderedRowsCount(),n=e.getRenderedColumnsCount();for(let i=0;i<r;i+=1){const o=e.rowFilter.renderedToSource(i);for(let s=0;s<n;s+=1)t(o,e.columnFilter.renderedToSource(s))}}class FA{constructor(e,r){r&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=r,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=oT(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(r),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let r=0,n=this.main.childNodes.length;r<n;r++){const i=this.main.childNodes[r];this.eventManager.addEventListener(i,"mouseenter",o=>this.onMouseEnter(o,this.main.childNodes[r]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,r){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),Yi(e);const n=this,i=this.wot.rootDocument.body,o=r.getBoundingClientRect();r.style.display="none";function s(l){if(l.clientY<Math.floor(o.top)||l.clientY>Math.ceil(o.top+o.height)||l.clientX<Math.floor(o.left)||l.clientX>Math.ceil(o.left+o.width))return!0}function a(l){s(l)&&(n.eventManager.removeEventListener(i,"mousemove",a),r.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:r}=this.wot;this.main=r.createElement("div");const n=["top","start","bottom","end","corner"];let i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let a=0;a<5;a++){const l=n[a],u=r.createElement("div");u.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(u.className+=" hidden"),i=u.style,i.backgroundColor=this.settings[l]&&this.settings[l].color?this.settings[l].color:e.border.color,i.height=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,i.width=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,this.main.appendChild(u)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=`${this.cornerDefaultStyle.width}px`,this.cornerStyle.height=`${this.cornerDefaultStyle.height}px`,this.cornerStyle.border=[`${this.cornerDefaultStyle.borderWidth}px`,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),ps()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:o}=this.wot;let s=o.bordersHolder;s||(s=r.createElement("div"),s.className="htBorders",o.bordersHolder=s,o.spreader.appendChild(s)),s.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e,stylesHandler:r}=this.wot,n=r.getCSSVariableValue("cell-mobile-handle-size"),i=r.getCSSVariableValue("cell-mobile-handle-border-radius"),o=r.getCSSVariableValue("cell-mobile-handle-background-color"),s=r.getCSSVariableValue("cell-mobile-handle-border-width"),a=r.getCSSVariableValue("cell-mobile-handle-border-color");this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const l=10,u=40;this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const c={position:"absolute",height:`${u}px`,width:`${u}px`,"border-radius":`${parseInt(u/1.5,10)}px`};We(c,(d,f)=>{this.selectionHandles.styles.bottomHitArea[f]=d,this.selectionHandles.styles.topHitArea[f]=d});const h=r.isClassicTheme()?{position:"absolute",height:`${l}px`,width:`${l}px`,"border-radius":`${parseInt(l/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"}:{position:"absolute",height:`${n}px`,width:`${n}px`,"border-radius":`${i}px`,background:`${o}`,border:`${s}px solid ${a}`};We(h,(d,f)=>{this.selectionHandles.styles.bottom[f]=d,this.selectionHandles.styles.top[f]=d}),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,r){const n=this.wot.selectionManager.getAreaSelection();return!!(n.cellRange&&(e!==n.cellRange.to.row||r!==n.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,r,n,i,o,s){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:u,topHitArea:c,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,f=parseInt(u.borderWidth,10),g=parseInt(u.width,10),w=parseInt(c.width,10),v=this.wot.wtTable.getWidth(),b=this.wot.wtTable.getHeight();u.top=`${parseInt(n-g-1,10)}px`,u[l]=`${parseInt(i-g-1,10)}px`,c.top=`${parseInt(n-w/4*3,10)}px`,c[l]=`${parseInt(i-w/4*3,10)}px`;const p=Math.min(parseInt(i+o,10),v-g-f*2),_=Math.min(parseInt(i+o-w/4,10),v-w-f*2);h[l]=`${p}px`,d[l]=`${_}px`;const O=Math.min(parseInt(n+s,10),b-g-f*2),T=Math.min(parseInt(n+s-w/4,10),b-w-f*2);h.top=`${O}px`,d.top=`${T}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(u.display="block",c.display="block",this.isPartRange(e,r)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(u.display="none",h.display="none",c.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||r===this.wot.wtSettings.getSetting("fixedColumnsStart")?(u.zIndex="9999",c.zIndex="9999"):(u.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;let[r,n,i,o]=e;if(r<0&&i<0||n<0&&o<0){this.disappear();return}const{wtTable:s,rootDocument:a,rootWindow:l}=this.wot,u=r!==i||n!==o,c=s.getFirstRenderedRow(),h=s.getLastRenderedRow(),d=s.getFirstRenderedColumn(),f=s.getLastRenderedColumn();if(d<0&&f<0||c<0&&h<0){this.disappear();return}let g;if(u){if(n=Math.max(n,d),o=Math.min(o,f),r=Math.max(r,c),i=Math.min(i,h),o<n||i<r){this.disappear();return}g=s.getCell(this.wot.createCellCoords(r,n))}else if(g=s.getCell(this.wot.createCellCoords(r,n)),!Rs(g)){this.disappear();return}const w=u?s.getCell(this.wot.createCellCoords(i,o)):g,v=jr(g),b=u?jr(w):v,p=jr(s.TABLE),_=v.top,O=v.left,T=this.wot.wtSettings.getSetting("rtlMode");let M=0,P=0;if(T){const ee=nr(s.TABLE),te=nr(g),ae=l.innerWidth-p.left-ee;P=O+te-b.left,M=l.innerWidth-O-te-ae-1}else P=b.left+nr(w)-O,M=O-p.left-1;if(this.isEntireColumnSelected(r,i)){const ee=r,te=this.getDimensionsFromHeader("columns",n,o,ee,p);let ae=null;te&&([ae,M,P]=te),ae&&(g=ae)}let G=_-p.top-1,j=b.top+fr(w)-_;if(this.isEntireRowSelected(n,o)){const ee=n,te=this.getDimensionsFromHeader("rows",r,i,ee,p);let ae=null;te&&([ae,G,j]=te),ae&&(g=ae)}const A=l.getComputedStyle(g);parseInt(A.borderTopWidth,10)>0&&(G+=1,j=j>0?j-1:0),parseInt(A[T?"borderRightWidth":"borderLeftWidth"],10)>0&&(M+=1,P=P>0?P-1:0);const q=T?"right":"left";this.topStyle.top=`${G}px`,this.topStyle[q]=`${M}px`,this.topStyle.width=`${P}px`,this.topStyle.display="block",this.startStyle.top=`${G}px`,this.startStyle[q]=`${M}px`,this.startStyle.height=`${j}px`,this.startStyle.display="block";const Q=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${G+j-Q}px`,this.bottomStyle[q]=`${M}px`,this.bottomStyle.width=`${P}px`,this.bottomStyle.display="block",this.endStyle.top=`${G}px`,this.endStyle[q]=`${M+P-Q}px`,this.endStyle.height=`${j+1}px`,this.endStyle.display="block";let ue=this.settings.border.cornerVisible;ue=typeof ue=="function"?ue(this.settings.layerLevel):ue;const J=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[Z,ne]=[i,o];if(J&&Array.isArray(J)&&([,,Z,ne]=J),ps()||!ue||this.isPartRange(Z,ne))this.cornerStyle.display="none";else{this.cornerStyle.top=`${G+j+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[q]=`${M+P+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderRightWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderLeftWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderBottomWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let ee=$d(s.TABLE);const te=ee===l;te&&(ee=a.documentElement);const ae=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,z=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),$=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const m=te?w.getBoundingClientRect().left:w.offsetLeft;let C=!1,y=0;T?(y=m-parseInt(this.cornerDefaultStyle.width,10)/2,C=y<0):(y=m+nr(w)+parseInt(this.cornerDefaultStyle.width,10)/2,C=y>=C$(ee)),C&&(this.cornerStyle[q]=`${Math.floor(M+P+this.cornerCenterPointOffset-z-ae)}px`,this.cornerStyle[T?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const y=(te?w.getBoundingClientRect().top:w.offsetTop)+fr(w)+parseInt(this.cornerDefaultStyle.height,10)/2>=fd(ee),I=this.wot.stylesHandler.isClassicTheme();if(y){const x=Math.floor(G+j+this.cornerCenterPointOffset-$-ae);I?(this.cornerStyle.top=`${x}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${x-1}px`}}this.cornerStyle.display="block"}ps()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,G,M,P,j)}isEntireColumnSelected(e,r){return e===this.wot.wtTable.getFirstRenderedRow()&&r===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,r){return e===this.wot.wtTable.getFirstRenderedColumn()&&r===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,r,n,i,o){const{wtTable:s}=this.wot,a=s.wtRootElement.parentNode;let l=null,u=null,c=null,h=null,d=null,f=null,g=null,w=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return fr(...arguments)},c="ht__selection--rows",f="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return nr(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const v=this.wot.getSetting("columnHeaders").length;if(g=l(r,v-i),w=l(n,v-i),!g||!w)return!1;const b=jr(g),p=jr(w);return g&&w&&(h=b[f]-o[f]-1,d=p[f]+u(w)-b[f]),[g,h,d]}return!1}changeBorderStyle(e,r){const n=this[e].style,i=r[e];!i||i.hide?ie(this[e],"hidden"):(_e(this[e],"hidden")&&Ee(this[e],"hidden"),n.backgroundColor=i.color,(e==="top"||e==="bottom")&&(n.height=`${i.width}px`),(e==="start"||e==="end")&&(n.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const r={width:1,color:"#000"},n=this[e].style;n.backgroundColor=r.color,n.width=`${r.width}px`,n.height=`${r.width}px`}toggleHiddenClass(e,r){this.changeBorderToDefaultStyle(e),r?ie(this[e],"hidden"):Ee(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",ps()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}function c5(t,e){oF(t,e),e.add(t)}function du(t,e,r){oF(t,e),e.set(t,r)}function oF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(t,e){return t.get(sT(t,e))}function VA(t,e,r){return t.set(sT(t,e),r),r}function sT(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Vr=new WeakMap,vn=new WeakMap,vb=new WeakMap,rd=new WeakMap,yb=new WeakMap,ka=new WeakMap,WA=new WeakSet;class h5{constructor(e){c5(this,WA),du(this,Vr,void 0),du(this,vn,void 0),du(this,vb,new l5),du(this,rd,new WeakMap),du(this,yb,new WeakSet),du(this,ka,new Map),VA(vn,this,e)}setActiveOverlay(e){return VA(Vr,this,e),Le(vb,this).setActiveOverlay(Le(Vr,this)),Le(rd,this).has(Le(Vr,this))||Le(rd,this).set(Le(Vr,this),new Set),this}getFocusSelection(){return Le(vn,this)!==null?Le(vn,this).getFocus():null}getAreaSelection(){return Le(vn,this)!==null?Le(vn,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Le(ka,this).has(e)){const n=Le(ka,this).get(e);if(n.has(Le(Vr,this)))return n.get(Le(Vr,this));const i=new FA(Le(Vr,this),e.settings);return n.set(Le(Vr,this),i),i}const r=new FA(Le(Vr,this),e.settings);return Le(ka,this).set(e,new Map([[Le(Vr,this),r]])),r}getBorderInstances(e){var r,n;return Array.from((r=(n=Le(ka,this).get(e))===null||n===void 0?void 0:n.values())!==null&&r!==void 0?r:[])}destroyBorders(e){Le(ka,this).get(e).forEach(r=>r.destroy()),Le(ka,this).delete(e)}render(e){if(Le(vn,this)===null)return;e&&sT(WA,this,d5).call(this);const r=Array.from(Le(vn,this)),n=new Map,i=new Map;for(let o=0;o<r.length;o++){const s=r[o],{className:a,headerAttributes:l,createLayers:u,selectionType:c}=s.settings;Le(yb,this).has(s)||(Le(yb,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h==null||h.disappear();continue}a&&Le(vb,this).setActiveSelection(s).scan().forEach(g=>{if(n.has(g)){const w=n.get(g);w.has(a)&&u===!0?w.set(a,w.get(a)+1):w.set(a,1)}else n.set(g,new Map([[a,1]]));l&&(i.has(g)||i.set(g,[]),g.nodeName==="TH"&&i.get(g).push(...l))});const d=s.getCorners();Le(Vr,this).getSetting("onBeforeDrawBorders",d,c),h==null||h.appear(d)}n.forEach((o,s)=>{var a;const l=Array.from(o).map(u=>{let[c,h]=u;return h===1?c:[c,...Array.from({length:h-1},(d,f)=>`${c}-${f+1}`)]}).flat();l.forEach(u=>Le(rd,this).get(Le(Vr,this)).add(u)),ie(s,l),s.nodeName==="TD"&&Array.isArray((a=Le(vn,this).options)===null||a===void 0?void 0:a.cellAttributes)&&Pe(s,Le(vn,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{Pe(o,[...i.get(o)])})}}function d5(){const t=Le(rd,this).get(Le(Vr,this)),e=Le(Vr,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let r=0;r<e.length;r++)t.add(e[r]);t.forEach(r=>{var n,i;const o=Le(Vr,this).wtTable.TABLE.querySelectorAll(`.${r}`);let s=[];Array.isArray((n=Le(vn,this).options)===null||n===void 0?void 0:n.cellAttributes)&&(s=Le(vn,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=Le(vn,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...Le(vn,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)Ee(o[a],r),Dc(o[a],s)}),t.clear()}class f5 extends vf{constructor(e,r,n,i){super(e,r,jl,n,i)}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new rT(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:r}=this.domBindings,n=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let o=0;this.trimmingContainer===r&&(!i||i!=="horizontal")?(o=this.getOverlayOffset()*(this.isRtl()?-1:1),j0(n,`${o}px`,"0px")):(o=this.getScrollPosition(),Cw(n));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:r}=this.domBindings;let n=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===r&&e!==r.scrollX){const o=r.scrollX;r.scrollTo(e,v$(r)),n=o!==r.scrollX}else if(e!==i.scrollLeft){const o=i.scrollLeft;i.scrollLeft=e,n=o!==i.scrollLeft}return n}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,r){const n=this.wtSettings.getSetting("defaultColumnWidth");let i=e,o=0;for(;i<r;)o+=this.wot.wtTable.getColumnWidth(i)||n,i+=1;return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=r.getWorkspaceHeight();r.hasHorizontalScroll()&&(u-=Or(n)),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=nr(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,r=oT(this.wot),n=this.wot.selectionManager.getFocusSelection()?parseInt(r.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+n}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),r=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[r]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[r]="0";else throw new Error("Incorrect value of the columnsRenderCalculator");this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.clone.wtTable.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:this.clone.wtTable.spreader.style.top=""}scrollTo(e,r){const{wtSettings:n}=this,i=n.getSetting("rowHeaders"),o=n.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=o===0&&i.length>0&&!_e(a.parentNode,"innerBorderInlineStart")?1:0;let u=this.getTableParentOffset(),c=0;if(r){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(r=!1)}return r&&a.offsetWidth!==a.clientWidth&&(c=Or(this.domBindings.rootDocument)),r?(u+=this.sumCellSizes(0,e+1),u-=this.wot.wtViewport.getViewportWidth(),u+=l):u+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),u+=c,y3(this.mainTableScrollableElement)===u-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(u)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let r=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(r=this.wot.wtTable.holderOffset.left),r}getScrollPosition(){return Math.abs(y$(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="horizontal")){this.isRtl()?n=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),o=this.clone.wtTable.getTotalWidth(),s=i-o;n>s&&(n=0)}return n}adjustHeaderBordersPosition(e){const{wtSettings:r}=this,n=this.wot.wtTable.holder.parentNode,i=r.getSetting("rowHeaders"),o=r.getSetting("fixedColumnsStart"),s=r.getSetting("totalRows"),a=r.getSetting("preventOverflow")==="vertical";s?Ee(n,"emptyRows"):ie(n,"emptyRows");let l=!1;if(!a){if(o&&!i.length)ie(n,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=_e(n,"innerBorderInlineStart");e?(ie(n,"innerBorderLeft innerBorderInlineStart"),l=!u):(Ee(n,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const g5="stickyRowsTop",aT={getFirstRenderedRow(){return this.getRenderedRowsCount()===0?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsTop"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};xs(aT,"MIXIN_NAME",g5,{writable:!1,enumerable:!1});class lT extends Lc{constructor(e,r,n,i){super(e,r,n,i,Ul)}}yt(lT,aT);yt(lT,Tw);function BA(t,e,r){return(e=m5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m5(t){var e=p5(t,"string");return typeof e=="symbol"?e:e+""}function p5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class w5 extends vf{constructor(e,r,n,i,o,s){super(e,r,Ul,n,i),BA(this,"topOverlay",void 0),BA(this,"inlineStartOverlay",void 0),this.topOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new lT(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const i=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),o=this.topOverlay.getOverlayOffset();j0(e,`${i}px`,`${o}px`)}else Cw(e);let r=fr(this.clone.wtTable.TABLE);const n=nr(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),e.style.height=`${r}px`,e.style.width=`${n}px`,!1}}class uT extends Lc{constructor(e,r,n,i){super(e,r,n,i,Bl)}}yt(uT,aT);yt(uT,_w);function v5(t,e,r){return(e=y5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y5(t){var e=C5(t,"string");return typeof e=="symbol"?e:e+""}function C5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b5 extends vf{constructor(e,r,n,i){super(e,r,Bl,n,i),v5(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new uT(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode,{rootWindow:r}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let i=0,o=!1;if(this.trimmingContainer===r&&(!n||n!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),u=Math.ceil(l.bottom),c=e.offsetHeight;o=u===c,i=this.getOverlayOffset(),j0(e,"0px",`${i}px`)}else i=this.getScrollPosition(),Cw(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:r}=this.domBindings,n=this.mainTableScrollableElement;let i=!1;if(n===r&&e!==r.scrollY){const o=r.scrollY;r.scrollTo(W0(r),e),i=o!==r.scrollY}else if(e!==n.scrollTop){const o=n.scrollTop;n.scrollTop=e,i=o!==n.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,r){const n=this.wot.stylesHandler.getDefaultRowHeight();let i=e,o=0;for(;i<r;){const s=this.wot.wtTable.getRowHeight(i);o+=s===void 0?n:s,i+=1}return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=r.getWorkspaceWidth();r.hasVerticalScroll()&&(u-=Or(n)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=fr(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,r=oT(this.wot),n=this.wot.selectionManager.getFocusSelection()?parseInt(r.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+n}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:r}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?r.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:r.style[e]=""}scrollTo(e,r){const{wot:n,wtSettings:i}=this,s=(n.cloneSource?n.cloneSource:n).wtTable.holder,a=i.getSetting("columnHeaders"),u=i.getSetting("fixedRowsTop")===0&&a.length>0&&!_e(s.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),h=0;if(r){const d=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();d>f&&(r=!1)}if(r&&s.offsetHeight!==s.clientHeight&&(h=Or(this.domBindings.rootDocument)),r){const d=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=n.wtViewport.getViewportHeight()-this.sumCellSizes(f-d,f),c+=1,c+=u}else c+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return c+=h,v3(this.mainTableScrollableElement)===c-u&&u>0&&this.wot.wtOverlays.expandHiderVerticallyBy(u),this.setScrollPosition(c)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return B0(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o;n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),n>s&&(n=0)}return n}adjustHeaderBordersPosition(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:n}=this,i=this.wot.wtTable.holder.parentNode,o=n.getSetting("totalColumns"),s=n.getSetting("preventOverflow")==="horizontal";o?Ee(i,"emptyColumns"):ie(i,"emptyColumns");let a=!1;if(!r&&!s){const l=n.getSetting("fixedRowsTop"),u=this.cachedFixedRowsTop!==l,c=n.getSetting("columnHeaders");if((u||l===0)&&c.length>0){const h=_e(i,"innerBorderTop");this.cachedFixedRowsTop=n.getSetting("fixedRowsTop"),e||n.getSetting("totalRows")===0?(ie(i,"innerBorderTop"),a=!h):(Ee(i,"innerBorderTop"),a=h)}}return a}}function Xf(t,e,r){S5(t,e),e.set(t,r)}function S5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jo(t,e,r){return(e=R5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function R5(t){var e=E5(t,"string");return typeof e=="symbol"?e:e+""}function E5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function La(t,e,r){return t.set(sF(t,e),r),r}function Uo(t,e){return t.get(sF(t,e))}function sF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var fu=new WeakMap,Zf=new WeakMap,gu=new WeakMap,Jf=new WeakMap;class T5{constructor(e,r,n,i,o,s){jo(this,"wot",null),Xf(this,fu,[]),jo(this,"topOverlay",null),jo(this,"bottomOverlay",null),jo(this,"inlineStartOverlay",null),jo(this,"topInlineStartCornerOverlay",null),jo(this,"bottomInlineStartCornerOverlay",null),jo(this,"browserLineHeight",void 0),jo(this,"wtSettings",null),Xf(this,Zf,!1),Xf(this,gu,0),Xf(this,Jf,null),jo(this,"resizeObserver",new ResizeObserver(c=>{lp(()=>{!Array.isArray(c)||!c.length||(La(gu,this,Uo(gu,this)+1),Uo(gu,this)===100&&(it("The ResizeObserver callback was fired too many times in direct succession.\nThis may be due to an infinite loop caused by setting a dynamic height/width (for example, with the `dvh` units) to a Handsontable container's parent. \nThe observer will be disconnected."),this.resizeObserver.disconnect()),Uo(Jf,this)!==null&&clearTimeout(Uo(Jf,this)),La(Jf,this,setTimeout(()=>{La(gu,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=i,this.domBindings=n,this.facadeGetter=r,this.wtTable=s;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=Or(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:sp(s.TABLE),this.initOverlays(),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=l.scrollX,this.lastScrollY=l.scrollY}getOverlays(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const r=[...Uo(fu,this)];return e&&r.push(this.wtTable),r}initBrowserLineHeight(){const{rootWindow:e,rootDocument:r}=this.domBindings,n=e.getComputedStyle(r.body),i=parseInt(n.lineHeight,10),o=parseInt(n.fontSize,10)*1.2;this.browserLineHeight=i||o}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new b5(...e),this.bottomOverlay=new Q6(...e),this.inlineStartOverlay=new f5(...e),this.topInlineStartCornerOverlay=new w5(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new q6(...e,this.bottomOverlay,this.inlineStartOverlay),La(fu,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){La(Zf,this,Uo(fu,this).reduce((e,r)=>r.hasRenderingStateChanged()||e,!1)),Uo(fu,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),Uo(fu,this).forEach(e=>{const r=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),r&&!e.needFullRender&&e.reset()})}refreshAll(){if(this.wot.drawn){if(!this.wtTable.holder.parentNode){this.destroy();return}this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}}registerListeners(){const{rootDocument:e,rootWindow:r}=this.domBindings,{mainTableScrollableElement:n}=this.topOverlay,{mainTableScrollableElement:i}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",h=>this.onKeyDown(h)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(n,"scroll",h=>this.onTableScroll(h),{passive:!0}),n!==i&&this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0});const o=r.devicePixelRatio&&r.devicePixelRatio>1,s=this.scrollableElement===r,a=this.wtSettings.getSetting("preventWheel"),l={passive:s};(a||o||!O$())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",h=>this.onCloneWheel(h,a),l),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(h=>{this.eventManager.addEventListener(h.clone.wtTable.holder,"wheel",d=>this.onCloneWheel(d,a),l)});let c;this.eventManager.addEventListener(r,"resize",()=>{lp(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{La(gu,this,0)},200)})}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const r=this.domBindings.rootWindow,n=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(i!==r&&o!==r&&!e.target.contains(i)||n!==r&&o!==r&&!e.target.contains(n))||this.syncScrollPositions(e)}onCloneWheel(e,r){const{rootWindow:n}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,o=this.topOverlay.mainTableScrollableElement,s=e.target,a=o!==n&&s!==n&&!s.contains(o),l=i!==n&&s!==n&&!s.contains(i);if(this.keyPressed&&(a||l)||this.scrollableElement===n)return;const u=this.translateMouseWheelToScroll(e);(r||this.scrollableElement!==n&&u)&&e.preventDefault()}onKeyDown(e){this.keyPressed=mf(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let r=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,n=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(n+=n*this.browserLineHeight,r+=r*this.browserLineHeight);const i=this.scrollVertically(r),o=this.scrollHorizontally(n);return i||o}scrollVertically(e){const r=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,r!==this.scrollableElement.scrollTop}scrollHorizontally(e){const r=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,r!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,r=this.inlineStartOverlay.clone.wtTable.holder;let n=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(n=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==n,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=n,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=n;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=n)}this.verticalScrolling&&(r.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!Uo(Zf,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:r,scrollTop:n}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=r),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=r),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=n),La(Zf,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:r}=this.domBindings;r.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=sp(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateLastSpreaderSize()&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,r=e.clientWidth,n=e.clientHeight,i=r!==this.spreaderLastSize.width||n!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=r,this.spreaderLastSize.height=n),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:r}=this,{rootWindow:n}=this.domBindings,i=this.scrollableElement===n,o=this.wtSettings.getSetting("totalColumns"),s=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),u=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,s)+1,c=a+this.inlineStartOverlay.sumCellSizes(0,o),d=r.hider.style,f=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,u-r.holder.clientHeight),g=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,c-r.holder.clientWidth),w=f()?1:0,v=g()?1:0;d.width=`${c+v}px`,d.height=`${u+w}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:r}=this;r.hider.style.height=`${parseInt(r.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:r}=this;r.hider.style.width=`${parseInt(r.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const r=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let n=null;return k(r,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(n=i.clone)}),n}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,r=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];k(r,n=>{n&&(n.clone.wtTable.TABLE.className=e.className)})}}function jA(t,e,r){return(e=_5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _5(t){var e=M5(t,"string");return typeof e=="symbol"?e:e+""}function M5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class P5{constructor(e){jA(this,"settings",{}),jA(this,"defaults",Object.freeze(this.getDefaults())),We(this.defaults,(r,n)=>{if(e[n]!==void 0)this.settings[n]=e[n];else{if(r===void 0)throw new Error(`A required setting "${n}" was not provided`);this.settings[n]=r}})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders(){return[]},columnHeaders(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:(e,r,n)=>{const i=this.getSetting("data",e,r);Fl(n,i??"")},columnWidth(){},rowHeight(){},rowHeightByOverlayName(){},defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,viewportRowRenderingThreshold:null,viewportColumnRenderingThreshold:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onModifyGetCoordsElement:null,onModifyGetCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0}}update(e,r){return r===void 0?We(e,(n,i)=>{this.settings[i]=n}):this.settings[e]=r,this}getSetting(e,r,n,i,o){return typeof this.settings[e]=="function"?this.settings[e](r,n,i,o):r!==void 0&&Array.isArray(this.settings[e])?this.settings[e][r]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class cT extends Lc{constructor(e,r,n,i){super(e,r,n,i,"master")}alignOverlaysWithTrimmingContainer(){const e=$d(this.wtRootElement),{rootWindow:r}=this.domBindings;if(e===r)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const n=e.parentElement,i=ap(e,"height",r),o=ap(e,"overflow",r),s=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let u=e.offsetWidth,c=e.offsetHeight;if(n&&["auto","hidden","scroll"].includes(o)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?n.insertBefore(d,e.nextElementSibling):n.appendChild(d);const f=parseInt(r.getComputedStyle(d).height,10);n.removeChild(d),f===0&&(c=0)}c=Math.min(c,l),s.height=i==="auto"?"auto":`${c}px`,u=Math.min(u,a),s.width=`${u}px`,s.overflow="",this.hasTableHeight=s.height==="auto"?!0:c>0,this.hasTableWidth=u>0}this.isTableVisible=yc(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:r}=this.dataAccessObject,n="master",o=e.getSetting("columnHeaders").length;if(o&&!r.hasOversizedColumnHeadersMarked[n]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let u=0;u<o;u++)for(let c=-1*a;c<l;c++)this.markIfOversizedColumnHeader(c);r.hasOversizedColumnHeadersMarked[n]=!0}}}yt(cT,tT);yt(cT,_w);class I5{constructor(e,r,n,i,o){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=r,this.wtSettings=n,this.wtTable=o,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.rowsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllRows")?new aX:new fX],["fullyVisible",()=>new Z4],["partiallyVisible",()=>new G$]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new iX:new cX],["fullyVisible",()=>new q4],["partiallyVisible",()=>new Y$]]),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,r=this.dataAccessObject.topOverlayTrimmingContainer;let n=0;return r===this.domBindings.rootWindow?n=e.documentElement.clientHeight:n=fr(r)>0&&r.clientHeight>0?r.clientHeight:1/0,n}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const r=this.getColumnHeaderHeight();return r>0&&(e-=r),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:r}=this.domBindings,n=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let i;if(n===r){const o=this.wtSettings.getSetting("totalColumns");i=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,o)>i&&(i=e.documentElement.clientWidth)}else i=n.clientWidth;return i}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const r=this.getRowHeaderWidth();return r>0?e-r:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollHeight>o.clientHeight}const{holder:e,hider:r}=this.wtTable,n=e.clientHeight,i=r.offsetHeight;return n<i?!0:i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollWidth>o.clientWidth}const{holder:e,hider:r}=this.wtTable,n=e.clientWidth,i=r.offsetWidth;return n<i?!0:i>this.getWorkspaceWidth()}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,r){let n=0,i=e;for(;i<r;)n+=this.wtTable.getColumnWidth(i),i+=1;return n}getWorkspaceOffset(){return jr(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=fr(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),r=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let n=0,i=r.length;n<i;n++)this.rowHeaderWidth+=e[n]||e}if(isNaN(this.rowHeaderWidth))if(r.length){let n=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,o=r.length;i<o;i++)n?(this.rowHeaderWidth+=nr(n),n=n.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:r,wtTable:n}=this;let i=this.getViewportHeight(),o,s;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=r.getSetting("fixedRowsTop"),u=r.getSetting("fixedRowsBottom"),c=r.getSetting("totalRows");return l&&a>=0&&(s=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=s,i-=s),u&&this.dataAccessObject.bottomOverlay.clone&&(s=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),i-=s),n.holder.clientHeight===n.holder.offsetHeight?o=0:o=Or(this.domBindings.rootDocument),new bX({calculationTypes:e.map(h=>[h,this.rowsCalculatorTypes.get(h)()]),viewportHeight:i,scrollOffset:a,totalRows:r.getSetting("totalRows"),defaultRowHeight:this.instance.stylesHandler.getDefaultRowHeight(),rowHeightFn:h=>n.getRowHeight(h),overrideFn:r.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:o})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:r,wtTable:n}=this;let i=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const s=r.getSetting("fixedColumnsStart");if(s&&o>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=a,i-=a}return n.holder.clientWidth!==n.holder.offsetWidth&&(i-=Or(this.domBindings.rootDocument)),new vX({calculationTypes:e.map(a=>[a,this.columnsCalculatorTypes.get(a)()]),viewportWidth:i,scrollOffset:o,totalColumns:r.getSetting("totalColumns"),columnWidthFn:a=>n.getColumnWidth(a),overrideFn:r.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:r}=this,n=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!r.getSetting("renderAllRows")){const o=n.getResultsFor("fullyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(o)}if(e&&!r.getSetting("renderAllColumns")){const o=i.getResultsFor("fullyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(o)}return e||(this.rowsRenderCalculator=n.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=n.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=n.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),r=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=r.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:r,endRow:n}=e;if(r===null&&n===null){if(!e.isVisibleInTrimmingContainer)return!0;r=this.rowsPartiallyVisibleCalculator.startRow,n=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:i,endRow:o,rowStartOffset:s,rowEndOffset:a}=this.rowsRenderCalculator,l=this.wtSettings.getSetting("totalRows")-1,u=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(u)&&u>0?(r=Math.max(0,r-Math.min(s,u)),n=Math.min(l,n+Math.min(a,u))):u==="auto"&&(r=Math.max(0,r-Math.ceil(s/2)),n=Math.min(l,n+Math.ceil(a/2))),r<i||r===i&&r>0?!1:!(n>o||n===o&&n<l)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;let{startColumn:r,endColumn:n}=e;if(r===null&&n===null){if(!e.isVisibleInTrimmingContainer)return!0;r=this.columnsPartiallyVisibleCalculator.startColumn,n=this.columnsPartiallyVisibleCalculator.endColumn}const{startColumn:i,endColumn:o,columnStartOffset:s,columnEndOffset:a}=this.columnsRenderCalculator,l=this.wtSettings.getSetting("totalColumns")-1,u=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(u)&&u>0?(r=Math.max(0,r-Math.min(s,u)),n=Math.min(l,n+Math.min(a,u))):u==="auto"&&(r=Math.max(0,r-Math.ceil(s/2)),n=Math.min(l,n+Math.ceil(a/2))),r<i||r===i&&r>0?!1:!(n>o||n===o&&n<l)}resetHasOversizedColumnHeadersMarked(){We(this.hasOversizedColumnHeadersMarked,(e,r,n)=>{n[r]=void 0})}}function O5(t,e){aF(t,e),e.add(t)}function $a(t,e,r){aF(t,e),e.set(t,r)}function aF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ht(t,e){return t.get(Ni(t,e))}function Hi(t,e,r){return t.set(Ni(t,e),r),r}function Ni(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const UA=23;var co=new WeakMap,ds=new WeakMap,hT=new WeakMap,tE=new WeakMap,Xs=new WeakMap,nd=new WeakMap,Vd=new WeakMap,go=new WeakSet;class x5{constructor(e){O5(this,go),$a(this,co,void 0),$a(this,ds,void 0),$a(this,hT,void 0),$a(this,tE,void 0),$a(this,Xs,!0),$a(this,nd,{}),$a(this,Vd,{}),Hi(ds,this,e.rootTable.parentElement.parentElement),Hi(tE,this,e.rootDocument)}isClassicTheme(){return Ht(Xs,this)}getCSSVariableValue(e){var r;if(Ht(Xs,this))return null;if(Ht(nd,this)[`--ht-${e}`])return Ht(nd,this)[`--ht-${e}`];const n=(r=Ni(go,this,D5).call(this,`--ht-${e}`))!==null&&r!==void 0?r:Ni(go,this,lF).call(this,`--ht-${e}`);if(n!==null)return Ht(nd,this)[`--ht-${e}`]=n,n}getStyleForTD(e){var r;return(r=Ht(Vd,this))===null||r===void 0?void 0:r.td[e]}getDefaultRowHeight(){if(Ht(Xs,this))return UA;const e=Ni(go,this,A5).call(this);return!e&&_e(Ht(ds,this),"ht-wrapper")?(it(`The "${Ht(co,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),Hi(Xs,this,!0),this.useTheme(),UA):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){Ni(go,this,zA).call(this),Hi(Xs,this,!0),Hi(co,this,e||void 0);return}e&&e!==Ht(co,this)&&(Ht(co,this)&&Ni(go,this,k5).call(this),Hi(co,this,e),Hi(Xs,this,!1),Ni(go,this,H5).call(this),Ni(go,this,zA).call(this))}getThemeName(){return Ht(co,this)}removeClassNames(){_e(Ht(ds,this),Ht(co,this))&&Ee(Ht(ds,this),Ht(co,this))}}function A5(){const t=this.getCSSVariableValue("line-height"),e=this.getCSSVariableValue("cell-vertical-padding"),r=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return t===null||e===null||isNaN(r)?null:t+2*e+r}function H5(){Ee(Ht(ds,this),/ht-theme-.*/g),ie(Ht(ds,this),Ht(co,this))}function zA(){this.isClassicTheme()||Hi(hT,this,getComputedStyle(Ht(ds,this)));const t=Ni(go,this,N5).call(this,["box-sizing","border-bottom-width"]);Ht(Vd,this).td={...Ht(Vd,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function N5(t){const e=Ht(tE,this),r=Ht(ds,this),n=e.createElement("table"),i=e.createElement("tbody"),o=e.createElement("tr"),s=e.createElement("tr"),a=e.createElement("td");s.appendChild(a),i.appendChild(o),i.appendChild(s),n.appendChild(i),r.appendChild(n);const l=getComputedStyle(a),u={};return t.forEach(c=>{u[c]=l.getPropertyValue(c)}),r.removeChild(n),u}function D5(t){const e=Math.ceil(parseFloat(Ni(go,this,lF).call(this,t)));return Number.isNaN(e)?null:e}function lF(t){const e=Ht(hT,this).getPropertyValue(t);return e===""?null:e}function k5(){Hi(Vd,this,{}),Hi(nd,this,{}),Hi(Xs,this,!0)}class L5 extends Q0{constructor(e,r){super(e,new P5(r)),this.stylesHandler=new x5(this.domBindings);const n=this.wtSettings.getSetting("facade",this);this.wtTable=new cT(this.getTableDao(),n,this.domBindings,this.wtSettings),this.wtViewport=new I5(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new h5(this.wtSettings.getSetting("selections")),this.wtEvent=new J$(n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new T5(this,n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},r=[],n=[];We(e,(i,o)=>{this.wtSettings.getSetting(o).length&&n.push(i),r.push(i)}),Ee(this.wtTable.wtRootElement.parentNode,r),ie(this.wtTable.wtRootElement.parentNode,n)}getOverlayByName(e){var r;if(!tF.includes(e))return null;const n=e.replace(/_([a-z])/g,i=>i[1].toUpperCase());return(r=this.wtOverlays[`${n}Overlay`])!==null&&r!==void 0?r:null}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}class dT{constructor(e){e instanceof Q0?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=r=>{const n=new dT(r);return()=>n},this._wot=new L5(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get activeOverlayName(){return this._wot.activeOverlayName}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}get stylesHandler(){return this._wot.stylesHandler}createCellCoords(e,r){return this._wot.createCellCoords(e,r)}createCellRange(e,r,n){return this._wot.createCellRange(e,r,n)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,r)}scrollViewport(e,r,n){return this._wot.scrollViewport(e,r,n)}scrollViewportHorizontally(e,r){return this._wot.scrollViewportHorizontally(e,r)}scrollViewportVertically(e,r){return this._wot.scrollViewportVertically(e,r)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}getOverlayByName(e){return this._wot.getOverlayByName(e)}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,r){return this._wot.wtSettings.update(e,r),this}getSetting(e,r,n,i,o){return this._wot.wtSettings.getSetting(e,r,n,i,o)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function YA(t){let{isShiftKey:e,isLeftClick:r,isRightClick:n,coords:i,selection:o,controller:s,cellCoordsFactory:a}=t;const l=o.isSelected()?o.getSelectedRange().current():null,u=o.isSelectedByCorner(),c=o.isSelectedByRowHeader();if(o.markSource("mouse"),e&&l)i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(i):(u||c)&&i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(a(i.row,i.col)):u&&i.row<0&&!s.column?o.setRangeEnd(a(l.to.row,i.col)):c&&i.col<0&&!s.row?o.setRangeEnd(a(i.row,l.to.col)):(!u&&!c&&i.col<0||u&&i.col<0)&&!s.row?o.selectRows(Math.max(l.from.row,0),i.row,i.col):(!u&&!c&&i.row<0||c&&i.row<0)&&!s.column&&o.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const h=!o.inInSelection(i),d=r||n&&h;i.row<0&&i.col>=0&&!s.column?d&&o.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!s.row?d&&o.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!s.cell?d&&o.setRangeStart(i):i.col<0&&i.row<0&&o.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}o.markEndSource()}function $5(t){let{isLeftClick:e,coords:r,selection:n,controller:i,cellCoordsFactory:o}=t;if(!e)return;const s=n.isSelectedByRowHeader(),a=n.isSelectedByColumnHeader(),l=n.tableProps.countCols(),u=n.tableProps.countRows();n.markSource("mouse"),a&&!i.column?n.setRangeEnd(o(u-1,r.col)):s&&!i.row?n.setRangeEnd(o(r.row,l-1)):i.cell||n.setRangeEnd(r),n.markEndSource()}const F5=new Map([["mousedown",YA],["mouseover",$5],["touchstart",YA]]);function GA(t,e){let{coords:r,selection:n,controller:i,cellCoordsFactory:o}=e;F5.get(t.type)({coords:r,selection:n,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:Y0(t)||t.type==="touchstart",isRightClick:Vl(t)})}const uF=new WeakMap,fT=Symbol("rootInstance");function V5(t){uF.set(t,!0)}function W5(t){return t===fT}function Hm(t){return uF.has(t)}function B5(t,e){cF(t,e),e.add(t)}function Ds(t,e,r){cF(t,e),e.set(t,r)}function cF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ks(t,e,r){return(e=j5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j5(t){var e=U5(t,"string");return typeof e=="symbol"?e:e+""}function U5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tr(t,e){return t.get(uc(t,e))}function un(t,e,r){return t.set(uc(t,e),r),r}function uc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Cb=new WeakMap,Qf=new WeakMap,eg=new WeakMap,zo=new WeakMap,Ci=new WeakMap,bb=new WeakMap,Sb=new WeakMap,mu=new WeakMap,id=new WeakSet;class z5{constructor(e){B5(this,id),ks(this,"hot",void 0),ks(this,"eventManager",void 0),ks(this,"settings",void 0),ks(this,"THEAD",void 0),ks(this,"TBODY",void 0),ks(this,"_wt",void 0),ks(this,"activeWt",void 0),Ds(this,Cb,0),Ds(this,Qf,0),ks(this,"postponedAdjustElementsSize",!1),Ds(this,eg,!1),Ds(this,zo,void 0),Ds(this,Ci,void 0),Ds(this,bb,0),Ds(this,Sb,0),Ds(this,mu,null),this.hot=e,this.eventManager=new ji(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!e),uc(id,this,G5).call(this),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,r){const n=this._wt.getCell(e,r);return n<0?null:n}scrollViewport(e,r,n){return this._wt.scrollViewport(e,r,n)}scrollViewportHorizontally(e,r){return this._wt.scrollViewportHorizontally(e,r)}scrollViewportVertically(e,r){return this._wt.scrollViewportVertically(e,r)}createElements(){const{rootElement:e,rootDocument:r}=this.hot,n=e.getAttribute("style");n&&e.setAttribute("data-originalstyle",n),ie(e,"handsontable"),un(Ci,this,r.createElement("TABLE")),ie(tr(Ci,this),"htCore"),this.hot.getSettings().tableClassName&&ie(tr(Ci,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Pe(tr(Ci,this),[ms()]),Pe(e,[jK(),d$(-1),vw(this.hot.countCols()),n3()])),this.THEAD=r.createElement("THEAD"),tr(Ci,this).appendChild(this.THEAD),this.TBODY=r.createElement("TBODY"),tr(Ci,this).appendChild(this.TBODY),this.hot.table=tr(Ci,this),this.hot.container.insertBefore(tr(Ci,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:r,selection:n,rootWindow:i}=this.hot,o=r.documentElement;this.eventManager.addEventListener(e,"mousedown",a=>{un(eg,this,!0),this.isTextSelectionAllowed(a.target)||(I1(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{un(eg,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{tr(eg,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&I1(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{n.isInProgress()&&!a.shiftKey&&n.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{n.isInProgress()&&Y0(a)&&n.finish(),un(zo,this,!1);const l=E$(r.activeElement);Am(r.activeElement)&&!l||(l||!n.isSelected()&&!n.isSelectedByAnyHeader()&&!e.contains(a.target)&&!Vl(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{n.isInProgress()&&Vl(a)&&(n.finish(),un(zo,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{n.isInProgress()&&n.finish(),un(zo,this,!1)}),this.eventManager.addEventListener(o,"mousedown",a=>{const l=a.target,u=a.x||a.clientX,c=a.y||a.clientY;let h=a.target;if(tr(zo,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const g=Or(r);if(r.elementFromPoint(u+g,c)!==d||r.elementFromPoint(u,c+g)!==d)return}else for(;h!==o;){if(h===null){if(a.isTargetWebComponent)break;return}if(h===e)return;h=h.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(l):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let s=vc(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=vc(s);this.eventManager.addEventListener(tr(Ci,this),"selectstart",a=>{this.settings.fragmentSelection||Am(a.target)||a.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:r,col:n}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(r,n))}translateFromRenderableToVisualIndex(e,r){let n=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=r>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(r):r;return n===null&&(n=e),i===null&&(i=r),[n,i]}countRenderableIndexes(e,r){const n=Math.min(e.getNotTrimmedIndexesLength(),r),i=e.getNearestNotHiddenIndex(n-1,-1);return i===null?0:e.getRenderableFromVisualIndex(i)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,r){return this.countNotHiddenIndexes(e,r,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,r){return this.countNotHiddenIndexes(e,r,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,r,n,i){if(isNaN(e)||e<0)return 0;const o=n.getNearestNotHiddenIndex(e,r),s=n.getRenderableFromVisualIndex(o);if(!Number.isInteger(s))return 0;let a=0;return r<0?a=s+1:r>0&&(a=i-s),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),r=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(r,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),r=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(r,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),r=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(r,1)}countRenderableColumnsInRange(e,r){let n=0;for(let i=e;i<=r;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(n+=1);return n}countRenderableRowsInRange(e,r){let n=0;for(let i=e;i<=r;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(n+=1);return n}getStylesHandler(){return this._wt.stylesHandler}getDefaultRowHeight(){return this._wt.stylesHandler.getDefaultRowHeight()}addClassNameToLicenseElement(e){var r;const n=(r=this.hot.rootElement.parentNode)===null||r===void 0?void 0:r.querySelector(".hot-display-license-info");n&&ie(n,e)}removeClassNameFromLicenseElement(e){var r;const n=(r=this.hot.rootElement.parentNode)===null||r===void 0?void 0:r.querySelector(".hot-display-license-info");n&&Ee(n,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),r=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>r}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:tr(Ci,this),isDataViewInstance:()=>Hm(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(o,s)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(o,s)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const o=[];return this.hot.hasRowHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(s):s;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",o),un(Qf,this,o.length),this.hot.getSettings().ariaTags&&uc(id,this,hF).call(this)===this.hot.countCols()&&uc(id,this,Y5).call(this,tr(Qf,this)),o},columnHeaders:()=>{const o=[];return this.hot.hasColHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(s):s;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",o),un(Cb,this,o.length),o},columnWidth:o=>{const s=this.hot.columnIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getColWidth(s===null?o:s)},rowHeight:o=>{const s=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getRowHeight(s===null?o:s)},rowHeightByOverlayName:(o,s)=>{const a=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o),l=a===null?o:a;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(l),l,s)},cellRenderer:(o,s,a)=>{const[l,u]=this.translateFromRenderableToVisualIndex(o,s),c=this.hot.runHooks("modifyGetCellCoords",l,u,!1,"meta");let h=l,d=u;Array.isArray(c)&&([h,d]=c);const f=this.hot.getCellMeta(h,d),g=this.hot.colToProp(d);let w=this.hot.getDataAtRowProp(h,g);this.hot.hasHook("beforeValueRender")&&(w=this.hot.runHooks("beforeValueRender",w,f)),this.hot.runHooks("beforeRenderer",a,l,u,g,w,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,g,w,f),this.hot.runHooks("afterRenderer",a,l,u,g,w,f)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&yc(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,un(zo,this,!0),un(mu,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!Sl(o)&&(GA(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",o,u,a),this.activeWt=this._wt)},onCellContextMenu:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,un(zo,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!Sl(o)&&(this.hot.runHooks("afterOnCellContextMenu",o,u,a),this.activeWt=this._wt)},onCellMouseOut:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",o,u,a),!Sl(o)&&(this.hot.runHooks("afterOnCellMouseOut",o,u,a),this.activeWt=this._wt)},onCellMouseOver:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",o,u,a,c),!Sl(o)&&(tr(zo,this)&&(!tr(mu,this)||tr(mu,this).x!==o.clientX||tr(mu,this).y!==o.clientY)&&GA(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",o,u,a),this.activeWt=this._wt,un(mu,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(Sl(o)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",o,u,a),this.activeWt=this._wt)},onCellCornerMouseDown:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",o)},onCellCornerDblClick:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",o)},beforeDraw:(o,s)=>this.beforeRender(o,s),onDraw:o=>this.afterRender(o),onBeforeViewportScrollVertically:(o,s)=>{const a=this.hot.rowIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollVertically",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onBeforeViewportScrollHorizontally:(o,s)=>{const a=this.hot.columnIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollHorizontally",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(o,s,a)=>{const l=this.hot.rowIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingRowHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(o,s,a)=>{const l=this.hot.columnIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingColumnHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(o,s,a)=>{let l;const[u,c]=this.translateFromRenderableToVisualIndex(o,s),h=this.hot.selection.getSelectedRange();if(h.size()>0){const f=h.peekByIndex(a??0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",u,c,l,a)},onBeforeDrawBorders:(o,s)=>{const[a,l,u,c]=o,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(u),this.hot.columnIndexMapper.getVisualFromRenderableIndex(c)];return this.hot.runHooks("beforeDrawBorders",h,s)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:o=>this.hot.runHooks("modifyRowHeaderWidth",o),onModifyGetCellCoords:(o,s,a,l)=>{const u=this.hot.rowIndexMapper,c=this.hot.columnIndexMapper,h=s>=0?c.getVisualFromRenderableIndex(s):s,d=o>=0?u.getVisualFromRenderableIndex(o):o,f=this.hot.runHooks("modifyGetCellCoords",d,h,a,l);if(Array.isArray(f)){const[g,w,v,b]=f;return[g>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(g,1)):g,w>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(w,1)):w,v>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(v,-1)):v,b>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(b,-1)):b]}},onModifyGetCoordsElement:(o,s)=>{const a=this.hot.rowIndexMapper,l=this.hot.columnIndexMapper,u=s>=0?l.getVisualFromRenderableIndex(s):s,c=o>=0?a.getVisualFromRenderableIndex(o):o,h=this.hot.runHooks("modifyGetCoordsElement",c,u);if(Array.isArray(h)){const[d,f]=h;return[d>=0?a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(d,1)):d,f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f]}},viewportRowCalculatorOverride:o=>{let s=this.settings.viewportRowRenderingOffset;if(s==="auto"&&this.settings.fixedRowsTop&&(s=10),s>0||s==="auto"){const a=this.countRenderableRows(),l=o.startRow,u=o.endRow;if(typeof s=="number")o.startRow=Math.max(l-s,0),o.endRow=Math.min(u+s,a-1);else if(s==="auto"){const c=Math.max(1,Math.ceil(u/a*12));o.startRow=Math.max(l-c,0),o.endRow=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",o)},viewportColumnCalculatorOverride:o=>{let s=this.settings.viewportColumnRenderingOffset;if(s==="auto"&&this.settings.fixedColumnsStart&&(s=10),s>0||s==="auto"){const a=this.countRenderableColumns(),l=o.startColumn,u=o.endColumn;if(typeof s=="number"&&(o.startColumn=Math.max(l-s,0),o.endColumn=Math.min(u+s,a-1)),s==="auto"){const c=Math.max(1,Math.ceil(u/a*6));o.startColumn=Math.max(l-c,0),o.endColumn=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",o)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const o=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||o}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new dT(e),this.activeWt=this._wt;const r=this._wt.wtTable.spreader,{width:n,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(n,i),this.eventManager.addEventListener(r,"mousedown",o=>{o.target===r&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(r,"contextmenu",o=>{o.target===r&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){if(Am(e))return!0;const r=Nl(e,this._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&r||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&r||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return tr(zo,this)}isSelectedOnlyCell(){var e,r;return(e=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,r){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,r)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,r){if(r.firstChild){const n=r.firstChild;if(!_e(n,"relative")){Ts(r),this.appendRowHeader(e,r);return}this.updateCellHeader(n.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:n,getRowHeader:i}=this.hot,o=n.createElement("div"),s=n.createElement("span");o.className="relative",s.className="rowHeader",this.updateCellHeader(s,e,i),o.appendChild(s),r.appendChild(o)}this.hot.runHooks("afterGetRowHeader",e,r)}appendColHeader(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;const o=()=>{const s=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return s?s.split(" "):[]};if(r.firstChild){const s=r.firstChild;_e(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,n,i),s.className="",ie(s,["relative",...o()])):(Ts(r),this.appendColHeader(e,r,n,i))}else{const{rootDocument:s}=this.hot,a=s.createElement("div"),l=s.createElement("span"),u=o();a.classList.add("relative",...u),l.className="colHeader",this.settings.ariaTags&&(Pe(a,...ms()),Pe(l,...ms())),this.updateCellHeader(l,e,n,i),a.appendChild(l),r.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,r,i)}updateCellHeader(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=r;const s=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(_e(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(r):_e(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(r))),o>-1?kc(e,n(r,i)):(Fl(e," "),ie(e,"cornerHeader"))}maximumVisibleElementWidth(e){const n=this._wt.wtViewport.getWorkspaceWidth()-e;return n>0?n:0}maximumVisibleElementHeight(e){const n=this._wt.wtViewport.getWorkspaceHeight()-e;return n>0?n:0}setLastSize(e,r){un(bb,this,e),un(Sb,this,r)}getLastSize(){return{width:tr(bb,this),height:tr(Sb,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,r=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(r??0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,r=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(r??this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,r=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(r??0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,r=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(r??this.hot.countCols()-1,-1)}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return tr(Cb,this)}getRowHeadersCount(){return tr(Qf,this)}getViewportWidth(){return this._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this._wt.wtViewport.getWorkspaceHeight()}getElementOverlayName(e){var r;return((r=this._wt.wtOverlays.getParentOverlay(e))!==null&&r!==void 0?r:this._wt).wtTable.name}getOverlayByName(e){return this._wt.getOverlayByName(e)}getActiveOverlayName(){return this._wt.activeOverlayName}isVisible(){return this._wt.wtTable.isVisible()}hasVerticalScroll(){return this._wt.wtViewport.hasVerticalScroll()}hasHorizontalScroll(){return this._wt.wtViewport.hasHorizontalScroll()}getTableWidth(){return this._wt.wtTable.getWidth()}getTableHeight(){return this._wt.wtTable.getHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getRowHeaderWidth(){return this._wt.wtViewport.getRowHeaderWidth()}getColumnHeaderHeight(){return this._wt.wtViewport.getColumnHeaderHeight()}isVerticallyScrollableByWindow(){return this._wt.wtViewport.isVerticallyScrollableByWindow()}isHorizontallyScrollableByWindow(){return this._wt.wtViewport.isHorizontallyScrollableByWindow()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function hF(){return parseInt(this.hot.rootElement.getAttribute(vw()[0]),10)}function Y5(t){const e=uc(id,this,hF).call(this)+t;Pe(this.hot.rootElement,...vw(e))}function G5(){const t=this.hot.rootElement;this.hasVerticalScroll()?ie(t,"htHasScrollY"):Ee(t,"htHasScrollY"),this.hasHorizontalScroll()?ie(t,"htHasScrollX"):Ee(t,"htHasScrollX")}var qA={},KA={},XA;function q5(){if(XA)return KA;XA=1;var t=St(),e=pr(),r=xc(),n=Tn(),i=vr(),o=xo(),s=_n(),a=Ra(),l=a("every",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(c){i(this);try{n(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return!r(h,function(f,g){if(!c(f,d++))return g()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),KA}var ZA;function K5(){return ZA||(ZA=1,q5()),qA}K5();const X5="ABCDEFGHIJKLMNOPQRSTUVWXYZ",JA=X5.length;function Z5(t){let e=t+1,r="",n;for(;e>0;)n=(e-1)%JA,r=String.fromCharCode(65+n)+r,e=parseInt((e-n)/JA,10);return r}function dF(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=t;const n=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(r=[t]),r.forEach((i,o)=>{Array.isArray(i)?i.forEach((s,a)=>{n.push([o+e,a,s])}):Object.keys(i).forEach(s=>{n.push([o+e,s,i[s]])})}),n}function fF(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&Ve(t[0])&&(e=z0(t[0]))),e}function J5(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function Q5(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function mh(t,e,r){return(e=e9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e9(t){var e=t9(t,"string");return typeof e=="symbol"?e:e+""}function t9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class r9{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];mh(this,"hot",void 0),mh(this,"data",void 0),mh(this,"dataType","array"),mh(this,"colToProp",()=>{}),mh(this,"propToCol",()=>{}),this.hot=e,this.data=r}modifyRowData(e){let r;return this.hot.hasHook("modifyRowData")&&(r=this.hot.runHooks("modifyRowData",e)),r!==void 0&&!Number.isInteger(r)?r:this.data[e]}getData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return!this.data||this.data.length===0?this.data:this.getByRange(null,null,e)}setData(e){this.data=e}getAtColumn(e){const r=[];return k(this.data,(n,i)=>{const o=this.getAtCell(i,e);r.push(o)}),r}getAtRow(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const o=r===void 0&&n===void 0,{dataDotNotation:s}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],o?a.forEach((u,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):Ce(r,n,u=>{l[u-r]=this.getAtPhysicalCell(e,u,a)});else if(Ve(a)||mt(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;Ce(0,c,h=>{const d=this.colToProp(h);if(h>=(r||0)&&h<=(n||c)&&!Number.isInteger(d)){const f=this.getAtPhysicalCell(e,d,a);i?l.push(f):s?GC(l,d,f):l[d]=f}})}else We(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?GC(l,c,h):l[c]=h});return l}setAtCell(e,r,n){if(!(e>=this.countRows()||r>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=Bn(n);this.hot.runHooks("modifySourceData",e,r,i,"set"),i.isTouched()&&(n=i.value)}["__proto__","constructor","prototype"].includes(e)||(Number.isInteger(r)?this.data[e][r]=n:GC(this.data[e],r,n))}}getAtPhysicalCell(e,r,n){let i=null;if(n)if(typeof r=="string"){const{dataDotNotation:o}=this.hot.getSettings();i=o?P3(n,r):n[r]}else typeof r=="function"?i=r(n):i=n[r];if(this.hot.hasHook("modifySourceData")){const o=Bn(i);this.hot.runHooks("modifySourceData",e,r,o,"get"),o.isTouched()&&(i=o.value)}return i}getAtCell(e,r){const n=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(r),n)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,o=null,s=null,a=null,l=null;e===null||r===null?(i=!0,o=0,a=this.countRows()-1):(o=Math.min(e.row,r.row),s=Math.min(e.col,r.col),a=Math.max(e.row,r.row),l=Math.max(e.col,r.col));const u=[];return Ce(o,a,c=>{u.push(i?this.getAtRow(c,void 0,void 0,n):this.getAtRow(c,s,l,n))}),u}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return fF(this.data)}destroy(){this.data=null,this.hot=null}}var QA={},eH={},tH;function n9(){if(tH)return eH;tH=1;var t=St(),e=pr(),r=xc(),n=Tn(),i=vr(),o=xo(),s=_n(),a=Ra(),l=a("some",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(c){i(this);try{n(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return r(h,function(f,g){if(c(f,d++))return g()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),eH}var rH;function i9(){return rH||(rH=1,n9()),QA}i9();function nH(t,e,r){return(e=o9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o9(t){var e=s9(t,"string");return typeof e=="symbol"?e:e+""}function s9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tu{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;nH(this,"indexedValues",[]),nH(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const r=this.indexedValues;if(e<r.length)return r[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,r){return e<this.indexedValues.length?(this.indexedValues[e]=r,this.runLocalHooks("change"),!0):!1}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,mt(this.initValueOrFn)?Ce(e-1,r=>this.indexedValues.push(this.initValueOrFn(r))):Ce(e-1,()=>this.indexedValues.push(this.initValueOrFn)),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}yt(tu,Hr);function gT(t,e,r,n){const i=r.length?r[0]:void 0;return[...t.slice(0,i),...r.map((o,s)=>mt(n)?n(o,s):n),...i===void 0?[]:t.slice(i)]}function mT(t,e){return Ll(t,(r,n)=>e.includes(n)===!1)}class Ta extends tu{insert(e,r){this.indexedValues=gT(this.indexedValues,e,r,this.initValueOrFn),super.insert(e,r)}remove(e){this.indexedValues=mT(this.indexedValues,e),super.remove(e)}}class Mw extends Ta{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return Mn(this.getValues(),(e,r,n)=>(r&&e.push(n),e),[])}}function pT(t,e,r){return[...t.slice(0,e),...r,...t.slice(e)]}function Wd(t,e){return Ll(t,r=>e.includes(r)===!1)}function wT(t,e){return qe(t,r=>r-e.filter(n=>n<r).length)}function vT(t,e){const r=e[0],n=e.length;return qe(t,i=>i>=r?i+n:i)}function a9(t,e,r){return(e=l9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l9(t){var e=u9(t,"string");return typeof e=="symbol"?e:e+""}function u9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pw extends tu{constructor(){super(...arguments),a9(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=r,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(n,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=Wd(this.orderOfIndexes,[e]),mt(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,r){this.indexedValues=gT(this.indexedValues,e,r,this.initValueOrFn),this.orderOfIndexes=vT(this.orderOfIndexes,r),super.insert(e,r)}remove(e){this.indexedValues=mT(this.indexedValues,e),this.orderOfIndexes=Wd(this.orderOfIndexes,e),this.orderOfIndexes=wT(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class yf extends Ta{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return Mn(this.getValues(),(e,r,n)=>(r&&e.push(n),e),[])}}const iH=new Map([["indexesSequence",{getListWithInsertedItems:pT,getListWithRemovedItems:Wd}],["physicallyIndexed",{getListWithInsertedItems:gT,getListWithRemovedItems:mT}]]),gF=t=>{if(iH.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return iH.get(t)};class mF extends tu{constructor(){super(e=>e)}insert(e,r){const n=vT(this.indexedValues,r);this.indexedValues=pT(n,e,r),super.insert(e,r)}remove(e){const r=Wd(this.indexedValues,e);this.indexedValues=wT(r,e),super.remove(e)}}const oH=new Map([["hiding",Mw],["index",tu],["linkedPhysicalIndexToValue",Pw],["physicalIndexToValue",Ta],["trimming",yf]]);function c9(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!oH.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(oH.get(t))(e)}function h9(t,e,r){return(e=d9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d9(t){var e=f9(t,"string");return typeof e=="symbol"?e:e+""}function f9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yT{constructor(){h9(this,"collection",new Map)}register(e,r){this.collection.has(e)===!1&&(this.collection.set(e,r),r.addLocalHook("change",()=>this.runLocalHooks("change",r)))}unregister(e){const r=this.collection.get(e);pe(r)&&(r.destroy(),this.collection.delete(e),this.runLocalHooks("change",r))}unregisterAll(){this.collection.forEach((e,r)=>this.unregister(r)),this.collection.clear()}get(e){return $t(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(r=>{r.remove(e)})}insertToEvery(e,r){this.collection.forEach(n=>{n.insert(e,r)})}initEvery(e){this.collection.forEach(r=>{r.init(e)})}}yt(yT,Hr);function Rb(t,e,r){return(e=g9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g9(t){var e=m9(t,"string");return typeof e=="symbol"?e:e+""}function m9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sH extends yT{constructor(e,r){super(),Rb(this,"mergedValuesCache",[]),Rb(this,"aggregationFunction",void 0),Rb(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=r}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const r=qe(this.get(),o=>o.getValues()),n=[],i=pe(r[0])&&r[0].length||0;for(let o=0;o<i;o+=1){const s=[];for(let a=0;a<this.getLength();a+=1)s.push(r[a][o]);n.push(s)}return qe(n,this.aggregationFunction)}getMergedValueAtIndex(e,r){const n=this.getMergedValues(r)[e];return pe(n)?n:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function p9(t,e,r){w9(t,e),e.set(t,r)}function w9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function v9(t,e,r){return t.set(pF(t,e),r),r}function y9(t,e){return t.get(pF(t,e))}function pF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Eb=new WeakMap;class wF{constructor(){p9(this,Eb,[])}subscribe(e){return this.addLocalHook("change",e),this._write(y9(Eb,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){v9(Eb,this,e)}}yt(wF,Hr);function aH(t,e){const r=[];let n=0,i=0;for(;n<t.length&&i<e.length;n++,i++)t[n]!==e[i]&&r.push({op:"replace",index:i,oldValue:t[n],newValue:e[i]});for(;n<e.length;n++)r.push({op:"insert",index:n,oldValue:void 0,newValue:e[n]});for(;i<t.length;i++)r.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return r}function ph(t,e,r){C9(t,e),e.set(t,r)}function C9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zn(t,e){return t.get(vF(t,e))}function tg(t,e,r){return t.set(vF(t,e),r),r}function vF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var rg=new WeakMap,wh=new WeakMap,ng=new WeakMap,ig=new WeakMap,og=new WeakMap;class b9{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ph(this,rg,new Set),ph(this,wh,[]),ph(this,ng,[]),ph(this,ig,!1),ph(this,og,!1),tg(og,this,e??!1)}createObserver(){const e=new wF;return Zn(rg,this).add(e),e.addLocalHook("unsubscribe",()=>{Zn(rg,this).delete(e)}),e._writeInitialChanges(aH(Zn(wh,this),Zn(ng,this))),e}emit(e){let r=Zn(ng,this);(!Zn(ig,this)||Zn(wh,this).length!==e.length)&&(e.length===0?e=new Array(r.length).fill(Zn(og,this)):tg(wh,this,new Array(e.length).fill(Zn(og,this))),Zn(ig,this)||(tg(ig,this,!0),r=Zn(wh,this)));const n=aH(r,e);Zn(rg,this).forEach(i=>i._write(n)),tg(ng,this,e)}}function Gr(t,e,r){return(e=S9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S9(t){var e=R9(t,"string");return typeof e=="symbol"?e:e+""}function R9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rE{constructor(){Gr(this,"indexesSequence",new mF),Gr(this,"trimmingMapsCollection",new sH(e=>e.some(r=>r===!0),!1)),Gr(this,"hidingMapsCollection",new sH(e=>e.some(r=>r===!0),!1)),Gr(this,"variousMapsCollection",new yT),Gr(this,"hidingChangesObservable",new b9({initialIndexValue:!1})),Gr(this,"notTrimmedIndexesCache",[]),Gr(this,"notHiddenIndexesCache",[]),Gr(this,"isBatched",!1),Gr(this,"indexesSequenceChanged",!1),Gr(this,"indexesChangeSource",void 0),Gr(this,"trimmedIndexesChanged",!1),Gr(this,"hiddenIndexesChanged",!1),Gr(this,"renderablePhysicalIndexesCache",[]),Gr(this,"fromPhysicalToVisualIndexesCache",new Map),Gr(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)}),this.trimmingMapsCollection.addLocalHook("change",e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)}),this.hidingMapsCollection.addLocalHook("change",e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)}),this.variousMapsCollection.addLocalHook("change",e=>{this.runLocalHooks("change",e,this.variousMapsCollection)})}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){if(e!=="hiding")throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,r,n){return this.registerMap(e,c9(r,n))}registerMap(e,r){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);r instanceof yf?this.trimmingMapsCollection.register(e,r):r instanceof Mw?this.hidingMapsCollection.register(e,r):this.variousMapsCollection.register(e,r);const n=this.getNumberOfIndexes();return n>0&&r.init(n),r}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const r=this.notTrimmedIndexesCache[e];return pe(r)?r:null}getPhysicalFromRenderableIndex(e){const r=this.renderablePhysicalIndexesCache[e];return pe(r)?r:null}getVisualFromPhysicalIndex(e){const r=this.fromPhysicalToVisualIndexesCache.get(e);return pe(r)?r:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const r=this.fromVisualToRenderableIndexesCache.get(e);return pe(r)?r:null}getNearestNotHiddenIndex(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const o=Array.from(this.fromVisualToRenderableIndexesCache.keys());let s=-1;return r>0?s=o.findIndex(a=>a>e):s=o.reverse().findIndex(a=>a<e),s===-1?n?this.getNearestNotHiddenIndex(e,-r,!1):null:o[s]}initToLength(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const r=this.getNumberOfIndexes();if(e<r){const n=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(n)}else this.insertIndexes(r,e-r)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){this.indexesChangeSource===void 0&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),this.indexesChangeSource==="update"&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(n=>this.isTrimmed(n)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(n=>this.isHidden(n)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(n=>this.isHidden(n)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,r){typeof e=="number"&&(e=[e]);const n=qe(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=Wd(this.getIndexesSequence(),n),a=s.filter(u=>this.isTrimmed(u)===!1);let l=s.indexOf(a[a.length-1])+1;if(r+o<i){const u=a[r];l=s.indexOf(u)}this.indexesChangeSource="move",this.setIndexesSequence(pT(s,l,n)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,r){const n=this.getNotTrimmedIndexes()[e],i=pe(n)?n:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(n)?this.getIndexesSequence().indexOf(n):this.getNumberOfIndexes(),s=qe(new Array(r).fill(i),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(o,s),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(o,s),this.hidingMapsCollection.insertToEvery(o,s),this.variousMapsCollection.insertToEvery(o,s),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const r=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&r===!0)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let r=0;r<e;r+=1){const n=this.getPhysicalFromVisualIndex(r);this.fromPhysicalToVisualIndexesCache.set(n,r)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let r=0;r<e;r+=1){const n=this.getPhysicalFromRenderableIndex(r),i=this.getVisualFromPhysicalIndex(n);this.fromVisualToRenderableIndexesCache.set(i,r)}}}yt(rE,Hr);function E9(t,e){return We(e,(r,n)=>{$t(t[n])&&(t[n]=r)}),t}function yF(t){const r=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return r?`${r[1].toLowerCase()}-${r[2].toUpperCase()}`:t}function CF(t){pe(t)&&G0(lt`Language with code "${t}" was not found. You should register particular language\x20
|
|
521
|
+
before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function T9(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:_9,getValues:M9}=Gi("phraseFormatters");function P9(t,e){_9(t,e)}function I9(){return M9()}P9("pluralize",T9);const bF="ContextMenu:items",He=bF,CT=`${He}.noItems`,bT=`${He}.insertRowAbove`,ST=`${He}.insertRowBelow`,RT=`${He}.insertColumnOnTheLeft`,ET=`${He}.insertColumnOnTheRight`,TT=`${He}.removeRow`,_T=`${He}.removeColumn`,MT=`${He}.undo`,PT=`${He}.redo`,dp=`${He}.readOnly`,IT=`${He}.clearColumn`,OT=`${He}.copy`,xT=`${He}.copyWithHeaders`,AT=`${He}.copyWithGroupHeaders`,HT=`${He}.copyHeadersOnly`,NT=`${He}.cut`,DT=`${He}.freezeColumn`,kT=`${He}.unfreezeColumn`,LT=`${He}.mergeCells`,$T=`${He}.unmergeCells`,FT=`${He}.addComment`,VT=`${He}.editComment`,WT=`${He}.removeComment`,BT=`${He}.readOnlyComment`,jT=`${He}.align`,UT=`${He}.align.left`,zT=`${He}.align.center`,YT=`${He}.align.right`,GT=`${He}.align.justify`,qT=`${He}.align.top`,KT=`${He}.align.middle`,XT=`${He}.align.bottom`,ZT=`${He}.borders`,JT=`${He}.borders.top`,QT=`${He}.borders.right`,e_=`${He}.borders.bottom`,t_=`${He}.borders.left`,r_=`${He}.borders.remove`,n_=`${He}.nestedHeaders.insertChildRow`,i_=`${He}.nestedHeaders.detachFromParent`,o_=`${He}.hideColumn`,s_=`${He}.showColumn`,a_=`${He}.hideRow`,l_=`${He}.showRow`,sn="Filters:",Gt=`${sn}conditions`,Iw=`${Gt}.none`,u_=`${Gt}.isEmpty`,c_=`${Gt}.isNotEmpty`,h_=`${Gt}.isEqualTo`,d_=`${Gt}.isNotEqualTo`,f_=`${Gt}.beginsWith`,g_=`${Gt}.endsWith`,m_=`${Gt}.contains`,p_=`${Gt}.doesNotContain`,O9=`${Gt}.byValue`,w_=`${Gt}.greaterThan`,v_=`${Gt}.greaterThanOrEqualTo`,y_=`${Gt}.lessThan`,C_=`${Gt}.lessThanOrEqualTo`,b_=`${Gt}.isBetween`,S_=`${Gt}.isNotBetween`,R_=`${Gt}.after`,E_=`${Gt}.before`,T_=`${Gt}.today`,__=`${Gt}.tomorrow`,M_=`${Gt}.yesterday`,P_=`${sn}labels.filterByCondition`,I_=`${sn}labels.filterByValue`,O_=`${sn}labels.conjunction`,Ow=`${sn}labels.disjunction`,fp=`${sn}values.blankCells`,x_=`${sn}buttons.selectAll`,A_=`${sn}buttons.clear`,H_=`${sn}buttons.ok`,N_=`${sn}buttons.cancel`,D_=`${sn}buttons.placeholder.search`,k_=`${sn}buttons.placeholder.value`,L_=`${sn}buttons.placeholder.secondValue`,$_="CheckboxRenderer:",F_=`${$_}checked`,V_=`${$_}unchecked`,x9=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:F_,CHECKBOX_RENDERER_NAMESPACE:$_,CHECKBOX_UNCHECKED:V_,CONTEXTMENU_ITEMS_ADD_COMMENT:FT,CONTEXTMENU_ITEMS_ALIGNMENT:jT,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:XT,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:zT,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:GT,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:UT,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:KT,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:YT,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:qT,CONTEXTMENU_ITEMS_BORDERS:ZT,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:e_,CONTEXTMENU_ITEMS_BORDERS_LEFT:t_,CONTEXTMENU_ITEMS_BORDERS_RIGHT:QT,CONTEXTMENU_ITEMS_BORDERS_TOP:JT,CONTEXTMENU_ITEMS_CLEAR_COLUMN:IT,CONTEXTMENU_ITEMS_COPY:OT,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:HT,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:AT,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:xT,CONTEXTMENU_ITEMS_CUT:NT,CONTEXTMENU_ITEMS_EDIT_COMMENT:VT,CONTEXTMENU_ITEMS_FREEZE_COLUMN:DT,CONTEXTMENU_ITEMS_HIDE_COLUMN:o_,CONTEXTMENU_ITEMS_HIDE_ROW:a_,CONTEXTMENU_ITEMS_INSERT_LEFT:RT,CONTEXTMENU_ITEMS_INSERT_RIGHT:ET,CONTEXTMENU_ITEMS_MERGE_CELLS:LT,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:i_,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:n_,CONTEXTMENU_ITEMS_NO_ITEMS:CT,CONTEXTMENU_ITEMS_READ_ONLY:dp,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:BT,CONTEXTMENU_ITEMS_REDO:PT,CONTEXTMENU_ITEMS_REMOVE_BORDERS:r_,CONTEXTMENU_ITEMS_REMOVE_COLUMN:_T,CONTEXTMENU_ITEMS_REMOVE_COMMENT:WT,CONTEXTMENU_ITEMS_REMOVE_ROW:TT,CONTEXTMENU_ITEMS_ROW_ABOVE:bT,CONTEXTMENU_ITEMS_ROW_BELOW:ST,CONTEXTMENU_ITEMS_SHOW_COLUMN:s_,CONTEXTMENU_ITEMS_SHOW_ROW:l_,CONTEXTMENU_ITEMS_UNDO:MT,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:kT,CONTEXTMENU_ITEMS_UNMERGE_CELLS:$T,CONTEXT_MENU_ITEMS_NAMESPACE:bF,FILTERS_BUTTONS_CANCEL:N_,FILTERS_BUTTONS_CLEAR:A_,FILTERS_BUTTONS_OK:H_,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:D_,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:L_,FILTERS_BUTTONS_PLACEHOLDER_VALUE:k_,FILTERS_BUTTONS_SELECT_ALL:x_,FILTERS_CONDITIONS_AFTER:R_,FILTERS_CONDITIONS_BEFORE:E_,FILTERS_CONDITIONS_BEGINS_WITH:f_,FILTERS_CONDITIONS_BETWEEN:b_,FILTERS_CONDITIONS_BY_VALUE:O9,FILTERS_CONDITIONS_CONTAINS:m_,FILTERS_CONDITIONS_EMPTY:u_,FILTERS_CONDITIONS_ENDS_WITH:g_,FILTERS_CONDITIONS_EQUAL:h_,FILTERS_CONDITIONS_GREATER_THAN:w_,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:v_,FILTERS_CONDITIONS_LESS_THAN:y_,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:C_,FILTERS_CONDITIONS_NAMESPACE:Gt,FILTERS_CONDITIONS_NONE:Iw,FILTERS_CONDITIONS_NOT_BETWEEN:S_,FILTERS_CONDITIONS_NOT_CONTAIN:p_,FILTERS_CONDITIONS_NOT_EMPTY:c_,FILTERS_CONDITIONS_NOT_EQUAL:d_,FILTERS_CONDITIONS_TODAY:T_,FILTERS_CONDITIONS_TOMORROW:__,FILTERS_CONDITIONS_YESTERDAY:M_,FILTERS_DIVS_FILTER_BY_CONDITION:P_,FILTERS_DIVS_FILTER_BY_VALUE:I_,FILTERS_LABELS_CONJUNCTION:O_,FILTERS_LABELS_DISJUNCTION:Ow,FILTERS_NAMESPACE:sn,FILTERS_VALUES_BLANK_CELLS:fp},Symbol.toStringTag,{value:"Module"}));/**
|
|
522
|
+
* @preserve
|
|
523
|
+
* Authors: Handsoncode
|
|
524
|
+
* Last updated: Nov 15, 2017
|
|
525
|
+
*
|
|
526
|
+
* Description: Definition file for English - United States language-country.
|
|
527
|
+
*/const SF={languageCode:"en-US",[CT]:"No available options",[bT]:"Insert row above",[ST]:"Insert row below",[RT]:"Insert column left",[ET]:"Insert column right",[TT]:["Remove row","Remove rows"],[_T]:["Remove column","Remove columns"],[MT]:"Undo",[PT]:"Redo",[dp]:"Read only",[IT]:"Clear column",[jT]:"Alignment",[UT]:"Left",[zT]:"Center",[YT]:"Right",[GT]:"Justify",[qT]:"Top",[KT]:"Middle",[XT]:"Bottom",[DT]:"Freeze column",[kT]:"Unfreeze column",[ZT]:"Borders",[JT]:"Top",[QT]:"Right",[e_]:"Bottom",[t_]:"Left",[r_]:"Remove border(s)",[FT]:"Add comment",[VT]:"Edit comment",[WT]:"Delete comment",[BT]:"Read-only comment",[LT]:"Merge cells",[$T]:"Unmerge cells",[OT]:"Copy",[xT]:["Copy with header","Copy with headers"],[AT]:["Copy with group header","Copy with group headers"],[HT]:["Copy header only","Copy headers only"],[NT]:"Cut",[n_]:"Insert child row",[i_]:"Detach from parent",[o_]:["Hide column","Hide columns"],[s_]:["Show column","Show columns"],[a_]:["Hide row","Hide rows"],[l_]:["Show row","Show rows"],[Iw]:"None",[u_]:"Is empty",[c_]:"Is not empty",[h_]:"Is equal to",[d_]:"Is not equal to",[f_]:"Begins with",[g_]:"Ends with",[m_]:"Contains",[p_]:"Does not contain",[w_]:"Greater than",[v_]:"Greater than or equal to",[y_]:"Less than",[C_]:"Less than or equal to",[b_]:"Is between",[S_]:"Is not between",[R_]:"After",[E_]:"Before",[T_]:"Today",[__]:"Tomorrow",[M_]:"Yesterday",[fp]:"Blank cells",[P_]:"Filter by condition",[I_]:"Filter by value",[O_]:"And",[Ow]:"Or",[x_]:"Select all",[A_]:"Clear",[H_]:"OK",[N_]:"Cancel",[D_]:"Search",[k_]:"Value",[L_]:"Second value",[F_]:"Checked",[V_]:"Unchecked"},A9=x9,nE=SF.languageCode,{register:H9,getItem:RF,hasItem:N9,getValues:D9}=Gi("languagesDictionaries");EF(SF);function EF(t,e){let r=t,n=e;return Ve(t)&&(n=t,r=n.languageCode),k9(r,n),H9(r,on(n)),on(n)}function k9(t,e){t!==nE&&E9(e,RF(nE))}function TF(t){return W_(t)?on(RF(t)):null}function W_(t){return N9(t)}function L9(){return D9()}function _F(t,e,r){const n=TF(t);if(n===null)return null;const i=n[e];if($t(i))return null;const o=$9(i,r);return Array.isArray(o)?o[0]:o}function $9(t,e){let r=t;return k(I9(),n=>{r=n(t,e)}),r}function F9(t){let e=yF(t);return W_(e)||(e=nE,CF(t)),e}function V9(t,e,r){return(e=W9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function W9(t){var e=B9(t,"string");return typeof e=="symbol"?e:e+""}function B9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class As extends rF{constructor(e,r){super(e,null),V9(this,"visualCellRange",null),this.visualCellRange=r||null,this.commit()}add(e){return this.visualCellRange===null?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:r,to:n}=e,i=this.getNearestNotHiddenCoords(r,1),o=this.getNearestNotHiddenCoords(n,-1);return i===null||o===null?null:((i.row>o.row||i.col>o.col)&&(i=r,o=n),this.settings.createCellRange(i,i,o))}getNearestNotHiddenCoords(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,r);if(i===null)return null;const o=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,n);return o===null?null:this.settings.createCellCoords(i,o)}getNearestNotHiddenIndex(e,r,n){return r<0?r:e.getNearestNotHiddenIndex(r,n)}commit(){if(this.visualCellRange===null)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return e===null?this.cellRange=null:this.cellRange=this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const r=e.from.clone().normalize(),n=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,o=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let s=null;if((o===null||o.col===null||o.row===null)&&(s=this.getNearestNotHiddenCoords(r,n,i)),s!==null&&e.overlaps(s)){const a=e.highlight.clone();if(a.row>=0&&(a.row=s.row),a.col>=0&&(a.col=s.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&o!==null&&s===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:r}=this.cellRange;return[Math.min(e.row,r.row),Math.min(e.col,r.col),Math.max(e.row,r.row),Math.max(e.col,r.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),r=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,r.row,r.col]}createRenderableCellRange(e,r){const n=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(r);return n.row===null||n.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(n,n,i)}}function Tb(t){let{activeHeaderClassName:e,...r}=t;return new As({className:e,...r,selectionType:nF})}function j9(t){let{areaCornerVisible:e,...r}=t;return new As({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...r,selectionType:iT})}function U9(t){let{...e}=t;return new As({className:"highlight",...e,selectionType:iT})}function z9(t){let{columnClassName:e,...r}=t;return new As({className:e,...r,selectionType:i5})}function Y9(t){let{cellCornerVisible:e,...r}=t;return new As({className:"current",headerAttributes:[V0()],border:{width:2,color:"#4b89ff",cornerVisible:e},...r,selectionType:gd})}function G9(t){let{border:e,visualCellRange:r,...n}=t;return new As({...e,...n,selectionType:o5},r)}function q9(t){let{...e}=t;return new As({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:r5})}function lH(t){let{headerClassName:e,...r}=t;return new As({className:e,...r,selectionType:nT})}function K9(t){let{rowClassName:e,...r}=t;return new As({className:e,...r,selectionType:n5})}function X9(t,e){Z9(t,e),e.add(t)}function Z9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cn(t,e,r){return(e=J9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J9(t){var e=Q9(t,"string");return typeof e=="symbol"?e:e+""}function Q9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yo(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ji=new WeakSet;class e8{constructor(e){X9(this,Ji),cn(this,"options",void 0),cn(this,"layerLevel",0),cn(this,"focus",void 0),cn(this,"fill",void 0),cn(this,"layeredAreas",new Map),cn(this,"areas",new Map),cn(this,"rowHeaders",new Map),cn(this,"columnHeaders",new Map),cn(this,"activeRowHeaders",new Map),cn(this,"activeColumnHeaders",new Map),cn(this,"activeCornerHeaders",new Map),cn(this,"rowHighlights",new Map),cn(this,"columnHighlights",new Map),cn(this,"customSelections",[]),this.options=e,this.focus=Y9(e),this.fill=q9(e)}isEnabledFor(e,r){let n=e;e===gd&&(n="current");let i=this.options.disabledCellSelection(r.row,r.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(n)}useLayerLevel(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return Yo(Ji,this,Go).call(this,this.layeredAreas,j9)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Yo(Ji,this,Go).call(this,this.areas,U9)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Yo(Ji,this,Go).call(this,this.rowHeaders,lH)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Yo(Ji,this,Go).call(this,this.columnHeaders,lH)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Yo(Ji,this,Go).call(this,this.activeRowHeaders,Tb)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Yo(Ji,this,Go).call(this,this.activeColumnHeaders,Tb)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Yo(Ji,this,Go).call(this,this.activeCornerHeaders,Tb)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Yo(Ji,this,Go).call(this,this.rowHighlights,K9)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Yo(Ji,this,Go).call(this,this.columnHighlights,z9)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(G9({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),k(this.areas.values(),e=>void e.clear()),k(this.layeredAreas.values(),e=>void e.clear()),k(this.rowHeaders.values(),e=>void e.clear()),k(this.columnHeaders.values(),e=>void e.clear()),k(this.activeRowHeaders.values(),e=>void e.clear()),k(this.activeColumnHeaders.values(),e=>void e.clear()),k(this.activeCornerHeaders.values(),e=>void e.clear()),k(this.rowHighlights.values(),e=>void e.clear()),k(this.columnHighlights.values(),e=>void e.clear())}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function Go(t,e){const r=this.layerLevel;if(t.has(r))return t.get(r);const n=e({layerLevel:r,...this.options});return t.set(r,n),n}function uH(t,e,r){return(e=t8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function t8(t){var e=r8(t,"string");return typeof e=="symbol"?e:e+""}function r8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class n8{constructor(e){uH(this,"ranges",[]),uH(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return this.size()===0}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some(r=>r.includes(e))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}peekByIndex(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r;return e>=0&&e<this.size()&&(r=this.ranges[e]),r}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}function i8(t,e){MF(t,e),e.add(t)}function _b(t,e,r){MF(t,e),e.set(t,r)}function MF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function et(t,e){return t.get(ur(t,e))}function sg(t,e,r){return t.set(ur(t,e),r),r}function ur(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var ag=new WeakMap,Tt=new WeakMap,$i=new WeakMap,br=new WeakSet;class iE{constructor(e,r){i8(this,br),_b(this,ag,void 0),_b(this,Tt,void 0),_b(this,$i,{x:0,y:0}),sg(ag,this,e),sg(Tt,this,r)}transformStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=et(Tt,this).createCellCoords(e,r);let o=et(ag,this).current().highlight;const s=et(Tt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=ur(br,this,PF).call(this),{row:h,col:d}=ur(br,this,hH).call(this,o),f=et(Tt,this).fixedRowsBottom(),g=et(Tt,this).minSpareRows(),w=et(Tt,this).minSpareCols(),v=et(Tt,this).autoWrapRow(),b=et(Tt,this).autoWrapCol(),p=et(Tt,this).createCellCoords(h+i.row,d+i.col);if(p.row>=c){const T=Bn(n&&g>0&&f===0),M=p.col+1,P=et(Tt,this).createCellCoords(p.row-c,M>=u?M-u:M);this.runLocalHooks("beforeColumnWrap",T,ur(br,this,pu).call(this,P),M>=u),T.value?this.runLocalHooks("insertRowRequire",et(Tt,this).countRenderableRows()):b&&p.assign(P)}else if(p.row<0){const T=Bn(b),M=p.col-1,P=et(Tt,this).createCellCoords(c+p.row,M<0?u+M:M);this.runLocalHooks("beforeColumnWrap",T,ur(br,this,pu).call(this,P),M<0),b&&p.assign(P)}if(p.col>=u){const T=Bn(n&&w>0),M=p.row+1,P=et(Tt,this).createCellCoords(M>=c?M-c:M,p.col-u);this.runLocalHooks("beforeRowWrap",T,ur(br,this,pu).call(this,P),M>=c),T.value?this.runLocalHooks("insertColRequire",et(Tt,this).countRenderableColumns()):v&&p.assign(P)}else if(p.col<0){const T=Bn(v),M=p.row-1,P=et(Tt,this).createCellCoords(M<0?c+M:M,u+p.col);this.runLocalHooks("beforeRowWrap",T,ur(br,this,pu).call(this,P),M<0),v&&p.assign(P)}const{rowDir:_,colDir:O}=ur(br,this,cH).call(this,p);a=_,l=O,o=ur(br,this,pu).call(this,p)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,r){const n=et(Tt,this).createCellCoords(e,r),i=et(ag,this).current(),o=et(Tt,this).visualToRenderableCoords(i.highlight),s=ur(br,this,Mb).call(this,i.to.row,i.from.row),a=ur(br,this,Pb).call(this,i.to.col,i.from.col),l=i.to.clone();let u=0,c=0;if(this.runLocalHooks("beforeTransformEnd",n),o.row!==null&&o.col!==null&&s!==null&&a!==null){const{row:h,col:d}=ur(br,this,hH).call(this,i.highlight),f=et(Tt,this).createCellCoords(s+n.row,a+n.col),g=i.getTopStartCorner(),w=i.getTopEndCorner(),v=i.getBottomEndCorner();if(n.col<0&&a>=d&&f.col<d){const O=f.col-d;f.col=ur(br,this,Pb).call(this,g.col,w.col)+O}else if(n.col>0&&a<=d&&f.col>d){const O=ur(br,this,Pb).call(this,w.col,g.col),T=Math.max(f.col-O,1);f.col=O+T}if(n.row<0&&s>=h&&f.row<h){const O=f.row-h;f.row=ur(br,this,Mb).call(this,g.row,v.row)+O}else if(n.row>0&&s<=h&&f.row>h){const O=ur(br,this,Mb).call(this,v.row,g.row),T=Math.max(f.row-O,1);f.row=O+T}const{rowDir:b,colDir:p}=ur(br,this,cH).call(this,f);u=b,c=p;const _=ur(br,this,pu).call(this,f);n.row===0&&n.col!==0?l.col=_.col:n.row!==0&&n.col===0?l.row=_.row:(l.row=_.row,l.col=_.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:r,y:n}=e;sg($i,this,{x:r,y:n})}resetOffsetSize(){sg($i,this,{x:0,y:0})}}function cH(t){const{width:e,height:r}=ur(br,this,PF).call(this);let n=0,i=0;return t.row<0?(n=-1,t.row=0):t.row>0&&t.row>=r&&(n=1,t.row=r-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:n,colDir:i}}function PF(){return{width:et($i,this).x+et(Tt,this).countRenderableColumns(),height:et($i,this).y+et(Tt,this).countRenderableRows()}}function Mb(t,e){const r=et(Tt,this).findFirstNonHiddenRenderableRow(t,e);return r===null?null:et($i,this).y+r}function Pb(t,e){const r=et(Tt,this).findFirstNonHiddenRenderableColumn(t,e);return r===null?null:et($i,this).x+r}function hH(t){const{row:e,col:r}=et(Tt,this).visualToRenderableCoords(t);if(e===null||r===null)throw new Error("Renderable coords are not visible.");return et(Tt,this).createCellCoords(et($i,this).y+e,et($i,this).x+r)}function pu(t){const e=t.clone();return e.col=t.col-et($i,this).x,e.row=t.row-et($i,this).y,et(Tt,this).renderableToVisualCoords(e)}yt(iE,Hr);const xw=0,Aw=1,IF=2,B_=3,o8=[B_,IF],s8=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],Ib=Symbol("root"),dH=Symbol("child");function bc(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ib;if(e!==Ib&&e!==dH)throw new Error("The second argument is used internally only and cannot be overwritten.");const r=Array.isArray(t),n=e===Ib;let i=xw;if(r){const o=t[0];t.length===0?i=Aw:n&&o instanceof pf?i=B_:n&&Array.isArray(o)?i=bc(o,dH):t.length>=2&&t.length<=4&&!t.some((a,l)=>!s8[l].includes(typeof a))&&(i=IF)}return i}function Bd(t){let{createCellCoords:e,createCellRange:r,keepDirection:n=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!o8.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===B_;let a=s?o.from.row:o[0],l=s?o.from.col:o[1],u=s?o.to.row:o[2],c=s?o.to.col:o[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof c=="string"&&(c=i(c))),$t(u)&&(u=a),$t(c)&&(c=l),!n){const f=a,g=l,w=u,v=c;a=Math.min(f,w),l=Math.min(g,v),u=Math.max(f,w),c=Math.max(g,v)}const h=e(a,l),d=e(u,c);return r(h,h,d)}}function a8(t){const e=bc(t.getSelected());if(e===xw||e===Aw)return[];const r=Bd(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),n=new Set;k(t.getSelected(),s=>{const{from:a,to:l}=r(s),u=Math.max(a.col,0),c=l.col-u+1;k(Array.from(new Array(c),(h,d)=>u+d),h=>{n.has(h)||n.add(h)})});const i=Array.from(n).sort((s,a)=>s-a);return Mn(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function l8(t){const e=bc(t.getSelected());if(e===xw||e===Aw)return[];const r=Bd(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),n=new Set;k(t.getSelected(),s=>{const{from:a,to:l}=r(s),u=Math.max(a.row,0),c=l.row-u+1;k(Array.from(new Array(c),(h,d)=>u+d),h=>{n.has(h)||n.add(h)})});const i=Array.from(n).sort((s,a)=>s-a);return Mn(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function wu(t,e,r){u8(t,e),e.set(t,r)}function u8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fa(t,e,r){return(e=c8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c8(t){var e=h8(t,"string");return typeof e=="symbol"?e:e+""}function h8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ot(t,e){return t.get(OF(t,e))}function Qi(t,e,r){return t.set(OF(t,e),r),r}function OF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var kr=new WeakMap,Va=new WeakMap,lg=new WeakMap,vh=new WeakMap,ug=new WeakMap,yh=new WeakMap;class xF{constructor(e,r){var n=this;Fa(this,"settings",void 0),Fa(this,"tableProps",void 0),Fa(this,"inProgress",!1),Fa(this,"selectedRange",new n8((i,o,s)=>this.tableProps.createCellRange(i,o,s))),Fa(this,"highlight",void 0),wu(this,kr,void 0),wu(this,Va,void 0),Fa(this,"selectedByRowHeader",new Set),Fa(this,"selectedByColumnHeader",new Set),wu(this,lg,!1),wu(this,vh,!1),wu(this,ug,"unknown"),wu(this,yh,-1),this.settings=e,this.tableProps=r,this.highlight=new e8({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[V0()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,o)=>this.tableProps.isDisabledCellSelection(i,o),cellCornerVisible:function(){return n.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return n.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),createCellRange:(i,o,s)=>this.tableProps.createCellRange(i,o,s)}),Qi(kr,this,new iE(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return n.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return n.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),Qi(Va,this,new iE(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,i.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,i.getOuterBottomEndCorner().col)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return n.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return n.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),Ot(kr,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeModifyTransformStart",...o)}),Ot(kr,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("afterModifyTransformStart",...o)}),Ot(kr,this).addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeModifyTransformEnd",...o)}),Ot(kr,this).addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("afterModifyTransformEnd",...o)}),Ot(kr,this).addLocalHook("insertRowRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("insertRowRequire",...o)}),Ot(kr,this).addLocalHook("insertColRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("insertColRequire",...o)}),Ot(kr,this).addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeRowWrap",...o)}),Ot(kr,this).addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeColumnWrap",...o)}),Ot(Va,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeModifyTransformFocus",...o)}),Ot(Va,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("afterModifyTransformFocus",...o)})}getSelectedRange(){return this.selectedRange}markSource(e){Qi(ug,this,e)}markEndSource(){Qi(ug,this,"unknown")}getSelectionSource(){return Ot(ug,this)}setExpectedLayers(e){Qi(yh,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,Qi(yh,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const o=this.settings.selectionMode==="multiple",s=$t(r)?this.tableProps.getShortcutManager().isCtrlPressed():r,a=e.clone();Qi(lg,this,!1),this.runLocalHooks(`beforeSetRangeStart${n?"Only":""}`,a),(!o||o&&!s&&$t(r))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),n||this.setRangeEnd(e)}setRangeStartOnly(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,r,!0,n)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const r=e.clone(),n=this.tableProps.countRows(),i=this.tableProps.countCols(),o=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((n>0||i>0)&&(n===0&&r.col<0&&!o||i===0&&r.row<0&&!o))return;this.runLocalHooks("beforeSetRangeEnd",r),this.begin();const s=this.selectedRange.current();if(this.settings.navigableHeaders||s.highlight.normalize(),this.settings.selectionMode==="single")s.setFrom(s.highlight),s.setTo(s.highlight);else{const l=s.getHorizontalDirection(),u=s.getVerticalDirection(),c=this.isMultiple();s.setTo(r),c&&(l!==s.getHorizontalDirection()||s.getWidth()===1&&!s.includes(s.highlight))&&s.from.assign({col:s.highlight.col}),c&&(u!==s.getVerticalDirection()||s.getHeight()===1&&!s.includes(s.highlight))&&s.from.assign({row:s.highlight.row})}n>0&&i>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!s.isSingleHeader())&&s.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight),this.applyAndCommit();const a=Ot(yh,this)===-1||this.selectedRange.size()===Ot(yh,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectedRange.current(),r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const n=this.tableProps.countRows(),i=this.tableProps.countCols();r<this.highlight.layerLevel&&(k(this.highlight.getAreas(),g=>void g.clear()),k(this.highlight.getLayeredAreas(),g=>void g.clear()),k(this.highlight.getRowHeaders(),g=>void g.clear()),k(this.highlight.getColumnHeaders(),g=>void g.clear()),k(this.highlight.getActiveRowHeaders(),g=>void g.clear()),k(this.highlight.getActiveColumnHeaders(),g=>void g.clear()),k(this.highlight.getActiveCornerHeaders(),g=>void g.clear()),k(this.highlight.getRowHighlights(),g=>void g.clear()),k(this.highlight.getColumnHighlights(),g=>void g.clear())),this.highlight.useLayerLevel(r);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(o.clear(),s.clear(),a.clear(),l.clear(),u.clear(),c.clear(),h.clear(),d.clear(),f.clear(),this.highlight.isEnabledFor(iT,e.highlight)&&(this.isMultiple()||r>=1)&&(o.add(e.from).add(e.to).commit(),s.add(e.from).add(e.to).commit(),r===1)){const g=this.selectedRange.previous();this.highlight.useLayerLevel(r-1),this.highlight.createArea().add(g.from).commit().syncWith(g),this.highlight.createLayeredArea().add(g.from).commit().syncWith(g),this.highlight.useLayerLevel(r)}if(this.highlight.isEnabledFor(nT,e.highlight)){if(!e.isSingleHeader()){const v=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),b=this.tableProps.createCellCoords(e.to.row,-1),p=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),_=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(v).commit(),l.add(p).commit(),d.add(v).commit(),f.add(p).commit()):(a.add(v).add(b).commit(),l.add(p).add(_).commit(),d.add(v).add(b).commit(),f.add(p).add(_).commit())}const g=!Ot(vh,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),w=!Ot(vh,this)&&this.isEntireColumnSelected()&&(n>0&&n===e.getHeight()||n===0&&this.isSelectedByColumnHeader());g&&u.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),w&&c.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(e.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(e.to.col,0))).commit(),g&&w&&h.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const r=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const n=this.highlight.getFocus();n.clear(),r.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(gd,r.highlight)&&n.add(r.highlight).commit().syncWith(r),this.inProgress||(Qi(lg,this,!0),this.runLocalHooks("afterSetFocus",r.highlight))}transformStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders?Ot(kr,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):Ot(kr,this).resetOffsetSize(),this.setRangeStart(Ot(kr,this).transformStart(e,r,n))}transformEnd(e,r){this.settings.navigableHeaders?Ot(kr,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):Ot(kr,this).resetOffsetSize(),this.setRangeEnd(Ot(kr,this).transformEnd(e,r))}transformFocus(e,r){const n=this.selectedRange.current(),{row:i,col:o}=n.getOuterTopStartCorner(),s=this.tableProps.countRenderableColumnsInRange(0,o-1),a=this.tableProps.countRenderableRowsInRange(0,i-1);n.highlight.isHeader()?Ot(Va,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):Ot(Va,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=Ot(Va,this).transformStart(e,r);this.setRangeFocus(l.normalize())}shiftRows(e,r){if(!this.isSelected())return;const n=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||n.getOuterTopStartCorner().row>=e){const{from:i,to:o,highlight:s}=n,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:r;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(Xe(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(Xe(o.row+r,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(Xe(s.row+r,0,a-1),s.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,r){if(!this.isSelected())return;const n=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||n.getOuterTopStartCorner().col>=e){const{from:i,to:o,highlight:s}=n,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=l?-1:0,h=l?0:r;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(i.row,Xe(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,Xe(o.col+r,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,Xe(s.col+r,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=Bn(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&Ot(lg,this)}isSelectedByRowHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(e===-1?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const r=i=>{const{col:o}=i.getOuterTopStartCorner(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(s>0&&o<0||s===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>r(i));const n=this.selectedRange.peekByIndex(e);return n?r(n):!1}isSelectedByColumnHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(e===-1?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const r=i=>{const{row:o}=i.getOuterTopStartCorner(),s=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(s>0&&o<0||s===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>r(i));const n=this.selectedRange.peekByIndex(e);return n?r(n):!1}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const r=this.tableProps.visualToRenderableCoords(e);return r.row!==null&&r.col!==null}isAreaCornerVisible(e){return Number.isInteger(e)&&e!==this.getLayerLevel()?!1:this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple()}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const o=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),u=n?-l:0,c=r?-a:0;if(u===0&&c===0&&(o===0||s===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=i;Qi(vh,this,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(Xe(d.row,u,o-1),Xe(d.col,c,s-1)));const g=this.tableProps.createCellCoords(u,c),w=this.tableProps.createCellCoords(o-1,s-1);this.clear(),this.setRangeStartOnly(g,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(w),this.finish(),Qi(vh,this,!1)}selectCells(e){var r=this;const n=bc(e);if(n===Aw)return!1;if(n===xw)throw new Error(lt`Unsupported format of the selection ranges was passed. To select cells pass\x20
|
|
528
|
+
the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
|
|
529
|
+
columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=Bd(n,{createCellCoords:function(){return r.tableProps.createCellCoords(...arguments)},createCellRange:function(){return r.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),o=this.settings.navigableHeaders,s={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:o?this.tableProps.countRowHeaders():0,countColHeaders:o?this.tableProps.countColHeaders():0},a=!e.some(l=>{const u=i(l),c=u.isValid(s);return!(c&&!u.containsHeaders()||c&&u.containsHeaders()&&u.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),k(e,l=>{const{from:u,to:c}=i(l);this.setRangeStartOnly(u.clone(),!1),this.setRangeEnd(c.clone())}),this.finish()),a}selectColumns(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,o=typeof r=="string"?this.tableProps.propToCol(r):r,s=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),u=l===0?0:-l,c=this.tableProps.createCellCoords(u,i),h=this.tableProps.createCellCoords(s-1,o),d=this.tableProps.createCellRange(c,c,h).isValid({countRows:s,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let f=0,g=0;Number.isInteger(n==null?void 0:n.row)&&Number.isInteger(n==null?void 0:n.col)?(f=Xe(n.row,u,s-1),g=Xe(n.col,Math.min(i,o),Math.max(i,o))):(f=Xe(n,u,s-1),g=i);const w=this.tableProps.createCellCoords(f,g),v=l===0?0:Xe(w.row,u,-1),b=s-1,p=this.tableProps.createCellCoords(v,i),_=this.tableProps.createCellCoords(b,o);this.runLocalHooks("beforeSelectColumns",p,_,w),p.row=v,_.row=b,this.setRangeStartOnly(p,void 0,w),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(_),this.runLocalHooks("afterSelectColumns",p,_,w),this.finish()}return d}selectRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),o=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=s===0?0:-s,l=this.tableProps.createCellCoords(e,a),u=this.tableProps.createCellCoords(r,o-1),c=this.tableProps.createCellRange(l,l,u).isValid({countRows:i,countCols:o,countRowHeaders:s,countColHeaders:0});if(c){let h=0,d=0;Number.isInteger(n==null?void 0:n.row)&&Number.isInteger(n==null?void 0:n.col)?(h=Xe(n.row,Math.min(e,r),Math.max(e,r)),d=Xe(n.col,a,o-1)):(h=e,d=Xe(n,a,o-1));const f=this.tableProps.createCellCoords(h,d),g=s===0?0:Xe(f.col,a,-1),w=o-1,v=this.tableProps.createCellCoords(e,g),b=this.tableProps.createCellCoords(r,w);this.runLocalHooks("beforeSelectRows",v,b,f),v.col=g,b.col=w,this.setRangeStartOnly(v,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(b),this.runLocalHooks("afterSelectRows",v,b,f),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),r=this.tableProps.countCols();if(e===0||r===0){this.deselect();return}const n=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:o,highlight:s}=n;this.clear(),s.assign({row:Xe(s.row,-1/0,e-1),col:Xe(s.col,-1/0,r-1)}),i.assign({row:Xe(i.row,-1/0,e-1),col:Xe(i.col,-1/0,r-1)}),o.assign({row:Xe(o.row,0,e-1),col:Xe(o.col,0,r-1)}),this.selectedRange.ranges.push(n),this.highlight.isEnabledFor(gd,this.selectedRange.current().highlight)&&this.highlight.getFocus().add(s).commit().syncWith(n),this.applyAndCommit(n)}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const r=this.getLayerLevel(),n=this.selectedRange.current();this.highlight.isEnabledFor(gd,n.highlight)&&this.highlight.getFocus().commit().syncWith(n);for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();o.commit(),s.commit(),a.commit(),l.commit(),u.commit(),c.commit(),h.commit(),d.commit(),f.commit()}this.highlight.useLayerLevel(r)}}yt(xF,Hr);const fH=/^(\r\n|\n\r|\r|\n)/,d8=/^[^\t\r\n]+/,gH=/^\t/;function f8(t){const e=[[""]];if(t.length===0)return e;let r=0,n=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(gH))t=t.replace(gH,""),r+=1,e[n][r]="";else if(t.match(fH))t=t.replace(fH,""),r=0,n+=1,e[n]=[""];else{let o="";if(t.startsWith('"')){let s=0,a=!0;for(;a;){const l=t.slice(0,1);l==='"'&&(s+=1),o+=l,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&s%2===0)&&(a=!1)}o=o.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const s=t.match(d8);o=s?s[0]:"",t=t.slice(o.length)}e[n][r]=o}return e}function pd(t){let e,r,n,i,o="",s;for(e=0,r=t.length;e<r;e+=1){for(i=t[e].length,n=0;n<i;n+=1)n>0&&(o+=" "),s=t[e][n],typeof s=="string"?s.indexOf(`
|
|
530
|
+
`)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==r-1&&(o+=`
|
|
531
|
+
`)}return o}function Wa(t,e,r){return(e=g8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g8(t){var e=m8(t,"string");return typeof e=="symbol"?e:e+""}function m8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ec{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,r,n){Wa(this,"hot",void 0),Wa(this,"metaManager",void 0),Wa(this,"tableMeta",void 0),Wa(this,"dataSource",void 0),Wa(this,"duckSchema",void 0),Wa(this,"colToPropCache",void 0),Wa(this,"propToColCache",void 0),this.hot=e,this.metaManager=n,this.tableMeta=n.getTableMeta(),this.dataSource=r,this.refreshDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(typeof e>"u")throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const r=this.tableMeta.columns;let n;if(this.colToPropCache=[],this.propToColCache=new Map,r){let i=0,o=0,s=!1;if(typeof r=="function"){const a=z0(e);i=a>0?a:this.countFirstRowKeys(),s=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,r.length)}for(n=0;n<i;n++){const a=s?r(n):r[n];if(Ve(a)){if(typeof a.data<"u"){const l=s?o:n;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}o+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return fF(this.dataSource)}recursiveDuckColumns(e,r,n){let i=r,o=n,s;return typeof i>"u"&&(i=0,o=""),typeof e=="object"&&!Array.isArray(e)&&We(e,(a,l)=>{a===null?(s=o+l,this.colToPropCache.push(s),this.propToColCache.set(s,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const r=this.hot.toPhysicalColumn(e);return r===null?e:this.colToPropCache&&pe(this.colToPropCache[r])?this.colToPropCache[r]:r}propToCol(e){const r=this.propToColCache.get(e);if(pe(r))return this.hot.toVisualColumn(r);const n=this.hot.toVisualColumn(e);return n===null?e:n}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?Fd(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:n,mode:i="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.hot.countSourceRows();let s=o,a=0,l=e;if((typeof l!="number"||l>=o)&&(l=o),l<this.hot.countRows()&&(s=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,r,n)===!1||s===null)return{delta:0};const c=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<r&&o+a<c;){let g=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?g=on(this.getSchema()):(g=[],Ce(h-1,()=>g.push(null))):this.hot.dataType==="function"?g=this.tableMeta.dataSchema(l+a):(g={},Sw(g,this.getSchema())),d.push(g),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(s=Math.min(s+1,o)),this.spliceData(s,0,d);const f=this.hot.toVisualRow(s);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):n!=="auto"&&this.metaManager.createRow(s,r)),this.hot.runHooks("afterCreateRow",f,a,n),{delta:a,startPhysicalIndex:s}}createCol(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:n,mode:i="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const o=this.dataSource,s=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,r,n)===!1)return{delta:0};let c=a;l<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,g=c;i==="end"&&(g=Math.min(g+1,a));const w=g;for(;f<r&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let b=0;b<h;b+=1)typeof o[b]>"u"&&(o[b]=[]),o[b].push(null);else o.push([null]);else for(let b=0;b<h;b++)o[b].splice(g,0,null);f+=1,g+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,f),f>0&&(e==null?this.metaManager.createColumn(null,f):n!=="auto"&&this.metaManager.createColumn(w,r));const v=this.hot.toVisualColumn(w);return this.hot.runHooks("afterCreateCol",v,f,n),this.refreshDuckSchema(),{delta:f,startPhysicalIndex:w}}removeRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-r;const o=this.visualRowsToPhysical(i,r),s=this.hot.countSourceRows();if(i=(s+i)%s,this.hot.runHooks("beforeRemoveRow",i,o.length,o,n)===!1)return!1;const l=o.length;if(this.filterData(i,l,o),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(o);const c=pe(this.tableMeta.columns)||pe(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!c&&this.hot.columnIndexMapper.setIndexesSequence([])}return o.slice(0).sort((c,h)=>h-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",i,l,o,n),!0}removeCol(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;if(this.hot.dataType==="object"||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-r:e;i=(this.hot.countCols()+i)%this.hot.countCols();const o=this.visualColumnsToPhysical(i,r),s=o.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,r,o,n)===!1)return!1;let l=!0;const u=s.length,c=this.dataSource;for(let h=0;h<u;h++)l&&o[0]!==o[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)c[h].splice(o[0],r),h===0&&this.metaManager.removeColumn(o[0],r);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<u;f++)c[h].splice(s[f],1),h===0&&this.metaManager.removeColumn(s[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(o),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,r,o,n),this.refreshDuckSchema(),!0}spliceCol(e,r,n){const i=this.hot.getDataAtCol(e),o=i.slice(r,r+n),s=i.slice(r+n);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];y1(l,s);let c=0;for(;c<n;)l.push(null),c+=1;return kK(l),this.hot.populateFromArray(r,e,l,null,null,"spliceCol"),o}spliceRow(e,r,n){const i=this.hot.getSourceDataAtRow(e),o=i.slice(r,r+n),s=i.slice(r+n);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];y1(l,s);let c=0;for(;c<n;)l.push(null),c+=1;return this.hot.populateFromArray(e,r,[l],null,null,"spliceRow"),o}spliceData(e,r,n){if(this.hot.runHooks("beforeDataSplice",e,r,n)!==!1){const o=[...this.dataSource.slice(0,e),...n,...this.dataSource.slice(e)];this.dataSource.length=0,o.forEach(s=>this.dataSource.push(s))}}filterData(e,r,n){let i=this.hot.runHooks("filterData",e,r,n);Array.isArray(i)===!1&&(i=this.dataSource.filter((o,s)=>n.indexOf(s)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,r){const n=this.hot.toPhysicalRow(e);let i=this.dataSource[n];const o=this.hot.runHooks("modifyRowData",n);i=isNaN(o)?o:i;const{dataDotNotation:s}=this.hot.getSettings();let a=null;if(i&&i.hasOwnProperty&&dr(i,r))a=i[r];else if(s&&typeof r=="string"&&r.indexOf(".")>-1){let l=i;if(!l)return null;const u=r.split(".");for(let c=0,h=u.length;c<h;c++)if(l=l[u[c]],typeof l>"u")return null;a=l}else typeof r=="function"&&(a=r(this.dataSource.slice(n,n+1)[0]));if(this.hot.hasHook("modifyData")){const l=Bn(a);this.hot.runHooks("modifyData",n,this.propToCol(r),l,"get"),l.isTouched()&&(a=l.value)}return a}getCopyable(e,r){return this.hot.getCellMeta(e,this.propToCol(r)).copyable?this.get(e,r):""}set(e,r,n){const i=this.hot.toPhysicalRow(e);let o=n,s=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(s=isNaN(a)?a:s,this.hot.hasHook("modifyData")){const u=Bn(o);this.hot.runHooks("modifyData",i,this.propToCol(r),u,"set"),u.isTouched()&&(o=u.value)}const{dataDotNotation:l}=this.hot.getSettings();if(s&&s.hasOwnProperty&&dr(s,r))s[r]=o;else if(l&&typeof r=="string"&&r.indexOf(".")>-1){let u=s,c=0,h;const d=r.split(".");for(c=0,h=d.length-1;c<h;c++){if(d[c]==="__proto__"||d[c]==="constructor"||d[c]==="prototype")return;typeof u[d[c]]>"u"&&(u[d[c]]={}),u=u[d[c]]}u[d[c]]=o}else if(typeof r=="function")r(this.dataSource.slice(i,i+1)[0],o);else{if(r==="__proto__"||r==="constructor"||r==="prototype")return;s[r]=o}}visualRowsToPhysical(e,r){const n=this.hot.countSourceRows(),i=[];let o=(n+e)%n,s=r,a;for(;o<n&&s;)a=this.hot.toPhysicalRow(o),i.push(a),s-=1,o+=1;return i}visualColumnsToPhysical(e,r){const n=this.hot.countCols(),i=[];let o=(n+e)%n,s=r;for(;o<n&&s;){const a=this.hot.toPhysicalColumn(o);i.push(a),s-=1,o+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let r=0;r<this.hot.countCols();r++)this.set(e,this.colToProp(r),"")}getLength(){const e=this.tableMeta.maxRows;let r;e<0||e===0?r=0:r=e||1/0;const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(n,r)}getAll(){const e={row:0,col:0},r={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-r.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,r,ec.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,r,n){const i=[];let o,s,a;const l=this.tableMeta.maxRows,u=this.tableMeta.maxCols;if(l===0||u===0)return[];const c=n===ec.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,r.row)),d=Math.min(Math.max(u-1,0),Math.max(e.col,r.col));for(o=Math.min(e.row,r.row);o<=h;o++){a=[];const f=o>=0?this.hot.toPhysicalRow(o):o;for(s=Math.min(e.col,r.col);s<=d&&f!==null;s++)a.push(c.call(this,o,this.colToProp(s)));f!==null&&i.push(a)}return i}getText(e,r){return pd(this.getRange(e,r,ec.DESTINATION_RENDERER))}getCopyableText(e,r){return pd(this.getRange(e,r,ec.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}const{register:p8,getItem:w8,hasItem:AF,getNames:Eme,getValues:Tme}=Gi("cellTypes");function v8(t){if(!AF(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
|
|
532
|
+
Cell type must be an object or a string mapped to an object registered by
|
|
533
|
+
"Handsontable.cellTypes.registerCellType" method`);return w8(t)}function _i(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:r,renderer:n,validator:i}=e;r&&Dn(t,r),n&&Jn(t,n),i&&Yu(t,i),p8(t,e)}function y8(t,e){var r;return t==="CELL_TYPE"?!1:((r=e._automaticallyAssignedMetaProps)===null||r===void 0?void 0:r.has(t))||!dr(e,t)}function Hw(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const n=typeof e.type=="string"?v8(e.type):e.type;if(t._automaticallyAssignedMetaProps&&We(e,(o,s)=>void t._automaticallyAssignedMetaProps.delete(s)),!Ve(n))return;r===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};We(n,(o,s)=>{if(y8(s,r)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),gr(t,i)}function C8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function r(){}M3(r,t);for(let n=0;n<e.length;n++)r.prototype[e[n]]=void 0;return r}function Nm(t){return Number.isInteger(t)&&t>=0}function Dm(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function cg(t){return t==null}const HF=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,headerClassName:void 0,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(t){let e,r,n;for(e=0,r=this.countRows();e<r;e++)if(n=this.getDataAtCell(e,t),Qt(n)===!1)return!1;return!0},isEmptyRow(t){let e,r,n,i;for(e=0,r=this.countCols();e<r;e++)if(n=this.getDataAtCell(t,e),Qt(n)===!1)return typeof n=="object"?(i=this.getCellMeta(t,e),U0(this.getSchema()[i.prop],n)):!1;return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,mergeCells:!1,minCols:0,minRows:0,minSpareCols:0,minSpareRows:0,multiColumnSorting:void 0,navigableHeaders:!1,tabNavigation:!0,nestedHeaders:void 0,nestedRows:void 0,noWordWrapClassName:"htNoWrap",numericFormat:void 0,observeDOMVisibility:!0,outsideClickDeselects:!0,persistentState:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,themeName:void 0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:!0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",viewportColumnRenderingThreshold:0,viewportRowRenderingThreshold:0,visibleRows:10,width:void 0,wordWrap:!0});function mH(t,e,r){return(e=b8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b8(t){var e=S8(t,"string");return typeof e=="symbol"?e:e+""}function S8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function R8(){return class{}}class E8{constructor(e){mH(this,"metaCtor",R8()),mH(this,"meta",void 0),this.meta=this.metaCtor.prototype,gr(this.meta,HF()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var r;gr(this.meta,e),Hw(this.meta,{...e,type:(r=e.type)!==null&&r!==void 0?r:this.meta.type},e)}}function T8(t,e,r){return(e=_8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _8(t){var e=M8(t,"string");return typeof e=="symbol"?e:e+""}function M8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class P8{constructor(e){T8(this,"meta",void 0);const r=e.getMetaConstructor();this.meta=new r}getMeta(){return this.meta}updateMeta(e){gr(this.meta,e),Hw(this.meta,e,e)}}function hg(t,e,r){return(e=I8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I8(t){var e=O8(t,"string");return typeof e=="symbol"?e:e+""}function O8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gp{constructor(e){hg(this,"valueFactory",void 0),hg(this,"data",[]),hg(this,"index",[]),hg(this,"holes",new Set),this.valueFactory=e}obtain(e){Dm(()=>Nm(e),"Expecting an unsigned number.");const r=this._getStorageIndexByKey(e);let n;if(r>=0)n=this.data[r],n===void 0&&(n=this.valueFactory(e),this.data[r]=n);else if(n=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=n,this.index[e]=i}else this.data.push(n),this.index[e]=this.data.length-1;return n}insert(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Dm(()=>Nm(e)||cg(e),"Expecting an unsigned number or null/undefined argument.");const n=[],i=this.data.length;for(let s=0;s<r;s++)n.push(i+s),this.data.push(void 0);const o=cg(e)?this.index.length:e;this.index=[...this.index.slice(0,o),...n,...this.index.slice(o)]}remove(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Dm(()=>Nm(e)||cg(e),"Expecting an unsigned number or null/undefined argument.");const n=this.index.splice(cg(e)?this.index.length-r:e,r);for(let i=0;i<n.length;i++){const o=n[i];typeof o=="number"&&this.holes.add(o)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,r)=>e!==void 0&&!this.holes.has(r))[Symbol.iterator]()}entries(){const e=[];for(let n=0;n<this.data.length;n++){const i=this._getKeyByStorageIndex(n);i!==-1&&this.data[n]!==void 0&&e.push([i,this.data[n]])}let r=0;return{next:()=>{if(r<e.length){const n=e[r];return r+=1,{value:n,done:!1}}return{done:!0}}}}clear(){this.data=[],this.index=[],this.holes.clear()}_getStorageIndexByKey(e){return this.index.length>e?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}function pH(t,e,r){return(e=x8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x8(t){var e=A8(t,"string");return typeof e=="symbol"?e:e+""}function A8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const H8=["data","width"];class N8{constructor(e){pH(this,"globalMeta",void 0),pH(this,"metas",new gp(()=>this._createMeta())),this.globalMeta=e,this.metas=new gp(()=>this._createMeta())}updateMeta(e,r){const n=this.getMeta(e);gr(n,r),Hw(n,r)}createColumn(e,r){this.metas.insert(e,r)}removeColumn(e,r){this.metas.remove(e,r)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return C8(this.globalMeta.getMetaConstructor(),H8).prototype}}function wH(t,e,r){return(e=D8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D8(t){var e=k8(t,"string");return typeof e=="symbol"?e:e+""}function k8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class L8{constructor(e){wH(this,"columnMeta",void 0),wH(this,"metas",new gp(()=>this._createRow())),this.columnMeta=e}updateMeta(e,r,n){const i=this.getMeta(e,r);gr(i,n),Hw(i,n)}createRow(e,r){this.metas.insert(e,r)}createColumn(e,r){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).insert(e,r)}removeRow(e,r){this.metas.remove(e,r)}removeColumn(e,r){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).remove(e,r)}getMeta(e,r,n){const i=this.metas.obtain(e).obtain(r);return n===void 0?i:i[n]}setMeta(e,r,n,i){var o;const s=this.metas.obtain(e).obtain(r);(o=s._automaticallyAssignedMetaProps)===null||o===void 0||o.delete(n),s[n]=i}removeMeta(e,r,n){const i=this.metas.obtain(e).obtain(r);delete i[n]}getMetas(){const e=[],r=Array.from(this.metas.values());for(let n=0;n<r.length;n++)pe(r[n])&&e.push(...r[n].values());return e}getMetasAtRow(e){Dm(()=>Nm(e),"Expecting an unsigned number.");const r=new Map(this.metas);return r.has(e)?Array.from(r.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new gp(e=>this._createMeta(e))}_createMeta(e){const r=this.columnMeta.getMetaConstructor(e);return new r}}class NF{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new E8(e),this.tableMeta=new P8(this.globalMeta),this.columnMeta=new N8(this.globalMeta),this.cellMeta=new L8(this.columnMeta),n.forEach(i=>new i(this)),this.globalMeta.updateMeta(r)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,r){this.columnMeta.updateMeta(e,r)}getCellMeta(e,r,n){const i=this.cellMeta.getMeta(e,r);return i.visualRow=n.visualRow,i.visualCol=n.visualColumn,i.row=e,i.col=r,n.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,r,n){if(typeof n!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,r,n)}setCellMeta(e,r,n,i){this.cellMeta.setMeta(e,r,n,i)}updateCellMeta(e,r,n){this.cellMeta.updateMeta(e,r,n)}removeCellMeta(e,r,n){this.cellMeta.removeMeta(e,r,n)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,r)}removeRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,r)}createColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,r),this.columnMeta.createColumn(e,r)}removeColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,r),this.columnMeta.removeColumn(e,r)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}yt(NF,Hr);function vH(t,e,r,n){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=n,h=Bi(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":mt(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new ec(i,t,u);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const g=f.getSchema();t=[];let w,v=0,b=0;for(v=0,b=d.startRows;v<b;v++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)w=on(g),t.push(w);else if(i.dataType==="array")w=on(g[0]),t.push(w);else{w=[];for(let p=0,_=d.startCols;p<_;p++)w.push(null);t.push(w)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),d.data=t,f.dataSource=t,s.data=t,s.dataType=i.dataType,s.colToProp=f.colToProp.bind(f),s.propToCol=f.propToCol.bind(f),s.countCachedColumns=f.countCachedColumns.bind(f),r(f),i.runHooks(`after${h}`,t,c,l),c||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&Pe(i.rootElement,[d$(-1),vw(i.countCols()+(i.view?i.countRowHeaders():0))])}function yH(t,e,r){return(e=$8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $8(t){var e=F8(t,"string");return typeof e=="symbol"?e:e+""}function F8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class V8{constructor(e){var r=this;yH(this,"metaManager",void 0),yH(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return r.extendCellMeta(...arguments)}),fe.getSingleton().add("beforeRender",n=>{n&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var r;const{row:n,col:i}=e;if((r=this.metaSyncMemo.get(n))!==null&&r!==void 0&&r.has(i))return;const{visualRow:o,visualCol:s}=e,a=this.metaManager.hot,l=a.colToProp(s);e.prop=l,a.runHooks("beforeGetCellMeta",o,s,e);const u=dr(e,"type")?e.type:null;let c=mt(e.cells)?e.cells(n,i,l):null;if(u)if(c){var h;c.type=(h=c.type)!==null&&h!==void 0?h:u}else c={type:u};c&&this.metaManager.updateCellMeta(n,i,c),a.runHooks("afterGetCellMeta",o,s,e),this.metaSyncMemo.has(n)||this.metaSyncMemo.set(n,new Set),this.metaSyncMemo.get(n).add(i)}}function W8(t,e,r){B8(t,e),e.set(t,r)}function B8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ob(t,e,r){return(e=j8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j8(t){var e=U8(t,"string");return typeof e=="symbol"?e:e+""}function U8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function z8(t,e){return t.get(Y8(t,e))}function Y8(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var CH=new WeakMap;class G8{constructor(e){Ob(this,"metaManager",void 0),Ob(this,"usageTracker",new Set),Ob(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(r){if(this.metaManager.hot.isRtl()&&r==="fixedColumnsLeft")throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),W8(this,CH,(r,n,i)=>{if(!i)throw new Error(`The \`${r}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,r)=>{const{initOnly:n,target:i,onChange:o}=e,s=typeof i=="string",a=s?i:r,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],o?(this.installPropWatcher(r,l,o),s&&this.installPropWatcher(i,l,o)):n&&(this.installPropWatcher(r,l,z8(CH,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(r))})}installPropWatcher(e,r,n){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[r]},set(o){const s=!i.usageTracker.has(e);i.usageTracker.add(e),n.call(i,e,o,s),this[r]=o},enumerable:!0,configurable:!0})}}const DF="gridDefault",_a="editorManager.handlingEditor",q8={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},K8="hooksRefRegisterer",kF={_hooksStorage:Object.create(null),addHook(t,e){return this._hooksStorage[t]||(this._hooksStorage[t]=[]),this.hot.addHook(t,e),this._hooksStorage[t].push(e),this},removeHooksByKey(t){k(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){We(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};xs(kF,"MIXIN_NAME",K8,{writable:!1,enumerable:!1});function bi(t,e,r){return(e=X8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X8(t){var e=Z8(t,"string");return typeof e=="symbol"?e:e+""}function Z8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const J8="base",Zt=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class $c{static get EDITOR_TYPE(){return J8}constructor(e){bi(this,"hot",void 0),bi(this,"state",Zt.VIRGIN),bi(this,"_opened",!1),bi(this,"_fullEditMode",!1),bi(this,"_closeCallback",null),bi(this,"TD",null),bi(this,"row",null),bi(this,"col",null),bi(this,"prop",null),bi(this,"originalValue",null),bi(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,r,n,i,o,s){this.TD=i,this.row=e,this.col=r,this.prop=n,this.originalValue=o,this.cellProperties=s,this.state=this.isOpened()?this.state:Zt.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,r){let n,i,o,s;if(r){const l=this.hot.getSelectedLast();n=Math.max(Math.min(l[0],l[2]),0),i=Math.max(Math.min(l[1],l[3]),0),o=Math.max(l[0],l[2]),s=Math.max(l[1],l[3])}else[n,i,o,s]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",n,i,!1,"meta");Array.isArray(a)&&([n,i]=a),this.hot.populateFromArray(n,i,e,o,s,"edit")}beginEditing(e,r){if(this.state!==Zt.VIRGIN)return;const n=this.hot,i=n.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=n.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=Zt.EDITING,this.isInFullEditMode()){const l=typeof e=="string"?e:Ft(this.originalValue);this.setValue(l)}this.open(r),this._opened=!0,this.focus(),n.view.render(),n.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",s),n.view.scrollViewport(n._createCellCoords(i,o))||(this.hot.removeHook("afterScroll",s),s())}finishEditing(e,r,n){let i;if(n){const o=this._closeCallback;this._closeCallback=s=>{o&&o(s),n(s),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Zt.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Zt.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const o=this.getValue();this.cellProperties.trimWhitespace?i=[[typeof o=="string"?String.prototype.trim.call(o||""):o]]:i=[[o]],this.state=Zt.WAITING,this.saveValue(i,r),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Zt.FINISHED,this.discardEditor(s)}):(this.state=Zt.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Zt.FINISHED,this.discardEditor()}discardEditor(e){this.state===Zt.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Zt.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Zt.VIRGIN,this._fireCallbacks(!0),this.hot.getShortcutManager().setActiveContextName("grid")))}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===Zt.WAITING}getEditedCellRect(){var e;const r=this.getEditedCell();if(!r)return;const{wtOverlays:n,wtViewport:i}=this.hot.view._wt,o=this.hot.rootWindow,s=jr(r),a=nr(r),l=jr(this.hot.rootElement),u=nr(this.hot.rootElement),c=n.topOverlay.holder,h=n.inlineStartOverlay.holder,d=c!==o?c.scrollTop:0,f=h!==o?h.scrollLeft:0,g=o.innerWidth-l.left-u,{wtTable:w}=(e=n.getParentOverlay(r))!==null&&e!==void 0?e:this.hot.view._wt,v=w.name,b=["master","inline_start"].includes(v)?d:0,p=["master","top","bottom"].includes(v)?f:0,_=s.top===l.top?0:1;let O=s.top-l.top-_-b,T=0;this.hot.isRtl()?T=o.innerWidth-s.left-a-g-1+p:T=s.left-l.left-1-p,["top","top_inline_start_corner"].includes(v)&&(O+=n.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(v)&&(T+=Math.abs(n.inlineStartOverlay.getOverlayOffset()));const M=this.hot.hasColHeaders(),P=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),G=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),A=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(M&&P<=0||P===A)&&(O+=1),G<=0&&(T+=1);const q=i.rowsRenderCalculator.startPosition,Q=i.columnsRenderCalculator.startPosition,ue=Math.abs(n.inlineStartOverlay.getScrollPosition()),J=n.topOverlay.getScrollPosition(),Z=Or(this.hot.rootDocument);let ne=r.offsetTop;if(["inline_start","master"].includes(v)&&(ne+=q-J),["bottom","bottom_inline_start_corner"].includes(v)){const{wtViewport:B,wtTable:Y}=n.bottomOverlay.clone;ne+=B.getWorkspaceHeight()-Y.getHeight()-Z}let ee=r.offsetLeft;this.hot.isRtl()?(ee>=0?ee=w.getWidth()-r.offsetLeft:ee=Math.abs(ee),ee+=Q-ue-a):["top","master","bottom"].includes(v)&&(ee+=Q-ue);const te=o.getComputedStyle(this.TD),ae=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",z=parseInt(te[ae],10)>0?0:1,$=parseInt(te.borderTopWidth,10)>0?0:1,m=nr(r)+z,C=fr(r)+$,y=S$(c)?Z:0,I=R$(h)?Z:0,x=this.hot.view.maximumVisibleElementWidth(ee)-y+z,N=Math.max(this.hot.view.maximumVisibleElementHeight(ne)-I+$,this.hot.view.getDefaultRowHeight());return{top:O,start:T,height:C,maxHeight:N,width:m,maxWidth:x}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let r="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?r="top-inline-start-corner":r="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?r="bottom-inline-start-corner":r="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(r="inline-start"),r}}yt($c,kF);const Q8={name:"editorCloseAndSaveByArrowKeys",callback(t,e,r){const n=t._getEditorManager(),i=n.getActiveEditor();i.isInFullEditMode()&&i.state===Zt.EDITING||(n.closeEditorAndSaveChanges(),t.getSelected()&&(r.includes("arrowdown")?t.selection.transformStart(1,0):r.includes("arrowup")?t.selection.transformStart(-1,0):r.includes("arrowleft")?t.selection.transformStart(0,-1*t.getDirectionFactor()):r.includes("arrowright")&&t.selection.transformStart(0,t.getDirectionFactor())),e.preventDefault())}},e7={name:"editorCloseAndSaveByEnter",callback(t,e){const r=t._getEditorManager();r.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),r.moveSelectionAfterEnter(e)}},t7={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},r7={name:"editorFastOpen",callback(t,e){const{highlight:r}=t.getSelectedRangeLast();r.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},n7={name:"editorOpen",callback(t,e,r){const n=t._getEditorManager(),i=t.getSelectedRangeLast(),{highlight:o}=i;if(t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const s=t.getSettings(),a=typeof s.enterMoves=="function"?s.enterMoves(e):s.enterMoves;r.includes("shift")?t.selection.transformFocus(-a.row,-a.col):t.selection.transformFocus(a.row,a.col);return}o.isHeader()||(t.getSettings().enterBeginsEditing?n.cellProperties.readOnly?n.moveSelectionAfterEnter(e):n.openEditor(null,e,!0):n.moveSelectionAfterEnter(e),Yi(e))}};function i7(){return[q8,Q8,e7,t7,r7,n7]}const o7={name:"extendCellsSelectionDown",callback(t){const{selection:e}=t,{highlight:r}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},s7={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{selection:e,rowIndexMapper:r}=t,{to:n}=t.getSelectedRangeLast(),i=Math.min(n.row+t.countVisibleRows(),t.countRows()-1),o=r.getNearestNotHiddenIndex(i,-1);if(o!==null){const s=t._createCellCoords(o,n.col),a=n.row-t.getFirstFullyVisibleRow(),l=Math.min(s.row-a,t.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}},a7={name:"extendCellsSelectionLeft",callback(t){const{selection:e}=t,{highlight:r}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*t.getDirectionFactor()),e.markEndSource())}},l7={name:"extendCellsSelectionRight",callback(t){const{selection:e}=t,{highlight:r}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,t.getDirectionFactor()),e.markEndSource())}},u7={name:"extendCellsSelectionToColumns",callback(t){const{selection:e}=t,{highlight:r,from:n,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):t.selectColumns(n.col,i.col,r),e.markEndSource()}},c7={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast(),s=n.isHeader()&&e.isSelectedByRowHeader();if(n.isCell()||s){const a=r.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=n.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},h7={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&n.isCell()){const s=r.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=n.col,e.markSource("keyboard"),e.setRangeStart(a,void 0,!1,n.clone()),e.setRangeEnd(t._createCellCoords(o.row,s)),e.markEndSource()}}},d7={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&n.isCell()){const s=parseInt(t.getSettings().fixedColumnsStart,10),a=r.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=n.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},f7={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast(),s=n.isHeader()&&e.isSelectedByColumnHeader();if(n.isCell()||s){const a=r.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=i.clone();l.col=n.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},g7={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast(),s=n.isHeader()&&e.isSelectedByColumnHeader();if(n.isCell()||s){const a=r.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=i.clone();l.col=n.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},m7={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast(),s=n.isHeader()&&e.isSelectedByRowHeader();if(n.isCell()||s){const a=r.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=n.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},p7={name:"extendCellsSelectionToRows",callback(t){const{selection:e}=t,{highlight:r,from:n,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):t.selectRows(n.row,i.row,r),e.markEndSource()}},w7={name:"extendCellsSelectionUp",callback(t){const{selection:e}=t,{highlight:r}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},v7={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{selection:e,rowIndexMapper:r}=t,{to:n}=t.getSelectedRangeLast(),i=Math.max(n.row-t.countVisibleRows(),0),o=r.getNearestNotHiddenIndex(i,1);if(o!==null){const s=t._createCellCoords(o,n.col),a=n.row-t.getFirstFullyVisibleRow(),l=Math.max(s.row-a,0);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}};function y7(){return[o7,s7,a7,l7,u7,c7,h7,d7,f7,g7,m7,p7,w7,v7]}const C7={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},b7={name:"moveCellSelectionDownByViewportHeight",callback(t){const{selection:e}=t,{navigableHeaders:r}=t.getSettings(),n=r?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+n;o=o===0?1:o,i===t.countRows()-1?o=1:i+o>t.countRows()&&(o=t.countRows()-i-1),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},S7={name:"moveCellSelectionInlineEnd",callback(t,e){const{selection:r}=t,n=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;r.markSource("keyboard"),r.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?r.transformFocus(-o.row,-o.col):r.transformStart(-o.row,-o.col),r.markEndSource()}},R7={name:"moveCellSelectionInlineStart",callback(t,e){const{selection:r}=t,n=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;r.markSource("keyboard"),r.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?r.transformFocus(o.row,o.col):r.transformStart(o.row,o.col),r.markEndSource()}},E7={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},T7={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},_7={name:"moveCellSelectionToMostBottom",callback(t){const{selection:e}=t,{col:r}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);n===null&&(n=-1),e.setRangeStart(t._createCellCoords(n,r))}},M7={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:r,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),o=r.getNearestNotHiddenIndex(t.countRows()-i-1,-1),s=n.getNearestNotHiddenIndex(t.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(o,s)),e.markEndSource()}},P7={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:r}=t;e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,r.getNearestNotHiddenIndex(t.countCols()-1,-1))),e.markEndSource()}},I7={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:r}=t,n=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,o=r.getNearestNotHiddenIndex(n,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(i,o)),e.markEndSource()}},O7={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:r}=t,n=t.getSelectedRangeLast().highlight.row;let i=r.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(n,i)),e.markEndSource()}},x7={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:r}=t,{row:n}=t.getSelectedRangeLast().highlight;let i=r.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(n,i)),e.markEndSource()}},A7={name:"moveCellSelectionToMostTop",callback(t){const{selection:e}=t,{col:r}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);n===null&&(n=-t.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(n,r)),e.markEndSource()}},H7={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:r,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedRowsTop,10),o=parseInt(t.getSettings().fixedColumnsStart,10),s=r.getNearestNotHiddenIndex(i,1),a=n.getNearestNotHiddenIndex(o,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(s,a)),e.markEndSource()}},N7={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},D7={name:"moveCellSelectionUpByViewportHight",callback(t){const{selection:e}=t,{navigableHeaders:r}=t.getSettings(),n=r?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+n;o=o===0?-1:-o,i===-n?o=-1:i+o<n&&(o=-(i+n)),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function k7(){return[C7,b7,S7,R7,E7,T7,_7,M7,P7,I7,O7,x7,A7,H7,N7,D7]}const L7={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},$7={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),r=t.getFirstFullyVisibleRow()-1,n=t.getFirstFullyVisibleColumn()-1,i=t.getLastFullyVisibleRow()+1,o=t.getLastFullyVisibleColumn()+1,s=t._createCellCoords(r,n),a=t._createCellCoords(i,o);if(!t._createCellRange(s,s,a).includes(e)&&(e.row>=0||e.col>=0)){const u={};if(e.col>=0){const c=Math.floor(t.countVisibleCols()/2);u.col=Math.max(e.col-c,0)}if(e.row>=0){const c=Math.floor(t.countVisibleRows()/2);u.row=Math.max(e.row-c,0)}t.scrollViewportTo({...u,verticalSnap:"top",horizontalSnap:"start"})}}},F7={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},V7={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},W7={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:r,col:n}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(r,n),o=new Map;for(let s=0;s<e.length;s++)e[s].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==r||l!==n)){const{readOnly:u}=t.getCellMeta(a,l);u||o.set(`${a}x${l}`,[a,l,i])}});t.setDataAtCell(Array.from(o.values()))}},B7=[...i7(),...y7(),...k7(),L7,$7,F7,V7,W7];function LF(t){const e={};return B7.forEach(r=>{let{name:n,callback:i}=r;e[n]=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i(t,...s)}}),e}function j7(t){const e=t.getShortcutManager().addContext("editor"),r=LF(t),n={group:_a};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>r.editorCloseAndSaveByEnter(i,o)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,o)=>r.editorCloseAndSaveByEnter(i,o)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:(i,o)=>r.editorCloseAndSave(i,o)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,o)=>r.editorCloseAndSaveByArrowKeys(i,o)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>r.editorCloseWithoutSaving()}],n)}function U7(t){const e=t.getShortcutManager().addContext("grid"),r=LF(t),n={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return pe(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:DF};e.addShortcuts([{keys:[["F2"]],callback:i=>r.editorFastOpen(i)},{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>r.editorOpen(i,o)},{keys:[["Backspace"],["Delete"]],callback:()=>r.emptySelectedCells()}],{group:_a,runOnlyIf:()=>pe(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>r.selectAllCells(),runOnlyIf:()=>{var i;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var i;return(i=t.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isHeader()},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>r.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>r.populateSelectedCellsData(),runOnlyIf:()=>{var i,o;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())&&((o=t.getSelectedRangeLast())===null||o===void 0?void 0:o.getCellsCount())>1}},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>r.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>r.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>r.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>r.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>r.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>r.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>r.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>r.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>r.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>r.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>r.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>r.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>r.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:i=>r.moveCellSelectionInlineStart(i)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:i=>r.moveCellSelectionInlineEnd(i)},{keys:[["Control/Meta","Backspace"]],callback:()=>r.scrollToFocusedCell()}],n)}function z7(t){[U7,j7].forEach(e=>e(t))}function Y7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=t.rootElement,n=bH(t),i=bH(t);return n.addEventListener("focus",()=>e==null?void 0:e.onFocusFromTop()),i.addEventListener("focus",()=>e==null?void 0:e.onFocusFromBottom()),r.firstChild.before(n),r.lastChild.after(i),{activate(){t._registerTimeout(()=>{n.tabIndex=0,i.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{n.tabIndex=-1,i.tabIndex=-1},10)}}}function bH(t){const r=t.rootDocument.createElement("input");return r.type="text",r.name="__htFocusCatcher",r.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&Pe(r,[Ld("Focus catcher")]),r}function G7(t){const e=q7(t);let r;const{activate:n,deactivate:i}=Y7(t,{onFocusFromTop(){var h;const d=(h=e(r))!==null&&h!==void 0?h:oE(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(r))!==null&&h!==void 0?h:sE(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_below",d),t.selectCell(d.row,d.col)),t.listen()}}),o={wrapped:!1,flipped:!1};let s=!0,a=!1,l=!1;t.addHook("afterListen",()=>i()),t.addHook("afterUnlisten",()=>n()),t.addHook("afterSelection",(h,d,f,g,w)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,w.value=!0),s){var v;r=(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight}}),t.addHook("beforeRowWrap",(h,d,f)=>{o.wrapped=!0,o.flipped=f});function u(){o.wrapped=!1,o.flipped=!1,t.deselectCell(),t.unlisten()}const c={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:DF,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([{...c,callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(s=!1),h||(l=!0)},position:"before"},{...c,callback:h=>{const{tabNavigation:d,autoWrapRow:f}=t.getSettings();if(a=!1,s=!0,!d||!t.selection.isSelected()||f&&o.wrapped&&o.flipped||!f&&o.wrapped)return f&&o.wrapped&&o.flipped&&(r=h.shiftKey?oE(t):sE(t)),u(),!1;h.preventDefault()},position:"after"}])}function oE(t){const{rowIndexMapper:e,columnIndexMapper:r}=t,{navigableHeaders:n}=t.getSettings();let i=n&&t.countColHeaders()>0?-t.countColHeaders():0,o=n&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),o===0&&(o=r.getVisualFromRenderableIndex(o)),i===null||o===null?null:t._createCellCoords(i,o)}function sE(t){var e,r;const{rowIndexMapper:n,columnIndexMapper:i}=t,{navigableHeaders:o}=t.getSettings();let s=n.getRenderableIndexesLength()-1,a=i.getRenderableIndexesLength()-1;if(s<0){if(!o||t.countColHeaders()===0)return null;s=-1}if(a<0){if(!o||t.countColHeaders()===0)return null;a=-1}return t._createCellCoords((e=n.getVisualFromRenderableIndex(s))!==null&&e!==void 0?e:s,(r=i.getVisualFromRenderableIndex(a))!==null&&r!==void 0?r:a)}function q7(t){return e=>{if(!e)return null;const r=oE(t),n=sE(t);return e.col<r.col&&(e.col=r.col),e.col>n.col&&(e.col=n.col),e.row<r.row&&(e.row=r.row),e.row>n.row&&(e.row=n.row),e}}function Fc(t){Rs(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function Nw(t){const{selection:e,view:r}=t,n=t.getSelectedRangeLast(),i=e.getSelectionSource(),o=r.getFirstFullyVisibleColumn(),s=r.getLastFullyVisibleColumn(),a=n.getTopStartCorner().col,l=n.getBottomEndCorner().col,u=a<=o,c=l>=s,h=r.getFirstFullyVisibleRow(),d=r.getLastFullyVisibleRow(),f=n.getTopStartCorner().row,g=n.getBottomEndCorner().row,w=f<=h,v=g>=d;return{getComputedColumnTarget(b){return i==="mouse"||i==="keyboard"?b.col:u&&c?n.highlight.col:u?a:c?l:b.col},getComputedRowTarget(b){return i==="mouse"||i==="keyboard"?b.row:w&&v?n.highlight.row:w?f:v?g:b.row}}}function K7(t){return e=>{const r=Nw(t).getComputedColumnTarget(e);t.scrollViewportTo({col:r},()=>{const n=!!t.getSettings().colHeaders;Fc(t.getCell(n?-1:0,r,!0))})}}function X7(){return()=>{}}function Z7(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const{row:r,col:n}=t.getSelectedRangeLast().highlight;Fc(t.getCell(r,n,!0))})}}function J7(t){return e=>{const r=Nw(t),n={row:r.getComputedRowTarget(e),col:r.getComputedColumnTarget(e)};t.scrollViewportTo(n,()=>{const{row:i,col:o}=n;Fc(t.getCell(i,o,!0))})}}function Q7(t){return e=>{const r=Nw(t),n={row:r.getComputedRowTarget(e),col:r.getComputedColumnTarget(e)};t.scrollViewportTo(n,()=>{const{row:i,col:o}=n;Fc(t.getCell(i,o,!0))})}}function eZ(t){return e=>{const r=Nw(t).getComputedRowTarget(e);t.scrollViewportTo({row:r},()=>{const n=!!t.getSettings().rowHeaders;Fc(t.getCell(r,n?-1:0,!0))})}}function tZ(t){return e=>{const r=t.selection.getSelectionSource(),{row:n,col:i}=e,o=()=>{Fc(t.getCell(n,i,!0))};if(n<0&&i>=0)t.scrollViewportTo({col:i},o);else if(i<0&&n>=0)t.scrollViewportTo({row:n},o);else{if(r==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||n===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:n,col:i},o)}}}function rZ(t){const{selection:e}=t;let r=!1,n=!1;return{resume(){n=!1},suspend(){n=!0},skipNextScrollCycle(){r=!0},scrollTo(i){var o;if(r||n){r=!1;return}let s;e.isFocusSelectionChanged()?s=Z7(t):e.isSelectedByCorner()?s=X7():e.isSelectedByRowHeader()?s=eZ(t):e.isSelectedByColumnHeader()?s=K7(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=J7(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=tZ(t):e.getSelectedRange().size()>1&&(s=Q7(t)),(o=s)===null||o===void 0||o(i)}}}const SH=new Map([[" ","space"],["spacebar","space"],["scroll","scrolllock"],["del","delete"],["esc","escape"],["medianexttrack","mediatracknext"],["mediaprevioustrack","mediatrackprevious"],["volumeup","audiovolumeup"],["volumedown","audiovolumedown"],["volumemute","audiovolumemute"],["multiply","*"],["add","+"],["divide","/"],["subtract","-"],["left","arrowleft"],["right","arrowright"],["up","arrowup"],["down","arrowdown"]]),dg=t=>t.map(e=>{const r=e.toLowerCase();return SH.has(r)?SH.get(r):r}).sort().join("+"),nZ=t=>t.split("+"),RH=new Map([[96,"numpad0"],[97,"numpad1"],[98,"numpad2"],[99,"numpad3"],[100,"numpad4"],[101,"numpad5"],[102,"numpad6"],[103,"numpad7"],[104,"numpad8"],[105,"numpad9"],[106,"multiply"],[107,"add"],[108,"decimal"],[109,"subtract"],[110,"decimal"],[111,"divide"],[112,"f1"],[113,"f2"],[114,"f3"],[115,"f4"],[116,"f5"],[117,"f6"],[118,"f7"],[119,"f8"],[120,"f9"],[121,"f10"],[122,"f11"],[123,"f12"],[186,"semicolon"],[187,"equal"],[188,"comma"],[189,"minus"],[190,"period"],[191,"slash"],[192,"backquote"],[219,"bracketleft"],[220,"backslash"],[221,"bracketright"],[222,"quote"]]),xb=t=>{let{which:e,key:r}=t;if(RH.has(e))return RH.get(e);const n=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(n)?n:r.toLowerCase()},$F=Symbol("shortcut-context");function FF(t){return Ve(t)&&t.__kindOf===$F}const iZ=t=>{const e=Ew({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),r=function(){let{keys:l,callback:u,group:c,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:f=!0,stopPropagation:g=!1,relativeToGroup:w,position:v,forwardToContext:b}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if($t(c))throw new Error("You need to define the shortcut's group.");if(mt(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(lt`Pass the shortcut\'s keys as an array of arrays,\x20
|
|
534
|
+
using the KeyboardEvent.key properties:\x20
|
|
535
|
+
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const p={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:g};pe(w)&&(p.relativeToGroup=w,p.position=v),FF(b)&&(p.forwardToContext=b),l.forEach(_=>{const O=dg(_);if(e.hasItem(O)){const M=e.getItem(O);let P=M.findIndex(G=>G.group===w);P!==-1?v==="before"?P-=1:P+=1:P=M.length,M.splice(P,0,p)}else e.addItem(O,[p])})},n=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{We(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),r(c)})},i=l=>{const u=dg(l);e.removeItem(u)};return{__kindOf:$F,addShortcut:r,addShortcuts:n,getShortcuts:l=>{const u=dg(l),c=e.getItem(u);return pe(c)?c.slice():[]},hasShortcut:l=>{const u=dg(l);return e.hasItem(u)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const f=d.filter(g=>g.group!==l);f.length===0?i(nZ(h)):(d.length=0,d.push(...f))})}}};function oZ(){const t=new Set;return{press(e){t.add(e)},release(e){t.delete(e)},releaseAll(){t.clear()},isPressed(e){return t.has(e)}}}const sZ=["meta","alt","shift","control"],Ch=oZ(),bh=[];let fg=0;function aZ(t,e,r,n,i){const o=f=>sZ.includes(f),s=function(f){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const w=[];return f.altKey&&w.push("alt"),g&&(f.ctrlKey||f.metaKey)?w.push("control/meta"):(f.ctrlKey&&w.push("control"),f.metaKey&&w.push("meta")),f.shiftKey&&w.push("shift"),w},a=f=>{if(e(f)===!1||r(f)===!1||f.keyCode===229||typeof f.key!="string"||Sl(f))return;const w=xb(f);let v=[];o(w)||(v=s(f));const b=[w].concat(v);!i(f,b)&&(N1()&&v.includes("meta")||!N1()&&v.includes("control"))&&i(f,[w].concat(s(f,!0))),n(f)},l=f=>{if(typeof f.key=="string"){const g=xb(f);o(g)&&Ch.press(g)}},u=f=>{if(typeof f.key=="string"){const g=xb(f);o(g)&&Ch.release(g)}},c=()=>{Ch.releaseAll()};return{mount:()=>{let f=t;for(fg+=1;f;)fg===1&&(f.document.documentElement.addEventListener("keydown",l),bh.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),bh.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=vc(f)},unmount:()=>{let f=t;for(fg-=1;f;){if(fg===0){for(let g=0;g<bh.length;g++){const{event:w,listener:v}=bh[g];f.document.documentElement.removeEventListener(w,v)}bh.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=vc(f)}},isPressed:f=>Ch.isPressed(f),releasePressedKeys:()=>Ch.releaseAll()}}const lZ=t=>{let{ownerWindow:e,handleEvent:r,beforeKeyDown:n,afterKeyDown:i}=t;const o=Ew({errorIdExists:g=>`The "${g}" context name is already registered.`});let s="grid";const a=g=>{const w=iZ(g);return o.addItem(g,w),w},l=()=>s,u=g=>o.getItem(g),c=g=>{if(!o.hasItem(g))throw new Error(lt`You've tried to activate the "${g}" shortcut context\x20
|
|
536
|
+
that does not exist. Before activation, register the context using the "addContext" method.`);s=g};let h=!1;const d=function(g,w){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const b=FF(v)?v:u(v);let p=!1;if(!b.hasShortcut(w))return p;const _=b.getShortcuts(w);for(let O=0;O<_.length;O++){const{callback:T,runOnlyIf:M,preventDefault:P,stopPropagation:G,captureCtrl:j,forwardToContext:A}=_[O];if(M(g)===!0){if(h=j,p=T(g,w)===!1,h=!1,P&&g.preventDefault(),G&&(Yi(g),g.stopPropagation()),p)break;A&&d(g,w,A)}}return p},f=aZ(e,r,n,i,d);return f.mount(),{addContext:a,getActiveContextName:l,getContext:u,setActiveContextName:c,isCtrlPressed:()=>!h&&(f.isPressed("control")||f.isPressed("meta")),releasePressedKeys:()=>f.releasePressedKeys(),destroy:()=>f.unmount()}};function EH(t){const{classNames:e}=g3(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let Ab=null;const Hb=new Map;function VF(t,e){var r,n=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new ji(o);let a,l,u,c,h,d,f=!0;W5(i)&&V5(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const g=(r=e==null?void 0:e.layoutDirection)!==null&&r!==void 0?r:"inherit",w=["rtl","ltr"].includes(g)?g:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",w),this.isRtl=function(){return w==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=F9(e.language);const v=Object.fromEntries(Object.entries(e).filter(m=>{let[C]=m;return!(fe.getSingleton().isRegistered(C)||fe.getSingleton().isDeprecated(C))})),b=new NF(o,v,[V8,G8]),p=b.getTableMeta(),_=b.getGlobalMeta(),O=Ew();this.container=this.rootDocument.createElement("div"),t.insertBefore(this.container,t.firstChild),Hm(this)&&(WK(e.licenseKey,t),ie(t,"ht-wrapper")),this.guid=`ht_${s$()}`,Hb.set(this.guid,this),this.columnIndexMapper=new rE,this.rowIndexMapper=new rE,this.columnIndexMapper.addLocalHook("indexesSequenceChange",m=>{o.runHooks("afterColumnSequenceChange",m)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",m=>{o.runHooks("afterRowSequenceChange",m)}),s.addEventListener(this.rootDocument.documentElement,"compositionstart",m=>{o.runHooks("beforeCompositionStart",m)}),l=new r9(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const T=m=>{const{row:C,col:y}=m;return o._createCellCoords(C>=0?o.rowIndexMapper.getRenderableFromVisualIndex(C):C,y>=0?o.columnIndexMapper.getRenderableFromVisualIndex(y):y)},M=m=>{const{row:C,col:y}=m;return o._createCellCoords(C>=0?o.rowIndexMapper.getVisualFromRenderableIndex(C):C,y>=0?o.columnIndexMapper.getVisualFromRenderableIndex(y):y)},P=(m,C)=>{const y=C>m?1:-1,I=Math.min(m,C),x=Math.max(m,C),N=o.rowIndexMapper.getNearestNotHiddenIndex(m,y);return N===null||y===1&&N>x||y===-1&&N<I?null:N>=0?o.rowIndexMapper.getRenderableFromVisualIndex(N):N},G=(m,C)=>{const y=C>m?1:-1,I=Math.min(m,C),x=Math.max(m,C),N=o.columnIndexMapper.getNearestNotHiddenIndex(m,y);return N===null||y===1&&N>x||y===-1&&N<I?null:N>=0?o.columnIndexMapper.getRenderableFromVisualIndex(N):N};let j=new xF(p,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:m=>a.propToCol(m),isEditorOpened:()=>o.getActiveEditor()?o.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return n.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return n.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>o.getShortcutManager(),createCellCoords:(m,C)=>o._createCellCoords(m,C),createCellRange:(m,C,y)=>o._createCellRange(m,C,y),visualToRenderableCoords:T,renderableToVisualCoords:M,findFirstNonHiddenRenderableRow:P,findFirstNonHiddenRenderableColumn:G,isDisabledCellSelection:(m,C)=>m<0||C<0?o.getSettings().disableVisualSelection:o.getCellMeta(m,C).disableVisualSelection});this.selection=j;const A=m=>{let{hiddenIndexesChanged:C}=m;this.forceFullRender=!0,C&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",A),this.rowIndexMapper.addLocalHook("cacheUpdated",A),this.selection.addLocalHook("afterSetRangeEnd",(m,C)=>{const y=Bn(!1),I=this.selection.getSelectedRange(),{from:x,to:N}=I.current(),B=I.size()-1;this.runHooks("afterSelection",x.row,x.col,N.row,N.col,y,B),this.runHooks("afterSelectionByProp",x.row,o.colToProp(x.col),N.row,o.colToProp(N.col),y,B),C&&(!y.isTouched()||y.isTouched()&&!y.value)&&d.scrollTo(m);const Y=j.isSelectedByRowHeader(),R=j.isSelectedByColumnHeader();Y&&R?ie(this.rootElement,["ht__selection--rows","ht__selection--columns"]):Y?(Ee(this.rootElement,"ht__selection--columns"),ie(this.rootElement,"ht__selection--rows")):R?(Ee(this.rootElement,"ht__selection--rows"),ie(this.rootElement,"ht__selection--columns")):Ee(this.rootElement,["ht__selection--rows","ht__selection--columns"]),j.getSelectionSource()!=="shift"&&c.closeEditor(null),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",m=>{this.runHooks("beforeSelectionFocusSet",m.row,m.col)}),this.selection.addLocalHook("afterSetFocus",m=>{const C=Bn(!1);this.runHooks("afterSelectionFocusSet",m.row,m.col,C),(!C.isTouched()||C.isTouched()&&!C.value)&&d.scrollTo(m),c.closeEditor(),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",m=>{const C=m.length-1,{from:y,to:I}=m[C];this.runHooks("afterSelectionEnd",y.row,y.col,I.row,I.col,C),this.runHooks("afterSelectionEndByProp",y.row,o.colToProp(y.col),I.row,o.colToProp(I.col),C)}),this.selection.addLocalHook("afterIsMultipleSelection",m=>{const C=this.runHooks("afterIsMultipleSelection",m.value);m.value&&(m.value=C)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),o.view.render(),Ee(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSetRangeStart",...C)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSetRangeStartOnly",...C)}).addLocalHook("beforeSetRangeEnd",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSetRangeEnd",...C)}).addLocalHook("beforeSelectColumns",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSelectColumns",...C)}).addLocalHook("afterSelectColumns",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterSelectColumns",...C)}).addLocalHook("beforeSelectRows",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSelectRows",...C)}).addLocalHook("afterSelectRows",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterSelectRows",...C)}).addLocalHook("beforeModifyTransformStart",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("modifyTransformStart",...C)}).addLocalHook("afterModifyTransformStart",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterModifyTransformStart",...C)}).addLocalHook("beforeModifyTransformFocus",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("modifyTransformFocus",...C)}).addLocalHook("afterModifyTransformFocus",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterModifyTransformFocus",...C)}).addLocalHook("beforeModifyTransformEnd",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("modifyTransformEnd",...C)}).addLocalHook("afterModifyTransformEnd",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterModifyTransformEnd",...C)}).addLocalHook("beforeRowWrap",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeRowWrap",...C)}).addLocalHook("beforeColumnWrap",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeColumnWrap",...C)}).addLocalHook("insertRowRequire",m=>this.alter("insert_row_above",m,1,"auto")).addLocalHook("insertColRequire",m=>this.alter("insert_col_start",m,1,"auto")),u={alter(m,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,I=arguments.length>3?arguments[3]:void 0,x=arguments.length>4?arguments[4]:void 0;const N=B=>{if(B.length===0)return[];const Y=[...B];return Y.sort((E,S)=>{let[D]=E,[H]=S;return D===H?0:D>H?1:-1}),Mn(Y,(E,S)=>{let[D,H]=S;const F=E[E.length-1],[X,L]=F,W=X+L;if(D<=W){const K=Math.max(H-(W-D),0);F[1]+=K}else E.push([D,H]);return E},[Y[0]])};switch(m){case"insert_row_below":case"insert_row_above":const B=o.countSourceRows();if(p.maxRows===B)return;const Y=m==="insert_row_below"?"below":"above";C=C??(Y==="below"?B:0);const{delta:R,startPhysicalIndex:E}=a.createRow(C,y,{source:I,mode:Y});j.shiftRows(o.toVisualRow(E),R);break;case"insert_col_start":case"insert_col_end":const S=m==="insert_col_end"?"end":"start";C=C??(S==="end"?o.countSourceCols():0);const{delta:D,startPhysicalIndex:H}=a.createCol(C,y,{source:I,mode:S});if(D){if(Array.isArray(p.colHeaders)){const L=[o.toVisualColumn(H),0];L.length+=D,Array.prototype.splice.apply(p.colHeaders,L)}j.shiftColumns(o.toVisualColumn(H),D)}break;case"remove_row":const F=L=>{let W=0;k(L,K=>{let[U,re]=K;const me=Qt(U)?o.countRows()-1:Math.max(U-W,0);if(Number.isInteger(U)&&(U=Math.max(U-W,0)),!a.removeRow(U,re,I))return;if(j.isSelected()){const{row:Ie}=o.getSelectedRangeLast().highlight;Ie>=U&&Ie<=U+re-1&&c.closeEditor(!0)}const Oe=o.countRows(),Be=p.fixedRowsTop;Be>=me+1&&(p.fixedRowsTop-=Math.min(re,Be-me));const Ge=p.fixedRowsBottom;Ge&&me>=Oe-Ge&&(p.fixedRowsBottom-=Math.min(re,Ge)),Oe===0?j.deselect():I==="ContextMenu.removeRow"?j.refresh():j.shiftRows(U,-re),W+=re})};Array.isArray(C)?F(N(C)):F([[C,y]]);break;case"remove_col":const X=L=>{let W=0;k(L,K=>{let[U,re]=K;const me=Qt(U)?o.countCols()-1:Math.max(U-W,0);let ve=o.toPhysicalColumn(me);if(Number.isInteger(U)&&(U=Math.max(U-W,0)),!a.removeCol(U,re,I))return;if(j.isSelected()){const{col:Ie}=o.getSelectedRangeLast().highlight;Ie>=U&&Ie<=U+re-1&&c.closeEditor(!0)}o.countCols()===0?j.deselect():I==="ContextMenu.removeColumn"?j.refresh():j.shiftColumns(U,-re);const Ge=p.fixedColumnsStart;Ge>=me+1&&(p.fixedColumnsStart-=Math.min(re,Ge-me)),Array.isArray(p.colHeaders)&&(typeof ve>"u"&&(ve=-1),p.colHeaders.splice(ve,re)),W+=re})};Array.isArray(C)?X(N(C)):X([[C,y]]);break;default:throw new Error(`There is no such action "${m}"`)}x||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const m=p.minRows,C=p.minSpareRows,y=p.minCols,I=p.minSpareCols;if(m){const x=o.countRows();x<m&&a.createRow(x,m-x,{source:"auto"})}if(C){const x=o.countEmptyRows(!0);if(x<C){const N=C-x,B=Math.min(N,p.maxRows-o.countSourceRows());a.createRow(o.countRows(),B,{source:"auto"})}}{let x;(y||I)&&(x=o.countEmptyCols(!0));let N=o.countCols();if(y&&!p.columns&&N<y){const B=y-N;x+=B,a.createCol(N,B,{source:"auto"})}if(I&&!p.columns&&o.dataType==="array"&&x<I){N=o.countCols();const B=I-x,Y=Math.min(B,p.maxCols-N);a.createCol(N,Y,{source:"auto"})}}},populateFromArray(m,C,y,I,x){let N,B,Y,R;const E=[],S={},D=[],H=m.row,F=m.col;if(B=C.length,B===0)return!1;let X=0,L=0;switch(Ve(y)&&(X=y.col-F+1,L=y.row-H+1),x){case"shift_down":const W=Om(C),K=W.length,U=Math.max(K,X),re=o.getData().slice(H),me=Om(re).slice(F,F+U);for(Y=0;Y<U;Y+=1)if(Y<K){for(N=0,B=W[Y].length;N<L-B;N+=1)W[Y].push(W[Y][N%B]);Y<me.length?D.push(W[Y].concat(me[Y])):D.push(W[Y].concat(new Array(re.length).fill(null)))}else D.push(W[Y%K].concat(me[Y]));o.populateFromArray(H,F,Om(D));break;case"shift_right":const ve=C.length,Oe=Math.max(ve,L),Be=o.getData().slice(H).map(Pt=>Pt.slice(F));for(N=0;N<Oe;N+=1)if(N<ve){for(Y=0,R=C[N].length;Y<X-R;Y+=1)C[N].push(C[N][Y%R]);if(N<Be.length)for(let Pt=0;Pt<Be[N].length;Pt+=1)C[N].push(Be[N][Pt]);else C[N].push(...new Array(Be[0].length).fill(null))}else C.push(C[N%B].slice(0,Oe).concat(Be[N]));o.populateFromArray(H,F,C);break;case"overwrite":default:S.row=m.row,S.col=m.col;let Ge=0,Ie=0,je=!0,Mt;const wi=function(ar){let Rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const It=C[ar%C.length];return Rt!==null?It[Rt%It.length]:It},Do=C.length,zn=y?y.row-m.row+1:0;for(y?B=zn:B=Math.max(Do,zn),N=0;N<B&&!(y&&S.row>y.row&&zn>Do||!p.allowInsertRow&&S.row>o.countRows()-1||S.row>=p.maxRows);N++){const Pt=N-Ge,ar=wi(Pt).length,Rt=y?y.col-m.col+1:0;if(y?R=Rt:R=Math.max(ar,Rt),S.col=m.col,Mt=o.getCellMeta(S.row,S.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&Mt.skipRowOnPaste){Ge+=1,S.row+=1,B+=1;continue}for(Ie=0,Y=0;Y<R&&!(y&&S.col>y.col&&Rt>ar||!p.allowInsertColumn&&S.col>o.countCols()-1||S.col>=p.maxCols);Y++){if(Mt=o.getCellMeta(S.row,S.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&Mt.skipColumnOnPaste){Ie+=1,S.col+=1,R+=1;continue}if(Mt.readOnly&&I!=="UndoRedo.undo"){S.col+=1;continue}const It=Y-Ie;let Ue=wi(Pt,It),Yn=o.getDataAtCell(S.row,S.col);if(Ue!==null&&typeof Ue=="object")if(Array.isArray(Ue)&&Yn===null&&(Yn=[]),Yn===null||typeof Yn!="object")je=!1;else{const Ma=Fd(Array.isArray(Yn)?Yn:Yn[0]||Yn),Pa=Fd(Array.isArray(Ue)?Ue:Ue[0]||Ue);U0(Ma,Pa)||Array.isArray(Ma)&&Array.isArray(Pa)?Ue=on(Ue):je=!1}else Yn!==null&&typeof Yn=="object"&&(je=!1);je&&E.push([S.row,S.col,Ue]),je=!0,S.col+=1}S.row+=1}o.setDataAtCell(E,null,null,I||"populateFromArray");break}}};function q(m){const C=yF(m);W_(C)?(o.runHooks("beforeLanguageChange",C),_.language=C,o.runHooks("afterLanguageChange",C)):CF(m)}function Q(m,C){const y=m==="className"?o.rootElement:o.table;if(f)ie(y,C);else{let I=[],x=[];_[m]&&(I=Array.isArray(_[m])?_[m]:b1(_[m])),C&&(x=Array.isArray(C)?C:b1(C));const N=C1(I,x),B=C1(x,I);N.length&&Ee(y,N),B.length&&ie(y,B)}_[m]=C}this.init=function(){l.setData(p.data),o.runHooks("beforeInit"),(ps()||A$())&&ie(o.rootElement,"mobile"),this.updateSettings(e,!0),this.view=new z5(this);const m=p.themeName||EH(o.rootElement);o.useTheme(m),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=XR.getInstance(o,p,j),d=rZ(o),h=new d4(o),Hm(this)&&G7(o),o.runHooks("init"),this.render(),f&&o.rootElement.offsetParent===null&&S3(o.rootElement,()=>{o.view._wt.wtOverlays.updateLastSpreaderSize(),o.render(),o.view.adjustElementsSize()}),typeof f=="object"&&(o.runHooks("afterChange",f[0],f[1]),f=!1),o.runHooks("afterInit")};function ue(){let m=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,m=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&m===!1&&(m=!0,this.onQueueEmpty(this.valid))}}}function J(m){const C=m.replace(",",".");return isNaN(parseFloat(C))===!1?parseFloat(C):m}function Z(m,C,y){if(!m.length){y();return}const I=o.getActiveEditor(),x=new ue;let N=!0;x.onQueueEmpty=()=>{I&&N&&I.cancelChanges(),y()};for(let B=m.length-1;B>=0;B--){const[Y,R]=m[B],E=a.propToCol(R);let S;Number.isInteger(E)?S=o.getCellMeta(Y,E):S={...Object.getPrototypeOf(p),...p},o.getCellValidator(S)&&(x.addValidatorToQueue(),o.validateCell(m[B][3],S,function(D,H){return function(F){if(typeof F!="boolean")throw new Error("Validation error: result is not boolean");F===!1&&H.allowInvalid===!1&&(N=!1,m.splice(D,1),H.valid=!0),x.removeValidatorFormQueue()}}(B,S),C))}x.checkIfQueueIsEmpty()}function ne(m,C){for(let I=m.length-1;I>=0;I--){let x=!1;if(m[I]===null){m.splice(I,1);continue}if(!((m[I][2]===null||m[I][2]===void 0)&&(m[I][3]===null||m[I][3]===void 0))){if(p.allowInsertRow)for(;m[I][0]>o.countRows()-1;){const{delta:N}=a.createRow(void 0,void 0,{source:"auto"});if(N===0){x=!0;break}}if(o.dataType==="array"&&(!p.columns||p.columns.length===0)&&p.allowInsertColumn)for(;a.propToCol(m[I][1])>o.countCols()-1;){const{delta:N}=a.createCol(void 0,void 0,{source:"auto"});if(N===0){x=!0;break}}x||a.set(m[I][0],m[I][1],m[I][3])}}if(m.length>0){u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",m,C),c.closeEditor(),o.render(),c.prepareEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",m,C||"edit");const I=o.getActiveEditor();I&&pe(I.refreshValue)&&I.refreshValue()}else o.render()}this._createCellCoords=function(m,C){return o.view._wt.createCellCoords(m,C)},this._createCellRange=function(m,C,y){return o.view._wt.createCellRange(m,C,y)},this.validateCell=function(m,C,y,I){let x=o.getCellValidator(C);function N(B){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||C.hidden===!0){y(B);return}const R=C.visualCol,E=C.visualRow,S=o.getCell(E,R,!0);if(S&&S.nodeName!=="TH"){const D=o.rowIndexMapper.getRenderableFromVisualIndex(E),H=o.columnIndexMapper.getRenderableFromVisualIndex(R);o.view._wt.getSetting("cellRenderer",D,H,S)}y(B)}$K(x)&&(x=function(B){return function(Y,R){R(B.test(Y))}}(x)),mt(x)?(m=o.runHooks("beforeValidate",m,C.visualRow,C.prop,I),o._registerImmediate(()=>{x.call(C,m,B=>{o&&(B=o.runHooks("afterValidate",B,m,C.visualRow,C.prop,I),C.valid=B,N(B),o.runHooks("postAfterValidate",B,m,C.visualRow,C.prop,I))})})):o._registerImmediate(()=>{C.valid=!0,N(C.valid,!1)})};function ee(m,C,y){return Array.isArray(m)?m:[[m,C,y]]}function te(m,C){const y=o.runHooks("beforeChange",m,C||"edit"),I=m.filter(N=>N!==null);if(y===!1||I.length===0){var x;return(x=o.getActiveEditor())===null||x===void 0||x.cancelChanges(),[]}for(let N=I.length-1;N>=0;N--){const[B,Y,,R]=I[N],E=a.propToCol(Y);let S;Number.isInteger(E)?S=o.getCellMeta(B,E):S={...Object.getPrototypeOf(p),...p};const{type:D,checkedTemplate:H,uncheckedTemplate:F}=S;if(D==="numeric"&&typeof R=="string"&&_4(R)&&(I[N][3]=J(R)),D==="checkbox"){const X=Ft(R),L=X===Ft(H),W=X===Ft(F);(L||W)&&(I[N][3]=L?H:F)}}return I}this.setDataAtCell=function(m,C,y,I){const x=ee(m,C,y),N=[];let B=I,Y,R,E;for(Y=0,R=x.length;Y<R;Y++){if(typeof x[Y]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof x[Y][1]!="number")throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");x[Y][1]>=this.countCols()?E=x[Y][1]:E=a.colToProp(x[Y][1]),N.push([x[Y][0],E,l.getAtCell(this.toPhysicalRow(x[Y][0]),x[Y][1]),x[Y][2]])}!B&&typeof m=="object"&&(B=C);const S=te(N,B);o.runHooks("afterSetDataAtCell",S,B),Z(S,B,()=>{ne(S,B)})},this.setDataAtRowProp=function(m,C,y,I){const x=ee(m,C,y),N=[];let B=I,Y,R;for(Y=0,R=x.length;Y<R;Y++)N.push([x[Y][0],x[Y][1],l.getAtCell(this.toPhysicalRow(x[Y][0]),x[Y][1]),x[Y][2]]);!B&&typeof m=="object"&&(B=C);const E=te(N,I);o.runHooks("afterSetDataAtRowProp",E,B),Z(E,B,()=>{ne(E,B)})},this.listen=function(){o&&!o.isListening()&&(Hb.forEach(m=>{o!==m&&m.unlisten()}),Ab=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(Ab=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return Ab===o.guid},this.destroyEditor=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(m),o.view.render(),C&&j.isSelected()&&c.prepareEditor()},this.populateFromArray=function(m,C,y,I,x,N,B){if(!(typeof y=="object"&&typeof y[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const Y=typeof I=="number"?o._createCellCoords(I,x):null;return u.populateFromArray(o._createCellCoords(m,C),y,Y,N,B)},this.spliceCol=function(m,C,y){for(var I=arguments.length,x=new Array(I>3?I-3:0),N=3;N<I;N++)x[N-3]=arguments[N];return a.spliceCol(m,C,y,...x)},this.spliceRow=function(m,C,y){for(var I=arguments.length,x=new Array(I>3?I-3:0),N=3;N<I;N++)x[N-3]=arguments[N];return a.spliceRow(m,C,y,...x)},this.getSelected=function(){if(j.isSelected())return qe(j.getSelectedRange(),m=>{let{from:C,to:y}=m;return[C.row,C.col,y.row,y.col]})},this.getSelectedLast=function(){const m=this.getSelected();let C;return m&&m.length>0&&(C=m[m.length-1]),C},this.getSelectedRange=function(){if(j.isSelected())return Array.from(j.getSelectedRange())},this.getSelectedRangeLast=function(){const m=this.getSelectedRange();let C;return m&&m.length>0&&(C=m[m.length-1]),C},this.emptySelectedCells=function(m){if(!j.isSelected()||this.countRows()===0||this.countCols()===0)return;const C=[];k(j.getSelectedRange(),y=>{if(y.isSingleHeader())return;const I=y.getTopStartCorner(),x=y.getBottomEndCorner();Ce(I.row,x.row,N=>{Ce(I.col,x.col,B=>{this.getCellMeta(N,B).readOnly||C.push([N,B,null])})})}),C.length>0&&this.setDataAtCell(C,m)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const m=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(m,0),!this.isRenderSuspended()&&m===this.renderSuspendedCounter&&o.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(m){this.suspendRender();const C=m();return this.resumeRender(),C},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const C=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(C,0),(!this.isExecutionSuspended()&&C===this.executionSuspendedCounter||m)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const y=m();return this.resumeExecution(C),y},this.batch=function(m){this.suspendRender(),this.suspendExecution();const C=m();return this.resumeExecution(),this.resumeRender(),C},this.refreshDimensions=function(){if(!o.view)return;const m=o.view,{width:C,height:y}=m.getLastSize(),{width:I,height:x}=o.rootElement.getBoundingClientRect(),N=I!==C||x!==y;o.runHooks("beforeRefreshDimensions",{width:C,height:y},{width:I,height:x},N)!==!1&&((N||m._wt.wtOverlays.scrollableElement===o.rootWindow)&&(m.setLastSize(I,x),o.render(),m.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:C,height:y},{width:I,height:x},N))},this.updateData=function(m,C){vH(m,y=>{a=y},y=>{a=y,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),j.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:C,metaManager:b,firstRun:f})},this.loadData=function(m,C){vH(m,y=>{a=y},()=>{b.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),j.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:C,metaManager:b,firstRun:f})},this.getInitialColumnCount=function(){const m=p.columns;let C=0;if(Array.isArray(m))C=m.length;else if(mt(m))if(o.dataType==="array"){const y=this.countSourceCols();for(let I=0;I<y;I+=1)m(I)&&(C+=1)}else(o.dataType==="object"||o.dataType==="function")&&(C=a.colToPropCache.length);else if(pe(p.dataSchema)){const y=a.getSchema();C=Array.isArray(y)?y.length:z0(y)}else C=this.countSourceCols();return C},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(m,C,y,I){return $t(m)?a.getAll():a.getRange(o._createCellCoords(m,C),o._createCellCoords(y,I),a.DESTINATION_RENDERER)},this.getCopyableText=function(m,C,y,I){return a.getCopyableText(o._createCellCoords(m,C),o._createCellCoords(y,I))},this.getCopyableData=function(m,C){return a.getCopyable(m,a.colToProp(C))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const y=(f?o.loadData:o.updateData).bind(this);let I=!1,x,N;if(pe(m.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(pe(m.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(pe(m.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');m.language&&q(m.language);for(x in m)if(!(x==="data"||x==="language"))if(x==="className")Q("className",m.className);else if(x==="tableClassName"&&o.table)Q("tableClassName",m.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(fe.getSingleton().isRegistered(x)||fe.getSingleton().isDeprecated(x)){const S=m[x];mt(S)?(fe.getSingleton().addAsFixed(x,S,o),p[x]=S):Array.isArray(S)&&(fe.getSingleton().add(x,S,o),p[x]=S)}else!C&&dr(m,x)&&(_[x]=m[x]);m.data===void 0&&p.data===void 0?y(null,"updateSettings"):m.data!==void 0?y(m.data,"updateSettings"):m.columns!==void 0&&(a.createMap(),o.initIndexMappers());const B=o.countCols(),Y=p.columns;if(Y&&mt(Y)&&(I=!0),(m.cell!==void 0||m.cells!==void 0||m.columns!==void 0)&&b.clearCache(),B>0)for(x=0,N=0;x<B;x++){if(Y){const S=I?Y(x):Y[N];S&&b.updateColumnMeta(N,S)}N+=1}pe(m.cell)&&We(m.cell,S=>{o.setCellMetaObject(S.row,S.col,S)}),o.runHooks("afterCellMetaReset");let R=o.rootElement.style.height;R!==""&&(R=parseInt(o.rootElement.style.height,10));let E=m.height;if(mt(E)&&(E=E()),C&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),E===null){const S=o.rootElement.getAttribute("data-initialstyle");S&&(S.indexOf("height")>-1||S.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",S):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else E!==void 0&&(o.rootElement.style.height=isNaN(E)?`${E}`:`${E}px`,o.rootElement.style.overflow="hidden");if(typeof m.width<"u"){let S=m.width;mt(S)&&(S=S()),o.rootElement.style.width=isNaN(S)?`${S}`:`${S}px`}if(!C){if(o.view){o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames();const S=o.getCurrentThemeName(),D=dr(m,"themeName");S&&D&&S!==m.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(S));const H=D&&m.themeName||EH(o.rootElement);o.useTheme(H),o.view.addClassNameToLicenseElement(o.getCurrentThemeName())}o.runHooks("afterUpdateSettings",m)}u.adjustRowsAndCols(),o.view&&!f&&(o.render(),o.view._wt.wtOverlays.adjustElementsSize()),!C&&o.view&&(R===""||E===""||E===void 0)&&R!==E&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const m=o.getSelectedLast();if(p.getValue){if(mt(p.getValue))return p.getValue.call(o);if(m)return o.getData()[m[0][0]][p.getValue]}else if(m)return o.getDataAtCell(m[0],m[1])},this.getSettings=function(){return p},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(m,C,y,I,x){u.alter(m,C,y,I,x)},this.getCell=function(m,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,I=C,x=m;if(C>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(C)))return null;I=this.columnIndexMapper.getRenderableFromVisualIndex(C)}if(m>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(m)))return null;x=this.rowIndexMapper.getRenderableFromVisualIndex(m)}return x===null||I===null||x===void 0||I===void 0?null:o.view.getCellAtCoords(o._createCellCoords(x,I),y)},this.getCoords=function(m){const C=this.view._wt.wtTable.getCoords(m);if(C===null)return null;const{row:y,col:I}=C;let x=y,N=I;return y>=0&&(x=this.rowIndexMapper.getVisualFromRenderableIndex(y)),I>=0&&(N=this.columnIndexMapper.getVisualFromRenderableIndex(I)),o._createCellCoords(x,N)},this.colToProp=function(m){return a.colToProp(m)},this.propToCol=function(m){return a.propToCol(m)},this.toVisualRow=m=>this.rowIndexMapper.getVisualFromPhysicalIndex(m),this.toVisualColumn=m=>this.columnIndexMapper.getVisualFromPhysicalIndex(m),this.toPhysicalRow=m=>this.rowIndexMapper.getPhysicalFromVisualIndex(m),this.toPhysicalColumn=m=>this.columnIndexMapper.getPhysicalFromVisualIndex(m),this.getDataAtCell=function(m,C){return a.get(m,a.colToProp(C))},this.getDataAtRowProp=function(m,C){return a.get(m,C)},this.getDataAtCol=function(m){const C=[],y=a.getRange(o._createCellCoords(0,m),o._createCellCoords(p.data.length-1,m),a.DESTINATION_RENDERER);for(let I=0;I<y.length;I+=1)for(let x=0;x<y[I].length;x+=1)C.push(y[I][x]);return C},this.getDataAtProp=function(m){const C=[],y=a.getRange(o._createCellCoords(0,a.propToCol(m)),o._createCellCoords(p.data.length-1,a.propToCol(m)),a.DESTINATION_RENDERER);for(let I=0;I<y.length;I+=1)for(let x=0;x<y[I].length;x+=1)C.push(y[I][x]);return C},this.getSourceData=function(m,C,y,I){let x;return m===void 0?x=l.getData():x=l.getByRange(o._createCellCoords(m,C),o._createCellCoords(y,I)),x},this.getSourceDataArray=function(m,C,y,I){let x;return m===void 0?x=l.getData(!0):x=l.getByRange(o._createCellCoords(m,C),o._createCellCoords(y,I),!0),x},this.getSourceDataAtCol=function(m){return l.getAtColumn(m)},this.setSourceDataAtCell=function(m,C,y,I){const x=ee(m,C,y),N=this.hasHook("afterSetSourceDataAtCell"),B=[];N&&k(x,R=>{let[E,S,D]=R;B.push([E,S,l.getAtCell(E,S),D])}),k(x,R=>{let[E,S,D]=R;l.setAtCell(E,S,D)}),N&&this.runHooks("afterSetSourceDataAtCell",B,I),this.render();const Y=o.getActiveEditor();Y&&pe(Y.refreshValue)&&Y.refreshValue()},this.getSourceDataAtRow=function(m){return l.getAtRow(m)},this.getSourceDataAtCell=function(m,C){return l.getAtCell(m,C)},this.getDataAtRow=function(m){return a.getRange(o._createCellCoords(m,0),o._createCellCoords(m,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(m,C,y,I){const x=m===void 0?[0,0,this.countRows(),this.countCols()]:[m,C,y,I],[N,B]=x;let[,,Y,R]=x,E=null,S=null;Y===void 0&&(Y=N),R===void 0&&(R=B);let D="mixed";return Ce(Math.max(Math.min(N,Y),0),Math.max(N,Y),H=>{let F=!0;return Ce(Math.max(Math.min(B,R),0),Math.max(B,R),X=>(S=this.getCellMeta(H,X).type,E?F=E===S:E=S,F)),D=F?S:"mixed",F}),D},this.removeCellMeta=function(m,C,y){const[I,x]=[this.toPhysicalRow(m),this.toPhysicalColumn(C)];let N=b.getCellMetaKeyValue(I,x,y);o.runHooks("beforeRemoveCellMeta",m,C,y,N)!==!1&&(b.removeCellMeta(I,x,y),o.runHooks("afterRemoveCellMeta",m,C,y,N)),N=null},this.spliceCellsMeta=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var y=arguments.length,I=new Array(y>2?y-2:0),x=2;x<y;x++)I[x-2]=arguments[x];if(I.length>0&&!Array.isArray(I[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");C>0&&b.removeRow(this.toPhysicalRow(m),C),I.length>0&&k(I.reverse(),N=>{b.createRow(this.toPhysicalRow(m)),k(N,(B,Y)=>this.setCellMetaObject(m,Y,B))}),o.render()},this.setCellMetaObject=function(m,C,y){typeof y=="object"&&We(y,(I,x)=>{this.setCellMeta(m,C,x,I)})},this.setCellMeta=function(m,C,y,I){if(o.runHooks("beforeSetCellMeta",m,C,y,I)===!1)return;let N=m,B=C;m<this.countRows()&&(N=this.toPhysicalRow(m)),C<this.countCols()&&(B=this.toPhysicalColumn(C)),b.setCellMeta(N,B,y,I),o.runHooks("afterSetCellMeta",m,C,y,I)},this.getCellsMeta=function(){return b.getCellsMeta()},this.getCellMeta=function(m,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},I=this.toPhysicalRow(m),x=this.toPhysicalColumn(C);return I===null&&(I=m),x===null&&(x=C),b.getCellMeta(I,x,{visualRow:m,visualColumn:C,...y})},this.getColumnMeta=function(m){return b.getColumnMeta(this.toPhysicalColumn(m))},this.getCellMetaAtRow=function(m){return b.getCellsMetaAtRow(m)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||p.columns)},this.getCellRenderer=function(m,C){const y=typeof m=="number"?o.getCellMeta(m,C).renderer:m.renderer;return typeof y=="string"?QR(y):$t(y)?QR("text"):y},this.getCellEditor=function(m,C){const y=typeof m=="number"?o.getCellMeta(m,C).editor:m.editor;return typeof y=="string"?KR(y):$t(y)?KR("text"):y},this.getCellValidator=function(m,C){const y=typeof m=="number"?o.getCellMeta(m,C).validator:m.validator;return typeof y=="string"?j4(y):y},this.validateCells=function(m){this._validateCells(m)},this.validateRows=function(m,C){if(!Array.isArray(m))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(C,m)},this.validateColumns=function(m,C){if(!Array.isArray(m))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(C,void 0,m)},this._validateCells=function(m,C,y){const I=new ue;m&&(I.onQueueEmpty=m);let x=o.countRows()-1;for(;x>=0;){if(C!==void 0&&C.indexOf(x)===-1){x-=1;continue}let N=o.countCols()-1;for(;N>=0;){if(y!==void 0&&y.indexOf(N)===-1){N-=1;continue}I.addValidatorToQueue(),o.validateCell(o.getDataAtCell(x,N),o.getCellMeta(x,N),B=>{if(typeof B!="boolean")throw new Error("Validation error: result is not boolean");B===!1&&(I.valid=!1),I.removeValidatorFormQueue()},"validateCells"),N-=1}x-=1}I.checkIfQueueIsEmpty()},this.getRowHeader=function(m){let C=p.rowHeaders,y=m;return y!==void 0&&(y=o.runHooks("modifyRowHeader",y)),y===void 0?(C=[],Ce(o.countRows()-1,I=>{C.push(o.getRowHeader(I))})):Array.isArray(C)&&C[y]!==void 0?C=C[y]:mt(C)?C=C(y):C&&typeof C!="string"&&typeof C!="number"&&(C=y+1),C},this.hasRowHeaders=function(){return!!p.rowHeaders},this.hasColHeaders=function(){if(p.colHeaders!==void 0&&p.colHeaders!==null)return!!p.colHeaders;for(let m=0,C=o.countCols();m<C;m++)if(o.getColHeader(m))return!0;return!1},this.getColHeader=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const y=o.runHooks("modifyColHeader",m);if(y===void 0){const Y=[],R=o.countCols();for(let E=0;E<R;E++)Y.push(o.getColHeader(E));return Y}let I=p.colHeaders;const x=function(Y){const R=[],E=o.countCols();let S=0;for(;S<E;S++)mt(p.columns)&&p.columns(S)&&R.push(S);return R[Y]},N=o.toPhysicalColumn(y),B=x(N);return p.colHeaders===!1?I=null:p.columns&&mt(p.columns)&&p.columns(B)&&p.columns(B).title?I=p.columns(B).title:p.columns&&p.columns[N]&&p.columns[N].title?I=p.columns[N].title:Array.isArray(p.colHeaders)&&p.colHeaders[N]!==void 0?I=p.colHeaders[N]:mt(p.colHeaders)?I=p.colHeaders(N):p.colHeaders&&typeof p.colHeaders!="string"&&typeof p.colHeaders!="number"&&(I=Z5(y)),I=o.runHooks("modifyColumnHeaderValue",I,m,C),I},this._getColWidthFromSettings=function(m){let C;if(m>=0&&(C=o.getCellMeta(0,m).width),(C===void 0||C===p.width)&&(C=p.colWidths),C!=null){switch(typeof C){case"object":C=C[m];break;case"function":C=C(m);break}typeof C=="string"&&(C=parseInt(C,10))}return C},this.getColWidth=function(m,C){let y=o._getColWidthFromSettings(m);return y=o.runHooks("modifyColWidth",y,m,C),y===void 0&&(y=Cc),y},this._getRowHeightFromSettings=function(m){const C=this.view.getDefaultRowHeight();let y=p.rowHeights;if(y!=null){switch(typeof y){case"object":y=y[m];break;case"function":y=y(m);break}typeof y=="string"&&(y=parseInt(y,10))}return y!=null&&y<C?C:y},this.getRowHeight=function(m,C){let y=o._getRowHeightFromSettings(m);return y=o.runHooks("modifyRowHeight",y,m,C),y},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const m=p.maxCols,C=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(m,C)},this.countRenderedRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,C=0;return uA(o.countRows()-1,y=>{if(o.isEmptyRow(y))C+=1;else if(m===!0)return!1}),C},this.countEmptyCols=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,C=0;return uA(o.countCols()-1,y=>{if(o.isEmptyCol(y))C+=1;else if(m===!0)return!1}),C},this.isEmptyRow=function(m){return p.isEmptyRow.call(o,m)},this.isEmptyCol=function(m){return p.isEmptyCol.call(o,m)},this.selectCell=function(m,C,y,I){let x=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,N=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return $t(m)||$t(C)?!1:this.selectCells([[m,C,y,I]],x,N)},this.selectCells=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;C===!1&&d.suspend();const I=j.selectCells(m);return I&&y&&o.listen(),d.resume(),I},this.selectColumns=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=arguments.length>2?arguments[2]:void 0;return j.selectColumns(m,C,y)},this.selectRows=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=arguments.length>2?arguments[2]:void 0;return j.selectRows(m,C,y)},this.deselectCell=function(){j.deselect()},this.selectAll=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),j.selectAll(m,C,y)};const ae=(m,C)=>m.getNearestNotHiddenIndex(C,1,!0);this.scrollViewportTo=function(m,C){if(typeof m=="number"){var y;m={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(y=arguments[4])!==null&&y!==void 0?y:!0}}const{row:I,col:x,considerHiddenIndexes:N}=m??{};let B=I,Y=x;if(mt(C)&&this.addHookOnce("afterScroll",C),N===void 0||N){const D=Number.isInteger(I)&&I>=0,H=Number.isInteger(x)&&x>=0,F=D?ae(this.rowIndexMapper,I):void 0,X=H?ae(this.columnIndexMapper,x):void 0;if(F===null||X===null)return!1;B=D?o.rowIndexMapper.getRenderableFromVisualIndex(F):I,Y=H?o.columnIndexMapper.getRenderableFromVisualIndex(X):x}const R=Number.isInteger(B),E=Number.isInteger(Y);let S=!1;return R&&B>=0&&E&&Y>=0?S=o.view.scrollViewport(o._createCellCoords(B,Y),m.horizontalSnap,m.verticalSnap):R&&B>=0&&(E&&Y<0||!E)?S=o.view.scrollViewportVertically(B,m.verticalSnap):E&&Y>=0&&(R&&B<0||!R)&&(S=o.view.scrollViewportHorizontally(Y,m.horizontalSnap)),mt(C)&&(S?this.view.render():(this.removeHook("afterScroll",C),this._registerMicrotask(()=>C()))),S},this.scrollToFocusedCell=function(m){if(!this.selection.isSelected())return!1;mt(m)&&this.addHookOnce("afterScroll",m);const{highlight:C}=this.getSelectedRangeLast(),y=this.scrollViewportTo(C.toObject());return y?this.view.render():mt(m)&&(this.removeHook("afterScroll",m),this._registerMicrotask(()=>m())),y},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),b.clearCache(),Hb.delete(this.guid),Hm(o)){const m=this.rootDocument.querySelector(".hot-display-license-info");m&&m.parentNode.removeChild(m)}Ts(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),O.getItems().forEach(m=>{let[,C]=m;C.destroy()}),O.clear(),o.runHooks("afterDestroy")},!0),fe.getSingleton().destroy(o),We(o,(m,C,y)=>{mt(m)?y[C]=z(C):C!=="guid"&&(y[C]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,j=null,c=null,o=null};function z(m){return()=>{throw new Error(`The "${m}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return c.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return o.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return o.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return o.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return o.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return o.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return o.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return o.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return o.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return o.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return o.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return o.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return o.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(m){return O.getItem(Bi(m))},this.getPluginName=function(m){return m===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:O.getId(m)},this.getInstance=function(){return o},this.addHook=function(m,C,y){fe.getSingleton().add(m,C,o,y)},this.hasHook=function(m){return fe.getSingleton().has(m,o)||fe.getSingleton().has(m)},this.addHookOnce=function(m,C,y){fe.getSingleton().once(m,C,o,y)},this.removeHook=function(m,C){fe.getSingleton().remove(m,C,o)},this.runHooks=function(m,C,y,I,x,N,B){return fe.getSingleton().run(o,m,C,y,I,x,N,B)},this.getTranslatedPhrase=function(m,C){return _F(p.language,m,C)},this.toHTML=()=>aA(this),this.toTableElement=()=>{const m=this.rootDocument.createElement("div");return m.insertAdjacentHTML("afterbegin",aA(this)),m.firstElementChild},this.timeouts=[],this.useTheme=m=>{this.view.getStylesHandler().useTheme(m),this.runHooks("afterSetTheme",m,!!f)},this.getCurrentThemeName=()=>this.view.getStylesHandler().getThemeName(),this._registerTimeout=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,y=m;typeof y=="function"&&(y=setTimeout(y,C)),this.timeouts.push(y)},this._clearTimeouts=function(){k(this.timeouts,m=>{clearTimeout(m)})},this.immediates=[],this._registerImmediate=function(m){this.immediates.push(setImmediate(m))},this._clearImmediates=function(){k(this.immediates,m=>{clearImmediate(m)})},this._registerMicrotask=function(m){this.rootWindow.queueMicrotask(()=>{this.isDestroyed||m()})},this._getEditorManager=function(){return c};const $=lZ({handleEvent(){return o.isListening()},beforeKeyDown:m=>this.runHooks("beforeKeyDown",m),afterKeyDown:m=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",m)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",m=>{m.ctrlKey===!1&&m.metaKey===!1&&$.releasePressedKeys()}),this.getShortcutManager=function(){return $},this.getFocusManager=function(){return h},j$().forEach(m=>{const C=X0(m);O.addItem(m,new C(this))}),z7(o),$.setActiveContextName("grid"),fe.getSingleton().run(o,"construct")}function TH(t,e,r){t.addEventListener(e,r,!1)}function _H(t,e,r){t.removeEventListener(e,r,!1)}function gg(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function WF(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:h=>h.value,...e},n=t.body,i=t.createTextNode(""),o=t.createElement("span");let s;function a(){var h,d;i.textContent=r.textContent(s),o.style.position="absolute",o.style.fontSize=gg(s).fontSize,o.style.fontFamily=gg(s).fontFamily,o.style.whiteSpace="pre",n.appendChild(o);const f=parseInt(((h=gg(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),g=parseInt(((d=gg(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),w=o.clientWidth+f+g+1;n.removeChild(o);const v=s.style;v.height=`${r.minHeight}px`,r.minWidth>w?v.width=`${r.minWidth}px`:w>r.maxWidth?v.width=`${r.maxWidth}px`:v.width=`${w}px`;const b=s.scrollHeight?s.scrollHeight-1:0;r.minHeight>b?v.height=`${r.minHeight}px`:r.maxHeight<b?(v.height=`${r.maxHeight}px`,v.overflowY="visible"):v.height=`${b}px`}function l(){t.defaultView.setTimeout(a,0)}function u(h){if(h&&h.minHeight)if(h.minHeight==="inherit")r.minHeight=s.clientHeight;else{const d=parseInt(h.minHeight,10);isNaN(d)||(r.minHeight=d)}if(h&&h.maxHeight)if(h.maxHeight==="inherit")r.maxHeight=s.clientHeight;else{const d=parseInt(h.maxHeight,10);isNaN(d)||(r.maxHeight=d)}if(h&&h.minWidth)if(h.minWidth==="inherit")r.minWidth=s.clientWidth;else{const d=parseInt(h.minWidth,10);isNaN(d)||(r.minWidth=d)}if(h&&h.maxWidth)if(h.maxWidth==="inherit")r.maxWidth=s.clientWidth;else{const d=parseInt(h.maxWidth,10);isNaN(d)||(r.maxWidth=d)}o.firstChild||(o.className="autoResize",o.style.display="inline-block",o.appendChild(i))}function c(h,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=h,u(d),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.height=`${r.minHeight}px`,s.style.minWidth=`${r.minWidth}px`,s.style.maxWidth=`${r.maxWidth}px`,s.style.overflowY="hidden"),f&&(TH(s,"input",a),TH(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){_H(s,"input",a),_H(s,"keydown",l)}}}function MH(t,e){const r=b$(e),n=e.value.split(`
|
|
537
|
+
`);let i=r,o=0;for(let s=0;s<n.length;s++){const a=n[s];s!==0&&(o+=n[s-1].length+1);const l=o+a.length;if(t==="home"?i=o:t==="end"&&(i=l),r<=l)break}yw(e,i)}function Ba(t,e,r){return(e=uZ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uZ(t){var e=cZ(t,"string");return typeof e=="symbol"?e:e+""}function cZ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const hZ="ht_editor_visible",mg="ht_editor_hidden",PH="textEditor",dZ="text";class ru extends $c{static get EDITOR_TYPE(){return dZ}constructor(e){super(e),Ba(this,"eventManager",new ji(this)),Ba(this,"autoResize",WF(this.hot.rootDocument)),Ba(this,"TEXTAREA",void 0),Ba(this,"textareaStyle",void 0),Ba(this,"TEXTAREA_PARENT",void 0),Ba(this,"textareaParentStyle",void 0),Ba(this,"layerClass",void 0),this.eventManager=new ji(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),xm(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,r,n,i,o,s){const a=this.state;if(super.prepare(e,r,n,i,o,s),!s.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=s;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==Zt.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,r){this.state===Zt.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,r))}focus(){this.TEXTAREA.select(),yw(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Pe(this.TEXTAREA,[["data-hot-input",""],Ql(-1)]),ie(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=e.createElement("DIV"),ie(this.TEXTAREA_PARENT,"handsontableInputHolder"),_e(this.TEXTAREA_PARENT,this.layerClass)&&Ee(this.TEXTAREA_PARENT,this.layerClass),ie(this.TEXTAREA_PARENT,mg),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){D3()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",Ee(this.TEXTAREA_PARENT,this.layerClass),ie(this.TEXTAREA_PARENT,mg)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let r=!1;Ce(e.length-1,n=>{const i=e[n];if(_e(i,"handsontableEditor"))return r=!0,!1}),_e(this.TEXTAREA_PARENT,mg)&&Ee(this.TEXTAREA_PARENT,mg),r?(this.layerClass=hZ,ie(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),ie(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),r=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=r,this.setValue(r),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==Zt.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:r,start:n,width:i,maxWidth:o,height:s,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${r}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${n}px`,this.showEditableElement();const l=this.hot.rootWindow.getComputedStyle(this.TD);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor,this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(i,o),minHeight:Math.min(s,a),maxWidth:o,maxHeight:a},!0)}bindEvents(){x$()&&this.eventManager.addEventListener(this.TEXTAREA,"focusout",()=>this.finishEditing(!1)),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>{this.refreshDimensions(),this.state===Zt.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Zt.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor"),n={runOnlyIf:()=>pe(this.hot.getSelected()),group:PH},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
|
|
538
|
+
`)};r.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:o=>!this.hot.selection.isMultiple()&&!o.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(o,s)=>{let[a]=s;MH(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;MH(a,this.TEXTAREA)}}],n)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(PH)}}const fZ="base";function Cf(t,e,r,n,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&ie(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(M1())):a&&c.push(M1()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(P1())):(u.push(s.invalidCellClassName),a&&c.push(P1()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),Ee(e,u),ie(e,l),Dc(e,c),Pe(e,h)}Cf.RENDERER_TYPE=fZ;const gZ="text";function Hs(t,e,r,n,i,o,s){Cf.apply(this,[t,e,r,n,i,o,s]);let a=o;!a&&s.placeholder&&(a=s.placeholder),a=Ft(a),s.trimWhitespace&&(a=a.trim()),Fl(e,a)}Hs.RENDERER_TYPE=gZ;const mZ="text",BF={CELL_TYPE:mZ,editor:ru,renderer:Hs};_i(BF);En.editors={BaseEditor:$c};function En(t,e){const r=new VF(t,e||{},fT);return r.init(),r}En.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new VF(t,e,fT)};En.DefaultSettings=HF();En.hooks=fe.getSingleton();En.CellCoords=Wl;En.CellRange=pf;En.packageName="handsontable";En.buildDate="24/04/2025 10:59:00";En.version="15.3.0";En.languages={dictionaryKeys:A9,getLanguageDictionary:TF,getLanguagesDictionaries:L9,registerLanguageDictionary:EF,getTranslatedPhrase:_F};var Nb=null,pZ="Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.",wZ="Providing a component-based renderer using `hot-renderer`-annotated component is no longer supported. Pass your component using `renderer` prop of the `HotTable` or `HotColumn` component instead.",vZ="Providing a component-based editor using `hot-editor`-annotated component is no longer supported. Pass your component using `editor` prop of the `HotTable` or `HotColumn` component instead.",yZ="Unexpected children nodes found in HotTable component. Only HotColumn components are allowed.",CZ="Unexpected children nodes found in HotColumn component. HotColumn components do not support any children.",bZ="The Handsontable instance bound to this component was destroyed and cannot be used properly.",SZ="hot-wrapper-editor-container";function jd(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function aE(t){return IH(t,"hot-renderer")?(jd(wZ),!0):IH(t,"hot-editor")?(jd(vZ),!0):!1}function RZ(t,e){var r=oe.Children.toArray(t);return r.some(function(n){return n.type!==e})?(jd(yZ),!0):!1}function EZ(t){var e=oe.Children.toArray(t);return e.length?(jd(CZ),!0):!1}function IH(t,e){var r=oe.Children.toArray(t);return r.some(function(n){return n.props[e]!==void 0})}function jF(t,e){if(!t||!e||typeof e=="boolean")return null;var r=oe.createElement(e,null),n=UF({},!1);return n.className="".concat(SZ," ").concat(n.className),FE.createPortal(oe.createElement("div",Object.assign({},n),r),t.body)}function TZ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;e||(e=document),Nb||(Nb=e.createDocumentFragment());var i=n??e.createElement("DIV");return Nb.appendChild(i),{portal:FE.createPortal(t,i,r),portalContainer:i}}function UF(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{id:t.id||(e?"hot-"+Math.random().toString(36).substring(5):void 0),className:t.className||"",style:t.style||{}}}function _Z(){return typeof window<"u"}function MZ(t,e){var r=oe.useRef(!1);oe.useEffect(function(){if(r.current)return t();r.current=!0},e)}function lE(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function PZ(t){if(Array.isArray(t))return t}function IZ(t){if(Array.isArray(t))return lE(t)}function OZ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xZ(t,e,r){return e=mp(e),FZ(t,GF()?Reflect.construct(e,r||[],mp(t).constructor):e.apply(t,r))}function zF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OH(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jZ(n.key),n)}}function YF(t,e,r){return e&&OH(t.prototype,e),r&&OH(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mp(t){return mp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mp(t)}function AZ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uE(t,e)}function GF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GF=function(){return!!t})()}function HZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function NZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],l=!0,u=!1;try{if(o=(r=r.call(t)).next,e!==0)for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function DZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
539
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
540
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LZ(t,e){if(t==null)return{};var r,n,i=$Z(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function $Z(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function FZ(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return OZ(t)}function uE(t,e){return uE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},uE(t,e)}function VZ(t,e){return PZ(t)||NZ(t,e)||qF(t,e)||DZ()}function WZ(t){return IZ(t)||HZ(t)||qF(t)||kZ()}function BZ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function jZ(t){var e=BZ(t,"string");return typeof e=="symbol"?e:e+""}function jn(t){"@babel/helpers - typeof";return jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jn(t)}function qF(t,e){if(t){if(typeof t=="string")return lE(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lE(t,e):void 0}}var KF=function(){function t(){zF(this,t)}return YF(t,null,[{key:"getSettings",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.prevProps,o=i===void 0?{}:i,s=n.isInit,a=s===void 0?!1:s,l=n.initOnlySettingKeys,u=l===void 0?[]:l,c=function(g){return!a&&u.includes(g)?o[g]===r[g]:!1},h={};for(var d in r)d!=="children"&&!c(d)&&r.hasOwnProperty(d)&&(h[d]=r[d]);return h}}])}(),XF=oe.createContext(void 0),UZ=function(e){var r=e.children,n=oe.useRef([]),i=oe.useCallback(function(v,b){n.current[b]=v},[]),o=oe.useRef(new Map),s=oe.useRef(new Map),a=oe.useCallback(function(){return s.current.clear()},[]),l=oe.useRef(new Map),u=oe.useCallback(function(){return l.current.clear()},[]),c=oe.useRef(new Map),h=oe.useCallback(function(v){return function(p,_,O,T,M,P,G){var j="".concat(O,"-").concat(T),A=p.guid,q="".concat(A,"-").concat(j),Q="".concat(j,"-").concat(A);if(s.current.has(j)&&(_.innerHTML=s.current.get(j).innerHTML),_&&!_.getAttribute("ghost-table")){for(var ue=l.current.get(Q),J=c.current.get(q);_.firstChild;)_.removeChild(_.firstChild);if(ue&&J)_.appendChild(J);else{var Z=oe.createElement(v,{instance:p,TD:_,row:O,col:T,prop:M,value:P,cellProperties:G}),ne=TZ(Z,_.ownerDocument,Q,J),ee=ne.portal,te=ne.portalContainer;c.current.set(q,te),_.appendChild(te),l.current.set(Q,ee)}}return s.current.set("".concat(O,"-").concat(T),_),_}},[]),d=oe.useRef(function(){}),f=oe.useCallback(function(v){d.current=v},[]),g=oe.useCallback(function(){d.current(WZ(l.current.values()))},[]),w=oe.useMemo(function(){return{componentRendererColumns:o.current,columnsSettings:n.current,emitColumnSettings:i,getRendererWrapper:h,clearPortalCache:u,clearRenderedCellCache:a,setRenderersPortalManagerRef:f,pushCellPortalsIntoPortalManager:g}},[i,h,a,f,g]);return oe.createElement(XF.Provider,{value:w},r)};function ZF(){return oe.useContext(XF)}var JF=oe.createContext(void 0),zZ=function(e){var r=e.columnIndex,n=e.getOwnerDocument,i=e.children,o=oe.useMemo(function(){return{columnIndex:r,getOwnerDocument:n}},[r,n]);return oe.createElement(JF.Provider,{value:o},i)},YZ=function(){return oe.useContext(JF)},GZ=["close","focus","open"],qZ=["getValue","setValue"],Db={open:"onOpen",close:"onClose",prepare:"onPrepare",focus:"onFocus"};function QF(t,e){return function(r){function n(i){var o;return zF(this,n),o=xZ(this,n,[i]),e.current=o,Object.getOwnPropertyNames(En.editors.BaseEditor.prototype).forEach(function(s){if(!(s==="constructor"||qZ.includes(s))){var a=En.editors.BaseEditor.prototype[s];n.prototype[s]=(function(){for(var l,u,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];if(GZ.includes(s)||(u=a.call.apply(a,[this].concat(h))),Db[s]&&(l=t.current)!==null&&l!==void 0&&l[Db[s]]){var f;u=(f=t.current[Db[s]]).call.apply(f,[this].concat(h))}return u}).bind(o)}}),o}return AZ(n,r),YF(n,[{key:"focus",value:function(){}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(o){this.value=o}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(En.editors.BaseEditor)}var KZ=oe.createContext(void 0),eV=function(e){var r=e.hooksRef,n=e.hotCustomEditorInstanceRef,i=e.children;return oe.createElement(KZ.Provider,{value:{hooksRef:r,hotCustomEditorInstanceRef:n}},i)},XZ=function(e){return e.type===j_},ZZ=["_columnIndex","_getOwnerDocument","children"],j_=function(e){var r=ZF(),n=r.componentRendererColumns,i=r.emitColumnSettings,o=r.getRendererWrapper,s=YZ(),a=s.columnIndex,l=s.getOwnerDocument,u=oe.useRef(null),c=oe.useRef(null);oe.useEffect(function(){var d=function(){return Object.keys(e).filter(function(v){return!ZZ.includes(v)}).reduce(function(v,b){return v[b]=e[b],v},{})},f=function(){var v=KF.getSettings(d());return e.renderer?(v.renderer=o(e.renderer),n.set(a,!0)):e.hotRenderer&&(v.renderer=e.hotRenderer),e.editor?v.editor=QF(u,c):e.hotEditor&&(v.editor=e.hotEditor),v},g=f();i(g,a),aE(e.children)||EZ(e.children)});var h=jF(l(),e.editor);return oe.createElement(eV,{hooksRef:u,hotCustomEditorInstanceRef:c},h)},JZ="15.3.0",QZ=oe.forwardRef(function(t,e){var r=oe.useState([]),n=VZ(r,2),i=n[0],o=n[1];return oe.useImperativeHandle(e,function(){return o}),oe.createElement(oe.Fragment,null,i)});function eJ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var cE={exports:{}},pg={exports:{}},ct={},xH;function tJ(){if(xH)return ct;xH=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,g=t?Symbol.for("react.lazy"):60116,w=t?Symbol.for("react.block"):60121,v=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,p=t?Symbol.for("react.scope"):60119;function _(T){if(jn(T)==="object"&&T!==null){var M=T.$$typeof;switch(M){case e:switch(T=T.type,T){case l:case u:case n:case o:case i:case h:return T;default:switch(T=T&&T.$$typeof,T){case a:case c:case g:case f:case s:return T;default:return M}}case r:return M}}}function O(T){return _(T)===u}return ct.AsyncMode=l,ct.ConcurrentMode=u,ct.ContextConsumer=a,ct.ContextProvider=s,ct.Element=e,ct.ForwardRef=c,ct.Fragment=n,ct.Lazy=g,ct.Memo=f,ct.Portal=r,ct.Profiler=o,ct.StrictMode=i,ct.Suspense=h,ct.isAsyncMode=function(T){return O(T)||_(T)===l},ct.isConcurrentMode=O,ct.isContextConsumer=function(T){return _(T)===a},ct.isContextProvider=function(T){return _(T)===s},ct.isElement=function(T){return jn(T)==="object"&&T!==null&&T.$$typeof===e},ct.isForwardRef=function(T){return _(T)===c},ct.isFragment=function(T){return _(T)===n},ct.isLazy=function(T){return _(T)===g},ct.isMemo=function(T){return _(T)===f},ct.isPortal=function(T){return _(T)===r},ct.isProfiler=function(T){return _(T)===o},ct.isStrictMode=function(T){return _(T)===i},ct.isSuspense=function(T){return _(T)===h},ct.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===n||T===u||T===o||T===i||T===h||T===d||jn(T)==="object"&&T!==null&&(T.$$typeof===g||T.$$typeof===f||T.$$typeof===s||T.$$typeof===a||T.$$typeof===c||T.$$typeof===v||T.$$typeof===b||T.$$typeof===p||T.$$typeof===w)},ct.typeOf=_,ct}var ht={},AH;function rJ(){return AH||(AH=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,g=t?Symbol.for("react.lazy"):60116,w=t?Symbol.for("react.block"):60121,v=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,p=t?Symbol.for("react.scope"):60119;function _(S){return typeof S=="string"||typeof S=="function"||S===n||S===u||S===o||S===i||S===h||S===d||jn(S)==="object"&&S!==null&&(S.$$typeof===g||S.$$typeof===f||S.$$typeof===s||S.$$typeof===a||S.$$typeof===c||S.$$typeof===v||S.$$typeof===b||S.$$typeof===p||S.$$typeof===w)}function O(S){if(jn(S)==="object"&&S!==null){var D=S.$$typeof;switch(D){case e:var H=S.type;switch(H){case l:case u:case n:case o:case i:case h:return H;default:var F=H&&H.$$typeof;switch(F){case a:case c:case g:case f:case s:return F;default:return D}}case r:return D}}}var T=l,M=u,P=a,G=s,j=e,A=c,q=n,Q=g,ue=f,J=r,Z=o,ne=i,ee=h,te=!1;function ae(S){return te||(te=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),z(S)||O(S)===l}function z(S){return O(S)===u}function $(S){return O(S)===a}function m(S){return O(S)===s}function C(S){return jn(S)==="object"&&S!==null&&S.$$typeof===e}function y(S){return O(S)===c}function I(S){return O(S)===n}function x(S){return O(S)===g}function N(S){return O(S)===f}function B(S){return O(S)===r}function Y(S){return O(S)===o}function R(S){return O(S)===i}function E(S){return O(S)===h}ht.AsyncMode=T,ht.ConcurrentMode=M,ht.ContextConsumer=P,ht.ContextProvider=G,ht.Element=j,ht.ForwardRef=A,ht.Fragment=q,ht.Lazy=Q,ht.Memo=ue,ht.Portal=J,ht.Profiler=Z,ht.StrictMode=ne,ht.Suspense=ee,ht.isAsyncMode=ae,ht.isConcurrentMode=z,ht.isContextConsumer=$,ht.isContextProvider=m,ht.isElement=C,ht.isForwardRef=y,ht.isFragment=I,ht.isLazy=x,ht.isMemo=N,ht.isPortal=B,ht.isProfiler=Y,ht.isStrictMode=R,ht.isSuspense=E,ht.isValidElementType=_,ht.typeOf=O}()),ht}var HH;function tV(){return HH||(HH=1,process.env.NODE_ENV==="production"?pg.exports=tJ():pg.exports=rJ()),pg.exports}/*
|
|
541
|
+
object-assign
|
|
542
|
+
(c) Sindre Sorhus
|
|
543
|
+
@license MIT
|
|
544
|
+
*/var kb,NH;function nJ(){if(NH)return kb;NH=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(c){return s[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return kb=i()?Object.assign:function(o,s){for(var a,l=n(o),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var h in a)e.call(a,h)&&(l[h]=a[h]);if(t){u=t(a);for(var d=0;d<u.length;d++)r.call(a,u[d])&&(l[u[d]]=a[u[d]])}}return l},kb}var Lb,DH;function U_(){if(DH)return Lb;DH=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Lb=t,Lb}var $b,kH;function rV(){return kH||(kH=1,$b=Function.call.bind(Object.prototype.hasOwnProperty)),$b}var Fb,LH;function iJ(){if(LH)return Fb;LH=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=U_(),r={},n=rV();t=function(s){var a="Warning: "+s;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in o)if(n(o,c)){var h;try{if(typeof o[c]!="function"){var d=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+jn(o[c])+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}h=o[c](s,c,l,a,null,e)}catch(g){h=g}if(h&&!(h instanceof Error)&&t((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+jn(h)+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in r)){r[h.message]=!0;var f=u?u():"";t("Failed "+a+" type: "+h.message+(f??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},Fb=i,Fb}var Vb,$H;function oJ(){if($H)return Vb;$H=1;var t=tV(),e=nJ(),r=U_(),n=rV(),i=iJ(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function s(){return null}return Vb=function(l,u){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function d($){var m=$&&(c&&$[c]||$[h]);if(typeof m=="function")return m}var f="<<anonymous>>",g={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:_(),arrayOf:O,element:T(),elementType:M(),instanceOf:P,node:q(),objectOf:j,oneOf:G,oneOfType:A,shape:ue,exact:J};function w($,m){return $===m?$!==0||1/$===1/m:$!==$&&m!==m}function v($,m){this.message=$,this.data=m&&jn(m)==="object"?m:{},this.stack=""}v.prototype=Error.prototype;function b($){if(process.env.NODE_ENV!=="production")var m={},C=0;function y(x,N,B,Y,R,E,S){if(Y=Y||f,E=E||B,S!==r){if(u){var D=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw D.name="Invariant Violation",D}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var H=Y+":"+B;!m[H]&&C<3&&(o("You are manually calling a React.PropTypes validation function for the `"+E+"` prop on `"+Y+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),m[H]=!0,C++)}}return N[B]==null?x?N[B]===null?new v("The "+R+" `"+E+"` is marked as required "+("in `"+Y+"`, but its value is `null`.")):new v("The "+R+" `"+E+"` is marked as required in "+("`"+Y+"`, but its value is `undefined`.")):null:$(N,B,Y,R,E)}var I=y.bind(null,!1);return I.isRequired=y.bind(null,!0),I}function p($){function m(C,y,I,x,N,B){var Y=C[y],R=ee(Y);if(R!==$){var E=te(Y);return new v("Invalid "+x+" `"+N+"` of type "+("`"+E+"` supplied to `"+I+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return b(m)}function _(){return b(s)}function O($){function m(C,y,I,x,N){if(typeof $!="function")return new v("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside arrayOf.");var B=C[y];if(!Array.isArray(B)){var Y=ee(B);return new v("Invalid "+x+" `"+N+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected an array."))}for(var R=0;R<B.length;R++){var E=$(B,R,I,x,N+"["+R+"]",r);if(E instanceof Error)return E}return null}return b(m)}function T(){function $(m,C,y,I,x){var N=m[C];if(!l(N)){var B=ee(N);return new v("Invalid "+I+" `"+x+"` of type "+("`"+B+"` supplied to `"+y+"`, expected a single ReactElement."))}return null}return b($)}function M(){function $(m,C,y,I,x){var N=m[C];if(!t.isValidElementType(N)){var B=ee(N);return new v("Invalid "+I+" `"+x+"` of type "+("`"+B+"` supplied to `"+y+"`, expected a single ReactElement type."))}return null}return b($)}function P($){function m(C,y,I,x,N){if(!(C[y]instanceof $)){var B=$.name||f,Y=z(C[y]);return new v("Invalid "+x+" `"+N+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected ")+("instance of `"+B+"`."))}return null}return b(m)}function G($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function m(C,y,I,x,N){for(var B=C[y],Y=0;Y<$.length;Y++)if(w(B,$[Y]))return null;var R=JSON.stringify($,function(S,D){var H=te(D);return H==="symbol"?String(D):D});return new v("Invalid "+x+" `"+N+"` of value `"+String(B)+"` "+("supplied to `"+I+"`, expected one of "+R+"."))}return b(m)}function j($){function m(C,y,I,x,N){if(typeof $!="function")return new v("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside objectOf.");var B=C[y],Y=ee(B);if(Y!=="object")return new v("Invalid "+x+" `"+N+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected an object."));for(var R in B)if(n(B,R)){var E=$(B,R,I,x,N+"."+R,r);if(E instanceof Error)return E}return null}return b(m)}function A($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var m=0;m<$.length;m++){var C=$[m];if(typeof C!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ae(C)+" at index "+m+"."),s}function y(I,x,N,B,Y){for(var R=[],E=0;E<$.length;E++){var S=$[E],D=S(I,x,N,B,Y,r);if(D==null)return null;D.data&&n(D.data,"expectedType")&&R.push(D.data.expectedType)}var H=R.length>0?", expected one of type ["+R.join(", ")+"]":"";return new v("Invalid "+B+" `"+Y+"` supplied to "+("`"+N+"`"+H+"."))}return b(y)}function q(){function $(m,C,y,I,x){return Z(m[C])?null:new v("Invalid "+I+" `"+x+"` supplied to "+("`"+y+"`, expected a ReactNode."))}return b($)}function Q($,m,C,y,I){return new v(($||"React class")+": "+m+" type `"+C+"."+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+I+"`.")}function ue($){function m(C,y,I,x,N){var B=C[y],Y=ee(B);if(Y!=="object")return new v("Invalid "+x+" `"+N+"` of type `"+Y+"` "+("supplied to `"+I+"`, expected `object`."));for(var R in $){var E=$[R];if(typeof E!="function")return Q(I,x,N,R,te(E));var S=E(B,R,I,x,N+"."+R,r);if(S)return S}return null}return b(m)}function J($){function m(C,y,I,x,N){var B=C[y],Y=ee(B);if(Y!=="object")return new v("Invalid "+x+" `"+N+"` of type `"+Y+"` "+("supplied to `"+I+"`, expected `object`."));var R=e({},C[y],$);for(var E in R){var S=$[E];if(n($,E)&&typeof S!="function")return Q(I,x,N,E,te(S));if(!S)return new v("Invalid "+x+" `"+N+"` key `"+E+"` supplied to `"+I+"`.\nBad object: "+JSON.stringify(C[y],null," ")+`
|
|
545
|
+
Valid keys: `+JSON.stringify(Object.keys($),null," "));var D=S(B,E,I,x,N+"."+E,r);if(D)return D}return null}return b(m)}function Z($){switch(jn($)){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(Z);if($===null||l($))return!0;var m=d($);if(m){var C=m.call($),y;if(m!==$.entries){for(;!(y=C.next()).done;)if(!Z(y.value))return!1}else for(;!(y=C.next()).done;){var I=y.value;if(I&&!Z(I[1]))return!1}}else return!1;return!0;default:return!1}}function ne($,m){return $==="symbol"?!0:m?m["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&m instanceof Symbol:!1}function ee($){var m=jn($);return Array.isArray($)?"array":$ instanceof RegExp?"object":ne(m,$)?"symbol":m}function te($){if(typeof $>"u"||$===null)return""+$;var m=ee($);if(m==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return m}function ae($){var m=te($);switch(m){case"array":case"object":return"an "+m;case"boolean":case"date":case"regexp":return"a "+m;default:return m}}function z($){return!$.constructor||!$.constructor.name?f:$.constructor.name}return g.checkPropTypes=i,g.resetWarningCache=i.resetWarningCache,g.PropTypes=g,g},Vb}var Wb,FH;function sJ(){if(FH)return Wb;FH=1;var t=U_();function e(){}function r(){}return r.resetWarningCache=e,Wb=function(){function i(a,l,u,c,h,d){if(d!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function o(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return s.PropTypes=s,s},Wb}if(process.env.NODE_ENV!=="production"){var aJ=tV(),lJ=!0;cE.exports=oJ()(aJ.isElement,lJ)}else cE.exports=sJ()();var uJ=cE.exports,Bb=eJ(uJ),nV=oe.forwardRef(function(t,e){var r=oe.useRef(null),n=oe.useRef(null),i=oe.useRef(null),o=oe.useRef(null),s=oe.useRef(),a=ZF(),l=oe.useCallback(function(){return!r.current||!r.current.isDestroyed?r.current:(console.warn(bZ),null)},[r]),u=oe.useCallback(function(){return!r.current||r.current.isDestroyed},[r]),c=oe.useCallback(function(){a.clearRenderedCellCache(),a.componentRendererColumns.clear()},[a]),h=oe.useCallback(function(){return _Z()?n.current?n.current.ownerDocument:document:null},[n]),d=function(){var p,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=u()?[]:((p=l())===null||p===void 0||(p=p.getSettings())===null||p===void 0?void 0:p._initOnlySettings)||[],M=KF.getSettings(t,{prevProps:O,isInit:_,initOnlySettingKeys:T});return M.columns=a.columnsSettings.length?a.columnsSettings:M.columns,t.renderer?(M.renderer=a.getRendererWrapper(t.renderer),a.componentRendererColumns.set("global",!0)):M.renderer=t.hotRenderer||QR("text"),t.editor?M.editor=QF(i,o):M.editor=t.hotEditor||KR("text"),M},f=function(p){var _,O;p&&((_=p.getPlugin("autoRowSize"))!==null&&_!==void 0&&_.enabled||(O=p.getPlugin("autoColumnSize"))!==null&&O!==void 0&&O.enabled)&&a.componentRendererColumns.size>0&&jd(pZ)};oe.useEffect(function(){var b=d(!0);return s.current=t,r.current=new En.Core(n.current,b),r.current.addHook("beforeViewRender",function(){a.clearPortalCache(),a.clearRenderedCellCache()}),r.current.addHook("afterViewRender",function(){a.pushCellPortalsIntoPortalManager()}),r.current.init(),f(r.current),aE(t.children)||RZ(t.children,j_),function(){var p;c(),(p=l())===null||p===void 0||p.destroy()}},[]),MZ(function(){c();var b=l(),p=d(!1,s.current);s.current=t,b==null||b.updateSettings(p,!1),f(b),aE(t.children)}),oe.useImperativeHandle(e,function(){return{get hotElementRef(){return n.current},get hotInstance(){return l()}}});var g=oe.Children.toArray(t.children).filter(XZ).map(function(b,p){return oe.createElement(zZ,{columnIndex:p,getOwnerDocument:h,key:p},b)}),w=UF(t),v=jF(h(),t.editor);return oe.createElement(oe.Fragment,null,oe.createElement("div",Object.assign({ref:n},w),g),oe.createElement(QZ,{ref:a.setRenderersPortalManagerRef}),oe.createElement(eV,{hooksRef:i,hotCustomEditorInstanceRef:o},v))});nV.propTypes={style:Bb.object,id:Bb.string,className:Bb.string};var cJ=["children"],iV=oe.forwardRef(function(t,e){var r,n=t.children,i=LZ(t,cJ),o=(r=i.id)!==null&&r!==void 0?r:oe.useId();return oe.createElement(UZ,null,oe.createElement(nV,Object.assign({id:o},i,{ref:e}),n))});iV.version=JZ;const VH="handsontableEditor",hJ="handsontable";class z_ extends ru{static get EDITOR_TYPE(){return hJ}open(){super.open();const e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),e.display==="none"&&(e.display=""),this.htEditor=new this.hot.constructor(this.htContainer,this.htOptions),this.htEditor.init(),this.htEditor.rootElement.style.display="",this.cellProperties.strict?this.htEditor.selectCell(0,0):this.htEditor.deselectCell(),yw(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(u,c){const h=this.getSourceData(c.row,c.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&gr(l,s.handsontable),this.htOptions=l}beginEditing(e,r){const n=this.hot.getSettings().onBeginEditing;n&&n()===!1||super.beginEditing(e,r)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,r,n){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,r,n)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;(e=this.htEditor)===null||e===void 0||e.destroy()}),this.hot.addHook("afterSetTheme",(e,r)=>{if(!r){var n;(n=this.htEditor)===null||n===void 0||n.useTheme(e)}})}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const n={group:VH,relativeToGroup:_a,position:"before"},i=(o,s)=>{const a=this.htEditor;if(o!==void 0&&(o<0||a.flipped&&o>a.countRows()-1?a.deselectCell():a.selectCell(o,0),a.getData().length))return s.preventDefault(),Yi(s),this.hot.listen(),this.TEXTAREA.focus(),!1};r.addShortcuts([{keys:[["ArrowUp"]],callback:o=>{const s=this.htEditor;let a,l;return!s.getSelectedLast()&&s.flipped?a=s.countRows()-1:s.getSelectedLast()&&(s.flipped?(l=s.getSelectedLast()[0],a=Math.max(0,l-1)):(l=s.getSelectedLast()[0],a=l-1)),i(a,o)},preventDefault:!1},{keys:[["ArrowDown"]],callback:o=>{const s=this.htEditor;let a,l;if(!s.getSelectedLast()&&!s.flipped)a=0;else if(s.getSelectedLast()){if(s.flipped)a=s.getSelectedLast()[0]+1;else if(!s.flipped){const u=s.countRows()-1;l=s.getSelectedLast()[0],a=Math.min(u,l+1)}}return i(a,o)},preventDefault:!1}],n)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(VH)}}function dJ(t,e){oV(t,e),e.add(t)}function WH(t,e,r){oV(t,e),e.set(t,r)}function oV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wg(t,e,r){return(e=fJ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fJ(t){var e=gJ(t,"string");return typeof e=="symbol"?e:e+""}function gJ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jb(t,e){return t.get(hE(t,e))}function hE(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const mJ="autocomplete";var Ub=new WeakMap,BH=new WeakMap,zb=new WeakSet;class Y_ extends z_{constructor(){super(...arguments),dJ(this,zb),wg(this,"query",null),wg(this,"strippedChoices",[]),wg(this,"rawChoices",[]),WH(this,Ub,this.hot.guid.slice(0,9)),WH(this,BH,bw(()=>{this.focus()},100)),wg(this,"sortByRelevance",function(e,r,n){const i=[],o=[],s=e.length;let a=r.length,l,u,c,h;if(s===0){for(c=0;c<a;c++)o.push(c);return o}for(c=0;c<a;c++){if(u=_1(Ft(r[c])),n)h=u.indexOf(e);else{const d=this.cellProperties.locale;h=u.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=u.length-h-s,i.push({baseIndex:c,index:h,charsLeft:l,value:u}))}for(i.sort((d,f)=>{if(f.index===-1)return-1;if(d.index===-1)return 1;if(d.index<f.index)return-1;if(f.index<d.index)return 1;if(d.index===f.index){if(d.charsLeft<f.charsLeft)return-1;if(d.charsLeft>f.charsLeft)return 1}return 0}),c=0,a=i.length;c<a;c++)o.push(i[c].baseIndex);return o})}static get EDITOR_TYPE(){return mJ}getValue(){const e=this.rawChoices.find(r=>this.stripValueIfNeeded(r)===this.TEXTAREA.value);return pe(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),ie(this.htContainer,"autocompleteEditor"),ie(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Pe(this.TEXTAREA,[t3(),XK(),h$("listbox"),o3()])}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s),this.hot.getSettings().ariaTags&&Pe(this.TEXTAREA,[li("false"),s3(`${jb(Ub,this)}-listbox-${e}-${r}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,r=this.hot.getSettings().ariaTags,n=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=n==null?void 0:n.length,{row:o,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",a=>this.onBeforeKeyDown(a)),this.htEditor.addHook("afterScroll",jb(BH,this)),this.htEditor.updateSettings({colWidths:e?[nr(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,u,c,h,d,f)=>{Hs(a,l,u,c,h,d,f);const{filteringCaseSensitive:g,allowHtml:w,locale:v}=this.cellProperties,b=this.query;let p=Ft(d),_,O;p&&!w&&(_=g===!0?p.indexOf(b):p.toLocaleLowerCase(v).indexOf(b.toLocaleLowerCase(v)),_!==-1&&(O=p.substr(_,b.length),p=p.replace(O,`<strong>${O}</strong>`))),r&&Pe(l,[ZK(),...n?[c3(i)]:[],...n?[h3(n.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=p},afterSelectionEnd:(a,l)=>{if(r){const u=h=>{Pe(h,[V0()]),Pe(this.TEXTAREA,...a3(h.id))},c=this.htEditor.getCell(a,l,!0);c!==null?u(c):this.htEditor.addHookOnce("afterScrollVertically",()=>{const h=this.htEditor.getCell(a,l,!0);u(h)})}}}),r&&(Pe(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...ms()),Pe(this.htEditor.rootElement,[c$(),l3("polite"),u3("text"),["id",`${jb(Ub,this)}-listbox-${o}-${s}`]]),Pe(this.TEXTAREA,...li("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Pe(this.TEXTAREA,[li("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const r=this.cellProperties.source;this.query=e,typeof r=="function"?r.call(this.cellProperties,e,n=>{this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))}):Array.isArray(r)?(this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))):this.updateChoicesList([])}updateChoicesList(e){const r=b$(this.TEXTAREA),n=C3(this.TEXTAREA),i=this.cellProperties.sortByRelevance,o=this.cellProperties.filter;let s=null,a=null,l=e;i&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(s)?s.length:0;if(o===!1)u&&(a=s[0]);else{const c=[];for(let h=0,d=l.length;h<d&&!(i&&u<=h);h++)u?c.push(l[s[h]]):c.push(l[h]);a=0,l=c}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(Om([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),yw(this.TEXTAREA,r,r===n?void 0:n)}flipDropdownIfNeeded(){const e=this.getEditedCellRect(),r=e.height;let n=e.top;if(this.hot.view.isVerticallyScrollableByWindow()){const a=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;n=Math.max(n+a,0)}const i=this.getHeight(),o=this.hot.view.getWorkspaceHeight()-n-r,s=i>o&&n>o+r;return s?this.flipDropdown(i):this.unflipDropdown(),this.limitDropdownIfNeeded(s?n:o,i),s}limitDropdownIfNeeded(e,r){if(r>e){let n=0,i=0,o=0,s=null;do o=this.htEditor.getRowHeight(i)||this.htEditor.view.getDefaultRowHeight(),n+=o,i+=1;while(n<e);s=n-o,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+r-s}px`),this.setDropdownHeight(n-o)}}flipDropdown(e){const r=this.htEditor.rootElement.style;r.position="absolute",r.top=`${-e}px`,this.htEditor.flipped=!0}unflipDropdown(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.htEditor.flipped=void 0}updateDropdownDimensions(){this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),hE(zb,this,jH).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),hE(zb,this,jH).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getHeight(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),r=parseInt(e.borderTopWidth,10)+parseInt(e.borderBottomWidth,10),n=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:n},(o,s)=>s).reduce((o,s)=>{const a=this.htEditor.getRowHeight(s)||this.htEditor.view.getDefaultRowHeight();return o+a},0)+r+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),r=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+r}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:r}=this.cellProperties,n=qe(e,o=>Ft(o));return qe(n,o=>r?o:_1(o))}allowKeyEventPropagation(e){const r=this.htEditor.getSelectedRangeLast(),n={row:r?r.from.row:-1};let i=!1;return e===Re.ARROW_DOWN&&n.row>0&&n.row<this.htEditor.countRows()-1&&(i=!0),e===Re.ARROW_UP&&n.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(L3(e.keyCode)||e.keyCode===Re.BACKSPACE||e.keyCode===Re.DELETE||e.keyCode===Re.INSERT){let r=10;if(e.keyCode===Re.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(r+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},r)}}}function jH(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+Or(this.hot.rootDocument)})}const pJ="checkbox";class sV extends $c{static get EDITOR_TYPE(){return pJ}beginEditing(e,r){if(r&&r.type==="mouseup"&&r.target.nodeName==="TD"){const n=this.TD.querySelector('input[type="checkbox"]');_e(n,"htBadValue")||n.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
|
|
546
|
+
* Pikaday
|
|
547
|
+
*
|
|
548
|
+
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
|
|
549
|
+
*/const la=()=>window,ii=()=>window.document,dE=(t,e)=>window.setTimeout(t,e),ho=function(t,e,r,n){t.addEventListener(e,r,!!n)},qo=function(t,e,r,n){t.removeEventListener(e,r,!!n)},wJ=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},Nn=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},Yb=function(t,e){Nn(t,e)||(t.className=t.className===""?e:t.className+" "+e)},Gb=function(t,e){t.className=wJ((" "+t.className+" ").replace(" "+e+" "," "))},G_=function(t){return/Array/.test(Object.prototype.toString.call(t))},$n=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},vJ=function(t){let e=t.getDay();return e===0||e===6},yJ=function(t){return t%4===0&&t%100!==0||t%400===0},UH=function(t,e){return[31,yJ(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},vg=function(t){$n(t)&&t.setHours(0,0,0,0)},yg=function(t,e){return t.getTime()===e.getTime()},pp=function(t,e,r){let n,i;for(n in e)i=t[n]!==void 0,i&&typeof e[n]=="object"&&e[n]!==null&&e[n].nodeName===void 0?$n(e[n])?r&&(t[n]=new Date(e[n].getTime())):G_(e[n])?r&&(t[n]=e[n].slice(0)):t[n]=pp({},e[n],r):(r||!i)&&(t[n]=e[n]);return t},zH=function(t,e,r){let n=ii().createEvent("HTMLEvents");n.initEvent(e,!0,!1),n=pp(n,r),t.dispatchEvent(n)},YH=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},eo={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},GH=function(t,e,r){for(e+=t.firstDay;e>=7;)e-=7;return r?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},CJ=function(t){let e=[],r="false";if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled");else return'<td class="is-empty"></td>';return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),r="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'" aria-selected="'+r+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},bJ=function(t,e){t.setHours(0,0,0,0);let r=t.getDate(),n=t.getDay(),i=e,o=i-1,s=7,a=function(d){return(d+s-1)%s};t.setDate(r+o-a(n));let l=new Date(t.getFullYear(),0,i),u=24*60*60*1e3,c=(t.getTime()-l.getTime())/u;return 1+Math.round((c-o+a(l.getDay()))/s)},SJ=function(t,e,r,n,i){let o=new Date(n,r,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():bJ(o,i))+"</td>"},RJ=function(t,e,r,n){return'<tr class="pika-row'+(r?" pick-whole-week":"")+(n?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},EJ=function(t){return"<tbody>"+t.join("")+"</tbody>"},TJ=function(t){let e,r=[];for(t.showWeekNumber&&r.push("<th></th>"),e=0;e<7;e++)r.push('<th scope="col"><abbr title="'+GH(t,e)+'">'+GH(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?r.reverse():r).join("")+"</tr></thead>"},_J=function(t,e,r,n,i,o){let s,a,l,u=t._o,c=r===u.minYear,h=r===u.maxYear,d='<div id="'+o+'" class="pika-title" role="heading" aria-live="polite">',f,g,w=!0,v=!0;for(l=[],s=0;s<12;s++)l.push('<option value="'+(r===i?s-e:12+s-e)+'"'+(s===n?' selected="selected"':"")+(c&&s<u.minMonth||h&&s>u.maxMonth?' disabled="disabled"':"")+">"+u.i18n.months[s]+"</option>");for(f='<div class="pika-label">'+u.i18n.months[n]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",G_(u.yearRange)?(s=u.yearRange[0],a=u.yearRange[1]+1):(s=r-u.yearRange,a=1+r+u.yearRange),l=[];s<a&&s<=u.maxYear;s++)s>=u.minYear&&l.push('<option value="'+s+'"'+(s===r?' selected="selected"':"")+">"+s+"</option>");return g='<div class="pika-label">'+r+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=g+f:d+=f+g,c&&(n===0||u.minMonth>=n)&&(w=!1),h&&(n===11||u.maxMonth<=n)&&(v=!1),e===0&&(d+='<button class="pika-prev'+(w?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(v?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},MJ=function(t,e,r){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+r+'">'+TJ(t)+EJ(e)+"</table>"};function fE(t){let e=this,r=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||la().event;let o=i.target||i.srcElement;if(o)if(Nn(o,"is-disabled")||(Nn(o,"pika-button")&&!Nn(o,"is-empty")&&!Nn(o.parentNode,"is-disabled")?(e.setDate(new Date(o.getAttribute("data-pika-year"),o.getAttribute("data-pika-month"),o.getAttribute("data-pika-day"))),r.bound&&dE(function(){e.hide(),r.blurFieldOnSelect&&r.field&&r.field.blur()},100)):Nn(o,"pika-prev")?e.prevMonth():Nn(o,"pika-next")&&e.nextMonth()),Nn(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||la().event;let o=i.target||i.srcElement;o&&(Nn(o,"pika-select-month")?e.gotoMonth(o.value):Nn(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||la().event,e.isVisible())switch(i.keyCode){case 13:case 27:r.field&&r.field.blur();break;case 37:e.adjustDate("subtract",1);break;case 38:e.adjustDate("subtract",7);break;case 39:e.adjustDate("add",1);break;case 40:e.adjustDate("add",7);break;case 8:case 46:e.setDate(null);break}},e._parseFieldValue=function(){if(r.parse)return r.parse(r.field.value,r.format);if(this.hasMoment){let i=this.moment(r.field.value,r.format,r.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(r.field.value))},e._onInputChange=function(i){let o;i.firedBy!==e&&(o=e._parseFieldValue(),$n(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=ii().activeElement;do if(Nn(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=dE(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||la().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&Nn(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),ho(o,"change",e._onChange)));do if(Nn(s,"pika-single")||s===r.trigger)return;while(s=s.parentNode);e._v&&o!==r.trigger&&s!==r.trigger&&e.hide()}},e.el=ii().createElement("div"),e.el.className="pika-single"+(r.isRTL?" is-rtl":"")+(r.theme?" "+r.theme:""),ho(e.el,"mousedown",e._onMouseDown,!0),ho(e.el,"touchend",e._onMouseDown,!0),ho(e.el,"change",e._onChange),r.keyboardInput&&ho(ii(),"keydown",e._onKeyChange),r.field&&(r.container?r.container.appendChild(e.el):r.bound?ii().body.appendChild(e.el):r.field.parentNode.insertBefore(e.el,r.field.nextSibling),ho(r.field,"change",e._onInputChange),r.defaultDate||(r.defaultDate=e._parseFieldValue(),r.setDefaultDate=!0));let n=r.defaultDate;$n(n)?r.setDefaultDate?e.setDate(n,!0):e.gotoDate(n):e.gotoDate(new Date),r.bound?(this.hide(),e.el.className+=" is-bound",ho(r.trigger,"click",e._onInputClick),ho(r.trigger,"focus",e._onInputFocus),ho(r.trigger,"blur",e._onInputBlur)):this.show()}fE.prototype={config:function(t){this._o||(this._o=pp({},eo,!0));let e=pp(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=typeof e.theme=="string"&&e.theme?e.theme:null,e.bound=!!(e.bound!==void 0?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=typeof e.disableDayFn=="function"?e.disableDayFn:null;let r=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=r>4?4:r,$n(e.minDate)||(e.minDate=!1),$n(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),G_(e.yearRange)){let n=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||n,e.yearRange[1]=parseInt(e.yearRange[1],10)||n}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||eo.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,$n(this._d)?this._o.toString?this._o.toString(this._d,t):this.hasMoment?this.moment(this._d).format(t):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(t,e){this.hasMoment&&this.moment.isMoment(t)&&this.setDate(t.toDate(),e)},useMoment:function(t){this.hasMoment=!0,this.moment=t},getDate:function(){return $n(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",zH(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!$n(t))return;let r=this._o.minDate,n=this._o.maxDate;$n(r)&&t<r?t=r:$n(n)&&t>n&&(t=n),this._d=new Date(t.getTime()),vg(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),zH(this._o.field,"change",{firedBy:this})),!e&&typeof this._o.onSelect=="function"&&this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(t){let e=!0;if($n(t)){if(this.calendars){let r=new Date(this.calendars[0].year,this.calendars[0].month,1),n=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();n.setMonth(n.getMonth()+1),n.setDate(n.getDate()-1),e=i<r.getTime()||n.getTime()<i}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){let r=this.getDate()||new Date,n=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(r.valueOf()+n):t==="subtract"&&(i=new Date(r.valueOf()-n)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=YH(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=YH({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(vg(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=eo.minDate,this._o.minYear=eo.minYear,this._o.minMonth=eo.minMonth,this._o.startRange=eo.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(vg(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=eo.maxDate,this._o.maxYear=eo.maxYear,this._o.maxMonth=eo.maxMonth,this._o.endRange=eo.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(!this._v&&!t)return;let e=this._o,r=e.minYear,n=e.maxYear,i=e.minMonth,o=e.maxMonth,s="",a;this._y<=r&&(this._y=r,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=n&&(this._y=n,!isNaN(o)&&this._m>o&&(this._m=o));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),s+='<div class="pika-lendar">'+_J(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,a)+this.render(this.calendars[l].year,this.calendars[l].month,a)+"</div>";this.el.innerHTML=s,e.bound&&e.field.type!=="hidden"&&dE(function(){e.trigger.focus()},1),typeof this._o.onDraw=="function"&&this._o.onDraw(this),e.bound&&e.field.setAttribute("aria-label",e.ariaLabel)},adjustPosition:function(){let t,e,r,n,i,o,s,a,l,u,c;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,r=this.el.offsetHeight,n=la().innerWidth||ii().documentElement.clientWidth,i=la().innerHeight||ii().documentElement.clientHeight,o=ii().body.scrollTop||ii().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+la().pageXOffset,a=l.bottom+la().pageYOffset,(this._o.reposition&&s+e>n||this._o.position.indexOf("right")>-1&&s-e+t.offsetWidth>0)&&(s=s-e+t.offsetWidth,u=!1),(this._o.reposition&&a+r>i+o||this._o.position.indexOf("top")>-1&&a-r-t.offsetHeight>0)&&(a=a-r-t.offsetHeight,c=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",Yb(this.el,u?"left-aligned":"right-aligned"),Yb(this.el,c?"bottom-aligned":"top-aligned"),Gb(this.el,u?"right-aligned":"left-aligned"),Gb(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,r){let n=this._o,i=new Date,o=UH(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];vg(i),n.firstDay>0&&(s-=n.firstDay,s<0&&(s+=7));let u=e===0?11:e-1,c=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,f=UH(h,u),g=o+s,w=g;for(;w>7;)w-=7;g+=7-w;let v=!1;for(let b=0,p=0;b<g;b++){let _=new Date(t,e,1+(b-s)),O=$n(this._d)?yg(_,this._d):!1,T=yg(_,i),M=n.events.indexOf(_.toDateString())!==-1,P=b<s||b>=o+s,G=1+(b-s),j=e,A=t,q=n.startRange&&yg(n.startRange,_),Q=n.endRange&&yg(n.endRange,_),ue=n.startRange&&n.endRange&&n.startRange<_&&_<n.endRange,J=n.minDate&&_<n.minDate||n.maxDate&&_>n.maxDate||n.disableWeekends&&vJ(_)||n.disableDayFn&&n.disableDayFn(_);P&&(b<s?(G=f+G,j=u,A=h):(G=G-o,j=c,A=d));let Z={day:G,month:j,year:A,hasEvent:M,isSelected:O,isToday:T,isDisabled:J,isEmpty:P,isStartRange:q,isEndRange:Q,isInRange:ue,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:n.enableSelectionDaysInNextAndPreviousMonths};n.pickWholeWeek&&O&&(v=!0),l.push(CJ(Z)),++p===7&&(n.showWeekNumber&&l.unshift(SJ(this,b-s,e,t,n.firstWeekOfYearMinDays)),a.push(RJ(l,n.isRTL,n.pickWholeWeek,v)),l=[],p=0,v=!1)}return MJ(n,a,r)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),Gb(this.el,"is-hidden"),this._o.bound&&(ho(ii(),"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){let t=this._v;t!==!1&&(this._o.bound&&qo(ii(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),Yb(this.el,"is-hidden"),this._v=!1,t!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){let t=this._o;this.hide(),qo(this.el,"mousedown",this._onMouseDown,!0),qo(this.el,"touchend",this._onMouseDown,!0),qo(this.el,"change",this._onChange),t.keyboardInput&&qo(ii(),"keydown",this._onKeyChange),t.field&&(qo(t.field,"change",this._onInputChange),t.bound&&(qo(t.trigger,"click",this._onInputClick),qo(t.trigger,"focus",this._onInputFocus),qo(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function PJ(t,e){IJ(t,e),e.add(t)}function IJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qH(t,e,r){return(e=OJ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function OJ(t){var e=xJ(t,"string");return typeof e=="symbol"?e:e+""}function xJ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qb(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const aV="date",KH="dateEditor",AJ="DD/MM/YYYY";var Cg=new WeakSet;class lV extends ru{constructor(){super(...arguments),PJ(this,Cg),qH(this,"parentDestroyed",!1),qH(this,"$datePicker",null)}static get EDITOR_TYPE(){return aV}init(){if(typeof se!="function")throw new Error("You need to include moment.js to your project.");if(typeof fE!="function")throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,r)=>{r||(Ee(this.datePicker,/ht-theme-.*/g),ie(this.datePicker,e))})}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),ie(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();Ee(this.datePicker,/ht-theme-.*/g),ie(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",r=>{_e(r.target,"pika-day")&&this.hideDatepicker(),r.stopPropagation()})}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),n.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:KH})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const i=this.hot._getEditorManager();i.closeEditor(),this.hot.view.render(),i.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(KH),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,r)}showDatepicker(e){const r=qb(Cg,this,Kb).call(this),n=this.hot.view.isMouseDown(),i=e?H$(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new fE(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(se),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,se(o,r,!0).isValid()&&this.$datePicker.setMoment(se(o,r),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!n&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,se(o,r,!0).isValid()&&this.$datePicker.setMoment(se(o,r),!0),!i&&!n&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;const r=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&Sw(n,this.cellProperties.datePickerConfig);const i=n.onSelect,o=n.onClose;return n.field=r,n.trigger=r,n.container=this.datePicker,n.bound=!1,n.keyboardInput=!1,n.format=(e=n.format)!==null&&e!==void 0?e:qb(Cg,this,Kb).call(this),n.reposition=n.reposition||!1,n.isRTL=!1,n.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=se(a).format(qb(Cg,this,Kb).call(this))),this.setValue(a),i&&i(),ps()&&this.hideDatepicker()},n.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},n}refreshDimensions(e){var r;if(super.refreshDimensions(e),this.state!==Zt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:n,columnIndexMapper:i}=this.hot,{wtOverlays:o}=this.hot.view._wt,{wtTable:s}=(r=o.getParentOverlay(this.TD))!==null&&r!==void 0?r:this.hot.view._wt,a=n.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=n.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),u=i.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),c=i.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=u&&this.col<=c){const h=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+h.top+fr(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-nr(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}function Kb(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:AJ}const HJ="dropdown";class uV extends Y_{static get EDITOR_TYPE(){return HJ}prepare(e,r,n,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,r,n,i,o,s)}}const NJ="numeric";class cV extends ru{static get EDITOR_TYPE(){return NJ}}function DJ(t,e,r){return(e=kJ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kJ(t){var e=LJ(t,"string");return typeof e=="symbol"?e:e+""}function LJ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const $J="password";class hV extends ru{constructor(){super(...arguments),DJ(this,"autoResize",WF(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return $J}createElements(){super.createElements(),this.TEXTAREA=this.hot.rootDocument.createElement("input"),this.TEXTAREA.setAttribute("type","password"),this.TEXTAREA.setAttribute("data-hot-input",""),this.TEXTAREA.className="handsontableInput",this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,Ts(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Xb="ht_editor_visible",XH="selectEditor",FJ="select";class dV extends $c{static get EDITOR_TYPE(){return FJ}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),r=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",r&&e.setAttribute(...eu()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),ie(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",_e(this.selectWrapper,Xb)&&Ee(this.selectWrapper,Xb),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>this.refreshDimensions()),this.addHook("afterRowResize",()=>this.refreshDimensions())}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),Ts(this.select),We(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,kc(h,u),this.select.appendChild(h)})}prepareOptions(e){let r={};if(Array.isArray(e))for(let n=0,i=e.length;n<i;n++)r[e[n]]=e[n];else typeof e=="object"&&(r=e);return r}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Zt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:r,width:n,height:i}=this.getEditedCellRect(),o=this.selectWrapper.style;o.height=`${i}px`,o.width=`${n}px`,o.top=`${e}px`,o[this.hot.isRtl()?"right":"left"]=`${r}px`,o.margin="0px",ie(this.selectWrapper,Xb)}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor"),n={group:XH};this.isInFullEditMode()&&r.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const i=this.select.selectedIndex-1;i>=0&&(this.select[i].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const i=this.select.selectedIndex+1;i<=this.select.length-1&&(this.select[i].selected=!0)}}],n)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(XH)}}const VJ="time";class fV extends ru{static get EDITOR_TYPE(){return VJ}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s),this.TEXTAREA.dir="ltr"}}function WJ(){Dn($c),Dn(Y_),Dn(sV),Dn(lV),Dn(uV),Dn(z_),Dn(cV),Dn(hV),Dn(dV),Dn(ru),Dn(fV)}const BJ="html";function q_(t,e,r,n,i,o,s){Cf.apply(this,[t,e,r,n,i,o,s]),kc(e,o??"",!1)}q_.RENDERER_TYPE=BJ;const jJ="autocomplete";function Vc(t,e,r,n,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?q_:Hs,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...eu()),u.appendChild(a.createTextNode("▼")),l.apply(this,[t,e,r,n,i,o,s]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(u,e.firstChild),ie(e,"htAutocomplete"),!t.acArrowListener){const h=new ji(t);t.acArrowListener=function(d){_e(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(r,n),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}Vc.RENDERER_TYPE=jJ;const UJ="dropdown";function K_(t,e,r,n,i,o,s){Vc.apply(this,[t,e,r,n,i,o,s])}K_.RENDERER_TYPE=UJ;const ZH=new WeakMap,JH=new WeakMap,zJ="htBadValue",Sc="data-row",Rc="data-col",YJ="checkboxRenderer",gV="checkbox";fe.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,r){const{label:n,type:i,row:o,column:s,prop:a}=e;if(i===gV){if(n){const{value:l,property:u}=n;let c=r;if(l)c=typeof l=="function"?l(o,s,a,r):l;else if(u){const h=this.getDataAtRowProp(o,u);c=h!==null?h:r}t=c}return t}});function X_(t,e,r,n,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Cf.apply(this,[t,e,r,n,i,o,s]),GJ(t);let u=qJ(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),Ts(e),o===s.checkedTemplate||Ft(o).toLocaleLowerCase(s.locale)===Ft(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||Ft(o).toLocaleLowerCase(s.locale)===Ft(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:Qt(o)?ie(u,"noValue"):(u.style.display="none",ie(u,zJ),h=!0),Pe(u,[[Sc,r],[Rc,n]]),l&&Pe(u,[Ld(u.checked?t.getTranslatedPhrase(F_):t.getTranslatedPhrase(V_)),g$(u.checked),JK()]),!h&&c){let w="";if(c.value)w=typeof c.value=="function"?c.value.call(this,r,n,i,o):c.value;else if(c.property){const b=t.getDataAtRowProp(r,c.property);w=b!==null?b:""}const v=KJ(a,w,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(v),e.appendChild(u)):(v.appendChild(u),u=v):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(v)):(v.insertBefore(u,v.firstChild),u=v))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),ZH.has(t)||(ZH.set(t,!0),d());function d(){const v=t.getShortcutManager().getContext("grid"),b={group:YJ,relativeToGroup:_a,position:"before"};v.addShortcuts([{keys:[["space"]],callback:()=>(f(),!g()),runOnlyIf:()=>{var p;return(p=t.getSelectedRangeLast())===null||p===void 0?void 0:p.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!g()),runOnlyIf:()=>{const p=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&(p==null?void 0:p.highlight.isCell())&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!g()),runOnlyIf:()=>{var p;return(p=t.getSelectedRangeLast())===null||p===void 0?void 0:p.highlight.isCell()}}],b)}function f(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const v=t.getSelectedRange(),b=[],p=new Map;let _=[],O=0;if(v){for(let T=0;T<v.length;T++){const{row:M,col:P}=v[T].getTopStartCorner(),{row:G,col:j}=v[T].getBottomEndCorner();for(let A=M;A<=G;A+=1)for(let q=P;q<=j;q+=1){const Q=t.getCellMeta(A,q);if(Q.hidden)continue;const ue={checkedTemplate:Q.checkedTemplate,uncheckedTemplate:Q.uncheckedTemplate};if(Q.type!=="checkbox"){w===!0&&!Q.readOnly&&(p.has(b.length)?p.set(b.length,[...p.get(b.length),[A,q,null]]):p.set(b.length,[[A,q,null]]));continue}if(Q.readOnly===!0)continue;typeof Q.checkedTemplate>"u"&&(Q.checkedTemplate=!0),typeof Q.uncheckedTemplate>"u"&&(Q.uncheckedTemplate=!1);const J=t.getDataAtCell(A,q);w===!1?[Q.checkedTemplate,Q.checkedTemplate.toString()].includes(J)?_.push([A,q,Q.uncheckedTemplate,ue]):[Q.uncheckedTemplate,Q.uncheckedTemplate.toString(),null,void 0].includes(J)&&_.push([A,q,Q.checkedTemplate,ue]):_.push([A,q,Q.uncheckedTemplate,ue]),O+=1}b.push(O),O=0}_.every(T=>{let[,,M]=T;return M===_[0][2]})?_=_.map(T=>{let[M,P,G]=T;return[M,P,G]}):_=_.map(T=>{let[M,P,,G]=T;return[M,P,G.checkedTemplate]}),_.length>0&&b.forEach((T,M)=>{let P=_.splice(0,T);p.size&&p.has(M)&&(P=[...P,...p.get(M)]),t.setDataAtCell(P)})}}function g(){const w=t.getSelectedRange();if(w){for(let v=0;v<w.length;v++){const b=w[v].getTopStartCorner(),p=w[v].getBottomEndCorner();for(let _=b.row;_<=p.row;_++)for(let O=b.col;O<=p.col;O++){if(t.getCellMeta(_,O).readOnly)continue;const M=t.getCell(_,O);if(Rs(M)&&M.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}X_.RENDERER_TYPE=gV;function GJ(t){let e=JH.get(t);if(!e){const{rootElement:r}=t;e=new ji(t),e.addEventListener(r,"click",n=>ZJ(n,t)),e.addEventListener(r,"mouseup",n=>XJ(n,t)),e.addEventListener(r,"change",n=>JJ(n,t)),JH.set(t,e)}return e}function qJ(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function KJ(t,e,r){const n=t.createElement("label");n.className=`htCheckboxRendererLabel ${r?"fullWidth":""}`;const i=t.createTextNode(e);if(r){const o=t.createElement("span");o.appendChild(i),n.appendChild(o)}else n.appendChild(i);return n.cloneNode(!0)}function XJ(t,e){const{target:r}=t;Z_(r)&&(!r.hasAttribute(Sc)||!r.hasAttribute(Rc)||setTimeout(e.listen,10))}function ZJ(t,e){const{target:r}=t;if(!Z_(r)||!r.hasAttribute(Sc)||!r.hasAttribute(Rc))return;const n=parseInt(r.getAttribute(Sc),10),i=parseInt(r.getAttribute(Rc),10);e.getCellMeta(n,i).readOnly&&t.preventDefault()}function JJ(t,e){const{target:r}=t;if(!Z_(r)||!r.hasAttribute(Sc)||!r.hasAttribute(Rc))return;const n=parseInt(r.getAttribute(Sc),10),i=parseInt(r.getAttribute(Rc),10),o=e.getCellMeta(n,i);if(!o.readOnly){let s=null;t.target.checked?s=o.uncheckedTemplate===void 0?!0:o.checkedTemplate:s=o.uncheckedTemplate===void 0?!1:o.uncheckedTemplate,e.setDataAtCell(n,i,s)}}function Z_(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const QJ="handsontable";function J_(t,e,r,n,i,o,s){Vc.apply(this,[t,e,r,n,i,o,s])}J_.RENDERER_TYPE=QJ;var eQ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tQ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}/*!
|
|
550
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
551
|
+
*
|
|
552
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
553
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
554
|
+
* in the Software without restriction, including without limitation the rights
|
|
555
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
556
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
557
|
+
* furnished to do so, subject to the following conditions:
|
|
558
|
+
*
|
|
559
|
+
* The above copyright notice and this permission notice shall be included in
|
|
560
|
+
* all copies or substantial portions of the Software.
|
|
561
|
+
*
|
|
562
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
563
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
564
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
565
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
566
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
567
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
568
|
+
* SOFTWARE.
|
|
569
|
+
*/var Zb,QH;function rQ(){return QH||(QH=1,Zb={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(t){let e=t%10;return~~(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),Zb}/*!
|
|
570
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
571
|
+
*
|
|
572
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
573
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
574
|
+
* in the Software without restriction, including without limitation the rights
|
|
575
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
576
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
577
|
+
* furnished to do so, subject to the following conditions:
|
|
578
|
+
*
|
|
579
|
+
* The above copyright notice and this permission notice shall be included in
|
|
580
|
+
* all copies or substantial portions of the Software.
|
|
581
|
+
*
|
|
582
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
583
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
584
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
585
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
586
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
587
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
588
|
+
* SOFTWARE.
|
|
589
|
+
*/var Jb,eN;function mV(){if(eN)return Jb;eN=1;const t=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function e(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function r(l,u,c,h,d,f,g){if(!isNaN(+l))return+l;let w="",v=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(v!==l)return-1*r(v,u,c,h,d,f);for(let M=0;M<t.length;M++){let P=t[M];if(w=l.replace(RegExp(`([0-9 ])(${P.key})$`),"$1"),w!==l)return r(w,u,c,h,d,f)*P.factor}if(w=l.replace("%",""),w!==l)return r(w,u,c,h,d,f)/100;let b=parseFloat(l);if(isNaN(b))return;let p=h(b);if(p&&p!=="."&&(w=l.replace(new RegExp(`${e(p)}$`),""),w!==l))return r(w,u,c,h,d,f);let _={};Object.keys(f).forEach(M=>{_[f[M]]=M});let O=Object.keys(_).sort().reverse(),T=O.length;for(let M=0;M<T;M++){let P=O[M],G=_[P];if(w=l.replace(P,""),w!==l){let j;switch(G){case"thousand":j=Math.pow(10,3);break;case"million":j=Math.pow(10,6);break;case"billion":j=Math.pow(10,9);break;case"trillion":j=Math.pow(10,12);break}return r(w,u,c,h,d,f)*j}}}function n(l,u,c){let h=l.replace(c,"");return h=h.replace(new RegExp(`([0-9])${e(u.thousands)}([0-9])`,"g"),"$1$2"),h=h.replace(u.decimal,"."),h}function i(l,u,c="",h,d,f,g){if(l==="")return;if(l===d)return 0;let w=n(l,u,c);return r(w,u,c,h,d,f)}function o(l,u){if(!(l.indexOf(":")&&u.thousands!==":"))return!1;let h=l.split(":");if(h.length!==3)return!1;let d=+h[0],f=+h[1],g=+h[2];return!isNaN(d)&&!isNaN(f)&&!isNaN(g)}function s(l){let u=l.split(":"),c=+u[0],h=+u[1];return+u[2]+60*h+3600*c}function a(l,u){const c=tM();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),g=c.getZeroFormat(),w=c.currentAbbreviations(),v;if(typeof l=="string")o(l,h)?v=s(l):v=i(l,h,d,f,g,w);else if(typeof l=="number")v=l;else return;if(v!==void 0)return v}return Jb={unformat:a},Jb}/*!
|
|
590
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
591
|
+
*
|
|
592
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
593
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
594
|
+
* in the Software without restriction, including without limitation the rights
|
|
595
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
596
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
597
|
+
* furnished to do so, subject to the following conditions:
|
|
598
|
+
*
|
|
599
|
+
* The above copyright notice and this permission notice shall be included in
|
|
600
|
+
* all copies or substantial portions of the Software.
|
|
601
|
+
*
|
|
602
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
603
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
604
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
605
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
606
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
607
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
608
|
+
* SOFTWARE.
|
|
609
|
+
*/var Qb,tN;function Q_(){if(tN)return Qb;tN=1;let t=mV();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,r=["currency","percent","byte","time","ordinal","number"],n=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],o=["sign","parenthesis"],s={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},u={output:{type:"string",validValues:r},base:{type:"string",validValues:["decimal","binary","general"],restriction:(v,b)=>b.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:v=>v.output==="byte"},characteristic:{type:"number",restriction:v=>v>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:n},average:"boolean",lowPrecision:{type:"boolean",restriction:(v,b)=>b.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:v=>v>=0,message:"value must be positive"},{restriction:(v,b)=>!b.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:v=>v>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:o},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(v,b)=>b.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:v=>v.match(e),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:s,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function h(v,b){let p=d(v),_=g(b);return p&&_}function d(v){return t.unformat(v)!==void 0}function f(v,b,p,_=!1){let O=Object.keys(v).map(T=>{if(!b[T])return console.error(`${p} Invalid key: ${T}`),!1;let M=v[T],P=b[T];if(typeof P=="string"&&(P={type:P}),P.type==="format"){if(!f(M,u,`[Validate ${T}]`,!0))return!1}else if(typeof M!==P.type)return console.error(`${p} ${T} type mismatched: "${P.type}" expected, "${typeof M}" provided`),!1;if(P.restrictions&&P.restrictions.length){let G=P.restrictions.length;for(let j=0;j<G;j++){let{restriction:A,message:q}=P.restrictions[j];if(!A(M,v))return console.error(`${p} ${T} invalid value: ${q}`),!1}}return P.restriction&&!P.restriction(M,v)?(console.error(`${p} ${T} invalid value: ${P.message}`),!1):P.validValues&&P.validValues.indexOf(M)===-1?(console.error(`${p} ${T} invalid value: must be among ${JSON.stringify(P.validValues)}, "${M}" provided`),!1):!(P.children&&!f(M,P.children,`[Validate ${T}]`))});return _||O.push(...Object.keys(b).map(T=>{let M=b[T];if(typeof M=="string"&&(M={type:M}),M.mandatory){let P=M.mandatory;if(typeof P=="function"&&(P=P(v)),P&&v[T]===void 0)return console.error(`${p} Missing mandatory key "${T}"`),!1}return!0})),O.reduce((T,M)=>T&&M,!0)}function g(v){return f(v,u,"[Validate format]")}function w(v){return f(v,c,"[Validate language]")}return Qb={validate:h,validateFormat:g,validateInput:d,validateLanguage:w},Qb}/*!
|
|
610
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
611
|
+
*
|
|
612
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
613
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
614
|
+
* in the Software without restriction, including without limitation the rights
|
|
615
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
616
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
617
|
+
* furnished to do so, subject to the following conditions:
|
|
618
|
+
*
|
|
619
|
+
* The above copyright notice and this permission notice shall be included in
|
|
620
|
+
* all copies or substantial portions of the Software.
|
|
621
|
+
*
|
|
622
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
623
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
624
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
625
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
626
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
627
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
628
|
+
* SOFTWARE.
|
|
629
|
+
*/function nQ(t,e){let r=t.match(/^{([^}]*)}/);return r?(e.prefix=r[1],t.slice(r[0].length)):t}function iQ(t,e){let r=t.match(/{([^}]*)}$/);return r?(e.postfix=r[1],t.slice(0,-r[0].length)):t}function oQ(t,e){if(t.indexOf("$")!==-1){e.output="currency";return}if(t.indexOf("%")!==-1){e.output="percent";return}if(t.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(t.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(t.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(t.indexOf(":")!==-1){e.output="time";return}t.indexOf("o")!==-1&&(e.output="ordinal")}function sQ(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function aQ(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function lQ(t,e){let r=t.match(/[1-9]+[0-9]*/);r&&(e.totalLength=+r[0])}function uQ(t,e){let n=t.split(".")[0].match(/0+/);n&&(e.characteristic=n[0].length)}function cQ(t,e){let r=t.split(".")[1];if(r){let n=r.match(/0+/);n&&(e.mantissa=n[0].length)}}function hQ(t,e){const r=t.split(".")[1];r&&(e.trimMantissa=r.indexOf("[")!==-1)}function dQ(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function fQ(t,e){t.indexOf("K")!==-1?e.forceAverage="thousand":t.indexOf("M")!==-1?e.forceAverage="million":t.indexOf("B")!==-1?e.forceAverage="billion":t.indexOf("T")!==-1&&(e.forceAverage="trillion")}function gQ(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function mQ(t,e){if(t.indexOf(".")!==-1){let r=t.split(".")[0];e.optionalCharacteristic=r.indexOf("0")===-1}}function pQ(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function wQ(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function vQ(t,e={}){return typeof t!="string"?t:(t=nQ(t,e),t=iQ(t,e),oQ(t,e),lQ(t,e),uQ(t,e),mQ(t,e),dQ(t,e),fQ(t,e),cQ(t,e),gQ(t,e),hQ(t,e),sQ(t,e),aQ(t,e),pQ(t,e),wQ(t,e),e)}var eM={parseFormat:vQ};/*!
|
|
630
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
631
|
+
*
|
|
632
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
633
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
634
|
+
* in the Software without restriction, including without limitation the rights
|
|
635
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
636
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
637
|
+
* furnished to do so, subject to the following conditions:
|
|
638
|
+
*
|
|
639
|
+
* The above copyright notice and this permission notice shall be included in
|
|
640
|
+
* all copies or substantial portions of the Software.
|
|
641
|
+
*
|
|
642
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
643
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
644
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
645
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
646
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
647
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
648
|
+
* SOFTWARE.
|
|
649
|
+
*/var eS,rN;function tM(){if(rN)return eS;rN=1;const t=rQ(),e=Q_(),r=eM;let n={},i,o={},s=null,a={};function l(c){i=c}function u(){return o[i]}return n.languages=()=>Object.assign({},o),n.currentLanguage=()=>i,n.currentBytes=()=>u().bytes||{},n.currentCurrency=()=>u().currency,n.currentAbbreviations=()=>u().abbreviations,n.currentDelimiters=()=>u().delimiters,n.currentOrdinal=()=>u().ordinal,n.currentDefaults=()=>Object.assign({},u().defaults,a),n.currentOrdinalDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().ordinalFormat),n.currentByteDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().byteFormat),n.currentPercentageDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().percentageFormat),n.currentCurrencyDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().currencyFormat),n.currentTimeDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().timeFormat),n.setDefaults=c=>{c=r.parseFormat(c),e.validateFormat(c)&&(a=c)},n.getZeroFormat=()=>s,n.setZeroFormat=c=>s=typeof c=="string"?c:null,n.hasZeroFormat=()=>s!==null,n.languageData=c=>{if(c){if(o[c])return o[c];throw new Error(`Unknown tag "${c}"`)}return u()},n.registerLanguage=(c,h=!1)=>{if(!e.validateLanguage(c))throw new Error("Invalid language data");o[c.languageTag]=c,h&&l(c.languageTag)},n.setLanguage=(c,h=t.languageTag)=>{if(!o[c]){let d=c.split("-")[0],f=Object.keys(o).find(g=>g.split("-")[0]===d);if(!o[f]){l(h);return}l(f);return}l(c)},n.registerLanguage(t),i=t.languageTag,eS=n,eS}function yQ(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}/*!
|
|
650
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
651
|
+
*
|
|
652
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
653
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
654
|
+
* in the Software without restriction, including without limitation the rights
|
|
655
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
656
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
657
|
+
* furnished to do so, subject to the following conditions:
|
|
658
|
+
*
|
|
659
|
+
* The above copyright notice and this permission notice shall be included in
|
|
660
|
+
* all copies or substantial portions of the Software.
|
|
661
|
+
*
|
|
662
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
663
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
664
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
665
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
666
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
667
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
668
|
+
* SOFTWARE.
|
|
669
|
+
*/function CQ(t,e){t.forEach(r=>{let n;try{n=yQ(`../languages/${r}`)}catch{console.error(`Unable to load "${r}". No matching language file found.`)}n&&e.registerLanguage(n)})}var bQ=t=>({loadLanguagesInNode:e=>CQ(e,t)}),pV={exports:{}};(function(t){(function(e){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,f=1e9;function g(M){var P,G,j,A=y.prototype={constructor:y,toString:null,valueOf:null},q=new y(1),Q=20,ue=4,J=-7,Z=21,ne=-1e7,ee=1e7,te=!1,ae=1,z=0,$={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},m="0123456789abcdefghijklmnopqrstuvwxyz",C=!0;function y(R,E){var S,D,H,F,X,L,W,K,U=this;if(!(U instanceof y))return new y(R,E);if(E==null){if(R&&R._isBigNumber===!0){U.s=R.s,!R.c||R.e>ee?U.c=U.e=null:R.e<ne?U.c=[U.e=0]:(U.e=R.e,U.c=R.c.slice());return}if((L=typeof R=="number")&&R*0==0){if(U.s=1/R<0?(R=-R,-1):1,R===~~R){for(F=0,X=R;X>=10;X/=10,F++);F>ee?U.c=U.e=null:(U.e=F,U.c=[R]);return}K=String(R)}else{if(!n.test(K=String(R)))return j(U,K,L);U.s=K.charCodeAt(0)==45?(K=K.slice(1),-1):1}(F=K.indexOf("."))>-1&&(K=K.replace(".","")),(X=K.search(/e/i))>0?(F<0&&(F=X),F+=+K.slice(X+1),K=K.substring(0,X)):F<0&&(F=K.length)}else{if(p(E,2,m.length,"Base"),E==10&&C)return U=new y(R),B(U,Q+U.e+1,ue);if(K=String(R),L=typeof R=="number"){if(R*0!=0)return j(U,K,L,E);if(U.s=1/R<0?(K=K.slice(1),-1):1,y.DEBUG&&K.replace(/^0\.0*|\./,"").length>15)throw Error(a+R)}else U.s=K.charCodeAt(0)===45?(K=K.slice(1),-1):1;for(S=m.slice(0,E),F=X=0,W=K.length;X<W;X++)if(S.indexOf(D=K.charAt(X))<0){if(D=="."){if(X>F){F=W;continue}}else if(!H&&(K==K.toUpperCase()&&(K=K.toLowerCase())||K==K.toLowerCase()&&(K=K.toUpperCase()))){H=!0,X=-1,F=0;continue}return j(U,String(R),L,E)}L=!1,K=G(K,E,10,U.s),(F=K.indexOf("."))>-1?K=K.replace(".",""):F=K.length}for(X=0;K.charCodeAt(X)===48;X++);for(W=K.length;K.charCodeAt(--W)===48;);if(K=K.slice(X,++W)){if(W-=X,L&&y.DEBUG&&W>15&&(R>c||R!==o(R)))throw Error(a+U.s*R);if((F=F-X-1)>ee)U.c=U.e=null;else if(F<ne)U.c=[U.e=0];else{if(U.e=F,U.c=[],X=(F+1)%u,F<0&&(X+=u),X<W){for(X&&U.c.push(+K.slice(0,X)),W-=u;X<W;)U.c.push(+K.slice(X,X+=u));X=u-(K=K.slice(X)).length}else X-=W;for(;X--;K+="0");U.c.push(+K)}}else U.c=[U.e=0]}y.clone=g,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(R){var E,S;if(R!=null)if(typeof R=="object"){if(R.hasOwnProperty(E="DECIMAL_PLACES")&&(S=R[E],p(S,0,f,E),Q=S),R.hasOwnProperty(E="ROUNDING_MODE")&&(S=R[E],p(S,0,8,E),ue=S),R.hasOwnProperty(E="EXPONENTIAL_AT")&&(S=R[E],S&&S.pop?(p(S[0],-f,0,E),p(S[1],0,f,E),J=S[0],Z=S[1]):(p(S,-f,f,E),J=-(Z=S<0?-S:S))),R.hasOwnProperty(E="RANGE"))if(S=R[E],S&&S.pop)p(S[0],-f,-1,E),p(S[1],1,f,E),ne=S[0],ee=S[1];else if(p(S,-f,f,E),S)ne=-(ee=S<0?-S:S);else throw Error(s+E+" cannot be zero: "+S);if(R.hasOwnProperty(E="CRYPTO"))if(S=R[E],S===!!S)if(S)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))te=S;else throw te=!S,Error(s+"crypto unavailable");else te=S;else throw Error(s+E+" not true or false: "+S);if(R.hasOwnProperty(E="MODULO_MODE")&&(S=R[E],p(S,0,9,E),ae=S),R.hasOwnProperty(E="POW_PRECISION")&&(S=R[E],p(S,0,f,E),z=S),R.hasOwnProperty(E="FORMAT"))if(S=R[E],typeof S=="object")$=S;else throw Error(s+E+" not an object: "+S);if(R.hasOwnProperty(E="ALPHABET"))if(S=R[E],typeof S=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(S))C=S.slice(0,10)=="0123456789",m=S;else throw Error(s+E+" invalid: "+S)}else throw Error(s+"Object expected: "+R);return{DECIMAL_PLACES:Q,ROUNDING_MODE:ue,EXPONENTIAL_AT:[J,Z],RANGE:[ne,ee],CRYPTO:te,MODULO_MODE:ae,POW_PRECISION:z,FORMAT:$,ALPHABET:m}},y.isBigNumber=function(R){if(!R||R._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var E,S,D=R.c,H=R.e,F=R.s;e:if({}.toString.call(D)=="[object Array]"){if((F===1||F===-1)&&H>=-f&&H<=f&&H===o(H)){if(D[0]===0){if(H===0&&D.length===1)return!0;break e}if(E=(H+1)%u,E<1&&(E+=u),String(D[0]).length==E){for(E=0;E<D.length;E++)if(S=D[E],S<0||S>=l||S!==o(S))break e;if(S!==0)return!0}}}else if(D===null&&H===null&&(F===null||F===1||F===-1))return!0;throw Error(s+"Invalid BigNumber: "+R)},y.maximum=y.max=function(){return x(arguments,-1)},y.minimum=y.min=function(){return x(arguments,1)},y.random=function(){var R=9007199254740992,E=Math.random()*R&2097151?function(){return o(Math.random()*R)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(S){var D,H,F,X,L,W=0,K=[],U=new y(q);if(S==null?S=Q:p(S,0,f),X=i(S/u),te)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(X*=2));W<X;)L=D[W]*131072+(D[W+1]>>>11),L>=9e15?(H=crypto.getRandomValues(new Uint32Array(2)),D[W]=H[0],D[W+1]=H[1]):(K.push(L%1e14),W+=2);W=X/2}else if(crypto.randomBytes){for(D=crypto.randomBytes(X*=7);W<X;)L=(D[W]&31)*281474976710656+D[W+1]*1099511627776+D[W+2]*4294967296+D[W+3]*16777216+(D[W+4]<<16)+(D[W+5]<<8)+D[W+6],L>=9e15?crypto.randomBytes(7).copy(D,W):(K.push(L%1e14),W+=7);W=X/7}else throw te=!1,Error(s+"crypto unavailable");if(!te)for(;W<X;)L=E(),L<9e15&&(K[W++]=L%1e14);for(X=K[--W],S%=u,X&&S&&(L=h[u-S],K[W]=o(X/L)*L);K[W]===0;K.pop(),W--);if(W<0)K=[F=0];else{for(F=-1;K[0]===0;K.splice(0,1),F-=u);for(W=1,L=K[0];L>=10;L/=10,W++);W<u&&(F-=u-W)}return U.e=F,U.c=K,U}}(),y.sum=function(){for(var R=1,E=arguments,S=new y(E[0]);R<E.length;)S=S.plus(E[R++]);return S},G=function(){var R="0123456789";function E(S,D,H,F){for(var X,L=[0],W,K=0,U=S.length;K<U;){for(W=L.length;W--;L[W]*=D);for(L[0]+=F.indexOf(S.charAt(K++)),X=0;X<L.length;X++)L[X]>H-1&&(L[X+1]==null&&(L[X+1]=0),L[X+1]+=L[X]/H|0,L[X]%=H)}return L.reverse()}return function(S,D,H,F,X){var L,W,K,U,re,me,ve,Oe,Be=S.indexOf("."),Ge=Q,Ie=ue;for(Be>=0&&(U=z,z=0,S=S.replace(".",""),Oe=new y(D),me=Oe.pow(S.length-Be),z=U,Oe.c=E(T(v(me.c),me.e,"0"),10,H,R),Oe.e=Oe.c.length),ve=E(S,D,H,X?(L=m,R):(L=R,m)),K=U=ve.length;ve[--U]==0;ve.pop());if(!ve[0])return L.charAt(0);if(Be<0?--K:(me.c=ve,me.e=K,me.s=F,me=P(me,Oe,Ge,Ie,H),ve=me.c,re=me.r,K=me.e),W=K+Ge+1,Be=ve[W],U=H/2,re=re||W<0||ve[W+1]!=null,re=Ie<4?(Be!=null||re)&&(Ie==0||Ie==(me.s<0?3:2)):Be>U||Be==U&&(Ie==4||re||Ie==6&&ve[W-1]&1||Ie==(me.s<0?8:7)),W<1||!ve[0])S=re?T(L.charAt(1),-Ge,L.charAt(0)):L.charAt(0);else{if(ve.length=W,re)for(--H;++ve[--W]>H;)ve[W]=0,W||(++K,ve=[1].concat(ve));for(U=ve.length;!ve[--U];);for(Be=0,S="";Be<=U;S+=L.charAt(ve[Be++]));S=T(S,K,L.charAt(0))}return S}}(),P=function(){function R(D,H,F){var X,L,W,K,U=0,re=D.length,me=H%d,ve=H/d|0;for(D=D.slice();re--;)W=D[re]%d,K=D[re]/d|0,X=ve*W+K*me,L=me*W+X%d*d+U,U=(L/F|0)+(X/d|0)+ve*K,D[re]=L%F;return U&&(D=[U].concat(D)),D}function E(D,H,F,X){var L,W;if(F!=X)W=F>X?1:-1;else for(L=W=0;L<F;L++)if(D[L]!=H[L]){W=D[L]>H[L]?1:-1;break}return W}function S(D,H,F,X){for(var L=0;F--;)D[F]-=L,L=D[F]<H[F]?1:0,D[F]=L*X+D[F]-H[F];for(;!D[0]&&D.length>1;D.splice(0,1));}return function(D,H,F,X,L){var W,K,U,re,me,ve,Oe,Be,Ge,Ie,je,Mt,wi,Do,zn,Pt,ar,Rt=D.s==H.s?1:-1,It=D.c,Ue=H.c;if(!It||!It[0]||!Ue||!Ue[0])return new y(!D.s||!H.s||(It?Ue&&It[0]==Ue[0]:!Ue)?NaN:It&&It[0]==0||!Ue?Rt*0:Rt/0);for(Be=new y(Rt),Ge=Be.c=[],K=D.e-H.e,Rt=F+K+1,L||(L=l,K=w(D.e/u)-w(H.e/u),Rt=Rt/u|0),U=0;Ue[U]==(It[U]||0);U++);if(Ue[U]>(It[U]||0)&&K--,Rt<0)Ge.push(1),re=!0;else{for(Do=It.length,Pt=Ue.length,U=0,Rt+=2,me=o(L/(Ue[0]+1)),me>1&&(Ue=R(Ue,me,L),It=R(It,me,L),Pt=Ue.length,Do=It.length),wi=Pt,Ie=It.slice(0,Pt),je=Ie.length;je<Pt;Ie[je++]=0);ar=Ue.slice(),ar=[0].concat(ar),zn=Ue[0],Ue[1]>=L/2&&zn++;do{if(me=0,W=E(Ue,Ie,Pt,je),W<0){if(Mt=Ie[0],Pt!=je&&(Mt=Mt*L+(Ie[1]||0)),me=o(Mt/zn),me>1)for(me>=L&&(me=L-1),ve=R(Ue,me,L),Oe=ve.length,je=Ie.length;E(ve,Ie,Oe,je)==1;)me--,S(ve,Pt<Oe?ar:Ue,Oe,L),Oe=ve.length,W=1;else me==0&&(W=me=1),ve=Ue.slice(),Oe=ve.length;if(Oe<je&&(ve=[0].concat(ve)),S(Ie,ve,je,L),je=Ie.length,W==-1)for(;E(Ue,Ie,Pt,je)<1;)me++,S(Ie,Pt<je?ar:Ue,je,L),je=Ie.length}else W===0&&(me++,Ie=[0]);Ge[U++]=me,Ie[0]?Ie[je++]=It[wi]||0:(Ie=[It[wi]],je=1)}while((wi++<Do||Ie[0]!=null)&&Rt--);re=Ie[0]!=null,Ge[0]||Ge.splice(0,1)}if(L==l){for(U=1,Rt=Ge[0];Rt>=10;Rt/=10,U++);B(Be,F+(Be.e=U+K*u-1)+1,X,re)}else Be.e=K,Be.r=+re;return Be}}();function I(R,E,S,D){var H,F,X,L,W;if(S==null?S=ue:p(S,0,8),!R.c)return R.toString();if(H=R.c[0],X=R.e,E==null)W=v(R.c),W=D==1||D==2&&(X<=J||X>=Z)?O(W,X):T(W,X,"0");else if(R=B(new y(R),E,S),F=R.e,W=v(R.c),L=W.length,D==1||D==2&&(E<=F||F<=J)){for(;L<E;W+="0",L++);W=O(W,F)}else if(E-=X,W=T(W,F,"0"),F+1>L){if(--E>0)for(W+=".";E--;W+="0");}else if(E+=F-L,E>0)for(F+1==L&&(W+=".");E--;W+="0");return R.s<0&&H?"-"+W:W}function x(R,E){for(var S,D,H=1,F=new y(R[0]);H<R.length;H++)D=new y(R[H]),(!D.s||(S=b(F,D))===E||S===0&&F.s===E)&&(F=D);return F}function N(R,E,S){for(var D=1,H=E.length;!E[--H];E.pop());for(H=E[0];H>=10;H/=10,D++);return(S=D+S*u-1)>ee?R.c=R.e=null:S<ne?R.c=[R.e=0]:(R.e=S,R.c=E),R}j=function(){var R=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,S=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,H=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,X,L,W){var K,U=L?X:X.replace(H,"");if(D.test(U))F.s=isNaN(U)?null:U<0?-1:1;else{if(!L&&(U=U.replace(R,function(re,me,ve){return K=(ve=ve.toLowerCase())=="x"?16:ve=="b"?2:8,!W||W==K?me:re}),W&&(K=W,U=U.replace(E,"$1").replace(S,"0.$1")),X!=U))return new y(U,K);if(y.DEBUG)throw Error(s+"Not a"+(W?" base "+W:"")+" number: "+X);F.s=null}F.c=F.e=null}}();function B(R,E,S,D){var H,F,X,L,W,K,U,re=R.c,me=h;if(re){e:{for(H=1,L=re[0];L>=10;L/=10,H++);if(F=E-H,F<0)F+=u,X=E,W=re[K=0],U=o(W/me[H-X-1]%10);else if(K=i((F+1)/u),K>=re.length)if(D){for(;re.length<=K;re.push(0));W=U=0,H=1,F%=u,X=F-u+1}else break e;else{for(W=L=re[K],H=1;L>=10;L/=10,H++);F%=u,X=F-u+H,U=X<0?0:o(W/me[H-X-1]%10)}if(D=D||E<0||re[K+1]!=null||(X<0?W:W%me[H-X-1]),D=S<4?(U||D)&&(S==0||S==(R.s<0?3:2)):U>5||U==5&&(S==4||D||S==6&&(F>0?X>0?W/me[H-X]:0:re[K-1])%10&1||S==(R.s<0?8:7)),E<1||!re[0])return re.length=0,D?(E-=R.e+1,re[0]=me[(u-E%u)%u],R.e=-E||0):re[0]=R.e=0,R;if(F==0?(re.length=K,L=1,K--):(re.length=K+1,L=me[u-F],re[K]=X>0?o(W/me[H-X]%me[X])*L:0),D)for(;;)if(K==0){for(F=1,X=re[0];X>=10;X/=10,F++);for(X=re[0]+=L,L=1;X>=10;X/=10,L++);F!=L&&(R.e++,re[0]==l&&(re[0]=1));break}else{if(re[K]+=L,re[K]!=l)break;re[K--]=0,L=1}for(F=re.length;re[--F]===0;re.pop());}R.e>ee?R.c=R.e=null:R.e<ne&&(R.c=[R.e=0])}return R}function Y(R){var E,S=R.e;return S===null?R.toString():(E=v(R.c),E=S<=J||S>=Z?O(E,S):T(E,S,"0"),R.s<0?"-"+E:E)}return A.absoluteValue=A.abs=function(){var R=new y(this);return R.s<0&&(R.s=1),R},A.comparedTo=function(R,E){return b(this,new y(R,E))},A.decimalPlaces=A.dp=function(R,E){var S,D,H,F=this;if(R!=null)return p(R,0,f),E==null?E=ue:p(E,0,8),B(new y(F),R+F.e+1,E);if(!(S=F.c))return null;if(D=((H=S.length-1)-w(this.e/u))*u,H=S[H])for(;H%10==0;H/=10,D--);return D<0&&(D=0),D},A.dividedBy=A.div=function(R,E){return P(this,new y(R,E),Q,ue)},A.dividedToIntegerBy=A.idiv=function(R,E){return P(this,new y(R,E),0,1)},A.exponentiatedBy=A.pow=function(R,E){var S,D,H,F,X,L,W,K,U,re=this;if(R=new y(R),R.c&&!R.isInteger())throw Error(s+"Exponent not an integer: "+Y(R));if(E!=null&&(E=new y(E)),L=R.e>14,!re.c||!re.c[0]||re.c[0]==1&&!re.e&&re.c.length==1||!R.c||!R.c[0])return U=new y(Math.pow(+Y(re),L?R.s*(2-_(R)):+Y(R))),E?U.mod(E):U;if(W=R.s<0,E){if(E.c?!E.c[0]:!E.s)return new y(NaN);D=!W&&re.isInteger()&&E.isInteger(),D&&(re=re.mod(E))}else{if(R.e>9&&(re.e>0||re.e<-1||(re.e==0?re.c[0]>1||L&&re.c[1]>=24e7:re.c[0]<8e13||L&&re.c[0]<=9999975e7)))return F=re.s<0&&_(R)?-0:0,re.e>-1&&(F=1/F),new y(W?1/F:F);z&&(F=i(z/u+2))}for(L?(S=new y(.5),W&&(R.s=1),K=_(R)):(H=Math.abs(+Y(R)),K=H%2),U=new y(q);;){if(K){if(U=U.times(re),!U.c)break;F?U.c.length>F&&(U.c.length=F):D&&(U=U.mod(E))}if(H){if(H=o(H/2),H===0)break;K=H%2}else if(R=R.times(S),B(R,R.e+1,1),R.e>14)K=_(R);else{if(H=+Y(R),H===0)break;K=H%2}re=re.times(re),F?re.c&&re.c.length>F&&(re.c.length=F):D&&(re=re.mod(E))}return D?U:(W&&(U=q.div(U)),E?U.mod(E):F?B(U,z,ue,X):U)},A.integerValue=function(R){var E=new y(this);return R==null?R=ue:p(R,0,8),B(E,E.e+1,R)},A.isEqualTo=A.eq=function(R,E){return b(this,new y(R,E))===0},A.isFinite=function(){return!!this.c},A.isGreaterThan=A.gt=function(R,E){return b(this,new y(R,E))>0},A.isGreaterThanOrEqualTo=A.gte=function(R,E){return(E=b(this,new y(R,E)))===1||E===0},A.isInteger=function(){return!!this.c&&w(this.e/u)>this.c.length-2},A.isLessThan=A.lt=function(R,E){return b(this,new y(R,E))<0},A.isLessThanOrEqualTo=A.lte=function(R,E){return(E=b(this,new y(R,E)))===-1||E===0},A.isNaN=function(){return!this.s},A.isNegative=function(){return this.s<0},A.isPositive=function(){return this.s>0},A.isZero=function(){return!!this.c&&this.c[0]==0},A.minus=function(R,E){var S,D,H,F,X=this,L=X.s;if(R=new y(R,E),E=R.s,!L||!E)return new y(NaN);if(L!=E)return R.s=-E,X.plus(R);var W=X.e/u,K=R.e/u,U=X.c,re=R.c;if(!W||!K){if(!U||!re)return U?(R.s=-E,R):new y(re?X:NaN);if(!U[0]||!re[0])return re[0]?(R.s=-E,R):new y(U[0]?X:ue==3?-0:0)}if(W=w(W),K=w(K),U=U.slice(),L=W-K){for((F=L<0)?(L=-L,H=U):(K=W,H=re),H.reverse(),E=L;E--;H.push(0));H.reverse()}else for(D=(F=(L=U.length)<(E=re.length))?L:E,L=E=0;E<D;E++)if(U[E]!=re[E]){F=U[E]<re[E];break}if(F&&(H=U,U=re,re=H,R.s=-R.s),E=(D=re.length)-(S=U.length),E>0)for(;E--;U[S++]=0);for(E=l-1;D>L;){if(U[--D]<re[D]){for(S=D;S&&!U[--S];U[S]=E);--U[S],U[D]+=l}U[D]-=re[D]}for(;U[0]==0;U.splice(0,1),--K);return U[0]?N(R,U,K):(R.s=ue==3?-1:1,R.c=[R.e=0],R)},A.modulo=A.mod=function(R,E){var S,D,H=this;return R=new y(R,E),!H.c||!R.s||R.c&&!R.c[0]?new y(NaN):!R.c||H.c&&!H.c[0]?new y(H):(ae==9?(D=R.s,R.s=1,S=P(H,R,0,3),R.s=D,S.s*=D):S=P(H,R,0,ae),R=H.minus(S.times(R)),!R.c[0]&&ae==1&&(R.s=H.s),R)},A.multipliedBy=A.times=function(R,E){var S,D,H,F,X,L,W,K,U,re,me,ve,Oe,Be,Ge,Ie=this,je=Ie.c,Mt=(R=new y(R,E)).c;if(!je||!Mt||!je[0]||!Mt[0])return!Ie.s||!R.s||je&&!je[0]&&!Mt||Mt&&!Mt[0]&&!je?R.c=R.e=R.s=null:(R.s*=Ie.s,!je||!Mt?R.c=R.e=null:(R.c=[0],R.e=0)),R;for(D=w(Ie.e/u)+w(R.e/u),R.s*=Ie.s,W=je.length,re=Mt.length,W<re&&(Oe=je,je=Mt,Mt=Oe,H=W,W=re,re=H),H=W+re,Oe=[];H--;Oe.push(0));for(Be=l,Ge=d,H=re;--H>=0;){for(S=0,me=Mt[H]%Ge,ve=Mt[H]/Ge|0,X=W,F=H+X;F>H;)K=je[--X]%Ge,U=je[X]/Ge|0,L=ve*K+U*me,K=me*K+L%Ge*Ge+Oe[F]+S,S=(K/Be|0)+(L/Ge|0)+ve*U,Oe[F--]=K%Be;Oe[F]=S}return S?++D:Oe.splice(0,1),N(R,Oe,D)},A.negated=function(){var R=new y(this);return R.s=-R.s||null,R},A.plus=function(R,E){var S,D=this,H=D.s;if(R=new y(R,E),E=R.s,!H||!E)return new y(NaN);if(H!=E)return R.s=-E,D.minus(R);var F=D.e/u,X=R.e/u,L=D.c,W=R.c;if(!F||!X){if(!L||!W)return new y(H/0);if(!L[0]||!W[0])return W[0]?R:new y(L[0]?D:H*0)}if(F=w(F),X=w(X),L=L.slice(),H=F-X){for(H>0?(X=F,S=W):(H=-H,S=L),S.reverse();H--;S.push(0));S.reverse()}for(H=L.length,E=W.length,H-E<0&&(S=W,W=L,L=S,E=H),H=0;E;)H=(L[--E]=L[E]+W[E]+H)/l|0,L[E]=l===L[E]?0:L[E]%l;return H&&(L=[H].concat(L),++X),N(R,L,X)},A.precision=A.sd=function(R,E){var S,D,H,F=this;if(R!=null&&R!==!!R)return p(R,1,f),E==null?E=ue:p(E,0,8),B(new y(F),R,E);if(!(S=F.c))return null;if(H=S.length-1,D=H*u+1,H=S[H]){for(;H%10==0;H/=10,D--);for(H=S[0];H>=10;H/=10,D++);}return R&&F.e+1>D&&(D=F.e+1),D},A.shiftedBy=function(R){return p(R,-c,c),this.times("1e"+R)},A.squareRoot=A.sqrt=function(){var R,E,S,D,H,F=this,X=F.c,L=F.s,W=F.e,K=Q+4,U=new y("0.5");if(L!==1||!X||!X[0])return new y(!L||L<0&&(!X||X[0])?NaN:X?F:1/0);if(L=Math.sqrt(+Y(F)),L==0||L==1/0?(E=v(X),(E.length+W)%2==0&&(E+="0"),L=Math.sqrt(+E),W=w((W+1)/2)-(W<0||W%2),L==1/0?E="5e"+W:(E=L.toExponential(),E=E.slice(0,E.indexOf("e")+1)+W),S=new y(E)):S=new y(L+""),S.c[0]){for(W=S.e,L=W+K,L<3&&(L=0);;)if(H=S,S=U.times(H.plus(P(F,H,K,1))),v(H.c).slice(0,L)===(E=v(S.c)).slice(0,L))if(S.e<W&&--L,E=E.slice(L-3,L+1),E=="9999"||!D&&E=="4999"){if(!D&&(B(H,H.e+Q+2,0),H.times(H).eq(F))){S=H;break}K+=4,L+=4,D=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(B(S,S.e+Q+2,1),R=!S.times(S).eq(F));break}}return B(S,S.e+Q+1,ue,R)},A.toExponential=function(R,E){return R!=null&&(p(R,0,f),R++),I(this,R,E,1)},A.toFixed=function(R,E){return R!=null&&(p(R,0,f),R=R+this.e+1),I(this,R,E)},A.toFormat=function(R,E,S){var D,H=this;if(S==null)R!=null&&E&&typeof E=="object"?(S=E,E=null):R&&typeof R=="object"?(S=R,R=E=null):S=$;else if(typeof S!="object")throw Error(s+"Argument not an object: "+S);if(D=H.toFixed(R,E),H.c){var F,X=D.split("."),L=+S.groupSize,W=+S.secondaryGroupSize,K=S.groupSeparator||"",U=X[0],re=X[1],me=H.s<0,ve=me?U.slice(1):U,Oe=ve.length;if(W&&(F=L,L=W,W=F,Oe-=F),L>0&&Oe>0){for(F=Oe%L||L,U=ve.substr(0,F);F<Oe;F+=L)U+=K+ve.substr(F,L);W>0&&(U+=K+ve.slice(F)),me&&(U="-"+U)}D=re?U+(S.decimalSeparator||"")+((W=+S.fractionGroupSize)?re.replace(new RegExp("\\d{"+W+"}\\B","g"),"$&"+(S.fractionGroupSeparator||"")):re):U}return(S.prefix||"")+D+(S.suffix||"")},A.toFraction=function(R){var E,S,D,H,F,X,L,W,K,U,re,me,ve=this,Oe=ve.c;if(R!=null&&(L=new y(R),!L.isInteger()&&(L.c||L.s!==1)||L.lt(q)))throw Error(s+"Argument "+(L.isInteger()?"out of range: ":"not an integer: ")+Y(L));if(!Oe)return new y(ve);for(E=new y(q),K=S=new y(q),D=W=new y(q),me=v(Oe),F=E.e=me.length-ve.e-1,E.c[0]=h[(X=F%u)<0?u+X:X],R=!R||L.comparedTo(E)>0?F>0?E:K:L,X=ee,ee=1/0,L=new y(me),W.c[0]=0;U=P(L,E,0,1),H=S.plus(U.times(D)),H.comparedTo(R)!=1;)S=D,D=H,K=W.plus(U.times(H=K)),W=H,E=L.minus(U.times(H=E)),L=H;return H=P(R.minus(S),D,0,1),W=W.plus(H.times(K)),S=S.plus(H.times(D)),W.s=K.s=ve.s,F=F*2,re=P(K,D,F,ue).minus(ve).abs().comparedTo(P(W,S,F,ue).minus(ve).abs())<1?[K,D]:[W,S],ee=X,re},A.toNumber=function(){return+Y(this)},A.toPrecision=function(R,E){return R!=null&&p(R,1,f),I(this,R,E,2)},A.toString=function(R){var E,S=this,D=S.s,H=S.e;return H===null?D?(E="Infinity",D<0&&(E="-"+E)):E="NaN":(R==null?E=H<=J||H>=Z?O(v(S.c),H):T(v(S.c),H,"0"):R===10&&C?(S=B(new y(S),Q+H+1,ue),E=T(v(S.c),S.e,"0")):(p(R,2,m.length,"Base"),E=G(T(v(S.c),H,"0"),10,R,D,!0)),D<0&&S.c[0]&&(E="-"+E)),E},A.valueOf=A.toJSON=function(){return Y(this)},A._isBigNumber=!0,M!=null&&y.set(M),y}function w(M){var P=M|0;return M>0||M===P?P:P-1}function v(M){for(var P,G,j=1,A=M.length,q=M[0]+"";j<A;){for(P=M[j++]+"",G=u-P.length;G--;P="0"+P);q+=P}for(A=q.length;q.charCodeAt(--A)===48;);return q.slice(0,A+1||1)}function b(M,P){var G,j,A=M.c,q=P.c,Q=M.s,ue=P.s,J=M.e,Z=P.e;if(!Q||!ue)return null;if(G=A&&!A[0],j=q&&!q[0],G||j)return G?j?0:-ue:Q;if(Q!=ue)return Q;if(G=Q<0,j=J==Z,!A||!q)return j?0:!A^G?1:-1;if(!j)return J>Z^G?1:-1;for(ue=(J=A.length)<(Z=q.length)?J:Z,Q=0;Q<ue;Q++)if(A[Q]!=q[Q])return A[Q]>q[Q]^G?1:-1;return J==Z?0:J>Z^G?1:-1}function p(M,P,G,j){if(M<P||M>G||M!==o(M))throw Error(s+(j||"Argument")+(typeof M=="number"?M<P||M>G?" out of range: ":" not an integer: ":" not a primitive number: ")+String(M))}function _(M){var P=M.c.length-1;return w(M.e/u)==P&&M.c[P]%2!=0}function O(M,P){return(M.length>1?M.charAt(0)+"."+M.slice(1):M)+(P<0?"e":"e+")+P}function T(M,P,G){var j,A;if(P<0){for(A=G+".";++P;A+=G);M=A+M}else if(j=M.length,++P>j){for(A=G,P-=j;--P;A+=G);M+=A}else P<j&&(M=M.slice(0,P)+"."+M.slice(P));return M}r=g(),r.default=r.BigNumber=r,t.exports?t.exports=r:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=r)})(eQ)})(pV);var wV=pV.exports;/*!
|
|
670
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
671
|
+
*
|
|
672
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
673
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
674
|
+
* in the Software without restriction, including without limitation the rights
|
|
675
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
676
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
677
|
+
* furnished to do so, subject to the following conditions:
|
|
678
|
+
*
|
|
679
|
+
* The above copyright notice and this permission notice shall be included in
|
|
680
|
+
* all copies or substantial portions of the Software.
|
|
681
|
+
*
|
|
682
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
683
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
684
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
685
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
686
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
687
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
688
|
+
* SOFTWARE.
|
|
689
|
+
*/const Ii=tM(),SQ=Q_(),RQ=eM,EQ=wV,xr={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},bf={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:vV,decimalSuffixes:wp}=Ii.currentBytes(),rM={general:{scale:1024,suffixes:wp},binary:{scale:1024,suffixes:vV},decimal:{scale:1e3,suffixes:wp}};function TQ(t,e={},r){if(typeof e=="string"&&(e=RQ.parseFormat(e)),!SQ.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=_Q(t,e,r);return s=zQ(s,i),s=YQ(s,o),s}function _Q(t,e,r){switch(e.output){case"currency":return e=Gu(e,Ii.currentCurrencyDefaultFormat()),NQ(t,e,Ii);case"percent":return e=Gu(e,Ii.currentPercentageDefaultFormat()),HQ(t,e,Ii,r);case"byte":return e=Gu(e,Ii.currentByteDefaultFormat()),OQ(t,e,Ii,r);case"time":return e=Gu(e,Ii.currentTimeDefaultFormat()),AQ(t);case"ordinal":return e=Gu(e,Ii.currentOrdinalDefaultFormat()),xQ(t,e,Ii);case"number":default:return Sf({instance:t,providedFormat:e})}}function MQ(t){let e=rM.decimal;return Dw(t._value,e.suffixes,e.scale).suffix}function PQ(t){let e=rM.binary;return Dw(t._value,e.suffixes,e.scale).suffix}function IQ(t){let e=rM.general;return Dw(t._value,e.suffixes,e.scale).suffix}function Dw(t,e,r){let n=e[0],i=Math.abs(t);if(i>=r){for(let o=1;o<e.length;++o){let s=Math.pow(r,o),a=Math.pow(r,o+1);if(i>=s&&i<a){n=e[o],t=t/s;break}}n===e[0]&&(t=t/Math.pow(r,e.length-1),n=e[e.length-1])}return{value:t,suffix:n}}function OQ(t,e,r,n){let i=e.base||"binary",o=Object.assign({},bf,e);const{binarySuffixes:s,decimalSuffixes:a}=r.currentBytes();let u={general:{scale:1024,suffixes:a||wp,marker:"bd"},binary:{scale:1024,suffixes:s||vV,marker:"b"},decimal:{scale:1e3,suffixes:a||wp,marker:"d"}}[i],{value:c,suffix:h}=Dw(t._value,u.suffixes,u.scale);return`${Sf({instance:n(c),providedFormat:e,state:r,defaults:r.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function xQ(t,e,r){let n=r.currentOrdinal(),i=Object.assign({},bf,e),o=Sf({instance:t,providedFormat:e,state:r}),s=n(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function AQ(t){let e=Math.floor(t._value/60/60),r=Math.floor((t._value-e*60*60)/60),n=Math.round(t._value-e*60*60-r*60);return`${e}:${r<10?"0":""}${r}:${n<10?"0":""}${n}`}function HQ(t,e,r,n){let i=e.prefixSymbol,o=Sf({instance:n(t._value*100),providedFormat:e,state:r}),s=Object.assign({},bf,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function NQ(t,e,r){const n=r.currentCurrency();let i=Object.assign({},e),o=Object.assign({},bf,i),s,a="",l=!!o.totalLength||!!o.forceAverage||o.average,u=i.currencyPosition||n.position,c=i.currencySymbol||n.symbol;const h=o.spaceSeparatedCurrency!==void 0?o.spaceSeparatedCurrency:o.spaceSeparated;i.lowPrecision===void 0&&(i.lowPrecision=!1),h&&(a=" "),u==="infix"&&(s=a+c+a);let d=Sf({instance:t,providedFormat:i,state:r,decimalSeparator:s});return u==="prefix"&&(t._value<0&&o.negative==="sign"?d=`-${a}${c}${d.slice(1)}`:t._value>0&&o.forceSign?d=`+${a}${c}${d.slice(1)}`:d=c+a+d),(!u||u==="postfix")&&(a=!o.spaceSeparatedAbbreviation&&l?"":a,d=d+a+c),d}function DQ({value:t,forceAverage:e,lowPrecision:r=!0,abbreviations:n,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:s=Math.round}){let a="",l=Math.abs(t),u=-1;if(e&&n[e]&&xr[e]?(a=n[e],t=t/xr[e]):l>=xr.trillion||r&&s(l/xr.trillion)===1?(a=n.trillion,t=t/xr.trillion):l<xr.trillion&&l>=xr.billion||r&&s(l/xr.billion)===1?(a=n.billion,t=t/xr.billion):l<xr.billion&&l>=xr.million||r&&s(l/xr.million)===1?(a=n.million,t=t/xr.million):(l<xr.million&&l>=xr.thousand||r&&s(l/xr.thousand)===1)&&(a=n.thousand,t=t/xr.thousand),a&&(a=(i?" ":"")+a),o){let h=t<0,d=t.toString().split(".")[0],f=h?d.length-1:d.length;u=Math.max(o-f,0)}return{value:t,abbreviation:a,mantissaPrecision:u}}function kQ({value:t,characteristicPrecision:e}){let[r,n]=t.toExponential().split("e"),i=+r;if(!e)return{value:i,abbreviation:`e${n}`};let o=1;return o<e&&(i=i*Math.pow(10,e-o),n=+n-(e-o),n=n>=0?`+${n}`:n),{value:i,abbreviation:`e${n}`}}function bg(t){let e="";for(let r=0;r<t;r++)e+="0";return e}function LQ(t,e){let r=t.toString(),[n,i]=r.split("e"),[o,s=""]=n.split(".");if(+i>0)r=o+s+bg(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(bg(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=bg(e-l.length)),r=a+l}return+i>0&&e>0&&(r+=`.${bg(e)}`),r}function $Q(t,e,r=Math.round){return t.toString().indexOf("e")!==-1?LQ(t,e):new EQ(r(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function FQ(t,e,r,n,i,o){if(n===-1)return t;let s=$Q(e,n,o),[a,l=""]=s.toString().split(".");if(l.match(/^0+$/)&&(r||i))return a;let u=l.match(/0+$/);return i&&u?`${a}.${l.toString().slice(0,u.index)}`:s.toString()}function VQ(t,e,r,n){let i=t,[o,s]=i.toString().split(".");if(o.match(/^-?0$/)&&r)return s?`${o.replace("0","")}.${s}`:o.replace("0","");const a=e<0&&o.indexOf("-")===0;if(a&&(o=o.slice(1),i=i.slice(1)),o.length<n){let l=n-o.length;for(let u=0;u<l;u++)i=`0${i}`}return a&&(i=`-${i}`),i.toString()}function WQ(t,e){let r=[],n=0;for(let i=t;i>0;i--)n===e&&(r.unshift(i),n=0),n++;return r}function BQ(t,e,r,n,i){let o=n.currentDelimiters(),s=o.thousands;i=i||o.decimal;let a=o.thousandsSize||3,l=t.toString(),u=l.split(".")[0],c=l.split(".")[1];const h=e<0&&u.indexOf("-")===0;return r&&(h&&(u=u.slice(1)),WQ(u.length,a).forEach((f,g)=>{u=u.slice(0,f+g)+s+u.slice(f+g)}),h&&(u=`-${u}`)),c?l=u+i+c:l=u,l}function jQ(t,e){return t+e}function UQ(t,e,r){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:r==="sign"?t:`(${t.replace("-","")})`}function zQ(t,e){return e+t}function YQ(t,e){return t+e}function Sf({instance:t,providedFormat:e,state:r=Ii,decimalSeparator:n,defaults:i=r.currentDefaults()}){let o=t._value;if(o===0&&r.hasZeroFormat())return r.getZeroFormat();if(!isFinite(o))return o.toString();let s=Object.assign({},bf,i,e),a=s.totalLength,l=a?0:s.characteristic,u=s.optionalCharacteristic,c=s.forceAverage,h=s.lowPrecision,d=!!a||!!c||s.average,f=a?-1:d&&e.mantissa===void 0?0:s.mantissa,g=a?!1:e.optionalMantissa===void 0?f===-1:s.optionalMantissa,w=s.trimMantissa,v=s.thousandSeparated,b=s.spaceSeparated,p=s.negative,_=s.forceSign,O=s.exponential,T=s.roundingFunction,M="";if(d){let G=DQ({value:o,forceAverage:c,lowPrecision:h,abbreviations:r.currentAbbreviations(),spaceSeparated:b,roundingFunction:T,totalLength:a});o=G.value,M+=G.abbreviation,a&&(f=G.mantissaPrecision)}if(O){let G=kQ({value:o,characteristicPrecision:l});o=G.value,M=G.abbreviation+M}let P=FQ(o.toString(),o,g,f,w,T);return P=VQ(P,o,u,l),P=BQ(P,o,v,r,n),(d||O)&&(P=jQ(P,M)),(_||o<0)&&(P=UQ(P,o,p)),P}function Gu(t,e){if(!t)return e;let r=Object.keys(t);return r.length===1&&r[0]==="output"?e:t}var GQ=t=>({format:(...e)=>TQ(...e,t),getByteUnit:(...e)=>IQ(...e,t),getBinaryByteUnit:(...e)=>PQ(...e,t),getDecimalByteUnit:(...e)=>MQ(...e,t),formatOrDefault:Gu});/*!
|
|
690
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
691
|
+
*
|
|
692
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
693
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
694
|
+
* in the Software without restriction, including without limitation the rights
|
|
695
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
696
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
697
|
+
* furnished to do so, subject to the following conditions:
|
|
698
|
+
*
|
|
699
|
+
* The above copyright notice and this permission notice shall be included in
|
|
700
|
+
* all copies or substantial portions of the Software.
|
|
701
|
+
*
|
|
702
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
703
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
704
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
705
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
706
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
707
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
708
|
+
* SOFTWARE.
|
|
709
|
+
*/const _s=wV;function qQ(t,e,r){let n=new _s(t._value),i=e;return r.isNumbro(e)&&(i=e._value),i=new _s(i),t._value=n.plus(i).toNumber(),t}function yV(t,e,r){let n=new _s(t._value),i=e;return r.isNumbro(e)&&(i=e._value),i=new _s(i),t._value=n.minus(i).toNumber(),t}function KQ(t,e,r){let n=new _s(t._value),i=e;return r.isNumbro(e)&&(i=e._value),i=new _s(i),t._value=n.times(i).toNumber(),t}function XQ(t,e,r){let n=new _s(t._value),i=e;return r.isNumbro(e)&&(i=e._value),i=new _s(i),t._value=n.dividedBy(i).toNumber(),t}function ZQ(t,e,r){let n=e;return r.isNumbro(e)&&(n=e._value),t._value=n,t}function JQ(t,e,r){let n=r(t._value);return yV(n,e,r),Math.abs(n._value)}var QQ=t=>({add:(e,r)=>qQ(e,r,t),subtract:(e,r)=>yV(e,r,t),multiply:(e,r)=>KQ(e,r,t),divide:(e,r)=>XQ(e,r,t),set:(e,r)=>ZQ(e,r,t),difference:(e,r)=>JQ(e,r,t),BigNumber:_s});/*!
|
|
710
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
711
|
+
*
|
|
712
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
713
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
714
|
+
* in the Software without restriction, including without limitation the rights
|
|
715
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
716
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
717
|
+
* furnished to do so, subject to the following conditions:
|
|
718
|
+
*
|
|
719
|
+
* The above copyright notice and this permission notice shall be included in
|
|
720
|
+
* all copies or substantial portions of the Software.
|
|
721
|
+
*
|
|
722
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
723
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
724
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
725
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
726
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
727
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
728
|
+
* SOFTWARE.
|
|
729
|
+
*/const eee="2.5.0",No=tM(),tee=Q_(),ree=bQ(er),nee=mV();let ja=GQ(er),vl=QQ(er);const iee=eM;class CV{constructor(e){this._value=e}clone(){return er(this._value)}format(e={}){return ja.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=iee.parseFormat(e)),e=ja.formatOrDefault(e,No.currentCurrencyDefaultFormat()),e.output="currency",ja.format(this,e)}formatTime(e={}){return e.output="time",ja.format(this,e)}binaryByteUnits(){return ja.getBinaryByteUnit(this)}decimalByteUnits(){return ja.getDecimalByteUnit(this)}byteUnits(){return ja.getByteUnit(this)}difference(e){return vl.difference(this,e)}add(e){return vl.add(this,e)}subtract(e){return vl.subtract(this,e)}multiply(e){return vl.multiply(this,e)}divide(e){return vl.divide(this,e)}set(e){return vl.set(this,bV(e))}value(){return this._value}valueOf(){return this._value}}function bV(t){let e=t;return er.isNumbro(t)?e=t._value:typeof t=="string"?e=er.unformat(t):isNaN(t)&&(e=NaN),e}function er(t){return new CV(bV(t))}er.version=eee;er.isNumbro=function(t){return t instanceof CV};er.language=No.currentLanguage;er.registerLanguage=No.registerLanguage;er.setLanguage=No.setLanguage;er.languages=No.languages;er.languageData=No.languageData;er.zeroFormat=No.setZeroFormat;er.defaultFormat=No.currentDefaults;er.setDefaults=No.setDefaults;er.defaultCurrencyFormat=No.currentCurrencyDefaultFormat;er.validate=tee.validate;er.loadLanguagesInNode=ree.loadLanguagesInNode;er.unformat=nee.unformat;er.BigNumber=vl.BigNumber;var oee=er,Ua=tQ(oee);const see="numeric";function SV(t,e){if(tn(t)){const r=e.numericFormat,n=r&&r.culture||"-",i=r&&r.pattern;if(typeof n<"u"&&!Ua.languages()[n]){const o=n.replace("-",""),s=Ua.allLanguages?Ua.allLanguages[n]:Ua[o];s&&Ua.registerLanguage(s)}Ua.setLanguage(n),t=Ua(t).format(i||"0")}return t}function nM(t,e,r,n,i,o,s){let a=o;if(tn(a)){let u=[];if(Array.isArray(s.className))u=s.className;else{var l;const c=(l=s.className)!==null&&l!==void 0?l:"";c.length&&(u=c.split(" "))}a=SV(a,s),u.indexOf("htLeft")<0&&u.indexOf("htCenter")<0&&u.indexOf("htRight")<0&&u.indexOf("htJustify")<0&&u.push("htRight"),u.indexOf("htNumeric")<0&&u.push("htNumeric"),s.className=u.join(" "),e.dir="ltr"}Hs(t,e,r,n,i,a,s)}nM.RENDERER_TYPE=see;const aee="password";function iM(t,e,r,n,i,o,s){Hs.apply(this,[t,e,r,n,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";Ce(a-1,()=>{u+=l}),kc(e,u)}iM.RENDERER_TYPE=aee;const lee="select";function oM(t,e,r,n,i,o,s){Hs.apply(this,[t,e,r,n,i,o,s])}oM.RENDERER_TYPE=lee;const uee="time";function sM(t,e,r,n,i,o,s){Hs.apply(this,[t,e,r,n,i,o,s]),e.dir="ltr"}sM.RENDERER_TYPE=uee;function cee(){Jn(Vc),Jn(Cf),Jn(X_),Jn(K_),Jn(J_),Jn(q_),Jn(nM),Jn(iM),Jn(oM),Jn(Hs),Jn(sM)}const hee="autocomplete";function kw(t,e){let r=t;if(r==null&&(r=""),this.allowEmpty&&r===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(r,nN(r,e)):nN(r,e)(this.source):e(!0)}kw.VALIDATOR_TYPE=hee;function nN(t,e){const r=t;return function(n){let i=!1;for(let o=0,s=n.length;o<s;o++)if(r===n[o]){i=!0;break}e(i)}}function dee(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const fee="date";function aM(t,e){const r=L$(aV,this.instance);let n=t,i=!0;n==null&&(n="");let o=se(n,this.dateFormat||r.defaultDateFormat,!0).isValid(),s=se(new Date(n)).isValid()||o;if(this.allowEmpty&&n===""&&(s=!0,o=!0),s||(i=!1),!s&&o&&(i=!0),s&&!o)if(this.correctFormat===!0){const a=gee(n,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}aM.VALIDATOR_TYPE=fee;function gee(t,e){const r=se(dee(t)),n=se(t,e),i=t.search(/[A-Za-z]/g)>-1;let o;return r.isValid()&&r.format("x")===n.format("x")||!n.isValid()||i?o=r:o=n,o.format(e)}const mee="dropdown";function lM(t,e){kw.apply(this,[t,e])}lM.VALIDATOR_TYPE=mee;const pee="numeric";function uM(t,e){let r=t;r==null&&(r=""),this.allowEmpty&&r===""?e(!0):e(r===""?!1:tn(t))}uM.VALIDATOR_TYPE=pee;const wee=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],vee="time";function cM(t,e){const r=this.timeFormat||"h:mm:ss a";let n=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const o=/^\d{1,2}$/.test(i);o&&(i+=":00");const s=se(i,wee,!0).isValid()?se(i):se(i,r);let a=s.isValid(),l=se(i,r,!0).isValid()&&!o;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(n=!1),!a&&l&&(n=!0),a&&!l)if(this.correctFormat===!0){const u=s.format(r);this.instance.setDataAtCell(this.visualRow,this.visualCol,u,"timeValidator"),n=!0}else n=!1;e(n)}cM.VALIDATOR_TYPE=vee;function yee(){Yu(kw),Yu(lM),Yu(aM),Yu(uM),Yu(cM)}const Cee="autocomplete",bee={CELL_TYPE:Cee,editor:Y_,renderer:Vc,validator:kw},See="checkbox",Ree={CELL_TYPE:See,editor:sV,renderer:X_},Eee="date";function RV(t,e,r,n,i,o,s){Vc.apply(this,[t,e,r,n,i,o,s])}RV.RENDERER_TYPE=Eee;const Tee="date",_ee={CELL_TYPE:Tee,editor:lV,renderer:RV,validator:aM},Mee="dropdown",Pee={CELL_TYPE:Mee,editor:uV,renderer:K_,validator:lM,filter:!1,strict:!0},Iee="handsontable",Oee={CELL_TYPE:Iee,editor:z_,renderer:J_},xee="numeric",Aee={CELL_TYPE:xee,editor:cV,renderer:nM,validator:uM,dataType:"number"},Hee="password",Nee={CELL_TYPE:Hee,editor:hV,renderer:iM,copyable:!1},Dee="select",kee={CELL_TYPE:Dee,editor:dV,renderer:oM},Lee="time",$ee={CELL_TYPE:Lee,editor:fV,renderer:sM,validator:cM};function Fee(){_i(bee),_i(Ree),_i(_ee),_i(Pee),_i(Oee),_i(Aee),_i(Nee),_i(kee),_i(BF),_i($ee)}function Vee(t,e){EV(t,e),e.add(t)}function Wee(t,e,r){EV(t,e),e.set(t,r)}function EV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vu(t,e,r){return(e=Bee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bee(t){var e=jee(t,"string");return typeof e=="symbol"?e:e+""}function jee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yu(t,e){return t.get(TV(t,e))}function TV(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const iN=new Map([["plugin",k4],["cell-type",AF],["editor",k$],["renderer",U$],["validator",z$]]),_V=Symbol("mainSetting"),Uee="base",Sg=[];let za=null;var Ya=new WeakMap,oN=new WeakSet;class nt{static get PLUGIN_KEY(){return Uee}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){Vee(this,oN),vu(this,"eventManager",new ji(this)),vu(this,"pluginName",null),vu(this,"pluginsInitializedCallbacks",[]),vu(this,"isPluginsReady",!1),vu(this,"enabled",!1),vu(this,"initialized",!1),Wee(this,Ya,{}),xs(this,"hot",e,{writable:!1}),za=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",r=>this.onUpdateSettings(r)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,r=Array.isArray(e)?e:[];if(r.length>0){const i=[];if(r.forEach(o=>{const[s,a]=o.split(":");if(!iN.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);iN.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
|
|
730
|
+
`,`${i.join(`
|
|
731
|
+
`)}
|
|
732
|
+
`].join("");Sg.push(o)}}if(za||(za=j$()),za.indexOf(this.pluginName)>=0&&za.splice(za.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),za.length===0){if(Sg.length>0){const i=[`${Sg.join(`
|
|
733
|
+
`)}
|
|
734
|
+
`,"You have to import and register them manually."].join("");throw Sg.length=0,new Error(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;(e=this.eventManager)===null||e===void 0||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const r=this.hot.getSettings()[this.constructor.PLUGIN_KEY];if(e===void 0)return r;const n=this.constructor.DEFAULT_SETTINGS;if((Array.isArray(r)||Ve(r))&&n[_V]===e){var i;return Array.isArray(r)?r:(i=r[e])!==null&&i!==void 0?i:n[e]}if(Ve(r)){var o;return(o=r[e])!==null&&o!==void 0?o:n[e]}return n[e]}addHook(e,r,n){yu(Ya,this)[e]=yu(Ya,this)[e]||[];const i=yu(Ya,this)[e];this.hot.addHook(e,r,n),i.push(r),yu(Ya,this)[e]=i}removeHooks(e){k(yu(Ya,this)[e]||[],r=>{this.hot.removeHook(e,r)})}clearHooks(){const e=yu(Ya,this);We(e,(r,n)=>this.removeHooks(n)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){k(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const r=TV(oN,this,zee).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&r&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),We(this,(r,n)=>{n!=="hot"&&(this[n]=null)}),delete this.t,delete this.hot}}function zee(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let r=0;r<e.length;r++)if(t[e[r]]!==void 0)return!0;return!1}function Ga(t,e,r){return(e=Yee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yee(t){var e=Gee(t,"string");return typeof e=="symbol"?e:e+""}function Gee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let MV=class{constructor(e){Ga(this,"hot",null),Ga(this,"container",null),Ga(this,"injected",!1),Ga(this,"rows",[]),Ga(this,"columns",[]),Ga(this,"samples",null),Ga(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,r){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const n={row:e};this.rows.push(n),this.samples=r,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),e===0&&ie(this.table.table,"htGhostTableFirstRow"),this.container.container.appendChild(this.table.fragment),n.table=this.table.table}addColumnHeadersRow(e){const r=this.hot.getColHeader(0);if(r!=null){const n={row:-1};this.rows.push(n),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),n.table=this.table.table}}addColumn(e,r){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const n={col:e};this.columns.push(n),this.samples=r,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&this.hot.getColHeader(e)!==null&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table}getHeights(e){this.injected||this.injectTable(),k(this.rows,r=>{const{height:n}=r.table.getBoundingClientRect();e(r.row,Math.ceil(n))})}getWidths(e){this.injected||this.injectTable(),k(this.columns,r=>{const{width:n}=r.table.getBoundingClientRect();e(r.col,Math.ceil(n))})}setSettings(e){this.settings=e}setSetting(e,r){this.settings||(this.settings={}),this.settings[e]=r}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const r=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&r.appendChild(this.createColElement(-1,-1)),this.samples.forEach(n=>{k(n.strings,i=>{r.appendChild(this.createColElement(i.col,e))})}),r}createRow(e){const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),n.appendChild(i)),this.samples.forEach(o=>{k(o.strings,s=>{const a=s.col,l=this.hot.getCellMeta(e,a),u=this.hot.getCellRenderer(l),c=r.createElement("td");c.setAttribute("ghost-table",1),u(this.hot,c,e,a,this.hot.colToProp(a),s.value,l),n.appendChild(c)})}),n}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,r=e.createDocumentFragment(),n=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");n.push([-1,i]),r.appendChild(i)}this.samples.forEach(i=>{k(i.strings,o=>{const s=o.col,a=e.createElement("th");n.push([s,a]),r.appendChild(a)})}),this.table.tHead.appendChild(r),k(n,i=>{const[o,s]=i;this.hot.view.appendColHeader(o,s)})}createCol(e){const{rootDocument:r}=this.hot,n=r.createDocumentFragment();return this.samples.forEach(i=>{k(i.strings,o=>{const s=o.row,a=this.hot.getCellMeta(s,e),l=this.hot.getCellRenderer(a),u=r.createElement("td"),c=r.createElement("tr");u.setAttribute("ghost-table",1),l(this.hot,u,s,e,this.hot.colToProp(e),o.value,a),c.appendChild(u),n.appendChild(c)})}),n}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,r){const n=this.hot.rootDocument.createElement("col");let i=0;r>=0&&e>=0&&(i=this.hot.getCellMeta(r,e).colspan);let o=this.hot.getColWidth(e);if(i>1)for(let s=e+1;s<e+i;s++)o+=this.hot.getColWidth(s);return n.style.width=`${o}px`,n}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("table"),o=r.createElement("thead"),s=r.createElement("tbody"),a=r.createElement("colgroup"),l=r.createElement("tr"),u=r.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(u),o.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(o),this.isVertical()&&s.appendChild(l),i.appendChild(s),ie(i,e),n.appendChild(i),{fragment:n,table:i,tHead:o,tBody:s,colGroup:a,tr:l,th:u}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("div"),o=`htGhostTable htAutoSize ${e.trim()}`;return ie(i,o),n.appendChild(i),{fragment:n,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function Rg(t,e,r){return(e=qee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qee(t){var e=Kee(t,"string");return typeof e=="symbol"?e:e+""}function Kee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Lw{static get SAMPLE_COUNT(){return 3}constructor(e){Rg(this,"samples",null),Rg(this,"dataFactory",null),Rg(this,"customSampleCount",null),Rg(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:Lw.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,r){return this.generateSamples("row",r,e)}generateColumnSamples(e,r){return this.generateSamples("col",r,e)}generateSamples(e,r,n){const i=new Map,{from:o,to:s}=typeof n=="number"?{from:n,to:n}:n;return Ce(o,s,a=>{const l=this.generateSample(e,r,a);i.set(a,l)}),i}generateSample(e,r,n){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,o=e==="row"?"col":"row",s=[];return Ce(r.from,r.to,a=>{const l=e==="row"?this.dataFactory(n,a):this.dataFactory(a,n);if(l===!1)return;const{value:u,bundleSeed:c}=l,h=typeof c=="string"&&c.length>0;let d;h?d=c:Ve(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${Ft(u).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const f=i.get(d);f.needed&&(!(s.indexOf(u)>-1)||this.allowDuplicates||h)&&(f.strings.push({value:u,[o]:a}),s.push(u),f.needed-=1)}),i}}function Xee(t,e){PV(t,e),e.add(t)}function tS(t,e,r){PV(t,e),e.set(t,r)}function PV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sh(t,e,r){return(e=Zee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zee(t){var e=Jee(t,"string");return typeof e=="symbol"?e:e+""}function Jee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ua(t,e){return t.get(Cn(t,e))}function vp(t,e,r){return t.set(Cn(t,e),r),r}function Cn(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("modifyAutoColumnSizeSeed");const rS="autoColumnSize",Qee=10,ete="autoColumnSize";var hM=new WeakMap,qu=new WeakMap,Ec=new WeakMap,kn=new WeakSet;class wd extends nt{static get PLUGIN_KEY(){return rS}static get PLUGIN_PRIORITY(){return Qee}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),Xee(this,kn),Sh(this,"ghostTable",new MV(this.hot)),Sh(this,"samplesGenerator",new Lw((r,n)=>{const i=this.hot.toPhysicalRow(r),o=this.hot.toPhysicalColumn(n);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o))return!1;const s=this.hot.getCellMeta(r,n);let a="";s.spanned||(a=this.hot.getDataAtCell(r,n));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,s,a)),{value:a,bundleSeed:l}})),Sh(this,"inProgress",!1),Sh(this,"measuredColumns",0),Sh(this,"columnWidthsMap",new Ta),tS(this,hM,!1),tS(this,qu,[]),tS(this,Ec,[]),this.hot.columnIndexMapper.registerMap(ete,this.columnWidthsMap),this.addHook("beforeColumnResize",(r,n,i)=>Cn(kn,this,sN).call(this,r,n,i))}isEnabled(){return this.hot.getSettings()[rS]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const r=this.getSetting("samplingRatio");r&&!isNaN(r)&&this.samplesGenerator.setSampleCount(parseInt(r,10)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Cn(kn,e,nte).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Cn(kn,e,ite).call(e,...i)}),this.addHook("afterFormulasValuesUpdate",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Cn(kn,e,ste).call(e,...i)}),this.addHook("beforeRender",()=>Cn(kn,this,rte).call(this)),this.addHook("modifyColWidth",(n,i)=>this.getColumnWidth(i,n)),this.addHook("init",()=>Cn(kn,this,ote).call(this)),super.enablePlugin()}updatePlugin(){vp(Ec,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,r,n)=>Cn(kn,this,sN).call(this,e,r,n))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),r=this.getLastVisibleColumn();if(e===-1||r===-1)return;const n=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:r},void 0,n)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof r=="number"?{from:r,to:r}:r;Ce(i.from,i.to,s=>{let a=this.hot.toPhysicalColumn(s);a===null&&(a=s),(n||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a))&&Cn(kn,this,IV).call(this,s,o)}),this.ghostTable.columns.length&&(Cn(kn,this,OV).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=0;const i=this.hot.countCols()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){up(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:n,to:Math.min(n+wd.CALCULATION_STEP,i)},e,r),n=n+wd.CALCULATION_STEP+1,n<i?o=lp(s):(up(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateColumnsWidth({from:0,to:a},e,r),n=a+1),n<i?s():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[rS];let r=wd.SYNC_CALCULATION_LIMIT;const n=this.hot.countCols()-1;return Ve(e)&&(r=e.syncLimit,a$(r)?r=V$(n,r):r>>=0),Math.min(r,n)}getColumnWidth(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=r;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),n&&typeof i=="number"&&(i=Math.max(i,Cc))),i}getFirstVisibleColumn(){var e;return(e=this.hot.getFirstRenderedVisibleColumn())!==null&&e!==void 0?e:-1}getLastVisibleColumn(){var e;return(e=this.hot.getLastRenderedVisibleColumn())!==null&&e!==void 0?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((n,i,o)=>{const s=ua(qu,this).length;return(s-1<o||ua(qu,this)[o]!==i)&&n.push(this.hot.toVisualColumn(o)),s-1<o?ua(qu,this).push(i):ua(qu,this)[o]=i,n},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(r=>{this.columnWidthsMap.setValueAtIndex(r,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function tte(t){const e={from:0,to:this.hot.countRows()-1};t.forEach(r=>{const n=this.hot.toPhysicalColumn(r);n!==null&&(this.hot._getColWidthFromSettings(n)||Cn(kn,this,IV).call(this,r,e))}),this.ghostTable.columns.length&&(Cn(kn,this,OV).call(this),this.ghostTable.clean())}function IV(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((n,i)=>this.ghostTable.addColumn(i,n))}function OV(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const r=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(r,e)})},!0)}function rte(){this.calculateVisibleColumnsWidth(),this.inProgress||(Cn(kn,this,tte).call(this,ua(Ec,this)),vp(Ec,this,[]))}function nte(t,e){e||this.recalculateAllColumnsWidth()}function ite(t){const e=t.reduce((r,n)=>{let[,i]=n;const o=this.hot.propToCol(i);return Number.isInteger(o)&&r.indexOf(o)===-1&&r.push(o),r},[]);ua(Ec,this).push(...e)}function sN(t,e,r){let n=t;return r&&(this.calculateColumnsWidth(e,void 0,!0),n=this.getColumnWidth(e,void 0,!1)),n}function ote(){vp(qu,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),vp(hM,this,!0)}function ste(t){if(!ua(hM,this))return;const e=t.reduce((r,n)=>{var i;const o=(i=n.address)===null||i===void 0?void 0:i.col;if(Number.isInteger(o)){const s=this.hot.toVisualColumn(o);r.indexOf(s)===-1&&r.push(s)}return r},[]);ua(Ec,this).push(...e)}const Ml={horizontal:"horizontal",vertical:"vertical"};function ate(t,e,r){let n,i,o;return e[0]===t[0]&&e[1]<t[1]?(o="left",n=r(e[0],e[1]),i=r(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(o="right",n=r(e[0],t[3]+1),i=r(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(o="up",n=r(e[0],e[1]),i=r(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(o="down",n=r(t[2]+1,e[1]),i=r(e[2],e[3])),n&&n.normalize(),i&&i.normalize(),{directionOfDrag:o,startOfDragCoords:n,endOfDragCoords:i}}function lte(t){const e={};return t===!0?(e.directions=Object.keys(Ml),e.autoInsertRow=!0):Ve(t)?(pe(t.autoInsertRow)?t.direction===Ml.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,pe(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(Ml)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function ute(t,e){cte(t,e),e.add(t)}function cte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cu(t,e,r){return(e=hte(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hte(t){var e=dte(t,"string");return typeof e=="symbol"?e:e+""}function dte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rh(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("modifyAutofillRange");fe.getSingleton().register("beforeAutofill");fe.getSingleton().register("afterAutofill");const aN="autofill",fte=20,gte=["fillHandle"],mte="insert_row_below",pte=200;var bu=new WeakSet;class wte extends nt{constructor(){super(...arguments),ute(this,bu),Cu(this,"addingStarted",!1),Cu(this,"mouseDownOnCellCorner",!1),Cu(this,"mouseDragOutside",!1),Cu(this,"handleDraggedCells",0),Cu(this,"directions",[]),Cu(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return aN}static get PLUGIN_PRIORITY(){return fte}static get SETTING_KEYS(){return[aN,...gte]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Rh(bu,this,yte).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Rh(bu,this,vte).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,r)=>Rh(bu,this,Cte).call(this,r)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:r,col:n}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.hot.runHooks("modifyCopyableRange",[{startRow:r,startCol:n,endRow:i,endCol:o}]),a=[],l=[],u=[];return k(s,c=>{for(let h=c.startRow;h<=c.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=c.startCol;h<=c.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),k(a,c=>{const h=[];k(l,d=>{h.push(this.hot.getCopyableData(c,d))}),u.push(h)}),u}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,r,n,i]=this.hot.selection.highlight.getFill().getVisualCorners(),o=this.hot.getSelectedRangeLast(),s=o.getTopStartCorner(),a=o.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[s.row,s.col,a.row,a.col],u=this.hot.runHooks("modifyAutofillRange",[Math.min(s.row,e),Math.min(s.col,r),Math.max(a.row,n),Math.max(a.col,i)],l),{directionOfDrag:c,startOfDragCoords:h,endOfDragCoords:d}=ate(l,u,(f,g)=>this.hot._createCellCoords(f,g));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),g=o.clone(),w=this.hot._createCellRange(h,h,d),v=this.hot.runHooks("beforeAutofill",f,g,w,c);if(v===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let b=v;const p=v;if(["up","left"].indexOf(c)>-1&&!(p.length===1&&p[0].length===0))if(b=[],c==="up"){const _=d.row-h.row+1,O=_%p.length;for(let T=0;T<_;T++)b.push(p[(T+(p.length-O))%p.length])}else{const _=d.col-h.col+1,O=_%p[0].length;for(let T=0;T<p.length;T++){b.push([]);for(let M=0;M<_;M++)b[T].push(p[T][(M+(p[T].length-O))%p[T].length])}}this.hot.populateFromArray(h.row,h.col,b,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",b,g,w,c),this.hot.render()}else this.hot.view.render();return!0}reduceSelectionAreaIfNeeded(e){return e.row<0&&(e.row=0),e.col<0&&(e.col=0),e}getCoordsOfDragAndDropBorders(e){const r=this.hot.getSelectedRangeLast(),n=r.getBottomEndCorner();let i=e;if(this.directions.includes(Ml.vertical)&&this.directions.includes(Ml.horizontal)){const o=r.getTopStartCorner();(n.col<=e.col||o.col>=e.col)&&(i=this.hot._createCellCoords(n.row,e.col)),(n.row<e.row||o.row>e.row)&&(i=this.hot._createCellCoords(e.row,n.col))}else if(this.directions.includes(Ml.vertical))i=this.hot._createCellCoords(e.row,n.col);else if(this.directions.includes(Ml.horizontal))i=this.hot._createCellCoords(n.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const r=this.getCoordsOfDragAndDropBorders(e);r&&this.redrawBorders(r)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(mte,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},pte)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),r=this.hot.selection.highlight.getFill().getVisualCorners(),n=this.hot.countRows();e[2]<n-1&&r[2]===n-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const r=this.hot.getData(),n=this.hot.countRows();let i;for(let o=e[2]+1;o<n;o++){for(let l=e[1];l<=e[3];l++){const u=r[o][l];if(!Qt(u))return-1}const s=r[o][e[1]-1],a=r[o][e[3]+1];(!Qt(s)||!Qt(a))&&(i=o)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,r){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(r,e[3])).commit()}setSelection(e){this.hot.selectCell(...qe(e,r=>Math.max(r,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),r=this.getIndexOfLastAdjacentFilledInRow(e);return r===-1||r===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,r),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:r}=this.hot.rootDocument,n=jr(this.hot.table).top-(this.hot.rootWindow.pageYOffset||r.scrollTop)+fr(this.hot.table),i=jr(this.hot.table).left-(this.hot.rootWindow.pageXOffset||r.scrollLeft)+nr(this.hot.table);return e.clientY>n&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Rh(bu,this,bte).call(this)),this.eventManager.addEventListener(e,"mousemove",r=>Rh(bu,this,Ste).call(this,r))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=lte(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function vte(){this.selectAdjacent()&&this.fillIn()}function yte(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function Cte(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function bte(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function Ste(t){const e=this.getIfMouseWasDraggedOutside(t);this.addingStarted===!1&&this.handleDraggedCells>0&&e?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function Rte(t,e){xV(t,e),e.add(t)}function lN(t,e,r){xV(t,e),e.set(t,r)}function xV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Su(t,e,r){return(e=Ete(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ete(t){var e=Tte(t,"string");return typeof e=="symbol"?e:e+""}function Tte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AV(t,e,r){return t.set(vo(t,e),r),r}function yp(t,e){return t.get(vo(t,e))}function vo(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const nS="autoRowSize",_te=40,Mte="autoRowSize";var Ud=new WeakMap,dM=new WeakMap,rs=new WeakSet;class vd extends nt{static get PLUGIN_KEY(){return nS}static get PLUGIN_PRIORITY(){return _te}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),Rte(this,rs),Su(this,"headerHeight",null),Su(this,"ghostTable",new MV(this.hot)),Su(this,"samplesGenerator",new Lw((r,n)=>{const i=this.hot.toPhysicalRow(r),o=this.hot.toPhysicalColumn(n);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o)||r>=0&&n>=0&&this.hot.getCellMeta(r,n).hidden)return!1;let s;return r>=0?s=this.hot.getDataAtCell(r,n):r===-1&&(s=this.hot.getColHeader(n)),{value:s}})),Su(this,"inProgress",!1),Su(this,"measuredRows",0),Su(this,"rowHeightsMap",new Ta),lN(this,Ud,[]),lN(this,dM,!1),this.hot.rowIndexMapper.registerMap(Mte,this.rowHeightsMap),this.addHook("beforeRowResize",(r,n,i)=>vo(rs,this,uN).call(this,r,n,i))}isEnabled(){const e=this.hot.getSettings()[nS];return e===!0||Ve(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const r=this.getSetting("samplingRatio");r&&!isNaN(r)&&this.samplesGenerator.setSampleCount(parseInt(r,10)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return vo(rs,e,Ote).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return vo(rs,e,xte).call(e,...i)}),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return vo(rs,e,Hte).call(e,...i)}),this.addHook("beforeRender",()=>vo(rs,this,Ite).call(this)),this.addHook("modifyRowHeight",(n,i)=>this.getRowHeight(i,n)),this.addHook("init",()=>vo(rs,this,Ate).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,r,n)=>vo(rs,this,uN).call(this,e,r,n))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),r=this.getLastVisibleRow();if(e===-1||r===-1)return;const n=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:r},void 0,n)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof r=="number"?{from:r,to:r}:r;if(this.hot.getColHeader(0)!==null){const s=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(s.get(-1))}Ce(i.from,i.to,s=>{let a=this.hot.toPhysicalRow(s);a===null&&(a=s),(n||this.rowHeightsMap.getValueAtIndex(a)===null)&&this.samplesGenerator.generateRowSamples(s,o).forEach((u,c)=>this.ghostTable.addRow(c,u))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((s,a)=>{s<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(s),a)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=0;const i=this.hot.countRows()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){up(o),this.inProgress=!1;return}this.calculateRowsHeight({from:n,to:Math.min(n+vd.CALCULATION_STEP,i)},e,r),n=n+vd.CALCULATION_STEP+1,n<i?o=lp(s):(up(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateRowsHeight({from:0,to:a},e,r),n=a+1),n<i?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[nS];let r=vd.SYNC_CALCULATION_LIMIT;const n=this.hot.countRows()-1;return Ve(e)&&(r=e.syncLimit,a$(r)?r=V$(n,r):r>>=0),Math.min(r,n)}getRowHeight(e,r){const n=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=r;return n!==null&&n>(r||0)&&(i=n),i}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return(e=this.hot.getFirstRenderedVisibleRow())!==null&&e!==void 0?e:-1}getLastVisibleRow(){var e;return(e=this.hot.getLastRenderedVisibleRow())!==null&&e!==void 0?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(r=>{this.rowHeightsMap.setValueAtIndex(r,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:r,to:n}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{Ce(Math.min(r,n),Math.max(r,n),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function Pte(t){const e={from:0,to:this.hot.countCols()-1};t.forEach(r=>{this.samplesGenerator.generateRowSamples(r,e).forEach((i,o)=>this.ghostTable.addRow(o,i))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((r,n)=>{const i=this.hot.toPhysicalRow(r);this.rowHeightsMap.setValueAtIndex(i,n)})},!0),this.ghostTable.clean())}function Ite(){this.calculateVisibleRowsHeight(),this.inProgress||(vo(rs,this,Pte).call(this,yp(Ud,this)),AV(Ud,this,[]))}function uN(t,e,r){let n=t;return r&&(this.calculateRowsHeight(e,void 0,!0),n=this.getRowHeight(e)),n}function Ote(t,e){e||this.recalculateAllRowsHeight()}function xte(t){const e=t.reduce((r,n)=>{let[i]=n;return r.indexOf(i)===-1&&r.push(i),r},[]);yp(Ud,this).push(...e)}function Ate(){this.recalculateAllRowsHeight(),AV(dM,this,!0)}function Hte(t){if(!yp(dM,this))return;const e=t.reduce((r,n)=>{var i;const o=(i=n.address)===null||i===void 0?void 0:i.row;if(Number.isInteger(o)){const s=this.hot.toVisualRow(o);r.indexOf(s)===-1&&r.push(s)}return r},[]);yp(Ud,this).push(...e)}const{getListWithInsertedItems:Nte,getListWithRemovedItems:Dte}=gF("physicallyIndexed");class kte extends tu{constructor(){super(e=>e)}insert(e,r){const n=vT(this.indexedValues,r);this.indexedValues=Nte(n,e,r,this.initValueOrFn),super.insert(e,r)}remove(e){const r=Dte(this.indexedValues,e);this.indexedValues=wT(r,e),super.remove(e)}}const{getListWithInsertedItems:Lte,getListWithRemovedItems:$te}=gF("physicallyIndexed");class Fte extends tu{constructor(){super(e=>e)}insert(e,r){this.indexedValues=Lte(this.indexedValues,e,r,(n,i)=>this.getNextValue(i)),super.insert(e,r)}remove(e){this.indexedValues=$te(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function Vte(t,e){Wte(t,e),e.add(t)}function Wte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bte(t,e,r){return(e=jte(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jte(t){var e=Ute(t,"string");return typeof e=="symbol"?e:e+""}function Ute(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zte(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const cN="bindRowsWithHeaders",Yte=210,Gte="loose",hN=new Map([["loose",kte],["strict",Fte]]);var dN=new WeakSet;class qte extends nt{constructor(){super(...arguments),Vte(this,dN),Bte(this,"headerIndexes",null)}static get PLUGIN_KEY(){return cN}static get PLUGIN_PRIORITY(){return Yte}isEnabled(){return!!this.hot.getSettings()[cN]}enablePlugin(){var e;if(this.enabled)return;const r=(e=hN.get(this.getSetting()))!==null&&e!==void 0?e:hN.get(Gte);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new r),this.addHook("modifyRowHeader",n=>zte(dN,this,Kte).call(this,n)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function Kte(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function Xte(t,e){HV(t,e),e.add(t)}function Zte(t,e,r){HV(t,e),e.set(t,r)}function HV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fN(t,e,r){return(e=Jte(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jte(t){var e=Qte(t,"string");return typeof e=="symbol"?e:e+""}function Qte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gN(t,e){return t.get(tc(t,e))}function iS(t,e,r){return t.set(tc(t,e),r),r}function tc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const km="collapsibleColumns",ere=290,tre=["nestedHeaders"],cc="collapsibleIndicator",mN=km,pN=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Ru=new WeakMap,Eh=new WeakSet;class rre extends nt{constructor(){super(...arguments),Xte(this,Eh),fN(this,"nestedHeadersPlugin",null),fN(this,"headerStateManager",null),Zte(this,Ru,null)}static get PLUGIN_KEY(){return km}static get PLUGIN_PRIORITY(){return ere}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[km,...tre]}isEnabled(){return!!this.hot.getSettings()[km]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:r}=this.hot.getSettings();r||it("You need to configure the Nested Headers plugin in order to use collapsible headers."),iS(Ru,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>tc(Eh,this,ore).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tc(Eh,e,sre).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tc(Eh,e,nre).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(n,i,o)=>tc(Eh,this,ire).call(this,n,i,o)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();typeof e=="boolean"?this.headerStateManager.mapState(r=>({collapsible:r.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),iS(Ru,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:r,col:n}=this.hot.getSelectedRangeLast().highlight,{collapsible:i,isCollapsed:o,columnIndex:s}=(e=this.headerStateManager.getHeaderTreeNodeData(r,n))!==null&&e!==void 0?e:{};if(i)return o?this.expandSection({row:r,col:s}):this.collapseSection({row:r,col:s}),!1},runOnlyIf:()=>{var e,r;return((e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.isSingle())&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight.isHeader())},group:mN,relativeToGroup:_a,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(mN)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,r=this.hot.view._wt.wtTable.THEAD,n=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,o=function(s){s&&s.parentNode.removeChild(s)};Ce(0,e-1,s=>{const a=r.childNodes[s],l=n.childNodes[s],u=i?i.childNodes[s]:null;Ce(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${cc}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${cc}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${cc}`),o(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const r=this.headerStateManager.mapNodes(n=>{const{collapsible:i,origColspan:o,headerLevel:s,columnIndex:a,isCollapsed:l}=n;if(i===!0&&o>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(s),col:a}});this.toggleCollapsibleSection(r,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,r){if(!pN.has(r))throw new Error(`Unsupported action is passed (${r}).`);if(!Array.isArray(e))return;const n=Ll(e,f=>{let{row:g}=f;return g<0});let i=n.length>0;k(n,f=>{var g;let{row:w,col:v}=f;const{collapsible:b,isCollapsed:p}=(g=this.headerStateManager.getHeaderSettings(w,v))!==null&&g!==void 0?g:{};if(!b||p&&r==="collapse"||!p&&r==="expand")return i=!1,!1});const o=[],s=[];i&&k(n,f=>{let{row:g,col:w}=f;const{colspanCompensation:v,affectedColumns:b,rollbackModification:p}=this.headerStateManager.triggerNodeModification(r,g,w);v>0&&(s.push(...b),o.push(p))});const a=this.getCollapsedColumns();let l=[];r==="collapse"?l=LK([...a,...s]):r==="expand"&&(l=Ll(a,f=>!s.includes(f)));const u=pN.get(r);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){k(o,f=>{f()});return}this.hot.batchExecution(()=>{k(s,f=>{gN(Ru,this).setValueAtIndex(this.hot.toPhysicalColumn(f),u.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length,d=this.hot.getSelectedRangeLast();if(r==="collapse"&&h&&d){const{row:f,col:g}=d.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(g))&&s.includes(g)){const v=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,b=g>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(g,1,!0):g;v!==null&&b!==null&&this.hot.selectCell(v,b)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return gN(Ru,this).getHiddenIndexes()}destroy(){iS(Ru,this,null),super.destroy()}}function nre(t,e,r){var n;const{collapsible:i,origColspan:o,isCollapsed:s}=(n=this.headerStateManager.getHeaderSettings(r,t))!==null&&n!==void 0?n:{},a=i&&o>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let u=e.querySelector(`.${cc}`);if(Dc(e,[li("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),ie(u,cc),e.querySelector("div:first-child").appendChild(u)),Ee(u,["collapsed","expanded"]),s?(ie(u,"collapsed"),Fl(u,"+"),l&&Pe(e,...li(!1))):(ie(u,"expanded"),Fl(u,"-"),l&&Pe(e,...li(!0))),l&&Pe(u,...eu());else{var c;(c=u)===null||c===void 0||c.remove()}}function ire(t,e){_e(t.target,cc)&&(_e(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):_e(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),Yi(t))}function ore(){this.updatePlugin()}function sre(t,e){e||this.updatePlugin()}function qa(t,e,r){return(e=are(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function are(t){var e=lre(t,"string");return typeof e=="symbol"?e:e+""}function lre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ure=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],cre=!1,hre=!0,dre=!0;class fre{constructor(e,r){qa(this,"hot",void 0),qa(this,"sortingStates",new Pw),qa(this,"sortEmptyCells",cre),qa(this,"indicator",hre),qa(this,"headerAction",dre),qa(this,"compareFunctionFactory",void 0),qa(this,"mapName",void 0),this.hot=e,this.mapName=r,this.hot.columnIndexMapper.registerMap(r,this.sortingStates)}updateAllColumnsProperties(e){Ve(e)&&We(e,(r,n)=>{ure.includes(n)&&(this[n]=r)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return typeof this.compareFunctionFactory=="function"&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var r;return(r=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||r===void 0?void 0:r.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(r=>{let[n]=r;return n===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return Ve(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(r=>{let[n,i]=r;return{column:this.hot.toVisualColumn(n),...i}})}getColumnSortState(e){const r=this.getSortOrderOfColumn(e);if(pe(r))return{column:e,sortOrder:r}}setSortStates(e){this.sortingStates.clear();for(let r=0;r<e.length;r+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[r].column),{sortOrder:e[r].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function NV(t,e,r){const n=e.locale;return function(i,o){const{sortEmptyCells:s}=r;return typeof i=="string"&&(i=i.toLocaleLowerCase(n)),typeof o=="string"&&(o=o.toLocaleLowerCase(n)),i===o?_o:Qt(i)?Qt(o)?_o:s&&t==="asc"?zt:Yt:Qt(o)?s&&t==="asc"?Yt:zt:isNaN(i)&&!isNaN(o)?t==="asc"?Yt:zt:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?zt:Yt:i>o?t==="asc"?Yt:zt:_o}}const DV="default";function gre(t,e,r){return function(n,i){const o=parseFloat(n),s=parseFloat(i),{sortEmptyCells:a}=r;if(o===s||isNaN(o)&&isNaN(s))return _o;if(a){if(Qt(n))return t==="asc"?zt:Yt;if(Qt(i))return t==="asc"?Yt:zt}return isNaN(o)?Yt:isNaN(s)?zt:o<s?t==="asc"?zt:Yt:o>s?t==="asc"?Yt:zt:_o}}const mre="numeric";function pre(t,e,r){const n=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=r;return function(s,a){const l=Qt(s),u=Qt(a),c=l?i:s,h=u?i:a,d=c===i||c===n,f=h===i||h===n;if(o===!1){if(l&&u===!1)return Yt;if(l===!1&&u)return zt}return d===!1&&f?t==="asc"?zt:Yt:d&&f===!1?t==="asc"?Yt:zt:d===!1&&f===!1?NV(t,e,r)(s,a):c===i&&h===n?t==="asc"?zt:Yt:c===n&&h===i?t==="asc"?Yt:zt:_o}}const wre="checkbox";function vre(t,e,r){return WV(t,e.dateFormat,r)}const yre="date";function Cre(t,e,r){return WV(t,e.timeFormat,r)}const bre="time",{register:Rf,getItem:wN,hasItem:Sre}=Gi("sorting.compareFunctionFactory"),{register:kV,getItem:Rre}=Gi("sorting.mainSortComparator");function LV(t){return Sre(t)?wN(t):wN(DV)}Rf(wre,pre);Rf(yre,vre);Rf(DV,NV);Rf(mre,gre);Rf(bre,Cre);const _o=0,zt=-1,Yt=1;function Ere(t,e){const r=Rre(e);for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];t.sort(r(...i))}const Cp="asc",bp="desc",$V="colHeader";function Tre(t){if(Ve(t)===!1)return!1;const{column:e,sortOrder:r}=t;return Number.isInteger(e)&&[Cp,bp].includes(r)}function _re(t){if(t.some(r=>Tre(r)===!1))return!1;const e=t.map(r=>{let{column:n}=r;return n});return new Set(e).size===e.length}function vN(t){if(t!==bp)return t===Cp?bp:Cp}function FV(t){return t.querySelector(`.${$V}`)}function VV(t,e){if(t<0||!e.parentNode)return!1;const r=e.parentNode.parentNode.childNodes;return Array.from(r).indexOf(e.parentNode)-r.length===-1}function fM(t,e,r){return t===-1&&e>=0&&Vl(r)===!1}function WV(t,e,r){return function(n,i){const{sortEmptyCells:o}=r;if(n===i)return _o;if(Qt(n))return Qt(i)?_o:o&&t==="asc"?zt:Yt;if(Qt(i))return o&&t==="asc"?Yt:zt;const s=se(n,e),a=se(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?zt:Yt:a.isBefore(s)?t==="asc"?Yt:zt:_o:zt:Yt}}function Mre(t,e){it(lt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
|
|
735
|
+
Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const Pre="ascending",Ire="descending",BV="indicatorDisabled",jV="columnSorting",UV="sortAction",zV=new Map([[Cp,Pre],[bp,Ire]]);function Ore(t,e,r,n){const i=[jV];if(n&&i.push(UV),r===!1)return i.push(BV),i;const o=t.getSortOrderOfColumn(e);return pe(o)&&i.push(zV.get(o)),i}function xre(){return Array.from(zV.values()).concat(UV,BV,jV)}function Are(t,e){return function(r,n){const[,...i]=r,[,...o]=n;return function(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:LV(u.type))(l,u,d)(c,h)}(0)}}function Hre(t,e){Nre(t,e),e.add(t)}function Nre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Eg(t,e,r){return(e=Dre(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dre(t){var e=kre(t,"string");return typeof e=="symbol"?e:e+""}function kre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ku(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Sp="columnSorting",Lre=50,Rp="append",$re="replace",yN=Sp;kV(Sp,Are);fe.getSingleton().register("beforeColumnSort");fe.getSingleton().register("afterColumnSort");const Th=new WeakMap;var yl=new WeakSet;class YV extends nt{constructor(){super(...arguments),Hre(this,yl),Eg(this,"columnStatesManager",null),Eg(this,"columnMetaCache",null),Eg(this,"pluginKey",Sp),Eg(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return Sp}static get PLUGIN_PRIORITY(){return Lre}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(Th.has(this.hot)&&Th.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),Mre(Th.get(this.hot),this.pluginKey);return}this.enabled||(Th.set(this.hot,this.pluginKey),this.columnStatesManager=new fre(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Ta(r=>{let n=this.hot.toVisualColumn(r);return n===null&&(n=r),this.getMergedPluginSettings(n)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(r,n)=>Ku(yl,this,Fre).call(this,r,n)),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Ku(yl,e,Wre).call(e,...n)}),this.addHook("afterOnCellMouseDown",(r,n)=>this.onAfterOnCellMouseDown(r,n)),this.addHook("afterInit",()=>Ku(yl,this,gE).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Ku(yl,e,Vre).call(e,...n)}),this.hot.view&&Ku(yl,this,gE).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(r,n)=>{const i=FV(n);VV(r,n)===!1||i===null||this.updateHeaderClasses(i)};Th.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{this.indexesSequenceCache!==null&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)},!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.row===-1&&n.col>=0},relativeToGroup:_a,position:"before",group:yN})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(yN)}sort(e){const r=this.getSortConfig(),n=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(n);this.hot.runHooks("beforeColumnSort",r,n,i)!==!1&&(r.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new mF),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(n),this.sortByPresetSortStates(n),this.saveAllSortSettings(n)),this.hot.runHooks("afterColumnSort",r,i?n:r,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return pe(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const r=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(r)&&this.columnStatesManager.setSortStates(r)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const r=this.hot.countCols();return _re(e)&&e.every(n=>{let{column:i}=n;return i<=r&&i>=0})}saveAllSortSettings(e){const r=this.columnStatesManager.getAllColumnsProperties(),n=i=>{let{column:o,...s}=i;return{column:this.hot.toPhysicalColumn(o),...s}};r.initialConfig=qe(e,n),this.hot.runHooks("persistentStateSave","columnSorting",r)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const r=e.value,n=i=>{let{column:o,...s}=i;return{column:this.hot.toVisualColumn(o),...s}};return pe(r)&&Array.isArray(r.initialConfig)&&(r.initialConfig=qe(r.initialConfig,n)),r}getColumnNextConfig(e){const r=this.columnStatesManager.getSortOrderOfColumn(e);if(pe(r)){const i=vN(r);return pe(i)?{column:e,sortOrder:i}:void 0}const n=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<n)return{column:e,sortOrder:vN()}}getNextSortConfig(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rp;const n=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=n!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if($t(s))return[...o.slice(0,n),...o.slice(n+1)];if(r===Rp)return[...o.slice(0,n),...o.slice(n+1),s];if(r===$re)return[...o.slice(0,n),s,...o.slice(n+1)]}return pe(s)?o.concat(s):o}getPluginColumnConfig(e){if(Ve(e)){const r=e[this.pluginKey];if(Ve(r))return r}return{}}getMergedPluginSettings(e){const r=this.hot.getSettings()[this.pluginKey],n=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),o=Object.getPrototypeOf(i);return Array.isArray(o.columns)?Object.assign(n,r,this.getPluginColumnConfig(o.columns[e])):mt(o.columns)?Object.assign(n,r,this.getPluginColumnConfig(o.columns(e))):Object.assign(n,r)}getFirstCellSettings(e){const r=this.hot.getCellMeta(0,e),n=Object.create(r);return n[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),n}getNumberOfRowsToSort(e){const r=this.hot.getSettings();return r.maxRows<=e?r.maxRows:e-r.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const r=[],n=this.hot.countRows(),i=u=>qe(e,c=>this.hot.getDataAtCell(u,c.column));for(let u=0;u<this.getNumberOfRowsToSort(n);u+=1)r.push([this.hot.toPhysicalRow(u)].concat(i(u)));const o=qe(r,u=>u[0]);Ere(r,this.pluginKey,qe(e,u=>u.sortOrder),qe(e,u=>this.getFirstCellSettings(u.column)));for(let u=r.length;u<n;u+=1)r.push([u].concat(i(u)));const s=qe(r,u=>u[0]),a=new Map(qe(o,(u,c)=>[u,s[c]])),l=qe(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(Ve(e)){this.columnStatesManager.updateAllColumnsProperties(e);const r=e.initialConfig;(Array.isArray(r)||Ve(r))&&this.sort(r)}else this.hot.render()}updateHeaderClasses(e){if(Ee(e,xre()),this.enabled!==!1){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];ie(e,Ore(...n))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),pe(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,r){return this.getFirstCellSettings(r)[this.pluginKey].headerAction&&_e(e.target,$V)}onAfterOnCellMouseDown(e,r){if(fM(r.row,r.col,e)!==!1&&this.wasClickableHeaderClicked(e,r.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(r.col));const n=this.hot.getActiveEditor(),i=this.getColumnNextConfig(r.col);n!=null&&n.isOpened()&&this.hot.getCellValidator(n.row,n.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(i)}):this.sort(i)}}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function gE(){const t=this.getAllSavedSortSettings();if(Ve(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function Fre(t,e){const r=FV(e);if(VV(t,e)===!1||r===null)return;const n=this.getFirstCellSettings(t)[this.pluginKey],i=n.indicator,o=n.headerAction;if(this.updateHeaderClasses(r,this.columnStatesManager,t,i,o),this.hot.getSettings().ariaTags){const s=this.columnStatesManager.getSortOrderOfColumn(t);Pe(e,...i3(s?`${s}ending`:"none"))}}function Vre(t){t===!0&&this.hot.view&&Ku(yl,this,gE).call(this)}function Wre(t,e,r,n){fM(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(n.column=!0)}function Ka(t,e,r){return(e=Bre(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bre(t){var e=jre(t,"string");return typeof e=="symbol"?e:e+""}function jre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ure{constructor(e,r){Ka(this,"plugin",void 0),Ka(this,"hot",void 0),Ka(this,"endpoints",[]),Ka(this,"settings",void 0),Ka(this,"settingsType","array"),Ka(this,"currentEndpoint",null),Ka(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=r}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const r=[];let n=e;if(!n&&typeof this.settings=="function"){this.settingsType="function";return}return n||(n=this.settings),k(n,i=>{const o={};this.assignSetting(i,o,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,o,"reversedRowCoords",!1),this.assignSetting(i,o,"destinationRow",new Error(`
|
|
736
|
+
You must provide a destination row for the Column Summary plugin in order to work properly!
|
|
737
|
+
`)),this.assignSetting(i,o,"destinationColumn",new Error(`
|
|
738
|
+
You must provide a destination column for the Column Summary plugin in order to work properly!
|
|
739
|
+
`)),this.assignSetting(i,o,"sourceColumn",i.destinationColumn),this.assignSetting(i,o,"type","sum"),this.assignSetting(i,o,"forceNumeric",!1),this.assignSetting(i,o,"suppressDataTypeErrors",!0),this.assignSetting(i,o,"customFunction",null),this.assignSetting(i,o,"readOnly",!0),this.assignSetting(i,o,"roundFloat",!1),r.push(o)}),r}assignSetting(e,r,n,i){if(n==="ranges"&&e[n]===void 0){r[n]=i;return}else if(n==="ranges"&&e[n].length===0)return;if(e[n]===void 0){if(i instanceof Error)throw i;r[n]=i}else n==="destinationRow"&&r.reversedRowCoords?r[n]=this.hot.countRows()-e[n]-1:r[n]=e[n]}resetSetupBeforeStructureAlteration(e,r,n){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",o=this.getAllEndpoints();k(o,s=>{i==="row"&&s.destinationRow>=r&&(e==="insert_row"?s.alterRowOffset=n:e==="remove_row"&&(s.alterRowOffset=-1*n)),i==="col"&&s.destinationColumn>=r&&(e==="insert_col"?s.alterColumnOffset=n:e==="remove_col"&&(s.alterColumnOffset=-1*n))}),this.resetAllEndpoints(o,!1)}resetSetupAfterStructureAlteration(e,r,n,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(this.settingsType==="function"){const d=()=>(this.hot.removeHook("beforeViewRender",d),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",d);return}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,u=this.getAllEndpoints(),c=e.indexOf("move_row")===0,h=r;k(u,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*n),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*n)}),this.resetAllEndpoints(u,!c),c?k(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):k(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,r,n,i){k(e.ranges,o=>{o[1]&&(r>=o[0]&&r<=o[1]?n>o[1]?o[1]+=i:n<o[0]&&(o[0]-=i):n>=o[0]&&n<=o[1]&&(o[1]-=i,r<=o[0]&&(o[0]+=1,o[1]+=1)))})}recreatePhysicalRanges(e){const r=e.ranges,n=[],i=[];k(r,o=>{const s=[];if(o[1])for(let a=o[0];a<=o[1];a++)s.push(this.hot.toPhysicalRow(a));else s.push(this.hot.toPhysicalRow(o[0]));i.push(s)}),k(i,o=>{let s=[];k(o,(a,l)=>{l===0?s.push(a):o[l]!==o[l-1]+1&&(s.push(o[l-1]),n.push(s),s=[],s.push(a)),l===o.length-1&&(s.push(a),n.push(s))})}),e.ranges=n}shiftEndpointCoordinates(e,r){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,k(e.ranges,n=>{k(n,(i,o)=>{i>=r&&(n[o]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&e.alterColumnOffset!==0&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getAllEndpoints(),r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const o=i.alterRowOffset||0,s=i.alterColumnOffset||0;return i.destinationRow+o>=this.hot.countRows()||i.destinationColumn+s>=this.hot.countCols()})||(this.cellsToSetCache=[],k(e,i=>{this.resetEndpointValue(i,r)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],k(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const r=[];this.cellsToSetCache=[],k(e,(n,i,o)=>{`${n[2]||""}`!=`${n[3]}`&&k(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&r.indexOf(a)===-1&&r.push(a)})}),k(r,n=>{this.refreshEndpoint(this.getEndpoint(n))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const r=this.hot.toVisualRow(e.destinationRow);if(r!==null){const n=this.hot.getCellMeta(r,e.destinationColumn);n.readOnly=e.readOnly,n.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(r?n:0)),this.hot.toVisualColumn(e.destinationColumn+(r?i:0)),""])}setEndpointValue(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const o=this.hot.toVisualRow(e.destinationRow);if(o!==null){const s=this.hot.getCellMeta(o,e.destinationColumn);(r==="init"||s.readOnly!==e.readOnly)&&(s.readOnly=e.readOnly,s.className="columnSummaryResult")}if((e.roundFloat===!0||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const s=e.roundFloat;let a=0;Number.isInteger(s)&&(a=Math.min(Math.max(0,s),100)),e.result=e.result.toFixed(a)}n?this.hot.setDataAtCell(i,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([i,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){it("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function oS(t){return t==null||isNaN(t)}function zre(t,e){Yre(t,e),e.add(t)}function Yre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gre(t,e,r){return(e=qre(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qre(t){var e=Kre(t,"string");return typeof e=="symbol"?e:e+""}function Kre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tg(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const sS="columnSummary",Xre=220;var _h=new WeakSet;class Zre extends nt{constructor(){super(...arguments),zre(this,_h),Gre(this,"endpoints",null)}static get PLUGIN_KEY(){return sS}static get PLUGIN_PRIORITY(){return Xre}isEnabled(){return!!this.hot.getSettings()[sS]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[sS],this.endpoints=new Ure(this,this.settings),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Tg(_h,e,Jre).call(e,...n)}),this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Tg(_h,e,ene).call(e,...n)}),this.addHook("afterUpdateSettings",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Tg(_h,e,Qre).call(e,...n)}),this.addHook("beforeCreateRow",(r,n,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",r,n,null,i)),this.addHook("beforeCreateCol",(r,n,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",r,n,null,i)),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...n)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...n)}),this.addHook("afterCreateRow",(r,n,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",r,n,null,i)),this.addHook("afterCreateCol",(r,n,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",r,n,null,i)),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...n)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...n)}),this.addHook("afterRowMove",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Tg(_h,e,tne).call(e,...n)}),super.enablePlugin())}disablePlugin(){this.endpoints=null,this.settings=null,this.currentEndpoint=null,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.endpoints.initEndpoints(),super.updatePlugin()}calculate(e){switch(e.type.toLowerCase()){case"sum":e.result=this.calculateSum(e);break;case"min":e.result=this.calculateMinMax(e,e.type);break;case"max":e.result=this.calculateMinMax(e,e.type);break;case"count":e.result=this.countEntries(e);break;case"average":e.result=this.calculateAverage(e);break;case"custom":e.result=e.customFunction.call(this,e);break}}calculateSum(e){let r=0;return We(e.ranges,n=>{r+=this.getPartialSum(n,e.sourceColumn)}),r}getPartialSum(e,r){let n=0,i=e[1]||e[0],o=null,s=0;do{if(o=this.getCellValue(i,r),o=oS(o)?null:o,o!==null){const a=(`${o}`.split(".")[1]||[]).length||1;a>s&&(s=a)}n+=o||0,i-=1}while(i>=e[0]);return Math.round(n*10**s)/10**s}calculateMinMax(e,r){let n=null;return We(e.ranges,i=>{const o=this.getPartialMinMax(i,e.sourceColumn,r);if(n===null&&o!==null&&(n=o),o!==null)switch(r){case"min":n=Math.min(n,o);break;case"max":n=Math.max(n,o);break}}),n===null?"Not enough data":n}getPartialMinMax(e,r,n){let i=null,o=e[1]||e[0],s;do{if(s=this.getCellValue(o,r),s=oS(s)?null:s,i===null)i=s;else if(s!==null)switch(n){case"min":i=Math.min(i,s);break;case"max":i=Math.max(i,s);break}o-=1}while(o>=e[0]);return i}countEmpty(e,r){let n,i=0,o=e[1]||e[0];do n=this.getCellValue(o,r),n=oS(n)?null:n,n===null&&(i+=1),o-=1;while(o>=e[0]);return i}countEntries(e){let r=0;const n=e.ranges;return We(n,i=>{const o=i[1]===void 0?1:i[1]-i[0]+1,s=this.countEmpty(i,e.sourceColumn);r+=o,r-=s}),r}calculateAverage(e){const r=this.calculateSum(e),n=this.countEntries(e);return r/n}getCellValue(e,r){const n=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(r);let o=this.hot.getSourceDataAtCell(e,r),s="";if(n!==null&&i!==null&&(s=this.hot.getCellMeta(n,i).className||""),s.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof o=="string"&&(o=o.replace(/,/,".")),o=parseFloat(o)),isNaN(o)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(lt`ColumnSummary plugin: cell at (${e}, ${r}) is not in a\x20
|
|
740
|
+
numeric format. Cannot do the calculation.`);return o}}function Jre(){this.endpoints.initEndpoints()}function Qre(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function ene(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function tne(t,e){this.endpoints.resetSetupBeforeStructureAlteration("move_row",t[0],t.length,t,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",e,t.length,t,this.pluginName)}function rne(t,e){GV(t,e),e.add(t)}function aS(t,e,r){GV(t,e),e.set(t,r)}function GV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xu(t,e){return t.get(gM(t,e))}function mE(t,e,r){return t.set(gM(t,e),r),r}function gM(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ep=new WeakMap,_g=new WeakMap,Mg=new WeakMap,CN=new WeakSet;class qV{constructor(){rne(this,CN),aS(this,Ep,!0),aS(this,_g,null),aS(this,Mg,new ResizeObserver(e=>gM(CN,this,nne).call(this,e)))}setObservedElement(e){mE(_g,this,e)}unobserve(){Xu(Mg,this).unobserve(Xu(_g,this))}observe(){mE(Ep,this,!0),Xu(Mg,this).observe(Xu(_g,this))}destroy(){Xu(Mg,this).disconnect()}}function nne(t){if(Xu(Ep,this)||!Array.isArray(t)||!t.length){mE(Ep,this,!1);return}t.forEach(e=>{let{borderBoxSize:r}=e;const{inlineSize:n,blockSize:i}=r[0];this.runLocalHooks("resize",n,i)})}yt(qV,Hr);function Xa(t,e,r){ine(t,e),e.set(t,r)}function ine(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wt(t,e){return t.get(KV(t,e))}function Ko(t,e,r){return t.set(KV(t,e),r),r}function KV(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Za=new WeakMap,lS=new WeakMap,Xo=new WeakMap,Ls=new WeakMap,$s=new WeakMap,Pg=new WeakMap,Eu=new WeakMap;class Pl{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,r){var n=this;Xa(this,Za,void 0),Xa(this,lS,!1),Xa(this,Xo,null),Xa(this,Ls,void 0),Xa(this,$s,void 0),Xa(this,Pg,!0),Xa(this,Eu,new qV),Ko(Za,this,e),Ko(lS,this,r),Ko(Ls,this,this.createEditor()),Ko($s,this,wt(Ls,this).style),wt(Eu,this).setObservedElement(this.getInputElement()),wt(Eu,this).addLocalHook("resize",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("resize",...o)}),this.hide()}setPosition(e,r){wt($s,this).left=`${e}px`,wt($s,this).top=`${r}px`}setSize(e,r){if(e&&r){const n=this.getInputElement();n.style.width=`${e}px`,n.style.height=`${r}px`}}getSize(){return{width:nr(this.getInputElement()),height:fr(this.getInputElement())}}observeSize(){wt(Eu,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const r=this.getInputElement();r.readOnly=e}show(){wt($s,this).display="block",Ko(Pg,this,!1)}hide(){wt(Eu,this).unobserve(),wt(Pg,this)||(wt($s,this).display="none"),Ko(Pg,this,!0)}isVisible(){return wt($s,this).display==="block"}setValue(){const r=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=r}getValue(){return this.getInputElement().value}isFocused(){return wt(Za,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=wt(Za,this).createElement("div"),r=wt(Za,this).createElement("textarea");return e.style.display="none",Ko(Xo,this,wt(Za,this).createElement("div")),wt(Xo,this).setAttribute("dir",wt(lS,this)?"rtl":"ltr"),ie(wt(Xo,this),Pl.CLASS_EDITOR_CONTAINER),wt(Za,this).body.appendChild(wt(Xo,this)),ie(e,Pl.CLASS_EDITOR),ie(r,Pl.CLASS_INPUT),r.setAttribute("data-hot-input",!0),e.appendChild(r),wt(Xo,this).appendChild(e),e}getInputElement(){return wt(Ls,this).querySelector(`.${Pl.CLASS_INPUT}`)}getEditorElement(){return wt(Ls,this)}destroy(){const e=wt(Xo,this)?wt(Xo,this).parentNode:null;wt(Ls,this).parentNode.removeChild(wt(Ls,this)),Ko(Ls,this,null),Ko($s,this,null),wt(Eu,this).destroy(),e&&e.removeChild(wt(Xo,this))}}yt(Pl,Hr);function uS(t,e,r){return(e=one(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function one(t){var e=sne(t,"string");return typeof e=="symbol"?e:e+""}function sne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ane=250,lne=250;class XV{constructor(e){uS(this,"wasLastActionShow",!0),uS(this,"showDebounced",null),uS(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},lne)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ane;this.showDebounced=bw(r=>{this.wasLastActionShow&&this.runLocalHooks("show",r.from.row,r.from.col)},e)}destroy(){this.clearLocalHooks()}}yt(XV,Hr);function une(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function cne(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Ja(t,e){const r={};return k(t,n=>{n.forAll((i,o)=>{i>=0&&o>=0&&(r[i]||(r[i]=[]),r[i][o]=e(i,o))})}),r}function Zs(t,e,r,n,i){k(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&hne(s,a,e,r,n,i)})})}function hne(t,e,r,n,i,o){const s=i(t,e);let a=n;s.className&&(r==="vertical"?a=une(s.className,n):a=cne(s.className,n)),o(t,e,"className",a)}function ZV(t){return`<span class="selected">✓</span>${t}`}function Lm(t,e){let r=!1;return Array.isArray(t)&&k(t,n=>(n.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return r=!0,!1}),r)),r}function $w(t,e){const r={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:n}=e.defaultView,{top:i,left:o}=n.getBoundingClientRect();r.top=i,r.left=o}return r}const Fe="---------";function dne(){return{name:Fe}}const ti="alignment";function fne(){return{key:ti,name(){return this.getTranslatedPhrase(jT)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${ti}:left`,name(){return this.getTranslatedPhrase(UT)},callback(){const t=this.getSelectedRange(),e=Ja(t,(i,o)=>this.getCellMeta(i,o).className),r="horizontal",n="htLeft";this.runHooks("beforeCellAlignment",e,t,r,n),Zs(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:center`,name(){return this.getTranslatedPhrase(zT)},callback(){const t=this.getSelectedRange(),e=Ja(t,(i,o)=>this.getCellMeta(i,o).className),r="horizontal",n="htCenter";this.runHooks("beforeCellAlignment",e,t,r,n),Zs(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:right`,name(){return this.getTranslatedPhrase(YT)},callback(){const t=this.getSelectedRange(),e=Ja(t,(i,o)=>this.getCellMeta(i,o).className),r="horizontal",n="htRight";this.runHooks("beforeCellAlignment",e,t,r,n),Zs(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:justify`,name(){return this.getTranslatedPhrase(GT)},callback(){const t=this.getSelectedRange(),e=Ja(t,(i,o)=>this.getCellMeta(i,o).className),r="horizontal",n="htJustify";this.runHooks("beforeCellAlignment",e,t,r,n),Zs(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:Fe},{key:`${ti}:top`,name(){return this.getTranslatedPhrase(qT)},callback(){const t=this.getSelectedRange(),e=Ja(t,(i,o)=>this.getCellMeta(i,o).className),r="vertical",n="htTop";this.runHooks("beforeCellAlignment",e,t,r,n),Zs(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:middle`,name(){return this.getTranslatedPhrase(KT)},callback(){const t=this.getSelectedRange(),e=Ja(t,(i,o)=>this.getCellMeta(i,o).className),r="vertical",n="htMiddle";this.runHooks("beforeCellAlignment",e,t,r,n),Zs(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:bottom`,name(){return this.getTranslatedPhrase(XT)},callback(){const t=this.getSelectedRange(),e=Ja(t,(i,o)=>this.getCellMeta(i,o).className),r="vertical",n="htBottom";this.runHooks("beforeCellAlignment",e,t,r,n),Zs(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const Fw="clear_column";function gne(){return{key:Fw,name(){return this.getTranslatedPhrase(IT)},callback(t,e){const r=e[0].start.col,n=e[0].end.col;this.countRows()&&this.populateFromArray(0,r,[[null]],Math.max(e[0].start.row,e[0].end.row),n,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let e=!1;return t.forAll((r,n)=>{if(r<0||n<0)return!0;const{readOnly:i}=this.getCellMeta(r,n);return i?!0:(e=!0,!1)}),!e}}}const Ef="col_left";function mne(){return{key:Ef,name(){return this.getTranslatedPhrase(RT)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner(),e=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(e,t.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols?!0:this.selection.isSelectedByCorner()?this.countCols()===0:!1},hidden(){return!this.getSettings().allowInsertColumn}}}const Tf="col_right";function pne(){return{key:Tf,name(){return this.getTranslatedPhrase(ET)},callback(){const t=this.getSelectedRangeLast().getTopRightCorner(),e=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(e,t.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}}const _f="make_read_only";function wne(){return{key:_f,checkable:!0,ariaChecked(){return Lm(this.getSelectedRange(),(e,r)=>this.getCellMeta(e,r).readOnly)},ariaLabel(){return this.getTranslatedPhrase(dp)},name(){let t=this.getTranslatedPhrase(dp);return Lm(this.getSelectedRange(),(r,n)=>this.getCellMeta(r,n).readOnly)&&(t=ZV(t)),t},callback(){const t=this.getSelectedRange(),e=Lm(t,(r,n)=>this.getCellMeta(r,n).readOnly);k(t,r=>{r.forAll((n,i)=>{n>=0&&i>=0&&this.setCellMeta(n,i,"readOnly",!e)})}),this.render()},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const Vw="redo";function vne(){return{key:Vw,name(){return this.getTranslatedPhrase(PT)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Mf="remove_col";function yne(){return{key:Mf,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,r,,n]=t[0];r-n!==0&&(e=1)}return this.getTranslatedPhrase(_T,e)},callback(){this.alter("remove_col",a8(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0)return!0;const e=this.countCols();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByRowHeader()||e===0},hidden(){return!this.getSettings().allowRemoveColumn}}}const Ww="remove_row";function Cne(){return{key:Ww,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[r,,n]=t[0];r-n!==0&&(e=1)}return this.getTranslatedPhrase(TT,e)},callback(){this.alter("remove_row",l8(this),1,"ContextMenu.removeRow")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.row<0)return!0;const e=this.countRows();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByColumnHeader()||e===0},hidden(){return!this.getSettings().allowRemoveRow}}}const Bw="row_above";function bne(){return{key:Bw,name(){return this.getTranslatedPhrase(bT)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows?!0:this.selection.isSelectedByCorner()?this.countRows()===0:!1},hidden(){return!this.getSettings().allowInsertRow}}}const jw="row_below";function Sne(){return{key:jw,name(){return this.getTranslatedPhrase(ST)},callback(){const t=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}}const zd="no_items";function Rne(){return{key:zd,name(){return this.getTranslatedPhrase(CT)},disabled:!0,isCommand:!1}}const Uw="undo";function Ene(){return{key:Uw,name(){return this.getTranslatedPhrase(MT)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const Tne=[Bw,jw,Ef,Tf,Fw,Ww,Mf,Uw,Vw,_f,ti,Fe,zd],_ne={[Fe]:dne,[zd]:Rne,[Bw]:bne,[jw]:Sne,[Ef]:mne,[Tf]:pne,[Fw]:gne,[Ww]:Cne,[Mf]:yne,[Uw]:Ene,[Vw]:vne,[_f]:wne,[ti]:fne};function JV(){const t={};return We(_ne,(e,r)=>{t[r]=e()}),t}function Mne(t){return{key:"commentsAddEdit",name(){var e;const r=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r!=null&&r.isCell()&&t.getCommentAtCell(r.row,r.col)?this.getTranslatedPhrase(VT):this.getTranslatedPhrase(FT)},callback(){const e=this.getSelectedRangeLast();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function Pne(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(WT)},callback(){this.getSelectedRangeLast().forAll((r,n)=>{r>=0&&n>=0&&t.removeCommentAtCell(r,n,!1)}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function Ine(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(BT);return Lm(this.getSelectedRange(),(n,i)=>t.getCommentMeta(n,i,$m))?ZV(e):e},callback(){this.getSelectedRangeLast().forAll((r,n)=>{if(r>=0&&n>=0){const i=!!t.getCommentMeta(r,n,$m);t.updateCommentMeta(r,n,{[$m]:!i})}})},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||!t.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function One(t,e){QV(t,e),e.add(t)}function Tu(t,e,r){QV(t,e),e.set(t,r)}function QV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xne(t,e,r){return(e=Ane(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ane(t){var e=Hne(t,"string");return typeof e=="symbol"?e:e+""}function Hne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ca(t,e,r){return t.set(mn(t,e),r),r}function De(t,e){return t.get(mn(t,e))}function mn(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Tp="comments",Nne=60,ls="comment",od="value",eW="style",$m="readOnly",Mh=Tp,pE=`plugin:${Tp}`;var gt=new WeakMap,mo=new WeakMap,zw=new WeakMap,Fm=new WeakMap,wE=new WeakMap,_p=new WeakMap,In=new WeakSet;class Dne extends nt{constructor(){super(...arguments),One(this,In),xne(this,"range",{}),Tu(this,gt,null),Tu(this,mo,null),Tu(this,zw,!1),Tu(this,Fm,!1),Tu(this,wE,null),Tu(this,_p,"")}static get PLUGIN_KEY(){return Tp}static get PLUGIN_PRIORITY(){return Nne}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[Tp]}enablePlugin(){var e=this;this.enabled||(De(gt,this)||(ca(gt,this,new Pl(this.hot.rootDocument,this.hot.isRtl())),De(gt,this).addLocalHook("resize",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mn(In,e,jne).call(e,...n)})),De(mo,this)||ca(mo,this,new XV(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",r=>this.addToContextMenu(r)),this.addHook("afterRenderer",(r,n,i,o,s,a)=>mn(In,this,Vne).call(this,r,a)),this.addHook("afterScroll",()=>mn(In,this,Une).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",r=>mn(In,this,bN).call(this,r)),this.addHook("beforeCompositionStart",r=>mn(In,this,bN).call(this,r)),this.addHook("afterSetTheme",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mn(In,e,zne).call(e,...n)}),De(mo,this).addLocalHook("hide",()=>this.hide()),De(mo,this).addLocalHook("show",(r,n)=>this.showAtCell(r,n)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){De(mo,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),r=e.getContext("grid"),n=e.addContext(pE);r.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();ca(Fm,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(pE),this.hot._registerTimeout(()=>{ca(Fm,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:Mh}),n.addShortcut({keys:[["Escape"]],callback:()=>{De(gt,this).setValue(De(_p,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>De(gt,this).isVisible()&&De(gt,this).isFocused(),group:Mh}),n.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>De(gt,this).isVisible()&&De(gt,this).isFocused(),group:Mh}),n.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{De(gt,this).setValue(De(gt,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:Mh})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Mh)}registerListeners(){const{rootDocument:e}=this.hot,r=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",n=>mn(In,this,$ne).call(this,n)),this.eventManager.addEventListener(e,"mousedown",n=>mn(In,this,kne).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>mn(In,this,Fne).call(this)),this.eventManager.addEventListener(r,"focus",()=>mn(In,this,Bne).call(this)),this.eventManager.addEventListener(r,"blur",()=>mn(In,this,Wne).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",n=>mn(In,this,Lne).call(this,n))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const r=$l(e.target,"TD","TBODY");return!!(r&&_e(r,"htCommentCell")&&$l(r,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const r=De(gt,this).getValue();let n="";e!=null?n=e:r!=null&&(n=r);const i=this.range.from.row,o=this.range.from.col;this.updateCommentMeta(i,o,{[od]:n}),this.hot.render()}setCommentAtCell(e,r,n){this.setRange({from:this.hot._createCellCoords(e,r)}),this.setComment(n)}removeComment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,ls),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,r)}),this.removeComment(n)}getComment(){const e=this.range.from.row,r=this.range.from.col;return this.getCommentMeta(e,r,od)}getCommentAtCell(e,r){return this.getCommentMeta(e,r,od)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:r,col:n}}=this.range;if(r<0||r>this.hot.countSourceRows()-1||n<0||n>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return De(mo,this).cancelHiding(),De(gt,this).setValue((e=i[ls]?i[ls][od]:null)!==null&&e!==void 0?e:""),De(gt,this).show(),this.refreshEditor(!0),!0}showAtCell(e,r){return this.setRange({from:this.hot._createCellCoords(e,r)}),this.show()}hide(){De(gt,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!De(gt,this).isVisible()))return;const{rowIndexMapper:r,columnIndexMapper:n}=this.hot,{row:i,col:o}=this.range.from;let s=r.getRenderableFromVisualIndex(i),a=n.getRenderableFromVisualIndex(o);const l=s===null;De(gt,this).setPosition(0,0),s===null&&(s=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(i,-1))),a===null&&(a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o,-1)));const u=s===null,c=a===null;s=s??0,a=a??0;const{rootWindow:h,view:{_wt:d}}=this.hot,{wtTable:f}=d,g=d.getCell({row:s,col:a},!0),w=this.getCommentMeta(i,o,eW);w?De(gt,this).setSize(w.width,w.height):De(gt,this).resetSize();const v=c?0:f.getColumnWidth(a),b=l&&!u?fr(g):0,{left:p,top:_,width:O,height:T}=g.getBoundingClientRect(),{width:M,height:P}=De(gt,this).getSize(),{innerWidth:G,innerHeight:j}=this.hot.rootWindow,A=this.hot.rootDocument.documentElement,q=Or(this.hot.rootDocument),Q=S$(this.hot.rootWindow)?q:0,ue=R$(this.hot.rootWindow)?q:0;let J=p+h.scrollX+v,Z=_+h.scrollY+b;this.hot.isRtl()&&(J-=M+v),this.hot.isLtr()&&p+O+M>G-Q?J=p+h.scrollX-M-1:this.hot.isRtl()&&J<-(A.scrollWidth-A.clientWidth)&&(J=p+h.scrollX+v+1),_+P>j-ue&&(Z-=P-T+1),De(gt,this).setPosition(J,Z),De(gt,this).setReadOnlyState(this.getCommentMeta(i,o,$m)),De(gt,this).observeSize()}focusEditor(){De(gt,this).focus()}updateCommentMeta(e,r,n){const i=this.hot.getCellMeta(e,r)[ls];let o;i?(o=on(i),Sw(o,n)):o=n,this.hot.setCellMeta(e,r,ls,o)}getCommentMeta(e,r,n){const i=this.hot.getCellMeta(e,r);if(i[ls])return i[ls][n]}addToContextMenu(e){e.items.push({name:Fe},Mne(this),Pne(this),Ine(this))}getEditorInputElement(){return De(gt,this).getInputElement()}destroy(){var e,r;(e=De(gt,this))===null||e===void 0||e.destroy(),(r=De(mo,this))===null||r===void 0||r.destroy(),super.destroy()}}function kne(t){if(!(!this.hot.view||!this.hot.view._wt)&&!De(zw,this)&&!this.targetIsCommentTextArea(t)){const e=$l(t.target,"TD","TBODY");let r=null;e&&(r=this.hot.getCoords(e)),(!e||this.range.from&&r&&(this.range.from.row!==r.row||this.range.from.col!==r.col))&&this.hide()}}function Lne(t){t.stopPropagation()}function $ne(t){const{rootDocument:e}=this.hot;if(!(De(zw,this)||De(gt,this).isFocused()||_e(t.target,"wtBorder")||De(wE,this)===t.target||!De(gt,this)))if(ca(wE,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const r=this.hot._createCellRange(this.hot.getCoords(t.target));De(mo,this).show(r)}else Nl(t.target,e)&&!this.targetIsCommentTextArea(t)&&De(mo,this).hide()}function Fne(){ca(zw,this,!1)}function Vne(t,e){e[ls]&&e[ls][od]&&ie(t,e.commentedCellClassName)}function Wne(){ca(_p,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function Bne(){ca(_p,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(pE)}function jne(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[eW]:{width:t,height:e}})}function bN(t){De(gt,this).isFocused()&&Yi(t)}function Une(){De(Fm,this)||this.hide()}function zne(){const t=De(gt,this).getEditorElement();Ee(t,/ht-theme-.*/g),ie(t,this.hot.getCurrentThemeName())}function cS(t,e,r){return(e=Yne(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yne(t){var e=Gne(t,"string");return typeof e=="symbol"?e:e+""}function Gne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tW{constructor(e){cS(this,"hot",void 0),cS(this,"commands",{}),cS(this,"commonCallback",null),this.hot=e}registerCommand(e,r){this.commands[e]=r}setCommonCallback(e){this.commonCallback=e}execute(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];const o=e.split(":"),s=o[0],a=o.length===2?o[1]:null;let l=this.commands[s];if(!l)throw new Error(`Menu command '${s}' not exists.`);if(a&&l.submenu&&(l=qne(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||dr(l,"submenu"))return;const u=[];typeof l.callback=="function"&&u.push(l.callback),typeof this.commonCallback=="function"&&u.push(this.commonCallback),n.unshift(o.join(":")),k(u,c=>c.apply(this.hot,n))}}function qne(t,e){let r;return k(e,n=>{const i=n.key?n.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return r=n,!1}),r}function hS(t,e,r){return(e=Kne(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kne(t){var e=Xne(t,"string");return typeof e=="symbol"?e:e+""}function Xne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rW{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;hS(this,"hot",void 0),hS(this,"predefinedItems",JV()),hS(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=r}setPredefinedItems(e){const r={};this.defaultOrderPattern.length=0,We(e,(n,i)=>{let o="";n.name===Fe?(r[Fe]=n,o=Fe):isNaN(parseInt(i,10))?(n.key=n.key===void 0?i:n.key,r[i]=n,o=n.key):(r[n.key]=n,o=n.key),this.defaultOrderPattern.push(o)}),this.predefinedItems=r}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return Zne(e,this.defaultOrderPattern,this.predefinedItems)}}function Zne(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),Ve(i)?We(i,(o,s)=>{let a=r[typeof o=="string"?o:s];a||(a=o),Ve(o)?gr(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),n.push(a)}):k(i,(o,s)=>{let a=r[o];!a&&Tne.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),Ve(o)&&gr(a,o),a.key===void 0&&(a.key=s),n.push(a))}),n}function Fs(t,e,r){return(e=Jne(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jne(t){var e=Qne(t,"string");return typeof e=="symbol"?e:e+""}function Qne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class eie{constructor(e,r){Fs(this,"top",void 0),Fs(this,"topRelative",void 0),Fs(this,"left",void 0),Fs(this,"leftRelative",void 0),Fs(this,"scrollTop",void 0),Fs(this,"scrollLeft",void 0),Fs(this,"cellHeight",void 0),Fs(this,"cellWidth",void 0);const n=r.scrollY,i=r.scrollX;let o,s,a,l,u,c;this.rootWindow=r,this.type=this.getSourceType(e),this.type==="literal"?(o=parseInt(e.top,10),a=parseInt(e.left,10),u=e.height||0,c=e.width||0,s=o,l=a,o+=n,a+=i):this.type==="event"&&(o=parseInt(e.pageY,10),a=parseInt(e.pageX,10),u=e.target.clientHeight,c=e.target.clientWidth,s=o-n,l=a-i),this.top=o,this.topRelative=s,this.left=a,this.leftRelative=l,this.scrollTop=n,this.scrollLeft=i,this.cellHeight=u,this.cellWidth=c}getSourceType(e){let r="literal";return e instanceof Event&&(r="event"),r}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=r}fitsOnRight(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=r}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function Ph(t,e,r){tie(t,e),e.set(t,r)}function tie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ne(t,e){return t.get(nW(t,e))}function Ig(t,e,r){return t.set(nW(t,e),r),r}function nW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var qr=new WeakMap,hn=new WeakMap,dn=new WeakMap,dS=new WeakMap,_u=new WeakMap;class rie{constructor(e){Ph(this,qr,void 0),Ph(this,hn,void 0),Ph(this,dn,void 0),Ph(this,dS,!1),Ph(this,_u,{above:0,below:0,left:0,right:0}),Ig(dS,this,e)}setOffset(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Ne(_u,this)[e]=r,this}setElement(e){return Ig(qr,this,e),this}setParentElement(e){return Ig(hn,this,e),this}updatePosition(e){Ig(dn,this,new eie(e,Ne(qr,this).ownerDocument.defaultView)),Ne(dS,this)?(Ne(dn,this).fitsBelow(Ne(qr,this))?this.setPositionBelowCursor():Ne(dn,this).fitsAbove(Ne(qr,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Ne(qr,this).dir==="rtl"?Ne(dn,this).fitsOnLeft(Ne(qr,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Ne(dn,this).fitsOnRight(Ne(qr,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Ne(_u,this).above+Ne(dn,this).top-Ne(qr,this).offsetHeight;if(Ne(hn,this)){const n=Ne(hn,this).ownerDocument.defaultView.getComputedStyle(Ne(hn,this).querySelector(".ht_master")),i=Number.parseInt(n.paddingTop,10),o=Number.parseInt(n.borderTop,10);e=Ne(dn,this).top+Ne(dn,this).cellHeight-Ne(qr,this).scrollHeight+i+o}Ne(qr,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Ne(_u,this).below+Ne(dn,this).top+1;if(Ne(hn,this)){const n=Ne(hn,this).ownerDocument.defaultView.getComputedStyle(Ne(hn,this).querySelector(".ht_master")),i=Number.parseInt(n.paddingTop,10),o=Number.parseInt(n.borderTop,10);e=Ne(dn,this).top-i-o-1}Ne(qr,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Ne(dn,this).left;if(Ne(hn,this)){const r=Ne(hn,this).ownerDocument.defaultView,n=Number.parseInt(r.getComputedStyle(Ne(hn,this).querySelector(".htCore")).borderRightWidth,10);e+=Ne(dn,this).cellWidth+n}else e+=Ne(_u,this).right;Ne(qr,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Ne(_u,this).left+Ne(dn,this).left-Ne(qr,this).offsetWidth;if(Ne(hn,this)){const r=Ne(hn,this).ownerDocument.defaultView,n=Number.parseInt(r.getComputedStyle(Ne(hn,this).querySelector(".htCore")).borderLeftWidth,10);e-=n}Ne(qr,this).style.left=`${e}px`}}function iW(t){let{initialPage:e=-1,size:r=()=>0,onItemSelect:n=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=Xe(e,-1,g()-1);function a(v,b){const p=g()-1;return v<0&&(v=p),v>p&&(v=0),o.has(v)?-1:(o.add(v),n(v,!1)===!1&&(v=a(b===1?++v:--v,b)),v)}function l(v){v>-1&&v<g()&&n(v,!0)!==!1&&(s=v)}function u(){return s}function c(){g()>0&&(o.clear(),s=a(0,1))}function h(){g()>0&&(o.clear(),s=a(g()-1,-1))}function d(){g()>0&&(o.clear(),s=a(++s,1))}function f(){g()>0&&(o.clear(),s=a(--s,-1))}function g(){return Math.max(r(),0)}function w(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:g,clear:w}}function nie(t){return qe(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function vE(t){return dr(t,"submenu")}function yE(t){return new RegExp(Fe,"i").test(t.name)}function Vm(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function SN(t){return dr(t,"disableSelection")}function iie(t){return _e(t,"htSeparator")}function oie(t){return _e(t,"htSubmenu")}function sie(t){return _e(t,"htDisabled")}function aie(t){return _e(t,"htSelectionDisabled")}function lie(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function oW(t,e){const r=t.slice(0);for(let n=0;n<r.length&&r[n].name===e;)r.shift();return r}function uie(t,e){let r=t.slice(0);return r.reverse(),r=oW(r,e),r.reverse(),r}function cie(t){const e=[];return k(t,(r,n)=>{n>0?e[e.length-1].name!==r.name&&e.push(r):e.push(r)}),e}function hie(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fe,r=t.slice(0);return r=oW(r,e),r=uie(r,e),r=cie(r),r}function die(t){return t.checkable===!0}function fie(t){return iW({size:()=>t.countRows(),onItemSelect(e,r){const n=t.getCell(e,0);if(!n||iie(n)||sie(n)||aie(n))return!1;t.selectCell(e,0,...r?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function gie(t){const{hot:e,hotMenu:r}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(n,i)=>{const o=e.getSettings(),s=typeof o.tabMoves=="function"?o.tabMoves(n):o.tabMoves;i.includes("shift")?e.selection.transformStart(-s.row,-s.col):e.selection.transformStart(s.row,s.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const n=r.getSelectedLast();if(n){const i=t.openSubMenu(n[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{r.getSelectedLast()&&t.isSubMenu()&&(t.close(),t.isSubMenu()&&t.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>t.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>t.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:n=>{const i=r.getSelectedLast();i&&(r.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(n),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{r.getSelectedLast()?r.selection.transformStart(-r.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{r.getSelectedLast()?r.selection.transformStart(r.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const sW="menu",RN=sW;function mie(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];n(gie(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function n(u,c){a(c).addShortcuts(u,{group:sW})}function i(u,c){const h=a(c);u.forEach(d=>{let{keys:f}=d;f.forEach(g=>h.removeShortcutsByKeys(g))}),r.push({shortcuts:u,contextName:c}),n(u,c)}function o(){return[...r]}function s(u){return u?`${RN}:${u}`:RN}function a(u){var c;const h=t.hotMenu.getShortcutManager(),d=s(u);return(c=h.getContext(d))!==null&&c!==void 0?c:h.addContext(d)}function l(u){t.hotMenu.getShortcutManager().setActiveContextName(s(u))}return{addCustomShortcuts:i,getCustomShortcuts:o,getContext:a,listen:l}}function pie(t){return(e,r,n,i,o,s)=>{const a=e.getSourceDataAtRow(n),l=t.rootDocument.createElement("div"),u=typeof s=="function"?s.call(t):s,c=typeof a.ariaLabel=="function"?a.ariaLabel.call(t):a.ariaLabel,h=typeof a.ariaChecked=="function"?a.ariaChecked.call(t):a.ariaChecked;if(Ts(r),ie(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!Vm(a,t)&&!SN(a)&&!yE(a);Pe(r,[...die(a)?[KK(),Ld(c),g$(h)]:[qK(),Ld(u)],...d?[Ql(-1)]:[],...Vm(a,t)?[r3()]:[],...vE(a)?[li(!1)]:[]])}r.className="",r.appendChild(l),yE(a)?ie(r,"htSeparator"):typeof a.renderer=="function"?(ie(r,"htCustomMenuRenderer"),r.appendChild(a.renderer(e,l,n,i,o,u))):kc(l,u),Vm(a,t)?ie(r,"htDisabled"):SN(a)?ie(r,"htSelectionDisabled"):vE(a)&&ie(r,"htSubmenu")}}function fS(t,e,r){wie(t,e),e.set(t,r)}function wie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function to(t,e,r){return(e=vie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vie(t){var e=yie(t,"string");return typeof e=="symbol"?e:e+""}function yie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gS(t,e,r){return t.set(aW(t,e),r),r}function Qa(t,e){return t.get(aW(t,e))}function aW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const EN=215;var Ih=new WeakMap,Og=new WeakMap,xg=new WeakMap;class Wc{get tableBorderWidth(){return Qa(xg,this)===void 0&&this.hotMenu&&gS(xg,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),Qa(xg,this)}constructor(e,r){var n=this;to(this,"hot",void 0),to(this,"options",void 0),to(this,"eventManager",new ji(this)),to(this,"container",void 0),to(this,"positioner",void 0),to(this,"hotMenu",null),to(this,"hotSubMenus",{}),to(this,"parentMenu",void 0),to(this,"menuItems",null),to(this,"origOutsideClickDeselects",null),fS(this,Ih,void 0),fS(this,Og,void 0),fS(this,xg,void 0),this.hot=e,this.options=r||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:EN,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new rie(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.parentMenu.runLocalHooks("afterSelectionChange",...o)}),this.hot.addHook("afterSetTheme",(i,o)=>{if(!o){var s;(s=this.hotMenu)===null||s===void 0||s.useTheme(i)}})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",r=>this.onDocumentMouseDown(r)),this.eventManager.addEventListener(e.document,"touchstart",r=>this.onDocumentMouseDown(r)),this.eventManager.addEventListener(e.document,"contextmenu",r=>this.onDocumentContextMenu(r)),e=vc(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Qa(Ih,this)}getKeyboardShortcutsCtrl(){return Qa(Og,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=bw(a=>this.openSubMenu(a),300),r=this.options.minWidth||EN;let n=!1,i=Ll(this.menuItems,a=>(a.key===zd&&(n=!0),lie(a,this.hot)));if(i.length<1&&!n)i.push(JV()[zd]);else if(i.length===0)return;i=hie(i,Fe);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return pe(a)&&a<r?r:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:pie(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(a,l)=>{Qa(Ih,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),H1()&&o&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,u,c,h)=>{this.hotMenu.view.isMouseDown()&&(h.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(o=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!H1()||!Vl(a))&&o&&this.hasSelectedItem()&&(ps()||A$()?this.hot._registerTimeout(()=>this.close(!0),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,s),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),gS(Ih,this,fie(this.hotMenu)),gS(Og,this,mie(this)),Qa(Og,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(Qa(Ih,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const r=this.parentMenu.hotMenu.getSelectedLast();if(r){const n=this.parentMenu.hotMenu.getCell(r[0],0);Pe(n,[li(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const r=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!r||!oie(r))return!1;const n=this.hotMenu.getSourceDataAtRow(e),i=new Wc(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(n.submenu.items),i.open(),i.setPosition(r.getBoundingClientRect()),this.hotSubMenus[n.key]=i,this.hot.getSettings().ariaTags&&Pe(r,[li(!0)]),i}closeSubMenu(e){const r=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[r.key];if(n){n.destroy(),delete this.hotSubMenus[r.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&Pe(i,[li(!1)])}}closeAllSubMenus(){k(this.hotMenu.getData(),(e,r)=>this.closeSubMenu(r))}isAllSubMenusClosed(){return Object.keys(this.hotSubMenus).length===0}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return this.hotMenu!==null}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const r=this.getSelectedItem();if(this.runLocalHooks("select",r,e),this.isCommandPassive(r))return;const n=this.hot.getSelectedRange(),i=n?nie(n):[];this.runLocalHooks("executeCommand",r.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",r.key,i,e)}isCommandPassive(e){return e.isCommand===!1||yE(e)||Vm(e,this.hot)||vE(e)}setOffset(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,r)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const e=this.hotMenu.view.getStylesHandler(),{wtTable:r}=this.hotMenu.view._wt,n=this.hotMenu.getSettings().data,i=r.hider.style,o=r.holder.style,s=parseInt(i.width,10),a=Mn(n,(l,u,c)=>{const d=this.hotMenu.getCell(c,0)?fr(this.hotMenu.getCell(c,0)):0;return l+(u.name===Fe?1:d)},0);e.isClassicTheme()?(o.width=`${s+3}px`,o.height=`${a+3}px`):(o.width=`${s}px`,o.height=`${a}px`),i.height=o.height}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const r=this.options.container.ownerDocument;let n=e,i;return n&&(mt(n)&&(n=n.call(this.hot),n===null||$t(n)?n="":n=n.toString()),n=n.replace(/[^A-Za-z0-9]/g,"_"),n=`${this.options.className}Sub_${n}`,i=r.querySelector(`.${this.options.className}.${n}`)),i||(i=r.createElement("div"),ie(i,`htMenu handsontable ${this.options.className}`),n&&ie(i,n),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&Pe(this.hotMenu.rootElement,[GK(),Ql(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!Nl(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!Nl(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&_e(e.target,"htCore")&&Nl(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}yt(Wc,Hr);function Cie(t,e){bie(t,e),e.add(t)}function bie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mS(t,e,r){return(e=Sie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sie(t){var e=Rie(t,"string");return typeof e=="symbol"?e:e+""}function Rie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ag(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const sd="contextMenu",Eie=70,TN=sd;fe.getSingleton().register("afterContextMenuDefaultOptions");fe.getSingleton().register("beforeContextMenuShow");fe.getSingleton().register("afterContextMenuShow");fe.getSingleton().register("afterContextMenuHide");fe.getSingleton().register("afterContextMenuExecute");var Oh=new WeakSet;class Yw extends nt{constructor(){super(...arguments),Cie(this,Oh),mS(this,"commandExecutor",new tW(this.hot)),mS(this,"itemsFactory",null),mS(this,"menu",null)}static get PLUGIN_KEY(){return sd}static get PLUGIN_PRIORITY(){return Eie}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Bw,jw,Fe,Ef,Tf,Fe,Ww,Mf,Fe,Uw,Vw,Fe,_f,Fe,ti]}isEnabled(){return!!this.hot.getSettings()[sd]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[sd];typeof r.callback=="function"&&this.commandExecutor.setCommonCallback(r.callback),this.menu=new Wc(this.hot,{className:"htContextMenu",keepInViewport:!0,container:r.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Ag(Oh,this,_ie).call(this)),this.menu.addLocalHook("afterOpen",()=>Ag(Oh,this,Mie).call(this)),this.menu.addLocalHook("afterClose",()=>Ag(Oh,this,Pie).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",n=>Ag(Oh,this,Tie).call(this,n)),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();this.hot.scrollToFocusedCell();const r=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),n=$w(this.menu.container,this.hot.rootDocument);this.open({left:r.left+n.left,top:r.top+n.top-1+r.height},{left:r.width,above:-r.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&this.hot.selection.isCellVisible(r)&&!this.menu.isOpened()},group:TN})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(TN)}open(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};if((r=this.menu)!==null&&r!==void 0&&r.isOpened())return;this.prepareMenuItems(),this.menu.open();const i=this.menu.tableBorderWidth>0;We(n,(o,s)=>{const a=["below","right"].includes(s)?o+1:o-1;this.menu.setOffset(s,i?o:a)}),this.menu.setPosition(e)}close(){var e;(e=this.menu)===null||e===void 0||e.close(),this.itemsFactory=null}executeCommand(e){this.itemsFactory===null&&this.prepareMenuItems();for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.commandExecutor.execute(e,...n)}prepareMenuItems(){this.itemsFactory=new rW(this.hot,Yw.DEFAULT_ITEMS);const e=this.hot.getSettings()[sd],r={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const n=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",n),this.menu.setMenuItems(n),k(n,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function Tie(t){const e=this.hot.getSettings(),r=e.rowHeaders,n=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const o=t.target;if(this.close(),_e(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(r||n)&&!i(o)&&!(_e(o,"current")&&_e(o,"wtBorder"))))return;const s=$w(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function _ie(){this.hot.runHooks("beforeContextMenuShow",this)}function Mie(){this.hot.runHooks("afterContextMenuShow",this)}function Pie(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Yw.SEPARATOR={name:Fe};function Iie(t){return{key:"copy",name(){return this.getTranslatedPhrase(OT)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Oie(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),r=e?Xe(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(HT,r)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function xie(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),r=e?Xe(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(AT,r)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Aie(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),r=e?Xe(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(xT,r)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Hie(t){return{key:"cut",name(){return this.getTranslatedPhrase(NT)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}class Nie{constructor(){this.data={}}setData(e,r){this.data[e]=r}getData(e){return this.data[e]||void 0}}class Die{constructor(){this.clipboardData=new Nie}preventDefault(){}composedPath(){return[]}}function kie(t,e){lW(t,e),e.add(t)}function Mu(t,e,r){lW(t,e),e.set(t,r)}function lW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zr(t,e){return t.get(rc(t,e))}function Pu(t,e,r){return t.set(rc(t,e),r),r}function rc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Vs=new WeakMap,pS=new WeakMap,xh=new WeakMap,CE=new WeakMap,bE=new WeakMap,Ah=new WeakMap,Hh=new WeakSet;class Lie{constructor(e){let{countRows:r,countColumns:n,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;kie(this,Hh),Mu(this,Vs,void 0),Mu(this,pS,void 0),Mu(this,xh,void 0),Mu(this,CE,void 0),Mu(this,bE,void 0),Mu(this,Ah,void 0),Pu(pS,this,r),Pu(xh,this,n),Pu(CE,this,i),Pu(bE,this,o),Pu(Ah,this,s)}setSelectedRange(e){Pu(Vs,this,e)}getCellsRange(){if(Zr(pS,this).call(this)===0||Zr(xh,this).call(this)===0)return null;const{row:e,col:r}=Zr(Vs,this).getTopStartCorner(),{row:n,col:i}=Zr(Vs,this).getBottomEndCorner(),o=rc(Hh,this,$ie).call(this,e,n),s=rc(Hh,this,wS).call(this,r,i);return{isRangeTrimmed:n!==o||i!==s,startRow:e,startCol:r,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Zr(xh,this).call(this)===0||Zr(Ah,this).call(this)===0)return null;const{col:e}=Zr(Vs,this).getTopStartCorner(),{col:r}=Zr(Vs,this).getBottomEndCorner(),n=rc(Hh,this,wS).call(this,e,r);return{isRangeTrimmed:r!==n,startRow:-1,startCol:e,endRow:-1,endCol:n}}getAllColumnHeadersRange(){if(Zr(xh,this).call(this)===0||Zr(Ah,this).call(this)===0)return null;const{col:e}=Zr(Vs,this).getTopStartCorner(),{col:r}=Zr(Vs,this).getBottomEndCorner(),n=rc(Hh,this,wS).call(this,e,r);return{isRangeTrimmed:r!==n,startRow:-Zr(Ah,this).call(this),startCol:e,endRow:-1,endCol:n}}}function wS(t,e){return Math.min(e,Math.max(t+Zr(bE,this).call(this)-1,t))}function $ie(t,e){return Math.min(e,Math.max(t+Zr(CE,this).call(this)-1,t))}function uW(t){const e=[],r=[];return k(t,n=>{const i=Math.min(n.startRow,n.endRow),o=Math.max(n.startRow,n.endRow);Ce(i,o,l=>{e.indexOf(l)===-1&&e.push(l)});const s=Math.min(n.startCol,n.endCol),a=Math.max(n.startCol,n.endCol);Ce(s,a,l=>{r.indexOf(l)===-1&&r.push(l)})}),{rows:e,columns:r}}function Fie(t,e){cW(t,e),e.add(t)}function Ws(t,e,r){cW(t,e),e.set(t,r)}function cW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nh(t,e,r){return(e=Vie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vie(t){var e=Wie(t,"string");return typeof e=="symbol"?e:e+""}function Wie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yn(t,e){return t.get(bn(t,e))}function Mi(t,e,r){return t.set(bn(t,e),r),r}function bn(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("afterCopyLimit");fe.getSingleton().register("modifyCopyableRange");fe.getSingleton().register("beforeCut");fe.getSingleton().register("afterCut");fe.getSingleton().register("beforePaste");fe.getSingleton().register("afterPaste");fe.getSingleton().register("beforeCopy");fe.getSingleton().register("afterCopy");const vS="copyPaste",Bie=80,jie=["fragmentSelection"],_N=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var SE=new WeakMap,RE=new WeakMap,EE=new WeakMap,Iu=new WeakMap,Hg=new WeakMap,Ng=new WeakMap,Ou=new WeakMap,Mp=new WeakMap,Ln=new WeakSet;class Uie extends nt{constructor(){super(...arguments),Fie(this,Ln),Nh(this,"columnsLimit",1/0),Nh(this,"rowsLimit",1/0),Nh(this,"pasteMode","overwrite"),Nh(this,"uiContainer",this.hot.rootDocument.body),Ws(this,SE,!1),Ws(this,RE,!1),Ws(this,EE,!1),Ws(this,Iu,"cells-only"),Ws(this,Hg,!1),Ws(this,Ng,!1),Ws(this,Ou,new Lie({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Ws(this,Mp,!1),Nh(this,"copyableRanges",[])}static get PLUGIN_KEY(){return vS}static get SETTING_KEYS(){return[vS,...jie]}static get PLUGIN_PRIORITY(){return Bie}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[vS]}enablePlugin(){var e,r,n=this;this.enabled||(this.pasteMode=(e=this.getSetting("pasteMode"))!==null&&e!==void 0?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),Mi(SE,this,this.getSetting("copyColumnHeaders")),Mi(RE,this,this.getSetting("copyColumnGroupHeaders")),Mi(EE,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(r=this.getSetting("uiContainer"))!==null&&r!==void 0?r:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>bn(Ln,this,Gie).call(this,i)),this.addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return bn(Ln,n,qie).call(n,...o)}),this.addHook("afterSelectionEnd",()=>bn(Ln,this,Kie).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return n.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return n.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return n.onPaste(...arguments)}),cp()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return bn(Ln,n,Xie).call(n,...o)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return bn(Ln,n,Zie).call(n,...o)}),this.addHook("afterSelection",()=>bn(Ln,this,Jie).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cells-only";Mi(Iu,this,e),Mi(Hg,this,!0),bn(Ln,this,MN).call(this,"copy")}copyCellsOnly(){this.copy("cells-only")}copyColumnHeadersOnly(){this.copy("column-headers-only")}copyWithAllColumnHeaders(){this.copy("with-column-group-headers")}copyWithColumnHeaders(){this.copy("with-column-headers")}cut(){Mi(Ng,this,!0),bn(Ln,this,MN).call(this,"cut")}getRangedCopyableData(e){return pd(this.getRangedData(e))}getRangedData(e){const r=[],{rows:n,columns:i}=uW(e);return k(n,o=>{const s=[];k(i,a=>{o<0?s.push(this.hot.getColHeader(a,o)):s.push(this.hot.getCopyableData(o,a))}),r.push(s)}),r}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!r)return;const n=new Die;e&&n.clipboardData.setData("text/plain",e),r&&n.clipboardData.setData("text/html",r),this.onPaste(n)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}yn(Ou,this).setSelectedRange(e);const r=new Map([["headers",null],["cells",null]]);yn(Iu,this)==="column-headers-only"?r.set("headers",yn(Ou,this).getMostBottomColumnHeadersRange()):(yn(Iu,this)==="with-column-headers"?r.set("headers",yn(Ou,this).getMostBottomColumnHeadersRange()):yn(Iu,this)==="with-column-group-headers"&&r.set("headers",yn(Ou,this).getAllColumnHeadersRange()),r.set("cells",yn(Ou,this).getCellsRange())),this.copyableRanges=Array.from(r.values()).filter(i=>i!==null).map(i=>{let{startRow:o,startCol:s,endRow:a,endCol:l}=i;return{startRow:o,startCol:s,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const n=r.get("cells");if(n!==null&&n.isRangeTrimmed){const{startRow:i,startCol:o,endRow:s,endCol:a}=n;this.hot.runHooks("afterCopyLimit",s-i+1,a-o+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return(e=this.hot.getActiveEditor())===null||e===void 0?void 0:e.isOpened()}populateValues(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const n=e.length,i=e[0].length,o=[],{row:s,col:a}=r.getTopStartCorner(),{row:l,col:u}=r.getBottomEndCorner();let c=s,h=a,d=s,f=a;for(;o.length<n||c<=l;){const{skipRowOnPaste:g,visualRow:w}=this.hot.getCellMeta(c,a);if(c=w+1,g===!0)continue;d=w,h=a;const v=[],b=o.length%n;for(;v.length<i||h<=u;){const{skipColumnOnPaste:p,visualCol:_}=this.hot.getCellMeta(s,h);if(h=_+1,p===!0)continue;f=_;const O=v.length%i;v.push(e[b][O])}o.push(v)}return Mi(Mp,this,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,f]}onCopy(e){const r=e.composedPath()[0],n=this.hot.getFocusManager().getRefocusElement(),i=r==null?void 0:r.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!yn(Hg,this)||this.isEditorOpened()||Rs(r)&&(i&&r!==n||!i&&r!==this.hot.rootDocument.body&&!xm(r,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Mi(Hg,this,!1);const o=this.getRangedData(this.copyableRanges),s=bn(Ln,this,zie).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=pd(o);if(e&&e.clipboardData){const u=lA(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[_N,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}Mi(Iu,this,"cells-only")}onCut(e){const r=e.composedPath()[0],n=this.hot.getFocusManager().getRefocusElement(),i=r==null?void 0:r.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!yn(Ng,this)||this.isEditorOpened()||Rs(r)&&(i&&r!==n||!i&&r!==this.hot.rootDocument.body&&!xm(r,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Mi(Ng,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=pd(o);if(e&&e.clipboardData){const l=lA(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[_N,l].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",a);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",o,this.copyableRanges)}}onPaste(e){const r=e.composedPath()[0],n=this.hot.getFocusManager().getRefocusElement(),i=r==null?void 0:r.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||Rs(r)&&(i&&r!==n||!i&&r!==this.hot.rootDocument.body&&!xm(r,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=$0(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=T4(c,this.hot.rootDocument).data:o=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(o=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof o=="string"&&(o=f8(o)),o===void 0||o&&o.length===0||this.hot.runHooks("beforePaste",o,this.copyableRanges)===!1)return;const[s,a,l,u]=this.populateValues(o);this.hot.selectCell(s,a,Math.min(this.hot.countRows()-1,l),Math.min(this.hot.countCols()-1,u)),this.hot.runHooks("afterPaste",o,this.copyableRanges)}destroy(){super.destroy()}}function MN(t){if(cp()){const e=this.hot.getSelectedRangeLast();if(e){const{row:r,col:n}=e.highlight,i=this.hot.getCell(r,n,!0);i&&R3(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function zie(t){const{rows:e}=uW(t);let r=0;for(let n=0;n<e.length&&!(e[n]>=0);n++)r+=1;return{columnHeadersCount:r}}function Yie(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:r}=t.highlight,n=this.hot.getCell(e,r,!0);n&&_$(n)}}}function hW(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:r}=t.highlight,n=this.hot.getCell(e,r,!0);n!=null&&n.hasAttribute("contenteditable")&&M$(n)}}}function Gie(t){t.items.push({name:"---------"},Iie(this)),yn(SE,this)&&t.items.push(Aie(this)),yn(RE,this)&&t.items.push(xie(this)),yn(EE,this)&&t.items.push(Oie(this)),t.items.push(Hie(this))}function qie(t,e,r,n,i){yn(Mp,this)&&(i.value=!0),Mi(Mp,this,!1)}function Kie(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function Xie(){bn(Ln,this,hW).call(this)}function Zie(){bn(Ln,this,Yie).call(this)}function Jie(){bn(Ln,this,hW).call(this)}function dW(t,e){return`border_row${t}col${e}`}function ad(){return{width:1,color:"#000"}}function ws(){return{hide:!0}}function Qie(){return{width:1,color:"#000",cornerVisible:!1}}function yS(t){if(pe(t.start)||pe(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(pe(t.end)||pe(t.right)){var r;t.end=(r=t.end)!==null&&r!==void 0?r:t.right}return delete t.left,delete t.right,t}function Dh(t){return pe(t.start)&&(t.left=t.start),pe(t.end)&&(t.right=t.end),t}function CS(t,e){return{id:dW(t,e),border:Qie(),row:t,col:e,top:ws(),bottom:ws(),start:ws(),end:ws()}}function eoe(t,e){return dr(e,"border")&&e.border&&(t.border=e.border),dr(e,"top")&&pe(e.top)&&(e.top?(Ve(e.top)||(e.top=ad()),t.top=e.top):(e.top=ws(),t.top=e.top)),dr(e,"bottom")&&pe(e.bottom)&&(e.bottom?(Ve(e.bottom)||(e.bottom=ad()),t.bottom=e.bottom):(e.bottom=ws(),t.bottom=e.bottom)),dr(e,"start")&&pe(e.start)&&(e.start?(Ve(e.start)||(e.start=ad()),t.start=e.start):(e.start=ws(),t.start=e.start)),dr(e,"end")&&pe(e.end)&&(e.end?(Ve(e.end)||(e.end=ad()),t.end=e.end):(e.end=ws(),t.end=e.end)),t}function Ms(t,e){let r=!1;return k(t.getSelectedRange(),n=>{n.forAll((i,o)=>{if(i<0||o<0)return;const s=t.getCellMeta(i,o).borders;if(s)if(e){if(!dr(s[e],"hide")||s[e].hide===!1)return r=!0,!1}else return r=!0,!1})}),r}function Gw(t){return`<span class="selected">✓</span>${t}`}function toe(t){return t.some(e=>pe(e.left)||pe(e.right))}function roe(t){return t.some(e=>pe(e.start)||pe(e.end))}const noe=new Map([["left","start"],["right","end"]]);function ioe(t){var e;return(e=noe.get(t))!==null&&e!==void 0?e:t}function ooe(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(e_);return Ms(this,"bottom")&&(e=Gw(e)),e},callback(e,r){const n=Ms(this,"bottom");t.prepareBorder(r,"bottom",n)}}}function soe(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let r=this.getTranslatedPhrase(t_);return Ms(this,e)&&(r=Gw(r)),r},callback(r,n){const i=Ms(this,e);t.prepareBorder(n,e,i)}}}function aoe(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(r_)},callback(e,r){t.prepareBorder(r,"noBorders")},disabled(){return!Ms(this)}}}function loe(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let r=this.getTranslatedPhrase(QT);return Ms(this,e)&&(r=Gw(r)),r},callback(r,n){const i=Ms(this,e);t.prepareBorder(n,e,i)}}}function uoe(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(JT);return Ms(this,"top")&&(e=Gw(e)),e},callback(e,r){const n=Ms(this,"top");t.prepareBorder(r,"top",n)}}}function coe(t,e){hoe(t,e),e.add(t)}function hoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function doe(t,e,r){return(e=foe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function foe(t){var e=goe(t,"string");return typeof e=="symbol"?e:e+""}function goe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function PN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Wm="customBorders",moe=90;var bS=new WeakSet;class poe extends nt{constructor(){super(...arguments),coe(this,bS),doe(this,"savedBorders",[])}static get PLUGIN_KEY(){return Wm}static get PLUGIN_PRIORITY(){return moe}isEnabled(){return!!this.hot.getSettings()[Wm]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>PN(bS,this,woe).call(this,e)),this.addHook("init",()=>PN(bS,this,voe).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,r){let n=["top","bottom","start","end"],i=null;r&&(this.checkSettingsCohesion([r]),n=Object.keys(r),i=yS(r));const o=bc(e),s=Bd(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});k(e,a=>{s(a).forAll((l,u)=>{k(n,c=>{this.prepareBorderFromCustomAdded(l,u,i,ioe(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const r=bc(e),n=Bd(r,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return k(e,o=>{n(o).forAll((s,a)=>{k(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(Dh(l))})})}),i}clearBorders(e){e?this.setBorders(e):(k(this.savedBorders,r=>{this.clearBordersFromSelectionSettings(r.id),this.clearNullCellRange(),this.hot.removeCellMeta(r.row,r.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,r){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,r)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,r,n,i){const o=this.hot.countRows(),s=this.hot.countCols();if(e>=o||r>=s)return;let a=CS(e,r);n&&(a=eoe(a,n),k(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,n),a.id=l.settings.id,a.top=l.settings.top,a.bottom=l.settings.bottom,a.start=l.settings.start,a.end=l.settings.end,!1})),this.hot.setCellMeta(e,r,"borders",Dh(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,r){const n=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);Ce(e.from.row,n,o=>{Ce(e.from.col,i,s=>{const a=CS(o,s);let l=0;o===e.from.row&&dr(r,"top")&&(l+=1,a.top=r.top),o===e.to.row&&dr(r,"bottom")&&(l+=1,a.bottom=r.bottom),s===e.from.col&&dr(r,"start")&&(l+=1,a.start=r.start),s===e.to.col&&dr(r,"end")&&(l+=1,a.end=r.end),l>0&&(this.hot.setCellMeta(o,s,"borders",Dh(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,r){const n=dW(e,r);this.spliceBorder(n),this.clearBordersFromSelectionSettings(n),this.clearNullCellRange(),this.hot.removeCellMeta(e,r,"borders")}setBorder(e,r,n,i){let o=this.hot.getCellMeta(e,r).borders;!o||o.border===void 0?o=CS(e,r):o=yS(o),i?(o[n]=ws(),this.countHide(o)===4?this.removeAllBorders(e,r):(this.checkCustomSelectionsFromContextMenu(o,n,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,r,"borders",Dh(o)))):(o[n]=ad(),this.checkCustomSelectionsFromContextMenu(o,n,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,r,"borders",Dh(o)))}prepareBorder(e,r,n){k(e,i=>{let{start:o,end:s}=i;if(o.row===s.row&&o.col===s.col)r==="noBorders"?this.removeAllBorders(o.row,o.col):this.setBorder(o.row,o.col,r,n);else switch(r){case"noBorders":Ce(o.col,s.col,a=>{Ce(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":Ce(o.col,s.col,a=>{this.setBorder(o.row,a,r,n)});break;case"bottom":Ce(o.col,s.col,a=>{this.setBorder(s.row,a,r,n)});break;case"start":Ce(o.row,s.row,a=>{this.setBorder(a,o.col,r,n)});break;case"end":Ce(o.row,s.row,a=>{this.setBorder(a,s.col,r,n)});break}})}createCustomBorders(e){k(e,r=>{const n=yS(r);r.range?this.prepareBorderFromCustomAddedRange(r.range,n):this.prepareBorderFromCustomAdded(r.row,r.col,n)})}countHide(e){const{top:r,bottom:n,start:i,end:o}=e;return Mn([r,n,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const r=qe(this.hot.selection.highlight.customSelections,n=>n.settings.id).indexOf(e);r>-1&&this.hot.selection.highlight.customSelections[r].clear()}clearNullCellRange(){k(this.hot.selection.highlight.customSelections,(e,r)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[r].destroy(),this.hot.selection.highlight.customSelections.splice(r,1),!1})}hideBorders(){k(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const r=qe(this.savedBorders,n=>n.id).indexOf(e);r>-1&&this.savedBorders.splice(r,1)}checkSavedBorders(e){let r=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),r=!0):k(this.savedBorders,(i,o)=>{if(e.id===i.id)return this.savedBorders[o]=e,r=!0,!1}),r}checkCustomSelectionsFromContextMenu(e,r,n){let i=!1;return k(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return k(s,a=>{a.toggleHiddenClass(r,n)}),i=!0,!1}}),i}checkCustomSelections(e,r,n){const i=this.countHide(e);let o=!1;return i===4?(this.removeAllBorders(e.row,e.col),o=!0):k(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){if(s.visualCellRange=r,s.commit(),n){const a=this.hot.view._wt.selectionManager.getBorderInstances(s);k(a,l=>{l.changeBorderStyle(n,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[Wm];if(Array.isArray(e)){const r=on(e);this.checkSettingsCohesion(r),r.length||(this.savedBorders=r),this.createCustomBorders(r)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const r=toe(e),n=roe(e);if(r&&n)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&r)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function woe(t){this.hot.getSettings()[Wm]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(ZT)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[uoe(this),loe(this),ooe(this),soe(this),aoe(this)]}})}function voe(){this.changeBorderSettings()}function yoe(t,e){Coe(t,e),e.add(t)}function Coe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function SS(t,e,r){return(e=boe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function boe(t){var e=Soe(t,"string");return typeof e=="symbol"?e:e+""}function Soe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const ON="dragToScroll",Roe=100;var RS=new WeakSet;class Eoe extends nt{constructor(){super(...arguments),yoe(this,RS),SS(this,"boundaries",null),SS(this,"callback",null),SS(this,"listening",!1)}static get PLUGIN_KEY(){return ON}static get PLUGIN_PRIORITY(){return Roe}isEnabled(){return!!this.hot.getSettings()[ON]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>IN(RS,this,xN).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>IN(RS,this,xN).call(this,e)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,r){let n=0,i=0;r<this.boundaries.top?i=r-this.boundaries.top:r>this.boundaries.bottom&&(i=r-this.boundaries.bottom),e<this.boundaries.left?n=e-this.boundaries.left:e>this.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let r=e;for(;r;)this.eventManager.addEventListener(r.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(r.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(r.document,"mousemove",n=>this.onMouseMove(n)),r=vc(r)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function xN(t){if(Vl(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((r,n)=>{var i,o;const s=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,a=(o=e.scrollTop)!==null&&o!==void 0?o:e.scrollY;e.scroll(s+Math.sign(r)*50,a+Math.sign(n)*20)}),this.listen()}function Toe(t,e){fW(t,e),e.add(t)}function _oe(t,e,r){fW(t,e),e.set(t,r)}function fW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ES(t,e,r){return(e=Moe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Moe(t){var e=Poe(t,"string");return typeof e=="symbol"?e:e+""}function Poe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ioe(t,e){return t.get(ri(t,e))}function gW(t,e,r){return t.set(ri(t,e),r),r}function ri(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("afterDropdownMenuDefaultOptions");fe.getSingleton().register("beforeDropdownMenuShow");fe.getSingleton().register("afterDropdownMenuShow");fe.getSingleton().register("afterDropdownMenuHide");fe.getSingleton().register("afterDropdownMenuExecute");const Bm="dropdownMenu",Ooe=230,Yd="changeType",TS=Bm;var qw=new WeakMap,Oi=new WeakSet;class Kw extends nt{static get PLUGIN_KEY(){return Bm}static get PLUGIN_PRIORITY(){return Ooe}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Ef,Tf,Fe,Mf,Fe,Fw,Fe,_f,Fe,ti]}constructor(e){super(e),Toe(this,Oi),ES(this,"commandExecutor",new tW(this.hot)),ES(this,"itemsFactory",null),ES(this,"menu",null),_oe(this,qw,!1),this.hot.addHook("afterGetColHeader",(r,n)=>ri(Oi,this,Aoe).call(this,r,n))}isEnabled(){return this.hot.getSettings()[Bm]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new rW(this.hot,Kw.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ri(Oi,e,$oe).call(e,...o)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ri(Oi,e,Loe).call(e,...o)});const r=this.hot.getSettings()[Bm],n={items:this.itemsFactory.getItems(r)};this.registerEvents(),typeof r.callback=="function"&&this.commandExecutor.setCommonCallback(r.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const i=this.itemsFactory.getItems(r);this.menu&&this.menu.destroy(),this.menu=new Wc(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:r.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>ri(Oi,this,Hoe).call(this)),this.menu.addLocalHook("afterOpen",()=>ri(Oi,this,Noe).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>ri(Oi,this,Doe).call(this,o)),this.menu.addLocalHook("afterClose",()=>ri(Oi,this,koe).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e.executeCommand.call(e,...s)}),k(i,o=>this.commandExecutor.registerCommand(o.key,o))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("grid"),r=()=>{const{highlight:n}=this.hot.getSelectedRangeLast();if((n.isHeader()&&n.row===-1||n.isCell())&&n.col>=0){this.hot.selectColumns(n.col,n.col,-1);const{from:i}=this.hot.getSelectedRangeLast(),o=$w(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${Yd}`),a=s.getBoundingClientRect();this.open({left:a.left+o.left,top:a.top+s.offsetHeight+o.top},{left:a.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:r,runOnlyIf:()=>{var n;const i=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:TS},{keys:[["Shift","Alt","ArrowDown"]],callback:r,runOnlyIf:()=>{var n;const i=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:TS}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(TS)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>ri(Oi,this,xoe).call(this,e))}open(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(r=this.menu)!==null&&r!==void 0&&r.isOpened()||(this.menu.open(),We(n,(i,o)=>{this.menu.setOffset(o,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.commandExecutor.execute(e,...n)}setListening(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function mW(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function xoe(t){if(_e(t.target,Yd)){const e=$w(this.menu.container,this.hot.rootDocument),r=t.target.getBoundingClientRect();t.stopPropagation(),gW(qw,this,!1),this.open({left:r.left+e.left,top:r.top+t.target.offsetHeight+e.top},{left:r.width,right:0,above:0,below:3})}}function Aoe(t,e){const r=e.parentNode;if(!r)return;const n=r.parentNode.childNodes,i=Array.prototype.indexOf.call(n,r);if(t<0||i!==n.length-1)return;const o=e.querySelector(`.${Yd}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=Yd,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(Pe(s,[eu(),Ld(" ")]),Pe(e,[h$("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function Hoe(){this.hot.runHooks("beforeDropdownMenuShow",this)}function Noe(){this.hot.runHooks("afterDropdownMenuShow",this),ri(Oi,this,mW).call(this,this.menu)}function Doe(t){ri(Oi,this,mW).call(this,t)}function koe(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function Loe(t){return Ioe(qw,this)?null:t}function $oe(t){_e(t.target,Yd)&&gW(qw,this,!0)}Kw.SEPARATOR={name:Fe};function AN(t,e,r){return(e=Foe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Foe(t){var e=Voe(t,"string");return typeof e=="symbol"?e:e+""}function Voe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Woe{constructor(e){AN(this,"hot",void 0),AN(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:r,endRow:n,endCol:i}=this._getDataRange(),o=this.options,s=[];return Ce(e,n,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(Ce(r,i,u=>{!o.exportHiddenColumns&&this._isHiddenColumn(u)||l.push(this.hot.getDataAtCell(a,u))}),s.push(l))}),s}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:r,endRow:n}=this._getDataRange(),i=this.hot.getRowHeader();Ce(r,n,o=>{!this.options.exportHiddenRows&&this._isHiddenRow(o)||e.push(i[o])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:r,endCol:n}=this._getDataRange(),i=this.hot.getColHeader();Ce(r,n,o=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(o)||e.push(i[o])})}return e}_getDataRange(){const e=this.hot.countCols()-1,r=this.hot.countRows()-1;let[n=0,i=0,o=r,s=e]=this.options.range;return n=Math.max(n,0),i=Math.max(i,0),o=Math.min(o,r),s=Math.min(s,e),{startRow:n,startCol:i,endRow:o,endCol:s}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function HN(t,e,r){return(e=Boe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Boe(t){var e=joe(t,"string");return typeof e=="symbol"?e:e+""}function joe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mM{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,r){HN(this,"dataProvider",void 0),HN(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(r),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let r=Po(this.constructor.DEFAULT_OPTIONS);const n=new Date;return r=gr(Po(mM.DEFAULT_OPTIONS),r),r=gr(r,e),r.filename=l$(r.filename,{YYYY:n.getFullYear(),MM:`${n.getMonth()+1}`.padStart(2,"0"),DD:`${n.getDate()}`.padStart(2,"0")}),r}}function Uoe(t,e){zoe(t,e),e.add(t)}function zoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function NN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const pW="\r",Yoe='"',Goe=`
|
|
741
|
+
`,qoe="=",Koe="+",Xoe="-",Zoe="@",Joe=" ";var _S=new WeakSet;class Qoe extends mM{constructor(){super(...arguments),Uoe(this,_S)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
|
|
742
|
+
`,sanitizeValues:!1}}export(){const e=this.options,r=this.dataProvider.getData();let n=this.dataProvider.getColumnHeaders();const i=n.length>0,o=this.dataProvider.getRowHeaders(),s=o.length>0;let a=e.bom?"\uFEFF":"";return i&&(n=qe(n,l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),s&&(a+=e.columnDelimiter),a+=n.join(e.columnDelimiter),a+=e.rowDelimiter),k(r,(l,u)=>{u>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(o[u],{sanitizeValue:e.sanitizeValues}),a+=e.columnDelimiter);const c=l.map(h=>this._escapeCell(h,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);a+=c}),a}_escapeCell(e){let{force:r=!1,sanitizeValue:n=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=Ft(e);return i===""||(n&&(r=!0),n instanceof RegExp?i=NN(_S,this,tse).call(this,i,n):typeof n=="function"?i=n(i):n&&(i=NN(_S,this,ese).call(this,i)),(r||i.indexOf(pW)>=0||i.indexOf(Yoe)>=0||i.indexOf(Goe)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function ese(t){return t.startsWith(qoe)||t.startsWith(Koe)||t.startsWith(Xoe)||t.startsWith(Zoe)||t.startsWith(Joe)||t.startsWith(pW)?`'${t}`:t}function tse(t,e){return e.test(t)?`'${t}`:t}const rse="csv",TE={[rse]:Qoe};function nse(t,e,r){return typeof TE[t]=="function"?new TE[t](e,r):null}const ise="exportFile",ose=240;class sse extends nt{static get PLUGIN_KEY(){return ise}static get PLUGIN_PRIORITY(){return ose}isEnabled(){return!0}exportAsString(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,r).export()}exportAsBlob(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,r))}downloadFile(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:n,rootWindow:i}=this.hot,o=this._createTypeFormatter(e,r),s=this._createBlob(o),a=i.URL||i.webkitURL,l=n.createElement("a"),u=`${o.options.filename}.${o.options.fileExtension}`;if(l.download!==void 0){const c=a.createObjectURL(s);l.style.display="none",l.setAttribute("href",c),l.setAttribute("download",u),n.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),n.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(c)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(s,u)}_createTypeFormatter(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!TE[e])throw new Error(`Export format type "${e}" is not supported.`);return nse(e,new Woe(this.hot),r)}_createBlob(e){let r=null;return typeof Blob<"u"&&(r=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),r}}function xu(t,e,r){return(e=ase(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ase(t){var e=lse(t,"string");return typeof e=="symbol"?e:e+""}function lse(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pf{constructor(e,r){let{id:n,stateless:i=!0}=r;xu(this,"hot",void 0),xu(this,"id",void 0),xu(this,"elements",[]),xu(this,"hidden",!1),xu(this,"stateId",""),xu(this,"state",void 0),this.hot=e,this.id=n,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new Pw)}getElements(){return this.elements}reset(){k(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return this.hot===null||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),k(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}yt(Pf,Hr);const Gd={};function ya(t,e){if(!Gd[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:r,descriptor:n}=Gd[t];let i=e;return n.inputValuesDecorator&&(i=n.inputValuesDecorator(i)),function(o){return r.apply(o.meta.instance,[].concat([o],[i]))}}function Il(t){if(!Gd[t])throw Error(`Filter condition "${t}" does not exist.`);return Gd[t].descriptor}function sr(t,e,r){r.key=t,Gd[t]={condition:e,descriptor:r}}const Ir="none";function use(){return!0}sr(Ir,use,{name:Iw,inputsCount:0,showOperators:!1});const yd="empty";function cse(t){return Qt(t.value)}sr(yd,cse,{name:u_,inputsCount:0,showOperators:!0});const jm="not_empty";function hse(t,e){return!ya(yd,e)(t)}sr(jm,hse,{name:c_,inputsCount:0,showOperators:!0});const Cd="eq";function dse(t,e){let[r]=e;return Ft(t.value).toLocaleLowerCase(t.meta.locale)===Ft(r)}sr(Cd,dse,{name:h_,inputsCount:1,showOperators:!0});const Um="neq";function fse(t,e){return!ya(Cd,e)(t)}sr(Um,fse,{name:d_,inputsCount:1,showOperators:!0});const wW="gt";function gse(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value>n}sr(wW,gse,{name:w_,inputsCount:1,showOperators:!0});const vW="gte";function mse(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value>=n}sr(vW,mse,{name:v_,inputsCount:1,showOperators:!0});const yW="lt";function pse(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value<n}sr(yW,pse,{name:y_,inputsCount:1,showOperators:!0});const CW="lte";function wse(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value<=n}sr(CW,wse,{name:C_,inputsCount:1,showOperators:!0});const pM="date_after";function vse(t,e){let[r]=e;const n=se(t.value,t.meta.dateFormat),i=se(r,t.meta.dateFormat);return!n.isValid()||!i.isValid()?!1:n.diff(i)>=0}sr(pM,vse,{name:R_,inputsCount:1,showOperators:!0});const wM="date_before";function yse(t,e){let[r]=e;const n=se(t.value,t.meta.dateFormat),i=se(r,t.meta.dateFormat);return!n.isValid()||!i.isValid()?!1:n.diff(i)<=0}sr(wM,yse,{name:E_,inputsCount:1,showOperators:!0});const Pp="between";function Cse(t,e){let[r,n]=e,i=r,o=n;if(t.meta.type==="numeric"){const s=parseFloat(i,10),a=parseFloat(o,10);i=Math.min(s,a),o=Math.max(s,a)}else if(t.meta.type==="date"){const s=ya(wM,[o]),a=ya(pM,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}sr(Pp,Cse,{name:b_,inputsCount:2,showOperators:!0});const bW="not_between";function bse(t,e){return!ya(Pp,e)(t)}sr(bW,bse,{name:S_,inputsCount:2,showOperators:!0});const SW="begins_with";function Sse(t,e){let[r]=e;return Ft(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Ft(r))}sr(SW,Sse,{name:f_,inputsCount:1,showOperators:!0});const RW="ends_with";function Rse(t,e){let[r]=e;return Ft(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Ft(r))}sr(RW,Rse,{name:g_,inputsCount:1,showOperators:!0});const vM="contains";function Ese(t,e){let[r]=e;return Ft(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Ft(r))>=0}sr(vM,Ese,{name:m_,inputsCount:1,showOperators:!0});const EW="not_contains";function Tse(t,e){return!ya(vM,e)(t)}sr(EW,Tse,{name:p_,inputsCount:1,showOperators:!0});const TW="date_tomorrow";function _se(t){const e=se(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(se().subtract(-1,"days").startOf("day"),"d"):!1}sr(TW,_se,{name:__,inputsCount:0});const _W="date_today";function Mse(t){const e=se(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(se().startOf("day"),"d"):!1}sr(_W,Mse,{name:T_,inputsCount:0});const MW="date_yesterday";function Pse(t){const e=se(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(se().subtract(1,"days").startOf("day"),"d"):!1}sr(MW,Pse,{name:M_,inputsCount:0});O3();function Ise(t,e){let r=t;return r===""&&(r=`(${e})`),r}function If(t){const e=new Set(t);return function(r){return e.has(r)}}function yM(t){return t??""}function _E(t){return Array.from(new Set(t)).map(e=>yM(e)).sort((e,r)=>typeof e=="number"&&typeof r=="number"?e-r:e===r?0:e>r?1:-1)}function DN(t,e,r,n){const i=[],o=t===e;let s;return o||(s=If(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:Ise(a,r)};n&&n(u),i.push(u)}),i}const Ol="by_value";function Ose(t,e){let[r]=e;return r(t.value)}sr(Ol,Ose,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[If(e)]},showOperators:!1});const qd={};function xse(t){if(!qd[t])throw Error(`Operation with id "${t}" does not exist.`);const e=qd[t].func;return function(r,n){return e(r,n)}}function Ase(t){return qd[t].name}function CM(t,e,r){qd[t]={name:e,func:r}}const pa="conjunction",Hse=O_;function Nse(t,e){return t.every(r=>r.func(e))}CM(pa,Hse,Nse);const Ip="disjunction",Dse=Ow;function kse(t,e){return t.some(r=>r.func(e))}CM(Ip,Dse,kse);const bM="disjunctionWithExtraCondition",Lse=Ow;function $se(t,e){if(t.length<3)throw Error("Operation doesn't work on less then three conditions.");return t.slice(0,t.length-1).some(r=>r.func(e))&&t[t.length-1].func(e)}CM(bM,Lse,$se);const Fse="numeric",PW="text",Vse="date",kN={[Fse]:[Ir,Fe,yd,jm,Fe,Cd,Um,Fe,wW,vW,yW,CW,Pp,bW],[PW]:[Ir,Fe,yd,jm,Fe,Cd,Um,Fe,SW,RW,Fe,vM,EW],[Vse]:[Ir,Fe,yd,jm,Fe,Cd,Um,Fe,wM,pM,Pp,Fe,TW,_W,MW]};function Wse(t){const e=[];let r=t;return kN[r]||(r=PW),k(kN[r],n=>{let i;n===Fe?i={name:Fe}:i=Po(Il(n)),e.push(i)}),e}function kh(t,e,r){return(e=Bse(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bse(t){var e=jse(t,"string");return typeof e=="symbol"?e:e+""}function jse(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const MS="built",PS="building",LN=["click","input","keydown","keypress","keyup","focus","blur","change"];let Fi=class IW{static get DEFAULTS(){return Po({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,r){kh(this,"hot",void 0),kh(this,"eventManager",new ji(this)),kh(this,"options",void 0),kh(this,"_element",void 0),kh(this,"buildState",void 0),this.hot=e,this.options=gr(IW.DEFAULTS,r),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===PS?this._element:this.buildState===MS?(this.update(),this._element):(this.buildState=PS,this.build(),this.buildState=MS,this._element)}isBuilt(){return this.buildState===MS}translateIfPossible(e){return typeof e=="string"&&e.startsWith(sn)?this.hot.getTranslatedPhrase(e):e}build(){const e=(r,n)=>{this.eventManager.addEventListener(r,n,i=>this.runLocalHooks(n,i,this))};if(this.buildState||(this.buildState=PS),this._element.setAttribute("data-hot-input",!0),this.options.tabIndex!==void 0&&this._element.setAttribute("tabindex",this.options.tabIndex),this.options.role!==void 0&&this._element.setAttribute("role",this.options.role),this.options.className&&ie(this._element,this.options.className),this.options.children.length)k(this.options.children,r=>this._element.appendChild(r.element));else if(this.options.wrapIt){const r=this.hot.rootDocument.createElement(this.options.tagName);r.setAttribute("data-hot-input",!0),We(this.options,(n,i)=>{r[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(r[i]=this.translateIfPossible(n))}),this._element.appendChild(r),k(LN,n=>e(r,n))}else k(LN,r=>e(this._element,r))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}};yt(Fi,Hr);function Use(t,e){OW(t,e),e.add(t)}function zse(t,e,r){OW(t,e),e.set(t,r)}function OW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dg(t,e){return t.get(SM(t,e))}function Yse(t,e,r){return t.set(SM(t,e),r),r}function SM(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Au=new WeakMap,$N=new WeakSet;class wa extends Fi{static get DEFAULTS(){return Po({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,r){super(e,gr(wa.DEFAULTS,r)),Use(this,$N),zse(this,Au,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>SM($N,this,Gse).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");Yse(Au,this,this._element.firstChild),ie(this._element,"htUIInput"),ie(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Dg(Au,this).type=this.options.type,Dg(Au,this).placeholder=this.translateIfPossible(this.options.placeholder),Dg(Au,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&Dg(Au,this).focus()}}function Gse(t){this.options.value=t.target.value}function qse(t,e){xW(t,e),e.add(t)}function Lh(t,e,r){xW(t,e),e.set(t,r)}function xW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hu(t,e,r){return t.set(bd(t,e),r),r}function Vt(t,e){return t.get(bd(t,e))}function bd(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Cr=new WeakMap,kg=new WeakMap,Lg=new WeakMap,IS=new WeakMap,$g=new WeakMap,Fg=new WeakSet;class Kd extends Fi{static get DEFAULTS(){return Po({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,r){super(e,gr(Kd.DEFAULTS,r)),qse(this,Fg),Lh(this,Cr,null),Lh(this,kg,[]),Lh(this,Lg,void 0),Lh(this,IS,void 0),Lh(this,$g,void 0),this.registerHooks()}getMenu(){return Vt(Cr,this)}registerHooks(){this.addLocalHook("click",()=>bd(Fg,this,Zse).call(this))}setItems(e){Hu(kg,this,this.translateNames(e)),Vt(Cr,this)&&Vt(Cr,this).setMenuItems(Vt(kg,this))}translateNames(e){return k(e,r=>{r.name=this.translateIfPossible(r.name)}),e}build(){super.build(),Hu(Cr,this,new Wc(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Vt(Cr,this).setMenuItems(Vt(kg,this));const e=new Fi(this.hot,{className:"htUISelectCaption"}),r=new Fi(this.hot,{className:"htUISelectDropdown"});Hu(Lg,this,e),Hu(IS,this,e.element),Hu($g,this,r),this.hot.getSettings().ariaTags&&(Pe(r.element,[eu()]),Pe(this._element,[c$()])),k([e,r],n=>this._element.appendChild(n.element)),Vt(Cr,this).addLocalHook("select",n=>bd(Fg,this,Kse).call(this,n)),Vt(Cr,this).addLocalHook("afterClose",()=>bd(Fg,this,Xse).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Vt(Cr,this).hot.getTranslatedPhrase(Iw),Vt(IS,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Vt(Cr,this)&&(Vt(Cr,this).open(),Vt(Cr,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Vt(Cr,this).getNavigator().toFirstItem(),Vt(Cr,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:r=>{this.closeOptions(),this.runLocalHooks("tabKeydown",r)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Vt(Cr,this)&&Vt(Cr,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Vt(Cr,this)&&(Vt(Cr,this).destroy(),Hu(Cr,this,null)),Vt(Lg,this)&&Vt(Lg,this).destroy(),Vt($g,this)&&Vt($g,this).destroy(),super.destroy()}}function Kse(t){t.name!==Fe&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function Xse(){this.runLocalHooks("afterClose")}function Zse(){this.openOptions()}function Jse(t,e){Qse(t,e),e.add(t)}function Qse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function FN(t,e,r){return(e=eae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eae(t){var e=tae(t,"string");return typeof e=="symbol"?e:e+""}function tae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var OS=new WeakSet;class ME extends Pf{constructor(e,r){super(e,{id:r.id,stateless:!1}),Jse(this,OS),FN(this,"name",""),FN(this,"addSeparator",!1),this.name=r.name,this.addSeparator=r.addSeparator,this.elements.push(new Kd(this.hot,{menuContainer:r.menuContainer})),this.elements.push(new wa(this.hot,{placeholder:k_})),this.elements.push(new wa(this.hot,{placeholder:L_})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>VN(OS,this,rae).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),k(this.getInputElements(),e=>{e.addLocalHook("keydown",r=>VN(OS,this,nae).call(this,r))})}setState(e){if(this.reset(),!e)return;const r=Po(e.command);r.name.startsWith(Gt)&&(r.name=this.hot.getTranslatedPhrase(r.name)),this.getSelectElement().setValue(r),k(e.args,(n,i)=>{if(i>r.inputsCount-1)return!1;const o=this.getInputElement(i);o.setValue(n),o[r.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>o.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Il(Ir),r=[];return k(this.getInputElements(),(n,i)=>{e.inputsCount>i&&r.push(n.getValue())}),{command:e,args:r}}updateState(e,r){const n=Il(e?e.name:Ir);this.state.setValueAtIndex(r,{command:n,args:e?e.args:[]}),e||k(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof Kd)[0]}getInputElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof wa)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r,n,i,o,s)=>{ie(r.parentNode,"htFiltersMenuCondition"),this.addSeparator&&ie(r.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return ie(a,"htFiltersMenuLabel"),a.textContent=s,r.appendChild(a),r.parentElement.hasAttribute("ghost-table")||k(this.elements,l=>r.appendChild(l.element)),r}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let r=[Il(Ir)];if(e!==null){const{visualIndex:n}=e;r=Wse(this.hot.getDataType(0,n,this.hot.countRows(),n))}k(this.getInputElements(),n=>n.hide()),this.getSelectElement().setItems(r),super.reset(),this.getSelectElement().setValue(r[0])}}function rae(t){k(this.getInputElements(),(e,r)=>{e[t.inputsCount>r?"show":"hide"](),r===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function nae(t){mf(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Yi(t))}function WN(t,e,r){iae(t,e),e.set(t,r)}function iae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $h(t,e){return t.get(AW(t,e))}function BN(t,e,r){return t.set(AW(t,e),r),r}function AW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Nu=new WeakMap,xS=new WeakMap;class Op extends Fi{static get DEFAULTS(){return Po({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,r){super(e,gr(Op.DEFAULTS,r)),WN(this,Nu,void 0),WN(this,xS,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),BN(xS,this,e),BN(Nu,this,this._element.firstChild),$h(Nu,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&($h(xS,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?$h(Nu,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&($h(Nu,this).checked=e)}focus(){this.isBuilt()&&$h(Nu,this).focus()}}function oae(t,e){sae(t,e),e.add(t)}function sae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function aae(t,e,r){return(e=lae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lae(t){var e=uae(t,"string");return typeof e=="symbol"?e:e+""}function uae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cae(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const jN=0;var UN=new WeakSet;class hae extends Pf{constructor(e,r){super(e,{id:r.id,stateless:!1}),oae(this,UN),aae(this,"name",""),this.name=r.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r)=>(ie(r.parentNode,"htFiltersMenuOperators"),k(this.elements,n=>r.appendChild(n.element)),r)}}buildOperatorsElement(){const e=[pa,Ip];k(e,r=>{const n=new Op(this.hot,{name:"operator",label:{htmlFor:r,textContent:Ase(r)},value:r,checked:r===e[jN],id:r});n.addLocalHook("change",i=>cae(UN,this,dae).call(this,i)),this.elements.push(n)})}setChecked(e){if(this.elements.length<e)throw Error(lt`Radio button with index ${e} doesn't exist.`);k(this.elements,(r,n)=>{r.setChecked(n===e)})}getActiveOperationId(){const e=this.elements.find(r=>r instanceof Op&&r.isChecked());return e?e.getValue():pa}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&k(this.elements,r=>{r.setChecked(r.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pa,r=arguments.length>1?arguments[1]:void 0,n=e;n===bM&&(n=Ip),this.state.setValueAtIndex(r,n)}reset(){this.setChecked(jN)}}function dae(t){this.setState(t.target.value)}function fae(t,e,r){gae(t,e),e.set(t,r)}function gae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function AS(t,e){return t.get(HW(t,e))}function mae(t,e,r){return t.set(HW(t,e),r),r}function HW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Fh=new WeakMap;class Xd extends Fi{static get DEFAULTS(){return Po({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,r){super(e,gr(Xd.DEFAULTS,r)),fae(this,Fh,void 0)}build(){super.build(),mae(Fh,this,this._element.firstChild)}update(){this.isBuilt()&&(AS(Fh,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&AS(Fh,this).focus()}activate(){AS(Fh,this).click()}}function pae(t,e){NW(t,e),e.add(t)}function Du(t,e,r){NW(t,e),e.set(t,r)}function NW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ae(t,e){return t.get(nc(t,e))}function Si(t,e,r){return t.set(nc(t,e),r),r}function nc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const zN="multipleSelect.itemBox";var xi=new WeakMap,Xt=new WeakMap,HS=new WeakMap,Zo=new WeakMap,Bs=new WeakMap,js=new WeakMap,Vh=new WeakSet;class Zd extends Fi{static get DEFAULTS(){return Po({className:"htUIMultipleSelect",value:[]})}constructor(e,r){super(e,gr(Zd.DEFAULTS,r)),pae(this,Vh),Du(this,xi,[]),Du(this,Xt,void 0),Du(this,HS,void 0),Du(this,Zo,void 0),Du(this,Bs,void 0),Du(this,js,void 0),Si(Zo,this,new wa(this.hot,{placeholder:D_,className:"htUIMultipleSelectSearch"})),Si(Bs,this,new Xd(this.hot,{textContent:x_,className:"htUISelectAll"})),Si(js,this,new Xd(this.hot,{textContent:A_,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Ae(Xt,this)}registerHooks(){Ae(Zo,this).addLocalHook("keydown",e=>nc(Vh,this,vae).call(this,e)),Ae(Zo,this).addLocalHook("input",e=>nc(Vh,this,wae).call(this,e)),Ae(Bs,this).addLocalHook("click",e=>nc(Vh,this,yae).call(this,e)),Ae(js,this).addLocalHook("click",e=>nc(Vh,this,Cae).call(this,e))}setItems(e){var r;Si(xi,this,e),(r=Ae(Xt,this))===null||r===void 0||r.loadData(Ae(xi,this))}setLocale(e){Si(HS,this,e)}getLocale(){return Ae(HS,this)}getItems(){return[...Ae(xi,this)]}getValue(){return Sae(Ae(xi,this))}getSearchInputElement(){return Ae(Zo,this)}getSelectAllElement(){return Ae(Bs,this)}getClearAllElement(){return Ae(js,this)}isSelectedAllValues(){return Ae(xi,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,r=e.createElement("div"),n=new Fi(this.hot,{className:"htUISelectionControls",children:[Ae(Bs,this),Ae(js,this)]});this._element.appendChild(Ae(Zo,this).element),this._element.appendChild(n.element),this._element.appendChild(r);const i=o=>{var s;if(!this._element)return;(s=Ae(Xt,this))===null||s===void 0||s.destroy(),ie(o,"htUIMultipleSelectHot"),Si(Xt,this,new this.hot.constructor(o,{data:Ae(xi,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(u,c,h,d,f,g)=>{u.title=g.instance.getDataAtRowProp(c,g.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Ae(Xt,this).listen()},modifyColWidth:u=>{const c=Ae(Xt,this).container.scrollWidth-Or(e);return u!==void 0&&u<c?c:u},maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),Ae(Xt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||Ae(Xt,this).useTheme(u)});const l=Ae(Xt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:zN}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{Ae(Xt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:zN})};i(r),this.hot._registerTimeout(()=>i(r),100)}focus(){this.isBuilt()&&Ae(Xt,this).listen()}reset(){Ae(Zo,this).reset(),Ae(Bs,this).reset(),Ae(js,this).reset()}update(){this.isBuilt()&&(Ae(Xt,this).loadData(bae(Ae(xi,this),this.options.value)),super.update())}destroy(){var e;(e=Ae(Xt,this))===null||e===void 0||e.destroy(),Ae(Zo,this).destroy(),Ae(js,this).destroy(),Ae(Bs,this).destroy(),Si(Zo,this,null),Si(js,this,null),Si(Bs,this,null),Si(Xt,this,null),Si(xi,this,null),super.destroy()}}function wae(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let r;e===""?r=[...Ae(xi,this)]:r=Ae(xi,this).filter(n=>`${n.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),Ae(Xt,this).loadData(r)}function vae(t){this.runLocalHooks("keydown",t,this),P$(mf,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),Yi(t),Ae(Xt,this).listen(),Ae(Xt,this).selectCell(0,0))}function yae(t){const e=[];t.preventDefault(),Ae(Xt,this).getSourceData().forEach((r,n)=>{r.checked=!0,e.push(dF(r,n)[0])}),Ae(Xt,this).setSourceDataAtCell(e)}function Cae(t){const e=[];t.preventDefault(),Ae(Xt,this).getSourceData().forEach((r,n)=>{r.checked=!1,e.push(dF(r,n)[0])}),Ae(Xt,this).setSourceDataAtCell(e)}function bae(t,e){const r=If(e);return t.map(n=>(n.checked=r(n.value),n))}function Sae(t){const e=[];return t.forEach(r=>{r.checked&&e.push(r.value)}),e}function Rae(t,e){Eae(t,e),e.add(t)}function Eae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tae(t,e,r){return(e=_ae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _ae(t){var e=Mae(t,"string");return typeof e=="symbol"?e:e+""}function Mae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vg(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Wh=new WeakSet;class Pae extends Pf{constructor(e,r){super(e,{id:r.id,stateless:!1}),Rae(this,Wh),Tae(this,"name",""),this.name=r.name,this.elements.push(new Zd(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Vg(Wh,this,Iae).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,r)=>Vg(Wh,this,Oae).call(this,e,r))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===Ol){const r=this.getMultipleSelectElement();r.setItems(e.itemsSnapshot),r.setValue(e.args[0]),r.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),r=e.getItems();return{command:{key:e.isSelectedAllValues()||!r.length?Ir:Ol},args:[e.getValue()],itemsSnapshot:r}}updateState(e){const r=(n,i,o,s,a)=>{const[l]=Ll(i,h=>h.name===Ol),u={},c=this.hot.getTranslatedPhrase(fp);if(l){const h=s(n,a),d=qe(h,p=>p.value),f=new Map(h.map(p=>[p.value,this.hot.getCellMeta(p.meta.visualRow,p.meta.visualCol)])),g=_E(d);o&&(l.args[0]=o);const w=[],v=DN(g,l.args[0],c,p=>{p.checked&&w.push(p.value),Vg(Wh,this,YN).call(this,p,f)}),b=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,b).locale,u.args=[w],u.command=Il(Ol),u.itemsSnapshot=v}else u.args=[],u.command=Il(Ir);this.state.setValueAtIndex(n,u)};r(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&r(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof Zd)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r,n,i,o,s)=>{ie(r.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return ie(a,"htFiltersMenuLabel"),a.textContent=s,r.appendChild(a),r.parentElement.hasAttribute("ghost-table")||k(this.elements,l=>r.appendChild(l.element)),r}}}reset(){const e=this.hot.getTranslatedPhrase(fp),r=this._getColumnVisibleValues(),n=r.map(l=>l.value),i=new Map(r.map(l=>[l.value,l.meta])),o=_E(n),s=DN(o,o,e,l=>{Vg(Wh,this,YN).call(this,l,i)});this.getMultipleSelectElement().setItems(s),super.reset(),this.getMultipleSelectElement().setValue(o);const a=this.hot.getPlugin("filters").getSelectedColumn();a!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,a.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:qe(this.hot.getDataAtCol(e.visualIndex),(r,n)=>({value:yM(r),meta:this.hot.getCellMeta(n,e.visualIndex)}))}}function Iae(t){mf(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Yi(t))}function YN(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function Oae(t,e){switch(e.type){case"numeric":return SV(t,e);default:return t}}var DW;function xae(t,e){Aae(t,e),e.add(t)}function Aae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hae(t,e,r){return(e=Nae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nae(t){var e=Dae(t,"string");return typeof e=="symbol"?e:e+""}function Dae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kae(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var GN=new WeakSet;class Jd extends Pf{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,r){super(e,{id:r.id,stateless:!0}),xae(this,GN),Hae(this,"name",""),this.name=r.name,this.elements.push(new wa(this.hot,{type:"button",value:H_,className:"htUIButton htUIButtonOK",identifier:Jd.BUTTON_OK})),this.elements.push(new wa(this.hot,{type:"button",value:N_,className:"htUIButton htUIButtonCancel",identifier:Jd.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){k(this.elements,e=>{e.addLocalHook("click",(r,n)=>kae(GN,this,Lae).call(this,r,n))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r)=>(ie(r.parentNode,"htFiltersMenuActionBar"),k(this.elements,n=>r.appendChild(n.element)),r)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}DW=Jd;function Lae(t,e){e.options.identifier===DW.BUTTON_OK?this.accept():this.cancel()}function NS(t,e,r){return(e=$ae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $ae(t){var e=Fae(t,"string");return typeof e=="symbol"?e:e+""}function Fae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const qN="ConditionCollection.filteringStates";class RM{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;NS(this,"hot",void 0),NS(this,"isMapRegistrable",void 0),NS(this,"filteringStates",new Pw),this.hot=e,this.isMapRegistrable=r,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(qN,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,r){var n;const i=this.filteringStates.getValueAtIndex(r),o=(n=i==null?void 0:i.conditions)!==null&&n!==void 0?n:[],s=i==null?void 0:i.operation;return this.isMatchInConditions(o,e,s)}isMatchInConditions(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pa;return e.length?xse(n)(e,r):!0}addCondition(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pa,i=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,s=r.args.map(c=>typeof c=="string"?c.toLocaleLowerCase(o):c),a=r.name||r.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==n)throw Error(lt`The column of index ${e} has been already applied with a \`${l}\`\x20
|
|
743
|
+
filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
|
|
744
|
+
Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
|
|
745
|
+
use it consequently for a particular column).`)}else if($t(qd[n]))throw new Error(lt`Unexpected operation named \`${n}\`. Possible ones are\x20
|
|
746
|
+
\`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:n,conditions:[{name:a,args:s,func:ya(a,s)}]},i):u.push({name:a,args:s,func:ya(a,s)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var r,n;return(r=(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.conditions)!==null&&r!==void 0?r:[]}getOperation(e){var r;return(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[r]=e;return r})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce((e,r)=>{let[n,{operation:i,conditions:o}]=r;return e.push({column:n,operation:i,conditions:o.map(s=>{let{name:a,args:l}=s;return{name:a,args:[...l]}})}),e},[])}importAllConditions(e){this.clean(),e.forEach(r=>{r.conditions.forEach(n=>this.addCondition(r.column,n))})}removeConditions(e){this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,r){const n=this.getConditions(e);return r?n.some(i=>i.name===r):n.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(qN),this.filteringStates=null,this.clearLocalHooks()}}yt(RM,Hr);function KN(t,e,r){return(e=Vae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vae(t){var e=Wae(t,"string");return typeof e=="symbol"?e:e+""}function Wae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kW{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];KN(this,"conditionCollection",void 0),KN(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=r}filter(){let e=[];return k(this.conditionCollection.getFilteredColumns(),(r,n)=>{let i=this.columnDataFactory(r);n&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(r,i)}),e}filterByColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];return k(r,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&n.push(i)}),n}_getIntersectData(e,r){const n=[];return k(r,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(n[o]=e[o])}),n}}function Bae(t,e){jae(t,e),e.add(t)}function jae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function el(t,e,r){return(e=Uae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uae(t){var e=zae(t,"string");return typeof e=="symbol"?e:e+""}function zae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function DS(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Wg=new WeakSet;class LW{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];Bae(this,Wg),el(this,"hot",void 0),el(this,"conditionCollection",void 0),el(this,"columnDataFactory",void 0),el(this,"changes",[]),el(this,"grouping",!1),el(this,"latestEditedColumnPosition",-1),el(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=r,this.columnDataFactory=n,this.conditionCollection.addLocalHook("beforeRemove",i=>DS(Wg,this,Yae).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>DS(Wg,this,Gae).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>DS(Wg,this,qae).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,k(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,r){var n=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let o=this.conditionCollection.getColumnStackPosition(e);o===-1&&(o=this.latestEditedColumnPosition);const s=i.slice(0,o),a=i.slice(o);a.length&&a[0].column===e&&a.shift();const l=E3(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new RM(n.hot,!1),g=[].concat(c,d);f.importAllConditions(g);const w=n.columnDataFactory(h);let v;f.isEmpty()?v=w:v=new kW(f,p=>n.columnDataFactory(p)).filter(),v=qe(v,p=>p.meta.visualRow);const b=If(v);return f.destroy(),Ll(w,p=>b(p.meta.visualRow))})(s),u=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:u},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:r})}destroy(){this.clearLocalHooks(),We(this,(e,r)=>{this[r]=null})}}function Yae(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function Gae(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function qae(){k(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}yt(LW,Hr);function Kae(t){return iW({initialPage:0,size:()=>t.length,onItemSelect:(r,n)=>{const i=t[r];if(i instanceof Zd)return n;if(i.element&&!yc(i.element))return!1;i.focus()}})}const Bh="filters";function Xae(t,e){let r=-1,n;const i=Kae(e),o=h=>()=>{n.isOpened()&&n.getKeyboardShortcutsCtrl().listen(Bh),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof Fi&&(h.addLocalHook("click",o(h)),h.addLocalHook("focus",o(h)),h.addLocalHook("afterClose",o(h)))}),l(t);function s(h){const d=n.getKeyboardShortcutsCtrl(),f=h.getKeyboardShortcutsCtrl();i.clear(),f.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:d.getContext(Bh),callback:()=>{h.isSubMenu()&&h.close(),d.listen(Bh)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:g=>{const w=n.getNavigator();w.getCurrentPage()>-1&&(r=w.getCurrentPage()),w.clear(),g.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{n.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:g=>{const w=e[i.getCurrentPage()];w instanceof Kd&&(w.openOptions(),g.preventDefault()),w instanceof Xd&&(w.activate(),g.preventDefault()),w instanceof Fi||g.preventDefault()}}],Bh)}function a(){n.focus(),n.getKeyboardShortcutsCtrl().listen(Bh)}function l(h){h.addLocalHook("afterSelectionChange",d=>{d.key.startsWith("filter_")||i.clear()}),h.addLocalHook("afterSubmenuOpen",s),h.addLocalHook("afterOpen",s),n=h}function u(){return n}function c(){return r}return{...i,listen:a,setMenu:l,getMenu:u,getLastMenuPage:c}}function Zae(t,e){$W(t,e),e.add(t)}function kS(t,e,r){$W(t,e),e.set(t,r)}function $W(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jh(t,e,r){return(e=Jae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jae(t){var e=Qae(t,"string");return typeof e=="symbol"?e:e+""}function Qae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zm(t,e,r){return t.set(pn(t,e),r),r}function ni(t,e){return t.get(pn(t,e))}function pn(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const PE="filters",ele=250,XN=PE;var ns=new WeakMap,IE=new WeakMap,El=new WeakMap,On=new WeakSet;class tle extends nt{static get PLUGIN_KEY(){return PE}static get PLUGIN_PRIORITY(){return ele}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var r;super(e),r=this,Zae(this,On),jh(this,"dropdownMenuPlugin",null),jh(this,"conditionCollection",null),jh(this,"conditionUpdateObserver",null),jh(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),jh(this,"filtersRowsMap",null),kS(this,ns,void 0),kS(this,IE,new WeakSet),kS(this,El,[]),this.hot.addHook("afterGetColHeader",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return pn(On,r,lle).call(r,...i)})}isEnabled(){return!!this.hot.getSettings()[PE]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new yf),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const r=this.hot.getSettings().dropdownMenu,n=r&&r.uiContainer||this.hot.rootDocument.body,i=a=>(a.addLocalHook("accept",()=>pn(On,this,ZN).call(this,"accept")),a.addLocalHook("cancel",()=>pn(On,this,ZN).call(this,"cancel")),a.addLocalHook("change",l=>pn(On,this,ale).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(P_)}:`,s=()=>`${this.hot.getTranslatedPhrase(I_)}:`;if(!this.components.get("filter_by_condition")){const a=new ME(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:n});a.addLocalHook("afterClose",()=>pn(On,this,JN).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new hae(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new ME(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:n});a.addLocalHook("afterClose",()=>pn(On,this,JN).call(this)),this.components.set("filter_by_condition2",i(a))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",i(new Pae(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new Jd(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new RM(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new LW(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>pn(On,this,ule).call(this,a))),this.components.forEach(a=>a.show()),this.addHook("afterDropdownMenuDefaultOptions",function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return pn(On,e,sle).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>pn(On,this,ole).call(this)),this.addHook("afterDropdownMenuShow",()=>pn(On,this,nle).call(this)),this.addHook("afterDropdownMenuHide",()=>pn(On,this,ile).call(this)),this.addHook("afterChange",a=>pn(On,this,rle).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!ni(ns,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=ni(ns,this).getMenu(),c=u.getNavigator(),h=ni(ns,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];zm(ns,this,Xae(this.dropdownMenuPlugin.menu,a));const l=u=>{ni(ns,this).listen(),u.preventDefault(),mf(u.keyCode,"TAB")&&(u.shiftKey?ni(ns,this).toPreviousItem():ni(ns,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",l),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",l)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){if(this.enabled){var e;(e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((r,n)=>{r.destroy(),this.components.set(n,null)}),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName)}this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:XN})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(XN)}addCondition(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:pa;const o=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(o,{command:{key:r},args:n},i)}removeConditions(e){const r=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(r)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const r=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(r)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),r=this._createDataFilter(),n=!this.conditionCollection.isEmpty();let i=[];const o=this.exportConditions(),s=this.hot.runHooks("beforeFilter",o,ni(El,this));if(s!==!1&&n){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=qe(r.filter(),u=>u.meta.visualRow);const l=If(i);Ce(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),k(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell(),zm(El,this,this.exportConditions())}else s!==!1&&!n?(zm(El,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(ni(El,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col),s!==!1&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r?{visualIndex:r.col,physicalIndex:this.hot.toPhysicalColumn(r.col)}:null}getDataMapAtColumn(e){const r=this.hot.toVisualColumn(e),n=[];return k(this.hot.getSourceDataAtCol(r),(i,o)=>{var s;const{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:g}=this.hot.getCellMeta(o,r),w=(s=this.hot.getDataAtCell(this.hot.toVisualRow(o),r))!==null&&s!==void 0?s:i;n.push({meta:{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:g},value:yM(w)})}),n}updateValueComponentCondition(e){const r=this.hot.getDataAtCol(e),n=_E(r);this.conditionUpdateObserver.updateStatesAtColumn(e,n)}restoreComponents(e){var r;const n=(r=this.getSelectedColumn())===null||r===void 0?void 0:r.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(n)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,r,n,i){let o=e;return o===Ip&&r.command.key!==Ir&&n.command.key!==Ir&&i.command.key!==Ir?o=bM:i.command.key!==Ir&&(r.command.key===Ir||n.command.key===Ir)&&(o=pa),o}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:r}=e.getState(),n=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];r.showOperators?this.showComponents(...n):this.hideComponents(...n)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new kW(e,r=>this.getDataMapAtColumn(r))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const r=this.dropdownMenuPlugin.menu;for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return k(i,s=>{k(r.menuItems,(a,l)=>{a.key===s.getMenuItemDescriptor().key&&e.push(l)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const n=this.dropdownMenuPlugin.menu.hotMenu,i=n.getPlugin("hiddenRows");for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];const l=this.getIndexesOfComponents(...s);e?i.showRows(l):i.hideRows(l),n.render()}hideComponents(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.changeComponentsVisibility(!1,...r)}showComponents(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.changeComponentsVisibility(!0,...r)}destroy(){this.enabled&&(this.components.forEach((e,r)=>{e!==null&&(e.destroy(),this.components.set(r,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function rle(t){t&&k(t,e=>{const[,r]=e,n=this.hot.propToCol(r);this.conditionCollection.hasConditions(n)&&this.updateValueComponentCondition(n)})}function nle(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function ile(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function ole(){const t=this.dropdownMenuPlugin.menu;ni(IE,this).has(t)||ni(ns,this).setMenu(t),ni(IE,this).add(t)}function sle(t){t.items.push({name:Fe}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function ZN(t){var e;if(t==="accept"){const n=this.getSelectedColumn();if(n===null){var r;(r=this.dropdownMenuPlugin)===null||r===void 0||r.close();return}const{physicalIndex:i}=n,o=this.components.get("filter_by_condition").getState(),s=this.components.get("filter_by_condition2").getState(),a=this.components.get("filter_by_value").getState(),l=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),o,s,a);this.conditionUpdateObserver.groupChanges();let u=this.conditionCollection.getColumnStackPosition(i);u===-1&&(u=void 0),this.conditionCollection.removeConditions(i),o.command.key!==Ir&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==Ir&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==Ir&&this.conditionCollection.addCondition(i,a,l,u),this.conditionUpdateObserver.flush(),this.components.forEach(c=>c.saveState(i)),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function ale(t,e){const r=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===ME&&!e.inputsCount&&this.setListeningDropdownMenu(),r.updateMenuDimensions()}function JN(){this.setListeningDropdownMenu()}function lle(t,e,r){const n=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(n)&&r===this.hot.view.getColumnHeadersCount()-1?ie(e,"htFiltersActive"):Ee(e,"htFiltersActive")}function ule(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:r,column:n},conditionArgsChange:i}=t;Array.isArray(i)&&zm(El,this,ni(El,this).map(a=>(a.column===n&&r.length>0&&a.conditions.forEach(l=>{l.name==="by_value"&&(l.args=[[...i]])}),a)));const o=r.filter(a=>a.name===Ol),s=r.filter(a=>a.name!==Ol);if(o.length>=2||s.length>=3)it(lt`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
|
|
747
|
+
The overall amount of conditions exceed the capability of the dropdown menu.\x20
|
|
748
|
+
For more details see the documentation.`);else{const a=this.conditionCollection.getOperation(n);this.components.get("filter_by_condition").updateState(s[0],n),this.components.get("filter_by_condition2").updateState(s[1],n),this.components.get("filter_operators").updateState(a,n),this.components.get("filter_by_value").updateState(t)}}const FW="internal-use-in-handsontable",OE={licenseKey:FW,useArrayArithmetic:!0,useColumnIndex:!1,useStats:!1,evaluateNullToZero:!0,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,leapYear1900:!1,nullDate:{year:1899,month:12,day:30},nullYear:30,dateFormats:["DD/MM/YYYY","DD/MM/YY"],timeFormats:["hh:mm","hh:mm:ss.sss"],matchWholeCell:!0,useRegularExpressions:!1,useWildcards:!0,functionArgSeparator:",",thousandSeparator:"",decimalSeparator:".",language:"enGB"};function VW(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[Br])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function WW(t){return Object.keys(t).reduce((e,r)=>(r!=="hyperformula"&&(e[r]=t[r]),e),{})}function cle(t){var e;const r=t[Br],n=WW(r!=null&&(e=r.engine)!==null&&e!==void 0&&e.hyperformula?r.engine:{}),i=VW(t);return{...OE,...n,...i}}function hle(t){var e;const r=t[Br],n=WW(r!=null&&(e=r.engine)!==null&&e!==void 0&&e.hyperformula?r.engine:{}),i=VW(t);return{...n,...i}}function dle(t,e){return Object.keys(e).some(r=>e[r]!==void 0&&e[r]!==t[r])}function Xw(){const t="engine_relationship",e=Gi(Br);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function EM(){const t="shared_engine_usage",e=Gi(Br);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function fle(t){const e=t.getSettings(),r=e[Br],n=r==null?void 0:r.engine;if(r===!0||$t(n))return null;if(typeof n.hyperformula=="function"||typeof n=="function"){var i;return gle((i=n.hyperformula)!==null&&i!==void 0?i:n,e,t)}else if(typeof n=="object"&&$t(n.hyperformula)){const o=Xw(),s=EM().get(n);return o.has(n)||o.set(n,[]),o.get(n).push(t),s&&s.push(t.guid),n.getConfig().licenseKey||n.updateConfig({licenseKey:FW}),(n.getConfig().leapYear1900!==OE.leapYear1900||U0(n.getConfig().nullDate,OE.nullDate)===!1)&&it(lt`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
|
|
749
|
+
settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),n}return null}function gle(t,e,r){const n=e[Br],i=cle(e),o=Xw(),s=EM();mle(t,n.functions),ple(t,n.language);const a=t.buildEmpty(i);return o.set(a,[r]),s.set(a,[r.guid]),wle(a,n.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function QN(t){var e;const r=Xw(),n=r.size===0?[]:Array.from((e=r.get(t))!==null&&e!==void 0?e:[]);return new Map(n.map(i=>[i.getPlugin("formulas").sheetId,i]))}function eD(t,e){if(t){const r=Xw(),n=r.get(t),i=EM(),o=i.get(t);n&&n.includes(e)&&(n.splice(n.indexOf(e),1),n.length===0&&r.delete(t)),o&&o.includes(e.guid)&&(o.splice(o.indexOf(e.guid),1),o.length===0&&(i.delete(t),t.destroy()))}}function mle(t,e){e&&e.forEach(r=>{const{name:n,plugin:i,translations:o}=r;try{t.registerFunction(n,i,o)}catch(s){it(s.message)}})}function ple(t,e){if(e){const{langCode:r}=e;try{t.registerLanguage(r,e)}catch(n){it(n.message)}}}function wle(t,e){e&&(t.suspendEvaluation(),e.forEach(r=>{const{name:n,expression:i,scope:o,options:s}=r;try{t.addNamedExpression(n,i,o,s)}catch(a){it(a.message)}}),t.resumeEvaluation())}function vle(t,e){return($t(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const BW="DD/MM/YYYY";function yle(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function Cle(t){return yle(t)?t.substr(1):t}function ble(t){return typeof t=="string"&&t.startsWith("=")}function TM(t,e){return typeof t=="string"&&e==="date"}function jW(t,e){return se(t,e,!0).isValid()}function UW(t,e){return se(t,e,!0).format(BW)}function Sle(t,e){return se(t,BW,!0).format(e)}function zW(t,e){const n=new Date(Date.UTC(0,0,t+-1));return se(n).format(e)}function Rle(t,e,r){const n=Array.from(Array(r).keys()).filter(o=>t.includes(o)===!1);if(e===0){var i;return(i=n[e])!==null&&i!==void 0?i:0}return n[e-1]+1}function Ele(t,e){const r=[];return t.forEach(n=>{const i={from:n,to:e};r.forEach(o=>{const s=o.from>o.to,a=o.to<=i.from;o.from>i.from&&a&&s&&(i.from+=1)}),i.from>=e&&(e+=1),r.push(i)}),r}function Tle(t){return t.forEach((e,r)=>{t.slice(r+1).forEach(i=>{const o=i.from<i.to;i.from>e.from&&o&&(i.from-=1)})}),t}function _M(t,e,r){const n=Ele(t,Rle(t,e,r));return Tle(n)}function tl(t,e,r){_le(t,e),e.set(t,r)}function _le(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xt(t,e){return t.get(YW(t,e))}function Us(t,e,r){return t.set(YW(t,e),r),r}function YW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Uh=new WeakMap,zs=new WeakMap,xn=new WeakMap,Bg=new WeakMap,LS=new WeakMap,$S=new WeakMap,jg=new WeakMap;class tD{constructor(e,r,n){tl(this,Uh,void 0),tl(this,zs,void 0),tl(this,xn,void 0),tl(this,Bg,[]),tl(this,LS,[]),tl(this,$S,void 0),tl(this,jg,[]),Us(Uh,this,e),Us(zs,this,r),Us(xn,this,n)}setRemovedHfIndexes(e){return Us(jg,this,e.map(r=>{const n=xt(zs,this).getVisualFromPhysicalIndex(r);return this.getHfIndexFromVisualIndex(n)})),xt(jg,this)}getRemovedHfIndexes(){return xt(jg,this)}getHfIndexFromVisualIndex(e){const r=xt(zs,this).getIndexesSequence(),n=xt(zs,this).getNotTrimmedIndexes();return r.indexOf(n[e],e)}syncMoves(e){const n=`move${Bi(xt(Uh,this))}s`;xt(xn,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&xt(xn,this).getEngine()[n](xt(xn,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,r,n){n!==!1&&(Us(LS,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),Us($S,this,this.getHfIndexFromVisualIndex(r)))}calculateAndSyncMoves(e,r){if(xt(xn,this).isPerformingUndoRedo()||e===!1||r===!1)return;const n=_M(xt(LS,this),xt($S,this),xt(zs,this).getNumberOfIndexes());xt(xn,this).getSheetId()===null?xt(xn,this).getPostponeAction(()=>this.syncMoves(n)):this.syncMoves(n)}getIndexesChangeSyncMethod(){const e=`set${Bi(xt(Uh,this))}Order`;return r=>{if(xt(xn,this).isPerformingUndoRedo())return;const n=xt(zs,this).getIndexesSequence();if(r==="update"&&n.length>0){const i=xt(Bg,this).map(l=>n.indexOf(l)),o=xt(xn,this).getEngine().getSheetDimensions(xt(xn,this).getSheetId());let s;xt(Uh,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);xt(xn,this).getEngine()[e](xt(xn,this).getSheetId(),i)}Us(Bg,this,n)}}init(){Us(Bg,this,xt(zs,this).getIndexesSequence())}}function rl(t,e,r){Mle(t,e),e.set(t,r)}function Mle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jo(t,e){return t.get(GW(t,e))}function nl(t,e,r){return t.set(GW(t,e),r),r}function GW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ug=new WeakMap,zg=new WeakMap,FS=new WeakMap,VS=new WeakMap,WS=new WeakMap,BS=new WeakMap,jS=new WeakMap;class Ple{constructor(e,r,n){rl(this,Ug,void 0),rl(this,zg,void 0),rl(this,FS,void 0),rl(this,VS,!1),rl(this,WS,!1),rl(this,BS,null),rl(this,jS,null),nl(Ug,this,new tD("row",e,this)),nl(zg,this,new tD("column",r,this)),nl(FS,this,n)}getForAxis(e){return e==="row"?Jo(Ug,this):Jo(zg,this)}setPerformUndo(e){nl(VS,this,e)}setPerformRedo(e){nl(WS,this,e)}isPerformingUndoRedo(){return Jo(VS,this)||Jo(WS,this)}getSheetId(){return Jo(jS,this)}getEngine(){return Jo(BS,this)}getPostponeAction(){return Jo(FS,this)}setupSyncEndpoint(e,r){nl(BS,this,e),nl(jS,this,r),Jo(Ug,this).init(),Jo(zg,this).init()}}function Ile(t,e){qW(t,e),e.add(t)}function il(t,e,r){return(e=Ole(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ole(t){var e=xle(t,"string");return typeof e=="symbol"?e:e+""}function xle(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function US(t,e,r){qW(t,e),e.set(t,r)}function qW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ca(t,e,r){return t.set(Qe(t,e),r),r}function Dl(t,e){return t.get(Qe(t,e))}function Qe(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Br="formulas",Ale=["maxRows","maxColumns","language"],Hle=260;fe.getSingleton().register("afterNamedExpressionAdded");fe.getSingleton().register("afterNamedExpressionRemoved");fe.getSingleton().register("afterSheetAdded");fe.getSingleton().register("afterSheetRemoved");fe.getSingleton().register("afterSheetRenamed");fe.getSingleton().register("afterFormulasValuesUpdate");const Bc=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var Ps=new WeakMap,Zw=new WeakMap,zh=new WeakMap,rt=new WeakSet;class Nle extends nt{constructor(){var e;super(...arguments),e=this,Ile(this,rt),US(this,Ps,!1),US(this,Zw,!1),US(this,zh,[["valuesUpdated",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qe(rt,e,Xle).call(e,...n)}],["namedExpressionAdded",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qe(rt,e,Zle).call(e,...n)}],["namedExpressionRemoved",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qe(rt,e,Jle).call(e,...n)}],["sheetAdded",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qe(rt,e,Qle).call(e,...n)}],["sheetRenamed",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qe(rt,e,eue).call(e,...n)}],["sheetRemoved",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qe(rt,e,tue).call(e,...n)}]]),il(this,"staticRegister",Gi("formulas")),il(this,"engine",null),il(this,"sheetId",null),il(this,"sheetName",null),il(this,"indexSyncer",null),il(this,"rowAxisSyncer",null),il(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return Br}static get PLUGIN_PRIORITY(){return Hle}static get SETTING_KEYS(){return[Br,...Ale]}isEnabled(){return!!this.hot.getSettings()[Br]}enablePlugin(){var e,r=this;if(!this.enabled){if(this.engine=(e=fle(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){it("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.");return}if(this.sheetName!==null&&!this.engine.doesSheetExist(this.sheetName)){const n=this.addSheet(this.sheetName,this.hot.getSourceDataArray());n!==!1&&Qe(rt,this,Sd).call(this,n)}this.addHook("beforeLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,rD).call(r,...i)}),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,nD).call(r,...i)}),this.addHook("beforeUpdateData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,rD).call(r,...i)}),this.addHook("afterUpdateData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,nD).call(r,...i)}),this.addHook("modifyData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,$le).call(r,...i)}),this.addHook("modifySourceData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Fle).call(r,...i)}),this.addHook("beforeValidate",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Dle).call(r,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Vle).call(r,...i)}),this.addHook("afterSetDataAtCell",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,iD).call(r,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,iD).call(r,...i)}),this.addHook("beforeCreateRow",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Wle).call(r,...i)}),this.addHook("beforeCreateCol",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Ble).call(r,...i)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,zle).call(r,...i)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Yle).call(r,...i)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,jle).call(r,...i)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Ule).call(r,...i)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Gle).call(r,...i)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,qle).call(r,...i)}),this.indexSyncer=new Ple(this.hot.rowIndexMapper,this.hot.columnIndexMapper,n=>{this.hot.addHookOnce("init",()=>{n()})}),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",(n,i,o,s)=>{this.rowAxisSyncer.storeMovesInformation(n,i,s)}),this.hot.addHook("beforeColumnMove",(n,i,o,s)=>{this.columnAxisSyncer.storeMovesInformation(n,i,s)}),this.hot.addHook("afterRowMove",(n,i,o,s,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("afterColumnMove",(n,i,o,s,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("beforeColumnFreeze",(n,i)=>{this.columnAxisSyncer.storeMovesInformation([n],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(n,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(n,i)=>{this.columnAxisSyncer.storeMovesInformation([n],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(n,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Lle).call(r,...i)}),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,Kle).call(r,...i)}),this.addHook("beforeAutofill",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Qe(rt,r,kle).call(r,...i)}),Dl(zh,this).forEach(n=>{let[i,o]=n;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){Dl(zh,this).forEach(e=>{let[r,n]=e;return this.engine.off(r,n)}),eD(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const r=hle(this.hot.getSettings());dle(this.engine.getConfig(),r)&&this.engine.updateConfig(r);const n=this.hot.getSettings()[Br];if(pe(n)&&pe(n.sheetName)&&n.sheetName!==this.sheetName&&this.switchSheet(n.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[Br].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const o=this.addSheet(i??void 0,this.hot.getSourceDataArray());Qe(rt,this,Sd).call(this,o)}}super.updatePlugin(e)}destroy(){Dl(zh,this).forEach(e=>{var r;let[n,i]=e;return(r=this.engine)===null||r===void 0?void 0:r.off(n,i)}),Ca(zh,this,null),eD(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,r){if(pe(r)&&!J5(r))return it("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return it("Sheet with the provided name already exists."),!1;try{const n=this.engine.addSheet(e??void 0);return r&&this.engine.setSheetContent(this.engine.getSheetId(n),r),n}catch(n){return it(n.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){G0(`The sheet named \`${e}\` does not exist, switch aborted.`);return}Qe(rt,this,Sd).call(this,e);const r=this.engine.getSheetSerialized(this.sheetId);r.length>0&&this.hot.loadData(r,`${Bi(Br)}.switchSheet`)}getCellType(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),o=this.hot.toPhysicalColumn(r);return i!==null&&o!==null?this.engine.getCellType({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r)}):"EMPTY"}isFormulaCellType(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r)})}renderDependentSheets(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=new Set;e.forEach(i=>{var o;const s=i==null||(o=i.address)===null||o===void 0?void 0:o.sheet;s!==void 0&&(n.has(s)||n.add(s))}),QN(this.engine).forEach((i,o)=>{if((r||o!==this.sheetId)&&n.has(o)){var s;i.render(),(s=i.view)===null||s===void 0||s.adjustElementsSize()}})}validateDependentCells(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=o=>{var s;const{row:a,col:l,sheet:u}=(s=o==null?void 0:o.address)!==null&&s!==void 0?s:{};return pe(u)?`${u}:${a}x${l}`:""},i=new Set(r.map(o=>n(o)));e.forEach(o=>{var s,a;const{row:l,col:u}=(s=o.address)!==null&&s!==void 0?s:{};if(pe(l)===!1||pe(u)===!1||l>=this.hot.countRows()||u>=this.hot.countCols())return;const c=o==null||(a=o.address)===null||a===void 0?void 0:a.sheet,h=n(o);if(c!==void 0&&!i.has(h)){const d=QN(this.engine).get(c);if(!d)return;d.validateCell(d.getDataAtCell(l,u),d.getCellMeta(l,u),()=>{})}})}syncChangeWithEngine(e,r,n){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){it(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,r);return TM(n,o.type)&&(jW(n,o.dateFormat)?n=UW(n,o.dateFormat):ble(n)===!1&&(n=`'${n}`)),this.engine.setCellContents(i,n)}}function Sd(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function Dle(t,e,r){const n=this.hot.propToCol(r);if(this.isFormulaCellType(e,n)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId},o=this.hot.getCellMeta(e,n);let s=this.engine.getCellValue(i);return o.type==="date"&&tn(s)&&(s=zW(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function kle(t,e,r){const{row:n,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),{row:a,col:l}=r.getTopStartCorner(),{row:u,col:c}=r.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(n),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const f=this.engine.getFillRangeData(h,d),{row:g,col:w}=h.start,{row:v,col:b}=h.end,p=v-g+1,_=b-w+1;for(let O=0;O<f.length;O+=1)for(let T=0;T<f[O].length;T+=1){const M=f[O][T],P=g+O%p,G=w+T%_,j=this.hot.getCellMeta(P,G);TM(M,j.type)&&(M.startsWith("'")?f[O][T]=M.slice(1):this.isFormulaCellType(P,G,this.sheetId)===!1&&(f[O][T]=Sle(M,j.dateFormat)))}return f}function rD(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Bi(Br))||Ca(Zw,this,$t(this.hot.getSettings().data))}function Lle(){if(Dl(Zw,this)){this.switchSheet(this.sheetName);return}const t=this.hot.getSourceDataArray();t.forEach((r,n)=>{r.forEach((i,o)=>{const s=this.hot.getCellMeta(n,o,{skipMetaExtension:!0}),a=s.dateFormat;TM(i,s.type)&&(jW(i,a)?t[n][o]=UW(i,a):i.startsWith("=")||(t[n][o]=`'${i}`))})}),Ca(Ps,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),Ca(Ps,this,!1)}function nD(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(r.includes(Bi(Br)))return;const n=vle(this.engine,this.hot.getSettings()[Br].sheetName);if(Qe(rt,this,Sd).call(this,n),r!=="updateSettings")if(Dl(Zw,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){Ca(Ps,this,!0);const o=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(o),Ca(Ps,this,!1)}}}function $le(t,e,r,n){if(n!=="get"||Dl(Ps,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;const o=this.getCellType(i,e);if(o==="VALUE"||o==="EMPTY"){r.value=Cle(r.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s);const l=this.hot.getCellMeta(i,e,{skipMetaExtension:!0});l.type==="date"&&tn(a)&&(a=zW(a,l.dateFormat)),r.value=typeof a=="object"&&a!==null?a.value:a}function Fle(t,e,r,n){if(n!=="get"||Dl(Ps,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),o=this.hot.propToCol(e);if(i===null||o===null)return;const s=this.getCellType(i,o);if(s==="VALUE"||s==="EMPTY")return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(a.width===0&&a.height===0)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};r.value=this.engine.getCellSerialized(l)}function iD(t,e){if(Bc(e))return;const r=[],n=[],i=this.engine.batch(()=>{t.forEach(o=>{let[s,a,,l]=o;const u=this.hot.propToCol(a),c=this.hot.toPhysicalRow(s),h=this.hot.toPhysicalColumn(u),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId};c!==null&&h!==null?this.syncChangeWithEngine(s,u,l):r.push([s,u,l]),n.push({address:d})})});r.length&&this.hot.addHookOnce("afterChange",()=>{const o=this.engine.batch(()=>{r.forEach(s=>{let[a,l,u]=s;this.syncChangeWithEngine(a,l,u)})});this.renderDependentSheets(o,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,n)}function Vle(t,e){if(Bc(e))return;const r=[],n=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!tn(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){it(`Not possible to set source cell data at ${JSON.stringify(u)}`);return}n.push({address:u}),r.push(...this.engine.setCellContents(u,a))}),this.renderDependentSheets(r),this.validateDependentCells(r,n)}function Wle(t,e){let r=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(r=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[r,e]))return!1}function Ble(t,e){let r=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(r=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[r,e]))return!1}function jle(t,e,r){return this.rowAxisSyncer.setRemovedHfIndexes(r).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function Ule(t,e,r){return this.columnAxisSyncer.setRemovedHfIndexes(r).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function zle(t,e,r){if(Bc(r))return;const n=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(n)}function Yle(t,e,r){if(Bc(r))return;const n=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(n)}function Gle(t,e,r,n){if(Bc(n))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeRows(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function qle(t,e,r,n){if(Bc(n))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeColumns(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function Kle(t,e,r){var n;Ca(Ps,this,!0);const i=this.hot.getSourceDataArray(r,0,r+(((n=e.__children)===null||n===void 0?void 0:n.length)||0),this.hot.countSourceCols());Ca(Ps,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:r+s,sheet:this.sheetId},[[a]])})})}function Xle(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function Zle(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function Jle(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function Qle(t){this.hot.runHooks("afterSheetAdded",t)}function eue(t,e){Qe(rt,this,Sd).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function tue(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function rue(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let r=0;if(Array.isArray(e)){const[,n,,i]=e;n-i!==0&&(r=1)}return this.getTranslatedPhrase(o_,r)},callback(){const{from:e,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(e.col,r.col),0),i=Math.max(e.col,r.col),o=[];for(let l=n;l<=i;l+=1)o.push(l);t.hideColumns(o);const s=o[o.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function nue(t){const e=[];return{key:"hidden_columns_show",name(){const r=e.length>1?1:0;return this.getTranslatedPhrase(s_,r)},callback(){var r,n;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(r=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&r!==void 0?r:0,o=(n=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&n!==void 0?n:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countCols()||this.selectColumns(i,o)},disabled:!1,hidden(){const r=qe(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;e.length=0;const n=this.getSelectedRangeLast(),i=n.getTopStartCorner().col,o=n.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(g=>r.includes(g)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countCols()));else{const h=this.countCols()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return k(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function iue(t,e){KW(t,e),e.add(t)}function oue(t,e,r){KW(t,e),e.set(t,r)}function KW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ol(t,e){return t.get(Qs(t,e))}function oD(t,e,r){return t.set(Qs(t,e),r),r}function Qs(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("beforeHideColumns");fe.getSingleton().register("afterHideColumns");fe.getSingleton().register("beforeUnhideColumns");fe.getSingleton().register("afterUnhideColumns");const sD="hiddenColumns",sue=310;var ro=new WeakMap,sl=new WeakSet;class aue extends nt{constructor(){super(...arguments),iue(this,sl),oue(this,ro,null)}static get PLUGIN_KEY(){return sD}static get PLUGIN_PRIORITY(){return sue}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[sD]}enablePlugin(){var e=this;this.enabled||(oD(ro,this,new Mw),ol(ro,this).addLocalHook("init",()=>Qs(sl,this,fue).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ol(ro,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qs(sl,e,due).call(e,...n)}),this.addHook("afterGetCellMeta",(r,n,i)=>Qs(sl,this,uue).call(this,r,n,i)),this.addHook("modifyColWidth",(r,n)=>Qs(sl,this,lue).call(this,r,n),2),this.addHook("afterGetColHeader",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qs(sl,e,hue).call(e,...n)}),this.addHook("modifyCopyableRange",r=>Qs(sl,this,cue).call(this,r)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const r=this.getHiddenColumns(),n=this.isValidConfig(e);let i=r;const o=ol(ro,this).getValues().slice(),s=e.length>0;if(n&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));k(l,u=>{o[u]=!1}),i=Mn(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",r,i,n&&s)!==!1&&(n&&s&&ol(ro,this).setValues(o),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",r,i,n&&s,n&&i.length<r.length))}showColumn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.showColumns(r)}hideColumns(e){const r=this.getHiddenColumns(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeHideColumns",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{k(e,s=>{ol(ro,this).setValueAtIndex(this.hot.toPhysicalColumn(s),!0)})},!0),this.hot.runHooks("afterHideColumns",r,i,n,n&&i.length>r.length))}hideColumn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.hideColumns(r)}getHiddenColumns(){return qe(ol(ro,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return ol(ro,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const r=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(n=>Number.isInteger(n)&&n>=0&&n<r):!1}resetCellsMeta(){k(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){oD(ro,this,null),super.destroy()}}function lue(t,e){if(this.isHidden(e))return 0;if(this.getSetting("indicators")&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function uue(t,e,r){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(e)&&(r.skipColumnOnPaste=!0),this.isHidden(e-1))r.className=r.className||"",r.className.indexOf("afterHiddenColumn")===-1&&(r.className+=" afterHiddenColumn");else if(r.className){const n=r.className.split(" ");if(n.length>0){const i=n.indexOf("afterHiddenColumn");i>-1&&n.splice(i,1),r.className=n.join(" ")}}}function cue(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],r=(n,i,o,s)=>{e.push({startRow:n,endRow:i,startCol:o,endCol:s})};return k(t,n=>{let i=!0,o=0;Ce(n.startCol,n.endCol,s=>{this.isHidden(s)?(i||r(n.startRow,n.endRow,o,s-1),i=!0):(i&&(o=s),s===n.endCol&&r(n.startRow,n.endRow,o,s),i=!1)})}),e}function hue(t,e){if(!this.getSetting("indicators")||t<0)return;const r=[];t>=1&&this.isHidden(t-1)&&r.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&r.push("beforeHiddenColumn"),ie(e,r)}function due(t){t.items.push({name:Fe},rue(this),nue(this))}function fue(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function gue(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let r=0;if(Array.isArray(e)){const[n,,i]=e;n-i!==0&&(r=1)}return this.getTranslatedPhrase(a_,r)},callback(){const{from:e,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(e.row,r.row),0),i=Math.max(e.row,r.row),o=[];for(let l=n;l<=i;l+=1)o.push(l);t.hideRows(o);const s=o[o.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function mue(t){const e=[];return{key:"hidden_rows_show",name(){const r=e.length>1?1:0;return this.getTranslatedPhrase(l_,r)},callback(){var r,n;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(r=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&r!==void 0?r:0,o=(n=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&n!==void 0?n:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countRows()||this.selectRows(i,o)},disabled:!1,hidden(){const r=qe(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;e.length=0;const n=this.getSelectedRangeLast(),i=n.getTopStartCorner().row,o=n.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(g=>r.includes(g)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countRows()));else{const h=this.countRows()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return k(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function pue(t,e){XW(t,e),e.add(t)}function wue(t,e,r){XW(t,e),e.set(t,r)}function XW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function al(t,e){return t.get(ea(t,e))}function aD(t,e,r){return t.set(ea(t,e),r),r}function ea(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("beforeHideRows");fe.getSingleton().register("afterHideRows");fe.getSingleton().register("beforeUnhideRows");fe.getSingleton().register("afterUnhideRows");const lD="hiddenRows",vue=320;var no=new WeakMap,ll=new WeakSet;class yue extends nt{constructor(){super(...arguments),pue(this,ll),wue(this,no,null)}static get PLUGIN_KEY(){return lD}static get PLUGIN_PRIORITY(){return vue}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[lD]}enablePlugin(){var e=this;this.enabled||(aD(no,this,new Mw),al(no,this).addLocalHook("init",()=>ea(ll,this,Tue).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,al(no,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ea(ll,e,Eue).call(e,...n)}),this.addHook("afterGetCellMeta",(r,n,i)=>ea(ll,this,bue).call(this,r,n,i)),this.addHook("modifyRowHeight",(r,n)=>ea(ll,this,Cue).call(this,r,n)),this.addHook("afterGetRowHeader",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ea(ll,e,Rue).call(e,...n)}),this.addHook("modifyCopyableRange",r=>ea(ll,this,Sue).call(this,r)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const r=this.getHiddenRows(),n=this.isValidConfig(e);let i=r;const o=al(no,this).getValues().slice(),s=e.length>0;if(n&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));k(l,u=>{o[u]=!1}),i=Mn(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",r,i,n&&s)!==!1&&(n&&s&&al(no,this).setValues(o),this.hot.runHooks("afterUnhideRows",r,i,n&&s,n&&i.length<r.length))}showRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.showRows(r)}hideRows(e){const r=this.getHiddenRows(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeHideRows",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{k(e,s=>{al(no,this).setValueAtIndex(this.hot.toPhysicalRow(s),!0)})},!0),this.hot.runHooks("afterHideRows",r,i,n,n&&i.length>r.length))}hideRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.hideRows(r)}getHiddenRows(){return qe(al(no,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return al(no,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const r=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(n=>Number.isInteger(n)&&n>=0&&n<r):!1}resetCellsMeta(){k(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){aD(no,this,null),super.destroy()}}function Cue(t,e){return this.isHidden(e)?0:t}function bue(t,e,r){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(t)&&(r.skipRowOnPaste=!0),this.isHidden(t-1))r.className=r.className||"",r.className.indexOf("afterHiddenRow")===-1&&(r.className+=" afterHiddenRow");else if(r.className){const n=r.className.split(" ");if(n.length>0){const i=n.indexOf("afterHiddenRow");i>-1&&n.splice(i,1),r.className=n.join(" ")}}}function Sue(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],r=(n,i,o,s)=>{e.push({startRow:n,endRow:i,startCol:o,endCol:s})};return k(t,n=>{let i=!0,o=0;Ce(n.startRow,n.endRow,s=>{this.isHidden(s)?(i||r(o,s-1,n.startCol,n.endCol),i=!0):(i&&(o=s),s===n.endRow&&r(o,s,n.startCol,n.endCol),i=!1)})}),e}function Rue(t,e){if(!this.getSetting("indicators")||t<0)return;const r=[];t>=1&&this.isHidden(t-1)&&r.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&r.push("beforeHiddenRow"),ie(e,r)}function Eue(t){t.items.push({name:Fe},gue(this),mue(this))}function Tue(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function _ue(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(DT)},callback(e,r){const[{start:{col:n}}]=r;t.freezeColumn(n),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let r=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(r=!0),r}}}function Mue(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(kT)},callback(e,r){const[{start:{col:n}}]=r;t.unfreezeColumn(n),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let r=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(r=!0),r}}}function Pue(t,e){ZW(t,e),e.add(t)}function Iue(t,e,r){ZW(t,e),e.set(t,r)}function ZW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xE(t,e){return t.get(xp(t,e))}function zS(t,e,r){return t.set(xp(t,e),r),r}function xp(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("beforeColumnFreeze");fe.getSingleton().register("afterColumnFreeze");fe.getSingleton().register("beforeColumnUnfreeze");fe.getSingleton().register("afterColumnUnfreeze");const uD="manualColumnFreeze",Oue=110;var Cl=new WeakMap,YS=new WeakSet;class xue extends nt{constructor(){super(...arguments),Pue(this,YS),Iue(this,Cl,!1)}static get PLUGIN_KEY(){return uD}static get PLUGIN_PRIORITY(){return Oue}isEnabled(){return!!this.hot.getSettings()[uD]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>xp(YS,this,Aue).call(this,e)),this.addHook("beforeColumnMove",(e,r)=>xp(YS,this,Hue).call(this,e,r)),super.enablePlugin())}disablePlugin(){zS(Cl,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const r=this.hot.getSettings(),n=r.fixedColumnsStart<this.hot.countCols()&&e>r.fixedColumnsStart-1;xE(Cl,this)||zS(Cl,this,!0),this.hot.runHooks("beforeColumnFreeze",e,n)!==!1&&(n&&(this.hot.columnIndexMapper.moveIndexes(e,r.fixedColumnsStart),r._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,n))}unfreezeColumn(e){const r=this.hot.getSettings(),n=r.fixedColumnsStart>0&&e<=r.fixedColumnsStart-1;xE(Cl,this)||zS(Cl,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,n)!==!1&&(n&&(r._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,r.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,n))}}function Aue(t){t.items.push({name:"---------"},_ue(this),Mue(this))}function Hue(t,e){if(xE(Cl,this)){const r=this.hot.getSettings().fixedColumnsStart;if(e<r||t.some(n=>n<r))return!1}}function Yg(t,e,r){return(e=Nue(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nue(t){var e=Due(t,"string");return typeof e=="symbol"?e:e+""}function Due(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const GS=0,cD=1,hD=2,ku="px";let JW=class{constructor(e){Yg(this,"hot",void 0),Yg(this,"_element",null),Yg(this,"state",GS),Yg(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=hD}build(){this.state===GS&&(this._element=this.hot.rootDocument.createElement("div"),this.state=cD)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=GS}isAppended(){return this.state===hD}isBuilt(){return this.state>=cD}setPosition(e,r){tn(e)&&(this._element.style.top=e+ku),tn(r)&&(this._element.style[this.inlineProperty]=r+ku)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,r){tn(e)&&(this._element.style.width=e+ku),tn(r)&&(this._element.style.height=r+ku)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,r){tn(e)&&(this._element.style.marginTop=e+ku),tn(r)&&(this._element.style[`margin${Bi(this.inlineProperty)}`]=r+ku)}getOffset(){const e=this._element.style,r=`margin${Bi(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[r]?parseInt(e[r],10):0}}};const kue="ht__manualColumnMove--backlight";let Lue=class extends JW{build(){super.build(),ie(this._element,kue)}};const $ue="ht__manualColumnMove--guideline";let Fue=class extends JW{build(){super.build(),ie(this._element,$ue)}};function Vue(t,e){QW(t,e),e.add(t)}function Ri(t,e,r){QW(t,e),e.set(t,r)}function QW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sn(t,e,r){return t.set(ta(t,e),r),r}function ye(t,e){return t.get(ta(t,e))}function ta(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("beforeColumnMove");fe.getSingleton().register("afterColumnMove");const qS="manualColumnMove",Wue=120,dD="ht__manualColumnMove",Ap="show-ui",AE="on-moving--columns",HE="after-selection--columns";var Qr=new WeakMap,na=new WeakMap,vs=new WeakMap,Ym=new WeakMap,ha=new WeakMap,Jr=new WeakMap,Gg=new WeakMap,Qn=new WeakMap,Zu=new WeakMap,Hp=new WeakMap,Rd=new WeakMap,ul=new WeakSet;class Bue extends nt{constructor(){super(...arguments),Vue(this,ul),Ri(this,Qr,new Lue(this.hot)),Ri(this,na,new Fue(this.hot)),Ri(this,vs,[]),Ri(this,Ym,0),Ri(this,ha,!1),Ri(this,Jr,{}),Ri(this,Gg,void 0),Ri(this,Qn,void 0),Ri(this,Zu,void 0),Ri(this,Hp,void 0),Ri(this,Rd,void 0)}static get PLUGIN_KEY(){return qS}static get PLUGIN_PRIORITY(){return Wue}isEnabled(){return!!this.hot.getSettings()[qS]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ta(ul,e,jue).call(e,...n)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ta(ul,e,zue).call(e,...n)}),this.addHook("afterScrollVertically",()=>ta(ul,this,Gue).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ta(ul,e,que).call(e,...n)}),this.buildPluginUI(),this.registerEvents(),ie(this.hot.rootElement,dD),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){Ee(this.hot.rootElement,dD),this.unregisterEvents(),ye(Qr,this).destroy(),ye(na,this).destroy(),super.disablePlugin()}moveColumn(e,r){return this.moveColumns([e],r)}moveColumns(e,r){const n=ye(Gg,this),i=this.isMovePossible(e,r),o=this.hot.runHooks("beforeColumnMove",e,r,n,i);if(Sn(Gg,this,void 0),o===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,r);const s=i&&this.isColumnOrderChanged(e,r);return this.hot.runHooks("afterColumnMove",e,r,n,i,s),s}dragColumn(e,r){return this.dragColumns([e],r)}dragColumns(e,r){const n=this.countFinalIndex(e,r);return Sn(Gg,this,r),this.moveColumns(e,n)}isMovePossible(e,r){const n=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+r>n,o=r<0,s=e.some(l=>l<0),a=e.some(l=>l>=n);return!(i||o||s||a)}isColumnOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}countFinalIndex(e,r){const n=Mn(e,(i,o)=>(o<r&&(i+=1),i),0);return r-n}getColumnsWidth(e,r){const n=this.hot.columnIndexMapper;let i=0;for(let o=e;o<=r;o+=1){const s=n.getRenderableFromVisualIndex(o);o<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:s!==null&&(i+=this.hot.view._wt.wtTable.getColumnWidth(s)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[qS];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const r=this.persistentStateLoad();r.length&&this.moveColumns(r,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,r){const n=[];return Ce(e,r,i=>{n.push(i)}),n}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(ye(Qn,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const r=this.hot.view._wt.wtTable,n=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof n.scrollX=="number"?n.scrollX:n.scrollLeft;let o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,ye(Qn,this)-1);const s=r.hider.offsetWidth,a=r.TBODY.offsetLeft,l=ye(Qr,this).getOffset().start,u=ye(Qr,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const g=this.hot.rootWindow,w=nr(this.hot.rootElement),v=g.innerWidth-ye(Zu,this)-w;h=g.innerWidth-ye(Jr,this).eventPageX-v-(n.scrollX===void 0?i:0)}else h=ye(Jr,this).eventPageX-(ye(Zu,this)-(n.scrollX===void 0?i:0));if(ye(Hp,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(ye(Qn,this))&&(o+=i),o+=c,ye(Qn,this)<0)ye(Rd,this)>0?ye(Jr,this).col=0:ye(Jr,this).col=e>0?e-1:e;else if(ye(Jr,this).TD.offsetWidth/2+o<=h){const g=ye(Qn,this)>=ye(Ym,this)?ye(Ym,this)-1:ye(Qn,this);ye(Jr,this).col=g+1,o+=ye(Jr,this).TD.offsetWidth}else ye(Jr,this).col=ye(Qn,this);let d=h,f=o;h+u+l>=s?d=s-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),o>=s-1?f=s-1:f===0?f=1:n.scrollX!==void 0&&ye(Qn,this)<ye(Rd,this)&&(f-=ye(Zu,this)<=n.scrollX?ye(Zu,this):0),ye(Qr,this).setPosition(null,d),ye(na,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",r=>ta(ul,this,Uue).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>ta(ul,this,Yue).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){ye(Qr,this).build(),ye(na,this).build()}destroy(){ye(Qr,this).destroy(),ye(na,this).destroy(),super.destroy()}}function jue(t,e,r,n){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=_e(t.target,"sortAction");if(!s||!o||ye(ha,this)||t.button!==0||a){Sn(ha,this,!1),ye(vs,this).length=0,Ee(this.hot.rootElement,[AE,Ap]);return}const l=ye(na,this).isBuilt()&&!ye(na,this).isAppended(),u=ye(Qr,this).isBuilt()&&!ye(Qr,this).isAppended();l&&u&&(ye(na,this).appendTo(i.hider),ye(Qr,this).appendTo(i.hider));const{from:c,to:h}=s,d=Math.min(c.col,h.col),f=Math.max(c.col,h.col);if(e.row<0&&e.col>=d&&e.col<=f){n.column=!0,Sn(ha,this,!0);const g=r.firstChild?V3(t,r.firstChild).x:t.offsetX;ye(Jr,this).eventPageX=t.pageX,Sn(Qn,this,e.col),ye(Jr,this).TD=r,ye(Jr,this).col=e.col,Sn(vs,this,this.prepareColumnsToMoving(d,f)),Sn(Hp,this,!!this.hot.getSettings().rowHeaders),Sn(Ym,this,this.hot.countCols()),Sn(Rd,this,this.hot.getSettings().fixedColumnsStart),Sn(Zu,this,jr(this.hot.rootElement).left);const w=ye(Hp,this)?-1:0,v=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,b=e.col<ye(Rd,this),p=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),_=Math.abs(g-(this.hot.isRtl()?r.offsetWidth:0)),O=this.getColumnsWidth(d,e.col-1)+_,T=this.getColumnsWidth(w,d-1)+(b?p:0)+O;ye(Qr,this).setPosition(v,T),ye(Qr,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-v),ye(Qr,this).setOffset(null,-O),ie(this.hot.rootElement,AE)}else Ee(this.hot.rootElement,HE),Sn(ha,this,!1),ye(vs,this).length=0}function Uue(t){ye(ha,this)&&(ye(Jr,this).eventPageX=t.pageX,this.refreshPositions())}function zue(t,e,r,n){!this.hot.getSelectedRangeLast()||!ye(ha,this)||(ye(vs,this).indexOf(e.col)>-1?Ee(this.hot.rootElement,Ap):ie(this.hot.rootElement,Ap),n.row=!0,n.column=!0,n.cell=!0,Sn(Qn,this,e.col),ye(Jr,this).TD=r)}function Yue(){const t=ye(Jr,this).col,e=ye(vs,this).length;if(Sn(Qn,this,void 0),Sn(ha,this,!1),Ee(this.hot.rootElement,[AE,Ap,HE]),this.hot.selection.isSelectedByColumnHeader()&&ie(this.hot.rootElement,HE),e<1||t===void 0)return;const r=ye(vs,this)[0],n=this.hot.toPhysicalColumn(r),i=this.dragColumns(ye(vs,this),t);if(ye(vs,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualColumn(n),s=o+e-1;this.hot.selectColumns(o,s)}}function Gue(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,r=t.holder.scrollTop,n=e+r;ye(Qr,this).setPosition(n),ye(Qr,this).setSize(null,t.hider.offsetHeight-n)}function que(){this.moveBySettingsOrLoad()}function Kue(t,e){eB(t,e),e.add(t)}function Lr(t,e,r){eB(t,e),e.set(t,r)}function eB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jt(t,e,r){return t.set(Ai(t,e),r),r}function ge(t,e){return t.get(Ai(t,e))}function Ai(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Np="manualColumnResize",Xue=130,fD="manualColumnWidths";var us=new WeakMap,qg=new WeakMap,Fn=new WeakMap,Dp=new WeakMap,Eo=new WeakMap,Zue=new WeakMap,hc=new WeakMap,Kg=new WeakMap,gn=new WeakMap,is=new WeakMap,zl=new WeakMap,kp=new WeakMap,Ed=new WeakMap,Td=new WeakMap,Wn=new WeakMap,_d=new WeakMap,io=new WeakSet;class Jue extends nt{static get PLUGIN_KEY(){return Np}static get PLUGIN_PRIORITY(){return Xue}constructor(e){super(e),Kue(this,io),Lr(this,us,null),Lr(this,qg,null),Lr(this,Fn,[]),Lr(this,Dp,null),Lr(this,Eo,null),Lr(this,Zue,null),Lr(this,hc,null),Lr(this,Kg,null),Lr(this,gn,this.hot.rootDocument.createElement("DIV")),Lr(this,is,this.hot.rootDocument.createElement("DIV")),Lr(this,zl,null),Lr(this,kp,!1),Lr(this,Ed,0),Lr(this,Td,null),Lr(this,Wn,void 0),Lr(this,_d,void 0),ie(ge(gn,this),"manualColumnResizer"),ie(ge(is,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Np]}enablePlugin(){var e=this;this.enabled||(Jt(Wn,this,new Ta),ge(Wn,this).addLocalHook("init",()=>Ai(io,this,Que).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ge(Wn,this)),this.addHook("modifyColWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Ai(io,e,oce).call(e,...n)},1),this.addHook("beforeStretchingColumnWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Ai(io,e,sce).call(e,...n)},1),this.addHook("beforeColumnResize",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Ai(io,e,ace).call(e,...n)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Jt(_d,this,ge(Wn,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",fD,ge(Wn,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",fD,e),e.value}setManualSize(e,r){const n=Math.max(r,20),i=this.hot.toPhysicalColumn(e);return ge(Wn,this).setValueAtIndex(i,n),n}clearManualSize(e){const r=this.hot.toPhysicalColumn(e);ge(Wn,this).setValueAtIndex(r,null)}setupHandlePosition(e){if(!e.parentNode)return;Jt(us,this,e);const{_wt:r}=this.hot.view,n=r.wtTable.getCoords(ge(us,this)),i=n.col;if(i<0)return;const o=fr(ge(us,this)),s=ge(us,this).getBoundingClientRect(),a=i<r.getSetting("fixedColumnsStart");let l;a&&(l=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ge(us,this),n.row,n.col)),l||(l=r.wtOverlays.topOverlay.getRelativeCellPosition(ge(us,this),n.row,n.col)),Jt(qg,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),Jt(Fn,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();k(c,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;Ce(d,f,g=>{ge(Fn,this).includes(g)||ge(Fn,this).push(g)})})}ge(Fn,this).includes(ge(qg,this))||Jt(Fn,this,[ge(qg,this)]),Jt(Kg,this,l.start-6),Jt(hc,this,parseInt(s.width,10)),ge(gn,this).style.top=`${l.top}px`,ge(gn,this).style[this.inlineDir]=`${ge(Kg,this)+ge(hc,this)}px`,ge(gn,this).style.height=`${o}px`,this.hot.rootElement.appendChild(ge(gn,this))}refreshHandlePosition(){ge(gn,this).style[this.inlineDir]=`${ge(Kg,this)+ge(Dp,this)}px`}setupGuidePosition(){const e=parseInt(fr(ge(gn,this)),10),r=parseInt(ge(gn,this).style.top,10)+e,n=this.hot.view.getTableHeight();ie(ge(gn,this),"active"),ie(ge(is,this),"active"),ge(is,this).style.top=`${r}px`,this.refreshGuidePosition(),ge(is,this).style.height=`${n-e}px`,this.hot.rootElement.appendChild(ge(is,this))}refreshGuidePosition(){ge(is,this).style[this.inlineDir]=ge(gn,this).style[this.inlineDir]}hideHandleAndGuide(){Ee(ge(gn,this),"active"),Ee(ge(is,this),"active")}checkIfColumnHeader(e){const r=$l(e,["THEAD"],this.hot.rootElement),{topOverlay:n,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(r)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},r=(n,i)=>{const o=this.hot.runHooks("beforeColumnResize",ge(Eo,this),n,!0);o!==void 0&&Jt(Eo,this,o),this.setManualSize(n,ge(Eo,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ge(Eo,this),n,!0),i&&e()};ge(Ed,this)>=2&&(ge(Fn,this).length>1?(k(ge(Fn,this),i=>{r(i)}),e()):k(ge(Fn,this),i=>{r(i,!0)})),Jt(Ed,this,0),Jt(Td,this,null)}bindEvents(){const{rootWindow:e,rootElement:r}=this.hot;this.eventManager.addEventListener(r,"mouseover",n=>Ai(io,this,ece).call(this,n)),this.eventManager.addEventListener(r,"mousedown",n=>Ai(io,this,tce).call(this,n)),this.eventManager.addEventListener(e,"mousemove",n=>Ai(io,this,rce).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Ai(io,this,nce).call(this)),this.eventManager.addEventListener(ge(gn,this),"contextmenu",()=>Ai(io,this,ice).call(this))}destroy(){super.destroy()}}function Que(){const t=this.hot.getSettings()[Np],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((r,n)=>{ge(Wn,this).setValueAtIndex(n,r)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((r,n)=>{ge(Wn,this).setValueAtIndex(n,r)})},!0),Jt(_d,this,t)):t===!0&&Array.isArray(ge(_d,this))&&this.hot.batchExecution(()=>{ge(_d,this).forEach((r,n)=>{ge(Wn,this).setValueAtIndex(n,r)})},!0)}function ece(t){if(!T$(t.target)&&ge(kp,this)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const r=e.getAttribute("colspan");e&&(r===null||r==="1")&&(ge(zl,this)||this.setupHandlePosition(e))}}function tce(t){t.target.parentNode===this.hot.rootElement&&_e(t.target,"manualColumnResizer")&&(this.setupHandlePosition(ge(us,this)),this.setupGuidePosition(),Jt(zl,this,!0),ge(Td,this)===null&&(Jt(Td,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ge(Td,this))),Jt(Ed,this,ge(Ed,this)+1),this.startX=t.pageX,Jt(Eo,this,ge(hc,this)))}function rce(t){if(ge(zl,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();Jt(Dp,this,ge(hc,this)+e),k(ge(Fn,this),r=>{Jt(Eo,this,this.setManualSize(r,ge(Dp,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function nce(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(r,n)=>{this.hot.runHooks("beforeColumnResize",ge(Eo,this),r,!1),n&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ge(Eo,this),r,!1)};ge(zl,this)&&(this.hideHandleAndGuide(),Jt(zl,this,!1),ge(Eo,this)!==ge(hc,this)&&(ge(Fn,this).length>1?(k(ge(Fn,this),n=>{e(n)}),t()):k(ge(Fn,this),n=>{e(n,!0)})),this.setupHandlePosition(ge(us,this)))}function ice(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ge(gn,this)),this.hot.rootElement.removeChild(ge(is,this)),Jt(zl,this,!1),Jt(kp,this,!0),this.hot._registerImmediate(()=>{Jt(kp,this,!1)})}function oce(t,e){let r=t;if(this.enabled){const n=this.hot.toPhysicalColumn(e),i=ge(Wn,this).getValueAtIndex(n);this.hot.getSettings()[Np]&&i&&(r=i)}return r}function sce(t,e){const r=ge(Wn,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof r=="number"?r:t}function ace(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function KS(t,e,r){return(e=lce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lce(t){var e=uce(t,"string");return typeof e=="symbol"?e:e+""}function uce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const XS=0,gD=1,mD=2,Lu="px";let tB=class{constructor(e){KS(this,"hot",void 0),KS(this,"_element",null),KS(this,"state",XS),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=mD}build(){this.state===XS&&(this._element=this.hot.rootDocument.createElement("div"),this.state=gD)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=XS}isAppended(){return this.state===mD}isBuilt(){return this.state>=gD}setPosition(e,r){e!==void 0&&(this._element.style.top=e+Lu),r!==void 0&&(this._element.style.left=r+Lu)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,r){e&&(this._element.style.width=e+Lu),r&&(this._element.style.height=r+Lu)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,r){e&&(this._element.style.marginTop=e+Lu),r&&(this._element.style.marginLeft=r+Lu)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}};const cce="ht__manualRowMove--backlight";class hce extends tB{build(){super.build(),ie(this._element,cce)}}const dce="ht__manualRowMove--guideline";class fce extends tB{build(){super.build(),ie(this._element,dce)}}function gce(t,e){rB(t,e),e.add(t)}function $u(t,e,r){rB(t,e),e.set(t,r)}function rB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xl(t,e,r){return t.set(ra(t,e),r),r}function xe(t,e){return t.get(ra(t,e))}function ra(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("beforeRowMove");fe.getSingleton().register("afterRowMove");const ZS="manualRowMove",mce=140,pD="ht__manualRowMove",Lp="show-ui",NE="on-moving--rows",DE="after-selection--rows";var en=new WeakMap,ia=new WeakMap,ys=new WeakMap,da=new WeakMap,Rn=new WeakMap,Xg=new WeakMap,cl=new WeakSet;class pce extends nt{constructor(){super(...arguments),gce(this,cl),$u(this,en,new hce(this.hot)),$u(this,ia,new fce(this.hot)),$u(this,ys,[]),$u(this,da,void 0),$u(this,Rn,{}),$u(this,Xg,void 0)}static get PLUGIN_KEY(){return ZS}static get PLUGIN_PRIORITY(){return mce}isEnabled(){return!!this.hot.getSettings()[ZS]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ra(cl,e,wce).call(e,...n)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ra(cl,e,yce).call(e,...n)}),this.addHook("afterScrollHorizontally",()=>ra(cl,this,bce).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ra(cl,e,Sce).call(e,...n)}),this.buildPluginUI(),this.registerEvents(),ie(this.hot.rootElement,pD),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){Ee(this.hot.rootElement,pD),this.unregisterEvents(),xe(en,this).destroy(),xe(ia,this).destroy(),super.disablePlugin()}moveRow(e,r){return this.moveRows([e],r)}moveRows(e,r){const n=xe(Xg,this),i=this.isMovePossible(e,r),o=this.hot.runHooks("beforeRowMove",e,r,n,i);if(xl(Xg,this,void 0),o===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,r);const s=i&&this.isRowOrderChanged(e,r);return this.hot.runHooks("afterRowMove",e,r,n,i,s),s}dragRow(e,r){return this.dragRows([e],r)}dragRows(e,r){const n=this.countFinalIndex(e,r);return xl(Xg,this,r),this.moveRows(e,n)}isMovePossible(e,r){const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+r>n,o=r<0,s=e.some(l=>l<0),a=e.some(l=>l>=n);return!(i||o||s||a)}isRowOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}countFinalIndex(e,r){const n=Mn(e,(i,o)=>(o<r&&(i+=1),i),0);return r-n}getRowsHeight(e,r){const n=this.hot.rowIndexMapper;let i=0;for(let o=e;o<=r;o++){const s=n.getRenderableFromVisualIndex(o);s!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(s)||this.hot.view.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[ZS];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const r=this.persistentStateLoad();r.length&&this.moveRows(r,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),r=[];if(!e)return r;const{from:n,to:i}=e,o=Math.min(n.row,i.row),s=Math.max(n.row,i.row);return Ce(o,s,a=>{r.push(a)}),r}refreshPositions(){const e=xe(Rn,this).coords,r=this.hot.getFirstFullyVisibleRow(),n=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&r>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r-1,-1)),this.isFixedRowBottom(e.row)&&n<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n+1,1),void 0,!0);const o=this.hot.view._wt.wtTable,s=xe(Rn,this).TD,a=this.hot.rootElement,l=jr(a),u=$d(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=xe(Rn,this).eventPageY-d+c,g=o.hider.offsetHeight,w=o.TBODY.offsetTop,v=xe(en,this).getOffset().top,b=xe(en,this).getSize().height,p=s.offsetHeight/2,_=s.offsetHeight;let O=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const T=f>=O+p;this.isFixedRowTop(e.row)&&(O+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?xe(Rn,this).row=r>0?r-1:r:T?(xe(Rn,this).row=e.row+1,O+=e.row===0?_-1:_):xe(Rn,this).row=e.row;let M=f,P=O;f+b+v>=g?M=g-b-v:f+v<w&&(M=w+Math.abs(v)),O>=g-1&&(P=g-1),xe(en,this).setPosition(M),xe(ia,this).setPosition(P)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",r=>ra(cl,this,vce).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>ra(cl,this,Cce).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){xe(en,this).build(),xe(ia,this).build()}destroy(){xe(en,this).destroy(),xe(ia,this).destroy(),super.destroy()}}function wce(t,e,r,n){const{wtTable:i,wtViewport:o}=this.hot.view._wt,s=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!s||xe(da,this)||t.button!==0){xl(da,this,!1),xe(ys,this).length=0,Ee(this.hot.rootElement,[NE,Lp]);return}const l=xe(ia,this).isBuilt()&&!xe(ia,this).isAppended(),u=xe(en,this).isBuilt()&&!xe(en,this).isAppended();l&&u&&(xe(ia,this).appendTo(i.hider),xe(en,this).appendTo(i.hider));const{from:c,to:h}=a,d=Math.min(c.row,h.row),f=Math.max(c.row,h.row);if(e.col<0&&e.row>=d&&e.row<=f){n.row=!0,xl(da,this,!0),xe(Rn,this).eventPageY=t.pageY,xe(Rn,this).coords=e,xe(Rn,this).TD=r,xl(ys,this,this.prepareRowsToMoving());const g=i.holder.scrollLeft+o.getRowHeaderWidth(),w=this.getRowsHeight(d,e.row-1)+(t.clientY-r.getBoundingClientRect().top);xe(en,this).setPosition(null,g),xe(en,this).setSize(i.hider.offsetWidth-g,this.getRowsHeight(d,f)),xe(en,this).setOffset(-w,null),ie(this.hot.rootElement,NE),this.refreshPositions()}else Ee(this.hot.rootElement,DE),xl(da,this,!1),xe(ys,this).length=0}function vce(t){xe(da,this)&&(xe(Rn,this).eventPageY=t.pageY,this.refreshPositions())}function yce(t,e,r,n){!this.hot.getSelectedRangeLast()||!xe(da,this)||(xe(ys,this).indexOf(e.row)>-1?Ee(this.hot.rootElement,Lp):ie(this.hot.rootElement,Lp),n.row=!0,n.column=!0,n.cell=!0,xe(Rn,this).coords=e,xe(Rn,this).TD=r)}function Cce(){const t=xe(Rn,this).row,e=xe(ys,this).length;if(xl(da,this,!1),Ee(this.hot.rootElement,[NE,Lp,DE]),this.hot.selection.isSelectedByRowHeader()&&ie(this.hot.rootElement,DE),e<1||t===void 0)return;const r=xe(ys,this)[0],n=this.hot.toPhysicalRow(r),i=this.dragRows(xe(ys,this),t);if(xe(ys,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualRow(n),s=o+e-1;this.hot.selectRows(o,s)}}function bce(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),r=t.holder.scrollLeft,n=e+r;xe(en,this).setPosition(null,n),xe(en,this).setSize(t.hider.offsetWidth-n)}function Sce(){this.moveBySettingsOrLoad()}function Rce(t,e){nB(t,e),e.add(t)}function $r(t,e,r){nB(t,e),e.set(t,r)}function nB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ut(t,e,r){return t.set(cs(t,e),r),r}function de(t,e){return t.get(cs(t,e))}function cs(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const $p="manualRowResize",Ece=30,wD="manualRowHeights";var po=new WeakMap,Zg=new WeakMap,Vn=new WeakMap,Md=new WeakMap,oa=new WeakMap,MM=new WeakMap,dc=new WeakMap,Jg=new WeakMap,Xr=new WeakMap,fo=new WeakMap,Yl=new WeakMap,Fp=new WeakMap,Pd=new WeakMap,Id=new WeakMap,Di=new WeakMap,Od=new WeakMap,Ys=new WeakSet;class Tce extends nt{static get PLUGIN_KEY(){return $p}static get PLUGIN_PRIORITY(){return Ece}constructor(e){super(e),Rce(this,Ys),$r(this,po,null),$r(this,Zg,null),$r(this,Vn,[]),$r(this,Md,null),$r(this,oa,null),$r(this,MM,null),$r(this,dc,null),$r(this,Jg,null),$r(this,Xr,this.hot.rootDocument.createElement("DIV")),$r(this,fo,this.hot.rootDocument.createElement("DIV")),$r(this,Yl,!1),$r(this,Fp,!1),$r(this,Pd,0),$r(this,Id,null),$r(this,Di,void 0),$r(this,Od,void 0),ie(de(Xr,this),"manualRowResizer"),ie(de(fo,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[$p]}enablePlugin(){this.enabled||(Ut(Di,this,new Ta),de(Di,this).addLocalHook("init",()=>cs(Ys,this,Ace).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,de(Di,this)),this.addHook("modifyRowHeight",(e,r)=>cs(Ys,this,xce).call(this,e,r)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Ut(Od,this,de(Di,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",wD,de(Di,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",wD,e),e.value}setManualSize(e,r){const n=this.hot.toPhysicalRow(e),i=Math.max(r,this.hot.view.getDefaultRowHeight());return de(Di,this).setValueAtIndex(n,i),i}getLastDesiredRowHeight(){return de(Md,this)}setupHandlePosition(e){Ut(po,this,e);const{view:r}=this.hot,{_wt:n}=r,i=n.wtTable.getCoords(de(po,this)),o=i.row;if(o<0)return;const s=nr(de(po,this)),a=de(po,this).getBoundingClientRect(),l=o<n.getSetting("fixedRowsTop"),u=o>=r.countNotHiddenRowIndexes(0,1)-n.getSetting("fixedRowsBottom");let c;l?c=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(de(po,this),i.row,i.col):u&&(c=n.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(de(po,this),i.row,i.col)),c||(c=n.wtOverlays.inlineStartOverlay.getRelativeCellPosition(de(po,this),i.row,i.col)),Ut(Zg,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),Ut(Vn,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();k(d,f=>{const g=f.getTopStartCorner().row,w=f.getBottomStartCorner().row;Ce(g,w,v=>{de(Vn,this).includes(v)||de(Vn,this).push(v)})})}de(Vn,this).includes(de(Zg,this))||Ut(Vn,this,[de(Zg,this)]),Ut(Jg,this,c.top-6),Ut(dc,this,parseInt(a.height,10)),de(Xr,this).style.top=`${de(Jg,this)+de(dc,this)}px`,de(Xr,this).style[this.inlineDir]=`${c.start}px`,de(Xr,this).style.width=`${s}px`,this.hot.rootElement.appendChild(de(Xr,this))}refreshHandlePosition(){de(Xr,this).style.top=`${de(Jg,this)+de(Md,this)}px`}setupGuidePosition(){const e=parseInt(nr(de(Xr,this)),10),r=parseInt(de(Xr,this).style[this.inlineDir],10)+e,n=this.hot.view.getTableWidth();ie(de(Xr,this),"active"),ie(de(fo,this),"active"),de(fo,this).style.top=de(Xr,this).style.top,de(fo,this).style[this.inlineDir]=`${r}px`,de(fo,this).style.width=`${n-e}px`,this.hot.rootElement.appendChild(de(fo,this))}refreshGuidePosition(){de(fo,this).style.top=de(Xr,this).style.top}hideHandleAndGuide(){Ee(de(Xr,this),"active"),Ee(de(fo,this),"active")}checkIfRowHeader(e){const r=$l(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:n,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.TBODY,i.clone.wtTable.TBODY,o.clone.wtTable.TBODY].includes(r)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const r=this.hot.view._wt.wtTable.getRowHeight(e);return r!==void 0&&de(oa,this)<r?r:de(oa,this)}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},r=(n,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!0);o!==void 0&&Ut(oa,this,o),this.setManualSize(n,de(oa,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!0),i&&e()};de(Pd,this)>=2&&(de(Vn,this).length>1?(k(de(Vn,this),i=>{r(i)}),e()):k(de(Vn,this),i=>{r(i,!0)})),Ut(Pd,this,0),Ut(Id,this,null)}bindEvents(){const{rootElement:e,rootWindow:r}=this.hot;this.eventManager.addEventListener(e,"mouseover",n=>cs(Ys,this,_ce).call(this,n)),this.eventManager.addEventListener(e,"mousedown",n=>cs(Ys,this,Mce).call(this,n)),this.eventManager.addEventListener(r,"mousemove",n=>cs(Ys,this,Pce).call(this,n)),this.eventManager.addEventListener(r,"mouseup",()=>cs(Ys,this,Ice).call(this)),this.eventManager.addEventListener(de(Xr,this),"contextmenu",()=>cs(Ys,this,Oce).call(this))}destroy(){super.destroy()}}function _ce(t){if(!T$(t.target)&&de(Fp,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(de(Yl,this)||this.setupHandlePosition(e))}}function Mce(t){_e(t.target,"manualRowResizer")&&(this.setupHandlePosition(de(po,this)),this.setupGuidePosition(),Ut(Yl,this,!0),de(Id,this)===null&&(Ut(Id,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(de(Id,this))),Ut(Pd,this,de(Pd,this)+1),Ut(MM,this,t.pageY),Ut(oa,this,de(dc,this)))}function Pce(t){de(Yl,this)&&(Ut(Md,this,de(dc,this)+(t.pageY-de(MM,this))),k(de(Vn,this),e=>{Ut(oa,this,this.setManualSize(e,de(Md,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function Ice(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(r,n)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!1),n&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!1)};de(Yl,this)&&(this.hideHandleAndGuide(),Ut(Yl,this,!1),de(oa,this)!==de(dc,this)&&(de(Vn,this).length>1?(k(de(Vn,this),n=>{e(n)}),t()):k(de(Vn,this),n=>{e(n,!0)})),this.setupHandlePosition(de(po,this)))}function Oce(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(de(Xr,this)),this.hot.rootElement.removeChild(de(fo,this)),Ut(Yl,this,!1),Ut(Fp,this,!0),this.hot._registerImmediate(()=>{Ut(Fp,this,!1)})}function xce(t,e){let r=t;if(this.enabled){const n=this.hot.toPhysicalRow(e),i=de(Di,this).getValueAtIndex(n);this.hot.getSettings()[$p]&&i&&(r=i)}return r}function Ace(){const t=this.hot.getSettings()[$p],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((r,n)=>{de(Di,this).setValueAtIndex(n,r)}):Array.isArray(t)?(t.forEach((r,n)=>{de(Di,this).setValueAtIndex(n,r)}),Ut(Od,this,t)):t===!0&&Array.isArray(de(Od,this))&&de(Od,this).forEach((r,n)=>{de(Di,this).setValueAtIndex(n,r)})},!0)}var vD={},yD;function Hce(){if(yD)return vD;yD=1;var t=Rw();return t("flatMap"),vD}Hce();var CD={},bD={},JS,SD;function Nce(){if(SD)return JS;SD=1;var t=pr(),e=vr(),r=xo(),n=c0();return JS=function(i,o){(!o||typeof i!="string")&&e(i);var s=n(i);return r(e(s!==void 0?t(s,i):i))},JS}var RD;function Dce(){if(RD)return bD;RD=1;var t=St(),e=pr(),r=Tn(),n=vr(),i=xo(),o=Nce(),s=f0(),a=_n(),l=ba(),u=g0(),c=Ra(),h=!l&&!u("flatMap",function(){}),d=!l&&!h&&c("flatMap",TypeError),f=l||h||d,g=s(function(){for(var w=this.iterator,v=this.mapper,b,p;;){if(p=this.inner)try{if(b=n(e(p.next,p.iterator)),!b.done)return b.value;this.inner=null}catch(_){a(w,"throw",_)}if(b=n(e(this.next,w)),this.done=!!b.done)return;try{this.inner=o(v(b.value,this.counter++),!1)}catch(_){a(w,"throw",_)}}});return t({target:"Iterator",proto:!0,real:!0,forced:f},{flatMap:function(v){n(this);try{r(v)}catch(b){a(this,"throw",b)}return d?e(d,this,v):new g(i(this),{mapper:v,inner:null})}}),bD}var ED;function kce(){return ED||(ED=1,Dce()),CD}kce();function Lce(t,e,r){$ce(t,e),e.set(t,r)}function $ce(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hl(t,e,r){return(e=Fce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fce(t){var e=Vce(t,"string");return typeof e=="symbol"?e:e+""}function Vce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function TD(t,e){return t.get(iB(t,e))}function Qg(t,e,r){return t.set(iB(t,e),r),r}function iB(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var dl=new WeakMap;class wo{constructor(e,r,n,i,o,s){hl(this,"row",void 0),hl(this,"col",void 0),hl(this,"rowspan",void 0),hl(this,"colspan",void 0),hl(this,"removed",!1),hl(this,"cellCoordsFactory",void 0),hl(this,"cellRangeFactory",void 0),Lce(this,dl,null),this.row=e,this.col=r,this.rowspan=n,this.colspan=i,this.cellCoordsFactory=o,this.cellRangeFactory=s}static NEGATIVE_VALUES_WARNING(e){let{row:r,col:n,rowspan:i,colspan:o}=e;return lt`The merged cell declared with {row: ${r}, col: ${n},\x20
|
|
750
|
+
rowspan: ${i}, colspan: ${o}} contains negative values, which is\x20
|
|
751
|
+
not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:r,col:n}=e;return lt`The merged cell declared at [${r}, ${n}] is positioned\x20
|
|
752
|
+
(or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:r,col:n}=e;return lt`The merged cell declared at [${r}, ${n}] has both "rowspan"\x20
|
|
753
|
+
and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:r,col:n}=e;return lt`The merged cell declared at [${r}, ${n}] has "rowspan"\x20
|
|
754
|
+
or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:r,col:n,rowspan:i,colspan:o}=e;return r<0||n<0||i<0||o<0}static isSingleCell(e){let{rowspan:r,colspan:n}=e;return n===1&&r===1}static containsZeroSpan(e){let{rowspan:r,colspan:n}=e;return n===0||r===0}static isOutOfBounds(e,r,n){return e.row<0||e.col<0||e.row>=r||e.row+e.rowspan-1>=r||e.col>=n||e.col+e.colspan-1>=n}normalize(e){const r=e.countRows(),n=e.countCols();this.row<0?this.row=0:this.row>r-1&&(this.row=r-1),this.col<0?this.col=0:this.col>n-1&&(this.col=n-1),this.row+this.rowspan>r-1&&(this.rowspan=r-this.row),this.col+this.colspan>n-1&&(this.colspan=n-this.col),Qg(dl,this,null)}includes(e,r){return this.row<=e&&this.col<=r&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=r}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,r){const n=e[0]||e[1],i=r+Math.abs(e[0]||e[1])-1,o=e[0]?"colspan":"rowspan",s=e[0]?"col":"row",a=Math.min(r,i),l=Math.max(r,i),u=this[s],c=this[s]+this[o]-1;if(u>=r&&(this[s]+=n),n>0)r<=c&&r>u&&(this[o]+=n);else if(n<0){if(a<=u&&l>=c)return this.removed=!0,Qg(dl,this,null),!1;if(u>=a&&u<=l){const h=l-u+1,d=Math.abs(n)-h;this[s]-=d+n,this[o]-=h}else if(u<=a&&c>=l)this[o]+=n;else if(u<=a&&c>=a&&c<l){const h=c-a+1;this[o]-=h}}return Qg(dl,this,null),!0}isFarther(e,r){return e?r==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:r==="up"?e.row>this.row:r==="right"?e.col+e.colspan-1<this.col+this.colspan-1:r==="left"?e.col>this.col:null:!0}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return TD(dl,this)||Qg(dl,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),TD(dl,this)}}function Wce(t,e){Bce(t,e),e.add(t)}function Bce(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function em(t,e,r){return(e=jce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jce(t){var e=Uce(t,"string");return typeof e=="symbol"?e:e+""}function Uce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fl(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Gs=new WeakSet;class Vp{constructor(e){Wce(this,Gs),em(this,"plugin",void 0),em(this,"mergedCells",[]),em(this,"mergedCellsMatrix",new Map),em(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:r,col:n}=e;return lt`The merged cell declared at [${r}, ${n}], overlaps\x20
|
|
755
|
+
with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
|
|
756
|
+
fix your setup.`}get(e,r){var n;return this.mergedCellsMatrix.has(e)&&(n=this.mergedCellsMatrix.get(e).get(r))!==null&&n!==void 0?n:!1}getByRange(e){const{row:r,col:n}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.mergedCells.length;let a=!1;for(let l=0;l<s;l++){const u=this.mergedCells[l],{row:c,col:h,rowspan:d,colspan:f}=u;if(c>=r&&c+d-1<=i&&h>=n&&h+f-1<=o){a=u;break}}return a}filterOverlappingMergeCells(e){const r=new Set;return this.mergedCells.forEach(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i;for(let u=o;u<o+l;u++)for(let c=s;c<s+a;c++)r.add(`r${u},c${c}`)}),e.filter(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i,u=new Set;let c=!1;for(let h=o;h<o+l;h++){for(let d=s;d<s+a;d++){const f=`r${h},c${d}`;if(r.has(f)){it(Vp.IS_OVERLAPPING_WARNING(i)),c=!0;break}u.add(f)}if(c)break}return c||r.add(...u),!c})}getWithinRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{row:n,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),a=[];for(let l=n;l<=o;l++)for(let u=i;u<=s;u++){const c=this.get(l,u);c&&(r||!r&&c.row===l&&c.col===u)&&a.push(c)}return a}add(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=e.row,i=e.col,o=e.rowspan,s=e.colspan,a=new wo(n,i,o,s,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(n,i),u=r?!1:this.isOverlapping(a);return!l&&!u?(this.hot&&a.normalize(this.hot),this.mergedCells.push(a),fl(Gs,this,_D).call(this,a),a):(u&&it(Vp.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,r){const n=this.get(e,r),i=n?this.mergedCells.indexOf(n):-1;return n&&i!==-1?(this.mergedCells.splice(i,1),fl(Gs,this,zce).call(this,n),n):!1}clear(){k(this.mergedCells,e=>{let{row:r,col:n,rowspan:i,colspan:o}=e;Ce(r,r+i,s=>{Ce(n,n+o,a=>{const l=this.hot.getCell(s,a);l&&(l.removeAttribute("rowspan"),l.removeAttribute("colspan"),l.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const r=e.getRange();for(let n=0;n<this.mergedCells.length;n++)if(this.mergedCells[n].getRange().overlaps(r))return!0;return!1}isFirstRenderableMergedCell(e,r){const n=this.get(e,r);if(!n)return!1;const{row:i,col:o,rowspan:s,colspan:a}=n,l=this.hot.view.getActiveOverlayName(),u=["top","top_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleRow(),c=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleColumn(),h=Xe(u,i,i+s-1),d=Xe(c,o,o+a-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(h,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(d,1)===r}getFirstRenderableCoords(e,r){const n=this.get(e,r);if(!n||this.isFirstRenderableMergedCell(e,r))return this.hot._createCellCoords(e,r);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(n.row,1),o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n.col,1);return this.hot._createCellCoords(i,o)}getStartMostColumnIndex(e,r){const n=fl(Gs,this,tm).call(this,e,"col",-1);let i=r;for(let o=0;o<n.length;o++)if(n[o]<=r){i=n[o];break}return i}getEndMostColumnIndex(e,r){const n=fl(Gs,this,tm).call(this,e,"col",1);let i=r;for(let o=0;o<n.length;o++)if(n[o]>=r){i=n[o];break}return i}getTopMostRowIndex(e,r){const n=fl(Gs,this,tm).call(this,e,"row",-1);let i=r;for(let o=0;o<n.length;o++)if(n[o]<=r){i=n[o];break}return i}getBottomMostRowIndex(e,r){const n=fl(Gs,this,tm).call(this,e,"row",1);let i=r;for(let o=0;o<n.length;o++)if(n[o]>=r){i=n[o];break}return i}shiftCollections(e,r,n){const i=[0,0];switch(e){case"right":i[0]+=n;break;case"left":i[0]-=n;break;case"down":i[1]+=n;break;case"up":i[1]-=n;break}const o=[];this.mergedCells.forEach(s=>{s.shift(i,r),s.removed&&o.push(s)}),o.forEach(s=>{this.mergedCells.splice(this.mergedCells.indexOf(s),1)}),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(s=>{fl(Gs,this,_D).call(this,s)})}}function tm(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const n=new Map,i=r===1?t.getTopStartCorner():t.getBottomEndCorner(),o=r===1?t.getBottomEndCorner():t.getTopStartCorner();for(let s=i.row;r===1?s<=o.row:s>=o.row;s+=r)for(let a=i.col;r===1?a<=o.col:a>=o.col;a+=r){const l=e==="row"?s:a,u=this.get(s,a);let c=l;u&&(c=r===1?u[e]+u[`${e}span`]-1:u[e]),n.has(l)||n.set(l,new Set),n.get(l).add(c)}return Array.from(new Set(Array.from(n.entries()).filter(s=>{let[,a]=s;return a.size===1}).flatMap(s=>{let[,a]=s;return Array.from(a)})))}function _D(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let r=t.col;r<t.col+t.colspan;r++)this.mergedCellsMatrix.has(e)||this.mergedCellsMatrix.set(e,new Map),this.mergedCellsMatrix.get(e).set(r,t)}function zce(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let r=t.col;r<t.col+t.colspan;r++)this.mergedCellsMatrix.get(e).delete(r)}function QS(t,e,r){return(e=Yce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yce(t){var e=Gce(t,"string");return typeof e=="symbol"?e:e+""}function Gce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class qce{constructor(e){QS(this,"plugin",void 0),QS(this,"mergedCellsCollection",void 0),QS(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,r){let n=null;return r[0]===e[0]&&r[1]===e[1]&&r[3]===e[3]?n="down":r[2]===e[2]&&r[1]===e[1]&&r[3]===e[3]?n="up":r[1]===e[1]&&r[2]===e[2]?n="right":n="left",n}snapDragArea(e,r,n,i){const o=r.slice(0),s=this.getAutofillSize(e,r,n),[a,l,u,c]=e,d=["up","down"].indexOf(n)>-1?u-a+1:c-l+1,f=Math.floor(s/d)*d,g=s-f,w=this.getFarthestCollection(e,r,n,i);if(w){if(n==="down"){const v=w.row+w.rowspan-a-g;o[2]+v>=this.plugin.hot.countRows()?o[2]-=g:o[2]+=g?v:0}else if(n==="right"){const v=w.col+w.colspan-l-g;o[3]+v>=this.plugin.hot.countCols()?o[3]-=g:o[3]+=g?v:0}else if(n==="up"){const v=u-g-w.row+1;o[0]+v<0?o[0]+=g:o[0]-=g?v:0}else if(n==="left"){const v=c-g-w.col+1;o[1]+v<0?o[1]+=g:o[1]-=g?v:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:n,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),gr(this.currentFillData,e)}getAutofillSize(e,r,n){const[i,o,s,a]=e,[l,u,c,h]=r;switch(n){case"up":return i-l;case"down":return c-s;case"left":return o-u;case"right":return h-a;default:return null}}getDragArea(e,r,n){const[i,o,s,a]=e,[l,u,c,h]=r;switch(n){case"up":return[l,u,i-1,a];case"down":{const d=this.mergedCellsCollection.get(c,a),f=d?d.rowspan-1:0;return[s+1,o,c+f,a]}case"left":return[l,u,s,o-1];case"right":{const d=this.mergedCellsCollection.get(c,a),f=d?d.colspan-1:0;return[i,a+f,c,h]}default:return null}}getFarthestCollection(e,r,n,i){const[o,s,a,l]=e,u=["up","down"].indexOf(n)>-1,c=u?a:l,h=u?o:s,d=this.getAutofillSize(e,r,n),f=u?a-o+1:l-s+1,g=Math.floor(d/f)*f,w=d-g;let v=null,b=null,p=null;switch(n){case"up":v="includesVertically",p=c-w+1;break;case"left":v="includesHorizontally",p=c-w+1;break;case"down":v="includesVertically",p=h+w-1;break;case"right":v="includesHorizontally",p=h+w-1;break}return k(i,_=>{_[v](p)&&_.isFarther(b,n)&&(b=_)}),b}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const r=this.getRangeFromChanges(e),n=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,o=(u,c)=>{switch(i){case"up":return u.row-c>=r.from.row;case"down":return u.row+u.rowspan-1+c<=r.to.row;case"left":return u.col-c>=r.from.column;case"right":return u.col+u.colspan-1+c<=r.to.column;default:return null}};let s=0,a=null,l=1;do for(let u=0;u<n.length;u+=1){if(a=n[u],s=l*this.currentFillData.cycleLength,o(a,s))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-s,colspan:a.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+s,colspan:a.colspan},!0);break}u===n.length-1&&(l+=1)}while(o(a,s));this.currentFillData=null,this.plugin.hot.render(),n.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const r={min:null,max:null},n={min:null,max:null};return k(e,i=>{const o=i[0],s=this.plugin.hot.propToCol(i[1]);(r.min===null||o<r.min)&&(r.min=o),(r.max===null||o>r.max)&&(r.max=o),(n.min===null||s<n.min)&&(n.min=s),(n.max===null||s>n.max)&&(n.max=s)}),{from:{row:r.min,column:n.min},to:{row:r.max,column:n.max}}}dragAreaOverlapsCollections(e,r,n){const i=this.getDragArea(e,r,n),[o,s,a,l]=i,u=this.plugin.hot._createCellCoords(o,s),c=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(u,u,c);if(this.mergedCellsCollection.getWithinRange(h,!0).length===0)return!1;const f=this.mergedCellsCollection.getWithinRange(h,!1);return f.length===0?!0:n==="up"||n==="down"?!f.every(g=>{let{colspan:w}=g;return w===h.getWidth()}):!f.every(g=>{let{rowspan:w}=g;return w===h.getHeight()})}}function eR(t,e,r){return(e=Kce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kce(t){var e=Xce(t,"string");return typeof e=="symbol"?e:e+""}function Xce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zce{constructor(e){eR(this,"plugin",void 0),eR(this,"hot",void 0),eR(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,r,n,i){const o=Math.min(n[0],n[2]),s=Math.min(n[1],n[3]),a=Math.max(n[0],n[2]),l=Math.max(n[1],n[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,r))return;const c=this.plugin.mergedCellsCollection.get(e,r);if(!c)return;const h=c.getLastRow(),d=c.getLastColumn();if(o<=c.row&&s<=c.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,r){const n=[];if(!r||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let o=0;o<e.colspan;o+=1)n.push(this.hot._createCellCoords(e.row+i,e.col+o));for(let i=0;i<n.length;i+=1){const o=[];for(let s=0;s<r.length;s+=1)o[s]=r[s].includes(n[i]);if(!o.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let r=0;r<=7;r+=1)e.push(`${this.fullySelectedMergedCellClassName}-${r}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function Jce(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();if(e){const r=t.mergedCellsCollection.get(e[0],e[1]);if(r.row===e[0]&&r.col===e[1]&&r.row+r.rowspan-1===e[2]&&r.col+r.colspan-1===e[3])return this.getTranslatedPhrase($T)}return this.getTranslatedPhrase(LT)},callback(){const e=this.getSelectedRangeLast();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:r,to:n}=e;t.toggleMerge(e),this.selectCell(r.row,r.col,n.row,n.col,!1)},disabled(){const e=this.getSelectedLast();return e?wo.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner():!0},hidden:!1}}function xd(t,e,r){return(e=Qce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qce(t){var e=ehe(t,"string");return typeof e=="symbol"?e:e+""}function ehe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class MD{constructor(e){xd(this,"data",void 0),xd(this,"next",null),xd(this,"prev",null),this.data=e}}class rm{constructor(){xd(this,"first",null),xd(this,"last",null)}push(e){const r=new MD(e);if(this.first===null)this.first=r,this.last=r;else{const n=this.last;this.last=r,r.prev=n,n.next=r}return r}unshift(e){const r=new MD(e);if(this.first===null)this.first=r,this.last=r;else{const n=this.first;this.first=r,r.next=n,n.prev=r}}inorder(e){let r=this.first;for(;r;){const n=e(r);if(r===this.last||n===!0)break;r=r.next}}remove(e){if(this.first===null)return!1;let r=this.first,n,i;for(;r;){if(r.data===e)return n=r.next,i=r.prev,n&&(n.prev=i),i&&(i.next=n),r===this.first&&(this.first=n),r===this.last&&(this.last=i),!0;r=r.next}return!1}hasCycle(){let e=this.first,r=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,r=r.next,e===r)return!0}}pop(){if(this.last===null)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(this.first===null)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){function e(n,i){i&&(e(i,i.next),i.next=n)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const r=this.first;this.first=this.last,this.last=r}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,r=this.first,n;for(;e;)n=e.next,e.next=r,r.prev=e,r=e,e=n;this.first.next=null,this.last.prev=null,n=this.first,this.first=r,this.last=n}}function the(t,e){oB(t,e),e.add(t)}function gl(t,e,r){oB(t,e),e.set(t,r)}function oB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function at(t,e){return t.get(Wp(t,e))}function An(t,e,r){return t.set(Wp(t,e),r),r}function Wp(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var oo=new WeakMap,so=new WeakMap,ao=new WeakMap,lo=new WeakMap,kE=new WeakMap,nm=new WeakMap,im=new WeakMap,tR=new WeakSet;class rhe{constructor(e){let{mergedCellsGetter:r,rowIndexMapper:n,columnIndexMapper:i}=e;the(this,tR),gl(this,oo,new rm),gl(this,so,new rm),gl(this,ao,null),gl(this,lo,null),gl(this,kE,null),gl(this,nm,null),gl(this,im,null),An(kE,this,r),An(nm,this,n),An(im,this,i)}getCurrentVerticalNode(){return at(lo,this).data}getFirstVerticalNode(){return at(so,this).first.data}getNextVerticalNode(){return at(lo,this).next.data}getPrevVerticalNode(){return at(lo,this).prev.data}getCurrentHorizontalNode(){return at(ao,this).data}getFirstHorizontalNode(){return at(oo,this).first.data}getNextHorizontalNode(){return at(ao,this).next.data}getPrevHorizontalNode(){return at(ao,this).prev.data}setPrevNodeAsActive(){An(lo,this,at(lo,this).prev),An(ao,this,at(ao,this).prev)}setNextNodeAsActive(){An(lo,this,at(lo,this).next),An(ao,this,at(ao,this).next)}buildFocusOrder(e){const r=e.getTopStartCorner(),n=e.getBottomEndCorner(),i=new WeakSet;An(oo,this,new rm);for(let s=r.row;s<=n.row;s++)if(!at(nm,this).isHidden(s))for(let a=r.col;a<=n.col;a++){if(at(im,this).isHidden(a))continue;const l=Wp(tR,this,PD).call(this,e,at(oo,this),i,s,a);l&&An(ao,this,l)}at(oo,this).first&&(at(oo,this).first.prev=at(oo,this).last,at(oo,this).last.next=at(oo,this).first);const o=new WeakSet;An(so,this,new rm);for(let s=r.col;s<=n.col;s++)if(!at(im,this).isHidden(s))for(let a=r.row;a<=n.row;a++){if(at(nm,this).isHidden(a))continue;const l=Wp(tR,this,PD).call(this,e,at(so,this),o,a,s);l&&An(lo,this,l)}at(so,this).first&&(at(so,this).first.prev=at(so,this).last,at(so,this).last.next=at(so,this).first)}setActiveNode(e,r){return at(oo,this).inorder(n=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=n.data;if(e>=i&&e<=o&&r>=s&&r<=a)return An(ao,this,n),!1}),at(so,this).inorder(n=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=n.data;if(e>=i&&e<=o&&r>=s&&r<=a)return An(lo,this,n),!1}),this}}function PD(t,e,r,n,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=at(kE,this).call(this,n,i);if(l&&r.has(l))return null;const u={colStart:i,colEnd:i,rowStart:n,rowEnd:n};if(l){if(r.add(l),l.row<o.row||l.row+l.rowspan-1>s.row||l.col<o.col||l.col+l.colspan-1>s.col)return null;u.colStart=l.col,u.colEnd=l.col+l.colspan-1,u.rowStart=l.row,u.rowEnd=l.row+l.rowspan-1}const c=e.push(u);return n===a.row&&i===a.col||l&&a.row>=l.row&&a.row<=l.row+l.rowspan-1&&a.col>=l.col&&a.col<=l.col+l.colspan-1?c:null}function sB(t,e,r){const{view:n,rowIndexMapper:i}=t,o=n.getStylesHandler(),s=n.getDefaultRowHeight();let a=0;for(let u=e;u<e+r;u++)if(!i.isHidden(u)){var l;a+=(l=t.getRowHeight(u))!==null&&l!==void 0?l:s,u===0&&!o.isClassicTheme()&&(a+=1)}return a}function nhe(t){const{hot:e}=t,{rowIndexMapper:r,columnIndexMapper:n}=e,i=new Map;function o(){}function s(a,l,u){const c=t.mergedCellsCollection.get(l,u);if(!Ve(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),cp()&&i.has(l)&&!e.getSettings().rowHeaders&&(a.style.height=`${i.get(l)}px`,i.delete(l)),a.style.display="";return}const{row:h,col:d,colspan:f,rowspan:g}=c,[w,v]=t.translateMergedCellToRenderable(h,g,d,f),b=t.getSetting("virtualized");if(cp()&&d===0&&!e.getSettings().rowHeaders){const A=sB(e,h,g);i.set(l,A/g)}const p=r.getRenderableFromVisualIndex(l),_=n.getRenderableFromVisualIndex(u),O=w-p+1,T=v-_+1;let M=r.getNearestNotHiddenIndex(h,1),P=n.getNearestNotHiddenIndex(d,1);if(b){const A=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(A)||(M=Math.max(M,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(A)||(P=Math.max(P,e.getFirstRenderedVisibleColumn()))}const G=Math.min(g,O),j=Math.min(f,T);M===l&&P===u?(a.setAttribute("rowspan",G),a.setAttribute("colspan",j)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:o,after:s}}function ihe(t,e){aB(t,e),e.add(t)}function om(t,e,r){aB(t,e),e.set(t,r)}function aB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rR(t,e,r){return(e=ohe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ohe(t){var e=she(t,"string");return typeof e=="symbol"?e:e+""}function she(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qd(t,e,r){return t.set(ft(t,e),r),r}function bt(t,e){return t.get(ft(t,e))}function ft(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}fe.getSingleton().register("beforeMergeCells");fe.getSingleton().register("afterMergeCells");fe.getSingleton().register("beforeUnmergeCells");fe.getSingleton().register("afterUnmergeCells");const LE="mergeCells",ahe=150,ID=LE;var si=new WeakMap,ai=new WeakMap,To=new WeakMap,OD=new WeakMap,vt=new WeakSet;class lhe extends nt{constructor(){super(...arguments),ihe(this,vt),rR(this,"mergedCellsCollection",null),rR(this,"autofillCalculations",null),rR(this,"selectionCalculations",null),om(this,si,null),om(this,ai,{row:0,col:0}),om(this,To,new rhe({mergedCellsGetter:(e,r)=>this.mergedCellsCollection.get(e,r),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),om(this,OD,nhe(this))}static get PLUGIN_KEY(){return LE}static get PLUGIN_PRIORITY(){return ahe}static get DEFAULT_SETTINGS(){return{[_V]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[LE]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new Vp(this),this.autofillCalculations=new qce(this),this.selectionCalculations=new Zce(this),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,uhe).call(e,...n)}),this.addHook("modifyTransformFocus",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,hhe).call(e,...n)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,dhe).call(e,...n)}),this.addHook("modifyTransformEnd",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,fhe).call(e,...n)}),this.addHook("beforeSelectionHighlightSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,ghe).call(e,...n)}),this.addHook("beforeSetRangeStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,AD).call(e,...n)}),this.addHook("beforeSetRangeStartOnly",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,AD).call(e,...n)}),this.addHook("beforeSelectionFocusSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,phe).call(e,...n)}),this.addHook("afterSelectionFocusSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,whe).call(e,...n)}),this.addHook("afterSelectionEnd",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,vhe).call(e,...n)}),this.addHook("modifyGetCellCoords",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,xD).call(e,...n)}),this.addHook("modifyGetCoordsElement",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,xD).call(e,...n)}),this.addHook("afterIsMultipleSelection",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,che).call(e,...n)}),this.addHook("afterRenderer",function(){return bt(OD,e).after(...arguments)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,mhe).call(e,...n)}),this.addHook("afterGetCellMeta",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,yhe).call(e,...n)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,Che).call(e,...n)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,bhe).call(e,...n)}),this.addHook("modifyAutofillRange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,She).call(e,...n)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,Rhe).call(e,...n)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,Ehe).call(e,...n)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,The).call(e,...n)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,_he).call(e,...n)}),this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,Mhe).call(e,...n)}),this.addHook("beforeDrawBorders",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,Phe).call(e,...n)}),this.addHook("afterDrawSelection",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,Ihe).call(e,...n)}),this.addHook("beforeRemoveCellClassNames",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,Ohe).call(e,...n)}),this.addHook("beforeBeginEditing",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,xhe).call(e,...n)}),this.addHook("modifyRowHeightByOverlayName",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ft(vt,e,Ahe).call(e,...n)}),this.addHook("beforeUndoStackChange",(r,n)=>{if(n==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!O$())return;const e=[];let r=[];this.mergedCellsCollection.mergedCells.forEach(n=>{const{row:i,rowspan:o}=n;for(let s=i+1;s<i+o;s++)r.push(s)}),r=[...new Set(r)],r.forEach(n=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(n);this.hot.view._wt.wtOverlays.getOverlays(!0).map(o=>(o==null?void 0:o.name)==="master"?o:o.clone.wtTable).forEach(o=>{const s=o.getRow(i);s&&(s.style.background=ap(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(n=>{var i;n.style.background=(i=ap(n,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?wo.containsNegativeValues(e)?(it(wo.NEGATIVE_VALUES_WARNING(e)),!1):wo.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(it(wo.IS_OUT_OF_BOUNDS_WARNING(e)),!1):wo.isSingleCell(e)?(it(wo.IS_SINGLE_CELL(e)),!1):wo.containsZeroSpan(e)?(it(wo.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),r=this.mergedCellsCollection.filterOverlappingMergeCells(e),n=[];r.forEach(i=>{const{row:o,col:s,rowspan:a,colspan:l}=i,u=this.hot._createCellCoords(o,s),c=this.hot._createCellCoords(o+a-1,s+l-1),h=this.hot._createCellRange(u,u,c);this.mergeRange(h,!0,!0);for(let d=o;d<o+a;d++)for(let f=s;f<s+l;f++)(d!==o||f!==s)&&n.push([d,f,null])}),n.length!==0&&this.hot.setDataAtCell(n,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:r,to:n}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(r.row,r.col,n.row,n.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:r,to:n}=e;this.unmergeRange(e,!0),this.hot.selectCell(r.row,r.col,n.row,n.col,!1)}mergeRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),s={row:i.row,col:i.col,rowspan:o.row-i.row+1,colspan:o.col-i.col+1},a=[];let l=null;return this.canMergeRange(s,r)?(this.hot.runHooks("beforeMergeCells",e,r),Ce(0,s.rowspan-1,c=>{Ce(0,s.colspan-1,h=>{let d=null;a[c]||(a[c]=[]),c===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s.row),this.hot.toPhysicalColumn(s.col)):this.hot.setCellMeta(s.row+c,s.col+h,"hidden",!0),a[c][h]=d})}),this.hot.setCellMeta(s.row,s.col,"spanned",!0),this.mergedCellsCollection.add(s,r)?(n?l=[s.row,s.col,a]:this.hot.populateFromArray(s.row,s.col,a,void 0,void 0,this.pluginName),r||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,s,r),l):!0):!1}unmergeRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.mergedCellsCollection.getWithinRange(e);n.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,r),k(n,i=>{this.mergedCellsCollection.remove(i.row,i.col),Ce(0,i.rowspan-1,o=>{Ce(0,i.colspan-1,s=>{this.hot.removeCellMeta(i.row+o,i.col+s,"hidden"),this.hot.removeCellMeta(i.row+o,i.col+s,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,r),this.hot.render())}toggleMerge(e){const{from:r,to:n}=e.clone().normalize(),i=this.mergedCellsCollection.get(r.row,r.col);i.row===r.row&&i.col===r.col&&i.row+i.rowspan-1===n.row&&i.col+i.colspan-1===n.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,r,n,i){const o=this.hot._createCellCoords(e,r),s=this.hot._createCellCoords(n,i);this.mergeRange(this.hot._createCellRange(o,o,s))}unmerge(e,r,n,i){const o=this.hot._createCellCoords(e,r),s=this.hot._createCellCoords(n,i);this.unmergeRange(this.hot._createCellRange(o,o,s))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const n=this.hot.getSelectedRangeLast();n&&!n.isSingleHeader()&&(this.toggleMerge(n),this.hot.render())},runOnlyIf:n=>!n.altKey,group:ID})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(ID)}modifyViewportRowStart(e,r){const n=this.hot.rowIndexMapper,i=n.getVisualFromRenderableIndex(e.startRow);for(let o=0;o<r;o+=1){const s=this.mergedCellsCollection.get(i,o);if(Ve(s)){const a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(s.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,r);return}}}}modifyViewportRowEnd(e,r){const n=this.hot.rowIndexMapper,i=n.getVisualFromRenderableIndex(e.endRow);for(let o=0;o<r;o+=1){const s=this.mergedCellsCollection.get(i,o);if(Ve(s)){const a=s.row+s.rowspan-1,l=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,r);return}}}}modifyViewportColumnStart(e,r){const n=this.hot.columnIndexMapper,i=n.getVisualFromRenderableIndex(e.startColumn);for(let o=0;o<r;o+=1){const s=this.mergedCellsCollection.get(o,i);if(Ve(s)){const a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(s.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,r);return}}}}modifyViewportColumnEnd(e,r){const n=this.hot.columnIndexMapper,i=n.getVisualFromRenderableIndex(e.endColumn);for(let o=0;o<r;o+=1){const s=this.mergedCellsCollection.get(o,i);if(Ve(s)){const a=s.col+s.colspan-1,l=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,r);return}}}}translateMergedCellToRenderable(e,r,n,i){const{rowIndexMapper:o,columnIndexMapper:s}=this.hot;let a,l;r===0?a=o.getNearestNotHiddenIndex(e,1):a=o.getNearestNotHiddenIndex(e+r-1,-1),i===0?l=s.getNearestNotHiddenIndex(n,1):l=s.getNearestNotHiddenIndex(n+i-1,-1);const u=e>=0?o.getRenderableFromVisualIndex(a):e,c=n>=0?s.getRenderableFromVisualIndex(l):n;return[u,c]}}function uhe(){this.generateFromSettings(),this.hot.render()}function che(t){if(t){const e=this.mergedCellsCollection.mergedCells,r=this.hot.getSelectedRangeLast(),n=r.getTopStartCorner(),i=r.getBottomEndCorner();for(let o=0;o<e.length;o+=1)if(n.row===e[o].row&&n.col===e[o].col&&i.row===e[o].row+e[o].rowspan-1&&i.col===e[o].col+e[o].colspan-1)return!1}return t}function hhe(t){bt(ai,this).row=t.row,bt(ai,this).col=t.col}function dhe(t){const e=this.hot.getSelectedRangeLast(),{highlight:r}=e,{columnIndexMapper:n,rowIndexMapper:i}=this.hot;bt(si,this)&&(i.getRenderableFromVisualIndex(bt(si,this).row)!==null&&(r.row=bt(si,this).row),n.getRenderableFromVisualIndex(bt(si,this).col)!==null&&(r.col=bt(si,this).col),Qd(si,this,null));const o=this.mergedCellsCollection.get(r.row,r.col);if(!o)return;const s=o.col,a=o.col+o.colspan-1;if(t.col<0){const c=r.col>=s&&r.col<=a?s-1:a,h=n.getNearestNotHiddenIndex(c,-1);h===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,r.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,r.col)-1,1)}else if(t.col>0){const c=r.col>=s&&r.col<=a?a+1:s,h=n.getNearestNotHiddenIndex(c,1);h===null?t.col=this.hot.view.countRenderableColumnsInRange(r.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,h)-1,1)}const l=o.row,u=o.row+o.rowspan-1;if(t.row<0){const c=r.row>=l&&r.row<=u?l-1:u,h=i.getNearestNotHiddenIndex(c,-1);h===null?t.row=-this.hot.view.countRenderableRowsInRange(0,r.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,r.row)-1,1)}else if(t.row>0){const c=r.row>=l&&r.row<=u?u+1:l,h=i.getNearestNotHiddenIndex(c,1);h===null?t.row=this.hot.view.countRenderableRowsInRange(r.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,h)-1,1)}}function fhe(t){const e=this.hot.getSelectedRangeLast(),r=e.clone(),{to:n}=e,{columnIndexMapper:i,rowIndexMapper:o}=this.hot,s=(a,l)=>{r.expand(this.hot._createCellCoords(a,l));for(let u=0;u<this.mergedCellsCollection.mergedCells.length;u+=1)r.expandByRange(this.mergedCellsCollection.mergedCells[u].getRange())};if(t.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,n.col)+t.col;s(n.row,a),e.getHorizontalDirection()==="E-W"&&r.getHorizontalDirection()==="E-W"&&(a=r.getTopStartCorner().col);const l=i.getNearestNotHiddenIndex(a,1);l!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,n.col)-1,1))}else if(t.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,n.col)+t.col;s(n.row,a),e.getHorizontalDirection()==="W-E"&&r.getHorizontalDirection()==="W-E"&&(a=r.getBottomEndCorner().col);const l=i.getNearestNotHiddenIndex(a,-1);l!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,l)-1,1))}if(t.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,n.row)+t.row;s(a,n.col),e.getVerticalDirection()==="S-N"&&r.getVerticalDirection()==="S-N"&&(a=r.getTopStartCorner().row);const l=o.getNearestNotHiddenIndex(a,1);l!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,n.row)-1,1))}else if(t.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,n.row)+t.row;s(a,n.col),e.getVerticalDirection()==="N-S"&&r.getVerticalDirection()==="N-S"&&(a=r.getBottomStartCorner().row);const l=o.getNearestNotHiddenIndex(a,-1);l!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,l)-1,1))}}function ghe(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){Qd(si,this,e.clone());return}for(let n=0;n<this.mergedCellsCollection.mergedCells.length;n+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[n].getRange(),!1);for(let n=0;n<this.mergedCellsCollection.mergedCells.length;n+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[n].getRange(),!1);const r=this.mergedCellsCollection.get(e.row,e.col);Qd(si,this,e.clone()),r&&e.assign(r)}function xD(t,e,r,n){if(t<0||e<0)return;const i=this.mergedCellsCollection.get(t,e);if(!i)return;const{row:o,col:s,colspan:a,rowspan:l}=i,u=o,c=s,h=o+l-1,d=s+a-1;if(n==="render"&&this.getSetting("virtualized")){const f=this.hot.view.getActiveOverlayName(),g=["top","top_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleRow(),w=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleColumn();return[Xe(g,u,h),Xe(w,c,d),Xe(this.hot.getLastRenderedVisibleRow(),u,h),Xe(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function mhe(t){t.items.push({name:"---------"},Jce(this))}function AD(){Qd(si,this,null)}function phe(){if(bt(si,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),r=t.getHorizontalDirection(),n=bt(si,this).clone().normalize();bt(To,this).setActiveNode(n.row,n.col),bt(ai,this).row>0||bt(ai,this).col>0?bt(To,this).setPrevNodeAsActive():(r==="E-W"&&bt(ai,this).col<0||e==="S-N"&&bt(ai,this).row<0)&&bt(To,this).setNextNodeAsActive()}function whe(t,e){const r=this.hot.getSelectedRangeLast(),{columnIndexMapper:n,rowIndexMapper:i}=this.hot;let o=null,s=null;if(bt(ai,this).col<0){const{rowEnd:a,colEnd:l}=bt(To,this).getPrevHorizontalNode();s=n.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(bt(ai,this).col>0){const{rowStart:a,colStart:l}=bt(To,this).getNextHorizontalNode();s=n.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(bt(ai,this).row<0){const{rowEnd:a,colEnd:l}=bt(To,this).getPrevVerticalNode();s=n.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(bt(ai,this).row>0){const{rowStart:a,colStart:l}=bt(To,this).getNextVerticalNode();s=n.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}if(o!==null||s!==null){const a=this.hot._createCellCoords(o,s),l=this.mergedCellsCollection.get(a.row,a.col),u=this.hot.selection.highlight.getFocus();t=a.row,e=a.col,l?r.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(l.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(l.col,1)}):r.highlight.assign(a),u.clear(),u.add(a).commit()}bt(To,this).setActiveNode(t,e),Qd(ai,this,{row:0,col:0})}function vhe(){this.hot.getSelectedRangeLast().isHeader()||bt(To,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function yhe(t,e,r){const n=this.mergedCellsCollection.get(t,e);n&&(n.row!==t||n.col!==e?r.copyable=!1:(r.rowspan=n.rowspan,r.colspan=n.colspan))}function Che(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function bhe(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function She(t,e){const r=this.autofillCalculations.getDirection(e,t);if(this.autofillCalculations.dragAreaOverlapsCollections(e,t,r))return e;const n=this.hot._createCellCoords(e[0],e[1]),i=this.hot._createCellCoords(e[2],e[3]),o=this.hot._createCellRange(n,n,i),s=this.mergedCellsCollection.getWithinRange(o);return s.length===0?t:this.autofillCalculations.snapDragArea(e,t,r,s)}function Rhe(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function Ehe(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function The(t,e,r){r!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function _he(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Mhe(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function Phe(t,e){if(e&&e==="area"){const r=this.hot.getSelectedRangeLast(),n=this.mergedCellsCollection.getWithinRange(r);k(n,i=>{r.getBottomEndCorner().row===i.getLastRow()&&r.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function Ihe(t,e,r,n){if(r)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,r,n)}function Ohe(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function xhe(t,e,r,n){if(!(n instanceof MouseEvent))return;const i=this.hot.getSelectedRangeLast(),o=this.mergedCellsCollection.getByRange(i);if(!o)return;const s=this.hot._createCellCoords(o.row,o.col),a=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);return this.hot.selection.getLayerLevel()===0&&i.isEqual(this.hot._createCellRange(s,s,a))}function Ahe(t,e,r){if(this.hot.getSettings().rowHeaders||r==="bottom"||r==="bottom_inline_start_corner")return t;let n,i;if(r==="master")n=this.hot.getFirstRenderedVisibleColumn(),i=this.hot.getLastRenderedVisibleColumn();else{const d=this.hot.view.getOverlayByName(r);n=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getFirstRenderedColumn()),i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(e,n))return t;const s=this.hot._createCellCoords(e,n),a=this.hot._createCellCoords(e,i),l=this.hot._createCellRange(s,s,a),u=this.mergedCellsCollection.getWithinRange(l,!0),c=u.reduce((d,f)=>{let{rowspan:g}=f;return Math.max(d,g)},1);let h=0;return u.length>1&&u[0].rowspan<c&&(h=c-u[0].rowspan),u.forEach(d=>{let{rowspan:f}=d,g=0;r==="top"||r==="top_inline_start_corner"?g=Math.min(c,this.hot.view.countNotHiddenFixedRowsTop()-e):g=f-h,t=Math.max(t??0,sB(this.hot,e,g))}),t}function Hhe(t,e){return function(r,n){const[,...i]=r,[,...o]=n;return function s(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.multiColumnSorting,g=(d.compareFunctionFactory?d.compareFunctionFactory:LV(u.type))(l,u,d)(c,h);if(g===_o){const w=a+1;if(typeof e[w]<"u")return s(w)}return g}(0)}}const lB="sort";function Nhe(t,e,r){const n=[];return r===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&n.push(`${lB}-${t.getIndexOfColumnInSortQueue(e)+1}`),n}function Dhe(t){const e=t.className.split(" "),r=new RegExp(`^${lB}-[0-9]{1,2}$`);return e.filter(n=>r.test(n))}function khe(t,e,r){return(e=Lhe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lhe(t){var e=$he(t,"string");return typeof e=="symbol"?e:e+""}function $he(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Bp="multiColumnSorting",Fhe=170,HD=Bp;kV(Bp,Hhe);class Vhe extends YV{constructor(){super(...arguments),khe(this,"pluginKey",Bp)}static get PLUGIN_KEY(){return Bp}static get PLUGIN_PRIORITY(){return Fhe}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,Rp)),!1},runOnlyIf:()=>{var e,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.isHeader()},relativeToGroup:_a,position:"before",group:HD})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(HD)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];super.updateHeaderClasses(e,...n),Ee(e,Dhe(e)),this.enabled!==!1&&ie(e,Nhe(...n))}onAfterOnCellMouseDown(e,r){fM(r.row,r.col,e)!==!1&&this.wasClickableHeaderClicked(e,r.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(r.col),this.sort(this.getNextSortConfig(r.col,Rp))):this.sort(this.getColumnNextConfig(r.col)))}}function ND(t,e,r){return(e=Whe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Whe(t){var e=Bhe(t,"string");return typeof e=="symbol"?e:e+""}function Bhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const jhe="multipleSelectionHandles",Uhe=160;class zhe extends nt{constructor(){super(...arguments),ND(this,"dragged",[]),ND(this,"lastSetCell",null)}static get PLUGIN_KEY(){return jhe}static get PLUGIN_PRIORITY(){return Uhe}isEnabled(){return ps()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:r}=this.hot;function n(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const o=e.dragged.indexOf(i);if(o===-1)return!1;o===0?e.dragged=e.dragged.slice(0,1):o===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(r,"touchstart",i=>{let o;if(_e(i.target,"topSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1;if(_e(i.target,"bottomSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(r,"touchend",i=>{if(_e(i.target,"topSelectionHandle-HitArea"))return n.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(_e(i.target,"bottomSelectionHandle-HitArea"))return n.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(r,"touchmove",i=>{const{rootDocument:o}=this.hot;let s,a,l,u,c,h;if(e.dragged.length===0)return;const d=o.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!d||d===e.lastSetCell||((d.nodeName==="TD"||d.nodeName==="TH")&&(s=e.hot.getCoords(d),s.col===-1&&(s.col=0),a=e.hot.getSelectedRangeLast(),l=a.getWidth(),u=a.getHeight(),c=a.getDirection(),l===1&&u===1&&e.hot.selection.setRangeEnd(s),h=e.getCurrentRangeCoords(a,s,e.touchStartRange.direction,c,e.dragged[0]),h.start!==null&&e.hot.selection.setRangeStart(h.start),e.hot.selection.setRangeEnd(h.end),e.lastSetCell=d),i.preventDefault())})}getCurrentRangeCoords(e,r,n,i,o){const s=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),u=e.getTopEndCorner();let c={start:null,end:null};switch(n){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":o==="top"?c={start:this.hot._createCellCoords(r.row,e.highlight.col),end:this.hot._createCellCoords(l.row,r.col)}:c={start:this.hot._createCellCoords(e.highlight.row,r.col),end:this.hot._createCellCoords(r.row,s.col)};break;case"SE-NW":o==="bottom"&&(c={start:this.hot._createCellCoords(a.row,r.col),end:this.hot._createCellCoords(r.row,s.col)});break}break;case"NW-SE":switch(i){case"NE-SW":o==="top"?c={start:r,end:l}:c.end=r;break;case"NW-SE":o==="top"?c={start:r,end:a}:c.end=r;break;case"SE-NW":o==="top"?c={start:r,end:s}:c.end=r;break;case"SW-NE":o==="top"?c={start:r,end:u}:c.end=r;break}break;case"SW-NE":switch(i){case"NW-SE":o==="bottom"?c={start:this.hot._createCellCoords(r.row,s.col),end:this.hot._createCellCoords(l.row,r.col)}:c={start:this.hot._createCellCoords(s.row,r.col),end:this.hot._createCellCoords(r.row,a.col)};break;case"SW-NE":o==="top"?c={start:this.hot._createCellCoords(e.highlight.row,r.col),end:this.hot._createCellCoords(r.row,a.col)}:c={start:this.hot._createCellCoords(r.row,s.col),end:this.hot._createCellCoords(s.row,r.col)};break;case"SE-NW":o==="bottom"?c={start:this.hot._createCellCoords(r.row,u.col),end:this.hot._createCellCoords(s.row,r.col)}:o==="top"&&(c={start:l,end:r});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":o==="top"&&(c.end=r);break;case"SE-NW":o==="top"?c.end=r:c={start:r,end:s};break}break}return c}isDragged(){return this.dragged.length>0}}function $E(){let{label:t="",colspan:e=1,origColspan:r=1,collapsible:n=!1,crossHiddenColumns:i=[],isCollapsed:o=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:u=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:r,collapsible:n,isCollapsed:o,crossHiddenColumns:i,isHidden:s,isRoot:a,isPlaceholder:l,headerClassNames:u}}function uB(){return{label:"",isPlaceholder:!0}}function Yhe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const r=[];if(e===0)return r;k(t,i=>{const o=[];let s=0;r.push(o),k(i,a=>{const l=$E();if(Ve(a)){const{label:c,colspan:h,headerClassName:d}=a;l.label=Ft(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h),typeof d=="string"&&(l.headerClassNames=[...d.split(" ")])}else l.label=Ft(a);s+=l.origColspan;let u=!1;if(s>=e&&(l.colspan=l.origColspan-(s-e),l.origColspan=l.colspan,u=!0),o.push(l),l.colspan>1)for(let c=0;c<l.colspan-1;c++)o.push(uB());return!u})});const n=Math.max(...qe(r,i=>i.length));return k(r,i=>{if(i.length<n){const o=qe(new Array(n-i.length),()=>$E());i.splice(i.length,0,...o)}}),r}function nR(t,e,r){Ghe(t,e),e.set(t,r)}function Ghe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ei(t,e){return t.get(cB(t,e))}function Yh(t,e,r){return t.set(cB(t,e),r),r}function cB(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const DD=["label","collapsible"];var Qo=new WeakMap,ml=new WeakMap,iR=new WeakMap;class qhe{constructor(){nR(this,Qo,[]),nR(this,ml,0),nR(this,iR,1/0)}setColumnsLimit(e){Yh(iR,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Yh(Qo,this,Yhe(e,Ei(iR,this))),Yh(ml,this,Ei(Qo,this).length)}getData(){return Ei(Qo,this)}mergeWith(e){k(e,r=>{let{row:n,col:i,...o}=r;const s=this.getHeaderSettings(n,i);s!==null&&gr(s,o,DD)})}map(e){k(Ei(Qo,this),r=>{k(r,n=>{const i=e({...n});Ve(i)&&gr(n,i,DD)})})}getHeaderSettings(e,r){var n;if(e>=Ei(ml,this)||e<0)return null;const i=Ei(Qo,this)[e];return Array.isArray(i)===!1||r>=i.length?null:(n=i[r])!==null&&n!==void 0?n:null}getHeadersSettings(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=Ei(ml,this)||e<0)return i;const o=Ei(Qo,this)[e];let s=0;for(let a=r;a<o.length;a++){const l=o[a];if(l.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(s+=l.colspan,i.push(l),l.colspan>1&&(a+=l.colspan-1),s===n)break;if(s>n)throw new Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return Ei(ml,this)}getColumnsCount(){return Ei(ml,this)>0?Ei(Qo,this)[0].length:0}clear(){Yh(Qo,this,[]),Yh(ml,this,0)}}function oR(t,e,r){return(e=Khe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Khe(t){var e=Xhe(t,"string");return typeof e=="symbol"?e:e+""}function Xhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const hB="DF-pre-order";function dB(t,e){let r=t.call(e,this);for(let n=0;n<this.childs.length;n++){if(r===!1)return!1;r=dB.call(this.childs[n],t,e)}return r}const Zhe="DF-post-order";function fB(t,e){for(let r=0;r<this.childs.length;r++)if(fB.call(this.childs[r],t,e)===!1)return!1;return t.call(e,this)}const gB="BF";function Jhe(t,e){const r=[this];function n(){if(r.length===0)return;const i=r.shift();r.push(...i.childs),t.call(e,i)!==!1&&n()}n()}const Qhe=gB,kD=new Map([[hB,dB],[Zhe,fB],[gB,Jhe]]);class jp{constructor(e){oR(this,"data",{}),oR(this,"parent",null),oR(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this;const r=new jp({...e.data});for(let n=0;n<e.childs.length;n++)r.addChild(this.cloneTree(e.childs[n]));return r}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let r=0;r<e.childs.length;r++)this.addChild(e.childs[r])}walkDown(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qhe;if(!kD.has(r))throw new Error(`Traversal strategy "${r}" does not exist`);kD.get(r).call(this,e,this)}walkUp(e){const r=this,n=i=>{e.call(r,i)!==!1&&i.parent!==null&&n(i.parent)};n(this)}}function sR(t,e,r){ede(t,e),e.set(t,r)}function ede(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kr(t,e){return t.get(mB(t,e))}function tde(t,e,r){return t.set(mB(t,e),r),r}function mB(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Fu=new WeakMap,pl=new WeakMap,Vu=new WeakMap;class rde{constructor(e){sR(this,Fu,new Map),sR(this,pl,new Map),sR(this,Vu,null),tde(Vu,this,e)}getRoots(){return Array.from(Kr(Fu,this).values())}getRootByColumn(e){let r;return Kr(pl,this).has(e)&&(r=Kr(Fu,this).get(Kr(pl,this).get(e))),r}getNode(e,r){const n=this.getRootByColumn(r);if(!n)return;const i=r-Kr(pl,this).get(r);let o=0,s;return n.walkDown(a=>{const{data:{origColspan:l,headerLevel:u}}=a;if(e===u){if(i>=o&&i<=o+l-1)return s=a,s.data.isRoot=r===s.data.columnIndex,!1;o+=l}}),s}rebuildTreeIndex(){let e=0;Kr(pl,this).clear(),k(Kr(Fu,this),r=>{let[,{data:{colspan:n}}]=r;for(let i=e;i<e+n;i++)Kr(pl,this).set(i,e);e+=n})}buildTree(){this.clear();const e=Kr(Vu,this).getColumnsCount();let r=0;for(;r<e;){const n=Kr(Vu,this).getHeaderSettings(0,r),i=new jp;Kr(Fu,this).set(r,i),this.buildLeaves(i,r,0,n.origColspan),r+=n.origColspan}this.rebuildTreeIndex()}buildLeaves(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const o=Kr(Vu,this).getHeadersSettings(n,r,i);n+=1,k(o,s=>{const a={...s,headerLevel:n-1,columnIndex:r};let l;n===1?(e.data=a,l=e):(l=new jp(a),e.addChild(l)),n<Kr(Vu,this).getLayersCount()&&this.buildLeaves(l,r,n,s.origColspan),r+=s.origColspan})}clear(){Kr(Fu,this).clear(),Kr(pl,this).clear()}}function pB(t,e){t.walkDown(r=>{let{data:n,childs:i}=r;if(!n.isHidden&&(e(n.columnIndex),i.length===0))for(let o=1;o<n.colspan;o++)e(n.columnIndex+o)})}function Up(t,e){let{childs:r}=t;if(r.length!==0)return r[0].data[e]}function zp(t){return Up(t,"origColspan")===t.data.origColspan}function PM(t){const{data:e,childs:r}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(zp(t))return PM(r[0]);e.isCollapsed=!1;const i=r.slice(1),o=new Set;let s=0;if(i.length>0)k(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,pB(a,u=>{o.add(u)})});else{const{colspan:a,origColspan:l,columnIndex:u}=e;s=l-a;for(let c=1;c<l;c++)o.add(u+c)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=s,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):zp(a)&&(l.isCollapsed=Up(a,"isCollapsed"))}),{rollbackModification:()=>IM(t),affectedColumns:Array.from(o),colspanCompensation:s}}function IM(t){var e;const{data:r,childs:n}=t;if(r.isCollapsed||r.isHidden||r.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(zp(t))return IM(n[0]);r.isCollapsed=!0;const o=n.slice(1),s=new Set;if(o.length>0)k(o,l=>{pB(l,u=>{s.add(u)}),l.data.clonedTree=l.cloneTree(),l.walkDown(u=>{let{data:c}=u;c.isHidden=!0})});else{const{origColspan:l,columnIndex:u}=r;for(let c=1;c<l;c++){const h=u+c;s.add(h)}}const a=r.colspan-((e=Up(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:u}=l;u.colspan-=a,u.colspan<=1?(u.colspan=1,u.isCollapsed=!0):zp(l)&&(u.isCollapsed=Up(l,"isCollapsed"))}),{rollbackModification:()=>PM(t),affectedColumns:Array.from(s),colspanCompensation:a}}function nde(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(lt`The passed node is not the last node on the tree. Only for\x20
|
|
757
|
+
the last node, the hide column modification can be applied.`);const{crossHiddenColumns:r}=t.data;if(r.includes(e))return;let n=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return n=!0,!1}),!n&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.push(e),o.colspan>1?o.colspan-=1:o.isHidden=!0})}function ide(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(lt`The passed node is not the last node on the tree. Only for\x20
|
|
758
|
+
the last node, the show column modification can be applied.`);const{crossHiddenColumns:r}=t.data;if(!r.includes(e))return;let n=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return n=!0,!1}),!n&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.splice(o.crossHiddenColumns.indexOf(e),1),!o.isHidden&&o.colspan<o.origColspan&&(o.colspan+=1),o.isHidden=!1})}const LD=new Map([["collapse",IM],["expand",PM],["hide-column",nde],["show-column",ide]]);function ode(t,e,r){if(!LD.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return LD.get(t)(e,r)}function sm(t){const e=[];return k(t,r=>{r.walkDown(n=>{const i=n.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=ade(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(uB());else{const f=sde(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function sde(t){const{crossHiddenColumns:e,...r}=$E(t);return r}function ade(t,e){let r;return Array.isArray(t[e])?r=t[e]:(r=[],t[e]=r),r}function aR(t,e,r){lde(t,e),e.set(t,r)}function lde(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gh(t,e,r){return t.set(wB(t,e),r),r}function Wt(t,e){return t.get(wB(t,e))}function wB(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var uo=new WeakMap,fn=new WeakMap,wl=new WeakMap;class ude{constructor(){aR(this,uo,new qhe),aR(this,fn,new rde(Wt(uo,this))),aR(this,wl,[[]])}setState(e){Wt(uo,this).setData(e);let r=!1;try{Wt(fn,this).buildTree()}catch{Wt(fn,this).clear(),Wt(uo,this).clear(),r=!0}return Gh(wl,this,sm(Wt(fn,this).getRoots())),r}setColumnsLimit(e){Wt(uo,this).setColumnsLimit(e)}mergeStateWith(e){const r=qe(e,n=>{let{row:i,...o}=n;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});Wt(uo,this).mergeWith(r),Wt(fn,this).buildTree(),Gh(wl,this,sm(Wt(fn,this).getRoots()))}mapState(e){Wt(uo,this).map(e),Wt(fn,this).buildTree(),Gh(wl,this,sm(Wt(fn,this).getRoots()))}mapNodes(e){return Mn(Wt(fn,this).getRoots(),(r,n)=>(n.walkDown(i=>{const o=e(i.data);o!==void 0&&r.push(o)}),r),[])}triggerNodeModification(e,r,n){r<0&&(r=this.rowCoordsToLevel(r));const i=Wt(fn,this).getNode(r,n);let o;return i&&(o=ode(e,i,n),Gh(wl,this,sm(Wt(fn,this).getRoots()))),o}triggerColumnModification(e,r){return this.triggerNodeModification(e,-1,r)}rowCoordsToLevel(e){if(e>=0)return null;const r=e+Math.max(this.getLayersCount(),1);return r<0?null:r}levelToRowCoords(e){if(e<0)return null;const r=e-Math.max(this.getLayersCount(),1);return r>=0?null:r}getHeaderSettings(e,r){var n,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(n=(i=Wt(wl,this)[e])===null||i===void 0?void 0:i[r])!==null&&n!==void 0?n:null}getHeaderTreeNodeData(e,r){const n=this.getHeaderTreeNode(e,r);return n?{...n.data}:null}getHeaderTreeNode(e,r){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const n=Wt(fn,this).getNode(e,r);return n||null}findTopMostEntireHeaderLevel(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const n=r-e+1;let i=!1,o=null;for(let s=e;s<=r;s++){const a=Wt(fn,this).getRootByColumn(s);if(!a)break;i=!0,a.walkDown(l=>{const{columnIndex:u,headerLevel:c,origColspan:h,isHidden:d}=l.data;d||h<=n&&u>=e&&u+h-1<=r&&(o===null||c<o)&&(o=c)},hB)}return i&&o===null?-1:this.levelToRowCoords(o??0)}findLeftMostColumnIndex(e,r){var n;const{isRoot:i}=(n=this.getHeaderSettings(e,r))!==null&&n!==void 0?n:{isRoot:!0};if(i)return r;let o=r-1;for(;o>=0;){var s;const{isRoot:a}=(s=this.getHeaderSettings(e,o))!==null&&s!==void 0?s:{isRoot:!0};if(a)break;o-=1}return o}findRightMostColumnIndex(e,r){var n;const{isRoot:i,origColspan:o}=(n=this.getHeaderSettings(e,r))!==null&&n!==void 0?n:{isRoot:!0,origColspan:1};if(i)return r+o-1;let s=r+1;for(;s<this.getColumnsCount();){var a;const{isRoot:l}=(a=this.getHeaderSettings(e,s))!==null&&a!==void 0?a:{isRoot:!0};if(l)break;s+=1}return s-1}getLayersCount(){return Wt(uo,this).getLayersCount()}getColumnsCount(){return Wt(uo,this).getColumnsCount()}clear(){Gh(wl,this,[]),Wt(uo,this).clear(),Wt(fn,this).clear()}}function qh(t,e,r){return(e=cde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cde(t){var e=hde(t,"string");return typeof e=="symbol"?e:e+""}function hde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dde{constructor(e,r){qh(this,"hot",void 0),qh(this,"nestedHeaderSettingsGetter",void 0),qh(this,"layersCount",0),qh(this,"container",void 0),qh(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=r,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),e&&this.container.classList.add(e),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const r=this.container.querySelectorAll("tr:last-of-type th"),n=r.length;this.widthsMap.clear();for(let i=0;i<n;i++){const o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),s=this.hot.toPhysicalColumn(o);this.widthsMap.setValueAtIndex(s,r[i].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:r,columnIndexMapper:n}=this.hot,i=r.createDocumentFragment(),o=r.createElement("table"),s=!!this.hot.getSettings().dropdownMenu,a=n.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const u=r.createElement("tr");for(let c=0;c<a;c++){let h=n.getVisualFromRenderableIndex(c);h===null&&(h=c);const d=r.createElement("th"),f=this.nestedHeaderSettingsGetter(l,h);if(f&&(!f.isPlaceholder||f.isHidden)){let g=f.label;s&&(g+='<button class="changeType"></button>'),kc(d,g),d.colSpan=f.colspan,u.appendChild(d)}}o.appendChild(u)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function fde(t,e){vB(t,e),e.add(t)}function $D(t,e,r){return(e=gde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gde(t){var e=mde(t,"string");return typeof e=="symbol"?e:e+""}function mde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Kh(t,e,r){vB(t,e),e.set(t,r)}function vB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cs(t,e,r){return t.set(Bt(t,e),r),r}function Ye(t,e){return t.get(Bt(t,e))}function Bt(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const FD="nestedHeaders",pde=280;var pt=new WeakMap,qs=new WeakMap,Ad=new WeakMap,Jw=new WeakMap,Yp=new WeakMap,qt=new WeakSet;class wde extends nt{constructor(){super(...arguments),fde(this,qt),Kh(this,pt,new ude),Kh(this,qs,null),Kh(this,Ad,null),Kh(this,Jw,!1),Kh(this,Yp,null),$D(this,"ghostTable",new dde(this.hot,(e,r)=>this.getHeaderSettings(e,r))),$D(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return FD}static get PLUGIN_PRIORITY(){return pde}isEnabled(){return!!this.hot.getSettings()[FD]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:r}=this.hot.getSettings();(!Array.isArray(r)||!Array.isArray(r[0]))&&it(lt`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
|
|
759
|
+
passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>Bt(qt,this,Hde).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Nde).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,bde).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Sde).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Rde).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Ede).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Tde).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,_de).call(e,...i)}),this.addHook("afterSelection",()=>Bt(qt,this,am).call(this)),this.addHook("afterSelectionFocusSet",()=>Bt(qt,this,am).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,vde).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",n=>Bt(qt,this,Pde).call(this,n)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Ode).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,xde).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,yde).call(e,...i)}),this.addHook("beforeCopy",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Cde).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Mde).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Ide).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Bt(qt,e,Ade).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Bt(qt,this,am).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Bt(qt,this,am).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Ye(pt,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Ye(pt,this).setState(e)),this.detectedOverlappedHeaders&&it(lt`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
|
|
760
|
+
is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((r,n)=>{const i=r===!0?"hide-column":"show-column";Ye(pt,this).triggerColumnModification(i,n)}),!Ye(qs,this)&&this.enabled&&Cs(qs,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(r=>{r.forEach(n=>{let{op:i,index:o,newValue:s}=n;if(i==="replace"){const a=s===!0?"hide-column":"show-column";Ye(pt,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Ye(pt,this).clear(),Ye(qs,this).unsubscribe(),Cs(qs,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Ye(pt,this)}getLayersCount(){return Ye(pt,this).getLayersCount()}getHeaderSettings(e,r){return Ye(pt,this).getHeaderSettings(e,r)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,r=e.getSetting("columnHeaders").length,n=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let s=0;s<r;s++){const a=n.childNodes[s];if(!a)break;const l=i.childNodes[s],u=o?o.childNodes[s]:null;for(let c=0,h=a.childNodes.length;c<h;c++)a.childNodes[c].removeAttribute("colspan"),Ee(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),Ee(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),Ee(u.childNodes[c],"hiddenHeader"))}}headerRendererFactory(e){var r=this;const n=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,o)=>{var s;const{columnIndexMapper:a,view:l}=this.hot;let u=a.getVisualFromRenderableIndex(i);u===null&&(u=i),o.removeAttribute("colspan"),Ee(o,"hiddenHeader"),Ee(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=Ye(pt,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)ie(o,"hiddenHeader");else if(c>1){var g,w,v;const{wtOverlays:b}=l._wt,p=(g=b.topInlineStartCornerOverlay)===null||g===void 0?void 0:g.clone.wtTable.THEAD.contains(o),_=(w=b.inlineStartOverlay)===null||w===void 0?void 0:w.clone.wtTable.THEAD.contains(o);((v=b.topOverlay)===null||v===void 0?void 0:v.clone.wtTable.THEAD.contains(o))&&u<n&&ie(o,"hiddenHeaderText");const T=p||_?Math.min(c,n-i):c;T>1&&o.setAttribute("colspan",T)}if(this.hot.view.appendColHeader(u,o,function(){return r.getColumnHeaderValue(...arguments)},e),!d&&!h){const b=o.querySelector("div.relative");b&&f&&f.length>0&&(Ee(b,this.hot.getColumnMeta(u).headerClassName),ie(b,f))}}}getColumnHeaderValue(e,r){var n;const{isHidden:i,isPlaceholder:o}=(n=Ye(pt,this).getHeaderSettings(r,e))!==null&&n!==void 0?n:{};return o||i?"":this.hot.getColHeader(e,r)}destroy(){Cs(pt,this,null),Ye(qs,this)!==null&&(Ye(qs,this).unsubscribe(),Cs(qs,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Ye(pt,this).getHeaderTreeNodeData(e.row,e.col)}}function am(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:r}=e;if(r.isHeader()&&r.col>=0){const i=Ye(pt,this).findLeftMostColumnIndex(r.row,r.col),o=this.hot.selection.highlight.getFocus();o.visualCellRange.highlight.col=i,o.visualCellRange.from.col=i,o.visualCellRange.to.col=i,o.commit()}}function vde(t,e){var r;const n=this.hot.getSelectedRangeLast();if(!n)return t;const{highlight:i}=n,{navigableHeaders:o}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=o?i.row:(r=Ye(Yp,this))===null||r===void 0?void 0:r.row,l=s?t:i.col,u=a<0&&l>=0;if(Cs(Yp,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=Ye(pt,this).findLeftMostColumnIndex(a,l),g=Ye(pt,this).findRightMostColumnIndex(a,l),w=g-f+1;if(f<c&&g>h)return f;if(s){let v=null;return f>=c&&g>h?w>d?(e.value="start",v=f):(e.value="end",v=g):f<c&&g<=h&&(w>d?(e.value="end",v=g):(e.value="start",v=f)),v}return f<=c?f:g}function yde(t,e,r){const n=Ye(pt,this).getHeaderTreeNodeData(e,t);if(!n)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=r,{isRoot:a,colspan:l}=Ye(pt,this).getHeaderSettings(e,t);if(o===nT){if(!a)return n.columnIndex}else if(o===nF&&(l>s-i||!a))return null;return t}function Cde(t,e,r){let{columnHeadersCount:n}=r;if(n!==0)for(let o=0;o<e.length;o++){const{startRow:s,startCol:a,endRow:l,endCol:u}=e[o],c=l-s+1,h=a-u+1;if(s>=0||h===1)break;for(let d=a;d<=u;d++)for(let f=s;f<=l;f++){var i;const g=c+f,w=d-a;if(w===0)continue;((i=Ye(pt,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[g][w]="")}}}function bde(t,e,r,n){this._getHeaderTreeNodeDataByCoords(e)&&(n.column=!0)}function Sde(t,e){const r=this._getHeaderTreeNodeDataByCoords(e);if(!r)return;Cs(Ad,this,e.clone()),Cs(Jw,this,!0);const{selection:n}=this.hot,i=n.isSelected()?n.getSelectedRange().current():null,o=[],{columnIndex:s,origColspan:a}=r,l=!n.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?o.push(i.getTopEndCorner().col,s,e.row):e.col>i.from.col?o.push(i.getTopStartCorner().col,s+a-1,e.row):o.push(s,s+a-1,e.row):(Y0(t)||Vl(t)&&l||F3(t))&&o.push(s,s+a-1,e.row),n.selectColumns(...o)}function Rde(t,e,r,n){if(!this.hot.view.isMouseDown()||n.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:o,origColspan:s}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:c}=a;n.column=!0,n.cell=!0;const h=[],d=Xe(e.row,-1/0,-1);e.col<c.col?h.push(u.col,o,d):e.col>c.col?h.push(l.col,o+s-1,d):h.push(o,o+s-1,d),this.hot.selection.selectColumns(...h)}function Ede(){Cs(Jw,this,!1)}function Tde(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Ye(Jw,this)||!t)return;const e=this.hot.getSelectedRangeLast(),r=e.getTopStartCorner().col,n=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=Ye(pt,this).getHeaderTreeNodeData(Ye(Ad,this).row,Ye(Ad,this).col);if(e.setHighlight(Ye(Ad,this)),o>e.getWidth()||i<r||i+o-1>n){const s=Ye(pt,this).findTopMostEntireHeaderLevel(Xe(r,i,i+o-1),Xe(n,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function _de(t){const{highlight:e}=this.hot.getSelectedRangeLast(),r=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(r.isHeader()&&r.col>=0))return;const i=Ye(pt,this).findLeftMostColumnIndex(r.row,r.col),o=Ye(pt,this).findRightMostColumnIndex(r.row,r.col);if(t.col<0){const s=e.col>=i&&e.col<=o?i-1:o,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,-1);a===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,e.col)-1,1)}else if(t.col>0){const s=e.col>=i&&e.col<=o?o+1:i,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,1);a===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,a)-1,1)}}function Mde(t,e,r){const n=t.row,i=this._getHeaderTreeNodeDataByCoords({row:n,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:n,col:e.col});Cs(Yp,this,r.clone()),e.col<t.col?(i&&(t.col=i.columnIndex+i.origColspan-1),o&&(e.col=o.columnIndex)):e.col>=t.col&&(i&&(t.col=i.columnIndex),o&&(e.col=o.columnIndex+o.origColspan-1))}function Pde(t){if(Ye(pt,this).getLayersCount()>0){t.length=0;for(let e=0;e<Ye(pt,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function Ide(t){const e=Ye(pt,this).getLayersCount();let r=t.startColumn,n=!!e;for(let i=0;i<e;i++){const o=Ye(pt,this).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(n=!1),tn(s)&&s<t.startColumn){r=s;break}}t.startColumn=n?Ye(pt,this).getHeaderTreeNodeData(0,r).columnIndex:r}function Ode(t,e){const r=this.ghostTable.getWidth(e);return t>r?t:r}function xde(t,e,r){var n;const{label:i}=(n=Ye(pt,this).getHeaderTreeNodeData(r,e))!==null&&n!==void 0?n:{label:""};return i}function Ade(t,e){if(t<0)return this.hot.getCell(t,Ye(pt,this).findLeftMostColumnIndex(t,e),!0)}function Hde(){this.updatePlugin()}function Nde(t,e){e||this.updatePlugin()}function Xh(t,e,r){return(e=Dde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dde(t){var e=kde(t,"string");return typeof e=="symbol"?e:e+""}function kde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Lde{constructor(e,r){Xh(this,"hot",void 0),Xh(this,"data",null),Xh(this,"plugin",void 0),Xh(this,"parentReference",new WeakMap),Xh(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=r,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},Ce(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,r,n){this.cache.levels[r]||(this.cache.levels[r]=[],this.cache.levelCount+=1),this.cache.levels[r].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:n,row:this.cache.rows.length-1,level:r}),this.hasChildren(e)&&k(e.__children,i=>{this.cacheNode(i,r+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,r,n,i){let o=!1,s=r;if(isNaN(s)&&s.end)return s;let a=e;return a||(a={__children:this.data},o=!0,s-=1),n!=null&&s===n?{result:a,end:!0}:i!=null&&a===i?{result:s,end:!0}:(s+=1,a.__children&&k(a.__children,l=>{if(this.parentReference.set(l,o?null:a),s=this.readTreeNodes(l,s,n,i),isNaN(s)&&s.end)return!1}),s)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return We(this.data[0],(r,n)=>{e[n]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let r=null;isNaN(e)?r=e:r=this.getDataObject(e);const n=this.getRowParent(e);return n==null?this.data.indexOf(r):n.__children.indexOf(r)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let r=0,n=e;return isNaN(n)||(n=this.getDataObject(n)),!n||!n.__children?0:(k(n.__children,i=>{r+=1,i.__children&&(r+=this.countChildren(i))}),r)}getRowParent(e){let r;return isNaN(e)?r=e:r=this.getDataObject(e),this.getRowObjectParent(r)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let r=null;return isNaN(e)?r=e:r=this.getDataObject(e),r?this.getRowObjectLevel(r):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let r=e;return isNaN(r)||(r=this.getDataObject(r)),!!(r.__children&&r.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,r){var n;return((n=e.__children)===null||n===void 0?void 0:n[r])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var r;let n=e;return isNaN(n)||(n=this.getDataObject(n)),n&&!!n.__children&&((r=n.__children)===null||r===void 0?void 0:r.length)!==0}addChild(e,r){let n=r;this.hot.runHooks("beforeAddChild",e,n);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let o=e;e||(o=this.mockParent()),o.__children||(o.__children=[]),n||(n=this.mockNode()),o.__children.push(n),this.rewriteCache();const s=this.getRowIndex(n);this.hot.rowIndexMapper.insertIndexes(s,1),this.hot.runHooks("afterCreateRow",s,1),this.hot.runHooks("afterAddChild",e,n)}addChildAtIndex(e,r,n){let i=n,o;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,r),e){const a=this.getRowIndex(e)+r+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(r,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(a,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",a,1),o=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",r,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),o=this.getRowIndex(this.data[r]);i=this.getDataObject(o),this.hot.runHooks("afterAddChild",e,i,r)}addSibling(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const n=this.translateTrimmedRow(e),i=this.getRowParent(n),o=this.getRowIndexWithinParent(n);switch(r){case"below":this.addChildAtIndex(i,o+1,null);break;case"above":this.addChildAtIndex(i,o,null);break}}detachFromParent(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=null;const i=[];Array.isArray(e)?(Ce(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),Ce(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),n=i[i.length-1]):n=e;const o=this.getRowIndex(n),s=this.countChildren(n),a=this.getRowIndexWithinParent(n),l=this.getRowParent(n),u=this.getRowParent(l),c=this.getRowIndex(u);let h=null;if(this.hot.runHooks("beforeDetachChild",l,n),a!=null){const d=Array.from(new Array(o+s+1).keys()).splice(-1*(s+1));if(this.hot.runHooks("beforeRemoveRow",o,s+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",o,s+1,d,this.plugin.pluginName),u){h=c+this.countChildren(u);const f=this.getChild(u,this.countChildren(u)-1),g=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",g+1,s+1,this.plugin.pluginName),u.__children.push(n)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,s+1,this.plugin.pluginName),this.data.push(n)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,s+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,n,this.getRowIndex(n)),r&&this.hot.render()}filterData(e,r,n){const i=[];k(n,o=>{i.push(this.getDataObject(o))}),k(i,o=>{const s=this.getRowIndexWithinParent(o),a=this.getRowParent(o);a===null?this.data.splice(s,1):a.__children.splice(s,1)}),this.rewriteCache()}spliceData(e,r,n){const i=this.getDataObject(e-1);let o=null,s=e;i&&i.__children&&i.__children.length===0?(o=i,s=0):e<this.countAllRows()&&(o=this.getRowParent(e),s=this.getRowIndexWithinParent(e)),o?n?o.__children.splice(s,r,...n):o.__children.splice(s,r):n?this.data.splice(s,r,...n):this.data.splice(s,r),this.rewriteCache()}syncRowWithRawSource(e){let r=e,n=r;do n=this.getRowParent(n),n!==null&&(r=n);while(n!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(r),"__children",r.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,r,n,i){const o=r===this.hot.countRows(),s=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=s.__children.slice(a,a+1),u=e>r;let c=o?this.getRowParent(r-1):this.getRowParent(r);c==null&&(c=this.getRowParent(r-1)),c==null&&(c=this.getDataObject(r-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(r),c.__children=[]);const h=o||n||i?c.__children.length:this.getRowIndexWithinParent(r),d=s===c;c.__children.splice(h,0,l[0]),s.__children.splice(a+(u&&d?1:0),1),this.syncRowWithRawSource(s),d||this.syncRowWithRawSource(c)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}function VD(t,e,r){return(e=$de(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $de(t){var e=Fde(t,"string");return typeof e=="symbol"?e:e+""}function Fde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class OM{constructor(e,r){VD(this,"hot",void 0),VD(this,"plugin",void 0),this.hot=r,this.plugin=e}}class yo extends OM{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,r){super(e,r),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,r){const n=this.hot.toPhysicalRow(e),i=this.dataManager.getRowLevel(n),o=this.dataManager.getDataObject(n),s=r.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),u=this.hot.getSettings().ariaTags;if(k(l,c=>{c&&s.removeChild(c)}),ie(r,yo.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",Ce(0,i-1,()=>{const d=c.createElement("SPAN");ie(d,yo.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&Pe(c,[eu()]),ie(r,yo.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(n)?(ie(c,`${yo.CSS_CLASSES.button} ${yo.CSS_CLASSES.expandButton}`),u&&Pe(r,[li(!1)])):(ie(c,`${yo.CSS_CLASSES.button} ${yo.CSS_CLASSES.collapseButton}`),u&&Pe(r,[li(!0)])),s.appendChild(c)}}updateRowHeaderWidth(e){let r=e;r||(r=this.dataManager.cache.levelCount);const n=this.hot.view.getStylesHandler();let i=11;n.isClassicTheme()||(i=n.getCSSVariableValue("cell-horizontal-padding")*2),this.rowHeaderWidthCache=Math.max(50,i+10*r+25),this.hot.render()}}class Vde extends OM{constructor(e,r){var n;super(e,r),n=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;n.lastCollapsedRows=n.collapsedRows.slice(0),n.expandMultipleChildren(n.lastCollapsedRows,i)},shiftStash:function(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;o==null&&(o=1/0),k(n.lastCollapsedRows,(a,l)=>{a>=i&&a<o&&(n.lastCollapsedRows[l]=a+s)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.collapseMultipleChildren(n.lastCollapsedRows,i),n.lastCollapsedRows=void 0},trimStash:(i,o)=>{Ce(i,i+o-1,s=>{const a=this.lastCollapsedRows.indexOf(s);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(o)):(o=this.dataManager.getDataObject(e),s=e),this.dataManager.hasChildren(o)&&k(o.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),n&&this.trimRows(a),r&&this.renderAndAdjust(),this.collapsedRows.indexOf(s)===-1&&this.collapsedRows.push(s),a}collapseMultipleChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];k(e,o=>{i.push(...this.collapseChildren(o,!1,!1))}),n&&this.trimRows(i),r&&this.renderAndAdjust()}collapseRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],r)}collapseRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return k(e,o=>{i.push(o),r&&this.collapseChildRows(o,i)}),n&&this.trimRows(i),i}collapseChildRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);k(i.__children,o=>{const s=this.dataManager.getRowIndex(o);r.push(s),this.collapseChildRows(s,r)})}n&&this.trimRows(r)}expandRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],r)}expandRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return k(e,o=>{i.push(o),r&&this.expandChildRows(o,i)}),n&&this.untrimRows(i),i}expandChildRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);k(i.__children,o=>{if(!this.isAnyParentCollapsed(o)){const s=this.dataManager.getRowIndex(o);r.push(s),this.expandChildRows(s,r)}})}n&&this.untrimRows(r)}expandChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(e)):(o=this.dataManager.getDataObject(e),s=e),this.collapsedRows.splice(this.collapsedRows.indexOf(s),1),this.dataManager.hasChildren(o)&&k(o.__children,l=>{const u=this.dataManager.getRowIndex(l);i.push(u)}),a=this.expandRows(i,!0,!1),n&&this.untrimRows(a),r&&this.renderAndAdjust(),a}expandMultipleChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];k(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),n&&this.untrimRows(i),r&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),r=[];k(e,n=>{this.dataManager.hasChildren(n)&&r.push(n)}),this.collapseMultipleChildren(r),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),r=[];k(e,n=>{this.dataManager.hasChildren(n)&&r.push(n)}),this.expandMultipleChildren(r),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{k(e,r=>{this.plugin.collapsedRowsMap.setValueAtIndex(r,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{k(e,r=>{this.plugin.collapsedRowsMap.setValueAtIndex(r,!1)})},!0)}areChildrenCollapsed(e){let r=isNaN(e)?e:this.dataManager.getDataObject(e),n=!0;return r===null&&(r={__children:this.dataManager.data}),this.dataManager.hasChildren(r)&&k(r.__children,i=>{const o=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(o))return n=!1,!1}),n}isAnyParentCollapsed(e){let r=e;for(;r!==null;){r=this.dataManager.getRowParent(r);const n=this.dataManager.getRowIndex(r);if(this.collapsedRows.indexOf(n)>-1)return!0}return!1}toggleState(e,r){if(r.col>=0)return;const n=this.translateTrimmedRow(r.row);_e(e.target,yo.CSS_CLASSES.button)&&(this.areChildrenCollapsed(n)?this.expandChildren(n):this.collapseChildren(n),Yi(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function Wde(t,e,r){Bde(t,e),e.set(t,r)}function Bde(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jde(t,e,r){return(e=Ude(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ude(t){var e=zde(t,"string");return typeof e=="symbol"?e:e+""}function zde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yde(t,e){return t.get(Gde(t,e))}function Gde(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var WD=new WeakMap;class qde extends OM{constructor(){super(...arguments),jde(this,"dataManager",this.plugin.dataManager),Wde(this,WD,{row_above:(e,r)=>{const n=r[r.length-1];this.dataManager.addSibling(n.start.row,"above")},row_below:(e,r)=>{const n=r[r.length-1];this.dataManager.addSibling(n.start.row,"below")}})}appendOptions(e){const r=[{key:"add_child",name(){return this.getTranslatedPhrase(n_)},callback:()=>{const n=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),i=this.dataManager.getDataObject(n);this.dataManager.addChild(i)},disabled:()=>{const n=this.hot.getSelectedLast();return!n||n[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(i_)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const n=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(n[0]);return!this.dataManager.getRowParent(i)||!n||n[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return Ce(0,e.items.length-1,n=>{if(n===0)return k(r,(i,o)=>{e.items.splice(n+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return Ce(0,e.items.length-1,r=>{const n=Yde(WD,this)[e.items[r].key];n!=null&&(e.items[r].callback=n)}),e}}function lm(t,e,r){return(e=Kde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kde(t){var e=Xde(t,"string");return typeof e=="symbol"?e:e+""}function Xde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zde{constructor(e){lm(this,"plugin",void 0),lm(this,"hot",void 0),lm(this,"dataManager",void 0),lm(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,r,n,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:r,dropIndex:n,movePossible:i}))return!1;this.movedToCollapsed=!1;const s=n===this.hot.countRows(),a=s?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(n);let l=!0;const u=e.map(g=>{if(!l)return!1;const w=this.dataManager.translateTrimmedRow(g);return l=this.shouldAllowMoving(w,a),w}),c=u.indexOf(a)===-1;if(!l||!c)return!1;const h=this.getBaseParent(u),d=this.getTargetParent(s,a),f=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(u,a,f),this.moveRows(u,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(u,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,r,n,i,i&&this.isRowOrderChanged(e,r)),this.hot.render(),this.selectCells(e,n),!1}displayAPICompatibilityWarning(e){const{rows:r,finalIndex:n,dropIndex:i,movePossible:o}=e;let s=!1;return $t(i)&&(it(lt`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
|
|
761
|
+
when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",r,n,i,o,!1),s=!0),s}shouldAllowMoving(e,r){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===r||r===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,r){let n=this.dataManager.getRowParent(e?r-1:r);return n==null&&(n=this.dataManager.getRowParent(r-1)),n}shiftCollapsibleParentsLocations(e,r,n){n||(Math.max(...e)<=r?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],r,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(r,e[0],e.length))}moveRows(e,r,n){const i=r===this.dataManager.getRowIndex(n)+this.dataManager.countChildren(n)+1;this.hot.batchRender(()=>{e.forEach(o=>{this.dataManager.moveRow(o,r,this.movedToCollapsed,i)})})}moveCellsMeta(e,r){const n=[],i=Math.max(...e)<r;e.forEach(o=>{n.push(this.hot.getCellMetaAtRow(o))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(r-(i?n.length:0),0,...n)}selectCells(e,r){const n=e.length;let i=0,o=0;if(this.movedToCollapsed){let s=null;e[n-1]<r?s=this.dataManager.translateTrimmedRow(r-n):s=this.dataManager.translateTrimmedRow(r);const a=this.dataManager.getRowParent(s===null?this.hot.countSourceRows()-1:s-1),l=this.dataManager.getRowIndex(a);i=this.dataManager.untranslateTrimmedRow(l),o=i}else e[n-1]<r?(o=r-1,i=o-n+1):(i=r,o=i+n-1);this.hot.selectCells([[i,0,o,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}}function Jde(t,e){yB(t,e),e.add(t)}function BD(t,e,r){yB(t,e),e.set(t,r)}function yB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lR(t,e,r){return(e=Qde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qde(t){var e=efe(t,"string");return typeof e=="symbol"?e:e+""}function efe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gm(t,e){return t.get(Sr(t,e))}function Gp(t,e,r){return t.set(Sr(t,e),r),r}function Sr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const qp="nestedRows",tfe=300,jD=qp,rfe="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var Qw=new WeakMap,Wu=new WeakMap,_r=new WeakSet;class nfe extends nt{constructor(){super(...arguments),Jde(this,_r),lR(this,"dataManager",null),lR(this,"headersUI",null),lR(this,"collapsedRowsMap",null),BD(this,Qw,!1),BD(this,Wu,!1)}static get PLUGIN_KEY(){return qp}static get PLUGIN_PRIORITY(){return tfe}isEnabled(){return!!this.hot.getSettings()[qp]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new yf),this.dataManager=new Lde(this,this.hot),this.collapsingUI=new Vde(this,this.hot),this.headersUI=new yo(this,this.hot),this.contextMenuUI=new qde(this,this.hot),this.rowMoveController=new Zde(this),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,wfe).call(e,...n)}),this.addHook("beforeViewRender",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,vfe).call(e,...n)}),this.addHook("modifyRowData",function(){return e.onModifyRowData(...arguments)}),this.addHook("modifySourceLength",function(){return e.onModifySourceLength(...arguments)}),this.addHook("beforeDataSplice",function(){return e.onBeforeDataSplice(...arguments)}),this.addHook("filterData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,sfe).call(e,...n)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,afe).call(e,...n)}),this.addHook("afterGetRowHeader",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,lfe).call(e,...n)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,ofe).call(e,...n)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,hfe).call(e,...n)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,cfe).call(e,...n)}),this.addHook("beforeAddChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,dfe).call(e,...n)}),this.addHook("afterAddChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,ffe).call(e,...n)}),this.addHook("beforeDetachChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,gfe).call(e,...n)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,mfe).call(e,...n)}),this.addHook("modifyRowHeaderWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,ufe).call(e,...n)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,pfe).call(e,...n)}),this.addHook("beforeRowMove",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(_r,e,ife).call(e,...n)}),this.addHook("beforeLoadData",r=>Sr(_r,this,UD).call(this,r)),this.addHook("beforeUpdateData",r=>Sr(_r,this,UD).call(this,r)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast(),r=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(r)?this.collapsingUI.expandChildren(r):this.collapsingUI.collapseChildren(r),!1},runOnlyIf:()=>{var e,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.col===-1&&n.row>=0},group:jD,relativeToGroup:_a,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(jD)}disableCoreAPIModifiers(){Gp(Wu,this,!0)}enableCoreAPIModifiers(){Gp(Wu,this,!1)}onModifyRowData(e){if(!Gm(Wu,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!Gm(Wu,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,r,n){return Gm(Wu,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,r,n),!1)}destroy(){super.destroy()}}function ife(t,e,r,n){return this.rowMoveController.onBeforeRowMove(t,e,r,n)}function ofe(t,e,r){this.collapsingUI.toggleState(t,e,r)}function sfe(t,e,r){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(r[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(r[0],null,-1*e),this.dataManager.filterData(t,e,r),Gp(Qw,this,!0),this.dataManager.getData().slice()}function afe(t){return this.contextMenuUI.appendOptions(t)}function lfe(t,e){this.headersUI.appendLevelIndicators(t,e)}function ufe(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function cfe(t,e,r,n){n!==this.pluginName&&this.hot._registerTimeout(()=>{Gp(Qw,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function hfe(t,e,r){const n=Array.from(r.reduce((i,o)=>{if(this.dataManager.isParent(o)){const s=this.dataManager.getDataObject(o).__children;return i.add(o),Array.isArray(s)&&s.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(o)},new Set));r.length=0,r.push(...n)}function dfe(){this.collapsingUI.collapsedRowsStash.stash()}function ffe(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function gfe(){this.collapsingUI.collapsedRowsStash.stash()}function mfe(t,e,r){this.collapsingUI.collapsedRowsStash.shiftStash(r,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function pfe(){this.dataManager.rewriteCache()}function wfe(){this.headersUI.updateRowHeaderWidth()}function vfe(t,e){Gm(Qw,this)&&(e.skipRender=!0)}function UD(t){if(!Q5(t)){G0(rfe),this.hot.getSettings()[qp]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function uR(t,e,r){return(e=yfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yfe(t){var e=Cfe(t,"string");return typeof e=="symbol"?e:e+""}function Cfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bfe{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;uR(this,"rootWindow",void 0),uR(this,"prefix",void 0),uR(this,"savedKeys",[]),this.rootWindow=r,this.prefix=e,this.loadSavedKeys()}saveValue(e,r){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(r)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,r){const n=typeof e>"u"?r:e,i=this.rootWindow.localStorage.getItem(`${this.prefix}_${n}`);return i===null?void 0:JSON.parse(i)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){k(this.savedKeys,(e,r)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[r]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),r=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=r||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}function Sfe(t,e,r){return(e=Rfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rfe(t){var e=Efe(t,"string");return typeof e=="symbol"?e:e+""}function Efe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}fe.getSingleton().register("persistentStateSave");fe.getSingleton().register("persistentStateLoad");fe.getSingleton().register("persistentStateReset");const zD="persistentState",Tfe=0;class _fe extends nt{constructor(){super(...arguments),Sfe(this,"storage",void 0)}static get PLUGIN_KEY(){return zD}static get PLUGIN_PRIORITY(){return Tfe}isEnabled(){return!!this.hot.getSettings()[zD]}enablePlugin(){this.enabled||(this.storage||(this.storage=new bfe(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,r)=>this.saveValue(e,r)),this.addHook("persistentStateLoad",(e,r)=>this.loadValue(e,r)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,r){r.value=this.storage.loadValue(e)}saveValue(e,r){this.storage.saveValue(e,r)}resetValue(e){typeof e>"u"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function Mfe(t,e){Pfe(t,e),e.add(t)}function Pfe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cR(t,e,r){return(e=Ife(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ife(t){var e=Ofe(t,"string");return typeof e=="symbol"?e:e+""}function Ofe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YD(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const hR="search",xfe=190,Afe="htSearchResult",Hfe=function(t,e,r,n,i){t.getCellMeta(e,r).isSearchResult=i},Nfe=function(t,e,r){return $t(t)||t===null||!t.toLocaleLowerCase||t.length===0||$t(e)||e===null?!1:e.toString().toLocaleLowerCase(r.locale).indexOf(t.toLocaleLowerCase(r.locale))!==-1};var dR=new WeakSet;class Dfe extends nt{constructor(){super(...arguments),Mfe(this,dR),cR(this,"callback",Hfe),cR(this,"queryMethod",Nfe),cR(this,"searchResultClass",Afe)}static get PLUGIN_KEY(){return hR}static get PLUGIN_PRIORITY(){return xfe}isEnabled(){return this.hot.getSettings()[hR]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[hR];this.updatePluginSettings(r),this.addHook("beforeRenderer",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return YD(dR,e,GD).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const r=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return YD(dR,e,GD).call(e,...i)};this.hot.addHook("beforeRenderer",r),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",r)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),o=this.hot.countCols(),s=[],a=this.hot;return Ce(0,i-1,l=>{Ce(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||r,g=(h.search.queryMethod||n)(e,c,h);if(g){const w={row:l,col:u,data:c};s.push(w)}d&&d(a,l,u,c,g)})}),s}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){Ve(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function GD(t,e,r,n,i,o){const s=o.className||[];let a=[];typeof s=="string"?a=s.split(" "):a.push(...s),this.isEnabled()&&o.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),o.className=a.join(" ")}function um(t,e,r){return(e=kfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kfe(t){var e=Lfe(t,"string");return typeof e=="symbol"?e:e+""}function Lfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class CB{constructor(e){um(this,"viewportWidth",void 0),um(this,"overwriteColumnWidthFn",void 0),um(this,"baseWidths",new Map),um(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:r}=e;this.viewportWidth=r,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,r){this.baseWidths.set(e,r)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class $fe extends CB{calculate(){const e=Array.from(this.baseWidths).reduce((h,d)=>{let[,f]=d;return h+f},0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}const n=this.viewportWidth/e,i=[],o=[];let s=this.viewportWidth,a=0;if(this.baseWidths.forEach((h,d)=>{const f=Math.round(h*n),g=this.overwriteColumnWidthFn(f,d);f===g&&f>=Cc?(i.push([d,g]),a+=g):f!==g&&(i.push([d,g]),o.push(d),s-=g)}),s<=Cc){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,g]=h,w=g;o.includes(f)||(w=Math.round(g*l)),this.stretchedWidths.set(f,w),u=f,d<i.length-1&&(c+=w)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(u,Math.round(this.viewportWidth-c))}}function qD(t,e,r){Ffe(t,e),e.set(t,r)}function Ffe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fR(t,e){return t.get(bB(t,e))}function cm(t,e,r){return t.set(bB(t,e),r),r}function bB(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var hm=new WeakMap,Zh=new WeakMap;class Vfe extends CB{constructor(){super(...arguments),qD(this,hm,0),qD(this,Zh,-1)}prepare(e){super.prepare(e),cm(hm,this,0),cm(Zh,this,-1)}setColumnBaseWidth(e,r){super.setColumnBaseWidth(e,r),cm(Zh,this,e),cm(hm,this,r)}calculate(){if(fR(Zh,this)===-1)return;const e=Array.from(this.baseWidths).reduce((n,i)=>{let[,o]=i;return n+o},0),r=Math.max(this.viewportWidth-e+fR(hm,this),0);this.stretchedWidths.set(fR(Zh,this),r)}}function Wfe(t,e){SB(t,e),e.add(t)}function dm(t,e,r){SB(t,e),e.set(t,r)}function SB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kt(t,e){return t.get(ic(t,e))}function gR(t,e,r){return t.set(ic(t,e),r),r}function ic(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Bfe="stretchColumns";var Wr=new WeakMap,Bu=new WeakMap,mR=new WeakMap,fm=new WeakMap,Jh=new WeakSet;class jfe{constructor(e){Wfe(this,Jh),dm(this,Wr,void 0),dm(this,Bu,void 0),dm(this,mR,new Map([["all",new $fe(ic(Jh,this,KD).bind(this))],["last",new Vfe(ic(Jh,this,KD).bind(this))]])),dm(this,fm,"none"),gR(Wr,this,e),gR(Bu,this,Kt(Wr,this).columnIndexMapper.createAndRegisterIndexMap(Bfe,"physicalIndexToValue"))}useStrategy(e){gR(fm,this,Kt(mR,this).has(e)?e:"none")}refreshStretching(){if(Kt(fm,this)==="none"){Kt(Bu,this).clear();return}Kt(Wr,this).batchExecution(()=>{Kt(Bu,this).clear();const e=Kt(mR,this).get(Kt(fm,this));let n=Kt(Wr,this).view.getViewportWidth();ic(Jh,this,Ufe).call(this)&&(n-=Or(Kt(Wr,this).rootDocument)),e.prepare({viewportWidth:n});for(let i=0;i<Kt(Wr,this).countCols();i++)Kt(Wr,this).columnIndexMapper.isHidden(Kt(Wr,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,ic(Jh,this,zfe).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;Kt(Bu,this).setValueAtIndex(Kt(Wr,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return Kt(Bu,this).getValueAtIndex(Kt(Wr,this).toPhysicalColumn(e))}}function Ufe(){const{view:t}=Kt(Wr,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),r=Kt(Wr,this).countRows(),n=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<r;a++){var s;if(i+=((s=Kt(Wr,this).getRowHeight(a))!==null&&s!==void 0?s:n)+(a===0?1:0),i>e){o=!0;break}}return o}function zfe(t){var e;return(e=Kt(Wr,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:Cc}function KD(t,e){return Kt(Wr,this).runHooks("beforeStretchingColumnWidth",t,e)}function Yfe(t,e){RB(t,e),e.add(t)}function pR(t,e,r){RB(t,e),e.set(t,r)}function RB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wR(t,e,r){return t.set(Kp(t,e),r),r}function os(t,e){return t.get(Kp(t,e))}function Kp(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Gfe="stretchColumns",qfe=155;var Ju=new WeakMap,gm=new WeakMap,Qh=new WeakMap,vR=new WeakSet;class Kfe extends nt{constructor(){super(...arguments),Yfe(this,vR),pR(this,Ju,new jfe(this.hot)),pR(this,gm,null),pR(this,Qh,new ResizeObserver(e=>{requestAnimationFrame(()=>{var r;(r=this.hot)!==null&&r!==void 0&&r.view.isHorizontallyScrollableByWindow()&&e.forEach(n=>{let{contentRect:i}=n;os(gm,this)!==null&&os(gm,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),wR(gm,this,i.width)})})}))}static get PLUGIN_KEY(){return Gfe}static get PLUGIN_PRIORITY(){return qfe}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(os(Ju,this).useStrategy(this.hot.getSettings().stretchH),os(Qh,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Kp(vR,e,Zfe).call(e,...n)}),this.addHook("modifyColWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Kp(vR,e,Xfe).call(e,...n)},10),super.enablePlugin())}updatePlugin(){os(Ju,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),os(Qh,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return os(Ju,this).getStretchedWidth(e)}destroy(){os(Qh,this).disconnect(),wR(Qh,this,null),wR(Ju,this,null),super.destroy()}}function Xfe(t,e,r){if(r===this.pluginName)return;const n=this.getColumnWidth(e);return typeof n=="number"?n:t}function Zfe(t){t&&os(Ju,this).refreshStretching()}function Jfe(t,e){Qfe(t,e),e.add(t)}function Qfe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mm(t,e,r){return(e=ege(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ege(t){var e=tge(t,"string");return typeof e=="symbol"?e:e+""}function tge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yR(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const rge="touchScroll",nge=200;var pm=new WeakSet;class ige extends nt{constructor(){super(...arguments),Jfe(this,pm),mm(this,"scrollbars",[]),mm(this,"clones",[]),mm(this,"lockedCollection",!1),mm(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return rge}static get PLUGIN_PRIORITY(){return nge}static get SETTING_KEYS(){return!0}isEnabled(){return I$()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>yR(pm,this,oge).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>yR(pm,this,sge).call(this)),this.addHook("afterMomentumScroll",()=>yR(pm,this,age).call(this))}}function oge(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:r,topInlineStartCornerOverlay:n,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(t),e.clone&&this.scrollbars.push(e),this.scrollbars.push(r),n&&this.scrollbars.push(n),i&&i.clone&&this.scrollbars.push(i),this.clones=[],t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),r.needFullRender&&this.clones.push(r.clone.wtTable.holder.parentNode),n&&this.clones.push(n.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function sge(){this.freezeOverlays=!0,k(this.clones,t=>{ie(t,"hide-tween")})}function age(){this.freezeOverlays=!1,k(this.clones,t=>{Ee(t,"hide-tween"),ie(t,"show-tween")}),this.hot._registerTimeout(()=>{k(this.clones,t=>{Ee(t,"show-tween")})},400),k(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function lge(t,e){uge(t,e),e.add(t)}function uge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cge(t,e,r){return(e=hge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hge(t){var e=dge(t,"string");return typeof e=="symbol"?e:e+""}function dge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fge(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const qm="trimRows",gge=330;var XD=new WeakSet;class mge extends nt{constructor(){super(...arguments),lge(this,XD),cge(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return qm}static get PLUGIN_PRIORITY(){return gge}isEnabled(){return!!this.hot.getSettings()[qm]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new yf),this.trimmedRowsMap.addLocalHook("init",()=>fge(XD,this,pge).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[qm];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),k(e,r=>{this.trimmedRowsMap.setValueAtIndex(r,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const r=this.getTrimmedRows(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeTrimRow",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{k(e,s=>{this.trimmedRowsMap.setValueAtIndex(s,!0)})},!0),this.hot.runHooks("afterTrimRow",r,i,n,n&&i.length>r.length))}trimRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.trimRows(r)}untrimRows(e){const r=this.getTrimmedRows(),n=this.isValidConfig(e);let i=r;const o=this.trimmedRowsMap.getValues().slice(),s=e.length>0;n&&s&&(k(e,l=>{o[l]=!1}),i=Mn(o,(l,u,c)=>(u&&l.push(c),l),[])),this.hot.runHooks("beforeUntrimRow",r,i,n&&s)!==!1&&(n&&s&&this.trimmedRowsMap.setValues(o),this.hot.runHooks("afterUntrimRow",r,i,n&&s,n&&i.length<r.length))}untrimRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.untrimRows(r)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const r=this.hot.countSourceRows();return e.every(n=>Number.isInteger(n)&&n>=0&&n<r)}destroy(){super.destroy()}}function pge(){const t=this.hot.getSettings()[qm];Array.isArray(t)&&this.hot.batchExecution(()=>{k(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function wge(t,e,r){return(e=vge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vge(t){var e=yge(t,"string");return typeof e=="symbol"?e:e+""}function yge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class pi{constructor(e){wge(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function wm(t,e,r){return(e=Cge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cge(t){var e=bge(t,"string");return typeof e=="symbol"?e:e+""}function bge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xM extends pi{constructor(e){let{stateBefore:r,range:n,type:i,alignment:o}=e;super("cell_alignment"),wm(this,"stateBefore",void 0),wm(this,"range",void 0),wm(this,"type",void 0),wm(this,"alignment",void 0),this.stateBefore=r,this.range=n,this.type=i,this.alignment=o}static startRegisteringEvents(e,r){e.addHook("beforeCellAlignment",(n,i,o,s)=>{r.done(()=>new xM({stateBefore:n,range:i,type:o,alignment:s}))})}undo(e,r){k(this.range,n=>{n.forAll((i,o)=>{i>=0&&o>=0&&e.setCellMeta(i,o,"className",this.stateBefore[i][o]||" htLeft")})}),e.addHookOnce("afterViewRender",r),e.render()}redo(e,r){Zs(this.range,this.type,this.alignment,(n,i)=>e.getCellMeta(n,i),(n,i,o,s)=>e.setCellMeta(n,i,o,s)),e.addHookOnce("afterViewRender",r),e.render()}}function ZD(t,e,r){return(e=Sge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sge(t){var e=Rge(t,"string");return typeof e=="symbol"?e:e+""}function Rge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class AM extends pi{constructor(e){let{columns:r,finalIndex:n}=e;super("col_move"),ZD(this,"columns",void 0),ZD(this,"finalColumnIndex",void 0),this.columns=r.slice(),this.finalColumnIndex=n}static startRegisteringEvents(e,r){e.addHook("beforeColumnMove",(n,i)=>{n!==!1&&r.done(()=>new AM({columns:n,finalIndex:i}))})}undo(e,r){const n=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",r),_M(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),n.moveColumn(a,s)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,r){const n=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",r),n.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}}function JD(t,e,r){return(e=Ege(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ege(t){var e=Tge(t,"string");return typeof e=="symbol"?e:e+""}function Tge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class HM extends pi{constructor(e){let{currentSortState:r,newSortState:n}=e;super("col_sort"),JD(this,"previousSortState",void 0),JD(this,"nextSortState",void 0),this.previousSortState=r,this.nextSortState=n}static startRegisteringEvents(e,r){e.addHook("beforeColumnSort",(n,i,o)=>{o&&r.done(()=>new HM({currentSortState:n,newSortState:i}))})}undo(e,r){const n=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),o=i.isEnabled()?i:n;this.previousSortState.length?o.sort(this.previousSortState):o.clearSort(),r()}redo(e,r){const n=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:n).sort(this.nextSortState),r()}}function QD(t,e,r){return(e=_ge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _ge(t){var e=Mge(t,"string");return typeof e=="symbol"?e:e+""}function Mge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class NM extends pi{constructor(e){let{index:r,amount:n}=e;super("insert_col"),QD(this,"index",void 0),QD(this,"amount",void 0),this.index=r,this.amount=n}static startRegisteringEvents(e,r){e.addHook("afterCreateCol",(n,i,o)=>{r.done(()=>new NM({index:n,amount:i}),o)})}undo(e,r){e.addHookOnce("afterRemoveCol",r),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,r){e.addHookOnce("afterCreateCol",r),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function ek(t,e,r){return(e=Pge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pge(t){var e=Ige(t,"string");return typeof e=="symbol"?e:e+""}function Ige(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class DM extends pi{constructor(e){let{index:r,amount:n}=e;super("insert_row"),ek(this,"index",void 0),ek(this,"amount",void 0),this.index=r,this.amount=n}static startRegisteringEvents(e,r){e.addHook("afterCreateRow",(n,i,o)=>{r.done(()=>new DM({index:n,amount:i}),o)})}undo(e,r){const n=e.countRows(),i=e.getSettings().minSpareRows;this.index>=n&&this.index-i<n&&(this.index-=i),e.addHookOnce("afterRemoveRow",r),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,r){e.addHookOnce("afterCreateRow",r),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}}function vm(t,e,r){return(e=Oge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oge(t){var e=xge(t,"string");return typeof e=="symbol"?e:e+""}function xge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kM extends pi{constructor(e){let{changes:r,selected:n,countCols:i,countRows:o}=e;super("change"),vm(this,"changes",void 0),vm(this,"selected",void 0),vm(this,"countCols",void 0),vm(this,"countRows",void 0),this.changes=r,this.selected=n,this.countCols=i,this.countRows=o}static startRegisteringEvents(e,r){e.addHook("beforeChange",function(n,i){const o=n&&n.length;if(!o||!n.find(l=>{const[,,u,c]=l;return u!==c}))return;const a=()=>{const l=n.reduce((c,h)=>(c.push([...h]),c),[]);l.forEach(c=>{c[1]=e.propToCol(c[1])});const u=o>1?this.getSelected():[[l[0][0],l[0][1]]];return new kM({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};r.done(a,i)})}undo(e,r){const n=on(this.changes);for(let s=0,a=n.length;s<a;s++)n[s].splice(3,1);e.addHookOnce("afterChange",r),e.setDataAtCell(n,null,null,"UndoRedo.undo");const i=e.countRows()-this.countRows;i>0&&e.alter("remove_row",null,i,"UndoRedo.undo");const o=e.countCols()-this.countCols;o>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,o,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1)}redo(e,r){const n=on(this.changes);for(let i=0,o=n.length;i<o;i++)n[i].splice(2,1);e.addHookOnce("afterChange",r),e.setDataAtCell(n,null,null,"UndoRedo.redo"),this.selected&&e.selectCells(this.selected,!1,!1)}}function tk(t,e,r){return(e=Age(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Age(t){var e=Hge(t,"string");return typeof e=="symbol"?e:e+""}function Hge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class LM extends pi{constructor(e){let{conditionsStack:r,previousConditionsStack:n}=e;super("filter"),tk(this,"conditionsStack",void 0),tk(this,"previousConditionsStack",void 0),this.conditionsStack=r,this.previousConditionsStack=n}static startRegisteringEvents(e,r){e.addHook("beforeFilter",(n,i)=>{r.done(()=>new LM({conditionsStack:n,previousConditionsStack:i}))})}undo(e,r){const n=e.getPlugin("filters");e.addHookOnce("afterViewRender",r),n.importConditions(this.previousConditionsStack),n.filter()}redo(e,r){const n=e.getPlugin("filters");e.addHookOnce("afterViewRender",r),n.importConditions(this.conditionsStack),n.filter()}}function Nge(t,e,r){return(e=Dge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dge(t){var e=kge(t,"string");return typeof e=="symbol"?e:e+""}function kge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $M extends pi{constructor(e){let{data:r,cellRange:n}=e;super("merge_cells"),Nge(this,"cellRange",void 0),this.cellRange=n,this.data=r}static startRegisteringEvents(e,r){e.addHook("beforeMergeCells",(n,i)=>{if(i)return;const o=n.getTopStartCorner(),s=n.getBottomEndCorner(),a=e.getData(o.row,o.col,s.row,s.col);r.done(()=>new $M({data:a,cellRange:n}))})}undo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.mergeRange(this.cellRange)}}function EB(t,e,r,n,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return Ce(n,i,l=>{Ce(e,r,u=>{const c=t.getCellMeta(u,l);if(Object.keys(c).length!==s){const h=Object.fromEntries(Object.entries(c).filter(d=>{let[f]=d;return o.includes(f)===!1}));a.push([c.visualRow,c.visualCol,h])}})}),a}function es(t,e,r){return(e=Lge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lge(t){var e=$ge(t,"string");return typeof e=="symbol"?e:e+""}function $ge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class FM extends pi{constructor(e){let{index:r,indexes:n,data:i,amount:o,headers:s,columnPositions:a,rowPositions:l,fixedColumnsStart:u,removedCellMetas:c}=e;super("remove_col"),es(this,"index",void 0),es(this,"indexes",void 0),es(this,"data",void 0),es(this,"amount",void 0),es(this,"headers",void 0),es(this,"columnPositions",void 0),es(this,"rowPositions",void 0),es(this,"fixedColumnsStart",void 0),es(this,"removedCellMetas",void 0),this.index=r,this.indexes=n,this.data=i,this.amount=o,this.headers=s,this.columnPositions=a.slice(0),this.rowPositions=l.slice(0),this.fixedColumnsStart=u,this.removedCellMetas=c}static startRegisteringEvents(e,r){e.addHook("beforeRemoveCol",(n,i,o,s)=>{const a=()=>{const l=e.getSourceDataArray(),u=(e.countCols()+n)%e.countCols(),c=u+i-1,h=[],d=[],f=[];return Ce(l.length-1,g=>{const w=[],v=l[g];Ce(u,c,b=>{w.push(v[e.toPhysicalColumn(b)])}),h.push(w)}),Ce(i-1,g=>{f.push(e.toPhysicalColumn(u+g))}),Array.isArray(e.getSettings().colHeaders)&&Ce(i-1,g=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+g)]||null)}),new FM({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:EB(e,0,e.countRows(),u,c)})};r.done(a,s)})}undo(e,r){const n=e.getSettings();n.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),o=(c,h,d)=>d[this.indexes.indexOf(i[h])],s=this.data.length,a=[];for(let c=0;c<s;c++)a.push(qe(this.data[c],o));const l=qe(this.headers,o),u=[];e.columnIndexMapper.setIndexesSequence(this.columnPositions),e.alter("insert_col_start",e.toVisualColumn(this.indexes[0]),this.indexes.length,"UndoRedo.undo"),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),k(e.getSourceDataArray(),(c,h)=>{k(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),typeof this.headers<"u"&&k(l,(c,h)=>{e.getSettings().colHeaders[i[h]]=c}),this.removedCellMetas.forEach(c=>{let[h,d,f]=c;e.setCellMetaObject(h,d,f)}),e.addHookOnce("afterViewRender",r),e.setSourceDataAtCell(u,null,null,"UndoRedo.undo")}redo(e,r){e.addHookOnce("afterRemoveCol",r),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function ju(t,e,r){return(e=Fge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fge(t){var e=Vge(t,"string");return typeof e=="symbol"?e:e+""}function Vge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class VM extends pi{constructor(e){let{index:r,data:n,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),ju(this,"index",void 0),ju(this,"data",void 0),ju(this,"fixedRowsBottom",void 0),ju(this,"fixedRowsTop",void 0),ju(this,"rowIndexesSequence",void 0),ju(this,"removedCellMetas",void 0),this.index=r,this.data=n,this.fixedRowsBottom=i,this.fixedRowsTop=o,this.rowIndexesSequence=s,this.removedCellMetas=a}static startRegisteringEvents(e,r){e.addHook("beforeRemoveRow",(n,i,o,s)=>{const a=()=>{const l=e.toPhysicalRow(n),u=l+i-1,c=on(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new VM({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:EB(e,l,u,0,e.countCols()-1)})};r.done(a,s)})}undo(e,r){const n=e.getSettings(),i=[];n.fixedRowsBottom=this.fixedRowsBottom,n.fixedRowsTop=this.fixedRowsTop,this.data.forEach((o,s)=>{Object.keys(o).forEach(a=>{const l=parseInt(a,10);i.push([this.index+s,isNaN(l)?a:l,o[a]])})}),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach(o=>{let[s,a,l]=o;e.setCellMetaObject(s,a,l)}),e.addHookOnce("afterViewRender",r),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,r){e.addHookOnce("afterRemoveRow",r),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function rk(t,e,r){return(e=Wge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wge(t){var e=Bge(t,"string");return typeof e=="symbol"?e:e+""}function Bge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class WM extends pi{constructor(e){let{rows:r,finalIndex:n}=e;super("row_move"),rk(this,"rows",void 0),rk(this,"finalRowIndex",void 0),this.rows=r.slice(),this.finalRowIndex=n}static startRegisteringEvents(e,r){e.addHook("beforeRowMove",(n,i)=>{n!==!1&&r.done(()=>new WM({rows:n,finalIndex:i}))})}undo(e,r){const n=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",r),_M(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),n.moveRow(a,s)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,r){const n=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",r),n.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}}function jge(t,e,r){return(e=Uge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uge(t){var e=zge(t,"string");return typeof e=="symbol"?e:e+""}function zge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class BM extends pi{constructor(e){let{cellRange:r}=e;super("unmerge_cells"),jge(this,"cellRange",void 0),this.cellRange=r}static startRegisteringEvents(e,r){e.addHook("afterUnmergeCells",(n,i)=>{i||r.done(()=>new BM({cellRange:n}))})}undo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.mergeRange(this.cellRange,!0)}redo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.unmergeRange(this.cellRange,!0),e.render()}}function Yge(t,e){[xM,AM,HM,NM,DM,kM,LM,$M,FM,VM,WM,BM].forEach(r=>r.startRegisteringEvents(t,e))}function Gge(t,e){qge(t,e),e.add(t)}function qge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function CR(t,e,r){return(e=Kge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kge(t){var e=Xge(t,"string");return typeof e=="symbol"?e:e+""}function Xge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bR(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const nk="undoRedo",Zge="undoRedo",Jge=1e3;fe.getSingleton().register("beforeUndo");fe.getSingleton().register("afterUndo");fe.getSingleton().register("beforeRedo");fe.getSingleton().register("afterRedo");const ik=new Set;var ym=new WeakSet;class Qge extends nt{static get PLUGIN_KEY(){return Zge}static get PLUGIN_PRIORITY(){return Jge}static get SETTING_KEYS(){return!0}constructor(e){super(e),Gge(this,ym),CR(this,"doneActions",[]),CR(this,"undoneActions",[]),CR(this,"ignoreNewActions",!1),Yge(e,this)}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return bR(ym,e,eme).call(e,...n)}),this.registerShortcuts(),bR(ym,this,tme).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),bR(ym,this,rme).call(this)}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:nk};r.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(nk)}done(e,r){if(this.ignoreNewActions||r==="UndoRedo.undo"||r==="UndoRedo.redo"||r==="auto")return;const i=this.doneActions.slice();if(this.hot.runHooks("beforeUndoStackChange",i,r)===!1)return;const s=e(),a=this.undoneActions.slice();this.doneActions.push(s),this.hot.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",a),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",a,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const r=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const n=on(r);if(this.hot.runHooks("beforeUndo",n)===!1)return;this.ignoreNewActions=!0;const o=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",o),r.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(r)}),this.hot.runHooks("afterRedoStackChange",o,this.undoneActions.slice()),this.hot.runHooks("afterUndo",n)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const r=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const n=on(r);if(this.hot.runHooks("beforeRedo",n)===!1)return;this.ignoreNewActions=!0;const o=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",o),r.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(r)}),this.hot.runHooks("afterUndoStackChange",o,this.doneActions.slice()),this.hot.runHooks("afterRedo",n)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function eme(t,e){e==="loadData"&&this.clear()}function tme(){const t=e=>{ik.has(e)||(it(lt`The "${e}" method is deprecated and it will be removed\x20
|
|
762
|
+
from the Core API in the future. Please use the method from the UndoRedo plugin\x20
|
|
763
|
+
(e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),ik.add(e))};this.hot.undo=()=>{t("undo"),this.undo()},this.hot.redo=()=>{t("redo"),this.redo()},this.hot.isUndoAvailable=()=>(t("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(t("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{t("clear"),this.clear()},this.hot.undoRedo=this}function rme(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}function nme(){Je(wd),Je(wte),Je(vd),Je(qte),Je(rre),Je(YV),Je(Zre),Je(Dne),Je(Yw),Je(Uie),Je(poe),Je(Eoe),Je(Kw),Je(sse),Je(tle),Je(Nle),Je(aue),Je(yue),Je(xue),Je(Bue),Je(Jue),Je(pce),Je(Tce),Je(lhe),Je(Vhe),Je(zhe),Je(wde),Je(nfe),Je(_fe),Je(Dfe),Je(Kfe),Je(ige),Je(mge),Je(Qge)}function ime(){WJ(),cee(),yee(),Fee(),nme()}ime();const ome=Xj`
|
|
764
|
+
/* Checkbox y focos genéricos */
|
|
765
|
+
.hot-scope .handsontable input[type='checkbox'] {
|
|
766
|
+
accent-color: ${`var(--hot-primary, ${Mr})`};
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.hot-scope .handsontable input:focus,
|
|
770
|
+
.hot-scope .handsontable select:focus,
|
|
771
|
+
.hot-scope .handsontable textarea:focus {
|
|
772
|
+
box-shadow: ${"0 0 0 2px color-mix(in srgb, var(--hot-primary, #25cc89) 25%, transparent)"};
|
|
773
|
+
border-color: ${`var(--hot-primary, ${Mr})`};
|
|
774
|
+
outline: none;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
.pika-single .pika-table td.is-selected .pika-button {
|
|
778
|
+
background: ${`var(--hot-primary, ${Mr})`};
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.handsontableInputHolder .handsontableInput {
|
|
782
|
+
box-shadow: ${`
|
|
783
|
+
inset 0 0 0 var(--ht-cell-editor-border-width, 2px) var(--hot-primary, ${Mr}),
|
|
784
|
+
0 0 var(--ht-cell-editor-shadow-blur-radius, 0) 0 var(--hot-primary, transparent);
|
|
785
|
+
`}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/* Celda activa */
|
|
789
|
+
.hot-scope .handsontable .current {
|
|
790
|
+
outline: ${`1px solid var(--hot-primary, ${Mr})`};
|
|
791
|
+
outline-offset: -1px;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/* Capas de selección (todas las áreas, incluyendo selección por filas/columnas) */
|
|
795
|
+
.hot-scope .handsontable [class^="ht__selection"] .area,
|
|
796
|
+
.hot-scope .handsontable [class*=" ht__selection"] .area {
|
|
797
|
+
background-color: ${`color-mix(in srgb, var(--hot-primary, ${Mr}) 20%, transparent);`};
|
|
798
|
+
border-color: ${`var(--hot-primary, ${Mr}) !important;`};
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/* Bordes de selección (cuadro que dibuja Handsontable) */
|
|
802
|
+
.hot-scope .handsontable .wtBorder {
|
|
803
|
+
background: ${`var(--hot-primary, ${Mr}) !important;`};
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.hot-scope .handsontable .wtBorder.corner {
|
|
807
|
+
border-color: ${`var(--hot-primary, ${Mr}) !important;`};
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/* Encabezados (headers) resaltados al seleccionar filas/columnas */
|
|
811
|
+
//.hot-scope .ht_clone_left.handsontable th.ht__highlight,
|
|
812
|
+
//.hot-scope .ht_clone_left.handsontable th.ht__active_highlight,
|
|
813
|
+
//.hot-scope .ht_clone_top.handsontable th.ht__highlight,
|
|
814
|
+
//.hot-scope .ht_clone_top.handsontable th.ht__active_highlight {
|
|
815
|
+
// background-color: ${`var(--hot-primary, ${Mr}) !important;`};
|
|
816
|
+
// border-color: ${`var(--hot-primary, ${Mr}) !important;`};
|
|
817
|
+
//}
|
|
818
|
+
|
|
819
|
+
.hot-scope .ht_clone_left.handsontable th.ht__active_highlight,
|
|
820
|
+
.hot-scope .ht_clone_top.handsontable th.ht__active_highlight {
|
|
821
|
+
background-color: ${`var(--hot-primary, ${Mr}) !important;`};
|
|
822
|
+
border-color: ${`var(--hot-primary, ${Mr}) !important;`};
|
|
823
|
+
box-shadow: ${"0 -1px 0 0 var(--hot-primary)"};
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
.hot-scope .handsontable thead tr th.ht__active_highlight {
|
|
827
|
+
box-shadow: ${`-1px 0 0 0 var(--hot-primary, ${Mr}) !important;`}
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.hot-scope .handsontable .handsontable td.area:before {
|
|
831
|
+
background-color: ${`var(--hot-primary, ${Mr});`}
|
|
832
|
+
}
|
|
833
|
+
`,sme=Ze.div`
|
|
834
|
+
/* Este contenedor define la variable que todo Handsontable interno consumirá */
|
|
835
|
+
`;function ame({onUpdateItemData:t,...e}){var a,l;const r=((a=e.item)==null?void 0:a.row_num)??0,n=((l=e.item)==null?void 0:l.row_start)??0,i=(u,c)=>{const h=[...e.item.items];h[u]=c,t==null||t(u,c),e.onUpdate({...e.item,items:h})},o=Array.from({length:r},(u,c)=>{const h={};return e.item.items.forEach((d,f)=>{var b;const g=n-f,w=`${d.column}${f+c+g}`,v=(b=d==null?void 0:d.value)==null?void 0:b.find(p=>(p==null?void 0:p.cell)===w);h[`${d.column}-${f}`]=v==null?void 0:v.value}),h}),s={autocomplete:"autocomplete",check:"checkbox",datetime:"date",dropdown:"dropdown",handsontable:"handsontable",number:"numeric",password:"password",select:"select",textarea:"text",input:"text",time:"time"};return he.jsxs(oe.Fragment,{children:[he.jsx(ome,{}),he.jsx(sme,{className:"hot-scope",children:he.jsx(iV,{data:o,rowHeaders:!0,colHeaders:!0,height:"auto",autoWrapRow:!0,autoWrapCol:!0,licenseKey:"non-commercial-and-evaluation",afterChange:(u,c)=>{u==null||u.forEach(({"0":h,"1":d,"3":f})=>{const{"0":g,"1":w}=d.toString().replace(/[^a-zA-Z0-9\-]/g,"").split("-"),v=e.item.items.find(b=>b.column===g);if(v&&["edit","Autofill.fill"].includes(c)){const b=v.value??[];if(h>0)for(let p=0;p<h;p++)b[p]||(b[p]={value:c==="Autofill.fill"?f:"",cell:`${g}${n+p}`});b[h]={value:f,cell:`${g}${n+h}`},i(parseInt(w),{...v,value:b})}})},children:e.item.items.map((u,c)=>{var f;const h=s[u.type],d={};return h=="select"&&(d.selectOptions=(f=u.option)==null?void 0:f.map(g=>g.value)),h=="numeric"&&(d.numericFormat={pattern:"0.########"}),he.jsx(j_,{readOnly:e.mode!==JE.READ,type:h,title:u.alias,data:`${u.column}-${c}`,...d},c)})})})]})}const lme={form:JU,table:ame},ume=({tab:t,mode:e,onUpdate:r,config:n,activeItemOptions:i,onItemOptions:o,itemOptions:s})=>{const a=(l,u)=>{const c=[...t.items];c[l]={...c[l],...u},r({items:c})};return he.jsxs(oe.Fragment,{children:[i&&he.jsx(pU,{config:n,languageConfig:n==null?void 0:n.formOptions,onSpanChange:l=>o==null?void 0:o({...s,span:l}),onSizeChange:l=>{o==null||o({...s,size:l})},span:s.span,size:s.size}),t.items.map((l,u)=>{const c=lme[l.type];return he.jsxs(cU,{children:[he.jsx(AR.Title,{theme:n==null?void 0:n.theme,level:3,children:l.alias}),c&&he.jsx(c,{itemOptions:s,config:n,item:l,onUpdate:h=>a(u,h),mode:e})]},u)})]})};function cme({activeKey:t,tabs:e,mode:r=JE.READ,setActiveKey:n,updateTab:i,config:o,activeOptions:s=!1}){var u,c;const[a,l]=oe.useState({size:"middle",span:24});return he.jsx(bU,{size:a.size,theme:o==null?void 0:o.theme,tabPosition:((c=(u=o==null?void 0:o.components)==null?void 0:u.Tabs)==null?void 0:c.tabPosition)??"bottom",type:"card",activeKey:t,onChange:h=>n==null?void 0:n(h),items:e.map((h,d)=>({key:d.toString(),label:he.jsx("span",{children:h.sheet||"Sin nombre"}),children:he.jsx(ume,{activeItemOptions:s,itemOptions:a,onItemOptions:l,config:o,tab:h,onUpdate:f=>i==null?void 0:i(d,f),mode:r})}))})}const hme=Ze.div`
|
|
836
|
+
width: 100%;
|
|
837
|
+
display: flex;
|
|
838
|
+
justify-content: center;
|
|
839
|
+
`,dme=({clientId:t,templateId:e,onData:r,options:n})=>{const{lastMessage:i}=zB(rU(Ak.applyActions,n),{queryParams:{Authorization:`Bearer ${t}`,"X-ws-identifier":e}});return oe.useEffect(()=>{r==null||r(i==null?void 0:i.data)},[i==null?void 0:i.data]),he.jsx(he.Fragment,{})};function fme({token:t,identity:e,apiBaseUrl:r,protocol:n,waitKeyboard:i=1500,config:o,activeOptions:s,textLoading:a}){var P;ud.API_GO_XCEL_HOST=`${r}`;const[l,u]=oe.useState(!0),[c,h]=oe.useState(),{tabs:d,activeKey:f,setActiveKey:g,addTab:w,removeTab:v,updateTab:b,setTabs:p}=eU(),[_]=Jj(async G=>{O(G)},i),O=async G=>{ud.applyAction(t,{template__uuid:`${c==null?void 0:c.uuid}`,actions:G}).then(j=>{console.log(j)}).catch(j=>{console.error(j)}).finally(()=>{})},T=(G,j)=>{p(G==null?void 0:G.map((A,q)=>({...A,items:A.items.map((Q,ue)=>({...Q,items:Q.items.map((J,Z)=>{var ne,ee,te,ae;return{...J,value:(J==null?void 0:J.value)??((ae=(te=(ee=(ne=j==null?void 0:j[q])==null?void 0:ne.items)==null?void 0:ee[ue])==null?void 0:te.items[Z])==null?void 0:ae.value)??void 0}})}))})))},M=async()=>{u(!0),ud.readTemplateIdentity(t,e).then(G=>{h(G);const{configuration:j}=(G==null?void 0:G.template_configuration)??{},A=G.values;j&&T(j,A)}).catch(G=>{console.error(G)}).finally(()=>{u(!1)})};return oe.useEffect(()=>{M()},[]),he.jsxs(he.Fragment,{children:[he.jsx(nU,{primary:(P=o==null?void 0:o.theme)==null?void 0:P.primaryColor}),c&&he.jsx(dme,{options:{apiBaseUrl:`${r}`,protocol:n},onData:G=>{if(G){const j=JSON.parse(G);T(j.notification)}},clientId:t,templateId:c.uuid}),l?he.jsx(hme,{children:he.jsx(lU,{text:a,theme:o==null?void 0:o.theme})}):he.jsx(he.Fragment,{children:he.jsx(cme,{activeOptions:s,config:o,activeKey:f,setActiveKey:G=>g(G),addTab:w,removeTab:v,updateTab:(G,j)=>{const A=b(G,j);_(A)},tabs:d},d.length)})]})}function gme(t){return he.jsx(fme,{...t})}exports.GoXcelInterpret=gme;
|