PageSourceSearch

https://snfalyze.ai/_next/static/chunks/5125.4efb33555fa3d990.js

js snfalyze.ai collected 2026-10-05 15:07:29 UTC 1,596,107 bytes, 134 lines download raw bytes

vendor: 61,170 bytes, line 1
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5125],{15554:function(e,t,r){"use strict";r.r(t),r.d(t,{Alternation:function(){return eD},CstParser:function(){return rl},EMPTY_ALT:function(){return rs},EOF:function(){return eR},EarlyExitException:function(){return tH},EmbeddedActionsParser:function(){return rh},Flat:function(){return eO},GAstVisitor:function(){return eW},Lexer:function(){return eh},LexerDefinitionErrorType:function(){return w},MismatchedTokenException:function(){return tL},NoViableAltException:function(){return tk},NonTerminal:function(){return eI},NotAllInputParsedException:function(){return tD},Option:function(){return ex},Parser:function(){return ra},ParserDefinitionErrorType:function(){return C},Repetition:function(){return eL},RepetitionMandatory:function(){return e_},RepetitionMandatoryWithSeparator:function(){return eP},RepetitionWithSeparator:function(){return ek},Rule:function(){return eM},Terminal:function(){return eH},VERSION:function(){return R},assignOccurrenceIndices:function(){return tA},clearCache:function(){return rv},createSyntaxDiagramsCode:function(){return ru},createToken:function(){return eS},createTokenInstance:function(){return eb},defaultGrammarResolverErrorProvider:function(){return tS},defaultGrammarValidatorErrorProvider:function(){return tC},defaultLexerErrorProvider:function(){return ea},defaultParserErrorProvider:function(){return tE},generateParserFactory:function(){return rm},generateParserModule:function(){return ry},isRecognitionException:function(){return tP},resolveGrammar:function(){return tT},serializeGrammar:function(){return eB},serializeProduction:function(){return eF},tokenLabel:function(){return eu},tokenMatcher:function(){return eT},tokenName:function(){return ec},validateGrammar:function(){return tN}});var i,n,o,s,a,l,h,u,c,d,g,p,f,m,y,w,E,S,C,R="6.5.0",b=r(45937),T=r(76489),N={},A=new T.RegExpParser;function I(e){var t=e.toString();if(N.hasOwnProperty(t))return N[t];var r=A.pattern(t);return N[t]=r,r}var M=(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),O="Complement Sets are not supported for first char optimization",x='Unable to use "first char" lexer optimizations:\n';function _(e,t,r){var i=Z(e);t[i]=i,!0===r&&function(e,t){var r=String.fromCharCode(e),i=r.toUpperCase();if(i!==r){var n=Z(i.charCodeAt(0));t[n]=n}else{var o=r.toLowerCase();if(o!==r){var n=Z(o.charCodeAt(0));t[n]=n}}}(e,t)}function P(e,t){return(0,b.sE)(e.value,function(e){return"number"==typeof e?(0,b.r3)(t,e):void 0!==(0,b.sE)(t,function(t){return e.from<=t&&t<=e.to})})}var L=function(e){function t(t){var r=e.call(this)||this;return r.targetCharCodes=t,r.found=!1,r}return M(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){(0,b.r3)(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===P(e,this.targetCharCodes)&&(this.found=!0):void 0!==P(e,this.targetCharCodes)&&(this.found=!0)},t}(T.BaseRegExpVisitor);function k(e,t){if(!(t instanceof RegExp))return void 0!==(0,b.sE)(t,function(t){return(0,b.r3)(e,t.charCodeAt(0))});var r=I(t),i=new L(e);return i.visit(r),i.found}var D=(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),H="PATTERN",B="defaultMode",F="modes",V="boolean"==typeof RegExp("(?:)").sticky,U=/[^\\][\$]/,W=/[^\\[][\^]|^\^/;function j(e){var t=e.ignoreCase?"i":"";return RegExp("^(?:"+e.source+")",t)}function G(e){var t=e.ignoreCase?"iy":"y";return RegExp(""+e.source,t)}function $(e){var t=e.PATTERN;if((0,b.Kj)(t))return!1;if((0,b.mf)(t)||(0,b.e$)(t,"exec"))return!0;if((0,b.HD)(t))return!1;throw Error("non exhaustive match")}function z(e){return!!(0,b.HD)(e)&&1===e.length&&e.charCodeAt(0)}var Y={test:function(e){for(var t=e.length,r=this.lastIndex;r<t;r++){var i=e.charCodeAt(r);if(10===i)return this.lastIndex=r+1,!0;if(13===i)return 10===e.charCodeAt(r+1)?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function K(e,t){if((0,b.e$)(e,"LINE_BREAKS"))return!1;if((0,b.Kj)(e.PATTERN)){try{k(t,e.PATTERN)}catch(e){return{issue:w.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if((0,b.HD)(e.PATTERN))return!1;if($(e))return{issue:w.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function X(e){return(0,b.UI)(e,function(e){return(0,b.HD)(e)&&e.length>0?e.charCodeAt(0):e})}function q(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}function Z(e){return e<256?e:Q[e]}var Q=[];function J(e,t){var r=e.tokenTypeIdx;return r===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[r]}function ee(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var et=1,er={};function ei(e){var t=function(e){for(var t=(0,b.Qw)(e),r=e,i=!0;i;){r=(0,b.oA)((0,b.xH)((0,b.UI)(r,function(e){return e.CATEGORIES})));var n=(0,b.e5)(r,t);t=t.concat(n),(0,b.xb)(n)?i=!1:r=n}return t}(e);(0,b.Ed)(t,function(e){en(e)||(er[et]=e,e.tokenTypeIdx=et++),eo(e)&&!(0,b.kJ)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),eo(e)||(e.CATEGORIES=[]),(0,b.e$)(e,"categoryMatches")||(e.categoryMatches=[]),(0,b.e$)(e,"categoryMatchesMap")||(e.categoryMatchesMap={})}),(0,b.Ed)(t,function(e){(function e(t,r){(0,b.Ed)(t,function(e){r.categoryMatchesMap[e.tokenTypeIdx]=!0}),(0,b.Ed)(r.CATEGORIES,function(i){var n=t.concat(r);(0,b.r3)(n,i)||e(n,i)})})([],e)}),(0,b.Ed)(t,function(e){e.categoryMatches=[],(0,b.Ed)(e.categoryMatchesMap,function(t,r){e.categoryMatches.push(er[r].tokenTypeIdx)})}),(0,b.Ed)(t,function(e){e.isParent=e.categoryMatches.length>0})}function en(e){return(0,b.e$)(e,"tokenTypeIdx")}function eo(e){return(0,b.e$)(e,"CATEGORIES")}function es(e){return(0,b.e$)(e,"tokenTypeIdx")}var ea={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,r,i,n){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+r+" characters."}};(o=w||(w={}))[o.MISSING_PATTERN=0]="MISSING_PATTERN",o[o.INVALID_PATTERN=1]="INVALID_PATTERN",o[o.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",o[o.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",o[o.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",o[o.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",o[o.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",o[o.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",o[o.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",o[o.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",o[o.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",o[o.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",o[o.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",o[o.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",o[o.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",o[o.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",o[o.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK";var el={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:ea,traceInitPerf:!1,skipValidations:!1};Object.freeze(el);var eh=function(){function e(e,t){var r=this;if(void 0===t&&(t=el),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=(0,b.TS)(el,t);var i=this.config.traceInitPerf;!0===i?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof i&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var i,n=!0;r.TRACE_INIT("Lexer Config handling",function(){if(r.config.lineTerminatorsPattern===el.lineTerminatorsPattern)r.config.lineTerminatorsPattern=Y;else if(r.config.lineTerminatorCharacters===el.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');r.trackStartLines=/full|onlyStart/i.test(r.config.positionTracking),r.trackEndLines=/full/i.test(r.config.positionTracking),(0,b.kJ)(e)?((i={modes:{}}).modes[B]=(0,b.Qw)(e),i[B]=B):(n=!1,i=(0,b.Cl)(e))}),!1===r.config.skipValidations&&(r.TRACE_INIT("performRuntimeChecks",function(){var e,t;r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((e=i,r.trackStartLines,r.config.lineTerminatorCharacters,t=[],(0,b.e$)(e,B)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+B+"> property in its definition\n",type:w.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,b.e$)(e,F)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+F+"> property in its definition\n",type:w.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,b.e$)(e,F)&&(0,b.e$)(e,B)&&!(0,b.e$)(e.modes,e.defaultMode)&&t.push({message:"A MultiMode Lexer cannot be initialized with a "+B+": <"+e.defaultMode+">which does not exist\n",type:w.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,b.e$)(e,F)&&(0,b.Ed)(e.modes,function(e,r){(0,b.Ed)(e,function(e,i){(0,b.o8)(e)&&t.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+r+"> at index: <"+i+">\n",type:w.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),t))}),r.TRACE_INIT("performWarningRuntimeChecks",function(){var e,t,n,o,s,a,l,h;r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat((e=i,t=r.trackStartLines,n=r.config.lineTerminatorCharacters,o=[],s=!1,a=(0,b.oA)((0,b.xH)((0,b.Q8)(e.modes,function(e){return e}))),l=(0,b.d1)(a,function(e){return e[H]===eh.NA}),h=X(n),t&&(0,b.Ed)(l,function(e){var t=K(e,h);if(!1!==t){var r={message:function(e,t){if(t.issue===w.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n	The problem is in the <"+e.name+"> Token Type\n	 Root cause: "+t.errMsg+".\n	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===w.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n	The problem is in the <"+e.name+"> Token Type\n	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}(e,t),type:t.issue,tokenType:e};o.push(r)}else(0,b.e$)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(s=!0):k(h,e.PATTERN)&&(s=!0)}),t&&!s&&o.push({message:"Warning: No LINE_BREAKS Found.\n	This Lexer has been defined to track line and column information,\n	But none of the Token Types can be identified as matching a line terminator.\n	See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n	for details.",type:w.NO_LINE_BREAKS_FLAGS}),o))})),i.modes=i.modes?i.modes:{},(0,b.Ed)(i.modes,function(e,t){i.modes[t]=(0,b.d1)(e,function(e){return(0,b.o8)(e)})});var o=(0,b.XP)(i.modes);if((0,b.Ed)(i.modes,function(e,i){r.TRACE_INIT("Mode: <"+i+"> processing",function(){if(r.modes.push(i),!1===r.config.skipValidations&&r.TRACE_INIT("validatePatterns",function(){var t,i,n,s,a,l,h,u,c,d,g,p,f,m,y,E,S,C,R,N,A,M;r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((t=[],a=(0,b.hX)(e,function(e){return!(0,b.e$)(e,H)}),i={errors:(0,b.UI)(a,function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:w.MISSING_PATTERN,tokenTypes:[e]}}),valid:(0,b.e5)(e,a)},t=t.concat(i.errors),s=(l=i.valid,h=(0,b.hX)(l,function(e){var t=e[H];return!(0,b.Kj)(t)&&!(0,b.mf)(t)&&!(0,b.e$)(t,"exec")&&!(0,b.HD)(t)}),n={errors:(0,b.UI)(h,function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:w.INVALID_PATTERN,tokenTypes:[e]}}),valid:(0,b.e5)(l,h)}).valid,t=(t=(t=(t=(t=t.concat(n.errors)).concat((u=[],c=(0,b.hX)(s,function(e){return(0,b.Kj)(e[H])}),(u=(u=(u=(u=u.concat((d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return D(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(T.BaseRegExpVisitor),g=(0,b.hX)(c,function(e){var t=e[H];try{var r=I(t),i=new d;return i.visit(r),i.found}catch(e){return U.test(t.source)}}),(0,b.UI)(g,function(e){return{message:"Unexpected RegExp Anchor Error:\n	Token Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n	See sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.",type:w.EOI_ANCHOR_FOUND,tokenTypes:[e]}})))).concat((p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return D(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(T.BaseRegExpVisitor),f=(0,b.hX)(c,function(e){var t=e[H];try{var r=I(t),i=new p;return i.visit(r),i.found}catch(e){return W.test(t.source)}}),(0,b.UI)(f,function(e){return{message:"Unexpected RegExp Anchor Error:\n	Token Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n	See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.",type:w.SOI_ANCHOR_FOUND,tokenTypes:[e]}})))).concat((m=(0,b.hX)(c,function(e){var t=e[H];return t instanceof RegExp&&(t.multiline||t.global)}),(0,b.UI)(m,function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:w.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}})))).concat((y=[],E=(0,b.UI)(c,function(e){return(0,b.u4)(c,function(t,r){return e.PATTERN.source!==r.PATTERN.source||(0,b.r3)(y,r)||r.PATTERN===eh.NA||(y.push(r),t.push(r)),t},[])}),E=(0,b.oA)(E),S=(0,b.hX)(E,function(e){return e.length>1}),(0,b.UI)(S,function(e){var t=(0,b.UI)(e,function(e){return e.name});return{message:"The same RegExp pattern ->"+(0,b.Ps)(e).PATTERN+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:w.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})))).concat((C=(0,b.hX)(c,function(e){return e[H].test("")}),(0,b.UI)(C,function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:w.EMPTY_MATCH_PATTERN,tokenTypes:[e]}})))))).concat((R=(0,b.hX)(s,function(e){if(!(0,b.e$)(e,"GROUP"))return!1;var t=e.GROUP;return t!==eh.SKIPPED&&t!==eh.NA&&!(0,b.HD)(t)}),(0,b.UI)(R,function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:w.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}})))).concat((N=(0,b.hX)(s,function(e){return void 0!==e.PUSH_MODE&&!(0,b.r3)(o,e.PUSH_MODE)}),(0,b.UI)(N,function(e){return{message:"Token Type: ->"+e.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+e.PUSH_MODE+"<-which does not exist",type:w.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}})))).concat((A=[],M=(0,b.u4)(s,function(e,t,r){var i=t.PATTERN;return i===eh.NA||((0,b.HD)(i)?e.push({str:i,idx:r,tokenType:t}):(0,b.Kj)(i)&&void 0===(0,b.sE)([".","\\","[","]","|","^","$","(",")","?","*","+","{"],function(e){return -1!==i.source.indexOf(e)})&&e.push({str:i.source,idx:r,tokenType:t})),e},[]),(0,b.Ed)(s,function(e,t){(0,b.Ed)(M,function(r){var i=r.str,n=r.idx,o=r.tokenType;if(t<n&&function(e,t){if((0,b.Kj)(t)){var r=t.exec(e);return null!==r&&0===r.index}if((0,b.mf)(t))return t(e,0,[],{});if((0,b.e$)(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(i,e.PATTERN)){var s="Token: ->"+o.name+"<- can never be matched.\nBecause it appears AFTER the Token Type ->"+e.name+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";A.push({message:s,type:w.UNREACHABLE_PATTERN,tokenTypes:[e,o]})}})}),A))))}),(0,b.xb)(r.lexerDefinitionErrors)){var n;ei(e),r.TRACE_INIT("analyzeTokenTypes",function(){var i,o,s,a,l,h,u,c,d,g,p,f,m,y,w,E,S;i={lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:r.TRACE_INIT.bind(r)},(y=(i=(0,b.ce)(i,{useSticky:V,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer)("initCharCodeToOptimizedIndexMap",function(){(function(){if((0,b.xb)(Q)){Q=Array(65536);for(var e=0;e<65536;e++)Q[e]=e>255?255+~~(e/255):e}})()}),y("Reject Lexer.NA",function(){o=(0,b.d1)(e,function(e){return e[H]===eh.NA})}),w=!1,y("Transform Patterns",function(){w=!1,s=(0,b.UI)(o,function(e){var t=e[H];if((0,b.Kj)(t)){var r=t.source;return 1===r.length&&"^"!==r&&"$"!==r&&"."!==r?r:2!==r.length||"\\"!==r[0]||(0,b.r3)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?i.useSticky?G(t):j(t):r[1]}if((0,b.mf)(t))return w=!0,{exec:t};if((0,b.e$)(t,"exec"))return w=!0,t;if("string"==typeof t){if(1===t.length)return t;var n=new RegExp(t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"));return i.useSticky?G(n):j(n)}throw Error("non exhaustive match")})}),y("misc mapping",function(){a=(0,b.UI)(o,function(e){return e.tokenTypeIdx}),l=(0,b.UI)(o,function(e){var t=e.GROUP;if(t!==eh.SKIPPED){if((0,b.HD)(t))return t;if((0,b.o8)(t))return!1;throw Error("non exhaustive match")}}),h=(0,b.UI)(o,function(e){var t=e.LONGER_ALT;if(t)return(0,b.cq)(o,t)}),u=(0,b.UI)(o,function(e){return e.PUSH_MODE}),c=(0,b.UI)(o,function(e){return(0,b.e$)(e,"POP_MODE")})}),y("Line Terminator Handling",function(){var e=X(i.lineTerminatorCharacters);d=(0,b.UI)(o,function(e){return!1}),"onlyOffset"!==i.positionTracking&&(d=(0,b.UI)(o,function(t){return(0,b.e$)(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===K(t,e)?k(e,t.PATTERN):void 0}))}),y("Misc Mapping #2",function(){g=(0,b.UI)(o,$),p=(0,b.UI)(s,z),f=(0,b.u4)(o,function(e,t){var r=t.GROUP;return(0,b.HD)(r)&&r!==eh.SKIPPED&&(e[r]=[]),e},{}),m=(0,b.UI)(s,function(e,t){return{pattern:s[t],longerAlt:h[t],canLineTerminator:d[t],isCustom:g[t],short:p[t],group:l[t],push:u[t],pop:c[t],tokenTypeIdx:a[t],tokenType:o[t]}})}),E=!0,S=[],i.safeMode||y("First Char Optimization",function(){S=(0,b.u4)(o,function(e,t,r){if("string"==typeof t.PATTERN){var n;q(e,Z(t.PATTERN.charCodeAt(0)),m[r])}else if((0,b.kJ)(t.START_CHARS_HINT))(0,b.Ed)(t.START_CHARS_HINT,function(t){var i=Z("string"==typeof t?t.charCodeAt(0):t);n!==i&&(n=i,q(e,i,m[r]))});else if((0,b.Kj)(t.PATTERN)){if(t.PATTERN.unicode)E=!1,i.ensureOptimizations&&(0,b.WB)(""+x+"	Unable to analyze < "+t.PATTERN.toString()+" > pattern.\n	The regexp unicode flag is not currently supported by the regexp-to-ast library.\n	This will disable the lexer's first char optimizations.\n	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var o=function(e,t){void 0===t&&(t=!1);try{var r=I(e);return function e(t,r,i){switch(t.type){case"Disjunction":for(var n=0;n<t.value.length;n++)e(t.value[n],r,i);break;case"Alternative":for(var o=t.value,n=0;n<o.length;n++){var s=o[n];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}switch(s.type){case"Character":_(s.value,r,i);break;case"Set":if(!0===s.complement)throw Error(O);(0,b.Ed)(s.value,function(e){if("number"==typeof e)_(e,r,i);else if(!0===i)for(var t=e.from;t<=e.to;t++)_(t,r,i);else{for(var t=e.from;t<=e.to&&t<256;t++)_(t,r,i);if(e.to>=256)for(var n=e.from>=256?e.from:256,o=e.to,s=Z(n),a=Z(o),l=s;l<=a;l++)r[l]=l}});break;case"Group":e(s.value,r,i);break;default:throw Error("Non Exhaustive Match")}var a=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===function e(t){return!!t.quantifier&&0===t.quantifier.atLeast||!!t.value&&((0,b.kJ)(t.value)?(0,b.yW)(t.value,e):e(t.value))}(s)||"Group"!==s.type&&!1===a)break}break;default:throw Error("non exhaustive match!")}return(0,b.VO)(r)}(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===O)t&&(0,b.rr)(""+x+"	Unable to optimize: < "+e.toString()+" >\n	Complement Sets cannot be automatically optimized.\n	This will disable the lexer's first char optimizations.\n	See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var i="";t&&(i="\n	This will disable the lexer's first char optimizations.\n	See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),(0,b.WB)(x+"\n	Failed parsing: < "+e.toString()+" >\n	Using the regexp-to-ast library version: "+T.VERSION+"\n	Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}(t.PATTERN,i.ensureOptimizations);(0,b.xb)(o)&&(E=!1),(0,b.Ed)(o,function(t){q(e,t,m[r])})}}else i.ensureOptimizations&&(0,b.WB)(""+x+"	TokenType: <"+t.name+"> is using a custom token pattern without providing <start_chars_hint> parameter.\n	This will disable the lexer's first char optimizations.\n	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),E=!1;return e},[])}),y("ArrayPacking",function(){S=(0,b.X0)(S)}),n={emptyGroups:f,patternIdxToConfig:m,charCodeToPatternIdxToConfig:S,hasCustom:w,canBeOptimized:E}}),r.patternIdxToConfig[i]=n.patternIdxToConfig,r.charCodeToPatternIdxToConfig[i]=n.charCodeToPatternIdxToConfig,r.emptyGroups=(0,b.TS)(r.emptyGroups,n.emptyGroups),r.hasCustom=n.hasCustom||r.hasCustom,r.canModeBeOptimized[i]=n.canBeOptimized}})}),r.defaultMode=i.defaultMode,!(0,b.xb)(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling)throw Error("Errors detected in definition of Lexer:\n"+(0,b.UI)(r.lexerDefinitionErrors,function(e){return e.message}).join("-----------------------\n"));(0,b.Ed)(r.lexerDefinitionWarning,function(e){(0,b.rr)(e.message)}),r.TRACE_INIT("Choosing sub-methods implementations",function(){if(V?(r.chopInput=b.Wd,r.match=r.matchWithTest):(r.updateLastIndex=b.dG,r.match=r.matchWithExec),n&&(r.handleModes=b.dG),!1===r.trackStartLines&&(r.computeNewColumn=b.Wd),!1===r.trackEndLines&&(r.updateTokenEndLineColumnLocation=b.dG),/full/i.test(r.config.positionTracking))r.createTokenInstance=r.createFullToken;else if(/onlyStart/i.test(r.config.positionTracking))r.createTokenInstance=r.createStartOnlyToken;else if(/onlyOffset/i.test(r.config.positionTracking))r.createTokenInstance=r.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+r.config.positionTracking+'"');r.hasCustom?(r.addToken=r.addTokenUsingPush,r.handlePayload=r.handlePayloadWithCustom):(r.addToken=r.addTokenUsingMemberAccess,r.handlePayload=r.handlePayloadNoCustom)}),r.TRACE_INIT("Failed Optimization Warnings",function(){var e=(0,b.u4)(r.canModeBeOptimized,function(e,t,r){return!1===t&&e.push(r),e},[]);if(t.ensureOptimizations&&!(0,b.xb)(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n	 Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n	 Or inspect the console log for details on how to resolve these issues.')}),r.TRACE_INIT("clearRegExpParserCache",function(){N={}}),r.TRACE_INIT("toFastProperties",function(){(0,b.SV)(r)})})}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!(0,b.xb)(this.lexerDefinitionErrors))throw Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+(0,b.UI)(this.lexerDefinitionErrors,function(e){return e.message}).join("-----------------------\n"));return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var r,i,n,o,s,a,l,h,u,c,d,g,p,f,m,y,w,E,S=this,C=e,R=C.length,T=0,N=0,A=Array(this.hasCustom?0:Math.floor(e.length/10)),I=[],M=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0,x=(r=this.emptyGroups,i={},n=(0,b.XP)(r),(0,b.Ed)(n,function(e){var t=r[e];if((0,b.kJ)(t))i[e]=[];else throw Error("non exhaustive match")}),i),_=this.trackStartLines,P=this.config.lineTerminatorsPattern,L=0,k=[],D=[],H=[],B=[];Object.freeze(B);var F=void 0;function V(){return k}function U(e){var t=D[Z(e)];return void 0===t?B:t}var W=function(e){if(1===H.length&&void 0===e.tokenType.PUSH_MODE){var t=S.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);I.push({offset:e.startOffset,line:void 0!==e.startLine?e.startLine:void 0,column:void 0!==e.startColumn?e.startColumn:void 0,length:e.image.length,message:t})}else{H.pop();var r=(0,b.Z$)(H);k=S.patternIdxToConfig[r],D=S.charCodeToPatternIdxToConfig[r],L=k.length;var i=S.canModeBeOptimized[r]&&!1===S.config.safeMode;F=D&&i?U:V}};function j(e){H.push(e),D=this.charCodeToPatternIdxToConfig[e],L=(k=this.patternIdxToConfig[e]).length,L=k.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;F=D&&t?U:V}for(j.call(this,t);T<R;){h=null;var G=C.charCodeAt(T),$=F(G),z=$.length;for(o=0;o<z;o++){var Y=(E=$[o]).pattern;u=null;var K=E.short;if(!1!==K?G===K&&(h=Y):!0===E.isCustom?null!==(w=Y.exec(C,T,A,x))?(h=w[0],void 0!==w.payload&&(u=w.payload)):h=null:(this.updateLastIndex(Y,T),h=this.match(Y,e,T)),null!==h){if(void 0!==(l=E.longerAlt)){var X=k[l],q=X.pattern;c=null,!0===X.isCustom?null!==(w=q.exec(C,T,A,x))?(a=w[0],void 0!==w.payload&&(c=w.payload)):a=null:(this.updateLastIndex(q,T),a=this.match(q,e,T)),a&&a.length>h.length&&(h=a,u=c,E=X)}break}}if(null!==h){if(d=h.length,void 0!==(g=E.group)&&(p=E.tokenTypeIdx,f=this.createTokenInstance(h,T,p,E.tokenType,M,O,d),this.handlePayload(f,u),!1===g?N=this.addToken(A,N,f):x[g].push(f)),e=this.chopInput(e,d),T+=d,O=this.computeNewColumn(O,d),!0===_&&!0===E.canLineTerminator){var Q=0,J=void 0,ee=void 0;P.lastIndex=0;do!0===(J=P.test(h))&&(ee=P.lastIndex-1,Q++);while(!0===J);0!==Q&&(M+=Q,O=d-ee,this.updateTokenEndLineColumnLocation(f,g,ee,Q,M,O,d))}this.handleModes(E,W,j,f)}else{for(var et=T,er=M,ei=O,en=!1;!en&&T<R;)for(C.charCodeAt(T),e=this.chopInput(e,1),T++,s=0;s<L;s++){var eo=k[s],Y=eo.pattern,K=eo.short;if(!1!==K?C.charCodeAt(T)===K&&(en=!0):!0===eo.isCustom?en=null!==Y.exec(C,T,A,x):(this.updateLastIndex(Y,T),en=null!==Y.exec(e)),!0===en)break}m=T-et,y=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(C,et,m,er,ei),I.push({offset:et,line:er,column:ei,length:m,message:y})}}return this.hasCustom||(A.length=N),{tokens:A,groups:x,errors:I}},e.prototype.handleModes=function(e,t,r,i){if(!0===e.pop){var n=e.push;t(i),void 0!==n&&r.call(this,n)}else void 0!==e.push&&r.call(this,e.push)},e.prototype.chopInput=function(e,t){return e.substring(t)},e.prototype.updateLastIndex=function(e,t){e.lastIndex=t},e.prototype.updateTokenEndLineColumnLocation=function(e,t,r,i,n,o,s){var a,l;void 0===t||(l=(a=r===s-1)?-1:0,1===i&&!0===a||(e.endLine=n+l,e.endColumn=o-1+-l))},e.prototype.computeNewColumn=function(e,t){return e+t},e.prototype.createTokenInstance=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return null},e.prototype.createOffsetOnlyToken=function(e,t,r,i){return{image:e,startOffset:t,tokenTypeIdx:r,tokenType:i}},e.prototype.createStartOnlyToken=function(e,t,r,i,n,o){return{image:e,startOffset:t,startLine:n,startColumn:o,tokenTypeIdx:r,tokenType:i}},e.prototype.createFullToken=function(e,t,r,i,n,o,s){return{image:e,startOffset:t,endOffset:t+s-1,startLine:n,endLine:n,startColumn:o,endColumn:o+s-1,tokenTypeIdx:r,tokenType:i}},e.prototype.addToken=function(e,t,r){return 666},e.prototype.addTokenUsingPush=function(e,t,r){return e.push(r),t},e.prototype.addTokenUsingMemberAccess=function(e,t,r){return e[t]=r,++t},e.prototype.handlePayload=function(e,t){},e.prototype.handlePayloadNoCustom=function(e,t){},e.prototype.handlePayloadWithCustom=function(e,t){null!==t&&(e.payload=t)},e.prototype.match=function(e,t,r){return null},e.prototype.matchWithTest=function(e,t,r){return!0===e.test(t)?t.substring(r,e.lastIndex):null},e.prototype.matchWithExec=function(e,t){var r=e.exec(t);return null!==r?r[0]:r},e.prototype.TRACE_INIT=function(e,t){if(!0!==this.traceInitPerf)return t();this.traceInitIndent++;var r=Array(this.traceInitIndent+1).join("	");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--> <"+e+">");var i=(0,b.HT)(t),n=i.time,o=i.value,s=n>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(r+"<-- <"+e+"> time: "+n+"ms"),this.traceInitIndent--,o},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();function eu(e){return ed(e)?e.LABEL:e.name}function ec(e){return e.name}function ed(e){return(0,b.HD)(e.LABEL)&&""!==e.LABEL}var eg="categories",ep="label",ef="group",em="push_mode",ey="pop_mode",ev="longer_alt",ew="line_breaks",eE="start_chars_hint";function eS(e){return eC(e)}function eC(e){var t=e.pattern,r={};if(r.name=e.name,(0,b.o8)(t)||(r.PATTERN=t),(0,b.e$)(e,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";return(0,b.e$)(e,eg)&&(r.CATEGORIES=e[eg]),ei([r]),(0,b.e$)(e,ep)&&(r.LABEL=e[ep]),(0,b.e$)(e,ef)&&(r.GROUP=e[ef]),(0,b.e$)(e,ey)&&(r.POP_MODE=e[ey]),(0,b.e$)(e,em)&&(r.PUSH_MODE=e[em]),(0,b.e$)(e,ev)&&(r.LONGER_ALT=e[ev]),(0,b.e$)(e,ew)&&(r.LINE_BREAKS=e[ew]),(0,b.e$)(e,eE)&&(r.START_CHARS_HINT=e[eE]),r}var eR=eC({name:"EOF",pattern:eh.NA});function eb(e,t,r,i,n,o,s,a){return{image:t,startOffset:r,endOffset:i,startLine:n,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function eT(e,t){return J(e,t)}ei([eR]);var eN=(s=function(e,t){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),eA=function(){function e(e){this.definition=e}return e.prototype.accept=function(e){e.visit(this),(0,b.Ed)(this.definition,function(t){t.accept(e)})},e}(),eI=function(e){function t(t){var r=e.call(this,[])||this;return r.idx=1,(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!0,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(eA),eM=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.orgText="",(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),t}(eA),eO=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),t}(eA),ex=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),t}(eA),e_=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),t}(eA),eP=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),t}(eA),eL=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),t}(eA),ek=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),t}(eA),eD=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,(0,b.f0)(r,(0,b.ei)(t,function(e){return void 0!==e})),r}return eN(t,e),t}(eA),eH=function(){function e(e){this.idx=1,(0,b.f0)(this,(0,b.ei)(e,function(e){return void 0!==e}))}return e.prototype.accept=function(e){e.visit(this)},e}();function eB(e){return(0,b.UI)(e,eF)}function eF(e){function t(e){return(0,b.UI)(e,eF)}if(e instanceof eI)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof eO)return{type:"Flat",definition:t(e.definition)};if(e instanceof ex)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof e_)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof eP)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:e.idx,separator:eF(new eH({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ek)return{type:"RepetitionWithSeparator",name:e.name,idx:e.idx,separator:eF(new eH({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof eL)return{type:"Repetition",name:e.name,idx:e.idx,definition:t(e.definition)};else if(e instanceof eD)return{type:"Alternation",name:e.name,idx:e.idx,definition:t(e.definition)};else if(e instanceof eH){var r={type:"Terminal",name:e.terminalType.name,label:eu(e.terminalType),idx:e.idx},i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=(0,b.Kj)(i)?i.source:i),r}else if(e instanceof eM)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};else throw Error("non exhaustive match")}var eV=function(){function e(){}return e.prototype.walk=function(e,t){var r=this;void 0===t&&(t=[]),(0,b.Ed)(e.definition,function(i,n){var o=(0,b.Cw)(e.definition,n+1);if(i instanceof eI)r.walkProdRef(i,o,t);else if(i instanceof eH)r.walkTerminal(i,o,t);else if(i instanceof eO)r.walkFlat(i,o,t);else if(i instanceof ex)r.walkOption(i,o,t);else if(i instanceof e_)r.walkAtLeastOne(i,o,t);else if(i instanceof eP)r.walkAtLeastOneSep(i,o,t);else if(i instanceof ek)r.walkManySep(i,o,t);else if(i instanceof eL)r.walkMany(i,o,t);else if(i instanceof eD)r.walkOr(i,o,t);else throw Error("non exhaustive match")})},e.prototype.walkTerminal=function(e,t,r){},e.prototype.walkProdRef=function(e,t,r){},e.prototype.walkFlat=function(e,t,r){var i=t.concat(r);this.walk(e,i)},e.prototype.walkOption=function(e,t,r){var i=t.concat(r);this.walk(e,i)},e.prototype.walkAtLeastOne=function(e,t,r){var i=[new ex({definition:e.definition})].concat(t,r);this.walk(e,i)},e.prototype.walkAtLeastOneSep=function(e,t,r){var i=eU(e,t,r);this.walk(e,i)},e.prototype.walkMany=function(e,t,r){var i=[new ex({definition:e.definition})].concat(t,r);this.walk(e,i)},e.prototype.walkManySep=function(e,t,r){var i=eU(e,t,r);this.walk(e,i)},e.prototype.walkOr=function(e,t,r){var i=this,n=t.concat(r);(0,b.Ed)(e.definition,function(e){var t=new eO({definition:[e]});i.walk(t,n)})},e}();function eU(e,t,r){return[new ex({definition:[new eH({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}var eW=function(){function e(){}return e.prototype.visit=function(e){switch(e.constructor){case eI:return this.visitNonTerminal(e);case eO:return this.visitFlat(e);case ex:return this.visitOption(e);case e_:return this.visitRepetitionMandatory(e);case eP:return this.visitRepetitionMandatoryWithSeparator(e);case ek:return this.visitRepetitionWithSeparator(e);case eL:return this.visitRepetition(e);case eD:return this.visitAlternation(e);case eH:return this.visitTerminal(e);case eM:return this.visitRule(e);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitFlat=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}(),ej=(a=function(e,t){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function eG(e,t){return void 0===t&&(t=[]),e instanceof ex||e instanceof eL||e instanceof ek||(e instanceof eD?(0,b.G)(e.definition,function(e){return eG(e,t)}):!(e instanceof eI&&(0,b.r3)(t,e))&&e instanceof eA&&(e instanceof eI&&t.push(e),(0,b.yW)(e.definition,function(e){return eG(e,t)})))}function e$(e){if(e instanceof eI)return"SUBRULE";if(e instanceof ex)return"OPTION";if(e instanceof eD)return"OR";if(e instanceof e_)return"AT_LEAST_ONE";if(e instanceof eP)return"AT_LEAST_ONE_SEP";if(e instanceof ek)return"MANY_SEP";if(e instanceof eL)return"MANY";else if(e instanceof eH)return"CONSUME";else throw Error("non exhaustive match")}var ez=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return ej(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+"Terminal";(0,b.e$)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";(0,b.e$)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitOption=function(e){this.dslMethods.option.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},t.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},t.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},t}(eW),eY=new ez;function eK(e){if(e instanceof eI)return eK(e.referencedRule);if(e instanceof eH)return[e.terminalType];if(e instanceof eO||e instanceof ex||e instanceof eL||e instanceof e_||e instanceof eP||e instanceof ek||e instanceof eH||e instanceof eM)return function(e){for(var t,r=[],i=e.definition,n=0,o=i.length>n,s=!0;o&&s;)s=eG(t=i[n]),r=r.concat(eK(t)),n+=1,o=i.length>n;return(0,b.jj)(r)}(e);if(e instanceof eD){var t;return t=(0,b.UI)(e.definition,function(e){return eK(e)}),(0,b.jj)((0,b.xH)(t))}throw Error("non exhaustive match")}var eX="_~IN~_",eq=(l=function(e,t){return(l=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),eZ=function(e){function t(t){var r=e.call(this)||this;return r.topProd=t,r.follows={},r}return eq(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(e,t,r){},t.prototype.walkProdRef=function(e,t,r){var i,n,o=(i=e.referencedRule,n=e.idx,i.name+n+eX+this.topProd.name),s=eK(new eO({definition:t.concat(r)}));this.follows[o]=s},t}(eV),eQ=(h=function(e,t){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function eJ(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset)}function e0(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function e1(e,t,r){void 0===e.children[t]?e.children[t]=[r]:e.children[t].push(r)}var e2=function(e){function t(t){var r=e.call(this)||this;return r.result=[],r.ruleIdx=t,r}return eQ(t,e),t.prototype.collectNamedDSLMethod=function(e,t,r){if(!(0,b.o8)(e.name)){var i,n=void 0;if(e instanceof ex||e instanceof eL||e instanceof e_||e instanceof eD)n=new t({definition:e.definition,idx:e.idx});else if(e instanceof eP||e instanceof ek)n=new t({definition:e.definition,idx:e.idx,separator:e.separator});else throw Error("non exhaustive match");var o=[n],s=(i=this.ruleIdx,e.idx|r|i);this.result.push({def:o,key:s,name:e.name,orgProd:e})}},t.prototype.visitOption=function(e){this.collectNamedDSLMethod(e,ex,512)},t.prototype.visitRepetition=function(e){this.collectNamedDSLMethod(e,eL,768)},t.prototype.visitRepetitionMandatory=function(e){this.collectNamedDSLMethod(e,e_,1024)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.collectNamedDSLMethod(e,eP,1536)},t.prototype.visitRepetitionWithSeparator=function(e){this.collectNamedDSLMethod(e,ek,1280)},t.prototype.visitAlternation=function(e){var t=this;this.collectNamedDSLMethod(e,eD,256);var r=e.definition.length>1;(0,b.Ed)(e.definition,function(i,n){if(!(0,b.o8)(i.name)){var o,s=i.definition;s=r?[new ex({definition:i.definition})]:i.definition;var a=(o=t.ruleIdx,256|e.idx|o|n+1<<24);t.result.push({def:s,key:a,name:i.name,orgProd:i})}})},t}(eW),e5=(u=function(e,t){return(u=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),e3=function(e){function t(t,r){var i=e.call(this,t,r)||this;return i.path=r,i.nextTerminalName="",i.nextTerminalOccurrence=0,i.nextTerminalName=i.path.lastTok.name,i.nextTerminalOccurrence=i.path.lastTokOccurrence,i}return e5(t,e),t.prototype.walkTerminal=function(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var i=new eO({definition:t.concat(r)});this.possibleTokTypes=eK(i),this.found=!0}},t}(function(e){function t(t,r){var i=e.call(this)||this;return i.topProd=t,i.path=r,i.possibleTokTypes=[],i.nextProductionName="",i.nextProductionOccurrence=0,i.found=!1,i.isAtEndOfPath=!1,i}return e5(t,e),t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,b.Qw)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,b.Qw)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(t,r){void 0===r&&(r=[]),this.found||e.prototype.walk.call(this,t,r)},t.prototype.walkProdRef=function(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var i=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}},t.prototype.updateExpectedNext=function(){(0,b.xb)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(eV)),e9=function(e){function t(t,r){var i=e.call(this)||this;return i.topRule=t,i.occurrence=r,i.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},i}return e5(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(eV),e4=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return e5(t,e),t.prototype.walkMany=function(t,r,i){if(t.idx===this.occurrence){var n=(0,b.Ps)(r.concat(i));this.result.isEndOfRule=void 0===n,n instanceof eH&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else e.prototype.walkMany.call(this,t,r,i)},t}(e9),e7=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return e5(t,e),t.prototype.walkManySep=function(t,r,i){if(t.idx===this.occurrence){var n=(0,b.Ps)(r.concat(i));this.result.isEndOfRule=void 0===n,n instanceof eH&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else e.prototype.walkManySep.call(this,t,r,i)},t}(e9),e8=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return e5(t,e),t.prototype.walkAtLeastOne=function(t,r,i){if(t.idx===this.occurrence){var n=(0,b.Ps)(r.concat(i));this.result.isEndOfRule=void 0===n,n instanceof eH&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else e.prototype.walkAtLeastOne.call(this,t,r,i)},t}(e9),e6=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return e5(t,e),t.prototype.walkAtLeastOneSep=function(t,r,i){if(t.idx===this.occurrence){var n=(0,b.Ps)(r.concat(i));this.result.isEndOfRule=void 0===n,n instanceof eH&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,r,i)},t}(e9);function te(e,t,r){void 0===r&&(r=[]),r=(0,b.Qw)(r);var i=[],n=0;function o(o){var s=te(o.concat((0,b.Cw)(e,n+1)),t,r);return i.concat(s)}for(;r.length<t&&n<e.length;){var s=e[n];if(s instanceof eO||s instanceof eI)return o(s.definition);if(s instanceof ex)i=o(s.definition);else if(s instanceof e_){var a=s.definition.concat([new eL({definition:s.definition})]);return o(a)}else if(s instanceof eP){var a=[new eO({definition:s.definition}),new eL({definition:[new eH({terminalType:s.separator})].concat(s.definition)})];return o(a)}else if(s instanceof ek){var a=s.definition.concat([new eL({definition:[new eH({terminalType:s.separator})].concat(s.definition)})]);i=o(a)}else if(s instanceof eL){var a=s.definition.concat([new eL({definition:s.definition})]);i=o(a)}else if(s instanceof eD)return(0,b.Ed)(s.definition,function(e){i=o(e.definition)}),i;else if(s instanceof eH)r.push(s.terminalType);else throw Error("non exhaustive match");n++}return i.push({partialPath:r,suffixDef:(0,b.Cw)(e,n)}),i}function tt(e,t,r,i){var n="EXIT_NONE_TERMINAL",o=[n],s="EXIT_ALTERNATIVE",a=!1,l=t.length,h=l-i-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!(0,b.xb)(c);){var d=c.pop();if(d===s){a&&(0,b.Z$)(c).idx<=h&&c.pop();continue}var g=d.def,p=d.idx,f=d.ruleStack,m=d.occurrenceStack;if(!(0,b.xb)(g)){var y=g[0];if(y===n){var w={idx:p,def:(0,b.Cw)(g),ruleStack:(0,b.j7)(f),occurrenceStack:(0,b.j7)(m)};c.push(w)}else if(y instanceof eH){if(p<l-1){var E=p+1;if(r(t[E],y.terminalType)){var w={idx:E,def:(0,b.Cw)(g),ruleStack:f,occurrenceStack:m};c.push(w)}}else if(p===l-1)u.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:f,occurrenceStack:m}),a=!0;else throw Error("non exhaustive match")}else if(y instanceof eI){var S=(0,b.Qw)(f);S.push(y.nonTerminalName);var C=(0,b.Qw)(m);C.push(y.idx);var w={idx:p,def:y.definition.concat(o,(0,b.Cw)(g)),ruleStack:S,occurrenceStack:C};c.push(w)}else if(y instanceof ex){var R={idx:p,def:(0,b.Cw)(g),ruleStack:f,occurrenceStack:m};c.push(R),c.push(s);var T={idx:p,def:y.definition.concat((0,b.Cw)(g)),ruleStack:f,occurrenceStack:m};c.push(T)}else if(y instanceof e_){var N=new eL({definition:y.definition,idx:y.idx}),A=y.definition.concat([N],(0,b.Cw)(g)),w={idx:p,def:A,ruleStack:f,occurrenceStack:m};c.push(w)}else if(y instanceof eP){var I=new eH({terminalType:y.separator}),N=new eL({definition:[I].concat(y.definition),idx:y.idx}),A=y.definition.concat([N],(0,b.Cw)(g)),w={idx:p,def:A,ruleStack:f,occurrenceStack:m};c.push(w)}else if(y instanceof ek){var R={idx:p,def:(0,b.Cw)(g),ruleStack:f,occurrenceStack:m};c.push(R),c.push(s);var I=new eH({terminalType:y.separator}),M=new eL({definition:[I].concat(y.definition),idx:y.idx}),A=y.definition.concat([M],(0,b.Cw)(g)),T={idx:p,def:A,ruleStack:f,occurrenceStack:m};c.push(T)}else if(y instanceof eL){var R={idx:p,def:(0,b.Cw)(g),ruleStack:f,occurrenceStack:m};c.push(R),c.push(s);var M=new eL({definition:y.definition,idx:y.idx}),A=y.definition.concat([M],(0,b.Cw)(g)),T={idx:p,def:A,ruleStack:f,occurrenceStack:m};c.push(T)}else if(y instanceof eD)for(var O=y.definition.length-1;O>=0;O--){var x={idx:p,def:y.definition[O].definition.concat((0,b.Cw)(g)),ruleStack:f,occurrenceStack:m};c.push(x),c.push(s)}else if(y instanceof eO)c.push({idx:p,def:y.definition.concat((0,b.Cw)(g)),ruleStack:f,occurrenceStack:m});else if(y instanceof eM)c.push(function(e,t,r,i){var n=(0,b.Qw)(r);n.push(e.name);var o=(0,b.Qw)(i);return o.push(1),{idx:t,def:e.definition,ruleStack:n,occurrenceStack:o}}(y,p,f,m));else throw Error("non exhaustive match")}}return u}var tr=(c=function(e,t){return(c=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});(d=E||(E={}))[d.OPTION=0]="OPTION",d[d.REPETITION=1]="REPETITION",d[d.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",d[d.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",d[d.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",d[d.ALTERNATION=5]="ALTERNATION";var ti=function(e){function t(t,r,i){var n=e.call(this)||this;return n.topProd=t,n.targetOccurrence=r,n.targetProdType=i,n}return tr(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=r.concat(i),!0)},t.prototype.walkOption=function(t,r,i){this.checkIsTarget(t,E.OPTION,r,i)||e.prototype.walkOption.call(this,t,r,i)},t.prototype.walkAtLeastOne=function(t,r,i){this.checkIsTarget(t,E.REPETITION_MANDATORY,r,i)||e.prototype.walkOption.call(this,t,r,i)},t.prototype.walkAtLeastOneSep=function(t,r,i){this.checkIsTarget(t,E.REPETITION_MANDATORY_WITH_SEPARATOR,r,i)||e.prototype.walkOption.call(this,t,r,i)},t.prototype.walkMany=function(t,r,i){this.checkIsTarget(t,E.REPETITION,r,i)||e.prototype.walkOption.call(this,t,r,i)},t.prototype.walkManySep=function(t,r,i){this.checkIsTarget(t,E.REPETITION_WITH_SEPARATOR,r,i)||e.prototype.walkOption.call(this,t,r,i)},t}(eV),tn=function(e){function t(t,r,i){var n=e.call(this)||this;return n.targetOccurrence=t,n.targetProdType=r,n.targetRef=i,n.result=[],n}return tr(t,e),t.prototype.checkIsTarget=function(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(void 0===this.targetRef||e===this.targetRef)&&(this.result=e.definition)},t.prototype.visitOption=function(e){this.checkIsTarget(e,E.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,E.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,E.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,E.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,E.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,E.ALTERNATION)},t}(eW);function to(e){for(var t=Array(e),r=0;r<e;r++)t[r]=[];return t}function ts(e){for(var t=[""],r=0;r<e.length;r++){for(var i=e[r],n=[],o=0;o<t.length;o++){var s=t[o];n.push(s+"_"+i.tokenTypeIdx);for(var a=0;a<i.categoryMatches.length;a++){var l="_"+i.categoryMatches[a];n.push(s+l)}}t=n}return t}function ta(e,t){for(var r=(0,b.UI)(e,function(e){return te([e],1)}),i=to(r.length),n=(0,b.UI)(r,function(e){var t={};return(0,b.Ed)(e,function(e){var r=ts(e.partialPath);(0,b.Ed)(r,function(e){t[e]=!0})}),t}),o=r,s=1;s<=t;s++){var a=o;o=to(a.length);for(var l=function(e){for(var r=a[e],l=0;l<r.length;l++){var h=r[l].partialPath,u=r[l].suffixDef,c=ts(h);if(function(e,t,r){for(var i=0;i<e.length;i++)if(i!==r){for(var n=e[i],o=0;o<t.length;o++)if(!0===n[t[o]])return!1}return!0}(n,c,e)||(0,b.xb)(u)||h.length===t){var d=i[e];if(!1===tu(d,h)){d.push(h);for(var g=0;g<c.length;g++){var p=c[g];n[e][p]=!0}}}else{var f=te(u,s+1,h);o[e]=o[e].concat(f),(0,b.Ed)(f,function(t){var r=ts(t.partialPath);(0,b.Ed)(r,function(t){n[e][t]=!0})})}}},h=0;h<a.length;h++)l(h)}return i}function tl(e,t,r,i){var n=new tn(e,E.ALTERNATION,i);return t.accept(n),ta(n.result,r)}function th(e,t,r,i){var n=new tn(e,r);t.accept(n);var o=n.result,s=new ti(t,e,r).startWalking();return ta([new eO({definition:o}),new eO({definition:s})],i)}function tu(e,t){e:for(var r=0;r<e.length;r++){var i=e[r];if(i.length===t.length){for(var n=0;n<i.length;n++){var o=t[n],s=i[n];if(!1==(o===s||void 0!==s.categoryMatchesMap[o.tokenTypeIdx]))continue e}return!0}}return!1}function tc(e){return(0,b.yW)(e,function(e){return(0,b.yW)(e,function(e){return(0,b.yW)(e,function(e){return(0,b.xb)(e.categoryMatches)})})})}var td=(g=function(e,t){return(g=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function tg(e){return e$(e)+"_#_"+e.idx+"_#_"+tp(e)}function tp(e){return e instanceof eH?e.terminalType.name:e instanceof eI?e.nonTerminalName:""}var tf=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return td(t,e),t.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},t.prototype.visitOption=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t.prototype.visitAlternation=function(e){this.allProductions.push(e)},t.prototype.visitTerminal=function(e){this.allProductions.push(e)},t}(eW),tm=/^[a-zA-Z_]\w*$/,ty=new RegExp(tm.source.replace("^","^\\$")),tv=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return td(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(eW),tw=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return td(t,e),t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t}(eW),tE={buildMismatchTokenMessage:function(e){var t=e.expected,r=e.actual;return e.previous,e.ruleName,"Expecting "+(ed(t)?"--> "+eu(t)+" <--":"token of type --> "+t.name+" <--")+" but found --> '"+r.image+"' <--"},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;return e.ruleName,"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,r=e.actual,i=(e.previous,e.customUserDescription);e.ruleName;var n="Expecting: ",o="\nbut found: '"+(0,b.Ps)(r).image+"'";if(i)return n+i+o;var s=(0,b.u4)(t,function(e,t){return e.concat(t)},[]),a=(0,b.UI)(s,function(e){return"["+(0,b.UI)(e,function(e){return eu(e)}).join(", ")+"]"});return n+"one of these possible Token sequences:\n"+(0,b.UI)(a,function(e,t){return"  "+(t+1)+". "+e}).join("\n")+o},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,r=e.actual,i=e.customUserDescription;e.ruleName;var n="Expecting: ",o="\nbut found: '"+(0,b.Ps)(r).image+"'";return i?n+i+o:n+"expecting at least one iteration which starts with one of these possible Token sequences::\n  <"+(0,b.UI)(t,function(e){return"["+(0,b.UI)(e,function(e){return eu(e)}).join(",")+"]"}).join(" ,")+">"+o}};Object.freeze(tE);var tS={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},tC={buildDuplicateFoundError:function(e,t){var r=e.name,i=(0,b.Ps)(t),n=i.idx,o=e$(i),s=i instanceof eH?i.terminalType.name:i instanceof eI?i.nonTerminalName:"",a="->"+o+(n>0?n:"")+"<- "+(s?"with argument: ->"+s+"<-":"")+"\n                  appears more than once ("+t.length+" times) in the top level rule: ->"+r+"<-.                  \n                  For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n                  ";return(a=a.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildInvalidNestedRuleNameError:function(e,t){return"Invalid nested rule name: ->"+t.name+"<- inside rule: ->"+e.name+"<-\nit must match the pattern: ->"+ty.toString()+"<-.\nNote that this means a nested rule name must start with the '$'(dollar) sign."},buildDuplicateNestedRuleNameError:function(e,t){return"Duplicate nested rule name: ->"+(0,b.Ps)(t).name+"<- inside rule: ->"+e.name+"<-\nA nested name must be unique in the scope of a top level grammar rule."},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+e.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(e){var t=(0,b.UI)(e.prefixPath,function(e){return eu(e)}).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\n"+("in <OR"+r)+"> inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(e){var t=(0,b.UI)(e.prefixPath,function(e){return eu(e)}).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous Alternatives Detected: <"+e.ambiguityIndices.join(" ,")+"> in <OR"+r+"> inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=e$(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <"+t+"> within Rule <"+e.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(e){return"Invalid Grammar Token name: ->"+e.tokenType.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <"+(e.emptyChoiceIdx+1)+">"+(" in <OR"+e.alternation.idx)+"> inside <"+e.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n"+("<OR"+e.alternation.idx+"> inside <"+e.topLevelRule.name)+"> Rule.\n has "+(e.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,r=t+" --> "+b.UI(e.leftRecursionPath,function(e){return e.name}).concat([t]).join(" --> ");return"Left Recursion found in grammar.\nrule: <"+t+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+r+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(e){return"Invalid grammar rule name: ->"+e.topLevelRule.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildDuplicateRuleNameError:function(e){return"Duplicate definition, rule: ->"+(e.topLevelRule instanceof eM?e.topLevelRule.name:e.topLevelRule)+"<- is already defined in the grammar: ->"+e.grammarName+"<-"}}
1,tR=(p=function(e,t){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),tb=function(e){function t(t,r){var i=e.call(this)||this;return i.nameToTopRule=t,i.errMsgProvider=r,i.errors=[],i}return tR(t,e),t.prototype.resolveRefs=function(){var e=this;(0,b.Ed)((0,b.VO)(this.nameToTopRule),function(t){e.currTopLevel=t,t.accept(e)})},t.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:C.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(eW);function tT(e){e=(0,b.ce)(e,{errMsgProvider:tS});var t,r={};return(0,b.Ed)(e.rules,function(e){r[e.name]=e}),(t=new tb(r,e.errMsgProvider)).resolveRefs(),t.errors}function tN(e){var t,r,i,n,o,s,a,l,h,u,c,d,g,p,f,m,y,w,S,R,T;return t=(e=(0,b.ce)(e,{errMsgProvider:tC,ignoredIssues:{}})).rules,r=e.maxLookahead,i=e.tokenTypes,n=e.ignoredIssues,o=e.errMsgProvider,s=e.grammarName,a=b.UI(t,function(e){return function(e,t){var r=new tf;e.accept(r);var i=r.allProductions,n=b.vM(i,tg),o=b.ei(n,function(e){return e.length>1});return b.UI(b.VO(o),function(r){var i=b.Ps(r),n=t.buildDuplicateFoundError(e,r),o=e$(i),s={message:n,type:C.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:o,occurrence:i.idx},a=tp(i);return a&&(s.parameter=a),s})}(e,o)}),l=b.UI(t,function(e){return function e(t,r,i,n){void 0===n&&(n=[]);var o=[],s=function e(t){var r=[];if(b.xb(t))return r;var i=b.Ps(t);if(i instanceof eI)r.push(i.referencedRule);else if(i instanceof eO||i instanceof ex||i instanceof e_||i instanceof eP||i instanceof ek||i instanceof eL)r=r.concat(e(i.definition));else if(i instanceof eD)r=b.xH(b.UI(i.definition,function(t){return e(t.definition)}));else if(i instanceof eH);else throw Error("non exhaustive match");var n=eG(i),o=t.length>1;if(!n||!o)return r;var s=b.Cw(t);return r.concat(e(s))}(r.definition);if(b.xb(s))return[];var a=t.name;b.r3(s,t)&&o.push({message:i.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:C.LEFT_RECURSION,ruleName:a});var l=b.e5(s,n.concat([t])),h=b.UI(l,function(r){var o=b.Qw(n);return o.push(r),e(t,r,i,o)});return o.concat(b.xH(h))}(e,e,o)}),h=[],u=[],c=[],(0,b.yW)(l,b.xb)&&(h=(0,b.UI)(t,function(e){return function(e,t){var r=new tv;e.accept(r);var i=r.alternations;return b.u4(i,function(r,i){var n=b.j7(i.definition),o=b.UI(n,function(r,n){var o=tt([r],[],null,1);return b.xb(o)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:i,emptyChoiceIdx:n}),type:C.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:i.idx,alternative:n+1}:null});return r.concat(b.oA(o))},[])}(e,o)}),u=(0,b.UI)(t,function(e){return function(e,t,r,i){var n=new tv;e.accept(n);var o=n.alternations,s=r[e.name];return s&&(o=(0,b.d1)(o,function(e){return s[e$(e)+(0===e.idx?"":e.idx)]})),o=(0,b.d1)(o,function(e){return!0===e.ignoreAmbiguities}),b.u4(o,function(r,n){var o,s,a,l,h=tl(n.idx,e,n.maxLookahead||t,n),u=(o=[],s=(0,b.u4)(h,function(e,t,r){return!0===n.definition[r].ignoreAmbiguities||(0,b.Ed)(t,function(t){var i=[r];(0,b.Ed)(h,function(e,o){r!==o&&tu(e,t)&&!0!==n.definition[o].ignoreAmbiguities&&i.push(o)}),i.length>1&&!tu(o,t)&&(o.push(t),e.push({alts:i,path:t}))}),e},[]),b.UI(s,function(t){var r=(0,b.UI)(t.alts,function(e){return e+1});return{message:i.buildAlternationAmbiguityError({topLevelRule:e,alternation:n,ambiguityIndices:r,prefixPath:t.path}),type:C.AMBIGUOUS_ALTS,ruleName:e.name,occurrence:n.idx,alternatives:[t.alts]}})),c=(a=[],l=(0,b.u4)(h,function(e,t,r){var i=(0,b.UI)(t,function(e){return{idx:r,path:e}});return e.concat(i)},[]),(0,b.Ed)(l,function(t){if(!0!==n.definition[t.idx].ignoreAmbiguities){var r=t.idx,o=t.path,s=(0,b.Oq)(l,function(e){var t;return!0!==n.definition[e.idx].ignoreAmbiguities&&e.idx<r&&(t=e.path).length<o.length&&(0,b.yW)(t,function(e,t){var r=o[t];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}),h=(0,b.UI)(s,function(t){var o=[t.idx+1,r+1],s=0===n.idx?"":n.idx;return{message:i.buildAlternationPrefixAmbiguityError({topLevelRule:e,alternation:n,ambiguityIndices:o,prefixPath:t.path}),type:C.AMBIGUOUS_PREFIX_ALTS,ruleName:e.name,occurrence:s,alternatives:o}});a=a.concat(h)}}),a);return r.concat(u,c)},[])}(e,r,n,o)}),y=[],(0,b.Ed)(t,function(e){var t=new tw;e.accept(t);var i=t.allProductions;(0,b.Ed)(i,function(t){var i=function(e){if(e instanceof ex)return E.OPTION;if(e instanceof eL)return E.REPETITION;if(e instanceof e_)return E.REPETITION_MANDATORY;if(e instanceof eP)return E.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ek)return E.REPETITION_WITH_SEPARATOR;if(e instanceof eD)return E.ALTERNATION;throw Error("non exhaustive match")}(t),n=t.maxLookahead||r,s=th(t.idx,e,i,n)[0];if((0,b.xb)((0,b.xH)(s))){var a=o.buildEmptyRepetitionError({topLevelRule:e,repetition:t});y.push({message:a,type:C.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),c=y),w=[],S=(0,b.UI)(i,function(e){return e.name}),(0,b.Ed)(t,function(e){var t=e.name;if((0,b.r3)(S,t)){var r=o.buildNamespaceConflictError(e);w.push({message:r,type:C.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),d=b.UI(i,function(e){var t;return t=[],e.name.match(tm)||t.push({message:o.buildTokenNameError({tokenType:e,expectedPattern:tm}),type:C.INVALID_TOKEN_NAME}),t}),R=[],(0,b.Ed)(t,function(e){var t=new e2("");e.accept(t);var r=(0,b.UI)(t.result,function(e){return e.orgProd});R.push((0,b.UI)(r,function(t){var r;return r=[],t.name.match(ty)||r.push({message:o.buildInvalidNestedRuleNameError(e,t),type:C.INVALID_
1NESTED_RULE_NAME,ruleName:e.name}),r}))}),g=(0,b.xH)(R),T=[],(0,b.Ed)(t,function(e){var t=new e2("");e.accept(t);var r=(0,b.vM)(t.result,function(e){return e.name}),i=(0,b.ei)(r,function(e){return e.length>1});(0,b.Ed)((0,b.VO)(i),function(t){var r=(0,b.UI)(t,function(e){return e.orgProd}),i=o.buildDuplicateNestedRuleNameError(e,r);T.push({message:i,type:C.DUPLICATE_NESTED_NAME,ruleName:e.name})})}),p=(0,b.UI)(t,function(e){return function(e,t){var r=new tv;e.accept(r);var i=r.alternations;return b.u4(i,function(r,i){return i.definition.length>255&&r.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:i}),type:C.TOO_MANY_ALTS,ruleName:e.name,occurrence:i.idx}),r},[])}(e,o)}),f=(0,b.UI)(t,function(e){var t,r;return t=[],(r=e.name).match(tm)||t.push({message:o.buildInvalidRuleNameError({topLevelRule:e,expectedPattern:tm}),type:C.INVALID_RULE_NAME,ruleName:r}),t}),m=(0,b.UI)(t,function(e){return function(e,t,r,i){var n=[];if((0,b.u4)(t,function(t,r){return r.name===e.name?t+1:t},0)>1){var o=i.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});n.push({message:o,type:C.DUPLICATE_RULE_NAME,ruleName:e.name})}return n}(e,t,s,o)}),b.xH(a.concat(d,g,T,c,l,h,u,w,p,f,m))}function tA(e){(0,b.Ed)(e.rules,function(e){var t=new ez;e.accept(t),(0,b.Ed)(t.dslMethods,function(e){(0,b.Ed)(e,function(e,t){e.idx=t+1})})})}var tI="MismatchedTokenException",tM="NoViableAltException",tO="EarlyExitException",tx="NotAllInputParsedException",t_=[tI,tM,tO,tx];function tP(e){return(0,b.r3)(t_,e.name)}function tL(e,t,r){this.name=tI,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function tk(e,t,r){this.name=tM,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function tD(e,t){this.name=tx,this.message=e,this.token=t,this.resyncedTokens=[]}function tH(e,t,r){this.name=tO,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}Object.freeze(t_),tL.prototype=Error.prototype,tk.prototype=Error.prototype,tD.prototype=Error.prototype,tH.prototype=Error.prototype;var tB={},tF="InRuleRecoveryException";function tV(e){this.name=tF,this.message=e}tV.prototype=Error.prototype;var tU=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,b.e$)(e,"recoveryEnabled")?e.recoveryEnabled:rn.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=tW)},e.prototype.getTokenToInsert=function(e){var t=eb(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,r,i){for(var n=this,o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],l=!1,h=this.LA(1),u=this.LA(1),c=function(){var e=n.LA(0),t=new tL(n.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:h,previous:e,ruleName:n.getCurrRuleFullName()}),h,n.LA(0));t.resyncedTokens=(0,b.j7)(a),n.SAVE_ERROR(t)};!l;){if(this.tokenMatcher(u,i)){c();return}if(r.call(this)){c(),e.apply(this,t);return}this.tokenMatcher(u,o)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,a))}this.importLexerState(s)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,r){return!(!1===r||void 0===e||void 0===t||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new tV("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var r=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,b.xb)(t))return!1;var i=this.LA(1);return void 0!==(0,b.sE)(t,function(e){return r.tokenMatcher(i,e)})},e.prototype.canRecoverWithSingleTokenDeletion=function(e){return this.tokenMatcher(this.LA(2),e)},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return(0,b.r3)(r,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var i=t.tokenType;if((0,b.r3)(e,i))return i;t=this.LA(r),r++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return tB;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,
vendor: 21,655 bytes, line 1
1inRule:this.shortRuleNameToFullName(r)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return(0,b.xb)(this.LAST_EXPLICIT_RULE_STACK)||(t=(0,b.UI)(this.LAST_EXPLICIT_RULE_STACK,function(t){return e.RULE_STACK[t]}),r=(0,b.UI)(this.LAST_EXPLICIT_RULE_STACK,function(t){return e.RULE_OCCURRENCE_STACK[t]})),(0,b.UI)(t,function(i,n){return 0===n?tB:{ruleName:e.shortRuleNameToFullName(i),idxInCallingRule:r[n],inRule:e.shortRuleNameToFullName(t[n-1])}})},e.prototype.flattenFollowSet=function(){var e=this,t=(0,b.UI)(this.buildFullFollowKeyStack(),function(t){return e.getFollowSetFromFollowKey(t)});return(0,b.xH)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===tB)return[eR];var t=e.ruleName+e.idxInCallingRule+eX+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,eR)||t.push(e),t},e.prototype.reSyncTo=function(e){for(var t=[],r=this.LA(1);!1===this.tokenMatcher(r,e);)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return(0,b.j7)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,r,i,n,o,s){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,b.Qw)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,b.xb)(this.LAST_EXPLICIT_RULE_STACK)?(0,b.UI)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)}):(0,b.UI)(this.LAST_EXPLICIT_RULE_STACK,function(t){return e.shortRuleNameToFullName(e.RULE_STACK[t])})},e}();function tW(e,t,r,i,n,o,s){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(void 0===l){var h=this.getCurrRuleFullName();l=new o(this.getGAstProductions()[h],n).startWalking(),this.firstAfterRepMap[a]=l}var u=l.token,c=l.occurrence,d=l.isEndOfRule;1===this.RULE_STACK.length&&d&&void 0===u&&(u=eR,c=1),this.shouldInRepetitionRecoveryBeTried(u,c,s)&&this.tryInRepetitionRecovery(e,t,r,u)}var tj=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,b.e$)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:rn.dynamicTokensEnabled,this.maxLookahead=(0,b.e$)(e,"maxLookahead")?e.maxLookahead:rn.maxLookahead,this.lookAheadFuncsCache=(0,b.dU)()?new Map:[],(0,b.dU)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,b.Ed)(e,function(e){t.TRACE_INIT(e.name+" Rule Lookahead",function(){var r,i=(eY.reset(),e.accept(eY),r=eY.dslMethods,eY.reset(),r),n=i.alternation,o=i.repetition,s=i.option,a=i.repetitionMandatory,l=i.repetitionMandatoryWithSeparator,h=i.repetitionWithSeparator;(0,b.Ed)(n,function(r){var i=0===r.idx?"":r.idx;t.TRACE_INIT(""+e$(r)+i,function(){var i,n,o,s,a,l,h,u,c=(i=r.idx,n=r.maxLookahead||t.maxLookahead,o=r.hasPredicates,s=t.dynamicTokensEnabled,a=t.lookAheadBuilderForAlternatives,h=tc(l=tl(i,e,n))?ee:J,a(l,o,h,s)),d=(u=t.fullRuleNameToShort[e.name],256|r.idx|u);t.setLaFuncCache(d,c)})}),(0,b.Ed)(o,function(r){t.computeLookaheadFunc(e,r.idx,768,E.REPETITION,r.maxLookahead,e$(r))}),(0,b.Ed)(s,function(r){t.computeLookaheadFunc(e,r.idx,512,E.OPTION,r.maxLookahead,e$(r))}),(0,b.Ed)(a,function(r){t.computeLookaheadFunc(e,r.idx,1024,E.REPETITION_MANDATORY,r.maxLookahead,e$(r))}),(0,b.Ed)(l,function(r){t.computeLookaheadFunc(e,r.idx,1536,E.REPETITION_MANDATORY_WITH_SEPARATOR,r.maxLookahead,e$(r))}),(0,b.Ed)(h,function(r){t.computeLookaheadFunc(e,r.idx,1280,E.REPETITION_WITH_SEPARATOR,r.maxLookahead,e$(r))})})})},e.prototype.computeLookaheadFunc=function(e,t,r,i,n,o){var s=this;this.TRACE_INIT(""+o+(0===t?"":t),function(){var o,a,l,h,u,c=(o=n||s.maxLookahead,a=s.dynamicTokensEnabled,l=s.lookAheadBuilderForOptional,u=tc(h=th(t,e,i,o))?ee:J,l(h[0],u,a)),d=t|r|s.fullRuleNameToShort[e.name];s.setLaFuncCache(d,c)})},e.prototype.lookAheadBuilderForOptional=function(e,t,r){return function(e,t,r){var i=(0,b.yW)(e,function(e){return 1===e.length}),n=e.length;if(!i||r)return function(){t:for(var r=0;r<n;r++){for(var i=e[r],o=i.length,s=0;s<o;s++)if(!1===t(this.LA(s+1),i[s]))continue t;return!0}return!1};var o=(0,b.xH)(e);if(1===o.length&&(0,b.xb)(o[0].categoryMatches)){var s=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}var a=(0,b.u4)(o,function(e,t,r){return e[t.tokenTypeIdx]=!0,(0,b.Ed)(t.categoryMatches,function(t){e[t]=!0}),e},[]);return function(){return!0===a[this.LA(1).tokenTypeIdx]}}(e,t,r)},e.prototype.lookAheadBuilderForAlternatives=function(e,t,r,i){return function(e,t,r,i){var n=e.length,o=(0,b.yW)(e,function(e){return(0,b.yW)(e,function(e){return 1===e.length})});if(t)return function(t){for(var i=(0,b.UI)(t,function(e){return e.GATE}),o=0;o<n;o++){var s=e[o],a=s.length,l=i[o];if(void 0===l||!1!==l.call(this))t:for(var h=0;h<a;h++){for(var u=s[h],c=u.length,d=0;d<c;d++)if(!1===r(this.LA(d+1),u[d]))continue t;return o}}};if(!o||i)return function(){for(var t=0;t<n;t++){var i=e[t],o=i.length;t:for(var s=0;s<o;s++){for(var a=i[s],l=a.length,h=0;h<l;h++)if(!1===r(this.LA(h+1),a[h]))continue t;return t}}};var s=(0,b.UI)(e,function(e){return(0,b.xH)(e)}),a=(0,b.u4)(s,function(e,t,r){return(0,b.Ed)(t,function(t){(0,b.e$)(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=r),(0,b.Ed)(t.categoryMatches,function(t){(0,b.e$)(e,t)||(e[t]=r)})}),e},[]);return function(){return a[this.LA(1).tokenTypeIdx]}}(e,t,r,i)},e.prototype.getKeyForAutomaticLookahead=function(e,t){return t|e|this.getLastExplicitRuleShortName()},e.prototype.getLaFuncFromCache=function(e){},e.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},e.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},e.prototype.setLaFuncCache=function(e,t){},e.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},e.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},e}(),tG=/^\s*function\s*(\S*)\s*\(/,t$="name";function tz(e){return e.name||e.toString().match(tG)[1]}function tY(e,t){var r=Object.getOwnPropertyDescriptor(e,t$);return(!!(0,b.o8)(r)||!!r.configurable)&&(Object.defineProperty(e,t$,{enumerable:!1,configurable:!0,writable:!1,value:t}),!0)}function tK(e,t){for(var r=(0,b.XP)(e),i=r.length,n=0;n<i;n++)for(var o=e[r[n]],s=o.length,a=0;a<s;a++){var l=o[a];void 0===l.tokenTypeIdx&&(void 0!==l.fullName?this[l.fullName](l.children,t):this[l.name](l.children,t))}}(f=S||(S={}))[f.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",f[f.MISSING_METHOD=1]="MISSING_METHOD";var tX=["constructor","visit","validateVisitor"],tq=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.outputCst=(0,b.e$)(e,"outputCst")?e.outputCst:rn.outputCst,this.nodeLocationTracking=(0,b.e$)(e,"nodeLocationTracking")?e.nodeLocationTracking:rn.nodeLocationTracking,this.outputCst){if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=e0,this.setNodeLocationFromNode=e0,this.cstPostRule=b.dG,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=b.dG,this.setNodeLocationFromNode=b.dG,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=eJ,this.setNodeLocationFromNode=eJ,this.cstPostRule=b.dG,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=b.dG,this.setNodeLocationFromNode=b.dG,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=b.dG,this.setNodeLocationFromNode=b.dG,this.cstPostRule=b.dG,this.setInitialNodeLocation=b.dG;else throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"')}else this.cstInvocationStateUpdate=b.dG,this.cstFinallyStateUpdate=b.dG,this.cstPostTerminal=b.dG,this.cstPostNonTerminal=b.dG,this.cstPostRule=b.dG,this.getLastExplicitRuleShortName=this.getLastExplicitRuleShortNameNoCst,this.getPreviousExplicitRuleShortName=this.getPreviousExplicitRuleShortNameNoCst,this.getLastExplicitRuleOccurrenceIndex=this.getLastExplicitRuleOccurrenceIndexNoCst,this.manyInternal=this.manyInternalNoCst,this.orInternal=this.orInternalNoCst,this.optionInternal=this.optionInternalNoCst,this.atLeastOneInternal=this.atLeastOneInternalNoCst,this.manySepFirstInternal=this.manySepFirstInternalNoCst,this.atLeastOneSepFirstInternal=this.atLeastOneSepFirstInternalNoCst},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstNestedInvocationStateUpdate=function(e,t){var r={name:e,fullName:this.shortRuleNameToFull[this.getLastExplicitRuleShortName()]+e,children:{}};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},e.prototype.cstInvocationStateUpdate=function(e,t){this.LAST_EXPLICIT_RULE_STACK.push(this.RULE_STACK.length-1);var r={name:e,children:{}};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},e.prototype.cstFinallyStateUpdate=function(){this.LAST_EXPLICIT_RULE_STACK.pop(),this.CST_STACK.pop()},e.prototype.cstNestedFinallyStateUpdate=function(){var e=this.CST_STACK.pop();this.cstPostRule(e)},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==!0?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==!0?r.endOffset=t.endOffset:r.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var r=this.CST_STACK[this.CST_STACK.length-1];void 0===r.children[e]?r.children[e]=[t]:r.children[e].push(t),this.setNodeLocationFromToken(r.location,t)},e.prototype.cstPostNonTerminal=function(e,t){if(!0!==this.isBackTracking()){var r=this.CST_STACK[this.CST_STACK.length-1];e1(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}},e.prototype.getBaseCstVisitorConstructor=function(){if((0,b.o8)(this.baseCstVisitorConstructor)){var e,t,r,i=(e=this.className,t=this.allRuleNames,tY(r=function(){},e+"BaseSemantics"),r.prototype={visit:function(e,t){return((0,b.kJ)(e)&&(e=e[0]),(0,b.o8)(e))?void 0:void 0!==e.fullName?this[e.fullName](e.children,t):this[e.name](e.children,t)},validateVisitor:function(){var e,r,i,n,o=(e=this,r=(0,b.UI)(t,function(t){if(!(0,b.mf)(e[t]))return{msg:"Missing visitor method: <"+t+"> on "+tz(e.constructor)+" CST Visitor.",type:S.MISSING_METHOD,methodName:t}}),i=(0,b.oA)(r),n=function(e,t){var r=[];for(var i in e)tm.test(i)&&(0,b.mf)(e[i])&&!(0,b.r3)(tX,i)&&!(0,b.r3)(t,i)&&r.push({msg:"Redundant visitor method: <"+i+"> on "+tz(e.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+tm.source+"/.",type:S.REDUNDANT_METHOD,methodName:i});return r}(this,t),i.concat(n));if(!(0,b.xb)(o)){var s=(0,b.UI)(o,function(e){return e.msg});throw Error("Errors Detected in CST Visitor <"+tz(this.constructor)+">:\n	"+s.join("\n\n").replace(/\n/g,"\n	"))}}},r.prototype.constructor=r,r._RULE_NAMES=t,r);return this.baseCstVisitorConstructor=i,i}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,b.o8)(this.baseCstVisitorWithDefaultsConstructor)){var e,t,r,i,n,o=(e=this.className,t=this.allRuleNames,r=this.getBaseCstVisitorConstructor(),tY(i=function(){},e+"BaseSemanticsWithDefaults"),n=Object.create(r.prototype),(0,b.Ed)(t,function(e){n[e]=tK}),i.prototype=n,i.prototype.constructor=i,i);return this.baseCstVisitorWithDefaultsConstructor=o,o}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.nestedRuleBeforeClause=function(e,t){var r;return void 0!==e.NAME?(r=e.NAME,this.nestedRuleInvocationStateUpdate(r,t),r):void 0},e.prototype.nestedAltBeforeClause=function(e,t,r,i){var n,o=t|r|this.getLastExplicitRuleShortName()|i+1<<24;return void 0!==e.NAME?(n=e.NAME,this.nestedRuleInvocationStateUpdate(n,o),{shortName:o,nestedName:n}):void 0},e.prototype.nestedRuleFinallyClause=function(e,t){var r=this.CST_STACK,i=r[r.length-1];this.nestedRuleFinallyStateUpdate();var n=r[r.length-1];e1(n,t,i),this.setNodeLocationFromNode(n.location,i.location)},e.prototype.getLastExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_STACK[e]},e.prototype.getLastExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-2];return this.RULE_STACK[e]},e.prototype.getPreviousExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_OCCURRENCE_STACK[e]},e.prototype.getLastExplicitRuleOccurrenceIndexNoCst=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e.prototype.nestedRuleInvocationStateUpdate=function(e,t){this.RULE_OCCURRENCE_STACK.push(1),this.RULE_STACK.push(t),this.cstNestedInvocationStateUpdate(e,t)},e.prototype.nestedRuleFinallyStateUpdate=function(){this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstNestedFinallyStateUpdate()},e}(),tZ=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!0,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):ri},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ri:this.tokVector[t]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}(),tQ=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,r){return this.consumeInternal(t,e,r)},e.prototype.subrule=function(e,t,r){return this.subruleInternal(t,e,r)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,t,r){if(void 0===r&&(r=ro),(0,b.r3)(this.definedRulesNames,e)){var i={message:tC.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:C.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(i)}this.definedRulesNames.push(e);var n=this.defineRule(e,t,r);return this[e]=n,n},e.prototype.OVERRIDE_RULE=function(e,t,r){void 0===r&&(r=ro);var i,n,o,s,a=[];a=a.concat((i=this.definedRulesNames,n=this.className,s=[],b.r3(i,e)||(o="Invalid rule override, rule: ->"+e+"<- cannot be overridden in the grammar: ->
1"+n+"<-as it is not defined in any of the super grammars ",s.push({message:o,type:C.INVALID_RULE_OVERRIDE,ruleName:e})),s)),this.definitionErrors.push.apply(this.definitionErrors,a);var l=this.defineRule(e,t,r);return this[e]=l,l},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var r=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(tP(e))return!1;throw e}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return eB((0,b.VO)(this.gastProductionsCache))},e}(),tJ=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=tz(this.constructor),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ee,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,b.e$)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n	See: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n	For Further details.");if((0,b.kJ)(e)){if((0,b.xb)(e))throw Error("A Token Vocabulary cannot be empty.\n	Note that the first argument for the parser constructor\n	is no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n	See: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n	For Further details.")}if((0,b.kJ)(e))this.tokensMap=(0,b.u4)(e,function(e,t){return e[t.name]=t,e},{});else if((0,b.e$)(e,"modes")&&(0,b.yW)((0,b.xH)((0,b.VO)(e.modes)),es)){var r=(0,b.xH)((0,b.VO)(e.modes)),i=(0,b.jj)(r);this.tokensMap=(0,b.u4)(i,function(e,t){return e[t.name]=t,e},{})}else if((0,b.Kn)(e))this.tokensMap=(0,b.Cl)(e);else throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=eR;var n=(0,b.yW)((0,b.VO)(e),function(e){return(0,b.xb)(e.categoryMatches)});this.tokenMatcher=n?ee:J,ei((0,b.VO)(this.tokensMap))},e.prototype.defineRule=function(e,t,r){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var i,n=(0,b.e$)(r,"resyncEnabled")?r.resyncEnabled:ro.resyncEnabled,o=(0,b.e$)(r,"recoveryValueFunc")?r.recoveryValueFunc:ro.recoveryValueFunc,s=this.ruleShortNameIdx<<12;function a(e){try{if(!0!==this.outputCst)return t.apply(this,e);t.apply(this,e);var r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,n,o)}finally{this.ruleFinallyStateUpdate()}}return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,(i=function(t,r){return void 0===t&&(t=0),this.ruleInvocationStateUpdate(s,e,t),a.call(this,r)}).ruleName=e,i.originalGrammarAction=t,i},e.prototype.invokeRuleCatch=function(e,t,r){var i=1===this.RULE_STACK.length,n=t&&!this.isBackTracking()&&this.recoveryEnabled;if(tP(e)){if(n){var o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o)){if(e.resyncedTokens=this.reSyncTo(o),!this.outputCst)return r();var s=this.CST_STACK[this.CST_STACK.length-1];return s.recoveredNode=!0,s}if(this.outputCst){var s=this.CST_STACK[this.CST_STACK.length-1];s.recoveredNode=!0,e.partialCstResult=s}throw e}if(i)return this.moveToTerminatedState(),r()}throw e},e.prototype.optionInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(512,t),i=this.nestedRuleBeforeClause(e,r);try{return this.optionInternalLogic(e,t,r)}finally{void 0!==i&&this.nestedRuleFinallyClause(r,i)}},e.prototype.optionInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,r)},e.prototype.optionInternalLogic=function(e,t,r){var i,n,o=this,s=this.getLaFuncFromCac
vendor: 21,053 bytes, line 1
1he(r);if(void 0!==e.DEF){if(i=e.DEF,void 0!==(n=e.GATE)){var a=s;s=function(){return n.call(o)&&a.call(o)}}}else i=e;if(!0===s.call(this))return i.call(this)},e.prototype.atLeastOneInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(1024,e),i=this.nestedRuleBeforeClause(t,r);try{return this.atLeastOneInternalLogic(e,t,r)}finally{void 0!==i&&this.nestedRuleFinallyClause(r,i)}},e.prototype.atLeastOneInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(1024,e);this.atLeastOneInternalLogic(e,t,r)},e.prototype.atLeastOneInternalLogic=function(e,t,r){var i,n,o=this,s=this.getLaFuncFromCache(r);if(void 0!==t.DEF){if(i=t.DEF,void 0!==(n=t.GATE)){var a=s;s=function(){return n.call(o)&&a.call(o)}}}else i=t;if(!0===s.call(this))for(var l=this.doSingleRepetition(i);!0===s.call(this)&&!0===l;)l=this.doSingleRepetition(i);else throw this.raiseEarlyExitException(e,E.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],s,1024,e,e8)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(1536,e),i=this.nestedRuleBeforeClause(t,r);try{this.atLeastOneSepFirstInternalLogic(e,t,r)}finally{void 0!==i&&this.nestedRuleFinallyClause(r,i)}},e.prototype.atLeastOneSepFirstInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,t,r)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,r){var i=this,n=t.DEF,o=t.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){n.call(this);for(var s=function(){return i.tokenMatcher(i.LA(1),o)};!0===this.tokenMatcher(this.LA(1),o);)this.CONSUME(o),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,s,n,e6],s,1536,e,e6)}else throw this.raiseEarlyExitException(e,E.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)},e.prototype.manyInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(768,e),i=this.nestedRuleBeforeClause(t,r);try{return this.manyInternalLogic(e,t,r)}finally{void 0!==i&&this.nestedRuleFinallyClause(r,i)}},e.prototype.manyInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,r)},e.prototype.manyInternalLogic=function(e,t,r){var i,n,o=this,s=this.getLaFuncFromCache(r);if(void 0!==t.DEF){if(i=t.DEF,void 0!==(n=t.GATE)){var a=s;s=function(){return n.call(o)&&a.call(o)}}}else i=t;for(var l=!0;!0===s.call(this)&&!0===l;)l=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],s,768,e,e4,l)},e.prototype.manySepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(1280,e),i=this.nestedRuleBeforeClause(t,r);try{this.manySepFirstInternalLogic(e,t,r)}finally{void 0!==i&&this.nestedRuleFinallyClause(r,i)}},e.prototype.manySepFirstInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,t,r)},e.prototype.manySepFirstInternalLogic=function(e,t,r){var i=this,n=t.DEF,o=t.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){n.call(this);for(var s=function(){return i.tokenMatcher(i.LA(1),o)};!0===this.tokenMatcher(this.LA(1),o);)this.CONSUME(o),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,s,n,e7],s,1280,e,e7)}},e.prototype.repetitionSepSecondInternal=function(e,t,r,i,n){for(;r();)this.CONSUME(t),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,i,n],r,1536,e,n)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t},e.prototype.orInternalNoCst=function(e,t){var r=(0,b.kJ)(e)?e:e.DEF,i=this.getKeyForAutomaticLookahead(256,t),n=this.getLaFuncFromCache(i).call(this,r);if(void 0!==n)return r[n].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.orInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(256,t),i=this.nestedRuleBeforeClause(e,r);try{var n=(0,b.kJ)(e)?e:e.DEF,o=this.getLaFuncFromCache(r).call(this,n);if(void 0!==o){var s=n[o],a=this.nestedAltBeforeClause(s,t,256,o);try{return s.ALT.call(this)}finally{void 0!==a&&this.nestedRuleFinallyClause(a.shortName,a.nestedName)}}this.raiseNoAltException(t,e.ERR_MSG)}finally{void 0!==i&&this.nestedRuleFinallyClause(r,i)}},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new tD(t,e))}},e.prototype.subruleInternal=function(e,t,r){var i;try{var n=void 0!==r?r.ARGS:void 0;return i=e.call(this,t,n),this.cstPostNonTerminal(i,void 0!==r&&void 0!==r.LABEL?r.LABEL:e.ruleName),i}catch(t){this.subruleInternalError(t,r,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,r){throw tP(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:r),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,r){var i;try{var n=this.LA(1);!0===this.tokenMatcher(n,e)?(this.consumeToken(),i=n):this.consumeInternalError(e,n,r)}catch(r){i=this.consumeInternalRecovery(e,t,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:e.name,i),i},e.prototype.consumeInternalError=function(e,t,r){var i,n=this.LA(0);throw i=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:n,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new tL(i,t,n))},e.prototype.consumeInternalRecovery=function(e,t,r){if(this.recoveryEnabled&&"MismatchedTokenException"===r.name&&!this.isBackTracking()){var i=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,i)}catch(e){if(e.name===tF)throw r;throw e}}else throw r},e.prototype.saveRecogState=function(){var e=this.errors,t=(0,b.Qw)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK,LAST_EXPLICIT_RULE_STACK:this.LAST_EXPLICIT_RULE_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),eR)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}(),t0=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,b.ce)(e.errorMessageProvider,rn.errorMessageProvider)},e.prototype.SAVE_ERROR=function(e){if(tP(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,b.Qw)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return(0,b.Qw)(this._errors)},set:function(e){this._errors=e},enumerable:!0,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,r){for(var i=this.getCurrRuleFullName(),n=th(e,this.getGAstProductions()[i],t,this.maxLookahead)[0],o=[],s=1;s<=this.maxLookahead;s++)o.push(this.LA(s));var a=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:n,actual:o,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new tH(a,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var r=this.getCurrRuleFullName(),i=tl(e,this.getGAstProductions()[r],this.maxLookahead),n=[],o=1;o<=this.maxLookahead;o++)n.push(this.LA(o));var s=this.LA(0),a=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:n,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new tk(a,this.LA(1),s))},e}(),t1=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var r=this.gastProductionsCache[e];if((0,b.o8)(r))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return tt([r],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=(0,b.Ps)(e.ruleStack);return new e3(this.getGAstProductions()[t],e).startWalking()},e}(),t2={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(t2);var t5=eC({name:"RECORDING_PHASE_TOKEN",pattern:eh.NA});ei([t5]);var t3=eb(t5,"This IToken indicates the Parser is in Recording Phase\n	See: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(t3);var t9={name:"This CSTNode indicates the Parser is in Recording Phase\n	See: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},t4=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var t=function(t){var r=t>0?t:"";e["CONSUME"+r]=function(e,r){return this.consumeInternalRecord(e,t,r)},e["SUBRULE"+r]=function(e,r){return this.subruleInternalRecord(e,t,r)},e["OPTION"+r]=function(e){return this.optionInternalRecord(e,t)},e["OR"+r]=function(e){return this.orInternalRecord(e,t)},e["MANY"+r]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP"+r]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE"+r]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP"+r]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},r=0;r<10;r++)t(r);e.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},e.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var t=0;t<10;t++){var r=t>0?t:"";delete e["CONSUME"+r],delete e["SUBRULE"+r],delete e["OPTION"+r],delete e["OR"+r],delete e["MANY"+r],delete e["MANY_SEP"+r],delete e["AT_LEAST_ONE"+r],delete e["AT_LEAST_ONE_SEP"+r]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return ri},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new eM({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n	 This error was thrown during the "grammar recording phase" For more info see:\n	https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(e){}throw e}},e.prototype.optionInternalRecord=function(e,t){return t7.call(this,ex,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){t7.call(this,e_,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){t7.call(this,eP,t,e,!0)},e.prototype.manyInternalRecord=function(e,t){t7.call(this,eL,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){t7.call(this,ek,t,e,!0)},e.prototype.orInternalRecord=function(e,t){return t8.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,r){if(re(t),!e||!1===(0,b.e$)(e,"ruleName")){var i=Error("<SUBRULE"+t6(t)+"> argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw i.KNOWN_RECORDER_ERROR=!0,i}var n=(0,b.fj)(this.recordingProdStack),o=new eI({idx:t,nonTerminalName:e.ruleName,referencedRule:void 0});return n.definition.push(o),this.outputCst?t9:t2},e.prototype.consumeInternalRecord=function(e,t,r){if(re(t),!en(e)){var i=Error("<CONSUME"+t6(t)+"> argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw i.KNOWN_RECORDER_ERROR=!0,i}var n=(0,b.fj)(this.recordingProdStack),o=new eH({idx:t,terminalType:e});return n.definition.push(o),t3},e}();function t7(e,t,r,i){void 0===i&&(i=!1),re(r);var n=(0,b.fj)(this.recordingProdStack),o=(0,b.mf)(t)?t:t.DEF,s=new e({definition:[],idx:r});return(0,b.e$)(t,"NAME")&&(s.name=t.NAME),i&&(s.separator=t.SEP),(0,b.e$)(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),n.definition.push(s),this.recordingProdStack.pop(),t2}function t8(e,t){var r=this;re(t);var i=(0,b.fj)(this.recordingProdStack),n=!1===(0,b.kJ)(e),o=!1===n?e:e.DEF,s=new eD({definition:[],idx:t,ignoreAmbiguities:n&&!0===e.IGNORE_AMBIGUITIES});(0,b.e$)(e,"NAME")&&(s.name=e.NAME),(0,b.e$)(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);var a=(0,b.G)(o,function(e){return(0,b.mf)(e.GATE)});return s.hasPredicates=a,i.definition.push(s),(0,b.Ed)(o,function(e){var t=new eO({definition:[]});s.definition.push(t),(0,b.e$)(e,"NAME")&&(t.name=e.NAME),(0,b.e$)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,b.e$)(e,"GATE")&&(t.ignoreAmbiguities=!0),r.recordingProdStack.push(t),e.ALT.call(r),r.recordingProdStack.pop()}),t2}function t6(e){return 0===e?"":""+e}function re(e){if(e<0||e>255){var t=Error("Invalid DSL Method idx value: <"+e+">\n	Idx value must be a none negative value smaller than 256");throw t.KNOWN_RECORDER_ERROR=!0,t}}var rt=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if((0,b.e$)(e,"traceInitPerf")){var t=e.traceInitPerf,r="number"==typeof t;this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=rn.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0!==this.traceInitPerf)return t();this.traceInitIndent++;var r=Array(this.traceInitIndent+1).join("	");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--> <"+e+">");var i=(0,b.HT)(t),n=i.time,o=i.value,s=n>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(r+"<-- <"+e+"> time: "+n+"ms"),this.traceInitIndent--,o},e}(),rr=(m=function(e,t){return(m=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ri=eb(eR,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ri);var rn=Object.freeze({recoveryEnabled:!1,maxLookahead:4,ignoredIssues:{},dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:tE,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ro=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function rs(e){return void 0===e&&(e=void 0),function(){return e}}(y=C||(C={}))[y.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",y[y.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",y[y.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",y[y.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",y[y.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",y[y.LEFT_RECURSION=5]="LEFT_RECURSION",y[y.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",y[y.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",y[y.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",y[y.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",y[y.INVALID_NESTED_RULE_NAME=10]="INVALID_NESTED_RULE_NAME",y[y.DUPLICATE_NESTED_NAME=11]="DUPLICATE_NESTED_NAME",y[y.NO_NON_EMPTY_LOOKAHEAD=12]="NO_NON_EMPTY_LOOKAHEAD",y[y.AMBIGUOUS_PREFIX_ALTS=13]="AMBIGUOUS_PREFIX_ALTS",y[y.TOO_MANY_ALTS=14]="TOO_MANY_ALTS";var ra=function(){function e(e,t){void 0===t&&(t=rn),this.ignoredIssues=rn.ignoredIssues,this.definitionErrors=[],this.selfAnalysisDone=!1,this.initErrorHandler(t),this.initLexerAdapter(),this.initLooksAhead(t),this.initRecognizerEngine(e,t),this.initRecoverable(t),this.initTreeBuilder(t),this.initContentAssist(),this.initGastRecorder(t),this.initPerformanceTracer(t),(0,b.e$)(t,"ignoredIssues")&&t.ignoredIssues!==rn.ignoredIssues&&(0,b.rr)("The <ignoredIssues> IParserConfig property is soft-deprecated and will be removed in future versions.\n	Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead."),this.ignoredIssues=(0,b.e$)(t,"ignoredIssues")?t.ignoredIssues:rn.ignoredIssues,this.skipValidations=(0,b.e$)(t,"skipValidations")?t.skipValidations:rn.skipValidations}return e.performSelfAnalysis=function(e){e.performSelfAnalysis()},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",function(){t.selfAnalysisDone=!0;var r=t.className;t.TRACE_INIT("toFastProps",function(){(0,b.SV)(t)}),t.TRACE_INIT("Grammar Recording",function(){try{t.enableRecording(),(0,b.Ed)(t.definedRulesNames,function(e){var r=t[e].originalGrammarAction,i=void 0;t.TRACE_INIT(e+" Rule",function(){i=t.topLevelRuleRecord(e,r)}),t.gastProductionsCache[e]=i})}finally{t.disableRecording()}});var i=[];if(t.TRACE_INIT("Grammar Resolving",function(){i=tT({rules:(0,b.VO)(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,i)}),t.TRACE_INIT("Grammar Validations",function(){if((0,b.xb)(i)&&!1===t.skipValidations){var e=tN({rules:(0,b.VO)(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:(0,b.VO)(t.tokensMap),ignoredIssues:t.ignoredIssues,errMsgProvider:tC,grammarName:r});t.definitionErrors.push.apply(t.definitionErrors,e)}}),(0,b.xb)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",function(){var e,r,i=(e=(0,b.VO)(t.gastProductionsCache),r={},(0,b.Ed)(e,function(e){var t=new eZ(e).startWalking();(0,b.f0)(r,t)}),r);t.resyncFollows=i}),t.TRACE_INIT("ComputeLookaheadFunctions",function(){t.preComputeLookaheadFunctions((0,b.VO)(t.gastProductionsCache))})),t.TRACE_INIT("expandAllNestedRuleNames",function(){var e,r,i,n=(e=(0,b.VO)(t.gastProductionsCache),r=t.fullRuleNameToShort,i={allRuleNames:[]},(0,b.Ed)(e,function(e){var t=r[e.name];i.allRuleNames.push(e.name);var n=new e2(t);e.accept(n),(0,b.Ed)(n.result,function(t){t.def,t.key;var r=t.name;i.allRuleNames.push(e.name+r)})}),i);t.allRuleNames=n.allRuleNames}),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,b.xb)(t.definitionErrors))throw Error("Parser Definition Errors detected:\n "+(0,b.UI)(t.definitionErrors,function(e){return e.message}).join("\n-------------------------------\n"))})},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();(0,b.ef)(ra,[tU,tj,tq,tZ,tJ,tQ,t0,t1,t4,rt]);var rl=function(e){function t(t,r){void 0===r&&(r=rn);var i=(0,b.Cl)(r);return i.outputCst=!0,e.call(this,t,i)||this}return rr(t,e),t}(ra),rh=function(e){function t(t,r){void 0===r&&(r=rn);var i=(0,b.Cl)(r);return i.outputCst=!1,e.call(this,t,i)||this}return rr(t,e),t}(ra);function ru(e,t){var r=void 0===t?{}:t,i=r.resourceBase,n=void 0===i?"https://unpkg.com/chevrotain@"+R+"/diagrams/":i,o=r.css;return"\n<!-- This is a generated file -->\n<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<style>\n  body {\n    background-color: hsl(30, 20%, 95%)\n  }\n</style>\n\n\n<link rel='stylesheet' href='"+(void 0===o?"https://unpkg.com/chevrotain@"+R+"/diagrams/diagrams.css":o)+"'>\n"+("\n<script src='"+n+"vendor/railroad-diagrams.js'></script>\n<script src='"+n+"src/diagrams_builder.js'></script>\n<script src='"+n)+"src/diagrams_behavior.js'></script>\n<script src='"+n+'src/main.js\'></script>\n\n<div id="diagrams" align="center"></div>    \n'+("\n<script>\n    window.serializedGrammar = "+JSON.stringify(e,null,"  "))+';\n</script>\n\n<script>\n    var diagramsDiv = document.getElementById("diagrams");\n    main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n</script>\n'}function rc(e){var t;return"\nfunction "+e.name+"(tokenVocabulary, config) {\n    // invoke super constructor\n    // No support for embedded actions currently, so we can 'hardcode'\n    // The use of CstParser.\n    chevrotain.CstParser.call(this, tokenVocabulary, config)\n\n    const $ = this\n\n    "+(t=e.rules,(0,b.UI)(t,function(e){var t;return rf(1,'$.RULE("'+e.name+'", function() {')+"\n"+rp(e.definition,2)+(rf(2,"})")+"\n")}).join("\n"))+"\n\n    // very important to call this after all the rules have been defined.\n    // otherwise the parser may 
1not work correctly as it will lack information\n    // derived during the self analysis phase.\n    this.performSelfAnalysis(this)\n}\n\n// inheritance as implemented in javascript in the previous decade... :(\n"+e.name+".prototype = Object.create(chevrotain.CstParser.prototype)\n"+e.name+".prototype.constructor = "+e.name+"    \n    "}function rd(e,t,r){var i=rf(r,"$."+(e+t.idx)+"(");return t.name||t.separator?(i+="{\n",t.name&&(i+=rf(r+1,'NAME: "'+t.name+'"')+",\n"),t.separator&&(i+=rf(r+1,"SEP: this.tokensMap."+t.separator.name)+",\n"),i+="DEF: "+rg(t.definition,r+2)+"\n"+rf(r,"}")+"\n"):i+=rg(t.definition,r+1),i+=rf(r,")")+"\n"}function rg(e,t){return"function() {\n"+rp(e,t)+(rf(t,"}")+"\n")}function rp(e,t){var r="";return(0,b.Ed)(e,function(e){r+=function(e,t){var r;if(e instanceof eI)return rf(t,"$.SUBRULE"+e.idx+"($."+e.nonTerminalName+")\n");if(e instanceof ex)return rd("OPTION",e,t);if(e instanceof e_)return rd("AT_LEAST_ONE",e,t);if(e instanceof eP)return rd("AT_LEAST_ONE_SEP",e,t);if(e instanceof ek)return rd("MANY_SEP",e,t);if(e instanceof eL)return rd("MANY",e,t);if(e instanceof eD)return rf(t,"$.OR"+e.idx+"([")+"\n"+(0,b.UI)(e.definition,function(e){var r,i;return i=rf(r=t+1,"{")+"\n",e.name&&(i+=rf(r+1,'NAME: "'+e.name+'",')+"\n"),i+=rf(r+1,"ALT: function() {")+"\n"+rp(e.definition,r+1)+rf(r+1,"}")+"\n"+rf(r,"}")}).join(",\n")+"\n"+rf(t,"])\n");else if(e instanceof eH)return r=e.terminalType.name,rf(t,"$.CONSUME"+e.idx+"(this.tokensMap."+r+")\n");else if(e instanceof eO)return rp(e.definition,t);else throw Error("non exhaustive match")}(e,t+1)}),r}function rf(e,t){return Array(4*e+1).join(" ")+t}function rm(e){var t,i=Function("tokenVocabulary","config","chevrotain","    \n"+rc(t={name:e.name,rules:e.rules})+"\nreturn new "+t.name+"(tokenVocabulary, config)    \n");return function(t){return i(e.tokenVocabulary,t,r(15554))}}function ry(e){var t;return"\n(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['chevrotain'], factory);\n    } else if (typeof module === 'object' && module.exports) {\n        // Node. Does not work with strict CommonJS, but\n        // only CommonJS-like environments that support module.exports,\n        // like Node.\n        module.exports = factory(require('chevrotain'));\n    } else {\n        // Browser globals (root is window)\n        root.returnExports = factory(root.b);\n    }\n}(typeof self !== 'undefined' ? self : this, function (chevrotain) {\n\n"+rc(t={name:e.name,rules:e.rules})+"\n    \nreturn {\n    "+t.name+": "+t.name+" \n}\n}));\n"}function rv(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n	 It performs no action other than printing this message.\n	 Please avoid using it as it will be completely removed in the future")}},45937:function(e,t,r){"use strict";function i(e){return e&&0===e.length}function n(e){return null==e?[]:Object.keys(e)}function o(e){for(var t=[],r=Object.keys(e),i=0;i<r.length;i++)t.push(e[r[i]]);return t}function s(e,t){for(var r=[],i=n(e),o=0;o<i.length;o++){var s=i[o];r.push(t.call(null,e[s],s))}return r}function a(e,t){for(var r=[],i=0;i<e.length;i++)r.push(t.call(null,e[i],i));return r}function l(e){return i(e)?void 0:e[0]}function h(e){var t=e&&e.length;return t?e[t-1]:void 0}function u(e,t){if(Array.isArray(e))for(var r=0;r<e.length;r++)t.call(null,e[r],r);else if(x(e))for(var i=n(e),r=0;r<i.length;r++){var o=i[r],s=e[o];t.call(null,s,o)}else throw Error("non exhaustive match")}function c(e){return"string"==typeof e}function d(e){return void 0===e}function g(e){return e instanceof Function}function p(e,t){return void 0===t&&(t=1),e.slice(t,e.length)}function f(e,t){return void 0===t&&(t=1),e.slice(0,e.length-t)}function m(e,t){var r=[];if(Array.isArray(e))for(var i=0;i<e.length;i++){var n=e[i];t.call(null,n)&&r.push(n)}return r}function y(e,t){return m(e,function(e){return!t(e)})}function w(e,t){for(var r=Object.keys(e),i={},n=0;n<r.length;n++){var o=r[n],s=e[o];t(s)&&(i[o]=s)}return i}function E(e,t){return!!x(e)&&e.hasOwnProperty(t)}function S(e,t){return void 0!==b(e,function(e){return e===t})}function C(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t}function R(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}function b(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(t.call(null,i))return i}}function T(e,t){for(var r=[],i=0;i<e.length;i++){var n=e[i];t.call(null,n)&&r.push(n)}return r}function N(e,t,r){for(var i=Array.isArray(e),s=i?e:o(e),a=i?[]:n(e),l=r,h=0;h<s.length;h++)l=t.call(null,l,s[h],i?h:a[h]);return l}function A(e){return y(e,function(e){return null==e})}function I(e,t){void 0===t&&(t=function(e){return e});var r=[];return N(e,function(e,i){var n=t(i);return S(r,n)?e:(r.push(n),e.concat(i))},[])}function M(e){return Array.isArray(e)}function O(e){return e instanceof RegExp}function x(e){return e instanceof Object}function _(e,t){for(var r=0;r<e.length;r++)if(!t(e[r],r))return!1;return!0}function P(e,t){return y(e,function(e){return S(t,e)})}function L(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return!0;return!1}function k(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return r;return -1}function D(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var i=0;i<t.length;i++)for(var o=t[i],s=n(o),a=0;a<s.length;a++){var l=s[a];e[l]=o[l]}return e}function H(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var i=0;i<t.length;i++){var o=t[i];if(!d(o))for(var s=n(o),a=0;a<s.length;a++){var l=s[a];E(e,l)||(e[l]=o[l])}}return e}function B(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return H.apply(null,[{}].concat(e))}function F(e,t){var r={};return u(e,function(e){var i=t(e),n=r[i];n?n.push(e):r[i]=[e]}),r}function V(e,t){for(var r=R(e),i=n(t),o=0;o<i.length;o++){var s=i[o],a=t[s];r[s]=a}return r}function U(){}function W(e){return e}function j(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];t.push(void 0!==i?i:void 0)}return t}function G(e){console&&console.error&&console.error("Error: "+e)}function $(e){console&&console.warn&&console.warn("Warning: "+e)}function z(){return"function"==typeof Map}function Y(e,t){t.forEach(function(t){var r=t.prototype;Object.getOwnPropertyNames(r).forEach(function(i){if("constructor"!==i){var n=Object.getOwnPropertyDescriptor(r,i);n&&(n.get||n.set)?Object.defineProperty(e.prototype,i,n):e.prototype[i]=t.prototype[i]}})})}function K(e){function t(){}t.prototype=e;var r=new t;function i(){return typeof r.bar}return i(),i(),e}function X(e){return e[e.length-1]}function q(e){var t=new Date().getTime(),r=e();return{time:new Date().getTime()-t,value:r}}r.d(t,{Cl:function(){return R},Cw:function(){return p},Ed:function(){return u},G:function(){return L},HD:function(){return c},HT:function(){return q},Kj:function(){return O},Kn:function(){return x},Oq:function(){return T},Ps:function(){return l},Q8:function(){return s},Qw:function(){return C},SV:function(){return K},TS:function(){return V},UI:function(){return a},VO:function(){return o},WB:function(){return G},Wd:function(){return W},X0:function(){return j},XP:function(){return n},Z$:function(){return h},ce:function(){return B},cq:function(){return k},d1:function(){return y},dG:function(){return U},dU:function(){return z},e$:function(){return E},e5:function(){return P},ef:function(){return Y},ei:function(){return w},f0:function(){return D},fj:function(){return X},hX:function(){return m},j7:function(){return f},jj:function(){return I},kJ:function(){return M},mf:function(){return g}
1,o8:function(){return d},oA:function(){return A},r3:function(){return S},rr:function(){return $},sE:function(){return b},u4:function(){return N},vM:function(){return F},xH:function(){return function e(t){for(var r=[],i=0;i<t.length;i++){var n=t[i];Array.isArray(n)?r=r.concat(e(n)):r.push(n)}return r}},xb:function(){return i},yW:function(){return _}})},76489:function(e,t){var r,i,n;"undefined"!=typeof self&&self,i=[],void 0!==(n="function"==typeof(r=function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx},e.prototype.pattern=function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");var t=this.disjunction();this.consumeChar("/");for(var r={type:"Flags",global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":a(r,"global");break;case"i":a(r,"ignoreCase");break;case"m":a(r,"multiLine");break;case"u":a(r,"unicode");break;case"y":a(r,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t}},e.prototype.disjunction=function(){var e=[];for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e}},e.prototype.alternative=function(){for(var e=[];this.isTerm();)e.push(this.term());return{type:"Alternative",value:e}},e.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},e.prototype.assertion=function(){switch(this.popChar()){case"^":return{type:"StartAnchor"};case"$":return{type:"EndAnchor"};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary"};case"B":return{type:"NonWordBoundary"}}throw Error("Invalid Assertion Escape");case"(":switch(this.consumeChar("?"),this.popChar()){case"=":e="Lookahead";break;case"!":e="NegativeLookahead"}l(e);var e,t=this.disjunction();return this.consumeChar(")"),{type:e,value:t}}(function(){throw Error("Internal Error - Should never get here!")})()},e.prototype.quantifier=function(e){var t;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":var r=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:r,atMost:r};break;case",":t=this.isDigit()?{atLeast:r,atMost:this.integerIncludingZero()}:{atLeast:r,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;l(t)}if(!0!==e||void 0!==t)return l(t),"?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t},e.prototype.atom=function(){var e;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),l(e),this.isQuantifier()&&(e.quantifier=this.quantifier()),e},e.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[o("\n"),o("\r"),o("\u2028"),o("\u2029")]}},e.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.decimalEscapeAtom=function(){return{type:"GroupBackReference",value:this.positiveInteger()}},e.prototype.characterClassEscape=function(){var e,t=!1;switch(this.popChar()){case"d":e=h;break;case"D":e=h,t=!0;break;case"s":e=c;break;case"S":e=c,t=!0;break;case"w":e=u;break;case"W":e=u,t=!0}return l(e),{type:"Set",value:e,complement:t}},e.prototype.controlEscapeAtom=function(){var e;switch(this.popChar()){case"f":e=o("\f");break;case"n":e=o("\n");break;case"r":e=o("\r");break;case"t":e=o("	");break;case"v":e=o("\v")}return l(e),{type:"Character",value:e}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");
vendor: 5,025 bytes, line 1
1return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}},e.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\0")}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){return{type:"Character",value:o(this.popChar())}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:o(this.popChar())}}},e.prototype.characterClass=function(){var e=[],t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){var r=this.classAtom();if("Character"===r.type&&this.isRangeDash()){this.consumeChar("-");var i=this.classAtom();if("Character"===i.type){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else s(r.value,e),e.push(o("-")),s(i.value,e)}else s(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}},e.prototype.classAtom=function(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:o("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.group=function(){var e=!0;(this.consumeChar("("),"?"===this.peekChar(0))?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;var t=this.disjunction();this.consumeChar(")");var r={type:"Group",capturing:e,value:t};return e&&(r.idx=this.groupIdx),r},e.prototype.positiveInteger=function(){var e=this.popChar();if(!1===n.test(e))throw Error("Expecting a positive integer");for(;i.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(!1===i.test(e))throw Error("Expecting an integer");for(;i.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.patternCharacter=function(){var e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:o(e)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},e.prototype.isRangeDash=function(){return"-"===this.peekChar()&&this.isClassAtom(1)},e.prototype.isDigit=function(){return i.test(this.peekChar(0))},e.prototype.isClassAtom=function(e){switch(void 0===e&&(e=0),this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},e.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}},e.prototype.isQuantifier=function(){var e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(e){return!1}finally{this.restoreState(e)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.parseHexDigits=function(e){for(var t="",i=0;i<e;i++){var n=this.popChar();if(!1===r.test(n))throw Error("Expecting a HexDecimal digits");t+=n}return{type:"Character",value:parseInt(t,16)}},e.prototype.peekChar=function(e){return void 0===e&&(e=0),this.input[this.idx+e]},e.prototype.popChar=function(){var e=this.peekChar(0);return this.consumeChar(),e},e.prototype.consumeChar=function(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++};var t,r=/[0-9a-fA-F]/,i=/[0-9]/,n=/[1-9]/;function o(e){return e.charCodeAt(0)}function s(e,t){void 0!==e.length?e.forEach(function(e){t.push(e)}):t.push(e)}function a(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t]=!0}
1function l(e){if(void 0===e)throw Error("Internal Error - Should never get here!")}var h=[];for(t=o("0");t<=o("9");t++)h.push(t);var u=[o("_")].concat(h);for(t=o("a");t<=o("z");t++)u.push(t);for(t=o("A");t<=o("Z");t++)u.push(t);var c=[o(" "),o("\f"),o("\n"),o("\r"),o("	"),o("\v"),o("	"),o("\xa0"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\uFEFF")];function d(){}return d.prototype.visitChildren=function(e){for(var t in e){var r=e[t];e.hasOwnProperty(t)&&(void 0!==r.type?this.visit(r):Array.isArray(r)&&r.forEach(function(e){this.visit(e)},this))}},d.prototype.visit=function(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)},d.prototype.visitPattern=function(e){},d.prototype.visitFlags=function(e){},d.prototype.visitDisjunction=function(e){},d.prototype.visitAlternative=function(e){},d.prototype.visitStartAnchor=function(e){},d.prototype.visitEndAnchor=function(e){},d.prototype.visitWordBoundary=function(e){},d.prototype.visitNonWordBoundary=function(e){},d.prototype.visitLookahead=function(e){},d.prototype.visitNegativeLookahead=function(e){},d.prototype.visitCharacter=function(e){},d.prototype.visitSet=function(e){},d.prototype.visitGroup=function(e){},d.prototype.visitGroupBackReference=function(e){},d.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:d,VERSION:"0.4.0"}})?r.apply(t,i):r)&&(e.exports=n)},99182:function(e){function t(){}t.prototype={on:function(e,t,r){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var i=this;function n(){i.off(e,n),t.apply(r,arguments)}return n._=t,this.on(e,n,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),i=0,n=r.length;i<n;i++)r[i].fn.apply(r[i].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),i=r[e],n=[];if(i&&t)for(var o=0,s=i.length;o<s;o++)i[o].fn!==t&&i[o].fn._!==t&&n.push(i[o]);return n.length?r[e]=n:delete r[e],this}},e.exports=t,e.exports.TinyEmitter=t},95636:function(){},5722:function(e,t,r){"use strict";var i=r(88257),n=r(93175),o=TypeError;e.exports=function(e){if(i(e))return e;throw new o(n(e)+" is not a function")}},96902:function(e,t,r){"use strict";var i=r(40541),n=String,o=TypeError;e.exports=function(e){if(i(e))return e;throw new o("Can't set "+n(e)+" as a prototype")}},29647:function(e,t,r){"use strict";var i=r(70974).has;e.exports=function(e){return i(e),e}},81128:function(e,t,r){"use strict";var i=r(37194),n=r(79796),o=r(96324).f,s=i("unscopables"),a=Array.prototype;void 0===a[s]&&o(a,s,{configurable:!0,value:n(null)}),e.exports=function(e){a[s][e]=!0}},74909:function(e,t,r){"use strict";var i=r(1755),n=TypeError;e.exports=function(e,t){if(i(t,e))return e;throw new n("Incorrect invocation")}},94993:function(e,t,r){"use strict";var i=r(4800),n=String,o=TypeError;e.exports=function(e){if(i(e))return e;throw new o(n(e)+" is not an object")}},29816:function(e,t,r){"use strict";var i=r(22614);e.exports=function(e,t,r){for(var n=0,o=arguments.length>2?r:i(t),s=new e(o);o>n;)s[n]=t[n++];return s}},57162:function(e,t,r){"use strict";var i=r(22752),n=r(79508),o=r(22614),s=function(e){return function(t,r,s){var a,l=i(t),h=o(l);if(0===h)return!e&&-1;var u=n(s,h);if(e&&r!=r){for(;h>u;)if((a=l[u++])!=a)return!0}else for(;h>u;u++)if((e||u in l)&&l[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},56853:function(e,t,r){"use strict";var i=r(9687),n=r(74174),o=TypeError,s=Object.getOwnPropertyDescriptor,a=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(n(e)&&!s(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},9935:function(e,t,r){"use strict";var i=r(88840);e.exports=i([].slice)},71882:function(e,t,r){"use strict";var i=r(94993),n=r(19582);e.exports=function(e,t,r,o){try{return o?t(i(r)[0],r[1]):t(r)}catch(t){n(e,"throw",t)}}},9406:function(e,t,r){"use strict";var i=r(88840),n=i({}.toString),o=i("".slice);e.exports=function(e){return o(n(e),8,-1)}},37394:function(e,t,r){"use strict";var i=r(93101),n=r(88257),o=r(9406),s=r(37194)("toStringTag"),a=Object,l="Arguments"===o(function(){return arguments}()),h=function(e,t){try{return e[t]}catch(e){}};e.exports=i?o:function(e){var t,r,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=h(t=a(e),s))?r:l?o(t):"Object"===(i=o(t))&&n(t.callee)?"Arguments":i}},84186:function(e,t,r){"use strict";var i=r(97394),n=r(23816),o=r(31382),s=r(96324);e.exports=function(e,t,r){for(var a=n(t),l=s.f,h=o.f,u=0;u<a.length;u++){var c=a[u];i(e,c)||r&&i(r,c)||l(e,c,h(t,c))}}},66018:function(e,t,r){"use strict";var i=r(59847);e.exports=!i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},60081:function(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},84669:function(e,t,r){"use strict";var i=r(9687),n=r(96324),o=r(55838);e.exports=i?function(e,t,r){return n.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},55838:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},53816:function(e,t,r){"use strict";var i=r(9687),n=r(96324),o=r(55838);e.exports=function(e,t,r){i?n.f(e,t,o(0,r)):e[t]=r}},95236:function(e,t,r){"use strict";var i=r(69524),n=r(96324);e.exports=function(e,t,r){return r.get&&i(r.get,t,{getter:!0}),r.set&&i(r.set,t,{setter:!0}),n.f(e,t,r)}},86478:function(e,t,r){"use strict";var i=r(88257),n=r(96324),o=r(69524),s=r(31276);e.exports=function(e,t,r,a){a||(a={});var l=a.enumerable,h=void 0!==a.name?a.name:t;if(i(r)&&o(r,h,a),a.global)l?e[t]=r:s(t,r);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}
1l?e[t]=r:n.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},68829:function(e,t,r){"use strict";var i=r(86478);e.exports=function(e,t,r){for(var n in t)i(e,n,t[n],r);return e}},31276:function(e,t,r){"use strict";var i=r(14124),n=Object.defineProperty;e.exports=function(e,t){try{n(i,e,{value:t,configurable:!0,writable:!0})}catch(r){i[e]=t}return t}},88854:function(e,t,r){"use strict";var i=r(93175),n=TypeError;e.exports=function(e,t){if(!delete e[t])throw new n("Cannot delete property "+i(t)+" of "+i(e))}},9687:function(e,t,r){"use strict";var i=r(59847);e.exports=!i(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},1176:function(e,t,r){"use strict";var i=r(14124),n=r(4800),o=i.document,s=n(o)&&n(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},99006:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},54554:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},91117:function(e,t,r){"use strict";var i=r(18805);
vendor: 9,678 bytes, line 1
1e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},73504:function(e,t,r){"use strict";var i=r(61834);e.exports="NODE"===i},18805:function(e,t,r){"use strict";var i=r(14124).navigator,n=i&&i.userAgent;e.exports=n?String(n):""},65055:function(e,t,r){"use strict";var i,n,o=r(14124),s=r(18805),a=o.process,l=o.Deno,h=a&&a.versions||l&&l.version,u=h&&h.v8;u&&(n=(i=u.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!n&&s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(n=+i[1]),e.exports=n},61834:function(e,t,r){"use strict";var i=r(14124),n=r(18805),o=r(9406),s=function(e){return n.slice(0,e.length)===e};e.exports=s("Bun/")?"BUN":s("Cloudflare-Workers")?"CLOUDFLARE":s("Deno/")?"DENO":s("Node.js/")?"NODE":i.Bun&&"string"==typeof Bun.version?"BUN":i.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(i.process)?"NODE":i.window&&i.document?"BROWSER":"REST"},35720:function(e,t,r){"use strict";var i=r(88840),n=Error,o=i("".replace),s=String(new n("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(s);e.exports=function(e,t){if(l&&"string"==typeof e&&!n.prepareStackTrace)for(;t--;)e=o(e,a,"");return e}},50521:function(e,t,r){"use strict";var i=r(84669),n=r(35720),o=r(73998),s=Error.captureStackTrace;e.exports=function(e,t,r,a){o&&(s?s(e,t):i(e,"stack",n(r,a)))}},73998:function(e,t,r){"use strict";var i=r(59847),n=r(55838);e.exports=!i(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",n(1,7)),7!==e.stack)})},23414:function(e,t,r){"use strict";var i=r(14124),n=r(31382).f,o=r(84669),s=r(86478),a=r(31276),l=r(84186),h=r(60770);e.exports=function(e,t){var r,u,c,d,g,p=e.target,f=e.global,m=e.stat;if(r=f?i:m?i[p]||a(p,{}):i[p]&&i[p].prototype)for(u in t){if(d=t[u],c=e.dontCallGetSet?(g=n(r,u))&&g.value:r[u],!h(f?u:p+(m?".":"#")+u,e.forced)&&void 0!==c){if(typeof d==typeof c)continue;l(d,c)}(e.sham||c&&c.sham)&&o(d,"sham",!0),s(r,u,d,e)}}},59847:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},97202:function(e,t,r){"use strict";var i=r(79894),n=Function.prototype,o=n.apply,s=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(i?s.bind(o):function(){return s.apply(o,arguments)})},27384:function(e,t,r){"use strict";var i=r(96116),n=r(5722),o=r(79894),s=i(i.bind);e.exports=function(e,t){return n(e),void 0===t?e:o?s(e,t):function(){return e.apply(t,arguments)}}},79894:function(e,t,r){"use strict";var i=r(59847);e.exports=!i(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},35107:function(e,t,r){"use strict";var i=r(79894),n=Function.prototype.call;e.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},18984:function(e,t,r){"use strict";var i=r(9687),n=r(97394),o=Function.prototype,s=i&&Object.getOwnPropertyDescriptor,a=n(o,"name"),l=a&&(!i||i&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:a&&"something"===(function(){}).name,CONFIGURABLE:l}},64776:function(e,t,r){"use strict";var i=r(88840),n=r(5722);e.exports=function(e,t,r){try{return i(n(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},96116:function(e,t,r){"use strict";var i=r(9406),n=r(88840);e.exports=function(e){if("Function"===i(e))return n(e)}},88840:function(e,t,r){"use strict";var i=r(79894),n=Function.prototype,o=n.call,s=i&&n.bind.bind(o,o);e.exports=i?s:function(e){return function(){return o.apply(e,arguments)}}},81689:function(e,t,r){"use strict";var i=r(14124);e.exports=function(e,t){var r=i[e],n=r&&r.prototype;return n&&n[t]}},53630:function(e,t,r){"use strict";var i=r(14124),n=r(88257);e.exports=function(e,t){var r;return arguments.length<2?n(r=i[e])?r:void 0:i[e]&&i[e][t]}},25055:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},71678:function(e,t,r){"use strict";var i=r(35107),n=r(94993),o=r(25055),s=r(12156);e.exports=function(e,t){t&&"string"==typeof e||n(e);var r=s(e);return o(n(void 0!==r?i(r,e):e))}},12156:function(e,t,r){"use strict";var i=r(37394),n=r(54291),o=r(50378),s=r(14481),a=r(37194)("iterator");e.exports=function(e){if(!o(e))return n(e,a)||n(e,"@@iterator")||s[i(e)]}},40833:function(e,t,r){"use strict";var i=r(35107),n=r(5722),o=r(94993),s=r(93175),a=r(12156),l=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(n(r))return o(i(r,e));throw new l(s(e)+" is not iterable")}},54291:function(e,t,r){"use strict";var i=r(5722),n=r(50378);e.exports=function(e,t){var r=e[t];return n(r)?void 0:i(r)}},18543:function(e,t,r){"use strict";var i=r(5722),n=r(94993),o=r(35107),s=r(28922),a=r(25055),l="Invalid size",h=RangeError,u=TypeError,c=Math.max,d=function(e,t){this.set=e,this.size=c(t,0),this.has=i(e.has),this.keys=i(e.keys)};d.prototype={getIterator:function(){return a(n(o(this.keys,this.set)))},includes:function(e){return o(this.has,this.set,e)}},e.exports=function(e){n(e);var t=+e.size;if(t!=t)throw new u(l);var r=s(t);if(r<0)throw new h(l);return new d(e,r)}},98678:function(e,t,r){"use strict";var i=r(88840),n=r(29530),o=Math.floor,s=i("".charAt),a=i("".replace),l=i("".slice),h=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,i,c,d){var g=r+e.length,p=i.length,f=u;return void 0!==c&&(c=n(c),f=h),a(d,f,function(n,a){var h;switch(s(a,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,r);case"'":return l(t,g);case"<":h=c[l(a,1,-1)];break;default:var u=+a;if(0===u)return n;if(u>p){var d=o(u/10);if(0===d)return n;if(d<=p)return void 0===i[d-1]?s(a,1):i[d-1]+s(a,1);return n}h=i[u-1]}return void 0===h?"":h})}},14124:function(e,t,r){"use strict";var i=function(e){return e&&e.Math===Math&&e};e.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r.g&&r.g)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},97394:function(e,t,r){"use strict";var i=r(88840),n=r(29530),o=i({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(n(e),t)}},56643:function(e){"use strict";e.exports={}},49122:function(e,t,r){"use strict";var i=r(53630);e.exports=i("document","documentElement")},83416:function(e,t,r){"use strict";var i=r(9687),n=r(59847),o=r(1176);e.exports=!i&&!n(function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},18113:function(e,t,r){"use strict";var i=r(88840),n=r(59847),o=r(9406),s=Object,a=i("".split);e.exports=n(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===o(e)?a(e,""):s(e)}:s},63747:function(e,t,r){"use strict";var i=r(88257),n=r(4800),o=r(28599);e.exports=function(e,t,r){var s,a;return o&&i(s=t.constructor)&&s!==r&&n(a=s.prototype)&&a!==r.prototype&&o(e,a),e}},65232:function(e,t,r){"use strict";var i=r(88840),n=r(88257),o=r(45661),s=i(Function.toString);n(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},48382:function(e,t,r){"use strict";var i=r(4800),n=r(84669);e.exports=function(e,t){i(t)&&"cause"in t&&n(e,"cause",t.cause)}},22796:function(e,t,r){"use strict";var i,n,o,s=r(3464),a=r(14124),l=r(4800),h=r(84669),u=r(97394),c=r(45661),d=r(2753),g=r(56643),p="Object already initialized",f=a.TypeError,m=a.WeakMap;if(s||c.state){var y=c.state||(c.state=new m);y.get=y.get,y.has=y.has,y.set=y.set,i=function(e,t){if(y.has(e))throw new f(p);return t.facade=e,y.set(e,t),t},n=function(e){return y.get(e)||{}},o=function(e){return y.has(e)}}else{var w=d("state");g[w]=!0,i=function(e,t){if(u(e,w))throw new f(p);return t.facade=e,h(e,w,t),t},n=function(e){return u(e,w)?e[w]:{}},o=function(e){return u(e,w)}}e.exports={set:i,get:n,has:o,enforce:function(e){return o(e)?n(e):i(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=n(t)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}},45263:function(e,t,r){"use strict";var i=r(37194),n=r(14481),o=i("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||s[o]===e)}},74174:function(e,t,r){"use strict";var i=r(9406);e.exports=Array.isArray||function(e){return"Array"===i(e)}},88257:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},60770:function(e,t,r){"use strict";var i=r(59847),n=r(88257),o=/#|\.prototype\./,s=function(e,t){var r=l[a(e)];return r===u||r!==h&&(n(t)?i(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=s.data={},h=s.NATIVE="N",u=s.POLYFILL="P";e.exports=s},50378:function(e){"use strict";e.exports=function(e){return null==e}},4800:function(e,t,r){"use strict";var i=r(88257);e.exports=function(e){return"object"==typeof e?null!==e:i(e)}},40541:function(e,t,r){"use strict";var i=r(4800);e.exports=function(e){return i(e)||null===e}},31564:function(e){"use strict";e.exports=!1},61715:function(e,t,r){"use strict";var i=r(4800),n=r(22796).get;e.exports=function(e){if(!i(e))return!1;var t=n(e);return!!t&&"RawJSON"===t.type}},69381:function(e,t,r){"use strict";var i=r(4800),n=r(9406),o=r(37194)("match");e.exports=function(e){var t;return i(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===n(e))}},73195:function(e,t,r){"use strict";var i=r(53630),n=r(88257),o=r(1755),s=r(14838),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=i("Symbol");return n(t)&&o(t.prototype,a(e))}},62223:function(e,t,r){"use strict";var i=r(35107);e.exports=function(e,t,r){for(var n,o,s=r?e:e.iterator,a=e.next;!(n=i(a,s)).done;)if(void 0!==(o=t(n.value)))return o}},64199:function(e,t,r){"use strict";var i=r(27384),n=r(35107),o=r(94993),s=r(93175),a=r(45263),l=r(22614),h=r(1755),u=r(40833),
vendor: 4,521 bytes, line 1
1c=r(12156),d=r(19582),g=TypeError,p=function(e,t){this.stopped=e,this.result=t},f=p.prototype;e.exports=function(e,t,r){var m,y,w,E,S,C,R,b=r&&r.that,T=!!(r&&r.AS_ENTRIES),N=!!(r&&r.IS_RECORD),A=!!(r&&r.IS_ITERATOR),I=!!(r&&r.INTERRUPTED),M=i(t,b),O=function(e){return m&&d(m,"normal"),new p(!0,e)},x=function(e){return T?(o(e),I?M(e[0],e[1],O):M(e[0],e[1])):I?M(e,O):M(e)};if(N)m=e.iterator;else if(A)m=e;else{if(!(y=c(e)))throw new g(s(e)+" is not iterable");if(a(y)){for(w=0,E=l(e);E>w;w++)if((S=x(e[w]))&&h(f,S))return S;return new p(!1)}m=u(e,y)}for(C=N?e.next:m.next;!(R=n(C,m)).done;){try{S=x(R.value)}catch(e){d(m,"throw",e)}if("object"==typeof S&&S&&h(f,S))return S}return new p(!1)}},19958:function(e,t,r){"use strict";var i=r(19582);e.exports=function(e,t,r){for(var n=e.length-1;n>=0;n--)if(void 0!==e[n])try{r=i(e[n].iterator,t,r)}catch(e){t="throw",r=e}if("throw"===t)throw r;return r}},19582:function(e,t,r){"use strict";var i=r(35107),n=r(94993),o=r(54291);e.exports=function(e,t,r){var s,a;n(e);try{if(!(s=o(e,"return"))){if("throw"===t)throw r;return r}s=i(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw r;if(a)throw s;return n(s),r}},72005:function(e,t,r){"use strict";var i=r(35107),n=r(79796),o=r(84669),s=r(68829),a=r(37194),l=r(22796),h=r(54291),u=r(80454).IteratorPrototype,c=r(60081),d=r(19582),g=r(19958),p=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",y="normal",w="throw",E=l.set,S=function(e){var t=l.getterFor(e?m:f);return s(n(u),{next:function(){var r=t(this);if(e)return r.nextHandler();if(r.done)return c(void 0,!0);try{var i=r.nextHandler();return r.returnHandlerResult?i:c(i,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),n=r.iterator;if(r.done=!0,e){var o=h(n,"return");return o?i(o,n):c(void 0,!0)}if(r.inner)try{d(r.inner.iterator,y)}catch(e){return d(n,w,e)}if(r.openIters)try{g(r.openIters,y)}catch(e){return d(n,w,e)}return n&&d(n,y),c(void 0,!0)}})},C=S(!0),R=S(!1);o(R,p,"Iterator Helper"),e.exports=function(e,t,r){var i=function(i,n){n?(n.iterator=i.iterator,n.next=i.next):n=i,n.type=t?m:f,n.returnHandlerResult=!!r,n.nextHandler=e,n.counter=0,n.done=!1,E(this,n)};return i.prototype=t?C:R,i}},18354:function(e){"use strict";e.exports=function(e,t){var r="function"==typeof Iterator&&Iterator.prototype[e];if(r)try{r.call({next:null},t).next()}catch(e){return!0}}},19633:function(e,t,r){"use strict";var i=r(14124);e.exports=function(e,t){var r=i.Iterator,n=r&&r.prototype,o=n&&n[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(e){e instanceof t||(s=!1)}if(!s)return o}},80454:function(e,t,r){"use strict";var i,n,o,s=r(59847),a=r(88257),l=r(4800),h=r(79796),u=r(42447),c=r(86478),d=r(37194),g=r(31564),p=d("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(n=u(u(o)))!==Object.prototype&&(i=n):f=!0),!l(i)||s(function(){var e={};return i[p].call(e)!==e})?i={}:g&&(i=h(i)),a(i[p])||c(i,p,function(){return this}),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:f}},14481:function(e){"use strict";e.exports={}},22614:function(e,t,r){"use strict";var i=r(25009);e.exports=function(e){return i(e.length)}},69524:function(e,t,r){"use strict";var i=r(88840),n=r(59847),o=r(88257),s=r(97394),a=r(9687),l=r(18984).CONFIGURABLE,h=r(65232),u=r(22796),c=u.enforce,d=u.get,g=String,p=Object.defineProperty,f=i("".slice),m=i("".replace),y=i([].join),w=a&&!n(function(){return 8!==p(function(){},"length",{value:8}).length}),E=String(String).split("String"),S=e.exports=function(e,t,r){"Symbol("===f(g(t),0,7)&&(t="["+m(g(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!s(e,"name")||l&&e.name!==t)&&(a?p(e,"name",{value:t,configurable:!0}):e.name=t),w&&r&&s(r,"arity")&&e.length!==r.arity&&p(e,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?a&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=c(e);return s(i,"source")||(i.source=y(E,"string"==typeof t?t:"")),e};Function.prototype.toString=S(function(){return o(this)&&d(this).source||h(this)},"toString")},28498:function(e){"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var i=+e;return(i>0?r:t)(i)}},2132:function(e,t,r){"use strict";var i=r(59847);e.exports=!i(function(){var e="9007199254740993",t=JSON.rawJSON(e);return!JSON.isRawJSON(t)||JSON.stringify(t)!==e})},75119:function(e,t,r){"use strict";var i=r(57618);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:i(e)}},79796:function(e,t,r){"use strict";
vendor: 3,102 bytes, line 1
1var i,n=r(94993),o=r(98138),s=r(54554),a=r(56643),l=r(49122),h=r(1176),u=r(2753),c="prototype",d="script",g=u("IE_PROTO"),p=function(){},f=function(e){return"<"+d+">"+e+"</"+d+">"},m=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){var e,t=h("iframe");return t.style.display="none",l.appendChild(t),t.src=String("java"+d+":"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F},w=function(){try{i=new ActiveXObject("htmlfile")}catch(e){}w="undefined"!=typeof document?document.domain&&i?m(i):y():m(i);for(var e=s.length;e--;)delete w[c][s[e]];return w()};a[g]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(p[c]=n(e),r=new p,p[c]=null,r[g]=e):r=w(),void 0===t?r:o.f(r,t)}},98138:function(e,t,r){"use strict";var i=r(9687),n=r(85963),o=r(96324),s=r(94993),a=r(22752),l=r(30795);t.f=i&&!n?Object.defineProperties:function(e,t){s(e);for(var r,i=a(t),n=l(t),h=n.length,u=0;h>u;)o.f(e,r=n[u++],i[r]);return e}},96324:function(e,t,r){"use strict";var i=r(9687),n=r(83416),o=r(85963),s=r(94993),a=r(4587),l=TypeError,h=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c="enumerable",d="configurable",g="writable";t.f=i?o?function(e,t,r){if(s(e),t=a(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&g in r&&!r[g]){var i=u(e,t);i&&i[g]&&(e[t]=r.value,r={configurable:d in r?r[d]:i[d],enumerable:c in r?r[c]:i[c],writable:!1})}return h(e,t,r)}:h:function(e,t,r){if(s(e),t=a(t),s(r),n)try{return h(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},31382:function(e,t,r){"use strict";var i=r(9687),n=r(35107),o=r(7230),s=r(55838),a=r(22752),l=r(4587),h=r(97394),u=r(83416),c=Object.getOwnPropertyDescriptor;t.f=i?c:function(e,t){if(e=a(e),t=l(t),u)try{return c(e,t)}catch(e){}if(h(e,t))return s(!n(o.f,e,t),e[t])}},82459:function(e,t,r){"use strict";var i=r(93770),n=r(54554).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,n)}},20972:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},42447:function(e,t,r){"use strict";var i=r(97394),n=r(88257),o=r(29530),s=r(2753),a=r(66018),l=s("IE_PROTO"),h=Object,u=h.prototype;e.exports=a?h.getPrototypeOf:function(e){var t=o(e);if(i(t,l))return t[l];var r=t.constructor;return n(r)&&t instanceof r?r.prototype:t instanceof h?u:null}},1755:function(e,t,r){"use strict";var i=r(88840);e.exports=i({}.isPrototypeOf)},93770:function(e,t,r){"use strict";var i=r(88840),n=r(97394),o=r(22752),s=r(57162).indexOf,a=r(56643),l=i([].push);e.exports=function(e,t){var r,i=o(e),h=0,u=[];for(r in i)!n(a,r)&&n(i,r)&&l(u,r);for(;t.length>h;)n(i,r=t[h++])&&(~s(u,r)||l(u,r));return u}},30795:function(e,t,r){"use strict";var i=r(93770),n=r(54554);e.exports=Object.keys||function(e){return i(e,n)}},7230:function(e,t){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);t.f=n?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},28599:function(e,t,r){"use strict";var i=r(64776),n=r(4800),o=r(81988),s=r(96902);
1e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=i(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,i){return o(r),s(i),n(r)&&(t?e(r,i):r.__proto__=i),r}}():void 0)},45327:function(e,t,r){"use strict";var i=r(35107),n=r(88257),o=r(4800),s=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&n(r=e.toString)&&!o(a=i(r,e))||n(r=e.valueOf)&&!o(a=i(r,e))||"string"!==t&&n(r=e.toString)&&!o(a=i(r,e)))return a;throw new s("Can't convert object to primitive value")}},23816:function(e,t,r){"use strict";var i=r(53630),n=r(88840),o=r(82459),s=r(20972),a=r(94993),l=n([].concat);e.exports=i("Reflect","ownKeys")||function(e){var t=o.f(a(e)),r=s.f;return r?l(t,r(e)):t}},899:function(e,t,r){"use strict";var i=r(88840),n=r(97394),o=SyntaxError,s=parseInt,a=String.fromCharCode,l=i("".charAt),h=i("".slice),u=i(/./.exec),c={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"	"},d=/^[\da-f]{4}$/i,g=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var r=!0,i="";t<e.length;){var p=l(e,t);if("\\"===p){var f=h(e,t,t+2);if(n(c,f))i+=c[f],t+=2;else if("\\u"===f){var m=h(e,t+=2,t+4);if(!u(d,m))throw new o("Bad Unicode escape at: "+t);i+=a(s(m,16)),t+=4}else throw new o('Unknown escape sequence: "'+f+'"')}else if('"'===p){r=!1,t++;break}else{if(u(g,p))throw new o("Bad control character in string literal at: "+t);i+=p,t++}}if(r)throw new o("Unterminated string at: "+t);return{value:i,end:t}}},2222:function(e,t,r){"use strict";var i=r(96324).f;e.exports=function(e,t,r){r in e||i(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},50052:function(e,t,r){"use strict";var i=r(14124),n=r(59847),o=i.RegExp,s=!n(function(){var e=!0;try{o(".","d")}catch(t){e=!1}var t={},r="",i=e?"dgimsy":"gimsy",n=function(e,i){Object.defineProperty(t,e,{get:function(){return r+=i,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in e&&(s.hasIndices="d"),s)n(a,s[a]);return Object.getOwnPropertyDescriptor(o.prototype,"flags").get.call(t)!==i||r!==i});e.exports={correct:s}},22864:function(e,t,r){"use strict";var i=r(94993);e.exports=function(){var e=i(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},78732:function(e,t,r){"use strict";var i=r(35107),n=r(97394),o=r(1755),s=r(50052),a=r(22864),l=RegExp.prototype;e.exports=s.correct?function(e){return e.flags}:function(e){return!s.correct&&o(l,e)&&!n(e,"flags")?i(a,e):e.flags}},81988:function(e,t,r){"use strict";var i=r(50378),n=TypeError;e.exports=function(e){if(i(e))throw new n("Can't call method on "+e);return e}},40571:function(e,t,r){"use strict";var i,n=r(14124),o=r(97202),s=r(88257),a=r(61834),l=r(18805),h=r(9935),u=r(43160),c=n.Function,d=/MSIE .\./.test(l)||"BUN"===a&&((i=n.Bun.version.split(".")).length<3||"0"===i[0]&&(i[1]<3||"3"===i[1]&&"0"===i[2]));e.exports=function(e,t){var r=t?2:1;return d?function(i,n){var a=u(arguments.length,1)>r,l=s(i)?i:c(i),d=a?h(arguments,r):[],g=a?function(){o(l,this,d)}:l;return t?e(g,n):e(g)}:e}},54048:function(e,t,r){"use strict";var i=r(70974),n=r(95201),o=i.Set,s=i.add;e.exports=function(e){var t=new o;return n(e,function(e){s(t,e)}),t}},25117:function(e,t,r){"use strict";var i=r(29647),n=r(70974),o=r(54048),s=r(91164),a=r(18543),l=r(95201),h=r(62223),u=n.has,c=n.remove;e.exports=function(e){var t=i(this),r=a(e),n=o(t);return s(t)<=r.size?l(t,function(e){r.includes(e)&&c(n,e)}):h(r.getIterator(),function(e){u(n,e)&&c(n,e)}),n}},70974:function(e,t,r){"use strict";var i=r(88840),n=Set.prototype;e.exports={Set:Set,add:i(n.add),has:i(n.has),remove:i(n.delete),proto:n}},86596:function(e,t,r){"use strict";var i=r(29647),n=r(70974),o=r(91164),s=r(18543),a=r(95201),l=r(62223),h=n.Set,u=n.add,c=n.has;e.exports=function(e){var t=i(this),r=s(e),n=new h;return o(t)>r.size?l(r.getIterator(),function(e){c(t,e)&&u(n,e)}):a(t,function(e){r.includes(e)&&u(n,e)}),n}},10185:function(e,t,r){"use strict";var i=r(29647),n=r(70974).has,o=r(91164),s=r(18543),a=r(95201),l=r(62223),h=r(19582);e.exports=function(e){var t=i(this),r=s(e);if(o(t)<=r.size)return!1!==a(t,function(e){if(r.includes(e))return!1},!0);var u=r.getIterator();return!1!==l(u,function(e){if(n(t,e))return h(u,"normal",!1)})}},45371:function(e,t,r){"use strict";var i=r(29647),n=r(91164),o=r(95201),s=r(18543);e.exports=function(e){var t=i(this),r=s(e);return!(n(t)>r.size)&&!1!==o(t,function(e){if(!r.includes(e))return!1},!0)}},72176:function(e,t,r){"use strict";var i=r(29647),n=r(70974).has,o=r(91164),s=r(18543),a=r(62223),l=r(19582);e.exports=function(e){var t=i(this),r=s(e);if(o(t)<r.size)return!1;var h=r.getIterator();
1return!1!==a(h,function(e){if(!n(t,e))return l(h,"normal",!1)})}},95201:function(e,t,r){"use strict";var i=r(88840),n=r(62223),o=r(70974),s=o.Set,a=o.proto,l=i(a.forEach),h=i(a.keys),u=h(new s).next;e.exports=function(e,t,r){return r?n({iterator:h(e),next:u},t):l(e,t)}},95287:function(e,t,r){"use strict";var i=r(53630),n=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},o=function(e){return{size:e,has:function(){return!0},keys:function(){throw Error("e")}}};e.exports=function(e,t){var r=i("Set");try{new r()[e](n(0));try{return new r()[e](n(-1)),!1}catch(i){if(!t)return!0;try{return new r()[e](o(-1/0)),!1}catch(i){var s=new r([1,2]);return t(s[e](o(1/0)))}}}catch(e){return!1}}},86330:function(e){"use strict";e.exports=function(e){try{var t=new Set,r=t[e]({size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}});return 1===r.size&&4===r.values().next().value}catch(e){return!1}}},91164:function(e,t,r){"use strict";var i=r(64776),n=r(70974);e.exports=i(n.proto,"size","get")||function(e){return e.size}},6792:function(e,t,r){"use strict";var i=r(29647),n=r(70974),o=r(54048),s=r(18543),a=r(62223),l=n.add,h=n.has,u=n.remove;e.exports=function(e){var t=i(this),r=s(e).getIterator(),n=o(t);return a(r,function(e){h(t,e)?u(n,e):l(n,e)}),n}},57985:function(e,t,r){"use strict";var i=r(29647),n=r(70974).add,o=r(54048),s=r(18543),a=r(62223);e.exports=function(e){var t=i(this),r=s(e).getIterator(),l=o(t);return a(r,function(e){n(l,e)}),l}},2753:function(e,t,r){"use strict";var i=r(309),n=r(15842),o=i("keys");e.exports=function(e){return o[e]||(o[e]=n(e))}},45661:function(e,t,r){"use strict";var i=r(31564),n=r(14124),o=r(31276),s="__core-js_shared__",a=e.exports=n[s]||o(s,{});(a.versions||(a.versions=[])).push({version:"3.47.0",mode:i?"pure":"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})},309:function(e,t,r){"use strict";var i=r(45661);e.exports=function(e,t){return i[e]||(i[e]=t||{})}},4699:function(e,t,r){"use strict";var i=r(65055),n=r(59847),o=r(14124).String;e.exports=!!Object.getOwnPropertySymbols&&!n(function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&i&&i<41})},20861:function(e,t,r){"use strict";var i,n,o,s,a=r(14124),l=r(97202),h=r(27384),u=r(88257),c=r(97394),d=r(59847),g=r(49122),p=r(9935),f=r(1176),m=r(43160),y=r(91117),w=r(73504),E=a.setImmediate,S=a.clearImmediate,C=a.process,R=a.Dispatch,b=a.Function,T=a.MessageChannel,N=a.String,A=0,I={},M="onreadystatechange";d(function(){i=a.location});var O=function(e){if(c(I,e)){var t=I[e];delete I[e],t()}},x=function(e){return function(){O(e)}},_=function(e){O(e.data)},P=function(e){a.postMessage(N(e),i.protocol+"//"+i.host)};E&&S||(E=function(e){m(arguments.length,1);var t=u(e)?e:b(e),r=p(arguments,1);return I[++A]=function(){l(t,void 0,r)},n(A),A},S=function(e){delete I[e]},w?n=function(e){C.nextTick(x(e))}:R&&R.now?n=function(e){R.now(x(e))}:T&&!y?(s=(o=new T).port2,o.port1.onmessage=_,n=h(s.postMessage,s)):a.addEventListener&&u(a.postMessage)&&!a.importScripts&&i&&"file:"!==i.protocol&&!d(P)?(n=P,a.addEventListener("message",_,!1)):n=M in f("script")?function(e){g.appendChild(f("script"))[M]=function(){g.removeChild(this),O(e)}}:function(e){setTimeout(x(e),0)}),e.exports={set:E,clear:S}},79508:function(e,t,r){"use strict";var i=r(28922),n=Math.max,o=Math.min;e.exports=function(e,t){var r=i(e);return r<0?n(r+t,0):o(r,t)}},22752:function(e,t,r){"use strict";var i=r(18113),n=r(81988);e.exports=function(e){return i(n(e))}},28922:function(e,t,r){"use strict";var i=r(28498);e.exports=function(e){var t=+e;return t!=t||0===t?0:i(t)}},25009:function(e,t,r){"use strict";var i=r(28922),n=Math.min;e.exports=function(e){var t=i(e);return t>0?n(t,9007199254740991):0}},29530:function(e,t,r){"use strict";var i=r(81988),n=Object;e.exports=function(e){return n(i(e))}},61382:function(e,t,r){"use strict";var i=r(35107),n=r(4800),o=r(73195),s=r(54291),a=r(45327),l=r(37194),h=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!n(e)||o(e))return e;var r,l=s(e,u);if(l){if(void 0===t&&(t="default"),!n(r=i(l,e,t))||o(r))return r;throw new h("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},4587:function(e,t,r){"use strict";var i=r(61382),n=r(73195);e.exports=function(e){var t=i(e,"string");return n(t)?t:t+""}},93101:function(e,t,r){"use strict";var i=r(37194)("toStringTag"),n={};n[i]="z",e.exports="[object z]"===String(n)},57618:function(e,t,r){"use strict";var i=r(37394),n=String;e.exports=function(e){if("Symbol"===i(e))throw TypeError("Cannot convert a Symbol value to a string");return n(e)}},93175:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},15842:function(e,t,r){"use strict";var i=r(88840),n=0,o=Math.random(),s=i(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++n+o,36)}},14838:function(e,t,r){"use strict";var i=r(4699);e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},85963:function(e,t,r){"use strict";var i=r(9687),n=r(59847);e.exports=i&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},43160:function(e){"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}},3464:function(e,t,r){"use strict";var i=r(14124),n=r(88257),o=i.WeakMap;e.exports=n(o)&&/native code/.test(String(o))},37194:function(e,t,r){"use strict";var i=r(14124),n=r(309),o=r(97394),s=r(15842),a=r(4699),l=r(14838),h=i.Symbol,u=n("wks"),c=l?h.for||h:h&&h.withoutSetter||s;e.exports=function(e){return o(u,e)||(u[e]=a&&o(h,e)?h[e]:c("Symbol."+e)),u[e]}},90101:function(e,t,r){"use strict";var i=r(53630),n=r(97394),o=r(84669),s=r(1755),a=r(28599),l=r(84186),h=r(2222),u=r(63747),c=r(75119),d=r(48382),g=r(50521),p=r(9687),f=r(31564);e.exports=function(e,t,r,m){var y="stackTraceLimit",w=m?2:1,E=e.split("."),S=E[E.length-1],C=i.apply(null,E);if(C){var R=C.prototype;if(!f&&n(R,"cause")&&delete R.cause,!r)return C;var b=i("Error"),T=t(function(e,t){var r=c(m?t:e,void 0),i=m?new C(e):new C;return void 0!==r&&o(i,"message",r),g(i,T,i.stack,2),this&&s(R,this)&&u(i,this,T),arguments.length>w&&d(i,arguments[w]),i});if(T.prototype=R,"Error"!==S?a?a(T,b):l(T,b,{name:!0}):p&&y in C&&(h(T,C,y),h(T,C,"prepareStackTrace")),l(T,C),!f)try{R.name!==S&&o(R,"name",S),R.constructor=T}catch(e){}return T}}},24029:function(e,t,r){"use strict";var i=r(23414),n=r(29530),o=r(22614),s=r(28922),a=r(81128);i({target:"Array",proto:!0},{at:function(e){var t=n(this),r=o(t),i=s(e),a=i>=0?i:r+i;return a<0||a>=r?void 0:t[a]}}),a("at")},65230:function(e,t,r){"use strict";var i=r(23414),n=r(29530),o=r(22614),s=r(56853),a=r(99006);i({target:"Array",proto:!0,arity:1,forced:r(59847)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=n(this),r=o(t),i=arguments.length;a(r+i);for(var l=0;l<i;l++)t[r]=arguments[l],r++;return s(t,r),r}})},44174:function(e,t,r){"use strict";
1var i=r(23414),n=r(88840),o=r(5722),s=r(22752),a=r(29816),l=r(81689),h=r(81128),u=Array,c=n(l("Array","sort"));i({target:"Array",proto:!0},{toSorted:function(e){return void 0!==e&&o(e),c(a(u,s(this)),e)}}),h("toSorted")},20994:function(e,t,r){"use strict";r(81128)("flatMap")},19087:function(e,t,r){"use strict";r(81128)("flat")},9784:function(e,t,r){"use strict";var i=r(23414),n=r(29530),o=r(22614),s=r(56853),a=r(88854),l=r(99006);i({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=n(this),r=o(t),i=arguments.length;if(i){l(r+i);for(var h=r;h--;){var u=h+i;h in t?t[u]=t[h]:a(t,u)}for(var c=0;c<i;c++)t[c]=arguments[c]}return s(t,r+i)}})},76346:function(e,t,r){"use strict";var i=r(23414),n=r(14124),o=r(97202),s=r(90101),a="WebAssembly",l=n[a],h=7!==Error("e",{cause:7}).cause,u=function(e,t){var r={};r[e]=s(e,t,h),i({global:!0,constructor:!0,arity:1,forced:h},r)},c=function(e,t){if(l&&l[e]){var r={};r[e]=s(a+"."+e,t,h),i({target:a,stat:!0,constructor:!0,arity:1,forced:h},r)}};u("Error",function(e){return function(t){return o(e,this,arguments)}}),u("EvalError",function(e){return function(t){return o(e,this,arguments)}}),u("RangeError",function(e){return function(t){return o(e,this,arguments)}}),u("ReferenceError",function(e){return function(t){return o(e,this,arguments)}}),u("SyntaxError",function(e){return function(t){return o(e,this,arguments)}}),u("TypeError",function(e){return function(t){return o(e,this,arguments)}}),u("URIError",function(e){return function(t){return o(e,this,arguments)}}),c("CompileError",function(e){return function(t){return o(e,this,arguments)}}),c("LinkError",function(e){return function(t){return o(e,this,arguments)}}),c("RuntimeError",function(e){return function(t){return o(e,this,arguments)}})},26622:function(e,t,r){"use strict";var i=r(23414),n=r(14124),o=r(74909),s=r(94993),a=r(88257),l=r(42447),h=r(95236),u=r(53816),c=r(59847),d=r(97394),g=r(37194),p=r(80454).IteratorPrototype,f=r(9687),m=r(31564),y="constructor",w="Iterator",E=g("toStringTag"),S=TypeError,C=n[w],R=m||!a(C)||C.prototype!==p||!c(function(){C({})}),b=function(){if(o(this,p),l(this)===p)throw new S("Abstract class Iterator not directly constructable")},T=function(e,t){f?h(p,e,{configurable:!0,get:function(){return t},set:function(t){if(s(this),this===p)throw new S("You can't redefine this property");d(this,e)?this[e]=t:u(this,e,t)}}):p[e]=t};d(p,E)||T(E,w),(R||!d(p,y)||p[y]===Object)&&T(y,b),b.prototype=p,i({global:!0,constructor:!0,forced:R},{Iterator:b})},77735:function(e,t,r){"use strict";var i=r(23414),n=r(35107),o=r(64199),s=r(5722),a=r(94993),l=r(25055),h=r(19582),u=r(19633)("every",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:u},{every:function(e){a(this);try{s(e)}catch(e){h(this,"throw",e)}if(u)return n(u,this,e);var t=l(this),r=0;return!o(t,function(t,i){if(!e(t,r++))return i()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},65668:function(e,t,r){"use strict";var i=r(23414),n=r(35107),o=r(5722),s=r(94993),a=r(25055),l=r(72005),h=r(71882),u=r(31564),c=r(19582),d=r(18354),g=r(19633),p=!u&&!d("filter",function(){}),f=!u&&!p&&g("filter",TypeError),m=u||p||f,y=l(function(){for(var e,t,r=this.iterator,i=this.predicate,o=this.next;;){if(e=s(n(o,r)),this.done=!!e.done)return;if(h(r,i,[t=e.value,this.counter++],!0))return t}});i({target:"Iterator",proto:!0,real:!0,forced:m},{filter:function(e){s(this);try{o(e)}catch(e){c(this,"throw",e)}return f?n(f,this,e):new y(a(this),{predicate:e})}})},42572:function(e,t,r){"use strict";var i=r(23414),n=r(35107),o=r(64199),s=r(5722),a=r(94993),l=r(25055),h=r(19582),u=r(19633)("find",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:u},{find:function(e){a(this);try{s(e)}catch(e){h(this,"throw",e)}if(u)return n(u,this,e);var t=l(this),r=0;return o(t,function(t,i){if(e(t,r++))return i(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},57506:function(e,t,r){"use strict";var i=r(23414),n=r(35107),o=r(5722),s=r(94993),a=r(25055),l=r(71678),h=r(72005),u=r(19582),c=r(31564),d=r(18354),g=r(19633),p=!c&&!d("flatMap",function(){}),f=!c&&!p&&g("flatMap",TypeError),m=c||p||f,y=h(function(){for(var e,t,r=this.iterator,i=this.mapper;;){if(t=this.inner)try{if(!(e=s(n(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){u(r,"throw",e)}if(e=s(n(this.next,r)),this.done=!!e.done)return;try{this.inner=l(i(e.value,this.counter++),!1)}catch(e){u(r,"throw",e)}}});i({target:"Iterator",proto:!0,real:!0,forced:m},{flatMap:function(e){s(this);try{o(e)}catch(e){u(this,"throw",e)}return f?n(f,this,e):new y(a(this),{mapper:e,inner:null})}})},71005:function(e,t,r){"use strict";var i=r(23414),n=r(35107),o=r(64199),s=r(5722),a=r(94993),l=r(25055),h=r(19582),u=r(19633)("forEac
1h",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function(e){a(this);try{s(e)}catch(e){h(this,"throw",e)}if(u)return n(u,this,e);var t=l(this),r=0;o(t,function(t){e(t,r++)},{IS_RECORD:!0})}})},22488:function(e,t,r){"use strict";var i=r(23414),n=r(35107),o=r(5722),s=r(94993),a=r(25055),l=r(72005),h=r(71882),u=r(19582),c=r(18354),d=r(19633),g=r(31564),p=!g&&!c("map",function(){}),f=!g&&!p&&d("map",TypeError),m=g||p||f,y=l(function(){var e=this.iterator,t=s(n(this.next,e));if(!(this.done=!!t.done))return h(e,this.mapper,[t.value,this.counter++],!0)});i({target:"Iterator",proto:!0,real:!0,forced:m},{map:function(e){s(this);try{o(e)}catch(e){u(this,"throw",e)}return f?n(f,this,e):new y(a(this),{mapper:e})}})},15831:function(e,t,r){"use strict";var i=r(23414),n=r(64199),o=r(5722),s=r(94993),a=r(25055),l=r(19582),h=r(19633),u=r(97202),c=r(59847),d=TypeError,g=c(function(){[].keys().reduce(function(){},void 0)}),p=!g&&h("reduce",d);i({target:"Iterator",proto:!0,real:!0,forced:g||p},{reduce:function(e){s(this);try{o(e)}catch(e){l(this,"throw",e)}var t=arguments.length<2,r=t?void 0:arguments[1];if(p)return u(p,this,t?[e]:[e,r]);var i=a(this),h=0;if(n(i,function(i){t?(t=!1,r=i):r=e(r,i,h),h++},{IS_RECORD:!0}),t)throw new d("Reduce of empty iterator with no initial value");return r}})},90492:function(e,t,r){"use strict";var i=r(23414),n=r(35107),o=r(64199),s=r(5722),a=r(94993),l=r(25055),h=r(19582),u=r(19633)("some",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:u},{some:function(e){a(this);try{s(e)}catch(e){h(this,"throw",e)}if(u)return n(u,this,e);var t=l(this),r=0;return o(t,function(t,i){if(e(t,r++))return i()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},18044:function(e,t,r){"use strict";var i=r(23414),n=r(53630),o=r(97202),s=r(35107),a=r(88840),l=r(59847),h=r(74174),u=r(88257),c=r(61715),d=r(73195),g=r(9406),p=r(57618),f=r(9935),m=r(899),y=r(15842),w=r(4699),E=r(2132),S=String,C=n("JSON","stringify"),R=a(/./.exec),b=a("".charAt),T=a("".charCodeAt),N=a("".replace),A=a("".slice),I=a([].push),M=a(1.1.toString),O=/[\uD800-\uDFFF]/g,x=/^[\uD800-\uDBFF]$/,_=/^[\uDC00-\uDFFF]$/,P=y(),L=P.length,k=!w||l(function(){var e=n("Symbol")("stringify detection");return"[null]"!==C([e])||"{}"!==C({a:e})||"{}"!==C(Object(e))}),D=l(function(){return'"\udf06\ud834"'!==C("\uDF06\uD834")||'"\udead"'!==C("\uDEAD")}),H=k?function(e,t){var r=f(arguments),i=F(t);if(!(!u(i)&&(void 0===e||d(e))))return r[1]=function(e,t){if(u(i)&&(t=s(i,this,S(e),t)),!d(t))return t},o(C,null,r)}:C,B=function(e,t,r){var i=b(r,t-1),n=b(r,t+1);return R(x,e)&&!R(_,n)||R(_,e)&&!R(x,i)?"\\u"+M(T(e,0),16):e},F=function(e){if(u(e))return e;if(h(e)){for(var t=e.length,r=[],i=0;i<t;i++){var n=e[i];"string"==typeof n?I(r,n):("number"==typeof n||"Number"===g(n)||"String"===g(n))&&I(r,p(n))}var o=r.length,s=!0;return function(e,t){if(s)return s=!1,t;if(h(this))return t;for(var i=0;i<o;i++)if(r[i]===e)return t}}};C&&i({target:"JSON",stat:!0,arity:3,forced:k||D||!E},{stringify:function(e,t,r){var i=F(t),n=[],o=H(e,function(e,t){var r=u(i)?s(i,this,S(e),t):t;return!E&&c(r)?P+(I(n,r.rawJSON)-1):r},r);if("string"!=typeof o||(D&&(o=N(o,O,B)),E))return o;for(var a="",l=o.length,h=0;h<l;h++){var d=b(o,h);if('"'===d){var g=m(o,++h).end-1,p=A(o,h,g);a+=A(p,0,L)===P?n[A(p,L)]:'"'+p+'"',h=g}else a+=d}return a}})},97545:function(e,t,r){"use strict";var i=r(23414),n=r(64199),o=r(53816);i({target:"Object",stat:!0},{fromEntries:function(e){var t={};return n(e,function(e,r){o(t,e,r)},{AS_ENTRIES:!0}),t}})},81090:function(e,t,r){"use strict";var i=r(23414),n=r(25117),o=r(59847);i({target:"Set",proto:!0,real:!0,forced:!r(95287)("difference",function(e){return 0===e.size})||o(function(){var e=new Set([1,2,3,4]);return 3!==e.difference({size:1,has:function(){return!0},keys:function(){var t=0;return{next:function(){var r=t++>1;return e.has(1)&&e.clear(),{done:r,value:2}}}}}).size})},{difference:n})},54485:function(e,t,r){"use strict";var i=r(23414),n=r(59847),o=r(86596);i({target:"Set",proto:!0,real:!0,forced:!r(95287)("intersection",function(e){return 2===e.size&&e.has(1)&&e.has(2)})||n(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:o})},25765:function(e,t,r){"use strict";var i=r(23414),n=r(10185);i({target:"Set",proto:!0,real:!0,forced:!r(95287)("isDisjointFrom",function(e){return!e})},{isDisjointFrom:n})},10565:function(e,t,r){"use strict";var i=r(23414),n=r(45371);i({target:"Set",proto:!0,real:!0,forced:!r(95287)("isSubsetOf",function(e){return e})},{isSubsetOf:n})},48712:function(e,t,r){"use strict";var i=r(23414),n=r(72176);i({target:"Set",proto:!0,real:!0,forced:!r(95287)("isSupersetOf",function(e){return!e})},{isSupersetOf:n})},72956:function(e,t,r){"use strict";var i=r(23414),n=r(6792),o=r(86330);i({target:"Set",proto:!0,real:!0,forced:!r(95287)("symmetricDifference")||!o("symmetricDifference")},{symmetricDifference:n})},19975:function(e,t,r){"use strict";var i=r(23414),n=r(57985),o=r(86330);i({target:"Set",proto:!0,real:!0,forced:!r(95287)("union")||!o("union")},{union:n})},46228:function(e,t,r){"use strict";var i=r(23414),n=r(88840),o=r(81988),s=r(28922),a=r(57618),l=r(59847),h=n("".charAt);i({target:"String",proto:!0,forced:l(function(){return"\uD842"!=="\uD842\uDFB7".at(-2)})},{at:function(e){var t=a(o(this)),r=t.length,i=s(e),n=i>=0?i:r+i;return n<0||n>=r?void 0:h(t,n)}})},12928:function(e,t,r){"use strict";var i=r(23414),n=r(35107),o=r(88840),s=r(81988),a=r(88257),l=r(4800),h=r(69381),u=r(57618),c=r(54291),d=r(78732),g=r(98678),p=r(37194),f=r(31564),m=p("replace"),y=TypeError,w=o("".indexOf),E=o("".replace),S=o("".slice),C=Math.max;i({target:"String",proto:!0},{replaceAll:function(e,t){var r,i,o,p,R,b,T,N,A,I=s(this),M=0,O="";if(l(e)){if((r=h(e))&&!~w(u(s(d(e))),"g"))throw new y("`.replaceAll` does not allow non-global regexes");if(i=c(e,m))return n(i,e,I,t);if(f&&r)return E(u(I),e,t)}for(o=u(I),p=u(e),(R=a(t))||(t=u(t)),T=C(1,b=p.length),N=w(o,p);-1!==N;)A=R?u(t(p,N,o)):g(p,o,N,[],void 0,t),O+=S(o,M,N)+A,M=N+b,N=N+T>o.length?-1:w(o,p,N+T);return M<o.length&&(O+=S(o,M)),O}})},70470:function(e,t,r){"use strict";r(26622)},11898:function(e,t,r){"use strict";r(77735)},52419:function(e,t,r){"use strict";r(65668)},88514:function(e,t,r){"use strict";r(42572)},34950:function(e,t,r){"use strict";r(57506)},95984:function(e,t,r){"use strict";r(71005)},17901:function(e,t,r){"use strict";r(22488)},85411:function(e,t,r){"use strict";r(15831)},97934:function(e,t,r){"use strict";r(90492)},8049:function(e,t,r){"use strict";var i=r(23414),n=r(14124),o=r(20861).clear;i({global:!0,bind:!0,enumerable:!0,forced:n.clearImmediate!==o},{clearImmediate:o})},57607:function(e,t,r){"use strict";r(8049),r(41429)},41429:function(e,t,r){"use strict";var i=r(23414),n=r(14124),o=r(20861).set,s=r(40571),a=n.setImmediate?s(o,!1):o;i({global:!0,bind:!0,enumerable:!0,forced:n.setImmediate!==a},{setImmediate:a})},62012:function(e,t,r){"use strict";r.d(t,{sZ:function(){return K}});var i,n,o,s,a,l=r(2265),h=r(54887),u=r(43857),c=r(26595),d=r(65187),g=null;function p(){if("undefined"!=typeof console){var e;(e=console).warn.apply(e,arguments)}}function f(e){return m(e,"hot-renderer")?(p("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."),!0):!!m(e,"hot-editor")&&(p("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."),!0)}function m(e,t){return l.Children.toArray(e).some(function(e){return void 0!==e.props[t]})}function y(e,t){if(!e||!t||"boolean"==typeof t)return null;var r=l.createElement(t,null),i=w({},!1);return i.className="".concat("hot-wrapper-editor-container"," ").concat(i.className),h.createPortal(l.createElement("div",Object.assign({},i),r),e.body)}function w(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return{id:e.id||(t?"hot-"+Math.random().toString(36).substring(5):void 0),className:e.className||"",style:e.style||{}}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function S(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function C(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t);if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i.key),i)}}function R(e,t,r){return t&&C(e.prototype,t),r&&C(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}function N(e,t){return(N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function A(e,t){if(e){if("string"==typeof e)return E(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}var I=R(function e(){S(this,e)},null,[{key:"getSettings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.prevProps,i=void 0===r?{}:r,n=t.isInit,o=void 0!==n&&n,s=t.initOnlySettingKeys,a=void 0===s?[]:s,l={};for(var h in e)"children"!==h&&(!(!o&&a.includes(h))||i[h]!==e[h])&&e.hasOwnProperty(h)&&(l[h]=e[h]);return l}}]),M=(0,l.createContext)(void 0),O=function(e){var t=e.children,r=(0,l.useRef)([]),i=(0,l.useCallback)(function(e,t){r.current[t]=e},[]),n=(0,l.useRef)(new Map),o=(0,l.useRef)(new Map),s=(0,l.useCallback)(function(){return o.current.clear()},[]),a=(0,l.useRef)(new Map),u=(0,l.useCallback)(function(){return a.current.clear()},[]),c=(0,l.useRef)(new Map),d=(0,l.useCallback)(function(e){return function(t,r,i,n,s,u,d){var p="".concat(i,"-").concat(n),f=t.guid,m="".concat(f,"-").concat(p),y="".concat(p,"-").concat(f);if(o.current.has(p)&&(r.innerHTML=o.current.get(p).innerHTML),r&&!r.getAttribute("ghost-table")){for(var w=a.current.get(y),E=c.current.get(m);r.firstChild;)r.removeChild(r.firstChild);if(w&&E)r.appendChild(E);else{var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;t||(t=document),g||(g=t.createDocumentFragment());var n=null!=i?i:t.createElement("DIV");return g.appendChild(n),{portal:h.createPortal(e,n,r),portalContainer:n}}(l.createElement(e,{instance:t,TD:r,row:i,col:n,prop:s,value:u,cellProperties:d}),r.ownerDocument,y,E),C=S.portal,R=S.portalContainer;c.current.set(m,R),r.appendChild(R),a.current.set(y,C)}}return o.current.set("".concat(i,"-").concat(n),r),r}},[]),p=(0,l.useRef)(function(){}),f=(0,l.useCallback)(function(e){p.current=e},[]),m=(0,l.useCallback)(function(){var e;p.current(function(e){if(Array.isArray(e))return E(e)}(e=a.current.values())||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||A(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},[]),y=(0,l.useMemo)(function(){return{componentRendererColumns:n.current,columnsSettings:r.current,emitColumnSettings:i,getRendererWrapper:d,clearPortalCache:u,clearRenderedCellCache:s,setRenderersPortalManagerRef:f,pushCellPortalsIntoPortalManager:m}},[i,d,s,f,m]);return l.createElement(M.Provider,{value:y},t)};function x(){return(0,l.useContext)(M)}var _=(0,l.createContext)(void 0),P=function(e){var t=e.columnIndex,r=e.getOwnerDocument,i=e.children,n=(0,l.useMemo)(function(){return{columnIndex:t,getOwnerDocument:r}},[t,r]);return l.createElement(_.Provider,{value:n},i)},L=["close","focus","open"],k=["getValue","setValue"],D={open:"onOpen",close:"onClose",prepare:"onPrepare",focus:"onFocus"};function H(e,t){return function(r){function i(r){var n,o,s;return S(this,i),o=i,s=[r],o=b(o),n=function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,T()?Reflect.construct(o,s||[],b(this).constructor):o.apply(this,s)),t.current=n,Object.getOwnPropertyNames(u.ZP.editors.BaseEditor.prototype).forEach(function(t){if(!("constructor"===t||k.includes(t))){var r=u.ZP.editors.BaseEditor.prototype[t];i.prototype[t]=(function(){for(var i,n,o,s=arguments.length,a=Array(s),l=0;l<s;l++)a[l]=arguments[l];return L.includes(t)||(n=r.call.apply(r,[this].concat(a))),D[t]&&null!==(i=e.current)&&void 0!==i&&i[D[t]]&&(n=(o=e.current[D[t]]).call.apply(o,[this].concat(a))),n}).bind(n)}}),n}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N(e,t)}(i,r),R(i,[{key:"focus",value:function(){}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(e){this.value=e}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(u.ZP.editors.BaseEditor)}var B=(0,l.createContext)(void 0),F=function(e){var t=e.hooksRef,r=e.hotCustomEditorInstanceRef,i=e.children;return l.createElement(B.Provider,{value:{hooksRef:t,hotCustomEditorInstanceRef:r}},i)},V=function(e){return e.type===W},U=["_columnIndex","_getOwnerDocument","children"],W=function(e){var t=x(),r=t.componentRendererColumns,i=t.emitColumnSettings,n=t.getRendererWrapper,o=(0,l.useContext)(_),s=o.columnIndex,a=o.getOwnerDocument,h=(0,l.useRef)(null),u=(0,l.useRef)(null);(0,l.useEffect)(function(){var t,o;i((t=I.getSettings(Object.keys(e).filter(function(e){return!U.includes(e)}).reduce(function(t,r){return t[r]=e[r],t},{})),e.renderer?(t.renderer=n(e.renderer),r.set(s,!0)):e.hotRenderer&&(t.renderer=e.hotRenderer),e.editor?t.editor=H(h,u):e.hotEditor&&(t.editor=e.hotEditor),t),s),!f(e.children)&&(o=e.children,l.Children.toArray(o).length&&p("Unexpected children nodes found in HotC
1olumn component. HotColumn components do not support any children."))});var c=y(a(),e.editor);return l.createElement(F,{hooksRef:h,hotCustomEditorInstanceRef:u},c)},j=(0,l.forwardRef)(function(e,t){var r,i=function(e){if(Array.isArray(e))return e}(r=(0,l.useState)([]))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,o,s,a=[],l=!0,h=!1;try{for(o=(r=r.call(e)).next;!(l=(i=o.call(r)).done)&&(a.push(i.value),2!==a.length);l=!0);}catch(e){h=!0,n=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(h)throw n}}return a}}(r,2)||A(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=i[0],o=i[1];return(0,l.useImperativeHandle)(t,function(){return o}),l.createElement(l.Fragment,null,n)}),G={exports:{}};G.exports=(function(){if(a)return s;a=1;var e=o?n:(o=1,n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function r(){}return r.resetWarningCache=t,s=function(){function i(t,r,i,n,o,s){if(s!==e){var a=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 a.name="Invariant Violation",a}}function n(){return i}i.isRequired=i;var o={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:n,element:i,elementType:i,instanceOf:n,node:i,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:r,resetWarningCache:t};return o.PropTypes=o,o}})()();var $=(i=G.exports)&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,z=(0,l.forwardRef)(function(e,t){var r,i,n=(0,l.useRef)(null),o=(0,l.useRef)(null),s=(0,l.useRef)(null),a=(0,l.useRef)(null),h=(0,l.useRef)(),g=x(),m=(0,l.useCallback)(function(){return n.current&&n.current.isDestroyed?(console.warn("The Handsontable instance bound to this component was destroyed and cannot be used properly."),null):n.current},[n]),E=(0,l.useCallback)(function(){return!n.current||n.current.isDestroyed},[n]),S=(0,l.useCallback)(function(){g.clearRenderedCellCache(),g.componentRendererColumns.clear()},[g]),C=(0,l.useCallback)(function(){return"undefined"!=typeof window?o.current?o.current.ownerDocument:document:null},[o]),R=function(){var t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=E()?[]:(null===(t=m())||void 0===t||null===(t=t.getSettings())||void 0===t?void 0:t._initOnlySettings)||[],o=I.getSettings(e,{prevProps:i,isInit:r,initOnlySettingKeys:n});return g.columnsSettings.length&&(o.columns=g.columnsSettings),e.renderer?(o.renderer=g.getRendererWrapper(e.renderer),g.componentRendererColumns.set("global",!0)):o.renderer=e.hotRenderer||(0,c.Bp)("text"),e.editor?o.editor=H(s,a):o.editor=e.hotEditor||(0,d.y$)("text"),o},b=function(e){var t,r;e&&(null!==(t=e.getPlugin("autoRowSize"))&&void 0!==t&&t.enabled||null!==(r=e.getPlugin("autoColumnSize"))&&void 0!==r&&r.enabled)&&g.componentRendererColumns.size>0&&p("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.")};(0,l.useEffect)(function(){var t,r=R(!0);return h.current=e,n.current=new u.ZP.Core(o.current,r),n.current.addHook("beforeViewRender",function(){g.clearPortalCache(),g.clearRenderedCellCache()}),n.current.addHook("afterViewRender",function(){g.pushCellPortalsIntoPortalManager()}),n.current.init(),b(n.current),!f(e.children)&&(t=e.children,l.Children.toArray(t).some(function(e){return e.type!==W})&&p("Unexpected children nodes found in HotTable component. Only HotColumn components are allowed.")),function(){var e;S(),null===(e=m())||void 0===e||e.destroy()}},[]),r=function(){S();var t=m(),r=R(!1,h.current);h.current=e,null==t||t.updateSettings(r,!1),b(t),f(e.children)},i=l.useRef(!1),(0,l.useEffect)(function(){if(i.current)return r();i.current=!0},void 0),(0,l.useImperativeHandle)(t,function(){return{get hotElementRef(){return o.current},get hotInstance(){return m()}}});var T=l.Children.toArray(e.children).filter(V).map(function(e,t){return l.createElement(P,{columnIndex:t,getOwnerDocument:C,key:t},e)}),N=w(e),A=y(C(),e.editor);return l.createElement(l.Fragment,null,l.createElement("div",Object.assign({ref:o},N),T),l.createElement(j,{ref:g.setRenderersPortalManagerRef}),l.createElement(F,{hooksRef:s,hotCustomEditorInstanceRef:a},A))});z.propTypes={style:$.object,id:$.string,className:$.string};var Y=["children"],K=(0,l.forwardRef)(function(e,t){var r,i=e.children,n=function(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r={};for(var i in e)if(({}).hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;
1r[i]=e[i]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,Y),o=null!==(r=n.id)&&void 0!==r?r:(0,l.useId)();return l.createElement(O,null,l.createElement(z,Object.assign({id:o},n,{ref:t}),i))});K.version="16.2.0"},28744:function(e,t,r){"use strict";r.d(t,{P:function(){return a},Q:function(){return s}});let i=/^(\r\n|\n\r|\r|\n)/,n=/^[^\t\r\n]+/,o=/^\t/;function s(e){let t;let r=[[""]];if(0===e.length)return r;let s=0,a=0;for(;e.length>0&&t!==e.length;)if(t=e.length,e.match(o))e=e.replace(o,""),s+=1,r[a][s]="";else if(e.match(i))e=e.replace(i,""),s=0,r[a+=1]=[""];else{let t="";if(e.startsWith('"')){let r=0,i=!0;for(;i;){let n=e.slice(0,1);'"'===n&&(r+=1),t+=n,(0===(e=e.slice(1)).length||e.match(/^[\t\r\n]/)&&r%2==0)&&(i=!1)}t=t.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,e=>Array(Math.floor(e.length/2)).fill('"').join(""))}else{let r=e.match(n);t=r?r[0]:"",e=e.slice(t.length)}r[a][s]=t}return r}function a(e){let t,r,i,n,o;let s="";for(t=0,r=e.length;t<r;t+=1){for(i=0,n=e[t].length;i<n;i+=1)i>0&&(s+="	"),"string"==typeof(o=e[t][i])?o.indexOf("\n")>-1?s+=`"${o.replace(/"/g,'""')}"`:s+=o:null==o?s+="":s+=o;t!==r-1&&(s+="\n")}return s}},82982:function(e,t,r){"use strict";function i(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{f:function(){return n}}),r(76346),r(70470),r(95984);class n{constructor(e){i(this,"calculationTypes",[]),i(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach(t=>{let[r,i]=t;this.calculationResults.set(r,i),i.initialize(e)})}_process(e,t){this.calculationTypes.forEach(r=>{let[,i]=r;return i.process(e,t)})}_finalize(e){this.calculationTypes.forEach(t=>{let[,r]=t;return r.finalize(e)})}getResultsFor(e){return this.calculationResults.get(e)}}},91062:function(e,t,r){"use strict";r.d(t,{$:function(){return o},E:function(){return s}}),r(76346),r(65230);var i=r(82982);function n(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let o=50;class s extends i.f{constructor(e){let{calculationTypes:t,viewportWidth:r,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(t),n(this,"viewportWidth",0),n(this,"scrollOffset",0),n(this,"zeroBasedScrollOffset",0),n(this,"totalColumns",0),n(this,"columnWidthFn",null),n(this,"columnWidth",0),n(this,"overrideFn",null),n(this,"inlineStartOffset",0),n(this,"totalCalculatedWidth",0),n(this,"startPositions",[]),n(this,"needReverse",!0),this.viewportWidth=r,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){let t=this.columnWidthFn(e);return isNaN(t)?o:t}}},5506:function(e,t,r){"use strict";function i(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){return e.get(s(e,t))}function o(e,t,r){return e.set(s(e,t),r),r}function s(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}r(76346);var a=new WeakMap;class l{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i(this,"row",null),i(this,"col",null),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,a),a.set(this,!1),o(a,this,r),void 0!==e&&void 0!==t&&(this.row=e,this.col=t)}
1isValid(e){let{countRows:t,countCols:r,countRowHeaders:i,countColHeaders:n}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!!Number.isInteger(this.row)&&!!Number.isInteger(this.col)&&!(this.row<-n)&&!(this.col<-i)&&!(this.row>=t)&&!(this.col>=r)}isEqual(e){return e===this||this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return n(a,this)}isSouthEastOf(e){return this.row>=e.row&&(n(a,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(n(a,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(n(a,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(n(a,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=null===this.row?this.row:Math.max(this.row,0),this.col=null===this.col?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(null==e?void 0:e.row)&&(this.row=e.row),Number.isInteger(null==e?void 0:e.col)&&(this.col=e.col),e instanceof l&&o(a,this,e.isRtl()),this}clone(){return new l(this.row,this.col,n(a,this))}toObject(){return{row:this.row,col:this.col}}}t.Z=l},77718:function(e,t,r){"use strict";r(76346),r(65230);var i=r(5506);function n(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return e.get(s(e,t))}function s(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var a=new WeakMap;class l{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n(this,"highlight",null),n(this,"from",null),n(this,"to",null),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,a),a.set(this,!1),this.highlight=e.clone(),this.from=t.clone(),this.to=r.clone(),a.set(s(a,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())||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;let e=Math.max(this.from.row,0),t=Math.max(this.to.row,0);return Math.max(e,t)-Math.min(e,t)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;let e=Math.max(this.from.col,0),t=Math.max(this.to.col,0);return Math.max(e,t)-Math.min(e,t)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){let{row:t,col:r}=e,i=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();return i.row<=t&&n.row>=t&&i.col<=r&&n.col>=r}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}
1expand(e){let t=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();return(e.row<t.row||e.col<t.col||e.row>r.row||e.col>r.col)&&(this.from=this._createCellCoords(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=this._createCellCoords(Math.max(r.row,e.row),Math.max(r.col,e.col)),!0)}expandByRange(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(this.includesRange(e)||!this.overlaps(e))return!1;let r=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),n=this.getDirection(),o=e.getOuterTopStartCorner(),s=e.getOuterBottomEndCorner(),a=Math.min(r.row,o.row),l=Math.min(r.col,o.col),h=Math.max(i.row,s.row),u=Math.max(i.col,s.col),c=this._createCellCoords(a,l),d=this._createCellCoords(h,u);return this.from=c,this.to=d,this.setDirection(n),t&&(this.highlight.row===this.getOuterBottomRightCorner().row&&"N-S"===this.getVerticalDirection()&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&"W-E"===this.getHorizontalDirection()&&this.flipDirectionHorizontally()),!0}getDirection(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0}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()]}}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")}}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")}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return o(a,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 o(a,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 o(a,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 o(a,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 o(a,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 o(a,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 o(a,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 o(a,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){return e instanceof i.Z&&(e.isEqual(this.getOuterBottomEndCorner())?this.getOuterTopStartCorner():e.isEqual(this.getOuterTopStartCorner())?this.getOuterBottomEndCorner():e.isEqual(this.getOuterTopEndCorner())?this.getOuterBottomStartCorner():e.isEqual(this.getOuterBottomStartCorner())?this.getOuterTopEndCorner():void 0)}getBordersSharedWith(e){if(!this.includesRange(e))return[];let t={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)},r={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 t.top===r.top&&i.push("top"),t.right===r.right&&i.push(o(a,this)?"left":"right"),t.bottom===r.bottom&&i.push("bottom"),t.left===r.left&&i.push(o(a,this)?"right":"left"),i}getInner(){let e=this.getOuterTopStartCorner(),t=this.getOuterBottomEndCorner(),r
1=[];for(let i=e.row;i<=t.row;i++)for(let n=e.col;n<=t.col;n++)this.from.row===i&&this.from.col===n||this.to.row===i&&this.to.col===n||r.push(this._createCellCoords(i,n));return r}getAll(){let e=this.getOuterTopStartCorner(),t=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=t.row;i++)for(let n=e.col;n<=t.col;n++)e.row===i&&e.col===n?r.push(e):t.row===i&&t.col===n?r.push(t):r.push(this._createCellCoords(i,n));return r}forAll(e){let t=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();for(let i=t.row;i<=r.row;i++)for(let n=t.col;n<=r.col;n++)if(!1===e(i,n))return}clone(){return new l(this.highlight,this.from,this.to,o(a,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,t){return new i.Z(e,t,o(a,this))}}t.Z=l},79401:function(e,t,r){"use strict";r.d(t,{$7:function(){return u},AI:function(){return o},BA:function(){return h},CD:function(){return i},Nc:function(){return n},Os:function(){return l},P$:function(){return a},t8:function(){return s}});let i="active-header",n="header",o="area",s="focus",a="fill",l="row",h="column",u="custom-selection"},43857:function(e,t,r){"use strict";var i=r(45272),n=r(31285),o=r(9277),s=r(41965),a=r(9732),l=r(26212),h=r(3277),u=r(43488),c=r(5506),d=r(77718);function g(e,t){let r=new i.Z(e,t||{},n.mc);return r.init(),r}(0,l.xN)(h.n),g.editors={BaseEditor:u.Hf},g.Core=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new i.Z(e,t,n.mc)},g.DefaultSettings=(0,o.Z)(),g.hooks=s.P.getSingleton(),g.CellCoords=c.Z,g.CellRange=d.Z,g.packageName="handsontable",g.buildDate="20/11/2025 13:26:54",g.version="16.2.0",g.languages={dictionaryKeys:a.Zs,getLanguageDictionary:a.qG,getLanguagesDictionaries:a.vq,registerLanguageDictionary:a.MG,getTranslatedPhrase:a.vk},t.ZP=g},26212:function(e,t,r){"use strict";r.d(t,{DA:function(){return d},V1:function(){return h},pH:function(){return u},xN:function(){return g}}),r(76346);var i=r(14216),n=r(65187),o=r(26595),s=r(92809);let{register:a,getItem:l,hasItem:h,getNames:u,getValues:c}=(0,i.Qv)("cellTypes");function d(e){if(!h(e))throw Error(`You declared cell type "${e}" as a string that is not mapped to a known object.
2                 Cell type must be an object or a string mapped to an object registered by
3                 "Handsontable.cellTypes.registerCellType" method`);return l(e)}function g(e,t){"string"!=typeof e&&(e=(t=e).CELL_TYPE);let{editor:r,renderer:i,validator:l}=t;r&&(0,n.qm)(e,r),i&&(0,o.zn)(e,i),l&&(0,s.Ie)(e,l),a(e,t)}},3277:function(e,t,r){"use strict";r.d(t,{n:function(){return o}});var i=r(58805),n=r(48463);let o={CELL_TYPE:"text",editor:i.H,renderer:n.V}},85650:function(e,t,r){"use strict";function i(e,t,r){n(e,t),t.set(e,r)}function n(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function o(e,t,r){return e.set(s(e,t),r),r}function s(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}r.d(t,{w:function(){return u}}),r(76346);var a=new WeakMap,l=new WeakMap,h=new WeakSet;class u{constructor(e){let{rowIndexMapper:t,columnIndexMapper:r}=e;n(this,h),h.add(this),i(this,a,void 0),i(this,l,void 0),o(a,this,t),o(l,this,r)}toRenderable(e){let t="N-S"===e.getVerticalDirection()?1:-1,r="W-E"===e.getHorizontalDirection()?1:-1,i=s(h,this,c).call(this,e.from,t,r);if(null===i)return null;let n=s(h,this,c).call(this,e.to,-t,-r);if(null===n)return null;let o=e.clone();return o.from=i,o.to=n,o.includes(e.highlight)||(o.highlight=i),o}}function c(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=s(h,this,d).call(this,a.get(s(a,this)),e.row,t);if(null===i)return null;let n=s(h,this,d).call(this,l.get(s(l,this)),e.col,r);return null===n?null:e.clone().assign({row:i,col:n})}function d(e,t,r){return t<0?t:e.getNearestNotHiddenIndex(t,r)}},41965:function(e,t,r){"use strict";r.d(t,{P:function(){return b}}),r(76346),r(65230);var i=r(22386),n=r(60049),o=r(26247),s=r(80600),a=r(37710);let l=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceCac
3heUpdate","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","afterRowSequenceCacheUpdate","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","beforeSelectAll","afterSelectAll","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeHeightChange","beforeWidthChange","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","beforePageChange","afterPageChange","beforePageSizeChange","afterPageSizeChange","afterPageSizeVisibilityChange","afterPageCounterVisibilityChange","afterPageNavigationVisibilityChange","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","afterDialogHide","afterDialogShow","beforeDialogHide","beforeDialogShow","dialogFocusPreviousElement","dialogFocusNextElement","afterDialogFocus","beforeLoadingShow","afterLoadingShow","beforeLoadingHide","afterLoadingHide","beforeEmptyDataStateShow","afterEmptyDataStateShow","beforeEmptyDataStateHide","afterEmptyDataStateHide","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],h=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"]]),u=new Map([[]]);function c(e,t,r){d(e,t),t.set(e,r)}function d(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t,r){return e.set(f(e,t),r),r}function p(e,t){return e.get(f(e,t))}function f(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}r(44174),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975),r(70470),r(52419),r(88514),r(95984);var m=new WeakMap,y=new WeakMap,w=new WeakMap,E=new WeakSet;class S{constructor(){d(this,E),E.add(this),c(this,m,new Map),c(this,y,new Map),c(this,w,new Set),l.forEach(e
3=>f(E,this,C).call(this,e))}getHooks(e){var t;return null!==(t=p(m,this).get(e))&&void 0!==t?t:[]}add(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};p(m,this).has(e)||(f(E,this,C).call(this,e),l.push(e));let i=p(m,this).get(e),n=i.find(e=>e.callback===t);if(n){!0===n.skip&&(n.skip=!1);return}let o=Number.isInteger(r.orderIndex)?r.orderIndex:0,s=!!r.runOnce,a=!!r.initialHook,h=!1;if(a){let e=i.find(e=>e.initialHook);e&&(e.callback=t,h=!0)}if(!h){i.push({callback:t,orderIndex:o,runOnce:s,initialHook:a,skip:!1});let r=p(w,this).has(e);r||0===o||(r=!0,p(w,this).add(e)),r&&i.length>1&&p(m,this).set(e,i.toSorted((e,t)=>e.orderIndex-t.orderIndex))}}has(e){return p(m,this).has(e)&&p(m,this).get(e).length>0}remove(e,t){if(!p(m,this).has(e))return!1;let r=p(m,this).get(e),i=r.find(e=>e.callback===t);if(i){let t=p(y,this).get(e);return i.skip=!0,(t+=1)>100&&(p(m,this).set(e,r.filter(e=>!e.skip)),t=0),p(y,this).set(e,t),!0}return!1}destroy(){p(m,this).clear(),p(y,this).clear(),g(m,this,null),g(y,this,null)}}function C(e){p(m,this).set(e,[]),p(y,this).set(e,0)}let R=(0,s.e)`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
4  Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
5  learn about the migration path.`;class b{constructor(){var e,t,r;e="globalBucket",t=new S,(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t}static getSingleton(){return T}getBucket(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new S),e.pluginHookBucket):this.globalBucket}add(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3?arguments[3]:void 0;return Array.isArray(t)?(0,i.arrayEach)(t,t=>this.add(e,t,r)):(h.has(e)&&(0,o.ZK)((0,n.substitute)(R,{hookName:e,removedInVersion:h.get(e)})),u.has(e)&&(0,o.ZK)(u.get(e)),this.getBucket(r).add(e,t,{orderIndex:s,runOnce:!1})),this}once(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0;return Array.isArray(t)?(0,i.arrayEach)(t,t=>this.once(e,t,r)):this.getBucket(r).add(e,t,{orderIndex:n,runOnce:!0}),this}addAsFixed(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Array.isArray(t)?(0,i.arrayEach)(t,t=>this.addAsFixed(e,t,r)):this.getBucket(r).add(e,t,{initialHook:!0}),this}remove(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.getBucket(r).remove(e,t)}has(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.getBucket(t).has(e)}run(e,t,r,i,n,o,s,l){{let h=this.getBucket().getHooks(t),u=h?h.length:0,c=0;if(u)for(;c<u;){if(!h[c]||h[c].skip){c+=1;continue}let u=(0,a.fastCall)(h[c].callback,e,r,i,n,o,s,l);void 0!==u&&(r=u),h[c]&&h[c].runOnce&&this.remove(t,h[c].callback),c+=1}}{let h=this.getBucket(e).getHooks(t),u=h?h.length:0,c=0;if(u)for(;c<u;){if(!h[c]||h[c].skip){c+=1;continue}let u=(0,a.fastCall)(h[c].callback,e,r,i,n,o,s,l);void 0!==u&&(r=u),h[c]&&h[c].runOnce&&this.remove(t,h[c].callback,e),c+=1}}return r}destroy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||l.push(e)}deregister(e){this.isRegistered(e)&&l.splice(l.indexOf(e),1)}isDeprecated(e){return u.has(e)||h.has(e)}isRegistered(e){return l.indexOf(e)>=0}getRegistered(){return l}}let T=new b},35507:function(e,t,r){"use strict";r.d(t,{t:function(){return s}});var i=r(46879);function n(e){(0,i.isHTMLElement)(e)&&e.scrollIntoView({block:"nearest",inline:"nearest"})}function o(e){let{selection:t,view:r}=e,i=e.getSelectedRangeActive(),n=t.getSelectionSource(),o=r.getFirstFullyVisibleColumn(),s=r.getLastFullyVisibleColumn(),a=i.getTopStartCorner().col,l=i.getBottomEndCorner().col,h=a<=o,u=l>=s,c=r.getFirstFullyVisibleRow(),d=r.getLastFullyVisibleRow(),g=i.getTopStartCorner().row,p=i.getBottomEndCorner().row,f=g<=c,m=p>=d;return{getComputedColumnTarget:e=>"mouse"===n||"keyboard"===n?e.col:h&&u?i.highlight.col:h?a:u?l:e.col,getComputedRowTarget:e=>"mouse"===n||"keyboard"===n?e.row:f&&m?i.highlight.row:f?g:m?p:e.row}}function s(e){let{selection:t}=e,r=!1,i=!1;return{resume(){i=!1},suspend(){i=!0},skipNextScrollCycle(){r=!0},scrollTo(s){var a;let l;if(r||i){r=!1;return}
5t.isFocusSelectionChanged()?l=t=>{e.scrollViewportTo(t.toObject(),()=>{let t=e.getSelectedRangeActive();if(!t)return;let{row:r,col:i}=t.highlight;n(e.getCell(r,i,!0))})}:t.isSelectedByCorner()?l=()=>{}:t.isSelectedByRowHeader()?l=t=>{let r=o(e).getComputedRowTarget(t);e.scrollViewportTo({row:r},()=>{let t=!!e.getSettings().rowHeaders;n(e.getCell(r,t?-1:0,!0))})}:t.isSelectedByColumnHeader()?l=t=>{let r=o(e).getComputedColumnTarget(t);e.scrollViewportTo({col:r},()=>{let t=!!e.getSettings().colHeaders;n(e.getCell(t?-1:0,r,!0))})}:1===t.getSelectedRange().size()&&t.isMultiple()?l=t=>{let r=o(e),i={row:r.getComputedRowTarget(t),col:r.getComputedColumnTarget(t)};e.scrollViewportTo(i,()=>{let{row:t,col:r}=i;n(e.getCell(t,r,!0))})}:1!==t.getSelectedRange().size()||t.isMultiple()?t.getSelectedRange().size()>1&&(l=t=>{let r=o(e),i={row:r.getComputedRowTarget(t),col:r.getComputedColumnTarget(t)};e.scrollViewportTo(i,()=>{let{row:t,col:r}=i;n(e.getCell(t,r,!0))})}):l=t=>{let r=e.selection.getSelectionSource(),{row:i,col:o}=t,s=()=>{n(e.getCell(i,o,!0))};if(i<0&&o>=0)e.scrollViewportTo({col:o},s);else if(o<0&&i>=0)e.scrollViewportTo({row:i},s);else{if("mouse"===r&&(o===e.view.getLastPartiallyVisibleColumn()||i===e.view.getLastPartiallyVisibleRow()))return;e.scrollViewportTo({row:i,col:o},s)}},null===(a=l)||void 0===a||a(s)}}}},80483:function(e,t,r){"use strict";r(76346),r(65230),r(70470),r(95984);var i=r(92263),n=r(24697),o=r(22386),s=r(47771),a=r(37710);function l(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class h{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];l(this,"hot",void 0),l(this,"data",void 0),l(this,"dataType","array"),l(this,"colToProp",()=>{}),l(this,"propToCol",()=>{}),this.hot=e,this.data=t}modifyRowData(e){let t;return this.hot.hasHook("modifyRowData")&&(t=this.hot.runHooks("modifyRowData",e)),void 0===t||Number.isInteger(t)?this.data[e]:t}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.data&&0!==this.data.length?this.getByRange(null,null,e):this.data}setData(e){this.data=e}getAtColumn(e){let t=[];return(0,o.arrayEach)(this.data,(r,i)=>{let n=this.getAtCell(i,e);t.push(n)}),t}getAtRow(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=void 0===t&&void 0===r,{dataDotNotation:l}=this.hot.getSettings(),h=null,u=null;if(Array.isArray(h=this.modifyRowData(e)))u=[],o?h.forEach((t,r)=>{u[r]=this.getAtPhysicalCell(e,r,h)}):(0,s.rangeEach)(t,r,r=>{u[r-t]=this.getAtPhysicalCell(e,r,h)});else if((0,i.isObject)(h)||(0,a.isFunction)(h)){if(u=n?[]:{},!o||n){let o=this.countFirstRowKeys()-1;(0,s.rangeEach)(0,o,s=>{let a=this.colToProp(s);if(s>=(t||0)&&s<=(r||o)&&!Number.isInteger(a)){let t=this.getAtPhysicalCell(e,a,h);n?u.push(t):l?(0,i.setProperty)(u,a,t):u[a]=t}})}else(0,i.objectEach)(h,(t,r)=>{let n=this.getAtPhysicalCell(e,r,h);l?(0,i.setProperty)(u,r,n):u[r]=n})}return u}setAtCell(e,t,r){if(!(e>=this.countRows()||t>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){let n=(0,i.createObjectPropListener)(r);this.hot.runHooks("modifySourceData",e,t,n,"set"),n.isTouched()&&(r=n.value)}["__proto__","constructor","prototype"].includes(e)||(Number.isInteger(t)?this.data[e][t]=r:(0,i.setProperty)(this.data[e],t,r))}}getAtPhysicalCell(e,t,r){let n=null;if(r){if("string"==typeof t){let{dataDotNotation:e}=this.hot.getSettings();n=e?(0,i.getProperty)(r,t):r[t]}else n="function"==typeof t?t(r):r[t]}if(this.hot.hasHook("modifySourceData")){let r=(0,i.createObjectPropListener)(n);this.hot.runHooks("modifySourceData",e,t,r,"get"),r.isTouched()&&(n=r.value)}return n}getAtCell(e,t){let r=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(t),r)}getByRange(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!1,n=null,o=null,a=null,l=null;null===e||null===t?(i=!0,n=0,a=this.countRows()-1):(n=Math.min(e.row,t.row),o=Math.min(e.col,t.col),a=Math.max(e.row,t.row),l=Math.max(e.col,t.col));let h=[];return(0,s.rangeEach)(n,a,e=>{h.push(i?this.getAtRow(e,void 0,void 0,r):this.getAtRow(e,o,l,r))}),h}getCopyable(e,t){let r=this.propToCol(t);return this.hot.getCellMeta(e,r).copyable?this.getAtCell(this.hot.toPhysicalRow(e),r):""}countRows(){if(this.hot.hasHook("modifySourceLength")){let e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}
5countFirstRowKeys(){return(0,n.countFirstRowKeys)(this.data)}destroy(){this.data=null,this.hot=null}}t.Z=h},69087:function(e,t,r){"use strict";r.d(t,{Z:function(){return E}}),r(76346),r(70470),r(95984);var i=r(92263),n=r(87239),o=r(9277);function s(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a{constructor(e){s(this,"metaCtor",class{}),s(this,"meta",void 0),this.meta=this.metaCtor.prototype,(0,i.extend)(this.meta,(0,o.Z)()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var t;(0,i.extend)(this.meta,e),(0,n.oD)(this.meta,{...e,type:null!==(t=e.type)&&void 0!==t?t:this.meta.type},e)}}class l{constructor(e){var t,r,i;r=void 0,(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t="meta","string"))?i:i+"")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r;let n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){(0,i.extend)(this.meta,e),(0,n.oD)(this.meta,e,e)}}r(65230),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975),r(52419);var h=r(47771);function u(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c{constructor(e){u(this,"valueFactory",void 0),u(this,"data",[]),u(this,"index",[]),u(this,"holes",new Set),this.valueFactory=e}obtain(e){let t;(0,n.hu)(()=>(0,h.isUnsignedNumber)(e),"Expecting an unsigned number.");let r=this._getStorageIndexByKey(e);if(r>=0)void 0===(t=this.data[r])&&(t=this.valueFactory(e),this.data[r]=t);else if(t=this.valueFactory(e),this.holes.size>0){let r=this.holes.values().next().value;this.holes.delete(r),this.data[r]=t,this.index[e]=r}else this.data.push(t),this.index[e]=this.data.length-1;return t}insert(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;(0,n.hu)(()=>(0,h.isUnsignedNumber)(e)||(0,n.Rw)(e),"Expecting an unsigned number or null/undefined argument.");let r=[],i=this.data.length;for(let e=0;e<t;e++)r.push(i+e),this.data.push(void 0);let o=(0,n.Rw)(e)?this.index.length:e;this.index=[...this.index.slice(0,o),...r,...this.index.slice(o)]}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;(0,n.hu)(()=>(0,h.isUnsignedNumber)(e)||(0,n.Rw)(e),"Expecting an unsigned number or null/undefined argument.");let r=this.index.splice((0,n.Rw)(e)?this.index.length-t:e,t);for(let e=0;e<r.length;e++){let t=r[e];"number"==typeof t&&this.holes.add(t)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,t)=>void 0!==e&&!this.holes.has(t))[Symbol.iterator]()}entries(){let e=[];for(let t=0;t<this.data.length;t++){let r=this._getKeyByStorageIndex(t);-1!==r&&void 0!==this.data[t]&&e.push([r,this.data[t]])}let t=0;return{next:()=>{if(t<e.length){let r=e[t];return t+=1,{value:r,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 d(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let g=["data","width"];class p{constructor(e){d(this,"globalMeta",void 0),d(this,"metas",new c(()=>this._createMeta())),this.globalMeta=e,this.metas=new c(()=>this._createMeta())}updateMeta(e,t){let r=this.getMeta(e);(0,i.extend)(r,t),(0,n.oD)(r,t)}createColumn(e,t){this.metas.insert(e,t)}
5removeColumn(e,t){this.metas.remove(e,t)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return(0,n.I7)(this.globalMeta.getMetaConstructor(),g).prototype}}var f=r(21927);function m(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class y{constructor(e){m(this,"columnMeta",void 0),m(this,"metas",new c(()=>this._createRow())),this.columnMeta=e}updateMeta(e,t,r){let o=this.getMeta(e,t);(0,i.extend)(o,r),(0,n.oD)(o,r)}createRow(e,t){this.metas.insert(e,t)}createColumn(e,t){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).insert(e,t)}removeRow(e,t){this.metas.remove(e,t)}removeColumn(e,t){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).remove(e,t)}getMeta(e,t,r){let i=this.metas.obtain(e).obtain(t);return void 0===r?i:i[r]}setMeta(e,t,r,i){var n;let o=this.metas.obtain(e).obtain(t);null===(n=o._automaticallyAssignedMetaProps)||void 0===n||n.delete(r),o[r]=i}removeMeta(e,t,r){let i=this.metas.obtain(e).obtain(t);delete i[r]}getMetas(){let e=[],t=Array.from(this.metas.values());for(let r=0;r<t.length;r++)(0,f.isDefined)(t[r])&&e.push(...t[r].values());return e}getMetasAtRow(e){(0,n.hu)(()=>(0,h.isUnsignedNumber)(e),"Expecting an unsigned number.");let t=new Map(this.metas);return t.has(e)?Array.from(t.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new c(e=>this._createMeta(e))}_createMeta(e){return new(this.columnMeta.getMetaConstructor(e))}}var w=r(65166);class E{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.hot=e,this.globalMeta=new a(e),this.tableMeta=new l(this.globalMeta),this.columnMeta=new p(this.globalMeta),this.cellMeta=new y(this.columnMeta),r.forEach(e=>new e(this)),this.globalMeta.updateMeta(t)}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,t){this.columnMeta.updateMeta(e,t)}getCellMeta(e,t,r){let i=this.cellMeta.getMeta(e,t);return i.visualRow=r.visualRow,i.visualCol=r.visualColumn,i.row=e,i.col=t,r.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,t,r){if("string"!=typeof r)throw Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,t,r)}setCellMeta(e,t,r,i){this.cellMeta.setMeta(e,t,r,i)}updateCellMeta(e,t,r){this.cellMeta.updateMeta(e,t,r)}removeCellMeta(e,t,r){this.cellMeta.removeMeta(e,t,r)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.createRow(e,t)}removeRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.removeRow(e,t)}createColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.createColumn(e,t),this.columnMeta.createColumn(e,t)}removeColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.removeColumn(e,t),this.columnMeta.removeColumn(e,t)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}(0,i.mixin)(E,w.Z)},96414:function(e,t,r){"use strict";r.d(t,{$:function(){return a}}),r(76346),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975);var i=r(41965),n=r(92263),o=r(37710);function s(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a{constructor(e){var t=this;s(this,"metaManager",void 0),s(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return t.extendCellMeta(...arguments)}),i.P.getSingleton().add("beforeRender",e=>{e&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var t,r;let{row:i,col:s}=e;if(null!==(t=this.metaSyncMemo.get(i))&&void 0!==t&&t.has(s))return;let{visualRow:a,visualCol:l}=e,h=this.metaManager.hot,u=h.colToProp(l);e.prop=u,h.runHooks("beforeGetCellMeta",a,l,e);let c=(0,n.hasOwnProperty)(e,"type")?e.type:null,d=(0,o.isFunction)(e.cells)?e.cells(i,s,u):null;c&&(d?d.type=null!==(r=d.type)&&void 0!==r?r:c:d={type:c}),d&&this.metaManager.updateCellMeta(i,s,d),h.runHooks("afterGetCellMeta",a,l,e),this.metaSyncMemo.has(i)||this.metaSyncMemo.set(i,new Set),this.metaSyncMemo.get(i).add(s)}}},7006:function(e,t,r){"use strict";function i(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{_:function(){return o}}),r(76346),r(65230),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975),r(70470),r(95984);var n=new WeakMap;class o{constructor(e){var t;i(this,"metaManager",void 0),i(this,"usageTracker",new Set),i(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(e){if(this.metaManager.hot.isRtl()&&"fixedColumnsLeft"===e)throw Error("The `fixedColumnsLeft` is not supported for RT
5L. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw 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}]])),t=(e,t,r)=>{if(!r)throw Error(`The \`${e}\` option can not be updated after the Handsontable is initialized.`)},function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,n),n.set(this,t),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,t)=>{let{initOnly:r,target:i,onChange:o}=e,s="string"==typeof i,a=s?i:t,l=`_${a}`;(this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],o)?(this.installPropWatcher(t,l,o),s&&this.installPropWatcher(i,l,o)):r&&(this.installPropWatcher(t,l,n.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}(n,this))),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(t))})}installPropWatcher(e,t,r){let i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[t]},set(n){let o=!i.usageTracker.has(e);i.usageTracker.add(e),r.call(i,e,n,o),this[t]=n},enumerable:!0,configurable:!0})}}},87239:function(e,t,r){"use strict";r.d(t,{I7:function(){return s},Rw:function(){return l},hu:function(){return a},oD:function(){return o}}),r(76346),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975);var i=r(92263),n=r(26212);function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,o="string"==typeof t.type?(0,n.DA)(t.type):t.type;if(e._automaticallyAssignedMetaProps&&(0,i.objectEach)(t,(t,r)=>void e._automaticallyAssignedMetaProps.delete(r)),!(0,i.isObject)(o))return;r!==e||e._automaticallyAssignedMetaProps||(e._automaticallyAssignedMetaProps=new Set);let s={};(0,i.objectEach)(o,(t,n)=>{var o,a;"CELL_TYPE"!==n&&((null===(o=r._automaticallyAssignedMetaProps)||void 0===o?void 0:o.has(n))||!(0,i.hasOwnProperty)(r,n))&&(s[n]=t,null===(a=e._automaticallyAssignedMetaProps)||void 0===a||a.add(n))}),(0,i.extend)(e,s)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];function r(){}(0,i.inherit)(r,e);for(let e=0;e<t.length;e++)r.prototype[t[e]]=void 0;return r}function a(e,t){if(!e())throw Error(`Assertion failed: ${t}`)}function l(e){return null==e}},45598:function(e,t,r){"use strict";r.d(t,{o:function(){return m}}),r(76346),r(65230);var i=r(60049),n=r(37710);r(70470),r(52419),r(95984);var o=r(28744),s=r(24697),a=r(92263),l=r(22386),h=r(47771),u=r(21927),c=r(73888);function d(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class g{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,t,r){d(this,"hot",void 0),d(this,"metaManager",void 0),d(this,"tableMeta",void 0),d(this,"dataSource",void 0),d(this,"duckSchema",void 0),d(this,"colToPropCache",void 0),d(this,"propToColCache",void 0),this.hot=e,this.metaManager=r,this.tableMeta=r.getTableMeta(),this.dataSource=t,this.refreshDuckSchema(),this.createMap()}createMap(){let e;let t=this.getSchema();if(void 0===t)throw Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");let r=this.tableMeta.columns;if(this.colToPropCache=[],this.propToColCache=new Map,r){let i=0,n=0,o=!1;if("function"==typeof r){let e=(0,a.deepObjectSize)(t);i=e>0?e:this.countFirstRowKeys(),o=!0}else i=Math.min(this.tableMeta.maxCols,r.length);for(e=0;e<i;
5e++){let t=o?r(e):r[e];if((0,a.isObject)(t)){if(void 0!==t.data){let r=o?n:e;this.colToPropCache[r]=t.data,this.propToColCache.set(t.data,r)}n+=1}}}else this.recursiveDuckColumns(t)}countFirstRowKeys(){return(0,s.countFirstRowKeys)(this.dataSource)}recursiveDuckColumns(e,t,r){let i,n=t,o=r;return void 0===n&&(n=0,o=""),"object"!=typeof e||Array.isArray(e)||(0,a.objectEach)(e,(e,t)=>{null===e?(i=o+t,this.colToPropCache.push(i),this.propToColCache.set(i,n),n+=1):n=this.recursiveDuckColumns(e,n,`${t}.`)}),n}colToProp(e){if(!1===Number.isInteger(e))return e;let t=this.hot.toPhysicalColumn(e);return null===t?e:this.colToPropCache&&(0,u.isDefined)(this.colToPropCache[t])?this.colToPropCache[t]:t}propToCol(e){let t=this.propToColCache.get(e);if((0,u.isDefined)(t))return this.hot.toVisualColumn(t);let r=this.hot.toVisualColumn(e);return null===r?e:r}getSchema(){let e=this.tableMeta.dataSchema;return e?"function"==typeof e?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?(0,a.duckSchema)(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{source:r,mode:i="above"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.hot.countSourceRows(),o=n,s=0,l=e;if(("number"!=typeof l||l>=n)&&(l=n),l<this.hot.countRows()&&(o=this.hot.toPhysicalRow(l)),!1===this.hot.runHooks("beforeCreateRow",l,t,r)||null===o)return{delta:0};let u=this.tableMeta.maxRows,c=this.getSchema().length,d=[];for(;s<t&&n+s<u;){let e=null;"array"===this.hot.dataType?this.tableMeta.dataSchema?e=(0,a.deepClone)(this.getSchema()):(e=[],(0,h.rangeEach)(c-1,()=>e.push(null))):"function"===this.hot.dataType?e=this.tableMeta.dataSchema(l+s):(e={},(0,a.deepExtend)(e,this.getSchema())),d.push(e),s+=1}this.hot.rowIndexMapper.insertIndexes(l,s),"below"===i&&(o=Math.min(o+1,n)),this.spliceData(o,0,d);let g=this.hot.toVisualRow(o);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),s>0&&(null==e?this.metaManager.createRow(null,s):"auto"!==r&&this.metaManager.createRow(o,t)),this.hot.runHooks("afterCreateRow",g,s,r),{delta:s,startPhysicalIndex:o}}createCol(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{source:r,mode:i="start"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw 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.");let n=this.dataSource,o=this.tableMeta.maxCols,s=this.hot.countSourceCols(),a=this.hot.countCols(),l=this.hot.countSourceRows(),h="number"==typeof e&&e<=s?e:a;if(!1===this.hot.runHooks("beforeCreateCol",h,t,r))return{delta:0};let u=h<a?this.hot.toPhysicalColumn(h):s,c="end"===i?Math.min(u+1,s):u,d=0;for(let e=c;d<t&&a+d<o;e++){if("number"!=typeof h||h>=a+d){if(l>0)for(let e=0;e<l;e+=1)void 0===n[e]&&(n[e]=[]),n[e].push(null);else n.push([null])}else for(let t=0;t<l;t++)n[t].splice(e,0,null);d+=1}return d>0&&(null==e?this.metaManager.createColumn(null,d):"auto"!==r&&this.metaManager.createColumn(c,t)),this.hot.columnIndexMapper.insertIndexes(h,d,i),this.hot.runHooks("afterCreateCol",this.hot.toVisualColumn(c),d,r),this.refreshDuckSchema(),{delta:d,startPhysicalIndex:c}}removeRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-t,n=this.visualRowsToPhysical(i,t),o=this.hot.countSourceRows();if(i=(o+i)%o,!1===this.hot.runHooks("beforeRemoveRow",i,n.length,n,r))return!1;let s=n.length;if(this.filterData(i,s,n),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(n);let e=(0,u.isDefined)(this.tableMeta.columns)||(0,u.isDefined)(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;0!==this.hot.rowIndexMapper.getNotTrimmedIndexesLength()||e||this.hot.columnIndexMapper.setIndexesSequence([])}return n.slice(0).sort((e,t)=>
5t-e).forEach(e=>{this.metaManager.removeRow(e,1)}),this.hot.runHooks("afterRemoveRow",i,s,n,r),!0}removeCol(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if("object"===this.hot.dataType||this.tableMeta.columns)throw Error("cannot remove column with object data source or columns option specified");let i="number"!=typeof e?-t:e;i=(this.hot.countCols()+i)%this.hot.countCols();let n=this.visualColumnsToPhysical(i,t),o=n.slice(0).sort((e,t)=>t-e);if(!1===this.hot.runHooks("beforeRemoveCol",i,t,n,r))return!1;let s=!0,a=o.length,l=this.dataSource;for(let e=0;e<a;e++)s&&n[0]!==n[e]-e&&(s=!1);if(s)for(let e=0,r=this.hot.countSourceRows();e<r;e++)l[e].splice(n[0],t),0===e&&this.metaManager.removeColumn(n[0],t);else for(let e=0,t=this.hot.countSourceRows();e<t;e++)for(let t=0;t<a;t++)l[e].splice(o[t],1),0===e&&this.metaManager.removeColumn(o[t],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(n),this.tableMeta.rowHeaders||0!==this.hot.columnIndexMapper.getNotTrimmedIndexesLength()||this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,t,n,r),this.refreshDuckSchema(),!0}spliceCol(e,t,r){let i=this.hot.getDataAtCol(e),n=i.slice(t,t+r),o=i.slice(t+r);for(var s=arguments.length,a=Array(s>3?s-3:0),h=3;h<s;h++)a[h-3]=arguments[h];(0,l.extendArray)(a,o);let u=0;for(;u<r;)a.push(null),u+=1;return(0,l.to2dArray)(a),this.hot.populateFromArray(t,e,a,null,null,"spliceCol"),n}spliceRow(e,t,r){let i=this.hot.getSourceDataAtRow(e),n=i.slice(t,t+r),o=i.slice(t+r);for(var s=arguments.length,a=Array(s>3?s-3:0),h=3;h<s;h++)a[h-3]=arguments[h];(0,l.extendArray)(a,o);let u=0;for(;u<r;)a.push(null),u+=1;return this.hot.populateFromArray(e,t,[a],null,null,"spliceRow"),n}spliceData(e,t,r){if(!1!==this.hot.runHooks("beforeDataSplice",e,t,r)){let t=[...this.dataSource.slice(0,e),...r,...this.dataSource.slice(e)];this.dataSource.length=0,t.forEach(e=>this.dataSource.push(e))}}filterData(e,t,r){let i=this.hot.runHooks("filterData",e,t,r);!1===Array.isArray(i)&&(i=this.dataSource.filter((e,t)=>-1===r.indexOf(t))),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,t){let r=this.hot.toPhysicalRow(e),i=this.dataSource[r],n=this.hot.runHooks("modifyRowData",r);i=isNaN(n)?n:i;let{dataDotNotation:o}=this.hot.getSettings(),s=null;if(i&&i.hasOwnProperty&&(0,a.hasOwnProperty)(i,t))s=i[t];else if(o&&"string"==typeof t&&t.indexOf(".")>-1){let e=i;if(!e)return null;let r=t.split(".");for(let t=0,i=r.length;t<i;t++)if(void 0===(e=e[r[t]]))return null;s=e}else"function"==typeof t&&(s=t(this.dataSource.slice(r,r+1)[0]));let l=this.propToCol(t),u=this.hot.toPhysicalColumn(l);if((0,h.isUnsignedNumber)(r)&&(0,h.isUnsignedNumber)(u)&&(s=(0,c.l)(s,this.metaManager.getCellMeta(r,u,{visualRow:e,visualColumn:l,skipMetaExtension:!0}))),this.hot.hasHook("modifyData")){let t=(0,a.createObjectPropListener)(s);this.hot.runHooks("modifyData",e,l,t,"get"),t.isTouched()&&(s=t.value)}return s}getCopyable(e,t){return this.hot.getCellMeta(e,this.propToCol(t)).copyable?this.get(e,t):""}set(e,t,r){let i=this.hot.toPhysicalRow(e),n=r,o=this.dataSource[i],s=this.hot.runHooks("modifyRowData",i);if(o=isNaN(s)?s:o,this.hot.hasHook("modifyData")){let r=(0,a.createObjectPropListener)(n);this.hot.runHooks("modifyData",e,this.propToCol(t),r,"set"),r.isTouched()&&(n=r.value)}let{dataDotNotation:l}=this.hot.getSettings();if(o&&o.hasOwnProperty&&(0,a.hasOwnProperty)(o,t))o[t]=n;else if(l&&"string"==typeof t&&t.indexOf(".")>-1){let e,r=o,i=0,s=t.split(".");for(i=0,e=s.length-1;i<e;i++){if("__proto__"===s[i]||"constructor"===s[i]||"prototype"===s[i])return;void 0===r[s[i]]&&(r[s[i]]={}),r=r[s[i]]}r[s[i]]=n}else if("function"==typeof t)t(this.dataSource.slice(i,i+1)[0],n);else{if("__proto__"===t||"constructor"===t||"prototype"===t)return;o[t]=n}}visualRowsToPhysical(e,t){let r=this.hot.countSourceRows(),i=[],n=(r+e)%r,o=t;for(;n<r&&o;)i.push(this.hot.toPhysicalRow(n)),o-=1,n+=1;return i}visualColumnsToPhysical(e,t){let r=this.hot.countCols(),i=[],n=(r+e)%r,o=t;for(;n<r&&o;){let e=this.hot.toPhysicalColumn(n);i.push(e),o-=1,n+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let t=0;t<this.hot.countCols();t++)this.set(e,this.colToProp(t),"")}getLength(){let e;let t=this.tableMeta.maxRows;return e=t<0||0===t?0:t||1/0,Math.min(this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),e)}getAll(){let e={row:0,col:0}
5,t={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-t.row!=0||this.hot.countSourceRows()?this.getRange(e,t,g.DESTINATION_RENDERER):[]}countCachedColumns(){return this.colToPropCache.length}getRange(e,t,r){let i,n,o;let s=[],a=this.tableMeta.maxRows,l=this.tableMeta.maxCols;if(0===a||0===l)return[];let h=r===g.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,u=Math.min(Math.max(a-1,0),Math.max(e.row,t.row)),c=Math.min(Math.max(l-1,0),Math.max(e.col,t.col));for(i=Math.min(e.row,t.row);i<=u;i++){o=[];let r=i>=0?this.hot.toPhysicalRow(i):i;for(n=Math.min(e.col,t.col);n<=c&&null!==r;n++)o.push(h.call(this,i,this.colToProp(n)));null!==r&&s.push(o)}return s}getText(e,t){return(0,o.P)(this.getRange(e,t,g.DESTINATION_RENDERER))}getCopyableText(e,t){return(0,o.P)(this.getRange(e,t,g.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}}var p=r(46879),f=r(65839);function m(e,t,r,o){let{hotInstance:s,dataMap:l,dataSource:h,internalSource:u,source:c,metaManager:d,firstRun:m}=o,y=(0,i.toUpperCaseFirst)(u),w=s.getSettings();Array.isArray(w.dataSchema)?s.dataType="array":(0,n.isFunction)(w.dataSchema)?s.dataType="function":s.dataType="object",l&&l.destroy(),e=s.runHooks(`before${y}`,e,m,c);let E=new g(s,e,d);if(t(E),"object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else if(null===e){let t;let r=E.getSchema();e=[];let i=0,n=0;for(i=0,n=w.startRows;i<n;i++)if(("object"===s.dataType||"function"===s.dataType)&&w.dataSchema)t=(0,a.deepClone)(r),e.push(t);else if("array"===s.dataType)t=(0,a.deepClone)(r[0]),e.push(t);else{t=[];for(let e=0,r=w.startCols;e<r;e++)t.push(null);e.push(t)}}else throw Error(`${u} only accepts array of objects or array of arrays (${typeof e} given)`);Array.isArray(e[0])&&(s.dataType="array"),w.data=e,E.dataSource=e,h.data=e,h.dataType=s.dataType,h.colToProp=E.colToProp.bind(E),h.propToCol=E.propToCol.bind(E),h.countCachedColumns=E.countCachedColumns.bind(E),r(E),s.runHooks(`after${y}`,e,m,c),m||(s.runHooks("afterChange",null,u),s.view.adjustElementsSize(),s.render()),s.getSettings().ariaTags&&(0,p.setAttribute)(s.rootElement,[(0,f.a2)(-1),(0,f.Wv)(s.countCols()+(s.view?s.countRowHeaders():0))])}},18345:function(e,t,r){"use strict";r(76346);var i=r(79341),n=r(9190),o=r(65187),s=r(77882);function a(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var h=new WeakSet;class u{constructor(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(this,h),h.add(this),a(this,"hot",void 0),a(this,"tableMeta",void 0),a(this,"selection",void 0),a(this,"eventManager",void 0),a(this,"destroyed",!1),a(this,"activeEditor",void 0),a(this,"cellProperties",void 0),this.hot=e,this.tableMeta=t,this.selection=r,this.eventManager=new s.Z(e),this.hot.addHook("afterDocumentKeyDown",e=>l(h,this,c).call(this,e)),this.hot.addHook("beforeCompositionStart",e=>l(h,this,c).call(this,e)),this.hot.view._wt.update("onCellDblClick",(e,t,r)=>l(h,this,d).call(this,e,t,r))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,e=>{e&&this.prepareEditor()});return}let t=null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight;if(!t||t.isHeader())return;let{row:r,col:i}=t,n=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta"),s=r,a=i;if(Array.isArray(n)&&([s,a]=n),this.cellProperties=this.hot.getCellMeta(s,a),!this.isCellEditable()){this.clearActiveEditor();return}let l=this.hot.getCell(r,i,!0);if(l){let e=this.hot.getCellEditor(this.cellProperties),t=this.hot.colToProp(a),n=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),a);this.activeEditor=(0,o.Jq)(e,this.hot),this.activeEditor.prepare(r,i,t,l,n,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.isCellEditable()){this.clearActiveEditor();return}let i=this.hot.getSelectedRangeActive(),n=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,t,r);if(t instanceof MouseEvent&&"boolean"!=typeof n&&(n=0===this.hot.selection.getLayerLevel()&&i.isSingle()),!1===n){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(r&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,t))}closeEditor(e,t,r){this.activeEditor?this.activeEditor.finishEditing(e,t,r):r&&r(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){let e=this.hot.getSelectedRangeActive();if(!e)return!1;let t=this.hot.getCellEditor(this.cellProperties),{row:r,col:i}=e.highlight,{rowIndexMapper:n,columnIndexMapper:o}=this.hot,s=n.isHidden(this.hot.toPhysicalRow(r))||o.isHidden(this.hot.toPhysicalColumn(i));return!this.cellProperties.readOnly&&!!t&&!s}moveSelectionAfterEnter(e){let t={..."function"==typeof this.tableMeta.enterMoves?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(t.row=-t.row,t.col=-t.col),this.hot.selection.isMultiple()?this.selection.transformFocus(t.row,t.col):this.selection.transformStart(t.row,t.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function c(e){let t=this.hot.getSelectedRangeActive();if(!this.hot.isListening()||!t||t.highlight.isHeader()||(0,n.isImmediatePropagationStopped)(e))return;let{keyCode:r}=e,o=(e.ctrlKey||e.metaKey)&&!e.altKey;this.activeEditor&&(!this.activeEditor||this.activeEditor.isWaiting(
5))||(0,i.isFunctionKey)(r)||(0,i.isCtrlMetaKey)(r)||o||this.isEditorOpened()||this.openEditor("",e)}function d(e,t){t.isCell()&&(this.hot.getShortcutManager().isCtrlPressed()?this.clearActiveEditor():this.openEditor(null,e,!0))}let g=new WeakMap;u.getInstance=function(e,t,r){let i=g.get(e);return i||(i=new u(e,t,r),g.set(e,i)),i},t.Z=u},43488:function(e,t,r){"use strict";r.d(t,{Hf:function(){return u},ed:function(){return h}}),r(76346);var i=r(21927),n=r(92263);r(65230);var o=r(22386);let s={_hooksStorage:Object.create(null),addHook(e,t){return this._hooksStorage[e]||(this._hooksStorage[e]=[]),this.hot.addHook(e,t),this._hooksStorage[e].push(t),this},removeHooksByKey(e){(0,o.arrayEach)(this._hooksStorage[e]||[],t=>{this.hot.removeHook(e,t)})},clearHooks(){(0,n.objectEach)(this._hooksStorage,(e,t)=>this.removeHooksByKey(t)),this._hooksStorage={}}};(0,n.defineGetter)(s,"MIXIN_NAME","hooksRefRegisterer",{writable:!1,enumerable:!1});var a=r(46879);function l(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let h=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class u{static get EDITOR_TYPE(){return"base"}constructor(e){l(this,"hot",void 0),l(this,"state",h.VIRGIN),l(this,"_opened",!1),l(this,"_fullEditMode",!1),l(this,"_closeCallback",null),l(this,"TD",null),l(this,"row",null),l(this,"col",null),l(this,"prop",null),l(this,"originalValue",null),l(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,t,r,i,n,o){this.TD=i,this.row=e,this.col=t,this.prop=r,this.originalValue=n,this.cellProperties=o,this.state=this.isOpened()?this.state:h.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,t){let r,i,n,o;if(t){let e=this.hot.getSelectedRangeActive(),t=e.getTopStartCorner(),s=e.getBottomEndCorner();r=t.row,i=t.col,n=s.row,o=s.col}else[r,i,n,o]=[this.row,this.col,null,null];let s=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");Array.isArray(s)&&([r,i]=s),this.hot.populateFromArray(r,i,e,n,o,"edit")}beginEditing(e,t){if(this.state!==h.VIRGIN)return;let r=this.hot,n=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=h.EDITING,this.isInFullEditMode()){let t=this.cellProperties.valueGetter?this.cellProperties.valueGetter(this.originalValue):this.originalValue,r="string"==typeof e?e:(0,i.stringify)(t);this.setValue(r)}this.open(t),this._opened=!0,this.focus(),r.view.render(),r.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",s),r.view.scrollViewport(r._createCellCoords(n,o))||(this.hot.removeHook("afterScroll",s),s()),this.addHook("beforeDialogShow",()=>this.cancelChanges())}finishEditing(e,t,r){let i;if(r){let e=this._closeCallback;this._closeCallback=t=>{e&&e(t),r(t),this.hot.view.render()}}
5if(!this.isWaiting()){if(this.state===h.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===h.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}let r=this.getValue();i=this.cellProperties.trimWhitespace?[["string"==typeof r?String.prototype.trim.call(r||""):r]]:[[r]],this.state=h.WAITING,this.saveValue(i,t),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",e=>{this.state=h.FINISHED,this.discardEditor(e)}):(this.state=h.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=h.FINISHED,this.discardEditor()}discardEditor(e){this.state===h.FINISHED&&(!1===e&&!0!==this.cellProperties.allowInvalid?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=h.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=h.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===h.WAITING}getEditedCellRect(){var e;let t=this.getEditedCell();if(!t)return;let{wtOverlays:r,wtViewport:i}=this.hot.view._wt,n=this.hot.rootWindow,o=(0,a.offset)(t),s=(0,a.outerWidth)(t),l=(0,a.offset)(this.hot.rootElement),h=(0,a.outerWidth)(this.hot.rootElement),u=r.topOverlay.holder,c=r.inlineStartOverlay.holder,d=u!==n?u.scrollTop:0,g=c!==n?c.scrollLeft:0,p=n.innerWidth-l.left-h,{wtTable:f}=null!==(e=r.getParentOverlay(t))&&void 0!==e?e:this.hot.view._wt,m=f.name,y=["master","inline_start"].includes(m)?d:0,w=["master","top","bottom"].includes(m)?g:0,E=o.top===l.top?0:1,S=o.top-l.top-E-y,C=0;C=this.hot.isRtl()?n.innerWidth-o.left-s-p-1+w:o.left-l.left-1-w,["top","top_inline_start_corner"].includes(m)&&(S+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(m)&&(C+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));let R=this.hot.hasColHeaders(),b=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),T=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),N=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(R&&b<=0||b===N)&&(S+=1),T<=0&&(C+=1);let A=i.rowsRenderCalculator.startPosition,I=i.columnsRenderCalculator.startPosition,M=Math.abs(r.inlineStartOverlay.getScrollPosition()),O=r.topOverlay.getScrollPosition(),x=(0,a.getScrollbarWidth)(this.hot.rootDocument),_=t.offsetTop;if(["inline_start","master"].includes(m)&&(_+=A-O),["bottom","bottom_inline_start_corner"].includes(m)){let{wtViewport:e,wtTable:t}=r.bottomOverlay.clone;_+=e.getWorkspaceHeight()-t.getHeight()-x}let P=t.offsetLeft;this.hot.isRtl()?P=(P>=0?f.getWidth()-t.offsetLeft:Math.abs(P))+(I-M-s):["top","master","bottom"].includes(m)&&(P+=I-M);let L=n.getComputedStyle(this.TD),k=parseInt(L[this.hot.isRtl()?"borderRightWidth":"borderLeftWidth"],10)>0?0:1,D=parseInt(L.borderTopWidth,10)>0?0:1,H=(0,a.outerWidth)(t)+k,B=(0,a.outerHeight)(t)+D,F=(0,a.hasVerticalScrollbar)(u)?x:0,V=(0,a.hasHorizontalScrollbar)(c)?x:0,U=this.hot.view.maximumVisibleElementWidth(P)-F+k;return{top:S,start:C,height:B,maxHeight:Math.max(this.hot.view.maximumVisibleElementHeight(_)-V+D,this.hot.stylesHandler.getDefaultRowHeight()),width:H,maxWidth:U}}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(){let e=this.hot.countRows(),t="";return this.row<this.hot.getSettings().fixedRowsTop?t=this.col<this.hot.getSettings().fixedColumnsStart?"top-inline-start-corner":"top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?t=this.col<this.hot.getSettings().fixedColumnsStart?"bottom-inline-start-corner":"bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(t="inline-start"),t}}(0,n.mixin)(u,s)},65187:function(e,t,r){"use strict";r.d(t,{Jq:function(){return d},Wu:function(){return l},_f:function(){return h},qm:function(){return p},y$:function(){return g}}),r(76346);var i=r(41965),n=r(14216);let o=new WeakMap,{register:s,getItem:a,hasItem:l,getNames:h,getValues:u}=(0,n.Qv)("editors");function c(e){let t={};this.getConstructor=function(){return e},this.getInstance=function(r){return r.guid in t||(t[r.guid]=new e(r)),t[r.guid]},i.P.getSingleton().add("afterDestroy",function(){t[this.guid]=null})}function d(e,t){let r;if("function"==typeof e)o.get(e)||p(null,e),r=o.get(e);else if("string"==typeof e)r=a(e);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!r)throw Error(`No editor registered under name "${e}"`);return r.getInstance(t)}function g(e){if("function"==typeof e)return e;if(!l(e))throw Error(`No registered editor found under "${e}" name`);return a(e).getConstructor()}function p(e,t){e&&"string"!=typeof e&&(e=(t=e).EDITOR_TYPE);let r=new c(t);"string"==typeof e&&s(e,r),o.set(t,r)}},58805:function(e,t,r){"use strict";r.d(t,{H:function(){return f}}),r(76346);var i=r(43488),n=r(77882),o=r(66327),s=r(46879),a=r(47771),l=r(9211),h=r(21927);function u(e,t){let r=(0,s.getCaretPosition)(t),i=t.value.split("\n"),n=r,o=0;for(let t=0;t<i.length;t++){let s=i[t];0!==t&&(o+=i[t-1].length+1);let a=o+s.length;if("home"===e?n=o:"end"===e&&(n=a),r<=a)break}(0,s.setCaretPosition)(t,n)}var c=r(65839);function d(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let g="ht_editor_hidden",p="textEditor";class f extends i.Hf{static get EDITOR_TYPE(){return"text"}constructor(e){super(e),d(this,"eventManager",new n.Z(this)),d(this,"autoResize",(0,l.x)(this.hot.rootDocument)),d(this,"TEXTAREA",void 0),d(this,"textareaStyle",void 0),d(this,"TEXTAREA_PARENT",void 0),d(this,"textareaParentStyle",void 0),d(this,"layerClass",void 0),this.eventManager=new n.Z(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this._opened=!0,this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.autoResize.unObserve(),(0,s.isInternalElement)(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,t,r,n,o,s){let a=this.state;if(super.prepare(e,t,r,n,o,s),!s.readOnly){this.refreshDimensions(!0);let{allowInvalid:e}=s;e&&!this.isOpened()&&(this.TEXTAREA.value=""),a===i.ed.FINISHED||this.isOpened()||this.hideEditableElement()}}beginEditing(e,t){this.state===i.ed.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,t))}focus(){this.TEXTAREA.select(),(0,s.setCaretPosition)(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){let{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),(0,s.setAttribute)(this.TEXTAREA,[["data-hot-input",""],(0,c.Qk)(-1)]),(0,s.addClass)(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"),(0,s.addClass)(this.TEXTAREA_PARENT,"handsontableInputHolder"),(0,s.hasClass)(this.TEXTAREA_PARENT,this.layerClass)&&(0,s.removeClass)(this.TEXTAREA_PARENT,this.layerClass),(0,s.addClass)(this.TEXTAREA_PARENT,g),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){(0,o.isEdge)()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",(0,s.removeClass)(this.TEXTAREA_PARENT,this.layerClass),(0,s.addClass)(this.TEXTAREA_PARENT,g)}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="";let e=this.TEXTAREA_PARENT.childNodes,t=!1;(0,a.rangeEach)(e.length-1,r=>{let i=e[r];if((0,s.hasClass)(i,"handsontableEditor"))return t=!0,!1}),(0,s.hasClass)(this.TEXTAREA_PARENT,g)&&(0,s.removeClass)(this.TEXTAREA_PARENT,g),t?this.layerClass="ht_editor_visible":this.layerClass=this.getEditedCellsLayerClass(),(0,s.addClass)(this.TEXTAREA_PARENT,this.layerClass)}refreshValue(){let e=this.hot.toPhysicalRow(this.row),t=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=t,this.setValue(t),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.state!==i.ed.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}let{top:t,start:r,width:n,maxWidth:o,height:s,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${t}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${r}px`,this.showEditableElement();let 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(n,o),minHeight:Math.min(s,a),maxWidth:o,maxHeight:a},!0)}bindEvents(){(0,o.isIOS)()&&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===i.ed.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===i.ed.EDITING&&this.focus()})}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){let e=this.hot.getShortcutManager().getContext("editor"),t=()=>{this.hot.rootDocument.execCommand("insertText",!1,"\n")};e.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(t(),!1),runOnlyIf:e=>!this.hot.selection.isMultiple()&&!e.altKey},{keys:[["Meta","Enter"]],callback:()=>(t(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(t(),!1)},{keys:[["Home"]],callback:(e,t)=>{let[r]=t;u(r,this.TEXTAREA)}},{keys:[["End"]],callback:(e,t)=>{let[r]=t;u(r,this.TEXTAREA)}}],{runOnlyIf:()=>(0,h.isDefined)(this.hot.getSelected()),group:p})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(p)}}},77882:function(e,t,r){"use strict";r.d(t,{k:function(){return s}}),r(76346),r(65230);var i=r(9190);let n=0;class o{constructor(){var e,t,r;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t=void 0,(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="context","string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t,this.context=i||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];function s(e){r.call(this,function(e){let t=e.stopImmediatePropagation;return e.stopImmediatePropagation=function(){t.apply(this),(0,i.stopImmediatePropagation)(this)},e}(e))}return this.context.eventListeners.push({element:e,event:t,callback:r,callbackProxy:s,options:o,eventManager:this}),e.addEventListener(t,s,o),n+=1,()=>{this.removeEventListener(e,t,r)}}removeEventListener(e,t,r){let i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=this.context.eventListeners.length;for(;s;)if(s-=1,(i=this.context.eventListeners[s]).event===t&&i.element===e){if(r&&r!==i.callback||o&&i.eventManager!==this)continue;this.context.eventListeners.splice(s,1),i.element.removeEventListener(i.event,i.callbackProxy,i.options),n-=1}}clearEvents(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.context)return;let t=this.context.eventListeners.length;for(;t;){t-=1;let r=this.context.eventListeners[t];e&&r.eventManager!==this||(this.context.eventListeners.splice(t,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options),n-=1)}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,t){let r,i=e.document,n=e;i||(n=(i=e.ownerDocument?e.ownerDocument:e).defaultView);let o={bubbles:!0,cancelable:"mousemove"!==t,view:n,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};i.createEvent?(r=i.createEvent("MouseEvents")).initMouseEvent(t,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,o.relatedTarget||i.body.parentNode):r=i.createEventObject(),e.dispatchEvent?e.dispatchEvent(r):e.fireEvent(`on${t}`,r)}}function s(){return n}t.Z=o},40846:function(e,t,r){"use strict";r.d(t,{Z:function(){return E}}),r(76346);var i=r(26247),n=r(46879),o=r(37710);function s(e,t,r){a(e,t),t.set(e,r)}function a(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function l(e,t){return e.get(u(e,t))}function h(e,t,r){return e.set(u(e,t),r),r}function u(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let c=Object.freeze({CELL:"cell",MIXED:"mixed"});var d=new WeakMap,g=new WeakMap,p=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakMap,w=new WeakSet;class E{constructor(e){a(this,w),w.add(this),s(this,d,void 0),s(this,g,void 0),s(this,p,1),s(this,f,null),s(this,m,new Map),s(this,y,!1),h(d,this,e)}init(){var e=this;h(g,this,l(d,this).getSettings().imeFastEdit?c.MIXED:c.CELL),l(d,this).addHook("afterUpdateSettings",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return u(w,e,N).call(e,...r)}),l(d,this).addHook("afterSelection",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return u(w,e,b).call(e,...r)}),l(d,this).addHook("afterSelectionFocusSet",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return u(w,e,b).call(e,...r)}),l(d,this).addHook("afterSelectionEnd",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return u(w,e,R).call(e,...r)}),l(d,this).addHook("afterRender",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return u(w,e,T).call(e,...r)})}getFocusMode(){return l(g,this)}setFocusMode(e){Object.values(c).includes(e)?h(g,this,e):(0,i.ZK)(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return l(p,this)}setRefocusDelay(e){h(p,this,e)}setRefocusElementGetter(e){h(f,this,e)}getRefocusElement(){var e;return"function"==typeof l(f,this)?l(f,this).call(this):null===(e=l(d,this).getActiveEditor())||void 0===e?void 0:e.TEXTAREA}focusOnHighlightedCell(e){let t=e=>{var t,r;let i=null===(t=l(d,this).getSelectedRangeActive())||void 0===t?void 0:t.highlight;if(!i)return;let o=l(d,this).runHooks("modifyFocusedElement",i.row,i.col,e);(0,n.isHTMLElement)(o)||(o=e),o&&!(null!==(r=l(d,this).getActiveEditor())&&void 0!==r&&r.isOpened())&&o.focus({preventScroll:!0})};e?t(e):u(w,this,S).call(this,e=>t(e))}refocusToEditorTextarea(){var e,t,r;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l(p,this);l(d,this).getSetting
5s().imeFastEdit&&!(null!==(e=l(d,this).getActiveEditor())&&void 0!==e&&e.isOpened())&&(null===(t=l(d,this).getActiveEditor())||void 0===t||null===(r=t.refreshValue)||void 0===r||r.call(t),l(m,this).has(i)||l(m,this).set(i,(0,o.debounce)(()=>{if(!l(d,this).isDestroyed){var e;null===(e=this.getRefocusElement())||void 0===e||e.select()}},i)),l(m,this).get(i)())}}function S(e){var t;let r=null===(t=l(d,this).getSelectedRangeActive())||void 0===t?void 0:t.highlight;if(!r||!l(d,this).selection.isCellVisible(r)){e(null);return}let i=l(d,this).getCell(r.row,r.col,!0);null===i?l(d,this).addHookOnce("afterScroll",()=>{e(l(d,this).getCell(r.row,r.col,!0))}):e(i)}function C(){u(w,this,S).call(this,e=>{let{activeElement:t}=l(d,this).rootDocument;t&&(0,n.isOutsideInput)(t)&&t.blur(),this.focusOnHighlightedCell(e)})}function R(){u(w,this,S).call(this,e=>{this.getFocusMode()===c.MIXED&&(null==e?void 0:e.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function b(){h(y,this,!0)}function T(){l(y,this)&&(h(y,this,!1),u(w,this,C).call(this))}function N(e){"boolean"==typeof e.imeFastEdit&&this.setFocusMode(e.imeFastEdit?c.MIXED:c.CELL)}},85122:function(e,t,r){"use strict";r.d(t,{E:function(){return h}}),r(76346),r(70470),r(52419),r(95984);var i=r(94896),n=r(46879),o=r(65839);let s=Object.freeze({INLINE:"inline",MODAL:"modal"}),a=Object.freeze({UNKNOWN:"unknown",CLICK:"click",TAB_FROM_ABOVE:"tab_from_above",TAB_FROM_BELOW:"tab_from_below"});function l(e,t){let r=e.rootDocument.createElement("input");return r.type="text",r.name="htFocusCatcher",r.classList.add("htFocusCatcher"),r.dataset.htFocusSource=t,e.getSettings().ariaTags&&(0,n.setAttribute)(r,[(0,o.QK)("Focus catcher")]),r}function h(e){let t=(0,i.I)({errorIdExists:e=>`The "${e}" focus scope is already registered.`}),r=e.getShortcutManager(),o=null;function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.UNKNOWN;o!==e&&(null!==o&&u(o),(o=e).activate(t),r.setActiveContextName(e.getShortcutsContextName()))}function u(e){c(),o===e&&(o=null,e.deactivate())}function c(){let r=t.getValues(),i=r.filter(e=>e.runOnlyIf()&&"modal"===e.getType());r.forEach(t=>{i.length>0&&i.includes(t)||0===i.length||t.hasContainerDetached()?t.enable():t.disable(),t===o?t.contains(e.rootDocument.activeElement)?t.deactivateFocusCatchers():t.activateFocusCatchers():t.runOnlyIf()?t.activateFocusCatchers():t.deactivateFocusCatchers()})}function d(r,i){if(!r.isConnected||!(0,n.isVisible)(r))return;let s=t.getValues().filter(e=>e.runOnlyIf()),l=!1;s.forEach(t=>{!l&&t.contains(r)&&(l=!0,i!==a.UNKNOWN&&e.listen(),h(t,i))}),!l&&o&&(u(o),e.unlisten())}let g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!1;function i(e){if(!r){var i;null===(i=t.onFocus)||void 0===i||i.call(t,e)}}function o(e){var r;null===(r=t.onClick)||void 0===r||r.call(t,e)}function s(e){if("Tab"===e.key){var r;null===(r=t.onTabKeyDown)||void 0===r||r.call(t,e)}}function a(){r=!0}function l(){r=!1}return{mount:()=>{let t=e;for(;t;){let{documentElement:e}=t.document;e.addEventListener("focusin",i),e.addEventListener("click",o),e.addEventListener("keydown",s),e.addEventListener("mousedown",a),e.addEventListener("mouseup",l),t=(0,n.getParentWindow)(t)}},unmount:()=>{let t=e;for(;t;){let{documentElement:e}=t.document;e.removeEventListener("focusin",i),e.removeEventListener("click",o),e.removeEventListener("keydown",s),e.removeEventListener("mousedown",a),e.removeEventListener("mouseup",l),t=(0,n.getParentWindow)(t)}}}}(e.rootWindow,{onFocus:e=>{var t;d(e.target,null!==(t=e.target.dataset.htFocusSource)&&void 0!==t?t:a.UNKNOWN)},onClick:e=>{d(e.target,a.CLICK)},onTabKeyDown:()=>{c()}});return g.mount(),{getActiveScopeId:function(){return o?t.getId(o):null},registerScope:function(i,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.hasItem(i))throw Error(`Scope with id "${i}" already registered`);let h=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={shortcutsContextName:"grid",type:s.INLINE,contains:e=>e===t||t.contains(e),runOnlyIf:()=>!0,...r},n=function(e,t){let r=l(e,a.TAB_FROM_ABOVE),i=l(e,a.TAB_FROM_BELOW);return t.prepend(r),t.append(i),{activate(){r.tabIndex=0,i.tabIndex=0},deactivate(){r.tabIndex=-1,i.tabIndex=-1},destroy(){r.remove(),i.remove()}}}(e,t);return{getType:()=>i.type,hasContainerDetached:()=>!e.rootWrapperElement.contains(t),getShortcutsContextName:()=>i.shortcutsContextName,runOnlyIf:()=>i.runOnlyIf(),contains:e=>i.contains(e),activate:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.UNKNOWN;null===(e=i.onActivate)||void 0===e||e.call(i,t)},deactivate:()=>{var e;null===(e=i.onDeactivate)||void 0===e||e.call(i)},activateFocusCatchers:()=>{null==n||n.activate()},deactivateFocusCatchers:()=>{null==n||n.deactivate()},enable:()=>{t.removeAttribute("inert")},disable:()=>{t.setAttribute("inert","true")},destroy:()=>{null==n||n.destroy()}}}(e,n,o);t.addItem(i,h),r.getOrCreateContext(h.getShortcutsContextName())},unregisterScope:function(e){if(!t.hasItem(e))throw Error(`Scope with i
5d "${e}" not found`);t.getItem(e).destroy(),t.removeItem(e)},activateScope:e=>(function(e){if(!t.hasItem(e))throw Error(`Scope with id "${e}" not found`);h(t.getItem(e))})(e),deactivateScope:e=>(function(e){if(!t.hasItem(e))throw Error(`Scope with id "${e}" not found`);u(t.getItem(e))})(e),destroy:()=>g.unmount()}}},14448:function(e,t,r){"use strict";r.d(t,{R:function(){return l}});var i=r(47771);function n(e){let{rowIndexMapper:t,columnIndexMapper:r}=e,{navigableHeaders:i}=e.getSettings(),n=i&&e.countColHeaders()>0?-e.countColHeaders():0,o=i&&e.countRowHeaders()>0?-e.countRowHeaders():0;return(0===n&&(n=t.getVisualFromRenderableIndex(n)),0===o&&(o=r.getVisualFromRenderableIndex(o)),null===n||null===o)?null:e._createCellCoords(n,o)}function o(e){var t,r;let{rowIndexMapper:i,columnIndexMapper:n}=e,{navigableHeaders:o}=e.getSettings(),s=i.getRenderableIndexesLength()-1,a=n.getRenderableIndexesLength()-1;if(s<0){if(!o||0===e.countColHeaders())return null;s=-1}if(a<0){if(!o||0===e.countColHeaders())return null;a=-1}return e._createCellCoords(null!==(t=i.getVisualFromRenderableIndex(s))&&void 0!==t?t:s,null!==(r=n.getVisualFromRenderableIndex(a))&&void 0!==r?r:a)}var s=r(20386);function a(e){var t;let r;let a=t=>{if(!t)return null;let{rowIndexMapper:r,columnIndexMapper:s}=e;if(r.isHidden(t.row)||s.isHidden(t.col))return null;let a=n(e),l=o(e);return null===a||null===l?null:(t.row=(0,i.clamp)(t.row,a.row,l.row),t.col=(0,i.clamp)(t.col,a.col,l.col),t)},l={wrapped:!1,flipped:!1},h=!0,u=!1;e.addHook("afterSelection",()=>{if(h){var t;r=null===(t=e.getSelectedRangeActive())||void 0===t?void 0:t.highlight}}),e.addHook("beforeRowWrap",(e,t,r)=>{l.wrapped=!0,l.flipped=r}),e.addHook("beforeEmptyDataStateShow",()=>{u=!0}),e.addHook("beforeEmptyDataStateHide",()=>{u=!1}),e.getShortcutManager().getContext(s.FP).addShortcuts([{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:s.Wz,group:s.n4,position:"before",callback(){let{tabNavigation:t}=e.getSettings();e.getSelectedRangeActive()&&!t&&(h=!1)}},{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:s.Wz,group:s.n4,callback(t){let{tabNavigation:i,autoWrapRow:s}=e.getSettings();h=!0,(!i||!e.selection.isSelected()||s&&l.wrapped&&l.flipped||!s&&l.wrapped)&&(s&&l.wrapped&&l.flipped&&(r=t.shiftKey?n(e):o(e)),l.wrapped=!1,l.flipped=!1)},position:"after"}]);let c=null!==(t=e.rootGridElement)&&void 0!==t?t:e.rootElement;e.getFocusScopeManager().registerScope("grid",c,{contains:t=>!!(c===t||c.contains(t))||null===t.closest(".htMenu")&&e.rootPortalElement.contains(t),runOnlyIf:()=>{let{navigableHeaders:t}=e.getSettings();return!((u||!t)&&0===e.countRenderedRows()&&0===e.countRenderedCols()&&e.countRowHeaders()>0&&e.countColHeaders()>0)&&(!t&&e.countRenderedRows()>0&&e.countRenderedCols()>0||t&&(e.countRowHeaders()>0||e.countColHeaders()>0))},onActivate:t=>{var i,s;if("tab_from_above"===t){let t=null!==(i=a(r))&&void 0!==i?i:n(e);t&&!1!==e.runHooks("modifyFocusOnTabNavigation","from_above",t)&&e.selectCell(t.row,t.col)}else if("tab_from_below"===t){let t=null!==(s=a(r))&&void 0!==s?s:o(e);t&&!1!==e.runHooks("modifyFocusOnTabNavigation","from_below",t)&&e.selectCell(t.row,t.col)}}})}function l(e){[a].forEach(t=>t(e))}},65839:function(e,t,r){"use strict";r.d(t,{Ak:function(){return U},Ct:function(){return h},DT:function(){return Y},Ez:function(){return $},JV:function(){return D},LI:function(){return A},LO:function(){return f},Ng:function(){return u},Nl:function(){return y},Nr:function(){return b},Pn:function(){return V},Pp:function(){return R},QK:function(){return T},Qk:function(){return i},Qz:function(){return s},Rn:function(){return o},Uo:function(){return E},Up:function(){return z},Wv:function(){return P},a2:function(){return _},a6:function(){return m},cV:function(){return I},d:function(){return j},d5:function(){return L},f3:function(){return c},fv:function(){return x},gw:function(){return M},hm:function(){return a},iJ:function(){return C},iL:function(){return l},jH:function(){return K},kD:function(){return X},l_:function(){return H},nO:function(){return n},nT:function(){return G},qt:function(){return O},rQ:function(){return g},tm:function(){return d},tx:function(){return N},w1:function(){return F},wt:function(){return w},ys:function(){return p},yz:function(){return k},zR:function(){return B},zU:function(){return S},zV:function(){return W}});let i=e=>["tabindex",e],n=()=>["role","treegrid"],o=()=>["role","presentation"],s=()=>["role","gridcell"],a=()=>["role","gridcell button"],l=()=>["role","rowheader"],h=()=>["role","rowgroup"],u=()=>["role","columnheader"],c=()=>["role","row"],d=()=>["role","menu"],g=()=>["role","menuitem"],p=()=>["role","menuitemcheckbox"],f=()=>["role","combobox"],m=()=>["role","listbox"],y=()=>["role","option"],w=()=>["role","checkbox"],E=()=>["role","dialog"],S=()=>["role","alertdialog"],C=()=>["scope","col"],R=()=>["scope","row"],b=()=>["type","text"],T=e=>["aria-label",e],N=e=>["aria-labelledby",e],A=e=>["aria-describedby",e],I=()=>["aria-hidden","true"],M=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return["aria-disabled",e]},O=()=>["aria-multiselectable","true"],x=e=>["aria-haspopup",e],_=e=>["aria-rowcount",e],P=e=>["aria-colcount",e],L=e=>["aria-rowindex",e],k=e=>["aria-colindex",e],D=e=>["aria-expanded",e],H=e=>["aria-sort",e],B=()=>["aria-readonly","true"],F=()=>["aria-invalid","true"],V=e=>["aria-checked",e],U=()=>["aria-selected","true"],W=()=>["aria-autocomplete","list"],j=e=>["aria-controls",e],G=e=>["aria-activedescendant",e],$=e=>["aria-live",e],z=e=>["aria-relevant",e],Y=e=>["aria-setsize",e],K=e=>["aria-posinset",e],X=()=>["aria-modal","true"]},22386:function(e,t,r){"use strict";function i(e){let t=e.length,r=0;for(;r<t;)e[r]=[e[r]],r+=1}function n(e,t){let r=t.length,i=0;for(;i<r;)e.push(t[i]),i+=1}function o(e){let t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;let r=e.length,i=e[0].length;for(let n=0;n<r;n++)for(let r=0;r<i;r++)t[r]||(t[r]=[]),t[r][n]=e[n][r];return t}function s(e,t,r,i){let n=-1,o=e,s=r;Array.isArray(e)||(o=Array.from(e));let a=o.length;for(i&&a&&(n+=1,s=o[n]),n+=1;n<a;)s=t(s,o[n],n,o),n+=1;return s}function a(e,t){let r=0,i=e;Array.isArray(e)||(i=Array.from(e));let n=i.length,o=[],s=-1;for(;r<n;){let e=i[r];t(e,r,i)&&(o[s+=1]=e),r+=1}return o}function l(e,t){let r=0,i=e;Array.isArray(e)||(i=Array.from(e));let n=i.length,o=[],s=-1;for(;r<n;){let e=i[r];o[s+=1]=t(e,r,i),r+=1}return o}function h(e,t){let r=0,i=e;Array.isArray(e)||(i=Array.from(e));let n=i.length;for(;r<n&&!1!==t(i[r],r,i);)r+=1;return e}function u(e){return s(e,(e,t)=>e+t,0)}function c(e){return s(e,(e,t)=>e>t?e:t,Array.isArray(e)?e[0]:void 0)}function d(e){return s(e,(e,t)=>e<t?e:t,Array.isArray(e)?e[0]:void 0)}function g(e){return e.length?u(e)/e.length:0}function p(e){let t=[];return h(e,e=>{-1===t.indexOf(e)&&t.push(e)}),t}function f(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[i,...n]=[...t],o=i;return h(n,e=>{o=o.filter(t=>!e.includes(t))}),o}function m(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[i,...n]=[...t],o=i;return h(n,e=>{o=o.filter(t=>e.includes(t))}),o}function y(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[i,...n]=[...t],o=new Set(i);return h(n,e=>{h(e,e=>{o.has(e)||o.add(e)})}),Array.from(o)}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return e.split(t)}r.r(t),r.d(t,{arrayAvg:function(){return g},arrayEach:function(){return h},arrayFilter:function(){return a},arrayFlatten:function(){return function e(t){return s(t,(t,r)=>t.concat(Array.isArray(r)?e(r):r),[])}},arrayMap:function(){return l},arrayMax:function(){return c},arrayMin:function(){return d},arrayReduce:function(){return s},arraySum:function(){return u},arrayUnique:function(){return p},extendArray:function(){return n},getDifferenceOfArrays:function(){return f},getIntersectionOfArrays:function(){return m},getUnionOfArrays:function(){return y},pivot:function(){return o},stringToArray:function(){return w},to2dArray:function(){return i}}),r(65230),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975),r(70470),r(52419)},66327:function(e,t,r){"use strict";r.r(t),r.d(t,{isChrome:function(){return u},isChromeWebKit:function(){return c},isEdge:function(){return f},isEdgeWebKit:function(){return m},isFirefox:function(){return d},isFirefoxWebKit:function(){return g},isIOS:function(){return w},isIpadOS:function(){return E},isLinuxOS:function(){return R},isMacOS:function(){return C},isMobileBrowser:function(){return y},isSafari:function(){return p},isWindowsOS:function(){return S},setBrowserMeta:function(){return l},setPlatformMeta:function(){return h}});var i=r(92263),n=r(13066);let o=e=>{let t={value:!1};return t.test=(r,i)=>{t.value=e(r,i)},t},s={chrome:o((e,t)=>/Chrome/.test(e)&&/Google/.test(t)),chromeWebKit:o(e=>/CriOS/.test(e)),edge:o(e=>/Edge/.test(e)),edgeWebKit:o(e=>/EdgiOS/.test(e)),firefox:o(e=>/Firefox/.test(e)),firefoxWebKit:o(e=>/FxiOS/.test(e)),mobile:o(e=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)),safari:o((e,t)=>/Safari/.test(e)&&/Apple Computer/.test(t))},a={mac:o(e=>/^Mac/.test(e)),win:o(e=>/^Win/.test(e)),linux:o(e=>/^Linux/.test(e)),ios:o(e=>/iPhone|iPad|iPod/i.test(e))};function l(){let{userAgent:e=navigator.userAgent,vendor:t=navigator.vendor}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.objectEach)(s,r=>{let{test:i}=r;i(e,t)})}function h(){let{platform:e=navigator.platform}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.objectEach)(a,t=>{let{test:r}=t;r(e)})}function u(){return s.chrome.value}function c(){return s.chromeWebKit.value}function d(){return s.firefox.value}function g(){return s.firefoxWebKit.value}function p(){return s.safari.value}function f(){return s.edge.value}function m(){return s.edgeWebKit.value}function y(){return s.mobile.value}function w(){return a.ios.value}function E(){let{maxTouchPoints:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator;return e>2&&a.mac.value}function S(){return a.win.value}function C(){return a.mac.value}function R(){return a.linux.value}(0,n.isCSR)()&&(l(),h())},26247:function(e,t,r){"use strict";r.d(t,{ZK:function(){return n},vF:function(){return o},vU:function(){return s}});var i=r(21927);function n(){(0,i.isDefined)(console)&&console.warn(...arguments)}function o(e){(0,i.isDefined)(console)&&console.warn(`Deprecated: ${e}`)}function s(){(0,i.isDefined)(console)&&console.error(...arguments)}},24697:function(e,t,r){"use strict";r.r(t),r.d(t,{countFirstRowKeys:function(){return d},createEmptySpreadsheetData:function(){return u},createSpreadsheetData:function(){return l},createSpreadsheetObjectData:function(){return h},dataRowToChangesArray:function(){return c},isArrayOfArrays:function(){return g},isArrayOfObjects:function(){return p},spreadsheetColumnIndex:function(){return a},spreadsheetColumnLabel:function(){return s}}),r(65230),r(70470),r(11898),r(95984);var i=r(92263);let n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",o=n.length;function s(e){let t,r=e+1,i="";for(;r>0;)i=String.fromCharCode(65+(t=(r-1)%o))+i,r=parseInt((r-t)/o,10);return i}function a(e){let t=0;if(e)for(let r=0,i=e.length-1;r<e.length;r+=1,i-=1)t+=o**i*(n.indexOf(e[r])+1);return t-1}function l(){let e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[];for(e=0;e<r;e++){let r=[];for(t=0;t<i;t++)r.push(s(t)+(e+1));n.push(r)}return n}function h(){let e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[];for(e=0;e<r;e++){let r={};for(t=0;t<i;t++)r[`prop${t}`]=s(t)+(e+1);n.push(r)}return n}function u(e,t){let r;let i=[];for(let n=0;n<e;n++){r=[];for(let e=0;e<t;e++)r.push("");i.push(r)}return i}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e,i=[];return Array.isArray(e)&&Array.isArray(e[0])||(r=[e]),r.forEach((e,r)=>{Array.isArray(e)?e.forEach((e,n)=>{i.push([r+t,n,e])}):Object.keys(e).forEach(n=>{i.push([r+t,n,e[n]])})}),i}function d(e){let t=0;return Array.isArray(e)&&(e[0]&&Array.isArray(e[0])?t=e[0].length:e[0]&&(0,i.isObject)(e[0])&&(t=(0,i.deepObjectSize)(e[0]))),t}function g(e){return!!(Array.isArray(e)&&e.length&&e.every(e=>Array.isArray(e)))}function p(e){return!!(Array.isArray(e)&&e.length&&e.every(e=>"object"==typeof e&&!Array.isArray(e)&&null!==e))}},56751:function(e,t,r){"use strict";function i(e){let t=new Date(e);return isNaN(new Date(`${e}T00:00`).getDate())?t:new Date(t.getTime()+6e4*t.getTimezoneOffset())}r.r(t),r.d(t,{getNormalizedDate:function(){return i}})},46879:function(e,t,r){"use strict";let i;r.r(t),r.d(t,{HTML_CHARACTERS:function(){return A},addClass:function(){return C},addEvent:function(){return z},clearTextSelection:function(){return Z},closest:function(){return d},closestDown:function(){return g},empty:function(){return N},fastInnerHTML:function(){return I},fastInnerText:function(){return M},findFirstParentWithClass:function(){return p},getCaretPosition:function(){return K},getCssTransform:function(){return en},getFractionalScalingCompensation:function(){return J},getFrameElement:function(){return h},getMaximumScrollLeft:function(){return B},getMaximumScrollTop:function(){return H},getParent:function(){return a},getParentWindow:function(){return u},getScrollLeft:function(){return k},getScrollTop:function(){return L},getScrollableElement:function(){return D},getScrollbarWidth:function(){return ee},getSelectionEndPosition:function(){return X},getSelectionText:function(){return q},getStyle:function(){return V},getTrimmingContainer:function(){return F},getWindowScrollLeft:function(){return P},getWindowScrollTop:function(){return _},hasAccessToParentWindow:function(){return c},hasClass:function(){return S},hasHorizontalScrollbar:function(){return er},hasVerticalScrollbar:function(){return et},hasZeroHeight:function(){return O},index:function(){return m},innerHeight:function(){return G},innerWidth:function(){return $},isChildOf:function(){return f},isDetached:function(){return eh},isHTMLElement:function(){return ep}
5,isInput:function(){return es},isInternalElement:function(){return l},isOutsideInput:function(){return ea},isVisible:function(){return function e(t){let r=t.ownerDocument.documentElement,i=t.ownerDocument.defaultView,n=t;for(;n!==r;){if(null===n)return!1;if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(!n.host)return!1;if(n.host.impl)return e(n.host.impl);if(n.host)return e(n.host);throw Error("Lost in Web Components world")}if("none"===i.getComputedStyle(n).display)return!1;n=n.parentNode}return!0}},makeElementContentEditableAndSelectItsContent:function(){return ec},matchesCSSRules:function(){return U},observeVisibilityChangeOnce:function(){return eu},offset:function(){return x},outerHeight:function(){return j},outerWidth:function(){return W},overlayContainsElement:function(){return y},removeAttribute:function(){return T},removeClass:function(){return R},removeContentEditableFromElementAndDeselect:function(){return ed},removeEvent:function(){return Y},removeTextNodes:function(){return function e(t){if(3===t.nodeType)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){let r=t.childNodes;for(let t=r.length-1;t>=0;t--)e(r[t])}}},resetCssTransform:function(){return eo},runWithSelectedContendEditableElement:function(){return eg},selectElementIfAllowed:function(){return el},setAttribute:function(){return b},setCaretPosition:function(){return Q},setOverlayPosition:function(){return ei}}),r(76346),r(65230),r(70470),r(52419),r(95984);var n=r(60049),o=r(65839),s=r(66327);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=-1,i=null,n=e;for(;null!==n;){if(r===t){i=n;break}n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE?n=n.host:(r+=1,n=n.parentNode)}return i}function l(e,t){let r=e.closest(".handsontable");return!!r&&(r.parentNode===t||r===t)}function h(e){return Object.getPrototypeOf(e.parent)&&e.frameElement}function u(e){return h(e)&&e.parent}function c(e){return!!Object.getPrototypeOf(e.parent)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,{ELEMENT_NODE:i,DOCUMENT_FRAGMENT_NODE:n}=Node,o=e;for(;null!=o&&o!==r;){let{nodeType:e,nodeName:r}=o;if(e===i&&(t.includes(r)||t.includes(o)))return o;let{host:s}=o;o=s&&e===n?s:o.parentNode}return null}function g(e,t,r){let i=[],n=e;for(;n&&(n=d(n,t,r))&&(!r||r.contains(n));)i.push(n),n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE?n=n.host:n=n.parentNode;let o=i.length;return o?i[o-1]:null}function p(e,t){let r={element:void 0,classNames:[]},i=e;for(;null!==i&&i!==e.ownerDocument.documentElement&&!r.element;){if("string"==typeof t&&i.classList.contains(t))r.element=i,r.classNames.push(t);else if(t instanceof RegExp){let e=Array.from(i.classList).filter(e=>t.test(e));e.length&&(r.element=i,r.classNames.push(...e))}i=i.parentElement}return r}function f(e,t){let r=e.parentNode,i=[];for("string"==typeof t?i=e.defaultView?Array.prototype.slice.call(e.querySelectorAll(t),0):Array.prototype.slice.call(e.ownerDocument.querySelectorAll(t),0):i.push(t);null!==r;){if(i.indexOf(r)>-1)return!0;r=r.parentNode}return!1}function m(e){let t=0,r=e;if(r.previousSibling)for(;r=r.previousSibling;)t+=1;return t}function y(e,t,r){let i=r.parentElement.querySelector(`.ht_clone_${e}`);return i?i.contains(t):null}function w(e){return e&&e.length?e.filter(e=>!!e):[]}function E(e,t){if(!e||!e.length)return t?{regexFree:[],regexes:[]}:[];let r=[],i=[];return i.push(...e.filter(e=>{let i=e instanceof RegExp;return i&&t&&r.push(e),!i})),t?{regexFree:i,regexes:r}:i}function S(e,t){return void 0!==e.classList&&"string"==typeof t&&""!==t&&e.classList.contains(t)}function C(e,t){"string"==typeof t&&(t=t.split(" ")),(t=w(t)).length>0&&e.classList.add(...t)}function R(e,t){"string"==typeof t?t=t.split(" "):t instanceof RegExp&&(t=[t]);let{regexFree:r,regexes:i}=E(t,!0);(r=w(r)).length>0&&e.classList.remove(...r),i.forEach(t=>{e.classList.forEach(r=>{t.test(r)&&e.classList.remove(r)})})}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;Array.isArray(t)||(t=[[t,r]]),t.forEach(t=>{Array.isArray(t)&&""!==t[0]&&e.setAttribute(...t)})}function T(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];"string"==typeof t?t=t.split(" "):t instanceof RegExp&&(t=[t]);let{regexFree:r,regexes:i}=E(t,!0);r.forEach(t=>{""!==t&&e.removeAttribute(t)}
5),i.forEach(t=>{e.getAttributeNames().forEach(r=>{t.test(r)&&e.removeAttribute(r)})})}function N(e){let t;for(;t=e.lastChild;)e.removeChild(t)}let A=/(<(.*)>|&(.*);)/;function I(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];A.test(t)?e.innerHTML=r?(0,n.sanitize)(t):t:M(e,t)}function M(e,t){let r=e.firstChild;r&&3===r.nodeType&&null===r.nextSibling?r.textContent=t:(N(e),e.appendChild(e.ownerDocument.createTextNode(t)))}function O(e){let t=e.ownerDocument.defaultView,r=e;for(;r.parentNode;){if("0px"===r.style.height||"0"===r.style.height)return"hidden"===t.getComputedStyle(r).overflow;r=r.parentNode}return!1}function x(e){let t,r,i;let n=e.ownerDocument,o=n.defaultView,s=n.documentElement,a=e;for(t=a.offsetLeft,r=a.offsetTop,i=a;(a=a.offsetParent)&&a!==n.body&&("offsetLeft"in a);)t+=a.offsetLeft,r+=a.offsetTop,i=a;return i&&"fixed"===i.style.position&&(t+=o.pageXOffset||s.scrollLeft,r+=o.pageYOffset||s.scrollTop),{left:t,top:r}}function _(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return e.scrollY}function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return e.scrollX}function L(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e===t?_(t):e.scrollTop}function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e===t?P(t):e.scrollLeft}function D(e){let t=e.ownerDocument,r=t?t.defaultView:void 0;t||(r=(t=e.document?e.document:e).defaultView);let i=["auto","scroll"],n=e.parentNode;for(;n&&n.style&&t.body!==n;){let{overflow:e,overflowX:t,overflowY:o}=n.style;if([e,t,o].includes("scroll")||({overflow:e,overflowX:t,overflowY:o}=r.getComputedStyle(n),i.includes(e)||i.includes(t)||i.includes(o))||n.clientHeight<=n.scrollHeight+1&&(i.includes(o)||i.includes(e))||n.clientWidth<=n.scrollWidth+1&&(i.includes(t)||i.includes(e)))return n;n=n.parentNode}return r}function H(e){return e.scrollHeight-e.clientHeight}function B(e){return e.scrollWidth-e.clientWidth}function F(e){let t=e.ownerDocument,r=t.defaultView,i=e.parentNode;for(;i&&i.style&&t.body!==i;){if("visible"!==i.style.overflow&&""!==i.style.overflow)return i;let e=r.getComputedStyle(i),t=["scroll","hidden","auto"],n=e.getPropertyValue("overflow"),o=e.getPropertyValue("overflow-y"),s=e.getPropertyValue("overflow-x");if(t.includes(n)||t.includes(o)||t.includes(s))return i;i=i.parentNode}return r}function V(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;if(!e)return;if(e===r)return"width"===t?`${r.innerWidth}px`:"height"===t?`${r.innerHeight}px`:void 0;let i=e.style[t];if(""!==i&&void 0!==i)return i;let n=r.getComputedStyle(e);if(""!==n[t]&&void 0!==n[t])return n[t]}function U(e,t){let{selectorText:r}=t,i=!1;return t.type===CSSRule.STYLE_RULE&&r&&(e.msMatchesSelector?i=e.msMatchesSelector(r):e.matches&&(i=e.matches(r))),i}function W(e){return e.offsetWidth}function j(e){return e.getBoundingClientRect().height}function G(e){return e.clientHeight||e.innerHeight}function $(e){return e.clientWidth||e.innerWidth}function z(e,t,r){e.addEventListener(t,r,!1)}function Y(e,t,r){e.removeEventListener(t,r,!1)}function K(e){return e.selectionStart?e.selectionStart:0}function X(e){return e.selectionEnd?e.selectionEnd:0}function q(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,t=e.document,r="";return e.getSelection?r=e.getSelection().toString():t.selection&&"Control"!==t.selection.type&&(r=t.selection.createRange().text),r}function Z(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;e.getSelection&&(e.getSelection().empty?e.getSelection().empty():e.getSelection().removeAllRanges&&e.getSelection().removeAllRanges())}function Q(e,t,r){if(void 0===r&&(r=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,r)}catch(o){let i=e.parentNode,n=i.style.display;i.style.display="block",e.setSelectionRange(t,r),i.style.display=n}}}function J(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return(0,s.isWindowsOS)()?Number.isInteger(e.defaultView.devicePixelRatio||1)?0:2:0}function ee(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return void 0===i&&(i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=e.createElement("div");t.style.height="200px",t.style.width="100%";let r=e.createElement("div");!(0,s.isSafari)()||(0,s.isMobileBrowser)()||(0,s.isIpadOS)()||r.classList.add("htScrollbarSafariTest"),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(t),(e.body||e.documentElement).appendChild(r);let i=t.getBoundingClientRect().width;r.style.overflow="scroll";let n=t.getBoundingClientRect().width;return i===n&&(n=r.clientWidth),(e.body||e.documentElement).removeChild(r),parseFloat((i-n).toFixed(3))}(e)),i}function et(e){return e instanceof Window?e.document.body.scrollHeight>
5e.innerHeight:e.offsetWidth!==e.clientWidth}function er(e){return e instanceof Window?e.document.body.scrollWidth>e.innerWidth:e.offsetHeight!==e.clientHeight}function ei(e,t,r){e.style.transform=`translate3d(${t},${r},0)`}function en(e){let t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:-1}function eo(e){e.style.transform&&""!==e.style.transform&&(e.style.transform="")}function es(e){return e&&(["INPUT","SELECT","TEXTAREA"].indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function ea(e){return es(e)&&!1===e.hasAttribute("data-hot-input")}function el(e){ea(e.ownerDocument.activeElement)||e.select()}function eh(e){return!e.parentNode}function eu(e,t){new IntersectionObserver((r,i)=>{r.forEach(r=>{r.isIntersecting&&null!==e.offsetParent&&(t(),i.unobserve(e))})},{root:e.ownerDocument.body}).observe(e)}function ec(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=e.ownerDocument,n=i.createRange(),s=i.defaultView.getSelection();b(e,"contenteditable",!0),r&&b(e,...(0,o.cV)()),t&&C(e,"invisibleSelection"),n.selectNodeContents(e),s.removeAllRanges(),s.addRange(n)}function ed(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=e.ownerDocument.defaultView.getSelection();e.hasAttribute("aria-hidden")&&e.removeAttribute("aria-hidden"),r.removeAllRanges(),t&&R(e,"invisibleSelection"),e.removeAttribute("contenteditable")}function eg(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];ec(e,r),t(),ed(e,r)}function ep(e){var t;let r=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView.Element;return!!(r&&null!==r&&e instanceof r)}},9190:function(e,t,r){"use strict";r.r(t),r.d(t,{isImmediatePropagationStopped:function(){return o},isLeftClick:function(){return a},isRightClick:function(){return s},isTouchEvent:function(){return l},offsetRelativeTo:function(){return h},stopImmediatePropagation:function(){return n}});var i=r(46879);function n(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}function o(e){return!1===e.isImmediatePropagationEnabled}function s(e){return 2===e.button}function a(e){return 0===e.button}function l(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function h(e,t){let r={x:e.offsetX,y:e.offsetY},n=e.target;if(!(0,i.isHTMLElement)(t)||n!==t&&n.contains(t))return r;for(;n!==t;)r.x+=n.offsetLeft,r.y+=n.offsetTop,n=n.offsetParent;return r}},13066:function(e,t,r){"use strict";let i;function n(e){return window.requestAnimationFrame(e)}function o(e){window.cancelAnimationFrame(e)}function s(){return"ontouchstart"in window}function a(){return"undefined"!=typeof window}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i||("object"==typeof Intl?i=new Intl.Collator(e,t).compare:i="function"==typeof String.prototype.localeCompare?(e,t)=>`${e}`.localeCompare(t):(e,t)=>e===t?0:e>t?-1:1),i}r.r(t),r.d(t,{cancelAnimationFrame:function(){return o},getComparisonFunction:function(){return l},isCSR:function(){return a},isTouchSupported:function(){return s},requestAnimationFrame:function(){return n}})},37710:function(e,t,r){"use strict";r.r(t),r.d(t,{curry:function(){return c},curryRight:function(){return d},debounce:function(){return l},fastCall:function(){return g},isFunction:function(){return o},partial:function(){return u},pipe:function(){return h},throttle:function(){return s},throttleAfterHits:function(){return a}});var i=r(22386),n=r(21927);function o(e){return"function"==typeof e}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,r=0,i={lastCallThrottled:!0},n=null;return function(){for(var o=arguments.length,s=Array(o),a=0;a<o;a++)s[a]=arguments[a];let l=Date.now(),h=!1;i.lastCallThrottled=!0,r||(r=l,h=!0);let u=t-(l-r);return h?(i.lastCallThrottled=!1,e.apply(this,s)):(n&&clearTimeout(n),n=setTimeout(()=>{i.lastCallThrottled=!1,e.apply(this,s),r=0,n=void 0},u)),i}}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i=s(e,t),n=r;function o(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return n?(n-=1,e.apply(this,r)):i.apply(this,r)}return o.clearHits=function(){n=r},o}function l(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,i=null;return function(){for(var n=arguments.length,o=Array(n),s=0;s<n;s++)o[s]=arguments[s];return i&&clearTimeout(i),i=setTimeout(()=>{t=e.apply(this,o)},r),t}}function h(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,...o]=t;return function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.arrayReduce)(o,(e,t)=>t(e),n.apply(this,t))}}function u(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return function(){for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return e.apply(this,r.concat(i))}}function c(e){let t=e.length;return function r(i){return function(){for(var n=arguments.length,o=Array(n),s=0;s<n;s++)o[s]=arguments[s];let a=i.concat(o);return a.length>=t?e.apply(this,a):r(a)}}([])}function d(e){let t=e.length;return function r(i){return function(){for(var n=arguments.length,o=Array(n),s=0;s<n;s++)o[s]=arguments[s];let a=i.concat(o.reverse());return a.length>=t?e.apply(this,a):r(a)}}([])}function g(e,t,r,i,o,s,a,l){return(0,n.isDefined)(l)?e.call(t,r,i,o,s,a,l):(0,n.isDefined)(a)?e.call(t,r,i,o,s,a):(0,n.isDefined)(s)?e.call(t,r,i,o,s):(0,n.isDefined)(o)?e.call(t,r,i,o):(0,n.isDefined)(i)?e.call(t,r,i):(0,n.isDefined)(r)?e.call(t,r):e.call(t)}},21927:function(e,t,r){"use strict";r.r(t),r.d(t,{_injectProductInfo:function(){return C},isDefined:function(){return s},isEmpty:function(){return l},isRegExp:function(){return h},isUndefined:function(){return a},stringify:function(){return o}});var i=r(77398),n=r(80600);function o(e){let t;switch(typeof e){case"string":case"number":t=`${e}`;break;case"object":t=null===e?"":e.toString();break;case"undefined":t="";break;default:t=e.toString()}return t}function s(e){return void 0!==e}function a(e){return void 0===e}function l(e){return null===e||""===e||a(e)}function h(e){return"[object RegExp]"===Object.prototype.toString.call(e)}let u="length",c=e=>parseInt(e,16),d=e=>parseInt(e,10),g=(e,t,r)=>e.substr(t,r),p=e=>e.codePointAt(0)-65,f=e=>`${e}`.replace(/\-/g,""),m=e=>c(g(f(e),c("12"),p("F")))/(c(g(f(e),p("B"),~~![][u]))||9),y=()=>"undefined"!=typeof location&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host),w=!1,E={invalid:()=>(0,n.e)`
6    The license key for Handsontable is invalid.\x20
7    If you need any help, contact us at [email protected].`,expired:e=>{let{keyValidityDate:t,hotVersion:r}=e;return(0,n.e)`
8    The license key for Handsontable expired on ${t}, and is not valid for the installed\x20
9    version ${r}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
10    to ${t}. If you need any help, contact us at [email protected].`},missing:()=>(0,n.e)`
11    The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
12    Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
13    passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
14    us at [email protected].`,non_commercial:()=>""},S={invalid:()=>(0,n.e)`
15    The license key for Handsontable is invalid.\x20
16    <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
17    install it properly or contact us at <a href="mailto:[email protected]">[email protected]</a>.`,expired:e=>{let{keyValidityDate:t,hotVersion:r}=e;return(0,n.e)`
18    The license key for Handsontable expired on ${t}, and is not valid for the installed\x20
19    version ${r}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
20    license key or downgrade to a version released prior to ${t}. If you need any\x20
21    help, contact us at <a href="mailto:[email protected]">[email protected]</a>.`},missing:()=>(0,n.e)`
22    The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
23    Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
24    passing the key: 'non-commercial-and-evaluation'.\x20
25    <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
26    the documentation or contact us at <a href="mailto:[email protected]">[email protected]</a>.`,non_commercial:()=>""};function C(e,t){let r;let n=!l(e),o="string"==typeof e&&"non-commercial-and-evaluation"===e.toLowerCase(),s="16.2.0",a="invalid",h="invalid",C=function(e){let t=[][u],r=t;if(e[u]!==p("Z"))return!1;for(let t="",i="B<H4P+".split(""),n=p(i.shift());n;n=p(i.shift()||"A"))--n<""[u]?r|=(d(`${d(c(t)+(c(g(e,Math.abs(n),2))+[]).padStart(2,"0"))}`)%97||2)>>1:t=g(e,n,n?1===i[u]?9:8:6);return r===t}(e=f(e||""));if(n||o||C){if(C){let t=Math.floor(i("25/11/2025","DD/MM/YYYY").toDate().getTime()/864e5),n=m(e);r=i((n+1)*864e5,"x").format("MMMM DD, YYYY"),t>n?(a="expired",h="expired"):(a="valid",h="valid")}else o?(a="non_commercial",h="valid"):(a="invalid",h="invalid")}else a="missing",h="missing";if(y()&&(a="valid",h="valid"),w||"valid"===a||(E[a]({keyValidityDate:r,hotVersion:s})&&console["non_commercial"===a?"info":"warn"](E[a]({keyValidityDate:r,hotVersion:s})),w=!0),"valid"!==h&&t&&S[h]({keyValidityDate:r,hotVersion:s})){let e=document.createElement("div");e.className="handsontable hot-display-license-info",e.innerHTML=S[h]({keyValidityDate:r,hotVersion:s}),t.appendChild(e)}}},47771:function(e,t,r){"use strict";function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=typeof e;if("number"===r)return!isNaN(e)&&isFinite(e);if("string"===r){if(0===e.length)return!1;if(1===e.length)return/\d/.test(e);let r=Array.from(new Set([".",...t])).map(e=>`\\${e}`).join("|");return RegExp(`^[+-]?(((${r})?\\d+((${r})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(e.trim())}return"object"===r&&!!e&&"number"==typeof e.valueOf()&&!(e instanceof Date)}function n(e){return i(e,[","])}function o(e,t,r){let i=-1;for("function"==typeof t?(r=t,t=e):i=e-1;++i<=t&&!1!==r(i););}function s(e,t,r){let i=e+1;for("function"==typeof t&&(r=t,t=0);--i>=t&&!1!==r(i););}function a(e,t){return parseInt(e*(t=isNaN(t=parseInt(t.toString().replace("%",""),10))?0:t)/100,10)}function l(e,t,r){return Math.min(e,t)===e?t:Math.max(e,r)===e?r:e}function h(e){let t=e.replace(",",".");return!1===isNaN(parseFloat(t))?parseFloat(t):null}function u(e){return Number.isInteger(e)&&e>=0}r.r(t),r.d(t,{clamp:function(){return l},getParsedNumber:function(){return h},isNumeric:function(){return i},isNumericLike:function(){return n},isUnsignedNumber:function(){return u},rangeEach:function(){return o},rangeEachReverse:function(){return s},valueAccordingPercent:function(){return a}}),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975),r(70470),r(17901)},92263:function(e,t,r){"use strict";r.r(t),r.d(t,{assignObjectDefaults:function(){return function e(t,r){if("object"!=typeof t||null===t)return r;if("object"!=typeof r||null===r)return t;let i={};return Object.keys(r).forEach(n=>{"object"!=typeof r[n]||null===r[n]||Array.isArray(r[n])?i[n]=y(t,n)&&void 0!==t[n]?t[n]:r[n]:i[n]=e(t[n],r[n])}
26),Object.keys(t).forEach(e=>{y(i,e)||(i[e]=t[e])}),i}},clone:function(){return a},createObjectPropListener:function(){return m},deepClone:function(){return s},deepExtend:function(){return function e(t,r){d(r,(i,n)=>{r[n]&&"object"==typeof r[n]?(t[n]||(Array.isArray(r[n])?t[n]=[]:"[object Date]"===Object.prototype.toString.call(r[n])?t[n]=r[n]:t[n]={}),e(t[n],r[n])):t[n]=r[n]})}},deepObjectSize:function(){return f},defineGetter:function(){return c},duckSchema:function(){return function e(t){let r;return Array.isArray(t)?r=t.length?Array(t.length).fill(null):[]:(r={},d(t,(t,i)=>{"__children"!==i&&(t&&"object"==typeof t&&!Array.isArray(t)?r[i]=e(t):Array.isArray(t)?t.length&&"object"==typeof t[0]&&!Array.isArray(t[0])?r[i]=[e(t[0])]:r[i]=[]:r[i]=null)})),r}},extend:function(){return o},getProperty:function(){return g},hasOwnProperty:function(){return y},inherit:function(){return n},isObject:function(){return u},isObjectEqual:function(){return h},mixin:function(){return l},objectEach:function(){return d},setProperty:function(){return p}}),r(76346),r(65230),r(18044),r(70470),r(95984);var i=r(22386);function n(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function o(e,t,r){let i=Array.isArray(r);return d(t,(t,n)=>{(!1===i||r.includes(n))&&(e[n]=t)}),e}function s(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function a(e){let t={};return d(e,(e,r)=>{t[r]=e}),t}function l(e){e.MIXINS||(e.MIXINS=[]);for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return(0,i.arrayEach)(r,t=>{e.MIXINS.push(t.MIXIN_NAME),d(t,(t,r)=>{if(void 0!==e.prototype[r])throw Error(`Mixin conflict. Property '${r}' already exist and cannot be overwritten.`);"function"==typeof t?e.prototype[r]=t:Object.defineProperty(e.prototype,r,{get:function(e,t){let r=`_${e}`,i=e=>{let t=e;return(Array.isArray(t)||u(t))&&(t=s(t)),t};return function(){return void 0===this[r]&&(this[r]=i(t)),this[r]}}(r,t),set:function(e){let t=`_${e}`;return function(e){this[t]=e}}(r),configurable:!0})})}),e}function h(e,t){return JSON.stringify(e)===JSON.stringify(t)}function u(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e,t,r,i){i.value=r,i.writable=!1!==i.writable,i.enumerable=!1!==i.enumerable,i.configurable=!1!==i.configurable,Object.defineProperty(e,t,i)}function d(e,t){for(let r in e)if((!e.hasOwnProperty||e.hasOwnProperty&&Object.prototype.hasOwnProperty.call(e,r))&&!1===t(e[r],r,e))break;return e}function g(e,t){let r=t.split("."),i=e;return d(r,e=>{if(void 0===(i=i[e]))return i=void 0,!1}),i}function p(e,t,r){if("string"!=typeof t)return;let i=t.split("."),n=e;i.forEach((e,t)=>{"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(t!==i.length-1?(y(n,e)||(n[e]={}),n=n[e]):n[e]=r)})}function f(e){if(!u(e))return 0;let t=function(e){let r=0;return u(e)?d(e,(e,i)=>{"__children"!==i&&(r+=t(e))}):r+=1,r};return t(e)}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value",r=`_${t}`,i={_touched:!1,[r]:e,isTouched(){return this._touched}};return Object.defineProperty(i,t,{get(){return this[r]},set(e){this._touched=!0,this[r]=e},enumerable:!0,configurable:!0}),i}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},60049:function(e,t,r){"use strict";r.r(t),r.d(t,{equalsIgnoreCase:function(){return es},isJSON:function(){return el},isPercentValue:function(){return eh},randomString:function(){return ea},sanitize:function(){return ed},stripTags:function(){return ec},substitute:function(){return eu},toUpperCaseFirst:function(){return eo}}),r(65230);let{entries:i,setPrototypeOf:n,isFrozen:o,getPrototypeOf:s,getOwnPropertyDescriptor:a}=Object,{freeze:l,seal:h,create:u}=Object,{apply:c,construct:d}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e){return e}),h||(h=function(e){return e}),c||(c=function(e,t){for(var r=arguments.length,i=Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];return e.apply(t,i)}),d||(d=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});let g=I(Array.prototype.forEach),p=I(Array.prototype.lastIndexOf),f=I(Array.prototype.pop),m=I(Array.prototype.push),y=I(Array.prototype.splice),w=I(String.prototype.toLowerCase),E=I(String.prototype.toString),S=I(String.prototype.match),C=I(String.prototype.replace),R=I(String.prototype.indexOf),b=I(String.prototype.trim),T=I(Object.prototype.hasOwnProperty),N=I(RegExp.prototype.test),A=(Q=TypeError,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return d(Q,t)}
26);function I(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return c(e,t,i)}}function M(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w;n&&n(e,null);let i=t.length;for(;i--;){let n=t[i];if("string"==typeof n){let e=r(n);e!==n&&(o(t)||(t[i]=e),n=e)}e[n]=!0}return e}function O(e){let t=u(null);for(let[r,n]of i(e))T(e,r)&&(Array.isArray(n)?t[r]=function(e){for(let t=0;t<e.length;t++)T(e,t)||(e[t]=null);return e}(n):n&&"object"==typeof n&&n.constructor===Object?t[r]=O(n):t[r]=n);return t}function x(e,t){for(;null!==e;){let r=a(e,t);if(r){if(r.get)return I(r.get);if("function"==typeof r.value)return I(r.value)}e=s(e)}return function(){return null}}let _=l(["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","search","section","select","shadow","slot","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"]),P=l(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=l(["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"]),k=l(["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"]),D=l(["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"]),H=l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=l(["#text"]),F=l(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
26spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),V=l(["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","mask-type","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"]),U=l(["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"]),W=l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),j=h(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=h(/<%[\w\W]*|[\w\W]*%>/gm),$=h(/\$\{[\w\W]*/gm),z=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),Y=h(/^aria-[\-\w]+$/),K=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),X=h(/^(?:\w+script|data):/i),q=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Z=h(/^html$/i);var Q,J=Object.freeze({__proto__:null,ARIA_ATTR:Y,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:h(/^[a-z][.\w]*(-[.\w]+)+$/i),DATA_ATTR:z,DOCTYPE_NAME:Z,ERB_EXPR:G,IS_ALLOWED_URI:K,IS_SCRIPT_OR_DATA:X,MUSTACHE_EXPR:j,TMPLIT_EXPR:$});let ee={element:1,text:3,progressingInstruction:7,comment:8,document:9},et=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let r=null,i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));let n="dompurify"+(r?"#"+r:"");try{return e.createPolicy(n,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+n+" could not be created."),null}},er=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};var ei=function e(){let t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,n=t=>e(t);if(n.version="3.3.1",n.removed=[],!r||!r.document||r.document.nodeType!==ee.document||!r.Element)return n.isSupported=!1,n;let{document:o}=r,s=o,a=s.currentScript,{DocumentFragment:h,HTMLTemplateElement:c,Node:d,Element:I,NodeFilter:j,NamedNodeMap:G=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:$,DOMParser:z,trustedTypes:Y}=r,X=I.prototype,q=x(X,"cloneNode"),Q=x(X,"remove"),ei=x(X,"nextSibling"),en=x(X,"childNodes"),eo=x(X,"parentNode");if("function"==typeof c){let e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let es="",{implementation:ea,createNodeIterator:el,createDocumentFragment:eh,getElementsByTagName:eu}=o,{importNode:ec}=s,ed=er();n.isSupported="function"==typeof i&&"function"==typeof eo&&ea&&void 0!==ea.createHTMLDocument;let{MUSTACHE_EXPR:eg,ERB_EXPR:ep,TMPLIT_EXPR:ef,DATA_ATTR:em,ARIA_ATTR:ey,IS_SCRIPT_OR_DATA:ev,ATTR_WHITESPACE:ew,CUSTOM_ELEMENT:eE}=J,{IS_ALLOWED_URI:eS}=J,eC=null,eR=M({},[..._,...P,...L,...D,...B]),eb=null,eT=M({}
26,[...F,...V,...U,...W]),eN=Object.seal(u(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}})),eA=null,eI=null,eM=Object.seal(u(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),eO=!0,ex=!0,e_=!1,eP=!0,eL=!1,ek=!0,eD=!1,eH=!1,eB=!1,eF=!1,eV=!1,eU=!1,eW=!0,ej=!1,eG=!0,e$=!1,ez={},eY=null,eK=M({},["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"]),eX=null,eq=M({},["audio","video","img","source","image","track"]),eZ=null,eQ=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),eJ="http://www.w3.org/1998/Math/MathML",e0="http://www.w3.org/2000/svg",e1="http://www.w3.org/1999/xhtml",e2=e1,e5=!1,e3=null,e9=M({},[eJ,e0,e1],E),e4=M({},["mi","mo","mn","ms","mtext"]),e7=M({},["annotation-xml"]),e8=M({},["title","style","font","a","script"]),e6=null,te=["application/xhtml+xml","text/html"],tt=null,tr=null,ti=o.createElement("form"),tn=function(e){return e instanceof RegExp||e instanceof Function},to=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!tr||tr!==e){if(e&&"object"==typeof e||(e={}),e=O(e),tt="application/xhtml+xml"===(e6=-1===te.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?E:w,eC=T(e,"ALLOWED_TAGS")?M({},e.ALLOWED_TAGS,tt):eR,eb=T(e,"ALLOWED_ATTR")?M({},e.ALLOWED_ATTR,tt):eT,e3=T(e,"ALLOWED_NAMESPACES")?M({},e.ALLOWED_NAMESPACES,E):e9,eZ=T(e,"ADD_URI_SAFE_ATTR")?M(O(eQ),e.ADD_URI_SAFE_ATTR,tt):eQ,eX=T(e,"ADD_DATA_URI_TAGS")?M(O(eq),e.ADD_DATA_URI_TAGS,tt):eq,eY=T(e,"FORBID_CONTENTS")?M({},e.FORBID_CONTENTS,tt):eK,eA=T(e,"FORBID_TAGS")?M({},e.FORBID_TAGS,tt):O({}),eI=T(e,"FORBID_ATTR")?M({},e.FORBID_ATTR,tt):O({}),ez=!!T(e,"USE_PROFILES")&&e.USE_PROFILES,eO=!1!==e.ALLOW_ARIA_ATTR,ex=!1!==e.ALLOW_DATA_ATTR,e_=e.ALLOW_UNKNOWN_PROTOCOLS||!1,eP=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,eL=e.SAFE_FOR_TEMPLATES||!1,ek=!1!==e.SAFE_FOR_XML,eD=e.WHOLE_DOCUMENT||!1,eF=e.RETURN_DOM||!1,eV=e.RETURN_DOM_FRAGMENT||!1,eU=e.RETURN_TRUSTED_TYPE||!1,eB=e.FORCE_BODY||!1,eW=!1!==e.SANITIZE_DOM,ej=e.SANITIZE_NAMED_PROPS||!1,eG=!1!==e.KEEP_CONTENT,e$=e.IN_PLACE||!1,eS=e.ALLOWED_URI_REGEXP||K,e2=e.NAMESPACE||e1,e4=e.MATHML_TEXT_INTEGRATION_POINTS||e4,e7=e.HTML_INTEGRATION_POINTS||e7,eN=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&tn(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(eN.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&tn(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(eN.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(eN.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),eL&&(ex=!1),eV&&(eF=!0),ez&&(eC=M({},B),eb=[],!0===ez.html&&(M(eC,_),M(eb,F)),!0===ez.svg&&(M(eC,P),M(eb,V),M(eb,W)),!0===ez.svgFilters&&(M(eC,L),M(eb,V),M(eb,W)),!0===ez.mathMl&&(M(eC,D),M(eb,U),M(eb,W))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?eM.tagCheck=e.ADD_TAGS:(eC===eR&&(eC=O(eC)),M(eC,e.ADD_TAGS,tt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?eM.attributeCheck=e.ADD_ATTR:(eb===eT&&(eb=O(eb)),M(eb,e.ADD_ATTR,tt))),e.ADD_URI_SAFE_ATTR&&M(eZ,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(eY===eK&&(eY=O(eY)),M(eY,e.FORBID_CONTENTS,tt)),e.ADD_FORBID_CONTENTS&&(eY===eK&&(eY=O(eY)),M(eY,e.ADD_FORBID_CONTENTS,tt)),eG&&(eC["#text"]=!0),eD&&M(eC,["html","head","body"]),eC.table&&(M(eC,["tbody"]),delete eA.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');es=(t=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===t&&(t=et(Y,a)),null!==t&&"string"==typeof es&&(es=t.createHTML(""));l&&l(e),tr=e}},ts=M({},[...P,...L,...k]),ta=M({},[...D,...H]),tl=function(e){let t=eo(e);t&&t.tagName||(t={namespaceURI:e2,tagName:"template"});let r=w(e.tagName),i=w(t.tagName);return!!e3[e.namespaceURI]&&(e.namespaceURI===e0?t.namespaceURI===e1?"svg"===r:t.namespaceURI===eJ?"svg"===r&&("annotation-xml"===i||e4[i]):!!ts[r]:e.namespaceURI===eJ?t.namespaceURI===e1?"math"===r:t.namespaceURI===e0?"math"===r&&e7[i]:!!ta[r]:e.namespaceURI===e1?(t.namespaceURI!==e0||!!e7[i])&&(t.namespaceURI!==eJ||!!e4[i])&&!ta[r]&&(e8[r]||!ts[r]):"application/xhtml+xml"===e6&&!!e3[e.namespaceURI])},th=function(e){m(n.removed,{element:e});try{eo(e).removeChild(e)}catch(t){Q(e)}},tu=function(e,t){try{m(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){m(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e){if(eF||eV)try{th(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}}},tc=function(e){let r=null,i=null;if(eB)e="<remove></remove>"+e;else{let t=S(e,/^[\r\n\t ]+/);i=t&&t[0]}
26"application/xhtml+xml"===e6&&e2===e1&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let n=t?t.createHTML(e):e;if(e2===e1)try{r=new z().parseFromString(n,e6)}catch(e){}if(!r||!r.documentElement){r=ea.createDocument(e2,"template",null);try{r.documentElement.innerHTML=e5?es:n}catch(e){}}let s=r.body||r.documentElement;return(e&&i&&s.insertBefore(o.createTextNode(i),s.childNodes[0]||null),e2===e1)?eu.call(r,eD?"html":"body")[0]:eD?r.documentElement:s},td=function(e){return el.call(e.ownerDocument||e,e,j.SHOW_ELEMENT|j.SHOW_COMMENT|j.SHOW_TEXT|j.SHOW_PROCESSING_INSTRUCTION|j.SHOW_CDATA_SECTION,null)},tg=function(e){return e instanceof $&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof G)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},tp=function(e){return"function"==typeof d&&e instanceof d};function tf(e,t,r){g(e,e=>{e.call(n,t,r,tr)})}let tm=function(e){let t=null;if(tf(ed.beforeSanitizeElements,e,null),tg(e))return th(e),!0;let r=tt(e.nodeName);if(tf(ed.uponSanitizeElement,e,{tagName:r,allowedTags:eC}),ek&&e.hasChildNodes()&&!tp(e.firstElementChild)&&N(/<[/\w!]/g,e.innerHTML)&&N(/<[/\w!]/g,e.textContent)||e.nodeType===ee.progressingInstruction||ek&&e.nodeType===ee.comment&&N(/<[/\w]/g,e.data))return th(e),!0;if(!(eM.tagCheck instanceof Function&&eM.tagCheck(r))&&(!eC[r]||eA[r])){if(!eA[r]&&tv(r)&&(eN.tagNameCheck instanceof RegExp&&N(eN.tagNameCheck,r)||eN.tagNameCheck instanceof Function&&eN.tagNameCheck(r)))return!1;if(eG&&!eY[r]){let t=eo(e)||e.parentNode,r=en(e)||e.childNodes;if(r&&t){let i=r.length;for(let n=i-1;n>=0;--n){let i=q(r[n],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,ei(e))}}}return th(e),!0}return e instanceof I&&!tl(e)||("noscript"===r||"noembed"===r||"noframes"===r)&&N(/<\/no(script|embed|frames)/i,e.innerHTML)?(th(e),!0):(eL&&e.nodeType===ee.text&&(t=e.textContent,g([eg,ep,ef],e=>{t=C(t,e," ")}),e.textContent!==t&&(m(n.removed,{element:e.cloneNode()}),e.textContent=t)),tf(ed.afterSanitizeElements,e,null),!1)},ty=function(e,t,r){if(eW&&("id"===t||"name"===t)&&(r in o||r in ti))return!1;if(ex&&!eI[t]&&N(em,t));else if(eO&&N(ey,t));else if(eM.attributeCheck instanceof Function&&eM.attributeCheck(t,e));else if(!eb[t]||eI[t]){if(!(tv(e)&&(eN.tagNameCheck instanceof RegExp&&N(eN.tagNameCheck,e)||eN.tagNameCheck instanceof Function&&eN.tagNameCheck(e))&&(eN.attributeNameCheck instanceof RegExp&&N(eN.attributeNameCheck,t)||eN.attributeNameCheck instanceof Function&&eN.attributeNameCheck(t,e))||"is"===t&&eN.allowCustomizedBuiltInElements&&(eN.tagNameCheck instanceof RegExp&&N(eN.tagNameCheck,r)||eN.tagNameCheck instanceof Function&&eN.tagNameCheck(r))))return!1}else if(eZ[t]);else if(N(eS,C(r,ew,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===R(r,"data:")&&eX[e]);else if(e_&&!N(ev,C(r,ew,"")));else if(r)return!1;return!0},tv=function(e){return"annotation-xml"!==e&&S(e,eE)},tw=function(e){tf(ed.beforeSanitizeAttributes,e,null);let{attributes:r}=e;if(!r||tg(e))return;let i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:eb,forceKeepAttr:void 0},o=r.length;for(;o--;){let{name:s,namespaceURI:a,value:l}=r[o],h=tt(s),u="value"===s?l:b(l);if(i.attrName=h,i.attrValue=u,i.keepAttr=!0,i.forceKeepAttr=void 0,tf(ed.uponSanitizeAttribute,e,i),u=i.attrValue,ej&&("id"===h||"name"===h)&&(tu(s,e),u="user-content-"+u),ek&&N(/((--!?|])>)|<\/(style|title|textarea)/i,u)||"attributename"===h&&S(u,"href")){tu(s,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr||!eP&&N(/\/>/i,u)){tu(s,e);continue}eL&&g([eg,ep,ef],e=>{u=C(u,e," ")});let c=tt(e.nodeName);if(!ty(c,h,u)){tu(s,e);continue}if(t&&"object"==typeof Y&&"function"==typeof Y.getAttributeType){if(a);else switch(Y.getAttributeType(c,h)){case"TrustedHTML":u=t.createHTML(u);break;case"TrustedScriptURL":u=t.createScriptURL(u)}}if(u!==l)try{a?e.setAttributeNS(a,s,u):e.setAttribute(s,u),tg(e)?th(e):f(n.removed)}catch(t){tu(s,e)}}tf(ed.afterSanitizeAttributes,e,null)},tE=function e(t){let r=null,i=td(t);for(tf(ed.beforeSanitizeShadowDOM,t,null);r=i.nextNode();)tf(ed.uponSanitizeShadowNode,r,null),tm(r),tw(r),r.content instanceof h&&e(r.content);tf(ed.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,a=null,l=null;if((e5=!e)&&(e="<!-->"),"string"!=typeof e&&!tp(e)){if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw A("dirty is not a string, aborting")}else throw A("toString is not a function")}if(!n.isSupported)return e;if(eH||to(r),n.removed=[],"string"==typeof e&&(e$=!1),e$){if(e.nodeName){let t=tt(e.nodeName);if(!eC[t]||eA[t])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof d)(o=(i=tc("<!---->")).ownerDocument.importNode(e,!0)).nodeType===ee.element&&"BODY"===o.nodeName?i=o:"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!eF&&!eL&&!eD&&-1===e.indexOf("<"))return t&&eU?t.createHTML(e):e;if(!(i=tc(e)))return eF?null:eU?es:""}i&&eB&&th(i.firstChild);let u=td(e$?e:i);for(;a=u.nextNode();)tm(a),tw(a),a.content instanceof h&&tE(a.content);if(e$)return e;if(eF){if(eV)for(l=eh.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(eb.shadowroot||eb.shadowrootmode)&&(l=ec.call(s,l,!0)),l}let c=eD?i.outerHTML:i.innerHTML;return eD&&eC["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&N(Z,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),eL&&g([eg,ep,ef],e=>{c=C(c,e," ")}),t&&eU?t.createHTML(c):c},n.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};to(e),eH=!0},n.clearConfig=function(){tr=null,eH=!1},n.isValidAttribute=function(e,t,r){return tr||to({}),ty(tt(e),tt(t),r)},n.addHook=function(e,t){"function"==typeof t&&m(ed[e],t)},n.removeHook=function(e,t){if(void 0!==t){let r=p(ed[e],t);return -1===r?void 0:y(ed[e],r,1)[0]}return f(ed[e])},n.removeHooks=function(e){ed[e]=[]},n.removeAllHooks=function(){ed=er()},n}(),en=r(21927);function eo(e){return e[0].toUpperCase()+e.substr(1)}function es(){let e=[];for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];let n=r.length;for(;n;){n-=1;let t=(0,en.stringify)(r[n]).toLowerCase();-1===e.indexOf(t)&&e.push(t)}return 1===e.length}function ea(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return e()+e()+e()+e()}function el(e){if("string"!=typeof e)return!1;try{let t=JSON.parse(e);return"object"==typeof t&&null!==t}catch{return!1}}function eh(e){return/^([0-9][0-9]?%$)|(^100%$)/.test(e)}function eu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return`${e}`.replace(/(?:\\)?\[([^[\]]+)]/g,(e,r)=>"\\"===e.charAt(0)?e.substr(1,e.length-1):void 0===t[r]?"":t[r])}function ec(e){return ed(`${e}`,{ALLOWED_TAGS:[]})}function ed(e,t){return ei.sanitize(e,t)}},80600:function(e,t,r){"use strict";r.d(t,{d:function(){return o},e:function(){return n}}),r(70470),r(95984),r(85411);var i=r(22386);function n(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return(0,i.arrayReduce)(e,(e,t,i)=>e+t.replace(/\r?\n\s*/g,"")+(r[i]?r[i]:""),"").trim()}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];let n=document.createElement("template");n.innerHTML=e.reduce((e,t,i)=>{var n;return e+t+(null!==(n=r[i])&&void 0!==n?n:"")},"");let o=n.content.cloneNode(!0),s={};
26return o.querySelectorAll("[data-ref]").forEach(e=>{let t=e.getAttribute("data-ref");e.removeAttribute("data-ref"),s[t]=e}),{fragment:o,refs:s}}},14820:function(e,t,r){"use strict";r.d(t,{e:function(){return n}});var i=r(46879);function n(e){let{classNames:t}=(0,i.findFirstParentWithClass)(e,/ht-theme-[a-zA-Z0-9_-]+/);return t.pop()}},79341:function(e,t,r){"use strict";r.r(t),r.d(t,{KEY_CODES:function(){return o},isCtrlKey:function(){return h},isCtrlMetaKey:function(){return u},isFunctionKey:function(){return l},isKey:function(){return c},isPrintableChar:function(){return a}}),r(65230);var i=r(22386),n=r(66327);let o={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:(0,n.isFirefox)()?182:174,AUDIO_MUTE:(0,n.isFirefox)()?181:173,AUDIO_UP:(0,n.isFirefox)()?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},s=[o.ALT,o.ARROW_DOWN,o.ARROW_LEFT,o.ARROW_RIGHT,o.ARROW_UP,o.AUDIO_DOWN,o.AUDIO_MUTE,o.AUDIO_UP,o.BACKSPACE,o.CAPS_LOCK,o.DELETE,o.END,o.ENTER,o.ESCAPE,o.F1,o.F2,o.F3,o.F4,o.F5,o.F6,o.F7,o.F8,o.F9,o.F10,o.F11,o.F12,o.F13,o.F14,o.F15,o.F16,o.F17,o.F18,o.F19,o.HOME,o.INSERT,o.MEDIA_NEXT,o.MEDIA_PLAY_PAUSE,o.MEDIA_PREV,o.MEDIA_STOP,o.NULL,o.NUM_LOCK,o.PAGE_DOWN,o.PAGE_UP,o.PAUSE,o.SCROLL_LOCK,o.SHIFT,o.TAB];function a(e){return 32===e||e>=48&&e<=57||e>=96&&e<=111||e>=186&&e<=192||e>=219&&e<=222||e>=226||e>=65&&e<=90}function l(e){return s.includes(e)}function h(e){let t=[];return(0,n.isMacOS)()?t.push(o.COMMAND_LEFT,o.COMMAND_RIGHT,o.COMMAND_FIREFOX):t.push(o.CONTROL),t.includes(e)}function u(e){return[o.CONTROL,o.COMMAND_LEFT,o.COMMAND_RIGHT,o.COMMAND_FIREFOX].includes(e)}function c(e,t){let r=t.split("|"),n=!1;return(0,i.arrayEach)(r,t=>{if(e===o[t])return n=!0,!1}),n}},2178:function(e,t,r){"use strict";r.r(t),r.d(t,{CANCEL:function(){return o},CHECKBOX_CHECKED:function(){return eG},CHECKBOX_RENDERER_NAMESPACE:function(){return ej},CHECKBOX_UNCHECKED:function(){return e$},COMMON_NAMESPACE:function(){return i},CONTEXTMENU_ITEMS_ADD_COMMENT:function(){return I},CONTEXTMENU_ITEMS_ALIGNMENT:function(){return _},CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:function(){return F},CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:function(){return L},CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:function(){return D},CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:function(){return P},CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:function(){return B},CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:function(){return k},CONTEXTMENU_ITEMS_ALIGNMENT_TOP:function(){return H},CONTEXTMENU_ITEMS_BORDERS:function(){return V},CONTEXTMENU_ITEMS_BORDERS_BOTTOM:function(){return j},CONTEXTMENU_ITEMS_BORDERS_LEFT:function(){return G},CONTEXTMENU_ITEMS_BORDERS_RIGHT:function(){return W},CONTEXTMENU_ITEMS_BORDERS_TOP:function(){return U},CONTEXTMENU_ITEMS_CLEAR_COLUMN:function(){return y},CONTEXTMENU_ITEMS_COPY:function(){return w},CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:function(){return C},CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:function(){return S},CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:function(){return E},CONTEXTMENU_ITEMS_CUT:function(){return R},CONTEXTMENU_ITEMS_EDIT_COMMENT:function(){return M},CONTEXTMENU_ITEMS_FREEZE_COLUMN:function(){return b},CONTEXTMENU_ITEMS_HIDE_COLUMN:function(){return K},CONTEXTMENU_ITEMS_HIDE_ROW:function(){return q},CONTEXTMENU_ITEMS_INSERT_LEFT:function(){return u},CONTEXTMENU_ITEMS_INSERT_RIGHT:function(){return c},CONTEXTMENU_ITEMS_MERGE_CELLS:function(){return N},CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:function(){return Y},CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:function(){return z},CONTEXTMENU_ITEMS_NO_ITEMS:function(){return a},CONTEXTMENU_ITEMS_READ_ONLY:function(){return m},CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:function(){return x},CONTEXTMENU_ITEMS_REDO:function(){return f},CONTEXTMENU_ITEMS_REMOVE_BORDERS:function(){return $},CONTEXTMENU_ITEMS_REMOVE_COLUMN:function(){return g},CONTEXTMENU_ITEMS_REMOVE_COMMENT:function(){return O},CONTEXTMENU_ITEMS_REMOVE_ROW:function(){return d},CONTEXTMENU_ITEMS_ROW_ABOVE:function(){return l},CONTEXTMENU_ITEMS_ROW_BELOW:function(){return h},CONTEXTMENU_ITEMS_SHOW_COLUMN:function(){return X},CONTEXTMENU_ITEMS_SHOW_ROW:function(){return Z},CONTEXTMENU_ITEMS_UNDO:function(){return p}
26,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:function(){return T},CONTEXTMENU_ITEMS_UNMERGE_CELLS:function(){return A},CONTEXT_MENU_ITEMS_NAMESPACE:function(){return s},EMPTY_DATA_STATE_BUTTONS_FILTERS_RESET:function(){return eJ},EMPTY_DATA_STATE_DESCRIPTION:function(){return eq},EMPTY_DATA_STATE_DESCRIPTION_FILTERS:function(){return eQ},EMPTY_DATA_STATE_NAMESPACE:function(){return eK},EMPTY_DATA_STATE_TITLE:function(){return eX},EMPTY_DATA_STATE_TITLE_FILTERS:function(){return eZ},FILTERS_BUTTONS_CANCEL:function(){return eM},FILTERS_BUTTONS_CLEAR:function(){return eA},FILTERS_BUTTONS_OK:function(){return eI},FILTERS_BUTTONS_PLACEHOLDER_SEARCH:function(){return eO},FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:function(){return e_},FILTERS_BUTTONS_PLACEHOLDER_VALUE:function(){return ex},FILTERS_BUTTONS_SELECT_ALL:function(){return eN},FILTERS_CONDITIONS_AFTER:function(){return em},FILTERS_CONDITIONS_BEFORE:function(){return ey},FILTERS_CONDITIONS_BEGINS_WITH:function(){return eo},FILTERS_CONDITIONS_BETWEEN:function(){return ep},FILTERS_CONDITIONS_BY_VALUE:function(){return eh},FILTERS_CONDITIONS_CONTAINS:function(){return ea},FILTERS_CONDITIONS_EMPTY:function(){return et},FILTERS_CONDITIONS_ENDS_WITH:function(){return es},FILTERS_CONDITIONS_EQUAL:function(){return ei},FILTERS_CONDITIONS_GREATER_THAN:function(){return eu},FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:function(){return ec},FILTERS_CONDITIONS_LESS_THAN:function(){return ed},FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:function(){return eg},FILTERS_CONDITIONS_NAMESPACE:function(){return J},FILTERS_CONDITIONS_NONE:function(){return ee},FILTERS_CONDITIONS_NOT_BETWEEN:function(){return ef},FILTERS_CONDITIONS_NOT_CONTAIN:function(){return el},FILTERS_CONDITIONS_NOT_EMPTY:function(){return er},FILTERS_CONDITIONS_NOT_EQUAL:function(){return en},FILTERS_CONDITIONS_TODAY:function(){return ev},FILTERS_CONDITIONS_TOMORROW:function(){return ew},FILTERS_CONDITIONS_YESTERDAY:function(){return eE},FILTERS_DIVS_FILTER_BY_CONDITION:function(){return eS},FILTERS_DIVS_FILTER_BY_VALUE:function(){return eC},FILTERS_LABELS_CONJUNCTION:function(){return eR},FILTERS_LABELS_DISJUNCTION:function(){return eb},FILTERS_NAMESPACE:function(){return Q},FILTERS_VALUES_BLANK_CELLS:function(){return eT},LOADING_NAMESPACE:function(){return ez},LOADING_TITLE:function(){return eY},OK:function(){return n},PAGINATION_COUNTER_SECTION:function(){return eH},PAGINATION_FIRST_PAGE:function(){return eF},PAGINATION_LAST_PAGE:function(){return eW},PAGINATION_NAMESPACE:function(){return eP},PAGINATION_NAV_SECTION:function(){return eB},PAGINATION_NEXT_PAGE:function(){return eU},PAGINATION_PAGE_SIZE_AUTO:function(){return ek},PAGINATION_PAGE_SIZE_SECTION:function(){return eD},PAGINATION_PREV_PAGE:function(){return eV},PAGINATION_SECTION:function(){return eL}});let i="Common:",n=`${i}ok`,o=`${i}cancel`,s="ContextMenu:items",a=`${s}.noItems`,l=`${s}.insertRowAbove`,h=`${s}.insertRowBelow`,u=`${s}.insertColumnOnTheLeft`,c=`${s}.insertColumnOnTheRight`,d=`${s}.removeRow`,g=`${s}.removeColumn`,p=`${s}.undo`,f=`${s}.redo`,m=`${s}.readOnly`,y=`${s}.clearColumn`,w=`${s}.copy`,E=`${s}.copyWithHeaders`,S=`${s}.copyWithGroupHeaders`,C=`${s}.copyHeadersOnly`,R=`${s}.cut`,b=`${s}.freezeColumn`,T=`${s}.unfreezeColumn`,N=`${s}.mergeCells`,A=`${s}.unmergeCells`,I=`${s}.addComment`,M=`${s}.editComment`,O=`${s}.removeComment`,x=`${s}.readOnlyComment`,_=`${s}.align`,P=`${s}.align.left`,L=`${s}.align.center`,k=`${s}.align.right`,D=`${s}.align.justify`,H=`${s}.align.top`,B=`${s}.align.middle`,F=`${s}.align.bottom`,V=`${s}.borders`,U=`${s}.borders.top`,W=`${s}.borders.right`,j=`${s}.borders.bottom`,G=`${s}.borders.left`,$=`${s}.borders.remove`,z=`${s}.nestedHeaders.insertChildRow`,Y=`${s}.nestedHeaders.detachFromParent`,K=`${s}.hideColumn`,X=`${s}.showColumn`,q=`${s}.hideRow`,Z=`${s}.showRow`,Q="Filters:",J=`${Q}conditions`,ee=`${J}.none`,et=`${J}.isEmpty`,er=`${J}.isNotEmpty`,ei=`${J}.isEqualTo`,en=`${J}.isNotEqualTo`,eo=`${J}.beginsWith`,es=`${J}.endsWith`,ea=`${J}.contains`,el=`${J}.doesNotContain`,eh=`${J}.byValue`,eu=`${J}.greaterThan`,ec=`${J}.greaterThanOrEqualTo`,ed=`${J}.lessThan`,eg=`${J}.lessThanOrEqualTo`,ep=`${J}.isBetween`,ef=`${J}.isNotBetween`,em=`${J}.after`,ey=`${J}.before`,ev=`${J}.today`,ew=`${J}.tomorrow`,eE=`${J}.yesterday`,eS=`${Q}labels.filterByCondition`,eC=`${Q}labels.filterByValue`,eR=`${Q}labels.conjunction`,eb=`${Q}labels.disjunction`,eT=`${Q}values.blankCells`,eN=`${Q}buttons.selectAll`,eA=`${Q}buttons.clear`,eI=`${Q}buttons.ok`,eM=`${Q}buttons.cancel`,eO=`${Q}buttons.placeholder.search`,ex=`${Q}buttons.placeholder.value`,e_=`${Q}buttons.placeholder.secondValue`,eP="Pagination:",eL=`${eP}section.pagination`,ek=`${eP}.pageSize.auto`,eD=`${eP}section.pageSize`,eH=`${eP}section.counter`,eB=`${eP}section.navigation`,eF=`${eP}firstPage`,eV=`${eP}prevPage`,eU=`${eP}nextPage`,eW=`${eP}lastPage`,ej="CheckboxRenderer:",eG=`${ej}checked`,e$=`${ej}unchecked`,ez="Loading:",eY=`${ez}title`,eK="EmptyDataState:",eX=`${eK}title`,eq=`${eK}description`,eZ=`${eK}title.filters`,eQ=`${eK}description.filters`,eJ=`${eK}buttons.filters.reset`},9732:function(e,t,r){"use strict";r.d(t,{Zs:function(){return d},qG:function(){return E},vq:function(){return C},vk:function(){return R},gr:function(){return b},RY:function(){return S},MG:function(){return w}}),r(70470),r(85411);var i=r(92263),n=r(21927),o=r(43779),s=r(14216);r(17901);var a=r(60049);let{register:l,getValues:h}=(0,s.Qv)("phraseFormatters");l("pluralize",function(e,t){return Array.isArray(e)&&Number.isInteger(t)?e[t]:e}),l("substitute",function e(t,r){return Array.isArray(t)?t.map(t=>e(t,r)):(0,a.substitute)(t,r)});var u=r(2178);let c={languageCode:"en-US",[u.OK]:"OK",[u.CANCEL]:"Cancel",[u.CONTEXTMENU_ITEMS_NO_ITEMS]:"No available options",[u.CONTEXTMENU_ITEMS_ROW_ABOVE]:"Insert row above",[u.CONTEXTMENU_ITEMS_ROW_BELOW]:"Insert row below",[u.CONTEXTMENU_ITEMS_INSERT_LEFT]:"Insert column left",[u.CONTEXTMENU_ITEMS_INSERT_RIGHT]:"Insert column right",[u.CONTEXTMENU_ITEMS_REMOVE_ROW]:["Remove row","Remove rows"],[u.CONTEXTMENU_ITEMS_REMOVE_COLUMN]:["Remove c
26olumn","Remove columns"],[u.CONTEXTMENU_ITEMS_UNDO]:"Undo",[u.CONTEXTMENU_ITEMS_REDO]:"Redo",[u.CONTEXTMENU_ITEMS_READ_ONLY]:"Read only",[u.CONTEXTMENU_ITEMS_CLEAR_COLUMN]:"Clear column",[u.CONTEXTMENU_ITEMS_ALIGNMENT]:"Alignment",[u.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT]:"Left",[u.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER]:"Center",[u.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT]:"Right",[u.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY]:"Justify",[u.CONTEXTMENU_ITEMS_ALIGNMENT_TOP]:"Top",[u.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE]:"Middle",[u.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM]:"Bottom",[u.CONTEXTMENU_ITEMS_FREEZE_COLUMN]:"Freeze column",[u.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN]:"Unfreeze column",[u.CONTEXTMENU_ITEMS_BORDERS]:"Borders",[u.CONTEXTMENU_ITEMS_BORDERS_TOP]:"Top",[u.CONTEXTMENU_ITEMS_BORDERS_RIGHT]:"Right",[u.CONTEXTMENU_ITEMS_BORDERS_BOTTOM]:"Bottom",[u.CONTEXTMENU_ITEMS_BORDERS_LEFT]:"Left",[u.CONTEXTMENU_ITEMS_REMOVE_BORDERS]:"Remove border(s)",[u.CONTEXTMENU_ITEMS_ADD_COMMENT]:"Add comment",[u.CONTEXTMENU_ITEMS_EDIT_COMMENT]:"Edit comment",[u.CONTEXTMENU_ITEMS_REMOVE_COMMENT]:"Delete comment",[u.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT]:"Read-only comment",[u.CONTEXTMENU_ITEMS_MERGE_CELLS]:"Merge cells",[u.CONTEXTMENU_ITEMS_UNMERGE_CELLS]:"Unmerge cells",[u.CONTEXTMENU_ITEMS_COPY]:"Copy",[u.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS]:["Copy with header","Copy with headers"],[u.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS]:["Copy with group header","Copy with group headers"],[u.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY]:["Copy header only","Copy headers only"],[u.CONTEXTMENU_ITEMS_CUT]:"Cut",[u.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD]:"Insert child row",[u.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD]:"Detach from parent",[u.CONTEXTMENU_ITEMS_HIDE_COLUMN]:["Hide column","Hide columns"],[u.CONTEXTMENU_ITEMS_SHOW_COLUMN]:["Show column","Show columns"],[u.CONTEXTMENU_ITEMS_HIDE_ROW]:["Hide row","Hide rows"],[u.CONTEXTMENU_ITEMS_SHOW_ROW]:["Show row","Show rows"],[u.FILTERS_CONDITIONS_NONE]:"None",[u.FILTERS_CONDITIONS_EMPTY]:"Is empty",[u.FILTERS_CONDITIONS_NOT_EMPTY]:"Is not empty",[u.FILTERS_CONDITIONS_EQUAL]:"Is equal to",[u.FILTERS_CONDITIONS_NOT_EQUAL]:"Is not equal to",[u.FILTERS_CONDITIONS_BEGINS_WITH]:"Begins with",[u.FILTERS_CONDITIONS_ENDS_WITH]:"Ends with",[u.FILTERS_CONDITIONS_CONTAINS]:"Contains",[u.FILTERS_CONDITIONS_NOT_CONTAIN]:"Does not contain",[u.FILTERS_CONDITIONS_GREATER_THAN]:"Greater than",[u.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL]:"Greater than or equal to",[u.FILTERS_CONDITIONS_LESS_THAN]:"Less than",[u.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL]:"Less than or equal to",[u.FILTERS_CONDITIONS_BETWEEN]:"Is between",[u.FILTERS_CONDITIONS_NOT_BETWEEN]:"Is not between",[u.FILTERS_CONDITIONS_AFTER]:"After",[u.FILTERS_CONDITIONS_BEFORE]:"Before",[u.FILTERS_CONDITIONS_TODAY]:"Today",[u.FILTERS_CONDITIONS_TOMORROW]:"Tomorrow",[u.FILTERS_CONDITIONS_YESTERDAY]:"Yesterday",[u.FILTERS_VALUES_BLANK_CELLS]:"Blank cells",[u.FILTERS_DIVS_FILTER_BY_CONDITION]:"Filter by condition",[u.FILTERS_DIVS_FILTER_BY_VALUE]:"Filter by value",[u.FILTERS_LABELS_CONJUNCTION]:"And",[u.FILTERS_LABELS_DISJUNCTION]:"Or",[u.FILTERS_BUTTONS_SELECT_ALL]:"Select all",[u.FILTERS_BUTTONS_CLEAR]:"Clear",[u.FILTERS_BUTTONS_OK]:"OK",[u.FILTERS_BUTTONS_CANCEL]:"Cancel",[u.FILTERS_BUTTONS_PLACEHOLDER_SEARCH]:"Search",[u.FILTERS_BUTTONS_PLACEHOLDER_VALUE]:"Value",[u.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE]:"Second value",[u.PAGINATION_SECTION]:"Pagination",[u.PAGINATION_PAGE_SIZE_SECTION]:"Page size",[u.PAGINATION_PAGE_SIZE_AUTO]:"Auto",[u.PAGINATION_COUNTER_SECTION]:"[start] - [end] of [total]",[u.PAGINATION_NAV_SECTION]:"Page [currentPage] of [totalPages]",[u.PAGINATION_FIRST_PAGE]:"Go to first page",[u.PAGINATION_PREV_PAGE]:"Go to previous page",[u.PAGINATION_NEXT_PAGE]:"Go to next page",[u.PAGINATION_LAST_PAGE]:"Go to last page",[u.CHECKBOX_CHECKED]:"Checked",[u.CHECKBOX_UNCHECKED]:"Unchecked",[u.LOADING_TITLE]:"Loading...",[u.EMPTY_DATA_STATE_TITLE]:"No data available",[u.EMPTY_DATA_STATE_DESCRIPTION]:"There’s nothing to display yet.",[u.EMPTY_DATA_STATE_TITLE_FILTERS]:"No results found",[u.EMPTY_DATA_STATE_DESCRIPTION_FILTERS]:"It looks like your current filters are hiding all results.",[u.EMPTY_DATA_STATE_BUTTONS_FILTERS_RESET]:"Reset filters"},d=u,g=c.languageCode,{register:p,getItem:f,hasItem:m,getValues:y}=(0,s.Qv)("languagesDictionaries");function w(e,t){var r,n;let s=e,a=t;return(0,i.isObject)(e)&&(s=(a=e).languageCode),r=s,n=a,r!==g&&(0,o.eb)(n,f(g)),p(s,(0,i.deepClone)(a)),(0,i.deepClone)(a)}function E(e){return m(e)?(0,i.deepClone)(f(e)):null}function S(e){return m(e)}function C(){return y()}function R(e,t,r){let i=E(e);if(null===i)return null;let o=i[t];if((0,n.isUndefined)(o))return null;let s=h().reduce((e,t)=>
26t(e,r),o);return Array.isArray(s)?s[0]:s}function b(e){let t=(0,o.TH)(e);return m(t)||(t=g,(0,o.Vn)(e)),t}w(c)},43779:function(e,t,r){"use strict";r.d(t,{TH:function(){return l},Vn:function(){return h},eb:function(){return a}});var i=r(21927),n=r(92263),o=r(26247),s=r(80600);function a(e,t){return(0,n.objectEach)(t,(t,r)=>{(0,i.isUndefined)(e[r])&&(e[r]=t)}),e}function l(e){let t=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(e);return t?`${t[1].toLowerCase()}-${t[2].toUpperCase()}`:e}function h(e){(0,i.isDefined)(e)&&(0,o.vU)((0,s.e)`Language with code "${e}" was not found. You should register particular language\x20
27    before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}},15239:function(e,t,r){"use strict";r.d(t,{ZP:function(){return L}});var i,n,o,s,a,l=r(43857),h=r(75701),u=r(77882),c=r(98014);r(76346);var d=r(38005),g=r(81146),p=r(22386),f=r(66327),m=r(24697),y=r(56751),w=r(13066),E=r(37710),S=r(21927),C=r(47771),R=r(92263),b=r(60049),T=r(79341),N=r(46879),A=r(9190),I=r(65187),M=r(26595),O=r(92809),x=r(26212),_=r(98282),P=r(87385);(0,h.t9)(),function(e){let t="undefined"!=typeof window&&window.jQuery;t&&(t.fn.handsontable=function(t){let r;let i=this.first(),n=i.data("handsontable");if("string"!=typeof t){let r=t||{};return n?n.updateSettings(r):(n=new e.Core(i[0],r),i.data("handsontable",n),n.init()),i}if(n){if(void 0!==n[t]){for(var o=arguments.length,s=Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];r=n[t].call(n,...s),"destroy"===t&&i.removeData()}else throw Error(`Handsontable do not provide action: ${t}`)}return r})}(l.ZP),l.ZP.__GhostTable=d.Z,l.ZP._getListenersCounter=u.k,l.ZP._getRegisteredMapsCounter=c.P,l.ZP.EventManager=u.Z,l.ZP.helper={},l.ZP.dom={},p.arrayEach([p,f,m,y,w,E,S,C,R,b,T,g],e=>{p.arrayEach(Object.getOwnPropertyNames(e),t=>{"_"!==t.charAt(0)&&(l.ZP.helper[t]=e[t])})}),p.arrayEach([N,A],e=>{p.arrayEach(Object.getOwnPropertyNames(e),t=>{"_"!==t.charAt(0)&&(l.ZP.dom[t]=e[t])})}),l.ZP.cellTypes=null!==(i=l.ZP.cellTypes)&&void 0!==i?i:{},p.arrayEach((0,x.pH)(),e=>{l.ZP.cellTypes[e]=(0,x.DA)(e)}),l.ZP.cellTypes.registerCellType=x.xN,l.ZP.cellTypes.getCellType=x.DA,l.ZP.editors=null!==(n=l.ZP.editors)&&void 0!==n?n:{},p.arrayEach((0,I._f)(),e=>{l.ZP.editors[`${b.toUpperCaseFirst(e)}Editor`]=(0,I.y$)(e)}),l.ZP.editors.registerEditor=I.qm,l.ZP.editors.getEditor=I.y$,l.ZP.renderers=null!==(o=l.ZP.renderers)&&void 0!==o?o:{},p.arrayEach((0,M.LX)(),e=>{let t=(0,M.Bp)(e);"base"===e&&(l.ZP.renderers.cellDecorator=t),l.ZP.renderers[`${b.toUpperCaseFirst(e)}Renderer`]=t}),l.ZP.renderers.registerRenderer=M.zn,l.ZP.renderers.getRenderer=M.Bp,l.ZP.validators=null!==(s=l.ZP.validators)&&void 0!==s?s:{},p.arrayEach((0,O.k_)(),e=>{l.ZP.validators[`${b.toUpperCaseFirst(e)}Validator`]=(0,O.Te)(e)}),l.ZP.validators.registerValidator=O.Ie,l.ZP.validators.getValidator=O.Te,l.ZP.plugins=null!==(a=l.ZP.plugins)&&void 0!==a?a:{},p.arrayEach((0,_.a9)(),e=>{l.ZP.plugins[e]=(0,_.s3)(e)}),l.ZP.plugins[`${b.toUpperCaseFirst(P.vq.PLUGIN_KEY)}Plugin`]=P.vq,l.ZP.plugins.registerPlugin=_.fo,l.ZP.plugins.getPlugin=_.s3;var L=l.ZP},65166:function(e,t,r){"use strict";r(65230);var i=r(92263),n=r(37710);let o={_localHooks:Object.create(null),addLocalHook(e,t){return this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t),this},removeLocalHook(e,t){if(this._localHooks[e]){let r=this._localHooks[e].indexOf(t);r>-1&&this._localHooks[e].splice(r,1)}return this},runLocalHooks(e,t,r,i,o,s,a){if(this._localHooks[e]){let l=this._localHooks[e].length;for(let h=0;h<l;h++)(0,n.fastCall)(this._localHooks[e][h],this,t,r,i,o,s,a)}},clearLocalHooks(){return this._localHooks={},this}};(0,i.defineGetter)(o,"MIXIN_NAME","localHooks",{writable:!1,enumerable:!1}),t.Z=o},87385:function(e,t,r){"use strict";r.d(t,{Ur:function(){return E},vq:function(){return N}}),r(76346),r(65230),r(70470),r(95984),r(17901);
27var i=r(92263),n=r(22386),o=r(98282),s=r(26212),a=r(65187),l=r(26595),h=r(92809),u=r(77882),c=r(26247);function d(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g(e,t,r){p(e,t),t.set(e,r)}function p(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function f(e,t,r){return e.set(y(e,t),r),r}function m(e,t){return e.get(y(e,t))}function y(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let w=new Map([["plugin",o._j],["cell-type",s.V1],["editor",a.Wu],["renderer",l.Y3],["validator",h.oh]]),E=Symbol("mainSetting"),S=[],C=null;var R=new WeakMap,b=new WeakMap,T=new WeakSet;class N{static get PLUGIN_KEY(){return"base"}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}static get SETTINGS_VALIDATORS(){return null}constructor(e){p(this,T),T.add(this),g(this,R,null),d(this,"eventManager",new u.Z(this)),d(this,"pluginName",null),d(this,"pluginsInitializedCallbacks",[]),d(this,"isPluginsReady",!1),d(this,"enabled",!1),d(this,"initialized",!1),g(this,b,{}),(0,i.defineGetter)(this,"hot",e,{writable:!1}),C=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",e=>this.onUpdateSettings(e)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this),this.updatePluginSettings(this.hot.getSettings()[this.constructor.PLUGIN_KEY]);let e=this.constructor.PLUGIN_DEPS,t=Array.isArray(e)?e:[];if(t.length>0){let e=[];
27if(t.forEach(t=>{let[r,i]=t.split(":");if(!w.has(r))throw Error(`Unknown plugin dependency type "${r}" was found.`);w.get(r)(i)||e.push(` - ${i} (${r})`)}),e.length>0){let t=`The ${this.pluginName} plugin requires the following modules:
28${e.join("\n")}
29`;S.push(t)}}if(C||(C=(0,o.a9)()),C.indexOf(this.pluginName)>=0&&C.splice(C.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),0===C.length){if(S.length>0){let e=`${S.join("\n")}
30You have to import and register them manually.`;throw S.length=0,Error(e)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;null===(e=this.eventManager)||void 0===e||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){let t;var r,n=this;let o=this.constructor.DEFAULT_SETTINGS,s=this.constructor.SETTINGS_VALIDATORS;if(void 0===e)return(0,i.isObject)(m(R,this))?(0,i.assignObjectDefaults)(m(R,this),o):m(R,this);if((Array.isArray(m(R,this))||(0,i.isObject)(m(R,this)))&&o[E]===e)t=Array.isArray(m(R,this))?m(R,this):null!==(r=m(R,this)[e])&&void 0!==r?r:o[e];else if(e.includes(".")){let r=(0,i.getProperty)(m(R,this),e),n=(0,i.getProperty)(o,e);t=(0,i.isObject)(r)?(0,i.assignObjectDefaults)(r,n):void 0!==r?r:n}else t=(0,i.isObject)(m(R,this))?(0,i.assignObjectDefaults)(m(R,this),o)[e]:o[e];if("function"==typeof t&&s&&"object"==typeof s){let r=s[e];if(r&&"function"==typeof r)return function(){for(var i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];let a=t(...o);if(!1===r(a)){let t=o.map(e=>"string"==typeof e?`"${e}"`:"").join(", "),r=o.length>0?t:"";(0,c.ZK)(`${n.pluginName} Plugin: "${e}" function (${r}) result \
31               is not valid and will be ignored.`);return}return a}}return t}updatePluginSettings(e){let t=this.constructor.SETTINGS_VALIDATORS;if(t&&"function"==typeof t&&"object"!=typeof e){if(!1===t(e)){(0,c.ZK)(`${this.pluginName} Plugin: option is not valid and it will be ignored.`);return}return f(R,this,e),m(R,this)}return t&&"object"==typeof t&&"object"==typeof e?((null===m(R,this)||"object"!=typeof m(R,this))&&f(R,this,{...this.constructor.DEFAULT_SETTINGS}),Object.keys(t).forEach(r=>{if(!(r in e))return;let i=t[r];if(!1===(!i||i(e[r]))){(0,c.ZK)(`${this.pluginName} Plugin: "${r}" option is not valid and it will be ignored.`);return}m(R,this)[r]=e[r]}),m(R,this)):(f(R,this,e),e)}addHook(e,t,r){m(b,this)[e]=m(b,this)[e]||[];let i=m(b,this)[e];this.hot.addHook(e,t,r),i.push(t),m(b,this)[e]=i}removeHooks(e){(0,n.arrayEach)(m(b,this)[e]||[],t=>{this.hot.removeHook(e,t)})}clearHooks(){let e=m(b,this);(0,i.objectEach)(e,(e,t)=>this.removeHooks(t)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){(0,n.arrayEach)(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){let t=y(T,this,A).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&t&&(this.updatePluginSettings(e[this.constructor.PLUGIN_KEY]),this.updatePlugin(e)))}updatePlugin(){}destroy(){var e;f(R,this,null),null===(e=this.eventManager)||void 0===e||e.destroy(),this.clearHooks(),(0,i.objectEach)(this,(e,t)=>{"hot"!==t&&(this[t]=null)}),delete this.t,delete this.hot}}function A(e){if(!e)return!1;let t=this.constructor.SETTING_KEYS;if("boolean"==typeof t)return t;for(let r=0;r<t.length;r++)if(void 0!==e[t[r]])return!0;return!1}},98282:function(e,t,r){"use strict";r.d(t,{s3:function(){return m},a9:function(){return f},_j:function(){return y},fo:function(){return w}}),r(76346);var i=r(60049);r(70470),r(17901);var n=r(47771),o=r(37710);let s=new Map([["asc",[-1,1]],["desc",[1,-1]]]),a=e=>`The priority '${e}' is already declared in a map.`,l=e=>`The priority '${e}' is not a number.`;var h=r(94896);r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975);let u=e=>`'${e}' value is already declared in a unique set.`,c=e=>`There is already registered "${e}" plugin.`,d=function(){let{errorPriorityExists:e,errorPriorityNaN:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new Map;return e=(0,o.isFunction)(e)?e:a,t=(0,o.isFunction)(t)?t:l,{addItem:function(i,o){if(!(0,n.isNumeric)(i))throw Error(t(i));if(r.has(i))throw Error(e(i));r.set(i,o)},getItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"asc",[t,i]=s.get(e)||s.get("asc");return[...r].sort((e,r)=>e[0]<r[0]?t:i).map(e=>e[1])}}}({errorPriorityExists:e=>`There is already registered plugin on priority "${e}".`,errorPriorityNaN:e=>`The priority "${e}" is not a number.`}),g=function(){let{errorItemExists:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Set;return e=(0,o.isFunction)(e)?e:u,{addItem:function(r){if(t.has(r))throw Error(e(r));t.add(r)},clear:function(){t.clear()},getItems:function(){return[...t]}}}({errorItemExists:c}),p=(0,h.I)({errorIdExists:c});function f(){return[...d.getItems(),...g.getItems()]}function m(e){let t=(0,i.toUpperCaseFirst)(e);return p.getItem(t)}function y(e){return!!m(e)}function w(e,t,r){var n,o,s;[e,t,r]=(n=e,o=t,s=r,"function"==typeof n&&(n=(o=n).PLUGIN_KEY,s=o.PLUGIN_PRIORITY),[n,o,s]),void 0===m(e)&&function(e,t,r){let n=(0,i.toUpperCaseFirst)(e);if(p.hasItem(n))throw Error(c(n));void 0===r?g.addItem(n):d.addItem(r,n),p.addItem(n,t)}(e,t,r)}},75701:function(e,t,r){"use strict";r.d(t,{t9:function(){return wK}}),r(76346),r(65230),r(44174),r(70470),r(11898),r(52419),r(88514),r(17901),r(85411);var i=r(58805),n=r(46879),o=r(9190),s=r(92263),a=r(20386);function l(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let h="handsontableEditor";class u extends i.H{constructor(){super(...arguments),l(this,"isFlippedVertically",!1),l(this,"isFlippedHorizontally",!1)}static get EDITOR_TYPE(){return"handsontable"}open(){super.open();let e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),"none"===e.display&&(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(),(0,n.setCaretPosition)(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getTargetDropdownWidth(),height:this.getTargetDropdownHeight()}),this.refreshDimensions(),this.flipDropdownVerticallyIfNeeded(),this.flipDropdownHorizontallyIfNeeded()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,t,r,i,n,o){super.prepare(e,t,r,i,n,o);let 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(e,t){let r=this.getSourceData(t.row,t.col);void 0!==r&&a.setValue(r),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&(0,s.extend)(l,o.handsontable),this.htOptions=l}beginEditing(e,t){let r=this.hot.getSettings().onBeginEditing;r&&!1===r()||super.beginEditing(e,t)}createElements(){super.createElements();let e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,t,r){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedActive()){let e=this.htEditor.getValue();void 0!==e&&this.setValue(e)}super.finishEditing(e,t,r)}flipDropdownVerticallyIfNeeded(){let{view:e}=this.hot,t=this.getEditedCellRect(),r=t.top;e.isVerticallyScrollableByWindow()&&(r=Math.max(r+(e.getTableOffset().top-this.hot.rootWindow.scrollY),0));let i=this.getDropdownHeight(),n=e.getWorkspaceHeight()-r-t.height,o=i>n&&r>n+t.height;return o?this.flipDropdownVertically():this.unflipDropdownVertically(),{isFlipped:o,spaceAbove:r,spaceBelow:n}}flipDropdownVertically(){let e=this.htEditor.rootElement.style;e.position="absolute",e.top=`${-this.getDropdownHeight()}px`,this.isFlippedVertically=!0}unflipDropdownVertically(){let e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.isFlippedVertically=!1}flipDropdownHorizontallyIfNeeded(){let{view:e}=this.hot,t=this.getEditedCellRect(),r=t.start+t.width;e.isHorizontallyScrollableByWindow()&&(r=Math.max(r+(e.getTableOffset().left-this.hot.rootWindow.scrollX),0));let i=this.getDropdownWidth(),n=e.getWorkspaceWidth()-r+t.width,o=i>n&&r>n;return o?this.flipDropdownHorizontally():this.unflipDropdownHorizontally(),{isFlipped:o,spaceInlineStart:r,spaceInlineEnd:n}}flipDropdownHorizontally(){let e=this.htEditor.rootElement.style,{width:t}=this.getEditedCellRect();e.position="absolute",e[this.hot.isRtl()?"right":"left"]=`${-(this.getDropdownWidth()-t)}px`,this.isFlippedHorizontally=!0}unflipDropdownHorizontally(){let e=this.htEditor.rootElement.style;e.position="absolute",e[this.hot.isRtl()?"right":"left"]="",this.isFlippedHorizontally=!1}getDropdownHeight(){return this.htEditor.getTableHeight()}getDropdownWidth(){return this.htEditor.getTableWidth()}getTargetDropdownWidth(){return this.htEditor.view.getTableWidth()}getTargetDropdownHeight(){return this.htEditor.view.getTableHeight()+1}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;null===(e=this.htEditor)||void 0===e||e.destroy()}),this.hot.addHook("afterSetTheme",(e,t)=>{t||this.close()})}registerShortcuts(){let e=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();let t={group:h,relativeToGroup:a.II,position:"before"},r=(e,t)=>{let r=this.htEditor;if(void 0!==e&&(e<0||this.isFlippedVertically&&e>r.countRows()-1?r.deselectCell():r.selectCell(e,0),r.getData().length))return t.preventDefault(),(0,o.stopImmediatePropagation)(t),this.hot.listen(),this.TEXTAREA.focus(),!1};e.addShortcuts([{keys:[["ArrowUp"]],callback:e=>{let t;let i=this.htEditor;
31return!i.getSelectedActive()&&this.isFlippedVertically?t=i.countRows()-1:i.getSelectedActive()&&(t=this.isFlippedVertically?Math.max(0,i.getSelectedActive()[0]-1):i.getSelectedActive()[0]-1),r(t,e)},preventDefault:!1},{keys:[["ArrowDown"]],callback:e=>{let t;let i=this.htEditor;return i.getSelectedActive()||this.isFlippedVertically?i.getSelectedActive()&&(this.isFlippedVertically?t=i.getSelectedActive()[0]+1:this.isFlippedVertically||(t=Math.min(i.countRows()-1,i.getSelectedActive()[0]+1))):t=0,r(t,e)},preventDefault:!1}],t)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(h)}}var c=r(22386),d=r(21927),g=r(60049),p=r(79341),f=r(48463),m=r(65839),y=r(37710);function w(e,t,r){E(e,t),t.set(e,r)}function E(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function S(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(e,t){return e.get(R(e,t))}function R(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var b=new WeakMap,T=new WeakMap,N=new WeakSet;class A extends u{constructor(){super(...arguments),E(this,N),N.add(this),S(this,"query",null),S(this,"strippedChoices",[]),S(this,"rawChoices",[]),w(this,b,this.hot.guid.slice(0,9)),w(this,T,(0,y.debounce)(()=>{this.focus()},100))}static get EDITOR_TYPE(){return"autocomplete"}getValue(){let e=this.rawChoices.find(e=>{let t=this.stripValueIfNeeded(e);return(R(N,this,M).call(this,t)?t.value:t)===this.TEXTAREA.value});return(0,d.isDefined)(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),(0,n.addClass)(this.htContainer,"autocompleteEditor"),(0,n.addClass)(this.htContainer,-1===this.hot.rootWindow.navigator.platform.indexOf("Mac")?"":"htMacScroll"),this.hot.getSettings().ariaTags&&(0,n.setAttribute)(this.TEXTAREA,[(0,m.Nr)(),(0,m.LO)(),(0,m.fv)("listbox"),(0,m.zV)()])}prepare(e,t,r,i,o,s){super.prepare(e,t,r,i,o,s),this.hot.getSettings().ariaTags&&(0,n.setAttribute)(this.TEXTAREA,[(0,m.JV)("false"),(0,m.d)(`${C(b,this)}-listbox-${e}-${t}`)]),this.htOptions={...this.htOptions,valueGetter:e=>R(N,this,M).call(this,e)?e.value:e}}open(){super.open();let e=void 0===this.cellProperties.trimDropdown||this.cellProperties.trimDropdown,t=this.hot.getSettings().ariaTags,r=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=null==r?void 0:r.length,{row:o,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",e=>this.onBeforeKeyDown(e)),this.htEditor.addHook("afterScroll",C(T,this)),this.htEditor.updateSettings({colWidths:e?[(0,n.outerWidth)(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(e,o,s,a,l,h,u)=>{let c,g;(0,f.V)(e,o,s,a,l,h,u);let{filteringCaseSensitive:p,allowHtml:y,locale:w}=this.cellProperties,E=this.query,S=(0,d.stringify)(h);S&&!y&&-1!==(c=!0===p?S.indexOf(E):S.toLocaleLowerCase(w).indexOf(E.toLocaleLowerCase(w)))&&(g=S.substr(c,E.length),S=S.replace(g,`<strong>${g}</strong>`)),t&&(0,n.setAttribute)(o,[(0,m.Nl)(),...r?[(0,m.DT)(i)]:[],...r?[(0,m.jH)(r.indexOf(h)+1)]:[],["id",`${this.htEditor.rootElement.id}_${s}-${a}`]]),o.innerHTML=S},afterSelectionEnd:(e,r)=>{if(t){let t=e=>{(0,n.setAttribute)(e,[(0,m.Ak)()]),(0,n.setAttribute)(this.TEXTAREA,...(0,m.nT)(e.id))},i=this.htEditor.getCell(e,r,!0);null!==i?t(i):this.htEditor.addHookOnce("afterScrollVertically",()=>{t(this.htEditor.getCell(e,r,!0))})}}}),t&&((0,n.setAttribute)(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...(0,m.Rn)()),(0,n.setAttribute)(this.htEditor.rootElement,[(0,m.a6)(),(0,m.Ez)("polite"),(0,m.Up)("text"),["id",`${C(b,this)}-listbox-${o}-${s}`]]),(0,n.setAttribute)(this.TEXTAREA,...(0,m.JV)("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&(0,n.setAttribute)(this.TEXTAREA,[(0,m.JV)("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}finishEditing(e,t,r){if(this.isOpened()){let t=this.hot.getSelectedRangeActive();((0,d.isUndefined)(t)||(0,d.isDefined)(t)&&!t.includes(this.hot._createCellCoords(this.row,this.col)))&&(e=!0)}super.finishEditing(e,t,r)}queryChoices(e){let t=this.cellProperties.source;this.query=e,"function"==typeof t?t.call(this.cellProperties,e,e=>{this.rawChoices=e,this.updateChoicesList(this.stripValuesIfNeeded(e))}):Array.isArray(t)?(this.rawChoices=t,this.updateChoicesList(this.stripValuesIfNeeded(t))):this.updateChoicesList([])}updateChoicesList(e){let t=(0,n.getCaretPosition)(this.TEXTAREA),r=(0,n.getSelectionEndPosition)(this.TEXTAREA),i=this.cellProperties.sortByRelevance,o=this.cellProperties.filter,s=this.stripValueIfNeeded(this.getValue()),a=R(N,this,M).call(this,s)?s.value:s,l=null,h=e;i||(h=h.toSorted());let u=[],p=this.cellProperties.locale,f=this.cellProperties.filteringCaseSensitive,m=f?a:a.toLocaleLowerCase(p);for(let e=0;e<h.length;e++){let t=R(N,this,M).call(this,h[e])?(0,g.stripTags)((0,d.stringify)(h[e].value)):(0,g.stripTags)((0,d.stringify)(h[e]));
31if(-1!==(f?t:t.toLocaleLowerCase(p)).indexOf(m)&&(u.push(e),!1===o))break}!1===o?s.length>0&&(l=u[0]):l=(h=u.map(e=>h[e])).indexOf(m)>-1?h.indexOf(m):0,this.strippedChoices=h,0===h.length?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData((0,c.pivot)([h])),h.length>0&&(this.updateDropdownDimensions(),this.flipDropdownVerticallyIfNeeded(),!0===this.cellProperties.strict&&this.highlightBestMatchingChoice(l)),this.hot.listen(),(0,n.setCaretPosition)(this.TEXTAREA,t,t===r?void 0:r)}flipDropdownVerticallyIfNeeded(){let e=super.flipDropdownVerticallyIfNeeded(),{isFlipped:t,spaceAbove:r,spaceBelow:i}=e;return this.limitDropdownIfNeeded(t?r:i),e}limitDropdownIfNeeded(e){let t=this.getDropdownHeight();if(t>e){let r=0,i=0,n=null;do r+=i=this.htEditor.stylesHandler.getDefaultRowHeight();while(r<e);n=r-i,this.isFlippedVertically&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+t-n}px`),this.setDropdownHeight(r-i)}}updateDropdownDimensions(){let e=(0,n.getFractionalScalingCompensation)(),t=this.getTargetEditorWidth()+e,r=this.getTargetEditorHeight()+e;this.htEditor.updateSettings({width:t,height:r}),R(N,this,I).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),R(N,this,I).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){"number"==typeof e?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getTargetEditorHeight(){let e=0;if(!this.hot.getCurrentThemeName()){let t=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore"));e=parseInt(t.borderTopWidth,10)+parseInt(t.borderBottomWidth,10)}return Array.from({length:Math.min(this.cellProperties.visibleRows,this.strippedChoices.length)},(e,t)=>t).reduce((e,t)=>e+(this.hot.stylesHandler.getDefaultRowHeight()+(0===t?1:0)),0)+e}getTargetEditorWidth(){let e=0;if(!this.hot.getCurrentThemeName()){let t=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore"));e=parseInt(t.borderInlineStartWidth,10)+parseInt(t.borderInlineEndWidth,10)}return this.htEditor.getColWidth(0)+e}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){let{allowHtml:t}=this.cellProperties,r=e=>(0,d.stringify)(t?e:(0,g.stripTags)(e));return e.every(e=>R(N,this,M).call(this,e))?e.map(e=>({key:r(e.key),value:r(e.value)})):e.map(e=>r(e))}onBeforeKeyDown(e){if((0,p.isPrintableChar)(e.keyCode)||e.keyCode===p.KEY_CODES.BACKSPACE||e.keyCode===p.KEY_CODES.DELETE||e.keyCode===p.KEY_CODES.INSERT){let t=10;e.keyCode===p.KEY_CODES.C&&(e.ctrlKey||e.metaKey)||(this.isOpened()||(t+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},t))}}}function I(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getTargetEditorWidth()+(0,n.getScrollbarWidth)(this.hot.rootDocument)})}function M(e){return(0,s.isObject)(e)&&(0,d.isDefined)(e.key)&&(0,d.isDefined)(e.value)}var O=r(43488);class x extends O.Hf{static get EDITOR_TYPE(){return"checkbox"}beginEditing(e,t){if(t&&"mouseup"===t.type&&"TD"===t.target.nodeName){let e=this.TD.querySelector('input[type="checkbox"]');(0,n.hasClass)(e,"htBadValue")||e.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}var _=r(77398);let P=()=>window,L=()=>window.document,k=(e,t)=>window.setTimeout(e,t),D=function(e,t,r,i){e.addEventListener(t,r,!!i)},H=function(e,t,r,i){e.removeEventListener(t,r,!!i)},B=function(e,t){return -1!==(" "+e.className+" ").indexOf(" "+t+" ")},F=function(e,t){B(e,t)||(e.className=""===e.className?t:e.className+" "+t)},V=function(e,t){var r;e.className=(r=(" "+e.className+" ").replace(" "+t+" "," ")).trim?r.trim():r.replace(/^\s+|\s+$/g,"")},U=function(e){return/Array/.test(Object.prototype.toString.call(e))},W=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},j=function(e){let t=e.getDay();return 0===t||6===t},G=function(e,t){return[31,e%4==0&&e%100!=0||e%400==0?29:28,31,30,31,30,31,31,30,31,30,31][t]},$=function(e){W(e)&&e.setHours(0,0,0,0)},z=function(e,t){return e.getTime()===t.getTime()},Y=function(e,t,r){let i,n;for(i in t)(n=void 0!==e[i])&&"object"==typeof t[i]&&null!==t[i]&&void 0===t[i].nodeName?W(t[i])?r&&(e[i]=new Date(t[i].getTime())):U(t[i])?r&&(e[i]=t[i].slice(0)):e[i]=Y({},t[i],r):(r||!n)&&(e[i]=t[i]);return e},K=function(e,t,r){let i=L().createEvent("HTMLEvents");i.initEvent(t,!0,!1),i=Y(i,r),e.dispatchEvent(i)},X=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},q={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","Frid
31ay","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},Z=function(e,t,r){for(t+=e.firstDay;t>=7;)t-=7;return r?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},Q=function(e){let t=[],r="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month"),e.enableSelectionDaysInNextAndPreviousMonths||t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),r="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+r+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},J=function(e,t){e.setHours(0,0,0,0);let r=e.getDate(),i=e.getDay(),n=t-1,o=function(e){return(e+7-1)%7};e.setDate(r+n-o(i));let s=new Date(e.getFullYear(),0,t);return 1+Math.round(((e.getTime()-s.getTime())/864e5-n+o(s.getDay()))/7)},ee=function(e,t,r,i,n){let o=new Date(i,r,t);return'<td class="pika-week">'+(e.hasMoment?e.moment(o).isoWeek():J(o,n))+"</td>"},et=function(e){let t,r=[];for(e.showWeekNumber&&r.push("<th></th>"),t=0;t<7;t++)r.push('<th scope="col"><abbr title="'+Z(e,t)+'">'+Z(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?r.reverse():r).join("")+"</tr></thead>"},er=function(e,t,r,i,n,o){let s,a,l,h=e._o,u=r===h.minYear,c=r===h.maxYear,d='<div id="'+o+'" class="pika-title" role="heading" aria-live="polite">',g,p,f=!0,m=!0;for(l=[],s=0;s<12;s++)l.push('<option value="'+(r===n?s-t:12+s-t)+'"'+(s===i?' selected="selected"':"")+(u&&s<h.minMonth||c&&s>h.maxMonth?' disabled="disabled"':"")+">"+h.i18n.months[s]+"</option>");for(g='<div class="pika-label">'+h.i18n.months[i]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",U(h.yearRange)?(s=h.yearRange[0],a=h.yearRange[1]+1):(s=r-h.yearRange,a=1+r+h.yearRange),l=[];s<a&&s<=h.maxYear;s++)s>=h.minYear&&l.push('<option value="'+s+'"'+(s===r?' selected="selected"':"")+">"+s+"</option>");return p='<div class="pika-label">'+r+h.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",h.showMonthAfterYear?d+=p+g:d+=g+p,u&&(0===i||h.minMonth>=i)&&(f=!1),c&&(11===i||h.maxMonth<=i)&&(m=!1),0===t&&(d+='<button class="pika-prev'+(f?"":" is-disabled")+'" type="button">'+h.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(d+='<button class="pika-next'+(m?"":" is-disabled")+'" type="button">'+h.i18n.nextMonth+"</button>"),d+"</div>"};function ei(e){let t=this,r=t.config(e);t._onMouseDown=function(e){if(!t._v)return;let i=(e=e||P().event).target||e.srcElement;if(i){if(!B(i,"is-disabled")&&(!B(i,"pika-button")||B(i,"is-empty")||B(i.parentNode,"is-disabled")?B(i,"pika-prev")?t.prevMonth():B(i,"pika-next")&&t.nextMonth():(t.setDate(new Date(i.getAttribute("data-pika-year"),i.getAttribute("data-pika-month"),i.getAttribute("data-pika-day"))),r.bound&&k(function(){t.hide(),r.blurFieldOnSelect&&r.field&&r.field.blur()},100))),B(i,"pika-select"))t._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},t._onChange=function(e){let r=(e=e||P().event).target||e.srcElement;r&&(B(r,"pika-select-month")?t.gotoMonth(r.value):B(r,"pika-select-year")&&t.gotoYear(r.value))},t._onKeyChange=function(e){if(e=e||P().event,t.isVisible())switch(e.keyCode){case 13:case 27:r.field&&r.field.blur();break;case 37:t.adjustDate("subtract",1);break;case 38:t.adjustDate("subtract",7);break;case 39:t.adjustDate("add",1);break;case 40:t.adjustDate("add",7);break;case 8:case 46:t.setDate(null)}},t._parseFieldValue=function(){if(r.parse)return r.parse(r.field.value,r.format);if(!this.hasMoment)return new Date(Date.parse(r.field.value));{let e=this.moment(r.field.value,r.format,r.formatStrict);return e&&e.isValid()?e.toDate():null}},t._onInputChange=function(e){let r;e.firedBy!==t&&(W(r=t._parseFieldValue())&&t.setDate(r),t._v||t.show())},t._onInputFocus=function(){t.show()},t._onInputClick=function(){t.show()},t._onInputBlur=function(){let e=L().activeElement;do if(B(e,"pika-single"))return;while(e=e.parentNode);t._c||(t._b=k(function(){t.hide()},50)),t._c=!1},t._onClick=function(e){let i=(e=e||P().event).target||e.srcElement,n=i;if(i){!hasEventListeners&&B(i,"pika-select")&&!i.onchange&&(i.setAttribute("onchange","return;"),D(i,"change",t._onChange));do if(B(n,"pika-single")||n===r.trigger)return;while(n=n.parentNode);t._v&&i!==r.trigger&&n!==r.trigger&&t.hide()}},t.el=L().createElement("div"),t.el.className="pika-single"+(r.isRTL?" is-rtl":"")+(r.theme?" "+r.theme:""),D(t.el,"mousedown",t._onMouseDown,!0),D(t.el,"touchend",t._onMouseDown,!0),D(t.el,"change",t._onChange),r.keyboardInput&&D(L(),"keydown",t._onKeyChange),r.field&&(r.container?r.container.appendChild(t.el):r.bound?L().body.appendChild(t.el):r.field.parentNode.insertBefore(t.el,r.field.nextSibling),D(r.field,"change",t._onInputChange),r.defaultDate||(r.defaultDate=t._parseFieldValue(),r.setDefaultDate=!0));let i=r.defaultDate;W(i)?r.setDefaultDate?t.setDate(i,!0):t.gotoDate(i):t.gotoDate(new Date),r.bound?(this.hide(),t.el.className+=" is-bound",D(r.trigger,"click",t._onInputClick),D(r.trigger,"focus",t._onInputFocus),D(r.trigger,"blur",t._onInputBlur)):this.show()}ei.prototype={config:function(e){this._o||(this._o=Y({},q,!0));let t=Y(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;let r=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=r>4?4:r,W(t.minDate)||(t.minDate=!1),W(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),U(t.yearRange)){let e=new Date().getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||e,t.yearRange[1]=parseInt(t.yearRange[1],10)||e}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||q.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(e){return(e=e||this._o.format,W(this._d))?this._o.toString?this._o.toString(this._d,e):this.hasMoment?this.moment(this._d).format(e):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(e,t){this.hasMoment&&this.moment.isMoment(e)&&this.setDate(e.toDate(),t)},useMoment:function(e){this.hasMoment=!0,this.moment=e},getDate:function(){return W(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",K(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),!W(e))return;let r=this._o.minDate,i=this._o.maxDate;W(r)&&e<r?e=r:W(i)&&e>i&&(e=i),this._d=new Date(e.getTime()),$(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),K(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(e){let t=!0;if(W(e)){if(this.calendars){let r=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),n=e.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),t=n<r.getTime()||i.getTime()<n}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(e,t){let r,i=this.getDate()||new Date,n=864e5*parseInt(t);"add"===e?r=new Date(i.valueOf()+n):"subtract"===e&&(r=new Date(i.valueOf()-n)),this.setDate(r)},adjustCalendars:function(){this.calendars[0]=X(this.calendars[0]);for(let e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=X({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?($(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=q.minDate,this._o.minYear=q.minYear,this._o.minMonth=q.minMonth,this._o.startRange=q.startRange),this.draw()}
31,setMaxDate:function(e){e instanceof Date?($(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=q.maxDate,this._o.maxYear=q.maxYear,this._o.maxMonth=q.maxMonth,this._o.endRange=q.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(!this._v&&!e)return;let t=this._o,r=t.minYear,i=t.maxYear,n=t.minMonth,o=t.maxMonth,s="",a;this._y<=r&&(this._y=r,!isNaN(n)&&this._m<n&&(this._m=n)),this._y>=i&&(this._y=i,!isNaN(o)&&this._m>o&&(this._m=o));for(let e=0;e<t.numberOfMonths;e++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),s+='<div class="pika-lendar">'+er(this,e,this.calendars[e].year,this.calendars[e].month,this.calendars[0].year,a)+this.render(this.calendars[e].year,this.calendars[e].month,a)+"</div>";this.el.innerHTML=s,t.bound&&"hidden"!==t.field.type&&k(function(){t.trigger.focus()},1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),t.bound&&t.field.setAttribute("aria-label",t.ariaLabel)},adjustPosition:function(){let e,t,r,i,n,o,s,a,l,h,u;this._o.container||(this.el.style.position="absolute",e=this._o.trigger,t=this.el.offsetWidth,r=this.el.offsetHeight,i=P().innerWidth||L().documentElement.clientWidth,n=P().innerHeight||L().documentElement.clientHeight,o=L().body.scrollTop||L().documentElement.scrollTop,h=!0,u=!0,s=(l=e.getBoundingClientRect()).left+P().pageXOffset,a=l.bottom+P().pageYOffset,(this._o.reposition&&s+t>i||this._o.position.indexOf("right")>-1&&s-t+e.offsetWidth>0)&&(s=s-t+e.offsetWidth,h=!1),(this._o.reposition&&a+r>n+o||this._o.position.indexOf("top")>-1&&a-r-e.offsetHeight>0)&&(a=a-r-e.offsetHeight,u=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",F(this.el,h?"left-aligned":"right-aligned"),F(this.el,u?"bottom-aligned":"top-aligned"),V(this.el,h?"right-aligned":"left-aligned"),V(this.el,u?"top-aligned":"bottom-aligned"))},render:function(e,t,r){var i,n;let o=this._o,s=new Date,a=G(e,t),l=new Date(e,t,1).getDay(),h=[],u=[];$(s),o.firstDay>0&&(l-=o.firstDay)<0&&(l+=7);let c=0===t?11:t-1,d=11===t?0:t+1,g=0===t?e-1:e,p=11===t?e+1:e,f=G(g,c),m=a+l,y=m;for(;y>7;)y-=7;m+=7-y;let w=!1;for(let r=0,y=0;r<m;r++){let m=new Date(e,t,1+(r-l)),E=!!W(this._d)&&z(m,this._d),S=z(m,s),C=-1!==o.events.indexOf(m.toDateString()),R=r<l||r>=a+l,b=1+(r-l),T=t,N=e,A=o.startRange&&z(o.startRange,m),I=o.endRange&&z(o.endRange,m),M=o.startRange&&o.endRange&&o.startRange<m&&m<o.endRange,O=o.minDate&&m<o.minDate||o.maxDate&&m>o.maxDate||o.disableWeekends&&j(m)||o.disableDayFn&&o.disableDayFn(m);R&&(r<l?(b=f+b,T=c,N=g):(b-=a,T=d,N=p));let x={day:b,month:T,year:N,hasEvent:C,isSelected:E,isToday:S,isDisabled:O,isEmpty:R,isStartRange:A,isEndRange:I,isInRange:M,showDaysInNextAndPreviousMonths:o.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:o.enableSelectionDaysInNextAndPreviousMonths};o.pickWholeWeek&&E&&(w=!0),u.push(Q(x)),7==++y&&(o.showWeekNumber&&u.unshift(ee(this,r-l,t,e,o.firstWeekOfYearMinDays)),h.push((i=u,n=o.isRTL,'<tr class="pika-row'+(o.pickWholeWeek?" pick-whole-week":"")+(w?" is-selected":"")+'">'+(n?i.reverse():i).join("")+"</tr>")),u=[],y=0,w=!1)}return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+r+'">'+et(o)+"<tbody>"+h.join("")+"</tbody></table>"},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),V(this.el,"is-hidden"),this._o.bound&&(D(L(),"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){let e=this._v;!1!==e&&(this._o.bound&&H(L(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),F(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){let e=this._o;this.hide(),H(this.el,"mousedown",this._onMouseDown,!0),H(this.el,"touchend",this._onMouseDown,!0),H(this.el,"change",this._onChange),e.keyboardInput&&H(L(),"keydown",this._onKeyChange),e.field&&(H(e.field,"change",this._onInputChange),e.bound&&(H(e.trigger,"click",this._onInputClick),H(e.trigger,"focus",this._onInputFocus),H(e.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};var en=r(66327);function eo(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function es(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let ea="date",el="dateEditor";var eh=new WeakSet;class eu extends i.H{constructor(){super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,eh),eh.add(this),eo(this,"parentDestroyed",!1),eo(this,"$datePicker",null)}static get EDITOR_TYPE(){return ea}init(){if("function"!=typeof _)throw Error("You need to include moment.js to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,t)=>{t||this.close()})}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"),(0,n.addClass)(this.datePicker,"htDatepickerHolder"),this.hot.rootPortalElement.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",e=>{(0,n.hasClass)(e.target,"pika-day")&&this.hideDatepicker(),e.stopPropagation()})}destroyElements(){let e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,t,r,i,n,o){super.prepare(e,t,r,i,n,o)}open(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),t.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:el})}close(){var e;null!==(e=this.$datePicker)&&void 0!==e&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{let e=this.hot._getEditorManager();e.closeEditor(),this.hot.view.render(),e.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(el),super.close()}finishEditing(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.finishEditing(e,t)}showDatepicker(e){let t;let r=es(eh,this,ec).call(this),i=this.hot.view.isMouseDown(),n=!!e&&(0,p.isFunctionKey)(e.ke
31yCode);this.datePicker.style.display="block",this.$datePicker=new ei(this.getDatePickerConfig()),"function"==typeof this.$datePicker.useMoment&&this.$datePicker.useMoment(_),this.$datePicker._onInputFocus=function(){},this.originalValue?(_(t=this.originalValue,r,!0).isValid()&&this.$datePicker.setMoment(_(t,r),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),n||i||this.setValue("")):this.cellProperties.defaultDate?(_(t=this.cellProperties.defaultDate,r,!0).isValid()&&this.$datePicker.setMoment(_(t,r),!0),n||i||this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;let t=this.TEXTAREA,r={};this.cellProperties&&this.cellProperties.datePickerConfig&&(0,s.deepExtend)(r,this.cellProperties.datePickerConfig);let i=r.onSelect,n=r.onClose;return r.field=t,r.trigger=t,r.container=this.datePicker,r.bound=!1,r.keyboardInput=!1,r.format=null!==(e=r.format)&&void 0!==e?e:es(eh,this,ec).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=e=>{let t=e;isNaN(t.getTime())||(t=_(t).format(es(eh,this,ec).call(this))),this.setValue(t),i&&i(),(0,en.isMobileBrowser)()&&this.hideDatepicker()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),n&&n()},r}refreshDimensions(e){var t;if(super.refreshDimensions(e),this.state!==O.ed.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}let{rowIndexMapper:r,columnIndexMapper:i}=this.hot,{wtOverlays:o}=this.hot.view._wt,{wtTable:s}=null!==(t=o.getParentOverlay(this.TD))&&void 0!==t?t:this.hot.view._wt,a=r.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=r.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),h=i.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),u=i.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=h&&this.col<=u){let e=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+e.top+(0,n.outerHeight)(this.TD)}px`;let t=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?t+=e.right-(0,n.outerWidth)(this.datePicker):t+=e.left,this.datePickerStyle.left=`${t}px`}else this.hideDatepicker()}}function ec(){var e;return null!==(e=this.cellProperties.dateFormat)&&void 0!==e?e:"DD/MM/YYYY"}class ed extends A{static get EDITOR_TYPE(){return"dropdown"}prepare(e,t,r,i,n,o){o.filter=!1,o.strict=!0,super.prepare(e,t,r,i,n,o)}}class eg extends i.H{static get EDITOR_TYPE(){return"numeric"}}var ep=r(9211);class ef extends i.H{constructor(){var e,t,r;super(...arguments),e="autoResize",t=(0,ep.x)(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}),(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t}static get EDITOR_TYPE(){return"password"}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,(0,n.empty)(this.TEXTAREA_PARENT),this.TEXTAREA.setAttribute(...(0,m.Qk)(-1)),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}let em="ht_editor_visible",ey="selectEditor";class ev extends O.Hf{static get EDITOR_TYPE(){return"select"}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";let e=this.hot.rootDocument.createElement("DIV"),t=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",t&&e.setAttribute(...(0,m.cV)()),e.appendChild(this.hot.rootDocument.createTextNode(String.fromCharCode(9660))),(0,n.addClass)(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",(0,n.hasClass)(this.selectWrapper,em)&&(0,n.removeClass)(this.selectWrapper,em),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,t,r,i,o,a){let l;super.prepare(e,t,r,i,o,a);let h=this.cellProperties.selectOptions;l="function"==typeof h?this.prepareOptions(h(this.row,this.col,this.prop)):this.prepareOptions(h),(0,n.empty)(this.select),(0,s.objectEach)(l,(e,t)=>{let r=this.hot.rootDocument.createElement("OPTION");r.value=t,(0,n.fastInnerHTML)(r,e),this.select.appendChild(r)})}prepareOptions(e){let t={};if(Array.isArray(e))for(let r=0,i=e.length;r<i;r++)t[e[r]]=e[r];else"object"==typeof e&&(t=e);return t}refreshValue(){let e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==O.ed.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}let{top:e,start:t,width:r,height:i}=this.getEditedCellRect(),o=this.selectWrapper.style;o.height=`${i}px`,o.width=`${r}px`,o.top=`${e}px`,o[this.hot.isRtl()?"right":"left"]=`${t}px`,o.margin="0px",(0,n.addClass)(this.selectWrapper,em)}registerShortcuts(){let e=this.hot.getShortcutManager().getContext("editor");
31this.isInFullEditMode()&&e.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{let e=this.select.selectedIndex-1;e>=0&&(this.select[e].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{let e=this.select.selectedIndex+1;e<=this.select.length-1&&(this.select[e].selected=!0)}}],{group:ey})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(ey)}}class ew extends i.H{static get EDITOR_TYPE(){return"time"}prepare(e,t,r,i,n,o){super.prepare(e,t,r,i,n,o),this.TEXTAREA.dir="ltr"}}var eE=r(65187),eS=r(91350);function eC(e,t,r,i,o,s,a){eS.Z.apply(this,[e,t,r,i,o,s,a]),(0,n.fastInnerHTML)(t,null==s?"":s,!1)}eC.RENDERER_TYPE="html";var eR=r(77882);function eb(e,t,r,i,o,s,a){let{rootDocument:l}=e,h=a.allowHtml?eC:f.V,u=l.createElement("DIV"),c=e.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...(0,m.cV)()),u.appendChild(l.createTextNode(String.fromCharCode(9660))),h.apply(this,[e,t,r,i,o,s,a]),t.firstChild||t.appendChild(l.createTextNode(String.fromCharCode(160))),t.insertBefore(u,t.firstChild),(0,n.addClass)(t,"htAutocomplete"),!e.acArrowListener){let o=new eR.Z(e);e.acArrowListener=function(o){(0,n.hasClass)(o.target,"htAutocompleteArrow")&&e.view._wt.getSetting("onCellDblClick",null,e._createCellCoords(r,i),t)},o.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",()=>{o.destroy()})}}function eT(e,t,r,i,n,o,s){eb.apply(this,[e,t,r,i,n,o,s])}eb.RENDERER_TYPE="autocomplete",eT.RENDERER_TYPE="dropdown";var eN=r(41965),eA=r(2178);let eI=new WeakMap,eM=new WeakMap,eO="data-row",ex="data-col",e_="checkbox";function eP(e,t,r,i,o,s,l){let{rootDocument:h}=e,u=e.getSettings().ariaTags;eS.Z.apply(this,[e,t,r,i,o,s,l]),function(e){let t=eM.get(e);if(!t){let{rootElement:r}=e;(t=new eR.Z(e)).addEventListener(r,"click",t=>(function(e,t){let{target:r}=e;if(!eL(r)||!r.hasAttribute(eO)||!r.hasAttribute(ex))return;let i=parseInt(r.getAttribute(eO),10),n=parseInt(r.getAttribute(ex),10);t.getCellMeta(i,n).readOnly&&e.preventDefault()})(t,e)),t.addEventListener(r,"mouseup",t=>(function(e,t){let{target:r}=e;eL(r)&&r.hasAttribute(eO)&&r.hasAttribute(ex)&&setTimeout(t.listen,10)})(t,e)),t.addEventListener(r,"change",t=>(function(e,t){let{target:r}=e;if(!eL(r)||!r.hasAttribute(eO)||!r.hasAttribute(ex))return;let i=parseInt(r.getAttribute(eO),10),n=parseInt(r.getAttribute(ex),10),o=t.getCellMeta(i,n);if(!o.readOnly){let r=null;r=e.target.checked?void 0===o.uncheckedTemplate||o.checkedTemplate:void 0!==o.uncheckedTemplate&&o.uncheckedTemplate,t.setDataAtCell(i,n,r)}})(t,e)),eM.set(e,t)}}(e);let c=function(e){let t=e.createElement("input");return t.className="htCheckboxRendererInput",t.type="checkbox",t.setAttribute("tabindex","-1"),t.cloneNode(!1)}(h),g=l.label,p=!1;if(void 0===l.checkedTemplate&&(l.checkedTemplate=!0),void 0===l.uncheckedTemplate&&(l.uncheckedTemplate=!1),(0,n.empty)(t),s===l.checkedTemplate||(0,d.stringify)(s).toLocaleLowerCase(l.locale)===(0,d.stringify)(l.checkedTemplate).toLocaleLowerCase(l.locale)?c.checked=!0:s===l.uncheckedTemplate||(0,d.stringify)(s).toLocaleLowerCase(l.locale)===(0,d.stringify)(l.uncheckedTemplate).toLocaleLowerCase(l.locale)?c.checked=!1:(0,d.isEmpty)(s)?(0,n.addClass)(c,"noValue"):(c.style.display="none",(0,n.addClass)(c,"htBadValue"),p=!0),(0,n.setAttribute)(c,[[eO,r],[ex,i]]),u&&(0,n.setAttribute)(c,[(0,m.QK)(c.checked?e.getTranslatedPhrase(eA.CHECKBOX_CHECKED):e.getTranslatedPhrase(eA.CHECKBOX_UNCHECKED)),(0,m.Pn)(c.checked),(0,m.wt)()]),!p&&g){let n="";if(g.value)n="function"==typeof g.value?g.value.call(this,r,i,o,s):g.value;else if(g.property){let t=e.getDataAtRowProp(r,g.property);n=null!==t?t:""}let a=function(e,t,r){let i=e.createElement("label");i.className=`htCheckboxRendererLabel ${r?"fullWidth":""}`;let n=e.createTextNode(t);if(r){let t=e.createElement("span");t.appendChild(n),i.appendChild(t)}else i.appendChild(n);return i.cloneNode(!0)}(h,n,!0!==g.separated);"before"===g.position?g.separated?(t.appendChild(a),t.appendChild(c)):(a.appendChild(c),c=a):g.position&&"after"!==g.position||(g.separated?(t.appendChild(c),t.appendChild(a)):(a.insertBefore(c,a.firstChild),c=a))}function f(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=e.getSelectedRange(),i=[],n=new Map,o=[],s=0;if(r){for(let a=0;a<r.length;a++){let{row:l,col:h}=r[a].getTopStartCorner(),{row:u,col:c}=r[a].getBottomEndCorner();for(let r=l;r<=u;r+=1)for(let a=h;a<=c;a+=1){let l=e.getCellMeta(r,a);if(l.hidden)continue;let h={checkedTemplate:l.checkedTemplate,uncheckedTemplate:l.uncheckedTemplate};if("checkbox"!==l.type){!0!==t||l.readOnly||(n.has(i.length)?n.set(i.length,[...n.get(i.length),[r,a,null]]):n.set(i.length,[[r,a,null]]));continue}if(!0===l.readOnly)continue;void 0===l.checkedTemplate&&(l.checkedTemplate=!0),void 0===l.uncheckedTemplate&&(l.uncheckedTemplate=!1);let u=e.getDataAtCell(r,a);!1===t?[l.checkedTemplate,l.checkedTemplate.toString()].includes(u)?o.push([r,a,l.uncheckedTemplate,h]):[l.uncheckedTemplate,l.uncheckedTemplate.toString(),null,void 0].includes(u)&&o.push([r,a,l.checkedTemplate,h]):o.push([r,a,l.uncheckedTemplate,h]),s+=1}i.push(s),s=0}(o=o.every(e=>{let[,,t]=e;return t===o[0][2]})?o.map(e=>{let[t,r,i]=e;return[t,r,i]}):o.map(e=>{let[t,r,,i]=e;return[t,r,i.checkedTemplate]})).length>
310&&i.forEach((t,r)=>{let i=o.splice(0,t);n.size&&n.has(r)&&(i=[...i,...n.get(r)]),e.setDataAtCell(i)})}}function y(){let t=e.getSelectedRange();if(t){for(let r=0;r<t.length;r++){let i=t[r].getTopStartCorner(),o=t[r].getBottomEndCorner();for(let t=i.row;t<=o.row;t++)for(let r=i.col;r<=o.col;r++){if(e.getCellMeta(t,r).readOnly)continue;let i=e.getCell(t,r);if((0,n.isHTMLElement)(i)&&i.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}g&&(!g||g.separated)||t.appendChild(c),p&&t.appendChild(h.createTextNode("#bad-value#")),eI.has(e)||(eI.set(e,!0),function(){let t=e.getShortcutManager().getContext("grid"),r={group:"checkboxRenderer",relativeToGroup:a.II,position:"before"};t.addShortcuts([{keys:[["space"]],callback:()=>(f(),!y()),runOnlyIf:()=>{var t;return null===(t=e.getSelectedRangeActive())||void 0===t?void 0:t.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!y()),runOnlyIf:()=>{let t=e.getSelectedRangeActive();return e.getSettings().enterBeginsEditing&&(null==t?void 0:t.highlight.isCell())&&!e.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!y()),runOnlyIf:()=>{var t;return null===(t=e.getSelectedRangeActive())||void 0===t?void 0:t.highlight.isCell()}}],r)}())}function eL(e){return"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}function ek(e,t,r,i,n,o,s){eb.apply(this,[e,t,r,i,n,o,s])}eN.P.getSingleton().add("modifyAutoColumnSizeSeed",function(e,t,r){let{label:i,type:n,row:o,column:s,prop:a}=t;if(n!==e_||!i)return;let{value:l,property:h}=i,u=r;if(l)u="function"==typeof l?l(o,s,a,r):l;else if(h){let e=this.getDataAtRowProp(o,h);u=null!==e?e:r}return`${(0,d.stringify)(u).length}`}),eP.RENDERER_TYPE=e_,ek.RENDERER_TYPE="handsontable";var eD=r(76959),eH=r(47771);function eB(e,t){if((0,eH.isNumeric)(e)){let r=t.numericFormat,i=r&&r.culture||"-",n=r&&r.pattern;if(void 0!==i&&!eD.Z.languages()[i]){let e=i.replace("-",""),t=eD.Z.allLanguages?eD.Z.allLanguages[i]:eD.Z[e];t&&eD.Z.registerLanguage(t)}eD.Z.setLanguage(i),e=(0,eD.Z)(e).format(n||"0")}return e}function eF(e,t,r,i,n,o,s){let a=o;if((0,eH.isNumeric)(a)){let e=[];
31if(Array.isArray(s.className))e=s.className;else{var l;let t=null!==(l=s.className)&&void 0!==l?l:"";t.length&&(e=t.split(" "))}a=eB(a,s),0>e.indexOf("htLeft")&&0>e.indexOf("htCenter")&&0>e.indexOf("htRight")&&0>e.indexOf("htJustify")&&e.push("htRight"),0>e.indexOf("htNumeric")&&e.push("htNumeric"),s.className=e.join(" "),t.dir="ltr"}(0,f.V)(e,t,r,i,n,a,s)}function eV(e,t,r,i,o,s,a){f.V.apply(this,[e,t,r,i,o,s,a]);let l=a.hashLength||t.innerHTML.length,h=a.hashSymbol||"*",u="";(0,eH.rangeEach)(l-1,()=>{u+=h}),(0,n.fastInnerHTML)(t,u)}function eU(e,t,r,i,n,o,s){f.V.apply(this,[e,t,r,i,n,o,s])}function eW(e,t,r,i,n,o,s){f.V.apply(this,[e,t,r,i,n,o,s]),t.dir="ltr"}eF.RENDERER_TYPE="numeric",eV.RENDERER_TYPE="password",eU.RENDERER_TYPE="select",eW.RENDERER_TYPE="time";var ej=r(26595);function eG(e,t){let r=e;if(null==r&&(r=""),this.allowEmpty&&""===r){t(!0);return}this.strict&&this.source?"function"==typeof this.source?this.source(r,e$(r,t)):e$(r,t)(this.source):t(!0)}function e$(e,t){return function(r){let i=!1;for(let t=0,n=r.length;t<n;t++)if((0,s.isObjectEqual)(e,r[t])){i=!0;break}t(i)}}eG.VALIDATOR_TYPE="autocomplete";var ez=r(56751);function eY(e,t){let r=(0,eE.Jq)(ea,this.instance),i=e,n=!0;null==i&&(i="");let o=_(i,this.dateFormat||r.defaultDateFormat,!0).isValid(),s=_(new Date(i)).isValid()||o;if(this.allowEmpty&&""===i&&(s=!0,o=!0),s||(n=!1),!s&&o&&(n=!0),s&&!o){if(!0===this.correctFormat){let e=function(e,t){let r=_((0,ez.getNormalizedDate)(e)),i=_(e,t),n=e.search(/[A-Za-z]/g)>-1;return(r.isValid()&&r.format("x")===i.format("x")||!i.isValid()||n?r:i).format(t)}(i,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,e,"dateValidator"),n=!0}else n=!1}t(n)}function eK(e,t){eG.apply(this,[e,t])}function eX(e,t){let r=e;null==r&&(r=""),t(!!this.allowEmpty&&""===r||""!==r&&(0,eH.isNumeric)(e))}eY.VALIDATOR_TYPE="date",eK.VALIDATOR_TYPE="dropdown",eX.VALIDATOR_TYPE="numeric";let eq=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"];function eZ(e,t){let r=this.timeFormat||"h:mm:ss a",i=!0,n=e;null===n&&(n=""),n=/^\d{3,}$/.test(n)?parseInt(n,10):n;let o=/^\d{1,2}$/.test(n);o&&(n+=":00");let s=_(n,eq,!0).isValid()?_(n):_(n,r),a=s.isValid(),l=_(n,r,!0).isValid()&&!o;if(this.allowEmpty&&""===n&&(a=!0,l=!0),a||(i=!1),!a&&l&&(i=!0),a&&!l){if(!0===this.correctFormat){let e=s.format(r);this.instance.setDataAtCell(this.visualRow,this.visualCol,e,"timeValidator"),i=!0}else i=!1}t(i)}eZ.VALIDATOR_TYPE="time";var eQ=r(92809);function eJ(e){return(0,s.isObject)(e)&&void 0!==e.value?e.value:e}function e0(e,t,r){let i=this.getSourceDataAtCell(this.toPhysicalRow(t),this.toPhysicalColumn(r)),n=e=>(0,s.isObject)(e)&&(0,d.isDefined)(e.key)&&(0,d.isDefined)(e.value);return n(i)?n(e)?e:{key:e,value:e}:e}let e1={CELL_TYPE:"autocomplete",editor:A,renderer:eb,validator:eG,valueGetter:eJ,valueSetter:e0},e2={CELL_TYPE:"checkbox",editor:x,renderer:eP,valueSetter:function(e,t,r){let{checkedTemplate:i,uncheckedTemplate:n}=this.getCellMeta(t,r),o=(0,d.stringify)(e),s=o===(0,d.stringify)(i),a=o===(0,d.stringify)(n);return s||a?s?i:n:e}};function e5(e,t,r,i,n,o,s){eb.apply(this,[e,t,r,i,n,o,s])}e5.RENDERER_TYPE="date";let e3={CELL_TYPE:"date",editor:eu,renderer:e5,validator:eY},e9={CELL_TYPE:"dropdown",editor:ed,renderer:eT,validator:eK,filter:!1,strict:!0,valueGetter:function(e){return eJ.call(this,e)},valueSetter:function(e,t,r,i){return e0.call(this,e,t,r,i)}},e4={CELL_TYPE:"handsontable",editor:u,renderer:ek};var e7=r(87239);let e8={CELL_TYPE:"numeric",editor:eg,renderer:eF,validator:eX,dataType:"number",valueSetter:function(e){if("string"==typeof e&&(0,eH.isNumericLike)(e)){let t=(0,eH.getParsedNumber)(e);return(0,e7.Rw)(t)?e:t}return e}},e6={CELL_TYPE:"password",editor:ef,renderer:eV,copyable:!1},te={CELL_TYPE:"select",editor:ev,renderer:eU};var tt=r(3277);let tr={CELL_TYPE:"time",editor:ew,renderer:eW,validator:eZ};var ti=r(26212);r(95984);var tn=r(87385),to=r(13066),ts=r(38005);function ta(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class tl{static get SAMPLE_COUNT(){return 3}constructor(e){ta(this,"samples",null),ta(this,"dataFactory",null),ta(this,"customSampleC
31ount",null),ta(this,"allowDuplicates",!1),ta(this,"includeHidden",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:tl.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}setIncludeHidden(e){this.includeHidden=e}generateRowSamples(e,t){return this.generateSamples("row",t,e)}generateColumnSamples(e,t){return this.generateSamples("col",t,e)}generateSamples(e,t,r){let i=new Map,{from:n,to:o}="number"==typeof r?{from:r,to:r}:r;return(0,eH.rangeEach)(n,o,r=>{let n=this.generateSample(e,t,r);i.set(r,n)}),i}generateSample(e,t,r){if("row"!==e&&"col"!==e)throw Error("Unsupported sample type");let i=new Map,n="row"===e?"col":"row",o=[];return(0,eH.rangeEach)(t.from,t.to,t=>{let a;let l="row"===e?this.dataFactory(r,t,this):this.dataFactory(t,r,this);if(!1===l)return;let{value:h,bundleSeed:u}=l,c="string"==typeof u&&u.length>0;a=c?u:(0,s.isObject)(h)?`${Object.keys(h).length}`:Array.isArray(h)?`${h.length}`:`${(0,d.stringify)(h).length}`,i.has(a)||i.set(a,{needed:this.getSampleCount(),strings:[]});let g=i.get(a);g.needed&&(!(o.indexOf(h)>-1)||this.allowDuplicates||c)&&(g.strings.push({value:h,[n]:t}),o.push(h),g.needed-=1)}),i}}var th=r(91062),tu=r(38231);function tc(e,t,r){td(e,t),t.set(e,r)}function td(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function tg(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tp(e,t){return e.get(tm(e,t))}function tf(e,t,r){return e.set(tm(e,t),r),r}function tm(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("modifyAutoColumnSizeSeed");let ty="autoColumnSize";var tv=new WeakMap,tw=new WeakMap,tE=new WeakMap,tS=new WeakSet;class tC extends tn.vq{static get PLUGIN_KEY(){return ty}static get PLUGIN_PRIORITY(){return 10}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),td(this,tS),tS.add(this),tg(this,"ghostTable",new ts.Z(this.hot)),tg(this,"samplesGenerator",new tl((e,t)=>{let r=this.hot.toPhysicalRow(e),i=this.hot.toPhysicalColumn(t);if(this.hot.rowIndexMapper.isHidden(r)||this.hot.columnIndexMapper.isHidden(i))return!1;let n=this.hot.getCellMeta(e,t),o="";n.spanned||(o=this.hot.getDataAtCell(e,t));let s="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(s=this.hot.runHooks("modifyAutoColumnSizeSeed",s,n,o)),{value:o,bundleSeed:s}})),tg(this,"inProgress",!1),tg(this,"measuredColumns",0),tg(this,"columnWidthsMap",new tu.L),tc(this,tv,!1),tc(this,tw,[]),tc(this,tE,[]),this.hot.columnIndexMapper.registerMap("autoColumnSize",this.columnWidthsMap),this.addHook("beforeColumnResize",(e,t,r)=>tm(tS,this,tM).call(this,e,t,r))}isEnabled(){return!1!==this.hot.getSettings()[ty]&&!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"));let t=this.getSetting("samplingRatio");t&&!isNaN(t)&&this.samplesGenerator.setSampleCount(parseInt(t,10)),this.addHook("afterLoadData",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return tm(tS,e,tA).call(e,...r)}),this.addHook("beforeChangeRender",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return tm(tS,e,tI).call(e,...r)}),this.addHook("afterFormulasValuesUpdate",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return tm(tS,e,tx).call(e,...r)}),this.addHook("beforeRender",()=>
31tm(tS,this,tN).call(this)),this.addHook("modifyColWidth",(e,t)=>this.getColumnWidth(t,e)),this.addHook("init",()=>tm(tS,this,tO).call(this)),super.enablePlugin()}updatePlugin(){tf(tE,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,t,r)=>tm(tS,this,tM).call(this,e,t,r))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;let e=this.getFirstVisibleColumn(),t=this.getLastVisibleColumn();if(-1===e||-1===t)return;let r=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:t},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i="number"==typeof e?{from:e,to:e}:e,n="number"==typeof t?{from:t,to:t}:t;(0,eH.rangeEach)(i.from,i.to,e=>{let t=this.hot.toPhysicalColumn(e);null===t&&(t=e),(r||null===this.columnWidthsMap.getValueAtIndex(t)&&!this.hot._getColWidthFromSettings(t))&&tm(tS,this,tb).call(this,e,n)}),this.ghostTable.columns.length&&(tm(tS,this,tT).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0,i=this.hot.countCols()-1,n=null;this.inProgress=!0;let o=()=>{if(!this.hot){(0,to.cancelAnimationFrame)(n),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+tC.CALCULATION_STEP,i)},e,t),(r=r+tC.CALCULATION_STEP+1)<i?n=(0,to.requestAnimationFrame)(o):((0,to.cancelAnimationFrame)(n),this.inProgress=!1,this.hot.view.adjustElementsSize())},s=this.getSyncCalculationLimit();s>=0&&(this.calculateColumnsWidth({from:0,to:s},e,t),r=s+1),r<i?o():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){let e=this.hot.getSettings()[ty],t=tC.SYNC_CALCULATION_LIMIT,r=this.hot.countCols()-1;return(0,s.isObject)(e)&&(t=e.syncLimit,(0,g.isPercentValue)(t)?t=(0,eH.valueAccordingPercent)(r,t):t>>=0),Math.min(t,r)}getColumnWidth(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=t;return void 0===i&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),r&&"number"==typeof i&&(i=Math.max(i,th.$))),i}getFirstVisibleColumn(){var e;return null!==(e=this.hot.getFirstRenderedVisibleColumn())&&void 0!==e?e:-1}getLastVisibleColumn(){var e;return null!==(e=this.hot.getLastRenderedVisibleColumn())&&void 0!==e?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((e,t,r)=>{let i=tp(tw,this).length;return(i-1<r||tp(tw,this)[r]!==t)&&e.push(this.hot.toVisualColumn(r)),i-1<r?tp(tw,this).push(t):tp(tw,this)[r]=t,e},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(e=>{this.columnWidthsMap.setValueAtIndex(e,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter(e=>null===e).length}destroy(){this.ghostTable.clean(),super.destroy()}}function tR(e){let t={from:0,to:this.hot.countRows()-1};e.forEach(e=>{let r=this.hot.toPhysicalColumn(e);null!==r&&(this.hot._getColWidthFromSettings(r)||tm(tS,this,tb).call(this,e,t))}),this.ghostTable.columns.length&&(tm(tS,this,tT).call(this),this.ghostTable.clean())}function tb(e,t){this.samplesGenerator.generateColumnSamples(e,t).forEach((e,t)=>this.ghostTable.addColumn(t,e))}function tT(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((e,t)=>{let r=this.hot.toPhysicalColumn(e);this.columnWidthsMap.setValueAtIndex(r,t)})},!0)}function tN(){this.calculateVisibleColumnsWidth(),this.inProgress||(tm(tS,this,tR).call(this,tp(tE,this)),tf(tE,this,[]))}function tA(e,t){t||this.recalculateAllColumnsWidth()}function tI(e){let t=e.reduce((e,t)=>{let[,r]=t,i=this.hot.propToCol(r);return Number.isInteger(i)&&-1===e.indexOf(i)&&e.push(i),e},[]);tp(tE,this).push(...t)}function tM(e,t,r){let i=e;return r&&(this.calculateColumnsWidth(t,void 0,!0),i=this.getColumnWidth(t,void 0,!1)),i}function tO(){tf(tw,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),tf(tv,this,
31!0)}function tx(e){if(!tp(tv,this))return;let t=e.reduce((e,t)=>{var r;let i=null===(r=t.address)||void 0===r?void 0:r.col;if(Number.isInteger(i)){let t=this.hot.toVisualColumn(i);-1===e.indexOf(t)&&e.push(t)}return e},[]);tp(tE,this).push(...t)}r(97934);let t_={horizontal:"horizontal",vertical:"vertical"};function tP(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tL(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("modifyAutofillRange"),eN.P.getSingleton().register("beforeAutofill"),eN.P.getSingleton().register("afterAutofill");let tk="autofill",tD=["fillHandle"];var tH=new WeakSet;class tB extends tn.vq{constructor(){super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,tH),tH.add(this),tP(this,"addingStarted",!1),tP(this,"mouseDownOnCellCorner",!1),tP(this,"mouseDragOutside",!1),tP(this,"handleDraggedCells",0),tP(this,"directions",[]),tP(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return tk}static get PLUGIN_PRIORITY(){return 20}static get SETTING_KEYS(){return[tk,...tD]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>tL(tH,this,tU).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>tL(tH,this,tV).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,t)=>tL(tH,this,tW).call(this,t)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.hot.getSelectedRangeLast(),{row:r,col:i}=t.getTopStartCorner(),{row:n,col:o}=t.getBottomEndCorner(),a=this.hot.runHooks("modifyCopyableRange",[{startRow:r,startCol:i,endRow:n,endCol:o}]),l=[],h=[],u=[];return(0,c.arrayEach)(a,e=>{for(let t=e.startRow;t<=e.endRow;t+=1)-1===l.indexOf(t)&&l.push(t);for(let t=e.startCol;t<=e.endCol;t+=1)-1===h.indexOf(t)&&h.push(t)}),(0,c.arrayEach)(l,t=>{let r=[];(0,c.arrayEach)(h,i=>{let n=e?this.hot.getSourceDataAtCell(t,i):null;e&&(0,s.isObject)(n)?r.push(this.hot.getCopyableSourceData(t,i)):r.push(this.hot.getCopyableData(t,i))}),u.push(r)}),u}fillIn(){var e;let t,r,i;if(this.hot.selection.highlight.getFill().isEmpty())return!1;let[n,o,a,l]=this.hot.selection.highlight.getFill().getVisualCorners(),h=this.hot.getSelectedRangeLast(),u=h.getTopStartCorner(),c=h.getBottomEndCorner();this.resetSelectionOfDraggedArea();let d=[u.row,u.col,c.row,c.col],g=this.hot.runHooks("modifyAutofillRange",[Math.min(u.row,n),Math.min(u.col,o),Math.max(c.row,a),Math.max(c.col,l)],d),{directionOfDrag:p,startOfDragCoords:f,endOfDragCoords:m}=(e=(e,t)=>this.hot._createCellCoords(e,t),g[0]===d[0]&&g[1]<d[1]?(i="left",t=e(g[0],g[1]),r=e(g[2],d[1]-1)):g[2]===d[2]&&g[0]===d[0]&&g[3]>d[3]?(i="right",t=e(g[0],d[3]+1),r=e(g[2],g[3])):g[0]<d[0]&&g[1]===d[1]?(i="up",t=e(g[0],g[1]),r=e(d[0]-1,g[3])):g[2]>d[2]&&g[1]===d[1]&&(i="down",t=e(d[2]+1,g[1]),r=e(g[2],g[3])),t&&t.normalize(),r&&r.normalize(),{directionOfDrag:i,startOfDragCoords:t,endOfDragCoords:r});if(f&&f.row>-1&&f.col>-1){let e=this.getSelectionData(),t=this.getSelectionData(!0),r=h.clone(),i=this.hot._createCellRange(f,f,m),n=this.hot.runHooks("beforeAutofill",e,r,i,p);if(!1===n)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let o=n;if(["up","left"].indexOf(p)>-1&&!(1===n.length&&0===n[0].length)){if(o=[],"up"===p){let e=m.row-f.row+1,t=e%n.length;for(let r=0;r<e;r++)o.push(n[(r+(n.length-t))%n.length])}
31else{let e=m.col-f.col+1,t=e%n[0].length;for(let r=0;r<n.length;r++){o.push([]);for(let i=0;i<e;i++)o[r].push(n[r][(i+(n[r].length-t))%n[r].length])}}}if(t.some(e=>e.some(e=>(0,s.isObject)(e)))){let e=tL(tH,this,tF).call(this,o,t,f,m,p);e.length&&(o=e)}this.hot.populateFromArray(f.row,f.col,o,m.row,m.col,`${this.pluginName}.fill`,null),this.setSelection(g),this.hot.runHooks("afterAutofill",o,r,i,p),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){let t=this.hot.getSelectedRangeLast(),r=t.getBottomEndCorner(),i=e;if(this.directions.includes(t_.vertical)&&this.directions.includes(t_.horizontal)){let n=t.getTopStartCorner();(r.col<=e.col||n.col>=e.col)&&(i=this.hot._createCellCoords(r.row,e.col)),(r.row<e.row||n.row>e.row)&&(i=this.hot._createCellCoords(e.row,r.col))}else if(this.directions.includes(t_.vertical))i=this.hot._createCellCoords(e.row,r.col);else{if(!this.directions.includes(t_.horizontal))return;i=this.hot._createCellCoords(r.row,e.col)}return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){let t=this.getCoordsOfDragAndDropBorders(e);t&&this.redrawBorders(t)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter("insert_row_below",void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},200)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&!1===this.addingStarted&&this.autoInsertRow){let e=this.hot.getSelectedLast(),t=this.hot.selection.highlight.getFill().getVisualCorners(),r=this.hot.countRows();e[2]<r-1&&t[2]===r-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){let t;let r=this.hot.getData(),i=this.hot.countRows();for(let n=e[2]+1;n<i;n++){for(let t=e[1];t<=e[3];t++){let e=r[n][t];if(!(0,d.isEmpty)(e))return -1}let i=r[n][e[1]-1],o=r[n][e[3]+1];(0,d.isEmpty)(i)&&(0,d.isEmpty)(o)||(t=n)}return t}addSelectionFromStartAreaToSpecificRowIndex(e,t){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(t,e[3])).commit()}setSelection(e){this.hot.selectCell(...(0,c.arrayMap)(e,e=>Math.max(e,0)),!1,!1)}selectAdjacent(){let e=this.hot.getSelectedLast(),t=this.getIndexOfLastAdjacentFilledInRow(e);return -1!==t&&void 0!==t&&(this.addSelectionFromStartAreaToSpecificRowIndex(e,t),!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){let{documentElement:t}=this.hot.rootDocument,r=(0,n.offset)(this.hot.table).top-(this.hot.rootWindow.pageYOffset||t.scrollTop)+(0,n.outerHeight)(this.hot.table),i=(0,n.offset)(this.hot.table).left-(this.hot.rootWindow.pageXOffset||t.scrollLeft)+(0,n.outerWidth)(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){let{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>tL(tH,this,tj).call(this)),this.eventManager.addEventListener(e,"mousemove",e=>tL(tH,this,tG).call(this,e))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){let e=function(e){let t={};return!0===e?(t.directions=Object.keys(t_),t.autoInsertRow=!0):(0,s.isObject)(e)?((0,d.isDefined)(e.autoInsertRow)?e.direction===t_.horizontal?t.autoInsertRow=!1:t.autoInsertRow=e.autoInsertRow:t.autoInsertRow=!1,(0,d.isDefined)(e.direction)?t.directions=[e.direction]:t.directions=Object.keys(t_)):"string"==typeof e?(t.directions=[e],t.autoInsertRow=!0):(t.directions=[],t.autoInsertRow=!1),t}(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function tF(e,t,r,i){let n=[];for(let o=Math.min(r.row,i.row);o<=Math.max(r.row,i.row);o+=1){n.push([]);for(let a=Math.min(r.col,i.col);a<=Math.max(r.col,i.col);a+=1){let l=this.hot.getSourceDataAtCell(o,a),h=o-Math.min(r.row,i.row),u=a-Math.min(r.col,i.col),c=h%t.length,d=u%t[0].length;(0,s.isObject)(l)?n[h][u]=t[c][d]:n[h][u]=e[c][d]}}return n}function tV(){this.selectAdjacent()&&this.fillIn()}function tU(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function tW(e){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(e),this.addNewRowIfNeeded())}function tj(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function tG(e){let t=this.getIfMouseWasDraggedOutside(e);!1===this.addingStarted&&this.handleDraggedCells>0&&t?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function t$(e,t,r){tz(e,t),t.set(e,r)}function tz(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function tY(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tK(e,t,r){return e.set(tq(e,t),r),r}function tX(e,t){return e.get(tq(e,t))}function tq(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let tZ="autoRowSize",tQ="htFirstDatasetColumnNotRendered",tJ="htAutoRowSize";var t0=new WeakMap,t1=new WeakMap,t2=new WeakSet;class t5 extends tn.vq{static get PLUGIN_KEY(){return tZ}static get PLUGIN_PRIORITY(){return 40}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),tz(this,t2),t2.add(this),tY(this,"headerHeight",null),tY(this,"ghostTable",new ts.Z(this.hot)),tY(this,"samplesGenerator",new tl((e,t)=>{let r;let i=this.hot.toPhysicalColumn(t);return!this.hot.columnIndexMapper.isHidden(i)&&(!(e>=0)||!(t>=0)||!this.hot.getCellMeta(e,t).hidden)&&(e>=0?r=this.hot.getDataAtCell(e,t):-1===e&&(r=this.hot.getColHeader(t)),{value:r})})),tY(this,"inProgress",!1),tY(this,"measuredRows",0),tY(this,"rowHeightsMap",new tu.L),t$(this,t0,[]),t$(this,t1,!1),this.hot.rowIndexMapper.registerMap("autoRowSize",this.rowHeightsMap),this.addHook("beforeRowResize",(e,t,r)=>tq(t2,this,t8).call(this,e,t,r))}isEnabled(){let e=this.hot.getSettings()[tZ];return!0===e||(0,s.isObject)(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));let t=this.getSetting("samplingRatio");
31t&&!isNaN(t)&&this.samplesGenerator.setSampleCount(parseInt(t,10)),this.addHook("afterLoadData",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return tq(t2,e,t6).call(e,...r)}),this.addHook("beforeChangeRender",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return tq(t2,e,re).call(e,...r)}),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return tq(t2,e,rr).call(e,...r)}),this.addHook("beforeViewRender",()=>tq(t2,this,t4).call(this)),this.addHook("beforeRender",()=>tq(t2,this,t7).call(this)),this.addHook("modifyRowHeight",(e,t)=>this.getRowHeight(t,e)),this.addHook("init",()=>tq(t2,this,rt).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),(0,n.addClass)(this.hot.rootElement,tJ),super.enablePlugin()}disablePlugin(){this.headerHeight=null,(0,n.removeClass)(this.hot.rootElement,tJ),super.disablePlugin(),tq(t2,this,t9).call(this,!1),this.addHook("beforeRowResize",(e,t,r)=>tq(t2,this,t8).call(this,e,t,r))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;let e=this.getFirstVisibleRow(),t=this.getLastVisibleRow();if(-1===e||-1===t)return;let r=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:t},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i="number"==typeof e?{from:e,to:e}:e,n="number"==typeof t?{from:t,to:t}:t;if(null!==this.hot.getColHeader(0)){let e=this.samplesGenerator.generateRowSamples(-1,n);this.ghostTable.addColumnHeadersRow(e.get(-1))}(0,eH.rangeEach)(i.from,i.to,e=>{let t=this.hot.toPhysicalRow(e);null===t&&(t=e),(r||null===this.rowHeightsMap.getValueAtIndex(t))&&this.samplesGenerator.generateRowSamples(e,n).forEach((e,t)=>this.ghostTable.addRow(t,e))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((e,t)=>{e<0?this.headerHeight=t:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(e),t)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0,i=this.hot.countRows()-1,n=null;this.inProgress=!0;let o=()=>{if(!this.hot){(0,to.cancelAnimationFrame)(n),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+t5.CALCULATION_STEP,i)},e,t),(r=r+t5.CALCULATION_STEP+1)<i?n=(0,to.requestAnimationFrame)(o):((0,to.cancelAnimationFrame)(n),this.inProgress=!1,this.hot.view.adjustElementsSize())},s=this.getSyncCalculationLimit();s>=0&&(this.calculateRowsHeight({from:0,to:s},e,t),r=s+1),r<i?o():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){let e=this.hot.getSettings()[tZ],t=t5.SYNC_CALCULATION_LIMIT,r=this.hot.countRows()-1;return(0,s.isObject)(e)&&(t=e.syncLimit,(0,g.isPercentValue)(t)?t=(0,eH.valueAccordingPercent)(r,t):t>>=0),Math.min(t,r)}getRowHeight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.hot.stylesHandler.getDefaultRowHeight(e);if(e<0){var r;return null!==(r=this.headerHeight)&&void 0!==r?r:t}let i=this.hot.toPhysicalRow(e);if(this.hot.rowIndexMapper.isHidden(i))return t;let n=this.rowHeightsMap.getValueAtIndex(i),o=t;return null!==n&&n>t&&(o=n,this.hot.stylesHandler.isClassicTheme()||e!==this.hot.view.getFirstRenderedVisibleRow()||(o+=1)),o}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return null!==(e=this.hot.getFirstRenderedVisibleRow())&&void 0!==e?e:-1}getLastVisibleRow(){var e;return null!==(e=this.hot.getLastRenderedVisibleRow())&&void 0!==e?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>
31{e.forEach(e=>{this.rowHeightsMap.setValueAtIndex(e,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){let{from:t,to:r}="number"==typeof e?{from:e,to:e}:e;this.hot.batchExecution(()=>{(0,eH.rangeEach)(Math.min(t,r),Math.max(t,r),e=>{this.rowHeightsMap.setValueAtIndex(e,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>null===e).length}destroy(){this.ghostTable.clean(),super.destroy()}}function t3(e){let t={from:0,to:this.hot.countCols()-1};e.forEach(e=>{this.samplesGenerator.generateRowSamples(e,t).forEach((e,t)=>this.ghostTable.addRow(t,e))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((e,t)=>{let r=this.hot.toPhysicalRow(e);this.rowHeightsMap.setValueAtIndex(r,t)})},!0),this.ghostTable.clean())}function t9(e){let t=this.hot.getFirstRenderedVisibleColumn(),r=this.hot.columnIndexMapper.getPhysicalFromVisualIndex(t);!1===e||r===this.hot.columnIndexMapper.getPhysicalFromRenderableIndex(0)?(0,n.removeClass)(this.hot.rootElement,tQ):(0,n.addClass)(this.hot.rootElement,tQ)}function t4(){tq(t2,this,t9).call(this)}function t7(){this.calculateVisibleRowsHeight(),this.inProgress||(tq(t2,this,t3).call(this,tX(t0,this)),tK(t0,this,[]))}function t8(e,t,r){let i=e;return r&&(this.calculateRowsHeight(t,void 0,!0),i=this.getRowHeight(t)),i}function t6(e,t){t||this.recalculateAllRowsHeight()}function re(e){let t=e.reduce((e,t)=>{let[r]=t;return -1===e.indexOf(r)&&e.push(r),e},[]);tX(t0,this).push(...t)}function rt(){this.recalculateAllRowsHeight(),tK(t1,this,!0)}function rr(e){if(!tX(t1,this))return;let t=e.reduce((e,t)=>{var r;let i=null===(r=t.address)||void 0===r?void 0:r.row;if(Number.isInteger(i)){let t=this.hot.toVisualRow(i);-1===e.indexOf(t)&&e.push(t)}return e},[]);tX(t0,this).push(...t)}var ri=r(66128),rn=r(65624);let ro=new Map([["indexesSequence",{getListWithInsertedItems:ri.S,getListWithRemovedItems:ri.t}],["physicallyIndexed",{getListWithInsertedItems:rn.S,getListWithRemovedItems:rn.t}]]),rs=e=>{if(!1===ro.has(e))throw Error(`Alter strategy with ID '${e}' does not exist.`);return ro.get(e)};var ra=r(27861),rl=r(45116);let{getListWithInsertedItems:rh,getListWithRemovedItems:ru}=rs("physicallyIndexed");class rc extends ra.n{constructor(){super(e=>e)}insert(e,t){let r=(0,rl.X)(this.indexedValues,t);this.indexedValues=rh(r,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){let t=ru(this.indexedValues,e);this.indexedValues=(0,rl.i)(t,e),super.remove(e)}}let{getListWithInsertedItems:rd,getListWithRemovedItems:rg}=rs("physicallyIndexed");class rp extends ra.n{constructor(){super(e=>e)}insert(e,t){this.indexedValues=rd(this.indexedValues,e,t,(e,t)=>this.getNextValue(t)),super.insert(e,t)}remove(e){this.indexedValues=rg(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}let rf="bindRowsWithHeaders",rm=new Map([["loose",rc],["strict",rp]]);var ry=new WeakSet;class rv extends tn.vq{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,ry),ry.add(this),(e="symbol"==typeof(t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="headerIndexes","string"))?t:t+"")in this?Object.defineProperty(this,e,{value:null,enumerable:!0,configurable:!0,writable:!0}):this[e]=null}static get PLUGIN_KEY(){return rf}static get PLUGIN_PRIORITY(){return 210}isEnabled(){return!!this.hot.getSettings()[rf]}enablePlugin(){var e;if(this.enabled)return;let t=null!==(e=rm.get(this.getSetting()))&&void 0!==e?e:rm.get("loose");this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new t),this.addHook("modifyRowHeader",e=>(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")})(ry,this,rw).call(this,e)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function rw(e){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(e))}var rE=r(26247);function rS(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function rC(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rR(e,t,r){return e.set(rb(e,t),r),r}function rb(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let rT="collapsibleColumns",rN=["nestedHeaders"],rA="collapsibleIndicator",rI=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var rM=new WeakMap,rO=new WeakSet;class rx extends tn.vq{constructor(){super(...arguments),rS(this,rO),rO.add(this),rC(this,"nestedHeadersPlugin",null),rC(this,"headerStateManager",null),rS(this,rM),rM.set(this,null)}static get PLUGIN_KEY(){return rT}static get PLUGIN_PRIORITY(){return 290}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[rT,...rN]}isEnabled(){return!!this.hot.getSettings()[rT]}enablePlugin(){var e=this;if(this.enabled)return;let{nestedHeaders:t}=this.hot.getSettings();t||(0,rE.ZK)("You need to configure the Nested Headers plugin in order to use collapsible headers."),rR(rM,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>
31rb(rO,this,rL).call(this)),this.addHook("afterLoadData",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return rb(rO,e,rk).call(e,...r)}),this.addHook("afterGetColHeader",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return rb(rO,e,r_).call(e,...r)}),this.addHook("beforeOnCellMouseDown",(e,t,r)=>rb(rO,this,rP).call(this,e,t,r)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){let{collapsibleColumns:e}=this.hot.getSettings();"boolean"==typeof e?this.headerStateManager.mapState(e=>({collapsible:e.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),rR(rM,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;let{row:t,col:r}=this.hot.getSelectedRangeActive().highlight,{collapsible:i,isCollapsed:n,columnIndex:o}=null!==(e=this.headerStateManager.getHeaderTreeNodeData(t,r))&&void 0!==e?e:{};if(i)return n?this.expandSection({row:t,col:o}):this.collapseSection({row:t,col:o}),!1},runOnlyIf:()=>{var e,t;return(null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.isSingle())&&(null===(t=this.hot.getSelectedRangeActive())||void 0===t?void 0:t.highlight.isHeader())},group:rT,relativeToGroup:a.II,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(rT)}clearButtons(){if(!this.hot.view)return;let e=this.hot.view._wt.getSetting("columnHeaders").length,t=this.hot.view._wt.wtTable.THEAD,r=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,n=function(e){e&&e.parentNode.removeChild(e)};(0,eH.rangeEach)(0,e-1,e=>{let o=t.childNodes[e],s=r.childNodes[e],a=i?i.childNodes[e]:null;(0,eH.rangeEach)(0,o.childNodes.length-1,e=>{let t=o.childNodes[e].querySelector(`.${rA}`);n(t),s&&s.childNodes[e]&&n(t=s.childNodes[e].querySelector(`.${rA}`)),i&&a&&a.childNodes[e]&&n(t=a.childNodes[e].querySelector(`.${rA}`))})},!0)}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){let t=this.headerStateManager.mapNodes(t=>{let{collapsible:r,origColspan:i,headerLevel:n,columnIndex:o,isCollapsed:s}=t;if(!0===r&&i>1&&(s&&"expand"===e||!s&&"collapse"===e))return{row:this.headerStateManager.levelToRowCoords(n),col:o}});this.toggleCollapsibleSection(t,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,t){if(!rI.has(t))throw Error(`Unsupported action is passed (${t}).`);if(!Array.isArray(e))return;let r=(0,c.arrayFilter)(e,e=>{let{row:t}=e;return t<0}),i=r.length>0;(0,c.arrayEach)(r,e=>{var r;let{row:n,col:o}=e,{collapsible:s,isCollapsed:a}=null!==(r=this.headerStateManager.getHeaderSettings(n,o))&&void 0!==r?r:{};if(!s||a&&"collapse"===t||!a&&"expand"===t)return i=!1,!1});let n=[],o=[];i&&(0,c.arrayEach)(r,e=>{let{row:r,col:i}=e,{colspanCompensation:s,affectedColumns:a,rollbackModification:l}=this.headerStateManager.triggerNodeModification(t,r,i);s>0&&(o.push(...a),n.push(l))});let s=this.getCollapsedColumns(),a=[];"collapse"===t?a=(0,c.arrayUnique)([...s,...o]):"expand"===t&&(a=(0,c.arrayFilter)(s,e=>!o.includes(e)));let l=rI.get(t);if(!1===this.hot.runHooks(l.beforeHook,s,a,i)){(0,c.arrayEach)(n,e=>{e()});return}this.hot.batchExecution(()=>{(0,c.arrayEach)(o,e=>{rM.get(rb(rM,this)).setValueAtIndex(this.hot.toPhysicalColumn(e),l.hideColumn)})},!0);let h=this.getCollapsedColumns().length!==s.length,u=this.hot.getSelectedRangeActive();if("collapse"===t&&h&&u){let{row:e,col:t}=u.highlight;if((this.hot.rowIndexMapper.isHidden(e)||this.hot.columnIndexMapper.isHidden(t))&&o.includes(t)){let r=e>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(e,1,!0):e,i=t>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(t,1,!0):t;null!==r&&null!==i&&this.hot.selectCell(r,i)}}this.hot.runHooks(l.afterHook,s,a,i,h),this.hot.view.adjustElementsSize(),this.hot.render()}getCollapsedColumns(){return rM.get(rb(rM,this)).getHiddenIndexes()}destroy(){rR(rM,this,null),super.destroy()}}function r_(e,t,r){var i,o;let{collapsible:s,origColspan:a,isCollapsed:l}=null!==(i=this.headerStateManager.getHeaderSettings(r,e))&&void 0!==i?i:{},h=s&&a>1&&e>=this.hot.getSettings().fixedColumnsStart,u=this.hot.getSettings().ariaTags,c=t.querySelector(`.${rA}`);(0,n.removeAttribute)(t,[(0,m.JV)("")[0]]),h?(c||(c=this.hot.rootDocument.createElement("div"),(0,n.addClass)(c,rA),t.querySelector("div:first-child").appendChild(c)),(0,n.removeClass)(c,["collapsed","expanded"]),l?((0,n.addClass)(c,"collapsed"),(0,n.fastInnerText)(c,"+"),u&&(0,n.setAttribute)(t,...(0,m.JV)(!1))):((0,n.addClass)(c,"expanded"),(0,n.fastInnerText)(c,"-"),u&&(0,n.setAttribute)(t,...(0,m.JV)(!0))),u&&(0,n.setAttribute)(c,...(0,m.cV)())):null===(o=c)||void 0===o||o.remove()}function rP(e,t){(0,n.hasClass)(e.target,rA)&&((0,n.hasClass)(e.target,"expanded")?(this.eventManager.fireEvent(e.target,"mouseup"),this.toggleCollapsibleSection([t],"collapse")):(0,n.hasClass)(e.target,"collapsed")&&(this.eventManager.fireEvent(e.target,"mouseup"),this.toggleCollapsibleSection([t],"expand")),(0,o.stopImmediatePropagation)(e))}function rL(){this.updatePlugin()}function rk(e,t){t||this.updatePlugin()}
31var rD=r(84616),rH=r(25778);function rB(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let rF=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"];class rV{constructor(e,t){rB(this,"hot",void 0),rB(this,"sortingStates",new rH.A),rB(this,"sortEmptyCells",!1),rB(this,"indicator",!0),rB(this,"headerAction",!0),rB(this,"compareFunctionFactory",void 0),rB(this,"mapName",void 0),this.hot=e,this.mapName=t,this.hot.columnIndexMapper.registerMap(t,this.sortingStates)}updateAllColumnsProperties(e){(0,s.isObject)(e)&&(0,s.objectEach)(e,(e,t)=>{rF.includes(t)&&(this[t]=e)})}getAllColumnsProperties(){let e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return"function"==typeof this.compareFunctionFactory&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var t;return null===(t=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))||void 0===t?void 0:t.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(t=>{let[r]=t;return r===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return 0===this.getNumberOfSortedColumns()}isColumnSorted(e){return(0,s.isObject)(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return null===this.sortingStates?[]:this.sortingStates.getEntries().map(e=>{let[t,r]=e;return{column:this.hot.toVisualColumn(t),...r}})}getColumnSortState(e){let t=this.getSortOrderOfColumn(e);if((0,d.isDefined)(t))return{column:e,sortOrder:t}}setSortStates(e){this.sortingStates.clear();for(let t=0;t<e.length;t+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[t].column),{sortOrder:e[t].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function rU(e,t,r){let i=t.locale;return function(t,n){let{sortEmptyCells:o}=r;return("string"==typeof t&&(t=t.toLocaleLowerCase(i)),"string"==typeof n&&(n=n.toLocaleLowerCase(i)),t===n)?rq:(0,d.isEmpty)(t)?(0,d.isEmpty)(n)?rq:o&&"asc"===e?rZ:rQ:(0,d.isEmpty)(n)?o&&"asc"===e?rQ:rZ:isNaN(t)&&!isNaN(n)?"asc"===e?rQ:rZ:!isNaN(t)&&isNaN(n)?"asc"===e?rZ:rQ:(isNaN(t)||isNaN(n)||(t=parseFloat(t),n=parseFloat(n)),t<n)?"asc"===e?rZ:rQ:t>n?"asc"===e?rQ:rZ:rq}}r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975);let rW="default";var rj=r(14216);let{register:rG,getItem:r$,hasItem:rz}=(0,rj.Qv)("sorting.compareFunctionFactory"),{register:rY,getItem:rK}=(0,rj.Qv)("sorting.mainSortComparator");function rX(e){return rz(e)?r$(e):r$(rW)}rG("checkbox",function(e,t,r){let i=t.checkedTemplate,n=t.uncheckedTemplate,{sortEmptyCells:o}=r;return function(s,a){let l=(0,d.isEmpty)(s),h=(0,d.isEmpty)(a),u=l?n:s,c=h?n:a,g=u===n||u===i,p=c===n||c===i;if(!1===o){if(l&&!1===h)return rQ;if(!1===l&&h)return rZ}return!1===g&&p?"asc"===e?rZ:rQ:g&&!1===p?"asc"===e?rQ:rZ:!1===g&&!1===p?rU(e,t,r)(s,a):u===n&&c===i?"asc"===e?rZ:rQ:u===i&&c===n?"asc"===e?rQ:rZ:rq}}),rG("date",function(e,t,r){return r4(e,t.dateFormat,r)}),rG(rW,rU),rG("numeric",function(e,t,r){return function(t,i){let n=parseFloat(t),o=parseFloat(i),{sortEmptyCells:s}=r;if(n===o||isNaN(n)&&isNaN(o))return rq;if(s){if((0,d.isEmpty)(t))return"asc"===e?rZ:rQ;if((0,d.isEmpty)(i))return"asc"===e?rQ:rZ}return isNaN(n)?rQ:isNaN(o)?rZ:n<o?"asc"===e?rZ:rQ:n>o?"asc"===e?rQ:rZ:rq}}),rG("time",function(e,t,r){return r4(e,t.timeFormat,r)});let rq=0,rZ=-1,rQ=1;var rJ=r(80600);let r0="desc",r1="colHeader";function r2(e){return e===r0?void 0:"asc"===e?r0:"asc"}function r5(e){return e.querySelector(`.${r1}`)}function r3(e,t){if(e<0||!t.parentNode)return!1;let r=t.parentNode.parentNode.childNodes;return -1==Array.from(r).indexOf(t.parentNode)-r.length}function r9(e,t,r){return -1===e&&t>=0&&!1===(0,o.isRightClick)(r)}function r4(e,t,r){return function(i,n){let{sortEmptyCells:o}=r;if(i===n)return rq;if((0,d.isEmpty)(i))return(0,d.isEmpty)(n)?rq:o&&"asc"===e?rZ:rQ;if((0,d.isEmpty)(n))return o&&"asc"===e?rQ:rZ;let s=_(i,t),a=_(n,t);return s.isValid()?a.isValid()?a.isAfter(s)?"asc"===e?rZ:rQ:a.isBefore(s)?"asc"===e?rQ:rZ:rq:rZ:rQ}}let r7="indicatorDisabled",r8="columnSorting",r6="sortAction",ie=new Map([["asc","ascending"],[r0,"desce
31nding"]]);function it(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ir(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let ii="columnSorting",io="append";rY(ii,function(e,t){return function(r,i){let[,...n]=r,[,...o]=i;return function(r){let i=e[0],s=t[0],a=n[0],l=o[r],h=s.columnSorting;return(h.compareFunctionFactory?h.compareFunctionFactory:rX(s.type))(i,s,h)(a,l)}(0)}}),eN.P.getSingleton().register("beforeColumnSort"),eN.P.getSingleton().register("afterColumnSort");let is=new WeakMap;var ia=new WeakSet;class il extends tn.vq{constructor(){super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,ia),ia.add(this),it(this,"columnStatesManager",null),it(this,"columnMetaCache",null),it(this,"pluginKey",ii),it(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return ii}static get PLUGIN_PRIORITY(){return 50}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e,t,r=this;if(is.has(this.hot)&&is.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),e=is.get(this.hot),t=this.pluginKey,(0,rE.ZK)((0,rJ.e)`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
32    Only \`${e}\` will work. The \`${t}\` plugin will remain disabled.`);return}this.enabled||(is.set(this.hot,this.pluginKey),this.columnStatesManager=new rV(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new tu.L(e=>{let t=this.hot.toVisualColumn(e);return null===t&&(t=e),this.getMergedPluginSettings(t)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(e,t)=>ir(ia,this,iu).call(this,e,t)),this.addHook("beforeOnCellMouseDown",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return ir(ia,r,id).call(r,...t)}),this.addHook("afterOnCellMouseDown",(e,t)=>this.onAfterOnCellMouseDown(e,t)),this.addHook("afterInit",()=>ir(ia,this,ih).call(this)),this.addHook("afterLoadData",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return ir(ia,r,ic).call(r,...t)}),this.hot.view&&ir(ia,this,ih).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){let e=(e,t)=>{let r=r5(t);!1!==r3(e,t)&&null!==r&&this.updateHeaderClasses(r)};is.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{null!==this.indexesSequenceCache&&(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:()=>{let{highlight:e}=this.hot.getSelectedRangeActive();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,t;let r=null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight;return r&&(null===(t=this.hot.getSelectedRangeActive())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(r)&&-1===r.row&&r.col>=0},relativeToGroup:a.II,position:"before",group:ii})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(ii)}sort(e){let t=this.getSortConfig(),r=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(r);!1!==this.hot.runHooks("beforeColumnSort",t,r,i)&&(0===t.length&&null===this.indexesSequenceCac
32he&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new rD.b),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(r),this.sortByPresetSortStates(r),this.saveAllSortSettings(r)),this.hot.runHooks("afterColumnSort",t,i?r:t,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return(0,d.isDefined)(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){let t=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(t)&&this.columnStatesManager.setSortStates(t)}getNormalizedSortConfigs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){let t=this.hot.countCols();return function(e){if(e.some(e=>!1===function(e){if(!1===(0,s.isObject)(e))return!1;let{column:t,sortOrder:r}=e;return Number.isInteger(t)&&["asc",r0].includes(r)}(e)))return!1;let t=e.map(e=>{let{column:t}=e;return t});return new Set(t).size===t.length}(e)&&e.every(e=>{let{column:r}=e;return r<=t&&r>=0})}saveAllSortSettings(e){let t=this.columnStatesManager.getAllColumnsProperties();t.initialConfig=(0,c.arrayMap)(e,e=>{let{column:t,...r}=e;return{column:this.hot.toPhysicalColumn(t),...r}}),this.hot.runHooks("persistentStateSave","columnSorting",t)}getAllSavedSortSettings(){let e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);let t=e.value;return(0,d.isDefined)(t)&&Array.isArray(t.initialConfig)&&(t.initialConfig=(0,c.arrayMap)(t.initialConfig,e=>{let{column:t,...r}=e;return{column:this.hot.toVisualColumn(t),...r}})),t}getColumnNextConfig(e){let t=this.columnStatesManager.getSortOrderOfColumn(e);if((0,d.isDefined)(t)){let r=r2(t);return(0,d.isDefined)(r)?{column:e,sortOrder:r}:void 0}let r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:r2()}}getNextSortConfig(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:io,r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=-1!==r,n=this.getSortConfig(),o=this.getColumnNextConfig(e);if(i){if((0,d.isUndefined)(o))return[...n.slice(0,r),...n.slice(r+1)];if(t===io)return[...n.slice(0,r),...n.slice(r+1),o];if("replace"===t)return[...n.slice(0,r),o,...n.slice(r+1)]}return(0,d.isDefined)(o)?n.concat(o):n}getPluginColumnConfig(e){if((0,s.isObject)(e)){let t=e[this.pluginKey];if((0,s.isObject)(t))return t}return{}}getMergedPluginSettings(e){let t=this.hot.getSettings()[this.pluginKey],r=this.columnStatesManager.getAllColumnsProperties(),i=Object.getPrototypeOf(this.hot.getCellMeta(0,e));return Array.isArray(i.columns)?Object.assign(r,t,this.getPluginColumnConfig(i.columns[e])):(0,y.isFunction)(i.columns)?Object.assign(r,t,this.getPluginColumnConfig(i.columns(e))):Object.assign(r,t)}getFirstCellSettings(e){let t=Object.create(this.hot.getCellMeta(0,e));return t[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),t}getNumberOfRowsToSort(e){let t=this.hot.getSettings();return t.maxRows<=e?t.maxRows:e-t.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),0===e.length)return;let t=[],r=this.hot.countRows(),i=t=>(0,c.arrayMap)(e,e=>this.hot.getDataAtCell(t,e.column));for(let e=0;e<this.getNumberOfRowsToSort(r);e+=1)t.push([this.hot.toPhysicalRow(e)].concat(i(e)));let n=(0,c.arrayMap)(t,e=>e[0]);!function(e,t){let r=rK(t);for(var i=arguments.length,n=Array(i>2?i-2:0),o=2;o<i;o++)n[o-2]=arguments[o];e.sort(r(...n))}(t,this.pluginKey,(0,c.arrayMap)(e,e=>e.sortOrder),(0,c.arrayMap)(e,e=>this.getFirstCellSettings(e.column)));for(let e=t.length;e<r;e+=1)t.push([e].concat(i(e)));let o=(0,c.arrayMap)(t,e=>e[0]),s=new Map((0,c.arrayMap)(n,(e,t)=>[e,o[t]])),a=(0,c.arrayMap)(this.hot.rowIndexMapper.getIndexesSequence(),e=>s.has(e)?s.get(e):e);this.hot.rowIndexMapper.setIndexesSequence(a)}sortBySettings(e){if((0,s.isObject)(e)){this.columnStatesManager.updateAllColumnsProperties(e);let t=e.initialConfig;(Array.isArray(t)||(0,s.isObject)(t))&&this.sort(t)}else this.hot.render()}updateHeaderClasses(e){if((0,n.removeClass)(e,Array.from(ie.values()).concat(r6,r7,r8)),!1!==this.enabled){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];(0,n.addClass)(e,function(e,t,r,i){let n=[r8];if(i&&n.push(r6),!1===r)return n.push(r7),n;let o=e.getSortOrderOfColumn(t);return(0,d.isDefined)(o)&&n.push(ie.get(o)),n}(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),null!==this.columnMetaCache&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexe
32s()),(0,d.isDefined)(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,t){return this.getFirstCellSettings(t)[this.pluginKey].headerAction&&(0,n.hasClass)(e.target,r1)}onAfterOnCellMouseDown(e,t){if(!1!==r9(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(t.col));let e=this.hot.getActiveEditor(),r=this.getColumnNextConfig(t.col);null!=e&&e.isOpened()&&this.hot.getCellValidator(e.row,e.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(r)}):this.sort(r)}}destroy(){var e;null===(e=this.columnStatesManager)||void 0===e||e.destroy(),super.destroy()}}function ih(){let e=this.getAllSavedSortSettings();if((0,s.isObject)(e))this.sortBySettings(e);else{let e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function iu(e,t){let r=r5(t);if(!1===r3(e,t)||null===r)return;let i=this.getFirstCellSettings(e)[this.pluginKey],o=i.indicator,s=i.headerAction;if(this.updateHeaderClasses(r,this.columnStatesManager,e,o,s),this.hot.getSettings().ariaTags){let r=this.columnStatesManager.getSortOrderOfColumn(e);(0,n.setAttribute)(t,...(0,m.l_)(r?`${r}ending`:"none"))}}function ic(e){!0===e&&this.hot.view&&ir(ia,this,ih).call(this)}function id(e,t,r,i){!1!==r9(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(i.column=!0)}function ig(e){return null==e||isNaN(e)}function ip(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class im{constructor(e,t){ip(this,"plugin",void 0),ip(this,"hot",void 0),ip(this,"endpoints",[]),ip(this,"settings",void 0),ip(this,"settingsType","array"),ip(this,"currentEndpoint",null),ip(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=t}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return"function"===this.settingsType?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return"function"===this.settingsType?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){let t=[],r=e;if(!r&&"function"==typeof this.settings){this.settingsType="function";return}return r||(r=this.settings),(0,c.arrayEach)(r,e=>{let r={};this.assignSetting(e,r,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(e,r,"reversedRowCoords",!1),this.assignSetting(e,r,"destinationRow",Error(`
33        You must provide a destination row for the Column Summary plugin in order to work properly!
34      `)),this.assignSetting(e,r,"destinationColumn",Error(`
35        You must provide a destination column for the Column Summary plugin in order to work properly!
36      `)),this.assignSetting(e,r,"sourceColumn",e.destinationColumn),this.assignSetting(e,r,"type","sum"),this.assignSetting(e,r,"forceNumeric",!1),this.assignSetting(e,r,"suppressDataTypeErrors",!0),this.assignSetting(e,r,"customFunction",null),this.assignSetting(e,r,"readOnly",!0),this.assignSetting(e,r,"roundFloat",!1),t.push(r)}),t}assignSetting(e,t,r,i){if("ranges"===r&&void 0===e[r]){t[r]=i;return}if("ranges"!==r||0!==e[r].length){if(void 0===e[r]){if(i instanceof Error)throw i;t[r]=i}else"destinationRow"===r&&t.reversedRowCoords?t[r]=this.hot.countRows()-e[r]-1:t[r]=e[r]}}resetSetupBeforeStructureAlteration(e,t,r){if("function"!==this.settingsType)return;let i=e.indexOf("row")>-1?"row":"col",n=this.getAllEndpoints();(0,c.arrayEach)(n,n=>{"row"===i&&n.destinationRow>=t&&("insert_row"===e?n.alterRowOffset=r:"remove_row"===e&&(n.alterRowOffset=-1*r)),"col"===i&&n.destinationColumn>=t&&("insert_col"===e?n.alterColumnOffset=r:"remove_col"===e&&(n.alterColumnOffset=-1*r))}),this.resetAllEndpoints(n,!1)}resetSetupAfterStructureAlteration(e,t,r,i,n){let o=!(arguments.length>5)||void 0===arguments[5]||arguments[5];if("auto"===n)return;if("function"===this.settingsType){let e=()=>(this.hot.removeHook("beforeViewRender",e),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",e);return}let s=e.indexOf("row")>-1?"row":"col",a=e.indexOf("remove")>-1?-1:1,l=this.getAllEndpoints(),h=0===e.indexOf("move_row");(0,c.arrayEach)(l,e=>{"row"===s&&e.destinationRow>=t&&(e.alterRowOffset=a*r),"col"===s&&e.destinationColumn>=t&&(e.alterColumnOffset=a*r)}),this.resetAllEndpoints(l,!h),h?(0,c.arrayEach)(l,e=>{this.extendEndpointRanges(e,t,i[0],i.length),this.recreatePhysicalRanges(e),this.clearOffsetInformation(e)}):(0,c.arrayEach)(l,e=>{this.shiftEndpointCoordinates(e,t)}),o&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,t,r,i){(0,c.arrayEach)(e.ranges,e=>{e[1]&&(t>=e[0]&&t<=e[1]?r>e[1]?e[1]+=i:r<e[0]&&(e[0]-=i):r>=e[0]&&r<=e[1]&&(e[1]-=i,t<=e[0]&&(e[0]+=1,e[1]+=1)))})}recreatePhysicalRanges(e){let t=e.ranges,r=[],i=[];(0,c.arrayEach)(t,e=>{let t=[];if(e[1])for(let r=e[0];r<=e[1];r++)t.push(this.hot.toPhysicalRow(r));else t.push(this.hot.toPhysicalRow(e[0]));i.push(t)}),(0,c.arrayEach)(i,e=>{let t=[];(0,c.arrayEach)(e,(i,n)=>{0===n?t.push(i):e[n]!==e[n-1]+1&&(t.push(e[n-1]),r.push(t),(t=[]).push(i)),n===e.length-1&&(t.push(i),r.push(t))})}),e.ranges=r}shiftEndpointCoordinates(e,t){e.alterRowOffset&&0!==e.alterRowOffset?(e.destinationRow+=e.alterRowOffset||0,(0,c.arrayEach)(e.ranges,r=>{(0,c.arrayEach)(r,(i,n)=>{i>=t&&(r[n]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&0!==e.alterColumnOffset&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAllEndpoints(),t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];e.some(e=>{let t=e.alterRowOffset||0,r=e.alterColumnOffset||0;return!!(e.destinationRow+t>=this.hot.countRows()||e.destinationColumn+r>=this.hot.countCols())})||(this.cellsToSetCache=[],(0,c.arrayEach)(e,e=>{this.resetEndpointValue(e,t)}),this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],(0,c.arrayEach)(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){let t=[];this.cellsToSetCache=[],(0,c.arrayEach)(e,(e,r,i)=>{`${e[2]||""}`!=`${e[3]}`&&(0,c.arrayEach)(this.getAllEndpoints(),(e,n)=>{this.hot.propToCol(i[r][1])===e.sourceColumn&&-1===t.indexOf(n)&&t.push(n)})}),(0,c.arrayEach)(t,e=>{this.refreshEndpoint(this.getEndpoint(e))}),this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}
36refreshCellMetas(){this.endpoints.forEach(e=>{let t=this.hot.toVisualRow(e.destinationRow);if(null!==t){let r=this.hot.getCellMeta(t,e.destinationColumn);r.readOnly=e.readOnly,r.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(t?r:0)),this.hot.toVisualColumn(e.destinationColumn+(t?i:0)),""])}setEndpointValue(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}let n=this.hot.toVisualRow(e.destinationRow);if(null!==n){let r=this.hot.getCellMeta(n,e.destinationColumn);("init"===t||r.readOnly!==e.readOnly)&&(r.readOnly=e.readOnly,r.className="columnSummaryResult")}e.result=function(e,t){if("number"!=typeof e)return e;let r=e=>e.toString();switch(typeof t){case"number":return r(e.toFixed(Math.min(Math.max(0,t),100)));case"boolean":return t?r(Math.round(e)):e;case"string":if("auto"===t){let t=Math.round(e).toString().length;return r(e.toFixed(8-t))}return e;default:return e}}(e.result,e.roundFloat),r?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(){(0,rE.ZK)("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function iy(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let iv="columnSummary";var iw=new WeakSet;class iE extends tn.vq{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,iw),iw.add(this),(e="symbol"==typeof(t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="endpoints","string"))?t:t+"")in this?Object.defineProperty(this,e,{value:null,enumerable:!0,configurable:!0,writable:!0}):this[e]=null}static get PLUGIN_KEY(){return iv}static get PLUGIN_PRIORITY(){return 220}isEnabled(){return!!this.hot.getSettings()[iv]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[iv],this.endpoints=new im(this,this.settings),this.addHook("afterInit",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return iy(iw,e,iS).call(e,...r)}),this.addHook("afterChange",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return iy(iw,e,iR).call(e,...r)}),this.addHook("afterUpdateSettings",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return iy(iw,e,iC).call(e,...r)}),this.addHook("afterLoadData",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return iy(iw,e,ib).call(e,...r)}),this.addHook("afterUpdateData",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return iy(iw,e,iT).call(e,...r)}),this.addHook("beforeCreateRow",(e,t,r)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",e,t,null,r)),this.addHook("beforeCreateCol",(e,t,r)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",e,t,null,r)),this.addHook("beforeRemoveRow",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...r)}),this.addHook("beforeRemoveCol",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...r)}),this.addHook("afterCreateRow",(e,t,r)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",e,t,null,r)),this.addHook("afterCreateCol",(e,t,r)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",e,t,null,r)),this.addHook("afterRemoveRow",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...r)}),this.addHook("afterRemoveCol",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...r)}),this.addHook("afterRowMove",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return iy(iw,e,iN).call(e,...r)}),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":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;
36case"custom":e.result=e.customFunction.call(this,e)}}calculateSum(e){let t=0;return(0,s.objectEach)(e.ranges,r=>{t+=this.getPartialSum(r,e.sourceColumn)}),t}getPartialSum(e,t){let r=0,i=e[1]||e[0],n=null,o=0;do{if(null!==(n=ig(n=this.getCellValue(i,t))?null:n)){let e=(`${n}`.split(".")[1]||[]).length||1;e>o&&(o=e)}r+=n||0,i-=1}while(i>=e[0]);return Math.round(r*10**o)/10**o}calculateMinMax(e,t){let r=null;return(0,s.objectEach)(e.ranges,i=>{let n=this.getPartialMinMax(i,e.sourceColumn,t);if(null===r&&null!==n&&(r=n),null!==n)switch(t){case"min":r=Math.min(r,n);break;case"max":r=Math.max(r,n)}}),null===r?"Not enough data":r}getPartialMinMax(e,t,r){let i,n=null,o=e[1]||e[0];do{if(i=ig(i=this.getCellValue(o,t))?null:i,null===n)n=i;else if(null!==i)switch(r){case"min":n=Math.min(n,i);break;case"max":n=Math.max(n,i)}o-=1}while(o>=e[0]);return n}countEmpty(e,t){let r;let i=0,n=e[1]||e[0];do null===(r=ig(r=this.getCellValue(n,t))?null:r)&&(i+=1),n-=1;while(n>=e[0]);return i}countEntries(e){let t=0,r=e.ranges;return(0,s.objectEach)(r,r=>{let i=void 0===r[1]?1:r[1]-r[0]+1,n=this.countEmpty(r,e.sourceColumn);t+=i,t-=n}),t}calculateAverage(e){return this.calculateSum(e)/this.countEntries(e)}getCellValue(e,t){let r=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(t),n=this.hot.getSourceDataAtCell(e,t),o="";if(null!==r&&null!==i&&(o=this.hot.getCellMeta(r,i).className||""),o.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&("string"==typeof n&&(n=n.replace(/,/,".")),n=parseFloat(n)),isNaN(n)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw Error((0,rJ.e)`ColumnSummary plugin: cell at (${e}, ${t}) is not in a\x20
37          numeric format. Cannot do the calculation.`);return n}}function iS(){this.endpoints.initEndpoints()}function iC(e){void 0!==e.columns&&this.endpoints.refreshCellMetas()}function iR(e,t){e&&"ColumnSummary.reset"!==t&&"ColumnSummary.set"!==t&&"loadData"!==t&&this.endpoints.refreshChangedEndpoints(e)}function ib(e,t){t||this.endpoints.refreshAllEndpoints()}function iT(e,t){t||this.endpoints.refreshAllEndpoints()}function iN(e,t){this.endpoints.resetSetupBeforeStructureAlteration("move_row",e[0],e.length,e,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",t,e.length,e,this.pluginName)}var iA=r(77718),iI=r(65166);function iM(e,t,r){iO(e,t),t.set(e,r)}function iO(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function ix(e,t){return e.get(iP(e,t))}function i_(e,t,r){return e.set(iP(e,t),r),r}function iP(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var iL=new WeakMap,ik=new WeakMap,iD=new WeakMap,iH=new WeakSet;class iB{constructor(){iO(this,iH),iH.add(this),iM(this,iL,!0),iM(this,ik,null),iM(this,iD,new ResizeObserver(e=>iP(iH,this,iF).call(this,e)))}setObservedElement(e){i_(ik,this,e)}unobserve(){ix(iD,this).unobserve(ix(ik,this))}observe(){i_(iL,this,!0),ix(iD,this).observe(ix(ik,this))}destroy(){ix(iD,this).disconnect()}}function iF(e){if(ix(iL,this)||!Array.isArray(e)||!e.length){i_(iL,this,!1);return}e.forEach(e=>{let{borderBoxSize:t}=e,{inlineSize:r,blockSize:i}=t[0];this.runLocalHooks("resize",r,i)})}function iV(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function iU(e,t){return e.get(ij(e,t))}function iW(e,t,r){return e.set(ij(e,t),r),r}function ij(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}(0,s.mixin)(iB,iI.Z);var iG=new WeakMap,i$=new WeakMap,iz=new WeakMap,iY=new WeakMap,iK=new WeakMap,iX=new WeakMap,iq=new WeakMap,iZ=new WeakMap;class iQ{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,t,r){var i=this;iV(this,iG,void 0),iV(this,i$,void 0),iV(this,iz,!1),iV(this,iY,null),iV(this,iK,void 0),iV(this,iX,void 0),iV(this,iq,!0),iV(this,iZ,new iB),iW(iG,this,e),iW(i$,this,r),iW(iz,this,t),iW(iK,this,this.createEditor()),iW(iX,this,iU(iK,this).style),iU(iZ,this).setObservedElement(this.getInputElement()),iU(iZ,this).addLocalHook("resize",function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.runLocalHooks("resize",...t)}),this.hide()}setPosition(e,t){iU(iX,this).left=`${e}px`,iU(iX,this).top=`${t}px`}setSize(e,t){if(e&&t){let r=this.getInputElement();r.style.width=`${e}px`,r.style.height=`${t}px`}}getSize(){return{width:(0,n.outerWidth)(this.getInputElement()),height:(0,n.outerHeight)(this.getInputElement())}}observeSize(){iU(iZ,this).observe()}resetSize(){let e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){this.getInputElement().readOnly=e}show(){iU(iX,this).display="block",iW(iq,this,!1)}hide(){iU(iZ,this).unobserve(),iU(iq,this)||(iU(iX,this).display="none"),iW(iq,this,!0)}isVisible(){return"block"===iU(iX,this).display}setValue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.getInputElement().value=e||""}getValue(){return this.getInputElement().value}isFocused(){return iU(iG,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){let e=iU(iG,this).createElement("div"),t=iU(iG,this).createElement("textarea");return e.style.display="none",iW(iY,this,iU(iG,this).createElement("div")),iU(iY,this).setAttribute("dir",iU(iz,this)?"rtl":"ltr"),(0,n.addClass)(iU(iY,this),iQ.CLASS_EDITOR_CONTAINER),iU(i$,this).appendChild(iU(iY,this)),(0,n.addClass)(e,iQ.CLASS_EDITOR),(0,n.addClass)(t,iQ.CLASS_INPUT),t.setAttribute("data-hot-input",!0),e.appendChild(t),iU(iY,this).appendChild(e),e}getInputElement(){return iU(iK,this).querySelector(`.${iQ.CLASS_INPUT}`)}getEditorElement(){return iU(iK,this)}destroy(){let e=iU(iY,this)?iU(iY,this).parentNode:null;iU(iK,this).parentNode.removeChild(iU(iK,this)),iW(iK,this,null),iW(iX,this,null),iU(iZ,this).destroy(),e&&e.removeChild(iU(iY,this))}}function iJ(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,s.mixin)(iQ,iI.Z);class i0{constructor(e){iJ(this,"wasLastActionShow",!0),iJ(this,"showDebounced",null),iJ(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{!1===this.wasLastActionShow&&this.runLocalHooks("hide")},250)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250;this.showDebounced=(0,y.debounce)(e=>{this.wasLastActionShow&&this.runLocalHooks("show",e.from.row,e.from.col)},e)}destroy(){this.clearLocalHooks()}}(0,s.mixin)(i0,iI.Z);let i1="---------";function i2(e,t){let r={};return(0,c.arrayEach)(e,e=>{e.forAll((e,i)=>{e>=0&&i>=0&&(r[e]||(r[e]=[]),r[e][i]=t(e,i))})}),r}function i5(e,t,r,i,n){(0,c.arrayEach)(e,e=>{e.forAll((e,o)=>{e>=0&&o>=0&&function(e,t,r,i,n,o){let s=n(e,t),a=i;s.className&&(a="vertical"===r?function(e,t){if(-1!==e.indexOf(t))return e;let r=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace("  ","");return`${r} ${t}`}(s.className,i):function(e,t){if(-1!==e.indexOf(t))return e;let r=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace("  ","");return`${r} ${t}`}(s.className,i)),o(e,t,"className",a)}(e,o,t,r,i,n)})})}function i3(e){return`<span class="selected">${String.fromCharCode(10003)}</span>${e}`}function i9(e,t){let r=!1;return Array.isArray(e)&&(0,c.arrayEach)(e,e=>(e.forAll((e,i)=>{if(e>=0&&i>=0&&t(e,i))return r=!0,!1}),r)),r}function i4(e,t){let r={top:0,left:0};if(t!==e.ownerDocument){let{frameElement:e}=t.defaultView,{top:i,left:n}=e.getBoundingClientRect();r.top=i,r.left=n}return r}function i7(e,t,r){i8(e,t),t.set(e,r)}function i8(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function i6(e,t,r){return e.set(nt(e,t),r),r}function ne(e,t){return e.get(nt(e,t))}function nt(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let nr="comments",ni="comment",nn="value",no="style",ns="readOnly",na=`plugin:${nr}`;var nl=new WeakMap,nh=new WeakMap,nu=new WeakMap,nc=new WeakMap,nd=new WeakMap,ng=new WeakMap,np=new WeakMap,nf=new WeakSet;class nm extends tn.vq{constructor(){var e,t,r;super(...arguments),i8(this,nf),nf.add(this),t={},(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="range","string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t,i7(this,nl,null),i7(this,nh,null),i7(this,nu,!1),i7(this,nc,!1),i7(this,nd,!1),i7(this,ng,null),i7(this,np,"")}static get PLUGIN_KEY(){return nr}static get PLUGIN_PRIORITY(){return 60}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[nr]}enablePlugin(){var e=this;this.enabled||(ne(nl,this)||(i6(nl,this,new iQ(this.hot.rootDocument,this.hot.isRtl(),this.hot.rootPortalElement)),ne(nl,this).addLocalHook("resize",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return nt(nf,e,nb).call(e,...r)}),this.hot.addHook("afterSetTheme",(e,t)=>{t||this.hide()})),ne(nh,this)||i6(nh,this,new i0(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",e=>this.addToContextMenu(e)),this.addHook("afterRenderer",(e,t,r,i,n,o)=>nt(nf,this,nS).call(this,e,o)),this.addHook("afterScroll",()=>nt(nf,this,nN).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",e=>nt(nf,this,nT).call(this,e)),this.addHook("beforeCompositionStart",e=>nt(nf,this,nT).call(this,e)),ne(nh,this).addLocalHook("hide",()=>this.hide()),ne(nh,this).addLocalHook("show",(e,t)=>this.showAtCell(e,t)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){ne(nh,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){let e=this.hot.getShortcutManager(),t=e.getContext("grid"),r=e.addContext(na);t.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{let t=this.hot.getSelectedRangeActive();i6(nc,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(t),this.show(),this.focusEditor(),e.setActiveContextName(na),this.hot._registerTimeout(()=>{i6(nc,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var e;return null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight.isCell()},group:nr}),r.addShortcut({keys:[["Escape"]],callback:()=>{ne(nl,this).setValue(ne(np,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>ne(nl,this).isVisible()&&ne(nl,this).isFocused(),group:nr}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>ne(nl,this).isVisible()&&ne(nl,this).isFocused(),group:nr}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{i6(nd,this,!0),ne(nl,this).setValue(ne(nl,this).getValue()),this.setComment(),this.hide(),e.setActiveContextName("grid")},group:nr})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(nr)}registerListeners(){let{rootDocument:e}=this.hot,t=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",e=>nt(nf,this,nw).call(this,e)),this.eventManager.addEventListener(e,"mousedown",e=>nt(nf,this,ny).call(this,e)),this.eventManager.addEventListener(e,"mouseup",()=>nt(nf,this,nE).call(this)),this.eventManager.addEventListener(t,"focus",()=>nt(nf,this,nR).call(this)),this.eventManager.addEventListener(t,"blur",()=>nt(nf,this,nC).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",e=>
37nt(nf,this,nv).call(this,e))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){let t=(0,n.closest)(e.target,"TD","TBODY");return!!(t&&(0,n.hasClass)(t,"htCommentCell")&&(0,n.closest)(t,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');let t=ne(nl,this).getValue(),r="";null!=e?r=e:null!=t&&(r=t);let{row:i,col:n}=nt(nf,this,nA).call(this);this.updateCommentMeta(i,n,{[nn]:r}),this.hot.render()}setCommentAtCell(e,t,r){this.setRange({from:this.hot._createCellCoords(e,t)}),this.setComment(r)}removeComment(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(!this.range.from)throw Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');let{row:t,col:r}=nt(nf,this,nA).call(this);this.hot.setCellMeta(t,r,ni),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];this.setRange({from:this.hot._createCellCoords(e,t)}),this.removeComment(r)}getComment(){let{row:e,col:t}=nt(nf,this,nA).call(this);return this.getCommentMeta(e,t,nn)}getCommentAtCell(e,t){return this.getCommentMeta(e,t,nn)}show(){var e;if(!this.range.from)throw Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');let{row:t,col:r}=nt(nf,this,nA).call(this);if(t<0||t>this.hot.countSourceRows()-1||r<0||r>this.hot.countSourceCols()-1)return!1;let i=this.hot.getCellMeta(t,r);return ne(nh,this).cancelHiding(),ne(nl,this).setValue(null!==(e=i[ni]?i[ni][nn]:null)&&void 0!==e?e:""),ne(nl,this).show(),this.refreshEditor(!0),!0}showAtCell(e,t){return this.setRange({from:this.hot._createCellCoords(e,t)}),this.show()}hide(){ne(nl,this).hide()}refreshEditor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&(!this.range.from||!ne(nl,this).isVisible()))return;let{rowIndexMapper:t,columnIndexMapper:r}=this.hot,{row:i,col:o}=nt(nf,this,nA).call(this),s=t.getRenderableFromVisualIndex(i),a=r.getRenderableFromVisualIndex(o),l=null===s;ne(nl,this).setPosition(0,0),null===s&&(s=t.getRenderableFromVisualIndex(t.getNearestNotHiddenIndex(i,-1))),null===a&&(a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o,-1)));let h=null===s,u=null===a;s=null!=s?s:0,a=null!=a?a:0;let{rootWindow:c,view:{_wt:d}}=this.hot,{wtTable:g}=d,p=d.getCell({row:s,col:a},!0),f=this.getCommentMeta(i,o,no);f?ne(nl,this).setSize(f.width,f.height):ne(nl,this).resetSize();let m=u?0:g.getColumnWidth(a),y=l&&!h?(0,n.outerHeight)(p):0,{left:w,top:E,width:S,height:C}=p.getBoundingClientRect(),{width:R,height:b}=ne(nl,this).getSize(),{innerWidth:T,innerHeight:N}=this.hot.rootWindow,A=this.hot.rootDocument.documentElement,I=(0,n.getScrollbarWidth)(this.hot.rootDocument),M=(0,n.hasVerticalScrollbar)(this.hot.rootWindow)?I:0,O=(0,n.hasHorizontalScrollbar)(this.hot.rootWindow)?I:0,x=w+c.scrollX+m,_=E+c.scrollY+y;this.hot.isRtl()&&(x-=R+m),this.hot.isLtr()&&w+S+R>T-M?x=w+c.scrollX-R-1:this.hot.isRtl()&&x<-(A.scrollWidth-A.clientWidth)&&(x=w+c.scrollX+m+1),E+b>N-O&&(_-=b-C+1),ne(nl,this).setPosition(x,_),ne(nl,this).setReadOnlyState(this.getCommentMeta(i,o,ns)),ne(nl,this).observeSize()}focusEditor(){ne(nl,this).focus()}updateCommentMeta(e,t,r){let i;let n=this.hot.getCellMeta(e,t)[ni];n?(i=(0,s.deepClone)(n),(0,s.deepExtend)(i,r)):i=r,this.hot.setCellMeta(e,t,ni,i)}getCommentMeta(e,t,r){let i=this.hot.getCellMeta(e,t);if(i[ni])return i[ni][r]}addToContextMenu(e){var t,r,i;e.items.push({name:i1},(t=this,{key:"commentsAddEdit",name(){var e;let r=null===(e=this.getSelectedRangeActive())||void 0===e?void 0:e.highlight;return null!=r&&r.isCell()&&t.getCommentAtCell(r.row,r.col)?this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_EDIT_COMMENT):this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ADD_COMMENT)},callback(){let e=this.getSelectedRangeActive();t.setRange(e),t.show(),t.focusEditor()},disabled(){let e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected())||0===this.countRenderedRows()||0===this.countRenderedCols()}}),(r=this,{key:"commentsRemove",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_REMOVE_COMMENT)}
37,callback(){this.getSelectedRangeActive().forAll((e,t)=>{e>=0&&t>=0&&r.removeCommentAtCell(e,t,!1)}),this.render()},disabled(){let e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected())||0===this.countRenderedRows()||0===this.countRenderedCols()}}),(i=this,{key:"commentsReadOnly",name(){let e=this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT);return i9(this.getSelectedRange(),(e,t)=>i.getCommentMeta(e,t,ns))?i3(e):e},callback(){this.getSelectedRangeActive().forAll((e,t)=>{if(e>=0&&t>=0){let r=!!i.getCommentMeta(e,t,ns);i.updateCommentMeta(e,t,{[ns]:!r})}})},disabled(){let e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||!i.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected())||0===this.countRenderedRows()||0===this.countRenderedCols()}}))}getEditorInputElement(){return ne(nl,this).getInputElement()}destroy(){var e,t;null===(e=ne(nl,this))||void 0===e||e.destroy(),null===(t=ne(nh,this))||void 0===t||t.destroy(),super.destroy()}}function ny(e){if(this.hot.view&&this.hot.view._wt&&!ne(nu,this)&&!this.targetIsCommentTextArea(e)){let t=(0,n.closest)(e.target,"TD","TBODY"),r=null;t&&(r=this.hot.getCoords(t)),(!t||this.range.from&&r&&(this.range.from.row!==r.row||this.range.from.col!==r.col))&&this.hide()}}function nv(e){e.stopPropagation()}function nw(e){let{rootDocument:t}=this.hot;if(!(ne(nu,this)||ne(nl,this).isFocused()||(0,n.hasClass)(e.target,"wtBorder"))&&ne(ng,this)!==e.target&&ne(nl,this)){if(i6(ng,this,t.elementFromPoint(e.clientX,e.clientY)),this.targetIsCellWithComment(e)){let t=this.hot._createCellRange(this.hot.getCoords(e.target));ne(nh,this).show(t)}else(0,n.isChildOf)(e.target,t)&&!this.targetIsCommentTextArea(e)&&ne(nh,this).hide()}}function nE(){i6(nu,this,!1)}function nS(e,t){t[ni]&&t[ni][nn]&&(0,n.addClass)(e,t.commentedCellClassName)}function nC(){if(ne(nd,this)){i6(nd,this,!1);return}i6(np,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}
37function nR(){i6(np,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(na)}function nb(e,t){let{row:r,col:i}=nt(nf,this,nA).call(this);this.updateCommentMeta(r,i,{[no]:{width:e,height:t}})}function nT(e){ne(nl,this).isFocused()&&(0,o.stopImmediatePropagation)(e)}function nN(){ne(nc,this)||this.hide()}function nA(){return this.range instanceof iA.Z?this.range.highlight:this.hot._createCellCoords(this.range.from.row,this.range.from.col)}function nI(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r(9784);class nM{constructor(e){nI(this,"hot",void 0),nI(this,"commands",{}),nI(this,"commonCallback",null),this.hot=e}registerCommand(e,t){this.commands[e]=t}setCommonCallback(e){this.commonCallback=e}execute(e){let t;for(var r,i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];let a=e.split(":"),l=a[0],h=2===a.length?a[1]:null,u=this.commands[l];if(!u)throw Error(`Menu command '${l}' not exists.`);if(h&&u.submenu&&(r=u.submenu.items,(0,c.arrayEach)(r,e=>{let r=e.key?e.key.split(":"):null;if(Array.isArray(r)&&r[1]===h)return t=e,!1}),u=t),!0===u.disabled||"function"==typeof u.disabled&&!0===u.disabled.call(this.hot)||(0,s.hasOwnProperty)(u,"submenu"))return;let d=[];"function"==typeof u.callback&&d.push(u.callback),"function"==typeof this.commonCallback&&d.push(this.commonCallback),n.unshift(a.join(":")),(0,c.arrayEach)(d,e=>e.apply(this.hot,n))}}let nO="alignment",nx="clear_column",n_="col_left",nP="col_right",nL="make_read_only",nk="redo";var nD=r(20295);let nH="remove_col",nB="remove_row",nF="row_above",nV="row_below",nU="no_items",nW="undo",nj=[nF,nV,n_,nP,nx,nB,nH,nW,nk,nL,nO,i1,nU],nG={[i1]:function(){return{name:i1}},[nU]:function(){return{key:nU,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_NO_ITEMS)},disabled:!0,isCommand:!1}},[nF]:function(){return{key:nF,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ROW_ABOVE)},callback(){let e=this.getSelectedRangeActive().getTopLeftCorner();this.alter("insert_row_above",e.row,1,"ContextMenu.rowAbove")},disabled(){let e=this.getSelectedRangeActive();return!!(!e||this.selection.isSelectedByColumnHeader()||e.isSingleHeader()&&e.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)||!!this.selection.isSelectedByCorner()&&0===this.countRows()},hidden(){return!this.getSettings().allowInsertRow}}},[nV]:function(){return{key:nV,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ROW_BELOW)},callback(){let e=this.getSelectedRangeActive().getBottomRightCorner();this.alter("insert_row_below",e.row,1,"ContextMenu.rowBelow")},disabled(){let e=this.getSelectedRangeActive();return!!(!e||this.selection.isSelectedByColumnHeader()||e.isSingleHeader()&&e.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}},[n_]:function(){return{key:n_,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_INSERT_LEFT)},callback(){let e=this.getSelectedRangeActive().getTopLeftCorner(),t=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(t,e.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;let e=this.getSelectedRangeActive();return!!(!e||this.selection.isSelectedByRowHeader()||e.isSingleHeader()&&e.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)||!!this.selection.isSelectedByCorner()&&0===this.countCols()},hidden(){return!this.getSettings().allowInsertColumn}}},[nP]:function(){return{key:nP,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_INSERT_RIGHT)},callback(){let e=this.getSelectedRangeActive().getTopRightCorner(),t=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(t,e.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;let e=this.getSelectedRangeActive();return!!(!e||this.selection.isSelectedByRowHeader()||e.isSingleHeader()&&e.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}},[nx]:function(){return{key:nx,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_CLEAR_COLUMN)},callback(e,t){let r=t[0].start.col,i=t[0].end.col;this.countRows()&&this.populateFromArray(0,r,[[null]],Math.max(t[0].start.row,t[0].end.row),i,"ContextMenu.clearColumn")},disabled(){let e=this.getSelectedRangeActive();if(!e||e.isSingleHeader()&&e.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let t=!1;return e.forAll((e,r)=>{if(e<0||r<0)return!0;let{readOnly:i}=this.getCellMeta(e,r);return!!i||(t=!0,!1)}),!t}}},[nB]:function(){return{key:nB,name(){let e=this.getSelected(),t=0;if(e){if(e.length>1)t=1;else{let[r,,i]=e[0];r-i!=0&&(t=1)}}return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_REMOVE_ROW,t)},callback(){this.alter("remove_row",(0,nD.I8)(this),1,"ContextMenu.removeRow")},disabled(){let e=this.getSelectedRangeActive();if(!e||e.isSingleHeader()&&e.highlight.row<0)return!0;let t=this.countRows();return this.selection.isSelectedByCorner()?0===t:this.selection.isSelectedByColumnHeader()||0===t},hidden(){return!this.getSettings().allowRemoveRow}}},[nH]:function(){return{key:nH,name(){let e=this.getSelected(),t=0;if(e){if(e.length>1)t=1;else{let[,r,,i]=e[0];r-i!=0&&(t=1)}}return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_REMOVE_COLUMN,t)},callback(){this.alter("remove_col",(0,nD.X8)(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;let e=this.getSelectedRangeActive();if(!e||e.isSingleHeader()&&e.highlight.col<0)return!0;let t=this.countCols();return this.selection.isSelectedByCorner()?0===t:this.selection.isSelectedByRowHeader()||0===t},hidden(){return!this.getSettings().allowRemoveColumn}}},[nW]:function(){return{key:nW,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_UNDO)},callback(){this.getPlugin("undoRedo").undo()},hidden(){let e=this.getPlugin("undoRedo");return!e||!e.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}
37,[nk]:function(){return{key:nk,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_REDO)},callback(){this.getPlugin("undoRedo").redo()},hidden(){let e=this.getPlugin("undoRedo");return!e||!e.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}},[nL]:function(){return{key:nL,checkable:!0,ariaChecked(){return i9(this.getSelectedRange(),(e,t)=>this.getCellMeta(e,t).readOnly)},ariaLabel(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_READ_ONLY)},name(){let e=this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_READ_ONLY);return i9(this.getSelectedRange(),(e,t)=>this.getCellMeta(e,t).readOnly)&&(e=i3(e)),e},callback(){let e=this.getSelectedRange(),t=i9(e,(e,t)=>this.getCellMeta(e,t).readOnly);(0,c.arrayEach)(e,e=>{e.forAll((e,r)=>{e>=0&&r>=0&&this.setCellMeta(e,r,"readOnly",!t)})}),this.render()},disabled(){let e=this.getSelectedRangeActive();return!!(!e||e.isSingleHeader()||this.selection.isSelectedByCorner())||0===this.countRows()||0===this.countCols()||!this.getSelectedRange()||0===this.getSelectedRange().length}}},[nO]:function(){return{key:nO,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ALIGNMENT)},disabled(){if(0===this.countRows()||0===this.countCols())return!0;let e=this.getSelectedRangeActive();return!!(!e||e.isSingleHeader())||!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${nO}:left`,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT)},callback(){let e=this.getSelectedRange(),t=i2(e,(e,t)=>this.getCellMeta(e,t).className),r="horizontal",i="htLeft";this.runHooks("beforeCellAlignment",t,e,r,i),i5(e,r,i,(e,t)=>this.getCellMeta(e,t),(e,t,r,i)=>this.setCellMeta(e,t,r,i)),this.render()},disabled:!1},{key:`${nO}:center`,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER)},callback(){let e=this.getSelectedRange(),t=i2(e,(e,t)=>this.getCellMeta(e,t).className),r="horizontal",i="htCenter";this.runHooks("beforeCellAlignment",t,e,r,i),i5(e,r,i,(e,t)=>this.getCellMeta(e,t),(e,t,r,i)=>this.setCellMeta(e,t,r,i)),this.render()},disabled:!1},{key:`${nO}:right`,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT)},callback(){let e=this.getSelectedRange(),t=i2(e,(e,t)=>this.getCellMeta(e,t).className),r="horizontal",i="htRight";this.runHooks("beforeCellAlignment",t,e,r,i),i5(e,r,i,(e,t)=>this.getCellMeta(e,t),(e,t,r,i)=>this.setCellMeta(e,t,r,i)),this.render()},disabled:!1},{key:`${nO}:justify`,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY)},callback(){let e=this.getSelectedRange(),t=i2(e,(e,t)=>this.getCellMeta(e,t).className),r="horizontal",i="htJustify";this.runHooks("beforeCellAlignment",t,e,r,i),i5(e,r,i,(e,t)=>this.getCellMeta(e,t),(e,t,r,i)=>this.setCellMeta(e,t,r,i)),this.render()},disabled:!1},{name:i1},{key:`${nO}:top`,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ALIGNMENT_TOP)},callback(){let e=this.getSelectedRange(),t=i2(e,(e,t)=>this.getCellMeta(e,t).className),r="vertical",i="htTop";this.runHooks("beforeCellAlignment",t,e,r,i),i5(e,r,i,(e,t)=>this.getCellMeta(e,t),(e,t,r,i)=>this.setCellMeta(e,t,r,i)),this.render()},disabled:!1},{key:`${nO}:middle`,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE)},callback(){let e=this.getSelectedRange(),t=i2(e,(e,t)=>this.getCellMeta(e,t).className),r="vertical",i="htMiddle";this.runHooks("beforeCellAlignment",t,e,r,i),i5(e,r,i,(e,t)=>this.getCellMeta(e,t),(e,t,r,i)=>this.setCellMeta(e,t,r,i)),this.render()},disabled:!1},{key:`${nO}:bottom`,name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM)},callback(){let e=this.getSelectedRange(),t=i2(e,(e,t)=>this.getCellMeta(e,t).className),r="vertical",i="htBottom";this.runHooks("beforeCellAlignment",t,e,r,i),i5(e,r,i,(e,t)=>this.getCellMeta(e,t),(e,t,r,i)=>this.setCellMeta(e,t,r,i)),this.render()},disabled:!1}]}}}};function n$(){let e={};return(0,s.objectEach)(nG,(t,r)=>{e[r]=t()}),e}function nz(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class nY{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;nz(this,"hot",void 0),nz(this,"predefinedItems",n$()),nz(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=t}setPredefinedItems(e){let t={};this.defaultOrderPattern.length=0,(0,s.objectEach)(e,(e,r)=>{let i="";e.name===i1?(t[i1]=e,i=i1):(isNaN(parseInt(r,10))?(e.key=void 0===e.key?r:e.key,t[r]=e):t[e.key]=e,i=e.key),this.defaultOrderPattern.push(i)}),this.predefinedItems=t}getItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=[],n=e;return n&&n.items?n=n.items:Array.isArray(n)||(n=t),(0,s.isObject)(n)?(0,s.objectEach)(n,(e,t)=>{let n=r["string"==typeof e?e:t];n||(n=e),(0,s.isObject)(e)?(0,s.extend)(n,e):"string"==typeof n&&(n={name:n}),void 0===n.key&&(n.key=t),i.push(n)}):(0,c.arrayEach)(n,(e,t)=>{let n=r[e];!n&&nj.indexOf(e)>=0||(n||(n={name:e,key:`${t}`}),(0,s.isObject)(e)&&(0,s.extend)(n,e),void 0===n.key&&(n.key=t),i.push(n))}),i}(e,this.defaultOrderPattern,this.predefinedItems)}}function nK(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class nX{constructor(e,t){let r,i,n,o,s,a;nK(this,"top",void 0),nK(this,"topRelative",void 0),nK(this,"left",void 0),nK(this,"leftRelative",void 0),nK(this,"scrollTop",void 0),nK(this,"scrollLeft",void 0),nK(this,"cellHeight",void 0),nK(this,"cellWidth",void 0);let l=t.scrollY,h=t.scrollX;
37this.rootWindow=t,this.type=this.getSourceType(e),"literal"===this.type?(r=parseInt(e.top,10),n=parseInt(e.left,10),s=e.height||0,a=e.width||0,i=r,o=n,r+=l,n+=h):"event"===this.type&&(r=parseInt(e.pageY,10),n=parseInt(e.pageX,10),s=e.target.clientHeight,a=e.target.clientWidth,i=r-l,o=n-h),this.top=r,this.topRelative=i,this.left=n,this.leftRelative=o,this.scrollTop=l,this.scrollLeft=h,this.cellHeight=s,this.cellWidth=a}getSourceType(e){let t="literal";return e instanceof Event&&(t="event"),t}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=t}fitsOnRight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rootWindow.document.documentElement.clientWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function nq(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function nZ(e,t){return e.get(nJ(e,t))}function nQ(e,t,r){return e.set(nJ(e,t),r),r}function nJ(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var n0=new WeakMap,n1=new WeakMap,n2=new WeakMap,n5=new WeakMap,n3=new WeakMap;class n9{constructor(e){nq(this,n0,void 0),nq(this,n1,void 0),nq(this,n2,void 0),nq(this,n5,!1),nq(this,n3,{above:0,below:0,left:0,right:0}),nQ(n5,this,e)}setOffset(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return nZ(n3,this)[e]=t,this}setElement(e){return nQ(n0,this,e),this}setParentElement(e){return nQ(n1,this,e),this}updatePosition(e){nQ(n2,this,new nX(e,nZ(n0,this).ownerDocument.defaultView)),nZ(n5,this)?(nZ(n2,this).fitsBelow(nZ(n0,this))?this.setPositionBelowCursor():nZ(n2,this).fitsAbove(nZ(n0,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){"rtl"===nZ(n0,this).dir?nZ(n2,this).fitsOnLeft(nZ(n0,this))?this.setPositionOnLeftOfCurs
37or():this.setPositionOnRightOfCursor():nZ(n2,this).fitsOnRight(nZ(n0,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=nZ(n3,this).above+nZ(n2,this).top-nZ(n0,this).offsetHeight;if(nZ(n1,this)){let t=nZ(n1,this).ownerDocument.defaultView.getComputedStyle(nZ(n1,this).querySelector(".ht_master")),r=Number.parseInt(t.paddingTop,10),i=Number.parseInt(t.borderTop,10);e=nZ(n2,this).top+nZ(n2,this).cellHeight-nZ(n0,this).scrollHeight+r+i}nZ(n0,this).style.top=`${e}px`}setPositionBelowCursor(){let e=nZ(n3,this).below+nZ(n2,this).top+1;if(nZ(n1,this)){let t=nZ(n1,this).ownerDocument.defaultView.getComputedStyle(nZ(n1,this).querySelector(".ht_master")),r=Number.parseInt(t.paddingTop,10),i=Number.parseInt(t.borderTop,10);e=nZ(n2,this).top-r-i}nZ(n0,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=nZ(n2,this).left;if(nZ(n1,this)){let t=Number.parseInt(nZ(n1,this).ownerDocument.defaultView.getComputedStyle(nZ(n1,this).querySelector(".htCore")).borderRightWidth,10);e+=nZ(n2,this).cellWidth+t}else e+=nZ(n3,this).right;nZ(n0,this).style.left=`${e}px`}
37setPositionOnLeftOfCursor(){let e=nZ(n3,this).left+nZ(n2,this).left-nZ(n0,this).offsetWidth;nZ(n1,this)&&(e-=Number.parseInt(nZ(n1,this).ownerDocument.defaultView.getComputedStyle(nZ(n1,this).querySelector(".htCore")).borderLeftWidth,10)),nZ(n0,this).style.left=`${e}px`}}function n4(e){let{initialPage:t=-1,size:r=()=>0,onItemSelect:i=()=>{},onClear:n=()=>{}}=e,o=new Set,s=(0,eH.clamp)(t,-1,l()-1);function a(e,t){let r=l()-1;return(e<0&&(e=r),e>r&&(e=0),o.has(e))?-1:(o.add(e),!1===i(e,!1)&&(e=a(1===t?++e:--e,t)),e)}function l(){return Math.max(r(),0)}return{setCurrentPage:function(e){e>-1&&e<l()&&!1!==i(e,!0)&&(s=e)},setPageCursorAt:function(e){e>-1&&e<l()&&(s=e)},getCurrentPage:function(){return s},toFirstItem:function(){l()>0&&(o.clear(),s=a(0,1))},toLastItem:function(){l()>0&&(o.clear(),s=a(l()-1,-1))},toNextItem:function(){l()>0&&(o.clear(),s=a(++s,1))},toPreviousItem:function(){l()>0&&(o.clear(),s=a(--s,-1))},getSize:l,clear:function(){o.clear(),s=t,n()}}}function n7(e){return(0,s.hasOwnProperty)(e,"submenu")}function n8(e){return RegExp(i1,"i").test(e.name)}function n6(e,t){return!0===e.disabled||"function"==typeof e.disabled&&!0===e.disabled.call(t)}function oe(e){return(0,s.hasOwnProperty)(e,"disableSelection")}function ot(e,t){let r=e.slice(0);for(;0<r.length;)if(r[0].name===t)r.shift();else break;return r}let or="menu";function oi(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function on(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oo(e,t,r){return e.set(oa(e,t),r),r}function os(e,t){return e.get(oa(e,t))}function oa(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var ol=new WeakMap,oh=new WeakMap,ou=new WeakMap;class oc{get tableBorderWidth(){return void 0===os(ou,this)&&this.hotMenu&&oo(ou,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),os(ou,this)}constructor(e,t){var r=this;on(this,"hot",void 0),on(this,"options",void 0),on(this,"eventManager",new eR.Z(this)),on(this,"container",void 0),on(this,"positioner",void 0),on(this,"hotMenu",null),on(this,"hotSubMenus",{}),on(this,"parentMenu",void 0),on(this,"menuItems",null),on(this,"origOutsideClickDeselects",null),oi(this,ol,void 0),oi(this,oh,void 0),oi(this,ou,void 0),this.hot=e,this.options=t||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:215,container:this.hot.rootPortalElement},this.container=this.createContainer(this.options.name),this.positioner=new n9(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.parentMenu.runLocalHooks("afterSelectionChange",...t)}),this.hot.addHook("afterSetTheme",(e,t)=>{this.options.container!==this.hot.rootPortalElement&&((0,n.removeClass)(this.options.container,/ht-theme-.*/g),(0,n.addClass)(this.options.container,e)),t||this.close()})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",e=>this.onDocumentMouseDown(e)),this.eventManager.addEventListener(e.document,"touchstart",e=>this.onDocumentMouseDown(e)),this.eventManager.addEventListener(e.document,"contextmenu",e=>this.onDocumentContextMenu(e)),e=(0,n.getParentWindow)(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return os(ol,this)}getKeyboardShortcutsCtrl(){return os(oh,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedActive()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedActive())}isSubMenu(){return null!==this.parentMenu}open(){var e,t;this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";let r=(0,y.debounce)(e=>this.openSubMenu(e),300),i=this.options.minWidth||215,s=!1,a=(0,c.arrayFilter)(this.menuItems,e=>{var t;return e.key===nU&&(s=!0),t=this.hot,!e.hidden||!("function"==typeof e.hidden&&e.hidden.call(t))});if(a.length<1&&!s)a.push(n$()[nU]);else if(0===a.length)return;a=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i1,i=e.slice(0);return(t=(i=ot(i,r)).slice(0)).reverse(),(t=ot(t,r)).reverse(),i=function(e){let t=[];return(0,c.arrayEach)(e,(e,r)=>{r>0?t[t.length-1].name!==e.name&&t.push(e):t.push(e)}),t}(i=t)}(a,i1);let l=!1,h={data:a,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth:e=>(0,d.isDefined)(e)&&e<i?i:e,autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:(e=this.hot,(t,r,i,o,s,a)=>{let l=t.getSourceDataAtRow(i),h=e.rootDocument.createElement("div"),u="function"==typeof a?a.call(e):a,c="function"==typeof l.ariaLabel?l.ariaLabel.call(e):l.ariaLabel,d="function"==typeof l.ariaChecked?l.ariaChecked.call(e):l.ariaChecked;if((0,n.empty)(r),(0,n.addClass)(h,"htItemWrapper"),e.getSettings().ariaTags){let t=!n6(l,e)&&!oe(l)&&!n8(l);(0,n.setAttribute)(r,[...!0===l.checkable?[(0,m.ys)(),(0,m.QK)(c),(0,m.Pn)(d)]:[(0,m.rQ)(),(0,m.QK)(u)],...t?[(0,m.Qk)(-1)]:[],...n6(l,e)?[(0,m.gw)()]:[],...n7(l)?[(0,m.JV)(!1)]:[]])}r.className="",r.appendChild(h),n8(l)?(0,n.addClass)(r,"htSeparator"):"function"==typeof l.renderer?((0,n.addClass)(r,"htCustomMenuRenderer"),r.appendChild(l.renderer(t,h,i,o,s,u))):(0,n.fastInnerHTML)(h,u),n6(l,e)?(0,n.addClass)(r,"htDisabled"):oe(l)?(0,n.addClass)(r,"htSelectionDisabled"):n7(l)&&(0,n.addClass)(r,"htSubmenu")})}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(e,t)=>{this.hotMenu.stylesHandler.isClassicTheme()?os(ol,this).setCurrentPage(t.row):os(ol,this).setPageCursorAt(t.row)},afterOnCellMouseOver:(e,t)=>{this.isAllSubMenusClosed()?r(t.row):this.openSubMenu(t.row)},afterOnCellContextMenu:e=>{e.preventDefault(),(0,en.isWindowsOS)()&&l&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(e,t,r,i,n)=>{this.hotMenu.view.isMouseDown()&&(n.value=!0),this.runLocalHooks("afterSelectionChange",this.get
37SelectedItem())},beforeOnCellMouseUp:e=>{this.hasSelectedItem()&&(l=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(e))},afterOnCellMouseUp:e=>{(!(0,en.isWindowsOS)()||!(0,o.isRightClick)(e))&&l&&this.hasSelectedItem()&&((0,en.isMobileBrowser)()||(0,en.isIpadOS)()?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,h),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),oo(ol,this,(t=this.hotMenu,n4({size:()=>t.countRows(),onItemSelect(e,r){let i=t.getCell(e,0);if(!i||(0,n.hasClass)(i,"htSeparator")||(0,n.hasClass)(i,"htDisabled")||(0,n.hasClass)(i,"htSelectionDisabled"))return!1;t.selectCell(e,0,...r?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}}))),oo(oh,this,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];function i(e,t){s(t).addShortcuts(e,{group:or})}function n(e,t){let n=s(t);e.forEach(e=>{let{keys:t}=e;t.forEach(e=>n.removeShortcutsByKeys(e))}),r.push({shortcuts:e,contextName:t}),i(e,t)}function o(e){return e?`${or}:${e}`:or}function s(t){var r;let i=e.hotMenu.getShortcutManager(),n=o(t);return null!==(r=i.getContext(n))&&void 0!==r?r:i.addContext(n)}return i(function(e){let{hot:t,hotMenu:r}=e;return[{keys:[["Control/Meta","A"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:()=>e.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(r,i)=>{let n=t.getSettings(),o="function"==typeof n.tabMoves?n.tabMoves(r):n.tabMoves;i.includes("shift")?t.selection.transformStart(-o.row,-o.col):t.selection.transformStart(o.row,o.col),e.close(!0)}},{keys:[["Escape"]],callback:()=>e.close()},{keys:[["ArrowDown"]],callback:()=>e.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>e.getNavigator().toPreviousItem()},{keys:[[t.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{let t=r.getSelectedActive();if(t){let r=e.openSubMenu(t[0]);r&&r.getNavigator().toFirstItem()}}},{keys:[[t.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{r.getSelectedActive()&&e.isSubMenu()&&(e.close(),e.isSubMenu()&&e.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>e.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>e.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:t=>{let i=r.getSelectedActive();i&&(r.getSourceDataAtRow(i[0]).submenu?e.openSubMenu(i[0]).getNavigator().toFirstItem():(e.executeCommand(t),e.close(!0)))}},{keys:[["PageUp"]],callback:()=>{r.getSelectedActive()?r.selection.transformStart(-r.countVisibleRows(),0):e.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{r.getSelectedActive()?r.selection.transformStart(r.countVisibleRows(),0):e.getNavigator().toLastItem()}}]}(e)),t.forEach(e=>{let{shortcuts:t,contextName:r}=e;n(t,r)}),{addCustomShortcuts:n,getCustomShortcuts:function(){return[...r]},getContext:s,listen:function(t){e.hotMenu.getShortcutManager().setActiveContextName(o(t))}}}(this)),os(oh,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(os(ol,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){let e=this.parentMenu.hotMenu.getSelectedActive();if(e){let t=this.parentMenu.hotMenu.getCell(e[0],0);(0,n.setAttribute)(t,[(0,m.JV)(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;let t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!(0,n.hasClass)(t,"htSubmenu"))return!1;let r=this.hotMenu.getSourceDataAtRow(e),i=new oc(this.hot,{parent:this,name:r.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(r.submenu.items),i.open(),i.setPosition(t.getBoundingClientRect()),this.hotSubMenus[r.key]=i,this.hot.getSettings().ariaTags&&(0,n.setAttribute)(t,[(0,m.JV)(!0)]),i}closeSubMenu(e){let t=this.hotMenu.getSourceDataAtRow(e),r=this.hotSubMenus[t.key];if(r){r.destroy(),delete this.hotSubMenus[t.key];let i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&(0,n.setAttribute)(i,[(0,m.JV)(!1)])}}closeAllSubMenus(){(0,c.arrayEach)(this.hotMenu.getData(),(e,t)=>this.closeSubMenu(t))}isAllSubMenusClosed(){return 0===Object.keys(this.hotSubMenus).length}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){let e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return null!==this.hotMenu}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;let t=this.getSelectedItem();if(this.runLocalHooks("select",t,e),this.isCommandPassive(t))return;let r=this.hot.getSelectedRange(),i=r?(0,c.arrayMap)(r,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()})):[];this.runLocalHooks("executeCommand",t.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,i,e)}isCommandPassive(e){return!1===e.isCommand||n8(e)||n6(e,this.hot)||n7(e)}setOffset(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.positioner.setOffset(e,t)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){let{wtTable:e}=this.hotMenu.view._wt,t=this.hotMenu.getSettings().data,r=e.hider.style,i=e.holder.style,o=
37parseInt(r.width,10),s=(0,c.arrayReduce)(t,(e,t,r)=>{let i=this.hotMenu.getCell(r,0)?(0,n.outerHeight)(this.hotMenu.getCell(r,0)):0;return e+(t.name===i1?1:i)},0);this.hotMenu.stylesHandler.isClassicTheme()?(i.width=`${o+3}px`,i.height=`${s+3}px`):(i.width=`${o}px`,i.height=`${s}px`),r.height=i.height}createContainer(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this.options.container.ownerDocument,i=t;return i&&((0,y.isFunction)(i)&&(i=null===(i=i.call(this.hot))||(0,d.isUndefined)(i)?"":i.toString()),i=i.replace(/[^A-Za-z0-9]/g,"_"),i=`${this.options.className}Sub_${i}`,e=r.querySelector(`.${this.options.className}.${i}`)),e||(e=r.createElement("div"),(0,n.addClass)(e,`htMenu handsontable ${this.options.className}`),i&&(0,n.addClass)(e,i),this.options.container.appendChild(e)),e}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&(0,n.setAttribute)(this.hotMenu.rootElement,[(0,m.tm)(),(0,m.Qk)(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!(0,n.isChildOf)(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!(0,n.isChildOf)(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&(0,n.hasClass)(e.target,"htCore")&&(0,n.isChildOf)(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}function od(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function og(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}(0,s.mixin)(oc,iI.Z);let op="contextMenu";eN.P.getSingleton().register("afterContextMenuDefaultOptions"),eN.P.getSingleton().register("beforeContextMenuShow"),eN.P.getSingleton().register("afterContextMenuShow"),eN.P.getSingleton().register("afterContextMenuHide"),eN.P.getSingleton().register("afterContextMenuExecute");var of=new WeakSet;class om extends tn.vq{constructor(){super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,of),of.add(this),od(this,"commandExecutor",new nM(this.hot)),od(this,"itemsFactory",null),od(this,"menu",null)}static get PLUGIN_KEY(){return op}static get PLUGIN_PRIORITY(){return 70}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[nF,nV,i1,n_,nP,i1,nB,nH,i1,nW,nk,i1,nL,i1,nO]}isEnabled(){return!!this.hot.getSettings()[op]}enablePlugin(){var e=this;if(this.enabled)return;let t=this.hot.getSettings()[op];"function"==typeof t.callback&&this.commandExecutor.setCommonCallback(t.callback),this.menu=new oc(this.hot,{className:"htContextMenu",keepInViewport:!0,container:t.uiContainer||this.hot.rootPortalElement}),this.menu.addLocalHook("beforeOpen",()=>og(of,this,ov).call(this)),this.menu.addLocalHook("afterOpen",()=>og(of,this,ow).call(this)),this.menu.addLocalHook("afterClose",()=>og(of,this,oE).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.executeCommand.call(e,...r)}),this.addHook("afterOnCellContextMenu",e=>og(of,this,oy).call(this,e)),this.addHook("beforeDialogShow",()=>this.close()),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:()=>{let{highlight:e}=this.hot.getSelectedRangeActive();this.hot.scrollToFocusedCell();let t=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),r=i4(this.menu.container,this.hot.rootDocument);this.open({left:t.left+r.left,top:t.top+r.top-1+t.height},{left:t.width,above:-t.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;let t=null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&!this.menu.isOpened()},group:op})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(op)}open(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{above:0,below:0,left:0,right:0};null!==(t=this.menu)&&void 0!==t&&t.isOpened()||(this.prepareMenuItems(),this.menu.open(),(0,s.objectEach)(r,(e,t)=>{this.menu.setOffset(t,e)}),this.menu.setPosition(e))}close(){var e;null===(e=this.menu)||void 0===e||e.close(),this.itemsFactory=null}executeCommand(e){null===this.itemsFactory&&this.prepareMenuItems();for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}prepareMenuItems(){this.itemsFactory=new nY(this.hot,om.DEFAULT_ITEMS);let e=this.hot.getSettings()[op],t={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",t),this.itemsFactory.setPredefinedItems(t.items);let r=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",r),this.menu.setMenuItems(r),(0,c.arrayEach)(r,e=>this.commandExecutor.registerCommand(e.key,e))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function oy(e){let t=this.hot.getSettings(),r=t.rowHeaders,i=t.colHeaders,o=e.target;if(this.close(),(0,n.hasClass)(o,"handsontableInput")||(e.preventDefault(),e.stopPropagation(),!(r||i)&&!("TD"===o.nodeName||"TD"===o.parentNode.nodeName)&&!((0,n.hasClass)(o,"current")&&(0,n.hasClass)(o,"wtBorder"))))return;let s=i4(this.menu.container,this.hot.rootDocument);
37this.open({top:e.clientY+s.top,left:e.clientX+s.left})}function ov(){this.hot.runHooks("beforeContextMenuShow",this)}function ow(){this.hot.runHooks("afterContextMenuShow",this)}function oE(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}om.SEPARATOR={name:i1},r(18044);var oS=r(28744);class oC{constructor(){this.data={}}setData(e,t){this.data[e]=t}getData(e){return this.data[e]||void 0}}class oR{constructor(){this.clipboardData=new oC}preventDefault(){}composedPath(){return[]}}function ob(e,t,r){oT(e,t),t.set(e,r)}function oT(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function oN(e,t){return e.get(oI(e,t))}function oA(e,t,r){return e.set(oI(e,t),r),r}function oI(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var oM=new WeakMap,oO=new WeakMap,ox=new WeakMap,o_=new WeakMap,oP=new WeakMap,oL=new WeakMap,ok=new WeakSet;class oD{constructor(e){let{countRows:t,countColumns:r,rowsLimit:i,columnsLimit:n,countColumnHeaders:o}=e;oT(this,ok),ok.add(this),ob(this,oM,void 0),ob(this,oO,void 0),ob(this,ox,void 0),ob(this,o_,void 0),ob(this,oP,void 0),ob(this,oL,void 0),oA(oO,this,t),oA(ox,this,r),oA(o_,this,i),oA(oP,this,n),oA(oL,this,o)}setSelectedRange(e){oA(oM,this,e)}getCellsRange(){if(0===oN(oO,this).call(this)||0===oN(ox,this).call(this))return null;let{row:e,col:t}=oN(oM,this).getTopStartCorner(),{row:r,col:i}=oN(oM,this).getBottomEndCorner(),n=oI(ok,this,oB).call(this,e,r),o=oI(ok,this,oH).call(this,t,i);return{isRangeTrimmed:r!==n||i!==o,startRow:e,startCol:t,endRow:n,endCol:o}}getMostBottomColumnHeadersRange(){if(0===oN(ox,this).call(this)||0===oN(oL,this).call(this))return null;let{col:e}=oN(oM,this).getTopStartCorner(),{col:t}=oN(oM,this).getBottomEndCorner(),r=oI(ok,this,oH).call(this,e,t);return{isRangeTrimmed:t!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(0===oN(ox,this).call(this)||0===oN(oL,this).call(this))return null;let{col:e}=oN(oM,this).getTopStartCorner(),{col:t}=oN(oM,this).getBottomEndCorner(),r=oI(ok,this,oH).call(this,e,t);return{isRangeTrimmed:t!==r,startRow:-oN(oL,this).call(this),startCol:e,endRow:-1,endCol:r}}}function oH(e,t){return Math.min(t,Math.max(e+oN(oP,this).call(this)-1,e))}function oB(e,t){return Math.min(t,Math.max(e+oN(o_,this).call(this)-1,e))}function oF(e){let t=[],r=[];return(0,c.arrayEach)(e,e=>{let i=Math.min(e.startRow,e.endRow),n=Math.max(e.startRow,e.endRow);(0,eH.rangeEach)(i,n,e=>{-1===t.indexOf(e)&&t.push(e)});let o=Math.min(e.startCol,e.endCol),s=Math.max(e.startCol,e.endCol);(0,eH.rangeEach)(o,s,e=>{-1===r.indexOf(e)&&r.push(e)})}),{rows:t,columns:r}}var oV=r(81146);function oU(e,t,r){oW(e,t),t.set(e,r)}function oW(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function oj(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oG(e,t){return e.get(oz(e,t))}function o$(e,t,r){return e.set(oz(e,t),r),r}function oz(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("afterCopyLimit"),eN.P.getSingleton().register("modifyCopyableRange"),eN.P.getSingleton().register("beforeCut"),eN.P.getSingleton().register("afterCut"),eN.P.getSingleton().register("beforePaste"),eN.P.getSingleton().register("afterPaste"),eN.P.getSingleton().register("beforeCopy"),eN.P.getSingleton().register("afterCopy");let oY="copyPaste",oK=["fragmentSelection"],oX="application/ht-source-data-json-html",oq='<meta name="generator" content="Handsontable"/><style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>';var oZ=new WeakMap,oQ=new WeakMap,oJ=new WeakMap,o0=new WeakMap,o1=new WeakMap,o2=new WeakMap,o5=new WeakMap,o3=new WeakMap,o9=new WeakSet;class o4 extends tn.vq{constructor(){super(...arguments),oW(this,o9),o9.add(this),oj(this,"columnsLimit",1/0),oj(this,"rowsLim
37it",1/0),oj(this,"pasteMode","overwrite"),oj(this,"uiContainer",this.hot.rootDocument.body),oU(this,oZ,!1),oU(this,oQ,!1),oU(this,oJ,!1),oU(this,o0,"cells-only"),oU(this,o1,!1),oU(this,o2,!1),oU(this,o5,new oD({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),oU(this,o3,!1),oj(this,"copyableRanges",[])}static get PLUGIN_KEY(){return oY}static get SETTING_KEYS(){return[oY,...oK]}static get PLUGIN_PRIORITY(){return 80}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[oY]}enablePlugin(){var e,t,r=this;this.enabled||(this.pasteMode=null!==(e=this.getSetting("pasteMode"))&&void 0!==e?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"),o$(oZ,this,this.getSetting("copyColumnHeaders")),o$(oQ,this,this.getSetting("copyColumnGroupHeaders")),o$(oJ,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=null!==(t=this.getSetting("uiContainer"))&&void 0!==t?t:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",e=>oz(o9,this,sr).call(this,e)),this.addHook("afterSelection",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return oz(o9,r,si).call(r,...t)}),this.addHook("afterSelectionEnd",()=>oz(o9,this,sn).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return r.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return r.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return r.onPaste(...arguments)}),(0,en.isSafari)()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return oz(o9,r,so).call(r,...t)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return oz(o9,r,ss).call(r,...t)}),this.addHook("afterSelection",()=>oz(o9,this,sa).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cells-only";o$(o0,this,e),o$(o1,this,!0),oz(o9,this,o7).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(){o$(o2,this,!0),oz(o9,this,o7).call(this,"cut")}getRangedCopyableData(e){return(0,oS.P)(this.getRangedData(e))}getRangedData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=[],{rows:i,columns:n}=oF(e);return(0,c.arrayEach)(i,e=>{let i=[];(0,c.arrayEach)(n,r=>{if(e<0)i.push(this.hot.getColHeader(r,e));else{let n=t?this.hot.getCopyableSourceData(e,r):this.hot.getCopyableData(e,r);t&&(0,s.isObject)(n)&&(n=JSON.stringify(n)),i.push(n)}}),r.push(i)}),r}paste(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(!e&&!t)return;let r=new oR;e&&r.clipboardData.setData("text/plain",e),t&&r.clipboardData.setData("text/html",t),this.onPaste(r)}setCopyableText(){let e=this.hot.getSelectedRangeActive();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}oG(o5,this).setSelectedRange(e);let t=new Map([["headers",null],["cells",null]]);"column-headers-only"===oG(o0,this)?t.set("headers",oG(o5,this).getMostBottomColumnHeadersRange()):("with-column-headers"===oG(o0,this)?t.set("headers",oG(o5,this).getMostBottomColumnHeadersRange()):"with-column-group-headers"===oG(o0,this)&&t.set("headers",oG(o5,this).getAllColumnHeadersRange()),t.set("cells",oG(o5,this).getCellsRange())),this.copyableRanges=Array.from(t.values()).filter(e=>null!==e).map(e=>{let{startRow:t,startCol:r,endRow:i,endCol:n}=e;return{startRow:t,startCol:r,endRow:i,endCol:n}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);let r=t.get("cells");if(null!==r&&r.isRangeTrimmed){let{startRow:e,startCol:t,endRow:i,endCol:n}=r;this.hot.runHooks("afterCopyLimit",i-e+1,n-t+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return null===(e=this.hot.getActiveEditor())||void 0===e?void 0:e.isOpened()}populateValues(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hot.getSelectedRangeActive();
37if(!e.length)return[null,null,null,null];let i=e.length,n=e[0].length,o=[],{row:a,col:l}=r.getTopStartCorner(),{row:h,col:u}=r.getBottomEndCorner(),c=a,d=l,p=a,f=l;for(;o.length<i||c<=h;){let{skipRowOnPaste:r,visualRow:a}=this.hot.getCellMeta(c,l);if(c=a+1,!0===r)continue;p=a,d=l;let h=[],y=o.length%i;for(;h.length<n||d<=u;){var m;let{skipColumnOnPaste:r,visualCol:i}=this.hot.getCellMeta(a,d),o=this.hot.getSourceDataAtCell(a,d),l=h.length%n;if(d=i+1,!0===r)continue;f=i;let u=null==t||null===(m=t[y])||void 0===m?void 0:m[l],c=e[y][l];if(t&&(0,g.isJSON)(u)){let e=JSON.parse(u);((0,s.isObject)(o)||null===o)&&(c=e)}h.push(c)}o.push(h)}return o$(o3,this,!0),this.hot.populateFromArray(a,l,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[a,l,p,f]}onCopy(e){let t=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=null==t?void 0:t.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!oG(o1,this)||this.isEditorOpened()||(0,n.isHTMLElement)(t)&&(i&&t!==r||!i&&t!==this.hot.rootDocument.body&&!(0,n.isInternalElement)(t,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),o$(o1,this,!1);let o=this.getRangedData(this.copyableRanges),s=this.getRangedData(this.copyableRanges,!0),a=oz(o9,this,o8).call(this,this.copyableRanges);this.hot.runHooks("beforeCopy",o,this.copyableRanges,a)&&(oz(o9,this,st).call(this,e,o,s),this.hot.runHooks("afterCopy",o,this.copyableRanges,a)),o$(o0,this,"cells-only")}onCut(e){let t=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=null==t?void 0:t.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!oG(o2,this)||this.isEditorOpened()||(0,n.isHTMLElement)(t)&&(i&&t!==r||!i&&t!==this.hot.rootDocument.body&&!(0,n.isInternalElement)(t,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),o$(o2,this,!1);let o=this.getRangedData(this.copyableRanges),s=this.getRangedData(this.copyableRanges,!0);this.hot.runHooks("beforeCut",o,this.copyableRanges)&&(oz(o9,this,st).call(this,e,o,s),this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",o,this.copyableRanges))}onPaste(e){let t,r;let i=e.composedPath()[0],o=this.hot.getFocusManager().getRefocusElement(),s=null==i?void 0:i.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||(0,n.isHTMLElement)(i)&&(s&&i!==o||!s&&i!==this.hot.rootDocument.body&&!(0,n.isInternalElement)(i,this.hot.rootElement)))return;if(e.preventDefault(),e&&void 0!==e.clipboardData){let i=e.clipboardData.getData(oX);i&&(r=(0,oV.htmlToGridSettings)(i,this.hot.rootDocument).data);let n=(0,g.sanitize)(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});t=n&&/(<table)|(<TABLE)/g.test(n)?(0,oV.htmlToGridSettings)(n,this.hot.rootDocument).data:e.clipboardData.getData("text/plain")}else"undefined"==typeof ClipboardEvent&&void 0!==this.hot.rootWindow.clipboardData&&(t=this.hot.rootWindow.clipboardData.getData("Text"));if("string"==typeof t&&(t=(0,oS.Q)(t)),void 0===t||t&&0===t.length||!1===this.hot.runHooks("beforePaste",t,this.copyableRanges))return;let[a,l,h,u]=this.populateValues(t,r);null!==a&&null!==l&&this.hot.selectCell(a,l,Math.min(this.hot.countRows()-1,h),Math.min(this.hot.countCols()-1,u)),this.hot.runHooks("afterPaste",t,this.copyableRanges)}destroy(){super.destroy()}}function o7(e){if((0,en.isSafari)()){let t=this.hot.getSelectedRangeActive();if(t){let{row:r,col:i}=t.highlight,o=this.hot.getCell(r,i,!0);o&&(0,n.runWithSelectedContendEditableElement)(o,()=>{this.hot.rootDocument.execCommand(e)})}}else this.hot.rootDocument.execCommand(e)}function o8(e){let{rows:t}=oF(e),r=0;for(let e=0;e<t.length&&!(t[e]>=0);e++)r+=1;return{columnHeadersCount:r}}function o6(){if(this.hot.isListening()){let e=this.hot.getSelectedRangeActive();if(e){let{row:t,col:r}=e.highlight,i=this.hot.getCell(t,r,!0);i&&(0,n.makeElementContentEditableAndSelectItsContent)(i)}}}function se(){if(this.hot.isListening()){let e=this.hot.getSelectedRangeActive();if(e){let{row:t,col:r}=e.highlight,i=this.hot.getCell(t,r,!0);null!=i&&i.hasAttribute("contenteditable")&&(0,n.removeContentEditableFromElementAndDeselect)(i)}}}function st(e,t,r){let i=(0,oS.P)(t);if(e&&e.clipboardData){let n=(0,oV._dataToHTML)(t),o=(0,oV._dataToHTML)(r);e.clipboardData.setData("text/plain",i),e.clipboardData.setData("text/html",[oq,n].join("")),e.clipboardData.setData(oX,[oq,o].join(""))}else"undefined"==typeof ClipboardEvent&&this.hot.rootWindow.clipboardData.setData("Text",i
37)}function sr(e){var t,r,i,n,o;e.items.push({name:"---------"},(t=this,{key:"copy",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_COPY)},callback(){t.copyCellsOnly()},disabled(){if(0===this.countRows()||0===this.countCols())return!0;let e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;let t=this.getSelected();return!t||t.length>1},hidden:!1})),oG(oZ,this)&&e.items.push((r=this,{key:"copy_with_column_headers",name(){let e=this.getSelectedRangeActive(),t=e?(0,eH.clamp)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS,t)},callback(){r.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;let e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;let t=this.getSelected();return!t||t.length>1},hidden:!1})),oG(oQ,this)&&e.items.push((i=this,{key:"copy_with_column_group_headers",name(){let e=this.getSelectedRangeActive(),t=e?(0,eH.clamp)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS,t)},callback(){i.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;let e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;let t=this.getSelected();return!t||t.length>1},hidden:!1})),oG(oJ,this)&&e.items.push((n=this,{key:"copy_column_headers_only",name(){let e=this.getSelectedRangeActive(),t=e?(0,eH.clamp)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY,t)},callback(){n.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;let e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;let t=this.getSelected();return!t||t.length>1},hidden:!1})),e.items.push((o=this,{key:"cut",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_CUT)},callback(){o.cut()},disabled(){if(0===this.countRows()||0===this.countCols())return!0;let e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;let t=this.getSelected();return!t||t.length>1},hidden:!1}))}function si(e,t,r,i,n){oG(o3,this)&&(n.value=!0),o$(o3,this,!1)}function sn(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function so(){oz(o9,this,se).call(this)}function ss(){oz(o9,this,o6).call(this)}function sa(){oz(o9,this,se).call(this)}function sl(e,t){return`border_row${e}col${t}`}function sh(){return{width:1,color:"#000"}}function su(){return{hide:!0}}function sc(e){var t,r;return((0,d.isDefined)(e.start)||(0,d.isDefined)(e.left))&&(e.start=null!==(t=e.start)&&void 0!==t?t:e.left),((0,d.isDefined)(e.end)||(0,d.isDefined)(e.right))&&(e.end=null!==(r=e.end)&&void 0!==r?r:e.right),delete e.left,delete e.right,e}function sd(e){return(0,d.isDefined)(e.start)&&(e.left=e.start),(0,d.isDefined)(e.end)&&(e.right=e.end),e}function sg(e,t){return{id:sl(e,t),border:{width:1,color:"#000",cornerVisible:!1},row:e,col:t,top:su(),bottom:su(),start:su(),end:su()}}function sp(e,t){let r=!1;return(0,c.arrayEach)(e.getSelectedRange(),i=>{i.forAll((i,n)=>{if(i<0||n<0)return;let o=e.getCellMeta(i,n).borders;if(o&&(!t||!(0,s.hasOwnProperty)(o[t],"hide")||!1===o[t].hide))return r=!0,!1})}),r}function sf(e){return`<span class="selected">${String.fromCharCode(10003)}</span>${e}`}let sm=new Map([["left","start"],["right","end"]]);function sy(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let sv="customBorders",sw=["dashed","dotted","solid"];var sE=new WeakSet;class sS extends tn.vq{constructor(){var e,t,r;super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,sE),sE.add(this),t=[],(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="savedBorders","string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t}static get PLUGIN_KEY(){return sv}static get PLUGIN_PRIORITY(){return 90}isEnabled(){return!!this.hot.getSettings()[sv]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>sy(sE,this,sR).call(this,e)),this.addHook("init",()=>sy(sE,this,sb).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,t){let r=["top","bottom","start","end"],i=null;t&&(this.checkSettingsCohesion([t]),r=Object.keys(t),i=sc(t));let n=(0,nD.AV)(e),o=(0,nD.S5)(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});(0,c.arrayEach)(e,e=>{o(e).forAll((e,t)=>{(0,c.arrayEach)(r,r=>{var n;this.prepareBorderFromCustomAdded(e,t,i,null!==(n=sm.get(r))&&void 0!==n?n:r)})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;
37let t=(0,nD.AV)(e),r=(0,nD.S5)(t,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return(0,c.arrayEach)(e,e=>{r(e).forAll((e,t)=>{(0,c.arrayEach)(this.savedBorders,r=>{r.row===e&&r.col===t&&i.push(sd(r))})})}),i}clearBorders(e){e?this.setBorders(e):((0,c.arrayEach)(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange(),this.hot.removeCellMeta(e.row,e.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,t){this.checkSavedBorders(e)||this.savedBorders.push(e);let r=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,r,t)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:r})}prepareBorderFromCustomAdded(e,t,r,i){let n=this.hot.countRows(),o=this.hot.countCols();if(e>=n||t>=o)return;let a=sg(e,t);if(r){var l;l=a,(0,s.hasOwnProperty)(r,"border")&&r.border&&(l.border=r.border),(0,s.hasOwnProperty)(r,"top")&&(0,d.isDefined)(r.top)&&(r.top?(0,s.isObject)(r.top)||(r.top=sh()):r.top=su(),l.top=r.top),(0,s.hasOwnProperty)(r,"bottom")&&(0,d.isDefined)(r.bottom)&&(r.bottom?(0,s.isObject)(r.bottom)||(r.bottom=sh()):r.bottom=su(),l.bottom=r.bottom),(0,s.hasOwnProperty)(r,"start")&&(0,d.isDefined)(r.start)&&(r.start?(0,s.isObject)(r.start)||(r.start=sh()):r.start=su(),l.start=r.start),(0,s.hasOwnProperty)(r,"end")&&(0,d.isDefined)(r.end)&&(r.end?(0,s.isObject)(r.end)||(r.end=sh()):r.end=su(),l.end=r.end),a=l,(0,c.arrayEach)(this.hot.selection.highlight.customSelections,e=>{if(a.id===e.settings.id)return Object.assign(e.settings,r),a.id=e.settings.id,a.top=e.settings.top,a.bottom=e.settings.bottom,a.start=e.settings.start,a.end=e.settings.end,!1})}this.hot.setCellMeta(e,t,"borders",sd(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,t){let r=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);(0,eH.rangeEach)(e.from.row,r,r=>{(0,eH.rangeEach)(e.from.col,i,i=>{let n=sg(r,i),o=0;r===e.from.row&&(0,s.hasOwnProperty)(t,"top")&&(o+=1,n.top=t.top),r===e.to.row&&(0,s.hasOwnProperty)(t,"bottom")&&(o+=1,n.bottom=t.bottom),i===e.from.col&&(0,s.hasOwnProperty)(t,"start")&&(o+=1,n.start=t.start),i===e.to.col&&(0,s.hasOwnProperty)(t,"end")&&(o+=1,n.end=t.end),o>0&&(this.hot.setCellMeta(r,i,"borders",sd(n)),this.insertBorderIntoSettings(n))})})}removeAllBorders(e,t){let r=sl(e,t);this.spliceBorder(r),this.clearBordersFromSelectionSettings(r),this.clearNullCellRange(),this.hot.removeCellMeta(e,t,"borders")}setBorder(e,t,r,i){let n=this.hot.getCellMeta(e,t).borders;n=n&&void 0!==n.border?sc(n):sg(e,t),i?(n[r]=su(),4===this.countHide(n)?this.removeAllBorders(e,t):(this.checkCustomSelectionsFromContextMenu(n,r,i)||this.insertBorderIntoSettings(n),this.hot.setCellMeta(e,t,"borders",sd(n)))):(n[r]=sh(),this.checkCustomSelectionsFromContextMenu(n,r,i)||this.insertBorderIntoSettings(n),this.hot.setCellMeta(e,t,"borders",sd(n)))}prepareBorder(e,t,r){(0,c.arrayEach)(e,e=>{let{start:i,end:n}=e;if(i.row===n.row&&i.col===n.col)"noBorders"===t?this.removeAllBorders(i.row,i.col):this.setBorder(i.row,i.col,t,r);else switch(t){case"noBorders":(0,eH.rangeEach)(i.col,n.col,e=>{(0,eH.rangeEach)(i.row,n.row,t=>{this.removeAllBorders(t,e)})});break;case"top":(0,eH.rangeEach)(i.col,n.col,e=>{this.setBorder(i.row,e,t,r)});break;case"bottom":(0,eH.rangeEach)(i.col,n.col,e=>{this.setBorder(n.row,e,t,r)});break;case"start":(0,eH.rangeEach)(i.row,n.row,e=>{this.setBorder(e,i.col,t,r)});break;case"end":(0,eH.rangeEach)(i.row,n.row,e=>{this.setBorder(e,n.col,t,r)})}})}createCustomBorders(e){(0,c.arrayEach)(e,e=>{let t=sc(e);e.range?this.prepareBorderFromCustomAddedRange(e.range,t):this.prepareBorderFromCustomAdded(e.row,e.col,t)})}countHide(e){let{top:t,bottom:r,start:i,end:n}=e;return(0,c.arrayReduce)([t,r,i,n],(e,t)=>{let r=e;return t&&t.hide&&(r+=1),r},0)}clearBordersFromSelectionSettings(e){let t=(0,c.arrayMap)(this.hot.selection.highlight.customSelections,e=>e.settings.id).indexOf(e);t>-1&&this.hot.selection.highlight.customSelections[t].clear()}clearNullCellRange(){(0,c.arrayEach)(this.hot.selection.highlight.customSelections,
37(e,t)=>{if(null===e.cellRange)return this.hot.selection.highlight.customSelections[t].destroy(),this.hot.selection.highlight.customSelections.splice(t,1),!1})}hideBorders(){(0,c.arrayEach)(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){let t=(0,c.arrayMap)(this.savedBorders,e=>e.id).indexOf(e);t>-1&&this.savedBorders.splice(t,1)}checkSavedBorders(e){let t=!1;return 4===this.countHide(e)?(this.spliceBorder(e.id),t=!0):(0,c.arrayEach)(this.savedBorders,(r,i)=>{if(e.id===r.id)return this.savedBorders[i]=e,t=!0,!1}),t}checkCustomSelectionsFromContextMenu(e,t,r){let i=!1;return(0,c.arrayEach)(this.hot.selection.highlight.customSelections,n=>{if(e.id===n.settings.id){let e=this.hot.view._wt.selectionManager.getBorderInstances(n);return(0,c.arrayEach)(e,e=>{e.toggleHiddenClass(t,r)}),i=!0,!1}}),i}checkCustomSelections(e,t,r){let i=this.countHide(e),n=!1;return 4===i?(this.removeAllBorders(e.row,e.col),n=!0):(0,c.arrayEach)(this.hot.selection.highlight.customSelections,i=>
37{if(e.id===i.settings.id){if(i.visualCellRange=t,i.commit(),r){let t=this.hot.view._wt.selectionManager.getBorderInstances(i);(0,c.arrayEach)(t,t=>{t.changeBorderStyle(r,e)})}return n=!0,!1}}),n}changeBorderSettings(){let e=this.hot.getSettings()[sv];if(Array.isArray(e)){let t=(0,s.deepClone)(e);this.checkSettingsCohesion(t),t.length||(this.savedBorders=t),this.createCustomBorders(t)}else void 0!==e&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){let t=e.some(e=>(0,d.isDefined)(e.left)||(0,d.isDefined)(e.right)),r=e.some(e=>(0,d.isDefined)(e.start)||(0,d.isDefined)(e.end));if(t&&r)throw Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&t)throw Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".');sy(sE,this,sC).call(this,e)}destroy(){super.destroy()}}function sC(e){e.forEach(e=>{Object.keys(e).forEach(t=>{let r=e[t].style;(0,d.isDefined)(r)&&!sw.includes(r)?((0,rE.ZK)(`The "${r}" border style is not supported. Please use one of the following styles: ${sw.join(", ")}.
38The border style will be ignored.`),delete e[t].style):(0,d.isDefined)(r)&&"solid"===r&&delete e[t].style})})}function sR(e){var t,r,i;this.hot.getSettings()[sv]&&e.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_BORDERS)},disabled(){let e=this.getSelectedRangeActive();return!!(!e||e.isSingleHeader())||this.selection.isSelectedByCorner()},submenu:{items:[(t=this,{key:"borders:top",name(){let e=this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_BORDERS_TOP);return sp(this,"top")&&(e=sf(e)),e},callback(e,r){let i=sp(this,"top");t.prepareBorder(r,"top",i)}}),function(e){let t=e.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let e=this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_BORDERS_RIGHT);return sp(this,t)&&(e=sf(e)),e},callback(r,i){let n=sp(this,t);e.prepareBorder(i,t,n)}}}(this),(r=this,{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_BORDERS_BOTTOM);return sp(this,"bottom")&&(e=sf(e)),e},callback(e,t){let i=sp(this,"bottom");r.prepareBorder(t,"bottom",i)}}),function(e){let t=e.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let e=this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_BORDERS_LEFT);return sp(this,t)&&(e=sf(e)),e},callback(r,i){let n=sp(this,t);e.prepareBorder(i,t,n)}}}(this),(i=this,{key:"borders:no_borders",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_REMOVE_BORDERS)},callback(e,t){i.prepareBorder(t,"noBorders")},disabled(){return!sp(this)}})]}})}function sb(){this.changeBorderSettings()}function sT(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sN(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let sA="dragToScroll";var sI=new WeakSet;class sM extends tn.vq{constructor(){super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,sI),sI.add(this),sT(this,"boundaries",null),sT(this,"callback",null),sT(this,"listening",!1)}static get PLUGIN_KEY(){return sA}static get PLUGIN_PRIORITY(){return 100}isEnabled(){return!!this.hot.getSettings()[sA]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>sN(sI,this,sO).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>sN(sI,this,sO).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&&void 0!==arguments[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,t){let r=0,i=0;t<this.boundaries.top?i=t-this.boundaries.top:t>this.boundaries.bottom&&(i=t-this.boundaries.bottom),e<this.boundaries.left?r=e-this.boundaries.left:e>this.boundaries.right&&(r=e-this.boundaries.right),this.callback(r,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){let{rootWindow:e}=this.hot,t=e;for(;t;)this.eventManager.addEventListener(t.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(t.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(t.document,"mousemove",e=>this.onMouseMove(e)),t=(0,n.getParentWindow)(t)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function sO(e){if((0,o.isRightClick)(e))return;let t=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(t!==this.hot.rootWindow?t.getBoundingClientRect():void 0),this.setCallback((e,r)=>{var i,n;let o=null!==(i=t.scrollLeft)&&void 0!==i?i:t.scrollX,s=null!==(n=t.scrollTop)&&void 0!==n?n:t.scrollY;t.scroll(o+50*Math.sign(e),s+20*Math.sign(r))}),this.listen()}function sx(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function s_(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sP(e,t,r){return e.set(sL(e,t),r),r}function sL(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("afterDropdownMenuDefaultOptions"),eN.P.getSingleton().register("beforeDropdownMenuShow"),eN.P.getSingleton().register("afterDropdownMenuShow"),eN.P.getSingleton().register("afterDropdownMenuHide"),eN.P.getSingleton().register("afterDropdownMenuExecute");let sk="dropdownMenu",sD="changeType";var sH=new WeakMap,sB=new WeakSet;class sF extends tn.vq{static get PLUGIN_KEY(){return sk}static get PLUGIN_PRIORITY(){return 230}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[n_,nP,i1,nH,i1,nx,i1,nL,i1,nO]}constructor(e){super(e),sx(this,sB),sB.add(this),s_(this,"commandExecutor",new nM(this.hot)),s_(this,"itemsFactory",null),s_(this,"menu",null),sx(this,sH),sH.set(this,!1),this.hot.addHook("afterGetColHeader",(e,t)=>sL(sB,this,sW).call(this,e,t))}isEnabled(){return this.hot.getSettings()[sk]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new nY(this.hot,sF.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return sL(sB,e,sK).call(e,...r)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return sL(sB,e,sY).call(e,...r)}),this.addHook("beforeDialogShow",()=>this.close());let t=this.hot.getSettings()[sk],r={items:this.itemsFactory.getItems(t)};this.registerEvents(),"function"==typeof t.callback&&this.commandExecutor.setCommonCallback(t.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);let i=this.itemsFactory.getItems(t);this.menu&&this.menu.destroy(),this.menu=new oc(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:t.uiContainer||this.hot.rootPortalElement}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>sL(sB,this,sj).call(this)),this.menu.addLocalHook("afterOpen",()=>sL(sB,this,sG).call(this)),this.menu.addLocalHook("afterSubmenuOpen",e=>sL(sB,this,s$).call(this,e)),this.menu.addLocalHook("afterClose",()=>sL(sB,this,sz).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.executeCommand.call(e,...r)}),(0,c.arrayEach)(i,e=>this.commandExecutor.registerCommand(e.key,e))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){let e=this.hot.getShortcutManager().getContext("grid"),t=()=>{let{highlight:e}=this.hot.getSelectedRangeActive();if((e.isHeader()&&-1===e.row||e.isCell())&&e.col>=0){this.hot.selectColumns(e.col,e.col,-1);let{from:t}=this.hot.getSelectedRangeActive(),r=i4(this.menu.container,this.hot.rootDocument),i=this.hot.getCell(-1,t.col,!0).querySelector(`.${sD}`),n=i.getBoundingClientRect();
38this.open({left:n.left+r.left,top:n.top+i.offsetHeight+r.top},{left:n.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:t,runOnlyIf:()=>{var e;let t=null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&t.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:sk},{keys:[["Shift","Alt","ArrowDown"]],callback:t,runOnlyIf:()=>{var e;let t=null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&t.isCell()&&!this.menu.isOpened()},group:sk}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(sk)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>sL(sB,this,sU).call(this,e))}open(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{above:0,below:0,left:0,right:0};null!==(t=this.menu)&&void 0!==t&&t.isOpened()||(this.menu.open(),(0,s.objectEach)(r,(e,t)=>{this.menu.setOffset(t,e)}),this.menu.setPosition(e))}close(){var e;null===(e=this.menu)||void 0===e||e.close()}executeCommand(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}setListening(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function sV(e){e.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function sU(e){if((0,n.hasClass)(e.target,sD)){let t=i4(this.menu.container,this.hot.rootDocument),r=e.target.getBoundingClientRect();e.stopPropagation(),sP(sH,this,!1),this.open({left:r.left+t.left,top:r.top+e.target.offsetHeight+t.top},{left:r.width,right:0,above:0,below:3})}}function sW(e,t){let r=t.parentNode;if(!r)return;let i=r.parentNode.childNodes,o=Array.prototype.indexOf.call(i,r);if(e<0||o!==i.length-1)return;let s=t.querySelector(`.${sD}`);if(this.enabled&&s)return;if(!this.enabled){s&&s.parentNode.removeChild(s);return}let a=this.hot.rootDocument.createElement("button");a.className=sD,a.type="button",a.tabIndex=-1,this.hot.getSettings().ariaTags&&((0,n.setAttribute)(a,[(0,m.cV)(),(0,m.QK)(" ")]),(0,n.setAttribute)(t,[(0,m.fv)("menu")])),a.onclick=function(){return!1},t.firstChild.insertBefore(a,t.firstChild.firstChild)}function sj(){this.hot.runHooks("beforeDropdownMenuShow",this)}function sG(){this.hot.runHooks("afterDropdownMenuShow",this),sL(sB,this,sV).call(this,this.menu)}function s$(e){sL(sB,this,sV).call(this,e)}function sz(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function sY(e){return sH.get(sL(sH,this))?null:e}function sK(e){(0,n.hasClass)(e.target,sD)&&sP(sH,this,!0)}function sX(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}sF.SEPARATOR={name:i1};class sq{constructor(e){sX(this,"hot",void 0),sX(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){let{startRow:e,startCol:t,endRow:r,endCol:i}=this._getDataRange(),n=this.options,o=[];return(0,eH.rangeEach)(e,r,e=>{let r=[];!n.exportHiddenRows&&this._isHiddenRow(e)||((0,eH.rangeEach)(t,i,t=>{!n.exportHiddenColumns&&this._isHiddenColumn(t)||r.push(this.hot.getDataAtCell(e,t))}),o.push(r))}),o}getRowHeaders(){let e=[];
38if(this.options.rowHeaders){let{startRow:t,endRow:r}=this._getDataRange(),i=this.hot.getRowHeader();(0,eH.rangeEach)(t,r,t=>{!this.options.exportHiddenRows&&this._isHiddenRow(t)||e.push(i[t])})}return e}getColumnHeaders(){let e=[];if(this.options.columnHeaders){let{startCol:t,endCol:r}=this._getDataRange(),i=this.hot.getColHeader();(0,eH.rangeEach)(t,r,t=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(t)||e.push(i[t])})}return e}_getDataRange(){let e=this.hot.countCols()-1,t=this.hot.countRows()-1,[r=0,i=0,n=t,o=e]=this.options.range;return r=Math.max(r,0),{startRow:r,startCol:i=Math.max(i,0),endRow:n=Math.min(n,t),endCol:o=Math.min(o,e)}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function sZ(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class sQ{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,t){sZ(this,"dataProvider",void 0),sZ(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(t),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let t=(0,s.clone)(this.constructor.DEFAULT_OPTIONS),r=new Date;return t=(0,s.extend)((0,s.clone)(sQ.DEFAULT_OPTIONS),t),(t=(0,s.extend)(t,e)).filename=(0,g.substitute)(t.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),t}}var sJ=sQ;function s0(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var s1=new WeakSet;class s2 extends sJ{constructor(){super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,s1),s1.add(this)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:"\r\n",sanitizeValues:!1}}export(){let e=this.options,t=this.dataProvider.getData(),r=this.dataProvider.getColumnHeaders(),i=r.length>0,n=this.dataProvider.getRowHeaders(),o=n.length>0,s=e.bom?String.fromCharCode(65279):"";return i&&(r=(0,c.arrayMap)(r,t=>this._escapeCell(t,{force:!0,sanitizeValue:e.sanitizeValues})),o&&(s+=e.columnDelimiter),s+=r.join(e.columnDelimiter)+e.rowDelimiter),(0,c.arrayEach)(t,(t,r)=>{r>0&&(s+=e.rowDelimiter),o&&(s+=this._escapeCell(n[r],{sanitizeValue:e.sanitizeValues})+e.columnDelimiter);let i=t.map(t=>this._escapeCell(t,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);s+=i}),s}_escapeCell(e){let{force:t=!1,sanitizeValue:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,d.stringify)(e);return""===i||(r&&(t=!0),r instanceof RegExp?i=s0(s1,this,s3).call(this,i,r):"function"==typeof r?i=r(i):r&&(i=s0(s1,this,s5).call(this,i)),(t||i.indexOf("\r")>=0||i.indexOf('"')>=0||i.indexOf("\n")>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function s5(e){return e.startsWith("=")||e.startsWith("+")||e.startsWith("-")||e.startsWith("@")||e.startsWith("	")||e.startsWith("\r")?`'${e}`:e}function s3(e,t){return t.test(e)?`'${e}`:e}let s9={csv:s2};class s4 extends tn.vq{static get PLUGIN_KEY(){return"exportFile"}static get PLUGIN_PRIORITY(){return 240}isEnabled(){return!0}exportAsString(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._createTypeFormatter(e,t).export()}exportAsBlob(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,t))}downloadFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{rootDocument:r,rootWindow:i}=this.hot,n=this._createTypeFormatter(e,t),o=this._createBlob(n),s=i.URL||i.webkitURL,a=r.createElement("a"),l=`${n.options.filename}.${n.options.fileExtension}`;if(void 0!==a.download){let e=s.createObjectURL(o);a.style.display="none",a.setAttribute("href",e),a.setAttribute("download",l),r.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),r.body.removeChild(a),setTimeout(()=>{s.revokeObjectURL(e)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(o,l)}_createTypeFormatter(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!s9[e])throw Error(`Export format type "${e}" is not supported.`);return t=new sq(this.hot),"function"==typeof s9[e]?new s9[e](t,r):null}_createBlob(e){let t=null;return"undefined"!=typeof Blob&&(t=new Blob([e.export()],{type:`${e.o
38ptions.mimeType};charset=${e.options.encoding}`})),t}}function s7(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r(19087);class s8{constructor(e,t){let{id:r,stateless:i=!0}=t;s7(this,"hot",void 0),s7(this,"id",void 0),s7(this,"elements",[]),s7(this,"hidden",!1),s7(this,"stateId",""),s7(this,"state",void 0),this.hot=e,this.id=r,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new rH.A)}getElements(){return this.elements}reset(){(0,c.arrayEach)(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return null===this.hot||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),(0,c.arrayEach)(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}(0,s.mixin)(s8,iI.Z);let s6={};function ae(e,t){if(!s6[e])throw Error(`Filter condition "${e}" does not exist.`);let{condition:r,descriptor:i}=s6[e],n=t;return i.inputValuesDecorator&&(n=i.inputValuesDecorator(n)),function(e){return r.apply(e.meta.instance,[].concat([e],[n]))}}function at(e){if(!s6[e])throw Error(`Filter condition "${e}" does not exist.`);return s6[e].descriptor}function ar(e,t,r){r.key=e,s6[e]={condition:t,descriptor:r}}let ai="none";ar(ai,function(){return!0},{name:eA.FILTERS_CONDITIONS_NONE,inputsCount:0,showOperators:!1});let an="empty";ar(an,function(e){return(0,d.isEmpty)(e.value)},{name:eA.FILTERS_CONDITIONS_EMPTY,inputsCount:0,showOperators:!0});let ao="not_empty";ar(ao,function(e,t){return!ae(an,t)(e)},{name:eA.FILTERS_CONDITIONS_NOT_EMPTY,inputsCount:0,showOperators:!0}),ar("eq",function(e,t){let[r]=t;return(0,d.stringify)(e.value).toLocaleLowerCase(e.meta.locale)===(0,d.stringify)(r)},{name:eA.FILTERS_CONDITIONS_EQUAL,inputsCount:1,showOperators:!0}),ar("neq",function(e,t){return!ae("eq",t)(e)},{name:eA.FILTERS_CONDITIONS_NOT_EQUAL,inputsCount:1,showOperators:!0}),ar("gt",function(e,t){let[r]=t,i=r;return"numeric"===e.meta.type&&(i=parseFloat(i,10)),e.value>i},{name:eA.FILTERS_CONDITIONS_GREATER_THAN,inputsCount:1,showOperators:!0}),ar("gte",function(e,t){let[r]=t,i=r;return"numeric"===e.meta.type&&(i=parseFloat(i,10)),e.value>=i},{name:eA.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL,inputsCount:1,showOperators:!0}),ar("lt",function(e,t){let[r]=t,i=r;return"numeric"===e.meta.type&&(i=parseFloat(i,10)),e.value<i},{name:eA.FILTERS_CONDITIONS_LESS_THAN,inputsCount:1,showOperators:!0}),ar("lte",function(e,t){let[r]=t,i=r;return"numeric"===e.meta.type&&(i=parseFloat(i,10)),e.value<=i},{name:eA.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL,inputsCount:1,showOperators:!0});let as="date_after";ar(as,function(e,t){let[r]=t,i=_(e.value,e.meta.dateFormat),n=_(r,e.meta.dateFormat);return!!(i.isValid()&&n.isValid())&&i.diff(n)>=0},{name:eA.FILTERS_CONDITIONS_AFTER,inputsCount:1,showOperators:!0});let aa="date_before";ar(aa,function(e,t){let[r]=t,i=_(e.value,e.meta.dateFormat),n=_(r,e.meta.dateFormat);return!!(i.isValid()&&n.isValid())&&0>=i.diff(n)},{name:eA.FILTERS_CONDITIONS_BEFORE,inputsCount:1,showOperators:!0});let al="between";ar(al,function(e,t){let[r,i]=t,n=r,o=i;if("numeric"===e.meta.type){let e=parseFloat(n,10),t=parseFloat(o,10);n=Math.min(e,t),o=Math.max(e,t)}else if("date"===e.meta.type){let t=ae(aa,[o]),r=ae(as,[n]);return t(e)&&r(e)}return e.value>=n&&e.value<=o},{name:eA.FILTERS_CONDITIONS_BETWEEN,inputsCount:2,showOperators:!0});let ah="not_between";ar(ah,function(e,t){return!ae(al,t)(e)},{name:eA.FILTERS_CONDITIONS_NOT_BETWEEN,inputsCount:2,showOperators:!0});let au="begins_with";ar(au,function(e,t){let[r]=t;return(0,d.stringify)(e.value).toLocaleLowerCase(e.meta.locale).startsWith((0,d.stringify)(r))},{name:eA.FILTERS_CONDITIONS_BEGINS_WITH,inputsCount:1,showOperators:!0});let ac="ends_with";ar(ac,function(e,t){let[r]=t;return(0,d.stringify)(e.value).toLocaleLowerCase(e.meta.locale).endsWith((0,d.stringify)(r))},{name:eA.FILTERS_CONDITIONS_ENDS_WITH,inputsCount:1,showOperators:!0});let ad="contains";
38ar(ad,function(e,t){let[r]=t;return(0,d.stringify)(e.value).toLocaleLowerCase(e.meta.locale).indexOf((0,d.stringify)(r))>=0},{name:eA.FILTERS_CONDITIONS_CONTAINS,inputsCount:1,showOperators:!0});let ag="not_contains";ar(ag,function(e,t){return!ae(ad,t)(e)},{name:eA.FILTERS_CONDITIONS_NOT_CONTAIN,inputsCount:1,showOperators:!0});let ap="date_tomorrow";ar(ap,function(e){let t=_(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(_().subtract(-1,"days").startOf("day"),"d")},{name:eA.FILTERS_CONDITIONS_TOMORROW,inputsCount:0});let af="date_today";ar(af,function(e){let t=_(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(_().startOf("day"),"d")},{name:eA.FILTERS_CONDITIONS_TODAY,inputsCount:0});let am="date_yesterday";ar(am,function(e){let t=_(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(_().subtract(1,"days").startOf("day"),"d")},{name:eA.FILTERS_CONDITIONS_YESTERDAY,inputsCount:0});let ay="text",av={numeric:[ai,i1,an,ao,i1,"eq","neq",i1,"gt","gte","lt","lte",al,ah],[ay]:[ai,i1,an,ao,i1,"eq","neq",i1,au,ac,i1,ad,ag],date:[ai,i1,an,ao,i1,"eq","neq",i1,aa,as,al,i1,ap,af,am]};function aw(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let aE="built",aS="building",aC=["click","input","keydown","keypress","keyup","focus","blur","change"];class aR{static get DEFAULTS(){return(0,s.clone)({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,t){aw(this,"hot",void 0),aw(this,"eventManager",new eR.Z(this)),aw(this,"options",void 0),aw(this,"_element",void 0),aw(this,"buildState",void 0),this.hot=e,this.options=(0,s.extend)(aR.DEFAULTS,t),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===aS||(this.buildState===aE?this.update():(this.buildState=aS,this.build(),this.buildState=aE)),this._element}isBuilt(){return this.buildState===aE}translateIfPossible(e){return"string"==typeof e&&e.startsWith(eA.FILTERS_NAMESPACE)?this.hot.getTranslatedPhrase(e):e}build(){let e=(e,t)=>{this.eventManager.addEventListener(e,t,e=>this.runLocalHooks(t,e,this))};if(this.buildState||(this.buildState=aS),this._element.setAttribute("data-hot-input",!0),void 0!==this.options.tabIndex&&this._element.setAttribute("tabindex",this.options.tabIndex),void 0!==this.options.role&&this._element.setAttribute("role",this.options.role),this.options.className&&(0,n.addClass)(this._element,this.options.className),this.options.children.length)(0,c.arrayEach)(this.options.children,e=>this._element.appendChild(e.element));else if(this.options.wrapIt){let t=this.hot.rootDocument.createElement(this.options.tagName);t.setAttribute("data-hot-input",!0),(0,s.objectEach)(this.options,(e,r)=>{void 0!==t[r]&&"className"!==r&&"tagName"!==r&&"children"!==r&&(t[r]=this.translateIfPossible(e))}),this._element.appendChild(t),(0,c.arrayEach)(aC,r=>e(t,r))}else(0,c.arrayEach)(aC,t=>e(this._element,t))}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}}function ab(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function aT(e,t){return e.get(aN(e,t))}function aN(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}(0,s.mixin)(aR,iI.Z);var aA=new WeakMap,aI=new WeakSet;class aM extends aR{static get DEFAULTS(){return(0,s.clone)({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,t){var r;super(e,(0,s.extend)(aM.DEFAULTS,t)),ab(this,aI),aI.add(this),r=void 0,ab(this,aA),aA.set(this,r),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>aN(aI,this,aO).call(this,e))}build(){var e;super.build();let t=this.hot.rootDocument.createElement("div");e=this._element.firstChild,aA.set(aN(aA,this),e),(0,n.addClass)(this._element,"htUIInput"),(0,n.addClass)(t,"htUIInputIcon"),this._element.appendChild(t),this.update()}update(){this.isBuilt()&&(aT(aA,this).type=this.options.type,aT(aA,this).placeholder=this.translateIfPossible(this.options.placeholder),aT(aA,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&aT(aA,this).focus()}}function aO(e){this.options.value=e.target.value}function ax(e,t,r){a_(e,t),t.set(e,r)}function a_(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function aP(e,t,r){return e.set(ak(e,t),r),r}function aL(e,t){return e.get(ak(e,t))}function ak(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var aD=new WeakMap,aH=new WeakMap,aB=new WeakMap,aF=new WeakMap,aV=new WeakMap,aU=new WeakSet;class aW extends aR{static get DEFAULTS(){return(0,s.clone)({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,t){super(e,(0,s.extend)(aW.DEFAULTS,t)),a_(this,aU),aU.add(this),ax(this,aD,null),ax(this,aH,[]),ax(this,aB,void 0),ax(this,aF,void 0),ax(this,aV,void 0),this.registerHooks()}getMenu(){return aL(aD,this)}registerHooks(){this.addLocalHook("click",()=>ak(aU,this,a$).call(this))}setItems(e){aP(aH,this,this.translateNames(e)),aL(aD,this)&&aL(aD,this).setMenuItems(aL(aH,this))}translateNames(e){return(0,c.arrayEach)(e,e=>{e.name=this.translateIfPossible(e.name)}
38),e}build(){super.build(),aP(aD,this,new oc(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),aL(aD,this).setMenuItems(aL(aH,this));let e=new aR(this.hot,{className:"htUISelectCaption"}),t=new aR(this.hot,{className:"htUISelectDropdown"});aP(aB,this,e),aP(aF,this,e.element),aP(aV,this,t),this.hot.getSettings().ariaTags&&((0,n.setAttribute)(t.element,[(0,m.cV)()]),(0,n.setAttribute)(this._element,[(0,m.a6)()])),(0,c.arrayEach)([e,t],e=>this._element.appendChild(e.element)),aL(aD,this).addLocalHook("select",e=>ak(aU,this,aj).call(this,e)),aL(aD,this).addLocalHook("afterClose",()=>ak(aU,this,aG).call(this)),this.update()}update(){let e;this.isBuilt()&&(e=this.options.value?this.options.value.name:aL(aD,this).hot.getTranslatedPhrase(eA.FILTERS_CONDITIONS_NONE),aL(aF,this).textContent=e,super.update())}openOptions(){let e=this.element.getBoundingClientRect();aL(aD,this)&&(aL(aD,this).open(),aL(aD,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),aL(aD,this).getNavigator().toFirstItem(),aL(aD,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:e=>{this.closeOptions(),this.runLocalHooks("tabKeydown",e)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){aL(aD,this)&&aL(aD,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){aL(aD,this)&&(aL(aD,this).destroy(),aP(aD,this,null)),aL(aB,this)&&aL(aB,this).destroy(),aL(aV,this)&&aL(aV,this).destroy(),super.destroy()}}function aj(e){e.name!==i1&&(this.options.value=e,this.update(),this.runLocalHooks("select",this.options.value))}function aG(){this.runLocalHooks("afterClose")}function a$(){this.openOptions()}function az(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aY(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var aK=new WeakSet;class aX extends s8{constructor(e,t){super(e,{id:t.id,stateless:!1}),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,aK),aK.add(this),az(this,"name",""),az(this,"addSeparator",!1),this.name=t.name,this.addSeparator=t.addSeparator,this.elements.push(new aW(this.hot,{menuContainer:t.menuContainer})),this.elements.push(new aM(this.hot,{placeholder:eA.FILTERS_BUTTONS_PLACEHOLDER_VALUE})),this.elements.push(new aM(this.hot,{placeholder:eA.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>aY(aK,this,aq).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),(0,c.arrayEach)(this.getInputElements(),e=>{e.addLocalHook("keydown",e=>aY(aK,this,aZ).call(this,e))})}setState(e){if(this.reset(),!e)return;let t=(0,s.clone)(e.command);t.name.startsWith(eA.FILTERS_CONDITIONS_NAMESPACE)&&(t.name=this.hot.getTranslatedPhrase(t.name)),this.get
38SelectElement().setValue(t),(0,c.arrayEach)(e.args,(e,r)=>{if(r>t.inputsCount-1)return!1;let i=this.getInputElement(r);i.setValue(e),i[t.inputsCount>r?"show":"hide"](),r||this.hot._registerTimeout(()=>i.focus(),10)})}getState(){let e=this.getSelectElement().getValue()||at(ai),t=[];return(0,c.arrayEach)(this.getInputElements(),(r,i)=>{e.inputsCount>i&&t.push(r.getValue())}),{command:e,args:t}}updateState(e,t){let r=e?at(e.name):at(ai);this.state.setValueAtIndex(t,{command:r,args:e?e.args:[]}),e||(0,c.arrayEach)(this.getInputElements(),e=>e.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof aW)[0]}getInputElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof aM)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,r,i,o,s)=>{(0,n.addClass)(t.parentNode,"htFiltersMenuCondition"),this.addSeparator&&(0,n.addClass)(t.parentNode,"border");let a=this.hot.rootDocument.createElement("div");return(0,n.addClass)(a,"htFiltersMenuLabel"),a.textContent=s,t.appendChild(a),t.parentElement.hasAttribute("ghost-table")||(0,c.arrayEach)(this.elements,e=>t.appendChild(e.element)),t}}}reset(){let e=this.hot.getPlugin("filters").getSelectedColumn(),t=[at(ai)];if(null!==e){let{visualIndex:r}=e;t=function(e){let t=[],r=e;return av[r]||(r=ay),(0,c.arrayEach)(av[r],e=>{let r;r=e===i1?{name:i1}:(0,s.clone)(at(e)),t.push(r)}),t}(this.hot.getDataType(0,r,this.hot.countRows(),r))}(0,c.arrayEach)(this.getInputElements(),e=>e.hide()),this.getSelectElement().setItems(t),super.reset(),this.getSelectElement().setValue(t[0])}}function aq(e){(0,c.arrayEach)(this.getInputElements(),(t,r)=>{t[e.inputsCount>r?"show":"hide"](),0===r&&this.hot._registerTimeout(()=>t.focus(),10)}),this.runLocalHooks("change",e)}function aZ(e){(0,p.isKey)(e.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),(0,o.stopImmediatePropagation)(e))}let aQ={};function aJ(e,t,r){aQ[e]={name:t,func:r}}let a0="conjunction";aJ(a0,eA.FILTERS_LABELS_CONJUNCTION,function(e,t){return e.every(e=>e.func(t))});let a1="disjunction";aJ(a1,eA.FILTERS_LABELS_DISJUNCTION,function(e,t){return e.some(e=>e.func(t))});let a2="disjunctionWithExtraCondition";function a5(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function a3(e,t){return e.get(a4(e,t))}function a9(e,t,r){return e.set(a4(e,t),r),r}function a4(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}aJ(a2,eA.FILTERS_LABELS_DISJUNCTION,function(e,t){if(e.length<3)throw Error("Operation doesn't work on less then three conditions.");return e.slice(0,e.length-1).some(e=>e.func(t))&&e[e.length-1].func(t)});var a7=new WeakMap,a8=new WeakMap;class a6 extends aR{static get DEFAULTS(){return(0,s.clone)({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,t){super(e,(0,s.extend)(a6.DEFAULTS,t)),a5(this,a7,void 0),a5(this,a8,void 0)}build(){super.build();let e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),a9(a8,this,e),a9(a7,this,this._element.firstChild),a3(a7,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(a3(a8,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return!!this.isBuilt()&&a3(a7,this).checked}setChecked(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.isBuilt()&&(a3(a7,this).checked=e)}focus(){this.isBuilt()&&a3(a7,this).focus()}}var le=new WeakSet;class lt extends s8{constructor(e,t){var r,i;super(e,{id:t.id,stateless:!1}),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,le),le.add(this),(r="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r="name","string"))?i:i+"")in this?Object.defineProperty(this,r,{value:"",enumerable:!0,configurable:!0,writable:!0}):this[r]="",this.name=t.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>((0,n.addClass)(t.parentNode,"htFiltersMenuOperators"),(0,c.arrayEach)(this.elements,e=>t.appendChild(e.element)),t)}}buildOperatorsElement(){let e=[a0,a1];(0,c.arrayEach)(e,t=>{let r=new a6(this.hot,{name:"operator",label:{htmlFor:t,textContent:aQ[t].name},value:t,checked:t===e[0],id:t});r.addLocalHook("change",e=>(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")})(le,this,lr).call(this,e)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error((0,rJ.e)`Radio button with index ${e} doesn't exist.`);(0,c.arrayEach)(this.elements,(t,r)=>{t.setChecked(r===e)})}getActiveOperationId(){let e=this.elements.find(e=>e instanceof a6&&e.isChecked());return e?e.getValue():a0}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&(0,c.arrayEach)(this.elements,t=>{t.setChecked(t.getValue()===e)})}updateState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a0,t=arguments.length>1?arguments[1]:void 0,r=e;r===a2&&(r=a1),this.state.setValueAtIndex(t,r)}reset(){this.setChecked(0)}}function lr(e){this.setState(e.target.value)}function li(e){let t=new Set(e);return function(e){return t.has(e)}}function ln(e){return null==e?"":e}function lo(e){return Array.from(new Set(e)).map(e=>ln(e)).sort((e,t)=>
38"number"==typeof e&&"number"==typeof t?e-t:e===t?0:e>t?1:-1)}function ls(e,t,r,i){let n;let o=[],s=e===t;return s||(n=li(t)),e.forEach(e=>{let t,a=!1;(s||n(e))&&(a=!0);let l={checked:a,value:e,visualValue:(""===(t=e)&&(t=`(${r})`),t)};i&&i(l),o.push(l)}),o}(0,to.getComparisonFunction)();var la=r(24697);function ll(e,t){return e.get(lh(e,t))}function lh(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var lu=new WeakMap;class lc extends aR{static get DEFAULTS(){return(0,s.clone)({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,t){var r;super(e,(0,s.extend)(lc.DEFAULTS,t)),r=void 0,function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,lu),lu.set(this,r)}build(){var e;super.build(),e=this._element.firstChild,lu.set(lh(lu,this),e)}update(){this.isBuilt()&&(ll(lu,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&ll(lu,this).focus()}activate(){ll(lu,this).click()}}function ld(e,t,r){lg(e,t),t.set(e,r)}function lg(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function lp(e,t){return e.get(lm(e,t))}function lf(e,t,r){return e.set(lm(e,t),r),r}function lm(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let ly="multipleSelect.itemBox";var lv=new WeakMap,lw=new WeakMap,lE=new WeakMap,lS=new WeakMap,lC=new WeakMap,lR=new WeakMap,lb=new WeakSet;class lT extends aR{static get DEFAULTS(){return(0,s.clone)({className:"htUIMultipleSelect",value:[]})}constructor(e,t){super(e,(0,s.extend)(lT.DEFAULTS,t)),lg(this,lb),lb.add(this),ld(this,lv,[]),ld(this,lw,void 0),ld(this,lE,void 0),ld(this,lS,void 0),ld(this,lC,void 0),ld(this,lR,void 0),lf(lS,this,new aM(this.hot,{placeholder:eA.FILTERS_BUTTONS_PLACEHOLDER_SEARCH,className:"htUIMultipleSelectSearch"})),lf(lC,this,new lc(this.hot,{textContent:eA.FILTERS_BUTTONS_SELECT_ALL,className:"htUISelectAll"})),lf(lR,this,new lc(this.hot,{textContent:eA.FILTERS_BUTTONS_CLEAR,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return lp(lw,this)}registerHooks(){lp(lS,this).addLocalHook("keydown",e=>lm(lb,this,lA).call(this,e)),lp(lS,this).addLocalHook("input",e=>lm(lb,this,lN).call(this,e)),lp(lC,this).addLocalHook("click",e=>lm(lb,this,lI).call(this,e)),lp(lR,this).addLocalHook("click",e=>lm(lb,this,lM).call(this,e))}setItems(e){var t;lf(lv,this,e),null===(t=lp(lw,this))||void 0===t||t.loadData(lp(lv,this))}setLocale(e){lf(lE,this,e)}getLocale(){return lp(lE,this)}getItems(){return[...lp(lv,this)]}getValue(){return function(e){let t=[];return e.forEach(e=>{e.checked&&t.push(e.value)}),t}(lp(lv,this))}getSearchInputElement(){return lp(lS,this)}getSelectAllElement(){return lp(lC,this)}getClearAllElement(){return lp(lR,this)}isSelectedAllValues(){return lp(lv,this).length===this.getValue().length}build(){var e;super.build();let{rootDocument:t}=this.hot,r=t.createElement("div"),i=new aR(this.hot,{className:"htUISelectionControls",children:[lp(lC,this),lp(lR,this)]});this._element.appendChild(lp(lS,this).element),this._element.appendChild(i.element),this._element.appendChild(r),null===(e=lp(lw,this))||void 0===e||e.destroy(),(0,n.addClass)(r,"htUIMultipleSelectHot"),lf(lw,this,new this.hot.constructor(r,{data:[[]],columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(e,t,r,i,n,o)=>{e.title=o.instance.getDataAtRowProp(t,o.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{lp(lw,this).listen()},modifyColWidth:e=>{let r=lp(lw,this).container.scrollWidth-(0,n.getScrollbarWidth)(t);return void 0!==e&&e<r?r:e},autoColumnSize:!0,autoRowSize:!1,hiddenRows:!0,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"})),lp(lw,this).init();let o=lp(lw,this).getShortcutManager().getContext("grid");o.removeShortcutsByKeys(["Tab"]),o.removeShortcutsByKeys(["Shift","Tab"]),o.addShortcut({keys:[["Escape"]],callback:e=>
38{this.runLocalHooks("keydown",e,this)},group:ly}),o.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:e=>{lp(lw,this).deselectCell(),this.runLocalHooks("keydown",e,this),this.runLocalHooks("listTabKeydown",e,this)},group:ly})}focus(){this.isBuilt()&&lp(lw,this).listen()}reset(){lp(lS,this).reset(),lp(lC,this).reset(),lp(lR,this).reset()}update(){this.isBuilt()&&0!==lp(lw,this).rootElement.offsetHeight&&(lp(lw,this).updateSettings({data:function(e,t){let r=li(t);return e.map(e=>(e.checked=r(e.value),e))}(lp(lv,this),this.options.value)}),super.update())}destroy(){var e;null===(e=lp(lw,this))||void 0===e||e.destroy(),lp(lS,this).destroy(),lp(lR,this).destroy(),lp(lC,this).destroy(),lf(lS,this,null),lf(lR,this,null),lf(lC,this,null),lf(lw,this,null),lf(lv,this,null),super.destroy()}}function lN(e){let t=e.target.value.toLocaleLowerCase(this.getLocale());if("apply"===this.options.searchMode){let e=lp(lw,this).getPlugin("hiddenRows");e.showRows(e.getHiddenRows()),lp(lv,this).forEach((r,i)=>{r.checked=`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(t)>=0,r.checked||e.hideRow(i)}),lp(lw,this).view.adjustElementsSize(),lp(lw,this).render()}else{let e;e=""===t?[...lp(lv,this)]:lp(lv,this).filter(e=>`${e.value}`.toLocaleLowerCase(this.getLocale()).indexOf(t)>=0),lp(lw,this).loadData(e)}}function lA(e){this.runLocalHooks("keydown",e,this),(0,y.partial)(p.isKey,e.keyCode)("ARROW_DOWN")&&(e.preventDefault(),(0,o.stopImmediatePropagation)(e),lp(lw,this).listen(),lp(lw,this).selectCell(0,0))}function lI(e){let t=[];e.preventDefault(),lp(lw,this).getSourceData().forEach((e,r)=>{e.checked=!0,t.push((0,la.dataRowToChangesArray)(e,r)[0])}),lp(lw,this).setSourceDataAtCell(t)}function lM(e){let t=[];e.preventDefault(),lp(lw,this).getSourceData().forEach((e,r)=>{e.checked=!1,t.push((0,la.dataRowToChangesArray)(e,r)[0])}),lp(lw,this).setSourceDataAtCell(t)}let lO="by_value";function lx(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l_(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}ar(lO,function(e,t){let[r]=t;return r(e.value)},{name:"By value",inputsCount:0,inputValuesDecorator(e){let[t]=e;return[li(t)]},showOperators:!1});var lP=new WeakSet;class lL extends s8{constructor(e,t){super(e,{id:t.id,stateless:!1}),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,lP),lP.add(this),lx(this,"name",""),lx(this,"searchMode",void 0),this.name=t.name,this.searchMode=t.searchMode,this.elements.push(new lT(this.hot,{searchMode:this.searchMode})),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>l_(lP,this,lk).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,t)=>l_(lP,this,lH).call(this,e,t))}getElements(){let e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===lO){let t=this.getMultipleSelectElement();t.setItems(e.itemsSnapshot),t.setValue(e.args[0]),t.setLocale(e.locale)}}getState(){let e=this.getMultipleSelectElement(),t=e.getItems();return{command:{key:e.isSelectedAllValues()||!t.length?ai:lO},args:[e.getValue()],itemsSnapshot:t}}updateState(e){let t=(t,r,i,n,o)=>{let[s]=(0,c.arrayFilter)(r,e=>e.name===lO),a={},l=this.hot.getTranslatedPhrase(eA.FILTERS_VALUES_BLANK_CELLS);if(s){let r=n(t,o),h=(0,c.arrayMap)(r,e=>e.value),u=new Map(r.map(e=>[e.value,this.hot.getCellMeta(e.meta.visualRow,e.meta.visualCol)])),d=lo(h);i&&(s.args[0]=i);let g=[],p=ls(d,s.args[0],l,e=>{e.checked&&g.push(e.value),l_(lP,this,lD).call(this,e,u)}),f=e.editedConditionStack.column;a.locale=this.hot.getCellMeta(0,f).locale,a.args=[g],a.command=at(lO),a.itemsSnapshot=p}else a.args=[],a.command=at(ai);this.state.setValueAtIndex(t,a)};t(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&t(e.depen
38dentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof lT)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,r,i,o,s)=>{(0,n.addClass)(t.parentNode,"htFiltersMenuValue");let a=this.hot.rootDocument.createElement("div");return(0,n.addClass)(a,"htFiltersMenuLabel"),a.textContent=s,t.appendChild(a),t.parentElement.hasAttribute("ghost-table")||(0,c.arrayEach)(this.elements,e=>t.appendChild(e.element)),t}}}reset(){let e=this.hot.getTranslatedPhrase(eA.FILTERS_VALUES_BLANK_CELLS),t=this._getColumnVisibleValues(),r=t.map(e=>e.value),i=new Map(t.map(e=>[e.value,e.meta])),n=lo(r),o=ls(n,n,e,e=>{l_(lP,this,lD).call(this,e,i)});this.getMultipleSelectElement().setItems(o),super.reset(),this.getMultipleSelectElement().setValue(n);let s=this.hot.getPlugin("filters").getSelectedColumn();null!==s&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,s.visualIndex).locale)}_getColumnVisibleValues(){let e=this.hot.getPlugin("filters").getSelectedColumn();return null===e?[]:(0,c.arrayMap)(this.hot.getDataAtCol(e.visualIndex),(t,r)=>({value:ln(t),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function lk(e){(0,p.isKey)(e.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),(0,o.stopImmediatePropagation)(e)),(0,p.isKey)(e.keyCode,"ENTER")&&("apply"===this.searchMode&&this.runLocalHooks("accept"),(0,o.stopImmediatePropagation)(e))}function lD(e,t){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(e.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",e.visualValue,t.get(e.value)))}function lH(e,t){return"numeric"===t.type?eB(e,t):e}var lB=new WeakSet;class lF extends s8{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,t){var r,i;super(e,{id:t.id,stateless:!0}),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,lB),lB.add(this),(r="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r="name","string"))?i:i+"")in this?Object.defineProperty(this,r,{value:"",enumerable:!0,configurable:!0,writable:!0}):this[r]="",this.name=t.name,this.elements.push(new aM(this.hot,{type:"button",value:eA.FILTERS_BUTTONS_OK,className:"htUIButton htUIButtonOK",identifier:lF.BUTTON_OK})),this.elements.push(new aM(this.hot,{type:"button",value:eA.FILTERS_BUTTONS_CANCEL,className:"htUIButton htUIButtonCancel",identifier:lF.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){(0,c.arrayEach)(this.elements,e=>{e.addLocalHook("click",(e,t)=>(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")})(lB,this,lV).call(this,e,t))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>((0,n.addClass)(t.parentNode,"htFiltersMenuActionBar"),(0,c.arrayEach)(this.elements,e=>t.appendChild(e.element)),t)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}function lV(e,t){t.options.identifier===lF.BUTTON_OK?this.accept():this.cancel()}function lU(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let lW="ConditionCollection.filteringStates";class lj{constructor(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];lU(this,"hot",void 0),lU(this,"isMapRegistrable",void 0),lU(this,"filteringStates",new rH.A),this.hot=e,this.isMapRegistrable=t,!0===this.isMapRegistrable?this.hot.columnIndexMapper.registerMap(lW,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexe
38s())}isEmpty(){return 0===this.getFilteredColumns().length}isMatch(e,t){var r;let i=this.filteringStates.getValueAtIndex(t),n=null!==(r=null==i?void 0:i.conditions)&&void 0!==r?r:[],o=null==i?void 0:i.operation;return this.isMatchInConditions(n,e,o)}isMatchInConditions(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a0;return!e.length||(function(e){if(!aQ[e])throw Error(`Operation with id "${e}" does not exist.`);let t=aQ[e].func;return function(e,r){return t(e,r)}})(r)(e,t)}addCondition(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a0,i=arguments.length>3?arguments[3]:void 0,n=this.hot.getCellMeta(0,e).locale,o=t.args.map(e=>"string"==typeof e?e.toLocaleLowerCase(n):e),s=t.name||t.command.key;this.runLocalHooks("beforeAdd",e);let a=this.getOperation(e);if(a){if(a!==r)throw Error((0,rJ.e)`The column of index ${e} has been already applied with a \`${a}\`\x20
39        filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
40        Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
41        use it consequently for a particular column).`)}else if((0,d.isUndefined)(aQ[r]))throw Error((0,rJ.e)`Unexpected operation named \`${r}\`. Possible ones are\x20
42        \`disjunction\` and \`conjunction\`.`);let l=this.getConditions(e);0===l.length?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:s,args:o,func:ae(s,o)}]},i):l.push({name:s,args:o,func:ae(s,o)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var t,r;return null!==(t=null===(r=this.filteringStates.getValueAtIndex(e))||void 0===r?void 0:r.conditions)&&void 0!==t?t:[]}getOperation(e){var t;return null===(t=this.filteringStates.getValueAtIndex(e))||void 0===t?void 0:t.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[t]=e;return t})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce((e,t)=>{let[r,{operation:i,conditions:n}]=t;return e.push({column:r,operation:i,conditions:n.map(e=>{let{name:t,args:r}=e;return{name:t,args:[...r]}})}),e},[])}importAllConditions(e){this.clean(),e.forEach(e=>{e.conditions.forEach(t=>this.addCondition(e.column,t))})}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,t){let r=this.getConditions(e);return t?r.some(e=>e.name===t):r.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(lW),this.filteringStates=null,this.clearLocalHooks()}}function lG(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,s.mixin)(lj,iI.Z);class l${constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>[];lG(this,"conditionCollection",void 0),lG(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=t}filter(){let e=[];return(0,c.arrayEach)(this.conditionCollection.getFilteredColumns(),(t,r)=>{let i=this.columnDataFactory(t);r&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(t,i)}),e}filterByColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];return(0,c.arrayEach)(t,t=>{void 0!==t&&this.conditionCollection.isMatch(t,e)&&r.push(t)}),r}_getIntersectData(e,t){let r=[];return(0,c.arrayEach)(t,t=>{let i=t.meta.visualRow;void 0!==e[i]&&(r[i]=e[i])}),r}}function lz(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lY(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var lK=new WeakSet;class lX{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[];(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(this,lK),lK.add(this),lz(this,"hot",void 0),lz(this,"conditionCollection",void 0),lz(this,"columnDataFactory",void 0),lz(this,"changes",[]),lz(this,"grouping",!1),lz(this,"latestEditedColumnPosition",-1),lz(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=t,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",e=>lY(lK,this,lq).call(this,e)),this.conditionCollection.addLocalHook("afterRemove",e=>this.updateStatesAtColumn(e)),this.conditionCollection.addLocalHook("afterAdd",e=>this.updateStatesAtColumn(e)),this.conditionCollection.addLocalHook("beforeClean",()=>lY(lK,this,lZ).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>lY(lK,this,lQ).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,(0,c.arrayEach)(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,t){var r=this;if(this.grouping){-1===this.changes.indexOf(e)&&this.changes.push(e);return}let i=this.conditionCollection.exportAllConditions(),n=this.conditionCollection.getColumnStackPosition(e);-1===n&&(n=this.latestEditedColumnPosition);let o=i.slice(0,n),s=i.slice(n);s.length&&s[0].column===e&&s.shift();let a=(0,y.curry)(function(e,t){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=new lj(r.hot,!1),s=[].concat(e,n);o.importAllConditions(s);let a=r.columnDataFactory(t);i=o.isEmpty()?a:new l$(o,e=>r.columnDataFactory(e)).filter();let l=li(i=(0,c.arrayMap)(i,e=>e.meta.visualRow));return o.destroy(),(0,c.arrayFilter)(a,e=>l(e.meta.visualRow))})(o),l=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:l},dependentConditionStacks:s,filteredRowsFactory:a,conditionArgsChange:t})}destroy(){this.clearLocalHooks(),(0,s.objectEach)(this,(e,t)=>{this[t]=null})}}function lq(e){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(e)}function lZ(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function lQ(){(0,c.arrayEach)(this.latestOrderStack,e=>{this.updateStatesAtColumn(e)})}(0,s.mixin)(lX,iI.Z);let lJ="filters";var l0=r(88579);function l1(e,t,r){l2(e,t),t.set(e,r)}function l2(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function l5(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l3(e,t,r){return e.set(l4(e,t),r),r}function l9(e,t){return e.get(l4(e,t))}function l4(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let l7="filters";
42var l8=new WeakMap,l6=new WeakMap,he=new WeakMap,ht=new WeakSet;class hr extends tn.vq{static get PLUGIN_KEY(){return l7}static get PLUGIN_PRIORITY(){return 250}static get DEFAULT_SETTINGS(){return{searchMode:"show"}}static get SETTINGS_VALIDATORS(){return{searchMode:e=>"string"==typeof e&&["show","apply"].includes(e)}}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var t;super(e),t=this,l2(this,ht),ht.add(this),l5(this,"dropdownMenuPlugin",null),l5(this,"conditionCollection",null),l5(this,"conditionUpdateObserver",null),l5(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),l5(this,"filtersRowsMap",null),l1(this,l8,void 0),l1(this,l6,new WeakSet),l1(this,he,[]),this.hot.addHook("afterGetColHeader",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return l4(ht,t,hc).call(t,...r)})}isEnabled(){return!!this.hot.getSettings()[l7]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new l0.n),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");let t=this.hot.getSettings().dropdownMenu,r=t&&t.uiContainer||this.hot.rootPortalElement,i=e=>(e.addLocalHook("accept",()=>l4(ht,this,hl).call(this,"accept")),e.addLocalHook("cancel",()=>l4(ht,this,hl).call(this,"cancel")),e.addLocalHook("change",t=>l4(ht,this,hh).call(this,e,t)),e);if(!this.components.get("filter_by_condition")){let e=new aX(this.hot,{id:"filter_by_condition",name:()=>`${this.hot.getTranslatedPhrase(eA.FILTERS_DIVS_FILTER_BY_CONDITION)}:`,addSeparator:!1,menuContainer:r});e.addLocalHook("afterClose",()=>l4(ht,this,hu).call(this)),this.components.set("filter_by_condition",i(e))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new lt(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){let e=new aX(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});e.addLocalHook("afterClose",()=>l4(ht,this,hu).call(this)),this.components.set("filter_by_condition2",i(e))}if(!this.components.get("filter_by_value")){let e=this.getSetting("searchMode");this.components.set("filter_by_value",i(new lL(this.hot,{id:"filter_by_value",name:()=>`${this.hot.getTranslatedPhrase(eA.FILTERS_DIVS_FILTER_BY_VALUE)}:`,searchMode:e})))}if(this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new lF(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new lj(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new lX(this.hot,this.conditionCollection,e=>this.getDataMapAtColumn(e)),this.conditionUpdateObserver.addLocalHook("update",e=>l4(ht,this,hd).call(this,e))),this.components.forEach(e=>e.show()),this.addHook("afterDropdownMenuDefaultOptions",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return l4(ht,e,ha).call(e,...r)}),this.addHook("beforeDropdownMenuShow",()=>l4(ht,this,hs).call(this)),this.addHook("afterDropdownMenuShow",()=>l4(ht,this,hn).call(this)),this.addHook("afterDropdownMenuHide",()=>l4(ht,this,ho).call(this)),this.addHook("afterChange",e=>l4(ht,this,hi).call(this,e)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!l9(l8,this)&&this.dropdownMenuPlugin.enabled){let e=[{focus:()=>{let e=l9(l8,this).getMenu(),t=e.getNavigator(),r=l9(l8,this).getLastMenuPage();e.focus(),r>0?t.setCurrentPage(r):t.toFirstItem()}},...Array.from(this.components).map(e=>{let[,t]=e;return t.getElements()}).flat()];l3(l8,this,function(e,t){let r,i=-1,o=n4({initialPage:0,size:()=>t.length,onItemSelect:(e,r)=>{let i=t[e];return i instanceof lT?r:(!i.element||!!(0,n.isVisible)(i.element))&&void i.focus()}}),s=e=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(lJ),o.setCurrentPage(t.indexOf(e))};function a(e){let n=r.getKeyboardShortcutsCtrl(),s=e.getKeyboardShortcutsCtrl();o.clear(),s.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:n.getContext(lJ),callback:()=>{e.isSubMenu()&&e.close(),n.listen(lJ)}
42}]),e.isSubMenu()||n.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:e=>{let t=r.getNavigator();t.getCurrentPage()>-1&&(i=t.getCurrentPage()),t.clear(),e.shiftKey?o.toPreviousItem():o.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:e=>{let r=t[o.getCurrentPage()];r instanceof aW&&(r.openOptions(),e.preventDefault()),r instanceof lc&&(r.activate(),e.preventDefault()),r instanceof aR||e.preventDefault()}}],lJ)}function l(e){e.addLocalHook("afterSelectionChange",e=>{e.key.startsWith("filter_")||o.clear()}),e.addLocalHook("afterSubmenuOpen",a),e.addLocalHook("afterOpen",a),r=e}return t.forEach(e=>{e instanceof aR&&(e.addLocalHook("click",s(e)),e.addLocalHook("focus",s(e)),e.addLocalHook("afterClose",s(e)))}),l(e),{...o,listen:function(){r.focus(),r.getKeyboardShortcutsCtrl().listen(lJ)},setMenu:l,getMenu:function(){return r},getLastMenuPage:function(){return i}}}(this.dropdownMenuPlugin.menu,e));let t=e=>{l9(l8,this).listen(),e.preventDefault(),(0,p.isKey)(e.keyCode,"TAB")&&(e.shiftKey?l9(l8,this).toPreviousItem():l9(l8,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",t),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",t)}this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){if(this.enabled){var e;null!==(e=this.dropdownMenuPlugin)&&void 0!==e&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((e,t)=>{e.destroy(),this.components.set(t,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:()=>{let e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:l7})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(l7)}addCondition(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a0,n=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(n,{command:{key:t},args:r},i)}removeConditions(e){let t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}clearConditions(e){if(void 0===e)this.conditionCollection.clean();else{let t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){let{navigableHeaders:e}=this.hot.getSettings(),t=this._createDataFilter(),r=!this.conditionCollection.isEmpty(),i=[],n=this.exportConditions(),o=this.hot.runHooks("beforeFilter",n,l9(he,this));if(!1!==o&&r){let r=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear();let e=li(i=(0,c.arrayMap)(t.filter(),e=>e.meta.visualRow));(0,eH.rangeEach)(this.hot.countSourceRows()-1,t=>{e(t)||r.push(t)}),(0,c.arrayEach)(r,e=>{this.filtersRowsMap.setValueAtIndex(e,!0)})},!0),e||i.length||this.hot.deselectCell(),l3(he,this,this.exportConditions())}else!1===o||r?this.importConditions(l9(he,this)):(l3(he,this,this.exportConditions()),this.filtersRowsMap.clear());this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeActive().highlight.col),!1!==o&&(this.hot.runHooks("afterFilter",n),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;let t=null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight;return t?{visualIndex:t.col,physicalIndex:this.hot.toPhysicalColumn(t.col)}:null}getDataMapAtColumn(e){let t=this.hot.toVisualColumn(e),r=[];return(0,c.arrayEach)(this.hot.getSourceDataAtCol(t),(e,i)=>{var n;let{row:o,col:s,visualCol:a,visualRow:l,type:h,instance:u,dateFormat:c,locale:d}=this.hot.getCellMeta(i,t),g=null!==(n=this.hot.getDataAtCell(this.hot.toVisualRow(i),t))&&void 0!==n?n:e;r.push({meta:{row:o,col:s,visualCol:a,visualRow:l,type:h,instance:u,dateFormat:c,locale:d},value:ln(g)})}),r}updateValueComponentCondition(e){let t=lo(this.hot.getDataAtCol(e));this.conditionUpdateObserver.updateStatesAtColumn(e,t)}restoreComponents(e){var t;let r=null===(t=this.getSelectedColumn())||void 0===t?void 0:t.physicalIndex;
42e.forEach(e=>{e.isHidden()||e.restoreState(r)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,t,r,i){let n=e;return n===a1&&t.command.key!==ai&&r.command.key!==ai&&i.command.key!==ai?n=a2:i.command.key!==ai&&(t.command.key===ai||r.command.key===ai)&&(n=a0),n}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){let{command:e}=this.components.get("filter_by_condition").getState(),t=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];e.showOperators?this.showComponents(...t):this.hideComponents(...t)}_createDataFilter(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.conditionCollection;return new l$(e,e=>this.getDataMapAtColumn(e))}getIndexesOfComponents(){let e=[];if(!this.dropdownMenuPlugin)return e;let t=this.dropdownMenuPlugin.menu;for(var r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];return(0,c.arrayEach)(i,r=>{(0,c.arrayEach)(t.menuItems,(t,i)=>{t.key===r.getMenuItemDescriptor().key&&e.push(i)})}),e}changeComponentsVisibility(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(!this.dropdownMenuPlugin)return;let t=this.dropdownMenuPlugin.menu.hotMenu,r=t.getPlugin("hiddenRows");for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];let s=this.getIndexesOfComponents(...n);e?r.showRows(s):r.hideRows(s),t.render()}hideComponents(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.changeComponentsVisibility(!1,...t)}showComponents(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.changeComponentsVisibility(!0,...t)}destroy(){this.enabled&&(this.components.forEach((e,t)=>{null!==e&&(e.destroy(),this.components.set(t,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function hi(e){e&&(0,c.arrayEach)(e,e=>{let[,t]=e,r=this.hot.propToCol(t);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function hn(){let e=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),e.updateMenuDimensions()}function ho(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function hs(){let e=this.dropdownMenuPlugin.menu;l9(l6,this).has(e)||l9(l8,this).setMenu(e),l9(l6,this).add(e)}function ha(e){e.items.push({name:i1}),this.components.forEach(t=>{e.items.push(t.getMenuItemDescriptor())})}function hl(e){var t,r;if("accept"===e){let e=this.getSelectedColumn();if(null===e){null===(r=this.dropdownMenuPlugin)||void 0===r||r.close();return}let{physicalIndex:t}=e,i=this.components.get("filter_by_condition").getState(),n=this.components.get("filter_by_condition2").getState(),o=this.components.get("filter_by_value").getState(),s=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),i,n,o);this.conditionUpdateObserver.groupChanges();let a=this.conditionCollection.getColumnStackPosition(t);-1===a&&(a=void 0),this.conditionCollection.removeConditions(t),i.command.key!==ai&&(this.conditionCollection.addCondition(t,i,s,a),n.command.key!==ai&&this.conditionCollection.addCondition(t,n,s,a)),o.command.key!==ai&&this.conditionCollection.addCondition(t,o,s,a),this.conditionUpdateObserver.flush(),this.components.forEach(e=>e.saveState(t)),this.filter()}null===(t=this.dropdownMenuPlugin)||void 0===t||t.close()}function hh(e,t){let r=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),e.constructor!==aX||t.inputsCount||this.setListeningDropdownMenu(),r.updateMenuDimensions()}function hu(){this.setListeningDropdownMenu()}function hc(e,t,r){let i=this.hot.toPhysicalColumn(e);this.enabled&&this.conditionCollection.hasConditions(i)&&r===this.hot.view.getColumnHeadersCount()-1?(0,n.addClass)(t,"htFiltersActive"):(0,n.removeClass)(t,"htFiltersActive")}function hd(e){var t;if(!(null!==(t=this.dropdownMenuPlugin)&&void 0!==t&&t.enabled))return;let{editedConditionStack:{conditions:r,column:i},conditionArgsChange:n}=e;Array.isArray(n)&&l3(he,this,l9(he,this).map(e=>(e.column===i&&r.length>
420&&e.conditions.forEach(e=>{"by_value"===e.name&&(e.args=[[...n]])}),e)));let o=r.filter(e=>e.name===lO),s=r.filter(e=>e.name!==lO);if(o.length>=2||s.length>=3)(0,rE.ZK)((0,rJ.e)`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
43        The overall amount of conditions exceed the capability of the dropdown menu.\x20
44        For more details see the documentation.`);else{let t=this.conditionCollection.getOperation(i);this.components.get("filter_by_condition").updateState(s[0],i),this.components.get("filter_by_condition2").updateState(s[1],i),this.components.get("filter_operators").updateState(t,i),this.components.get("filter_by_value").updateState(e)}}let hg="internal-use-in-handsontable",hp={licenseKey:hg,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 hf(e){var t;return{maxColumns:e.maxColumns,maxRows:e.maxRows,language:null===(t=e[h5])||void 0===t||null===(t=t.language)||void 0===t?void 0:t.langCode}}function hm(e){return Object.keys(e).reduce((t,r)=>("hyperformula"!==r&&(t[r]=e[r]),t),{})}function hy(){let e="engine_relationship",t=(0,rj.Qv)(h5);return t.hasItem(e)||t.register(e,new Map),t.getItem(e)}function hv(){let e="shared_engine_usage",t=(0,rj.Qv)(h5);return t.hasItem(e)||t.register(e,new Map),t.getItem(e)}function hw(e){var t;let r=hy();return new Map((0===r.size?[]:Array.from(null!==(t=r.get(e))&&void 0!==t?t:[])).map(e=>[e.getPlugin("formulas").sheetId,e]))}function hE(e,t){if(e){let r=hy(),i=r.get(e),n=hv(),o=n.get(e);i&&i.includes(t)&&(i.splice(i.indexOf(t),1),0===i.length&&r.delete(e)),o&&o.includes(t.guid)&&(o.splice(o.indexOf(t.guid),1),0===o.length&&(n.delete(e),e.destroy()))}}let hS="DD/MM/YYYY";function hC(e,t){return"string"==typeof e&&"date"===t}function hR(e,t){return _(e,t,!0).isValid()}function hb(e,t){return _(e,t,!0).format(hS)}function hT(e,t){return _(new Date(Date.UTC(0,0,e+-1))).format(t)}function hN(e,t,r){var i;return(i=function(e,t){let r=[];return e.forEach(e=>{let i={from:e,to:t};r.forEach(e=>{let t=e.from>e.to,r=e.to<=i.from;e.from>i.from&&r&&t&&(i.from+=1)}),i.from>=t&&(t+=1),r.push(i)}),r}(e,function(e,t,r){let i=Array.from(Array(r).keys()).filter(t=>!1===e.includes(t));if(0===t){var n;return null!==(n=i[t])&&void 0!==n?n:0}return i[t-1]+1}(e,t,r))).forEach((e,t)=>{i.slice(t+1).forEach(t=>{let r=t.from<t.to;t.from>e.from&&r&&(t.from-=1)})}),i}function hA(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function hI(e,t){return e.get(hO(e,t))}function hM(e,t,r){return e.set(hO(e,t),r),r}function hO(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var hx=new WeakMap,h_=new WeakMap,hP=new WeakMap,hL=new WeakMap,hk=new WeakMap,hD=new WeakMap,hH=new WeakMap;class hB{constructor(e,t,r){hA(this,hx,void 0),hA(this,h_,void 0),hA(this,hP,void 0),hA(this,hL,[]),hA(this,hk,[]),hA(this,hD,void 0),hA(this,hH,[]),hM(hx,this,e),hM(h_,this,t),hM(hP,this,r)}setRemovedHfIndexes(e){return hM(hH,this,e.map(e=>{let t=hI(h_,this).getVisualFromPhysicalIndex(e);return this.getHfIndexFromVisualIndex(t)})),hI(hH,this)}getRemovedHfIndexes(){return hI(hH,this)}getHfIndexFromVisualIndex(e){let t=hI(h_,this).getIndexesSequence(),r=hI(h_,this).getNotTrimmedIndexes();return t.indexOf(r[e],e)}syncMoves(e){let t=`move${(0,g.toUpperCaseFirst)(hI(hx,this))}s`;hI(hP,this).getEngine().batch(()=>{e.forEach(e=>{let r=e.from!==e.to,i=e.from+1!==e.to;r&&i&&hI(hP,this).getEngine()[t](hI(hP,this).getSheetId(),e.from,1,e.to)})})}storeMovesInformation(e,t,r){!1!==r&&(hM(hk,this,e.map(e=>this.getHfIndexFromVisualIndex(e))),hM(hD,this,this.getHfIndexFromVisualIndex(t)))}
44calculateAndSyncMoves(e,t){if(hI(hP,this).isPerformingUndoRedo()||!1===e||!1===t)return;let r=hN(hI(hk,this),hI(hD,this),hI(h_,this).getNumberOfIndexes());null===hI(hP,this).getSheetId()?hI(hP,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){let e=`set${(0,g.toUpperCaseFirst)(hI(hx,this))}Order`;return t=>{if(hI(hP,this).isPerformingUndoRedo())return;let r=hI(h_,this).getIndexesSequence();if("update"===t&&r.length>0){let t;let i=hI(hL,this).map(e=>r.indexOf(e)),n=hI(hP,this).getEngine().getSheetDimensions(hI(hP,this).getSheetId());t="row"===hI(hx,this)?n.height:n.width;let o=i.length;for(let e=o;e<t;e+=1)i.push(e);hI(hP,this).getEngine()[e](hI(hP,this).getSheetId(),i)}hM(hL,this,r)}}init(){hM(hL,this,hI(h_,this).getIndexesSequence())}}function hF(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function hV(e,t){return e.get(hW(e,t))}function hU(e,t,r){return e.set(hW(e,t),r),r}function hW(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var hj=new WeakMap,hG=new WeakMap,h$=new WeakMap,hz=new WeakMap,hY=new WeakMap,hK=new WeakMap,hX=new WeakMap;class hq{constructor(e,t,r){hF(this,hj,void 0),hF(this,hG,void 0),hF(this,h$,void 0),hF(this,hz,!1),hF(this,hY,!1),hF(this,hK,null),hF(this,hX,null),hU(hj,this,new hB("row",e,this)),hU(hG,this,new hB("column",t,this)),hU(h$,this,r)}getForAxis(e){return"row"===e?hV(hj,this):hV(hG,this)}setPerformUndo(e){hU(hz,this,e)}setPerformRedo(e){hU(hY,this,e)}isPerformingUndoRedo(){return hV(hz,this)||hV(hY,this)}getSheetId(){return hV(hX,this)}getEngine(){return hV(hK,this)}getPostponeAction(){return hV(h$,this)}setupSyncEndpoint(e,t){hU(hK,this,e),hU(hX,this,t),hV(hj,this).init(),hV(hG,this).init()}}function hZ(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hQ(e,t,r){hJ(e,t),t.set(e,r)}function hJ(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function h0(e,t,r){return e.set(h2(e,t),r),r}function h1(e,t){return e.get(h2(e,t))}function h2(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let h5="formulas",h3=["maxRows","maxColumns","language"];eN.P.getSingleton().register("afterNamedExpressionAdded"),eN.P.getSingleton().register("afterNamedExpressionRemoved"),eN.P.getSingleton().register("afterSheetAdded"),eN.P.getSingleton().register("afterSheetRemoved"),eN.P.getSingleton().register("afterSheetRenamed"),eN.P.getSingleton().register("afterFormulasValuesUpdate");let h9=e=>"UndoRedo.undo"===e||"UndoRedo.redo"===e||"auto"===e;var h4=new WeakMap,h7=new WeakMap,h8=new WeakMap,h6=new WeakSet;class ue extends tn.vq{constructor(){var e;super(...arguments),e=this,hJ(this,h6),h6.add(this),hQ(this,h4,!1),hQ(this,h7,!1),hQ(this,h8,[["valuesUpdated",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return h2(h6,e,uC).call(e,...r)}],["namedExpressionAdded",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return h2(h6,e,uR).call(e,...r)}],["namedExpressionRemoved",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return h2(h6,e,ub).call(e,...r)}],["sheetAdded",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return h2(h6,e,uT).call(e,...r)}],["sheetRenamed",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return h2(h6,e,uN).call(e,...r)}],["sheetRemoved",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return h2(h6,e,uA).call(e,...r)}]]),hZ(this,"staticRegister",(0,rj.Qv)("formulas")),hZ(this,"engine",null),hZ(this,"sheetId",null),hZ(this,"sheetName",null),hZ(this,"indexSyncer",null),hZ(this,"rowAxisSyncer",null),hZ(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return h5}static get PLUGIN_PRIORITY(){return 260}static get SETTING_KEYS(){return[h5,...h3]}isEnabled(){return!!this.hot.getSettings()[h5]}enablePlugin(){var e,t=this;if(!this.enabled){if(this.engine=null!==(e=function(e){let t=e.getSettings(),r=t[h5],i=null==r?void 0:r.engine;if(!0===r||(0,d.isUndefined)(i))return null;if("function"==typeof i.hyperformula||"function"==typeof i){var n;return function(e,t,r){var i,n;let o=t[h5],s=function(e){var t;let r=e[h5],i=hm(null!=r&&null!==(t=r.engine)&&void 0!==t&&t.hyperformula?r.engine:{}),n=hf(e);return{...hp,...i,...n}}(t),a=hy(),l=hv();
44(i=o.functions)&&i.forEach(t=>{let{name:r,plugin:i,translations:n}=t;try{e.registerFunction(r,i,n)}catch(e){(0,rE.ZK)(e.message)}}),function(e,t){if(t){let{langCode:r}=t;try{e.registerLanguage(r,t)}catch(e){(0,rE.ZK)(e.message)}}}(e,o.language);let h=e.buildEmpty(s);return a.set(h,[r]),l.set(h,[r.guid]),(n=o.namedExpressions)&&(h.suspendEvaluation(),n.forEach(e=>{let{name:t,expression:r,scope:i,options:n}=e;try{h.addNamedExpression(t,r,i,n)}catch(e){(0,rE.ZK)(e.message)}}),h.resumeEvaluation()),h.on("sheetAdded",()=>{h.rebuildAndRecalculate()}),h.on("sheetRemoved",()=>{h.rebuildAndRecalculate()}),h}(null!==(n=i.hyperformula)&&void 0!==n?n:i,t,e)}if("object"==typeof i&&(0,d.isUndefined)(i.hyperformula)){let t=hy(),r=hv().get(i);return t.has(i)||t.set(i,[]),t.get(i).push(e),r&&r.push(e.guid),i.getConfig().licenseKey||i.updateConfig({licenseKey:hg}),(i.getConfig().leapYear1900!==hp.leapYear1900||!1===(0,s.isObjectEqual)(i.getConfig().nullDate,hp.nullDate))&&(0,rE.ZK)((0,rJ.e)`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\` 
45      settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),i}return null}(this.hot))&&void 0!==e?e:this.engine,!this.engine){(0,rE.ZK)("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.");return}if(null!==this.sheetName&&!this.engine.doesSheetExist(this.sheetName)){let e=this.addSheet(this.sheetName,h2(h6,this,ui).call(this));!1!==e&&h2(h6,this,ut).call(this,e)}this.addHook("beforeLoadData",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,us).call(t,...r)}),this.addHook("afterLoadData",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,ul).call(t,...r)}),this.addHook("beforeUpdateData",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,us).call(t,...r)}),this.addHook("afterUpdateData",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,ul).call(t,...r)}),this.addHook("modifyData",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uh).call(t,...r)}),this.addHook("modifySourceData",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uu).call(t,...r)}),this.addHook("beforeValidate",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,un).call(t,...r)}),this.addHook("afterSetSourceDataAtCell",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,ud).call(t,...r)}),this.addHook("afterSetDataAtCell",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uc).call(t,...r)}),this.addHook("afterSetDataAtRowProp",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uc).call(t,...r)}),this.addHook("beforeCreateRow",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,ug).call(t,...r)}),this.addHook("beforeCreateCol",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,up).call(t,...r)}),this.addHook("afterCreateRow",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uy).call(t,...r)}),this.addHook("afterCreateCol",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uv).call(t,...r)}),this.addHook("beforeRemoveRow",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uf).call(t,...r)}),this.addHook("beforeRemoveCol",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,um).call(t,...r)}),this.addHook("afterRemoveRow",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uw).call(t,...r)}),this.addHook("afterRemoveCol",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uE).call(t,...r)}),this.indexSyncer=new hq(this.hot.rowIndexMapper,this.hot.columnIndexMapper,e=>{this.hot.addHookOnce("init",()=>{e()})}),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",(e,t,r,i
45)=>{this.rowAxisSyncer.storeMovesInformation(e,t,i)}),this.hot.addHook("beforeColumnMove",(e,t,r,i)=>{this.columnAxisSyncer.storeMovesInformation(e,t,i)}),this.hot.addHook("afterRowMove",(e,t,r,i,n)=>{this.rowAxisSyncer.calculateAndSyncMoves(i,n)}),this.hot.addHook("afterColumnMove",(e,t,r,i,n)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,n)}),this.hot.addHook("beforeColumnFreeze",(e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart,t)}),this.hot.addHook("afterColumnFreeze",(e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)}),this.hot.addHook("beforeColumnUnfreeze",(e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart-1,t)}),this.hot.addHook("afterColumnUnfreeze",(e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)}),this.addHook("afterCellMetaReset",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,ua).call(t,...r)}),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 e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uS).call(t,...r)}),this.addHook("beforeAutofill",function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return h2(h6,t,uo).call(t,...r)}),h1(h8,this).forEach(e=>{let[t,r]=e;return this.engine.on(t,r)}),super.enablePlugin()}}disablePlugin(){h1(h8,this).forEach(e=>{let[t,r]=e;return this.engine.off(t,r)}),hE(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){var t;let r=function(e){var t;let r=e[h5],i=hm(null!=r&&null!==(t=r.engine)&&void 0!==t&&t.hyperformula?r.engine:{}),n=hf(e);return{...i,...n}}(this.hot.getSettings());t=this.engine.getConfig(),Object.keys(r).some(e=>void 0!==r[e]&&r[e]!==t[e])&&this.engine.updateConfig(r);let i=this.hot.getSettings()[h5];if((0,d.isDefined)(i)&&(0,d.isDefined)(i.sheetName)&&i.sheetName!==this.sheetName&&this.switchSheet(i.sheetName),!e.data&&null===this.sheetName){let e=this.hot.getSettings()[h5].sheetName;if(e&&this.engine.doesSheetExist(e))this.switchSheet(this.sheetName);else{let t=this.addSheet(null!=e?e:void 0,h2(h6,this,ui).call(this));h2(h6,this,ut).call(this,t)}}super.updatePlugin(e)}destroy(){h1(h8,this).forEach(e=>{var t;let[r,i]=e;return null===(t=this.engine)||void 0===t?void 0:t.off(r,i)}),h0(h8,this,null),hE(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,t){if((0,d.isDefined)(t)&&!(0,la.isArrayOfArrays)(t))return(0,rE.ZK)("The provided data should be an array of arrays."),!1;if(null!=e&&this.engine.doesSheetExist(e))return(0,rE.ZK)("Sheet with the provided name already exists."),!1;try{let r=this.engine.addSheet(null!=e?e:void 0);return t&&this.engine.setSheetContent(this.engine.getSheetId(r),t),r}catch(e){return(0,rE.ZK)(e.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){(0,rE.vU)(`The sheet named \`${e}\` does not exist, switch aborted.`);return}h2(h6,this,ut).call(this,e);let t=this.engine.getSheetSerialized(this.sheetId);t.length>0&&this.hot.loadData(t,`${(0,g.toUpperCaseFirst)(h5)}.switchSheet`)}getCellType(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sheetId,i=this.hot.toPhysicalRow(e),n=this.hot.toPhysicalColumn(t);return null!==i&&null!==n?this.engine.getCellType({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)}):"EMPTY"}isFormulaCellType(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)})}renderDependentSheets(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new Set;e.forEach(e=>{var t;let i=null==e||null===(t=e.address)||void 0===t?void 0:t.sheet;void 0===i||r.has(i)||r.add(i)}),hw(this.engine).forEach((e,i)=>{if((t||i!==this.sheetId)&&r.has(i)){var n;
45e.render(),null===(n=e.view)||void 0===n||n.adjustElementsSize()}})}validateDependentCells(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e=>{var t;let{row:r,col:i,sheet:n}=null!==(t=null==e?void 0:e.address)&&void 0!==t?t:{};return(0,d.isDefined)(n)?`${n}:${r}x${i}`:""},i=new Set(t.map(e=>r(e)));e.forEach(e=>{var t,n;let{row:o,col:s}=null!==(t=e.address)&&void 0!==t?t:{};if(!1===(0,d.isDefined)(o)||!1===(0,d.isDefined)(s)||o>=this.hot.countRows()||s>=this.hot.countCols())return;let a=null==e||null===(n=e.address)||void 0===n?void 0:n.sheet,l=r(e);if(void 0!==a&&!i.has(l)){let e=hw(this.engine).get(a);if(!e)return;e.validateCell(e.getDataAtCell(o,s),e.getCellMeta(o,s),()=>{})}})}syncChangeWithEngine(e,t,r){let i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){(0,rE.ZK)(`Not possible to set cell data at ${JSON.stringify(i)}`);return}let n=this.hot.getCellMeta(e,t);if(hC(r,n.type)){if(hR(r,n.dateFormat))r=hb(r,n.dateFormat);else{var o;!1===("string"==typeof(o=r)&&o.startsWith("="))&&(r=`'${r}`)}}return this.engine.setCellContents(i,r)}}function ut(e){this.sheetName=e,this.sheetId=this.engine.getSheetId(this.sheetName)}function ur(e,t,r){if((0,s.isObject)(r)&&null!==r){let i=this.hot.toVisualRow(e),n=this.hot.toVisualColumn(t),o=this.hot.getCellMeta(i,n).valueGetter;return o?o.call(this.hot,r):r.toString()}return r}function ui(e,t,r,i){return this.hot.getSourceDataArray(e,t,r,i).map((e,t)=>e.map((e,r)=>h2(h6,this,ur).call(this,t,r,e)))}function un(e,t,r){let i=this.hot.propToCol(r);if(this.isFormulaCellType(t,i)){let e={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},r=this.hot.getCellMeta(t,i),n=this.engine.getCellValue(e);return"date"===r.type&&(0,eH.isNumeric)(n)&&(n=hT(n,r.dateFormat)),"object"==typeof n&&null!==n?n.value:n}return e}function uo(e,t,r){let{row:i,col:n}=t.getTopStartCorner(),{row:o,col:s}=t.getBottomEndCorner(),{row:a,col:l}=r.getTopStartCorner(),{row:h,col:u}=r.getBottomEndCorner(),c={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),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(h),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId}};if(!1===this.engine.isItPossibleToSetCellContents(d))return!1;let g=this.engine.getFillRangeData(c,d),{row:p,col:f}=c.start,{row:m,col:y}=c.end,w=m-p+1,E=y-f+1;for(let e=0;e<g.length;e+=1)for(let t=0;t<g[e].length;t+=1){let r=g[e][t],i=p+e%w,n=f+t%E,o=this.hot.getCellMeta(i,n);if(hC(r,o.type)){if(r.startsWith("'"))g[e][t]=r.slice(1);else if(!1===this.isFormulaCellType(i,n,this.sheetId)){var S;g[e][t]=(S=o.dateFormat,_(r,hS,!0).format(S))}}}return g}function us(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";r.includes((0,g.toUpperCaseFirst)(h5))||h0(h7,this,(0,d.isUndefined)(this.hot.getSettings().data))}function ua(){if(h1(h7,this)){this.switchSheet(this.sheetName);return}let e=h2(h6,this,ui).call(this);e.forEach((t,r)=>{t.forEach((t,i)=>{let n=this.hot.getCellMeta(r,i,{skipMetaExtension:!0}),o=n.dateFormat;hC(t,n.type)&&(hR(t,o)?e[r][i]=hb(t,o):t.startsWith("=")||(e[r][i]=`'${t}`))})}),h0(h4,this,!0);let t=this.engine.setSheetContent(this.sheetId,e);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(t),h0(h4,this,!1)}function ul(e,t){var r,i;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n.includes((0,g.toUpperCaseFirst)(h5)))return;let o=(r=this.engine,i=this.hot.getSettings()[h5].sheetName,((0,d.isUndefined)(i)||!r.doesSheetExist(i))&&(i=r.addSheet(i)),i);if(h2(h6,this,ut).call(this,o),"updateSettings"!==n){if(h1(h7,this))this.switchSheet(this.sheetName);else{let e=h2(h6,this,ui).call(this);if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,e)){h0(h4,this,
45!0);let t=this.engine.setSheetContent(this.sheetId,e);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(t),h0(h4,this,!1)}}}}function uh(e,t,r,i){if("get"!==i||h1(h4,this)||null===this.sheetName||!this.engine.doesSheetExist(this.sheetName)||null===e||null===t)return;let n=this.getCellType(e,t);if("VALUE"===n||"EMPTY"===n){var o,s;r.value="string"==typeof(s=o=r.value)&&"'"===s.charAt(0)&&"="===s.charAt(1)?o.substr(1):o;return}let a={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId},l=this.engine.getCellValue(a),h=this.hot.getCellMeta(e,t,{skipMetaExtension:!0});"date"===h.type&&(0,eH.isNumeric)(l)&&(l=hT(l,h.dateFormat)),r.value="object"==typeof l&&null!==l?l.value:l}function uu(e,t,r,i){if("get"!==i||h1(h4,this)||null===this.sheetName||!this.engine.doesSheetExist(this.sheetName))return;let n=this.hot.toVisualRow(e),o=this.hot.propToCol(t);if(null===n||null===o)return;let s=this.getCellType(n,o);if("VALUE"===s||"EMPTY"===s)return;let a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(0===a.width&&0===a.height)return;let l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(n),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};r.value=this.engine.getCellSerialized(l)}function uc(e,t){if(h9(t))return;let r=[],i=[],n=this.engine.batch(()=>{e.forEach(e=>{let[t,n,,o]=e,s=this.hot.propToCol(n),a=this.hot.toPhysicalRow(t),l=this.hot.toPhysicalColumn(s),h={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};o=h2(h6,this,ur).call(this,a,l,o),null!==a&&null!==l?this.syncChangeWithEngine(t,s,o):r.push([t,s,o]),i.push({address:h})})});r.length&&this.hot.addHookOnce("afterChange",()=>{let e=this.engine.batch(()=>{r.forEach(e=>{let[t,r,i]=e;this.syncChangeWithEngine(t,r,i)})});this.renderDependentSheets(e,!0)}),this.renderDependentSheets(n),this.validateDependentCells(n,i)}function ud(e,t){if(h9(t))return;let r=[],i=[];e.forEach(e=>{let[t,n,,o]=e,s=this.hot.propToCol(n);if(!(0,eH.isNumeric)(s))return;let a={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(a)){(0,rE.ZK)(`Not possible to set source cell data at ${JSON.stringify(a)}`);return}i.push({address:a}),r.push(...this.engine.setCellContents(a,o))}),this.renderDependentSheets(r),this.validateDependentCells(r,i)}function ug(e,t){let r=this.rowAxisSyncer.getHfIndexFromVisualIndex(e);if(e>=this.hot.countRows()&&(r=e),null===this.sheetId||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[r,t]))return!1}function up(e,t){let r=this.columnAxisSyncer.getHfIndexFromVisualIndex(e);if(e>=this.hot.countCols()&&(r=e),null===this.sheetId||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[r,t]))return!1}function uf(e,t,r){return!1!==this.rowAxisSyncer.setRemovedHfIndexes(r).every(e=>this.engine.isItPossibleToRemoveRows(this.sheetId,[e,1]))&&void 0}function um(e,t,r){return!1!==this.columnAxisSyncer.setRemovedHfIndexes(r).every(e=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[e,1]))&&void 0}function uy(e,t,r){if(h9(r))return;let i=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(e),t]);this.renderDependentSheets(i)}function uv(e,t,r){if(h9(r))return;let i=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(e),t]);this.renderDependentSheets(i)}function uw(e,t,r,i){if(h9(i))return;let n=this.rowAxisSyncer.getRemovedHfIndexes().sort((e,t)=>t-e),o=this.engine.batch(()=>{n.forEach(e=>{this.engine.removeRows(this.sheetId,[e,1])})});this.renderDependentSheets(o)}function uE(e,t,r,i){if(h9(i))return;let n=this.columnAxisSyncer.getRemovedHfIndexes().sort((e,t)=>t-e),o=this.engine.batch(()=>{n.forEach(e=>{this.engine.removeColumns(this.sheetId,[e,1])})});this.renderDependentSheets(o)}function uS(e,t,r){var i;
45h0(h4,this,!0);let n=h2(h6,this,ui).call(this,r,0,r+((null===(i=t.__children)||void 0===i?void 0:i.length)||0),this.hot.countSourceCols());h0(h4,this,!1),n.forEach((e,t)=>{e.forEach((e,i)=>{this.engine.setCellContents({col:i,row:r+t,sheet:this.sheetId},[[e]])})})}function uC(e){this.hot.runHooks("afterFormulasValuesUpdate",e)}function uR(e,t){this.hot.runHooks("afterNamedExpressionAdded",e,t)}function ub(e,t){this.hot.runHooks("afterNamedExpressionRemoved",e,t)}function uT(e){this.hot.runHooks("afterSheetAdded",e)}function uN(e,t){h2(h6,this,ut).call(this,t),this.hot.runHooks("afterSheetRenamed",e,t)}function uA(e,t){this.hot.runHooks("afterSheetRemoved",e,t)}var uI=r(49559);function uM(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function uO(e,t){return e.get(u_(e,t))}function ux(e,t,r){return e.set(u_(e,t),r),r}function u_(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("beforeHideColumns"),eN.P.getSingleton().register("afterHideColumns"),eN.P.getSingleton().register("beforeUnhideColumns"),eN.P.getSingleton().register("afterUnhideColumns");let uP="hiddenColumns";var uL=new WeakMap,uk=new WeakSet;class uD extends tn.vq{constructor(){super(...arguments),uM(this,uk),uk.add(this),uM(this,uL),uL.set(this,null)}static get PLUGIN_KEY(){return uP}static get PLUGIN_PRIORITY(){return 310}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[uP]}enablePlugin(){var e=this;this.enabled||(ux(uL,this,new uI.o),uO(uL,this).addLocalHook("init",()=>u_(uk,this,uW).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,uO(uL,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return u_(uk,e,uU).call(e,...r)}),this.addHook("afterGetCellMeta",(e,t,r)=>u_(uk,this,uB).call(this,e,t,r)),this.addHook("modifyColWidth",(e,t)=>u_(uk,this,uH).call(this,e,t),2),this.addHook("afterGetColHeader",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return u_(uk,e,uV).call(e,...r)}),this.addHook("modifyCopyableRange",e=>u_(uk,this,uF).call(this,e)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){let t=this.getHiddenColumns(),r=this.isValidConfig(e),i=t,n=uO(uL,this).getValues().slice(),o=e.length>0;if(r&&o){let t=e.map(e=>this.hot.toPhysicalColumn(e));(0,c.arrayEach)(t,e=>{n[e]=!1}),i=(0,c.arrayReduce)(n,(e,t,r)=>(t&&e.push(this.hot.toVisualColumn(r)),e),[])}!1!==this.hot.runHooks("beforeUnhideColumns",t,i,r&&o)&&(r&&o&&uO(uL,this).setValues(n),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",t,i,r&&o,r&&i.length<t.length))}showColumn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.showColumns(t)}hideColumns(e){let t=this.getHiddenColumns(),r=this.isValidConfig(e),i=t;r&&(i=Array.from(new Set(t.concat(e)))),!1!==this.hot.runHooks("beforeHideColumns",t,i,r)&&(r&&this.hot.batchExecution(()=>{(0,c.arrayEach)(e,e=>{uO(uL,this).setValueAtIndex(this.hot.toPhysicalColumn(e),!0)})},!0),this.hot.runHooks("afterHideColumns",t,i,r,r&&i.length>t.length))}hideColumn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.hideColumns(t)}getHiddenColumns(){return(0,c.arrayMap)(uO(uL,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return uO(uL,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){let t=this.hot.countCols();return!!Array.isArray(e)&&e.length>0&&e.every(e=>Number.isInteger(e)&&e>=0&&e<t)}resetCellsMeta(){(0,c.arrayEach)(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){ux(uL,this,null),super.destroy()}}function uH(e,t){return this.isHidden(t)?0:this.getSetting("indicators")&&(this.isHidden(t+1)||this.isHidden(t-1))&&"number"==typeof e&&this.hot.hasColHeaders()?e+15:void 0}function uB(e,t,r){if(!1===this.getSetting("copyPasteEnabled")&&this.isHidden(t)&&(r.skipColumnOnPaste=!0),this.isHidden(t-1))r.className=r.className||"",-1===r.className.indexOf("afterHiddenColumn")&&(r.className+=" afterHiddenColumn");else if(r.className){let e=r.className.split(" ");if(e.length>0){let t=e.indexOf("afterHiddenColumn");t>-1&&e.splice(t,1),r.className=e.join(" ")}}}function uF(e){if(this.getSetting("copyPasteEnabled"))return e;let t=[],r=(e,r,i,n)=>{t.push({startRow:e,endRow:r,startCol:i,endCol:n})};return(0,c.arrayEach)(e,e=>{let t=!0,i=0;(0,eH.rangeEach)(e.startCol,e.endCol,n=>{this.isHidden(n)?(t||r(e.startRow,e.endRow,i,n-1),t=!0):(t&&(i=n),n===e.endCol&&r(e.startRow,e.endRow,i,n),t=!1)})}),t}function uV(e,t){if(!this.getSetting("indicators")||e<0)return;let r=[];e>=1&&this.isHidden(e-1)&&r.push("afterHiddenColumn"),e<this.hot.countCols()-1&&this.isHidden(e+1)&&r.push("beforeHiddenColumn"),(0,n.addClass)(t,r)}function uU(e){var t;e.items.push({name:i1},(t=this,{key:"hidden_columns_hide",name(){let e=this.getSelectedActive(),t=0;if(Array.isArray(e)){let[,r,,i]=e;r-i!=0&&(t=1)}return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_HIDE_COLUMN,t)},callback(){let{from:e,to:r}=this.getSelectedRangeActive(),i=Math.max(Math.min(e.col,r.col),0),n=Math.max(e.col,r.col),o=[];for(let e=i;e<=n;e+=1)o.push(e);t.hideColumns(o);let s=o[o.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.view.adjustElementsSize(),this.render()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}),function(e){let t=[];return{key:"hidden_columns_show",name(){let e=t.length>1?1:0;return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_SHOW_COLUMN,e)},callback(){var r,i;if(0===t.length)return;let n=t[0],o=t[t.length-1];n=null!==(r=this.columnIndexMapper.getNearestNotHiddenIndex(n-1,-1))&&void 0!==r?r:0,o=null!==(i=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))&&void 0!==i?i:this.countCols()-1,e.showColumns(t),this.view.adjustElementsSize(),this.render(),o-n+1!==this.countCols()&&this.selectColumns(n,o)},disabled:!1,hidden(){let r=(0,c.arrayMap)(e.getHiddenColumns(),e=>this.toPhysicalColumn(e));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;t.length=0;let i=this.getSelectedRangeActive(),n=i.getTopStartCorner().col,o=i.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(n),l=s.getRenderableFromVisualIndex(o),h=s.getNotTrimmedIndexes(),u=[];
45if(n!==o){if(o-n+1>l-a+1){let e=h.slice(n,o+1);u.push(...e.filter(e=>r.includes(e)))}}else if(0===a&&a<n)u.push(...h.slice(0,n));else if(null===a)u.push(...h.slice(0,this.countCols()));else{let e=this.countCols()-1;l===s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(e,-1))&&e>o&&u.push(...h.slice(o+1))}return(0,c.arrayEach)(u,e=>{t.push(this.toVisualColumn(e))}),0===t.length}}}(this))}function uW(){let e=this.getSetting("columns");Array.isArray(e)&&this.hideColumns(e)}function uj(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function uG(e,t){return e.get(uz(e,t))}function u$(e,t,r){return e.set(uz(e,t),r),r}function uz(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("beforeHideRows"),eN.P.getSingleton().register("afterHideRows"),eN.P.getSingleton().register("beforeUnhideRows"),eN.P.getSingleton().register("afterUnhideRows");let uY="hiddenRows";var uK=new WeakMap,uX=new WeakSet;class uq extends tn.vq{constructor(){super(...arguments),uj(this,uX),uX.add(this),uj(this,uK),uK.set(this,null)}static get PLUGIN_KEY(){return uY}static get PLUGIN_PRIORITY(){return 320}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[uY]}enablePlugin(){var e=this;this.enabled||(u$(uK,this,new uI.o),uG(uK,this).addLocalHook("init",()=>uz(uX,this,u2).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,uG(uK,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return uz(uX,e,u1).call(e,...r)}),this.addHook("afterGetCellMeta",(e,t,r)=>uz(uX,this,uQ).call(this,e,t,r)),this.addHook("modifyRowHeight",(e,t)=>uz(uX,this,uZ).call(this,e,t)),this.addHook("afterGetRowHeader",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return uz(uX,e,u0).call(e,...r)}),this.addHook("modifyCopyableRange",e=>uz(uX,this,uJ).call(this,e)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){let t=this.getHiddenRows(),r=this.isValidConfig(e),i=t,n=uG(uK,this).getValues().slice(),o=e.length>0;if(r&&o){let t=e.map(e=>this.hot.toPhysicalRow(e));(0,c.arrayEach)(t,e=>{n[e]=!1}),i=(0,c.arrayReduce)(n,(e,t,r)=>(t&&e.push(this.hot.toVisualRow(r)),e),[])}!1!==this.hot.runHooks("beforeUnhideRows",t,i,r&&o)&&(r&&o&&uG(uK,this).setValues(n),this.hot.runHooks("afterUnhideRows",t,i,r&&o,r&&i.length<t.length))}showRow(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.showRows(t)}hideRows(e){let t=this.getHiddenRows(),r=this.isValidConfig(e),i=t;r&&(i=Array.from(new Set(t.concat(e)))),!1!==this.hot.runHooks("beforeHideRows",t,i,r)&&(r&&this.hot.batchExecution(()=>{(0,c.arrayEach)(e,e=>{uG(uK,this).setValueAtIndex(this.hot.toPhysicalRow(e),!0)})},!0),this.hot.runHooks("afterHideRows",t,i,r,r&&i.length>t.length))}hideRow(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.hideRows(t)}getHiddenRows(){return(0,c.arrayMap)(uG(uK,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return uG(uK,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){let t=this.hot.countRows();return!!Array.isArray(e)&&e.length>0&&e.every(e=>Number.isInteger(e)&&e>=0&&e<t)}resetCellsMeta(){(0,c.arrayEach)(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){u$(uK,this,null),super.destroy()}}function uZ(e,t){return this.isHidden(t)?0:e}function uQ(e,t,r){if(!1===this.getSetting("copyPasteEnabled")&&this.isHidden(e)&&(r.skipRowOnPaste=!0),this.isHidden(e-1))r.className=r.className||"",-1===r.className.indexOf("afterHiddenRow")&&(r.className+=" afterHiddenRow");else if(r.className){let e=r.className.split(" ");if(e.length>0){let t=e.indexOf("afterHiddenRow");t>-1&&e.splice(t,1),r.className=e.join(" ")}}}function uJ(e){if(this.getSetting("copyPasteEnabled"))return e;let t=[],r=(e,r,i,n)=>{t.push({startRow:e,endRow:r,startCol:i,endCol:n})};return(0,c.arrayEach)(e,e=>{let t=!0,i=0;(0,eH.rangeEach)(e.startRow,e.endRow,n=>{this.isHidden(n)?(t||r(i,n-1,e.startCol,e.endCol),t=!0):(t&&(i=n),n===e.endRow&&r(i,n,e.startCol,e.endCol),t=!1)})}),t}function u0(e,t){if(!this.getSetting("indicators")||e<0)return;let r=[];e>=1&&this.isHidden(e-1)&&r.push("afterHiddenRow"),e<this.hot.countRows()-1&&this.isHidden(e+1)&&r.push("beforeHiddenRow"),(0,n.addClass)(t,r)}function u1(e){var t;e.items.push({name:i1},(t=this,{key:"hidden_rows_hide",name(){let e=this.getSelectedActive(),t=0;if(Array.isArray(e)){let[r,,i]=e;r-i!=0&&(t=1)}return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_HIDE_ROW,t)},callback(){let{from:e,to:r}=this.getSelectedRangeActive(),i=Math.max(Math.min(e.row,r.row),0),n=Math.max(e.row,r.row),o=[];for(let e=i;e<=n;e+=1)o.push(e);t.hideRows(o);let s=o[o.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.view.adjustElementsSize(),this.render()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}),function(e){let t=[];return{key:"hidden_rows_show",name(){let e=t.length>1?1:0;return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_SHOW_ROW,e)},callback(){var r,i;if(0===t.length)return;let n=t[0],o=t[t.length-1];n=null!==(r=this.rowIndexMapper.getNearestNotHiddenIndex(n-1,-1))&&void 0!==r?r:0,o=null!==(i=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))&&void 0!==i?i:this.countRows()-1,e.showRows(t),this.view.adjustElementsSize(),this.render(),o-n+1!==this.countRows()&&this.selectRows(n,o)},disabled:!1,hidden(){let r=(0,c.arrayMap)(e.getHiddenRows(),e=>this.toPhysicalRow(e));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;t.length=0;let i=this.getSelectedRangeActive(),n=i.getTopStartCorner().row,o=i.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(n),l=s.getRenderableFromVisualIndex(o),h=s.getNotTrimmedIndexes(),u=[];
45if(n!==o){if(o-n+1>l-a+1){let e=h.slice(n,o+1);u.push(...e.filter(e=>r.includes(e)))}}else if(0===a&&a<n)u.push(...h.slice(0,n));else if(null===a)u.push(...h.slice(0,this.countRows()));else{let e=this.countRows()-1;l===s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(e,-1))&&e>o&&u.push(...h.slice(o+1))}return(0,c.arrayEach)(u,e=>{t.push(this.toVisualRow(e))}),0===t.length}}}(this))}function u2(){let e=this.getSetting("rows");Array.isArray(e)&&this.hideRows(e)}function u5(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function u3(e,t){return e.get(u4(e,t))}function u9(e,t,r){return e.set(u4(e,t),r),r}function u4(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("beforeColumnFreeze"),eN.P.getSingleton().register("afterColumnFreeze"),eN.P.getSingleton().register("beforeColumnUnfreeze"),eN.P.getSingleton().register("afterColumnUnfreeze");let u7="manualColumnFreeze";var u8=new WeakMap,u6=new WeakSet;class ce extends tn.vq{constructor(){super(...arguments),u5(this,u6),u6.add(this),u5(this,u8),u8.set(this,!1)}static get PLUGIN_KEY(){return u7}static get PLUGIN_PRIORITY(){return 110}isEnabled(){return!!this.hot.getSettings()[u7]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>u4(u6,this,ct).call(this,e)),this.addHook("beforeColumnMove",(e,t)=>u4(u6,this,cr).call(this,e,t)),super.enablePlugin())}disablePlugin(){u9(u8,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){let t=this.hot.getSettings(),r=t.fixedColumnsStart<this.hot.countCols()&&e>t.fixedColumnsStart-1;u3(u8,this)||u9(u8,this,!0),!1!==this.hot.runHooks("beforeColumnFreeze",e,r)&&(r&&(this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart),t._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,r))}unfreezeColumn(e){let t=this.hot.getSettings(),r=t.fixedColumnsStart>0&&e<=t.fixedColumnsStart-1;u3(u8,this)||u9(u8,this,!0),!1!==this.hot.runHooks("beforeColumnUnfreeze",e,r)&&(r&&(t._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,r))}}function ct(e){var t,r;e.items.push({name:"---------"},(t=this,{key:"freeze_column",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_FREEZE_COLUMN)},callback(e,r){let[{start:{col:i}}]=r;t.freezeColumn(i),this.view.adjustElementsSize(),this.render()},hidden(){let e=this.getSelectedRange(),t=!1;return void 0===e?t=!0:e.length>1?t=!0:(e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(t=!0),t}}),(r=this,{key:"unfreeze_column",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN)},callback(e,t){let[{start:{col:i}}]=t;r.unfreezeColumn(i),this.view.adjustElementsSize(),this.render()},hidden(){let e=this.getSelectedRange(),t=!1;return void 0===e?t=!0:e.length>1?t=!0:(e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(t=!0),t}}))}function cr(e,t){if(u3(u8,this)){let r=this.hot.getSettings().fixedColumnsStart;if(t<r||e.some(e=>e<r))return!1}}function ci(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class cn{constructor(e){ci(this,"hot",void 0),ci(this,"_element",null),ci(this,"state",0),ci(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=2}build(){0===this.state&&(this._element=this.hot.rootDocument.createElement("div"),this.state=1)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=0}isAppended(){return 2===this.state}isBuilt(){return this.state>=1}setPosition(e,t){(0,eH.isNumeric)(e)&&(this._element.style.top=e+"px"),(0,eH.isNumeric)(t)&&(this._element.style[this.inlineProperty]=t+"px")}getPosition(){let 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,t){(0,eH.isNumeric)(e)&&(this._element.style.width=e+"px"),(0,eH.isNumeric)(t)&&(this._element.style.height=t+"px")}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,t){(0,eH.isNumeric)(e)&&(this._element.style.marginTop=e+"px"),(0,eH.isNumeric)(t)&&(this._element.style[`margin${(0,g.toUpperCaseFirst)(this.inl
45ineProperty)}`]=t+"px")}getOffset(){let e=this._element.style,t=`margin${(0,g.toUpperCaseFirst)(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[t]?parseInt(e[t],10):0}}}var co=cn;class cs extends co{build(){super.build(),(0,n.addClass)(this._element,"ht__manualColumnMove--backlight")}}class ca extends co{build(){super.build(),(0,n.addClass)(this._element,"ht__manualColumnMove--guideline")}}function cl(e,t,r){ch(e,t),t.set(e,r)}function ch(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function cu(e,t,r){return e.set(cd(e,t),r),r}function cc(e,t){return e.get(cd(e,t))}function cd(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("beforeColumnMove"),eN.P.getSingleton().register("afterColumnMove");let cg="manualColumnMove",cp="ht__manualColumnMove",cf="show-ui",cm="on-moving--columns",cy="after-selection--columns";var cv=new WeakMap,cw=new WeakMap,cE=new WeakMap,cS=new WeakMap,cC=new WeakMap,cR=new WeakMap,cb=new WeakMap,cT=new WeakMap,cN=new WeakMap,cA=new WeakMap,cI=new WeakMap,cM=new WeakSet;class cO extends tn.vq{constructor(){super(...arguments),ch(this,cM),cM.add(this),cl(this,cv,new cs(this.hot)),cl(this,cw,new ca(this.hot)),cl(this,cE,[]),cl(this,cS,0),cl(this,cC,!1),cl(this,cR,{}),cl(this,cb,void 0),cl(this,cT,void 0),cl(this,cN,void 0),cl(this,cA,void 0),cl(this,cI,void 0)}static get PLUGIN_KEY(){return cg}static get PLUGIN_PRIORITY(){return 120}isEnabled(){return!!this.hot.getSettings()[cg]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return cd(cM,e,cx).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return cd(cM,e,cP).call(e,...r)}),this.addHook("afterScrollVertically",()=>cd(cM,this,ck).call(this)),this.addHook("afterLoadData",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return cd(cM,e,cD).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),(0,n.addClass)(this.hot.rootElement,cp),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){(0,n.removeClass)(this.hot.rootElement,cp),this.unregisterEvents(),cc(cv,this).destroy(),cc(cw,this).destroy(),super.disablePlugin()}moveColumn(e,t){return this.moveColumns([e],t)}moveColumns(e,t){let r=cc(cb,this),i=this.isMovePossible(e,t),n=this.hot.runHooks("beforeColumnMove",e,t,r,i);if(cu(cb,this,void 0),!1===n)return;i&&this.hot.columnIndexMapper.moveIndexes(e,t);let o=i&&this.isColumnOrderChanged(e,t);return this.hot.runHooks("afterColumnMove",e,t,r,i,o),o}dragColumn(e,t){return this.dragColumns([e],t)}dragColumns(e,t){let r=this.countFinalIndex(e,t);return cu(cb,this,t),this.moveColumns(e,r)}isMovePossible(e,t){let r=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+t>r,n=e.some(e=>e<0),o=e.some(e=>e>=r);return!i&&!(t<0)&&!n&&!o}isColumnOrderChanged(e,t){return e.some((e,r)=>e-r!==t)}countFinalIndex(e,t){let r=(0,c.arrayReduce)(e,(e,r)=>(r<t&&(e+=1),e),0);return t-r}getColumnsWidth(e,t){let r=this.hot.columnIndexMapper,i=0;for(let n=e;n<=t;n+=1){let e=r.getRenderableFromVisualIndex(n);n<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:null!==e&&(i+=this.hot.view._wt.wtTable.getColumnWidth(e)||0)}return i}moveBySettingsOrLoad(){let e=this.hot.getSettings()[cg];if(Array.isArray(e))this.moveColumns(e,0);else if(void 0!==e){let e=this.persistentStateLoad();e.length&&this.moveColumns(e,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){let e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,t){let r=[];return(0,eH.rangeEach)(e,t,e=>{r.push(e)}),r}refreshPositions(){let e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(cc(cT,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});let t=this.hot.view._wt.wtTable,r=this.hot.view._wt.wtOverlays.scrollableElement,i="number"==typeof r.scrollX?r.scrollX:r.scrollLeft,o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,cc(cT,this)-1),s=t.hider.offsetWidth,a=t.TBODY.offsetLeft,l=cc(cv,this).getOffset().start,h=cc(cv,this).getSize().width,u=0,c=0;if(this.hot.isRtl()){let e=this.hot.rootWindow,t=(0,n.outerWidth)(this.hot.rootElement),o=e.innerWidth-cc(cN,this)-t;c=e.innerWidth-cc(cR,this).eventPageX-o-(void 0===r.scrollX?i:0)}else c=cc(cR,this).eventPageX-(cc(cN,this)-(void 0===r.scrollX?i:0));
45if(cc(cA,this)&&(u=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(cc(cT,this))&&(o+=i),o+=u,0>cc(cT,this))cc(cI,this)>0?cc(cR,this).col=0:cc(cR,this).col=e>0?e-1:e;else if(cc(cR,this).TD.offsetWidth/2+o<=c){let e=cc(cT,this)>=cc(cS,this)?cc(cS,this)-1:cc(cT,this);cc(cR,this).col=e+1,o+=cc(cR,this).TD.offsetWidth}else cc(cR,this).col=cc(cT,this);let d=c,g=o;c+h+l>=s?d=s-h-l:c+l<a+u&&(d=a+u+Math.abs(l)),o>=s-1?g=s-1:0===g?g=1:void 0!==r.scrollX&&cc(cT,this)<cc(cI,this)&&(g-=cc(cN,this)<=r.scrollX?cc(cN,this):0),cc(cv,this).setPosition(null,d),cc(cw,this).setPosition(null,g)}registerEvents(){let{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",e=>cd(cM,this,c_).call(this,e)),this.eventManager.addEventListener(e,"mouseup",()=>cd(cM,this,cL).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){cc(cv,this).build(),cc(cw,this).build()}destroy(){cc(cv,this).destroy(),cc(cw,this).destroy(),super.destroy()}}function cx(e,t,r,i){let s=this.hot.view._wt.wtTable,a=this.hot.selection.isSelectedByColumnHeader(),l=this.hot.getSelectedRangeActive(),h=(0,n.hasClass)(e.target,"sortAction");if(!l||!a||cc(cC,this)||0!==e.button||h){cu(cC,this,!1),cc(cE,this).length=0,(0,n.removeClass)(this.hot.rootElement,[cm,cf]);return}let u=cc(cw,this).isBuilt()&&!cc(cw,this).isAppended(),c=cc(cv,this).isBuilt()&&!cc(cv,this).isAppended();u&&c&&(cc(cw,this).appendTo(s.hider),cc(cv,this).appendTo(s.hider));let{from:d,to:g}=l,p=Math.min(d.col,g.col),f=Math.max(d.col,g.col);if(t.row<0&&t.col>=p&&t.col<=f){i.column=!0,cu(cC,this,!0);let a=r.firstChild?(0,o.offsetRelativeTo)(e,r.firstChild).x:e.offsetX;cc(cR,this).eventPageX=e.pageX,cu(cT,this,t.col),cc(cR,this).TD=r,cc(cR,this).col=t.col,cu(cE,this,this.prepareColumnsToMoving(p,f)),cu(cA,this,!!this.hot.getSettings().rowHeaders),cu(cS,this,this.hot.countCols()),cu(cI,this,this.hot.getSettings().fixedColumnsStart),cu(cN,this,(0,n.offset)(this.hot.rootElement).left);let l=cc(cA,this)?-1:0,h=s.holder.scrollTop+s.getColumnHeaderHeight(0)+1,u=t.col<cc(cI,this),c=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),d=Math.abs(a-(this.hot.isRtl()?r.offsetWidth:0)),g=this.getColumnsWidth(p,t.col-1)+d,m=this.getColumnsWidth(l,p-1)+(u?c:0)+g;cc(cv,this).setPosition(h,m),cc(cv,this).setSize(this.getColumnsWidth(p,f),s.hider.offsetHeight-h),cc(cv,this).setOffset(null,-g),(0,n.addClass)(this.hot.rootElement,cm)}else(0,n.removeClass)(this.hot.rootElement,cy),cu(cC,this,!1),cc(cE,this).length=0}function c_(e){cc(cC,this)&&(cc(cR,this).eventPageX=e.pageX,this.refreshPositions())}function cP(e,t,r,i){this.hot.getSelectedRangeActive()&&cc(cC,this)&&(cc(cE,this).indexOf(t.col)>-1?(0,n.removeClass)(this.hot.rootElement,cf):(0,n.addClass)(this.hot.rootElement,cf),i.row=!0,i.column=!0,i.cell=!0,cu(cT,this,t.col),cc(cR,this).TD=r)}function cL(){let e=cc(cR,this).col,t=cc(cE,this).length;if(cu(cT,this,void 0),cu(cC,this,!1),(0,n.removeClass)(this.hot.rootElement,[cm,cf,cy]),this.hot.selection.isSelectedByColumnHeader()&&(0,n.addClass)(this.hot.rootElement,cy),t<1||void 0===e)return;let r=cc(cE,this)[0],i=this.hot.toPhysicalColumn(r),o=this.dragColumns(cc(cE,this),e);if(cc(cE,this).length=0,!0===o){this.persistentStateSave(),this.hot.view.adjustElementsSize(),this.hot.render();let e=this.hot.toVisualColumn(i);this.hot.selectColumns(e,e+t-1)}}function ck(){let e=this.hot.view._wt.wtTable,t=e.getColumnHeaderHeight(0)+1+e.holder.scrollTop;cc(cv,this).setPosition(t),cc(cv,this).setSize(null,e.hider.offsetHeight-t)}function cD(){this.moveBySettingsOrLoad()}function cH(e,t,r){cB(e,t),t.set(e,r)}function cB(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function cF(e,t,r){return e.set(cU(e,t),r),r}function cV(e,t){return e.get(cU(e,t))}function cU(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let cW="manualColumnResize",cj="manualColumnWidths";
45var cG=new WeakMap,c$=new WeakMap,cz=new WeakMap,cY=new WeakMap,cK=new WeakMap,cX=new WeakMap,cq=new WeakMap,cZ=new WeakMap,cQ=new WeakMap,cJ=new WeakMap,c0=new WeakMap,c1=new WeakMap,c2=new WeakMap,c5=new WeakMap,c3=new WeakMap,c9=new WeakMap,c4=new WeakSet;class c7 extends tn.vq{static get PLUGIN_KEY(){return cW}static get PLUGIN_PRIORITY(){return 130}constructor(e){super(e),cB(this,c4),c4.add(this),cH(this,cG,null),cH(this,c$,null),cH(this,cz,[]),cH(this,cY,null),cH(this,cK,null),cH(this,cX,null),cH(this,cq,null),cH(this,cZ,null),cH(this,cQ,this.hot.rootDocument.createElement("DIV")),cH(this,cJ,this.hot.rootDocument.createElement("DIV")),cH(this,c0,null),cH(this,c1,!1),cH(this,c2,0),cH(this,c5,null),cH(this,c3,void 0),cH(this,c9,void 0),(0,n.addClass)(cV(cQ,this),"manualColumnResizer"),(0,n.addClass)(cV(cJ,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[cW]}enablePlugin(){var e=this;this.enabled||(cF(c3,this,new tu.L),cV(c3,this).addLocalHook("init",()=>cU(c4,this,c8).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,cV(c3,this)),this.addHook("modifyColWidth",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return cU(c4,e,dn).call(e,...r)},1),this.addHook("beforeStretchingColumnWidth",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return cU(c4,e,ds).call(e,...r)},1),this.addHook("beforeColumnResize",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return cU(c4,e,da).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){cF(c9,this,cV(c3,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",cj,cV(c3,this).getValues())}loadManualColumnWidths(){let e={};return this.hot.runHooks("persistentStateLoad",cj,e),e.value}setManualSize(e,t){let r=Math.max(t,20),i=this.hot.toPhysicalColumn(e);return cV(c3,this).setValueAtIndex(i,r),r}clearManualSize(e){let t=this.hot.toPhysicalColumn(e);cV(c3,this).setValueAtIndex(t,null)}setupHandlePosition(e){let t;if(!e.parentNode||cV(c2,this)>1)return;cF(cG,this,e);let{_wt:r}=this.hot.view,i=r.wtTable.getCoords(cV(cG,this)),o=i.col;if(o<0)return;let s=(0,n.outerHeight)(cV(cG,this)),a=cV(cG,this).getBoundingClientRect();o<r.getSetting("fixedColumnsStart")&&(t=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(cV(cG,this),i.row,i.col)),t||(t=r.wtOverlays.topOverlay.getRelativeCellPosition(cV(cG,this),i.row,i.col)),cF(c$,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(o)),cF(cz,this,[]);let l=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&l){let e=this.hot.getSelectedRange();(0,c.arrayEach)(e,e=>{let t=e.getTopStartCorner().col,r=e.getBottomEndCorner().col;(0,eH.rangeEach)(t,r,e=>{cV(cz,this).includes(e)||cV(cz,this).push(e)})})}cV(cz,this).includes(cV(c$,this))||cF(cz,this,[cV(c$,this)]),cF(cZ,this,t.start-6),cF(cq,this,parseInt(a.width,10)),cV(cQ,this).style.top=`${t.top}px`,cV(cQ,this).style[this.inlineDir]=`${cV(cZ,this)+cV(cq,this)}px`,cV(cQ,this).style.height=`${s}px`,this.hot.rootElement.appendChild(cV(cQ,this))}refreshHandlePosition(){cV(cQ,this).style[this.inlineDir]=`${cV(cZ,this)+cV(cY,this)}px`}setupGuidePosition(){let e=parseInt((0,n.outerHeight)(cV(cQ,this)),10),t=parseInt(cV(cQ,this).style.top,10)+e,r=this.hot.view.getTableHeight();(0,n.addClass)(cV(cQ,this),"active"),(0,n.addClass)(cV(cJ,this),"active"),cV(cJ,this).style.top=`${t}px`,this.refreshGuidePosition(),cV(cJ,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(cV(cJ,this))}refreshGuidePosition(){cV(cJ,this).style[this.inlineDir]=cV(cQ,this).style[this.inlineDir]}hideHandleAndGuide(){(0,n.removeClass)(cV(cQ,this),"active"),(0,n.removeClass)(cV(cJ,this),"active")}checkIfColumnHeader(e){let t=(0,n.closest)(e,["THEAD"],this.hot.rootElement),{topOverlay:r,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(t)}getClosestTHParent(e){return"TABLE"!==e.tagName?"TH"===e.tagName?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){let e=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},t=(t,r)=>{let i=this.hot.runHooks("beforeColumnResize",cV(cK,this),t,!0);void 0!==i&&cF(cK,this,i),this.setManualSize(t,cV(cK,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",cV(cK,this),t,!0),r&&e()};cV(c2,this)>=2&&(cV(cz,this).length>1?((0,c.arrayEach)(cV(cz,this),e=>{t(e)}),e()):(0,c.arrayEach)(cV(cz,this),e=>{t(e,!0)})),cF(c2,this,0),cF(c5,this,null)}bindEvents(){let{rootWindow:e,rootElement:t}=this.hot;this.eventManager.addEventListener(t,"mouseover",e=>cU(c4,this,c6).call(this,e)),this.eventManager.addEventListener(t,"mousedown",e=>cU(c4,this,de).call(this,e)),this.eventManager.addEventListener(e,"mousemove",e=>cU(c4,this,dt).call(this,e)),this.eventManager.addEventListener(e,"mouseup",()=>cU(c4,this,dr).call(this)),this.eventManager.addEventListener(cV(c
45Q,this),"contextmenu",()=>cU(c4,this,di).call(this))}destroy(){super.destroy()}}function c8(){let e=this.hot.getSettings()[cW],t=this.loadManualColumnWidths();void 0!==t?this.hot.batchExecution(()=>{t.forEach((e,t)=>{cV(c3,this).setValueAtIndex(t,e)})},!0):Array.isArray(e)?(this.hot.batchExecution(()=>{e.forEach((e,t)=>{cV(c3,this).setValueAtIndex(t,e)})},!0),cF(c9,this,e)):!0===e&&Array.isArray(cV(c9,this))&&this.hot.batchExecution(()=>{cV(c9,this).forEach((e,t)=>{cV(c3,this).setValueAtIndex(t,e)})},!0)}function c6(e){if(!(0,n.isDetached)(e.target)&&!0!==cV(c1,this)&&this.checkIfColumnHeader(e.target)){let t=this.getClosestTHParent(e.target);if(!t)return;let r=t.getAttribute("colspan");t&&(null===r||"1"===r)&&!cV(c0,this)&&this.setupHandlePosition(t)}}function de(e){e.target.parentNode===this.hot.rootElement&&(0,n.hasClass)(e.target,"manualColumnResizer")&&(this.setupHandlePosition(cV(cG,this)),this.setupGuidePosition(),cF(c0,this,!0),null===cV(c5,this)&&(cF(c5,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(cV(c5,this))),cF(c2,this,cV(c2,this)+1),this.startX=e.pageX,cF(cK,this,cV(cq,this)))}function dt(e){if(cV(c0,this)){let t=(e.pageX-this.startX)*this.hot.getDirectionFactor();cF(cY,this,cV(cq,this)+t),(0,c.arrayEach)(cV(cz,this),e=>{cF(cK,this,this.setManualSize(e,cV(cY,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function dr(){let e=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},t=(t,r)=>{this.hot.runHooks("beforeColumnResize",cV(cK,this),t,!1),r&&e(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",cV(cK,this),t,!1)};cV(c0,this)&&(this.hideHandleAndGuide(),cF(c0,this,!1),cV(cK,this)!==cV(cq,this)&&(cV(cz,this).length>1?((0,c.arrayEach)(cV(cz,this),e=>{t(e)}),e()):(0,c.arrayEach)(cV(cz,this),e=>{t(e,!0)})),this.setupHandlePosition(cV(cG,this)))}function di(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(cV(cQ,this)),this.hot.rootElement.removeChild(cV(cJ,this)),cF(c0,this,!1),cF(c1,this,!0),this.hot._registerImmediate(()=>{cF(c1,this,!1)})}function dn(e,t){let r=e;if(this.enabled){let e=this.hot.toPhysicalColumn(t),i=cV(c3,this).getValueAtIndex(e);this.hot.getSettings()[cW]&&i&&(r=i)}return r}function ds(e,t){let r=cV(c3,this).getValueAtIndex(this.hot.toPhysicalColumn(t));return"number"==typeof r?r:e}function da(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function dl(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class dh{constructor(e){dl(this,"hot",void 0),dl(this,"_element",null),dl(this,"state",0),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=2}build(){0===this.state&&(this._element=this.hot.rootDocument.createElement("div"),this.state=1)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=0}isAppended(){return 2===this.state}isBuilt(){return this.state>=1}setPosition(e,t){void 0!==e&&(this._element.style.top=e+"px"),void 0!==t&&(this._element.style.left=t+"px")}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,t){e&&(this._element.style.width=e+"px"),t&&(this._element.style.height=t+"px")}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,t){e&&(this._element.style.marginTop=e+"px"),t&&(this._element.style.marginLeft=t+"px")}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}}}var du=dh;class dc extends du{build(){super.build(),(0,n.addClass)(this._element,"ht__manualRowMove--backlight")}}class dd extends du{build(){super.build(),(0,n.addClass)(this._element,"ht__manualRowMove--guideline")}}function dg(e,t,r){dp(e,t),t.set(e,r)}function dp(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function df(e,t,r){return e.set(dy(e,t),r),r}function dm(e,t){return e.get(dy(e,t))}function dy(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("beforeRowMove"),eN.P.getSingleton().register("afterRowMove");let dv="manualRowMove",dw="ht__manualRowMove",dE="show-ui",dS="on-moving--rows",dC="after-selection--rows";var dR=new WeakMap,db=new WeakMap,dT=new WeakMap,dN=new WeakMap,dA=new WeakMap,dI=new WeakMap,dM=new WeakSet;class dO extends tn.vq{constructor(){super(...arguments),dp(this,dM),dM.add(this),dg(this,dR,new dc(this.hot)),dg(this,db,new dd(this.hot)),dg(this,dT,[]),dg(this,dN,void 0),dg(this,dA,{}),dg(this,dI,void 0)}static get PLUGIN_KEY(){return dv}static get PLUGIN_PRIORITY(){return 140}isEnabled(){return!!this.hot.getSettings()[dv]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return dy(dM,e,dx).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return dy(dM,e,dP).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>dy(dM,this,dk).call(this)),this.addHook("afterLoadData",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return dy(dM,e,dD).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),(0,n.addClass)(this.hot.rootElement,dw),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){(0,n.removeClass)(this.hot.rootElement,dw),this.unregisterEvents(),dm(dR,this).destroy(),dm(db,this).destroy(),super.disablePlugin()}moveRow(e,t){return this.moveRows([e],t)}moveRows(e,t){let r=dm(dI,this),i=this.isMovePossible(e,t),n=this.hot.runHooks("beforeRowMove",e,t,r,i);if(df(dI,this,void 0),!1===n)return;i&&this.hot.rowIndexMapper.moveIndexes(e,t);let o=i&&this.isRowOrderChanged(e,t);return this.hot.runHooks("afterRowMove",e,t,r,i,o),o}
45dragRow(e,t){return this.dragRows([e],t)}dragRows(e,t){let r=this.countFinalIndex(e,t);return df(dI,this,t),this.moveRows(e,r)}isMovePossible(e,t){let r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+t>r,n=e.some(e=>e<0),o=e.some(e=>e>=r);return!i&&!(t<0)&&!n&&!o}isRowOrderChanged(e,t){return e.some((e,r)=>e-r!==t)}countFinalIndex(e,t){let r=(0,c.arrayReduce)(e,(e,r)=>(r<t&&(e+=1),e),0);return t-r}getRowsHeight(e,t){let r=this.hot.rowIndexMapper,i=0;for(let n=e;n<=t;n++){let e=r.getRenderableFromVisualIndex(n);null!==e&&(i+=this.hot.view._wt.wtTable.getRowHeight(e)||this.hot.stylesHandler.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){let e=this.hot.getSettings()[dv];if(Array.isArray(e))this.moveRows(e,0);else if(void 0!==e){let e=this.persistentStateLoad();e.length&&this.moveRows(e,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(){let e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){let e=this.hot.getSelectedRangeActive(),t=[];if(!e)return t;let{from:r,to:i}=e,n=Math.min(r.row,i.row),o=Math.max(r.row,i.row);return(0,eH.rangeEach)(n,o,e=>{t.push(e)}),t}refreshPositions(){let e=dm(dA,this).coords,t=this.hot.getFirstFullyVisibleRow(),r=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&t>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(t-1,-1)),this.isFixedRowBottom(e.row)&&r<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r+1,1),void 0,!0);let o=this.hot.view._wt.wtTable,s=dm(dA,this).TD,a=this.hot.rootElement,l=(0,n.offset)(a),h=(0,n.getTrimmingContainer)(a),u=o.holder.scrollTop,c=this.hot.rootWindow!==h?h.scrollTop:0,d=l.top-c,g=dm(dA,this).eventPageY-d+u,p=o.hider.offsetHeight,f=o.TBODY.offsetTop,m=dm(dR,this).getOffset().top,y=dm(dR,this).getSize().height,w=s.offsetHeight/2,E=s.offsetHeight,S=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1),C=g>=S+w;this.isFixedRowTop(e.row)&&(S+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?dm(dA,this).row=t>0?t-1:t:C?(dm(dA,this).row=e.row+1,S+=0===e.row?E-1:E):dm(dA,this).row=e.row;let R=g,b=S;g+y+m>=p?R=p-y-m:g+m<f&&(R=f+Math.abs(m)),S>=p-1&&(b=p-1),dm(dR,this).setPosition(R),dm(db,this).setPosition(b)}registerEvents(){let{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",e=>dy(dM,this,d_).call(this,e)),this.eventManager.addEventListener(e,"mouseup",()=>dy(dM,this,dL).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){dm(dR,this).build(),dm(db,this).build()}destroy(){dm(dR,this).destroy(),dm(db,this).destroy(),super.destroy()}}function dx(e,t,r,i){let{wtTable:o,wtViewport:s}=this.hot.view._wt,a=this.hot.selection.isSelectedByRowHeader(),l=this.hot.getSelectedRangeActive();if(!l||!a||dm(dN,this)||0!==e.button){df(dN,this,!1),dm(dT,this).length=0,(0,n.removeClass)(this.hot.rootElement,[dS,dE]);return}let h=dm(db,this).isBuilt()&&!dm(db,this).isAppended(),u=dm(dR,this).isBuilt()&&!dm(dR,this).isAppended();h&&u&&(dm(db,this).appendTo(o.hider),dm(dR,this).appendTo(o.hider));let{from:c,to:d}=l,g=Math.min(c.row,d.row),p=Math.max(c.row,d.row);if(t.col<0&&t.row>=g&&t.row<=p){i.row=!0,df(dN,this,!0),dm(dA,this).eventPageY=e.pageY,dm(dA,this).coords=t,dm(dA,this).TD=r,df(dT,this,this.prepareRowsToMoving());let a=o.holder.scrollLeft+s.getRowHeaderWidth(),l=this.getRowsHeight(g,t.row-1)+(e.clientY-r.getBoundingClientRect().top);dm(dR,this).setPosition(null,a),dm(dR,this).setSize(o.hider.offsetWidth-a,this.getRowsHeight(g,p)),dm(dR,this).setOffset(-l,null),(0,n.addClass)(this.hot.rootElement,dS),this.refreshPositions()}else(0,n.removeClass)(this.hot.rootElement,dC),df(dN,this,!1),dm(dT,this).length=0}function d_(e){dm(dN,this)&&(dm(dA,this).eventPageY=e.pageY,this.refreshPositions())}
45function dP(e,t,r,i){this.hot.getSelectedRangeActive()&&dm(dN,this)&&(dm(dT,this).indexOf(t.row)>-1?(0,n.removeClass)(this.hot.rootElement,dE):(0,n.addClass)(this.hot.rootElement,dE),i.row=!0,i.column=!0,i.cell=!0,dm(dA,this).coords=t,dm(dA,this).TD=r)}function dL(){let e=dm(dA,this).row,t=dm(dT,this).length;if(df(dN,this,!1),(0,n.removeClass)(this.hot.rootElement,[dS,dE,dC]),this.hot.selection.isSelectedByRowHeader()&&(0,n.addClass)(this.hot.rootElement,dC),t<1||void 0===e)return;let r=dm(dT,this)[0],i=this.hot.toPhysicalRow(r),o=this.dragRows(dm(dT,this),e);if(dm(dT,this).length=0,!0===o){this.persistentStateSave(),this.hot.view.adjustElementsSize(),this.hot.render();let e=this.hot.toVisualRow(i);this.hot.selectRows(e,e+t-1)}}function dk(){let e=this.hot.view._wt.wtTable,t=this.hot.view._wt.wtViewport.getRowHeaderWidth()+e.holder.scrollLeft;dm(dR,this).setPosition(null,t),dm(dR,this).setSize(e.hider.offsetWidth-t)}function dD(){this.moveBySettingsOrLoad()}function dH(e,t,r){dB(e,t),t.set(e,r)}function dB(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function dF(e,t,r){return e.set(dU(e,t),r),r}function dV(e,t){return e.get(dU(e,t))}function dU(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let dW="manualRowResize",dj="manualRowHeights";var dG=new WeakMap,d$=new WeakMap,dz=new WeakMap,dY=new WeakMap,dK=new WeakMap,dX=new WeakMap,dq=new WeakMap,dZ=new WeakMap,dQ=new WeakMap,dJ=new WeakMap,d0=new WeakMap,d1=new WeakMap,d2=new WeakMap,d5=new WeakMap,d3=new WeakMap,d9=new WeakMap,d4=new WeakSet;class d7 extends tn.vq{static get PLUGIN_KEY(){return dW}static get PLUGIN_PRIORITY(){return 30}constructor(e){super(e),dB(this,d4),d4.add(this),dH(this,dG,null),dH(this,d$,null),dH(this,dz,[]),dH(this,dY,null),dH(this,dK,null),dH(this,dX,null),dH(this,dq,null),dH(this,dZ,null),dH(this,dQ,this.hot.rootDocument.createElement("DIV")),dH(this,dJ,this.hot.rootDocument.createElement("DIV")),dH(this,d0,!1),dH(this,d1,!1),dH(this,d2,0),dH(this,d5,null),dH(this,d3,void 0),dH(this,d9,void 0),(0,n.addClass)(dV(dQ,this),"manualRowResizer"),(0,n.addClass)(dV(dJ,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[dW]}
45enablePlugin(){this.enabled||(dF(d3,this,new tu.L),dV(d3,this).addLocalHook("init",()=>dU(d4,this,gn).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,dV(d3,this)),this.addHook("modifyRowHeight",(e,t)=>dU(d4,this,gi).call(this,e,t)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){dF(d9,this,dV(d3,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",dj,dV(d3,this).getValues())}loadManualRowHeights(){let e={};return this.hot.runHooks("persistentStateLoad",dj,e),e.value}setManualSize(e,t){let r=this.hot.toPhysicalRow(e),i=Math.max(t,this.hot.stylesHandler.getDefaultRowHeight());return dV(d3,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return dV(dY,this)}setupHandlePosition(e){let t;if(dV(d2,this)>1)return;dF(dG,this,e);let{view:r}=this.hot,{_wt:i}=r,o=i.wtTable.getCoords(dV(dG,this)),s=o.row;if(s<0)return;let a=(0,n.outerWidth)(dV(dG,this)),l=dV(dG,this).getBoundingClientRect(),h=s<i.getSetting("fixedRowsTop"),u=s>=r.countNotHiddenRowIndexes(0,1)-i.getSetting("fixedRowsBottom");h?t=i.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(dV(dG,this),o.row,o.col):u&&(t=i.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(dV(dG,this),o.row,o.col)),t||(t=i.wtOverlays.inlineStartOverlay.getRelativeCellPosition(dV(dG,this),o.row,o.col)),dF(d$,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(s)),dF(dz,this,[]);let d=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&d){let e=this.hot.getSelectedRange();(0,c.arrayEach)(e,e=>{let t=e.getTopStartCorner().row,r=e.getBottomStartCorner().row;(0,eH.rangeEach)(t,r,e=>{dV(dz,this).includes(e)||dV(dz,this).push(e)})})}dV(dz,this).includes(dV(d$,this))||dF(dz,this,[dV(d$,this)]),dF(dZ,this,t.top-6),dF(dq,this,parseInt(l.height,10)),dV(dQ,this).style.top=`${dV(dZ,this)+dV(dq,this)}px`,dV(dQ,this).style[this.inlineDir]=`${t.start}px`,dV(dQ,this).style.width=`${a}px`,this.hot.rootElement.appendChild(dV(dQ,this))}refreshHandlePosition(){dV(dQ,this).style.top=`${dV(dZ,this)+dV(dY,this)}px`}setupGuidePosition(){let e=parseInt((0,n.outerWidth)(dV(dQ,this)),10),t=parseInt(dV(dQ,this).style[this.inlineDir],10)+e,r=this.hot.view.getTableWidth();(0,n.addClass)(dV(dQ,this),"active"),(0,n.addClass)(dV(dJ,this),"active"),dV(dJ,this).style.top=dV(dQ,this).style.top,dV(dJ,this).style[this.inlineDir]=`${t}px`,dV(dJ,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(dV(dJ,this))}refreshGuidePosition(){dV(dJ,this).style.top=dV(dQ,this).style.top}hideHandleAndGuide(){(0,n.removeClass)(dV(dQ,this),"active"),(0,n.removeClass)(dV(dJ,this),"active")}checkIfRowHeader(e){let t=(0,n.closest)(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:r,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.TBODY,i.clone.wtTable.TBODY,o.clone.wtTable.TBODY].includes(t)}getClosestTHParent(e){return"TABLE"!==e.tagName?"TH"===e.tagName?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){let t=this.hot.view._wt.wtTable.getRowHeight(e);return void 0!==t&&dV(dK,this)<t?t:dV(dK,this)}afterMouseDownTimeout(){let e=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},t=(t,r)=>{let i=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!0);void 0!==i&&dF(dK,this,i),this.setManualSize(t,dV(dK,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!0),r&&e()};dV(d2,this)>=2&&(dV(dz,this).length>1?((0,c.arrayEach)(dV(dz,this),e=>{t(e)}),e()):(0,c.arrayEach)(dV(dz,this),e=>{t(e,!0)})),dF(d2,this,0),dF(d5,this,null)}bindEvents(){let{rootElement:e,rootWindow:t}=this.hot;this.eventManager.addEventListener(e,"mouseover",e=>dU(d4,this,d8).call(this,e)),this.eventManager.addEventListener(e,"mousedown",e=>dU(d4,this,d6).call(this,e)),this.eventManager.addEventListener(t,"mousemove",e=>dU(d4,this,ge).call(this,e)),this.eventManager.addEventListener(t,"mouseup",()=>dU(d4,this,gt).call(this)),this.eventManager.addEventListener(dV(dQ,this),"contextmenu",()=>dU(d4,this,gr).call(this))}destroy(){super.destroy()}}function d8(e){if(!(0,n.isDetached)(e.target)&&!0!==dV(d1,this)&&this.checkIfRowHeader(e.target)){let t=this.getClosestTHParent(e.target);t&&!dV(d0,this)&&this.setupHandlePosition(t)}}function d6(e){(0,n.hasClass)(e.target,"manualRowResizer")&&(this.setupHandlePosition(dV(dG,this)),this.setupGuidePosition(),dF(d0,this,!0),null===dV(d5,this)&&(dF(d5,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(dV(d5,this))),dF(d2,this,dV(d2,this)+1),dF(dX,this,e.pageY),dF(dK,this,dV(dq,this)))}function ge(e){dV(d0,this)&&(dF(dY,this,dV(dq,this)+(e.pageY-dV(dX,this))),(0,c.arrayEach)(dV(dz,this),e=>{dF(dK,this,this.setManualSize(e,dV(dY,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function gt(){let e=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},t=(t,r)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!1),r&&e(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!1)};dV(d0,this)&&(this.hideHandleAndGuide(),dF(d0,this,!1),dV(dK,this)!==dV(dq,this)&&(dV(dz,this).length>1?((0,c.arrayEach)(dV(dz,this),e=>{t(e)}),e()):(0,c.arrayEach)(dV(dz,this),e=>{t(e,!0)})),this.setupHandlePosition(dV(dG,this)))}function gr(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(dV(dQ,this)),this.hot.rootElement.removeChild(dV(dJ,this)),dF(d0,this,!1),dF(d1,this,!0),this.hot._registerImmediate(()=>{dF(d1,this,!1)})}function gi(e,t){let r=e;if(this.enabled){let e=this.hot.toPhysicalRow(t),n=dV(d3,this).getValueAtIndex(e);if(this.hot.getSettings()[dW]&&n){var i;r=null!==(i=this.hot.getPlugin("autoRowSize"))&&void 0!==i&&i.isEnabled()?Math.max(n,null!=r?r:0):n}}return r}function gn(){let e=this.hot.getSettings()[dW],t=this.loadManualRowHeights();this.hot.batchExecution(()=>{void 0!==t?t.forEach((e,t)=>{dV(d3,this).setValueAtIndex(t,e)}):Array.isArray(e)?(e.forEach((e,t)=>{dV(d3,this).setValueAtIndex(t,e)}),dF(d9,this,e)):!0===e&&Array.isArray(dV(d9,this))&&dV(d9,this).forEac
45h((e,t)=>{dV(d3,this).setValueAtIndex(t,e)})},!0)}function go(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gs(e,t,r){return e.set(ga(e,t),r),r}function ga(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}r(20994),r(34950);var gl=new WeakMap;class gh{constructor(e,t,r,i,n,o){go(this,"row",void 0),go(this,"col",void 0),go(this,"rowspan",void 0),go(this,"colspan",void 0),go(this,"removed",!1),go(this,"cellCoordsFactory",void 0),go(this,"cellRangeFactory",void 0),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,gl),gl.set(this,null),this.row=e,this.col=t,this.rowspan=r,this.colspan=i,this.cellCoordsFactory=n,this.cellRangeFactory=o}static NEGATIVE_VALUES_WARNING(e){let{row:t,col:r,rowspan:i,colspan:n}=e;return(0,rJ.e)`The merged cell declared with {row: ${t}, col: ${r},\x20
46      rowspan: ${i}, colspan: ${n}} contains negative values, which is\x20
47      not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:t,col:r}=e;return(0,rJ.e)`The merged cell declared at [${t}, ${r}] is positioned\x20
48      (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:t,col:r}=e;return(0,rJ.e)`The merged cell declared at [${t}, ${r}] has both "rowspan"\x20
49      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:t,col:r}=e;return(0,rJ.e)`The merged cell declared at [${t}, ${r}] has "rowspan"\x20
50      or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:t,col:r,rowspan:i,colspan:n}=e;return t<0||r<0||i<0||n<0}static isSingleCell(e){let{rowspan:t,colspan:r}=e;return 1===r&&1===t}static containsZeroSpan(e){let{rowspan:t,colspan:r}=e;return 0===r||0===t}static isOutOfBounds(e,t,r){return e.row<0||e.col<0||e.row>=t||e.row+e.rowspan-1>=t||e.col>=r||e.col+e.colspan-1>=r}normalize(e){let t=e.countRows(),r=e.countCols();this.row<0?this.row=0:this.row>t-1&&(this.row=t-1),this.col<0?this.col=0:this.col>r-1&&(this.col=r-1),this.row+this.rowspan>t-1&&(this.rowspan=t-this.row),this.col+this.colspan>r-1&&(this.colspan=r-this.col),gs(gl,this,null)}includes(e,t){return this.row<=e&&this.col<=t&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=t}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,t){let r=e[0]||e[1],i=t+Math.abs(e[0]||e[1])-1,n=e[0]?"colspan":"rowspan",o=e[0]?"col":"row",s=Math.min(t,i),a=Math.max(t,i),l=this[o],h=this[o]+this[n]-1;if(l>=t&&(this[o]+=r),r>0)t<=h&&t>l&&(this[n]+=r);else if(r<0){if(s<=l&&a>=h)return this.removed=!0,gs(gl,this,null),!1;if(l>=s&&l<=a){let e=a-l+1;this[o]-=Math.abs(r)-e+r,this[n]-=e}else l<=s&&h>=a?this[n]+=r:l<=s&&h>=s&&h<a&&(this[n]-=h-s+1)}return gs(gl,this,null),!0}isFarther(e,t){return!e||("down"===t?e.row+e.rowspan-1<this.row+this.rowspan-1:"up"===t?e.row>this.row:"right"===t?e.col+e.colspan-1<this.col+this.colspan-1:"left"===t?e.col>this.col:null)}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return gl.get(ga(gl,this))||gs(gl,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),gl.get(ga(gl,this))}}function gu(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gc(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var gd=new WeakSet;class gg{constructor(e){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}
50)(this,gd),gd.add(this),gu(this,"plugin",void 0),gu(this,"mergedCells",[]),gu(this,"mergedCellsMatrix",new Map),gu(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:t,col:r}=e;return(0,rJ.e)`The merged cell declared at [${t}, ${r}], overlaps\x20
51      with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
52      fix your setup.`}get(e,t){var r;return!!this.mergedCellsMatrix.has(e)&&null!==(r=this.mergedCellsMatrix.get(e).get(t))&&void 0!==r&&r}getByRange(e){let{row:t,col:r}=e.getTopStartCorner(),{row:i,col:n}=e.getBottomEndCorner(),o=this.mergedCells.length,s=!1;for(let e=0;e<o;e++){let o=this.mergedCells[e],{row:a,col:l,rowspan:h,colspan:u}=o;if(a>=t&&a+h-1<=i&&l>=r&&l+u-1<=n){s=o;break}}return s}filterOverlappingMergeCells(e){let t=new Set;return this.mergedCells.forEach(e=>{let{row:r,col:i,colspan:n,rowspan:o}=e;for(let e=r;e<r+o;e++)for(let r=i;r<i+n;r++)t.add(`r${e},c${r}`)}),e.filter(e=>{let{row:r,col:i,colspan:n,rowspan:o}=e,s=new Set,a=!1;for(let l=r;l<r+o;l++){for(let r=i;r<i+n;r++){let i=`r${l},c${r}`;if(t.has(i)){(0,rE.ZK)(gg.IS_OVERLAPPING_WARNING(e)),a=!0;break}s.add(i)}if(a)break}return a||t.add(...s),!a})}getWithinRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{row:r,col:i}=e.getTopStartCorner(),{row:n,col:o}=e.getBottomEndCorner(),s=[];for(let e=r;e<=n;e++)for(let r=i;r<=o;r++){let i=this.get(e,r);i&&(t||!t&&i.row===e&&i.col===r)&&s.push(i)}return s}add(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.row,i=e.col,n=new gh(r,i,e.rowspan,e.colspan,this.hot._createCellCoords,this.hot._createCellRange),o=this.get(r,i),s=!t&&this.isOverlapping(n);return o||s?(s&&(0,rE.ZK)(gg.IS_OVERLAPPING_WARNING(n)),!1):(this.hot&&n.normalize(this.hot),this.mergedCells.push(n),gc(gd,this,gf).call(this,n),n)}remove(e,t){let r=this.get(e,t),i=r?this.mergedCells.indexOf(r):-1;return!!r&&-1!==i&&(this.mergedCells.splice(i,1),gc(gd,this,gm).call(this,r),r)}clear(){(0,c.arrayEach)(this.mergedCells,e=>{let{row:t,col:r,rowspan:i,colspan:n}=e;(0,eH.rangeEach)(t,t+i,e=>{(0,eH.rangeEach)(r,r+n,t=>{let r=this.hot.getCell(e,t);r&&(r.removeAttribute("rowspan"),r.removeAttribute("colspan"),r.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){let t=e.getRange();for(let e=0;e<this.mergedCells.length;e++)if(this.mergedCells[e].getRange().overlaps(t))return!0;return!1}isFirstRenderableMergedCell(e,t){let r=this.get(e,t);if(!r)return!1;let{row:i,col:n,rowspan:o,colspan:s}=r,a=this.hot.view.getActiveOverlayName(),l=["top","top_inline_start_corner"].includes(a)?0:this.hot.getFirstRenderedVisibleRow(),h=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(a)?0:this.hot.getFirstRenderedVisibleColumn(),u=(0,eH.clamp)(l,i,i+o-1),c=(0,eH.clamp)(h,n,n+s-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(u,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(c,1)===t}getFirstRenderableCoords(e,t){let r=this.get(e,t);if(!r||this.isFirstRenderableMergedCell(e,t))return this.hot._createCellCoords(e,t);let i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(r.row,1),n=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r.col,1);return this.hot._createCellCoords(i,n)}getStartMostColumnIndex(e,t){let r=gc(gd,this,gp).call(this,e,"col",-1),i=t;for(let e=0;e<r.length;e++)if(r[e]<=t){i=r[e];break}return i}getEndMostColumnIndex(e,t){let r=gc(gd,this,gp).call(this,e,"col",1),i=t;for(let e=0;e<r.length;e++)if(r[e]>=t){i=r[e];break}return i}getTopMostRowIndex(e,t){let r=gc(gd,this,gp).call(this,e,"row",-1),i=t;for(let e=0;e<r.length;e++)if(r[e]<=t){i=r[e];break}return i}getBottomMostRowIndex(e,t){let r=gc(gd,this,gp).call(this,e,"row",1),i=t;for(let e=0;e<r.length;e++)if(r[e]>=t){i=r[e];break}return i}shiftCollections(e,t,r){let i=[0,0];switch(e){case"right":i[0]+=r;break;case"left":i[0]-=r;break;case"down":i[1]+=r;break;case"up":i[1]-=r}let n=[];this.mergedCells.forEach(e=>{e.shift(i,t),e.removed&&n.push(e)}),n.forEach(e=>{this.mergedCells.splice(this.mergedCells.indexOf(e),1)}
52),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(e=>{gc(gd,this,gf).call(this,e)})}}function gp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=new Map,n=1===r?e.getTopStartCorner():e.getBottomEndCorner(),o=1===r?e.getBottomEndCorner():e.getTopStartCorner();for(let e=n.row;1===r?e<=o.row:e>=o.row;e+=r)for(let s=n.col;1===r?s<=o.col:s>=o.col;s+=r){let n="row"===t?e:s,o=this.get(e,s),a=n;o&&(a=1===r?o[t]+o[`${t}span`]-1:o[t]),i.has(n)||i.set(n,new Set),i.get(n).add(a)}return Array.from(new Set(Array.from(i.entries()).filter(e=>{let[,t]=e;return 1===t.size}).flatMap(e=>{let[,t]=e;return Array.from(t)})))}function gf(e){for(let t=e.row;t<e.row+e.rowspan;t++)for(let r=e.col;r<e.col+e.colspan;r++)this.mergedCellsMatrix.has(t)||this.mergedCellsMatrix.set(t,new Map),this.mergedCellsMatrix.get(t).set(r,e)}function gm(e){for(let t=e.row;t<e.row+e.rowspan;t++)for(let r=e.col;r<e.col+e.colspan;r++)this.mergedCellsMatrix.get(t).delete(r)}function gy(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class gv{constructor(e){gy(this,"plugin",void 0),gy(this,"mergedCellsCollection",void 0),gy(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,t){return t[0]===e[0]&&t[1]===e[1]&&t[3]===e[3]?"down":t[2]===e[2]&&t[1]===e[1]&&t[3]===e[3]?"up":t[1]===e[1]&&t[2]===e[2]?"right":"left"}snapDragArea(e,t,r,i){let n=t.slice(0),o=this.getAutofillSize(e,t,r),[s,a,l,h]=e,u=["up","down"].indexOf(r)>-1?l-s+1:h-a+1,c=Math.floor(o/u)*u,d=o-c,g=this.getFarthestCollection(e,t,r,i);if(g){if("down"===r){let e=g.row+g.rowspan-s-d;n[2]+e>=this.plugin.hot.countRows()?n[2]-=d:n[2]+=d?e:0}else if("right"===r){let e=g.col+g.colspan-a-d;n[3]+e>=this.plugin.hot.countCols()?n[3]-=d:n[3]+=d?e:0}else if("up"===r){let e=l-d-g.row+1;n[0]+e<0?n[0]+=d:n[0]-=d?e:0}else if("left"===r){let e=h-d-g.col+1;n[1]+e<0?n[1]+=d:n[1]-=d?e:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:o,dragArea:n,cycleLength:u}),n}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),(0,s.extend)(this.currentFillData,e)}getAutofillSize(e,t,r){let[i,n,o,s]=e,[a,l,h,u]=t;switch(r){case"up":return i-a;case"down":return h-o;case"left":return n-l;case"right":return u-s;default:return null}}getDragArea(e,t,r){let[i,n,o,s]=e,[a,l,h,u]=t;switch(r){case"up":return[a,l,i-1,s];case"down":{let e=this.mergedCellsCollection.get(h,s);return[o+1,n,h+(e?e.rowspan-1:0),s]}case"left":return[a,l,o,n-1];case"right":{let e=this.mergedCellsCollection.get(h,s);return[i,s+(e?e.colspan-1:0),h,u]}default:return null}}getFarthestCollection(e,t,r,i){let[n,o,s,a]=e,l=["up","down"].indexOf(r)>-1,h=l?s:a,u=l?n:o,d=this.getAutofillSize(e,t,r),g=l?s-n+1:a-o+1,p=d-Math.floor(d/g)*g,f=null,m=null,y=null;switch(r){case"up":f="includesVertically",y=h-p+1;break;case"left":f="includesHorizontally",y=h-p+1;break;case"down":f="includesVertically",y=u+p-1;break;case"right":f="includesHorizontally",y=u+p-1}return(0,c.arrayEach)(i,e=>{e[f](y)&&e.isFarther(m,r)&&(m=e)}),m}recreateAfterDataPopulation(e){if(!this.currentFillData)return;let t=this.getRangeFromChanges(e),r=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,n=(e,r)=>{switch(i){case"up":return e.row-r>=t.from.row;case"down":return e.row+e.rowspan-1+r<=t.to.row;case"left":return e.col-r>=t.from.column;case"right":return e.col+e.colspan-1+r<=t.to.column;default:return null}},o=0,s=null,a=1;do for(let e=0;e<r.length;e+=1){if(n(s=r[e],o=a*this.currentFillData.cycleLength))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:s.row-o,rowspan:s.rowspan,col:s.col,colspan:s.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:s.row+o,rowspan:s.rowspan,col:s.col,colspan:s.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:s.row,rowspan:s.rowspan,col:s.col-o,colspan:s.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:s.row,rowspan:s.rowspan,col:s.col+o,colspan:s.colspan},!0)}e===r.length-1&&(a+=1)}while(n(s,o));this.currentFillData=null,this.plugin.hot.render(),r.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){let t={min:null,max:null},r={min:null,max:null};return(0,c.arrayEach)(e,e=>{let i=e[0],n=this.plugin.hot.propToCol(e[1]);(null===t.min||i<t.min)&&(t.min=i),(null===t.max||i>t.max)&&(t.max=i),(null===r.min||n<r.min)&&(r.min=n),(null===r.max||n>r.max)&&(r.max=n)}),{from:{row:t.min,column:r.min},to:{row:t.max,column:r.max}}}dragAreaOverlapsCollections(e,t,r){let[i,n,o,s]=this.getDragArea(e,t,r),a=this.plugin.hot._createCellCoords(i,n),l=this.plugin.hot._createCellCoords(o,s),h=this.plugin.hot._createCellRange(a,a,l);if(0===this.mergedCellsCollection.getWithinRange(h,!0).length)return!1;let u=this.mergedCellsCollection.getWithinRange(h,!1);return 0===u.length||("up"===r||"down"===r?!u.every(e=>{let{colspan:t}=e;return t===h.getWidth()}):!u.every(e=>{let{rowspan:t}=e;return t===h.getHeight()}))}}function gw(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class gE{constructor(e){gw(this,"plugin",void 0),gw(this,"hot",void 0),gw(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}
52getSelectedMergedCellClassName(e,t,r,i){let n=Math.min(r[0],r[2]),o=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),a=Math.max(r[1],r[3]);if(void 0===i||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,t))return;let l=this.plugin.mergedCellsCollection.get(e,t);if(!l)return;let h=l.getLastRow(),u=l.getLastColumn();return n<=l.row&&o<=l.col&&s>=h&&a>=u?`${this.fullySelectedMergedCellClassName}-${i}`:this.isMergeCellFullySelected(l,this.plugin.hot.getSelectedRange())?`${this.fullySelectedMergedCellClassName}-multiple`:void 0}isMergeCellFullySelected(e,t){let r=[];if(!t||!e)return!1;for(let t=0;t<e.rowspan;t+=1)for(let i=0;i<e.colspan;i+=1)r.push(this.hot._createCellCoords(e.row+t,e.col+i));for(let e=0;e<r.length;e+=1){let i=[];for(let n=0;n<t.length;n+=1)i[n]=t[n].includes(r[e]);if(!i.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){let e=[];for(let t=0;t<=7;t+=1)e.push(`${this.fullySelectedMergedCellClassName}-${t}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function gS(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class gC{constructor(e){gS(this,"data",void 0),gS(this,"next",null),gS(this,"prev",null),this.data=e}}class gR{constructor(){gS(this,"first",null),gS(this,"last",null)}push(e){let t=new gC(e);if(null===this.first)this.first=t,this.last=t;else{let e=this.last;this.last=t,t.prev=e,e.next=t}return t}unshift(e){let t=new gC(e);if(null===this.first)this.first=t,this.last=t;else{let e=this.first;this.first=t,t.next=e,e.prev=t}}inorder(e){let t=this.first;for(;t;){let r=e(t);if(t===this.last||!0===r)break;t=t.next}}remove(e){let t,r;if(null===this.first)return!1;let i=this.first;for(;i;){if(i.data===e)return t=i.next,r=i.prev,t&&(t.prev=r),r&&(r.next=t),i===this.first&&(this.first=t),i===this.last&&(this.last=r),!0;i=i.next}return!1}hasCycle(){let e=this.first,t=this.first;for(;;){if(null===e||null===(e=e.next))return!1;if((e=e.next)===(t=t.next))return!0}}pop(){if(null===this.last)return null;let e=this.last;return this.last=this.last.prev,e}shift(){if(null===this.first)return null;let e=this.first;return this.first=this.first.next,e}recursiveReverse(){if(!this.first)return;!function e(t,r){r&&(e(r,r.next),r.next=t)}(this.first,this.first.next),this.first.next=null;let e=this.first;this.first=this.last,this.last=e}reverse(){let e;if(!this.first||!this.first.next)return;let t=this.first.next,r=this.first;for(;t;)e=t.next,t.next=r,r.prev=t,r=t,t=e;this.first.next=null,this.last.prev=null,e=this.first,this.first=r,this.last=e}}function gb(e,t,r){gT(e,t),t.set(e,r)}function gT(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function gN(e,t){return e.get(gI(e,t))}function gA(e,t,r){return e.set(gI(e,t),r),r}function gI(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var gM=new WeakMap,gO=new WeakMap,gx=new WeakMap,g_=new WeakMap,gP=new WeakMap,gL=new WeakMap,gk=new WeakMap,gD=new WeakSet;class gH{constructor(e){let{mergedCellsGetter:t,rowIndexMapper:r,columnIndexMapper:i}=e;gT(this,gD),gD.add(this),gb(this,gM,new gR),gb(this,gO,new gR),gb(this,gx,null),gb(this,g_,null),gb(this,gP,null),gb(this,gL,null),gb(this,gk,null),gA(gP,this,t),gA(gL,this,r),gA(gk,this,i)}getCurrentVerticalNode(){return gN(g_,this).data}getFirstVerticalNode(){return gN(gO,this).first.data}getNextVerticalNode(){return gN(g_,this).next.data}getPrevVerticalNode(){return gN(g_,this).prev.data}getCurrentHorizontalNode(){return gN(gx,this).data}getFirstHorizontalNode(){return gN(gM,this).first.data}getNextHorizontalNode(){return gN(gx,this).next.data}getPrevHorizontalNode(){return gN(gx,this).prev.data}setPrevNodeAsActive(){gA(g_,this,gN(g_,this).prev),gA(gx,this,gN(gx,this).prev)}setNextNodeAsActive(){gA(g_,this,gN(g_,this).next),gA(gx,this,gN(gx,this).next)}buildFocusOrder(e){gA(gM,this,new gR),e.forEach((e,t)=>{let r=new WeakSet,i=e.getTopStartCorner(),n=e.getBottomEndCorner();for(let o=i.row;o<=n.row;o++)if(!gN(gL,this).isHidden(o))for(let s=i.col;s<=n.col;s++){if(gN(gk,this).isHidden(s))continue;let i=gI(gD,this,gB).call(this,{selectedRange:e,selectionLayer:t,listOrder:gN(gM,this),mergeCellsVisitor:r,row:o,column:s});i&&gA(gx,this,i)}}),gN(gM,this).first&&(gN(gM,this).first.prev=gN(gM,this).last,gN(gM,this).last.next=gN(gM,this).first),gA(gO,this,new gR),e.forEach((e,t)=>{let r=new WeakSet,i=e.getTopStartCorner(),n=e.getBottomEndCorner();for(let o=i.col;o<=n.col;o++)if(!gN(gk,this).isHidden(o))for(let s=i.row;s<=n.row;s++){if(gN(gL,this).isHidden(s))continue;let i=gI(gD,this,gB).call(this,{selectedRange:e,selectionLayer:t,listOrder:gN(gO,this),mergeCellsVisitor:r,row:s,column:o});i&&gA(g_,this,i)}}),gN(gO,this).first&&(gN(gO,this).first.prev=gN(gO,this).last,gN(gO,this).last.next=gN(gO,this).first)}setActiveNode(e,t,r){return gN(gM,this).inorder(i=>
52{let{selectionLayer:n,rowStart:o,rowEnd:s,colStart:a,colEnd:l}=i.data;if(n===r&&e>=o&&e<=s&&t>=a&&t<=l)return gA(gx,this,i),!0}),gN(gO,this).inorder(i=>{let{selectionLayer:n,rowStart:o,rowEnd:s,colStart:a,colEnd:l}=i.data;if(n===r&&e>=o&&e<=s&&t>=a&&t<=l)return gA(g_,this,i),!0}),this}}function gB(e){let{selectedRange:t,selectionLayer:r,listOrder:i,mergeCellsVisitor:n,row:o,column:s}=e,a=t.getTopStartCorner(),l=t.getBottomEndCorner(),h=t.highlight.clone().normalize(),u=gN(gP,this).call(this,o,s);if(u&&n.has(u))return null;let c={selectionLayer:r,colStart:s,colEnd:s,rowStart:o,rowEnd:o};if(u){if(n.add(u),u.row<a.row||u.row+u.rowspan-1>l.row||u.col<a.col||u.col+u.colspan-1>l.col)return null;c.colStart=u.col,c.colEnd=u.col+u.colspan-1,c.rowStart=u.row,c.rowEnd=u.row+u.rowspan-1}let d=i.push(c);return o===h.row&&s===h.col||u&&h.row>=u.row&&h.row<=u.row+u.rowspan-1&&h.col>=u.col&&h.col<=u.col+u.colspan-1?d:null}function gF(e,t,r){let{rowIndexMapper:i,stylesHandler:n}=e,o=0;for(let a=t;a<t+r;a++)if(!i.isHidden(a)){var s;o+=null!==(s=e.getRowHeight(a))&&void 0!==s?s:n.getDefaultRowHeight(a)}return o}function gV(e,t,r){gU(e,t),t.set(e,r)}function gU(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function gW(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gj(e,t,r){return e.set(g$(e,t),r),r}function gG(e,t){return e.get(g$(e,t))}function g$(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}eN.P.getSingleton().register("beforeMergeCells"),eN.P.getSingleton().register("afterMergeCells"),eN.P.getSingleton().register("beforeUnmergeCells"),eN.P.getSingleton().register("afterUnmergeCells");let gz="mergeCells";var gY=new WeakMap,gK=new WeakMap,gX=new WeakMap,gq=new WeakMap,gZ=new WeakSet;class gQ extends tn.vq{constructor(){super(...arguments),gU(this,gZ),gZ.add(this),gW(this,"mergedCellsCollection",null),gW(this,"autofillCalculations",null),gW(this,"selectionCalculations",null),gV(this,gY,null),gV(this,gK,{row:0,col:0}),gV(this,gX,new gH({mergedCellsGetter:(e,t)=>this.mergedCellsCollection.get(e,t),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),gV(this,gq,function(e){let{hot:t}=e,{rowIndexMapper:r,columnIndexMapper:i}=t,n=new Map;return{before:function(){},after:function(o,a,l){let h=e.mergedCellsCollection.get(a,l);if(!(0,s.isObject)(h)){o.removeAttribute("rowspan"),o.removeAttribute("colspan"),n.has(a)&&!t.getSettings().rowHeaders&&(o.style.height=`${n.get(a)}px`,n.delete(a)),o.style.display="";return}let{row:u,col:c,colspan:d,rowspan:g}=h,[p,f]=e.translateMergedCellToRenderable(u,g,c,d),m=e.getSetting("virtualized");if(0===c&&!t.getSettings().rowHeaders){let e=t._getRowHeightFromSettings(a);if(void 0!==e){let r=t.stylesHandler.areCellsBorderBox();n.set(a,e-(r?0:1))}else if((0,en.isSafari)()){let e=gF(t,u,g);n.set(a,e/g)}}let y=r.getRenderableFromVisualIndex(a),w=i.getRenderableFromVisualIndex(l),E=r.getNearestNotHiddenIndex(u,1),S=i.getNearestNotHiddenIndex(c,1);if(m){let e=t.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(e)||(E=Math.max(E,t.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(e)||(S=Math.max(S,t.getFirstRenderedVisibleColumn()))}E===a&&S===l?(o.setAttribute("rowspan",Math.min(g,p-y+1)),o.setAttribute("colspan",Math.min(d,f-w+1))):(o.removeAttribute("rowspan"),o.removeAttribute("colspan"),o.style.display="none")}}}(this))}static get PLUGIN_KEY(){return gz}static get PLUGIN_PRIORITY(){return 150}static get DEFAULT_SETTINGS(){return{[tn.Ur]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[gz]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new gg(this),this.autofillCalculations=new gv(this),this.selectionCalculations=new gE(this),this.addHook("afterInit",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,gJ).call(e,...r)}),this.addHook("modifyTransformFocus",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g1).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g2).call(e,...r)}),this.addHook("modifyTransformEnd",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g5).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g3).call(e,...r)}),this.addHook("beforeSetRangeStart",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g7).call(e,...r)}),this.addHook("beforeSetRangeStartOnly",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g7).call(e,...r)}),this.addHook("beforeSelectionFocusSet",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g8).call(e,...r)}),this.addHook("afterSelectionFocusSet",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g6).call(e,...r)}),this.addHook("afterSelectionEnd",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pe).call(e,...r)}),this.addHook("modifyGetCellCoords",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g9).call(e,...r)}),this.addHook("modifyGetCoordsElement",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g9).call(e,...r)}),this.addHook("afterIsMultipleSelection",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g0).call(e,...r)}),this.addHook("afterRenderer",function(){return gG(gq,e).after(...arguments)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,g4).call(e,...r)}),this.addHook("afterGetCellMeta",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pt).call(e,...r)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pr).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pi).call(e,...r)}),this.addHook("modifyAutofillRange",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pn).call(e,...r)}),this.addHook("afterCreateCol",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,po).call(e,...r)}),this.addHook("afterRemoveCol",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,ps).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pa).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pl).call(e,...r)}),this.addHook("afterChange",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,ph).call(e,...r)}),this.addHook("beforeDrawBorders",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pu).call(e,...r)}),this.addHook("afterDrawSelection",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pc).call(e,...r)}),this.addHook("beforeRemoveCellClassNames",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pd).call(e,...r)}),this.addHook("beforeBeginEditing",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pg).call(e,...r)}),this.addHook("modifyRowHeightByOverlayName",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return g$(gZ,e,pp).call(e,...r)}),this.addHook("beforeUndoStackChange",(e,t)=>{if("MergeCells"===t)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()}
52ifChromeForceRepaint(){if(!(0,en.isChrome)())return;let e=[],t=[];this.mergedCellsCollection.mergedCells.forEach(e=>{let{row:r,rowspan:i}=e;for(let e=r+1;e<r+i;e++)t.push(e)}),(t=[...new Set(t)]).forEach(t=>{let r=this.hot.rowIndexMapper.getRenderableFromVisualIndex(t);this.hot.view._wt.wtOverlays.getOverlays(!0).map(e=>(null==e?void 0:e.name)==="master"?e:e.clone.wtTable).forEach(t=>{let i=t.getRow(r);i&&(i.style.background=(0,n.getStyle)(i,"backgroundColor").replace(")",", 0.99)"),e.push(i))})}),this.hot._registerTimeout(()=>{e.forEach(e=>{var t;e.style.background=null===(t=(0,n.getStyle)(e,"backgroundColor"))||void 0===t?void 0:t.replace(", 0.99)",")")})},1)}validateSetting(e){return!!e&&(gh.containsNegativeValues(e)?((0,rE.ZK)(gh.NEGATIVE_VALUES_WARNING(e)),!1):gh.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?((0,rE.ZK)(gh.IS_OUT_OF_BOUNDS_WARNING(e)),!1):gh.isSingleCell(e)?((0,rE.ZK)(gh.IS_SINGLE_CELL(e)),!1):!gh.containsZeroSpan(e)||((0,rE.ZK)(gh.ZERO_SPAN_WARNING(e)),!1))}generateFromSettings(){let e=this.getSetting("cells").filter(e=>this.validateSetting(e)),t=this.mergedCellsCollection.filterOverlappingMergeCells(e),r=[];t.forEach(e=>{let{row:t,col:i,rowspan:n,colspan:o}=e,s=this.hot._createCellCoords(t,i),a=this.hot._createCellCoords(t+n-1,i+o-1),l=this.hot._createCellRange(s,s,a);this.mergeRange(l,!0,!0);for(let e=t;e<t+n;e++)for(let n=i;n<i+o;n++)(e!==t||n!==i)&&r.push([e,n,null])}),0!==r.length&&this.hot.setDataAtCell(r,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!t||this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hot.getSelectedRangeActive();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");let{from:t,to:r}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(t.row,t.col,r.row,r.col,!1)}unmergeSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hot.getSelectedRangeActive();if(!e)return;let{from:t,to:r}=e;this.unmergeRange(e,!0),this.hot.selectCell(t.row,t.col,r.row,r.col,!1)}mergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.getTopStartCorner(),n=e.getBottomEndCorner(),o={row:i.row,col:i.col,rowspan:n.row-i.row+1,colspan:n.col-i.col+1},s=[],a=null;return!!this.canMergeRange(o,t)&&(this.hot.runHooks("beforeMergeCells",e,t),(0,eH.rangeEach)(0,o.rowspan-1,e=>{(0,eH.rangeEach)(0,o.colspan-1,t=>{let r=null;s[e]||(s[e]=[]),0===e&&0===t?r=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(o.row),this.hot.toPhysicalColumn(o.col)):this.hot.setCellMeta(o.row+e,o.col+t,"hidden",!0),s[e][t]=r})}),this.hot.setCellMeta(o.row,o.col,"spanned",!0),!this.mergedCellsCollection.add(o,t)||(r?a=[o.row,o.col,s]:this.hot.populateFromArray(o.row,o.col,s,void 0,void 0,this.pluginName),t||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,o,t),a))}unmergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.mergedCellsCollection.getWithinRange(e);0!==r.length&&(this.hot.runHooks("beforeUnmergeCells",e,t),(0,c.arrayEach)(r,e=>{this.mergedCellsCollection.remove(e.row,e.col),(0,eH.rangeEach)(0,e.rowspan-1,t=>{(0,eH.rangeEach)(0,e.colspan-1,r=>{this.hot.removeCellMeta(e.row+t,e.col+r,"hidden"),this.hot.removeCellMeta(e.row+t,e.col+r,"copyable")})}),this.hot.removeCellMeta(e.row,e.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,t),this.hot.render())}toggleMerge(e){let{from:t,to:r}=e.clone().normalize(),i=this.mergedCellsCollection.get(t.row,t.col);i.row===t.row&&i.col===t.col&&i.row+i.rowspan-1===r.row&&i.col+i.colspan-1===r.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,t,r,i){let n=this.hot._createCellCoords(e,t),o=this.hot._createCellCoords(r,i);this.mergeRange(this.hot._createCellRange(n,n,o))}unmerge(e,t,r,i){let n=this.hot._createCellCoords(e,t),o=this.hot._createCellCoords(r,i);this.unmergeRange(this.hot._createCellRange(n,n,o))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{let e=this.hot.getSelectedRangeActive();e&&!e.isSingleHeader()&&(this.toggleMerge(e),this.hot.render())},runOnlyIf:e=>!e.altKey,group:gz})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(gz)}modifyViewportRowStart(e,t){let r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.startRow);for(let n=0;n<t;n+=1){let o=this.mergedCellsCollection.get(i,n);if((0,s.isObject)(o)){let i=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o.row,1));if(i<e.startRow){e.startRow=i,this.modifyViewportRowStart(e,t);return}}}}modifyViewportRowEnd(e,t){let r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.endRow);for(let n=0;n<t;n+=1){let o=this.mergedCellsCollection.get(i,n);if((0,s.isObject)(o)){let i=o.row+o.rowspan-1,n=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(i,-1));if(n>e.endRow){e.endRow=n,this.modifyViewportRowEnd(e,t);return}}}}modifyViewportColumnStart(e,t){let r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.startColumn);for(let n=0;n<t;n+=1){let o=this.mergedCellsCollection.get(n,i);if((0,s.isObject)(o)){let i=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o.col,1));if(i<e.startColumn){e.startColumn=i,this.modifyViewportColumnStart(e,t);return}}}}modifyViewportColumnEnd(e,t){let r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.endColumn);for(let n=0;n<t;n+=1){let o=this.mergedCellsCollection.get(n,i);if((0,s.isObject)(o)){let i=o.col+o.colspan-1,n=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(i,-1));if(n>e.endColumn){e.endColumn=n,this.modifyViewportColumnEnd(e,t);return}}}}
52translateMergedCellToRenderable(e,t,r,i){let n,o;let{rowIndexMapper:s,columnIndexMapper:a}=this.hot;return n=0===t?s.getNearestNotHiddenIndex(e,1):s.getNearestNotHiddenIndex(e+t-1,-1),o=0===i?a.getNearestNotHiddenIndex(r,1):a.getNearestNotHiddenIndex(r+i-1,-1),[e>=0?s.getRenderableFromVisualIndex(n):e,r>=0?a.getRenderableFromVisualIndex(o):r]}}function gJ(){this.generateFromSettings(),this.hot.render()}function g0(e){if(e){let e=this.mergedCellsCollection.mergedCells,t=this.hot.getSelectedRangeActive(),r=t.getTopStartCorner(),i=t.getBottomEndCorner();for(let t=0;t<e.length;t+=1)if(r.row===e[t].row&&r.col===e[t].col&&i.row===e[t].row+e[t].rowspan-1&&i.col===e[t].col+e[t].colspan-1)return!1}return e}function g1(e){gG(gK,this).row=e.row,gG(gK,this).col=e.col}function g2(e){let{highlight:t}=this.hot.getSelectedRangeActive(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;gG(gY,this)&&(null!==i.getRenderableFromVisualIndex(gG(gY,this).row)&&(t.row=gG(gY,this).row),null!==r.getRenderableFromVisualIndex(gG(gY,this).col)&&(t.col=gG(gY,this).col),gj(gY,this,null));let n=this.mergedCellsCollection.get(t.row,t.col);if(!n)return;let o=n.col,s=n.col+n.colspan-1;if(e.col<0){let i=t.col>=o&&t.col<=s?o-1:s,n=r.getNearestNotHiddenIndex(i,-1);null===n?e.col=-this.hot.view.countRenderableColumnsInRange(0,t.col):e.col=-Math.max(this.hot.view.countRenderableColumnsInRange(n,t.col)-1,1)}else if(e.col>0){let i=t.col>=o&&t.col<=s?s+1:o,n=r.getNearestNotHiddenIndex(i,1);null===n?e.col=this.hot.view.countRenderableColumnsInRange(t.col,this.hot.countCols()):e.col=Math.max(this.hot.view.countRenderableColumnsInRange(t.col,n)-1,1)}let a=n.row,l=n.row+n.rowspan-1;if(e.row<0){let r=t.row>=a&&t.row<=l?a-1:l,n=i.getNearestNotHiddenIndex(r,-1);null===n?e.row=-this.hot.view.countRenderableRowsInRange(0,t.row):e.row=-Math.max(this.hot.view.countRenderableRowsInRange(n,t.row)-1,1)}else if(e.row>0){let r=t.row>=a&&t.row<=l?l+1:a,n=i.getNearestNotHiddenIndex(r,1);null===n?e.row=this.hot.view.countRenderableRowsInRange(t.row,this.hot.countRows()):e.row=Math.max(this.hot.view.countRenderableRowsInRange(t.row,n)-1,1)}}function g5(e){let t=this.hot.getSelectedRangeActive(),r=t.clone(),{to:i}=t,{columnIndexMapper:n,rowIndexMapper:o}=this.hot,s=(e,t)=>{r.expand(this.hot._createCellCoords(e,t));for(let e=0;e<this.mergedCellsCollection.mergedCells.length;e+=1)r.expandByRange(this.mergedCellsCollection.mergedCells[e].getRange())};if(e.col<0){let o=this.mergedCellsCollection.getStartMostColumnIndex(t,i.col)+e.col;s(i.row,o),"E-W"===t.getHorizontalDirection()&&"E-W"===r.getHorizontalDirection()&&(o=r.getTopStartCorner().col);let a=n.getNearestNotHiddenIndex(o,1);null!==a&&(e.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,i.col)-1,1))}else if(e.col>0){let o=this.mergedCellsCollection.getEndMostColumnIndex(t,i.col)+e.col;s(i.row,o),"W-E"===t.getHorizontalDirection()&&"W-E"===r.getHorizontalDirection()&&(o=r.getBottomEndCorner().col);let a=n.getNearestNotHiddenIndex(o,-1);null!==a&&(e.col=Math.max(this.hot.view.countRenderableColumnsInRange(i.col,a)-1,1))}if(e.row<0){let n=this.mergedCellsCollection.getTopMostRowIndex(t,i.row)+e.row;s(n,i.col),"S-N"===t.getVerticalDirection()&&"S-N"===r.getVerticalDirection()&&(n=r.getTopStartCorner().row);let a=o.getNearestNotHiddenIndex(n,1);null!==a&&(e.row=-Math.max(this.hot.view.countRenderableRowsInRange(a,i.row)-1,1))}else if(e.row>0){let n=this.mergedCellsCollection.getBottomMostRowIndex(t,i.row)+e.row;s(n,i.col),"N-S"===t.getVerticalDirection()&&"N-S"===r.getVerticalDirection()&&(n=r.getBottomStartCorner().row);let a=o.getNearestNotHiddenIndex(n,-1);null!==a&&(e.row=Math.max(this.hot.view.countRenderableRowsInRange(i.row,a)-1,1))}}function g3(){let e=this.hot.getSelectedRangeLast(),{highlight:t}=e;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){gj(gY,this,t.clone());return}for(let t=0;t<this.mergedCellsCollection.mergedCells.length;t+=1)e.expandByRange(this.mergedCellsCollection.mergedCells[t].getRange(),!1);for(let t=0;t<this.mergedCellsCollection.mergedCells.length;t+=1)e.expandByRange(this.mergedCellsCollection.mergedCells[t].getRange(),!1);let r=this.mergedCellsCollection.get(t.row,t.col);gj(gY,this,t.clone()),r&&t.assign(r)}
52function g9(e,t,r,i){if(e<0||t<0)return;let n=this.mergedCellsCollection.get(e,t);if(!n)return;let{row:o,col:s,colspan:a,rowspan:l}=n,h=o+l-1,u=s+a-1;if("render"===i&&this.getSetting("virtualized")){let e=this.hot.view.getActiveOverlayName(),t=["top","top_inline_start_corner"].includes(e)?0:this.hot.getFirstRenderedVisibleRow(),r=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(e)?0:this.hot.getFirstRenderedVisibleColumn();return[(0,eH.clamp)(t,o,h),(0,eH.clamp)(r,s,u),(0,eH.clamp)(this.hot.getLastRenderedVisibleRow(),o,h),(0,eH.clamp)(this.hot.getLastRenderedVisibleColumn(),s,u)]}return[o,s,h,u]}function g4(e){var t;e.items.push({name:"---------"},(t=this,{key:"mergeCells",name(){let e=this.getSelectedActive();if(e){let 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(eA.CONTEXTMENU_ITEMS_UNMERGE_CELLS)}return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_MERGE_CELLS)},callback(){let e=this.getSelectedRangeActive();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");let{from:r,to:i}=e;t.toggleMerge(e),this.selectCell(r.row,r.col,i.row,i.col,!1)},disabled(){let e=this.getSelectedActive();return!e||gh.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner()},hidden:!1}))}function g7(){gj(gY,this,null)}function g8(){if(gG(gY,this).isCell())return;let e=this.hot.getSelectedRangeActive(),t=e.getVerticalDirection(),r=e.getHorizontalDirection(),i=gG(gY,this).clone().normalize();gG(gX,this).setActiveNode(i.row,i.col),gG(gK,this).row>0||gG(gK,this).col>0?gG(gX,this).setPrevNodeAsActive():("E-W"===r&&gG(gK,this).col<0||"S-N"===t&&gG(gK,this).row<0)&&gG(gX,this).setNextNodeAsActive()}function g6(e,t){let{columnIndexMapper:r,rowIndexMapper:i}=this.hot,n=this.hot.getActiveSelectionLayerIndex(),o=null,s=null;if(gG(gK,this).col<0){let{rowEnd:e,colEnd:t,selectionLayer:a}=gG(gX,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(t,-1),o=i.getNearestNotHiddenIndex(e,-1),n=a}else if(gG(gK,this).col>0){let{rowStart:e,colStart:t,selectionLayer:a}=gG(gX,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(t,1),o=i.getNearestNotHiddenIndex(e,1),n=a}else if(gG(gK,this).row<0){let{rowEnd:e,colEnd:t,selectionLayer:a}=gG(gX,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(t,-1),o=i.getNearestNotHiddenIndex(e,-1),n=a}else if(gG(gK,this).row>0){let{rowStart:e,colStart:t,selectionLayer:a}=gG(gX,this).getNextVerticalNode();s=r.getNearestNotHiddenIndex(t,1),o=i.getNearestNotHiddenIndex(e,1),n=a}if(null!==o||null!==s){this.hot.selection.setActiveSelectionLayerIndex(n);let r=this.hot.getSelectedRangeActive(),i=this.hot._createCellCoords(o,s),a=this.mergedCellsCollection.get(i.row,i.col),l=this.hot.selection.highlight.getFocus();e=i.row,t=i.col,a?r.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(a.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(a.col,1)}):r.highlight.assign(i),l.clear(),l.add(i).commit()}gG(gX,this).setActiveNode(e,t,n),gj(gK,this,{row:0,col:0})}function pe(){gG(gX,this).buildFocusOrder(this.hot.getSelectedRange())}function pt(e,t,r){let i=this.mergedCellsCollection.get(e,t);i&&(i.row!==e||i.col!==t?r.copyable=!1:(r.rowspan=i.rowspan,r.colspan=i.colspan))}function pr(e){if(this.getSetting("virtualized"))return;let t=this.hot.countCols();this.modifyViewportRowStart(e,t),this.modifyViewportRowEnd(e,t)}function pi(e){if(this.getSetting("virtualized"))return;let t=this.hot.countRows();this.modifyViewportColumnStart(e,t),this.modifyViewportColumnEnd(e,t)}function pn(e,t){let r=this.autofillCalculations.getDirection(t,e);if(this.autofillCalculations.dragAreaOverlapsCollections(t,e,r))return t;let i=this.hot._createCellCoords(t[0],t[1]),n=this.hot._createCellCoords(t[2],t[3]),o=this.hot._createCellRange(i,i,n),s=this.mergedCellsCollection.getWithinRange(o);return 0===s.length?e:this.autofillCalculations.snapDragArea(t,e,r,s)}function po(e,t){this.mergedCellsCollection.shiftCollections("right",e,t)}function ps(e,t){this.mergedCellsCollection.shiftCollections("left",e,t)}function pa(e,t,r){"auto"!==r&&this.mergedCellsCollection.shiftCollections("down",e,t)}function pl(e,t){this.mergedCellsCollection.shiftCollections("up",e,t)}function ph(e,t){"Autofill.fill"===t&&this.autofillCalculations.recreateAfterDataPopulation(e)}function pu(e,t){if(t&&"area"===t){let t=this.hot.getSelectedRangeActive(),r=this.mergedCellsCollection.getWithinRange(t);(0,c.arrayEach)(r,r=>{t.getBottomEndCorner().row===r.getLastRow()&&t.getBottomEndCorner().col===r.getLastColumn()&&(e[2]=r.row,e[3]=r.col)})}}function pc(e,t,r,i){if(r)return this.selectionCalculations.getSelectedMergedCellClassName(e,t,r,i
52)}function pd(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function pg(e,t,r,i){if(!(i instanceof MouseEvent))return;let n=this.hot.getSelectedRangeActive(),o=this.mergedCellsCollection.getByRange(n);if(!o)return;let s=this.hot._createCellCoords(o.row,o.col),a=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);return 0===this.hot.selection.getLayerLevel()&&n.isEqual(this.hot._createCellRange(s,s,a))}function pp(e,t,r){let i,n;if(this.hot.getSettings().rowHeaders||"bottom"===r||"bottom_inline_start_corner"===r)return e;if("master"===r)i=this.hot.getFirstRenderedVisibleColumn(),n=this.hot.getLastRenderedVisibleColumn();else{let e=this.hot.view.getOverlayByName(r);i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e.clone.wtTable.getFirstRenderedColumn()),n=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(t,i))return e;let o=this.hot._createCellCoords(t,i),s=this.hot._createCellCoords(t,n),a=this.hot._createCellRange(o,o,s),l=this.mergedCellsCollection.getWithinRange(a,!0),h=l.reduce((e,t)=>{let{rowspan:r}=t;return Math.max(e,r)},1),u=0;return l.length>1&&l[0].rowspan<h&&(u=h-l[0].rowspan),l.forEach(i=>{let{rowspan:n}=i,o=0;o="top"===r||"top_inline_start_corner"===r?Math.min(h,this.hot.view.countNotHiddenFixedRowsTop()-t):n-u,e=Math.max(null!=e?e:0,gF(this.hot,t,o))}),e}let pf="sort",pm="multiColumnSorting";rY(pm,function(e,t){return function(r,i){let[,...n]=r,[,...o]=i;return function r(i){let s=e[i],a=t[i],l=n[i],h=o[i],u=a.multiColumnSorting,c=(u.compareFunctionFactory?u.compareFunctionFactory:rX(a.type))(s,a,u)(l,h);if(c===rq){let e=i+1;if(void 0!==t[e])return r(e)}return c}(0)}});class py extends il{constructor(){var e,t;super(...arguments),(e="symbol"==typeof(t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="pluginKey","string"))?t:t+"")in this?Object.defineProperty(this,e,{value:pm,enumerable:!0,configurable:!0,writable:!0}):this[e]=pm}static get PLUGIN_KEY(){return pm}static get PLUGIN_PRIORITY(){return 170}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:()=>{let{highlight:e}=this.hot.getSelectedRangeActive();return -1===e.row&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,io)),!1},runOnlyIf:()=>{var e,t;let r=null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight;return r&&(null===(t=this.hot.getSelectedRangeActive())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(r)&&r.isHeader()},relativeToGroup:a.II,position:"before",group:pm})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(pm)}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&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];super.updateHeaderClasses(e,...r),(0,n.removeClass)(e,function(e){let t=e.className.split(" "),r=RegExp(`^${pf}-[0-9]{1,2}$`);return t.filter(e=>r.test(e))}(e)),!1!==this.enabled&&(0,n.addClass)(e,function(e,t,r){let i=[];return!1===r||e.isColumnSorted(t)&&e.getNumberOfSortedColumns()>1&&i.push(`${pf}-${e.getIndexOfColumnInSortQueue(t)+1}`),i}(...r))}onAfterOnCellMouseDown(e,t){!1!==r9(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(t.col),this.sort(this.getNextSortConfig(t.col,io))):this.sort(this.getColumnNextConfig(t.col)))}}function pv(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class pw extends tn.vq{constructor(){super(...arguments),pv(this,"dragged",[]),pv(this,"lastSetCell",null)}static get PLUGIN_KEY(){return"multipleSelectionHandles"}static get PLUGIN_PRIORITY(){return 160}isEnabled(){return(0,en.isMobileBrowser)()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){let e=this,{rootElement:t}=this.hot;function r(t){if(1===e.dragged.length)return e.dragged.splice(0,e.dragged.length),!0;let r=e.dragged.indexOf(t);if(-1===r)return!1;0===r?e.dragged=e.dragged.slice(0,1):1===r&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(t,"touchstart",t=>{let r;return(0,n.hasClass)(t.target,"topSelectionHandle-HitArea")?(r=e.hot.getSelectedRangeActive(),e.dragged.push("top"),e.touchStartRange={width:r.getWidth(),height:r.getHeight(),direction:r.getDirection()},t.preventDefault(),!1):(0,n.hasClass)(t.target,"bottomSelectionHandle-HitArea")?(r=e.hot.getSelectedRangeActive(),e.dragged.push("bottom"),e.touchStartRange={width:r.getWidth(),height:r.getHeight(),direction:r.getDirection()},t.preventDefault(),!1):void 0}),this.eventManager.addEventListener(t,"touchend",t=>(0,n.hasClass)(t.target,"topSelectionHandle-HitArea")?(r.call(e,"top"),e.touchStartRange=void 0,t.preventDefault(),!1):(0,n.hasClass)(t.target,"bottomSelectionHandle-HitArea")?(r.call(e,"bottom"),e.touchStartRange=void 0,t.preventDefault(),!1):void 0),this.eventManager.addEventListener(t,"touchmove",t=>{let r,i,n,o,s,a;let{rootDocument:l}=this.hot;if(0===e.dragged.length)return;let h=l.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY);h&&h!==e.lastSetCell&&(("TD"===h.nodeName||"TH"===h.nodeName)&&(-1===(r=e.hot.getCoords(h)).col&&(r.col=0),n=(i=e.hot.getSelectedRangeActive()).getWidth(),o=i.getHeight(),s=i.getDirection(),1===n&&1===o&&e.hot.selection.setRangeEnd(r),null!==(a=e.getCurrentRangeCoords(i,r,e.touchStartRange.direction,s,e.dragged[0])).start&&e.hot.selection.setRangeStart(a.start),e.hot.selection.setRangeEnd(a.end),e.lastSetCell=h),t.preventDefault())})}getCurrentRangeCoords(e,t,r,i,n){let o=e.getTopStartCorner(),s=e.getBottomEndCorner(),a=e.getBottomStartCorner(),l=e.getTopEndCorner(),h={start:null,end:null};switch(r){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":h="top"===n?{start:this.hot._createCellCoords(t.row,e.highlight.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,o.col)};break;case"SE-NW":"bottom"===n&&(h={start:this.hot._createCellCoords(s.row,t.col),end:this.hot._createCellCoords(t.row,o.col)})}break;case"NW-SE":switch(i){case"NE-SW":"top"===n?h={start:t,end:a}:h.end=t;break;case"NW-SE":"top"===n?h={start:t,end:s}:h.end=t;break;case"SE-NW":"top"===n?h={start:t,end:o}:h.end=t;break;case"SW-NE":"top"===n?h={start:t,end:l}:h.end=t}break;case"SW-NE":switch(i){case"NW-SE":h="bottom"===n?{start:this.hot._createCellCoords(t.row,o.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(o.row,t.col),end:this.hot._createCellCoords(t.row,s.col)};break;case"SW-NE":h="top"===n?{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,s.col)}:{start:this.hot._createCellCoords(t.row,o.col),end:this.hot._createCellCoords(o.row,t.col)};break;case"SE-NW":"bottom"===n?h={start:this.hot._createCellCoords(t.row,l.col),end:this.hot._createCellCoords(o.row,t.col)}:"top"===n&&(h={start:a,end:t})}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":"top"===n&&(h.end=t);break;case"SE-NW":"top"===n?h.end=t:h={start:t,end:o}}}return h}isDragged(){return this.dragged.length>0}}var pE=r(79401);function pS(){let{label:e="",colspan:t=1,origColspan:r=1,collapsible:i=!1,crossHiddenColumns:n=[],isCollapsed:o=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:h=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{label:e,colspan:t,origColspan:r,collapsible:i,isCollapsed:o,crossHiddenColumns:n,isHidden:s,isRoot:a,isPlaceholder:l,headerClassNames:h}}function pC(){return{label:"",isPlaceholder:!0}}function pR(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function pb(e,t){return e.get(pN(e,t))}function pT(e,t,r){return e.set(pN(e,t),r),r}function pN(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let pA=["label","collapsible"];var pI=new WeakMap,pM=new WeakMap,pO=new WeakMap;class px{constructor(){pR(this,pI,[]),pR(this,pM,0),pR(this,pO,1/0)}setColumnsLimit(e){pT(pO,this,e)}setData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];pT(pI,this,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,r=[];if(0===t)return r;(0,c.arrayEach)(e,e=>{let i=[],n=0;r.push(i),(0,c.arrayEach)(e,e=>{let r=pS();if((0,s.isObject)(e)){let{label:t,colspan:i,headerClassName:n}=e;r.label=(0,d.stringify)(t),"number"==typeof i&&i>1&&(r.colspan=i,r.origColspan=i),"string"==typeof n&&(r.headerClassNames=[...n.split(" ")])}else r.label=(0,d.stringify)(e);n+=r.origColspan;let o=!1;if(n>=t&&(r.colspan=r.origColspan-(n-t),r.origColspan=r.colspan,o=!0),i.push(r),r.colspan>1)for(let e=0;e<r.colspan-1;e++)i.push(pC());return!o})});let i=Math.max(...(0,c.arrayMap)(r,e=>e.length));return(0,c.arrayEach)(r,e=>{if(e.length<i){let t=(0,c.arrayMap)(Array(i-e.length),()=>pS());e.splice(e.length,0,...t)}}),r}(e,pb(pO,this))),pT(pM,this,pb(pI,this).length)}getData(){return pb(pI,this)}mergeWith(e){(0,c.arrayEach)(e,e=>{let{row:t,col:r,...i}=e,n=this.getHeaderSettings(t,r);null!==n&&(0,s.extend)(n,i,pA)})}map(e){(0,c.arrayEach)(pb(pI,this),t=>{(0,c.arrayEach)(t,t=>{let r=e({...t});(0,s.isObject)(r)&&(0,s.extend)(t,r,pA)})})}getHeaderSettings(e,t){var r;if(e>=pb(pM,this)||e<0)return null;let i=pb(pI,this)[e];return!1===Array.isArray(i)||t>=i.length?null:null!==(r=i[t])&&void 0!==r?r:null}getHeadersSettings(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=[];if(e>=pb(pM,this)||e<0)return i;let n=pb(pI,this)[e],o=0;for(let e=t;e<n.length;e++){let t=n[e];if(t.isPlaceholder)throw Error("The first column settings cannot overlap the other header layers");if(o+=t.colspan,i.push(t),t.colspan>1&&(e+=t.colspan-1),o===r)break;
52if(o>r)throw Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return pb(pM,this)}getColumnsCount(){return pb(pM,this)>0?pb(pI,this)[0].length:0}clear(){pT(pI,this,[]),pT(pM,this,0)}}function p_(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let pP="DF-pre-order",pL=new Map([[pP,function e(t,r){let i=t.call(r,this);for(let n=0;n<this.childs.length;n++){if(!1===i)return!1;i=e.call(this.childs[n],t,r)}return i}],["DF-post-order",function e(t,r){for(let i=0;i<this.childs.length;i++)if(!1===e.call(this.childs[i],t,r))return!1;return t.call(r,this)}],["BF",function(e,t){let r=[this];!function i(){if(0===r.length)return;let n=r.shift();r.push(...n.childs),!1!==e.call(t,n)&&i()}()}]]);class pk{constructor(e){p_(this,"data",{}),p_(this,"parent",null),p_(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=new pk({...e.data});for(let r=0;r<e.childs.length;r++)t.addChild(this.cloneTree(e.childs[r]));return t}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let t=0;t<e.childs.length;t++)this.addChild(e.childs[t])}walkDown(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"BF";if(!pL.has(t))throw Error(`Traversal strategy "${t}" does not exist`);pL.get(t).call(this,e,this)}walkUp(e){let t=this,r=i=>{!1!==e.call(t,i)&&null!==i.parent&&r(i.parent)};r(this)}}function pD(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function pH(e,t){return e.get(pB(e,t))}function pB(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var pF=new WeakMap,pV=new WeakMap,pU=new WeakMap;class pW{constructor(e){pD(this,pF,new Map),pD(this,pV,new Map),pD(this,pU,null),pU.set(pB(pU,this),e)}getRoots(){return Array.from(pH(pF,this).values())}getRootByColumn(e){let t;return pH(pV,this).has(e)&&(t=pH(pF,this).get(pH(pV,this).get(e))),t}getNode(e,t){let r;let i=this.getRootByColumn(t);if(!i)return;let n=t-pH(pV,this).get(t),o=0;return i.walkDown(i=>{let{data:{origColspan:s,headerLevel:a}}=i;if(e===a){if(n>=o&&n<=o+s-1)return(r=i).data.isRoot=t===r.data.columnIndex,!1;o+=s}}),r}rebuildTreeIndex(){let e=0;pH(pV,this).clear(),(0,c.arrayEach)(pH(pF,this),t=>{let[,{data:{colspan:r}}]=t;for(let t=e;t<e+r;t++)pH(pV,this).set(t,e);e+=r})}buildTree(){this.clear();let e=pH(pU,this).getColumnsCount(),t=0;for(;t<e;){let e=pH(pU,this).getHeaderSettings(0,t),r=new pk;pH(pF,this).set(t,r),this.buildLeaves(r,t,0,e.origColspan),t+=e.origColspan}this.rebuildTreeIndex()}buildLeaves(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=pH(pU,this).getHeadersSettings(r,t,i);r+=1,(0,c.arrayEach)(n,i=>{let n;let o={...i,headerLevel:r-1,columnIndex:t};1===r?(e.data=o,n=e):(n=new pk(o),e.addChild(n)),r<pH(pU,this).getLayersCount()&&this.buildLeaves(n,t,r,i.origColspan),t+=i.origColspan})}clear(){pH(pF,this).clear(),pH(pV,this).clear()}}function pj(e,t){e.walkDown(e=>{let{data:r,childs:i}=e;if(!r.isHidden&&(t(r.columnIndex),0===i.length))for(let e=1;e<r.colspan;e++)t(r.columnIndex+e)})}function pG(e,t){let{childs:r}=e;if(0!==r.length)return r[0].data[t]}function p$(e){return pG(e,"origColspan")===e.data.origColspan}function pz(e){let{data:t,childs:r}=e;if(!t.isCollapsed||t.isHidden||t.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(p$(e))return pz(r[0]);t.isCollapsed=!1;let i=r.slice(1),n=new Set,o=0;if(i.length>0)(0,c.arrayEach)(i,e=>{e.replaceTreeWith(e.data.clonedTree),e.data.clonedTree=null;let t=e.data;o+=t.colspan,pj(e,e=>{n.add(e)})});else{let{colspan:e,origColspan:r,columnIndex:i}=t;o=r-e;for(let e=1;e<r;e++)n.add(i+e)}return e.walkUp(e=>{let{data:t}=e;t.colspan+=o,t.colspan>=t.origColspan?(t.colspan=t.origColspan,t.isCollapsed=!1):p$(e)&&(t.isCollapsed=pG(e,"isCollapsed"))}),{rollbackModification:()=>pY(e),affectedColumns:Array.from(n),colspanCompensation:o}}function pY(e){var t;let{data:r,childs:i}=e;if(r.isCollapsed||r.isHidden||r.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(p$(e))return pY(i[0]);r.isCollapsed=!0;let n=i.slice(1),o=new Set;if(n.length>0)(0,c.arrayEach)(n,e=>{pj(e,e=>{o.add(e)}),e.data.clonedTree=e.cloneTree(),e.walkDown(e=>{let{data:t}=e;t.isHidden=!0})});else{let{origColspan:e,columnIndex:t}=r;for(let r=1;r<e;r++){let e=t+r;o.add(e)}}let s=r.colspan-(null!==(t=pG(e,"colspan"))&&void 0!==t?t:1);return e.walkUp(e=>{let{data:t}=e;t.colspan-=s,t.colspan<=1?(t.colspan=1,t.isCollapsed=!0):p$(e)&&(t.isCollapsed=pG(e,"isCollapsed"))}),{rollbackModification:()=>pz(e),affectedColumns:Array.from(o),colspanCompensation:s}}let pK=new Map([["collapse",pY],["expand",pz],["hide-column",function(e,t){if(!Number.isInteger(t))throw Error("The passed gridColumnIndex argument has invali
52d type.");if(e.childs.length>0)throw Error((0,rJ.e)`The passed node is not the last node on the tree. Only for\x20
53the last node, the hide column modification can be applied.`);let{crossHiddenColumns:r}=e.data;if(r.includes(t))return;let i=!1;e.walkUp(e=>{let{data:{collapsible:t}}=e;if(t)return i=!0,!1}),i||e.walkUp(e=>{let{data:r}=e;r.crossHiddenColumns.push(t),r.colspan>1?r.colspan-=1:r.isHidden=!0})}],["show-column",function(e,t){if(!Number.isInteger(t))throw Error("The passed gridColumnIndex argument has invalid type.");if(e.childs.length>0)throw Error((0,rJ.e)`The passed node is not the last node on the tree. Only for\x20
54the last node, the show column modification can be applied.`);let{crossHiddenColumns:r}=e.data;if(!r.includes(t))return;let i=!1;e.walkUp(e=>{let{data:{collapsible:t}}=e;if(t)return i=!0,!1}),i||e.walkUp(e=>{let{data:r}=e;r.crossHiddenColumns.splice(r.crossHiddenColumns.indexOf(t),1),!r.isHidden&&r.colspan<r.origColspan&&(r.colspan+=1),r.isHidden=!1})}]]);function pX(e){let t=[];return(0,c.arrayEach)(e,e=>{e.walkDown(e=>{let r;let i=e.data,{origColspan:n,columnIndex:o,headerLevel:s,crossHiddenColumns:a}=i,l=(Array.isArray(t[s])?r=t[s]:(r=[],t[s]=r),r),h=!1;for(let e=o;e<o+n;e++)if(a.includes(e)||h)l.push(pC(i));else{let e=function(e){let{crossHiddenColumns:t,...r}=pS(e);return r}(i);e.isRoot=!0,l.push(e),h=!0}})}),t}function pq(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function pZ(e,t,r){return e.set(pJ(e,t),r),r}function pQ(e,t){return e.get(pJ(e,t))}function pJ(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var p0=new WeakMap,p1=new WeakMap,p2=new WeakMap;class p5{constructor(){pq(this,p0,new px),pq(this,p1,new pW(pQ(p0,this))),pq(this,p2,[[]])}setState(e){pQ(p0,this).setData(e);let t=!1;try{pQ(p1,this).buildTree()}catch(e){pQ(p1,this).clear(),pQ(p0,this).clear(),t=!0}return pZ(p2,this,pX(pQ(p1,this).getRoots())),t}setColumnsLimit(e){pQ(p0,this).setColumnsLimit(e)}mergeStateWith(e){let t=(0,c.arrayMap)(e,e=>{let{row:t,...r}=e;return{row:t<0?this.rowCoordsToLevel(t):t,...r}});pQ(p0,this).mergeWith(t),pQ(p1,this).buildTree(),pZ(p2,this,pX(pQ(p1,this).getRoots()))}mapState(e){pQ(p0,this).map(e),pQ(p1,this).buildTree(),pZ(p2,this,pX(pQ(p1,this).getRoots()))}mapNodes(e){return(0,c.arrayReduce)(pQ(p1,this).getRoots(),(t,r)=>(r.walkDown(r=>{let i=e(r.data);void 0!==i&&t.push(i)}),t),[])}triggerNodeModification(e,t,r){let i;t<0&&(t=this.rowCoordsToLevel(t));let n=pQ(p1,this).getNode(t,r);return n&&(i=function(e,t,r){if(!pK.has(e))throw Error(`The node modifier action ("${e}") does not exist.`);return pK.get(e)(t,r)}(e,n,r),pZ(p2,this,pX(pQ(p1,this).getRoots()))),i}triggerColumnModification(e,t){return this.triggerNodeModification(e,-1,t)}rowCoordsToLevel(e){if(e>=0)return null;let t=e+Math.max(this.getLayersCount(),1);return t<0?null:t}levelToRowCoords(e){if(e<0)return null;let t=e-Math.max(this.getLayersCount(),1);return t>=0?null:t}getHeaderSettings(e,t){var r,i;return(e<0&&(e=this.rowCoordsToLevel(e)),null===e||e>=this.getLayersCount())?null:null!==(r=null===(i=pQ(p2,this)[e])||void 0===i?void 0:i[t])&&void 0!==r?r:null}getHeaderTreeNodeData(e,t){let r=this.getHeaderTreeNode(e,t);return r?{...r.data}:null}getHeaderTreeNode(e,t){return(e<0&&(e=this.rowCoordsToLevel(e)),null===e||e>=this.getLayersCount())?null:pQ(p1,this).getNode(e,t)||null}findTopMostEntireHeaderLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=t-e+1,i=!1,n=null;for(let o=e;o<=t;o++){let s=pQ(p1,this).getRootByColumn(o);if(!s)break;i=!0,s.walkDown(i=>{let{columnIndex:o,headerLevel:s,origColspan:a,isHidden:l}=i.data;!l&&a<=r&&o>=e&&o+a-1<=t&&(null===n||s<n)&&(n=s)},pP)}return i&&null===n?-1:this.levelToRowCoords(null!=n?n:0)}findLeftMostColumnIndex(e,t){var r,i;let{isRoot:n}=null!==(r=this.getHeaderSettings(e,t))&&void 0!==r?r:{isRoot:!0};if(n)return t;let o=t-1;for(;o>=0;){let{isRoot:t}=null!==(i=this.getHeaderSettings(e,o))&&void 0!==i?i:{isRoot:!0};if(t)break;o-=1}return o}findRightMostColumnIndex(e,t){var r,i;let{isRoot:n,origColspan:o}=null!==(r=this.getHeaderSettings(e,t))&&void 0!==r?r:{isRoot:!0,origColspan:1};if(n)return t+o-1;let s=t+1;for(;s<this.getColumnsCount();){let{isRoot:t}=null!==(i=this.getHeaderSettings(e,s))&&void 0!==i?i:{isRoot:!0};if(t)break;s+=1}return s-1}getLayersCount(){return pQ(p0,this).getLayersCount()}getColumnsCount(){return pQ(p0,this).getColumnsCount()}clear(){pZ(p2,this,[]),pQ(p0,this).clear(),pQ(p1,this).clear()}}function p3(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class p9{constructor(e,t){p3(this,"hot",void 0),p3(this,"nestedHeaderSettingsGetter",void 0),p3(this,"layersCount",0),p3(this,"container",void 0),p3(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=t,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(){let 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);let t=this.container.querySelectorAll("tr:last-of-type th"),r=t.length;this.widthsMap.clear();for(let e=0;e<r;e++){let r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e),i=this.hot.toPhysicalColumn(r);this.widthsMap.setValueAtIndex(i,t[e].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){let{rootDocument:t,columnIndexMapper:r}=this.hot,i=t.createDocumentFragment(),o=t.createElement("table"),s=!!this.hot.getSettings().dropdownMenu,a=r.getRenderableIndexesLength();for(let e=0;e<this.layersCount;e++){let i=t.createElement("tr");for(let o=0;o<a;o++){let a=r.getVisualFromRenderableIndex(o);null===a&&(a=o);let l=t.createElement("th"),h=this.nestedHeaderSettingsGetter(e,a);if(h&&(!h.isPlaceholder||h.isHidden)){let e=h.label;s&&(e+='<button class="changeType"></button>'),(0,n.fastInnerHTML)(l,e),l.colSpan=h.colspan,i.appendChild(l)}}o.appendChild(i)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function p4(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p7(e,t,r){p8(e,t),t.set(e,r)}function p8(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function p6(e,t,r){return e.set(ft(e,t),r),r}function fe(e,t){return e.get(ft(e,t))}function ft(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let fr="nestedHeaders";var fi=new WeakMap,fn=new WeakMap,fo=new WeakMap,fs=new WeakMap,fa=new WeakMap,fl=new WeakMap,fh=new WeakSet;class fu extends tn.vq{constructor(){super(...arguments),p8(this,fh),fh.add(this),p7(this,fi,new p5),p7(this,fn,null),p7(this,fo,null),p7(this,fs,!1),p7(this,fa,null),p4(this,"ghostTable",new p9(this.hot,(e,t)=>this.getHeaderSettings(e,t))),p4(this,"detectedOverlappedHeaders",!1),p7(this,fl,()=>{var e;let t=null===(e=this.hot)||void 0===e?void 0:e.getSelectedRangeActive();if(!t)return;let{highlight:r}=t;if(r.isHeader()&&r.col>=0){let e=fe(fi,this).findLeftMostColumnIndex(r.row,r.col),t=this.hot.selection.highlight.getFocus();t.visualCellRange.highlight.col=e,t.visualCellRange.from.col=e,t.visualCellRange.to.col=e,t.commit()}})}static get PLUGIN_KEY(){return fr}static get PLUGIN_PRIORITY(){return 280}isEnabled(){return!!this.hot.getSettings()[fr]}enablePlugin(){var e=this;if(this.enabled)return;let{nestedHeaders:t}=this.hot.getSettings();Array.isArray(t)&&Array.isArray(t[0])||(0,rE.ZK)((0,rJ.e)`Your Nested Headers plugin configuration is invali
54d. The settings has to be\x20
55                        passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>ft(fh,this,fN).call(this)),this.addHook("afterLoadData",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fA).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fp).call(e,...r)}),this.addHook("afterOnCellMouseDown",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,ff).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fm).call(e,...r)}),this.addHook("beforeOnCellMouseUp",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fy).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fv).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fw).call(e,...r)}),this.addHook("afterSelection",()=>fe(fl,this).call(this)),this.addHook("afterSelectionFocusSet",()=>fe(fl,this).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fc).call(e,...r)}),this.addHook("afterGetColumnHeaderRenderers",e=>ft(fh,this,fS).call(this,e)),this.addHook("modifyColWidth",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fR).call(e,...r)}),this.addHook("modifyColumnHeaderValue",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fb).call(e,...r)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fd).call(e,...r)}),this.addHook("beforeCopy",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fg).call(e,...r)}),this.addHook("beforeSelectColumns",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fE).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fC).call(e,...r)}),this.addHook("modifyFocusedElement",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ft(fh,e,fT).call(e,...r)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",fe(fl,this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",fe(fl,this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;let{nestedHeaders:e}=this.hot.getSettings();fe(fi,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=fe(fi,this).setState(e)),this.detectedOverlappedHeaders&&(0,rE.ZK)((0,rJ.e)`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
56                        is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEac
56h((e,t)=>{fe(fi,this).triggerColumnModification(!0===e?"hide-column":"show-column",t)}),!fe(fn,this)&&this.enabled&&p6(fn,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(e=>{e.forEach(e=>{let{op:t,index:r,newValue:i}=e;"replace"===t&&fe(fi,this).triggerColumnModification(!0===i?"hide-column":"show-column",r)}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.removeLocalHook("cacheUpdated",fe(fl,this)),this.hot.columnIndexMapper.removeLocalHook("cacheUpdated",fe(fl,this)),this.clearColspans(),fe(fi,this).clear(),fe(fn,this).unsubscribe(),p6(fn,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return fe(fi,this)}getLayersCount(){return fe(fi,this).getLayersCount()}getHeaderSettings(e,t){return fe(fi,this).getHeaderSettings(e,t)}clearColspans(){if(!this.hot.view)return;let{_wt:e}=this.hot.view,t=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let e=0;e<t;e++){let t=r.childNodes[e];if(!t)break;let s=i.childNodes[e],a=o?o.childNodes[e]:null;for(let e=0,r=t.childNodes.length;e<r;e++)t.childNodes[e].removeAttribute("colspan"),(0,n.removeClass)(t.childNodes[e],"hiddenHeader"),s&&s.childNodes[e]&&(s.childNodes[e].removeAttribute("colspan"),(0,n.removeClass)(s.childNodes[e],"hiddenHeader")),o&&a&&a.childNodes[e]&&(a.childNodes[e].removeAttribute("colspan"),(0,n.removeClass)(a.childNodes[e],"hiddenHeader"))}}headerRendererFactory(e){var t=this;let r=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,o)=>{var s,a,l,h;let{columnIndexMapper:u,view:c}=this.hot,d=u.getVisualFromRenderableIndex(i);null===d&&(d=i),o.removeAttribute("colspan"),(0,n.removeClass)(o,"hiddenHeader"),(0,n.removeClass)(o,"hiddenHeaderText");let{colspan:g,isHidden:p,isPlaceholder:f,headerClassNames:m}=null!==(s=fe(fi,this).getHeaderSettings(e,d))&&void 0!==s?s:{label:""};if(f||p)(0,n.addClass)(o,"hiddenHeader");else if(g>1){let{wtOverlays:e}=c._wt,t=null===(a=e.topInlineStartCornerOverlay)||void 0===a?void 0:a.clone.wtTable.THEAD.contains(o),s=null===(l=e.inlineStartOverlay)||void 0===l?void 0:l.clone.wtTable.THEAD.contains(o);(null===(h=e.topOverlay)||void 0===h?void 0:h.clone.wtTable.THEAD.contains(o))&&d<r&&(0,n.addClass)(o,"hiddenHeaderText");let u=t||s?Math.min(g,r-i):g;u>1&&o.setAttribute("colspan",u)}if(this.hot.view.appendColHeader(d,o,function(){return t.getColumnHeaderValue(...arguments)},e),!f&&!p){let e=o.querySelector("div.relative");e&&m&&m.length>0&&((0,n.removeClass)(e,this.hot.getColumnMeta(d).headerClassName),(0,n.addClass)(e,m))}}}getColumnHeaderValue(e,t){var r;let{isHidden:i,isPlaceholder:n}=null!==(r=fe(fi,this).getHeaderSettings(t,e))&&void 0!==r?r:{};return n||i?"":this.hot.getColHeader(e,t)}destroy(){p6(fi,this,null),null!==fe(fn,this)&&(fe(fn,this).unsubscribe(),p6(fn,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0)&&!(e.col<0))return fe(fi,this).getHeaderTreeNodeData(e.row,e.col)}}function fc(e,t){var r;let i=this.hot.getSelectedRangeActive();if(!i)return e;let{highlight:n}=i,{navigableHeaders:o}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=o?n.row:null===(r=fe(fa,this))||void 0===r?void 0:r.row,l=s?e:n.col,h=a<0&&l>=0;if(p6(fa,this,null),!h)return e;let u=this.hot.getFirstFullyVisibleColumn(),c=this.hot.getLastFullyVisibleColumn(),d=c-u+1,g=fe(fi,this).findLeftMostColumnIndex(a,l),p=fe(fi,this).findRightMostColumnIndex(a,l),f=p-g+1;if(g<u&&p>c)return g;if(s){let e=null;return g>=u&&p>c?f>d?(t.value="start",e=g):(t.value="end",e=p):g<u&&p<=c&&(f>d?(t.value="end",e=p):(t.value="start",e=g)),e}return g<=u?g:p}function fd(e,t,r){let i=fe(fi,this).getHeaderTreeNodeData(t,e);if(!i)return e;let{columnCursor:n,selectionType:o,selectionWidth:s}=r,{isRoot:a,colspan:l}=fe(fi,this).getHeaderSettings(t,e);if(o===pE.Nc){if(!a)return i.columnIndex}else if(o===pE.CD&&(l>s-n||!a))return null;return e}
56function fg(e,t,r){let{columnHeadersCount:i}=r;if(0!==i)for(let r=0;r<t.length;r++){let{startRow:i,startCol:o,endRow:s,endCol:a}=t[r],l=s-i+1,h=o-a+1;if(i>=0||1===h)break;for(let t=o;t<=a;t++)for(let r=i;r<=s;r++){var n;let i=l+r,s=t-o;0!==s&&!1===(null===(n=fe(fi,this).getHeaderTreeNodeData(r,t))||void 0===n?void 0:n.isRoot)&&(e[i][s]="")}}}function fp(e,t,r,i){this._getHeaderTreeNodeDataByCoords(t)&&(i.column=!0)}function ff(e,t){let r=this._getHeaderTreeNodeDataByCoords(t);if(!r)return;p6(fo,this,t.clone()),p6(fs,this,!0);let{selection:i}=this.hot,n=i.isSelected()?i.getSelectedRange().current():null,s=[],{columnIndex:a,origColspan:l}=r,h=!i.inInSelection(t);e.shiftKey&&n?t.col<n.from.col?s.push(n.getTopEndCorner().col,a,t.row):t.col>n.from.col?s.push(n.getTopStartCorner().col,a+l-1,t.row):s.push(a,a+l-1,t.row):((0,o.isLeftClick)(e)||(0,o.isRightClick)(e)&&h||(0,o.isTouchEvent)(e))&&s.push(a,a+l-1,t.row),i.selectColumns(...s)}function fm(e,t,r,i){if(!this.hot.view.isMouseDown()||i.column)return;let n=this._getHeaderTreeNodeDataByCoords(t);if(!n)return;let{columnIndex:o,origColspan:s}=n,a=this.hot.getSelectedRangeActive(),l=a.getTopStartCorner(),h=a.getBottomEndCorner(),{from:u}=a;i.column=!0,i.cell=!0;let c=[],d=(0,eH.clamp)(t.row,-1/0,-1);t.col<u.col?c.push(h.col,o,d):t.col>u.col?c.push(l.col,o+s-1,d):c.push(o,o+s-1,d),this.hot.selection.selectColumns(...c)}function fy(){p6(fs,this,!1)}function fv(){let{navigableHeaders:e}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!fe(fs,this)||!e)return;let t=this.hot.getSelectedRangeLast(),r=t.getTopStartCorner().col,i=t.getBottomEndCorner().col,{columnIndex:n,origColspan:o}=fe(fi,this).getHeaderTreeNodeData(fe(fo,this).row,fe(fo,this).col);if(t.setHighlight(fe(fo,this)),o>t.getWidth()||n<r||n+o-1>i){let e=fe(fi,this).findTopMostEntireHeaderLevel((0,eH.clamp)(r,n,n+o-1),(0,eH.clamp)(i,n,n+o-1));t.highlight.row=e,t.highlight.col=t.from.col}}function fw(e){let{highlight:t}=this.hot.getSelectedRangeActive(),r=this.hot._createCellCoords(t.row+e.row,t.col+e.col);if(!(r.isHeader()&&r.col>=0))return;let i=fe(fi,this).findLeftMostColumnIndex(r.row,r.col),n=fe(fi,this).findRightMostColumnIndex(r.row,r.col);if(e.col<0){let r=t.col>=i&&t.col<=n?i-1:n,o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r,-1);null===o?e.col=-this.hot.view.countRenderableColumnsInRange(0,t.col):e.col=-Math.max(this.hot.view.countRenderableColumnsInRange(o,t.col)-1,1)}else if(e.col>0){let r=t.col>=i&&t.col<=n?n+1:i,o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r,1);null===o?e.col=this.hot.view.countRenderableColumnsInRange(t.col,this.hot.countCols()):e.col=Math.max(this.hot.view.countRenderableColumnsInRange(t.col,o)-1,1)}}function fE(e,t,r){let i=e.row,n=this._getHeaderTreeNodeDataByCoords({row:i,col:e.col}),o=this._getHeaderTreeNodeDataByCoords({row:i,col:t.col});p6(fa,this,r.clone()),t.col<e.col?(n&&(e.col=n.columnIndex+n.origColspan-1),o&&(t.col=o.columnIndex)):t.col>=e.col&&(n&&(e.col=n.columnIndex),o&&(t.col=o.columnIndex+o.origColspan-1))}function fS(e){if(fe(fi,this).getLayersCount()>0){e.length=0;for(let t=0;t<fe(fi,this).getLayersCount();t++)e.push(this.headerRendererFactory(t))}}function fC(e){let t=fe(fi,this).getLayersCount(),r=e.startColumn,i=!!t;for(let n=0;n<t;n++){let t=fe(fi,this).findLeftMostColumnIndex(n,e.startColumn),o=this.hot.columnIndexMapper.getRenderableFromVisualIndex(t);if(t>=0&&(i=!1),(0,eH.isNumeric)(o)&&o<e.startColumn){r=o;break}}e.startColumn=i?fe(fi,this).getHeaderTreeNodeData(0,r).columnIndex:r}function fR(e,t){let r=this.ghostTable.getWidth(t);return e>r?e:r}function fb(e,t,r){var i;let{label:n}=null!==(i=fe(fi,this).getHeaderTreeNodeData(r,t))&&void 0!==i?i:{label:""};return n}function fT(e,t){if(e<0)return this.hot.getCell(e,fe(fi,this).findLeftMostColumnIndex(e,t),!0)}function fN(){this.updatePlugin()}function fA(e,t){t||this.updatePlugin()}function fI(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class fM{constructor(e,t){fI(this,"hot",void 0),fI(this,"data",null),fI(this,"plugin",void 0),fI(this,"parentReference",new WeakMap),fI(this,"cac
56he",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=t,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},(0,eH.rangeEach)(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,t,r){this.cache.levels[t]||(this.cache.levels[t]=[],this.cache.levelCount+=1),this.cache.levels[t].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:r,row:this.cache.rows.length-1,level:t}),this.hasChildren(e)&&(0,c.arrayEach)(e.__children,r=>{this.cacheNode(r,t+1,e)})}getDataObject(e){return null==e?null:this.cache.rows[e]}readTreeNodes(e,t,r,i){let n=!1,o=t;if(isNaN(o)&&o.end)return o;let s=e;return(s||(s={__children:this.data},n=!0,o-=1),null!=r&&o===r)?{result:s,end:!0}:null!=i&&s===i?{result:o,end:!0}:(o+=1,s.__children&&(0,c.arrayEach)(s.__children,e=>{if(this.parentReference.set(e,n?null:s),isNaN(o=this.readTreeNodes(e,o,r,i))&&o.end)return!1}),o)}mockParent(){let e=this.mockNode();return e.__children=this.data,e}mockNode(){let e={};return(0,s.objectEach)(this.data[0],(t,r)=>{e[r]=null}),e}getRowIndex(e){return null==e?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let t=null;t=isNaN(e)?e:this.getDataObject(e);let r=this.getRowParent(e);return null==r?this.data.indexOf(t):r.__children.indexOf(t)}countAllRows(){let e={__children:this.data};return this.countChildren(e)}countChildren(e){let t=0,r=e;return(isNaN(r)||(r=this.getDataObject(r)),r&&r.__children)?((0,c.arrayEach)(r.__children,e=>{t+=1,e.__children&&(t+=this.countChildren(e))}),t):0}getRowParent(e){let t;return t=isNaN(e)?e:this.getDataObject(e),this.getRowObjectParent(t)}getRowObjectParent(e){return e&&"object"==typeof e?this.cache.nodeInfo.get(e).parent:null}getRowLevel(e){let t=null;return(t=isNaN(e)?e:this.getDataObject(e))?this.getRowObjectLevel(t):null}getRowObjectLevel(e){return null==e?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let t=e;return isNaN(t)||(t=this.getDataObject(t)),!!(t.__children&&t.__children.length)}isChild(e){return null!==this.getRowParent(e)}getChild(e,t){var r;return(null===(r=e.__children)||void 0===r?void 0:r[t])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var t;let r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&!!r.__children&&(null===(t=r.__children)||void 0===t?void 0:t.length)!==0}addChild(e,t){let r=t;this.hot.runHooks("beforeAddChild",e,r);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let n=e;e||(n=this.mockParent()),n.__children||(n.__children=[]),r||(r=this.mockNode()),n.__children.push(r),this.rewriteCache();let o=this.getRowIndex(r);this.hot.rowIndexMapper.insertIndexes(o,1),this.hot.runHooks("afterCreateRow",o,1),this.hot.runHooks("afterAddChild",e,r)}addChildAtIndex(e,t,r){let i,n=r;if(n||(n=this.mockNode()),this.hot.runHooks("beforeAddChild",e,n,t),e){let r=this.getRowIndex(e)+t+1;this.hot.runHooks("beforeCreateRow",r,1),e.__children.splice(t,null,n),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(r,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",r,1),i=r}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",t,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),i=this.getRowIndex(this.data[t]);n=this.getDataObject(i),this.hot.runHooks("afterAddChild",e,n,t)}addSibling(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"below",r=this.translateTrimmedRow(e),i=this.getRowParent(r),n=this.getRowIndexWithinParent(r);switch(t){case"below":this.addChildAtIndex(i,n+1,null);break;case"above":this.addChildAtIndex(i,n,null)}}detachFromParent(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=null,i=[];Array.isArray(e)?((0,eH.rangeEach)(e[0],e[2],e=>{let t=this.translateTrimmedRow(e);i.push(this.getDataObject(t))}),(0,eH.rangeEach)(0,i.length-2,e=>{this.detachFromParent(i[e],!1)}
56),r=i[i.length-1]):r=e;let n=this.getRowIndex(r),o=this.countChildren(r),s=this.getRowIndexWithinParent(r),a=this.getRowParent(r),l=this.getRowParent(a),h=this.getRowIndex(l),u=null;if(this.hot.runHooks("beforeDetachChild",a,r),null!=s){let e=Array.from(Array(n+o+1).keys()).splice(-1*(o+1));if(this.hot.runHooks("beforeRemoveRow",n,o+1,e,this.plugin.pluginName),a.__children.splice(s,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",n,o+1,e,this.plugin.pluginName),l){u=h+this.countChildren(l);let e=this.getChild(l,this.countChildren(l)-1),t=this.getRowIndex(e);this.hot.runHooks("beforeCreateRow",t+1,o+1,this.plugin.pluginName),l.__children.push(r)}else u=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",u-2,o+1,this.plugin.pluginName),this.data.push(r)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",u-2,o+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",a,r,this.getRowIndex(r)),t&&this.hot.render()}filterData(e,t,r){let i=[];(0,c.arrayEach)(r,e=>{i.push(this.getDataObject(e))}),(0,c.arrayEach)(i,e=>{let t=this.getRowIndexWithinParent(e),r=this.getRowParent(e);null===r?this.data.splice(t,1):r.__children.splice(t,1)}),this.rewriteCache()}spliceData(e,t,r){let i=this.getDataObject(e-1),n=null,o=e;i&&i.__children&&0===i.__children.length?(n=i,o=0):e<this.countAllRows()&&(n=this.getRowParent(e),o=this.getRowIndexWithinParent(e)),n?r?n.__children.splice(o,t,...r):n.__children.splice(o,t):r?this.data.splice(o,t,...r):this.data.splice(o,t),this.rewriteCache()}syncRowWithRawSource(e){let t=e,r=t;do null!==(r=this.getRowParent(r))&&(t=r);while(null!==r);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(t),"__children",t.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,t,r,i){let n=t===this.hot.countRows(),o=this.getRowParent(e),s=this.getRowIndexWithinParent(e),a=o.__children.slice(s,s+1),l=e>t,h=n?this.getRowParent(t-1):this.getRowParent(t);null==h&&(h=this.getRowParent(t-1)),null==h&&(h=this.getDataObject(t-1)),h?h.__children||(h.__children=[]):(h=this.getDataObject(t)).__children=[];let u=n||r||i?h.__children.length:this.getRowIndexWithinParent(t),c=o===h;h.__children.splice(u,0,a[0]),o.__children.splice(s+(l&&c?1:0),1),this.syncRowWithRawSource(o),c||this.syncRowWithRawSource(h)}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 fO(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class fx{constructor(e,t){fO(this,"hot",void 0),fO(this,"plugin",void 0),this.hot=t,this.plugin=e}}var f_=fx;class fP extends f_{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,t){super(e,t),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,t){let r=this.hot.toPhysicalRow(e),i=this.dataManager.getDataObject(r);if(!i)return;let o=this.dataManager.getRowLevel(r),s=t.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),h=this.hot.getSettings().ariaTags;if((0,c.arrayEach)(l,e=>{e&&s.removeChild(e)}),(0,n.addClass)(t,fP.CSS_CLASSES.indicatorContainer),o){let{rootDocument:e}=this.hot,t=a.cloneNode(!0);s.innerHTML="",(0,eH.rangeEach)(0,o-1,()=>{let t=e.createElement("SPAN");(0,n.addClass)(t,fP.CSS_CLASSES.emptyIndicator),s.appendChild(t)}),s.appendChild(t)}if(this.dataManager.hasChildren(i)){let e=this.hot.rootDocument.createElement("DIV");h&&(0,n.setAttribute)(e,[(0,m.cV)()]),(0,n.addClass)(t,fP.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?((0,n.addClass)(e,`${fP.CSS_CLASSES.button} ${fP.CSS_CLASSES.expandButton}`),h&&(0,n.setAttribute)(t,[(0,m.JV)(!1)])):((0,n.addClass)(e,`${fP.CSS_CLASSES.button} ${fP.CSS_CLASSES.collapseButton}`),h&&(0,n.setAttribute)(t,[(0,m.JV)(!0)])),s.appendChild(e)}}updateRowHeaderWidth(e){let t=e;t||(t=this.dataManager.cache.levelCount);let r=11;this.hot.stylesHandler.isClassicTheme()||(r=2*this.hot.stylesHandler.getCSSVariableValue("cell-horizontal-padding")),this.rowHeaderWidthCache=Math.max(50,r+10*t+25),this.hot.render()}}class fL extends f_{constructor(e,t){var r;super(e,t),r=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r.lastCollapsedRows=r.collapsedRows.slice(0),r.expandMultipleChildren(r.lastCollapsedRows,e)},shiftStash:function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;null==t&&(t=1/0),(0,c.arrayEach)(r.lastCollapsedRows,(n,o)=>{n>=e&&n<t&&(r.lastCollapsedRows[o]=n+i)})},applyStash:function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];r.collapseMultipleChildren(r.lastCollapsedRows,e),r.lastCollapsedRows=void 0},trimStash:(e,t)=>{(0,eH.rangeEach)(e,e+t-1,e=>{let t=this.lastCollapsedRows.indexOf(e);t>-1&&this.lastCollapsedRows.splice(t,1)})}}}collapseChildren(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=[],n=null,o=null,s=null;return isNaN(e)?(n=e,o=this.dataManager.getRowIndex(n)):(n=this.dataManager.getDataObject(e),o=e),this.dataManager.hasChildren(n)&&(0,c.arrayEach)(n.__children,e=>{i.push(this.dataManager.getRowIndex(e))}),s=this.collapseRows(i,!0,!1),r&&this.trimRows(s),t&&this.renderAndAdjust(),-1===this.collapsedRows.indexOf(o)&&this.collapsedRows.push(o),s}collapseMultipleChildren(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=[];(0,c.arrayEach)(e,e=>{i.push(...this.collapseChildren(e,!1,!1))}),r&&this.trimRows(i),t&&this.renderAndAdjust()}collapseRow(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.collapseRows([e],t)}collapseRows(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[];return(0,c.arrayEach)(e,e=>{i.push(e),t&&this.collapseChildRows(e,i)}),r&&this.trimRows(i),i}collapseChildRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];arguments.length>2&&arguments[2];let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.dataManager.hasChildren(e)){let r=this.dataManager.getDataObject(e);(0,c.arrayEach)(r.__children,e=>{let r=this.dataManager.getRowIndex(e);t.push(r),this.collapseChildRows(r,t)})}r&&this.trimRows(t)}expandRow(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.expandRows([e],t)}expandRows(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[];return(0,c.arrayEach)(e,e=>{i.push(e),t&&this.expandChildRows(e,i)}),r&&this.untrimRows(i),i}expandChildRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];arguments.length>2&&arguments[2];let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.dataManager.hasChildren(e)){let r=this.dataManager.getDataObject(e);(0,c.arrayEach)(r.__children,e=>{if(!this.isAnyParentCollapsed(e)){let r=this.dataManager.getRowIndex(e);t.push(r),this.expandChildRows(r,t)}})}r&&this.untrimRows(t)}expandChildren(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=[],n=null,o=null,s=null;return isNaN(e)?(n=e,o=this.dataManager.getRowIndex(e)):(n=this.dataManager.getDataObject(e),o=e),this.collapsedRows.splice(this.collapsedRows.indexOf(o),1),this.dataManager.hasChildren(n)&&(0,c.arrayEach)(n.__children,e=>{let t=this.dataManager.getRowIndex(e);i.push(t)}),s=this.expandRows(i,!0,!1),r&&this.untrimRows(s),t&&this.renderAndAdjust(),s}expandMultipleChildren(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=[];(0,c.arrayEach)(e,e=>{i.push(...this.expandChildren(e,!1,!1))}),r&&this.untrimRows(i),t&&this.renderAndAdjust()}collapseAll(){let e=this.dataManager.getData(),t=[];(0,c.arrayEach)(e,e=>{this.dataManager.hasChildren(e)&&t.push(e)}),this.collapseMultipleChildren(t),this.renderAndAdjust()}
56expandAll(){let e=this.dataManager.getData(),t=[];(0,c.arrayEach)(e,e=>{this.dataManager.hasChildren(e)&&t.push(e)}),this.expandMultipleChildren(t),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{(0,c.arrayEach)(e,e=>{this.plugin.collapsedRowsMap.setValueAtIndex(e,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{(0,c.arrayEach)(e,e=>{this.plugin.collapsedRowsMap.setValueAtIndex(e,!1)})},!0)}areChildrenCollapsed(e){let t=isNaN(e)?e:this.dataManager.getDataObject(e),r=!0;return null===t&&(t={__children:this.dataManager.data}),this.dataManager.hasChildren(t)&&(0,c.arrayEach)(t.__children,e=>{let t=this.dataManager.getRowIndex(e);if(!this.plugin.collapsedRowsMap.getValueAtIndex(t))return r=!1,!1}),r}isAnyParentCollapsed(e){let t=e;for(;null!==t;){t=this.dataManager.getRowParent(t);let e=this.dataManager.getRowIndex(t);if(this.collapsedRows.indexOf(e)>-1)return!0}return!1}toggleState(e,t){if(t.col>=0)return;let r=this.translateTrimmedRow(t.row);(0,n.hasClass)(e.target,fP.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),(0,o.stopImmediatePropagation)(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.view.adjustElementsSize(),this.hot.render()}}var fk=new WeakMap;class fD extends f_{constructor(){var e,t,r,i;super(...arguments),e="dataManager",t=this.plugin.dataManager,(e="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string"))?i:i+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t,r={row_above:(e,t)=>{let r=t[t.length-1];this.dataManager.addSibling(r.start.row,"above")},row_below:(e,t)=>{let r=t[t.length-1];this.dataManager.addSibling(r.start.row,"below")}},function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,fk),fk.set(this,r)}appendOptions(e){let t=[{key:"add_child",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD)},callback:()=>{let e=this.dataManager.translateTrimmedRow(this.hot.getSelectedActive()[0]),t=this.dataManager.getDataObject(e);this.dataManager.addChild(t)},disabled:()=>{let e=this.hot.getSelectedActive();return!e||e[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(eA.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedActive())},disabled:()=>{let e=this.hot.getSelectedActive(),t=this.dataManager.translateTrimmedRow(e[0]);return!this.dataManager.getRowParent(t)||!e||e[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return(0,eH.rangeEach)(0,e.items.length-1,r=>{if(0===r)return(0,c.arrayEach)(t,(t,i)=>{e.items.splice(r+i,0,t)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return(0,eH.rangeEach)(0,e.items.length-1,t=>{let r=fk.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}(fk,this))[e.items[t].key];null!=r&&(e.items[t].callback=r)}),e}}function fH(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class fB{constructor(e){fH(this,"plugin",void 0),fH(this,"hot",void 0),fH(this,"dataManager",void 0),fH(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}
56onBeforeRowMove(e,t,r,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:t,dropIndex:r,movePossible:i}))return!1;this.movedToCollapsed=!1;let n=r===this.hot.countRows(),o=n?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(r),s=!0,a=e.map(e=>{if(!s)return!1;let t=this.dataManager.translateTrimmedRow(e);return s=this.shouldAllowMoving(t,o),t}),l=-1===a.indexOf(o);if(!s||!l)return!1;let h=this.getBaseParent(a),u=this.getTargetParent(n,o),c=h===u;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(u),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(a,o,c),this.moveRows(a,o,u),this.dataManager.rewriteCache(),this.moveCellsMeta(a,o),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,t,r,i,i&&this.isRowOrderChanged(e,t)),this.hot.render(),this.selectCells(e,r),!1}displayAPICompatibilityWarning(e){let{rows:t,finalIndex:r,dropIndex:i,movePossible:n}=e,o=!1;return(0,d.isUndefined)(i)&&((0,rE.ZK)((0,rJ.e)`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
57      when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",t,r,i,n,!1),o=!0),o}shouldAllowMoving(e,t){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===t||0===t)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,t){let r=this.dataManager.getRowParent(e?t-1:t);return null==r&&(r=this.dataManager.getRowParent(t-1)),r}shiftCollapsibleParentsLocations(e,t,r){r||(Math.max(...e)<=t?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],t,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(t,e[0],e.length))}moveRows(e,t,r){let i=t===this.dataManager.getRowIndex(r)+this.dataManager.countChildren(r)+1;this.hot.batchRender(()=>{e.forEach(e=>{this.dataManager.moveRow(e,t,this.movedToCollapsed,i)})})}moveCellsMeta(e,t){let r=[];e.forEach(e=>{r.push(this.hot.getCellMetaAtRow(e))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(t-(Math.max(...e)<t?r.length:0),0,...r)}selectCells(e,t){let r=e.length,i=0,n=0;if(this.movedToCollapsed){let o=null;o=e[r-1]<t?this.dataManager.translateTrimmedRow(t-r):this.dataManager.translateTrimmedRow(t);let s=this.dataManager.getRowParent(null===o?this.hot.countSourceRows()-1:o-1),a=this.dataManager.getRowIndex(s);n=i=this.dataManager.untranslateTrimmedRow(a)}else e[r-1]<t?i=(n=t-1)-r+1:n=(i=t)+r-1;this.hot.selectCells([[i,0,n,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,t){return e.some((e,r)=>e-r!==t)}}function fF(e,t,r){fV(e,t),t.set(e,r)}function fV(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function fU(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fW(e,t){return e.get(fG(e,t))}function fj(e,t,r){return e.set(fG(e,t),r),r}function fG(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let f$="nestedRows";var fz=new WeakMap,fY=new WeakMap,fK=new WeakSet;class fX extends tn.vq{constructor(){super(...arguments),fV(this,fK),fK.add(this),fU(this,"dataManager",null),fU(this,"headersUI",null),fU(this,"collapsedRowsMap",null),fF(this,fz,!1),fF(this,fY,!1)}static get PLUGIN_KEY(){return f$}static get PLUGIN_PRIORITY(){return 300}isEnabled(){return!!this.hot.getSettings()[f$]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new l0.n),this.dataManager=new fM(this,this.hot),this.collapsingUI=new fL(this,this.hot),this.headersUI=new fP(this,this.hot),this.contextMenuUI=new fD(this,this.hot),this.rowMoveController=new fB(this),this.addHook("afterInit",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f6).call(e,...r)}),this.addHook("beforeViewRender",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,me).call(e,...r)}),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 t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,fQ).call(e,...r)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,fJ).call(e,...r)}),this.addHook("afterGetRowHeader",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f0).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,fZ).call(e,...r)}),this.addHook("beforeRemoveRow",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f5).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f2).call(e,...r)}),this.addHook("beforeAddChild",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f3).call(e,...r)}),this.addHook("afterAddChild",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f9).call(e,...r)}),this.addHook("beforeDetachChild",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f4).call(e,...r)}),this.addHook("afterDetachChild",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f7).call(e,...r)}),this.addHook("modifyRowHeaderWidth",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f1).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,f8).call(e,...r)}),this.addHook("beforeRowMove",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return fG(fK,e,fq).call(e,...r)}),this.addHook("beforeLoadData",e=>fG(fK,this,mt).call(this,e)),this.addHook("beforeUpdateData",e=>fG(fK,this,mt).call(this,e)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();let e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{let{highlight:e}=this.hot.getSelectedRangeActive(),t=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(t)?this.collapsingUI.expandChildren(t):this.collapsingUI.collapseChildren(t),!1},runOnlyIf:()=>{var e,t;let r=null===(e=this.hot.getSelectedRangeActive())||void 0===e?void 0:e.highlight;return r&&(null===(t=this.hot.getSelectedRangeActive())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(r)&&-1===r.col&&r.row>=0},group:f$,relativeToGroup:a.II,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(f$)}disableCoreAPIModifiers(){fj(fY,this,!0)}enableCoreAPIModifiers(){fj(fY,this,!1)}onModifyRowData(e){if(!fW(fY,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!fW(fY,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,t,r){return!!(fW(fY,this)||this.dataManager.isRowHighestLevel(e))||(this.dataManager.spliceData(e,t,r),!1)}destroy(){super.destroy()}}
57function fq(e,t,r,i){return this.rowMoveController.onBeforeRowMove(e,t,r,i)}function fZ(e,t,r){this.collapsingUI.toggleState(e,t,r)}function fQ(e,t,r){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(r[0],t),this.collapsingUI.collapsedRowsStash.shiftStash(r[0],null,-1*t),this.dataManager.filterData(e,t,r),fj(fz,this,!0),this.dataManager.getData().slice()}function fJ(e){return this.contextMenuUI.appendOptions(e)}function f0(e,t){this.headersUI.appendLevelIndicators(e,t)}function f1(e){return Math.max(this.headersUI.rowHeaderWidthCache,e)}function f2(e,t,r,i){i!==this.pluginName&&this.hot._registerTimeout(()=>{fj(fz,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function f5(e,t,r){let i=Array.from(r.reduce((e,t)=>{if(this.dataManager.isParent(t)){let r=this.dataManager.getDataObject(t).__children;return e.add(t),Array.isArray(r)&&r.forEach(t=>e.add(this.dataManager.getRowIndex(t))),e}return e.add(t)},new Set));r.length=0,r.push(...i)}function f3(){this.collapsingUI.collapsedRowsStash.stash()}function f9(e,t){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(t)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function f4(){this.collapsingUI.collapsedRowsStash.stash()}function f7(e,t,r){this.collapsingUI.collapsedRowsStash.shiftStash(r,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function f8(){this.dataManager.rewriteCache()}function f6(){this.headersUI.updateRowHeaderWidth()}function me(e,t){fW(fz,this)&&(t.skipRender=!0)}function mt(e){if(!(0,la.isArrayOfObjects)(e)){(0,rE.vU)("The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled."),this.hot.getSettings()[f$]=!1,this.disablePlugin();return}this.dataManager.setData(e),this.dataManager.rewriteCache()}function mr(e,t,r){mi(e,t),t.set(e,r)}function mi(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function mn(e,t){return e.get(ms(e,t))}function mo(e,t,r){return e.set(ms(e,t),r),r}function ms(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}r(24029),r(46228);let ma=`
58<div data-ref="container" class="ht-pagination handsontable">
59  <div class="ht-pagination__inner">
60    <div data-ref="pageSizeSection" class="ht-page-size-section">
61      <span data-ref="pageSizeLabel" class="ht-page-size-section__label"></span>
62      <div class="ht-page-size-section__select-wrapper">
63        <select data-ref="pageSizeSelect" name="pageSize" data-hot-input></select>
64      </div>
65    </div>
66    <div data-ref="pageCounterSection" class="ht-page-counter-section"></div>
67    <nav data-ref="pageNavSection" class="ht-page-navigation-section">
68      <button data-ref="first" class="ht-page-navigation-section__button ht-page-first"></button>
69      <button data-ref="prev" class="ht-page-navigation-section__button ht-page-prev"></button>
70      <span data-ref="pageNavLabel" class="ht-page-navigation-section__label"></span>
71      <button data-ref="next" class="ht-page-navigation-section__button ht-page-next"></button>
72      <button data-ref="last" class="ht-page-navigation-section__button ht-page-last"></button>
73    </nav>
74  </div>
75</div>
76`;var ml=new WeakMap,mh=new WeakMap,mu=new WeakMap,mc=new WeakMap,md=new WeakMap,mg=new WeakMap,mp=new WeakMap,mf=new WeakMap,mm=new WeakSet;class my{constructor(e){let{rootElement:t,uiContainer:r,isRtl:i,themeName:n,phraseTranslator:o,shouldHaveBorder:s,a11yAnnouncer:a}=e;mi(this,mm),mm.add(this),mr(this,ml,void 0),mr(this,mh,void 0),mr(this,mu,!1),mr(this,mc,void 0),mr(this,md,void 0),mr(this,mg,void 0),mr(this,mp,void 0),mr(this,mf,void 0),mo(ml,this,t),mo(mh,this,r),mo(mu,this,i),mo(md,this,n),mo(mg,this,o),mo(mp,this,s),mo(mf,this,a),this.install()}install(){var e;if(null!==(e=mn(mc,this))&&void 0!==e&&e.container)return;let t=(0,rJ.d)`${ma}`,{container:r,first:i,prev:o,next:s,last:a,pageSizeSelect:l}=t.refs;mo(mc,this,t.refs),r.setAttribute("dir",mn(mu,this)?"rtl":"ltr"),r.tabIndex=-1;let h=e=>e.currentTarget.disabled,u=(e,t,r)=>{t.addEventListener(e,e=>{h(e)||r()})};u("click",i,()=>this.runLocalHooks("firstPageClick")),u("click",o,()=>
76this.runLocalHooks("prevPageClick")),u("click",s,()=>this.runLocalHooks("nextPageClick")),u("click",a,()=>this.runLocalHooks("lastPageClick")),l.addEventListener("change",()=>{let e="auto"===l.value?"auto":Number.parseInt(l.value,10);this.runLocalHooks("pageSizeChange",e)}),this.setCounterSectionVisibility(!1),this.setNavigationSectionVisibility(!1),this.setPageSizeSectionVisibility(!1),mn(mh,this)?(mn(mh,this).appendChild(t.fragment),(0,n.addClass)(r,[mn(md,this),"handsontable"])):mn(ml,this).after(t.fragment)}getContainer(){return mn(mc,this).container}getFocusableElements(){let{first:e,prev:t,next:r,last:i,pageSizeSelect:n}=mn(mc,this);return[n,e,t,r,i].filter(e=>!e.disabled)}updateWidth(e){return mn(mc,this).container.style.width=`${e}px`,this}updateTheme(e){if(mo(md,this,e),mn(mh,this)){let{container:e}=mn(mc,this);(0,n.removeClass)(e,/ht-theme-.*/g),mn(md,this)&&(0,n.addClass)(e,mn(md,this))}return this}getHeight(){return mn(mc,this).container.offsetHeight}refreshBorderState(){let{container:e}=mn(mc,this);return mn(mh,this)||mn(mp,this).call(this)?(0,n.addClass)(e,"ht-pagination--bordered"):(0,n.removeClass)(e,"ht-pagination--bordered"),this}updateState(e){let{currentPage:t,totalPages:r,firstVisibleRowIndex:i,lastVisibleRowIndex:o,totalRenderedRows:s,pageSizeList:a,pageSize:l,autoPageSize:h}=e,{first:u,prev:c,next:d,last:g,pageCounterSection:p,pageNavSection:f,pageNavLabel:y,pageSizeSelect:w,pageSizeLabel:E}=mn(mc,this),S=mn(mg,this).call(this,eA.PAGINATION_COUNTER_SECTION,{start:i+1,end:o+1,total:s}),C=mn(mg,this).call(this,eA.PAGINATION_NAV_SECTION,{currentPage:t,totalPages:r}),R=mn(mg,this).call(this,eA.PAGINATION_PAGE_SIZE_SECTION);p.textContent=S,y.textContent=C,w.textContent="",E.textContent=`${R}:`,(0,n.setAttribute)(f,[(0,m.QK)(mn(mg,this).call(this,eA.PAGINATION_SECTION))]),(0,n.setAttribute)(w,[(0,m.QK)(mn(mg,this).call(this,eA.PAGINATION_PAGE_SIZE_SECTION))]),mn(mf,this).call(this,C),this.refreshBorderState(),a.forEach(e=>{let t=new Option("auto"===e?mn(mg,this).call(this,eA.PAGINATION_PAGE_SIZE_AUTO):e,e);(h&&"auto"===e||!h&&e===l)&&(t.selected=!0),w.add(t)});let b=1===t,T=t===r;if("none"!==f.style.display){let e=mn(ml,this).ownerDocument.activeElement;b?((0,n.addClass)(u,"ht-page-navigation-section__button--disabled"),(0,n.addClass)(c,"ht-page-navigation-section__button--disabled"),u.disabled=!0,c.disabled=!0):((0,n.removeClass)(u,"ht-page-navigation-section__button--disabled"),(0,n.removeClass)(c,"ht-page-navigation-section__button--disabled"),u.disabled=!1,c.disabled=!1),T?((0,n.addClass)(d,"ht-page-navigation-section__button--disabled"),(0,n.addClass)(g,"ht-page-navigation-section__button--disabled"),d.disabled=!0,g.disabled=!0):((0,n.removeClass)(d,"ht-page-navigation-section__button--disabled"),(0,n.removeClass)(g,"ht-page-navigation-section__button--disabled"),d.disabled=!1,g.disabled=!1),[u,c,d,g].includes(e)&&(c.disabled?d.focus():d.disabled&&c.focus())}return(0,n.setAttribute)(u,[(0,m.QK)(mn(mg,this).call(this,eA.PAGINATION_FIRST_PAGE)),(0,m.gw)(b)]),(0,n.setAttribute)(c,[(0,m.QK)(mn(mg,this).call(this,eA.PAGINATION_PREV_PAGE)),(0,m.gw)(b)]),(0,n.setAttribute)(d,[(0,m.QK)(mn(mg,this).call(this,eA.PAGINATION_NEXT_PAGE)),(0,m.gw)(T)]),(0,n.setAttribute)(g,[(0,m.QK)(mn(mg,this).call(this,eA.PAGINATION_LAST_PAGE)),(0,m.gw)(T)]),this}setPageSizeSectionVisibility(e){let{pageSizeSection:t,pageSizeSelect:r}=mn(mc,this);return t.style.display=e?"":"none",r.disabled=!e,ms(mm,this,mv).call(this),this}setCounterSectionVisibility(e){return mn(mc,this).pageCounterSection.style.display=e?"":"none",ms(mm,this,mv).call(this),this}setNavigationSectionVisibility(e){let{pageNavSection:t,first:r,prev:i,next:n,last:o}=mn(mc,this);return t.style.display=e?"":"none",r.disabled=!e,i.disabled=!e,n.disabled=!e,o.disabled=!e,ms(mm,this,mv).call(this),this}destroy(){var e;null===(e=mn(mc,this))||void 0===e||e.container.remove(),mo(mc,this,null)}}function mv(){let{container:e,pageSizeSection:t,pageCounterSection:r,pageNavSection:i}=mn(mc,this),o="none"!==t.style.display||"none"!==r.style.display||"none"!==i.style.display;mn(mh,this)||(o?(0,n.addClass)(mn(ml,this).querySelector(".ht-wrapper"),"htPagination"):(0,n.removeClass)(mn(ml,this).querySelector(".ht-wrapper"),"htPagination")),e.style.display=o?"":"none"}(0,s.mixin)(my,iI.Z);let mw=["nestedRows","mergeCells","fixedRowsTop","fixedRowsBottom"];var mE=r(71660);function mS(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class mC{constructor(){mS(this,"pageSize",1),mS(this,"totalItems",0),mS(this,"totalPages",0)}calculate(e){let{pageSize:t,totalItems:r}=e;this.pageSize=Math.max(t,1),this.totalItems=r,this.totalPages=Math.max(1,Math.ceil(this.totalItems/this.pageSize))}getTotalPages(){return this.totalPages}getState(e){if((e-=1)<0||e>=this.getTotalPages())return;let t=e*this.pageSize,r=Math.max(0,Math.min(t+this.pageSize-1,this.totalItems-1));return{startIndex:t,endIndex:r,pageSize:this.pageSize}}}class mR{constructor(){var e,t,r;
76t=[],(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="pages","string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t}calculate(e){let{itemsSizeProvider:t,viewportSizeProvider:r}=e,i=t(),n=r(),o=[],s=0,a=0,l=0;for(let e=0;e<i.length;e++){let t=i[e];l>0&&a+t>=n&&(o.push({startIndex:s,endIndex:e-1,pageSize:l}),s=e,a=0,l=0),a+=t,l+=1}o.push({startIndex:s,endIndex:Math.max(0,i.length-1),pageSize:l}),this.pages=o}getTotalPages(){return this.pages.length}getState(e){if(!((e-=1)<0||e>=this.getTotalPages()))return this.pages[e]}}let mb=new Map([["fixed",mC],["auto",mR]]);function mT(e){if(!mb.has(e))throw Error(`Unknown pagination strategy type: ${e}`);return new(mb.get(e))}function mN(e,t,r){mA(e,t),t.set(e,r)}function mA(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function mI(e,t){return e.get(mO(e,t))}function mM(e,t,r){return e.set(mO(e,t),r),r}function mO(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let mx="pagination",m_=`plugin:${mx}`,mP=(0,rJ.e)`The \`auto\` page size setting requires the \`autoRowSize\`\x20
77  plugin to be enabled. Set the \`autoRowSize: true\` in the configuration to ensure correct behavior.`;var mL=new WeakMap,mk=new WeakMap,mD=new WeakMap,mH=new WeakMap,mB=new WeakMap,mF=new WeakMap,mV=new WeakMap,mU=new WeakSet,mW=new WeakMap;class mj extends tn.vq{constructor(){super(...arguments),mA(this,mU),mU.add(this),mN(this,mL,null),mN(this,mk,1),mN(this,mD,10),mN(this,mH,null),mN(this,mB,null),mN(this,mF,!1),mN(this,mV,!1),mN(this,mW,()=>{var e;!mI(mF,this)&&null!==(e=this.hot)&&void 0!==e&&e.view&&mO(mU,this,m$).call(this)})}static get PLUGIN_KEY(){return mx}static get PLUGIN_PRIORITY(){return 900}static get DEFAULT_SETTINGS(){return{pageSize:10,pageSizeList:["auto",5,10,20,50,100],initialPage:1,showPageSize:!0,showCounter:!0,showNavigation:!0,uiContainer:null}}isEnabled(){return!!this.hot.getSettings()[mx]}enablePlugin(){var e,t,r=this;if(e=this.hot.getSettings(),mw.some(t=>{let r=!!e[t];return r&&(0,rE.ZK)((0,rJ.e)`The \`pagination\` plugin cannot be used with the \`${t}\` option.\x20
78                        This combination is not supported. The plugin will remain disabled.`),r})){this.hot.getSettings()[mx]=!1;return}if(this.enabled)return;let i=this.hot.getSettings()[mx];(null==i?void 0:i.initialPage)!==void 0&&mM(mk,this,this.getSetting("initialPage")),(null==i?void 0:i.pageSize)!==void 0&&mM(mD,this,this.getSetting("pageSize")),mM(mL,this,this.hot.rowIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding",!1)),"auto"!==mI(mD,this)||null!==(t=this.hot.getPlugin("autoRowSize"))&&void 0!==t&&t.enabled||(0,rE.ZK)(mP),mM(mB,this,mT("auto"===mI(mD,this)?"auto":"fixed")),mI(mH,this)||(mM(mH,this,new my({rootElement:this.hot.rootGridElement,uiContainer:this.getSetting("uiContainer"),isRtl:this.hot.isRtl(),themeName:this.hot.getSettings().themeName,phraseTranslator:function(){return r.hot.getTranslatedPhrase(...arguments)},shouldHaveBorder:()=>mO(mU,this,mz).call(this),a11yAnnouncer:e=>(0,mE.xQ)(e)})),mO(mU,this,mG).call(this),mI(mH,this).addLocalHook("firstPageClick",()=>this.firstPage()).addLocalHook("prevPageClick",()=>this.prevPage()).addLocalHook("nextPageClick",()=>this.nextPage()).addLocalHook("lastPageClick",()=>this.lastPage()).addLocalHook("pageSizeChange",e=>this.setPageSize(e))),this.addHook("init",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,m2).call(r,...t)},-1),this.addHook("beforeSelectAll",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,mX).call(r,...t)}),this.addHook("beforeSelectColumns",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,mX).call(r,...t)}),this.addHook("beforeSetRangeEnd",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,mq).call(r,...t)}),this.addHook("beforeSelectionHighlightSet",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,mZ).call(r,...t)}),this.addHook("beforePaste",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,mQ).call(r,...t)}),this.addHook("afterViewRender",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,mJ).call(r,...t)}),this.addHook("afterRender",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,m0).call(r,...t)}),this.addHook("afterScrollVertically",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,m5).call(r,...t)}),this.addHook("afterLanguageChange",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,m3).call(r,...t)}),this.addHook("beforeHeightChange",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];
78return mO(mU,r,m1).call(r,...t)}),this.addHook("afterSetTheme",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return mO(mU,r,m9).call(r,...t)}),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",mI(mW,this)),mO(mU,this,mY).call(this),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),mO(mU,this,m$).call(this),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.removeLocalHook("cacheUpdated",mI(mW,this)).unregisterMap(this.pluginName),mO(mU,this,mK).call(this),mI(mH,this).destroy(),mM(mH,this,null),super.disablePlugin()}getPaginationData(){let e=mI(mB,this).getTotalPages(),t=-1,r=-1,{pageSize:i,startIndex:n}=mI(mB,this).getState(mI(mk,this)),o=this.hot.countRows(),s=0;for(let e=n;s<i&&!(e>=o);e++)this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))||(-1===t&&(t=e),r=e,s+=1);return{currentPage:mI(mk,this),totalPages:e,pageSize:i,pageSizeList:[...this.getSetting("pageSizeList")],autoPageSize:"auto"===mI(mD,this),numberOfRenderedRows:this.hot.rowIndexMapper.getRenderableIndexesLength(),firstVisibleRowIndex:t,lastVisibleRowIndex:r}}setPage(e){let t=mI(mk,this);!1!==this.hot.runHooks("beforePageChange",t,e)&&(mM(mk,this,e),mO(mU,this,m$).call(this),this.hot.scrollViewportTo({row:0}),this.hot.runHooks("afterPageChange",t,mI(mk,this)),this.hot.view.adjustElementsSize(),this.hot.render())}resetPage(){this.setPage(this.getSetting("initialPage"))}setPageSize(e){var t;let r=mI(mD,this);!1!==this.hot.runHooks("beforePageSizeChange",r,e)&&("auto"!==e||null!==(t=this.hot.getPlugin("autoRowSize"))&&void 0!==t&&t.enabled||(0,rE.ZK)(mP),mM(mB,this,mT("auto"===e?"auto":"fixed")),mM(mD,this,e),mO(mU,this,m$).call(this),this.hot.runHooks("afterPageSizeChange",r,mI(mD,this)),this.hot.view.adjustElementsSize(),this.hot.render())}resetPageSize(){this.setPageSize(this.getSetting("pageSize"))}resetPagination(){this.resetPage(),this.resetPageSize(),mO(mU,this,mG).call(this)}nextPage(){this.setPage(mI(mk,this)+1)}prevPage(){this.setPage(mI(mk,this)-1)}firstPage(){this.setPage(1)}lastPage(){this.setPage(mI(mB,this).getTotalPages())}hasPreviousPage(){return mI(mk,this)>1}hasNextPage(){return mI(mk,this)<mI(mB,this).getTotalPages()}getCurrentPageData(){let{firstVisibleRowIndex:e,lastVisibleRowIndex:t}=this.getPaginationData();return -1===e||-1===t?[]:this.hot.getData(e,0,t,this.hot.countCols()-1)}showPageSizeSection(){mI(mH,this).setPageSizeSectionVisibility(!0),this.hot.runHooks("afterPageSizeVisibilityChange",!0)}hidePageSizeSection(){mI(mH,this).setPageSizeSectionVisibility(!1),this.hot.runHooks("afterPageSizeVisibilityChange",!1)}showPageCounterSection(){mI(mH,this).setCounterSectionVisibility(!0),this.hot.runHooks("afterPageCounterVisibilityChange",!0)}hidePageCounterSection(){mI(mH,this).setCounterSectionVisibility(!1),this.hot.runHooks("afterPageCounterVisibilityChange",!1)}showPageNavigationSection(){mI(mH,this).setNavigationSectionVisibility(!0),this.hot.runHooks("afterPageNavigationVisibilityChange",!0)}hidePageNavigationSection(){mI(mH,this).setNavigationSectionVisibility(!1),this.hot.runHooks("afterPageNavigationVisibilityChange",!1)}destroy(){var e;mM(mL,this,null),mM(mB,this,null),null===(e=mI(mH,this))||void 0===e||e.destroy(),mM(mH,this,null),super.destroy()}}function mG(){this.getSetting("showPageSize")?this.showPageSizeSection():this.hidePageSizeSection(),this.get
78Setting("showCounter")?this.showPageCounterSection():this.hidePageCounterSection(),this.getSetting("showNavigation")?this.showPageNavigationSection():this.hidePageNavigationSection()}function m$(){mM(mF,this,!0),mI(mL,this).clear();let e=this.hot.rowIndexMapper.getRenderableIndexes(),t=e.length,{stylesHandler:r}=this.hot;mI(mB,this).calculate({pageSize:mI(mD,this),totalItems:t,viewportSizeProvider:()=>{let{view:e}=this.hot;if(e.isVerticallyScrollableByWindow()){let t=getComputedStyle(this.hot.rootDocument.body),r=Number.parseInt(t.marginTop,10)+Number.parseInt(t.marginBottom,10),i=this.hot.hasColHeaders()?e._wt.wtTable.getColumnHeaderHeight():0,n=mI(mH,this).getHeight();return e.getWorkspaceHeight()-n-i-r}let t=e.hasHorizontalScroll()?(0,n.getScrollbarWidth)():0;return e.getViewportHeight()-t},itemsSizeProvider:()=>this.hot.rowIndexMapper.getRenderableIndexes().map(e=>{var t;let i=this.hot.toVisualRow(e);return null!==(t=this.hot.getRowHeight(i))&&void 0!==t?t:r.getDefaultRowHeight(i)})});let i=mI(mB,this).getTotalPages();if(mM(mk,this,(0,eH.clamp)(mI(mk,this),1,i)),e.length>0){let{startIndex:t,pageSize:r}=mI(mB,this).getState(mI(mk,this));e.splice(t,r)}e.length>0?this.hot.batchExecution(()=>{e.forEach(e=>mI(mL,this).setValueAtIndex(e,!0))},!0):this.hot.rowIndexMapper.updateCache(!0),mM(mF,this,!1);let o=this.getPaginationData();mI(mH,this).updateState({...o,totalRenderedRows:t})}function mz(){if(!this.hot.view)return!0;let{view:e}=this.hot;if(e.isVerticallyScrollableByWindow())return!1;if(e.hasHorizontalScroll()||e.getTableHeight()<e.getWorkspaceHeight())return!0;let{lastVisibleRowIndex:t}=this.getPaginationData();return e.getLastFullyVisibleRow()!==t}function mY(){this.hot.getFocusScopeManager().registerScope(mx,mI(mH,this).getContainer(),{shortcutsContextName:m_,runOnlyIf:()=>this.getSetting("showPageSize")||this.getSetting("showNavigation"),onActivate:e=>{let t=mI(mH,this).getFocusableElements();t.length>0&&("tab_from_above"===e?t.at(0).focus():"tab_from_below"===e&&t.at(-1).focus())}})}function mK(){this.hot.getFocusScopeManager().unregisterScope(mx)}function mX(e,t){let{firstVisibleRowIndex:r,lastVisibleRowIndex:i}=this.getPaginationData();(mI(mk,this)>1||e.row>=0)&&(e.row=r),t.row=i}function mq(e){if(this.hot.selection.isSelectedByColumnHeader()){let{lastVisibleRowIndex:t}=this.getPaginationData();e.row=t}}function mZ(){if(!this.hot.getSettings().navigableHeaders)return;let e=this.hot.getSelectedRangeLast();if(!e.isSingle()){let{highlight:t}=e;t.row=(0,eH.clamp)(t.row,e.getTopStartCorner().row,e.getBottomEndCorner().row)}}function mQ(e,t){let{firstVisibleRowIndex:r,lastVisibleRowIndex:i}=this.getPaginationData();if(-1===r||-1===i)return!1;t.forEach(t=>{let{startRow:r}=t;if(0===e.length)return;let n=Math.min(e.length-(i-r+1),e.length);e.splice(0,n)})}function mJ(){if("auto"!==mI(mD,this)||mI(mV,this)){mM(mV,this,!1);return}mO(mU,this,m$).call(this),mM(mV,this,!0),this.hot.view.adjustElementsSize(),this.hot.render()}function m0(){let{view:e}=this.hot,t=e.isHorizontallyScrollableByWindow()?e.getTotalTableWidth():e.getWorkspaceWidth();mI(mH,this).updateWidth(t).refreshBorderState()}function m1(e){if(this.getSetting("uiContainer")||!("number"==typeof e||"string"==typeof e&&/^\d+$/.test(e)||"string"==typeof e&&e.endsWith("px")))return e;let t="string"==typeof e&&e.endsWith("px")?e:`${e}px`;return`calc(${t} - ${mI(mH,this).getHeight()}px)`}function m2(){"auto"!==mI(mD,this)&&mO(mU,this,m$).call(this)}function m5(){mI(mH,this).refreshBorderState()}function m3(){mO(mU,this,m$).call(this)}function m9(e){mI(mH,this).updateTheme(e)}function m4(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class m7{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;m4(this,"rootWindow",void 0),m4(this,"prefix",void 0),m4(this,"savedKeys",[]),this.rootWindow=t,this.prefix=e,this.loadSavedKeys()}saveValue(e,t){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(t)),-1===this.savedKeys.indexOf(e)&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,t){let r=this.rootWindow.localStorage.getItem(`${this.prefix}_${void 0===e?t:e}`);return null===r?void 0:JSON.parse(r)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){(0,c.arrayEach)(this.savedKeys,(e,t)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[t]}`)}),this.clearSavedKeys()}loadSavedKeys(){let e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),t="string"==typeof e?JSON.parse(e):void 0;this.savedKeys=t||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}eN.P.getSingleton().register("persistentStateSave"),eN.P.getSingleton().register("persistentStateLoad"),eN.P.getSingleton().register("persistentStateReset");let m8="persistentState",m6=new WeakSet;class ye extends tn.vq{constructor(){var e,t,r;super(...arguments),t=void 0,(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="storage","string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t}static get PLUGIN_KEY(){return m8}static get PLUGIN_PRIORITY(){return 0}isEnabled(){return!!this.hot.getSettings()[m8]}enablePlugin(){this.enabled||(m6.has(this.hot)||(m6.add(this.hot),(0,rE.vF)("The PersistentState plugin is deprecated and will be removed in version 17.0. Please update your settings to ensure compatibility with future versions.")),this.storage||(this.storage=new m7(this.hot.rootContainer.id||this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,t)=>this.saveValue(e,t)),this.addHook("persistentStateLoad",(e,t)=>this.loadValue(e,t)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,t){t.value=this.storage.loadValue(e)}saveValue(e,t){this.storage.saveValue(e,t)}resetValue(e){void 0===e?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function yt(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yr(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let yi="search",yn=function(e,t,r,i,n){e.getCellMeta(t,r).isSearchResult=n},yo=function(e,t,r){return!((0,d.isUndefined)(e)||null===e||!e.toLocaleLowerCase||0===e.length||(0,d.isUndefined)(t)||null===t)&&-1!==t.toString().toLocaleLowerCase(r.locale).indexOf(e.toLocaleLowerCase(r.locale))};var ys=new WeakSet;class ya extends tn.vq{constructor(){super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,ys),ys.add(this),yt(this,"callback",yn),yt(this,"queryMethod",yo),yt(this,"searchResultClass","htSearchResult")}static get PLUGIN_KEY(){return yi}static get PLUGIN_PRIORITY(){return 190}isEnabled(){return this.hot.getSettings()[yi]}enablePlugin(){var e=this;if(this.enabled)return;let t=this.hot.getSettings()[yi];this.updatePluginSettings(t),this.addHook("beforeRenderer",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return yr(ys,e,yl).call(e,...r)}),super.enablePlugin()}disablePlugin(){var e=this;let t=function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return yr(ys,e,yl).call(e,...r)};this.hot.addHook("beforeRenderer",t),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",t)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getCallback(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getQueryMethod(),i=this.hot.countRows(),n=this.hot.countCols(),o=[],s=this.hot;return(0,eH.rangeEach)(0,i-1,i=>{(0,eH.rangeEach)(0,n-1,n=>{let a=this.hot.getDataAtCell(i,n),l=this.hot.getCellMeta(i,n),h=l.search.callback||t,u=(l.search.queryMethod||r)(e,a,l);u&&o.push({row:i,col:n,data:a}),h&&h(s,i,n,a,u)})}),o}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){(0,s.isObject)(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function yl(e,t,r,i,n,o){let s=o.className||[],a=[];"string"==typeof s?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 yh(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class yu{constructor(e){yh(this,"viewportWidth",void 0),yh(this,"overwriteColumnWidthFn",void 0),yh(this,"baseWidths",new Map),yh(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:t}=e;this.viewportWidth=t,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,t){this.baseWidths.set(e,t)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class yc extends yu{calculate(){let e=Array.from(this.baseWidths).reduce((e,t)=>
78{let[,r]=t;return e+r},0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}let t=this.viewportWidth/e,r=[],i=[],n=this.viewportWidth,o=0;if(this.baseWidths.forEach((e,s)=>{let a=Math.round(e*t),l=this.overwriteColumnWidthFn(a,s);a===l&&a>=th.$?(r.push([s,l]),o+=l):a!==l&&(r.push([s,l]),i.push(s),n-=l)}),n<=th.$){this.stretchedWidths.clear();return}let s=n/o,a=-1,l=0;r.forEach((e,t)=>{let[n,o]=e,h=o;i.includes(n)||(h=Math.round(o*s)),this.stretchedWidths.set(n,h),a=n,t<r.length-1&&(l+=h)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(a,Math.round(this.viewportWidth-l))}}function yd(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function yg(e,t){return e.get(yf(e,t))}function yp(e,t,r){return e.set(yf(e,t),r),r}function yf(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var ym=new WeakMap,yy=new WeakMap;class yv extends yu{constructor(){super(...arguments),yd(this,ym,0),yd(this,yy,-1)}prepare(e){super.prepare(e),yp(ym,this,0),yp(yy,this,-1)}setColumnBaseWidth(e,t){super.setColumnBaseWidth(e,t),yp(yy,this,e),yp(ym,this,t)}calculate(){if(-1===yg(yy,this))return;let e=Array.from(this.baseWidths).reduce((e,t)=>{let[,r]=t;return e+r},0),t=Math.max(this.viewportWidth-e+yg(ym,this),0);this.stretchedWidths.set(yg(yy,this),t)}}function yw(e,t,r){yE(e,t),t.set(e,r)}function yE(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function yS(e,t){return e.get(yR(e,t))}function yC(e,t,r){return e.set(yR(e,t),r),r}function yR(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var yb=new WeakMap,yT=new WeakMap,yN=new WeakMap,yA=new WeakMap,yI=new WeakSet;class yM{constructor(e){yE(this,yI),yI.add(this),yw(this,yb,void 0),yw(this,yT,void 0),yw(this,yN,new Map([["all",new yc(yR(yI,this,y_).bind(this))],["last",new yv(yR(yI,this,y_).bind(this))]])),yw(this,yA,"none"),yC(yb,this,e),yC(yT,this,yS(yb,this).columnIndexMapper.createAndRegisterIndexMap("stretchColumns","physicalIndexToValue"))}useStrategy(e){yC(yA,this,yS(yN,this).has(e)?e:"none")}refreshStretching(){if("none"===yS(yA,this)){yS(yT,this).clear();return}yS(yb,this).batchExecution(()=>{yS(yT,this).clear();let e=yS(yN,this).get(yS(yA,this)),t=yS(yb,this).view.getViewportWidth();yR(yI,this,yO).call(this)&&(t-=(0,n.getScrollbarWidth)(yS(yb,this).rootDocument)),e.prepare({viewportWidth:t});for(let t=0;t<yS(yb,this).countCols();t++)yS(yb,this).columnIndexMapper.isHidden(yS(yb,this).toPhysicalColumn(t))||e.setColumnBaseWidth(t,yR(yI,this,yx).call(this,t));e.calculate(),e.getWidths().forEach(e=>{let[t,r]=e;yS(yT,this).setValueAtIndex(yS(yb,this).toPhysicalColumn(t),r)})},!0)}getStretchedWidth(e){return yS(yT,this).getValueAtIndex(yS(yb,this).toPhysicalColumn(e))}}function yO(){let{view:e,stylesHandler:t}=yS(yb,this);if(e.isVerticallyScrollableByWindow())return!1;let r=e.getViewportHeight(),i=yS(yb,this).countRows(),n=t.getDefaultRowHeight(),o=t.isClassicTheme(),s=e=>o&&0===e?1:0,a=0,l=!1;for(let e=0;e<i;e++){var h;if(!yS(yb,this).rowIndexMapper.isHidden(yS(yb,this).toPhysicalRow(e))&&(a+=(null!==(h=yS(yb,this).getRowHeight(e))&&void 0!==h?h:n)+s(e))>r){l=!0;break}}return l}function yx(e){var t;return null!==(t=yS(yb,this).getColWidth(e,"StretchColumns"))&&void 0!==t?t:th.$}function y_(e,t){return yS(yb,this).runHooks("beforeStretchingColumnWidth",e,t)}function yP(e,t,r){yL(e,t),t.set(e,r)}function yL(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function yk(e,t,r){return e.set(yH(e,t),r),r}function yD(e,t){return e.get(yH(e,t))}function yH(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var yB=new WeakMap,yF=new WeakMap,yV=new WeakMap,yU=new WeakSet;class yW extends tn.vq{constructor(){super(...arguments),yL(this,yU),yU.add(this),yP(this,y
78B,new yM(this.hot)),yP(this,yF,null),yP(this,yV,new ResizeObserver(e=>{requestAnimationFrame(()=>{var t;null!==(t=this.hot)&&void 0!==t&&t.view.isHorizontallyScrollableByWindow()&&e.forEach(e=>{let{contentRect:t}=e;null!==yD(yF,this)&&yD(yF,this)!==t.width&&(this.hot.view.adjustElementsSize(),this.hot.refreshDimensions()),yk(yF,this,t.width)})})}))}static get PLUGIN_KEY(){return"stretchColumns"}static get PLUGIN_PRIORITY(){return 155}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(yD(yB,this).useStrategy(this.hot.getSettings().stretchH),yD(yV,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return yH(yU,e,yG).call(e,...r)}),this.addHook("modifyColWidth",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return yH(yU,e,yj).call(e,...r)},10),super.enablePlugin())}updatePlugin(){yD(yB,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),yD(yV,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return yD(yB,this).getStretchedWidth(e)}destroy(){yD(yV,this).disconnect(),yk(yV,this,null),yk(yB,this,null),super.destroy()}}function yj(e,t,r){if(r===this.pluginName)return;let i=this.getColumnWidth(t);return"number"==typeof i?i:e}function yG(e){e&&yD(yB,this).refreshStretching()}function y$(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yz(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var yY=new WeakSet;class yK extends tn.vq{constructor(){super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,yY),yY.add(this),y$(this,"scrollbars",[]),y$(this,"clones",[]),y$(this,"lockedCollection",!1),y$(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return"touchScroll"}static get PLUGIN_PRIORITY(){return 200}static get SETTING_KEYS(){return!0}isEnabled(){return(0,to.isTouchSupported)()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>yz(yY,this,yX).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>yz(yY,this,yq).call(this)),this.addHook("afterMomentumScroll",()=>yz(yY,this,yZ).call(this))}}function yX(){if(this.lockedCollection)return;let{topOverlay:e,bottomOverlay:t,inlineStartOverlay:r,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:n}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(e),t.clone&&this.scrollbars.push(t),this.scrollbars.push(r),i&&this.scrollbars.push(i),n&&n.clone&&this.scrollbars.push(n),this.clones=[],e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),r.needFullRender&&this.clones.push(r.clone.wtTable.holder.parentNode),i&&this.clones.push(i.clone.wtTable.holder.parentNode),n&&n.clone&&this.clones.push(n.clone.wtTable.holder.parentNode)}function yq(){this.freezeOverlays=!0,(0,c.arrayEach)(this.clones,e=>{(0,n.addClass)(e,"hide-tween")})}function yZ(){this.freezeOverlays=!1,(0,c.arrayEach)(this.clones,e=>{(0,n.removeClass)(e,"hide-tween"),(0,n.addClass)(e,"show-tween")}),this.hot._registerTimeout(()=>{(0,c.arrayEach)(this.clones,e=>{(0,n.removeClass)(e,"show-tween")})},400),(0,c.arrayEach)(this.scrollbars,e=>{e.refresh(),e.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}let yQ="trimRows";var yJ=new WeakSet;class y0 extends tn.vq{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,yJ),yJ.add(this),(e="symbol"==typeof(t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e="trimmedRowsMap","string"))?t:t+"")in this?Object.defineProperty(this,e,{value:null,enumerable:!0,configurable:!0,writable:!0}):this[e]=null}static get PLUGIN_KEY(){return yQ}static get PLUGIN_PRIORITY(){return 330}isEnabled(){return!!this.hot.getSettings()[yQ]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new l0.n),this.trimmedRowsMap.addLocalHook("init",()=>(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")})(yJ,this,y1).call(this)),super.enablePlugin())}updatePlugin(){let e=this.hot.getSettings()[yQ];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),(0,c.arrayEach)(e,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){let t=this.getTrimmedRows(),r=this.isValidConfig(e),i=t;r&&(i=Array.from(new Set(t.concat(e)))),!1!==this.hot.runHooks("beforeTrimRow",t,i,r)&&(r&&this.hot.batchExecution(()=>{(0,c.arrayEach)(e,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0),this.hot.runHooks("afterTrimRow",t,i,r,r&&i.length>t.length))}trimRow(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.trimRows(t)}untrimRows(e){let t=this.getTrimmedRows(),r=this.isValidConfig(e),i=t,n=this.trimmedRowsMap.getValues().slice(),o=e.length>0;r&&o&&((0,c.arrayEach)(e,e=>{n[e]=!1}),i=(0,c.arrayReduce)(n,(e,t,r)=>(t&&e.push(r),e),[])),!1!==this.hot.runHooks("beforeUntrimRow",t,i,r&&o)&&(r&&o&&this.trimmedRowsMap.setValues(n),this.hot.runHooks("afterUntrimRow",t,i,r&&o,r&&i.length<t.length))}untrimRow(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.untrimRows(t)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){let t=this.hot.countSourceRows();return e.every(e=>Number.isInteger(e)&&e>=0&&e<t)}destroy(){super.destroy()}}function y1(){let e=this.hot.getSettings()[yQ];Array.isArray(e)&&this.hot.batchExecution(()=>{(0,c.arrayEach)(e,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}class y2{constructor(e){var t,r;(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t="actionType","string"))?r:r+"")in this?Object.defineProperty(this,t,{value:"",enumerable:!0,configurable:!0,writable:!0}):this[t]="",this.actionType=e}undo(){throw Error("Not implemented")}redo(){throw Error("Not implemented")}}function y5(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class y3 extends y2{constructor(e){let{stateBefore:t,range:r,type:i,alignment:n}=e;super("cell_alignment"),y5(this,"stateBefore",void 0),y5(this,"range",void 0),y5(this,"type",void 0),y5(this,"alignment",void 0),this.stateBefore=t,this.range=r,this.type=i,this.alignment=n}static startRegisteringEvents(e,t){e.addHook("beforeCellAlignment",(e,r,i,n)=>{t.done(()=>new y3({stateBefore:e,range:r,type:i,alignment:n}))})}undo(e,t){(0,c.arrayEach)(this.range,t=>{t.forAll((t,r)=>{t>=0&&r>=0&&e.setCellMeta(t,r,"className",this.stateBefore[t][r]||" htLeft")})}),e.addHookOnce("afterViewRender",t),e.render()}redo(e,t){i5(this.range,this.type,this.alignment,(t,r)=>e.getCellMeta(t,r),(t,r,i,n)=>e.setCellMeta(t,r,i,n)),e.addHookOnce("afterViewRender",t),e.render()}}function y9(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
78class y4 extends y2{constructor(e){let{columns:t,finalIndex:r}=e;super("col_move"),y9(this,"columns",void 0),y9(this,"finalColumnIndex",void 0),this.columns=t.slice(),this.finalColumnIndex=r}static startRegisteringEvents(e,t){e.addHook("beforeColumnMove",(e,r)=>{!1!==e&&t.done(()=>new y4({columns:e,finalIndex:r}))})}undo(e,t){let r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",t),hN(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(e=>{let{from:t,to:i}=e;t<i&&(i-=1),r.moveColumn(i,t)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,t){let r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",t),r.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}}function y7(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class y8 extends y2{constructor(e){let{currentSortState:t,newSortState:r}=e;super("col_sort"),y7(this,"previousSortState",void 0),y7(this,"nextSortState",void 0),this.previousSortState=t,this.nextSortState=r}static startRegisteringEvents(e,t){e.addHook("beforeColumnSort",(e,r,i)=>{i&&t.done(()=>new y8({currentSortState:e,newSortState:r}))})}undo(e,t){let r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),n=i.isEnabled()?i:r;this.previousSortState.length?n.sort(this.previousSortState):n.clearSort(),t()}redo(e,t){let r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:r).sort(this.nextSortState),t()}}function y6(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ve extends y2{constructor(e){let{index:t,amount:r}=e;super("insert_col"),y6(this,"index",void 0),y6(this,"amount",void 0),this.index=t,this.amount=r}static startRegisteringEvents(e,t){e.addHook("afterCreateCol",(e,r,i)=>{t.done(()=>new ve({index:e,amount:r}),i)})}undo(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterCreateCol",t),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function vt(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class vr extends y2{constructor(e){let{index:t,amount:r}=e;super("insert_row"),vt(this,"index",void 0),vt(this,"amount",void 0),this.index=t,this.amount=r}static startRegisteringEvents(e,t){e.addHook("afterCreateRow",(e,r,i)=>{t.done(()=>new vr({index:e,amount:r}),i)})}undo(e,t){let r=e.countRows(),i=e.getSettings().minSpareRows;this.index>=r&&this.index-i<r&&(this.index-=i),e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterCreateRow",t),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}}function vi(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class vn extends y2{constructor(e){let{changes:t,selected:r,countCols:i,countRows:n}=e;super("change"),vi(this,"changes",void 0),vi(this,"selected",void 0),vi(this,"countCols",void 0),vi(this,"countRows",void 0),this.changes=t,this.selected=r,this.countCols=i,this.countRows=n}static startRegisteringEvents(e,t){e.addHook("beforeChange",function(r,i){let n=r&&r.length;n&&r.find(e=>{let[,,t,r]=e;return t!==r})&&t.done(()=>{let t=r.reduce((e,t)=>
78(e.push([...t]),e),[]);t.forEach(t=>{t[1]=e.propToCol(t[1])});let i=n>1?this.getSelected():[[t[0][0],t[0][1]]];return new vn({changes:t,selected:i,countCols:e.countCols(),countRows:e.countRows()})},i)})}undo(e,t){let r=(0,s.deepClone)(this.changes);for(let e=0,t=r.length;e<t;e++)r[e].splice(3,1);e.addHookOnce("afterChange",()=>{let r=e.countRows()-this.countRows;r>0&&e.alter("remove_row",null,r,"UndoRedo.undo");let i=e.countCols()-this.countCols;i>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,i,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1),t()}),e.setDataAtCell(r,null,null,"UndoRedo.undo")}redo(e,t){let r=(0,s.deepClone)(this.changes);for(let e=0,t=r.length;e<t;e++)r[e].splice(2,1);e.addHookOnce("afterChange",()=>{e.selectCells(this.selected,!1,!1),t()}),e.setDataAtCell(r,null,null,"UndoRedo.redo")}}function vo(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
78class vs extends y2{constructor(e){let{conditionsStack:t,previousConditionsStack:r}=e;super("filter"),vo(this,"conditionsStack",void 0),vo(this,"previousConditionsStack",void 0),this.conditionsStack=t,this.previousConditionsStack=r}static startRegisteringEvents(e,t){e.addHook("beforeFilter",(e,r)=>{t.done(()=>new vs({conditionsStack:e,previousConditionsStack:r}))})}undo(e,t){let r=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),r.importConditions(this.previousConditionsStack),r.filter()}redo(e,t){let r=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),r.importConditions(this.conditionsStack),r.filter()}}class va extends y2{constructor(e){var t,r,i;let{data:n,cellRange:o}=e;super("merge_cells"),r=void 0,(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t="cellRange","string"))?i:i+"")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.cellRange=o,this.data=n}static startRegisteringEvents(e,t){e.addHook("beforeMergeCells",(r,i)=>{if(i)return;let n=r.getTopStartCorner(),o=r.getBottomEndCorner(),s=e.getData(n.row,n.col,o.row,o.col);t.done(()=>new va({data:s,cellRange:r}))})}undo(e,t){let r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),r.unmergeRange(this.cellRange,!0);let i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,t){let r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),r.mergeRange(this.cellRange)}}function vl(e,t,r,i,n){let o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return(0,eH.rangeEach)(i,n,i=>{(0,eH.rangeEach)(t,r,t=>{let r=e.getCellMeta(t,i);if(Object.keys(r).length!==s){let e=Object.fromEntries(Object.entries(r).filter(e=>{let[t]=e;return!1===o.includes(t)}));a.push([r.visualRow,r.visualCol,e])}})}),a}function vh(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r(97545);class vu extends y2{constructor(e){let{index:t,indexes:r,data:i,amount:n,headers:o,columnPositions:s,rowPositions:a,fixedColumnsStart:l,removedCellMetas:h}=e;super("remove_col"),vh(this,"index",void 0),vh(this,"indexes",void 0),vh(this,"data",void 0),vh(this,"amount",void 0),vh(this,"headers",void 0),vh(this,"columnPositions",void 0),vh(this,"rowPositions",void 0),vh(this,"fixedColumnsStart",void 0),vh(this,"removedCellMetas",void 0),this.index=t,this.indexes=r,this.data=i,this.amount=n,this.headers=o,this.columnPositions=s.slice(0),this.rowPositions=a.slice(0),this.fixedColumnsStart=l,this.removedCellMetas=h}static startRegisteringEvents(e,t){e.addHook("beforeRemoveCol",(r,i,n,o)=>{t.done(()=>{let t=e.getSourceDataArray(),n=(e.countCols()+r)%e.countCols(),o=n+i-1,s=[],a=[],l=[];return(0,eH.rangeEach)(t.length-1,r=>{let i=[],a=t[r];(0,eH.rangeEach)(n,o,t=>{i.push(a[e.toPhysicalColumn(t)])}),s.push(i)}),(0,eH.rangeEach)(i-1,t=>{l.push(e.toPhysicalColumn(n+t))}),Array.isArray(e.getSettings().colHeaders)&&(0,eH.rangeEach)(i-1,t=>{a.push(e.getSettings().colHeaders[e.toPhysicalColumn(n+t)]||null)}),new vu({index:n,indexes:l,data:s,amount:i,headers:a,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:vl(e,0,e.countRows(),n,o)})},o)})}undo(e,t){e.getSettings().fixedColumnsStart=this.fixedColumnsStart;let r=this.indexes.slice(0).sort(),i=(e,t,i)=>i[this.indexes.indexOf(r[t])],n=this.data.length,o=[];for(let e=0;e<n;e++)o.push((0,c.arrayMap)(this.data[e],i));let s=(0,c.arrayMap)(this.headers,i),a=[];
78e.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),(0,c.arrayEach)(e.getSourceDataArray(),(e,t)=>{(0,c.arrayEach)(r,(r,i)=>{e[r]=o[t][i],a.push([t,r,e[r]])})}),void 0!==this.headers&&(0,c.arrayEach)(s,(t,i)=>{e.getSettings().colHeaders[r[i]]=t}),this.removedCellMetas.forEach(t=>{let[r,i,n]=t;e.setCellMetaObject(r,i,n)}),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(a,null,null,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function vc(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class vd extends y2{constructor(e){let{index:t,data:r,fixedRowsBottom:i,fixedRowsTop:n,rowIndexesSequence:o,removedCellMetas:s}=e;super("remove_row"),vc(this,"index",void 0),vc(this,"data",void 0),vc(this,"fixedRowsBottom",void 0),vc(this,"fixedRowsTop",void 0),vc(this,"rowIndexesSequence",void 0),vc(this,"removedCellMetas",void 0),this.index=t,this.data=r,this.fixedRowsBottom=i,this.fixedRowsTop=n,this.rowIndexesSequence=o,this.removedCellMetas=s}static startRegisteringEvents(e,t){e.addHook("beforeRemoveRow",(r,i,n,o)=>{t.done(()=>{let t=e.toPhysicalRow(r),n=t+i-1,o=(0,s.deepClone)(e.getSourceData(t,0,t+i-1,e.countSourceCols()-1));return new vd({index:t,data:o,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:vl(e,t,n,0,e.countCols()-1)})},o)})}undo(e,t){let r=e.getSettings(),i=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((e,t)=>{Object.keys(e).forEach(r=>{let n=parseInt(r,10);i.push([this.index+t,isNaN(n)?r:n,e[r]])})}),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(t=>{let[r,i,n]=t;e.setCellMetaObject(r,i,n)}),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function vg(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class vp extends y2{constructor(e){let{rows:t,finalIndex:r}=e;super("row_move"),vg(this,"rows",void 0),vg(this,"finalRowIndex",void 0),this.rows=t.slice(),this.finalRowIndex=r}static startRegisteringEvents(e,t){e.addHook("beforeRowMove",(e,r)=>{!1!==e&&t.done(()=>new vp({rows:e,finalIndex:r}))})}undo(e,t){let r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",t),hN(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexe
78s()).reverse().forEach(e=>{let{from:t,to:i}=e;t<i&&(i-=1),r.moveRow(i,t)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,t){let r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",t),r.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}}class vf extends y2{constructor(e){var t,r,i;let{cellRange:n}=e;super("unmerge_cells"),r=void 0,(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t="cellRange","string"))?i:i+"")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.cellRange=n}static startRegisteringEvents(e,t){e.addHook("afterUnmergeCells",(e,r)=>{r||t.done(()=>new vf({cellRange:e}))})}undo(e,t){let r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),r.mergeRange(this.cellRange,!0)}redo(e,t){let r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),r.unmergeRange(this.cellRange,!0),e.render()}}function vm(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vy(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let vv="undoRedo";eN.P.getSingleton().register("beforeUndo"),eN.P.getSingleton().register("afterUndo"),eN.P.getSingleton().register("beforeRedo"),eN.P.getSingleton().register("afterRedo");let vw=new Set;var vE=new WeakSet;class vS extends tn.vq{static get PLUGIN_KEY(){return"undoRedo"}static get PLUGIN_PRIORITY(){return 1e3}static get SETTING_KEYS(){return!0}constructor(e){var t;super(e),function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,vE),vE.add(this),vm(this,"doneActions",[]),vm(this,"undoneActions",[]),vm(this,"ignoreNewActions",!1),t=this,[y3,y4,y8,ve,vr,vn,vs,va,vu,vd,vp,vf].forEach(r=>r.startRegisteringEvents(e,t))}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return vy(vE,e,vC).call(e,...r)}),this.registerShortcuts(),vy(vE,this,vR).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),vy(vE,this,vb).call(this)}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],{runOnlyIf:e=>!e.altKey,group:vv})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(vv)}done(e,t){if(this.ignoreNewActions||"UndoRedo.undo"===t||"UndoRedo.redo"===t||"auto"===t)return;let r=this.doneActions.slice();if(!1===this.hot.runHooks("beforeUndoStackChange",r,t))return;let i=e(),n=this.undoneActions.slice();this.doneActions.push(i),this.hot.runHooks("afterUndoStackChange",r,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",n),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",n,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;let e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);let t=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());let r=(0,s.deepClone)(t);if(!1===this.hot.runHooks("beforeUndo",r))return;this.ignoreNewActions=!0;let i=this.undoneActions.slice();
78this.hot.runHooks("beforeRedoStackChange",i),t.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(t)}),this.hot.runHooks("afterRedoStackChange",i,this.undoneActions.slice()),this.hot.runHooks("afterUndo",r)}redo(){if(!this.isRedoAvailable())return;let e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);let t=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());let r=(0,s.deepClone)(t);if(!1===this.hot.runHooks("beforeRedo",r))return;this.ignoreNewActions=!0;let i=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",i),t.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(t)}),this.hot.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.hot.runHooks("afterRedo",r)}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 vC(e,t){"loadData"===t&&this.clear()}function vR(){let e=e=>{vw.has(e)||((0,rE.ZK)((0,rJ.e)`The "${e}" method is deprecated and it will be removed\x20
79          from the Core API in the future. Please use the method from the UndoRedo plugin\x20
80          (e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),vw.add(e))};this.hot.undo=()=>{e("undo"),this.undo()},this.hot.redo=()=>{e("redo"),this.redo()},this.hot.isUndoAvailable=()=>(e("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(e("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{e("clear"),this.clear()},this.hot.undoRedo=this}function vb(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}let vT="ht-dialog",vN=new Map([["base",function(){let e=null,t={};return{TEMPLATE_NAME:"base",dialogA11YOptions:()=>({role:"dialog"}),compile:function(){let r=(0,rJ.d)`${`
81      <div data-ref="contentElement" class="${vT}__content"></div>
82    `}`;return Object.assign(t,r.refs),e=r.fragment,r},focusableElements:function(){if(null===e)throw Error("Compile the template first.");return[]}}}],["confirm",function(e){let{id:t="",title:r="",description:i="",buttons:n=[]}=e,o=null,s={};return{TEMPLATE_NAME:"confirm",dialogA11YOptions:()=>({role:"alertdialog",ariaLabelledby:`${t}-dialog-confirm-title`,ariaDescribedby:i?`${t}-dialog-confirm-description`:void 0}),compile:function(){let e=(0,rJ.d)`${`
83      <div tabindex="-1" data-ref="contentElement" class="${vT}__content-wrapper-inner">
84        <div class="${vT}__content">
85          <h2
86            id="${t}-dialog-confirm-title"
87            class="${vT}__title">${(0,g.stripTags)(r)}</h2>
88          <p
89            id="${t}-dialog-confirm-description"
90            class="${vT}__description">${(0,g.stripTags)(i)}</p>
91        </div>
92        ${n.length>0?`
93          <div data-ref="buttonsContainer" class="${vT}__buttons">
94            ${n.map(e=>`
95              <button class="ht-button ht-button--${e.type}">${(0,g.stripTags)(e.text)}</button>
96            `).join("")}
97          </div>
98        `:""}
99      </div>
100    `}`;return Object.assign(s,e.refs),o=e.fragment,e},focusableElements:function(){if(null===o)throw Error("Compile the template first.");let{contentElement:e,buttonsContainer:t}=s,r=[];return t?r.push(...Array.from(t.children)):r.push(e),r}}}]]);function vA(e,t,r){vI(e,t),t.set(e,r)}function vI(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function vM(e,t){return e.get(vx(e,t))}function vO(e,t,r){return e.set(vx(e,t),r),r}function vx(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let v_=`
101<div data-ref="dialogElement" class="${vT}">
102  <div data-ref="dialogWrapperElement" class="${vT}__content-wrapper">
103</div>
104`;var vP=new WeakMap,vL=new WeakMap,vk=new WeakMap,vD=new WeakMap,vH=new WeakMap,vB=new WeakMap,vF=new WeakSet;class vV{constructor(e){let{rootElement:t,isRtl:r}=e;vI(this,vF),vF.add(this),vA(this,vP,void 0),vA(this,vL,void 0),vA(this,vk,!1),vA(this,vD,!1),vA(this,vH,vN.get("base")),vA(this,vB,[]),vO(vP,this,t),vO(vk,this,r),this.install()}useTemplate(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!vN.has(e)||"base"===e){let t=Array.from(vN.keys()).filter(e=>"base"!==e).join(", ");throw Error((0,rJ.e)`Invalid template: ${e}.\x20
105        Valid templates are: ${t}.`)}vO(vH,this,vN.get(e)(r)),vO(vB,this,(null!==(t=r.buttons)&&void 0!==t?t:[]).map(e=>e.callback))}useDefaultTemplate(){vO(vH,this,vN.get("base")()),vO(vB,this,[])}install(){var e;if(null!==(e=vM(vL,this))&&void 0!==e&&e.dialogElement)return;let t=(0,rJ.d)`${v_}`;vO(vL,this,t.refs);let{dialogElement:r}=vM(vL,this);(0,n.setAttribute)(r,[(0,m.kD)(),["dir",vM(vk,this)?"rtl":"ltr"]]),r.addEventListener("transitionstart",()=>vx(vF,this,vW).call(this)),r.addEventListener("transitionend",()=>vx(vF,this,vU).call(this)),vM(vP,this).after(t.fragment)}getContainer(){return vM(vL,this).dialogElement}getFocusableElements(){return vM(vH,this).focusableElements()}updateDialog(e){let{isVisible:t,content:r,customClassName:i,background:o,contentBackgroun
105d:s,animation:a,a11y:l}=e,h=vM(vH,this).compile(),{dialogElement:u,dialogWrapperElement:c}=vM(vL,this);c.innerHTML="",c.appendChild(h.fragment),Object.assign(vM(vL,this),h.refs);let{contentElement:d,buttonsContainer:g}=vM(vL,this);"base"!==vM(vH,this).TEMPLATE_NAME&&Object.assign(l,vM(vH,this).dialogA11YOptions());let p=i?` ${i}`:"",f=o?` ${vT}--background-${o}`:"",y=a?` ${vT}--animation`:"",w=t?` ${vT}--show`:"";u.className=[vT,`${vT}--${vM(vH,this).TEMPLATE_NAME}`,"handsontable",p,f,y,w].join(" "),(0,n.setAttribute)(u,["base"===vM(vH,this).TEMPLATE_NAME?(0,m.Qk)(-1):void 0]),(0,n.setAttribute)(u,["alertdialog"===l.role?(0,m.zU)():(0,m.Uo)()]),l.ariaLabel&&!l.ariaLabelledby?(0,n.setAttribute)(u,[l.ariaLabel?(0,m.QK)(l.ariaLabel):void 0]):(0,n.removeAttribute)(u,"aria-label"),l.ariaLabelledby?(0,n.setAttribute)(u,[(0,m.tx)(l.ariaLabelledby)]):(0,n.removeAttribute)(u,"aria-labelledby"),l.ariaDescribedby?(0,n.setAttribute)(u,[(0,m.LI)(l.ariaDescribedby)]):(0,n.removeAttribute)(u,"aria-describedby");let E=s?` ${vT}__content--background`:"";return(0,n.addClass)(d,`${vT}__content${E}`),"base"===vM(vH,this).TEMPLATE_NAME?(d.innerHTML="","string"==typeof r?(0,n.fastInnerHTML)(d,r):(r instanceof HTMLElement||r instanceof DocumentFragment)&&d.appendChild(r)):g&&Array.from(g.children).forEach((e,t)=>{let r=vM(vB,this)[t];r&&e.addEventListener("click",r)}),this}showDialog(e){let{dialogElement:t}=vM(vL,this);return t.style.display="block",e&&t.offsetHeight,(0,n.addClass)(t,`${vT}--show`),vO(vD,this,!1),this}hideDialog(e){let{dialogElement:t}=vM(vL,this);return(0,n.removeClass)(t,`${vT}--show`),(!e||vM(vD,this))&&e||(t.style.display="none"),vO(vD,this,!1),this}focusDialog(){vM(vL,this).dialogElement.focus()}updateWidth(e){return vM(vL,this).dialogElement.style.width=`${e}px`,this}updateHeight(e){return vM(vL,this).dialogElement.style.height=`calc(100% - ${e}px)`,this}destroyDialog(){var e;null===(e=vM(vL,this))||void 0===e||e.dialogElement.remove(),vO(vL,this,null)}}function vU(){let{dialogElement:e}=vM(vL,this);(0,n.hasClass)(e,`${vT}--show`)||(e.style.display="none")}function vW(){vO(vD,this,!0)}function vj(e,t,r){vG(e,t),t.set(e,r)}function vG(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function v$(e,t,r){return e.set(vY(e,t),r),r}function vz(e,t){return e.get(vY(e,t))}function vY(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}(0,s.mixin)(vV,iI.Z);let vK="dialog",vX=`plugin:${vK}`;var vq=new WeakMap,vZ=new WeakMap,vQ=new WeakMap,vJ=new WeakSet;class v0 extends tn.vq{constructor(){super(...arguments),vG(this,vJ),vJ.add(this),vj(this,vq,null),vj(this,vZ,!1),vj(this,vQ,null)}static get PLUGIN_KEY(){return vK}static get PLUGIN_PRIORITY(){return 360}static get DEFAULT_SETTINGS(){return{template:null,content:"",customClassName:"",background:"solid",contentBackground:!1,animation:!0,closable:!1,a11y:{role:"dialog",ariaLabel:"Dialog",ariaLabelledby:"",ariaDescribedby:""}}}static get SETTINGS_VALIDATORS(){return{template:e=>(0,s.isObject)(e)&&typeof["alert","confirm"].includes(e.type)&&"string"==typeof e.title&&(void 0===(null==e?void 0:e.description)||"string"==typeof(null==e?void 0:e.description))&&(void 0===(null==e?void 0:e.buttons)||Array.isArray(null==e?void 0:e.buttons)&&e.buttons.every(e=>"object"==typeof e&&"string"==typeof e.text&&["primary","secondary"].includes(e.type)&&(void 0===e.callback||"function"==typeof e.callback))),content:e=>"string"==typeof e||"undefined"!=typeof HTMLElement&&e instanceof HTMLElement||"undefined"!=typeof DocumentFragment&&e instanceof DocumentFragment,customClassName:e=>"string"==typeof e,background:e=>["solid","semi-transparent"].includes(e),contentBackground:e=>"boolean"==typeof e,animation:e=>"boolean"==typeof e,closable:e=>"boolean"==typeof e,a11y:e=>(0,s.isObject)(e)&&(void 0===(null==e?void 0:e.role)||["dialog","alertdialog"].includes(null==e?void 0:e.role))&&(void 0===(null==e?void 0:e.ariaLabel)||"string"==typeof(null==e?void 0:e.ariaLabel))&&(void 0===(null==e?void 0:e.ariaLabelledby)||"string"==typeof(null==e?void 0:e.ariaLabelledby))&&(void 0===(null==e?void 0:e.ariaDescribedby)||"string"==typeof(null==e?void 0:e.ariaDescribedby))}}isEnabled(){return!!this.hot.getSettings()[vK]}enablePlugin(){this.enabled||(vz(vq,this)||v$(vq,this,new vV({rootElement:this.hot.rootGridElement,isRtl:this.hot.isRtl()})),vY(vJ,this,v1).call(this),vY(vJ,this,v5).call(this),this.addHook("afterViewRender",()=>vY(vJ,this,v9).call(this)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hide(),vY(vJ,this,v2).call(this),vY(vJ,this,v3).call(this),super.disablePlugin()}isVisible(){return vz(vZ,this)}show(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.enabled){if(this.isVisible()){this.update(e);return}this.hot.runHooks("beforeDialogShow"),this.update(e),vz(vq,this).showDialog(this.getSetting("animation")),v$(vZ,this,!0),this.hot.getFocusScopeManager().activateScope(vK),v$(vQ,this,this.hot.selection.exportSelection()),this.hot.deselectCell(),this.hot.runHooks("afterDialogShow")}}hide(){var e;this.isVisible()&&(this.hot.runHooks("beforeDialogHide"),vz(vq,this).hideDialog(this.getSetting("animation")),v$(vZ,this,!1),this.hot.getFocusScopeManager().deactivateScope(vK),(null===(e=vz(vQ,this))||void 0===e?void 0:e.ranges.length)>0?(this.hot.selection.importSelection(vz(vQ,this)),this.hot.view.render(),v$(vQ,this,null)):this.hot.selectCell(0,0),this.hot.runHooks("afterDialogHide"))}update(e){if(!this.enabled)return;this.updatePluginSettings(e);let t=this.getSetting("template");
105if(t!==v0.DEFAULT_SETTINGS.template&&this.getSetting("content")!==v0.DEFAULT_SETTINGS.content)throw Error("The `template` option cannot be used together with the `content` option.");t?vz(vq,this).useTemplate(t.type,{id:this.hot.guid,...t}):vz(vq,this).useDefaultTemplate(),vz(vq,this).updateDialog({isVisible:this.isVisible(),content:this.getSetting("content"),customClassName:this.getSetting("customClassName"),background:this.getSetting("background"),contentBackground:this.getSetting("contentBackground"),animation:this.getSetting("animation"),a11y:this.getSetting("a11y")})}showAlert(e,t){let{title:r="Alert",description:i}=(0,s.isObject)(e)?e:{title:e};this.show({template:{type:"confirm",title:r,description:i,buttons:[{text:this.hot.getTranslatedPhrase(eA.OK),type:"primary",callback:function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return null==t?void 0:t(...r)}}]},contentBackground:!1,background:"solid",animation:!0,closable:!1})}showConfirm(e,t,r){let{title:i="Confirm",description:n}=(0,s.isObject)(e)?e:{title:e};this.show({template:{type:"confirm",title:i,description:n,buttons:[{text:this.hot.getTranslatedPhrase(eA.CANCEL),type:"secondary",callback:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return null==r?void 0:r(...t)}},{text:this.hot.getTranslatedPhrase(eA.OK),type:"primary",callback:function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return null==t?void 0:t(...r)}}]},contentBackground:!0,background:"semi-transparent",animation:!0,closable:!1})}focus(){vz(vq,this).focusDialog()}destroy(){var e;null===(e=vz(vq,this))||void 0===e||e.destroyDialog(),v$(vq,this,null),v$(vZ,this,!1),v$(vQ,this,null),super.destroy()}}function v1(){var e;let t=this.hot.getShortcutManager(),r=null!==(e=t.getContext(vX))&&void 0!==e?e:t.addContext(vX);r.addShortcut({keys:[["Escape"]],callback:()=>{this.hide()},runOnlyIf:()=>vz(vZ,this)&&this.getSetting("closable"),group:vK}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],preventDefault:!1,callback:e=>{this.hot._registerTimeout(()=>{e.shiftKey?this.hot.runHooks("dialogFocusPreviousElement"):this.hot.runHooks("dialogFocusNextElement")})},group:vK})}function v2(){this.hot.getShortcutManager().getContext(vX).removeShortcutsByGroup(vK)}function v5(){this.hot.getFocusScopeManager().registerScope(vK,vz(vq,this).getContainer(),{shortcutsContextName:vX,type:"modal",runOnlyIf:()=>this.isVisible(),onActivate:e=>{let t=this.hot.isListening(),r=vz(vq,this).getFocusableElements();r.length>0?"tab_from_above"===e?r.at(0).focus():"tab_from_below"===e&&r.at(-1).focus():"tab_from_above"!==e&&"tab_from_below"!==e&&t&&!vz(vq,this).getContainer().contains(this.hot.rootDocument.activeElement)&&vz(vq,this).getContainer().focus(),t&&this.hot.runHooks("afterDialogFocus","unknown"===e?"show":e)}})}function v3(){this.hot.getFocusScopeManager().unregisterScope(vK)}function v9(){let{view:e,rootWrapperElement:t,rootWindow:r}=this.hot,i=e.isHorizontallyScrollableByWindow()?e.getTotalTableWidth():e.getWorkspaceWidth();vz(vq,this).updateWidth(i);let n=t.querySelector(".hot-display-license-info");if(n){let e=n.offsetHeight,t=Number.parseFloat(r.getComputedStyle(n).marginTop);vz(vq,this).updateHeight(e+t)}}function v4(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function v7(e,t,r){return e.set(v6(e,t),r),r}function v8(e,t){return e.get(v6(e,t))}function v6(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let we="loading",wt=`ht-${we}`;var wr=new WeakMap,wi=new WeakSet;class wn extends tn.vq{constructor(){super(...arguments),v4(this,wi),wi.add(this),v4(this,wr),wr.set(this,null)}static get PLUGIN_KEY(){return we}static get PLUGIN_PRIORITY(){return 350}static get DEFAULT_SETTINGS(){return{icon:`<svg class="${wt}__icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path stroke="currentColor" stroke-width="2" d="M15 8a7 7 0 1 1-3.5-6.062"></path></svg>`,title:void 0,description:""}}static get SETTINGS_VALIDATORS(){return{icon:e=>"string"==typeof e,title:e=>"string"==typeof e,description:e=>"string"==typeof e}}isEnabled(){return!!this.hot.getSettings()[we]}enablePlugin(){if(!this.enabled){if(null===v8(wr,this)){var e;v7(wr,this,this.hot.getPlugin("dialog")),null!==(e=v8(wr,this))&&void 0!==e&&e.isEnabled()||(this.hot.getSettings().dialog=!0),this.hot.addHook("afterDialogFocus",()=>v6(wi,this,wo).call(this))}super.enablePlugin()}}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hide(),super.disablePlugin()}isVisible(){var e,t;return null!==(e=null===(t=v8(wr,this))||void 0===t?void 0:t.isVisible())&&void 0!==e&&e}show(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.isEnabled()&&v8(wr,this)&&null!==(e=v8(wr,this))&&void 0!==e&&e.isEnabled()){if
105(this.isVisible()){this.update(t);return}!1!==this.hot.runHooks("beforeLoadingShow")&&(this.update(t),v8(wr,this).show(),this.hot.runHooks("afterLoadingShow"))}}hide(){var e;v8(wr,this)&&null!==(e=v8(wr,this))&&void 0!==e&&e.isEnabled()&&this.isVisible()&&!1!==this.hot.runHooks("beforeLoadingHide")&&(v8(wr,this).hide(),this.hot.runHooks("afterLoadingHide"))}update(e){var t,r;if(!this.isEnabled()||!v8(wr,this)||!(null!==(t=v8(wr,this))&&void 0!==t&&t.isEnabled()))return;this.updatePluginSettings(e);let i=this.hot.guid,n=this.getSetting("icon"),o=null!==(r=this.getSetting("title"))&&void 0!==r?r:this.hot.getTranslatedPhrase(eA.LOADING_TITLE),s=this.getSetting("description"),a=function(e){let{id:t,icon:r,title:i,description:n}=e;return`
106    <div class="${wt}__content">
107      <i class="${wt}__icon">${r}</i>
108      <div class="${wt}__text">
109        <h2 id="${t}-${we}-title" class="${wt}__title">${i}</h2>
110        ${n?`<p id="${t}-${we}-description" class="${wt}__description">${n}</p>`:""}
111      </div>
112    </div>
113  `}({id:i,icon:n,title:o,description:s});v8(wr,this).update({content:a,customClassName:wt,background:0===this.hot.countSourceRows()?"solid":"semi-transparent",a11y:{role:"alertdialog",ariaLabelledby:`${i}-${we}-title`,ariaDescribedby:s?`${i}-${we}-description`:void 0}})}destroy(){v7(wr,this,null),super.destroy()}}function wo(){v8(wr,this).focus()}function ws(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function wa(e,t){return e.get(wh(e,t))}function wl(e,t,r){return e.set(wh(e,t),r),r}function wh(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let wu="ht-empty-data-state",wc=`<div data-ref="emptyDataStateElement" class="${wu} handsontable">
114  <div class="${wu}__content-wrapper">
115    <div data-ref="emptyDataStateInner" class="${wu}__content-wrapper-inner"></div>
116  </div>
117</div>`,wd=e=>{let{title:t,description:r,buttons:i}=e;return`
118  <div class="${wu}__content">
119    ${t?`<h2 class="${wu}__title">${(0,g.stripTags)(t)}</h2>`:""}
120    ${r?`<p class="${wu}__description">${(0,g.stripTags)(r)}</p>`:""}
121  </div>
122  <div
123    data-ref="emptyDataStateButtons"
124    class="${wu}__buttons${(null==i?void 0:i.length)>0?` ${wu}__buttons--has-buttons`:""}"
125  >${(null==i?void 0:i.length)>0?i.map(e=>`<button class="ht-button ht-button--${e.type}">${(0,g.stripTags)(e.text)}</button>`).join(""):""}</div>`};var wg=new WeakMap,wp=new WeakMap,wf=new WeakMap,wm=new WeakMap;class wy{constructor(e){let{rootElement:t,rootDocument:r}=e;ws(this,wg,void 0),ws(this,wp,void 0),ws(this,wf,void 0),ws(this,wm,void 0),wl(wg,this,t),wl(wp,this,r),this.install()}install(){var e;if(null!==(e=wa(wf,this))&&void 0!==e&&e.emptyDataStateElement)return;let t=(0,rJ.d)`${wc}`;wl(wf,this,t.refs);let{emptyDataStateInner:r,emptyDataStateElement:i}=wa(wf,this);(0,n.setAttribute)(r,[(0,m.Qk)(-1)]),(0,n.setAttribute)(i,[(0,m.Qk)(-1)]),wa(wg,this).after(t.fragment)}getElement(){var e;return null===(e=wa(wf,this))||void 0===e?void 0:e.emptyDataStateElement}getFocusableElements(){let{emptyDataStateButtons:e,emptyDataStateInner:t}=wa(wf,this),r=Array.from(null==e?void 0:e.children);return 0===r.length?[t]:r}show(){var e;null!==(e=wa(wf,this))&&void 0!==e&&e.emptyDataStateElement&&(wa(wf,this).emptyDataStateElement.style.display="block")}hide(){var e,t;null!==(e=wa(wf,this))&&void 0!==e&&e.emptyDataStateElement&&(null===(t=wa(wm,this))||void 0===t||t.remove(),wl(wm,this,null),wa(wf,this).emptyDataStateElement.style.display="none")}updateContent(e){var t;let{emptyDataStateInner:r}=wa(wf,this),i="";i="string"==typeof e?{title:e}:{title:null==e?void 0:e.title,description:null==e?void 0:e.description,buttons:null==e?void 0:e.buttons};let n=(0,rJ.d)`${wd(i)}`;wl(wf,this,{...wa(wf,this),...n.refs}),r.innerHTML="",r.appendChild(n.fragment),(null===(t=i.buttons)||void 0===t?void 0:t.length)>0&&Array.from(wa(wf,this).emptyDataStateButtons.children).forEach((e,t)=>{e.addEventListener("click",i.buttons[t].callback)})}updateClassNames(e){let{emptyDataStateElement:t}=wa(wf,this);e.countRenderableColumns()>0&&e.getColumnHeadersCount()>0?(0,n.addClass)(t,`${wu}--disable-top-border`):(0,n.removeClass)(t,`${wu}--disable-top-border`),e.countRenderableRows()>0&&e.getRowHeadersCount()>0?(0,n.addClass)(t,`${wu}--disable-inline-border`):(0,n.removeClass)(t,`${wu}--disable-inline-border`),e.hasHorizontalScroll()&&!e.isHorizontallyScrollableByWindow()?(0,n.addClass)(t,`${wu}--disable-bottom-border`):(0,n.removeClass)(t,`${wu}--disable-bottom-border`)}updateSize(e){let{emptyDataStateElement:t}=wa(wf,this),r=e.hasHorizontalScroll()?(0,n.getScrollbarWidth)(e.hot.rootDocument):0,i=e.countRenderableRows(),o=e.countRenderableColumns(),s=e.getColumnHeadersCount();if(t.style.top=o>0?`${e.getColumnHeaderHeight()}px`:"0px",t.style.insetInlineStart=i>0?`${e.getRowHeaderWidth()}px`:"0px",0===i)wa(wm,this)||(wl(wm,this,wa(wp,this).createElement("div")),wa(wm,this).classList.add(`${wu}-placeholder`),e._wt.wtTable.holder.appendChild(wa(wm,this))),wa(wm,this).style.width="100%",wa(wm,this).style.height="150px";else{var a;null===(a=wa(wm,this))||void 0===a||a.remove(),wl(wm,this,null)}let l=e.getWorkspaceWidth(),h=e.getTableHeight();e.isHorizontallyScrollableByWindow()?o>0?l=e.getTotalTableWidth():i>0&&(l=e.getViewportWidth()):i>0?l=e.getViewportWidth():e.getTableWidth()-e.getRowHeaderWidth()<e.getViewportWidth()&&o>0&&(l=e.getTableWidth()),e.isVerticallyScrollableByWindow()||e.hasVerticalScroll()?h=o>0?e.hot.getTableHeight()-e.getColumnHeaderHeight():e.hot.getTableHeight():s>0&&o>
1250?h=e.getViewportHeight()-r:s>0&&0===o&&(h=e.getWorkspaceHeight()-r),t.style.width=`${l}px`,t.style.height=`${h}px`}destroy(){var e,t;null===(e=wa(wf,this))||void 0===e||null===(e=e.emptyDataStateElement)||void 0===e||e.remove(),null===(t=wa(wm,this))||void 0===t||t.remove(),wl(wm,this,null),wl(wf,this,null)}}function wv(e,t,r){ww(e,t),t.set(e,r)}function ww(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function wE(e,t,r){return e.set(wC(e,t),r),r}function wS(e,t){return e.get(wC(e,t))}function wC(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let wR="emptyDataState",wb=Object.freeze({UNKNOWN:"unknown",FILTERS:"filters"}),wT=`plugin:${wR}`;var wN=new WeakMap,wA=new WeakMap,wI=new WeakMap,wM=new WeakMap,wO=new WeakMap,wx=new WeakSet;class w_ extends tn.vq{constructor(){super(...arguments),ww(this,wx),wx.add(this),wv(this,wN,!1),wv(this,wA,null),wv(this,wI,null),wv(this,wM,!1),wv(this,wO,null)}static get PLUGIN_KEY(){return wR}static get PLUGIN_PRIORITY(){return 370}static get DEFAULT_SETTINGS(){return{message:void 0}}static get SETTINGS_VALIDATORS(){return{message:e=>"string"==typeof e||"function"==typeof e||(0,s.isObject)(e)&&(void 0===(null==e?void 0:e.title)||"string"==typeof(null==e?void 0:e.title))&&(void 0===(null==e?void 0:e.description)||"string"==typeof(null==e?void 0:e.description))&&(void 0===(null==e?void 0:e.buttons)||Array.isArray(null==e?void 0:e.buttons)&&(null==e?void 0:e.buttons.every(e=>"object"==typeof e&&"string"==typeof e.text&&"string"==typeof e.type&&["primary","secondary"].includes(e.type)&&"function"==typeof e.callback)))||void 0===e}}isEnabled(){return!!this.hot.getSettings()[wR]}enablePlugin(){this.enabled||(wS(wA,this)||(wE(wA,this,new wy({rootElement:this.hot.rootGridElement,rootDocument:this.hot.rootDocument})),wC(wx,this,wD).call(this),wC(wx,this,wP).call(this),wC(wx,this,wL).call(this)),this.addHook("afterInit",()=>wC(wx,this,wG).call(this)),this.addHook("afterRender",()=>wC(wx,this,w$).call(this)),this.addHook("afterRowSequenceCacheUpdate",()=>wC(wx,this,wF).call(this)),this.addHook("afterColumnSequenceCacheUpdate",()=>wC(wx,this,wF).call(this)),this.addHook("beforeFilter",e=>wC(wx,this,wz).call(this,e)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),wC(wx,this,wU).call(this),this.isVisible()&&wS(wA,this).show(),super.updatePlugin()}disablePlugin(){wC(wx,this,wH).call(this),wC(wx,this,wk).call(this),wS(wA,this).destroy(),wE(wA,this,null),super.disablePlugin()}isVisible(){return wS(wN,this)}destroy(){var e;wE(wN,this,!1),null===(e=wS(wA,this))||void 0===e||e.destroy(),wE(wA,this,null),wE(wI,this,null),wE(wM,this,!1),wE(wO,this,null),super.destroy()}}function wP(){this.eventManager.addEventListener(wS(wA,this).getElement(),"wheel",e=>wC(wx,this,wj).call(this,e))}function wL(){wE(wI,this,new MutationObserver(()=>{if(!this.hot)return;let e=wS(wA,this).getElement();this.hot.rootGridElement.nextElementSibling!==e&&this.hot.rootGridElement.after(e)})),wS(wI,this).observe(this.hot.rootWrapperElement,{childList:!0})}function wk(){wS(wI,this).disconnect(),wE(wI,this,null)}function wD(){this.hot.getFocusScopeManager().registerScope(wR,wS(wA,this).getElement(),{shortcutsContextName:wT,runOnlyIf:()=>this.isVisible(),onActivate:e=>{var t;let r=null===(t=wS(wA,this))||void 0===t?void 0:t.getFocusableElements();r.length>0&&("tab_from_above"===e?r.at(0).focus():"tab_from_below"===e&&r.at(-1).focus())}})}function wH(){this.hot.getFocusScopeManager().unregisterScope(wR)}function wB(e){var t,r,i;let n;
125return"string"==typeof(n="function"==typeof this.getSetting("message")?this.getSetting("message")(e):this.getSetting("message"))&&(n={title:n}),null!==(t=n)&&void 0!==t&&t.title||null!==(r=n)&&void 0!==r&&r.description||null!==(i=n)&&void 0!==i&&i.buttons||(n={},e===wb.FILTERS?(n.title=this.hot.getTranslatedPhrase(eA.EMPTY_DATA_STATE_TITLE_FILTERS),n.description=this.hot.getTranslatedPhrase(eA.EMPTY_DATA_STATE_DESCRIPTION_FILTERS),n.buttons=[{text:this.hot.getTranslatedPhrase(eA.EMPTY_DATA_STATE_BUTTONS_FILTERS_RESET),type:"secondary",callback:()=>{let e=this.hot.getPlugin("filters");e&&(e.clearConditions(),e.filter())}}]):(n.title=this.hot.getTranslatedPhrase(eA.EMPTY_DATA_STATE_TITLE),n.description=this.hot.getTranslatedPhrase(eA.EMPTY_DATA_STATE_DESCRIPTION))),n}function wF(){this.hot.view&&(0===this.hot.view.countRenderableColumns()||0===this.hot.view.countRenderableRows()?wC(wx,this,wV).call(this):wC(wx,this,wW).call(this))}function wV(){wS(wN,this)||(this.hot.runHooks("beforeEmptyDataStateShow"),wC(wx,this,wU).call(this),wS(wA,this).show(),wE(wN,this,!0),wE(wO,this,this.hot.selection.exportSelection()),this.hot.getFocusScopeManager().activateScope(wR),this.hot.runHooks("afterEmptyDataStateShow"))}function wU(){wS(wM,this)?wS(wA,this).updateContent(wC(wx,this,wB).call(this,wb.FILTERS)):wS(wA,this).updateContent(wC(wx,this,wB).call(this,wb.UNKNOWN))}function wW(){var e;wS(wN,this)&&(this.hot.runHooks("beforeEmptyDataStateHide"),wS(wA,this).hide(),wE(wN,this,!1),this.hot.getFocusScopeManager().deactivateScope(wR),(null===(e=wS(wO,this))||void 0===e?void 0:e.ranges.length)>0?(this.hot.selection.importSelection(wS(wO,this)),this.hot.view.render(),wE(wO,this,null)):this.hot.selectCell(0,0),this.hot.runHooks("afterEmptyDataStateHide"))}function wj(e){let t=Number.isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;0!==t&&this.hot.view.hasHorizontalScroll()&&!this.hot.view.isHorizontallyScrollableByWindow()&&(this.hot.view.setTableScrollPosition({left:this.hot.view.getTableScrollPosition().left+t}),e.preventDefault())}function wG(){wC(wx,this,wF).call(this),this.hot.render()}function w$(){var e;null!==(e=wS(wA,this))&&void 0!==e&&e.getElement()&&this.isVisible()&&(wS(wA,this).updateSize(this.hot.view),wS(wA,this).updateClassNames(this.hot.view))}function wz(e){wE(wM,this,(null==e?void 0:e.length)>0),this.isVisible()&&wC(wx,this,wU).call(this)}var wY=r(98282);function wK(){(0,eE.qm)(O.Hf),(0,eE.qm)(A),(0,eE.qm)(x),(0,eE.qm)(eu),(0,eE.qm)(ed),(0,eE.qm)(u),(0,eE.qm)(eg),(0,eE.qm)(ef),(0,eE.qm)(ev),(0,eE.qm)(i.H),(0,eE.qm)(ew),(0,ej.zn)(eb),(0,ej.zn)(eS.Z),(0,ej.zn)(eP),(0,ej.zn)(eT),(0,ej.zn)(ek),(0,ej.zn)(eC),(0,ej.zn)(eF),(0,ej.zn)(eV),(0,ej.zn)(eU),(0,ej.zn)(f.V),(0,ej.zn)(eW),(0,eQ.Ie)(eG),(0,eQ.Ie)(eK),(0,eQ.Ie)(eY),(0,eQ.Ie)(eX),(0,eQ.Ie)(eZ),(0,ti.xN)(e1),(0,ti.xN)(e2),(0,ti.xN)(e3),(0,ti.xN)(e9),(0,ti.xN)(e4),(0,ti.xN)(e8),(0,ti.xN)(e6),(0,ti.xN)(te),(0,ti.xN)(tt.n),(0,ti.xN)(tr),(0,wY.fo)(tC),(0,wY.fo)(tB),(0,wY.fo)(t5),(0,wY.fo)(rv),(0,wY.fo)(rx),(0,wY.fo)(il),(0,wY.fo)(iE),(0,wY.fo)(nm),(0,wY.fo)(om),(0,wY.fo)(o4),(0,wY.fo)(sS),(0,wY.fo)(sM),(0,wY.fo)(sF),(0,wY.fo)(s4),(0,wY.fo)(hr),(0,wY.fo)(ue),(0,wY.fo)(uD),(0,wY.fo)(uq),(0,wY.fo)(ce),(0,wY.fo)(cO),(0,wY.fo)(c7),(0,wY.fo)(dO),(0,wY.fo)(d7),(0,wY.fo)(gQ),(0,wY.fo)(py),(0,wY.fo)(pw),(0,wY.fo)(fu),(0,wY.fo)(fX),(0,wY.fo)(mj),(0,wY.fo)(ye),(0,wY.fo)(ya),(0,wY.fo)(yW),(0,wY.fo)(yK),(0,wY.fo)(y0),(0,wY.fo)(vS),(0,wY.fo)(v0),(0,wY.fo)(wn),(0,wY.fo)(w_)}},91350:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}}),r(65230);var i=r(46879),n=r(65839);function o(e,t,r,o,s,a,l){let h=l.ariaTags,u=[],c=[],d=[],g=[];l.className&&(0,i.addClass)(t,l.className),l.readOnly?(u.push(l.readOnlyCellClassName),h&&g.push((0,n.zR)())):h&&d.push((0,n.zR)()[0]),!1===l.valid&&l.invalidCellClassName?(u.push(l.invalidCellClassName),h&&g.push((0,n.w1)())):(c.push(l.invalidCellClassName),h&&d.push((0,n.w1)()[0])),!1===l.wordWrap&&l.noWordWrapClassName&&u.push(l.noWordWrapClassName),!a&&l.placeholder&&u.push(l.placeholderCellClassName),l.textEllipsis&&u.push("htTextEllipsis"),(0,i.removeClass)(t,c),(0,i.addClass)(t,u),(0,i.removeAttribute)(t,d),(0,i.setAttribute)(t,g)}o.RENDERER_TYPE="base"},26595:function(e,t,r){"use strict";r.d(t,{Bp:function(){return l},LX:function(){return s},Y3:function(){return o},zn:function(){return h}}),r(76346);let{register:i,getItem:n,hasItem:o,getNames:s,getValues:a}=(0,r(14216).Qv)("renderers");function l(e){if("function"==typeof e)return e;if(!o(e))throw Error(`No registered renderer found under "${e}" name`);return n(e)}function h(e,t){"string"!=typeof e&&(e=(t=e).RENDERER_TYPE),i(e,t)}},48463:function(e,t,r){"use strict";r.d(t,{V:function(){return s}});var i=r(91350),n=r(46879),o=r(21927);function s(e,t,r,s,a,l,h){i.Z.apply(this,[e,t,r,s,a,l,h]);let u=l;!u&&h.placeholder&&(u=h.placeholder),u=(0,o.stringify)(u),h.trimWhitespace&&(u=u.trim()),(0,n.fastInnerText)(t,u)}s.RENDERER_TYPE="text"},4471:function(e,t,r){"use strict";r.d(t,{Z:function(){return eh}}),r(76346),r(65230),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975),r(70470),r(95984),r(17901),r(97934);var i=r(79401),n=r(92263),o=r(65166);class s{constructor(e,t){this.settings=e,this.cellRange=t||null}isEmpty(){return null===this.cellRange}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){let e=this.cellRange.getOuterTopStartCorner(),t=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,t.row,t.col]}destroy(){this.runLocalHooks("destroy")}}(0,n.mixin)(s,o.Z);var a=s;class l extends a{constructor(e,t){var r,i;super(e,null),(r="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r="visualCellRange","string"))?i:i+"")in this?Object.defineProperty(this,r,{value:null,enumerable:!0,configurable:!0,writable:!0}):this[r]=null,this.visualCellRange=t||null,this.commit()}add(e){return null===this.visualCellRange?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}
125trimToVisibleCellsRangeOnly(e){let{from:t,to:r}=e,i=this.getNearestNotHiddenCoords(t,1),n=this.getNearestNotHiddenCoords(r,-1);return null===i||null===n?null:((i.row>n.row||i.col>n.col)&&(i=t,n=r),this.settings.createCellRange(i,i,n))}getNearestNotHiddenCoords(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,t);if(null===i)return null;let n=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,r);return null===n?null:this.settings.createCellCoords(i,n)}getNearestNotHiddenIndex(e,t,r){return t<0?t:e.getNearestNotHiddenIndex(t,r)}commit(){if(null===this.visualCellRange)return this;let e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return null===e?this.cellRange=null:this.cellRange=this.createRenderableCellRange(e.from,e.to),this}syncWith(e){let t=e.from.clone().normalize(),r="N-S"===e.getVerticalDirection()?1:-1,i="W-E"===e.getHorizontalDirection()?1:-1,n=this.settings.visualToRenderableCoords(this.visualCellRange.highlight),o=null;if((null===n||null===n.col||null===n.row)&&(o=this.getNearestNotHiddenCoords(t,r,i)),null!==o&&e.overlaps(o)){let t=e.highlight.clone();if(t.row>=0&&(t.row=o.row),t.col>=0&&(t.col=o.col),null===this.cellRange){let e=this.settings.visualToRenderableCoords(t);this.cellRange=this.settings.createCellRange(e)}e.setHighlight(t)}return"focus"===this.settings.selectionType&&null!==n&&null===o&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){let{from:e,to:t}=this.cellRange;return[Math.min(e.row,t.row),Math.min(e.col,t.col),Math.max(e.row,t.row),Math.max(e.col,t.col)]}getVisualCorners(){let e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),t=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,t.row,t.col]}createRenderableCellRange(e,t){let r=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(t);return null===r.row||null===r.col||null===i.row||null===i.col?null:this.settings.createCellRange(r,r,i)}}function h(e){let{activeHeaderClassName:t,...r}=e;return new l({className:t,...r,selectionType:i.CD})}function u(e){let{areaCornerVisible:t,...r}=e;return new l({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:t},...r,selectionType:i.AI})}function c(e){let{...t}=e;return new l({className:"highlight",...t,selectionType:i.AI})}function d(e){let{columnClassName:t,...r}=e;return new l({className:t,...r,selectionType:i.BA})}var g=r(65839);function p(e){let{headerClassName:t,...r}=e;return new l({className:t,...r,selectionType:i.Nc})}function f(e){let{rowClassName:t,...r}=e;return new l({className:t,...r,selectionType:i.Os})}var m=r(22386);function y(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var E=new WeakSet;class S{constructor(e){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(this,E),E.add(this),y(this,"options",void 0),y(this,"layerLevel",0),y(this,"focus",void 0),y(this,"fill",void 0),y(this,"layeredAreas",new Map),y(this,"areas",new Map),y(this,"rowHeaders",new Map),y(this,"columnHeaders",new Map),y(this,"activeRowHeaders",new Map),y(this,"activeColumnHeaders",new Map),y(this,"activeCornerHeaders",new Map),y(this,"rowHighlights",new Map),y(this,"columnHighlights",new Map),y(this,"customSelections",[]),this.options=e,this.focus=function(e){let{cellCornerVisible:t,...r}=e;return new l({className:"current",headerAttributes:[(0,g.Ak)()],border:{width:2,color:"#4b89ff",cornerVisible:t},...r,selectionType:i.t8})}(e),this.fill=function(e){let{...t}=e;return new l({className:"fill",border:{width:1,color:"#ff0000"},...t,selectionType:i.P$})}(e)}isEnabledFor(e,t){let r=e;e===i.t8&&(r="current");let n=this.options.disabledCellSelection(t.row,t.col);return"string"==typeof n&&(n=[n]),!1===n||Array.isArray(n)&&!n.includes(r)}useLayerLevel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return w(E,this,C).call(this,this.layeredAreas,u)}
125getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return w(E,this,C).call(this,this.areas,c)}getAreas(){return[...this.areas.values()]}createRowHeader(){return w(E,this,C).call(this,this.rowHeaders,p)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return w(E,this,C).call(this,this.columnHeaders,p)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return w(E,this,C).call(this,this.activeRowHeaders,h)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return w(E,this,C).call(this,this.activeColumnHeaders,h)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return w(E,this,C).call(this,this.activeCornerHeaders,h)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return w(E,this,C).call(this,this.rowHighlights,f)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return w(E,this,C).call(this,this.columnHighlights,d)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(function(e){let{border:t,visualCellRange:r,...n}=e;return new l({...t,...n,selectionType:i.$7},r)}({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),(0,m.arrayEach)(this.areas.values(),e=>void e.clear()),(0,m.arrayEach)(this.layeredAreas.values(),e=>void e.clear()),(0,m.arrayEach)(this.rowHeaders.values(),e=>void e.clear()),(0,m.arrayEach)(this.columnHeaders.values(),e=>void e.clear()),(0,m.arrayEach)(this.activeRowHeaders.values(),e=>void e.clear()),(0,m.arrayEach)(this.activeColumnHeaders.values(),e=>void e.clear()),(0,m.arrayEach)(this.activeCornerHeaders.values(),e=>void e.clear()),(0,m.arrayEach)(this.rowHighlights.values(),e=>void e.clear()),(0,m.arrayEach)(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 C(e,t){let r=this.layerLevel;if(e.has(r))return e.get(r);let i=t({layerLevel:r,...this.options});return e.set(r,i),i}function R(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r(52419);class b{constructor(e){R(this,"ranges",[]),R(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return 0===this.size()}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}push(e){return this.ranges.push(e),this}pop(){return this.ranges.pop()}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;return this.ranges.some((r,i)=>r.includes(e)&&t(r,i))}findAll(e){let t=[];return this.ranges.forEach((r,i)=>{r.isEqual(e)&&t.push({range:r,layer:i})}),t}remove(e){return this.ranges=this.ranges.filter(t=>!e.some(e=>e.isEqual(t))),this}removeLayers(e){return this.ranges=this.ranges.filter((t,r)=>!e.includes(r)),this}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}clone(){let e=new b(this.createCellRange);return e.ranges=this.ranges.map(e=>e.clone()),e}map(e){return this.ranges=this.ranges.map((t,r)=>e(t,r)),this}peekByIndex(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t>=0&&t<this.size()&&(e=this.ranges[t]),e}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}var T=r(21927),N=r(47771);function A(e,t,r){I(e,t),t.set(e,r)}function I(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function M(e,t){return e.get(x(e,t))}function O(e,t,r){return e.set(x(e,t),r),r}function x(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var _=new WeakMap,P=new WeakMap,L=new WeakMap,k=new WeakSet;class D{constructor(e,t){var r,i,n;I(this,k),k.add(this),A(this,_,void 0),A(this,P,0),A(this,L,{x:0,y:0}),i=void 0,(r="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r="tableApi","string"))?n:n+"")in this?Object.defineProperty(this,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):this[r]=i,O(_,this,e),this.tableApi=t}setActiveLayerIndex(e){O(P,this,e)}getCurrentSelection(){return M(_,this).peekByIndex(M(P,this))}transformStart(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];O(L,this,this.calculateOffset());let i=this.tableApi.createCellCoords(e,t),o=this.getCurrentSelection().highlight,s=this.tableApi.visualToRenderableCoords(o),a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),null!==s.row&&null!==s.col){let{width:e,height:t}=x(k,this,V).call(this),{row:s,col:h}=x(k,this,G).call(this,o),u=this.tableApi.fixedRowsBottom(),c=this.tableApi.minSpareRows(),d=this.tableApi.minSpareCols(),g=this.tableApi.autoWrapRow(),p=this.tableApi.autoWrapCol(),f=this.tableApi.createCellCoords(s+i.row,h+i.col);
125if(f.row>=t){let i=(0,n.createObjectPropListener)(r&&c>0&&0===u),o=f.col+1,s=o>=e,a=this.tableApi.createCellCoords(f.row-t,s?o-e:o);if(this.runLocalHooks("beforeColumnWrap",i,x(k,this,$).call(this,a),s),i.value)this.runLocalHooks("insertRowRequire",this.countRenderableRows());else if(p){if(this.shouldSwitchSelectionLayer()&&s&&M(_,this).size()>1){x(k,this,H).call(this);let e=x(k,this,U).call(this,"forward");null!==e&&a.assign(e)}f.assign(a)}}else if(f.row<0){let r=(0,n.createObjectPropListener)(p),i=f.col-1,o=i<0,s=this.tableApi.createCellCoords(t+f.row,o?e+i:i);if(this.runLocalHooks("beforeColumnWrap",r,x(k,this,$).call(this,s),o),p){if(this.shouldSwitchSelectionLayer()&&o&&M(_,this).size()>1){x(k,this,B).call(this);let e=x(k,this,U).call(this,"backward");null!==e&&s.assign(e)}f.assign(s)}}if({width:e,height:t}=x(k,this,V).call(this),f.col>=e){let i=(0,n.createObjectPropListener)(r&&d>0),o=f.row+1,s=o>=t,a=this.tableApi.createCellCoords(s?o-t:o,f.col-e);if(this.runLocalHooks("beforeRowWrap",i,x(k,this,$).call(this,a),s),i.value)this.runLocalHooks("insertColRequire",this.countRenderableColumns());else if(g){if(this.shouldSwitchSelectionLayer()&&s&&M(_,this).size()>1){x(k,this,H).call(this);let e=x(k,this,U).call(this,"forward");null!==e&&a.assign(e)}f.assign(a)}}else if(f.col<0){let r=(0,n.createObjectPropListener)(g),i=f.row-1,o=i<0,s=this.tableApi.createCellCoords(o?t+i:i,e+f.col);if(this.runLocalHooks("beforeRowWrap",r,x(k,this,$).call(this,s),o),g){if(this.shouldSwitchSelectionLayer()&&o&&M(_,this).size()>1){x(k,this,B).call(this);let e=x(k,this,U).call(this,"backward");null!==e&&s.assign(e)}f.assign(s)}}let{rowDir:m,colDir:y}=x(k,this,F).call(this,f);a=m,l=y,o=x(k,this,$).call(this,f)}return this.runLocalHooks("afterTransformStart",o,a,l),{selectionLayer:M(P,this),visualCoords:o}}transformEnd(e,t){O(L,this,this.calculateOffset());let r=this.tableApi.createCellCoords(e,t),i=this.getCurrentSelection(),n=this.tableApi.visualToRenderableCoords(i.highlight),o=x(k,this,W).call(this,i.to.row,i.from.row),s=x(k,this,j).call(this,i.to.col,i.from.col),a=i.to.clone(),l=0,h=0;if(this.runLocalHooks("beforeTransformEnd",r),null!==n.row&&null!==n.col&&null!==o&&null!==s){let{row:e,col:t}=x(k,this,G).call(this,i.highlight),n=this.tableApi.createCellCoords(o+r.row,s+r.col),u=i.getTopStartCorner(),c=i.getTopEndCorner(),d=i.getBottomEndCorner();if(r.col<0&&s>=t&&n.col<t){let e=n.col-t;n.col=x(k,this,j).call(this,u.col,c.col)+e}else if(r.col>0&&s<=t&&n.col>t){let e=x(k,this,j).call(this,c.col,u.col),t=Math.max(n.col-e,1);n.col=e+t}if(r.row<0&&o>=e&&n.row<e){let t=n.row-e;n.row=x(k,this,W).call(this,u.row,d.row)+t}else if(r.row>0&&o<=e&&n.row>e){let e=x(k,this,W).call(this,d.row,u.row),t=Math.max(n.row-e,1);n.row=e+t}let{rowDir:g,colDir:p}=x(k,this,F).call(this,n);l=g,h=p;let f=x(k,this,$).call(this,n);0===r.row&&0!==r.col?a.col=f.col:0!==r.row&&0===r.col?a.row=f.row:(a.row=f.row,a.col=f.col)}return this.runLocalHooks("afterTransformEnd",a,l,h),{selectionLayer:M(P,this),visualCoords:a}}calculateOffset(){throw Error("`calculateOffset` is not implemented")}countRenderableRows(){throw Error("`countRenderableRows` is not implemented")}countRenderableColumns(){throw Error("`countRenderableColumns` is not implemented")}shouldSwitchSelectionLayer(){throw Error("`shouldSwitchSelectionLayer` is not implemented")}}function H(){let e=M(P,this)+1;this.setActiveLayerIndex(e>=M(_,this).size()?0:e),O(L,this,this.calculateOffset())}function B(){let e=M(P,this)-1;this.setActiveLayerIndex(e<0?M(_,this).size()-1:e),O(L,this,this.calculateOffset())}function F(e){let{width:t,height:r}=x(k,this,V).call(this),i=0,n=0;return e.row<0?(i=-1,e.row=0):e.row>0&&e.row>=r&&(i=1,e.row=r-1),e.col<0?(n=-1,e.col=0):e.col>0&&e.col>=t&&(n=1,e.col=t-1),{rowDir:i,colDir:n}}function V(){return{width:M(L,this).x+this.countRenderableColumns(),height:M(L,this).y+this.countRenderableRows()}}function U(e){if(!["forward","backward"].includes(e))return null;let t=this.getCurrentSelection().getTopStartCorner(),r=this.getCurrentSelection().getBottomEndCorner(),[i,n,o,s]="forward"===e?[t.row,r.row,t.col,r.col]:[r.row,t.row,r.col,t.col],a=x(k,this,W).call(this,i,n),l=x(k,this,j).call(this,o,s);return null===a||null===l?null:this.tableApi.createCellCoords(a,l)}function W(e,t){let r=this.tableApi.findFirstNonHiddenRenderableRow(e,t);return null===r?null:M(L,this).y+r}function j(e,t){let r=this.tableApi.findFirstNonHiddenRenderableColumn(e,t);return null===r?null:M(L,this).x+r}function G(e){let{row:t,col:r}=this.tableApi.visualToRenderableCoords(e);if(null===t||null===r)throw Error("Renderable coords are not visible.");return this.tableApi.createCellCoords(M(L,this).y+t,M(L,this).x+r)}function $(e){let t=e.clone();
125return t.col=e.col-M(L,this).x,t.row=e.row-M(L,this).y,this.tableApi.renderableToVisualCoords(t)}(0,n.mixin)(D,o.Z);class z extends D{calculateOffset(){return{x:this.tableApi.navigableHeaders()?this.tableApi.countRowHeaders():0,y:this.tableApi.navigableHeaders()?this.tableApi.countColHeaders():0}}countRenderableRows(){return this.tableApi.countRenderableRows()}countRenderableColumns(){return this.tableApi.countRenderableColumns()}shouldSwitchSelectionLayer(){return!1}}class Y extends D{calculateOffset(){let e=this.getCurrentSelection(),{row:t,col:r}=e.getOuterTopStartCorner(),i=this.tableApi.countRenderableColumnsInRange(0,r-1),n=this.tableApi.countRenderableRowsInRange(0,t-1),o=e.highlight.isHeader();return{x:r<0?o?Math.abs(r):0:-i,y:t<0?o?Math.abs(t):0:-n}}countRenderableRows(){let e=this.getCurrentSelection();return this.tableApi.countRenderableRowsInRange(0,e.getOuterBottomEndCorner().row)}countRenderableColumns(){let e=this.getCurrentSelection();return this.tableApi.countRenderableColumnsInRange(0,e.getOuterBottomEndCorner().col)}transformEnd(){throw Error("`transformEnd` is not valid for focus selection use `transformStart` instead")}shouldSwitchSelectionLayer(){return!0}}var K=r(20295),X=r(80600);function q(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function Z(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q(e,t){return e.get(ee(e,t))}function J(e,t,r){return e.set(ee(e,t),r),r}function ee(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var et=new WeakMap,er=new WeakMap,ei=new WeakMap,en=new WeakMap,eo=new WeakMap,es=new WeakMap,ea=new WeakMap;class el{constructor(e,t){var r=this;Z(this,"settings",void 0),Z(this,"tableProps",void 0),Z(this,"inProgress",!1),Z(this,"selectedRange",new b((e,t,r)=>this.tableProps.createCellRange(e,t,r))),Z(this,"highlight",void 0),q(this,et,void 0),q(this,er,void 0),Z(this,"selectedByRowHeader",new Set),Z(this,"selectedByColumnHeader",new Set),q(this,ei,!1),q(this,en,!1),q(this,eo,"unknown"),q(this,es,-1),q(this,ea,0),this.settings=e,this.tableProps=t,this.highlight=new S({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[(0,g.Ak)()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(e,t)=>this.tableProps.isDisabledCellSelection(e,t),cellCornerVisible:function(){return r.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return r.isAreaCornerVisible(...arguments)},visualToRenderableCoords:e=>this.tableProps.visualToRenderableCoords(e),renderableToVisualCoords:e=>this.tableProps.renderableToVisualCoords(e),createCellCoords:(e,t)=>this.tableProps.createCellCoords(e,t),createCellRange:(e,t,r)=>this.tableProps.createCellRange(e,t,r)}),J(et,this,new z(this.selectedRange,{...this.tableProps,navigableHeaders:()=>e.navigableHeaders,fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),J(er,this,new Y(this.selectedRange,{...this.tableProps,navigableHeaders:()=>e.navigableHeaders,fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),Q(et,this).addLocalHook("beforeTransformStart",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("beforeModifyTransformStart",...t)}),Q(et,this).addLocalHook("afterTransformStart",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("afterModifyTransformStart",...t)}),Q(et,this).addLocalHook("beforeTransformEnd",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("beforeModifyTransformEnd",...t)}),Q(et,this).addLocalHook("afterTransformEnd",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("afterModifyTransformEnd",...t)}),Q(et,this).addLocalHook("insertRowRequire",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("insertRowRequire",...t)}),Q(et,this).addLocalHook("insertColRequire",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("insertColRequire",...t)}),Q(et,this).addLocalHook("beforeRowWrap",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("beforeRowWrap",...t)}),Q(et,this).addLocalHook("beforeColumnWrap",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("beforeColumnWrap",...t)}),Q(er,this).addLocalHook("beforeTransformStart",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("beforeModifyTransformFocus",...t)}),Q(er,this).addLocalHook("afterTransformStart",function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.runLocalHooks("afterModifyTransformFocus",...t)})}getSelectedRange(){return this.selectedRange}getActiveSelectedRange(){return this.selectedRange.peekByIndex(Q(ea,this))}getActiveSelectionLayerIndex(){return Q(ea,this)}setActiveSelectionLayerIndex(e){J(ea,this,e)}markSource(e){J(eo,this,e)}markEndSource(){J(eo,this,"unknown")}getSelectionSource(){return Q(eo,this)}setExpectedLayers(e){J(es,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,J(es,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,n="multiple"===this.settings.selectionMode,o=(0,T.isUndefined)(t)?this.tableProps.getShortcutManager().isCtrlPressed():t,s=e.clone();J(en,this,!1),J(ei,this,!1),this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}
125`,s),(!n||n&&!o&&(0,T.isUndefined)(t))&&(this.selectedRange.clear(),(0,m.arrayEach)(this.highlight.getAreas(),e=>void e.clear()),(0,m.arrayEach)(this.highlight.getLayeredAreas(),e=>void e.clear()),(0,m.arrayEach)(this.highlight.getRowHeaders(),e=>void e.clear()),(0,m.arrayEach)(this.highlight.getColumnHeaders(),e=>void e.clear()),(0,m.arrayEach)(this.highlight.getActiveRowHeaders(),e=>void e.clear()),(0,m.arrayEach)(this.highlight.getActiveColumnHeaders(),e=>void e.clear()),(0,m.arrayEach)(this.highlight.getActiveCornerHeaders(),e=>void e.clear()),(0,m.arrayEach)(this.highlight.getRowHighlights(),e=>void e.clear()),(0,m.arrayEach)(this.highlight.getColumnHighlights(),e=>void e.clear())),this.selectedRange.add(s).current().setHighlight(i.clone()),0===this.getLayerLevel()&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),r||this.setRangeEnd(e)}setRangeStartOnly(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;this.setRangeStart(e,t,!0,r)}setRangeEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLayerLevel();if(this.selectedRange.isEmpty())return;this.setActiveSelectionLayerIndex(t);let r=e.clone(),i=this.tableProps.countRows(),n=this.tableProps.countCols(),o=this.getActiveSelectedRange().clone().setTo(e).isSingleHeader();if((i>0||n>0)&&(0===i&&r.col<0&&!o||0===n&&r.row<0&&!o))return;this.runLocalHooks("beforeSetRangeEnd",r),this.begin();let s=this.getActiveSelectedRange();if(this.settings.navigableHeaders||s.highlight.normalize(),"single"===this.settings.selectionMode)s.setFrom(s.highlight),s.setTo(s.highlight);else{let e=s.getHorizontalDirection(),t=s.getVerticalDirection(),i=this.isMultiple();s.setTo(r),i&&(e!==s.getHorizontalDirection()||1===s.getWidth()&&!s.includes(s.highlight))&&s.from.assign({col:s.highlight.col}),i&&(t!==s.getVerticalDirection()||1===s.getHeight()&&!s.includes(s.highlight))&&s.from.assign({row:s.highlight.row})}i>0&&n>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!s.isSingleHeader())&&s.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.getActiveSelectedRange().highlight,t),this.applyAndCommit(this.getActiveSelectedRange(),t);let a=-1===Q(es,this)||this.selectedRange.size()===Q(es,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getActiveSelectedRange(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLayerLevel(),r=this.tableProps.countRows(),n=this.tableProps.countCols();this.highlight.useLayerLevel(t);let o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),h=this.highlight.createActiveRowHeader(),u=this.highlight.createActiveColumnHeader(),c=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),g=this.highlight.createColumnHighlight();if(o.clear(),s.clear(),a.clear(),l.clear(),h.clear(),u.clear(),c.clear(),d.clear(),g.clear(),this.highlight.isEnabledFor(i.AI,e.highlight)&&(this.isMultiple()||t>=1)&&(o.add(e.from).add(e.to).commit(),s.add(e.from).add(e.to).commit(),1===t)){let e=this.selectedRange.peekByIndex(t-1);this.highlight.useLayerLevel(t-1),this.highlight.createArea().add(e.from).commit().syncWith(e),this.highlight.createLayeredArea().add(e.from).commit().syncWith(e),this.highlight.useLayerLevel(t)}if(this.highlight.isEnabledFor(i.Nc,e.highlight)){if(!e.isSingleHeader()){let t=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),r=this.tableProps.createCellCoords(e.to.row,-1),i=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),n=this.tableProps.createCellCoords(-1,e.to.col);"single"===this.settings.selectionMode?(a.add(t).commit(),l.add(i).commit(),d.add(t).commit(),g.add(i).commit()):(a.add(t).add(r).commit(),l.add(i).add(n).commit(),d.add(t).add(r).commit(),g.add(i).add(n).commit())}let t=!Q(en,this)&&this.isEntireRowSelected()&&(n>0&&n===e.getWidth()||0===n&&this.isSelectedByRowHeader()),i=!Q(en,this)&&this.isEntireColumnSelected()&&(r>0&&r===e.getHeight()||0===r&&this.isSelectedByColumnHeader());t&&h.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))
125).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),i&&u.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(),t&&i&&c.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLayerLevel();if(this.selectedRange.isEmpty())return;this.setActiveSelectionLayerIndex(t),Q(et,this).setActiveLayerIndex(t),Q(er,this).setActiveLayerIndex(t);let r=this.getActiveSelectedRange();this.inProgress||this.runLocalHooks("beforeSetFocus",e);let n=this.highlight.getFocus();n.clear(),r.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(i.t8,r.highlight)&&n.add(r.highlight).commit().syncWith(r),this.inProgress||(J(ei,this,!0),this.runLocalHooks("afterSetFocus",r.highlight))}transformStart(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{visualCoords:i}=Q(et,this).transformStart(e,t,r);this.setRangeStart(i)}transformEnd(e,t){let{visualCoords:r,selectionLayer:i}=Q(et,this).transformEnd(e,t);this.setRangeEnd(r,i)}transformFocus(e,t){let{selectionLayer:r,visualCoords:i}=Q(er,this).transformStart(e,t);this.setRangeFocus(i.normalize(),r)}shiftRows(e,t){if(!this.isSelected())return;let r=this.getActiveSelectedRange();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){let{from:i,to:n,highlight:o}=r,s=this.tableProps.countRows(),a=this.isSelectedByRowHeader(),l=this.isSelectedByColumnHeader(),h=l?-1:0;this.getSelectedRange().pop();let u=this.tableProps.createCellCoords((0,N.clamp)(i.row+(l?0:t),h,s-1),i.col),c=this.tableProps.createCellCoords((0,N.clamp)(n.row+t,h,s-1),n.col);this.markSource("shift"),o.row>=e?this.setRangeStartOnly(u,!0,this.tableProps.createCellCoords((0,N.clamp)(o.row+t,0,s-1),o.col)):this.setRangeStartOnly(u,!0),a&&this.selectedByRowHeader.add(this.getLayerLevel()),l&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(c),this.markEndSource()}}shiftColumns(e,t){if(!this.isSelected())return;let r=this.getActiveSelectedRange();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||r.getOuterTopStartCorner().col>=e){let{from:i,to:n,highlight:o}=r,s=this.tableProps.countCols(),a=this.isSelectedByRowHeader(),l=this.isSelectedByColumnHeader(),h=a?-1:0;this.getSelectedRange().pop();let u=this.tableProps.createCellCoords(i.row,(0,N.clamp)(i.col+(a?0:t),h,s-1)),c=this.tableProps.createCellCoords(n.row,(0,N.clamp)(n.col+t,h,s-1));this.markSource("shift"),o.col>=e?this.setRangeStartOnly(u,!0,this.tableProps.createCellCoords(o.row,(0,N.clamp)(o.col+t,0,s-1))):this.setRangeStartOnly(u,!0),a&&this.selectedByRowHeader.add(this.getLayerLevel()),l&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(c),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getActiveSelectedRange();if(!this.isSelected())return!1;let t=(0,n.createObjectPropListener)(!e.isSingle());return this.runLocalHooks("afterIsMultipleSelection",t),t.value}isFocusSelectionChanged(){return this.isSelected()&&Q(ei,this)}isSelectedByRowHeader(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(-1===e?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel(),t=e=>{let{col:t}=e.getOuterTopStartCorner(),r=this.tableProps.countRowHeaders(),i=this.tableProps.countCols();return(r>0&&t<0||0===r)&&e.getWidth()===i};if(-1===e)return Array.from(this.selectedRange).some(e=>t(e));let r=this.selectedRange.peekByIndex(e);return!!r&&t(r)}isSelectedByColumnHeader(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(-1===e?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel(),t=e=>{let{row:t}
125=e.getOuterTopStartCorner(),r=this.tableProps.countColHeaders(),i=this.tableProps.countRows();return(r>0&&t<0||0===r)&&e.getHeight()===i};if(-1===e)return Array.from(this.selectedRange).some(e=>t(e));let r=this.selectedRange.peekByIndex(e);return!!r&&t(r)}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){let t=this.tableProps.visualToRenderableCoords(e);return null!==t.row&&null!==t.col}isAreaCornerVisible(e){return(!Number.isInteger(e)||e===this.getLayerLevel())&&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 t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1},n=this.tableProps.countRows(),o=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countColHeaders(),l=r?-a:0,h=t?-s:0;if(0===l&&0===h&&(0===n||0===o))return;let u=null===(e=this.getActiveSelectedRange())||void 0===e?void 0:e.highlight,{focusPosition:c,disableHeadersHighlight:d}=i;c&&Number.isInteger(null==c?void 0:c.row)&&Number.isInteger(null==c?void 0:c.col)&&(u=this.tableProps.createCellCoords((0,N.clamp)(c.row,l,n-1),(0,N.clamp)(c.col,h,o-1)));let g=this.tableProps.createCellCoords(l,h),p=this.tableProps.createCellCoords(n-1,o-1);this.clear(),this.runLocalHooks("beforeSelectAll",g,p,u),this.setRangeStartOnly(g,void 0,u),J(en,this,d),h<0&&this.selectedByRowHeader.add(this.getLayerLevel()),l<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(p),this.runLocalHooks("afterSelectAll",g,p,u),this.finish()}selectCells(e){var t=this;let r=(0,K.AV)(e);if(r===K.gk)return!1;if(r===K.Kk)throw Error((0,X.e)`Unsupported format of the selection ranges was passed. To select cells pass\x20
126        the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
127        columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);let i=(0,K.S5)(r,{createCellCoords:function(){return t.tableProps.createCellCoords(...arguments)},createCellRange:function(){return t.tableProps.createCellRange(...arguments)},propToCol:e=>this.tableProps.propToCol(e),keepDirection:!0}
127),n=this.settings.navigableHeaders,o={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:n?this.tableProps.countRowHeaders():0,countColHeaders:n?this.tableProps.countColHeaders():0},s=!e.some(e=>{let t=i(e),r=t.isValid(o);return!(r&&!t.containsHeaders()||r&&t.containsHeaders()&&t.isSingleHeader())});return s&&(this.clear(),this.setExpectedLayers(e.length),(0,m.arrayEach)(e,e=>{let{from:t,to:r}=i(e);this.setRangeStartOnly(t.clone(),!1),this.setRangeEnd(r.clone())}),this.finish()),s}selectColumns(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i="string"==typeof e?this.tableProps.propToCol(e):e,n="string"==typeof t?this.tableProps.propToCol(t):t,o=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countColHeaders(),l=0===a?0:-a,h=this.tableProps.createCellCoords(l,i),u=this.tableProps.createCellCoords(o-1,n),c=this.tableProps.createCellRange(h,h,u).isValid({countRows:o,countCols:s,countRowHeaders:0,countColHeaders:a});if(c){let e=0,t=0;Number.isInteger(null==r?void 0:r.row)&&Number.isInteger(null==r?void 0:r.col)?(e=(0,N.clamp)(r.row,l,o-1),t=(0,N.clamp)(r.col,Math.min(i,n),Math.max(i,n))):(e=(0,N.clamp)(r,l,o-1),t=i);let s=this.tableProps.createCellCoords(e,t),h=0===a?0:(0,N.clamp)(s.row,l,-1),u=this.tableProps.createCellCoords(h,i),c=this.tableProps.createCellCoords(o-1,n);this.runLocalHooks("beforeSelectColumns",u,c,s),this.setRangeStartOnly(u,void 0,s),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(c),this.runLocalHooks("afterSelectColumns",u,c,s),this.finish()}return c}selectRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.tableProps.countRows(),n=this.tableProps.countCols(),o=this.tableProps.countRowHeaders(),s=0===o?0:-o,a=this.tableProps.createCellCoords(e,s),l=this.tableProps.createCellCoords(t,n-1),h=this.tableProps.createCellRange(a,a,l).isValid({countRows:i,countCols:n,countRowHeaders:o,countColHeaders:0});if(h){let i=0,a=0;Number.isInteger(null==r?void 0:r.row)&&Number.isInteger(null==r?void 0:r.col)?(i=(0,N.clamp)(r.row,Math.min(e,t),Math.max(e,t)),a=(0,N.clamp)(r.col,s,n-1)):(i=e,a=(0,N.clamp)(r,s,n-1));let l=this.tableProps.createCellCoords(i,a),h=0===o?0:(0,N.clamp)(l.col,s,-1),u=this.tableProps.createCellCoords(e,h),c=this.tableProps.createCellCoords(t,n-1);this.runLocalHooks("beforeSelectRows",u,c,l),this.setRangeStartOnly(u,void 0,l),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(c),this.runLocalHooks("afterSelectRows",u,c,l),this.finish()}return h}importSelection(e){let{ranges:t,activeRange:r,activeSelectionLayer:i,selectedByRowHeader:n,selectedByColumnHeader:o,disableHeadersHighlight:s}=e;0!==t.length&&(this.selectedRange.clear(),this.highlight.clear(),this.inProgress=!1,J(en,this,s),this.selectedByRowHeader=new Set(n),this.selectedByColumnHeader=new Set(o),this.setActiveSelectionLayerIndex(0),t.forEach((e,t)=>{this.selectedRange.push(e),this.applyAndCommit(e,t)}),this.setRangeFocus(r.highlight,i),J(en,this,!1),this.inProgress=!1)}exportSelection(){return{ranges:Array.from(this.selectedRange).map(e=>e.clone()),activeRange:this.getActiveSelectedRange(),activeSelectionLayer:this.getActiveSelectionLayerIndex(),selectedByRowHeader:Array.from(this.selectedByRowHeader),selectedByColumnHeader:Array.from(this.selectedByColumnHeader),disableHeadersHighlight:Q(en,this)}}refresh(){if(!this.isSelected())return;let e=this.tableProps.countRows(),t=this.tableProps.countCols();if(0===e||0===t){this.deselect();return}let r=this.selectedRange.ranges.map(e=>e.clone());this.markSource("refresh");let i=new Set(this.selectedByRowHeader),n=new Set(this.selectedByColumnHeader);this.clear(),this.setExpectedLayers(r.length),r.forEach(r=>{let{from:i,to:n,highlight:o}=r,s=e-1,a=t-1;o.assign({row:(0,N.clamp)(o.row,this.settings.navigableHeaders?-1/0:0,s),col:(0,N.clamp)(o.col,this.settings.navigableHeaders?-1/0:0,a)}),i.assign({row:(0,N.clamp)(i.row,-1/0,s),col:(0,N.clamp)(i.col,-1/0,a)}),n.assign({row:(0,N.clamp)(n.row,-1/0,s),col:(0,N.clamp)(n.col,-1/0,a)}),this.setRangeStartOnly(i,!0,o),this.setRangeEnd(n)}),this.selectedByRowHeader=i,this.selectedByColumnHeader=n,this.finish(),this.markEndSource()}
127commit(){if(this.highlight.getCustomSelections().forEach(e=>{e.commit()}),!this.isSelected())return;let e=this.getLayerLevel(),t=this.getActiveSelectedRange();this.highlight.isEnabledFor(i.t8,t.highlight)&&this.highlight.getFocus().commit().syncWith(t);for(let e=0;e<this.selectedRange.size();e+=1){this.highlight.useLayerLevel(e);let t=this.highlight.createArea(),r=this.highlight.createLayeredArea(),i=this.highlight.createRowHeader(),n=this.highlight.createColumnHeader(),o=this.highlight.createActiveRowHeader(),s=this.highlight.createActiveColumnHeader(),a=this.highlight.createActiveCornerHeader(),l=this.highlight.createRowHighlight(),h=this.highlight.createColumnHighlight();t.commit(),r.commit(),i.commit(),n.commit(),o.commit(),s.commit(),a.commit(),l.commit(),h.commit()}this.highlight.useLayerLevel(e)}}(0,n.mixin)(el,o.Z);var eh=el},20295:function(e,t,r){"use strict";r.d(t,{AV:function(){return d},I8:function(){return f},Kk:function(){return s},S5:function(){return g},X8:function(){return p},gk:function(){return a}}),r(76346),r(65230),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975),r(70470),r(97934);var i=r(77718),n=r(22386),o=r(21927);let s=0,a=1,l=[3,2],h=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],u=Symbol("root"),c=Symbol("child");function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;if(t!==u&&t!==c)throw Error("The second argument is used internally only and cannot be overwritten.");let r=Array.isArray(e),n=t===u,o=s;if(r){let t=e[0];0===e.length?o=a:n&&t instanceof i.Z?o=3:n&&Array.isArray(t)?o=d(t,c):e.length>=2&&e.length<=4&&!e.some((e,t)=>!h[t].includes(typeof e))&&(o=2)}return o}function g(e){let{createCellCoords:t,createCellRange:r,keepDirection:i=!1,propToCol:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!l.includes(e))throw Error("Unsupported selection ranges schema type was provided.");return function(s){let a=3===e,l=a?s.from.row:s[0],h=a?s.from.col:s[1],u=a?s.to.row:s[2],c=a?s.to.col:s[3];if("function"==typeof n&&("string"==typeof h&&(h=n(h)),"string"==typeof c&&(c=n(c))),(0,o.isUndefined)(u)&&(u=l),(0,o.isUndefined)(c)&&(c=h),!i){let e=l,t=h,r=u,i=c;l=Math.min(e,r),h=Math.min(t,i),u=Math.max(e,r),c=Math.max(t,i)}return r(a?s.highlight.clone():t(l,h),t(l,h),t(u,c))}}function p(e){let t=d(e.getSelected());if(t===s||t===a)return[];let r=g(t,{createCellCoords:e._createCellCoords.bind(e),createCellRange:e._createCellRange.bind(e)}),i=new Set;(0,n.arrayEach)(e.getSelected(),e=>{let{from:t,to:o}=r(e),s=Math.max(t.col,0),a=o.col-s+1;(0,n.arrayEach)(Array.from(Array(a),(e,t)=>s+t),e=>{i.has(e)||i.add(e)})});let o=Array.from(i).sort((e,t)=>e-t);return(0,n.arrayReduce)(o,(e,t,r,i)=>(0!==r&&t===i[r-1]+1?e[e.length-1][1]+=1:e.push([t,1]),e),[])}function f(e){let t=d(e.getSelected());if(t===s||t===a)return[];let r=g(t,{createCellCoords:e._createCellCoords.bind(e),createCellRange:e._createCellRange.bind(e)}),i=new Set;(0,n.arrayEach)(e.getSelected(),e=>{let{from:t,to:o}=r(e),s=Math.max(t.row,0),a=o.row-s+1;(0,n.arrayEach)(Array.from(Array(a),(e,t)=>s+t),e=>{i.has(e)||i.add(e)})});let o=Array.from(i).sort((e,t)=>e-t);return(0,n.arrayReduce)(o,(e,t,r,i)=>(0!==r&&t===i[r-1]+1?e[e.length-1][1]+=1:e.push([t,1]),e),[])}},20386:function(e,t,r){"use strict";r.d(t,{FP:function(){return n},II:function(){return s},Wz:function(){return i},hE:function(){return a},n4:function(){return o}});let i="gridDefault",n="grid",o="grid.tabNavigation",s="editorManager.handlingEditor",a="editor"},80913:function(e,t,r){"use strict";r.d(t,{xg:function(){return c}});var i=r(20386),n=r(43488);r(70470),r(97934);var o=r(9190);let s=[{name:"editorCloseAndSave",callback(e){e._getEditorManager().closeEditorAndSaveChanges()}},{name:"editorCloseAndSaveByArrowKeys",callback(e,t,r){let i=e._getEditorManager(),o=i.getActiveEditor();o.isInFullEditMode()&&o.state===n.ed.EDITING||(i.closeEditorAndSaveChanges(),e.getSelected()&&(r.includes("arrowdown")?e.selection.transformStart(1,0):r.includes("arrowup")?e.selection.transformStart(-1,0):r.includes("arrowleft")?e.selection.transformStart(0,-1*e.getDirectionFactor()):r.includes("arrowright")&&e.selection.transformStart(0,e.getDirectionFactor())),t.preventDefault())}},{name:"editorCloseAndSaveByEnter",callback(e,t){let r=e._getEditorManager();r.closeEditorAndSaveChanges(t.ctrlKey||t.metaKey),r.moveSelectionAfterEnter(t)}},{name:"editorCloseWithoutSaving",callback(e){let t=e._getEditorManager();t.closeEditorAndRestoreOriginalValue(e.getShortcutManager().isCtrlPressed()),t.activeEditor.focus()}},{name:"editorFastOpen",callback(e,t){let{highlight:r}=e.getSelectedRangeActive();r.isHeader()||e._getEditorManager().openEditor(null,t,!0)}},{name:"editorOpen",callback(e,t,r){let{selection:i}=e,n=e._getEditorManager(),s=e.getSelectedRange(),a=e.getSelectedRangeActive(),{highlight:l}=a;if((s.some(e=>i.isMultiple(e))||s.length>1)&&!a.isHeader()&&e.countRenderedCols()>0&&e.countRenderedRows()>0){let n=e.getSettings(),o="function"==typeof n.enterMoves?n.enterMoves(t):n.enterMoves;r.includes("shift")?i.transformFocus(-o.row,-o.col):i.transformFocus(o.row,o.col);return}l.isHeader()||(e.getSettings().enterBeginsEditing?n.cellProperties.readOnly?n.moveSelectionAfterEnter(t):n.openEditor(null,t,!0):n.moveSelectionAfterEnter(t),(0,o.stopImmediatePropagation)(t))}},{name:"extendCellsSelectionDown",callback(e){let{selection:t}=e,{highlight:r}=e.getSelectedRangeActive();!t.isSelectedByColumnHeader()&&!t.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&t.isSelectedByRowHeader())&&(t.markSource("keyboard"),t.transformEnd(1,0),t.markEndSource())}}
127,{name:"extendCellsSelectionDownByViewportHeight",callback(e){let{selection:t,rowIndexMapper:r}=e,{to:i}=e.getSelectedRangeActive(),n=Math.min(i.row+e.countVisibleRows(),e.countRows()-1),o=r.getNearestNotHiddenIndex(n,-1);if(null!==o){let r=e._createCellCoords(o,i.col),n=i.row-e.getFirstFullyVisibleRow(),s=Math.min(r.row-n,e.countRows()-1);t.markSource("keyboard"),t.setRangeEnd(r,e.getActiveSelectionLayerIndex()),t.markEndSource(),e.scrollViewportTo({row:s,verticalSnap:"top",horizontalSnap:"start"})}}},{name:"extendCellsSelectionLeft",callback(e){let{selection:t}=e,{highlight:r}=e.getSelectedRangeActive();!t.isSelectedByRowHeader()&&!t.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&t.isSelectedByColumnHeader())&&(t.markSource("keyboard"),t.transformEnd(0,-1*e.getDirectionFactor()),t.markEndSource())}},{name:"extendCellsSelectionRight",callback(e){let{selection:t}=e,{highlight:r}=e.getSelectedRangeActive();!t.isSelectedByRowHeader()&&!t.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&t.isSelectedByColumnHeader())&&(t.markSource("keyboard"),t.transformEnd(0,e.getDirectionFactor()),t.markEndSource())}},{name:"extendCellsSelectionToColumns",callback(e){let{selection:t}=e,{highlight:r,from:i,to:n}=e.getSelectedRangeActive();t.markSource("keyboard"),t.isSelectedByRowHeader()?t.selectAll(!0,!0):e.selectColumns(i.col,n.col,r),t.markEndSource()}},{name:"extendCellsSelectionToMostBottom",callback(e){let{selection:t,rowIndexMapper:r}=e,{highlight:i,from:n,to:o}=e.getSelectedRangeActive(),s=i.isHeader()&&t.isSelectedByRowHeader();if(i.isCell()||s){let a=r.getNearestNotHiddenIndex(e.countRows()-1,-1),l=n.clone();l.row=i.row,t.markSource("keyboard"),t.setRangeStart(l,void 0,!1,i.clone()),s&&t.selectedByRowHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(a,o.col)),t.markEndSource()}}},{name:"extendCellsSelectionToMostInlineEnd",callback(e){let{selection:t,columnIndexMapper:r}=e,{highlight:i,from:n,to:o}=e.getSelectedRangeActive();if(!t.isSelectedByRowHeader()&&!t.isSelectedByCorner()&&i.isCell()){let s=r.getNearestNotHiddenIndex(e.countCols()-1,-1),a=n.clone();a.col=i.col,t.markSource("keyboard"),t.setRangeStart(a,void 0,!1,i.clone()),t.setRangeEnd(e._createCellCoords(o.row,s)),t.markEndSource()}}},{name:"extendCellsSelectionToMostInlineStart",callback(e){let{selection:t,columnIndexMapper:r}=e,{highlight:i,from:n,to:o}=e.getSelectedRangeActive();if(!t.isSelectedByRowHeader()&&!t.isSelectedByCorner()&&i.isCell()){let s=parseInt(e.getSettings().fixedColumnsStart,10),a=r.getNearestNotHiddenIndex(s,1),l=n.clone();l.col=i.col,t.markSource("keyboard"),t.setRangeStart(l,void 0,!1,i.clone()),t.setRangeEnd(e._createCellCoords(o.row,a)),t.markEndSource()}}},{name:"extendCellsSelectionToMostLeft",callback(e){let{selection:t,columnIndexMapper:r}=e,{highlight:i,from:n,to:o}=e.getSelectedRangeActive(),s=i.isHeader()&&t.isSelectedByColumnHeader();if(i.isCell()||s){let a=r.getNearestNotHiddenIndex(...e.isRtl()?[e.countCols()-1,-1]:[0,1]),l=n.clone();l.col=i.col,t.markSource("keyboard"),t.setRangeStart(l,void 0,!1,i.clone()),s&&t.selectedByColumnHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(o.row,a)),t.markEndSource()}}},{name:"extendCellsSelectionToMostRight",callback(e){let{selection:t,columnIndexMapper:r}=e,{highlight:i,from:n,to:o}=e.getSelectedRangeActive(),s=i.isHeader()&&t.isSelectedByColumnHeader();if(i.isCell()||s){let a=r.getNearestNotHiddenIndex(...e.isRtl()?[0,1]:[e.countCols()-1,-1]),l=n.clone();l.col=i.col,t.markSource("keyboard"),t.setRangeStart(l,void 0,!1,i.clone()),s&&t.selectedByColumnHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(o.row,a)),t.markEndSource()}}},{name:"extendCellsSelectionToMostTop",callback(e){let{selection:t,rowIndexMapper:r}=e,{highlight:i,from:n,to:o}=e.getSelectedRangeActive(),s=i.isHeader()&&t.isSelectedByRowHeader();if(i.isCell()||s){let a=r.getNearestNotHiddenIndex(0,1),l=n.clone();l.row=i.row,t.markSource("keyboard"),t.setRangeStart(l,void 0,!1,i.clone()),s&&t.selectedByRowHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(a,o.col)),t.markEndSource()}}},{name:"extendCellsSelectionToRows",callback(e){let{selection:t}=e,{highlight:r,from:i,to:n}=e.getSelectedRangeActive();t.markSource("keyboard"),t.isSelectedByColumnHeader()?t.selectAll(!0,!0):e.selectRows(i.row,n.row,r),t.markEndSource()}},{name:"extendCellsSelectionUp",callback(e){let{selection:t}=e,{highlight:r}=e.getSelectedRangeActive();!t.isSelectedByColumnHeader()&&!t.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&t.isSelectedByRowHeader())&&(t.markSource("keyboard"),t.transformEnd(-1,0),t.markEndSource())}}
127,{name:"extendCellsSelectionUpByViewportHeight",callback(e){let{selection:t,rowIndexMapper:r}=e,{to:i}=e.getSelectedRangeActive(),n=Math.max(i.row-e.countVisibleRows(),0),o=r.getNearestNotHiddenIndex(n,1);if(null!==o){let r=e._createCellCoords(o,i.col),n=i.row-e.getFirstFullyVisibleRow(),s=Math.max(r.row-n,0);t.markSource("keyboard"),t.setRangeEnd(r,e.getActiveSelectionLayerIndex()),t.markEndSource(),e.scrollViewportTo({row:s,verticalSnap:"top",horizontalSnap:"start"})}}},{name:"moveCellSelectionDown",callback(e){let{selection:t}=e;t.markSource("keyboard"),t.transformStart(1,0),t.markEndSource()}},{name:"moveCellSelectionDownByViewportHeight",callback(e){let{selection:t}=e,{navigableHeaders:r}=e.getSettings(),i=r?e.countColHeaders():0,{row:n}=e.getSelectedRangeActive().highlight,o=e.countVisibleRows()+i;o=0===o?1:o,n===e.countRows()-1?o=1:n+o>e.countRows()&&(o=e.countRows()-n-1),t.markSource("keyboard"),t.transformStart(o,0),t.markEndSource(),e.getSelectedRangeActive().highlight.row<0&&e.scrollViewportTo({row:0})}},{name:"moveCellSelectionInlineEnd",callback(e,t){let{selection:r}=e,i=e.getSettings(),n=e.getSelectedRange(),o=e.getSelectedRangeActive(),s="function"==typeof i.tabMoves?i.tabMoves(t):i.tabMoves;r.markSource("keyboard"),(n.some(e=>r.isMultiple(e))||n.length>1)&&!o.isHeader()&&e.countRenderedCols()>0&&e.countRenderedRows()>0?r.transformFocus(-s.row,-s.col):r.transformStart(-s.row,-s.col),r.markEndSource()}},{name:"moveCellSelectionInlineStart",callback(e,t){let{selection:r}=e,i=e.getSettings(),n=e.getSelectedRange(),o=e.getSelectedRangeActive(),s="function"==typeof i.tabMoves?i.tabMoves(t):i.tabMoves;r.markSource("keyboard"),(n.some(e=>r.isMultiple(e))||n.length>1)&&!o.isHeader()&&e.countRenderedCols()>0&&e.countRenderedRows()>0?r.transformFocus(s.row,s.col):r.transformStart(s.row,s.col),r.markEndSource()}},{name:"moveCellSelectionLeft",callback(e){let{selection:t}=e;t.markSource("keyboard"),t.transformStart(0,-1*e.getDirectionFactor()),t.markEndSource()}},{name:"moveCellSelectionRight",callback(e){let{selection:t}=e;t.markSource("keyboard"),t.transformStart(0,e.getDirectionFactor()),t.markEndSource()}},{name:"moveCellSelectionToMostBottom",callback(e){let{selection:t}=e,{col:r}=e.getSelectedRangeActive().highlight,i=e.rowIndexMapper.getNearestNotHiddenIndex(e.countRows()-1,-1);null===i&&(i=-1),t.setRangeStart(e._createCellCoords(i,r))}},{name:"moveCellSelectionToMostBottomInlineEnd",callback(e){let{selection:t,rowIndexMapper:r,columnIndexMapper:i}=e,n=parseInt(e.getSettings().fixedRowsBottom,10),o=r.getNearestNotHiddenIndex(e.countRows()-n-1,-1),s=i.getNearestNotHiddenIndex(e.countCols()-1,-1);t.markSource("keyboard"),t.setRangeStart(e._createCellCoords(o,s)),t.markEndSource()}},{name:"moveCellSelectionToMostInlineEnd",callback(e){let{selection:t,columnIndexMapper:r}=e;t.markSource("keyboard"),t.setRangeStart(e._createCellCoords(e.getSelectedRangeActive().highlight.row,r.getNearestNotHiddenIndex(e.countCols()-1,-1))),t.markEndSource()}},{name:"moveCellSelectionToMostInlineStart",callback(e){let{selection:t,columnIndexMapper:r}=e,i=parseInt(e.getSettings().fixedColumnsStart,10),n=e.getSelectedRangeActive().highlight.row,o=r.getNearestNotHiddenIndex(i,1);t.markSource("keyboard"),t.setRangeStart(e._createCellCoords(n,o)),t.markEndSource()}},{name:"moveCellSelectionToMostLeft",callback(e){let{selection:t,columnIndexMapper:r}=e,i=e.getSelectedRangeActive().highlight.row,n=r.getNearestNotHiddenIndex(...e.isRtl()?[e.countCols()-1,-1]:[0,1]);null===n&&(n=e.isRtl()?-1:-e.countRowHeaders()),t.markSource("keyboard"),t.setRangeStart(e._createCellCoords(i,n)),t.markEndSource()}},{name:"moveCellSelectionToMostRight",callback(e){let{selection:t,columnIndexMapper:r}=e,{row:i}=e.getSelectedRangeActive().highlight,n=r.getNearestNotHiddenIndex(...e.isRtl()?[0,1]:[e.countCols()-1,-1]);null===n&&(n=e.isRtl()?-e.countRowHeaders():-1),t.markSource("keyboard"),t.setRangeStart(e._createCellCoords(i,n)),t.markEndSource()}},{name:"moveCellSelectionToMostTop",callback(e){let{selection:t}=e,{col:r}=e.getSelectedRangeActive().highlight,i=e.rowIndexMapper.getNearestNotHiddenIndex(0,1);null===i&&(i=-e.countColHeaders()),t.markSource("keyboard"),t.setRangeStart(e._createCellCoords(i,r)),t.markEndSource()}},{name:"moveCellSelectionToMostTopInlineStart",callback(e){let{selection:t,rowIndexMapper:r,columnIndexMapper:i}=e,n=parseInt(e.getSettings().fixedRowsTop,10),o=parseInt(e.getSettings().fixedColumnsStart,10),s=r.getNearestNotHiddenIndex(n,1),a=i.getNearestNotHiddenIndex(o,1
127);t.markSource("keyboard"),t.setRangeStart(e._createCellCoords(s,a)),t.markEndSource()}},{name:"moveCellSelectionUp",callback(e){let{selection:t}=e;t.markSource("keyboard"),t.transformStart(-1,0),t.markEndSource()}},{name:"moveCellSelectionUpByViewportHight",callback(e){let{selection:t}=e,{navigableHeaders:r}=e.getSettings(),i=r?e.countColHeaders():0,{row:n}=e.getSelectedRangeActive().highlight,o=e.countVisibleRows()+i;o=0===o?-1:-o,n===-i?o=-1:n+o<i&&(o=-(n+i)),t.markSource("keyboard"),t.transformStart(o,0),t.markEndSource(),e.getSelectedRangeActive().highlight.row<0&&e.scrollViewportTo({row:0})}},{name:"emptySelectedCells",callback(e){e.emptySelectedCells(),e._getEditorManager().prepareEditor()}},{name:"scrollToFocusedCell",callback(e){let{highlight:t}=e.getSelectedRangeActive(),r=e.getFirstFullyVisibleRow()-1,i=e.getFirstFullyVisibleColumn()-1,n=e.getLastFullyVisibleRow()+1,o=e.getLastFullyVisibleColumn()+1,s=e._createCellCoords(r,i),a=e._createCellCoords(n,o);if(!e._createCellRange(s,s,a).includes(t)&&(t.row>=0||t.col>=0)){let r={};if(t.col>=0){let i=Math.floor(e.countVisibleCols()/2);r.col=Math.max(t.col-i,0)}if(t.row>=0){let i=Math.floor(e.countVisibleRows()/2);r.row=Math.max(t.row-i,0)}e.scrollViewportTo({...r,verticalSnap:"top",horizontalSnap:"start"})}}},{name:"selectAllCells",callback(e){let{selection:t}=e;t.markSource("keyboard"),t.selectAll(!0,!0,{disableHeadersHighlight:!0}),t.markEndSource()}},{name:"selectAllCellsAndHeaders",callback(e){let{selection:t}=e;t.markSource("keyboard"),t.selectAll(!0,!0,{disableHeadersHighlight:!1}),t.markEndSource()}},{name:"populateSelectedCellsData",callback(e){let t=e.getSelectedRange(),{row:r,col:i}=t[t.length-1].highlight.normalize(),n=e.getDataAtCell(r,i),o=new Map;for(let s=0;s<t.length;s++)t[s].forAll((t,s)=>{if(t>=0&&s>=0&&(t!==r||s!==i)){let{readOnly:r}=e.getCellMeta(t,s);r||o.set(`${t}x${s}`,[t,s,n])}});e.setDataAtCell(Array.from(o.values()))}},{name:"tabNavigation",callback(e){let t={wrapped:!1,flipped:!1},r=!1,i=!1;return e.addHook("afterSelection",(e,n,o,s,a)=>{r&&(t.wrapped&&t.flipped||i)&&(i=!1,a.value=!0)}),e.addHook("beforeRowWrap",(e,r,i)=>{t.wrapped=!0,t.flipped=i}),{before(){let{tabNavigation:t}=e.getSettings();r=!0,t||(i=!0)},after(i){let{tabNavigation:n,autoWrapRow:o}=e.getSettings();if(r=!1,!n||!e.selection.isSelected()||o&&t.wrapped&&t.flipped||!o&&t.wrapped)return t.wrapped=!1,t.flipped=!1,e.deselectCell(),!1;i.preventDefault()}}}}];function a(e){let t={};return s.forEach(r=>{let{name:i,callback:n}=r;t[i]=function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return n(e,...r)}}),t}function l(e){let t=e.getShortcutManager().addContext(i.hE),r=a(e),n={group:i.II};t.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(e,t)=>r.editorCloseAndSaveByEnter(e,t)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(e,t)=>r.editorCloseAndSaveByEnter(e,t)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:e.getShortcutManager().getContext(i.FP),callback:(e,t)=>r.editorCloseAndSave(e,t)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(e,t)=>r.editorCloseAndSaveByArrowKeys(e,t)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>r.editorCloseWithoutSaving()}],n)}var h=r(21927);function u(e){let t=e.getShortcutManager().addContext(i.FP),r=a(e),n={runOnlyIf:()=>{let{navigableHeaders:t}=e.getSettings();return(0,h.isDefined)(e.getSelected())&&(t||!t&&e.countRenderedRows()>0&&e.countRenderedCols()>0)},group:i.Wz};t.addShortcuts([{keys:[["F2"]],callback:e=>r.editorFastOpen(e)},{keys:[["Enter"],["Enter","Shift"]],callback:(e,t)=>r.editorOpen(e,t)},{keys:[["Backspace"],["Delete"]],callback:()=>r.emptySelectedCells()}],{group:i.II,runOnlyIf:()=>(0,h.isDefined)(e.getSelected())}),t.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>r.selectAllCells(),runOnlyIf:()=>{var t;return!(null!==(t=e.getSelectedRangeActive())&&void 0!==t&&t.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var t;return null===(t=e.getSelectedRangeActive())||void 0===t?void 0:t.highlight.isHeader()},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>r.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>r.populateSelectedCellsData(),runOnlyIf:()=>{var t,r;return!(null!==(t=e.getSelectedRangeActive())&&void 0!==t&&t.highlight.isHeader())&&(null===(r=e.getSelectedRangeActive())||void 0===r?void 0:r.getCellsCount())>1}}
127,{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:()=>!(e.selection.isSelectedByCorner()||e.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:()=>!(e.selection.isSelectedByCorner()||e.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:()=>!(e.selection.isSelectedByCorner()||e.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:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>e.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:e=>r.moveCellSelectionInlineStart(e)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:e=>r.moveCellSelectionInlineEnd(e)},{keys:[["Control/Meta","Backspace"]],callback:()=>r.scrollToFocusedCell()}],n);let o=r.tabNavigation();t.addShortcuts([{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:i.Wz,group:i.n4,position:"before",callback:e=>o.before(e)},{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:i.Wz,group:i.n4,callback:e=>o.after(e),position:"after"}])}function c(e){[u,l].forEach(t=>t(e))}},2272:function(e,t,r){"use strict";r.d(t,{U:function(){return b}}),r(76346);var i=r(94896),n=r(9190);r(65230),r(70470),r(52419),r(95984),r(17901);let o=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"]]),s=e=>e.map(e=>{let t=e.toLowerCase();return o.has(t)?o.get(t):t}).sort().join("+"),a=e=>e.split("+"),l=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"]]),h=e=>{let{which:t,key:r}=e;if(l.has(t))return l.get(t);let i=String.fromCharCode(t).toLowerCase();return/^[a-z0-9]$/.test(i)?i:r.toLowerCase()};var u=r(21927),c=r(37710),d=r(92263),g=r(80600);let p=Symbol("shortcut-context");function f(e){return(0,d.isObject)(e)&&e.__kindOf===p}let m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table",r=(0,i.I)({errorIdExists:t=>`The "${t}" shortcut is already registered in the "${e}" context.`}),n=function(){let{keys:e,callback:t,group:i,runOnlyIf:n=()=>!0,captureCtrl:o=!1,preventDefault:a=!0,stopPropagation:l=!1,relativeToGroup:h,position:d,forwardToContext:p}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,u.isUndefined)(i))throw Error("You need to define the shortcut's group.");
127if(!1===(0,c.isFunction)(t))throw Error("The shortcut's callback needs to be a function.");if(!1===Array.isArray(e))throw Error((0,g.e)`Pass the shortcut\'s keys as an array of arrays,\x20
128      using the KeyboardEvent.key properties:\x20
129      https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);let m={callback:t,group:i,runOnlyIf:n,captureCtrl:o,preventDefault:a,stopPropagation:l};(0,u.isDefined)(h)&&(m.relativeToGroup=h,m.position=d),f(p)&&(m.forwardToContext=p),e.forEach(e=>{let t=s(e);if(r.hasItem(t)){let e=r.getItem(t),i=e.findIndex(e=>e.group===h);-1!==i?"before"===d?i-=1:i+=1:i=e.length,e.splice(i,0,m)}else r.addItem(t,[m])})},o=e=>{let t=s(e);r.removeItem(t)};return{__kindOf:p,scope:t,addShortcut:n,addShortcuts:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach(e=>{(0,d.objectEach)(t,(r,i)=>{!1===Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=t[i])}),n(e)})},getShortcuts:e=>{let t=s(e),i=r.getItem(t);return(0,u.isDefined)(i)?i.slice():[]},hasShortcut:e=>{let t=s(e);return r.hasItem(t)},removeShortcutsByKeys:o,removeShortcutsByGroup:e=>
129{r.getItems().forEach(t=>{let[r,i]=t,n=i.filter(t=>t.group!==e);0===n.length?o(a(r)):(i.length=0,i.push(...n))})}}};r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975);var y=r(46879),w=r(66327);let E=["meta","alt","shift","control"],S=function(){let e=new Set;return{press(t){e.add(t)},release(t){e.delete(t)},releaseAll(){e.clear()},isPressed:t=>e.has(t)}}(),C=[],R=0,b=e=>{let{ownerWindow:t,handleEvent:r,beforeKeyDown:o,afterKeyDown:s}=e,a=(0,i.I)({errorIdExists:e=>`The "${e}" context name is already registered.`}),l="grid",u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table",r=m(e,t);return a.addItem(e,r),r},c=()=>l,d=e=>a.getItem(e),p=!1,b=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c(),i=f(r)?r:d(r),o=!1;if(!i.hasShortcut(t))return o;let s=i.getShortcuts(t);for(let r=0;r<s.length;r++){let{callback:i,runOnlyIf:a,preventDefault:l,stopPropagation:h,captureCtrl:u,forwardToContext:c}=s[r];if(!0===a(e)){if(p=u,o=!1===i(e,t),p=!1,l&&e.preventDefault(),h&&((0,n.stopImmediatePropagation)(e),e.stopPropagation()),o)break;c&&b(e,t,c)}}return o},T=function(e,t,r,i,o){let s=e=>E.includes(e),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=[];return e.altKey&&r.push("alt"),t&&(e.ctrlKey||e.metaKey)?r.push("control/meta"):(e.ctrlKey&&r.push("control"),e.metaKey&&r.push("meta")),e.shiftKey&&r.push("shift"),r},l=e=>{if(!1===t(e)||!1===r(e)||229===e.keyCode||"string"!=typeof e.key||(0,n.isImmediatePropagationStopped)(e))return;let l=h(e),u=[];s(l)||(u=a(e)),!o(e,[l].concat(u))&&((0,w.isMacOS)()&&u.includes("meta")||!(0,w.isMacOS)()&&u.includes("control"))&&o(e,[l].concat(a(e,!0))),i(e)},u=e=>{if("string"==typeof e.key){let t=h(e);s(t)&&S.press(t)}},c=e=>{if("string"==typeof e.key){let t=h(e);s(t)&&S.release(t)}},d=()=>{S.releaseAll()};return{mount:()=>{let t=e;for(R+=1;t;)1===R&&(t.document.documentElement.addEventListener("keydown",u),C.push({event:"keydown",listener:u}),t.document.documentElement.addEventListener("keyup",c),C.push({event:"keyup",listener:c})),t.document.documentElement.addEventListener("keydown",l),t.document.documentElement.addEventListener("blur",d),t=(0,y.getParentWindow)(t)},unmount:()=>{let t=e;for(R-=1;t;){if(0===R){for(let e=0;e<C.length;e++){let{event:r,listener:i}=C[e];t.document.documentElement.removeEventListener(r,i)}C.length=0}t.document.documentElement.removeEventListener("keydown",l),t.document.documentElement.removeEventListener("blur",d),t=(0,y.getParentWindow)(t)}},isPressed:e=>S.isPressed(e),releasePressedKeys:()=>S.releaseAll()}}(t,e=>{let t=c();return r(e,(f(t)?t:d(t)).scope)},o,s,b);return T.mount(),{addContext:u,getActiveContextName:c,getContext:d,getOrCreateContext:function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"table";return null!==(t=d(e))&&void 0!==t?t:u(e,r)},setActiveContextName:e=>{if(!a.hasItem(e))throw Error((0,g.e)`You've tried to activate the "${e}" shortcut context\x20
130        that does not exist. Before activation, register the context using the "addContext" method.`);l=e},isCtrlPressed:()=>!p&&(T.isPressed("control")||T.isPressed("meta")),releasePressedKeys:()=>T.releasePressedKeys(),destroy:()=>T.unmount()}}},6615:function(e,t,r){"use strict";r.d(t,{Z:function(){return rc}}),r(76346),r(65230);var i=r(46879),n=r(77882),o=r(9190),s=r(37710),a=r(13066),l=r(66327),h=r(21927);function u(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function c(e,t){return e.get(g(e,t))}function d(e,t,r){return e.set(g(e,t),r),r}function g(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var p=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakMap,w=new WeakMap,E=new WeakMap,S=new WeakMap,C=new WeakMap,R=new WeakMap,b=new WeakMap;class T{constructor(e,t,r,i,n,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;u(this,p,void 0),u(this,f,void 0),u(this,m,void 0),u(this,y,void 0),u(this,w,void 0),u(this,E,void 0),u(this,S,void 0),u(this,C,void 0),u(this,R,[null,null]),u(this,b,[null,null]),d(p,this,r),d(f,this,t),d(m,this,n),d(y,this,o),d(w,this,s),d(E,this,i),d(S,this,e),this.registerEvents()}registerEvents(){c(E,this).addEventListener(c(m,this).holder,"contextmenu",e=>this.onContextMenu(e)),c(E,this).addEventListener(c(m,this).TABLE,"mouseover",e=>this.onMouseOver(e)),c(E,this).addEventListener(c(m,this).TABLE,"mouseout",e=>this.onMouseOut(e));let e=()=>{c(E,this).addEventListener(c(m,this).holder,"touchstart",e=>this.onTouchStart(e)),c(E,this).addEventListener(c(m,this).holder,"touchend",e=>this.onTouchEnd(e)),this.momentumScrolling||(this.momentumScrolling={}),c(E,this).addEventListener(c(m,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||c(p,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>
130{this.touchApplied||(this.momentumScrolling.ongoing=!1,c(p,this).getSetting("onAfterMomentumScroll"))},200)})};(0,l.isMobileBrowser)()?e():((0,a.isTouchSupported)()&&e(),(()=>{c(E,this).addEventListener(c(m,this).holder,"mouseup",e=>this.onMouseUp(e)),c(E,this).addEventListener(c(m,this).holder,"mousedown",e=>this.onMouseDown(e))})())}selectedCellWasTouched(e){let t=this.parentCell(e).coords;if(c(C,this)&&t){let[e,r]=[t.row,c(C,this).from.row],[i,n]=[t.col,c(C,this).from.col];return e===r&&i===n}return!1}parentCell(e){let t={},r=c(m,this).TABLE,n=(0,i.closestDown)(e,["TD","TH"],r);return n?(t.coords=c(m,this).getCoords(n),t.TD=n):(0,i.hasClass)(e,"wtBorder")&&(0,i.hasClass)(e,"current")?(t.coords=c(y,this).getFocusSelection().cellRange.highlight,t.TD=c(m,this).getCell(t.coords)):(0,i.hasClass)(e,"wtBorder")&&(0,i.hasClass)(e,"area")&&c(y,this).getAreaSelection().cellRange&&(t.coords=c(y,this).getAreaSelection().cellRange.to,t.TD=c(m,this).getCell(t.coords)),t}onMouseDown(e){let t=c(f,this).rootDocument.activeElement,r=(0,s.partial)(i.getParent,e.target),n=e.target;if(!["TD","TH"].includes(t.nodeName)&&(n===t||r(0)===t||r(1)===t))return;let o=this.parentCell(n);(0,i.hasClass)(n,"corner")?c(p,this).getSetting("onCellCornerMouseDown",e,n):o.TD&&c(p,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(0===e.button||this.touchApplied)&&o.TD&&(c(b,this)[0]=o.TD,clearTimeout(c(R,this)[0]),c(R,this)[0]=setTimeout(()=>{c(b,this)[0]=null},1e3))}onContextMenu(e){if(c(p,this).has("onCellContextMenu")){let t=this.parentCell(e.target);t.TD&&this.callListener("onCellContextMenu",e,t.coords,t.TD)}}onMouseOver(e){if(!c(p,this).has("onCellMouseOver"))return;let t=c(m,this).TABLE,r=(0,i.closestDown)(e.target,["TD","TH"],t),n=c(w,this)||this;r&&r!==n.lastMouseOver&&(0,i.isChildOf)(r,t)&&(n.lastMouseOver=r,this.callListener("onCellMouseOver",e,c(m,this).getCoords(r),r))}onMouseOut(e){if(!c(p,this).has("onCellMouseOut"))return;let t=c(m,this).TABLE,r=(0,i.closestDown)(e.target,["TD","TH"],t),n=(0,i.closestDown)(e.relatedTarget,["TD","TH"],t),o=c(w,this)||this;r&&r!==n&&(0,i.isChildOf)(r,t)&&(this.callListener("onCellMouseOut",e,c(m,this).getCoords(r),r),null===n&&(o.lastMouseOver=null))}onMouseUp(e){let t=this.parentCell(e.target);t.TD&&c(p,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,t.coords,t.TD),(0===e.button||this.touchApplied)&&(t.TD===c(b,this)[0]&&t.TD===c(b,this)[1]?((0,i.hasClass)(e.target,"corner")?this.callListener("onCellCornerDblClick",e,t.coords,t.TD):this.callListener("onCellDblClick",e,t.coords,t.TD),c(b,this)[0]=null,c(b,this)[1]=null):t.TD===c(b,this)[0]&&(c(b,this)[1]=t.TD,clearTimeout(c(R,this)[1]),c(R,this)[1]=setTimeout(()=>{c(b,this)[1]=null},500)))}onTouchStart(e){d(C,this,c(y,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var t;let r=e.target,i=null===(t=this.parentCell(r))||void 0===t?void 0:t.coords,n=(0,h.isDefined)(i)&&i.row>=0&&i.col>=0;e.cancelable&&n&&c(p,this).getSetting("isDataViewInstance")&&((0,l.isIOS)()&&((0,l.isChromeWebKit)()||(0,l.isFirefoxWebKit)())&&this.selectedCellWasTouched(r)&&!["A","BUTTON","INPUT"].includes(r.tagName)?e.preventDefault():this.selectedCellWasTouched(r)||e.preventDefault()),this.onMouseUp(e),this.touchApplied=!1}callListener(e,t,r,i){let n=c(p,this).getSettingPure(e);n&&n(t,r,i,c(S,this).call(this))}destroy(){clearTimeout(c(R,this)[0]),clearTimeout(c(R,this)[1]),c(E,this).destroy()}}r(70470),r(95984),r(85411);var N=r(22386),A=r(79341),I=r(26247);function M(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class O{constructor(e,t,r){M(this,"offset",void 0),M(this,"total",void 0),M(this,"countTH",void 0),this.offset=e,this.total=t,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}
130offsettedTH(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 x(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class _{constructor(e,t,r){x(this,"offset",void 0),x(this,"total",void 0),x(this,"countTH",void 0),this.offset=e,this.total=t,this.countTH=r}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 P(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class L{constructor(){P(this,"currentSize",0),P(this,"nextSize",0),P(this,"currentOffset",0),P(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}function k(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class D{constructor(){k(this,"size",new L),k(this,"workingSpace",0),k(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return null!==this.sharedSize}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=1,e.workingSpace=2,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=2,e.workingSpace=1,this.sharedSize=e.getViewSize()}}r(9784);class H{constructor(e,t){var r,i,n;i=[],(r="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r="order","string"))?n:n+"")in this?Object.defineProperty(this,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):this[r]=i,this.order=[...Array(t).keys()].map(t=>e+t)}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()}}class B{constructor(e){var t,r,i;r=void 0,(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t="sizeSet","string"))?i:i+"")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.sizeSet=e}diff(){let{sizeSet:e}=this,{currentSize:t,nextSize:r}=e.getViewSize(),i=Math.max(r,t);if(0===i)return[];let{currentOffset:n,nextOffset:o}=e.getViewSize(),s=new H(n,t),a=new H(o,r),l=[];for(let t=0;t<i;t++){let n=s.get(t),o=a.get(t);if(-1===o)l.push(["remove",n]);else if(-1===n)!e.isShared()||e.isShared()&&e.isPlaceOn(2)?l.push(["append",o]):l.push(["prepend",o]);else if(o>n)s.has(o)&&(s.remove(o),r<=s.length&&(i-=1)),l.push(["replace",o,n]);else if(o<n){let e=s.prepend(o);l.push(["insert_before",o,n,e])}else l.push(["none",o])}return l}}function F(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class V{constructor(e,t){F(this,"rootNode",void 0),F(this,"nodesPool",void 0),F(this,"sizeSet",new D),F(this,"collectedNodes",[]),F(this,"viewDiffer",new B(this.sizeSet)),F(this,"leads",[]),this.rootNode=e,this.nodesPool=t}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(){let e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}applyCommand(e){let{rootNode:t}=this,[r,i,n,o]=e,s=this.nodesPool(i);
130switch(this.collectedNodes.push(s),r){case"prepend":t.insertBefore(s,t.firstChild);break;case"append":t.appendChild(s);break;case"insert_before":t.insertBefore(s,this.nodesPool(n)),t.removeChild(this.nodesPool(o));break;case"replace":t.replaceChild(s,this.nodesPool(n));break;case"remove":t.removeChild(s)}}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 U extends V{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 W(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class j{constructor(e){W(this,"nodeType",void 0),W(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,t){let r="number"==typeof t?`${e}x${t}`:e.toString();if(this.pool.has(r))return this.pool.get(r);let i=this.rootDocument.createElement(this.nodeType);return this.pool.set(r,i),i}}function G(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ${constructor(e,t){G(this,"nodesPool",null),G(this,"nodeType",void 0),G(this,"rootNode",void 0),G(this,"table",null),G(this,"renderedNodes",0),this.nodesPool="string"==typeof e?new j(e):null,this.nodeType=e,this.rootNode=t}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}var z=r(65839);function Y(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class K extends ${constructor(){super("TH"),Y(this,"orderViews",new WeakMap),Y(this,"sourceRowIndex",0)}obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new U(e,e=>this.nodesPool.obtain(this.sourceRowIndex,e)),this.orderViews.set(e,t)),t}render(){let{rowsToRender:e,rowHeaderFunctions:t,rowHeadersCount:r,rows:n,cells:o}=this.table;for(let s=0;s<e;s++){let e=this.table.renderedRowToSource(s),a=n.getRenderedNode(s);this.sourceRowIndex=e;let l=this.obtainOrderView(a),h=o.obtainOrderView(a);l.appendView(h).setSize(r).setOffset(0).start();for(let n=r-1;n>=0;n--){l.render();let r=l.getCurrentNode();r.className="",r.removeAttribute("style"),(0,i.removeAttribute)(r,[RegExp("aria-(.*)"),/role/]),this.table.isAriaEnabled()&&(0,i.setAttribute)(r,[(0,z.iL)(),(0,z.Pp)(),(0,z.yz)(n+1),(0,z.Qk)(-1)]),t[n](e,r,n)}l.end()}}}class X extends ${constructor(e){super(null,e)}adjust(){let{columnHeadersCount:e,rowHeadersCount:t}=this.table,r=this.rootNode.firstChild;if(e){let{columnsToRender:i}=this.table,n=i+t;for(let t=0;t<e;t++){for((r=this.rootNode.childNodes[t])||(r=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(r)),this.renderedNodes=r.childNodes.length;this.renderedNodes<n;)r.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>n;)r.removeChild(r.lastChild),this.renderedNodes-=1}let o=this.rootNode.childNodes.length;if(o>e)for(let t=e;t<o;t++)this.rootNode.removeChild(this.rootNode.lastChild)}else r&&(0,i.empty)(r)}render(){let{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&(0,i.setAttribute)(this.rootNode,[(0,z.Ct)()]);for(let t=0;t<e;t+=1){let{columnHeaderFunctions:e,columnsToRender:r,rowHeadersCount:n}=this.table,o=this.rootNode.childNodes[t];this.table.isAriaEnabled()&&(0,i.setAttribute)(o,[(0,z.f3)(),(0,z.d5)(t+1)]);for(let s=-1*n;s<r;s+=1){let r=this.table.renderedColumnToSource(s),a=o.childNodes[s+n];a.className="",a.removeAttribute("style"),(0,i.removeAttribute)(a,[RegExp("aria-(.*)"),/role/]),this.table.isAriaEnabled()&&(0,i.setAttribute)(a,[(0,z.yz)(s+1+this.table.rowHeadersCount),(0,z.Qk)(-1),(0,z.Ng)(),...s>=0?[(0,z.iJ)()]:[(0,z.hm)(),(0,z.QK)("Select whole grid")]]),e[t](r,a,t)}}}}var q=r(80600);let Z=!1;class Q extends ${constructor(e){super(null,e)}adjust(){let{columnsToRender:e,rowHeadersCount:t}=this.table,r=e+t;for(;this.renderedNodes<r;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>r;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();let{columnsToRender:e,rowHeadersCount:t}=this.table;!Z&&e>1e3&&(Z=!0,(0,I.ZK)((0,q.e)`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
131        Consider limiting the number of rendered columns by specifying the table width and/or\x20
132        turning off the "renderAllColumns" option.`));for(let e=0;e<t;e++){let t=this.table.renderedColumnToSource(e),r=this.table.columnUtils.getHeaderWidth(t);this.rootNode.childNodes[e].style.width=`${r}px`}for(let r=0;r<e;r++){let e=this.table.renderedColumnToSource(r),i=this.table.columnUtils.getWidth(e);this.rootNode.childNodes[r+t].style.width=`${i}px`}let r=this.rootNode.firstChild;r&&(0,i.addClass)(r,"rowHeader")}}let J={rowEven:"ht__row_even",rowOdd:"ht__row_odd"},ee=!1;class et extends ${constructor(e){var t,r,i;super("TR",e),r=void 0,(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t="orderView","string"))?i:i+"")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.orderView=new V(e,e=>this.nodesPool.obtain(e))}getRenderedNode(e){return this.orderView.getNode(e)}
132hasStaleContent(e){return this.orderView.hasStaleContent(e)}render(){let{rowsToRender:e}=this.table;!ee&&e>1e3&&(ee=!0,(0,I.ZK)((0,q.e)`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
133        Consider limiting the number of rendered rows by specifying the table height and/or\x20
134        turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&(0,i.setAttribute)(this.rootNode,[(0,z.Ct)()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let n=0;n<e;n++){this.orderView.render();let e=this.orderView.getCurrentNode(),o=this.table.renderedRowToSource(n);if(this.table.isAriaEnabled()){var t,r;(0,i.setAttribute)(e,[(0,z.f3)(),(0,z.d5)(o+(null!==(t=null===(r=this.table.rowUtils)||void 0===r||null===(r=r.dataAccessObject)||void 0===r?void 0:r.columnHeaders.length)&&void 0!==t?t:0)+1)])}(o+1)%2==0?(0,i.hasClass)(e,J.rowEven)||((0,i.removeClass)(e,J.rowOdd),(0,i.addClass)(e,J.rowEven)):(0,i.hasClass)(e,J.rowOdd)||((0,i.removeClass)(e,J.rowEven),(0,i.addClass)(e,J.rowOdd))}this.orderView.end()}}function er(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ei extends ${constructor(){super("TD"),er(this,"orderViews",new WeakMap),er(this,"sourceRowIndex",0)}obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new U(e,e=>this.nodesPool.obtain(this.sourceRowIndex,e),this.nodeType),this.orderViews.set(e,t)),t}render(){let{rowsToRender:e,columnsToRender:t,rows:r,rowHeaders:n}=this.table;for(let a=0;a<e;a++){let e=this.table.renderedRowToSource(a),l=r.getRenderedNode(a);this.sourceRowIndex=e;let h=this.obtainOrderView(l),u=n.obtainOrderView(l);h.prependView(u).setSize(t).setOffset(0).start();for(let r=0;r<t;r++){h.render();let t=this.table.renderedColumnToSource(r),n=h.getCurrentNode();if((0,i.hasClass)(n,"hide")||(n.className=""),n.removeAttribute("style"),n.removeAttribute("dir"),(0,i.removeAttribute)(n,[RegExp("aria-(.*)"),/role/]),this.table.cellRenderer(e,t,n),this.table.isAriaEnabled()){var o,s;(0,i.setAttribute)(n,[...n.hasAttribute("role")?[]:[(0,z.Qz)()],(0,z.Qk)(-1),(0,z.yz)(t+(null!==(o=null===(s=this.table.rowUtils)||void 0===s||null===(s=s.dataAccessObject)||void 0===s?void 0:s.rowHeaders.length)&&void 0!==o?o:0)+1)])}}h.end()}}}function en(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class eo{constructor(e){let{cellRenderer:t,stylesHandler:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};en(this,"rootNode",void 0),en(this,"rootDocument",void 0),en(this,"rowHeaders",null),en(this,"columnHeaders",null),en(this,"colGroup",null),en(this,"rows",null),en(this,"cells",null),en(this,"rowFilter",null),en(this,"columnFilter",null),en(this,"rowUtils",null),en(this,"columnUtils",null),en(this,"rowsToRender",0),en(this,"columnsToRender",0),en(this,"rowHeaderFunctions",[]),en(this,"rowHeadersCount",0),en(this,"columnHeaderFunctions",[]),en(this,"columnHeadersCount",0),en(this,"cellRenderer",void 0),en(this,"activeOverlayName",void 0),en(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=t,this.stylesHandler=r}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,t){this.rowUtils=e,this.columnUtils=t}setViewportSize(e,t){this.rowsToRender=e,this.columnsToRender=t}setFilters(e,t){this.rowFilter=e,this.columnFilter=t}setHeaderContentRenderers(e,t){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=t,this.columnHeadersCount=t.length}setRenderers(){let{rowHeaders:e,columnHeaders:t,colGroup:r,rows:i,cells:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setTable(this),t.setTable(this),r.setTable(this),i.setTable(this),n.setTable(this),this.rowHeaders=e,this.columnHeaders=t,this.colGroup=r,this.rows=i,this.cells=n}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}
134render(){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();let{rowsToRender:e,rows:t}=this;for(let r=0;r<e;r++){let e=t.getRenderedNode(r),i=this.rowUtils;if(e.firstChild){let t=this.renderedRowToSource(r),n=i.getHeightByOverlayName(t,this.activeOverlayName),o=this.stylesHandler.areCellsBorderBox()?0:1;n?e.firstChild.style.height=`${n-o}px`:e.firstChild.style.height=""}}}}class es{constructor(){let{TABLE:e,THEAD:t,COLGROUP:r,TBODY:i,rowUtils:n,columnUtils:o,cellRenderer:s,stylesHandler:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.renderer=new eo(e,{cellRenderer:s,stylesHandler:a}),this.renderer.setRenderers({rowHeaders:new K,columnHeaders:new X(t),colGroup:new Q(r),rows:new et(i),cells:new ei}),this.renderer.setAxisUtils(n,o)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,t){return this.renderer.setFilters(e,t),this}setViewportSize(e,t){return this.renderer.setViewportSize(e,t),this}setHeaderContentRenderers(e,t){return this.renderer.setHeaderContentRenderers(e,t),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function ea(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class el{constructor(e,t){ea(this,"dataAccessObject",void 0),ea(this,"wtSettings",void 0),ea(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=t}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let t=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight(),r=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return void 0!==r&&(t=t?Math.max(t,r):r),t}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){let{wtSettings:e}=this,t=e.getSetting("rowHeaderWidth");if(null!=(t=e.getSetting("onModifyRowHeaderWidth",t))){let r=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let e=0;e<r;e++){let r=Array.isArray(t)?t[e]:t;r=null==r?i:r,this.headerWidths.set(e,r)}}}}function eh(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class eu{constructor(e,t){eh(this,"dataAccessObject",void 0),eh(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=t}getHeight(e){let t=this.wtSettings.getSetting("rowHeight",e),r=this.dataAccessObject.wtViewport.oversizedRows[e];return void 0!==r&&(t=void 0===t?r:Math.max(t,r)),t}getHeightByOverlayName(e,t){let r=this.wtSettings.getSetting("rowHeightByOverlayName",e,t),i=this.dataAccessObject.wtViewport.oversizedRows[e];return void 0!==i&&(r=void 0===r?i:Math.max(r,i)),r}}let ec="bottom",ed="inline_start",eg="top_inline_start_corner",ep="bottom_inline_start_corner",ef=["top",ec,ed,eg,ep],em=new Map([["top","ht_clone_top"],[ec,`ht_clone_${ec}`],[ed,`ht_clone_${ed} ht_clone_left`],[eg,`ht_clone_${eg} ht_clone_top_left_corner`],[ep,`ht_clone_${ep} ht_clone_bottom_left_corner`]]);function ey(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ev{constructor(e,t,r,n,o){ey(this,"wtSettings",null),ey(this,"domBindings",void 0),ey(this,"TBODY",null),ey(this,"THEAD",null),ey(this,"COLGROUP",null),ey(this,"hasTableHeight",!0),ey(this,"hasTableWidth",!0),ey(this,"isTableVisible",!1),ey(this,"tableOffset",0),ey(this,"holderOffset",0),this.domBindings=r,this.isMaster="master"===o,this.name=o,this.dataAccessObject=e,this.facadeGetter=t,this.wtSettings=n,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=r.rootTable,(0,i.removeTextNodes)(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;let s=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(s)),this.rowUtils=new eu(this.dataAccessObject,this.wtSettings),this.columnUtils=new el(this.dataAccessObject,this.wtSettings),this.tableRenderer=new es({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.wtSettings.getSetting("stylesHandler")})}is(e){return this.name===e}fixTableDomTree(){let 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){let t;let r=e.parentNode;return r&&r.nodeType===Node.ELEMENT_NODE&&(0,i.hasClass)(r,"wtHolder")||((t=this.domBindings.rootDocument.createElement("div")).className="wtSpreader",r&&r.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",this.wtSettings.getSetting("ariaTags")&&(0,i.setAttribute)(t,[(0,z.Rn)()]),t}createHider(e){let t;let r=e.parentNode;return r&&r.nodeType===Node.ELEMENT_NODE&&(0,i.hasClass)(r,"wtHolder")||((t=this.domBindings.rootDocument.createElement("div")).className="wtHider",r&&r.insertBefore(t,e),t.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&(0,i.setAttribute)(t,[(0,z.Rn)()]),t}createHolder(e){let t;let r=e.parentNode;return r&&r.nodeType===Node.ELEMENT_NODE&&(0,i.hasClass)(r,"wtHolder")||((t=this.domBindings.rootDocument.createElement("div")).style.position="relative",t.className="wtHolder",this.isMaster&&(0,i.setAttribute)(t,[(0,z.Qk)(-1)]),r&&r.insertBefore(t,e),this.isMaster&&(t.parentNode.className+="ht_master handsontable",t.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&(0,i.setAttribute)(t.parentNode,[(0,z.Rn)()])),t.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&(0,i.setAttribute)(t,[(0,z.Rn)()]),t}draw(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{wtSettings:t}=this,{wtOverlays:r,wtViewport:n}=this.dataAccessObject,o=t.getSetting("totalRows"),s=t.getSetting("totalColumns"),a=t.getSetting("rowHeaders"),l=a.length,h=t.getSetting("columnHeaders"),u=h.length,c=e;if(this.isMaster&&(r.beforeDraw(),this.holderOffset=(0,i.offset)(this.holder),c=n.
134createCalculators(c),l&&!t.getSetting("fixedColumnsStart"))){let e=r.inlineStartOverlay.getScrollPosition(),t=this.correctHeaderWidth;this.correctHeaderWidth=0!==e,t!==this.correctHeaderWidth&&(c=!1)}if(c)this.isMaster&&r.refresh(!0);else{this.isMaster?this.tableOffset=(0,i.offset)(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;let e=Math.max(this.getFirstRenderedRow(),0),t=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new _(e,o,u),this.columnFilter=new O(t,s,l);let c=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();let e={};this.wtSettings.getSetting("beforeDraw",!0,e),c=!0!==e.skipRender}c&&(this.tableRenderer.setHeaderContentRenderers(a,h),(this.is(ec)||this.is(ep))&&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(ec))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||n.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(ec)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let d=!1;return this.isMaster&&(d=r.topOverlay.resetFixedPosition(),r.bottomOverlay.clone&&(d=r.bottomOverlay.resetFixedPosition()||d),d=r.inlineStartOverlay.resetFixedPosition()||d,r.topInlineStartCornerOverlay&&r.topInlineStartCornerOverlay.resetFixedPosition(),r.bottomInlineStartCornerOverlay&&r.bottomInlineStartCornerOverlay.clone&&r.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(r.refreshAll(),r.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(c),this.isMaster&&r.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){let t,r,n;let o=this.columnFilter.renderedToSource(e),s=this.wtSettings.getSetting("columnHeaders").length,a=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight(),l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;s;)s-=1,t=this.getColumnHeaderHeight(s),(r=this.getColumnHeader(o,s))&&(n=(0,i.innerHeight)(r),(!t&&a<n||t<n)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[s]=n),Array.isArray(l)?null!==l[s]&&void 0!==l[s]&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[s]=l[s]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[s]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[s]<(l[s]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[s]=l[s]||l))}adjustColumnHeaderHeights(){let{wtSettings:e}=this,t=this.THEAD.childNodes,r=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let e=0,n=i.length;e<n;e++)if(r[e]){if(!t[e]||0===t[e].childNodes.length)return;t[e].childNodes[0].style.height=`${r[e]}px`}}resetOversizedRows(){let{wtSettings:e}=this,{wtViewport:t}=this.dataAccessObject;if((this.isMaster||this.is(ec))&&!e.getSetting("externalRowCalculator")){let e=this.getRenderedRowsCount();for(let r=0;r<e;r++){let e=this.rowFilter.renderedToSource(r);t.oversizedRows&&t.oversizedRows[e]&&(t.oversizedRows[e]=void 0)}}}getCell(e){let t=e.row,r=e.col,i=this.wtSettings.getSetting("onModifyGetCellCoords",t,r,!this.isMaster,"render");if(i&&Array.isArray(i)&&([t,r]=i),this.isRowBeforeRenderedRows(t))return -1;if(this.isRowAfterRenderedRows(t))return -2;if(this.isColumnBeforeRenderedColumns(r))return -3;if(this.isColumnAfterRenderedColumns(r))return -4;let n=this.getRow(t);if(!n&&t>=0)throw Error("TR was expected to be rendered but is not");let o=n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)];if(!o&&r>=0)throw Error("TD or TH was expected to be rendered but is not");return o}getRow(e){var t,r;let i=null,n=null;return e<0?(i=null===(t=this.rowFilter)||void 0===t?void 0:t.sourceRowToVisibleColHeadedRow(e),n=this.THEAD):(i=null===(r=this.rowFilter)||void 0===r?void 0:r.sourceToRendered(e),n=this.TBODY),void 0!==i&&void 0!==n&&!(n.childNodes.length<i+1)&&n.childNodes[i]}getColumnHeader(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.THEAD.childNodes[t];return null==r?void 0:r.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){let t=[],r=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);
134return this.THEAD.childNodes.forEach(e=>{let i=e.childNodes[r];i&&t.push(i)}),t}getRowHeader(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t>=this.wtSettings.getSetting("rowHeaders").length)return;let r=this.rowFilter.sourceToRendered(e),i=r<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):r,n=(r<0?this.THEAD:this.TBODY).childNodes[i];return null==n?void 0:n.childNodes[t]}getRowHeaders(e){let t=[],r=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<r;i++){let r=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],n=null==r?void 0:r.childNodes[i];n&&t.push(n)}return t}getCoords(e){let t=e;if("TD"!==t.nodeName&&"TH"!==t.nodeName&&(t=(0,i.closest)(t,["TD","TH"])),null===t)return null;let r=t.parentNode;if(!r)return null;let n=r.parentNode,o=(0,i.index)(r),s=t.cellIndex;(0,i.overlayContainsElement)(eg,t,this.wtRootElement)||(0,i.overlayContainsElement)("top",t,this.wtRootElement)?"THEAD"===n.nodeName&&(o-=n.childNodes.length):(0,i.overlayContainsElement)(ep,t,this.wtRootElement)||(0,i.overlayContainsElement)(ec,t,this.wtRootElement)?o=this.wtSettings.getSetting("totalRows")-n.childNodes.length+o:n===this.THEAD?o=this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter&&(o=this.rowFilter.renderedToSource(o)),(0,i.overlayContainsElement)(eg,t,this.wtRootElement)||(0,i.overlayContainsElement)(ed,t,this.wtRootElement)||(0,i.overlayContainsElement)(ep,t,this.wtRootElement)?s=this.columnFilter.offsettedTH(s):this.columnFilter&&(s=this.columnFilter.visibleRowHeadedColumnToSourceColumn(s));let a=this.wtSettings.getSetting("onModifyGetCoordsElement",o,s);return a&&Array.isArray(a)&&([o,s]=a),this.wot.createCellCoords(o,s)}markOversizedRows(){let e,t,r,n,o;if(this.wtSettings.getSetting("externalRowCalculator"))return;let s=this.TBODY.childNodes.length,a=this.wtSettings.getSetting("stylesHandler"),l=s*a.getDefaultRowHeight(),h=(0,i.innerHeight)(this.TBODY)-1,u=a.areCellsBorderBox(),c=u?i.outerHeight:i.innerHeight,d=u?0:1,g=u?1:0;if(l!==h||this.wtSettings.getSetting("fixedRowsBottom"))for(;s;){s-=1,r=this.rowFilter.renderedToSource(s),e=this.getRowHeight(r),o=(n=this.getTrForRow(r)).querySelector("th");let i=0===r?g:0;t=o?c(o):c(n)-d,(!e&&a.getDefaultRowHeight()<t-i||e<t)&&(u||(t+=1),this.dataAccessObject.wtViewport.oversizedRows[r]=t)}}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){return!(e>=0)&&Math.abs(e)<=this.wtSettings.getSetting("rowHeaders").length}isRowHeaderRendered(e){return!(e>=0)&&Math.abs(e)<=this.wtSettings.getSetting("columnHeaders").length}isRowBeforeRenderedRows(e){let t=this.getFirstRenderedRow();return e<0&&t<=0?!this.isRowHeaderRendered(e):e<t}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){let t=this.getFirstRenderedColumn();return e<0&&t<=0?!this.isColumnHeaderRendered(e):e<t}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&&0>this.columnFilter.sourceToRendered(e)&&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(0,i.outerWidth)(this.TABLE)}getHeight(){return(0,i.outerHeight)(this.TABLE)}getTotalWidth(){let e=(0,i.outerWidth)(this.hider);return 0!==e?e:this.getWidth()}getTotalHeight(){let e=(0,i.outerHeight)(this.hider);return 0!==e?e:this.getHeight()}isVisible(){return(0,i.isVisible)(this.TABLE)}_modifyRowHeaderWidth(e){let t=(0,s.isFunction)(e)?e():null;return Array.isArray(t)?(t=[...t])[t.length-1]=this._correctRowHeaderWidth(t[t.length-1]):t=this._correctRowHeaderWidth(t),t}_correctRowHeaderWidth(e){let t=e;return"number"!=typeof e&&(t=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(t+=1),t}}var ew=ev,eE=r(92263);let eS={getFirstRenderedRow(){return 0===this.getRenderedRowsCount()?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()}
134,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}};(0,eE.defineGetter)(eS,"MIXIN_NAME","stickyRowsTop",{writable:!1,enumerable:!1});let eC={getFirstRenderedColumn(){let e=this.dataAccessObject.startColumnRendered;return null===e?-1:e},getFirstVisibleColumn(){let e=this.dataAccessObject.startColumnVisible;return null===e?-1:e},getFirstPartiallyVisibleColumn(){let e=this.dataAccessObject.startColumnPartiallyVisible;return null===e?-1:e},getLastRenderedColumn(){let e=this.dataAccessObject.endColumnRendered;return null===e?-1:e},getLastVisibleColumn(){let e=this.dataAccessObject.endColumnVisible;return null===e?-1:e},getLastPartiallyVisibleColumn(){let e=this.dataAccessObject.endColumnPartiallyVisible;return null===e?-1:e},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};(0,eE.defineGetter)(eC,"MIXIN_NAME","calculatedColumns",{writable:!1,enumerable:!1});
134class eR extends ew{constructor(e,t,r,i){super(e,t,r,i,"top")}}(0,eE.mixin)(eR,eS),(0,eE.mixin)(eR,eC);var eb=r(60049);function eT(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var eN=new WeakSet;class eA{constructor(e){var t,r,i;(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(this,eN),eN.add(this),r=void 0,(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t="dataAccessObject","string"))?i:i+"")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.dataAccessObject=e}scrollViewport(e,t,r){if(e.col<0||e.row<0)return!1;let i=this.scrollViewportHorizontally(e.col,t),n=this.scrollViewportVertically(e.row,r);return i||n}scrollViewportHorizontally(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",{drawn:r,totalColumns:i}=this.dataAccessObject;if(!r)return!1;let n=(0,eE.createObjectPropListener)(t);if(!Number.isInteger(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,n))||e<0||e>i)return!1;t=n.value;let{fixedColumnsStart:o,inlineStartOverlay:s}=this.dataAccessObject,a="auto"===t;if(a&&e<o)return!1;let l=this.getFirstVisibleColumn(),h=this.getLastVisibleColumn(),u=!1;return(a&&(e<l||e>h)||!a)&&(u=s.scrollTo(e,a?e>=this.getLastPartiallyVisibleColumn():"end"===t)),u}scrollViewportVertically(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",{drawn:r,totalRows:i}=this.dataAccessObject;if(!r)return!1;let n=(0,eE.createObjectPropListener)(t);if(!Number.isInteger(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,n))||e<0||e>i)return!1;t=n.value;let{fixedRowsBottom:o,fixedRowsTop:s,topOverlay:a}=this.dataAccessObject,l="auto"===t;if(l&&(e<s||e>i-o-1))return!1;let h=this.getFirstVisibleRow(),u=this.getLastVisibleRow(),c=!1;return(l&&(e<h||e>u)||!l)&&(c=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleRow():"bottom"===t)),c}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return eT(eN,this,eM).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return eT(eN,this,eM).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return eT(eN,this,eI).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return eT(eN,this,eI).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function eI(e){let{wtSettings:t,inlineStartOverlay:r,wtTable:n,wtViewport:o,totalColumns:s,rootWindow:a}=this.dataAccessObject;if(r.mainTableScrollableElement===a){let l=t.getSetting("rtlMode"),h=null;if(l){let e=n.TABLE.getBoundingClientRect(),t=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;h=Math.abs(e.right-t)}else h=(0,i.offset)(n.wtRootElement).left;let u=Math.abs((0,i.getScrollLeft)(a,a));if(h>u){let t=(0,i.innerWidth)(a),n=o.getRowHeaderWidth();for(let i=1;i<=s;i++)if(h+(n+=r.sumCellSizes(i-1,i))-u>=t){e=i-2;break}}}return e}function eM(e){let{topOverlay:t,wtTable:r,wtViewport:n,totalRows:o,rootWindow:s}=this.dataAccessObject;if(t.mainTableScrollableElement===s){let a=(0,i.offset)(r.wtRootElement),l=(0,i.getScrollTop)(s,s);if(a.top>l){let r=(0,i.innerHeight)(s),h=n.getColumnHeaderHeight();for(let i=1;i<=o;i++)if(h+=t.sumCellSizes(i-1,i),a.top+h-l>=r){e=i-2;break}}}return e}var eO=r(5506),ex=r(77718);function e_(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class eP{get eventManager(){return new n.Z(this)}constructor(e,t){e_(this,"wtTable",void 0),e_(this,"wtScroll",void 0),e_(this,"wtViewport",void 0),e_(this,"wtOverlays",void 0),e_(this,"selectionManager",void 0),e_(this,"wtEvent",void 0),e_(this,"guid",`wt_${(0,eb.randomString)()}`),e_(this,"drawInterrupted",!1),e_(this,"drawn",!1),e_(this,"activeOverlayName","master"),e_(this,"domBindings",void 0),e_(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView}
134,this.wtSettings=t,this.wtScroll=new eA(this.createScrollDao())}findOriginalHeaders(){let e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let t=0,r=this.wtTable.THEAD.childNodes[0].childNodes.length;t<r;t++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[t].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(t,r){(0,i.fastInnerText)(r,e[t])}])}}createCellCoords(e,t){return new eO.Z(e,t,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,t,r){return new ex.Z(e,t,r,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.drawInterrupted=!1,!this.wtTable.isVisible()||(0,i.hasZeroHeight)(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.wtTable.getCell(e);let r=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),n=this.wtSettings.getSetting("fixedRowsBottom"),o=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<o)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<o&&e.row>=r-n){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else if(e.col<o)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);else if(e.row<r&&e.row>=r-n&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e);return this.wtTable.getCell(e)}scrollViewport(e,t,r){return this.wtScroll.scrollViewport(e,t,r)}scrollViewportHorizontally(e,t){return this.wtScroll.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this.wtScroll.scrollViewportVertically(e,t)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){let 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(){let 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 drawn(){return e.drawn},set drawn(v){e.drawn=v},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 eL(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ek extends eP{constructor(e,t,r){super(e,t),eL(this,"cloneSource",void 0),eL(this,"cloneOverlay",void 0);let i=this.wtSettings.getSetting("facade",this);this.cloneSource=r.source,this.cloneOverlay=r.overlay,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=r.viewport,this.selectionManager=r.selectionManager,this.wtEvent=ne
134w T(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}class eD{constructor(e,t,r,n,o){var s,a;(s="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s="wtSettings","string"))?a:a+"")in this?Object.defineProperty(this,s,{value:null,enumerable:!0,configurable:!0,writable:!0}):this[s]=null,(0,eE.defineGetter)(this,"wot",e,{writable:!1}),this.domBindings=o,this.facadeGetter=t,this.wtSettings=n;let{TABLE:l,hider:h,spreader:u,holder:c,wtRootElement:d}=this.wot.wtTable;this.instance=this.wot,this.type=r,this.mainTableScrollableElement=null,this.TABLE=l,this.hider=h,this.spreader=u,this.holder=c,this.wtRootElement=d,this.trimmingContainer=(0,i.getTrimmingContainer)(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){"before"===e&&this.shouldBeRendered()?this.needFullRender=!0:"after"!==e||this.shouldBeRendered()||(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=(0,i.getTrimmingContainer)(this.hider.parentNode.parentNode)}updateMainScrollableElement(){let{wtTable:e}=this.wot,{rootWindow:t}=this.domBindings;"hidden"===t.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=(0,i.getScrollableElement)(e.TABLE)}getRelativeCellPosition(e,t,r){if(!1===this.clone.wtTable.holder.contains(e)){(0,I.ZK)(`The provided element is not a child of the ${this.type} overlay`);return}let i=this.mainTableScrollableElement===this.domBindings.rootWindow,n=r<this.wtSettings.getSetting("fixedColumnsStart"),o=t<this.wtSettings.getSetting("fixedRowsTop"),s=t>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),a=this.clone.wtTable.spreader,l={start:this.getRelativeStartPosition(a),top:a.offsetTop},h={start:this.getRelativeStartPosition(e),top:e.offsetTop};return i?this.getRelativeCellPositionWithinWindow(o,n,h,l):this.getRelativeCellPositionWithinHolder(o,s,n,h,l)}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,t,r,n){let o=this.wot.wtTable.wtRootElement.getBoundingClientRect(),s=0,a=0;if(t){let e=o.left;this.isRtl()&&(e=this.domBindings.rootWindow.innerWidth-(o.left+o.width+(0,i.getScrollbarWidth)())),s=e<=0?-1*e:0}else s=n.start;return a=e?this.clone.wtTable.TABLE.getBoundingClientRect().top-o.top:n.top,{start:r.start+s,top:r.top+a}}getRelativeCellPositionWithinHolder(e,t,r,i,n){let o={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()},s=0,a=0;if(r||(s=o.horizontal-n.start),t){let e=this.wot.wtTable.wtRootElement.getBoundingClientRect();a=-1*this.clone.wtTable.TABLE.getBoundingClientRect().top+e.top}else e||(a=o.vertical-n.top);return{start:i.start-s,top:i.top-a}}makeClone(){if(-1===ef.indexOf(this.type))throw Error(`Clone type "${this.type}" is not supported.`);let{wtTable:e,wtSettings:t}=this.wot,{rootDocument:r,rootWindow:n}=this.domBindings,o=r.createElement("div"),s=r.createElement("table"),a=e.wtRootElement.parentNode;o.className=`${em.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,t.getSetting("ariaTags")&&(0,i.setAttribute)(o,[(0,z.Rn)()]),s.className=e.TABLE.className,e.TABLE.getAttribute("role")&&s.setAttribute("role",e.TABLE.getAttribute("role")),o.appendChild(s),a.appendChild(o);let l=this.wtSettings.getSetting("preventOverflow");return!0===l||"horizontal"===l&&"top"===this.type||"vertical"===l&&this.type===ed?this.mainTableScrollableElement=n:"hidden"===n.getComputedStyle(a).getPropertyValue("overflow")?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=(0,i.getScrollableElement)(e.TABLE),new ek(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager})}refresh(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.needFullRender){let t=this.clone.cloneSource;t.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),t.activeOverlayName="master"}}reset(){let e=this.clone.wtTable.holder,t=this.clone.wtTable.hider;
134[e.style,t.style,e.parentNode.style].forEach(e=>{e.width="",e.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}let eH=e=>{let t=e.wtSettings.getSetting("stylesHandler");if(t.isClassicTheme())return Object.freeze({width:6,height:6,borderWidth:1,borderStyle:"solid",borderColor:"#FFF"});let r=t.getCSSVariableValue("cell-autofill-size");return Object.freeze({width:r,height:r,borderWidth:t.getCSSVariableValue("cell-autofill-border-width"),borderStyle:"solid",borderColor:t.getCSSVariableValue("cell-autofill-border-color")})};class eB extends eD{constructor(e,t,r,i){var n,o;super(e,t,"top",r,i),(n="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(n="cachedFixedRowsTop","string"))?o:o+"")in this?Object.defineProperty(this,n,{value:-1,enumerable:!0,configurable:!0,writable:!0}):this[n]=-1,this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new eR(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;let e=this.clone.wtTable.holder.parentNode,{rootWindow:t}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow"),n=0,o=!1;if(this.trimmingContainer!==t||r&&"vertical"===r)n=this.getScrollPosition(),(0,i.resetCssTransform)(e);else{let{wtTable:t}=this.wot;o=Math.ceil(t.hider.getBoundingClientRect().bottom)===e.offsetHeight,n=this.getOverlayOffset(),(0,i.setOverlayPosition)(e,"0px",`${n}px`)}let s=this.adjustHeaderBordersPosition(n,o);return this.adjustElementsSize(),s}setScrollPosition(e){let{rootWindow:t}=this.domBindings,r=this.mainTableScrollableElement,n=!1;if(r===t&&e!==t.scrollY){let r=t.scrollY;t.scrollTo((0,i.getWindowScrollLeft)(t),e),n=r!==t.scrollY}else if(e!==r.scrollTop){let t=r.scrollTop;r.scrollTop=e,n=t!==r.scrollTop}return n}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,t){let r=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight(),i=e,n=0;for(;i<t;){let e=this.wot.wtTable.getRowHeight(i);n+=void 0===e?r:e,i+=1}return n}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){let{wtTable:e,wtViewport:t}=this.wot,{rootDocument:r,rootWindow:n}=this.domBindings,o=this.clone.wtTable.holder.parentNode.style,s=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||"horizontal"===s){let n=t.getWorkspaceWidth();t.hasVerticalScroll()&&(n-=(0,i.getScrollbarWidth)(r)),n=Math.min(n,e.wtRootElement.scrollWidth),o.width=`${n}px`}else o.width="";this.clone.wtTable.holder.style.width=o.width;let a=(0,i.outerHeight)(this.clone.wtTable.TABLE);e.hasDefinedSize()||(a=0),o.height=`${a}px`}adjustRootChildrenSize(){let{holder:e}=this.clone.wtTable,t=eH(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(t.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)+r}px`}applyToDOM(){let e=this.wtSettings.getSetting("totalRows");if("number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(0===e)this.spreader.style.top="0";else throw Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){let e=this.isRtl()?"right":"left",{spreader:t}=this.clone.wtTable;"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?t.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:t.style[e]=""}scrollTo(e,t){let{wot:r,wtSettings:n}=this,o=(r.cloneSource?r.cloneSource:r).wtTable.holder,s=n.getSetting("columnHeaders"),a=0===n.getSetting("fixedRowsTop")&&s.length>0&&!(0,i.hasClass)(o.parentNode,"innerBorderTop")?1:0,l=this.getTableParentOffset(),h=0;if(t&&this.wot.wtTable.getRowHeight(e)>
134this.wot.wtViewport.getViewportHeight()&&(t=!1),t&&o.offsetHeight!==o.clientHeight&&(h=(0,i.getScrollbarWidth)(this.domBindings.rootDocument)),t){let t=n.getSetting("fixedRowsBottom"),i=n.getSetting("totalRows");l+=this.sumCellSizes(0,e+1),l-=r.wtViewport.getViewportHeight()-this.sumCellSizes(i-t,i),l+=1+a}else l+=this.sumCellSizes(n.getSetting("fixedRowsTop"),e);return l+=h,(0,i.getMaximumScrollTop)(this.mainTableScrollableElement)===l-a&&a>0&&this.wot.wtOverlays.expandHiderVerticallyBy(a),this.setScrollPosition(l)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return(0,i.getScrollTop)(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){let{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow"),r=0;if(this.trimmingContainer===e&&(!t||"vertical"!==t)){let e=this.wot.wtTable.getTotalHeight(),t=this.clone.wtTable.getTotalHeight();(r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0))>e-t&&(r=0)}return r}adjustHeaderBordersPosition(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{wtSettings:r}=this,n=this.wot.wtTable.holder.parentNode,o=r.getSetting("totalColumns"),s="horizontal"===r.getSetting("preventOverflow");o?(0,i.removeClass)(n,"emptyColumns"):(0,i.addClass)(n,"emptyColumns");let a=!1;if(!t&&!s){let t=r.getSetting("fixedRowsTop"),o=this.cachedFixedRowsTop!==t,s=r.getSetting("columnHeaders");if((o||0===t)&&s.length>0){let t=(0,i.hasClass)(n,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||0===r.getSetting("totalRows")?((0,i.addClass)(n,"innerBorderTop"),a=!t):((0,i.removeClass)(n,"innerBorderTop"),a=t)}}return a}}let eF={getFirstRenderedRow(){let e=this.getRenderedRowsCount();return 0===e?-1:this.wtSettings.getSetting("totalRows")-e},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return 0===this.getRenderedRowsCount()?-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:()=>0};(0,eE.defineGetter)(eF,"MIXIN_NAME","stickyRowsBottom",{writable:!1,enumerable:!1});
134class eV extends ew{constructor(e,t,r,i){super(e,t,r,i,ec)}}(0,eE.mixin)(eV,eF),(0,eE.mixin)(eV,eC);class eU extends eD{constructor(e,t,r,i){var n,o;super(e,t,ec,r,i),(n="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(n="cachedFixedRowsBottom","string"))?o:o+"")in this?Object.defineProperty(this,n,{value:-1,enumerable:!0,configurable:!0,writable:!0}):this[n]=-1,this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new eV(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;let{rootWindow:e}=this.domBindings,t=this.clone.wtTable.holder.parentNode;t.style.top="";let r=0,i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer!==e||i&&"vertical"===i?(r=this.getScrollPosition(),this.repositionOverlay()):(r=this.getOverlayOffset(),t.style.bottom=`${r}px`);let n=this.adjustHeaderBordersPosition(r);return this.adjustElementsSize(),n}repositionOverlay(){let{wtTable:e,wtViewport:t}=this.wot,{rootDocument:r}=this.domBindings,n=this.clone.wtTable.holder.parentNode,o=0;t.hasVerticalScroll()||(o+=t.getWorkspaceHeight()-e.getTotalHeight()),t.hasVerticalScroll()&&t.hasHorizontalScroll()&&(o+=(0,i.getScrollbarWidth)(r)),n.style.bottom=`${o}px`}setScrollPosition(e){let{rootWindow:t}=this.domBindings,r=this.mainTableScrollableElement,n=!1;if(r===t&&e!==t.scrollY){let e=t.scrollY;t.scrollTo((0,i.getWindowScrollLeft)(t),top),n=e!==t.scrollY}else if(e!==r.scrollTop){let t=r.scrollTop;r.scrollTop=e,n=t!==r.scrollTop}return n}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,t){let{wtTable:r,wtSettings:i}=this.wot,n=i.getSetting("stylesHandler").getDefaultRowHeight(),o=e,s=0;for(;o<t;){let e=r.getRowHeight(o);s+=void 0===e?n:e,o+=1}return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){let{wtTable:e,wtViewport:t}=this.wot,{rootDocument:r,rootWindow:n}=this.domBindings,o=this.clone.wtTable.holder.parentNode.style,s=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||"horizontal"===s){let n=t.getWorkspaceWidth();t.hasVerticalScroll()&&(n-=(0,i.getScrollbarWidth)(r)),n=Math.min(n,e.wtRootElement.scrollWidth),o.width=`${n}px`}else o.width="";this.clone.wtTable.holder.style.width=o.width;let a=(0,i.outerHeight)(this.clone.wtTable.TABLE);e.hasDefinedSize()||(a=0),o.height=`${a}px`}adjustRootChildrenSize(){let{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(){let e=this.wtSettings.getSetting("totalRows");if("number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(0===e)this.spreader.style.top="0";else throw Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){let e=this.isRtl()?"right":"left",{spreader:t}=this.clone.wtTable;"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?t.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:t.style[e]=""}scrollTo(e,t){let r=this.getTableParentOffset(),n=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,o=0;t&&n.offsetHeight!==n.clientHeight&&(o=(0,i.getScrollbarWidth)(this.domBindings.rootDocument)),t?(r+=this.sumCellSizes(0,e+1),r-=this.wot.wtViewport.getViewportHeight(),r+=1):r+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),r+=o,this.setScrollPosition(r)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return(0,i.getScrollTop)(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){let{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow"),r=0;if(this.trimmingContainer===e&&(!t||"vertical"!==t)){let e=this.wot.wtTable.getTotalHeight(),t=this.clone.wtTable.getTotalHeight(),i=this.domBindings.rootDocument.documentElement.clientHeight;(r=Math.max(this.getTableParentOffset()-this.getScrollPosition()-i+e,0))>e-t&&(r=0)}return r}adjustHeaderBordersPosition(e){let t=this.wtSettings.getSetting("fixedRowsBottom"),r=this.cachedFixedRowsBottom!==t,n=this.wtSettings.getSetting("columnHeaders"),o=!1;if((r||0===t)&&n.length>0){let t=this.wot.wtTable.holder.parentNode,r=(0,i.hasClass)(t,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||0===this.wtSettings.getSetting("totalRows")?((0,i.addClass)(t,"innerBorderBottom"),o=!r):((0,i.removeClass)(t,"innerBorderBottom"),o=r)}return o}}
134let eW={getFirstRenderedRow(){let e=this.dataAccessObject.startRowRendered;return null===e?-1:e},getFirstVisibleRow(){let e=this.dataAccessObject.startRowVisible;return null===e?-1:e},getFirstPartiallyVisibleRow(){let e=this.dataAccessObject.startRowPartiallyVisible;return null===e?-1:e},getLastRenderedRow(){let e=this.dataAccessObject.endRowRendered;return null===e?-1:e},getLastVisibleRow(){let e=this.dataAccessObject.endRowVisible;return null===e?-1:e},getLastPartiallyVisibleRow(){let e=this.dataAccessObject.endRowPartiallyVisible;return null===e?-1:e},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};(0,eE.defineGetter)(eW,"MIXIN_NAME","calculatedRows",{writable:!1,enumerable:!1});let ej={getFirstRenderedColumn(){return 0===this.getRenderedColumnsCount()?-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}};(0,eE.defineGetter)(ej,"MIXIN_NAME","stickyColumnsStart",{writable:!1,enumerable:!1});
134class eG extends ew{constructor(e,t,r,i){super(e,t,r,i,ed)}}(0,eE.mixin)(eG,eW),(0,eE.mixin)(eG,ej);class e$ extends eD{constructor(e,t,r,i){super(e,t,ed,r,i)}createTable(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new eG(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){let{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;let{rootWindow:t}=this.domBindings,r=this.clone.wtTable.holder.parentNode,n=this.wtSettings.getSetting("preventOverflow"),o=0;this.trimmingContainer!==t||n&&"horizontal"===n?(o=this.getScrollPosition(),(0,i.resetCssTransform)(r)):(o=this.getOverlayOffset()*(this.isRtl()?-1:1),(0,i.setOverlayPosition)(r,`${o}px`,"0px"));let s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){let{rootWindow:t}=this.domBindings,r=!1;this.isRtl()&&(e=-e);let n=this.mainTableScrollableElement;if(n===t&&e!==t.scrollX){let n=t.scrollX;t.scrollTo(e,(0,i.getWindowScrollTop)(t)),r=n!==t.scrollX}else if(e!==n.scrollLeft){let t=n.scrollLeft;n.scrollLeft=e,r=t!==n.scrollLeft}return r}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,t){let r=this.wtSettings.getSetting("defaultColumnWidth"),i=e,n=0;for(;i<t;)n+=this.wot.wtTable.getColumnWidth(i)||r,i+=1;return n}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){let{wtTable:e,wtViewport:t}=this.wot,{rootDocument:r,rootWindow:n}=this.domBindings,o=this.clone.wtTable.holder.parentNode.style,s=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||"vertical"===s){let n=t.getWorkspaceHeight();t.hasHorizontalScroll()&&(n-=(0,i.getScrollbarWidth)(r)),n=Math.min(n,e.wtRootElement.scrollHeight),o.height=`${n}px`}else o.height="";this.clone.wtTable.holder.style.height=o.height;let a=(0,i.outerWidth)(this.clone.wtTable.TABLE);o.width=`${a}px`}adjustRootChildrenSize(){let{holder:e}=this.clone.wtTable,t=eH(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(t.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)+r}px`}applyToDOM(){let e=this.wtSettings.getSetting("totalColumns"),t=this.isRtl()?"right":"left";if("number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style[t]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(0===e)this.spreader.style[t]="0";else throw Error("Incorrect value of the columnsRenderCalculator");this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:this.clone.wtTable.spreader.style.top=""}scrollTo(e,t){let{wtSettings:r}=this,n=r.getSetting("rowHeaders"),o=r.getSetting("fixedColumnsStart"),s=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,a=0===o&&n.length>0&&!(0,i.hasClass)(s.parentNode,"innerBorderInlineStart")?1:0,l=this.getTableParentOffset(),h=0;return t&&this.wot.wtTable.getColumnWidth(e)>this.wot.wtViewport.getViewportWidth()&&(t=!1),t&&s.offsetWidth!==s.clientWidth&&(h=(0,i.getScrollbarWidth)(this.domBindings.rootDocument)),t?(l+=this.sumCellSizes(0,e+1),l-=this.wot.wtViewport.getViewportWidth(),l+=a):l+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),l+=h,(0,i.getMaximumScrollLeft)(this.mainTableScrollableElement)===l-a&&a>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(a),this.setScrollPosition(l)}getTableParentOffset(){let e=this.wtSettings.getSetting("preventOverflow"),t=0;return e||this.trimmingContainer!==this.domBindings.rootWindow||(t=this.wot.wtTable.holderOffset.left),t}getScrollPosition(){return Math.abs((0,i.getScrollLeft)(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){let{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow"),r=0;return this.trimmingContainer===e&&(!t||"horizontal"!==t)&&(r=this.isRtl()?Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),r>this.wot.wtTable.getTotalWidth()-this.clone.wtTable.getTotalWidth()&&(r=0)),r}adjustHeaderBordersPosition(e){let{wtSettings:t}=this,r=this.wot.wtTable.holder.parentNode,n=t.getSetting("rowHeaders"),o=t.getSetting("fixedColumnsStart"),s=t.getSetting("totalRows"),a="vertical"===t.getSetting("preventOverflow");s?(0,i.removeClass)(r,"emptyRows"):(0,i.addClass)(r,"emptyRows");let l=!1;if(!a){if(o&&!n.length)(0,i.addClass)(r,"innerBorderLeft innerBorderInlineStart");else if(!o&&n.length){let t=(0,i.hasClass)(r,"innerBorderInlineStart");e?((0,i.addClass)(r,"innerBorderLeft innerBorderInlineStart"),l=!t):((0,i.removeClass)(r,"innerBorderLeft innerBorderInlineStart"),l=t)}}return l}}
134class ez extends ew{constructor(e,t,r,i){super(e,t,r,i,eg)}}function eY(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,eE.mixin)(ez,eS),(0,eE.mixin)(ez,ej);class eK extends eD{constructor(e,t,r,i,n,o){super(e,t,eg,r,i),eY(this,"topOverlay",void 0),eY(this,"inlineStartOverlay",void 0),this.topOverlay=n,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new ez(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;let e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){let t=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),r=this.topOverlay.getOverlayOffset();(0,i.setOverlayPosition)(e,`${t}px`,`${r}px`)}else(0,i.resetCssTransform)(e);let t=(0,i.outerHeight)(this.clone.wtTable.TABLE),r=(0,i.outerWidth)(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(t=0),e.style.height=`${t}px`,e.style.width=`${r}px`,!1}}
134class eX extends ew{constructor(e,t,r,i){super(e,t,r,i,ep)}}(0,eE.mixin)(eX,eF),(0,eE.mixin)(eX,ej);class eq extends eD{constructor(e,t,r,i,n,o){super(e,t,ep,r,i),this.bottomOverlay=n,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return new eX(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){let{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;let t=this.clone.wtTable.holder.parentNode;if(t.style.top="",this.trimmingContainer===this.domBindings.rootWindow){let e=this.inlineStartOverlay.getOverlayOffset(),r=this.bottomOverlay.getOverlayOffset();t.style[this.isRtl()?"right":"left"]=`${e}px`,t.style.bottom=`${r}px`}else(0,i.resetCssTransform)(t),this.repositionOverlay();let r=(0,i.outerHeight)(this.clone.wtTable.TABLE),n=(0,i.outerWidth)(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),t.style.height=`${r}px`,t.style.width=`${n}px`,!1}repositionOverlay(){let{wtTable:e,wtViewport:t}=this.wot,{rootDocument:r}=this.domBindings,n=this.clone.wtTable.holder.parentNode,o=0;t.hasVerticalScroll()||(o+=t.getWorkspaceHeight()-e.getTotalHeight()),t.hasVerticalScroll()&&t.hasHorizontalScroll()&&(o+=(0,i.getScrollbarWidth)(r)),n.style.bottom=`${o}px`}}function eZ(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function eQ(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eJ(e,t,r){return e.set(e1(e,t),r),r}function e0(e,t){return e.get(e1(e,t))}function e1(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var e2=new WeakMap,e5=new WeakMap,e3=new WeakMap,e9=new WeakMap;class e4{constructor(e,t,r,n,o,s){eQ(this,"wot",null),eZ(this,e2,[]),eQ(this,"topOverlay",null),eQ(this,"bottomOverlay",null),eQ(this,"inlineStartOverlay",null),eQ(this,"topInlineStartCornerOverlay",null),eQ(this,"bottomInlineStartCornerOverlay",null),eQ(this,"browserLineHeight",void 0),eQ(this,"wtSettings",null),eZ(this,e5,!1),eZ(this,e3,0),eZ(this,e9,null),eQ(this,"resizeObserver",new ResizeObserver(e=>{(0,a.requestAnimationFrame)(()=>{Array.isArray(e)&&e.length&&(eJ(e3,this,e0(e3,this)+1),300===e0(e3,this)&&((0,I.ZK)("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()),null!==e0(e9,this)&&clearTimeout(e0(e9,this)),eJ(e9,this,setTimeout(()=>{eJ(e3,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=n,this.domBindings=r,this.facadeGetter=t,this.wtTable=s;let{rootDocument:l,rootWindow:h}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=(0,i.getScrollbarWidth)(l);let u="hidden"===h.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow");this.scrollableElement=u?s.holder:(0,i.getScrollableElement)(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=h.scrollX,this.lastScrollY=h.scrollY}getOverlays(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[...e0(e2,this)];return e&&t.push(this.wtTable),t}initBrowserLineHeight(){let{rootWindow:e,rootDocument:t}=this.domBindings,r=e.getComputedStyle(t.body),i=parseInt(r.lineHeight,10),n=1.2*parseInt(r.fontSize,10);this.browserLineHeight=i||n}initOverlays(){let e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new eB(...e),this.bottomOverlay=new eU(...e),this.inlineStartOverlay=new e$(...e),this.topInlineStartCornerOverlay=new eK(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new eq(...e,this.bottomOverlay,this.inlineStartOverlay),eJ(e2,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){eJ(e5,this,e0(e2,this).reduce((e,t)=>
134t.hasRenderingStateChanged()||e,!1)),e0(e2,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),e0(e2,this).forEach(e=>{let t=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),t&&!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(){let e;let{rootDocument:t,rootWindow:r}=this.domBindings,{mainTableScrollableElement:i}=this.topOverlay,{mainTableScrollableElement:n}=this.inlineStartOverlay;this.eventManager.addEventListener(t.documentElement,"keydown",e=>this.onKeyDown(e)),this.eventManager.addEventListener(t.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(t,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(i,"scroll",e=>this.onTableScroll(e),{passive:!0}),i!==n&&this.eventManager.addEventListener(n,"scroll",e=>this.onTableScroll(e),{passive:!0});let o=r.devicePixelRatio&&r.devicePixelRatio>1,s=this.scrollableElement===r,h=this.wtSettings.getSetting("preventWheel"),u={passive:s};(h||o||!(0,l.isChrome)())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",e=>this.onCloneWheel(e,h),u),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(e=>{this.eventManager.addEventListener(e.clone.wtTable.holder,"wheel",e=>this.onCloneWheel(e,h),u)}),this.eventManager.addEventListener(r,"resize",()=>{(0,a.requestAnimationFrame)(()=>{clearTimeout(e),this.wtSettings.getSetting("onWindowResize"),e=setTimeout(()=>{eJ(e3,this,0)},200)})}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){let t=this.domBindings.rootWindow,r=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,n=e.target;(!this.keyPressed||(i===t||n===t||e.target.contains(i))&&(r===t||n===t||e.target.contains(r)))&&this.syncScrollPositions(e)}onCloneWheel(e,t){if(e.ctrlKey)return;let{rootWindow:r}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,n=this.topOverlay.mainTableScrollableElement,o=e.target,s=n!==r&&o!==r&&!o.contains(n),a=i!==r&&o!==r&&!o.contains(i);if(this.keyPressed&&(s||a)||this.scrollableElement===r)return;let l=this.translateMouseWheelToScroll(e);(t||this.scrollableElement!==r&&l)&&e.preventDefault()}onKeyDown(e){this.keyPressed=(0,A.isKey)(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let t=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,r=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;1===e.deltaMode&&(r+=r*this.browserLineHeight,t+=t*this.browserLineHeight);let i=this.scrollVertically(t),n=this.scrollHorizontally(r);return i||n}scrollVertically(e){let t=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,t!==this.scrollableElement.scrollTop}scrollHorizontally(e){let t=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,t!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;let e=this.topOverlay.clone.wtTable.holder,t=this.inlineStartOverlay.clone.wtTable.holder,r=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(r=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==r,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=r,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=r;let t=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;t&&(t.scrollLeft=r)}this.verticalScrolling&&(t.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!e0(e5,this))return;let{scrollLeft:e,scrollTop:t}=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=e),this.inlineStartOverlay.needFullRender&&(this.inl
134ineStartOverlay.clone.wtTable.holder.scrollTop=t),eJ(e5,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();let{wtTable:e}=this,{rootWindow:t}=this.domBindings;"hidden"===t.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")?this.scrollableElement=e.holder:this.scrollableElement=(0,i.getScrollableElement)(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&&void 0!==arguments[0]&&arguments[0];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(){let e=this.wtTable.spreader,t=e.clientWidth,r=e.clientHeight,i=t!==this.spreaderLastSize.width||r!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=t,this.spreaderLastSize.height=r),i}adjustElementsSize(){let{wtViewport:e}=this.wot,{wtTable:t}=this,{rootWindow:r}=this.domBindings,i=this.scrollableElement===r,n=this.wtSettings.getSetting("totalColumns"),o=this.wtSettings.getSetting("totalRows"),s=e.getRowHeaderWidth(),a=e.getColumnHeaderHeight(),l=this.wtSettings.getSetting("externalRowCalculator")?0:1,h=a+this.topOverlay.sumCellSizes(0,o)+l,u=s+this.inlineStartOverlay.sumCellSizes(0,n),c=t.hider.style,d=!i&&this.scrollableElement.scrollTop>Math.max(0,h-t.holder.clientHeight)?1:0,g=!i&&this.scrollableElement.scrollLeft>Math.max(0,u-t.holder.clientWidth)?1:0;c.width=`${u+g}px`,c.height=`${h+d}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){let{wtTable:t}=this;t.hider.style.height=`${parseInt(t.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){let{wtTable:t}=this;t.hider.style.width=`${parseInt(t.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;let t=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay],r=null;return(0,N.arrayEach)(t,t=>{t&&t.clone&&t.clone.wtTable.TABLE.contains(e)&&(r=t.clone)}),r}syncOverlayTableClassNames(){let e=this.wtTable.TABLE,t=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];(0,N.arrayEach)(t,t=>{t&&(t.clone.wtTable.TABLE.className=e.className)})}}function e7(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class e8{constructor(e){e7(this,"settings",{}),e7(this,"defaults",Object.freeze(this.getDefaults())),(0,eE.objectEach)(this.defaults,(t,r)=>{if(void 0!==e[r])this.settings[r]=e[r];else if(void 0===t)throw Error(`A required setting "${r}" was not provided`);else this.settings[r]=t})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow:()=>!1,preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>
1340||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders:()=>[],columnHeaders:()=>[],totalRows:void 0,totalColumns:void 0,cellRenderer:(e,t,r)=>{let n=this.getSetting("data",e,t);(0,i.fastInnerText)(r,null==n?"":n)},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,stylesHandler:null}}update(e,t){return void 0===t?(0,eE.objectEach)(e,(e,t)=>{this.settings[t]=e}):this.settings[e]=t,this}getSetting(e,t,r,i,n){return"function"==typeof this.settings[e]?this.settings[e](t,r,i,n):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}
134class e6 extends ew{constructor(e,t,r,i){super(e,t,r,i,"master")}alignOverlaysWithTrimmingContainer(){let e=(0,i.getTrimmingContainer)(this.wtRootElement),{rootWindow:t}=this.domBindings;if(e===t)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{let r=e.parentElement,n=(0,i.getStyle)(e,"height",t),o=(0,i.getStyle)(e,"overflow",t),s=this.holder.style,{scrollWidth:a,scrollHeight:l}=e,h=e.offsetWidth,u=e.offsetHeight;if(r&&["auto","hidden","scroll"].includes(o)){let i=e.cloneNode(!1);i.style.overflow="auto",i.style.position="absolute",e.nextElementSibling?r.insertBefore(i,e.nextElementSibling):r.appendChild(i);let n=parseInt(t.getComputedStyle(i).height,10);r.removeChild(i),0===n&&(u=0)}u=Math.min(u,l),s.height="auto"===n?"auto":`${u}px`,h=Math.min(h,a),s.width=`${h}px`,s.overflow="",this.hasTableHeight="auto"===s.height||u>0,this.hasTableWidth=h>0}this.isTableVisible=(0,i.isVisible)(this.TABLE)}markOversizedColumnHeaders(){let{wtSettings:e}=this,{wtViewport:t}=this.dataAccessObject,r="master",i=e.getSetting("columnHeaders").length;if(i&&!t.hasOversizedColumnHeadersMarked[r]){let n=e.getSetting("rowHeaders").length,o=this.getRenderedColumnsCount();for(let e=0;e<i;e++)for(let e=-1*n;e<o;e++)this.markIfOversizedColumnHeader(e);t.hasOversizedColumnHeadersMarked[r]=!0}}}function te(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,eE.mixin)(e6,eW),(0,eE.mixin)(e6,eC),r(17901);class tt{constructor(){te(this,"count",0),te(this,"startRow",0),te(this,"endRow",0),te(this,"startPosition",0),te(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:t}=e;this.count=t,this.endRow=this.count-1}process(){}finalize(){}}function tr(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r(24029),r(46228);class ti{constructor(){tr(this,"count",0),tr(this,"startRow",null),tr(this,"endRow",null),tr(this,"startPosition",null),tr(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,t){let{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:n}=t;r<=i&&(this.startRow=e),r>=i&&r<=n&&null===this.startRow&&(this.startRow=e),this.endRow=e}finalize(e){var t;let{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:n,totalRows:o,needReverse:s,startPositions:a,rowHeight:l}=e;if(this.endRow===o-1&&s)for(this.startRow=this.endRow;this.startRow>0;){let e=a[this.endRow]+l-a[this.startRow-1];if(this.startRow-=1,e>=i-n)break}this.startPosition=null!==(t=a[this.startRow])&&void 0!==t?t:null,r+i-n<0||r>a.at(-1)+l?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,o<this.endRow&&(this.endRow=o-1),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}}function tn(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class to extends ti{constructor(){super(...arguments),tn(this,"rowStartOffset",0),tn(this,"rowEndOffset",0)}finalize(e){var t;super.finalize(e);let{overrideFn:r,totalRows:i,startPositions:n}=e;if(null!==this.startRow&&"function"==typeof r){let e=this.startRow,t=this.endRow;r(this),this.rowStartOffset=e-this.startRow,this.rowEndOffset=this.endRow-t}this.startRow<0&&(this.startRow=0),this.startPosition=null!==(t=n[this.startRow])&&void 0!==t?t:null,i<this.endRow&&(this.endRow=i-1),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}}function ts(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ta{constructor(){ts(this,"count",0),ts(this,"startRow",null),ts(this,"endRow",null),ts(this,"startPosition",null),ts(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,t){let{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHe
134ight:n,rowHeight:o}=t;r>=i&&r+o<=n&&(null===this.startRow&&(this.startRow=e),this.endRow=e)}finalize(e){var t;let{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:n,totalRows:o,needReverse:s,startPositions:a,rowHeight:l}=e;if(this.endRow===o-1&&s)for(this.startRow=this.endRow;this.startRow>0;){let e=a[this.endRow]+l-a[this.startRow-1];if(e<=i-n&&(this.startRow-=1),e>=i-n)break}this.startPosition=null!==(t=a[this.startRow])&&void 0!==t?t:null,r+i-n<(null===this.startRow?0:e.getRowHeight(this.startRow))||r>a.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,o<this.endRow&&(this.endRow=o-1),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}}function tl(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class th{constructor(){tl(this,"count",0),tl(this,"startColumn",0),tl(this,"endColumn",0),tl(this,"startPosition",0),tl(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:t}=e;this.count=t,this.endColumn=this.count-1}process(){}finalize(){}}function tu(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class tc{constructor(){tu(this,"count",0),tu(this,"startColumn",null),tu(this,"endColumn",null),tu(this,"startPosition",null),tu(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,t){let{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:n}=t;r<=i&&(this.startColumn=e),r>=i&&r<=i+(i>0?n+1:n)&&(null===this.startColumn||void 0===this.startColumn)&&(this.startColumn=e),this.endColumn=e}finalize(e){var t;let{scrollOffset:r,viewportWidth:i,inlineStartOffset:n,zeroBasedScrollOffset:o,totalColumns:s,needReverse:a,startPositions:l,columnWidth:h}=e;if(this.endColumn===s-1&&a)for(this.startColumn=this.endColumn;this.startColumn>0;){let e=l[this.endColumn]+h-l[this.startColumn-1];if(this.startColumn-=1,e>i)break}this.startPosition=null!==(t=l[this.startColumn])&&void 0!==t?t:null,r+i-(o>0?i+1:i)<-1*n||r>l.at(-1)+h||-1*r-i>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endColumn&&(this.endColumn=s-1),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)}}function td(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class tg extends tc{constructor(){super(...arguments),td(this,"columnStartOffset",0),td(this,"columnEndOffset",0)}finalize(e){var t;super.finalize(e);let{overrideFn:r,totalColumns:i,startPositions:n}=e;if(null!==this.startColumn&&"function"==typeof r){let e=this.startColumn,t=this.endColumn;r(this),this.columnStartOffset=e-this.startColumn,this.columnEndOffset=this.endColumn-t}this.startColumn<0&&(this.startColumn=0),this.startPosition=null!==(t=n[this.startColumn])&&void 0!==t?t:null,i<this.endColumn&&(this.endColumn=i-1),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)}}function tp(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class tf{constructor(){tp(this,"count",0),tp(this,"startColumn",null),tp(this,"endColumn",null),tp(this,"startPosition",null),tp(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,t){let{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:n,columnWidth:o}=t;r>=i&&r+o<=i+(i>0?n+1:n)&&((null===this.startColumn||void 0===this.startColumn)&&(this.startColumn=e),this.endColumn=e)}finalize(e){var t;let{scrollOffset:r,viewportWidth:i,inlineStartOffset:n,zeroBasedScrollOffset:o,totalColumns:s,needReverse:a,startPositions:l,columnWidth:h}=e;if(this.endColumn===s-1&&a)for(this.startColumn=this.endColumn;this.startColumn>0;){let e=l[this.endColumn]+h-l[this.startColumn-1];if(e<=i&&(this.startColumn-=1),e>=i)break}this.startPosition=null!==(t=l[this.startColumn])&&void 0!==t?t:null;let u=null===this.startColumn?0:e.getColumnWidth(this.startColumn);r+i-(o>0?i+1:i)<-1*n||r>l.at(-1)||-1*r-i>-1*u?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endColumn&&(this.endColumn=s-1),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)}}var tm=r(82982);function ty(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class tv extends tm.f{constructor(e){let{calculationTypes:t,viewportHe
134ight:r,scrollOffset:i,totalRows:n,defaultRowHeight:o,rowHeightFn:s,overrideFn:a,horizontalScrollbarHeight:l}=e;super(t),ty(this,"viewportHeight",0),ty(this,"scrollOffset",0),ty(this,"zeroBasedScrollOffset",0),ty(this,"totalRows",0),ty(this,"rowHeightFn",null),ty(this,"rowHeight",0),ty(this,"overrideFn",null),ty(this,"horizontalScrollbarHeight",0),ty(this,"innerViewportHeight",0),ty(this,"totalCalculatedHeight",0),ty(this,"startPositions",[]),ty(this,"needReverse",!0),this.defaultHeight=o,this.viewportHeight=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalRows=n,this.rowHeightFn=s,this.overrideFn=a,this.horizontalScrollbarHeight=null!=l?l: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){let t=this.rowHeightFn(e);return isNaN(t)?this.defaultHeight:t}}var tw=r(91062);class tE{constructor(e,t,r,i,n){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=t,this.wtSettings=r,this.wtTable=n,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 tt:new to],["fullyVisible",()=>new ta],["partiallyVisible",()=>new ti]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new th:new tg],["fullyVisible",()=>new tf],["partiallyVisible",()=>new tc]]),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){let e=this.domBindings.rootDocument,t=this.dataAccessObject.topOverlayTrimmingContainer;return t===this.domBindings.rootWindow?e.documentElement.clientHeight:(0,i.outerHeight)(t)>0&&t.clientHeight>0?t.clientHeight:1/0}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;let t=this.getColumnHeaderHeight();return t>0&&(e-=t),e}getWorkspaceWidth(){let e;let{rootDocument:t,rootWindow:r}=this.domBindings,i=this.dataAccessObject.inlineStartOverlayTrimmingContainer;if(i===r){let r=this.wtSettings.getSetting("totalColumns");e=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,r)>e&&(e=t.documentElement.clientWidth)}else e=i.clientWidth;return e}getViewportWidth(){let e=this.getWorkspaceWidth();if(e===1/0)return e;let t=this.getRowHeaderWidth();return t>0?e-t:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){let e=this.domBindings.rootDocument.documentElement;return e.scrollHeight>e.clientHeight}let{holder:e,hider:t}=this.wtTable,r=e.clientHeight,i=t.offsetHeight;return r<i||i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){let e=this.domBindings.rootDocument.documentElement;return e.scrollWidth>e.clientWidth}let{hider:e}=this.wtTable,t=e.offsetWidth,r=this.hasVerticalScroll()?(0,i.getScrollbarWidth)():0;return t>this.getWorkspaceWidth()-r}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,t){let r=0,i=e;for(;i<t;)r+=this.wtTable.getColumnWidth(i),i+=1;return r}getWorkspaceOffset(){return(0,i.offset)(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=(0,i.outerHeight)(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){let e=this.wtSettings.getSetting("rowHeaderWidth"),t=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let r=0,i=t.length;r<i;r++)this.rowHeaderWidth+=e[r]||e}if(isNaN(this.rowHeaderWidth)){if(t.length){let e=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let r=0,n=t.length;r<n;r++)e?(this.rowHeaderWidth+=(0,i.outerWidth)(e),e=e.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0}return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["rendered","fullyVisible","partiallyVisible"],{wtSettings:n,wtTable:o}
134=this,s=this.getViewportHeight();this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset,l=n.getSetting("fixedRowsTop"),h=n.getSetting("fixedRowsBottom"),u=n.getSetting("totalRows");return l&&a>=0&&(a+=t=this.dataAccessObject.topOverlay.sumCellSizes(0,l),s-=t),h&&this.dataAccessObject.bottomOverlay.clone&&(s-=t=this.dataAccessObject.bottomOverlay.sumCellSizes(u-h,u)),e=o.holder.clientHeight===o.holder.offsetHeight?0:(0,i.getScrollbarWidth)(this.domBindings.rootDocument),new tv({calculationTypes:r.map(e=>[e,this.rowsCalculatorTypes.get(e)()]),viewportHeight:s,scrollOffset:a,totalRows:n.getSetting("totalRows"),defaultRowHeight:n.getSetting("stylesHandler").getDefaultRowHeight(),rowHeightFn:e=>o.getRowHeight(e),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:e})}createColumnsCalculator(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["rendered","fullyVisible","partiallyVisible"],{wtSettings:t,wtTable:r}=this,n=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;let s=t.getSetting("fixedColumnsStart");if(s&&o>=0){let e=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=e,n-=e}return r.holder.clientWidth!==r.holder.offsetWidth&&(n-=(0,i.getScrollbarWidth)(this.domBindings.rootDocument)),new tw.E({calculationTypes:e.map(e=>[e,this.columnsCalculatorTypes.get(e)()]),viewportWidth:n,scrollOffset:o,totalColumns:t.getSetting("totalColumns"),columnWidthFn:e=>r.getColumnWidth(e),overrideFn:t.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{wtSettings:t}=this,r=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!t.getSetting("renderAllRows")){let t=r.getResultsFor("fullyVisible"),i=r.getResultsFor("partiallyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(t,i)}if(e&&!t.getSetting("renderAllColumns")){let t=i.getResultsFor("fullyVisible"),r=i.getResultsFor("partiallyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(t,r)}return e||(this.rowsRenderCalculator=r.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=r.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){let e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),t=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=t.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=t.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e,t){if(!this.rowsVisibleCalculator)return!1;let{startRow:r,endRow:i}=e,{startRow:n,endRow:o}=t;if(null===r&&null===i){if(!e.isVisibleInTrimmingContainer&&!this.wtTable.isRowBeforeRenderedRows(n)&&!this.wtTable.isRowAfterRenderedRows(o))return!0;r=n,i=o}let{startRow:s,endRow:a,rowStartOffset:l,rowEndOffset:h}=this.rowsRenderCalculator,u=this.wtSettings.getSetting("totalRows")-1,c=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(c)&&c>0?(r=Math.max(0,r-Math.min(l,c)),i=Math.min(u,i+Math.min(h,c))):"auto"===c&&(r=Math.max(0,r-Math.ceil(l/2)),i=Math.min(u,i+Math.ceil(h/2))),!(r<s)&&(r!==s||!(r>0))&&!(i>a)&&(i!==a||!(i<u))}areAllProposedVisibleColumnsAlreadyRendered(e,t){if(!this.columnsVisibleCalculator)return!1;let{startColumn:r,endColumn:i}=e,{startColumn:n,endColumn:o}=t;if(null===r&&null===i){if(!e.isVisibleInTrimmingContainer&&!this.wtTable.isColumnBeforeRenderedColumns(n)&&!this.wtTable.isColumnAfterRenderedColumns(o))return!0;r=n,i=o}let{startColumn:s,endColumn:a,columnStartOffset:l,columnEndOffset:h}=this.columnsRenderCalculator,u=this.wtSettings.getSetting("totalColumns")-1,c=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(c)&&c>0?(r=Math.max(0,r-Math.min(l,c)),i=Math.min(u,i+Math.min(h,c))):"auto"===c&&(r=Math.max(0,r-Math.ceil(l/2)),i=Math.min(u,i+Math.ceil(h/2))),!(r<s)&&(r!==s||!(r>0))&&!(i>a)&&(i!==a||!(i<u))}resetHasOversizedColumnHeadersMarked(){(0,eE.objectEach)(this.hasOversizedColumnHeadersMarked,(e,t,r)=>{r[t]=void 0})}}function tS(e,t,r){tC(e,t),t.set(e,r)}function tC(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function tR(e,t){return e.get(tT(e,t))}function tb(e,t,r){return e.set(tT(e,t),r),r}function tT(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}r(19087),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975);
134var tN=new WeakMap,tA=new WeakMap,tI=new WeakSet;class tM{constructor(){tC(this,tI),tI.add(this),tS(this,tN,void 0),tS(this,tA,void 0)}setActiveOverlay(e){return tb(tA,this,e),this}setActiveSelection(e){return tb(tN,this,e),this}scan(){let e=tR(tN,this).settings.selectionType,t=new Set;return"active-header"===e?(this.scanColumnsInHeadersRange(e=>t.add(e)),this.scanRowsInHeadersRange(e=>t.add(e))):"area"===e?this.scanCellsRange(e=>t.add(e)):"focus"===e?(this.scanColumnsInHeadersRange(e=>t.add(e)),this.scanRowsInHeadersRange(e=>t.add(e)),this.scanCellsRange(e=>t.add(e))):"fill"===e?this.scanCellsRange(e=>t.add(e)):"header"===e?(this.scanColumnsInHeadersRange(e=>t.add(e)),this.scanRowsInHeadersRange(e=>t.add(e))):"row"===e?(this.scanRowsInHeadersRange(e=>t.add(e)),this.scanRowsInCellsRange(e=>t.add(e))):"column"===e&&(this.scanColumnsInHeadersRange(e=>t.add(e)),this.scanColumnsInCellsRange(e=>t.add(e))),t}scanColumnsInHeadersRange(e){let[t,r,i,n]=tR(tN,this).getCorners(),{wtTable:o}=tR(tA,this),s=o.getRenderedColumnsCount(),a=o.getColumnHeadersCount(),l=0;for(let h=-o.getRowHeadersCount();h<s;h++){let s=o.columnFilter.renderedToSource(h);if(!(s<r)&&!(s>n)){for(let h=-a;h<0;h++){if(h<t||h>i)continue;let u=h+a,c=o.getColumnHeader(s,u),d=tR(tA,this).getSetting("onBeforeHighlightingColumnHeader",s,u,{selectionType:tR(tN,this).settings.selectionType,columnCursor:l,selectionWidth:n-r+1});null!==d&&(d!==s&&(c=o.getColumnHeader(d,u)),e(c))}l+=1}}}scanRowsInHeadersRange(e){let[t,r,i,n]=tR(tN,this).getCorners(),{wtTable:o}=tR(tA,this),s=o.getRenderedRowsCount(),a=o.getRowHeadersCount(),l=0;for(let h=-o.getColumnHeadersCount();h<s;h++){let s=o.rowFilter.renderedToSource(h);if(!(s<t)&&!(s>i)){for(let h=-a;h<0;h++){if(h<r||h>n)continue;let u=h+a,c=o.getRowHeader(s,u),d=tR(tA,this).getSetting("onBeforeHighlightingRowHeader",s,u,{selectionType:tR(tN,this).settings.selectionType,rowCursor:l,selectionHeight:i-t+1});null!==d&&(d!==s&&(c=o.getRowHeader(d,u)),e(c))}l+=1}}}scanCellsRange(e){let{wtTable:t}=tR(tA,this);tT(tI,this,tO).call(this,(r,n)=>{let o=t.getCell(tR(tA,this).createCellCoords(r,n)),s=tR(tA,this).getSetting("onAfterDrawSelection",r,n,tR(tN,this).settings.layerLevel);"string"==typeof s&&(0,i.addClass)(o,s),e(o)})}scanRowsInCellsRange(e){let[t,,r]=tR(tN,this).getCorners(),{wtTable:i}=tR(tA,this);tT(tI,this,tx).call(this,(n,o)=>{n>=t&&n<=r&&e(i.getCell(tR(tA,this).createCellCoords(n,o)))})}scanColumnsInCellsRange(e){let[,t,,r]=tR(tN,this).getCorners(),{wtTable:i}=tR(tA,this);tT(tI,this,tx).call(this,(n,o)=>{o>=t&&o<=r&&e(i.getCell(tR(tA,this).createCellCoords(n,o)))})}}function tO(e){let[t,r,n,o]=tR(tN,this).getCorners();if(t<0&&n<0||r<0&&o<0)return;let{wtTable:s}=tR(tA,this),a=t!==n||r!==o;if(r=Math.max(r,0),o=Math.max(o,0),t=Math.max(t,0),n=Math.max(n,0),a){if(r=Math.max(r,s.getFirstRenderedColumn()),o=Math.min(o,s.getLastRenderedColumn()),t=Math.max(t,s.getFirstRenderedRow()),n=Math.min(n,s.getLastRenderedRow()),o<r||n<t)return}else{let e=s.getCell(tR(tA,this).createCellCoords(t,r));if(!(0,i.isHTMLElement)(e))return}for(let i=t;i<=n;i+=1)for(let t=r;t<=o;t+=1)e(i,t)}function tx(e){let{wtTable:t}=tR(tA,this),r=t.getRenderedRowsCount(),i=t.getRenderedColumnsCount();for(let n=0;n<r;n+=1){let r=t.rowFilter.renderedToSource(n);for(let n=0;n<i;n+=1)e(r,t.columnFilter.renderedToSource(n))}}let t_="ht-border-style-";class tP{constructor(e,t){if(!t)return;this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=t,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=eH(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners()}registerListeners(){let e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let e=0,t=this.main.childNodes.length;e<t;e++){let t=this.main.childNodes[e];this.eventManager.addEventListener(t,"mouseenter",t=>this.onMouseEnter(t,this.main.childNodes[e]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,t){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),(0,o.stopImmediatePropagation)(e);let r=this,i=this.wot.rootDocument.body,n=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(i,"mousemove",function e(o){(function(e){if(e.clientY
134<Math.floor(n.top)||e.clientY>Math.ceil(n.top+n.height)||e.clientX<Math.floor(n.left)||e.clientX>Math.ceil(n.left+n.width))return!0})(o)&&(r.eventManager.removeEventListener(i,"mousemove",e),t.style.display="block")})}createBorders(e){let{rootDocument:t}=this.wot;this.main=t.createElement("div");let r=["top","start","bottom","end","corner"],i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let n=0;n<5;n++){let o=r[n],s=t.createElement("div"),a=t=>this.settings[o]&&this.settings[o][t]?this.settings[o][t]:e.border[t];s.className=`wtBorder ${this.settings.className||""}`,this.settings[o]&&this.settings[o].hide&&(s.className+=" hidden"),i=s.style;let l=a("style");l?(["start","end"].includes(o)?s.className+=` ${t_}${l}-vertical`:s.className+=` ${t_}${l}-horizontal`,i.setProperty("--ht-custom-border-size",`${a("width")}px`),i.setProperty("--ht-custom-border-color",a("color"))):i.backgroundColor=a("color"),i.height=`${a("width")}px`,i.width=`${a("width")}px`,this.main.appendChild(s)}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(" "),(0,l.isMobileBrowser)()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();let{wtTable:n}=this.wot,o=n.bordersHolder;o||((o=t.createElement("div")).className="htBorders",n.bordersHolder=o,n.spreader.appendChild(o)),o.appendChild(this.main)}createMultipleSelectorHandles(){let{rootDocument:e,wtSettings:t}=this.wot,r=t.getSetting("stylesHandler"),i=r.getCSSVariableValue("cell-mobile-handle-size"),n=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")},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};let l={position:"absolute",height:"40px",width:"40px","border-radius":`${parseInt(40/1.5,10)}px`};(0,eE.objectEach)(l,(e,t)=>{this.selectionHandles.styles.bottomHitArea[t]=e,this.selectionHandles.styles.topHitArea[t]=e});let h=r.isClassicTheme()?{position:"absolute",height:"10px",width:"10px","border-radius":`${parseInt(10/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"}:{position:"absolute",height:`${i}px`,width:`${i}px`,"border-radius":`${n}px`,background:`${o}`,border:`${s}px solid ${a}`};(0,eE.objectEach)(h,(e,t)=>{this.selectionHandles.styles.bottom[t]=e,this.selectionHandles.styles.top[t]=e}),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,t){let r=this.wot.selectionManager.getAreaSelection();return!!r.cellRange&&(e!==r.cellRange.to.row||t!==r.cellRange.to.col)}updateMultipleSelectionHandlesPosition(e,t,r,i,n,o){let s=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:a,topHitArea:l,bottom:h,bottomHitArea:u}
134=this.selectionHandles.styles,c=parseInt(a.borderWidth,10),d=parseInt(a.width,10),g=parseInt(l.width,10),p=this.wot.wtTable.getWidth(),f=this.wot.wtTable.getHeight();a.top=`${parseInt(r-d-1,10)}px`,a[s]=`${parseInt(i-d-1,10)}px`,l.top=`${parseInt(r-g/4*3,10)}px`,l[s]=`${parseInt(i-g/4*3,10)}px`;let m=Math.min(parseInt(i+n,10),p-d-2*c),y=Math.min(parseInt(i+n-g/4,10),p-g-2*c);h[s]=`${m}px`,u[s]=`${y}px`;let w=Math.min(parseInt(r+o,10),f-d-2*c),E=Math.min(parseInt(r+o-g/4,10),f-g-2*c);h.top=`${w}px`,u.top=`${E}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(a.display="block",l.display="block",this.isPartRange(e,t)?(h.display="none",u.display="none"):(h.display="block",u.display="block")):(a.display="none",h.display="none",l.display="none",u.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||t===this.wot.wtSettings.getSetting("fixedColumnsStart")?(a.zIndex="9999",l.zIndex="9999"):(a.zIndex="",l.zIndex="")}appear(e){let t;if(this.disabled)return;let[r,n,o,s]=e;if(r<0&&o<0||n<0&&s<0){this.disappear();return}let{wtTable:a,rootDocument:h,rootWindow:u}=this.wot,c=r!==o||n!==s,d=this.wot.wtSettings.getSetting("stylesHandler").isClassicTheme(),g=a.getFirstRenderedRow(),p=a.getLastRenderedRow(),f=a.getFirstRenderedColumn(),m=a.getLastRenderedColumn();if(f<0&&m<0||g<0&&p<0){this.disappear();return}if(c){if(n=Math.max(n,f),s=Math.min(s,m),r=Math.max(r,g),o=Math.min(o,p),s<n||o<r){this.disappear();return}t=a.getCell(this.wot.createCellCoords(r,n))}else if(t=a.getCell(this.wot.createCellCoords(r,n)),!(0,i.isHTMLElement)(t)){this.disappear();return}let y=c?a.getCell(this.wot.createCellCoords(o,s)):t,w=(0,i.offset)(t),E=c?(0,i.offset)(y):w,S=(0,i.offset)(a.TABLE),C=w.top,R=w.left,b=this.wot.wtSettings.getSetting("rtlMode"),T=0,N=0;if(b){let e=(0,i.outerWidth)(a.TABLE),r=(0,i.outerWidth)(t),n=u.innerWidth-S.left-e;N=R+r-E.left,T=u.innerWidth-R-r-n-1}else N=E.left+(0,i.outerWidth)(y)-R,T=R-S.left-1;if(this.isEntireColumnSelected(r,o)){let e=r,i=this.getDimensionsFromHeader("columns",n,s,e,S),o=null;i&&([o,T,N]=i),o&&(t=o)}let A=C-S.top-1,I=E.top+(0,i.outerHeight)(y)-C;if(this.isEntireRowSelected(n,s)){let e=n,i=this.getDimensionsFromHeader("rows",r,o,e,S),s=null;i&&([s,A,I]=i),s&&(t=s)}let M=u.getComputedStyle(t);parseInt(M.borderTopWidth,10)>0&&(A+=1,I=I>0?I-1:0),parseInt(M[b?"borderRightWidth":"borderLeftWidth"],10)>0&&(T+=1,N=N>0?N-1:0);let O=b?"right":"left",x=Math.ceil(this.settings.border.width/2);this.topStyle.top=`${A}px`,this.topStyle[O]=`${T}px`,this.topStyle.width=`${N+x}px`,this.topStyle.display="block",this.startStyle.top=`${A}px`,this.startStyle[O]=`${T}px`,this.startStyle.height=`${I+x}px`,this.startStyle.display="block",this.bottomStyle.top=`${A+I-parseInt(this.bottomStyle.height,10)+x}px`,this.bottomStyle[O]=`${T}px`,this.bottomStyle.width=`${N+x}px`,this.bottomStyle.display="block",this.endStyle.top=`${A}px`,this.endStyle[O]=`${T+N-parseInt(this.endStyle.width,10)+x}px`,this.endStyle.height=`${I+x}px`,this.endStyle.display="block";let _=this.settings.border.cornerVisible;_="function"==typeof _?_(this.settings.layerLevel):_;let P=this.wot.getSetting("onModifyGetCellCoords",o,s,!1,"render"),[L,k]=[o,s];if(P&&Array.isArray(P)&&([,,L,k]=P),(0,l.isMobileBrowser)()||!_||this.isPartRange(L,k))this.cornerStyle.display="none";else{this.cornerStyle.top=`${A+I+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[O]=`${T+N+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 e=(0,i.getTrimmingContainer)(a.TABLE),t=e===u;t&&(e=h.documentElement);let r=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,n=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),l=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(s===this.wot.getSetting("totalColumns")-1){let o=t?y.getBoundingClientRect().left:y.offsetLeft;if(b?o-parseInt(this.cornerDefaultStyle.width,10)/2<0:o+(0,i.outerWidth)(y)+parseInt(this.cornerDefaultStyle.width,10)/2>=(0,i.innerWidth)(e)){let e=Math.floor(T+N+this.cornerCenterPointOffset-n-r);d?(this.cornerStyle[O]=`${e}px`,this.cornerStyle[b?"borderLeftWidth":"borderRightWidth"]=0):this.cornerStyle[O]=`${e-1}px`}}if(o===this.wot.getSetting("totalRows")-1&&(t?y.getBoundingClientRect().top:y.offsetTop)+(0,i.outerHeight)(y)+parseInt(this.cornerDefaultStyle.height,10)/2>=(0,i.innerHeight)(e)){let e=Math.floor(A+I+this.cornerCenterPointOffset-l
134-r);d?(this.cornerStyle.top=`${e}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${e-1}px`}this.cornerStyle.display="block"}(0,l.isMobileBrowser)()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(o,s,A,T,N,I)}isEntireColumnSelected(e,t){return e===this.wot.wtTable.getFirstRenderedRow()&&t===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,t){return e===this.wot.wtTable.getFirstRenderedColumn()&&t===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,t,r,n,o){let{wtTable:s}=this.wot,a=s.wtRootElement.parentNode,l=null,h=null,u=null,c=null,d=null,g=null,p=null,f=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},h=function(){return(0,i.outerHeight)(...arguments)},u="ht__selection--rows",g="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},h=function(){return(0,i.outerWidth)(...arguments)},u="ht__selection--columns",g="left"}if(a.classList.contains(u)){let e=this.wot.getSetting("columnHeaders").length;if(p=l(t,e-n),f=l(r,e-n),!p||!f)return!1;let s=(0,i.offset)(p),a=(0,i.offset)(f);return p&&f&&(c=s[g]-o[g]-1,d=a[g]+h(f)-s[g]),[p,c,d]}return!1}changeBorderStyle(e,t){let r=this[e].style,n=t[e];!n||n.hide?(0,i.addClass)(this[e],"hidden"):((0,i.hasClass)(this[e],"hidden")&&(0,i.removeClass)(this[e],"hidden"),r.backgroundColor=n.color,("top"===e||"bottom"===e)&&(r.height=`${n.width}px`),("start"===e||"end"===e)&&(r.width=`${n.width}px`))}changeBorderToDefaultStyle(e){let t=this[e].style;t.backgroundColor="#000",t.width="1px",t.height="1px"}toggleHiddenClass(e,t){this.changeBorderToDefaultStyle(e),t?(0,i.addClass)(this[e],"hidden"):(0,i.removeClass)(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",(0,l.isMobileBrowser)()&&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 tL(e,t,r){tk(e,t),t.set(e,r)}function tk(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function tD(e,t){return e.get(tB(e,t))}function tH(e,t,r){return e.set(tB(e,t),r),r}function tB(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var tF=new WeakMap,tV=new WeakMap,tU=new WeakMap,tW=new WeakMap,tj=new WeakMap,tG=new WeakMap,t$=new WeakSet;class tz{constructor(e){tk(this,t$),t$.add(this),tL(this,tF,void 0),tL(this,tV,void 0),tL(this,tU,new tM),tL(this,tW,new WeakMap),tL(this,tj,new WeakSet),tL(this,tG,new Map),tH(tV,this,e)}setActiveOverlay(e){return tH(tF,this,e),tD(tU,this).setActiveOverlay(tD(tF,this)),tD(tW,this).has(tD(tF,this))||tD(tW,this).set(tD(tF,this),new Set),this}getFocusSelection(){return null!==tD(tV,this)?tD(tV,this).getFocus():null}getAreaSelection(){return null!==tD(tV,this)?tD(tV,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(tD(tG,this).has(e)){let t=tD(tG,this).get(e);if(t.has(tD(tF,this)))return t.get(tD(tF,this));let r=new tP(tD(tF,this),e.settings);return t.set(tD(tF,this),r),r}let t=new tP(tD(tF,this),e.settings);return tD(tG,this).set(e,new Map([[tD(tF,this),t]])),t}getBorderInstances(e){var t,r;return Array.from(null!==(t=null===(r=tD(tG,this).get(e))||void 0===r?void 0:r.values())&&void 0!==t?t:[])}destroyBorders(e){tD(tG,this).get(e).forEach(e=>e.destroy()),tD(tG,this).delete(e)}render(e){if(null===tD(tV,this))return;e&&tB(t$,this,tY).call(this);let t=Array.from(tD(tV,this)),r=new Map,n=new Map;for(let e=0;e<t.length;e++){let i=t[e],{className:o,headerAttributes:s,createLayers:a,selectionType:l}=i.settings;tD(tj,this).has(i)||(tD(tj,this).add(i),i.addLocalHook("destroy",()=>this.destroyBorders(i)));let h=this.getBorderInstance(i);if(i.isEmpty()){null==h||h.disappear();continue}
134o&&tD(tU,this).setActiveSelection(i).scan().forEach(e=>{if(r.has(e)){let t=r.get(e);t.has(o)&&!0===a?t.set(o,t.get(o)+1):t.set(o,1)}else r.set(e,new Map([[o,1]]));s&&(n.has(e)||n.set(e,[]),"TH"===e.nodeName&&n.get(e).push(...s))});let u=i.getCorners();tD(tF,this).getSetting("onBeforeDrawBorders",u,l),null==h||h.appear(u)}r.forEach((e,t)=>{var r;let n=Array.from(e).map(e=>{let[t,r]=e;return 1===r?t:[t,...Array.from({length:r-1},(e,r)=>`${t}-${r+1}`)]}).flat();n.forEach(e=>tD(tW,this).get(tD(tF,this)).add(e)),(0,i.addClass)(t,n),"TD"===t.nodeName&&Array.isArray(null===(r=tD(tV,this).options)||void 0===r?void 0:r.cellAttributes)&&(0,i.setAttribute)(t,tD(tV,this).options.cellAttributes)}),Array.from(n.keys()).forEach(e=>{(0,i.setAttribute)(e,[...n.get(e)])})}}function tY(){let e=tD(tW,this).get(tD(tF,this)),t=tD(tF,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(t))for(let r=0;r<t.length;r++)e.add(t[r]);e.forEach(e=>{var t,r;let n=tD(tF,this).wtTable.TABLE.querySelectorAll(`.${e}`),o=[];Array.isArray(null===(t=tD(tV,this).options)||void 0===t?void 0:t.cellAttributes)&&(o=tD(tV,this).options.cellAttributes.map(e=>e[0])),Array.isArray(null===(r=tD(tV,this).options)||void 0===r?void 0:r.headerAttributes)&&(o=[...o,...tD(tV,this).options.headerAttributes.map(e=>e[0])]);for(let t=0,r=n.length;t<r;t++)(0,i.removeClass)(n[t],e),(0,i.removeAttribute)(n[t],o)}),e.clear()}class tK extends eP{constructor(e,t){super(e,new e8(t));let r=this.wtSettings.getSetting("facade",this);this.wtTable=new e6(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new tE(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new tz(this.wtSettings.getSetting("selections")),this.wtEvent=new T(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new e4(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){let e=[],t=[];(0,eE.objectEach)({rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},(r,i)=>{this.wtSettings.getSetting(i).length&&t.push(r),e.push(r)}),(0,i.removeClass)(this.wtTable.wtRootElement.parentNode,e),(0,i.addClass)(this.wtTable.wtRootElement.parentNode,t)}getOverlayByName(e){var t;if(!ef.includes(e))return null;let r=e.replace(/_([a-z])/g,e=>e[1].toUpperCase());return null!==(t=this.wtOverlays[`${r}Overlay`])&&void 0!==t?t:null}getViewportDao(){let 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 tX{constructor(e){e instanceof eP?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=e=>{let t=new tX(e);return()=>t},this._wot=new tK(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}createCellCoords(e,t){return this._wot.createCellCoords(e,t)}createCellRange(e,t,r){return this._wot.createCellRange(e,t,r)}draw(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._wot.draw(e),this}getCell(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._wot.getCell(e,t)}scrollViewport(e,t,r){return this._wot.scrollViewport(e,t,r)}scrollViewportHorizontally(e,t){return this._wot.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this._wot.scrollViewportVertically(e,t)}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,t){return this._wot.wtSettings.update(e,t),this}getSetting(e,t,r,i,n){return this._wot.wtSettings.getSetting(e,t,r,i,n)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}
134destroy(){this._wot.destroy()}}function tq(e){let{isShiftKey:t,isLeftClick:r,isRightClick:i,coords:n,selection:o,controller:s,cellCoordsFactory:a}=e,l=o.isSelected()?o.getSelectedRange().current():null,h=o.isSelectedByCorner(),u=o.isSelectedByRowHeader();if(o.markSource("mouse"),t&&l)n.row>=0&&n.col>=0&&!s.cell?o.setRangeEnd(n):(h||u)&&n.row>=0&&n.col>=0&&!s.cell?o.setRangeEnd(a(n.row,n.col)):h&&n.row<0&&!s.column?o.setRangeEnd(a(l.to.row,n.col)):u&&n.col<0&&!s.row?o.setRangeEnd(a(n.row,l.to.col)):(!h&&!u&&n.col<0||h&&n.col<0)&&!s.row?o.selectRows(Math.max(l.from.row,0),n.row,n.col):(!h&&!u&&n.row<0||u&&n.row<0)&&!s.column&&o.selectColumns(Math.max(l.from.col,0),n.col,n.row);else{let e=!o.inInSelection(n),t=r||i&&e;n.row<0&&n.col>=0&&!s.column?t&&o.selectColumns(n.col,n.col,n.row):n.col<0&&n.row>=0&&!s.row?t&&o.selectRows(n.row,n.row,n.col):n.col>=0&&n.row>=0&&!s.cell?t&&o.setRangeStart(n):n.col<0&&n.row<0&&o.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}o.markEndSource()}function tZ(e){let{isLeftClick:t,selection:r,cellRangeMapper:i}=e;if(!t||"multiple"!==r.settings.selectionMode)return;let n=r.getSelectedRange(),o=n.clone().map(e=>i.toRenderable(e)),s=o.current();if(o.size()>1&&!s.isHeader()&&!r.isMultiple(s)){let e=o.findAll(s);e.length===o.size()?(n.pop(),r.refresh()):e.length>1&&(n.removeLayers(e.map(e=>{let{layer:t}=e;return t})),r.refresh())}}let tQ=new Map([["touchstart",tq],["touchend",tZ],["mousedown",tq],["mouseover",function(e){let{isLeftClick:t,coords:r,selection:i,controller:n,cellCoordsFactory:o}=e;if(!t)return;let s=i.isSelectedByRowHeader(),a=i.isSelectedByColumnHeader(),l=i.tableProps.countCols(),h=i.tableProps.countRows();i.markSource("mouse"),a&&!n.column?i.setRangeEnd(o(h-1,r.col)):s&&!n.row?i.setRangeEnd(o(r.row,l-1)):n.cell||i.setRangeEnd(r),i.markEndSource()}],["mouseup",tZ]]);function tJ(e,t){tQ.get(e.type)({isShiftKey:e.shiftKey,isLeftClick:(0,o.isLeftClick)(e)||"touchstart"===e.type,isRightClick:(0,o.isRightClick)(e),...t})}var t0=r(31285),t1=r(14216);function t2(e,t,r){t5(e,t),t.set(e,r)}function t5(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function t3(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t9(e,t){return e.get(t7(e,t))}function t4(e,t,r){return e.set(t7(e,t),r),r}function t7(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var t8=new WeakMap,t6=new WeakMap,re=new WeakMap,rt=new WeakMap,rr=new WeakMap,ri=new WeakMap,rn=new WeakMap,ro=new WeakMap,rs=new WeakSet;class ra{constructor(e){t5(this,rs),rs.add(this),t3(this,"hot",void 0),t3(this,"eventManager",void 0),t3(this,"settings",void 0),t3(this,"THEAD",void 0),t3(this,"TBODY",void 0),t3(this,"_wt",void 0),t3(this,"activeWt",void 0),t2(this,t8,0),t2(this,t6,0),t3(this,"postponedAdjustElementsSize",!1),t2(this,re,!1),t2(this,rt,void 0),t2(this,rr,void 0),t2(this,ri,0),t2(this,rn,0),t2(this,ro,null),this.hot=e,this.eventManager=new n.Z(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){let e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this._wt.draw(!e),t7(rs,this,ru).call(this),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize(!0)),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e?this._wt.wtOverlays.adjustElementsSize():this.postponedAdjustElementsSize=!0}getCellAtCoords(e,t){let r=this._wt.getCell(e,t);return r<0?null:r}scrollViewport(e,t,r){return this._wt.scrollViewport(e,t,r)}scrollViewportHorizontally(e,t){return this._wt.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this._wt.scrollViewportVertically(e,t)}createElements(){let{rootElement:e,rootDocument:t}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),(0,i.addClass)(e,"handsontable"),t4(rr,this,t.createElement("TABLE")),(0,i.addClass)(t9(rr,this),"htCore"),this.hot.getSettings().tableClassName&&(0,i.addClass)(t9(rr,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&((0,i.setAttribute)(t9(rr,this),[(0,z.Rn)()]),(0,i.setAttribute)(e,[(0,z.nO)(),(0,z.a2)(-1),(0,z.Wv)(this.hot.countCols()),(0,z.qt)()])),this.THEAD=t.createElement("THEAD"),t9(rr,this).appendChild(this.THEAD),this.TBODY=t.createElement("TBODY"),t9(rr,this).appendChild(this.TBODY),this.hot.table=t9(rr,this),this.hot.container.insertBefore(t9(rr,this),this.hot.container.firstChild)}registerEvents(){let{rootWrapperElement:e,rootElement:t,rootDocument:r,selection:n,rootWindow:s}=this.hot,a=r.documentElement;this.eventManager.addEventListener(t,"mousedown",e=>
134{t4(re,this,!0),this.isTextSelectionAllowed(e.target)||((0,i.clearTextSelection)(s),e.preventDefault(),s.focus())}),this.eventManager.addEventListener(t,"mouseup",()=>{t4(re,this,!1)}),this.eventManager.addEventListener(t,"mousemove",e=>{t9(re,this)&&!this.isTextSelectionAllowed(e.target)&&(this.settings.fragmentSelection&&(0,i.clearTextSelection)(s),e.preventDefault())}),this.eventManager.addEventListener(a,"keyup",e=>{n.isInProgress()&&!e.shiftKey&&n.finish()}),this.eventManager.addEventListener(a,"mouseup",s=>{n.isInProgress()&&(0,o.isLeftClick)(s)&&n.finish(),t4(rt,this,!1);let a=(0,i.isOutsideInput)(r.activeElement);(!(0,i.isInput)(r.activeElement)||a)&&(!a&&(n.isSelected()||n.isSelectedByAnyHeader()||(null!=e?e:t).contains(s.target)||(0,o.isRightClick)(s))||this.hot.unlisten())}),this.eventManager.addEventListener(a,"contextmenu",e=>{n.isInProgress()&&(0,o.isRightClick)(e)&&(n.finish(),t4(rt,this,!1))}),this.eventManager.addEventListener(a,"touchend",()=>{n.isInProgress()&&n.finish(),t4(rt,this,!1)}),this.eventManager.addEventListener(a,"mousedown",e=>{let n=e.target,o=e.x||e.clientX,s=e.y||e.clientY,l=e.target;if(t9(rt,this)||!t||!this.hot.view)return;let{holder:h}=this._wt.wtTable;if(l===h){let e=(0,i.getScrollbarWidth)(r);if(r.elementFromPoint(o+e,s)!==h||r.elementFromPoint(o,s+e)!==h)return}else for(;l!==a;){if(null===l){if(e.isTargetWebComponent)break;return}if(l===t)return;l=l.parentNode}("function"==typeof this.settings.outsideClickDeselects?this.settings.outsideClickDeselects(n):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let l=(0,i.getParentWindow)(s);for(;null!==l;)this.eventManager.addEventListener(l.document.documentElement,"click",()=>{this.hot.unlisten()}),l=(0,i.getParentWindow)(l);this.eventManager.addEventListener(t9(rr,this),"selectstart",e=>{this.settings.fragmentSelection||(0,i.isInput)(e.target)||e.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:t,col:r}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(t,r))}translateFromRenderableToVisualIndex(e,t){let r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=t>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(t):t;return null===r&&(r=e),null===i&&(i=t),[r,i]}countRenderableIndexes(e,t){let r=Math.min(e.getNotTrimmedIndexesLength(),t),i=e.getNearestNotHiddenIndex(r-1,-1);return null===i?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,t){return this.countNotHiddenIndexes(e,t,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,t){return this.countNotHiddenIndexes(e,t,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,t,r,i){if(isNaN(e)||e<0)return 0;let n=r.getNearestNotHiddenIndex(e,t),o=r.getRenderableFromVisualIndex(n);if(!Number.isInteger(o))return 0;let s=0;return t<0?s=o+1:t>0&&(s=i-o),s}countNotHiddenFixedColumnsStart(){let e=this.hot.countCols(),t=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(t,-1)}countNotHiddenFixedRowsTop(){let e=this.hot.countRows(),t=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(t,-1)}countNotHiddenFixedRowsBottom(){let e=Math.max(this.hot.countRows()-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(e,1)}countRenderableColumnsInRange(e,t){let r=0;for(let i=e;i<=t;i++)null!==this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)&&(r+=1);return r}countRenderableRowsInRange(e,t){let r=0;for(let i=e;i<=t;i++)null!==this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)&&(r+=1);return r}addClassNameToLicenseElement(e){var t;let r=null===(t=this.hot.rootElement.parentNode)||void 0===t?void 0:t.querySelector(".hot-display-license-info");r&&(0,i.addClass)(r,e)}removeClassNameFromLicenseElement(e){var t;let r=null===(t=this.hot.rootElement.parentNode)||void 0===t?void 0:t.querySelector(".hot-display-license-info");r&&(0,i.removeClass)(r,e)}isMainTableNotFullyCoveredByOverlays(){let e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),t=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>t}initializeWalkontable(){let e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:t9(rr,this),isDataViewInstance:()=>(0,t0._v)(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(e,t)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(e,t)),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:()=>{let e=[];return this.hot.hasRowHeaders()&&e.push((e,t)=>{let r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e;this.appendRowHeader(r,t)}),this.hot.runHooks("afterGetRowHeaderRenderers",e),t4(t6,this,e.length),this.hot.getSettings().ariaTags&&t7(rs,this,rl).call(this)===this.hot.countCols()&&t7(rs,this,rh).call(this,t9(t6,this)),e},columnHeaders:()=>{let e=[];return this.hot.hasColHeaders()&&e.push((e,t)=>{let r=e>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(e):e;this.appendColHeader(r,t)}),this.hot.runHooks("afterGetColumnHeaderRenderers",e),t4(t8,this,e.length),e},columnWidth:e=>{let t=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e);return this.hot.getColWidth(null===t?e:t)},rowHeight:e=>{let t=this.hot.rowIndexMapper.getVisualFromRenderableIndex(e);return this.hot.getRowHeight(null===t?e:t)},rowHeightByOverlayName:(e,t)=>
134{let r=this.hot.rowIndexMapper.getVisualFromRenderableIndex(e),i=null===r?e:r;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(i),i,t)},cellRenderer:(e,t,r)=>{let[i,n]=this.translateFromRenderableToVisualIndex(e,t),o=this.hot.runHooks("modifyGetCellCoords",i,n,!1,"meta"),s=i,a=n;Array.isArray(o)&&([s,a]=o);let l=this.hot.getCellMeta(s,a),h=this.hot.colToProp(a),u=this.hot.getDataAtRowProp(s,h);this.hot.hasHook("beforeValueRender")&&(u=this.hot.runHooks("beforeValueRender",u,l)),this.hot.runHooks("beforeRenderer",r,i,n,h,u,l),this.hot.getCellRenderer(l)(this.hot,r,i,n,h,u,l),this.hot.runHooks("afterRenderer",r,i,n,h,u,l)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&(0,i.isVisible)(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(e,t,r,i)=>{let n=this.translateFromRenderableToVisualCoords(t),s={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=i,t4(rt,this,!0),t4(ro,this,{x:e.clientX,y:e.clientY}),this.hot.runHooks("beforeOnCellMouseDown",e,n,r,s),(0,o.isImmediatePropagationStopped)(e)||(tJ(e,{coords:n,selection:this.hot.selection,controller:s,cellCoordsFactory:(e,t)=>this.hot._createCellCoords(e,t)}),this.hot.runHooks("afterOnCellMouseDown",e,n,r),this.activeWt=this._wt)},onCellContextMenu:(e,t,r,i)=>{let n=this.translateFromRenderableToVisualCoords(t);this.activeWt=i,t4(rt,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",e,n,r),(0,o.isImmediatePropagationStopped)(e)||(this.hot.runHooks("afterOnCellContextMenu",e,n,r),this.activeWt=this._wt)},onCellMouseOut:(e,t,r,i)=>{let n=this.translateFromRenderableToVisualCoords(t);this.activeWt=i,this.hot.runHooks("beforeOnCellMouseOut",e,n,r),(0,o.isImmediatePropagationStopped)(e)||(this.hot.runHooks("afterOnCellMouseOut",e,n,r),this.activeWt=this._wt)},onCellMouseOver:(e,t,r,i)=>{let n=this.translateFromRenderableToVisualCoords(t),s={row:!1,column:!1,cell:!1};this.activeWt=i,this.hot.runHooks("beforeOnCellMouseOver",e,n,r,s),(0,o.isImmediatePropagationStopped)(e)||(t9(rt,this)&&(!t9(ro,this)||t9(ro,this).x!==e.clientX||t9(ro,this).y!==e.clientY)&&tJ(e,{coords:n,selection:this.hot.selection,controller:s,cellCoordsFactory:(e,t)=>this.hot._createCellCoords(e,t)}),this.hot.runHooks("afterOnCellMouseOver",e,n,r),this.activeWt=this._wt,t4(ro,this,null))},onCellMouseUp:(e,t,r,i)=>{let n=this.translateFromRenderableToVisualCoords(t);this.activeWt=i,this.hot.runHooks("beforeOnCellMouseUp",e,n,r),(0,o.isImmediatePropagationStopped)(e)||this.hot.isDestroyed||(tJ(e,{coords:n,selection:this.hot.selection,cellRangeMapper:(0,t1.BK)(this.hot,"cellRangeMapper")}),this.hot.runHooks("afterOnCellMouseUp",e,n,r),this.activeWt=this._wt)},onCellCornerMouseDown:e=>{e.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",e)},onCellCornerDblClick:e=>{e.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",e)},beforeDraw:(e,t)=>this.beforeRender(e,t),onDraw:e=>this.afterRender(e),onBeforeViewportScrollVertically:(e,t)=>{let r=this.hot.rowIndexMapper,i=e<0,n=e;return i||null!==(n=r.getVisualFromRenderableIndex(e))?(n=this.hot.runHooks("beforeViewportScrollVertically",n,t),this.hot.runHooks("beforeViewportScroll"),i)?n:r.getRenderableFromVisualIndex(n):e},onBeforeViewportScrollHorizontally:(e,t)=>{let r=this.hot.columnIndexMapper,i=e<0,n=e;return i||null!==(n=r.getVisualFromRenderableIndex(e))?(n=this.hot.runHooks("beforeViewportScrollHorizontally",n,t),this.hot.runHooks("beforeViewportScroll"),i)?n:r.getRenderableFromVisualIndex(n):e},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(e,t,r)=>{let i=this.hot.rowIndexMapper,n=e<0,o=e;n||(o=i.getVisualFromRenderableIndex(e));let s=this.hot.runHooks("beforeHighlightingRowHeader",o,t,r);return n?s:i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(s,1))},onBeforeHighlightingColumnHeader:(e,t,r)=>{let i=this.hot.columnIndexMapper,n=e<0,o=e;n||(o=i.getVisualFromRenderableIndex(e));let s=this.hot.runHooks("beforeHighlightingColumnHeader",o,t,r);return n?s:i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(s,1))},onAfterDrawSelection:(e,t,r)=>{let i;let[n,o]=this.translateFromRenderableToVisualIndex(e,t),s=this.hot.selection.getSelectedRange();if(s.size()>0){let e=s.peekByIndex(null!=r?r:0);i=[e.from.row,e.from.col,e.to.row,e.to.col]}return this.hot.runHooks("afterDrawSelection",n,o,i,r)},onBeforeDrawBorders:(e,t)=>{let[r,i,n,o]=e,s=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(r),this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),this.hot.rowIndexMapper.getVisualFromRenderableIndex(n),this.hot.columnIndexMapper.getVisualFromRenderableIndex(o)];return this.hot.runHooks("beforeDrawBorders",s,t)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:e=>this.hot.runHooks("modifyRowHeaderWidth",e),onModifyGetCellCoords:(e,t,r,i)=>{let n=this.hot.rowIndexMapper,o=this.hot.columnIndexMapper,s=t>=0?o.getVisualFromRenderableIndex(t):t,a=e>=0?n.getVisualFromRenderableIndex(e):e,l=this.hot.runHooks("modifyGetCellCoords",a,s,r,i);if(Array.isArray(l)){let[e,t,r,i]=l;return[e>=0?n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(e,1)):e,t>=0?o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(t,1)):t,r>=0?n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(r,-1)):r,i>=0?o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(i,-1)):i]}},onModifyGetCoordsElement:(e,t)=>
134{let r=this.hot.rowIndexMapper,i=this.hot.columnIndexMapper,n=t>=0?i.getVisualFromRenderableIndex(t):t,o=e>=0?r.getVisualFromRenderableIndex(e):e,s=this.hot.runHooks("modifyGetCoordsElement",o,n);if(Array.isArray(s)){let[e,t]=s;return[e>=0?r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(e,1)):e,t>=0?i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(t,1)):t]}},viewportRowCalculatorOverride:e=>{let t=this.settings.viewportRowRenderingOffset;if("auto"===t&&this.settings.fixedRowsTop&&(t=10),t>0||"auto"===t){let r=this.countRenderableRows(),i=e.startRow,n=e.endRow;if("number"==typeof t)e.startRow=Math.max(i-t,0),e.endRow=Math.min(n+t,r-1);else if("auto"===t){let t=Math.max(1,Math.ceil(n/r*12));e.startRow=Math.max(i-t,0),e.endRow=Math.min(n+t,r-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",e)},viewportColumnCalculatorOverride:e=>{let t=this.settings.viewportColumnRenderingOffset;if("auto"===t&&this.settings.fixedColumnsStart&&(t=10),t>0||"auto"===t){let r=this.countRenderableColumns(),i=e.startColumn,n=e.endColumn;if("number"==typeof t&&(e.startColumn=Math.max(i-t,0),e.endColumn=Math.min(n+t,r-1)),"auto"===t){let t=Math.max(1,Math.ceil(n/r*6));e.startColumn=Math.max(i-t,0),e.endColumn=Math.min(n+t,r-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",e)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{let e=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||e},stylesHandler:()=>this.hot.stylesHandler};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new tX(e),this.activeWt=this._wt;let t=this._wt.wtTable.spreader,{width:r,height:n}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(r,n),this.eventManager.addEventListener(t,"mousedown",e=>{e.target===t&&3===e.which&&e.stopPropagation()}),this.eventManager.addEventListener(t,"contextmenu",e=>{e.target===t&&3===e.which&&e.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){var t,r;if((0,i.isInput)(e))return!0;let n=(0,i.isChildOf)(e,this._wt.wtTable.spreader);if(!0===this.settings.fragmentSelection&&n)return!0;let o=null!==(t=null===(r=this.hot.getSelectedRangeActive())||void 0===r?void 0:r.isSingleCell())&&void 0!==t&&t;return!!("cell"===this.settings.fragmentSelection&&o&&n||!this.settings.fragmentSelection&&this.isCellEdited()&&o)}isMouseDown(){return t9(rt,this)}isCellEdited(){let e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,t){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,t)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,t){if(t.firstChild){let r=t.firstChild;if(!(0,i.hasClass)(r,"relative")){(0,i.empty)(t),this.appendRowHeader(e,t);return}this.updateCellHeader(r.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{let{rootDocument:r,getRowHeader:i}=this.hot,n=r.createElement("div"),o=r.createElement("span");n.className="relative",o.className="rowHeader",this.updateCellHeader(o,e,i),n.appendChild(o),t.appendChild(n)}this.hot.runHooks("afterGetRowHeader",e,t)}appendColHeader(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hot.getColHeader,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=()=>{let t=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return t?t.split(" "):[]};if(t.firstChild){let s=t.firstChild;(0,i.hasClass)(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,r,n),s.className="",(0,i.addClass)(s,["relative",...o()])):((0,i.empty)(t),this.appendColHeader(e,t,r,n))}else{let{rootDocument:s}=this.hot,a=s.createElement("div"),l=s.createElement("span"),h=o();a.classList.add("relative",...h),l.className="colHeader",this.settings.ariaTags&&((0,i.setAttribute)(a,...(0,z.Rn)()),(0,i.setAttribute)(l,...(0,z.Rn)())),this.updateCellHeader(l,e,r,n),a.appendChild(l),t.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,t,n)}updateCellHeader(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=t,s=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&((0,i.hasClass)(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(t):(0,i.hasClass)(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(t))),o>-1?(0,i.fastInnerHTML)(e,r(t,n)):((0,i.fastInnerText)(e,String.fromCharCode(160)),(0,i.addClass)(e,"cornerHeader"))}maximumVisibleElementWidth(e){let t=this._wt.wtViewport.getWorkspaceWidth()-e;return t>0?t:0}maximumVisibleElementHeight(e){let t=this._wt.wtViewport.getWorkspaceHeight()-e;return t>0?t:0}setLastSize(e,t){t4(ri,this,e),t4(rn,this,t)}getLastSize(){return{width:t9(ri,this),height:t9(rn,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;let e=this.hot.rowIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(null!=t?t:0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;let e=this.hot.rowIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(null!=t?t:this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;let e=this.hot.columnIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(null!=t?t:0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;let e=this.hot.columnIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(null!=t?t: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())}
134getLastPartiallyVisibleRow(){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 t9(t8,this)}getRowHeadersCount(){return t9(t6,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 t;return(null!==(t=this._wt.wtOverlays.getParentOverlay(e))&&void 0!==t?t: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()}getTotalTableWidth(){return this._wt.wtTable.getTotalWidth()}getTotalTableHeight(){return this._wt.wtTable.getTotalHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getTableScrollPosition(){return{left:this._wt.wtTable.holder.scrollLeft,top:this._wt.wtTable.holder.scrollTop}}setTableScrollPosition(e){this._wt.wtTable.holder.scrollLeft=e.left,this._wt.wtTable.holder.scrollTop=e.top}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 rl(){return parseInt(this.hot.rootElement.getAttribute((0,z.Wv)()[0]),10)}function rh(e){let t=t7(rs,this,rl).call(this)+e;(0,i.setAttribute)(this.hot.rootElement,...(0,z.Wv)(t))}function ru(){let e=this.hot.rootElement;this.hasVerticalScroll()?(0,i.addClass)(e,"htHasScrollY"):(0,i.removeClass)(e,"htHasScrollY"),this.isVerticallyScrollableByWindow()?(0,i.addClass)(e,"htVerticallyScrollableByWindow"):(0,i.removeClass)(e,"htVerticallyScrollableByWindow"),this.hasHorizontalScroll()?(0,i.addClass)(e,"htHasScrollX"):(0,i.removeClass)(e,"htHasScrollX"),this.isHorizontallyScrollableByWindow()?(0,i.addClass)(e,"htHorizontallyScrollableByWindow"):(0,i.removeClass)(e,"htHorizontallyScrollableByWindow")}var rc=ra},9297:function(e,t,r){"use strict";r.d(t,{d:function(){return L}}),r(76346),r(81090),r(54485),r(25765),r(10565),r(48712),r(72956),r(19975),r(70470),r(52419),r(17901),r(97934);var i=r(22386),n=r(84616),o=r(49559),s=r(27861),a=r(25778),l=r(38231),h=r(88579);let u=new Map([["hiding",o.o],["index",s.n],["linkedPhysicalIndexToValue",a.A],["physicalIndexToValue",l.L],["trimming",h.n]]);var c=r(66128);r(65230);var d=r(98014),g=r(21927);function p(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class f extends d.f{constructor(e,t){super(),p(this,"mergedValuesCache",[]),p(this,"aggregationFunction",void 0),p(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=t}getMergedValues(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(!0===e)return this.mergedValuesCache;if(0===this.getLength())return[];let t=(0,i.arrayMap)(this.get(),e=>e.getValues()),r=[],n=(0,g.isDefined)(t[0])&&t[0].length||0;for(let e=0;e<n;e+=1){let i=[];for(let r=0;r<this.getLength();r+=1)i.push(t[r][e]);r.push(i)}return(0,i.arrayMap)(r,this.aggregationFunction)}getMergedValueAtIndex(e,t){let r=this.getMergedValues(t)[e];return(0,g.isDefined)(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}var m=r(65166),y=r(92263);function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}r(95984);var E=new WeakMap;class S{constructor(){var e;e=[],function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,E),E.set(this,e)}
134subscribe(e){return this.addLocalHook("change",e),this._write(E.get(w(E,this))),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){E.set(w(E,this),e)}}function C(e,t){let r=[],i=0,n=0;for(;i<e.length&&n<t.length;i++,n++)e[i]!==t[n]&&r.push({op:"replace",index:n,oldValue:e[i],newValue:t[n]});for(;i<t.length;i++)r.push({op:"insert",index:i,oldValue:void 0,newValue:t[i]});for(;n<e.length;n++)r.push({op:"remove",index:n,oldValue:e[n],newValue:void 0});return r}function R(e,t,r){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function b(e,t){return e.get(N(e,t))}function T(e,t,r){return e.set(N(e,t),r),r}function N(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}(0,y.mixin)(S,m.Z);var A=new WeakMap,I=new WeakMap,M=new WeakMap,O=new WeakMap,x=new WeakMap;class _{constructor(){let{initialIndexValue:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,A,new Set),R(this,I,[]),R(this,M,[]),R(this,O,!1),R(this,x,!1),T(x,this,null!=e&&e)}createObserver(){let e=new S;return b(A,this).add(e),e.addLocalHook("unsubscribe",()=>{b(A,this).delete(e)}),e._writeInitialChanges(C(b(I,this),b(M,this))),e}emit(e){let t=b(M,this);b(O,this)&&b(I,this).length===e.length||(0===e.length?e=Array(t.length).fill(b(x,this)):T(I,this,Array(e.length).fill(b(x,this))),b(O,this)||(T(O,this,!0),t=b(I,this)));let r=C(t,e);b(A,this).forEach(e=>e._write(r)),T(M,this,e)}}function P(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class L{constructor(){P(this,"indexesSequence",new n.b),P(this,"trimmingMapsCollection",new f(e=>e.some(e=>!0===e),!1)),P(this,"hidingMapsCollection",new f(e=>e.some(e=>!0===e),!1)),P(this,"variousMapsCollection",new d.f),P(this,"hidingChangesObservable",new _({initialIndexValue:!1})),P(this,"notTrimmedIndexesCache",[]),P(this,"notHiddenIndexesCache",[]),P(this,"isBatched",!1),P(this,"indexesSequenceChanged",!1),P(this,"indexesChangeSource",void 0),P(this,"trimmedIndexesChanged",!1),P(this,"hiddenIndexesChanged",!1),P(this,"renderablePhysicalIndexesCache",[]),P(this,"fromPhysicalToVisualIndexesCache",new Map),P(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("hiding"!==e)throw Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,t,r){return this.registerMap(e,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!u.has(e))throw Error(`The provided map type ("${e}") does not exist.`);return new(u.get(e))(t)}(t,r))}registerMap(e,t){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);t instanceof h.n?this.trimmingMapsCollection.register(e,t):t instanceof o.o?this.hidingMapsCollection.register(e,t):this.variousMapsCollection.register(e,t);
134let r=this.getNumberOfIndexes();return r>0&&t.init(r),t}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){let t=this.notTrimmedIndexesCache[e];return(0,g.isDefined)(t)?t:null}getPhysicalFromRenderableIndex(e){let t=this.renderablePhysicalIndexesCache[e];return(0,g.isDefined)(t)?t:null}getVisualFromPhysicalIndex(e){let t=this.fromPhysicalToVisualIndexesCache.get(e);return(0,g.isDefined)(t)?t:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){let t=this.fromVisualToRenderableIndexesCache.get(e);return(0,g.isDefined)(t)?t:null}getNearestNotHiddenIndex(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===this.getPhysicalFromVisualIndex(e))return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;let i=Array.from(this.fromVisualToRenderableIndexesCache.keys()),n=-1;return -1===(n=t>0?i.findIndex(t=>t>e):i.reverse().findIndex(t=>t<e))?r?this.getNearestNotHiddenIndex(e,-t,!1):null:i[n]}initToLength(){let e=arguments.length>
1340&&void 0!==arguments[0]?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...Array(e).keys()],this.notHiddenIndexesCache=[...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){let t=this.getNumberOfIndexes();if(e<t){let t=[...Array(this.getNumberOfIndexes()-e).keys()].map(t=>t+e);this.removeIndexes(t)}else this.insertIndexes(t,e-t)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){void 0===this.indexesChangeSource&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),"update"===this.indexesChangeSource&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return!0===e?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(e=>!1===this.isTrimmed(e))}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return!0===e?this.notHiddenIndexesCache:this.getIndexesSequence().filter(e=>!1===this.isHidden(e))}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return!0===e?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(e=>!1===this.isHidden(e))}getRenderableIndexesLength(){return this.getRenderableIndexes().length}
134getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,t){"number"==typeof e&&(e=[e]);let r=(0,i.arrayMap)(e,e=>this.getPhysicalFromVisualIndex(e)),n=this.getNotTrimmedIndexesLength(),o=e.length,s=(0,c.t)(this.getIndexesSequence(),r),a=s.filter(e=>!1===this.isTrimmed(e)),l=s.indexOf(a[a.length-1])+1;if(t+o<n){let e=a[t];l=s.indexOf(e)}this.indexesChangeSource="move",this.setIndexesSequence((0,c.S)(s,l,r)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"start",n=this.getNotTrimmedIndexes()[e],o=(0,g.isDefined)(n)?n:this.getNumberOfIndexes(),s=this.getIndexesSequence().includes(n)?this.getIndexesSequence().indexOf(n):this.getNumberOfIndexes(),a=(0,i.arrayMap)(Array(t).fill(o),(e,t)=>e+t);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(s,a),this.indexesChangeSource=void 0;let l="end"===r?a.map(e=>e+1):a;this.trimmingMapsCollection.insertToEvery(s,l),this.hidingMapsCollection.insertToEvery(s,l),this.variousMapsCollection.insertToEvery(s,l),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&&void 0!==arguments[0]&&arguments[0],t=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(!0===e||!1===this.isBatched&&!0===t)&&(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(){let e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let t=0;t<e;t+=1){let e=this.getPhysicalFromVisualIndex(t);this.fromPhysicalToVisualIndexesCache.set(e,t)}}cacheFromVisualToRenderableIndexes(){let e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let t=0;t<e;t+=1){let e=this.getPhysicalFromRenderableIndex(t),r=this.getVisualFromPhysicalIndex(e);this.fromVisualToRenderableIndexesCache.set(r,t)}}}(0,y.mixin)(L,m.Z)},98014:function(e,t,r){"use strict";r.d(t,{P:function(){return l},f:function(){return a}}),r(76346),r(70470),r(95984);var i=r(21927),n=r(92263),o=r(65166);let s=0;class a{constructor(){var e,t,r;e="collection",t=new Map,(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t}register(e,t){!1===this.collection.has(e)&&(this.collection.set(e,t),t.addLocalHook("change",()=>this.runLocalHooks("change",t)),s+=1)}unregister(e){let t=this.collection.get(e);(0,i.isDefined)(t)&&(t.destroy(),this.collection.delete(e),this.runLocalHooks("change",t),s-=1)}unregisterAll(){this.collection.forEach((e,t)=>this.unregister(t)),this.collection.clear()}get(e){return(0,i.isUndefined)(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(t=>{t.remove(e)})}insertToEvery(e,t){this.collection.forEach(r=>{r.insert(e,t)})}initEvery(e){this.collection.forEach(t=>{t.init(e)})}}function l(){return s}(0,n.mixin)(a,o.Z)},49559:function(e,t,r){"use strict";r.d(t,{o:function(){return o}}),r(65230);var i=r(38231),n=r(22386);class o extends i.L{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(e)}getHiddenIndexes(){return(0,n.arrayReduce)(this.getValues(),(e,t,r)=>(t&&e.push(r),e),[])}}},27861:function(e,t,r){"use strict";r.d(t,{n:function(){return l}}),r(76346),r(65230);var i=r(47771),n=r(92263),o=r(37710),s=r(65166);function a(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class l{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a(this,"indexedValues",[]),a(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){let t=this.indexedValues;if(e<t.length)return t[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,t){return e<this.indexedValues.length&&(this.indexedValues[e]=t,this.runLocalHooks("change"),!0)}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,(0,o.isFunction)(this.initValueOrFn)?(0,i.rangeEach)(e-1,e=>this.indexedValues.push(this.initValueOrFn(e))):(0,i.rangeEach)(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}}(0,n.mixin)(l,s.Z)},84616:function(e,t,r){"use strict";r.d(t,{b:function(){return s}});var i=r(27861),n=r(66128),o=r(45116);class s extends i.n{constructor(){super(e=>e)}insert(e,t){let r=(0,o.X)(this.indexedValues,t);this.indexedValues=(0,n.S)(r,e,t),super.insert(e,t)}remove(e){let t=(0,n.t)(this.indexedValues,e);this.indexedValues=(0,o.i)(t,e),super.remove(e)}}},25778:function(e,t,r){"use strict";r.d(t,{A:function(){return l}}),r(76346),r(70470),r(17901);var i=r(27861),n=r(65624),o=r(66128),s=r(45116),a=r(37710);class l extends i.n{constructor(){var e,t,r;super(...arguments),t=[],(e="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}
134(e="orderOfIndexes","string"))?r:r+"")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length&&(this.indexedValues[e]=t,!1===this.orderOfIndexes.includes(e)&&this.orderOfIndexes.splice(r,0,e),this.runLocalHooks("change"),!0)}clearValue(e){this.orderOfIndexes=(0,o.t)(this.orderOfIndexes,[e]),(0,a.isFunction)(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,t){this.indexedValues=(0,n.S)(this.indexedValues,e,t,this.initValueOrFn),this.orderOfIndexes=(0,s.X)(this.orderOfIndexes,t),super.insert(e,t)}remove(e){this.indexedValues=(0,n.t)(this.indexedValues,e),this.orderOfIndexes=(0,o.t)(this.orderOfIndexes,e),this.orderOfIndexes=(0,s.i)(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}},38231:function(e,t,r){"use strict";r.d(t,{L:function(){return o}});var i=r(27861),n=r(65624);class o extends i.n{insert(e,t){this.indexedValues=(0,n.S)(this.indexedValues,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){this.indexedValues=(0,n.t)(this.indexedValues,e),super.remove(e)}}},88579:function(e,t,r){"use strict";r.d(t,{n:function(){return o}}),r(65230);var i=r(38231),n=r(22386);class o extends i.L{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(e)}getTrimmedIndexes(){return(0,n.arrayReduce)(this.getValues(),(e,t,r)=>(t&&e.push(r),e),[])}}},45116:function(e,t,r){"use strict";r.d(t,{X:function(){return o},i:function(){return n}}),r(70470),r(52419);var i=r(22386);function n(e,t){return(0,i.arrayMap)(e,e=>e-t.filter(t=>t<e).length)}function o(e,t){let r=t[0],n=t.length;return(0,i.arrayMap)(e,e=>e>=r?e+n:e)}},66128:function(e,t,r){"use strict";r.d(t,{S:function(){return n},t:function(){return o}});var i=r(22386);function n(e,t,r){return[...e.slice(0,t),...r,...e.slice(t)]}function o(e,t){return(0,i.arrayFilter)(e,e=>!1===t.includes(e))}},65624:function(e,t,r){"use strict";r.d(t,{S:function(){return o},t:function(){return s}}),r(70470),r(17901);var i=r(37710),n=r(22386);function o(e,t,r,n){let o=r.length?r[0]:void 0;return[...e.slice(0,o),...r.map((e,t)=>(0,i.isFunction)(n)?n(e,t):n),...void 0===o?[]:e.slice(o)]}function s(e,t){return(0,n.arrayFilter)(e,(e,r)=>!1===t.includes(r))}},71660:function(e,t,r){"use strict";r.d(t,{N9:function(){return o},Tz:function(){return s},xQ:function(){return a}});let i=null,n=0;function o(e){let t=e.ownerDocument;if(!i){(i=t.createElement("div")).setAttribute("role","status"),i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true");let r=i.style;r.position="absolute",r.width="1px",r.height="1px",r.margin="-1px",r.overflow="hidden",r.clipPath="rect(0 0 0 0)",r.whiteSpace="nowrap",e.appendChild(i)}n+=1}function s(){0!==n&&(1===n&&(i.remove(),i=null),n-=1)}function a(e){i&&(i.textContent="",setTimeout(()=>{i&&(i.textContent=e)},100))}},9211:function(e,t,r){"use strict";function i(e,t,r){e.addEventListener(t,r,!1)}function n(e,t,r){e.removeEventListener(t,r,!1)}function o(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function s(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:e=>e.value,...r},a=e.body,l=e.createTextNode(""),h=e.createElement("span");function u(){var e,r;l.textContent=s.textContent(t),h.style.position="absolute",h.style.fontSize=o(t).fontSize,h.style.fontFamily=o(t).fontFamily,h.style.whiteSpace="pre",a.appendChild(h);let i=parseInt((null===(e=o(t))||void 0===e?void 0:e.paddingInlineStart)||0,10),n=parseInt((null===(r=o(t))||void 0===r?void 0:r.paddingInlineEnd)||0,10),u=h.clientWidth+i+n+1;a.removeChild(h);let c=t.style;c.height=`${s.minHeight}px`,s.minWidth>u?c.width=`${s.minWidth}px`:u>s.maxWidth?c.width=`${s.maxWidth}px`:c.width=`${u}px`;let d=t.scrollHeight?t.scrollHeight-1:0;s.minHeight>d?c.height=`${s.minHeight}px`:s.maxHeight<d?(c.height=`${s.maxHeight}px`,c.overflowY="visible"):c.height=`${d}px`}function c(){e.defaultView.setTimeout(u,0)}return{init:function(e,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=e,function(e){if(e&&e.minHeight){if("inherit"===e.minHeight)s.minHeight=t.clientHeight;else{let t=parseInt(e.minHeight,10);isNaN(t)||(s.minHeight=t)}}if(e&&e.maxHeight){if("inherit"===e.maxHeight)s.maxHeight=t.clientHeight;else{let t=parseInt(e.maxHeight,10);isNaN(t)||(s.maxHeight=t)}}if(e&&e.minWidth){if("inherit"===e.minWidth)s.minWidth=t.clientWidth;else{let t=parseInt(e.minWidth,10);isNaN(t)||(s.minWidth=t)}}if(e&&e.maxWidth){if("inherit"===e.maxWidth)s.maxWidth=t.clientWidth;else{let t=parseInt(e.maxWidth,10);isNaN(t)||(s.maxWidth=t)}}h.firstChild||(h.className="autoResize",h.style.display="inline-block",h.appendChild(l))}(r),"TEXTAREA"===t.nodeName&&(t.style.resize="none",t.style.height=`${s.minHeight}px`,t.style.minWidth=`${s.minWidth}px`,t.style.maxWidth=`${s.maxWidth}px`,t.style.overflowY="hidden"),n&&(i(t,"input",u),i(t,"keydown",c)),u()},resize:u,unObserve(){n(t,"input",u),n(t,"keydown",c)}}}r.d(t,{x:function(){return s}})},94896:function(e,t,r){"use strict";r.d(t,{I:function(){return o}}),r(76346),r(70470),r(88514);var i=r(37710);let n=e=>`The id '${e}' is already declared in a map.`;function o(){let{errorIdExists:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Map;function r(){return[...t]}function o(e){return t.has(e)}return e=(0,i.isFunction)(e)?e:n,{addItem:function(r,i){if(o(r))throw Error(e(r));t.set(r,i)},clear:function(){t.clear()}
134,getId:function(e){let[t]=r().find(t=>{let[r,i]=t;return e===i&&r})||[null];return t},getItem:function(e){return t.get(e)},getItems:r,getValues:function(){return[...t.values()]},hasItem:o,removeItem:function(e){return t.delete(e)}}}},38005:function(e,t,r){"use strict";r(76346),r(65230),r(70470),r(95984);var i=r(46879),n=r(22386);function o(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class s{constructor(e){o(this,"hot",null),o(this,"container",null),o(this,"injected",!1),o(this,"rows",[]),o(this,"columns",[]),o(this,"samples",null),o(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,t){if(this.columns.length)throw Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));let r={row:e};this.rows.push(r),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}addColumnHeadersRow(e){if(null!=this.hot.getColHeader(0)){let t={row:-1};this.rows.push(t),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),t.table=this.table.table}}addColumn(e,t){if(this.rows.length)throw Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));let r={col:e};this.columns.push(r),this.samples=t,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&null!==this.hot.getColHeader(e)&&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),r.table=this.table.table}getHeights(e){this.injected||this.injectTable(),(0,n.arrayEach)(this.rows,t=>{let{height:r}=t.table.getBoundingClientRect();e(t.row,Math.ceil(r))})}getWidths(e){this.injected||this.injectTable(),(0,n.arrayEach)(this.columns,t=>{let{width:r}=t.table.getBoundingClientRect();e(t.col,Math.ceil(r))})}setSettings(e){this.settings=e}setSetting(e,t){this.settings||(this.settings={}),this.settings[e]=t}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){let t=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&t.appendChild(this.createColElement(-1,-1)),this.samples.forEach(r=>{(0,n.arrayEach)(r.strings,r=>{t.appendChild(this.createColElement(r.col,e))})}),t}createRow(e){let{rootDocument:t}=this.hot,r=t.createDocumentFragment(),i=t.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),r.appendChild(i)),this.samples.forEach(i=>{(0,n.arrayEach)(i.strings,i=>{let n=i.col,o=this.hot.getCellMeta(e,n),s=this.hot.getCellRenderer(o),a=t.createElement("td");a.setAttribute("ghost-table",1),s(this.hot,a,e,n,this.hot.colToProp(n),i.value,o),r.appendChild(a)})}),r}appendColumnHeadersRow(){let{rootDocument:e}=this.hot,t=e.createDocumentFragment(),r=[];if(this.hot.hasRowHeaders()){let i=e.createElement("th");r.push([-1,i]),t.appendChild(i)}this.samples.forEach(i=>{(0,n.arrayEach)(i.strings,i=>{let n=i.col,o=e.createElement("th");r.push([n,o]),t.appendChild(o)})}),this.table.tHead.appendChild(t),(0,n.arrayEach)(r,e=>{let[t,r]=e;this.hot.view.appendColHeader(t,r)})}createCol(e){let{rootDocument:t}=this.hot,r=t.createDocumentFragment();return this.samples.forEach(i=>{(0,n.arrayEach)(i.strings,i=>{let n=i.row,o=this.hot.getCellMeta(n,e),s=this.hot.getCellRenderer(o),a=t.createElement("td"),l=t.createElement("tr");a.setAttribute("ghost-table",1),s(this.hot,a,n,e,this.hot.colToProp(e),i.value,o),l.appendChild(a),r.appendChild(l)})}),r}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&&void 0!==arguments[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,t){let r=this.hot.rootDocument.createElement("col"),i=0;t>=0&&e>=0&&(i=this.hot.getCellMeta(t,e).colspan);let n=this.hot.getColWidth(e);if(i>1)for(let t=e+1;t<e+i;t++)n+=this.hot.getColWidth(t);return r.style.width=`${n}px`,r}createTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",{rootDocument:t}=this.hot,r=t.createDocumentFragment(),n=t.createElement("table"),o=t.createElement("thead"),s=t.createElement("tbody"),a=t.createElement("colgroup"),l=t.createElement("tr"),h=t.createElement("th");return this.isVertical()&&n.appendChild(a),this.isHorizontal()&&(l.appendChild(h),o.appendChild(l),n.style.tableLayout="auto",n.style.width="auto"),n.appendChild(o),this.isVertical()&&s.appendChild(l),n.appendChild(s),(0,i.addClass)(n,e),r.appendChild(n),{fragment:r,table:n,tHead:o,tBody:s,colGroup:a,tr:l,th:h}}createContainer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",{rootDocument:t}=this.hot,r=t.createDocumentFragment(),n=t.createElement("div"),o=`htGhostTable htAutoSize ${e.trim()}`;return(0,i.addClass)(n,o),r.appendChild(n),{fragment:r,container:n}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}}t.Z=s},81146:function(e,t,r){"use strict";r.r(t),r.d(t,{_dataToHTML:function(){return a},htmlToGridSettings:function(){return l},instanceToHTML:function(){return s}}),r(65230),r(12928),r(70470),r(52419),r(17901),r(85411);var i=r(21927);let n={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},o=RegExp(Object.keys(n).map(e=>`(${e})`).join("|"),"gi");function s(e){let t=e.hasColHeaders(),r=e.hasRowHeaders(),n=[t?-1:0,r?-1:0,e.countRows()-1,e.countCols()-1],o=e.getData(...n),s=o.length,a=s>0?o[0].length:0,l=["<table>","</table>"],h=t?["<thead>","</thead>"]:[],u=["<tbody>","</tbody>"],c=r?1:0,d=t?1:0;for(let n=0;n<s;n+=1){let s=t&&0===n,l=[];for(let t=0;t<a;t+=1){let a=!s&&r&&0===t,h="";if(s)h=`<th>${e.getColHeader(t-c)}</th>`;else if(a)h=`<th>${e.getRowHeader(n-d)}</th>`;else{let r=o[n][t],{hidden:s,rowspan:a,colspan:l}=e.getCellMeta(n-d,t-c);if(!s){let e=[];
134if(a&&e.push(`rowspan="${a}"`),l&&e.push(`colspan="${l}"`),(0,i.isEmpty)(r))h=`<td ${e.join(" ")}></td>`;else{let t=r.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");h=`<td ${e.join(" ")}>${t}</td>`}}}l.push(h)}let g=["<tr>",...l,"</tr>"].join("");s?h.splice(1,0,g):u.splice(-1,0,g)}return l.splice(1,0,h.join(""),u.join("")),l.join("")}function a(e){let t=e.length,r=["<table>"];for(let n=0;n<t;n+=1){let o=e[n],s=o.length,a=[];0===n&&r.push("<tbody>");for(let e=0;e<s;e+=1){let t=o[e],r=(0,i.isEmpty)(t)?"":t.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20{2,}/gi,e=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(e.length-1)} </span>`).replace(/\t/gi,"&#9;");a.push(`<td>${r}</td>`)}r.push("<tr>",...a,"</tr>"),n+1===t&&r.push("</tbody>")}return r.push("</table>"),r.join("")}function l(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,i={},s=r.createDocumentFragment(),a=r.createElement("div");s.appendChild(a);let l=e;if("string"==typeof l){let e=l.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,e=>{let t=e.match(/<td\b[^>]*?>/g)[0],r=e.substring(t.length,e.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(/<p.*?>/g,"\n").replace("\n","").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^&nbsp;$/mg,"");return`${t}${r}</td>`});a.insertAdjacentHTML("afterbegin",`${e}`),l=a.querySelector("table")}if(!l||"TABLE"!==((t=l)&&t.nodeName||""))return;let h=a.querySelector('meta[name$="enerator"]'),u=null!==l.querySelector("tbody th"),c=l.querySelector("tr"),d=c?Array.from(c.cells).reduce((e,t)=>e+t.colSpan,0)-(u?1:0):0,g=l.tFoot&&Array.from(l.tFoot.rows)||[],p=[],f=!1,m=0,y=0;if(l.tHead){let e=Array.from(l.tHead.rows).filter(e=>{let t=null!==e.querySelector("td");return t&&p.push(e),!t});f=(m=e.length)>0,m>1?i.nestedHeaders=Array.from(e).reduce((e,t)=>{let r=Array.from(t.cells).reduce((e,t,r)=>{if(u&&0===r)return e;let{colSpan:i,innerHTML:n}=t;return e.push(i>1?{label:n,colspan:i}:n),e},[]);return e.push(r),e},[]):f&&(i.colHeaders=Array.from(e[0].children).reduce((e,t,r)=>(u&&0===r||e.push(t.innerHTML),e),[]))}p.length&&(i.fixedRowsTop=p.length),g.length&&(i.fixedRowsBottom=g.length);let w=[...p,...Array.from(l.tBodies).reduce((e,t)=>(e.push(...Array.from(t.rows)),e),[]),...g],E=Array(y=w.length);for(let e=0;e<y;e++)E[e]=Array(d);let S=[],C=[];for(let e=0;e<y;e++){let t=Array.from(w[e].cells),r=t.length;for(let i=0;i<r;i++){let r=t[i],{nodeName:s,innerHTML:a,rowSpan:l,colSpan:u}=r,c=E[e].findIndex(e=>void 0===e);if("TD"===s){if(l>1||u>1){for(let t=e;t<e+l;t++)if(t<y)for(let e=c;e<c+u;e++)E[t][e]=null;let t=r.getAttribute("style");t&&t.includes("mso-ignore:colspan")||S.push({col:c,row:e,rowspan:l,colspan:u})}let t="";t=h&&/excel/gi.test(h.content)?a.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,"\r\n"):a.replace(/<br(\s*|\/)>[\r\n]?/gim,"\r\n"),E[e][c]=t.replace(o,e=>n[e])}else C.push(a)}}return S.length&&(i.mergeCells=S),C.length&&(i.rowHeaders=C),E.length&&(i.data=E),i}},31285:function(e,t,r){"use strict";r.d(t,{IU:function(){return o},_v:function(){return a},dU:function(){return s},mc:function(){return n}});let i=new WeakMap,n=Symbol("rootInstance");function o(e){i.set(e,!0)}function s(e){return e===n}function a(e){return i.has(e)}},14216:function(e,t,r){"use strict";r.d(t,{BK:function(){return o},Qv:function(){return n}});let i=new Map;function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"common";i.has(e)||i.set(e,new Map);let t=i.get(e);return{register:function(e,r){t.set(e,r)},getItem:function(e){return t.get(e)},hasItem:function(e){return t.has(e)},getNames:function(){return[...t.keys()]},getValues:function(){return[...t.values()]},clear:function(){i.delete(e),t.clear()}}}function o(e,t){var r;return null==i||null===(r=i.get(e.guid))||void 0===r?void 0:r.get(t)}},6857:function(e,t,r){"use strict";r.d(t,{l:function(){return E}}),r(76346),r(70470),r(95984);var i=r(26247);function n(e,t,r){o(e,t),t.set(e,r)}function o(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function s(e,t){return e.get(l(e,t))}function a(e,t,r){return e.set(l(e,t),r),r}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap,g=new WeakMap,p=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakMap,w=new WeakSet;class E{constructor(e){let{hot:t,rootElement:r,rootDocument:i,onThemeChange:s=()=>{}}=e;o(this,w),w.add(this),n(this,h,void 0),n(this,u,void 0),n(this,c,void 0),n(this,d,void 0),n(this,g,void 0),n(this,p,!0),n(this,f,{}),n(this,m,{}),n(this,y,void 0),a(h,this,t),a(c,this,r),a(g,this,i),a(y,this,s)}isClassicTheme(){return s(p,this)}getCSSVariableValue(e){var t;if(s(p,this))return null;if(s(f,this)[`--ht-${e}`])return s(f,this)[`--ht-${e}`];let r=null!==(t=l(w,this,b).call(this,`--ht-${e}`))&&void 0!==t?t:l(w,this,T).call(this,`--ht-${e}`);if(null!==r)return s(f,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var t;return null===(t=s(m,this))||void 0===t?void 0:t.td[e]}getDefaultRowHeight(e){if(s(p,this))return 23;let t=l(w,this,S).call(this);return t?void 0!==e&&e===s(h,this).view.getFirstRenderedVisibleRow()?t+1:t:23}areCellsBorderBox(){return"border-box"===this.getStyleForTD("box-sizing")}useTheme(e){if(!e){a(u,this,void 0),a(p,this,!0),s(y,this).call(this,s(u,this)),l(w,this,C).call(this);return}if(e&&e!==s(u,this)){if(!/ht-theme-.*/.test(e)){(0,i.ZK)(`Invalid theme name: ${e}. Please provide a valid theme name.`),a(u,this,void 0),a(p,this,!1),s(y,this).call(this,s(u,this)),l(w,this,C).call(this);return}s(u,this)&&l(w,this,N).call(this),a(u,this,e),a(p,this,!1),s(y,this).call(this,s(u,this)),l(w,this,C).call(this)}}getThemeName(){return s(u,this)}}function S(){let e=this.getCSSVariableValue("line-height"),t=this.getCSSVariableValue("cell-vertical-padding"),r=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return null===e||null===t||isNaN(r)?null:e+2*t+r}function C(){this.isClassicTheme()||a(d,this,getComputedStyle(s(c,this)));let e=l(w,this,R).call(this,["box-sizing","border-bottom-width"]);s(m,this).td={...s(m,this).td,"box-sizing":e["box-sizing"],"border-bottom-width":e["border-bottom-width"]}}function R(e){let t=s(g,this),r=s(c,this),i=t.createElement("table"),n=t.createElement("tbody"),o=t.createElement("tr"),a=t.createElement("tr"),l=t.createElement("td");a.appendChild(l),n.appendChild(o),n.appendChild(a),i.appendChild(n),r.appendChild(i);let h=getComputedStyle(l),u={};
134return e.forEach(e=>{u[e]=h.getPropertyValue(e)}),r.removeChild(i),u}function b(e){let t=Math.ceil(parseFloat(l(w,this,T).call(this,e)));return Number.isNaN(t)?null:t}function T(e){let t=s(d,this).getPropertyValue(e);return""===t?null:t}function N(){a(m,this,{}),a(f,this,{}),a(p,this,!0)}},73888:function(e,t,r){"use strict";r.d(t,{I:function(){return n},l:function(){return o}});var i=r(37710);function n(e,t){let{instance:r,visualRow:n,visualCol:o,valueSetter:s}=t;return(0,i.isFunction)(s)?s.call(r,e,n,o,t):e}function o(e,t){let{instance:r,visualRow:n,visualCol:o,valueGetter:s}=t;return(0,i.isFunction)(s)?s.call(r,e,n,o,t):e}},92809:function(e,t,r){"use strict";r.d(t,{Ie:function(){return h},Te:function(){return l},k_:function(){return s},oh:function(){return o}}),r(76346);let{register:i,getItem:n,hasItem:o,getNames:s,getValues:a}=(0,r(14216).Qv)("validators");function l(e){if("function"==typeof e)return e;if(!o(e))throw Error(`No registered validator found under "${e}" name`);return n(e)}function h(e,t){"string"!=typeof e&&(e=(t=e).VALIDATOR_TYPE),i(e,t)}},58485:function(e,t,r){"use strict";r.d(t,{CZ:function(){return u},V$:function(){return a},W9:function(){return c},gG:function(){return h},nI:function(){return l}});var i=r(31387),n=r(57035),o=r(68940),s=r(79882);function a(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"start"in e&&(0,i.y8)(e.start)&&"end"in e&&(0,i.y8)(e.end)}let l=(e,t)=>({start:e,end:t});class h{constructor(e,t){if(e.sheet!==t.sheet)throw new n.Uk(e.sheet,t.sheet);this.start=(0,i.mT)(e.sheet,e.col,e.row),this.end=(0,i.mT)(t.sheet,t.col,t.row)}get sheet(){return this.start.sheet}static fromSimpleCellAddresses(e,t){if(e.sheet!==t.sheet)throw new n.Uk(e.sheet,t.sheet);let r=t.col-e.col,i=t.row-e.row;return Number.isFinite(i)&&Number.isFinite(r)?new h(e,t):Number.isFinite(i)?new c(e.sheet,e.row,t.row):new u(e.sheet,e.col,t.col)}static fromAst(e,t){return e.type===o.W$.CELL_RANGE?h.fromCellRange(e,t):e.type===o.W$.COLUMN_RANGE?u.fromColumnRange(e,t):c.fromRowRangeAst(e,t)}static fromAstOrUndef(e,t){try{return h.fromAst(e,t)}catch(e){return}}static fromCellRange(e,t){return new h(e.start.toSimpleCellAddress(t),e.end.toSimpleCellAddress(t))}static spanFrom(e,t,r){let i=h.spanFromOrUndef(e,t,r);if(void 0===i)throw Error("AbsoluteCellRange: Wrong range size");return i}static spanFromOrUndef(e,t,r){if(!Number.isFinite(t)&&Number.isFinite(r)){if(0!==e.col)return;return new c(e.sheet,e.row,e.row+r-1)}if(!Number.isFinite(r)&&Number.isFinite(t)){if(0!==e.row)return;return new u(e.sheet,e.col,e.col+t-1)}if(Number.isFinite(r)&&Number.isFinite(t))return new h(e,(0,i.mT)(e.sheet,e.col+t-1,e.row+r-1))}static fromCoordinates(e,t,r,n,o){return new h((0,i.mT)(e,t,r),(0,i.mT)(e,n,o))}isFinite(){return Number.isFinite(this.size())}doesOverlap(e){return this.start.sheet==e.start.sheet&&!(this.end.row<e.start.row)&&!(this.start.row>e.end.row)&&!(this.end.col<e.start.col)&&!(this.start.col>e.end.col)}addressInRange(e){return this.sheet===e.sheet&&this.start.row<=e.row&&this.end.row>=e.row&&this.start.col<=e.col&&this.end.col>=e.col}columnInRange(e){return this.sheet===e.sheet&&this.start.col<=e.col&&this.end.col>=e.col}rowInRange(e){return this.sheet===e.sheet&&this.start.row<=e.row&&this.end.row>=e.row}containsRange(e){return this.addressInRange(e.start)&&this.addressInRange(e.end)}intersectionWith(e){if(this.sheet!==e.start.sheet)return;let t=Math.max(this.start.row,e.start.row),r=Math.min(this.end.row,e.end.row),n=Math.max(this.start.col,e.start.col),o=Math.min(this.end.col,e.end.col);if(!(t>r)&&!(n>o))return new h((0,i.mT)(this.sheet,n,t),(0,i.mT)(this.sheet,o,r))}includesRow(e){return this.start.row<e&&this.end.row>=e}includesColumn(e){return this.start.col<e&&this.end.col>=e}shiftByRows(e){this.start.row+=e,this.end.row+=e}expandByRows(e){this.end.row+=e}shiftByColumns(e){this.start.col+=e,this.end.col+=e}shifted(e,t){return h.spanFrom((0,i.mT)(this.sheet,this.start.col+e,this.start.row+t),this.width(),this.height())}expandByColumns(e){this.end.col+=e}moveToSheet(e){this.start.sheet=e,this.end.sheet=e}removeSpan(e){e instanceof s.$?this.removeRows(e.start,e.end):this.removeColumns(e.start,e.end)}
134shouldBeRemoved(){return 0>=this.width()||0>=this.height()}rangeWithSameWidth(e,t){return h.spanFrom((0,i.mT)(this.sheet,this.start.col,e),this.width(),t)}rangeWithSameHeight(e,t){return h.spanFrom((0,i.mT)(this.sheet,e,this.start.row),t,this.height())}toString(){return`${this.start.sheet},${this.start.col},${this.start.row},${this.end.col},${this.end.row}`}width(){return this.end.col-this.start.col+1}height(){return this.end.row-this.start.row+1}size(){return this.height()*this.width()}arrayOfAddressesInRange(){let e=[];for(let t=0;t<this.height();++t){e[t]=[];for(let r=0;r<this.width();++r){let n=(0,i.mT)(this.sheet,this.start.col+r,this.start.row+t);e[t].push(n)}}return e}withStart(e){return new h(e,this.end)}sameDimensionsAs(e){return this.width()===e.width()&&this.height()===e.height()}sameAs(e){return(0,i.PO)(this.start,e.start)&&(0,i.PO)(this.end,e.end)}addressesArrayMap(e,t){let r=[],n=this.start.row;for(;n<=this.effectiveEndRow(e);){let o=this.start.col,s=[];for(;o<=this.effectiveEndColumn(e);)s.push(t((0,i.mT)(this.start.sheet,o,n))),o++;r.push(s),n++}return r}addresses(e){let t=[],r=this.start.row,n=this.effectiveEndRow(e),o=this.effectiveEndColumn(e);for(;r<=n;){let e=this.start.col;for(;e<=o;)t.push((0,i.mT)(this.start.sheet,e,r)),e++;r++}return t}*addressesWithDirection(e,t,r){if(e>0){if(t>0){let e=this.effectiveEndRow(r);for(;e>=this.start.row;){let t=this.effectiveEndColumn(r);for(;t>=this.start.col;)yield(0,i.mT)(this.start.sheet,t,e),t-=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(r);){let t=this.effectiveEndColumn(r);for(;t>=this.start.col;)yield(0,i.mT)(this.start.sheet,t,e),t-=1;e+=1}}}else if(t>0){let e=this.effectiveEndRow(r);for(;e>=this.start.row;){let t=this.start.col;for(;t<=this.effectiveEndColumn(r);)yield(0,i.mT)(this.start.sheet,t,e),t+=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(r);){let t=this.start.col;for(;t<=this.effectiveEndColumn(r);)yield(0,i.mT)(this.start.sheet,t,e),t+=1;e+=1}}}getAddress(e,t){if(e<0||t<0||t>this.height()-1||e>this.width()-1)throw Error("Index out of bound");return(0,i.mT)(this.start.sheet,this.start.col+e,this.start.row+t)}exceedsSheetSizeLimits(e,t){return this.end.col>=e||this.end.row>=t}effectiveEndColumn(e){return this.end.col}effectiveEndRow(e){return this.end.row}effectiveWidth(e){return this.width()}effectiveHeight(e){return this.height()}removeRows(e,t){if(!(e>this.end.row)){if(t<this.start.row)return this.shiftByRows(-(t-e+1));e<=this.start.row&&(this.start.row=e),this.end.row-=Math.min(t,this.end.row)-e+1}}removeColumns(e,t){if(!(e>this.end.col)){if(t<this.start.col)return this.shiftByColumns(-(t-e+1));e<=this.start.col&&(this.start.col=e),this.end.col-=Math.min(t,this.end.col)-e+1}}}class u extends h{constructor(e,t,r){super((0,i.mT)(e,t,0),(0,i.mT)(e,r,Number.POSITIVE_INFINITY))}static fromColumnRange(e,t){let r=e.start.toSimpleColumnAddress(t),i=e.end.toSimpleColumnAddress(t);if(r.sheet!==i.sheet)throw new n.Uk(r.sheet,i.sheet);return new u(r.sheet,r.col,i.col)}shouldBeRemoved(){return 0>=this.width()}shiftByRows(e){}expandByRows(e){}shifted(e,t){return new u(this.sheet,this.start.col+e,this.end.col+e)}rangeWithSameHeight(e,t){return new u(this.sheet,e,e+t-1)}exceedsSheetSizeLimits(e,t){return this.end.col>=e}effectiveEndRow(e){return this.effectiveHeight(e)-1}effectiveHeight(e){return e.getSheetHeight(this.sheet)}removeRows(e,t){}}class c extends h{constructor(e,t,r){super((0,i.mT)(e,0,t),(0,i.mT)(e,Number.POSITIVE_INFINITY,r))}static fromRowRangeAst(e,t){let r=e.start.toSimpleRowAddress(t),i=e.end.toSimpleRowAddress(t);if(r.sheet!==i.sheet)throw new n.Uk(r.sheet,i.sheet);return new c(r.sheet,r.row,i.row)}shouldBeRemoved(){return 0>=this.height()}shiftByColumns(e){}expandByColumns(e){}shifted(e,t){return new c(this.sheet,this.start.row+t,this.end.row+t)}rangeWithSameWidth(e,t){return new c(this.sheet,e,e+t-1)}exceedsSheetSizeLimits(e,t){return this.end.row>=t}effectiveEndColumn(e){return this.effectiveWidth(e)-1}effectiveWidth(e){return e.getSheetWidth(this.sheet)}removeColumns(e,t){}}},70149:function(e,t,r){"use strict";r.d(t,{J2:function(){return h},NU:function(){return s},Sw:function(){return o},XX:function(){return a},lK:function(){return l},mi:function(){return u}});var i=r(77080),n=r(57035);function o(e,t,r){if(void 0===e)return i.D.defaultConfig[r];if("string"==typeof t){if(typeof e===t)return e;throw new n.Qv(t,r)}if(t.includes(e))return e;throw new n.cO(t.map(e=>`'${e}'`).join(" "),r)}function s(e,t,r){if(e<r)throw new n.xr(t,r)}function a(e,t,r){if(e>r)throw new n.DX(t,r)}function l(e,t,r,o){if(t(e))return e;if(void 0===e)return i.D.defaultConfig[o];throw new n.Qv(r,o)}function h(...e){let t=new Map;
134e.forEach(e=>{let r=t.get(e.value)||[];r.push(e.name),t.set(e.value,r)});let r=[];for(let e of t.values())e.length>1&&r.push(e);if(r.length>0){r.forEach(e=>e.sort());let e=r.map(e=>`[${e}]`).join("; ");throw Error(`Config initialization failed. Parameters in conflict: ${e}`)}}function u(e,t,r){if(typeof e!==t)throw new n.Qv(t,r)}},90316:function(e,t,r){"use strict";r.d(t,{J:function(){return a},i:function(){return l}});var i=r(58485),n=r(47956),o=r(73338),s=r(68940);class a{constructor(e,t,r=!1){this.width=e,this.height=t,this.isRef=r}static error(){return new a(1,1,!0)}static scalar(){return new a(1,1,!1)}isScalar(){return 1===this.width&&1===this.height||this.isRef}}class l{constructor(e,t){this.config=e,this.functionRegistry=t}checkArraySize(e,t){return this.checkArraySizeForAst(e,{formulaAddress:t,arraysFlag:this.config.useArrayArithmetic})}checkArraySizeForAst(e,t){switch(e.type){case s.W$.FUNCTION_CALL:return this.checkArraySizeForFunction(e,t);case s.W$.COLUMN_RANGE:case s.W$.ROW_RANGE:case s.W$.CELL_RANGE:{let r=i.gG.fromAstOrUndef(e,t.formulaAddress);if(void 0===r)return a.error();return new a(r.width(),r.height(),!0)}case s.W$.ARRAY:{let r=[],i=[];for(let n of e.args){let e=n.map(e=>this.checkArraySizeForAst(e,t)),o=Math.min(...e.map(e=>e.height)),s=e.reduce((e,t)=>e+t.width,0);r.push(o),i.push(s)}return new a(Math.min(...i),r.reduce((e,t)=>e+t,0))}case s.W$.STRING:case s.W$.NUMBER:return a.scalar();case s.W$.CELL_REFERENCE:return new a(1,1,!0);case s.W$.DIV_OP:case s.W$.CONCATENATE_OP:case s.W$.EQUALS_OP:case s.W$.GREATER_THAN_OP:case s.W$.GREATER_THAN_OR_EQUAL_OP:case s.W$.LESS_THAN_OP:case s.W$.LESS_THAN_OR_EQUAL_OP:case s.W$.MINUS_OP:case s.W$.NOT_EQUAL_OP:case s.W$.PLUS_OP:case s.W$.POWER_OP:case s.W$.TIMES_OP:{let r=this.checkArraySizeForAst(e.left,t),i=this.checkArraySizeForAst(e.right,t);if(!t.arraysFlag&&(r.height>1||r.width>1||i.height>1||i.width>1))return a.error();return new a(Math.max(r.width,i.width),Math.max(r.height,i.height))}case s.W$.MINUS_UNARY_OP:case s.W$.PLUS_UNARY_OP:case s.W$.PERCENT_OP:{let r=this.checkArraySizeForAst(e.value,t);if(!t.arraysFlag&&(r.height>1||r.width>1))return a.error();return new a(r.width,r.height)}case s.W$.PARENTHESIS:return this.checkArraySizeForAst(e.expression,t);case s.W$.EMPTY:default:return a.error()}}checkArraySizeForFunction(e,t){let r=this.functionRegistry.getArraySizeFunction(e.procedureName);if(void 0!==r)return r(e,t);let i=this.functionRegistry.getMetadata(e.procedureName);if(void 0===i||i.expandRanges||!t.arraysFlag||i.vectorizationForbidden||void 0===i.parameters)return new a(1,1);let s=e.args.map(e=>{var r;return this.checkArraySizeForAst(e,new n.P(t.formulaAddress,t.arraysFlag||null!==(r=null==i?void 0:i.enableArrayArithmeticForArguments)&&void 0!==r&&r))}),l=[...i.parameters];if(void 0!==i.repeatLastArgs&&l.length<s.length&&(s.length-l.length)%i.repeatLastArgs!=0)return a.error();for(;l.length<s.length;){if(void 0===i.repeatLastArgs)return a.error();l.push(...l.slice(l.length-i.repeatLastArgs))}let h=1,u=1;for(let e=0;e<s.length;e++)l[e].argumentType!==o.Be.RANGE&&l[e].argumentType!==o.Be.ANY&&(u=Math.max(u,s[e].height),h=Math.max(h,s[e].width));return new a(h,u)}}},77023:function(e,t,r){"use strict";r.d(t,{FK:function(){return s},Ms:function(){return a},hm:function(){return l}});var i=r(90316),n=r(2714),o=r(15095);class s{constructor(e){this.size=e}width(){return this.size.width}height(){return this.size.height}get(e,t){throw Error("Array not computed yet.")}simpleRangeValue(){throw Error("Array not computed yet.")}}class a{constructor(e){if(this.size=new i.J(e.length>0?e[0].length:0,e.length),this.array=e,this.size.width<=0||this.size.height<=0)throw Error("Incorrect array size")}static fromInterpreterValue(e){return new a(e instanceof o.r?e.data:[[e]])}simpleRangeValue(){return o.r.onlyValues(this.array)}addRows(e,t){this.array.splice(e,0,...this.nullArrays(t,this.width())),this.size.height+=t}addColumns(e,t){for(let r=0;r<this.height();r++)this.array[r].splice(e,0,...Array(t).fill(n.OX));this.size.width+=t}removeRows(e,t){if(this.outOfBound(0,e)||this.outOfBound(0,t))throw Error("Array index out of bound");let r=t-e+1;this.array.splice(e,r),this.size.height-=r}removeColumns(e,t){if(this.outOfBound(e,0)||this.outOfBound(t,0))throw Error("Array index out of bound");let r=t-e+1;for(let t of this.array)t.splice(e,r);this.size.width-=r}nullArrays(e,t){let r=[];for(let i=0;i<e;
134++i)r.push(Array(t).fill(n.OX));return r}get(e,t){if(this.outOfBound(e,t))throw Error("Array index out of bound");return this.array[t][e]}set(e,t,r){if(this.outOfBound(e,t))throw Error("Array index out of bound");this.array[t][e]=r}width(){return this.size.width}height(){return this.size.height}raw(){return this.array}resize(e){if(this.height()<e.height&&isFinite(e.height)&&this.addRows(this.height(),e.height-this.height()),this.height()>e.height||(this.width()<e.width&&isFinite(e.width)&&this.addColumns(this.width(),e.width-this.width()),this.width()>e.width))throw Error("Resizing to smaller array")}outOfBound(e,t){return e<0||t<0||t>this.size.height-1||e>this.size.width-1}}class l{constructor(e,t){this.error=e,this.size=t}get(e,t){return this.error}width(){return this.size.width}height(){return this.size.height}simpleRangeValue(){return this.error}}},50926:function(e,t,r){"use strict";r.d(t,{s:function(){return eT}});var i,n,o=r(90316),s=r(88529),a=r(90745),l=r(77080),h=r(58485),u=r(31387),c=r(57035),d=r(40263),g=r(57123),p=r(28116),f=r(79882);class m{}class y extends m{constructor(e,t){super(),this.command=e,this.rowsRemovals=t}doUndo(e){e.undoRemoveRows(this)}doRedo(e){e.redoRemoveRows(this)}}class w extends m{constructor(e,t,r,i,n,o,s){super(),this.sourceLeftCorner=e,this.width=t,this.height=r,this.destinationLeftCorner=i,this.overwrittenCellsData=n,this.addedGlobalNamedExpressions=o,this.version=s}doUndo(e){e.undoMoveCells(this)}doRedo(e){e.redoMoveCells(this)}}class E extends m{constructor(e){super(),this.command=e}doUndo(e){e.undoAddRows(this)}doRedo(e){e.redoAddRows(this)}}class S extends m{constructor(e,t,r){super(),this.sheetId=e,this.rowMapping=t,this.oldContent=r}doUndo(e){e.undoSetRowOrder(this)}doRedo(e){e.redoSetRowOrder(this)}}class C extends m{constructor(e,t,r){super(),this.sheetId=e,this.columnMapping=t,this.oldContent=r}doUndo(e){e.undoSetColumnOrder(this)}doRedo(e){e.redoSetColumnOrder(this)}}class R extends m{constructor(e,t,r){super(),this.sheetId=e,this.oldSheetContent=t,this.newSheetContent=r}doUndo(e){e.undoSetSheetContent(this)}doRedo(e){e.redoSetSheetContent(this)}}class b extends m{constructor(e,t,r,i,n){super(),this.sheet=e,this.startRow=t,this.numberOfRows=r,this.targetRow=i,this.version=n,this.undoStart=this.startRow<this.targetRow?this.targetRow-this.numberOfRows:this.targetRow,this.undoEnd=this.startRow>this.targetRow?this.startRow+this.numberOfRows:this.startRow}doUndo(e){e.undoMoveRows(this)}doRedo(e){e.redoMoveRows(this)}}class T extends m{constructor(e,t,r,i,n){super(),this.sheet=e,this.startColumn=t,this.numberOfColumns=r,this.targetColumn=i,this.version=n,this.undoStart=this.startColumn<this.targetColumn?this.targetColumn-this.numberOfColumns:this.targetColumn,this.undoEnd=this.startColumn>this.targetColumn?this.startColumn+this.numberOfColumns:this.startColumn}doUndo(e){e.undoMoveColumns(this)}doRedo(e){e.redoMoveColumns(this)}}class N extends m{constructor(e){super(),this.command=e}doUndo(e){e.undoAddColumns(this)}doRedo(e){e.redoAddColumns(this)}}class A extends m{constructor(e,t){super(),this.command=e,this.columnsRemovals=t}doUndo(e){e.undoRemoveColumns(this)}doRedo(e){e.redoRemoveColumns(this)}}class I extends m{constructor(e,t){super(),this.sheetName=e,this.sheetId=t}doUndo(e){e.undoAddSheet(this)}doRedo(e){e.redoAddSheet(this)}}
134class M extends m{constructor(e,t,r,i){super(),this.sheetName=e,this.sheetId=t,this.oldSheetContent=r,this.scopedNamedExpressions=i}doUndo(e){e.undoRemoveSheet(this)}doRedo(e){e.redoRemoveSheet(this)}}class O extends m{constructor(e,t,r,i,n){super(),this.sheetId=e,this.oldName=t,this.newName=r,this.version=i,this.mergedPlaceholderSheetId=n}doUndo(e){e.undoRenameSheet(this)}doRedo(e){e.redoRenameSheet(this)}}class x extends m{constructor(e,t){super(),this.sheetId=e,this.oldSheetContent=t}doUndo(e){e.undoClearSheet(this)}doRedo(e){e.redoClearSheet(this)}}class _ extends m{constructor(e){super(),this.cellContents=e}doUndo(e){e.undoSetCellContents(this)}doRedo(e){e.redoSetCellContents(this)}}class P extends m{constructor(e,t,r,i){super(),this.targetLeftCorner=e,this.oldContent=t,this.newContent=r,this.addedGlobalNamedExpressions=i}doUndo(e){e.undoPaste(this)}doRedo(e){e.redoPaste(this)}}class L extends m{constructor(e,t,r,i){super(),this.name=e,this.newContent=t,this.scope=r,this.options=i}doUndo(e){e.undoAddNamedExpression(this)}doRedo(e){e.redoAddNamedExpression(this)}}class k extends m{constructor(e,t,r){super(),this.namedExpression=e,this.content=t,this.scope=r}doUndo(e){e.undoRemoveNamedExpression(this)}doRedo(e){e.redoRemoveNamedExpression(this)}}class D extends m{constructor(e,t,r,i,n){super(),this.namedExpression=e,this.newContent=t,this.oldContent=r,this.scope=i,this.options=n}doUndo(e){e.undoChangeNamedExpression(this)}doRedo(e){e.redoChangeNamedExpression(this)}}class H extends m{constructor(){super(...arguments),this.operations=[]}add(e){this.operations.push(e)}*reversedOperations(){for(let e=this.operations.length-1;e>=0;e--)yield this.operations[e]}doUndo(e){e.undoBatch(this)}doRedo(e){e.redoBatch(this)}}class B{constructor(e,t){this.operations=t,this.oldData=new Map,this.undoStack=[],this.redoStack=[],this.undoLimit=e.undoLimit}saveOperation(e){void 0!==this.batchUndoEntry?this.batchUndoEntry.add(e):this.addUndoEntry(e)}beginBatchMode(){this.batchUndoEntry=new H}commitBatchMode(){if(void 0===this.batchUndoEntry)throw Error("Batch mode wasn't started");this.addUndoEntry(this.batchUndoEntry),this.batchUndoEntry=void 0}storeDataForVersion(e,t,r){this.oldData.has(e)||this.oldData.set(e,[]),this.oldData.get(e).push([t,r])}clearRedoStack(){this.redoStack=[]}clearUndoStack(){this.undoStack=[]}isUndoStackEmpty(){return 0===this.undoStack.length}isRedoStackEmpty(){return 0===this.redoStack.length}undo(){let e=this.undoStack.pop();if(!e)throw Error("Attempted to undo without operation on stack");this.undoEntry(e),this.redoStack.push(e)}undoBatch(e){for(let t of e.reversedOperations())this.undoEntry(t)}undoRemoveRows(e){this.operations.forceApplyPostponedTransformations();let{command:{sheet:t},rowsRemovals:r}=e;for(let e=r.length-1;e>=0;--e){let i=r[e];for(let{address:e,cellType:r}of(this.operations.addRows(new g.aQ(t,[[i.rowFrom,i.rowCount]])),i.removedCells))this.operations.restoreCell(e,r);this.restoreOldDataFromVersion(i.version-1)}}undoRemoveColumns(e){this.operations.forceApplyPostponedTransformations();let{command:{sheet:t},columnsRemovals:r}=e;for(let e=r.length-1;e>=0;--e){let i=r[e];for(let{address:e,cellType:r}of(this.operations.addColumns(new g.pt(t,[[i.columnFrom,i.columnCount]])),i.removedCells))this.operations.restoreCell(e,r);this.restoreOldDataFromVersion(i.version-1)}}undoAddRows(e){let t=e.command.rowsSpans();for(let r=t.length-1;r>=0;--r){let i=t[r];this.operations.removeRows(new g.uO(e.command.sheet,[[i.rowStart,i.numberOfRows]]))}}undoAddColumns(e){let t=e.command.columnsSpans();for(let r=t.length-1;r>=0;--r){let i=t[r];this.operations.removeColumns(new g.HO(e.command.sheet,[[i.columnStart,i.numberOfColumns]]))}}undoSetCellContents(e){for(let t of e.cellContents){let e=t.address,[r,i]=t.oldContent;(0,u.PO)(e,r)||this.operations.setCellEmpty(e),this.operations.restoreCell(r,i)}}undoPaste(e){for(let t of(this.restoreOperationOldContent(e.oldContent),e.addedGlobalNamedExpressions))this.operations.removeNamedExpression(t)}undoMoveRows(e){let{sheet:t}=e;this.operations.moveRows(t,e.undoStart,e.numberOfRows,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveColumns(e){let{sheet:t}=e;this.operations.moveColumns(t,e.undoStart,e.numberOfColumns,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveCells(e){for(let t of(this.operations.forceApplyPostponedTransformations(),this.operations.moveCells(e.destinationLeftCorner,e.width,e.height,e.sourceLeftCorner),this.restoreOperationOldContent(e.overwrittenCellsData),this.restoreOldDataFromVersion(e.version-1),e.addedGlobalNamedExpressions))this.operations.removeNamedExpression(t)}undoAddSheet(e){let{sheetName:t}=e;this.operations.removeSheetByName(t)}undoRemoveSheet(e){this.operations.forceApplyPostponedTransformations();let{oldSheetContent:t,sheetId:r,scopedNamedExpressions:i,sheetName:n}=e;this.operations.addSheetWithId(r,n);for(let e=0;e<t.length;e++){let i=t[e];for(let t=0;t<i.length;t++){let n=i[t],o=(0,u.mT)(r,t,e);this.operations.restoreCell(o,n)}}for(let[e,t]of i)this.operations.restoreNamedExpression(e,t,r)}undoRenameSheet(e){this.operations.forceApplyPostponedTransformations(),this.operations.renameSheet(e.sheetId,e.oldName),void 0!==e.mergedPlaceholderSheetId&&void 0!==e.version&&(this.operations.addPlaceholderSheetWithId(e.mergedPlaceholderSheetId,e.newName),this.restoreOldDataFromVersion(e.version-1))}undoClearSheet(e){let{oldSheetContent:t,sheetId:r}=e;for(let e=0;e<t.length;e++){let i=t[e];for(let t=0;t<i.length;t++){let n=i[t],o=(0,u.mT)(r,t,e);this.operations.restoreCell(o,n)}}}undoSetSheetContent(e){let{oldSheetContent:t,sheetId:r}=e;this.operations.clearSheet(r);for(let e=0;e<t.length;e++){let i=t[e];for(let t=0;t<i.length;t++){let n=i[t],o=(0,u.mT)(r,t,e);this.operations.restoreCell(o,n)}}}undoAddNamedExpression(e){this.operations.removeNamedExpression(e.name,e.scope)}undoRemoveNamedExpression(e){this.operations.restoreNamedExpression(e.namedExpression,e.content,e.scope)}undoChangeNamedExpression(e){this.operations.restoreNamedExpression(e.namedExpression,e.oldContent,e.scope)}undoSetRowOrder(e){this.restoreOperationOldContent(e.oldContent)}undoSetColumnOrder(e){this.restoreOperationOldContent(e.oldContent)}redo(){let e=this.redoStack.pop();if(!e)throw Error("Attempted to redo without operation on stack");this.redoEntry(e),this.undoStack.push(e)}redoBatch(e){for(let t of e.operations)this.redoEntry(t)}redoRemoveRows(e){this.operations.removeRows(e.command)}redoMoveCells(e){this.operations.moveCells(e.sourceLeftCorner,e.width,e.height,e.destinationLeftCorner)}redoRemoveColumns(e){this.operations.removeColumns(e.command)}redoPaste(e){let{targetLeftCorner:t,newContent:r}=e,i=r.length,n=r[0].length;for(let e=0;e<i;++e)for(let i=0;i<n;++i){let n=(0,u.mT)(t.sheet,t.col+i,t.row+e);this.operations.restoreCell(n,r[e][i])}}redoSetCellContents(e){for(let t of e.cellContents)this.operations.setCellContent(t.address,t.newContent)}redoAddRows(e){this.operations.addRows(e.command)}redoAddColumns(e){this.operations.addColumns(e.command)}redoRemoveSheet(e){this.operations.removeSheetByName(e.sheetName)}redoAddSheet(e){this.operations.addSheetWithId(e.sheetId,e.sheetName)}redoRenameSheet(e){this.operations.renameSheet(e.sheetId,e.newName)}redoMoveRows(e){this.operations.moveRows(e.sheet,e.startRow,e.numberOfRows,e.targetRow)}redoMoveColumns(e){this.operations.moveColumns(e.sheet,e.startColumn,e.numberOfColumns,e.targetColumn)}redoClearSheet(e){this.operations.clearSheet(e.sheetId)}redoSetSheetContent(e){let{sheetId:t,newSheetContent:r}=e;this.operations.setSheetContent(t,r)}redoAddNamedExpression(e){this.operations.addNamedExpression(e.name,e.newContent,e.scope,e.options)}redoRemoveNamedExpression(e){this.operations.removeNamedExpression(e.namedExpression.displayName,e.scope)}
134redoChangeNamedExpression(e){this.operations.changeNamedExpressionExpression(e.namedExpression.displayName,e.newContent,e.scope,e.options)}redoSetRowOrder(e){this.operations.setRowOrder(e.sheetId,e.rowMapping)}redoSetColumnOrder(e){this.operations.setColumnOrder(e.sheetId,e.columnMapping)}addUndoEntry(e){this.undoStack.push(e),this.undoStack.splice(0,Math.max(0,this.undoStack.length-this.undoLimit))}undoEntry(e){e.doUndo(this)}restoreOperationOldContent(e){for(let[t,r]of e)this.operations.restoreCell(t,r)}redoEntry(e){e.doRedo(this)}restoreOldDataFromVersion(e){for(let t of this.oldData.get(e)||[]){let[e,r]=t;this.operations.setFormulaToCellFromCache(r,e)}}}class F{constructor(e,t,r,i,n,o,s,a,l,h){this.operations=t,this.undoRedo=r,this.clipboardOperations=i,this.dependencyGraph=n,this.columnSearch=o,this.parser=s,this.cellContentParser=a,this.lazilyTransformingAstService=l,this.namedExpressions=h,this.maxRows=e.maxRows,this.maxColumns=e.maxColumns}get sheetMapping(){return this.dependencyGraph.sheetMapping}addRows(e,...t){let r=new g.aQ(e,t);this.ensureItIsPossibleToAddRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addRows(r),this.undoRedo.saveOperation(new E(r))}removeRows(e,...t){let r=new g.uO(e,t);this.ensureItIsPossibleToRemoveRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let i=this.operations.removeRows(r);this.undoRedo.saveOperation(new y(r,i))}addColumns(e,...t){let r=new g.pt(e,t);this.ensureItIsPossibleToAddColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addColumns(r),this.undoRedo.saveOperation(new N(r))}removeColumns(e,...t){let r=new g.HO(e,t);this.ensureItIsPossibleToRemoveColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let i=this.operations.removeColumns(r);this.undoRedo.saveOperation(new A(r,i))}moveCells(e,t,r,i){this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let{version:n,overwrittenCellsData:o,addedGlobalNamedExpressions:s}=this.operations.moveCells(e,t,r,i);this.undoRedo.saveOperation(new w(e,t,r,i,o,s,n))}moveRows(e,t,r,i){this.ensureItIsPossibleToMoveRows(e,t,r,i),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let n=this.operations.moveRows(e,t,r,i);this.undoRedo.saveOperation(new b(e,t,r,i,n))}moveColumns(e,t,r,i){this.ensureItIsPossibleToMoveColumns(e,t,r,i),this.undoRedo.clearRedoStack();let n=this.operations.moveColumns(e,t,r,i);this.undoRedo.saveOperation(new T(e,t,r,i,n))}cut(e,t,r){this.clipboardOperations.cut(e,t,r)}ensureItIsPossibleToCopy(e,t,r){if(!V(t))throw new c.vn("width to be positive integer.");if(!V(r))throw new c.vn("height to be positive integer.")}copy(e,t,r){this.ensureItIsPossibleToCopy(e,t,r),this.clipboardOperations.copy(e,t,r)}paste(e){let t=this.clipboardOperations.clipboard;if(void 0===t)throw new c.h7;if(this.clipboardOperations.isCutClipboard())this.moveCells(t.sourceLeftCorner,t.width,t.height,e);else if(this.clipboardOperations.isCopyClipboard()){this.clipboardOperations.ensureItIsPossibleToCopyPaste(e);let r=h.gG.spanFrom(e,t.width,t.height),i=this.operations.getRangeClipboardCells(r);this.undoRedo.clearRedoStack();let n=this.operations.restoreClipboardCells(t.sourceLeftCorner.sheet,t.getContent(e));this.undoRedo.saveOperation(new P(e,i,t.content,n))}}beginUndoRedoBatchMode(){this.undoRedo.beginBatchMode()}commitUndoRedoBatchMode(){this.undoRedo.commitBatchMode()}isClipboardEmpty(){return void 0===this.clipboardOperations.clipboard}clearClipboard(){this.clipboardOperations.clear()}addSheet(e){void 0!==e&&this.ensureItIsPossibleToAddSheet(e),this.undoRedo.clearRedoStack();let{sheetName:t,sheetId:r}=this.operations.addSheet(e);return this.undoRedo.saveOperation(new I(t,r)),t}removeSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let t=this.sheetMapping.getSheetNameOrThrowError(e),r=this.operations.getSheetClipboardCells(e),i=this.operations.removeSheet(e);this.undoRedo.saveOperation(new M(t,e,r,i))}renameSheet(e,t){this.ensureItIsPossibleToRenameSheet(e,t);let{previousDisplayName:r,version:i,mergedPlaceholderSheetId:n}=this.operations.renameSheet(e,t);return void 0!==r&&(this.undoRedo.clearRedoStack(),this.undoRedo.saveOperation(new O(e,r,t,i,n))),r}clearSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let t=this.operations.getSheetClipboardCells(e);this.operations.clearSheet(e),this.undoRedo.saveOperation(new x(e,t))}setCellContents(e,t){if(t instanceof Array){for(let e=0;e<t.length;e++)if(!(t[e]instanceof Array))throw new c.vn("an array of arrays or a raw cell value.")}else t=[[t]];this.ensureItIsPossibleToChangeCellContents(e,t),this.undoRedo.clearRedoStack();let r=[];for(let i=0;i<t.length;i++)for(let n=0;n<t[i].length;n++){let o={sheet:e.sheet,row:e.row+i,col:e.col+n},s=t[i][n];this.clipboardOperations.abortCut();let a=this.operations.setCellContent(o,s);r.push({address:o,newContent:s,oldContent:a})}this.undoRedo.saveOperation(new _(r))}setSheetContent(e,t){this.ensureScopeIdIsValid(e),this.ensureItIsPossibleToChangeSheetContents(e,t),(0,p.c)(t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let r=this.operations.getSheetClipboardCells(e);this.operations.setSheetContent(e,t),this.undoRedo.saveOperation(new R(e,r,t))}setRowOrder(e,t){this.validateSwapRowIndexes(e,t),this.testRowOrderForArrays(e,t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let r=this.operations.setRowOrder(e,t);this.undoRedo.saveOperation(new S(e,t,r))}validateSwapRowIndexes(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e);this.validateRowOrColumnMapping(e,t,"row")}testColumnOrderForArrays(e,t){for(let[r,i]of t)if(r!==i){let t=h.gG.spanFrom({sheet:e,col:r,row:0},1,1/0);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new c.dV}}setColumnOrder(e,t){this.validateSwapColumnIndexes(e,t),this.testColumnOrderForArrays(e,t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();let r=this.operations.setColumnOrder(e,t);this.undoRedo.saveOperation(new C(e,t,r))}validateSwapColumnIndexes(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e);this.validateRowOrColumnMapping(e,t,"column")}testRowOrderForArrays(e,t){for(let[r,i]of t)if(r!==i){let t=h.gG.spanFrom({sheet:e,col:0,row:r},1/0,1);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new c.dV}}mappingFromOrder(e,t,r){if(!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e);let i="row"===r?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e);if(t.length!==i)throw new c.vn(`number of ${r}s provided to be sheet ${"row"===r?"height":"width"}.`);let n=[];for(let e=0;e<i;e++)t[e]!==e&&n.push([e,t[e]]);return n}undo(){if(this.undoRedo.isUndoStackEmpty())throw new c.CL;this.clipboardOperations.abortCut(),this.undoRedo.undo()}redo(){if(this.undoRedo.isRedoStackEmpty())throw new c.vs;this.clipboardOperations.abortCut(),this.undoRedo.redo()}addNamedExpression(e,t,r,i){this.ensureItIsPossibleToAddNamedExpression(e,t,r),this.operations.addNamedExpression(e,t,r,i),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new L(e,t,r,i))}changeNamedExpressionExpression(e,t,r,i){this.ensureItIsPossibleToChangeNamedExpression(e,r,t);
134let[n,o]=this.operations.changeNamedExpressionExpression(e,r,t,i);this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new D(n,r,o,t,i))}removeNamedExpression(e,t){this.ensureScopeIdIsValid(t);let[r,i]=this.operations.removeNamedExpression(e,t);return this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new k(r,i,t)),r}ensureItIsPossibleToAddNamedExpression(e,t,r){this.ensureScopeIdIsValid(r),this.ensureNamedExpressionNameIsValid(e,r),this.ensureNamedExpressionIsValid(t)}ensureItIsPossibleToChangeNamedExpression(e,t,r){if(this.ensureScopeIdIsValid(r),void 0===this.namedExpressions.namedExpressionForScope(e,r))throw new c.eA(e);this.ensureNamedExpressionIsValid(t)}isItPossibleToRemoveNamedExpression(e,t){if(this.ensureScopeIdIsValid(t),void 0===this.namedExpressions.namedExpressionForScope(e,t))throw new c.eA(e)}ensureItIsPossibleToAddRows(e,...t){if(!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e);if(this.dependencyGraph.getSheetHeight(e)+t.map(e=>e[1]).reduce((e,t)=>e+t,0)>this.maxRows)throw new c.mk;for(let[e,r]of t)if(!U(e)||!V(r))throw new c.vn("row number to be nonnegative and number of rows to add to be positive.")}ensureItIsPossibleToRemoveRows(e,...t){for(let[r,i]of t){let t=r+i-1;if(!U(r)||!U(t))throw new c.vn("starting and ending row to be nonnegative.");if(t<r)throw new c.vn("starting row to be smaller than the ending row.");if(!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e)}}ensureItIsPossibleToAddColumns(e,...t){if(!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e);if(this.dependencyGraph.getSheetWidth(e)+t.map(e=>e[1]).reduce((e,t)=>e+t,0)>this.maxColumns)throw new c.mk;for(let[e,r]of t)if(!U(e)||!V(r))throw new c.vn("column number to be nonnegative and number of columns to add to be positive.")}ensureItIsPossibleToRemoveColumns(e,...t){for(let[r,i]of t){let t=r+i-1;if(!U(r)||!U(t))throw new c.vn("starting and ending column to be nonnegative.");if(t<r)throw new c.vn("starting column to be smaller than the ending column.");if(!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e)}}ensureItIsPossibleToMoveRows(e,t,r,i){this.ensureItIsPossibleToAddRows(e,[i,r]);let n=(0,u.mT)(e,0,t),o=(0,u.mT)(e,0,i);if(!this.sheetMapping.hasSheetWithId(e)||(0,u.SL)(n)||(0,u.SL)(o)||!V(r)||i<=t+r&&i>=t)throw new c.vn("a valid range of rows to move.");let s=this.dependencyGraph.getSheetWidth(e),a=h.gG.spanFrom(n,s,r);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new c.dV;if(i>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllRows(f.$.fromNumberOfRows(e,i-1,2)))throw new c.kk}ensureItIsPossibleToMoveColumns(e,t,r,i){this.ensureItIsPossibleToAddColumns(e,[i,r]);let n=(0,u.mT)(e,t,0),o=(0,u.mT)(e,i,0);if(!this.sheetMapping.hasSheetWithId(e)||(0,u.SL)(n)||(0,u.SL)(o)||!V(r)||i<=t+r&&i>=t)throw new c.vn("a valid range of columns to move.");let s=this.dependencyGraph.getSheetHeight(e),a=h.gG.spanFrom(n,r,s);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new c.dV;if(i>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllColumns(f.N.fromNumberOfColumns(e,i-1,2)))throw new c.kk}ensureItIsPossibleToAddSheet(e){if(this.sheetMapping.hasSheetWithName(e))throw new c.Bo(e)}ensureItIsPossibleToRenameSheet(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e);let r=this.sheetMapping.getSheetId(t);if(void 0!==r&&r!==e)throw new c.Bo(t)}ensureItIsPossibleToChangeContent(e){if((0,u.SL)(e))throw new c.bS(e);if(!this.sheetMapping.hasSheetWithId(e.sheet))throw new c.uJ(e.sheet)}ensureItIsPossibleToChangeCellContents(e,t){let r=(0,p.l)(t),i=h.gG.spanFrom(e,r.width,r.height);for(let e of(this.ensureRangeInSizeLimits(i),i.addresses(this.dependencyGraph)))this.ensureItIsPossibleToChangeContent(e)}ensureItIsPossibleToChangeSheetContents(e,t){let r=(0,p.l)(t),i=h.gG.spanFrom((0,u.mT)(e,0,0),r.width,r.height);this.ensureRangeInSizeLimits(i)}ensureRangeInSizeLimits(e){if(e.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new c.mk}isThereSomethingToUndo(){return!this.undoRedo.isUndoStackEmpty()}isThereSomethingToRedo(){return!this.undoRedo.isRedoStackEmpty()}getAndClearContentChanges(){return this.operations.getAndClearContentChanges()}ensureScopeIdIsValid(e){if(void 0!==e&&!this.sheetMapping.hasSheetWithId(e))throw new c.uJ(e)}validateRowOrColumnMapping(e,t,r){let i="row"===r?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e),n=t.map(([e,t])=>e).sort((e,t)=>
134e-t),o=t.map(([e,t])=>t).sort((e,t)=>e-t);for(let e=0;e<n.length;e++){if(!U(n[e])||n[e]>=i)throw new c.vn(`${r} numbers to be nonnegative integers and less than sheet ${"row"===r?"height":"width"}.`);if(n[e]===n[e+1])throw new c.vn(`source ${r} numbers to be unique.`);if(n[e]!==o[e])throw new c.vn(`target ${r} numbers to be permutation of source ${r} numbers.`)}}ensureNamedExpressionNameIsValid(e,t){if(!this.namedExpressions.isNameValid(e))throw new c.jD(e);if(!this.namedExpressions.isNameAvailable(e,t))throw new c.G9(e)}ensureNamedExpressionIsValid(e){let t=this.cellContentParser.parse(e);if(t instanceof s.J5.Formula){let e=this.parser.parse(t.formula,(0,u.mT)(-1,0,0));if((0,d.C_)(e.ast))throw new c.vf}}}function V(e){return Number.isInteger(e)&&e>0}function U(e){return Number.isInteger(e)&&e>=0}var W=r(17808),j=r(31543),G=r(29319),$=r(61973),z=r(11e3),Y=r(47956),K=r(2714),X=r(15095),q=r(68724);class Z{constructor(e,t,r,i,n,o){this.config=e,this.stats=t,this.interpreter=r,this.lazilyTransformingAstService=i,this.dependencyGraph=n,this.columnSearch=o}run(){this.stats.start(q.wK.TOP_SORT);let{sorted:e,cycled:t}=this.dependencyGraph.topSortWithScc();this.stats.end(q.wK.TOP_SORT),this.stats.measure(q.wK.EVALUATION,()=>{this.recomputeFormulas(t,e)})}partialRun(e){let t=$.K.empty();return this.stats.measure(q.wK.EVALUATION,()=>{this.dependencyGraph.graph.getTopSortedWithSccSubgraphFrom(e,e=>this.recomputeVertex(e,t),e=>this.processVertexOnCycle(e,t))}),t}runAndForget(e,t,r){let i=[];for(let e of(0,G.d)(r,t))if(e instanceof h.gG&&void 0===this.dependencyGraph.getRange(e.start,e.end)){let t=new j.BD(e);this.dependencyGraph.rangeMapping.addOrUpdateVertex(t),i.push(t)}let n=this.evaluateAstToCellValue(e,new Y.P(t,this.config.useArrayArithmetic));return i.forEach(e=>{this.dependencyGraph.rangeMapping.removeVertexIfExists(e)}),n}recomputeVertex(e,t){if(e instanceof z._Z){let r=e.isComputed()?e.getCellValue():void 0,i=this.recomputeFormulaVertexValue(e);if(i!==r){let n=e.getAddress(this.lazilyTransformingAstService);return t.addChange(i,n),this.columnSearch.change((0,K.t_)(r),(0,K.t_)(i),n),!0}return!1}return!(e instanceof j.BD)||(e.clearCache(),!0)}processVertexOnCycle(e,t){if(e instanceof j.BD)e.clearCache();else if(e instanceof z._Z){let r=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.remove((0,K.t_)(e.valueOrUndef()),r);let i=new u.D5(u.NI.CYCLE,void 0,e);e.setCellValue(i),t.addChange(i,r)}}recomputeFormulas(e,t){e.forEach(e=>{e instanceof z._Z&&e.setCellValue(new u.D5(u.NI.CYCLE,void 0,e))}),t.forEach(e=>{if(e instanceof z._Z){let t=this.recomputeFormulaVertexValue(e),r=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.add((0,K.t_)(t),r)}else e instanceof j.BD&&e.clearCache()})}recomputeFormulaVertexValue(e){let t=e.getAddress(this.lazilyTransformingAstService);if(e instanceof j.H7&&(e.array.size.isRef||!this.dependencyGraph.isThereSpaceForArray(e)))return e.setNoSpace();{let r=e.getFormula(this.lazilyTransformingAstService),i=this.evaluateAstToCellValue(r,new Y.P(t,this.config.useArrayArithmetic,e));return e.setCellValue(i)}}evaluateAstToCellValue(e,t){let r=this.interpreter.evaluateAst(e,t);return r instanceof X.r?r:r===K.OX&&this.config.evaluateNullToZero?0:r}}var Q=r(54062);class J{constructor(e,t,r,i,n,o){this.dependencyGraph=e,this.columnSearch=t,this.parser=r,this.cellContentParser=i,this.stats=n,this.arraySizePredictor=o,this.buildStrategy=new ee(e,t,r,n,i,o)}buildGraph(e,t){let r=t.measure(q.wK.COLLECT_DEPENDENCIES,()=>this.buildStrategy.run(e));this.dependencyGraph.getAndClearContentChanges(),t.measure(q.wK.PROCESS_DEPENDENCIES,()=>this.processDependencies(r))}processDependencies(e){e.forEach((e,t)=>{this.dependencyGraph.processCellDependencies(e,t)})}}class ee{constructor(e,t,r,i,n,o){this.dependencyGraph=e,this.columnIndex=t,this.parser=r,this.stats=i,this.cellContentParser=n,this.arraySizePredictor=o}run(e){let t=new Map;for(let r in e){let i=this.dependencyGraph.getSheetId(r),n=e[r];for(let e=0;e<n.length;++e){let r=n[e];for(let n=0;n<r.length;++n){let a=r[n],l=(0,u.mT)(i,n,e),h=this.cellContentParser.parse(a);if(h instanceof s.J5.Formula){let e=this.stats.measure(q.wK.PARSER,()=>this.parser.parse(h.formula,l));if(e.errors.length>0){this.shrinkArrayIfNeeded(l);let t=new j.Oj(e.errors,h.formula);this.dependencyGraph.addVertex(l,t)}else{this.shrinkArrayIfNeeded(l);let r=this.arraySizePredictor.checkArraySize(e.ast,l);if(r.isScalar()){let r=new j.Gs(e.ast,l,0);t.set(r,(0,G.d)(e.dependencies,l)),this.dependencyGraph.addVertex(l,r),e.hasVolatileFunction&&this.dependencyGraph.markAsVolatile(r),e.hasStru
134cturalChangeFunction&&this.dependencyGraph.markAsDependentOnStructureChange(r)}else{let i=new j.H7(e.ast,l,new o.J(r.width,r.height));t.set(i,(0,G.d)(e.dependencies,l)),this.dependencyGraph.addArrayVertex(l,i)}}}else if(h instanceof s.J5.Empty);else{this.shrinkArrayIfNeeded(l);let e=new j.VO(h.value,a);this.columnIndex.add((0,K.t_)(h.value),l),this.dependencyGraph.addVertex(l,e)}}}}return t}shrinkArrayIfNeeded(e){let t=this.dependencyGraph.getCell(e);t instanceof j.H7&&this.dependencyGraph.shrinkArrayToCorner(t)}}var et=r(90518),er=r(31952),ei=r(69606),en=r(77023),eo=r(20763),es=r(12338);(i=n||(n={})).GREATER_THAN="GREATER_THAN",i.GREATER_THAN_OR_EQUAL="GREATER_THAN_OR_EQUAL",i.LESS_THAN="LESS_THAN",i.LESS_THAN_OR_EQUAL="LESS_THAN_OR_EQUAL",i.NOT_EQUAL="NOT_EQUAL",i.EQUAL="EQUAL";let ea=(e,t)=>({operator:e,value:t});class el{constructor(e){var t,r,i,n;this.trueString=null!==(r=null===(t=e.translationPackage.getMaybeFunctionTranslation("TRUE"))||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:"true",this.falseString=null!==(n=null===(i=e.translationPackage.getMaybeFunctionTranslation("FALSE"))||void 0===i?void 0:i.toLowerCase())&&void 0!==n?n:"false"}fromCellValue(e,t){if("string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e)return;let r=this.parseCriterion(e,t);if(void 0!==r)return{raw:e,lambda:eu(r,t)}}parseCriterion(e,t){if("number"==typeof e||"boolean"==typeof e)return ea(n.EQUAL,e);if("string"==typeof e){let r,i;let o=eh.exec(e);o?(i=function(e){switch(e){case">":return n.GREATER_THAN;case">=":return n.GREATER_THAN_OR_EQUAL;case"<":return n.LESS_THAN;case"<=":return n.LESS_THAN_OR_EQUAL;case"<>":return n.NOT_EQUAL;case"=":return n.EQUAL;default:return}}(o[1]),r=o[2]):(i=n.EQUAL,r=e);let s=t.coerceToMaybeNumber(r),a=r.toLowerCase()===this.trueString||r.toLowerCase()!==this.falseString&&void 0;if(void 0===i)return;if(""===r)return ea(i,null);if(void 0!==s)return ea(i,(0,K.t_)(s));if(i===n.EQUAL||i===n.NOT_EQUAL)return ea(i,null!=a?a:r)}}}let eh=/([<>=]+)(.*)/,eu=(e,t)=>{switch(e.operator){case n.GREATER_THAN:if("number"==typeof e.value)return r=>"number"==typeof r&&t.floatCmp(r,e.value)>0;return e=>!1;case n.GREATER_THAN_OR_EQUAL:if("number"==typeof e.value)return r=>"number"==typeof r&&t.floatCmp(r,e.value)>=0;return e=>!1;case n.LESS_THAN:if("number"==typeof e.value)return r=>"number"==typeof r&&0>t.floatCmp(r,e.value);return e=>!1;case n.LESS_THAN_OR_EQUAL:if("number"==typeof e.value)return r=>"number"==typeof r&&0>=t.floatCmp(r,e.value);return e=>!1;case n.EQUAL:if("number"==typeof e.value)return r=>{if("number"==typeof r)return 0===t.floatCmp(r,e.value);if("string"!=typeof r)return!1;{if(""===r)return!1;let i=t.coerceToMaybeNumber(r);return void 0!==i&&0===t.floatCmp(i,e.value)}};if("string"==typeof e.value)return t.eqMatcherFunction(e.value);if("boolean"==typeof e.value)return t=>"boolean"==typeof t&&t===e.value;return e=>e===K.OX;case n.NOT_EQUAL:if("number"==typeof e.value)return r=>{if("number"==typeof r)return 0!==t.floatCmp(r,e.value);if("string"!=typeof r)return!0;{if(""===r)return!0;let i=t.coerceToMaybeNumber(r);return void 0===i||0!==t.floatCmp(i,e.value)}};if("string"==typeof e.value)return t.neqMatcherFunction(e.value);if("boolean"==typeof e.value)return t=>"boolean"!=typeof t||t!==e.value;return e=>e!==K.OX}};class ec{constructor(e,t,r,i,n,o,s,a,l,h){this.config=e,this.dependencyGraph=t,this.columnSearch=r,this.stats=i,this.arithmeticHelper=n,this.functionRegistry=o,this.namedExpressions=s,this.serialization=a,this.arraySizePredictor=l,this.dateTimeHelper=h,this.equalOp=(e,t)=>eg(this.arithmeticHelper.eq,e,t),this.notEqualOp=(e,t)=>eg(this.arithmeticHelper.neq,e,t),this.greaterThanOp=(e,t)=>eg(this.arithmeticHelper.gt,e,t),this.lessThanOp=(e,t)=>eg(this.arithmeticHelper.lt,e,t),this.greaterThanOrEqualOp=(e,t)=>eg(this.arithmeticHelper.geq,e,t),this.lessThanOrEqualOp=(e,t)=>eg(this.arithmeticHelper.leq,e,t),this.concatOp=(e,t)=>eg(this.arithmeticHelper.concat,(0,er.uB)(e),(0,er.uB)(t)),this.plusOp=(e,t)=>eg(this.arithmeticHelper.addWithEpsilon,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.minusOp=(e,t)=>eg(this.arithmeticHelper.subtract,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.timesOp=(e,t)=>eg(this.arithmeticHelper.multiply,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.powerOp=(e,t)=>eg(this.arithmeticHelper.pow,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.divOp=(e,t)=>eg(this.arithmeticHelper.divide,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.unaryMinusOp=e=>ed(this.arithmeticHelper.unaryMinus,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.percentOp=e=>ed(this.arithmeticHelper.unaryPercent,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.unaryPlusOp=e
134=>this.arithmeticHelper.unaryPlus(e),this.functionRegistry.initializePlugins(this),this.criterionBuilder=new el(e)}evaluateAst(e,t){var r,i;let n=this.evaluateAstWithoutPostprocessing(e,t);if((0,K.g_)(n)){if((0,er.Uh)((0,K.t_)(n)))return new u.D5(u.NI.NUM,eo.B.NaN);n=(0,K.zV)(n,(0,er.h6)((0,K.t_)(n)))}return n instanceof X.r&&1===n.height()&&1===n.width()&&([[n]]=n.data),r=n,i=t.formulaVertex,r instanceof u.D5&&void 0!==i?r.attachRootVertex(i):r}evaluateAstWithoutPostprocessing(e,t){switch(e.type){case es.W$.EMPTY:return K.OX;case es.W$.CELL_REFERENCE:{let r=e.reference.toSimpleCellAddress(t.formulaAddress);if((0,u.SL)(r))return new u.D5(u.NI.REF,eo.B.BadRef);if(!this.isSheetValid(e.reference))return new u.D5(u.NI.REF,eo.B.SheetRef);return this.dependencyGraph.getCellValue(r)}case es.W$.NUMBER:case es.W$.STRING:return e.value;case es.W$.CONCATENATE_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.concatOp,r,i,t)}case es.W$.EQUALS_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.equalOp,r,i,t)}case es.W$.NOT_EQUAL_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.notEqualOp,r,i,t)}case es.W$.GREATER_THAN_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOp,r,i,t)}case es.W$.LESS_THAN_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOp,r,i,t)}case es.W$.GREATER_THAN_OR_EQUAL_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOrEqualOp,r,i,t)}case es.W$.LESS_THAN_OR_EQUAL_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOrEqualOp,r,i,t)}case es.W$.PLUS_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.plusOp,r,i,t)}case es.W$.MINUS_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.minusOp,r,i,t)}case es.W$.TIMES_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.timesOp,r,i,t)}case es.W$.POWER_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.powerOp,r,i,t)}case es.W$.DIV_OP:{let r=this.evaluateAst(e.left,t),i=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.divOp,r,i,t)}case es.W$.PLUS_UNARY_OP:{let r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryPlusOp,r,t)}case es.W$.MINUS_UNARY_OP:{let r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryMinusOp,r,t)}case es.W$.PERCENT_OP:{let r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.percentOp,r,t)}case es.W$.FUNCTION_CALL:{if("valid"!==this.config.licenseKeyValidityState&&!ei.g.functionIsProtected(e.procedureName))return new u.D5(u.NI.LIC,eo.B.LicenseKey(this.config.licenseKeyValidityState));let r=this.functionRegistry.getFunction(e.procedureName);if(void 0!==r)return r(e,new Y.P(t.formulaAddress,t.arraysFlag||this.functionRegistry.isArrayFunction(e.procedureName),t.formulaVertex));return new u.D5(u.NI.NAME,eo.B.FunctionName(e.procedureName))}case es.W$.NAMED_EXPRESSION:{let r=this.namedExpressions.nearestNamedExpression(e.expressionName,t.formulaAddress.sheet);if(r)return this.dependencyGraph.getCellValue(r.address);return new u.D5(u.NI.NAME,eo.B.NamedExpressionName(e.expressionName))}case es.W$.CELL_RANGE:{if(!this.isSheetValid(e.start)||!this.isSheetValid(e.end))return new u.D5(u.NI.REF,eo.B.SheetRef);if(!this.rangeSpansOneSheet(e))return new u.D5(u.NI.REF,eo.B.RangeManySheets);let r=h.gG.fromCellRange(e,t.formulaAddress),i=this.dependencyGraph.getArray(r);if(i){let e=i.array;if(e instanceof en.FK)throw Error("Array should be already computed");if(e instanceof u.D5)return e;if(e instanceof en.Ms)return X.r.fromRange(e.raw(),r,this.dependencyGraph);throw Error("Unknown array")}return X.r.onlyRange(r,this.dependencyGraph)}case es.W$.COLUMN_RANGE:{if(!this.isSheetValid(e.start)||!this.isSheetValid(e.end))return new u.D5(u.NI.REF,eo.B.SheetRef);if(!this.rangeSpansOneSheet(e))return new u.D5(u.NI.REF,eo.B.RangeManySheets);let r=h.CZ.fromColumnRange(e,t.formulaAddress);return X.r.onlyRange(r,this.dependencyGraph)}case es.W$.ROW_RANGE:{if(!this.isSheetValid(e.start)||!this.isSheetValid(e.end))return new u.D5(u.NI.REF,eo.B.SheetRef);if(!this.rangeSpansOneSheet(e))return new u.D5(u.NI.REF,eo.B.RangeManySheets);let r=h.W9.fromRowRangeAst(e,t.formulaAddress);return X.r.onlyRange(r,this.dependencyGraph)}case es.W$.PARENTHESIS:return this.evaluateAst(e.expression,t);case es.W$.ARRAY:{let r;let i=[];for(let n of e.args){let e;let o=[];for(let r of n){let i=(0,er.L6)(this.evaluateAst(r,t)),n=i.height();if(void 0===e)e=n,o.push(...i.data);else if(e!==n)return new u.D5(u.NI.REF,eo.B.SizeMismatch);else for(let e=0;e<n;e++)o[e].push(...i.data[e])}let s=o[0].length;if(void 0===r)r=s,i.push(...o);else{if(r!==s)return new u.D5(u.NI.REF,eo.B.SizeMismatch);i.push(...o)}}return X.r.onlyValues(i)}case es.W$.ERROR_WITH_RAW_INPUT:case es.W$.ERROR:return e.error}}isSheetValid(e){return void 0===e.sheet||e.sheet===d.GU.SHEET_FOR_WORKBOOK_EXPRESSIONS||this.dependencyGraph.sheetMapping.hasSheetWithId(e.sheet,{includePlaceholders:!1})}rangeSpansOneSheet(e){return e.start.sheet===e.end.sheet}unaryRangeWrapper(e,t,r){var i;if(t instanceof X.r&&!r.arraysFlag&&(t=null!==(i=(0,er.Kj)(t,r))&&void 0!==i?i:new u.D5(u.NI.VALUE,eo.B.ScalarExpected)),t instanceof u.D5)return t;if(t instanceof X.r){let r=t.data.map(t=>t.map(e));return X.r.onlyValues(r)}return e(t)}
134binaryRangeWrapper(e,t,r,i){var n,o;if(t instanceof X.r&&!i.arraysFlag&&(t=null!==(n=(0,er.Kj)(t,i))&&void 0!==n?n:new u.D5(u.NI.VALUE,eo.B.ScalarExpected)),t instanceof u.D5)return t;if(r instanceof X.r&&!i.arraysFlag&&(r=null!==(o=(0,er.Kj)(r,i))&&void 0!==o?o:new u.D5(u.NI.VALUE,eo.B.ScalarExpected)),r instanceof u.D5)return r;if(t instanceof X.r||r instanceof X.r){if(!(t instanceof X.r)){if(r.isAdHoc()){let i=r.data;for(let r=0;r<i.length;r++)for(let n=0;n<i[0].length;n++)i[r][n]=e(t,i[r][n]);return X.r.onlyValues(i)}t=X.r.fromScalar(t)}if(!(r instanceof X.r)){if(t.isAdHoc()){let i=t.data;for(let t=0;t<i.length;t++)for(let n=0;n<i[0].length;n++)i[t][n]=e(i[t][n],r);return X.r.onlyValues(i)}r=X.r.fromScalar(r)}if(t.width()===r.width()&&t.height()===r.height()){if(t.isAdHoc()){let i=t.data,n=r.data;for(let t=0;t<i.length;t++)for(let r=0;r<i[0].length;r++)i[t][r]=e(i[t][r],n[t][r]);return X.r.onlyValues(i)}if(r.isAdHoc()){let i=t.data,n=r.data;for(let t=0;t<i.length;t++)for(let r=0;r<i[0].length;r++)n[t][r]=e(i[t][r],n[t][r]);return X.r.onlyValues(n)}}let i=Math.max(t.width(),r.width()),n=Math.max(t.height(),r.height()),o=Array(n);for(let e=0;e<n;e++)o[e]=Array(i);for(let s=0;s<n;s++){let n=1!==t.height()?s:0,a=1!==r.height()?s:0;for(let l=0;l<i;l++){let i=1!==t.width()?l:0,h=1!==r.width()?l:0;n<t.height()&&a<r.height()&&i<t.width()&&h<r.width()?o[s][l]=e(t.data[n][i],r.data[a][h]):o[s][l]=new u.D5(u.NI.NA)}}return X.r.onlyValues(o)}return e(t,r)}}function ed(e,t){return t instanceof u.D5?t:e(t)}function eg(e,t,r){return t instanceof u.D5?t:r instanceof u.D5?r:e(t,r)}class ep{constructor(e){this.sheet=e,this.transformations=[]}add(e){this.transformations.push(e)}performEagerTransformations(e,t){this.transformations.forEach(r=>r.performEagerTransformations(e,t))}transformSingleAst(e,t){let[r,i]=[e,t];return this.transformations.forEach(e=>{[r,i]=e.transformSingleAst(r,i)}),[r,i]}isIrreversible(){return!0}}class ef{constructor(e){this.stats=e,this.transformations=[]}version(){return this.transformations.length}addTransformation(e){return void 0!==this.combinedTransformer?this.combinedTransformer.add(e):this.transformations.push(e),this.version()}beginCombinedMode(e){this.combinedTransformer=new ep(e)}commitCombinedMode(){if(void 0===this.combinedTransformer)throw Error("Combined mode wasn't started");return this.transformations.push(this.combinedTransformer),this.combinedTransformer=void 0,this.version()}applyTransformations(e,t,r){this.stats.start(q.wK.TRANSFORM_ASTS_POSTPONED);for(let i=r;i<this.transformations.length;i++){let r=this.transformations[i];r.isIrreversible()&&(this.undoRedo.storeDataForVersion(i,t,this.parser.computeHashFromAst(e)),this.parser.rememberNewAst(e));let[n,o]=r.transformSingleAst(e,t);e=n,t=o}let i=this.parser.rememberNewAst(e);return this.stats.end(q.wK.TRANSFORM_ASTS_POSTPONED),[i,t,this.transformations.length]}*getTransformationsFrom(e,t){for(let r=e;r<this.transformations.length;r++){let e=this.transformations[r];(!t||t(e))&&(yield e)}}}var em=r(64742);class ey extends em.z{constructor(e){super(e),this.dependencyGraph=e}add(e,t){}remove(e,t){}change(e,t,r){}applyChanges(e){}addColumns(e){}removeColumns(e){}removeSheet(e){}moveValues(e,t,r,i){}removeValues(e){}find(e,t,r){return this.basicFind(e,t,"row",r)}}var ev=r(35134),ew=r(52423);class eE{constructor(e,t,r){this.dependencyGraph=e,this.config=t,this.stats=r,this.index=new Map,this.transformingService=this.dependencyGraph.lazilyTransformingAstService,this.binarySearchStrategy=new ey(e)}add(e,t){if(e!==K.OX&&!(e instanceof u.D5)){if(e instanceof X.r)for(let[r,i]of e.entriesFromTopLeftCorner(t))this.addSingleCellValue((0,K.t_)(r),i);else this.addSingleCellValue(e,t)}}remove(e,t){if(void 0!==e){if(e instanceof X.r)for(let[r,i]of e.entriesFromTopLeftCorner(t))this.removeSingleValue((0,K.t_)(r),i);else this.removeSingleValue(e,t)}}change(e,t,r){e!==t&&(this.remove(e,r),this.add(t,r))}applyChanges(e){for(let t of e)void 0!==t.oldValue&&this.change((0,K.t_)(t.oldValue),(0,K.t_)(t.value),t.address)}moveValues(e,t,r,i){for(let[n,o]of e){let e=(0,u.HM)(o,i,t,r);this.remove(n,o),this.add(n,e)}}removeValues(e){for(let[t,r]of e)this.remove(t,r)}find(e,t,{ordering:r,ifNoMatch:i,returnOccurrence:n}){null==n&&(n="none"===r?"first":"last");let o=this.findUsingColumnIndex(e,t,n);return void 0!==o?o:this.binarySearchStrategy.find(e,t,{ordering:r,ifNoMatch:i,returnOccurrence:n})}findUsingColumnIndex(e,t,r){let i=t.range;if(void 0===i)return;this.ensureRecentData(i.sheet,i.start.col,e);let n=this.getColumnMap(i.sheet,i.start.col);if(!n)return -1;let o="string"==typeof e?(0,er.Gl)(e):e,s=n.get(o);if(!s||!s.index||0===s.index.length)return;let a=eE.findRowBelongingToRange(s,i,r);return void 0!==a?a-i.start.row:void 0}static findRowBelongingToRange(e,t,r){let i=t.start.row,n=t.end.row,o="first"===r?eS(i,e.index,"upperBound"):eS(n,e.index,"lowerBound");if(-1===o)return;let s=e.index[o];return s>=i&&s<=n?s:void 0}advancedFind(e,t,r={returnOccurrence:"first"}){return this.binarySearchStrategy.advancedFind(e,t,r)}addColumns(e){let t=this.index.get(e.sheet);t&&t.splice(e.columnStart,0,...Array(e.numberOfColumns))}
134removeColumns(e){let t=this.index.get(e.sheet);t&&t.splice(e.columnStart,e.numberOfColumns)}removeSheet(e){this.index.delete(e)}getColumnMap(e,t){this.index.has(e)||this.index.set(e,[]);let r=this.index.get(e),i=r[t];return i||(i=new Map,r[t]=i),i}getValueIndex(e,t,r){let i=this.getColumnMap(e,t),n=this.getColumnMap(e,t).get(r);return n||(n={version:this.transformingService.version(),index:[]},i.set(r,n)),n}ensureRecentData(e,t,r){let i=this.getValueIndex(e,t,r),n=this.transformingService.version();if(i.version!==n){for(let n of this.transformingService.getTransformationsFrom(i.version,t=>t.sheet===e&&(t instanceof ev.w||t instanceof ew.o)))n instanceof ev.w?this.addRows(t,n.rowsSpan,r):n instanceof ew.o&&this.removeRows(t,n.rowsSpan,r);i.version=n}}addSingleCellValue(e,t){this.stats.measure(q.wK.BUILD_COLUMN_INDEX,()=>{this.ensureRecentData(t.sheet,t.col,e),"string"==typeof e&&(e=(0,er.Gl)(e));let r=this.getValueIndex(t.sheet,t.col,e);eE.addValue(r,t.row)})}removeSingleValue(e,t){this.stats.measure(q.wK.BUILD_COLUMN_INDEX,()=>{this.ensureRecentData(t.sheet,t.col,e);let r=this.getColumnMap(t.sheet,t.col);"string"==typeof e&&(e=(0,er.Gl)(e));let i=r.get(e);if(!i)return;let n=eS(t.row,i.index);n>-1&&i.index.splice(n,1),0===i.index.length&&r.delete(e),0===r.size&&delete this.index.get(t.sheet)[t.col]})}addRows(e,t,r){let i=this.getValueIndex(t.sheet,e,r);eE.shiftRows(i,t.rowStart,t.numberOfRows)}removeRows(e,t,r){let i=this.getValueIndex(t.sheet,e,r);eE.removeRowsFromValues(i,t),eE.shiftRows(i,t.rowEnd+1,-t.numberOfRows)}static addValue(e,t){let r=eS(t,e.index,"lowerBound");e.index[r]!==t&&e.index.splice(r+1,0,t)}static removeRowsFromValues(e,t){let r=eS(t.rowStart,e.index,"upperBound"),i=eS(t.rowEnd,e.index,"lowerBound");r>-1&&i>-1&&r<=i&&e.index[r]<=t.rowEnd&&e.index.splice(r,i-r+1)}static shiftRows(e,t,r){let i=eS(t,e.index,"upperBound");if(-1!==i)for(let t=i;t<e.index.length;++t)e.index[t]+=r}}function eS(e,t,r="upperBound"){let i=0,n=t.length-1;for(;i<=n;){let r=Math.floor((i+n)/2);if(e>t[r])i=r+1;else{if(!(e<t[r]))return r;n=r-1}}let o="lowerBound"===r?n:i;return o>=0&&o<=t.length?o:-1}class eC{constructor(e){this.config=e;let t="."===this.config.thousandSeparator?`\\${this.config.thousandSeparator}`:this.config.thousandSeparator,r="."===this.config.decimalSeparator?`\\${this.config.decimalSeparator}`:this.config.decimalSeparator;this.numberPattern=RegExp(`^([+-]?((${r}\\d+)|(\\d+(${t}\\d{3,})*(${r}\\d*)?)))(e[+-]?\\d+)?$`),this.allThousandSeparatorsRegex=RegExp(`${t}`,"g")}numericStringToMaybeNumber(e){if(this.numberPattern.test(e)){let t=this.numericStringToNumber(e);if(!isNaN(t))return t}}numericStringToNumber(e){return Number(e.replace(this.allThousandSeparatorsRegex,"").replace(this.config.decimalSeparator,"."))}}var eR=r(68940);class eb{constructor(e,t,r){this.dependencyGraph=e,this.unparser=t,this.exporter=r}getCellHyperlink(e){let t=this.dependencyGraph.getCell(e);if(t instanceof j.Gs){let e=t.getFormula(this.dependencyGraph.lazilyTransformingAstService);if("HYPERLINK"===e.procedureName)return e.hyperlink}}getCellFormula(e,t){let r=this.dependencyGraph.getCell(e);if(r instanceof j.Gs){let i=r.getFormula(this.dependencyGraph.lazilyTransformingAstService);return t=null!=t?t:e,this.unparser.unparse(i,t)}if(r instanceof j.H7){let i=r.getAddress(this.dependencyGraph.lazilyTransformingAstService);if(i.row!==e.row||i.col!==e.col||i.sheet!==e.sheet)return;t=null!=t?t:e;let n=r.getFormula(this.dependencyGraph.lazilyTransformingAstService);if(void 0!==n)return this.unparser.unparse(n,t)}else if(r instanceof j.Oj)return r.getFormula()}getCellSerialized(e,t){var r;return null!==(r=this.getCellFormula(e,t))&&void 0!==r?r:this.getRawValue(e)}getCellValue(e){return this.exporter.exportValue(this.dependencyGraph.getScalarValue(e))}getRawValue(e){return this.dependencyGraph.getRawValue(e)}getSheetValues(e){return this.genericSheetGetter(e,e=>this.getCellValue(e))}getSheetFormulas(e){return this.genericSheetGetter(e,e=>this.getCellFormula(e))}genericSheetGetter(e,t){let r=this.dependencyGraph.getSheetHeight(e),i=this.dependencyGraph.getSheetWidth(e),n=Array(r);for(let o=0;o<r;o++){n[o]=Array(i);for(let r=0;r<i;r++){let i=(0,u.mT)(e,r,o);n[o][r]=t(i)}for(let e=i-1;e>=0;e--)if(null===n[o][e]||void 0===n[o][e])n[o].pop();else break}for(let e=r-1;e>=0;e--)if(0===n[e].length)n.pop();else break;return n}genericAllSheetsGetter(e){let t={};for(let r of this.dependencyGraph.sheetMapping.iterateSheetNames()){let i=this.dependencyGraph.sheetMapping.getSheetIdOrThrowError(r);t[r]=e(i)}return t}getSheetSerialized(e){return this.genericSheetGetter(e,e=>this.getCellSerialized(e))}getAllSheetsValues(){return this.genericAllSheetsGetter(e=>this.getSheetValues(e))}getAllSheetsFormulas(){return this.genericAllSheetsGetter(e=>this.getSheetFormulas(e))}getAllSheetsSerialized(){return this.genericAllSheetsGetter(e=>this.getSheetSerialized(e))}getAllNamedExpressionsSerialized(){let e=[],t=0;for(let r of this.dependencyGraph.sheetMapping.iterateSheetNames())e[this.dependencyGraph.sheetMapping.getSheetIdOrThrowError(r)]=t,t++;return this.dependencyGraph.namedExpressions.getAllNamedExpressions().map(t=>({name:t.expression.displayName,expression:this.getCellSerialized(t.expression.address),scope:void 0!==t.scope?e[t.scope]:void 0,options:t.expression.options}))}withNewConfig(e,t){let r=new eR.DH(e,this.dependencyGraph.sheetMapping,t);return new eb(this.dependencyGraph,r,this.exporter)}}class eT{static buildFromSheets(e,t={},r=[]){let i=new l.D(t);return this.buildEngine(i,e,r)}static buildFromSheet(e,t={},r=[]){let i=new l.D(t),n=i.translationPackage.getUITranslation(et.u1.NEW_SHEET_PREFIX)+"1";return this.buildEngine(i,{[n]:e},r)}static buildEmpty(e={},t=[]){return this.buildEngine(new l.D(e),{},t)}
134static rebuildWithConfig(e,t,r,i){return this.buildEngine(e,t,r,i)}static buildEngine(e,t={},r=[],i=e.useStats?new q.gy:new q.rW){i.start(q.wK.BUILD_ENGINE_TOTAL);let n=new d.GU,l=new ei.g(e),h=new ef(i),u=j.mn.buildEmpty(h,e,l,n,i),f=e.useColumnIndex?new eE(u,e,i):new ey(u),m=u.sheetMapping,y=u.addressMapping;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];(0,p.c)(i);let n=(0,p.l)(i);if(n.height>e.maxRows||n.width>e.maxColumns)throw new c.mk;let o=m.addSheet(r);y.addSheetAndSetStrategyBasedOnBoundaries(o,n,{throwIfSheetAlreadyExists:!0})}let w=new eR.Zu(e,l,u.sheetReferenceRegistrar.ensureSheetRegistered.bind(u.sheetReferenceRegistrar));h.parser=w;let E=new eR.DH(e,m,n),S=new W.HD(e),C=new eC(e),R=new er.ZI(e,S,C),b=new s.lj(e,S,C),T=new o.i(e,l),N=new g.BX(e,u,f,b,w,i,h,n,T),A=new B(e,N);h.undoRedo=A;let I=new a.F(e,u,N),M=new F(e,N,A,I,u,f,w,b,h,n),O=new Q.uX(e,n,m,h),x=new eb(u,E,O),_=new ec(e,u,f,i,R,l,n,x,T,S);i.measure(q.wK.GRAPH_BUILD,()=>{new J(u,f,w,b,i,T).buildGraph(t,i)}),r.forEach(e=>{M.ensureItIsPossibleToAddNamedExpression(e.name,e.expression,e.scope),M.operations.addNamedExpression(e.name,e.expression,e.scope,e.options)});let P=new Z(e,i,_,h,u,f);return P.run(),i.end(q.wK.BUILD_ENGINE_TOTAL),{config:e,stats:i,dependencyGraph:u,columnSearch:f,parser:w,unparser:E,cellContentParser:b,evaluator:P,lazilyTransformingAstService:h,crudOperations:M,exporter:O,namedExpressions:n,serialization:x,functionRegistry:l}}}},31387:function(e,t,r){"use strict";r.d(t,{CJ:function(){return N},D5:function(){return C},DA:function(){return p},HM:function(){return M},Lf:function(){return m},MC:function(){return _},NI:function(){return s},Nd:function(){return E},PO:function(){return P},SL:function(){return I},Tv:function(){return w},Un:function(){return R},Ve:function(){return T},Yi:function(){return b},bY:function(){return y},dS:function(){return O},lT:function(){return a},mT:function(){return A},rP:function(){return S},uw:function(){return f},y8:function(){return x}});var i,n,o,s,a,l,h,u=r(31543),c=r(20763),d=r(2714),g=r(15095);(i=s||(s={})).DIV_BY_ZERO="DIV_BY_ZERO",i.NAME="NAME",i.VALUE="VALUE",i.NUM="NUM",i.NA="NA",i.CYCLE="CYCLE",i.REF="REF",i.SPILL="SPILL",i.LIC="LIC",i.ERROR="ERROR",(n=a||(a={})).FORMULA="FORMULA",n.VALUE="VALUE",n.ARRAY="ARRAY",n.EMPTY="EMPTY",n.ARRAYFORMULA="ARRAYFORMULA";let p=(e,t)=>e instanceof u.H7?e.isLeftCorner(t)?a.ARRAYFORMULA:a.ARRAY:e instanceof u.Gs||e instanceof u.Oj?a.FORMULA:e instanceof u.VO?a.VALUE:a.EMPTY;(o=l||(l={})).EMPTY="EMPTY",o.NUMBER="NUMBER",o.STRING="STRING",o.BOOLEAN="BOOLEAN",o.ERROR="ERROR",(h||(h={})).NUMBER="NUMBER";let f=Object.assign(Object.assign({},l),h),m=Object.assign(Object.assign({},l),d.sw),y=e=>{switch(e){case f.EMPTY:return 0;case f.NUMBER:return 1;case f.STRING:return 2;case f.BOOLEAN:return 3;case f.ERROR:return 4}throw Error("Cell value not computed")},w=e=>{if(e===d.OX)return f.EMPTY;if(e instanceof C||e instanceof g.r)return f.ERROR;if("string"==typeof e)return f.STRING;if((0,d.g_)(e))return f.NUMBER;if("boolean"==typeof e)return f.BOOLEAN;throw Error("Cell value not computed")},E=e=>(0,d.g_)(e)?(0,d.I0)(e):w(e),S=e=>(0,d.g_)(e)?(0,d.Kz)(e):void 0;class C{constructor(e,t,r){this.type=e,this.message=t,this.root=r}static parsingError(e){return new C(s.ERROR,`${c.B.ParseError}${e?" "+e:""}`)}attachRootVertex(e){return void 0===this.root?new C(this.type,this.message,e):this}}let R=(e,t)=>({sheet:e,row:t}),b=e=>e.row<0,T=(e,t)=>({sheet:e,col:t}),N=e=>e.col<0,A=(e,t,r)=>({sheet:e,col:t,row:r}),I=e=>e.col<0||e.row<0,M=(e,t,r,i)=>A(t,e.col+r,e.row+i),O=e=>`${e.sheet},${e.row},${e.col}`;function x(e){return e&&("object"==typeof e||"function"==typeof e)&&"number"==typeof(null==e?void 0:e.sheet)&&"number"==typeof(null==e?void 0:e.col)&&"number"==typeof(null==e?void 0:e.row)}let _=(e,t)=>{var r;return null!==(r=e.sheet)&&void 0!==r?r:t.sheet},P=(e,t)=>e.sheet===t.sheet&&e.col===t.col&&e.row===t.row},88529:function(e,t,r){"use strict";r.d(t,{J5:function(){return i},lj:function(){return u}});var i,n=r(31387),o=r(17808),s=r(20763),a=r(57035),l=r(31952),h=r(2714);!function(e){class t{constructor(e){this.value=e,this.value=(0,h.zV)(this.value,(0,l.h6)((0,h.t_)(this.value)))}}e.Number=t;
134class r{constructor(e){this.value=e}}e.String=r;class i{constructor(e){this.value=e}}e.Boolean=i;class o{static getSingletonInstance(){return o.instance||(o.instance=new o),o.instance}}e.Empty=o;class s{constructor(e){this.formula=e}}e.Formula=s;class a{constructor(e,t){this.value=new n.D5(e,t)}}e.Error=a}(i||(i={}));class u{constructor(e,t,r){this.config=e,this.dateHelper=t,this.numberLiteralsHelper=r}parse(e){if(null==e)return i.Empty.getSingletonInstance();if("number"==typeof e)return(0,l.Uh)(e)?new i.Error(n.NI.NUM,s.B.ValueLarge):new i.Number(e);if("boolean"==typeof e)return new i.Boolean(e);if(e instanceof Date){let t=this.dateHelper.dateToNumber({day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear()})+(0,o.kf)({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()+e.getMilliseconds()/1e3});return t<0?new i.Error(n.NI.NUM,s.B.DateBounds):new i.Number(t%1==0?new h.kc(t,"Date()"):t<1?new h.B2(t,"Date()"):new h.PC(t,"Date()"))}if("string"==typeof e){if(function(e){let t=e.toLowerCase();return"true"===t||"false"===t}(e))return new i.Boolean("true"===e.toLowerCase());if(e.startsWith("="))return new i.Formula(e);{if(function(e,t){let r=e.toUpperCase();return/#[A-Za-z0-9\/]+[?!]?/.test(r)&&Object.prototype.hasOwnProperty.call(t,r)}(e,this.config.errorMapping))return new i.Error(this.config.errorMapping[e.toUpperCase()]);let t,r=e.trim(),n=0;if(r.endsWith("%"))n=1,r=r.slice(0,r.length-1);else{let e=this.currencyMatcher(r);void 0!==e&&(n=2,[t,r]=e)}let o=this.numberLiteralsHelper.numericStringToMaybeNumber(r);if(void 0!==o){let e;return e=1===n?new h.mg(o/100):2===n?new h.Sx(o,t):o,new i.Number(e)}let s=this.dateHelper.dateStringToDateNumber(r);return void 0!==s?new i.Number(s):new i.String(e.startsWith("'")?e.slice(1):e)}}throw new a.Wh(e)}currencyMatcher(e){for(let t of this.config.currencySymbol){if(e.startsWith(t))return[t,e.slice(t.length)];if(e.endsWith(t))return[t,e.slice(0,e.length-t.length)]}}}},69019:function(e,t,r){"use strict";r.d(t,{r:function(){return i}});class i{constructor(e,t,r){var i;this.value=t,this.address=r,this.type=e.type,this.message=null!==(i=e.message)&&void 0!==i?i:""}toString(){return this.value}valueOf(){return this.value}}},90745:function(e,t,r){"use strict";r.d(t,{F:function(){return c},x:function(){return s}});var i,n,o,s,a=r(58485),l=r(31387),h=r(57035);(i=o||(o={}))[i.COPY=0]="COPY",i[i.CUT=1]="CUT",(n=s||(s={}))[n.VALUE=0]="VALUE",n[n.EMPTY=1]="EMPTY",n[n.FORMULA=2]="FORMULA",n[n.PARSING_ERROR=3]="PARSING_ERROR";class u{constructor(e,t,r,i,n){this.sourceLeftCorner=e,this.width=t,this.height=r,this.type=i,this.content=n}*getContent(e){if(void 0!==this.content)for(let t=0;t<this.height;++t)for(let r=0;r<this.width;++r)yield[(0,l.mT)(e.sheet,e.col+r,e.row+t),this.content[t][r]]}}class c{constructor(e,t,r){this.dependencyGraph=t,this.operations=r,this.maxRows=e.maxRows,this.maxColumns=e.maxColumns}cut(e,t,r){this.clipboard=new u(e,t,r,o.CUT)}copy(e,t,r){let i=[];for(let n=0;n<r;++n){i[n]=[];for(let r=0;r<t;++r){let t=this.operations.getClipboardCell((0,l.mT)(e.sheet,e.col+r,e.row+n));i[n].push(t)}}this.clipboard=new u(e,t,r,o.COPY,i)}abortCut(){this.clipboard&&this.clipboard.type===o.CUT&&this.clear()}clear(){this.clipboard=void 0}ensureItIsPossibleToCopyPaste(e){if(void 0===this.clipboard)return;if((0,l.SL)(e)||!this.dependencyGraph.sheetMapping.hasSheetWithId(e.sheet))throw new h.vn("a valid target address.");let t=a.gG.spanFrom(e,this.clipboard.width,this.clipboard.height);if(t.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new h.mk;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw Error("It is not possible to paste onto an array")}isCutClipboard(){return void 0!==this.clipboard&&this.clipboard.type===o.CUT}isCopyClipboard(){return void 0!==this.clipboard&&this.clipboard.type===o.COPY}}},77080:function(e,t,r){"use strict";r.d(t,{D:function(){return E},_:function(){return C}});var i=r(70149),n=r(87034),o=r(17808),s=r(4731),a=r(57035),l=r(24623);let h="length",u=e=>parseInt(e,16),c=e=>parseInt(e,10),d=e=>(e+"").replace(/\-/g,""),g=(e,t,r)=>e.substr(t,r),p=e=>
134e.codePointAt(0)-65,f={invalid:()=>"The license key for HyperFormula is invalid.",expired:({keyValidityDate:e})=>`The license key for HyperFormula expired on ${e}, and is not valid for the installed version.`,missing:()=>"The license key for HyperFormula is missing."},m=!1;var y=r(49015);let w=new WeakMap;class E{constructor(e={},t=!0){let{accentSensitive:r,caseSensitive:n,caseFirst:s,chooseAddressMappingPolicy:a,context:l,currencySymbol:S,dateFormats:C,decimalSeparator:R,evaluateNullToZero:b,functionArgSeparator:T,functionPlugins:N,ignorePunctuation:A,leapYear1900:I,localeLang:M,language:O,ignoreWhiteSpace:x,licenseKey:_,matchWholeCell:P,arrayColumnSeparator:L,arrayRowSeparator:k,maxRows:D,maxColumns:H,nullYear:B,nullDate:F,parseDateTime:V,precisionEpsilon:U,precisionRounding:W,stringifyDateTime:j,stringifyDuration:G,smartRounding:$,timeFormats:z,thousandSeparator:Y,useArrayArithmetic:K,useStats:X,undoLimit:q,useColumnIndex:Z,useRegularExpressions:Q,useWildcards:J}=e;t&&E.warnDeprecatedOptions(e),this.useArrayArithmetic=(0,i.Sw)(K,"boolean","useArrayArithmetic"),this.accentSensitive=(0,i.Sw)(r,"boolean","accentSensitive"),this.caseSensitive=(0,i.Sw)(n,"boolean","caseSensitive"),this.caseFirst=(0,i.Sw)(s,["upper","lower","false"],"caseFirst"),this.ignorePunctuation=(0,i.Sw)(A,"boolean","ignorePunctuation"),this.chooseAddressMappingPolicy=null!=a?a:E.defaultConfig.chooseAddressMappingPolicy,this.dateFormats=[...(0,i.lK)(C,Array.isArray,"array","dateFormats")],this.timeFormats=[...(0,i.lK)(z,Array.isArray,"array","timeFormats")],this.functionArgSeparator=(0,i.Sw)(T,"string","functionArgSeparator"),this.decimalSeparator=(0,i.Sw)(R,[".",","],"decimalSeparator"),this.language=(0,i.Sw)(O,"string","language"),this.ignoreWhiteSpace=(0,i.Sw)(x,["standard","any"],"ignoreWhiteSpace"),this.licenseKey=(0,i.Sw)(_,"string","licenseKey"),this.thousandSeparator=(0,i.Sw)(Y,["",","," ","."],"thousandSeparator"),this.arrayColumnSeparator=(0,i.Sw)(L,[",",";"],"arrayColumnSeparator"),this.arrayRowSeparator=(0,i.Sw)(k,[";","|"],"arrayRowSeparator"),this.localeLang=(0,i.Sw)(M,"string","localeLang"),this.functionPlugins=[...null!=N?N:E.defaultConfig.functionPlugins],this.smartRounding=(0,i.Sw)($,"boolean","smartRounding"),this.evaluateNullToZero=(0,i.Sw)(b,"boolean","evaluateNullToZero"),this.nullYear=(0,i.Sw)(B,"number","nullYear"),(0,i.NU)(this.nullYear,"nullYear",0),(0,i.XX)(this.nullYear,"nullYear",100),this.precisionRounding=(0,i.Sw)(W,"number","precisionRounding"),(0,i.NU)(this.precisionRounding,"precisionRounding",0),this.precisionEpsilon=(0,i.Sw)(U,"number","precisionEpsilon"),(0,i.NU)(this.precisionEpsilon,"precisionEpsilon",0),this.useColumnIndex=(0,i.Sw)(Z,"boolean","useColumnIndex"),this.useStats=(0,i.Sw)(X,"boolean","useStats"),this.parseDateTime=(0,i.Sw)(V,"function","parseDateTime"),this.stringifyDateTime=(0,i.Sw)(j,"function","stringifyDateTime"),this.stringifyDuration=(0,i.Sw)(G,"function","stringifyDuration"),this.translationPackage=y.G.getLanguage(this.language),this.errorMapping=this.translationPackage.buildErrorMapping(),this.nullDate=(0,i.lK)(F,o.cA,"IDate","nullDate"),this.leapYear1900=(0,i.Sw)(I,"boolean","leapYear1900"),this.undoLimit=(0,i.Sw)(q,"number","undoLimit"),this.useRegularExpressions=(0,i.Sw)(Q,"boolean","useRegularExpressions"),this.useWildcards=(0,i.Sw)(J,"boolean","useWildcards"),this.matchWholeCell=(0,i.Sw)(P,"boolean","matchWholeCell"),(0,i.NU)(this.undoLimit,"undoLimit",0),this.maxRows=(0,i.Sw)(D,"number","maxRows"),(0,i.NU)(this.maxRows,"maxRows",1),this.maxColumns=(0,i.Sw)(H,"number","maxColumns"),this.currencySymbol=this.setupCurrencySymbol(S),(0,i.NU)(this.maxColumns,"maxColumns",1),this.context=l,w.set(this,{licenseKeyValidityState:function(e){let t={template:"missing",vars:{}};if("gpl-v3"===e||"internal-use-in-handsontable"===e)t.template="valid";else if("string"==typeof e&&function(e){if((e=(e+"").replace(/\-/g,""))[h]!==p("Z"))return!1;let t=0;return[[0,p("G")+1],[p("H"),p("H")-1],[p("G")+p("H"),p("G")]].reduce((r,[i,n],o)=>(r|=(c(`${c(u(g(e,t+i-(0===o?0:2),n+(o?2:0)))+(u(g(e,t+i+n,2))+[]).padStart(2,"0"))}`)%97||2)>>1,t+=2,r),p("A"))==="1">>1}(e)){let[r,i,n]="18/12/2025".split("/"),o=Math.floor(new Date(`${i}/${r}/${n}`).getTime()/864e5),s=25===d(e)[h]?u(g(d(e),u("12"),p("F")))/(u(g(d(e),p("
134C"),p("Y")>>4))||(~~![][h]<<3)+1):0;t.vars.keyValidityDate=function(e){let t=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],r=e.getDate(),i=e.getFullYear();return`${t} ${r}, ${i}`}(new Date((s+1)*864e5)),o>s?t.template="expired":t.template="valid"}else""!==e&&(t.template="invalid");return m||"valid"===t.template||(console.warn(f[t.template](t.vars)),m=!0),t.template}(this.licenseKey)}),(0,i.J2)({value:this.decimalSeparator,name:"decimalSeparator"},{value:this.functionArgSeparator,name:"functionArgSeparator"},{value:this.thousandSeparator,name:"thousandSeparator"}),(0,i.J2)({value:this.arrayRowSeparator,name:"arrayRowSeparator"},{value:this.arrayColumnSeparator,name:"arrayColumnSeparator"})}setupCurrencySymbol(e){let t=[...(0,i.lK)(e,Array.isArray,"array","currencySymbol")];return t.forEach(e=>{if("string"!=typeof e)throw new a.Qv("string[]","currencySymbol");if(""===e)throw new a.jS("currencySymbol")}),t}get licenseKeyValidityState(){return w.get(this).licenseKeyValidityState}getConfig(){return S(this)}mergeConfig(e){let t=Object.assign({},this.getConfig(),e);return E.warnDeprecatedOptions(e),new E(t,!1)}static warnDeprecatedOptions(e){}static warnDeprecatedIfUsed(e,t,r,i){void 0!==e&&(void 0===i?console.warn(`${t} option is deprecated since ${r}`):console.warn(`${t} option is deprecated since ${r}, please use ${i}`))}}function S(e){var t;let r={};for(let i in E.defaultConfig){let n=null!==(t=e[i])&&void 0!==t?t:E.defaultConfig[i];Array.isArray(n)?r[i]=[...n]:r[i]=n}return r}function C(){return S({})}E.defaultConfig={accentSensitive:!1,currencySymbol:["$"],caseSensitive:!1,caseFirst:"lower",context:void 0,chooseAddressMappingPolicy:new s.Ut,dateFormats:["DD/MM/YYYY","DD/MM/YY"],decimalSeparator:".",evaluateNullToZero:!1,functionArgSeparator:",",functionPlugins:[],ignorePunctuation:!1,language:"enGB",ignoreWhiteSpace:"standard",licenseKey:"",leapYear1900:!1,localeLang:"en",matchWholeCell:!0,arrayColumnSeparator:",",arrayRowSeparator:";",maxRows:4e4,maxColumns:18278,nullYear:30,nullDate:{year:1899,month:12,day:30},parseDateTime:n.T,precisionEpsilon:1e-13,precisionRounding:10,smartRounding:!0,stringifyDateTime:l.sO,stringifyDuration:l.L$,timeFormats:["hh:mm","hh:mm:ss.sss"],thousandSeparator:"",undoLimit:20,useRegularExpressions:!1,useWildcards:!0,useColumnIndex:!1,useStats:!1,useArrayArithmetic:!1}},61973:function(e,t,r){"use strict";r.d(t,{K:function(){return o}});var i=r(31387),n=r(15095);class o{constructor(){this.changes=new Map}static empty(){return new o}addAll(e){for(let t of e.changes.values())this.add(t.address,t);return this}addChange(e,t,r){this.addInterpreterValue(e,t,r)}exportChanges(e){let t=[];
134return this.changes.forEach(r=>{let i=e.exportChange(r);Array.isArray(i)?t=t.concat(i):t.push(i)}),t}getChanges(){return Array.from(this.changes.values())}isEmpty(){return 0===this.changes.size}add(e,t){let r=t.value;if(r instanceof n.r)for(let t of r.effectiveAddressesFromData(e))this.changes.delete((0,i.dS)(t));this.changes.set((0,i.dS)(e),t)}addInterpreterValue(e,t,r){this.add(t,{address:t,value:e,oldValue:r})}}},87034:function(e,t,r){"use strict";r.d(t,{T:function(){return h},c:function(){return i}});let i=RegExp("^ss(\\.(s+|0+))?$"),n=RegExp("^[0-9/.\\-: ]+[ap]?m?$"),o=RegExp("\\s+"),s=RegExp("[ /.-]"),a=d(function(e){let t=e.toLowerCase().trim(),r=(t.endsWith("am/pm")?t.substring(0,t.length-5):t.endsWith("a/p")?t.substring(0,e.length-3):t).trim().split(":");return{itemsCount:r.length,hourItem:r.indexOf("hh"),minuteItem:r.indexOf("mm"),secondItem:r.findIndex(e=>i.test(e))}}),l=d(function(e){let t=e.toLowerCase().trim().split(s);return{itemsCount:t.length,dayItem:t.indexOf("dd"),monthItem:t.indexOf("mm"),shortYearItem:t.indexOf("yy"),longYearItem:t.indexOf("yyyy")}});function h(e,t,r){var i;if(void 0===t&&void 0===r)return;let a=e.replace(o," ").trim().toLowerCase();if(i=a,!n.test(i))return;let l=a.substring(a.length-2);"am"===l||"pm"===l?a=a.substring(0,a.length-2).trim():"a"===(l=a.substring(a.length-1))||"p"===l?a=a.substring(0,a.length-1).trim():l=void 0;let h=a.split(s);h.length>=2&&h[h.length-2].includes(":")&&(h[h.length-2]=h[h.length-2]+"."+h[h.length-1],h.pop());let d=h[h.length-1].split(":");if(void 0!==l&&d.push(l),1===h.length)return u(d,r);if(1===d.length)return c(h,t);let g=c(h.slice(0,h.length-1),t),p=u(d,r);return void 0===g?void 0:void 0===p?void 0:Object.assign(Object.assign({},g),p)}function u(e,t){var r,i,n;let o;if(void 0===t)return;let{itemsCount:s,hourItem:l,minuteItem:h,secondItem:u}=a(t);if("am"===e[e.length-1]||"a"===e[e.length-1]?(o=!1,e.pop()):("pm"===e[e.length-1]||"p"===e[e.length-1])&&(o=!0,e.pop()),e.length!==s)return;let c=Number(null!==(r=e[u])&&void 0!==r?r:"0");if(!Number.isFinite(c))return;let d=Number(null!==(i=e[h])&&void 0!==i?i:"0");if(!(Number.isFinite(d)&&Number.isInteger(d)))return;let g=Number(null!==(n=e[l])&&void 0!==n?n:"0");if(Number.isFinite(g)&&Number.isInteger(g)&&(void 0===o||!(g<0)&&!(g>12)))return{hours:void 0!==o?g%12+(o?12:0):g,minutes:d,seconds:Math.round(1e3*c)/1e3}}function c(e,t){var r;if(void 0===t)return;let{itemsCount:i,dayItem:n,monthItem:o,shortYearItem:s,longYearItem:a}=l(t);if(e.length!==i)return;let h=Number(e[n]);if(!(Number.isFinite(h)&&Number.isInteger(h)))return;let u=Number(e[o]);if(!(Number.isFinite(u)&&Number.isInteger(u))||e[a]&&e[s])return;let c=Number(null!==(r=e[a])&&void 0!==r?r:e[s]);if(Number.isFinite(c)&&Number.isInteger(c)&&(!e[a]||!(c<1e3)&&!(c>9999))&&(!e[s]||!(c<0)&&!(c>99)))return{year:c,month:u,day:h}}function d(e){let t={};return r=>{let i=t[r];if(void 0!==i)return i;let n=e(r);return t[r]=n,n}}},17808:function(e,t,r){"use strict";r.d(t,{Fo:function(){return f},HD:function(){return h},XF:function(){return u},cA:function(){return s},dG:function(){return c},eS:function(){return g},fT:function(){return a},kf:function(){return p},lg:function(){return d}});var i=r(2714);let n=[31,28,31,30,31,30,31,31,30,31,30,31],o=[0,31,59,90,120,151,181,212,243,273,304,334];function s(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"year"in e&&"number"==typeof e.year&&"month"in e&&"number"==typeof e.month&&"day"in e&&"number"==typeof e.day}function a(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"hours"in e&&"number"==typeof e.hours&&"minutes"in e&&"number"==typeof e.minutes&&"seconds"in e&&"number"==typeof e.seconds}let l={year:9999,month:12,day:31};class h{constructor(e){this.config=e,this.minDateAbsoluteValue=this.dateToNumberFromZero(e.nullDate),this.maxDateValue=this.dateToNumber(l),this.leapYear1900=e.leapYear1900,!this.leapYear1900&&0<=this.dateToNumber({year:1900,month:2,day:28})?this.epochYearZero=this.numberToSimpleDate(2).year:this.epochYearZero=this.numberToSimpleDate(1).year,this.parseDateTime=e.parseDateTime}getWithinBounds(e){return e<=this.maxDateValue&&e>=0?e:void 0}dateStringToDateNumber(e){let{dateTime:t,dateFormat:r="",timeFormat:n=""}=this.parseDateTimeFromConfigFormats(e);if(void 0!==t)return a(t)?s(t)?new i.PC(p(t)+this.dateToNumber(t),r+" "+n):new i.B2(p(t),n):s(t)?new i.kc(this.dateToNumber(t),r):0}parseDateTimeFromConfigFormats(e){return this.parseDateTimeFromFormats(e,this.config.dateFormats,this.config.timeFormats)}getNullYear(){return this.config.nullYear}getEpochYearZero(){return this.epochYearZero}isValidDate(e){return!(isNaN(e.year)||isNaN(e.month)||isNaN(e.day))&&e.day===Math.round(e.day)&&e.month===Math.round(e.month)&&e.year===Math.round(e.year)&&!(e.year<1582)&&!(e.month<1)&&!(e.month>12)&&!(e.day<1)&&(this.isLeapYear(e.year)&&2===e.month?e.day<=29:e.day<=n[e.month-1])}dateToNumber(e){return this.dateToNumberFromZero(e)-this.minDateAbsoluteValue}relativeNumberToAbsoluteNumber(e){return e+this.minDateAbsoluteValue-(this.leapYear1900?1:0)}numberToSimpleDate(e){var t;let r;let i=Math.floor(e)+this.minDateAbsoluteValue,n=Math.floor(i/365.2425);this.dateToNumberFromZero({year:n+1,month:1,day:1})<=i?n++:this.dateToNumberFromZero({year:n-1,month:1,day:1})>i&&n--;let s=i-this.dateToNumberFromZero({year:n,month:1,day:1}),a=(t=s-(this.isLeapYear(n)&&s>=59?1:0),r=0,181<=t&&(r+=6),o[r+3]<=t&&(r+=3),o[r+2]<=t?r+=2:o[r+1]<=t&&(r+=1),r),l=s-o[a]-(this.isLeapYear(n)&&a>1?1:0);return{year:n,month:a+1,day:l+1}}numberToSimpleDateTime(e){let t=g(e%1),r=Math.floor(t.hours/24);return t.hours=t.hours%24,Object.assign(Object.assign({},this.numberToSimpleDate(Math.floor(e)+r)),t)}leapYearsCount(e){return Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)+(this.config.leapYear1900&&e>=1900?1:0)}daysInMonth(e,t){return this.isLeapYear(e)&&2===t?29:n[t-1]}endOfMonth(e){return{year:e.year,month:e.month,day:this.daysInMonth(e.year,e.month)}}
134toBasisUS(e,t){return 31===e.day&&(e.day=30),30===e.day&&31===t.day&&(t.day=30),2===e.month&&e.day===this.daysInMonth(e.year,e.month)&&(e.day=30,2===t.month&&t.day===this.daysInMonth(t.year,t.month)&&(t.day=30)),[e,t]}yearLengthForBasis(e,t){return e.year!==t.year?e.year+1!==t.year||e.month<t.month||e.month===t.month&&e.day<t.day?(this.leapYearsCount(t.year)-this.leapYearsCount(e.year-1))/(t.year-e.year+1)+365:this.countLeapDays(t)!==this.countLeapDays({year:e.year,month:e.month,day:e.day-1})?366:365:this.isLeapYear(e.year)?366:365}parseSingleFormat(e,t,r){let i=this.parseDateTime(e,t,r);if(!s(i)||(i.year>=0&&i.year<100&&(i.year<this.getNullYear()?i.year+=2e3:i.year+=1900),this.isValidDate(i)))return i}parseDateTimeFromFormats(e,t,r){let i=0===t.length?[void 0]:t,n=0===r.length?[void 0]:r;for(let t of i)for(let r of n){let i=this.parseSingleFormat(e,t,r);if(void 0!==i)return{dateTime:i,timeFormat:r,dateFormat:t}}return{}}countLeapDays(e){return e.month>2||2===e.month&&e.day>=29?this.leapYearsCount(e.year):this.leapYearsCount(e.year-1)}dateToNumberFromZero(e){return 365*e.year+o[e.month-1]+e.day-1+(e.month<=2?this.leapYearsCount(e.year-1):this.leapYearsCount(e.year))}isLeapYear(e){return!(e%4)&&(!!(e%100)||!(e%400)||1900===e&&this.config.leapYear1900)}}function u(e,t){let r=12*e.year+e.month-1+t;return{year:Math.floor(r/12),month:r%12+1,day:e.day}}function c(e){return{year:e.year,month:e.month,day:Math.min(e.day,n[e.month-1])}}function d(e){return Math.round(86400*e)/86400}function g(e){let t=86400*e,r=function(e,t=1){return Math.round(e*t)/t}(t%60,1e5)%60,i=(t-r)/60,n=Math.round(i%60)%60;return{hours:Math.round((i-n)/60),minutes:n,seconds:r}}function p(e){return((e.seconds/60+e.minutes)/60+e.hours)/24}function f(e){return{year:e.year,month:e.month,day:Math.min(30,e.day)}}},4731:function(e,t,r){"use strict";r.d(t,{Ut:function(){return n}});var i=r(49039);r(51415);class n{call(){return i.V}}},49039:function(e,t,r){"use strict";r.d(t,{V:function(){return n}});var i=r(31387);class n{constructor(e,t){this.width=e,this.height=t,this.mapping=Array(t);for(let r=0;r<t;r++)this.mapping[r]=Array(e)}getCell(e){return this.getCellVertex(e.col,e.row)}setCell(e,t){this.width=Math.max(this.width,e.col+1),this.height=Math.max(this.height,e.row+1),this.mapping[e.row]||(this.mapping[e.row]=Array(this.width)),this.mapping[e.row][e.col]=t}has(e){let t=this.mapping[e.row];return!!t&&!!t[e.col]}getHeight(){return this.height}getWidth(){return this.width}removeCell(e){void 0!==this.mapping[e.row]&&delete this.mapping[e.row][e.col]}addRows(e,t){let r=[];for(let e=0;e<t;e++)r.push(Array(this.width));this.mapping.splice(e,0,...r),this.height+=t}addColumns(e,t){for(let r=0;r<this.height;r++)void 0!==this.mapping[r]&&this.mapping[r].splice(e,0,...Array(t));this.width+=t}removeRows(e){this.mapping.splice(e.rowStart,e.numberOfRows);let t=Math.max(0,Math.min(this.height-1,e.rowEnd)-e.rowStart+1);this.height=Math.max(0,this.height-t)}removeColumns(e){for(let t=0;t<this.height;t++)void 0!==this.mapping[t]&&this.mapping[t].splice(e.columnStart,e.numberOfColumns);let t=Math.max(0,Math.min(this.width-1,e.columnEnd)-e.columnStart+1);this.width=Math.max(0,this.width-t)}*getEntries(e){for(let t=0;t<this.height;++t)for(let r=0;r<this.width;++r){let n=this.getCellVertex(r,t);n&&(yield[(0,i.mT)(e,r,t),n])}}*verticesFromColumn(e){for(let t=0;t<this.height;++t){let r=this.getCellVertex(e,t);r&&(yield r)}}*verticesFromRow(e){for(let t=0;t<this.width;++t){let r=this.getCellVertex(t,e);r&&(yield r)}}*verticesFromColumnsSpan(e){for(let t=e.columnStart;t<=e.columnEnd;++t)for(let e=0;e<this.height;++e){let r=this.getCellVertex(t,e);r&&(yield r)}}*verticesFromRowsSpan(e){for(let t=0;t<this.width;++t)for(let r=e.rowStart;r<=e.rowEnd;++r){let e=this.getCellVertex(t,r);e&&(yield e)}}*entriesFromRowsSpan(e){for(let t=0;t<this.width;++t)for(let r=e.rowStart;r<=e.rowEnd;++r){let n=this.getCellVertex(t,r);n&&(yield[(0,i.mT)(e.sheet,t,r),n])}}*entriesFromColumnsSpan(e){for(let t=e.columnStart;t<=e.columnEnd;++t)for(let r=0;r<this.height;++r){let n=this.getCellVertex(t,r);n&&(yield[(0,i.mT)(e.sheet,t,r),n])}}*vertices(){for(let e=0;e<this.height;++e)for(let t=0;t<this.width;++t){let r=this.getCellVertex(t,e);r&&(yield r)}}getCellVertex(e,t){var r;return null===(r=this.mapping[t])||void 0===r?void 0:r[e]}}},51415:function(e,t,r){"use strict";r.d(t,{U:function(){return n}});var i=r(31387);
134class n{constructor(e,t){this.width=e,this.height=t,this.mapping=new Map}getCell(e){var t;return null===(t=this.mapping.get(e.col))||void 0===t?void 0:t.get(e.row)}setCell(e,t){this.width=Math.max(this.width,e.col+1),this.height=Math.max(this.height,e.row+1);let r=this.mapping.get(e.col);r||(r=new Map,this.mapping.set(e.col,r)),r.set(e.row,t)}has(e){var t;return!!(null===(t=this.mapping.get(e.col))||void 0===t?void 0:t.get(e.row))}getHeight(){return this.height}getWidth(){return this.width}removeCell(e){var t;null===(t=this.mapping.get(e.col))||void 0===t||t.delete(e.row)}addRows(e,t){this.mapping.forEach(r=>{let i=new Map;r.forEach((n,o)=>{o>=e&&(i.set(o+t,n),r.delete(o))}),i.forEach((e,t)=>{r.set(t,e)})}),this.height+=t}addColumns(e,t){let r=new Map;this.mapping.forEach((i,n)=>{n>=e&&(r.set(n+t,i),this.mapping.delete(n))}),r.forEach((e,t)=>{this.mapping.set(t,e)}),this.width+=t}removeRows(e){this.mapping.forEach(t=>{let r=new Map;t.forEach((i,n)=>{n>=e.rowStart&&(t.delete(n),n>e.rowEnd&&r.set(n-e.numberOfRows,i))}),r.forEach((e,r)=>{t.set(r,e)})});let t=Math.max(0,Math.min(this.height-1,e.rowEnd)-e.rowStart+1);this.height=Math.max(0,this.height-t)}removeColumns(e){let t=new Map;this.mapping.forEach((r,i)=>{i>=e.columnStart&&(this.mapping.delete(i),i>e.columnEnd&&t.set(i-e.numberOfColumns,r))}),t.forEach((e,t)=>{this.mapping.set(t,e)});let r=Math.max(0,Math.min(this.width-1,e.columnEnd)-e.columnStart+1);this.width=Math.max(0,this.width-r)}*getEntries(e){for(let[t,r]of this.mapping)for(let[n,o]of r)yield[(0,i.mT)(e,t,n),o]}*verticesFromColumn(e){let t=this.mapping.get(e);if(void 0!==t)for(let[e,r]of t)yield r}*verticesFromRow(e){for(let t of this.mapping.values()){let r=t.get(e);void 0!==r&&(yield r)}}*verticesFromColumnsSpan(e){for(let t of e.columns()){let e=this.mapping.get(t);if(void 0!==e)for(let[t,r]of e)yield r}}*verticesFromRowsSpan(e){for(let t of this.mapping.values())for(let r of e.rows()){let e=t.get(r);void 0!==e&&(yield e)}}*entriesFromRowsSpan(e){for(let[t,r]of this.mapping.entries())for(let n of e.rows()){let o=r.get(n);void 0!==o&&(yield[(0,i.mT)(e.sheet,t,n),o])}}*entriesFromColumnsSpan(e){for(let t of e.columns()){let r=this.mapping.get(t);if(void 0!==r)for(let[n,o]of r.entries())yield[(0,i.mT)(e.sheet,t,n),o]}}*vertices(){for(let[e,t]of this.mapping)for(let[e,r]of t)void 0!==r&&(yield r)}}},11e3:function(e,t,r){"use strict";r.d(t,{Gs:function(){return d},H7:function(){return c},_Z:function(){return u}});var i=r(58485),n=r(90316),o=r(77023),s=r(31387),a=r(20763),l=r(2714),h=r(79882);class u{constructor(e,t,r){this.formula=e,this.cellAddress=t,this.version=r}get width(){return 1}get height(){return 1}static fromAst(e,t,r,i){return r.isScalar()?new d(e,t,i):new c(e,t,r,i)}getFormula(e){return this.ensureRecentData(e),this.formula}ensureRecentData(e){if(this.version!=e.version()){let[t,r,i]=e.applyTransformations(this.formula,this.cellAddress,this.version);this.formula=t,this.cellAddress=r,this.version=i}}getAddress(e){return this.ensureRecentData(e),this.cellAddress}}class c extends u{constructor(e,t,r,i=0){super(e,t,i),r.isRef?this.array=new o.hm(new s.D5(s.NI.REF,a.B.NoSpaceForArrayResult),n.J.error()):this.array=new o.FK(r)}get width(){return this.array.width()}get height(){return this.array.height()}get sheet(){return this.cellAddress.sheet}get leftCorner(){return this.cellAddress}setCellValue(e){if(e instanceof s.D5)return this.setErrorValue(e),e;let t=o.Ms.fromInterpreterValue(e);return t.resize(this.array.size),this.array=t,e}getCellValue(){if(this.array instanceof o.FK)throw Error("Array not computed yet.");return this.array.simpleRangeValue()}valueOrUndef(){if(!(this.array instanceof o.FK))return this.array.simpleRangeValue()}getArrayCellValue(e){let t=e.col-this.cellAddress.col,r=e.row-this.cellAddress.row;try{return this.array.get(t,r)}catch(e){return new s.D5(s.NI.REF)}}getArrayCellRawValue(e){let t=this.getArrayCellValue(e);if(!(t instanceof s.D5)&&t!==l.OX)return(0,l.t_)(t)}setArrayCellValue(e,t){let r=e.col-this.cellAddress.col,i=e.row-this.cellAddress.row;this.array instanceof o.Ms&&this.array.set(r,i,t)}setNoSpace(){return this.array=new o.hm(new s.D5(s.NI.SPILL,a.B.NoSpaceForArrayResult),n.J.error()),this.getCellValue()}getRange(){return i.gG.spanFrom(this.cellAddress,this.width,this.height)}getRangeOrUndef(){return i.gG.spanFromOrUndef(this.cellAddress,this.width,this.height)}setAddress(e){this.cellAddress=e}setFormula(e){this.formula=e}spansThroughSheetRows(e,t,r=t){return this.cellAddress.sheet===e&&this.cellAddress.row<=r&&t<this.cellAddress.row+this.height}spansThroughSheetColumn(e,t,r=t){return this.cellAddress.sheet===e&&this.cellAddress.col<=r&&t<this.cellAddress.col+this.width}isComputed(){return!(this.array instanceof o.FK)}columnsFromArray(){return h.N.fromNumberOfColumns(this.cellAddress.sheet,this.cellAddress.col,this.width)}rowsFromArray(){return h.$.fromNumberOfRows(this.cellAddress.sheet,this.cellAddress.row,this.height)}ensureRecentData(e){}isLeftCorner(e){return(0,s.PO)(this.cellAddress,e)}setErrorValue(e){this.array=new o.hm(e,this.array.size)}}class d extends u{constructor(e,t,r){super(e,t,r)}valueOrUndef(){return this.cachedCellValue}setCellValue(e){return this.cachedCellValue=e,this.cachedCellValue}getCellValue(){if(void 0!==this.cachedCellValue)return this.cachedCellValue;throw Error("Value of the formula cell is not computed.")}isComputed(){return void 0!==this.cachedCellValue}}},31543:function(e,t,r){"use strict";r.d(t,{H7:function(){return E.H7},Vt:function(){return H.V},mn:function(){return _},Rw:function(){return P},Oj:function(){return k},BD:function(){return S},Gs:function(){return E.Gs},UK:function(){return D.U},VO:function(){return L}});var i,n,o=r(58485),s=r(29319),a=r(31387),l=r(61973),h=r(20763),u=r(2714),c=r(15095),d=r(40263),g=r(68940),p=r(79882),f=r(68724),m=r(57035);class y{constructor(e){this.policy=e,this.mapping=new Map}getCell(e,t={}){let r=this.mapping.get(e.sheet);if(!r){if(t.throwIfSheetNotExists)throw new m.uJ(e.sheet);return}let i=r.getCell(e);if(!i&&t.throwIfCellNotExists)throw Error("Vertex for address missing in AddressMapping");return i}getCellOrThrow(e){let t=this.mapping.get(e.sheet);if(!t)throw new m.uJ(e.sheet);let r=t.getCell(e);if(!r)throw Error("Vertex for address missing in AddressMapping");return r}getStrategyForSheetOrThrow(e){let t=this.mapping.get(e);if(void 0===t)throw new m.uJ(e);return t}addSheetWithStrategy(e,t,r={throwIfSheetAlreadyExists:!0}){let i=this.mapping.get(e);if(i){if(r.throwIfSheetAlreadyExists)throw Error("Sheet already added");return i}return this.mapping.set(e,t),t}addSheetOrChangeStrategy(e,t){let r=this.createStrategyBasedOnBoundaries(t),i=this.mapping.get(e);return i?r instanceof H.V?i:(this.moveStrategyContent(i,r,e),this.mapping.set(e,r),r):(this.mapping.set(e,r),r)}
134moveStrategyContent(e,t,r){for(let[i,n]of e.getEntries(r))t.setCell(i,n)}addSheetAndSetStrategyBasedOnBoundaries(e,t,r={throwIfSheetAlreadyExists:!0}){this.addSheetWithStrategy(e,this.createStrategyBasedOnBoundaries(t),r)}createStrategyBasedOnBoundaries(e){let{height:t,width:r,fill:i}=e;return new(this.policy.call(i))(r,t)}addSheetStrategyPlaceholderIfNotExists(e){this.mapping.has(e)||this.mapping.set(e,new H.V(0,0))}removeSheetIfExists(e){return this.mapping.delete(e)}getCellValue(e){let t=this.getCell(e);return void 0===t?u.OX:t instanceof E.H7?t.getArrayCellValue(e):t.getCellValue()}getRawValue(e){let t=this.getCell(e);return t instanceof L?t.getValues().rawValue:t instanceof E.H7?t.getArrayCellRawValue(e):null}setCell(e,t){let r=this.mapping.get(e.sheet);if(!r)throw Error("Sheet not initialized");r.setCell(e,t)}moveCell(e,t){let r=this.mapping.get(e.sheet);if(!r)throw Error("Sheet not initialized.");if(this.has(t))throw Error("Cannot move cell. Destination already occupied.");let i=r.getCell(e);if(void 0===i)throw Error("Cannot move cell. No cell with such address.");this.setCell(t,i),this.removeCell(e)}removeCell(e){let t=this.mapping.get(e.sheet);if(!t)throw Error("Sheet not initialized");t.removeCell(e)}has(e){let t=this.mapping.get(e.sheet);return void 0!==t&&t.has(e)}getSheetHeight(e){return this.getStrategyForSheetOrThrow(e).getHeight()}getSheetWidth(e){return this.getStrategyForSheetOrThrow(e).getWidth()}addRows(e,t,r){this.getStrategyForSheetOrThrow(e).addRows(t,r)}removeRows(e){this.getStrategyForSheetOrThrow(e.sheet).removeRows(e)}addColumns(e,t,r){this.getStrategyForSheetOrThrow(e).addColumns(t,r)}removeColumns(e){this.getStrategyForSheetOrThrow(e.sheet).removeColumns(e)}*verticesFromRowsSpan(e){yield*this.mapping.get(e.sheet).verticesFromRowsSpan(e)}*verticesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).verticesFromColumnsSpan(e)}*entriesFromRowsSpan(e){let t=this.getStrategyForSheetOrThrow(e.sheet);yield*t.entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){let t=this.getStrategyForSheetOrThrow(e.sheet);yield*t.entriesFromColumnsSpan(e)}*entries(){for(let[e,t]of this.mapping.entries())yield*t.getEntries(e)}*sheetEntries(e){let t=this.getStrategyForSheetOrThrow(e);yield*t.getEntries(e)}hasAnyEntries(e){return!this.sheetEntries(e).next().done}}class w{constructor(){this.arrayMapping=new Map}getArray(e){let t=this.getArrayByCorner(e.start);if(null==t?void 0:t.getRange().sameAs(e))return t}getArrayByCorner(e){return this.arrayMapping.get((0,a.dS)(e))}setArray(e,t){this.arrayMapping.set((0,a.dS)(e.start),t)}removeArray(e){"string"==typeof e?this.arrayMapping.delete(e):this.arrayMapping.delete((0,a.dS)(e.start))}count(){return this.arrayMapping.size}*arraysInRows(e){for(let[t,r]of this.arrayMapping.entries())r.spansThroughSheetRows(e.sheet,e.rowStart,e.rowEnd)&&(yield[t,r])}*arraysInCols(e){for(let[t,r]of this.arrayMapping.entries())r.spansThroughSheetColumn(e.sheet,e.columnStart,e.columnEnd)&&(yield[t,r])}isFormulaArrayInRow(e,t){for(let r of this.arrayMapping.values())if(r.spansThroughSheetRows(e,t))return!0;return!1}isFormulaArrayInAllRows(e){let t=!0;for(let r of e.rows())this.isFormulaArrayInRow(e.sheet,r)||(t=!1);return t}isFormulaArrayInColumn(e,t){for(let r of this.arrayMapping.values())if(r.spansThroughSheetColumn(e,t))return!0;return!1}isFormulaArrayInAllColumns(e){let t=!0;for(let r of e.columns())this.isFormulaArrayInColumn(e.sheet,r)||(t=!1);return t}isFormulaArrayInRange(e){for(let t of this.arrayMapping.values())if(t.getRange().doesOverlap(e))return!0;return!1}isFormulaArrayAtAddress(e){for(let t of this.arrayMapping.values())if(t.getRange().addressInRange(e))return!0;return!1}moveArrayVerticesAfterRowByRows(e,t,r){this.updateArrayVerticesInSheet(e,(e,i)=>{let n=i.getRange();return t<=n.start.row?[n.shifted(0,r),i]:void 0})}moveArrayVerticesAfterColumnByColumns(e,t,r){this.updateArrayVerticesInSheet(e,(e,i)=>{let n=i.getRange();return t<=n.start.col?[n.shifted(r,0),i]:void 0})}updateArrayVerticesInSheet(e,t){let r=[];for(let[i,n]of this.arrayMapping.entries()){if(n.sheet!==e)continue;let o=t(i,n);void 0!==o&&(this.removeArray(i),r.push(o))}r.forEach(([e,t])=>{this.setArray(e,t)})}}var E=r(11e3);class S{constructor(e){this.range=e,this.functionCache=new Map,this.criterion
134FunctionCache=new Map,this.dependentCacheRanges=new Set,this.bruteForce=!1}get start(){return this.range.start}get end(){return this.range.end}get sheet(){return this.range.start.sheet}getFunctionValue(e){return this.functionCache.get(e)}setFunctionValue(e,t){this.functionCache.set(e,t)}getCriterionFunctionValue(e,t){var r;return null===(r=this.getCriterionFunctionValues(e).get(t))||void 0===r?void 0:r[0]}getCriterionFunctionValues(e){var t;return null!==(t=this.criterionFunctionCache.get(e))&&void 0!==t?t:new Map}setCriterionFunctionValues(e,t){this.criterionFunctionCache.set(e,t)}addDependentCacheRange(e){e!==this&&this.dependentCacheRanges.add(e)}clearCache(){this.functionCache.clear(),this.criterionFunctionCache.clear(),this.dependentCacheRanges.forEach(e=>e.criterionFunctionCache.clear()),this.dependentCacheRanges.clear()}}let C=(e,t,r,i,n)=>{let o,s;if(t instanceof S){let e=t.range.intersectionWith(r);return void 0!==e?Array.from(e.addresses(n)):[]}return t instanceof E._Z?(o=t.getFormula(i),s=t.getAddress(i),(0,g.Vd)(o,e).filter(e=>e instanceof g.CI).map(e=>e.dependency.toSimpleCellAddress(s)).filter(e=>r.addressInRange(e))):[]};(i=n||(n={}))[i.ON_STACK=0]="ON_STACK",i[i.PROCESSED=1]="PROCESSED",i[i.POPPED=2]="POPPED";class R{constructor(e=[],t=[]){this.nodesSparseArray=e,this.edgesSparseArray=t,this.entranceTime=[],this.low=[],this.parent=[],this.inSCC=[],this.nodeStatus=[],this.order=[],this.sccNonSingletons=[],this.timeCounter=0}getTopSortedWithSccSubgraphFrom(e,t,r){let i=e.reverse();return i.forEach(e=>this.runDFS(e)),this.postprocess(i,r,t)}getAdjacentNodeIds(e){return this.edgesSparseArray[e].filter(e=>void 0!==e&&this.nodesSparseArray[e])}runDFS(e){if(void 0!==this.nodeStatus[e])return;this.nodeStatus[e]=n.ON_STACK;let t=[e],r=[];for(;t.length>0;){let e=t[t.length-1];switch(this.nodeStatus[e]){case n.ON_STACK:this.handleOnStack(e,r,t);break;case n.PROCESSED:this.handleProcessed(e,r,t);break;case n.POPPED:t.pop()}}}handleOnStack(e,t,r){this.entranceTime[e]=this.timeCounter,this.low[e]=this.timeCounter,this.timeCounter++,t.push(e),this.getAdjacentNodeIds(e).forEach(t=>{void 0===this.entranceTime[t]&&(r.push(t),this.parent[t]=e,this.nodeStatus[t]=n.ON_STACK)}),this.nodeStatus[e]=n.PROCESSED}handleProcessed(e,t,r){let i=this.entranceTime[e];if(this.getAdjacentNodeIds(e).forEach(t=>{this.inSCC[t]||(i=this.parent[t]===e?Math.min(i,this.low[t]):Math.min(i,this.entranceTime[t]))}),this.low[e]=i,i===this.entranceTime[e]){let r=[];do r.push(t[t.length-1]),t.pop();while(r[r.length-1]!==e);r.forEach(e=>{this.inSCC[e]=!0}),this.order.push(...r),r.length>1&&r.forEach(e=>{this.sccNonSingletons[e]=!0})}r.pop(),this.nodeStatus[e]=n.POPPED}postprocess(e,t,r){let i=[];e.forEach(e=>{i[e]=!0});let n=[],o=[];return this.order.reverse(),this.order.forEach(e=>{let s=this.getAdjacentNodeIds(e);this.sccNonSingletons[e]||s.includes(e)?(o.push(this.nodesSparseArray[e]),t(this.nodesSparseArray[e]),s.forEac
134h(e=>i[e]=!0)):(n.push(this.nodesSparseArray[e]),i[e]&&r(this.nodesSparseArray[e])&&s.forEach(e=>i[e]=!0))}),{sorted:n,cycled:o}}}class b{constructor(e,t){this.rawValue=e,this.processFn=t,this.processedValue=null}getProcessedValue(){return null===this.processedValue&&(this.processedValue=this.processFn(this.rawValue)),this.processedValue}markAsModified(){this.processedValue=null}}class T{constructor(e){this.dependencyQuery=e,this.nodesSparseArray=[],this.edgesSparseArray=[],this.nodesIds=new Map,this.dirtyAndVolatileNodeIds=new b({dirty:[],volatile:[]},e=>this.processDirtyAndVolatileNodeIds(e)),this.infiniteRangeIds=new Set,this.changingWithStructureNodeIds=[],this.nextId=0}getNodes(){return this.nodesSparseArray.filter(e=>void 0!==e)}hasNode(e){return this.nodesIds.has(e)}existsEdge(e,t){let r=this.getNodeId(e),i=this.getNodeId(t);return void 0!==r&&void 0!==i&&this.edgesSparseArray[r].includes(i)}adjacentNodes(e){let t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);return new Set(this.edgesSparseArray[t].filter(e=>void 0!==e).map(e=>this.nodesSparseArray[e]))}adjacentNodesCount(e){let t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);return this.fixEdgesArrayForNode(t).length}addNodeAndReturnId(e){let t=this.nodesIds.get(e);if(void 0!==t)return t;let r=this.nextId;return this.nextId++,this.nodesSparseArray[r]=e,this.edgesSparseArray[r]=[],this.nodesIds.set(e,r),r}addEdge(e,t){let r=this.getNodeIdIfNotNumber(e),i=this.getNodeIdIfNotNumber(t);if(void 0===r)throw this.missingNodeError(e);
134if(void 0===i)throw this.missingNodeError(t);this.edgesSparseArray[r].includes(i)||this.edgesSparseArray[r].push(i)}removeNode(e){let t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);this.edgesSparseArray[t].length>0&&(this.edgesSparseArray[t].forEach(e=>this.dirtyAndVolatileNodeIds.rawValue.dirty.push(e)),this.dirtyAndVolatileNodeIds.markAsModified());let r=this.removeDependencies(e);return delete this.nodesSparseArray[t],delete this.edgesSparseArray[t],this.infiniteRangeIds.delete(t),this.nodesIds.delete(e),r}removeEdge(e,t){let r=this.getNodeIdIfNotNumber(e),i=this.getNodeIdIfNotNumber(t);if(void 0===r)throw this.missingNodeError(e);if(void 0===i)throw this.missingNodeError(t);let n=this.edgesSparseArray[r].indexOf(i);if(-1===n)throw Error("Edge does not exist");delete this.edgesSparseArray[r][n]}removeEdgeIfExists(e,t){let r=this.getNodeIdIfNotNumber(e),i=this.getNodeIdIfNotNumber(t);if(void 0===r||void 0===i)return;let n=this.edgesSparseArray[r].indexOf(i);-1!==n&&delete this.edgesSparseArray[r][n]}topSortWithScc(){return this.getTopSortedWithSccSubgraphFrom(this.getNodes(),()=>!0,()=>{})}getTopSortedWithSccSubgraphFrom(e,t,r){let i=new R(this.nodesSparseArray,this.edgesSparseArray),n=e.map(e=>this.getNodeId(e)).filter(e=>void 0!==e);return i.getTopSortedWithSccSubgraphFrom(n,t,r)}markNodeAsVolatile(e){let t=this.getNodeId(e);void 0!==t&&(this.dirtyAndVolatileNodeIds.rawValue.volatile.push(t),this.dirtyAndVolatileNodeIds.markAsModified())}markNodeAsDirty(e){let t=this.getNodeId(e);void 0!==t&&(this.dirtyAndVolatileNodeIds.rawValue.dirty.push(t),this.dirtyAndVolatileNodeIds.markAsModified())}getDirtyAndVolatileNodes(){return this.dirtyAndVolatileNodeIds.getProcessedValue()}clearDirtyNodes(){this.dirtyAndVolatileNodeIds.rawValue.dirty=[],this.dirtyAndVolatileNodeIds.markAsModified()}markNodeAsChangingWithStructure(e){let t=this.getNodeId(e);void 0!==t&&this.changingWithStructureNodeIds.push(t)}markChangingWithStructureNodesAsDirty(){this.changingWithStructureNodeIds.length<=0||(this.dirtyAndVolatileNodeIds.rawValue.dirty=[...this.dirtyAndVolatileNodeIds.rawValue.dirty,...this.changingWithStructureNodeIds],this.dirtyAndVolatileNodeIds.markAsModified())}markNodeAsInfiniteRange(e){let t=this.getNodeIdIfNotNumber(e);void 0!==t&&this.infiniteRangeIds.add(t)}getInfiniteRanges(){return[...this.infiniteRangeIds].map(e=>({node:this.nodesSparseArray[e],id:e}))}getNodeId(e){return this.nodesIds.get(e)}getNodeIdIfNotNumber(e){return"number"==typeof e?e:this.nodesIds.get(e)}fixEdgesArrayForNode(e){let t=this.edgesSparseArray[e];return this.edgesSparseArray[e]=t.filter(e=>void 0!==e&&this.nodesSparseArray[e]),this.edgesSparseArray[e]}removeDependencies(e){let t=this.dependencyQuery(e);return t.forEach(([t,r])=>{this.removeEdgeIfExists(r,e)}),t}processDirtyAndVolatileNodeIds({dirty:e,volatile:t}){return[...new Set([...e,...t])].map(e=>this.nodesSparseArray[e]).filter(e=>void 0!==e)}missingNodeError(e){return Error(`Unknown node ${JSON.stringify(e)}`)}}class N{constructor(){this.rangeMapping=new Map}getNumberOfRangesInSheet(e){var t,r;return null!==(r=null===(t=this.rangeMapping.get(e))||void 0===t?void 0:t.size)&&void 0!==r?r:0}addOrUpdateVertex(e){let t=this.rangeMapping.get(e.sheet);void 0===t&&(t=new Map,this.rangeMapping.set(e.sheet,t));let r=N.calculateRangeKey(e.start,e.end);t.set(r,e)}removeVertexIfExists(e){let t=e.sheet,r=this.rangeMapping.get(t);if(void 0===r)return;let i=N.calculateRangeKey(e.start,e.end);r.delete(i),0===r.size&&this.rangeMapping.delete(t)}getRangeVertex(e,t){let r=this.rangeMapping.get(e.sheet),i=N.calculateRangeKey(e,t);return null==r?void 0:r.get(i)}getVertexOrThrow(e,t){let r=this.getRangeVertex(e,t);if(!r)throw Error("Range does not exist");return r}truncateRanges(e,t){let r=[],i=[],n=[],o=e.sheet;for(let[s,a]of this.entriesFromSheet(e.sheet)){let l=a.range;e.start<=t(a.range.end)&&(l.removeSpan(e),l.shouldBeRemoved()?(this.removeByKey(o,s),r.push(a)):i.push([s,a]),n.push(a))}let s=[];for(let[e,r]of(i.sort((e,r)=>N.compareBy(e[1],r[1],t)),i)){let t=N.calculateRangeKey(r.range.start,r.range.end);if(t===e)continue;let i=this.getByKey(o,t);this.removeByKey(o,e),void 0!==i&&r!=i?s.push([i,r]):this.addOrUpdateVertex(r)}return{verticesToRemove:r,verticesToMerge:s,verticesWithChangedSize:n}}moveAllRangesInSheetAfterAddingRows(e,t,r){return this.updateVerticesFromSheet(e,(e,i)=>t<=i.start.row?(i.range.shiftByRows(r),{changedSize:!1,vertex:i}):t>i.start.row&&t<=i.end.row?(i.range.expandByRows(r),{changedSize:!0,vertex:i}):void 0)}moveAllRangesInSheetAfterAddingColumns(e,t,r){return this.updateVerticesFromSheet(e,(e,i)=>t<=i.start.col?(i.range.shiftByColumns(r),{changedSize:!1,vertex:i}):t>i.start.col&&t<=i.end.col?(i.range.expandByColumns(r),{changedSize:!0,vertex:i}):void 0)}
134moveRangesInsideSourceRange(e,t,r,i){this.updateVerticesFromSheet(e.sheet,(n,o)=>e.containsRange(o.range)?(o.range.shiftByColumns(t),o.range.shiftByRows(r),o.range.moveToSheet(i),{changedSize:!1,vertex:o}):void 0)}*rangesInSheet(e){let t=this.rangeMapping.get(e);t&&(yield*t.values())}*rangeVerticesContainedInRange(e){for(let t of this.rangesInSheet(e.sheet))e.containsRange(t.range)&&(yield t)}findSmallerRange(e){if(e.height()>1&&Number.isFinite(e.height())){let t=(0,a.mT)(e.end.sheet,e.end.col,e.end.row-1),r=this.getRangeVertex(e.start,t);if(void 0!==r)return{smallerRangeVertex:r,restRange:o.gG.fromSimpleCellAddresses((0,a.mT)(e.start.sheet,e.start.col,e.end.row),e.end)}}return{restRange:e}}static calculateRangeKey(e,t){return`${e.col},${e.row},${t.col},${t.row}`}static compareBy(e,t,r){let i=r(e.range.start),n=r(t.range.start);return i!==n?i-n:r(e.range.end)-r(t.range.end)}*entriesFromSheet(e){let t=this.rangeMapping.get(e);t&&(yield*t.entries())}removeByKey(e,t){let r=this.rangeMapping.get(e);if(!r)throw Error(`Sheet ${e} not found`);r.delete(t)}getByKey(e,t){var r;return null===(r=this.rangeMapping.get(e))||void 0===r?void 0:r.get(t)}updateVerticesFromSheet(e,t){let r=[];for(let[i,n]of this.entriesFromSheet(e)){let o=t(i,n);void 0!==o&&(this.removeByKey(e,i),r.push(o))}return r.forEach(e=>{this.addOrUpdateVertex(e.vertex)}),{verticesWithChangedSize:r.filter(e=>e.changedSize).map(e=>e.vertex)}}}var A=r(90518);class I{constructor(e,t,r=!1){this.id=e,this.displayName=t,this.isPlaceholder=r}get canonicalName(){return M.canonicalizeSheetName(this.displayName)}}class M{constructor(e){this.lastSheetId=-1,this.mappingFromCanonicalNameToId=new Map,this.allSheets=new Map,this.sheetNamePrefix=e.getUITranslation(A.u1.NEW_SHEET_PREFIX)}static canonicalizeSheetName(e){return e.toLowerCase()}getSheetId(e,t={}){var r;return null===(r=this._getSheetByName(e,t))||void 0===r?void 0:r.id}getSheetIdOrThrowError(e){let t=this._getSheetByName(e,{});if(void 0===t)throw new m.Hy(e);return t.id}getSheetName(e){var t;return null===(t=this._getSheet(e,{}))||void 0===t?void 0:t.displayName}getSheetNameOrThrowError(e,t={}){return this._getSheetOrThrowError(e,t).displayName}*iterateSheetNames(e={}){for(let t of this.allSheets.values())(e.includePlaceholders||!t.isPlaceholder)&&(yield t.displayName)}getSheetNames(e={}){return Array.from(this.iterateSheetNames(e))}numberOfSheets(e={}){return this.getSheetNames(e).length}hasSheetWithId(e,t={}){return void 0!==this._getSheet(e,t)}hasSheetWithName(e){return void 0!==this._getSheetByName(e,{})}addSheet(e=`${this.sheetNamePrefix}${this.lastSheetId+2}`){let t=this._getSheetByName(e,{includePlaceholders:!0});if(t){if(!t.isPlaceholder)throw new m.Bo(e);return t.isPlaceholder=!1,t.id}this.lastSheetId++;let r=new I(this.lastSheetId,e);return this._storeSheetInMappings(r),r.id}addSheetWithId(e,t){let r=this._getSheetByName(t,{includePlaceholders:!0});if(r){if(r.id!==e||!r.isPlaceholder)throw new m.Bo(t);r.isPlaceholder=!1;return}e>this.lastSheetId&&(this.lastSheetId=e);let i=new I(e,t);this._storeSheetInMappings(i)}addPlaceholderIfNotExists(e){let t=this._getSheetByName(e,{includePlaceholders:!0});if(t)return t.id;this.lastSheetId++;let r=new I(this.lastSheetId,e,!0);return this._storeSheetInMappings(r),r.id}addPlaceholderWithId(e,t){if(this._getSheetByName(t,{includePlaceholders:!0}))throw new m.Bo(t);if(this.hasSheetWithId(e,{includePlaceholders:!0}))throw Error(`Sheet with id ${e} already exists`);e>this.lastSheetId&&(this.lastSheetId=e);let r=new I(e,t,!0);this._storeSheetInMappings(r)}removeSheetIfExists(e,t={}){let r=this._getSheet(e,t);return!!r&&(this.allSheets.delete(e),this.mappingFromCanonicalNameToId.delete(r.canonicalName),e===this.lastSheetId&&this.lastSheetId--,!0)}markSheetAsPlaceholder(e){this._getSheetOrThrowError(e,{}).isPlaceholder=!0}renameSheet(e,t){let r;let i=this._getSheetOrThrowError(e,{}),n=i.displayName;if(n===t)return{previousDisplayName:void 0};let o=this._getSheetByName(t,{includePlaceholders:!0});if(void 0!==o&&o.id!==i.id){if(o.isPlaceholder)this.mappingFromCanonicalNameToId.delete(o.canonicalName),this.allSheets.delete(o.id),o.id===this.lastSheetId&&this.lastSheetId--,r=o.id;else throw new m.Bo(t)}let s=i.canonicalName;return this.mappingFromCanonicalNameToId.delete(s),i.displayName=t,this._storeSheetInMappings(i),{previousDisplayName:n,mergedWithPlaceholderSheet:r}}_storeSheetInMappings(e){this.allSheets.set(e.id,e),this.mappingFromCanonicalNameToId.set(e.canonicalName,e.id)}_getSheet(e,t){let r=this.allSheets.get(e);if(void 0!==r)return t.includePlaceholders||!r.isPlaceholder?r:void 0}_getSheetByName(e,t){let r=this.mappingFromCanonicalNameToId.get(M.canonicalizeSheetName(e));if(void 0!==r)return this._getSheet(r,t)}_getSheetOrThrowError(e,t){let r=this._getSheet(e,t);if(void 0===r)throw new m.uJ(e);return r}}class O{constructor(e,t){this.sheetMapping=e,this.addressMapping=t}ensureSheetRegistered(e){let t=this.sheetMapping.addPlaceholderIfNotExists(e);return this.addressMapping.addSheetStrategyPlaceholderIfNotExists(t),t}}var x=r(28116);class _{constructor(e,t,r,i,n,h,u,c){this.addressMapping=e,this.rangeMapping=t,this.sheetMapping=r,this.arrayMapping=i,this.stats=n,this.lazilyTransformingAstService=h,this.functionRegistry=u,this.namedExpressions=c,this.changes=l.K.empty(),this.dependencyQueryAddresses=e=>{if(e instanceof S)return this.rangeDependencyQuery(e).map(([e,t])=>e);{let t=this.formulaDependencyQuery(e);if(void 0===t)return[];{let[e,r]=t;return r.map(t=>t instanceof g.ZP?this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet).address:(0,a.y8)(t)?t:(0,o.nI)(t.start,t.end))}}},this.dependencyQueryVertices=e=>{if(e instanceof S)return this.rangeDependencyQuery(e);{let t=this.formulaDependencyQuery(e);if(void 0===t)return[];{let[e,r]=t;return r.map(t=>{if(t instanceof o.gG)return[t.start,this.rangeMapping.getVertexOrThrow(t.start,t.end)];if(!(t instanceof g.ZP))return[t,this.addressMapping.getCellOrThrow(t)];{let r=this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet);return[r.address,this.addressMapping.getCellOrThrow(r.address)]}})}}},this.rangeDependencyQuery=e=>{let t;let r=[],{smallerRangeVertex:i,restRange:n}=this.rangeMapping.findSmallerRange(e.range);for(let s of(void 0!==i&&this.graph.adjacentNodes(i).has(e)?(t=n,r.push([new o.gG(i.start,i.end),i])):t=e.range,t.addresses(this))){let e=this.addressMapping.getCell(s);void 0!==e&&r.push([s,e])}return r},this.formulaDependencyQuery=e=>{let t,r;if(!(e instanceof E._Z))return;r=e.getAddress(this.lazilyTransformingAstService),t=e.getFormula(this.lazilyTransformingAstService);
134let i=(0,g.Vd)(t,this.functionRegistry);return[r,(0,s.d)(i,r)]},this.graph=new T(this.dependencyQueryVertices),this.sheetReferenceRegistrar=new O(r,e)}static buildEmpty(e,t,r,i,n){return new _(new y(t.chooseAddressMappingPolicy),new N,new M(t.translationPackage),new w,n,e,r,i)}setFormulaToCell(e,t,r,i,n,o){let s=E._Z.fromAst(t,e,i,this.lazilyTransformingAstService.version());return this.exchangeOrAddFormulaVertex(s),this.processCellDependencies(r,s),this.graph.markNodeAsDirty(s),n&&this.markAsVolatile(s),o&&this.markAsDependentOnStructureChange(s),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setParsingErrorToCell(e,t){let r=this.shrinkPossibleArrayAndGetCell(e);return this.exchangeOrAddGraphNode(r,t),this.addressMapping.setCell(e,t),this.graph.markNodeAsDirty(t),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setValueToCell(e,t){let r=this.shrinkPossibleArrayAndGetCell(e);if(r instanceof E.H7&&this.arrayMapping.removeArray(r.getRange()),r instanceof L)r.getValues().rawValue!==t.rawValue&&(r.setValues(t),this.graph.markNodeAsDirty(r));else{let i=new L(t.parsedValue,t.rawValue);this.exchangeOrAddGraphNode(r,i),this.addressMapping.setCell(e,i),this.graph.markNodeAsDirty(i)}return this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setCellEmpty(e){let t=this.shrinkPossibleArrayAndGetCell(e);if(void 0===t)return l.K.empty();if(this.graph.adjacentNodes(t).size>0){let r=new P;this.exchangeGraphNode(t,r),0===this.graph.adjacentNodesCount(r)?(this.removeVertex(r),this.addressMapping.removeCell(e)):(this.graph.markNodeAsDirty(r),this.addressMapping.setCell(e,r))}else this.removeVertex(t),this.addressMapping.removeCell(e);return this.getAndClearContentChanges()}clearDirtyVertices(){this.graph.clearDirtyNodes()}verticesToRecompute(){return this.graph.getDirtyAndVolatileNodes()}processCellDependencies(e,t){let r=this.graph.getNodeId(t);if(void 0===r)throw Error("End vertex not found");e.forEach(e=>{if(e instanceof o.gG){let t=this.getRange(e.start,e.end);void 0===t&&(t=new S(e),this.rangeMapping.addOrUpdateVertex(t)),this.graph.addNodeAndReturnId(t);let i=this.graph.getNodeId(t);if(void 0===i)throw Error("Range vertex not found");e.isFinite()||this.graph.markNodeAsInfiniteRange(i);let{smallerRangeVertex:n,restRange:o}=this.rangeMapping.findSmallerRange(e);if(void 0!==n){if(this.graph.addEdge(n,i),t.bruteForce)for(let r of(t.bruteForce=!1,e.addresses(this)))this.graph.removeEdge(this.fetchCell(r),i)}else t.bruteForce=!0;let s=this.arrayMapping.getArray(o);if(void 0!==s)this.graph.addEdge(s,i);else for(let e of o.addresses(this)){let{vertex:t,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=r?r:t,i)}this.graph.addEdge(i,r),e.isFinite()&&this.correctInfiniteRangesDependenciesByRangeVertex(t)}else if(e instanceof g.ZP){let i=t.getAddress(this.lazilyTransformingAstService).sheet,{vertex:n,id:o}=this.fetchNamedExpressionVertex(e.name,i);this.graph.addEdge(null!=o?o:n,r)}else{let{vertex:t,id:i}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=i?i:t,r)}})}fetchNamedExpressionVertex(e,t){let r=this.namedExpressions.namedExpressionOrPlaceholder(e,t);return this.fetchCellOrCreateEmpty(r.address)}exchangeNode(e,t){let r=this.fetchCellOrCreateEmpty(e).vertex,i=this.fetchCellOrCreateEmpty(t).vertex;this.addressMapping.removeCell(e),this.exchangeGraphNode(r,i)}fetchCellOrCreateEmpty(e){let t=this.addressMapping.getCell(e);if(void 0!==t)return{vertex:t,id:void 0};let r=new P,i=this.graph.addNodeAndReturnId(r);return this.addressMapping.setCell(e,r),{vertex:r,id:i}}removeRows(e){this.stats.measure(f.wK.ADJUSTING_GRAPH,()=>{for(let[t,r]of this.addressMapping.entriesFromRowsSpan(e)){for(let e of this.graph.adjacentNodes(r))this.graph.markNodeAsDirty(e);if(r instanceof E.H7){if(!r.isLeftCorner(t))continue;this.shrinkArrayToCorner(r),this.arrayMapping.removeArray(r.getRange())}this.removeVertex(r)}}),this.stats.measure(f.wK.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.removeRows(e)});let t=this.stats.measure(f.wK.ADJUSTING_RANGES,()=>{let t=this.truncateRanges(e,e=>e.row);return this.getArrayVerticesRelatedToRanges(t)});return this.stats.measure(f.wK.ADJUSTING_ARRAY_MAPPING,()=>{this.fixArraysAfterRemovingRows(e.sheet,e.rowStart,e.numberOfRows)}),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}addSheet(e){this.addressMapping.addSheetOrChangeStrategy(e,(0,x.l)([])),this.stats.measure(f.wK.ADJUSTING_ADDRESS_MAPPING,()=>{this.markAllCellsAsDirtyInSheet(e)}),this.stats.measure(f.wK.ADJUSTING_RANGES,()=>{this.markAllRangesAsDirtyInSheet(e)})}removeSheet(e){this.clearSheet(e);let t=!this.addressMapping.hasAnyEntries(e),r=0===this.rangeMapping.getNumberOfRangesInSheet(e);t&&r?(this.sheetMapping.removeSheetIfExists(e),this.addressMapping.removeSheetIfExists(e)):this.sheetMapping.markSheetAsPlaceholder(e)}mergeSheets(e,t){if(!this.isPlaceholder(t))throw Error(`Cannot merge sheets: sheet ${t} is not a placeholder`);this.mergeRangeVertices(e,t),this.mergeCellVertices(e,t),this.addressMapping.removeSheetIfExists(t),this.addStructuralNodesToChangeSet()}clearSheet(e){let t=new Set;for(let[r,i]of this.addressMapping.sheetEntries(e))i instanceof E.H7?t.add(i):this.setCellEmpty(r);for(let e of t.values())this.setArrayEmpty(e);this.addStructuralNodesToChangeSet()}
134removeColumns(e){this.stats.measure(f.wK.ADJUSTING_GRAPH,()=>{for(let[t,r]of this.addressMapping.entriesFromColumnsSpan(e)){for(let e of this.graph.adjacentNodes(r))this.graph.markNodeAsDirty(e);if(r instanceof E.H7){if(!r.isLeftCorner(t))continue;this.shrinkArrayToCorner(r),this.arrayMapping.removeArray(r.getRange())}this.removeVertex(r)}}),this.stats.measure(f.wK.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.removeColumns(e)});let t=this.stats.measure(f.wK.ADJUSTING_RANGES,()=>{let t=this.truncateRanges(e,e=>e.col);return this.getArrayVerticesRelatedToRanges(t)});return this.stats.measure(f.wK.ADJUSTING_ARRAY_MAPPING,()=>this.fixArraysAfterRemovingColumns(e.sheet,e.columnStart,e.numberOfColumns)),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}addRows(e){this.stats.measure(f.wK.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.addRows(e.sheet,e.rowStart,e.numberOfRows)});let t=this.stats.measure(f.wK.ADJUSTING_RANGES,()=>{let t=this.rangeMapping.moveAllRangesInSheetAfterAddingRows(e.sheet,e.rowStart,e.numberOfRows);return this.fixRangesWhenAddingRows(e.sheet,e.rowStart,e.numberOfRows),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)});for(let t of(this.stats.measure(f.wK.ADJUSTING_ARRAY_MAPPING,()=>{this.fixArraysAfterAddingRow(e.sheet,e.rowStart,e.numberOfRows)}),this.addressMapping.verticesFromRowsSpan(e)))this.graph.markNodeAsDirty(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t}}addColumns(e){this.stats.measure(f.wK.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.addColumns(e.sheet,e.columnStart,e.numberOfColumns)});let t=this.stats.measure(f.wK.ADJUSTING_RANGES,()=>{let t=this.rangeMapping.moveAllRangesInSheetAfterAddingColumns(e.sheet,e.columnStart,e.numberOfColumns);return this.fixRangesWhenAddingColumns(e.sheet,e.columnStart,e.numberOfColumns),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)});for(let t of(this.stats.measure(f.wK.ADJUSTING_ARRAY_MAPPING,()=>this.fixArraysAfterAddingColumn(e.sheet,e.columnStart,e.numberOfColumns)),this.addressMapping.verticesFromColumnsSpan(e)))this.graph.markNodeAsDirty(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}isThereSpaceForArray(e){let t=e.getRangeOrUndef();if(void 0===t)return!1;for(let r of t.addresses(this)){let t=this.addressMapping.getCell(r);if(void 0!==t&&!(t instanceof P)&&t!==e)return!1}return!0}moveCells(e,t,r,i){for(let n of e.addressesWithDirection(t,r,this)){let o=(0,a.mT)(i,n.col+t,n.row+r),s=this.addressMapping.getCell(n),l=this.addressMapping.getCell(o);if(this.addressMapping.removeCell(n),void 0!==s){let t;for(let r of(this.graph.markNodeAsDirty(s),this.addressMapping.setCell(o,s),this.graph.adjacentNodes(s)))r instanceof S&&!e.containsRange(r.range)&&(t=null!=t?t:this.fetchCellOrCreateEmpty(n).vertex,this.graph.addEdge(t,r),this.graph.removeEdge(s,r));t&&(this.graph.markNodeAsDirty(t),this.addressMapping.setCell(n,t))}if(void 0!==l){for(let e of(void 0===s&&this.addressMapping.removeCell(o),this.graph.adjacentNodes(l)))s=null!=s?s:this.fetchCellOrCreateEmpty(o).vertex,this.graph.addEdge(s,e),this.graph.markNodeAsDirty(s);this.removeVertex(l)}}for(let t of this.rangeMapping.rangeVerticesContainedInRange(e))for(let r of this.graph.adjacentNodes(t))if(r instanceof S&&!e.containsRange(r.range))for(let e of(this.graph.removeEdge(t,r),t.range.addresses(this))){let{vertex:t,id:i}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=i?i:t,r),this.addressMapping.setCell(e,t),this.graph.markNodeAsDirty(t)}this.rangeMapping.moveRangesInsideSourceRange(e,t,r,i)}setArrayEmpty(e){let t=o.gG.spanFrom(e.getAddress(this.lazilyTransformingAstService),e.width,e.height),r=this.graph.adjacentNodes(e);for(let e of t.addresses(this))this.addressMapping.removeCell(e);for(let t of r.values()){let r=C(this.functionRegistry,t,e.getRange(),this.lazilyTransformingAstService,this);for(let e of r){let{vertex:r,id:i}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=i?i:r,t)}r.length>0&&this.graph.markNodeAsDirty(t)}this.removeVertex(e),this.arrayMapping.removeArray(e.getRange())}addVertex(e,t){this.graph.addNodeAndReturnId(t),this.addressMapping.setCell(e,t)}addArrayVertex(e,t){this.graph.addNodeAndReturnId(t),this.setAddressMappingForArrayVertex(t,e)}*arrayFormulaNodes(){for(let e of this.graph.getNodes())e instanceof E.H7&&(yield e)}*entriesFromRowsSpan(e){yield*this.addressMapping.entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.addressMapping.entriesFromColumnsSpan(e)}fetchCell(e){return this.addressMapping.getCellOrThrow(e)}getCell(e){return this.addressMapping.getCell(e,{throwIfSheetNotExists:!0})}getCellValue(e){return this.isPlaceholder(e.sheet)?new a.D5(a.NI.REF,h.B.SheetRef):this.addressMapping.getCellValue(e)}getRawValue(e){return this.isPlaceholder(e.sheet)?null:this.addressMapping.getRawValue(e)}getScalarValue(e){if(this.isPlaceholder(e.sheet))return new a.D5(a.NI.REF,h.B.SheetRef);let t=this.addressMapping.getCellValue(e);return t instanceof c.r?new a.D5(a.NI.VALUE,h.B.ScalarExpected):t}existsEdge(e,t){return this.graph.existsEdge(e,t)}getSheetId(e){return this.sheetMapping.getSheetIdOrThrowError(e)}getSheetHeight(e){return this.addressMapping.getSheetHeight(e)}getSheetWidth(e){return this.addressMapping.getSheetWidth(e)}getArray(e){return this.arrayMapping.getArray(e)}getRange(e,t){return this.rangeMapping.getRangeVertex(e,t)}topSortWithScc(){return this.graph.topSortWithScc()}markAsVolatile(e){this.graph.markNodeAsVolatile(e)}markAsDependentOnStructureChange(e){this.graph.markNodeAsChangingWithStructure(e)}forceApplyPostponedTransformations(){for(let e of this.graph.getNodes())e instanceof E.Gs&&e.ensureRecentData(this.lazilyTransformingAstService)}*rawValuesFromRange(e){for(let t of e.addresses(this)){let e=this.getScalarValue(t);e!==u.OX&&(yield[(0,u.t_)(e),t])}}computeListOfValuesInRange(e){let t=[];for(let r of e.addresses(this)){let e=this.getScalarValue(r);t.push(e)}return t}shrinkArrayToCorner(e){for(let t of(this.cleanAddressMappingUnderArray(e),this.adjacentArrayVertices(e))){let r;r=t instanceof E._Z?this.formulaDirectDependenciesToArray(t,e):this.rangeDirectDependenciesToArray(t,e);let i=!1;for(let[n,o]of r)e.isLeftCorner(n)&&(i=!0),this.graph.addEdge(o,t),this.graph.markNodeAsDirty(o);i||this.graph.removeEdge(e,t)}this.graph.markNodeAsDirty(e)}isArrayInternalCell(e){let t=this.getCell(e);return t instanceof E.H7&&!t.isLeftCorner(e)}getAndClearContentChanges(){let e=this.changes;return this.changes=l.K.empty(),e}getAdjacentNodesAddresses(e){let t=this.graph.adjacentNodes(e),r=[];
134return t.forEach(e=>{e instanceof S?r.push((0,o.nI)(e.start,e.end)):e instanceof E._Z&&r.push(e.getAddress(this.lazilyTransformingAstService))}),r}markAllCellsAsDirtyInSheet(e){for(let[,t]of this.addressMapping.sheetEntries(e))this.graph.markNodeAsDirty(t)}markAllRangesAsDirtyInSheet(e){for(let t of this.rangeMapping.rangesInSheet(e))this.graph.markNodeAsDirty(t)}mergeRangeVertices(e,t){for(let r of Array.from(this.rangeMapping.rangesInSheet(t))){if(!this.graph.hasNode(r))continue;let i=r.start,n=r.end;if(i.sheet!==t&&n.sheet!==t)continue;let o=(0,a.mT)(e,i.col,i.row),s=(0,a.mT)(e,n.col,n.row),l=this.rangeMapping.getRangeVertex(o,s);l?(this.rerouteDependents(r,l),this.removeVertexAndRerouteDependencies(r,l),this.rangeMapping.removeVertexIfExists(r),this.graph.markNodeAsDirty(l)):(this.rangeMapping.removeVertexIfExists(r),r.range.moveToSheet(e),this.rangeMapping.addOrUpdateVertex(r),this.graph.markNodeAsDirty(r))}}mergeCellVertices(e,t){for(let[r,i]of Array.from(this.addressMapping.sheetEntries(t))){let t=(0,a.mT)(e,r.col,r.row),n=this.getCell(t);n?(this.rerouteDependents(i,n),this.removeVertexAndCleanupDependencies(i),this.addressMapping.removeCell(r),this.graph.markNodeAsDirty(n)):(this.addressMapping.moveCell(r,t),this.graph.markNodeAsDirty(i))}}isPlaceholder(e){return e!==d.GU.SHEET_FOR_WORKBOOK_EXPRESSIONS&&!this.sheetMapping.hasSheetWithId(e,{includePlaceholders:!1})}exchangeGraphNode(e,t){this.graph.addNodeAndReturnId(t);let r=this.graph.adjacentNodes(e);this.removeVertex(e),r.forEach(e=>{this.graph.hasNode(e)&&this.graph.addEdge(t,e)})}setArray(e,t){this.arrayMapping.setArray(e,t)}correctInfiniteRangesDependency(e){let t=this.graph.getInfiniteRanges().filter(({node:t})=>t.range.addressInRange(e));if(t.length<=0)return;let{vertex:r,id:i}=this.fetchCellOrCreateEmpty(e),n=null!=i?i:this.graph.getNodeId(r);if(void 0===n)throw Error("Vertex not found");t.forEach(({id:e})=>{this.graph.addEdge(n,e)})}exchangeOrAddGraphNode(e,t){e?this.exchangeGraphNode(e,t):this.graph.addNodeAndReturnId(t)}getArrayVerticesRelatedToRanges(e){let t=new Set;return e.forEach(e=>{this.graph.hasNode(e)&&this.graph.adjacentNodes(e).forEach(e=>{e instanceof E.H7&&t.add(e)})}),t}correctInfiniteRangesDependenciesByRangeVertex(e){this.graph.getInfiniteRanges().forEac
134h(({id:t,node:r})=>{let i=e.range.intersectionWith(r.range);void 0!==i&&i.addresses(this).forEach(e=>{let{vertex:r,id:i}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=i?i:r,t)})})}cleanAddressMappingUnderArray(e){for(let t of e.getRange().addresses(this)){let r=e.getArrayCellValue(t);this.getCell(t)===e?e.isLeftCorner(t)?this.changes.addChange(new a.D5(a.NI.REF),t,r):(this.addressMapping.removeCell(t),this.changes.addChange(u.OX,t,r)):this.changes.addChange(u.OX,t,r)}}*formulaDirectDependenciesToArray(e,t){var r;let[,i]=null!==(r=this.formulaDependencyQuery(e))&&void 0!==r?r:[];if(void 0!==i){for(let e of i)if(!(e instanceof g.ZP)&&!(e instanceof o.gG)&&t.getRange().addressInRange(e)){let t=this.fetchCellOrCreateEmpty(e).vertex;yield[e,t]}}}*rangeDirectDependenciesToArray(e,t){let{restRange:r}=this.rangeMapping.findSmallerRange(e.range);for(let e of r.addresses(this))if(t.getRange().addressInRange(e)){let t=this.fetchCellOrCreateEmpty(e).vertex;yield[e,t]}}*adjacentArrayVertices(e){for(let t of this.graph.adjacentNodes(e))(t instanceof E._Z||t instanceof S)&&(yield t)}addStructuralNodesToChangeSet(){this.graph.markChangingWithStructureNodesAsDirty()}fixRangesWhenAddingRows(e,t,r){for(let i of Array.from(this.rangeMapping.rangesInSheet(e)))if(i.range.includesRow(t+r)){if(i.bruteForce)for(let e of i.range.rangeWithSameWidth(t,r).addresses(this)){let{vertex:t,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=r?r:t,i)}else{let e=i,t=this.rangeMapping.findSmallerRange(e.range);if(void 0!==t.smallerRangeVertex)continue;for(;void 0===t.smallerRangeVertex;){let r=new S(o.gG.spanFrom(e.range.start,e.range.width(),e.range.height()-1));this.rangeMapping.addOrUpdateVertex(r),this.graph.addNodeAndReturnId(r);let i=new o.gG((0,a.mT)(e.range.start.sheet,e.range.start.col,e.range.end.row),e.range.end);this.addAllFromRange(i,e),this.graph.addEdge(r,e),e=r,t=this.rangeMapping.findSmallerRange(e.range)}this.graph.addEdge(t.smallerRangeVertex,e),this.addAllFromRange(t.restRange,e),this.graph.removeEdge(t.smallerRangeVertex,i)}}}addAllFromRange(e,t){for(let r of e.addresses(this)){let{vertex:e,id:i}=this.fetchCellOrCreateEmpty(r);this.graph.addEdge(null!=i?i:e,t)}}
134fixRangesWhenAddingColumns(e,t,r){for(let i of this.rangeMapping.rangesInSheet(e))if(i.range.includesColumn(t+r))for(let n of(i.bruteForce?i.range.rangeWithSameHeight(t,r):o.gG.spanFrom((0,a.mT)(e,t,i.range.end.row),r,1)).addresses(this)){let{vertex:e,id:t}=this.fetchCellOrCreateEmpty(n);this.graph.addEdge(null!=t?t:e,i)}}exchangeOrAddFormulaVertex(e){let t=e.getAddress(this.lazilyTransformingAstService),r=o.gG.spanFrom(t,e.width,e.height),i=this.shrinkPossibleArrayAndGetCell(t);if(e instanceof E.H7&&this.setArray(r,e),this.exchangeOrAddGraphNode(i,e),this.addressMapping.setCell(t,e),e instanceof E.H7){if(!this.isThereSpaceForArray(e))return;for(let t of r.addresses(this)){if(e.isLeftCorner(t))continue;let r=this.getCell(t);this.exchangeOrAddGraphNode(r,e)}}for(let t of r.addresses(this))this.addressMapping.setCell(t,e)}setAddressMappingForArrayVertex(e,t){if(this.addressMapping.setCell(t,e),!(e instanceof E.H7))return;let r=o.gG.spanFromOrUndef(t,e.width,e.height);if(void 0!==r&&(this.setArray(r,e),this.isThereSpaceForArray(e)))for(let t of r.addresses(this))this.addressMapping.setCell(t,e)}truncateRanges(e,t){let{verticesToRemove:r,verticesToMerge:i,verticesWithChangedSize:n}=this.rangeMapping.truncateRanges(e,t);for(let[e,t]of i)this.rerouteDependents(t,e),this.removeVertexAndCleanupDependencies(t);for(let e of r)this.removeVertexAndCleanupDependencies(e);return n}fixArraysAfterAddingRow(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,r),!(t<=0))for(let[,i]of this.arrayMapping.arraysInRows(p.$.fromRowStartAndEnd(e,t-1,t-1))){let n=i.getRange();for(let o=n.start.col;o<=n.end.col;++o)for(let s=t;s<=n.end.row;++s){let t=(0,a.mT)(e,o,s),n=(0,a.mT)(e,o,s+r),l=i.getArrayCellValue(t);this.addressMapping.moveCell(n,t),this.changes.addChange(u.OX,n,l)}}}fixArraysAfterRemovingRows(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,-r),!(t<=0))for(let[,r]of this.arrayMapping.arraysInRows(p.$.fromRowStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(let e of r.getRange().addresses(this))this.addressMapping.setCell(e,r);else this.setNoSpaceIfArray(r)}fixArraysAfterAddingColumn(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,r),!(t<=0))for(let[,i]of this.arrayMapping.arraysInCols(p.N.fromColumnStartAndEnd(e,t-1,t-1))){let n=i.getRange();for(let o=n.start.row;o<=n.end.row;++o)for(let s=t;s<=n.end.col;++s){let t=(0,a.mT)(e,s,o),n=(0,a.mT)(e,s+r,o),l=i.getArrayCellValue(t);this.addressMapping.moveCell(n,t),this.changes.addChange(u.OX,n,l)}}}fixArraysAfterRemovingColumns(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,-r),!(t<=0))for(let[,r]of this.arrayMapping.arraysInCols(p.N.fromColumnStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(let e of r.getRange().addresses(this))this.addressMapping.setCell(e,r);else this.setNoSpaceIfArray(r)}shrinkPossibleArrayAndGetCell(e){let t=this.getCell(e);return t instanceof E.H7?(this.setNoSpaceIfArray(t),this.getCell(e)):t}setNoSpaceIfArray(e){e instanceof E.H7&&(this.shrinkArrayToCorner(e),e.setNoSpace())}removeVertex(e){this.removeVertexAndCleanupDependencies(e),e instanceof S&&this.rangeMapping.removeVertexIfExists(e)}rerouteDependents(e,t){let r=this.graph.adjacentNodes(e);this.graph.removeEdgeIfExists(t,e),r.forEach(e=>{this.graph.hasNode(e)&&this.graph.addEdge(t,e)})}removeVertexAndRerouteDependencies(e,t){let r=this.graph.removeNode(e);this.graph.removeEdgeIfExists(t,e),r.forEach(([e,r])=>{this.graph.hasNode(r)&&this.graph.addEdge(r,t)})}removeVertexAndCleanupDependencies(e){let t=new Set(this.graph.removeNode(e)),r=new Set;for(;t.size>0;){let e=t.values().next().value;t.delete(e);let[i,n]=e;this.graph.hasNode(n)&&0===this.graph.adjacentNodesCount(n)&&((n instanceof S||n instanceof P)&&this.graph.removeNode(n).forEach(e=>t.add(e)),n instanceof S?(this.rangeMapping.removeVertexIfExists(n),r.add(n.sheet)):n instanceof P&&(0,a.y8)(i)&&(this.addressMapping.removeCell(i),r.add(i.sheet)))}this.cleanupPlaceholderSheets(r)}cleanupPlaceholderSheets(e){for(let t of e)this.isPlaceholder(t)&&!this.addressMapping.hasAnyEntries(t)&&0===this.rangeMapping.getNumberOfRangesInSheet(t)&&(this.sheetMapping.removeSheetIfExists(t,{includePlaceholders:!0}),this.addressMapping.removeSheetIfExists(t))}}class P{constructor(){}getCellValue(){return u.OX}}class L{constructor(e,t){this.parsedValue=e,this.rawValue=t}getValues(){return{parsedValue:this.parsedValue,rawValue:this.rawValue}}setValues(e){this.parsedValue=e.parsedValue,this.rawValue=e.rawValue}getCellValue(){return this.parsedValue}}class k{constructor(e,t){this.errors=e,this.rawInput=t}getCellValue(){let e=this.errors.map(e=>e.message).find(e=>e);return a.D5.parsingError(e)}getFormula(){return this.rawInput}}
134var D=r(51415),H=r(49039)},21794:function(e,t,r){"use strict";function i(e){for(let[t,r]of Object.entries(e))r instanceof Function?e[t]=function(e){return()=>{throw Error(`The "${e}" method cannot be called because this HyperFormula instance has been destroyed`)}}(r):delete e[t]}r.d(t,{m:function(){return i}})},87678:function(e,t,r){"use strict";r.d(t,{Q:function(){return s},z:function(){return n}});var i,n,o=r(99182);(i=n||(n={})).SheetAdded="sheetAdded",i.SheetRemoved="sheetRemoved",i.SheetRenamed="sheetRenamed",i.NamedExpressionAdded="namedExpressionAdded",i.NamedExpressionRemoved="namedExpressionRemoved",i.ValuesUpdated="valuesUpdated",i.EvaluationSuspended="evaluationSuspended",i.EvaluationResumed="evaluationResumed";class s extends o.TinyEmitter{emit(e,...t){return super.emit(e,...t),this}}},54062:function(e,t,r){"use strict";r.d(t,{$d:function(){return c},AJ:function(){return u},uX:function(){return d}});var i=r(31387),n=r(69019),o=r(20763),s=r(2714),a=r(15095),l=r(40263),h=r(29253);class u{constructor(e,t){this.address=e,this.newValue=t}get col(){return this.address.col}get row(){return this.address.row}get sheet(){return this.address.sheet}get value(){return this.newValue}}class c{constructor(e,t){this.name=e,this.newValue=t}}
134class d{constructor(e,t,r,i){this.config=e,this.namedExpressions=t,this.sheetMapping=r,this.lazilyTransformingService=i}exportChange(e){let t=e.value,r=e.address;if(r.sheet===l.GU.SHEET_FOR_WORKBOOK_EXPRESSIONS){let e=this.namedExpressions.namedExpressionInAddress(r.row);if(!e)throw Error("Missing named expression");return new c(e.displayName,this.exportScalarOrRange(t))}if(!(t instanceof a.r))return new u(r,this.exportValue(t));{let e=[];for(let[i,n]of t.entriesFromTopLeftCorner(r))e.push(new u(n,this.exportValue(i)));return e}}exportValue(e){return e instanceof a.r?this.detailedError(new i.D5(i.NI.VALUE,o.B.ScalarExpected)):this.config.smartRounding&&(0,s.g_)(e)?this.cellValueRounding((0,s.t_)(e)):e instanceof i.D5?this.detailedError(e):e===s.OX?null:(0,s.t_)(e)}exportScalarOrRange(e){return e instanceof a.r?e.rawData().map(e=>e.map(e=>this.exportValue(e))):this.exportValue(e)}detailedError(e){var t,r;let i;let o=null===(t=e.root)||void 0===t?void 0:t.getAddress(this.lazilyTransformingService);return void 0!==o&&(i=o.sheet===l.GU.SHEET_FOR_WORKBOOK_EXPRESSIONS?null===(r=this.namedExpressions.namedExpressionInAddress(o.row))||void 0===r?void 0:r.displayName:(0,h.Cl)(this.sheetMapping.getSheetNameOrThrowError.bind(this.sheetMapping),o,-1)),new n.r(e,this.config.translationPackage.getErrorTranslation(e.type),i)}cellValueRounding(e){if(0===e)return e;let t=Math.pow(10,this.config.precisionRounding-Math.floor(Math.log10(Math.abs(e))));return e<0?-Math.round(-e*t)/t:Math.round(e*t)/t}}},64742:function(e,t,r){"use strict";r.d(t,{z:function(){return a}});var i=r(2714),n=r(31952),o=r(31387);function s(e,t){return typeof e==typeof t?e===i.OX?0:e<t?-1:e>t?1:0:e===i.OX?-1:t===i.OX?1:t instanceof o.D5||"number"==typeof e&&"string"==typeof t||"number"==typeof e&&"boolean"==typeof t?-1:"string"==typeof e&&"number"==typeof t?1:"string"==typeof e&&"boolean"==typeof t?-1:1}class a{constructor(e){this.dependencyGraph=e}advancedFind(e,t,{returnOccurrence:r}={returnOccurrence:"first"}){let n=t.range,o=void 0===n?t.valuesFromTopLeftCorner():this.dependencyGraph.computeListOfValuesInRange(n),s="first"===r?0:o.length-1,a="first"===r?e=>e<o.length:e=>e>=0,l="first"===r?e=>e+1:e=>e-1;for(let t=s;a(t);t=l(t))if(e((0,i.t_)(o[t])))return t;return -1}basicFind(e,t,r,{ordering:a,ifNoMatch:l,returnOccurrence:h}){let u="string"==typeof e?(0,n.Gl)(e):e,c=t.range;return void 0===c?this.findNormalizedValue(u,t.valuesFromTopLeftCorner(),l,h):"none"===a?this.findNormalizedValue(u,this.dependencyGraph.computeListOfValuesInRange(c),l,h):function(e,t,{searchCoordinate:r,orderingDirection:n,ifNoMatch:a},l){let h=t.start[r],u="col"===r?t.effectiveEndColumn(l):t.effectiveEndRow(l),c="col"===r?e=>(0,i.t_)(l.getCellValue((0,o.mT)(t.sheet,e,t.start.row))):e=>(0,i.t_)(l.getCellValue((0,o.mT)(t.sheet,t.start.col,e))),d="asc"===n?(e,t)=>s(e,t):(e,t)=>-s(e,t),g=function(e,t,r){let i=t,n=r;for(;i<n;){let t=Math.ceil((i+n)/2);e(t)?i=t:n=t-1}return i===n&&e(i)?i:-1}(t=>d(e,c(t))>=0,h,u),p=c(g);if(p===e)return g-h;if("returnLowerBound"===a){if(-1===g)return"asc"===n?-1:0;if(typeof p!=typeof e)return -1;if("asc"===n)return g-h;let t=g+1;return t<=u?t-h:-1}if("returnUpperBound"===a){if(-1===g)return"asc"===n?0:-1;if(typeof p!=typeof e)return -1;if("desc"===n)return g-h;let t=g+1;return t<=u?t-h:-1}return -1}(u,c,{searchCoordinate:r,orderingDirection:a,ifNoMatch:l},this.dependencyGraph)}findNormalizedValue(e,t,r="returnNotFound",o="first"){let a=t.map(i.t_).map(e=>"string"==typeof e?(0,n.Gl)(e):e);if("returnNotFound"===r)return"first"===o?a.indexOf(e):a.lastIndexOf(e);let l="returnLowerBound"===r?(e,t)=>s(e,t):(e,t)=>-s(e,t),h="returnLowerBound"===r?-1/0:1/0,u=-1,c="first"===o?0:a.length-1,d="first"===o?e=>e<a.length:e=>e>=0,g="first"===o?e=>e+1:e=>e-1;for(let t=c;d(t);t=g(t)){let r=a[t];if(r===e)return t;!(l(r,e)>0)&&0>l(h,r)&&(h=r,u=t)}return u}}},40263:function(e,t,r){"use strict";r.d(t,{C_:function(){return u},GU:function(){return h}});var i=r(31387),n=r(68940),o=r(5905);
134class s{constructor(e,t,r,i){this.displayName=e,this.address=t,this.added=r,this.options=i}normalizeExpressionName(){return this.displayName.toLowerCase()}copy(){return new s(this.displayName,this.address,this.added,this.options)}}class a{constructor(){this.mapping=new Map}has(e){return this.mapping.has(this.normalizeExpressionName(e))}isNameAvailable(e){let t=this.normalizeExpressionName(e),r=this.mapping.get(t);return!(r&&r.added)}add(e){this.mapping.set(e.normalizeExpressionName(),e)}get(e){return this.mapping.get(this.normalizeExpressionName(e))}getExisting(e){let t=this.mapping.get(this.normalizeExpressionName(e));return t&&t.added?t:void 0}remove(e){let t=this.normalizeExpressionName(e),r=this.mapping.get(t);r&&(r.added=!1)}getAllNamedExpressions(){return Array.from(this.mapping.values()).filter(e=>e.added)}normalizeExpressionName(e){return e.toLowerCase()}}class l{constructor(){this.mapping=new Map}add(e){this.mapping.set(this.normalizeExpressionName(e.displayName),e)}get(e){return this.mapping.get(this.normalizeExpressionName(e))}has(e){return this.mapping.has(this.normalizeExpressionName(e))}getAllNamedExpressions(){return Array.from(this.mapping.values()).filter(e=>e.added)}isNameAvailable(e){let t=this.normalizeExpressionName(e);return!this.mapping.has(t)}remove(e){let t=this.normalizeExpressionName(e);this.mapping.get(t)&&this.mapping.delete(t)}normalizeExpressionName(e){return e.toLowerCase()}}class h{constructor(){this.nextNamedExpressionRow=0,this.workbookStore=new a,this.worksheetStores=new Map,this.addressCache=new Map}isNameAvailable(e,t){var r,i;return void 0===t?this.workbookStore.isNameAvailable(e):null===(i=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.isNameAvailable(e))||void 0===i||i}namedExpressionInAddress(e){let t=this.addressCache.get(e);return t&&t.added?t:void 0}namedExpressionForScope(e,t){var r;return void 0===t?this.workbookStore.getExisting(e):null===(r=this.worksheetStore(t))||void 0===r?void 0:r.get(e)}nearestNamedExpression(e,t){var r,i;return null!==(i=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.get(e))&&void 0!==i?i:this.workbookStore.getExisting(e)}isExpressionInScope(e,t){var r,i;return null!==(i=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.has(e))&&void 0!==i&&i}isNameValid(e){let t=RegExp(`^${o.Qm}$`),r=RegExp(`^${o.p}$`),i=RegExp(`^${o.PO}$`);return!(t.test(e)||r.test(e))&&i.test(e)}addNamedExpression(e,t,r){let i=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t),n=i.get(e);return void 0!==n?(n.added=!0,n.displayName=e,n.options=r):(n=new s(e,this.nextAddress(),!0,r),i.add(n)),this.addressCache.set(n.address.row,n),n}restoreNamedExpression(e,t){let r=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);return e.added=!0,r.add(e),this.addressCache.set(e.address.row,e),e}namedExpressionOrPlaceholder(e,t){var r;return null!==(r=this.worksheetStoreOrCreate(t).get(e))&&void 0!==r?r:this.workbookNamedExpressionOrPlaceholder(e)}workbookNamedExpressionOrPlaceholder(e){let t=this.workbookStore.get(e);return void 0===t&&(t=new s(e,this.nextAddress(),!1),this.workbookStore.add(t)),t}remove(e,t){let r;let i=null==(r=void 0===t?this.workbookStore:this.worksheetStore(t))?void 0:r.get(e);if(void 0===r||void 0===i||!i.added)throw Error("Named expression does not exist");r.remove(e),r instanceof l&&0===r.mapping.size&&this.worksheetStores.delete(t),this.addressCache.delete(i.address.row)}getAllNamedExpressionsNamesInScope(e){return this.getAllNamedExpressions().filter(({scope:t})=>t===e).map(e=>e.expression.displayName)}getAllNamedExpressionsNames(){return this.getAllNamedExpressions().map(e=>e.expression.displayName)}getAllNamedExpressions(){let e=[];return this.workbookStore.getAllNamedExpressions().forEach(t=>{e.push({expression:t,scope:void 0})}),this.worksheetStores.forEach((t,r)=>{t.getAllNamedExpressions().forEach(t=>{e.push({expression:t,scope:r})})}),e}getAllNamedExpressionsForScope(e){var t,r;return void 0===e?this.workbookStore.getAllNamedExpressions():null!==(r=null===(t=this.worksheetStores.get(e))||void 0===t?void 0:t.getAllNamedExpressions())&&void 0!==r?r:[]}worksheetStoreOrCreate(e){let t=this.worksheetStores.get(e);return t||(t=new l,this.worksheetStores.set(e,t)),t}worksheetStore(e){return this.worksheetStores.get(e)}
134nextAddress(){return(0,i.mT)(h.SHEET_FOR_WORKBOOK_EXPRESSIONS,0,this.nextNamedExpressionRow++)}}h.SHEET_FOR_WORKBOOK_EXPRESSIONS=-1;let u=e=>{switch(e.type){case n.W$.EMPTY:case n.W$.NUMBER:case n.W$.STRING:case n.W$.ERROR:case n.W$.ERROR_WITH_RAW_INPUT:return!1;case n.W$.CELL_REFERENCE:return!e.reference.isAbsolute();case n.W$.CELL_RANGE:case n.W$.COLUMN_RANGE:case n.W$.ROW_RANGE:return!e.start.isAbsolute();case n.W$.NAMED_EXPRESSION:return!1;case n.W$.PERCENT_OP:case n.W$.PLUS_UNARY_OP:case n.W$.MINUS_UNARY_OP:return u(e.value);case n.W$.CONCATENATE_OP:case n.W$.EQUALS_OP:case n.W$.NOT_EQUAL_OP:case n.W$.LESS_THAN_OP:case n.W$.GREATER_THAN_OP:case n.W$.LESS_THAN_OR_EQUAL_OP:case n.W$.GREATER_THAN_OR_EQUAL_OP:case n.W$.MINUS_OP:case n.W$.PLUS_OP:case n.W$.TIMES_OP:case n.W$.DIV_OP:case n.W$.POWER_OP:return u(e.left)||u(e.right);case n.W$.PARENTHESIS:return u(e.expression);case n.W$.FUNCTION_CALL:return e.args.some(e=>u(e));case n.W$.ARRAY:return e.args.some(e=>e.some(e=>u(e)))}}},57123:function(e,t,r){"use strict";r.d(t,{pt:function(){return x},aQ:function(){return O},BX:function(){return P},HO:function(){return _},uO:function(){return M},i5:function(){return k},fb:function(){return L}});var i=r(58485),n=r(29319),o=r(90316),s=r(31387),a=r(88529),l=r(90745),h=r(61973),u=r(31543),c=r(11e3),d=r(78925);class g extends d.${constructor(e){super(),this.columnsSpan=e}get sheet(){return this.columnsSpan.sheet}isIrreversible(){return!1}transformRowRangeAst(e,t){return e}transformCellRange(e,t,r){return this.transformRange(e,t,r)}transformRowRange(e,t,r){throw Error("Not implemented")}transformColumnRange(e,t,r){return this.transformRange(e,t,r)}transformCellAddress(e,t){let r=(0,s.MC)(e,t);if(r!==this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return!1;let i=e.toSimpleColumnAddress(t);return r===this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet?this.columnsSpan.columnStart<=i.col&&e.shiftedByColumns(this.columnsSpan.numberOfColumns):t.sheet===this.columnsSpan.sheet&&r!==this.columnsSpan.sheet?!e.isColumnAbsolute()&&!(t.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(-this.columnsSpan.numberOfColumns):e.isColumnAbsolute()?!(e.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(this.columnsSpan.numberOfColumns):e.toSimpleColumnAddress(t).col<this.columnsSpan.columnStart?!(t.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(-this.columnsSpan.numberOfColumns):t.col<this.columnsSpan.columnStart&&e.shiftedByColumns(this.columnsSpan.numberOfColumns)}fixNodeAddress(e){return this.columnsSpan.sheet===e.sheet&&this.columnsSpan.columnStart<=e.col?Object.assign(Object.assign({},e),{col:e.col+this.columnsSpan.numberOfColumns}):e}transformRange(e,t,r){let i=this.transformCellAddress(e,r),n=this.transformCellAddress(t,r);return i===s.NI.REF||n===s.NI.REF?s.NI.REF:(!!i||!!n)&&[i||e,n||t]}}var p=r(35134);class f extends d.${constructor(e){super(),this.sheet=e}isIrreversible(){return!0}fixNodeAddress(e){return e}transformCellAddress(e,t){return!!e.isInvalid(t)&&s.NI.REF}transformCellRange(e,t,r){return!!(e.isInvalid(r)||t.isInvalid(r))&&s.NI.REF}transformColumnRange(e,t,r){return!!(e.isInvalid(r)||t.isInvalid(r))&&s.NI.REF}transformRowRange(e,t,r){return!!(e.isInvalid(r)||t.isInvalid(r))&&s.NI.REF}}var m=r(68940),y=r(44379);
134class w extends d.${constructor(e,t,r,i){super(),this.sourceRange=e,this.toRight=t,this.toBottom=r,this.toSheet=i,this.dependentFormulaTransformer=new E(e,t,r,i)}get sheet(){return this.sourceRange.sheet}isIrreversible(){return!0}transformSingleAst(e,t){return this.sourceRange.addressInRange(t)?[this.transformAst(e,t),this.fixNodeAddress(t)]:this.dependentFormulaTransformer.transformSingleAst(e,t)}fixNodeAddress(e){return(0,s.mT)(this.toSheet,e.col+this.toRight,e.row+this.toBottom)}transformCellAddress(e,t){return this.transformAddress(e,t)}transformCellRange(e,t,r){return this.transformRange(e,t,r)}transformColumnRange(e,t,r){return this.transformRange(e,t,r)}transformRowRange(e,t,r){return this.transformRange(e,t,r)}transformAddress(e,t){let r=this.sourceRange;if(e instanceof m.Lf){let i=e.toSimpleCellAddress(t);if(r.addressInRange(i))return e.shiftAbsoluteDimensions(this.toRight,this.toBottom)}return e.shiftRelativeDimensions(-this.toRight,-this.toBottom)}transformRange(e,t,r){let i=this.sourceRange;if(e instanceof m.Lf&&t instanceof m.Lf){let n=e.toSimpleCellAddress(r),o=t.toSimpleCellAddress(r);if(i.addressInRange(n)&&i.addressInRange(o))return[e.shiftAbsoluteDimensions(this.toRight,this.toBottom),t.shiftAbsoluteDimensions(this.toRight,this.toBottom)]}return[e.shiftRelativeDimensions(-this.toRight,-this.toBottom),t.shiftRelativeDimensions(-this.toRight,-this.toBottom)]}}
134class E extends d.${constructor(e,t,r,i){super(),this.sourceRange=e,this.toRight=t,this.toBottom=r,this.toSheet=i}get sheet(){return this.sourceRange.sheet}isIrreversible(){return!0}fixNodeAddress(e){return e}transformCellAddress(e,t){return!!this.shouldMove(e,t)&&e.moved(this.toSheet,this.toRight,this.toBottom)}transformCellRange(e,t,r){return this.transformRange(e,t,r)}transformColumnRange(e,t,r){return this.transformRange(e,t,r)}transformRowRange(e,t,r){return this.transformRange(e,t,r)}shouldMove(e,t){return e instanceof m.Lf?this.sourceRange.addressInRange(e.toSimpleCellAddress(t)):e instanceof y.u?this.sourceRange.rowInRange(e.toSimpleRowAddress(t))&&!this.sourceRange.isFinite():this.sourceRange.columnInRange(e.toSimpleColumnAddress(t))&&!this.sourceRange.isFinite()}transformRange(e,t,r){let i=this.transformCellAddress(e,r),n=this.transformCellAddress(t,r);return!!i&&!!n&&[i,n]}}class S extends d.${constructor(e){super(),this.columnsSpan=e}get sheet(){return this.columnsSpan.sheet}isIrreversible(){return!0}transformRowRangeAst(e,t){return e}transformCellRange(e,t,r){return this.transformRange(e,t,r)}transformRowRange(e,t,r){throw Error("Not implemented")}transformColumnRange(e,t,r){return this.transformRange(e,t,r)}transformCellAddress(e,t){let r=(0,s.MC)(e,t);if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet!==r)return!1;if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet===r){let r=e.toSimpleColumnAddress(t);if(r.col<this.columnsSpan.columnStart)return!1;if(r.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns)}if(this.columnsSpan.sheet===t.sheet&&this.columnsSpan.sheet!==r){if(e.isColumnAbsolute()||t.col<this.columnsSpan.columnStart)return!1;if(t.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(this.columnsSpan.numberOfColumns)}if(this.columnsSpan.sheet===t.sheet&&this.columnsSpan.sheet===r){if(e.isColumnAbsolute()){if(e.col<this.columnsSpan.columnStart)return!1;if(e.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns)}else{let r=e.toSimpleColumnAddress(t);if(r.col<this.columnsSpan.columnStart){if(t.col<this.columnsSpan.columnStart)return!1;if(t.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(this.columnsSpan.numberOfColumns)}else if(r.col>this.columnsSpan.columnEnd){if(t.col<this.columnsSpan.columnStart)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns);if(t.col>this.columnsSpan.columnEnd)return!1}}}return s.NI.REF}fixNodeAddress(e){return this.columnsSpan.sheet===e.sheet&&this.columnsSpan.columnStart<=e.col?Object.assign(Object.assign({},e),{col:e.col-this.columnsSpan.numberOfColumns}):e}transformRange(e,t,r){let i=(0,s.MC)(e,r),n=e,o=t;if(this.columnsSpan.sheet===i){let i=e.toSimpleColumnAddress(r),a=t.toSimpleColumnAddress(r);if(this.columnsSpan.columnStart<=i.col&&this.columnsSpan.columnEnd>=a.col)return s.NI.REF;i.col>=this.columnsSpan.columnStart&&i.col<=this.columnsSpan.columnEnd&&(n=e.shiftedByColumns(this.columnsSpan.columnEnd-i.col+1)),a.col>=this.columnsSpan.columnStart&&a.col<=this.columnsSpan.columnEnd&&(o=t.shiftedByColumns(-(a.col-this.columnsSpan.columnStart+1)))}let a=this.transformCellAddress(n,r),l=this.transformCellAddress(o,r);if(!1===a&&!1===l)return[n,o];if(a!==s.NI.REF&&l!==s.NI.REF)return[a||n,l||o];throw Error("Cannot happen")}}var C=r(52423);class R extends d.${constructor(e,t){super(),this.sheetIdToKeep=e,this.sheetBeingMerged=t}get sheet(){return this.sheetIdToKeep}isIrreversible(){return!0}transformCellAddress(e,t){return this.updateSheetInAddress(e)}transformCellRange(e,t,r){return this.transformRange(e,t)}transformColumnRange(e,t,r){return this.transformRange(e,t)}transformRowRange(e,t,r){return this.transformRange(e,t)}fixNodeAddress(e){return e}transformRange(e,t){let r=this.updateSheetInAddress(e),i=this.updateSheetInAddress(t);return(!!r||!!i)&&[r||e,i||t]}updateSheetInAddress(e){return e.sheet===this.sheetBeingMerged&&e.withSheet(this.sheetIdToKeep)}}var b=r(57035),T=r(2714),N=r(40263),A=r(79882),I=r(68724);class M{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return L(this.indexes)}rowsSpans(){return this.normalizedIndexes().map(e=>A.$.fromNumberOfRows(this.sheet,e[0],e[1]))}}class O{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return k(this.indexes)}rowsSpans(){return this.normalizedIndexes().map(e=>A.$.fromNumberOfRows(this.sheet,e[0],e[1]))}}class x{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return k(this.indexes)}columnsSpans(){return this.normalizedIndexes().map(e=>A.N.fromNumberOfColumns(this.sheet,e[0],e[1]))}}class _{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return L(this.indexes)}columnsSpans(){return this.normalizedIndexes().map(e=>A.N.fromNumberOfColumns(this.sheet,e[0],e[1]))}}class P{constructor(e,t,r,i,n,o,s,a,l){this.dependencyGraph=t,this.columnSearch=r,this.cellContentParser=i,this.parser=n,this.stats=o,this.lazilyTransformingAstService=s,this.namedExpressions=a,this.arraySizePredictor=l,this.changes=h.K.empty(),this.allocateNamedExpressionAddressSpace(),this.maxColumns=e.maxColumns,this.maxRows=e.maxR
134ows}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}removeRows(e){let t=[];for(let r of e.rowsSpans()){let e=this.doRemoveRows(r);e&&t.push(e)}return t}addRows(e){for(let t of e.rowsSpans())this.doAddRows(t)}addColumns(e){for(let t of e.columnsSpans())this.doAddColumns(t)}removeColumns(e){let t=[];for(let r of e.columnsSpans()){let e=this.doRemoveColumns(r);e&&t.push(e)}return t}clearSheet(e){this.dependencyGraph.clearSheet(e),this.columnSearch.removeSheet(e)}addSheet(e){let t=this.sheetMapping.addSheet(e);return this.dependencyGraph.addSheet(t),{sheetName:this.sheetMapping.getSheetNameOrThrowError(t),sheetId:t}}addSheetWithId(e,t){this.sheetMapping.addSheetWithId(e,t),this.dependencyGraph.addSheet(e)}addPlaceholderSheetWithId(e,t){this.sheetMapping.addPlaceholderWithId(e,t),this.addressMapping.addSheetStrategyPlaceholderIfNotExists(e)}removeSheet(e){return this.dependencyGraph.removeSheet(e),this.columnSearch.removeSheet(e),this.namedExpressions.getAllNamedExpressionsForScope(e).map(t=>this.removeNamedExpression(t.normalizeExpressionName(),e))}removeSheetByName(e){let t=this.sheetMapping.getSheetIdOrThrowError(e);return this.removeSheet(t)}renameSheet(e,t){let r;let{previousDisplayName:i,mergedWithPlaceholderSheet:n}=this.sheetMapping.renameSheet(e,t);return void 0!==n&&(this.dependencyGraph.mergeSheets(e,n),this.stats.measure(I.wK.TRANSFORM_ASTS,()=>{let t=new R(e,n);t.performEagerTransformations(this.dependencyGraph,this.parser),r=this.lazilyTransformingAstService.addTransformation(t)})),{previousDisplayName:i,version:r,mergedPlaceholderSheetId:n}}moveRows(e,t,r,i){let n=A.$.fromNumberOfRows(e,i,r);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddRows(n),i<t&&(t+=r);let o=(0,s.mT)(e,0,t),a=(0,s.mT)(e,0,i);this.moveCells(o,Number.POSITIVE_INFINITY,r,a);let l=A.$.fromNumberOfRows(e,t,r);return this.doRemoveRows(l),this.lazilyTransformingAstService.commitCombinedMode()}moveColumns(e,t,r,i){let n=A.N.fromNumberOfColumns(e,i,r);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddColumns(n),i<t&&(t+=r);let o=(0,s.mT)(e,t,0),a=(0,s.mT)(e,i,0);this.moveCells(o,r,Number.POSITIVE_INFINITY,a);let l=A.N.fromNumberOfColumns(e,t,r);return this.doRemoveColumns(l),this.lazilyTransformingAstService.commitCombinedMode()}moveCells(e,t,r,n){this.ensureItIsPossibleToMoveCells(e,t,r,n);let o=i.gG.spanFrom(e,t,r),s=i.gG.spanFrom(n,t,r),a=n.col-e.col,l=n.row-e.row,h=n.sheet,u=this.getRangeClipboardCells(s),c=this.dependencyGraph.rawValuesFromRange(s);this.columnSearch.removeValues(c);let d=this.dependencyGraph.rawValuesFromRange(o);this.columnSearch.moveValues(d,a,l,h);let g=0;this.stats.measure(I.wK.TRANSFORM_ASTS,()=>{let e=new w(o,a,l,h);e.performEagerTransformations(this.dependencyGraph,this.parser),g=this.lazilyTransformingAstService.addTransformation(e)}),this.dependencyGraph.moveCells(o,a,l,h);let p=this.updateNamedExpressionsForMovedCells(e,t,r,n);return{version:g,overwrittenCellsData:u,addedGlobalNamedExpressions:p}}setRowOrder(e,t){let r=[],n=[];for(let[o,s]of t)if(o!==s){let t=i.gG.spanFrom({sheet:e,col:0,row:o},1/0,1),a=this.getRangeClipboardCells(t);n=n.concat(a),r.push(a.map(([{sheet:e,col:t},r])=>[{sheet:e,col:t,row:s},r]))}return r.forEach(t=>this.restoreClipboardCells(e,t.values())),n}setColumnOrder(e,t){let r=[],n=[];for(let[o,s]of t)if(o!==s){let t=i.gG.spanFrom({sheet:e,col:o,row:0},1,1/0),a=this.getRangeClipboardCells(t);n=n.concat(a),r.push(a.map(([{sheet:e,col:t,row:r},i])=>[{sheet:e,col:s,row:r},i]))}return r.forEach(t=>this.restoreClipboardCells(e,t.values())),n}addNamedExpression(e,t,r,i){let n=this.namedExpressions.addNamedExpression(e,r,i);this.storeNamedExpressionInCell(n.address,t),this.adjustNamedExpressionEdges(n,e,r)}restoreNamedExpression(e,t,r){let i=e.displayName;this.restoreCell(e.address,t);let n=this.namedExpressions.restoreNamedExpression(e,r);this.adjustNamedExpressionEdges(n,i,r)}changeNamedExpressionExpression(e,t,r,i){let n=this.namedExpressions.namedExpressionForScope(e,r);if(!n)throw new b.eA(e);let o=n.copy();n.options=i;let s=this.getClipboardCell(n.address);return this.storeNamedExpressionInCell(n.address,t),[o,s]}removeNamedExpression(e,t){let r=this.namedExpressions.namedExpressionForScope(e,t);if(!r)throw new b.eA(e);this.namedExpressions.remove(r.displayName,t);let i=this.getClipboardCell(r.address);if(void 0!==t){let t=this.namedExpressions.workbookNamedExpressionOrPlaceholder(e);
134this.dependencyGraph.exchangeNode(r.address,t.address)}else this.dependencyGraph.setCellEmpty(r.address);return[r,i]}ensureItIsPossibleToMoveCells(e,t,r,n){if((0,s.SL)(e)||!(D(t)&&D(r)||0===e.row&&D(t)&&r===Number.POSITIVE_INFINITY||0===e.col&&D(r)&&t===Number.POSITIVE_INFINITY)||(0,s.SL)(n)||!this.sheetMapping.hasSheetWithId(e.sheet)||!this.sheetMapping.hasSheetWithId(n.sheet))throw new b.vn("a valid range of cells to move.");let o=i.gG.spanFrom(e,t,r),a=i.gG.spanFrom(n,t,r);if(a.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new b.mk;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(o))throw new b.dV;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new b.kk}restoreClipboardCells(e,t){let r=[];for(let[i,n]of t)if(this.restoreCell(i,n),n.type===l.x.FORMULA){let{dependencies:t}=this.parser.fetchCachedResult(n.hash);r.push(...this.updateNamedExpressionsForTargetAddress(e,i,t))}return r}restoreCell(e,t){switch(t.type){case l.x.VALUE:this.setValueToCell(t,e);break;case l.x.FORMULA:this.setFormulaToCellFromCache(t.hash,e);break;case l.x.EMPTY:this.setCellEmpty(e);break;case l.x.PARSING_ERROR:this.setParsingErrorToCell(t.rawInput,t.errors,e)}}getOldContent(e){let t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof u.Rw)return[e,{type:l.x.EMPTY}];if(t instanceof u.VO)return[e,Object.assign({type:l.x.VALUE},t.getValues())];if(t instanceof c._Z)return[t.getAddress(this.lazilyTransformingAstService),{type:l.x.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))}];if(t instanceof u.Oj)return[e,{type:l.x.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors}];throw Error("Trying to copy unsupported type")}getClipboardCell(e){let t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof u.Rw)return{type:l.x.EMPTY};if(t instanceof u.VO)return Object.assign({type:l.x.VALUE},t.getValues());if(t instanceof u.H7){let r=t.getArrayCellValue(e);return r===T.OX?{type:l.x.EMPTY}:{type:l.x.VALUE,parsedValue:r,rawValue:t.getArrayCellRawValue(e)}}if(t instanceof u.Gs)return{type:l.x.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))};if(t instanceof u.Oj)return{type:l.x.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors};throw Error("Trying to copy unsupported type")}getSheetClipboardCells(e){let t=this.dependencyGraph.getSheetHeight(e),r=this.dependencyGraph.getSheetWidth(e),i=Array(t);for(let n=0;n<t;n++){i[n]=Array(r);for(let t=0;t<r;t++){let r=(0,s.mT)(e,t,n);i[n][t]=this.getClipboardCell(r)}}return i}getRangeClipboardCells(e){let t=[];for(let r of e.addresses(this.dependencyGraph))t.push([r,this.getClipboardCell(r)]);return t}setCellContent(e,t){let r=this.cellContentParser.parse(t),i=this.getOldContent(e);if(r instanceof a.J5.Formula){let t=this.parser.parse(r.formula,e),{ast:i,errors:n}=t;if(n.length>0)this.setParsingErrorToCell(r.formula,n,e);else try{let r=this.arraySizePredictor.checkArraySize(i,e);if(r.width<=0||r.height<=0)throw Error("Incorrect array size");this.setFormulaToCell(e,r,t)}catch(i){if(!i.message)throw i;let t={type:m.XW.InvalidRangeSize,message:"Invalid range size."};this.setParsingErrorToCell(r.formula,[t],e)}}else r instanceof a.J5.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:r.value,rawValue:t},e);return i}setSheetContent(e,t){this.clearSheet(e);for(let r=0;r<t.length;r++)for(let i=0;i<t[r].length;i++){let n=(0,s.mT)(e,i,r);this.setCellContent(n,t[r][i])}}setParsingErrorToCell(e,t,r){this.removeCellValueFromColumnSearch(r);let i=new u.Oj(t,e),n=this.dependencyGraph.setParsingErrorToCell(r,i);this.columnSearch.applyChanges(n.getChanges()),this.changes.addAll(n),this.changes.addChange(i.getCellValue(),r)}setFormulaToCell(e,t,{ast:r,hasVolatileFunction:i,hasStructuralChangeFunction:o,dependencies:s}){this.removeCellValueFromColumnSearch(e);let a=this.dependencyGraph.setFormulaToCell(e,r,(0,n.d)(s,e),t,i,o);this.columnSearch.applyChanges(a.getChanges()),this.changes.addAll(a)}setValueToCell(e,t){this.changeCellValueInColumnSearch(t,e.parsedValue);let r=this.dependencyGraph.setValueToCell(t,e);this.columnSearch.applyChanges(r.getChanges().filter(e=>!(0,s.PO)(e.address,t))),this.changes.addAll(r),this.changes.addChange(e.parsedValue,t)}setCellEmpty(e){if(this.dependencyGraph.isArrayInternalCell(e))return;this.removeCellValueFromColumnSearch(e);let t=this.dependencyGraph.setCellEmpty(e);this.columnSearch.applyChanges(t.getChanges()),this.changes.addAll(t),this.changes.addChange(T.OX,e)}setFormulaToCellFromCache(e,t){let{ast:r,hasVolatileFunction:i,hasStructuralChangeFunction:o,dependencies:s}=this.parser.fetchCachedResult(e),a=(0,n.d)(s,t),[l]=new f(t.sheet).transformSingleAst(r,t);this.parser.rememberNewAst(l);let h=(0,n.l)(a),u=this.arraySizePredictor.checkArraySize(r,t);this.dependencyGraph.setFormulaToCell(t,l,h,u,i,o)}rowEffectivelyNotInSheet(e,t){return e>=this.dependencyGraph.addressMapping.getSheetHeight(t)}getAndClearContentChanges(){let e=this.changes;return this.changes=h.K.empty(),e}forceApplyPostponedTransformations(){this.dependencyGraph.forceApplyPostponedTransformations()}doRemoveRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;let t=[];for(let[r]of this.dependencyGraph.entriesFromRowsSpan(e))t.push({address:r,cellType:this.getClipboardCell(r)});let{affectedArrays:r,contentChanges:i}=this.dependencyGraph.removeRows(e);this.columnSearch.applyChanges(i.getChanges());let n=0;return this.stats.measure(I.wK.TRANSFORM_ASTS,()=>{let t=new C.o(e);t.performEagerTransformations(this.dependencyGraph,this.parser),n=this.lazilyTransformingAstService.addTransformation(t)}),this.rewriteAffectedArrays(r),{version:n,removedCells:t,rowFrom:e.rowStart,rowCount:e.numberOfRows}}doRemoveColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;let t=[];for(let[r]of this.dependencyGraph.entriesFromColumnsSpan(e))t.push({address:r,cellType:this.getClipboardCell(r)});let{affectedArrays:r,contentChanges:i}=this.dependencyGraph.removeColumns(e);this.columnSearch.applyChanges(i.getChanges()),this.columnSearch.removeColumns(e);let n=0;return this.stats.measure(I.wK.TRANSFORM_ASTS,()=>{let t=new S(e);t.performEagerTransformations(this.dependencyGraph,this.parser),n=this.lazilyTransformingAstService.addTransformation(t)}),this.rewriteAffectedArrays(r),{version:n,removedCells:t,columnFrom:e.columnStart,columnCount:e.numberOfColumns}}doAddRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;let{affectedArrays:t}=this.dependencyGraph.addRows(e);this.stats.measure(I.wK.TRANSFORM_ASTS,()=>{let t=new p.w(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)}),this.rewriteAffectedArrays(t)}rewriteAffectedArrays(e){for(let t of e.values()){if(t.array.size.isRef)continue;let e=t.getFormula(this.lazilyTransformingAstService),r=t.getAddress(this.lazilyTransformingAstService),i=this.parser.computeHashFromAst(e);this.setFormulaToCellFromCache(i,r)}}doAddColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;let{affectedArrays:t,contentChanges:r}=this.dependencyGraph.addColumns(e);this.columnSearch.addColumns(e),this.columnSearch.applyChanges(r.getChanges()),this.stats.measure(I.wK.TRANSFORM_ASTS,()=>{let t=new g(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)}),this.rewriteAffectedArrays(t)}columnEffectivelyNotInSheet(e,t){return e>=this.dependencyGraph.addressMapping.getSheetWidth(t)}
134adjustNamedExpressionEdges(e,t,r){if(void 0===r)return;let{vertex:i,id:o}=this.dependencyGraph.fetchCellOrCreateEmpty(e.address),s=null!=o?o:this.dependencyGraph.graph.getNodeId(i),a=this.namedExpressions.workbookNamedExpressionOrPlaceholder(t),{vertex:l,id:h}=this.dependencyGraph.fetchCellOrCreateEmpty(a.address),c=null!=h?h:this.dependencyGraph.graph.getNodeId(l);for(let t of this.dependencyGraph.graph.adjacentNodes(l))if(t instanceof u.Gs&&t.getAddress(this.lazilyTransformingAstService).sheet===r){let r=t.getFormula(this.lazilyTransformingAstService),i=t.getAddress(this.lazilyTransformingAstService),{dependencies:o}=this.parser.fetchCachedResultForAst(r);for(let r of(0,n.d)(o,i))r instanceof m.ZP&&r.name.toLowerCase()===e.displayName.toLowerCase()&&(this.dependencyGraph.graph.removeEdgeIfExists(c,t),this.dependencyGraph.graph.addEdge(s,t))}}storeNamedExpressionInCell(e,t){let r=this.cellContentParser.parse(t);if(r instanceof a.J5.Formula){let t=this.parser.parse(r.formula,(0,s.mT)(-1,0,0));if((0,N.C_)(t.ast))throw new b.vf;let{ast:i,hasVolatileFunction:a,hasStructuralChangeFunction:l,dependencies:h}=t;this.dependencyGraph.setFormulaToCell(e,i,(0,n.d)(h,e),o.J.scalar(),a,l)}else r instanceof a.J5.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:r.value,rawValue:t},e)}updateNamedExpressionsForMovedCells(e,t,r,n){if(e.sheet===n.sheet)return[];let o=[];for(let s of i.gG.spanFrom(n,t,r).addresses(this.dependencyGraph)){let t=this.addressMapping.getCell(s,{throwIfCellNotExists:!0});if(t instanceof u.Gs&&s.sheet!==e.sheet){let r=t.getFormula(this.lazilyTransformingAstService),{dependencies:i}=this.parser.fetchCachedResultForAst(r);o.push(...this.updateNamedExpressionsForTargetAddress(e.sheet,s,i)
134)}}return o}updateNamedExpressionsForTargetAddress(e,t,r){if(e===t.sheet)return[];let i=[],o=this.addressMapping.getCellOrThrow(t);for(let s of(0,n.d)(r,t)){if(!(s instanceof m.ZP))continue;let r=s.name,n=this.dependencyGraph.fetchNamedExpressionVertex(r,e).vertex,a=this.namedExpressions.isExpressionInScope(r,t.sheet)?this.dependencyGraph.fetchNamedExpressionVertex(r,t.sheet).vertex:this.copyOrFetchGlobalNamedExpressionVertex(r,n,i);a!==n&&(this.dependencyGraph.graph.removeEdgeIfExists(n,o),this.dependencyGraph.graph.addEdge(a,o))}return i}allocateNamedExpressionAddressSpace(){this.dependencyGraph.addressMapping.addSheetWithStrategy(N.GU.SHEET_FOR_WORKBOOK_EXPRESSIONS,new u.UK(0,0))}copyOrFetchGlobalNamedExpressionVertex(e,t,r){let i=this.namedExpressions.namedExpressionForScope(e);if(void 0===i){if(i=this.namedExpressions.addNamedExpression(e),r.push(i.normalizeExpressionName()),t instanceof u.Gs){let{ast:e,hasVolatileFunction:r,hasStructuralChangeFunction:s,dependencies:a}=this.parser.fetchCachedResultForAst(t.getFormula(this.lazilyTransformingAstService));this.dependencyGraph.setFormulaToCell(i.address,e,(0,n.d)(a,i.address),o.J.scalar(),r,s)}else t instanceof u.Rw?this.setCellEmpty(i.address):t instanceof u.VO&&this.setValueToCell(t.getValues(),i.address)}return this.dependencyGraph.fetchCellOrCreateEmpty(i.address).vertex}removeCellValueFromColumnSearch(e){if(this.isNotComputed(e))return;let t=this.dependencyGraph.getCellValue(e);this.columnSearch.remove((0,T.t_)(t),e)}changeCellValueInColumnSearch(e,t){if(this.isNotComputed(e))return;let r=this.dependencyGraph.getCellValue(e);this.columnSearch.change((0,T.t_)(r),(0,T.t_)(t),e)}isNotComputed(e){let t=this.dependencyGraph.getCell(e);return!!t&&"isComputed"in t&&!t.isComputed()}}function L(e){if(e.length<=1)return e;let t=[...e].sort(([e],[t])=>e-t),r=t.reduce((e,[t,r])=>{let i=e[e.length-1],n=i[0]+i[1];return t<=n?i[1]+=Math.max(0,r-(n-t)):e.push([t,r]),e},[t[0]]),i=0;for(let e=0;e<r.length;++e)r[e][0]-=i,i+=r[e][1];return r}function k(e){if(e.length<=1)return e;let t=[...e].sort(([e],[t])=>e-t),r=t.reduce((e,[t,r])=>{let i=e[e.length-1];return t===i[0]?i[1]=Math.max(i[1],r):e.push([t,r]),e},[t[0]]),i=0;for(let e=0;e<r.length;++e)r[e][0]+=i,i+=r[e][1];return r}function D(e){return Number.isInteger(e)&&e>0}},28116:function(e,t,r){"use strict";r.d(t,{c:function(){return n},l:function(){return o}});var i=r(57035);function n(e){if(!Array.isArray(e))throw new i.vn("an array of arrays.");for(let t=0;t<e.length;t++)if(!Array.isArray(e[t]))throw new i.vn("an array of arrays.")}function o(e){let t=0,r=0,i=0;for(let n=0;n<e.length;n++){let o=0;for(let t=0;t<e[n].length;t++)null!=e[n][t]&&(o=t+1,++i);t=Math.max(t,o),o>0&&(r=n+1)}let n=t*r;return{height:r,width:t,fill:0===n?0:i/n}}},15095:function(e,t,r){"use strict";r.d(t,{r:function(){return a}});var i=r(90316),n=r(31387),o=r(20763),s=r(2714);class a{constructor(e,t,r,n){this._data=e,this.range=t,this.dependencyGraph=r,this._hasOnlyNumbers=n,this.size=void 0===e?new i.J(t.effectiveWidth(r),t.effectiveHeight(r)):new i.J(e[0].length,e.length)}get data(){return this.ensureThatComputed(),this._data}static fromRange(e,t,r){return new a(e,t,r,!0)}static onlyNumbers(e){return new a(e,void 0,void 0,!0)}static onlyValues(e){return new a(e,void 0,void 0,void 0)}static onlyRange(e,t){return new a(void 0,e,t,void 0)}static fromScalar(e){return new a([[e]],void 0,void 0,void 0)}isAdHoc(){return void 0===this.range}width(){return this.size.width}height(){return this.size.height}valuesFromTopLeftCorner(){this.ensureThatComputed();let e=[];for(let t=0;t<this._data.length;t++)for(let r=0;r<this._data[0].length;r++)e.push(this._data[t][r]);return e}*effectiveAddressesFromData(e){for(let t=0;t<this.data.length;++t){let r=this.data[t];for(let i=0;i<r.length;++i)yield(0,n.mT)(e.sheet,e.col+i,e.row+t)}}*entriesFromTopLeftCorner(e){this.ensureThatComputed();for(let t=0;t<this.size.height;++t)for(let r=0;r<this.size.width;++r)yield[this._data[t][r],(0,n.mT)(e.sheet,e.col+r,e.row+t)]}*iterateValuesFromTopLeftCorner(){yield*this.valuesFromTopLeftCorner()}numberOfElements(){return this.size.width*this.size.height}hasOnlyNumbers(){if(void 0===this._hasOnlyNumbers){for(let e of(this._hasOnlyNumbers=!0,this.data))for(let t of e)if("number"!=typeof t)return this._hasOnlyNumbers=!1,!1}return this._hasOnlyNumbers}rawNumbers(){return this._data}rawData(){var e;return this.ensureThatComputed(),null!==(e=this._data)&&void 0!==e?e:[]}sameDimensionsAs(e){return this.width()===e.width()&&this.height()===e.height()}ensureThatComputed(){void 0===this._data&&(this._hasOnlyNumbers=!0,this._data=this.range.addressesArrayMap(this.dependencyGraph,e=>{let t=this.dependencyGraph.getCellValue(e);return t instanceof a?(this._hasOnlyNumbers=!1,new n.D5(n.NI.VALUE,o.B.ScalarExpected)):((0,s.g_)(t)||(this._hasOnlyNumbers=!1),t)}))}}},79882:function(e,t,r){"use strict";r.d(t,{$:function(){return i},N:function(){return n}});class i{constructor(e,t,r){if(this.sheet=e,this.rowStart=t,this.rowEnd=r,t<0)throw Error("Starting row cant be less than 0");if(r<t)throw Error("Row span cant end before start")}get numberOfRows(){return this.rowEnd-this.rowStart+1}get start(){return this.rowStart}get end(){return this.rowEnd}static fromNumberOfRows(e,t,r){return new i(e,t,t+r-1)}static fromRowStartAndEnd(e,t,r){return new i(e,t,r)}*rows(){for(let e=this.rowStart;e<=this.rowEnd;++e)yield e}intersect(e){if(this.sheet!==e.sheet)throw Error("Can't intersect spans from different sheets");let t=Math.max(this.rowStart,e.rowStart),r=Math.min(this.rowEnd,e.rowEnd);return t>r?null:new i(this.sheet,t,r)}firstRow(){return new i(this.sheet,this.rowStart,this.rowStart)}}class n{constructor(e,t,r){if(this.sheet=e,this.columnStart=t,this.columnEnd=r,t<0)throw Error("Starting column cant be less than 0");if(r<t)throw Error("Column span cant end before start")}get numberOfColumns(){return this.columnEnd-this.columnStart+1}get start(){return this.columnStart}get end(){return this.columnEnd}static fromNumberOfColumns(e,t,r){return new n(e,t,t+r-1)}static fromColumnStartAndEnd(e,t,r){return new n(e,t,r)}*columns(){for(let e=this.columnStart;e<=this.columnEnd;++e)yield e}intersect(e){if(this.sheet!==e.sheet)throw Error("Can't intersect spans from different sheets");let t=Math.max(this.columnStart,e.columnStart),r=Math.min(this.columnEnd,e.columnEnd);return t>r?null:new n(this.sheet,t,r)}firstColumn(){return new n(this.sheet,this.columnStart,this.columnStart)}}},29319:function(e,t,r){"use strict";r.d(t,{d:function(){return s},l:function(){return a}});var i=r(58485),n=r(31387),o=r(68940);let s=(e,t)=>e.map(e=>e.absolutize(t)),a=e=>e.filter(e=>e instanceof o.ZP||(e instanceof i.gG?!((0,n.SL)(e.start)||(0,n.SL)(e.end)):!(0,n.SL)(e)))},35134:function(e,t,r){"use strict";r.d(t,{w:function(){return o}});var i=r(31387),n=r(78925);class o extends n.${constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!1}transformColumnRangeAst(e,t){return e}transformCellRange(e,t,r){return this.transformRange(e,t,r)}transformRowRange(e,t,r){return this.transformRange(e,t,r)}transformColumnRange(e,t,r){throw Error("Not implemented")}transformCellAddress(e,t){let r=(0,i.MC)(e,t);if(r!==this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet)return!1;let n=e.toSimpleRowAddress(t);return r===this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet?this.rowsSpan.rowStart<=n.row&&e.shiftedByRows(this.rowsSpan.numberOfRows):t.sheet===this.rowsSpan.sheet&&r!==this.rowsSpan.sheet?!e.isRowAbsolute()&&!(t.row<this.rowsSpan.rowStart)&&e.shiftedByRows(-this.rowsSpan.numberOfRows):e.isRowAbsolute()?!(e.row<this.rowsSpan.rowStart)&&e.shiftedByRows(this.rowsSpan.numberOfRows):n.row<this.rowsSpan.rowStart?!(t.row<this.rowsSpan.rowStart)&&e.shiftedByRows(-this.rowsSpan.numberOfRows):t.row<this.rowsSpan.rowStart&&e.shiftedByRows(this.rowsSpan.numberOfRows)}fixNodeAddress(e){return this.rowsSpan.sheet===e.sheet&&this.rowsSpan.rowStart<=e.row?Object.assign(Object.assign({},e),{row:e.row+this.rowsSpan.numberOfRows}):e}transformRange(e,t,r){let n=this.transformCellAddress(e,r),o=this.transformCellAddress(t,r);return n===i.NI.REF||o===i.NI.REF?i.NI.REF:(!!n||!!o)&&[n||e,o||t]}}},52423:function(e,t,r){"use strict";r.d(t,{o:function(){return o}});var i=r(31387),n=r(78925);class o extends n.${constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!0}transformColumnRangeAst(e,t){return e}transformCellAddress(e,t){let r=(0,i.MC)(e,t);if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet!==r)return!1;if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet===r){let r=e.toSimpleRowAddress(t);if(r.row<this.rowsSpan.rowStart)return!1;if(r.row>this.rowsSpan.rowEnd)return e.shiftedByRows(-this.rowsSpan.numberOfRows)}if(this.rowsSpan.sheet===t.sheet&&this.rowsSpan.sheet!==r){if(e.isRowAbsolute()||t.row<this.rowsSpan.rowStart)return!1;if(t.row>this.rowsSpan.rowEnd)return e.shiftedByRows(this.rowsSpan.numberOfRows)}if(this.rowsSpan.sheet===t.sheet&&this.rowsSpan.sheet===r){if(e.isRowAbsolute()){if(e.row<this.rowsSpan.rowStart)return!1;if(e.row>this.rowsSpan.rowEnd)return e.shiftedByRows(-this.rowsSpan.numberOfRows)}else{let r=e.toSimpleRowAddress(t);if(r.row<this.rowsSpan.rowStart){if(t.row<this.rowsSpan.rowStart)return!1;if(t.row>this.rowsSpan.rowEnd)return e.shiftedByRows(this.rowsSpan.numberOfRows)}else if(r.row>this.rowsSpan.rowEnd){if(t.row<this.rowsSpan.rowStart)return e.shiftedByRows(-this.rowsSpan.numberOfRows);if(t.row>this.rowsSpan.rowEnd)return!1}}}return i.NI.REF}transformCellRange(e,t,r){return this.transformRange(e,t,r)}transformRowRange(e,t,r){return this.transformRange(e,t,r)}transformColumnRange(e,t,r){throw Error("Not implemented")}fixNodeAddress(e){return this.rowsSpan.sheet===e.sheet&&this.rowsSpan.rowStart<=e.row?Object.assign(Object.assign({},e),{row:e.row-this.rowsSpan.numberOfRows}):e}transformRange(e,t,r){let n=(0,i.MC)(e,r),o=e,s=t;if(this.rowsSpan.sheet===n){let n=e.toSimpleRowAddress(r),a=t.toSimpleRowAddress(r);if(this.rowsSpan.rowStart<=n.row&&this.rowsSpan.rowEnd>=a.row)return i.NI.REF;n.row>=this.rowsSpan.rowStart&&n.row<=this.rowsSpan.rowEnd&&(o=e.shiftedByRows(this.rowsSpan.rowEnd-n.row+1)),a.row>=this.rowsSpan.rowStart&&a.row<=this.rowsSpan.rowEnd&&(s=t.shiftedByRows(-(a.row-this.rowsSpan.rowStart+1)))}let a=this.transformCellAddress(o,r),l=this.transformCellAddress(s,r);return!1===a&&!1===l?[o,s]:a===i.NI.REF||l===i.NI.REF?i.NI.REF:[a||o,l||s]}}},78925:function(e,t,r){"use strict";r.d(t,{$:function(){return o}});var i=r(31387),n=r(68940);class o{performEagerTransformations(e,t){for(let r of e.arrayFormulaNodes()){let[i,n]=this.transformSingleAst(r.getFormula(e.lazilyTransformingAstService),r.getAddress(e.lazilyTransformingAstService)),o=t.rememberNewAst(i);r.setFormula(o),r.setAddress(n)}}transformSingleAst(e,t){return[this.transformAst(e,t),this.fixNodeAddress(t)]}transformAst(e,t){switch(e.type){case n.W$.CELL_REFERENCE:return this.transformCellReferenceAst(e,t);case n.W$.CELL_RANGE:return this.transformCellRangeAst(e,t);case n.W$.COLUMN_RANGE:return this.transformColumnRangeAst(e,t);case n.W$.ROW_RANGE:return this.transformRowRangeAst(e,t);case n.W$.EMPTY:case n.W$.ERROR:case n.W$.NUMBER:case n.W$.NAMED_EXPRESSION:case n.W$.ERROR_WITH_RAW_INPUT:case n.W$.STRING:return e;case n.W$.PERCENT_OP:case n.W$.MINUS_UNARY_OP:case n.W$.PLUS_UNARY_OP:return Object.assign(Object.assign({},e),{value:this.transformAst(e.value,t)});case n.W$.FUNCTION_CALL:return Object.assign(Object.assign({},e),{procedureName:e.procedureName,args:e.args.map(e=>this.transformAst(e,t))});case n.W$.PARENTHESIS:return Object.assign(Object.assign({},e),{expression:this.transformAst(e.expression,t)});case n.W$.ARRAY:return Object.assign(Object.assign({},e),{args:e.args.map(e=>e.map(e=>this.transformAst(e,t)))});default:return Object.assign(Object.assign({},e),{left:this.transformAst(e.left,t),right:this.transformAst(e.right,t)})}}transformCellReferenceAst(e,t){let r=this.transformCellAddress(e.reference,t);return r instanceof n.Lf?Object.assign(Object.assign({},e),{reference:r}):r===i.NI.REF?(0,n.hd)(new i.D5(i.NI.REF)):e}transformCellRangeAst(e,t){let r=this.transformCellRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===i.NI.REF?(0,n.hd)(new i.D5(i.NI.REF)):e}transformColumnRangeAst(e,t){let r=this.transformColumnRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===i.NI.REF?(0,n.hd)(new i.D5(i.NI.REF)):e}transformRowRangeAst(e,t){let r=this.transformRowRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===i.NI.REF?(0,n.hd)(new i.D5(i.NI.REF)):e}}},20763:function(e,t,r){"use strict";r.d(t,{B:function(){return i}});class i{}i.DistinctSigns="Distinct signs.",i.WrongArgNumber="Wrong number of arguments.",i.EmptyArg="Empty function argument.",i.EmptyArray="Empty array not allowed.",i.ArrayDimensions="Array dimensions are not compatible.",i.NoSpaceForArrayResult="No space for array result.",i.ValueSmall="Value too small.",i.ValueLarge="Value too large.",i.BadCriterion="Incorrect criterion.",i.RangeManySheets="Range spans more than one sheet.",i.CellRangeExpected="Cell range expected.",i.WrongDimension="Wrong range dimension.",i.ScalarExpected="Cell range not allowed.",i.NumberCoercion="Value cannot be coerced to number.",i.NumberExpected="Number argument expected.",i.IntegerExpected="Value needs to be an integer.",i.BadMode="Mode not recognized.",i.DateBounds="Date outside of bounds.",i.OutOfSheet="Resulting reference is out of the sheet.",i.WrongType="Wrong type of argument.",i.NaN="NaN or infinite value encountered.",i.EqualLength="Ranges need to be of equal length.",i.Negative="Value cannot be negative.",i.NotBinary="String does not represent a binary number.",i.NotOctal="String does not represent an octal number.",i.NotHex="String does not represent a hexadecimal number.",i.EndStartPeriod="End period needs to be at least start period.",i.CellRefExpected="Cell reference expected.",i.EmptyRange="Empty range not allowed.",i.BadRef="Address is not correct.",i.NumberRange="Number-only range expected.",i.ValueNotFound="Value not found.",i.ValueBaseLarge="Value in base too large.",i.ValueBaseSmall="Value in base too small.",i.ValueBaseLong="Value in base too long.",i.NegativeLength="Length cannot be negative.",i.PatternNotFound="Pattern not found.",i.OneValue="Needs at least one value.",i.TwoValues="Range needs to contain at least two elements.",i.ThreeValues="Range needs to contain at least three elements.",i.IndexBounds="Index out of bounds.",i.IndexLarge="Index too large.",i.Formula="Expected formula.",i.NegativeCount="Count cannot be negative.",i.ParseError="Parsing error.",i.SheetRef="Sheet does not exist.",i.Perio
134dLong="Period number cannot exceed life length.",i.InvalidDate="Invalid date.",i.BitshiftLong="Result of bitshift is too long.",i.EmptyString="Empty-string argument not allowed.",i.LengthBounds="Length out of bounds.",i.NegativeTime="Time cannot be negative.",i.NoDefault="No default option.",i.NoConditionMet="None of the conditions were met.",i.Selector="Selector cannot exceed the number of arguments.",i.StartEndDate="Start date needs to be earlier than end date.",i.IncorrectDateTime="String does not represent correct DateTime.",i.CharacterCodeBounds="Character code out of bounds.",i.NonZero="Argument cannot be 0.",i.LessThanOne="Argument cannot be less than 1.",i.WeekendString="Incorrect weekend bitmask string.",i.InvalidRoman="Invalid roman numeral.",i.WrongOrder="Wrong order of values.",i.ComplexNumberExpected="Complex number expected.",i.ShouldBeIorJ="Should be 'i' or 'j'.",i.SizeMismatch="Array dimensions mismatched.",i.FunctionName=e=>`Function name ${e} not recognized.`,i.NamedExpressionName=e=>`Named expression ${e} not recognized.`,i.LicenseKey=e=>`License key is ${e}.`},57035:function(e,t,r){"use strict";r.d(t,{$6:function(){return N},Bf:function(){return x},Bo:function(){return o},CL:function(){return p},DX:function(){return R},EY:function(){return M},G9:function(){return c},Hy:function(){return n},JJ:function(){return O},Qv:function(){return E},UK:function(){return k},Uk:function(){return u},Wh:function(){return w},bS:function(){return l},cO:function(){return b},dV:function(){return _},eA:function(){return g},h7:function(){return m},i7:function(){return A},jD:function(){return d},jS:function(){return S},kN:function(){return I},kk:function(){return P},lS:function(){return a},mk:function(){return s},uJ:function(){return i},uQ:function(){return T},vf:function(){return L},vn:function(){return h},vs:function(){return f},xr:function(){return C}});class i extends Error{constructor(e){super(`There's no sheet with id = ${e}`)}}class n extends Error{constructor(e){super(`There's no sheet with name '${e}'`)}}class o extends Error{constructor(e){super(`Sheet with name ${e} already exists`)}}class s extends Error{constructor(){super("Sheet size limit exceeded")}}class a extends Error{constructor(){super("This is not a formula")}}class l extends Error{constructor(e){super(`Address (row = ${e.row}, col = ${e.col}
134) is invalid`)}}class h extends Error{constructor(e){super(`Invalid arguments, expected ${e}`)}}class u extends Error{constructor(e,t){super(`Sheets ${e} and ${t} are not equal.`)}}class c extends Error{constructor(e){super(`Name of Named Expression '${e}' is already present`)}}class d extends Error{constructor(e){super(`Name of Named Expression '${e}' is invalid`)}}class g extends Error{constructor(e){super(`Named Expression '${e}' does not exist`)}}class p extends Error{constructor(){super("There is no operation to undo")}}class f extends Error{constructor(){super("There is no operation to redo")}}class m extends Error{constructor(){super("There is nothing to paste")}}function y(e,t){switch(typeof t){case"function":case"symbol":return t.toString();case"bigint":return"BigInt("+t.toString()+")";default:if(t instanceof RegExp)return"RegExp("+t.toString()+")";return t}}class w extends Error{constructor(e){super(`Unable to parse value: ${JSON.stringify(e,y,4)}`)}}class E extends Error{constructor(e,t){super(`Expected value of type: ${e} for config parameter: ${t}`)}}class S extends Error{constructor(e){super(`Config parameter ${e} cannot be empty.`)}}class C extends Error{constructor(e,t){super(`Config parameter ${e} should be at least ${t}`)}}class R extends Error{constructor(e,t){super(`Config parameter ${e} should be at most ${t}`)}}class b extends Error{constructor(e,t){super(`Expected one of ${e} for config parameter: ${t}`)}}class T extends Error{constructor(){super("Computations are suspended")}}class N extends Error{constructor(e){super(`Translation for ${e} is missing in the translation package you're using.`)}}class A extends Error{constructor(e){super(`Cannot register translation for function with id: ${e}`)}}class I extends Error{constructor(){super("Language not registered.")}}class M extends Error{constructor(){super("Language already registered.")}}class O extends Error{static functionNotDeclaredInPlugin(e,t){return new O(`Function with id ${e} not declared in plugin ${t}`)}static functionMethodNotFound(e,t){return new O(`Function method ${e} not found in plugin ${t}`)}}class x extends Error{static cannotRegisterFunctionWithId(e){return new x(`Cannot register function with id ${e}`)}static cannotUnregisterFunctionWithId(e){return new x(`Cannot unregister function with id ${e}`)}static cannotUnregisterProtectedPlugin(){return new x("Cannot unregister protected plugin")}}class _ extends Error{constructor(){super("Cannot perform this operation, source location has an array inside.")}}class P extends Error{constructor(){super("Cannot perform this operation, target location has an array inside.")}}class L extends Error{constructor(){super("Relative addresses not allowed in named expressions.")}}class k extends Error{constructor(e,t){super(`Alias id ${e} in plugin ${t} already defined as a function or alias.`)}}},24623:function(e,t,r){"use strict";r.d(t,{sO:function(){return E},L$:function(){return w},WU:function(){return f},Q_:function(){return m}});var i,n,o,s,a=r(87034),l=r(17808);let h=/(\\.|dd|DD|d|D|mm|MM|m|M|YYYY|YY|yyyy|yy|HH|hh|H|h|ss(\.(0+|s+))?|s|AM\/PM|am\/pm|A\/P|a\/p|\[mm]|\[MM]|\[hh]|\[HH])/g,u=/(\\.|[#0]+(\.[#0]*)?)/g;function c(e,t){return{type:e,value:t}}function d(e,t){let r=[],i=0;for(let n=0;n<e.length;++n){let s=e[n];if(s.index!==i){let e=t.substr(i,s.index-i);r.push(c(o.FREE_TEXT,e))}s[0].startsWith("\\")?r.push(c(o.FREE_TEXT,s[0])):r.push(c(o.FORMAT,s[0])),i=s.index+s[0].length}let n=e[e.length-1];if(n.index+n[0].length<t.length){let e=t.substr(n.index+n[0].length,t.length);r.push(c(o.FREE_TEXT,e))}return r}function g(e){let t=function(e){let t;h.lastIndex=0;let r=[];do null!==(t=h.exec(e))&&r.push(t);while(t);return r}(e);if(!t.every(e=>p(e)))return{type:s.DATE,tokens:d(t,e)}}function p(e){return e[0].startsWith("\\")}function f(e,t,r,i){let n=r.stringifyDateTime(i.numberToSimpleDateTime(e),t);if(void 0!==n)return n;let a=r.stringifyDuration((0,l.eS)(e),t);if(void 0!==a)return a;let h=function(e){let t=function(e){u.lastIndex=0;let t=u.exec(e);return null!==t?[t]:[]}(e);if(!t.every(e=>p(e)))return{type:s.NUMBER,tokens:d(t,e)}}(t);return void 0!==h?function(e,t){let r="";for(let i=0;i<e.length;++i){let n=e[i];if(n.type===o.FREE_TEXT){r+=n.value;continue}let s=n.value.split("."),a=s[0],l=s[1]||"",h=s[1]?".":"",u=Number(t.toFixed(l.length)).toString().split("."),c=u[0]||"",d=u[1]||"";if(a.length>c.length){let e=y(a.substr(0,a.length-c.length),"0");c=m(c,e+c.length)}let g=y(l.substr(d.length,l.length-d.length),"0");r+=c+h+(d=function(e,t){let r=`${e}`;for(;r.length<t;)r+="0";return r}(d,g+d.length))}return r}(h.tokens,e):t}function m(e,t){let r=`${e}`;for(;r.length<t;)r="0"+r;return r}function y(e,t){return e.split(t).length-1}function w(e,t){let r=g(t);if(void 0===r)return;let i=r.tokens,n="";for(let t of i){if(t.type===o.FREE_TEXT){n+=t.value;continue}switch(t.value.toLowerCase()){case"h":case"hh":n+=m(e.hours,t.value.length),e.hours=0;break;case"[hh]":n+=m(e.hours,t.value.length-2),e.hours=0;break;case"m":case"mm":n+=m(e.minutes,t.value.length),e.minutes=0;break;case"[mm]":n+=m(e.minutes+60*e.hours,t.value.length-2),e.minutes=0,e.hours=0;break;case"s":case"ss":n+=m(Math.floor(e.seconds),t.value.length);break;default:if(a.c.test(t.value)){let r=Math.max(t.value.length-3,0);n+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,r))/Math.pow(10,r)}`;continue}return}}return n}function E(e,t){let r=g(t);if(void 0===r)return;let i=r.tokens,n="",s=!1,l=i.some(e=>e.type===o.FORMAT&&("a/p"===e.value||"A/P"===e.value||"am/pm"===e.value||"AM/PM"===e.value));for(let t=0;t<i.length;t++){let r=i[t];if(r.type===o.FREE_TEXT){n+=r.value;continue}switch(r.value.toLowerCase()){case"h":case"hh":s=!0,n+=m(l?(e.hours+11)%12+1:e.hours,r.value.length);break;case"d":case"dd":n+=m(e.day,r.value.length);break;case"s":case"ss":n+=m(Math.floor(e.seconds),r.value.length);break;case"m":case"mm":t+1<i.length&&i[t+1].value.startsWith(":")&&(s=!0),s?n+=m(e.minutes,r.value.length):n+=m(e.month,r.value.length),s=!0;break;case"yy":n+=m(e.year%100,r.value.length);break;case"yyyy":n+=e.year;break;case"am/pm":case"a/p":{let[t,i]=r.value.split("/");n+=e.hours<12?t:i;break}default:if(a.c.test(r.value)){let t=r.value.length-3;n+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,t))/Math.pow(10,t)}`;continue}return}}return n}(i=o||(o={})).FORMAT="FORMAT",i.FREE_TEXT="FREE_TEXT",(n=s||(s={})).DATE="DATE",n.NUMBER="NUMBER",n.STRING="STRING"},90518:function(e,t,r){"use strict";r.d(t,{u1:function(){return i},F4:function(){return a}});var i,n=r(31387),o=r(57035);class s{constructor(e,t,r){this.functions=e,this.errors=t,this.ui=r,this._protectedTranslations={VERSION:"VERSION"},this.checkUI(),this.checkErrors(),this.checkFunctionTranslations(this.functions),Object.assign(this.functions,this._protectedTranslations)}extendFunctions(e){this.checkFunctionTranslations(e),Object.assign(this.functions,e)}buildFunctionMapping(){return Object.keys(this.functions).reduce((e,t)=>
134(e[this.functions[t]]=t,e),{})}buildErrorMapping(){return Object.keys(this.errors).reduce((e,t)=>(e[this.errors[t]]=t,e),{})}isFunctionTranslated(e){return void 0!==this.functions[e]}getFunctionTranslations(e){let t=[];for(let r of e)this.isFunctionTranslated(r)&&t.push(this.functions[r]);return t}getFunctionTranslation(e){let t=this.functions[e];if(void 0!==t)return t;throw new o.$6(`functions.${e}`)}getMaybeFunctionTranslation(e){return this.functions[e]}getErrorTranslation(e){if(e===n.NI.LIC)return`#${n.NI.LIC}!`;let t=this.errors[e];if(void 0!==t)return t;throw new o.$6(`errors.${e}`)}getUITranslation(e){let t=this.ui[e];if(void 0!==t)return t;throw new o.$6(`ui.${e}`)}checkUI(){for(let e of Object.values(i))if(!(e in this.ui))throw new o.$6(`ui.${e}`)}checkErrors(){for(let e of Object.values(n.NI))if(!(e in this.errors)&&e!==n.NI.LIC)throw new o.$6(`errors.${e}`)}checkFunctionTranslations(e){let t=new Set(Object.getOwnPropertyNames(e));for(let e of Object.getOwnPropertyNames(this._protectedTranslations))if(t.has(e))throw new o.i7(e)}}function a(e){return new s(Object.assign({},e.functions),Object.assign({},e.errors),Object.assign({},e.ui))}(i||(i={})).NEW_SHEET_PREFIX="NEW_SHEET_PREFIX"},70797:function(e,t,r){"use strict";r.d(t,{GP:function(){return M.G},uJ:function(){return A.uJ}}
134);var i,n,o,s,a,l,h,u,c,d,g,p,f,m,y,w,E,S,C={};r.r(C),r.d(C,{AbsPlugin:function(){return U},AddressPlugin:function(){return k},ArrayPlugin:function(){return V},BitShiftPlugin:function(){return W},BitwiseLogicOperationsPlugin:function(){return z},BooleanPlugin:function(){return Y},CharPlugin:function(){return K},CodePlugin:function(){return X},ComplexPlugin:function(){return tJ},ConditionalAggregationPlugin:function(){return e5},CountBlankPlugin:function(){return Z},CountUniquePlugin:function(){return Q},DateTimePlugin:function(){return et},DegreesPlugin:function(){return es},DeltaPlugin:function(){return ea},ExpPlugin:function(){return el},FinancialPlugin:function(){return eh},FormulaTextPlugin:function(){return ef},HyperlinkPlugin:function(){return em},InformationPlugin:function(){return ev},IsEvenPlugin:function(){return ew},IsOddPlugin:function(){return eE},LogarithmPlugin:function(){return eS},LookupPlugin:function(){return te},MathConstantsPlugin:function(){return eR},MathPlugin:function(){return tq},MatrixPlugin:function(){return eN},MedianPlugin:function(){return eA},ModuloPlugin:function(){return eI},NumericAggregationPlugin:function(){return e_},PowerPlugin:function(){return ek},RadiansPlugin:function(){return eD},RadixConversionPlugin:function(){return eH},RandomPlugin:function(){return eG},RomanPlugin:function(){return tt},RoundingPlugin:function(){return eY},SimpleArithmerticPlugin:function(){return tn},SqrtPlugin:function(){return eK},StatisticalAggregationPlugin:function(){return re},StatisticalPlugin:function(){return tX},SumprodPlugin:function(){return e3},TextPlugin:function(){return e9},TrigonometryPlugin:function(){return e4}});var R=r(90316),b=r(31387),T=r(69019),N=r(77080);r(4731);var A=r(57035),I=r(54062),M=r(49015),O={errors:{CYCLE:"#CYCLE!",DIV_BY_ZERO:"#DIV/0!",ERROR:"#ERROR!",NA:"#N/A",NAME:"#NAME?",NUM:"#NUM!",REF:"#REF!",SPILL:"#SPILL!",VALUE:"#VALUE!"},functions:{FILTER:"FILTER",ADDRESS:"ADDRESS",ARRAY_CONSTRAIN:"ARRAY_CONSTRAIN",ARRAYFORMULA:"ARRAYFORMULA",ABS:"ABS",ACOS:"ACOS",ACOSH:"ACOSH",ACOT:"ACOT",ACOTH:"ACOTH",AND:"AND",ARABIC:"ARABIC",ASIN:"ASIN",ASINH:"ASINH",ATAN2:"ATAN2",ATAN:"ATAN",ATANH:"ATANH",AVERAGE:"AVERAGE",AVERAGEA:"AVERAGEA",AVERAGEIF:"AVERAGEIF",BASE:"BASE",BIN2DEC:"BIN2DEC",BIN2HEX:"BIN2HEX",BIN2OCT:"BIN2OCT",BITAND:"BITAND",BITLSHIFT:"BITLSHIFT",BITOR:"BITOR",BITRSHIFT:"BITRSHIFT",BITXOR:"BITXOR",CEILING:"CEILING",CHAR:"CHAR",CHOOSE:"CHOOSE",CLEAN:"CLEAN",CODE:"CODE",COLUMN:"COLUMN",COLUMNS:"COLUMNS",CONCATENATE:"CONCATENATE",CORREL:"CORREL",COS:"COS",COSH:"COSH",COT:"COT",COTH:"COTH",COUNT:"COUNT",COUNTA:"COUNTA",COUNTBLANK:"COUNTBLANK",COUNTIF:"COUNTIF",COUNTIFS:"COUNTIFS",COUNTUNIQUE:"COUNTUNIQUE",CSC:"CSC",CSCH:"CSCH",CUMIPMT:"CUMIPMT",CUMPRINC:"CUMPRINC",DATE:"DATE",DATEDIF:"DATEDIF",DATEVALUE:"DATEVALUE",DAY:"DAY",DAYS360:"DAYS360",DAYS:"DAYS",DB:"DB",DDB:"DDB",DEC2BIN:"DEC2BIN",DEC2HEX:"DEC2HEX",DEC2OCT:"DEC2OCT",DECIMAL:"DECIMAL",DEGREES:"DEGREES",DELTA:"DELTA",DOLLARDE:"DOLLARDE",DOLLARFR:"DOLLARFR",EDATE:"EDATE",EFFECT:"EFFECT",EOMONTH:"EOMONTH",ERF:"ERF",ERFC:"ERFC",EVEN:"EVEN",EXACT:"EXACT",EXP:"EXP",FALSE:"FALSE",FIND:"FIND",FORMULATEXT:"FORMULATEXT",FV:"FV",FVSCHEDULE:"FVSCHEDULE",HEX2BIN:"HEX2BIN",HEX2DEC:"HEX2DEC",HEX2OCT:"HEX2OCT",HLOOKUP:"HLOOKUP",HOUR:"HOUR",HYPERLINK:"HYPERLINK",IF:"IF",IFERROR:"IFERROR",IFNA:"IFNA",IFS:"IFS",INDEX:"INDEX",INT:"INT",INTERVAL:"INTERVAL",IPMT:"IPMT",ISBINARY:"ISBINARY",ISBLANK:"ISBLANK",ISERR:"ISERR",ISERROR:"ISERROR",ISEVEN:"ISEVEN",ISFORMULA:"ISFORMULA",ISLOGICAL:"ISLOGICAL",ISNA:"ISNA",ISNONTEXT:"ISNONTEXT",ISNUMBER:"ISNUMBER",ISODD:"ISODD",ISOWEEKNUM:"ISOWEEKNUM",ISPMT:"ISPMT",ISREF:"ISREF",ISTEXT:"ISTEXT",LEFT:"LEFT",LEN:"LEN",LN:"LN",LOG10:"LOG10",LOG:"LOG",LOWER:"LOWER",MATCH:"MATCH",MAX:"MAX",MAXA:"MAXA",MAXIFS:"MAXIFS",MAXPOOL:"MAXPOOL",MEDIAN:"MEDIAN",MEDIANPOOL:"MEDIANPOOL",MID:"MID",MIN:"MIN",MINA:"MINA",MINIFS:"MINIFS",MINUTE:"MINUTE",MIRR:"MIRR",MMULT:"MMULT",MOD:"MOD",MONTH:"MONTH",NA:"NA",NETWORKDAYS:"NETWORKDAYS","NETWORKDAYS.INTL":"NETWORKDAYS.INTL",NOMINAL:"NOMINAL",NOT:"NOT",NOW:"NOW",NPER:"NPER",NPV:"NPV",OCT2BIN:"OCT2BIN",OCT2DEC:"OCT2DEC",OCT2HEX:"OCT2HEX",ODD:"ODD",OFFSET:"OFFSET",OR:"OR",PI:"PI",PMT:"PMT",PDURATION:"PDURATION",PRODUCT:"PRODUCT",POWER:"POWER",PPMT:"PPMT",PROPER:"PROPER",PV:"PV",RADIANS:"RADIANS",RAND:"RAND",RATE:"RATE",REPLACE:"REPLACE",REPT:"REPT",RIGHT:"RIGHT",ROMAN:"ROMAN",ROUND:"ROUND",ROUNDDOWN:"ROUNDDOWN",ROUNDUP:"ROUNDUP",ROW:"ROW",ROWS:"ROWS",RRI:"RRI",SEARCH:"SEARCH",SEC:"SEC",SECH:"SECH",SECOND:"SECOND",SHEET:"SHEET",SHEETS:"SHEETS",SIN:"SIN",SINH:"SINH",SLN:"SLN",SPLIT:"SPLIT",SQRT:"SQRT",STDEVA:"STDEVA","STDEV.P":"STDEV.P",STDEVPA:"STDEVPA","STDEV.S":"STDEV.S",SUBSTITUTE:"SUBSTITUTE",SUBTOTAL:"SUBTOTAL",SUM:"SUM",SUMIF:"SUMIF",SUMIFS:"SUMIFS",SUMPRODUCT:"SUMPRODUCT",SUMSQ:"SUMSQ",SWITCH:"SWITCH",SYD:"SYD",T:"T",TAN:"TAN",TANH:"TANH",TBILLEQ:"TBILLEQ",TBILLPRICE:"TBILLPRICE",TBILLYIELD:"TBILLYIELD",TEXT:"TEXT",TIME:"TIME",TIMEVALUE:"TIMEVALUE",TODAY:"TODAY",TRANSPOSE:"TRANSPOSE",TRIM:"TRIM",TRUE:"TRUE",TRUNC:"TRUNC",UNICHAR:"UNICHAR",UNICODE:"UNICODE",UPPER:"UPPER",VARA:"VARA","VAR.P":"VAR.P",VARPA:"VARPA","VAR.S":"VAR.S",VLOOKUP:"VLOOKUP",WEEKDAY:"WEEKDAY",WEEKNUM:"WEEKNUM",WORKDAY:"WORKDAY","WORKDAY.INTL":"WORKDAY.INTL",XNPV:"XNPV",XOR:"XOR",XLOOKUP:"XLOOKUP",YEAR:"YEAR",YEARFRAC:"YEARFRAC","HF.ADD":"HF.ADD","HF.CONCAT":"HF.CONCAT","HF.DIVIDE":"HF.DIVI
134DE","HF.EQ":"HF.EQ","HF.GT":"HF.GT","HF.GTE":"HF.GTE","HF.LT":"HF.LT","HF.LTE":"HF.LTE","HF.MINUS":"HF.MINUS","HF.MULTIPLY":"HF.MULTIPLY","HF.NE":"HF.NE","HF.POW":"HF.POW","HF.UMINUS":"HF.UMINUS","HF.UNARY_PERCENT":"HF.UNARY_PERCENT","HF.UPLUS":"HF.UPLUS",VARP:"VARP",VAR:"VAR",STDEVP:"STDEVP",STDEV:"STDEV","EXPON.DIST":"EXPON.DIST",FISHER:"FISHER",FISHERINV:"FISHERINV",GAMMA:"GAMMA","GAMMA.DIST":"GAMMA.DIST",GAMMALN:"GAMMALN","GAMMALN.PRECISE":"GAMMALN.PRECISE","GAMMA.INV":"GAMMA.INV",GAUSS:"GAUSS",FACT:"FACT",FACTDOUBLE:"FACTDOUBLE",COMBIN:"COMBIN",COMBINA:"COMBINA",GCD:"GCD",LCM:"LCM",MROUND:"MROUND",MULTINOMIAL:"MULTINOMIAL",QUOTIENT:"QUOTIENT",RANDBETWEEN:"RANDBETWEEN",SERIESSUM:"SERIESSUM",SIGN:"SIGN",SQRTPI:"SQRTPI",SUMX2MY2:"SUMX2MY2",SUMX2PY2:"SUMX2PY2",SUMXMY2:"SUMXMY2",EXPONDIST:"EXPONDIST",GAMMADIST:"GAMMADIST",GAMMAINV:"GAMMAINV","BETA.DIST":"BETA.DIST",BETADIST:"BETADIST","BETA.INV":"BETA.INV",BETAINV:"BETAINV","BINOM.DIST":"BINOM.DIST",BINOMDIST:"BINOMDIST","BINOM.INV":"BINOM.INV",BESSELI:"BESSELI",BESSELJ:"BESSELJ",BESSELK:"BESSELK",BESSELY:"BESSELY","CHISQ.DIST":"CHISQ.DIST","CHISQ.DIST.RT":"CHISQ.DIST.RT","CHISQ.INV":"CHISQ.INV","CHISQ.INV.RT":"CHISQ.INV.RT",CHIDIST:"CHIDIST",CHIINV:"CHIINV","F.DIST":"F.DIST","F.DIST.RT":"F.DIST.RT","F.INV":"F.INV","F.INV.RT":"F.INV.RT",FDIST:"FDIST",FINV:"FINV",WEIBULL:"WEIBULL","WEIBULL.DIST":"WEIBULL.DIST",POISSON:"POISSON","POISSON.DIST":"POISSON.DIST","HYPGEOM.DIST":"HYPGEOM.DIST",HYPGEOMDIST:"HYPGEOMDIST","T.DIST":"T.DIST","T.DIST.2T":"T.DIST.2T","T.DIST.RT":"T.DIST.RT","T.INV":"T.INV","T.INV.2T":"T.INV.2T",TDIST:"TDIST",TINV:"TINV",LOGINV:"LOGINV","LOGNORM.DIST":"LOGNORM.DIST","LOGNORM.INV":"LOGNORM.INV",LOGNORMDIST:"LOGNORMDIST","NORM.DIST":"NORM.DIST","NORM.INV":"NORM.INV","NORM.S.DIST":"NORM.S.DIST","NORM.S.INV":"NORM.S.INV",NORMDIST:"NORMDIST",NORMINV:"NORMINV",NORMSDIST:"NORMSDIST",NORMSINV:"NORMSINV",PHI:"PHI","NEGBINOM.DIST":"NEGBINOM.DIST",NEGBINOMDIST:"NEGBINOMDIST",COMPLEX:"COMPLEX",IMABS:"IMABS",IMAGINARY:"IMAGINARY",IMARGUMENT:"IMARGUMENT",IMCONJUGATE:"IMCONJUGATE",IMCOS:"IMCOS",IMCOSH:"IMCOSH",IMCOT:"IMCOT",IMCSC:"IMCSC",IMCSCH:"IMCSCH",IMDIV:"IMDIV",IMEXP:"IMEXP",IMLN:"IMLN",IMLOG10:"IMLOG10",IMLOG2:"IMLOG2",IMPOWER:"IMPOWER",IMPRODUCT:"IMPRODUCT",IMREAL:"IMREAL",IMSEC:"IMSEC",IMSECH:"IMSECH",IMSIN:"IMSIN",IMSINH:"IMSINH",IMSQRT:"IMSQRT",IMSUB:"IMSUB",IMSUM:"IMSUM",IMTAN:"IMTAN",LARGE:"LARGE",SMALL:"SMALL",AVEDEV:"AVEDEV",CONFIDENCE:"CONFIDENCE","CONFIDENCE.NORM":"CONFIDENCE.NORM","CONFIDENCE.T":"CONFIDENCE.T",DEVSQ:"DEVSQ",GEOMEAN:"GEOMEAN",HARMEAN:"HARMEAN",CRITBINOM:"CRITBINOM","COVARIANCE.P":"COVARIANCE.P","COVARIANCE.S":"COVARIANCE.S",COVAR:"COVAR",PEARSON:"PEARSON",RSQ:"RSQ",STANDARDIZE:"STANDARDIZE","Z.TEST":"Z.TEST",ZTEST:"ZTEST","F.TEST":"F.TEST",FTEST:"FTEST",STEYX:"STEYX",SLOPE:"SLOPE","CHISQ.TEST":"CHISQ.TEST",CHITEST:"CHITEST","T.TEST":"T.TEST",TTEST:"TTEST",SKEW:"SKEW","SKEW.P":"SKEW.P",WEIBULLDIST:"WEIBULLDIST",VARS:"VARS",TINV2T:"TINV2T",TDISTRT:"TDISTRT",TDIST2T:"TDIST2T",STDEVS:"STDEVS",FINVRT:"FINVRT",FDISTRT:"FDISTRT",CHIDISTRT:"CHIDISTRT",CHIINVRT:"CHIINVRT",COVARIANCEP:"COVARIANCEP",COVARIANCES:"COVARIANCES",LOGNORMINV:"LOGNORMINV",POISSONDIST:"POISSONDIST",SKEWP:"SKEWP","CEILING.MATH":"CEILING.MATH",FLOOR:"FLOOR","FLOOR.MATH":"FLOOR.MATH","CEILING.PRECISE":"CEILING.PRECISE","FLOOR.PRECISE":"FLOOR.PRECISE","ISO.CEILING":"ISO.CEILING"},langCode:"enGB",ui:{NEW_SHEET_PREFIX:"Sheet"}},x=r(73338),_=r(29253),P=r(79149),L=r(20763);(i=S||(S={}))[i.FullyAbsolute=1]="FullyAbsolute",i[i.RowAbsoluteColRelative=2]="RowAbsoluteColRelative",i[i.RowRelativeColAbsolute=3]="RowRelativeColAbsolute",i[i.FullyRelative=4]="FullyRelative";class k extends P.w{verifyAddressArguments(e,t,r,i){if(i){if(e<1||t<1)return new b.D5(b.NI.VALUE,L.B.LessThanOne)}else if(S.FullyAbsolute==r){if(e<1||t<1)return new b.D5(b.NI.VALUE,L.B.LessThanOne)}else if(S.RowAbsoluteColRelative==r){if(e<1)return new b.D5(b.NI.VALUE,L.B.LessThanOne)}else if(S.RowRelativeColAbsolute==r&&t<1)return new b.D5(b.NI.VALUE,L.B.LessThanOne)}address(e,t){return this.runFunction(e.args,t,this.metadata("ADDRESS"),(e,t,r,i,n)=>{let o=this.verifyAddressArguments(e,t,r,i);if(void 0!==o)return o;let s=(0,_.Ym)(t-1),a="";null!=n&&(a=`${n}!`);let l=0==t?"C":`C[${t}]`,h=0==e?"R":`R[${e}]`;return S.FullyRelative==r?i?`${a}${s}${e}`:`${a}${h}${l}`:S.RowRelativeColAbsolute==r?i?`${a}$${s}${e}`:`${a}${h}C${t}`:S.RowAbsoluteColRelative==r?i?`${a}${s}$${e}`:`${a}
134R${e}${l}`:i?`${a}$${s}$${e}`:`${a}R${e}C${t}`})}}k.implementedFunctions={ADDRESS:{method:"address",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,optionalArg:!0,defaultValue:1,minValue:1,maxValue:4},{argumentType:P.B.BOOLEAN,optionalArg:!0,defaultValue:!0},{argumentType:P.B.STRING,optionalArg:!0}]}};var D=r(68940),H=r(31952),B=r(47956),F=r(15095);class V extends P.w{arrayformula(e,t){return this.runFunction(e.args,t,this.metadata("ARRAYFORMULA"),e=>e)}arrayformulaArraySize(e,t){if(1!==e.args.length)return R.J.error();let r=this.metadata("ARRAYFORMULA");return e.args.map(e=>{var i;return this.arraySizeForAst(e,new B.P(t.formulaAddress,t.arraysFlag||null!==(i=null==r?void 0:r.enableArrayArithmeticForArguments)&&void 0!==i&&i))})[0]}arrayconstrain(e,t){return this.runFunction(e.args,t,this.metadata("ARRAY_CONSTRAIN"),(e,t,r)=>{t=Math.min(t,e.height()),r=Math.min(r,e.width());let i=e.data,n=[];for(let e=0;e<t;e++)n.push(i[e].slice(0,r));return F.r.onlyValues(n)})}arrayconstrainArraySize(e,t){if(3!==e.args.length)return R.J.error();let r=this.metadata("ARRAY_CONSTRAIN"),{height:i,width:n}=e.args.map(e=>{var i;return this.arraySizeForAst(e,new B.P(t.formulaAddress,t.arraysFlag||null!==(i=null==r?void 0:r.enableArrayArithmeticForArguments)&&void 0!==i&&i))})[0];return(e.args[1].type===D.W$.NUMBER&&(i=Math.min(i,e.args[1].value)),e.args[2].type===D.W$.NUMBER&&(n=Math.min(n,e.args[2].value)),i<1||n<1||!Number.isInteger(i)||!Number.isInteger(n))?R.J.error():new R.J(n,i)}filter(e,t){return this.runFunction(e.args,t,this.metadata("FILTER"),(e,...t)=>{for(let r of t)if(e.width()!==r.width()||e.height()!==r.height())return new b.D5(b.NI.NA,L.B.EqualLength);if(e.width()>1&&e.height()>1)return new b.D5(b.NI.NA,L.B.WrongDimension);let r=e.data,i=[];for(let n=0;n<e.height();n++){let o=[];for(let i=0;i<e.width();i++){let e=!0;for(let r of t)if(!0!==(0,H.sH)(r.data[n][i])){e=!1;break}e&&o.push(r[n][i])}o.length>0&&i.push(o)}return i.length>0?F.r.onlyValues(i):new b.D5(b.NI.NA,L.B.EmptyRange)})}filterArraySize(e,t){if(e.args.length<=1)return R.J.error();let r=this.metadata("FILTER"),i=e.args.map(e=>{var i;return this.arraySizeForAst(e,new B.P(t.formulaAddress,t.arraysFlag||null!==(i=null==r?void 0:r.enableArrayArithmeticForArguments)&&void 0!==i&&i))}),n=Math.max(...i.map(e=>e.width)),o=Math.max(...i.map(e=>e.height));return new R.J(n,o)}}V.implementedFunctions={ARRAYFORMULA:{method:"arrayformula",sizeOfResultArrayMethod:"arrayformulaArraySize",enableArrayArithmeticForArguments:!0,parameters:[{argumentType:P.B.ANY}]},ARRAY_CONSTRAIN:{method:"arrayconstrain",sizeOfResultArrayMethod:"arrayconstrainArraySize",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.INTEGER,minValue:1},{argumentType:P.B.INTEGER,minValue:1}],vectorizationForbidden:!0},FILTER:{method:"filter",sizeOfResultArrayMethod:"filterArraySize",enableArrayArithmeticForArguments:!0,parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}],repeatLastArgs:1}};class U extends P.w{abs(e,t){return this.runFunction(e.args,t,this.metadata("ABS"),Math.abs)}}U.implementedFunctions={ABS:{method:"abs",parameters:[{argumentType:P.B.NUMBER}]}};class W extends P.w{bitlshift(e,t){return this.runFunction(e.args,t,this.metadata("BITLSHIFT"),j)}bitrshift(e,t){return this.runFunction(e.args,t,this.metadata("BITRSHIFT"),G)}}function j(e,t){return t<0?G(e,-t):$(e*Math.pow(2,t))}function G(e,t){return t<0?j(e,-t):$(Math.floor(e/Math.pow(2,t)))}function $(e){return e>0xffffffffffff?new b.D5(b.NI.NUM,L.B.BitshiftLong):e}W.implementedFunctions={BITLSHIFT:{method:"bitlshift",parameters:[{argumentType:P.B.INTEGER,minValue:0},{argumentType:P.B.INTEGER,minValue:-53,maxValue:53}]},BITRSHIFT:{method:"bitrshift",parameters:[{argumentType:P.B.INTEGER,minValue:0},{argumentType:P.B.INTEGER,minValue:-53,maxValue:53}]}};class z extends P.w{bitand(e,t){return this.runFunction(e.args,t,this.metadata("BITAND"),(e,t)=>e&t)}bitor(e,t){return this.runFunction(e.args,t,this.metadata("BITOR"),(e,t)=>e|t)}bitxor(e,t){return this.runFunction(e.args,t,this.metadata("BITXOR"),(e,t)=>e^t)}}z.implementedFunctions={BITAND:{method:"bitand",parameters:[{argumentType:P.B.INTEGER,minValue:0},{argumentType:P.B.INTEGER,minValue:0}]},BITOR:{method:"bitor",parameters:[{argumentType:P.B.INTEGER,minValue:0},{argumentType:P.B.INTEGER,minValue:0}]},BITXOR:{method:"bitxor",parameters:[{argumentType:P.B.INTEGER,minValue:0},{argumentType:P.B.INTEGER,minValue:0}]}};class Y extends P.w{literalTrue(e,t){return this.runFunction(e.args,t,this.metadata("TRUE"),()=>!0)}literalFalse(e,t){return this.runFunction(e.args,t,this.metadata("FALSE"),()=>!1)}conditionalIf(e,t){return this.runFunction(e.args,t,this.metadata("IF"),(e,t,r)=>e?t:r)}ifs(e,t){return this.runFunction(e.args,t,this.metadata("IFS"),(...e)=>{for(let t=0;t<e.length;t+=2)if(e[t])return e[t+1];return new b.D5(b.NI.NA,L.B.NoConditionMet)})}and(e,t){return this.runFunction(e.args,t,this.metadata("AND"),(...e)=>e.filter(e=>void 0!==e).every(e=>!!e))}or(e,t){return this.runFunction(e.args,t,this.metadata("OR"),(...e)=>e.filter(e=>void 0!==e).some(e=>e))}not(e,t){return this.runFunction(e.args,t,this.metadata("NOT"),e=>!e)}xor(e,t){return this.runFunction(e.args,t,this.metadata("XOR"),(...e)=>{let t=0;return e.filter(e=>
134void 0!==e).forEach(e=>{e&&t++}),t%2==1})}switch(e,t){return this.runFunction(e.args,t,this.metadata("SWITCH"),(e,...t)=>{let r=t.length,i=0;for(;i+1<r;i+=2)if(!(t[i]instanceof b.D5)&&this.arithmeticHelper.eq(e,t[i]))return t[i+1];return i<r?t[i]:new b.D5(b.NI.NA,L.B.NoDefault)})}iferror(e,t){return this.runFunction(e.args,t,this.metadata("IFERROR"),(e,t)=>e instanceof b.D5?t:e)}ifna(e,t){return this.runFunction(e.args,t,this.metadata("IFNA"),(e,t)=>e instanceof b.D5&&e.type===b.NI.NA?t:e)}choose(e,t){return this.runFunction(e.args,t,this.metadata("CHOOSE"),(e,...t)=>e>t.length?new b.D5(b.NI.NUM,L.B.Selector):t[e-1])}}Y.implementedFunctions={TRUE:{method:"literalTrue",parameters:[]},FALSE:{method:"literalFalse",parameters:[]},IF:{method:"conditionalIf",parameters:[{argumentType:P.B.BOOLEAN},{argumentType:P.B.SCALAR,passSubtype:!0},{argumentType:P.B.SCALAR,defaultValue:!1,passSubtype:!0}]},IFS:{method:"ifs",parameters:[{argumentType:P.B.BOOLEAN},{argumentType:P.B.SCALAR,passSubtype:!0}],repeatLastArgs:2},AND:{method:"and",parameters:[{argumentType:P.B.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},OR:{method:"or",parameters:[{argumentType:P.B.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},XOR:{method:"xor",parameters:[{argumentType:P.B.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},NOT:{method:"not",parameters:[{argumentType:P.B.BOOLEAN}]},SWITCH:{method:"switch",parameters:[{argumentType:P.B.NOERROR},{argumentType:P.B.SCALAR,passSubtype:!0},{argumentType:P.B.SCALAR,passSubtype:!0}],repeatLastArgs:1},IFERROR:{method:"iferror",parameters:[{argumentType:P.B.SCALAR,passSubtype:!0},{argumentType:P.B.SCALAR,passSubtype:!0}]}
134,IFNA:{method:"ifna",parameters:[{argumentType:P.B.SCALAR,passSubtype:!0},{argumentType:P.B.SCALAR,passSubtype:!0}]},CHOOSE:{method:"choose",parameters:[{argumentType:P.B.INTEGER,minValue:1},{argumentType:P.B.SCALAR,passSubtype:!0}],repeatLastArgs:1}};class K extends P.w{char(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),e=>e<1||e>=256?new b.D5(b.NI.VALUE,L.B.CharacterCodeBounds):String.fromCharCode(Math.trunc(e)))}unichar(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),e=>e<1||e>=1114112?new b.D5(b.NI.VALUE,L.B.CharacterCodeBounds):String.fromCodePoint(Math.trunc(e)))}}K.implementedFunctions={CHAR:{method:"char",parameters:[{argumentType:P.B.NUMBER}]},UNICHAR:{method:"unichar",parameters:[{argumentType:P.B.NUMBER}]}};class X extends P.w{code(e,t){return this.runFunction(e.args,t,this.metadata("CODE"),e=>0===e.length?new b.D5(b.NI.VALUE,L.B.EmptyString):e.charCodeAt(0))}unicode(e,t){return this.runFunction(e.args,t,this.metadata("UNICODE"),e=>{var t;return null!==(t=e.codePointAt(0))&&void 0!==t?t:new b.D5(b.NI.VALUE,L.B.EmptyString)})}}X.implementedFunctions={CODE:{method:"code",parameters:[{argumentType:P.B.STRING}]},UNICODE:{method:"unicode",parameters:[{argumentType:P.B.STRING}]}};var q=r(2714);class Z extends P.w{countblank(e,t){return this.runFunction(e.args,t,this.metadata("COUNTBLANK"),(...e)=>{let t=0;return e.forEach(e=>{e===q.OX&&t++}),t})}}Z.implementedFunctions={COUNTBLANK:{method:"countblank",parameters:[{argumentType:P.B.SCALAR}],repeatLastArgs:1,expandRanges:!0}};class Q extends P.w{countunique(e,t){return this.runFunction(e.args,t,this.metadata("COUNTUNIQUE"),(...e)=>{let t=new Set,r=new Set;for(let i of e)i instanceof b.D5?r.add(i.type):""!==i&&t.add(i);return t.size+r.size})}}Q.implementedFunctions={COUNTUNIQUE:{method:"countunique",parameters:[{argumentType:P.B.SCALAR}],repeatLastArgs:1,expandRanges:!0}};var J=r(17808),ee=r(24623);class et extends P.w{constructor(){super(...arguments),this.isoweeknumCore=e=>{let t=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.dateToNumber({year:r.year,month:1,day:1}),n=this.dateTimeHelper.relativeNumberToAbsoluteNumber(i),o=Math.floor((t-1)/7)-Math.floor((n+((4-n)%7+7)%7-1)/7)+1;return 0===o?this.isoweeknumCore(e-7)+1:o},this.days360Core=(e,t,r)=>{let i,n;let o=this.dateTimeHelper.numberToSimpleDate(e),s=this.dateTimeHelper.numberToSimpleDate(t);return r?(i=(0,J.Fo)(o),n=(0,J.Fo)(s)):[i,n]=this.dateTimeHelper.toBasisUS(o,s),360*(n.year-i.year)+30*(n.month-i.month)+n.day-i.day}}date(e,t){return this.runFunction(e.args,t,this.metadata("DATE"),(e,t,r)=>{let i=Math.trunc(t),n=Math.trunc(e);n<this.dateTimeHelper.getEpochYearZero()&&(n+=this.dateTimeHelper.getEpochYearZero());let o=Math.floor((i-1)/12),s={year:n+=o,month:i-=12*o,day:1};if(this.dateTimeHelper.isValidDate(s)){let e=this.dateTimeHelper.dateToNumber(s)+(Math.trunc(r)-1);return void 0===(e=this.dateTimeHelper.getWithinBounds(e))?new b.D5(b.NI.NUM,L.B.DateBounds):e}return new b.D5(b.NI.VALUE,L.B.InvalidDate)})}time(e,t){return this.runFunction(e.args,t,this.metadata("TIME"),(e,t,r)=>{let i=(0,J.kf)({hours:Math.trunc(e),minutes:Math.trunc(t),seconds:Math.trunc(r)});return i<0?new b.D5(b.NI.NUM,L.B.NegativeTime):i%1})}eomonth(e,t){return this.runFunction(e.args,t,this.metadata("EOMONTH"),(e,t)=>{let r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.dateToNumber(this.dateTimeHelper.endOfMonth((0,J.XF)(r,t)));return void 0===(i=this.dateTimeHelper.getWithinBounds(i))?new b.D5(b.NI.NUM,L.B.DateBounds):i})}day(e,t){return this.runFunction(e.args,t,this.metadata("DAY"),e=>this.dateTimeHelper.numberToSimpleDate(e).day)}days(e,t){return this.runFunction(e.args,t,this.metadata("DAYS"),(e,t)=>Math.trunc(e)-Math.trunc(t))}month(e,t){return this.runFunction(e.args,t,this.metadata("MONTH"),e=>this.dateTimeHelper.numberToSimpleDate(e).month)}year(e,t){return this.runFunction(e.args,t,this.metadata("YEAR"),e=>this.dateTimeHelper.numberToSimpleDate(e).year)}hour(e,t){return this.runFunction(e.args,t,this.metadata("HOUR"),e=>(0,J.eS)((0,J.lg)(e)%1).hours)}minute(e,t){return this.runFunction(e.args,t,this.metadata("MINUTE"),e=>(0,J.eS)((0,J.lg)(e)%1).minutes)}second(e,t){return this.runFunction(e.args,t,this.metadata("SECOND"),e=>(0,J.eS)((0,J.lg)(e)%1).seconds)}text(e,t){return this.runFunction(e.args,t,this.metadata("TEXT"),(e,t)=>(0,ee.WU)(e,t,this.config,this.dateTimeHelper))}weekday(e,t){return this.runFunction(e.args,t,this.metadata("WEEKDAY"),(e,t)=>{let r=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));if(3===t)return(r-1)%7;let i=en.get(t);return void 0===i?new b.D5(b.NI.NUM,L.B.BadMode):(r-i)%7+1})}weeknum(e,t){return this.runFunction(e.args,t,this.metadata("WEEKNUM"),(e,t)=>{let r=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),i=this.dateTimeHelper.numberToSimpleDate(e),n=this.dateTimeHelper.dateToNumber({year:i.year,month:1,day:1}),o=this.dateTimeHelper.relativeNumberToAbsoluteNumber(n);if(21===t)return this.isoweeknumCore(e);let s=en.get(t);return void 0===s?new b.D5(b.NI.NUM,L.B.BadMode):Math.floor((r-s)/7)-Math.floor((o-s)/7)+1})}isoweeknum(e,t){return this.runFunction(e.args,t,this.metadata("ISOWEEKNUM"),this.isoweeknumCore)}
134datevalue(e,t){return this.runFunction(e.args,t,this.metadata("DATEVALUE"),e=>{let{dateTime:t}=this.dateTimeHelper.parseDateTimeFromConfigFormats(e);return void 0===t?new b.D5(b.NI.VALUE,L.B.IncorrectDateTime):(0,J.cA)(t)?((0,J.fT)(t)?Math.trunc((0,J.kf)(t)):0)+this.dateTimeHelper.dateToNumber(t):0})}timevalue(e,t){return this.runFunction(e.args,t,this.metadata("TIMEVALUE"),e=>{let t=this.dateTimeHelper.dateStringToDateNumber(e);return void 0===t?new b.D5(b.NI.VALUE,L.B.IncorrectDateTime):(0,q.t_)(t)%1})}now(e,t){return this.runFunction(e.args,t,this.metadata("NOW"),()=>{let e=new Date(Date.now());return(0,J.kf)({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()})+this.dateTimeHelper.dateToNumber({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})})}today(e,t){return this.runFunction(e.args,t,this.metadata("TODAY"),()=>{let e=new Date(Date.now());return this.dateTimeHelper.dateToNumber({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})})}edate(e,t){return this.runFunction(e.args,t,this.metadata("EDATE"),(e,t)=>{let r=this.dateTimeHelper.numberToSimpleDate(e),i=(0,J.dG)((0,J.XF)(r,t)),n=this.dateTimeHelper.dateToNumber(i);return void 0===(n=this.dateTimeHelper.getWithinBounds(n))?new b.D5(b.NI.NUM,L.B.DateBounds):n})}datedif(e,t){return this.runFunction(e.args,t,this.metadata("DATEDIF"),(e,t,r)=>{if(e>t)return new b.D5(b.NI.NUM,L.B.StartEndDate);if("D"===r)return Math.floor(t)-Math.floor(e);let i=this.dateTimeHelper.numberToSimpleDate(e),n=this.dateTimeHelper.numberToSimpleDate(t);switch(r){case"M":return(n.year-i.year)*12+(n.month-i.month)-(n.day<i.day?1:0);case"YM":return(12+(n.month-i.month)-(n.day<i.day?1:0))%12;case"Y":if(n.month>i.month||n.month===i.month&&n.day>=i.day)return n.year-i.year;return n.year-i.year-1;case"MD":if(n.day>=i.day)return n.day-i.day;{let e=1===n.month?12:n.month-1,t=1===n.month?n.year-1:n.year;return this.dateTimeHelper.daysInMonth(t,e)+n.day-i.day}case"YD":if(n.month>i.month||n.month===i.month&&n.day>=i.day)return Math.floor(t)-this.dateTimeHelper.dateToNumber({year:n.year,month:i.month,day:i.day});return Math.floor(t)-Math.floor(e)-365*(n.year-i.year-1)-this.dateTimeHelper.leapYearsCount(n.year-1)+this.dateTimeHelper.leapYearsCount(i.year);default:return new b.D5(b.NI.NUM,L.B.BadMode)}})}days360(e,t){return this.runFunction(e.args,t,this.metadata("DAYS360"),this.days360Core)}yearfrac(e,t){return this.runFunction(e.args,t,this.metadata("YEARFRAC"),(e,t,r)=>{switch((e=Math.trunc(e))>(t=Math.trunc(t))&&([e,t]=[t,e]),r){case 0:return this.days360Core(e,t,!1)/360;case 1:return(t-e)/this.dateTimeHelper.yearLengthForBasis(this.dateTimeHelper.numberToSimpleDate(e),this.dateTimeHelper.numberToSimpleDate(t));case 2:return(t-e)/360;case 3:return(t-e)/365;case 4:return this.days360Core(e,t,!0)/360}throw Error("Should not be reachable.")})}interval(e,t){return this.runFunction(e.args,t,this.metadata("INTERVAL"),e=>{let t=(e=Math.trunc(e))%60,r=(e=Math.trunc(e/60))%60,i=(e=Math.trunc(e/60))%24,n=(e=Math.trunc(e/24))%30,o=(e=Math.trunc(e/30))%12,s=Math.trunc(e/12);return"P"+(s>0?`${s}Y`:"")+(o>0?`${o}M`:"")+(n>0?`${n}D`:"")+"T"+(i>0?`${i}H`:"")+(r>0?`${r}M`:"")+(t>0?`${t}S`:"")})}networkdays(e,t){return this.runFunction(e.args,t,this.metadata("NETWORKDAYS"),(e,t,r)=>this.networkdayscore(e,t,1,r))}networkdaysintl(e,t){return this.runFunction(e.args,t,this.metadata("NETWORKDAYS.INTL"),(e,t,r,i
134)=>this.networkdayscore(e,t,r,i))}workday(e,t){return this.runFunction(e.args,t,this.metadata("WORKDAY"),(e,t,r)=>this.workdaycore(e,t,1,r))}workdayintl(e,t){return this.runFunction(e.args,t,this.metadata("WORKDAY.INTL"),(e,t,r,i)=>this.workdaycore(e,t,r,i))}networkdayscore(e,t,r,i){let n=1;(e=Math.trunc(e))>(t=Math.trunc(t))&&([e,t]=[t,e],n=-1);let o=ei(r);if(o instanceof b.D5)return o;let s=this.simpleRangeToFilteredHolidays(o,i);return s instanceof b.D5?s:n*this.countWorkdays(e,t,o,s)}workdaycore(e,t,r,i){e=Math.trunc(e),t=Math.trunc(t);let n=ei(r);if(n instanceof b.D5)return n;let o=this.simpleRangeToFilteredHolidays(n,i);if(o instanceof b.D5)return o;if(t>0){let r=1;for(;this.countWorkdays(e+1,e+r,n,o)<t;)r*=2;let i=1;for(;i+1<r;){let s=Math.trunc((i+r)/2);this.countWorkdays(e+1,e+s,n,o)<t?i=s:r=s}return e+r}if(!(t<0))return e;{t*=-1;let r=1;for(;this.countWorkdays(e-r,e-1,n,o)<t;)r*=2;let i=1;for(;i+1<r;){let s=Math.trunc((i+r)/2);this.countWorkdays(e-s,e-1,n,o)<t?i=s:r=s}return e-r}}countWorkdays(e,t,r,i){let n=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(t)),o=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),s=0;for(let e=0;e<7;e++)"0"===r.charAt(e)&&(s+=Math.floor((n+6-e)/7),s-=Math.floor((o-1+6-e)/7));return s-(er(t+1,i)-er(e,i))}simpleRangeToFilteredHolidays(e,t){var r;let i=null!==(r=null==t?void 0:t.valuesFromTopLeftCorner())&&void 0!==r?r:[];for(let e of i)if(e instanceof b.D5)return e;let n=[];for(let e of i)if(e!==q.OX){if(!(0,q.g_)(e))return new b.D5(b.NI.VALUE,L.B.WrongType);n.push(Math.trunc((0,q.t_)(e)))}return[...new Set(n)].sort((e,t)=>e-t).filter(t=>{let r=this.dateTimeHelper.relativeNumberToAbsoluteNumber(t);return"0"===e.charAt((r-1)%7)})}}function er(e,t){if(0===t.length||e<=t[0])return 0;if(t[t.length-1]<e)return t.length;let r=0,i=t.length-1;for(;r+1<i;){let n=Math.floor((i+r)/2);t[n]>=e?i=n:r=n}return i}function ei(e){var t;return"number"!=typeof e&&"string"!=typeof e?new b.D5(b.NI.VALUE,L.B.WrongType):"str
134ing"!=typeof e?null!==(t=eo.get(e))&&void 0!==t?t:new b.D5(b.NI.NUM,L.B.BadMode):7===e.length&&/^(0|1)*$/.test(e)&&"1111111"!==e?e:new b.D5(b.NI.NUM,L.B.WeekendString)}et.implementedFunctions={DATE:{method:"date",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}],returnNumberType:q.sw.NUMBER_DATE},TIME:{method:"time",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}],returnNumberType:q.sw.NUMBER_TIME},MONTH:{method:"month",parameters:[{argumentType:P.B.NUMBER,minValue:0}]},YEAR:{method:"year",parameters:[{argumentType:P.B.NUMBER,minValue:0}]},HOUR:{method:"hour",parameters:[{argumentType:P.B.NUMBER,minValue:0}]},MINUTE:{method:"minute",parameters:[{argumentType:P.B.NUMBER,minValue:0}]},SECOND:{method:"second",parameters:[{argumentType:P.B.NUMBER,minValue:0}]},TEXT:{method:"text",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.STRING}]},EOMONTH:{method:"eomonth",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER}],returnNumberType:q.sw.NUMBER_DATE},DAY:{method:"day",parameters:[{argumentType:P.B.NUMBER,minValue:0}]},DAYS:{method:"days",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0}]},WEEKDAY:{method:"weekday",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,defaultValue:1}]},WEEKNUM:{method:"weeknum",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,defaultValue:1}]},ISOWEEKNUM:{method:"isoweeknum",parameters:[{argumentType:P.B.NUMBER,minValue:0}]},DATEVALUE:{method:"datevalue",parameters:[{argumentType:P.B.STRING}],returnNumberType:q.sw.NUMBER_DATE},TIMEVALUE:{method:"timevalue",parameters:[{argumentType:P.B.STRING}],returnNumberType:q.sw.NUMBER_TIME},NOW:{method:"now",parameters:[],isVolatile:!0,returnNumberType:q.sw.NUMBER_DATETIME},TODAY:{method:"today",parameters:[],isVolatile:!0,returnNumberType:q.sw.NUMBER_DATE},EDATE:{method:"edate",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER}],returnNumberType:q.sw.NUMBER_DATE},DAYS360:{method:"days360",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.BOOLEAN,defaultValue:!1}]},DATEDIF:{method:"datedif",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.STRING}]},YEARFRAC:{method:"yearfrac",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.INTEGER,defaultValue:0,minValue:0,maxValue:4}]},INTERVAL:{method:"interval",parameters:[{argumentType:P.B.NUMBER,minValue:0}]},NETWORKDAYS:{method:"networkdays",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.RANGE,optionalArg:!0}]},"NETWORKDAYS.INTL":{method:"networkdaysintl",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NOERROR,defaultValue:1},{argumentType:P.B.RANGE,optionalArg:!0}]},WORKDAY:{method:"workday",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER},{argumentType:P.B.RANGE,optionalArg:!0}]},"WORKDAY.INTL":{method:"workdayintl",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER},{argumentType:P.B.NOERROR,defaultValue:1},{argumentType:P.B.RANGE,optionalArg:!0}]}};let en=new Map([[1,0],[2,1],[11,1],[12,2],[13,3],[14,4],[15,5],[16,6],[17,0]]),eo=new Map([[1,"0000011"],[2,"1000001"],[3,"1100000"],[4,"0110000"],[5,"0011000"],[6,"0001100"],[7,"0000110"],[11,"0000001"],[12,"1000000"],[13,"0100000"],[14,"0010000"],[15,"0001000"],[16,"0000100"],[17,"0000010"]]);class es extends P.w{degrees(e,t){return this.runFunction(e.args,t,this.metadata("DEGREES"),e=>180/Math.PI*e)}}es.implementedFunctions={DEGREES:{method:"degrees",parameters:[{argumentType:P.B.NUMBER}]}};class ea extends P.w{delta(e,t){return this.runFunction(e.args,t,this.metadata("DELTA"),(e,t)=>e===t?1:0)}}ea.implementedFunctions={DELTA:{method:"delta",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0}]}};class el extends P.w{exp(e,t){return this.runFunction(e.args,t,this.metadata("EXP"),Math.exp
134)}}el.implementedFunctions={EXP:{method:"exp",parameters:[{argumentType:P.B.NUMBER}]}};class eh extends P.w{pmt(e,t){return this.runFunction(e.args,t,this.metadata("PMT"),eu)}ipmt(e,t){return this.runFunction(e.args,t,this.metadata("IPMT"),ec)}ppmt(e,t){return this.runFunction(e.args,t,this.metadata("PPMT"),eg)}fv(e,t){return this.runFunction(e.args,t,this.metadata("FV"),ed)}cumipmt(e,t){return this.runFunction(e.args,t,this.metadata("CUMIPMT"),(e,t,r,i,n,o)=>{if(i>n)return new b.D5(b.NI.NUM,L.B.EndStartPeriod);let s=0;for(let a=i;a<=n;a++)s+=ec(e,a,t,r,0,o);return s})}cumprinc(e,t){return this.runFunction(e.args,t,this.metadata("CUMPRINC"),(e,t,r,i,n,o)=>{if(i>n)return new b.D5(b.NI.NUM,L.B.EndStartPeriod);let s=0;for(let a=i;a<=n;a++)s+=eg(e,a,t,r,0,o);return s})}db(e,t){return this.runFunction(e.args,t,this.metadata("DB"),(e,t,r,i,n)=>{if(12===n&&i>r||i>r+1)return new b.D5(b.NI.NUM,L.B.PeriodLong);if(t>=e)return 0;let o=Math.round((1-Math.pow(t/e,1/r))*1e3)/1e3,s=e*o*n/12;if(1===i)return s;let a=s;for(let t=0;t<i-2;t++)a+=(e-a)*o;return i===r+1?(e-a)*o*(12-n)/12:(e-a)*o})}ddb(e,t){return this.runFunction(e.args,t,this.metadata("DDB"),(e,t,r,i,n)=>{let o;if(i>r)return new b.D5(b.NI.NUM);let s=n/r;return s>=1?(s=1,o=1===i?e:0):o=e*Math.pow(1-s,i-1),Math.max(o-Math.max(t,e*Math.pow(1-s,i)),0)})}dollarde(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARDE"),(e,t)=>{if(t<1)return new b.D5(b.NI.DIV_BY_ZERO);for(t=Math.trunc(t);t>10;)t/=10;return Math.trunc(e)+(e-Math.trunc(e))*10/t})}dollarfr(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARFR"),(e,t)=>{if(t<1)return new b.D5(b.NI.DIV_BY_ZERO);for(t=Math.trunc(t);t>10;)t/=10;return Math.trunc(e)+(e-Math.trunc(e))*t/10})}effect(e,t){return this.runFunction(e.args,t,this.metadata("EFFECT"),(e,t)=>Math.pow(1+e/(t=Math.trunc(t)),t)-1)}ispmt(e,t){return this.runFunction(e.args,t,this.metadata("ISPMT"),(e,t,r,i)=>0===r?new b.D5(b.NI.DIV_BY_ZERO):i*e*(t/r-1))}nominal(e,t){return this.runFunction(e.args,t,this.metadata("NOMINAL"),(e,t)=>(Math.pow(e+1,1/(t=Math.trunc(t)))-1)*t)}nper(e,t){return this.runFunction(e.args,t,this.metadata("NPER"),(e,t,r,i,n)=>0===e?0===t?new b.D5(b.NI.DIV_BY_ZERO):(-r-i)/t:(n&&(t*=1+e),Math.log((t-i*e)/(r*e+t))/Math.log(1+e)))}rate(e,t){return this.runFunction(e.args,t,this.metadata("RATE"),(e,t,r,i,n,o)=>{if(o<=-1)return new b.D5(b.NI.VALUE);let s=o;n=n?1:0;for(let o=0;o<50;o++){let o,a;if(s<=-1)break;if(1e-7>Math.abs(s))o=r*(1+e*s)+t*(1+s*n)*e+i;else{let a=Math.pow(1+s,e);o=r*a+t*(1/s+n)*(a-1)+i}if(1e-7>Math.abs(o))return s;if(1e-7>Math.abs(s))a=r*e+t*n*e;else{let i=Math.pow(1+s,e),o=e*Math.pow(1+s,e-1);a=r*o+t*(1/s+n)*o+-1/(s*s)*t*(i-1)}s-=o/a}return new b.D5(b.NI.NUM)})}pv(e,t){return this.runFunction(e.args,t,this.metadata("PV"),(e,t,r,i,n)=>(n=n?1:0,-1===e)?new b.D5(0===t?b.NI.NUM:b.NI.DIV_BY_ZERO):0===e?-r*t-i:((1-Math.pow(1+e,t))*r*(1+e*n)/e-i)/Math.pow(1+e,t))}rri(e,t){return this.runFunction(e.args,t,this.metadata("RRI"),(e,t,r)=>0===t||r<0&&t>0||r>0&&t<0?new b.D5(b.NI.NUM):Math.pow(r/t,1/e)-1)}sln(e,t){return this.runFunction(e.args,t,this.metadata("SLN"),(e,t,r)=>0===r?new b.D5(b.NI.DIV_BY_ZERO):(e-t)/r)}syd(e,t){return this.runFunction(e.args,t,this.metadata("SYD"),(e,t,r,i)=>i>r?new b.D5(b.NI.NUM):(e-t)*(r-i+1)*2/(r*(r+1)))}tbilleq(e,t){return this.runFunction(e.args,t,this.metadata("TBILLEQ"),(e,t,r)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new b.D5(b.NI.NUM);let i=this.dateTimeHelper.numberToSimpleDate(e),n=this.dateTimeHelper.numberToSimpleDate(t);if(n.year>i.year+1||n.year===i.year+1&&(n.month>i.month||n.month===i.month&&n.day>i.day))return new b.D5(b.NI.NUM);let o=360-r*(t-e);return 0===o?0:o<0?new b.D5(b.NI.NUM):365*r/o})}tbillprice(e,t){return this.runFunction(e.args,t,this.metadata("TBILLPRICE"),(e,t,r)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new b.D5(b.NI.NUM);let i=this.dateTimeHelper.numberToSimpleDate(e),n=this.dateTimeHelper.numberToSimpleDate(t);if(n.year>i.year+1||n.year===i.year+1&&(n.month>i.month||n.month===i.month&&n.day>i.day))return new b.D5(b.NI.NUM);let o=360-r*(t-e);return 0===o?0:o<0?new b.D5(b.NI.NUM):100*(1-r*(t-e)/360)})}tbillyield(e,t){return this.runFunction(e.args,t,this.metadata("TBILLYIELD"),(e,t,r)=>
134{if((e=Math.round(e))>=(t=Math.round(t)))return new b.D5(b.NI.NUM);let i=this.dateTimeHelper.numberToSimpleDate(e),n=this.dateTimeHelper.numberToSimpleDate(t);return n.year>i.year+1||n.year===i.year+1&&(n.month>i.month||n.month===i.month&&n.day>i.day)?new b.D5(b.NI.NUM):(100-r)*360/(r*(t-e))})}fvschedule(e,t){return this.runFunction(e.args,t,this.metadata("FVSCHEDULE"),(e,t)=>{let r=t.valuesFromTopLeftCorner();for(let e of r)if(e instanceof b.D5)return e;for(let t of r)if((0,q.g_)(t))e*=1+(0,q.t_)(t);else if(t!==q.OX)return new b.D5(b.NI.VALUE,L.B.NumberExpected);return e})}npv(e,t){return this.runFunction(e.args,t,this.metadata("NPV"),(e,...t)=>{let r=this.arithmeticHelper.coerceNumbersExactRanges(t);return r instanceof b.D5?r:ep(e,r)})}mirr(e,t){return this.runFunction(e.args,t,this.metadata("MIRR"),(e,t,r)=>{let i=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(i instanceof b.D5)return i;let n=!1,o=!1,s=[],a=[];for(let e of i)e>0?(n=!0,s.push(e),a.push(0)):(e<0?(o=!0,a.push(e)):a.push(0),s.push(0));if(!n||!o)return new b.D5(b.NI.DIV_BY_ZERO);let l=i.length,h=ep(r,s);if(h instanceof b.D5)return h;let u=ep(t,a);return u instanceof b.D5?u:Math.pow(-h*Math.pow(1+r,l)/u/(1+t),1/(l-1))-1})}pduration(e,t){return this.runFunction(e.args,t,this.metadata("PDURATION"),(e,t,r)=>(Math.log(r)-Math.log(t))/Math.log(1+e))}xnpv(e,t){return this.runFunction(e.args,t,this.metadata("XNPV"),(e,t,r)=>{let i=t.valuesFromTopLeftCorner();for(let e of i)if("number"!=typeof e)return new b.D5(b.NI.VALUE,L.B.NumberExpected);let n=r.valuesFromTopLeftCorner();for(let e of n)if("number"!=typeof e)return new b.D5(b.NI.VALUE,L.B.NumberExpected);if(n.length!==i.length)return new b.D5(b.NI.NUM,L.B.EqualLength);let o=n.length,s=0;if(n[0]<0)return new b.D5(b.NI.NUM,L.B.ValueSmall);for(let t=0;t<o;t++){if(n[t]=Math.floor(n[t]),n[t]<n[0])return new b.D5(b.NI.NUM,L.B.ValueSmall);s+=i[t]/Math.pow(1+e,(n[t]-n[0])/365)}return s})}}function eu(e,t,r,i,n){if(0===e)return(-r-i)/t;{let o=Math.pow(1+e,t);return(i*e+r*e*o)*(n?1/(1+e):1)/(1-o)}}function ec(e,t,r,i,n,o){let s=eu(e,r,i,n,o);return 1===t?e*(o?0:-i):e*(o?ed(e,t-2,s,i,o)-s:ed(e,t-1,s,i,o))}function ed(e,t,r,i,n){if(0===e)return-i-r*t;{let o=Math.pow(1+e,t);return r*(n?1+e:1)*(1-o)/e-i*o}}function eg(e,t,r,i,n,o){return eu(e,r,i,n,o)-ec(e,t,r,i,n,o)}function ep(e,t){let r=0;for(let i=t.length-1;i>=0;i--){if(r+=t[i],-1===e){if(0===r)continue;return new b.D5(b.NI.DIV_BY_ZERO)}r/=1+e}return r}eh.implementedFunctions={PMT:{method:"pmt",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:0}],returnNumberType:q.sw.NUMBER_CURRENCY},IPMT:{method:"ipmt",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:0}],returnNumberType:q.sw.NUMBER_CURRENCY},PPMT:{method:"ppmt",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:0}],returnNumberType:q.sw.NUMBER_CURRENCY},FV:{method:"fv",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:0}],returnNumberType:q.sw.NUMBER_CURRENCY},CUMIPMT:{method:"cumipmt",parameters:[{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.INTEGER,minValue:1},{argumentType:P.B.INTEGER,minValue:1},{argumentType:P.B.INTEGER,minValue:0,maxValue:1}],returnNumberType:q.sw.NUMBER_CURRENCY},CUMPRINC:{method:"cumprinc",parameters:[{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.INTEGER,minValue:1},{argumentType:P.B.INTEGER,minValue:1},{argumentType:P.B.INTEGER,minValue:0,maxValue:1}],returnNumberType:q.sw.NUMBER_CURRENCY},DB:{method:"db",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.INTEGER,minValue:0},{argumentType:P.B.INTEGER,minValue:0},{argumentType:P.B.INTEGER,minValue:1,maxValue:12,defaultValue:12}],returnNumberType:q.sw.NUMBER_CURRENCY}
134,DDB:{method:"ddb",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.INTEGER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,greaterThan:0,defaultValue:2}],returnNumberType:q.sw.NUMBER_CURRENCY},DOLLARDE:{method:"dollarde",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:0}]},DOLLARFR:{method:"dollarfr",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:0}]},EFFECT:{method:"effect",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:1}],returnNumberType:q.sw.NUMBER_PERCENT},ISPMT:{method:"ispmt",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]},NOMINAL:{method:"nominal",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:1}],returnNumberType:q.sw.NUMBER_PERCENT},NPER:{method:"nper",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:0}]},PV:{method:"pv",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:0}],returnNumberType:q.sw.NUMBER_CURRENCY},RATE:{method:"rate",parameters:[{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:.1}],returnNumberType:q.sw.NUMBER_PERCENT},RRI:{method:"rri",parameters:[{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}],returnNumberType:q.sw.NUMBER_PERCENT},SLN:{method:"sln",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}],returnNumberType:q.sw.NUMBER_CURRENCY},SYD:{method:"syd",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0}],returnNumberType:q.sw.NUMBER_CURRENCY},TBILLEQ:{method:"tbilleq",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,greaterThan:0}],returnNumberType:q.sw.NUMBER_PERCENT},TBILLPRICE:{method:"tbillprice",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,greaterThan:0}],returnNumberType:q.sw.NUMBER_CURRENCY},TBILLYIELD:{method:"tbillyield",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,greaterThan:0}],returnNumberType:q.sw.NUMBER_PERCENT},FVSCHEDULE:{method:"fvschedule",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.RANGE}],returnNumberType:q.sw.NUMBER_CURRENCY},NPV:{method:"npv",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.ANY}],repeatLastArgs:1,returnNumberType:q.sw.NUMBER_CURRENCY},MIRR:{method:"mirr",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}],returnNumberType:q.sw.NUMBER_PERCENT},PDURATION:{method:"pduration",parameters:[{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0}]},XNPV:{method:"xnpv",parameters:[{argumentType:P.B.NUMBER,greaterThan:-1},{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]}};class ef extends x.w8{formulatext(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("FORMULATEXT"),()=>new b.D5(b.NI.NA,L.B.WrongArgNumber),e=>{var t;return null!==(t=this.serialization.getCellFormula(e))&&void 0!==t?t:new b.D5(b.NI.NA,L.B.Formula)})}}ef.implementedFunctions={FORMULATEXT:{method:"formulatext",parameters:[{argumentType:P.B.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,isDependentOnSheetStructureChange:!0,vectorizationForbidden:!0}};class em extends P.w{hyperlink(e,t){return this.runFunction(e.args,t,this.metadata("HYPERLINK"),(t,r)=>(e.hyperlink=t,null!=r?r:t))}}em.implementedFunctions={HYPERLINK:{method:"hyperlink",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.STRING,optionalArg:!0}]}};var ey=r(11e3);class ev extends P.w{isbinary(e,t){return this.runFunction(e.args,t,this.metadata("ISBINARY"),e=>/^[01]{1,10}$/.test(e))}iserr(e,t){return this.runFunction(e.args,t,this.metadata("ISERR"),e=>e instanceof b.D5&&e.type!==b.NI.NA)}
vendor: 4,586 bytes, line 134
134iserror(e,t){return this.runFunction(e.args,t,this.metadata("ISERROR"),e=>e instanceof b.D5)}isformula(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ISFORMULA"),()=>new b.D5(b.NI.NA,L.B.WrongArgNumber),e=>this.dependencyGraph.addressMapping.getCell(e) instanceof ey._Z)}isblank(e,t){return this.runFunction(e.args,t,this.metadata("ISBLANK"),e=>e===q.OX)}isna(e,t){return this.runFunction(e.args,t,this.metadata("ISNA"),e=>e instanceof b.D5&&e.type==b.NI.NA)}isnumber(e,t){return this.runFunction(e.args,t,this.metadata("ISNUMBER"),q.g_)}islogical(e,t){return this.runFunction(e.args,t,this.metadata("ISLOGICAL"),e=>"boolean"==typeof e)}isref(e,t){return this.runFunction(e.args,t,this.metadata("ISREF"),e=>e instanceof b.D5&&(e.type==b.NI.REF||e.type==b.NI.CYCLE))}istext(e,t){return this.runFunction(e.args,t,this.metadata("ISTEXT"),e=>"string"==typeof e)}isnontext(e,t){return this.runFunction(e.args,t,this.metadata("ISNONTEXT"),e=>"string"!=typeof e)}column(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("COLUMN"),()=>t.formulaAddress.col+1,e=>e.col+1)}columns(e,t){if(1!==e.args.length)return new b.D5(b.NI.NA,L.B.WrongArgNumber);if(e.args.some(e=>e.type===D.W$.EMPTY))return new b.D5(b.NI.NUM,L.B.EmptyArg);let r=e.args[0];for(;r.type===D.W$.PARENTHESIS;)r=r.expression;if(r.type===D.W$.CELL_RANGE||r.type===D.W$.COLUMN_RANGE)return r.end.col-r.start.col+1;if(r.type===D.W$.CELL_REFERENCE)return 1;if(r.type===D.W$.ROW_RANGE)return this.config.maxColumns;{let e=this.evaluateAst(r,t);return e instanceof F.r?e.width():e instanceof b.D5?e:1}}row(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ROW"),()=>t.formulaAddress.row+1,e=>e.row+1)}rows(e,t){if(1!==e.args.length)return new b.D5(b.NI.NA,L.B.WrongArgNumber);if(e.args.some(e=>e.type===D.W$.EMPTY))return new b.D5(b.NI.NUM,L.B.EmptyArg);let r=e.args[0];for(;r.type===D.W$.PARENTHESIS;)r=r.expression;if(r.type===D.W$.CELL_RANGE||r.type===D.W$.ROW_RANGE)return r.end.row-r.start.row+1;if(r.type===D.W$.CELL_REFERENCE)return 1;if(r.type===D.W$.COLUMN_RANGE)return this.config.maxRows;{let e=this.evaluateAst(r,t);return e instanceof F.r?e.height():e instanceof b.D5?e:1}}index(e,t){return this.runFunction(e.args,t,this.metadata("INDEX"),(e,t,r)=>{var i,n,o,s,a,l;return r<1||t<1?new b.D5(b.NI.VALUE,L.B.LessThanOne):r>e.width()||t>e.height()?new b.D5(b.NI.NUM,L.B.ValueLarge):null!==(l=null!==(o=null===(n=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i[t-1])||void 0===n?void 0:n[r-1])&&void 0!==o?o:null===(a=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s[0])||void 0===a?void 0:a[0])&&void 0!==l?l:new b.D5(b.NI.VALUE,L.B.CellRangeExpected)})}na(e,t){return new b.D5(b.NI.NA)}sheet(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEET"),()=>t.formulaAddress.sheet+1,e=>e.sheet+1,e=>{let t=this.dependencyGraph.sheetMapping.getSheetId(e);return void 0!==t?t+1:new b.D5(b.NI.NA,L.B.SheetRef)})}sheets(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEETS"),()=>this.dependencyGraph.sheetMapping.numberOfSheets(),()=>1,()=>new b.D5(b.NI.VALUE,L.B.CellRefExpected))}}ev.implementedFunctions={COLUMN:{method:"column",parameters:[{argumentType:P.B.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},COLUMNS:{method:"columns",parameters:[{argumentType:P.B.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISBINARY:{method:"isbinary",parameters:[{argumentType:P.B.STRING}]},ISERR:{method:"iserr",parameters:[{argumentType:P.B.SCALAR}]},ISFORMULA:{method:"isformula",parameters:[{argumentType:P.B.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISNA:{method:"isna",parameters:[{argumentType:P.B.SCALAR}]},ISREF:{method:"isref",parameters:[{argumentType:P.B.SCALAR}],vectorizationForbidden:!0},ISERROR:{method:"iserror",parameters:[{argumentType:P.B.SCALAR}]},ISBLANK:{method:"isblank",parameters:[{argumentType:P.B.SCALAR}]},ISNUMBER:{method:"isnumber",parameters:[{argumentType:P.B.SCALAR}]},ISLOGICAL:{method:"islogical",parameters:[{argumentType:P.B.SCALAR}]},ISTEXT:{method:"istext",parameters:[{argumentType:P.B.SCALAR}]},ISNONTEXT:{method:"isnontext",parameters:[{argumentType:P.B.SCALAR}]},INDEX:{method:"index",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:1}]},NA:{method:"na",parameters:[]},ROW:{method:"row",parameters:[{argumentType:P.B.NOERROR,optionalArg:!0}
134],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ROWS:{method:"rows",parameters:[{argumentType:P.B.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEET:{method:"sheet",parameters:[{argumentType:P.B.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEETS:{method:"sheets",parameters:[{argumentType:P.B.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0}};class ew extends P.w{iseven(e,t){return this.runFunction(e.args,t,this.metadata("ISEVEN"),e=>e%2==0)}}ew.implementedFunctions={ISEVEN:{method:"iseven",parameters:[{argumentType:P.B.NUMBER}]}};class eE extends P.w{isodd(e,t){return this.runFunction(e.args,t,this.metadata("ISODD"),e=>e%2==1)}}eE.implementedFunctions={ISODD:{method:"isodd",parameters:[{argumentType:P.B.NUMBER}]}};class eS extends P.w{log10(e,t){return this.runFunction(e.args,t,this.metadata("LOG10"),Math.log10)}log(e,t){return this.runFunction(e.args,t,this.metadata("LOG"),(e,t)=>Math.log(e)/Math.log(t))}ln(e,t){return this.runFunction(e.args,t,this.metadata("LN"),Math.log)}}eS.implementedFunctions={LOG10:{method:"log10",parameters:[{argumentType:P.B.NUMBER}]},LOG:{method:"log",parameters:[{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,defaultValue:10,greaterThan:0}]},LN:{method:"ln",parameters:[{argumentType:P.B.NUMBER}]}};let eC=parseFloat(Math.PI.toFixed(14));class eR extends P.w{pi(e,t){return this.runFunction(e.args,t,this.metadata("PI"),()=>eC)}sqrtpi(e,t){return this.runFunction(e.args,t,this.metadata("SQRTPI"),e=>Math.sqrt(eC*e))}}function eb(e,t){return new R.J(t.width,e.height)}function eT(e,t,r){return new R.J(1+(e.width-t)/r,1+(e.height-t)/r)}eR.implementedFunctions={PI:{method:"pi",parameters:[]},SQRTPI:{method:"sqrtpi",parameters:[{argumentType:P.B.NUMBER,minValue:0}]}};class eN extends P.w{mmult(e,t){return this.runFunction(e.args,t,this.metadata("MMULT"),(e,t)=>{if(!e.hasOnlyNumbers()||!t.hasOnlyNumbers())return new b.D5(b.NI.VALUE,L.B.NumberRange);if(t.height()!==e.width())return new b.D5(b.NI.VALUE,L.B.ArrayDimensions);let r=eb(e.size,t.size),i=this.createKernel(function(e,t,r){let i=0;for(let n=0;n<r;++n)i+=e[this.thread.y][n]*t[n][this.thread.x];return i},r)(e.rawNumbers(),t.rawNumbers(),e.width());return F.r.onlyNumbers(i)})}mmultArraySize(e,t){if(2!==e.args.length)return R.J.error();let r=this.metadata("MMULT"),[i,n]=e.args.map(e=>{var i;return this.arraySizeForAst(e,new B.P(t.formulaAddress,t.arraysFlag||null!==(i=null==r?void 0:r.enableArrayArithmeticForArguments)&&void 0!==i&&i))});return eb(i,n)}maxpool(e,t){return this.runFunction(e.args,t,this.metadata("MAXPOOL"),(e,t,r=t)=>{if(!e.hasOnlyNumbers())return new b.D5(b.NI.VALUE,L.B.NumberRange);let i=eT(e.size,t,r),n=this.createKernel(function(e,t,r){let i=this.thread.x*r,n=this.thread.y*r,o=e[n][i];for(let r=0;r<t;r++)for(let s=0;s<t;s++)o=Math.max(o,e[n+r][i+s]);return o},i)(e.rawNumbers(),t,r);return F.r.onlyNumbers(n)})}medianpool(e,t){return this.runFunction(e.args,t,this.metadata("MEDIANPOOL"),(e,t,r=t)=>{if(!e.hasOnlyNumbers())return new b.D5(b.NI.VALUE,L.B.NumberRange);let i=eT(e.size,t,r),n=this.createKernel(function(e,t,r){let i=this.thread.x*r,n=this.thread.y*r,o=e[n][i];for(let r=0;r<t;r++)for(let s=0;s<t;s++)o=Math.max(o,e[n+r][i+s]);let s=e[n][i];for(let r=0;r<t;r++)for(let o=0;o<t;o++)s=Math.min(s,e[n+r][i+o]);let a=t*t,l=s,h=o,u=42;for(let r=0;r<32;r++){let r=(l+h)/2,o=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++)e[n+s][i+a]>r&&o++;if(t%2==0){if(o===a/2){u=r;break}o>a/2?l=r:h=r}else{if(o===(a-1)/2){u=r;break}o>(a-1)/2?l=r:h=r}}return u},i)(e.rawNumbers(),t,r);return F.r.onlyNumbers(n)})}maxpoolArraySize(e,t){let r;if(e.args.length<2||e.args.length>3)return R.J.error();let i=this.metadata("MAXPOOL"),n=e.args.map(e=>{var r;return this.arraySizeForAst(e,new B.P(t.formulaAddress,t.arraysFlag||null!==(r=null==i?void 0:i.enableArrayArithmeticForArguments)&&void 0!==r&&r))})[0],o=e.args[1],s=r=o.type===D.W$.NUMBER?o.value:1;if(3===e.args.length){let t=e.args[2];s=t.type===D.W$.NUMBER?t.value:1}return r>n.width||r>n.height||s>r||(n.width-r)%s!=0||(n.height-r)%s!=0?R.J.error():eT(n,r,s)}medianpoolArraySize(e,t){return this.maxpoolArraySize(e,t)}transpose(e,t){return this.runFunction(e.args,t,this.metadata("TRANSPOSE"),e=>{let t=e.rawData(),r=e.size,i=[];for(let e=0;e<r.width;++e){i[e]=[];for(let n=0;n<r.height;++n)i[e][n]=t[n][e]}return F.r.onlyValues(i)})}transposeArraySize(e,t){if(1!==e.args.length)return R.J.error();let r=this.metadata("TRANSPOSE"),[i]=e.args.map(e=>{var i;return this.arraySizeForAst(e,new B.P(t.formulaAddress,t.arraysFlag||null!==(i=null==r?void 0:r.enableArrayArithmeticForArguments)&&void 0!==i&&i))});return new R.J(i.height,i.width)}createKernel(e,t){return function(...r){let i=[];for(let n=0;n<t.height;++n){i.push([]);for(let o=0;o<t.width;++o)i[n][o]=e.apply({thread:{x:o,y:n}},r)}return i}}}eN.implementedFunctions={MMULT:{method:"mmult",sizeOfResultArrayMethod:"mmultArraySize",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}],vectorizationForbidden:!0},TRANSPOSE:{method:"transpose",sizeOfResultArrayMethod:"transposeArraySize",parameters:[{argumentType:P.B.RANGE}],vectorizationForbidden:!0},MAXPOOL:{method:"maxpool",sizeOfResultArrayMethod:"maxpoolArraySize",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,optionalArg:!0}],vectorizationForbidden:!0},MEDIANPOOL:{method:"medianpool",sizeOfResultArrayMethod:"medianpoolArraySize",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,optionalArg:!0}],vectorizationForbidden:!0}};class eA extends P.w{median(e,t){return this.runFunction(e.args,t,this.metadata("MEDIAN"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof b.D5?t:0===t.length?new b.D5(b.NI.NUM,L.B.OneValue):(t.sort((e,t)=>
134e-t),t.length%2==0)?(t[t.length/2-1]+t[t.length/2])/2:t[Math.floor(t.length/2)]})}large(e,t){return this.runFunction(e.args,t,this.metadata("LARGE"),(e,t)=>{let r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return r instanceof b.D5?r:(r.sort((e,t)=>e-t),(t=Math.trunc(t))>r.length)?new b.D5(b.NI.NUM,L.B.ValueLarge):r[r.length-t]})}small(e,t){return this.runFunction(e.args,t,this.metadata("SMALL"),(e,t)=>{let r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return r instanceof b.D5?r:(r.sort((e,t)=>e-t),(t=Math.trunc(t))>r.length)?new b.D5(b.NI.NUM,L.B.ValueLarge):r[t-1]})}}eA.implementedFunctions={MEDIAN:{method:"median",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},LARGE:{method:"large",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER,minValue:1}]},SMALL:{method:"small",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER,minValue:1}]}};class eI extends P.w{mod(e,t){return this.runFunction(e.args,t,this.metadata("MOD"),(e,t)=>0===t?new b.D5(b.NI.DIV_BY_ZERO):e%t)}}eI.implementedFunctions={MOD:{method:"mod",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]}};var eM=r(58485);function eO(e){return(0,q.g_)(e)&&!Number.isFinite((0,q.t_)(e))?0:e}class ex{constructor(e,t,r){this.sumsq=e,this.sum=t,this.count=r}static single(e){return new ex(e*e,e,1)}compose(e){return new ex(this.sumsq+e.sumsq,this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}varSValue(){return this.count>1?(this.sumsq-this.sum*this.sum/this.count)/(this.count-1):void 0}varPValue(){return this.count>0?(this.sumsq-this.sum*this.sum/this.count)/this.count:void 0}}ex.empty=new ex(0,0,0);class e_ extends P.w{constructor(){super(...arguments),this.addWithEpsilonRaw=(e,t)=>this.arithmeticHelper.addWithEpsilonRaw(e,t)}sum(e,t){return this.doSum(e.args,t)}sumsq(e,t){return this.reduce(e.args,t,0,"SUMSQ",this.addWithEpsilonRaw,e=>Math.pow((0,q.t_)(e),2),eP)}max(e,t){return this.doMax(e.args,t)}maxa(e,t){return eO(this.reduce(e.args,t,Number.NEGATIVE_INFINITY,"MAXA",(e,t)=>Math.max(e,t),q.t_,eL))}min(e,t){return this.doMin(e.args,t)}mina(e,t){return eO(this.reduce(e.args,t,Number.POSITIVE_INFINITY,"MINA",(e,t)=>Math.min(e,t),q.t_,eL))}count(e,t){return this.doCount(e.args,t)}counta(e,t){return this.doCounta(e.args,t)}average(e,t){return this.doAverage(e.args,t)}averagea(e,t){var r;let i=this.reduce(e.args,t,ex.empty,"_AGGREGATE_A",(e,t)=>e.compose(t),e=>ex.single((0,q.t_)(e)),eL);return i instanceof b.D5?i:null!==(r=i.averageValue())&&void 0!==r?r:new b.D5(b.NI.DIV_BY_ZERO)}vars(e,t){return this.doVarS(e.args,t)}varp(e,t){return this.doVarP(e.args,t)}vara(e,t){var r;let i=this.reduceAggregateA(e.args,t);return i instanceof b.D5?i:null!==(r=i.varSValue())&&void 0!==r?r:new b.D5(b.NI.DIV_BY_ZERO)}varpa(e,t){var r;let i=this.reduceAggregateA(e.args,t);return i instanceof b.D5?i:null!==(r=i.varPValue())&&void 0!==r?r:new b.D5(b.NI.DIV_BY_ZERO)}stdevs(e,t){return this.doStdevS(e.args,t)}stdevp(e,t){return this.doStdevP(e.args,t)}stdeva(e,t){let r=this.reduceAggregateA(e.args,t);if(r instanceof b.D5)return r;{let e=r.varSValue();return void 0===e?new b.D5(b.NI.DIV_BY_ZERO):Math.sqrt(e)}}stdevpa(e,t){let r=this.reduceAggregateA(e.args,t);if(r instanceof b.D5)return r;{let e=r.varPValue();return void 0===e?new b.D5(b.NI.DIV_BY_ZERO):Math.sqrt(e)}}product(e,t){return this.doProduct(e.args,t)}subtotal(e,t){if(e.args.length<2)return new b.D5(b.NI.NA,L.B.WrongArgNumber);let r=this.coerceToType(this.evaluateAst(e.args[0],t),{argumentType:P.B.NUMBER},t),i=e.args.slice(1);switch(r){case 1:case 101:return this.doAverage(i,t);case 2:case 102:return this.doCount(i,t);case 3:case 103:return this.doCounta(i,t);case 4:case 104:return this.doMax(i,t);case 5:case 105:return this.doMin(i,t);case 6:case 106:return this.doProduct(i,t);case 7:case 107:return this.doStdevS(i,t);case 8:case 108:return this.doStdevP(i,t);case 9:case 109:return this.doSum(i,t);case 10:case 110:return this.doVarS(i,t);case 11:case 111:return this.doVarP(i,t);default:return new b.D5(b.NI.VALUE,L.B.BadMode)}}reduceAggregate(e,t){return this.reduce(e,t,ex.empty,"_AGGREGATE",(e,t)=>e.compose(t),e=>ex.single((0,q.t_)(e)),eP)}reduceAggregateA(e,t){return this.reduce(e,t,ex.empty,"_AGGREGATE_A",(e,t)=>e.compose(t),e=>ex.single((0,q.t_)(e)),eL)}doAverage(e,t){var r;let i=this.reduceAggregate(e,t);return i instanceof b.D5?i:null!==(r=i.averageValue())&&void 0!==r?r:new b.D5(b.NI.DIV_BY_ZERO)}doVarS(e,t){var r;let i=this.reduceAggregate(e,t);return i instanceof b.D5?i:null!==(r=i.varSValue())&&void 0!==r?r:new b.D5(b.NI.DIV_BY_ZERO)}doVarP(e,t){var r;let i=this.reduceAggregate(e,t);return i instanceof b.D5?i:null!==(r=i.varPValue())&&void 0!==r?r:new b.D5(b.NI.DIV_BY_ZERO)}doStdevS(e,t){let r=this.reduceAggregate(e,t);if(r instanceof b.D5)return r;{let e=r.varSValue();return void 0===e?new b.D5(b.NI.DIV_BY_ZERO):Math.sqrt(e)}}doStdevP(e,t){let r=this.reduceAggregate(e,t);if(r instanceof b.D5)return r;{let e=r.varPValue();return void 0===e?new b.D5(b.NI.DIV_BY_ZERO):Math.sqrt(e)}}doCount(e,t){return this.reduce(e,t,0,"COUNT",(e,t)=>e+t,q.t_,e=>(0,q.g_)(e)?1:0)}doCounta(e,t){return this.reduce(e,t,0,"COUNTA",(e,t)=>e+t,q.t_,e=>e===q.OX?0:1)}doMax(e,t){return eO(this.reduce(e,t,Number.NEGATIVE_INFINITY,"MAX",(e,t)=>Math.max(e,t),q.t_,eP))}doMin(e,t){return eO(this.reduce(e,t,Number.POSITIVE_INFINITY,"MIN",(e,t)=>Math.min(e,t),q.t_,eP))}doSum(e,t){return this.reduce(e,t,0,"SUM",this.addWithEpsilonRaw,q.t_,eP)}doProduct(e,t){return this.reduce(e,t,1,"PRODUCT",(e,t)=>e*t,q.t_,eP)}reduce(e,t,r,i,n,o,s){return e.length<1?new b.D5(b.NI.NA,L.B.WrongArgNumber):e.reduce((e,a)=>{let l;if(e instanceof b.D5)return e;if(a.type===D.W$.CELL_RANGE||a.type===D.W$.COLUMN_RANGE||a.type===D.W$.ROW_RANGE){let l=this.evaluateRange(a,t,r,i,n,o,s);return l instanceof b.D5?l:n(l,e)}if((l=this.evaluateAst(a,t))instanceof F.r)return Array.from(l.valuesFromTopLeftCorner()).map(s).filter(e=>void 0!==e).map(e=>e instanceof b.D5?e:o(e)).reduce((e,t)=>
134e instanceof b.D5?e:t instanceof b.D5?t:n(e,t),e);if(a.type===D.W$.CELL_REFERENCE){if(void 0===(l=s(l)))return e}else if(void 0===(l=s(l=this.coerceScalarToNumberOrError(l))))return e;return l instanceof b.D5?l:n(e,o(l))},r)}evaluateRange(e,t,r,i,n,o,s){let a;try{a=eM.gG.fromAst(e,t.formulaAddress)}catch(e){if(e instanceof A.Uk)return new b.D5(b.NI.REF,L.B.RangeManySheets);throw e}if(!this.isSheetValid(a))return new b.D5(b.NI.REF,L.B.SheetRef);let l=this.dependencyGraph.getRange(a.start,a.end);if(void 0===l)throw Error("Range does not exists in graph");let h=l.getFunctionValue(i);return void 0===h&&(h=this.getRangeValues(i,a,l,o,s).reduce((e,t)=>e instanceof b.D5?e:t instanceof b.D5?t:n(e,t),r),l.setFunctionValue(i,h)),h}isSheetValid(e){return this.dependencyGraph.sheetMapping.hasSheetWithId(e.start.sheet,{includePlaceholders:!1})&&this.dependencyGraph.sheetMapping.hasSheetWithId(e.end.sheet,{includePlaceholders:!1})}getRangeValues(e,t,r,i,n){let o;let s=[],{smallerRangeVertex:a,restRange:l}=this.dependencyGraph.rangeMapping.findSmallerRange(t);if(void 0!==a&&this.dependencyGraph.existsEdge(a,r)){let t=a.getFunctionValue(e);if(void 0!==t)s.push(t);else for(let e of a.range.addresses(this.dependencyGraph)){let t=n(this.dependencyGraph.getScalarValue(e));t instanceof b.D5?s.push(t):void 0!==t&&s.push(i(t))}o=l}else o=t;for(let e of o.addresses(this.dependencyGraph)){let t=n(this.dependencyGraph.getScalarValue(e));t instanceof b.D5?s.push(t):void 0!==t&&s.push(i(t))}return s}}function eP(e){return(0,q.g_)(e)||e instanceof b.D5?e:void 0}function eL(e){return"boolean"==typeof e?(0,H.oz)(e):(0,q.g_)(e)||e instanceof b.D5?e:"string"==typeof e?0:void 0}e_.implementedFunctions={SUM:{method:"sum",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},SUMSQ:{method:"sumsq",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},MAX:{method:"max",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},MIN:{method:"min",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},MAXA:{method:"maxa",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},MINA:{method:"mina",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},COUNT:{method:"count",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},COUNTA:{method:"counta",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},AVERAGE:{method:"average",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},AVERAGEA:{method:"averagea",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},PRODUCT:{method:"product",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},"VAR.S":{method:"vars",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},"VAR.P":{method:"varp",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},VARA:{method:"vara",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},VARPA:{method:"varpa",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},"STDEV.S":{method:"stdevs",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},"STDEV.P":{method:"stdevp",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},STDEVA:{method:"stdeva",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},STDEVPA:{method:"stdevpa",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},SUBTOTAL:{method:"subtotal",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.ANY}],repeatLastArgs:1}},e_.aliases={VAR:"VAR.S",VARP:"VAR.P",STDEV:"STDEV.S",STDEVP:"STDEV.P",VARS:"VAR.S",STDEVS:"STDEV.S"};class ek extends P.w{power(e,t){return this.runFunction(e.args,t,this.metadata("POWER"),Math.pow)}}ek.implementedFunctions={POWER:{method:"power",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]}};class eD extends P.w{radians(e,t){return this.runFunction(e.args,t,this.metadata("RADIANS"),e=>Math.PI/180*e)}}eD.implementedFunctions={RADIANS:{method:"radians",parameters:[{argumentType:P.B.NUMBER}]}};class eH extends P.w{dec2bin(e,t){return this.runFunction(e.args,t,this.metadata("DEC2BIN"),(e,t)=>eF(e,2,t))}dec2oct(e,t){return this.runFunction(e.args,t,this.metadata("DEC2OCT"),(e,t)=>eF(e,8,t))}dec2hex(e,t){return this.runFunction(e.args,t,this.metadata("DEC2HEX"),(e,t)=>eF(e,16,t))}bin2dec(e,t){return this.runFunction(e.args,t,this.metadata("BIN2DEC"),e=>{let t=eB(e,2,10);return void 0===t?new b.D5(b.NI.NUM,L.B.NotBinary):ej(t,2)})}bin2oct(e,t){return this.runFunction(e.args,t,this.metadata("BIN2OCT"),(e,t)=>{let r=eB(e,2,10);return void 0===r?new b.D5(b.NI.NUM,L.B.NotBinary):eF(ej(r,2),8,t)})}bin2hex(e,t){return this.runFunction(e.args,t,this.metadata("BIN2HEX"),(e,t)=>{let r=eB(e,2,10);return void 0===r?new b.D5(b.NI.NUM,L.B.NotBinary):eF(ej(r,2),16,t)})}oct2dec(e,t){return this.runFunction(e.args,t,this.metadata("OCT2DEC"),e=>{let t=eB(e,8,10);return void 0===t?new b.D5(b.NI.NUM,L.B.NotOctal):ej(t,8)})}oct2bin(e,t){return this.runFunction(e.args,t,this.metadata("OCT2BIN"),(e,t)=>{let r=eB(e,8,10);return void 0===r?new b.D5(b.NI.NUM,L.B.NotOctal):eF(ej(r,8),2,t)})}oct2hex(e,t){return this.runFunction(e.args,t,this.metadata("OCT2HEX"),(e,t)=>{let r=eB(e,8,10);return void 0===r?new b.D5(b.NI.NUM,L.B.NotOctal):eF(ej(r,8),16,t)})}hex2dec(e,t){return this.runFunction(e.args,t,this.metadata("HEX2DEC"),e=>{let t=eB(e,16,10);return void 0===t?new b.D5(b.NI.NUM,L.B.NotHex):ej(t,16)})}hex2bin(e,t){return this.runFunction(e.args,t,this.metadata("HEX2BIN"),(e,t)=>{let r=eB(e,16,10);return void 0===r?new b.D5(b.NI.NUM,L.B.NotHex):eF(ej(r,16),2,t)})}hex2oct(e,t){return this.runFunction(e.args,t,this.metadata("HEX2OCT"),(e,t)=>{let r=eB(e,16,10);return void 0===r?new b.D5(b.NI.NUM,L.B.NotHex):eF(ej(r,16),8,t)})}base(e,t){return this.runFunction(e.args,t,this.metadata("BASE"),eU)}decimal(e,t){return this.runFunction(e.args,t,this.metadata("DECIMAL"),(e,t)=>{let r=eB(e,t,255);return void 0===r?new b.D5(b.NI.NUM,L.B.NotHex):parseInt(r,t)})}}function eB(e,t,r){let i=RegExp(`^[${"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".substr(0,t)}]+$`);if(!(e.length>r)&&i.test(e))return e}function eF(e,t,r){if(e>-eV(t)-1)return new b.D5(b.NI.NUM,L.B.ValueBaseLarge);if(e<eV(t))return new b.D5(b.NI.NUM,L.B.ValueBaseSmall);let i=eW(e,t);return void 0===r||e<0?i:i.length>r?new b.D5(b.NI.NUM,L.B.ValueBaseLong):(0,ee.Q_)(i,r)}function eV(e){return-Math.pow(e,10)/2}function eU(e,t,r){let i=eW(e,t);return void 0!==r&&r>i.length?(0,ee.Q_)(i,r):i}function eW(e,t){let r=e<0?Math.pow(t,10):0;return(e+r).toString(t).toUpperCase()}function ej(e,t){let r=parseInt(e,t),i=Math.pow(t,10);return r>=i/2?r-i:r}eH.implementedFunctions={DEC2BIN:{method:"dec2bin",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2OCT:{method:"dec2oct",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2HEX:{method:"dec2hex",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},BIN2DEC:{method:"bin2dec",parameters:[{argumentType:P.B.STRING}]},BIN2OCT:{method:"bin2oct",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},BIN2HEX:{method:"bin2hex",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},OCT2DEC:{method:"oct2dec",parameters:[{argumentType:P.B.STRING}]},OCT2BIN:{method:"oct2bin",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},OCT2HEX:{method:"oct2hex",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},HEX2DEC:{method:"hex2dec",parameters:[{argumentType:P.B.STRING}]},HEX2BIN:{method:"hex2bin",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},HEX2OCT:{method:"hex2oct",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:0,maxValue:10}]},DECIMAL:{method:"decimal",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,minValue:2,maxValue:36}]},BASE:{method:"base",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:2,maxValue:36},{argumentType:P.B.NUMBER,optionalArg:!0,minValue:0,maxValue:255}]}};class eG extends P.w{rand(e,t){return this.runFunction(e.args,t,this.metadata("RAND"),Math.random)}randbetween(e,t){return this.runFunction(e.args,t,this.metadata("RANDBETWEEN"),(e,t)=>t<e?new b.D5(b.NI.NUM,L.B.WrongOrder):((e=Math.ceil(e))===(t=Math.floor(t)+1)&&(t+=1),e+Math.floor(Math.random()*(t-e))))}}function e$(e){let t=Math.ceil(e);return t%2==1?t:t+1}function ez(e){let t=Math.ceil(e);return t%2==0?t:t+1}eG.implementedFunctions={RAND:{method:"rand",parameters:[],isVolatile:!0},RANDBETWEEN:{method:"randbetween",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}],isVolatile:!0}};class eY extends P.w{roundup(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),(e,t)=>{let r=Math.pow(10,t);return e<0?-Math.ceil(-e*r)/r:Math.ceil(e*r)/r})}rounddown(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),(e,t)=>{let r=Math.pow(10,t);return e<0?-Math.floor(-e*r)/r:Math.floor(e*r)/r})}round(e,t){return this.runFunction(e.args,t,this.metadata("ROUND"),(e,t)=>{let r=Math.pow(10,t);return e<0?-Math.round(-e*r)/r:Math.round(e*r)/r})}intFunc(e,t){return this.runFunction(e.args,t,this.metadata("INT"),e=>e<0?-Math.floor(-e):Math.floor(e))}even(e,t){return this.runFunction(e.args,t,this.metadata("EVEN"),e=>e<0?-ez(-e):ez(e))}odd(e,t){return this.runFunction(e.args,t,this.metadata("ODD"),e=>e<0?-e$(-e):e$(e))}ceilingmath(e,t){return this.runFunction(e.args,t,this.metadata("CEILING.MATH"),(e,t,r)=>0===t||0===e?0:(t=Math.abs(t),1===r&&e<0&&(t=-t),Math.ceil(e/t)*t))}ceiling(e,t){return this.runFunction(e.args,t,this.metadata("CEILING"),
134(e,t)=>0===e?0:0===t?new b.D5(b.NI.DIV_BY_ZERO):e>0&&t<0?new b.D5(b.NI.NUM,L.B.DistinctSigns):Math.ceil(e/t)*t)}ceilingprecise(e,t){return this.runFunction(e.args,t,this.metadata("CEILING.PRECISE"),(e,t)=>0===t||0===e?0:Math.ceil(e/(t=Math.abs(t)))*t)}floormath(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR.MATH"),(e,t,r)=>0===t||0===e?0:(t=Math.abs(t),1===r&&e<0&&(t*=-1),Math.floor(e/t)*t))}floor(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR"),(e,t)=>0===e?0:0===t?new b.D5(b.NI.DIV_BY_ZERO):e>0&&t<0?new b.D5(b.NI.NUM,L.B.DistinctSigns):Math.floor(e/t)*t)}floorprecise(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR.PRECISE"),(e,t)=>0===t||0===e?0:Math.floor(e/(t=Math.abs(t)))*t)}}eY.implementedFunctions={ROUNDUP:{method:"roundup",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0}]},ROUNDDOWN:{method:"rounddown",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0}]},ROUND:{method:"round",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:0}]},INT:{method:"intFunc",parameters:[{argumentType:P.B.NUMBER}]},EVEN:{method:"even",parameters:[{argumentType:P.B.NUMBER}]},ODD:{method:"odd",parameters:[{argumentType:P.B.NUMBER}]},"CEILING.MATH":{method:"ceilingmath",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:1},{argumentType:P.B.NUMBER,defaultValue:0}]},CEILING:{method:"ceiling",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]},"CEILING.PRECISE":{method:"ceilingprecise",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:1}]},"FLOOR.MATH":{method:"floormath",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:1},{argumentType:P.B.NUMBER,defaultValue:0}]},FLOOR:{method:"floor",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]},"FLOOR.PRECISE":{method:"floorprecise",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,defaultValue:1}]}},eY.aliases={"ISO.CEILING":"CEILING.PRECISE",TRUNC:"ROUNDDOWN"};class eK extends P.w{sqrt(e,t){return this.runFunction(e.args,t,this.metadata("SQRT"),Math.sqrt)}}eK.implementedFunctions={SQRT:{method:"sqrt",parameters:[{argumentType:P.B.NUMBER}]}};let eX=(e,t,r)=>{if(r.end.row>r.start.row){let i=(0,b.mT)(r.end.sheet,r.end.col,r.end.row-1),n=e.getRange(r.start,i);if(void 0!==n)return{smallerRangeVertex:n,restValuesRange:r.withStart((0,b.mT)(r.start.sheet,r.start.col,r.end.row)),restConditionRanges:t.map(e=>e.withStart((0,b.mT)(e.start.sheet,e.start.col,e.end.row)))}}return{restValuesRange:r,restConditionRanges:t}};class eq{constructor(e,t,r,i,n){this.interpreter=e,this.cacheKey=t,this.reduceInitialValue=r,this.composeFunction=i,this.mapFunction=n,this.dependencyGraph=this.interpreter.dependencyGraph}compute(e,t){for(let r of t)if(!r.conditionRange.sameDimensionsAs(e))return new b.D5(b.NI.VALUE,L.B.EqualLength);let r=this.tryToGetRangeVertexForRangeValue(e),i=t.map(e=>this.tryToGetRangeVertexForRangeValue(e.conditionRange));if(!(r&&i.every(e=>void 0!==e)))return this.evaluateRangeValue(e,t);{let n=t.map(e=>e.criterionPackage.raw).join(","),o=this.findAlreadyComputedValueInCache(r,this.cacheKey(t),n);if(void 0!==o)return this.interpreter.stats.incrementCriterionFunctionFullCacheUsed(),o;let s=this.buildNewCriterionCache(this.cacheKey(t),t.map(e=>e.conditionRange.range),e.range);return s.has(n)||s.set(n,[this.evaluateRangeValue(e,t),t.map(e=>e.criterionPackage.lambda)]),r.setCriterionFunctionValues(this.cacheKey(t),s),i.forEac
134h(e=>{void 0!==e&&e.addDependentCacheRange(r)}),s.get(n)[0]}}tryToGetRangeVertexForRangeValue(e){let t=e.range;if(void 0!==t)return this.dependencyGraph.getRange(t.start,t.end)}reduceFunction(e){let t=this.reduceInitialValue;for(let r of e)t=this.composeFunction(t,r);return t}findAlreadyComputedValueInCache(e,t,r){return e.getCriterionFunctionValue(t,r)}evaluateRangeValue(e,t){let r=t.map(e=>e.criterionPackage.lambda),i=Array.from(e.valuesFromTopLeftCorner()).map(this.mapFunction)[Symbol.iterator](),n=eJ(r,t.map(e=>e.conditionRange.iterateValuesFromTopLeftCorner()),i);return this.reduceFunction(n)}buildNewCriterionCache(e,t,r){let i;let n=this.dependencyGraph.getRange(r.start,r.end),{smallerRangeVertex:o,restConditionRanges:s,restValuesRange:a}=eX(this.dependencyGraph,t,r);i=void 0!==o&&this.dependencyGraph.existsEdge(o,n)?o.getCriterionFunctionValues(e):new Map;let l=new Map;return i.forEach(([e,t],r)=>{let i=eJ(t,s.map(e=>eQ(this.dependencyGraph,e)),Array.from(eQ(this.dependencyGraph,a)).map(this.mapFunction)[Symbol.iterator]()),n=this.composeFunction(e,this.reduceFunction(i));this.interpreter.stats.incrementCriterionFunctionPartialCacheUsed(),l.set(r,[n,t])}),l}}class eZ{constructor(e,t){this.conditionRange=e,this.criterionPackage=t}}function*eQ(e,t){for(let r of t.addresses(e))yield(0,q.t_)(e.getScalarValue(r))}function*eJ(e,t,r){for(let i of r){let r=t.map(e=>(function(e){let t=e[Symbol.iterator](),{done:r,value:i}=t.next();return r?{rest:function*(){}()}:{value:i,rest:t}})(e));if(!r.every(e=>Object.prototype.hasOwnProperty.call(e,"value")))return;(function(e,t){let r=[];for(let i=0;i<Math.min(e.length,t.length);i++)r.push([e[i],t[i]]);return r})(r.map(e=>(0,q.t_)(e.value)),e).every(([e,t])=>t(e))&&(yield i),t=r.map(e=>e.rest)}}class e0{constructor(e,t){this.sum=e,this.count=t}static single(e){return new e0(e,1)}compose(e){return new e0(this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}}function e1(e){return(0,q.g_)(e)&&!Number.isFinite((0,q.t_)(e))?0:e}function e2(e){return e instanceof b.D5?e:(0,q.g_)(e)?(0,q.t_)(e):void 0}e0.empty=new e0(0,0);class e5 extends P.w{sumif(e,t){let r="SUMIF";return this.runFunction(e.args,t,this.metadata(r),(e,t,i)=>this.computeConditionalAggregationFunction(null!=i?i:e,[e,t],r,0,(e,t)=>this.arithmeticHelper.nonstrictadd(e,t),e2))}sumifs(e,t){let r="SUMIFS";return this.runFunction(e.args,t,this.metadata(r),(e,...t)=>this.computeConditionalAggregationFunction(e,t,r,0,(e,t)=>this.arithmeticHelper.nonstrictadd(e,t),e2))}averageif(e,t){let r="AVERAGEIF";return this.runFunction(e.args,t,this.metadata(r),(e,t,i)=>{let n=this.computeConditionalAggregationFunction(null!=i?i:e,[e,t],r,e0.empty,(e,t)=>e.compose(t),e=>(0,q.g_)(e)?e0.single((0,q.t_)(e)):e0.empty);return n instanceof b.D5?n:n.averageValue()||new b.D5(b.NI.DIV_BY_ZERO)})}countif(e,t){let r="COUNTIF";return this.runFunction(e.args,t,this.metadata(r),(e,t)=>this.computeConditionalAggregationFunction(e,[e,t],r,0,(e,t)=>e+t,()=>1))}countifs(e,t){let r="COUNTIFS";return this.runFunction(e.args,t,this.metadata(r),(...e)=>this.computeConditionalAggregationFunction(e[0],e,r,0,(e,t)=>e+t,()=>1))}minifs(e,t){let r="MINIFS",i=(e,t)=>void 0===t||void 0===e?void 0===t?e:t:Math.min(e,t);return this.runFunction(e.args,t,this.metadata(r),(e,...t)=>e1(this.computeConditionalAggregationFunction(e,t,r,Number.POSITIVE_INFINITY,i,e2)))}maxifs(e,t){let r="MAXIFS",i=(e,t)=>void 0===t||void 0===e?void 0===t?e:t:Math.max(e,t);return this.runFunction(e.args,t,this.metadata(r),(e,...t)=>e1(this.computeConditionalAggregationFunction(e,t,r,Number.NEGATIVE_INFINITY,i,e2)))}computeConditionalAggregationFunction(e,t,r,i,n,o){let s=[];for(let e=0;e<t.length;e+=2){let r=t[e],i=this.interpreter.criterionBuilder.fromCellValue(t[e+1],this.arithmeticHelper);if(void 0===i)return new b.D5(b.NI.VALUE,L.B.BadCriterion);s.push(new eZ(r,i))}return new eq(this.interpreter,e=>[r,...e.map(e=>`${e.conditionRange.range.sheet},${e.conditionRange.range.start.col},${e.conditionRange.range.start.row}`)].join(","),i,n,o).compute(e,s)}}e5.implementedFunctions={SUMIF:{method:"sumif",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NOERROR},{argumentType:P.B.RANGE,optionalArg:!0}]},COUNTIF:{method:"countif",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NOERROR}]},AVERAGEIF:{method:"averageif",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NOERROR},{argumentType:P.B.RANGE,optionalArg:!0}]}
134,SUMIFS:{method:"sumifs",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE},{argumentType:P.B.NOERROR}],repeatLastArgs:2},COUNTIFS:{method:"countifs",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NOERROR}],repeatLastArgs:2},MINIFS:{method:"minifs",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE},{argumentType:P.B.NOERROR}],repeatLastArgs:2},MAXIFS:{method:"maxifs",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE},{argumentType:P.B.NOERROR}],repeatLastArgs:2}};class e3 extends P.w{sumproduct(e,t){return this.runFunction(e.args,t,this.metadata("SUMPRODUCT"),(...e)=>{let t=e[0].width(),r=e[0].height();for(let i of e)if(i.width()!==t||i.height()!==r)return new b.D5(b.NI.VALUE,L.B.EqualLength);let i=0,n=e.map(e=>e.iterateValuesFromTopLeftCorner());for(let e=0;e<t*r;e++){let e=1;for(let t of n){let r=t.next().value;if(r instanceof b.D5)return r;let i=this.coerceScalarToNumberOrError(r);(0,q.g_)(i)?e*=(0,q.t_)(i):e=0}i+=e}return i})}}e3.implementedFunctions={SUMPRODUCT:{method:"sumproduct",parameters:[{argumentType:P.B.RANGE}],repeatLastArgs:1}};class e9 extends P.w{concatenate(e,t){return this.runFunction(e.args,t,this.metadata("CONCATENATE"),(...e)=>"".concat(...e))}split(e,t){return this.runFunction(e.args,t,this.metadata("SPLIT"),(e,t)=>{let r=e.split(" ");return t>=r.length||t<0?new b.D5(b.NI.VALUE,L.B.IndexBounds):r[t]})}len(e,t){return this.runFunction(e.args,t,this.metadata("LEN"),e=>e.length)}lower(e,t){return this.runFunction(e.args,t,this.metadata("LOWER"),e=>e.toLowerCase())}trim(e,t){return this.runFunction(e.args,t,this.metadata("TRIM"),e=>e.replace(/^ +/g,"").replace(/ +$/g,"").replace(/ +/g," "))}proper(e,t){return this.runFunction(e.args,t,this.metadata("PROPER"),e=>e.replace(/\p{L}+/gu,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()))}clean(e,t){return this.runFunction(e.args,t,this.metadata("CLEAN"),e=>e.replace(/[\u0000-\u001F]/g,""))}exact(e,t){return this.runFunction(e.args,t,this.metadata("EXACT"),(e,t)=>e===t)}rept(e,t){return this.runFunction(e.args,t,this.metadata("REPT"),(e,t)=>t<0?new b.D5(b.NI.VALUE,L.B.NegativeCount):e.repeat(t))}right(e,t){return this.runFunction(e.args,t,this.metadata("RIGHT"),(e,t)=>t<0?new b.D5(b.NI.VALUE,L.B.NegativeLength):0===t?"":e.slice(-t))}left(e,t){return this.runFunction(e.args,t,this.metadata("LEFT"),(e,t)=>t<0?new b.D5(b.NI.VALUE,L.B.NegativeLength):e.slice(0,t))}mid(e,t){return this.runFunction(e.args,t,this.metadata("MID"),(e,t,r)=>t<1?new b.D5(b.NI.VALUE,L.B.LessThanOne):r<0?new b.D5(b.NI.VALUE,L.B.NegativeLength):e.substring(t-1,t+r-1))}replace(e,t){return this.runFunction(e.args,t,this.metadata("REPLACE"),(e,t,r,i)=>t<1?new b.D5(b.NI.VALUE,L.B.LessThanOne):r<0?new b.D5(b.NI.VALUE,L.B.NegativeLength):e.substring(0,t-1)+i+e.substring(t+r-1))}search(e,t){return this.runFunction(e.args,t,this.metadata("SEARCH"),(e,t,r)=>{if(r<1||r>t.length)return new b.D5(b.NI.VALUE,L.B.LengthBounds);let i=e.toLowerCase(),n=t.substring(r-1).toLowerCase(),o=this.arithmeticHelper.requiresRegex(i)?this.arithmeticHelper.searchString(i,n):n.indexOf(i);return o>-1?o+r:new b.D5(b.NI.VALUE,L.B.PatternNotFound)})}substitute(e,t){return this.runFunction(e.args,t,this.metadata("SUBSTITUTE"),(e,t,r,i
134)=>{let n;let o=RegExp(this.escapeRegExpSpecialCharacters(t),"g");if(void 0===i)return e.replace(o,r);if(i<1)return new b.D5(b.NI.VALUE,L.B.LessThanOne);let s=0;for(;null!==(n=o.exec(e));)if(i===++s)return e.substring(0,n.index)+r+e.substring(o.lastIndex);return e})}find(e,t){return this.runFunction(e.args,t,this.metadata("FIND"),(e,t,r)=>{if(r<1||r>t.length)return new b.D5(b.NI.VALUE,L.B.IndexBounds);let i=t.substring(r-1).indexOf(e)+r;return i>0?i:new b.D5(b.NI.VALUE,L.B.PatternNotFound)})}t(e,t){return this.runFunction(e.args,t,this.metadata("T"),e=>e instanceof b.D5?e:"string"==typeof e?e:"")}upper(e,t){return this.runFunction(e.args,t,this.metadata("UPPER"),e=>e.toUpperCase())}escapeRegExpSpecialCharacters(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}e9.implementedFunctions={CONCATENATE:{method:"concatenate",parameters:[{argumentType:P.B.STRING}],repeatLastArgs:1,expandRanges:!0},EXACT:{method:"exact",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.STRING}]},SPLIT:{method:"split",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER}]},LEN:{method:"len",parameters:[{argumentType:P.B.STRING}]},LOWER:{method:"lower",parameters:[{argumentType:P.B.STRING}]},MID:{method:"mid",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]},TRIM:{method:"trim",parameters:[{argumentType:P.B.STRING}]},T:{method:"t",parameters:[{argumentType:P.B.SCALAR}]},PROPER:{method:"proper",parameters:[{argumentType:P.B.STRING}]},CLEAN:{method:"clean",parameters:[{argumentType:P.B.STRING}]},REPT:{method:"rept",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER}]},RIGHT:{method:"right",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,defaultValue:1}]},LEFT:{method:"left",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,defaultValue:1}]},REPLACE:{method:"replace",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.STRING}]},SEARCH:{method:"search",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,defaultValue:1}]},SUBSTITUTE:{method:"substitute",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.STRING},{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,optionalArg:!0}]},FIND:{method:"find",parameters:[{argumentType:P.B.STRING},{argumentType:P.B.STRING},{argumentType:P.B.NUMBER,defaultValue:1}]},UPPER:{method:"upper",parameters:[{argumentType:P.B.STRING}]}};class e4 extends P.w{acos(e,t){return this.runFunction(e.args,t,this.metadata("ACOS"),Math.acos)}asin(e,t){return this.runFunction(e.args,t,this.metadata("ASIN"),Math.asin)}cos(e,t){return this.runFunction(e.args,t,this.metadata("COS"),Math.cos)}sin(e,t){return this.runFunction(e.args,t,this.metadata("SIN"),Math.sin)}tan(e,t){return this.runFunction(e.args,t,this.metadata("TAN"),Math.tan)}atan(e,t){return this.runFunction(e.args,t,this.metadata("ATAN"),Math.atan)}atan2(e,t){return this.runFunction(e.args,t,this.metadata("ATAN2"),(e,t)=>0===e&&0===t?new b.D5(b.NI.DIV_BY_ZERO):Math.atan2(t,e))}cot(e,t){return this.runFunction(e.args,t,this.metadata("COT"),e=>0===e?new b.D5(b.NI.DIV_BY_ZERO):1/Math.tan(e))}acot(e,t){return this.runFunction(e.args,t,this.metadata("ACOT"),e=>0===e?eC/2:Math.atan(1/e))}sec(e,t){return this.runFunction(e.args,t,this.metadata("SEC"),e=>1/Math.cos(e))}csc(e,t){return this.runFunction(e.args,t,this.metadata("CSC"),e=>0===e?new b.D5(b.NI.DIV_BY_ZERO):1/Math.sin(e))}sinh(e,t){return this.runFunction(e.args,t,this.metadata("SINH"),Math.sinh)}asinh(e,t){return this.runFunction(e.args,t,this.metadata("ASINH"),Math.asinh)}cosh(e,t){return this.runFunction(e.args,t,this.metadata("COSH"),Math.cosh)}acosh(e,t){return this.runFunction(e.args,t,this.metadata("ACOSH"),Math.acosh)}tanh(e,t){return this.runFunction(e.args,t,this.metadata("TANH"),Math.tanh)}atanh(e,t){return this.runFunction(e.args,t,this.metadata("ATANH"),Math.atanh)}coth(e,t){return this.runFunction(e.args,t,this.metadata("COTH"),e=>0===e?new b.D5(b.NI.DIV_BY_ZERO):1/Math.tanh(e))}acoth(e,t){return this.runFunction(e.args,t,this.metadata("ACOTH"),e=>0===e?new b.D5(b.NI.NUM,L.B.NonZero):Math.atanh(1/e))}sech(e,t){return this.runFunction(e.args,t,this.metadata("SECH"),e=>1/Math.cosh(e))}csch(e,t){return this.runFunction(e.args,t,this.metadata("CSCH"),e=>0===e?new b.D5(b.NI.DIV_BY_ZERO):1/Math.sinh(e))}}e4.implementedFunctions={ACOS:{method:"acos",parameters:[{argumentType:P.B.NUMBER}]},ASIN:{method:"asin",parameters:[{argumentType:P.B.NUMBER}]},COS:{method:"cos",parameters:[{argumentType:P.B.NUMBER}]},SIN:{method:"sin",parameters:[{argumentType:P.B.NUMBER}]},TAN:{method:"tan",parameters:[{argumentType:P.B.NUMBER}]},ATAN:{method:"atan",parameters:[{argumentType:P.B.NUMBER}]},ATAN2:{method:"atan2",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]},COT:{method:"cot",parameters:[{argumentType:P.B.NUMBER}]},SEC:{method:"sec",parameters:[{argumentType:P.B.NUMBER}]},CSC:{method:"csc",parameters:[{argumentType:P.B.NUMBER}]},SINH:{method:"sinh",parameters:[{argumentType:P.B.NUMBER}]},COSH:{method:"cosh",parameters:[{argumentType:P.B.NUMBER}]},TANH:{method:"tanh",parameters:[{argumentType:P.B.NUMBER}]},COTH:{method:"coth",parameters:[{argumentType:P.B.NUMBER}]},SECH:{method:"sech",parameters:[{argumentType:P.B.NUMBER}]},CSCH:{method:"csch",parameters:[{argumentType:P.B.NUMBER}]},ACOT:{method:"acot",parameters:[{argumentType:P.B.NUMBER}]},ASINH:{method:"asinh",parameters:[{argumentType:P.B.NUMBER}]},ACOSH:{method:"acosh",parameters:[{argumentType:P.B.NUMBER}]},ATANH:{method:"atanh",parameters:[{argumentType:P.B.NUMBER}]},ACOTH:{method:"acoth",parameters:[{argumentType:P.B.NUMBER}]}};var e7=r(64742);class e8 extends e7.z{constructor(e){super(e),this.dependencyGraph=e}find(e,t,r){return this.basicFind(e,t,"col",r)}}var e6=r(68724);class te extends P.w{constructor(){super(...arguments),this.rowSearch=new e8(this.dependencyGraph)}vlookup(e,t){return this.runFunction(e.args,t,this.metadata("VLOOKUP"),
134(e,t,r,i)=>{let n=t.range;return void 0===n?new b.D5(b.NI.VALUE,L.B.WrongType):r<1?new b.D5(b.NI.VALUE,L.B.LessThanOne):r>n.width()?new b.D5(b.NI.REF,L.B.IndexLarge):this.doVlookup((0,H.oW)(e),t,r-1,{ordering:i?"asc":"none",ifNoMatch:i?"returnLowerBound":"returnNotFound"})})}hlookup(e,t){return this.runFunction(e.args,t,this.metadata("HLOOKUP"),(e,t,r,i)=>{let n=t.range;return void 0===n?new b.D5(b.NI.VALUE,L.B.WrongType):r<1?new b.D5(b.NI.VALUE,L.B.LessThanOne):r>n.height()?new b.D5(b.NI.REF,L.B.IndexLarge):this.doHlookup((0,H.oW)(e),t,r-1,{ordering:i?"asc":"none",ifNoMatch:i?"returnLowerBound":"returnNotFound"})})}xlookup(e,t){return this.runFunction(e.args,t,this.metadata("XLOOKUP"),(e,t,r,i,n,o)=>{if(![0,-1,1,2].includes(n)||![1,-1,2,-2].includes(o))return new b.D5(b.NI.VALUE,L.B.BadMode);let s=t instanceof F.r?t:F.r.fromScalar(t),a=r instanceof F.r?r:F.r.fromScalar(r);return this.doXlookup((0,H.oW)(e),s,a,i,2===n,{ordering:2===o?"asc":-2===o?"desc":"none",returnOccurrence:-1===o?"last":"first",ifNoMatch:-1===n?"returnLowerBound":1===n?"returnUpperBound":"returnNotFound"})})}xlookupArraySize(e){var t,r;let i=null===(t=null==e?void 0:e.args)||void 0===t?void 0:t[1],n=null===(r=null==e?void 0:e.args)||void 0===r?void 0:r[2];if((null==i?void 0:i.start)==null||(null==i?void 0:i.end)==null||(null==n?void 0:n.start)==null||(null==n?void 0:n.end)==null)return R.J.error();let o=i.end.row-i.start.row+1,s=i.end.col-i.start.col+1,a=n.end.row-n.start.row+1,l=n.end.col-n.start.col+1,h=1===s&&a===o,u=1===o&&l===s;return h||u?h?new R.J(l,1):new R.J(1,a):R.J.error()}match(e,t){return this.runFunction(e.args,t,this.metadata("MATCH"),(e,t,r)=>this.doMatch((0,H.oW)(e),t,r))}searchInRange(e,t,r,i,n){return r&&"string"==typeof e&&this.arithmeticHelper.requiresRegex(e)?n.advancedFind(this.arithmeticHelper.eqMatcherFunction(e),t,{returnOccurrence:i.returnOccurrence}):n.find(e,t,i)}doVlookup(e,t,r,i){let n,o;this.dependencyGraph.stats.start(e6.wK.VLOOKUP);let s=t.range;n=void 0===s?F.r.onlyValues(t.data.map(e=>[e[0]])):F.r.onlyRange(eM.gG.spanFrom(s.start,1,s.height()),this.dependencyGraph);let a=this.searchInRange(e,n,"none"===i.ordering,i,this.columnSearch);if(this.dependencyGraph.stats.end(e6.wK.VLOOKUP),-1===a)return new b.D5(b.NI.NA,L.B.ValueNotFound);if(void 0===s)o=t.data[a][r];else{let e=(0,b.mT)(s.sheet,s.start.col+r,s.start.row+a);o=this.dependencyGraph.getCellValue(e)}return o instanceof F.r?new b.D5(b.NI.VALUE,L.B.WrongType):o}doHlookup(e,t,r,i){let n,o;let s=t.range;n=void 0===s?F.r.onlyValues([t.data[0]]):F.r.onlyRange(eM.gG.spanFrom(s.start,s.width(),1),this.dependencyGraph);let a=this.searchInRange(e,n,"none"===i.ordering,i,this.rowSearch);if(-1===a)return new b.D5(b.NI.NA,L.B.ValueNotFound);if(void 0===s)o=t.data[r][a];else{let e=(0,b.mT)(s.sheet,s.start.col+a,s.start.row+r);o=this.dependencyGraph.getCellValue(e)}return o instanceof F.r?new b.D5(b.NI.VALUE,L.B.WrongType):o}doXlookup(e,t,r,i,n,o){let s=1===t.width()&&r.height()===t.height(),a=1===t.height()&&r.width()===t.width();if(!s&&!a)return new b.D5(b.NI.VALUE,L.B.WrongDimension);let l=s?this.columnSearch:this.rowSearch,h=this.searchInRange(e,t,n,o,l);if(-1===h)return i==b.NI.NA?new b.D5(b.NI.NA,L.B.ValueNotFound):i;let u=s?[r.data[h]]:r.data.map(e=>[e[h]]);return F.r.onlyValues(u)}doMatch(e,t,r){if(![-1,0,1].includes(r))return new b.D5(b.NI.VALUE,L.B.BadMode);if(t.width()>1&&t.height()>1)return new b.D5(b.NI.NA);let i=(1===t.width()?this.columnSearch:this.rowSearch).find(e,t,0===r?{ordering:"none",ifNoMatch:"returnNotFound"}:{ordering:-1===r?"desc":"asc",ifNoMatch:-1===r?"returnUpperBound":"returnLowerBound"});return -1===i?new b.D5(b.NI.NA,L.B.ValueNotFound):i+1}}te.implementedFunctions={VLOOKUP:{method:"vlookup",parameters:[{argumentType:P.B.NOERROR},{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER},{argumentType:P.B.BOOLEAN,defaultValue:!0}]},HLOOKUP:{method:"hlookup",parameters:[{argumentType:P.B.NOERROR},{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER},{argumentType:P.B.BOOLEAN,defaultValue:!0}]},XLOOKUP:{method:"xlookup",sizeOfResultArrayMethod:"xlookupArraySize",parameters:[{argumentType:P.B.NOERROR},{argumentType:P.B.RANGE},{argumentType:P.B.RANGE},{argumentType:P.B.SCALAR,optionalArg:!0,defaultValue:b.NI.NA},{argumentType:P.B.NUMBER,optionalArg:!0,defaultValue:0},{argumentType:P.B.NUMBER,optionalArg:!0,defaultValue:1}]},MATCH:{method:"match",parameters:[{argumentType:P.B.NOERROR},{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER,defaultValue:1}]}};class tt extends P.w{roman(e,t){return this.runFunction(e.args,t,this.metadata("ROMAN"),(e,t)=>
134(e=Math.trunc(e),!1===t?t=4:!0===t&&(t=0),(t=(0,q.t_)(this.coerceScalarToNumberOrError(t)))instanceof b.D5)?t:(t=Math.trunc(t))<0?new b.D5(b.NI.VALUE,L.B.ValueSmall):t>4?new b.D5(b.NI.VALUE,L.B.ValueLarge):function(e,t){let r={val:e%1e3,acc:"M".repeat(Math.floor(e/1e3))};return 4===t&&(ti(r,"IM",999,1e3),ti(r,"ID",499,500)),t>=3&&(ti(r,"VM",995,1e3),ti(r,"VD",495,500)),t>=2&&(ti(r,"XM",990,1e3),ti(r,"XD",490,500)),t>=1&&(ti(r,"LM",950,1e3),ti(r,"LD",450,500)),ti(r,"CM",900,1e3),ti(r,"CD",400,500),ti(r,"D",500,900),r.acc+="C".repeat(Math.floor(r.val/100)),r.val%=100,t>=2&&(ti(r,"IC",99,100),ti(r,"IL",49,50)),t>=1&&(ti(r,"VC",95,100),ti(r,"VL",45,50)),ti(r,"XC",90,100),ti(r,"XL",40,50),ti(r,"L",50,90),r.acc+="X".repeat(Math.floor(r.val/10)),r.val%=10,ti(r,"IX",9,10),ti(r,"IV",4,5),ti(r,"V",5,9),r.acc+="I".repeat(r.val),r.acc}(e,t))}arabic(e,t){return this.runFunction(e.args,t,this.metadata("ARABIC"),e=>{e=e.trim().toUpperCase();let t=!1;if(e.startsWith("-")&&(e=e.slice(1),t=!0,""===e))return new b.D5(b.NI.VALUE,L.B.InvalidRoman);let r={input:e,acc:0};return(tr(r,{token:"MMM",val:3e3},{token:"MM",val:2e3},{token:"M",val:1e3}),tr(r,{token:"IM",val:999},{token:"VM",val:995},{token:"XM",val:990},{token:"LM",val:950},{token:"CM",val:900}),tr(r,{token:"D",val:500},{token:"ID",val:499},{token:"VD",val:495},{token:"XD",val:490},{token:"LD",val:450},{token:"CD",val:400}),tr(r,{token:"CCC",val:300},{token:"CC",val:200},{token:"C",val:100}),tr(r,{token:"IC",val:99},{token:"VC",val:95},{token:"XC",val:90}),tr(r,{token:"L",val:50},{token:"IL",val:49},{token:"VL",val:45},{token:"XL",val:40}),tr(r,{token:"XXX",val:30},{token:"XX",val:20},{token:"X",val:10}),tr(r,{token:"IX",val:9}),tr(r,{token:"V",val:5},{token:"IV",val:4}),tr(r,{token:"III",val:3},{token:"II",val:2},{token:"I",val:1}),""!==r.input)?new b.D5(b.NI.VALUE,L.B.InvalidRoman):t?-r.acc:r.acc})}}function tr(e,...t){for(let r of t)if(e.input.startsWith(r.token)){e.input=e.input.slice(r.token.length),e.acc+=r.val;break}}function ti(e,t,r,i){e.val>=r&&e.val<i&&(e.val-=r,e.acc+=t)}tt.implementedFunctions={ROMAN:{method:"roman",parameters:[{argumentType:P.B.NUMBER,minValue:1,lessThan:4e3},{argumentType:P.B.NOERROR,optionalArg:!0,defaultValue:0}]},ARABIC:{method:"arabic",parameters:[{argumentType:P.B.STRING}]}};class tn extends P.w{add(e,t){return this.runFunction(e.args,t,this.metadata("HF.ADD"),this.arithmeticHelper.addWithEpsilon)}concat(e,t){return this.runFunction(e.args,t,this.metadata("HF.CONCAT"),this.arithmeticHelper.concat)}divide(e,t){return this.runFunction(e.args,t,this.metadata("HF.DIVIDE"),this.arithmeticHelper.divide)}eq(e,t){return this.runFunction(e.args,t,this.metadata("HF.EQ"),this.arithmeticHelper.eq)}gt(e,t){return this.runFunction(e.args,t,this.metadata("HF.GT"),this.arithmeticHelper.gt)}gte(e,t){return this.runFunction(e.args,t,this.metadata("HF.GTE"),this.arithmeticHelper.geq)}lt(e,t){return this.runFunction(e.args,t,this.metadata("HF.LT"),this.arithmeticHelper.lt)}lte(e,t){return this.runFunction(e.args,t,this.metadata("HF.LTE"),this.arithmeticHelper.leq)}minus(e,t){return this.runFunction(e.args,t,this.metadata("HF.MINUS"),this.arithmeticHelper.subtract)}multiply(e,t){return this.runFunction(e.args,t,this.metadata("HF.MULTIPLY"),this.arithmeticHelper.multiply)}ne(e,t){return this.runFunction(e.args,t,this.metadata("HF.NE"),this.arithmeticHelper.neq)}pow(e,t){return this.runFunction(e.args,t,this.metadata("HF.POW"),this.arithmeticHelper.pow)}uminus(e,t){return this.runFunction(e.args,t,this.metadata("HF.UMINUS"),this.arithmeticHelper.unaryMinus)}upercent(e,t){return this.runFunction(e.args,t,this.metadata("HF.UNARY_PERCENT"),this.arithmeticHelper.unaryPercent)}uplus(e,t){return this.runFunction(e.args,t,this.metadata("HF.UPLUS"),this.arithmeticHelper.unaryPlus)}}tn.implementedFunctions={"HF.ADD":{method:"add",parameters:[{argumentType:P.B.NUMBER,passSubtype:!0},{argumentType:P.B.NUMBER,passSubtype:!0}]},"HF.CONCAT":{method:"concat",parameters:[{argumentType:P.B.STRING,passSubtype:!0},{argumentType:P.B.STRING,passSubtype:!0}]},"HF.DIVIDE":{method:"divide",parameters:[{argumentType:P.B.NUMBER,passSubtype:!0},{argumentType:P.B.NUMBER,passSubtype:!0}]},"HF.EQ":{method:"eq",parameters:[{argumentType:P.B.NOERROR,passSubtype:!0},{argumentType:P.B.NOERROR,passSubtype:!0}]},"HF.GT":{method:"gt",parameters:[{argumentType:P.B.NOERROR,passSubtype:!0},{argumentType:P.B.NOERROR,passSubtype:!0}]},"HF.GTE":{method:"gte",parameters:[{argumentType:P.B.NOERROR,passSubtype:!0},{argumentType:P.B.NOERROR,passSubtype:!0}]},"HF.LT":{method:"lt",parameters:[{argumentType:P.B.NOERROR,passSubtype:!0},{argumentType:P.B.NOERROR,passSubtype:!0}]},"HF.LTE":{method:"lte",parameters:[{argumentType:P.B.NOERROR,passSubtype:!0},{argumentType:P.B.NOERROR,passSubtype:!0}]},"HF.MINUS":{method:"minus",parameters:[{argumentType:P.B.NUMBER,passSubtype:!0},{argumentType:P.B.NUMBER,passSubtype:!0}]},"HF.MULTIPLY":{method:"multiply",parameters:[{argumentType:P.B.NUMBER,passSubtype:!0},{argumentType:P.B.NUMBER,passSubtype:!0}]},"HF.NE":{method:"ne",parameters:[{argumentType:P.B.NOERROR,passSubtype:!0},{argumentType:P.B.NOERROR,passSubtype:!0}]},"HF.POW":{method:"pow",parameters:[{argumentType:P.B.NUMBER,passSubtype:!0},{argumentType:P.B.NUMBER,passSubtype:!0}]},"HF.UMINUS":{method:"uminus",parameters:[{argumentType:P.B.NUMBER,passSubtype:!0}]},"HF.UNARY_PERCENT":{method:"upercent",parameters:[{argumentType:P.B.NUMBER,passSubtype:!0}]},"HF.UPLUS":{method:"uplus",parameters:[{argumentType:P.B.NUMBER,passSubtype:!0}]}};var to=Math;function ts(e,t){for(var r=0,i=0;r<e.length;++r)i=t*i+e[r];return i}function ta(e,t,r,i,n){if(0===t)return r;if(1===t)return i;for(var o=2/e,s=i,a=1;a<t;
vendor: 9,597 bytes, line 134
134++a)s=i*a*o+n*r,r=i,i=s;return s}function tl(e,t,r,i,n){return function(r,o){if(i){if(0===r)return 1==i?-1/0:1/0;if(r<0)return NaN}if(0===o)return e(r);if(1===o)return t(r);if(o<0)return NaN;o|=0;var s=e(r),a=t(r);return ta(r,o,s,a,n)}}var th=function(){var e=[57568490574,-13362590354,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),t=[57568490411,1029532985,9494680.718,59272.64853,267.8532712,1].reverse(),r=[1,-.001098628627,2734510407e-14,-.000002073370639,2093887211e-16].reverse(),i=[-.01562499995,1430488765e-13,-.000006911147651,7621095161e-16,-.0000000934935152].reverse();function n(n){var o=0,s=0,a=0,l=n*n;if(n<8)o=(s=ts(e,l))/(a=ts(t,l));else{var h=n-.785398164;s=ts(r,l=64/l),a=ts(i,l),o=to.sqrt(.636619772/n)*(to.cos(h)*s-to.sin(h)*a*8/n)}return o}var o=[72362614232,-7895059235,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),s=[144725228442,2300535178,18583304.74,99447.43394,376.9991397,1].reverse(),a=[1,.00183105,-.00003516396496,2457520174e-15,-.000000240337019].reverse(),l=[.04687499995,-.0002002690873,8449199096e-15,-.00000088228987,105787412e-15].reverse();function h(e){var t=0,r=0,i=0,n=e*e,h=to.abs(e)-2.356194491;return 8>Math.abs(e)?t=(r=e*ts(o,n))/(i=ts(s,n)):(r=ts(a,n=64/n),i=ts(l,n),t=to.sqrt(.636619772/to.abs(e))*(to.cos(h)*r-to.sin(h)*i*8/to.abs(e)),e<0&&(t=-t)),t}return function e(t,r){if(r=Math.round(r),!isFinite(t))return isNaN(t)?t:0;if(r<0)return(r%2?-1:1)*e(t,-r);if(t<0)return(r%2?-1:1)*e(-t,r);if(0===r)return n(t);if(1===r)return h(t);if(0===t)return 0;var i=0;if(t>r)i=ta(t,r,n(t),h(t),-1);else{for(var o=2*to.floor((r+to.floor(to.sqrt(40*r)))/2),s=!1,a=0,l=0,u=1,c=0,d=2/t,g=o;g>0;g--)c=g*d*u-a,a=u,u=c,to.abs(u)>1e10&&(u*=1e-10,a*=1e-10,i*=1e-10,l*=1e-10),s&&(l+=u),s=!s,g==r&&(i=a);i/=l=2*l-u}return i}}(),tu=(n=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),o=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),s=[1,-.001098628627,2734510407e-14,-.000002073370639,2093887211e-16].reverse(),a=[-.01562499995,1430488765e-13,-.000006911147651,7621095161e-16,-.0000000934945152].reverse(),l=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),h=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),u=[1,.00183105,-.00003516396496,2457520174e-15,-.000000240337019].reverse(),c=[.04687499995,-.0002002690873,8449199096e-15,-.00000088228987,105787412e-15].reverse(),tl(function(e){var t=0,r=0,i=0,l=e*e,h=e-.785398164;return e<8?t=(r=ts(n,l))/(i=ts(o,l))+.636619772*th(e,0)*to.log(e):(r=ts(s,l=64/l),i=ts(a,l),t=to.sqrt(.636619772/e)*(to.sin(h)*r+to.cos(h)*i*8/e)),t},function(e){var t=0,r=0,i=0,n=e*e,o=e-2.356194491;return e<8?t=(r=e*ts(l,n))/(i=ts(h,n))+.636619772*(th(e,1)*to.log(e)-1/e):(r=ts(u,n=64/n),i=ts(c,n),t=to.sqrt(.636619772/e)*(to.sin(o)*r+to.cos(o)*i*8/e)),t},"BESSELY",1,-1)),tc=(d=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),g=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),p=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),f=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse(),function e(t,r){if(0===(r=Math.round(r)))return t<=3.75?ts(d,t*t/14.0625):to.exp(to.abs(t))/to.sqrt(to.abs(t))*ts(g,3.75/to.abs(t));if(1===r)return t<3.75?t*ts(p,t*t/14.0625):(t<0?-1:1)*to.exp(to.abs(t))/to.sqrt(to.abs(t))*ts(f,3.75/to.abs(t));if(r<0)return NaN;if(0===to.abs(t))return 0;if(t==1/0)return 1/0;var i,n=0,o=2/to.abs(t),s=0,a=1,l=0;for(i=2*to.round((r+to.round(to.sqrt(40*r)))/2);i>0;i--)l=i*o*a+s,s=a,a=l,to.abs(a)>1e10&&(a*=1e-10,s*=1e-10,n*=1e-10),i==r&&(n=s);return n*=e(t,0)/a,t<0&&r%2?-n:n}),td=(m=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),y=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse(),w=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-.00004686].reverse(),E=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-.00068245].reverse(),tl(function(e){return e<=2?-to.log(e/2)*tc(e,0)+ts(m,e*e/4):to.exp(-e)/to.sqrt(e)*ts(y,2/e)},function(e){return e<=2?to.log(e/2)*tc(e,1)+1/e*ts(w,e*e/4):to.exp(-e)/to.sqrt(e)*ts(E,2/e)},"BESSELK",2,1));function tg(e){let t,r,i,n;let o=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,366839497852761e-18,42523324806907e-18,-.000020278578112534,-.000001624290004647,130365583558e-17,15626441722e-18,-.000000085238095915,6529054439e-18,5059343495e-18,-.000000000991364156,-.000000000227365122,96467911e-18,2394038e-18,-.000000000006886027,894487e-18,313092e-18,-.000000000000112708,381e-18,7106e-18,-.000000000000001523,-.000000000000000094,121e-18,-.000000000000000028],s=o.length-1,a=!1,l=0,h=0;if(0===e)return 0;for(e<0&&(e=-e,a=!0),r=4*(t=2/(2+e))-2;s>0;s--)i=l,l=r*l-h+o[s],h=i;return n=t*Math.exp(-e*e+.5*(o[0]+r*l)-h),a?n-1:1-n}function tp(e){return 1-tg(e)}function tf(e){let t,r,i,n,o=0;if(e>=2)return -100;if(e<=0)return 100;for(t=-.70711*((2.30753+.27061*(i=Math.sqrt(-2*Math.log((n=e<1?e:2-e)/2))))/(1+i*(.99229+.04481*i))-i);o<2;o++)r=tp(t)-n,t+=r/(1.1283791670955126*Math.exp(-t*t)-t*r);return e<1?t:-t}let tm={pdf:(e,t)=>e<0?0:t*Math.exp(-t*e),cdf:(e,t)=>e<0?0:1-Math.exp(-t*e)};function ty(e){let t,r,i,n;let o=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],s=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],a=!1,l=0,h=0,u=0,c=e;if(e>171.6243769536076)return 1/0;if(c<=0){if(!(n=c%1))return 1/0;a=(1&c?-1:1)*Math.PI/Math.sin(Math.PI*n),c=1-c}for(t=0,i=c,r=c<1?c++:(c-=l=(0|c)-1)-1;t<8;++t)u=(u+o[t])*r,h=h*r+s[t];if(n=u/h+1,i<c)n/=i;else if(i>c)for(t=0;t<l;++t)n*=c,c++;return a&&(n=a/n),n}let tv={pdf:function(e,t,r){return e<0?0:0===e&&1===t?1/r:Math.exp((t-1)*Math.log(e)-e/r-tw(t)-t*Math.log(r))},cdf:function(e,t,r){return e<0?0:tE(t,e/r)},inv:function(e,t,r){return tS(e,t)*r}};function tw(e){let t,r,i=0,n=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-.000005395239384953],o=1.000000000190015;for(r=(t=e)+5.5,r-=(e+.5)*Math.log(r);i<6;i++)o+=n[i]/++t;return Math.log(2.5066282746310007*o/e)-r}function tE(e,t){let r;let i=tw(e),n=e,o=1/e,s=o,a=t+1-e,l=1/1e-30,h=1/a,u=h,c=1,d=-~(8.5*Math.log(e>=1?e:1/e)+.4*e+17);if(t<0||e<=0)return NaN;if(t<e+1){for(;c<=d;c++)o+=s*=t/++n;return o*Math.exp(-t+e*Math.log(t)-i)}for(;c<=d;c++)a+=2,u*=(h=1/(h=(r=-c*(c-e))*h+a))*(l=a+r/l);return 1-u*Math.exp(-t+e*Math.log(t)-i)}function tS(e,t){let r,i,n,o,s,a=0,l=t-1,h=tw(t);if(e>=1)return Math.max(100,t+100*Math.sqrt(t));if(e<=0)return 0;for(t>1?(o=Math.log(l),s=Math.exp(l*(o-1)-h),r=(2.30753+.27061*(i=Math.sqrt(-2*Math.log(e<.5?e:1-e))))/(1+i*(.99229+.04481*i))-i,e<.5&&(r=-r),r=Math.max(.001,t*Math.pow(1-1/(9*t)-r/(3*Math.sqrt(t)),3))):r=e<(i=1-t*(.253+.12*t))?Math.pow(e/i,1/t):1-Math.log(1-(e-i)/(1-i));a<12;a++){if(r<=0)return 0;if(n=(tE(t,r)-e)/(i=t>1?s*Math.exp(-(r-l)+l*(Math.log(r)-o)):Math.exp(-r+l*Math.log(r)-h)),(r-=i=n/(1-.5*Math.min(1,n*((t-1)/r-1))))<=0&&(r=.5*(r+i)),Math.abs(i)<1e-8*r)break}return r}let tC={pdf:function(e,t,r){return Math.exp(-.5*Math.log(2*Math.PI)-Math.log(r)-Math.pow(e-t,2)/(2*r*r))},cdf:function(e,t,r){return .5*(1+tg((e-t)/Math.sqrt(2*r*r)))},inv:function(e,t,r){return -1.4142135623730951*r*tf(2*e)+t}},tR={pdf:function(e,t,r){return e>1||e<0?0:1==t&&1==r?1:t<512&&r<512?Math.pow(e,t-1)*Math.pow(1-e,r-1)/tb(t,r):Math.exp((t-1)*Math.log(e)+(r-1)*Math.log(1-e)-tT(t,r))},cdf:function(e,t,r){return e>1||e<0?+(e>1):tA(e,t,r)},inv:function(e,t,r){return tN(e,t,r)}};function tb(e,t){if(!(e<=0)&&!(t<=0))return e+t>170?Math.exp(tT(e,t)):ty(e)*ty(t)/ty(e+t)}function tT(e,t){return tw(e)+tw(t)-tw(e+t)}function tN(e,t,r){var i,n,o,s,a,l,h,u,c,d=t-1,g=r-1,p=0;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&r>=1?(a=(2.30753+.27061*(o=Math.sqrt(-2*Math.log(e<.5?e:1-e))))/(1+o*(.99229+.04481*o))-o,e<.5&&(a=-a),l=(a*a-3)/6,u=a*Math.sqrt(l+(h=2/(1/(2*t-1)+1/(2*r-1))))/h-(1/(2*r-1)-1/(2*t-1))*(l+5/6-2/(3*h)),a=t/(t+r*Math.exp(2*u))):(i=Math.log(t/(t+r)),n=Math.log(r/(t+r)),u=(o=Math.exp(t*i)/t)+(s=Math.exp(r*n)/r),a=e<o/u?Math.pow(t*u*e,1/t):1-Math.pow(r*u*(1-e),1/r)),c=-tw(t)-tw(r)+tw(t+r);p<10&&0!==a&&1!==a&&(s=(tA(a,t,r)-e)/(o=Math.exp(d*Math.log(a)+g*Math.log(1-a)+c)),(a-=o=s/(1-.5*Math.min(1,s*(d/a-g/(1-a)))))<=0&&(a=.5*(a+o)),a>=1&&(a=.5*(a+o+1)),!(Math.abs(o)<1e-8*a)||!(p>0));p++);return a}function tA(e,t,r){var i=0===e||1===e?0:Math.exp(tw(t+r)-tw(t)-tw(r)+t*Math.log(e)+r*Math.log(1-e));return!(e<0)&&!(e>1)&&(e<(t+1)/(t+r+2)?i*tI(e,t,r)/t:1-i*tI(1-e,r,t)/r)}function tI(e,t,r){var i,n,o,s,a=1,l=t+r,h=t+1,u=t-1,c=1,d=1-l*e/h;for(1e-30>Math.abs(d)&&(d=1e-30),s=d=1/d;a<=100&&(i=2*a,1e-30>Math.abs(d=1+(n=a*(r-a)*e/((u+i)*(t+i)))*d)&&(d=1e-30),1e-30>Math.abs(c=1+n/c)&&(c=1e-30),s*=(d=1/d)*c,1e-30>Math.abs(d=1+(n=-(t+a)*(l+a)*e/((t+i)*(h+i)))*d)&&(d=1e-30),1e-30>Math.abs(c=1+n/c)&&(c=1e-30),s*=o=(d=1/d)*c,!(3e-7>Math.abs(o-1)));a++);return s}let tM={pdf:function(e,t,r){return 0===r||1===r?t*r===e?1:0:tx(t,e)*Math.pow(r,e)*Math.pow(1-r,t-e)},cdf:function(e,t,r){if(e<0)return 0;if(e>=t)return 1;if(r<0||r>1||t<=0)return NaN;var i=(e=Math.floor(e))+1,n=t-e,o=i+n,s=Math.exp(tw(o)-tw(n)-tw(i)+i*Math.log(r)+n*Math.log(1-r));return Math.round(1e10*(1-(r<(i+1)/(o+2)?s*tO(r,i,n,1e-10):1-s*tO(1-r,n,i,1e-10))))/1e10}};
134function tO(e,t,r,i){for(var n,o=0,s=1,a=1,l=1,h=0,u=0;Math.abs((a-u)/a)>i;)u=a,o=a+(n=-(t+h)*(t+r+h)*e/(t+2*h)/(t+2*h+1))*o,s=l+n*s,h+=1,a=o+(n=h*(r-h)*e/(t+2*h-1)/(t+2*h))*a,o/=l=s+n*l,s/=l,a/=l,l=1;return a/t}function tx(e,t){return e>170||t>170?Math.exp(t_(e)-t_(t)-t_(e-t)):tP(e)/tP(t)/tP(e-t)}function t_(e){return e<0?NaN:tw(e+1)}function tP(e){return e<0?NaN:ty(e+1)}let tL={pdf:function(e,t){return e<0?0:0===e&&2===t?.5:Math.exp((t/2-1)*Math.log(e)-e/2-t/2*Math.log(2)-tw(t/2))},cdf:function(e,t){return e<0?0:tE(t/2,e/2)},inv:function(e,t){return 2*tS(e,.5*t)}},tk={pdf:function(e,t,r){var i,n;return e<0?0:t<=2?0===e&&t<2?1/0:0===e&&2===t?1:1/tb(t/2,r/2)*Math.pow(t/r,t/2)*Math.pow(e,t/2-1)*Math.pow(1+t/r*e,-(t+r)/2):(i=t*e/(r+e*t),n=r/(r+e*t),t*n/2*tM.pdf((t-2)/2,(t+r-2)/2,i))},cdf:function(e,t,r){return e<0?0:tA(t*e/(t*e+r),t/2,r/2)},inv:function(e,t,r){return r/(t*(1/tN(e,t/2,r/2)-1))}},tD={pdf:function(e,t,r){return e<0||t<0||r<0?0:r/t*Math.pow(e/t,r-1)*Math.exp(-Math.pow(e/t,r))},cdf:function(e,t,r){return e<0?0:1-Math.exp(-Math.pow(e/t,r))}},tH={pdf:function(e,t){return t<0||e%1!=0||e<0?0:Math.pow(t,e)*Math.exp(-t)/tP(e)},cdf:function(e,t){var r=0;if(e<0)return 0;for(var i=0;r<=e;r++)i+=tH.pdf(r,t);return i}},tB={pdf:function(e,t,r,i){if(e<0||e<r-(t-i)||e>i||e>r)return 0;if(2*r>t)return 2*i>t?tB.pdf(t-r-i+e,t,t-r,t-i):tB.pdf(i-e,t,t-r,i);if(2*i>t)return tB.pdf(r-e,t,r,t-i);if(r<i)return tB.pdf(e,t,i,r);for(var n=1,o=0,s=0;s<e;s++){for(;n>1&&o<i;)n*=1-r/(t-o),o++;n*=(i-s)*(r-s)/((s+1)*(t-r-i+s+1))}for(;o<i;o++)n*=1-r/(t-o);return Math.min(1,Math.max(0,n))},cdf:function e(t,r,i,n){if(t<0||t<i-(r-n))return 0;if(t>=n||t>=i)return 1;if(2*i>r)return 2*n>r?e(r-i-n+t,r,r-i,r-n):1-tB.cdf(n-t-1,r,r-i,n);if(2*n>r)return 1-tB.cdf(i-t-1,r,i,r-n);if(i<n)return tB.cdf(t,r,n,i);for(var o=1,s=1,a=0,l=0;l<t;l++){for(;o>1&&a<n;){var h=1-i/(r-a);s*=h,o*=h,a++}s*=(n-l)*(i-l)/((l+1)*(r-i-n+l+1)),o+=s}for(;a<n;a++)o*=1-i/(r-a);return Math.min(1,Math.max(0,o))}},tF={pdf:function(e,t){return 1/(Math.sqrt(t=t>1e100?1e100:t)*tb(.5,t/2))*Math.pow(1+e*e/t,-((t+1)/2))},cdf:function(e,t){var r=t/2;return tA((e+Math.sqrt(e*e+t))/(2*Math.sqrt(e*e+t)),r,r)},inv:function(e,t){var r=tN(2*Math.min(e,1-e),.5*t,.5);return r=Math.sqrt(t*(1-r)/r),e>.5?r:-r}},tV={pdf:function(e,t,r){return e<=0?0:Math.exp(-Math.log(e)-.5*Math.log(2*Math.PI)-Math.log(r)-Math.pow(Math.log(e)-t,2)/(2*r*r))},cdf:function(e,t,r){return e<0?0:.5+.5*tg((Math.log(e)-t)/Math.sqrt(2*r*r))},inv:function(e,t,r){return Math.exp(-1.4142135623730951*r*tf(2*e)+t)}},tU={pdf:function(e,t,r){return e===e>>>0&&(e<0?0:tx(e+t-1,t-1)*Math.pow(1-r,e)*Math.pow(r,t))},cdf:function(e,t,r){var i=0,n=0;if(e<0)return 0;for(;n<=e;n++)i+=tU.pdf(n,t,r);return i}};function tW(e){for(var t=0,r=e.length;--r>=0;)t+=e[r];return t}function tj(e){return tW(e)/e.length}function tG(e){for(var t,r=tj(e),i=0,n=e.length;--n>=0;)i+=(t=e[n]-r)*t;return i}function t$(e,t){return tG(e)/(e.length-(t?1:0))}function tz(e,t){return Math.sqrt(t$(e,t))}function tY(e,t){var r,i=tj(e),n=tj(t),o=e.length,s=Array(o);for(r=0;r<o;r++)s[r]=(e[r]-i)*(t[r]-n);return tW(s)/(o-1)}function tK(e,t){return tY(e,t)/tz(e,1)/tz(t,1)}class tX extends P.w{erf(e,t){return this.runFunction(e.args,t,this.metadata("ERF"),(e,t)=>void 0===t?tg(e):tg(t)-tg(e))}erfc(e,t){return this.runFunction(e.args,t,this.metadata("ERFC"),tp)}expondist(e,t){return this.runFunction(e.args,t,this.metadata("EXPON.DIST"),(e,t,r)=>r?tm.cdf(e,t):tm.pdf(e,t))}fisher(e,t){return this.runFunction(e.args,t,this.metadata("FISHER"),e=>Math.log((1+e)/(1-e))/2)}fisherinv(e,t){return this.runFunction(e.args,t,this.metadata("FISHERINV"),e=>1-2/(Math.exp(2*e)+1))}gamma(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA"),ty)}gammadist(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.DIST"),(e,t,r,i)=>i?tv.cdf(e,t,r):tv.pdf(e,t,r))}gammaln(e,t){return this.runFunction(e.args,t,this.metadata("GAMMALN"),tw)}gammainv(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.INV"),tv.inv)}gauss(e,t){return this.runFunction(e.args,t,this.metadata("GAUSS"),e=>tC.cdf(e,0,1)-.5)}betadist(e,t){return this.runFunction(e.args,t,this.metadata("BETA.DIST"),(e,t,r,i,n,o)=>e<=n?new b.D5(b.NI.NUM,L.B.ValueSmall):e>=o?new b.D5(b.NI.NUM,L.B.ValueLarge):(e=(e-n)/(o-n),i)?tR.cdf(e,t,r):tR.pdf(e,t,r))}betainv(e,t){return this.runFunction(e.args,t,this.metadata("BETA.INV"),(e,t,r,i,n)=>i>=n?new b.D5(b.NI.NUM,L.B.WrongOrder):tR.inv(e,t,r)*(n-i)+i)}binomialdist(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.DIST"),(e,t,r,i
134)=>e>t?new b.D5(b.NI.NUM,L.B.WrongOrder):(e=Math.trunc(e),t=Math.trunc(t),i)?tM.cdf(e,t,r):tM.pdf(e,t,r))}binomialinv(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.INV"),(e,t,r)=>{let i=-1,n=e=Math.trunc(e);for(;n>i+1;){let o=Math.trunc((i+n)/2);tM.cdf(o,e,t)>=r?n=o:i=o}return n})}besselifn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELI"),(e,t)=>tc(e,Math.trunc(t)))}besseljfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELJ"),(e,t)=>th(e,Math.trunc(t)))}besselkfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELK"),(e,t)=>td(e,Math.trunc(t)))}besselyfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELY"),(e,t)=>tu(e,Math.trunc(t)))}chisqdist(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST"),(e,t,r)=>(t=Math.trunc(t),r)?tL.cdf(e,t):tL.pdf(e,t))}chisqdistrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST.RT"),(e,t)=>1-tL.cdf(e,Math.trunc(t)))}chisqinv(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV"),(e,t)=>tL.inv(e,Math.trunc(t)))}chisqinvrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV.RT"),(e,t)=>tL.inv(1-e,Math.trunc(t)))}fdist(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST"),(e,t,r,i)=>(t=Math.trunc(t),r=Math.trunc(r),i)?tk.cdf(e,t,r):tk.pdf(e,t,r))}fdistrt(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST.RT"),(e,t,r)=>1-tk.cdf(e,Math.trunc(t),Math.trunc(r)))}finv(e,t){return this.runFunction(e.args,t,this.metadata("F.INV"),(e,t,r)=>tk.inv(e,Math.trunc(t),Math.trunc(r)))}finvrt(e,t){return this.runFunction(e.args,t,this.metadata("F.INV.RT"),(e,t,r)=>tk.inv(1-e,Math.trunc(t),Math.trunc(r)))}weibulldist(e,t){return this.runFunction(e.args,t,this.metadata("WEIBULL.DIST"),(e,t,r,i)=>i?tD.cdf(e,r,t):tD.pdf(e,r,t))}poissondist(e,t){return this.runFunction(e.args,t,this.metadata("POISSON.DIST"),(e,t,r)=>(e=Math.trunc(e),r)?tH.cdf(e,t):tH.pdf(e,t))}hypgeomdist(e,t){return this.runFunction(e.args,t,this.metadata("HYPGEOM.DIST"),(e,t,r,i,n)=>e>t||e>r||t>i||r>i||e+i<r+t?new b.D5(b.NI.NUM,L.B.ValueLarge):(e=Math.trunc(e),t=Math.trunc(t),r=Math.trunc(r),i=Math.trunc(i),n)?tB.cdf(e,i,r,t):tB.pdf(e,i,r,t))}tdist(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST"),(e,t,r)=>(t=Math.trunc(t),r)?tF.cdf(e,t):tF.pdf(e,t))}tdist2t(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.2T"),(e,t)=>(1-tF.cdf(e,Math.trunc(t)))*2)}tdistrt(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.RT"),(e,t)=>1-tF.cdf(e,Math.trunc(t)))}tdistold(e,t){return this.runFunction(e.args,t,this.metadata("TDIST"),(e,t,r)=>r*(1-tF.cdf(e,Math.trunc(t))))}tinv(e,t){return this.runFunction(e.args,t,this.metadata("T.INV"),(e,t)=>tF.inv(e,Math.trunc(t)))}tinv2t(e,t){return this.runFunction(e.args,t,this.metadata("T.INV.2T"),(e,t)=>tF.inv(1-e/2,Math.trunc(t)))}lognormdist(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.DIST"),(e,t,r,i)=>i?tV.cdf(e,t,r):tV.pdf(e,t,r))}lognorminv(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.INV"),(e,t,r)=>tV.inv(e,t,r))}normdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.DIST"),(e,t,r,i)=>i?tC.cdf(e,t,r):tC.pdf(e,t,r))}norminv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.INV"),(e,t,r)=>tC.inv(e,t,r))}normsdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.DIST"),(e,t)=>t?tC.cdf(e,0,1):tC.pdf(e,0,1))}normsinv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.INV"),e=>tC.inv(e,0,1))}phi(e,t){return this.runFunction(e.args,t,this.metadata("PHI"),e=>tC.pdf(e,0,1))}negbinomdist(e,t){return this.runFunction(e.args,t,this.metadata("NEGBINOM.DIST"),(e,t,r,i)=>(e=Math.trunc(e),t=Math.trunc(t),i)?tU.cdf(e,t,r):tU.pdf(e,t,r))}confidencenorm(e,t){return this.runFunction(e.args,t,this.metadata("CONFIDENCE.NORM"),(e,t,r)=>(function(){var e,t=[].slice.call(arguments),r=[,,];return e=4===t.length?Math.abs(tC.inv(t[1]/2,0,1)*t[2]/Math.sqrt(t[3])):Math.abs(tC.inv(t[1]/2,0,1)*tz(t[2])/Math.sqrt(t[2].length)),r[0]=t[0]-e,r[1]=t[0]+e,r})(1,e,t,Math.trunc(r))[1]-1)}confidencet(e,t){return this.runFunction(e.args,t,this.metadata("CONFIDENCE.T"),(e,t,r)=>1===(r=Math.trunc(r))?new b.D5(b.NI.DIV_BY_ZERO):function(){var e,t=[].slice.call(arguments),r=[,,];return e=4===t.length?Math.abs(tF.inv(t[1]/2,t[3]-1)*t[2]/Math.sqrt(t[3])):Math.abs(tF.inv(t[1]/2,t[2].length-1)*tz(t[2],!0)/Math.sqrt(t[2].length)),r[0]=t[0]-e,r[1]=t[0]+e,r}(1,e,t,r)[1]-1)}standardize(e,t){return this.runFunction(e.args,t,this.metadata("STANDARDIZE"),(e,t,r)=>(e-t)/r)}}tX.implementedFunctions={ERF:{method:"erf",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,optionalArg:!0}]},ERFC:{method:"erfc",parameters:[{argumentType:P.B.NUMBER}]},"EXPON.DIST":{method:"expondist",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.BOOLEAN}]},FISHER:{method:"fisher",parameters:[{argumentType:P.B.NUMBER,greaterThan:-1,lessThan:1}]},FISHERINV:{method:"fisherinv",parameters:[{argumentType:P.B.NUMBER}]},GAMMA:{method:"gamma",parameters:[{argumentType:P.B.NUMBER}]},"GAMMA.DIST":{method:"gammadist",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.BOOLEAN}]},GAMMALN:{method:"gammaln",parameters:[{argumentType:P.B.NUMBER,greaterThan:0}]},"GAMMA.INV":{method:"gammainv",parameters:[{argumentType:P.B.NUMBER,minValue:0,lessThan:1},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0}]},GAUSS:{method:"gauss",parameters:[{argumentType:P.B.NUMBER}]},"BETA.DIST":{method:"betadist",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.BOOLEAN},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:1}]},"BETA.INV":{method:"betainv",parameters:[{argumentType:P.B.NUMBER,greaterThan:0,maxValue:1},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,defaultValue:0},{argumentType:P.B.NUMBER,defaultValue:1}]},"BINOM.DIST":{method:"binomialdist",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0,maxValue:1},{argumentType:P.B.BOOLEAN}]},"BINOM.INV":{method:"binomialinv",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0,maxValue:1},{argumentType:P.B.NUMBER,greaterThan:0,lessThan:1}]},BESSELI:{method:"besselifn",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:0}]},BESSELJ:{method:"besseljfn",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:0}]},BESSELK:{method:"besselkfn",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:0}]},BESSELY:{method:"besselyfn",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:0}]},"CHISQ.DIST":{method:"chisqdist",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:1,maxValue:1e10},{argumentType:P.B.BOOLEAN}]},"CHISQ.DIST.RT":{method:"chisqdistrt",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV":{method:"chisqinv",parameters:[{argumentType:P.B.NUMBER,minValue:0,maxValue:1},{argumentType:P.B.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV.RT":{method:"chisqinvrt",parameters:[{argumentType:P.B.NUMBER,minValue:0,maxValue:1},{argumentType:P.B.NUMBER,minValue:1}]},"F.DIST":{method:"fdist",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:1},{argumentType:P.B.NUMBER,minValue:1},{argumentType:P.B.BOOLEAN}]},"F.DIST.RT":{method:"fdistrt",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:1},{argumentType:P.B.NUMBER,minValue:1}]},"F.INV":{method:"finv",parameters:[{argumentType:P.B.NUMBER,minValue:0,maxValue:1},{argumentType:P.B.NUMBER,minValue:1},{argumentType:P.B.NUMBER,minValue:1}]},"F.INV.RT":{method:"finvrt",parameters:[{argumentType:P.B.NUMBER,minValue:0,maxValue:1},{argumentType:P.B.NUMBER,minValue:1},{argumentType:P.B.NUMBER,minValue:1}]},"WEIBULL.DIST":{method:"weibulldist",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.BOOLEAN}]},"POISSON.DIST":{method:"poissondist",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.BOOLEAN}]},"HYPGEOM.DIST":{method:"hypgeomdist",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.BOOLEAN}]},"T.DIST":{method:"tdist",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:1},{argumentType:P.B.BOOLEAN}]},"T.DIST.2T":{method:"tdist2t",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:1}]},"T.DIST.RT":{method:"tdistrt",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,minValue:1}]},TDIST:{method:"tdistold",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:1},{argumentType:P.B.INTEGER,minValue:1,maxValue:2}]},"T.INV":{method:"tinv",parameters:[{argumentType:P.B.NUMBER,greaterThan:0,lessThan:1},{argumentType:P.B.NUMBER,minValue:1}]},"T.INV.2T":{method:"tinv2t",parameters:[{argumentType:P.B.NUMBER,greaterThan:0,maxValue:1},{argumentType:P.B.NUMBER,minValue:1}]},"LOGNORM.DIST":{method:"lognormdist",parameters:[{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.BOOLEAN}]},"LOGNORM.INV":{method:"lognorminv",parameters:[{argumentType:P.B.NUMBER,greaterThan:0,lessThan:1},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,greaterThan:0}]},"NORM.DIST":{method:"normdist",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.BOOLEAN}]},"NORM.INV":{method:"norminv",parameters:[{argumentType:P.B.NUMBER,greaterThan:0,lessThan:1},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,greaterThan:0}]},"NORM.S.DIST":{method:"normsdist",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.BOOLEAN}]},"NORM.S.INV":{method:"normsinv",parameters:[{argumentType:P.B.NUMBER,greaterThan:0,lessThan:1}]},PHI:{method:"phi",parameters:[{argumentType:P.B.NUMBER}]},"NEGBINOM.DIST":{method:"negbinomdist",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:1},{argumentType:P.B.NUMBER,minValue:0,maxValue:1},{argumentType:P.B.BOOLEAN}]},"CONFIDENCE.NORM":{method:"confidencenorm",parameters:[{argumentType:P.B.NUMBER,greaterThan:0,lessThan:1},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,minValue:1}]},"CONFIDENCE.T":{method:"confidencet",parameters:[{argumentType:P.B.NUMBER,greaterThan:0,lessThan:1},{argumentType:P.B.NUMBER,greaterThan:0},{argumentType:P.B.NUMBER,minValue:1}]},STANDARDIZE:{method:"standardize",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,greaterThan:0}]}},tX.aliases={NEGBINOMDIST:"NEGBINOM.DIST",EXPONDIST:"EXPON.DIST",BETADIST:"BETA.DIST",NORMDIST:"NORM.DIST",NORMINV:"NORM.INV",NORMSDIST:"NORM.S.DIST",NORMSINV:"NORM.S.INV",LOGNORMDIST:"LOGNORM.DIST",LOGINV:"LOGNORM.INV",TINV:"T.INV.2T",HYPGEOMDIST:"HYPGEOM.DIST",POISSON:"POISSON.DIST",WEIBULL:"WEIBULL.DIST",FINV:"F.INV.RT",FDIST:"F.DIST.RT",CHIDIST:"CHISQ.DIST.RT",CHIINV:"CHISQ.INV.RT",GAMMADIST:"GAMMA.DIST","GAMMALN.PRECISE":"GAMMALN",GAMMAINV:"GAMMA.INV",BETAINV:"BETA.INV",BINOMDIST:"BINOM.DIST",CONFIDENCE:"CONFIDENCE.NORM",CRITBINOM:"BINOM.INV",WEIBULLDIST:"WEIBULL.DIST",TINV2T:"T.INV.2T",TDISTRT:"T.DIST.RT",TDIST2T:"T.DIST.2T",FINVRT:"F.INV.RT",FDISTRT:"F.DIST.RT",CHIDISTRT:"CHISQ.DIST.RT",CHIINVRT:"CHISQ.INV.RT",LOGNORMINV:"LOGNORM.INV",POISSONDIST:"POISSON.DIST"};class tq extends P.w{fact(e,t){return this.runFunction(e.args,t,this.metadata("FACT"),e=>{e=Math.trunc(e);let t=1;for(let r=1;r<=e;r++)t*=r;return t})}factdouble(e,t){return this.runFunction(e.args,t,this.metadata("FACTDOUBLE"),e=>{e=Math.trunc(e);let t=1;for(let r=e;r>=1;r-=2)t*=r;return t})}combin(e,t){return this.runFunction(e.args,t,this.metadata("COMBIN"),(e,t)=>t>e?new b.D5(b.NI.NUM,L.B.WrongOrder):tZ(e=Math.trunc(e),t=Math.trunc(t)))}combina(e,t){return this.runFunction(e.args,t,this.metadata("COMBINA"),(e,t)=>
134(e=Math.trunc(e))+(t=Math.trunc(t))-1>=1030?new b.D5(b.NI.NUM,L.B.ValueLarge):0===e&&0===t?1:tZ(e+t-1,t))}gcd(e,t){return this.runFunction(e.args,t,this.metadata("GCD"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof b.D5)return t;let r=0;for(let e of t){if(e<0)return new b.D5(b.NI.NUM,L.B.ValueSmall);r=tQ(r,Math.trunc(e))}return r>Number.MAX_SAFE_INTEGER?new b.D5(b.NI.NUM,L.B.ValueLarge):r})}lcm(e,t){return this.runFunction(e.args,t,this.metadata("LCM"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof b.D5)return t;let r=1;for(let e of t){var i,n;if(e<0)return new b.D5(b.NI.NUM,L.B.ValueSmall);i=r,n=Math.trunc(e),r=0===i||0===n?0:n/tQ(i,n)*i}return r>Number.MAX_SAFE_INTEGER?new b.D5(b.NI.NUM,L.B.ValueLarge):r})}mround(e,t){return this.runFunction(e.args,t,this.metadata("MROUND"),(e,t)=>0===t?0:e>0&&t<0||e<0&&t>0?new b.D5(b.NI.NUM,L.B.DistinctSigns):Math.round(e/t)*t)}multinomial(e,t){return this.runFunction(e.args,t,this.metadata("MULTINOMIAL"),(...e)=>{let t=0,r=1;for(let i of e){if(i<0)return new b.D5(b.NI.NUM,L.B.ValueSmall);i=Math.trunc(i);for(let e=1;e<=i;e++)r*=(t+e)/e;t+=i}return Math.round(r)})}quotient(e,t){return this.runFunction(e.args,t,this.metadata("QUOTIENT"),(e,t)=>0===t?new b.D5(b.NI.DIV_BY_ZERO):Math.trunc(e/t))}seriessum(e,t){return this.runFunction(e.args,t,this.metadata("SERIESSUM"),(e,t,r,i
vendor: 8,822 bytes, line 134
134)=>{let n=this.arithmeticHelper.manyToOnlyNumbersDropNulls(i.valuesFromTopLeftCorner());if(n instanceof b.D5)return n;let o=0;for(let t of(n.reverse(),n))o*=Math.pow(e,r),o+=t;return o*Math.pow(e,t)})}sign(e,t){return this.runFunction(e.args,t,this.metadata("SIGN"),e=>e>0?1:e<0?-1:0)}sumx2my2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2MY2"),(e,t)=>{let r=e.valuesFromTopLeftCorner(),i=t.valuesFromTopLeftCorner();if(r.length!==i.length)return new b.D5(b.NI.NA,L.B.EqualLength);let n=r.length,o=0;for(let e=0;e<n;e++){let t=r[e],n=i[e];if(t instanceof b.D5)return t;if(n instanceof b.D5)return n;"number"==typeof t&&"number"==typeof n&&(o+=Math.pow(t,2)-Math.pow(n,2))}return o})}sumx2py2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2PY2"),(e,t)=>{let r=e.valuesFromTopLeftCorner(),i=t.valuesFromTopLeftCorner();if(r.length!==i.length)return new b.D5(b.NI.NA,L.B.EqualLength);let n=r.length,o=0;for(let e=0;e<n;e++){let t=r[e],n=i[e];if(t instanceof b.D5)return t;if(n instanceof b.D5)return n;"number"==typeof t&&"number"==typeof n&&(o+=Math.pow(t,2)+Math.pow(n,2))}return o})}sumxmy2(e,t){return this.runFunction(e.args,t,this.metadata("SUMXMY2"),(e,t)=>{let r=e.valuesFromTopLeftCorner(),i=t.valuesFromTopLeftCorner();if(r.length!==i.length)return new b.D5(b.NI.NA,L.B.EqualLength);let n=r.length,o=0;for(let e=0;e<n;e++){let t=r[e],n=i[e];if(t instanceof b.D5)return t;if(n instanceof b.D5)return n;"number"==typeof t&&"number"==typeof n&&(o+=Math.pow(t-n,2))}return o})}}function tZ(e,t){2*t>e&&(t=e-t);let r=1;for(let i=1;i<=t;i++)r*=(e-t+i)/i;return Math.round(r)}function tQ(e,t){for(e<t&&([e,t]=[t,e]);t>0;)[e,t]=[t,e%t];return e}tq.implementedFunctions={FACT:{method:"fact",parameters:[{argumentType:P.B.NUMBER,minValue:0,maxValue:170}]},FACTDOUBLE:{method:"factdouble",parameters:[{argumentType:P.B.NUMBER,minValue:0,maxValue:288}]},COMBIN:{method:"combin",parameters:[{argumentType:P.B.NUMBER,minValue:0,lessThan:1030},{argumentType:P.B.NUMBER,minValue:0}]},COMBINA:{method:"combina",parameters:[{argumentType:P.B.NUMBER,minValue:0},{argumentType:P.B.NUMBER,minValue:0}]},GCD:{method:"gcd",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},LCM:{method:"lcm",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},MROUND:{method:"mround",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]},MULTINOMIAL:{method:"multinomial",parameters:[{argumentType:P.B.NUMBER}],repeatLastArgs:1,expandRanges:!0},QUOTIENT:{method:"quotient",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER}]},SERIESSUM:{method:"seriessum",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.RANGE}]},SIGN:{method:"sign",parameters:[{argumentType:P.B.NUMBER}]},SUMX2MY2:{method:"sumx2my2",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},SUMX2PY2:{method:"sumx2py2",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},SUMXMY2:{method:"sumxmy2",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]}};class tJ extends P.w{complex(e,t){return this.runFunction(e.args,t,this.metadata("COMPLEX"),(e,t,r)=>"i"!==r&&"j"!==r?new b.D5(b.NI.VALUE,L.B.ShouldBeIorJ):(0,H.sQ)([e,t],r))}imabs(e,t){return this.runFunction(e.args,t,this.metadata("IMABS"),t7)}imaginary(e,t){return this.runFunction(e.args,t,this.metadata("IMAGINARY"),([e,t])=>t)}imreal(e,t){return this.runFunction(e.args,t,this.metadata("IMREAL"),([e,t])=>e)}imargument(e,t){return this.runFunction(e.args,t,this.metadata("IMARGUMENT"),([e,t])=>0===e&&0===t?new b.D5(b.NI.DIV_BY_ZERO):Math.atan2(t,e))}imconjugate(e,t){return this.runFunction(e.args,t,this.metadata("IMCONJUGATE"),([e,t])=>(0,H.sQ)([e,-t]))}imcos(e,t){return this.runFunction(e.args,t,this.metadata("IMCOS"),e=>(0,H.sQ)(t2(e)))}imcosh(e,t){return this.runFunction(e.args,t,this.metadata("IMCOSH"),e=>(0,H.sQ)(t5(e)))}imcot(e,t){return this.runFunction(e.args,t,this.metadata("IMCOT"),e=>(0,H.sQ)(t1(t2(e),t3(e))))}imcsc(e,t){return this.runFunction(e.args,t,this.metadata("IMCSC"),e=>(0,H.sQ)(t1([1,0],t3(e))))}imcsch(e,t){return this.runFunction(e.args,t,this.metadata("IMCSCH"),e=>(0,H.sQ)(t1([1,0],t9(e))))}imsec(e,t){return this.runFunction(e.args,t,this.metadata("IMSEC"),e=>(0,H.sQ)(t1([1,0],t2(e))))}imsech(e,t){return this.runFunction(e.args,t,this.metadata("IMSECH"),e=>(0,H.sQ)(t1([1,0],t5(e))))}imsin(e,t){return this.runFunction(e.args,t,this.metadata("IMSIN"),e=>(0,H.sQ)(t3(e)))}imsinh(e,t){return this.runFunction(e.args,t,this.metadata("IMSINH"),e=>(0,H.sQ)(t9(e)))}imtan(e,t){return this.runFunction(e.args,t,this.metadata("IMTAN"),e=>(0,H.sQ)(t1(t3(e),t2(e))))}imdiv(e,t){return this.runFunction(e.args,t,this.metadata("IMDIV"),(e,t)=>(0,H.sQ)(t1(e,t)))}improduct(e,t){return this.runFunction(e.args,t,this.metadata("IMPRODUCT"),(...e)=>{let t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof b.D5)return t;let r=[1,0];for(let e of t)r=t0(r,e);return(0,H.sQ)(r)})}imsum(e,t){return this.runFunction(e.args,t,this.metadata("IMSUM"),(...e)=>{let t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof b.D5)return t;let r=[0,0];for(let e of t)r=function([e,t],[r,i]){return[e+r,t+i]}(r,e);return(0,H.sQ)(r)})}imsub(e,t){return this.runFunction(e.args,t,this.metadata("IMSUB"),(e,t)=>(0,H.sQ)(function([e,t],[r,i]){return[e-r,t-i]}(e,t)))}imexp(e,t){return this.runFunction(e.args,t,this.metadata("IMEXP"),e=>(0,H.sQ)(t4(e)))}imln(e,t){return this.runFunction(e.args,t,this.metadata("IMLN"),e=>(0,H.sQ)(t8(e)))}imlog10(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG10"),e=>{let[t,r]=t8(e),i=Math.log(10);return(0,H.sQ)([t/i,r/i])})}imlog2(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG2"),e=>{let[t,r]=t8(e),i=Math.log(2);return(0,H.sQ)([t/i,r/i])})}impower(e,t){return this.runFunction(e.args,t,this.metadata("IMPOWER"),(e,t)=>(0,H.sQ)(t6(e,t)))}imsqrt(e,t){return this.runFunction(e.args,t,this.metadata("IMSQRT"),e=>(0,H.sQ)(t6(e,.5)))}}function t0([e,t],[r,i]){return[e*r-t*i,e*i+r*t]}function t1([e,t],[r,i]){let n=Math.pow(r,2)+Math.pow(i,2),[o,s]=t0([e,t],[r,-i]);return[o/n,s/n]}function t2([e,t]){return[Math.cos(e)*Math.cosh(t),-Math.sin(e)*Math.sinh(t)]}function t5([e,t]){return[Math.cosh(e)*Math.cos(t),Math.sinh(e)*Math.sin(t)]}function t3([e,t]){return[Math.sin(e)*Math.cosh(t),Math.cos(e)*Math.sinh(t)]}function t9([e,t]){return[Math.sinh(e)*Math.cos(t),Math.cosh(e)*Math.sin(t)]}function t4([e,t]){return[Math.exp(e)*Math.cos(t),Math.exp(e)*Math.sin(t)]}function t7([e,t]){return Math.sqrt(e*e+t*t)}function t8([e,t]){return[Math.log(t7([e,t])),Math.atan2(t,e)]}function t6(e,t){let[r,i]=t8(e);return t4([t*r,t*i])}tJ.implementedFunctions={COMPLEX:{method:"complex",parameters:[{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER},{argumentType:P.B.STRING,defaultValue:"i"}]},IMABS:{method:"imabs",parameters:[{argumentType:P.B.COMPLEX}]},IMAGINARY:{method:"imaginary",parameters:[{argumentType:P.B.COMPLEX}]},IMREAL:{method:"imreal",parameters:[{argumentType:P.B.COMPLEX}]},IMARGUMENT:{method:"imargument",parameters:[{argumentType:P.B.COMPLEX}]},IMCONJUGATE:{method:"imconjugate",parameters:[{argumentType:P.B.COMPLEX}]},IMCOS:{method:"imcos",parameters:[{argumentType:P.B.COMPLEX}]},IMCOSH:{method:"imcosh",parameters:[{argumentType:P.B.COMPLEX}]},IMCOT:{method:"imcot",parameters:[{argumentType:P.B.COMPLEX}]},IMCSC:{method:"imcsc",parameters:[{argumentType:P.B.COMPLEX}]},IMCSCH:{method:"imcsch",parameters:[{argumentType:P.B.COMPLEX}]},IMSEC:{method:"imsec",parameters:[{argumentType:P.B.COMPLEX}]},IMSECH:{method:"imsech",parameters:[{argumentType:P.B.COMPLEX}]},IMSIN:{method:"imsin",parameters:[{argumentType:P.B.COMPLEX}]},IMSINH:{method:"imsinh",parameters:[{argumentType:P.B.COMPLEX}]},IMTAN:{method:"imtan",parameters:[{argumentType:P.B.COMPLEX}]},IMDIV:{method:"imdiv",parameters:[{argumentType:P.B.COMPLEX},{argumentType:P.B.COMPLEX}]},IMPRODUCT:{method:"improduct",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},IMSUM:{method:"imsum",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},IMSUB:{method:"imsub",parameters:[{argumentType:P.B.COMPLEX},{argumentType:P.B.COMPLEX}]},IMEXP:{method:"imexp",parameters:[{argumentType:P.B.COMPLEX}]},IMLN:{method:"imln",parameters:[{argumentType:P.B.COMPLEX}]},IMLOG10:{method:"imlog10",parameters:[{argumentType:P.B.COMPLEX}]},IMLOG2:{method:"imlog2",parameters:[{argumentType:P.B.COMPLEX}]},IMPOWER:{method:"impower",parameters:[{argumentType:P.B.COMPLEX},{argumentType:P.B.NUMBER}]},IMSQRT:{method:"imsqrt",parameters:[{argumentType:P.B.COMPLEX}]}};class re extends P.w{avedev(e,t){return this.runFunction(e.args,t,this.metadata("AVEDEV"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof b.D5)return t;if(0===t.length)return new b.D5(b.NI.DIV_BY_ZERO);let r=tj(t);return t.reduce((e,t)=>
134e+Math.abs(t-r),0)/t.length})}devsq(e,t){return this.runFunction(e.args,t,this.metadata("DEVSQ"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof b.D5?t:0===t.length?0:tG(t)})}geomean(e,t){return this.runFunction(e.args,t,this.metadata("GEOMEAN"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof b.D5)return t;if(0===t.length)return new b.D5(b.NI.NUM,L.B.OneValue);for(let e of t)if(e<=0)return new b.D5(b.NI.NUM,L.B.ValueSmall);return Math.pow(function(e){for(var t=1,r=e.length;--r>=0;)t*=e[r];return t}(t),1/t.length)})}harmean(e,t){return this.runFunction(e.args,t,this.metadata("HARMEAN"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof b.D5)return t;if(0===t.length)return new b.D5(b.NI.NUM,L.B.OneValue);for(let e of t)if(e<=0)return new b.D5(b.NI.NUM,L.B.ValueSmall);return t.length/t.reduce((e,t)=>e+1/t,0)})}correl(e,t){return this.runFunction(e.args,t,this.metadata("CORREL"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new b.D5(b.NI.NA,L.B.EqualLength);let r=rt(e,t);return r instanceof b.D5?r:r[0].length<=1?new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues):tK(r[0],r[1])})}rsq(e,t){return this.runFunction(e.args,t,this.metadata("RSQ"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new b.D5(b.NI.NA,L.B.EqualLength);let r=rt(e,t);return r instanceof b.D5?r:r[0].length<=1?new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues):Math.pow(tK(r[0],r[1]),2)})}covariancep(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.P"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new b.D5(b.NI.NA,L.B.EqualLength);let r=rt(e,t);if(r instanceof b.D5)return r;let i=r[0].length;return i<1?new b.D5(b.NI.DIV_BY_ZERO,L.B.OneValue):1===i?0:tY(r[0],r[1])*(i-1)/i})}covariances(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.S"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new b.D5(b.NI.NA,L.B.EqualLength);let r=rt(e,t);return r instanceof b.D5?r:r[0].length<=1?new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues):tY(r[0],r[1])})}ztest(e,t){return this.runFunction(e.args,t,this.metadata("Z.TEST"),(e,t,r)=>{let i=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(i instanceof b.D5)return i;let n=i.length;if(void 0===r){if(n<2)return new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues);r=tz(i,!0)}return n<1?new b.D5(b.NI.NA,L.B.OneValue):0===r?new b.D5(b.NI.DIV_BY_ZERO):1-tC.cdf((tj(i)-t)/(r/Math.sqrt(n)),0,1)})}ftest(e,t){return this.runFunction(e.args,t,this.metadata("F.TEST"),(e,t)=>{let r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),i=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(r instanceof b.D5)return r;if(i instanceof b.D5)return i;if(r.length<=1||i.length<=1)return new b.D5(b.NI.DIV_BY_ZERO);let n=t$(r,!0),o=t$(i,!0);if(0===n||0===o)return new b.D5(b.NI.DIV_BY_ZERO);let s=tk.cdf(n/o,r.length-1,i.length-1);return 2*Math.min(s,1-s)})}steyx(e,t){return this.runFunction(e.args,t,this.metadata("STEYX"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new b.D5(b.NI.NA,L.B.EqualLength);let r=rt(e,t);if(r instanceof b.D5)return r;let i=r[0].length;return i<=2?new b.D5(b.NI.DIV_BY_ZERO,L.B.ThreeValues):Math.sqrt((tG(r[0])-Math.pow(tY(r[0],r[1])*(i-1),2)/tG(r[1]))/(i-2))})}slope(e,t){return this.runFunction(e.args,t,this.metadata("SLOPE"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new b.D5(b.NI.NA,L.B.EqualLength);let r=rt(e,t);if(r instanceof b.D5)return r;let i=r[0].length;return i<=1?new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues):tY(r[0],r[1])*(i-1)/tG(r[1])})}chisqtest(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.TEST"),(e,t)=>{let r=e.height(),i=e.width();if(t.height()!==r||t.width()!==i)return new b.D5(b.NI.NA,L.B.EqualLength);let n=rt(e,t);if(n instanceof b.D5)return n;if(n[0].length<=1)return new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues);let o=0;for(let e=0;e<n[0].length;e++){if(0===n[1][e])return new b.D5(b.NI.DIV_BY_ZERO);o+=Math.pow(n[0][e]-n[1][e],2)/n[1][e]}return o<0?new b.D5(b.NI.NUM,L.B.NaN):1-tL.cdf(o,r>1&&i>1?(r-1)*(i-1):r*i-1)})}ttest(e,t){return this.runFunction(e.args,t,this.metadata("T.TEST"),(e,t,r,i
134)=>{let n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),o=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(n instanceof b.D5)return n;if(o instanceof b.D5)return o;let s=n.length,a=o.length;if(1===i){if(a!==s)return new b.D5(b.NI.NA,L.B.EqualLength);if(s<=1)return new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues);let e=Array(s);for(let t=0;t<s;t++)e[t]=n[t]-o[t];let t=tz(e,!0);if(0===t)return new b.D5(b.NI.DIV_BY_ZERO);let i=Math.abs(Math.sqrt(s)*tj(e)/t);return r*(1-tF.cdf(i,s-1))}if(2===i){if(s<=1||a<=1)return new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues);let e=(tG(n)+tG(o))/(s+a-2);if(0===e)return new b.D5(b.NI.DIV_BY_ZERO);let t=Math.abs((tj(n)-tj(o))/Math.sqrt(e*(1/s+1/a)));return r*(1-tF.cdf(t,s+a-2))}{if(s<=1||a<=1)return new b.D5(b.NI.DIV_BY_ZERO,L.B.TwoValues);let e=t$(n,!0),t=t$(o,!0);if(0===e&&0===t)return new b.D5(b.NI.DIV_BY_ZERO);let i=Math.abs((tj(n)-tj(o))/Math.sqrt(e/s+t/a)),l=Math.pow(e/s+t/a,2)/(Math.pow(e/s,2)/(s-1)+Math.pow(t/a,2)/(a-1));return r*(1-tF.cdf(i,l))}})}skew(e,t){return this.runFunction(e.args,t,this.metadata("SKEW"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof b.D5)return t;let r=t.length;if(r<3)return new b.D5(b.NI.DIV_BY_ZERO,L.B.ThreeValues);let i=tj(t),n=tz(t,!0);return 0===n?new b.D5(b.NI.DIV_BY_ZERO):t.reduce((e,t)=>e+Math.pow((t-i)/n,3),0)*r/(r-1)/(r-2)})}skewp(e,t){return this.runFunction(e.args,t,this.metadata("SKEW.P"),(...e)=>{let t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof b.D5)return t;let r=t.length;if(r<3)return new b.D5(b.NI.DIV_BY_ZERO,L.B.ThreeValues);let i=tj(t),n=tz(t,!1);return 0===n?new b.D5(b.NI.DIV_BY_ZERO):t.reduce((e,t)=>e+Math.pow((t-i)/n,3),0)/r})}}function rt(e,t){let r,i;let n=e.iterateValuesFromTopLeftCorner(),o=t.iterateValuesFromTopLeftCorner(),s=[],a=[];for(;r=n.next(),i=o.next(),!r.done&&!i.done;){let e=r.value,t=i.value;if(e instanceof b.D5)return e;if(t instanceof b.D5)return t;(0,q.g_)(e)&&(0,q.g_)(t)&&(s.push((0,q.t_)(e)),a.push((0,q.t_)(t)))}return[s,a]}re.implementedFunctions={AVEDEV:{method:"avedev",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},DEVSQ:{method:"devsq",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},GEOMEAN:{method:"geomean",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},HARMEAN:{method:"harmean",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},CORREL:{method:"correl",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},RSQ:{method:"rsq",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},"COVARIANCE.P":{method:"covariancep",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},"COVARIANCE.S":{method:"covariances",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},"Z.TEST":{method:"ztest",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.NUMBER},{argumentType:P.B.NUMBER,optionalArg:!0}]},"F.TEST":{method:"ftest",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},STEYX:{method:"steyx",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},SLOPE:{method:"slope",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},"CHISQ.TEST":{method:"chisqtest",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE}]},"T.TEST":{method:"ttest",parameters:[{argumentType:P.B.RANGE},{argumentType:P.B.RANGE},{argumentType:P.B.INTEGER,minValue:1,maxValue:2},{argumentType:P.B.INTEGER,minValue:1,maxValue:3}]},SKEW:{method:"skew",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1},"SKEW.P":{method:"skewp",parameters:[{argumentType:P.B.ANY}],repeatLastArgs:1}},re.aliases={COVAR:"COVARIANCE.P",FTEST:"F.TEST",PEARSON:"CORREL",ZTEST:"Z.TEST",CHITEST:"CHISQ.TEST",TTEST:"T.TEST",COVARIANCEP:"COVARIANCE.P",COVARIANCES:"COVARIANCE.S",SKEWP:"SKEW.P"};class rr extends M.G{}rr.HyperFormula=M.G,rr.ErrorType=b.NI,rr.CellError=b.D5,rr.CellType=b.lT,rr.CellValueType=b.uw,rr.CellValueDetailedType=b.Lf,rr.DetailedCellError=T.r,rr.ExportedCellChange=I.AJ,rr.ExportedNamedExpressionChange=I.$d,rr.ConfigValueTooBigError=A.DX,rr.ConfigValueTooSmallError=A.xr,rr.EvaluationSuspendedError=A.uQ,rr.ExpectedOneOfValuesError=A.cO,rr.ExpectedValueOfTypeError=A.Qv,rr.ArraySize=R.J,rr.SimpleRangeValue=F.r,rr.EmptyValue=x.OX,rr.FunctionPlugin=x.w8,rr.FunctionArgumentType=x.Be,rr.FunctionPluginValidationError=A.JJ,rr.InvalidAddressError=A.bS,rr.InvalidArgumentsError=A.vn,rr.LanguageNotRegisteredError=A.kN,rr.LanguageAlreadyRegisteredError=A.EY,rr.MissingTranslationError=A.$6,rr.NamedExpressionDoesNotExistError=A.eA,rr.NamedExpressionNameIsAlreadyTakenError=A.G9,rr.NamedExpressionNameIsInvalidError=A.jD,rr.NoOperationToRedoError=A.vs,rr.NoOperationToUndoError=A.CL,rr.NoRelativeAddressesAllowedError=A.vf,rr.NoSheetWithIdError=A.uJ,rr.NoSheetWithNameError=A.Hy,rr.NotAFormulaError=A.lS,rr.NothingToPasteError=A.h7,rr.ProtectedFunctionTranslationError=A.i7,rr.SheetNameAlreadyTakenError=A.Bo,rr.SheetSizeLimitExceededError=A.mk,rr.SourceLocationHasArrayError=A.dV,rr.TargetLocationHasArrayError=A.kk,rr.
134UnableToParseError=A.Wh;let ri=N.D.defaultConfig.language;for(let e of(M.G.registerLanguage(ri,O),M.G.languages[O.langCode]=O,Object.getOwnPropertyNames(C)))e.startsWith("_")||M.G.registerFunctionPlugin(C[e])},31952:function(e,t,r){"use strict";r.d(t,{ZI:function(){return l},oz:function(){return c},sQ:function(){return h},Kj:function(){return N},sH:function(){return g},uB:function(){return p},L6:function(){return u},h6:function(){return w},Gl:function(){return T},Uh:function(){return y},oW:function(){return f}});var i=r(31387),n=r(20763),o=r(2714),s=r(15095);let a=/^\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij]))\s*(([+-])\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij])))?$/;class l{constructor(e,t,r){this.config=e,this.dateTimeHelper=t,this.numberLiteralsHelper=r,this.lt=(e,t)=>0>this.compare(e,t),this.leq=(e,t)=>0>=this.compare(e,t),this.gt=(e,t)=>this.compare(e,t)>0,this.geq=(e,t)=>this.compare(e,t)>=0,this.eq=(e,t)=>0===this.compare(e,t),this.neq=(e,t)=>0!==this.compare(e,t),this.pow=(e,t)=>Math.pow((0,o.t_)(e),(0,o.t_)(t)),this.addWithEpsilonRaw=(e,t)=>{let r=e+t;return Math.abs(r)<this.actualEps*Math.abs(e)?0:r},this.addWithEpsilon=(e,t)=>{let r=R(e,t);return this.ExtendedNumberFactory(this.addWithEpsilonRaw((0,o.t_)(e),(0,o.t_)(t)),r)},this.unaryMinus=e=>(0,o.zV)(e,-(0,o.t_)(e)),this.unaryPlus=e=>e,this.unaryPercent=e=>new o.mg((0,o.t_)(e)/100),this.concat=(e,t)=>e.concat(t),this.nonstrictadd=(e,t)=>e instanceof i.D5?e:t instanceof i.D5?t:"number"==typeof e?"number"==typeof t?this.addWithEpsilonRaw(e,t):e:"number"==typeof t?t:0,this.subtract=(e,t)=>{let r=R(e,t),i=(0,o.t_)(e),n=i-(0,o.t_)(t);return Math.abs(n)<this.actualEps*Math.abs(i)&&(n=0),this.ExtendedNumberFactory(n,r)},this.divide=(e,t)=>{let r=(0,o.t_)(e),n=(0,o.t_)(t);if(0===n)return new i.D5(i.NI.DIV_BY_ZERO);{let i=b(e,t);return this.ExtendedNumberFactory(r/n,i)}},this.multiply=(e,t)=>{let r=b(e,t);return this.ExtendedNumberFactory((0,o.t_)(e)*(0,o.t_)(t),r)},this.manyToExactComplex=e=>{let t=[];for(let r of e){if(r instanceof i.D5)return r;if((0,o.g_)(r)||"string"==typeof r){let e=this.coerceScalarToComplex(r);e instanceof i.D5||t.push(e)}}return t},this.coerceNumbersExactRanges=e=>this.manyToNumbers(e,this.manyToExactNumbers),this.coerceNumbersCoerceRangesDropNulls=e=>this.manyToNumbers(e,this.manyToCoercedNumbersDropNulls),this.manyToExactNumbers=e=>{let t=[];for(let r of e){if(r instanceof i.D5)return r;(0,o.g_)(r)&&t.push((0,o.t_)(r))}return t},this.manyToOnlyNumbersDropNulls=e=>{let t=[];for(let r of e){if(r instanceof i.D5)return r;if((0,o.g_)(r))t.push((0,o.t_)(r));else if(r!==o.OX)return new i.D5(i.NI.VALUE,n.B.NumberExpected)}return t},this.manyToCoercedNumbersDropNulls=e=>{let t=[];for(let r of e){if(r instanceof i.D5)return r;if(r===o.OX)continue;let e=this.coerceScalarToNumberOrError(r);(0,o.g_)(e)&&t.push((0,o.t_)(e))}return t},this.collator=function(e){let t=e.caseSensitive?e.accentSensitive?"variant":"case":e.accentSensitive?"accent":"base",r=e.caseFirst,i=e.ignorePunctuation;return new Intl.Collator(e.localeLang,{sensitivity:t,caseFirst:r,ignorePunctuation:i})}(e),this.actualEps=e.smartRounding?e.precisionEpsilon:0}eqMatcherFunction(e){let t=this.buildRegex(e);return e=>"string"==typeof e&&t.test(this.normalizeString(e))}neqMatcherFunction(e){let t=this.buildRegex(e);return e=>"string"!=typeof e||!t.test(this.normalizeString(e))}searchString(e,t){var r;let i=this.buildRegex(e,!1).exec(t);return null!==(r=null==i?void 0:i.index)&&void 0!==r?r:-1}requiresRegex(e){if(!this.config.useRegularExpressions&&!this.config.useWildcards)return!this.config.matchWholeCell;for(let t=0;t<e.length;t++){let r=e.charAt(t);if(E(r)||this.config.useRegularExpressions&&C(r))return!0}return!1}floatCmp(e,t){let r=(0,o.t_)(e),i=(0,o.t_)(t),n=1+this.actualEps;return i>=0&&r*n>=i&&r<=i*n||i<=0&&r*n<=i&&r>=i*n?0:r>i?1:-1}coerceScalarToNumberOrError(e){var t;return e instanceof i.D5?e:null!==(t=this.coerceToMaybeNumber(e))&&void 0!==t?t:new i.D5(i.NI.VALUE,n.B.NumberCoercion)}coerceToMaybeNumber(e){var t;return null!==(t=this.coerceNonDateScalarToMaybeNumber(e))&&void 0!==t?t:"string"==typeof e?this.dateTimeHelper.dateStringToDateNumber(e):void 0}coerceNonDateScalarToMaybeNumber(e){if(e===o.OX)return 0;if("string"==typeof e){if(""===e)return 0;let t=this.coerceStringToMaybePercentNumber(e);if(void 0!==t)return t;let r=this.coerceStringToMaybeCurrencyNumber(e);return void 0!==r?r:this.numberLiteralsHelper.numericStringToMaybeNumber(e.trim())}return(0,o.g_)(e)?e:"boolean"==typeof e?Number(e):void 0}coerceStringToMaybePercentNumber(e){let t=e.trim();
134if(t.endsWith("%")){let e=t.slice(0,t.length-1).trim(),r=this.numberLiteralsHelper.numericStringToMaybeNumber(e);if(void 0!==r)return new o.mg(r/100)}}coerceStringToMaybeCurrencyNumber(e){let t=this.currencyMatcher(e.trim());if(void 0!==t){let[e,r]=t,i=this.numberLiteralsHelper.numericStringToMaybeNumber(r);if(void 0!==i)return new o.Sx(i,e)}}currencyMatcher(e){for(let t of this.config.currencySymbol){if(e.startsWith(t))return[t,e.slice(t.length).trim()];if(e.endsWith(t))return[t,e.slice(0,e.length-t.length).trim()]}}coerceComplexExactRanges(e){let t=[];for(let r of e)if(r instanceof s.r)t.push(r);else if(r!==o.OX){let e=this.coerceScalarToComplex(r);if(e instanceof i.D5)return e;t.push(e)}let r=[];for(let e of t)if(e instanceof s.r){let t=this.manyToExactComplex(e.valuesFromTopLeftCorner());if(t instanceof i.D5)return t;r.push(...t)}else r.push(e);return r}coerceScalarToComplex(e){return e instanceof i.D5?e:e===o.OX?[0,0]:(0,o.g_)(e)?[(0,o.t_)(e),0]:"string"==typeof e?this.coerceStringToComplex(e):new i.D5(i.NI.NUM,n.B.ComplexNumberExpected)}ExtendedNumberFactory(e,t){let{type:r,format:i}=t;switch(r){case o.sw.NUMBER_RAW:return e;case o.sw.NUMBER_CURRENCY:return new o.Sx(e,null!=i?i:this.config.currencySymbol[0]);case o.sw.NUMBER_DATE:return new o.kc(e,i);case o.sw.NUMBER_DATETIME:return new o.PC(e,i);case o.sw.NUMBER_TIME:return new o.B2(e,i);case o.sw.NUMBER_PERCENT:return new o.mg(e,i)}}buildRegex(e,t=!0){let r;e=this.normalizeString(e);let i=this.config.useWildcards,n=this.config.useRegularExpressions;if(n)try{RegExp(e)}catch(e){n=!1,i=!1}return(r=n?function(e,t){let r="";for(let i=0;i<e.length;i++){let n=e.charAt(i);E(n)||C(n)?r+=n:t?r+=n:r+=n.toLowerCase()}return r}(e,this.config.caseSensitive):i?function(e,t){let r="";for(let i=0;i<e.length;i++){let n=e.charAt(i);if("~"===n){if(i==e.length-1){r+="~";continue}let t=e.charAt(i+1);E(t)||C(t)?r+="\\"+t:r+=t,i++}else E(n)?r+="."+n:C(n)?r+="\\"+n:t?r+=n:r+=n.toLowerCase()}return r}(e,this.config.caseSensitive):function(e,t){let r="";for(let i=0;i<e.length;i++){let n=e.charAt(i);E(n)||C(n)?r+="\\"+n:t?r+=n:r+=n.toLowerCase()}return r}(e,this.config.caseSensitive),this.config.matchWholeCell&&t)?RegExp("^("+r+")$"):RegExp(r)}normalizeString(e){return this.config.caseSensitive||(e=e.toLowerCase()),this.config.accentSensitive||(e=A(e,"nfd").replace(/[\u0300-\u036f]/g,"")),e}compare(e,t){if("string"==typeof e||"string"==typeof t){let r="string"==typeof e?this.dateTimeHelper.dateStringToDateNumber(e):e,i="string"==typeof t?this.dateTimeHelper.dateStringToDateNumber(t):t;if((0,o.g_)(r)&&(0,o.g_)(i))return this.floatCmp(r,i)}return(e===o.OX?e=d(t):t===o.OX&&(t=d(e)),"string"==typeof e&&"string"==typeof t)?this.stringCmp(e,t):"boolean"==typeof e&&"boolean"==typeof t?m(c(e),c(t)):(0,o.g_)(e)&&(0,o.g_)(t)?this.floatCmp(e,t):e===o.OX&&t===o.OX?0:m((0,i.bY)((0,i.Tv)(e)),(0,i.bY)((0,i.Tv)(t)))}stringCmp(e,t){return this.collator.compare(e,t)}manyToNumbers(e,t){let r=[];for(let t of e)if(t instanceof s.r)r.push(t);else{let e=(0,o.t_)(this.coerceScalarToNumberOrError(t));if(e instanceof i.D5)return e;r.push(e)}let n=[];for(let e of r)if(e instanceof s.r){let r=t(e.valuesFromTopLeftCorner());if(r instanceof i.D5)return r;n.push(...r)}else n.push(e);return n}coerceStringToComplex(e){let t,r;let o=a.exec(e);return null===o?new i.D5(i.NI.NUM,n.B.ComplexNumberExpected):(t=void 0!==o[6]?"-"===o[1]?[0,-1]:[0,1]:this.parseComplexToken(o[1]+o[3],o[5]))instanceof i.D5||void 0===o[8]?t:(r=void 0!==o[14]?"-"===o[9]?[0,-1]:[0,1]:this.parseComplexToken(o[9]+o[11],o[13]))instanceof i.D5?r:""!==o[5]||""===o[13]?new i.D5(i.NI.NUM,n.B.ComplexNumberExpected):"+"===o[8]?[t[0]+r[0],t[1]+r[1]]:[t[0]-r[0],t[1]-r[1]]}parseComplexToken(e,t){let r=(0,o.t_)(this.coerceNonDateScalarToMaybeNumber(e));return void 0===r?new i.D5(i.NI.NUM,n.B.ComplexNumberExpected):""===t?[r,0]:[0,r]}}function h([e,t],r){if(!isFinite(e)||!isFinite(t))return new i.D5(i.NI.NUM,n.B.NaN);if(r=null!=r?r:"i",0===t)return`${e}`;let o=`${-1===t||1===t?"":Math.abs(t)}${r}`;return 0===e?`${t<0?"-":""}${o}`:`${e}${t<0?"-":"+"}${o}`}function u(e){return e instanceof s.r?e:s.r.fromScalar(e)}function c(e){return Number(e)}function d(e){return"string"==typeof e?"":(0,o.g_)(e)?0:"boolean"!=typeof e&&o.OX}function g(e){if(e instanceof i.D5||"boolean"==typeof e)return e;if(e===o.OX)return!1;if((0,o.g_)(e))return 0!==(0,o.t_)(e);{let t=e.toUpperCase();return"TRUE"===t||"FALSE"!==t&&""!==t&&void 0}}function p(e){return e instanceof i.D5||"string"==typeof e?e:e===o.OX?"":(0,o.g_)(e)?(0,o.t_)(e).toString():e?"TRUE":"FALSE"}function f(e){return e===o.OX?0:e}function m(e,t){let r=(0,o.t_)(e),i=(0,o.t_)(t);return r>i?1:r<i?-1:0}function y(e){return isNaN(e)||e===1/0||e===-1/0}function w(e){return 0===e?0:e}function E(e){return["*","?"].includes(e)}let S=["{","}","[","]","(",")","<",">","=",".","+","-",",","\\","$","^","!"];function C(e){return S.includes(e)}function R(e,t){let{type:r,format:i}=(0,o.ou)(e),{type:n,format:s}=(0,o.ou)(t);if(r===o.sw.NUMBER_RAW)return{type:n,format:s};if(n===o.sw.NUMBER_RAW)return{type:r,format:i};if((r===o.sw.NUMBER_DATETIME||r===o.sw.NUMBER_DATE)&&(n===o.sw.NUMBER_DATETIME||n===o.sw.NUMBER_DATE))return{type:o.sw.NUMBER_RAW};if(r===o.sw.NUMBER_TIME){if(n===o.sw.NUMBER_DATE)return{type:o.sw.NUMBER_DATETIME,format:`${s} ${i}`};if(n===o.sw.NUMBER_DATETIME)return{type:o.sw.NUMBER_DATETIME,format:s}}if(n===o.sw.NUMBER_TIME){if(r===o.sw.NUMBER_DATE)return{type:o.sw.NUMBER_DATETIME,format:`${i} ${s}`};if(r===o.sw.NUMBER_DATETIME)return{type:o.sw.NUMBER_DATETIME,format:i}}return{type:r,format:i}}function b(e,t){let{type:r,format:i}=(0,o.ou)(e),{type:n,format:s}=(0,o.ou)(t);return(r===o.sw.NUMBER_PERCENT&&(r=o.sw.NUMBER_RAW,i=void 0),n===o.sw.NUMBER_PERCENT&&(n=o.sw.NUMBER_RAW,s=void 0),r===o.sw.NUMBER_RAW)?{type:n,format:s}:n===o.sw.NUMBER_RAW?{type:r,format:i}:{type:o.sw.NUMBER_RAW}}function T(e){return A(e.toLowerCase(),"nfd").replace(/[\u0300-\u036f]/g,"")}function N(e,t){var r;if(e.isAdHoc())return null===(r=e.data[0])||void 0===r?void 0:r[0];let i=e.range;if(t.formulaAddress.sheet===i.sheet){if(1===i.width()){let r=t.formulaAddress.row-i.start.row;if(r>=0&&r<i.height())return e.data[r][0]}else if(1===i.height()){let r=t.formulaAddress.col-i.start.col;if(r>=0&&r<i.width())return e.data[0][r]}}}function A(e,t){return e.normalize(t.toUpperCase())}},69606:function(e,t,r){"use strict";r.d(t,{g:function(){return h}});var i=r(57035),n=r(49015),o=r(79149);
vendor: 5,034 bytes, line 134
134let s=new Map([["gpl-v3",1],["missing",2],["invalid",3],["expired",4]]);class a extends o.w{version(e,t){return this.runFunction(e.args,t,this.metadata("VERSION"),()=>{let e;let{licenseKeyValidityState:t,licenseKey:r}=this.config;return s.has(r)?e=s.get(r):s.has(t)?e=s.get(t):"valid"===t&&(e=r.slice(-5)),`HyperFormula v${n.G.version}, ${e}`})}}function l(e,t){var r;let n=t.implementedFunctions[e],o=null===(r=t.aliases)||void 0===r?void 0:r[e];if(void 0!==o){if(void 0!==n)throw new i.UK(e,t.name);n=t.implementedFunctions[o]}if(void 0===n)throw i.JJ.functionNotDeclaredInPlugin(e,t.name);return n}a.implementedFunctions={VERSION:{method:"version",parameters:[]}};class h{constructor(e){if(this.config=e,this.functions=new Map,this.arraySizeFunctions=new Map,this.volatileFunctions=new Set,this.arrayFunctions=new Set,this.structuralChangeFunctions=new Set,this.functionsWhichDoesNotNeedArgumentsToBeComputed=new Set,this.functionsMetadata=new Map,this.doesFunctionNeedArgumentToBeComputed=e=>this.functionsWhichDoesNotNeedArgumentsToBeComputed.has(e),this.isFunctionVolatile=e=>this.volatileFunctions.has(e),this.isArrayFunction=e=>this.arrayFunctions.has(e),this.isFunctionDependentOnSheetStructureChange=e=>this.structuralChangeFunctions.has(e),e.functionPlugins.length>0)for(let t of(this.instancePlugins=new Map,e.functionPlugins))h.loadPluginFunctions(t,this.instancePlugins);else this.instancePlugins=new Map(h.plugins);for(let[e,t]of h.protectedFunctions())h.loadFunctionUnprotected(t,e,this.instancePlugins);for(let[e,t]of this.instancePlugins.entries())this.categorizeFunction(e,l(e,t))}static registerFunctionPlugin(e,t){this.loadPluginFunctions(e,this.plugins),void 0!==t&&this.loadTranslations(t)}static registerFunction(e,t,r){this.loadPluginFunction(t,e,this.plugins),void 0!==r&&this.loadTranslations(r)}static unregisterFunction(e){if(this.functionIsProtected(e))throw i.Bf.cannotUnregisterFunctionWithId(e);this.plugins.delete(e)}static unregisterFunctionPlugin(e){for(let t of this.protectedPlugins())if(t===e)throw i.Bf.cannotUnregisterProtectedPlugin();for(let[t,r]of this.plugins.entries())r===e&&this.plugins.delete(t)}static unregisterAll(){this.plugins.clear()}static getRegisteredFunctionIds(){return[...Array.from(this.plugins.keys()),...Array.from(this._protectedPlugins.keys())]}static getPlugins(){return Array.from(new Set(this.plugins.values()).values())}static getFunctionPlugin(e){if(!this.functionIsProtected(e))return this.plugins.get(e)}static functionIsProtected(e){return this._protectedPlugins.has(e)}static loadTranslations(e){let t=new Set(n.G.getRegisteredLanguagesCodes());Object.keys(e).forEach(r=>{t.has(r)&&n.G.getLanguage(r).extendFunctions(e[r])})}static loadPluginFunctions(e,t){Object.keys(e.implementedFunctions).forEach(r=>{this.loadPluginFunction(e,r,t)}),void 0!==e.aliases&&Object.keys(e.aliases).forEach(r=>{this.loadPluginFunction(e,r,t)})}static loadPluginFunction(e,t,r){if(this.functionIsProtected(t))throw i.Bf.cannotRegisterFunctionWithId(t);this.loadFunctionUnprotected(e,t,r)}static handleDeprecatedMetadata(e,t){t&&void 0!==t.arrayFunction&&(console.warn(`${e}: 'arrayFunction' parameter is deprecated since 3.1.0; Use 'enableArrayArithmeticForArguments' instead.`),t.enableArrayArithmeticForArguments=t.arrayFunction),t&&void 0!==t.arraySizeMethod&&(console.warn(`${e}: 'arraySizeMethod' parameter is deprecated since 3.1.0; Use 'sizeOfResultArrayMethod' instead.`),t.sizeOfResultArrayMethod=t.arraySizeMethod)}static loadFunctionUnprotected(e,t,r){let n=l(t,e),o=n.method;if(this.handleDeprecatedMetadata(t,n),Object.prototype.hasOwnProperty.call(e.prototype,o))r.set(t,e);else throw i.JJ.functionMethodNotFound(o,e.name)}static*protectedFunctions(){for(let[e,t]of this._protectedPlugins)void 0!==t&&(yield[e,t])}static*protectedPlugins(){for(let[,e]of this._protectedPlugins)void 0!==e&&(yield e)}initializePlugins(e){let t=[];for(let[r,i]of this.instancePlugins.entries()){let n=t.find(e=>e instanceof i);void 0===n&&(n=new i(e),t.push(n));let o=l(r,i),s=o.method;this.functions.set(r,[s,n]);let a=o.sizeOfResultArrayMethod;void 0!==a&&this.arraySizeFunctions.set(r,[a,n])}}getFunctionPlugin(e){if(!h.functionIsProtected(e))return this.instancePlugins.get(e)}getFunction(e){let t=this.functions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){let[e,r]=t;return(t,i)=>r[e](t,i)}}getArraySizeFunction(e){let t=this.arraySizeFunctions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){let[e,r]=t;return(t,i)=>r[e](t,i)}}getMetadata(e){return this.functionsMetadata.get(e)}getPlugins(){let e=new Set;for(let[t,r]of this.instancePlugins)h.functionIsProtected(t)||e.add(r);return Array.from(e)}getRegisteredFunctionIds(){return Array.from(this.functions.keys())}categorizeFunction(e,t){t.isVolatile&&this.volatileFunctions.add(e),t.enableArrayArithmeticForArguments&&this.arrayFunctions.add(e),t.doesNotNeedArgumentsToBeComputed&&this.functionsWhichDoesNotNeedArgumentsToBeComputed.add(e),t.isDependentOnSheet
134StructureChange&&this.structuralChangeFunctions.add(e),this.functionsMetadata.set(e,t)}}h.plugins=new Map,h._protectedPlugins=new Map([["VERSION",a],["OFFSET",void 0]])},47956:function(e,t,r){"use strict";r.d(t,{P:function(){return i}});class i{constructor(e,t,r){this.formulaAddress=e,this.arraysFlag=t,this.formulaVertex=r}}},2714:function(e,t,r){"use strict";var i,n;r.d(t,{B2:function(){return c},I0:function(){return f},Kz:function(){return m},OX:function(){return o},PC:function(){return d},Sx:function(){return u},g_:function(){return p},kc:function(){return h},mg:function(){return g},ou:function(){return y},sw:function(){return i},t_:function(){return s},zV:function(){return l}});let o=Symbol("Empty value");function s(e){return e instanceof a?e.val:e}class a{constructor(e,t){this.val=e,this.format=t}fromNumber(e){return new this.constructor(e)}}function l(e,t){if("number"==typeof e)return t;{let r=e.fromNumber(t);return r.format=e.format,r}}class h extends a{getDetailedType(){return i.NUMBER_DATE}}class u extends a{getDetailedType(){return i.NUMBER_CURRENCY}}class c extends a{getDetailedType(){return i.NUMBER_TIME}}class d extends a{getDetailedType(){return i.NUMBER_DATETIME}}class g extends a{getDetailedType(){return i.NUMBER_PERCENT}}function p(e){return"number"==typeof e||e instanceof a}function f(e){return e instanceof a?e.getDetailedType():i.NUMBER_RAW}function m(e){return e instanceof a?e.format:void 0}function y(e){return e instanceof a?{type:e.getDetailedType(),format:e.format}:{type:i.NUMBER_RAW}}(n=i||(i={})).NUMBER_RAW="NUMBER_RAW",n.NUMBER_DATE="NUMBER_DATE",n.NUMBER_TIME="NUMBER_TIME",n.NUMBER_DATETIME="NUMBER_DATETIME",n.NUMBER_CURRENCY="NUMBER_CURRENCY",n.NUMBER_PERCENT="NUMBER_PERCENT"},73338:function(e,t,r){"use strict";r.d(t,{Be:function(){return i.B},OX:function(){return n.OX},w8:function(){return i.w}});var i=r(79149),n=r(2714)},79149:function(e,t,r){"use strict";r.d(t,{B:function(){return n},w:function(){return d}});var i,n,o=r(58485),s=r(31387),a=r(20763),l=r(68940),h=r(31952),u=r(2714),c=r(15095);(i=n||(n={})).STRING="STRING",i.NUMBER="NUMBER",i.BOOLEAN="BOOLEAN",i.SCALAR="SCALAR",i.NOERROR="NOERROR",i.RANGE="RANGE",i.INTEGER="INTEGER",i.COMPLEX="COMPLEX",i.ANY="ANY";class d{constructor(e){this.coerceScalarToNumberOrError=e=>this.arithmeticHelper.coerceScalarToNumberOrError(e),this.runFunction=(e,t,r,i)=>{let n=this.evaluateArguments(e,t,r),o=n.map(([e,t])=>e),l=n.map(([e,t])=>t),h=this.buildMetadataForEachArgumentValue(o.length,r),u=t.arraysFlag&&!r.vectorizationForbidden;if(!this.isNumberOfArgumentValuesValid(h,o.length))return new s.D5(s.NI.NA,a.B.WrongArgNumber);let[d,g]=u?this.calculateSizeOfVectorizedResultArray(o,h):[1,1];if(1===d&&1===g){let e=this.vectorizeAndBroadcastArgumentsIfNecessary(u,o,h,0,0);return this.calculateSingleCellOfResultArray(t,e,h,l,i,r.returnNumberType)}let p=[...Array(d).keys()].map(e=>[...Array(g).keys()].map(n=>{let s=this.vectorizeAndBroadcastArgumentsIfNecessary(u,o,h,e,n),a=this.calculateSingleCellOfResultArray(t,s,h,l,i,r.returnNumberType);if(a instanceof c.r)throw Error("Function returning array cannot be vectorized.");return a}));return c.r.onlyValues(p)},this.runFunctionWithReferenceArgument=(e,t,r,i,n,h=()=>new s.D5(s.NI.NA,a.B.CellRefExpected))=>{let u;if(0===e.length)return this.returnNumberWrapper(i(),r.returnNumberType);if(e.length>1)return new s.D5(s.NI.NA,a.B.WrongArgNumber);let c=e[0];for(;c.type===l.W$.PARENTHESIS;)c=c.expression;if(c.type===l.W$.CELL_REFERENCE)u=c.reference.toSimpleCellAddress(t.formulaAddress);else if(c.type===l.W$.CELL_RANGE||c.type===l.W$.COLUMN_RANGE||c.type===l.W$.ROW_RANGE)try{u=o.gG.fromAst(c,t.formulaAddress).start}catch(e){return new s.D5(s.NI.REF,a.B.CellRefExpected)}return void 0!==u?this.returnNumberWrapper(n(u),r.returnNumberType):this.runFunction(e,t,r,h)},this.interpreter=e,this.dependencyGraph=e.dependencyGraph,this.columnSearch=e.columnSearch,this.config=e.config,this.serialization=e.serialization,this.arraySizePredictor=e.arraySizePredictor,this.dateTimeHelper=e.dateTimeHelper,this.arithmeticHelper=e.arithmeticHelper}evaluateAst(e,t){return this.interpreter.evaluateAst(e,t)}arraySizeForAst(e,t){return this.arraySizePredictor.checkArraySizeForAst(e,t)}listOfScalarValues(e,t){let r=[];for(let i of e){let e=this.evaluateAst(i,t);if(e instanceof c.r)for(let t of e.valuesFromTopLeftCorner())r.push([t,!0]);else r.push([e,!1])}return r}coerceToType(e,t,r){let i;if(e instanceof c.r)switch(t.argumentType){case n.RANGE:case n.ANY
134:i=e;break;default:{let t=(0,h.Kj)(e,r);if(void 0===t)return;e=t}}if(!(e instanceof c.r))switch(t.argumentType){case n.INTEGER:case n.NUMBER:let o=this.coerceScalarToNumberOrError(e);if(!(0,u.g_)(o)){i=o;break}let l=(0,u.t_)(o);if(void 0!==t.maxValue&&l>t.maxValue)return new s.D5(s.NI.NUM,a.B.ValueLarge);if(void 0!==t.minValue&&l<t.minValue)return new s.D5(s.NI.NUM,a.B.ValueSmall);if(void 0!==t.lessThan&&l>=t.lessThan)return new s.D5(s.NI.NUM,a.B.ValueLarge);if(void 0!==t.greaterThan&&l<=t.greaterThan)return new s.D5(s.NI.NUM,a.B.ValueSmall);if(t.argumentType===n.INTEGER&&!Number.isInteger(l))return new s.D5(s.NI.NUM,a.B.IntegerExpected);i=o;break;case n.STRING:i=(0,h.uB)(e);break;case n.BOOLEAN:i=(0,h.sH)(e);break;case n.SCALAR:case n.NOERROR:case n.ANY:i=e;break;case n.RANGE:if(e instanceof s.D5)return e;i=(0,h.L6)(e);break;case n.COMPLEX:return this.arithmeticHelper.coerceScalarToComplex((0,u.t_)(e))}return t.passSubtype||void 0===i?i:(0,u.t_)(i)}calculateSingleCellOfResultArray(e,t,r,i,n,o){let a=this.coerceArgumentsToRequiredTypes(e,t,r,i);if(a instanceof s.D5)return a;let l=n(...a);return this.returnNumberWrapper(l,o)}coerceArgumentsToRequiredTypes(e,t,r,i){let o=[];for(let l=0;l<r.length;l++){let h=r[l],u=void 0!==t[l]?t[l]:null==h?void 0:h.defaultValue;if(void 0===u){o.push(void 0);continue}let c=this.coerceToType(u,h,e);if(void 0===c&&!i[l])return new s.D5(s.NI.VALUE,a.B.WrongType);if(c instanceof s.D5&&h.argumentType!==n.SCALAR)return c;o.push(c)}return o}vectorizeAndBroadcastArgumentsIfNecessary(e,t,r,i,n){return t.map((t,o)=>e&&this.isRangePassedAsAScalarArgument(t,r[o])?this.vectorizeAndBroadcastRangeArgument(t,i,n):t)}vectorizeAndBroadcastRangeArgument(e,t,r){var i;let n=1===e.height()?0:t,o=1===e.width()?0:r;return null===(i=e.data[n])||void 0===i?void 0:i[o]}evaluateArguments(e,t,r){return r.expandRanges?this.listOfScalarValues(e,t):e.map(e=>[this.evaluateAst(e,t),!1])}buildMetadataForEachArgumentValue(e,t){let r=t.parameters?[...t.parameters]:[];if(void 0!==t.repeatLastArgs&&Number.isInteger(t.repeatLastArgs)&&t.repeatLastArgs>0)for(;e>r.length;)r.push(...r.slice(r.length-t.repeatLastArgs));return r}isNumberOfArgumentValuesValid(e,t){return!(t>e.length)&&(!(t<e.length)||e.slice(t).every(e=>(null==e?void 0:e.optionalArg)||(null==e?void 0:e.defaultValue)!==void 0))}calculateSizeOfVectorizedResultArray(e,t){let r=e.filter((e,r)=>this.isRangePassedAsAScalarArgument(e,t[r]));return[Math.max(1,...r.map(e=>e.height())),Math.max(1,...r.map(e=>e.width()))]}isRangePassedAsAScalarArgument(e,t){return null!=e&&null!=t&&e instanceof c.r&&![n.RANGE,n.ANY].includes(t.argumentType)}metadata(e){let t=this.constructor.implementedFunctions[e];if(void 0!==t)return t;throw Error(`No metadata for function ${e}.`)}returnNumberWrapper(e,t,r){return void 0!==t&&(0,u.g_)(e)?this.arithmeticHelper.ExtendedNumberFactory((0,u.t_)(e),{type:t,format:r}):e}}},12338:function(e,t,r){"use strict";r.d(t,{A3:function(){return T},A9:function(){return p},Gl:function(){return P},Gm:function(){return M},HP:function(){return d},Hx:function(){return F},Kj:function(){return u},Ll:function(){return I},MF:function(){return V},O9:function(){return L},Of:function(){return c},Op:function(){return O},Qu:function(){return y},RL:function(){return _},W$:function(){return a},XW:function(){return s},Xq:function(){return w},_T:function(){return k},bR:function(){return H},dr:function(){return A},g4:function(){return C},hd:function(){return B},mF:function(){return E},mT:function(){return b},nj:function(){return m},oe:function(){return f},qC:function(){return S},qQ:function(){return l},rh:function(){return N},rl:function(){return g},t_:function(){return W},tp:function(){return x},uT:function(){return R},xf:function(){return D}});var i,n,o,s,a,l,h=r(31387);let u=(e,t)=>({type:e,message:t});(i=s||(s={})).LexingError="LexingError",i.ParserError="ParsingError",i.StaticOffsetError="StaticOffsetError",i.StaticOffsetOutOfRangeError="StaticOffsetOutOfRangeError",i.RangeOffsetNotAllowed="RangeOffsetNotAllowed",i.InvalidRangeSize="InvalidRangeSize",(n=a||(a={})).EMPTY="EMPTY",n.NUMBER="NUMBER",n.STRING="STRING",n.MINUS_UNARY_OP="MINUS_UNARY_OP",n.PLUS_UNARY_OP="PLUS_UNARY_OP",n.PERCENT_OP="PERCENT_OP",n.CONCATENATE_OP="CONCATENATE_OP",n.EQUALS_OP
134="EQUALS_OP",n.NOT_EQUAL_OP="NOT_EQUAL_OP",n.GREATER_THAN_OP="GREATER_THAN_OP",n.LESS_THAN_OP="LESS_THAN_OP",n.GREATER_THAN_OR_EQUAL_OP="GREATER_THAN_OR_EQUAL_OP",n.LESS_THAN_OR_EQUAL_OP="LESS_THAN_OR_EQUAL_OP",n.PLUS_OP="PLUS_OP",n.MINUS_OP="MINUS_OP",n.TIMES_OP="TIMES_OP",n.DIV_OP="DIV_OP",n.POWER_OP="POWER_OP",n.FUNCTION_CALL="FUNCTION_CALL",n.NAMED_EXPRESSION="NAMED_EXPRESSION",n.PARENTHESIS="PARENTHESES",n.CELL_REFERENCE="CELL_REFERENCE",n.CELL_RANGE="CELL_RANGE",n.COLUMN_RANGE="COLUMN_RANGE",n.ROW_RANGE="ROW_RANGE",n.ERROR="ERROR",n.ERROR_WITH_RAW_INPUT="ERROR_WITH_RAW_INPUT",n.ARRAY="ARRAY",(o=l||(l={}))[o.RELATIVE=0]="RELATIVE",o[o.START_ABSOLUTE=1]="START_ABSOLUTE",o[o.BOTH_ABSOLUTE=2]="BOTH_ABSOLUTE";let c=e=>({type:a.EMPTY,leadingWhitespace:null==e?void 0:e.image}),d=(e,t)=>({type:a.NUMBER,value:e,leadingWhitespace:null==t?void 0:t.image}),g=e=>{var t;return{type:a.STRING,value:e.image.slice(1,-1),leadingWhitespace:null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image}},p=(e,t)=>({type:a.CELL_REFERENCE,reference:e,leadingWhitespace:null==t?void 0:t.image}),f=(e,t,r,i)=>(U(e,t,r),{type:a.CELL_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:i}),m=(e,t,r,i)=>(U(e,t,r),{type:a.COLUMN_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:null==i?void 0:i.image}),y=(e,t,r,i)=>(U(e,t,r),{type:a.ROW_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:null==i?void 0:i.image}),w=(e,t,r)=>({type:a.CONCATENATE_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),E=(e,t,r)=>({type:a.EQUALS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),S=(e,t,r)=>({type:a.NOT_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),C=(e,t,r)=>({type:a.GREATER_THAN_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),R=(e,t,r)=>({type:a.LESS_THAN_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),b=(e,t,r)=>({type:a.GREATER_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),T=(e,t,r)=>({type:a.LESS_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),N=(e,t,r)=>({type:a.PLUS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),A=(e,t,r)=>({type:a.MINUS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),I=(e,t,r)=>({type:a.TIMES_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),M=(e,t,r)=>({type:a.DIV_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),O=(e,t,r)=>({type:a.POWER_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),x=(e,t)=>({type:a.MINUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),_=(e,t)=>({type:a.PLUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),P=(e,t)=>({type:a.PERCENT_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),L=(e,t,r,i,n)=>({type:a.FUNCTION_CALL,procedureName:e,args:t,leadingWhitespace:null==r?void 0:r.image,internalWhitespace:null==i?void 0:i.image,hyperlink:n}),k=(e,t,r)=>({type:a.ARRAY,args:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==r?void 0:r.image}),D=(e,t)=>({type:a.NAMED_EXPRESSION,expressionName:e,leadingWhitespace:null==t?void 0:t.image}),H=(e,t,r)=>({type:a.PARENTHESIS,expression:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==r?void 0:r.image}),B=(e,t)=>({type:a.ERROR,error:e,leadingWhitespace:null==t?void 0:t.image}),F=(e,t,r)=>({type:a.ERROR_WITH_RAW_INPUT,error:t,rawInput:e,leadingWhitespace:null==r?void 0:r.image}),V=()=>({type:a.ERROR,error:h.D5.parsingError()});function U(e,t,r){if(void 0!==e.sheet&&void 0===t.sheet||void 0===e.sheet&&void 0!==t.sheet)throw Error("Start address inconsistent with end address");if(void 0===e.sheet&&r!==l.RELATIVE||void 0!==e.sheet&&r===l.RELATIVE)throw Error("Sheet address inconsistent with sheet reference type")}function W(e,t){return(null!=t?t:"")+e}},38246:function(e,t,r){"use strict";r.d(t,{A:function(){return n},L:function(){return h}});var i,n,o=r(31387),s=r(29253),a=r(44832),l=r(44379);(i=n||(n={})).CELL_REFERENCE_RELATIVE="CELL_REFERENCE",i.CELL_REFERENCE_ABSOLUTE="CELL_REFERENCE_ABSOLUTE",i.CELL_REFERENCE_ABSOLUTE_COL="CELL_REFERENCE_ABSOLUTE_COL",i.CELL_REFERENCE_ABSOLUTE_ROW="CELL_REFERENCE_ABSOLUTE_ROW";
134class h{constructor(e,t,r,i){this.col=e,this.row=t,this.type=r,this.sheet=i}static fromColAndRow(e,t,r){return(e.isColumnAbsolute()&&t.isRowAbsolute()?h.absolute.bind(this):e.isColumnAbsolute()?h.absoluteCol.bind(this):t.isRowAbsolute()?h.absoluteRow.bind(this):h.relative.bind(this))(e.col,t.row,r)}static relative(e,t,r){return new h(e,t,n.CELL_REFERENCE_RELATIVE,r)}static absolute(e,t,r){return new h(e,t,n.CELL_REFERENCE_ABSOLUTE,r)}static absoluteCol(e,t,r){return new h(e,t,n.CELL_REFERENCE_ABSOLUTE_COL,r)}static absoluteRow(e,t,r){return new h(e,t,n.CELL_REFERENCE_ABSOLUTE_ROW,r)}toSimpleCellAddress(e){let t=(0,o.MC)(this,e);return this.type===n.CELL_REFERENCE_ABSOLUTE?(0,o.mT)(t,this.col,this.row):this.type===n.CELL_REFERENCE_ABSOLUTE_ROW?(0,o.mT)(t,e.col+this.col,this.row):this.type===n.CELL_REFERENCE_ABSOLUTE_COL?(0,o.mT)(t,this.col,e.row+this.row):(0,o.mT)(t,e.col+this.col,e.row+this.row)}toColumnAddress(){let e=this.isColumnRelative()?a.l.RELATIVE:a.l.ABSOLUTE;return new a.w(e,this.col,this.sheet)}toRowAddress(){let e=this.isRowRelative()?a.l.RELATIVE:a.l.ABSOLUTE;return new l.u(e,this.row,this.sheet)}toSimpleColumnAddress(e){let t=(0,o.MC)(this,e),r=this.col;return this.isColumnRelative()&&(r+=e.col),(0,o.Ve)(t,r)}toSimpleRowAddress(e){let t=(0,o.MC)(this,e),r=this.row;return this.isRowRelative()&&(r+=e.row),(0,o.Un)(t,r)}isRowAbsolute(){return this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_ROW}isColumnAbsolute(){return this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_COL}isColumnRelative(){return this.type===n.CELL_REFERENCE_RELATIVE||this.type===n.CELL_REFERENCE_ABSOLUTE_ROW}isRowRelative(){return this.type===n.CELL_REFERENCE_RELATIVE||this.type===n.CELL_REFERENCE_ABSOLUTE_COL}isAbsolute(){return this.type===n.CELL_REFERENCE_ABSOLUTE&&void 0!==this.sheet}shiftedByRows(e){return new h(this.col,this.row+e,this.type,this.sheet)}shiftedByColumns(e){return new h(this.col+e,this.row,this.type,this.sheet)}moved(e,t,r){let i=void 0===this.sheet?void 0:e;return new h(this.col+t,this.row+r,this.type,i)}withSheet(e){return new h(this.col,this.row,this.type,e)}isInvalid(e){return(0,o.SL)(this.toSimpleCellAddress(e))}shiftRelativeDimensions(e,t){return new h(this.isColumnAbsolute()?this.col:this.col+e,this.isRowAbsolute()?this.row:this.row+t,this.type,this.sheet)}shiftAbsoluteDimensions(e,t){return new h(this.isColumnRelative()?this.col:this.col+e,this.isRowRelative()?this.row:this.row+t,this.type,this.sheet)}hash(e){let t=e&&void 0!==this.sheet?`#${this.sheet}`:"";switch(this.type){case n.CELL_REFERENCE_RELATIVE:return`${t}#${this.row}R${this.col}`;case n.CELL_REFERENCE_ABSOLUTE:return`${t}#${this.row}A${this.col}`;case n.CELL_REFERENCE_ABSOLUTE_COL:return`${t}#${this.row}AC${this.col}`;case n.CELL_REFERENCE_ABSOLUTE_ROW:return`${t}#${this.row}AR${this.col}`}}unparse(e){let t=this.toSimpleCellAddress(e);if((0,o.SL)(t))return;let r=(0,s.Ym)(t.col),i=this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_ROW?"$":"",a=this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_COL?"$":"";return`${a}${r}${i}${t.row+1}`}exceedsSheetSizeLimits(e,t){return this.row>=t||this.col>=e}}},44832:function(e,t,r){"use strict";r.d(t,{l:function(){return n},w:function(){return a}});var i,n,o=r(31387),s=r(29253);(i=n||(n={})).RELATIVE="RELATIVE",i.ABSOLUTE="ABSOLUTE";class a{constructor(e,t,r){this.type=e,this.col=t,this.sheet=r}static absolute(e,t){return new a(n.ABSOLUTE,e,t)}static relative(e,t){return new a(n.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,r)=>t.toSimpleColumnAddress(e).col-r.toSimpleColumnAddress(e).col}isColumnAbsolute(){return this.type===n.ABSOLUTE}isColumnRelative(){return this.type===n.RELATIVE}isAbsolute(){return this.type===n.ABSOLUTE&&void 0!==this.sheet}moved(e,t,r){let i=void 0===this.sheet?void 0:e;return new a(this.type,this.col+t,i)}shiftedByColumns(e){return new a(this.type,this.col+e,this.sheet)}toSimpleColumnAddress(e){let t=(0,o.MC)(this,e),r=this.col;return this.isColumnRelative()&&(r=e.col+this.col),(0,o.Ve)(t,r)}shiftRelativeDimensions(e,t){let r=this.isColumnRelative()?this.col+e:this.col;return new a(this.type,r,this.sheet)}shiftAbsoluteDimensions(e,t){let r=this.isColumnAbsolute()?this.col+e:this.col;return new a(this.type,r,this.sheet)}withSheet(e){return new a(this.type,this.col,e)}isInvalid(e){return this.toSimpleColumnAddress(e).col<0}hash(e){let t=e&&void 0!==this.sheet?`#${this.sheet}`:"";switch(this.type){case n.RELATIVE:return`${t}#COLR${this.col}`;case n.ABSOLUTE:return`${t}#COLA${this.col}`}}unparse(e){let t=this.toSimpleColumnAddress(e);if((0,o.CJ)(t))return;let r=(0,s.Ym)(t.col),i=this.type===n.ABSOLUTE?"$":"";return`${i}${r}`}exceedsSheetSizeLimits(e){return this.col>=e}}},44379:function(e,t,r){"use strict";r.d(t,{u:function(){return o}});var i=r(31387),n=r(44832);class o{constructor(e,t,r){this.type=e,this.row=t,this.sheet=r}static absolute(e,t){return new o(n.l.ABSOLUTE,e,t)}static relative(e,t){return new o(n.l.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,r)=>t.toSimpleRowAddress(e).row-r.toSimpleRowAddress(e).row}
134isRowAbsolute(){return this.type===n.l.ABSOLUTE}isRowRelative(){return this.type===n.l.RELATIVE}isAbsolute(){return this.type===n.l.ABSOLUTE&&void 0!==this.sheet}moved(e,t,r){let i=void 0===this.sheet?void 0:e;return new o(this.type,this.row+r,i)}shiftedByRows(e){return new o(this.type,this.row+e,this.sheet)}toSimpleRowAddress(e){let t=(0,i.MC)(this,e),r=this.row;return this.isRowRelative()&&(r=e.row+this.row),(0,i.Un)(t,r)}shiftRelativeDimensions(e,t){let r=this.isRowRelative()?this.row+t:this.row;return new o(this.type,r,this.sheet)}shiftAbsoluteDimensions(e,t){let r=this.isRowAbsolute()?this.row+t:this.row;return new o(this.type,r,this.sheet)}withSheet(e){return new o(this.type,this.row,e)}isInvalid(e){return this.toSimpleRowAddress(e).row<0}hash(e){let t=e&&void 0!==this.sheet?`#${this.sheet}`:"";switch(this.type){case n.l.RELATIVE:return`${t}#ROWR${this.row}`;case n.l.ABSOLUTE:return`${t}#ROWA${this.row}`}}unparse(e){let t=this.toSimpleRowAddress(e);if((0,i.Yi)(t))return;let r=this.type===n.l.ABSOLUTE?"$":"";return`${r}${t.row+1}`}exceedsSheetSizeLimits(e){return this.row>=e}}},29253:function(e,t,r){"use strict";r.d(t,{Cl:function(){return w},Lc:function(){return g},Px:function(){return E},Ym:function(){return C},_N:function(){return R},d1:function(){return m},hS:function(){return f},sn:function(){return p},uu:function(){return y}});var i=r(58485),n=r(31387),o=r(38246),s=r(44832),a=r(5905),l=r(44379);let h=RegExp(`^(${a.Nm})?(\\${a.bR}?)([A-Za-z]+)(\\${a.bR}?)([0-9]+)$`),u=RegExp(`^(${a.Nm})?(\\${a.bR}?)([A-Za-z]+)$`),c=RegExp(`^(${a.Nm})?(\\${a.bR}?)([0-9]+)$`),d=RegExp(`^${a.LK}$`),g=(e,t,r)=>{let i=h.exec(e);if(!i)return;let n=S(i[6]),s=Number(i[8])-1,l=T(b(i),r);if(null!==l)return i[5]===a.bR&&i[7]===a.bR?o.L.absolute(n,s,l):i[5]===a.bR?o.L.absoluteCol(n,s-t.row,l):i[7]===a.bR?o.L.absoluteRow(n-t.col,s,l):o.L.relative(n-t.col,s-t.row,l)},p=(e,t,r)=>{let i=u.exec(e);if(!i)return;let n=S(i[6]),o=T(b(i),r);return null===o?void 0:i[5]===a.bR?s.w.absolute(n,o):s.w.relative(n-t.col,o)},f=(e,t,r)=>{let i=c.exec(e);if(!i)return;let n=Number(i[6])-1,o=T(b(i),r);return null===o?void 0:i[5]===a.bR?l.u.absolute(n,o):l.u.relative(n-t.row,o)},m=(e,t,r)=>{let i=h.exec(t);if(!i)return;let o=S(i[6]),s=Number(i[8])-1,a=T(b(i),e);if(null!==a)return(0,n.mT)(void 0===a?r:a,o,s)},y=(e,t,r)=>{let n=t.split(a.pt);if(2!==n.length)return;let[o,s]=n,l=m(e,o,r);if(void 0===l)return;let h=m(e,s,l.sheet);if(void 0!==h&&l.sheet===h.sheet)return(0,i.nI)(l,h)},w=(e,t,r)=>{let i=C(t.col),n=R(t.sheet,e);return void 0===n?void 0:r!==t.sheet?`${n}!${i}${t.row+1}`:`${i}${t.row+1}`},E=(e,t,r)=>{let i=w(e,t.start,r),n=w(e,t.end,t.start.sheet);if(void 0!==i&&void 0!==n)return`${i}${a.pt}${n}`};function S(e){return 1===e.length?e.toUpperCase().charCodeAt(0)-65:e.split("").reduce((e,t)=>26*e+(t.toUpperCase().charCodeAt(0)-64),0)-1}function C(e){let t="";for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}function R(e,t){let r=t(e);return void 0===r?void 0:d.test(r)?r:(r=r.replace(/'/g,"''"),`'${r}'`)}function b(e){var t;let r=null!==(t=e[3])&&void 0!==t?t:e[2];return r?r.replace(/''/g,"'"):null}function T(e,t){if(!e)return;let r=t(e);return void 0===r?null:r}},68940:function(e,t,r){"use strict";r.d(t,{CI:function(){return eo},W$:function(){return a.W$},Lf:function(){return n.L},H5:function(){return es},OU:function(){return ea},ZP:function(){return eh},Zu:function(){return et},XW:function(){return a.XW},qS:function(){return el},DH:function(){return Z},hd:function(){return a.hd},MF:function(){return a.MF},Vd:function(){return ei},d1:function(){return i.d1},Cl:function(){return i.Cl},uu:function(){return i.uu},Px:function(){return i.Px}});var i=r(29253),n=r(38246),o=r(15554),s=r(31387),a=r(12338);let l={[a.W$.PLUS_OP]:"+",[a.W$.MINUS_OP]:"-",[a.W$.TIMES_OP]:"*",[a.W$.DIV_OP]:"/",[a.W$.CONCATENATE_OP]:"&",[a.W$.POWER_OP]:"^",[a.W$.EQUALS_OP]:"=",[a.W$.NOT_EQUAL_OP]:"<>",[a.W$.GREATER_THAN_OP]:">",[a.W$.GREATER_THAN_OR_EQUAL_OP]:">=",[a.W$.LESS_THAN_OP]:"<",[a.W$.LESS_THAN_OR_EQUAL_OP]:"<="},h=(e,t,r,i)=>
134({ast:e,relativeDependencies:t,hasVolatileFunction:r,hasStructuralChangeFunction:i});class u{constructor(e){this.functionRegistry=e,this.cache=new Map}set(e,t){let r=ei(t,this.functionRegistry),i=h(t,r,c(t,this.functionRegistry.isFunctionVolatile),c(t,this.functionRegistry.isFunctionDependentOnSheetStructureChange));return this.cache.set(e,i),i}get(e){return this.cache.get(e)}maybeSetAndThenGet(e,t){let r=this.cache.get(e);return void 0!==r?r.ast:(this.set(e,t),t)}}let c=(e,t)=>{switch(e.type){case a.W$.EMPTY:case a.W$.NUMBER:case a.W$.STRING:case a.W$.ERROR:case a.W$.ERROR_WITH_RAW_INPUT:case a.W$.CELL_REFERENCE:case a.W$.CELL_RANGE:case a.W$.COLUMN_RANGE:case a.W$.ROW_RANGE:case a.W$.NAMED_EXPRESSION:return!1;case a.W$.PERCENT_OP:case a.W$.PLUS_UNARY_OP:case a.W$.MINUS_UNARY_OP:return c(e.value,t);case a.W$.CONCATENATE_OP:case a.W$.EQUALS_OP:case a.W$.NOT_EQUAL_OP:case a.W$.LESS_THAN_OP:case a.W$.GREATER_THAN_OP:case a.W$.LESS_THAN_OR_EQUAL_OP:case a.W$.GREATER_THAN_OR_EQUAL_OP:case a.W$.MINUS_OP:case a.W$.PLUS_OP:case a.W$.TIMES_OP:case a.W$.DIV_OP:case a.W$.POWER_OP:return c(e.left,t)||c(e.right,t);case a.W$.PARENTHESIS:return c(e.expression,t);case a.W$.FUNCTION_CALL:if(t(e.procedureName))return!0;return e.args.some(e=>c(e,t));case a.W$.ARRAY:return e.args.some(e=>e.some(e=>c(e,t)))}};var d=r(20763),g=r(5905);class p{constructor(){this.POSSIBLE_START_CHARACTERS=[...g.JM,...g.yV,g.bR,"'","_"],this.cellReferenceRegexp=RegExp(g.Bx,"y")}match(e,t){this.cellReferenceRegexp.lastIndex=t;let r=this.cellReferenceRegexp.exec(e+"@");return null==r||null==r[1]?null:(r[0]=r[1],r)}}class f{constructor(){this.POSSIBLE_START_CHARACTERS=[...g.JM,"_"],this.namedExpressionRegexp=RegExp(g.PO,"y"),this.r1c1CellRefRegexp=RegExp(`^${g.p}$`)}match(e,t){this.namedExpressionRegexp.lastIndex=t;let r=this.namedExpressionRegexp.exec(e);return null==r||null==r[0]||this.r1c1CellRefRegexp.test(r[0])?null:r}}let m=(0,o.createToken)({name:"AdditionOp",pattern:o.Lexer.NA}),y=(0,o.createToken)({name:"PlusOp",pattern:/\+/,categories:m}),w=(0,o.createToken)({name:"MinusOp",pattern:/-/,categories:m}),E=(0,o.createToken)({name:"MultiplicationOp",pattern:o.Lexer.NA}),S=(0,o.createToken)({name:"TimesOp",pattern:/\*/,categories:E}),C=(0,o.createToken)({name:"DivOp",pattern:/\//,categories:E}),R=(0,o.createToken)({name:"PowerOp",pattern:/\^/}),b=(0,o.createToken)({name:"PercentOp",pattern:/%/}),T=(0,o.createToken)({name:"BooleanOp",pattern:o.Lexer.NA}),N=(0,o.createToken)({name:"EqualsOp",pattern:/=/,categories:T}),A=(0,o.createToken)({name:"NotEqualOp",pattern:/<>/,categories:T}),I=(0,o.createToken)({name:"GreaterThanOp",pattern:/>/,categories:T}),M=(0,o.createToken)({name:"LessThanOp",pattern:/</,categories:T}),O=(0,o.createToken)({name:"GreaterThanOrEqualOp",pattern:/>=/,categories:T}),x=(0,o.createToken)({name:"LessThanOrEqualOp",pattern:/<=/,categories:T}),_=(0,o.createToken)({name:"ConcatenateOp",pattern:/&/}),P=(0,o.createToken)({name:"LParen",pattern:/\(/}),L=(0,o.createToken)({name:"RParen",pattern:/\)/}),k=(0,o.createToken)({name:"ArrayLParen",pattern:/{/}),D=(0,o.createToken)({name:"ArrayRParen",pattern:/}/}),H=(0,o.createToken)({name:"StringLiteral",pattern:/"([^"\\]*(\\.[^"\\]*)*)"/}),B=(0,o.createToken)({name:"ErrorLiteral",pattern:/#[A-Za-z0-9\/]+[?!]?/}),F=(0,o.createToken)({name:"RangeSeparator",pattern:new RegExp(g.pt)}),V=(0,o.createToken)({name:"ColumnRange",pattern:RegExp(`${g.rm}${g.pt}${g.rm}`)}),U=(0,o.createToken)({name:"RowRange",pattern:RegExp(`${g.vG}${g.pt}${g.vG}`)}),W=(0,o.createToken)({name:"ProcedureName",pattern:RegExp(`([${g.wZ}][${g.ri}]*)\\(`)}),j=new p,G=(0,o.createToken)({name:"CellReference",pattern:j.match.bind(j),start_chars_hint:j.POSSIBLE_START_CHARACTERS,line_breaks:!1}),$=new f,z=(0,o.createToken)({name:"NamedExpression",pattern:$.match.bind($),start_chars_hint:$.POSSIBLE_START_CHARACTERS,line_breaks:!1}),Y=e=>{let t,r;let i=e.translationPackage.getFunctionTranslation("OFFSET"),n=e.errorMapping,s=e.translationPackage.buildFunctionMapping(),a=new RegExp("standard"===e.ignoreWhiteSpace?g.g7:g.Qh),l=(0,o.createToken)({name:"WhiteSpace",pattern:a}),h=(0,o.createToken)({name:"ArrayRowSep",pattern:e.arrayRowSeparator}),u=(0,o.createToken)({name:"ArrayColSep",pattern:e.arrayColumnSeparator}),c=(0,o.createToken)({name:"NumberLiteral",pattern:RegExp(`(([${e.decimalSeparator}]\\d+)|(\\d+([${e.decimalSeparator}]\\d*)?))(e[+-]?\\d+)?`)}
134),d=(0,o.createToken)({name:"OffsetProcedureName",pattern:RegExp(i,"i")});e.functionArgSeparator===e.arrayColumnSeparator?(t=u,r=[]):e.functionArgSeparator===e.arrayRowSeparator?(t=h,r=[]):r=[t=(0,o.createToken)({name:"ArgSeparator",pattern:e.functionArgSeparator})];let p=[l,y,w,S,C,R,N,A,b,O,x,I,M,P,L,k,D,d,W,F,...r,V,U,c,H,B,_,T,m,E,G,z,h,u];return{ArgSeparator:t,NumberLiteral:c,OffsetProcedureName:d,ArrayRowSeparator:h,ArrayColSeparator:u,WhiteSpace:l,allTokens:p,errorMapping:n,functionMapping:s,decimalSeparator:e.decimalSeparator,maxColumns:e.maxColumns,maxRows:e.maxRows}};class K extends o.EmbeddedActionsParser{constructor(e,t){super(e.allTokens,{outputCst:!1,maxLookahead:7}),this.resolveSheetReference=t,this.booleanExpressionOrEmpty=this.RULE("booleanExpressionOrEmpty",()=>this.OR([{ALT:()=>this.SUBRULE(this.booleanExpression)},{ALT:(0,o.EMPTY_ALT)((0,a.Of)())}])),this.procedureExpression=this.RULE("procedureExpression",()=>{var e;let t=this.CONSUME(W),r=t.image.toUpperCase().slice(0,-1),i=null!==(e=this.lexerConfig.functionMapping[r])&&void 0!==e?e:r,n=[],o=this.SUBRULE(this.booleanExpressionOrEmpty);this.MANY(()=>{var e;let t=this.CONSUME(this.lexerConfig.ArgSeparator);o.type===a.W$.EMPTY&&(o.leadingWhitespace=null===(e=t.leadingWhitespace)||void 0===e?void 0:e.image),n.push(o),o=this.SUBRULE2(this.booleanExpressionOrEmpty)}),n.push(o),1===n.length&&n[0].type===a.W$.EMPTY&&(n.length=0);let s=this.CONSUME(L);return(0,a.O9)(i,n,t.leadingWhitespace,s.leadingWhitespace)}),this.namedExpressionExpression=this.RULE("namedExpressionExpression",()=>{let e=this.CONSUME(z);return(0,a.xf)(e.image,e.leadingWhitespace)}),this.offsetProcedureExpression=this.RULE("offsetProcedureExpression",()=>{let e=[];return this.CONSUME(this.lexerConfig.OffsetProcedureName),this.CONSUME(P),this.MANY_SEP({SEP:this.lexerConfig.ArgSeparator,DEF:()=>{e.push(this.SUBRULE(this.booleanExpression))}}),this.CONSUME(L),this.handleOffsetHeuristic(e)}),this.columnRangeExpression=this.RULE("columnRangeExpression",()=>{let e=this.CONSUME(V),[t,r]=e.image.split(":"),n=this.ACTION(()=>(0,i.sn)(t,this.formulaAddress,this.resolveSheetReference)),o=this.ACTION(()=>(0,i.sn)(r,this.formulaAddress,this.resolveSheetReference));if(void 0===n||void 0===o)return(0,a.hd)(new s.D5(s.NI.REF));if(n.exceedsSheetSizeLimits(this.lexerConfig.maxColumns)||o.exceedsSheetSizeLimits(this.lexerConfig.maxColumns))return(0,a.Hx)(e.image,new s.D5(s.NI.NAME),e.leadingWhitespace);if(void 0===n.sheet&&void 0!==o.sheet)return this.parsingError(a.XW.ParserError,"Malformed range expression");let{firstEnd:l,secondEnd:h,sheetRefType:u}=K.fixSheetIdsForRangeEnds(n,o);return(0,a.nj)(l,h,u,e.leadingWhitespace)}),this.rowRangeExpression=this.RULE("rowRangeExpression",()=>{let e=this.CONSUME(U),[t,r]=e.image.split(":"),n=this.ACTION(()=>(0,i.hS)(t,this.formulaAddress,this.resolveSheetReference)),o=this.ACTION(()=>(0,i.hS)(r,this.formulaAddress,this.resolveSheetReference));if(void 0===n||void 0===o)return(0,a.hd)(new s.D5(s.NI.REF));if(n.exceedsSheetSizeLimits(this.lexerConfig.maxRows)||o.exceedsSheetSizeLimits(this.lexerConfig.maxRows))return(0,a.Hx)(e.image,new s.D5(s.NI.NAME),e.leadingWhitespace);if(void 0===n.sheet&&void 0!==o.sheet)return this.parsingError(a.XW.ParserError,"Malformed range expression");let{firstEnd:l,secondEnd:h,sheetRefType:u}=K.fixSheetIdsForRangeEnds(n,o);return(0,a.Qu)(l,h,u,e.leadingWhitespace)}),this.cellReference=this.RULE("cellReference",()=>{let e=this.CONSUME(G),t=this.ACTION(()=>(0,i.Lc)(e.image,this.formulaAddress,this.resolveSheetReference));return void 0===t?(0,a.Hx)(e.image,new s.D5(s.NI.REF),e.leadingWhitespace):t.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?(0,a.Hx)(e.image,new s.D5(s.NI.NAME),e.leadingWhitespace):(0,a.A9)(t,e.leadingWhitespace)}),this.endRangeReference=this.RULE("endRangeReference",e=>{var t;let r=this.CONSUME(G),n=this.ACTION(()=>(0,i.Lc)(e.image,this.formulaAddress,this.resolveSheetReference)),o=this.ACTION(()=>(0,i.Lc)(r.image,this.formulaAddress,this.resolveSheetReference));return void 0===n||void 0===o?this.ACTION(()=>(0,a.Hx)(`${e.image}:${r.image}`,new s.D5(s.NI.REF),e.leadingWhitespace)):n.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)||o.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?this.ACTION(()=>(0,a.Hx)(`${e.image}:${r.image}`,new s.D5(s.NI.NAME),e.leadingWhitespace)):this.buildCellRange(n,o,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image)}),this.endOfRangeExpression=this.RULE("endOfRangeExpression",e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeReference,{ARGS:[e]})},{ALT:()=>{var t;let r=this.SUBRULE(this.offsetProcedureExpression),n=this.ACTION(()=>(0,i.Lc)(e.image,this.formulaAddress,this.resolveSheetReference));return void 0===n?(0,a.hd)(new s.D5(s.NI.REF)):r.type===a.W$.CELL_REFERENCE?this.buildCellRange(n,r.reference,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image):this.parsingError(a.XW.RangeOffsetNotAllowed,"Range offset not allowed here")}}])),this.cellRangeExpression=this.RULE("cellRangeExpression",()=>{let e=this.CONSUME(G);return this.CONSUME2(F),this.SUBRULE(this.endOfRangeExpression,{ARGS:[e]})}),this.endRangeWithOffsetStartReference=this.RULE("endRangeWithOffsetStartReference",e=>{let t=this.CONSUME(G),r=this.ACTION(()=>(0,i.Lc)(t.image,this.formulaAddress,this.resolveSheetReference));return void 0===r?this.ACTION(()=>(0,a.hd)(new s.D5(s.NI.REF))):this.buildCellRange(e.reference,r,e.leadingWhitespace)}),this.endOfRangeWithOffsetStartExpression=this.RULE("endOfRangeWithOffsetStartExpression",e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeWithOffsetStartReference,{ARGS:[e]})},{ALT:()=>{let t=this.SUBRULE(this.offsetProcedureExpression);return t.type===a.W$.CELL_REFERENCE?this.buildCellRange(e.reference,t.reference,e.leadingWhitespace):this.parsingError(a.XW.RangeOffsetNotAllowed,"Range offset not allowed here")}}])),this.offsetExpression=this.RULE("offsetExpression",()=>{let e;let t=this.SUBRULE(this.offsetProcedureExpression);return(this.OPTION(()=>{this.CONSUME(F),e=t.type===a.W$.CELL_RANGE?this.parsingError(a.XW.RangeOffsetNotAllowed,"Range offset not allowed here"):this.SUBRULE(this.endOfRangeWithOffsetStartExpression,{ARGS:[t]})}),void 0!==e)?e:t}),this.insideArrayExpression=this.RULE("insideArrayExpression",()=>{let e=[[]];return e[e.length-1].push(this.SUBRULE(this.booleanExpression)),this.MANY(()=>{this.OR([{ALT:()=>{this.CONSUME(this.lexerConfig.ArrayColSeparator),e[e.length-1].push(this.SUBRULE2(this.booleanExpression))}},{ALT:()=>{this.CONSUME(this.lexerConfig.ArrayRowSeparator),e.push([]),e[e.length-1].push(this.SUBRULE3(this.booleanExpression))}}])}),(0,a._T)(e)}),this.parenthesisExpression=this.RULE("parenthesisExpression",()=>{let e=this.CONSUME(P),t=this.SUBRULE(this.booleanExpression),r=this.CONSUME(L);return(0,a.bR)(t,e.leadingWhitespace,r.leadingWhitespace)}),this.arrayExpression=this.RULE("arrayExpression",()=>this.OR([{ALT:()=>{let e=this.CONSUME(k),t=this.SUBRULE(this.insideArrayExpression),r=this.CONSUME(D);return(0,a._T)(t.args,e.leadingWhitespace,r.leadingWhitespace)}},{ALT:()=>this.SUBRULE(this.parenthesisExpression)}])),this.numericStringToNumber=e=>Number(e.replace(this.lexerConfig.decimalSeparator,".")),this.positiveAtomicExpression=this.RULE("positiveAtomicExpression",()=>{var e;return this.OR(null!==(e=this.atomicExpCache)&&void 0!==e?e:this.atomicExpCache=[{ALT:()=>this.SUBRULE(this.arrayExpression)},{ALT:()=>this.SUBRULE(this.cellRangeExpression)},{ALT:()=>this.SUBRULE(this.columnRangeExpression)},{ALT:()=>this.SUBRULE(this.rowRangeExpression)},{ALT:()=>this.SUBRULE(this.offsetExpression)},{ALT:()=>this.SUBRULE(this.cellReference)},{ALT:()=>this.SUBRULE(this.procedureExpression)},{ALT:()=>this.SUBRULE(this.namedExpressionExpression)},{ALT:()=>{let e=this.CONSUME(this.lexerConfig.NumberLiteral);return(0,a.HP)(this.numericStringToNumber(e.image),e.leadingWhitespace)}},{ALT:()=>{let e=this.CONSUME(H);return(0,a.rl)(e)}},{ALT:()=>{let e=this.CONSUME(B),t=e.image.toUpperCase(),r=this.lexerConfig.errorMapping[t];return r?(0,a.hd)(new s.D5(r),e.leadingWhitespace):this.parsingError(a.XW.ParserError,"Unknown error literal")}}])}),this.rightUnaryOpAtomicExpression=this.RULE("rightUnaryOpAtomicExpression",()=>{let e=this.SUBRULE(this.positiveAtomicExpression),t=this.OPTION(()=>this.CONSUME(b));return t?(0,a.Gl)(e,t.leadingWhitespace):e}),this.atomicExpression=this.RULE("atomicExpression",()=>this.OR([{ALT:()=>{let e=this.CONSUME(m),t=this.SUBRULE(this.atomicExpression);return(0,o.tokenMatcher)(e,y)?(0,a.RL)(t,e.leadingWhitespace):(0,o.tokenMatcher)(e,w)?(0,a.tp)(t,e.leadingWhitespace):(this.customParsingError=(0,a.Kj)(a.XW.ParserError,"Mismatched token type"),this.customParsingError)}},{ALT:()=>this.SUBRULE2(this.rightUnaryOpAtomicExpression)}])),this.powerExpression=this.RULE("powerExpression",()=>{let e=this.SUBRULE(this.atomicExpression);return this.MANY(()=>{let t=this.CONSUME(R),r=this.SUBRULE2(this.atomicExpression);(0,o.tokenMatcher)(t,R)?e=(0,a.Op)(e,r,t.leadingWhitespace):this.ACTION(()=>{throw Error("Operator not supported")})}),e}),this.multiplicationExpression=this.RULE("multiplicationExpression",()=>{let e=this.SUBRULE(this.powerExpression);return this.MANY(()=>{let t=this.CONSUME(E),r=this.SUBRULE2(this.powerExpression);(0,o.tokenMatcher)(t,S)?e=(0,a.Ll)(e,r,t.leadingWhitespace):(0,o.tokenMatcher)(t,C)?e=(0,a.Gm)(e,r,t.leadingWhitespace):this.ACTION(()=>{throw Error("Operator not supported")})}),e}),this.additionExpression=this.RULE("additionExpression",()=>{let e=this.SUBRULE(this.multiplicationExpression);return this.MANY(()=>{let t=this.CONSUME(m),r=this.SUBRULE2(this.multiplicationExpression);(0,o.tokenMatcher)(t,y)?e=(0,a.rh)(e,r,t.leadingWhitespace):(0,o.tokenMatcher)(t,w)?e=(0,a.dr)(e,r,t.leadingWhitespace):this.ACTION(()=>{throw Error("Operator not supported")})}),e}),this.concatenateExpression=this.RULE("concatenateExpression",()=>{let e=this.SUBRULE(this.additionExpression);return this.MANY(()=>{let t=this.CONSUME(_),r=this.SUBRULE2(this.additionExpression);e=(0,a.Xq)(e,r,t.leadingWhitespace)}),e}),this.booleanExpression=this.RULE("booleanExpression",()=>{let e=this.SUBRULE(this.concatenateExpression);return this.MANY(()=>{let t=this.CONSUME(T),r=this.SUBRULE2(this.concatenateExpression);(0,o.tokenMatcher)(t,N)?e=(0,a.mF)(e,r,t.leadingWhitespace):(0,o.tokenMatcher)(t,A)?e=(0,a.qC)(e,r,t.leadingWhitespace):(0,o.tokenMatcher)(t,I)?e=(0,a.g4)(e,r,t.leadingWhitespace):(0,o.tokenMatcher)(t,M)?e=(0,a.uT)(e,r,t.leadingWhitespace):(0,o.tokenMatcher)(t,O)?e=(0,a.mT)(e,r,t.leadingWhitespace):(0,o.tokenMatcher)(t,x)?e=(0,a.A3)(e,r,t.leadingWhitespace):this.ACTION(()=>{throw Error("Operator not supported")})}),e}),this.formula=this.RULE("formula",()=>(this.CONSUME(N),this.SUBRULE(this.booleanExpression))),this.lexerConfig=e,this.formulaAddress=(0,s.mT)(0,
1340,0),this.performSelfAnalysis()}parseFromTokens(e,t){this.input=e;let r=this.formulaWithContext(t),i=[];return this.customParsingError&&i.push(this.customParsingError),(i=i.concat(this.errors.map(e=>({type:a.XW.ParserError,message:e.message})))).length>0&&(r=(0,a.MF)()),{ast:r,errors:i}}reset(){super.reset(),this.customParsingError=void 0}formulaWithContext(e){return this.formulaAddress=e,this.formula()}buildCellRange(e,t,r){if(void 0===e.sheet&&void 0!==t.sheet)return this.parsingError(a.XW.ParserError,"Malformed range expression");let{firstEnd:i,secondEnd:n,sheetRefType:o}=K.fixSheetIdsForRangeEnds(e,t);return(0,a.oe)(i,n,o,r)}static fixSheetIdsForRangeEnds(e,t){let r=K.rangeSheetReferenceType(e.sheet,t.sheet),i=void 0!==e.sheet&&void 0===t.sheet?t.withSheet(e.sheet):t;return{firstEnd:e,secondEnd:i,sheetRefType:r}}handleOffsetHeuristic(e){var t;let r,i,o,l;let h=e[0];if(h.type!==a.W$.CELL_REFERENCE)return this.parsingError(a.XW.StaticOffsetError,"First argument to OFFSET is not a reference");let u=e[1];if(u.type===a.W$.NUMBER&&Number.isInteger(u.value))r=u.value;else if(u.type===a.W$.PLUS_UNARY_OP&&u.value.type===a.W$.NUMBER&&Number.isInteger(u.value.value))r=u.value.value;else{if(!(u.type===a.W$.MINUS_UNARY_OP&&u.value.type===a.W$.NUMBER&&Number.isInteger(u.value.value)))return this.parsingError(a.XW.StaticOffsetError,"Second argument to OFFSET is not a static number");r=-u.value.value}let c=e[2];if(c.type===a.W$.NUMBER&&Number.isInteger(c.value))i=c.value;else if(c.type===a.W$.PLUS_UNARY_OP&&c.value.type===a.W$.NUMBER&&Number.isInteger(c.value.value))i=c.value.value;else{if(!(c.type===a.W$.MINUS_UNARY_OP&&c.value.type===a.W$.NUMBER&&Number.isInteger(c.value.value)))return this.parsingError(a.XW.StaticOffsetError,"Third argument to OFFSET is not a static number");i=-c.value.value}let g=e[3];if(void 0===g)o=1;else{if(g.type!==a.W$.NUMBER)return this.parsingError(a.XW.StaticOffsetError,"Fourth argument to OFFSET is not a static number");if((o=g.value)<1)return this.parsingError(a.XW.StaticOffsetError,"Fourth argument to OFFSET is too small number");if(!Number.isInteger(o))return this.parsingError(a.XW.StaticOffsetError,"Fourth argument to OFFSET is not integer")}let p=e[4];if(void 0===p)l=1;else{if(p.type!==a.W$.NUMBER)return this.parsingError(a.XW.StaticOffsetError,"Fifth argument to OFFSET is not a static number");if((l=p.value)<1)return this.parsingError(a.XW.StaticOffsetError,"Fifth argument to OFFSET is too small number");if(!Number.isInteger(l))return this.parsingError(a.XW.StaticOffsetError,"Fifth argument to OFFSET is not integer")}let f=new n.L(h.reference.col+i,h.reference.row+r,h.reference.type,null!==(t=h.reference.sheet)&&void 0!==t?t:void 0),m=f.col,y=f.row;if((h.reference.type===n.A.CELL_REFERENCE_RELATIVE||h.reference.type===n.A.CELL_REFERENCE_ABSOLUTE_COL)&&(y+=this.formulaAddress.row),(h.reference.type===n.A.CELL_REFERENCE_RELATIVE||h.reference.type===n.A.CELL_REFERENCE_ABSOLUTE_ROW)&&(m+=this.formulaAddress.col),m<0||y<0)return(0,a.hd)(new s.D5(s.NI.REF,d.B.OutOfSheet));if(1===l&&1===o)return(0,a.A9)(f);{let e=new n.L(f.col+l-1,f.row+o-1,f.type,f.sheet),t=null==h.reference.sheet?a.qQ.RELATIVE:a.qQ.BOTH_ABSOLUTE;return(0,a.oe)(f,e,t)}}parsingError(e,t){return this.customParsingError=(0,a.Kj)(e,t),(0,a.MF)()}static rangeSheetReferenceType(e,t){return void 0===e?a.qQ.RELATIVE:void 0===t?a.qQ.START_ABSOLUTE:a.qQ.BOTH_ABSOLUTE}}class X{constructor(e){this.lexerConfig=e,this.lexer=new o.Lexer(e.allTokens,{ensureOptimizations:!0})}tokenizeFormula(e){let t=this.lexer.tokenize(e),r=t.tokens;return r=this.trimTrailingWhitespaces(r),r=this.skipWhitespacesInsideRanges(r),r=this.skipWhitespacesBeforeArgSeparators(r),t.tokens=r,t}skipWhitespacesInsideRanges(e){return X.filterTokensByNeighbors(e,(e,t,r)=>((0,o.tokenMatcher)(e,G)||(0,o.tokenMatcher)(e,F))&&(0,o.tokenMatcher)(t,this.lexerConfig.WhiteSpace)&&((0,o.tokenMatcher)(r,G)||(0,o.tokenMatcher)(r,F)))}skipWhitespacesBeforeArgSeparators(e){return X.filterTokensByNeighbors(e,(e,t,r)=>!(0,o.tokenMatcher)(e,this.lexerConfig.ArgSeparator)&&(0,o.tokenMatcher)(t,this.lexerConfig.WhiteSpace)&&(0,o.tokenMatcher)(r,this.lexerConfig.ArgSeparator))}static filterTokensByNeighbors(e,t){if(e.length<3)return e;let r=0,i=[e[r++]];for(;r<e.length-1;)t(e[r-1],e[r],e[r+1])||i.push(e[r]),++r;return i.push(e[r]),i}
134trimTrailingWhitespaces(e){return e.length>0&&(0,o.tokenMatcher)(e[e.length-1],this.lexerConfig.WhiteSpace)&&e.pop(),e}}var q=r(70797);class Z{constructor(e,t,r){this.config=e,this.sheetMapping=t,this.namedExpressions=r}unparse(e,t){return"="+this.unparseAst(e,t)}unparseAst(e,t){var r,i;switch(e.type){case a.W$.EMPTY:return(0,a.t_)("",e.leadingWhitespace);case a.W$.NUMBER:return(0,a.t_)(Q(e.value,this.config.decimalSeparator),e.leadingWhitespace);case a.W$.STRING:return(0,a.t_)('"'+e.value+'"',e.leadingWhitespace);case a.W$.FUNCTION_CALL:{let r=e.args.map(e=>void 0!==e?this.unparseAst(e,t):"").join(this.config.functionArgSeparator),i=(this.config.translationPackage.isFunctionTranslated(e.procedureName)?this.config.translationPackage.getFunctionTranslation(e.procedureName):e.procedureName)+"("+r+(0,a.t_)(")",e.internalWhitespace);return(0,a.t_)(i,e.leadingWhitespace)}case a.W$.NAMED_EXPRESSION:{let i=null===(r=this.namedExpressions.nearestNamedExpression(e.expressionName,t.sheet))||void 0===r?void 0:r.displayName;return(0,a.t_)(i||e.expressionName,e.leadingWhitespace)}case a.W$.CELL_REFERENCE:{let r;return r=(void 0!==e.reference.sheet?this.unparseSheetName(e.reference.sheet)+"!":"")+(null!==(i=e.reference.unparse(t))&&void 0!==i?i:this.config.translationPackage.getErrorTranslation(s.NI.REF)),(0,a.t_)(r,e.leadingWhitespace)}case a.W$.COLUMN_RANGE:case a.W$.ROW_RANGE:case a.W$.CELL_RANGE:return(0,a.t_)(this.formatRange(e,t),e.leadingWhitespace);case a.W$.PLUS_UNARY_OP:{let r=this.unparseAst(e.value,t);return(0,a.t_)("+",e.leadingWhitespace)+r}case a.W$.MINUS_UNARY_OP:{let r=this.unparseAst(e.value,t);return(0,a.t_)("-",e.leadingWhitespace)+r}case a.W$.PERCENT_OP:return this.unparseAst(e.value,t)+(0,a.t_)("%",e.leadingWhitespace);case a.W$.ERROR:{let t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:s.NI.ERROR);return(0,a.t_)(t,e.leadingWhitespace)}case a.W$.ERROR_WITH_RAW_INPUT:return(0,a.t_)(e.rawInput,e.leadingWhitespace);case a.W$.PARENTHESIS:{let r="("+this.unparseAst(e.expression,t)+(0,a.t_)(")",e.internalWhitespace);return(0,a.t_)(r,e.leadingWhitespace)}case a.W$.ARRAY:{let r="{"+e.args.map(e=>e.map(e=>this.unparseAst(e,t)).join(this.config.arrayColumnSeparator)).join(this.config.arrayRowSeparator)+(0,a.t_)("}",e.internalWhitespace);return(0,a.t_)(r,e.leadingWhitespace)}default:{let r=this.unparseAst(e.left,t),i=this.unparseAst(e.right,t);return r+(0,a.t_)(l[e.type],e.leadingWhitespace)+i}}}unparseSheetName(e){let t=(0,i._N)(e,e=>this.sheetMapping.getSheetNameOrThrowError(e,{includePlaceholders:!0}));if(void 0===t)throw new q.uJ(e);return t}formatRange(e,t){let r="",i="";void 0!==e.start.sheet&&e.sheetReferenceType!==a.qQ.RELATIVE&&(r=this.unparseSheetName(e.start.sheet)+"!"),void 0!==e.end.sheet&&e.sheetReferenceType===a.qQ.BOTH_ABSOLUTE&&(i=this.unparseSheetName(e.end.sheet)+"!");let n=e.start.unparse(t),o=e.end.unparse(t);return void 0===n||void 0===o?this.config.translationPackage.getErrorTranslation(s.NI.REF):`${r}${n}:${i}${o}`}}function Q(e,t){return e.toString().replace(".",t)}var J=r(44832),ee=r(44379);class et{constructor(e,t,r){this.config=e,this.functionRegistry=t,this.resolveSheetReference=r,this.statsCacheUsed=0,this.lexerConfig=Y(e),this.lexer=new X(this.lexerConfig),this.formulaParser=new K(this.lexerConfig,this.resolveSheetReference),this.cache=new u(this.functionRegistry)}parse(e,t){this.formulaAddress=t;let r=this.tokenizeFormula(e);if(r.errors.length>0){let e=r.errors.map(e=>({type:a.XW.LexingError,message:e.message}));return{ast:(0,a.MF)(),errors:e,hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]}}let i=this.computeHashFromTokens(r.tokens,t),n=this.cache.get(i);if(void 0!==n)++this.statsCacheUsed;else{let e=this.bindWhitespacesToTokens(r.tokens),o=this.formulaParser.parseFromTokens(e,t);if(o.errors.length>0)return Object.assign(Object.assign({},o),{hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]});n=this.cache.set(i,o.ast)}let{ast:o,hasVolatileFunction:s,hasStructuralChangeFunction:l}=n,h=this.convertReversedRangesToRegularRanges(o),u=ei(h,this.functionRegistry);return{ast:h,errors:[],hasVolatileFunction:s,hasStructuralChangeFunction:l,depen
134dencies:u}}convertReversedRangesToRegularRanges(e){switch(e.type){case a.W$.EMPTY:case a.W$.NUMBER:case a.W$.STRING:case a.W$.ERROR:case a.W$.ERROR_WITH_RAW_INPUT:case a.W$.CELL_REFERENCE:case a.W$.NAMED_EXPRESSION:return e;case a.W$.CELL_RANGE:{let{start:t,end:r}=e,i=this.orderCellRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:i.start,end:i.end})}case a.W$.COLUMN_RANGE:{let{start:t,end:r}=e,i=this.orderColumnRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:i.start,end:i.end})}case a.W$.ROW_RANGE:{let{start:t,end:r}=e,i=this.orderRowRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:i.start,end:i.end})}case a.W$.PERCENT_OP:case a.W$.PLUS_UNARY_OP:case a.W$.MINUS_UNARY_OP:{let t=this.convertReversedRangesToRegularRanges(e.value);return Object.assign(Object.assign({},e),{value:t})}case a.W$.CONCATENATE_OP:case a.W$.EQUALS_OP:case a.W$.NOT_EQUAL_OP:case a.W$.LESS_THAN_OP:case a.W$.GREATER_THAN_OP:case a.W$.LESS_THAN_OR_EQUAL_OP:case a.W$.GREATER_THAN_OR_EQUAL_OP:case a.W$.MINUS_OP:case a.W$.PLUS_OP:case a.W$.TIMES_OP:case a.W$.DIV_OP:case a.W$.POWER_OP:{let t=this.convertReversedRangesToRegularRanges(e.left),r=this.convertReversedRangesToRegularRanges(e.right);return Object.assign(Object.assign({},e),{left:t,right:r})}case a.W$.PARENTHESIS:{let t=this.convertReversedRangesToRegularRanges(e.expression);return Object.assign(Object.assign({},e),{expression:t})}case a.W$.FUNCTION_CALL:{let t=e.args.map(e=>this.convertReversedRangesToRegularRanges(e));return Object.assign(Object.assign({},e),{args:t})}case a.W$.ARRAY:{let t=e.args.map(e=>e.map(e=>this.convertReversedRangesToRegularRanges(e)));return Object.assign(Object.assign({},e),{args:t})}}}orderCellRangeEnds(e,t){let r=[e,t],[i,o]=r.map(e=>e.toColumnAddress()).sort(J.w.compareByAbsoluteAddress(this.formulaAddress)),[s,a]=r.map(e=>e.toRowAddress()).sort(ee.u.compareByAbsoluteAddress(this.formulaAddress)),[l,h]=r.map(e=>e.sheet).sort(et.compareSheetIds.bind(this));return{start:n.L.fromColAndRow(i,s,l),end:n.L.fromColAndRow(o,a,h)}}orderColumnRangeEnds(e,t){let r=[e,t],[i,n]=r.sort(J.w.compareByAbsoluteAddress(this.formulaAddress)),[o,s]=r.map(e=>e.sheet).sort(et.compareSheetIds.bind(this));return{start:new J.w(i.type,i.col,o),end:new J.w(n.type,n.col,s)}}orderRowRangeEnds(e,t){let r=[e,t],[i,n]=r.sort(ee.u.compareByAbsoluteAddress(this.formulaAddress)),[o,s]=r.map(e=>e.sheet).sort(et.compareSheetIds.bind(this));return{start:new ee.u(i.type,i.row,o),end:new ee.u(n.type,n.row,s)}}static compareSheetIds(e,t){return(e=null!=e?e:1/0)-(t=null!=t?t:1/0)}fetchCachedResultForAst(e){let t=this.computeHashFromAst(e);return this.fetchCachedResult(t)}fetchCachedResult(e){let t=this.cache.get(e);if(void 0===t)throw Error("There is no AST with such key in the cache");{let{ast:e,hasVolatileFunction:r,hasStructuralChangeFunction:i,relativeDependencies:n}=t;return{ast:e,errors:[],hasVolatileFunction:r,hasStructuralChangeFunction:i,dependencies:n}}}computeHashFromTokens(e,t){var r;let n="",s=0;for(;s<e.length;){let a=e[s];if((0,o.tokenMatcher)(a,G)){let e=(0,i.Lc)(a.image,t,this.resolveSheetReference);n=void 0===e?n.concat(a.image):n.concat(e.hash(!0))}else if((0,o.tokenMatcher)(a,W)){let e=a.image.toUpperCase().slice(0,-1),t=null!==(r=this.lexerConfig.functionMapping[e])&&void 0!==r?r:e;n=n.concat(t,"(")}
134else if((0,o.tokenMatcher)(a,V)){let[e,r]=a.image.split(":"),o=(0,i.sn)(e,t,this.resolveSheetReference),s=(0,i.sn)(r,t,this.resolveSheetReference);n=void 0===o||void 0===s?n.concat("!REF"):n.concat(o.hash(!0),":",s.hash(!0))}else if((0,o.tokenMatcher)(a,U)){let[e,r]=a.image.split(":"),o=(0,i.hS)(e,t,this.resolveSheetReference),s=(0,i.hS)(r,t,this.resolveSheetReference);n=void 0===o||void 0===s?n.concat("!REF"):n.concat(o.hash(!0),":",s.hash(!0))}else n=n.concat(a.image);s++}return n}rememberNewAst(e){let t=this.computeHashFromAst(e);return this.cache.maybeSetAndThenGet(t,e)}computeHashFromAst(e){return"="+this.computeHashOfAstNode(e)}computeHashOfAstNode(e){switch(e.type){case a.W$.EMPTY:return e.leadingWhitespace||"";case a.W$.NUMBER:return(0,a.t_)(Q(e.value,this.config.decimalSeparator),e.leadingWhitespace);case a.W$.STRING:return(0,a.t_)('"'+e.value+'"',e.leadingWhitespace);case a.W$.NAMED_EXPRESSION:return(0,a.t_)(e.expressionName,e.leadingWhitespace);case a.W$.FUNCTION_CALL:{let t=e.args.map(e=>this.computeHashOfAstNode(e)).join(this.config.functionArgSeparator),r=e.procedureName+"("+t+(0,a.t_)(")",e.internalWhitespace);return(0,a.t_)(r,e.leadingWhitespace)}case a.W$.CELL_REFERENCE:return(0,a.t_)(e.reference.hash(!0),e.leadingWhitespace);case a.W$.COLUMN_RANGE:case a.W$.ROW_RANGE:case a.W$.CELL_RANGE:{let t=e.start.hash(e.sheetReferenceType!==a.qQ.RELATIVE),r=e.end.hash(e.sheetReferenceType===a.qQ.BOTH_ABSOLUTE);return(0,a.t_)(t+":"+r,e.leadingWhitespace)}case a.W$.MINUS_UNARY_OP:return(0,a.t_)("-"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case a.W$.PLUS_UNARY_OP:return(0,a.t_)("+"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case a.W$.PERCENT_OP:return this.computeHashOfAstNode(e.value)+(0,a.t_)("%",e.leadingWhitespace);case a.W$.ERROR:{let t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:s.NI.ERROR);return(0,a.t_)(t,e.leadingWhitespace)}case a.W$.ERROR_WITH_RAW_INPUT:return(0,a.t_)(e.rawInput,e.leadingWhitespace);case a.W$.ARRAY:{let t=e.args.map(e=>e.map(e=>this.computeHashOfAstNode(e)).join(",")).join(";");return(0,a.t_)("{"+t+(0,a.t_)("}",e.internalWhitespace),e.leadingWhitespace)}case a.W$.PARENTHESIS:{let t="("+this.computeHashOfAstNode(e.expression)+(0,a.t_)(")",e.internalWhitespace);return(0,a.t_)(t,e.leadingWhitespace)}default:return this.computeHashOfAstNode(e.left)+(0,a.t_)(l[e.type],e.leadingWhitespace)+this.computeHashOfAstNode(e.right)}}bindWhitespacesToTokens(e){let t=[],r=e[0];(0,o.tokenMatcher)(r,this.lexerConfig.WhiteSpace)||t.push(r);for(let r=1;r<e.length;++r){let i=e[r];if((0,o.tokenMatcher)(i,this.lexerConfig.WhiteSpace))continue;let n=e[r-1];(0,o.tokenMatcher)(n,this.lexerConfig.WhiteSpace)&&(i.leadingWhitespace=n),t.push(i)}return t}tokenizeFormula(e){return this.lexer.tokenizeFormula(e)}}let er=(e,t,r,i)=>{switch(e.type){case a.W$.EMPTY:case a.W$.NUMBER:case a.W$.STRING:case a.W$.ERROR:return;case a.W$.NAMED_EXPRESSION:i&&r.push(new eh(e.expressionName));return;case a.W$.CELL_REFERENCE:i&&r.push(new eo(e.reference));return;case a.W$.CELL_RANGE:i&&e.start.sheet===e.end.sheet&&r.push(new es(e.start,e.end));return;case a.W$.COLUMN_RANGE:i&&e.start.sheet===e.end.sheet&&r.push(new ea(e.start,e.end));return;case a.W$.ROW_RANGE:i&&e.start.sheet===e.end.sheet&&r.push(new el(e.start,e.end));return;case a.W$.PERCENT_OP:case a.W$.PLUS_UNARY_OP:case a.W$.MINUS_UNARY_OP:er(e.value,t,r,!0);return;case a.W$.CONCATENATE_OP:case a.W$.EQUALS_OP:case a.W$.NOT_EQUAL_OP:case a.W$.LESS_THAN_OP:case a.W$.GREATER_THAN_OP:case a.W$.LESS_THAN_OR_EQUAL_OP:case a.W$.GREATER_THAN_OR_EQUAL_OP:case a.W$.MINUS_OP:case a.W$.PLUS_OP:case a.W$.TIMES_OP:case a.W$.DIV_OP:case a.W$.POWER_OP:er(e.left,t,r,!0),er(e.right,t,r,!0);return;case a.W$.PARENTHESIS:er(e.expression,t,r,i);return;case a.W$.FUNCTION_CALL:{let i=!t.doesFunctionNeedArgumentToBeComputed(e.procedureName);e.args.forEach(e=>er(e,t,r,i));return}}},ei=(e,t)=>{let r=[];return er(e,t,r,!0),r};var en=r(58485);class eo{constructor(e){this.dependency=e}absolutize(e){return this.dependency.toSimpleCellAddress(e)}}class es{constructor(e,t){this.start=e,this.end=t}absolutize(e){return new en.gG(this.start.toSimpleCellAddress(e),this.end.toSimpleCellAddress(e))}}class ea{constructor(e,t){this.start=e,this.end=t}absolutize(e){let t=this.start.toSimpleColumnAddress(e),r=this.end.toSimpleColumnAddress(e);return new en.CZ(t.sheet,t.col,r.col)}}
134class el{constructor(e,t){this.start=e,this.end=t}absolutize(e){let t=this.start.toSimpleRowAddress(e),r=this.end.toSimpleRowAddress(e);return new en.W9(t.sheet,t.row,r.row)}}class eh{constructor(e){this.name=e}absolutize(e){return this}}},5905:function(e,t,r){"use strict";r.d(t,{Bx:function(){return f},JM:function(){return w},LK:function(){return h},Nm:function(){return u},PO:function(){return m},Qh:function(){return o},Qm:function(){return c},bR:function(){return n},g7:function(){return s},p:function(){return p},pt:function(){return i},ri:function(){return l},rm:function(){return d},vG:function(){return g},wZ:function(){return a},yV:function(){return y}});let i=":",n="$",o="\\s+",s="[ \\t\\n\\r]+",a="A-Za-z\xc0-ʯ",l=`${a}0-9_.`,h=`[${a}0-9_]+`,u=`(${h}|'(((?!').|'')*)')!`,c=`(${u})?\\${n}?[A-Za-z]+\\${n}?[0-9]+`,d=`(${u})?\\${n}?[A-Za-z]+`,g=`(${u})?\\${n}?[0-9]+`,p="[rR][0-9]*[cC][0-9]*",f=`(${c})[^${l}]`,m=`[${a}_][${l}]*`,y=["0","1","2","3","4","5","6","7","8","9"],w=[...Array.from(Array(26)).map((e,t)=>t+65),...Array.from(Array(26)).map((e,t)=>t+97),...Array.from(Array(496)).map((e,t)=>t+192)].map(e=>String.fromCharCode(e))},68724:function(e,t,r){"use strict";var i,n;r.d(t,{rW:function(){return s},wK:function(){return i},gy:function(){return o}}),(n=i||(i={})).BUILD_ENGINE_TOTAL="BUILD_ENGINE_TOTAL",n.PARSER="PARSER",n.GRAPH_BUILD="GRAPH_BUILD",n.COLLECT_DEPENDENCIES="COLLECT_DEPENDENCIES",n.PROCESS_DEPENDENCIES="PROCESS_DEPENDENCIES",n.TOP_SORT="TOP_SORT",n.BUILD_COLUMN_INDEX="BUILD_COLUMN_INDEX",n.EVALUATION="EVALUATION",n.VLOOKUP="VLOOKUP",n.TRANSFORM_ASTS="TRANSFORM_ASTS",n.TRANSFORM_ASTS_POSTPONED="TRANSFORM_ASTS_POSTPONED",n.ADJUSTING_ADDRESS_MAPPING="ADJUSTING_ADDRESS_MAPPING",n.ADJUSTING_ARRAY_MAPPING="ADJUSTING_ARRAY_MAPPING",n.ADJUSTING_RANGES="ADJUSTING_RANGES",n.ADJUSTING_GRAPH="ADJUSTING_GRAPH",n.CRITERION_FUNCTION_FULL_CACHE_USED="CRITERION_FUNCTION_FULL_CACHE_USED",n.CRITERION_FUNCTION_PARTIAL_CACHE_USED="CRITERION_FUNCTION_PARTIAL_CACHE_USED";class o{constructor(){this.stats=new Map([[i.CRITERION_FUNCTION_FULL_CACHE_USED,0],[i.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0]]),this.startTimes=new Map}incrementCriterionFunctionFullCacheUsed(){var e;let t=(null!==(e=this.stats.get(i.CRITERION_FUNCTION_FULL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(i.CRITERION_FUNCTION_FULL_CACHE_USED,t)}incrementCriterionFunctionPartialCacheUsed(){var e;let t=(null!==(e=this.stats.get(i.CRITERION_FUNCTION_PARTIAL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(i.CRITERION_FUNCTION_PARTIAL_CACHE_USED,t)}reset(){this.stats.clear(),this.startTimes.clear(),this.stats.set(i.CRITERION_FUNCTION_FULL_CACHE_USED,0),this.stats.set(i.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0)}start(e){if(this.startTimes.get(e))throw Error(`Statistics ${e} already started`);this.startTimes.set(e,Date.now())}end(e){var t;let r=Date.now(),i=this.startTimes.get(e);if(i){let n=null!==(t=this.stats.get(e))&&void 0!==t?t:0;n+=r-i,this.stats.set(e,n),this.startTimes.delete(e)}else throw Error(`Statistics ${e} not started`)}measure(e,t){this.start(e);let r=t();return this.end(e),r}snapshot(){return new Map(this.stats)}}class s extends o{incrementCriterionFunctionFullCacheUsed(){}incrementCriterionFunctionPartialCacheUsed(){}start(e){}end(e){}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.