handsontable 13.1.0-next-f6ea50b-20230811 → 13.1.0-next-28622ff-20230818

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Handsontable",[],t):"object"==typeof exports?exports.Handsontable=t():e.Handsontable=t()}("undefined"!=typeof self?self:this,(()=>(()=>{var e=[(e,t,r)=>{"use strict";r.r(t),r.d(t,{AlwaysDense:()=>a.AlwaysDense,AlwaysSparse:()=>a.AlwaysSparse,ArraySize:()=>n.ArraySize,CellError:()=>s.CellError,CellType:()=>s.CellType,CellValueDetailedType:()=>s.CellValueDetailedType,CellValueType:()=>s.CellValueType,ConfigValueTooBigError:()=>l.ConfigValueTooBigError,ConfigValueTooSmallError:()=>l.ConfigValueTooSmallError,DenseSparseChooseBasedOnThreshold:()=>a.DenseSparseChooseBasedOnThreshold,DetailedCellError:()=>o.DetailedCellError,ErrorType:()=>s.ErrorType,EvaluationSuspendedError:()=>l.EvaluationSuspendedError,ExpectedOneOfValuesError:()=>l.ExpectedOneOfValuesError,ExpectedValueOfTypeError:()=>l.ExpectedValueOfTypeError,ExportedCellChange:()=>u.ExportedCellChange,ExportedNamedExpressionChange:()=>u.ExportedNamedExpressionChange,FunctionArgumentType:()=>d.FunctionArgumentType,FunctionPlugin:()=>d.FunctionPlugin,FunctionPluginValidationError:()=>l.FunctionPluginValidationError,HyperFormula:()=>h.HyperFormula,InvalidAddressError:()=>l.InvalidAddressError,InvalidArgumentsError:()=>l.InvalidArgumentsError,LanguageAlreadyRegisteredError:()=>l.LanguageAlreadyRegisteredError,LanguageNotRegisteredError:()=>l.LanguageNotRegisteredError,MissingTranslationError:()=>l.MissingTranslationError,NamedExpressionDoesNotExistError:()=>l.NamedExpressionDoesNotExistError,NamedExpressionNameIsAlreadyTakenError:()=>l.NamedExpressionNameIsAlreadyTakenError,NamedExpressionNameIsInvalidError:()=>l.NamedExpressionNameIsInvalidError,NoOperationToRedoError:()=>l.NoOperationToRedoError,NoOperationToUndoError:()=>l.NoOperationToUndoError,NoRelativeAddressesAllowedError:()=>l.NoRelativeAddressesAllowedError,NoSheetWithIdError:()=>l.NoSheetWithIdError,NoSheetWithNameError:()=>l.NoSheetWithNameError,NotAFormulaError:()=>l.NotAFormulaError,NothingToPasteError:()=>l.NothingToPasteError,ProtectedFunctionTranslationError:()=>l.ProtectedFunctionTranslationError,SheetNameAlreadyTakenError:()=>l.SheetNameAlreadyTakenError,SheetSizeLimitExceededError:()=>l.SheetSizeLimitExceededError,SimpleRangeValue:()=>g.SimpleRangeValue,SourceLocationHasArrayError:()=>l.SourceLocationHasArrayError,TargetLocationHasArrayError:()=>l.TargetLocationHasArrayError,UnableToParseError:()=>l.UnableToParseError,default:()=>y});var n=r(1),s=r(3),o=r(98),i=r(99),a=r(103),l=r(77),u=r(126),h=r(108),c=r(144),d=r(145),p=r(146),g=r(69);class m extends h.HyperFormula{}m.HyperFormula=h.HyperFormula,m.ErrorType=s.ErrorType,m.CellError=s.CellError,m.CellType=s.CellType,m.CellValueType=s.CellValueType,m.CellValueDetailedType=s.CellValueDetailedType,m.DetailedCellError=o.DetailedCellError,m.ExportedCellChange=u.ExportedCellChange,m.ExportedNamedExpressionChange=u.ExportedNamedExpressionChange,m.ConfigValueTooBigError=l.ConfigValueTooBigError,m.ConfigValueTooSmallError=l.ConfigValueTooSmallError,m.EvaluationSuspendedError=l.EvaluationSuspendedError,m.ExpectedOneOfValuesError=l.ExpectedOneOfValuesError,m.ExpectedValueOfTypeError=l.ExpectedValueOfTypeError,m.ArraySize=n.ArraySize,m.SimpleRangeValue=g.SimpleRangeValue,m.FunctionPlugin=d.FunctionPlugin,m.FunctionArgumentType=d.FunctionArgumentType,m.FunctionPluginValidationError=l.FunctionPluginValidationError,m.InvalidAddressError=l.InvalidAddressError,m.InvalidArgumentsError=l.InvalidArgumentsError,m.LanguageNotRegisteredError=l.LanguageNotRegisteredError,m.LanguageAlreadyRegisteredError=l.LanguageAlreadyRegisteredError,m.MissingTranslationError=l.MissingTranslationError,m.NamedExpressionDoesNotExistError=l.NamedExpressionDoesNotExistError,m.NamedExpressionNameIsAlreadyTakenError=l.NamedExpressionNameIsAlreadyTakenError,m.NamedExpressionNameIsInvalidError=l.NamedExpressionNameIsInvalidError,m.NoOperationToRedoError=l.NoOperationToRedoError,m.NoOperationToUndoError=l.NoOperationToUndoError,m.NoRelativeAddressesAllowedError=l.NoRelativeAddressesAllowedError,m.NoSheetWithIdError=l.NoSheetWithIdError,m.NoSheetWithNameError=l.NoSheetWithNameError,m.NotAFormulaError=l.NotAFormulaError,m.NothingToPasteError=l.NothingToPasteError,m.ProtectedFunctionTranslationError=l.ProtectedFunctionTranslationError,m.SheetNameAlreadyTakenError=l.SheetNameAlreadyTakenError,m.SheetSizeLimitExceededError=l.SheetSizeLimitExceededError,m.SourceLocationHasArrayError=l.SourceLocationHasArrayError,m.TargetLocationHasArrayError=l.TargetLocationHasArrayError,m.UnableToParseError=l.UnableToParseError;const f=i.Config.defaultConfig.language;h.HyperFormula.registerLanguage(f,c.default),h.HyperFormula.languages[c.default.langCode]=c.default;for(const e of Object.getOwnPropertyNames(p))e.startsWith("_")||h.HyperFormula.registerFunctionPlugin(p[e]);const y=m;window.HyperFormula=r(0).default},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArraySize:()=>a,ArraySizePredictor:()=>l});var n=r(2),s=r(93),o=r(94),i=r(7);class a{constructor(e,t,r=!1){if(this.width=e,this.height=t,this.isRef=r,e<=0||t<=0)throw Error("Incorrect array size")}static fromArray(e){return new a(e.length>0?e[0].length:0,e.length)}static error(){return new a(1,1,!0)}static scalar(){return new a(1,1,!1)}isScalar(){return this.width<=1&&this.height<=1||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 i.AstNodeType.FUNCTION_CALL:return this.checkArraySizeForFunction(e,t);case i.AstNodeType.COLUMN_RANGE:case i.AstNodeType.ROW_RANGE:case i.AstNodeType.CELL_RANGE:{const r=n.AbsoluteCellRange.fromAstOrUndef(e,t.formulaAddress);return void 0===r?a.error():new a(r.width(),r.height(),!0)}case i.AstNodeType.ARRAY:{const r=[],n=[];for(const s of e.args){const e=s.map((e=>this.checkArraySizeForAst(e,t))),o=Math.min(...e.map((e=>e.height))),i=e.reduce(((e,t)=>e+t.width),0);r.push(o),n.push(i)}const s=r.reduce(((e,t)=>e+t),0),o=Math.min(...n);return new a(o,s)}case i.AstNodeType.STRING:case i.AstNodeType.NUMBER:return a.scalar();case i.AstNodeType.CELL_REFERENCE:return new a(1,1,!0);case i.AstNodeType.DIV_OP:case i.AstNodeType.CONCATENATE_OP:case i.AstNodeType.EQUALS_OP:case i.AstNodeType.GREATER_THAN_OP:case i.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case i.AstNodeType.LESS_THAN_OP:case i.AstNodeType.LESS_THAN_OR_EQUAL_OP:case i.AstNodeType.MINUS_OP:case i.AstNodeType.NOT_EQUAL_OP:case i.AstNodeType.PLUS_OP:case i.AstNodeType.POWER_OP:case i.AstNodeType.TIMES_OP:{const r=this.checkArraySizeForAst(e.left,t),n=this.checkArraySizeForAst(e.right,t);return!t.arraysFlag&&(r.height>1||r.width>1||n.height>1||n.width>1)?a.error():(s=r,o=n,new a(Math.max(s.width,o.width),Math.max(s.height,o.height)))}case i.AstNodeType.MINUS_UNARY_OP:case i.AstNodeType.PLUS_UNARY_OP:case i.AstNodeType.PERCENT_OP:{const n=this.checkArraySizeForAst(e.value,t);return!t.arraysFlag&&(n.height>1||n.width>1)?a.error():new a((r=n).width,r.height)}case i.AstNodeType.PARENTHESIS:return this.checkArraySizeForAst(e.expression,t);case i.AstNodeType.EMPTY:default:return a.error()}var r,s,o}checkArraySizeForFunction(e,t){const r=this.functionRegistry.getMetadata(e.procedureName),n=this.functionRegistry.getArraySizeFunction(e.procedureName);if(void 0!==n)return n(e,t);const i=e.args.map((e=>{var n;return this.checkArraySizeForAst(e,new s.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))}));if(void 0===r||r.expandRanges||!t.arraysFlag||r.vectorizationForbidden||void 0===r.parameters)return new a(1,1);const l=[...r.parameters];if(void 0===r.repeatLastArgs&&l.length<i.length)return a.error();if(void 0!==r.repeatLastArgs&&l.length<i.length&&(i.length-l.length)%r.repeatLastArgs!=0)return a.error();for(;l.length<i.length;)l.push(...l.slice(l.length-r.repeatLastArgs));let u=1,h=1;for(let e=0;e<i.length;e++)l[e].argumentType!==o.FunctionArgumentType.RANGE&&l[e].argumentType!==o.FunctionArgumentType.ANY&&(h=Math.max(h,i[e].height),u=Math.max(u,i[e].width));return new a(u,h)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbsoluteCellRange:()=>h,AbsoluteColumnRange:()=>c,AbsoluteRowRange:()=>d,WRONG_RANGE_SIZE:()=>a,isSimpleCellRange:()=>l,simpleCellRange:()=>u});var n=r(3),s=r(77),o=r(7),i=r(71);const a="AbsoluteCellRange: Wrong range size";function l(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&("start"in e&&(0,n.isSimpleCellAddress)(e.start)&&"end"in e&&(0,n.isSimpleCellAddress)(e.end))}const u=(e,t)=>({start:e,end:t});class h{constructor(e,t){if(e.sheet!==t.sheet)throw new s.SheetsNotEqual(e.sheet,t.sheet);this.start=(0,n.simpleCellAddress)(e.sheet,e.col,e.row),this.end=(0,n.simpleCellAddress)(t.sheet,t.col,t.row)}get sheet(){return this.start.sheet}static fromSimpleCellAddresses(e,t){if(e.sheet!==t.sheet)throw new s.SheetsNotEqual(e.sheet,t.sheet);const r=t.col-e.col,n=t.row-e.row;return Number.isFinite(n)&&Number.isFinite(r)?new h(e,t):Number.isFinite(n)?new d(e.sheet,e.row,t.row):new c(e.sheet,e.col,t.col)}static fromAst(e,t){return e.type===o.AstNodeType.CELL_RANGE?h.fromCellRange(e,t):e.type===o.AstNodeType.COLUMN_RANGE?c.fromColumnRange(e,t):d.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){const n=h.spanFromOrUndef(e,t,r);if(void 0===n)throw new Error(a);return n}static spanFromOrUndef(e,t,r){if(!Number.isFinite(t)&&Number.isFinite(r)){if(0!==e.col)return;return new d(e.sheet,e.row,e.row+r-1)}if(!Number.isFinite(r)&&Number.isFinite(t)){if(0!==e.row)return;return new c(e.sheet,e.col,e.col+t-1)}if(Number.isFinite(r)&&Number.isFinite(t))return new h(e,(0,n.simpleCellAddress)(e.sheet,e.col+t-1,e.row+r-1))}static fromCoordinates(e,t,r,s,o){return new h((0,n.simpleCellAddress)(e,t,r),(0,n.simpleCellAddress)(e,s,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;const t=Math.max(this.start.row,e.start.row),r=Math.min(this.end.row,e.end.row),s=Math.max(this.start.col,e.start.col),o=Math.min(this.end.col,e.end.col);return t>r||s>o?void 0:new h((0,n.simpleCellAddress)(this.sheet,s,t),(0,n.simpleCellAddress)(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,n.simpleCellAddress)(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 i.RowsSpan?this.removeRows(e.start,e.end):this.removeColumns(e.start,e.end)}shouldBeRemoved(){return this.width()<=0||this.height()<=0}rangeWithSameWidth(e,t){return h.spanFrom((0,n.simpleCellAddress)(this.sheet,this.start.col,e),this.width(),t)}rangeWithSameHeight(e,t){return h.spanFrom((0,n.simpleCellAddress)(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(){const e=[];for(let t=0;t<this.height();++t){e[t]=[];for(let r=0;r<this.width();++r){const s=(0,n.simpleCellAddress)(this.sheet,this.start.col+r,this.start.row+t);e[t].push(s)}}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,n.equalSimpleCellAddress)(this.start,e.start)&&(0,n.equalSimpleCellAddress)(this.end,e.end)}addressesArrayMap(e,t){const r=[];let s=this.start.row;for(;s<=this.effectiveEndRow(e);){let o=this.start.col;const i=[];for(;o<=this.effectiveEndColumn(e);)i.push(t((0,n.simpleCellAddress)(this.start.sheet,o,s))),o++;r.push(i),s++}return r}addresses(e){const t=[];let r=this.start.row;const s=this.effectiveEndRow(e),o=this.effectiveEndColumn(e);for(;r<=s;){let e=this.start.col;for(;e<=o;)t.push((0,n.simpleCellAddress)(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,n.simpleCellAddress)(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,n.simpleCellAddress)(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,n.simpleCellAddress)(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,n.simpleCellAddress)(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,n.simpleCellAddress)(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){const r=t-e+1;return this.shiftByRows(-r)}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){const r=t-e+1;return this.shiftByColumns(-r)}e<=this.start.col&&(this.start.col=e),this.end.col-=Math.min(t,this.end.col)-e+1}}}class c extends h{constructor(e,t,r){super((0,n.simpleCellAddress)(e,t,0),(0,n.simpleCellAddress)(e,r,Number.POSITIVE_INFINITY))}static fromColumnRange(e,t){const r=e.start.toSimpleColumnAddress(t),n=e.end.toSimpleColumnAddress(t);if(r.sheet!==n.sheet)throw new s.SheetsNotEqual(r.sheet,n.sheet);return new c(r.sheet,r.col,n.col)}shouldBeRemoved(){return this.width()<=0}shiftByRows(e){}expandByRows(e){}shifted(e,t){return new c(this.sheet,this.start.col+e,this.end.col+e)}rangeWithSameHeight(e,t){return new c(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 d extends h{constructor(e,t,r){super((0,n.simpleCellAddress)(e,0,t),(0,n.simpleCellAddress)(e,Number.POSITIVE_INFINITY,r))}static fromRowRangeAst(e,t){const r=e.start.toSimpleRowAddress(t),n=e.end.toSimpleRowAddress(t);if(r.sheet!==n.sheet)throw new s.SheetsNotEqual(r.sheet,n.sheet);return new d(r.sheet,r.row,n.row)}shouldBeRemoved(){return this.height()<=0}shiftByColumns(e){}expandByColumns(e){}shifted(e,t){return new d(this.sheet,this.start.row+t,this.end.row+t)}rangeWithSameWidth(e,t){return new d(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){}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CellError:()=>E,CellType:()=>s,CellValueDetailedType:()=>p,CellValueJustNumber:()=>c,CellValueNoNumber:()=>h,CellValueType:()=>d,CellValueTypeOrd:()=>g,ErrorType:()=>n,absoluteSheetReference:()=>M,addressKey:()=>N,equalSimpleCellAddress:()=>b,getCellType:()=>u,getCellValueDetailedType:()=>f,getCellValueFormat:()=>y,getCellValueType:()=>m,invalidSimpleCellAddress:()=>v,invalidSimpleColumnAddress:()=>w,invalidSimpleRowAddress:()=>T,isSimpleCellAddress:()=>O,movedSimpleCellAddress:()=>A,simpleCellAddress:()=>S,simpleColumnAddress:()=>R,simpleRowAddress:()=>C});var n,s,o=r(4),i=r(61),a=r(70),l=r(69);!function(e){e.DIV_BY_ZERO="DIV_BY_ZERO",e.NAME="NAME",e.VALUE="VALUE",e.NUM="NUM",e.NA="NA",e.CYCLE="CYCLE",e.REF="REF",e.SPILL="SPILL",e.LIC="LIC",e.ERROR="ERROR"}(n||(n={})),function(e){e.FORMULA="FORMULA",e.VALUE="VALUE",e.ARRAY="ARRAY",e.EMPTY="EMPTY",e.ARRAYFORMULA="ARRAYFORMULA"}(s||(s={}));const u=(e,t)=>e instanceof o.ArrayVertex?e.isLeftCorner(t)?s.ARRAYFORMULA:s.ARRAY:e instanceof o.FormulaCellVertex||e instanceof o.ParsingErrorVertex?s.FORMULA:e instanceof o.ValueCellVertex?s.VALUE:s.EMPTY;var h,c;!function(e){e.EMPTY="EMPTY",e.NUMBER="NUMBER",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.ERROR="ERROR"}(h||(h={})),function(e){e.NUMBER="NUMBER"}(c||(c={}));const d=Object.assign(Object.assign({},h),c),p=Object.assign(Object.assign({},h),a.NumberType),g=e=>{switch(e){case d.EMPTY:return 0;case d.NUMBER:return 1;case d.STRING:return 2;case d.BOOLEAN:return 3;case d.ERROR:return 4}throw new Error("Cell value not computed")},m=e=>{if(e===a.EmptyValue)return d.EMPTY;if(e instanceof E||e instanceof l.SimpleRangeValue)return d.ERROR;if("string"==typeof e)return d.STRING;if((0,a.isExtendedNumber)(e))return d.NUMBER;if("boolean"==typeof e)return d.BOOLEAN;throw new Error("Cell value not computed")},f=e=>(0,a.isExtendedNumber)(e)?(0,a.getTypeOfExtendedNumber)(e):m(e),y=e=>(0,a.isExtendedNumber)(e)?(0,a.getFormatOfExtendedNumber)(e):void 0;class E{constructor(e,t,r){this.type=e,this.message=t,this.root=r}static parsingError(){return new E(n.ERROR,i.ErrorMessage.ParseError)}attachRootVertex(e){return void 0===this.root?new E(this.type,this.message,e):this}}const C=(e,t)=>({sheet:e,row:t}),T=e=>e.row<0,R=(e,t)=>({sheet:e,col:t}),w=e=>e.col<0,S=(e,t,r)=>({sheet:e,col:t,row:r}),v=e=>e.col<0||e.row<0,A=(e,t,r,n)=>S(t,e.col+r,e.row+n),N=e=>`${e.sheet},${e.row},${e.col}`;function O(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&("col"in e&&"number"==typeof e.col&&"row"in e&&"number"==typeof e.row&&"sheet"in e&&"number"==typeof e.sheet)}const M=(e,t)=>{var r;return null!==(r=e.sheet)&&void 0!==r?r:t.sheet},b=(e,t)=>e.sheet===t.sheet&&e.col===t.col&&e.row===t.row},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressMapping:()=>s.AddressMapping,ArrayMapping:()=>l.ArrayMapping,ArrayVertex:()=>u.ArrayVertex,DenseStrategy:()=>m.DenseStrategy,DependencyGraph:()=>n.DependencyGraph,EmptyCellVertex:()=>h.EmptyCellVertex,FormulaCellVertex:()=>u.FormulaCellVertex,Graph:()=>o.Graph,ParsingErrorVertex:()=>d.ParsingErrorVertex,RangeMapping:()=>i.RangeMapping,RangeVertex:()=>p.RangeVertex,SheetMapping:()=>a.SheetMapping,SparseStrategy:()=>g.SparseStrategy,ValueCellVertex:()=>c.ValueCellVertex});var n=r(5),s=r(76),o=r(83),i=r(84),a=r(85),l=r(78),u=r(80),h=r(88),c=r(89),d=r(90),p=r(82),g=r(91),m=r(92)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DependencyGraph:()=>R});var n=r(2),s=r(6),o=r(3),i=r(68),a=r(61),l=r(70),u=r(69),h=r(7),c=r(71),d=r(72),p=r(4),g=r(76),m=r(78),f=r(79),y=r(80),E=r(83),C=r(84),T=r(85);class R{constructor(e,t,r,a,l,u,c,d){this.addressMapping=e,this.rangeMapping=t,this.sheetMapping=r,this.arrayMapping=a,this.stats=l,this.lazilyTransformingAstService=u,this.functionRegistry=c,this.namedExpressions=d,this.changes=i.ContentChanges.empty(),this.dependencyQueryAddresses=e=>{if(e instanceof p.RangeVertex)return this.rangeDependencyQuery(e).map((([e,t])=>e));{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,r]=t;return r.map((t=>t instanceof h.NamedExpressionDependency?this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet).address:(0,o.isSimpleCellAddress)(t)?t:(0,n.simpleCellRange)(t.start,t.end)))}return[]}},this.dependencyQueryVertices=e=>{if(e instanceof p.RangeVertex)return this.rangeDependencyQuery(e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,r]=t;return r.map((t=>{if(t instanceof n.AbsoluteCellRange)return[t.start,this.rangeMapping.fetchRange(t.start,t.end)];if(t instanceof h.NamedExpressionDependency){const r=this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet);return[r.address,this.addressMapping.fetchCell(r.address)]}return[t,this.addressMapping.fetchCell(t)]}))}return[]}},this.rangeDependencyQuery=e=>{const t=[],{smallerRangeVertex:r,restRange:s}=this.rangeMapping.findSmallerRange(e.range);let o;void 0!==r&&this.graph.adjacentNodes(r).has(e)?(o=s,t.push([new n.AbsoluteCellRange(r.start,r.end),r])):o=e.range;for(const e of o.addresses(this)){const r=this.addressMapping.getCell(e);void 0!==r&&t.push([e,r])}return t},this.formulaDependencyQuery=e=>{let t,r;if(!(e instanceof y.FormulaVertex))return;r=e.getAddress(this.lazilyTransformingAstService),t=e.getFormula(this.lazilyTransformingAstService);const n=(0,h.collectDependencies)(t,this.functionRegistry);return[r,(0,s.absolutizeDependencies)(n,r)]},this.graph=new E.Graph(this.dependencyQueryVertices)}static buildEmpty(e,t,r,n,s){return new R(new g.AddressMapping(t.chooseAddressMappingPolicy),new C.RangeMapping,new T.SheetMapping(t.translationPackage),new m.ArrayMapping,s,e,r,n)}setFormulaToCell(e,t,r,n,s,o){const i=y.FormulaVertex.fromAst(t,e,n,this.lazilyTransformingAstService.version());return this.exchangeOrAddFormulaVertex(i),this.processCellDependencies(r,i),this.graph.markNodeAsSpecialRecentlyChanged(i),s&&this.markAsVolatile(i),o&&this.markAsDependentOnStructureChange(i),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setParsingErrorToCell(e,t){const r=this.shrinkPossibleArrayAndGetCell(e);return this.exchangeOrAddGraphNode(r,t),this.addressMapping.setCell(e,t),this.graph.markNodeAsSpecialRecentlyChanged(t),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setValueToCell(e,t){const r=this.shrinkPossibleArrayAndGetCell(e);if(r instanceof p.ArrayVertex&&this.arrayMapping.removeArray(r.getRange()),r instanceof p.ValueCellVertex){r.getValues().rawValue!==t.rawValue&&(r.setValues(t),this.graph.markNodeAsSpecialRecentlyChanged(r))}else{const n=new p.ValueCellVertex(t.parsedValue,t.rawValue);this.exchangeOrAddGraphNode(r,n),this.addressMapping.setCell(e,n),this.graph.markNodeAsSpecialRecentlyChanged(n)}return this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setCellEmpty(e){const t=this.shrinkPossibleArrayAndGetCell(e);if(void 0===t)return i.ContentChanges.empty();if(this.graph.adjacentNodes(t).size>0){const r=new p.EmptyCellVertex;this.exchangeGraphNode(t,r),0===this.graph.adjacentNodesCount(r)?(this.removeVertex(r),this.addressMapping.removeCell(e)):(this.graph.markNodeAsSpecialRecentlyChanged(r),this.addressMapping.setCell(e,r))}else this.removeVertex(t),this.addressMapping.removeCell(e);return this.getAndClearContentChanges()}ensureThatVertexIsNonArrayCellVertex(e){if(e instanceof p.ArrayVertex)throw new Error("Illegal operation")}clearRecentlyChangedVertices(){this.graph.clearSpecialNodesRecentlyChanged()}verticesToRecompute(){return new Set([...this.graph.specialNodesRecentlyChanged,...this.volatileVertices()])}processCellDependencies(e,t){e.forEach((e=>{if(e instanceof n.AbsoluteCellRange){const r=e;let n=this.getRange(r.start,r.end);void 0===n&&(n=new p.RangeVertex(r),this.rangeMapping.setRange(n)),this.graph.addNode(n),r.isFinite()||this.graph.markNodeAsInfiniteRange(n);const{smallerRangeVertex:s,restRange:o}=this.rangeMapping.findSmallerRange(r);if(void 0!==s){if(this.graph.addEdge(s,n),n.bruteForce){n.bruteForce=!1;for(const e of r.addresses(this))this.graph.removeEdge(this.fetchCell(e),n)}}else n.bruteForce=!0;const i=this.arrayMapping.getArray(o);if(void 0!==i)this.graph.addEdge(i,n);else for(const e of o.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(e),n);this.graph.addEdge(n,t),r.isFinite()&&this.correctInfiniteRangesDependenciesByRangeVertex(n)}else if(e instanceof h.NamedExpressionDependency){const r=t.getAddress(this.lazilyTransformingAstService).sheet,n=this.fetchNamedExpressionVertex(e.name,r);this.graph.addEdge(n,t)}else this.graph.addEdge(this.fetchCellOrCreateEmpty(e),t)}))}fetchNamedExpressionVertex(e,t){const r=this.namedExpressions.namedExpressionOrPlaceholder(e,t);return this.fetchCellOrCreateEmpty(r.address)}exchangeNode(e,t){const r=this.fetchCellOrCreateEmpty(e),n=this.fetchCellOrCreateEmpty(t);this.addressMapping.removeCell(e),this.exchangeGraphNode(r,n)}correctInfiniteRangesDependency(e){let t;for(const r of this.graph.infiniteRanges){const n=r;n.range.addressInRange(e)&&(t=null!=t?t:this.fetchCellOrCreateEmpty(e),this.graph.addEdge(t,n))}}fetchCellOrCreateEmpty(e){let t=this.addressMapping.getCell(e);return void 0===t&&(t=new p.EmptyCellVertex,this.graph.addNode(t),this.addressMapping.setCell(e,t)),t}removeRows(e){this.stats.measure(d.StatType.ADJUSTING_GRAPH,(()=>{for(const[t,r]of this.addressMapping.entriesFromRowsSpan(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsSpecialRecentlyChanged(e);if(r instanceof p.ArrayVertex){if(!r.isLeftCorner(t))continue;this.shrinkArrayToCorner(r),this.arrayMapping.removeArray(r.getRange())}this.removeVertex(r)}})),this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeRows(e)}));const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.truncateRanges(e,(e=>e.row));return this.getArrayVerticesRelatedToRanges(t)}));return this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,(()=>{this.fixArraysAfterRemovingRows(e.sheet,e.rowStart,e.numberOfRows)})),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}removeSheet(e){this.clearSheet(e);for(const[t,r]of this.addressMapping.sheetEntries(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsSpecialRecentlyChanged(e);this.removeVertex(r),this.addressMapping.removeCell(t)}this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.removeRangesInSheet(e);for(const e of t)this.removeVertex(e);this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeSheet(e)}))}))}clearSheet(e){const t=new Set;for(const[r,n]of this.addressMapping.sheetEntries(e))n instanceof p.ArrayVertex?t.add(n):this.setCellEmpty(r);for(const e of t.values())this.setArrayEmpty(e);this.addStructuralNodesToChangeSet()}removeColumns(e){this.stats.measure(d.StatType.ADJUSTING_GRAPH,(()=>{for(const[t,r]of this.addressMapping.entriesFromColumnsSpan(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsSpecialRecentlyChanged(e);if(r instanceof p.ArrayVertex){if(!r.isLeftCorner(t))continue;this.shrinkArrayToCorner(r),this.arrayMapping.removeArray(r.getRange())}this.removeVertex(r)}})),this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeColumns(e)}));const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.truncateRanges(e,(e=>e.col));return this.getArrayVerticesRelatedToRanges(t)}));return this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,(()=>this.fixArraysAfterRemovingColumns(e.sheet,e.columnStart,e.numberOfColumns))),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}addRows(e){this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.addRows(e.sheet,e.rowStart,e.numberOfRows)}));const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterRowByRows(e.sheet,e.rowStart,e.numberOfRows);return this.fixRangesWhenAddingRows(e.sheet,e.rowStart,e.numberOfRows),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)}));this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,(()=>{this.fixArraysAfterAddingRow(e.sheet,e.rowStart,e.numberOfRows)}));for(const t of this.addressMapping.verticesFromRowsSpan(e))this.graph.markNodeAsSpecialRecentlyChanged(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t}}addColumns(e){this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.addColumns(e.sheet,e.columnStart,e.numberOfColumns)}));const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterColumnByColumns(e.sheet,e.columnStart,e.numberOfColumns);return this.fixRangesWhenAddingColumns(e.sheet,e.columnStart,e.numberOfColumns),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)}));this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,(()=>this.fixArraysAfterAddingColumn(e.sheet,e.columnStart,e.numberOfColumns)));for(const t of this.addressMapping.verticesFromColumnsSpan(e))this.graph.markNodeAsSpecialRecentlyChanged(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}ensureNoArrayInRange(e){if(this.arrayMapping.isFormulaArrayInRange(e))throw Error("It is not possible to move / replace cells with array")}isThereSpaceForArray(e){const t=e.getRangeOrUndef();if(void 0===t)return!1;for(const r of t.addresses(this)){const t=this.addressMapping.getCell(r);if(void 0!==t&&!(t instanceof p.EmptyCellVertex)&&t!==e)return!1}return!0}moveCells(e,t,r,n){for(const s of e.addressesWithDirection(t,r,this)){const i=(0,o.simpleCellAddress)(n,s.col+t,s.row+r);let a=this.addressMapping.getCell(s);const l=this.addressMapping.getCell(i);if(this.addressMapping.removeCell(s),void 0!==a){let t;this.graph.markNodeAsSpecialRecentlyChanged(a),this.addressMapping.setCell(i,a);for(const r of this.graph.adjacentNodes(a))r instanceof p.RangeVertex&&!e.containsRange(r.range)&&(t=null!=t?t:this.fetchCellOrCreateEmpty(s),this.graph.addEdge(t,r),this.graph.removeEdge(a,r));t&&(this.graph.markNodeAsSpecialRecentlyChanged(t),this.addressMapping.setCell(s,t))}if(void 0!==l){void 0===a&&this.addressMapping.removeCell(i);for(const e of this.graph.adjacentNodes(l))a=null!=a?a:this.fetchCellOrCreateEmpty(i),this.graph.addEdge(a,e),this.graph.markNodeAsSpecialRecentlyChanged(a);this.removeVertex(l)}}for(const t of this.rangeMapping.rangeVerticesContainedInRange(e))for(const r of this.graph.adjacentNodes(t))if(r instanceof p.RangeVertex&&!e.containsRange(r.range)){this.graph.removeEdge(t,r);for(const e of t.range.addresses(this)){const t=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(t,r),this.addressMapping.setCell(e,t),this.graph.markNodeAsSpecialRecentlyChanged(t)}}this.rangeMapping.moveRangesInsideSourceRange(e,t,r,n)}setArrayEmpty(e){const t=n.AbsoluteCellRange.spanFrom(e.getAddress(this.lazilyTransformingAstService),e.width,e.height),r=this.graph.adjacentNodes(e);for(const e of t.addresses(this))this.addressMapping.removeCell(e);for(const t of r.values()){const r=(0,f.collectAddressesDependentToRange)(this.functionRegistry,t,e.getRange(),this.lazilyTransformingAstService,this);for(const e of r){const r=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(r,t)}r.length>0&&this.graph.markNodeAsSpecialRecentlyChanged(t)}this.removeVertex(e),this.arrayMapping.removeArray(e.getRange())}addVertex(e,t){this.graph.addNode(t),this.addressMapping.setCell(e,t)}addArrayVertex(e,t){this.graph.addNode(t),this.setAddressMappingForArrayVertex(t,e)}*arrayFormulaNodes(){for(const e of this.graph.nodes)e instanceof p.ArrayVertex&&(yield e)}*entriesFromRowsSpan(e){yield*this.addressMapping.entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.addressMapping.entriesFromColumnsSpan(e)}existsVertex(e){return this.addressMapping.has(e)}fetchCell(e){return this.addressMapping.fetchCell(e)}getCell(e){return this.addressMapping.getCell(e)}getCellValue(e){return this.addressMapping.getCellValue(e)}getRawValue(e){return this.addressMapping.getRawValue(e)}getScalarValue(e){const t=this.addressMapping.getCellValue(e);return t instanceof u.SimpleRangeValue?new o.CellError(o.ErrorType.VALUE,a.ErrorMessage.ScalarExpected):t}existsEdge(e,t){return this.graph.existsEdge(e,t)}getSheetId(e){return this.sheetMapping.fetch(e)}getSheetHeight(e){return this.addressMapping.getHeight(e)}getSheetWidth(e){return this.addressMapping.getWidth(e)}getArray(e){return this.arrayMapping.getArray(e)}setArray(e,t){this.arrayMapping.setArray(e,t)}getRange(e,t){return this.rangeMapping.getRange(e,t)}topSortWithScc(){return this.graph.topSortWithScc()}markAsVolatile(e){this.graph.markNodeAsSpecial(e)}markAsDependentOnStructureChange(e){this.graph.markNodeAsChangingWithStructure(e)}forceApplyPostponedTransformations(){for(const e of this.graph.nodes.values())e instanceof p.FormulaCellVertex&&e.ensureRecentData(this.lazilyTransformingAstService)}volatileVertices(){return this.graph.specialNodes}getArrayVerticesRelatedToRanges(e){const t=e.map((e=>this.graph.hasNode(e)?Array.from(this.graph.adjacentNodes(e)).filter((e=>e instanceof p.ArrayVertex)):[]));return new Set(...t)}*rawValuesFromRange(e){for(const t of e.addresses(this)){const e=this.getScalarValue(t);e!==l.EmptyValue&&(yield[(0,l.getRawValue)(e),t])}}*entriesFromRange(e){for(const t of e.addresses(this))yield[t,this.getCell(t)]}exchangeGraphNode(e,t){this.graph.addNode(t);const r=this.graph.adjacentNodes(e);this.removeVertex(e),r.forEach((e=>{this.graph.hasNode(e)&&this.graph.addEdge(t,e)}))}exchangeOrAddGraphNode(e,t){e?this.exchangeGraphNode(e,t):this.graph.addNode(t)}computeListOfValuesInRange(e){const t=[];for(const r of e.addresses(this)){const e=this.getScalarValue(r);t.push(e)}return t}shrinkArrayToCorner(e){this.cleanAddressMappingUnderArray(e);for(const t of this.adjacentArrayVertices(e)){let r;r=t instanceof y.FormulaVertex?this.formulaDirectDependenciesToArray(t,e):this.rangeDirectDependenciesToArray(t,e);let n=!1;for(const[s,o]of r)e.isLeftCorner(s)&&(n=!0),this.graph.addEdge(o,t),this.graph.markNodeAsSpecialRecentlyChanged(o);n||this.graph.removeEdge(e,t)}this.graph.markNodeAsSpecialRecentlyChanged(e)}isArrayInternalCell(e){const t=this.getCell(e);return t instanceof p.ArrayVertex&&!t.isLeftCorner(e)}getAndClearContentChanges(){const e=this.changes;return this.changes=i.ContentChanges.empty(),e}getAdjacentNodesAddresses(e){const t=this.graph.adjacentNodes(e),r=[];return t.forEach((e=>{const t=e;t instanceof p.RangeVertex?r.push((0,n.simpleCellRange)(t.start,t.end)):r.push(t.getAddress(this.lazilyTransformingAstService))})),r}correctInfiniteRangesDependenciesByRangeVertex(e){for(const t of this.graph.infiniteRanges){const r=t,n=e.range.intersectionWith(r.range);if(void 0!==n)for(const e of n.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(e),t)}}cleanAddressMappingUnderArray(e){const t=e.getRange();for(const r of t.addresses(this)){const t=e.getArrayCellValue(r);this.getCell(r)===e?e.isLeftCorner(r)?this.changes.addChange(new o.CellError(o.ErrorType.REF),r,t):(this.addressMapping.removeCell(r),this.changes.addChange(l.EmptyValue,r,t)):this.changes.addChange(l.EmptyValue,r,t)}}*formulaDirectDependenciesToArray(e,t){var r;const[,s]=null!==(r=this.formulaDependencyQuery(e))&&void 0!==r?r:[];if(void 0!==s)for(const e of s)if(!(e instanceof h.NamedExpressionDependency||e instanceof n.AbsoluteCellRange)&&t.getRange().addressInRange(e)){const t=this.fetchCellOrCreateEmpty(e);yield[e,t]}}*rangeDirectDependenciesToArray(e,t){const{restRange:r}=this.rangeMapping.findSmallerRange(e.range);for(const e of r.addresses(this))if(t.getRange().addressInRange(e)){const t=this.fetchCellOrCreateEmpty(e);yield[e,t]}}*adjacentArrayVertices(e){const t=this.graph.adjacentNodes(e);for(const e of t)(e instanceof y.FormulaVertex||e instanceof p.RangeVertex)&&(yield e)}addStructuralNodesToChangeSet(){for(const e of this.graph.specialNodesStructuralChanges)this.graph.markNodeAsSpecialRecentlyChanged(e)}fixRangesWhenAddingRows(e,t,r){const s=Array.from(this.rangeMapping.rangesInSheet(e));for(const e of s)if(e.range.includesRow(t+r))if(e.bruteForce){const n=e.range.rangeWithSameWidth(t,r);for(const t of n.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(t),e)}else{let t=e,r=this.rangeMapping.findSmallerRange(t.range);if(void 0!==r.smallerRangeVertex)continue;for(;void 0===r.smallerRangeVertex;){const e=new p.RangeVertex(n.AbsoluteCellRange.spanFrom(t.range.start,t.range.width(),t.range.height()-1));this.rangeMapping.setRange(e),this.graph.addNode(e);const s=new n.AbsoluteCellRange((0,o.simpleCellAddress)(t.range.start.sheet,t.range.start.col,t.range.end.row),t.range.end);this.addAllFromRange(s,t),this.graph.addEdge(e,t),t=e,r=this.rangeMapping.findSmallerRange(t.range)}this.graph.addEdge(r.smallerRangeVertex,t),this.addAllFromRange(r.restRange,t),this.graph.removeEdge(r.smallerRangeVertex,e)}}addAllFromRange(e,t){for(const r of e.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(r),t)}fixRangesWhenAddingColumns(e,t,r){for(const s of this.rangeMapping.rangesInSheet(e))if(s.range.includesColumn(t+r)){let i;i=s.bruteForce?s.range.rangeWithSameHeight(t,r):n.AbsoluteCellRange.spanFrom((0,o.simpleCellAddress)(e,t,s.range.end.row),r,1);for(const e of i.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(e),s)}}exchangeOrAddFormulaVertex(e){const t=e.getAddress(this.lazilyTransformingAstService),r=n.AbsoluteCellRange.spanFrom(t,e.width,e.height),s=this.shrinkPossibleArrayAndGetCell(t);if(e instanceof p.ArrayVertex&&this.setArray(r,e),this.exchangeOrAddGraphNode(s,e),this.addressMapping.setCell(t,e),e instanceof p.ArrayVertex){if(!this.isThereSpaceForArray(e))return;for(const t of r.addresses(this)){if(e.isLeftCorner(t))continue;const r=this.getCell(t);this.exchangeOrAddGraphNode(r,e)}}for(const t of r.addresses(this))this.addressMapping.setCell(t,e)}setAddressMappingForArrayVertex(e,t){if(this.addressMapping.setCell(t,e),!(e instanceof p.ArrayVertex))return;const r=n.AbsoluteCellRange.spanFromOrUndef(t,e.width,e.height);if(void 0!==r&&(this.setArray(r,e),this.isThereSpaceForArray(e)))for(const t of r.addresses(this))this.addressMapping.setCell(t,e)}truncateRanges(e,t){const{verticesToRemove:r,verticesToMerge:n,verticesWithChangedSize:s}=this.rangeMapping.truncateRanges(e,t);for(const[e,t]of n)this.mergeRangeVertices(e,t);for(const e of r)this.removeVertexAndCleanupDependencies(e);return s}fixArraysAfterAddingRow(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,r),!(t<=0))for(const[,n]of this.arrayMapping.arraysInRows(c.RowsSpan.fromRowStartAndEnd(e,t-1,t-1))){const s=n.getRange();for(let i=s.start.col;i<=s.end.col;++i)for(let a=t;a<=s.end.row;++a){const t=(0,o.simpleCellAddress)(e,i,a),s=(0,o.simpleCellAddress)(e,i,a+r),u=n.getArrayCellValue(t);this.addressMapping.moveCell(s,t),this.changes.addChange(l.EmptyValue,s,u)}}}fixArraysAfterRemovingRows(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,-r),!(t<=0))for(const[,r]of this.arrayMapping.arraysInRows(c.RowsSpan.fromRowStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(const 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(const[,n]of this.arrayMapping.arraysInCols(c.ColumnsSpan.fromColumnStartAndEnd(e,t-1,t-1))){const s=n.getRange();for(let i=s.start.row;i<=s.end.row;++i)for(let a=t;a<=s.end.col;++a){const t=(0,o.simpleCellAddress)(e,a,i),s=(0,o.simpleCellAddress)(e,a+r,i),u=n.getArrayCellValue(t);this.addressMapping.moveCell(s,t),this.changes.addChange(l.EmptyValue,s,u)}}}fixArraysAfterRemovingColumns(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,-r),!(t<=0))for(const[,r]of this.arrayMapping.arraysInCols(c.ColumnsSpan.fromColumnStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(const e of r.getRange().addresses(this))this.addressMapping.setCell(e,r);else this.setNoSpaceIfArray(r)}shrinkPossibleArrayAndGetCell(e){const t=this.getCell(e);return t instanceof p.ArrayVertex?(this.setNoSpaceIfArray(t),this.getCell(e)):t}setNoSpaceIfArray(e){e instanceof p.ArrayVertex&&(this.shrinkArrayToCorner(e),e.setNoSpace())}removeVertex(e){this.removeVertexAndCleanupDependencies(e),e instanceof p.RangeVertex&&this.rangeMapping.removeRange(e)}mergeRangeVertices(e,t){const r=this.graph.adjacentNodes(t);this.removeVertexAndCleanupDependencies(t),this.graph.softRemoveEdge(e,t),r.forEach((t=>{this.graph.hasNode(t)&&this.graph.addEdge(e,t)}))}removeVertexAndCleanupDependencies(e){const t=new Set(this.graph.removeNode(e));for(;t.size>0;){const e=t.values().next().value;t.delete(e);const[r,n]=e;this.graph.hasNode(n)&&0===this.graph.adjacentNodesCount(n)&&((n instanceof p.RangeVertex||n instanceof p.EmptyCellVertex)&&this.graph.removeNode(n).forEach((e=>t.add(e))),n instanceof p.RangeVertex?this.rangeMapping.removeRange(n):n instanceof p.EmptyCellVertex&&this.addressMapping.removeCell(r))}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{absolutizeDependencies:()=>i,filterDependenciesOutOfScope:()=>a});var n=r(2),s=r(3),o=r(7);const i=(e,t)=>e.map((e=>e.absolutize(t))),a=e=>e.filter((e=>e instanceof o.NamedExpressionDependency||(e instanceof n.AbsoluteCellRange?!((0,s.invalidSimpleCellAddress)(e.start)||(0,s.invalidSimpleCellAddress)(e.end)):!(0,s.invalidSimpleCellAddress)(e))))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressDependency:()=>c.AddressDependency,AstNodeType:()=>u.AstNodeType,CellAddress:()=>s.CellAddress,CellRangeDependency:()=>c.CellRangeDependency,ColumnRangeDependency:()=>c.ColumnRangeDependency,FormulaLexer:()=>l.FormulaLexer,NamedExpressionDependency:()=>c.NamedExpressionDependency,ParserWithCaching:()=>o.ParserWithCaching,ParsingErrorType:()=>u.ParsingErrorType,RowRangeDependency:()=>c.RowRangeDependency,Unparser:()=>h.Unparser,buildCellErrorAst:()=>u.buildCellErrorAst,buildCellRangeAst:()=>u.buildCellRangeAst,buildLexerConfig:()=>a.buildLexerConfig,buildParsingErrorAst:()=>u.buildParsingErrorAst,buildProcedureAst:()=>u.buildProcedureAst,cellAddressFromString:()=>n.cellAddressFromString,collectDependencies:()=>i.collectDependencies,simpleCellAddressFromString:()=>n.simpleCellAddressFromString,simpleCellAddressToString:()=>n.simpleCellAddressToString,simpleCellRangeFromString:()=>n.simpleCellRangeFromString,simpleCellRangeToString:()=>n.simpleCellRangeToString});var n=r(8),s=r(9),o=r(13),i=r(66),a=r(62),l=r(60),u=r(57),h=r(65),c=r(67)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{cellAddressFromString:()=>p,columnAddressFromString:()=>g,columnIndexToLabel:()=>R,rowAddressFromString:()=>m,sheetIndexToString:()=>w,simpleCellAddressFromString:()=>f,simpleCellAddressToString:()=>E,simpleCellRangeFromString:()=>y,simpleCellRangeToString:()=>C});var n=r(2),s=r(3),o=r(9),i=r(10),a=r(12),l=r(11);const u=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([A-Za-z]+)(\\${a.ABSOLUTE_OPERATOR}?)([0-9]+)$`),h=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([A-Za-z]+)$`),c=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([0-9]+)$`),d=new RegExp(`^${a.UNQUOTED_SHEET_NAME_PATTERN}$`),p=(e,t,r)=>{const n=u.exec(t),s=T(n[6]);let i=S(n,e);if(void 0===i)return;null===i&&(i=void 0);const l=Number(n[8])-1;return n[5]===a.ABSOLUTE_OPERATOR&&n[7]===a.ABSOLUTE_OPERATOR?o.CellAddress.absolute(s,l,i):n[5]===a.ABSOLUTE_OPERATOR?o.CellAddress.absoluteCol(s,l-r.row,i):n[7]===a.ABSOLUTE_OPERATOR?o.CellAddress.absoluteRow(s-r.col,l,i):o.CellAddress.relative(s-r.col,l-r.row,i)},g=(e,t,r)=>{const n=h.exec(t);let s=S(n,e);if(void 0===s)return;null===s&&(s=void 0);const o=T(n[6]);return n[5]===a.ABSOLUTE_OPERATOR?i.ColumnAddress.absolute(o,s):i.ColumnAddress.relative(o-r.col,s)},m=(e,t,r)=>{const n=c.exec(t);let s=S(n,e);if(void 0===s)return;null===s&&(s=void 0);const o=Number(n[6])-1;return n[5]===a.ABSOLUTE_OPERATOR?l.RowAddress.absolute(o,s):l.RowAddress.relative(o-r.row,s)},f=(e,t,r)=>{const n=u.exec(t),o=T(n[6]);let i=S(n,e);if(void 0===i)return;null===i&&(i=r);const a=Number(n[8])-1;return(0,s.simpleCellAddress)(i,o,a)},y=(e,t,r)=>{const s=t.split(a.RANGE_OPERATOR);if(2!==s.length)return;const[o,i]=s,l=f(e,o,r);if(void 0===l)return;const u=f(e,i,l.sheet);return void 0!==u&&l.sheet===u.sheet?(0,n.simpleCellRange)(l,u):void 0},E=(e,t,r)=>{const n=R(t.col),s=w(t.sheet,e);if(void 0!==s)return r!==t.sheet?`${s}!${n}${t.row+1}`:`${n}${t.row+1}`},C=(e,t,r)=>{const n=E(e,t.start,r),s=E(e,t.end,t.start.sheet);return void 0===n||void 0===s?void 0:`${n}${a.RANGE_OPERATOR}${s}`};function T(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 R(e){let t="";for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}function w(e,t){let r=t(e);if(void 0!==r)return d.test(r)?r:(r=r.replace(/'/g,"''"),`'${r}'`)}function S(e,t){var r;let n=null!==(r=e[3])&&void 0!==r?r:e[2];return n?(n=n.replace(/''/g,"'"),t(n)):null}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CellAddress:()=>l,CellReferenceType:()=>n});var n,s=r(3),o=r(8),i=r(10),a=r(11);!function(e){e.CELL_REFERENCE_RELATIVE="CELL_REFERENCE",e.CELL_REFERENCE_ABSOLUTE="CELL_REFERENCE_ABSOLUTE",e.CELL_REFERENCE_ABSOLUTE_COL="CELL_REFERENCE_ABSOLUTE_COL",e.CELL_REFERENCE_ABSOLUTE_ROW="CELL_REFERENCE_ABSOLUTE_ROW"}(n||(n={}));class l{constructor(e,t,r,n){this.col=e,this.row=t,this.type=r,this.sheet=n}static fromColAndRow(e,t,r){return(e.isColumnAbsolute()&&t.isRowAbsolute()?l.absolute.bind(this):e.isColumnAbsolute()?l.absoluteCol.bind(this):t.isRowAbsolute()?l.absoluteRow.bind(this):l.relative.bind(this))(e.col,t.row,r)}static relative(e,t,r){return new l(e,t,n.CELL_REFERENCE_RELATIVE,r)}static absolute(e,t,r){return new l(e,t,n.CELL_REFERENCE_ABSOLUTE,r)}static absoluteCol(e,t,r){return new l(e,t,n.CELL_REFERENCE_ABSOLUTE_COL,r)}static absoluteRow(e,t,r){return new l(e,t,n.CELL_REFERENCE_ABSOLUTE_ROW,r)}toSimpleCellAddress(e){const t=(0,s.absoluteSheetReference)(this,e);return this.type===n.CELL_REFERENCE_ABSOLUTE?(0,s.simpleCellAddress)(t,this.col,this.row):this.type===n.CELL_REFERENCE_ABSOLUTE_ROW?(0,s.simpleCellAddress)(t,e.col+this.col,this.row):this.type===n.CELL_REFERENCE_ABSOLUTE_COL?(0,s.simpleCellAddress)(t,this.col,e.row+this.row):(0,s.simpleCellAddress)(t,e.col+this.col,e.row+this.row)}toColumnAddress(){const e=this.isColumnRelative()?i.ReferenceType.RELATIVE:i.ReferenceType.ABSOLUTE;return new i.ColumnAddress(e,this.col,this.sheet)}toRowAddress(){const e=this.isRowRelative()?i.ReferenceType.RELATIVE:i.ReferenceType.ABSOLUTE;return new a.RowAddress(e,this.row,this.sheet)}toSimpleColumnAddress(e){const t=(0,s.absoluteSheetReference)(this,e);let r=this.col;return this.isColumnRelative()&&(r+=e.col),(0,s.simpleColumnAddress)(t,r)}toSimpleRowAddress(e){const t=(0,s.absoluteSheetReference)(this,e);let r=this.row;return this.isRowRelative()&&(r+=e.row),(0,s.simpleRowAddress)(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 l(this.col,this.row+e,this.type,this.sheet)}shiftedByColumns(e){return new l(this.col+e,this.row,this.type,this.sheet)}moved(e,t,r){const n=void 0===this.sheet?void 0:e;return new l(this.col+t,this.row+r,this.type,n)}withSheet(e){return new l(this.col,this.row,this.type,e)}isInvalid(e){return(0,s.invalidSimpleCellAddress)(this.toSimpleCellAddress(e))}shiftRelativeDimensions(e,t){const r=this.isColumnAbsolute()?this.col:this.col+e,n=this.isRowAbsolute()?this.row:this.row+t;return new l(r,n,this.type,this.sheet)}shiftAbsoluteDimensions(e,t){const r=this.isColumnRelative()?this.col:this.col+e,n=this.isRowRelative()?this.row:this.row+t;return new l(r,n,this.type,this.sheet)}hash(e){const 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){const t=this.toSimpleCellAddress(e);if((0,s.invalidSimpleCellAddress)(t))return;const r=(0,o.columnIndexToLabel)(t.col),i=this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_ROW?"$":"";return`${this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_COL?"$":""}${r}${i}${t.row+1}`}exceedsSheetSizeLimits(e,t){return this.row>=t||this.col>=e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ColumnAddress:()=>i,ReferenceType:()=>n});var n,s=r(3),o=r(8);!function(e){e.RELATIVE="RELATIVE",e.ABSOLUTE="ABSOLUTE"}(n||(n={}));class i{constructor(e,t,r){this.type=e,this.col=t,this.sheet=r}static absolute(e,t){return new i(n.ABSOLUTE,e,t)}static relative(e,t){return new i(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){const n=void 0===this.sheet?void 0:e;return new i(this.type,this.col+t,n)}shiftedByColumns(e){return new i(this.type,this.col+e,this.sheet)}toSimpleColumnAddress(e){const t=(0,s.absoluteSheetReference)(this,e);let r=this.col;return this.isColumnRelative()&&(r=e.col+this.col),(0,s.simpleColumnAddress)(t,r)}shiftRelativeDimensions(e,t){const r=this.isColumnRelative()?this.col+e:this.col;return new i(this.type,r,this.sheet)}shiftAbsoluteDimensions(e,t){const r=this.isColumnAbsolute()?this.col+e:this.col;return new i(this.type,r,this.sheet)}withSheet(e){return new i(this.type,this.col,e)}isInvalid(e){return this.toSimpleColumnAddress(e).col<0}hash(e){const 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){const t=this.toSimpleColumnAddress(e);if((0,s.invalidSimpleColumnAddress)(t))return;const r=(0,o.columnIndexToLabel)(t.col);return`${this.type===n.ABSOLUTE?"$":""}${r}`}exceedsSheetSizeLimits(e){return this.col>=e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RowAddress:()=>o});var n=r(3),s=r(10);class o{constructor(e,t,r){this.type=e,this.row=t,this.sheet=r}static absolute(e,t){return new o(s.ReferenceType.ABSOLUTE,e,t)}static relative(e,t){return new o(s.ReferenceType.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,r)=>t.toSimpleRowAddress(e).row-r.toSimpleRowAddress(e).row}isRowAbsolute(){return this.type===s.ReferenceType.ABSOLUTE}isRowRelative(){return this.type===s.ReferenceType.RELATIVE}isAbsolute(){return this.type===s.ReferenceType.ABSOLUTE&&void 0!==this.sheet}moved(e,t,r){const n=void 0===this.sheet?void 0:e;return new o(this.type,this.row+r,n)}shiftedByRows(e){return new o(this.type,this.row+e,this.sheet)}toSimpleRowAddress(e){const t=(0,n.absoluteSheetReference)(this,e);let r=this.row;return this.isRowRelative()&&(r=e.row+this.row),(0,n.simpleRowAddress)(t,r)}shiftRelativeDimensions(e,t){const r=this.isRowRelative()?this.row+t:this.row;return new o(this.type,r,this.sheet)}shiftAbsoluteDimensions(e,t){const 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){const t=e&&void 0!==this.sheet?`#${this.sheet}`:"";switch(this.type){case s.ReferenceType.RELATIVE:return`${t}#ROWR${this.row}`;case s.ReferenceType.ABSOLUTE:return`${t}#ROWA${this.row}`}}unparse(e){const t=this.toSimpleRowAddress(e);if((0,n.invalidSimpleRowAddress)(t))return;return`${this.type===s.ReferenceType.ABSOLUTE?"$":""}${t.row+1}`}exceedsSheetSizeLimits(e){return this.row>=e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ABSOLUTE_OPERATOR:()=>s,ALL_DIGITS_ARRAY:()=>E,ALL_UNICODE_LETTERS_ARRAY:()=>C,ALL_WHITESPACE_PATTERN:()=>o,CELL_REFERENCE_PATTERN:()=>d,CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN:()=>f,COLUMN_REFERENCE_PATTERN:()=>p,NAMED_EXPRESSION_PATTERN:()=>y,NON_RESERVED_CHARACTER_PATTERN:()=>l,ODFF_WHITESPACE_PATTERN:()=>i,QUOTED_SHEET_NAME_PATTERN:()=>h,R1C1_CELL_REFERENCE_PATTERN:()=>m,RANGE_OPERATOR:()=>n,ROW_REFERENCE_PATTERN:()=>g,SHEET_NAME_PATTERN:()=>c,UNICODE_LETTER_PATTERN:()=>a,UNQUOTED_SHEET_NAME_PATTERN:()=>u});const n=":",s="$",o="\\s+",i="[ \\t\\n\\r]+",a="A-Za-zÀ-ʯ",l=`${a}0-9_.`,u=`[${a}0-9_]+`,h="'(((?!').|'')*)'",c=`(${u}|${h})!`,d=`(${c})?\\${s}?[A-Za-z]+\\${s}?[0-9]+`,p=`(${c})?\\${s}?[A-Za-z]+`,g=`(${c})?\\${s}?[0-9]+`,m="[rR][0-9]*[cC][0-9]*",f=`(${d})[^${l}]`,y=`[${a}_][${l}]*`,E=["0","1","2","3","4","5","6","7","8","9"],C=[...Array.from(Array(26)).map(((e,t)=>t+"A".charCodeAt(0))),...Array.from(Array(26)).map(((e,t)=>t+"a".charCodeAt(0))),...Array.from(Array(496)).map(((e,t)=>t+192))].map((e=>String.fromCharCode(e)))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ParserWithCaching:()=>m});var n=r(14),s=r(3),o=r(7),i=r(8),a=r(57),l=r(58),u=r(59),h=r(60),c=r(62),d=r(65),p=r(10),g=r(11);class m{constructor(e,t,r){this.config=e,this.functionRegistry=t,this.sheetMapping=r,this.statsCacheUsed=0,this.lexerConfig=(0,c.buildLexerConfig)(e),this.lexer=new h.FormulaLexer(this.lexerConfig),this.formulaParser=new h.FormulaParser(this.lexerConfig,this.sheetMapping),this.cache=new u.Cache(this.functionRegistry)}parse(e,t){this.formulaAddress=t;const r=this.tokenizeFormula(e);if(r.errors.length>0){const e=r.errors.map((e=>({type:a.ParsingErrorType.LexingError,message:e.message})));return{ast:(0,o.buildParsingErrorAst)(),errors:e,hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]}}const n=this.computeHashFromTokens(r.tokens,t);let s=this.cache.get(n);if(void 0!==s)++this.statsCacheUsed;else{const 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:[]});s=this.cache.set(n,o.ast)}const{ast:i,hasVolatileFunction:l,hasStructuralChangeFunction:u}=s,h=this.convertReversedRangesToRegularRanges(i);return{ast:h,errors:[],hasVolatileFunction:l,hasStructuralChangeFunction:u,dependencies:(0,o.collectDependencies)(h,this.functionRegistry)}}convertReversedRangesToRegularRanges(e){switch(e.type){case o.AstNodeType.EMPTY:case o.AstNodeType.NUMBER:case o.AstNodeType.STRING:case o.AstNodeType.ERROR:case o.AstNodeType.ERROR_WITH_RAW_INPUT:case o.AstNodeType.CELL_REFERENCE:case o.AstNodeType.NAMED_EXPRESSION:return e;case o.AstNodeType.CELL_RANGE:{const{start:t,end:r}=e,n=this.orderCellRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case o.AstNodeType.COLUMN_RANGE:{const{start:t,end:r}=e,n=this.orderColumnRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case o.AstNodeType.ROW_RANGE:{const{start:t,end:r}=e,n=this.orderRowRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case o.AstNodeType.PERCENT_OP:case o.AstNodeType.PLUS_UNARY_OP:case o.AstNodeType.MINUS_UNARY_OP:{const t=this.convertReversedRangesToRegularRanges(e.value);return Object.assign(Object.assign({},e),{value:t})}case o.AstNodeType.CONCATENATE_OP:case o.AstNodeType.EQUALS_OP:case o.AstNodeType.NOT_EQUAL_OP:case o.AstNodeType.LESS_THAN_OP:case o.AstNodeType.GREATER_THAN_OP:case o.AstNodeType.LESS_THAN_OR_EQUAL_OP:case o.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case o.AstNodeType.MINUS_OP:case o.AstNodeType.PLUS_OP:case o.AstNodeType.TIMES_OP:case o.AstNodeType.DIV_OP:case o.AstNodeType.POWER_OP:{const t=this.convertReversedRangesToRegularRanges(e.left),r=this.convertReversedRangesToRegularRanges(e.right);return Object.assign(Object.assign({},e),{left:t,right:r})}case o.AstNodeType.PARENTHESIS:{const t=this.convertReversedRangesToRegularRanges(e.expression);return Object.assign(Object.assign({},e),{expression:t})}case o.AstNodeType.FUNCTION_CALL:{const t=e.args.map((e=>this.convertReversedRangesToRegularRanges(e)));return Object.assign(Object.assign({},e),{args:t})}case o.AstNodeType.ARRAY:{const t=e.args.map((e=>e.map((e=>this.convertReversedRangesToRegularRanges(e)))));return Object.assign(Object.assign({},e),{args:t})}}}orderCellRangeEnds(e,t){const r=[e,t],[n,s]=r.map((e=>e.toColumnAddress())).sort(p.ColumnAddress.compareByAbsoluteAddress(this.formulaAddress)),[i,a]=r.map((e=>e.toRowAddress())).sort(g.RowAddress.compareByAbsoluteAddress(this.formulaAddress)),[l,u]=r.map((e=>e.sheet)).sort(m.compareSheetIds.bind(this));return{start:o.CellAddress.fromColAndRow(n,i,l),end:o.CellAddress.fromColAndRow(s,a,u)}}orderColumnRangeEnds(e,t){const r=[e,t],[n,s]=r.sort(p.ColumnAddress.compareByAbsoluteAddress(this.formulaAddress)),[o,i]=r.map((e=>e.sheet)).sort(m.compareSheetIds.bind(this));return{start:new p.ColumnAddress(n.type,n.col,o),end:new p.ColumnAddress(s.type,s.col,i)}}orderRowRangeEnds(e,t){const r=[e,t],[n,s]=r.sort(g.RowAddress.compareByAbsoluteAddress(this.formulaAddress)),[o,i]=r.map((e=>e.sheet)).sort(m.compareSheetIds.bind(this));return{start:new g.RowAddress(n.type,n.row,o),end:new g.RowAddress(s.type,s.row,i)}}static compareSheetIds(e,t){return(e=null!=e?e:1/0)-(t=null!=t?t:1/0)}fetchCachedResultForAst(e){const t=this.computeHashFromAst(e);return this.fetchCachedResult(t)}fetchCachedResult(e){const t=this.cache.get(e);if(void 0===t)throw new Error("There is no AST with such key in the cache");{const{ast:e,hasVolatileFunction:r,hasStructuralChangeFunction:n,relativeDependencies:s}=t;return{ast:e,errors:[],hasVolatileFunction:r,hasStructuralChangeFunction:n,dependencies:s}}}computeHashFromTokens(e,t){var r;let s="",o=0;for(;o<e.length;){const a=e[o];if((0,n.tokenMatcher)(a,c.CellReference)){const e=(0,i.cellAddressFromString)(this.sheetMapping,a.image,t);s=void 0===e?s.concat(a.image):s.concat(e.hash(!0))}else if((0,n.tokenMatcher)(a,c.ProcedureName)){const e=a.image.toUpperCase().slice(0,-1),t=null!==(r=this.lexerConfig.functionMapping[e])&&void 0!==r?r:e;s=s.concat(t,"(")}else if((0,n.tokenMatcher)(a,c.ColumnRange)){const[e,r]=a.image.split(":"),n=(0,i.columnAddressFromString)(this.sheetMapping,e,t),o=(0,i.columnAddressFromString)(this.sheetMapping,r,t);s=void 0===n||void 0===o?s.concat("!REF"):s.concat(n.hash(!0),":",o.hash(!0))}else if((0,n.tokenMatcher)(a,c.RowRange)){const[e,r]=a.image.split(":"),n=(0,i.rowAddressFromString)(this.sheetMapping,e,t),o=(0,i.rowAddressFromString)(this.sheetMapping,r,t);s=void 0===n||void 0===o?s.concat("!REF"):s.concat(n.hash(!0),":",o.hash(!0))}else s=s.concat(a.image);o++}return s}rememberNewAst(e){const t=this.computeHashFromAst(e);return this.cache.maybeSetAndThenGet(t,e)}computeHashFromAst(e){return"="+this.computeHashOfAstNode(e)}computeHashOfAstNode(e){switch(e.type){case o.AstNodeType.EMPTY:return e.leadingWhitespace||"";case o.AstNodeType.NUMBER:return(0,a.imageWithWhitespace)((0,d.formatNumber)(e.value,this.config.decimalSeparator),e.leadingWhitespace);case o.AstNodeType.STRING:return(0,a.imageWithWhitespace)('"'+e.value+'"',e.leadingWhitespace);case o.AstNodeType.NAMED_EXPRESSION:return(0,a.imageWithWhitespace)(e.expressionName,e.leadingWhitespace);case o.AstNodeType.FUNCTION_CALL:{const t=e.args.map((e=>this.computeHashOfAstNode(e))).join(this.config.functionArgSeparator),r=e.procedureName+"("+t+(0,a.imageWithWhitespace)(")",e.internalWhitespace);return(0,a.imageWithWhitespace)(r,e.leadingWhitespace)}case o.AstNodeType.CELL_REFERENCE:return(0,a.imageWithWhitespace)(e.reference.hash(!0),e.leadingWhitespace);case o.AstNodeType.COLUMN_RANGE:case o.AstNodeType.ROW_RANGE:case o.AstNodeType.CELL_RANGE:{const t=e.start.hash(e.sheetReferenceType!==a.RangeSheetReferenceType.RELATIVE),r=e.end.hash(e.sheetReferenceType===a.RangeSheetReferenceType.BOTH_ABSOLUTE);return(0,a.imageWithWhitespace)(t+":"+r,e.leadingWhitespace)}case o.AstNodeType.MINUS_UNARY_OP:return(0,a.imageWithWhitespace)("-"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case o.AstNodeType.PLUS_UNARY_OP:return(0,a.imageWithWhitespace)("+"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case o.AstNodeType.PERCENT_OP:return this.computeHashOfAstNode(e.value)+(0,a.imageWithWhitespace)("%",e.leadingWhitespace);case o.AstNodeType.ERROR:{const t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:s.ErrorType.ERROR);return(0,a.imageWithWhitespace)(t,e.leadingWhitespace)}case o.AstNodeType.ERROR_WITH_RAW_INPUT:return(0,a.imageWithWhitespace)(e.rawInput,e.leadingWhitespace);case o.AstNodeType.ARRAY:{const t=e.args.map((e=>e.map((e=>this.computeHashOfAstNode(e))).join(","))).join(";");return(0,a.imageWithWhitespace)("{"+t+(0,a.imageWithWhitespace)("}",e.internalWhitespace),e.leadingWhitespace)}case o.AstNodeType.PARENTHESIS:{const t="("+this.computeHashOfAstNode(e.expression)+(0,a.imageWithWhitespace)(")",e.internalWhitespace);return(0,a.imageWithWhitespace)(t,e.leadingWhitespace)}default:return this.computeHashOfAstNode(e.left)+(0,a.imageWithWhitespace)(l.binaryOpTokenMap[e.type],e.leadingWhitespace)+this.computeHashOfAstNode(e.right)}}bindWhitespacesToTokens(e){const t=[],r=e[0];(0,n.tokenMatcher)(r,this.lexerConfig.WhiteSpace)||t.push(r);for(let r=1;r<e.length;++r){const s=e[r];if((0,n.tokenMatcher)(s,this.lexerConfig.WhiteSpace))continue;const o=e[r-1];(0,n.tokenMatcher)(o,this.lexerConfig.WhiteSpace)&&(s.leadingWhitespace=o),t.push(s)}return t}tokenizeFormula(e){return this.lexer.tokenizeFormula(e)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Alternation:()=>h.Alternation,CstParser:()=>s.CstParser,EMPTY_ALT:()=>s.EMPTY_ALT,EOF:()=>i.EOF,EarlyExitException:()=>l.EarlyExitException,EmbeddedActionsParser:()=>s.EmbeddedActionsParser,Flat:()=>h.Flat,GAstVisitor:()=>c.GAstVisitor,Lexer:()=>o.Lexer,LexerDefinitionErrorType:()=>o.LexerDefinitionErrorType,MismatchedTokenException:()=>l.MismatchedTokenException,NoViableAltException:()=>l.NoViableAltException,NonTerminal:()=>h.NonTerminal,NotAllInputParsedException:()=>l.NotAllInputParsedException,Option:()=>h.Option,Parser:()=>s.Parser,ParserDefinitionErrorType:()=>s.ParserDefinitionErrorType,Repetition:()=>h.Repetition,RepetitionMandatory:()=>h.RepetitionMandatory,RepetitionMandatoryWithSeparator:()=>h.RepetitionMandatoryWithSeparator,RepetitionWithSeparator:()=>h.RepetitionWithSeparator,Rule:()=>h.Rule,Terminal:()=>h.Terminal,VERSION:()=>n.VERSION,assignOccurrenceIndices:()=>d.assignOccurrenceIndices,clearCache:()=>m,createSyntaxDiagramsCode:()=>p.createSyntaxDiagramsCode,createToken:()=>i.createToken,createTokenInstance:()=>i.createTokenInstance,defaultGrammarResolverErrorProvider:()=>a.defaultGrammarResolverErrorProvider,defaultGrammarValidatorErrorProvider:()=>a.defaultGrammarValidatorErrorProvider,defaultLexerErrorProvider:()=>u.defaultLexerErrorProvider,defaultParserErrorProvider:()=>a.defaultParserErrorProvider,generateParserFactory:()=>g.generateParserFactory,generateParserModule:()=>g.generateParserModule,isRecognitionException:()=>l.isRecognitionException,resolveGrammar:()=>d.resolveGrammar,serializeGrammar:()=>h.serializeGrammar,serializeProduction:()=>h.serializeProduction,tokenLabel:()=>i.tokenLabel,tokenMatcher:()=>i.tokenMatcher,tokenName:()=>i.tokenName,validateGrammar:()=>d.validateGrammar});var n=r(15),s=r(16),o=r(22),i=r(21),a=r(35),l=r(42),u=r(28),h=r(20),c=r(31),d=r(39),p=r(54),g=r(55);function m(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{VERSION:()=>n});var n="6.5.0"},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CstParser:()=>O,DEFAULT_PARSER_CONFIG:()=>S,DEFAULT_RULE_CONFIG:()=>v,EMPTY_ALT:()=>A,END_OF_FILE:()=>R,EmbeddedActionsParser:()=>M,Parser:()=>N,ParserDefinitionErrorType:()=>w});var n,s=r(17),o=r(18),i=r(21),a=r(33),l=r(35),u=r(39),h=r(41),c=r(43),d=r(44),p=r(47),g=r(48),m=r(49),f=r(50),y=r(51),E=r(52),C=r(53),T=(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])},n(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)}),R=(0,i.createTokenInstance)(i.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(R);var w,S=Object.freeze({recoveryEnabled:!1,maxLookahead:4,ignoredIssues:{},dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:l.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),v=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function A(e){return void 0===e&&(e=void 0),function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.INVALID_NESTED_RULE_NAME=10]="INVALID_NESTED_RULE_NAME",e[e.DUPLICATE_NESTED_NAME=11]="DUPLICATE_NESTED_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=12]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=13]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=14]="TOO_MANY_ALTS"}(w||(w={}));var N=function(){function e(e,t){void 0===t&&(t=S),this.ignoredIssues=S.ignoredIssues,this.definitionErrors=[],this.selfAnalysisDone=!1;var r=this;r.initErrorHandler(t),r.initLexerAdapter(),r.initLooksAhead(t),r.initRecognizerEngine(e,t),r.initRecoverable(t),r.initTreeBuilder(t),r.initContentAssist(),r.initGastRecorder(t),r.initPerformanceTracer(t),(0,s.has)(t,"ignoredIssues")&&t.ignoredIssues!==S.ignoredIssues&&(0,s.PRINT_WARNING)("The <ignoredIssues> IParserConfig property is soft-deprecated and will be removed in future versions.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead."),this.ignoredIssues=(0,s.has)(t,"ignoredIssues")?t.ignoredIssues:S.ignoredIssues,this.skipValidations=(0,s.has)(t,"skipValidations")?t.skipValidations:S.skipValidations}return e.performSelfAnalysis=function(e){e.performSelfAnalysis()},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var r;t.selfAnalysisDone=!0;var n=t.className;t.TRACE_INIT("toFastProps",(function(){(0,s.toFastProperties)(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),(0,s.forEach)(t.definedRulesNames,(function(e){var r=t[e].originalGrammarAction,n=void 0;t.TRACE_INIT(e+" Rule",(function(){n=t.topLevelRuleRecord(e,r)})),t.gastProductionsCache[e]=n}))}finally{t.disableRecording()}}));var i=[];if(t.TRACE_INIT("Grammar Resolving",(function(){i=(0,u.resolveGrammar)({rules:(0,s.values)(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,i)})),t.TRACE_INIT("Grammar Validations",(function(){if((0,s.isEmpty)(i)&&!1===t.skipValidations){var e=(0,u.validateGrammar)({rules:(0,s.values)(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:(0,s.values)(t.tokensMap),ignoredIssues:t.ignoredIssues,errMsgProvider:l.defaultGrammarValidatorErrorProvider,grammarName:n});t.definitionErrors.push.apply(t.definitionErrors,e)}})),(0,s.isEmpty)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e=(0,o.computeAllProdsFollows)((0,s.values)(t.gastProductionsCache));t.resyncFollows=e})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){t.preComputeLookaheadFunctions((0,s.values)(t.gastProductionsCache))}))),t.TRACE_INIT("expandAllNestedRuleNames",(function(){var e=(0,a.expandAllNestedRuleNames)((0,s.values)(t.gastProductionsCache),t.fullRuleNameToShort);t.allRuleNames=e.allRuleNames})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,s.isEmpty)(t.definitionErrors))throw r=(0,s.map)(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n "+r.join("\n-------------------------------\n"))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();(0,s.applyMixins)(N,[h.Recoverable,c.LooksAhead,d.TreeBuilder,p.LexerAdapter,m.RecognizerEngine,g.RecognizerApi,f.ErrorHandler,y.ContentAssist,E.GastRecorder,C.PerformanceTracer]);var O=function(e){function t(t,r){void 0===r&&(r=S);var n=(0,s.cloneObj)(r);return n.outputCst=!0,e.call(this,t,n)||this}return T(t,e),t}(N),M=function(e){function t(t,r){void 0===r&&(r=S);var n=(0,s.cloneObj)(r);return n.outputCst=!1,e.call(this,t,n)||this}return T(t,e),t}(N)},(e,t,r)=>{"use strict";function n(e){return e&&0===e.length}function s(e){return null==e?[]:Object.keys(e)}function o(e){for(var t=[],r=Object.keys(e),n=0;n<r.length;n++)t.push(e[r[n]]);return t}function i(e,t){for(var r=[],n=s(e),o=0;o<n.length;o++){var i=n[o];r.push(t.call(null,e[i],i))}return r}function a(e,t){for(var r=[],n=0;n<e.length;n++)r.push(t.call(null,e[n],n));return r}function l(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];Array.isArray(n)?t=t.concat(l(n)):t.push(n)}return t}function u(e){return n(e)?void 0:e[0]}function h(e){var t=e&&e.length;return t?e[t-1]:void 0}function c(e,t){if(Array.isArray(e))for(var r=0;r<e.length;r++)t.call(null,e[r],r);else{if(!x(e))throw Error("non exhaustive match");var n=s(e);for(r=0;r<n.length;r++){var o=n[r],i=e[o];t.call(null,i,o)}}}function d(e){return"string"==typeof e}function p(e){return void 0===e}function g(e){return e instanceof Function}function m(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 y(e,t){var r=[];if(Array.isArray(e))for(var n=0;n<e.length;n++){var s=e[n];t.call(null,s)&&r.push(s)}return r}function E(e,t){return y(e,(function(e){return!t(e)}))}function C(e,t){for(var r=Object.keys(e),n={},s=0;s<r.length;s++){var o=r[s],i=e[o];t(i)&&(n[o]=i)}return n}function T(e,t){return!!x(e)&&e.hasOwnProperty(t)}function R(e,t){return void 0!==v(e,(function(e){return e===t}))}function w(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t}function S(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}function v(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t.call(null,n))return n}}function A(e,t){for(var r=[],n=0;n<e.length;n++){var s=e[n];t.call(null,s)&&r.push(s)}return r}function N(e,t,r){for(var n=Array.isArray(e),i=n?e:o(e),a=n?[]:s(e),l=r,u=0;u<i.length;u++)l=t.call(null,l,i[u],n?u:a[u]);return l}function O(e){return E(e,(function(e){return null==e}))}function M(e,t){void 0===t&&(t=function(e){return e});var r=[];return N(e,(function(e,n){var s=t(n);return R(r,s)?e:(r.push(s),e.concat(n))}),[])}function b(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=[null].concat(t);return Function.bind.apply(e,n)}function I(e){return Array.isArray(e)}function _(e){return e instanceof RegExp}function x(e){return e instanceof Object}function P(e,t){for(var r=0;r<e.length;r++)if(!t(e[r],r))return!1;return!0}function L(e,t){return E(e,(function(e){return R(t,e)}))}function D(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return!0;return!1}function F(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1}function k(e,t){var r=w(e);return r.sort((function(e,r){return t(e)-t(r)})),r}function H(e,t){if(e.length!==t.length)throw Error("can't zipObject with different number of keys and values!");for(var r={},n=0;n<e.length;n++)r[e[n]]=t[n];return r}function U(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++)for(var o=t[n],i=s(o),a=0;a<i.length;a++){var l=i[a];e[l]=o[l]}return e}function V(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var o=t[n];if(!p(o))for(var i=s(o),a=0;a<i.length;a++){var l=i[a];T(e,l)||(e[l]=o[l])}}return e}function B(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return V.apply(null,[{}].concat(e))}function W(e,t){var r={};return c(e,(function(e){var n=t(e),s=r[n];s?s.push(e):r[n]=[e]})),r}function G(e,t){for(var r=S(e),n=s(t),o=0;o<n.length;o++){var i=n[o],a=t[i];r[i]=a}return r}function Y(){}function j(e){return e}function z(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(void 0!==n?n:void 0)}return t}function $(e){console&&console.error&&console.error("Error: "+e)}function K(e){console&&console.warn&&console.warn("Warning: "+e)}function X(){return"function"==typeof Map}function q(e,t){t.forEach((function(t){var r=t.prototype;Object.getOwnPropertyNames(r).forEach((function(n){if("constructor"!==n){var s=Object.getOwnPropertyDescriptor(r,n);s&&(s.get||s.set)?Object.defineProperty(e.prototype,n,s):e.prototype[n]=t.prototype[n]}}))}))}function Q(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.bar}return n(),n(),e}function Z(e){return e[e.length-1]}function J(e){var t=(new Date).getTime(),r=e();return{time:(new Date).getTime()-t,value:r}}r.r(t),r.d(t,{IDENTITY:()=>j,NOOP:()=>Y,PRINT_ERROR:()=>$,PRINT_WARNING:()=>K,applyMixins:()=>q,assign:()=>U,assignNoOverwrite:()=>V,cloneArr:()=>w,cloneObj:()=>S,compact:()=>O,contains:()=>R,defaults:()=>B,difference:()=>L,drop:()=>m,dropRight:()=>f,every:()=>P,filter:()=>y,find:()=>v,findAll:()=>A,first:()=>u,flatten:()=>l,forEach:()=>c,groupBy:()=>W,has:()=>T,indexOf:()=>F,isArray:()=>I,isES2015MapSupported:()=>X,isEmpty:()=>n,isFunction:()=>g,isObject:()=>x,isRegExp:()=>_,isString:()=>d,isUndefined:()=>p,keys:()=>s,last:()=>h,map:()=>a,mapValues:()=>i,merge:()=>G,packArray:()=>z,partial:()=>b,peek:()=>Z,pick:()=>C,reduce:()=>N,reject:()=>E,some:()=>D,sortBy:()=>k,timer:()=>J,toFastProperties:()=>Q,uniq:()=>M,values:()=>o,zipObject:()=>H})},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ResyncFollowsWalker:()=>h,buildBetweenProdsFollowPrefix:()=>d,buildInProdFollowPrefix:()=>p,computeAllProdsFollows:()=>c});var n,s=r(19),o=r(29),i=r(17),a=r(32),l=r(20),u=(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])},n(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=function(e){function t(t){var r=e.call(this)||this;return r.topProd=t,r.follows={},r}return u(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 n=d(e.referencedRule,e.idx)+this.topProd.name,s=t.concat(r),i=new l.Flat({definition:s}),a=(0,o.first)(i);this.follows[n]=a},t}(s.RestWalker);function c(e){var t={};return(0,i.forEach)(e,(function(e){var r=new h(e).startWalking();(0,i.assign)(t,r)})),t}function d(e,t){return e.name+t+a.IN}function p(e){return e.terminalType.name+e.idx+a.IN}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RestWalker:()=>o});var n=r(17),s=r(20),o=function(){function e(){}return e.prototype.walk=function(e,t){var r=this;void 0===t&&(t=[]),(0,n.forEach)(e.definition,(function(o,i){var a=(0,n.drop)(e.definition,i+1);if(o instanceof s.NonTerminal)r.walkProdRef(o,a,t);else if(o instanceof s.Terminal)r.walkTerminal(o,a,t);else if(o instanceof s.Flat)r.walkFlat(o,a,t);else if(o instanceof s.Option)r.walkOption(o,a,t);else if(o instanceof s.RepetitionMandatory)r.walkAtLeastOne(o,a,t);else if(o instanceof s.RepetitionMandatoryWithSeparator)r.walkAtLeastOneSep(o,a,t);else if(o instanceof s.RepetitionWithSeparator)r.walkManySep(o,a,t);else if(o instanceof s.Repetition)r.walkMany(o,a,t);else{if(!(o instanceof s.Alternation))throw Error("non exhaustive match");r.walkOr(o,a,t)}}))},e.prototype.walkTerminal=function(e,t,r){},e.prototype.walkProdRef=function(e,t,r){},e.prototype.walkFlat=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkOption=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkAtLeastOne=function(e,t,r){var n=[new s.Option({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkAtLeastOneSep=function(e,t,r){var n=i(e,t,r);this.walk(e,n)},e.prototype.walkMany=function(e,t,r){var n=[new s.Option({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkManySep=function(e,t,r){var n=i(e,t,r);this.walk(e,n)},e.prototype.walkOr=function(e,t,r){var o=this,i=t.concat(r);(0,n.forEach)(e.definition,(function(e){var t=new s.Flat({definition:[e]});o.walk(t,i)}))},e}();function i(e,t,r){return[new s.Option({definition:[new s.Terminal({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractProduction:()=>a,Alternation:()=>f,Flat:()=>h,NonTerminal:()=>l,Option:()=>c,Repetition:()=>g,RepetitionMandatory:()=>d,RepetitionMandatoryWithSeparator:()=>p,RepetitionWithSeparator:()=>m,Rule:()=>u,Terminal:()=>y,serializeGrammar:()=>E,serializeProduction:()=>C});var n,s=r(17),o=r(21),i=(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])},n(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)}),a=function(){function e(e){this.definition=e}return e.prototype.accept=function(e){e.visit(this),(0,s.forEach)(this.definition,(function(t){t.accept(e)}))},e}(),l=function(e){function t(t){var r=e.call(this,[])||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(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}(a),u=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.orgText="",(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),h=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),c=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),d=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),p=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),g=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),m=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),f=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),y=function(){function e(e){this.idx=1,(0,s.assign)(this,(0,s.pick)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function E(e){return(0,s.map)(e,C)}function C(e){function t(e){return(0,s.map)(e,C)}if(e instanceof l)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof h)return{type:"Flat",definition:t(e.definition)};if(e instanceof c)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof d)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof p)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:e.idx,separator:C(new y({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof m)return{type:"RepetitionWithSeparator",name:e.name,idx:e.idx,separator:C(new y({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof g)return{type:"Repetition",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof f)return{type:"Alternation",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof y){var r={type:"Terminal",name:e.terminalType.name,label:(0,o.tokenLabel)(e.terminalType),idx:e.idx},n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=(0,s.isRegExp)(n)?n.source:n),r}if(e instanceof u)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EOF:()=>C,createToken:()=>E,createTokenInstance:()=>T,hasTokenLabel:()=>l,tokenLabel:()=>i,tokenMatcher:()=>R,tokenName:()=>a});var n=r(17),s=r(22),o=r(27);function i(e){return l(e)?e.LABEL:e.name}function a(e){return e.name}function l(e){return(0,n.isString)(e.LABEL)&&""!==e.LABEL}var u="parent",h="categories",c="label",d="group",p="push_mode",g="pop_mode",m="longer_alt",f="line_breaks",y="start_chars_hint";function E(e){return function(e){var t=e.pattern,r={};r.name=e.name,(0,n.isUndefined)(t)||(r.PATTERN=t);if((0,n.has)(e,u))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";(0,n.has)(e,h)&&(r.CATEGORIES=e[h]);(0,o.augmentTokenTypes)([r]),(0,n.has)(e,c)&&(r.LABEL=e[c]);(0,n.has)(e,d)&&(r.GROUP=e[d]);(0,n.has)(e,g)&&(r.POP_MODE=e[g]);(0,n.has)(e,p)&&(r.PUSH_MODE=e[p]);(0,n.has)(e,m)&&(r.LONGER_ALT=e[m]);(0,n.has)(e,f)&&(r.LINE_BREAKS=e[f]);(0,n.has)(e,y)&&(r.START_CHARS_HINT=e[y]);return r}(e)}var C=E({name:"EOF",pattern:s.Lexer.NA});function T(e,t,r,n,s,o,i,a){return{image:t,startOffset:r,endOffset:n,startLine:s,endLine:o,startColumn:i,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function R(e,t){return(0,o.tokenStructuredMatcher)(e,t)}(0,o.augmentTokenTypes)([C])},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Lexer:()=>h,LexerDefinitionErrorType:()=>n});var n,s=r(23),o=r(17),i=r(27),a=r(28),l=r(26);!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(n||(n={}));var u={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:a.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(u);var h=function(){function e(e,t){var r=this;if(void 0===t&&(t=u),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,o.merge)(u,t);var n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var n,a=!0;r.TRACE_INIT("Lexer Config handling",(function(){if(r.config.lineTerminatorsPattern===u.lineTerminatorsPattern)r.config.lineTerminatorsPattern=s.LineTerminatorOptimizedTester;else if(r.config.lineTerminatorCharacters===u.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor 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,o.isArray)(e)?((n={modes:{}}).modes[s.DEFAULT_MODE]=(0,o.cloneArr)(e),n[s.DEFAULT_MODE]=s.DEFAULT_MODE):(a=!1,n=(0,o.cloneObj)(e))})),!1===r.config.skipValidations&&(r.TRACE_INIT("performRuntimeChecks",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((0,s.performRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))})),r.TRACE_INIT("performWarningRuntimeChecks",(function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat((0,s.performWarningRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},(0,o.forEach)(n.modes,(function(e,t){n.modes[t]=(0,o.reject)(e,(function(e){return(0,o.isUndefined)(e)}))}));var h=(0,o.keys)(n.modes);if((0,o.forEach)(n.modes,(function(e,n){r.TRACE_INIT("Mode: <"+n+"> processing",(function(){var a;(r.modes.push(n),!1===r.config.skipValidations&&r.TRACE_INIT("validatePatterns",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((0,s.validatePatterns)(e,h))})),(0,o.isEmpty)(r.lexerDefinitionErrors))&&((0,i.augmentTokenTypes)(e),r.TRACE_INIT("analyzeTokenTypes",(function(){a=(0,s.analyzeTokenTypes)(e,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:r.TRACE_INIT.bind(r)})})),r.patternIdxToConfig[n]=a.patternIdxToConfig,r.charCodeToPatternIdxToConfig[n]=a.charCodeToPatternIdxToConfig,r.emptyGroups=(0,o.merge)(r.emptyGroups,a.emptyGroups),r.hasCustom=a.hasCustom||r.hasCustom,r.canModeBeOptimized[n]=a.canBeOptimized)}))})),r.defaultMode=n.defaultMode,!(0,o.isEmpty)(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var c=(0,o.map)(r.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+c)}(0,o.forEach)(r.lexerDefinitionWarning,(function(e){(0,o.PRINT_WARNING)(e.message)})),r.TRACE_INIT("Choosing sub-methods implementations",(function(){if(s.SUPPORT_STICKY?(r.chopInput=o.IDENTITY,r.match=r.matchWithTest):(r.updateLastIndex=o.NOOP,r.match=r.matchWithExec),a&&(r.handleModes=o.NOOP),!1===r.trackStartLines&&(r.computeNewColumn=o.IDENTITY),!1===r.trackEndLines&&(r.updateTokenEndLineColumnLocation=o.NOOP),/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))throw Error('Invalid <positionTracking> config option: "'+r.config.positionTracking+'"');r.createTokenInstance=r.createOffsetOnlyToken}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,o.reduce)(r.canModeBeOptimized,(function(e,t,r){return!1===t&&e.push(r),e}),[]);if(t.ensureOptimizations&&!(0,o.isEmpty)(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),r.TRACE_INIT("clearRegExpParserCache",(function(){(0,l.clearRegExpParserCache)()})),r.TRACE_INIT("toFastProperties",(function(){(0,o.toFastProperties)(r)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!(0,o.isEmpty)(this.lexerDefinitionErrors)){var r=(0,o.map)(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+r)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var r,n,i,a,l,u,h,c,d,p,g,m,f,y,E=this,C=e,T=C.length,R=0,w=0,S=this.hasCustom?0:Math.floor(e.length/10),v=new Array(S),A=[],N=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0,M=(0,s.cloneEmptyGroups)(this.emptyGroups),b=this.trackStartLines,I=this.config.lineTerminatorsPattern,_=0,x=[],P=[],L=[],D=[];Object.freeze(D);var F=void 0;function k(){return x}function H(e){var t=(0,s.charCodeToOptimizedIndex)(e),r=P[t];return void 0===r?D:r}var U,V=function(e){if(1===L.length&&void 0===e.tokenType.PUSH_MODE){var t=E.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);A.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{L.pop();var r=(0,o.last)(L);x=E.patternIdxToConfig[r],P=E.charCodeToPatternIdxToConfig[r],_=x.length;var n=E.canModeBeOptimized[r]&&!1===E.config.safeMode;F=P&&n?H:k}};function B(e){L.push(e),P=this.charCodeToPatternIdxToConfig[e],x=this.patternIdxToConfig[e],_=x.length,_=x.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;F=P&&t?H:k}for(B.call(this,t);R<T;){l=null;var W=C.charCodeAt(R),G=F(W),Y=G.length;for(r=0;r<Y;r++){var j=(U=G[r]).pattern;if(u=null,!1!==(te=U.short)?W===te&&(l=j):!0===U.isCustom?null!==(y=j.exec(C,R,v,M))?(l=y[0],void 0!==y.payload&&(u=y.payload)):l=null:(this.updateLastIndex(j,R),l=this.match(j,e,R)),null!==l){if(void 0!==(a=U.longerAlt)){var z=x[a],$=z.pattern;h=null,!0===z.isCustom?null!==(y=$.exec(C,R,v,M))?(i=y[0],void 0!==y.payload&&(h=y.payload)):i=null:(this.updateLastIndex($,R),i=this.match($,e,R)),i&&i.length>l.length&&(l=i,u=h,U=z)}break}}if(null!==l){if(c=l.length,void 0!==(d=U.group)&&(p=U.tokenTypeIdx,g=this.createTokenInstance(l,R,p,U.tokenType,N,O,c),this.handlePayload(g,u),!1===d?w=this.addToken(v,w,g):M[d].push(g)),e=this.chopInput(e,c),R+=c,O=this.computeNewColumn(O,c),!0===b&&!0===U.canLineTerminator){var K=0,X=void 0,q=void 0;I.lastIndex=0;do{!0===(X=I.test(l))&&(q=I.lastIndex-1,K++)}while(!0===X);0!==K&&(N+=K,O=c-q,this.updateTokenEndLineColumnLocation(g,d,q,K,N,O,c))}this.handleModes(U,V,B,g)}else{for(var Q=R,Z=N,J=O,ee=!1;!ee&&R<T;)for(C.charCodeAt(R),e=this.chopInput(e,1),R++,n=0;n<_;n++){var te,re=x[n];j=re.pattern;if(!1!==(te=re.short)?C.charCodeAt(R)===te&&(ee=!0):!0===re.isCustom?ee=null!==j.exec(C,R,v,M):(this.updateLastIndex(j,R),ee=null!==j.exec(e)),!0===ee)break}m=R-Q,f=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(C,Q,m,Z,J),A.push({offset:Q,line:Z,column:J,length:m,message:f})}}return this.hasCustom||(v.length=w),{tokens:v,groups:M,errors:A}},e.prototype.handleModes=function(e,t,r,n){if(!0===e.pop){var s=e.push;t(n),void 0!==s&&r.call(this,s)}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,n,s,o,i){var a,l;void 0!==t&&(l=(a=r===i-1)?-1:0,1===n&&!0===a||(e.endLine=s+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,n){return{image:e,startOffset:t,tokenTypeIdx:r,tokenType:n}},e.prototype.createStartOnlyToken=function(e,t,r,n,s,o){return{image:e,startOffset:t,startLine:s,startColumn:o,tokenTypeIdx:r,tokenType:n}},e.prototype.createFullToken=function(e,t,r,n,s,o,i){return{image:e,startOffset:t,endOffset:t+i-1,startLine:s,endLine:s,startColumn:o,endColumn:o+i-1,tokenTypeIdx:r,tokenType:n}},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){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--\x3e <"+e+">");var n=(0,o.timer)(t),s=n.time,i=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(r+"<-- <"+e+"> time: "+s+"ms"),this.traceInitIndent--,i}return t()},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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DEFAULT_MODE:()=>c,LineTerminatorOptimizedTester:()=>k,MODES:()=>d,SUPPORT_STICKY:()=>p,addStartOfInput:()=>I,addStickyFlag:()=>_,analyzeTokenTypes:()=>f,buildLineBreakIssueMessage:()=>U,charCodeToOptimizedIndex:()=>G,cloneEmptyGroups:()=>L,disableSticky:()=>g,enableSticky:()=>m,findDuplicatePatterns:()=>N,findEmptyMatchRegExps:()=>w,findEndOfInputAnchor:()=>R,findInvalidGroupType:()=>O,findInvalidPatterns:()=>C,findMissingPatterns:()=>E,findModesThatDoNotExist:()=>M,findStartOfInputAnchor:()=>v,findUnreachablePatterns:()=>b,findUnsupportedFlags:()=>A,isCustomPattern:()=>D,isShortPattern:()=>F,minOptimizationVal:()=>W,performRuntimeChecks:()=>x,performWarningRuntimeChecks:()=>P,validatePatterns:()=>y});var n,s=r(24),o=r(22),i=r(17),a=r(25),l=r(26),u=(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])},n(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",c="defaultMode",d="modes",p="boolean"==typeof new RegExp("(?:)").sticky;function g(){p=!1}function m(){p=!0}function f(e,t){var r,n=(t=(0,i.defaults)(t,{useSticky:p,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;n("initCharCodeToOptimizedIndexMap",(function(){!function(){if((0,i.isEmpty)(Y)){Y=new Array(65536);for(var e=0;e<65536;e++)Y[e]=e>255?255+~~(e/255):e}}()})),n("Reject Lexer.NA",(function(){r=(0,i.reject)(e,(function(e){return e[h]===o.Lexer.NA}))}));var s,l,u,c,d,g,m,f,y,E,C,T=!1;n("Transform Patterns",(function(){T=!1,s=(0,i.map)(r,(function(e){var r=e[h];if((0,i.isRegExp)(r)){var n=r.source;return 1===n.length&&"^"!==n&&"$"!==n&&"."!==n?n:2!==n.length||"\\"!==n[0]||(0,i.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],n[1])?t.useSticky?_(r):I(r):n[1]}if((0,i.isFunction)(r))return T=!0,{exec:r};if((0,i.has)(r,"exec"))return T=!0,r;if("string"==typeof r){if(1===r.length)return r;var s=r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),o=new RegExp(s);return t.useSticky?_(o):I(o)}throw Error("non exhaustive match")}))})),n("misc mapping",(function(){l=(0,i.map)(r,(function(e){return e.tokenTypeIdx})),u=(0,i.map)(r,(function(e){var t=e.GROUP;if(t!==o.Lexer.SKIPPED){if((0,i.isString)(t))return t;if((0,i.isUndefined)(t))return!1;throw Error("non exhaustive match")}})),c=(0,i.map)(r,(function(e){var t=e.LONGER_ALT;if(t)return(0,i.indexOf)(r,t)})),d=(0,i.map)(r,(function(e){return e.PUSH_MODE})),g=(0,i.map)(r,(function(e){return(0,i.has)(e,"POP_MODE")}))})),n("Line Terminator Handling",(function(){var e=V(t.lineTerminatorCharacters);m=(0,i.map)(r,(function(e){return!1})),"onlyOffset"!==t.positionTracking&&(m=(0,i.map)(r,(function(t){return(0,i.has)(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===H(t,e)?(0,a.canMatchCharCode)(e,t.PATTERN):void 0})))})),n("Misc Mapping #2",(function(){f=(0,i.map)(r,D),y=(0,i.map)(s,F),E=(0,i.reduce)(r,(function(e,t){var r=t.GROUP;return(0,i.isString)(r)&&r!==o.Lexer.SKIPPED&&(e[r]=[]),e}),{}),C=(0,i.map)(s,(function(e,t){return{pattern:s[t],longerAlt:c[t],canLineTerminator:m[t],isCustom:f[t],short:y[t],group:u[t],push:d[t],pop:g[t],tokenTypeIdx:l[t],tokenType:r[t]}}))}));var R=!0,w=[];return t.safeMode||n("First Char Optimization",(function(){w=(0,i.reduce)(r,(function(e,r,n){if("string"==typeof r.PATTERN){var s=G(r.PATTERN.charCodeAt(0));B(e,s,C[n])}else if((0,i.isArray)(r.START_CHARS_HINT)){var o;(0,i.forEach)(r.START_CHARS_HINT,(function(t){var r=G("string"==typeof t?t.charCodeAt(0):t);o!==r&&(o=r,B(e,r,C[n]))}))}else if((0,i.isRegExp)(r.PATTERN))if(r.PATTERN.unicode)R=!1,t.ensureOptimizations&&(0,i.PRINT_ERROR)(a.failedOptimizationPrefixMsg+"\tUnable to analyze < "+r.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var l=(0,a.getOptimizedStartCodesIndices)(r.PATTERN,t.ensureOptimizations);(0,i.isEmpty)(l)&&(R=!1),(0,i.forEach)(l,(function(t){B(e,t,C[n])}))}else t.ensureOptimizations&&(0,i.PRINT_ERROR)(a.failedOptimizationPrefixMsg+"\tTokenType: <"+r.name+"> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),R=!1;return e}),[])})),n("ArrayPacking",(function(){w=(0,i.packArray)(w)})),{emptyGroups:E,patternIdxToConfig:C,charCodeToPatternIdxToConfig:w,hasCustom:T,canBeOptimized:R}}function y(e,t){var r=[],n=E(e);r=r.concat(n.errors);var s=C(n.valid),o=s.valid;return r=(r=r.concat(s.errors)).concat(function(e){var t=[],r=(0,i.filter)(e,(function(e){return(0,i.isRegExp)(e[h])}));return t=t.concat(R(r)),t=t.concat(v(r)),t=t.concat(A(r)),t=t.concat(N(r)),t=t.concat(w(r)),t}(o)),r=(r=(r=r.concat(O(o))).concat(M(o,t))).concat(b(o))}function E(e){var t=(0,i.filter)(e,(function(e){return!(0,i.has)(e,h)}));return{errors:(0,i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:o.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[e]}})),valid:(0,i.difference)(e,t)}}function C(e){var t=(0,i.filter)(e,(function(e){var t=e[h];return!((0,i.isRegExp)(t)||(0,i.isFunction)(t)||(0,i.has)(t,"exec")||(0,i.isString)(t))}));return{errors:(0,i.map)(t,(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:o.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[e]}})),valid:(0,i.difference)(e,t)}}var T=/[^\\][\$]/;function R(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return u(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(s.BaseRegExpVisitor),r=(0,i.filter)(e,(function(e){var r=e[h];try{var n=(0,l.getRegExpAst)(r),s=new t;return s.visit(n),s.found}catch(e){return T.test(r.source)}}));return(0,i.map)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:o.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function w(e){var t=(0,i.filter)(e,(function(e){return e[h].test("")}));return(0,i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:o.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}))}var S=/[^\\[][\^]|^\^/;function v(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return u(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(s.BaseRegExpVisitor),r=(0,i.filter)(e,(function(e){var r=e[h];try{var n=(0,l.getRegExpAst)(r),s=new t;return s.visit(n),s.found}catch(e){return S.test(r.source)}}));return(0,i.map)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:o.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function A(e){var t=(0,i.filter)(e,(function(e){var t=e[h];return t instanceof RegExp&&(t.multiline||t.global)}));return(0,i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:o.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}))}function N(e){var t=[],r=(0,i.map)(e,(function(r){return(0,i.reduce)(e,(function(e,n){return r.PATTERN.source!==n.PATTERN.source||(0,i.contains)(t,n)||n.PATTERN===o.Lexer.NA||(t.push(n),e.push(n)),e}),[])}));r=(0,i.compact)(r);var n=(0,i.filter)(r,(function(e){return e.length>1}));return(0,i.map)(n,(function(e){var t=(0,i.map)(e,(function(e){return e.name}));return{message:"The same RegExp pattern ->"+(0,i.first)(e).PATTERN+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:o.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}))}function O(e){var t=(0,i.filter)(e,(function(e){if(!(0,i.has)(e,"GROUP"))return!1;var t=e.GROUP;return t!==o.Lexer.SKIPPED&&t!==o.Lexer.NA&&!(0,i.isString)(t)}));return(0,i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:o.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}))}function M(e,t){var r=(0,i.filter)(e,(function(e){return void 0!==e.PUSH_MODE&&!(0,i.contains)(t,e.PUSH_MODE)}));return(0,i.map)(r,(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:o.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}))}function b(e){var t=[],r=(0,i.reduce)(e,(function(e,t,r){var n,s,a=t.PATTERN;return a===o.Lexer.NA||((0,i.isString)(a)?e.push({str:a,idx:r,tokenType:t}):(0,i.isRegExp)(a)&&(n=a,s=[".","\\","[","]","|","^","$","(",")","?","*","+","{"],void 0===(0,i.find)(s,(function(e){return-1!==n.source.indexOf(e)})))&&e.push({str:a.source,idx:r,tokenType:t})),e}),[]);return(0,i.forEach)(e,(function(e,n){(0,i.forEach)(r,(function(r){var s=r.str,a=r.idx,l=r.tokenType;if(n<a&&function(e,t){if((0,i.isRegExp)(t)){var r=t.exec(e);return null!==r&&0===r.index}if((0,i.isFunction)(t))return t(e,0,[],{});if((0,i.has)(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(s,e.PATTERN)){var u="Token: ->"+l.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";t.push({message:u,type:o.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[e,l]})}}))})),t}function I(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function _(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function x(e,t,r){var n=[];return(0,i.has)(e,c)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+c+"> property in its definition\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,i.has)(e,d)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+d+"> property in its definition\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,i.has)(e,d)&&(0,i.has)(e,c)&&!(0,i.has)(e.modes,e.defaultMode)&&n.push({message:"A MultiMode Lexer cannot be initialized with a "+c+": <"+e.defaultMode+">which does not exist\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,i.has)(e,d)&&(0,i.forEach)(e.modes,(function(e,t){(0,i.forEach)(e,(function(e,r){(0,i.isUndefined)(e)&&n.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+t+"> at index: <"+r+">\n",type:o.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}))})),n}function P(e,t,r){var n=[],s=!1,l=(0,i.compact)((0,i.flatten)((0,i.mapValues)(e.modes,(function(e){return e})))),u=(0,i.reject)(l,(function(e){return e[h]===o.Lexer.NA})),c=V(r);return t&&(0,i.forEach)(u,(function(e){var t=H(e,c);if(!1!==t){var r={message:U(e,t),type:t.issue,tokenType:e};n.push(r)}else(0,i.has)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(s=!0):(0,a.canMatchCharCode)(c,e.PATTERN)&&(s=!0)})),t&&!s&&n.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:o.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n}function L(e){var t={},r=(0,i.keys)(e);return(0,i.forEach)(r,(function(r){var n=e[r];if(!(0,i.isArray)(n))throw Error("non exhaustive match");t[r]=[]})),t}function D(e){var t=e.PATTERN;if((0,i.isRegExp)(t))return!1;if((0,i.isFunction)(t))return!0;if((0,i.has)(t,"exec"))return!0;if((0,i.isString)(t))return!1;throw Error("non exhaustive match")}function F(e){return!(!(0,i.isString)(e)||1!==e.length)&&e.charCodeAt(0)}var k={test:function(e){for(var t=e.length,r=this.lastIndex;r<t;r++){var n=e.charCodeAt(r);if(10===n)return this.lastIndex=r+1,!0;if(13===n)return 10===e.charCodeAt(r+1)?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function H(e,t){if((0,i.has)(e,"LINE_BREAKS"))return!1;if((0,i.isRegExp)(e.PATTERN)){try{(0,a.canMatchCharCode)(t,e.PATTERN)}catch(e){return{issue:o.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if((0,i.isString)(e.PATTERN))return!1;if(D(e))return{issue:o.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function U(e,t){if(t.issue===o.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+e.name+"> Token Type\n\t Root cause: "+t.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===o.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <"+e.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function V(e){return(0,i.map)(e,(function(e){return(0,i.isString)(e)&&e.length>0?e.charCodeAt(0):e}))}function B(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}var W=256;function G(e){return e<W?e:Y[e]}var Y=[]},function(e,t){var r,n,s;"undefined"!=typeof self&&self,n=[],void 0===(s="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"(":var e;switch(this.consumeChar("?"),this.popChar()){case"=":e="Lookahead";break;case"!":e="NegativeLookahead"}l(e);var t=this.disjunction();return this.consumeChar(")"),{type:e,value:t}}u()},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=d;break;case"S":e=d,t=!0;break;case"w":e=c;break;case"W":e=c,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("\t");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 ");return{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 n=this.classAtom();if("Character"===n.type){if(n.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:n.value})}else i(r.value,e),e.push(o("-")),i(n.value,e)}else i(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===s.test(e))throw Error("Expecting a positive integer");for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(!1===n.test(e))throw Error("Expecting an integer");for(;n.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 n.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="",n=0;n<e;n++){var s=this.popChar();if(!1===r.test(s))throw Error("Expecting a HexDecimal digits");t+=s}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]/,n=/[0-9]/,s=/[1-9]/;function o(e){return e.charCodeAt(0)}function i(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}function l(e){if(void 0===e)throw Error("Internal Error - Should never get here!")}function u(){throw Error("Internal Error - Should never get here!")}var h=[];for(t=o("0");t<=o("9");t++)h.push(t);var c=[o("_")].concat(h);for(t=o("a");t<=o("z");t++)c.push(t);for(t=o("A");t<=o("Z");t++)c.push(t);var d=[o(" "),o("\f"),o("\n"),o("\r"),o("\t"),o("\v"),o("\t"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\ufeff")];function p(){}return p.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))}},p.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)},p.prototype.visitPattern=function(e){},p.prototype.visitFlags=function(e){},p.prototype.visitDisjunction=function(e){},p.prototype.visitAlternative=function(e){},p.prototype.visitStartAnchor=function(e){},p.prototype.visitEndAnchor=function(e){},p.prototype.visitWordBoundary=function(e){},p.prototype.visitNonWordBoundary=function(e){},p.prototype.visitLookahead=function(e){},p.prototype.visitNegativeLookahead=function(e){},p.prototype.visitCharacter=function(e){},p.prototype.visitSet=function(e){},p.prototype.visitGroup=function(e){},p.prototype.visitGroupBackReference=function(e){},p.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:p,VERSION:"0.4.0"}})?r.apply(t,n):r)||(e.exports=s)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{canMatchCharCode:()=>y,failedOptimizationPrefixMsg:()=>h,firstCharOptimizedIndices:()=>d,getOptimizedStartCodesIndices:()=>c});var n,s=r(24),o=r(17),i=r(26),a=r(23),l=(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])},n(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)}),u="Complement Sets are not supported for first char optimization",h='Unable to use "first char" lexer optimizations:\n';function c(e,t){void 0===t&&(t=!1);try{var r=(0,i.getRegExpAst)(e);return d(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===u)t&&(0,o.PRINT_WARNING)(h+"\tUnable to optimize: < "+e.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),(0,o.PRINT_ERROR)(h+"\n\tFailed parsing: < "+e.toString()+" >\n\tUsing the regexp-to-ast library version: "+s.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}function d(e,t,r){switch(e.type){case"Disjunction":for(var n=0;n<e.value.length;n++)d(e.value[n],t,r);break;case"Alternative":var s=e.value;for(n=0;n<s.length;n++){var i=s[n];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var l=i;switch(l.type){case"Character":p(l.value,t,r);break;case"Set":if(!0===l.complement)throw Error(u);(0,o.forEach)(l.value,(function(e){if("number"==typeof e)p(e,t,r);else{var n=e;if(!0===r)for(var s=n.from;s<=n.to;s++)p(s,t,r);else{for(s=n.from;s<=n.to&&s<a.minOptimizationVal;s++)p(s,t,r);if(n.to>=a.minOptimizationVal)for(var o=n.from>=a.minOptimizationVal?n.from:a.minOptimizationVal,i=n.to,l=(0,a.charCodeToOptimizedIndex)(o),u=(0,a.charCodeToOptimizedIndex)(i),h=l;h<=u;h++)t[h]=h}}}));break;case"Group":d(l.value,t,r);break;default:throw Error("Non Exhaustive Match")}var h=void 0!==l.quantifier&&0===l.quantifier.atLeast;if("Group"===l.type&&!1===m(l)||"Group"!==l.type&&!1===h)break}break;default:throw Error("non exhaustive match!")}return(0,o.values)(t)}function p(e,t,r){var n=(0,a.charCodeToOptimizedIndex)(e);t[n]=n,!0===r&&function(e,t){var r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){t[s=(0,a.charCodeToOptimizedIndex)(n.charCodeAt(0))]=s}else{var s,o=r.toLowerCase();if(o!==r)t[s=(0,a.charCodeToOptimizedIndex)(o.charCodeAt(0))]=s}}(e,t)}function g(e,t){return(0,o.find)(e.value,(function(e){if("number"==typeof e)return(0,o.contains)(t,e);var r=e;return void 0!==(0,o.find)(t,(function(e){return r.from<=e&&e<=r.to}))}))}function m(e){return!(!e.quantifier||0!==e.quantifier.atLeast)||!!e.value&&((0,o.isArray)(e.value)?(0,o.every)(e.value,m):m(e.value))}var f=function(e){function t(t){var r=e.call(this)||this;return r.targetCharCodes=t,r.found=!1,r}return l(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){(0,o.contains)(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===g(e,this.targetCharCodes)&&(this.found=!0):void 0!==g(e,this.targetCharCodes)&&(this.found=!0)},t}(s.BaseRegExpVisitor);function y(e,t){if(t instanceof RegExp){var r=(0,i.getRegExpAst)(t),n=new f(e);return n.visit(r),n.found}return void 0!==(0,o.find)(t,(function(t){return(0,o.contains)(e,t.charCodeAt(0))}))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearRegExpParserCache:()=>a,getRegExpAst:()=>i});var n=r(24),s={},o=new n.RegExpParser;function i(e){var t=e.toString();if(s.hasOwnProperty(t))return s[t];var r=o.pattern(t);return s[t]=r,r}function a(){s={}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{assignCategoriesMapProp:()=>d,assignCategoriesTokensProp:()=>c,assignTokenDefaultProps:()=>h,augmentTokenTypes:()=>l,expandCategories:()=>u,hasCategoriesProperty:()=>m,hasExtendingTokensTypesMapProperty:()=>y,hasExtendingTokensTypesProperty:()=>f,hasShortKeyProperty:()=>g,isTokenType:()=>E,singleAssignCategoriesToksMap:()=>p,tokenIdxToClass:()=>a,tokenShortNameIdx:()=>i,tokenStructuredMatcher:()=>s,tokenStructuredMatcherNoCategories:()=>o});var n=r(17);function s(e,t){var r=e.tokenTypeIdx;return r===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[r]}function o(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var i=1,a={};function l(e){var t=u(e);h(t),d(t),c(t),(0,n.forEach)(t,(function(e){e.isParent=e.categoryMatches.length>0}))}function u(e){for(var t=(0,n.cloneArr)(e),r=e,s=!0;s;){r=(0,n.compact)((0,n.flatten)((0,n.map)(r,(function(e){return e.CATEGORIES}))));var o=(0,n.difference)(r,t);t=t.concat(o),(0,n.isEmpty)(o)?s=!1:r=o}return t}function h(e){(0,n.forEach)(e,(function(e){g(e)||(a[i]=e,e.tokenTypeIdx=i++),m(e)&&!(0,n.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),m(e)||(e.CATEGORIES=[]),f(e)||(e.categoryMatches=[]),y(e)||(e.categoryMatchesMap={})}))}function c(e){(0,n.forEach)(e,(function(e){e.categoryMatches=[],(0,n.forEach)(e.categoryMatchesMap,(function(t,r){e.categoryMatches.push(a[r].tokenTypeIdx)}))}))}function d(e){(0,n.forEach)(e,(function(e){p([],e)}))}function p(e,t){(0,n.forEach)(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),(0,n.forEach)(t.CATEGORIES,(function(r){var s=e.concat(t);(0,n.contains)(s,r)||p(s,r)}))}function g(e){return(0,n.has)(e,"tokenTypeIdx")}function m(e){return(0,n.has)(e,"CATEGORIES")}function f(e){return(0,n.has)(e,"categoryMatches")}function y(e){return(0,n.has)(e,"categoryMatchesMap")}function E(e){return(0,n.has)(e,"tokenTypeIdx")}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{defaultLexerErrorProvider:()=>n});var n={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,r,n,s){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+r+" characters."}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{first:()=>i,firstForBranching:()=>l,firstForSequence:()=>a,firstForTerminal:()=>u});var n=r(17),s=r(20),o=r(30);function i(e){if(e instanceof s.NonTerminal)return i(e.referencedRule);if(e instanceof s.Terminal)return u(e);if((0,o.isSequenceProd)(e))return a(e);if((0,o.isBranchingProd)(e))return l(e);throw Error("non exhaustive match")}function a(e){for(var t,r=[],s=e.definition,a=0,l=s.length>a,u=!0;l&&u;)t=s[a],u=(0,o.isOptionalProd)(t),r=r.concat(i(t)),a+=1,l=s.length>a;return(0,n.uniq)(r)}function l(e){var t=(0,n.map)(e.definition,(function(e){return i(e)}));return(0,n.uniq)((0,n.flatten)(t))}function u(e){return[e.terminalType]}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DslMethodsCollectorVisitor:()=>d,collectMethods:()=>g,getProductionDslName:()=>c,isBranchingProd:()=>h,isOptionalProd:()=>u,isSequenceProd:()=>l});var n,s=r(17),o=r(20),i=r(31),a=(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])},n(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)});function l(e){return e instanceof o.Flat||e instanceof o.Option||e instanceof o.Repetition||e instanceof o.RepetitionMandatory||e instanceof o.RepetitionMandatoryWithSeparator||e instanceof o.RepetitionWithSeparator||e instanceof o.Terminal||e instanceof o.Rule}function u(e,t){return void 0===t&&(t=[]),!!(e instanceof o.Option||e instanceof o.Repetition||e instanceof o.RepetitionWithSeparator)||(e instanceof o.Alternation?(0,s.some)(e.definition,(function(e){return u(e,t)})):!(e instanceof o.NonTerminal&&(0,s.contains)(t,e))&&(e instanceof o.AbstractProduction&&(e instanceof o.NonTerminal&&t.push(e),(0,s.every)(e.definition,(function(e){return u(e,t)})))))}function h(e){return e instanceof o.Alternation}function c(e){if(e instanceof o.NonTerminal)return"SUBRULE";if(e instanceof o.Option)return"OPTION";if(e instanceof o.Alternation)return"OR";if(e instanceof o.RepetitionMandatory)return"AT_LEAST_ONE";if(e instanceof o.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(e instanceof o.RepetitionWithSeparator)return"MANY_SEP";if(e instanceof o.Repetition)return"MANY";if(e instanceof o.Terminal)return"CONSUME";throw Error("non exhaustive match")}var d=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 a(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,s.has)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";(0,s.has)(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}(i.GAstVisitor),p=new d;function g(e){p.reset(),e.accept(p);var t=p.dslMethods;return p.reset(),t}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{GAstVisitor:()=>s});var n=r(20),s=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case n.NonTerminal:return this.visitNonTerminal(t);case n.Flat:return this.visitFlat(t);case n.Option:return this.visitOption(t);case n.RepetitionMandatory:return this.visitRepetitionMandatory(t);case n.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case n.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case n.Repetition:return this.visitRepetition(t);case n.Alternation:return this.visitAlternation(t);case n.Terminal:return this.visitTerminal(t);case n.Rule:return this.visitRule(t);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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{IN:()=>n});var n="_~IN~_"},(e,t,r)=>{"use strict";r.r(t),r.d(t,{NamedDSLMethodsCollectorVisitor:()=>p,addNoneTerminalToCst:()=>d,addTerminalToCst:()=>c,expandAllNestedRuleNames:()=>g,setNodeLocationFull:()=>h,setNodeLocationOnlyOffset:()=>u});var n,s=r(17),o=r(34),i=r(20),a=r(31),l=(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])},n(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)});function u(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset)}function h(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 c(e,t,r){void 0===e.children[r]?e.children[r]=[t]:e.children[r].push(t)}function d(e,t,r){void 0===e.children[t]?e.children[t]=[r]:e.children[t].push(r)}var p=function(e){function t(t){var r=e.call(this)||this;return r.result=[],r.ruleIdx=t,r}return l(t,e),t.prototype.collectNamedDSLMethod=function(e,t,r){if(!(0,s.isUndefined)(e.name)){var n=void 0;if(e instanceof i.Option||e instanceof i.Repetition||e instanceof i.RepetitionMandatory||e instanceof i.Alternation)n=new t({definition:e.definition,idx:e.idx});else{if(!(e instanceof i.RepetitionMandatoryWithSeparator||e instanceof i.RepetitionWithSeparator))throw Error("non exhaustive match");n=new t({definition:e.definition,idx:e.idx,separator:e.separator})}var a=[n],l=(0,o.getKeyForAutomaticLookahead)(this.ruleIdx,r,e.idx);this.result.push({def:a,key:l,name:e.name,orgProd:e})}},t.prototype.visitOption=function(e){this.collectNamedDSLMethod(e,i.Option,o.OPTION_IDX)},t.prototype.visitRepetition=function(e){this.collectNamedDSLMethod(e,i.Repetition,o.MANY_IDX)},t.prototype.visitRepetitionMandatory=function(e){this.collectNamedDSLMethod(e,i.RepetitionMandatory,o.AT_LEAST_ONE_IDX)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.collectNamedDSLMethod(e,i.RepetitionMandatoryWithSeparator,o.AT_LEAST_ONE_SEP_IDX)},t.prototype.visitRepetitionWithSeparator=function(e){this.collectNamedDSLMethod(e,i.RepetitionWithSeparator,o.MANY_SEP_IDX)},t.prototype.visitAlternation=function(e){var t=this;this.collectNamedDSLMethod(e,i.Alternation,o.OR_IDX);var r=e.definition.length>1;(0,s.forEach)(e.definition,(function(n,a){if(!(0,s.isUndefined)(n.name)){var l=n.definition;l=r?[new i.Option({definition:n.definition})]:n.definition;var u=(0,o.getKeyForAltIndex)(t.ruleIdx,o.OR_IDX,e.idx,a);t.result.push({def:l,key:u,name:n.name,orgProd:n})}}))},t}(a.GAstVisitor);function g(e,t){var r={allRuleNames:[]};return(0,s.forEach)(e,(function(e){var n=t[e.name];r.allRuleNames.push(e.name);var o=new p(n);e.accept(o),(0,s.forEach)(o.result,(function(t){t.def,t.key;var n=t.name;r.allRuleNames.push(e.name+n)}))})),r}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AT_LEAST_ONE_IDX:()=>h,AT_LEAST_ONE_SEP_IDX:()=>d,BITS_FOR_ALT_IDX:()=>i,BITS_FOR_METHOD_TYPE:()=>n,BITS_FOR_OCCURRENCE_IDX:()=>s,BITS_FOR_RULE_IDX:()=>o,MANY_IDX:()=>u,MANY_SEP_IDX:()=>c,OPTION_IDX:()=>l,OR_IDX:()=>a,getKeyForAltIndex:()=>m,getKeyForAutomaticLookahead:()=>p});var n=4,s=8,o=12,i=8,a=1<<s,l=2<<s,u=3<<s,h=4<<s,c=5<<s,d=6<<s;function p(e,t,r){return r|t|e}var g=32-i;function m(e,t,r,n){var s=n+1<<g;return p(e,t,r)|s}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{defaultGrammarResolverErrorProvider:()=>u,defaultGrammarValidatorErrorProvider:()=>h,defaultParserErrorProvider:()=>l});var n=r(21),s=r(17),o=r(20),i=r(30),a=r(36),l={buildMismatchTokenMessage:function(e){var t=e.expected,r=e.actual;e.previous,e.ruleName;return"Expecting "+((0,n.hasTokenLabel)(t)?"--\x3e "+(0,n.tokenLabel)(t)+" <--":"token of type --\x3e "+t.name+" <--")+" but found --\x3e '"+r.image+"' <--"},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,r=e.actual,o=(e.previous,e.customUserDescription),i=(e.ruleName,"Expecting: "),a="\nbut found: '"+(0,s.first)(r).image+"'";if(o)return i+o+a;var l=(0,s.reduce)(t,(function(e,t){return e.concat(t)}),[]),u=(0,s.map)(l,(function(e){return"["+(0,s.map)(e,(function(e){return(0,n.tokenLabel)(e)})).join(", ")+"]"}));return i+("one of these possible Token sequences:\n"+(0,s.map)(u,(function(e,t){return" "+(t+1)+". "+e})).join("\n"))+a},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,r=e.actual,o=e.customUserDescription,i=(e.ruleName,"Expecting: "),a="\nbut found: '"+(0,s.first)(r).image+"'";return o?i+o+a:i+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+(0,s.map)(t,(function(e){return"["+(0,s.map)(e,(function(e){return(0,n.tokenLabel)(e)})).join(",")+"]"})).join(" ,")+">")+a}};Object.freeze(l);var u={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},h={buildDuplicateFoundError:function(e,t){var r,n=e.name,a=(0,s.first)(t),l=a.idx,u=(0,i.getProductionDslName)(a),h=(r=a)instanceof o.Terminal?r.terminalType.name:r instanceof o.NonTerminal?r.nonTerminalName:"",c="->"+u+(l>0?l:"")+"<- "+(h?"with argument: ->"+h+"<-":"")+"\n appears more than once ("+t.length+" times) in the top level rule: ->"+n+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return c=(c=c.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: ->"+a.validNestedRuleName.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,s.first)(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,s.map)(e.prefixPath,(function(e){return(0,n.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin <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,s.map)(e.prefixPath,(function(e){return(0,n.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx,o="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.\n";return o+="See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=(0,i.getProductionDslName)(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;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 "+(t+" --\x3e "+s.map(e.leftRecursionPath,(function(e){return e.name})).concat([t]).join(" --\x3e "))+"\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 o.Rule?e.topLevelRule.name:e.topLevelRule)+"<- is already defined in the grammar: ->"+e.grammarName+"<-"}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{OccurrenceValidationCollector:()=>f,RepetionCollector:()=>b,checkPrefixAlternativesAmbiguities:()=>x,getFirstNoneTerminal:()=>A,identifyProductionForDuplicates:()=>g,validNestedRuleName:()=>E,validTermsPattern:()=>y,validateAmbiguousAlternationAlternatives:()=>M,validateEmptyOrAlternative:()=>O,validateGrammar:()=>p,validateNestedRuleName:()=>T,validateNoLeftRecursion:()=>v,validateRuleDoesNotAlreadyExist:()=>w,validateRuleIsOverridden:()=>S,validateRuleName:()=>C,validateSomeNonEmptyLookaheadPath:()=>_,validateTokenName:()=>R,validateTooManyAlts:()=>I});var n,s=r(17),o=r(16),i=r(30),a=r(37),l=r(33),u=r(38),h=r(20),c=r(31),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])},n(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)});function p(e,t,r,n,a,u){var h=s.map(e,(function(e){return function(e,t){var r=new f;e.accept(r);var n=r.allProductions,a=s.groupBy(n,g),l=s.pick(a,(function(e){return e.length>1})),u=s.map(s.values(l),(function(r){var n=s.first(r),a=t.buildDuplicateFoundError(e,r),l=(0,i.getProductionDslName)(n),u={message:a,type:o.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:l,occurrence:n.idx},h=m(n);return h&&(u.parameter=h),u}));return u}(e,a)})),c=s.map(e,(function(e){return v(e,e,a)})),d=[],p=[],y=[];(0,s.every)(c,s.isEmpty)&&(d=(0,s.map)(e,(function(e){return O(e,a)})),p=(0,s.map)(e,(function(e){return M(e,t,n,a)})),y=_(e,t,a));var E=function(e,t,r){var n=[],i=(0,s.map)(t,(function(e){return e.name}));return(0,s.forEach)(e,(function(e){var t=e.name;if((0,s.contains)(i,t)){var a=r.buildNamespaceConflictError(e);n.push({message:a,type:o.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),n}(e,r,a),S=s.map(r,(function(e){return R(e,a)})),A=function(e,t){var r=[];return(0,s.forEach)(e,(function(e){var n=new l.NamedDSLMethodsCollectorVisitor("");e.accept(n);var o=(0,s.map)(n.result,(function(e){return e.orgProd}));r.push((0,s.map)(o,(function(r){return T(e,r,t)})))})),(0,s.flatten)(r)}(e,a),N=function(e,t){var r=[];return(0,s.forEach)(e,(function(e){var n=new l.NamedDSLMethodsCollectorVisitor("");e.accept(n);var i=(0,s.groupBy)(n.result,(function(e){return e.name})),a=(0,s.pick)(i,(function(e){return e.length>1}));(0,s.forEach)((0,s.values)(a),(function(n){var i=(0,s.map)(n,(function(e){return e.orgProd})),a=t.buildDuplicateNestedRuleNameError(e,i);r.push({message:a,type:o.ParserDefinitionErrorType.DUPLICATE_NESTED_NAME,ruleName:e.name})}))})),r}(e,a),b=(0,s.map)(e,(function(e){return I(e,a)})),x=(0,s.map)(e,(function(e){return C(e,a)})),P=(0,s.map)(e,(function(t){return w(t,e,u,a)}));return s.flatten(h.concat(S,A,N,y,c,d,p,E,b,x,P))}function g(e){return(0,i.getProductionDslName)(e)+"_#_"+e.idx+"_#_"+m(e)}function m(e){return e instanceof h.Terminal?e.terminalType.name:e instanceof h.NonTerminal?e.nonTerminalName:""}var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return d(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}(c.GAstVisitor),y=/^[a-zA-Z_]\w*$/,E=new RegExp(y.source.replace("^","^\\$"));function C(e,t){var r=[],n=e.name;return n.match(y)||r.push({message:t.buildInvalidRuleNameError({topLevelRule:e,expectedPattern:y}),type:o.ParserDefinitionErrorType.INVALID_RULE_NAME,ruleName:n}),r}function T(e,t,r){var n,s=[];return t.name.match(E)||(n=r.buildInvalidNestedRuleNameError(e,t),s.push({message:n,type:o.ParserDefinitionErrorType.INVALID_NESTED_RULE_NAME,ruleName:e.name})),s}function R(e,t){var r=[];return e.name.match(y)||r.push({message:t.buildTokenNameError({tokenType:e,expectedPattern:y}),type:o.ParserDefinitionErrorType.INVALID_TOKEN_NAME}),r}function w(e,t,r,n){var i=[];if((0,s.reduce)(t,(function(t,r){return r.name===e.name?t+1:t}),0)>1){var a=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:a,type:o.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function S(e,t,r){var n,i=[];return s.contains(t,e)||(n="Invalid rule override, rule: ->"+e+"<- cannot be overridden in the grammar: ->"+r+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:o.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:e})),i}function v(e,t,r,n){void 0===n&&(n=[]);var i=[],a=A(t.definition);if(s.isEmpty(a))return[];var l=e.name;s.contains(a,e)&&i.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:o.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:l});var u=s.difference(a,n.concat([e])),h=s.map(u,(function(t){var o=s.cloneArr(n);return o.push(t),v(e,t,r,o)}));return i.concat(s.flatten(h))}function A(e){var t=[];if(s.isEmpty(e))return t;var r=s.first(e);if(r instanceof h.NonTerminal)t.push(r.referencedRule);else if(r instanceof h.Flat||r instanceof h.Option||r instanceof h.RepetitionMandatory||r instanceof h.RepetitionMandatoryWithSeparator||r instanceof h.RepetitionWithSeparator||r instanceof h.Repetition)t=t.concat(A(r.definition));else if(r instanceof h.Alternation)t=s.flatten(s.map(r.definition,(function(e){return A(e.definition)})));else if(!(r instanceof h.Terminal))throw Error("non exhaustive match");var n=(0,i.isOptionalProd)(r),o=e.length>1;if(n&&o){var a=s.drop(e);return t.concat(A(a))}return t}var N=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return d(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(c.GAstVisitor);function O(e,t){var r=new N;e.accept(r);var n=r.alternations;return s.reduce(n,(function(r,n){var i=s.dropRight(n.definition),a=s.map(i,(function(r,i){var a=(0,u.nextPossibleTokensAfter)([r],[],null,1);return s.isEmpty(a)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:o.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}:null}));return r.concat(s.compact(a))}),[])}function M(e,t,r,n){var l=new N;e.accept(l);var u=l.alternations,h=r[e.name];h&&(u=(0,s.reject)(u,(function(e){return h[(0,i.getProductionDslName)(e)+(0===e.idx?"":e.idx)]}))),u=(0,s.reject)(u,(function(e){return!0===e.ignoreAmbiguities}));var c=s.reduce(u,(function(r,i){var l=i.idx,u=i.maxLookahead||t,h=(0,a.getLookaheadPathsForOr)(l,e,u,i),c=function(e,t,r,n){var i=[],l=(0,s.reduce)(e,(function(r,n,o){return!0===t.definition[o].ignoreAmbiguities||(0,s.forEach)(n,(function(n){var l=[o];(0,s.forEach)(e,(function(e,r){o!==r&&(0,a.containsPath)(e,n)&&!0!==t.definition[r].ignoreAmbiguities&&l.push(r)})),l.length>1&&!(0,a.containsPath)(i,n)&&(i.push(n),r.push({alts:l,path:n}))})),r}),[]),u=s.map(l,(function(e){var i=(0,s.map)(e.alts,(function(e){return e+1}));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:o.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:[e.alts]}}));return u}(h,i,e,n),d=x(h,i,e,n);return r.concat(c,d)}),[]);return c}var b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return d(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}(c.GAstVisitor);function I(e,t){var r=new N;e.accept(r);var n=r.alternations;return s.reduce(n,(function(r,n){return n.definition.length>255&&r.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:o.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}),r}),[])}function _(e,t,r){var n=[];return(0,s.forEach)(e,(function(e){var i=new b;e.accept(i);var l=i.allProductions;(0,s.forEach)(l,(function(i){var l=(0,a.getProdType)(i),u=i.maxLookahead||t,h=i.idx,c=(0,a.getLookaheadPathsForOptionalProd)(h,e,l,u)[0];if((0,s.isEmpty)((0,s.flatten)(c))){var d=r.buildEmptyRepetitionError({topLevelRule:e,repetition:i});n.push({message:d,type:o.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),n}function x(e,t,r,n){var i=[],l=(0,s.reduce)(e,(function(e,t,r){var n=(0,s.map)(t,(function(e){return{idx:r,path:e}}));return e.concat(n)}),[]);return(0,s.forEach)(l,(function(e){if(!0!==t.definition[e.idx].ignoreAmbiguities){var u=e.idx,h=e.path,c=(0,s.findAll)(l,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<u&&(0,a.isStrictPrefixOfPath)(e.path,h)})),d=(0,s.map)(c,(function(e){var s=[e.idx+1,u+1],i=0===t.idx?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:s,prefixPath:e.path}),type:o.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:i,alternatives:s}}));i=i.concat(d)}})),i}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{PROD_TYPE:()=>s,areTokenCategoriesNotUsed:()=>O,buildAlternativesLookAheadFunc:()=>m,buildLookaheadFuncForOptionalProd:()=>g,buildLookaheadFuncForOr:()=>p,buildSingleAlternativeLookaheadFunction:()=>f,containsPath:()=>A,getLookaheadPathsForOptionalProd:()=>v,getLookaheadPathsForOr:()=>S,getProdType:()=>d,isStrictPrefixOfPath:()=>N,lookAheadSequenceFromAlternatives:()=>w});var n,s,o=r(17),i=r(38),a=r(19),l=r(27),u=r(20),h=r(31),c=(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])},n(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)});function d(e){if(e instanceof u.Option)return s.OPTION;if(e instanceof u.Repetition)return s.REPETITION;if(e instanceof u.RepetitionMandatory)return s.REPETITION_MANDATORY;if(e instanceof u.RepetitionMandatoryWithSeparator)return s.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof u.RepetitionWithSeparator)return s.REPETITION_WITH_SEPARATOR;if(e instanceof u.Alternation)return s.ALTERNATION;throw Error("non exhaustive match")}function p(e,t,r,n,s,o){var i=S(e,t,r);return o(i,n,O(i)?l.tokenStructuredMatcherNoCategories:l.tokenStructuredMatcher,s)}function g(e,t,r,n,s,o){var i=v(e,t,s,r),a=O(i)?l.tokenStructuredMatcherNoCategories:l.tokenStructuredMatcher;return o(i[0],a,n)}function m(e,t,r,n){var s=e.length,i=(0,o.every)(e,(function(e){return(0,o.every)(e,(function(e){return 1===e.length}))}));if(t)return function(t){for(var n=(0,o.map)(t,(function(e){return e.GATE})),i=0;i<s;i++){var a=e[i],l=a.length,u=n[i];if(void 0===u||!1!==u.call(this))e:for(var h=0;h<l;h++){for(var c=a[h],d=c.length,p=0;p<d;p++){var g=this.LA(p+1);if(!1===r(g,c[p]))continue e}return i}}};if(i&&!n){var a=(0,o.map)(e,(function(e){return(0,o.flatten)(e)})),l=(0,o.reduce)(a,(function(e,t,r){return(0,o.forEach)(t,(function(t){(0,o.has)(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=r),(0,o.forEach)(t.categoryMatches,(function(t){(0,o.has)(e,t)||(e[t]=r)}))})),e}),[]);return function(){var e=this.LA(1);return l[e.tokenTypeIdx]}}return function(){for(var t=0;t<s;t++){var n=e[t],o=n.length;e:for(var i=0;i<o;i++){for(var a=n[i],l=a.length,u=0;u<l;u++){var h=this.LA(u+1);if(!1===r(h,a[u]))continue e}return t}}}}function f(e,t,r){var n=(0,o.every)(e,(function(e){return 1===e.length})),s=e.length;if(n&&!r){var i=(0,o.flatten)(e);if(1===i.length&&(0,o.isEmpty)(i[0].categoryMatches)){var a=i[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}var l=(0,o.reduce)(i,(function(e,t,r){return e[t.tokenTypeIdx]=!0,(0,o.forEach)(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===l[e.tokenTypeIdx]}}return function(){e:for(var r=0;r<s;r++){for(var n=e[r],o=n.length,i=0;i<o;i++){var a=this.LA(i+1);if(!1===t(a,n[i]))continue e}return!0}return!1}}!function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"}(s||(s={}));var y=function(e){function t(t,r,n){var s=e.call(this)||this;return s.topProd=t,s.targetOccurrence=r,s.targetProdType=n,s}return c(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,r,n){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=r.concat(n),!0)},t.prototype.walkOption=function(t,r,n){this.checkIsTarget(t,s.OPTION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOne=function(t,r,n){this.checkIsTarget(t,s.REPETITION_MANDATORY,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOneSep=function(t,r,n){this.checkIsTarget(t,s.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkMany=function(t,r,n){this.checkIsTarget(t,s.REPETITION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkManySep=function(t,r,n){this.checkIsTarget(t,s.REPETITION_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t}(a.RestWalker),E=function(e){function t(t,r,n){var s=e.call(this)||this;return s.targetOccurrence=t,s.targetProdType=r,s.targetRef=n,s.result=[],s}return c(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,s.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,s.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,s.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,s.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,s.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,s.ALTERNATION)},t}(h.GAstVisitor);function C(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=[];return t}function T(e){for(var t=[""],r=0;r<e.length;r++){for(var n=e[r],s=[],o=0;o<t.length;o++){var i=t[o];s.push(i+"_"+n.tokenTypeIdx);for(var a=0;a<n.categoryMatches.length;a++){var l="_"+n.categoryMatches[a];s.push(i+l)}}t=s}return t}function R(e,t,r){for(var n=0;n<e.length;n++)if(n!==r)for(var s=e[n],o=0;o<t.length;o++){if(!0===s[t[o]])return!1}return!0}function w(e,t){for(var r=(0,o.map)(e,(function(e){return(0,i.possiblePathsFrom)([e],1)})),n=C(r.length),s=(0,o.map)(r,(function(e){var t={};return(0,o.forEach)(e,(function(e){var r=T(e.partialPath);(0,o.forEach)(r,(function(e){t[e]=!0}))})),t})),a=r,l=1;l<=t;l++){var u=a;a=C(u.length);for(var h=function(e){for(var r=u[e],h=0;h<r.length;h++){var c=r[h].partialPath,d=r[h].suffixDef,p=T(c);if(R(s,p,e)||(0,o.isEmpty)(d)||c.length===t){var g=n[e];if(!1===A(g,c)){g.push(c);for(var m=0;m<p.length;m++){var f=p[m];s[e][f]=!0}}}else{var y=(0,i.possiblePathsFrom)(d,l+1,c);a[e]=a[e].concat(y),(0,o.forEach)(y,(function(t){var r=T(t.partialPath);(0,o.forEach)(r,(function(t){s[e][t]=!0}))}))}}},c=0;c<u.length;c++)h(c)}return n}function S(e,t,r,n){var o=new E(e,s.ALTERNATION,n);return t.accept(o),w(o.result,r)}function v(e,t,r,n){var s=new E(e,r);t.accept(s);var o=s.result,i=new y(t,e,r).startWalking();return w([new u.Flat({definition:o}),new u.Flat({definition:i})],n)}function A(e,t){e:for(var r=0;r<e.length;r++){var n=e[r];if(n.length===t.length){for(var s=0;s<n.length;s++){var o=t[s],i=n[s];if(!1===(o===i||void 0!==i.categoryMatchesMap[o.tokenTypeIdx]))continue e}return!0}}return!1}function N(e,t){return e.length<t.length&&(0,o.every)(e,(function(e,r){var n=t[r];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}))}function O(e){return(0,o.every)(e,(function(e){return(0,o.every)(e,(function(e){return(0,o.every)(e,(function(e){return(0,o.isEmpty)(e.categoryMatches)}))}))}))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractNextPossibleTokensWalker:()=>u,AbstractNextTerminalAfterProductionWalker:()=>c,NextAfterTokenWalker:()=>h,NextTerminalAfterAtLeastOneSepWalker:()=>m,NextTerminalAfterAtLeastOneWalker:()=>g,NextTerminalAfterManySepWalker:()=>p,NextTerminalAfterManyWalker:()=>d,nextPossibleTokensAfter:()=>y,possiblePathsFrom:()=>f});var n,s=r(19),o=r(17),i=r(29),a=r(20),l=(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])},n(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)}),u=function(e){function t(t,r){var n=e.call(this)||this;return n.topProd=t,n.path=r,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return l(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,o.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,o.cloneArr)(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 n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}},t.prototype.updateExpectedNext=function(){(0,o.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(s.RestWalker),h=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.path=r,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return l(t,e),t.prototype.walkTerminal=function(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var n=t.concat(r),s=new a.Flat({definition:n});this.possibleTokTypes=(0,i.first)(s),this.found=!0}},t}(u),c=function(e){function t(t,r){var n=e.call(this)||this;return n.topRule=t,n.occurrence=r,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return l(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(s.RestWalker),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.walkMany=function(t,r,n){if(t.idx===this.occurrence){var s=(0,o.first)(r.concat(n));this.result.isEndOfRule=void 0===s,s instanceof a.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else e.prototype.walkMany.call(this,t,r,n)},t}(c),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.walkManySep=function(t,r,n){if(t.idx===this.occurrence){var s=(0,o.first)(r.concat(n));this.result.isEndOfRule=void 0===s,s instanceof a.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else e.prototype.walkManySep.call(this,t,r,n)},t}(c),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.walkAtLeastOne=function(t,r,n){if(t.idx===this.occurrence){var s=(0,o.first)(r.concat(n));this.result.isEndOfRule=void 0===s,s instanceof a.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else e.prototype.walkAtLeastOne.call(this,t,r,n)},t}(c),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.walkAtLeastOneSep=function(t,r,n){if(t.idx===this.occurrence){var s=(0,o.first)(r.concat(n));this.result.isEndOfRule=void 0===s,s instanceof a.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,r,n)},t}(c);function f(e,t,r){void 0===r&&(r=[]),r=(0,o.cloneArr)(r);var n=[],s=0;function i(i){var a=f(i.concat((0,o.drop)(e,s+1)),t,r);return n.concat(a)}for(;r.length<t&&s<e.length;){var l=e[s];if(l instanceof a.Flat)return i(l.definition);if(l instanceof a.NonTerminal)return i(l.definition);if(l instanceof a.Option)n=i(l.definition);else{if(l instanceof a.RepetitionMandatory)return i(u=l.definition.concat([new a.Repetition({definition:l.definition})]));if(l instanceof a.RepetitionMandatoryWithSeparator)return i(u=[new a.Flat({definition:l.definition}),new a.Repetition({definition:[new a.Terminal({terminalType:l.separator})].concat(l.definition)})]);if(l instanceof a.RepetitionWithSeparator){var u=l.definition.concat([new a.Repetition({definition:[new a.Terminal({terminalType:l.separator})].concat(l.definition)})]);n=i(u)}else if(l instanceof a.Repetition){u=l.definition.concat([new a.Repetition({definition:l.definition})]);n=i(u)}else{if(l instanceof a.Alternation)return(0,o.forEach)(l.definition,(function(e){n=i(e.definition)})),n;if(!(l instanceof a.Terminal))throw Error("non exhaustive match");r.push(l.terminalType)}}s++}return n.push({partialPath:r,suffixDef:(0,o.drop)(e,s)}),n}function y(e,t,r,n){var s="EXIT_NONE_TERMINAL",i=[s],l="EXIT_ALTERNATIVE",u=!1,h=t.length,c=h-n-1,d=[],p=[];for(p.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!(0,o.isEmpty)(p);){var g=p.pop();if(g!==l){var m=g.def,f=g.idx,y=g.ruleStack,C=g.occurrenceStack;if(!(0,o.isEmpty)(m)){var T=m[0];if(T===s){var R={idx:f,def:(0,o.drop)(m),ruleStack:(0,o.dropRight)(y),occurrenceStack:(0,o.dropRight)(C)};p.push(R)}else if(T instanceof a.Terminal)if(f<h-1){var w=f+1;if(r(t[w],T.terminalType)){R={idx:w,def:(0,o.drop)(m),ruleStack:y,occurrenceStack:C};p.push(R)}}else{if(f!==h-1)throw Error("non exhaustive match");d.push({nextTokenType:T.terminalType,nextTokenOccurrence:T.idx,ruleStack:y,occurrenceStack:C}),u=!0}else if(T instanceof a.NonTerminal){var S=(0,o.cloneArr)(y);S.push(T.nonTerminalName);var v=(0,o.cloneArr)(C);v.push(T.idx);R={idx:f,def:T.definition.concat(i,(0,o.drop)(m)),ruleStack:S,occurrenceStack:v};p.push(R)}else if(T instanceof a.Option){var A={idx:f,def:(0,o.drop)(m),ruleStack:y,occurrenceStack:C};p.push(A),p.push(l);var N={idx:f,def:T.definition.concat((0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(N)}else if(T instanceof a.RepetitionMandatory){var O=new a.Repetition({definition:T.definition,idx:T.idx});R={idx:f,def:T.definition.concat([O],(0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(R)}else if(T instanceof a.RepetitionMandatoryWithSeparator){var M=new a.Terminal({terminalType:T.separator});O=new a.Repetition({definition:[M].concat(T.definition),idx:T.idx}),R={idx:f,def:T.definition.concat([O],(0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(R)}else if(T instanceof a.RepetitionWithSeparator){A={idx:f,def:(0,o.drop)(m),ruleStack:y,occurrenceStack:C};p.push(A),p.push(l);M=new a.Terminal({terminalType:T.separator});var b=new a.Repetition({definition:[M].concat(T.definition),idx:T.idx});N={idx:f,def:T.definition.concat([b],(0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(N)}else if(T instanceof a.Repetition){A={idx:f,def:(0,o.drop)(m),ruleStack:y,occurrenceStack:C};p.push(A),p.push(l);b=new a.Repetition({definition:T.definition,idx:T.idx}),N={idx:f,def:T.definition.concat([b],(0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(N)}else if(T instanceof a.Alternation)for(var I=T.definition.length-1;I>=0;I--){var _={idx:f,def:T.definition[I].definition.concat((0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(_),p.push(l)}else if(T instanceof a.Flat)p.push({idx:f,def:T.definition.concat((0,o.drop)(m)),ruleStack:y,occurrenceStack:C});else{if(!(T instanceof a.Rule))throw Error("non exhaustive match");p.push(E(T,f,y,C))}}}else u&&(0,o.last)(p).idx<=c&&p.pop()}return d}function E(e,t,r,n){var s=(0,o.cloneArr)(r);s.push(e.name);var i=(0,o.cloneArr)(n);return i.push(1),{idx:t,def:e.definition,ruleStack:s,occurrenceStack:i}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{assignOccurrenceIndices:()=>h,resolveGrammar:()=>l,validateGrammar:()=>u});var n=r(17),s=r(40),o=r(36),i=r(35),a=r(30);function l(e){e=(0,n.defaults)(e,{errMsgProvider:i.defaultGrammarResolverErrorProvider});var t={};return(0,n.forEach)(e.rules,(function(e){t[e.name]=e})),(0,s.resolveGrammar)(t,e.errMsgProvider)}function u(e){return e=(0,n.defaults)(e,{errMsgProvider:i.defaultGrammarValidatorErrorProvider,ignoredIssues:{}}),(0,o.validateGrammar)(e.rules,e.maxLookahead,e.tokenTypes,e.ignoredIssues,e.errMsgProvider,e.grammarName)}function h(e){(0,n.forEach)(e.rules,(function(e){var t=new a.DslMethodsCollectorVisitor;e.accept(t),(0,n.forEach)(t.dslMethods,(function(e){(0,n.forEach)(e,(function(e,t){e.idx=t+1}))}))}))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{GastRefResolverVisitor:()=>u,resolveGrammar:()=>l});var n,s=r(16),o=r(17),i=r(31),a=(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])},n(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)});function l(e,t){var r=new u(e,t);return r.resolveRefs(),r.errors}var u=function(e){function t(t,r){var n=e.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=r,n.errors=[],n}return a(t,e),t.prototype.resolveRefs=function(){var e=this;(0,o.forEach)((0,o.values)(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:s.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(i.GAstVisitor)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EOF_FOLLOW_KEY:()=>l,IN_RULE_RECOVERY_EXCEPTION:()=>u,InRuleRecoveryException:()=>h,Recoverable:()=>c,attemptInRepetitionRecovery:()=>d});var n=r(21),s=r(17),o=r(42),i=r(32),a=r(16),l={},u="InRuleRecoveryException";function h(e){this.name=u,this.message=e}h.prototype=Error.prototype;var c=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,s.has)(e,"recoveryEnabled")?e.recoveryEnabled:a.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=d)},e.prototype.getTokenToInsert=function(e){var t=(0,n.createTokenInstance)(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,n){for(var i=this,a=this.findReSyncTokenType(),l=this.exportLexerState(),u=[],h=!1,c=this.LA(1),d=this.LA(1),p=function(){var e=i.LA(0),t=i.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:c,previous:e,ruleName:i.getCurrRuleFullName()}),r=new o.MismatchedTokenException(t,c,i.LA(0));r.resyncedTokens=(0,s.dropRight)(u),i.SAVE_ERROR(r)};!h;){if(this.tokenMatcher(d,n))return void p();if(r.call(this))return p(),void e.apply(this,t);this.tokenMatcher(d,a)?h=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,u))}this.importLexerState(l)},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 h("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))return!1;if((0,s.isEmpty)(t))return!1;var n=this.LA(1);return void 0!==(0,s.find)(t,(function(e){return r.tokenMatcher(n,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,s.contains)(r,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var n=t.tokenType;if((0,s.contains)(e,n))return n;t=this.LA(r),r++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return l;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return(0,s.isEmpty)(this.LAST_EXPLICIT_RULE_STACK)||(t=(0,s.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_STACK[t]})),r=(0,s.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_OCCURRENCE_STACK[t]}))),(0,s.map)(t,(function(n,s){return 0===s?l:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:r[s],inRule:e.shortRuleNameToFullName(t[s-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=(0,s.map)(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return(0,s.flatten)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===l)return[n.EOF];var t=e.ruleName+e.idxInCallingRule+i.IN+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,n.EOF)||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,s.dropRight)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,r,n,s,o,i){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,s.cloneArr)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,s.isEmpty)(this.LAST_EXPLICIT_RULE_STACK)?(0,s.map)(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)})):(0,s.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.shortRuleNameToFullName(e.RULE_STACK[t])}))},e}();function d(e,t,r,s,o,i,a){var l=this.getKeyForAutomaticLookahead(s,o),u=this.firstAfterRepMap[l];if(void 0===u){var h=this.getCurrRuleFullName();u=new i(this.getGAstProductions()[h],o).startWalking(),this.firstAfterRepMap[l]=u}var c=u.token,d=u.occurrence,p=u.isEndOfRule;1===this.RULE_STACK.length&&p&&void 0===c&&(c=n.EOF,d=1),this.shouldInRepetitionRecoveryBeTried(c,d,a)&&this.tryInRepetitionRecovery(e,t,r,c)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EarlyExitException:()=>p,MismatchedTokenException:()=>h,NoViableAltException:()=>c,NotAllInputParsedException:()=>d,isRecognitionException:()=>u});var n=r(17),s="MismatchedTokenException",o="NoViableAltException",i="EarlyExitException",a="NotAllInputParsedException",l=[s,o,i,a];function u(e){return(0,n.contains)(l,e.name)}function h(e,t,r){this.name=s,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function c(e,t,r){this.name=o,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function d(e,t){this.name=a,this.message=e,this.token=t,this.resyncedTokens=[]}function p(e,t,r){this.name=i,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}Object.freeze(l),h.prototype=Error.prototype,c.prototype=Error.prototype,d.prototype=Error.prototype,p.prototype=Error.prototype},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LooksAhead:()=>l});var n=r(37),s=r(17),o=r(16),i=r(34),a=r(30),l=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,s.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:o.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,s.has)(e,"maxLookahead")?e.maxLookahead:o.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,s.isES2015MapSupported)()?new Map:[],(0,s.isES2015MapSupported)()?(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,s.forEach)(e,(function(e){t.TRACE_INIT(e.name+" Rule Lookahead",(function(){var r=(0,a.collectMethods)(e),o=r.alternation,l=r.repetition,u=r.option,h=r.repetitionMandatory,c=r.repetitionMandatoryWithSeparator,d=r.repetitionWithSeparator;(0,s.forEach)(o,(function(r){var s=0===r.idx?"":r.idx;t.TRACE_INIT(""+(0,a.getProductionDslName)(r)+s,(function(){var s=(0,n.buildLookaheadFuncForOr)(r.idx,e,r.maxLookahead||t.maxLookahead,r.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),o=(0,i.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[e.name],i.OR_IDX,r.idx);t.setLaFuncCache(o,s)}))})),(0,s.forEach)(l,(function(r){t.computeLookaheadFunc(e,r.idx,i.MANY_IDX,n.PROD_TYPE.REPETITION,r.maxLookahead,(0,a.getProductionDslName)(r))})),(0,s.forEach)(u,(function(r){t.computeLookaheadFunc(e,r.idx,i.OPTION_IDX,n.PROD_TYPE.OPTION,r.maxLookahead,(0,a.getProductionDslName)(r))})),(0,s.forEach)(h,(function(r){t.computeLookaheadFunc(e,r.idx,i.AT_LEAST_ONE_IDX,n.PROD_TYPE.REPETITION_MANDATORY,r.maxLookahead,(0,a.getProductionDslName)(r))})),(0,s.forEach)(c,(function(r){t.computeLookaheadFunc(e,r.idx,i.AT_LEAST_ONE_SEP_IDX,n.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,r.maxLookahead,(0,a.getProductionDslName)(r))})),(0,s.forEach)(d,(function(r){t.computeLookaheadFunc(e,r.idx,i.MANY_SEP_IDX,n.PROD_TYPE.REPETITION_WITH_SEPARATOR,r.maxLookahead,(0,a.getProductionDslName)(r))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,r,s,o,a){var l=this;this.TRACE_INIT(""+a+(0===t?"":t),(function(){var a=(0,n.buildLookaheadFuncForOptionalProd)(t,e,o||l.maxLookahead,l.dynamicTokensEnabled,s,l.lookAheadBuilderForOptional),u=(0,i.getKeyForAutomaticLookahead)(l.fullRuleNameToShort[e.name],r,t);l.setLaFuncCache(u,a)}))},e.prototype.lookAheadBuilderForOptional=function(e,t,r){return(0,n.buildSingleAlternativeLookaheadFunction)(e,t,r)},e.prototype.lookAheadBuilderForAlternatives=function(e,t,r,s){return(0,n.buildAlternativesLookAheadFunc)(e,t,r,s)},e.prototype.getKeyForAutomaticLookahead=function(e,t){var r=this.getLastExplicitRuleShortName();return(0,i.getKeyForAutomaticLookahead)(r,e,t)},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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TreeBuilder:()=>l});var n=r(33),s=r(17),o=r(45),i=r(34),a=r(16),l=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.outputCst=(0,s.has)(e,"outputCst")?e.outputCst:a.DEFAULT_PARSER_CONFIG.outputCst,this.nodeLocationTracking=(0,s.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:a.DEFAULT_PARSER_CONFIG.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=n.setNodeLocationFull,this.setNodeLocationFromNode=n.setNodeLocationFull,this.cstPostRule=s.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=s.NOOP,this.setNodeLocationFromNode=s.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=n.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=n.setNodeLocationOnlyOffset,this.cstPostRule=s.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=s.NOOP,this.setNodeLocationFromNode=s.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"');this.setNodeLocationFromToken=s.NOOP,this.setNodeLocationFromNode=s.NOOP,this.cstPostRule=s.NOOP,this.setInitialNodeLocation=s.NOOP}else this.cstInvocationStateUpdate=s.NOOP,this.cstFinallyStateUpdate=s.NOOP,this.cstPostTerminal=s.NOOP,this.cstPostNonTerminal=s.NOOP,this.cstPostRule=s.NOOP,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];(0,n.addTerminalToCst)(r,t,e),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];(0,n.addNoneTerminalToCst)(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}},e.prototype.getBaseCstVisitorConstructor=function(){if((0,s.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,o.createBaseSemanticVisitorConstructor)(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,s.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,o.createBaseVisitorConstructorWithDefaults)(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}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,n){var s,o=this.getLastExplicitRuleShortName(),a=(0,i.getKeyForAltIndex)(o,r,t,n);return void 0!==e.NAME?(s=e.NAME,this.nestedRuleInvocationStateUpdate(s,a),{shortName:a,nestedName:s}):void 0},e.prototype.nestedRuleFinallyClause=function(e,t){var r=this.CST_STACK,s=r[r.length-1];this.nestedRuleFinallyStateUpdate();var o=r[r.length-1];(0,n.addNoneTerminalToCst)(o,t,s),this.setNodeLocationFromNode(o.location,s.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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CstVisitorDefinitionError:()=>n,createBaseSemanticVisitorConstructor:()=>l,createBaseVisitorConstructorWithDefaults:()=>u,defaultVisit:()=>a,validateMissingCstMethods:()=>c,validateRedundantMethods:()=>p,validateVisitor:()=>h});var n,s=r(17),o=r(46),i=r(36);function a(e,t){for(var r=(0,s.keys)(e),n=r.length,o=0;o<n;o++)for(var i=e[r[o]],a=i.length,l=0;l<a;l++){var u=i[l];void 0===u.tokenTypeIdx&&(void 0!==u.fullName?this[u.fullName](u.children,t):this[u.name](u.children,t))}}function l(e,t){var r=function(){};return(0,o.defineNameProp)(r,e+"BaseSemantics"),(r.prototype={visit:function(e,t){if((0,s.isArray)(e)&&(e=e[0]),!(0,s.isUndefined)(e))return void 0!==e.fullName?this[e.fullName](e.children,t):this[e.name](e.children,t)},validateVisitor:function(){var e=h(this,t);if(!(0,s.isEmpty)(e)){var r=(0,s.map)(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <"+(0,o.functionName)(this.constructor)+">:\n\t"+r.join("\n\n").replace(/\n/g,"\n\t"))}}}).constructor=r,r._RULE_NAMES=t,r}function u(e,t,r){var n=function(){};(0,o.defineNameProp)(n,e+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,s.forEach)(t,(function(e){i[e]=a})),(n.prototype=i).constructor=n,n}function h(e,t){var r=c(e,t),n=p(e,t);return r.concat(n)}function c(e,t){var r=(0,s.map)(t,(function(t){if(!(0,s.isFunction)(e[t]))return{msg:"Missing visitor method: <"+t+"> on "+(0,o.functionName)(e.constructor)+" CST Visitor.",type:n.MISSING_METHOD,methodName:t}}));return(0,s.compact)(r)}!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(n||(n={}));var d=["constructor","visit","validateVisitor"];function p(e,t){var r=[];for(var a in e)i.validTermsPattern.test(a)&&(0,s.isFunction)(e[a])&&!(0,s.contains)(d,a)&&!(0,s.contains)(t,a)&&r.push({msg:"Redundant visitor method: <"+a+"> on "+(0,o.functionName)(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 /"+i.validTermsPattern.source+"/.",type:n.REDUNDANT_METHOD,methodName:a});return r}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{classNameFromInstance:()=>s,defineNameProp:()=>l,functionName:()=>a});var n=r(17);function s(e){return a(e.constructor)}var o=/^\s*function\s*(\S*)\s*\(/,i="name";function a(e){var t=e.name;return t||e.toString().match(o)[1]}function l(e,t){var r=Object.getOwnPropertyDescriptor(e,i);return!(!(0,n.isUndefined)(r)&&!r.configurable)&&(Object.defineProperty(e,i,{enumerable:!1,configurable:!0,writable:!1,value:t}),!0)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LexerAdapter:()=>s});var n=r(16),s=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)):n.END_OF_FILE},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?n.END_OF_FILE: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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RecognizerApi:()=>u});var n=r(17),s=r(42),o=r(16),i=r(35),a=r(36),l=r(20),u=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=o.DEFAULT_RULE_CONFIG),(0,n.contains)(this.definedRulesNames,e)){var s={message:i.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:o.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);var a=this.defineRule(e,t,r);return this[e]=a,a},e.prototype.OVERRIDE_RULE=function(e,t,r){void 0===r&&(r=o.DEFAULT_RULE_CONFIG);var n=[];n=n.concat((0,a.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,n);var s=this.defineRule(e,t,r);return this[e]=s,s},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((0,s.isRecognitionException)(e))return!1;throw e}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return(0,l.serializeGrammar)((0,n.values)(this.gastProductionsCache))},e}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RecognizerEngine:()=>p});var n=r(17),s=r(34),o=r(42),i=r(37),a=r(38),l=r(16),u=r(41),h=r(21),c=r(27),d=r(46),p=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=(0,d.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=c.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,n.has)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,n.isArray)(e)){if((0,n.isEmpty)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis 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\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if((0,n.isArray)(e))this.tokensMap=(0,n.reduce)(e,(function(e,t){return e[t.name]=t,e}),{});else if((0,n.has)(e,"modes")&&(0,n.every)((0,n.flatten)((0,n.values)(e.modes)),c.isTokenType)){var r=(0,n.flatten)((0,n.values)(e.modes)),s=(0,n.uniq)(r);this.tokensMap=(0,n.reduce)(s,(function(e,t){return e[t.name]=t,e}),{})}else{if(!(0,n.isObject)(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,n.cloneObj)(e)}this.tokensMap.EOF=h.EOF;var o=(0,n.every)((0,n.values)(e),(function(e){return(0,n.isEmpty)(e.categoryMatches)}));this.tokenMatcher=o?c.tokenStructuredMatcherNoCategories:c.tokenStructuredMatcher,(0,c.augmentTokenTypes)((0,n.values)(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 o,i=(0,n.has)(r,"resyncEnabled")?r.resyncEnabled:l.DEFAULT_RULE_CONFIG.resyncEnabled,a=(0,n.has)(r,"recoveryValueFunc")?r.recoveryValueFunc:l.DEFAULT_RULE_CONFIG.recoveryValueFunc,u=this.ruleShortNameIdx<<s.BITS_FOR_METHOD_TYPE+s.BITS_FOR_OCCURRENCE_IDX;function h(e){try{if(!0===this.outputCst){t.apply(this,e);var r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}return t.apply(this,e)}catch(e){return this.invokeRuleCatch(e,i,a)}finally{this.ruleFinallyStateUpdate()}}this.ruleShortNameIdx++,this.shortRuleNameToFull[u]=e,this.fullRuleNameToShort[e]=u;return(o=function(t,r){return void 0===t&&(t=0),this.ruleInvocationStateUpdate(u,e,t),h.call(this,r)}).ruleName=e,o.originalGrammarAction=t,o},e.prototype.invokeRuleCatch=function(e,t,r){var n=1===this.RULE_STACK.length,s=t&&!this.isBackTracking()&&this.recoveryEnabled;if((0,o.isRecognitionException)(e)){var i=e;if(s){var a,l=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(l))return i.resyncedTokens=this.reSyncTo(l),this.outputCst?((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,a):r();throw this.outputCst&&((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,i.partialCstResult=a),i}if(n)return this.moveToTerminatedState(),r();throw i}throw e},e.prototype.optionInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.OPTION_IDX,t),n=this.nestedRuleBeforeClause(e,r);try{return this.optionInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.optionInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.OPTION_IDX,t);return this.optionInternalLogic(e,t,r)},e.prototype.optionInternalLogic=function(e,t,r){var n,s,o=this,i=this.getLaFuncFromCache(r);if(void 0!==e.DEF){if(n=e.DEF,void 0!==(s=e.GATE)){var a=i;i=function(){return s.call(o)&&a.call(o)}}}else n=e;if(!0===i.call(this))return n.call(this)},e.prototype.atLeastOneInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.AT_LEAST_ONE_IDX,e),n=this.nestedRuleBeforeClause(t,r);try{return this.atLeastOneInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.atLeastOneInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.AT_LEAST_ONE_IDX,e);this.atLeastOneInternalLogic(e,t,r)},e.prototype.atLeastOneInternalLogic=function(e,t,r){var n,o,l=this,u=this.getLaFuncFromCache(r);if(void 0!==t.DEF){if(n=t.DEF,void 0!==(o=t.GATE)){var h=u;u=function(){return o.call(l)&&h.call(l)}}}else n=t;if(!0!==u.call(this))throw this.raiseEarlyExitException(e,i.PROD_TYPE.REPETITION_MANDATORY,t.ERR_MSG);for(var c=this.doSingleRepetition(n);!0===u.call(this)&&!0===c;)c=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],u,s.AT_LEAST_ONE_IDX,e,a.NextTerminalAfterAtLeastOneWalker)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.AT_LEAST_ONE_SEP_IDX,e),n=this.nestedRuleBeforeClause(t,r);try{this.atLeastOneSepFirstInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.atLeastOneSepFirstInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,t,r)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,r){var n=this,o=t.DEF,l=t.SEP;if(!0!==this.getLaFuncFromCache(r).call(this))throw this.raiseEarlyExitException(e,i.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);o.call(this);for(var u=function(){return n.tokenMatcher(n.LA(1),l)};!0===this.tokenMatcher(this.LA(1),l);)this.CONSUME(l),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,l,u,o,a.NextTerminalAfterAtLeastOneSepWalker],u,s.AT_LEAST_ONE_SEP_IDX,e,a.NextTerminalAfterAtLeastOneSepWalker)},e.prototype.manyInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.MANY_IDX,e),n=this.nestedRuleBeforeClause(t,r);try{return this.manyInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.manyInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.MANY_IDX,e);return this.manyInternalLogic(e,t,r)},e.prototype.manyInternalLogic=function(e,t,r){var n,o,i=this,l=this.getLaFuncFromCache(r);if(void 0!==t.DEF){if(n=t.DEF,void 0!==(o=t.GATE)){var u=l;l=function(){return o.call(i)&&u.call(i)}}}else n=t;for(var h=!0;!0===l.call(this)&&!0===h;)h=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],l,s.MANY_IDX,e,a.NextTerminalAfterManyWalker,h)},e.prototype.manySepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.MANY_SEP_IDX,e),n=this.nestedRuleBeforeClause(t,r);try{this.manySepFirstInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.manySepFirstInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,t,r)},e.prototype.manySepFirstInternalLogic=function(e,t,r){var n=this,o=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){o.call(this);for(var l=function(){return n.tokenMatcher(n.LA(1),i)};!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,l,o,a.NextTerminalAfterManySepWalker],l,s.MANY_SEP_IDX,e,a.NextTerminalAfterManySepWalker)}},e.prototype.repetitionSepSecondInternal=function(e,t,r,n,o){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,o],r,s.AT_LEAST_ONE_SEP_IDX,e,o)},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,n.isArray)(e)?e:e.DEF,o=this.getKeyForAutomaticLookahead(s.OR_IDX,t),i=this.getLaFuncFromCache(o).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.orInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.OR_IDX,t),o=this.nestedRuleBeforeClause(e,r);try{var i=(0,n.isArray)(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(void 0!==a){var l=i[a],u=this.nestedAltBeforeClause(l,t,s.OR_IDX,a);try{return l.ALT.call(this)}finally{void 0!==u&&this.nestedRuleFinallyClause(u.shortName,u.nestedName)}}this.raiseNoAltException(t,e.ERR_MSG)}finally{void 0!==o&&this.nestedRuleFinallyClause(r,o)}},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 o.NotAllInputParsedException(t,e))}},e.prototype.subruleInternal=function(e,t,r){var n;try{var s=void 0!==r?r.ARGS:void 0;return n=e.call(this,t,s),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:e.ruleName),n}catch(t){this.subruleInternalError(t,r,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,r){throw(0,o.isRecognitionException)(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 n;try{var s=this.LA(1);!0===this.tokenMatcher(s,e)?(this.consumeToken(),n=s):this.consumeInternalError(e,s,r)}catch(r){n=this.consumeInternalRecovery(e,t,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:e.name,n),n},e.prototype.consumeInternalError=function(e,t,r){var n,s=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new o.MismatchedTokenException(n,t,s))},e.prototype.consumeInternalRecovery=function(e,t,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(e){throw e.name===u.IN_RULE_RECOVERY_EXCEPTION?r:e}},e.prototype.saveRecogState=function(){var e=this.errors,t=(0,n.cloneArr)(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),h.EOF)},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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorHandler:()=>a});var n=r(42),s=r(17),o=r(37),i=r(16),a=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,s.defaults)(e.errorMessageProvider,i.DEFAULT_PARSER_CONFIG.errorMessageProvider)},e.prototype.SAVE_ERROR=function(e){if((0,n.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,s.cloneArr)(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,s.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!0,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,r){for(var s=this.getCurrRuleFullName(),i=this.getGAstProductions()[s],a=(0,o.getLookaheadPathsForOptionalProd)(e,i,t,this.maxLookahead)[0],l=[],u=1;u<=this.maxLookahead;u++)l.push(this.LA(u));var h=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:s});throw this.SAVE_ERROR(new n.EarlyExitException(h,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var r=this.getCurrRuleFullName(),s=this.getGAstProductions()[r],i=(0,o.getLookaheadPathsForOr)(e,s,this.maxLookahead),a=[],l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));var u=this.LA(0),h=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:u,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new n.NoViableAltException(h,this.LA(1),u))},e}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ContentAssist:()=>o});var n=r(38),s=r(17),o=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var r=this.gastProductionsCache[e];if((0,s.isUndefined)(r))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,n.nextPossibleTokensAfter)([r],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=(0,s.first)(e.ruleStack),r=this.getGAstProductions()[t];return new n.NextAfterTokenWalker(r,e).startWalking()},e}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{GastRecorder:()=>m});var n=r(17),s=r(20),o=r(22),i=r(27),a=r(21),l=r(16),u=r(34),h={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(h);var c=Math.pow(2,u.BITS_FOR_OCCURRENCE_IDX)-1,d=(0,a.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:o.Lexer.NA});(0,i.augmentTokenTypes)([d]);var p=(0,a.createTokenInstance)(d,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(p);var g={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},m=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 l.END_OF_FILE},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new s.Rule({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\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return f.call(this,s.Option,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){f.call(this,s.RepetitionMandatory,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){f.call(this,s.RepetitionMandatoryWithSeparator,t,e,true)},e.prototype.manyInternalRecord=function(e,t){f.call(this,s.Repetition,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){f.call(this,s.RepetitionWithSeparator,t,e,true)},e.prototype.orInternalRecord=function(e,t){return y.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,r){if(C(t),!e||!1===(0,n.has)(e,"ruleName")){var o=new Error("<SUBRULE"+E(t)+"> argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw o.KNOWN_RECORDER_ERROR=!0,o}var i=(0,n.peek)(this.recordingProdStack),a=e.ruleName,l=new s.NonTerminal({idx:t,nonTerminalName:a,referencedRule:void 0});return i.definition.push(l),this.outputCst?g:h},e.prototype.consumeInternalRecord=function(e,t,r){if(C(t),!(0,i.hasShortKeyProperty)(e)){var o=new Error("<CONSUME"+E(t)+"> argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw o.KNOWN_RECORDER_ERROR=!0,o}var a=(0,n.peek)(this.recordingProdStack),l=new s.Terminal({idx:t,terminalType:e});return a.definition.push(l),p},e}();function f(e,t,r,s){void 0===s&&(s=!1),C(r);var o=(0,n.peek)(this.recordingProdStack),i=(0,n.isFunction)(t)?t:t.DEF,a=new e({definition:[],idx:r});return(0,n.has)(t,"NAME")&&(a.name=t.NAME),s&&(a.separator=t.SEP),(0,n.has)(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(a),i.call(this),o.definition.push(a),this.recordingProdStack.pop(),h}function y(e,t){var r=this;C(t);var o=(0,n.peek)(this.recordingProdStack),i=!1===(0,n.isArray)(e),a=!1===i?e:e.DEF,l=new s.Alternation({definition:[],idx:t,ignoreAmbiguities:i&&!0===e.IGNORE_AMBIGUITIES});(0,n.has)(e,"NAME")&&(l.name=e.NAME),(0,n.has)(e,"MAX_LOOKAHEAD")&&(l.maxLookahead=e.MAX_LOOKAHEAD);var u=(0,n.some)(a,(function(e){return(0,n.isFunction)(e.GATE)}));return l.hasPredicates=u,o.definition.push(l),(0,n.forEach)(a,(function(e){var t=new s.Flat({definition:[]});l.definition.push(t),(0,n.has)(e,"NAME")&&(t.name=e.NAME),(0,n.has)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,n.has)(e,"GATE")&&(t.ignoreAmbiguities=!0),r.recordingProdStack.push(t),e.ALT.call(r),r.recordingProdStack.pop()})),h}function E(e){return 0===e?"":""+e}function C(e){if(e<0||e>c){var t=new Error("Invalid DSL Method idx value: <"+e+">\n\tIdx value must be a none negative value smaller than "+(c+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{PerformanceTracer:()=>o});var n=r(17),s=r(16),o=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if((0,n.has)(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=s.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--\x3e <"+e+">");var s=(0,n.timer)(t),o=s.time,i=s.value,a=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(r+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,i}return t()},e}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{createSyntaxDiagramsCode:()=>s});var n=r(15);function s(e,t){var r=void 0===t?{}:t,s=r.resourceBase,o=void 0===s?"https://unpkg.com/chevrotain@"+n.VERSION+"/diagrams/":s,i=r.css;return'\n\x3c!-- This is a generated file --\x3e\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===i?"https://unpkg.com/chevrotain@"+n.VERSION+"/diagrams/diagrams.css":i)+"'>\n")+("\n<script src='"+o+"vendor/railroad-diagrams.js'><\/script>\n<script src='"+o+"src/diagrams_builder.js'><\/script>\n<script src='"+o+"src/diagrams_behavior.js'><\/script>\n<script src='"+o+"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'}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{generateParserFactory:()=>s,generateParserModule:()=>o});var n=r(56);function s(e){var t=(0,n.genWrapperFunction)({name:e.name,rules:e.rules}),s=new Function("tokenVocabulary","config","chevrotain",t);return function(t){return s(e.tokenVocabulary,t,r(14))}}function o(e){return(0,n.genUmdModule)({name:e.name,rules:e.rules})}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{genAllRules:()=>u,genAlternation:()=>p,genClass:()=>l,genNonTerminal:()=>d,genRule:()=>h,genSingleAlt:()=>g,genTerminal:()=>c,genUmdModule:()=>i,genWrapperFunction:()=>a});var n=r(17),s=r(20),o="\n";function i(e){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"+l(e)+"\n \nreturn {\n "+e.name+": "+e.name+" \n}\n}));\n"}function a(e){return" \n"+l(e)+"\nreturn new "+e.name+"(tokenVocabulary, config) \n"}function l(e){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 "+u(e.rules)+"\n\n // very important to call this after all the rules have been defined.\n // otherwise the parser may not 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 u(e){return(0,n.map)(e,(function(e){return h(e,1)})).join("\n")}function h(e,t){var r=E(t,'$.RULE("'+e.name+'", function() {')+o;return r+=y(e.definition,t+1),r+=E(t+1,"})")+o}function c(e,t){var r=e.terminalType.name;return E(t,"$.CONSUME"+e.idx+"(this.tokensMap."+r+")"+o)}function d(e,t){return E(t,"$.SUBRULE"+e.idx+"($."+e.nonTerminalName+")"+o)}function p(e,t){var r=E(t,"$.OR"+e.idx+"([")+o;return r+=(0,n.map)(e.definition,(function(e){return g(e,t+1)})).join(","+o),r+=o+E(t,"])"+o)}function g(e,t){var r=E(t,"{")+o;return e.name&&(r+=E(t+1,'NAME: "'+e.name+'",')+o),r+=E(t+1,"ALT: function() {")+o,r+=y(e.definition,t+1),r+=E(t+1,"}")+o,r+=E(t,"}")}function m(e,t,r){var n=E(r,"$."+(e+t.idx)+"(");return t.name||t.separator?(n+="{"+o,t.name&&(n+=E(r+1,'NAME: "'+t.name+'"')+","+o),t.separator&&(n+=E(r+1,"SEP: this.tokensMap."+t.separator.name)+","+o),n+="DEF: "+f(t.definition,r+2)+o,n+=E(r,"}")+o):n+=f(t.definition,r+1),n+=E(r,")")+o}function f(e,t){var r="function() {"+o;return r+=y(e,t),r+=E(t,"}")+o}function y(e,t){var r="";return(0,n.forEach)(e,(function(e){r+=function(e,t){if(e instanceof s.NonTerminal)return d(e,t);if(e instanceof s.Option)return m("OPTION",e,t);if(e instanceof s.RepetitionMandatory)return m("AT_LEAST_ONE",e,t);if(e instanceof s.RepetitionMandatoryWithSeparator)return m("AT_LEAST_ONE_SEP",e,t);if(e instanceof s.RepetitionWithSeparator)return m("MANY_SEP",e,t);if(e instanceof s.Repetition)return m("MANY",e,t);if(e instanceof s.Alternation)return p(e,t);if(e instanceof s.Terminal)return c(e,t);if(e instanceof s.Flat)return y(e.definition,t);throw Error("non exhaustive match")}(e,t+1)})),r}function E(e,t){return Array(4*e+1).join(" ")+t}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AstNodeType:()=>i,ParsingErrorType:()=>o,RangeSheetReferenceType:()=>a,buildArrayAst:()=>_,buildCellErrorAst:()=>L,buildCellRangeAst:()=>d,buildCellReferenceAst:()=>c,buildColumnRangeAst:()=>p,buildConcatenateOpAst:()=>m,buildDivOpAst:()=>A,buildEmptyArgAst:()=>l,buildEqualsOpAst:()=>f,buildErrorWithRawInputAst:()=>D,buildGreaterThanOpAst:()=>E,buildGreaterThanOrEqualOpAst:()=>T,buildLessThanOpAst:()=>C,buildLessThanOrEqualOpAst:()=>R,buildMinusOpAst:()=>S,buildMinusUnaryOpAst:()=>O,buildNamedExpressionAst:()=>x,buildNotEqualOpAst:()=>y,buildNumberAst:()=>u,buildParenthesisAst:()=>P,buildParsingErrorAst:()=>F,buildPercentOpAst:()=>b,buildPlusOpAst:()=>w,buildPlusUnaryOpAst:()=>M,buildPowerOpAst:()=>N,buildProcedureAst:()=>I,buildRowRangeAst:()=>g,buildStringAst:()=>h,buildTimesOpAst:()=>v,imageWithWhitespace:()=>H,parsingError:()=>s});var n=r(3);const s=(e,t)=>({type:e,message:t});var o,i,a;!function(e){e.LexingError="LexingError",e.ParserError="ParsingError",e.StaticOffsetError="StaticOffsetError",e.StaticOffsetOutOfRangeError="StaticOffsetOutOfRangeError",e.RangeOffsetNotAllowed="RangeOffsetNotAllowed"}(o||(o={})),function(e){e.EMPTY="EMPTY",e.NUMBER="NUMBER",e.STRING="STRING",e.MINUS_UNARY_OP="MINUS_UNARY_OP",e.PLUS_UNARY_OP="PLUS_UNARY_OP",e.PERCENT_OP="PERCENT_OP",e.CONCATENATE_OP="CONCATENATE_OP",e.EQUALS_OP="EQUALS_OP",e.NOT_EQUAL_OP="NOT_EQUAL_OP",e.GREATER_THAN_OP="GREATER_THAN_OP",e.LESS_THAN_OP="LESS_THAN_OP",e.GREATER_THAN_OR_EQUAL_OP="GREATER_THAN_OR_EQUAL_OP",e.LESS_THAN_OR_EQUAL_OP="LESS_THAN_OR_EQUAL_OP",e.PLUS_OP="PLUS_OP",e.MINUS_OP="MINUS_OP",e.TIMES_OP="TIMES_OP",e.DIV_OP="DIV_OP",e.POWER_OP="POWER_OP",e.FUNCTION_CALL="FUNCTION_CALL",e.NAMED_EXPRESSION="NAMED_EXPRESSION",e.PARENTHESIS="PARENTHESES",e.CELL_REFERENCE="CELL_REFERENCE",e.CELL_RANGE="CELL_RANGE",e.COLUMN_RANGE="COLUMN_RANGE",e.ROW_RANGE="ROW_RANGE",e.ERROR="ERROR",e.ERROR_WITH_RAW_INPUT="ERROR_WITH_RAW_INPUT",e.ARRAY="ARRAY"}(i||(i={})),function(e){e[e.RELATIVE=0]="RELATIVE",e[e.START_ABSOLUTE=1]="START_ABSOLUTE",e[e.BOTH_ABSOLUTE=2]="BOTH_ABSOLUTE"}(a||(a={}));const l=e=>({type:i.EMPTY,leadingWhitespace:null==e?void 0:e.image}),u=(e,t)=>({type:i.NUMBER,value:e,leadingWhitespace:null==t?void 0:t.image}),h=e=>{var t;return{type:i.STRING,value:e.image.slice(1,-1),leadingWhitespace:null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image}},c=(e,t)=>({type:i.CELL_REFERENCE,reference:e,leadingWhitespace:null==t?void 0:t.image}),d=(e,t,r,n)=>(k(e,t,r),{type:i.CELL_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:n}),p=(e,t,r,n)=>(k(e,t,r),{type:i.COLUMN_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:null==n?void 0:n.image}),g=(e,t,r,n)=>(k(e,t,r),{type:i.ROW_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:null==n?void 0:n.image}),m=(e,t,r)=>({type:i.CONCATENATE_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),f=(e,t,r)=>({type:i.EQUALS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),y=(e,t,r)=>({type:i.NOT_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),E=(e,t,r)=>({type:i.GREATER_THAN_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),C=(e,t,r)=>({type:i.LESS_THAN_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),T=(e,t,r)=>({type:i.GREATER_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),R=(e,t,r)=>({type:i.LESS_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),w=(e,t,r)=>({type:i.PLUS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),S=(e,t,r)=>({type:i.MINUS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),v=(e,t,r)=>({type:i.TIMES_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),A=(e,t,r)=>({type:i.DIV_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),N=(e,t,r)=>({type:i.POWER_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),O=(e,t)=>({type:i.MINUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),M=(e,t)=>({type:i.PLUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),b=(e,t)=>({type:i.PERCENT_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),I=(e,t,r,n,s)=>({type:i.FUNCTION_CALL,procedureName:e,args:t,leadingWhitespace:null==r?void 0:r.image,internalWhitespace:null==n?void 0:n.image,hyperlink:s}),_=(e,t,r)=>({type:i.ARRAY,args:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==r?void 0:r.image}),x=(e,t)=>({type:i.NAMED_EXPRESSION,expressionName:e,leadingWhitespace:null==t?void 0:t.image}),P=(e,t,r)=>({type:i.PARENTHESIS,expression:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==r?void 0:r.image}),L=(e,t)=>({type:i.ERROR,error:e,leadingWhitespace:null==t?void 0:t.image}),D=(e,t,r)=>({type:i.ERROR_WITH_RAW_INPUT,error:t,rawInput:e,leadingWhitespace:null==r?void 0:r.image}),F=()=>({type:i.ERROR,error:n.CellError.parsingError()});function k(e,t,r){if(void 0!==e.sheet&&void 0===t.sheet||void 0===e.sheet&&void 0!==t.sheet)throw new Error("Start address inconsistent with end address");if(void 0===e.sheet&&r!==a.RELATIVE||void 0!==e.sheet&&r===a.RELATIVE)throw new Error("Sheet address inconsistent with sheet reference type")}function H(e,t){return(null!=t?t:"")+e}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{binaryOpTokenMap:()=>s});var n=r(57);const s={[n.AstNodeType.PLUS_OP]:"+",[n.AstNodeType.MINUS_OP]:"-",[n.AstNodeType.TIMES_OP]:"*",[n.AstNodeType.DIV_OP]:"/",[n.AstNodeType.CONCATENATE_OP]:"&",[n.AstNodeType.POWER_OP]:"^",[n.AstNodeType.EQUALS_OP]:"=",[n.AstNodeType.NOT_EQUAL_OP]:"<>",[n.AstNodeType.GREATER_THAN_OP]:">",[n.AstNodeType.GREATER_THAN_OR_EQUAL_OP]:">=",[n.AstNodeType.LESS_THAN_OP]:"<",[n.AstNodeType.LESS_THAN_OR_EQUAL_OP]:"<="}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Cache:()=>s,doesContainFunctions:()=>o});var n=r(7);class s{constructor(e){this.functionRegistry=e,this.cache=new Map}set(e,t){const r=((e,t,r,n)=>({ast:e,relativeDependencies:t,hasVolatileFunction:r,hasStructuralChangeFunction:n}))(t,(0,n.collectDependencies)(t,this.functionRegistry),o(t,this.functionRegistry.isFunctionVolatile),o(t,this.functionRegistry.isFunctionDependentOnSheetStructureChange));return this.cache.set(e,r),r}get(e){return this.cache.get(e)}maybeSetAndThenGet(e,t){const r=this.cache.get(e);return void 0!==r?r.ast:(this.set(e,t),t)}}const o=(e,t)=>{switch(e.type){case n.AstNodeType.EMPTY:case n.AstNodeType.NUMBER:case n.AstNodeType.STRING:case n.AstNodeType.ERROR:case n.AstNodeType.ERROR_WITH_RAW_INPUT:case n.AstNodeType.CELL_REFERENCE:case n.AstNodeType.CELL_RANGE:case n.AstNodeType.COLUMN_RANGE:case n.AstNodeType.ROW_RANGE:case n.AstNodeType.NAMED_EXPRESSION:return!1;case n.AstNodeType.PERCENT_OP:case n.AstNodeType.PLUS_UNARY_OP:case n.AstNodeType.MINUS_UNARY_OP:return o(e.value,t);case n.AstNodeType.CONCATENATE_OP:case n.AstNodeType.EQUALS_OP:case n.AstNodeType.NOT_EQUAL_OP:case n.AstNodeType.LESS_THAN_OP:case n.AstNodeType.GREATER_THAN_OP:case n.AstNodeType.LESS_THAN_OR_EQUAL_OP:case n.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case n.AstNodeType.MINUS_OP:case n.AstNodeType.PLUS_OP:case n.AstNodeType.TIMES_OP:case n.AstNodeType.DIV_OP:case n.AstNodeType.POWER_OP:return o(e.left,t)||o(e.right,t);case n.AstNodeType.PARENTHESIS:return o(e.expression,t);case n.AstNodeType.FUNCTION_CALL:return!!t(e.procedureName)||e.args.some((e=>o(e,t)));case n.AstNodeType.ARRAY:return e.args.some((e=>e.some((e=>o(e,t)))))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FormulaLexer:()=>c,FormulaParser:()=>h});var n=r(14),s=r(3),o=r(61),i=r(8),a=r(57),l=r(9),u=r(62);class h extends n.EmbeddedActionsParser{constructor(e,t){super(e.allTokens,{outputCst:!1,maxLookahead:7}),this.booleanExpressionOrEmpty=this.RULE("booleanExpressionOrEmpty",(()=>this.OR([{ALT:()=>this.SUBRULE(this.booleanExpression)},{ALT:(0,n.EMPTY_ALT)((0,a.buildEmptyArgAst)())}]))),this.procedureExpression=this.RULE("procedureExpression",(()=>{var e;const t=this.CONSUME(u.ProcedureName),r=t.image.toUpperCase().slice(0,-1),n=null!==(e=this.lexerConfig.functionMapping[r])&&void 0!==e?e:r,s=[];let o=this.SUBRULE(this.booleanExpressionOrEmpty);this.MANY((()=>{var e;const t=this.CONSUME(this.lexerConfig.ArgSeparator);o.type===a.AstNodeType.EMPTY&&(o.leadingWhitespace=null===(e=t.leadingWhitespace)||void 0===e?void 0:e.image),s.push(o),o=this.SUBRULE2(this.booleanExpressionOrEmpty)})),s.push(o),1===s.length&&s[0].type===a.AstNodeType.EMPTY&&(s.length=0);const i=this.CONSUME(u.RParen);return(0,a.buildProcedureAst)(n,s,t.leadingWhitespace,i.leadingWhitespace)})),this.namedExpressionExpression=this.RULE("namedExpressionExpression",(()=>{const e=this.CONSUME(u.NamedExpression);return(0,a.buildNamedExpressionAst)(e.image,e.leadingWhitespace)})),this.offsetProcedureExpression=this.RULE("offsetProcedureExpression",(()=>{const e=[];return this.CONSUME(this.lexerConfig.OffsetProcedureName),this.CONSUME(u.LParen),this.MANY_SEP({SEP:this.lexerConfig.ArgSeparator,DEF:()=>{e.push(this.SUBRULE(this.booleanExpression))}}),this.CONSUME(u.RParen),this.handleOffsetHeuristic(e)})),this.columnRangeExpression=this.RULE("columnRangeExpression",(()=>{const e=this.CONSUME(u.ColumnRange),[t,r]=e.image.split(":"),n=this.ACTION((()=>(0,i.columnAddressFromString)(this.sheetMapping,t,this.formulaAddress))),o=this.ACTION((()=>(0,i.columnAddressFromString)(this.sheetMapping,r,this.formulaAddress)));if(void 0===n||void 0===o)return(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF));if(n.exceedsSheetSizeLimits(this.lexerConfig.maxColumns)||o.exceedsSheetSizeLimits(this.lexerConfig.maxColumns))return(0,a.buildErrorWithRawInputAst)(e.image,new s.CellError(s.ErrorType.NAME),e.leadingWhitespace);if(void 0===n.sheet&&void 0!==o.sheet)return this.parsingError(a.ParsingErrorType.ParserError,"Malformed range expression");const{firstEnd:l,secondEnd:c,sheetRefType:d}=h.fixSheetIdsForRangeEnds(n,o);return(0,a.buildColumnRangeAst)(l,c,d,e.leadingWhitespace)})),this.rowRangeExpression=this.RULE("rowRangeExpression",(()=>{const e=this.CONSUME(u.RowRange),[t,r]=e.image.split(":"),n=this.ACTION((()=>(0,i.rowAddressFromString)(this.sheetMapping,t,this.formulaAddress))),o=this.ACTION((()=>(0,i.rowAddressFromString)(this.sheetMapping,r,this.formulaAddress)));if(void 0===n||void 0===o)return(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF));if(n.exceedsSheetSizeLimits(this.lexerConfig.maxRows)||o.exceedsSheetSizeLimits(this.lexerConfig.maxRows))return(0,a.buildErrorWithRawInputAst)(e.image,new s.CellError(s.ErrorType.NAME),e.leadingWhitespace);if(void 0===n.sheet&&void 0!==o.sheet)return this.parsingError(a.ParsingErrorType.ParserError,"Malformed range expression");const{firstEnd:l,secondEnd:c,sheetRefType:d}=h.fixSheetIdsForRangeEnds(n,o);return(0,a.buildRowRangeAst)(l,c,d,e.leadingWhitespace)})),this.cellReference=this.RULE("cellReference",(()=>{const e=this.CONSUME(u.CellReference),t=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress)));return void 0===t?(0,a.buildErrorWithRawInputAst)(e.image,new s.CellError(s.ErrorType.REF),e.leadingWhitespace):t.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?(0,a.buildErrorWithRawInputAst)(e.image,new s.CellError(s.ErrorType.NAME),e.leadingWhitespace):(0,a.buildCellReferenceAst)(t,e.leadingWhitespace)})),this.endRangeReference=this.RULE("endRangeReference",(e=>{var t;const r=this.CONSUME(u.CellReference),n=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress))),o=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,r.image,this.formulaAddress)));return void 0===n||void 0===o?this.ACTION((()=>(0,a.buildErrorWithRawInputAst)(`${e.image}:${r.image}`,new s.CellError(s.ErrorType.REF),e.leadingWhitespace))):n.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)||o.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?this.ACTION((()=>(0,a.buildErrorWithRawInputAst)(`${e.image}:${r.image}`,new s.CellError(s.ErrorType.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;const r=this.SUBRULE(this.offsetProcedureExpression),n=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress)));return void 0===n?(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF)):r.type===a.AstNodeType.CELL_REFERENCE?this.buildCellRange(n,r.reference,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image):this.parsingError(a.ParsingErrorType.RangeOffsetNotAllowed,"Range offset not allowed here")}}]))),this.cellRangeExpression=this.RULE("cellRangeExpression",(()=>{const e=this.CONSUME(u.CellReference);return this.CONSUME2(u.RangeSeparator),this.SUBRULE(this.endOfRangeExpression,{ARGS:[e]})})),this.endRangeWithOffsetStartReference=this.RULE("endRangeWithOffsetStartReference",(e=>{const t=this.CONSUME(u.CellReference),r=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,t.image,this.formulaAddress)));return void 0===r?this.ACTION((()=>(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF)))):this.buildCellRange(e.reference,r,e.leadingWhitespace)})),this.endOfRangeWithOffsetStartExpression=this.RULE("endOfRangeWithOffsetStartExpression",(e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeWithOffsetStartReference,{ARGS:[e]})},{ALT:()=>{const t=this.SUBRULE(this.offsetProcedureExpression);return t.type===a.AstNodeType.CELL_REFERENCE?this.buildCellRange(e.reference,t.reference,e.leadingWhitespace):this.parsingError(a.ParsingErrorType.RangeOffsetNotAllowed,"Range offset not allowed here")}}]))),this.offsetExpression=this.RULE("offsetExpression",(()=>{const e=this.SUBRULE(this.offsetProcedureExpression);let t;return this.OPTION((()=>{this.CONSUME(u.RangeSeparator),t=e.type===a.AstNodeType.CELL_RANGE?this.parsingError(a.ParsingErrorType.RangeOffsetNotAllowed,"Range offset not allowed here"):this.SUBRULE(this.endOfRangeWithOffsetStartExpression,{ARGS:[e]})})),void 0!==t?t:e})),this.insideArrayExpression=this.RULE("insideArrayExpression",(()=>{const 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.buildArrayAst)(e)})),this.parenthesisExpression=this.RULE("parenthesisExpression",(()=>{const e=this.CONSUME(u.LParen),t=this.SUBRULE(this.booleanExpression),r=this.CONSUME(u.RParen);return(0,a.buildParenthesisAst)(t,e.leadingWhitespace,r.leadingWhitespace)})),this.arrayExpression=this.RULE("arrayExpression",(()=>this.OR([{ALT:()=>{const e=this.CONSUME(u.ArrayLParen),t=this.SUBRULE(this.insideArrayExpression),r=this.CONSUME(u.ArrayRParen);return(0,a.buildArrayAst)(t.args,e.leadingWhitespace,r.leadingWhitespace)}},{ALT:()=>this.SUBRULE(this.parenthesisExpression)}]))),this.numericStringToNumber=e=>{const t=e.replace(this.lexerConfig.decimalSeparator,".");return Number(t)},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:()=>{const e=this.CONSUME(this.lexerConfig.NumberLiteral);return(0,a.buildNumberAst)(this.numericStringToNumber(e.image),e.leadingWhitespace)}},{ALT:()=>{const e=this.CONSUME(u.StringLiteral);return(0,a.buildStringAst)(e)}},{ALT:()=>{const e=this.CONSUME(u.ErrorLiteral),t=e.image.toUpperCase(),r=this.lexerConfig.errorMapping[t];return r?(0,a.buildCellErrorAst)(new s.CellError(r),e.leadingWhitespace):this.parsingError(a.ParsingErrorType.ParserError,"Unknown error literal")}}])})),this.rightUnaryOpAtomicExpression=this.RULE("rightUnaryOpAtomicExpression",(()=>{const e=this.SUBRULE(this.positiveAtomicExpression),t=this.OPTION((()=>this.CONSUME(u.PercentOp)));return t?(0,a.buildPercentOpAst)(e,t.leadingWhitespace):e})),this.atomicExpression=this.RULE("atomicExpression",(()=>this.OR([{ALT:()=>{const e=this.CONSUME(u.AdditionOp),t=this.SUBRULE(this.atomicExpression);return(0,n.tokenMatcher)(e,u.PlusOp)?(0,a.buildPlusUnaryOpAst)(t,e.leadingWhitespace):(0,n.tokenMatcher)(e,u.MinusOp)?(0,a.buildMinusUnaryOpAst)(t,e.leadingWhitespace):(this.customParsingError=(0,a.parsingError)(a.ParsingErrorType.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((()=>{const t=this.CONSUME(u.PowerOp),r=this.SUBRULE2(this.atomicExpression);(0,n.tokenMatcher)(t,u.PowerOp)?e=(0,a.buildPowerOpAst)(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((()=>{const t=this.CONSUME(u.MultiplicationOp),r=this.SUBRULE2(this.powerExpression);(0,n.tokenMatcher)(t,u.TimesOp)?e=(0,a.buildTimesOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.DivOp)?e=(0,a.buildDivOpAst)(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((()=>{const t=this.CONSUME(u.AdditionOp),r=this.SUBRULE2(this.multiplicationExpression);(0,n.tokenMatcher)(t,u.PlusOp)?e=(0,a.buildPlusOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.MinusOp)?e=(0,a.buildMinusOpAst)(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((()=>{const t=this.CONSUME(u.ConcatenateOp),r=this.SUBRULE2(this.additionExpression);e=(0,a.buildConcatenateOpAst)(e,r,t.leadingWhitespace)})),e})),this.booleanExpression=this.RULE("booleanExpression",(()=>{let e=this.SUBRULE(this.concatenateExpression);return this.MANY((()=>{const t=this.CONSUME(u.BooleanOp),r=this.SUBRULE2(this.concatenateExpression);(0,n.tokenMatcher)(t,u.EqualsOp)?e=(0,a.buildEqualsOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.NotEqualOp)?e=(0,a.buildNotEqualOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.GreaterThanOp)?e=(0,a.buildGreaterThanOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.LessThanOp)?e=(0,a.buildLessThanOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.GreaterThanOrEqualOp)?e=(0,a.buildGreaterThanOrEqualOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.LessThanOrEqualOp)?e=(0,a.buildLessThanOrEqualOpAst)(e,r,t.leadingWhitespace):this.ACTION((()=>{throw Error("Operator not supported")}))})),e})),this.formula=this.RULE("formula",(()=>(this.CONSUME(u.EqualsOp),this.SUBRULE(this.booleanExpression)))),this.lexerConfig=e,this.sheetMapping=t,this.formulaAddress=(0,s.simpleCellAddress)(0,0,0),this.performSelfAnalysis()}parseFromTokens(e,t){this.input=e;let r=this.formulaWithContext(t),n=[];return this.customParsingError&&n.push(this.customParsingError),n=n.concat(this.errors.map((e=>({type:a.ParsingErrorType.ParserError,message:e.message})))),n.length>0&&(r=(0,a.buildParsingErrorAst)()),{ast:r,errors:n}}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.ParsingErrorType.ParserError,"Malformed range expression");const{firstEnd:n,secondEnd:s,sheetRefType:o}=h.fixSheetIdsForRangeEnds(e,t);return(0,a.buildCellRangeAst)(n,s,o,r)}static fixSheetIdsForRangeEnds(e,t){const r=h.rangeSheetReferenceType(e.sheet,t.sheet);return{firstEnd:e,secondEnd:void 0!==e.sheet&&void 0===t.sheet?t.withSheet(e.sheet):t,sheetRefType:r}}handleOffsetHeuristic(e){const t=e[0];if(t.type!==a.AstNodeType.CELL_REFERENCE)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"First argument to OFFSET is not a reference");const r=e[1];let n;if(r.type===a.AstNodeType.NUMBER&&Number.isInteger(r.value))n=r.value;else if(r.type===a.AstNodeType.PLUS_UNARY_OP&&r.value.type===a.AstNodeType.NUMBER&&Number.isInteger(r.value.value))n=r.value.value;else{if(r.type!==a.AstNodeType.MINUS_UNARY_OP||r.value.type!==a.AstNodeType.NUMBER||!Number.isInteger(r.value.value))return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Second argument to OFFSET is not a static number");n=-r.value.value}const i=e[2];let u;if(i.type===a.AstNodeType.NUMBER&&Number.isInteger(i.value))u=i.value;else if(i.type===a.AstNodeType.PLUS_UNARY_OP&&i.value.type===a.AstNodeType.NUMBER&&Number.isInteger(i.value.value))u=i.value.value;else{if(i.type!==a.AstNodeType.MINUS_UNARY_OP||i.value.type!==a.AstNodeType.NUMBER||!Number.isInteger(i.value.value))return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Third argument to OFFSET is not a static number");u=-i.value.value}const h=e[3];let c;if(void 0===h)c=1;else{if(h.type!==a.AstNodeType.NUMBER)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fourth argument to OFFSET is not a static number");if(c=h.value,c<1)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fourth argument to OFFSET is too small number");if(!Number.isInteger(c))return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fourth argument to OFFSET is not integer")}const d=e[4];let p;if(void 0===d)p=1;else{if(d.type!==a.AstNodeType.NUMBER)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fifth argument to OFFSET is not a static number");if(p=d.value,p<1)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fifth argument to OFFSET is too small number");if(!Number.isInteger(p))return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fifth argument to OFFSET is not integer")}const g=new l.CellAddress(t.reference.col+u,t.reference.row+n,t.reference.type);let m=g.col,f=g.row;if(t.reference.type!==l.CellReferenceType.CELL_REFERENCE_RELATIVE&&t.reference.type!==l.CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL||(f+=this.formulaAddress.row),t.reference.type!==l.CellReferenceType.CELL_REFERENCE_RELATIVE&&t.reference.type!==l.CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW||(m+=this.formulaAddress.col),m<0||f<0)return(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF,o.ErrorMessage.OutOfSheet));if(1===p&&1===c)return(0,a.buildCellReferenceAst)(g);{const e=new l.CellAddress(g.col+p-1,g.row+c-1,g.type);return(0,a.buildCellRangeAst)(g,e,a.RangeSheetReferenceType.RELATIVE)}}parsingError(e,t){return this.customParsingError=(0,a.parsingError)(e,t),(0,a.buildParsingErrorAst)()}static rangeSheetReferenceType(e,t){return void 0===e?a.RangeSheetReferenceType.RELATIVE:void 0===t?a.RangeSheetReferenceType.START_ABSOLUTE:a.RangeSheetReferenceType.BOTH_ABSOLUTE}}class c{constructor(e){this.lexerConfig=e,this.lexer=new n.Lexer(e.allTokens,{ensureOptimizations:!0})}tokenizeFormula(e){const t=this.lexer.tokenize(e);let r=t.tokens;return r=this.trimTrailingWhitespaces(r),r=this.skipWhitespacesInsideRanges(r),r=this.skipWhitespacesBeforeArgSeparators(r),t.tokens=r,t}skipWhitespacesInsideRanges(e){return c.filterTokensByNeighbors(e,((e,t,r)=>((0,n.tokenMatcher)(e,u.CellReference)||(0,n.tokenMatcher)(e,u.RangeSeparator))&&(0,n.tokenMatcher)(t,this.lexerConfig.WhiteSpace)&&((0,n.tokenMatcher)(r,u.CellReference)||(0,n.tokenMatcher)(r,u.RangeSeparator))))}skipWhitespacesBeforeArgSeparators(e){return c.filterTokensByNeighbors(e,((e,t,r)=>!(0,n.tokenMatcher)(e,this.lexerConfig.ArgSeparator)&&(0,n.tokenMatcher)(t,this.lexerConfig.WhiteSpace)&&(0,n.tokenMatcher)(r,this.lexerConfig.ArgSeparator)))}static filterTokensByNeighbors(e,t){if(e.length<3)return e;let r=0;const n=[e[r++]];for(;r<e.length-1;)t(e[r-1],e[r],e[r+1])||n.push(e[r]),++r;return n.push(e[r]),n}trimTrailingWhitespaces(e){return e.length>0&&(0,n.tokenMatcher)(e[e.length-1],this.lexerConfig.WhiteSpace)&&e.pop(),e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorMessage:()=>n});class n{}n.DistinctSigns="Distinct signs.",n.WrongArgNumber="Wrong number of arguments.",n.EmptyArg="Empty function argument.",n.EmptyArray="Empty array not allowed.",n.ArrayDimensions="Array dimensions are not compatible.",n.NoSpaceForArrayResult="No space for array result.",n.ValueSmall="Value too small.",n.ValueLarge="Value too large.",n.BadCriterion="Incorrect criterion.",n.RangeManySheets="Range spans more than one sheet.",n.CellRangeExpected="Cell range expected.",n.WrongDimension="Wrong range dimension.",n.ScalarExpected="Cell range not allowed.",n.NumberCoercion="Value cannot be coerced to number.",n.NumberExpected="Number argument expected.",n.IntegerExpected="Value needs to be an integer.",n.BadMode="Mode not recognized.",n.DateBounds="Date outside of bounds.",n.OutOfSheet="Resulting reference is out of the sheet.",n.WrongType="Wrong type of argument.",n.NaN="NaN or infinite value encountered.",n.EqualLength="Ranges need to be of equal length.",n.Negative="Value cannot be negative.",n.NotBinary="String does not represent a binary number.",n.NotOctal="String does not represent an octal number.",n.NotHex="String does not represent a hexadecimal number.",n.EndStartPeriod="End period needs to be at least start period.",n.CellRefExpected="Cell reference expected.",n.EmptyRange="Empty range not allowed.",n.BadRef="Address is not correct.",n.NumberRange="Number-only range expected.",n.ValueNotFound="Value not found.",n.ValueBaseLarge="Value in base too large.",n.ValueBaseSmall="Value in base too small.",n.ValueBaseLong="Value in base too long.",n.NegativeLength="Length cannot be negative.",n.PatternNotFound="Pattern not found.",n.OneValue="Needs at least one value.",n.TwoValues="Range needs to contain at least two elements.",n.ThreeValues="Range needs to contain at least three elements.",n.IndexBounds="Index out of bounds.",n.IndexLarge="Index too large.",n.Formula="Expected formula.",n.NegativeCount="Count cannot be negative.",n.ParseError="Parsing error.",n.SheetRef="Sheet does not exist.",n.PeriodLong="Period number cannot exceed life length.",n.InvalidDate="Invalid date.",n.BitshiftLong="Result of bitshift is too long.",n.EmptyString="Empty-string argument not allowed.",n.LengthBounds="Length out of bounds.",n.NegativeTime="Time cannot be negative.",n.NoDefault="No default option.",n.NoConditionMet="None of the conditions were met.",n.Selector="Selector cannot exceed the number of arguments.",n.StartEndDate="Start date needs to be earlier than end date.",n.IncorrectDateTime="String does not represent correct DateTime.",n.CharacterCodeBounds="Character code out of bounds.",n.NonZero="Argument cannot be 0.",n.LessThanOne="Argument cannot be less than 1.",n.WeekendString="Incorrect weekend bitmask string.",n.InvalidRoman="Invalid roman numeral.",n.WrongOrder="Wrong order of values.",n.ComplexNumberExpected="Complex number expected.",n.ShouldBeIorJ="Should be 'i' or 'j'.",n.SizeMismatch="Array dimensions mismatched.",n.FunctionName=e=>`Function name ${e} not recognized.`,n.NamedExpressionName=e=>`Named expression ${e} not recognized.`,n.LicenseKey=e=>`License key is ${e}.`},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AdditionOp:()=>a,ArrayLParen:()=>A,ArrayRParen:()=>N,BooleanOp:()=>m,CellReference:()=>L,ColumnRange:()=>I,ConcatenateOp:()=>w,DivOp:()=>d,EqualsOp:()=>f,ErrorLiteral:()=>M,GreaterThanOp:()=>E,GreaterThanOrEqualOp:()=>T,LParen:()=>S,LessThanOp:()=>C,LessThanOrEqualOp:()=>R,MinusOp:()=>u,MultiplicationOp:()=>h,NamedExpression:()=>F,NotEqualOp:()=>y,PercentOp:()=>g,PlusOp:()=>l,PowerOp:()=>p,ProcedureName:()=>x,RParen:()=>v,RangeSeparator:()=>b,RowRange:()=>_,StringLiteral:()=>O,TimesOp:()=>c,buildLexerConfig:()=>k});var n=r(14),s=r(12),o=r(63),i=r(64);const a=(0,n.createToken)({name:"AdditionOp",pattern:n.Lexer.NA}),l=(0,n.createToken)({name:"PlusOp",pattern:/\+/,categories:a}),u=(0,n.createToken)({name:"MinusOp",pattern:/-/,categories:a}),h=(0,n.createToken)({name:"MultiplicationOp",pattern:n.Lexer.NA}),c=(0,n.createToken)({name:"TimesOp",pattern:/\*/,categories:h}),d=(0,n.createToken)({name:"DivOp",pattern:/\//,categories:h}),p=(0,n.createToken)({name:"PowerOp",pattern:/\^/}),g=(0,n.createToken)({name:"PercentOp",pattern:/%/}),m=(0,n.createToken)({name:"BooleanOp",pattern:n.Lexer.NA}),f=(0,n.createToken)({name:"EqualsOp",pattern:/=/,categories:m}),y=(0,n.createToken)({name:"NotEqualOp",pattern:/<>/,categories:m}),E=(0,n.createToken)({name:"GreaterThanOp",pattern:/>/,categories:m}),C=(0,n.createToken)({name:"LessThanOp",pattern:/</,categories:m}),T=(0,n.createToken)({name:"GreaterThanOrEqualOp",pattern:/>=/,categories:m}),R=(0,n.createToken)({name:"LessThanOrEqualOp",pattern:/<=/,categories:m}),w=(0,n.createToken)({name:"ConcatenateOp",pattern:/&/}),S=(0,n.createToken)({name:"LParen",pattern:/\(/}),v=(0,n.createToken)({name:"RParen",pattern:/\)/}),A=(0,n.createToken)({name:"ArrayLParen",pattern:/{/}),N=(0,n.createToken)({name:"ArrayRParen",pattern:/}/}),O=(0,n.createToken)({name:"StringLiteral",pattern:/"([^"\\]*(\\.[^"\\]*)*)"/}),M=(0,n.createToken)({name:"ErrorLiteral",pattern:/#[A-Za-z0-9\/]+[?!]?/}),b=(0,n.createToken)({name:"RangeSeparator",pattern:new RegExp(s.RANGE_OPERATOR)}),I=(0,n.createToken)({name:"ColumnRange",pattern:new RegExp(`${s.COLUMN_REFERENCE_PATTERN}${s.RANGE_OPERATOR}${s.COLUMN_REFERENCE_PATTERN}`)}),_=(0,n.createToken)({name:"RowRange",pattern:new RegExp(`${s.ROW_REFERENCE_PATTERN}${s.RANGE_OPERATOR}${s.ROW_REFERENCE_PATTERN}`)}),x=(0,n.createToken)({name:"ProcedureName",pattern:new RegExp(`([${s.UNICODE_LETTER_PATTERN}][${s.NON_RESERVED_CHARACTER_PATTERN}]*)\\(`)}),P=new o.CellReferenceMatcher,L=(0,n.createToken)({name:"CellReference",pattern:P.match.bind(P),start_chars_hint:P.POSSIBLE_START_CHARACTERS,line_breaks:!1}),D=new i.NamedExpressionMatcher,F=(0,n.createToken)({name:"NamedExpression",pattern:D.match.bind(D),start_chars_hint:D.POSSIBLE_START_CHARACTERS,line_breaks:!1}),k=e=>{const t=e.translationPackage.getFunctionTranslation("OFFSET"),r=e.errorMapping,o=e.translationPackage.buildFunctionMapping(),i=new RegExp("standard"===e.ignoreWhiteSpace?s.ODFF_WHITESPACE_PATTERN:s.ALL_WHITESPACE_PATTERN),P=(0,n.createToken)({name:"WhiteSpace",pattern:i}),D=(0,n.createToken)({name:"ArrayRowSep",pattern:e.arrayRowSeparator}),k=(0,n.createToken)({name:"ArrayColSep",pattern:e.arrayColumnSeparator}),H=(0,n.createToken)({name:"NumberLiteral",pattern:new RegExp(`(([${e.decimalSeparator}]\\d+)|(\\d+([${e.decimalSeparator}]\\d*)?))(e[+-]?\\d+)?`)}),U=(0,n.createToken)({name:"OffsetProcedureName",pattern:new RegExp(t,"i")});let V,B;e.functionArgSeparator===e.arrayColumnSeparator?(V=k,B=[]):e.functionArgSeparator===e.arrayRowSeparator?(V=D,B=[]):(V=(0,n.createToken)({name:"ArgSeparator",pattern:e.functionArgSeparator}),B=[V]);return{ArgSeparator:V,NumberLiteral:H,OffsetProcedureName:U,ArrayRowSeparator:D,ArrayColSeparator:k,WhiteSpace:P,allTokens:[P,l,u,c,d,p,f,y,g,T,R,E,C,S,v,A,N,U,x,b,...B,I,_,H,O,M,w,m,a,h,L,F,D,k],errorMapping:r,functionMapping:o,decimalSeparator:e.decimalSeparator,maxColumns:e.maxColumns,maxRows:e.maxRows}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CellReferenceMatcher:()=>s});var n=r(12);class s{constructor(){this.POSSIBLE_START_CHARACTERS=[...n.ALL_UNICODE_LETTERS_ARRAY,...n.ALL_DIGITS_ARRAY,n.ABSOLUTE_OPERATOR,"'","_"],this.cellReferenceRegexp=new RegExp(n.CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN,"y")}match(e,t){this.cellReferenceRegexp.lastIndex=t;const r=this.cellReferenceRegexp.exec(e+"@");return null==r||null==r[1]?null:(r[0]=r[1],r)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{NamedExpressionMatcher:()=>s});var n=r(12);class s{constructor(){this.POSSIBLE_START_CHARACTERS=[...n.ALL_UNICODE_LETTERS_ARRAY,"_"],this.namedExpressionRegexp=new RegExp(n.NAMED_EXPRESSION_PATTERN,"y"),this.r1c1CellRefRegexp=new RegExp(`^${n.R1C1_CELL_REFERENCE_PATTERN}$`)}match(e,t){this.namedExpressionRegexp.lastIndex=t;const r=this.namedExpressionRegexp.exec(e);return null==r||null==r[0]||this.r1c1CellRefRegexp.test(r[0])?null:r}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Unparser:()=>l,formatNumber:()=>u});var n=r(3),s=r(0),o=r(8),i=r(57),a=r(58);class l{constructor(e,t,r,n){this.config=e,this.lexerConfig=t,this.sheetMappingFn=r,this.namedExpressions=n}unparse(e,t){return"="+this.unparseAst(e,t)}unparseAst(e,t){var r,s;switch(e.type){case i.AstNodeType.EMPTY:return(0,i.imageWithWhitespace)("",e.leadingWhitespace);case i.AstNodeType.NUMBER:return(0,i.imageWithWhitespace)(u(e.value,this.config.decimalSeparator),e.leadingWhitespace);case i.AstNodeType.STRING:return(0,i.imageWithWhitespace)('"'+e.value+'"',e.leadingWhitespace);case i.AstNodeType.FUNCTION_CALL:{const r=e.args.map((e=>void 0!==e?this.unparseAst(e,t):"")).join(this.config.functionArgSeparator),n=(this.config.translationPackage.isFunctionTranslated(e.procedureName)?this.config.translationPackage.getFunctionTranslation(e.procedureName):e.procedureName)+"("+r+(0,i.imageWithWhitespace)(")",e.internalWhitespace);return(0,i.imageWithWhitespace)(n,e.leadingWhitespace)}case i.AstNodeType.NAMED_EXPRESSION:{const n=null===(r=this.namedExpressions.nearestNamedExpression(e.expressionName,t.sheet))||void 0===r?void 0:r.displayName;return(0,i.imageWithWhitespace)(n||e.expressionName,e.leadingWhitespace)}case i.AstNodeType.CELL_REFERENCE:{let r;return r=void 0!==e.reference.sheet?this.unparseSheetName(e.reference.sheet)+"!":"",r+=null!==(s=e.reference.unparse(t))&&void 0!==s?s:this.config.translationPackage.getErrorTranslation(n.ErrorType.REF),(0,i.imageWithWhitespace)(r,e.leadingWhitespace)}case i.AstNodeType.COLUMN_RANGE:case i.AstNodeType.ROW_RANGE:case i.AstNodeType.CELL_RANGE:return(0,i.imageWithWhitespace)(this.formatRange(e,t),e.leadingWhitespace);case i.AstNodeType.PLUS_UNARY_OP:{const r=this.unparseAst(e.value,t);return(0,i.imageWithWhitespace)("+",e.leadingWhitespace)+r}case i.AstNodeType.MINUS_UNARY_OP:{const r=this.unparseAst(e.value,t);return(0,i.imageWithWhitespace)("-",e.leadingWhitespace)+r}case i.AstNodeType.PERCENT_OP:return this.unparseAst(e.value,t)+(0,i.imageWithWhitespace)("%",e.leadingWhitespace);case i.AstNodeType.ERROR:{const t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:n.ErrorType.ERROR);return(0,i.imageWithWhitespace)(t,e.leadingWhitespace)}case i.AstNodeType.ERROR_WITH_RAW_INPUT:return(0,i.imageWithWhitespace)(e.rawInput,e.leadingWhitespace);case i.AstNodeType.PARENTHESIS:{const r="("+this.unparseAst(e.expression,t)+(0,i.imageWithWhitespace)(")",e.internalWhitespace);return(0,i.imageWithWhitespace)(r,e.leadingWhitespace)}case i.AstNodeType.ARRAY:{const r="{"+e.args.map((e=>e.map((e=>this.unparseAst(e,t))).join(this.config.arrayColumnSeparator))).join(this.config.arrayRowSeparator)+(0,i.imageWithWhitespace)("}",e.internalWhitespace);return(0,i.imageWithWhitespace)(r,e.leadingWhitespace)}default:{const r=this.unparseAst(e.left,t),n=this.unparseAst(e.right,t);return r+(0,i.imageWithWhitespace)(a.binaryOpTokenMap[e.type],e.leadingWhitespace)+n}}}unparseSheetName(e){const t=(0,o.sheetIndexToString)(e,this.sheetMappingFn);if(void 0===t)throw new s.NoSheetWithIdError(e);return t}formatRange(e,t){let r="",s="";void 0!==e.start.sheet&&e.sheetReferenceType!==i.RangeSheetReferenceType.RELATIVE&&(r=this.unparseSheetName(e.start.sheet)+"!"),void 0!==e.end.sheet&&e.sheetReferenceType===i.RangeSheetReferenceType.BOTH_ABSOLUTE&&(s=this.unparseSheetName(e.end.sheet)+"!");const o=e.start.unparse(t),a=e.end.unparse(t);return void 0===o||void 0===a?this.config.translationPackage.getErrorTranslation(n.ErrorType.REF):`${r}${o}:${s}${a}`}}function u(e,t){return e.toString().replace(".",t)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{collectDependencies:()=>o});var n=r(7);const s=(e,t,r,o)=>{switch(e.type){case n.AstNodeType.EMPTY:case n.AstNodeType.NUMBER:case n.AstNodeType.STRING:case n.AstNodeType.ERROR:return;case n.AstNodeType.NAMED_EXPRESSION:return void(o&&r.push(new n.NamedExpressionDependency(e.expressionName)));case n.AstNodeType.CELL_REFERENCE:return void(o&&r.push(new n.AddressDependency(e.reference)));case n.AstNodeType.CELL_RANGE:return void(o&&e.start.sheet===e.end.sheet&&r.push(new n.CellRangeDependency(e.start,e.end)));case n.AstNodeType.COLUMN_RANGE:return void(o&&e.start.sheet===e.end.sheet&&r.push(new n.ColumnRangeDependency(e.start,e.end)));case n.AstNodeType.ROW_RANGE:return void(o&&e.start.sheet===e.end.sheet&&r.push(new n.RowRangeDependency(e.start,e.end)));case n.AstNodeType.PERCENT_OP:case n.AstNodeType.PLUS_UNARY_OP:case n.AstNodeType.MINUS_UNARY_OP:return void s(e.value,t,r,!0);case n.AstNodeType.CONCATENATE_OP:case n.AstNodeType.EQUALS_OP:case n.AstNodeType.NOT_EQUAL_OP:case n.AstNodeType.LESS_THAN_OP:case n.AstNodeType.GREATER_THAN_OP:case n.AstNodeType.LESS_THAN_OR_EQUAL_OP:case n.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case n.AstNodeType.MINUS_OP:case n.AstNodeType.PLUS_OP:case n.AstNodeType.TIMES_OP:case n.AstNodeType.DIV_OP:case n.AstNodeType.POWER_OP:return s(e.left,t,r,!0),void s(e.right,t,r,!0);case n.AstNodeType.PARENTHESIS:return void s(e.expression,t,r,o);case n.AstNodeType.FUNCTION_CALL:{const n=!t.doesFunctionNeedArgumentToBeComputed(e.procedureName);return void e.args.forEach((e=>s(e,t,r,n)))}}},o=(e,t)=>{const r=new Array;return s(e,t,r,!0),r}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressDependency:()=>s,CellRangeDependency:()=>o,ColumnRangeDependency:()=>i,NamedExpressionDependency:()=>l,RowRangeDependency:()=>a});var n=r(2);class s{constructor(e){this.dependency=e}absolutize(e){return this.dependency.toSimpleCellAddress(e)}}class o{constructor(e,t){this.start=e,this.end=t}absolutize(e){return new n.AbsoluteCellRange(this.start.toSimpleCellAddress(e),this.end.toSimpleCellAddress(e))}}class i{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleColumnAddress(e),r=this.end.toSimpleColumnAddress(e);return new n.AbsoluteColumnRange(t.sheet,t.col,r.col)}}class a{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleRowAddress(e),r=this.end.toSimpleRowAddress(e);return new n.AbsoluteRowRange(t.sheet,t.row,r.row)}}class l{constructor(e){this.name=e}absolutize(e){return this}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ContentChanges:()=>o});var n=r(3),s=r(69);class o{constructor(){this.changes=new Map}static empty(){return new o}addAll(e){for(const 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=[];return this.changes.forEach((r=>{const n=e.exportChange(r);Array.isArray(n)?t=t.concat(n):t.push(n)})),t}getChanges(){return Array.from(this.changes.values())}isEmpty(){return 0===this.changes.size}add(e,t){const r=t.value;if(r instanceof s.SimpleRangeValue)for(const t of r.effectiveAddressesFromData(e))this.changes.delete(`${t.sheet},${t.col},${t.row}`);this.changes.set((0,n.addressKey)(e),t)}addInterpreterValue(e,t,r){this.add(t,{address:t,value:e,oldValue:r})}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SimpleRangeValue:()=>a});var n=r(1),s=r(3),o=r(61),i=r(70);class a{constructor(e,t,r,s){this._data=e,this.range=t,this.dependencyGraph=r,this._hasOnlyNumbers=s,this.size=void 0===e?new n.ArraySize(t.effectiveWidth(r),t.effectiveHeight(r)):new n.ArraySize(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();const 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){const r=this.data[t];for(let n=0;n<r.length;++n)yield(0,s.simpleCellAddress)(e.sheet,e.col+n,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,s.simpleCellAddress)(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){this._hasOnlyNumbers=!0;for(const e of this.data)for(const 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=>{const t=this.dependencyGraph.getCellValue(e);return t instanceof a?(this._hasOnlyNumbers=!1,new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.ScalarExpected)):((0,i.isExtendedNumber)(t)||(this._hasOnlyNumbers=!1),t)})))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CurrencyNumber:()=>l,DateNumber:()=>a,DateTimeNumber:()=>h,EmptyValue:()=>n,NumberType:()=>p,PercentNumber:()=>c,RichNumber:()=>o,TimeNumber:()=>u,cloneNumber:()=>i,getFormatOfExtendedNumber:()=>m,getRawValue:()=>s,getTypeFormatOfExtendedNumber:()=>f,getTypeOfExtendedNumber:()=>g,isExtendedNumber:()=>d});const n=Symbol("Empty value");function s(e){return e instanceof o?e.val:e}class o{constructor(e,t){this.val=e,this.format=t}fromNumber(e){return new this.constructor(e)}}function i(e,t){if("number"==typeof e)return t;{const r=e.fromNumber(t);return r.format=e.format,r}}class a extends o{getDetailedType(){return p.NUMBER_DATE}}class l extends o{getDetailedType(){return p.NUMBER_CURRENCY}}class u extends o{getDetailedType(){return p.NUMBER_TIME}}class h extends o{getDetailedType(){return p.NUMBER_DATETIME}}class c extends o{getDetailedType(){return p.NUMBER_PERCENT}}function d(e){return"number"==typeof e||e instanceof o}var p;function g(e){return e instanceof o?e.getDetailedType():p.NUMBER_RAW}function m(e){return e instanceof o?e.format:void 0}function f(e){return e instanceof o?{type:e.getDetailedType(),format:e.format}:{type:p.NUMBER_RAW}}!function(e){e.NUMBER_RAW="NUMBER_RAW",e.NUMBER_DATE="NUMBER_DATE",e.NUMBER_TIME="NUMBER_TIME",e.NUMBER_DATETIME="NUMBER_DATETIME",e.NUMBER_CURRENCY="NUMBER_CURRENCY",e.NUMBER_PERCENT="NUMBER_PERCENT"}(p||(p={}))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ColumnsSpan:()=>s,RowsSpan:()=>n});class n{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 n(e,t,t+r-1)}static fromRowStartAndEnd(e,t,r){return new n(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");const t=Math.max(this.rowStart,e.rowStart),r=Math.min(this.rowEnd,e.rowEnd);return t>r?null:new n(this.sheet,t,r)}firstRow(){return new n(this.sheet,this.rowStart,this.rowStart)}}class s{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 s(e,t,t+r-1)}static fromColumnStartAndEnd(e,t,r){return new s(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");const t=Math.max(this.columnStart,e.columnStart),r=Math.min(this.columnEnd,e.columnEnd);return t>r?null:new s(this.sheet,t,r)}firstColumn(){return new s(this.sheet,this.columnStart,this.columnStart)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EmptyStatistics:()=>n.EmptyStatistics,StatType:()=>o.StatType,Statistics:()=>s.Statistics});var n=r(73),s=r(74),o=r(75)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EmptyStatistics:()=>s});var n=r(74);class s extends n.Statistics{incrementCriterionFunctionFullCacheUsed(){}incrementCriterionFunctionPartialCacheUsed(){}start(e){}end(e){}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Statistics:()=>s});var n=r(75);class s{constructor(){this.stats=new Map([[n.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,0],[n.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0]]),this.startTimes=new Map}incrementCriterionFunctionFullCacheUsed(){var e;const t=(null!==(e=this.stats.get(n.StatType.CRITERION_FUNCTION_FULL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(n.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,t)}incrementCriterionFunctionPartialCacheUsed(){var e;const t=(null!==(e=this.stats.get(n.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(n.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED,t)}reset(){this.stats.clear(),this.startTimes.clear(),this.stats.set(n.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,0),this.stats.set(n.StatType.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;const r=Date.now(),n=this.startTimes.get(e);if(!n)throw Error(`Statistics ${e} not started`);{let s=null!==(t=this.stats.get(e))&&void 0!==t?t:0;s+=r-n,this.stats.set(e,s),this.startTimes.delete(e)}}measure(e,t){this.start(e);const r=t();return this.end(e),r}snapshot(){return new Map(this.stats)}}},(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{StatType:()=>n}),function(e){e.BUILD_ENGINE_TOTAL="BUILD_ENGINE_TOTAL",e.PARSER="PARSER",e.GRAPH_BUILD="GRAPH_BUILD",e.COLLECT_DEPENDENCIES="COLLECT_DEPENDENCIES",e.PROCESS_DEPENDENCIES="PROCESS_DEPENDENCIES",e.TOP_SORT="TOP_SORT",e.BUILD_COLUMN_INDEX="BUILD_COLUMN_INDEX",e.EVALUATION="EVALUATION",e.VLOOKUP="VLOOKUP",e.TRANSFORM_ASTS="TRANSFORM_ASTS",e.TRANSFORM_ASTS_POSTPONED="TRANSFORM_ASTS_POSTPONED",e.ADJUSTING_ADDRESS_MAPPING="ADJUSTING_ADDRESS_MAPPING",e.ADJUSTING_ARRAY_MAPPING="ADJUSTING_ARRAY_MAPPING",e.ADJUSTING_RANGES="ADJUSTING_RANGES",e.ADJUSTING_GRAPH="ADJUSTING_GRAPH",e.CRITERION_FUNCTION_FULL_CACHE_USED="CRITERION_FUNCTION_FULL_CACHE_USED",e.CRITERION_FUNCTION_PARTIAL_CACHE_USED="CRITERION_FUNCTION_PARTIAL_CACHE_USED"}(n||(n={}))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressMapping:()=>i});var n=r(77),s=r(70),o=r(4);class i{constructor(e){this.policy=e,this.mapping=new Map}getCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new n.NoSheetWithIdError(e.sheet);return t.getCell(e)}fetchCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new n.NoSheetWithIdError(e.sheet);const r=t.getCell(e);if(!r)throw Error("Vertex for address missing in AddressMapping");return r}strategyFor(e){const t=this.mapping.get(e);if(void 0===t)throw new n.NoSheetWithIdError(e);return t}addSheet(e,t){if(this.mapping.has(e))throw Error("Sheet already added");this.mapping.set(e,t)}autoAddSheet(e,t,r){const{height:n,width:s,fill:o}=r,i=this.policy.call(o);this.addSheet(e,new i(s,n))}getCellValue(e){const t=this.getCell(e);return void 0===t?s.EmptyValue:t instanceof o.ArrayVertex?t.getArrayCellValue(e):t.getCellValue()}getRawValue(e){const t=this.getCell(e);return t instanceof o.ValueCellVertex?t.getValues().rawValue:t instanceof o.ArrayVertex?t.getArrayCellRawValue(e):null}setCell(e,t){const r=this.mapping.get(e.sheet);if(!r)throw Error("Sheet not initialized");r.setCell(e,t)}moveCell(e,t){const r=this.mapping.get(e.sheet);if(!r)throw Error("Sheet not initialized.");if(e.sheet!==t.sheet)throw Error("Cannot move cells between sheets.");if(r.has(t))throw new Error("Cannot move cell. Destination already occupied.");const n=r.getCell(e);if(void 0===n)throw new Error("Cannot move cell. No cell with such address.");this.setCell(t,n),this.removeCell(e)}removeCell(e){const t=this.mapping.get(e.sheet);if(!t)throw Error("Sheet not initialized");t.removeCell(e)}has(e){const t=this.mapping.get(e.sheet);return void 0!==t&&t.has(e)}getHeight(e){const t=this.mapping.get(e);if(void 0===t)throw new n.NoSheetWithIdError(e);return t.getHeight()}getWidth(e){const t=this.mapping.get(e);if(!t)throw new n.NoSheetWithIdError(e);return t.getWidth()}addRows(e,t,r){const s=this.mapping.get(e);if(void 0===s)throw new n.NoSheetWithIdError(e);s.addRows(t,r)}removeRows(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new n.NoSheetWithIdError(e.sheet);t.removeRows(e)}removeSheet(e){this.mapping.delete(e)}addColumns(e,t,r){const s=this.mapping.get(e);if(void 0===s)throw new n.NoSheetWithIdError(e);s.addColumns(t,r)}removeColumns(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new n.NoSheetWithIdError(e.sheet);t.removeColumns(e)}*verticesFromRowsSpan(e){yield*this.mapping.get(e.sheet).verticesFromRowsSpan(e)}*verticesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).verticesFromColumnsSpan(e)}*entriesFromRowsSpan(e){yield*this.mapping.get(e.sheet).entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).entriesFromColumnsSpan(e)}*entries(){for(const[e,t]of this.mapping.entries())yield*t.getEntries(e)}*sheetEntries(e){const t=this.mapping.get(e);if(void 0===t)throw new n.NoSheetWithIdError(e);yield*t.getEntries(e)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AliasAlreadyExisting:()=>L,ConfigValueEmpty:()=>T,ConfigValueTooBigError:()=>w,ConfigValueTooSmallError:()=>R,EvaluationSuspendedError:()=>v,ExpectedOneOfValuesError:()=>S,ExpectedValueOfTypeError:()=>C,FunctionPluginValidationError:()=>b,InvalidAddressError:()=>l,InvalidArgumentsError:()=>u,LanguageAlreadyRegisteredError:()=>M,LanguageNotRegisteredError:()=>O,MissingTranslationError:()=>A,NamedExpressionDoesNotExistError:()=>p,NamedExpressionNameIsAlreadyTakenError:()=>c,NamedExpressionNameIsInvalidError:()=>d,NoOperationToRedoError:()=>m,NoOperationToUndoError:()=>g,NoRelativeAddressesAllowedError:()=>P,NoSheetWithIdError:()=>n,NoSheetWithNameError:()=>s,NotAFormulaError:()=>a,NothingToPasteError:()=>f,ProtectedFunctionError:()=>I,ProtectedFunctionTranslationError:()=>N,SheetNameAlreadyTakenError:()=>o,SheetSizeLimitExceededError:()=>i,SheetsNotEqual:()=>h,SourceLocationHasArrayError:()=>_,TargetLocationHasArrayError:()=>x,UnableToParseError:()=>E});class n extends Error{constructor(e){super(`There's no sheet with id = ${e}`)}}class s 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 i 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}) is invalid`)}}class u extends Error{constructor(e){super(`Invalid arguments, expected ${e}`)}}class h 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 p extends Error{constructor(e){super(`Named Expression '${e}' does not exist`)}}class g extends Error{constructor(){super("There is no operation to undo")}}class m extends Error{constructor(){super("There is no operation to redo")}}class f 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:return t instanceof RegExp?"RegExp("+t.toString()+")":t}}class E extends Error{constructor(e){super(`Unable to parse value: ${JSON.stringify(e,y,4)}`)}}class C extends Error{constructor(e,t){super(`Expected value of type: ${e} for config parameter: ${t}`)}}class T extends Error{constructor(e){super(`Config parameter ${e} cannot be empty.`)}}class R extends Error{constructor(e,t){super(`Config parameter ${e} should be at least ${t}`)}}class w extends Error{constructor(e,t){super(`Config parameter ${e} should be at most ${t}`)}}class S extends Error{constructor(e,t){super(`Expected one of ${e} for config parameter: ${t}`)}}class v extends Error{constructor(){super("Computations are suspended")}}class A extends Error{constructor(e){super(`Translation for ${e} is missing in the translation package you're using.`)}}class N extends Error{constructor(e){super(`Cannot register translation for function with id: ${e}`)}}class O extends Error{constructor(){super("Language not registered.")}}class M extends Error{constructor(){super("Language already registered.")}}class b extends Error{static functionNotDeclaredInPlugin(e,t){return new b(`Function with id ${e} not declared in plugin ${t}`)}static functionMethodNotFound(e,t){return new b(`Function method ${e} not found in plugin ${t}`)}}class I extends Error{static cannotRegisterFunctionWithId(e){return new I(`Cannot register function with id ${e}`)}static cannotUnregisterFunctionWithId(e){return new I(`Cannot unregister function with id ${e}`)}static cannotUnregisterProtectedPlugin(){return new I("Cannot unregister protected plugin")}}class _ extends Error{constructor(){super("Cannot perform this operation, source location has an array inside.")}}class x extends Error{constructor(){super("Cannot perform this operation, target location has an array inside.")}}class P extends Error{constructor(){super("Relative addresses not allowed in named expressions.")}}class L extends Error{constructor(e,t){super(`Alias id ${e} in plugin ${t} already defined as a function or alias.`)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArrayMapping:()=>s});var n=r(3);class s{constructor(){this.arrayMapping=new Map}getArray(e){const t=this.getArrayByCorner(e.start);if(null==t?void 0:t.getRange().sameAs(e))return t}getArrayByCorner(e){return this.arrayMapping.get((0,n.addressKey)(e))}setArray(e,t){this.arrayMapping.set((0,n.addressKey)(e.start),t)}removeArray(e){"string"==typeof e?this.arrayMapping.delete(e):this.arrayMapping.delete((0,n.addressKey)(e.start))}count(){return this.arrayMapping.size}*arraysInRows(e){for(const[t,r]of this.arrayMapping.entries())r.spansThroughSheetRows(e.sheet,e.rowStart,e.rowEnd)&&(yield[t,r])}*arraysInCols(e){for(const[t,r]of this.arrayMapping.entries())r.spansThroughSheetColumn(e.sheet,e.columnStart,e.columnEnd)&&(yield[t,r])}isFormulaArrayInRow(e,t){for(const r of this.arrayMapping.values())if(r.spansThroughSheetRows(e,t))return!0;return!1}isFormulaArrayInAllRows(e){let t=!0;for(const r of e.rows())this.isFormulaArrayInRow(e.sheet,r)||(t=!1);return t}isFormulaArrayInColumn(e,t){for(const r of this.arrayMapping.values())if(r.spansThroughSheetColumn(e,t))return!0;return!1}isFormulaArrayInAllColumns(e){let t=!0;for(const r of e.columns())this.isFormulaArrayInColumn(e.sheet,r)||(t=!1);return t}isFormulaArrayInRange(e){for(const t of this.arrayMapping.values())if(t.getRange().doesOverlap(e))return!0;return!1}isFormulaArrayAtAddress(e){for(const t of this.arrayMapping.values())if(t.getRange().addressInRange(e))return!0;return!1}moveArrayVerticesAfterRowByRows(e,t,r){this.updateArrayVerticesInSheet(e,((e,n)=>{const s=n.getRange();return t<=s.start.row?[s.shifted(0,r),n]:void 0}))}moveArrayVerticesAfterColumnByColumns(e,t,r){this.updateArrayVerticesInSheet(e,((e,n)=>{const s=n.getRange();return t<=s.start.col?[s.shifted(r,0),n]:void 0}))}updateArrayVerticesInSheet(e,t){const r=Array();for(const[n,s]of this.arrayMapping.entries()){if(s.sheet!==e)continue;const o=t(n,s);void 0!==o&&(this.removeArray(n),r.push(o))}r.forEach((([e,t])=>{this.setArray(e,t)}))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{collectAddressesDependentToRange:()=>i});var n=r(7),s=r(80),o=r(82);const i=(e,t,r,i,a)=>{if(t instanceof o.RangeVertex){const e=t.range.intersectionWith(r);return void 0!==e?Array.from(e.addresses(a)):[]}let l,u;return t instanceof s.FormulaVertex?(l=t.getFormula(i),u=t.getAddress(i),(0,n.collectDependencies)(l,e).filter((e=>e instanceof n.AddressDependency)).map((e=>e.dependency.toSimpleCellAddress(u))).filter((e=>r.addressInRange(e)))):[]}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArrayVertex:()=>c,FormulaCellVertex:()=>d,FormulaVertex:()=>h});var n=r(2),s=r(1),o=r(81),i=r(3),a=r(61),l=r(70),u=r(71);class h{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,n){return r.isScalar()?new d(e,t,n):new c(e,t,r,n)}getFormula(e){return this.ensureRecentData(e),this.formula}ensureRecentData(e){if(this.version!=e.version()){const[t,r,n]=e.applyTransformations(this.formula,this.cellAddress,this.version);this.formula=t,this.cellAddress=r,this.version=n}}getAddress(e){return this.ensureRecentData(e),this.cellAddress}}class c extends h{constructor(e,t,r,n=0){super(e,t,n),r.isRef?this.array=new o.ErroredArray(new i.CellError(i.ErrorType.REF,a.ErrorMessage.NoSpaceForArrayResult),s.ArraySize.error()):this.array=new o.NotComputedArray(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 i.CellError)return this.setErrorValue(e),e;const t=o.ArrayValue.fromInterpreterValue(e);return t.resize(this.array.size),this.array=t,e}getCellValue(){if(this.array instanceof o.NotComputedArray)throw Error("Array not computed yet.");return this.array.simpleRangeValue()}valueOrUndef(){if(!(this.array instanceof o.NotComputedArray))return this.array.simpleRangeValue()}getArrayCellValue(e){const t=e.col-this.cellAddress.col,r=e.row-this.cellAddress.row;try{return this.array.get(t,r)}catch(e){return new i.CellError(i.ErrorType.REF)}}getArrayCellRawValue(e){const t=this.getArrayCellValue(e);return t instanceof i.CellError||t===l.EmptyValue?void 0:(0,l.getRawValue)(t)}setArrayCellValue(e,t){const r=e.col-this.cellAddress.col,n=e.row-this.cellAddress.row;this.array instanceof o.ArrayValue&&this.array.set(r,n,t)}setNoSpace(){return this.array=new o.ErroredArray(new i.CellError(i.ErrorType.SPILL,a.ErrorMessage.NoSpaceForArrayResult),s.ArraySize.error()),this.getCellValue()}getRange(){return n.AbsoluteCellRange.spanFrom(this.cellAddress,this.width,this.height)}getRangeOrUndef(){return n.AbsoluteCellRange.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.NotComputedArray)}columnsFromArray(){return u.ColumnsSpan.fromNumberOfColumns(this.cellAddress.sheet,this.cellAddress.col,this.width)}rowsFromArray(){return u.RowsSpan.fromNumberOfRows(this.cellAddress.sheet,this.cellAddress.row,this.height)}ensureRecentData(e){}isLeftCorner(e){return(0,i.equalSimpleCellAddress)(this.cellAddress,e)}setErrorValue(e){this.array=new o.ErroredArray(e,this.array.size)}}class d extends h{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}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArrayValue:()=>a,ErroredArray:()=>l,NotComputedArray:()=>i});var n=r(1),s=r(70),o=r(69);class i{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){this.size=new n.ArraySize(e.length>0?e[0].length:0,e.length),this.array=e}static fromInterpreterValue(e){return e instanceof o.SimpleRangeValue?new a(e.data):new a([[e]])}simpleRangeValue(){return o.SimpleRangeValue.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,...new Array(t).fill(s.EmptyValue));this.size.width+=t}removeRows(e,t){if(this.outOfBound(0,e)||this.outOfBound(0,t))throw Error("Array index out of bound");const 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");const r=t-e+1;for(const t of this.array)t.splice(e,r);this.size.width-=r}nullArrays(e,t){const r=[];for(let n=0;n<e;++n)r.push(new Array(t).fill(s.EmptyValue));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)throw Error("Resizing to smaller array");if(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}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RangeVertex:()=>n});class n{constructor(e){this.range=e,this.functionCache=new Map,this.criterionFunctionCache=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()}getStart(){return this.start}getEnd(){return this.end}}},(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{Graph:()=>s}),function(e){e[e.ON_STACK=0]="ON_STACK",e[e.PROCESSED=1]="PROCESSED",e[e.POPPED=2]="POPPED"}(n||(n={}));class s{constructor(e){this.dependencyQuery=e,this.nodes=new Set,this.specialNodes=new Set,this.specialNodesStructuralChanges=new Set,this.specialNodesRecentlyChanged=new Set,this.infiniteRanges=new Set,this.edges=new Map}addNode(e){this.nodes.add(e),this.edges.has(e)||this.edges.set(e,new Set)}addEdge(e,t){if(!this.nodes.has(e))throw new Error(`Unknown node ${e}`);if(!this.nodes.has(t))throw new Error(`Unknown node ${t}`);this.edges.get(e).add(t)}removeEdge(e,t){if(!this.existsEdge(e,t))throw new Error("Edge does not exist");this.edges.get(e).delete(t)}softRemoveEdge(e,t){var r;null===(r=this.edges.get(e))||void 0===r||r.delete(t)}removeIncomingEdges(e){this.edges.forEach((t=>{t.delete(e)}))}adjacentNodes(e){return this.edges.get(e)}adjacentNodesCount(e){return this.adjacentNodes(e).size}hasNode(e){return this.nodes.has(e)}nodesCount(){return this.nodes.size}edgesCount(){let e=0;return this.edges.forEach((t=>e+=t.size)),e}removeNode(e){for(const t of this.adjacentNodes(e).values())this.markNodeAsSpecialRecentlyChanged(t);return this.edges.delete(e),this.nodes.delete(e),this.specialNodes.delete(e),this.specialNodesRecentlyChanged.delete(e),this.specialNodesStructuralChanges.delete(e),this.infiniteRanges.delete(e),this.removeDependencies(e)}markNodeAsSpecial(e){this.specialNodes.add(e)}markNodeAsSpecialRecentlyChanged(e){this.nodes.has(e)&&this.specialNodesRecentlyChanged.add(e)}markNodeAsChangingWithStructure(e){this.specialNodesStructuralChanges.add(e)}clearSpecialNodesRecentlyChanged(){this.specialNodesRecentlyChanged.clear()}markNodeAsInfiniteRange(e){this.infiniteRanges.add(e)}existsEdge(e,t){var r,n;return null!==(n=null===(r=this.edges.get(e))||void 0===r?void 0:r.has(t))&&void 0!==n&&n}topSortWithScc(){return this.getTopSortedWithSccSubgraphFrom(Array.from(this.nodes),(()=>!0),(()=>{}))}getTopSortedWithSccSubgraphFrom(e,t,r){const s=new Map,o=new Map,i=new Map,a=new Set,l=new Map,u=[];let h=0;const c=new Set;e.reverse(),e.forEach((e=>{if(void 0!==l.get(e))return;const t=[e],r=[];for(l.set(e,n.ON_STACK);t.length>0;){const e=t[t.length-1];switch(l.get(e)){case n.ON_STACK:s.set(e,h),o.set(e,h),r.push(e),h++,this.adjacentNodes(e).forEach((r=>{void 0===s.get(r)&&(t.push(r),i.set(r,e),l.set(r,n.ON_STACK))})),l.set(e,n.PROCESSED);break;case n.PROCESSED:{let h;if(h=s.get(e),this.adjacentNodes(e).forEach((t=>{a.has(t)||(h=i.get(t)===e?Math.min(h,o.get(t)):Math.min(h,s.get(t)))})),o.set(e,h),h===s.get(e)){const t=[];do{t.push(r[r.length-1]),r.pop()}while(t[t.length-1]!==e);t.forEach((e=>{a.add(e)})),u.push(...t),t.length>1&&t.forEach((e=>{c.add(e)}))}t.pop(),l.set(e,n.POPPED);break}case n.POPPED:t.pop()}}}));const d=new Set(e),p=[],g=[];return u.reverse(),u.forEach((e=>{c.has(e)||this.adjacentNodes(e).has(e)?(g.push(e),r(e),this.adjacentNodes(e).forEach((e=>d.add(e)))):(p.push(e),d.has(e)&&t(e)&&this.adjacentNodes(e).forEach((e=>d.add(e))))})),{sorted:p,cycled:g}}getDependencies(e){const t=[];return this.edges.forEach(((r,n)=>{r.has(e)&&t.push(n)})),t}removeDependencies(e){const t=this.dependencyQuery(e);for(const[r,n]of t)this.softRemoveEdge(n,e);return t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RangeMapping:()=>o});var n=r(2),s=r(3);class o{constructor(){this.rangeMapping=new Map}getMappingSize(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}setRange(e){let t=this.rangeMapping.get(e.getStart().sheet);void 0===t&&(t=new Map,this.rangeMapping.set(e.getStart().sheet,t));const r=i(e.getStart(),e.getEnd());t.set(r,e)}removeRange(e){const t=e.getStart().sheet,r=this.rangeMapping.get(t);if(void 0===r)return;const n=i(e.getStart(),e.getEnd());r.delete(n),0===r.size&&this.rangeMapping.delete(t)}getRange(e,t){const r=this.rangeMapping.get(e.sheet),n=i(e,t);return null==r?void 0:r.get(n)}fetchRange(e,t){const r=this.getRange(e,t);if(!r)throw Error("Range does not exist");return r}truncateRanges(e,t){const r=Array(),n=Array(),s=Array(),o=e.sheet;for(const[i,a]of this.entriesFromSheet(e.sheet)){const l=a.range;e.start<=t(a.range.end)&&(l.removeSpan(e),l.shouldBeRemoved()?(this.removeByKey(o,i),r.push(a)):n.push([i,a]),s.push(a))}const l=[];n.sort(((e,r)=>a(e[1],r[1],t)));for(const[e,t]of n){const r=i((u=t.range).start,u.end);if(r===e)continue;const n=this.getByKey(o,r);this.removeByKey(o,e),void 0!==n&&t!=n?l.push([n,t]):this.setRange(t)}var u;return{verticesToRemove:r,verticesToMerge:l,verticesWithChangedSize:s}}moveAllRangesInSheetAfterRowByRows(e,t,r){return this.updateVerticesFromSheet(e,((e,n)=>t<=n.start.row?(n.range.shiftByRows(r),{changedSize:!1,vertex:n}):t>n.start.row&&t<=n.end.row?(n.range.expandByRows(r),{changedSize:!0,vertex:n}):void 0))}moveAllRangesInSheetAfterColumnByColumns(e,t,r){return this.updateVerticesFromSheet(e,((e,n)=>t<=n.start.col?(n.range.shiftByColumns(r),{changedSize:!1,vertex:n}):t>n.start.col&&t<=n.end.col?(n.range.expandByColumns(r),{changedSize:!0,vertex:n}):void 0))}moveRangesInsideSourceRange(e,t,r,n){this.updateVerticesFromSheet(e.sheet,((s,o)=>e.containsRange(o.range)?(o.range.shiftByColumns(t),o.range.shiftByRows(r),o.range.moveToSheet(n),{changedSize:!1,vertex:o}):void 0))}removeRangesInSheet(e){if(this.rangeMapping.has(e)){const t=this.rangeMapping.get(e).values();return this.rangeMapping.delete(e),t}return[][Symbol.iterator]()}*rangesInSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.values())}*rangeVerticesContainedInRange(e){for(const t of this.rangesInSheet(e.sheet))e.containsRange(t.range)&&(yield t)}findSmallerRange(e){if(e.height()>1&&Number.isFinite(e.height())){const t=(0,s.simpleCellAddress)(e.end.sheet,e.end.col,e.end.row-1),r=this.getRange(e.start,t);if(void 0!==r){return{smallerRangeVertex:r,restRange:n.AbsoluteCellRange.fromSimpleCellAddresses((0,s.simpleCellAddress)(e.start.sheet,e.start.col,e.end.row),e.end)}}}return{restRange:e}}*entriesFromSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.entries())}removeByKey(e,t){this.rangeMapping.get(e).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){const r=Array();for(const[n,s]of this.entriesFromSheet(e)){const o=t(n,s);void 0!==o&&(this.removeByKey(e,n),r.push(o))}return r.forEach((e=>{this.setRange(e.vertex)})),{verticesWithChangedSize:r.filter((e=>e.changedSize)).map((e=>e.vertex))}}}function i(e,t){return`${e.col},${e.row},${t.col},${t.row}`}const a=(e,t,r)=>{const n=r(e.range.start),s=r(e.range.start);if(n===s){return r(e.range.end)-r(t.range.end)}return n-s}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SheetMapping:()=>a});var n=r(77),s=r(86);function o(e){return e.toLowerCase()}class i{constructor(e,t){this.id=e,this.displayName=t}get canonicalName(){return o(this.displayName)}}class a{constructor(e){this.languages=e,this.mappingFromCanonicalName=new Map,this.mappingFromId=new Map,this.lastSheetId=-1,this.fetch=e=>{const t=this.mappingFromCanonicalName.get(o(e));if(void 0===t)throw new n.NoSheetWithNameError(e);return t.id},this.get=e=>{var t;return null===(t=this.mappingFromCanonicalName.get(o(e)))||void 0===t?void 0:t.id},this.fetchDisplayName=e=>this.fetchSheetById(e).displayName,this.sheetNamePrefix=e.getUITranslation(s.UIElement.NEW_SHEET_PREFIX)}addSheet(e=`${this.sheetNamePrefix}${this.lastSheetId+2}`){const t=o(e);if(this.mappingFromCanonicalName.has(t))throw new n.SheetNameAlreadyTakenError(e);this.lastSheetId++;const r=new i(this.lastSheetId,e);return this.store(r),r.id}removeSheet(e){const t=this.fetchSheetById(e);e==this.lastSheetId&&--this.lastSheetId,this.mappingFromCanonicalName.delete(t.canonicalName),this.mappingFromId.delete(t.id)}getDisplayName(e){var t;return null===(t=this.mappingFromId.get(e))||void 0===t?void 0:t.displayName}*displayNames(){for(const e of this.mappingFromCanonicalName.values())yield e.displayName}numberOfSheets(){return this.mappingFromCanonicalName.size}hasSheetWithId(e){return this.mappingFromId.has(e)}hasSheetWithName(e){return this.mappingFromCanonicalName.has(o(e))}renameSheet(e,t){const r=this.fetchSheetById(e),s=r.displayName;if(s===t)return;const i=this.mappingFromCanonicalName.get(o(t));if(void 0!==i&&i.id!==r.id)throw new n.SheetNameAlreadyTakenError(t);const a=r.canonicalName;return this.mappingFromCanonicalName.delete(a),r.displayName=t,this.store(r),s}sheetNames(){return Array.from(this.mappingFromId.values()).map((e=>e.displayName))}store(e){this.mappingFromId.set(e.id,e),this.mappingFromCanonicalName.set(e.canonicalName,e)}fetchSheetById(e){const t=this.mappingFromId.get(e);if(void 0===t)throw new n.NoSheetWithIdError(e);return t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TranslationPackage:()=>s.TranslationPackage,UIElement:()=>n,buildTranslationPackage:()=>s.buildTranslationPackage});var n,s=r(87);!function(e){e.NEW_SHEET_PREFIX="NEW_SHEET_PREFIX"}(n||(n={}))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TranslationPackage:()=>i,buildTranslationPackage:()=>a});var n=r(3),s=r(77),o=r(86);class i{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)=>(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){const t=[];for(const r of e)this.isFunctionTranslated(r)&&t.push(this.functions[r]);return t}getFunctionTranslation(e){const t=this.functions[e];if(void 0===t)throw new s.MissingTranslationError(`functions.${e}`);return t}getMaybeFunctionTranslation(e){return this.functions[e]}getErrorTranslation(e){if(e===n.ErrorType.LIC)return`#${n.ErrorType.LIC}!`;const t=this.errors[e];if(void 0===t)throw new s.MissingTranslationError(`errors.${e}`);return t}getUITranslation(e){const t=this.ui[e];if(void 0===t)throw new s.MissingTranslationError(`ui.${e}`);return t}checkUI(){for(const e of Object.values(o.UIElement))if(!(e in this.ui))throw new s.MissingTranslationError(`ui.${e}`)}checkErrors(){for(const e of Object.values(n.ErrorType))if(!(e in this.errors)&&e!==n.ErrorType.LIC)throw new s.MissingTranslationError(`errors.${e}`)}checkFunctionTranslations(e){const t=new Set(Object.getOwnPropertyNames(e));for(const e of Object.getOwnPropertyNames(this._protectedTranslations))if(t.has(e))throw new s.ProtectedFunctionTranslationError(e)}}function a(e){return new i(Object.assign({},e.functions),Object.assign({},e.errors),Object.assign({},e.ui))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EmptyCellVertex:()=>s});var n=r(70);class s{constructor(){}getCellValue(){return n.EmptyValue}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ValueCellVertex:()=>n});class n{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}setCellValue(e){throw Error("SetCellValue is deprecated for ValueCellVertex")}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ParsingErrorVertex:()=>s});var n=r(3);class s{constructor(e,t){this.errors=e,this.rawInput=t}getCellValue(){return n.CellError.parsingError()}getFormula(){return this.rawInput}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SparseStrategy:()=>s});var n=r(3);class s{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=>{const n=new Map;r.forEach(((s,o)=>{o>=e&&(n.set(o+t,s),r.delete(o))})),n.forEach(((e,t)=>{r.set(t,e)}))})),this.height+=t}addColumns(e,t){const r=new Map;this.mapping.forEach(((n,s)=>{s>=e&&(r.set(s+t,n),this.mapping.delete(s))})),r.forEach(((e,t)=>{this.mapping.set(t,e)})),this.width+=t}removeRows(e){this.mapping.forEach((t=>{const r=new Map;t.forEach(((n,s)=>{s>=e.rowStart&&(t.delete(s),s>e.rowEnd&&r.set(s-e.numberOfRows,n))})),r.forEach(((e,r)=>{t.set(r,e)}))}));const t=Math.min(this.height-1,e.rowEnd),r=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-r)}removeColumns(e){const t=new Map;this.mapping.forEach(((r,n)=>{n>=e.columnStart&&(this.mapping.delete(n),n>e.columnEnd&&t.set(n-e.numberOfColumns,r))})),t.forEach(((e,t)=>{this.mapping.set(t,e)}));const r=Math.min(this.width-1,e.columnEnd),n=Math.max(0,r-e.columnStart+1);this.width=Math.max(0,this.width-n)}*getEntries(e){for(const[t,r]of this.mapping)for(const[s,o]of r)yield[(0,n.simpleCellAddress)(e,t,s),o]}*verticesFromColumn(e){const t=this.mapping.get(e);if(void 0!==t)for(const[e,r]of t)yield r}*verticesFromRow(e){for(const t of this.mapping.values()){const r=t.get(e);void 0!==r&&(yield r)}}*verticesFromColumnsSpan(e){for(const t of e.columns()){const e=this.mapping.get(t);if(void 0!==e)for(const[t,r]of e)yield r}}*verticesFromRowsSpan(e){for(const t of this.mapping.values())for(const r of e.rows()){const e=t.get(r);void 0!==e&&(yield e)}}*entriesFromRowsSpan(e){for(const[t,r]of this.mapping.entries())for(const s of e.rows()){const o=r.get(s);void 0!==o&&(yield[(0,n.simpleCellAddress)(e.sheet,t,s),o])}}*entriesFromColumnsSpan(e){for(const t of e.columns()){const r=this.mapping.get(t);if(void 0!==r)for(const[s,o]of r.entries())yield[(0,n.simpleCellAddress)(e.sheet,t,s),o]}}*vertices(){for(const[e,t]of this.mapping)for(const[e,r]of t)void 0!==r&&(yield r)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DenseStrategy:()=>s});var n=r(3);class s{constructor(e,t){this.width=e,this.height=t,this.mapping=new Array(t);for(let r=0;r<t;r++)this.mapping[r]=new 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]=new Array(this.width)),this.mapping[e.row][e.col]=t}has(e){const 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){const r=[];for(let e=0;e<t;e++)r.push(new Array(this.width));this.mapping.splice(e,0,...r),this.height+=t}addColumns(e,t){for(let r=0;r<this.height;r++)this.mapping[r].splice(e,0,...new Array(t));this.width+=t}removeRows(e){this.mapping.splice(e.rowStart,e.numberOfRows);const t=Math.min(this.height-1,e.rowEnd),r=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-r)}removeColumns(e){for(let t=0;t<this.height;t++)this.mapping[t].splice(e.columnStart,e.numberOfColumns);const t=Math.min(this.width-1,e.columnEnd),r=Math.max(0,t-e.columnStart+1);this.width=Math.max(0,this.width-r)}*getEntries(e){for(let t=0;t<this.height;++t)for(let r=0;r<this.width;++r){const s=this.getCellVertex(r,t);s&&(yield[(0,n.simpleCellAddress)(e,r,t),s])}}*verticesFromColumn(e){for(let t=0;t<this.height;++t){const r=this.getCellVertex(e,t);r&&(yield r)}}*verticesFromRow(e){for(let t=0;t<this.width;++t){const 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){const 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){const 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){const s=this.getCellVertex(t,r);s&&(yield[(0,n.simpleCellAddress)(e.sheet,t,r),s])}}*entriesFromColumnsSpan(e){for(let t=e.columnStart;t<=e.columnEnd;++t)for(let r=0;r<this.height;++r){const s=this.getCellVertex(t,r);s&&(yield[(0,n.simpleCellAddress)(e.sheet,t,r),s])}}*vertices(){for(let e=0;e<this.height;++e)for(let t=0;t<this.width;++t){const 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]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{InterpreterState:()=>n});class n{constructor(e,t,r){this.formulaAddress=e,this.arraysFlag=t,this.formulaVertex=r}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FunctionArgumentType:()=>n,FunctionPlugin:()=>c});var n,s=r(2),o=r(3),i=r(61),a=r(7),l=r(95),u=r(70),h=r(69);!function(e){e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.SCALAR="SCALAR",e.NOERROR="NOERROR",e.RANGE="RANGE",e.INTEGER="INTEGER",e.COMPLEX="COMPLEX",e.ANY="ANY"}(n||(n={}));class c{constructor(e){this.coerceScalarToNumberOrError=e=>this.arithmeticHelper.coerceScalarToNumberOrError(e),this.runFunction=(e,t,r,n)=>{const s=this.evaluateArguments(e,t,r),a=s.map((([e,t])=>e)),l=s.map((([e,t])=>t)),u=this.buildMetadataForEachArgumentValue(a.length,r),c=t.arraysFlag&&!r.vectorizationForbidden;if(!this.isNumberOfArgumentValuesValid(u,a.length))return new o.CellError(o.ErrorType.NA,i.ErrorMessage.WrongArgNumber);const[d,p]=c?this.calculateSizeOfVectorizedResultArray(a,u):[1,1];if(1===d&&1===p){const e=this.vectorizeAndBroadcastArgumentsIfNecessary(c,a,u,0,0);return this.calculateSingleCellOfResultArray(t,e,u,l,n,r.returnNumberType)}const g=[...Array(d).keys()].map((e=>[...Array(p).keys()].map((s=>{const o=this.vectorizeAndBroadcastArgumentsIfNecessary(c,a,u,e,s),i=this.calculateSingleCellOfResultArray(t,o,u,l,n,r.returnNumberType);if(i instanceof h.SimpleRangeValue)throw new Error("Function returning array cannot be vectorized.");return i}))));return h.SimpleRangeValue.onlyValues(g)},this.runFunctionWithReferenceArgument=(e,t,r,n,l,u=(()=>new o.CellError(o.ErrorType.NA,i.ErrorMessage.CellRefExpected)))=>{if(0===e.length)return this.returnNumberWrapper(n(),r.returnNumberType);if(e.length>1)return new o.CellError(o.ErrorType.NA,i.ErrorMessage.WrongArgNumber);let h,c=e[0];for(;c.type===a.AstNodeType.PARENTHESIS;)c=c.expression;if(c.type===a.AstNodeType.CELL_REFERENCE)h=c.reference.toSimpleCellAddress(t.formulaAddress);else if(c.type===a.AstNodeType.CELL_RANGE||c.type===a.AstNodeType.COLUMN_RANGE||c.type===a.AstNodeType.ROW_RANGE)try{h=s.AbsoluteCellRange.fromAst(c,t.formulaAddress).start}catch(e){return new o.CellError(o.ErrorType.REF,i.ErrorMessage.CellRefExpected)}return void 0!==h?this.returnNumberWrapper(l(h),r.returnNumberType):this.runFunction(e,t,r,u)},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){const r=[];for(const n of e){const e=this.evaluateAst(n,t);if(e instanceof h.SimpleRangeValue)for(const t of e.valuesFromTopLeftCorner())r.push([t,!0]);else r.push([e,!1])}return r}coerceToType(e,t,r){let s;if(e instanceof h.SimpleRangeValue)switch(t.argumentType){case n.RANGE:case n.ANY:s=e;break;default:{const t=(0,l.coerceRangeToScalar)(e,r);if(void 0===t)return;e=t}}if(!(e instanceof h.SimpleRangeValue))switch(t.argumentType){case n.INTEGER:case n.NUMBER:const r=this.coerceScalarToNumberOrError(e);if(!(0,u.isExtendedNumber)(r)){s=r;break}const a=(0,u.getRawValue)(r);if(void 0!==t.maxValue&&a>t.maxValue)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ValueLarge);if(void 0!==t.minValue&&a<t.minValue)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ValueSmall);if(void 0!==t.lessThan&&a>=t.lessThan)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ValueLarge);if(void 0!==t.greaterThan&&a<=t.greaterThan)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ValueSmall);if(t.argumentType===n.INTEGER&&!Number.isInteger(a))return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.IntegerExpected);s=r;break;case n.STRING:s=(0,l.coerceScalarToString)(e);break;case n.BOOLEAN:s=(0,l.coerceScalarToBoolean)(e);break;case n.SCALAR:case n.NOERROR:case n.ANY:s=e;break;case n.RANGE:if(e instanceof o.CellError)return e;s=(0,l.coerceToRange)(e);break;case n.COMPLEX:return this.arithmeticHelper.coerceScalarToComplex((0,u.getRawValue)(e))}return t.passSubtype||void 0===s?s:(0,u.getRawValue)(s)}calculateSingleCellOfResultArray(e,t,r,n,s,i){const a=this.coerceArgumentsToRequiredTypes(e,t,r,n);if(a instanceof o.CellError)return a;const l=s(...a);return this.returnNumberWrapper(l,i)}coerceArgumentsToRequiredTypes(e,t,r,s){const a=[];for(let l=0;l<r.length;l++){const u=r[l],h=void 0!==t[l]?t[l]:null==u?void 0:u.defaultValue;if(void 0===h){a.push(void 0);continue}const c=this.coerceToType(h,u,e);if(void 0===c&&!s[l])return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.WrongType);if(c instanceof o.CellError&&u.argumentType!==n.SCALAR)return c;a.push(c)}return a}vectorizeAndBroadcastArgumentsIfNecessary(e,t,r,n,s){return t.map(((t,o)=>e&&this.isRangePassedAsAScalarArgument(t,r[o])?this.vectorizeAndBroadcastRangeArgument(t,n,s):t))}vectorizeAndBroadcastRangeArgument(e,t,r){var n;const s=1===e.height()?0:t,o=1===e.width()?0:r;return null===(n=e.data[s])||void 0===n?void 0:n[o]}evaluateArguments(e,t,r){return r.expandRanges?this.listOfScalarValues(e,t):e.map((e=>[this.evaluateAst(e,t),!1]))}buildMetadataForEachArgumentValue(e,t){const 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){if(t>e.length)return!1;if(t<e.length){return e.slice(t).every((e=>(null==e?void 0:e.optionalArg)||void 0!==(null==e?void 0:e.defaultValue)))}return!0}calculateSizeOfVectorizedResultArray(e,t){const 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 h.SimpleRangeValue&&![n.RANGE,n.ANY].includes(t.argumentType))}metadata(e){const t=this.constructor.implementedFunctions[e];if(void 0!==t)return t;throw new Error(`No metadata for function ${e}.`)}returnNumberWrapper(e,t,r){return void 0!==t&&(0,u.isExtendedNumber)(e)?this.arithmeticHelper.ExtendedNumberFactory((0,u.getRawValue)(e),{type:t,format:r}):e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArithmeticHelper:()=>d,coerceBooleanToNumber:()=>f,coerceComplexToString:()=>p,coerceEmptyToValue:()=>y,coerceRangeToScalar:()=>I,coerceScalarToBoolean:()=>E,coerceScalarToString:()=>C,coerceToRange:()=>g,coerceToRangeNumbersOrError:()=>m,fixNegativeZero:()=>S,forceNormalizeString:()=>b,isNumberOverflow:()=>w,normalizeString:()=>_,numberCmp:()=>R,zeroIfEmpty:()=>T});var n=r(96),s=r.n(n),o=r(3),i=r(61),a=r(97),l=r(70),u=r(69);const h="i",c=/^\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij]))\s*(([+-])\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij])))?$/;class d{constructor(e,t,r){this.config=e,this.dateTimeHelper=t,this.numberLiteralsHelper=r,this.lt=(e,t)=>this.compare(e,t)<0,this.leq=(e,t)=>this.compare(e,t)<=0,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,l.getRawValue)(e),(0,l.getRawValue)(t)),this.addWithEpsilonRaw=(e,t)=>{const r=e+t;return Math.abs(r)<this.actualEps*Math.abs(e)?0:r},this.addWithEpsilon=(e,t)=>{const r=O(e,t);return this.ExtendedNumberFactory(this.addWithEpsilonRaw((0,l.getRawValue)(e),(0,l.getRawValue)(t)),r)},this.unaryMinus=e=>(0,l.cloneNumber)(e,-(0,l.getRawValue)(e)),this.unaryPlus=e=>e,this.unaryPercent=e=>new l.PercentNumber((0,l.getRawValue)(e)/100),this.concat=(e,t)=>e.concat(t),this.nonstrictadd=(e,t)=>e instanceof o.CellError?e:t instanceof o.CellError?t:"number"==typeof e?"number"==typeof t?this.addWithEpsilonRaw(e,t):e:"number"==typeof t?t:0,this.subtract=(e,t)=>{const r=O(e,t),n=(0,l.getRawValue)(e);let s=n-(0,l.getRawValue)(t);return Math.abs(s)<this.actualEps*Math.abs(n)&&(s=0),this.ExtendedNumberFactory(s,r)},this.divide=(e,t)=>{const r=(0,l.getRawValue)(e),n=(0,l.getRawValue)(t);if(0===n)return new o.CellError(o.ErrorType.DIV_BY_ZERO);{const s=M(e,t);return this.ExtendedNumberFactory(r/n,s)}},this.multiply=(e,t)=>{const r=M(e,t);return this.ExtendedNumberFactory((0,l.getRawValue)(e)*(0,l.getRawValue)(t),r)},this.manyToExactComplex=e=>{const t=[];for(const r of e){if(r instanceof o.CellError)return r;if((0,l.isExtendedNumber)(r)||"string"==typeof r){const e=this.coerceScalarToComplex(r);e instanceof o.CellError||t.push(e)}}return t},this.coerceNumbersExactRanges=e=>this.manyToNumbers(e,this.manyToExactNumbers),this.coerceNumbersCoerceRangesDropNulls=e=>this.manyToNumbers(e,this.manyToCoercedNumbersDropNulls),this.manyToExactNumbers=e=>{const t=[];for(const r of e){if(r instanceof o.CellError)return r;(0,l.isExtendedNumber)(r)&&t.push((0,l.getRawValue)(r))}return t},this.manyToOnlyNumbersDropNulls=e=>{const t=[];for(const r of e){if(r instanceof o.CellError)return r;if((0,l.isExtendedNumber)(r))t.push((0,l.getRawValue)(r));else if(r!==l.EmptyValue)return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.NumberExpected)}return t},this.manyToCoercedNumbersDropNulls=e=>{const t=[];for(const r of e){if(r instanceof o.CellError)return r;if(r===l.EmptyValue)continue;const e=this.coerceScalarToNumberOrError(r);(0,l.isExtendedNumber)(e)&&t.push((0,l.getRawValue)(e))}return t},this.collator=(0,a.collatorFromConfig)(e),this.actualEps=e.smartRounding?e.precisionEpsilon:0}eqMatcherFunction(e){const t=this.buildRegex(e);return e=>"string"==typeof e&&t.test(this.normalizeString(e))}neqMatcherFunction(e){const t=this.buildRegex(e);return e=>!("string"==typeof e&&t.test(this.normalizeString(e)))}searchString(e,t){var r;const n=this.buildRegex(e,!1).exec(t);return null!==(r=null==n?void 0:n.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++){const r=e.charAt(t);if(v(r)||this.config.useRegularExpressions&&N(r))return!0}return!1}floatCmp(e,t){const r=(0,l.getRawValue)(e),n=(0,l.getRawValue)(t),s=1+this.actualEps;return n>=0&&r*s>=n&&r<=n*s||n<=0&&r*s<=n&&r>=n*s?0:r>n?1:-1}coerceScalarToNumberOrError(e){var t;return e instanceof o.CellError?e:null!==(t=this.coerceToMaybeNumber(e))&&void 0!==t?t:new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.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===l.EmptyValue)return 0;if("string"==typeof e){if(""===e)return 0;const t=this.coerceStringToMaybePercentNumber(e);if(void 0!==t)return t;const r=this.coerceStringToMaybeCurrencyNumber(e);return void 0!==r?r:this.numberLiteralsHelper.numericStringToMaybeNumber(e.trim())}return(0,l.isExtendedNumber)(e)?e:"boolean"==typeof e?Number(e):void 0}coerceStringToMaybePercentNumber(e){const t=e.trim();if(t.endsWith("%")){const e=t.slice(0,t.length-1).trim(),r=this.numberLiteralsHelper.numericStringToMaybeNumber(e);if(void 0!==r)return new l.PercentNumber(r/100)}}coerceStringToMaybeCurrencyNumber(e){const t=this.currencyMatcher(e.trim());if(void 0!==t){const[e,r]=t,n=this.numberLiteralsHelper.numericStringToMaybeNumber(r);if(void 0!==n)return new l.CurrencyNumber(n,e)}}currencyMatcher(e){for(const 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){const t=[];for(const r of e)if(r instanceof u.SimpleRangeValue)t.push(r);else if(r!==l.EmptyValue){const e=this.coerceScalarToComplex(r);if(e instanceof o.CellError)return e;t.push(e)}const r=[];for(const e of t)if(e instanceof u.SimpleRangeValue){const t=this.manyToExactComplex(e.valuesFromTopLeftCorner());if(t instanceof o.CellError)return t;r.push(...t)}else r.push(e);return r}coerceScalarToComplex(e){return e instanceof o.CellError?e:e===l.EmptyValue?[0,0]:(0,l.isExtendedNumber)(e)?[(0,l.getRawValue)(e),0]:"string"==typeof e?this.coerceStringToComplex(e):new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ComplexNumberExpected)}ExtendedNumberFactory(e,t){const{type:r,format:n}=t;switch(r){case l.NumberType.NUMBER_RAW:return e;case l.NumberType.NUMBER_CURRENCY:return new l.CurrencyNumber(e,null!=n?n:this.config.currencySymbol[0]);case l.NumberType.NUMBER_DATE:return new l.DateNumber(e,n);case l.NumberType.NUMBER_DATETIME:return new l.DateTimeNumber(e,n);case l.NumberType.NUMBER_TIME:return new l.TimeNumber(e,n);case l.NumberType.NUMBER_PERCENT:return new l.PercentNumber(e,n)}}buildRegex(e,t=!0){let r;e=this.normalizeString(e);let n=this.config.useWildcards,s=this.config.useRegularExpressions;if(s)try{RegExp(e)}catch(e){s=!1,n=!1}return r=s?function(e,t){let r="";for(let n=0;n<e.length;n++){const s=e.charAt(n);v(s)||N(s)?r+=s:r+=t?s:s.toLowerCase()}return r}(e,this.config.caseSensitive):n?function(e,t){let r="";for(let n=0;n<e.length;n++){const s=e.charAt(n);if("~"===s){if(n==e.length-1){r+="~";continue}const t=e.charAt(n+1);v(t)||N(t)?(r+="\\"+t,n++):(r+=t,n++)}else v(s)?r+="."+s:N(s)?r+="\\"+s:r+=t?s:s.toLowerCase()}return r}(e,this.config.caseSensitive):function(e,t){let r="";for(let n=0;n<e.length;n++){const s=e.charAt(n);v(s)||N(s)?r+="\\"+s:r+=t?s:s.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=_(e,"nfd").replace(/[\u0300-\u036f]/g,"")),e}compare(e,t){if("string"==typeof e||"string"==typeof t){const r="string"==typeof e?this.dateTimeHelper.dateStringToDateNumber(e):e,n="string"==typeof t?this.dateTimeHelper.dateStringToDateNumber(t):t;if((0,l.isExtendedNumber)(r)&&(0,l.isExtendedNumber)(n))return this.floatCmp(r,n)}return e===l.EmptyValue?e=y(t):t===l.EmptyValue&&(t=y(e)),"string"==typeof e&&"string"==typeof t?this.stringCmp(e,t):"boolean"==typeof e&&"boolean"==typeof t?R(f(e),f(t)):(0,l.isExtendedNumber)(e)&&(0,l.isExtendedNumber)(t)?this.floatCmp(e,t):e===l.EmptyValue&&t===l.EmptyValue?0:R((0,o.CellValueTypeOrd)((0,o.getCellValueType)(e)),(0,o.CellValueTypeOrd)((0,o.getCellValueType)(t)))}stringCmp(e,t){return this.collator.compare(e,t)}manyToNumbers(e,t){const r=[];for(const t of e)if(t instanceof u.SimpleRangeValue)r.push(t);else{const e=(0,l.getRawValue)(this.coerceScalarToNumberOrError(t));if(e instanceof o.CellError)return e;r.push(e)}const n=[];for(const e of r)if(e instanceof u.SimpleRangeValue){const r=t(e.valuesFromTopLeftCorner());if(r instanceof o.CellError)return r;n.push(...r)}else n.push(e);return n}coerceStringToComplex(e){const t=c.exec(e);if(null===t)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ComplexNumberExpected);let r,n;return r=void 0!==t[6]?"-"===t[1]?[0,-1]:[0,1]:this.parseComplexToken(t[1]+t[3],t[5]),r instanceof o.CellError||void 0===t[8]?r:(n=void 0!==t[14]?"-"===t[9]?[0,-1]:[0,1]:this.parseComplexToken(t[9]+t[11],t[13]),n instanceof o.CellError?n:""!==t[5]||""===t[13]?new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ComplexNumberExpected):"+"===t[8]?[r[0]+n[0],r[1]+n[1]]:[r[0]-n[0],r[1]-n[1]])}parseComplexToken(e,t){const r=(0,l.getRawValue)(this.coerceNonDateScalarToMaybeNumber(e));return void 0===r?new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ComplexNumberExpected):""===t?[r,0]:[0,r]}}function p([e,t],r){if(!isFinite(e)||!isFinite(t))return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.NaN);if(r=null!=r?r:h,0===t)return`${e}`;const n=`${-1===t||1===t?"":Math.abs(t)}${r}`;return 0===e?`${t<0?"-":""}${n}`:`${e}${t<0?"-":"+"}${n}`}function g(e){return e instanceof u.SimpleRangeValue?e:u.SimpleRangeValue.fromScalar(e)}function m(e){return e instanceof u.SimpleRangeValue&&e.hasOnlyNumbers()||e instanceof o.CellError?e:(0,l.isExtendedNumber)(e)?u.SimpleRangeValue.fromScalar(e):null}function f(e){return Number(e)}function y(e){return"string"==typeof e?"":(0,l.isExtendedNumber)(e)?0:"boolean"!=typeof e&&l.EmptyValue}function E(e){if(e instanceof o.CellError||"boolean"==typeof e)return e;if(e===l.EmptyValue)return!1;if((0,l.isExtendedNumber)(e))return 0!==(0,l.getRawValue)(e);{const t=e.toUpperCase();return"TRUE"===t||"FALSE"!==t&&(""!==t&&void 0)}}function C(e){return e instanceof o.CellError||"string"==typeof e?e:e===l.EmptyValue?"":(0,l.isExtendedNumber)(e)?(0,l.getRawValue)(e).toString():e?"TRUE":"FALSE"}function T(e){return e===l.EmptyValue?0:e}function R(e,t){const r=(0,l.getRawValue)(e),n=(0,l.getRawValue)(t);return r>n?1:r<n?-1:0}function w(e){return isNaN(e)||e===1/0||e===-1/0}function S(e){return 0===e?0:e}function v(e){return["*","?"].includes(e)}const A=["{","}","[","]","(",")","<",">","=",".","+","-",",","\\","$","^","!"];function N(e){return A.includes(e)}function O(e,t){const{type:r,format:n}=(0,l.getTypeFormatOfExtendedNumber)(e),{type:s,format:o}=(0,l.getTypeFormatOfExtendedNumber)(t);if(r===l.NumberType.NUMBER_RAW)return{type:s,format:o};if(s===l.NumberType.NUMBER_RAW)return{type:r,format:n};if(!(r!==l.NumberType.NUMBER_DATETIME&&r!==l.NumberType.NUMBER_DATE||s!==l.NumberType.NUMBER_DATETIME&&s!==l.NumberType.NUMBER_DATE))return{type:l.NumberType.NUMBER_RAW};if(r===l.NumberType.NUMBER_TIME){if(s===l.NumberType.NUMBER_DATE)return{type:l.NumberType.NUMBER_DATETIME,format:`${o} ${n}`};if(s===l.NumberType.NUMBER_DATETIME)return{type:l.NumberType.NUMBER_DATETIME,format:o}}if(s===l.NumberType.NUMBER_TIME){if(r===l.NumberType.NUMBER_DATE)return{type:l.NumberType.NUMBER_DATETIME,format:`${n} ${o}`};if(r===l.NumberType.NUMBER_DATETIME)return{type:l.NumberType.NUMBER_DATETIME,format:n}}return{type:r,format:n}}function M(e,t){let{type:r,format:n}=(0,l.getTypeFormatOfExtendedNumber)(e),{type:s,format:o}=(0,l.getTypeFormatOfExtendedNumber)(t);return r===l.NumberType.NUMBER_PERCENT&&(r=l.NumberType.NUMBER_RAW,n=void 0),s===l.NumberType.NUMBER_PERCENT&&(s=l.NumberType.NUMBER_RAW,o=void 0),r===l.NumberType.NUMBER_RAW?{type:s,format:o}:s===l.NumberType.NUMBER_RAW?{type:r,format:n}:{type:l.NumberType.NUMBER_RAW}}function b(e){return _(e.toLowerCase(),"nfd").replace(/[\u0300-\u036f]/g,"")}function I(e,t){var r;if(e.isAdHoc())return null===(r=e.data[0])||void 0===r?void 0:r[0];const n=e.range;if(t.formulaAddress.sheet===n.sheet)if(1===n.width()){const r=t.formulaAddress.row-n.start.row;if(r>=0&&r<n.height())return e.data[r][0]}else if(1===n.height()){const r=t.formulaAddress.col-n.start.col;if(r>=0&&r<n.width())return e.data[0][r]}}function _(e,t){return"function"==typeof e.normalize?e.normalize(t.toUpperCase()):s()[t](e)}},function(e){!function(t){"use strict";for(var r=[null,0,{}],n=44032,s=4352,o=function(e,t){this.codepoint=e,this.feature=t},i={},a=[],l=0;l<=255;++l)a[l]=0;var u=[function(e,t,n){return t<60||13311<t&&t<42607?new o(t,r):e(t,n)},function(e,t,r){var n=i[t];return n||(n=e(t,r)).feature&&++a[t>>8&255]>10&&(i[t]=n),n},function(e,t,r){return r?e(t,r):new o(t,null)},function(e,t,r){var i;if(t<s||4371<=t&&t<n||55204<t)return e(t,r);if(s<=t&&t<4371){var a={},l=21*(t-s);for(i=0;i<21;++i)a[4449+i]=n+28*(i+l);return new o(t,[,,a])}var u=t-n,h=u%28,c=[];if(0!==h)c[0]=[n+u-h,4519+h];else for(c[0]=[s+Math.floor(u/588),4449+Math.floor(u%588/28)],c[2]={},i=1;i<28;++i)c[2][4519+i]=t+i;return new o(t,c)},function(e,t,n){var s=(o.udata[65280&t]||{})[t];return new o(t,s||r)}];o.fromCharCode=u.reduceRight((function(e,t){return function(r,n){return t(e,r,n)}}),null),o.isHighSurrogate=function(e){return e>=55296&&e<=56319},o.isLowSurrogate=function(e){return e>=56320&&e<=57343},o.prototype.prepFeature=function(){this.feature||(this.feature=o.fromCharCode(this.codepoint,!0).feature)},o.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var e=this.codepoint-65536;return String.fromCharCode(Math.floor(e/1024)+55296,e%1024+56320)},o.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},o.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},o.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},o.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},o.prototype.getComposite=function(e){if(this.prepFeature(),!this.feature[2])return null;var t=this.feature[2][e.codepoint];return t?o.fromCharCode(t):null};var h=function(e){this.str=e,this.cursor=0};h.prototype.next=function(){if(this.str&&this.cursor<this.str.length){var e,t=this.str.charCodeAt(this.cursor++);return o.isHighSurrogate(t)&&this.cursor<this.str.length&&o.isLowSurrogate(e=this.str.charCodeAt(this.cursor))&&(t=1024*(t-55296)+(e-56320)+65536,++this.cursor),o.fromCharCode(t)}return this.str=null,null};var c=function(e,t){this.it=e,this.canonical=t,this.resBuf=[]};c.prototype.next=function(){if(0===this.resBuf.length){var e=this.it.next();if(!e)return null;this.resBuf=function e(t,r){var n=r.getDecomp();if(!n||t&&r.isCompatibility())return[r];for(var s=[],i=0;i<n.length;++i){var a=e(t,o.fromCharCode(n[i]));s=s.concat(a)}return s}(this.canonical,e)}return this.resBuf.shift()};var d=function(e){this.it=e,this.resBuf=[]};d.prototype.next=function(){var e;if(0===this.resBuf.length)do{var t=this.it.next();if(!t)break;e=t.getCanonicalClass();var r=this.resBuf.length;if(0!==e)for(;r>0;--r){if(this.resBuf[r-1].getCanonicalClass()<=e)break}this.resBuf.splice(r,0,t)}while(0!==e);return this.resBuf.shift()};var p=function(e){this.it=e,this.procBuf=[],this.resBuf=[],this.lastClass=null};p.prototype.next=function(){for(;0===this.resBuf.length;){var e=this.it.next();if(!e){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=e.getCanonicalClass(),this.procBuf.push(e);else{var t=this.procBuf[0].getComposite(e),r=e.getCanonicalClass();t&&(this.lastClass<r||0===this.lastClass)?this.procBuf[0]=t:(0===r&&(this.resBuf=this.procBuf,this.procBuf=[]),this.lastClass=r,this.procBuf.push(e))}}return this.resBuf.shift()};var g=function(e,t){for(var r,n=function(e,t){switch(e){case"NFD":return new d(new c(new h(t),!0));case"NFKD":return new d(new c(new h(t),!1));case"NFC":return new p(new d(new c(new h(t),!0)));case"NFKC":return new p(new d(new c(new h(t),!1)))}throw e+" is invalid"}(e,t),s="";r=n.next();)s+=r.toString();return s};o.udata={0:{60:[,,{824:8814}],61:[,,{824:8800}],62:[,,{824:8815}],65:[,,{768:192,769:193,770:194,771:195,772:256,774:258,775:550,776:196,777:7842,778:197,780:461,783:512,785:514,803:7840,805:7680,808:260}],66:[,,{775:7682,803:7684,817:7686}],67:[,,{769:262,770:264,775:266,780:268,807:199}],68:[,,{775:7690,780:270,803:7692,807:7696,813:7698,817:7694}],69:[,,{768:200,769:201,770:202,771:7868,772:274,774:276,775:278,776:203,777:7866,780:282,783:516,785:518,803:7864,807:552,808:280,813:7704,816:7706}],70:[,,{775:7710}],71:[,,{769:500,770:284,772:7712,774:286,775:288,780:486,807:290}],72:[,,{770:292,775:7714,776:7718,780:542,803:7716,807:7720,814:7722}],73:[,,{768:204,769:205,770:206,771:296,772:298,774:300,775:304,776:207,777:7880,780:463,783:520,785:522,803:7882,808:302,816:7724}],74:[,,{770:308}],75:[,,{769:7728,780:488,803:7730,807:310,817:7732}],76:[,,{769:313,780:317,803:7734,807:315,813:7740,817:7738}],77:[,,{769:7742,775:7744,803:7746}],78:[,,{768:504,769:323,771:209,775:7748,780:327,803:7750,807:325,813:7754,817:7752}],79:[,,{768:210,769:211,770:212,771:213,772:332,774:334,775:558,776:214,777:7886,779:336,780:465,783:524,785:526,795:416,803:7884,808:490}],80:[,,{769:7764,775:7766}],82:[,,{769:340,775:7768,780:344,783:528,785:530,803:7770,807:342,817:7774}],83:[,,{769:346,770:348,775:7776,780:352,803:7778,806:536,807:350}],84:[,,{775:7786,780:356,803:7788,806:538,807:354,813:7792,817:7790}],85:[,,{768:217,769:218,770:219,771:360,772:362,774:364,776:220,777:7910,778:366,779:368,780:467,783:532,785:534,795:431,803:7908,804:7794,808:370,813:7798,816:7796}],86:[,,{771:7804,803:7806}],87:[,,{768:7808,769:7810,770:372,775:7814,776:7812,803:7816}],88:[,,{775:7818,776:7820}],89:[,,{768:7922,769:221,770:374,771:7928,772:562,775:7822,776:376,777:7926,803:7924}],90:[,,{769:377,770:7824,775:379,780:381,803:7826,817:7828}],97:[,,{768:224,769:225,770:226,771:227,772:257,774:259,775:551,776:228,777:7843,778:229,780:462,783:513,785:515,803:7841,805:7681,808:261}],98:[,,{775:7683,803:7685,817:7687}],99:[,,{769:263,770:265,775:267,780:269,807:231}],100:[,,{775:7691,780:271,803:7693,807:7697,813:7699,817:7695}],101:[,,{768:232,769:233,770:234,771:7869,772:275,774:277,775:279,776:235,777:7867,780:283,783:517,785:519,803:7865,807:553,808:281,813:7705,816:7707}],102:[,,{775:7711}],103:[,,{769:501,770:285,772:7713,774:287,775:289,780:487,807:291}],104:[,,{770:293,775:7715,776:7719,780:543,803:7717,807:7721,814:7723,817:7830}],105:[,,{768:236,769:237,770:238,771:297,772:299,774:301,776:239,777:7881,780:464,783:521,785:523,803:7883,808:303,816:7725}],106:[,,{770:309,780:496}],107:[,,{769:7729,780:489,803:7731,807:311,817:7733}],108:[,,{769:314,780:318,803:7735,807:316,813:7741,817:7739}],109:[,,{769:7743,775:7745,803:7747}],110:[,,{768:505,769:324,771:241,775:7749,780:328,803:7751,807:326,813:7755,817:7753}],111:[,,{768:242,769:243,770:244,771:245,772:333,774:335,775:559,776:246,777:7887,779:337,780:466,783:525,785:527,795:417,803:7885,808:491}],112:[,,{769:7765,775:7767}],114:[,,{769:341,775:7769,780:345,783:529,785:531,803:7771,807:343,817:7775}],115:[,,{769:347,770:349,775:7777,780:353,803:7779,806:537,807:351}],116:[,,{775:7787,776:7831,780:357,803:7789,806:539,807:355,813:7793,817:7791}],117:[,,{768:249,769:250,770:251,771:361,772:363,774:365,776:252,777:7911,778:367,779:369,780:468,783:533,785:535,795:432,803:7909,804:7795,808:371,813:7799,816:7797}],118:[,,{771:7805,803:7807}],119:[,,{768:7809,769:7811,770:373,775:7815,776:7813,778:7832,803:7817}],120:[,,{775:7819,776:7821}],121:[,,{768:7923,769:253,770:375,771:7929,772:563,775:7823,776:255,777:7927,778:7833,803:7925}],122:[,,{769:378,770:7825,775:380,780:382,803:7827,817:7829}],160:[[32],256],168:[[32,776],256,{768:8173,769:901,834:8129}],170:[[97],256],175:[[32,772],256],178:[[50],256],179:[[51],256],180:[[32,769],256],181:[[956],256],184:[[32,807],256],185:[[49],256],186:[[111],256],188:[[49,8260,52],256],189:[[49,8260,50],256],190:[[51,8260,52],256],192:[[65,768]],193:[[65,769]],194:[[65,770],,{768:7846,769:7844,771:7850,777:7848}],195:[[65,771]],196:[[65,776],,{772:478}],197:[[65,778],,{769:506}],198:[,,{769:508,772:482}],199:[[67,807],,{769:7688}],200:[[69,768]],201:[[69,769]],202:[[69,770],,{768:7872,769:7870,771:7876,777:7874}],203:[[69,776]],204:[[73,768]],205:[[73,769]],206:[[73,770]],207:[[73,776],,{769:7726}],209:[[78,771]],210:[[79,768]],211:[[79,769]],212:[[79,770],,{768:7890,769:7888,771:7894,777:7892}],213:[[79,771],,{769:7756,772:556,776:7758}],214:[[79,776],,{772:554}],216:[,,{769:510}],217:[[85,768]],218:[[85,769]],219:[[85,770]],220:[[85,776],,{768:475,769:471,772:469,780:473}],221:[[89,769]],224:[[97,768]],225:[[97,769]],226:[[97,770],,{768:7847,769:7845,771:7851,777:7849}],227:[[97,771]],228:[[97,776],,{772:479}],229:[[97,778],,{769:507}],230:[,,{769:509,772:483}],231:[[99,807],,{769:7689}],232:[[101,768]],233:[[101,769]],234:[[101,770],,{768:7873,769:7871,771:7877,777:7875}],235:[[101,776]],236:[[105,768]],237:[[105,769]],238:[[105,770]],239:[[105,776],,{769:7727}],241:[[110,771]],242:[[111,768]],243:[[111,769]],244:[[111,770],,{768:7891,769:7889,771:7895,777:7893}],245:[[111,771],,{769:7757,772:557,776:7759}],246:[[111,776],,{772:555}],248:[,,{769:511}],249:[[117,768]],250:[[117,769]],251:[[117,770]],252:[[117,776],,{768:476,769:472,772:470,780:474}],253:[[121,769]],255:[[121,776]]},256:{256:[[65,772]],257:[[97,772]],258:[[65,774],,{768:7856,769:7854,771:7860,777:7858}],259:[[97,774],,{768:7857,769:7855,771:7861,777:7859}],260:[[65,808]],261:[[97,808]],262:[[67,769]],263:[[99,769]],264:[[67,770]],265:[[99,770]],266:[[67,775]],267:[[99,775]],268:[[67,780]],269:[[99,780]],270:[[68,780]],271:[[100,780]],274:[[69,772],,{768:7700,769:7702}],275:[[101,772],,{768:7701,769:7703}],276:[[69,774]],277:[[101,774]],278:[[69,775]],279:[[101,775]],280:[[69,808]],281:[[101,808]],282:[[69,780]],283:[[101,780]],284:[[71,770]],285:[[103,770]],286:[[71,774]],287:[[103,774]],288:[[71,775]],289:[[103,775]],290:[[71,807]],291:[[103,807]],292:[[72,770]],293:[[104,770]],296:[[73,771]],297:[[105,771]],298:[[73,772]],299:[[105,772]],300:[[73,774]],301:[[105,774]],302:[[73,808]],303:[[105,808]],304:[[73,775]],306:[[73,74],256],307:[[105,106],256],308:[[74,770]],309:[[106,770]],310:[[75,807]],311:[[107,807]],313:[[76,769]],314:[[108,769]],315:[[76,807]],316:[[108,807]],317:[[76,780]],318:[[108,780]],319:[[76,183],256],320:[[108,183],256],323:[[78,769]],324:[[110,769]],325:[[78,807]],326:[[110,807]],327:[[78,780]],328:[[110,780]],329:[[700,110],256],332:[[79,772],,{768:7760,769:7762}],333:[[111,772],,{768:7761,769:7763}],334:[[79,774]],335:[[111,774]],336:[[79,779]],337:[[111,779]],340:[[82,769]],341:[[114,769]],342:[[82,807]],343:[[114,807]],344:[[82,780]],345:[[114,780]],346:[[83,769],,{775:7780}],347:[[115,769],,{775:7781}],348:[[83,770]],349:[[115,770]],350:[[83,807]],351:[[115,807]],352:[[83,780],,{775:7782}],353:[[115,780],,{775:7783}],354:[[84,807]],355:[[116,807]],356:[[84,780]],357:[[116,780]],360:[[85,771],,{769:7800}],361:[[117,771],,{769:7801}],362:[[85,772],,{776:7802}],363:[[117,772],,{776:7803}],364:[[85,774]],365:[[117,774]],366:[[85,778]],367:[[117,778]],368:[[85,779]],369:[[117,779]],370:[[85,808]],371:[[117,808]],372:[[87,770]],373:[[119,770]],374:[[89,770]],375:[[121,770]],376:[[89,776]],377:[[90,769]],378:[[122,769]],379:[[90,775]],380:[[122,775]],381:[[90,780]],382:[[122,780]],383:[[115],256,{775:7835}],416:[[79,795],,{768:7900,769:7898,771:7904,777:7902,803:7906}],417:[[111,795],,{768:7901,769:7899,771:7905,777:7903,803:7907}],431:[[85,795],,{768:7914,769:7912,771:7918,777:7916,803:7920}],432:[[117,795],,{768:7915,769:7913,771:7919,777:7917,803:7921}],439:[,,{780:494}],452:[[68,381],256],453:[[68,382],256],454:[[100,382],256],455:[[76,74],256],456:[[76,106],256],457:[[108,106],256],458:[[78,74],256],459:[[78,106],256],460:[[110,106],256],461:[[65,780]],462:[[97,780]],463:[[73,780]],464:[[105,780]],465:[[79,780]],466:[[111,780]],467:[[85,780]],468:[[117,780]],469:[[220,772]],470:[[252,772]],471:[[220,769]],472:[[252,769]],473:[[220,780]],474:[[252,780]],475:[[220,768]],476:[[252,768]],478:[[196,772]],479:[[228,772]],480:[[550,772]],481:[[551,772]],482:[[198,772]],483:[[230,772]],486:[[71,780]],487:[[103,780]],488:[[75,780]],489:[[107,780]],490:[[79,808],,{772:492}],491:[[111,808],,{772:493}],492:[[490,772]],493:[[491,772]],494:[[439,780]],495:[[658,780]],496:[[106,780]],497:[[68,90],256],498:[[68,122],256],499:[[100,122],256],500:[[71,769]],501:[[103,769]],504:[[78,768]],505:[[110,768]],506:[[197,769]],507:[[229,769]],508:[[198,769]],509:[[230,769]],510:[[216,769]],511:[[248,769]],66045:[,220]},512:{512:[[65,783]],513:[[97,783]],514:[[65,785]],515:[[97,785]],516:[[69,783]],517:[[101,783]],518:[[69,785]],519:[[101,785]],520:[[73,783]],521:[[105,783]],522:[[73,785]],523:[[105,785]],524:[[79,783]],525:[[111,783]],526:[[79,785]],527:[[111,785]],528:[[82,783]],529:[[114,783]],530:[[82,785]],531:[[114,785]],532:[[85,783]],533:[[117,783]],534:[[85,785]],535:[[117,785]],536:[[83,806]],537:[[115,806]],538:[[84,806]],539:[[116,806]],542:[[72,780]],543:[[104,780]],550:[[65,775],,{772:480}],551:[[97,775],,{772:481}],552:[[69,807],,{774:7708}],553:[[101,807],,{774:7709}],554:[[214,772]],555:[[246,772]],556:[[213,772]],557:[[245,772]],558:[[79,775],,{772:560}],559:[[111,775],,{772:561}],560:[[558,772]],561:[[559,772]],562:[[89,772]],563:[[121,772]],658:[,,{780:495}],688:[[104],256],689:[[614],256],690:[[106],256],691:[[114],256],692:[[633],256],693:[[635],256],694:[[641],256],695:[[119],256],696:[[121],256],728:[[32,774],256],729:[[32,775],256],730:[[32,778],256],731:[[32,808],256],732:[[32,771],256],733:[[32,779],256],736:[[611],256],737:[[108],256],738:[[115],256],739:[[120],256],740:[[661],256],66272:[,220]},768:{768:[,230],769:[,230],770:[,230],771:[,230],772:[,230],773:[,230],774:[,230],775:[,230],776:[,230,{769:836}],777:[,230],778:[,230],779:[,230],780:[,230],781:[,230],782:[,230],783:[,230],784:[,230],785:[,230],786:[,230],787:[,230],788:[,230],789:[,232],790:[,220],791:[,220],792:[,220],793:[,220],794:[,232],795:[,216],796:[,220],797:[,220],798:[,220],799:[,220],800:[,220],801:[,202],802:[,202],803:[,220],804:[,220],805:[,220],806:[,220],807:[,202],808:[,202],809:[,220],810:[,220],811:[,220],812:[,220],813:[,220],814:[,220],815:[,220],816:[,220],817:[,220],818:[,220],819:[,220],820:[,1],821:[,1],822:[,1],823:[,1],824:[,1],825:[,220],826:[,220],827:[,220],828:[,220],829:[,230],830:[,230],831:[,230],832:[[768],230],833:[[769],230],834:[,230],835:[[787],230],836:[[776,769],230],837:[,240],838:[,230],839:[,220],840:[,220],841:[,220],842:[,230],843:[,230],844:[,230],845:[,220],846:[,220],848:[,230],849:[,230],850:[,230],851:[,220],852:[,220],853:[,220],854:[,220],855:[,230],856:[,232],857:[,220],858:[,220],859:[,230],860:[,233],861:[,234],862:[,234],863:[,233],864:[,234],865:[,234],866:[,233],867:[,230],868:[,230],869:[,230],870:[,230],871:[,230],872:[,230],873:[,230],874:[,230],875:[,230],876:[,230],877:[,230],878:[,230],879:[,230],884:[[697]],890:[[32,837],256],894:[[59]],900:[[32,769],256],901:[[168,769]],902:[[913,769]],903:[[183]],904:[[917,769]],905:[[919,769]],906:[[921,769]],908:[[927,769]],910:[[933,769]],911:[[937,769]],912:[[970,769]],913:[,,{768:8122,769:902,772:8121,774:8120,787:7944,788:7945,837:8124}],917:[,,{768:8136,769:904,787:7960,788:7961}],919:[,,{768:8138,769:905,787:7976,788:7977,837:8140}],921:[,,{768:8154,769:906,772:8153,774:8152,776:938,787:7992,788:7993}],927:[,,{768:8184,769:908,787:8008,788:8009}],929:[,,{788:8172}],933:[,,{768:8170,769:910,772:8169,774:8168,776:939,788:8025}],937:[,,{768:8186,769:911,787:8040,788:8041,837:8188}],938:[[921,776]],939:[[933,776]],940:[[945,769],,{837:8116}],941:[[949,769]],942:[[951,769],,{837:8132}],943:[[953,769]],944:[[971,769]],945:[,,{768:8048,769:940,772:8113,774:8112,787:7936,788:7937,834:8118,837:8115}],949:[,,{768:8050,769:941,787:7952,788:7953}],951:[,,{768:8052,769:942,787:7968,788:7969,834:8134,837:8131}],953:[,,{768:8054,769:943,772:8145,774:8144,776:970,787:7984,788:7985,834:8150}],959:[,,{768:8056,769:972,787:8e3,788:8001}],961:[,,{787:8164,788:8165}],965:[,,{768:8058,769:973,772:8161,774:8160,776:971,787:8016,788:8017,834:8166}],969:[,,{768:8060,769:974,787:8032,788:8033,834:8182,837:8179}],970:[[953,776],,{768:8146,769:912,834:8151}],971:[[965,776],,{768:8162,769:944,834:8167}],972:[[959,769]],973:[[965,769]],974:[[969,769],,{837:8180}],976:[[946],256],977:[[952],256],978:[[933],256,{769:979,776:980}],979:[[978,769]],980:[[978,776]],981:[[966],256],982:[[960],256],1008:[[954],256],1009:[[961],256],1010:[[962],256],1012:[[920],256],1013:[[949],256],1017:[[931],256],66422:[,230],66423:[,230],66424:[,230],66425:[,230],66426:[,230]},1024:{1024:[[1045,768]],1025:[[1045,776]],1027:[[1043,769]],1030:[,,{776:1031}],1031:[[1030,776]],1036:[[1050,769]],1037:[[1048,768]],1038:[[1059,774]],1040:[,,{774:1232,776:1234}],1043:[,,{769:1027}],1045:[,,{768:1024,774:1238,776:1025}],1046:[,,{774:1217,776:1244}],1047:[,,{776:1246}],1048:[,,{768:1037,772:1250,774:1049,776:1252}],1049:[[1048,774]],1050:[,,{769:1036}],1054:[,,{776:1254}],1059:[,,{772:1262,774:1038,776:1264,779:1266}],1063:[,,{776:1268}],1067:[,,{776:1272}],1069:[,,{776:1260}],1072:[,,{774:1233,776:1235}],1075:[,,{769:1107}],1077:[,,{768:1104,774:1239,776:1105}],1078:[,,{774:1218,776:1245}],1079:[,,{776:1247}],1080:[,,{768:1117,772:1251,774:1081,776:1253}],1081:[[1080,774]],1082:[,,{769:1116}],1086:[,,{776:1255}],1091:[,,{772:1263,774:1118,776:1265,779:1267}],1095:[,,{776:1269}],1099:[,,{776:1273}],1101:[,,{776:1261}],1104:[[1077,768]],1105:[[1077,776]],1107:[[1075,769]],1110:[,,{776:1111}],1111:[[1110,776]],1116:[[1082,769]],1117:[[1080,768]],1118:[[1091,774]],1140:[,,{783:1142}],1141:[,,{783:1143}],1142:[[1140,783]],1143:[[1141,783]],1155:[,230],1156:[,230],1157:[,230],1158:[,230],1159:[,230],1217:[[1046,774]],1218:[[1078,774]],1232:[[1040,774]],1233:[[1072,774]],1234:[[1040,776]],1235:[[1072,776]],1238:[[1045,774]],1239:[[1077,774]],1240:[,,{776:1242}],1241:[,,{776:1243}],1242:[[1240,776]],1243:[[1241,776]],1244:[[1046,776]],1245:[[1078,776]],1246:[[1047,776]],1247:[[1079,776]],1250:[[1048,772]],1251:[[1080,772]],1252:[[1048,776]],1253:[[1080,776]],1254:[[1054,776]],1255:[[1086,776]],1256:[,,{776:1258}],1257:[,,{776:1259}],1258:[[1256,776]],1259:[[1257,776]],1260:[[1069,776]],1261:[[1101,776]],1262:[[1059,772]],1263:[[1091,772]],1264:[[1059,776]],1265:[[1091,776]],1266:[[1059,779]],1267:[[1091,779]],1268:[[1063,776]],1269:[[1095,776]],1272:[[1067,776]],1273:[[1099,776]]},1280:{1415:[[1381,1410],256],1425:[,220],1426:[,230],1427:[,230],1428:[,230],1429:[,230],1430:[,220],1431:[,230],1432:[,230],1433:[,230],1434:[,222],1435:[,220],1436:[,230],1437:[,230],1438:[,230],1439:[,230],1440:[,230],1441:[,230],1442:[,220],1443:[,220],1444:[,220],1445:[,220],1446:[,220],1447:[,220],1448:[,230],1449:[,230],1450:[,220],1451:[,230],1452:[,230],1453:[,222],1454:[,228],1455:[,230],1456:[,10],1457:[,11],1458:[,12],1459:[,13],1460:[,14],1461:[,15],1462:[,16],1463:[,17],1464:[,18],1465:[,19],1466:[,19],1467:[,20],1468:[,21],1469:[,22],1471:[,23],1473:[,24],1474:[,25],1476:[,230],1477:[,220],1479:[,18]},1536:{1552:[,230],1553:[,230],1554:[,230],1555:[,230],1556:[,230],1557:[,230],1558:[,230],1559:[,230],1560:[,30],1561:[,31],1562:[,32],1570:[[1575,1619]],1571:[[1575,1620]],1572:[[1608,1620]],1573:[[1575,1621]],1574:[[1610,1620]],1575:[,,{1619:1570,1620:1571,1621:1573}],1608:[,,{1620:1572}],1610:[,,{1620:1574}],1611:[,27],1612:[,28],1613:[,29],1614:[,30],1615:[,31],1616:[,32],1617:[,33],1618:[,34],1619:[,230],1620:[,230],1621:[,220],1622:[,220],1623:[,230],1624:[,230],1625:[,230],1626:[,230],1627:[,230],1628:[,220],1629:[,230],1630:[,230],1631:[,220],1648:[,35],1653:[[1575,1652],256],1654:[[1608,1652],256],1655:[[1735,1652],256],1656:[[1610,1652],256],1728:[[1749,1620]],1729:[,,{1620:1730}],1730:[[1729,1620]],1746:[,,{1620:1747}],1747:[[1746,1620]],1749:[,,{1620:1728}],1750:[,230],1751:[,230],1752:[,230],1753:[,230],1754:[,230],1755:[,230],1756:[,230],1759:[,230],1760:[,230],1761:[,230],1762:[,230],1763:[,220],1764:[,230],1767:[,230],1768:[,230],1770:[,220],1771:[,230],1772:[,230],1773:[,220]},1792:{1809:[,36],1840:[,230],1841:[,220],1842:[,230],1843:[,230],1844:[,220],1845:[,230],1846:[,230],1847:[,220],1848:[,220],1849:[,220],1850:[,230],1851:[,220],1852:[,220],1853:[,230],1854:[,220],1855:[,230],1856:[,230],1857:[,230],1858:[,220],1859:[,230],1860:[,220],1861:[,230],1862:[,220],1863:[,230],1864:[,220],1865:[,230],1866:[,230],2027:[,230],2028:[,230],2029:[,230],2030:[,230],2031:[,230],2032:[,230],2033:[,230],2034:[,220],2035:[,230]},2048:{2070:[,230],2071:[,230],2072:[,230],2073:[,230],2075:[,230],2076:[,230],2077:[,230],2078:[,230],2079:[,230],2080:[,230],2081:[,230],2082:[,230],2083:[,230],2085:[,230],2086:[,230],2087:[,230],2089:[,230],2090:[,230],2091:[,230],2092:[,230],2093:[,230],2137:[,220],2138:[,220],2139:[,220],2276:[,230],2277:[,230],2278:[,220],2279:[,230],2280:[,230],2281:[,220],2282:[,230],2283:[,230],2284:[,230],2285:[,220],2286:[,220],2287:[,220],2288:[,27],2289:[,28],2290:[,29],2291:[,230],2292:[,230],2293:[,230],2294:[,220],2295:[,230],2296:[,230],2297:[,220],2298:[,220],2299:[,230],2300:[,230],2301:[,230],2302:[,230],2303:[,230]},2304:{2344:[,,{2364:2345}],2345:[[2344,2364]],2352:[,,{2364:2353}],2353:[[2352,2364]],2355:[,,{2364:2356}],2356:[[2355,2364]],2364:[,7],2381:[,9],2385:[,230],2386:[,220],2387:[,230],2388:[,230],2392:[[2325,2364],512],2393:[[2326,2364],512],2394:[[2327,2364],512],2395:[[2332,2364],512],2396:[[2337,2364],512],2397:[[2338,2364],512],2398:[[2347,2364],512],2399:[[2351,2364],512],2492:[,7],2503:[,,{2494:2507,2519:2508}],2507:[[2503,2494]],2508:[[2503,2519]],2509:[,9],2524:[[2465,2492],512],2525:[[2466,2492],512],2527:[[2479,2492],512]},2560:{2611:[[2610,2620],512],2614:[[2616,2620],512],2620:[,7],2637:[,9],2649:[[2582,2620],512],2650:[[2583,2620],512],2651:[[2588,2620],512],2654:[[2603,2620],512],2748:[,7],2765:[,9],68109:[,220],68111:[,230],68152:[,230],68153:[,1],68154:[,220],68159:[,9],68325:[,230],68326:[,220]},2816:{2876:[,7],2887:[,,{2878:2891,2902:2888,2903:2892}],2888:[[2887,2902]],2891:[[2887,2878]],2892:[[2887,2903]],2893:[,9],2908:[[2849,2876],512],2909:[[2850,2876],512],2962:[,,{3031:2964}],2964:[[2962,3031]],3014:[,,{3006:3018,3031:3020}],3015:[,,{3006:3019}],3018:[[3014,3006]],3019:[[3015,3006]],3020:[[3014,3031]],3021:[,9]},3072:{3142:[,,{3158:3144}],3144:[[3142,3158]],3149:[,9],3157:[,84],3158:[,91],3260:[,7],3263:[,,{3285:3264}],3264:[[3263,3285]],3270:[,,{3266:3274,3285:3271,3286:3272}],3271:[[3270,3285]],3272:[[3270,3286]],3274:[[3270,3266],,{3285:3275}],3275:[[3274,3285]],3277:[,9]},3328:{3398:[,,{3390:3402,3415:3404}],3399:[,,{3390:3403}],3402:[[3398,3390]],3403:[[3399,3390]],3404:[[3398,3415]],3405:[,9],3530:[,9],3545:[,,{3530:3546,3535:3548,3551:3550}],3546:[[3545,3530]],3548:[[3545,3535],,{3530:3549}],3549:[[3548,3530]],3550:[[3545,3551]]},3584:{3635:[[3661,3634],256],3640:[,103],3641:[,103],3642:[,9],3656:[,107],3657:[,107],3658:[,107],3659:[,107],3763:[[3789,3762],256],3768:[,118],3769:[,118],3784:[,122],3785:[,122],3786:[,122],3787:[,122],3804:[[3755,3737],256],3805:[[3755,3745],256]},3840:{3852:[[3851],256],3864:[,220],3865:[,220],3893:[,220],3895:[,220],3897:[,216],3907:[[3906,4023],512],3917:[[3916,4023],512],3922:[[3921,4023],512],3927:[[3926,4023],512],3932:[[3931,4023],512],3945:[[3904,4021],512],3953:[,129],3954:[,130],3955:[[3953,3954],512],3956:[,132],3957:[[3953,3956],512],3958:[[4018,3968],512],3959:[[4018,3969],256],3960:[[4019,3968],512],3961:[[4019,3969],256],3962:[,130],3963:[,130],3964:[,130],3965:[,130],3968:[,130],3969:[[3953,3968],512],3970:[,230],3971:[,230],3972:[,9],3974:[,230],3975:[,230],3987:[[3986,4023],512],3997:[[3996,4023],512],4002:[[4001,4023],512],4007:[[4006,4023],512],4012:[[4011,4023],512],4025:[[3984,4021],512],4038:[,220]},4096:{4133:[,,{4142:4134}],4134:[[4133,4142]],4151:[,7],4153:[,9],4154:[,9],4237:[,220],4348:[[4316],256],69702:[,9],69759:[,9],69785:[,,{69818:69786}],69786:[[69785,69818]],69787:[,,{69818:69788}],69788:[[69787,69818]],69797:[,,{69818:69803}],69803:[[69797,69818]],69817:[,9],69818:[,7]},4352:{69888:[,230],69889:[,230],69890:[,230],69934:[[69937,69927]],69935:[[69938,69927]],69937:[,,{69927:69934}],69938:[,,{69927:69935}],69939:[,9],69940:[,9],70003:[,7],70080:[,9]},4608:{70197:[,9],70198:[,7],70377:[,7],70378:[,9]},4864:{4957:[,230],4958:[,230],4959:[,230],70460:[,7],70471:[,,{70462:70475,70487:70476}],70475:[[70471,70462]],70476:[[70471,70487]],70477:[,9],70502:[,230],70503:[,230],70504:[,230],70505:[,230],70506:[,230],70507:[,230],70508:[,230],70512:[,230],70513:[,230],70514:[,230],70515:[,230],70516:[,230]},5120:{70841:[,,{70832:70844,70842:70843,70845:70846}],70843:[[70841,70842]],70844:[[70841,70832]],70846:[[70841,70845]],70850:[,9],70851:[,7]},5376:{71096:[,,{71087:71098}],71097:[,,{71087:71099}],71098:[[71096,71087]],71099:[[71097,71087]],71103:[,9],71104:[,7]},5632:{71231:[,9],71350:[,9],71351:[,7]},5888:{5908:[,9],5940:[,9],6098:[,9],6109:[,230]},6144:{6313:[,228]},6400:{6457:[,222],6458:[,230],6459:[,220]},6656:{6679:[,230],6680:[,220],6752:[,9],6773:[,230],6774:[,230],6775:[,230],6776:[,230],6777:[,230],6778:[,230],6779:[,230],6780:[,230],6783:[,220],6832:[,230],6833:[,230],6834:[,230],6835:[,230],6836:[,230],6837:[,220],6838:[,220],6839:[,220],6840:[,220],6841:[,220],6842:[,220],6843:[,230],6844:[,230],6845:[,220]},6912:{6917:[,,{6965:6918}],6918:[[6917,6965]],6919:[,,{6965:6920}],6920:[[6919,6965]],6921:[,,{6965:6922}],6922:[[6921,6965]],6923:[,,{6965:6924}],6924:[[6923,6965]],6925:[,,{6965:6926}],6926:[[6925,6965]],6929:[,,{6965:6930}],6930:[[6929,6965]],6964:[,7],6970:[,,{6965:6971}],6971:[[6970,6965]],6972:[,,{6965:6973}],6973:[[6972,6965]],6974:[,,{6965:6976}],6975:[,,{6965:6977}],6976:[[6974,6965]],6977:[[6975,6965]],6978:[,,{6965:6979}],6979:[[6978,6965]],6980:[,9],7019:[,230],7020:[,220],7021:[,230],7022:[,230],7023:[,230],7024:[,230],7025:[,230],7026:[,230],7027:[,230],7082:[,9],7083:[,9],7142:[,7],7154:[,9],7155:[,9]},7168:{7223:[,7],7376:[,230],7377:[,230],7378:[,230],7380:[,1],7381:[,220],7382:[,220],7383:[,220],7384:[,220],7385:[,220],7386:[,230],7387:[,230],7388:[,220],7389:[,220],7390:[,220],7391:[,220],7392:[,230],7394:[,1],7395:[,1],7396:[,1],7397:[,1],7398:[,1],7399:[,1],7400:[,1],7405:[,220],7412:[,230],7416:[,230],7417:[,230]},7424:{7468:[[65],256],7469:[[198],256],7470:[[66],256],7472:[[68],256],7473:[[69],256],7474:[[398],256],7475:[[71],256],7476:[[72],256],7477:[[73],256],7478:[[74],256],7479:[[75],256],7480:[[76],256],7481:[[77],256],7482:[[78],256],7484:[[79],256],7485:[[546],256],7486:[[80],256],7487:[[82],256],7488:[[84],256],7489:[[85],256],7490:[[87],256],7491:[[97],256],7492:[[592],256],7493:[[593],256],7494:[[7426],256],7495:[[98],256],7496:[[100],256],7497:[[101],256],7498:[[601],256],7499:[[603],256],7500:[[604],256],7501:[[103],256],7503:[[107],256],7504:[[109],256],7505:[[331],256],7506:[[111],256],7507:[[596],256],7508:[[7446],256],7509:[[7447],256],7510:[[112],256],7511:[[116],256],7512:[[117],256],7513:[[7453],256],7514:[[623],256],7515:[[118],256],7516:[[7461],256],7517:[[946],256],7518:[[947],256],7519:[[948],256],7520:[[966],256],7521:[[967],256],7522:[[105],256],7523:[[114],256],7524:[[117],256],7525:[[118],256],7526:[[946],256],7527:[[947],256],7528:[[961],256],7529:[[966],256],7530:[[967],256],7544:[[1085],256],7579:[[594],256],7580:[[99],256],7581:[[597],256],7582:[[240],256],7583:[[604],256],7584:[[102],256],7585:[[607],256],7586:[[609],256],7587:[[613],256],7588:[[616],256],7589:[[617],256],7590:[[618],256],7591:[[7547],256],7592:[[669],256],7593:[[621],256],7594:[[7557],256],7595:[[671],256],7596:[[625],256],7597:[[624],256],7598:[[626],256],7599:[[627],256],7600:[[628],256],7601:[[629],256],7602:[[632],256],7603:[[642],256],7604:[[643],256],7605:[[427],256],7606:[[649],256],7607:[[650],256],7608:[[7452],256],7609:[[651],256],7610:[[652],256],7611:[[122],256],7612:[[656],256],7613:[[657],256],7614:[[658],256],7615:[[952],256],7616:[,230],7617:[,230],7618:[,220],7619:[,230],7620:[,230],7621:[,230],7622:[,230],7623:[,230],7624:[,230],7625:[,230],7626:[,220],7627:[,230],7628:[,230],7629:[,234],7630:[,214],7631:[,220],7632:[,202],7633:[,230],7634:[,230],7635:[,230],7636:[,230],7637:[,230],7638:[,230],7639:[,230],7640:[,230],7641:[,230],7642:[,230],7643:[,230],7644:[,230],7645:[,230],7646:[,230],7647:[,230],7648:[,230],7649:[,230],7650:[,230],7651:[,230],7652:[,230],7653:[,230],7654:[,230],7655:[,230],7656:[,230],7657:[,230],7658:[,230],7659:[,230],7660:[,230],7661:[,230],7662:[,230],7663:[,230],7664:[,230],7665:[,230],7666:[,230],7667:[,230],7668:[,230],7669:[,230],7676:[,233],7677:[,220],7678:[,230],7679:[,220]},7680:{7680:[[65,805]],7681:[[97,805]],7682:[[66,775]],7683:[[98,775]],7684:[[66,803]],7685:[[98,803]],7686:[[66,817]],7687:[[98,817]],7688:[[199,769]],7689:[[231,769]],7690:[[68,775]],7691:[[100,775]],7692:[[68,803]],7693:[[100,803]],7694:[[68,817]],7695:[[100,817]],7696:[[68,807]],7697:[[100,807]],7698:[[68,813]],7699:[[100,813]],7700:[[274,768]],7701:[[275,768]],7702:[[274,769]],7703:[[275,769]],7704:[[69,813]],7705:[[101,813]],7706:[[69,816]],7707:[[101,816]],7708:[[552,774]],7709:[[553,774]],7710:[[70,775]],7711:[[102,775]],7712:[[71,772]],7713:[[103,772]],7714:[[72,775]],7715:[[104,775]],7716:[[72,803]],7717:[[104,803]],7718:[[72,776]],7719:[[104,776]],7720:[[72,807]],7721:[[104,807]],7722:[[72,814]],7723:[[104,814]],7724:[[73,816]],7725:[[105,816]],7726:[[207,769]],7727:[[239,769]],7728:[[75,769]],7729:[[107,769]],7730:[[75,803]],7731:[[107,803]],7732:[[75,817]],7733:[[107,817]],7734:[[76,803],,{772:7736}],7735:[[108,803],,{772:7737}],7736:[[7734,772]],7737:[[7735,772]],7738:[[76,817]],7739:[[108,817]],7740:[[76,813]],7741:[[108,813]],7742:[[77,769]],7743:[[109,769]],7744:[[77,775]],7745:[[109,775]],7746:[[77,803]],7747:[[109,803]],7748:[[78,775]],7749:[[110,775]],7750:[[78,803]],7751:[[110,803]],7752:[[78,817]],7753:[[110,817]],7754:[[78,813]],7755:[[110,813]],7756:[[213,769]],7757:[[245,769]],7758:[[213,776]],7759:[[245,776]],7760:[[332,768]],7761:[[333,768]],7762:[[332,769]],7763:[[333,769]],7764:[[80,769]],7765:[[112,769]],7766:[[80,775]],7767:[[112,775]],7768:[[82,775]],7769:[[114,775]],7770:[[82,803],,{772:7772}],7771:[[114,803],,{772:7773}],7772:[[7770,772]],7773:[[7771,772]],7774:[[82,817]],7775:[[114,817]],7776:[[83,775]],7777:[[115,775]],7778:[[83,803],,{775:7784}],7779:[[115,803],,{775:7785}],7780:[[346,775]],7781:[[347,775]],7782:[[352,775]],7783:[[353,775]],7784:[[7778,775]],7785:[[7779,775]],7786:[[84,775]],7787:[[116,775]],7788:[[84,803]],7789:[[116,803]],7790:[[84,817]],7791:[[116,817]],7792:[[84,813]],7793:[[116,813]],7794:[[85,804]],7795:[[117,804]],7796:[[85,816]],7797:[[117,816]],7798:[[85,813]],7799:[[117,813]],7800:[[360,769]],7801:[[361,769]],7802:[[362,776]],7803:[[363,776]],7804:[[86,771]],7805:[[118,771]],7806:[[86,803]],7807:[[118,803]],7808:[[87,768]],7809:[[119,768]],7810:[[87,769]],7811:[[119,769]],7812:[[87,776]],7813:[[119,776]],7814:[[87,775]],7815:[[119,775]],7816:[[87,803]],7817:[[119,803]],7818:[[88,775]],7819:[[120,775]],7820:[[88,776]],7821:[[120,776]],7822:[[89,775]],7823:[[121,775]],7824:[[90,770]],7825:[[122,770]],7826:[[90,803]],7827:[[122,803]],7828:[[90,817]],7829:[[122,817]],7830:[[104,817]],7831:[[116,776]],7832:[[119,778]],7833:[[121,778]],7834:[[97,702],256],7835:[[383,775]],7840:[[65,803],,{770:7852,774:7862}],7841:[[97,803],,{770:7853,774:7863}],7842:[[65,777]],7843:[[97,777]],7844:[[194,769]],7845:[[226,769]],7846:[[194,768]],7847:[[226,768]],7848:[[194,777]],7849:[[226,777]],7850:[[194,771]],7851:[[226,771]],7852:[[7840,770]],7853:[[7841,770]],7854:[[258,769]],7855:[[259,769]],7856:[[258,768]],7857:[[259,768]],7858:[[258,777]],7859:[[259,777]],7860:[[258,771]],7861:[[259,771]],7862:[[7840,774]],7863:[[7841,774]],7864:[[69,803],,{770:7878}],7865:[[101,803],,{770:7879}],7866:[[69,777]],7867:[[101,777]],7868:[[69,771]],7869:[[101,771]],7870:[[202,769]],7871:[[234,769]],7872:[[202,768]],7873:[[234,768]],7874:[[202,777]],7875:[[234,777]],7876:[[202,771]],7877:[[234,771]],7878:[[7864,770]],7879:[[7865,770]],7880:[[73,777]],7881:[[105,777]],7882:[[73,803]],7883:[[105,803]],7884:[[79,803],,{770:7896}],7885:[[111,803],,{770:7897}],7886:[[79,777]],7887:[[111,777]],7888:[[212,769]],7889:[[244,769]],7890:[[212,768]],7891:[[244,768]],7892:[[212,777]],7893:[[244,777]],7894:[[212,771]],7895:[[244,771]],7896:[[7884,770]],7897:[[7885,770]],7898:[[416,769]],7899:[[417,769]],7900:[[416,768]],7901:[[417,768]],7902:[[416,777]],7903:[[417,777]],7904:[[416,771]],7905:[[417,771]],7906:[[416,803]],7907:[[417,803]],7908:[[85,803]],7909:[[117,803]],7910:[[85,777]],7911:[[117,777]],7912:[[431,769]],7913:[[432,769]],7914:[[431,768]],7915:[[432,768]],7916:[[431,777]],7917:[[432,777]],7918:[[431,771]],7919:[[432,771]],7920:[[431,803]],7921:[[432,803]],7922:[[89,768]],7923:[[121,768]],7924:[[89,803]],7925:[[121,803]],7926:[[89,777]],7927:[[121,777]],7928:[[89,771]],7929:[[121,771]]},7936:{7936:[[945,787],,{768:7938,769:7940,834:7942,837:8064}],7937:[[945,788],,{768:7939,769:7941,834:7943,837:8065}],7938:[[7936,768],,{837:8066}],7939:[[7937,768],,{837:8067}],7940:[[7936,769],,{837:8068}],7941:[[7937,769],,{837:8069}],7942:[[7936,834],,{837:8070}],7943:[[7937,834],,{837:8071}],7944:[[913,787],,{768:7946,769:7948,834:7950,837:8072}],7945:[[913,788],,{768:7947,769:7949,834:7951,837:8073}],7946:[[7944,768],,{837:8074}],7947:[[7945,768],,{837:8075}],7948:[[7944,769],,{837:8076}],7949:[[7945,769],,{837:8077}],7950:[[7944,834],,{837:8078}],7951:[[7945,834],,{837:8079}],7952:[[949,787],,{768:7954,769:7956}],7953:[[949,788],,{768:7955,769:7957}],7954:[[7952,768]],7955:[[7953,768]],7956:[[7952,769]],7957:[[7953,769]],7960:[[917,787],,{768:7962,769:7964}],7961:[[917,788],,{768:7963,769:7965}],7962:[[7960,768]],7963:[[7961,768]],7964:[[7960,769]],7965:[[7961,769]],7968:[[951,787],,{768:7970,769:7972,834:7974,837:8080}],7969:[[951,788],,{768:7971,769:7973,834:7975,837:8081}],7970:[[7968,768],,{837:8082}],7971:[[7969,768],,{837:8083}],7972:[[7968,769],,{837:8084}],7973:[[7969,769],,{837:8085}],7974:[[7968,834],,{837:8086}],7975:[[7969,834],,{837:8087}],7976:[[919,787],,{768:7978,769:7980,834:7982,837:8088}],7977:[[919,788],,{768:7979,769:7981,834:7983,837:8089}],7978:[[7976,768],,{837:8090}],7979:[[7977,768],,{837:8091}],7980:[[7976,769],,{837:8092}],7981:[[7977,769],,{837:8093}],7982:[[7976,834],,{837:8094}],7983:[[7977,834],,{837:8095}],7984:[[953,787],,{768:7986,769:7988,834:7990}],7985:[[953,788],,{768:7987,769:7989,834:7991}],7986:[[7984,768]],7987:[[7985,768]],7988:[[7984,769]],7989:[[7985,769]],7990:[[7984,834]],7991:[[7985,834]],7992:[[921,787],,{768:7994,769:7996,834:7998}],7993:[[921,788],,{768:7995,769:7997,834:7999}],7994:[[7992,768]],7995:[[7993,768]],7996:[[7992,769]],7997:[[7993,769]],7998:[[7992,834]],7999:[[7993,834]],8e3:[[959,787],,{768:8002,769:8004}],8001:[[959,788],,{768:8003,769:8005}],8002:[[8e3,768]],8003:[[8001,768]],8004:[[8e3,769]],8005:[[8001,769]],8008:[[927,787],,{768:8010,769:8012}],8009:[[927,788],,{768:8011,769:8013}],8010:[[8008,768]],8011:[[8009,768]],8012:[[8008,769]],8013:[[8009,769]],8016:[[965,787],,{768:8018,769:8020,834:8022}],8017:[[965,788],,{768:8019,769:8021,834:8023}],8018:[[8016,768]],8019:[[8017,768]],8020:[[8016,769]],8021:[[8017,769]],8022:[[8016,834]],8023:[[8017,834]],8025:[[933,788],,{768:8027,769:8029,834:8031}],8027:[[8025,768]],8029:[[8025,769]],8031:[[8025,834]],8032:[[969,787],,{768:8034,769:8036,834:8038,837:8096}],8033:[[969,788],,{768:8035,769:8037,834:8039,837:8097}],8034:[[8032,768],,{837:8098}],8035:[[8033,768],,{837:8099}],8036:[[8032,769],,{837:8100}],8037:[[8033,769],,{837:8101}],8038:[[8032,834],,{837:8102}],8039:[[8033,834],,{837:8103}],8040:[[937,787],,{768:8042,769:8044,834:8046,837:8104}],8041:[[937,788],,{768:8043,769:8045,834:8047,837:8105}],8042:[[8040,768],,{837:8106}],8043:[[8041,768],,{837:8107}],8044:[[8040,769],,{837:8108}],8045:[[8041,769],,{837:8109}],8046:[[8040,834],,{837:8110}],8047:[[8041,834],,{837:8111}],8048:[[945,768],,{837:8114}],8049:[[940]],8050:[[949,768]],8051:[[941]],8052:[[951,768],,{837:8130}],8053:[[942]],8054:[[953,768]],8055:[[943]],8056:[[959,768]],8057:[[972]],8058:[[965,768]],8059:[[973]],8060:[[969,768],,{837:8178}],8061:[[974]],8064:[[7936,837]],8065:[[7937,837]],8066:[[7938,837]],8067:[[7939,837]],8068:[[7940,837]],8069:[[7941,837]],8070:[[7942,837]],8071:[[7943,837]],8072:[[7944,837]],8073:[[7945,837]],8074:[[7946,837]],8075:[[7947,837]],8076:[[7948,837]],8077:[[7949,837]],8078:[[7950,837]],8079:[[7951,837]],8080:[[7968,837]],8081:[[7969,837]],8082:[[7970,837]],8083:[[7971,837]],8084:[[7972,837]],8085:[[7973,837]],8086:[[7974,837]],8087:[[7975,837]],8088:[[7976,837]],8089:[[7977,837]],8090:[[7978,837]],8091:[[7979,837]],8092:[[7980,837]],8093:[[7981,837]],8094:[[7982,837]],8095:[[7983,837]],8096:[[8032,837]],8097:[[8033,837]],8098:[[8034,837]],8099:[[8035,837]],8100:[[8036,837]],8101:[[8037,837]],8102:[[8038,837]],8103:[[8039,837]],8104:[[8040,837]],8105:[[8041,837]],8106:[[8042,837]],8107:[[8043,837]],8108:[[8044,837]],8109:[[8045,837]],8110:[[8046,837]],8111:[[8047,837]],8112:[[945,774]],8113:[[945,772]],8114:[[8048,837]],8115:[[945,837]],8116:[[940,837]],8118:[[945,834],,{837:8119}],8119:[[8118,837]],8120:[[913,774]],8121:[[913,772]],8122:[[913,768]],8123:[[902]],8124:[[913,837]],8125:[[32,787],256],8126:[[953]],8127:[[32,787],256,{768:8141,769:8142,834:8143}],8128:[[32,834],256],8129:[[168,834]],8130:[[8052,837]],8131:[[951,837]],8132:[[942,837]],8134:[[951,834],,{837:8135}],8135:[[8134,837]],8136:[[917,768]],8137:[[904]],8138:[[919,768]],8139:[[905]],8140:[[919,837]],8141:[[8127,768]],8142:[[8127,769]],8143:[[8127,834]],8144:[[953,774]],8145:[[953,772]],8146:[[970,768]],8147:[[912]],8150:[[953,834]],8151:[[970,834]],8152:[[921,774]],8153:[[921,772]],8154:[[921,768]],8155:[[906]],8157:[[8190,768]],8158:[[8190,769]],8159:[[8190,834]],8160:[[965,774]],8161:[[965,772]],8162:[[971,768]],8163:[[944]],8164:[[961,787]],8165:[[961,788]],8166:[[965,834]],8167:[[971,834]],8168:[[933,774]],8169:[[933,772]],8170:[[933,768]],8171:[[910]],8172:[[929,788]],8173:[[168,768]],8174:[[901]],8175:[[96]],8178:[[8060,837]],8179:[[969,837]],8180:[[974,837]],8182:[[969,834],,{837:8183}],8183:[[8182,837]],8184:[[927,768]],8185:[[908]],8186:[[937,768]],8187:[[911]],8188:[[937,837]],8189:[[180]],8190:[[32,788],256,{768:8157,769:8158,834:8159}]},8192:{8192:[[8194]],8193:[[8195]],8194:[[32],256],8195:[[32],256],8196:[[32],256],8197:[[32],256],8198:[[32],256],8199:[[32],256],8200:[[32],256],8201:[[32],256],8202:[[32],256],8209:[[8208],256],8215:[[32,819],256],8228:[[46],256],8229:[[46,46],256],8230:[[46,46,46],256],8239:[[32],256],8243:[[8242,8242],256],8244:[[8242,8242,8242],256],8246:[[8245,8245],256],8247:[[8245,8245,8245],256],8252:[[33,33],256],8254:[[32,773],256],8263:[[63,63],256],8264:[[63,33],256],8265:[[33,63],256],8279:[[8242,8242,8242,8242],256],8287:[[32],256],8304:[[48],256],8305:[[105],256],8308:[[52],256],8309:[[53],256],8310:[[54],256],8311:[[55],256],8312:[[56],256],8313:[[57],256],8314:[[43],256],8315:[[8722],256],8316:[[61],256],8317:[[40],256],8318:[[41],256],8319:[[110],256],8320:[[48],256],8321:[[49],256],8322:[[50],256],8323:[[51],256],8324:[[52],256],8325:[[53],256],8326:[[54],256],8327:[[55],256],8328:[[56],256],8329:[[57],256],8330:[[43],256],8331:[[8722],256],8332:[[61],256],8333:[[40],256],8334:[[41],256],8336:[[97],256],8337:[[101],256],8338:[[111],256],8339:[[120],256],8340:[[601],256],8341:[[104],256],8342:[[107],256],8343:[[108],256],8344:[[109],256],8345:[[110],256],8346:[[112],256],8347:[[115],256],8348:[[116],256],8360:[[82,115],256],8400:[,230],8401:[,230],8402:[,1],8403:[,1],8404:[,230],8405:[,230],8406:[,230],8407:[,230],8408:[,1],8409:[,1],8410:[,1],8411:[,230],8412:[,230],8417:[,230],8421:[,1],8422:[,1],8423:[,230],8424:[,220],8425:[,230],8426:[,1],8427:[,1],8428:[,220],8429:[,220],8430:[,220],8431:[,220],8432:[,230]},8448:{8448:[[97,47,99],256],8449:[[97,47,115],256],8450:[[67],256],8451:[[176,67],256],8453:[[99,47,111],256],8454:[[99,47,117],256],8455:[[400],256],8457:[[176,70],256],8458:[[103],256],8459:[[72],256],8460:[[72],256],8461:[[72],256],8462:[[104],256],8463:[[295],256],8464:[[73],256],8465:[[73],256],8466:[[76],256],8467:[[108],256],8469:[[78],256],8470:[[78,111],256],8473:[[80],256],8474:[[81],256],8475:[[82],256],8476:[[82],256],8477:[[82],256],8480:[[83,77],256],8481:[[84,69,76],256],8482:[[84,77],256],8484:[[90],256],8486:[[937]],8488:[[90],256],8490:[[75]],8491:[[197]],8492:[[66],256],8493:[[67],256],8495:[[101],256],8496:[[69],256],8497:[[70],256],8499:[[77],256],8500:[[111],256],8501:[[1488],256],8502:[[1489],256],8503:[[1490],256],8504:[[1491],256],8505:[[105],256],8507:[[70,65,88],256],8508:[[960],256],8509:[[947],256],8510:[[915],256],8511:[[928],256],8512:[[8721],256],8517:[[68],256],8518:[[100],256],8519:[[101],256],8520:[[105],256],8521:[[106],256],8528:[[49,8260,55],256],8529:[[49,8260,57],256],8530:[[49,8260,49,48],256],8531:[[49,8260,51],256],8532:[[50,8260,51],256],8533:[[49,8260,53],256],8534:[[50,8260,53],256],8535:[[51,8260,53],256],8536:[[52,8260,53],256],8537:[[49,8260,54],256],8538:[[53,8260,54],256],8539:[[49,8260,56],256],8540:[[51,8260,56],256],8541:[[53,8260,56],256],8542:[[55,8260,56],256],8543:[[49,8260],256],8544:[[73],256],8545:[[73,73],256],8546:[[73,73,73],256],8547:[[73,86],256],8548:[[86],256],8549:[[86,73],256],8550:[[86,73,73],256],8551:[[86,73,73,73],256],8552:[[73,88],256],8553:[[88],256],8554:[[88,73],256],8555:[[88,73,73],256],8556:[[76],256],8557:[[67],256],8558:[[68],256],8559:[[77],256],8560:[[105],256],8561:[[105,105],256],8562:[[105,105,105],256],8563:[[105,118],256],8564:[[118],256],8565:[[118,105],256],8566:[[118,105,105],256],8567:[[118,105,105,105],256],8568:[[105,120],256],8569:[[120],256],8570:[[120,105],256],8571:[[120,105,105],256],8572:[[108],256],8573:[[99],256],8574:[[100],256],8575:[[109],256],8585:[[48,8260,51],256],8592:[,,{824:8602}],8594:[,,{824:8603}],8596:[,,{824:8622}],8602:[[8592,824]],8603:[[8594,824]],8622:[[8596,824]],8653:[[8656,824]],8654:[[8660,824]],8655:[[8658,824]],8656:[,,{824:8653}],8658:[,,{824:8655}],8660:[,,{824:8654}]},8704:{8707:[,,{824:8708}],8708:[[8707,824]],8712:[,,{824:8713}],8713:[[8712,824]],8715:[,,{824:8716}],8716:[[8715,824]],8739:[,,{824:8740}],8740:[[8739,824]],8741:[,,{824:8742}],8742:[[8741,824]],8748:[[8747,8747],256],8749:[[8747,8747,8747],256],8751:[[8750,8750],256],8752:[[8750,8750,8750],256],8764:[,,{824:8769}],8769:[[8764,824]],8771:[,,{824:8772}],8772:[[8771,824]],8773:[,,{824:8775}],8775:[[8773,824]],8776:[,,{824:8777}],8777:[[8776,824]],8781:[,,{824:8813}],8800:[[61,824]],8801:[,,{824:8802}],8802:[[8801,824]],8804:[,,{824:8816}],8805:[,,{824:8817}],8813:[[8781,824]],8814:[[60,824]],8815:[[62,824]],8816:[[8804,824]],8817:[[8805,824]],8818:[,,{824:8820}],8819:[,,{824:8821}],8820:[[8818,824]],8821:[[8819,824]],8822:[,,{824:8824}],8823:[,,{824:8825}],8824:[[8822,824]],8825:[[8823,824]],8826:[,,{824:8832}],8827:[,,{824:8833}],8828:[,,{824:8928}],8829:[,,{824:8929}],8832:[[8826,824]],8833:[[8827,824]],8834:[,,{824:8836}],8835:[,,{824:8837}],8836:[[8834,824]],8837:[[8835,824]],8838:[,,{824:8840}],8839:[,,{824:8841}],8840:[[8838,824]],8841:[[8839,824]],8849:[,,{824:8930}],8850:[,,{824:8931}],8866:[,,{824:8876}],8872:[,,{824:8877}],8873:[,,{824:8878}],8875:[,,{824:8879}],8876:[[8866,824]],8877:[[8872,824]],8878:[[8873,824]],8879:[[8875,824]],8882:[,,{824:8938}],8883:[,,{824:8939}],8884:[,,{824:8940}],8885:[,,{824:8941}],8928:[[8828,824]],8929:[[8829,824]],8930:[[8849,824]],8931:[[8850,824]],8938:[[8882,824]],8939:[[8883,824]],8940:[[8884,824]],8941:[[8885,824]]},8960:{9001:[[12296]],9002:[[12297]]},9216:{9312:[[49],256],9313:[[50],256],9314:[[51],256],9315:[[52],256],9316:[[53],256],9317:[[54],256],9318:[[55],256],9319:[[56],256],9320:[[57],256],9321:[[49,48],256],9322:[[49,49],256],9323:[[49,50],256],9324:[[49,51],256],9325:[[49,52],256],9326:[[49,53],256],9327:[[49,54],256],9328:[[49,55],256],9329:[[49,56],256],9330:[[49,57],256],9331:[[50,48],256],9332:[[40,49,41],256],9333:[[40,50,41],256],9334:[[40,51,41],256],9335:[[40,52,41],256],9336:[[40,53,41],256],9337:[[40,54,41],256],9338:[[40,55,41],256],9339:[[40,56,41],256],9340:[[40,57,41],256],9341:[[40,49,48,41],256],9342:[[40,49,49,41],256],9343:[[40,49,50,41],256],9344:[[40,49,51,41],256],9345:[[40,49,52,41],256],9346:[[40,49,53,41],256],9347:[[40,49,54,41],256],9348:[[40,49,55,41],256],9349:[[40,49,56,41],256],9350:[[40,49,57,41],256],9351:[[40,50,48,41],256],9352:[[49,46],256],9353:[[50,46],256],9354:[[51,46],256],9355:[[52,46],256],9356:[[53,46],256],9357:[[54,46],256],9358:[[55,46],256],9359:[[56,46],256],9360:[[57,46],256],9361:[[49,48,46],256],9362:[[49,49,46],256],9363:[[49,50,46],256],9364:[[49,51,46],256],9365:[[49,52,46],256],9366:[[49,53,46],256],9367:[[49,54,46],256],9368:[[49,55,46],256],9369:[[49,56,46],256],9370:[[49,57,46],256],9371:[[50,48,46],256],9372:[[40,97,41],256],9373:[[40,98,41],256],9374:[[40,99,41],256],9375:[[40,100,41],256],9376:[[40,101,41],256],9377:[[40,102,41],256],9378:[[40,103,41],256],9379:[[40,104,41],256],9380:[[40,105,41],256],9381:[[40,106,41],256],9382:[[40,107,41],256],9383:[[40,108,41],256],9384:[[40,109,41],256],9385:[[40,110,41],256],9386:[[40,111,41],256],9387:[[40,112,41],256],9388:[[40,113,41],256],9389:[[40,114,41],256],9390:[[40,115,41],256],9391:[[40,116,41],256],9392:[[40,117,41],256],9393:[[40,118,41],256],9394:[[40,119,41],256],9395:[[40,120,41],256],9396:[[40,121,41],256],9397:[[40,122,41],256],9398:[[65],256],9399:[[66],256],9400:[[67],256],9401:[[68],256],9402:[[69],256],9403:[[70],256],9404:[[71],256],9405:[[72],256],9406:[[73],256],9407:[[74],256],9408:[[75],256],9409:[[76],256],9410:[[77],256],9411:[[78],256],9412:[[79],256],9413:[[80],256],9414:[[81],256],9415:[[82],256],9416:[[83],256],9417:[[84],256],9418:[[85],256],9419:[[86],256],9420:[[87],256],9421:[[88],256],9422:[[89],256],9423:[[90],256],9424:[[97],256],9425:[[98],256],9426:[[99],256],9427:[[100],256],9428:[[101],256],9429:[[102],256],9430:[[103],256],9431:[[104],256],9432:[[105],256],9433:[[106],256],9434:[[107],256],9435:[[108],256],9436:[[109],256],9437:[[110],256],9438:[[111],256],9439:[[112],256],9440:[[113],256],9441:[[114],256],9442:[[115],256],9443:[[116],256],9444:[[117],256],9445:[[118],256],9446:[[119],256],9447:[[120],256],9448:[[121],256],9449:[[122],256],9450:[[48],256]},10752:{10764:[[8747,8747,8747,8747],256],10868:[[58,58,61],256],10869:[[61,61],256],10870:[[61,61,61],256],10972:[[10973,824],512]},11264:{11388:[[106],256],11389:[[86],256],11503:[,230],11504:[,230],11505:[,230]},11520:{11631:[[11617],256],11647:[,9],11744:[,230],11745:[,230],11746:[,230],11747:[,230],11748:[,230],11749:[,230],11750:[,230],11751:[,230],11752:[,230],11753:[,230],11754:[,230],11755:[,230],11756:[,230],11757:[,230],11758:[,230],11759:[,230],11760:[,230],11761:[,230],11762:[,230],11763:[,230],11764:[,230],11765:[,230],11766:[,230],11767:[,230],11768:[,230],11769:[,230],11770:[,230],11771:[,230],11772:[,230],11773:[,230],11774:[,230],11775:[,230]},11776:{11935:[[27597],256],12019:[[40863],256]},12032:{12032:[[19968],256],12033:[[20008],256],12034:[[20022],256],12035:[[20031],256],12036:[[20057],256],12037:[[20101],256],12038:[[20108],256],12039:[[20128],256],12040:[[20154],256],12041:[[20799],256],12042:[[20837],256],12043:[[20843],256],12044:[[20866],256],12045:[[20886],256],12046:[[20907],256],12047:[[20960],256],12048:[[20981],256],12049:[[20992],256],12050:[[21147],256],12051:[[21241],256],12052:[[21269],256],12053:[[21274],256],12054:[[21304],256],12055:[[21313],256],12056:[[21340],256],12057:[[21353],256],12058:[[21378],256],12059:[[21430],256],12060:[[21448],256],12061:[[21475],256],12062:[[22231],256],12063:[[22303],256],12064:[[22763],256],12065:[[22786],256],12066:[[22794],256],12067:[[22805],256],12068:[[22823],256],12069:[[22899],256],12070:[[23376],256],12071:[[23424],256],12072:[[23544],256],12073:[[23567],256],12074:[[23586],256],12075:[[23608],256],12076:[[23662],256],12077:[[23665],256],12078:[[24027],256],12079:[[24037],256],12080:[[24049],256],12081:[[24062],256],12082:[[24178],256],12083:[[24186],256],12084:[[24191],256],12085:[[24308],256],12086:[[24318],256],12087:[[24331],256],12088:[[24339],256],12089:[[24400],256],12090:[[24417],256],12091:[[24435],256],12092:[[24515],256],12093:[[25096],256],12094:[[25142],256],12095:[[25163],256],12096:[[25903],256],12097:[[25908],256],12098:[[25991],256],12099:[[26007],256],12100:[[26020],256],12101:[[26041],256],12102:[[26080],256],12103:[[26085],256],12104:[[26352],256],12105:[[26376],256],12106:[[26408],256],12107:[[27424],256],12108:[[27490],256],12109:[[27513],256],12110:[[27571],256],12111:[[27595],256],12112:[[27604],256],12113:[[27611],256],12114:[[27663],256],12115:[[27668],256],12116:[[27700],256],12117:[[28779],256],12118:[[29226],256],12119:[[29238],256],12120:[[29243],256],12121:[[29247],256],12122:[[29255],256],12123:[[29273],256],12124:[[29275],256],12125:[[29356],256],12126:[[29572],256],12127:[[29577],256],12128:[[29916],256],12129:[[29926],256],12130:[[29976],256],12131:[[29983],256],12132:[[29992],256],12133:[[3e4],256],12134:[[30091],256],12135:[[30098],256],12136:[[30326],256],12137:[[30333],256],12138:[[30382],256],12139:[[30399],256],12140:[[30446],256],12141:[[30683],256],12142:[[30690],256],12143:[[30707],256],12144:[[31034],256],12145:[[31160],256],12146:[[31166],256],12147:[[31348],256],12148:[[31435],256],12149:[[31481],256],12150:[[31859],256],12151:[[31992],256],12152:[[32566],256],12153:[[32593],256],12154:[[32650],256],12155:[[32701],256],12156:[[32769],256],12157:[[32780],256],12158:[[32786],256],12159:[[32819],256],12160:[[32895],256],12161:[[32905],256],12162:[[33251],256],12163:[[33258],256],12164:[[33267],256],12165:[[33276],256],12166:[[33292],256],12167:[[33307],256],12168:[[33311],256],12169:[[33390],256],12170:[[33394],256],12171:[[33400],256],12172:[[34381],256],12173:[[34411],256],12174:[[34880],256],12175:[[34892],256],12176:[[34915],256],12177:[[35198],256],12178:[[35211],256],12179:[[35282],256],12180:[[35328],256],12181:[[35895],256],12182:[[35910],256],12183:[[35925],256],12184:[[35960],256],12185:[[35997],256],12186:[[36196],256],12187:[[36208],256],12188:[[36275],256],12189:[[36523],256],12190:[[36554],256],12191:[[36763],256],12192:[[36784],256],12193:[[36789],256],12194:[[37009],256],12195:[[37193],256],12196:[[37318],256],12197:[[37324],256],12198:[[37329],256],12199:[[38263],256],12200:[[38272],256],12201:[[38428],256],12202:[[38582],256],12203:[[38585],256],12204:[[38632],256],12205:[[38737],256],12206:[[38750],256],12207:[[38754],256],12208:[[38761],256],12209:[[38859],256],12210:[[38893],256],12211:[[38899],256],12212:[[38913],256],12213:[[39080],256],12214:[[39131],256],12215:[[39135],256],12216:[[39318],256],12217:[[39321],256],12218:[[39340],256],12219:[[39592],256],12220:[[39640],256],12221:[[39647],256],12222:[[39717],256],12223:[[39727],256],12224:[[39730],256],12225:[[39740],256],12226:[[39770],256],12227:[[40165],256],12228:[[40565],256],12229:[[40575],256],12230:[[40613],256],12231:[[40635],256],12232:[[40643],256],12233:[[40653],256],12234:[[40657],256],12235:[[40697],256],12236:[[40701],256],12237:[[40718],256],12238:[[40723],256],12239:[[40736],256],12240:[[40763],256],12241:[[40778],256],12242:[[40786],256],12243:[[40845],256],12244:[[40860],256],12245:[[40864],256]},12288:{12288:[[32],256],12330:[,218],12331:[,228],12332:[,232],12333:[,222],12334:[,224],12335:[,224],12342:[[12306],256],12344:[[21313],256],12345:[[21316],256],12346:[[21317],256],12358:[,,{12441:12436}],12363:[,,{12441:12364}],12364:[[12363,12441]],12365:[,,{12441:12366}],12366:[[12365,12441]],12367:[,,{12441:12368}],12368:[[12367,12441]],12369:[,,{12441:12370}],12370:[[12369,12441]],12371:[,,{12441:12372}],12372:[[12371,12441]],12373:[,,{12441:12374}],12374:[[12373,12441]],12375:[,,{12441:12376}],12376:[[12375,12441]],12377:[,,{12441:12378}],12378:[[12377,12441]],12379:[,,{12441:12380}],12380:[[12379,12441]],12381:[,,{12441:12382}],12382:[[12381,12441]],12383:[,,{12441:12384}],12384:[[12383,12441]],12385:[,,{12441:12386}],12386:[[12385,12441]],12388:[,,{12441:12389}],12389:[[12388,12441]],12390:[,,{12441:12391}],12391:[[12390,12441]],12392:[,,{12441:12393}],12393:[[12392,12441]],12399:[,,{12441:12400,12442:12401}],12400:[[12399,12441]],12401:[[12399,12442]],12402:[,,{12441:12403,12442:12404}],12403:[[12402,12441]],12404:[[12402,12442]],12405:[,,{12441:12406,12442:12407}],12406:[[12405,12441]],12407:[[12405,12442]],12408:[,,{12441:12409,12442:12410}],12409:[[12408,12441]],12410:[[12408,12442]],12411:[,,{12441:12412,12442:12413}],12412:[[12411,12441]],12413:[[12411,12442]],12436:[[12358,12441]],12441:[,8],12442:[,8],12443:[[32,12441],256],12444:[[32,12442],256],12445:[,,{12441:12446}],12446:[[12445,12441]],12447:[[12424,12426],256],12454:[,,{12441:12532}],12459:[,,{12441:12460}],12460:[[12459,12441]],12461:[,,{12441:12462}],12462:[[12461,12441]],12463:[,,{12441:12464}],12464:[[12463,12441]],12465:[,,{12441:12466}],12466:[[12465,12441]],12467:[,,{12441:12468}],12468:[[12467,12441]],12469:[,,{12441:12470}],12470:[[12469,12441]],12471:[,,{12441:12472}],12472:[[12471,12441]],12473:[,,{12441:12474}],12474:[[12473,12441]],12475:[,,{12441:12476}],12476:[[12475,12441]],12477:[,,{12441:12478}],12478:[[12477,12441]],12479:[,,{12441:12480}],12480:[[12479,12441]],12481:[,,{12441:12482}],12482:[[12481,12441]],12484:[,,{12441:12485}],12485:[[12484,12441]],12486:[,,{12441:12487}],12487:[[12486,12441]],12488:[,,{12441:12489}],12489:[[12488,12441]],12495:[,,{12441:12496,12442:12497}],12496:[[12495,12441]],12497:[[12495,12442]],12498:[,,{12441:12499,12442:12500}],12499:[[12498,12441]],12500:[[12498,12442]],12501:[,,{12441:12502,12442:12503}],12502:[[12501,12441]],12503:[[12501,12442]],12504:[,,{12441:12505,12442:12506}],12505:[[12504,12441]],12506:[[12504,12442]],12507:[,,{12441:12508,12442:12509}],12508:[[12507,12441]],12509:[[12507,12442]],12527:[,,{12441:12535}],12528:[,,{12441:12536}],12529:[,,{12441:12537}],12530:[,,{12441:12538}],12532:[[12454,12441]],12535:[[12527,12441]],12536:[[12528,12441]],12537:[[12529,12441]],12538:[[12530,12441]],12541:[,,{12441:12542}],12542:[[12541,12441]],12543:[[12467,12488],256]},12544:{12593:[[4352],256],12594:[[4353],256],12595:[[4522],256],12596:[[4354],256],12597:[[4524],256],12598:[[4525],256],12599:[[4355],256],12600:[[4356],256],12601:[[4357],256],12602:[[4528],256],12603:[[4529],256],12604:[[4530],256],12605:[[4531],256],12606:[[4532],256],12607:[[4533],256],12608:[[4378],256],12609:[[4358],256],12610:[[4359],256],12611:[[4360],256],12612:[[4385],256],12613:[[4361],256],12614:[[4362],256],12615:[[4363],256],12616:[[4364],256],12617:[[4365],256],12618:[[4366],256],12619:[[4367],256],12620:[[4368],256],12621:[[4369],256],12622:[[4370],256],12623:[[4449],256],12624:[[4450],256],12625:[[4451],256],12626:[[4452],256],12627:[[4453],256],12628:[[4454],256],12629:[[4455],256],12630:[[4456],256],12631:[[4457],256],12632:[[4458],256],12633:[[4459],256],12634:[[4460],256],12635:[[4461],256],12636:[[4462],256],12637:[[4463],256],12638:[[4464],256],12639:[[4465],256],12640:[[4466],256],12641:[[4467],256],12642:[[4468],256],12643:[[4469],256],12644:[[4448],256],12645:[[4372],256],12646:[[4373],256],12647:[[4551],256],12648:[[4552],256],12649:[[4556],256],12650:[[4558],256],12651:[[4563],256],12652:[[4567],256],12653:[[4569],256],12654:[[4380],256],12655:[[4573],256],12656:[[4575],256],12657:[[4381],256],12658:[[4382],256],12659:[[4384],256],12660:[[4386],256],12661:[[4387],256],12662:[[4391],256],12663:[[4393],256],12664:[[4395],256],12665:[[4396],256],12666:[[4397],256],12667:[[4398],256],12668:[[4399],256],12669:[[4402],256],12670:[[4406],256],12671:[[4416],256],12672:[[4423],256],12673:[[4428],256],12674:[[4593],256],12675:[[4594],256],12676:[[4439],256],12677:[[4440],256],12678:[[4441],256],12679:[[4484],256],12680:[[4485],256],12681:[[4488],256],12682:[[4497],256],12683:[[4498],256],12684:[[4500],256],12685:[[4510],256],12686:[[4513],256],12690:[[19968],256],12691:[[20108],256],12692:[[19977],256],12693:[[22235],256],12694:[[19978],256],12695:[[20013],256],12696:[[19979],256],12697:[[30002],256],12698:[[20057],256],12699:[[19993],256],12700:[[19969],256],12701:[[22825],256],12702:[[22320],256],12703:[[20154],256]},12800:{12800:[[40,4352,41],256],12801:[[40,4354,41],256],12802:[[40,4355,41],256],12803:[[40,4357,41],256],12804:[[40,4358,41],256],12805:[[40,4359,41],256],12806:[[40,4361,41],256],12807:[[40,4363,41],256],12808:[[40,4364,41],256],12809:[[40,4366,41],256],12810:[[40,4367,41],256],12811:[[40,4368,41],256],12812:[[40,4369,41],256],12813:[[40,4370,41],256],12814:[[40,4352,4449,41],256],12815:[[40,4354,4449,41],256],12816:[[40,4355,4449,41],256],12817:[[40,4357,4449,41],256],12818:[[40,4358,4449,41],256],12819:[[40,4359,4449,41],256],12820:[[40,4361,4449,41],256],12821:[[40,4363,4449,41],256],12822:[[40,4364,4449,41],256],12823:[[40,4366,4449,41],256],12824:[[40,4367,4449,41],256],12825:[[40,4368,4449,41],256],12826:[[40,4369,4449,41],256],12827:[[40,4370,4449,41],256],12828:[[40,4364,4462,41],256],12829:[[40,4363,4457,4364,4453,4523,41],256],12830:[[40,4363,4457,4370,4462,41],256],12832:[[40,19968,41],256],12833:[[40,20108,41],256],12834:[[40,19977,41],256],12835:[[40,22235,41],256],12836:[[40,20116,41],256],12837:[[40,20845,41],256],12838:[[40,19971,41],256],12839:[[40,20843,41],256],12840:[[40,20061,41],256],12841:[[40,21313,41],256],12842:[[40,26376,41],256],12843:[[40,28779,41],256],12844:[[40,27700,41],256],12845:[[40,26408,41],256],12846:[[40,37329,41],256],12847:[[40,22303,41],256],12848:[[40,26085,41],256],12849:[[40,26666,41],256],12850:[[40,26377,41],256],12851:[[40,31038,41],256],12852:[[40,21517,41],256],12853:[[40,29305,41],256],12854:[[40,36001,41],256],12855:[[40,31069,41],256],12856:[[40,21172,41],256],12857:[[40,20195,41],256],12858:[[40,21628,41],256],12859:[[40,23398,41],256],12860:[[40,30435,41],256],12861:[[40,20225,41],256],12862:[[40,36039,41],256],12863:[[40,21332,41],256],12864:[[40,31085,41],256],12865:[[40,20241,41],256],12866:[[40,33258,41],256],12867:[[40,33267,41],256],12868:[[21839],256],12869:[[24188],256],12870:[[25991],256],12871:[[31631],256],12880:[[80,84,69],256],12881:[[50,49],256],12882:[[50,50],256],12883:[[50,51],256],12884:[[50,52],256],12885:[[50,53],256],12886:[[50,54],256],12887:[[50,55],256],12888:[[50,56],256],12889:[[50,57],256],12890:[[51,48],256],12891:[[51,49],256],12892:[[51,50],256],12893:[[51,51],256],12894:[[51,52],256],12895:[[51,53],256],12896:[[4352],256],12897:[[4354],256],12898:[[4355],256],12899:[[4357],256],12900:[[4358],256],12901:[[4359],256],12902:[[4361],256],12903:[[4363],256],12904:[[4364],256],12905:[[4366],256],12906:[[4367],256],12907:[[4368],256],12908:[[4369],256],12909:[[4370],256],12910:[[4352,4449],256],12911:[[4354,4449],256],12912:[[4355,4449],256],12913:[[4357,4449],256],12914:[[4358,4449],256],12915:[[4359,4449],256],12916:[[4361,4449],256],12917:[[4363,4449],256],12918:[[4364,4449],256],12919:[[4366,4449],256],12920:[[4367,4449],256],12921:[[4368,4449],256],12922:[[4369,4449],256],12923:[[4370,4449],256],12924:[[4366,4449,4535,4352,4457],256],12925:[[4364,4462,4363,4468],256],12926:[[4363,4462],256],12928:[[19968],256],12929:[[20108],256],12930:[[19977],256],12931:[[22235],256],12932:[[20116],256],12933:[[20845],256],12934:[[19971],256],12935:[[20843],256],12936:[[20061],256],12937:[[21313],256],12938:[[26376],256],12939:[[28779],256],12940:[[27700],256],12941:[[26408],256],12942:[[37329],256],12943:[[22303],256],12944:[[26085],256],12945:[[26666],256],12946:[[26377],256],12947:[[31038],256],12948:[[21517],256],12949:[[29305],256],12950:[[36001],256],12951:[[31069],256],12952:[[21172],256],12953:[[31192],256],12954:[[30007],256],12955:[[22899],256],12956:[[36969],256],12957:[[20778],256],12958:[[21360],256],12959:[[27880],256],12960:[[38917],256],12961:[[20241],256],12962:[[20889],256],12963:[[27491],256],12964:[[19978],256],12965:[[20013],256],12966:[[19979],256],12967:[[24038],256],12968:[[21491],256],12969:[[21307],256],12970:[[23447],256],12971:[[23398],256],12972:[[30435],256],12973:[[20225],256],12974:[[36039],256],12975:[[21332],256],12976:[[22812],256],12977:[[51,54],256],12978:[[51,55],256],12979:[[51,56],256],12980:[[51,57],256],12981:[[52,48],256],12982:[[52,49],256],12983:[[52,50],256],12984:[[52,51],256],12985:[[52,52],256],12986:[[52,53],256],12987:[[52,54],256],12988:[[52,55],256],12989:[[52,56],256],12990:[[52,57],256],12991:[[53,48],256],12992:[[49,26376],256],12993:[[50,26376],256],12994:[[51,26376],256],12995:[[52,26376],256],12996:[[53,26376],256],12997:[[54,26376],256],12998:[[55,26376],256],12999:[[56,26376],256],13e3:[[57,26376],256],13001:[[49,48,26376],256],13002:[[49,49,26376],256],13003:[[49,50,26376],256],13004:[[72,103],256],13005:[[101,114,103],256],13006:[[101,86],256],13007:[[76,84,68],256],13008:[[12450],256],13009:[[12452],256],13010:[[12454],256],13011:[[12456],256],13012:[[12458],256],13013:[[12459],256],13014:[[12461],256],13015:[[12463],256],13016:[[12465],256],13017:[[12467],256],13018:[[12469],256],13019:[[12471],256],13020:[[12473],256],13021:[[12475],256],13022:[[12477],256],13023:[[12479],256],13024:[[12481],256],13025:[[12484],256],13026:[[12486],256],13027:[[12488],256],13028:[[12490],256],13029:[[12491],256],13030:[[12492],256],13031:[[12493],256],13032:[[12494],256],13033:[[12495],256],13034:[[12498],256],13035:[[12501],256],13036:[[12504],256],13037:[[12507],256],13038:[[12510],256],13039:[[12511],256],13040:[[12512],256],13041:[[12513],256],13042:[[12514],256],13043:[[12516],256],13044:[[12518],256],13045:[[12520],256],13046:[[12521],256],13047:[[12522],256],13048:[[12523],256],13049:[[12524],256],13050:[[12525],256],13051:[[12527],256],13052:[[12528],256],13053:[[12529],256],13054:[[12530],256]},13056:{13056:[[12450,12497,12540,12488],256],13057:[[12450,12523,12501,12449],256],13058:[[12450,12531,12506,12450],256],13059:[[12450,12540,12523],256],13060:[[12452,12491,12531,12464],256],13061:[[12452,12531,12481],256],13062:[[12454,12457,12531],256],13063:[[12456,12473,12463,12540,12489],256],13064:[[12456,12540,12459,12540],256],13065:[[12458,12531,12473],256],13066:[[12458,12540,12512],256],13067:[[12459,12452,12522],256],13068:[[12459,12521,12483,12488],256],13069:[[12459,12525,12522,12540],256],13070:[[12460,12525,12531],256],13071:[[12460,12531,12510],256],13072:[[12462,12460],256],13073:[[12462,12491,12540],256],13074:[[12461,12517,12522,12540],256],13075:[[12462,12523,12480,12540],256],13076:[[12461,12525],256],13077:[[12461,12525,12464,12521,12512],256],13078:[[12461,12525,12513,12540,12488,12523],256],13079:[[12461,12525,12527,12483,12488],256],13080:[[12464,12521,12512],256],13081:[[12464,12521,12512,12488,12531],256],13082:[[12463,12523,12476,12452,12525],256],13083:[[12463,12525,12540,12493],256],13084:[[12465,12540,12473],256],13085:[[12467,12523,12490],256],13086:[[12467,12540,12509],256],13087:[[12469,12452,12463,12523],256],13088:[[12469,12531,12481,12540,12512],256],13089:[[12471,12522,12531,12464],256],13090:[[12475,12531,12481],256],13091:[[12475,12531,12488],256],13092:[[12480,12540,12473],256],13093:[[12487,12471],256],13094:[[12489,12523],256],13095:[[12488,12531],256],13096:[[12490,12494],256],13097:[[12494,12483,12488],256],13098:[[12495,12452,12484],256],13099:[[12497,12540,12475,12531,12488],256],13100:[[12497,12540,12484],256],13101:[[12496,12540,12524,12523],256],13102:[[12500,12450,12473,12488,12523],256],13103:[[12500,12463,12523],256],13104:[[12500,12467],256],13105:[[12499,12523],256],13106:[[12501,12449,12521,12483,12489],256],13107:[[12501,12451,12540,12488],256],13108:[[12502,12483,12471,12455,12523],256],13109:[[12501,12521,12531],256],13110:[[12504,12463,12479,12540,12523],256],13111:[[12506,12477],256],13112:[[12506,12491,12498],256],13113:[[12504,12523,12484],256],13114:[[12506,12531,12473],256],13115:[[12506,12540,12472],256],13116:[[12505,12540,12479],256],13117:[[12509,12452,12531,12488],256],13118:[[12508,12523,12488],256],13119:[[12507,12531],256],13120:[[12509,12531,12489],256],13121:[[12507,12540,12523],256],13122:[[12507,12540,12531],256],13123:[[12510,12452,12463,12525],256],13124:[[12510,12452,12523],256],13125:[[12510,12483,12495],256],13126:[[12510,12523,12463],256],13127:[[12510,12531,12471,12519,12531],256],13128:[[12511,12463,12525,12531],256],13129:[[12511,12522],256],13130:[[12511,12522,12496,12540,12523],256],13131:[[12513,12460],256],13132:[[12513,12460,12488,12531],256],13133:[[12513,12540,12488,12523],256],13134:[[12516,12540,12489],256],13135:[[12516,12540,12523],256],13136:[[12518,12450,12531],256],13137:[[12522,12483,12488,12523],256],13138:[[12522,12521],256],13139:[[12523,12500,12540],256],13140:[[12523,12540,12502,12523],256],13141:[[12524,12512],256],13142:[[12524,12531,12488,12466,12531],256],13143:[[12527,12483,12488],256],13144:[[48,28857],256],13145:[[49,28857],256],13146:[[50,28857],256],13147:[[51,28857],256],13148:[[52,28857],256],13149:[[53,28857],256],13150:[[54,28857],256],13151:[[55,28857],256],13152:[[56,28857],256],13153:[[57,28857],256],13154:[[49,48,28857],256],13155:[[49,49,28857],256],13156:[[49,50,28857],256],13157:[[49,51,28857],256],13158:[[49,52,28857],256],13159:[[49,53,28857],256],13160:[[49,54,28857],256],13161:[[49,55,28857],256],13162:[[49,56,28857],256],13163:[[49,57,28857],256],13164:[[50,48,28857],256],13165:[[50,49,28857],256],13166:[[50,50,28857],256],13167:[[50,51,28857],256],13168:[[50,52,28857],256],13169:[[104,80,97],256],13170:[[100,97],256],13171:[[65,85],256],13172:[[98,97,114],256],13173:[[111,86],256],13174:[[112,99],256],13175:[[100,109],256],13176:[[100,109,178],256],13177:[[100,109,179],256],13178:[[73,85],256],13179:[[24179,25104],256],13180:[[26157,21644],256],13181:[[22823,27491],256],13182:[[26126,27835],256],13183:[[26666,24335,20250,31038],256],13184:[[112,65],256],13185:[[110,65],256],13186:[[956,65],256],13187:[[109,65],256],13188:[[107,65],256],13189:[[75,66],256],13190:[[77,66],256],13191:[[71,66],256],13192:[[99,97,108],256],13193:[[107,99,97,108],256],13194:[[112,70],256],13195:[[110,70],256],13196:[[956,70],256],13197:[[956,103],256],13198:[[109,103],256],13199:[[107,103],256],13200:[[72,122],256],13201:[[107,72,122],256],13202:[[77,72,122],256],13203:[[71,72,122],256],13204:[[84,72,122],256],13205:[[956,8467],256],13206:[[109,8467],256],13207:[[100,8467],256],13208:[[107,8467],256],13209:[[102,109],256],13210:[[110,109],256],13211:[[956,109],256],13212:[[109,109],256],13213:[[99,109],256],13214:[[107,109],256],13215:[[109,109,178],256],13216:[[99,109,178],256],13217:[[109,178],256],13218:[[107,109,178],256],13219:[[109,109,179],256],13220:[[99,109,179],256],13221:[[109,179],256],13222:[[107,109,179],256],13223:[[109,8725,115],256],13224:[[109,8725,115,178],256],13225:[[80,97],256],13226:[[107,80,97],256],13227:[[77,80,97],256],13228:[[71,80,97],256],13229:[[114,97,100],256],13230:[[114,97,100,8725,115],256],13231:[[114,97,100,8725,115,178],256],13232:[[112,115],256],13233:[[110,115],256],13234:[[956,115],256],13235:[[109,115],256],13236:[[112,86],256],13237:[[110,86],256],13238:[[956,86],256],13239:[[109,86],256],13240:[[107,86],256],13241:[[77,86],256],13242:[[112,87],256],13243:[[110,87],256],13244:[[956,87],256],13245:[[109,87],256],13246:[[107,87],256],13247:[[77,87],256],13248:[[107,937],256],13249:[[77,937],256],13250:[[97,46,109,46],256],13251:[[66,113],256],13252:[[99,99],256],13253:[[99,100],256],13254:[[67,8725,107,103],256],13255:[[67,111,46],256],13256:[[100,66],256],13257:[[71,121],256],13258:[[104,97],256],13259:[[72,80],256],13260:[[105,110],256],13261:[[75,75],256],13262:[[75,77],256],13263:[[107,116],256],13264:[[108,109],256],13265:[[108,110],256],13266:[[108,111,103],256],13267:[[108,120],256],13268:[[109,98],256],13269:[[109,105,108],256],13270:[[109,111,108],256],13271:[[80,72],256],13272:[[112,46,109,46],256],13273:[[80,80,77],256],13274:[[80,82],256],13275:[[115,114],256],13276:[[83,118],256],13277:[[87,98],256],13278:[[86,8725,109],256],13279:[[65,8725,109],256],13280:[[49,26085],256],13281:[[50,26085],256],13282:[[51,26085],256],13283:[[52,26085],256],13284:[[53,26085],256],13285:[[54,26085],256],13286:[[55,26085],256],13287:[[56,26085],256],13288:[[57,26085],256],13289:[[49,48,26085],256],13290:[[49,49,26085],256],13291:[[49,50,26085],256],13292:[[49,51,26085],256],13293:[[49,52,26085],256],13294:[[49,53,26085],256],13295:[[49,54,26085],256],13296:[[49,55,26085],256],13297:[[49,56,26085],256],13298:[[49,57,26085],256],13299:[[50,48,26085],256],13300:[[50,49,26085],256],13301:[[50,50,26085],256],13302:[[50,51,26085],256],13303:[[50,52,26085],256],13304:[[50,53,26085],256],13305:[[50,54,26085],256],13306:[[50,55,26085],256],13307:[[50,56,26085],256],13308:[[50,57,26085],256],13309:[[51,48,26085],256],13310:[[51,49,26085],256],13311:[[103,97,108],256]},27136:{92912:[,1],92913:[,1],92914:[,1],92915:[,1],92916:[,1]},27392:{92976:[,230],92977:[,230],92978:[,230],92979:[,230],92980:[,230],92981:[,230],92982:[,230]},42496:{42607:[,230],42612:[,230],42613:[,230],42614:[,230],42615:[,230],42616:[,230],42617:[,230],42618:[,230],42619:[,230],42620:[,230],42621:[,230],42652:[[1098],256],42653:[[1100],256],42655:[,230],42736:[,230],42737:[,230]},42752:{42864:[[42863],256],43e3:[[294],256],43001:[[339],256]},43008:{43014:[,9],43204:[,9],43232:[,230],43233:[,230],43234:[,230],43235:[,230],43236:[,230],43237:[,230],43238:[,230],43239:[,230],43240:[,230],43241:[,230],43242:[,230],43243:[,230],43244:[,230],43245:[,230],43246:[,230],43247:[,230],43248:[,230],43249:[,230]},43264:{43307:[,220],43308:[,220],43309:[,220],43347:[,9],43443:[,7],43456:[,9]},43520:{43696:[,230],43698:[,230],43699:[,230],43700:[,220],43703:[,230],43704:[,230],43710:[,230],43711:[,230],43713:[,230],43766:[,9]},43776:{43868:[[42791],256],43869:[[43831],256],43870:[[619],256],43871:[[43858],256],44013:[,9]},48128:{113822:[,1]},53504:{119134:[[119127,119141],512],119135:[[119128,119141],512],119136:[[119135,119150],512],119137:[[119135,119151],512],119138:[[119135,119152],512],119139:[[119135,119153],512],119140:[[119135,119154],512],119141:[,216],119142:[,216],119143:[,1],119144:[,1],119145:[,1],119149:[,226],119150:[,216],119151:[,216],119152:[,216],119153:[,216],119154:[,216],119163:[,220],119164:[,220],119165:[,220],119166:[,220],119167:[,220],119168:[,220],119169:[,220],119170:[,220],119173:[,230],119174:[,230],119175:[,230],119176:[,230],119177:[,230],119178:[,220],119179:[,220],119210:[,230],119211:[,230],119212:[,230],119213:[,230],119227:[[119225,119141],512],119228:[[119226,119141],512],119229:[[119227,119150],512],119230:[[119228,119150],512],119231:[[119227,119151],512],119232:[[119228,119151],512]},53760:{119362:[,230],119363:[,230],119364:[,230]},54272:{119808:[[65],256],119809:[[66],256],119810:[[67],256],119811:[[68],256],119812:[[69],256],119813:[[70],256],119814:[[71],256],119815:[[72],256],119816:[[73],256],119817:[[74],256],119818:[[75],256],119819:[[76],256],119820:[[77],256],119821:[[78],256],119822:[[79],256],119823:[[80],256],119824:[[81],256],119825:[[82],256],119826:[[83],256],119827:[[84],256],119828:[[85],256],119829:[[86],256],119830:[[87],256],119831:[[88],256],119832:[[89],256],119833:[[90],256],119834:[[97],256],119835:[[98],256],119836:[[99],256],119837:[[100],256],119838:[[101],256],119839:[[102],256],119840:[[103],256],119841:[[104],256],119842:[[105],256],119843:[[106],256],119844:[[107],256],119845:[[108],256],119846:[[109],256],119847:[[110],256],119848:[[111],256],119849:[[112],256],119850:[[113],256],119851:[[114],256],119852:[[115],256],119853:[[116],256],119854:[[117],256],119855:[[118],256],119856:[[119],256],119857:[[120],256],119858:[[121],256],119859:[[122],256],119860:[[65],256],119861:[[66],256],119862:[[67],256],119863:[[68],256],119864:[[69],256],119865:[[70],256],119866:[[71],256],119867:[[72],256],119868:[[73],256],119869:[[74],256],119870:[[75],256],119871:[[76],256],119872:[[77],256],119873:[[78],256],119874:[[79],256],119875:[[80],256],119876:[[81],256],119877:[[82],256],119878:[[83],256],119879:[[84],256],119880:[[85],256],119881:[[86],256],119882:[[87],256],119883:[[88],256],119884:[[89],256],119885:[[90],256],119886:[[97],256],119887:[[98],256],119888:[[99],256],119889:[[100],256],119890:[[101],256],119891:[[102],256],119892:[[103],256],119894:[[105],256],119895:[[106],256],119896:[[107],256],119897:[[108],256],119898:[[109],256],119899:[[110],256],119900:[[111],256],119901:[[112],256],119902:[[113],256],119903:[[114],256],119904:[[115],256],119905:[[116],256],119906:[[117],256],119907:[[118],256],119908:[[119],256],119909:[[120],256],119910:[[121],256],119911:[[122],256],119912:[[65],256],119913:[[66],256],119914:[[67],256],119915:[[68],256],119916:[[69],256],119917:[[70],256],119918:[[71],256],119919:[[72],256],119920:[[73],256],119921:[[74],256],119922:[[75],256],119923:[[76],256],119924:[[77],256],119925:[[78],256],119926:[[79],256],119927:[[80],256],119928:[[81],256],119929:[[82],256],119930:[[83],256],119931:[[84],256],119932:[[85],256],119933:[[86],256],119934:[[87],256],119935:[[88],256],119936:[[89],256],119937:[[90],256],119938:[[97],256],119939:[[98],256],119940:[[99],256],119941:[[100],256],119942:[[101],256],119943:[[102],256],119944:[[103],256],119945:[[104],256],119946:[[105],256],119947:[[106],256],119948:[[107],256],119949:[[108],256],119950:[[109],256],119951:[[110],256],119952:[[111],256],119953:[[112],256],119954:[[113],256],119955:[[114],256],119956:[[115],256],119957:[[116],256],119958:[[117],256],119959:[[118],256],119960:[[119],256],119961:[[120],256],119962:[[121],256],119963:[[122],256],119964:[[65],256],119966:[[67],256],119967:[[68],256],119970:[[71],256],119973:[[74],256],119974:[[75],256],119977:[[78],256],119978:[[79],256],119979:[[80],256],119980:[[81],256],119982:[[83],256],119983:[[84],256],119984:[[85],256],119985:[[86],256],119986:[[87],256],119987:[[88],256],119988:[[89],256],119989:[[90],256],119990:[[97],256],119991:[[98],256],119992:[[99],256],119993:[[100],256],119995:[[102],256],119997:[[104],256],119998:[[105],256],119999:[[106],256],12e4:[[107],256],120001:[[108],256],120002:[[109],256],120003:[[110],256],120005:[[112],256],120006:[[113],256],120007:[[114],256],120008:[[115],256],120009:[[116],256],120010:[[117],256],120011:[[118],256],120012:[[119],256],120013:[[120],256],120014:[[121],256],120015:[[122],256],120016:[[65],256],120017:[[66],256],120018:[[67],256],120019:[[68],256],120020:[[69],256],120021:[[70],256],120022:[[71],256],120023:[[72],256],120024:[[73],256],120025:[[74],256],120026:[[75],256],120027:[[76],256],120028:[[77],256],120029:[[78],256],120030:[[79],256],120031:[[80],256],120032:[[81],256],120033:[[82],256],120034:[[83],256],120035:[[84],256],120036:[[85],256],120037:[[86],256],120038:[[87],256],120039:[[88],256],120040:[[89],256],120041:[[90],256],120042:[[97],256],120043:[[98],256],120044:[[99],256],120045:[[100],256],120046:[[101],256],120047:[[102],256],120048:[[103],256],120049:[[104],256],120050:[[105],256],120051:[[106],256],120052:[[107],256],120053:[[108],256],120054:[[109],256],120055:[[110],256],120056:[[111],256],120057:[[112],256],120058:[[113],256],120059:[[114],256],120060:[[115],256],120061:[[116],256],120062:[[117],256],120063:[[118],256]},54528:{120064:[[119],256],120065:[[120],256],120066:[[121],256],120067:[[122],256],120068:[[65],256],120069:[[66],256],120071:[[68],256],120072:[[69],256],120073:[[70],256],120074:[[71],256],120077:[[74],256],120078:[[75],256],120079:[[76],256],120080:[[77],256],120081:[[78],256],120082:[[79],256],120083:[[80],256],120084:[[81],256],120086:[[83],256],120087:[[84],256],120088:[[85],256],120089:[[86],256],120090:[[87],256],120091:[[88],256],120092:[[89],256],120094:[[97],256],120095:[[98],256],120096:[[99],256],120097:[[100],256],120098:[[101],256],120099:[[102],256],120100:[[103],256],120101:[[104],256],120102:[[105],256],120103:[[106],256],120104:[[107],256],120105:[[108],256],120106:[[109],256],120107:[[110],256],120108:[[111],256],120109:[[112],256],120110:[[113],256],120111:[[114],256],120112:[[115],256],120113:[[116],256],120114:[[117],256],120115:[[118],256],120116:[[119],256],120117:[[120],256],120118:[[121],256],120119:[[122],256],120120:[[65],256],120121:[[66],256],120123:[[68],256],120124:[[69],256],120125:[[70],256],120126:[[71],256],120128:[[73],256],120129:[[74],256],120130:[[75],256],120131:[[76],256],120132:[[77],256],120134:[[79],256],120138:[[83],256],120139:[[84],256],120140:[[85],256],120141:[[86],256],120142:[[87],256],120143:[[88],256],120144:[[89],256],120146:[[97],256],120147:[[98],256],120148:[[99],256],120149:[[100],256],120150:[[101],256],120151:[[102],256],120152:[[103],256],120153:[[104],256],120154:[[105],256],120155:[[106],256],120156:[[107],256],120157:[[108],256],120158:[[109],256],120159:[[110],256],120160:[[111],256],120161:[[112],256],120162:[[113],256],120163:[[114],256],120164:[[115],256],120165:[[116],256],120166:[[117],256],120167:[[118],256],120168:[[119],256],120169:[[120],256],120170:[[121],256],120171:[[122],256],120172:[[65],256],120173:[[66],256],120174:[[67],256],120175:[[68],256],120176:[[69],256],120177:[[70],256],120178:[[71],256],120179:[[72],256],120180:[[73],256],120181:[[74],256],120182:[[75],256],120183:[[76],256],120184:[[77],256],120185:[[78],256],120186:[[79],256],120187:[[80],256],120188:[[81],256],120189:[[82],256],120190:[[83],256],120191:[[84],256],120192:[[85],256],120193:[[86],256],120194:[[87],256],120195:[[88],256],120196:[[89],256],120197:[[90],256],120198:[[97],256],120199:[[98],256],120200:[[99],256],120201:[[100],256],120202:[[101],256],120203:[[102],256],120204:[[103],256],120205:[[104],256],120206:[[105],256],120207:[[106],256],120208:[[107],256],120209:[[108],256],120210:[[109],256],120211:[[110],256],120212:[[111],256],120213:[[112],256],120214:[[113],256],120215:[[114],256],120216:[[115],256],120217:[[116],256],120218:[[117],256],120219:[[118],256],120220:[[119],256],120221:[[120],256],120222:[[121],256],120223:[[122],256],120224:[[65],256],120225:[[66],256],120226:[[67],256],120227:[[68],256],120228:[[69],256],120229:[[70],256],120230:[[71],256],120231:[[72],256],120232:[[73],256],120233:[[74],256],120234:[[75],256],120235:[[76],256],120236:[[77],256],120237:[[78],256],120238:[[79],256],120239:[[80],256],120240:[[81],256],120241:[[82],256],120242:[[83],256],120243:[[84],256],120244:[[85],256],120245:[[86],256],120246:[[87],256],120247:[[88],256],120248:[[89],256],120249:[[90],256],120250:[[97],256],120251:[[98],256],120252:[[99],256],120253:[[100],256],120254:[[101],256],120255:[[102],256],120256:[[103],256],120257:[[104],256],120258:[[105],256],120259:[[106],256],120260:[[107],256],120261:[[108],256],120262:[[109],256],120263:[[110],256],120264:[[111],256],120265:[[112],256],120266:[[113],256],120267:[[114],256],120268:[[115],256],120269:[[116],256],120270:[[117],256],120271:[[118],256],120272:[[119],256],120273:[[120],256],120274:[[121],256],120275:[[122],256],120276:[[65],256],120277:[[66],256],120278:[[67],256],120279:[[68],256],120280:[[69],256],120281:[[70],256],120282:[[71],256],120283:[[72],256],120284:[[73],256],120285:[[74],256],120286:[[75],256],120287:[[76],256],120288:[[77],256],120289:[[78],256],120290:[[79],256],120291:[[80],256],120292:[[81],256],120293:[[82],256],120294:[[83],256],120295:[[84],256],120296:[[85],256],120297:[[86],256],120298:[[87],256],120299:[[88],256],120300:[[89],256],120301:[[90],256],120302:[[97],256],120303:[[98],256],120304:[[99],256],120305:[[100],256],120306:[[101],256],120307:[[102],256],120308:[[103],256],120309:[[104],256],120310:[[105],256],120311:[[106],256],120312:[[107],256],120313:[[108],256],120314:[[109],256],120315:[[110],256],120316:[[111],256],120317:[[112],256],120318:[[113],256],120319:[[114],256]},54784:{120320:[[115],256],120321:[[116],256],120322:[[117],256],120323:[[118],256],120324:[[119],256],120325:[[120],256],120326:[[121],256],120327:[[122],256],120328:[[65],256],120329:[[66],256],120330:[[67],256],120331:[[68],256],120332:[[69],256],120333:[[70],256],120334:[[71],256],120335:[[72],256],120336:[[73],256],120337:[[74],256],120338:[[75],256],120339:[[76],256],120340:[[77],256],120341:[[78],256],120342:[[79],256],120343:[[80],256],120344:[[81],256],120345:[[82],256],120346:[[83],256],120347:[[84],256],120348:[[85],256],120349:[[86],256],120350:[[87],256],120351:[[88],256],120352:[[89],256],120353:[[90],256],120354:[[97],256],120355:[[98],256],120356:[[99],256],120357:[[100],256],120358:[[101],256],120359:[[102],256],120360:[[103],256],120361:[[104],256],120362:[[105],256],120363:[[106],256],120364:[[107],256],120365:[[108],256],120366:[[109],256],120367:[[110],256],120368:[[111],256],120369:[[112],256],120370:[[113],256],120371:[[114],256],120372:[[115],256],120373:[[116],256],120374:[[117],256],120375:[[118],256],120376:[[119],256],120377:[[120],256],120378:[[121],256],120379:[[122],256],120380:[[65],256],120381:[[66],256],120382:[[67],256],120383:[[68],256],120384:[[69],256],120385:[[70],256],120386:[[71],256],120387:[[72],256],120388:[[73],256],120389:[[74],256],120390:[[75],256],120391:[[76],256],120392:[[77],256],120393:[[78],256],120394:[[79],256],120395:[[80],256],120396:[[81],256],120397:[[82],256],120398:[[83],256],120399:[[84],256],120400:[[85],256],120401:[[86],256],120402:[[87],256],120403:[[88],256],120404:[[89],256],120405:[[90],256],120406:[[97],256],120407:[[98],256],120408:[[99],256],120409:[[100],256],120410:[[101],256],120411:[[102],256],120412:[[103],256],120413:[[104],256],120414:[[105],256],120415:[[106],256],120416:[[107],256],120417:[[108],256],120418:[[109],256],120419:[[110],256],120420:[[111],256],120421:[[112],256],120422:[[113],256],120423:[[114],256],120424:[[115],256],120425:[[116],256],120426:[[117],256],120427:[[118],256],120428:[[119],256],120429:[[120],256],120430:[[121],256],120431:[[122],256],120432:[[65],256],120433:[[66],256],120434:[[67],256],120435:[[68],256],120436:[[69],256],120437:[[70],256],120438:[[71],256],120439:[[72],256],120440:[[73],256],120441:[[74],256],120442:[[75],256],120443:[[76],256],120444:[[77],256],120445:[[78],256],120446:[[79],256],120447:[[80],256],120448:[[81],256],120449:[[82],256],120450:[[83],256],120451:[[84],256],120452:[[85],256],120453:[[86],256],120454:[[87],256],120455:[[88],256],120456:[[89],256],120457:[[90],256],120458:[[97],256],120459:[[98],256],120460:[[99],256],120461:[[100],256],120462:[[101],256],120463:[[102],256],120464:[[103],256],120465:[[104],256],120466:[[105],256],120467:[[106],256],120468:[[107],256],120469:[[108],256],120470:[[109],256],120471:[[110],256],120472:[[111],256],120473:[[112],256],120474:[[113],256],120475:[[114],256],120476:[[115],256],120477:[[116],256],120478:[[117],256],120479:[[118],256],120480:[[119],256],120481:[[120],256],120482:[[121],256],120483:[[122],256],120484:[[305],256],120485:[[567],256],120488:[[913],256],120489:[[914],256],120490:[[915],256],120491:[[916],256],120492:[[917],256],120493:[[918],256],120494:[[919],256],120495:[[920],256],120496:[[921],256],120497:[[922],256],120498:[[923],256],120499:[[924],256],120500:[[925],256],120501:[[926],256],120502:[[927],256],120503:[[928],256],120504:[[929],256],120505:[[1012],256],120506:[[931],256],120507:[[932],256],120508:[[933],256],120509:[[934],256],120510:[[935],256],120511:[[936],256],120512:[[937],256],120513:[[8711],256],120514:[[945],256],120515:[[946],256],120516:[[947],256],120517:[[948],256],120518:[[949],256],120519:[[950],256],120520:[[951],256],120521:[[952],256],120522:[[953],256],120523:[[954],256],120524:[[955],256],120525:[[956],256],120526:[[957],256],120527:[[958],256],120528:[[959],256],120529:[[960],256],120530:[[961],256],120531:[[962],256],120532:[[963],256],120533:[[964],256],120534:[[965],256],120535:[[966],256],120536:[[967],256],120537:[[968],256],120538:[[969],256],120539:[[8706],256],120540:[[1013],256],120541:[[977],256],120542:[[1008],256],120543:[[981],256],120544:[[1009],256],120545:[[982],256],120546:[[913],256],120547:[[914],256],120548:[[915],256],120549:[[916],256],120550:[[917],256],120551:[[918],256],120552:[[919],256],120553:[[920],256],120554:[[921],256],120555:[[922],256],120556:[[923],256],120557:[[924],256],120558:[[925],256],120559:[[926],256],120560:[[927],256],120561:[[928],256],120562:[[929],256],120563:[[1012],256],120564:[[931],256],120565:[[932],256],120566:[[933],256],120567:[[934],256],120568:[[935],256],120569:[[936],256],120570:[[937],256],120571:[[8711],256],120572:[[945],256],120573:[[946],256],120574:[[947],256],120575:[[948],256]},55040:{120576:[[949],256],120577:[[950],256],120578:[[951],256],120579:[[952],256],120580:[[953],256],120581:[[954],256],120582:[[955],256],120583:[[956],256],120584:[[957],256],120585:[[958],256],120586:[[959],256],120587:[[960],256],120588:[[961],256],120589:[[962],256],120590:[[963],256],120591:[[964],256],120592:[[965],256],120593:[[966],256],120594:[[967],256],120595:[[968],256],120596:[[969],256],120597:[[8706],256],120598:[[1013],256],120599:[[977],256],120600:[[1008],256],120601:[[981],256],120602:[[1009],256],120603:[[982],256],120604:[[913],256],120605:[[914],256],120606:[[915],256],120607:[[916],256],120608:[[917],256],120609:[[918],256],120610:[[919],256],120611:[[920],256],120612:[[921],256],120613:[[922],256],120614:[[923],256],120615:[[924],256],120616:[[925],256],120617:[[926],256],120618:[[927],256],120619:[[928],256],120620:[[929],256],120621:[[1012],256],120622:[[931],256],120623:[[932],256],120624:[[933],256],120625:[[934],256],120626:[[935],256],120627:[[936],256],120628:[[937],256],120629:[[8711],256],120630:[[945],256],120631:[[946],256],120632:[[947],256],120633:[[948],256],120634:[[949],256],120635:[[950],256],120636:[[951],256],120637:[[952],256],120638:[[953],256],120639:[[954],256],120640:[[955],256],120641:[[956],256],120642:[[957],256],120643:[[958],256],120644:[[959],256],120645:[[960],256],120646:[[961],256],120647:[[962],256],120648:[[963],256],120649:[[964],256],120650:[[965],256],120651:[[966],256],120652:[[967],256],120653:[[968],256],120654:[[969],256],120655:[[8706],256],120656:[[1013],256],120657:[[977],256],120658:[[1008],256],120659:[[981],256],120660:[[1009],256],120661:[[982],256],120662:[[913],256],120663:[[914],256],120664:[[915],256],120665:[[916],256],120666:[[917],256],120667:[[918],256],120668:[[919],256],120669:[[920],256],120670:[[921],256],120671:[[922],256],120672:[[923],256],120673:[[924],256],120674:[[925],256],120675:[[926],256],120676:[[927],256],120677:[[928],256],120678:[[929],256],120679:[[1012],256],120680:[[931],256],120681:[[932],256],120682:[[933],256],120683:[[934],256],120684:[[935],256],120685:[[936],256],120686:[[937],256],120687:[[8711],256],120688:[[945],256],120689:[[946],256],120690:[[947],256],120691:[[948],256],120692:[[949],256],120693:[[950],256],120694:[[951],256],120695:[[952],256],120696:[[953],256],120697:[[954],256],120698:[[955],256],120699:[[956],256],120700:[[957],256],120701:[[958],256],120702:[[959],256],120703:[[960],256],120704:[[961],256],120705:[[962],256],120706:[[963],256],120707:[[964],256],120708:[[965],256],120709:[[966],256],120710:[[967],256],120711:[[968],256],120712:[[969],256],120713:[[8706],256],120714:[[1013],256],120715:[[977],256],120716:[[1008],256],120717:[[981],256],120718:[[1009],256],120719:[[982],256],120720:[[913],256],120721:[[914],256],120722:[[915],256],120723:[[916],256],120724:[[917],256],120725:[[918],256],120726:[[919],256],120727:[[920],256],120728:[[921],256],120729:[[922],256],120730:[[923],256],120731:[[924],256],120732:[[925],256],120733:[[926],256],120734:[[927],256],120735:[[928],256],120736:[[929],256],120737:[[1012],256],120738:[[931],256],120739:[[932],256],120740:[[933],256],120741:[[934],256],120742:[[935],256],120743:[[936],256],120744:[[937],256],120745:[[8711],256],120746:[[945],256],120747:[[946],256],120748:[[947],256],120749:[[948],256],120750:[[949],256],120751:[[950],256],120752:[[951],256],120753:[[952],256],120754:[[953],256],120755:[[954],256],120756:[[955],256],120757:[[956],256],120758:[[957],256],120759:[[958],256],120760:[[959],256],120761:[[960],256],120762:[[961],256],120763:[[962],256],120764:[[963],256],120765:[[964],256],120766:[[965],256],120767:[[966],256],120768:[[967],256],120769:[[968],256],120770:[[969],256],120771:[[8706],256],120772:[[1013],256],120773:[[977],256],120774:[[1008],256],120775:[[981],256],120776:[[1009],256],120777:[[982],256],120778:[[988],256],120779:[[989],256],120782:[[48],256],120783:[[49],256],120784:[[50],256],120785:[[51],256],120786:[[52],256],120787:[[53],256],120788:[[54],256],120789:[[55],256],120790:[[56],256],120791:[[57],256],120792:[[48],256],120793:[[49],256],120794:[[50],256],120795:[[51],256],120796:[[52],256],120797:[[53],256],120798:[[54],256],120799:[[55],256],120800:[[56],256],120801:[[57],256],120802:[[48],256],120803:[[49],256],120804:[[50],256],120805:[[51],256],120806:[[52],256],120807:[[53],256],120808:[[54],256],120809:[[55],256],120810:[[56],256],120811:[[57],256],120812:[[48],256],120813:[[49],256],120814:[[50],256],120815:[[51],256],120816:[[52],256],120817:[[53],256],120818:[[54],256],120819:[[55],256],120820:[[56],256],120821:[[57],256],120822:[[48],256],120823:[[49],256],120824:[[50],256],120825:[[51],256],120826:[[52],256],120827:[[53],256],120828:[[54],256],120829:[[55],256],120830:[[56],256],120831:[[57],256]},59392:{125136:[,220],125137:[,220],125138:[,220],125139:[,220],125140:[,220],125141:[,220],125142:[,220]},60928:{126464:[[1575],256],126465:[[1576],256],126466:[[1580],256],126467:[[1583],256],126469:[[1608],256],126470:[[1586],256],126471:[[1581],256],126472:[[1591],256],126473:[[1610],256],126474:[[1603],256],126475:[[1604],256],126476:[[1605],256],126477:[[1606],256],126478:[[1587],256],126479:[[1593],256],126480:[[1601],256],126481:[[1589],256],126482:[[1602],256],126483:[[1585],256],126484:[[1588],256],126485:[[1578],256],126486:[[1579],256],126487:[[1582],256],126488:[[1584],256],126489:[[1590],256],126490:[[1592],256],126491:[[1594],256],126492:[[1646],256],126493:[[1722],256],126494:[[1697],256],126495:[[1647],256],126497:[[1576],256],126498:[[1580],256],126500:[[1607],256],126503:[[1581],256],126505:[[1610],256],126506:[[1603],256],126507:[[1604],256],126508:[[1605],256],126509:[[1606],256],126510:[[1587],256],126511:[[1593],256],126512:[[1601],256],126513:[[1589],256],126514:[[1602],256],126516:[[1588],256],126517:[[1578],256],126518:[[1579],256],126519:[[1582],256],126521:[[1590],256],126523:[[1594],256],126530:[[1580],256],126535:[[1581],256],126537:[[1610],256],126539:[[1604],256],126541:[[1606],256],126542:[[1587],256],126543:[[1593],256],126545:[[1589],256],126546:[[1602],256],126548:[[1588],256],126551:[[1582],256],126553:[[1590],256],126555:[[1594],256],126557:[[1722],256],126559:[[1647],256],126561:[[1576],256],126562:[[1580],256],126564:[[1607],256],126567:[[1581],256],126568:[[1591],256],126569:[[1610],256],126570:[[1603],256],126572:[[1605],256],126573:[[1606],256],126574:[[1587],256],126575:[[1593],256],126576:[[1601],256],126577:[[1589],256],126578:[[1602],256],126580:[[1588],256],126581:[[1578],256],126582:[[1579],256],126583:[[1582],256],126585:[[1590],256],126586:[[1592],256],126587:[[1594],256],126588:[[1646],256],126590:[[1697],256],126592:[[1575],256],126593:[[1576],256],126594:[[1580],256],126595:[[1583],256],126596:[[1607],256],126597:[[1608],256],126598:[[1586],256],126599:[[1581],256],126600:[[1591],256],126601:[[1610],256],126603:[[1604],256],126604:[[1605],256],126605:[[1606],256],126606:[[1587],256],126607:[[1593],256],126608:[[1601],256],126609:[[1589],256],126610:[[1602],256],126611:[[1585],256],126612:[[1588],256],126613:[[1578],256],126614:[[1579],256],126615:[[1582],256],126616:[[1584],256],126617:[[1590],256],126618:[[1592],256],126619:[[1594],256],126625:[[1576],256],126626:[[1580],256],126627:[[1583],256],126629:[[1608],256],126630:[[1586],256],126631:[[1581],256],126632:[[1591],256],126633:[[1610],256],126635:[[1604],256],126636:[[1605],256],126637:[[1606],256],126638:[[1587],256],126639:[[1593],256],126640:[[1601],256],126641:[[1589],256],126642:[[1602],256],126643:[[1585],256],126644:[[1588],256],126645:[[1578],256],126646:[[1579],256],126647:[[1582],256],126648:[[1584],256],126649:[[1590],256],126650:[[1592],256],126651:[[1594],256]},61696:{127232:[[48,46],256],127233:[[48,44],256],127234:[[49,44],256],127235:[[50,44],256],127236:[[51,44],256],127237:[[52,44],256],127238:[[53,44],256],127239:[[54,44],256],127240:[[55,44],256],127241:[[56,44],256],127242:[[57,44],256],127248:[[40,65,41],256],127249:[[40,66,41],256],127250:[[40,67,41],256],127251:[[40,68,41],256],127252:[[40,69,41],256],127253:[[40,70,41],256],127254:[[40,71,41],256],127255:[[40,72,41],256],127256:[[40,73,41],256],127257:[[40,74,41],256],127258:[[40,75,41],256],127259:[[40,76,41],256],127260:[[40,77,41],256],127261:[[40,78,41],256],127262:[[40,79,41],256],127263:[[40,80,41],256],127264:[[40,81,41],256],127265:[[40,82,41],256],127266:[[40,83,41],256],127267:[[40,84,41],256],127268:[[40,85,41],256],127269:[[40,86,41],256],127270:[[40,87,41],256],127271:[[40,88,41],256],127272:[[40,89,41],256],127273:[[40,90,41],256],127274:[[12308,83,12309],256],127275:[[67],256],127276:[[82],256],127277:[[67,68],256],127278:[[87,90],256],127280:[[65],256],127281:[[66],256],127282:[[67],256],127283:[[68],256],127284:[[69],256],127285:[[70],256],127286:[[71],256],127287:[[72],256],127288:[[73],256],127289:[[74],256],127290:[[75],256],127291:[[76],256],127292:[[77],256],127293:[[78],256],127294:[[79],256],127295:[[80],256],127296:[[81],256],127297:[[82],256],127298:[[83],256],127299:[[84],256],127300:[[85],256],127301:[[86],256],127302:[[87],256],127303:[[88],256],127304:[[89],256],127305:[[90],256],127306:[[72,86],256],127307:[[77,86],256],127308:[[83,68],256],127309:[[83,83],256],127310:[[80,80,86],256],127311:[[87,67],256],127338:[[77,67],256],127339:[[77,68],256],127376:[[68,74],256]},61952:{127488:[[12411,12363],256],127489:[[12467,12467],256],127490:[[12469],256],127504:[[25163],256],127505:[[23383],256],127506:[[21452],256],127507:[[12487],256],127508:[[20108],256],127509:[[22810],256],127510:[[35299],256],127511:[[22825],256],127512:[[20132],256],127513:[[26144],256],127514:[[28961],256],127515:[[26009],256],127516:[[21069],256],127517:[[24460],256],127518:[[20877],256],127519:[[26032],256],127520:[[21021],256],127521:[[32066],256],127522:[[29983],256],127523:[[36009],256],127524:[[22768],256],127525:[[21561],256],127526:[[28436],256],127527:[[25237],256],127528:[[25429],256],127529:[[19968],256],127530:[[19977],256],127531:[[36938],256],127532:[[24038],256],127533:[[20013],256],127534:[[21491],256],127535:[[25351],256],127536:[[36208],256],127537:[[25171],256],127538:[[31105],256],127539:[[31354],256],127540:[[21512],256],127541:[[28288],256],127542:[[26377],256],127543:[[26376],256],127544:[[30003],256],127545:[[21106],256],127546:[[21942],256],127552:[[12308,26412,12309],256],127553:[[12308,19977,12309],256],127554:[[12308,20108,12309],256],127555:[[12308,23433,12309],256],127556:[[12308,28857,12309],256],127557:[[12308,25171,12309],256],127558:[[12308,30423,12309],256],127559:[[12308,21213,12309],256],127560:[[12308,25943,12309],256],127568:[[24471],256],127569:[[21487],256]},63488:{194560:[[20029]],194561:[[20024]],194562:[[20033]],194563:[[131362]],194564:[[20320]],194565:[[20398]],194566:[[20411]],194567:[[20482]],194568:[[20602]],194569:[[20633]],194570:[[20711]],194571:[[20687]],194572:[[13470]],194573:[[132666]],194574:[[20813]],194575:[[20820]],194576:[[20836]],194577:[[20855]],194578:[[132380]],194579:[[13497]],194580:[[20839]],194581:[[20877]],194582:[[132427]],194583:[[20887]],194584:[[20900]],194585:[[20172]],194586:[[20908]],194587:[[20917]],194588:[[168415]],194589:[[20981]],194590:[[20995]],194591:[[13535]],194592:[[21051]],194593:[[21062]],194594:[[21106]],194595:[[21111]],194596:[[13589]],194597:[[21191]],194598:[[21193]],194599:[[21220]],194600:[[21242]],194601:[[21253]],194602:[[21254]],194603:[[21271]],194604:[[21321]],194605:[[21329]],194606:[[21338]],194607:[[21363]],194608:[[21373]],194609:[[21375]],194610:[[21375]],194611:[[21375]],194612:[[133676]],194613:[[28784]],194614:[[21450]],194615:[[21471]],194616:[[133987]],194617:[[21483]],194618:[[21489]],194619:[[21510]],194620:[[21662]],194621:[[21560]],194622:[[21576]],194623:[[21608]],194624:[[21666]],194625:[[21750]],194626:[[21776]],194627:[[21843]],194628:[[21859]],194629:[[21892]],194630:[[21892]],194631:[[21913]],194632:[[21931]],194633:[[21939]],194634:[[21954]],194635:[[22294]],194636:[[22022]],194637:[[22295]],194638:[[22097]],194639:[[22132]],194640:[[20999]],194641:[[22766]],194642:[[22478]],194643:[[22516]],194644:[[22541]],194645:[[22411]],194646:[[22578]],194647:[[22577]],194648:[[22700]],194649:[[136420]],194650:[[22770]],194651:[[22775]],194652:[[22790]],194653:[[22810]],194654:[[22818]],194655:[[22882]],194656:[[136872]],194657:[[136938]],194658:[[23020]],194659:[[23067]],194660:[[23079]],194661:[[23e3]],194662:[[23142]],194663:[[14062]],194664:[[14076]],194665:[[23304]],194666:[[23358]],194667:[[23358]],194668:[[137672]],194669:[[23491]],194670:[[23512]],194671:[[23527]],194672:[[23539]],194673:[[138008]],194674:[[23551]],194675:[[23558]],194676:[[24403]],194677:[[23586]],194678:[[14209]],194679:[[23648]],194680:[[23662]],194681:[[23744]],194682:[[23693]],194683:[[138724]],194684:[[23875]],194685:[[138726]],194686:[[23918]],194687:[[23915]],194688:[[23932]],194689:[[24033]],194690:[[24034]],194691:[[14383]],194692:[[24061]],194693:[[24104]],194694:[[24125]],194695:[[24169]],194696:[[14434]],194697:[[139651]],194698:[[14460]],194699:[[24240]],194700:[[24243]],194701:[[24246]],194702:[[24266]],194703:[[172946]],194704:[[24318]],194705:[[140081]],194706:[[140081]],194707:[[33281]],194708:[[24354]],194709:[[24354]],194710:[[14535]],194711:[[144056]],194712:[[156122]],194713:[[24418]],194714:[[24427]],194715:[[14563]],194716:[[24474]],194717:[[24525]],194718:[[24535]],194719:[[24569]],194720:[[24705]],194721:[[14650]],194722:[[14620]],194723:[[24724]],194724:[[141012]],194725:[[24775]],194726:[[24904]],194727:[[24908]],194728:[[24910]],194729:[[24908]],194730:[[24954]],194731:[[24974]],194732:[[25010]],194733:[[24996]],194734:[[25007]],194735:[[25054]],194736:[[25074]],194737:[[25078]],194738:[[25104]],194739:[[25115]],194740:[[25181]],194741:[[25265]],194742:[[25300]],194743:[[25424]],194744:[[142092]],194745:[[25405]],194746:[[25340]],194747:[[25448]],194748:[[25475]],194749:[[25572]],194750:[[142321]],194751:[[25634]],194752:[[25541]],194753:[[25513]],194754:[[14894]],194755:[[25705]],194756:[[25726]],194757:[[25757]],194758:[[25719]],194759:[[14956]],194760:[[25935]],194761:[[25964]],194762:[[143370]],194763:[[26083]],194764:[[26360]],194765:[[26185]],194766:[[15129]],194767:[[26257]],194768:[[15112]],194769:[[15076]],194770:[[20882]],194771:[[20885]],194772:[[26368]],194773:[[26268]],194774:[[32941]],194775:[[17369]],194776:[[26391]],194777:[[26395]],194778:[[26401]],194779:[[26462]],194780:[[26451]],194781:[[144323]],194782:[[15177]],194783:[[26618]],194784:[[26501]],194785:[[26706]],194786:[[26757]],194787:[[144493]],194788:[[26766]],194789:[[26655]],194790:[[26900]],194791:[[15261]],194792:[[26946]],194793:[[27043]],194794:[[27114]],194795:[[27304]],194796:[[145059]],194797:[[27355]],194798:[[15384]],194799:[[27425]],194800:[[145575]],194801:[[27476]],194802:[[15438]],194803:[[27506]],194804:[[27551]],194805:[[27578]],194806:[[27579]],194807:[[146061]],194808:[[138507]],194809:[[146170]],194810:[[27726]],194811:[[146620]],194812:[[27839]],194813:[[27853]],194814:[[27751]],194815:[[27926]]},63744:{63744:[[35912]],63745:[[26356]],63746:[[36554]],63747:[[36040]],63748:[[28369]],63749:[[20018]],63750:[[21477]],63751:[[40860]],63752:[[40860]],63753:[[22865]],63754:[[37329]],63755:[[21895]],63756:[[22856]],63757:[[25078]],63758:[[30313]],63759:[[32645]],63760:[[34367]],63761:[[34746]],63762:[[35064]],63763:[[37007]],63764:[[27138]],63765:[[27931]],63766:[[28889]],63767:[[29662]],63768:[[33853]],63769:[[37226]],63770:[[39409]],63771:[[20098]],63772:[[21365]],63773:[[27396]],63774:[[29211]],63775:[[34349]],63776:[[40478]],63777:[[23888]],63778:[[28651]],63779:[[34253]],63780:[[35172]],63781:[[25289]],63782:[[33240]],63783:[[34847]],63784:[[24266]],63785:[[26391]],63786:[[28010]],63787:[[29436]],63788:[[37070]],63789:[[20358]],63790:[[20919]],63791:[[21214]],63792:[[25796]],63793:[[27347]],63794:[[29200]],63795:[[30439]],63796:[[32769]],63797:[[34310]],63798:[[34396]],63799:[[36335]],63800:[[38706]],63801:[[39791]],63802:[[40442]],63803:[[30860]],63804:[[31103]],63805:[[32160]],63806:[[33737]],63807:[[37636]],63808:[[40575]],63809:[[35542]],63810:[[22751]],63811:[[24324]],63812:[[31840]],63813:[[32894]],63814:[[29282]],63815:[[30922]],63816:[[36034]],63817:[[38647]],63818:[[22744]],63819:[[23650]],63820:[[27155]],63821:[[28122]],63822:[[28431]],63823:[[32047]],63824:[[32311]],63825:[[38475]],63826:[[21202]],63827:[[32907]],63828:[[20956]],63829:[[20940]],63830:[[31260]],63831:[[32190]],63832:[[33777]],63833:[[38517]],63834:[[35712]],63835:[[25295]],63836:[[27138]],63837:[[35582]],63838:[[20025]],63839:[[23527]],63840:[[24594]],63841:[[29575]],63842:[[30064]],63843:[[21271]],63844:[[30971]],63845:[[20415]],63846:[[24489]],63847:[[19981]],63848:[[27852]],63849:[[25976]],63850:[[32034]],63851:[[21443]],63852:[[22622]],63853:[[30465]],63854:[[33865]],63855:[[35498]],63856:[[27578]],63857:[[36784]],63858:[[27784]],63859:[[25342]],63860:[[33509]],63861:[[25504]],63862:[[30053]],63863:[[20142]],63864:[[20841]],63865:[[20937]],63866:[[26753]],63867:[[31975]],63868:[[33391]],63869:[[35538]],63870:[[37327]],63871:[[21237]],63872:[[21570]],63873:[[22899]],63874:[[24300]],63875:[[26053]],63876:[[28670]],63877:[[31018]],63878:[[38317]],63879:[[39530]],63880:[[40599]],63881:[[40654]],63882:[[21147]],63883:[[26310]],63884:[[27511]],63885:[[36706]],63886:[[24180]],63887:[[24976]],63888:[[25088]],63889:[[25754]],63890:[[28451]],63891:[[29001]],63892:[[29833]],63893:[[31178]],63894:[[32244]],63895:[[32879]],63896:[[36646]],63897:[[34030]],63898:[[36899]],63899:[[37706]],63900:[[21015]],63901:[[21155]],63902:[[21693]],63903:[[28872]],63904:[[35010]],63905:[[35498]],63906:[[24265]],63907:[[24565]],63908:[[25467]],63909:[[27566]],63910:[[31806]],63911:[[29557]],63912:[[20196]],63913:[[22265]],63914:[[23527]],63915:[[23994]],63916:[[24604]],63917:[[29618]],63918:[[29801]],63919:[[32666]],63920:[[32838]],63921:[[37428]],63922:[[38646]],63923:[[38728]],63924:[[38936]],63925:[[20363]],63926:[[31150]],63927:[[37300]],63928:[[38584]],63929:[[24801]],63930:[[20102]],63931:[[20698]],63932:[[23534]],63933:[[23615]],63934:[[26009]],63935:[[27138]],63936:[[29134]],63937:[[30274]],63938:[[34044]],63939:[[36988]],63940:[[40845]],63941:[[26248]],63942:[[38446]],63943:[[21129]],63944:[[26491]],63945:[[26611]],63946:[[27969]],63947:[[28316]],63948:[[29705]],63949:[[30041]],63950:[[30827]],63951:[[32016]],63952:[[39006]],63953:[[20845]],63954:[[25134]],63955:[[38520]],63956:[[20523]],63957:[[23833]],63958:[[28138]],63959:[[36650]],63960:[[24459]],63961:[[24900]],63962:[[26647]],63963:[[29575]],63964:[[38534]],63965:[[21033]],63966:[[21519]],63967:[[23653]],63968:[[26131]],63969:[[26446]],63970:[[26792]],63971:[[27877]],63972:[[29702]],63973:[[30178]],63974:[[32633]],63975:[[35023]],63976:[[35041]],63977:[[37324]],63978:[[38626]],63979:[[21311]],63980:[[28346]],63981:[[21533]],63982:[[29136]],63983:[[29848]],63984:[[34298]],63985:[[38563]],63986:[[40023]],63987:[[40607]],63988:[[26519]],63989:[[28107]],63990:[[33256]],63991:[[31435]],63992:[[31520]],63993:[[31890]],63994:[[29376]],63995:[[28825]],63996:[[35672]],63997:[[20160]],63998:[[33590]],63999:[[21050]],194816:[[27966]],194817:[[28023]],194818:[[27969]],194819:[[28009]],194820:[[28024]],194821:[[28037]],194822:[[146718]],194823:[[27956]],194824:[[28207]],194825:[[28270]],194826:[[15667]],194827:[[28363]],194828:[[28359]],194829:[[147153]],194830:[[28153]],194831:[[28526]],194832:[[147294]],194833:[[147342]],194834:[[28614]],194835:[[28729]],194836:[[28702]],194837:[[28699]],194838:[[15766]],194839:[[28746]],194840:[[28797]],194841:[[28791]],194842:[[28845]],194843:[[132389]],194844:[[28997]],194845:[[148067]],194846:[[29084]],194847:[[148395]],194848:[[29224]],194849:[[29237]],194850:[[29264]],194851:[[149e3]],194852:[[29312]],194853:[[29333]],194854:[[149301]],194855:[[149524]],194856:[[29562]],194857:[[29579]],194858:[[16044]],194859:[[29605]],194860:[[16056]],194861:[[16056]],194862:[[29767]],194863:[[29788]],194864:[[29809]],194865:[[29829]],194866:[[29898]],194867:[[16155]],194868:[[29988]],194869:[[150582]],194870:[[30014]],194871:[[150674]],194872:[[30064]],194873:[[139679]],194874:[[30224]],194875:[[151457]],194876:[[151480]],194877:[[151620]],194878:[[16380]],194879:[[16392]],194880:[[30452]],194881:[[151795]],194882:[[151794]],194883:[[151833]],194884:[[151859]],194885:[[30494]],194886:[[30495]],194887:[[30495]],194888:[[30538]],194889:[[16441]],194890:[[30603]],194891:[[16454]],194892:[[16534]],194893:[[152605]],194894:[[30798]],194895:[[30860]],194896:[[30924]],194897:[[16611]],194898:[[153126]],194899:[[31062]],194900:[[153242]],194901:[[153285]],194902:[[31119]],194903:[[31211]],194904:[[16687]],194905:[[31296]],194906:[[31306]],194907:[[31311]],194908:[[153980]],194909:[[154279]],194910:[[154279]],194911:[[31470]],194912:[[16898]],194913:[[154539]],194914:[[31686]],194915:[[31689]],194916:[[16935]],194917:[[154752]],194918:[[31954]],194919:[[17056]],194920:[[31976]],194921:[[31971]],194922:[[32e3]],194923:[[155526]],194924:[[32099]],194925:[[17153]],194926:[[32199]],194927:[[32258]],194928:[[32325]],194929:[[17204]],194930:[[156200]],194931:[[156231]],194932:[[17241]],194933:[[156377]],194934:[[32634]],194935:[[156478]],194936:[[32661]],194937:[[32762]],194938:[[32773]],194939:[[156890]],194940:[[156963]],194941:[[32864]],194942:[[157096]],194943:[[32880]],194944:[[144223]],194945:[[17365]],194946:[[32946]],194947:[[33027]],194948:[[17419]],194949:[[33086]],194950:[[23221]],194951:[[157607]],194952:[[157621]],194953:[[144275]],194954:[[144284]],194955:[[33281]],194956:[[33284]],194957:[[36766]],194958:[[17515]],194959:[[33425]],194960:[[33419]],194961:[[33437]],194962:[[21171]],194963:[[33457]],194964:[[33459]],194965:[[33469]],194966:[[33510]],194967:[[158524]],194968:[[33509]],194969:[[33565]],194970:[[33635]],194971:[[33709]],194972:[[33571]],194973:[[33725]],194974:[[33767]],194975:[[33879]],194976:[[33619]],194977:[[33738]],194978:[[33740]],194979:[[33756]],194980:[[158774]],194981:[[159083]],194982:[[158933]],194983:[[17707]],194984:[[34033]],194985:[[34035]],194986:[[34070]],194987:[[160714]],194988:[[34148]],194989:[[159532]],194990:[[17757]],194991:[[17761]],194992:[[159665]],194993:[[159954]],194994:[[17771]],194995:[[34384]],194996:[[34396]],194997:[[34407]],194998:[[34409]],194999:[[34473]],195e3:[[34440]],195001:[[34574]],195002:[[34530]],195003:[[34681]],195004:[[34600]],195005:[[34667]],195006:[[34694]],195007:[[17879]],195008:[[34785]],195009:[[34817]],195010:[[17913]],195011:[[34912]],195012:[[34915]],195013:[[161383]],195014:[[35031]],195015:[[35038]],195016:[[17973]],195017:[[35066]],195018:[[13499]],195019:[[161966]],195020:[[162150]],195021:[[18110]],195022:[[18119]],195023:[[35488]],195024:[[35565]],195025:[[35722]],195026:[[35925]],195027:[[162984]],195028:[[36011]],195029:[[36033]],195030:[[36123]],195031:[[36215]],195032:[[163631]],195033:[[133124]],195034:[[36299]],195035:[[36284]],195036:[[36336]],195037:[[133342]],195038:[[36564]],195039:[[36664]],195040:[[165330]],195041:[[165357]],195042:[[37012]],195043:[[37105]],195044:[[37137]],195045:[[165678]],195046:[[37147]],195047:[[37432]],195048:[[37591]],195049:[[37592]],195050:[[37500]],195051:[[37881]],195052:[[37909]],195053:[[166906]],195054:[[38283]],195055:[[18837]],195056:[[38327]],195057:[[167287]],195058:[[18918]],195059:[[38595]],195060:[[23986]],195061:[[38691]],195062:[[168261]],195063:[[168474]],195064:[[19054]],195065:[[19062]],195066:[[38880]],195067:[[168970]],195068:[[19122]],195069:[[169110]],195070:[[38923]],195071:[[38923]]},64e3:{64e3:[[20999]],64001:[[24230]],64002:[[25299]],64003:[[31958]],64004:[[23429]],64005:[[27934]],64006:[[26292]],64007:[[36667]],64008:[[34892]],64009:[[38477]],64010:[[35211]],64011:[[24275]],64012:[[20800]],64013:[[21952]],64016:[[22618]],64018:[[26228]],64021:[[20958]],64022:[[29482]],64023:[[30410]],64024:[[31036]],64025:[[31070]],64026:[[31077]],64027:[[31119]],64028:[[38742]],64029:[[31934]],64030:[[32701]],64032:[[34322]],64034:[[35576]],64037:[[36920]],64038:[[37117]],64042:[[39151]],64043:[[39164]],64044:[[39208]],64045:[[40372]],64046:[[37086]],64047:[[38583]],64048:[[20398]],64049:[[20711]],64050:[[20813]],64051:[[21193]],64052:[[21220]],64053:[[21329]],64054:[[21917]],64055:[[22022]],64056:[[22120]],64057:[[22592]],64058:[[22696]],64059:[[23652]],64060:[[23662]],64061:[[24724]],64062:[[24936]],64063:[[24974]],64064:[[25074]],64065:[[25935]],64066:[[26082]],64067:[[26257]],64068:[[26757]],64069:[[28023]],64070:[[28186]],64071:[[28450]],64072:[[29038]],64073:[[29227]],64074:[[29730]],64075:[[30865]],64076:[[31038]],64077:[[31049]],64078:[[31048]],64079:[[31056]],64080:[[31062]],64081:[[31069]],64082:[[31117]],64083:[[31118]],64084:[[31296]],64085:[[31361]],64086:[[31680]],64087:[[32244]],64088:[[32265]],64089:[[32321]],64090:[[32626]],64091:[[32773]],64092:[[33261]],64093:[[33401]],64094:[[33401]],64095:[[33879]],64096:[[35088]],64097:[[35222]],64098:[[35585]],64099:[[35641]],64100:[[36051]],64101:[[36104]],64102:[[36790]],64103:[[36920]],64104:[[38627]],64105:[[38911]],64106:[[38971]],64107:[[24693]],64108:[[148206]],64109:[[33304]],64112:[[20006]],64113:[[20917]],64114:[[20840]],64115:[[20352]],64116:[[20805]],64117:[[20864]],64118:[[21191]],64119:[[21242]],64120:[[21917]],64121:[[21845]],64122:[[21913]],64123:[[21986]],64124:[[22618]],64125:[[22707]],64126:[[22852]],64127:[[22868]],64128:[[23138]],64129:[[23336]],64130:[[24274]],64131:[[24281]],64132:[[24425]],64133:[[24493]],64134:[[24792]],64135:[[24910]],64136:[[24840]],64137:[[24974]],64138:[[24928]],64139:[[25074]],64140:[[25140]],64141:[[25540]],64142:[[25628]],64143:[[25682]],64144:[[25942]],64145:[[26228]],64146:[[26391]],64147:[[26395]],64148:[[26454]],64149:[[27513]],64150:[[27578]],64151:[[27969]],64152:[[28379]],64153:[[28363]],64154:[[28450]],64155:[[28702]],64156:[[29038]],64157:[[30631]],64158:[[29237]],64159:[[29359]],64160:[[29482]],64161:[[29809]],64162:[[29958]],64163:[[30011]],64164:[[30237]],64165:[[30239]],64166:[[30410]],64167:[[30427]],64168:[[30452]],64169:[[30538]],64170:[[30528]],64171:[[30924]],64172:[[31409]],64173:[[31680]],64174:[[31867]],64175:[[32091]],64176:[[32244]],64177:[[32574]],64178:[[32773]],64179:[[33618]],64180:[[33775]],64181:[[34681]],64182:[[35137]],64183:[[35206]],64184:[[35222]],64185:[[35519]],64186:[[35576]],64187:[[35531]],64188:[[35585]],64189:[[35582]],64190:[[35565]],64191:[[35641]],64192:[[35722]],64193:[[36104]],64194:[[36664]],64195:[[36978]],64196:[[37273]],64197:[[37494]],64198:[[38524]],64199:[[38627]],64200:[[38742]],64201:[[38875]],64202:[[38911]],64203:[[38923]],64204:[[38971]],64205:[[39698]],64206:[[40860]],64207:[[141386]],64208:[[141380]],64209:[[144341]],64210:[[15261]],64211:[[16408]],64212:[[16441]],64213:[[152137]],64214:[[154832]],64215:[[163539]],64216:[[40771]],64217:[[40846]],195072:[[38953]],195073:[[169398]],195074:[[39138]],195075:[[19251]],195076:[[39209]],195077:[[39335]],195078:[[39362]],195079:[[39422]],195080:[[19406]],195081:[[170800]],195082:[[39698]],195083:[[4e4]],195084:[[40189]],195085:[[19662]],195086:[[19693]],195087:[[40295]],195088:[[172238]],195089:[[19704]],195090:[[172293]],195091:[[172558]],195092:[[172689]],195093:[[40635]],195094:[[19798]],195095:[[40697]],195096:[[40702]],195097:[[40709]],195098:[[40719]],195099:[[40726]],195100:[[40763]],195101:[[173568]]},64256:{64256:[[102,102],256],64257:[[102,105],256],64258:[[102,108],256],64259:[[102,102,105],256],64260:[[102,102,108],256],64261:[[383,116],256],64262:[[115,116],256],64275:[[1396,1398],256],64276:[[1396,1381],256],64277:[[1396,1387],256],64278:[[1406,1398],256],64279:[[1396,1389],256],64285:[[1497,1460],512],64286:[,26],64287:[[1522,1463],512],64288:[[1506],256],64289:[[1488],256],64290:[[1491],256],64291:[[1492],256],64292:[[1499],256],64293:[[1500],256],64294:[[1501],256],64295:[[1512],256],64296:[[1514],256],64297:[[43],256],64298:[[1513,1473],512],64299:[[1513,1474],512],64300:[[64329,1473],512],64301:[[64329,1474],512],64302:[[1488,1463],512],64303:[[1488,1464],512],64304:[[1488,1468],512],64305:[[1489,1468],512],64306:[[1490,1468],512],64307:[[1491,1468],512],64308:[[1492,1468],512],64309:[[1493,1468],512],64310:[[1494,1468],512],64312:[[1496,1468],512],64313:[[1497,1468],512],64314:[[1498,1468],512],64315:[[1499,1468],512],64316:[[1500,1468],512],64318:[[1502,1468],512],64320:[[1504,1468],512],64321:[[1505,1468],512],64323:[[1507,1468],512],64324:[[1508,1468],512],64326:[[1510,1468],512],64327:[[1511,1468],512],64328:[[1512,1468],512],64329:[[1513,1468],512],64330:[[1514,1468],512],64331:[[1493,1465],512],64332:[[1489,1471],512],64333:[[1499,1471],512],64334:[[1508,1471],512],64335:[[1488,1500],256],64336:[[1649],256],64337:[[1649],256],64338:[[1659],256],64339:[[1659],256],64340:[[1659],256],64341:[[1659],256],64342:[[1662],256],64343:[[1662],256],64344:[[1662],256],64345:[[1662],256],64346:[[1664],256],64347:[[1664],256],64348:[[1664],256],64349:[[1664],256],64350:[[1658],256],64351:[[1658],256],64352:[[1658],256],64353:[[1658],256],64354:[[1663],256],64355:[[1663],256],64356:[[1663],256],64357:[[1663],256],64358:[[1657],256],64359:[[1657],256],64360:[[1657],256],64361:[[1657],256],64362:[[1700],256],64363:[[1700],256],64364:[[1700],256],64365:[[1700],256],64366:[[1702],256],64367:[[1702],256],64368:[[1702],256],64369:[[1702],256],64370:[[1668],256],64371:[[1668],256],64372:[[1668],256],64373:[[1668],256],64374:[[1667],256],64375:[[1667],256],64376:[[1667],256],64377:[[1667],256],64378:[[1670],256],64379:[[1670],256],64380:[[1670],256],64381:[[1670],256],64382:[[1671],256],64383:[[1671],256],64384:[[1671],256],64385:[[1671],256],64386:[[1677],256],64387:[[1677],256],64388:[[1676],256],64389:[[1676],256],64390:[[1678],256],64391:[[1678],256],64392:[[1672],256],64393:[[1672],256],64394:[[1688],256],64395:[[1688],256],64396:[[1681],256],64397:[[1681],256],64398:[[1705],256],64399:[[1705],256],64400:[[1705],256],64401:[[1705],256],64402:[[1711],256],64403:[[1711],256],64404:[[1711],256],64405:[[1711],256],64406:[[1715],256],64407:[[1715],256],64408:[[1715],256],64409:[[1715],256],64410:[[1713],256],64411:[[1713],256],64412:[[1713],256],64413:[[1713],256],64414:[[1722],256],64415:[[1722],256],64416:[[1723],256],64417:[[1723],256],64418:[[1723],256],64419:[[1723],256],64420:[[1728],256],64421:[[1728],256],64422:[[1729],256],64423:[[1729],256],64424:[[1729],256],64425:[[1729],256],64426:[[1726],256],64427:[[1726],256],64428:[[1726],256],64429:[[1726],256],64430:[[1746],256],64431:[[1746],256],64432:[[1747],256],64433:[[1747],256],64467:[[1709],256],64468:[[1709],256],64469:[[1709],256],64470:[[1709],256],64471:[[1735],256],64472:[[1735],256],64473:[[1734],256],64474:[[1734],256],64475:[[1736],256],64476:[[1736],256],64477:[[1655],256],64478:[[1739],256],64479:[[1739],256],64480:[[1733],256],64481:[[1733],256],64482:[[1737],256],64483:[[1737],256],64484:[[1744],256],64485:[[1744],256],64486:[[1744],256],64487:[[1744],256],64488:[[1609],256],64489:[[1609],256],64490:[[1574,1575],256],64491:[[1574,1575],256],64492:[[1574,1749],256],64493:[[1574,1749],256],64494:[[1574,1608],256],64495:[[1574,1608],256],64496:[[1574,1735],256],64497:[[1574,1735],256],64498:[[1574,1734],256],64499:[[1574,1734],256],64500:[[1574,1736],256],64501:[[1574,1736],256],64502:[[1574,1744],256],64503:[[1574,1744],256],64504:[[1574,1744],256],64505:[[1574,1609],256],64506:[[1574,1609],256],64507:[[1574,1609],256],64508:[[1740],256],64509:[[1740],256],64510:[[1740],256],64511:[[1740],256]},64512:{64512:[[1574,1580],256],64513:[[1574,1581],256],64514:[[1574,1605],256],64515:[[1574,1609],256],64516:[[1574,1610],256],64517:[[1576,1580],256],64518:[[1576,1581],256],64519:[[1576,1582],256],64520:[[1576,1605],256],64521:[[1576,1609],256],64522:[[1576,1610],256],64523:[[1578,1580],256],64524:[[1578,1581],256],64525:[[1578,1582],256],64526:[[1578,1605],256],64527:[[1578,1609],256],64528:[[1578,1610],256],64529:[[1579,1580],256],64530:[[1579,1605],256],64531:[[1579,1609],256],64532:[[1579,1610],256],64533:[[1580,1581],256],64534:[[1580,1605],256],64535:[[1581,1580],256],64536:[[1581,1605],256],64537:[[1582,1580],256],64538:[[1582,1581],256],64539:[[1582,1605],256],64540:[[1587,1580],256],64541:[[1587,1581],256],64542:[[1587,1582],256],64543:[[1587,1605],256],64544:[[1589,1581],256],64545:[[1589,1605],256],64546:[[1590,1580],256],64547:[[1590,1581],256],64548:[[1590,1582],256],64549:[[1590,1605],256],64550:[[1591,1581],256],64551:[[1591,1605],256],64552:[[1592,1605],256],64553:[[1593,1580],256],64554:[[1593,1605],256],64555:[[1594,1580],256],64556:[[1594,1605],256],64557:[[1601,1580],256],64558:[[1601,1581],256],64559:[[1601,1582],256],64560:[[1601,1605],256],64561:[[1601,1609],256],64562:[[1601,1610],256],64563:[[1602,1581],256],64564:[[1602,1605],256],64565:[[1602,1609],256],64566:[[1602,1610],256],64567:[[1603,1575],256],64568:[[1603,1580],256],64569:[[1603,1581],256],64570:[[1603,1582],256],64571:[[1603,1604],256],64572:[[1603,1605],256],64573:[[1603,1609],256],64574:[[1603,1610],256],64575:[[1604,1580],256],64576:[[1604,1581],256],64577:[[1604,1582],256],64578:[[1604,1605],256],64579:[[1604,1609],256],64580:[[1604,1610],256],64581:[[1605,1580],256],64582:[[1605,1581],256],64583:[[1605,1582],256],64584:[[1605,1605],256],64585:[[1605,1609],256],64586:[[1605,1610],256],64587:[[1606,1580],256],64588:[[1606,1581],256],64589:[[1606,1582],256],64590:[[1606,1605],256],64591:[[1606,1609],256],64592:[[1606,1610],256],64593:[[1607,1580],256],64594:[[1607,1605],256],64595:[[1607,1609],256],64596:[[1607,1610],256],64597:[[1610,1580],256],64598:[[1610,1581],256],64599:[[1610,1582],256],64600:[[1610,1605],256],64601:[[1610,1609],256],64602:[[1610,1610],256],64603:[[1584,1648],256],64604:[[1585,1648],256],64605:[[1609,1648],256],64606:[[32,1612,1617],256],64607:[[32,1613,1617],256],64608:[[32,1614,1617],256],64609:[[32,1615,1617],256],64610:[[32,1616,1617],256],64611:[[32,1617,1648],256],64612:[[1574,1585],256],64613:[[1574,1586],256],64614:[[1574,1605],256],64615:[[1574,1606],256],64616:[[1574,1609],256],64617:[[1574,1610],256],64618:[[1576,1585],256],64619:[[1576,1586],256],64620:[[1576,1605],256],64621:[[1576,1606],256],64622:[[1576,1609],256],64623:[[1576,1610],256],64624:[[1578,1585],256],64625:[[1578,1586],256],64626:[[1578,1605],256],64627:[[1578,1606],256],64628:[[1578,1609],256],64629:[[1578,1610],256],64630:[[1579,1585],256],64631:[[1579,1586],256],64632:[[1579,1605],256],64633:[[1579,1606],256],64634:[[1579,1609],256],64635:[[1579,1610],256],64636:[[1601,1609],256],64637:[[1601,1610],256],64638:[[1602,1609],256],64639:[[1602,1610],256],64640:[[1603,1575],256],64641:[[1603,1604],256],64642:[[1603,1605],256],64643:[[1603,1609],256],64644:[[1603,1610],256],64645:[[1604,1605],256],64646:[[1604,1609],256],64647:[[1604,1610],256],64648:[[1605,1575],256],64649:[[1605,1605],256],64650:[[1606,1585],256],64651:[[1606,1586],256],64652:[[1606,1605],256],64653:[[1606,1606],256],64654:[[1606,1609],256],64655:[[1606,1610],256],64656:[[1609,1648],256],64657:[[1610,1585],256],64658:[[1610,1586],256],64659:[[1610,1605],256],64660:[[1610,1606],256],64661:[[1610,1609],256],64662:[[1610,1610],256],64663:[[1574,1580],256],64664:[[1574,1581],256],64665:[[1574,1582],256],64666:[[1574,1605],256],64667:[[1574,1607],256],64668:[[1576,1580],256],64669:[[1576,1581],256],64670:[[1576,1582],256],64671:[[1576,1605],256],64672:[[1576,1607],256],64673:[[1578,1580],256],64674:[[1578,1581],256],64675:[[1578,1582],256],64676:[[1578,1605],256],64677:[[1578,1607],256],64678:[[1579,1605],256],64679:[[1580,1581],256],64680:[[1580,1605],256],64681:[[1581,1580],256],64682:[[1581,1605],256],64683:[[1582,1580],256],64684:[[1582,1605],256],64685:[[1587,1580],256],64686:[[1587,1581],256],64687:[[1587,1582],256],64688:[[1587,1605],256],64689:[[1589,1581],256],64690:[[1589,1582],256],64691:[[1589,1605],256],64692:[[1590,1580],256],64693:[[1590,1581],256],64694:[[1590,1582],256],64695:[[1590,1605],256],64696:[[1591,1581],256],64697:[[1592,1605],256],64698:[[1593,1580],256],64699:[[1593,1605],256],64700:[[1594,1580],256],64701:[[1594,1605],256],64702:[[1601,1580],256],64703:[[1601,1581],256],64704:[[1601,1582],256],64705:[[1601,1605],256],64706:[[1602,1581],256],64707:[[1602,1605],256],64708:[[1603,1580],256],64709:[[1603,1581],256],64710:[[1603,1582],256],64711:[[1603,1604],256],64712:[[1603,1605],256],64713:[[1604,1580],256],64714:[[1604,1581],256],64715:[[1604,1582],256],64716:[[1604,1605],256],64717:[[1604,1607],256],64718:[[1605,1580],256],64719:[[1605,1581],256],64720:[[1605,1582],256],64721:[[1605,1605],256],64722:[[1606,1580],256],64723:[[1606,1581],256],64724:[[1606,1582],256],64725:[[1606,1605],256],64726:[[1606,1607],256],64727:[[1607,1580],256],64728:[[1607,1605],256],64729:[[1607,1648],256],64730:[[1610,1580],256],64731:[[1610,1581],256],64732:[[1610,1582],256],64733:[[1610,1605],256],64734:[[1610,1607],256],64735:[[1574,1605],256],64736:[[1574,1607],256],64737:[[1576,1605],256],64738:[[1576,1607],256],64739:[[1578,1605],256],64740:[[1578,1607],256],64741:[[1579,1605],256],64742:[[1579,1607],256],64743:[[1587,1605],256],64744:[[1587,1607],256],64745:[[1588,1605],256],64746:[[1588,1607],256],64747:[[1603,1604],256],64748:[[1603,1605],256],64749:[[1604,1605],256],64750:[[1606,1605],256],64751:[[1606,1607],256],64752:[[1610,1605],256],64753:[[1610,1607],256],64754:[[1600,1614,1617],256],64755:[[1600,1615,1617],256],64756:[[1600,1616,1617],256],64757:[[1591,1609],256],64758:[[1591,1610],256],64759:[[1593,1609],256],64760:[[1593,1610],256],64761:[[1594,1609],256],64762:[[1594,1610],256],64763:[[1587,1609],256],64764:[[1587,1610],256],64765:[[1588,1609],256],64766:[[1588,1610],256],64767:[[1581,1609],256]},64768:{64768:[[1581,1610],256],64769:[[1580,1609],256],64770:[[1580,1610],256],64771:[[1582,1609],256],64772:[[1582,1610],256],64773:[[1589,1609],256],64774:[[1589,1610],256],64775:[[1590,1609],256],64776:[[1590,1610],256],64777:[[1588,1580],256],64778:[[1588,1581],256],64779:[[1588,1582],256],64780:[[1588,1605],256],64781:[[1588,1585],256],64782:[[1587,1585],256],64783:[[1589,1585],256],64784:[[1590,1585],256],64785:[[1591,1609],256],64786:[[1591,1610],256],64787:[[1593,1609],256],64788:[[1593,1610],256],64789:[[1594,1609],256],64790:[[1594,1610],256],64791:[[1587,1609],256],64792:[[1587,1610],256],64793:[[1588,1609],256],64794:[[1588,1610],256],64795:[[1581,1609],256],64796:[[1581,1610],256],64797:[[1580,1609],256],64798:[[1580,1610],256],64799:[[1582,1609],256],64800:[[1582,1610],256],64801:[[1589,1609],256],64802:[[1589,1610],256],64803:[[1590,1609],256],64804:[[1590,1610],256],64805:[[1588,1580],256],64806:[[1588,1581],256],64807:[[1588,1582],256],64808:[[1588,1605],256],64809:[[1588,1585],256],64810:[[1587,1585],256],64811:[[1589,1585],256],64812:[[1590,1585],256],64813:[[1588,1580],256],64814:[[1588,1581],256],64815:[[1588,1582],256],64816:[[1588,1605],256],64817:[[1587,1607],256],64818:[[1588,1607],256],64819:[[1591,1605],256],64820:[[1587,1580],256],64821:[[1587,1581],256],64822:[[1587,1582],256],64823:[[1588,1580],256],64824:[[1588,1581],256],64825:[[1588,1582],256],64826:[[1591,1605],256],64827:[[1592,1605],256],64828:[[1575,1611],256],64829:[[1575,1611],256],64848:[[1578,1580,1605],256],64849:[[1578,1581,1580],256],64850:[[1578,1581,1580],256],64851:[[1578,1581,1605],256],64852:[[1578,1582,1605],256],64853:[[1578,1605,1580],256],64854:[[1578,1605,1581],256],64855:[[1578,1605,1582],256],64856:[[1580,1605,1581],256],64857:[[1580,1605,1581],256],64858:[[1581,1605,1610],256],64859:[[1581,1605,1609],256],64860:[[1587,1581,1580],256],64861:[[1587,1580,1581],256],64862:[[1587,1580,1609],256],64863:[[1587,1605,1581],256],64864:[[1587,1605,1581],256],64865:[[1587,1605,1580],256],64866:[[1587,1605,1605],256],64867:[[1587,1605,1605],256],64868:[[1589,1581,1581],256],64869:[[1589,1581,1581],256],64870:[[1589,1605,1605],256],64871:[[1588,1581,1605],256],64872:[[1588,1581,1605],256],64873:[[1588,1580,1610],256],64874:[[1588,1605,1582],256],64875:[[1588,1605,1582],256],64876:[[1588,1605,1605],256],64877:[[1588,1605,1605],256],64878:[[1590,1581,1609],256],64879:[[1590,1582,1605],256],64880:[[1590,1582,1605],256],64881:[[1591,1605,1581],256],64882:[[1591,1605,1581],256],64883:[[1591,1605,1605],256],64884:[[1591,1605,1610],256],64885:[[1593,1580,1605],256],64886:[[1593,1605,1605],256],64887:[[1593,1605,1605],256],64888:[[1593,1605,1609],256],64889:[[1594,1605,1605],256],64890:[[1594,1605,1610],256],64891:[[1594,1605,1609],256],64892:[[1601,1582,1605],256],64893:[[1601,1582,1605],256],64894:[[1602,1605,1581],256],64895:[[1602,1605,1605],256],64896:[[1604,1581,1605],256],64897:[[1604,1581,1610],256],64898:[[1604,1581,1609],256],64899:[[1604,1580,1580],256],64900:[[1604,1580,1580],256],64901:[[1604,1582,1605],256],64902:[[1604,1582,1605],256],64903:[[1604,1605,1581],256],64904:[[1604,1605,1581],256],64905:[[1605,1581,1580],256],64906:[[1605,1581,1605],256],64907:[[1605,1581,1610],256],64908:[[1605,1580,1581],256],64909:[[1605,1580,1605],256],64910:[[1605,1582,1580],256],64911:[[1605,1582,1605],256],64914:[[1605,1580,1582],256],64915:[[1607,1605,1580],256],64916:[[1607,1605,1605],256],64917:[[1606,1581,1605],256],64918:[[1606,1581,1609],256],64919:[[1606,1580,1605],256],64920:[[1606,1580,1605],256],64921:[[1606,1580,1609],256],64922:[[1606,1605,1610],256],64923:[[1606,1605,1609],256],64924:[[1610,1605,1605],256],64925:[[1610,1605,1605],256],64926:[[1576,1582,1610],256],64927:[[1578,1580,1610],256],64928:[[1578,1580,1609],256],64929:[[1578,1582,1610],256],64930:[[1578,1582,1609],256],64931:[[1578,1605,1610],256],64932:[[1578,1605,1609],256],64933:[[1580,1605,1610],256],64934:[[1580,1581,1609],256],64935:[[1580,1605,1609],256],64936:[[1587,1582,1609],256],64937:[[1589,1581,1610],256],64938:[[1588,1581,1610],256],64939:[[1590,1581,1610],256],64940:[[1604,1580,1610],256],64941:[[1604,1605,1610],256],64942:[[1610,1581,1610],256],64943:[[1610,1580,1610],256],64944:[[1610,1605,1610],256],64945:[[1605,1605,1610],256],64946:[[1602,1605,1610],256],64947:[[1606,1581,1610],256],64948:[[1602,1605,1581],256],64949:[[1604,1581,1605],256],64950:[[1593,1605,1610],256],64951:[[1603,1605,1610],256],64952:[[1606,1580,1581],256],64953:[[1605,1582,1610],256],64954:[[1604,1580,1605],256],64955:[[1603,1605,1605],256],64956:[[1604,1580,1605],256],64957:[[1606,1580,1581],256],64958:[[1580,1581,1610],256],64959:[[1581,1580,1610],256],64960:[[1605,1580,1610],256],64961:[[1601,1605,1610],256],64962:[[1576,1581,1610],256],64963:[[1603,1605,1605],256],64964:[[1593,1580,1605],256],64965:[[1589,1605,1605],256],64966:[[1587,1582,1610],256],64967:[[1606,1580,1610],256],65008:[[1589,1604,1746],256],65009:[[1602,1604,1746],256],65010:[[1575,1604,1604,1607],256],65011:[[1575,1603,1576,1585],256],65012:[[1605,1581,1605,1583],256],65013:[[1589,1604,1593,1605],256],65014:[[1585,1587,1608,1604],256],65015:[[1593,1604,1610,1607],256],65016:[[1608,1587,1604,1605],256],65017:[[1589,1604,1609],256],65018:[[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605],256],65019:[[1580,1604,32,1580,1604,1575,1604,1607],256],65020:[[1585,1740,1575,1604],256]},65024:{65040:[[44],256],65041:[[12289],256],65042:[[12290],256],65043:[[58],256],65044:[[59],256],65045:[[33],256],65046:[[63],256],65047:[[12310],256],65048:[[12311],256],65049:[[8230],256],65056:[,230],65057:[,230],65058:[,230],65059:[,230],65060:[,230],65061:[,230],65062:[,230],65063:[,220],65064:[,220],65065:[,220],65066:[,220],65067:[,220],65068:[,220],65069:[,220],65072:[[8229],256],65073:[[8212],256],65074:[[8211],256],65075:[[95],256],65076:[[95],256],65077:[[40],256],65078:[[41],256],65079:[[123],256],65080:[[125],256],65081:[[12308],256],65082:[[12309],256],65083:[[12304],256],65084:[[12305],256],65085:[[12298],256],65086:[[12299],256],65087:[[12296],256],65088:[[12297],256],65089:[[12300],256],65090:[[12301],256],65091:[[12302],256],65092:[[12303],256],65095:[[91],256],65096:[[93],256],65097:[[8254],256],65098:[[8254],256],65099:[[8254],256],65100:[[8254],256],65101:[[95],256],65102:[[95],256],65103:[[95],256],65104:[[44],256],65105:[[12289],256],65106:[[46],256],65108:[[59],256],65109:[[58],256],65110:[[63],256],65111:[[33],256],65112:[[8212],256],65113:[[40],256],65114:[[41],256],65115:[[123],256],65116:[[125],256],65117:[[12308],256],65118:[[12309],256],65119:[[35],256],65120:[[38],256],65121:[[42],256],65122:[[43],256],65123:[[45],256],65124:[[60],256],65125:[[62],256],65126:[[61],256],65128:[[92],256],65129:[[36],256],65130:[[37],256],65131:[[64],256],65136:[[32,1611],256],65137:[[1600,1611],256],65138:[[32,1612],256],65140:[[32,1613],256],65142:[[32,1614],256],65143:[[1600,1614],256],65144:[[32,1615],256],65145:[[1600,1615],256],65146:[[32,1616],256],65147:[[1600,1616],256],65148:[[32,1617],256],65149:[[1600,1617],256],65150:[[32,1618],256],65151:[[1600,1618],256],65152:[[1569],256],65153:[[1570],256],65154:[[1570],256],65155:[[1571],256],65156:[[1571],256],65157:[[1572],256],65158:[[1572],256],65159:[[1573],256],65160:[[1573],256],65161:[[1574],256],65162:[[1574],256],65163:[[1574],256],65164:[[1574],256],65165:[[1575],256],65166:[[1575],256],65167:[[1576],256],65168:[[1576],256],65169:[[1576],256],65170:[[1576],256],65171:[[1577],256],65172:[[1577],256],65173:[[1578],256],65174:[[1578],256],65175:[[1578],256],65176:[[1578],256],65177:[[1579],256],65178:[[1579],256],65179:[[1579],256],65180:[[1579],256],65181:[[1580],256],65182:[[1580],256],65183:[[1580],256],65184:[[1580],256],65185:[[1581],256],65186:[[1581],256],65187:[[1581],256],65188:[[1581],256],65189:[[1582],256],65190:[[1582],256],65191:[[1582],256],65192:[[1582],256],65193:[[1583],256],65194:[[1583],256],65195:[[1584],256],65196:[[1584],256],65197:[[1585],256],65198:[[1585],256],65199:[[1586],256],65200:[[1586],256],65201:[[1587],256],65202:[[1587],256],65203:[[1587],256],65204:[[1587],256],65205:[[1588],256],65206:[[1588],256],65207:[[1588],256],65208:[[1588],256],65209:[[1589],256],65210:[[1589],256],65211:[[1589],256],65212:[[1589],256],65213:[[1590],256],65214:[[1590],256],65215:[[1590],256],65216:[[1590],256],65217:[[1591],256],65218:[[1591],256],65219:[[1591],256],65220:[[1591],256],65221:[[1592],256],65222:[[1592],256],65223:[[1592],256],65224:[[1592],256],65225:[[1593],256],65226:[[1593],256],65227:[[1593],256],65228:[[1593],256],65229:[[1594],256],65230:[[1594],256],65231:[[1594],256],65232:[[1594],256],65233:[[1601],256],65234:[[1601],256],65235:[[1601],256],65236:[[1601],256],65237:[[1602],256],65238:[[1602],256],65239:[[1602],256],65240:[[1602],256],65241:[[1603],256],65242:[[1603],256],65243:[[1603],256],65244:[[1603],256],65245:[[1604],256],65246:[[1604],256],65247:[[1604],256],65248:[[1604],256],65249:[[1605],256],65250:[[1605],256],65251:[[1605],256],65252:[[1605],256],65253:[[1606],256],65254:[[1606],256],65255:[[1606],256],65256:[[1606],256],65257:[[1607],256],65258:[[1607],256],65259:[[1607],256],65260:[[1607],256],65261:[[1608],256],65262:[[1608],256],65263:[[1609],256],65264:[[1609],256],65265:[[1610],256],65266:[[1610],256],65267:[[1610],256],65268:[[1610],256],65269:[[1604,1570],256],65270:[[1604,1570],256],65271:[[1604,1571],256],65272:[[1604,1571],256],65273:[[1604,1573],256],65274:[[1604,1573],256],65275:[[1604,1575],256],65276:[[1604,1575],256]},65280:{65281:[[33],256],65282:[[34],256],65283:[[35],256],65284:[[36],256],65285:[[37],256],65286:[[38],256],65287:[[39],256],65288:[[40],256],65289:[[41],256],65290:[[42],256],65291:[[43],256],65292:[[44],256],65293:[[45],256],65294:[[46],256],65295:[[47],256],65296:[[48],256],65297:[[49],256],65298:[[50],256],65299:[[51],256],65300:[[52],256],65301:[[53],256],65302:[[54],256],65303:[[55],256],65304:[[56],256],65305:[[57],256],65306:[[58],256],65307:[[59],256],65308:[[60],256],65309:[[61],256],65310:[[62],256],65311:[[63],256],65312:[[64],256],65313:[[65],256],65314:[[66],256],65315:[[67],256],65316:[[68],256],65317:[[69],256],65318:[[70],256],65319:[[71],256],65320:[[72],256],65321:[[73],256],65322:[[74],256],65323:[[75],256],65324:[[76],256],65325:[[77],256],65326:[[78],256],65327:[[79],256],65328:[[80],256],65329:[[81],256],65330:[[82],256],65331:[[83],256],65332:[[84],256],65333:[[85],256],65334:[[86],256],65335:[[87],256],65336:[[88],256],65337:[[89],256],65338:[[90],256],65339:[[91],256],65340:[[92],256],65341:[[93],256],65342:[[94],256],65343:[[95],256],65344:[[96],256],65345:[[97],256],65346:[[98],256],65347:[[99],256],65348:[[100],256],65349:[[101],256],65350:[[102],256],65351:[[103],256],65352:[[104],256],65353:[[105],256],65354:[[106],256],65355:[[107],256],65356:[[108],256],65357:[[109],256],65358:[[110],256],65359:[[111],256],65360:[[112],256],65361:[[113],256],65362:[[114],256],65363:[[115],256],65364:[[116],256],65365:[[117],256],65366:[[118],256],65367:[[119],256],65368:[[120],256],65369:[[121],256],65370:[[122],256],65371:[[123],256],65372:[[124],256],65373:[[125],256],65374:[[126],256],65375:[[10629],256],65376:[[10630],256],65377:[[12290],256],65378:[[12300],256],65379:[[12301],256],65380:[[12289],256],65381:[[12539],256],65382:[[12530],256],65383:[[12449],256],65384:[[12451],256],65385:[[12453],256],65386:[[12455],256],65387:[[12457],256],65388:[[12515],256],65389:[[12517],256],65390:[[12519],256],65391:[[12483],256],65392:[[12540],256],65393:[[12450],256],65394:[[12452],256],65395:[[12454],256],65396:[[12456],256],65397:[[12458],256],65398:[[12459],256],65399:[[12461],256],65400:[[12463],256],65401:[[12465],256],65402:[[12467],256],65403:[[12469],256],65404:[[12471],256],65405:[[12473],256],65406:[[12475],256],65407:[[12477],256],65408:[[12479],256],65409:[[12481],256],65410:[[12484],256],65411:[[12486],256],65412:[[12488],256],65413:[[12490],256],65414:[[12491],256],65415:[[12492],256],65416:[[12493],256],65417:[[12494],256],65418:[[12495],256],65419:[[12498],256],65420:[[12501],256],65421:[[12504],256],65422:[[12507],256],65423:[[12510],256],65424:[[12511],256],65425:[[12512],256],65426:[[12513],256],65427:[[12514],256],65428:[[12516],256],65429:[[12518],256],65430:[[12520],256],65431:[[12521],256],65432:[[12522],256],65433:[[12523],256],65434:[[12524],256],65435:[[12525],256],65436:[[12527],256],65437:[[12531],256],65438:[[12441],256],65439:[[12442],256],65440:[[12644],256],65441:[[12593],256],65442:[[12594],256],65443:[[12595],256],65444:[[12596],256],65445:[[12597],256],65446:[[12598],256],65447:[[12599],256],65448:[[12600],256],65449:[[12601],256],65450:[[12602],256],65451:[[12603],256],65452:[[12604],256],65453:[[12605],256],65454:[[12606],256],65455:[[12607],256],65456:[[12608],256],65457:[[12609],256],65458:[[12610],256],65459:[[12611],256],65460:[[12612],256],65461:[[12613],256],65462:[[12614],256],65463:[[12615],256],65464:[[12616],256],65465:[[12617],256],65466:[[12618],256],65467:[[12619],256],65468:[[12620],256],65469:[[12621],256],65470:[[12622],256],65474:[[12623],256],65475:[[12624],256],65476:[[12625],256],65477:[[12626],256],65478:[[12627],256],65479:[[12628],256],65482:[[12629],256],65483:[[12630],256],65484:[[12631],256],65485:[[12632],256],65486:[[12633],256],65487:[[12634],256],65490:[[12635],256],65491:[[12636],256],65492:[[12637],256],65493:[[12638],256],65494:[[12639],256],65495:[[12640],256],65498:[[12641],256],65499:[[12642],256],65500:[[12643],256],65504:[[162],256],65505:[[163],256],65506:[[172],256],65507:[[175],256],65508:[[166],256],65509:[[165],256],65510:[[8361],256],65512:[[9474],256],65513:[[8592],256],65514:[[8593],256],65515:[[8594],256],65516:[[8595],256],65517:[[9632],256],65518:[[9675],256]}};var m={nfc:function(e){return g("NFC",e)},nfd:function(e){return g("NFD",e)},nfkc:function(e){return g("NFKC",e)},nfkd:function(e){return g("NFKD",e)}};e.exports=m,m.shimApplied=!1,String.prototype.normalize||(Object.defineProperty(String.prototype,"normalize",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=""+this,t=void 0===arguments[0]?"NFC":arguments[0];if(null==this)throw new TypeError("Cannot call method on "+Object.prototype.toString.call(this));if("NFC"===t)return m.nfc(e);if("NFD"===t)return m.nfd(e);if("NFKC"===t)return m.nfkc(e);if("NFKD"===t)return m.nfkd(e);throw new RangeError("Invalid normalization form: "+t)}}),m.shimApplied=!0)}()},(e,t,r)=>{"use strict";function n(e){const t=e.caseSensitive?e.accentSensitive?"variant":"case":e.accentSensitive?"accent":"base",r=e.caseFirst,n=e.ignorePunctuation;return new Intl.Collator(e.localeLang,{sensitivity:t,caseFirst:r,ignorePunctuation:n})}r.r(t),r.d(t,{collatorFromConfig:()=>n})},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DetailedCellError:()=>n});class n{constructor(e,t,r){var n;this.value=t,this.address=r,this.type=e.type,this.message=null!==(n=e.message)&&void 0!==n?n:""}toString(){return this.value}valueOf(){return this.value}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Config:()=>d,getDefaultConfig:()=>g});var n=r(100),s=r(101),o=r(102),i=r(103),a=r(77),l=r(104),u=r(106),h=r(108);const c=new WeakMap;class d{constructor(e={},t=!0){const{accentSensitive:r,binarySearchThreshold:s,caseSensitive:i,caseFirst:a,chooseAddressMappingPolicy:l,currencySymbol:p,dateFormats:g,decimalSeparator:m,evaluateNullToZero:f,functionArgSeparator:y,functionPlugins:E,ignorePunctuation:C,leapYear1900:T,localeLang:R,language:w,ignoreWhiteSpace:S,licenseKey:v,matchWholeCell:A,arrayColumnSeparator:N,arrayRowSeparator:O,maxRows:M,maxColumns:b,nullYear:I,nullDate:_,parseDateTime:x,precisionEpsilon:P,precisionRounding:L,stringifyDateTime:D,stringifyDuration:F,smartRounding:k,timeFormats:H,thousandSeparator:U,useArrayArithmetic:V,useStats:B,undoLimit:W,useColumnIndex:G,useRegularExpressions:Y,useWildcards:j}=e;t&&d.warnDeprecatedOptions(e),this.useArrayArithmetic=(0,n.configValueFromParam)(V,"boolean","useArrayArithmetic"),this.accentSensitive=(0,n.configValueFromParam)(r,"boolean","accentSensitive"),this.caseSensitive=(0,n.configValueFromParam)(i,"boolean","caseSensitive"),this.caseFirst=(0,n.configValueFromParam)(a,["upper","lower","false"],"caseFirst"),this.ignorePunctuation=(0,n.configValueFromParam)(C,"boolean","ignorePunctuation"),this.chooseAddressMappingPolicy=null!=l?l:d.defaultConfig.chooseAddressMappingPolicy,this.dateFormats=[...(0,n.configValueFromParamCheck)(g,Array.isArray,"array","dateFormats")],this.timeFormats=[...(0,n.configValueFromParamCheck)(H,Array.isArray,"array","timeFormats")],this.functionArgSeparator=(0,n.configValueFromParam)(y,"string","functionArgSeparator"),this.decimalSeparator=(0,n.configValueFromParam)(m,[".",","],"decimalSeparator"),this.language=(0,n.configValueFromParam)(w,"string","language"),this.ignoreWhiteSpace=(0,n.configValueFromParam)(S,["standard","any"],"ignoreWhiteSpace"),this.licenseKey=(0,n.configValueFromParam)(v,"string","licenseKey"),this.thousandSeparator=(0,n.configValueFromParam)(U,["",","," ","."],"thousandSeparator"),this.arrayColumnSeparator=(0,n.configValueFromParam)(N,[",",";"],"arrayColumnSeparator"),this.arrayRowSeparator=(0,n.configValueFromParam)(O,[";","|"],"arrayRowSeparator"),this.localeLang=(0,n.configValueFromParam)(R,"string","localeLang"),this.functionPlugins=[...null!=E?E:d.defaultConfig.functionPlugins],this.smartRounding=(0,n.configValueFromParam)(k,"boolean","smartRounding"),this.evaluateNullToZero=(0,n.configValueFromParam)(f,"boolean","evaluateNullToZero"),this.nullYear=(0,n.configValueFromParam)(I,"number","nullYear"),(0,n.validateNumberToBeAtLeast)(this.nullYear,"nullYear",0),(0,n.validateNumberToBeAtMost)(this.nullYear,"nullYear",100),this.precisionRounding=(0,n.configValueFromParam)(L,"number","precisionRounding"),(0,n.validateNumberToBeAtLeast)(this.precisionRounding,"precisionRounding",0),this.precisionEpsilon=(0,n.configValueFromParam)(P,"number","precisionEpsilon"),(0,n.validateNumberToBeAtLeast)(this.precisionEpsilon,"precisionEpsilon",0),this.useColumnIndex=(0,n.configValueFromParam)(G,"boolean","useColumnIndex"),this.useStats=(0,n.configValueFromParam)(B,"boolean","useStats"),this.binarySearchThreshold=null!=s?s:d.defaultConfig.binarySearchThreshold,this.parseDateTime=(0,n.configValueFromParam)(x,"function","parseDateTime"),this.stringifyDateTime=(0,n.configValueFromParam)(D,"function","stringifyDateTime"),this.stringifyDuration=(0,n.configValueFromParam)(F,"function","stringifyDuration"),this.translationPackage=h.HyperFormula.getLanguage(this.language),this.errorMapping=this.translationPackage.buildErrorMapping(),this.nullDate=(0,n.configValueFromParamCheck)(_,o.instanceOfSimpleDate,"IDate","nullDate"),this.leapYear1900=(0,n.configValueFromParam)(T,"boolean","leapYear1900"),this.undoLimit=(0,n.configValueFromParam)(W,"number","undoLimit"),this.useRegularExpressions=(0,n.configValueFromParam)(Y,"boolean","useRegularExpressions"),this.useWildcards=(0,n.configValueFromParam)(j,"boolean","useWildcards"),this.matchWholeCell=(0,n.configValueFromParam)(A,"boolean","matchWholeCell"),(0,n.validateNumberToBeAtLeast)(this.undoLimit,"undoLimit",0),this.maxRows=(0,n.configValueFromParam)(M,"number","maxRows"),(0,n.validateNumberToBeAtLeast)(this.maxRows,"maxRows",1),this.maxColumns=(0,n.configValueFromParam)(b,"number","maxColumns"),this.currencySymbol=this.setupCurrencySymbol(p),(0,n.validateNumberToBeAtLeast)(this.maxColumns,"maxColumns",1),c.set(this,{licenseKeyValidityState:(0,u.checkLicenseKeyValidity)(this.licenseKey)}),(0,n.configCheckIfParametersNotInConflict)({value:this.decimalSeparator,name:"decimalSeparator"},{value:this.functionArgSeparator,name:"functionArgSeparator"},{value:this.thousandSeparator,name:"thousandSeparator"}),(0,n.configCheckIfParametersNotInConflict)({value:this.arrayRowSeparator,name:"arrayRowSeparator"},{value:this.arrayColumnSeparator,name:"arrayColumnSeparator"})}setupCurrencySymbol(e){const t=[...(0,n.configValueFromParamCheck)(e,Array.isArray,"array","currencySymbol")];return t.forEach((e=>{if("string"!=typeof e)throw new a.ExpectedValueOfTypeError("string[]","currencySymbol");if(""===e)throw new a.ConfigValueEmpty("currencySymbol")})),t}get licenseKeyValidityState(){return c.get(this).licenseKeyValidityState}getConfig(){return p(this)}mergeConfig(e){const t=Object.assign({},this.getConfig(),e);return d.warnDeprecatedOptions(e),new d(t,!1)}static warnDeprecatedOptions(e){d.warnDeprecatedIfUsed(e.binarySearchThreshold,"binarySearchThreshold","1.1")}static warnDeprecatedIfUsed(e,t,r,n){void 0!==e&&(void 0===n?console.warn(`${t} option is deprecated since ${r}`):console.warn(`${t} option is deprecated since ${r}, please use ${n}`))}}function p(e){var t;const r={};for(const n in d.defaultConfig){const s=null!==(t=e[n])&&void 0!==t?t:d.defaultConfig[n];Array.isArray(s)?r[n]=[...s]:r[n]=s}return r}function g(){return p({})}d.defaultConfig={accentSensitive:!1,binarySearchThreshold:20,currencySymbol:["$"],caseSensitive:!1,caseFirst:"lower",chooseAddressMappingPolicy:new i.AlwaysDense,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:s.defaultParseToDateTime,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,stringifyDateTime:l.defaultStringifyDateTime,stringifyDuration:l.defaultStringifyDuration,timeFormats:["hh:mm","hh:mm:ss.sss"],thousandSeparator:"",undoLimit:20,useRegularExpressions:!1,useWildcards:!0,useColumnIndex:!1,useStats:!1,useArrayArithmetic:!1}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{configCheckIfParametersNotInConflict:()=>u,configValueFromParam:()=>o,configValueFromParamCheck:()=>l,validateArgToType:()=>h,validateNumberToBeAtLeast:()=>i,validateNumberToBeAtMost:()=>a});var n=r(99),s=r(77);function o(e,t,r){if(void 0===e)return n.Config.defaultConfig[r];if("string"==typeof t){if(typeof e===t)return e;throw new s.ExpectedValueOfTypeError(t,r)}if(t.includes(e))return e;throw new s.ExpectedOneOfValuesError(t.map((e=>`'${e}'`)).join(" "),r)}function i(e,t,r){if(e<r)throw new s.ConfigValueTooSmallError(t,r)}function a(e,t,r){if(e>r)throw new s.ConfigValueTooBigError(t,r)}function l(e,t,r,o){if(t(e))return e;if(void 0===e)return n.Config.defaultConfig[o];throw new s.ExpectedValueOfTypeError(r,o)}function u(...e){const t=new Map;e.forEach((e=>{const r=t.get(e.value)||[];r.push(e.name),t.set(e.value,r)}));const r=[];for(const e of t.values())e.length>1&&r.push(e);if(r.length>0){r.forEach((e=>e.sort()));const e=r.map((e=>`[${e}]`)).join("; ");throw new Error(`Config initialization failed. Parameters in conflict: ${e}`)}}function h(e,t,r){if(typeof e!==t)throw new s.ExpectedValueOfTypeError(t,r)}},(e,t,r)=>{"use strict";function n(e,t,r){let n=(e=e.replace(/\s\s+/g," ").trim().toLowerCase()).substring(e.length-2);"am"===n||"pm"===n?e=e.substring(0,e.length-2).trim():(n=e.substring(e.length-1),"a"===n||"p"===n?e=e.substring(0,e.length-1).trim():n=void 0);const s=e.split(/[ /.-]/g);s.length>=2&&s[s.length-2].includes(":")&&(s[s.length-2]=s[s.length-2]+"."+s[s.length-1],s.pop());const a=s[s.length-1].split(":");if(void 0!==n&&a.push(n),1===s.length)return o(a,r);if(1===a.length)return i(s,t);const l=i(s.slice(0,s.length-1),t),u=o(a,r);return void 0===l||void 0===u?void 0:Object.assign(Object.assign({},l),u)}r.r(t),r.d(t,{defaultParseToDateTime:()=>n,secondsExtendedRegexp:()=>s});const s=/^ss(\.(s+|0+))?$/;function o(e,t){if(void 0===t)return;(t=t.toLowerCase()).endsWith("am/pm")?t=t.substring(0,t.length-5).trim():t.endsWith("a/p")&&(t=t.substring(0,t.length-3).trim());const r=t.split(":");let n;if("am"===e[e.length-1]||"a"===e[e.length-1]?(n=!1,e.pop()):"pm"!==e[e.length-1]&&"p"!==e[e.length-1]||(n=!0,e.pop()),e.length!==r.length)return;const o=r.indexOf("hh"),i=r.indexOf("mm"),a=r.findIndex((e=>s.test(e))),l=-1!==o?e[o]:"0";if(!/^\d+$/.test(l))return;let u=Number(l);if(void 0!==n){if(u<0||u>12)return;u%=12,n&&(u+=12)}const h=-1!==i?e[i]:"0";if(!/^\d+$/.test(h))return;const c=Number(h),d=-1!==a?e[a]:"0";if(!/^\d+(\.\d+)?$/.test(d))return;return{hours:u,minutes:c,seconds:Math.round(1e3*Number(d))/1e3}}function i(e,t){if(void 0===t)return;const r=t.toLowerCase().split(/[ /.-]/g);if(e.length!==r.length)return;const n=r.indexOf("mm"),s=r.indexOf("dd"),o=r.indexOf("yyyy"),i=r.indexOf("yy");if(!(n in e)||!(s in e)||!(o in e)&&!(i in e))return;if(o in e&&i in e)return;let a;if(o in e){const t=e[o];if(!/^\d+$/.test(t))return;if(a=Number(t),a<1e3||a>9999)return}else{const t=e[i];if(!/^\d+$/.test(t))return;if(a=Number(t),a<0||a>99)return}const l=e[n];if(!/^\d+$/.test(l))return;const u=Number(l),h=e[s];if(!/^\d+$/.test(h))return;return{year:a,month:u,day:Number(h)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DateTimeHelper:()=>d,instanceOfSimpleDate:()=>u,instanceOfSimpleTime:()=>h,maxDate:()=>c,numberToSimpleTime:()=>f,offsetMonth:()=>p,roundToNearestSecond:()=>m,timeToNumber:()=>y,toBasisEU:()=>E,truncateDayInMonth:()=>g});var n=r(70);const s=[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],i=60,a=60,l=24;function u(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 h(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)}const c={year:9999,month:12,day:31};class d{constructor(e){this.config=e,this.minDateAbsoluteValue=this.dateToNumberFromZero(e.nullDate),this.maxDateValue=this.dateToNumber(c),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){const{dateTime:t,dateFormat:r="",timeFormat:s=""}=this.parseDateTimeFromConfigFormats(e);if(void 0!==t)return h(t)?u(t)?new n.DateTimeNumber(y(t)+this.dateToNumber(t),r+" "+s):new n.TimeNumber(y(t),s):u(t)?new n.DateNumber(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<=s[e.month-1])))))}dateToNumber(e){return this.dateToNumberFromZero(e)-this.minDateAbsoluteValue}relativeNumberToAbsoluteNumber(e){return e+this.minDateAbsoluteValue-(this.leapYear1900?1:0)}numberToSimpleDate(e){const t=Math.floor(e)+this.minDateAbsoluteValue;let r=Math.floor(t/365.2425);this.dateToNumberFromZero({year:r+1,month:1,day:1})<=t?r++:this.dateToNumberFromZero({year:r-1,month:1,day:1})>t&&r--;const n=t-this.dateToNumberFromZero({year:r,month:1,day:1}),s=function(e){let t=0;o[t+6]<=e&&(t+=6);o[t+3]<=e&&(t+=3);o[t+2]<=e?t+=2:o[t+1]<=e&&(t+=1);return t}(n-(this.isLeapYear(r)&&n>=59?1:0));return{year:r,month:s+1,day:n-o[s]-(this.isLeapYear(r)&&s>1?1:0)+1}}numberToSimpleDateTime(e){const t=f(e%1),r=Math.floor(t.hours/l);t.hours=t.hours%l;const n=this.numberToSimpleDate(Math.floor(e)+r);return Object.assign(Object.assign({},n),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:s[t-1]}endOfMonth(e){return{year:e.year,month:e.month,day:this.daysInMonth(e.year,e.month)}}toBasisUS(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){const n=this.parseDateTime(e,t,r);if(!u(n)||(n.year>=0&&n.year<100&&(n.year<this.getNullYear()?n.year+=2e3:n.year+=1900),this.isValidDate(n)))return n}parseDateTimeFromFormats(e,t,r){const n=0===t.length?[void 0]:t,s=0===r.length?[void 0]:r;for(const t of n)for(const r of s){const n=this.parseSingleFormat(e,t,r);if(void 0!==n)return{dateTime:n,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 p(e,t){const r=12*e.year+e.month-1+t;return{year:Math.floor(r/12),month:r%12+1,day:e.day}}function g(e){return{year:e.year,month:e.month,day:Math.min(e.day,s[e.month-1])}}function m(e){return Math.round(3600*e*24)/86400}function f(e){const t=e*l*a*i,r=function(e,t=1){return Math.round(e*t)/t}(t%i,1e5)%i,n=(t-r)/i,s=Math.round(n%a)%a,o=(n-s)/a;return{hours:Math.round(o),minutes:s,seconds:r}}function y(e){return((e.seconds/60+e.minutes)/60+e.hours)/24}function E(e){return{year:e.year,month:e.month,day:Math.min(30,e.day)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AlwaysDense:()=>a,AlwaysSparse:()=>i,DenseSparseChooseBasedOnThreshold:()=>o});var n=r(92),s=r(91);class o{constructor(e){this.threshold=e}call(e){return e>this.threshold?n.DenseStrategy:s.SparseStrategy}}class i{call(){return s.SparseStrategy}}class a{call(){return n.DenseStrategy}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{defaultStringifyDateTime:()=>c,defaultStringifyDuration:()=>h,format:()=>i,padLeft:()=>a,padRight:()=>l});var n=r(101),s=r(102),o=r(105);function i(e,t,r,n){const i=r.stringifyDateTime(n.numberToSimpleDateTime(e),t);if(void 0!==i)return i;const h=r.stringifyDuration((0,s.numberToSimpleTime)(e),t);if(void 0!==h)return h;const c=(0,o.parseForNumberFormat)(t);return void 0!==c?function(e,t){let r="";for(let n=0;n<e.length;++n){const s=e[n];if(s.type===o.TokenType.FREE_TEXT){r+=s.value;continue}const i=s.value.split("."),h=i[0],c=i[1]||"",d=i[1]?".":"",p=Number(t.toFixed(c.length)).toString().split(".");let g=p[0]||"",m=p[1]||"";if(h.length>g.length){g=a(g,u(h.substr(0,h.length-g.length),"0")+g.length)}m=l(m,u(c.substr(m.length,c.length-m.length),"0")+m.length),r+=g+d+m}return r}(c.tokens,e):t}function a(e,t){let r=`${e}`;for(;r.length<t;)r="0"+r;return r}function l(e,t){let r=`${e}`;for(;r.length<t;)r+="0";return r}function u(e,t){return e.split(t).length-1}function h(e,t){const r=(0,o.parseForDateTimeFormat)(t);if(void 0===r)return;const s=r.tokens;let i="";for(const t of s)if(t.type!==o.TokenType.FREE_TEXT)switch(t.value.toLowerCase()){case"h":case"hh":i+=a(e.hours,t.value.length),e.hours=0;break;case"[hh]":i+=a(e.hours,t.value.length-2),e.hours=0;break;case"m":case"mm":i+=a(e.minutes,t.value.length),e.minutes=0;break;case"[mm]":i+=a(e.minutes+60*e.hours,t.value.length-2),e.minutes=0,e.hours=0;break;case"s":case"ss":i+=a(Math.floor(e.seconds),t.value.length);break;default:if(n.secondsExtendedRegexp.test(t.value)){const r=Math.max(t.value.length-3,0);i+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,r))/Math.pow(10,r)}`;continue}return}else i+=t.value;return i}function c(e,t){const r=(0,o.parseForDateTimeFormat)(t);if(void 0===r)return;const s=r.tokens;let i="",l=!1;const u=s.some((e=>e.type===o.TokenType.FORMAT&&("a/p"===e.value||"A/P"===e.value||"am/pm"===e.value||"AM/PM"===e.value)));for(let t=0;t<s.length;t++){const r=s[t];if(r.type!==o.TokenType.FREE_TEXT)switch(r.value.toLowerCase()){case"h":case"hh":l=!0,i+=a(u?(e.hours+11)%12+1:e.hours,r.value.length);break;case"d":case"dd":i+=a(e.day,r.value.length);break;case"s":case"ss":i+=a(Math.floor(e.seconds),r.value.length);break;case"m":case"mm":t+1<s.length&&s[t+1].value.startsWith(":")&&(l=!0),i+=a(l?e.minutes:e.month,r.value.length),l=!0;break;case"yy":i+=a(e.year%100,r.value.length);break;case"yyyy":i+=e.year;break;case"am/pm":case"a/p":{const[t,n]=r.value.split("/");i+=e.hours<12?t:n;break}default:if(n.secondsExtendedRegexp.test(r.value)){const t=r.value.length-3;i+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,t))/Math.pow(10,t)}`;continue}return}else i+=r.value}return i}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FormatExpressionType:()=>i,TokenType:()=>o,formatToken:()=>a,isEscapeToken:()=>d,parse:()=>c,parseForDateTimeFormat:()=>u,parseForNumberFormat:()=>h});const n=/(\\.|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,s=/(\\.|[#0]+(\.[#0]*)?)/g;var o,i;function a(e,t){return{type:e,value:t}}function l(e,t){const r=[];let n=0;for(let s=0;s<e.length;++s){const i=e[s];if(i.index!==n){const e=t.substr(n,i.index-n);r.push(a(o.FREE_TEXT,e))}i[0].startsWith("\\")?r.push(a(o.FREE_TEXT,i[0])):r.push(a(o.FORMAT,i[0])),n=i.index+i[0].length}const s=e[e.length-1];if(s.index+s[0].length<t.length){const e=t.substr(s.index+s[0].length,t.length);r.push(a(o.FREE_TEXT,e))}return r}function u(e){const t=function(e){n.lastIndex=0;const t=[];let r;do{r=n.exec(e),null!==r&&t.push(r)}while(r);return t}(e);return t.every((e=>d(e)))?void 0:{type:i.DATE,tokens:l(t,e)}}function h(e){const t=function(e){s.lastIndex=0;const t=s.exec(e);return null!==t?[t]:[]}(e);return t.every((e=>d(e)))?void 0:{type:i.NUMBER,tokens:l(t,e)}}function c(e){var t,r;return null!==(r=null!==(t=u(e))&&void 0!==t?t:h(e))&&void 0!==r?r:{type:i.STRING,tokens:[{type:o.FREE_TEXT,value:e}]}}function d(e){return e[0].startsWith("\\")}!function(e){e.FORMAT="FORMAT",e.FREE_TEXT="FREE_TEXT"}(o||(o={})),function(e){e.DATE="DATE",e.NUMBER="NUMBER",e.STRING="STRING"}(i||(i={}))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{checkLicenseKeyValidity:()=>i});var n=r(107);const s={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."};let o=!1;function i(e){const t={template:"missing",vars:{}};if("gpl-v3"===e||"internal-use-in-handsontable"===e)t.template="valid";else if("string"==typeof e&&(0,n.checkKeySchema)(e)){const[r,s,o]="29/05/2023".split("/"),i=Math.floor(new Date(`${s}/${r}/${o}`).getTime()/864e5),a=(0,n.extractTime)(e);t.vars.keyValidityDate=function(e){const t=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],r=e.getDate(),n=e.getFullYear();return`${t} ${r}, ${n}`}(new Date(864e5*(a+1))),t.template=i>a?"expired":"valid"}else""!==e&&(t.template="invalid");return o||"valid"===t.template||(console.warn(s[t.template](t.vars)),o=!0),t.template}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{checkKeySchema:()=>h,extractTime:()=>u});const n="length",s=e=>parseInt(e,16),o=e=>parseInt(e,10),i=e=>(e+"").replace(/\-/g,""),a=(e,t,r)=>e.substr(t,r),l=e=>e.codePointAt(0)-65;function u(e){return 25===i(e)[n]?s(a(i(e),s("12"),l("F")))/(s(a(i(e),l("C"),l("Y")>>4))||1+(~~![][n]<<3)):0}function h(e){if((e=(e+"").replace(/\-/g,""))[n]!==l("Z"))return!1;let t=0;return[[0,l("G")+1],[l("H"),l("H")-1],[l("G")+l("H"),l("G")]].reduce(((r,[n,i],l)=>(r|=(o(`${o(s(a(e,t+n-(0===l?0:2),i+(l?2:0)))+(s(a(e,t+n+i,2))+[]).padStart(2,"0"))}`)%97||2)>>1,t+=2,r)),l("A"))===[]+1>>1}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{HyperFormula:()=>y});var n=r(2),s=r(100),o=r(109),i=r(3),a=r(110),l=r(99),u=r(102),h=r(141),c=r(142),d=r(77),p=r(86),g=r(128),m=r(114),f=r(7);class y{constructor(e,t,r,n,s,o,i,a,l,u,h,d,p,g){this._config=e,this._stats=t,this._dependencyGraph=r,this._columnSearch=n,this._parser=s,this._unparser=o,this._cellContentParser=i,this._evaluator=a,this._lazilyTransformingAstService=l,this._crudOperations=u,this._exporter=h,this._namedExpressions=d,this._serialization=p,this._functionRegistry=g,this._emitter=new c.Emitter,this._evaluationSuspended=!1}static get defaultConfig(){return(0,l.getDefaultConfig)()}get graph(){return this.dependencyGraph.graph}get rangeMapping(){return this.dependencyGraph.rangeMapping}get arrayMapping(){return this.dependencyGraph.arrayMapping}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}get dependencyGraph(){return this._dependencyGraph}get evaluator(){return this._evaluator}get columnSearch(){return this._columnSearch}get lazilyTransformingAstService(){return this._lazilyTransformingAstService}get licenseKeyValidityState(){return this._config.licenseKeyValidityState}static buildFromArray(e,t={},r=[]){return this.buildFromEngineState(o.BuildEngineFactory.buildFromSheet(e,t,r))}static buildFromSheets(e,t={},r=[]){return this.buildFromEngineState(o.BuildEngineFactory.buildFromSheets(e,t,r))}static buildEmpty(e={},t=[]){return this.buildFromEngineState(o.BuildEngineFactory.buildEmpty(e,t))}static getLanguage(e){(0,s.validateArgToType)(e,"string","languageCode");const t=this.registeredLanguages.get(e);if(void 0===t)throw new d.LanguageNotRegisteredError;return t}static registerLanguage(e,t){if((0,s.validateArgToType)(e,"string","languageCode"),this.registeredLanguages.has(e))throw new d.LanguageAlreadyRegisteredError;this.registeredLanguages.set(e,(0,p.buildTranslationPackage)(t))}static unregisterLanguage(e){if((0,s.validateArgToType)(e,"string","languageCode"),!this.registeredLanguages.has(e))throw new d.LanguageNotRegisteredError;this.registeredLanguages.delete(e)}static getRegisteredLanguagesCodes(){return Array.from(this.registeredLanguages.keys())}static registerFunctionPlugin(e,t){g.FunctionRegistry.registerFunctionPlugin(e,t)}static unregisterFunctionPlugin(e){g.FunctionRegistry.unregisterFunctionPlugin(e)}static registerFunction(e,t,r){(0,s.validateArgToType)(e,"string","functionId"),g.FunctionRegistry.registerFunction(e,t,r)}static unregisterFunction(e){(0,s.validateArgToType)(e,"string","functionId"),g.FunctionRegistry.unregisterFunction(e)}static unregisterAllFunctions(){g.FunctionRegistry.unregisterAll()}static getRegisteredFunctionNames(e){(0,s.validateArgToType)(e,"string","code");const t=g.FunctionRegistry.getRegisteredFunctionIds();return this.getLanguage(e).getFunctionTranslations(t)}static getFunctionPlugin(e){return(0,s.validateArgToType)(e,"string","functionId"),g.FunctionRegistry.getFunctionPlugin(e)}static getAllFunctionPlugins(){return g.FunctionRegistry.getPlugins()}static buildFromEngineState(e){return new y(e.config,e.stats,e.dependencyGraph,e.columnSearch,e.parser,e.unparser,e.cellContentParser,e.evaluator,e.lazilyTransformingAstService,e.crudOperations,e.exporter,e.namedExpressions,e.serialization,e.functionRegistry)}getCellValue(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellValue(e)}getCellFormula(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this._serialization.getCellFormula(e)}getCellHyperlink(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellHyperlink(e)}getCellSerialized(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellSerialized(e)}getSheetValues(e){return(0,s.validateArgToType)(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetValues(e)}getSheetFormulas(e){return(0,s.validateArgToType)(e,"number","sheetId"),this._serialization.getSheetFormulas(e)}getSheetSerialized(e){return(0,s.validateArgToType)(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetSerialized(e)}getAllSheetsDimensions(){return this._serialization.genericAllSheetsGetter((e=>this.getSheetDimensions(e)))}getSheetDimensions(e){return(0,s.validateArgToType)(e,"number","sheetId"),{width:this.dependencyGraph.getSheetWidth(e),height:this.dependencyGraph.getSheetHeight(e)}}getAllSheetsValues(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsValues()}getAllSheetsFormulas(){return this._serialization.getAllSheetsFormulas()}getAllSheetsSerialized(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsSerialized()}updateConfig(e){Object.entries(e).every((([e,t])=>this._config[e]===t))||this.rebuildWithConfig(e)}getConfig(){return this._config.getConfig()}rebuildAndRecalculate(){this.rebuildWithConfig({})}getStats(){return this._stats.snapshot()}undo(){return this._crudOperations.undo(),this.recomputeIfDependencyGraphNeedsIt()}redo(){return this._crudOperations.redo(),this.recomputeIfDependencyGraphNeedsIt()}isThereSomethingToUndo(){return this._crudOperations.isThereSomethingToUndo()}isThereSomethingToRedo(){return this._crudOperations.isThereSomethingToRedo()}isItPossibleToSetCellContents(e){let t;if((0,i.isSimpleCellAddress)(e))t=new n.AbsoluteCellRange(e,e);else{if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange","address");t=new n.AbsoluteCellRange(e.start,e.end)}try{this._crudOperations.ensureRangeInSizeLimits(t);for(const e of t.addresses(this._dependencyGraph))this._crudOperations.ensureItIsPossibleToChangeContent(e)}catch(e){return!1}return!0}setCellContents(e,t){return this._crudOperations.setCellContents(e,t),this.recomputeIfDependencyGraphNeedsIt()}swapRowIndexes(e,t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.setRowOrder(e,t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToSwapRowIndexes(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.validateSwapRowIndexes(e,t),this._crudOperations.testRowOrderForArrays(e,t),!0}catch(e){return!1}}setRowOrder(e,t){(0,s.validateArgToType)(e,"number","sheetId");const r=this._crudOperations.mappingFromOrder(e,t,"row");return this.swapRowIndexes(e,r)}isItPossibleToSetRowOrder(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{const r=this._crudOperations.mappingFromOrder(e,t,"row");return this._crudOperations.validateSwapRowIndexes(e,r),this._crudOperations.testRowOrderForArrays(e,r),!0}catch(e){return!1}}swapColumnIndexes(e,t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.setColumnOrder(e,t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToSwapColumnIndexes(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.validateSwapColumnIndexes(e,t),this._crudOperations.testColumnOrderForArrays(e,t),!0}catch(e){return!1}}setColumnOrder(e,t){(0,s.validateArgToType)(e,"number","sheetId");const r=this._crudOperations.mappingFromOrder(e,t,"column");return this.swapColumnIndexes(e,r)}isItPossibleToSetColumnOrder(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{const r=this._crudOperations.mappingFromOrder(e,t,"column");return this._crudOperations.validateSwapColumnIndexes(e,r),this._crudOperations.testColumnOrderForArrays(e,r),!0}catch(e){return!1}}isItPossibleToAddRows(e,...t){(0,s.validateArgToType)(e,"number","sheetId");const r=(0,m.normalizeAddedIndexes)(t);try{return this._crudOperations.ensureItIsPossibleToAddRows(e,...r),!0}catch(e){return!1}}addRows(e,...t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.addRows(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveRows(e,...t){(0,s.validateArgToType)(e,"number","sheetId");const r=(0,m.normalizeRemovedIndexes)(t);try{return this._crudOperations.ensureItIsPossibleToRemoveRows(e,...r),!0}catch(e){return!1}}removeRows(e,...t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.removeRows(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToAddColumns(e,...t){(0,s.validateArgToType)(e,"number","sheetId");const r=(0,m.normalizeAddedIndexes)(t);try{return this._crudOperations.ensureItIsPossibleToAddColumns(e,...r),!0}catch(e){return!1}}addColumns(e,...t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.addColumns(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveColumns(e,...t){(0,s.validateArgToType)(e,"number","sheetId");const r=(0,m.normalizeRemovedIndexes)(t);try{return this._crudOperations.ensureItIsPossibleToRemoveColumns(e,...r),!0}catch(e){return!1}}removeColumns(e,...t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.removeColumns(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveCells(e,t){if(!(0,i.isSimpleCellAddress)(t))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","destinationLeftCorner");if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");try{const r=new n.AbsoluteCellRange(e.start,e.end);return this._crudOperations.operations.ensureItIsPossibleToMoveCells(r.start,r.width(),r.height(),t),!0}catch(e){return!1}}moveCells(e,t){if(!(0,i.isSimpleCellAddress)(t))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","destinationLeftCorner");if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");const r=new n.AbsoluteCellRange(e.start,e.end);return this._crudOperations.moveCells(r.start,r.width(),r.height(),t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveRows(e,t,r,n){(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"number","startRow"),(0,s.validateArgToType)(r,"number","numberOfRows"),(0,s.validateArgToType)(n,"number","targetRow");try{return this._crudOperations.ensureItIsPossibleToMoveRows(e,t,r,n),!0}catch(e){return!1}}moveRows(e,t,r,n){return(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"number","startRow"),(0,s.validateArgToType)(r,"number","numberOfRows"),(0,s.validateArgToType)(n,"number","targetRow"),this._crudOperations.moveRows(e,t,r,n),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveColumns(e,t,r,n){(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"number","startColumn"),(0,s.validateArgToType)(r,"number","numberOfColumns"),(0,s.validateArgToType)(n,"number","targetColumn");try{return this._crudOperations.ensureItIsPossibleToMoveColumns(e,t,r,n),!0}catch(e){return!1}}moveColumns(e,t,r,n){return(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"number","startColumn"),(0,s.validateArgToType)(r,"number","numberOfColumns"),(0,s.validateArgToType)(n,"number","targetColumn"),this._crudOperations.moveColumns(e,t,r,n),this.recomputeIfDependencyGraphNeedsIt()}copy(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");const t=new n.AbsoluteCellRange(e.start,e.end);return this._crudOperations.copy(t.start,t.width(),t.height()),this.getRangeValues(e)}cut(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");const t=new n.AbsoluteCellRange(e.start,e.end);return this._crudOperations.cut(t.start,t.width(),t.height()),this.getRangeValues(e)}paste(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","targetLeftCorner");return this.ensureEvaluationIsNotSuspended(),this._crudOperations.paste(e),this.recomputeIfDependencyGraphNeedsIt()}isClipboardEmpty(){return this._crudOperations.isClipboardEmpty()}clearClipboard(){this._crudOperations.clearClipboard()}clearRedoStack(){this._crudOperations.undoRedo.clearRedoStack()}clearUndoStack(){this._crudOperations.undoRedo.clearUndoStack()}getRangeValues(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");return new n.AbsoluteCellRange(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellValue(e)))))}getRangeFormulas(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");return new n.AbsoluteCellRange(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellFormula(e)))))}getRangeSerialized(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");return new n.AbsoluteCellRange(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellSerialized(e)))))}getFillRangeData(e,t,r=!1){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");if(!(0,n.isSimpleCellRange)(t))throw new d.ExpectedValueOfTypeError("SimpleCellRange","target");const s=new n.AbsoluteCellRange(e.start,e.end),o=new n.AbsoluteCellRange(t.start,t.end);return this.ensureEvaluationIsNotSuspended(),o.arrayOfAddressesInRange().map((n=>n.map((n=>{const o=((n.row-(r?t:e).start.row)%s.height()+s.height())%s.height()+e.start.row,i=((n.col-(r?t:e).start.col)%s.width()+s.width())%s.width()+e.start.col;return this._serialization.getCellSerialized({row:o,col:i,sheet:s.sheet},n)}))))}isItPossibleToAddSheet(e){(0,s.validateArgToType)(e,"string","sheetName");try{return this._crudOperations.ensureItIsPossibleToAddSheet(e),!0}catch(e){return!1}}addSheet(e){void 0!==e&&(0,s.validateArgToType)(e,"string","sheetName");const t=this._crudOperations.addSheet(e);return this._emitter.emit(c.Events.SheetAdded,t),t}isItPossibleToRemoveSheet(e){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),!0}catch(e){return!1}}removeSheet(e){(0,s.validateArgToType)(e,"number","sheetId");const t=this.sheetMapping.getDisplayName(e);this._crudOperations.removeSheet(e);const r=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(c.Events.SheetRemoved,t,r),r}isItPossibleToClearSheet(e){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),!0}catch(e){return!1}}clearSheet(e){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.clearSheet(e),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToReplaceSheetContent(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),this._crudOperations.ensureItIsPossibleToChangeSheetContents(e,t),!0}catch(e){return!1}}setSheetContent(e,t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.setSheetContent(e,t),this.recomputeIfDependencyGraphNeedsIt()}simpleCellAddressFromString(e,t){return(0,s.validateArgToType)(e,"string","cellAddress"),(0,s.validateArgToType)(t,"number","sheetId"),(0,f.simpleCellAddressFromString)(this.sheetMapping.get,e,t)}simpleCellRangeFromString(e,t){return(0,s.validateArgToType)(e,"string","cellRange"),(0,s.validateArgToType)(t,"number","sheetId"),(0,f.simpleCellRangeFromString)(this.sheetMapping.get,e,t)}simpleCellAddressToString(e,t){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return(0,s.validateArgToType)(t,"number","sheetId"),(0,f.simpleCellAddressToString)(this.sheetMapping.fetchDisplayName,e,t)}simpleCellRangeToString(e,t){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","cellRange");return(0,s.validateArgToType)(t,"number","sheetId"),(0,f.simpleCellRangeToString)(this.sheetMapping.fetchDisplayName,e,t)}getCellDependents(e){let t;if((0,i.isSimpleCellAddress)(e))t=this._dependencyGraph.addressMapping.getCell(e);else{if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange",e);t=this._dependencyGraph.rangeMapping.getRange(e.start,e.end)}return void 0===t?[]:this._dependencyGraph.getAdjacentNodesAddresses(t)}getCellPrecedents(e){let t;if((0,i.isSimpleCellAddress)(e))t=this._dependencyGraph.addressMapping.getCell(e);else{if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange",e);t=this._dependencyGraph.rangeMapping.getRange(e.start,e.end)}return void 0===t?[]:this._dependencyGraph.dependencyQueryAddresses(t)}getSheetName(e){return(0,s.validateArgToType)(e,"number","sheetId"),this.sheetMapping.getDisplayName(e)}getSheetNames(){return this.sheetMapping.sheetNames()}getSheetId(e){return(0,s.validateArgToType)(e,"string","sheetName"),this.sheetMapping.get(e)}doesSheetExist(e){return(0,s.validateArgToType)(e,"string","sheetName"),this.sheetMapping.hasSheetWithName(e)}getCellType(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");const t=this.dependencyGraph.getCell(e);return(0,i.getCellType)(t,e)}doesCellHaveSimpleValue(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.getCellType(e)===i.CellType.VALUE}doesCellHaveFormula(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");const t=this.getCellType(e);return t===i.CellType.FORMULA||t===i.CellType.ARRAYFORMULA}isCellEmpty(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.getCellType(e)===i.CellType.EMPTY}isCellPartOfArray(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");const t=this.getCellType(e);return t===i.CellType.ARRAY||t===i.CellType.ARRAYFORMULA}getCellValueType(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return(0,i.getCellValueType)(t)}getCellValueDetailedType(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return(0,i.getCellValueDetailedType)(t)}getCellValueFormat(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return(0,i.getCellValueFormat)(t)}countSheets(){return this.sheetMapping.numberOfSheets()}isItPossibleToRenameSheet(e,t){(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"string","newName");try{return this._crudOperations.ensureItIsPossibleToRenameSheet(e,t),!0}catch(e){return!1}}renameSheet(e,t){(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"string","newName");const r=this._crudOperations.renameSheet(e,t);void 0!==r&&this._emitter.emit(c.Events.SheetRenamed,r,t)}batch(e){this.suspendEvaluation(),this._crudOperations.beginUndoRedoBatchMode();try{e()}catch(e){throw this._crudOperations.commitUndoRedoBatchMode(),this.resumeEvaluation(),e}return this._crudOperations.commitUndoRedoBatchMode(),this.resumeEvaluation()}suspendEvaluation(){this._evaluationSuspended=!0,this._emitter.emit(c.Events.EvaluationSuspended)}resumeEvaluation(){this._evaluationSuspended=!1;const e=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(c.Events.EvaluationResumed,e),e}isEvaluationSuspended(){return this._evaluationSuspended}isItPossibleToAddNamedExpression(e,t,r){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==r&&(0,s.validateArgToType)(r,"number","scope");try{return this._crudOperations.ensureItIsPossibleToAddNamedExpression(e,t,r),!0}catch(e){return!1}}addNamedExpression(e,t,r,n){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==r&&(0,s.validateArgToType)(r,"number","scope"),this._crudOperations.addNamedExpression(e,t,r,n);const o=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(c.Events.NamedExpressionAdded,e,o),o}getNamedExpressionValue(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope"),this.ensureEvaluationIsNotSuspended(),this._crudOperations.ensureScopeIdIsValid(t);const r=this._namedExpressions.namedExpressionForScope(e,t);return r?this._serialization.getCellValue(r.address):void 0}getNamedExpressionFormula(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope"),this._crudOperations.ensureScopeIdIsValid(t);const r=this._namedExpressions.namedExpressionForScope(e,t);return void 0===r?void 0:this._serialization.getCellFormula(r.address)}getNamedExpression(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope");const r=this._namedExpressions.namedExpressionForScope(e,t);if(void 0===r)return;return{name:e,scope:t,expression:this._serialization.getCellFormula(r.address),options:r.options}}isItPossibleToChangeNamedExpression(e,t,r){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==r&&(0,s.validateArgToType)(r,"number","scope");try{return this._crudOperations.ensureItIsPossibleToChangeNamedExpression(e,t,r),!0}catch(e){return!1}}changeNamedExpression(e,t,r,n){return(0,s.validateArgToType)(e,"string","expressionName"),void 0!==r&&(0,s.validateArgToType)(r,"number","scope"),this._crudOperations.changeNamedExpressionExpression(e,r,t,n),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveNamedExpression(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope");try{return this._crudOperations.isItPossibleToRemoveNamedExpression(e,t),!0}catch(e){return!1}}removeNamedExpression(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope");const r=this._crudOperations.removeNamedExpression(e,t);if(r){const e=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(c.Events.NamedExpressionRemoved,r.displayName,e),e}return[]}listNamedExpressions(e){return void 0!==e&&(0,s.validateArgToType)(e,"number","scope"),this._crudOperations.ensureScopeIdIsValid(e),this._namedExpressions.getAllNamedExpressionsNamesInScope(e)}getAllNamedExpressionsSerialized(){return this._serialization.getAllNamedExpressionsSerialized()}normalizeFormula(e){(0,s.validateArgToType)(e,"string","formulaString");const{ast:t,address:r}=this.extractTemporaryFormula(e);if(void 0===t)throw new d.NotAFormulaError;return this._unparser.unparse(t,r)}calculateFormula(e,t){(0,s.validateArgToType)(e,"string","formulaString"),(0,s.validateArgToType)(t,"number","sheetId"),this._crudOperations.ensureScopeIdIsValid(t);const{ast:r,address:n,dependencies:o}=this.extractTemporaryFormula(e,t);if(void 0===r)throw new d.NotAFormulaError;const i=this.evaluator.runAndForget(r,n,o);return this._exporter.exportScalarOrRange(i)}validateFormula(e){(0,s.validateArgToType)(e,"string","formulaString");const{ast:t}=this.extractTemporaryFormula(e);return void 0!==t&&!(t.type===f.AstNodeType.ERROR&&!t.error)}getRegisteredFunctionNames(){return y.getLanguage(this._config.language).getFunctionTranslations(this._functionRegistry.getRegisteredFunctionIds())}getFunctionPlugin(e){return(0,s.validateArgToType)(e,"string","functionId"),this._functionRegistry.getFunctionPlugin(e)}getAllFunctionPlugins(){return this._functionRegistry.getPlugins()}numberToDateTime(e){return(0,s.validateArgToType)(e,"number","val"),this._evaluator.interpreter.dateTimeHelper.numberToSimpleDateTime(e)}numberToDate(e){return(0,s.validateArgToType)(e,"number","val"),this._evaluator.interpreter.dateTimeHelper.numberToSimpleDate(e)}numberToTime(e){return(0,s.validateArgToType)(e,"number","val"),(0,u.numberToSimpleTime)(e)}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}destroy(){(0,h.objectDestroy)(this)}ensureEvaluationIsNotSuspended(){if(this._evaluationSuspended)throw new d.EvaluationSuspendedError}extractTemporaryFormula(e,t=1){const r=this._cellContentParser.parse(e),n={sheet:t,col:0,row:0};if(!(r instanceof a.CellContent.Formula))return{address:n,dependencies:[]};const{ast:s,errors:o,dependencies:i}=this._parser.parse(r.formula,n);return o.length>0?{address:n,dependencies:[]}:{ast:s,address:n,dependencies:i}}rebuildWithConfig(e){const t=this._config.mergeConfig(e),r=this._config.mergeConfig({language:e.language}),n=this._serialization.withNewConfig(r,this._namedExpressions).getAllSheetsSerialized(),s=this._serialization.getAllNamedExpressionsSerialized(),i=o.BuildEngineFactory.rebuildWithConfig(t,n,s,this._stats);this._config=i.config,this._stats=i.stats,this._dependencyGraph=i.dependencyGraph,this._columnSearch=i.columnSearch,this._parser=i.parser,this._unparser=i.unparser,this._cellContentParser=i.cellContentParser,this._evaluator=i.evaluator,this._lazilyTransformingAstService=i.lazilyTransformingAstService,this._crudOperations=i.crudOperations,this._exporter=i.exporter,this._namedExpressions=i.namedExpressions,this._serialization=i.serialization,this._functionRegistry=i.functionRegistry}recomputeIfDependencyGraphNeedsIt(){if(this._evaluationSuspended)return[];{const e=this._crudOperations.getAndClearContentChanges(),t=Array.from(this.dependencyGraph.verticesToRecompute());this.dependencyGraph.clearRecentlyChangedVertices(),t.length>0&&e.addAll(this.evaluator.partialRun(t));const r=e.exportChanges(this._exporter);return e.isEmpty()||this._emitter.emit(c.Events.ValuesUpdated,r),r}}}y.version="2.5.0",y.buildDate="29/05/2023 09:32:33",y.releaseDate="29/05/2023",y.languages={},y.registeredLanguages=new Map},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BuildEngineFactory:()=>M});var n=r(1),s=r(110),o=r(111),i=r(99),a=r(112),l=r(102),u=r(4),h=r(77),c=r(125),d=r(126),p=r(127),g=r(86),m=r(95),f=r(128),y=r(130),E=r(132),C=r(134),T=r(113),R=r(139),w=r(114),S=r(7),v=r(140),A=r(123),N=r(72),O=r(124);class M{static buildFromSheets(e,t={},r=[]){const n=new i.Config(t);return this.buildEngine(n,e,r)}static buildFromSheet(e,t={},r=[]){const n=new i.Config(t),s=n.translationPackage.getUITranslation(g.UIElement.NEW_SHEET_PREFIX)+"1";return this.buildEngine(n,{[s]:e},r)}static buildEmpty(e={},t=[]){return this.buildEngine(new i.Config(e),{},t)}static rebuildWithConfig(e,t,r,n){return this.buildEngine(e,t,r,n)}static buildEngine(e,t={},r=[],i=(e.useStats?new N.Statistics:new N.EmptyStatistics)){i.start(N.StatType.BUILD_ENGINE_TOTAL);const g=new T.NamedExpressions,M=new f.FunctionRegistry(e),b=new E.LazilyTransformingAstService(i),I=u.DependencyGraph.buildEmpty(b,e,M,g,i),_=(0,C.buildColumnSearchStrategy)(I,e,i),x=I.sheetMapping,P=I.addressMapping;for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=t[r];(0,A.validateAsSheet)(n);const s=(0,A.findBoundaries)(n);if(s.height>e.maxRows||s.width>e.maxColumns)throw new h.SheetSizeLimitExceededError;const o=x.addSheet(r);P.autoAddSheet(o,n,s)}const L=new S.ParserWithCaching(e,M,x.get);b.parser=L;const D=new S.Unparser(e,(0,S.buildLexerConfig)(e),x.fetchDisplayName,g),F=new l.DateTimeHelper(e),k=new R.NumberLiteralHelper(e),H=new m.ArithmeticHelper(e,F,k),U=new s.CellContentParser(e,F,k),V=new n.ArraySizePredictor(e,M),B=new w.Operations(e,I,_,U,L,i,b,g,V),W=new O.UndoRedo(e,B);b.undoRedo=W;const G=new o.ClipboardOperations(e,I,B),Y=new a.CrudOperations(e,B,W,G,I,_,L,U,b,g);r.forEach((e=>{Y.ensureItIsPossibleToAddNamedExpression(e.name,e.expression,e.scope),Y.operations.addNamedExpression(e.name,e.expression,e.scope,e.options)}));const j=new d.Exporter(e,g,x.fetchDisplayName,b),z=new v.Serialization(I,D,j),$=new y.Interpreter(e,I,_,i,H,M,g,z,V,F);i.measure(N.StatType.GRAPH_BUILD,(()=>{new p.GraphBuilder(I,_,L,U,i,V).buildGraph(t,i)}));const K=new c.Evaluator(e,i,$,b,I,_);return K.run(),i.end(N.StatType.BUILD_ENGINE_TOTAL),{config:e,stats:i,dependencyGraph:I,columnSearch:_,parser:L,unparser:D,cellContentParser:U,evaluator:K,lazilyTransformingAstService:b,crudOperations:Y,exporter:j,namedExpressions:g,serialization:z,functionRegistry:M}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CellContent:()=>n,CellContentParser:()=>p,isBoolean:()=>c,isError:()=>d,isFormula:()=>h});var n,s=r(3),o=r(102),i=r(61),a=r(77),l=r(95),u=r(70);function h(e){return e.startsWith("=")}function c(e){const t=e.toLowerCase();return"true"===t||"false"===t}function d(e,t){const r=e.toUpperCase();return/#[A-Za-z0-9\/]+[?!]?/.test(r)&&Object.prototype.hasOwnProperty.call(t,r)}!function(e){e.Number=class{constructor(e){this.value=e,this.value=(0,u.cloneNumber)(this.value,(0,l.fixNegativeZero)((0,u.getRawValue)(this.value)))}};e.String=class{constructor(e){this.value=e}};e.Boolean=class{constructor(e){this.value=e}};class t{static getSingletonInstance(){return t.instance||(t.instance=new t),t.instance}}e.Empty=t;e.Formula=class{constructor(e){this.formula=e}};e.Error=class{constructor(e,t){this.value=new s.CellError(e,t)}}}(n||(n={}));class p{constructor(e,t,r){this.config=e,this.dateHelper=t,this.numberLiteralsHelper=r}parse(e){if(null==e)return n.Empty.getSingletonInstance();if("number"==typeof e)return(0,l.isNumberOverflow)(e)?new n.Error(s.ErrorType.NUM,i.ErrorMessage.ValueLarge):new n.Number(e);if("boolean"==typeof e)return new n.Boolean(e);if(e instanceof Date){const t=this.dateHelper.dateToNumber({day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear()})+(0,o.timeToNumber)({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()+e.getMilliseconds()/1e3});return t<0?new n.Error(s.ErrorType.NUM,i.ErrorMessage.DateBounds):t%1==0?new n.Number(new u.DateNumber(t,"Date()")):t<1?new n.Number(new u.TimeNumber(t,"Date()")):new n.Number(new u.DateTimeNumber(t,"Date()"))}if("string"==typeof e){if(c(e))return new n.Boolean("true"===e.toLowerCase());if(h(e))return new n.Formula(e);if(d(e,this.config.errorMapping))return new n.Error(this.config.errorMapping[e.toUpperCase()]);{let t,r=e.trim(),s=0;if(r.endsWith("%"))s=1,r=r.slice(0,r.length-1);else{const e=this.currencyMatcher(r);void 0!==e&&(s=2,[t,r]=e)}const o=this.numberLiteralsHelper.numericStringToMaybeNumber(r);if(void 0!==o){let e;return e=1===s?new u.PercentNumber(o/100):2===s?new u.CurrencyNumber(o,t):o,new n.Number(e)}const i=this.dateHelper.dateStringToDateNumber(r);return void 0!==i?new n.Number(i):new n.String(e.startsWith("'")?e.slice(1):e)}}throw new a.UnableToParseError(e)}currencyMatcher(e){for(const 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)]}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClipboardCellType:()=>s,ClipboardOperations:()=>u});var n,s,o=r(2),i=r(3),a=r(77);!function(e){e[e.COPY=0]="COPY",e[e.CUT=1]="CUT"}(n||(n={})),function(e){e[e.VALUE=0]="VALUE",e[e.EMPTY=1]="EMPTY",e[e.FORMULA=2]="FORMULA",e[e.PARSING_ERROR=3]="PARSING_ERROR"}(s||(s={}));class l{constructor(e,t,r,n,s){this.sourceLeftCorner=e,this.width=t,this.height=r,this.type=n,this.content=s}*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,i.simpleCellAddress)(e.sheet,e.col+r,e.row+t),this.content[t][r]]}}class u{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 l(e,t,r,n.CUT)}copy(e,t,r){const s=[];for(let n=0;n<r;++n){s[n]=[];for(let r=0;r<t;++r){const t=this.operations.getClipboardCell((0,i.simpleCellAddress)(e.sheet,e.col+r,e.row+n));s[n].push(t)}}this.clipboard=new l(e,t,r,n.COPY,s)}abortCut(){this.clipboard&&this.clipboard.type===n.CUT&&this.clear()}clear(){this.clipboard=void 0}ensureItIsPossibleToCopyPaste(e){if(void 0===this.clipboard)return;if((0,i.invalidSimpleCellAddress)(e)||!this.dependencyGraph.sheetMapping.hasSheetWithId(e.sheet))throw new a.InvalidArgumentsError("a valid target address.");const t=o.AbsoluteCellRange.spanFrom(e,this.clipboard.width,this.clipboard.height);if(t.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new a.SheetSizeLimitExceededError;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new Error("It is not possible to paste onto an array")}isCutClipboard(){return void 0!==this.clipboard&&this.clipboard.type===n.CUT}isCopyClipboard(){return void 0!==this.clipboard&&this.clipboard.type===n.COPY}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CrudOperations:()=>d});var n=r(2),s=r(3),o=r(110),i=r(77),a=r(113),l=r(114),u=r(123),h=r(71),c=r(124);class d{constructor(e,t,r,n,s,o,i,a,l,u){this.operations=t,this.undoRedo=r,this.clipboardOperations=n,this.dependencyGraph=s,this.columnSearch=o,this.parser=i,this.cellContentParser=a,this.lazilyTransformingAstService=l,this.namedExpressions=u,this.maxRows=e.maxRows,this.maxColumns=e.maxColumns}get sheetMapping(){return this.dependencyGraph.sheetMapping}addRows(e,...t){const r=new l.AddRowsCommand(e,t);this.ensureItIsPossibleToAddRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addRows(r),this.undoRedo.saveOperation(new c.AddRowsUndoEntry(r))}removeRows(e,...t){const r=new l.RemoveRowsCommand(e,t);this.ensureItIsPossibleToRemoveRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const n=this.operations.removeRows(r);this.undoRedo.saveOperation(new c.RemoveRowsUndoEntry(r,n))}addColumns(e,...t){const r=new l.AddColumnsCommand(e,t);this.ensureItIsPossibleToAddColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addColumns(r),this.undoRedo.saveOperation(new c.AddColumnsUndoEntry(r))}removeColumns(e,...t){const r=new l.RemoveColumnsCommand(e,t);this.ensureItIsPossibleToRemoveColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const n=this.operations.removeColumns(r);this.undoRedo.saveOperation(new c.RemoveColumnsUndoEntry(r,n))}moveCells(e,t,r,n){this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const{version:s,overwrittenCellsData:o,addedGlobalNamedExpressions:i}=this.operations.moveCells(e,t,r,n);this.undoRedo.saveOperation(new c.MoveCellsUndoEntry(e,t,r,n,o,i,s))}moveRows(e,t,r,n){this.ensureItIsPossibleToMoveRows(e,t,r,n),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const s=this.operations.moveRows(e,t,r,n);this.undoRedo.saveOperation(new c.MoveRowsUndoEntry(e,t,r,n,s))}moveColumns(e,t,r,n){this.ensureItIsPossibleToMoveColumns(e,t,r,n),this.undoRedo.clearRedoStack();const s=this.operations.moveColumns(e,t,r,n);this.undoRedo.saveOperation(new c.MoveColumnsUndoEntry(e,t,r,n,s))}cut(e,t,r){this.clipboardOperations.cut(e,t,r)}ensureItIsPossibleToCopy(e,t,r){if(!p(t))throw new i.InvalidArgumentsError("width to be positive integer.");if(!p(r))throw new i.InvalidArgumentsError("height to be positive integer.")}copy(e,t,r){this.ensureItIsPossibleToCopy(e,t,r),this.clipboardOperations.copy(e,t,r)}paste(e){const t=this.clipboardOperations.clipboard;if(void 0===t)throw new i.NothingToPasteError;if(this.clipboardOperations.isCutClipboard())this.moveCells(t.sourceLeftCorner,t.width,t.height,e);else if(this.clipboardOperations.isCopyClipboard()){this.clipboardOperations.ensureItIsPossibleToCopyPaste(e);const r=n.AbsoluteCellRange.spanFrom(e,t.width,t.height),s=this.operations.getRangeClipboardCells(r);this.undoRedo.clearRedoStack();const o=this.operations.restoreClipboardCells(t.sourceLeftCorner.sheet,t.getContent(e));this.undoRedo.saveOperation(new c.PasteUndoEntry(e,s,t.content,o))}}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();const t=this.operations.addSheet(e);return this.undoRedo.saveOperation(new c.AddSheetUndoEntry(t)),t}removeSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const t=this.sheetMapping.fetchDisplayName(e),r=this.operations.getSheetClipboardCells(e),{version:n,scopedNamedExpressions:s}=this.operations.removeSheet(e);this.undoRedo.saveOperation(new c.RemoveSheetUndoEntry(t,e,r,s,n))}renameSheet(e,t){this.ensureItIsPossibleToRenameSheet(e,t);const r=this.operations.renameSheet(e,t);return void 0!==r&&(this.undoRedo.clearRedoStack(),this.undoRedo.saveOperation(new c.RenameSheetUndoEntry(e,r,t))),r}clearSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const t=this.operations.getSheetClipboardCells(e);this.operations.clearSheet(e),this.undoRedo.saveOperation(new c.ClearSheetUndoEntry(e,t))}setCellContents(e,t){if(t instanceof Array){for(let e=0;e<t.length;e++)if(!(t[e]instanceof Array))throw new i.InvalidArgumentsError("an array of arrays or a raw cell value.")}else t=[[t]];this.ensureItIsPossibleToChangeCellContents(e,t),this.undoRedo.clearRedoStack();const r=[];for(let n=0;n<t.length;n++)for(let s=0;s<t[n].length;s++){const o={sheet:e.sheet,row:e.row+n,col:e.col+s},i=t[n][s];this.clipboardOperations.abortCut();const a=this.operations.setCellContent(o,i);r.push({address:o,newContent:i,oldContent:a})}this.undoRedo.saveOperation(new c.SetCellContentsUndoEntry(r))}setSheetContent(e,t){this.ensureScopeIdIsValid(e),this.ensureItIsPossibleToChangeSheetContents(e,t),(0,u.validateAsSheet)(t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.getSheetClipboardCells(e);this.operations.setSheetContent(e,t),this.undoRedo.saveOperation(new c.SetSheetContentUndoEntry(e,r,t))}setRowOrder(e,t){this.validateSwapRowIndexes(e,t),this.testRowOrderForArrays(e,t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.setRowOrder(e,t);this.undoRedo.saveOperation(new c.SetRowOrderUndoEntry(e,t,r))}validateSwapRowIndexes(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);this.validateRowOrColumnMapping(e,t,"row")}testColumnOrderForArrays(e,t){for(const[r,s]of t)if(r!==s){const t=n.AbsoluteCellRange.spanFrom({sheet:e,col:r,row:0},1,1/0);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new i.SourceLocationHasArrayError}}setColumnOrder(e,t){this.validateSwapColumnIndexes(e,t),this.testColumnOrderForArrays(e,t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.setColumnOrder(e,t);this.undoRedo.saveOperation(new c.SetColumnOrderUndoEntry(e,t,r))}validateSwapColumnIndexes(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);this.validateRowOrColumnMapping(e,t,"column")}testRowOrderForArrays(e,t){for(const[r,s]of t)if(r!==s){const t=n.AbsoluteCellRange.spanFrom({sheet:e,col:0,row:r},1/0,1);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new i.SourceLocationHasArrayError}}mappingFromOrder(e,t,r){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);const n="row"===r?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e);if(t.length!==n)throw new i.InvalidArgumentsError(`number of ${r}s provided to be sheet ${"row"===r?"height":"width"}.`);const s=[];for(let e=0;e<n;e++)t[e]!==e&&s.push([e,t[e]]);return s}undo(){if(this.undoRedo.isUndoStackEmpty())throw new i.NoOperationToUndoError;this.clipboardOperations.abortCut(),this.undoRedo.undo()}redo(){if(this.undoRedo.isRedoStackEmpty())throw new i.NoOperationToRedoError;this.clipboardOperations.abortCut(),this.undoRedo.redo()}addNamedExpression(e,t,r,n){this.ensureItIsPossibleToAddNamedExpression(e,t,r),this.operations.addNamedExpression(e,t,r,n),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new c.AddNamedExpressionUndoEntry(e,t,r,n))}changeNamedExpressionExpression(e,t,r,n){this.ensureItIsPossibleToChangeNamedExpression(e,r,t);const[s,o]=this.operations.changeNamedExpressionExpression(e,r,t,n);this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new c.ChangeNamedExpressionUndoEntry(s,r,o,t,n))}removeNamedExpression(e,t){this.ensureScopeIdIsValid(t);const[r,n]=this.operations.removeNamedExpression(e,t);return this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new c.RemoveNamedExpressionUndoEntry(r,n,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 i.NamedExpressionDoesNotExistError(e);this.ensureNamedExpressionIsValid(t)}isItPossibleToRemoveNamedExpression(e,t){if(this.ensureScopeIdIsValid(t),void 0===this.namedExpressions.namedExpressionForScope(e,t))throw new i.NamedExpressionDoesNotExistError(e)}ensureItIsPossibleToAddRows(e,...t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);if(this.dependencyGraph.getSheetHeight(e)+t.map((e=>e[1])).reduce(((e,t)=>e+t),0)>this.maxRows)throw new i.SheetSizeLimitExceededError;for(const[e,r]of t)if(!g(e)||!p(r))throw new i.InvalidArgumentsError("row number to be nonnegative and number of rows to add to be positive.")}ensureItIsPossibleToRemoveRows(e,...t){for(const[r,n]of t){const t=r+n-1;if(!g(r)||!g(t))throw new i.InvalidArgumentsError("starting and ending row to be nonnegative.");if(t<r)throw new i.InvalidArgumentsError("starting row to be smaller than the ending row.");if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e)}}ensureItIsPossibleToAddColumns(e,...t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);if(this.dependencyGraph.getSheetWidth(e)+t.map((e=>e[1])).reduce(((e,t)=>e+t),0)>this.maxColumns)throw new i.SheetSizeLimitExceededError;for(const[e,r]of t)if(!g(e)||!p(r))throw new i.InvalidArgumentsError("column number to be nonnegative and number of columns to add to be positive.")}ensureItIsPossibleToRemoveColumns(e,...t){for(const[r,n]of t){const t=r+n-1;if(!g(r)||!g(t))throw new i.InvalidArgumentsError("starting and ending column to be nonnegative.");if(t<r)throw new i.InvalidArgumentsError("starting column to be smaller than the ending column.");if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e)}}ensureItIsPossibleToMoveRows(e,t,r,o){this.ensureItIsPossibleToAddRows(e,[o,r]);const a=(0,s.simpleCellAddress)(e,0,t),l=(0,s.simpleCellAddress)(e,0,o);if(!this.sheetMapping.hasSheetWithId(e)||(0,s.invalidSimpleCellAddress)(a)||(0,s.invalidSimpleCellAddress)(l)||!p(r)||o<=t+r&&o>=t)throw new i.InvalidArgumentsError("a valid range of rows to move.");const u=this.dependencyGraph.getSheetWidth(e),c=n.AbsoluteCellRange.spanFrom(a,u,r);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(c))throw new i.SourceLocationHasArrayError;if(o>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllRows(h.RowsSpan.fromNumberOfRows(e,o-1,2)))throw new i.TargetLocationHasArrayError}ensureItIsPossibleToMoveColumns(e,t,r,o){this.ensureItIsPossibleToAddColumns(e,[o,r]);const a=(0,s.simpleCellAddress)(e,t,0),l=(0,s.simpleCellAddress)(e,o,0);if(!this.sheetMapping.hasSheetWithId(e)||(0,s.invalidSimpleCellAddress)(a)||(0,s.invalidSimpleCellAddress)(l)||!p(r)||o<=t+r&&o>=t)throw new i.InvalidArgumentsError("a valid range of columns to move.");const u=this.dependencyGraph.getSheetHeight(e),c=n.AbsoluteCellRange.spanFrom(a,r,u);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(c))throw new i.SourceLocationHasArrayError;if(o>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllColumns(h.ColumnsSpan.fromNumberOfColumns(e,o-1,2)))throw new i.TargetLocationHasArrayError}ensureItIsPossibleToAddSheet(e){if(this.sheetMapping.hasSheetWithName(e))throw new i.SheetNameAlreadyTakenError(e)}ensureItIsPossibleToRenameSheet(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);const r=this.sheetMapping.get(t);if(void 0!==r&&r!==e)throw new i.SheetNameAlreadyTakenError(t)}ensureItIsPossibleToChangeContent(e){if((0,s.invalidSimpleCellAddress)(e))throw new i.InvalidAddressError(e);if(!this.sheetMapping.hasSheetWithId(e.sheet))throw new i.NoSheetWithIdError(e.sheet)}ensureItIsPossibleToChangeCellContents(e,t){const r=(0,u.findBoundaries)(t),s=n.AbsoluteCellRange.spanFrom(e,r.width,r.height);this.ensureRangeInSizeLimits(s);for(const e of s.addresses(this.dependencyGraph))this.ensureItIsPossibleToChangeContent(e)}ensureItIsPossibleToChangeSheetContents(e,t){const r=(0,u.findBoundaries)(t),o=n.AbsoluteCellRange.spanFrom((0,s.simpleCellAddress)(e,0,0),r.width,r.height);this.ensureRangeInSizeLimits(o)}ensureRangeInSizeLimits(e){if(e.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new i.SheetSizeLimitExceededError}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 i.NoSheetWithIdError(e)}validateRowOrColumnMapping(e,t,r){const n="row"===r?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e),s=t.map((([e,t])=>e)).sort(((e,t)=>e-t)),o=t.map((([e,t])=>t)).sort(((e,t)=>e-t));for(let e=0;e<s.length;e++){if(!g(s[e])||s[e]>=n)throw new i.InvalidArgumentsError(`${r} numbers to be nonnegative integers and less than sheet ${"row"===r?"height":"width"}.`);if(s[e]===s[e+1])throw new i.InvalidArgumentsError(`source ${r} numbers to be unique.`);if(s[e]!==o[e])throw new i.InvalidArgumentsError(`target ${r} numbers to be permutation of source ${r} numbers.`)}}ensureNamedExpressionNameIsValid(e,t){if(!this.namedExpressions.isNameValid(e))throw new i.NamedExpressionNameIsInvalidError(e);if(!this.namedExpressions.isNameAvailable(e,t))throw new i.NamedExpressionNameIsAlreadyTakenError(e)}ensureNamedExpressionIsValid(e){const t=this.cellContentParser.parse(e);if(t instanceof o.CellContent.Formula){const e=this.parser.parse(t.formula,(0,s.simpleCellAddress)(-1,0,0));if((0,a.doesContainRelativeReferences)(e.ast))throw new i.NoRelativeAddressesAllowedError}}}function p(e){return Number.isInteger(e)&&e>0}function g(e){return Number.isInteger(e)&&e>=0}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{InternalNamedExpression:()=>i,NamedExpressions:()=>u,doesContainRelativeReferences:()=>h});var n=r(3),s=r(7),o=r(12);class i{constructor(e,t,r,n){this.displayName=e,this.address=t,this.added=r,this.options=n}normalizeExpressionName(){return this.displayName.toLowerCase()}copy(){return new i(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){const 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){const t=this.mapping.get(this.normalizeExpressionName(e));return t&&t.added?t:void 0}remove(e){const 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){const t=this.normalizeExpressionName(e);return!this.mapping.has(t)}remove(e){const t=this.normalizeExpressionName(e);this.mapping.get(t)&&this.mapping.delete(t)}normalizeExpressionName(e){return e.toLowerCase()}}class u{constructor(){this.nextNamedExpressionRow=0,this.workbookStore=new a,this.worksheetStores=new Map,this.addressCache=new Map}isNameAvailable(e,t){var r,n;return void 0===t?this.workbookStore.isNameAvailable(e):null===(n=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.isNameAvailable(e))||void 0===n||n}namedExpressionInAddress(e){const 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,n;return null!==(n=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.get(e))&&void 0!==n?n:this.workbookStore.getExisting(e)}isExpressionInScope(e,t){var r,n;return null!==(n=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.has(e))&&void 0!==n&&n}isNameValid(e){const t=new RegExp(`^${o.CELL_REFERENCE_PATTERN}$`),r=new RegExp(`^${o.R1C1_CELL_REFERENCE_PATTERN}$`),n=new RegExp(`^${o.NAMED_EXPRESSION_PATTERN}$`);return!t.test(e)&&!r.test(e)&&n.test(e)}addNamedExpression(e,t,r){const n=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);let s=n.get(e);return void 0!==s?(s.added=!0,s.displayName=e,s.options=r):(s=new i(e,this.nextAddress(),!0,r),n.add(s)),this.addressCache.set(s.address.row,s),s}restoreNamedExpression(e,t){const 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 i(e,this.nextAddress(),!1),this.workbookStore.add(t)),t}remove(e,t){let r;r=void 0===t?this.workbookStore:this.worksheetStore(t);const n=null==r?void 0:r.get(e);if(void 0===r||void 0===n||!n.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(n.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(){const 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)}nextAddress(){return(0,n.simpleCellAddress)(u.SHEET_FOR_WORKBOOK_EXPRESSIONS,0,this.nextNamedExpressionRow++)}}u.SHEET_FOR_WORKBOOK_EXPRESSIONS=-1;const h=e=>{switch(e.type){case s.AstNodeType.EMPTY:case s.AstNodeType.NUMBER:case s.AstNodeType.STRING:case s.AstNodeType.ERROR:case s.AstNodeType.ERROR_WITH_RAW_INPUT:return!1;case s.AstNodeType.CELL_REFERENCE:return!e.reference.isAbsolute();case s.AstNodeType.CELL_RANGE:case s.AstNodeType.COLUMN_RANGE:case s.AstNodeType.ROW_RANGE:return!e.start.isAbsolute();case s.AstNodeType.NAMED_EXPRESSION:return!1;case s.AstNodeType.PERCENT_OP:case s.AstNodeType.PLUS_UNARY_OP:case s.AstNodeType.MINUS_UNARY_OP:return h(e.value);case s.AstNodeType.CONCATENATE_OP:case s.AstNodeType.EQUALS_OP:case s.AstNodeType.NOT_EQUAL_OP:case s.AstNodeType.LESS_THAN_OP:case s.AstNodeType.GREATER_THAN_OP:case s.AstNodeType.LESS_THAN_OR_EQUAL_OP:case s.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case s.AstNodeType.MINUS_OP:case s.AstNodeType.PLUS_OP:case s.AstNodeType.TIMES_OP:case s.AstNodeType.DIV_OP:case s.AstNodeType.POWER_OP:return h(e.left)||h(e.right);case s.AstNodeType.PARENTHESIS:return h(e.expression);case s.AstNodeType.FUNCTION_CALL:return e.args.some((e=>h(e)));case s.AstNodeType.ARRAY:return e.args.some((e=>e.some((e=>h(e)))))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddColumnsCommand:()=>M,AddRowsCommand:()=>O,Operations:()=>I,RemoveColumnsCommand:()=>b,RemoveRowsCommand:()=>N,normalizeAddedIndexes:()=>x,normalizeRemovedIndexes:()=>_});var n=r(2),s=r(6),o=r(1),i=r(3),a=r(110),l=r(111),u=r(68),h=r(4),c=r(80),d=r(115),p=r(117),g=r(118),m=r(119),f=r(120),y=r(121),E=r(122),C=r(77),T=r(70),R=r(113),w=r(7),S=r(123),v=r(71),A=r(72);class N{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return _(this.indexes)}rowsSpans(){return this.normalizedIndexes().map((e=>v.RowsSpan.fromNumberOfRows(this.sheet,e[0],e[1])))}}class O{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return x(this.indexes)}rowsSpans(){return this.normalizedIndexes().map((e=>v.RowsSpan.fromNumberOfRows(this.sheet,e[0],e[1])))}}class M{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return x(this.indexes)}columnsSpans(){return this.normalizedIndexes().map((e=>v.ColumnsSpan.fromNumberOfColumns(this.sheet,e[0],e[1])))}}class b{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return _(this.indexes)}columnsSpans(){return this.normalizedIndexes().map((e=>v.ColumnsSpan.fromNumberOfColumns(this.sheet,e[0],e[1])))}}class I{constructor(e,t,r,n,s,o,i,a,l){this.dependencyGraph=t,this.columnSearch=r,this.cellContentParser=n,this.parser=s,this.stats=o,this.lazilyTransformingAstService=i,this.namedExpressions=a,this.arraySizePredictor=l,this.changes=u.ContentChanges.empty(),this.allocateNamedExpressionAddressSpace(),this.maxColumns=e.maxColumns,this.maxRows=e.maxRows}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}removeRows(e){const t=[];for(const r of e.rowsSpans()){const e=this.doRemoveRows(r);e&&t.push(e)}return t}addRows(e){for(const t of e.rowsSpans())this.doAddRows(t)}addColumns(e){for(const t of e.columnsSpans())this.doAddColumns(t)}removeColumns(e){const t=[];for(const r of e.columnsSpans()){const e=this.doRemoveColumns(r);e&&t.push(e)}return t}removeSheet(e){let t;this.dependencyGraph.removeSheet(e),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const r=new E.RemoveSheetTransformer(e);r.performEagerTransformations(this.dependencyGraph,this.parser),t=this.lazilyTransformingAstService.addTransformation(r)})),this.sheetMapping.removeSheet(e),this.columnSearch.removeSheet(e);const r=this.namedExpressions.getAllNamedExpressionsForScope(e).map((t=>this.removeNamedExpression(t.normalizeExpressionName(),e)));return{version:t,scopedNamedExpressions:r}}removeSheetByName(e){const t=this.sheetMapping.fetch(e);return this.removeSheet(t)}clearSheet(e){this.dependencyGraph.clearSheet(e),this.columnSearch.removeSheet(e)}addSheet(e){const t=this.sheetMapping.addSheet(e),r=[];return this.dependencyGraph.addressMapping.autoAddSheet(t,r,(0,S.findBoundaries)(r)),this.sheetMapping.fetchDisplayName(t)}renameSheet(e,t){return this.sheetMapping.renameSheet(e,t)}moveRows(e,t,r,n){const s=v.RowsSpan.fromNumberOfRows(e,n,r);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddRows(s),n<t&&(t+=r);const o=(0,i.simpleCellAddress)(e,0,t),a=(0,i.simpleCellAddress)(e,0,n);this.moveCells(o,Number.POSITIVE_INFINITY,r,a);const l=v.RowsSpan.fromNumberOfRows(e,t,r);return this.doRemoveRows(l),this.lazilyTransformingAstService.commitCombinedMode()}moveColumns(e,t,r,n){const s=v.ColumnsSpan.fromNumberOfColumns(e,n,r);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddColumns(s),n<t&&(t+=r);const o=(0,i.simpleCellAddress)(e,t,0),a=(0,i.simpleCellAddress)(e,n,0);this.moveCells(o,r,Number.POSITIVE_INFINITY,a);const l=v.ColumnsSpan.fromNumberOfColumns(e,t,r);return this.doRemoveColumns(l),this.lazilyTransformingAstService.commitCombinedMode()}moveCells(e,t,r,s){this.ensureItIsPossibleToMoveCells(e,t,r,s);const o=n.AbsoluteCellRange.spanFrom(e,t,r),i=n.AbsoluteCellRange.spanFrom(s,t,r),a=s.col-e.col,l=s.row-e.row,u=s.sheet,h=this.getRangeClipboardCells(i),c=this.dependencyGraph.rawValuesFromRange(i);this.columnSearch.removeValues(c);const d=this.dependencyGraph.rawValuesFromRange(o);let p;this.columnSearch.moveValues(d,a,l,u),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const e=new m.MoveCellsTransformer(o,a,l,u);e.performEagerTransformations(this.dependencyGraph,this.parser),p=this.lazilyTransformingAstService.addTransformation(e)})),this.dependencyGraph.moveCells(o,a,l,u);const g=this.updateNamedExpressionsForMovedCells(e,t,r,s);return{version:p,overwrittenCellsData:h,addedGlobalNamedExpressions:g}}setRowOrder(e,t){const r=[];let s=[];for(const[o,i]of t)if(o!==i){const t=n.AbsoluteCellRange.spanFrom({sheet:e,col:0,row:o},1/0,1),a=this.getRangeClipboardCells(t);s=s.concat(a),r.push(a.map((([{sheet:e,col:t},r])=>[{sheet:e,col:t,row:i},r])))}return r.forEach((t=>this.restoreClipboardCells(e,t.values()))),s}setColumnOrder(e,t){const r=[];let s=[];for(const[o,i]of t)if(o!==i){const t=n.AbsoluteCellRange.spanFrom({sheet:e,col:o,row:0},1,1/0),a=this.getRangeClipboardCells(t);s=s.concat(a),r.push(a.map((([{sheet:e,col:t,row:r},n])=>[{sheet:e,col:i,row:r},n])))}return r.forEach((t=>this.restoreClipboardCells(e,t.values()))),s}addNamedExpression(e,t,r,n){const s=this.namedExpressions.addNamedExpression(e,r,n);this.storeNamedExpressionInCell(s.address,t),this.adjustNamedExpressionEdges(s,e,r)}restoreNamedExpression(e,t,r){const n=e.displayName;this.restoreCell(e.address,t);const s=this.namedExpressions.restoreNamedExpression(e,r);this.adjustNamedExpressionEdges(s,n,r)}changeNamedExpressionExpression(e,t,r,n){const s=this.namedExpressions.namedExpressionForScope(e,r);if(!s)throw new C.NamedExpressionDoesNotExistError(e);const o=s.copy();s.options=n;const i=this.getClipboardCell(s.address);return this.storeNamedExpressionInCell(s.address,t),[o,i]}removeNamedExpression(e,t){const r=this.namedExpressions.namedExpressionForScope(e,t);if(!r)throw new C.NamedExpressionDoesNotExistError(e);this.namedExpressions.remove(r.displayName,t);const n=this.getClipboardCell(r.address);if(void 0!==t){const t=this.namedExpressions.workbookNamedExpressionOrPlaceholder(e);this.dependencyGraph.exchangeNode(r.address,t.address)}else this.dependencyGraph.setCellEmpty(r.address);return[r,n]}ensureItIsPossibleToMoveCells(e,t,r,s){if((0,i.invalidSimpleCellAddress)(e)||!(P(t)&&P(r)||function(e,t,r){return 0===e.row&&P(t)&&r===Number.POSITIVE_INFINITY||0===e.col&&P(r)&&t===Number.POSITIVE_INFINITY}(e,t,r))||(0,i.invalidSimpleCellAddress)(s)||!this.sheetMapping.hasSheetWithId(e.sheet)||!this.sheetMapping.hasSheetWithId(s.sheet))throw new C.InvalidArgumentsError("a valid range of cells to move.");const o=n.AbsoluteCellRange.spanFrom(e,t,r),a=n.AbsoluteCellRange.spanFrom(s,t,r);if(a.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new C.SheetSizeLimitExceededError;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(o))throw new C.SourceLocationHasArrayError;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new C.TargetLocationHasArrayError}restoreClipboardCells(e,t){const r=[];for(const[n,s]of t)if(this.restoreCell(n,s),s.type===l.ClipboardCellType.FORMULA){const{dependencies:t}=this.parser.fetchCachedResult(s.hash);r.push(...this.updateNamedExpressionsForTargetAddress(e,n,t))}return r}restoreCell(e,t){switch(t.type){case l.ClipboardCellType.VALUE:this.setValueToCell(t,e);break;case l.ClipboardCellType.FORMULA:this.setFormulaToCellFromCache(t.hash,e);break;case l.ClipboardCellType.EMPTY:this.setCellEmpty(e);break;case l.ClipboardCellType.PARSING_ERROR:this.setParsingErrorToCell(t.rawInput,t.errors,e)}}getOldContent(e){const t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof h.EmptyCellVertex)return[e,{type:l.ClipboardCellType.EMPTY}];if(t instanceof h.ValueCellVertex)return[e,Object.assign({type:l.ClipboardCellType.VALUE},t.getValues())];if(t instanceof c.FormulaVertex)return[t.getAddress(this.lazilyTransformingAstService),{type:l.ClipboardCellType.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))}];if(t instanceof h.ParsingErrorVertex)return[e,{type:l.ClipboardCellType.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors}];throw Error("Trying to copy unsupported type")}getClipboardCell(e){const t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof h.EmptyCellVertex)return{type:l.ClipboardCellType.EMPTY};if(t instanceof h.ValueCellVertex)return Object.assign({type:l.ClipboardCellType.VALUE},t.getValues());if(t instanceof h.ArrayVertex){const r=t.getArrayCellValue(e);return r===T.EmptyValue?{type:l.ClipboardCellType.EMPTY}:{type:l.ClipboardCellType.VALUE,parsedValue:r,rawValue:t.getArrayCellRawValue(e)}}if(t instanceof h.FormulaCellVertex)return{type:l.ClipboardCellType.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))};if(t instanceof h.ParsingErrorVertex)return{type:l.ClipboardCellType.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors};throw Error("Trying to copy unsupported type")}getSheetClipboardCells(e){const t=this.dependencyGraph.getSheetHeight(e),r=this.dependencyGraph.getSheetWidth(e),n=new Array(t);for(let s=0;s<t;s++){n[s]=new Array(r);for(let t=0;t<r;t++){const r=(0,i.simpleCellAddress)(e,t,s);n[s][t]=this.getClipboardCell(r)}}return n}getRangeClipboardCells(e){const t=[];for(const r of e.addresses(this.dependencyGraph))t.push([r,this.getClipboardCell(r)]);return t}setCellContent(e,t){const r=this.cellContentParser.parse(t),n=this.getOldContent(e);if(r instanceof a.CellContent.Formula){const t=this.parser.parse(r.formula,e),{ast:n,errors:s}=t;if(s.length>0)this.setParsingErrorToCell(r.formula,s,e);else{const r=this.arraySizePredictor.checkArraySize(n,e);this.setFormulaToCell(e,r,t)}}else r instanceof a.CellContent.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:r.value,rawValue:t},e);return n}setSheetContent(e,t){this.clearSheet(e);for(let r=0;r<t.length;r++)for(let n=0;n<t[r].length;n++){const s=(0,i.simpleCellAddress)(e,n,r);this.setCellContent(s,t[r][n])}}setParsingErrorToCell(e,t,r){const n=this.dependencyGraph.getCellValue(r),s=new h.ParsingErrorVertex(t,e),o=this.dependencyGraph.setParsingErrorToCell(r,s);this.columnSearch.remove((0,T.getRawValue)(n),r),this.columnSearch.applyChanges(o.getChanges()),this.changes.addAll(o),this.changes.addChange(s.getCellValue(),r)}setFormulaToCell(e,t,{ast:r,hasVolatileFunction:n,hasStructuralChangeFunction:o,dependencies:i}){const a=this.dependencyGraph.getCellValue(e),l=this.dependencyGraph.setFormulaToCell(e,r,(0,s.absolutizeDependencies)(i,e),t,n,o);this.columnSearch.remove((0,T.getRawValue)(a),e),this.columnSearch.applyChanges(l.getChanges()),this.changes.addAll(l)}setValueToCell(e,t){const r=this.dependencyGraph.getCellValue(t),n=this.dependencyGraph.setValueToCell(t,e);this.columnSearch.change((0,T.getRawValue)(r),(0,T.getRawValue)(e.parsedValue),t),this.columnSearch.applyChanges(n.getChanges().filter((e=>!(0,i.equalSimpleCellAddress)(e.address,t)))),this.changes.addAll(n),this.changes.addChange(e.parsedValue,t)}setCellEmpty(e){if(this.dependencyGraph.isArrayInternalCell(e))return;const t=this.dependencyGraph.getCellValue(e),r=this.dependencyGraph.setCellEmpty(e);this.columnSearch.remove((0,T.getRawValue)(t),e),this.columnSearch.applyChanges(r.getChanges()),this.changes.addAll(r),this.changes.addChange(T.EmptyValue,e)}setFormulaToCellFromCache(e,t){const{ast:r,hasVolatileFunction:n,hasStructuralChangeFunction:o,dependencies:i}=this.parser.fetchCachedResult(e),a=(0,s.absolutizeDependencies)(i,t),[l]=new g.CleanOutOfScopeDependenciesTransformer(t.sheet).transformSingleAst(r,t);this.parser.rememberNewAst(l);const u=(0,s.filterDependenciesOutOfScope)(a),h=this.arraySizePredictor.checkArraySize(r,t);this.dependencyGraph.setFormulaToCell(t,l,u,h,n,o)}rowEffectivelyNotInSheet(e,t){return e>=this.dependencyGraph.addressMapping.getHeight(t)}getAndClearContentChanges(){const e=this.changes;return this.changes=u.ContentChanges.empty(),e}forceApplyPostponedTransformations(){this.dependencyGraph.forceApplyPostponedTransformations()}doRemoveRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;const t=[];for(const[r]of this.dependencyGraph.entriesFromRowsSpan(e))t.push({address:r,cellType:this.getClipboardCell(r)});const{affectedArrays:r,contentChanges:n}=this.dependencyGraph.removeRows(e);let s;return this.columnSearch.applyChanges(n.getChanges()),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const t=new y.RemoveRowsTransformer(e);t.performEagerTransformations(this.dependencyGraph,this.parser),s=this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(r),{version:s,removedCells:t,rowFrom:e.rowStart,rowCount:e.numberOfRows}}doRemoveColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;const t=[];for(const[r]of this.dependencyGraph.entriesFromColumnsSpan(e))t.push({address:r,cellType:this.getClipboardCell(r)});const{affectedArrays:r,contentChanges:n}=this.dependencyGraph.removeColumns(e);let s;return this.columnSearch.applyChanges(n.getChanges()),this.columnSearch.removeColumns(e),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const t=new f.RemoveColumnsTransformer(e);t.performEagerTransformations(this.dependencyGraph,this.parser),s=this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(r),{version:s,removedCells:t,columnFrom:e.columnStart,columnCount:e.numberOfColumns}}doAddRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;const{affectedArrays:t}=this.dependencyGraph.addRows(e);this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const t=new p.AddRowsTransformer(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(t)}rewriteAffectedArrays(e){for(const t of e.values()){if(t.array.size.isRef)continue;const e=t.getFormula(this.lazilyTransformingAstService),r=t.getAddress(this.lazilyTransformingAstService),n=this.parser.computeHashFromAst(e);this.setFormulaToCellFromCache(n,r)}}doAddColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;const{affectedArrays:t,contentChanges:r}=this.dependencyGraph.addColumns(e);this.columnSearch.addColumns(e),this.columnSearch.applyChanges(r.getChanges()),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const t=new d.AddColumnsTransformer(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(t)}columnEffectivelyNotInSheet(e,t){return e>=this.dependencyGraph.addressMapping.getWidth(t)}adjustNamedExpressionEdges(e,t,r){if(void 0===r)return;const n=this.dependencyGraph.fetchCellOrCreateEmpty(e.address),o=this.namedExpressions.workbookNamedExpressionOrPlaceholder(t),i=this.dependencyGraph.fetchCellOrCreateEmpty(o.address);for(const t of this.dependencyGraph.graph.adjacentNodes(i))if(t instanceof h.FormulaCellVertex&&t.getAddress(this.lazilyTransformingAstService).sheet===r){const r=t.getFormula(this.lazilyTransformingAstService),o=t.getAddress(this.lazilyTransformingAstService),{dependencies:a}=this.parser.fetchCachedResultForAst(r);for(const r of(0,s.absolutizeDependencies)(a,o))r instanceof w.NamedExpressionDependency&&r.name.toLowerCase()===e.displayName.toLowerCase()&&(this.dependencyGraph.graph.removeEdge(i,t),this.dependencyGraph.graph.addEdge(n,t))}}storeNamedExpressionInCell(e,t){const r=this.cellContentParser.parse(t);if(r instanceof a.CellContent.Formula){const t=this.parser.parse(r.formula,(0,i.simpleCellAddress)(-1,0,0));if((0,R.doesContainRelativeReferences)(t.ast))throw new C.NoRelativeAddressesAllowedError;const{ast:n,hasVolatileFunction:a,hasStructuralChangeFunction:l,dependencies:u}=t;this.dependencyGraph.setFormulaToCell(e,n,(0,s.absolutizeDependencies)(u,e),o.ArraySize.scalar(),a,l)}else r instanceof a.CellContent.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:r.value,rawValue:t},e)}updateNamedExpressionsForMovedCells(e,t,r,s){if(e.sheet===s.sheet)return[];const o=[],i=n.AbsoluteCellRange.spanFrom(s,t,r);for(const t of i.addresses(this.dependencyGraph)){const r=this.addressMapping.fetchCell(t);if(r instanceof h.FormulaCellVertex&&t.sheet!==e.sheet){const n=r.getFormula(this.lazilyTransformingAstService),{dependencies:s}=this.parser.fetchCachedResultForAst(n);o.push(...this.updateNamedExpressionsForTargetAddress(e.sheet,t,s))}}return o}updateNamedExpressionsForTargetAddress(e,t,r){if(e===t.sheet)return[];const n=[],o=this.addressMapping.fetchCell(t);for(const i of(0,s.absolutizeDependencies)(r,t)){if(!(i instanceof w.NamedExpressionDependency))continue;const r=i.name,s=this.dependencyGraph.fetchNamedExpressionVertex(r,e),a=this.namedExpressions.isExpressionInScope(r,t.sheet)?this.dependencyGraph.fetchNamedExpressionVertex(r,t.sheet):this.copyOrFetchGlobalNamedExpressionVertex(r,s,n);a!==s&&(this.dependencyGraph.graph.softRemoveEdge(s,o),this.dependencyGraph.graph.addEdge(a,o))}return n}allocateNamedExpressionAddressSpace(){this.dependencyGraph.addressMapping.addSheet(R.NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS,new h.SparseStrategy(0,0))}copyOrFetchGlobalNamedExpressionVertex(e,t,r){let n=this.namedExpressions.namedExpressionForScope(e);if(void 0===n)if(n=this.namedExpressions.addNamedExpression(e),r.push(n.normalizeExpressionName()),t instanceof h.FormulaCellVertex){const e=this.parser.fetchCachedResultForAst(t.getFormula(this.lazilyTransformingAstService)),{ast:r,hasVolatileFunction:i,hasStructuralChangeFunction:a,dependencies:l}=e;this.dependencyGraph.setFormulaToCell(n.address,r,(0,s.absolutizeDependencies)(l,n.address),o.ArraySize.scalar(),i,a)}else t instanceof h.EmptyCellVertex?this.setCellEmpty(n.address):t instanceof h.ValueCellVertex&&this.setValueToCell(t.getValues(),n.address);return this.dependencyGraph.fetchCellOrCreateEmpty(n.address)}}function _(e){if(e.length<=1)return e;const t=[...e].sort((([e],[t])=>e-t)),r=t.reduce(((e,[t,r])=>{const n=e[e.length-1],s=n[0]+n[1];return t<=s?n[1]+=Math.max(0,r-(s-t)):e.push([t,r]),e}),[t[0]]);let n=0;for(let e=0;e<r.length;++e)r[e][0]-=n,n+=r[e][1];return r}function x(e){if(e.length<=1)return e;const t=[...e].sort((([e],[t])=>e-t)),r=t.reduce(((e,[t,r])=>{const n=e[e.length-1];return t===n[0]?n[1]=Math.max(n[1],r):e.push([t,r]),e}),[t[0]]);let n=0;for(let e=0;e<r.length;++e)r[e][0]+=n,n+=r[e][1];return r}function P(e){return Number.isInteger(e)&&e>0}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddColumnsTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{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){const r=(0,n.absoluteSheetReference)(e,t);if(r!==this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return!1;const s=e.toSimpleColumnAddress(t);if(r===this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return this.columnsSpan.columnStart<=s.col&&e.shiftedByColumns(this.columnsSpan.numberOfColumns);if(t.sheet===this.columnsSpan.sheet&&r!==this.columnsSpan.sheet)return!e.isColumnAbsolute()&&(!(t.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(-this.columnsSpan.numberOfColumns));if(e.isColumnAbsolute())return!(e.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(this.columnsSpan.numberOfColumns);return 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){const s=this.transformCellAddress(e,r),o=this.transformCellAddress(t,r);return s===n.ErrorType.REF||o===n.ErrorType.REF?n.ErrorType.REF:!(!s&&!o)&&[s||e,o||t]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Transformer:()=>o});var n=r(3),s=r(7);class o{performEagerTransformations(e,t){for(const r of e.arrayFormulaNodes()){const[n,s]=this.transformSingleAst(r.getFormula(e.lazilyTransformingAstService),r.getAddress(e.lazilyTransformingAstService)),o=t.rememberNewAst(n);r.setFormula(o),r.setAddress(s)}}transformSingleAst(e,t){return[this.transformAst(e,t),this.fixNodeAddress(t)]}transformAst(e,t){switch(e.type){case s.AstNodeType.CELL_REFERENCE:return this.transformCellReferenceAst(e,t);case s.AstNodeType.CELL_RANGE:return this.transformCellRangeAst(e,t);case s.AstNodeType.COLUMN_RANGE:return this.transformColumnRangeAst(e,t);case s.AstNodeType.ROW_RANGE:return this.transformRowRangeAst(e,t);case s.AstNodeType.EMPTY:case s.AstNodeType.ERROR:case s.AstNodeType.NUMBER:case s.AstNodeType.NAMED_EXPRESSION:case s.AstNodeType.ERROR_WITH_RAW_INPUT:case s.AstNodeType.STRING:return e;case s.AstNodeType.PERCENT_OP:case s.AstNodeType.MINUS_UNARY_OP:case s.AstNodeType.PLUS_UNARY_OP:return Object.assign(Object.assign({},e),{value:this.transformAst(e.value,t)});case s.AstNodeType.FUNCTION_CALL:return Object.assign(Object.assign({},e),{procedureName:e.procedureName,args:e.args.map((e=>this.transformAst(e,t)))});case s.AstNodeType.PARENTHESIS:return Object.assign(Object.assign({},e),{expression:this.transformAst(e.expression,t)});case s.AstNodeType.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){const r=this.transformCellAddress(e.reference,t);return r instanceof s.CellAddress?Object.assign(Object.assign({},e),{reference:r}):r===n.ErrorType.REF?(0,s.buildCellErrorAst)(new n.CellError(n.ErrorType.REF)):e}transformCellRangeAst(e,t){const r=this.transformCellRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===n.ErrorType.REF?(0,s.buildCellErrorAst)(new n.CellError(n.ErrorType.REF)):e}transformColumnRangeAst(e,t){const r=this.transformColumnRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===n.ErrorType.REF?(0,s.buildCellErrorAst)(new n.CellError(n.ErrorType.REF)):e}transformRowRangeAst(e,t){const r=this.transformRowRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===n.ErrorType.REF?(0,s.buildCellErrorAst)(new n.CellError(n.ErrorType.REF)):e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddRowsTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{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){const r=(0,n.absoluteSheetReference)(e,t);if(r!==this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet)return!1;const s=e.toSimpleRowAddress(t);return r===this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet?this.rowsSpan.rowStart<=s.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):s.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){const s=this.transformCellAddress(e,r),o=this.transformCellAddress(t,r);return s===n.ErrorType.REF||o===n.ErrorType.REF?n.ErrorType.REF:!(!s&&!o)&&[s||e,o||t]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CleanOutOfScopeDependenciesTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}fixNodeAddress(e){return e}transformCellAddress(e,t){return!!e.isInvalid(t)&&n.ErrorType.REF}transformCellRange(e,t,r){return!(!e.isInvalid(r)&&!t.isInvalid(r))&&n.ErrorType.REF}transformColumnRange(e,t,r){return!(!e.isInvalid(r)&&!t.isInvalid(r))&&n.ErrorType.REF}transformRowRange(e,t,r){return!(!e.isInvalid(r)&&!t.isInvalid(r))&&n.ErrorType.REF}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DependentFormulaTransformer:()=>l,MoveCellsTransformer:()=>a});var n=r(3),s=r(7),o=r(11),i=r(116);class a extends i.Transformer{constructor(e,t,r,n){super(),this.sourceRange=e,this.toRight=t,this.toBottom=r,this.toSheet=n,this.dependentFormulaTransformer=new l(e,t,r,n)}get sheet(){return this.sourceRange.sheet}isIrreversible(){return!0}transformSingleAst(e,t){if(this.sourceRange.addressInRange(t)){return[this.transformAst(e,t),this.fixNodeAddress(t)]}return this.dependentFormulaTransformer.transformSingleAst(e,t)}fixNodeAddress(e){return(0,n.simpleCellAddress)(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){const r=this.sourceRange;if(e instanceof s.CellAddress){const n=e.toSimpleCellAddress(t);if(r.addressInRange(n))return e.shiftAbsoluteDimensions(this.toRight,this.toBottom)}return e.shiftRelativeDimensions(-this.toRight,-this.toBottom)}transformRange(e,t,r){const n=this.sourceRange;if(e instanceof s.CellAddress&&t instanceof s.CellAddress){const s=e.toSimpleCellAddress(r),o=t.toSimpleCellAddress(r);if(n.addressInRange(s)&&n.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)]}}class l extends i.Transformer{constructor(e,t,r,n){super(),this.sourceRange=e,this.toRight=t,this.toBottom=r,this.toSheet=n}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 s.CellAddress?this.sourceRange.addressInRange(e.toSimpleCellAddress(t)):e instanceof o.RowAddress?this.sourceRange.rowInRange(e.toSimpleRowAddress(t))&&!this.sourceRange.isFinite():this.sourceRange.columnInRange(e.toSimpleColumnAddress(t))&&!this.sourceRange.isFinite()}transformRange(e,t,r){const n=this.transformCellAddress(e,r),s=this.transformCellAddress(t,r);return!(!n||!s)&&[n,s]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RemoveColumnsTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{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){const r=(0,n.absoluteSheetReference)(e,t);if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet!==r)return!1;if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet===r){const 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())return!1;if(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{const 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 n.ErrorType.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){const s=(0,n.absoluteSheetReference)(e,r);let o=e,i=t;if(this.columnsSpan.sheet===s){const s=e.toSimpleColumnAddress(r),a=t.toSimpleColumnAddress(r);if(this.columnsSpan.columnStart<=s.col&&this.columnsSpan.columnEnd>=a.col)return n.ErrorType.REF;s.col>=this.columnsSpan.columnStart&&s.col<=this.columnsSpan.columnEnd&&(o=e.shiftedByColumns(this.columnsSpan.columnEnd-s.col+1)),a.col>=this.columnsSpan.columnStart&&a.col<=this.columnsSpan.columnEnd&&(i=t.shiftedByColumns(-(a.col-this.columnsSpan.columnStart+1)))}const a=this.transformCellAddress(o,r),l=this.transformCellAddress(i,r);if(!1===a&&!1===l)return[o,i];if(a===n.ErrorType.REF||l===n.ErrorType.REF)throw Error("Cannot happen");return[a||o,l||i]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RemoveRowsTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!0}transformColumnRangeAst(e,t){return e}transformCellAddress(e,t){const r=(0,n.absoluteSheetReference)(e,t);if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet!==r)return!1;if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet===r){const 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())return!1;if(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{const 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 n.ErrorType.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){const s=(0,n.absoluteSheetReference)(e,r);let o=e,i=t;if(this.rowsSpan.sheet===s){const s=e.toSimpleRowAddress(r),a=t.toSimpleRowAddress(r);if(this.rowsSpan.rowStart<=s.row&&this.rowsSpan.rowEnd>=a.row)return n.ErrorType.REF;s.row>=this.rowsSpan.rowStart&&s.row<=this.rowsSpan.rowEnd&&(o=e.shiftedByRows(this.rowsSpan.rowEnd-s.row+1)),a.row>=this.rowsSpan.rowStart&&a.row<=this.rowsSpan.rowEnd&&(i=t.shiftedByRows(-(a.row-this.rowsSpan.rowStart+1)))}const a=this.transformCellAddress(o,r),l=this.transformCellAddress(i,r);return!1===a&&!1===l?[o,i]:a===n.ErrorType.REF||l===n.ErrorType.REF?n.ErrorType.REF:[a||o,l||i]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RemoveSheetTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}performEagerTransformations(e,t){for(const t of e.arrayFormulaNodes()){const[r]=this.transformSingleAst(t.getFormula(e.lazilyTransformingAstService),t.getAddress(e.lazilyTransformingAstService));t.setFormula(r)}}fixNodeAddress(e){return e}transformCellAddress(e,t){return this.transformAddress(e)}transformCellRange(e,t,r){return this.transformAddress(e)}transformColumnRange(e,t,r){return this.transformAddress(e)}transformRowRange(e,t,r){return this.transformAddress(e)}transformAddress(e){return e.sheet===this.sheet&&n.ErrorType.REF}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{findBoundaries:()=>o,validateAsSheet:()=>s});var n=r(77);function s(e){if(!Array.isArray(e))throw new n.InvalidArgumentsError("an array of arrays.");for(let t=0;t<e.length;t++)if(!Array.isArray(e[t]))throw new n.InvalidArgumentsError("an array of arrays.")}function o(e){let t=0,r=0,n=0;for(let s=0;s<e.length;s++){let o=0;for(let t=0;t<e[s].length;t++){const r=e[s][t];null!=r&&(o=t+1,++n)}t=Math.max(t,o),o>0&&(r=s+1)}const s=t*r;return{height:r,width:t,fill:0===s?0:n/s}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddColumnsUndoEntry:()=>g,AddNamedExpressionUndoEntry:()=>w,AddRowsUndoEntry:()=>l,AddSheetUndoEntry:()=>f,BaseUndoEntry:()=>o,BatchUndoEntry:()=>A,ChangeNamedExpressionUndoEntry:()=>v,ClearSheetUndoEntry:()=>C,MoveCellsUndoEntry:()=>a,MoveColumnsUndoEntry:()=>p,MoveRowsUndoEntry:()=>d,PasteUndoEntry:()=>R,RemoveColumnsUndoEntry:()=>m,RemoveNamedExpressionUndoEntry:()=>S,RemoveRowsUndoEntry:()=>i,RemoveSheetUndoEntry:()=>y,RenameSheetUndoEntry:()=>E,SetCellContentsUndoEntry:()=>T,SetColumnOrderUndoEntry:()=>h,SetRowOrderUndoEntry:()=>u,SetSheetContentUndoEntry:()=>c,UndoRedo:()=>N});var n=r(3),s=r(114);class o{}class i extends o{constructor(e,t){super(),this.command=e,this.rowsRemovals=t}doUndo(e){e.undoRemoveRows(this)}doRedo(e){e.redoRemoveRows(this)}}class a extends o{constructor(e,t,r,n,s,o,i){super(),this.sourceLeftCorner=e,this.width=t,this.height=r,this.destinationLeftCorner=n,this.overwrittenCellsData=s,this.addedGlobalNamedExpressions=o,this.version=i}doUndo(e){e.undoMoveCells(this)}doRedo(e){e.redoMoveCells(this)}}class l extends o{constructor(e){super(),this.command=e}doUndo(e){e.undoAddRows(this)}doRedo(e){e.redoAddRows(this)}}class u extends o{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 h extends o{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 c extends o{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 d extends o{constructor(e,t,r,n,s){super(),this.sheet=e,this.startRow=t,this.numberOfRows=r,this.targetRow=n,this.version=s,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 p extends o{constructor(e,t,r,n,s){super(),this.sheet=e,this.startColumn=t,this.numberOfColumns=r,this.targetColumn=n,this.version=s,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 g extends o{constructor(e){super(),this.command=e}doUndo(e){e.undoAddColumns(this)}doRedo(e){e.redoAddColumns(this)}}class m extends o{constructor(e,t){super(),this.command=e,this.columnsRemovals=t}doUndo(e){e.undoRemoveColumns(this)}doRedo(e){e.redoRemoveColumns(this)}}class f extends o{constructor(e){super(),this.sheetName=e}doUndo(e){e.undoAddSheet(this)}doRedo(e){e.redoAddSheet(this)}}class y extends o{constructor(e,t,r,n,s){super(),this.sheetName=e,this.sheetId=t,this.oldSheetContent=r,this.scopedNamedExpressions=n,this.version=s}doUndo(e){e.undoRemoveSheet(this)}doRedo(e){e.redoRemoveSheet(this)}}class E extends o{constructor(e,t,r){super(),this.sheetId=e,this.oldName=t,this.newName=r}doUndo(e){e.undoRenameSheet(this)}doRedo(e){e.redoRenameSheet(this)}}class C extends o{constructor(e,t){super(),this.sheetId=e,this.oldSheetContent=t}doUndo(e){e.undoClearSheet(this)}doRedo(e){e.redoClearSheet(this)}}class T extends o{constructor(e){super(),this.cellContents=e}doUndo(e){e.undoSetCellContents(this)}doRedo(e){e.redoSetCellContents(this)}}class R extends o{constructor(e,t,r,n){super(),this.targetLeftCorner=e,this.oldContent=t,this.newContent=r,this.addedGlobalNamedExpressions=n}doUndo(e){e.undoPaste(this)}doRedo(e){e.redoPaste(this)}}class w extends o{constructor(e,t,r,n){super(),this.name=e,this.newContent=t,this.scope=r,this.options=n}doUndo(e){e.undoAddNamedExpression(this)}doRedo(e){e.redoAddNamedExpression(this)}}class S extends o{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 v extends o{constructor(e,t,r,n,s){super(),this.namedExpression=e,this.newContent=t,this.oldContent=r,this.scope=n,this.options=s}doUndo(e){e.undoChangeNamedExpression(this)}doRedo(e){e.redoChangeNamedExpression(this)}}class A extends o{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 N{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 A}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(){const 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(const t of e.reversedOperations())this.undoEntry(t)}undoRemoveRows(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},rowsRemovals:r}=e;for(let e=r.length-1;e>=0;--e){const n=r[e];this.operations.addRows(new s.AddRowsCommand(t,[[n.rowFrom,n.rowCount]]));for(const{address:e,cellType:t}of n.removedCells)this.operations.restoreCell(e,t);this.restoreOldDataFromVersion(n.version-1)}}undoRemoveColumns(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},columnsRemovals:r}=e;for(let e=r.length-1;e>=0;--e){const n=r[e];this.operations.addColumns(new s.AddColumnsCommand(t,[[n.columnFrom,n.columnCount]]));for(const{address:e,cellType:t}of n.removedCells)this.operations.restoreCell(e,t);this.restoreOldDataFromVersion(n.version-1)}}undoAddRows(e){const t=e.command.rowsSpans();for(let r=t.length-1;r>=0;--r){const n=t[r];this.operations.removeRows(new s.RemoveRowsCommand(e.command.sheet,[[n.rowStart,n.numberOfRows]]))}}undoAddColumns(e){const t=e.command.columnsSpans();for(let r=t.length-1;r>=0;--r){const n=t[r];this.operations.removeColumns(new s.RemoveColumnsCommand(e.command.sheet,[[n.columnStart,n.numberOfColumns]]))}}undoSetCellContents(e){for(const t of e.cellContents){const e=t.address,[r,s]=t.oldContent;(0,n.equalSimpleCellAddress)(e,r)||this.operations.setCellEmpty(e),this.operations.restoreCell(r,s)}}undoPaste(e){this.restoreOperationOldContent(e.oldContent);for(const t of e.addedGlobalNamedExpressions)this.operations.removeNamedExpression(t)}undoMoveRows(e){const{sheet:t}=e;this.operations.moveRows(t,e.undoStart,e.numberOfRows,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveColumns(e){const{sheet:t}=e;this.operations.moveColumns(t,e.undoStart,e.numberOfColumns,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveCells(e){this.operations.forceApplyPostponedTransformations(),this.operations.moveCells(e.destinationLeftCorner,e.width,e.height,e.sourceLeftCorner),this.restoreOperationOldContent(e.overwrittenCellsData),this.restoreOldDataFromVersion(e.version-1);for(const t of e.addedGlobalNamedExpressions)this.operations.removeNamedExpression(t)}undoAddSheet(e){const{sheetName:t}=e;this.operations.removeSheetByName(t)}undoRemoveSheet(e){this.operations.forceApplyPostponedTransformations();const{oldSheetContent:t,sheetId:r}=e;this.operations.addSheet(e.sheetName);for(let e=0;e<t.length;e++){const s=t[e];for(let t=0;t<s.length;t++){const o=s[t],i=(0,n.simpleCellAddress)(r,t,e);this.operations.restoreCell(i,o)}}for(const[t,n]of e.scopedNamedExpressions)this.operations.restoreNamedExpression(t,n,r);this.restoreOldDataFromVersion(e.version-1)}undoRenameSheet(e){this.operations.renameSheet(e.sheetId,e.oldName)}undoClearSheet(e){const{oldSheetContent:t,sheetId:r}=e;for(let e=0;e<t.length;e++){const s=t[e];for(let t=0;t<s.length;t++){const o=s[t],i=(0,n.simpleCellAddress)(r,t,e);this.operations.restoreCell(i,o)}}}undoSetSheetContent(e){const{oldSheetContent:t,sheetId:r}=e;this.operations.clearSheet(r);for(let e=0;e<t.length;e++){const s=t[e];for(let t=0;t<s.length;t++){const o=s[t],i=(0,n.simpleCellAddress)(r,t,e);this.operations.restoreCell(i,o)}}}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(){const 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(const 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){const{targetLeftCorner:t,newContent:r}=e,s=r.length,o=r[0].length;for(let e=0;e<s;++e)for(let s=0;s<o;++s){const o=(0,n.simpleCellAddress)(t.sheet,t.col+s,t.row+e);this.operations.restoreCell(o,r[e][s])}}redoSetCellContents(e){for(const 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.addSheet(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){const{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)}redoChangeNamedExpression(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(const[t,r]of e)this.operations.restoreCell(t,r)}redoEntry(e){e.doRedo(this)}restoreOldDataFromVersion(e){const t=this.oldData.get(e)||[];for(const e of t){const[t,r]=e;this.operations.setFormulaToCellFromCache(r,t)}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Evaluator:()=>p});var n=r(2),s=r(6),o=r(3),i=r(68),a=r(4),l=r(80),u=r(93),h=r(70),c=r(69),d=r(72);class p{constructor(e,t,r,n,s,o){this.config=e,this.stats=t,this.interpreter=r,this.lazilyTransformingAstService=n,this.dependencyGraph=s,this.columnSearch=o}run(){this.stats.start(d.StatType.TOP_SORT);const{sorted:e,cycled:t}=this.dependencyGraph.topSortWithScc();this.stats.end(d.StatType.TOP_SORT),this.stats.measure(d.StatType.EVALUATION,(()=>{this.recomputeFormulas(t,e)}))}partialRun(e){const t=i.ContentChanges.empty();return this.stats.measure(d.StatType.EVALUATION,(()=>{this.dependencyGraph.graph.getTopSortedWithSccSubgraphFrom(e,(e=>{if(e instanceof l.FormulaVertex){const r=e.isComputed()?e.getCellValue():void 0,n=this.recomputeFormulaVertexValue(e);if(n!==r){const s=e.getAddress(this.lazilyTransformingAstService);return t.addChange(n,s),this.columnSearch.change((0,h.getRawValue)(r),(0,h.getRawValue)(n),s),!0}return!1}return!(e instanceof a.RangeVertex)||(e.clearCache(),!0)}),(e=>{if(e instanceof a.RangeVertex)e.clearCache();else if(e instanceof l.FormulaVertex){const r=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.remove((0,h.getRawValue)(e.valueOrUndef()),r);const n=new o.CellError(o.ErrorType.CYCLE,void 0,e);e.setCellValue(n),t.addChange(n,r)}}))})),t}runAndForget(e,t,r){const o=[];for(const e of(0,s.absolutizeDependencies)(r,t))if(e instanceof n.AbsoluteCellRange){const t=e;if(void 0===this.dependencyGraph.getRange(t.start,t.end)){const e=new a.RangeVertex(t);this.dependencyGraph.rangeMapping.setRange(e),o.push(e)}}const i=this.evaluateAstToCellValue(e,new u.InterpreterState(t,this.config.useArrayArithmetic));return o.forEach((e=>{this.dependencyGraph.rangeMapping.removeRange(e)})),i}recomputeFormulas(e,t){e.forEach((e=>{e instanceof l.FormulaVertex&&e.setCellValue(new o.CellError(o.ErrorType.CYCLE,void 0,e))})),t.forEach((e=>{if(e instanceof l.FormulaVertex){const t=this.recomputeFormulaVertexValue(e),r=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.add((0,h.getRawValue)(t),r)}else e instanceof a.RangeVertex&&e.clearCache()}))}recomputeFormulaVertexValue(e){const t=e.getAddress(this.lazilyTransformingAstService);if(e instanceof a.ArrayVertex&&(e.array.size.isRef||!this.dependencyGraph.isThereSpaceForArray(e)))return e.setNoSpace();{const r=e.getFormula(this.lazilyTransformingAstService),n=this.evaluateAstToCellValue(r,new u.InterpreterState(t,this.config.useArrayArithmetic,e));return e.setCellValue(n)}}evaluateAstToCellValue(e,t){const r=this.interpreter.evaluateAst(e,t);return r instanceof c.SimpleRangeValue?r:r===h.EmptyValue&&this.config.evaluateNullToZero?0:r}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ExportedCellChange:()=>h,ExportedNamedExpressionChange:()=>c,Exporter:()=>d});var n=r(3),s=r(98),o=r(61),i=r(70),a=r(69),l=r(113),u=r(8);class h{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}}class d{constructor(e,t,r,n){this.config=e,this.namedExpressions=t,this.sheetIndexMapping=r,this.lazilyTransformingService=n}exportChange(e){const t=e.value,r=e.address;if(r.sheet===l.NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS){const e=this.namedExpressions.namedExpressionInAddress(r.row);if(!e)throw new Error("Missing named expression");return new c(e.displayName,this.exportScalarOrRange(t))}if(t instanceof a.SimpleRangeValue){const e=[];for(const[n,s]of t.entriesFromTopLeftCorner(r))e.push(new h(s,this.exportValue(n)));return e}return new h(r,this.exportValue(t))}exportValue(e){return e instanceof a.SimpleRangeValue?this.detailedError(new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.ScalarExpected)):this.config.smartRounding&&(0,i.isExtendedNumber)(e)?this.cellValueRounding((0,i.getRawValue)(e)):e instanceof n.CellError?this.detailedError(e):e===i.EmptyValue?null:(0,i.getRawValue)(e)}exportScalarOrRange(e){return e instanceof a.SimpleRangeValue?e.rawData().map((e=>e.map((e=>this.exportValue(e))))):this.exportValue(e)}detailedError(e){var t,r;let n;const o=null===(t=e.root)||void 0===t?void 0:t.getAddress(this.lazilyTransformingService);return void 0!==o&&(n=o.sheet===l.NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS?null===(r=this.namedExpressions.namedExpressionInAddress(o.row))||void 0===r?void 0:r.displayName:(0,u.simpleCellAddressToString)(this.sheetIndexMapping,o,-1)),new s.DetailedCellError(e,this.config.translationPackage.getErrorTranslation(e.type),n)}cellValueRounding(e){if(0===e)return e;const t=Math.floor(Math.log10(Math.abs(e))),r=Math.pow(10,this.config.precisionRounding-t);return e<0?-Math.round(-e*r)/r:Math.round(e*r)/r}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{GraphBuilder:()=>h,SimpleStrategy:()=>c});var n=r(6),s=r(1),o=r(3),i=r(110),a=r(4),l=r(70),u=r(72);class h{constructor(e,t,r,n,s,o){this.dependencyGraph=e,this.columnSearch=t,this.parser=r,this.cellContentParser=n,this.stats=s,this.arraySizePredictor=o,this.buildStrategy=new c(e,t,r,s,n,o)}buildGraph(e,t){const r=t.measure(u.StatType.COLLECT_DEPENDENCIES,(()=>this.buildStrategy.run(e)));this.dependencyGraph.getAndClearContentChanges(),t.measure(u.StatType.PROCESS_DEPENDENCIES,(()=>this.processDependencies(r)))}processDependencies(e){e.forEach(((e,t)=>{this.dependencyGraph.processCellDependencies(e,t)}))}}class c{constructor(e,t,r,n,s,o){this.dependencyGraph=e,this.columnIndex=t,this.parser=r,this.stats=n,this.cellContentParser=s,this.arraySizePredictor=o}run(e){const t=new Map;for(const r in e){const h=this.dependencyGraph.getSheetId(r),c=e[r];for(let e=0;e<c.length;++e){const r=c[e];for(let c=0;c<r.length;++c){const d=r[c],p=(0,o.simpleCellAddress)(h,c,e),g=this.cellContentParser.parse(d);if(g instanceof i.CellContent.Formula){const e=this.stats.measure(u.StatType.PARSER,(()=>this.parser.parse(g.formula,p)));if(e.errors.length>0){this.shrinkArrayIfNeeded(p);const t=new a.ParsingErrorVertex(e.errors,g.formula);this.dependencyGraph.addVertex(p,t)}else{this.shrinkArrayIfNeeded(p);const r=this.arraySizePredictor.checkArraySize(e.ast,p);if(r.isScalar()){const r=new a.FormulaCellVertex(e.ast,p,0);t.set(r,(0,n.absolutizeDependencies)(e.dependencies,p)),this.dependencyGraph.addVertex(p,r),e.hasVolatileFunction&&this.dependencyGraph.markAsVolatile(r),e.hasStructuralChangeFunction&&this.dependencyGraph.markAsDependentOnStructureChange(r)}else{const o=new a.ArrayVertex(e.ast,p,new s.ArraySize(r.width,r.height));t.set(o,(0,n.absolutizeDependencies)(e.dependencies,p)),this.dependencyGraph.addArrayVertex(p,o)}}}else if(g instanceof i.CellContent.Empty);else{this.shrinkArrayIfNeeded(p);const e=new a.ValueCellVertex(g.value,d);this.columnIndex.add((0,l.getRawValue)(g.value),p),this.dependencyGraph.addVertex(p,e)}}}}return t}shrinkArrayIfNeeded(e){const t=this.dependencyGraph.getCell(e);t instanceof a.ArrayVertex&&this.dependencyGraph.shrinkArrayToCorner(t)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FunctionRegistry:()=>a});var n=r(77),s=r(108),o=r(129);function i(e,t){var r;let s=t.implementedFunctions[e];const o=null===(r=t.aliases)||void 0===r?void 0:r[e];if(void 0!==o){if(void 0!==s)throw new n.AliasAlreadyExisting(e,t.name);s=t.implementedFunctions[o]}if(void 0===s)throw n.FunctionPluginValidationError.functionNotDeclaredInPlugin(e,t.name);return s}class a{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){this.instancePlugins=new Map;for(const t of e.functionPlugins)a.loadPluginFunctions(t,this.instancePlugins)}else this.instancePlugins=new Map(a.plugins);for(const[e,t]of a.protectedFunctions())a.loadFunctionUnprotected(t,e,this.instancePlugins);for(const[e,t]of this.instancePlugins.entries())this.categorizeFunction(e,i(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 n.ProtectedFunctionError.cannotUnregisterFunctionWithId(e);this.plugins.delete(e)}static unregisterFunctionPlugin(e){for(const t of this.protectedPlugins())if(t===e)throw n.ProtectedFunctionError.cannotUnregisterProtectedPlugin();for(const[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){return this.functionIsProtected(e)?void 0:this.plugins.get(e)}static functionIsProtected(e){return this._protectedPlugins.has(e)}static loadTranslations(e){const t=new Set(s.HyperFormula.getRegisteredLanguagesCodes());Object.keys(e).forEach((r=>{t.has(r)&&s.HyperFormula.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 n.ProtectedFunctionError.cannotRegisterFunctionWithId(t);this.loadFunctionUnprotected(e,t,r)}static loadFunctionUnprotected(e,t,r){const s=i(t,e).method;if(!Object.prototype.hasOwnProperty.call(e.prototype,s))throw n.FunctionPluginValidationError.functionMethodNotFound(s,e.name);r.set(t,e)}static*protectedFunctions(){for(const[e,t]of this._protectedPlugins)void 0!==t&&(yield[e,t])}static*protectedPlugins(){for(const[,e]of this._protectedPlugins)void 0!==e&&(yield e)}initializePlugins(e){const t=[];for(const[r,n]of this.instancePlugins.entries()){let s=t.find((e=>e instanceof n));void 0===s&&(s=new n(e),t.push(s));const o=i(r,n),a=o.method;this.functions.set(r,[a,s]);const l=o.arraySizeMethod;void 0!==l&&this.arraySizeFunctions.set(r,[l,s])}}getFunctionPlugin(e){if(!a.functionIsProtected(e))return this.instancePlugins.get(e)}getFunction(e){const t=this.functions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,r]=t;return(t,n)=>r[e](t,n)}}getArraySizeFunction(e){const t=this.arraySizeFunctions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,r]=t;return(t,n)=>r[e](t,n)}}getMetadata(e){return this.functionsMetadata.get(e)}getPlugins(){const e=new Set;for(const[t,r]of this.instancePlugins)a.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.arrayFunction&&this.arrayFunctions.add(e),t.doesNotNeedArgumentsToBeComputed&&this.functionsWhichDoesNotNeedArgumentsToBeComputed.add(e),t.isDependentOnSheetStructureChange&&this.structuralChangeFunctions.add(e),this.functionsMetadata.set(e,t)}}a.plugins=new Map,a._protectedPlugins=new Map([["VERSION",o.VersionPlugin],["OFFSET",void 0]])},(e,t,r)=>{"use strict";r.r(t),r.d(t,{VersionPlugin:()=>i});var n=r(108),s=r(94);const o=new Map([["gpl-v3",1],["missing",2],["invalid",3],["expired",4]]);class i extends s.FunctionPlugin{version(e,t){return this.runFunction(e.args,t,this.metadata("VERSION"),(()=>{const{licenseKeyValidityState:e,licenseKey:t}=this.config;let r;return o.has(t)?r=o.get(t):o.has(e)?r=o.get(e):"valid"===e&&(r=t.slice(-5)),`HyperFormula v${n.HyperFormula.version}, ${r}`}))}}i.implementedFunctions={VERSION:{method:"version",parameters:[]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Interpreter:()=>g});var n=r(2),s=r(81),o=r(3),i=r(61),a=r(57),l=r(95),u=r(131),h=r(128),c=r(93),d=r(70),p=r(69);class g{constructor(e,t,r,n,s,o,i,a,h,c){this.config=e,this.dependencyGraph=t,this.columnSearch=r,this.stats=n,this.arithmeticHelper=s,this.functionRegistry=o,this.namedExpressions=i,this.serialization=a,this.arraySizePredictor=h,this.dateTimeHelper=c,this.equalOp=(e,t)=>f(this.arithmeticHelper.eq,e,t),this.notEqualOp=(e,t)=>f(this.arithmeticHelper.neq,e,t),this.greaterThanOp=(e,t)=>f(this.arithmeticHelper.gt,e,t),this.lessThanOp=(e,t)=>f(this.arithmeticHelper.lt,e,t),this.greaterThanOrEqualOp=(e,t)=>f(this.arithmeticHelper.geq,e,t),this.lessThanOrEqualOp=(e,t)=>f(this.arithmeticHelper.leq,e,t),this.concatOp=(e,t)=>f(this.arithmeticHelper.concat,(0,l.coerceScalarToString)(e),(0,l.coerceScalarToString)(t)),this.plusOp=(e,t)=>f(this.arithmeticHelper.addWithEpsilon,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.minusOp=(e,t)=>f(this.arithmeticHelper.subtract,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.timesOp=(e,t)=>f(this.arithmeticHelper.multiply,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.powerOp=(e,t)=>f(this.arithmeticHelper.pow,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.divOp=(e,t)=>f(this.arithmeticHelper.divide,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.unaryMinusOp=e=>m(this.arithmeticHelper.unaryMinus,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.percentOp=e=>m(this.arithmeticHelper.unaryPercent,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.unaryPlusOp=e=>this.arithmeticHelper.unaryPlus(e),this.functionRegistry.initializePlugins(this),this.criterionBuilder=new u.CriterionBuilder(e)}evaluateAst(e,t){let r=this.evaluateAstWithoutPostprocessing(e,t);if((0,d.isExtendedNumber)(r)){if((0,l.isNumberOverflow)((0,d.getRawValue)(r)))return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.NaN);r=(0,d.cloneNumber)(r,(0,l.fixNegativeZero)((0,d.getRawValue)(r)))}return r instanceof p.SimpleRangeValue&&1===r.height()&&1===r.width()&&([[r]]=r.data),function(e,t){if(e instanceof o.CellError&&void 0!==t)return e.attachRootVertex(t);return e}(r,t.formulaVertex)}evaluateAstWithoutPostprocessing(e,t){switch(e.type){case a.AstNodeType.EMPTY:return d.EmptyValue;case a.AstNodeType.CELL_REFERENCE:{const r=e.reference.toSimpleCellAddress(t.formulaAddress);return(0,o.invalidSimpleCellAddress)(r)?new o.CellError(o.ErrorType.REF,i.ErrorMessage.BadRef):this.dependencyGraph.getCellValue(r)}case a.AstNodeType.NUMBER:case a.AstNodeType.STRING:return e.value;case a.AstNodeType.CONCATENATE_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.concatOp,r,n,t)}case a.AstNodeType.EQUALS_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.equalOp,r,n,t)}case a.AstNodeType.NOT_EQUAL_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.notEqualOp,r,n,t)}case a.AstNodeType.GREATER_THAN_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOp,r,n,t)}case a.AstNodeType.LESS_THAN_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOp,r,n,t)}case a.AstNodeType.GREATER_THAN_OR_EQUAL_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOrEqualOp,r,n,t)}case a.AstNodeType.LESS_THAN_OR_EQUAL_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOrEqualOp,r,n,t)}case a.AstNodeType.PLUS_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.plusOp,r,n,t)}case a.AstNodeType.MINUS_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.minusOp,r,n,t)}case a.AstNodeType.TIMES_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.timesOp,r,n,t)}case a.AstNodeType.POWER_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.powerOp,r,n,t)}case a.AstNodeType.DIV_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.divOp,r,n,t)}case a.AstNodeType.PLUS_UNARY_OP:{const r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryPlusOp,r,t)}case a.AstNodeType.MINUS_UNARY_OP:{const r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryMinusOp,r,t)}case a.AstNodeType.PERCENT_OP:{const r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.percentOp,r,t)}case a.AstNodeType.FUNCTION_CALL:{if("valid"!==this.config.licenseKeyValidityState&&!h.FunctionRegistry.functionIsProtected(e.procedureName))return new o.CellError(o.ErrorType.LIC,i.ErrorMessage.LicenseKey(this.config.licenseKeyValidityState));const r=this.functionRegistry.getFunction(e.procedureName);return void 0!==r?r(e,new c.InterpreterState(t.formulaAddress,t.arraysFlag||this.functionRegistry.isArrayFunction(e.procedureName),t.formulaVertex)):new o.CellError(o.ErrorType.NAME,i.ErrorMessage.FunctionName(e.procedureName))}case a.AstNodeType.NAMED_EXPRESSION:{const r=this.namedExpressions.nearestNamedExpression(e.expressionName,t.formulaAddress.sheet);return r?this.dependencyGraph.getCellValue(r.address):new o.CellError(o.ErrorType.NAME,i.ErrorMessage.NamedExpressionName(e.expressionName))}case a.AstNodeType.CELL_RANGE:{if(!this.rangeSpansOneSheet(e))return new o.CellError(o.ErrorType.REF,i.ErrorMessage.RangeManySheets);const r=n.AbsoluteCellRange.fromCellRange(e,t.formulaAddress),a=this.dependencyGraph.getArray(r);if(a){const e=a.array;if(e instanceof s.NotComputedArray)throw new Error("Array should be already computed");if(e instanceof o.CellError)return e;if(e instanceof s.ArrayValue)return p.SimpleRangeValue.fromRange(e.raw(),r,this.dependencyGraph);throw new Error("Unknown array")}return p.SimpleRangeValue.onlyRange(r,this.dependencyGraph)}case a.AstNodeType.COLUMN_RANGE:{if(!this.rangeSpansOneSheet(e))return new o.CellError(o.ErrorType.REF,i.ErrorMessage.RangeManySheets);const r=n.AbsoluteColumnRange.fromColumnRange(e,t.formulaAddress);return p.SimpleRangeValue.onlyRange(r,this.dependencyGraph)}case a.AstNodeType.ROW_RANGE:{if(!this.rangeSpansOneSheet(e))return new o.CellError(o.ErrorType.REF,i.ErrorMessage.RangeManySheets);const r=n.AbsoluteRowRange.fromRowRangeAst(e,t.formulaAddress);return p.SimpleRangeValue.onlyRange(r,this.dependencyGraph)}case a.AstNodeType.PARENTHESIS:return this.evaluateAst(e.expression,t);case a.AstNodeType.ARRAY:{let r;const n=[];for(const s of e.args){let e;const a=[];for(const r of s){const n=(0,l.coerceToRange)(this.evaluateAst(r,t)),s=n.height();if(void 0===e)e=s,a.push(...n.data);else{if(e!==s)return new o.CellError(o.ErrorType.REF,i.ErrorMessage.SizeMismatch);for(let e=0;e<s;e++)a[e].push(...n.data[e])}}const u=a[0].length;if(void 0===r)r=u,n.push(...a);else{if(r!==u)return new o.CellError(o.ErrorType.REF,i.ErrorMessage.SizeMismatch);n.push(...a)}}return p.SimpleRangeValue.onlyValues(n)}case a.AstNodeType.ERROR_WITH_RAW_INPUT:case a.AstNodeType.ERROR:return e.error}}rangeSpansOneSheet(e){return e.start.sheet===e.end.sheet}unaryRangeWrapper(e,t,r){var n;if(t instanceof p.SimpleRangeValue&&!r.arraysFlag&&(t=null!==(n=(0,l.coerceRangeToScalar)(t,r))&&void 0!==n?n:new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.ScalarExpected)),t instanceof o.CellError)return t;if(t instanceof p.SimpleRangeValue){const r=t.data.map((t=>t.map(e)));return p.SimpleRangeValue.onlyValues(r)}return e(t)}binaryRangeWrapper(e,t,r,n){var s,a;if(t instanceof p.SimpleRangeValue&&!n.arraysFlag&&(t=null!==(s=(0,l.coerceRangeToScalar)(t,n))&&void 0!==s?s:new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.ScalarExpected)),t instanceof o.CellError)return t;if(r instanceof p.SimpleRangeValue&&!n.arraysFlag&&(r=null!==(a=(0,l.coerceRangeToScalar)(r,n))&&void 0!==a?a:new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.ScalarExpected)),r instanceof o.CellError)return r;if(t instanceof p.SimpleRangeValue||r instanceof p.SimpleRangeValue){if(!(t instanceof p.SimpleRangeValue)){if(r.isAdHoc()){const n=r.data;for(let r=0;r<n.length;r++)for(let s=0;s<n[0].length;s++)n[r][s]=e(t,n[r][s]);return p.SimpleRangeValue.onlyValues(n)}t=p.SimpleRangeValue.fromScalar(t)}if(!(r instanceof p.SimpleRangeValue)){if(t.isAdHoc()){const n=t.data;for(let t=0;t<n.length;t++)for(let s=0;s<n[0].length;s++)n[t][s]=e(n[t][s],r);return p.SimpleRangeValue.onlyValues(n)}r=p.SimpleRangeValue.fromScalar(r)}if(t.width()===r.width()&&t.height()===r.height()){if(t.isAdHoc()){const n=t.data,s=r.data;for(let t=0;t<n.length;t++)for(let r=0;r<n[0].length;r++)n[t][r]=e(n[t][r],s[t][r]);return p.SimpleRangeValue.onlyValues(n)}if(r.isAdHoc()){const n=t.data,s=r.data;for(let t=0;t<n.length;t++)for(let r=0;r<n[0].length;r++)s[t][r]=e(n[t][r],s[t][r]);return p.SimpleRangeValue.onlyValues(s)}}const n=Math.max(t.width(),r.width()),s=Math.max(t.height(),r.height()),i=Array(s);for(let e=0;e<s;e++)i[e]=Array(n);for(let a=0;a<s;a++){const s=1!==t.height()?a:0,l=1!==r.height()?a:0;for(let u=0;u<n;u++){const n=1!==t.width()?u:0,h=1!==r.width()?u:0;s<t.height()&&l<r.height()&&n<t.width()&&h<r.width()?i[a][u]=e(t.data[s][n],r.data[l][h]):i[a][u]=new o.CellError(o.ErrorType.NA)}}return p.SimpleRangeValue.onlyValues(i)}return e(t,r)}}function m(e,t){return t instanceof o.CellError?t:e(t)}function f(e,t,r){return t instanceof o.CellError?t:r instanceof o.CellError?r:e(t,r)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CriterionBuilder:()=>i,CriterionType:()=>n,buildCriterion:()=>o,buildCriterionLambda:()=>l});var n,s=r(70);!function(e){e.GREATER_THAN="GREATER_THAN",e.GREATER_THAN_OR_EQUAL="GREATER_THAN_OR_EQUAL",e.LESS_THAN="LESS_THAN",e.LESS_THAN_OR_EQUAL="LESS_THAN_OR_EQUAL",e.NOT_EQUAL="NOT_EQUAL",e.EQUAL="EQUAL"}(n||(n={}));const o=(e,t)=>({operator:e,value:t});class i{constructor(e){var t,r,n,s;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!==(s=null===(n=e.translationPackage.getMaybeFunctionTranslation("FALSE"))||void 0===n?void 0:n.toLowerCase())&&void 0!==s?s:"false"}fromCellValue(e,t){if("string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e)return;const r=this.parseCriterion(e,t);return void 0!==r?{raw:e,lambda:l(r,t)}:void 0}parseCriterion(e,t){if("number"==typeof e||"boolean"==typeof e)return o(n.EQUAL,e);if("string"==typeof e){const r=a.exec(e);let i,l;r?(l=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}}(r[1]),i=r[2]):(l=n.EQUAL,i=e);const u=t.coerceToMaybeNumber(i),h=i.toLowerCase()===this.trueString||i.toLowerCase()!==this.falseString&&void 0;if(void 0===l)return;if(""===i)return o(l,null);if(void 0!==u)return o(l,(0,s.getRawValue)(u));if(l===n.EQUAL||l===n.NOT_EQUAL)return o(l,null!=h?h:i)}}}const a=/([<>=]+)(.*)/;const l=(e,t)=>{switch(e.operator){case n.GREATER_THAN:return"number"==typeof e.value?r=>"number"==typeof r&&t.floatCmp(r,e.value)>0:e=>!1;case n.GREATER_THAN_OR_EQUAL:return"number"==typeof e.value?r=>"number"==typeof r&&t.floatCmp(r,e.value)>=0:e=>!1;case n.LESS_THAN:return"number"==typeof e.value?r=>"number"==typeof r&&t.floatCmp(r,e.value)<0:e=>!1;case n.LESS_THAN_OR_EQUAL:return"number"==typeof e.value?r=>"number"==typeof r&&t.floatCmp(r,e.value)<=0:e=>!1;case n.EQUAL:return"number"==typeof e.value?r=>{if("number"==typeof r)return 0===t.floatCmp(r,e.value);if("string"==typeof r){if(""===r)return!1;const n=t.coerceToMaybeNumber(r);return void 0!==n&&0===t.floatCmp(n,e.value)}return!1}:"string"==typeof e.value?t.eqMatcherFunction(e.value):"boolean"==typeof e.value?t=>"boolean"==typeof t&&t===e.value:e=>e===s.EmptyValue;case n.NOT_EQUAL:return"number"==typeof e.value?r=>{if("number"==typeof r)return 0!==t.floatCmp(r,e.value);if("string"==typeof r){if(""===r)return!0;const n=t.coerceToMaybeNumber(r);return void 0===n||0!==t.floatCmp(n,e.value)}return!0}:"string"==typeof e.value?t.neqMatcherFunction(e.value):"boolean"==typeof e.value?t=>"boolean"!=typeof t||t!==e.value:e=>e!==s.EmptyValue}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LazilyTransformingAstService:()=>o});var n=r(133),s=r(72);class o{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 n.CombinedTransformer(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(s.StatType.TRANSFORM_ASTS_POSTPONED);for(let n=r;n<this.transformations.length;n++){const r=this.transformations[n];r.isIrreversible()&&(this.undoRedo.storeDataForVersion(n,t,this.parser.computeHashFromAst(e)),this.parser.rememberNewAst(e));const[s,o]=r.transformSingleAst(e,t);e=s,t=o}const n=this.parser.rememberNewAst(e);return this.stats.end(s.StatType.TRANSFORM_ASTS_POSTPONED),[n,t,this.transformations.length]}*getTransformationsFrom(e,t){for(let r=e;r<this.transformations.length;r++){const e=this.transformations[r];t&&!t(e)||(yield e)}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CombinedTransformer:()=>n});class n{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,n]=[e,t];return this.transformations.forEach((e=>{[r,n]=e.transformSingleAst(r,n)})),[r,n]}isIrreversible(){return!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{buildColumnSearchStrategy:()=>o});var n=r(135),s=r(138);function o(e,t,r){return t.useColumnIndex?new s.ColumnIndex(e,t,r):new n.ColumnBinarySearch(e)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ColumnBinarySearch:()=>s});var n=r(136);class s extends n.AdvancedFind{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,n){}removeValues(e){}find(e,t,r){return this.basicFind(e,t,"row",r)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AdvancedFind:()=>i});var n=r(70),s=r(95),o=r(137);class i{constructor(e){this.dependencyGraph=e}advancedFind(e,t){let r;const s=t.range;r=void 0===s?t.valuesFromTopLeftCorner():this.dependencyGraph.computeListOfValuesInRange(s);for(let t=0;t<r.length;t++)if(e((0,n.getRawValue)(r[t])))return t;return-1}basicFind(e,t,r,{ordering:n,matchExactly:i}){const a="string"==typeof e?(0,s.forceNormalizeString)(e):e,l=t.range;return void 0===l?this.findNormalizedValue(a,t.valuesFromTopLeftCorner()):"none"===n?this.findNormalizedValue(a,this.dependencyGraph.computeListOfValuesInRange(l)):(0,o.findLastOccurrenceInOrderedRange)(a,l,{searchCoordinate:r,orderingDirection:n,matchExactly:i},this.dependencyGraph)}findNormalizedValue(e,t){return t.map(n.getRawValue).map((e=>"string"==typeof e?(0,s.forceNormalizeString)(e):e)).indexOf(e)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{compare:()=>u,findLastMatchingIndex:()=>l,findLastOccurrenceInOrderedArray:()=>a,findLastOccurrenceInOrderedRange:()=>i});var n=r(3),s=r(70);const o=-1;function i(e,t,{searchCoordinate:r,orderingDirection:i,matchExactly:a},h){const c=t.start[r],d="col"===r?t.effectiveEndColumn(h):t.effectiveEndRow(h),p="col"===r?e=>(0,s.getRawValue)(h.getCellValue((0,n.simpleCellAddress)(t.sheet,e,t.start.row))):e=>(0,s.getRawValue)(h.getCellValue((0,n.simpleCellAddress)(t.sheet,t.start.col,e))),g="asc"===i?(e,t)=>u(e,t):(e,t)=>-u(e,t),m=l((t=>g(e,p(t))>=0),c,d),f=p(m);return m===o||typeof f!=typeof e||a&&f!==e?o:m-c}function a(e,t,r="asc"){return l("asc"===r?r=>u(e,t[r])>=0:r=>-u(e,t[r])>=0,0,t.length-1)}function l(e,t,r){let n=t,s=r;for(;n<s;){const t=Math.ceil((n+s)/2);e(t)?n=t:s=t-1}return n===s&&e(n)?n:o}function u(e,t){return typeof e==typeof t?e===s.EmptyValue?0:e<t?-1:e>t?1:0:e===s.EmptyValue?-1:t===s.EmptyValue?1:t instanceof n.CellError||"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}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ColumnIndex:()=>c,findInOrderedArray:()=>d});var n=r(3),s=r(117),o=r(121),i=r(95),a=r(70),l=r(69),u=r(72),h=r(135);class c{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 h.ColumnBinarySearch(e)}add(e,t){if(!(e===a.EmptyValue||e instanceof n.CellError))if(e instanceof l.SimpleRangeValue)for(const[r,n]of e.entriesFromTopLeftCorner(t))this.addSingleCellValue((0,a.getRawValue)(r),n);else this.addSingleCellValue(e,t)}remove(e,t){if(void 0!==e)if(e instanceof l.SimpleRangeValue)for(const[r,n]of e.entriesFromTopLeftCorner(t))this.removeSingleValue((0,a.getRawValue)(r),n);else this.removeSingleValue(e,t)}change(e,t,r){e!==t&&(this.remove(e,r),this.add(t,r))}applyChanges(e){for(const t of e)void 0!==t.oldValue&&this.change((0,a.getRawValue)(t.oldValue),(0,a.getRawValue)(t.value),t.address)}moveValues(e,t,r,s){for(const[o,i]of e){const e=(0,n.movedSimpleCellAddress)(i,s,t,r);this.remove(o,i),this.add(o,e)}}removeValues(e){for(const[t,r]of e)this.remove(t,r)}find(e,t,{ordering:r,matchExactly:n}){const s=!0===n?"findFirst":"findLast",o=this.findUsingColumnIndex(e,t,s);return void 0!==o?o:this.binarySearchStrategy.find(e,t,{ordering:r,matchExactly:n})}findUsingColumnIndex(e,t,r){const n=t.range;if(void 0===n)return;this.ensureRecentData(n.sheet,n.start.col,e);const s=this.getColumnMap(n.sheet,n.start.col);if(!s)return-1;const o="string"==typeof e?(0,i.forceNormalizeString)(e):e,a=s.get(o);if(!a||!a.index||0===a.index.length)return;const l=c.findRowBelongingToRange(a,n,r);return void 0!==l?l-n.start.row:void 0}static findRowBelongingToRange(e,t,r){const n=t.start.row,s=t.end.row,o="findFirst"===r?d(n,e.index,"upperBound"):d(s,e.index,"lowerBound");if(-1===o)return;const i=e.index[o];return i>=n&&i<=s?i:void 0}advancedFind(e,t){return this.binarySearchStrategy.advancedFind(e,t)}addColumns(e){const t=this.index.get(e.sheet);t&&t.splice(e.columnStart,0,...Array(e.numberOfColumns))}removeColumns(e){const 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,[]);const r=this.index.get(e);let n=r[t];return n||(n=new Map,r[t]=n),n}getValueIndex(e,t,r){const n=this.getColumnMap(e,t);let s=this.getColumnMap(e,t).get(r);return s||(s={version:this.transformingService.version(),index:[]},n.set(r,s)),s}ensureRecentData(e,t,r){const n=this.getValueIndex(e,t,r),i=this.transformingService.version();if(n.version===i)return;const a=this.transformingService.getTransformationsFrom(n.version,(t=>t.sheet===e&&(t instanceof s.AddRowsTransformer||t instanceof o.RemoveRowsTransformer)));for(const e of a)e instanceof s.AddRowsTransformer?this.addRows(t,e.rowsSpan,r):e instanceof o.RemoveRowsTransformer&&this.removeRows(t,e.rowsSpan,r);n.version=i}addSingleCellValue(e,t){this.stats.measure(u.StatType.BUILD_COLUMN_INDEX,(()=>{this.ensureRecentData(t.sheet,t.col,e),"string"==typeof e&&(e=(0,i.forceNormalizeString)(e));const r=this.getValueIndex(t.sheet,t.col,e);c.addValue(r,t.row)}))}removeSingleValue(e,t){this.stats.measure(u.StatType.BUILD_COLUMN_INDEX,(()=>{this.ensureRecentData(t.sheet,t.col,e);const r=this.getColumnMap(t.sheet,t.col);"string"==typeof e&&(e=(0,i.forceNormalizeString)(e));const n=r.get(e);if(!n)return;const s=d(t.row,n.index);s>-1&&n.index.splice(s,1),0===n.index.length&&r.delete(e),0===r.size&&delete this.index.get(t.sheet)[t.col]}))}addRows(e,t,r){const n=this.getValueIndex(t.sheet,e,r);c.shiftRows(n,t.rowStart,t.numberOfRows)}removeRows(e,t,r){const n=this.getValueIndex(t.sheet,e,r);c.removeRowsFromValues(n,t),c.shiftRows(n,t.rowEnd+1,-t.numberOfRows)}static addValue(e,t){const r=d(t,e.index,"lowerBound");e.index[r]===t||e.index.splice(r+1,0,t)}static removeRowsFromValues(e,t){const r=d(t.rowStart,e.index,"upperBound"),n=d(t.rowEnd,e.index,"lowerBound");r>-1&&n>-1&&r<=n&&e.index[r]<=t.rowEnd&&e.index.splice(r,n-r+1)}static shiftRows(e,t,r){const n=d(t,e.index,"upperBound");if(-1!==n)for(let t=n;t<e.index.length;++t)e.index[t]+=r}}function d(e,t,r="upperBound"){let n=0,s=t.length-1;for(;n<=s;){const r=Math.floor((n+s)/2);if(e>t[r])n=r+1;else{if(!(e<t[r]))return r;s=r-1}}const o="lowerBound"===r?s:n;return o>=0&&o<=t.length?o:-1}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{NumberLiteralHelper:()=>n});class n{constructor(e){this.config=e;const t="."===this.config.thousandSeparator?`\\${this.config.thousandSeparator}`:this.config.thousandSeparator,r="."===this.config.decimalSeparator?`\\${this.config.decimalSeparator}`:this.config.decimalSeparator;this.numberPattern=new RegExp(`^([+-]?((${r}\\d+)|(\\d+(${t}\\d{3,})*(${r}\\d*)?)))(e[+-]?\\d+)?$`),this.allThousandSeparatorsRegex=new RegExp(`${t}`,"g")}numericStringToMaybeNumber(e){if(this.numberPattern.test(e)){const t=this.numericStringToNumber(e);if(isNaN(t))return;return t}}numericStringToNumber(e){const t=e.replace(this.allThousandSeparatorsRegex,"").replace(this.config.decimalSeparator,".");return Number(t)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Serialization:()=>i});var n=r(3),s=r(4),o=r(7);class i{constructor(e,t,r){this.dependencyGraph=e,this.unparser=t,this.exporter=r}getCellHyperlink(e){const t=this.dependencyGraph.getCell(e);if(t instanceof s.FormulaCellVertex){const e=t.getFormula(this.dependencyGraph.lazilyTransformingAstService);if("HYPERLINK"===e.procedureName)return e.hyperlink}}getCellFormula(e,t){const r=this.dependencyGraph.getCell(e);if(r instanceof s.FormulaCellVertex){const n=r.getFormula(this.dependencyGraph.lazilyTransformingAstService);return t=null!=t?t:e,this.unparser.unparse(n,t)}if(r instanceof s.ArrayVertex){const n=r.getAddress(this.dependencyGraph.lazilyTransformingAstService);if(n.row!==e.row||n.col!==e.col||n.sheet!==e.sheet)return;t=null!=t?t:e;const s=r.getFormula(this.dependencyGraph.lazilyTransformingAstService);if(void 0!==s)return this.unparser.unparse(s,t)}else if(r instanceof s.ParsingErrorVertex)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){const r=this.dependencyGraph.getSheetHeight(e),s=this.dependencyGraph.getSheetWidth(e),o=new Array(r);for(let i=0;i<r;i++){o[i]=new Array(s);for(let r=0;r<s;r++){const s=(0,n.simpleCellAddress)(e,r,i);o[i][r]=t(s)}for(let e=s-1;e>=0&&(null===o[i][e]||void 0===o[i][e]);e--)o[i].pop()}for(let e=r-1;e>=0&&0===o[e].length;e--)o.pop();return o}genericAllSheetsGetter(e){const t={};for(const r of this.dependencyGraph.sheetMapping.displayNames()){const n=this.dependencyGraph.sheetMapping.fetch(r);t[r]=e(n)}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(){const e=[];let t=0;for(const r of this.dependencyGraph.sheetMapping.displayNames()){const n=this.dependencyGraph.sheetMapping.fetch(r);e[n]=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){const r=new o.Unparser(e,(0,o.buildLexerConfig)(e),this.dependencyGraph.sheetMapping.fetchDisplayName,t);return new i(this.dependencyGraph,r,this.exporter)}}},(e,t,r)=>{"use strict";function n(e){for(const[t,r]of Object.entries(e))r instanceof Function?e[t]=s(r):delete e[t]}function s(e){return()=>{throw new Error(`The "${e}" method cannot be called because this HyperFormula instance has been destroyed`)}}r.r(t),r.d(t,{objectDestroy:()=>n})},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Emitter:()=>o,Events:()=>n});var n,s=r(143);!function(e){e.SheetAdded="sheetAdded",e.SheetRemoved="sheetRemoved",e.SheetRenamed="sheetRenamed",e.NamedExpressionAdded="namedExpressionAdded",e.NamedExpressionRemoved="namedExpressionRemoved",e.ValuesUpdated="valuesUpdated",e.EvaluationSuspended="evaluationSuspended",e.EvaluationResumed="evaluationResumed"}(n||(n={}));class o extends s.TinyEmitter{emit(e,...t){return super.emit(e,...t),this}}},e=>{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function s(){n.off(e,s),t.apply(r,arguments)}return s._=t,this.on(e,s,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,s=r.length;n<s;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],s=[];if(n&&t)for(var o=0,i=n.length;o<i;o++)n[o].fn!==t&&n[o].fn._!==t&&s.push(n[o]);return s.length?r[e]=s:delete r[e],this}},e.exports=t,e.exports.TinyEmitter=t},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n={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",YEAR:"YEAR",YEARFRAC:"YEARFRAC","HF.ADD":"HF.ADD","HF.CONCAT":"HF.CONCAT","HF.DIVIDE":"HF.DIVIDE","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"}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FunctionArgumentType:()=>n.FunctionArgumentType,FunctionPlugin:()=>n.FunctionPlugin});var n=r(94)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbsPlugin:()=>o.AbsPlugin,AddressPlugin:()=>n.AddressPlugin,ArrayPlugin:()=>s.ArrayPlugin,BitShiftPlugin:()=>i.BitShiftPlugin,BitwiseLogicOperationsPlugin:()=>a.BitwiseLogicOperationsPlugin,BooleanPlugin:()=>l.BooleanPlugin,CharPlugin:()=>u.CharPlugin,CodePlugin:()=>h.CodePlugin,ComplexPlugin:()=>Y.ComplexPlugin,ConditionalAggregationPlugin:()=>D.ConditionalAggregationPlugin,CountBlankPlugin:()=>c.CountBlankPlugin,CountUniquePlugin:()=>d.CountUniquePlugin,DateTimePlugin:()=>p.DateTimePlugin,DegreesPlugin:()=>g.DegreesPlugin,DeltaPlugin:()=>m.DeltaPlugin,ExpPlugin:()=>f.ExpPlugin,FinancialPlugin:()=>y.FinancialPlugin,FormulaTextPlugin:()=>E.FormulaTextPlugin,HyperlinkPlugin:()=>C.HyperlinkPlugin,InformationPlugin:()=>T.InformationPlugin,IsEvenPlugin:()=>R.IsEvenPlugin,IsOddPlugin:()=>w.IsOddPlugin,LogarithmPlugin:()=>S.LogarithmPlugin,LookupPlugin:()=>U.LookupPlugin,MathConstantsPlugin:()=>v.MathConstantsPlugin,MathPlugin:()=>G.MathPlugin,MatrixPlugin:()=>A.MatrixPlugin,MedianPlugin:()=>N.MedianPlugin,ModuloPlugin:()=>O.ModuloPlugin,NumericAggregationPlugin:()=>M.NumericAggregationPlugin,PowerPlugin:()=>b.PowerPlugin,RadiansPlugin:()=>I.RadiansPlugin,RadixConversionPlugin:()=>_.RadixConversionPlugin,RandomPlugin:()=>x.RandomPlugin,RomanPlugin:()=>V.RomanPlugin,RoundingPlugin:()=>P.RoundingPlugin,SimpleArithmerticPlugin:()=>B.SimpleArithmerticPlugin,SqrtPlugin:()=>L.SqrtPlugin,StatisticalAggregationPlugin:()=>j.StatisticalAggregationPlugin,StatisticalPlugin:()=>W.StatisticalPlugin,SumprodPlugin:()=>F.SumprodPlugin,TextPlugin:()=>k.TextPlugin,TrigonometryPlugin:()=>H.TrigonometryPlugin});var n=r(147),s=r(148),o=r(149),i=r(150),a=r(151),l=r(152),u=r(153),h=r(154),c=r(155),d=r(156),p=r(157),g=r(158),m=r(159),f=r(160),y=r(161),E=r(162),C=r(163),T=r(164),R=r(165),w=r(166),S=r(167),v=r(168),A=r(169),N=r(170),O=r(171),M=r(172),b=r(173),I=r(174),_=r(175),x=r(176),P=r(177),L=r(178),D=r(179),F=r(182),k=r(183),H=r(184),U=r(185),V=r(187),B=r(188),W=r(189),G=r(192),Y=r(193),j=r(194)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressPlugin:()=>l});var n,s=r(8),o=r(94),i=r(3),a=r(61);!function(e){e[e.FullyAbsolute=1]="FullyAbsolute",e[e.RowAbsoluteColRelative=2]="RowAbsoluteColRelative",e[e.RowRelativeColAbsolute=3]="RowRelativeColAbsolute",e[e.FullyRelative=4]="FullyRelative"}(n||(n={}));class l extends o.FunctionPlugin{verifyAddressArguments(e,t,r,s){if(s){if(e<1||t<1)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.LessThanOne)}else if(n.FullyAbsolute==r){if(e<1||t<1)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.LessThanOne)}else if(n.RowAbsoluteColRelative==r){if(e<1)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.LessThanOne)}else if(n.RowRelativeColAbsolute==r&&t<1)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.LessThanOne)}address(e,t){return this.runFunction(e.args,t,this.metadata("ADDRESS"),((e,t,r,o,i)=>{const a=this.verifyAddressArguments(e,t,r,o);if(void 0!==a)return a;const l=(0,s.columnIndexToLabel)(t-1);let u="";null!=i&&(u=`${i}!`);const h=0==t?"C":`C[${t}]`,c=0==e?"R":`R[${e}]`;return n.FullyRelative==r?o?`${u}${l}${e}`:`${u}${c}${h}`:n.RowRelativeColAbsolute==r?o?`${u}$${l}${e}`:`${u}${c}C${t}`:n.RowAbsoluteColRelative==r?o?`${u}${l}$${e}`:`${u}R${e}${h}`:o?`${u}$${l}$${e}`:`${u}R${e}C${t}`}))}}l.implementedFunctions={ADDRESS:{method:"address",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,optionalArg:!0,defaultValue:1,minValue:1,maxValue:4},{argumentType:o.FunctionArgumentType.BOOLEAN,optionalArg:!0,defaultValue:!0},{argumentType:o.FunctionArgumentType.STRING,optionalArg:!0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArrayPlugin:()=>c});var n=r(1),s=r(3),o=r(61),i=r(7),a=r(95),l=r(93),u=r(69),h=r(94);class c extends h.FunctionPlugin{arrayformula(e,t){return this.runFunction(e.args,t,this.metadata("ARRAYFORMULA"),(e=>e))}arrayformulaArraySize(e,t){if(1!==e.args.length)return n.ArraySize.error();const r=this.metadata("ARRAYFORMULA");return e.args.map((e=>{var n;return this.arraySizeForAst(e,new l.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))}))[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());const n=e.data,s=[];for(let e=0;e<t;e++)s.push(n[e].slice(0,r));return u.SimpleRangeValue.onlyValues(s)}))}arrayconstrainArraySize(e,t){if(3!==e.args.length)return n.ArraySize.error();const r=this.metadata("ARRAY_CONSTRAIN"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new l.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))}));let{height:o,width:a}=s[0];return e.args[1].type===i.AstNodeType.NUMBER&&(o=Math.min(o,e.args[1].value)),e.args[2].type===i.AstNodeType.NUMBER&&(a=Math.min(a,e.args[2].value)),o<1||a<1||!Number.isInteger(o)||!Number.isInteger(a)?n.ArraySize.error():new n.ArraySize(a,o)}filter(e,t){return this.runFunction(e.args,t,this.metadata("FILTER"),((e,...t)=>{for(const r of t)if(e.width()!==r.width()||e.height()!==r.height())return new s.CellError(s.ErrorType.NA,o.ErrorMessage.EqualLength);if(e.width()>1&&e.height()>1)return new s.CellError(s.ErrorType.NA,o.ErrorMessage.WrongDimension);const r=e.data,n=[];for(let s=0;s<e.height();s++){const o=[];for(let n=0;n<e.width();n++){let e=!0;for(const r of t){if(!0!==(0,a.coerceScalarToBoolean)(r.data[s][n])){e=!1;break}}e&&o.push(r[s][n])}o.length>0&&n.push(o)}return n.length>0?u.SimpleRangeValue.onlyValues(n):new s.CellError(s.ErrorType.NA,o.ErrorMessage.EmptyRange)}))}filterArraySize(e,t){if(e.args.length<=1)return n.ArraySize.error();const r=this.metadata("FILTER"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new l.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))})),o=Math.max(...s.map((e=>e.width))),i=Math.max(...s.map((e=>e.height)));return new n.ArraySize(o,i)}}c.implementedFunctions={ARRAYFORMULA:{method:"arrayformula",arraySizeMethod:"arrayformulaArraySize",arrayFunction:!0,parameters:[{argumentType:h.FunctionArgumentType.ANY}]},ARRAY_CONSTRAIN:{method:"arrayconstrain",arraySizeMethod:"arrayconstrainArraySize",parameters:[{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.INTEGER,minValue:1},{argumentType:h.FunctionArgumentType.INTEGER,minValue:1}],vectorizationForbidden:!0},FILTER:{method:"filter",arraySizeMethod:"filterArraySize",arrayFunction:!0,parameters:[{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.RANGE}],repeatLastArgs:1}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbsPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{abs(e,t){return this.runFunction(e.args,t,this.metadata("ABS"),Math.abs)}}s.implementedFunctions={ABS:{method:"abs",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BitShiftPlugin:()=>a});var n=r(3),s=r(61),o=r(94);const i=0xffffffffffff;class a extends o.FunctionPlugin{bitlshift(e,t){return this.runFunction(e.args,t,this.metadata("BITLSHIFT"),l)}bitrshift(e,t){return this.runFunction(e.args,t,this.metadata("BITRSHIFT"),u)}}function l(e,t){return t<0?u(e,-t):h(e*Math.pow(2,t))}function u(e,t){return t<0?l(e,-t):h(Math.floor(e/Math.pow(2,t)))}function h(e){return e>i?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.BitshiftLong):e}a.implementedFunctions={BITLSHIFT:{method:"bitlshift",parameters:[{argumentType:o.FunctionArgumentType.INTEGER,minValue:0},{argumentType:o.FunctionArgumentType.INTEGER,minValue:-53,maxValue:53}]},BITRSHIFT:{method:"bitrshift",parameters:[{argumentType:o.FunctionArgumentType.INTEGER,minValue:0},{argumentType:o.FunctionArgumentType.INTEGER,minValue:-53,maxValue:53}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BitwiseLogicOperationsPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{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))}}s.implementedFunctions={BITAND:{method:"bitand",parameters:[{argumentType:n.FunctionArgumentType.INTEGER,minValue:0},{argumentType:n.FunctionArgumentType.INTEGER,minValue:0}]},BITOR:{method:"bitor",parameters:[{argumentType:n.FunctionArgumentType.INTEGER,minValue:0},{argumentType:n.FunctionArgumentType.INTEGER,minValue:0}]},BITXOR:{method:"bitxor",parameters:[{argumentType:n.FunctionArgumentType.INTEGER,minValue:0},{argumentType:n.FunctionArgumentType.INTEGER,minValue:0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BooleanPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{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 n.CellError(n.ErrorType.NA,s.ErrorMessage.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=>void 0!==e)).forEach((e=>{e&&t++})),t%2==1}))}switch(e,t){return this.runFunction(e.args,t,this.metadata("SWITCH"),((e,...t)=>{const r=t.length;let o=0;for(;o+1<r;o+=2)if(!(t[o]instanceof n.CellError)&&this.arithmeticHelper.eq(e,t[o]))return t[o+1];return o<r?t[o]:new n.CellError(n.ErrorType.NA,s.ErrorMessage.NoDefault)}))}iferror(e,t){return this.runFunction(e.args,t,this.metadata("IFERROR"),((e,t)=>e instanceof n.CellError?t:e))}ifna(e,t){return this.runFunction(e.args,t,this.metadata("IFNA"),((e,t)=>e instanceof n.CellError&&e.type===n.ErrorType.NA?t:e))}choose(e,t){return this.runFunction(e.args,t,this.metadata("CHOOSE"),((e,...t)=>e>t.length?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.Selector):t[e-1]))}}i.implementedFunctions={TRUE:{method:"literalTrue",parameters:[]},FALSE:{method:"literalFalse",parameters:[]},IF:{method:"conditionalIf",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:o.FunctionArgumentType.SCALAR,defaultValue:!1,passSubtype:!0}]},IFS:{method:"ifs",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:2},AND:{method:"and",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},OR:{method:"or",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},XOR:{method:"xor",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},NOT:{method:"not",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN}]},SWITCH:{method:"switch",parameters:[{argumentType:o.FunctionArgumentType.NOERROR},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:1},IFERROR:{method:"iferror",parameters:[{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}]},IFNA:{method:"ifna",parameters:[{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}]},CHOOSE:{method:"choose",parameters:[{argumentType:o.FunctionArgumentType.INTEGER,minValue:1},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:1}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CharPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{char(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),(e=>e<1||e>=256?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.CharacterCodeBounds):String.fromCharCode(Math.trunc(e))))}unichar(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),(e=>e<1||e>=1114112?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.CharacterCodeBounds):String.fromCodePoint(Math.trunc(e))))}}i.implementedFunctions={CHAR:{method:"char",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},UNICHAR:{method:"unichar",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CodePlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{code(e,t){return this.runFunction(e.args,t,this.metadata("CODE"),(e=>0===e.length?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.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 n.CellError(n.ErrorType.VALUE,s.ErrorMessage.EmptyString)}))}}i.implementedFunctions={CODE:{method:"code",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},UNICODE:{method:"unicode",parameters:[{argumentType:o.FunctionArgumentType.STRING}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CountBlankPlugin:()=>o});var n=r(70),s=r(94);class o extends s.FunctionPlugin{countblank(e,t){return this.runFunction(e.args,t,this.metadata("COUNTBLANK"),((...e)=>{let t=0;return e.forEach((e=>{e===n.EmptyValue&&t++})),t}))}}o.implementedFunctions={COUNTBLANK:{method:"countblank",parameters:[{argumentType:s.FunctionArgumentType.SCALAR}],repeatLastArgs:1,expandRanges:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CountUniquePlugin:()=>o});var n=r(3),s=r(94);class o extends s.FunctionPlugin{countunique(e,t){return this.runFunction(e.args,t,this.metadata("COUNTUNIQUE"),((...e)=>{const t=new Set,r=new Set;for(const s of e)s instanceof n.CellError?r.add(s.type):""!==s&&t.add(s);return t.size+r.size}))}}o.implementedFunctions={COUNTUNIQUE:{method:"countunique",parameters:[{argumentType:s.FunctionArgumentType.SCALAR}],repeatLastArgs:1,expandRanges:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DateTimePlugin:()=>u});var n=r(3),s=r(102),o=r(61),i=r(104),a=r(70),l=r(94);class u extends l.FunctionPlugin{constructor(){super(...arguments),this.isoweeknumCore=e=>{const t=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),r=this.dateTimeHelper.numberToSimpleDate(e),n=this.dateTimeHelper.dateToNumber({year:r.year,month:1,day:1}),s=this.dateTimeHelper.relativeNumberToAbsoluteNumber(n),o=s+((4-s)%7+7)%7,i=Math.floor((t-1)/7)-Math.floor((o-1)/7)+1;return 0===i?this.isoweeknumCore(e-7)+1:i},this.days360Core=(e,t,r)=>{const n=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);let i,a;return r?(i=(0,s.toBasisEU)(n),a=(0,s.toBasisEU)(o)):[i,a]=this.dateTimeHelper.toBasisUS(n,o),360*(a.year-i.year)+30*(a.month-i.month)+a.day-i.day}}date(e,t){return this.runFunction(e.args,t,this.metadata("DATE"),((e,t,r)=>{const s=Math.trunc(r);let i=Math.trunc(t),a=Math.trunc(e);a<this.dateTimeHelper.getEpochYearZero()&&(a+=this.dateTimeHelper.getEpochYearZero());const l=Math.floor((i-1)/12);a+=l,i-=12*l;const u={year:a,month:i,day:1};if(this.dateTimeHelper.isValidDate(u)){let e=this.dateTimeHelper.dateToNumber(u)+(s-1);return e=this.dateTimeHelper.getWithinBounds(e),void 0===e?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.DateBounds):e}return new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.InvalidDate)}))}time(e,t){return this.runFunction(e.args,t,this.metadata("TIME"),((e,t,r)=>{const i=(0,s.timeToNumber)({hours:Math.trunc(e),minutes:Math.trunc(t),seconds:Math.trunc(r)});return i<0?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.NegativeTime):i%1}))}eomonth(e,t){return this.runFunction(e.args,t,this.metadata("EOMONTH"),((e,t)=>{const r=this.dateTimeHelper.numberToSimpleDate(e);let i=this.dateTimeHelper.dateToNumber(this.dateTimeHelper.endOfMonth((0,s.offsetMonth)(r,t)));return i=this.dateTimeHelper.getWithinBounds(i),void 0===i?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.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,s.numberToSimpleTime)((0,s.roundToNearestSecond)(e)%1).hours))}minute(e,t){return this.runFunction(e.args,t,this.metadata("MINUTE"),(e=>(0,s.numberToSimpleTime)((0,s.roundToNearestSecond)(e)%1).minutes))}second(e,t){return this.runFunction(e.args,t,this.metadata("SECOND"),(e=>(0,s.numberToSimpleTime)((0,s.roundToNearestSecond)(e)%1).seconds))}text(e,t){return this.runFunction(e.args,t,this.metadata("TEXT"),((e,t)=>(0,i.format)(e,t,this.config,this.dateTimeHelper)))}weekday(e,t){return this.runFunction(e.args,t,this.metadata("WEEKDAY"),((e,t)=>{const r=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));if(3===t)return(r-1)%7;const s=d.get(t);return void 0===s?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.BadMode):(r-s)%7+1}))}weeknum(e,t){return this.runFunction(e.args,t,this.metadata("WEEKNUM"),((e,t)=>{const r=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),s=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.dateToNumber({year:s.year,month:1,day:1}),a=this.dateTimeHelper.relativeNumberToAbsoluteNumber(i);if(21===t)return this.isoweeknumCore(e);const l=d.get(t);return void 0===l?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.BadMode):Math.floor((r-l)/7)-Math.floor((a-l)/7)+1}))}isoweeknum(e,t){return this.runFunction(e.args,t,this.metadata("ISOWEEKNUM"),this.isoweeknumCore)}datevalue(e,t){return this.runFunction(e.args,t,this.metadata("DATEVALUE"),(e=>{const{dateTime:t}=this.dateTimeHelper.parseDateTimeFromConfigFormats(e);return void 0===t?new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.IncorrectDateTime):(0,s.instanceOfSimpleDate)(t)?((0,s.instanceOfSimpleTime)(t)?Math.trunc((0,s.timeToNumber)(t)):0)+this.dateTimeHelper.dateToNumber(t):0}))}timevalue(e,t){return this.runFunction(e.args,t,this.metadata("TIMEVALUE"),(e=>{const t=this.dateTimeHelper.dateStringToDateNumber(e);return void 0===t?new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.IncorrectDateTime):(0,a.getRawValue)(t)%1}))}now(e,t){return this.runFunction(e.args,t,this.metadata("NOW"),(()=>{const e=new Date(Date.now());return(0,s.timeToNumber)({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"),(()=>{const 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)=>{const r=this.dateTimeHelper.numberToSimpleDate(e),i=(0,s.truncateDayInMonth)((0,s.offsetMonth)(r,t));let a=this.dateTimeHelper.dateToNumber(i);return a=this.dateTimeHelper.getWithinBounds(a),void 0===a?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.DateBounds):a}))}datedif(e,t){return this.runFunction(e.args,t,this.metadata("DATEDIF"),((e,t,r)=>{if(e>t)return new n.CellError(n.ErrorType.NUM,o.ErrorMessage.StartEndDate);if("D"===r)return Math.floor(t)-Math.floor(e);const s=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);switch(r){case"M":return 12*(i.year-s.year)+(i.month-s.month)-(i.day<s.day?1:0);case"YM":return(i.month-s.month+12-(i.day<s.day?1:0))%12;case"Y":return i.month>s.month||i.month===s.month&&i.day>=s.day?i.year-s.year:i.year-s.year-1;case"MD":if(i.day>=s.day)return i.day-s.day;{const e=1===i.month?12:i.month-1,t=1===i.month?i.year-1:i.year;return this.dateTimeHelper.daysInMonth(t,e)+i.day-s.day}case"YD":return i.month>s.month||i.month===s.month&&i.day>=s.day?Math.floor(t)-this.dateTimeHelper.dateToNumber({year:i.year,month:s.month,day:s.day}):Math.floor(t)-Math.floor(e)-365*(i.year-s.year-1)-this.dateTimeHelper.leapYearsCount(i.year-1)+this.dateTimeHelper.leapYearsCount(s.year);default:return new n.CellError(n.ErrorType.NUM,o.ErrorMessage.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 new Error("Should not be reachable.")}))}interval(e,t){return this.runFunction(e.args,t,this.metadata("INTERVAL"),(e=>{const t=(e=Math.trunc(e))%60,r=(e=Math.trunc(e/60))%60,n=(e=Math.trunc(e/60))%24,s=(e=Math.trunc(e/24))%30,o=(e=Math.trunc(e/30))%12,i=Math.trunc(e/12);return"P"+(i>0?`${i}Y`:"")+(o>0?`${o}M`:"")+(s>0?`${s}D`:"")+"T"+(n>0?`${n}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,n)=>this.networkdayscore(e,t,r,n)))}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,n)=>this.workdaycore(e,t,r,n)))}networkdayscore(e,t,r,s){let o=1;(e=Math.trunc(e))>(t=Math.trunc(t))&&([e,t]=[t,e],o=-1);const i=c(r);if(i instanceof n.CellError)return i;const a=this.simpleRangeToFilteredHolidays(i,s);return a instanceof n.CellError?a:o*this.countWorkdays(e,t,i,a)}workdaycore(e,t,r,s){e=Math.trunc(e),t=Math.trunc(t);const o=c(r);if(o instanceof n.CellError)return o;const i=this.simpleRangeToFilteredHolidays(o,s);if(i instanceof n.CellError)return i;if(t>0){let r=1;for(;this.countWorkdays(e+1,e+r,o,i)<t;)r*=2;let n=1;for(;n+1<r;){const s=Math.trunc((n+r)/2);this.countWorkdays(e+1,e+s,o,i)<t?n=s:r=s}return e+r}if(t<0){t*=-1;let r=1;for(;this.countWorkdays(e-r,e-1,o,i)<t;)r*=2;let n=1;for(;n+1<r;){const s=Math.trunc((n+r)/2);this.countWorkdays(e-s,e-1,o,i)<t?n=s:r=s}return e-r}return e}countWorkdays(e,t,r,n){const s=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(t)),o=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));let i=0;for(let e=0;e<7;e++)"0"===r.charAt(e)&&(i+=Math.floor((s+6-e)/7),i-=Math.floor((o-1+6-e)/7));return i-=h(t+1,n)-h(e,n),i}simpleRangeToFilteredHolidays(e,t){var r;const s=null!==(r=null==t?void 0:t.valuesFromTopLeftCorner())&&void 0!==r?r:[];for(const e of s)if(e instanceof n.CellError)return e;const i=[];for(const e of s)if(e!==a.EmptyValue){if(!(0,a.isExtendedNumber)(e))return new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.WrongType);i.push(Math.trunc((0,a.getRawValue)(e)))}return[...new Set(i)].sort(((e,t)=>e-t)).filter((t=>{const r=(this.dateTimeHelper.relativeNumberToAbsoluteNumber(t)-1)%7;return"0"===e.charAt(r)}))}}function h(e,t){if(0===t.length)return 0;if(e<=t[0])return 0;if(t[t.length-1]<e)return t.length;let r=0,n=t.length-1;for(;r+1<n;){const s=Math.floor((n+r)/2);t[s]>=e?n=s:r=s}return n}function c(e){var t;return"number"!=typeof e&&"string"!=typeof e?new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.WrongType):"string"==typeof e?7===e.length&&/^(0|1)*$/.test(e)&&"1111111"!==e?e:new n.CellError(n.ErrorType.NUM,o.ErrorMessage.WeekendString):null!==(t=p.get(e))&&void 0!==t?t:new n.CellError(n.ErrorType.NUM,o.ErrorMessage.BadMode)}u.implementedFunctions={DATE:{method:"date",parameters:[{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER}],returnNumberType:a.NumberType.NUMBER_DATE},TIME:{method:"time",parameters:[{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER}],returnNumberType:a.NumberType.NUMBER_TIME},MONTH:{method:"month",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},YEAR:{method:"year",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},HOUR:{method:"hour",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},MINUTE:{method:"minute",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},SECOND:{method:"second",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},TEXT:{method:"text",parameters:[{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.STRING}]},EOMONTH:{method:"eomonth",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER}],returnNumberType:a.NumberType.NUMBER_DATE},DAY:{method:"day",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},DAYS:{method:"days",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},WEEKDAY:{method:"weekday",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,defaultValue:1}]},WEEKNUM:{method:"weeknum",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,defaultValue:1}]},ISOWEEKNUM:{method:"isoweeknum",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},DATEVALUE:{method:"datevalue",parameters:[{argumentType:l.FunctionArgumentType.STRING}],returnNumberType:a.NumberType.NUMBER_DATE},TIMEVALUE:{method:"timevalue",parameters:[{argumentType:l.FunctionArgumentType.STRING}],returnNumberType:a.NumberType.NUMBER_TIME},NOW:{method:"now",parameters:[],isVolatile:!0,returnNumberType:a.NumberType.NUMBER_DATETIME},TODAY:{method:"today",parameters:[],isVolatile:!0,returnNumberType:a.NumberType.NUMBER_DATE},EDATE:{method:"edate",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER}],returnNumberType:a.NumberType.NUMBER_DATE},DAYS360:{method:"days360",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.BOOLEAN,defaultValue:!1}]},DATEDIF:{method:"datedif",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.STRING}]},YEARFRAC:{method:"yearfrac",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.INTEGER,defaultValue:0,minValue:0,maxValue:4}]},INTERVAL:{method:"interval",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},NETWORKDAYS:{method:"networkdays",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.RANGE,optionalArg:!0}]},"NETWORKDAYS.INTL":{method:"networkdaysintl",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NOERROR,defaultValue:1},{argumentType:l.FunctionArgumentType.RANGE,optionalArg:!0}]},WORKDAY:{method:"workday",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.RANGE,optionalArg:!0}]},"WORKDAY.INTL":{method:"workdayintl",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NOERROR,defaultValue:1},{argumentType:l.FunctionArgumentType.RANGE,optionalArg:!0}]}};const d=new Map([[1,0],[2,1],[11,1],[12,2],[13,3],[14,4],[15,5],[16,6],[17,0]]),p=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"]])},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DegreesPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{degrees(e,t){return this.runFunction(e.args,t,this.metadata("DEGREES"),(e=>e*(180/Math.PI)))}}s.implementedFunctions={DEGREES:{method:"degrees",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeltaPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{delta(e,t){return this.runFunction(e.args,t,this.metadata("DELTA"),((e,t)=>e===t?1:0))}}s.implementedFunctions={DELTA:{method:"delta",parameters:[{argumentType:n.FunctionArgumentType.NUMBER},{argumentType:n.FunctionArgumentType.NUMBER,defaultValue:0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ExpPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{exp(e,t){return this.runFunction(e.args,t,this.metadata("EXP"),Math.exp)}}s.implementedFunctions={EXP:{method:"exp",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FinancialPlugin:()=>a});var n=r(3),s=r(61),o=r(70),i=r(94);class a extends i.FunctionPlugin{pmt(e,t){return this.runFunction(e.args,t,this.metadata("PMT"),l)}ipmt(e,t){return this.runFunction(e.args,t,this.metadata("IPMT"),u)}ppmt(e,t){return this.runFunction(e.args,t,this.metadata("PPMT"),c)}fv(e,t){return this.runFunction(e.args,t,this.metadata("FV"),h)}cumipmt(e,t){return this.runFunction(e.args,t,this.metadata("CUMIPMT"),((e,t,r,o,i,a)=>{if(o>i)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.EndStartPeriod);let l=0;for(let n=o;n<=i;n++)l+=u(e,n,t,r,0,a);return l}))}cumprinc(e,t){return this.runFunction(e.args,t,this.metadata("CUMPRINC"),((e,t,r,o,i,a)=>{if(o>i)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.EndStartPeriod);let l=0;for(let n=o;n<=i;n++)l+=c(e,n,t,r,0,a);return l}))}db(e,t){return this.runFunction(e.args,t,this.metadata("DB"),((e,t,r,o,i)=>{if(12===i&&o>r||o>r+1)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.PeriodLong);if(t>=e)return 0;const a=Math.round(1e3*(1-Math.pow(t/e,1/r)))/1e3,l=e*a*i/12;if(1===o)return l;let u=l;for(let t=0;t<o-2;t++)u+=(e-u)*a;return o===r+1?(e-u)*a*(12-i)/12:(e-u)*a}))}ddb(e,t){return this.runFunction(e.args,t,this.metadata("DDB"),((e,t,r,s,o)=>{if(s>r)return new n.CellError(n.ErrorType.NUM);let i,a=o/r;a>=1?(a=1,i=1===s?e:0):i=e*Math.pow(1-a,s-1);const l=e*Math.pow(1-a,s);return Math.max(i-Math.max(t,l),0)}))}dollarde(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARDE"),((e,t)=>{if(t<1)return new n.CellError(n.ErrorType.DIV_BY_ZERO);for(t=Math.trunc(t);t>10;)t/=10;return Math.trunc(e)+10*(e-Math.trunc(e))/t}))}dollarfr(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARFR"),((e,t)=>{if(t<1)return new n.CellError(n.ErrorType.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)=>(t=Math.trunc(t),Math.pow(1+e/t,t)-1)))}ispmt(e,t){return this.runFunction(e.args,t,this.metadata("ISPMT"),((e,t,r,s)=>0===r?new n.CellError(n.ErrorType.DIV_BY_ZERO):s*e*(t/r-1)))}nominal(e,t){return this.runFunction(e.args,t,this.metadata("NOMINAL"),((e,t)=>(t=Math.trunc(t),(Math.pow(e+1,1/t)-1)*t)))}nper(e,t){return this.runFunction(e.args,t,this.metadata("NPER"),((e,t,r,s,o)=>0===e?0===t?new n.CellError(n.ErrorType.DIV_BY_ZERO):(-r-s)/t:(o&&(t*=1+e),Math.log((t-s*e)/(r*e+t))/Math.log(1+e))))}rate(e,t){return this.runFunction(e.args,t,this.metadata("RATE"),((e,t,r,s,o,i)=>{if(i<=-1)return new n.CellError(n.ErrorType.VALUE);const a=1e-7;let l=i;o=o?1:0;for(let i=0;i<50;i++){if(l<=-1)return new n.CellError(n.ErrorType.NUM);let i,u;if(Math.abs(l)<a)i=r*(1+e*l)+t*(1+l*o)*e+s;else{const n=Math.pow(1+l,e);i=r*n+t*(1/l+o)*(n-1)+s}if(Math.abs(i)<a)return l;if(Math.abs(l)<a)u=r*e+t*o*e;else{const n=Math.pow(1+l,e),s=e*Math.pow(1+l,e-1);u=r*s+t*(1/l+o)*s+t*(-1/(l*l))*(n-1)}l-=i/u}return new n.CellError(n.ErrorType.NUM)}))}pv(e,t){return this.runFunction(e.args,t,this.metadata("PV"),((e,t,r,s,o)=>(o=o?1:0,-1===e?0===t?new n.CellError(n.ErrorType.NUM):new n.CellError(n.ErrorType.DIV_BY_ZERO):0===e?-r*t-s:((1-Math.pow(1+e,t))*r*(1+e*o)/e-s)/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 n.CellError(n.ErrorType.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 n.CellError(n.ErrorType.DIV_BY_ZERO):(e-t)/r))}syd(e,t){return this.runFunction(e.args,t,this.metadata("SYD"),((e,t,r,s)=>s>r?new n.CellError(n.ErrorType.NUM):(e-t)*(r-s+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 n.CellError(n.ErrorType.NUM);const s=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);if(o.year>s.year+1||o.year===s.year+1&&(o.month>s.month||o.month===s.month&&o.day>s.day))return new n.CellError(n.ErrorType.NUM);const i=360-r*(t-e);return 0===i?0:i<0?new n.CellError(n.ErrorType.NUM):365*r/i}))}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 n.CellError(n.ErrorType.NUM);const s=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);if(o.year>s.year+1||o.year===s.year+1&&(o.month>s.month||o.month===s.month&&o.day>s.day))return new n.CellError(n.ErrorType.NUM);const i=360-r*(t-e);return 0===i?0:i<0?new n.CellError(n.ErrorType.NUM):100*(1-r*(t-e)/360)}))}tbillyield(e,t){return this.runFunction(e.args,t,this.metadata("TBILLYIELD"),((e,t,r)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new n.CellError(n.ErrorType.NUM);const s=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);return o.year>s.year+1||o.year===s.year+1&&(o.month>s.month||o.month===s.month&&o.day>s.day)?new n.CellError(n.ErrorType.NUM):360*(100-r)/(r*(t-e))}))}fvschedule(e,t){return this.runFunction(e.args,t,this.metadata("FVSCHEDULE"),((e,t)=>{const r=t.valuesFromTopLeftCorner();for(const e of r)if(e instanceof n.CellError)return e;for(const t of r)if((0,o.isExtendedNumber)(t))e*=1+(0,o.getRawValue)(t);else if(t!==o.EmptyValue)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NumberExpected);return e}))}npv(e,t){return this.runFunction(e.args,t,this.metadata("NPV"),((e,...t)=>{const r=this.arithmeticHelper.coerceNumbersExactRanges(t);return r instanceof n.CellError?r:d(e,r)}))}mirr(e,t){return this.runFunction(e.args,t,this.metadata("MIRR"),((e,t,r)=>{const s=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(s instanceof n.CellError)return s;let o=!1,i=!1;const a=[],l=[];for(const e of s)e>0?(o=!0,a.push(e),l.push(0)):e<0?(i=!0,l.push(e),a.push(0)):(l.push(0),a.push(0));if(!o||!i)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const u=s.length,h=d(r,a);if(h instanceof n.CellError)return h;const c=d(t,l);return c instanceof n.CellError?c:Math.pow(-h*Math.pow(1+r,u)/c/(1+t),1/(u-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)=>{const o=t.valuesFromTopLeftCorner();for(const e of o)if("number"!=typeof e)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NumberExpected);const i=o,a=r.valuesFromTopLeftCorner();for(const e of a)if("number"!=typeof e)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NumberExpected);const l=a;if(l.length!==i.length)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.EqualLength);const u=l.length;let h=0;if(l[0]<0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);for(let t=0;t<u;t++){if(l[t]=Math.floor(l[t]),l[t]<l[0])return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);h+=i[t]/Math.pow(1+e,(l[t]-l[0])/365)}return h}))}}function l(e,t,r,n,s){if(0===e)return(-r-n)/t;{const o=Math.pow(1+e,t);return(n*e+r*e*o)*(s?1/(1+e):1)/(1-o)}}function u(e,t,r,n,s,o){const i=l(e,r,n,s,o);return 1===t?e*(o?0:-n):e*(o?h(e,t-2,i,n,o)-i:h(e,t-1,i,n,o))}function h(e,t,r,n,s){if(0===e)return-n-r*t;{const o=Math.pow(1+e,t);return r*(s?1+e:1)*(1-o)/e-n*o}}function c(e,t,r,n,s,o){return l(e,r,n,s,o)-u(e,t,r,n,s,o)}function d(e,t){let r=0;for(let s=t.length-1;s>=0;s--){if(r+=t[s],-1===e){if(0===r)continue;return new n.CellError(n.ErrorType.DIV_BY_ZERO)}r/=1+e}return r}a.implementedFunctions={PMT:{method:"pmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},IPMT:{method:"ipmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},PPMT:{method:"ppmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},FV:{method:"fv",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},CUMIPMT:{method:"cumipmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0,maxValue:1}],returnNumberType:o.NumberType.NUMBER_CURRENCY},CUMPRINC:{method:"cumprinc",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0,maxValue:1}],returnNumberType:o.NumberType.NUMBER_CURRENCY},DB:{method:"db",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1,maxValue:12,defaultValue:12}],returnNumberType:o.NumberType.NUMBER_CURRENCY},DDB:{method:"ddb",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0,defaultValue:2}],returnNumberType:o.NumberType.NUMBER_CURRENCY},DOLLARDE:{method:"dollarde",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0}]},DOLLARFR:{method:"dollarfr",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0}]},EFFECT:{method:"effect",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:1}],returnNumberType:o.NumberType.NUMBER_PERCENT},ISPMT:{method:"ispmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}]},NOMINAL:{method:"nominal",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:1}],returnNumberType:o.NumberType.NUMBER_PERCENT},NPER:{method:"nper",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}]},PV:{method:"pv",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},RATE:{method:"rate",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:.1}],returnNumberType:o.NumberType.NUMBER_PERCENT},RRI:{method:"rri",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}],returnNumberType:o.NumberType.NUMBER_PERCENT},SLN:{method:"sln",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}],returnNumberType:o.NumberType.NUMBER_CURRENCY},SYD:{method:"syd",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},TBILLEQ:{method:"tbilleq",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}],returnNumberType:o.NumberType.NUMBER_PERCENT},TBILLPRICE:{method:"tbillprice",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},TBILLYIELD:{method:"tbillyield",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}],returnNumberType:o.NumberType.NUMBER_PERCENT},FVSCHEDULE:{method:"fvschedule",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.RANGE}],returnNumberType:o.NumberType.NUMBER_CURRENCY},NPV:{method:"npv",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1,returnNumberType:o.NumberType.NUMBER_CURRENCY},MIRR:{method:"mirr",parameters:[{argumentType:i.FunctionArgumentType.RANGE},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}],returnNumberType:o.NumberType.NUMBER_PERCENT},PDURATION:{method:"pduration",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}]},XNPV:{method:"xnpv",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:-1},{argumentType:i.FunctionArgumentType.RANGE},{argumentType:i.FunctionArgumentType.RANGE}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FormulaTextPlugin:()=>a});var n=r(3),s=r(61),o=r(145),i=r(94);class a extends o.FunctionPlugin{formulatext(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("FORMULATEXT"),(()=>new n.CellError(n.ErrorType.NA,s.ErrorMessage.WrongArgNumber)),(e=>{var t;return null!==(t=this.serialization.getCellFormula(e))&&void 0!==t?t:new n.CellError(n.ErrorType.NA,s.ErrorMessage.Formula)}))}}a.implementedFunctions={FORMULATEXT:{method:"formulatext",parameters:[{argumentType:i.FunctionArgumentType.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,isDependentOnSheetStructureChange:!0,vectorizationForbidden:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{HyperlinkPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{hyperlink(e,t){return this.runFunction(e.args,t,this.metadata("HYPERLINK"),((t,r)=>(e.hyperlink=t,null!=r?r:t)))}}s.implementedFunctions={HYPERLINK:{method:"hyperlink",parameters:[{argumentType:n.FunctionArgumentType.STRING},{argumentType:n.FunctionArgumentType.STRING,optionalArg:!0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{InformationPlugin:()=>h});var n=r(3),s=r(80),o=r(61),i=r(7),a=r(70),l=r(69),u=r(94);class h extends u.FunctionPlugin{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 n.CellError&&e.type!==n.ErrorType.NA))}iserror(e,t){return this.runFunction(e.args,t,this.metadata("ISERROR"),(e=>e instanceof n.CellError))}isformula(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ISFORMULA"),(()=>new n.CellError(n.ErrorType.NA,o.ErrorMessage.WrongArgNumber)),(e=>this.dependencyGraph.addressMapping.getCell(e)instanceof s.FormulaVertex))}isblank(e,t){return this.runFunction(e.args,t,this.metadata("ISBLANK"),(e=>e===a.EmptyValue))}isna(e,t){return this.runFunction(e.args,t,this.metadata("ISNA"),(e=>e instanceof n.CellError&&e.type==n.ErrorType.NA))}isnumber(e,t){return this.runFunction(e.args,t,this.metadata("ISNUMBER"),a.isExtendedNumber)}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 n.CellError&&(e.type==n.ErrorType.REF||e.type==n.ErrorType.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 n.CellError(n.ErrorType.NA,o.ErrorMessage.WrongArgNumber);if(e.args.some((e=>e.type===i.AstNodeType.EMPTY)))return new n.CellError(n.ErrorType.NUM,o.ErrorMessage.EmptyArg);let r=e.args[0];for(;r.type===i.AstNodeType.PARENTHESIS;)r=r.expression;if(r.type===i.AstNodeType.CELL_RANGE||r.type===i.AstNodeType.COLUMN_RANGE)return r.end.col-r.start.col+1;if(r.type===i.AstNodeType.CELL_REFERENCE)return 1;if(r.type===i.AstNodeType.ROW_RANGE)return this.config.maxColumns;{const e=this.evaluateAst(r,t);return e instanceof l.SimpleRangeValue?e.width():e instanceof n.CellError?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 n.CellError(n.ErrorType.NA,o.ErrorMessage.WrongArgNumber);if(e.args.some((e=>e.type===i.AstNodeType.EMPTY)))return new n.CellError(n.ErrorType.NUM,o.ErrorMessage.EmptyArg);let r=e.args[0];for(;r.type===i.AstNodeType.PARENTHESIS;)r=r.expression;if(r.type===i.AstNodeType.CELL_RANGE||r.type===i.AstNodeType.ROW_RANGE)return r.end.row-r.start.row+1;if(r.type===i.AstNodeType.CELL_REFERENCE)return 1;if(r.type===i.AstNodeType.COLUMN_RANGE)return this.config.maxRows;{const e=this.evaluateAst(r,t);return e instanceof l.SimpleRangeValue?e.height():e instanceof n.CellError?e:1}}index(e,t){return this.runFunction(e.args,t,this.metadata("INDEX"),((e,t,r)=>{var s,i,a,l,u,h;return r<1||t<1?new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.LessThanOne):r>e.width()||t>e.height()?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.ValueLarge):null!==(h=null!==(a=null===(i=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s[t-1])||void 0===i?void 0:i[r-1])&&void 0!==a?a:null===(u=null===(l=null==e?void 0:e.data)||void 0===l?void 0:l[0])||void 0===u?void 0:u[0])&&void 0!==h?h:new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.CellRangeExpected)}))}na(e,t){return new n.CellError(n.ErrorType.NA)}sheet(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEET"),(()=>t.formulaAddress.sheet+1),(e=>e.sheet+1),(e=>{const t=this.dependencyGraph.sheetMapping.get(e);return void 0!==t?t+1:new n.CellError(n.ErrorType.NA,o.ErrorMessage.SheetRef)}))}sheets(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEETS"),(()=>this.dependencyGraph.sheetMapping.numberOfSheets()),(()=>1),(()=>new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.CellRefExpected)))}}h.implementedFunctions={COLUMN:{method:"column",parameters:[{argumentType:u.FunctionArgumentType.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},COLUMNS:{method:"columns",parameters:[{argumentType:u.FunctionArgumentType.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISBINARY:{method:"isbinary",parameters:[{argumentType:u.FunctionArgumentType.STRING}]},ISERR:{method:"iserr",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISFORMULA:{method:"isformula",parameters:[{argumentType:u.FunctionArgumentType.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISNA:{method:"isna",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISREF:{method:"isref",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}],vectorizationForbidden:!0},ISERROR:{method:"iserror",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISBLANK:{method:"isblank",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISNUMBER:{method:"isnumber",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISLOGICAL:{method:"islogical",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISTEXT:{method:"istext",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISNONTEXT:{method:"isnontext",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},INDEX:{method:"index",parameters:[{argumentType:u.FunctionArgumentType.RANGE},{argumentType:u.FunctionArgumentType.NUMBER},{argumentType:u.FunctionArgumentType.NUMBER,defaultValue:1}]},NA:{method:"na",parameters:[]},ROW:{method:"row",parameters:[{argumentType:u.FunctionArgumentType.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ROWS:{method:"rows",parameters:[{argumentType:u.FunctionArgumentType.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEET:{method:"sheet",parameters:[{argumentType:u.FunctionArgumentType.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEETS:{method:"sheets",parameters:[{argumentType:u.FunctionArgumentType.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{IsEvenPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{iseven(e,t){return this.runFunction(e.args,t,this.metadata("ISEVEN"),(e=>e%2==0))}}s.implementedFunctions={ISEVEN:{method:"iseven",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{IsOddPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{isodd(e,t){return this.runFunction(e.args,t,this.metadata("ISODD"),(e=>e%2==1))}}s.implementedFunctions={ISODD:{method:"isodd",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LogarithmPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{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)}}s.implementedFunctions={LOG10:{method:"log10",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]},LOG:{method:"log",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:n.FunctionArgumentType.NUMBER,defaultValue:10,greaterThan:0}]},LN:{method:"ln",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{MathConstantsPlugin:()=>o,PI:()=>s});var n=r(94);const s=parseFloat(Math.PI.toFixed(14));class o extends n.FunctionPlugin{pi(e,t){return this.runFunction(e.args,t,this.metadata("PI"),(()=>s))}sqrtpi(e,t){return this.runFunction(e.args,t,this.metadata("SQRTPI"),(e=>Math.sqrt(s*e)))}}o.implementedFunctions={PI:{method:"pi",parameters:[]},SQRTPI:{method:"sqrtpi",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,minValue:0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{MatrixPlugin:()=>d});var n=r(1),s=r(3),o=r(61),i=r(7),a=r(93),l=r(69),u=r(94);function h(e,t){return new n.ArraySize(t.width,e.height)}function c(e,t,r){return new n.ArraySize(1+(e.width-t)/r,1+(e.height-t)/r)}class d extends u.FunctionPlugin{mmult(e,t){return this.runFunction(e.args,t,this.metadata("MMULT"),((e,t)=>{if(!e.hasOnlyNumbers()||!t.hasOnlyNumbers())return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.NumberRange);if(t.height()!==e.width())return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.ArrayDimensions);const r=h(e.size,t.size),n=this.createKernel((function(e,t,r){let n=0;for(let s=0;s<r;++s)n+=e[this.thread.y][s]*t[s][this.thread.x];return n}),r)(e.rawNumbers(),t.rawNumbers(),e.width());return l.SimpleRangeValue.onlyNumbers(n)}))}mmultArraySize(e,t){if(2!==e.args.length)return n.ArraySize.error();const r=this.metadata("MMULT"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new a.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))})),[o,i]=s;return h(o,i)}maxpool(e,t){return this.runFunction(e.args,t,this.metadata("MAXPOOL"),((e,t,r=t)=>{if(!e.hasOnlyNumbers())return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.NumberRange);const n=c(e.size,t,r),i=this.createKernel((function(e,t,r){const n=this.thread.x*r,s=this.thread.y*r;let o=e[s][n];for(let r=0;r<t;r++)for(let i=0;i<t;i++)o=Math.max(o,e[s+r][n+i]);return o}),n)(e.rawNumbers(),t,r);return l.SimpleRangeValue.onlyNumbers(i)}))}medianpool(e,t){return this.runFunction(e.args,t,this.metadata("MEDIANPOOL"),((e,t,r=t)=>{if(!e.hasOnlyNumbers())return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.NumberRange);const n=c(e.size,t,r),i=this.createKernel((function(e,t,r){const n=this.thread.x*r,s=this.thread.y*r;let o=e[s][n];for(let r=0;r<t;r++)for(let i=0;i<t;i++)o=Math.max(o,e[s+r][n+i]);let i=e[s][n];for(let r=0;r<t;r++)for(let o=0;o<t;o++)i=Math.min(i,e[s+r][n+o]);const a=t*t;let l=i,u=o,h=42;for(let r=0;r<32;r++){const r=(l+u)/2;let o=0;for(let i=0;i<t;i++)for(let a=0;a<t;a++)e[s+i][n+a]>r&&o++;if(t%2==0){if(o===a/2){h=r;break}o>a/2?l=r:u=r}else{if(o===(a-1)/2){h=r;break}o>(a-1)/2?l=r:u=r}}return h}),n)(e.rawNumbers(),t,r);return l.SimpleRangeValue.onlyNumbers(i)}))}maxpoolArraySize(e,t){if(e.args.length<2||e.args.length>3)return n.ArraySize.error();const r=this.metadata("MAXPOOL"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new a.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))}))[0],o=e.args[1];let l;l=o.type===i.AstNodeType.NUMBER?o.value:1;let u=l;if(3===e.args.length){const t=e.args[2];u=t.type===i.AstNodeType.NUMBER?t.value:1}return l>s.width||l>s.height||u>l||(s.width-l)%u!=0||(s.height-l)%u!=0?n.ArraySize.error():c(s,l,u)}medianpoolArraySize(e,t){return this.maxpoolArraySize(e,t)}transpose(e,t){return this.runFunction(e.args,t,this.metadata("TRANSPOSE"),(e=>{const t=e.rawData(),r=e.size,n=[];for(let e=0;e<r.width;++e){n[e]=[];for(let s=0;s<r.height;++s)n[e][s]=t[s][e]}return l.SimpleRangeValue.onlyValues(n)}))}transposeArraySize(e,t){if(1!==e.args.length)return n.ArraySize.error();const r=this.metadata("MMULT"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new a.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))})),[o]=s;return new n.ArraySize(o.height,o.width)}createKernel(e,t){return function(...r){const n=[];for(let s=0;s<t.height;++s){n.push([]);for(let o=0;o<t.width;++o)n[s][o]=e.apply({thread:{x:o,y:s}},r)}return n}}}d.implementedFunctions={MMULT:{method:"mmult",arraySizeMethod:"mmultArraySize",parameters:[{argumentType:u.FunctionArgumentType.RANGE},{argumentType:u.FunctionArgumentType.RANGE}],vectorizationForbidden:!0},TRANSPOSE:{method:"transpose",arraySizeMethod:"transposeArraySize",parameters:[{argumentType:u.FunctionArgumentType.RANGE}],vectorizationForbidden:!0},MAXPOOL:{method:"maxpool",arraySizeMethod:"maxpoolArraySize",parameters:[{argumentType:u.FunctionArgumentType.RANGE},{argumentType:u.FunctionArgumentType.NUMBER},{argumentType:u.FunctionArgumentType.NUMBER,optionalArg:!0}],vectorizationForbidden:!0},MEDIANPOOL:{method:"medianpool",arraySizeMethod:"medianpoolArraySize",parameters:[{argumentType:u.FunctionArgumentType.RANGE},{argumentType:u.FunctionArgumentType.NUMBER},{argumentType:u.FunctionArgumentType.NUMBER,optionalArg:!0}],vectorizationForbidden:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{MedianPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{median(e,t){return this.runFunction(e.args,t,this.metadata("MEDIAN"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof n.CellError?t:0===t.length?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.OneValue):(t.sort(((e,t)=>e-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)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return r instanceof n.CellError?r:(r.sort(((e,t)=>e-t)),(t=Math.trunc(t))>r.length?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):r[r.length-t])}))}small(e,t){return this.runFunction(e.args,t,this.metadata("SMALL"),((e,t)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return r instanceof n.CellError?r:(r.sort(((e,t)=>e-t)),(t=Math.trunc(t))>r.length?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):r[t-1])}))}}i.implementedFunctions={MEDIAN:{method:"median",parameters:[{argumentType:o.FunctionArgumentType.ANY}],repeatLastArgs:1},LARGE:{method:"large",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.NUMBER,minValue:1}]},SMALL:{method:"small",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.NUMBER,minValue:1}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ModuloPlugin:()=>o});var n=r(3),s=r(94);class o extends s.FunctionPlugin{mod(e,t){return this.runFunction(e.args,t,this.metadata("MOD"),((e,t)=>0===t?new n.CellError(n.ErrorType.DIV_BY_ZERO):e%t))}}o.implementedFunctions={MOD:{method:"mod",parameters:[{argumentType:s.FunctionArgumentType.NUMBER},{argumentType:s.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{NumericAggregationPlugin:()=>g});var n=r(2),s=r(3),o=r(61),i=r(77),a=r(7),l=r(95),u=r(70),h=r(69),c=r(94);function d(e){return(0,u.isExtendedNumber)(e)&&!Number.isFinite((0,u.getRawValue)(e))?0:e}class p{constructor(e,t,r){this.sumsq=e,this.sum=t,this.count=r}static single(e){return new p(e*e,e,1)}compose(e){return new p(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}}p.empty=new p(0,0,0);class g extends c.FunctionPlugin{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,u.getRawValue)(e),2)),m)}max(e,t){return this.doMax(e.args,t)}maxa(e,t){return d(this.reduce(e.args,t,Number.NEGATIVE_INFINITY,"MAXA",((e,t)=>Math.max(e,t)),u.getRawValue,f))}min(e,t){return this.doMin(e.args,t)}mina(e,t){return d(this.reduce(e.args,t,Number.POSITIVE_INFINITY,"MINA",((e,t)=>Math.min(e,t)),u.getRawValue,f))}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;const n=this.reduce(e.args,t,p.empty,"_AGGREGATE_A",((e,t)=>e.compose(t)),(e=>p.single((0,u.getRawValue)(e))),f);return n instanceof s.CellError?n:null!==(r=n.averageValue())&&void 0!==r?r:new s.CellError(s.ErrorType.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;const n=this.reduceAggregateA(e.args,t);return n instanceof s.CellError?n:null!==(r=n.varSValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}varpa(e,t){var r;const n=this.reduceAggregateA(e.args,t);return n instanceof s.CellError?n:null!==(r=n.varPValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}stdevs(e,t){return this.doStdevS(e.args,t)}stdevp(e,t){return this.doStdevP(e.args,t)}stdeva(e,t){const r=this.reduceAggregateA(e.args,t);if(r instanceof s.CellError)return r;{const e=r.varSValue();return void 0===e?new s.CellError(s.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}stdevpa(e,t){const r=this.reduceAggregateA(e.args,t);if(r instanceof s.CellError)return r;{const e=r.varPValue();return void 0===e?new s.CellError(s.ErrorType.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 s.CellError(s.ErrorType.NA,o.ErrorMessage.WrongArgNumber);const r=this.coerceToType(this.evaluateAst(e.args[0],t),{argumentType:c.FunctionArgumentType.NUMBER},t),n=e.args.slice(1);switch(r){case 1:case 101:return this.doAverage(n,t);case 2:case 102:return this.doCount(n,t);case 3:case 103:return this.doCounta(n,t);case 4:case 104:return this.doMax(n,t);case 5:case 105:return this.doMin(n,t);case 6:case 106:return this.doProduct(n,t);case 7:case 107:return this.doStdevS(n,t);case 8:case 108:return this.doStdevP(n,t);case 9:case 109:return this.doSum(n,t);case 10:case 110:return this.doVarS(n,t);case 11:case 111:return this.doVarP(n,t);default:return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.BadMode)}}reduceAggregate(e,t){return this.reduce(e,t,p.empty,"_AGGREGATE",((e,t)=>e.compose(t)),(e=>p.single((0,u.getRawValue)(e))),m)}reduceAggregateA(e,t){return this.reduce(e,t,p.empty,"_AGGREGATE_A",((e,t)=>e.compose(t)),(e=>p.single((0,u.getRawValue)(e))),f)}doAverage(e,t){var r;const n=this.reduceAggregate(e,t);return n instanceof s.CellError?n:null!==(r=n.averageValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}doVarS(e,t){var r;const n=this.reduceAggregate(e,t);return n instanceof s.CellError?n:null!==(r=n.varSValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}doVarP(e,t){var r;const n=this.reduceAggregate(e,t);return n instanceof s.CellError?n:null!==(r=n.varPValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}doStdevS(e,t){const r=this.reduceAggregate(e,t);if(r instanceof s.CellError)return r;{const e=r.varSValue();return void 0===e?new s.CellError(s.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}doStdevP(e,t){const r=this.reduceAggregate(e,t);if(r instanceof s.CellError)return r;{const e=r.varPValue();return void 0===e?new s.CellError(s.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}doCount(e,t){return this.reduce(e,t,0,"COUNT",((e,t)=>e+t),u.getRawValue,(e=>(0,u.isExtendedNumber)(e)?1:0))}doCounta(e,t){return this.reduce(e,t,0,"COUNTA",((e,t)=>e+t),u.getRawValue,(e=>e===u.EmptyValue?0:1))}doMax(e,t){return d(this.reduce(e,t,Number.NEGATIVE_INFINITY,"MAX",((e,t)=>Math.max(e,t)),u.getRawValue,m))}doMin(e,t){return d(this.reduce(e,t,Number.POSITIVE_INFINITY,"MIN",((e,t)=>Math.min(e,t)),u.getRawValue,m))}doSum(e,t){return this.reduce(e,t,0,"SUM",this.addWithEpsilonRaw,u.getRawValue,m)}doProduct(e,t){return this.reduce(e,t,1,"PRODUCT",((e,t)=>e*t),u.getRawValue,m)}reduce(e,t,r,n,i,l,u){return e.length<1?new s.CellError(s.ErrorType.NA,o.ErrorMessage.WrongArgNumber):e.reduce(((e,o)=>{if(e instanceof s.CellError)return e;if(o.type===a.AstNodeType.CELL_RANGE||o.type===a.AstNodeType.COLUMN_RANGE||o.type===a.AstNodeType.ROW_RANGE){const a=this.evaluateRange(o,t,r,n,i,l,u);return a instanceof s.CellError?a:i(a,e)}let c;if(c=this.evaluateAst(o,t),c instanceof h.SimpleRangeValue){const t=Array.from(c.valuesFromTopLeftCorner()).map(u).filter((e=>void 0!==e));return t.map((e=>e instanceof s.CellError?e:l(e))).reduce(((e,t)=>e instanceof s.CellError?e:t instanceof s.CellError?t:i(e,t)),e)}if(o.type===a.AstNodeType.CELL_REFERENCE){if(c=u(c),void 0===c)return e}else if(c=this.coerceScalarToNumberOrError(c),c=u(c),void 0===c)return e;return c instanceof s.CellError?c:i(e,l(c))}),r)}evaluateRange(e,t,r,a,l,u,h){let c;try{c=n.AbsoluteCellRange.fromAst(e,t.formulaAddress)}catch(e){if(e instanceof i.SheetsNotEqual)return new s.CellError(s.ErrorType.REF,o.ErrorMessage.RangeManySheets);throw e}const d=this.dependencyGraph.getRange(c.start,c.end);if(void 0===d)throw new Error("Range does not exists in graph");let p=d.getFunctionValue(a);if(void 0===p){p=this.getRangeValues(a,c,d,u,h).reduce(((e,t)=>e instanceof s.CellError?e:t instanceof s.CellError?t:l(e,t)),r),d.setFunctionValue(a,p)}return p}getRangeValues(e,t,r,n,o){const i=[],{smallerRangeVertex:a,restRange:l}=this.dependencyGraph.rangeMapping.findSmallerRange(t);let u;if(void 0!==a&&this.dependencyGraph.existsEdge(a,r)){const t=a.getFunctionValue(e);if(void 0!==t)i.push(t);else for(const e of a.range.addresses(this.dependencyGraph)){const t=o(this.dependencyGraph.getScalarValue(e));t instanceof s.CellError?i.push(t):void 0!==t&&i.push(n(t))}u=l}else u=t;for(const e of u.addresses(this.dependencyGraph)){const t=o(this.dependencyGraph.getScalarValue(e));t instanceof s.CellError?i.push(t):void 0!==t&&i.push(n(t))}return i}}function m(e){return(0,u.isExtendedNumber)(e)||e instanceof s.CellError?e:void 0}function f(e){return"boolean"==typeof e?(0,l.coerceBooleanToNumber)(e):(0,u.isExtendedNumber)(e)||e instanceof s.CellError?e:"string"==typeof e?0:void 0}g.implementedFunctions={SUM:{method:"sum",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},SUMSQ:{method:"sumsq",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},MAX:{method:"max",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},MIN:{method:"min",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},MAXA:{method:"maxa",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},MINA:{method:"mina",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},COUNT:{method:"count",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},COUNTA:{method:"counta",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},AVERAGE:{method:"average",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},AVERAGEA:{method:"averagea",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},PRODUCT:{method:"product",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},"VAR.S":{method:"vars",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},"VAR.P":{method:"varp",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},VARA:{method:"vara",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},VARPA:{method:"varpa",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},"STDEV.S":{method:"stdevs",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},"STDEV.P":{method:"stdevp",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},STDEVA:{method:"stdeva",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},STDEVPA:{method:"stdevpa",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},SUBTOTAL:{method:"subtotal",parameters:[{argumentType:c.FunctionArgumentType.NUMBER},{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1}},g.aliases={VAR:"VAR.S",VARP:"VAR.P",STDEV:"STDEV.S",STDEVP:"STDEV.P",VARS:"VAR.S",STDEVS:"STDEV.S"}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{PowerPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{power(e,t){return this.runFunction(e.args,t,this.metadata("POWER"),Math.pow)}}s.implementedFunctions={POWER:{method:"power",parameters:[{argumentType:n.FunctionArgumentType.NUMBER},{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RadiansPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{radians(e,t){return this.runFunction(e.args,t,this.metadata("RADIANS"),(e=>e*(Math.PI/180)))}}s.implementedFunctions={RADIANS:{method:"radians",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RadixConversionPlugin:()=>l});var n=r(3),s=r(61),o=r(104),i=r(94);const a=10;class l extends i.FunctionPlugin{dec2bin(e,t){return this.runFunction(e.args,t,this.metadata("DEC2BIN"),((e,t)=>h(e,2,t)))}dec2oct(e,t){return this.runFunction(e.args,t,this.metadata("DEC2OCT"),((e,t)=>h(e,8,t)))}dec2hex(e,t){return this.runFunction(e.args,t,this.metadata("DEC2HEX"),((e,t)=>h(e,16,t)))}bin2dec(e,t){return this.runFunction(e.args,t,this.metadata("BIN2DEC"),(e=>{const t=u(e,2,a);return void 0===t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotBinary):g(t,2)}))}bin2oct(e,t){return this.runFunction(e.args,t,this.metadata("BIN2OCT"),((e,t)=>{const r=u(e,2,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotBinary):h(g(r,2),8,t)}))}bin2hex(e,t){return this.runFunction(e.args,t,this.metadata("BIN2HEX"),((e,t)=>{const r=u(e,2,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotBinary):h(g(r,2),16,t)}))}oct2dec(e,t){return this.runFunction(e.args,t,this.metadata("OCT2DEC"),(e=>{const t=u(e,8,a);return void 0===t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotOctal):g(t,8)}))}oct2bin(e,t){return this.runFunction(e.args,t,this.metadata("OCT2BIN"),((e,t)=>{const r=u(e,8,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotOctal):h(g(r,8),2,t)}))}oct2hex(e,t){return this.runFunction(e.args,t,this.metadata("OCT2HEX"),((e,t)=>{const r=u(e,8,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotOctal):h(g(r,8),16,t)}))}hex2dec(e,t){return this.runFunction(e.args,t,this.metadata("HEX2DEC"),(e=>{const t=u(e,16,a);return void 0===t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotHex):g(t,16)}))}hex2bin(e,t){return this.runFunction(e.args,t,this.metadata("HEX2BIN"),((e,t)=>{const r=u(e,16,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotHex):h(g(r,16),2,t)}))}hex2oct(e,t){return this.runFunction(e.args,t,this.metadata("HEX2OCT"),((e,t)=>{const r=u(e,16,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotHex):h(g(r,16),8,t)}))}base(e,t){return this.runFunction(e.args,t,this.metadata("BASE"),d)}decimal(e,t){return this.runFunction(e.args,t,this.metadata("DECIMAL"),((e,t)=>{const r=u(e,t,255);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotHex):parseInt(r,t)}))}}function u(e,t,r){const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".substr(0,t),s=new RegExp(`^[${n}]+$`);if(!(e.length>r)&&s.test(e))return e}function h(e,t,r){if(e>function(e){return-c(e)-1}(t))return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueBaseLarge);if(e<c(t))return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueBaseSmall);const i=p(e,t);return void 0===r||e<0?i:i.length>r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueBaseLong):(0,o.padLeft)(i,r)}function c(e){return-Math.pow(e,a)/2}function d(e,t,r){const n=p(e,t);return void 0!==r&&r>n.length?(0,o.padLeft)(n,r):n}function p(e,t){return(e+(e<0?Math.pow(t,a):0)).toString(t).toUpperCase()}function g(e,t){const r=parseInt(e,t),n=Math.pow(t,a);return r>=n/2?r-n:r}l.implementedFunctions={DEC2BIN:{method:"dec2bin",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2OCT:{method:"dec2oct",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2HEX:{method:"dec2hex",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},BIN2DEC:{method:"bin2dec",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},BIN2OCT:{method:"bin2oct",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},BIN2HEX:{method:"bin2hex",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},OCT2DEC:{method:"oct2dec",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},OCT2BIN:{method:"oct2bin",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},OCT2HEX:{method:"oct2hex",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},HEX2DEC:{method:"hex2dec",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},HEX2BIN:{method:"hex2bin",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},HEX2OCT:{method:"hex2oct",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},DECIMAL:{method:"decimal",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,minValue:2,maxValue:36}]},BASE:{method:"base",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:2,maxValue:36},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:255}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RandomPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{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 n.CellError(n.ErrorType.NUM,s.ErrorMessage.WrongOrder):((e=Math.ceil(e))===(t=Math.floor(t)+1)&&(t+=1),e+Math.floor(Math.random()*(t-e)))))}}i.implementedFunctions={RAND:{method:"rand",parameters:[],isVolatile:!0},RANDBETWEEN:{method:"randbetween",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}],isVolatile:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RoundingPlugin:()=>l,findNextEvenNumber:()=>a,findNextOddNumber:()=>i});var n=r(3),s=r(61),o=r(94);function i(e){const t=Math.ceil(e);return t%2==1?t:t+1}function a(e){const t=Math.ceil(e);return t%2==0?t:t+1}class l extends o.FunctionPlugin{roundup(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),((e,t)=>{const 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)=>{const 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)=>{const 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?-a(-e):a(e)))}odd(e,t){return this.runFunction(e.args,t,this.metadata("ODD"),(e=>e<0?-i(-e):i(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"),((e,t)=>0===e?0:0===t?new n.CellError(n.ErrorType.DIV_BY_ZERO):e>0&&t<0?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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:(t=Math.abs(t),Math.ceil(e/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 n.CellError(n.ErrorType.DIV_BY_ZERO):e>0&&t<0?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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:(t=Math.abs(t),Math.floor(e/t)*t)))}}l.implementedFunctions={ROUNDUP:{method:"roundup",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},ROUNDDOWN:{method:"rounddown",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},ROUND:{method:"round",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},INT:{method:"intFunc",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},EVEN:{method:"even",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ODD:{method:"odd",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},"CEILING.MATH":{method:"ceilingmath",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},CEILING:{method:"ceiling",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},"CEILING.PRECISE":{method:"ceilingprecise",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},"FLOOR.MATH":{method:"floormath",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},FLOOR:{method:"floor",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},"FLOOR.PRECISE":{method:"floorprecise",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]}},l.aliases={"ISO.CEILING":"CEILING.PRECISE",TRUNC:"ROUNDDOWN"}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SqrtPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{sqrt(e,t){return this.runFunction(e.args,t,this.metadata("SQRT"),Math.sqrt)}}s.implementedFunctions={SQRT:{method:"sqrt",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ConditionalAggregationPlugin:()=>c});var n=r(3),s=r(61),o=r(180),i=r(70),a=r(94);class l{constructor(e,t){this.sum=e,this.count=t}static single(e){return new l(e,1)}compose(e){return new l(this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}}function u(e){return(0,i.isExtendedNumber)(e)&&!Number.isFinite((0,i.getRawValue)(e))?0:e}function h(e){return e instanceof n.CellError?e:(0,i.isExtendedNumber)(e)?(0,i.getRawValue)(e):void 0}l.empty=new l(0,0);class c extends a.FunctionPlugin{sumif(e,t){const r="SUMIF";return this.runFunction(e.args,t,this.metadata(r),((e,t,n)=>this.computeConditionalAggregationFunction(null!=n?n:e,[e,t],r,0,((e,t)=>this.arithmeticHelper.nonstrictadd(e,t)),h)))}sumifs(e,t){const 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)),h)))}averageif(e,t){const r="AVERAGEIF";return this.runFunction(e.args,t,this.metadata(r),((e,t,s)=>{const o=this.computeConditionalAggregationFunction(null!=s?s:e,[e,t],r,l.empty,((e,t)=>e.compose(t)),(e=>(0,i.isExtendedNumber)(e)?l.single((0,i.getRawValue)(e)):l.empty));return o instanceof n.CellError?o:o.averageValue()||new n.CellError(n.ErrorType.DIV_BY_ZERO)}))}countif(e,t){const 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){const 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){const r="MINIFS",n=(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)=>u(this.computeConditionalAggregationFunction(e,t,r,Number.POSITIVE_INFINITY,n,h))))}maxifs(e,t){const r="MAXIFS",n=(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)=>u(this.computeConditionalAggregationFunction(e,t,r,Number.NEGATIVE_INFINITY,n,h))))}computeConditionalAggregationFunction(e,t,r,i,a,l){const u=[];for(let e=0;e<t.length;e+=2){const r=t[e],i=this.interpreter.criterionBuilder.fromCellValue(t[e+1],this.arithmeticHelper);if(void 0===i)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.BadCriterion);u.push(new o.Condition(r,i))}return new o.CriterionFunctionCompute(this.interpreter,function(e){return t=>{const r=t.map((e=>`${e.conditionRange.range.sheet},${e.conditionRange.range.start.col},${e.conditionRange.range.start.row}`));return[e,...r].join(",")}}(r),i,a,l).compute(e,u)}}c.implementedFunctions={SUMIF:{method:"sumif",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR},{argumentType:a.FunctionArgumentType.RANGE,optionalArg:!0}]},COUNTIF:{method:"countif",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}]},AVERAGEIF:{method:"averageif",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR},{argumentType:a.FunctionArgumentType.RANGE,optionalArg:!0}]},SUMIFS:{method:"sumifs",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}],repeatLastArgs:2},COUNTIFS:{method:"countifs",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}],repeatLastArgs:2},MINIFS:{method:"minifs",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}],repeatLastArgs:2},MAXIFS:{method:"maxifs",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}],repeatLastArgs:2}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Condition:()=>l,CriterionFunctionCompute:()=>a});var n=r(3),s=r(61),o=r(181),i=r(70);class a{constructor(e,t,r,n,s){this.interpreter=e,this.cacheKey=t,this.reduceInitialValue=r,this.composeFunction=n,this.mapFunction=s,this.dependencyGraph=this.interpreter.dependencyGraph}compute(e,t){for(const r of t)if(!r.conditionRange.sameDimensionsAs(e))return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.EqualLength);const r=this.tryToGetRangeVertexForRangeValue(e),o=t.map((e=>this.tryToGetRangeVertexForRangeValue(e.conditionRange)));if(r&&o.every((e=>void 0!==e))){const n=t.map((e=>e.criterionPackage.raw)).join(","),s=this.findAlreadyComputedValueInCache(r,this.cacheKey(t),n);if(void 0!==s)return this.interpreter.stats.incrementCriterionFunctionFullCacheUsed(),s;const i=this.buildNewCriterionCache(this.cacheKey(t),t.map((e=>e.conditionRange.range)),e.range);return i.has(n)||i.set(n,[this.evaluateRangeValue(e,t),t.map((e=>e.criterionPackage.lambda))]),r.setCriterionFunctionValues(this.cacheKey(t),i),o.forEach((e=>{void 0!==e&&e.addDependentCacheRange(r)})),i.get(n)[0]}return this.evaluateRangeValue(e,t)}tryToGetRangeVertexForRangeValue(e){const t=e.range;return void 0===t?void 0:this.dependencyGraph.getRange(t.start,t.end)}reduceFunction(e){let t=this.reduceInitialValue;for(const r of e)t=this.composeFunction(t,r);return t}findAlreadyComputedValueInCache(e,t,r){return e.getCriterionFunctionValue(t,r)}evaluateRangeValue(e,t){const r=t.map((e=>e.criterionPackage.lambda)),n=Array.from(e.valuesFromTopLeftCorner()).map(this.mapFunction)[Symbol.iterator](),s=h(r,t.map((e=>e.conditionRange.iterateValuesFromTopLeftCorner())),n);return this.reduceFunction(s)}buildNewCriterionCache(e,t,r){const s=this.dependencyGraph.getRange(r.start,r.end),{smallerRangeVertex:o,restConditionRanges:i,restValuesRange:a}=((e,t,r)=>{if(r.end.row>r.start.row){const s=(0,n.simpleCellAddress)(r.end.sheet,r.end.col,r.end.row-1),o=e.getRange(r.start,s);if(void 0!==o)return{smallerRangeVertex:o,restValuesRange:r.withStart((0,n.simpleCellAddress)(r.start.sheet,r.start.col,r.end.row)),restConditionRanges:t.map((e=>e.withStart((0,n.simpleCellAddress)(e.start.sheet,e.start.col,e.end.row))))}}return{restValuesRange:r,restConditionRanges:t}})(this.dependencyGraph,t,r);let l;l=void 0!==o&&this.dependencyGraph.existsEdge(o,s)?o.getCriterionFunctionValues(e):new Map;const c=new Map;return l.forEach((([e,t],r)=>{const n=h(t,i.map((e=>u(this.dependencyGraph,e))),Array.from(u(this.dependencyGraph,a)).map(this.mapFunction)[Symbol.iterator]()),s=this.composeFunction(e,this.reduceFunction(n));this.interpreter.stats.incrementCriterionFunctionPartialCacheUsed(),c.set(r,[s,t])})),c}}class l{constructor(e,t){this.conditionRange=e,this.criterionPackage=t}}function*u(e,t){for(const r of t.addresses(e))yield(0,i.getRawValue)(e.getScalarValue(r))}function*h(e,t,r){for(const n of r){const r=t.map((e=>(0,o.split)(e)));if(!r.every((e=>Object.prototype.hasOwnProperty.call(e,"value"))))return;c(r.map((e=>(0,i.getRawValue)(e.value))),e).every((([e,t])=>t(e)))&&(yield n),t=r.map((e=>e.rest))}}function c(e,t){const r=[];for(let n=0;n<Math.min(e.length,t.length);n++)r.push([e[n],t[n]]);return r}},(e,t,r)=>{"use strict";function*n(){}function s(e){const t=e[Symbol.iterator](),{done:r,value:s}=t.next();return r?{rest:n()}:{value:s,rest:t}}function o(e){const t=e[Symbol.iterator](),{done:r,value:n}=t.next();if(!r)return n}r.r(t),r.d(t,{empty:()=>n,first:()=>o,split:()=>s})},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SumprodPlugin:()=>a});var n=r(3),s=r(61),o=r(70),i=r(94);class a extends i.FunctionPlugin{sumproduct(e,t){return this.runFunction(e.args,t,this.metadata("SUMPRODUCT"),((...e)=>{const t=e[0].width(),r=e[0].height();for(const o of e)if(o.width()!==t||o.height()!==r)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.EqualLength);let i=0;const a=e.map((e=>e.iterateValuesFromTopLeftCorner()));for(let e=0;e<t*r;e++){let e=1;for(const t of a){const r=t.next().value;if(r instanceof n.CellError)return r;const s=this.coerceScalarToNumberOrError(r);(0,o.isExtendedNumber)(s)?e*=(0,o.getRawValue)(s):e=0}i+=e}return i}))}}a.implementedFunctions={SUMPRODUCT:{method:"sumproduct",parameters:[{argumentType:i.FunctionArgumentType.RANGE}],repeatLastArgs:1}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TextPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{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)=>{const r=e.split(" ");return t>=r.length||t<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.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," ")))}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 n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeCount):e.repeat(t)))}right(e,t){return this.runFunction(e.args,t,this.metadata("RIGHT"),((e,t)=>t<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeLength):0===t?"":e.slice(-t)))}left(e,t){return this.runFunction(e.args,t,this.metadata("LEFT"),((e,t)=>t<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeLength):e.slice(0,t)))}mid(e,t){return this.runFunction(e.args,t,this.metadata("MID"),((e,t,r)=>t<1?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.LessThanOne):r<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeLength):e.substring(t-1,t+r-1)))}replace(e,t){return this.runFunction(e.args,t,this.metadata("REPLACE"),((e,t,r,o)=>t<1?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.LessThanOne):r<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeLength):e.substring(0,t-1)+o+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 n.CellError(n.ErrorType.VALUE,s.ErrorMessage.LengthBounds);const o=e.toLowerCase(),i=t.substring(r-1).toLowerCase(),a=this.arithmeticHelper.requiresRegex(o)?this.arithmeticHelper.searchString(o,i):i.indexOf(o);return a>-1?a+r:new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.PatternNotFound)}))}substitute(e,t){return this.runFunction(e.args,t,this.metadata("SUBSTITUTE"),((e,t,r,o)=>{const i=new RegExp(t,"g");if(void 0===o)return e.replace(i,r);if(o<1)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.LessThanOne);let a,l=0;for(;null!==(a=i.exec(e));)if(o===++l)return e.substring(0,a.index)+r+e.substring(i.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 n.CellError(n.ErrorType.VALUE,s.ErrorMessage.IndexBounds);const o=t.substring(r-1).indexOf(e)+r;return o>0?o:new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.PatternNotFound)}))}t(e,t){return this.runFunction(e.args,t,this.metadata("T"),(e=>e instanceof n.CellError||"string"==typeof e?e:""))}upper(e,t){return this.runFunction(e.args,t,this.metadata("UPPER"),(e=>e.toUpperCase()))}}i.implementedFunctions={CONCATENATE:{method:"concatenate",parameters:[{argumentType:o.FunctionArgumentType.STRING}],repeatLastArgs:1,expandRanges:!0},EXACT:{method:"exact",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING}]},SPLIT:{method:"split",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER}]},LEN:{method:"len",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},LOWER:{method:"lower",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},MID:{method:"mid",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},TRIM:{method:"trim",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},T:{method:"t",parameters:[{argumentType:o.FunctionArgumentType.SCALAR}]},PROPER:{method:"proper",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},CLEAN:{method:"clean",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},REPT:{method:"rept",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER}]},RIGHT:{method:"right",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},LEFT:{method:"left",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},REPLACE:{method:"replace",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.STRING}]},SEARCH:{method:"search",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},SUBSTITUTE:{method:"substitute",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,optionalArg:!0}]},FIND:{method:"find",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},UPPER:{method:"upper",parameters:[{argumentType:o.FunctionArgumentType.STRING}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TrigonometryPlugin:()=>a});var n=r(3),s=r(61),o=r(94),i=r(168);class a extends o.FunctionPlugin{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 n.CellError(n.ErrorType.DIV_BY_ZERO):Math.atan2(t,e)))}cot(e,t){return this.runFunction(e.args,t,this.metadata("COT"),(e=>0===e?new n.CellError(n.ErrorType.DIV_BY_ZERO):1/Math.tan(e)))}acot(e,t){return this.runFunction(e.args,t,this.metadata("ACOT"),(e=>0===e?i.PI/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 n.CellError(n.ErrorType.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 n.CellError(n.ErrorType.DIV_BY_ZERO):1/Math.tanh(e)))}acoth(e,t){return this.runFunction(e.args,t,this.metadata("ACOTH"),(e=>0===e?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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 n.CellError(n.ErrorType.DIV_BY_ZERO):1/Math.sinh(e)))}}a.implementedFunctions={ACOS:{method:"acos",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ASIN:{method:"asin",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},COS:{method:"cos",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SIN:{method:"sin",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},TAN:{method:"tan",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ATAN:{method:"atan",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ATAN2:{method:"atan2",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},COT:{method:"cot",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SEC:{method:"sec",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},CSC:{method:"csc",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SINH:{method:"sinh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},COSH:{method:"cosh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},TANH:{method:"tanh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},COTH:{method:"coth",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SECH:{method:"sech",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},CSCH:{method:"csch",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ACOT:{method:"acot",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ASINH:{method:"asinh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ACOSH:{method:"acosh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ATANH:{method:"atanh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ACOTH:{method:"acoth",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LookupPlugin:()=>c});var n=r(2),s=r(3),o=r(61),i=r(186),a=r(72),l=r(95),u=r(69),h=r(94);class c extends h.FunctionPlugin{constructor(){super(...arguments),this.rowSearch=new i.RowSearchStrategy(this.dependencyGraph)}vlookup(e,t){return this.runFunction(e.args,t,this.metadata("VLOOKUP"),((e,t,r,n)=>{const i=t.range;return void 0===i?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.WrongType):r<1?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.LessThanOne):r>i.width()?new s.CellError(s.ErrorType.REF,o.ErrorMessage.IndexLarge):this.doVlookup((0,l.zeroIfEmpty)(e),t,r-1,n)}))}hlookup(e,t){return this.runFunction(e.args,t,this.metadata("HLOOKUP"),((e,t,r,n)=>{const i=t.range;return void 0===i?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.WrongType):r<1?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.LessThanOne):r>i.height()?new s.CellError(s.ErrorType.REF,o.ErrorMessage.IndexLarge):this.doHlookup((0,l.zeroIfEmpty)(e),t,r-1,n)}))}match(e,t){return this.runFunction(e.args,t,this.metadata("MATCH"),((e,t,r)=>this.doMatch((0,l.zeroIfEmpty)(e),t,r)))}searchInRange(e,t,r,n){if(!r&&"string"==typeof e&&this.arithmeticHelper.requiresRegex(e))return n.advancedFind(this.arithmeticHelper.eqMatcherFunction(e),t);{const s=r?{ordering:"asc"}:{ordering:"none",matchExactly:!0};return n.find(e,t,s)}}doVlookup(e,t,r,i){this.dependencyGraph.stats.start(a.StatType.VLOOKUP);const l=t.range;let h;h=void 0===l?u.SimpleRangeValue.onlyValues(t.data.map((e=>[e[0]]))):u.SimpleRangeValue.onlyRange(n.AbsoluteCellRange.spanFrom(l.start,1,l.height()),this.dependencyGraph);const c=this.searchInRange(e,h,i,this.columnSearch);if(this.dependencyGraph.stats.end(a.StatType.VLOOKUP),-1===c)return new s.CellError(s.ErrorType.NA,o.ErrorMessage.ValueNotFound);let d;if(void 0===l)d=t.data[c][r];else{const e=(0,s.simpleCellAddress)(l.sheet,l.start.col+r,l.start.row+c);d=this.dependencyGraph.getCellValue(e)}return d instanceof u.SimpleRangeValue?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.WrongType):d}doHlookup(e,t,r,i){const a=t.range;let l;l=void 0===a?u.SimpleRangeValue.onlyValues([t.data[0]]):u.SimpleRangeValue.onlyRange(n.AbsoluteCellRange.spanFrom(a.start,a.width(),1),this.dependencyGraph);const h=this.searchInRange(e,l,i,this.rowSearch);if(-1===h)return new s.CellError(s.ErrorType.NA,o.ErrorMessage.ValueNotFound);let c;if(void 0===a)c=t.data[r][h];else{const e=(0,s.simpleCellAddress)(a.sheet,a.start.col+h,a.start.row+r);c=this.dependencyGraph.getCellValue(e)}return c instanceof u.SimpleRangeValue?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.WrongType):c}doMatch(e,t,r){if(![-1,0,1].includes(r))return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.BadMode);if(t.width()>1&&t.height()>1)return new s.CellError(s.ErrorType.NA);const n=0===r?{ordering:"none",matchExactly:!0}:{ordering:-1===r?"desc":"asc"},i=(1===t.width()?this.columnSearch:this.rowSearch).find(e,t,n);return-1===i?new s.CellError(s.ErrorType.NA,o.ErrorMessage.ValueNotFound):i+1}}c.implementedFunctions={VLOOKUP:{method:"vlookup",parameters:[{argumentType:h.FunctionArgumentType.NOERROR},{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.NUMBER},{argumentType:h.FunctionArgumentType.BOOLEAN,defaultValue:!0}]},HLOOKUP:{method:"hlookup",parameters:[{argumentType:h.FunctionArgumentType.NOERROR},{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.NUMBER},{argumentType:h.FunctionArgumentType.BOOLEAN,defaultValue:!0}]},MATCH:{method:"match",parameters:[{argumentType:h.FunctionArgumentType.NOERROR},{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.NUMBER,defaultValue:1}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RowSearchStrategy:()=>s});var n=r(136);class s extends n.AdvancedFind{constructor(e){super(e),this.dependencyGraph=e}find(e,t,r){return this.basicFind(e,t,"col",r)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RomanPlugin:()=>a});var n=r(3),s=r(61),o=r(70),i=r(94);class a extends i.FunctionPlugin{roman(e,t){return this.runFunction(e.args,t,this.metadata("ROMAN"),((e,t)=>(e=Math.trunc(e),!1===t?t=4:!0===t&&(t=0),(t=(0,o.getRawValue)(this.coerceScalarToNumberOrError(t)))instanceof n.CellError?t:(t=Math.trunc(t))<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.ValueSmall):t>4?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.ValueLarge):function(e,t){const r={val:e%1e3,acc:"M".repeat(Math.floor(e/1e3))};4===t&&(u(r,"IM",999,1e3),u(r,"ID",499,500));t>=3&&(u(r,"VM",995,1e3),u(r,"VD",495,500));t>=2&&(u(r,"XM",990,1e3),u(r,"XD",490,500));t>=1&&(u(r,"LM",950,1e3),u(r,"LD",450,500));u(r,"CM",900,1e3),u(r,"CD",400,500),u(r,"D",500,900),r.acc+="C".repeat(Math.floor(r.val/100)),r.val%=100,t>=2&&(u(r,"IC",99,100),u(r,"IL",49,50));t>=1&&(u(r,"VC",95,100),u(r,"VL",45,50));return u(r,"XC",90,100),u(r,"XL",40,50),u(r,"L",50,90),r.acc+="X".repeat(Math.floor(r.val/10)),r.val%=10,u(r,"IX",9,10),u(r,"IV",4,5),u(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=>{let t=!1;if((e=e.trim().toUpperCase()).startsWith("-")&&(t=!0,""===(e=e.slice(1))))return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.InvalidRoman);const r={input:e,acc:0};return l(r,{token:"MMM",val:3e3},{token:"MM",val:2e3},{token:"M",val:1e3}),l(r,{token:"IM",val:999},{token:"VM",val:995},{token:"XM",val:990},{token:"LM",val:950},{token:"CM",val:900}),l(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}),l(r,{token:"CCC",val:300},{token:"CC",val:200},{token:"C",val:100}),l(r,{token:"IC",val:99},{token:"VC",val:95},{token:"XC",val:90}),l(r,{token:"L",val:50},{token:"IL",val:49},{token:"VL",val:45},{token:"XL",val:40}),l(r,{token:"XXX",val:30},{token:"XX",val:20},{token:"X",val:10}),l(r,{token:"IX",val:9}),l(r,{token:"V",val:5},{token:"IV",val:4}),l(r,{token:"III",val:3},{token:"II",val:2},{token:"I",val:1}),""!==r.input?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.InvalidRoman):t?-r.acc:r.acc}))}}function l(e,...t){for(const r of t)if(e.input.startsWith(r.token)){e.input=e.input.slice(r.token.length),e.acc+=r.val;break}}function u(e,t,r,n){e.val>=r&&e.val<n&&(e.val-=r,e.acc+=t)}a.implementedFunctions={ROMAN:{method:"roman",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:1,lessThan:4e3},{argumentType:i.FunctionArgumentType.NOERROR,optionalArg:!0,defaultValue:0}]},ARABIC:{method:"arabic",parameters:[{argumentType:i.FunctionArgumentType.STRING}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SimpleArithmerticPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{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)}}s.implementedFunctions={"HF.ADD":{method:"add",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.CONCAT":{method:"concat",parameters:[{argumentType:n.FunctionArgumentType.STRING,passSubtype:!0},{argumentType:n.FunctionArgumentType.STRING,passSubtype:!0}]},"HF.DIVIDE":{method:"divide",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.EQ":{method:"eq",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.GT":{method:"gt",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.GTE":{method:"gte",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.LT":{method:"lt",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.LTE":{method:"lte",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.MINUS":{method:"minus",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.MULTIPLY":{method:"multiply",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.NE":{method:"ne",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.POW":{method:"pow",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UMINUS":{method:"uminus",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UNARY_PERCENT":{method:"upercent",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UPLUS":{method:"uplus",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{StatisticalPlugin:()=>l});var n=r(3),s=r(61),o=r(190),i=r(191),a=r(94);class l extends a.FunctionPlugin{erf(e,t){return this.runFunction(e.args,t,this.metadata("ERF"),((e,t)=>void 0===t?(0,i.erf)(e):(0,i.erf)(t)-(0,i.erf)(e)))}erfc(e,t){return this.runFunction(e.args,t,this.metadata("ERFC"),i.erfc)}expondist(e,t){return this.runFunction(e.args,t,this.metadata("EXPON.DIST"),((e,t,r)=>r?i.exponential.cdf(e,t):i.exponential.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"),i.gammafn)}gammadist(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.DIST"),((e,t,r,n)=>n?i.gamma.cdf(e,t,r):i.gamma.pdf(e,t,r)))}gammaln(e,t){return this.runFunction(e.args,t,this.metadata("GAMMALN"),i.gammaln)}gammainv(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.INV"),i.gamma.inv)}gauss(e,t){return this.runFunction(e.args,t,this.metadata("GAUSS"),(e=>i.normal.cdf(e,0,1)-.5))}betadist(e,t){return this.runFunction(e.args,t,this.metadata("BETA.DIST"),((e,t,r,o,a,l)=>e<=a?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall):e>=l?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):(e=(e-a)/(l-a),o?i.beta.cdf(e,t,r):i.beta.pdf(e,t,r))))}betainv(e,t){return this.runFunction(e.args,t,this.metadata("BETA.INV"),((e,t,r,o,a)=>o>=a?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.WrongOrder):i.beta.inv(e,t,r)*(a-o)+o))}binomialdist(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.DIST"),((e,t,r,o)=>e>t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.WrongOrder):(e=Math.trunc(e),t=Math.trunc(t),o?i.binomial.cdf(e,t,r):i.binomial.pdf(e,t,r))))}binomialinv(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.INV"),((e,t,r)=>{let n=-1,s=e=Math.trunc(e);for(;s>n+1;){const o=Math.trunc((n+s)/2);i.binomial.cdf(o,e,t)>=r?s=o:n=o}return s}))}besselifn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELI"),((e,t)=>(0,o.besseli)(e,Math.trunc(t))))}besseljfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELJ"),((e,t)=>(0,o.besselj)(e,Math.trunc(t))))}besselkfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELK"),((e,t)=>(0,o.besselk)(e,Math.trunc(t))))}besselyfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELY"),((e,t)=>(0,o.bessely)(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?i.chisquare.cdf(e,t):i.chisquare.pdf(e,t))))}chisqdistrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST.RT"),((e,t)=>1-i.chisquare.cdf(e,Math.trunc(t))))}chisqinv(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV"),((e,t)=>i.chisquare.inv(e,Math.trunc(t))))}chisqinvrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV.RT"),((e,t)=>i.chisquare.inv(1-e,Math.trunc(t))))}fdist(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST"),((e,t,r,n)=>(t=Math.trunc(t),r=Math.trunc(r),n?i.centralF.cdf(e,t,r):i.centralF.pdf(e,t,r))))}fdistrt(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST.RT"),((e,t,r)=>1-i.centralF.cdf(e,Math.trunc(t),Math.trunc(r))))}finv(e,t){return this.runFunction(e.args,t,this.metadata("F.INV"),((e,t,r)=>i.centralF.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)=>i.centralF.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,n)=>n?i.weibull.cdf(e,r,t):i.weibull.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?i.poisson.cdf(e,t):i.poisson.pdf(e,t))))}hypgeomdist(e,t){return this.runFunction(e.args,t,this.metadata("HYPGEOM.DIST"),((e,t,r,o,a)=>e>t||e>r||t>o||r>o||e+o<r+t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):(e=Math.trunc(e),t=Math.trunc(t),r=Math.trunc(r),o=Math.trunc(o),a?i.hypgeom.cdf(e,o,r,t):i.hypgeom.pdf(e,o,r,t))))}tdist(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST"),((e,t,r)=>(t=Math.trunc(t),r?i.studentt.cdf(e,t):i.studentt.pdf(e,t))))}tdist2t(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.2T"),((e,t)=>2*(1-i.studentt.cdf(e,Math.trunc(t)))))}tdistrt(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.RT"),((e,t)=>1-i.studentt.cdf(e,Math.trunc(t))))}tdistold(e,t){return this.runFunction(e.args,t,this.metadata("TDIST"),((e,t,r)=>r*(1-i.studentt.cdf(e,Math.trunc(t)))))}tinv(e,t){return this.runFunction(e.args,t,this.metadata("T.INV"),((e,t)=>i.studentt.inv(e,Math.trunc(t))))}tinv2t(e,t){return this.runFunction(e.args,t,this.metadata("T.INV.2T"),((e,t)=>i.studentt.inv(1-e/2,Math.trunc(t))))}lognormdist(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.DIST"),((e,t,r,n)=>n?i.lognormal.cdf(e,t,r):i.lognormal.pdf(e,t,r)))}lognorminv(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.INV"),((e,t,r)=>i.lognormal.inv(e,t,r)))}normdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.DIST"),((e,t,r,n)=>n?i.normal.cdf(e,t,r):i.normal.pdf(e,t,r)))}norminv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.INV"),((e,t,r)=>i.normal.inv(e,t,r)))}normsdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.DIST"),((e,t)=>t?i.normal.cdf(e,0,1):i.normal.pdf(e,0,1)))}normsinv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.INV"),(e=>i.normal.inv(e,0,1)))}phi(e,t){return this.runFunction(e.args,t,this.metadata("PHI"),(e=>i.normal.pdf(e,0,1)))}negbinomdist(e,t){return this.runFunction(e.args,t,this.metadata("NEGBINOM.DIST"),((e,t,r,n)=>(e=Math.trunc(e),t=Math.trunc(t),n?i.negbin.cdf(e,t,r):i.negbin.pdf(e,t,r))))}confidencenorm(e,t){return this.runFunction(e.args,t,this.metadata("CONFIDENCE.NORM"),((e,t,r)=>(0,i.normalci)(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 n.CellError(n.ErrorType.DIV_BY_ZERO):(0,i.tci)(1,e,t,r)[1]-1))}standardize(e,t){return this.runFunction(e.args,t,this.metadata("STANDARDIZE"),((e,t,r)=>(e-t)/r))}}l.implementedFunctions={ERF:{method:"erf",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0}]},ERFC:{method:"erfc",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},"EXPON.DIST":{method:"expondist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},FISHER:{method:"fisher",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:-1,lessThan:1}]},FISHERINV:{method:"fisherinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},GAMMA:{method:"gamma",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},"GAMMA.DIST":{method:"gammadist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},GAMMALN:{method:"gammaln",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]},"GAMMA.INV":{method:"gammainv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]},GAUSS:{method:"gauss",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},"BETA.DIST":{method:"betadist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN},{argumentType:a.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:a.FunctionArgumentType.NUMBER,defaultValue:1}]},"BETA.INV":{method:"betainv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:a.FunctionArgumentType.NUMBER,defaultValue:1}]},"BINOM.DIST":{method:"binomialdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"BINOM.INV":{method:"binomialinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1}]},BESSELI:{method:"besselifn",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0}]},BESSELJ:{method:"besseljfn",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0}]},BESSELK:{method:"besselkfn",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0}]},BESSELY:{method:"besselyfn",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0}]},"CHISQ.DIST":{method:"chisqdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1,maxValue:1e10},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"CHISQ.DIST.RT":{method:"chisqdistrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV":{method:"chisqinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV.RT":{method:"chisqinvrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"F.DIST":{method:"fdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"F.DIST.RT":{method:"fdistrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"F.INV":{method:"finv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"F.INV.RT":{method:"finvrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"WEIBULL.DIST":{method:"weibulldist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"POISSON.DIST":{method:"poissondist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"HYPGEOM.DIST":{method:"hypgeomdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"T.DIST":{method:"tdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"T.DIST.2T":{method:"tdist2t",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"T.DIST.RT":{method:"tdistrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},TDIST:{method:"tdistold",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.INTEGER,minValue:1,maxValue:2}]},"T.INV":{method:"tinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"T.INV.2T":{method:"tinv2t",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"LOGNORM.DIST":{method:"lognormdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"LOGNORM.INV":{method:"lognorminv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]},"NORM.DIST":{method:"normdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"NORM.INV":{method:"norminv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]},"NORM.S.DIST":{method:"normsdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"NORM.S.INV":{method:"normsinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1}]},PHI:{method:"phi",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},"NEGBINOM.DIST":{method:"negbinomdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"CONFIDENCE.NORM":{method:"confidencenorm",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"CONFIDENCE.T":{method:"confidencet",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},STANDARDIZE:{method:"standardize",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]}},l.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"}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{besseli:()=>w,besselj:()=>T,besselk:()=>S,bessely:()=>R});var n=Math;function s(e,t){for(var r=0,n=0;r<e.length;++r)n=t*n+e[r];return n}function o(e,t,r,n,s){if(0===t)return r;if(1===t)return n;for(var o=2/e,i=n,a=1;a<t;++a)i=n*a*o+s*r,r=n,n=i;return i}function i(e,t,r,n,s){return function(r,i){if(n){if(0===r)return 1==n?-1/0:1/0;if(r<0)return NaN}return 0===i?e(r):1===i?t(r):i<0?NaN:o(r,i|=0,e(r),t(r),s)}}var a,l,u,h,c,d,p,g,m,f,y,E,C,T=function(){var e=.636619772,t=[57568490574,-13362590354,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),r=[57568490411,1029532985,9494680.718,59272.64853,267.8532712,1].reverse(),i=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),a=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34935152e-8].reverse();function l(o){var l=0,u=0,h=0,c=o*o;if(o<8)l=(u=s(t,c))/(h=s(r,c));else{var d=o-.785398164;u=s(i,c=64/c),h=s(a,c),l=n.sqrt(e/o)*(n.cos(d)*u-n.sin(d)*h*8/o)}return l}var u=[72362614232,-7895059235,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),h=[144725228442,2300535178,18583304.74,99447.43394,376.9991397,1].reverse(),c=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),d=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();function p(t){var r=0,o=0,i=0,a=t*t,l=n.abs(t)-2.356194491;return Math.abs(t)<8?r=(o=t*s(u,a))/(i=s(h,a)):(o=s(c,a=64/a),i=s(d,a),r=n.sqrt(e/n.abs(t))*(n.cos(l)*o-n.sin(l)*i*8/n.abs(t)),t<0&&(r=-r)),r}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 l(t);if(1===r)return p(t);if(0===t)return 0;var s=0;if(t>r)s=o(t,r,l(t),p(t),-1);else{for(var i=!1,a=0,u=0,h=1,c=0,d=2/t,g=2*n.floor((r+n.floor(n.sqrt(40*r)))/2);g>0;g--)c=g*d*h-a,a=h,h=c,n.abs(h)>1e10&&(h*=1e-10,a*=1e-10,s*=1e-10,u*=1e-10),i&&(u+=h),i=!i,g==r&&(s=a);s/=u=2*u-h}return s}}(),R=(a=.636619772,l=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),u=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),h=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),c=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse(),d=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),p=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),g=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),m=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse(),i((function(e){var t=0,r=0,o=0,i=e*e,d=e-.785398164;return e<8?t=(r=s(l,i))/(o=s(u,i))+a*T(e,0)*n.log(e):(r=s(h,i=64/i),o=s(c,i),t=n.sqrt(a/e)*(n.sin(d)*r+n.cos(d)*o*8/e)),t}),(function(e){var t=0,r=0,o=0,i=e*e,l=e-2.356194491;return e<8?t=(r=e*s(d,i))/(o=s(p,i))+a*(T(e,1)*n.log(e)-1/e):(r=s(g,i=64/i),o=s(m,i),t=n.sqrt(a/e)*(n.sin(l)*r+n.cos(l)*o*8/e)),t}),0,1,-1)),w=(f=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),y=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),E=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),C=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse(),function e(t,r){if(0===(r=Math.round(r)))return function(e){return e<=3.75?s(f,e*e/14.0625):n.exp(n.abs(e))/n.sqrt(n.abs(e))*s(y,3.75/n.abs(e))}(t);if(1===r)return function(e){return e<3.75?e*s(E,e*e/14.0625):(e<0?-1:1)*n.exp(n.abs(e))/n.sqrt(n.abs(e))*s(C,3.75/n.abs(e))}(t);if(r<0)return NaN;if(0===n.abs(t))return 0;if(t==1/0)return 1/0;var o,i=0,a=2/n.abs(t),l=0,u=1,h=0;for(o=2*n.round((r+n.round(n.sqrt(40*r)))/2);o>0;o--)h=o*a*u+l,l=u,u=h,n.abs(u)>1e10&&(u*=1e-10,l*=1e-10,i*=1e-10),o==r&&(i=l);return i*=e(t,0)/u,t<0&&r%2?-i:i}),S=function(){var e=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),t=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();var r=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),o=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();return i((function(r){return r<=2?-n.log(r/2)*w(r,0)+s(e,r*r/4):n.exp(-r)/n.sqrt(r)*s(t,2/r)}),(function(e){return e<=2?n.log(e/2)*w(e,1)+1/e*s(r,e*e/4):n.exp(-e)/n.sqrt(e)*s(o,2/e)}),0,2,1)}()},(e,t,r)=>{"use strict";function n(e){const t=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18];let r,n,s,o,i=t.length-1,a=!1,l=0,u=0;if(0===e)return 0;for(e<0&&(e=-e,a=!0),r=2/(2+e),n=4*r-2;i>0;i--)s=l,l=n*l-u+t[i],u=s;return o=r*Math.exp(-e*e+.5*(t[0]+n*l)-u),a?o-1:1-o}function s(e){return 1-n(e)}function o(e){let t,r,n,o,i=0;if(e>=2)return-100;if(e<=0)return 100;for(o=e<1?e:2-e,n=Math.sqrt(-2*Math.log(o/2)),t=-.70711*((2.30753+.27061*n)/(1+n*(.99229+.04481*n))-n);i<2;i++)r=s(t)-o,t+=r/(1.1283791670955126*Math.exp(-t*t)-t*r);return e<1?t:-t}r.r(t),r.d(t,{beta:()=>p,binomial:()=>C,centralF:()=>A,chisquare:()=>v,corrcoeff:()=>B,covariance:()=>V,erf:()=>n,erfc:()=>s,exponential:()=>i,factorial:()=>S,factorialln:()=>w,gamma:()=>l,gammafn:()=>a,gammaln:()=>u,geomean:()=>U,hypgeom:()=>M,lognormal:()=>I,mean:()=>P,negbin:()=>_,normal:()=>d,normalci:()=>k,poisson:()=>O,stdev:()=>F,studentt:()=>b,sumsqerr:()=>L,tci:()=>H,variance:()=>D,weibull:()=>N});const i={pdf:(e,t)=>e<0?0:t*Math.exp(-t*e),cdf:(e,t)=>e<0?0:1-Math.exp(-t*e)};function a(e){const t=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],r=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535];let n,s,o,i,a=!1,l=0,u=0,h=0,c=e;if(e>171.6243769536076)return 1/0;if(c<=0){if(i=c%1,!i)return 1/0;a=(1&c?-1:1)*Math.PI/Math.sin(Math.PI*i),c=1-c}for(o=c,s=c<1?c++:(c-=l=(0|c)-1)-1,n=0;n<8;++n)h=(h+t[n])*s,u=u*s+r[n];if(i=h/u+1,o<c)i/=o;else if(o>c)for(n=0;n<l;++n)i*=c,c++;return a&&(i=a/i),i}const l={pdf:function(e,t,r){return e<0?0:0===e&&1===t?1/r:Math.exp((t-1)*Math.log(e)-e/r-u(t)-t*Math.log(r))},cdf:function(e,t,r){return e<0?0:h(t,e/r)},inv:function(e,t,r){return c(e,t)*r}};function u(e){let t=0;const r=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];let n,s,o,i=1.000000000190015;for(o=(s=n=e)+5.5,o-=(n+.5)*Math.log(o);t<6;t++)i+=r[t]/++s;return Math.log(2.5066282746310007*i/n)-o}function h(e,t){const r=u(e);let n=e,s=1/e,o=s,i=t+1-e,a=1/1e-30,l=1/i,h=l,c=1;const d=-~(8.5*Math.log(e>=1?e:1/e)+.4*e+17);let p;if(t<0||e<=0)return NaN;if(t<e+1){for(;c<=d;c++)s+=o*=t/++n;return s*Math.exp(-t+e*Math.log(t)-r)}for(;c<=d;c++)p=-c*(c-e),i+=2,l=p*l+i,a=i+p/a,l=1/l,h*=l*a;return 1-h*Math.exp(-t+e*Math.log(t)-r)}function c(e,t){let r=0;const n=t-1,s=u(t);let o,i,a,l,c,d,p;if(e>=1)return Math.max(100,t+100*Math.sqrt(t));if(e<=0)return 0;for(t>1?(d=Math.log(n),p=Math.exp(n*(d-1)-s),c=e<.5?e:1-e,a=Math.sqrt(-2*Math.log(c)),o=(2.30753+.27061*a)/(1+a*(.99229+.04481*a))-a,e<.5&&(o=-o),o=Math.max(.001,t*Math.pow(1-1/(9*t)-o/(3*Math.sqrt(t)),3))):(a=1-t*(.253+.12*t),o=e<a?Math.pow(e/a,1/t):1-Math.log(1-(e-a)/(1-a)));r<12;r++){if(o<=0)return 0;if(i=h(t,o)-e,a=t>1?p*Math.exp(-(o-n)+n*(Math.log(o)-d)):Math.exp(-o+n*Math.log(o)-s),l=i/a,o-=a=l/(1-.5*Math.min(1,l*((t-1)/o-1))),o<=0&&(o=.5*(o+a)),Math.abs(a)<1e-8*o)break}return o}const d={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+n((e-t)/Math.sqrt(2*r*r)))},inv:function(e,t,r){return-1.4142135623730951*r*o(2*e)+t}},p={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)/g(t,r):Math.exp((t-1)*Math.log(e)+(r-1)*Math.log(1-e)-m(t,r))},cdf:function(e,t,r){return e>1||e<0?+(e>1):y(e,t,r)},inv:function(e,t,r){return f(e,t,r)}};function g(e,t){if(!(e<=0||t<=0))return e+t>170?Math.exp(m(e,t)):a(e)*a(t)/a(e+t)}function m(e,t){return u(e)+u(t)-u(e+t)}function f(e,t,r){var n,s,o,i,a,l,h,c,d,p,g=t-1,m=r-1,f=0;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&r>=1?(o=e<.5?e:1-e,l=(2.30753+.27061*(i=Math.sqrt(-2*Math.log(o))))/(1+i*(.99229+.04481*i))-i,e<.5&&(l=-l),h=(l*l-3)/6,c=2/(1/(2*t-1)+1/(2*r-1)),d=l*Math.sqrt(h+c)/c-(1/(2*r-1)-1/(2*t-1))*(h+5/6-2/(3*c)),l=t/(t+r*Math.exp(2*d))):(n=Math.log(t/(t+r)),s=Math.log(r/(t+r)),l=e<(i=Math.exp(t*n)/t)/(d=i+(a=Math.exp(r*s)/r))?Math.pow(t*d*e,1/t):1-Math.pow(r*d*(1-e),1/r)),p=-u(t)-u(r)+u(t+r);f<10;f++){if(0===l||1===l)return l;if((l-=i=(a=(y(l,t,r)-e)/(i=Math.exp(g*Math.log(l)+m*Math.log(1-l)+p)))/(1-.5*Math.min(1,a*(g/l-m/(1-l)))))<=0&&(l=.5*(l+i)),l>=1&&(l=.5*(l+i+1)),Math.abs(i)<1e-8*l&&f>0)break}return l}function y(e,t,r){var n=0===e||1===e?0:Math.exp(u(t+r)-u(t)-u(r)+t*Math.log(e)+r*Math.log(1-e));return!(e<0||e>1)&&(e<(t+1)/(t+r+2)?n*E(e,t,r)/t:1-n*E(1-e,r,t)/r)}function E(e,t,r){var n,s,o,i,a=1e-30,l=1,u=t+r,h=t+1,c=t-1,d=1,p=1-u*e/h;for(Math.abs(p)<a&&(p=a),i=p=1/p;l<=100&&(p=1+(s=l*(r-l)*e/((c+(n=2*l))*(t+n)))*p,Math.abs(p)<a&&(p=a),d=1+s/d,Math.abs(d)<a&&(d=a),i*=(p=1/p)*d,p=1+(s=-(t+l)*(u+l)*e/((t+n)*(h+n)))*p,Math.abs(p)<a&&(p=a),d=1+s/d,Math.abs(d)<a&&(d=a),i*=o=(p=1/p)*d,!(Math.abs(o-1)<3e-7));l++);return i}const C={pdf:function(e,t,r){return 0===r||1===r?t*r===e?1:0:R(t,e)*Math.pow(r,e)*Math.pow(1-r,t-e)},cdf:function(e,t,r){var n,s=1e-10;if(e<0)return 0;if(e>=t)return 1;if(r<0||r>1||t<=0)return NaN;var o=r,i=(e=Math.floor(e))+1,a=t-e,l=i+a,h=Math.exp(u(l)-u(a)-u(i)+i*Math.log(o)+a*Math.log(1-o));return n=o<(i+1)/(l+2)?h*T(o,i,a,s):1-h*T(1-o,a,i,s),Math.round(1/s*(1-n))/(1/s)}};function T(e,t,r,n){for(var s,o=0,i=1,a=1,l=1,u=0,h=0;Math.abs((a-h)/a)>n;)h=a,i=l+(s=-(t+u)*(t+r+u)*e/(t+2*u)/(t+2*u+1))*i,a=(o=a+s*o)+(s=(u+=1)*(r-u)*e/(t+2*u-1)/(t+2*u))*a,o/=l=i+s*l,i/=l,a/=l,l=1;return a/t}function R(e,t){return e>170||t>170?Math.exp(function(e,t){return w(e)-w(t)-w(e-t)}(e,t)):S(e)/S(t)/S(e-t)}function w(e){return e<0?NaN:u(e+1)}function S(e){return e<0?NaN:a(e+1)}const v={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)-u(t/2))},cdf:function(e,t){return e<0?0:h(t/2,e/2)},inv:function(e,t){return 2*c(e,.5*t)}},A={pdf:function(e,t,r){var n;return e<0?0:t<=2?0===e&&t<2?1/0:0===e&&2===t?1:1/g(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):(n=t*e/(r+e*t),t*(r/(r+e*t))/2*C.pdf((t-2)/2,(t+r-2)/2,n))},cdf:function(e,t,r){return e<0?0:y(t*e/(t*e+r),t/2,r/2)},inv:function(e,t,r){return r/(t*(1/f(e,t/2,r/2)-1))}},N={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))}},O={pdf:function(e,t){return t<0||e%1!=0||e<0?0:Math.pow(t,e)*Math.exp(-t)/S(e)},cdf:function(e,t){var r=0;if(e<0)return 0;for(var n=0;r<=e;r++)n+=O.pdf(r,t);return n}},M={pdf:function(e,t,r,n){if(e<0||e<r-(t-n))return 0;if(e>n||e>r)return 0;if(2*r>t)return 2*n>t?M.pdf(t-r-n+e,t,t-r,t-n):M.pdf(n-e,t,t-r,n);if(2*n>t)return M.pdf(r-e,t,r,t-n);if(r<n)return M.pdf(e,t,n,r);for(var s=1,o=0,i=0;i<e;i++){for(;s>1&&o<n;)s*=1-r/(t-o),o++;s*=(n-i)*(r-i)/((i+1)*(t-r-n+i+1))}for(;o<n;o++)s*=1-r/(t-o);return Math.min(1,Math.max(0,s))},cdf:function e(t,r,n,s){if(t<0||t<n-(r-s))return 0;if(t>=s||t>=n)return 1;if(2*n>r)return 2*s>r?e(r-n-s+t,r,r-n,r-s):1-M.cdf(s-t-1,r,r-n,s);if(2*s>r)return 1-M.cdf(n-t-1,r,n,r-s);if(n<s)return M.cdf(t,r,s,n);for(var o=1,i=1,a=0,l=0;l<t;l++){for(;o>1&&a<s;){var u=1-n/(r-a);i*=u,o*=u,a++}o+=i*=(s-l)*(n-l)/((l+1)*(r-n-s+l+1))}for(;a<s;a++)o*=1-n/(r-a);return Math.min(1,Math.max(0,o))}},b={pdf:function(e,t){return t=t>1e100?1e100:t,1/(Math.sqrt(t)*g(.5,t/2))*Math.pow(1+e*e/t,-(t+1)/2)},cdf:function(e,t){var r=t/2;return y((e+Math.sqrt(e*e+t))/(2*Math.sqrt(e*e+t)),r,r)},inv:function(e,t){var r=f(2*Math.min(e,1-e),.5*t,.5);return r=Math.sqrt(t*(1-r)/r),e>.5?r:-r}},I={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*n((Math.log(e)-t)/Math.sqrt(2*r*r))},inv:function(e,t,r){return Math.exp(-1.4142135623730951*r*o(2*e)+t)}},_={pdf:function(e,t,r){return e===e>>>0&&(e<0?0:R(e+t-1,t-1)*Math.pow(1-r,e)*Math.pow(r,t))},cdf:function(e,t,r){var n=0,s=0;if(e<0)return 0;for(;s<=e;s++)n+=_.pdf(s,t,r);return n}};function x(e){for(var t=0,r=e.length;--r>=0;)t+=e[r];return t}function P(e){return x(e)/e.length}function L(e){for(var t,r=P(e),n=0,s=e.length;--s>=0;)n+=(t=e[s]-r)*t;return n}function D(e,t){return L(e)/(e.length-(t?1:0))}function F(e,t){return Math.sqrt(D(e,t))}function k(){var e,t=[].slice.call(arguments),r=new Array(2);return e=4===t.length?Math.abs(d.inv(t[1]/2,0,1)*t[2]/Math.sqrt(t[3])):Math.abs(d.inv(t[1]/2,0,1)*F(t[2])/Math.sqrt(t[2].length)),r[0]=t[0]-e,r[1]=t[0]+e,r}function H(){var e,t=[].slice.call(arguments),r=new Array(2);return e=4===t.length?Math.abs(b.inv(t[1]/2,t[3]-1)*t[2]/Math.sqrt(t[3])):Math.abs(b.inv(t[1]/2,t[2].length-1)*F(t[2],!0)/Math.sqrt(t[2].length)),r[0]=t[0]-e,r[1]=t[0]+e,r}function U(e){return Math.pow(function(e){for(var t=1,r=e.length;--r>=0;)t*=e[r];return t}(e),1/e.length)}function V(e,t){var r,n=P(e),s=P(t),o=e.length,i=new Array(o);for(r=0;r<o;r++)i[r]=(e[r]-n)*(t[r]-s);return x(i)/(o-1)}function B(e,t){return V(e,t)/F(e,1)/F(t,1)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{MathPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{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=>{let t=1;for(let r=e=Math.trunc(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 n.CellError(n.ErrorType.NUM,s.ErrorMessage.WrongOrder):a(e=Math.trunc(e),t=Math.trunc(t))))}combina(e,t){return this.runFunction(e.args,t,this.metadata("COMBINA"),((e,t)=>(e=Math.trunc(e))+(t=Math.trunc(t))-1>=1030?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):0===e&&0===t?1:a(e+t-1,t)))}gcd(e,t){return this.runFunction(e.args,t,this.metadata("GCD"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof n.CellError)return t;let r=0;for(const e of t){if(e<0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);r=l(r,Math.trunc(e))}return r>Number.MAX_SAFE_INTEGER?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):r}))}lcm(e,t){return this.runFunction(e.args,t,this.metadata("LCM"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof n.CellError)return t;let r=1;for(const e of t){if(e<0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);r=u(r,Math.trunc(e))}return r>Number.MAX_SAFE_INTEGER?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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 n.CellError(n.ErrorType.NUM,s.ErrorMessage.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 o of e){if(o<0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);o=Math.trunc(o);for(let e=1;e<=o;e++)r*=(t+e)/e;t+=o}return Math.round(r)}))}quotient(e,t){return this.runFunction(e.args,t,this.metadata("QUOTIENT"),((e,t)=>0===t?new n.CellError(n.ErrorType.DIV_BY_ZERO):Math.trunc(e/t)))}seriessum(e,t){return this.runFunction(e.args,t,this.metadata("SERIESSUM"),((e,t,r,s)=>{const o=this.arithmeticHelper.manyToOnlyNumbersDropNulls(s.valuesFromTopLeftCorner());if(o instanceof n.CellError)return o;let i=0;o.reverse();for(const t of o)i*=Math.pow(e,r),i+=t;return i*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)=>{const r=e.valuesFromTopLeftCorner(),o=t.valuesFromTopLeftCorner();if(r.length!==o.length)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const i=r.length;let a=0;for(let e=0;e<i;e++){const t=r[e],s=o[e];if(t instanceof n.CellError)return t;if(s instanceof n.CellError)return s;"number"==typeof t&&"number"==typeof s&&(a+=Math.pow(t,2)-Math.pow(s,2))}return a}))}sumx2py2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2PY2"),((e,t)=>{const r=e.valuesFromTopLeftCorner(),o=t.valuesFromTopLeftCorner();if(r.length!==o.length)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const i=r.length;let a=0;for(let e=0;e<i;e++){const t=r[e],s=o[e];if(t instanceof n.CellError)return t;if(s instanceof n.CellError)return s;"number"==typeof t&&"number"==typeof s&&(a+=Math.pow(t,2)+Math.pow(s,2))}return a}))}sumxmy2(e,t){return this.runFunction(e.args,t,this.metadata("SUMXMY2"),((e,t)=>{const r=e.valuesFromTopLeftCorner(),o=t.valuesFromTopLeftCorner();if(r.length!==o.length)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const i=r.length;let a=0;for(let e=0;e<i;e++){const t=r[e],s=o[e];if(t instanceof n.CellError)return t;if(s instanceof n.CellError)return s;"number"==typeof t&&"number"==typeof s&&(a+=Math.pow(t-s,2))}return a}))}}function a(e,t){2*t>e&&(t=e-t);let r=1;for(let n=1;n<=t;n++)r*=(e-t+n)/n;return Math.round(r)}function l(e,t){for(e<t&&([e,t]=[t,e]);t>0;)[e,t]=[t,e%t];return e}function u(e,t){return 0===e||0===t?0:e*(t/l(e,t))}i.implementedFunctions={FACT:{method:"fact",parameters:[{argumentType:o.FunctionArgumentType.NUMBER,minValue:0,maxValue:170}]},FACTDOUBLE:{method:"factdouble",parameters:[{argumentType:o.FunctionArgumentType.NUMBER,minValue:0,maxValue:288}]},COMBIN:{method:"combin",parameters:[{argumentType:o.FunctionArgumentType.NUMBER,minValue:0,lessThan:1030},{argumentType:o.FunctionArgumentType.NUMBER,minValue:0}]},COMBINA:{method:"combina",parameters:[{argumentType:o.FunctionArgumentType.NUMBER,minValue:0},{argumentType:o.FunctionArgumentType.NUMBER,minValue:0}]},GCD:{method:"gcd",parameters:[{argumentType:o.FunctionArgumentType.ANY}],repeatLastArgs:1},LCM:{method:"lcm",parameters:[{argumentType:o.FunctionArgumentType.ANY}],repeatLastArgs:1},MROUND:{method:"mround",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},MULTINOMIAL:{method:"multinomial",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}],repeatLastArgs:1,expandRanges:!0},QUOTIENT:{method:"quotient",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},SERIESSUM:{method:"seriessum",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.RANGE}]},SIGN:{method:"sign",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SUMX2MY2:{method:"sumx2my2",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.RANGE}]},SUMX2PY2:{method:"sumx2py2",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.RANGE}]},SUMXMY2:{method:"sumxmy2",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.RANGE}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ComplexPlugin:()=>a});var n=r(3),s=r(61),o=r(95),i=r(94);class a extends i.FunctionPlugin{complex(e,t){return this.runFunction(e.args,t,this.metadata("COMPLEX"),((e,t,r)=>"i"!==r&&"j"!==r?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.ShouldBeIorJ):(0,o.coerceComplexToString)([e,t],r)))}imabs(e,t){return this.runFunction(e.args,t,this.metadata("IMABS"),f)}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 n.CellError(n.ErrorType.DIV_BY_ZERO):Math.atan2(t,e)))}imconjugate(e,t){return this.runFunction(e.args,t,this.metadata("IMCONJUGATE"),(([e,t])=>(0,o.coerceComplexToString)([e,-t])))}imcos(e,t){return this.runFunction(e.args,t,this.metadata("IMCOS"),(e=>(0,o.coerceComplexToString)(c(e))))}imcosh(e,t){return this.runFunction(e.args,t,this.metadata("IMCOSH"),(e=>(0,o.coerceComplexToString)(d(e))))}imcot(e,t){return this.runFunction(e.args,t,this.metadata("IMCOT"),(e=>(0,o.coerceComplexToString)(h(c(e),p(e)))))}imcsc(e,t){return this.runFunction(e.args,t,this.metadata("IMCSC"),(e=>(0,o.coerceComplexToString)(h([1,0],p(e)))))}imcsch(e,t){return this.runFunction(e.args,t,this.metadata("IMCSCH"),(e=>(0,o.coerceComplexToString)(h([1,0],g(e)))))}imsec(e,t){return this.runFunction(e.args,t,this.metadata("IMSEC"),(e=>(0,o.coerceComplexToString)(h([1,0],c(e)))))}imsech(e,t){return this.runFunction(e.args,t,this.metadata("IMSECH"),(e=>(0,o.coerceComplexToString)(h([1,0],d(e)))))}imsin(e,t){return this.runFunction(e.args,t,this.metadata("IMSIN"),(e=>(0,o.coerceComplexToString)(p(e))))}imsinh(e,t){return this.runFunction(e.args,t,this.metadata("IMSINH"),(e=>(0,o.coerceComplexToString)(g(e))))}imtan(e,t){return this.runFunction(e.args,t,this.metadata("IMTAN"),(e=>(0,o.coerceComplexToString)(h(p(e),c(e)))))}imdiv(e,t){return this.runFunction(e.args,t,this.metadata("IMDIV"),((e,t)=>(0,o.coerceComplexToString)(h(e,t))))}improduct(e,t){return this.runFunction(e.args,t,this.metadata("IMPRODUCT"),((...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof n.CellError)return t;let r=[1,0];for(const e of t)r=u(r,e);return(0,o.coerceComplexToString)(r)}))}imsum(e,t){return this.runFunction(e.args,t,this.metadata("IMSUM"),((...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof n.CellError)return t;let r=[0,0];for(const e of t)r=l(r,e);return(0,o.coerceComplexToString)(r)}))}imsub(e,t){return this.runFunction(e.args,t,this.metadata("IMSUB"),((e,t)=>(0,o.coerceComplexToString)(function([e,t],[r,n]){return[e-r,t-n]}(e,t))))}imexp(e,t){return this.runFunction(e.args,t,this.metadata("IMEXP"),(e=>(0,o.coerceComplexToString)(m(e))))}imln(e,t){return this.runFunction(e.args,t,this.metadata("IMLN"),(e=>(0,o.coerceComplexToString)(y(e))))}imlog10(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG10"),(e=>{const[t,r]=y(e),n=Math.log(10);return(0,o.coerceComplexToString)([t/n,r/n])}))}imlog2(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG2"),(e=>{const[t,r]=y(e),n=Math.log(2);return(0,o.coerceComplexToString)([t/n,r/n])}))}impower(e,t){return this.runFunction(e.args,t,this.metadata("IMPOWER"),((e,t)=>(0,o.coerceComplexToString)(E(e,t))))}imsqrt(e,t){return this.runFunction(e.args,t,this.metadata("IMSQRT"),(e=>(0,o.coerceComplexToString)(E(e,.5))))}}function l([e,t],[r,n]){return[e+r,t+n]}function u([e,t],[r,n]){return[e*r-t*n,e*n+r*t]}function h([e,t],[r,n]){const s=Math.pow(r,2)+Math.pow(n,2),[o,i]=u([e,t],[r,-n]);return[o/s,i/s]}function c([e,t]){return[Math.cos(e)*Math.cosh(t),-Math.sin(e)*Math.sinh(t)]}function d([e,t]){return[Math.cosh(e)*Math.cos(t),Math.sinh(e)*Math.sin(t)]}function p([e,t]){return[Math.sin(e)*Math.cosh(t),Math.cos(e)*Math.sinh(t)]}function g([e,t]){return[Math.sinh(e)*Math.cos(t),Math.cosh(e)*Math.sin(t)]}function m([e,t]){return[Math.exp(e)*Math.cos(t),Math.exp(e)*Math.sin(t)]}function f([e,t]){return Math.sqrt(e*e+t*t)}function y([e,t]){return[Math.log(f([e,t])),Math.atan2(t,e)]}function E(e,t){const[r,n]=y(e);return m([t*r,t*n])}a.implementedFunctions={COMPLEX:{method:"complex",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.STRING,defaultValue:"i"}]},IMABS:{method:"imabs",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMAGINARY:{method:"imaginary",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMREAL:{method:"imreal",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMARGUMENT:{method:"imargument",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCONJUGATE:{method:"imconjugate",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCOS:{method:"imcos",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCOSH:{method:"imcosh",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCOT:{method:"imcot",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCSC:{method:"imcsc",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCSCH:{method:"imcsch",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMSEC:{method:"imsec",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMSECH:{method:"imsech",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMSIN:{method:"imsin",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMSINH:{method:"imsinh",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMTAN:{method:"imtan",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMDIV:{method:"imdiv",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX},{argumentType:i.FunctionArgumentType.COMPLEX}]},IMPRODUCT:{method:"improduct",parameters:[{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1},IMSUM:{method:"imsum",parameters:[{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1},IMSUB:{method:"imsub",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX},{argumentType:i.FunctionArgumentType.COMPLEX}]},IMEXP:{method:"imexp",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMLN:{method:"imln",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMLOG10:{method:"imlog10",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMLOG2:{method:"imlog2",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMPOWER:{method:"impower",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX},{argumentType:i.FunctionArgumentType.NUMBER}]},IMSQRT:{method:"imsqrt",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{StatisticalAggregationPlugin:()=>l});var n=r(3),s=r(61),o=r(70),i=r(191),a=r(94);class l extends a.FunctionPlugin{avedev(e,t){return this.runFunction(e.args,t,this.metadata("AVEDEV"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;if(0===t.length)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const r=(0,i.mean)(t);return t.reduce(((e,t)=>e+Math.abs(t-r)),0)/t.length}))}devsq(e,t){return this.runFunction(e.args,t,this.metadata("DEVSQ"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof n.CellError?t:0===t.length?0:(0,i.sumsqerr)(t)}))}geomean(e,t){return this.runFunction(e.args,t,this.metadata("GEOMEAN"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;if(0===t.length)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.OneValue);for(const e of t)if(e<=0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);return(0,i.geomean)(t)}))}harmean(e,t){return this.runFunction(e.args,t,this.metadata("HARMEAN"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;if(0===t.length)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.OneValue);for(const e of t)if(e<=0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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 n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;return r[0].length<=1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues):(0,i.corrcoeff)(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 n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;return r[0].length<=1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues):Math.pow((0,i.corrcoeff)(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 n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;const o=r[0].length;return o<1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.OneValue):1===o?0:(0,i.covariance)(r[0],r[1])*(o-1)/o}))}covariances(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.S"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;return r[0].length<=1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues):(0,i.covariance)(r[0],r[1])}))}ztest(e,t){return this.runFunction(e.args,t,this.metadata("Z.TEST"),((e,t,r)=>{const o=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(o instanceof n.CellError)return o;const a=o.length;if(void 0===r){if(a<2)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);r=(0,i.stdev)(o,!0)}return a<1?new n.CellError(n.ErrorType.NA,s.ErrorMessage.OneValue):0===r?new n.CellError(n.ErrorType.DIV_BY_ZERO):1-i.normal.cdf(((0,i.mean)(o)-t)/(r/Math.sqrt(a)),0,1)}))}ftest(e,t){return this.runFunction(e.args,t,this.metadata("F.TEST"),((e,t)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),s=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(r instanceof n.CellError)return r;if(s instanceof n.CellError)return s;if(r.length<=1||s.length<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const o=(0,i.variance)(r,!0),a=(0,i.variance)(s,!0);if(0===o||0===a)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const l=o/a,u=i.centralF.cdf(l,r.length-1,s.length-1);return 2*Math.min(u,1-u)}))}steyx(e,t){return this.runFunction(e.args,t,this.metadata("STEYX"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;const o=r[0].length;return o<=2?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.ThreeValues):Math.sqrt(((0,i.sumsqerr)(r[0])-Math.pow((0,i.covariance)(r[0],r[1])*(o-1),2)/(0,i.sumsqerr)(r[1]))/(o-2))}))}slope(e,t){return this.runFunction(e.args,t,this.metadata("SLOPE"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;const o=r[0].length;return o<=1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues):(0,i.covariance)(r[0],r[1])*(o-1)/(0,i.sumsqerr)(r[1])}))}chisqtest(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.TEST"),((e,t)=>{const r=e.height(),o=e.width();if(t.height()!==r||t.width()!==o)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const a=u(e,t);if(a instanceof n.CellError)return a;if(a[0].length<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);let l=0;for(let e=0;e<a[0].length;e++){if(0===a[1][e])return new n.CellError(n.ErrorType.DIV_BY_ZERO);l+=Math.pow(a[0][e]-a[1][e],2)/a[1][e]}return l<0?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NaN):1-i.chisquare.cdf(l,r>1&&o>1?(r-1)*(o-1):r*o-1)}))}ttest(e,t){return this.runFunction(e.args,t,this.metadata("T.TEST"),((e,t,r,o)=>{const a=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),l=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(a instanceof n.CellError)return a;if(l instanceof n.CellError)return l;const u=a.length,h=l.length;if(1===o){if(h!==u)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);if(u<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);const e=Array(u);for(let t=0;t<u;t++)e[t]=a[t]-l[t];const t=(0,i.stdev)(e,!0);if(0===t)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const o=Math.abs(Math.sqrt(u)*(0,i.mean)(e)/t);return r*(1-i.studentt.cdf(o,u-1))}if(2===o){if(u<=1||h<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);const e=((0,i.sumsqerr)(a)+(0,i.sumsqerr)(l))/(u+h-2);if(0===e)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const t=Math.abs(((0,i.mean)(a)-(0,i.mean)(l))/Math.sqrt(e*(1/u+1/h)));return r*(1-i.studentt.cdf(t,u+h-2))}{if(u<=1||h<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);const e=(0,i.variance)(a,!0),t=(0,i.variance)(l,!0);if(0===e&&0===t)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const o=Math.abs(((0,i.mean)(a)-(0,i.mean)(l))/Math.sqrt(e/u+t/h)),c=Math.pow(e/u+t/h,2)/(Math.pow(e/u,2)/(u-1)+Math.pow(t/h,2)/(h-1));return r*(1-i.studentt.cdf(o,c))}}))}skew(e,t){return this.runFunction(e.args,t,this.metadata("SKEW"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;const r=t.length;if(r<3)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.ThreeValues);const o=(0,i.mean)(t),a=(0,i.stdev)(t,!0);return 0===a?new n.CellError(n.ErrorType.DIV_BY_ZERO):t.reduce(((e,t)=>e+Math.pow((t-o)/a,3)),0)*r/(r-1)/(r-2)}))}skewp(e,t){return this.runFunction(e.args,t,this.metadata("SKEW.P"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;const r=t.length;if(r<3)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.ThreeValues);const o=(0,i.mean)(t),a=(0,i.stdev)(t,!1);return 0===a?new n.CellError(n.ErrorType.DIV_BY_ZERO):t.reduce(((e,t)=>e+Math.pow((t-o)/a,3)),0)/r}))}}function u(e,t){const r=e.iterateValuesFromTopLeftCorner(),s=t.iterateValuesFromTopLeftCorner();let i,a;const l=[],u=[];for(;i=r.next(),a=s.next(),!i.done&&!a.done;){const e=i.value,t=a.value;if(e instanceof n.CellError)return e;if(t instanceof n.CellError)return t;(0,o.isExtendedNumber)(e)&&(0,o.isExtendedNumber)(t)&&(l.push((0,o.getRawValue)(e)),u.push((0,o.getRawValue)(t)))}return[l,u]}l.implementedFunctions={AVEDEV:{method:"avedev",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},DEVSQ:{method:"devsq",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},GEOMEAN:{method:"geomean",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},HARMEAN:{method:"harmean",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},CORREL:{method:"correl",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},RSQ:{method:"rsq",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"COVARIANCE.P":{method:"covariancep",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"COVARIANCE.S":{method:"covariances",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"Z.TEST":{method:"ztest",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0}]},"F.TEST":{method:"ftest",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},STEYX:{method:"steyx",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},SLOPE:{method:"slope",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"CHISQ.TEST":{method:"chisqtest",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"T.TEST":{method:"ttest",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.INTEGER,minValue:1,maxValue:2},{argumentType:a.FunctionArgumentType.INTEGER,minValue:1,maxValue:3}]},SKEW:{method:"skew",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},"SKEW.P":{method:"skewp",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1}},l.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"}},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0;var s=F(r(197));t.CellCoords=s.CellCoords,t.CellRange=s.CellRange;var o,i,a,l,u,h=r(620),c=F(r(457)),d=r(543),p=n(r(920)),g=n(r(690)),m=F(r(458)),f=F(r(444)),y=F(r(446)),E=F(r(542)),C=F(r(663)),T=F(r(490)),R=F(r(445)),w=F(r(305)),S=F(r(461)),v=F(r(447)),A=F(r(303)),N=F(r(451)),O=F(r(302)),M=F(r(452)),b=r(453),I=r(464),_=r(465),x=r(591),P=r(459),L=r(688);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(D=function(e){return e?r:t})(e)}function F(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=D(t);if(r&&r.has(e))return r.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=s?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(0,h.registerAllModules)(),(0,p.default)(s.default),s.default.__GhostTable=g.default,s.default._getListenersCounter=c.getListenersCounter,s.default._getRegisteredMapsCounter=d.getRegisteredMapsCounter,s.default.EventManager=c.default;const k=[f,y,E,C,T,R,w,S,v,A,N,m],H=[O,M];s.default.helper={},s.default.dom={},f.arrayEach(k,(e=>{f.arrayEach(Object.getOwnPropertyNames(e),(t=>{"_"!==t.charAt(0)&&(s.default.helper[t]=e[t])}))})),f.arrayEach(H,(e=>{f.arrayEach(Object.getOwnPropertyNames(e),(t=>{"_"!==t.charAt(0)&&(s.default.dom[t]=e[t])}))})),s.default.cellTypes=null!==(o=s.default.cellTypes)&&void 0!==o?o:{},f.arrayEach((0,x.getRegisteredCellTypeNames)(),(e=>{s.default.cellTypes[e]=(0,x.getCellType)(e)})),s.default.cellTypes.registerCellType=x.registerCellType,s.default.cellTypes.getCellType=x.getCellType,s.default.editors=null!==(i=s.default.editors)&&void 0!==i?i:{},f.arrayEach((0,b.getRegisteredEditorNames)(),(e=>{s.default.editors[`${A.toUpperCaseFirst(e)}Editor`]=(0,b.getEditor)(e)})),s.default.editors.registerEditor=b.registerEditor,s.default.editors.getEditor=b.getEditor,s.default.renderers=null!==(a=s.default.renderers)&&void 0!==a?a:{},f.arrayEach((0,I.getRegisteredRendererNames)(),(e=>{const t=(0,I.getRenderer)(e);"base"===e&&(s.default.renderers.cellDecorator=t),s.default.renderers[`${A.toUpperCaseFirst(e)}Renderer`]=t})),s.default.renderers.registerRenderer=I.registerRenderer,s.default.renderers.getRenderer=I.getRenderer,s.default.validators=null!==(l=s.default.validators)&&void 0!==l?l:{},f.arrayEach((0,_.getRegisteredValidatorNames)(),(e=>{s.default.validators[`${A.toUpperCaseFirst(e)}Validator`]=(0,_.getValidator)(e)})),s.default.validators.registerValidator=_.registerValidator,s.default.validators.getValidator=_.getValidator,s.default.plugins=null!==(u=s.default.plugins)&&void 0!==u?u:{},f.arrayEach((0,P.getPluginsNames)(),(e=>{s.default.plugins[e]=(0,P.getPlugin)(e)})),s.default.plugins[`${A.toUpperCaseFirst(L.BasePlugin.PLUGIN_KEY)}Plugin`]=L.BasePlugin,s.default.plugins.registerPlugin=P.registerPlugin,s.default.plugins.getPlugin=P.getPlugin;var U=s.default;t.default=U},e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0,r(198),r(199),r(200),r(201);var s=n(r(202)),o=r(540),i=r(584),a=n(r(454)),l=r(563),u=r(591),h=r(606),c=r(610),d=r(476);function p(e,t){const r=new s.default(e,t||{},o.rootInstanceSymbol);return r.init(),r}t.CellCoords=d.CellCoords,t.CellRange=d.CellRange,(0,u.registerCellType)(h.TextCellType),p.editors={BaseEditor:c.BaseEditor},p.Core=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new s.default(e,t,o.rootInstanceSymbol)},p.DefaultSettings=(0,i.metaSchemaFactory)(),p.hooks=a.default.getSingleton(),p.CellCoords=d.CellCoords,p.CellRange=d.CellRange,p.packageName="handsontable",p.buildDate="11/08/2023 09:54:43",p.version="13.1.0-next-f6ea50b-20230811",p.languages={dictionaryKeys:l.dictionaryKeys,getLanguageDictionary:l.getLanguageDictionary,getLanguagesDictionaries:l.getLanguagesDictionaries,registerLanguageDictionary:l.registerLanguageDictionary,getTranslatedPhrase:l.getTranslatedPhrase};var g=p;t.default=g},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0,t.default=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],L=!1,D=this;const F=new u.default(D);let k,H,U,V,B=!0;(0,S.hasValidParameter)(n)&&(0,S.registerAsRootInstance)(this);this.rootElement=e,this.rootDocument=e.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const W=null!==(r=null==t?void 0:t.layoutDirection)&&void 0!==r?r:"inherit",G=["rtl","ltr"].includes(W)?W:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",G),this.isRtl=function(){return"rtl"===G},this.isLtr=function(){return!D.isRtl()},this.getDirectionFactor=function(){return D.isLtr()?1:-1},t.language=(0,N.getValidLanguageCode)(t.language);const Y=new b.MetaManager(D,t,[b.DynamicCellMetaMod,b.ExtendMetaPropertiesMod]),j=Y.getTableMeta(),z=Y.getGlobalMeta(),$=(0,I.createUniqueMap)();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),(0,S.isRootInstance)(this)&&(0,i._injectProductInfo)(t.licenseKey,e);this.guid=`ht_${(0,y.randomString)()}`,this.columnIndexMapper=new w.IndexMapper,this.rowIndexMapper=new w.IndexMapper,this.columnIndexMapper.addLocalHook("indexesSequenceChange",(e=>{D.runHooks("afterColumnSequenceChange",e)})),this.rowIndexMapper.addLocalHook("indexesSequenceChange",(e=>{D.runHooks("afterRowSequenceChange",e)})),H=new T.default(D),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid);const K=e=>{const{row:t,col:r}=e;return D._createCellCoords(t>=0?D.rowIndexMapper.getRenderableFromVisualIndex(t):t,r>=0?D.columnIndexMapper.getRenderableFromVisualIndex(r):r)};let X=new M.Selection(j,{rowIndexMapper:()=>D.rowIndexMapper,columnIndexMapper:()=>D.columnIndexMapper,countCols:()=>D.countCols(),countRows:()=>D.countRows(),propToCol:e=>k.propToCol(e),isEditorOpened:()=>!!D.getActiveEditor()&&D.getActiveEditor().isOpened(),countColsTranslated:()=>this.view.countRenderableColumns(),countRowsTranslated:()=>this.view.countRenderableRows(),getShortcutManager:()=>D.getShortcutManager(),createCellCoords:(e,t)=>D._createCellCoords(e,t),createCellRange:(e,t,r)=>D._createCellRange(e,t,r),visualToRenderableCoords:K,renderableToVisualCoords:e=>{const{row:t,col:r}=e;return D._createCellCoords(t>=0?D.rowIndexMapper.getVisualFromRenderableIndex(t):t,r>=0?D.columnIndexMapper.getVisualFromRenderableIndex(r):r)},isDisabledCellSelection:(e,t)=>D.getCellMeta(e,t).disableVisualSelection});this.selection=X;const q=e=>{let{hiddenIndexesChanged:t}=e;t&&this.selection.refresh()};function Q(e){const t=(0,O.normalizeLanguageCode)(e);(0,N.hasLanguageDictionary)(t)?(D.runHooks("beforeLanguageChange",t),z.language=t,D.runHooks("afterLanguageChange",t)):(0,O.warnUserAboutLanguageRegistration)(e)}function Z(e,t){const r="className"===e?D.rootElement:D.table;if(B)(0,s.addClass)(r,t);else{let n=[],o=[];z[e]&&(n=Array.isArray(z[e])?z[e]:(0,c.stringToArray)(z[e])),t&&(o=Array.isArray(t)?t:(0,c.stringToArray)(t));const i=(0,c.getDifferenceOfArrays)(n,o),a=(0,c.getDifferenceOfArrays)(o,n);i.length&&(0,s.removeClass)(r,i),a.length&&(0,s.addClass)(r,a)}z[e]=t}function J(){let e=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,e=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){0===this.validatorsInQueue&&!1===e&&(e=!0,this.onQueueEmpty(this.valid))}}}function ee(e){const t=e.replace(",",".");return!1===isNaN(parseFloat(t))?parseFloat(t):e}function te(e,t,r){if(!e.length)return;const n=D.getActiveEditor(),o=new J;let i=!0;o.onQueueEmpty=e=>{n&&i&&n.cancelChanges(),r(e)};for(let r=e.length-1;r>=0;r--){const[n,a,,l]=e[r],u=k.propToCol(a),h=D.getCellMeta(n,u);"numeric"===h.type&&"string"==typeof l&&(0,E.isNumericLike)(l)&&(e[r][3]=ee(l)),D.getCellValidator(h)&&(o.addValidatorToQueue(),D.validateCell(e[r][3],h,function(t,r){return function(n){if("boolean"!=typeof n)throw new Error("Validation error: result is not boolean");if(!1===n&&!1===r.allowInvalid){i=!1,e.splice(t,1),r.valid=!0;const n=D.getCell(r.visualRow,r.visualCol);null!==n&&(0,s.removeClass)(n,j.invalidCellClassName)}o.removeValidatorFormQueue()}}(r,h),t))}o.checkIfQueueIsEmpty()}function re(e,t){let r=e.length-1;if(r<0)return;for(;r>=0;r--){let n=!1;if(null!==e[r]){if(null!==e[r][2]&&void 0!==e[r][2]||null!==e[r][3]&&void 0!==e[r][3]){if(j.allowInsertRow)for(;e[r][0]>D.countRows()-1;){const{delta:e}=k.createRow(void 0,void 0,{source:t});if(0===e){n=!0;break}}if("array"===D.dataType&&(!j.columns||0===j.columns.length)&&j.allowInsertColumn)for(;k.propToCol(e[r][1])>D.countCols()-1;){const{delta:e}=k.createCol(void 0,void 0,{source:t});if(0===e){n=!0;break}}n||k.set(e[r][0],e[r][1],e[r][3])}}else e.splice(r,1)}D.forceFullRender=!0,U.adjustRowsAndCols(),D.runHooks("beforeChangeRender",e,t),V.lockEditor(),D._refreshBorders(null),V.unlockEditor(),D.view.adjustElementsSize(),D.runHooks("afterChange",e,t||"edit");const n=D.getActiveEditor();n&&(0,i.isDefined)(n.refreshValue)&&n.refreshValue()}function ne(e,t,r){return Array.isArray(e)?e:[[e,t,r]]}function se(e,t){const r=D.getActiveEditor(),n=D.runHooks("beforeChange",e,t||"edit"),s=e.filter((e=>null!==e));return!1===n||0===s.length?(r&&r.cancelChanges(),[]):s}this.columnIndexMapper.addLocalHook("cacheUpdated",q),this.rowIndexMapper.addLocalHook("cacheUpdated",q),this.selection.addLocalHook("beforeSetRangeStart",(e=>{this.runHooks("beforeSetRangeStart",e)})),this.selection.addLocalHook("beforeSetRangeStartOnly",(e=>{this.runHooks("beforeSetRangeStartOnly",e)})),this.selection.addLocalHook("beforeSetRangeEnd",(e=>{this.runHooks("beforeSetRangeEnd",e),e.row<0&&(e.row=this.view._wt.wtTable.getFirstVisibleRow()),e.col<0&&(e.col=this.view._wt.wtTable.getFirstVisibleColumn())})),this.selection.addLocalHook("afterSetRangeEnd",(e=>{const t=(0,h.createObjectPropListener)(!1),r=this.selection.getSelectedRange(),{from:n,to:o}=r.current(),i=r.size()-1;this.runHooks("afterSelection",n.row,n.col,o.row,o.col,t,i),this.runHooks("afterSelectionByProp",n.row,D.colToProp(n.col),o.row,D.colToProp(o.col),t,i);const a=this.selection.isSelectedByAnyHeader(),l=this.selection.selectedRange.current();let u=!0;L&&(u=!1),t.isTouched()&&(u=!t.value);const c=this.selection.isSelectedByRowHeader(),d=this.selection.isSelectedByColumnHeader();!1!==u&&(a?c?this.view.scrollViewportVertically(D.rowIndexMapper.getRenderableFromVisualIndex(e.row)):d&&this.view.scrollViewportHorizontally(D.columnIndexMapper.getRenderableFromVisualIndex(e.col)):l&&!this.selection.isMultiple()?this.view.scrollViewport(K(l.from)):this.view.scrollViewport(K(e))),c&&d?(0,s.addClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]):c?((0,s.removeClass)(this.rootElement,"ht__selection--columns"),(0,s.addClass)(this.rootElement,"ht__selection--rows")):d?((0,s.removeClass)(this.rootElement,"ht__selection--rows"),(0,s.addClass)(this.rootElement,"ht__selection--columns")):(0,s.removeClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this._refreshBorders(null)})),this.selection.addLocalHook("afterSelectionFinished",(e=>{const t=e.length-1,{from:r,to:n}=e[t];this.runHooks("afterSelectionEnd",r.row,r.col,n.row,n.col,t),this.runHooks("afterSelectionEndByProp",r.row,D.colToProp(r.col),n.row,D.colToProp(n.col),t)})),this.selection.addLocalHook("afterIsMultipleSelection",(e=>{const t=this.runHooks("afterIsMultipleSelection",e.value);e.value&&(e.value=t)})),this.selection.addLocalHook("beforeModifyTransformStart",(e=>{this.runHooks("modifyTransformStart",e)})),this.selection.addLocalHook("afterModifyTransformStart",((e,t,r)=>{this.runHooks("afterModifyTransformStart",e,t,r)})),this.selection.addLocalHook("beforeModifyTransformEnd",(e=>{this.runHooks("modifyTransformEnd",e)})),this.selection.addLocalHook("afterModifyTransformEnd",((e,t,r)=>{this.runHooks("afterModifyTransformEnd",e,t,r)})),this.selection.addLocalHook("afterDeselect",(()=>{V.destroyEditor(),this._refreshBorders(),(0,s.removeClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")})),this.selection.addLocalHook("insertRowRequire",(e=>{this.alter("insert_row_above",e,1,"auto")})),this.selection.addLocalHook("insertColRequire",(e=>{this.alter("insert_col_start",e,1,"auto")})),U={alter(e,t){var r,n;let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;const l=e=>{if(0===e.length)return[];const t=[...e];t.sort(((e,t)=>{let[r]=e,[n]=t;return r===n?0:r>n?1:-1}));return(0,c.arrayReduce)(t,((e,t)=>{let[r,n]=t;const s=e[e.length-1],[o,i]=s,a=o+i;if(r<=a){const e=Math.max(n-(a-r),0);s[1]+=e}else e.push([r,n]);return e}),[t[0]])};switch(e){case"insert_row_below":case"insert_row_above":const a=D.countSourceRows();if(j.maxRows===a)return;const u="insert_row_below"===e?"below":"above";t=null!==(r=t)&&void 0!==r?r:"below"===u?a:0;const{delta:h,startPhysicalIndex:d}=k.createRow(t,s,{source:o,mode:u});if(h){const e=X.selectedRange.current(),t=null==e?void 0:e.from,r=null==t?void 0:t.row,n=D.toVisualRow(d);if(X.isSelectedByCorner())D.selectAll();else if((0,i.isDefined)(r)&&r>=n){const{row:n,col:s}=e.to;let o=t.col;X.isSelectedByRowHeader()&&(o=-1),X.getSelectedRange().pop(),X.setRangeStartOnly(D._createCellCoords(r+h,o),!0),X.setRangeEnd(D._createCellCoords(n+h,s))}else D._refreshBorders()}break;case"insert_col_start":case"insert_col_end":const p="insert_col_end"===e?"end":"start";t=null!==(n=t)&&void 0!==n?n:"end"===p?D.countSourceCols():0;const{delta:g,startPhysicalIndex:m}=k.createCol(t,s,{source:o,mode:p});if(g){if(Array.isArray(j.colHeaders)){const e=[D.toVisualColumn(m),0];e.length+=g,Array.prototype.splice.apply(j.colHeaders,e)}const e=X.selectedRange.current(),t=null==e?void 0:e.from,r=null==t?void 0:t.col,n=D.toVisualColumn(m);if(X.isSelectedByCorner())D.selectAll();else if((0,i.isDefined)(r)&&r>=n){const{row:n,col:s}=e.to;let o=t.row;X.isSelectedByColumnHeader()&&(o=-1),X.getSelectedRange().pop(),X.setRangeStartOnly(D._createCellCoords(o,r+g),!0),X.setRangeEnd(D._createCellCoords(n,s+g))}else D._refreshBorders()}break;case"remove_row":const f=e=>{let t=0;(0,c.arrayEach)(e,(e=>{let[r,n]=e;const s=(0,i.isEmpty)(r)?D.countRows()-1:Math.max(r-t,0);Number.isInteger(r)&&(r=Math.max(r-t,0));if(!k.removeRow(r,n,o))return;const a=D.countRows(),l=j.fixedRowsTop;l>=s+1&&(j.fixedRowsTop-=Math.min(n,l-s));const u=j.fixedRowsBottom;u&&s>=a-u&&(j.fixedRowsBottom-=Math.min(n,u)),t+=n}))};Array.isArray(t)?f(l(t)):f([[t,s]]),U.adjustRowsAndCols(),D._refreshBorders();break;case"remove_col":const y=e=>{let t=0;(0,c.arrayEach)(e,(e=>{let[r,n]=e;const s=(0,i.isEmpty)(r)?D.countCols()-1:Math.max(r-t,0);let a=D.toPhysicalColumn(s);Number.isInteger(r)&&(r=Math.max(r-t,0));if(!k.removeCol(r,n,o))return;const l=j.fixedColumnsStart;l>=s+1&&(j.fixedColumnsStart-=Math.min(n,l-s)),Array.isArray(j.colHeaders)&&(void 0===a&&(a=-1),j.colHeaders.splice(a,n)),t+=n}))};Array.isArray(t)?y(l(t)):y([[t,s]]),U.adjustRowsAndCols(),D._refreshBorders();break;default:throw new Error(`There is no such action "${e}"`)}a||U.adjustRowsAndCols()},adjustRowsAndCols(){const e=j.minRows,t=j.minSpareRows,r=j.minCols,n=j.minSpareCols;if(0===D.countRows()&&0===D.countCols()&&X.deselect(),e){const t=D.countRows();t<e&&k.createRow(t,e-t,{source:"auto"})}if(t){const e=D.countEmptyRows(!0);if(e<t){const r=t-e,n=Math.min(r,j.maxRows-D.countSourceRows());k.createRow(D.countRows(),n,{source:"auto"})}}{let e;(r||n)&&(e=D.countEmptyCols(!0));let t=D.countCols();if(r&&!j.columns&&t<r){const n=r-t;e+=n,k.createCol(t,n,{source:"auto"})}if(n&&!j.columns&&"array"===D.dataType&&e<n){t=D.countCols();const r=n-e,s=Math.min(r,j.maxCols-t);k.createCol(t,s,{source:"auto"})}}if(X.isSelected()){const e=D.countRows(),t=D.countCols();(0,c.arrayEach)(X.selectedRange,(r=>{let n=!1,s=r.from.row,o=r.from.col,i=r.to.row,a=r.to.col;s>e-1?(s=e-1,n=!0,i>s&&(i=s)):i>e-1&&(i=e-1,n=!0,s>i&&(s=i)),o>t-1?(o=t-1,n=!0,a>o&&(a=o)):a>t-1&&(a=t-1,n=!0,o>a&&(o=a)),n&&D.selectCell(s,o,i,a)}))}D.view&&D.view.adjustElementsSize()},populateFromArray(e,t,r,n,s){let o,i,a,l;const u=[],d={},p=[],g=e.row,m=e.col;if(i=t.length,0===i)return!1;let f=0,y=0;switch((0,h.isObject)(r)&&(f=r.col-m+1,y=r.row-g+1),s){case"shift_down":const s=(0,c.pivot)(t),E=s.length,C=Math.max(E,f),T=D.getData().slice(g),R=(0,c.pivot)(T).slice(m,m+C);for(a=0;a<C;a+=1)if(a<E){for(o=0,i=s[a].length;o<y-i;o+=1)s[a].push(s[a][o%i]);a<R.length?p.push(s[a].concat(R[a])):p.push(s[a].concat(new Array(T.length).fill(null)))}else p.push(s[a%E].concat(R[a]));D.populateFromArray(g,m,(0,c.pivot)(p));break;case"shift_right":const w=t.length,S=Math.max(w,y),v=D.getData().slice(g).map((e=>e.slice(m)));for(o=0;o<S;o+=1)if(o<w){for(a=0,l=t[o].length;a<f-l;a+=1)t[o].push(t[o][a%l]);if(o<v.length)for(let e=0;e<v[o].length;e+=1)t[o].push(v[o][e]);else t[o].push(...new Array(v[0].length).fill(null))}else t.push(t[o%i].slice(0,S).concat(v[o]));D.populateFromArray(g,m,t);break;default:d.row=e.row,d.col=e.col;let A,N=0,O=0,M=!0;const b=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=t[e%t.length];return null!==r?n[r%n.length]:n},I=t.length,_=r?r.row-e.row+1:0;for(i=r?_:Math.max(I,_),o=0;o<i&&!(r&&d.row>r.row&&_>I||!j.allowInsertRow&&d.row>D.countRows()-1||d.row>=j.maxRows);o++){const t=o-N,s=b(t).length,c=r?r.col-e.col+1:0;if(l=r?c:Math.max(s,c),d.col=e.col,A=D.getCellMeta(d.row,d.col),"CopyPaste.paste"!==n&&"Autofill.fill"!==n||!A.skipRowOnPaste){for(O=0,a=0;a<l&&!(r&&d.col>r.col&&c>s||!j.allowInsertColumn&&d.col>D.countCols()-1||d.col>=j.maxCols);a++){if(A=D.getCellMeta(d.row,d.col),("CopyPaste.paste"===n||"Autofill.fill"===n)&&A.skipColumnOnPaste){O+=1,d.col+=1,l+=1;continue}if(A.readOnly&&"UndoRedo.undo"!==n){d.col+=1;continue}let e=b(t,a-O),r=D.getDataAtCell(d.row,d.col);if(null!==e&&"object"==typeof e)if(Array.isArray(e)&&null===r&&(r=[]),null===r||"object"!=typeof r)M=!1;else{const t=(0,h.duckSchema)(Array.isArray(r)?r:r[0]||r),n=(0,h.duckSchema)(Array.isArray(e)?e:e[0]||e);(0,h.isObjectEqual)(t,n)||Array.isArray(t)&&Array.isArray(n)?e=(0,h.deepClone)(e):M=!1}else null!==r&&"object"==typeof r&&(M=!1);M&&u.push([d.row,d.col,e]),M=!0,d.col+=1}d.row+=1}else N+=1,d.row+=1,i+=1}D.setDataAtCell(u,null,null,n||"populateFromArray")}}},this.init=function(){H.setData(j.data),D.runHooks("beforeInit"),((0,a.isMobileBrowser)()||(0,a.isIpadOS)())&&(0,s.addClass)(D.rootElement,"mobile"),this.updateSettings(j,!0),this.view=new C.default(this),V=l.default.getInstance(D,j,X),D.runHooks("init"),this.forceFullRender=!0,this.view.render(),B&&null===D.rootElement.offsetParent&&(0,s.observeVisibilityChangeOnce)(D.rootElement,(()=>{D.view._wt.wtOverlays.updateLastSpreaderSize(),D.render(),D.view.adjustElementsSize()})),"object"==typeof B&&(D.runHooks("afterChange",B[0],B[1]),B=!1),D.runHooks("afterInit")},this._createCellCoords=function(e,t){return D.view._wt.createCellCoords(e,t)},this._createCellRange=function(e,t,r){return D.view._wt.createCellRange(e,t,r)},this.validateCell=function(e,t,r,n){let s=D.getCellValidator(t);function a(e){if(!(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])||!0===t.hidden)return void r(e);const n=t.visualCol,s=t.visualRow,o=D.getCell(s,n,!0);if(o&&"TH"!==o.nodeName){const e=D.rowIndexMapper.getRenderableFromVisualIndex(s),t=D.columnIndexMapper.getRenderableFromVisualIndex(n);D.view._wt.getSetting("cellRenderer",e,t,o)}r(e)}var l;(0,i.isRegExp)(s)&&(l=s,s=function(e,t){t(l.test(e))}),(0,o.isFunction)(s)?(e=D.runHooks("beforeValidate",e,t.visualRow,t.prop,n),D._registerImmediate((()=>{s.call(t,e,(r=>{D&&(r=D.runHooks("afterValidate",r,e,t.visualRow,t.prop,n),t.valid=r,a(r),D.runHooks("postAfterValidate",r,e,t.visualRow,t.prop,n))}))}))):D._registerImmediate((()=>{t.valid=!0,a(t.valid,!1)}))},this.setDataAtCell=function(e,t,r,n){const s=ne(e,t,r),o=[];let i,a,l,u=n;for(i=0,a=s.length;i<a;i++){if("object"!=typeof s[i])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof s[i][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");l=s[i][1]>=this.countCols()?s[i][1]:k.colToProp(s[i][1]),o.push([s[i][0],l,H.getAtCell(this.toPhysicalRow(s[i][0]),s[i][1]),s[i][2]])}u||"object"!=typeof e||(u=t);const h=se(o,n);D.runHooks("afterSetDataAtCell",h,u),te(h,u,(()=>{re(h,u)}))},this.setDataAtRowProp=function(e,t,r,n){const s=ne(e,t,r),o=[];let i,a,l=n;for(i=0,a=s.length;i<a;i++)o.push([s[i][0],s[i][1],H.getAtCell(this.toPhysicalRow(s[i][0]),s[i][1]),s[i][2]]);l||"object"!=typeof e||(l=t);const u=se(o,n);D.runHooks("afterSetDataAtRowProp",u,l),te(u,l,(()=>{re(u,l)}))},this.listen=function(){D&&!D.isListening()&&(P=D.guid,D.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(P=null,D.runHooks("afterUnlisten"))},this.isListening=function(){return P===D.guid},this.destroyEditor=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];D._refreshBorders(e,t)},this.populateFromArray=function(e,t,r,n,s,o,i){if("object"!=typeof r||"object"!=typeof r[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");const a="number"==typeof n?D._createCellCoords(n,s):null;return U.populateFromArray(D._createCellCoords(e,t),r,a,o,i)},this.spliceCol=function(e,t,r){for(var n=arguments.length,s=new Array(n>3?n-3:0),o=3;o<n;o++)s[o-3]=arguments[o];return k.spliceCol(e,t,r,...s)},this.spliceRow=function(e,t,r){for(var n=arguments.length,s=new Array(n>3?n-3:0),o=3;o<n;o++)s[o-3]=arguments[o];return k.spliceRow(e,t,r,...s)},this.getSelected=function(){if(X.isSelected())return(0,c.arrayMap)(X.getSelectedRange(),(e=>{let{from:t,to:r}=e;return[t.row,t.col,r.row,r.col]}))},this.getSelectedLast=function(){const e=this.getSelected();let t;return e&&e.length>0&&(t=e[e.length-1]),t},this.getSelectedRange=function(){if(X.isSelected())return Array.from(X.getSelectedRange())},this.getSelectedRangeLast=function(){const e=this.getSelectedRange();let t;return e&&e.length>0&&(t=e[e.length-1]),t},this.emptySelectedCells=function(e){if(!X.isSelected()||0===this.countRows()||0===this.countCols())return;const t=[];(0,c.arrayEach)(X.getSelectedRange(),(e=>{const r=e.getTopStartCorner(),n=e.getBottomEndCorner();(0,E.rangeEach)(r.row,n.row,(e=>{(0,E.rangeEach)(r.col,n.col,(r=>{this.getCellMeta(e,r).readOnly||t.push([e,r,null])}))}))})),t.length>0&&this.setDataAtCell(t,e)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const e=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(e,0),this.isRenderSuspended()||e!==this.renderSuspendedCounter||(this.renderCall?this.render():this._refreshBorders(null))},this.render=function(){this.view&&(this.renderCall=!0,this.forceFullRender=!0,this.isRenderSuspended()||(V.lockEditor(),this._refreshBorders(null),V.unlockEditor()))},this.batchRender=function(e){this.suspendRender();const t=e();return this.resumeRender(),t},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(t,0),(!this.isExecutionSuspended()&&t===this.executionSuspendedCounter||e)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.suspendExecution();const r=e();return this.resumeExecution(t),r},this.batch=function(e){this.suspendRender(),this.suspendExecution();const t=e();return this.resumeExecution(),this.resumeRender(),t},this.refreshDimensions=function(){if(!D.view)return;const{width:e,height:t}=D.view.getLastSize(),{width:r,height:n}=D.rootElement.getBoundingClientRect(),s=r!==e||n!==t;!1===D.runHooks("beforeRefreshDimensions",{width:e,height:t},{width:r,height:n},s)||((s||D.view._wt.wtOverlays.scrollableElement===D.rootWindow)&&(D.view.setLastSize(r,n),D.render()),D.runHooks("afterRefreshDimensions",{width:e,height:t},{width:r,height:n},s))},this.updateData=function(e,t){(0,b.replaceData)(e,(e=>{k=e}),(e=>{k=e,D.columnIndexMapper.fitToLength(this.getInitialColumnCount()),D.rowIndexMapper.fitToLength(this.countSourceRows()),U.adjustRowsAndCols()}),{hotInstance:D,dataMap:k,dataSource:H,internalSource:"updateData",source:t,metaManager:Y,firstRun:B})},this.loadData=function(e,t){(0,b.replaceData)(e,(e=>{k=e}),(()=>{Y.clearCellsCache(),D.initIndexMappers(),U.adjustRowsAndCols(),B&&(B=[null,"loadData"])}),{hotInstance:D,dataMap:k,dataSource:H,internalSource:"loadData",source:t,metaManager:Y,firstRun:B})},this.getInitialColumnCount=function(){const e=j.columns;let t=0;if(Array.isArray(e))t=e.length;else if((0,o.isFunction)(e))if("array"===D.dataType){const r=this.countSourceCols();for(let n=0;n<r;n+=1)e(n)&&(t+=1)}else"object"!==D.dataType&&"function"!==D.dataType||(t=k.colToPropCache.length);else if((0,i.isDefined)(j.dataSchema)){const e=k.getSchema();t=Array.isArray(e)?e.length:(0,h.deepObjectSize)(e)}else t=this.countSourceCols();return t},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(e,t,r,n){return(0,i.isUndefined)(e)?k.getAll():k.getRange(D._createCellCoords(e,t),D._createCellCoords(r,n),k.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,r,n){return k.getCopyableText(D._createCellCoords(e,t),D._createCellCoords(r,n))},this.getCopyableData=function(e,t){return k.getCopyable(e,k.colToProp(t))},this.getSchema=function(){return k.getSchema()},this.updateSettings=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=(B?D.loadData:D.updateData).bind(this);let n,s,a=!1;if((0,i.isDefined)(e.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if((0,i.isDefined)(e.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if((0,i.isDefined)(e.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(n in e)"data"===n||("language"===n?Q(e.language):"className"===n?Z("className",e.className):"tableClassName"===n&&D.table?(Z("tableClassName",e.tableClassName),D.view._wt.wtOverlays.syncOverlayTableClassNames()):A.default.getSingleton().isRegistered(n)||A.default.getSingleton().isDeprecated(n)?((0,o.isFunction)(e[n])||Array.isArray(e[n]))&&(e[n].initialHook=!0,D.addHook(n,e[n])):!t&&(0,h.hasOwnProperty)(e,n)&&(z[n]=e[n]));void 0===e.data&&void 0===j.data?r(null,"updateSettings"):void 0!==e.data?r(e.data,"updateSettings"):void 0!==e.columns&&(k.createMap(),D.initIndexMappers());const l=D.countCols(),u=j.columns;if(u&&(0,o.isFunction)(u)&&(a=!0),void 0===e.cell&&void 0===e.cells&&void 0===e.columns||Y.clearCache(),l>0)for(n=0,s=0;n<l;n++){if(u){const e=a?u(n):u[s];e&&Y.updateColumnMeta(s,e)}s+=1}(0,i.isDefined)(e.cell)&&(0,h.objectEach)(e.cell,(e=>{D.setCellMetaObject(e.row,e.col,e)})),D.runHooks("afterCellMetaReset");let c=D.rootElement.style.height;""!==c&&(c=parseInt(D.rootElement.style.height,10));let d=e.height;if((0,o.isFunction)(d)&&(d=d()),t){D.rootElement.getAttribute("style")&&D.rootElement.setAttribute("data-initialstyle",D.rootElement.getAttribute("style"))}if(null===d){const e=D.rootElement.getAttribute("data-initialstyle");e&&(e.indexOf("height")>-1||e.indexOf("overflow")>-1)?D.rootElement.setAttribute("style",e):(D.rootElement.style.height="",D.rootElement.style.overflow="")}else void 0!==d&&(D.rootElement.style.height=isNaN(d)?`${d}`:`${d}px`,D.rootElement.style.overflow="hidden");if(void 0!==e.width){let t=e.width;(0,o.isFunction)(t)&&(t=t()),D.rootElement.style.width=isNaN(t)?`${t}`:`${t}px`}t||(D.view&&(D.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),D.view._wt.exportSettingsAsClassNames()),D.runHooks("afterUpdateSettings",e)),U.adjustRowsAndCols(),D.view&&!B&&(D.forceFullRender=!0,V.lockEditor(),D._refreshBorders(null),D.view._wt.wtOverlays.adjustElementsSize(),V.unlockEditor()),t||!D.view||""!==c&&""!==d&&void 0!==d||c===d||D.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const e=D.getSelectedLast();if(j.getValue){if((0,o.isFunction)(j.getValue))return j.getValue.call(D);if(e)return D.getData()[e[0][0]][j.getValue]}else if(e)return D.getDataAtCell(e[0],e[1])},this.getSettings=function(){return j},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(e,t,r,n,s){U.alter(e,t,r,n,s)},this.getCell=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t,s=e;if(t>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(t)))return null;n=this.columnIndexMapper.getRenderableFromVisualIndex(t)}if(e>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(e)))return null;s=this.rowIndexMapper.getRenderableFromVisualIndex(e)}return null===s||null===n?null:D.view.getCellAtCoords(D._createCellCoords(s,n),r)},this.getCoords=function(e){const t=this.view._wt.wtTable.getCoords(e);if(null===t)return null;const{row:r,col:n}=t;let s=r,o=n;return r>=0&&(s=this.rowIndexMapper.getVisualFromRenderableIndex(r)),n>=0&&(o=this.columnIndexMapper.getVisualFromRenderableIndex(n)),D._createCellCoords(s,o)},this.colToProp=function(e){return k.colToProp(e)},this.propToCol=function(e){return k.propToCol(e)},this.toVisualRow=e=>this.rowIndexMapper.getVisualFromPhysicalIndex(e),this.toVisualColumn=e=>this.columnIndexMapper.getVisualFromPhysicalIndex(e),this.toPhysicalRow=e=>this.rowIndexMapper.getPhysicalFromVisualIndex(e),this.toPhysicalColumn=e=>this.columnIndexMapper.getPhysicalFromVisualIndex(e),this.getDataAtCell=function(e,t){return k.get(e,k.colToProp(t))},this.getDataAtRowProp=function(e,t){return k.get(e,t)},this.getDataAtCol=function(e){const t=[],r=k.getRange(D._createCellCoords(0,e),D._createCellCoords(j.data.length-1,e),k.DESTINATION_RENDERER);for(let e=0;e<r.length;e+=1)for(let n=0;n<r[e].length;n+=1)t.push(r[e][n]);return t},this.getDataAtProp=function(e){const t=[],r=k.getRange(D._createCellCoords(0,k.propToCol(e)),D._createCellCoords(j.data.length-1,k.propToCol(e)),k.DESTINATION_RENDERER);for(let e=0;e<r.length;e+=1)for(let n=0;n<r[e].length;n+=1)t.push(r[e][n]);return t},this.getSourceData=function(e,t,r,n){let s;return s=void 0===e?H.getData():H.getByRange(D._createCellCoords(e,t),D._createCellCoords(r,n)),s},this.getSourceDataArray=function(e,t,r,n){let s;return s=void 0===e?H.getData(!0):H.getByRange(D._createCellCoords(e,t),D._createCellCoords(r,n),!0),s},this.getSourceDataAtCol=function(e){return H.getAtColumn(e)},this.setSourceDataAtCell=function(e,t,r,n){const s=ne(e,t,r),o=this.hasHook("afterSetSourceDataAtCell"),a=[];o&&(0,c.arrayEach)(s,(e=>{let[t,r,n]=e;a.push([t,r,H.getAtCell(t,r),n])})),(0,c.arrayEach)(s,(e=>{let[t,r,n]=e;H.setAtCell(t,r,n)})),o&&this.runHooks("afterSetSourceDataAtCell",a,n),this.render();const l=D.getActiveEditor();l&&(0,i.isDefined)(l.refreshValue)&&l.refreshValue()},this.getSourceDataAtRow=function(e){return H.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return H.getAtCell(e,t)},this.getDataAtRow=function(e){return k.getRange(D._createCellCoords(e,0),D._createCellCoords(e,this.countCols()-1),k.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(e,t,r,n){const s=void 0===e?[0,0,this.countRows(),this.countCols()]:[e,t,r,n],[o,i]=s;let[,,a,l]=s,u=null,h=null;void 0===a&&(a=o),void 0===l&&(l=i);let c="mixed";return(0,E.rangeEach)(Math.max(Math.min(o,a),0),Math.max(o,a),(e=>{let t=!0;return(0,E.rangeEach)(Math.max(Math.min(i,l),0),Math.max(i,l),(r=>{const n=this.getCellMeta(e,r);return h=n.type,u?t=u===h:u=h,t})),c=t?h:"mixed",t})),c},this.removeCellMeta=function(e,t,r){const[n,s]=[this.toPhysicalRow(e),this.toPhysicalColumn(t)];let o=Y.getCellMetaKeyValue(n,s,r);!1!==D.runHooks("beforeRemoveCellMeta",e,t,r,o)&&(Y.removeCellMeta(n,s,r),D.runHooks("afterRemoveCellMeta",e,t,r,o)),o=null},this.spliceCellsMeta=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(n.length>0&&!Array.isArray(n[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");t>0&&Y.removeRow(this.toPhysicalRow(e),t),n.length>0&&(0,c.arrayEach)(n.reverse(),(t=>{Y.createRow(this.toPhysicalRow(e)),(0,c.arrayEach)(t,((t,r)=>this.setCellMetaObject(e,r,t)))})),D.render()},this.setCellMetaObject=function(e,t,r){"object"==typeof r&&(0,h.objectEach)(r,((r,n)=>{this.setCellMeta(e,t,n,r)}))},this.setCellMeta=function(e,t,r,n){if(!1===D.runHooks("beforeSetCellMeta",e,t,r,n))return;let s=e,o=t;e<this.countRows()&&(s=this.toPhysicalRow(e)),t<this.countCols()&&(o=this.toPhysicalColumn(t)),Y.setCellMeta(s,o,r,n),D.runHooks("afterSetCellMeta",e,t,r,n)},this.getCellsMeta=function(){return Y.getCellsMeta()},this.getCellMeta=function(e,t){let r=this.toPhysicalRow(e),n=this.toPhysicalColumn(t);return null===r&&(r=e),null===n&&(n=t),Y.getCellMeta(r,n,{visualRow:e,visualColumn:t})},this.getCellMetaAtRow=function(e){return Y.getCellsMetaAtRow(e)},this.isColumnModificationAllowed=function(){return!("object"===D.dataType||j.columns)},this.getCellRenderer=function(e,t){const r="number"==typeof e?D.getCellMeta(e,t).renderer:e.renderer;return"string"==typeof r?(0,g.getRenderer)(r):(0,i.isUndefined)(r)?(0,g.getRenderer)("text"):r},this.getCellEditor=function(e,t){const r="number"==typeof e?D.getCellMeta(e,t).editor:e.editor;return"string"==typeof r?(0,m.getEditor)(r):(0,i.isUndefined)(r)?(0,m.getEditor)("text"):r},this.getCellValidator=function(e,t){const r="number"==typeof e?D.getCellMeta(e,t).validator:e.validator;return"string"==typeof r?(0,f.getValidator)(r):r},this.validateCells=function(e){this._validateCells(e)},this.validateRows=function(e,t){if(!Array.isArray(e))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(t,e)},this.validateColumns=function(e,t){if(!Array.isArray(e))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(t,void 0,e)},this._validateCells=function(e,t,r){const n=new J;e&&(n.onQueueEmpty=e);let s=D.countRows()-1;for(;s>=0;){if(void 0!==t&&-1===t.indexOf(s)){s-=1;continue}let e=D.countCols()-1;for(;e>=0;)void 0===r||-1!==r.indexOf(e)?(n.addValidatorToQueue(),D.validateCell(D.getDataAtCell(s,e),D.getCellMeta(s,e),(e=>{if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");!1===e&&(n.valid=!1),n.removeValidatorFormQueue()}),"validateCells"),e-=1):e-=1;s-=1}n.checkIfQueueIsEmpty()},this.getRowHeader=function(e){let t=j.rowHeaders,r=e;return void 0!==r&&(r=D.runHooks("modifyRowHeader",r)),void 0===r?(t=[],(0,E.rangeEach)(D.countRows()-1,(e=>{t.push(D.getRowHeader(e))}))):Array.isArray(t)&&void 0!==t[r]?t=t[r]:(0,o.isFunction)(t)?t=t(r):t&&"string"!=typeof t&&"number"!=typeof t&&(t=r+1),t},this.hasRowHeaders=function(){return!!j.rowHeaders},this.hasColHeaders=function(){if(void 0!==j.colHeaders&&null!==j.colHeaders)return!!j.colHeaders;for(let e=0,t=D.countCols();e<t;e++)if(D.getColHeader(e))return!0;return!1},this.getColHeader=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;const r=D.runHooks("modifyColHeader",e);if(void 0===r){const e=[],t=D.countCols();for(let r=0;r<t;r++)e.push(D.getColHeader(r));return e}let n=j.colHeaders;const s=D.toPhysicalColumn(r),i=function(e){const t=[],r=D.countCols();let n=0;for(;n<r;n++)(0,o.isFunction)(j.columns)&&j.columns(n)&&t.push(n);return t[e]}(s);return!1===j.colHeaders?n=null:j.columns&&(0,o.isFunction)(j.columns)&&j.columns(i)&&j.columns(i).title?n=j.columns(i).title:j.columns&&j.columns[s]&&j.columns[s].title?n=j.columns[s].title:Array.isArray(j.colHeaders)&&void 0!==j.colHeaders[s]?n=j.colHeaders[s]:(0,o.isFunction)(j.colHeaders)?n=j.colHeaders(s):j.colHeaders&&"string"!=typeof j.colHeaders&&"number"!=typeof j.colHeaders&&(n=(0,R.spreadsheetColumnLabel)(r)),n=D.runHooks("modifyColumnHeaderValue",n,e,t),n},this._getColWidthFromSettings=function(e){let t;if(e>=0){t=D.getCellMeta(0,e).width}if(void 0!==t&&t!==j.width||(t=j.colWidths),null!=t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getColWidth=function(e){let t=D._getColWidthFromSettings(e);return t=D.runHooks("modifyColWidth",t,e),void 0===t&&(t=v.ViewportColumnsCalculator.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){let t=j.rowHeights;if(null!=t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){let t=D._getRowHeightFromSettings(e);return t=D.runHooks("modifyRowHeight",t,e),t},this.countSourceRows=function(){return H.countRows()},this.countSourceCols=function(){return H.countFirstRowKeys()},this.countRows=function(){return k.getLength()},this.countCols=function(){const e=j.maxCols,t=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(e,t)},this.countRenderedRows=function(){return D.view._wt.drawn?D.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return D.view._wt.drawn?D.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return D.view._wt.drawn?D.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return D.view._wt.drawn?D.view._wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;return(0,E.rangeEachReverse)(D.countRows()-1,(r=>{if(D.isEmptyRow(r))t+=1;else if(!0===e)return!1})),t},this.countEmptyCols=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;return(0,E.rangeEachReverse)(D.countCols()-1,(r=>{if(D.isEmptyCol(r))t+=1;else if(!0===e)return!1})),t},this.isEmptyRow=function(e){return j.isEmptyRow.call(D,e)},this.isEmptyCol=function(e){return j.isEmptyCol.call(D,e)},this.selectCell=function(e,t,r,n){let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];return!(0,i.isUndefined)(e)&&!(0,i.isUndefined)(t)&&this.selectCells([[e,t,r,n]],s,o)},this.selectCells=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[[]],t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(L=!0);const r=X.selectCells(e);return r&&t&&D.listen(),L=!1,r},this.selectColumns=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return X.selectColumns(e,t)},this.selectRows=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return X.selectRows(e,t)},this.deselectCell=function(){X.deselect()},this.selectAll=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e&&this.hasRowHeaders(),r=e&&this.hasColHeaders();L=!0,X.selectAll(t,r),L=!1};const oe=(e,t)=>e.getNearestNotHiddenIndex(t,1,!0);this.scrollViewportTo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=!r,o=!n;let i=e,a=t;if(!(arguments.length>4&&void 0!==arguments[4])||arguments[4]){const r=Number.isInteger(e),n=Number.isInteger(t),s=r?oe(this.rowIndexMapper,e):void 0,o=n?oe(this.columnIndexMapper,t):void 0;if(null===s||null===o)return!1;i=r?D.rowIndexMapper.getRenderableFromVisualIndex(s):void 0,a=n?D.columnIndexMapper.getRenderableFromVisualIndex(o):void 0}const l=Number.isInteger(i),u=Number.isInteger(a);return l&&u?D.view.scrollViewport(D._createCellCoords(i,a),s,n,r,o):l&&!1===u?D.view.scrollViewportVertically(i,s,r):!(!u||!1!==l)&&D.view.scrollViewportHorizontally(a,n,o)},this.destroy=function(){if(D._clearTimeouts(),D._clearImmediates(),D.view&&D.view.destroy(),H&&H.destroy(),H=null,this.getShortcutManager().destroy(),Y.clearCache(),(0,S.isRootInstance)(D)){const e=this.rootDocument.querySelector(".hot-display-license-info");e&&e.parentNode.removeChild(e)}(0,s.empty)(D.rootElement),F.destroy(),V&&V.destroy(),D.batchExecution((()=>{D.rowIndexMapper.unregisterAll(),D.columnIndexMapper.unregisterAll(),$.getItems().forEach((e=>{let[,t]=e;t.destroy()})),$.clear(),D.runHooks("afterDestroy")}),!0),A.default.getSingleton().destroy(D),(0,h.objectEach)(D,((e,t,r)=>{var n;(0,o.isFunction)(e)?r[t]=(n=t,()=>{throw new Error(`The "${n}" method cannot be called because this Handsontable instance has been destroyed`)}):"guid"!==t&&(r[t]=null)})),D.isDestroyed=!0,k&&k.destroy(),k=null,U=null,X=null,V=null,D=null},this.getActiveEditor=function(){return V.getActiveEditor()},this.getPlugin=function(e){const t=(0,y.toUpperCaseFirst)(e);return"UndoRedo"===t?this.undoRedo:$.getItem(t)},this.getPluginName=function(e){return e===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:$.getId(e)},this.getInstance=function(){return D},this.addHook=function(e,t){A.default.getSingleton().add(e,t,D)},this.hasHook=function(e){return A.default.getSingleton().has(e,D)||A.default.getSingleton().has(e)},this.addHookOnce=function(e,t){A.default.getSingleton().once(e,t,D)},this.removeHook=function(e,t){A.default.getSingleton().remove(e,t,D)},this.runHooks=function(e,t,r,n,s,o,i){return A.default.getSingleton().run(D,e,t,r,n,s,o,i)},this.getTranslatedPhrase=function(e,t){return(0,N.getTranslatedPhrase)(j.language,e,t)},this.toHTML=()=>(0,d.instanceToHTML)(this),this.toTableElement=()=>{const e=this.rootDocument.createElement("div");return e.insertAdjacentHTML("afterbegin",(0,d.instanceToHTML)(this)),e.firstElementChild},this.timeouts=[],this._registerTimeout=function(e){let t=e;"function"==typeof t&&(t=setTimeout(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)),this.timeouts.push(t)},this._clearTimeouts=function(){(0,c.arrayEach)(this.timeouts,(e=>{clearTimeout(e)}))},this.immediates=[],this._registerImmediate=function(e){this.immediates.push(setImmediate(e))},this._clearImmediates=function(){(0,c.arrayEach)(this.immediates,(e=>{clearImmediate(e)}))},this._refreshBorders=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];V.destroyEditor(e),D.view.render(),t&&X.isSelected()&&V.prepareEditor()},this.isRtl=function(){return"rtl"===D.rootWindow.getComputedStyle(D.rootElement).direction},this.isLtr=function(){return!D.isRtl()},this.getDirectionFactor=function(){return D.isLtr()?1:-1};const ie=(0,_.createShortcutManager)({handleEvent(e){const t=D.isListening(),r=void 0!==(null==e?void 0:e.key);return t&&r},beforeKeyDown:e=>this.runHooks("beforeKeyDown",e),afterKeyDown:e=>{this.isDestroyed||D.runHooks("afterDocumentKeyDown",e)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",(e=>{!1===e.ctrlKey&&!1===e.metaKey&&ie.releasePressedKeys()})),this.getShortcutManager=function(){return ie};const ae=ie.addContext("grid"),le={runOnlyIf:()=>(0,i.isDefined)(D.getSelected())&&D.countRenderedRows()>0&&D.countRenderedCols()>0,group:x};ie.setActiveContextName("grid"),ae.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>{D.selectAll()}},{keys:[["Control/Meta","Enter"]],callback:()=>{const e=D.getSelectedRange(),{row:t,col:r}=e[e.length-1].highlight,n=D.getDataAtCell(t,r),s=new Map;for(let o=0;o<e.length;o++)e[o].forAll(((e,o)=>{if(e>=0&&o>=0&&(e!==t||o!==r)){const{readOnly:t}=D.getCellMeta(e,o);t||s.set(`${e}x${o}`,[e,o,n])}}));D.setDataAtCell(Array.from(s.values()))},runOnlyIf:()=>D.getSelectedRangeLast().getCellsCount()>1},{keys:[["ArrowUp"]],callback:()=>{X.transformStart(-1,0)}},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>{X.setRangeStart(D._createCellCoords(D.rowIndexMapper.getNearestNotHiddenIndex(0,1),D.getSelectedRangeLast().highlight.col))}},{keys:[["ArrowUp","Shift"]],callback:()=>{X.transformEnd(-1,0)}},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>{const{from:e,to:t}=D.getSelectedRangeLast(),r=D.rowIndexMapper.getNearestNotHiddenIndex(0,1);X.setRangeStart(e.clone()),X.setRangeEnd(D._createCellCoords(r,t.col))},runOnlyIf:()=>!(D.selection.isSelectedByCorner()||D.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>{X.transformStart(1,0)}},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>{X.setRangeStart(D._createCellCoords(D.rowIndexMapper.getNearestNotHiddenIndex(D.countRows()-1,-1),D.getSelectedRangeLast().highlight.col))}},{keys:[["ArrowDown","Shift"]],callback:()=>{X.transformEnd(1,0)}},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>{const{from:e,to:t}=D.getSelectedRangeLast(),r=D.rowIndexMapper.getNearestNotHiddenIndex(D.countRows()-1,-1);X.setRangeStart(e.clone()),X.setRangeEnd(D._createCellCoords(r,t.col))},runOnlyIf:()=>!(D.selection.isSelectedByCorner()||D.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>{X.transformStart(0,-1*D.getDirectionFactor())}},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>{const e=D.getSelectedRangeLast().highlight.row,t=D.columnIndexMapper.getNearestNotHiddenIndex(...D.isRtl()?[D.countCols()-1,-1]:[0,1]);X.setRangeStart(D._createCellCoords(e,t))}},{keys:[["ArrowLeft","Shift"]],callback:()=>{X.transformEnd(0,-1*D.getDirectionFactor())}},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>{const{from:e,to:t}=D.getSelectedRangeLast(),r=D.columnIndexMapper.getNearestNotHiddenIndex(...D.isRtl()?[D.countCols()-1,-1]:[0,1]);X.setRangeStart(e.clone()),X.setRangeEnd(D._createCellCoords(t.row,r))},runOnlyIf:()=>!(D.selection.isSelectedByCorner()||D.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>{X.transformStart(0,D.getDirectionFactor())}},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>{const e=D.getSelectedRangeLast().highlight.row,t=D.columnIndexMapper.getNearestNotHiddenIndex(...D.isRtl()?[0,1]:[D.countCols()-1,-1]);X.setRangeStart(D._createCellCoords(e,t))}},{keys:[["ArrowRight","Shift"]],callback:()=>{X.transformEnd(0,D.getDirectionFactor())}},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>{const{from:e,to:t}=D.getSelectedRangeLast(),r=D.columnIndexMapper.getNearestNotHiddenIndex(...D.isRtl()?[0,1]:[D.countCols()-1,-1]);X.setRangeStart(e.clone()),X.setRangeEnd(D._createCellCoords(t.row,r))},runOnlyIf:()=>!(D.selection.isSelectedByCorner()||D.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>{const e=parseInt(D.getSettings().fixedColumnsStart,10),t=D.getSelectedRangeLast().highlight.row,r=D.columnIndexMapper.getNearestNotHiddenIndex(e,1);X.setRangeStart(D._createCellCoords(t,r))},runOnlyIf:()=>D.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>{X.setRangeEnd(D._createCellCoords(X.selectedRange.current().from.row,D.columnIndexMapper.getNearestNotHiddenIndex(0,1)))}},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>{const e=parseInt(D.getSettings().fixedRowsTop,10),t=parseInt(D.getSettings().fixedColumnsStart,10),r=D.rowIndexMapper.getNearestNotHiddenIndex(e,1),n=D.columnIndexMapper.getNearestNotHiddenIndex(t,1);X.setRangeStart(D._createCellCoords(r,n))},runOnlyIf:()=>D.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>{X.setRangeStart(D._createCellCoords(D.getSelectedRangeLast().highlight.row,D.columnIndexMapper.getNearestNotHiddenIndex(D.countCols()-1,-1)))},runOnlyIf:()=>D.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>{X.setRangeEnd(D._createCellCoords(X.selectedRange.current().from.row,D.columnIndexMapper.getNearestNotHiddenIndex(D.countCols()-1,-1)))}},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>{const e=parseInt(D.getSettings().fixedRowsBottom,10),t=D.rowIndexMapper.getNearestNotHiddenIndex(D.countRows()-e-1,-1),r=D.columnIndexMapper.getNearestNotHiddenIndex(D.countCols()-1,-1);X.setRangeStart(D._createCellCoords(t,r))},runOnlyIf:()=>D.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>{X.transformStart(-D.countVisibleRows(),0)}},{keys:[["PageUp","Shift"]],callback:()=>{const{to:e}=D.getSelectedRangeLast(),t=Math.max(e.row-D.countVisibleRows(),0),r=D.rowIndexMapper.getNearestNotHiddenIndex(t,1);if(null!==r){const t=D._createCellCoords(r,e.col),n=e.row-D.view.getFirstFullyVisibleRow(),s=Math.max(t.row-n,0);X.setRangeEnd(t),D.scrollViewportTo(s)}}},{keys:[["PageDown"]],callback:()=>{X.transformStart(D.countVisibleRows(),0)}},{keys:[["PageDown","Shift"]],callback:()=>{const{to:e}=D.getSelectedRangeLast(),t=Math.min(e.row+D.countVisibleRows(),D.countRows()-1),r=D.rowIndexMapper.getNearestNotHiddenIndex(t,-1);if(null!==r){const t=D._createCellCoords(r,e.col),n=e.row-D.view.getFirstFullyVisibleRow(),s=Math.min(t.row-n,D.countRows()-1);X.setRangeEnd(t),D.scrollViewportTo(s)}}},{keys:[["Tab"]],callback:e=>{const t="function"==typeof j.tabMoves?j.tabMoves(e):j.tabMoves;X.transformStart(t.row,t.col,!0)}},{keys:[["Shift","Tab"]],callback:e=>{const t="function"==typeof j.tabMoves?j.tabMoves(e):j.tabMoves;X.transformStart(-t.row,-t.col)}}],le),(0,p.getPluginsNames)().forEach((e=>{const t=(0,p.getPlugin)(e);$.addItem(e,new t(this))})),A.default.getSingleton().run(D,"construct")},r(203),r(273),r(289);var s=r(302),o=r(445),i=r(305),a=r(446),l=n(r(450)),u=n(r(457)),h=r(447),c=r(444),d=r(458),p=r(459),g=r(464),m=r(453),f=r(465),y=r(303),E=r(461),C=n(r(466)),T=n(r(541)),R=r(542),w=r(543),S=r(540),v=r(476),A=n(r(454)),N=r(563),O=r(564),M=r(569),b=r(584),I=r(462),_=r(600);const x="gridDefault";let P=null;new Set},(e,t,r)=>{"use strict";var n=r(204),s=r(241),o=r(265),i=r(270),a=r(272);n({target:"Array",proto:!0,arity:1,forced:r(208)((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=s(this),r=o(t),n=arguments.length;a(r+n);for(var l=0;l<n;l++)t[r]=arguments[l],r++;return i(t,r),r}})},(e,t,r)=>{"use strict";var n=r(205),s=r(206).f,o=r(245),i=r(249),a=r(239),l=r(257),u=r(269);e.exports=function(e,t){var r,h,c,d,p,g=e.target,m=e.global,f=e.stat;if(r=m?n:f?n[g]||a(g,{}):(n[g]||{}).prototype)for(h in t){if(d=t[h],c=e.dontCallGetSet?(p=s(r,h))&&p.value:r[h],!u(m?h:g+(f?".":"#")+h,e.forced)&&void 0!==c){if(typeof d==typeof c)continue;l(d,c)}(e.sham||c&&c.sham)&&o(d,"sham",!0),i(r,h,d,e)}}},function(e){"use strict";var t=function(e){return e&&e.Math==Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(e,t,r)=>{"use strict";var n=r(207),s=r(209),o=r(211),i=r(212),a=r(213),l=r(219),u=r(240),h=r(243),c=Object.getOwnPropertyDescriptor;t.f=n?c:function(e,t){if(e=a(e),t=l(t),h)try{return c(e,t)}catch(e){}if(u(e,t))return i(!s(o.f,e,t),e[t])}},(e,t,r)=>{"use strict";var n=r(208);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,r)=>{"use strict";var n=r(210),s=Function.prototype.call;e.exports=n?s.bind(s):function(){return s.apply(s,arguments)}},(e,t,r)=>{"use strict";var n=r(208);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!r.call({1:2},1);t.f=s?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},(e,t,r)=>{"use strict";var n=r(214),s=r(217);e.exports=function(e){return n(s(e))}},(e,t,r)=>{"use strict";var n=r(215),s=r(208),o=r(216),i=Object,a=n("".split);e.exports=s((function(){return!i("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a(e,""):i(e)}:i},(e,t,r)=>{"use strict";var n=r(210),s=Function.prototype,o=s.call,i=n&&s.bind.bind(o,o);e.exports=n?i:function(e){return function(){return o.apply(e,arguments)}}},(e,t,r)=>{"use strict";var n=r(215),s=n({}.toString),o=n("".slice);e.exports=function(e){return o(s(e),8,-1)}},(e,t,r)=>{"use strict";var n=r(218),s=TypeError;e.exports=function(e){if(n(e))throw s("Can't call method on "+e);return e}},e=>{"use strict";e.exports=function(e){return null==e}},(e,t,r)=>{"use strict";var n=r(220),s=r(224);e.exports=function(e){var t=n(e,"string");return s(t)?t:t+""}},(e,t,r)=>{"use strict";var n=r(209),s=r(221),o=r(224),i=r(231),a=r(234),l=r(235),u=TypeError,h=l("toPrimitive");e.exports=function(e,t){if(!s(e)||o(e))return e;var r,l=i(e,h);if(l){if(void 0===t&&(t="default"),r=n(l,e,t),!s(r)||o(r))return r;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},(e,t,r)=>{"use strict";var n=r(222),s=r(223),o=s.all;e.exports=s.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===o}:function(e){return"object"==typeof e?null!==e:n(e)}},(e,t,r)=>{"use strict";var n=r(223),s=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===s}:function(e){return"function"==typeof e}},e=>{"use strict";var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},(e,t,r)=>{"use strict";var n=r(225),s=r(222),o=r(226),i=r(227),a=Object;e.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return s(t)&&o(t.prototype,a(e))}},(e,t,r)=>{"use strict";var n=r(205),s=r(222);e.exports=function(e,t){return arguments.length<2?(r=n[e],s(r)?r:void 0):n[e]&&n[e][t];var r}},(e,t,r)=>{"use strict";var n=r(215);e.exports=n({}.isPrototypeOf)},(e,t,r)=>{"use strict";var n=r(228);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(e,t,r)=>{"use strict";var n=r(229),s=r(208),o=r(205).String;e.exports=!!Object.getOwnPropertySymbols&&!s((function(){var e=Symbol();return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},(e,t,r)=>{"use strict";var n,s,o=r(205),i=r(230),a=o.process,l=o.Deno,u=a&&a.versions||l&&l.version,h=u&&u.v8;h&&(s=(n=h.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!s&&i&&(!(n=i.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=i.match(/Chrome\/(\d+)/))&&(s=+n[1]),e.exports=s},e=>{"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(e,t,r)=>{"use strict";var n=r(232),s=r(218);e.exports=function(e,t){var r=e[t];return s(r)?void 0:n(r)}},(e,t,r)=>{"use strict";var n=r(222),s=r(233),o=TypeError;e.exports=function(e){if(n(e))return e;throw o(s(e)+" is not a function")}},e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},(e,t,r)=>{"use strict";var n=r(209),s=r(222),o=r(221),i=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&s(r=e.toString)&&!o(a=n(r,e)))return a;if(s(r=e.valueOf)&&!o(a=n(r,e)))return a;if("string"!==t&&s(r=e.toString)&&!o(a=n(r,e)))return a;throw i("Can't convert object to primitive value")}},(e,t,r)=>{"use strict";var n=r(205),s=r(236),o=r(240),i=r(242),a=r(228),l=r(227),u=n.Symbol,h=s("wks"),c=l?u.for||u:u&&u.withoutSetter||i;e.exports=function(e){return o(h,e)||(h[e]=a&&o(u,e)?u[e]:c("Symbol."+e)),h[e]}},(e,t,r)=>{"use strict";var n=r(237),s=r(238);(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.32.0",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE",source:"https://github.com/zloirock/core-js"})},e=>{"use strict";e.exports=!1},(e,t,r)=>{"use strict";var n=r(205),s=r(239),o="__core-js_shared__",i=n[o]||s(o,{});e.exports=i},(e,t,r)=>{"use strict";var n=r(205),s=Object.defineProperty;e.exports=function(e,t){try{s(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},(e,t,r)=>{"use strict";var n=r(215),s=r(241),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(s(e),t)}},(e,t,r)=>{"use strict";var n=r(217),s=Object;e.exports=function(e){return s(n(e))}},(e,t,r)=>{"use strict";var n=r(215),s=0,o=Math.random(),i=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+i(++s+o,36)}},(e,t,r)=>{"use strict";var n=r(207),s=r(208),o=r(244);e.exports=!n&&!s((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},(e,t,r)=>{"use strict";var n=r(205),s=r(221),o=n.document,i=s(o)&&s(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},(e,t,r)=>{"use strict";var n=r(207),s=r(246),o=r(212);e.exports=n?function(e,t,r){return s.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},(e,t,r)=>{"use strict";var n=r(207),s=r(243),o=r(247),i=r(248),a=r(219),l=TypeError,u=Object.defineProperty,h=Object.getOwnPropertyDescriptor,c="enumerable",d="configurable",p="writable";t.f=n?o?function(e,t,r){if(i(e),t=a(t),i(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=h(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:c in r?r[c]:n[c],writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(i(e),t=a(t),i(r),s)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},(e,t,r)=>{"use strict";var n=r(207),s=r(208);e.exports=n&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(e,t,r)=>{"use strict";var n=r(221),s=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw o(s(e)+" is not an object")}},(e,t,r)=>{"use strict";var n=r(222),s=r(246),o=r(250),i=r(239);e.exports=function(e,t,r,a){a||(a={});var l=a.enumerable,u=void 0!==a.name?a.name:t;if(n(r)&&o(r,u,a),a.global)l?e[t]=r:i(t,r);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=r:s.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},(e,t,r)=>{"use strict";var n=r(215),s=r(208),o=r(222),i=r(240),a=r(207),l=r(251).CONFIGURABLE,u=r(252),h=r(253),c=h.enforce,d=h.get,p=String,g=Object.defineProperty,m=n("".slice),f=n("".replace),y=n([].join),E=a&&!s((function(){return 8!==g((function(){}),"length",{value:8}).length})),C=String(String).split("String"),T=e.exports=function(e,t,r){"Symbol("===m(p(t),0,7)&&(t="["+f(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!i(e,"name")||l&&e.name!==t)&&(a?g(e,"name",{value:t,configurable:!0}):e.name=t),E&&r&&i(r,"arity")&&e.length!==r.arity&&g(e,"length",{value:r.arity});try{r&&i(r,"constructor")&&r.constructor?a&&g(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=c(e);return i(n,"source")||(n.source=y(C,"string"==typeof t?t:"")),e};Function.prototype.toString=T((function(){return o(this)&&d(this).source||u(this)}),"toString")},(e,t,r)=>{"use strict";var n=r(207),s=r(240),o=Function.prototype,i=n&&Object.getOwnPropertyDescriptor,a=s(o,"name"),l=a&&"something"===function(){}.name,u=a&&(!n||n&&i(o,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:u}},(e,t,r)=>{"use strict";var n=r(215),s=r(222),o=r(238),i=n(Function.toString);s(o.inspectSource)||(o.inspectSource=function(e){return i(e)}),e.exports=o.inspectSource},(e,t,r)=>{"use strict";var n,s,o,i=r(254),a=r(205),l=r(221),u=r(245),h=r(240),c=r(238),d=r(255),p=r(256),g="Object already initialized",m=a.TypeError,f=a.WeakMap;if(i||c.state){var y=c.state||(c.state=new f);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw m(g);return t.facade=e,y.set(e,t),t},s=function(e){return y.get(e)||{}},o=function(e){return y.has(e)}}else{var E=d("state");p[E]=!0,n=function(e,t){if(h(e,E))throw m(g);return t.facade=e,u(e,E,t),t},s=function(e){return h(e,E)?e[E]:{}},o=function(e){return h(e,E)}}e.exports={set:n,get:s,has:o,enforce:function(e){return o(e)?s(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=s(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return r}}}},(e,t,r)=>{"use strict";var n=r(205),s=r(222),o=n.WeakMap;e.exports=s(o)&&/native code/.test(String(o))},(e,t,r)=>{"use strict";var n=r(236),s=r(242),o=n("keys");e.exports=function(e){return o[e]||(o[e]=s(e))}},e=>{"use strict";e.exports={}},(e,t,r)=>{"use strict";var n=r(240),s=r(258),o=r(206),i=r(246);e.exports=function(e,t,r){for(var a=s(t),l=i.f,u=o.f,h=0;h<a.length;h++){var c=a[h];n(e,c)||r&&n(r,c)||l(e,c,u(t,c))}}},(e,t,r)=>{"use strict";var n=r(225),s=r(215),o=r(259),i=r(268),a=r(248),l=s([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),r=i.f;return r?l(t,r(e)):t}},(e,t,r)=>{"use strict";var n=r(260),s=r(267).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},(e,t,r)=>{"use strict";var n=r(215),s=r(240),o=r(213),i=r(261).indexOf,a=r(256),l=n([].push);e.exports=function(e,t){var r,n=o(e),u=0,h=[];for(r in n)!s(a,r)&&s(n,r)&&l(h,r);for(;t.length>u;)s(n,r=t[u++])&&(~i(h,r)||l(h,r));return h}},(e,t,r)=>{"use strict";var n=r(213),s=r(262),o=r(265),i=function(e){return function(t,r,i){var a,l=n(t),u=o(l),h=s(i,u);if(e&&r!=r){for(;u>h;)if((a=l[h++])!=a)return!0}else for(;u>h;h++)if((e||h in l)&&l[h]===r)return e||h||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},(e,t,r)=>{"use strict";var n=r(263),s=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?s(r+t,0):o(r,t)}},(e,t,r)=>{"use strict";var n=r(264);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},(e,t,r)=>{"use strict";var n=r(266);e.exports=function(e){return n(e.length)}},(e,t,r)=>{"use strict";var n=r(263),s=Math.min;e.exports=function(e){return e>0?s(n(e),9007199254740991):0}},e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},(e,t,r)=>{"use strict";var n=r(208),s=r(222),o=/#|\.prototype\./,i=function(e,t){var r=l[a(e)];return r==h||r!=u&&(s(t)?n(t):!!t)},a=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=i.data={},u=i.NATIVE="N",h=i.POLYFILL="P";e.exports=i},(e,t,r)=>{"use strict";var n=r(207),s=r(271),o=TypeError,i=Object.getOwnPropertyDescriptor,a=n&&!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(s(e)&&!i(e,"length").writable)throw o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},(e,t,r)=>{"use strict";var n=r(216);e.exports=Array.isArray||function(e){return"Array"==n(e)}},e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},(e,t,r)=>{"use strict";var n=r(204),s=r(205),o=r(274),i=r(275),a="WebAssembly",l=s[a],u=7!==Error("e",{cause:7}).cause,h=function(e,t){var r={};r[e]=i(e,t,u),n({global:!0,constructor:!0,arity:1,forced:u},r)},c=function(e,t){if(l&&l[e]){var r={};r[e]=i(a+"."+e,t,u),n({target:a,stat:!0,constructor:!0,arity:1,forced:u},r)}};h("Error",(function(e){return function(t){return o(e,this,arguments)}})),h("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),h("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),h("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),h("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),h("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),h("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)}}))},(e,t,r)=>{"use strict";var n=r(210),s=Function.prototype,o=s.apply,i=s.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?i.bind(o):function(){return i.apply(o,arguments)})},(e,t,r)=>{"use strict";var n=r(225),s=r(240),o=r(245),i=r(226),a=r(276),l=r(257),u=r(279),h=r(280),c=r(281),d=r(285),p=r(286),g=r(207),m=r(237);e.exports=function(e,t,r,f){var y="stackTraceLimit",E=f?2:1,C=e.split("."),T=C[C.length-1],R=n.apply(null,C);if(R){var w=R.prototype;if(!m&&s(w,"cause")&&delete w.cause,!r)return R;var S=n("Error"),v=t((function(e,t){var r=c(f?t:e,void 0),n=f?new R(e):new R;return void 0!==r&&o(n,"message",r),p(n,v,n.stack,2),this&&i(w,this)&&h(n,this,v),arguments.length>E&&d(n,arguments[E]),n}));if(v.prototype=w,"Error"!==T?a?a(v,S):l(v,S,{name:!0}):g&&y in R&&(u(v,R,y),u(v,R,"prepareStackTrace")),l(v,R),!m)try{w.name!==T&&o(w,"name",T),w.constructor=v}catch(e){}return v}}},(e,t,r)=>{"use strict";var n=r(277),s=r(248),o=r(278);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return s(r),o(n),t?e(r,n):r.__proto__=n,r}}():void 0)},(e,t,r)=>{"use strict";var n=r(215),s=r(232);e.exports=function(e,t,r){try{return n(s(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},(e,t,r)=>{"use strict";var n=r(222),s=String,o=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw o("Can't set "+s(e)+" as a prototype")}},(e,t,r)=>{"use strict";var n=r(246).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},(e,t,r)=>{"use strict";var n=r(222),s=r(221),o=r(276);e.exports=function(e,t,r){var i,a;return o&&n(i=t.constructor)&&i!==r&&s(a=i.prototype)&&a!==r.prototype&&o(e,a),e}},(e,t,r)=>{"use strict";var n=r(282);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},(e,t,r)=>{"use strict";var n=r(283),s=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return s(e)}},(e,t,r)=>{"use strict";var n=r(284),s=r(222),o=r(216),i=r(235)("toStringTag"),a=Object,l="Arguments"==o(function(){return arguments}());e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),i))?r:l?o(t):"Object"==(n=o(t))&&s(t.callee)?"Arguments":n}},(e,t,r)=>{"use strict";var n={};n[r(235)("toStringTag")]="z",e.exports="[object z]"===String(n)},(e,t,r)=>{"use strict";var n=r(221),s=r(245);e.exports=function(e,t){n(t)&&"cause"in t&&s(e,"cause",t.cause)}},(e,t,r)=>{"use strict";var n=r(245),s=r(287),o=r(288),i=Error.captureStackTrace;e.exports=function(e,t,r,a){o&&(i?i(e,t):n(e,"stack",s(r,a)))}},(e,t,r)=>{"use strict";var n=r(215),s=Error,o=n("".replace),i=String(s("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(i);e.exports=function(e,t){if(l&&"string"==typeof e&&!s.prepareStackTrace)for(;t--;)e=o(e,a,"");return e}},(e,t,r)=>{"use strict";var n=r(208),s=r(212);e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",s(1,7)),7!==e.stack)}))},(e,t,r)=>{"use strict";r(290),r(299)},(e,t,r)=>{"use strict";var n=r(204),s=r(205),o=r(291).clear;n({global:!0,bind:!0,enumerable:!0,forced:s.clearImmediate!==o},{clearImmediate:o})},(e,t,r)=>{"use strict";var n,s,o,i,a=r(205),l=r(274),u=r(292),h=r(222),c=r(240),d=r(208),p=r(294),g=r(295),m=r(244),f=r(296),y=r(297),E=r(298),C=a.setImmediate,T=a.clearImmediate,R=a.process,w=a.Dispatch,S=a.Function,v=a.MessageChannel,A=a.String,N=0,O={},M="onreadystatechange";d((function(){n=a.location}));var b=function(e){if(c(O,e)){var t=O[e];delete O[e],t()}},I=function(e){return function(){b(e)}},_=function(e){b(e.data)},x=function(e){a.postMessage(A(e),n.protocol+"//"+n.host)};C&&T||(C=function(e){f(arguments.length,1);var t=h(e)?e:S(e),r=g(arguments,1);return O[++N]=function(){l(t,void 0,r)},s(N),N},T=function(e){delete O[e]},E?s=function(e){R.nextTick(I(e))}:w&&w.now?s=function(e){w.now(I(e))}:v&&!y?(i=(o=new v).port2,o.port1.onmessage=_,s=u(i.postMessage,i)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!d(x)?(s=x,a.addEventListener("message",_,!1)):s=M in m("script")?function(e){p.appendChild(m("script"))[M]=function(){p.removeChild(this),b(e)}}:function(e){setTimeout(I(e),0)}),e.exports={set:C,clear:T}},(e,t,r)=>{"use strict";var n=r(293),s=r(232),o=r(210),i=n(n.bind);e.exports=function(e,t){return s(e),void 0===t?e:o?i(e,t):function(){return e.apply(t,arguments)}}},(e,t,r)=>{"use strict";var n=r(216),s=r(215);e.exports=function(e){if("Function"===n(e))return s(e)}},(e,t,r)=>{"use strict";var n=r(225);e.exports=n("document","documentElement")},(e,t,r)=>{"use strict";var n=r(215);e.exports=n([].slice)},e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw t("Not enough arguments");return e}},(e,t,r)=>{"use strict";var n=r(230);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},(e,t,r)=>{"use strict";var n=r(216);e.exports="undefined"!=typeof process&&"process"==n(process)},(e,t,r)=>{"use strict";var n=r(204),s=r(205),o=r(291).set,i=r(300),a=s.setImmediate?i(o,!1):o;n({global:!0,bind:!0,enumerable:!0,forced:s.setImmediate!==a},{setImmediate:a})},(e,t,r)=>{"use strict";var n,s=r(205),o=r(274),i=r(222),a=r(301),l=r(230),u=r(295),h=r(296),c=s.Function,d=/MSIE .\./.test(l)||a&&((n=s.Bun.version.split(".")).length<3||0==n[0]&&(n[1]<3||3==n[1]&&0==n[2]));e.exports=function(e,t){var r=t?2:1;return d?function(n,s){var a=h(arguments.length,1)>r,l=i(n)?n:c(n),d=a?u(arguments,r):[],p=a?function(){o(l,this,d)}:l;return t?e(p,s):e(p)}:e}},e=>{"use strict";e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},(e,t,r)=>{"use strict";t.__esModule=!0,t.addClass=function(e,t){"string"==typeof t&&(t=t.split(" "));(t=i(t)).length>0&&e.classList.add(...t)},t.addEvent=function(e,t,r){e.addEventListener(t,r,!1)},t.clearTextSelection=function(){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())},t.closest=o,t.closestDown=function(e,t,r){const n=[];let s=e;for(;s&&(s=o(s,t,r),s&&(!r||r.contains(s)));)n.push(s),s=s.host&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s.host:s.parentNode;const i=n.length;return i?n[i-1]:null},t.empty=a,t.fastInnerHTML=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];l.test(t)?e.innerHTML=r?(0,n.sanitize)(t):t:u(e,t)},t.fastInnerText=u,t.getCaretPosition=function(e){if(e.selectionStart)return e.selectionStart;return 0},t.getComputedStyle=d,t.getCssTransform=function(e){let t;if(e.style.transform&&""!==(t=e.style.transform))return["transform",t];return-1},t.getFrameElement=s,t.getParent=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=-1,n=null,s=e;for(;null!==s;){if(r===t){n=s;break}s.host&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s=s.host:(r+=1,s=s.parentNode)}return n},t.getParentWindow=function(e){return s(e)&&e.parent},t.getScrollLeft=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(e===t)return c(t);return e.scrollLeft},t.getScrollTop=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(e===t)return h(t);return e.scrollTop},t.getScrollableElement=function(e){let t=e.ownerDocument,r=t?t.defaultView:void 0;t||(t=e.document?e.document:e,r=t.defaultView);const n=["auto","scroll"];let s=e.parentNode;for(;s&&s.style&&t.body!==s;){let{overflow:e,overflowX:t,overflowY:o}=s.style;if([e,t,o].includes("scroll"))return s;if(({overflow:e,overflowX:t,overflowY:o}=r.getComputedStyle(s)),n.includes(e)||n.includes(t)||n.includes(o))return s;if(s.clientHeight<=s.scrollHeight+1&&(n.includes(o)||n.includes(e)))return s;if(s.clientWidth<=s.scrollWidth+1&&(n.includes(t)||n.includes(e)))return s;s=s.parentNode}return r},t.getScrollbarWidth=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;void 0===p&&(p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;const t=e.createElement("div");t.style.height="200px",t.style.width="100%";const r=e.createElement("div");r.style.boxSizing="content-box",r.style.height="150px",r.style.left="0px",r.style.overflow="hidden",r.style.position="absolute",r.style.top="0px",r.style.width="200px",r.style.visibility="hidden",r.appendChild(t),(e.body||e.documentElement).appendChild(r);const n=t.offsetWidth;r.style.overflow="scroll";let s=t.offsetWidth;n===s&&(s=r.clientWidth);return(e.body||e.documentElement).removeChild(r),n-s}(e));return p},t.getSelectionEndPosition=function(e){if(e.selectionEnd)return e.selectionEnd;return 0},t.getSelectionText=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=e.document;let r="";e.getSelection?r=e.getSelection().toString():t.selection&&"Control"!==t.selection.type&&(r=t.selection.createRange().text);return r},t.getStyle=function(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;const n=e.style[t];if(""!==n&&void 0!==n)return n;const s=d(e,r);if(""!==s[t]&&void 0!==s[t])return s[t]},t.getTrimmingContainer=function(e){const t=e.ownerDocument,r=t.defaultView;let n=e.parentNode;for(;n&&n.style&&t.body!==n;){if("visible"!==n.style.overflow&&""!==n.style.overflow)return n;const e=d(n,r),t=["scroll","hidden","auto"],s=e.getPropertyValue("overflow"),o=e.getPropertyValue("overflow-y"),i=e.getPropertyValue("overflow-x");if(t.includes(s)||t.includes(o)||t.includes(i))return n;n=n.parentNode}return r},t.getWindowScrollLeft=c,t.getWindowScrollTop=h,t.hasAccessToParentWindow=function(e){return!!Object.getPrototypeOf(e.parent)},t.hasClass=function(e,t){if(void 0===e.classList||"string"!=typeof t||""===t)return!1;return e.classList.contains(t)},t.hasHorizontalScrollbar=function(e){return e.offsetHeight!==e.clientHeight},t.hasVerticalScrollbar=function(e){return e.offsetWidth!==e.clientWidth},t.index=function(e){let t=0,r=e;if(r.previousSibling)for(;r=r.previousSibling;)t+=1;return t},t.innerHeight=function(e){return e.clientHeight||e.innerHeight},t.innerWidth=function(e){return e.clientWidth||e.innerWidth},t.isChildOf=function(e,t){let r=e.parentNode,n=[];"string"==typeof t?n=e.defaultView?Array.prototype.slice.call(e.querySelectorAll(t),0):Array.prototype.slice.call(e.ownerDocument.querySelectorAll(t),0):n.push(t);for(;null!==r;){if(n.indexOf(r)>-1)return!0;r=r.parentNode}return!1},t.isDetached=function(e){return!e.parentNode},t.isInput=g,t.isOutsideInput=m,t.isVisible=function e(t){const r=t.ownerDocument.documentElement;let n=t;for(;n!==r;){if(null===n)return!1;if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(n.host){if(n.host.impl)return e(n.host.impl);if(n.host)return e(n.host);throw new Error("Lost in Web Components world")}return!1}if(n.style&&"none"===n.style.display)return!1;n=n.parentNode}return!0},t.matchesCSSRules=function(e,t){const{selectorText:r}=t;let n=!1;t.type===CSSRule.STYLE_RULE&&r&&(e.msMatchesSelector?n=e.msMatchesSelector(r):e.matches&&(n=e.matches(r)));return n},t.observeVisibilityChangeOnce=function(e,t){new IntersectionObserver(((r,n)=>{r.forEach((r=>{r.isIntersecting&&null!==e.offsetParent&&(t(),n.unobserve(e))}))}),{root:e.ownerDocument.body}).observe(e)},t.offset=function(e){const t=e.ownerDocument,r=t.defaultView,n=t.documentElement;let s,o,i,a=e;s=a.offsetLeft,o=a.offsetTop,i=a;for(;(a=a.offsetParent)&&a!==t.body;)s+=a.offsetLeft,o+=a.offsetTop,i=a;i&&"fixed"===i.style.position&&(s+=r.pageXOffset||n.scrollLeft,o+=r.pageYOffset||n.scrollTop);return{left:s,top:o}},t.outerHeight=function(e){return e.offsetHeight},t.outerWidth=function(e){return e.offsetWidth},t.overlayContainsElement=function(e,t,r){const n=r.parentElement.querySelector(`.ht_clone_${e}`);return n?n.contains(t):null},t.removeClass=function(e,t){"string"==typeof t&&(t=t.split(" "));(t=i(t)).length>0&&e.classList.remove(...t)},t.removeEvent=function(e,t,r){e.removeEventListener(t,r,!1)},t.removeTextNodes=function e(t){if(3===t.nodeType)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const r=t.childNodes;for(let t=r.length-1;t>=0;t--)e(r[t])}},t.resetCssTransform=function(e){e.style.transform&&""!==e.style.transform&&(e.style.transform="")},t.selectElementIfAllowed=function(e){m(e.ownerDocument.activeElement)||e.select()},t.setCaretPosition=function(e,t,r){void 0===r&&(r=t);if(e.setSelectionRange){e.focus();try{e.setSelectionRange(t,r)}catch(n){const s=e.parentNode,o=s.style.display;s.style.display="block",e.setSelectionRange(t,r),s.style.display=o}}},t.setOverlayPosition=function(e,t,r){e.style.transform=`translate3d(${t},${r},0)`},r(203),r(273);var n=r(303);function s(e){return Object.getPrototypeOf(e.parent)&&e.frameElement}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:n,DOCUMENT_FRAGMENT_NODE:s}=Node;let o=e;for(;null!=o&&o!==r;){const{nodeType:e,nodeName:r}=o;if(e===n&&(t.includes(r)||t.includes(o)))return o;const{host:i}=o;o=i&&e===s?i:o.parentNode}return null}function i(e){return e&&e.length?e.filter((e=>!!e)):[]}function a(e){let t;for(;t=e.lastChild;)e.removeChild(t)}const l=/(<(.*)>|&(.*);)/;function u(e,t){const r=e.firstChild;r&&3===r.nodeType&&null===r.nextSibling?r.textContent=t:(a(e),e.appendChild(e.ownerDocument.createTextNode(t)))}function h(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).scrollY}function c(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).scrollX}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e.currentStyle||t.getComputedStyle(e)}let p;function g(e){return e&&(["INPUT","SELECT","TEXTAREA"].indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function m(e){return g(e)&&!1===e.hasAttribute("data-hot-input")}t.HTML_CHARACTERS=l},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0,t.equalsIgnoreCase=function(){const e=[];for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];let s=r.length;for(;s;){s-=1;const t=(0,o.stringify)(r[s]).toLowerCase();-1===e.indexOf(t)&&e.push(t)}return 1===e.length},t.isPercentValue=function(e){return/^([0-9][0-9]?%$)|(^100%$)/.test(e)},t.randomString=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},t.sanitize=i,t.stripTags=function(e){return i(`${e}`,{ALLOWED_TAGS:[]})},t.substitute=function(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]))},t.toUpperCaseFirst=function(e){return e[0].toUpperCase()+e.substr(1)},r(203);var s=n(r(304)),o=r(305);function i(e,t){return s.default.sanitize(e,t)}},function(e,t,r){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,r){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,r)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function n(e,s,o){return n=r()?Reflect.construct:function(e,r,n){var s=[null];s.push.apply(s,r);var o=new(Function.bind.apply(e,s));return n&&t(o,n.prototype),o},n.apply(null,arguments)}function s(e){return o(e)||i(e)||a(e)||u()}function o(e){if(Array.isArray(e))return l(e)}function i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.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)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h=Object.hasOwnProperty,c=Object.setPrototypeOf,d=Object.isFrozen,p=Object.getPrototypeOf,g=Object.getOwnPropertyDescriptor,m=Object.freeze,f=Object.seal,y=Object.create,E="undefined"!=typeof Reflect&&Reflect,C=E.apply,T=E.construct;C||(C=function(e,t,r){return e.apply(t,r)}),m||(m=function(e){return e}),f||(f=function(e){return e}),T||(T=function(e,t){return n(e,s(t))});var R=x(Array.prototype.forEach),w=x(Array.prototype.pop),S=x(Array.prototype.push),v=x(String.prototype.toLowerCase),A=x(String.prototype.toString),N=x(String.prototype.match),O=x(String.prototype.replace),M=x(String.prototype.indexOf),b=x(String.prototype.trim),I=x(RegExp.prototype.test),_=P(TypeError);function x(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return C(e,t,n)}}function P(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return T(e,r)}}function L(e,t,r){var n;r=null!==(n=r)&&void 0!==n?n:v,c&&c(e,null);for(var s=t.length;s--;){var o=t[s];if("string"==typeof o){var i=r(o);i!==o&&(d(t)||(t[s]=i),o=i)}e[o]=!0}return e}function D(e){var t,r=y(null);for(t in e)!0===C(h,e,[t])&&(r[t]=e[t]);return r}function F(e,t){for(;null!==e;){var r=g(e,t);if(r){if(r.get)return x(r.get);if("function"==typeof r.value)return x(r.value)}e=p(e)}function n(e){return console.warn("fallback value for",e),null}return n}var k=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),H=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),U=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),V=m(["animate","color-profile","cursor","discard","fedropshadow","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"]),B=m(["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"]),W=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),G=m(["#text"]),Y=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),j=m(["accent-height","accumulate","additive","alignment-baseline","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","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","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","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","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"]),z=m(["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"]),$=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),K=f(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X=f(/<%[\w\W]*|[\w\W]*%>/gm),q=f(/\${[\w\W]*}/gm),Q=f(/^data-[\-\w.\u00B7-\uFFFF]/),Z=f(/^aria-[\-\w]+$/),J=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ee=f(/^(?:\w+script|data):/i),te=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),re=f(/^html$/i),ne=function(){return"undefined"==typeof window?null:window},se=function(t,r){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var n=null,s="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(s)&&(n=r.currentScript.getAttribute(s));var o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function oe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ne(),r=function(e){return oe(e)};if(r.version="2.4.7",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;var n=t.document,o=t.document,i=t.DocumentFragment,a=t.HTMLTemplateElement,l=t.Node,u=t.Element,h=t.NodeFilter,c=t.NamedNodeMap,d=void 0===c?t.NamedNodeMap||t.MozNamedAttrMap:c,p=t.HTMLFormElement,g=t.DOMParser,f=t.trustedTypes,y=u.prototype,E=F(y,"cloneNode"),C=F(y,"nextSibling"),T=F(y,"childNodes"),x=F(y,"parentNode");if("function"==typeof a){var P=o.createElement("template");P.content&&P.content.ownerDocument&&(o=P.content.ownerDocument)}var ie=se(f,n),ae=ie?ie.createHTML(""):"",le=o,ue=le.implementation,he=le.createNodeIterator,ce=le.createDocumentFragment,de=le.getElementsByTagName,pe=n.importNode,ge={};try{ge=D(o).documentMode?o.documentMode:{}}catch(e){}var me={};r.isSupported="function"==typeof x&&ue&&void 0!==ue.createHTMLDocument&&9!==ge;var fe,ye,Ee=K,Ce=X,Te=q,Re=Q,we=Z,Se=ee,ve=te,Ae=J,Ne=null,Oe=L({},[].concat(s(k),s(H),s(U),s(B),s(G))),Me=null,be=L({},[].concat(s(Y),s(j),s(z),s($))),Ie=Object.seal(Object.create(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}})),_e=null,xe=null,Pe=!0,Le=!0,De=!1,Fe=!0,ke=!1,He=!1,Ue=!1,Ve=!1,Be=!1,We=!1,Ge=!1,Ye=!0,je=!1,ze="user-content-",$e=!0,Ke=!1,Xe={},qe=null,Qe=L({},["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"]),Ze=null,Je=L({},["audio","video","img","source","image","track"]),et=null,tt=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml",ot=st,it=!1,at=null,lt=L({},[rt,nt,st],A),ut=["application/xhtml+xml","text/html"],ht="text/html",ct=null,dt=o.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},gt=function(t){ct&&ct===t||(t&&"object"===e(t)||(t={}),t=D(t),fe=fe=-1===ut.indexOf(t.PARSER_MEDIA_TYPE)?ht:t.PARSER_MEDIA_TYPE,ye="application/xhtml+xml"===fe?A:v,Ne="ALLOWED_TAGS"in t?L({},t.ALLOWED_TAGS,ye):Oe,Me="ALLOWED_ATTR"in t?L({},t.ALLOWED_ATTR,ye):be,at="ALLOWED_NAMESPACES"in t?L({},t.ALLOWED_NAMESPACES,A):lt,et="ADD_URI_SAFE_ATTR"in t?L(D(tt),t.ADD_URI_SAFE_ATTR,ye):tt,Ze="ADD_DATA_URI_TAGS"in t?L(D(Je),t.ADD_DATA_URI_TAGS,ye):Je,qe="FORBID_CONTENTS"in t?L({},t.FORBID_CONTENTS,ye):Qe,_e="FORBID_TAGS"in t?L({},t.FORBID_TAGS,ye):{},xe="FORBID_ATTR"in t?L({},t.FORBID_ATTR,ye):{},Xe="USE_PROFILES"in t&&t.USE_PROFILES,Pe=!1!==t.ALLOW_ARIA_ATTR,Le=!1!==t.ALLOW_DATA_ATTR,De=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ke=t.SAFE_FOR_TEMPLATES||!1,He=t.WHOLE_DOCUMENT||!1,Be=t.RETURN_DOM||!1,We=t.RETURN_DOM_FRAGMENT||!1,Ge=t.RETURN_TRUSTED_TYPE||!1,Ve=t.FORCE_BODY||!1,Ye=!1!==t.SANITIZE_DOM,je=t.SANITIZE_NAMED_PROPS||!1,$e=!1!==t.KEEP_CONTENT,Ke=t.IN_PLACE||!1,Ae=t.ALLOWED_URI_REGEXP||Ae,ot=t.NAMESPACE||st,Ie=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ie.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ie.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ie.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(Le=!1),We&&(Be=!0),Xe&&(Ne=L({},s(G)),Me=[],!0===Xe.html&&(L(Ne,k),L(Me,Y)),!0===Xe.svg&&(L(Ne,H),L(Me,j),L(Me,$)),!0===Xe.svgFilters&&(L(Ne,U),L(Me,j),L(Me,$)),!0===Xe.mathMl&&(L(Ne,B),L(Me,z),L(Me,$))),t.ADD_TAGS&&(Ne===Oe&&(Ne=D(Ne)),L(Ne,t.ADD_TAGS,ye)),t.ADD_ATTR&&(Me===be&&(Me=D(Me)),L(Me,t.ADD_ATTR,ye)),t.ADD_URI_SAFE_ATTR&&L(et,t.ADD_URI_SAFE_ATTR,ye),t.FORBID_CONTENTS&&(qe===Qe&&(qe=D(qe)),L(qe,t.FORBID_CONTENTS,ye)),$e&&(Ne["#text"]=!0),He&&L(Ne,["html","head","body"]),Ne.table&&(L(Ne,["tbody"]),delete _e.tbody),m&&m(t),ct=t)},mt=L({},["mi","mo","mn","ms","mtext"]),ft=L({},["foreignobject","desc","title","annotation-xml"]),yt=L({},["title","style","font","a","script"]),Et=L({},H);L(Et,U),L(Et,V);var Ct=L({},B);L(Ct,W);var Tt=function(e){var t=x(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});var r=v(e.tagName),n=v(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===st?"svg"===r:t.namespaceURI===rt?"svg"===r&&("annotation-xml"===n||mt[n]):Boolean(Et[r]):e.namespaceURI===rt?t.namespaceURI===st?"math"===r:t.namespaceURI===nt?"math"===r&&ft[n]:Boolean(Ct[r]):e.namespaceURI===st?!(t.namespaceURI===nt&&!ft[n])&&!(t.namespaceURI===rt&&!mt[n])&&!Ct[r]&&(yt[r]||!Et[r]):!("application/xhtml+xml"!==fe||!at[e.namespaceURI]))},Rt=function(e){S(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},wt=function(e,t){try{S(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){S(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Me[e])if(Be||We)try{Rt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},St=function(e){var t,r;if(Ve)e="<remove></remove>"+e;else{var n=N(e,/^[\r\n\t ]+/);r=n&&n[0]}"application/xhtml+xml"===fe&&ot===st&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var s=ie?ie.createHTML(e):e;if(ot===st)try{t=(new g).parseFromString(s,fe)}catch(e){}if(!t||!t.documentElement){t=ue.createDocument(ot,"template",null);try{t.documentElement.innerHTML=it?ae:s}catch(e){}}var i=t.body||t.documentElement;return e&&r&&i.insertBefore(o.createTextNode(r),i.childNodes[0]||null),ot===st?de.call(t,He?"html":"body")[0]:He?t.documentElement:i},vt=function(e){return he.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT,null,!1)},At=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Ot=function(e,t,n){me[e]&&R(me[e],(function(e){e.call(r,t,n,ct)}))},Mt=function(e){var t;if(Ot("beforeSanitizeElements",e,null),At(e))return Rt(e),!0;if(I(/[\u0080-\uFFFF]/,e.nodeName))return Rt(e),!0;var n=ye(e.nodeName);if(Ot("uponSanitizeElement",e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&(!Nt(e.content)||!Nt(e.content.firstElementChild))&&I(/<[/\w]/g,e.innerHTML)&&I(/<[/\w]/g,e.textContent))return Rt(e),!0;if("select"===n&&I(/<template/i,e.innerHTML))return Rt(e),!0;if(!Ne[n]||_e[n]){if(!_e[n]&&It(n)){if(Ie.tagNameCheck instanceof RegExp&&I(Ie.tagNameCheck,n))return!1;if(Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(n))return!1}if($e&&!qe[n]){var s=x(e)||e.parentNode,o=T(e)||e.childNodes;if(o&&s)for(var i=o.length-1;i>=0;--i)s.insertBefore(E(o[i],!0),C(e))}return Rt(e),!0}return e instanceof u&&!Tt(e)?(Rt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!I(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&3===e.nodeType&&(t=e.textContent,t=O(t,Ee," "),t=O(t,Ce," "),t=O(t,Te," "),e.textContent!==t&&(S(r.removed,{element:e.cloneNode()}),e.textContent=t)),Ot("afterSanitizeElements",e,null),!1):(Rt(e),!0)},bt=function(e,t,r){if(Ye&&("id"===t||"name"===t)&&(r in o||r in dt))return!1;if(Le&&!xe[t]&&I(Re,t));else if(Pe&&I(we,t));else if(!Me[t]||xe[t]){if(!(It(e)&&(Ie.tagNameCheck instanceof RegExp&&I(Ie.tagNameCheck,e)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(e))&&(Ie.attributeNameCheck instanceof RegExp&&I(Ie.attributeNameCheck,t)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(t))||"is"===t&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&I(Ie.tagNameCheck,r)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(r))))return!1}else if(et[t]);else if(I(Ae,O(r,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==M(r,"data:")||!Ze[e])if(De&&!I(Se,O(r,ve,"")));else if(r)return!1;return!0},It=function(e){return e.indexOf("-")>0},_t=function(t){var n,s,o,i;Ot("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Me};for(i=a.length;i--;){var u=n=a[i],h=u.name,c=u.namespaceURI;if(s="value"===h?n.value:b(n.value),o=ye(h),l.attrName=o,l.attrValue=s,l.keepAttr=!0,l.forceKeepAttr=void 0,Ot("uponSanitizeAttribute",t,l),s=l.attrValue,!l.forceKeepAttr&&(wt(h,t),l.keepAttr))if(Fe||!I(/\/>/i,s)){ke&&(s=O(s,Ee," "),s=O(s,Ce," "),s=O(s,Te," "));var d=ye(t.nodeName);if(bt(d,o,s)){if(!je||"id"!==o&&"name"!==o||(wt(h,t),s=ze+s),ie&&"object"===e(f)&&"function"==typeof f.getAttributeType)if(c);else switch(f.getAttributeType(d,o)){case"TrustedHTML":s=ie.createHTML(s);break;case"TrustedScriptURL":s=ie.createScriptURL(s)}try{c?t.setAttributeNS(c,h,s):t.setAttribute(h,s),w(r.removed)}catch(e){}}}else wt(h,t)}Ot("afterSanitizeAttributes",t,null)}},xt=function e(t){var r,n=vt(t);for(Ot("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)Ot("uponSanitizeShadowNode",r,null),Mt(r)||(r.content instanceof i&&e(r.content),_t(r));Ot("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(s){var o,a,u,h,c,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((it=!s)&&(s="\x3c!--\x3e"),"string"!=typeof s&&!Nt(s)){if("function"!=typeof s.toString)throw _("toString is not a function");if("string"!=typeof(s=s.toString()))throw _("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof s)return t.toStaticHTML(s);if(Nt(s))return t.toStaticHTML(s.outerHTML)}return s}if(Ue||gt(d),r.removed=[],"string"==typeof s&&(Ke=!1),Ke){if(s.nodeName){var p=ye(s.nodeName);if(!Ne[p]||_e[p])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(s instanceof l)1===(a=(o=St("\x3c!----\x3e")).ownerDocument.importNode(s,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!Be&&!ke&&!He&&-1===s.indexOf("<"))return ie&&Ge?ie.createHTML(s):s;if(!(o=St(s)))return Be?null:Ge?ae:""}o&&Ve&&Rt(o.firstChild);for(var g=vt(Ke?s:o);u=g.nextNode();)3===u.nodeType&&u===h||Mt(u)||(u.content instanceof i&&xt(u.content),_t(u),h=u);if(h=null,Ke)return s;if(Be){if(We)for(c=ce.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(Me.shadowroot||Me.shadowrootmod)&&(c=pe.call(n,c,!0)),c}var m=He?o.outerHTML:o.innerHTML;return He&&Ne["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&I(re,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),ke&&(m=O(m,Ee," "),m=O(m,Ce," "),m=O(m,Te," ")),ie&&Ge?ie.createHTML(m):m},r.setConfig=function(e){gt(e),Ue=!0},r.clearConfig=function(){ct=null,Ue=!1},r.isValidAttribute=function(e,t,r){ct||gt({});var n=ye(e),s=ye(t);return bt(n,s,r)},r.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],S(me[e],t))},r.removeHook=function(e){if(me[e])return w(me[e])},r.removeHooks=function(e){me[e]&&(me[e]=[])},r.removeAllHooks=function(){me={}},r}return oe()}(),window.DOMPurify=r(304)},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0,t._injectProductInfo=function(e,t){const r=!a(e),n="string"==typeof e&&"non-commercial-and-evaluation"===e.toLowerCase(),o="13.1.0-next-f6ea50b-20230811";let i,C="invalid",T="invalid";const R=function(e){let t=[][l],r=t;if(e[l]!==d("Z"))return!1;for(let t="",n="B<H4P+".split(""),s=d(n.shift());s;s=d(n.shift()||"A"))--s<""[l]?r|=(h(`${h(u(t)+(u(c(e,Math.abs(s),2))+[]).padStart(2,"0"))}`)%97||2)>>1:t=c(e,s,s?1===n[l]?9:8:6);return r===t}(e=p(e||""));if(r||n||R)if(R){const t=(0,s.default)("21/08/2023","DD/MM/YYYY"),r=Math.floor(t.toDate().getTime()/864e5),n=g(e);i=(0,s.default)(864e5*(n+1),"x").format("MMMM DD, YYYY"),r>n?(C="expired",T="expired"):(C="valid",T="valid")}else n?(C="non_commercial",T="valid"):(C="invalid",T="invalid");else C="missing",T="missing";m()&&(C="valid",T="valid");if(!f&&"valid"!==C){y[C]({keyValidityDate:i,hotVersion:o})&&console["non_commercial"===C?"info":"warn"](y[C]({keyValidityDate:i,hotVersion:o})),f=!0}if("valid"!==T&&t.parentNode){if(E[T]({keyValidityDate:i,hotVersion:o})){const e=document.createElement("div");e.className="hot-display-license-info",e.innerHTML=E[T]({keyValidityDate:i,hotVersion:o}),t.parentNode.insertBefore(e,t.nextSibling)}}},t.isDefined=function(e){return void 0!==e},t.isEmpty=a,t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isUndefined=i,t.stringify=function(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};var s=n(r(306)),o=r(443);function i(e){return void 0===e}function a(e){return null===e||""===e||i(e)}const l="length",u=e=>parseInt(e,16),h=e=>parseInt(e,10),c=(e,t,r)=>e.substr(t,r),d=e=>e.codePointAt(0)-65,p=e=>`${e}`.replace(/\-/g,""),g=e=>u(c(p(e),u("12"),d("F")))/(u(c(p(e),d("B"),~~![][l]))||9),m=()=>"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);let f=!1;const y={invalid:()=>o.toSingleLine`
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Handsontable",[],t):"object"==typeof exports?exports.Handsontable=t():e.Handsontable=t()}("undefined"!=typeof self?self:this,(()=>(()=>{var e=[(e,t,r)=>{"use strict";r.r(t),r.d(t,{AlwaysDense:()=>a.AlwaysDense,AlwaysSparse:()=>a.AlwaysSparse,ArraySize:()=>n.ArraySize,CellError:()=>s.CellError,CellType:()=>s.CellType,CellValueDetailedType:()=>s.CellValueDetailedType,CellValueType:()=>s.CellValueType,ConfigValueTooBigError:()=>l.ConfigValueTooBigError,ConfigValueTooSmallError:()=>l.ConfigValueTooSmallError,DenseSparseChooseBasedOnThreshold:()=>a.DenseSparseChooseBasedOnThreshold,DetailedCellError:()=>o.DetailedCellError,ErrorType:()=>s.ErrorType,EvaluationSuspendedError:()=>l.EvaluationSuspendedError,ExpectedOneOfValuesError:()=>l.ExpectedOneOfValuesError,ExpectedValueOfTypeError:()=>l.ExpectedValueOfTypeError,ExportedCellChange:()=>u.ExportedCellChange,ExportedNamedExpressionChange:()=>u.ExportedNamedExpressionChange,FunctionArgumentType:()=>d.FunctionArgumentType,FunctionPlugin:()=>d.FunctionPlugin,FunctionPluginValidationError:()=>l.FunctionPluginValidationError,HyperFormula:()=>h.HyperFormula,InvalidAddressError:()=>l.InvalidAddressError,InvalidArgumentsError:()=>l.InvalidArgumentsError,LanguageAlreadyRegisteredError:()=>l.LanguageAlreadyRegisteredError,LanguageNotRegisteredError:()=>l.LanguageNotRegisteredError,MissingTranslationError:()=>l.MissingTranslationError,NamedExpressionDoesNotExistError:()=>l.NamedExpressionDoesNotExistError,NamedExpressionNameIsAlreadyTakenError:()=>l.NamedExpressionNameIsAlreadyTakenError,NamedExpressionNameIsInvalidError:()=>l.NamedExpressionNameIsInvalidError,NoOperationToRedoError:()=>l.NoOperationToRedoError,NoOperationToUndoError:()=>l.NoOperationToUndoError,NoRelativeAddressesAllowedError:()=>l.NoRelativeAddressesAllowedError,NoSheetWithIdError:()=>l.NoSheetWithIdError,NoSheetWithNameError:()=>l.NoSheetWithNameError,NotAFormulaError:()=>l.NotAFormulaError,NothingToPasteError:()=>l.NothingToPasteError,ProtectedFunctionTranslationError:()=>l.ProtectedFunctionTranslationError,SheetNameAlreadyTakenError:()=>l.SheetNameAlreadyTakenError,SheetSizeLimitExceededError:()=>l.SheetSizeLimitExceededError,SimpleRangeValue:()=>g.SimpleRangeValue,SourceLocationHasArrayError:()=>l.SourceLocationHasArrayError,TargetLocationHasArrayError:()=>l.TargetLocationHasArrayError,UnableToParseError:()=>l.UnableToParseError,default:()=>y});var n=r(1),s=r(3),o=r(98),i=r(99),a=r(103),l=r(77),u=r(126),h=r(108),c=r(144),d=r(145),p=r(146),g=r(69);class m extends h.HyperFormula{}m.HyperFormula=h.HyperFormula,m.ErrorType=s.ErrorType,m.CellError=s.CellError,m.CellType=s.CellType,m.CellValueType=s.CellValueType,m.CellValueDetailedType=s.CellValueDetailedType,m.DetailedCellError=o.DetailedCellError,m.ExportedCellChange=u.ExportedCellChange,m.ExportedNamedExpressionChange=u.ExportedNamedExpressionChange,m.ConfigValueTooBigError=l.ConfigValueTooBigError,m.ConfigValueTooSmallError=l.ConfigValueTooSmallError,m.EvaluationSuspendedError=l.EvaluationSuspendedError,m.ExpectedOneOfValuesError=l.ExpectedOneOfValuesError,m.ExpectedValueOfTypeError=l.ExpectedValueOfTypeError,m.ArraySize=n.ArraySize,m.SimpleRangeValue=g.SimpleRangeValue,m.FunctionPlugin=d.FunctionPlugin,m.FunctionArgumentType=d.FunctionArgumentType,m.FunctionPluginValidationError=l.FunctionPluginValidationError,m.InvalidAddressError=l.InvalidAddressError,m.InvalidArgumentsError=l.InvalidArgumentsError,m.LanguageNotRegisteredError=l.LanguageNotRegisteredError,m.LanguageAlreadyRegisteredError=l.LanguageAlreadyRegisteredError,m.MissingTranslationError=l.MissingTranslationError,m.NamedExpressionDoesNotExistError=l.NamedExpressionDoesNotExistError,m.NamedExpressionNameIsAlreadyTakenError=l.NamedExpressionNameIsAlreadyTakenError,m.NamedExpressionNameIsInvalidError=l.NamedExpressionNameIsInvalidError,m.NoOperationToRedoError=l.NoOperationToRedoError,m.NoOperationToUndoError=l.NoOperationToUndoError,m.NoRelativeAddressesAllowedError=l.NoRelativeAddressesAllowedError,m.NoSheetWithIdError=l.NoSheetWithIdError,m.NoSheetWithNameError=l.NoSheetWithNameError,m.NotAFormulaError=l.NotAFormulaError,m.NothingToPasteError=l.NothingToPasteError,m.ProtectedFunctionTranslationError=l.ProtectedFunctionTranslationError,m.SheetNameAlreadyTakenError=l.SheetNameAlreadyTakenError,m.SheetSizeLimitExceededError=l.SheetSizeLimitExceededError,m.SourceLocationHasArrayError=l.SourceLocationHasArrayError,m.TargetLocationHasArrayError=l.TargetLocationHasArrayError,m.UnableToParseError=l.UnableToParseError;const f=i.Config.defaultConfig.language;h.HyperFormula.registerLanguage(f,c.default),h.HyperFormula.languages[c.default.langCode]=c.default;for(const e of Object.getOwnPropertyNames(p))e.startsWith("_")||h.HyperFormula.registerFunctionPlugin(p[e]);const y=m;window.HyperFormula=r(0).default},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArraySize:()=>a,ArraySizePredictor:()=>l});var n=r(2),s=r(93),o=r(94),i=r(7);class a{constructor(e,t,r=!1){if(this.width=e,this.height=t,this.isRef=r,e<=0||t<=0)throw Error("Incorrect array size")}static fromArray(e){return new a(e.length>0?e[0].length:0,e.length)}static error(){return new a(1,1,!0)}static scalar(){return new a(1,1,!1)}isScalar(){return this.width<=1&&this.height<=1||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 i.AstNodeType.FUNCTION_CALL:return this.checkArraySizeForFunction(e,t);case i.AstNodeType.COLUMN_RANGE:case i.AstNodeType.ROW_RANGE:case i.AstNodeType.CELL_RANGE:{const r=n.AbsoluteCellRange.fromAstOrUndef(e,t.formulaAddress);return void 0===r?a.error():new a(r.width(),r.height(),!0)}case i.AstNodeType.ARRAY:{const r=[],n=[];for(const s of e.args){const e=s.map((e=>this.checkArraySizeForAst(e,t))),o=Math.min(...e.map((e=>e.height))),i=e.reduce(((e,t)=>e+t.width),0);r.push(o),n.push(i)}const s=r.reduce(((e,t)=>e+t),0),o=Math.min(...n);return new a(o,s)}case i.AstNodeType.STRING:case i.AstNodeType.NUMBER:return a.scalar();case i.AstNodeType.CELL_REFERENCE:return new a(1,1,!0);case i.AstNodeType.DIV_OP:case i.AstNodeType.CONCATENATE_OP:case i.AstNodeType.EQUALS_OP:case i.AstNodeType.GREATER_THAN_OP:case i.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case i.AstNodeType.LESS_THAN_OP:case i.AstNodeType.LESS_THAN_OR_EQUAL_OP:case i.AstNodeType.MINUS_OP:case i.AstNodeType.NOT_EQUAL_OP:case i.AstNodeType.PLUS_OP:case i.AstNodeType.POWER_OP:case i.AstNodeType.TIMES_OP:{const r=this.checkArraySizeForAst(e.left,t),n=this.checkArraySizeForAst(e.right,t);return!t.arraysFlag&&(r.height>1||r.width>1||n.height>1||n.width>1)?a.error():(s=r,o=n,new a(Math.max(s.width,o.width),Math.max(s.height,o.height)))}case i.AstNodeType.MINUS_UNARY_OP:case i.AstNodeType.PLUS_UNARY_OP:case i.AstNodeType.PERCENT_OP:{const n=this.checkArraySizeForAst(e.value,t);return!t.arraysFlag&&(n.height>1||n.width>1)?a.error():new a((r=n).width,r.height)}case i.AstNodeType.PARENTHESIS:return this.checkArraySizeForAst(e.expression,t);case i.AstNodeType.EMPTY:default:return a.error()}var r,s,o}checkArraySizeForFunction(e,t){const r=this.functionRegistry.getMetadata(e.procedureName),n=this.functionRegistry.getArraySizeFunction(e.procedureName);if(void 0!==n)return n(e,t);const i=e.args.map((e=>{var n;return this.checkArraySizeForAst(e,new s.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))}));if(void 0===r||r.expandRanges||!t.arraysFlag||r.vectorizationForbidden||void 0===r.parameters)return new a(1,1);const l=[...r.parameters];if(void 0===r.repeatLastArgs&&l.length<i.length)return a.error();if(void 0!==r.repeatLastArgs&&l.length<i.length&&(i.length-l.length)%r.repeatLastArgs!=0)return a.error();for(;l.length<i.length;)l.push(...l.slice(l.length-r.repeatLastArgs));let u=1,h=1;for(let e=0;e<i.length;e++)l[e].argumentType!==o.FunctionArgumentType.RANGE&&l[e].argumentType!==o.FunctionArgumentType.ANY&&(h=Math.max(h,i[e].height),u=Math.max(u,i[e].width));return new a(u,h)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbsoluteCellRange:()=>h,AbsoluteColumnRange:()=>c,AbsoluteRowRange:()=>d,WRONG_RANGE_SIZE:()=>a,isSimpleCellRange:()=>l,simpleCellRange:()=>u});var n=r(3),s=r(77),o=r(7),i=r(71);const a="AbsoluteCellRange: Wrong range size";function l(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&("start"in e&&(0,n.isSimpleCellAddress)(e.start)&&"end"in e&&(0,n.isSimpleCellAddress)(e.end))}const u=(e,t)=>({start:e,end:t});class h{constructor(e,t){if(e.sheet!==t.sheet)throw new s.SheetsNotEqual(e.sheet,t.sheet);this.start=(0,n.simpleCellAddress)(e.sheet,e.col,e.row),this.end=(0,n.simpleCellAddress)(t.sheet,t.col,t.row)}get sheet(){return this.start.sheet}static fromSimpleCellAddresses(e,t){if(e.sheet!==t.sheet)throw new s.SheetsNotEqual(e.sheet,t.sheet);const r=t.col-e.col,n=t.row-e.row;return Number.isFinite(n)&&Number.isFinite(r)?new h(e,t):Number.isFinite(n)?new d(e.sheet,e.row,t.row):new c(e.sheet,e.col,t.col)}static fromAst(e,t){return e.type===o.AstNodeType.CELL_RANGE?h.fromCellRange(e,t):e.type===o.AstNodeType.COLUMN_RANGE?c.fromColumnRange(e,t):d.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){const n=h.spanFromOrUndef(e,t,r);if(void 0===n)throw new Error(a);return n}static spanFromOrUndef(e,t,r){if(!Number.isFinite(t)&&Number.isFinite(r)){if(0!==e.col)return;return new d(e.sheet,e.row,e.row+r-1)}if(!Number.isFinite(r)&&Number.isFinite(t)){if(0!==e.row)return;return new c(e.sheet,e.col,e.col+t-1)}if(Number.isFinite(r)&&Number.isFinite(t))return new h(e,(0,n.simpleCellAddress)(e.sheet,e.col+t-1,e.row+r-1))}static fromCoordinates(e,t,r,s,o){return new h((0,n.simpleCellAddress)(e,t,r),(0,n.simpleCellAddress)(e,s,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;const t=Math.max(this.start.row,e.start.row),r=Math.min(this.end.row,e.end.row),s=Math.max(this.start.col,e.start.col),o=Math.min(this.end.col,e.end.col);return t>r||s>o?void 0:new h((0,n.simpleCellAddress)(this.sheet,s,t),(0,n.simpleCellAddress)(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,n.simpleCellAddress)(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 i.RowsSpan?this.removeRows(e.start,e.end):this.removeColumns(e.start,e.end)}shouldBeRemoved(){return this.width()<=0||this.height()<=0}rangeWithSameWidth(e,t){return h.spanFrom((0,n.simpleCellAddress)(this.sheet,this.start.col,e),this.width(),t)}rangeWithSameHeight(e,t){return h.spanFrom((0,n.simpleCellAddress)(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(){const e=[];for(let t=0;t<this.height();++t){e[t]=[];for(let r=0;r<this.width();++r){const s=(0,n.simpleCellAddress)(this.sheet,this.start.col+r,this.start.row+t);e[t].push(s)}}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,n.equalSimpleCellAddress)(this.start,e.start)&&(0,n.equalSimpleCellAddress)(this.end,e.end)}addressesArrayMap(e,t){const r=[];let s=this.start.row;for(;s<=this.effectiveEndRow(e);){let o=this.start.col;const i=[];for(;o<=this.effectiveEndColumn(e);)i.push(t((0,n.simpleCellAddress)(this.start.sheet,o,s))),o++;r.push(i),s++}return r}addresses(e){const t=[];let r=this.start.row;const s=this.effectiveEndRow(e),o=this.effectiveEndColumn(e);for(;r<=s;){let e=this.start.col;for(;e<=o;)t.push((0,n.simpleCellAddress)(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,n.simpleCellAddress)(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,n.simpleCellAddress)(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,n.simpleCellAddress)(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,n.simpleCellAddress)(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,n.simpleCellAddress)(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){const r=t-e+1;return this.shiftByRows(-r)}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){const r=t-e+1;return this.shiftByColumns(-r)}e<=this.start.col&&(this.start.col=e),this.end.col-=Math.min(t,this.end.col)-e+1}}}class c extends h{constructor(e,t,r){super((0,n.simpleCellAddress)(e,t,0),(0,n.simpleCellAddress)(e,r,Number.POSITIVE_INFINITY))}static fromColumnRange(e,t){const r=e.start.toSimpleColumnAddress(t),n=e.end.toSimpleColumnAddress(t);if(r.sheet!==n.sheet)throw new s.SheetsNotEqual(r.sheet,n.sheet);return new c(r.sheet,r.col,n.col)}shouldBeRemoved(){return this.width()<=0}shiftByRows(e){}expandByRows(e){}shifted(e,t){return new c(this.sheet,this.start.col+e,this.end.col+e)}rangeWithSameHeight(e,t){return new c(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 d extends h{constructor(e,t,r){super((0,n.simpleCellAddress)(e,0,t),(0,n.simpleCellAddress)(e,Number.POSITIVE_INFINITY,r))}static fromRowRangeAst(e,t){const r=e.start.toSimpleRowAddress(t),n=e.end.toSimpleRowAddress(t);if(r.sheet!==n.sheet)throw new s.SheetsNotEqual(r.sheet,n.sheet);return new d(r.sheet,r.row,n.row)}shouldBeRemoved(){return this.height()<=0}shiftByColumns(e){}expandByColumns(e){}shifted(e,t){return new d(this.sheet,this.start.row+t,this.end.row+t)}rangeWithSameWidth(e,t){return new d(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){}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CellError:()=>E,CellType:()=>s,CellValueDetailedType:()=>p,CellValueJustNumber:()=>c,CellValueNoNumber:()=>h,CellValueType:()=>d,CellValueTypeOrd:()=>g,ErrorType:()=>n,absoluteSheetReference:()=>M,addressKey:()=>N,equalSimpleCellAddress:()=>b,getCellType:()=>u,getCellValueDetailedType:()=>f,getCellValueFormat:()=>y,getCellValueType:()=>m,invalidSimpleCellAddress:()=>v,invalidSimpleColumnAddress:()=>w,invalidSimpleRowAddress:()=>T,isSimpleCellAddress:()=>O,movedSimpleCellAddress:()=>A,simpleCellAddress:()=>S,simpleColumnAddress:()=>R,simpleRowAddress:()=>C});var n,s,o=r(4),i=r(61),a=r(70),l=r(69);!function(e){e.DIV_BY_ZERO="DIV_BY_ZERO",e.NAME="NAME",e.VALUE="VALUE",e.NUM="NUM",e.NA="NA",e.CYCLE="CYCLE",e.REF="REF",e.SPILL="SPILL",e.LIC="LIC",e.ERROR="ERROR"}(n||(n={})),function(e){e.FORMULA="FORMULA",e.VALUE="VALUE",e.ARRAY="ARRAY",e.EMPTY="EMPTY",e.ARRAYFORMULA="ARRAYFORMULA"}(s||(s={}));const u=(e,t)=>e instanceof o.ArrayVertex?e.isLeftCorner(t)?s.ARRAYFORMULA:s.ARRAY:e instanceof o.FormulaCellVertex||e instanceof o.ParsingErrorVertex?s.FORMULA:e instanceof o.ValueCellVertex?s.VALUE:s.EMPTY;var h,c;!function(e){e.EMPTY="EMPTY",e.NUMBER="NUMBER",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.ERROR="ERROR"}(h||(h={})),function(e){e.NUMBER="NUMBER"}(c||(c={}));const d=Object.assign(Object.assign({},h),c),p=Object.assign(Object.assign({},h),a.NumberType),g=e=>{switch(e){case d.EMPTY:return 0;case d.NUMBER:return 1;case d.STRING:return 2;case d.BOOLEAN:return 3;case d.ERROR:return 4}throw new Error("Cell value not computed")},m=e=>{if(e===a.EmptyValue)return d.EMPTY;if(e instanceof E||e instanceof l.SimpleRangeValue)return d.ERROR;if("string"==typeof e)return d.STRING;if((0,a.isExtendedNumber)(e))return d.NUMBER;if("boolean"==typeof e)return d.BOOLEAN;throw new Error("Cell value not computed")},f=e=>(0,a.isExtendedNumber)(e)?(0,a.getTypeOfExtendedNumber)(e):m(e),y=e=>(0,a.isExtendedNumber)(e)?(0,a.getFormatOfExtendedNumber)(e):void 0;class E{constructor(e,t,r){this.type=e,this.message=t,this.root=r}static parsingError(){return new E(n.ERROR,i.ErrorMessage.ParseError)}attachRootVertex(e){return void 0===this.root?new E(this.type,this.message,e):this}}const C=(e,t)=>({sheet:e,row:t}),T=e=>e.row<0,R=(e,t)=>({sheet:e,col:t}),w=e=>e.col<0,S=(e,t,r)=>({sheet:e,col:t,row:r}),v=e=>e.col<0||e.row<0,A=(e,t,r,n)=>S(t,e.col+r,e.row+n),N=e=>`${e.sheet},${e.row},${e.col}`;function O(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&("col"in e&&"number"==typeof e.col&&"row"in e&&"number"==typeof e.row&&"sheet"in e&&"number"==typeof e.sheet)}const M=(e,t)=>{var r;return null!==(r=e.sheet)&&void 0!==r?r:t.sheet},b=(e,t)=>e.sheet===t.sheet&&e.col===t.col&&e.row===t.row},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressMapping:()=>s.AddressMapping,ArrayMapping:()=>l.ArrayMapping,ArrayVertex:()=>u.ArrayVertex,DenseStrategy:()=>m.DenseStrategy,DependencyGraph:()=>n.DependencyGraph,EmptyCellVertex:()=>h.EmptyCellVertex,FormulaCellVertex:()=>u.FormulaCellVertex,Graph:()=>o.Graph,ParsingErrorVertex:()=>d.ParsingErrorVertex,RangeMapping:()=>i.RangeMapping,RangeVertex:()=>p.RangeVertex,SheetMapping:()=>a.SheetMapping,SparseStrategy:()=>g.SparseStrategy,ValueCellVertex:()=>c.ValueCellVertex});var n=r(5),s=r(76),o=r(83),i=r(84),a=r(85),l=r(78),u=r(80),h=r(88),c=r(89),d=r(90),p=r(82),g=r(91),m=r(92)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DependencyGraph:()=>R});var n=r(2),s=r(6),o=r(3),i=r(68),a=r(61),l=r(70),u=r(69),h=r(7),c=r(71),d=r(72),p=r(4),g=r(76),m=r(78),f=r(79),y=r(80),E=r(83),C=r(84),T=r(85);class R{constructor(e,t,r,a,l,u,c,d){this.addressMapping=e,this.rangeMapping=t,this.sheetMapping=r,this.arrayMapping=a,this.stats=l,this.lazilyTransformingAstService=u,this.functionRegistry=c,this.namedExpressions=d,this.changes=i.ContentChanges.empty(),this.dependencyQueryAddresses=e=>{if(e instanceof p.RangeVertex)return this.rangeDependencyQuery(e).map((([e,t])=>e));{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,r]=t;return r.map((t=>t instanceof h.NamedExpressionDependency?this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet).address:(0,o.isSimpleCellAddress)(t)?t:(0,n.simpleCellRange)(t.start,t.end)))}return[]}},this.dependencyQueryVertices=e=>{if(e instanceof p.RangeVertex)return this.rangeDependencyQuery(e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,r]=t;return r.map((t=>{if(t instanceof n.AbsoluteCellRange)return[t.start,this.rangeMapping.fetchRange(t.start,t.end)];if(t instanceof h.NamedExpressionDependency){const r=this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet);return[r.address,this.addressMapping.fetchCell(r.address)]}return[t,this.addressMapping.fetchCell(t)]}))}return[]}},this.rangeDependencyQuery=e=>{const t=[],{smallerRangeVertex:r,restRange:s}=this.rangeMapping.findSmallerRange(e.range);let o;void 0!==r&&this.graph.adjacentNodes(r).has(e)?(o=s,t.push([new n.AbsoluteCellRange(r.start,r.end),r])):o=e.range;for(const e of o.addresses(this)){const r=this.addressMapping.getCell(e);void 0!==r&&t.push([e,r])}return t},this.formulaDependencyQuery=e=>{let t,r;if(!(e instanceof y.FormulaVertex))return;r=e.getAddress(this.lazilyTransformingAstService),t=e.getFormula(this.lazilyTransformingAstService);const n=(0,h.collectDependencies)(t,this.functionRegistry);return[r,(0,s.absolutizeDependencies)(n,r)]},this.graph=new E.Graph(this.dependencyQueryVertices)}static buildEmpty(e,t,r,n,s){return new R(new g.AddressMapping(t.chooseAddressMappingPolicy),new C.RangeMapping,new T.SheetMapping(t.translationPackage),new m.ArrayMapping,s,e,r,n)}setFormulaToCell(e,t,r,n,s,o){const i=y.FormulaVertex.fromAst(t,e,n,this.lazilyTransformingAstService.version());return this.exchangeOrAddFormulaVertex(i),this.processCellDependencies(r,i),this.graph.markNodeAsSpecialRecentlyChanged(i),s&&this.markAsVolatile(i),o&&this.markAsDependentOnStructureChange(i),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setParsingErrorToCell(e,t){const r=this.shrinkPossibleArrayAndGetCell(e);return this.exchangeOrAddGraphNode(r,t),this.addressMapping.setCell(e,t),this.graph.markNodeAsSpecialRecentlyChanged(t),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setValueToCell(e,t){const r=this.shrinkPossibleArrayAndGetCell(e);if(r instanceof p.ArrayVertex&&this.arrayMapping.removeArray(r.getRange()),r instanceof p.ValueCellVertex){r.getValues().rawValue!==t.rawValue&&(r.setValues(t),this.graph.markNodeAsSpecialRecentlyChanged(r))}else{const n=new p.ValueCellVertex(t.parsedValue,t.rawValue);this.exchangeOrAddGraphNode(r,n),this.addressMapping.setCell(e,n),this.graph.markNodeAsSpecialRecentlyChanged(n)}return this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setCellEmpty(e){const t=this.shrinkPossibleArrayAndGetCell(e);if(void 0===t)return i.ContentChanges.empty();if(this.graph.adjacentNodes(t).size>0){const r=new p.EmptyCellVertex;this.exchangeGraphNode(t,r),0===this.graph.adjacentNodesCount(r)?(this.removeVertex(r),this.addressMapping.removeCell(e)):(this.graph.markNodeAsSpecialRecentlyChanged(r),this.addressMapping.setCell(e,r))}else this.removeVertex(t),this.addressMapping.removeCell(e);return this.getAndClearContentChanges()}ensureThatVertexIsNonArrayCellVertex(e){if(e instanceof p.ArrayVertex)throw new Error("Illegal operation")}clearRecentlyChangedVertices(){this.graph.clearSpecialNodesRecentlyChanged()}verticesToRecompute(){return new Set([...this.graph.specialNodesRecentlyChanged,...this.volatileVertices()])}processCellDependencies(e,t){e.forEach((e=>{if(e instanceof n.AbsoluteCellRange){const r=e;let n=this.getRange(r.start,r.end);void 0===n&&(n=new p.RangeVertex(r),this.rangeMapping.setRange(n)),this.graph.addNode(n),r.isFinite()||this.graph.markNodeAsInfiniteRange(n);const{smallerRangeVertex:s,restRange:o}=this.rangeMapping.findSmallerRange(r);if(void 0!==s){if(this.graph.addEdge(s,n),n.bruteForce){n.bruteForce=!1;for(const e of r.addresses(this))this.graph.removeEdge(this.fetchCell(e),n)}}else n.bruteForce=!0;const i=this.arrayMapping.getArray(o);if(void 0!==i)this.graph.addEdge(i,n);else for(const e of o.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(e),n);this.graph.addEdge(n,t),r.isFinite()&&this.correctInfiniteRangesDependenciesByRangeVertex(n)}else if(e instanceof h.NamedExpressionDependency){const r=t.getAddress(this.lazilyTransformingAstService).sheet,n=this.fetchNamedExpressionVertex(e.name,r);this.graph.addEdge(n,t)}else this.graph.addEdge(this.fetchCellOrCreateEmpty(e),t)}))}fetchNamedExpressionVertex(e,t){const r=this.namedExpressions.namedExpressionOrPlaceholder(e,t);return this.fetchCellOrCreateEmpty(r.address)}exchangeNode(e,t){const r=this.fetchCellOrCreateEmpty(e),n=this.fetchCellOrCreateEmpty(t);this.addressMapping.removeCell(e),this.exchangeGraphNode(r,n)}correctInfiniteRangesDependency(e){let t;for(const r of this.graph.infiniteRanges){const n=r;n.range.addressInRange(e)&&(t=null!=t?t:this.fetchCellOrCreateEmpty(e),this.graph.addEdge(t,n))}}fetchCellOrCreateEmpty(e){let t=this.addressMapping.getCell(e);return void 0===t&&(t=new p.EmptyCellVertex,this.graph.addNode(t),this.addressMapping.setCell(e,t)),t}removeRows(e){this.stats.measure(d.StatType.ADJUSTING_GRAPH,(()=>{for(const[t,r]of this.addressMapping.entriesFromRowsSpan(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsSpecialRecentlyChanged(e);if(r instanceof p.ArrayVertex){if(!r.isLeftCorner(t))continue;this.shrinkArrayToCorner(r),this.arrayMapping.removeArray(r.getRange())}this.removeVertex(r)}})),this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeRows(e)}));const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.truncateRanges(e,(e=>e.row));return this.getArrayVerticesRelatedToRanges(t)}));return this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,(()=>{this.fixArraysAfterRemovingRows(e.sheet,e.rowStart,e.numberOfRows)})),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}removeSheet(e){this.clearSheet(e);for(const[t,r]of this.addressMapping.sheetEntries(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsSpecialRecentlyChanged(e);this.removeVertex(r),this.addressMapping.removeCell(t)}this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.removeRangesInSheet(e);for(const e of t)this.removeVertex(e);this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeSheet(e)}))}))}clearSheet(e){const t=new Set;for(const[r,n]of this.addressMapping.sheetEntries(e))n instanceof p.ArrayVertex?t.add(n):this.setCellEmpty(r);for(const e of t.values())this.setArrayEmpty(e);this.addStructuralNodesToChangeSet()}removeColumns(e){this.stats.measure(d.StatType.ADJUSTING_GRAPH,(()=>{for(const[t,r]of this.addressMapping.entriesFromColumnsSpan(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsSpecialRecentlyChanged(e);if(r instanceof p.ArrayVertex){if(!r.isLeftCorner(t))continue;this.shrinkArrayToCorner(r),this.arrayMapping.removeArray(r.getRange())}this.removeVertex(r)}})),this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeColumns(e)}));const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.truncateRanges(e,(e=>e.col));return this.getArrayVerticesRelatedToRanges(t)}));return this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,(()=>this.fixArraysAfterRemovingColumns(e.sheet,e.columnStart,e.numberOfColumns))),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}addRows(e){this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.addRows(e.sheet,e.rowStart,e.numberOfRows)}));const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterRowByRows(e.sheet,e.rowStart,e.numberOfRows);return this.fixRangesWhenAddingRows(e.sheet,e.rowStart,e.numberOfRows),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)}));this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,(()=>{this.fixArraysAfterAddingRow(e.sheet,e.rowStart,e.numberOfRows)}));for(const t of this.addressMapping.verticesFromRowsSpan(e))this.graph.markNodeAsSpecialRecentlyChanged(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t}}addColumns(e){this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.addColumns(e.sheet,e.columnStart,e.numberOfColumns)}));const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterColumnByColumns(e.sheet,e.columnStart,e.numberOfColumns);return this.fixRangesWhenAddingColumns(e.sheet,e.columnStart,e.numberOfColumns),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)}));this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,(()=>this.fixArraysAfterAddingColumn(e.sheet,e.columnStart,e.numberOfColumns)));for(const t of this.addressMapping.verticesFromColumnsSpan(e))this.graph.markNodeAsSpecialRecentlyChanged(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}ensureNoArrayInRange(e){if(this.arrayMapping.isFormulaArrayInRange(e))throw Error("It is not possible to move / replace cells with array")}isThereSpaceForArray(e){const t=e.getRangeOrUndef();if(void 0===t)return!1;for(const r of t.addresses(this)){const t=this.addressMapping.getCell(r);if(void 0!==t&&!(t instanceof p.EmptyCellVertex)&&t!==e)return!1}return!0}moveCells(e,t,r,n){for(const s of e.addressesWithDirection(t,r,this)){const i=(0,o.simpleCellAddress)(n,s.col+t,s.row+r);let a=this.addressMapping.getCell(s);const l=this.addressMapping.getCell(i);if(this.addressMapping.removeCell(s),void 0!==a){let t;this.graph.markNodeAsSpecialRecentlyChanged(a),this.addressMapping.setCell(i,a);for(const r of this.graph.adjacentNodes(a))r instanceof p.RangeVertex&&!e.containsRange(r.range)&&(t=null!=t?t:this.fetchCellOrCreateEmpty(s),this.graph.addEdge(t,r),this.graph.removeEdge(a,r));t&&(this.graph.markNodeAsSpecialRecentlyChanged(t),this.addressMapping.setCell(s,t))}if(void 0!==l){void 0===a&&this.addressMapping.removeCell(i);for(const e of this.graph.adjacentNodes(l))a=null!=a?a:this.fetchCellOrCreateEmpty(i),this.graph.addEdge(a,e),this.graph.markNodeAsSpecialRecentlyChanged(a);this.removeVertex(l)}}for(const t of this.rangeMapping.rangeVerticesContainedInRange(e))for(const r of this.graph.adjacentNodes(t))if(r instanceof p.RangeVertex&&!e.containsRange(r.range)){this.graph.removeEdge(t,r);for(const e of t.range.addresses(this)){const t=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(t,r),this.addressMapping.setCell(e,t),this.graph.markNodeAsSpecialRecentlyChanged(t)}}this.rangeMapping.moveRangesInsideSourceRange(e,t,r,n)}setArrayEmpty(e){const t=n.AbsoluteCellRange.spanFrom(e.getAddress(this.lazilyTransformingAstService),e.width,e.height),r=this.graph.adjacentNodes(e);for(const e of t.addresses(this))this.addressMapping.removeCell(e);for(const t of r.values()){const r=(0,f.collectAddressesDependentToRange)(this.functionRegistry,t,e.getRange(),this.lazilyTransformingAstService,this);for(const e of r){const r=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(r,t)}r.length>0&&this.graph.markNodeAsSpecialRecentlyChanged(t)}this.removeVertex(e),this.arrayMapping.removeArray(e.getRange())}addVertex(e,t){this.graph.addNode(t),this.addressMapping.setCell(e,t)}addArrayVertex(e,t){this.graph.addNode(t),this.setAddressMappingForArrayVertex(t,e)}*arrayFormulaNodes(){for(const e of this.graph.nodes)e instanceof p.ArrayVertex&&(yield e)}*entriesFromRowsSpan(e){yield*this.addressMapping.entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.addressMapping.entriesFromColumnsSpan(e)}existsVertex(e){return this.addressMapping.has(e)}fetchCell(e){return this.addressMapping.fetchCell(e)}getCell(e){return this.addressMapping.getCell(e)}getCellValue(e){return this.addressMapping.getCellValue(e)}getRawValue(e){return this.addressMapping.getRawValue(e)}getScalarValue(e){const t=this.addressMapping.getCellValue(e);return t instanceof u.SimpleRangeValue?new o.CellError(o.ErrorType.VALUE,a.ErrorMessage.ScalarExpected):t}existsEdge(e,t){return this.graph.existsEdge(e,t)}getSheetId(e){return this.sheetMapping.fetch(e)}getSheetHeight(e){return this.addressMapping.getHeight(e)}getSheetWidth(e){return this.addressMapping.getWidth(e)}getArray(e){return this.arrayMapping.getArray(e)}setArray(e,t){this.arrayMapping.setArray(e,t)}getRange(e,t){return this.rangeMapping.getRange(e,t)}topSortWithScc(){return this.graph.topSortWithScc()}markAsVolatile(e){this.graph.markNodeAsSpecial(e)}markAsDependentOnStructureChange(e){this.graph.markNodeAsChangingWithStructure(e)}forceApplyPostponedTransformations(){for(const e of this.graph.nodes.values())e instanceof p.FormulaCellVertex&&e.ensureRecentData(this.lazilyTransformingAstService)}volatileVertices(){return this.graph.specialNodes}getArrayVerticesRelatedToRanges(e){const t=e.map((e=>this.graph.hasNode(e)?Array.from(this.graph.adjacentNodes(e)).filter((e=>e instanceof p.ArrayVertex)):[]));return new Set(...t)}*rawValuesFromRange(e){for(const t of e.addresses(this)){const e=this.getScalarValue(t);e!==l.EmptyValue&&(yield[(0,l.getRawValue)(e),t])}}*entriesFromRange(e){for(const t of e.addresses(this))yield[t,this.getCell(t)]}exchangeGraphNode(e,t){this.graph.addNode(t);const r=this.graph.adjacentNodes(e);this.removeVertex(e),r.forEach((e=>{this.graph.hasNode(e)&&this.graph.addEdge(t,e)}))}exchangeOrAddGraphNode(e,t){e?this.exchangeGraphNode(e,t):this.graph.addNode(t)}computeListOfValuesInRange(e){const t=[];for(const r of e.addresses(this)){const e=this.getScalarValue(r);t.push(e)}return t}shrinkArrayToCorner(e){this.cleanAddressMappingUnderArray(e);for(const t of this.adjacentArrayVertices(e)){let r;r=t instanceof y.FormulaVertex?this.formulaDirectDependenciesToArray(t,e):this.rangeDirectDependenciesToArray(t,e);let n=!1;for(const[s,o]of r)e.isLeftCorner(s)&&(n=!0),this.graph.addEdge(o,t),this.graph.markNodeAsSpecialRecentlyChanged(o);n||this.graph.removeEdge(e,t)}this.graph.markNodeAsSpecialRecentlyChanged(e)}isArrayInternalCell(e){const t=this.getCell(e);return t instanceof p.ArrayVertex&&!t.isLeftCorner(e)}getAndClearContentChanges(){const e=this.changes;return this.changes=i.ContentChanges.empty(),e}getAdjacentNodesAddresses(e){const t=this.graph.adjacentNodes(e),r=[];return t.forEach((e=>{const t=e;t instanceof p.RangeVertex?r.push((0,n.simpleCellRange)(t.start,t.end)):r.push(t.getAddress(this.lazilyTransformingAstService))})),r}correctInfiniteRangesDependenciesByRangeVertex(e){for(const t of this.graph.infiniteRanges){const r=t,n=e.range.intersectionWith(r.range);if(void 0!==n)for(const e of n.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(e),t)}}cleanAddressMappingUnderArray(e){const t=e.getRange();for(const r of t.addresses(this)){const t=e.getArrayCellValue(r);this.getCell(r)===e?e.isLeftCorner(r)?this.changes.addChange(new o.CellError(o.ErrorType.REF),r,t):(this.addressMapping.removeCell(r),this.changes.addChange(l.EmptyValue,r,t)):this.changes.addChange(l.EmptyValue,r,t)}}*formulaDirectDependenciesToArray(e,t){var r;const[,s]=null!==(r=this.formulaDependencyQuery(e))&&void 0!==r?r:[];if(void 0!==s)for(const e of s)if(!(e instanceof h.NamedExpressionDependency||e instanceof n.AbsoluteCellRange)&&t.getRange().addressInRange(e)){const t=this.fetchCellOrCreateEmpty(e);yield[e,t]}}*rangeDirectDependenciesToArray(e,t){const{restRange:r}=this.rangeMapping.findSmallerRange(e.range);for(const e of r.addresses(this))if(t.getRange().addressInRange(e)){const t=this.fetchCellOrCreateEmpty(e);yield[e,t]}}*adjacentArrayVertices(e){const t=this.graph.adjacentNodes(e);for(const e of t)(e instanceof y.FormulaVertex||e instanceof p.RangeVertex)&&(yield e)}addStructuralNodesToChangeSet(){for(const e of this.graph.specialNodesStructuralChanges)this.graph.markNodeAsSpecialRecentlyChanged(e)}fixRangesWhenAddingRows(e,t,r){const s=Array.from(this.rangeMapping.rangesInSheet(e));for(const e of s)if(e.range.includesRow(t+r))if(e.bruteForce){const n=e.range.rangeWithSameWidth(t,r);for(const t of n.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(t),e)}else{let t=e,r=this.rangeMapping.findSmallerRange(t.range);if(void 0!==r.smallerRangeVertex)continue;for(;void 0===r.smallerRangeVertex;){const e=new p.RangeVertex(n.AbsoluteCellRange.spanFrom(t.range.start,t.range.width(),t.range.height()-1));this.rangeMapping.setRange(e),this.graph.addNode(e);const s=new n.AbsoluteCellRange((0,o.simpleCellAddress)(t.range.start.sheet,t.range.start.col,t.range.end.row),t.range.end);this.addAllFromRange(s,t),this.graph.addEdge(e,t),t=e,r=this.rangeMapping.findSmallerRange(t.range)}this.graph.addEdge(r.smallerRangeVertex,t),this.addAllFromRange(r.restRange,t),this.graph.removeEdge(r.smallerRangeVertex,e)}}addAllFromRange(e,t){for(const r of e.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(r),t)}fixRangesWhenAddingColumns(e,t,r){for(const s of this.rangeMapping.rangesInSheet(e))if(s.range.includesColumn(t+r)){let i;i=s.bruteForce?s.range.rangeWithSameHeight(t,r):n.AbsoluteCellRange.spanFrom((0,o.simpleCellAddress)(e,t,s.range.end.row),r,1);for(const e of i.addresses(this))this.graph.addEdge(this.fetchCellOrCreateEmpty(e),s)}}exchangeOrAddFormulaVertex(e){const t=e.getAddress(this.lazilyTransformingAstService),r=n.AbsoluteCellRange.spanFrom(t,e.width,e.height),s=this.shrinkPossibleArrayAndGetCell(t);if(e instanceof p.ArrayVertex&&this.setArray(r,e),this.exchangeOrAddGraphNode(s,e),this.addressMapping.setCell(t,e),e instanceof p.ArrayVertex){if(!this.isThereSpaceForArray(e))return;for(const t of r.addresses(this)){if(e.isLeftCorner(t))continue;const r=this.getCell(t);this.exchangeOrAddGraphNode(r,e)}}for(const t of r.addresses(this))this.addressMapping.setCell(t,e)}setAddressMappingForArrayVertex(e,t){if(this.addressMapping.setCell(t,e),!(e instanceof p.ArrayVertex))return;const r=n.AbsoluteCellRange.spanFromOrUndef(t,e.width,e.height);if(void 0!==r&&(this.setArray(r,e),this.isThereSpaceForArray(e)))for(const t of r.addresses(this))this.addressMapping.setCell(t,e)}truncateRanges(e,t){const{verticesToRemove:r,verticesToMerge:n,verticesWithChangedSize:s}=this.rangeMapping.truncateRanges(e,t);for(const[e,t]of n)this.mergeRangeVertices(e,t);for(const e of r)this.removeVertexAndCleanupDependencies(e);return s}fixArraysAfterAddingRow(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,r),!(t<=0))for(const[,n]of this.arrayMapping.arraysInRows(c.RowsSpan.fromRowStartAndEnd(e,t-1,t-1))){const s=n.getRange();for(let i=s.start.col;i<=s.end.col;++i)for(let a=t;a<=s.end.row;++a){const t=(0,o.simpleCellAddress)(e,i,a),s=(0,o.simpleCellAddress)(e,i,a+r),u=n.getArrayCellValue(t);this.addressMapping.moveCell(s,t),this.changes.addChange(l.EmptyValue,s,u)}}}fixArraysAfterRemovingRows(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,-r),!(t<=0))for(const[,r]of this.arrayMapping.arraysInRows(c.RowsSpan.fromRowStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(const 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(const[,n]of this.arrayMapping.arraysInCols(c.ColumnsSpan.fromColumnStartAndEnd(e,t-1,t-1))){const s=n.getRange();for(let i=s.start.row;i<=s.end.row;++i)for(let a=t;a<=s.end.col;++a){const t=(0,o.simpleCellAddress)(e,a,i),s=(0,o.simpleCellAddress)(e,a+r,i),u=n.getArrayCellValue(t);this.addressMapping.moveCell(s,t),this.changes.addChange(l.EmptyValue,s,u)}}}fixArraysAfterRemovingColumns(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,-r),!(t<=0))for(const[,r]of this.arrayMapping.arraysInCols(c.ColumnsSpan.fromColumnStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(const e of r.getRange().addresses(this))this.addressMapping.setCell(e,r);else this.setNoSpaceIfArray(r)}shrinkPossibleArrayAndGetCell(e){const t=this.getCell(e);return t instanceof p.ArrayVertex?(this.setNoSpaceIfArray(t),this.getCell(e)):t}setNoSpaceIfArray(e){e instanceof p.ArrayVertex&&(this.shrinkArrayToCorner(e),e.setNoSpace())}removeVertex(e){this.removeVertexAndCleanupDependencies(e),e instanceof p.RangeVertex&&this.rangeMapping.removeRange(e)}mergeRangeVertices(e,t){const r=this.graph.adjacentNodes(t);this.removeVertexAndCleanupDependencies(t),this.graph.softRemoveEdge(e,t),r.forEach((t=>{this.graph.hasNode(t)&&this.graph.addEdge(e,t)}))}removeVertexAndCleanupDependencies(e){const t=new Set(this.graph.removeNode(e));for(;t.size>0;){const e=t.values().next().value;t.delete(e);const[r,n]=e;this.graph.hasNode(n)&&0===this.graph.adjacentNodesCount(n)&&((n instanceof p.RangeVertex||n instanceof p.EmptyCellVertex)&&this.graph.removeNode(n).forEach((e=>t.add(e))),n instanceof p.RangeVertex?this.rangeMapping.removeRange(n):n instanceof p.EmptyCellVertex&&this.addressMapping.removeCell(r))}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{absolutizeDependencies:()=>i,filterDependenciesOutOfScope:()=>a});var n=r(2),s=r(3),o=r(7);const i=(e,t)=>e.map((e=>e.absolutize(t))),a=e=>e.filter((e=>e instanceof o.NamedExpressionDependency||(e instanceof n.AbsoluteCellRange?!((0,s.invalidSimpleCellAddress)(e.start)||(0,s.invalidSimpleCellAddress)(e.end)):!(0,s.invalidSimpleCellAddress)(e))))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressDependency:()=>c.AddressDependency,AstNodeType:()=>u.AstNodeType,CellAddress:()=>s.CellAddress,CellRangeDependency:()=>c.CellRangeDependency,ColumnRangeDependency:()=>c.ColumnRangeDependency,FormulaLexer:()=>l.FormulaLexer,NamedExpressionDependency:()=>c.NamedExpressionDependency,ParserWithCaching:()=>o.ParserWithCaching,ParsingErrorType:()=>u.ParsingErrorType,RowRangeDependency:()=>c.RowRangeDependency,Unparser:()=>h.Unparser,buildCellErrorAst:()=>u.buildCellErrorAst,buildCellRangeAst:()=>u.buildCellRangeAst,buildLexerConfig:()=>a.buildLexerConfig,buildParsingErrorAst:()=>u.buildParsingErrorAst,buildProcedureAst:()=>u.buildProcedureAst,cellAddressFromString:()=>n.cellAddressFromString,collectDependencies:()=>i.collectDependencies,simpleCellAddressFromString:()=>n.simpleCellAddressFromString,simpleCellAddressToString:()=>n.simpleCellAddressToString,simpleCellRangeFromString:()=>n.simpleCellRangeFromString,simpleCellRangeToString:()=>n.simpleCellRangeToString});var n=r(8),s=r(9),o=r(13),i=r(66),a=r(62),l=r(60),u=r(57),h=r(65),c=r(67)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{cellAddressFromString:()=>p,columnAddressFromString:()=>g,columnIndexToLabel:()=>R,rowAddressFromString:()=>m,sheetIndexToString:()=>w,simpleCellAddressFromString:()=>f,simpleCellAddressToString:()=>E,simpleCellRangeFromString:()=>y,simpleCellRangeToString:()=>C});var n=r(2),s=r(3),o=r(9),i=r(10),a=r(12),l=r(11);const u=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([A-Za-z]+)(\\${a.ABSOLUTE_OPERATOR}?)([0-9]+)$`),h=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([A-Za-z]+)$`),c=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([0-9]+)$`),d=new RegExp(`^${a.UNQUOTED_SHEET_NAME_PATTERN}$`),p=(e,t,r)=>{const n=u.exec(t),s=T(n[6]);let i=S(n,e);if(void 0===i)return;null===i&&(i=void 0);const l=Number(n[8])-1;return n[5]===a.ABSOLUTE_OPERATOR&&n[7]===a.ABSOLUTE_OPERATOR?o.CellAddress.absolute(s,l,i):n[5]===a.ABSOLUTE_OPERATOR?o.CellAddress.absoluteCol(s,l-r.row,i):n[7]===a.ABSOLUTE_OPERATOR?o.CellAddress.absoluteRow(s-r.col,l,i):o.CellAddress.relative(s-r.col,l-r.row,i)},g=(e,t,r)=>{const n=h.exec(t);let s=S(n,e);if(void 0===s)return;null===s&&(s=void 0);const o=T(n[6]);return n[5]===a.ABSOLUTE_OPERATOR?i.ColumnAddress.absolute(o,s):i.ColumnAddress.relative(o-r.col,s)},m=(e,t,r)=>{const n=c.exec(t);let s=S(n,e);if(void 0===s)return;null===s&&(s=void 0);const o=Number(n[6])-1;return n[5]===a.ABSOLUTE_OPERATOR?l.RowAddress.absolute(o,s):l.RowAddress.relative(o-r.row,s)},f=(e,t,r)=>{const n=u.exec(t),o=T(n[6]);let i=S(n,e);if(void 0===i)return;null===i&&(i=r);const a=Number(n[8])-1;return(0,s.simpleCellAddress)(i,o,a)},y=(e,t,r)=>{const s=t.split(a.RANGE_OPERATOR);if(2!==s.length)return;const[o,i]=s,l=f(e,o,r);if(void 0===l)return;const u=f(e,i,l.sheet);return void 0!==u&&l.sheet===u.sheet?(0,n.simpleCellRange)(l,u):void 0},E=(e,t,r)=>{const n=R(t.col),s=w(t.sheet,e);if(void 0!==s)return r!==t.sheet?`${s}!${n}${t.row+1}`:`${n}${t.row+1}`},C=(e,t,r)=>{const n=E(e,t.start,r),s=E(e,t.end,t.start.sheet);return void 0===n||void 0===s?void 0:`${n}${a.RANGE_OPERATOR}${s}`};function T(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 R(e){let t="";for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}function w(e,t){let r=t(e);if(void 0!==r)return d.test(r)?r:(r=r.replace(/'/g,"''"),`'${r}'`)}function S(e,t){var r;let n=null!==(r=e[3])&&void 0!==r?r:e[2];return n?(n=n.replace(/''/g,"'"),t(n)):null}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CellAddress:()=>l,CellReferenceType:()=>n});var n,s=r(3),o=r(8),i=r(10),a=r(11);!function(e){e.CELL_REFERENCE_RELATIVE="CELL_REFERENCE",e.CELL_REFERENCE_ABSOLUTE="CELL_REFERENCE_ABSOLUTE",e.CELL_REFERENCE_ABSOLUTE_COL="CELL_REFERENCE_ABSOLUTE_COL",e.CELL_REFERENCE_ABSOLUTE_ROW="CELL_REFERENCE_ABSOLUTE_ROW"}(n||(n={}));class l{constructor(e,t,r,n){this.col=e,this.row=t,this.type=r,this.sheet=n}static fromColAndRow(e,t,r){return(e.isColumnAbsolute()&&t.isRowAbsolute()?l.absolute.bind(this):e.isColumnAbsolute()?l.absoluteCol.bind(this):t.isRowAbsolute()?l.absoluteRow.bind(this):l.relative.bind(this))(e.col,t.row,r)}static relative(e,t,r){return new l(e,t,n.CELL_REFERENCE_RELATIVE,r)}static absolute(e,t,r){return new l(e,t,n.CELL_REFERENCE_ABSOLUTE,r)}static absoluteCol(e,t,r){return new l(e,t,n.CELL_REFERENCE_ABSOLUTE_COL,r)}static absoluteRow(e,t,r){return new l(e,t,n.CELL_REFERENCE_ABSOLUTE_ROW,r)}toSimpleCellAddress(e){const t=(0,s.absoluteSheetReference)(this,e);return this.type===n.CELL_REFERENCE_ABSOLUTE?(0,s.simpleCellAddress)(t,this.col,this.row):this.type===n.CELL_REFERENCE_ABSOLUTE_ROW?(0,s.simpleCellAddress)(t,e.col+this.col,this.row):this.type===n.CELL_REFERENCE_ABSOLUTE_COL?(0,s.simpleCellAddress)(t,this.col,e.row+this.row):(0,s.simpleCellAddress)(t,e.col+this.col,e.row+this.row)}toColumnAddress(){const e=this.isColumnRelative()?i.ReferenceType.RELATIVE:i.ReferenceType.ABSOLUTE;return new i.ColumnAddress(e,this.col,this.sheet)}toRowAddress(){const e=this.isRowRelative()?i.ReferenceType.RELATIVE:i.ReferenceType.ABSOLUTE;return new a.RowAddress(e,this.row,this.sheet)}toSimpleColumnAddress(e){const t=(0,s.absoluteSheetReference)(this,e);let r=this.col;return this.isColumnRelative()&&(r+=e.col),(0,s.simpleColumnAddress)(t,r)}toSimpleRowAddress(e){const t=(0,s.absoluteSheetReference)(this,e);let r=this.row;return this.isRowRelative()&&(r+=e.row),(0,s.simpleRowAddress)(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 l(this.col,this.row+e,this.type,this.sheet)}shiftedByColumns(e){return new l(this.col+e,this.row,this.type,this.sheet)}moved(e,t,r){const n=void 0===this.sheet?void 0:e;return new l(this.col+t,this.row+r,this.type,n)}withSheet(e){return new l(this.col,this.row,this.type,e)}isInvalid(e){return(0,s.invalidSimpleCellAddress)(this.toSimpleCellAddress(e))}shiftRelativeDimensions(e,t){const r=this.isColumnAbsolute()?this.col:this.col+e,n=this.isRowAbsolute()?this.row:this.row+t;return new l(r,n,this.type,this.sheet)}shiftAbsoluteDimensions(e,t){const r=this.isColumnRelative()?this.col:this.col+e,n=this.isRowRelative()?this.row:this.row+t;return new l(r,n,this.type,this.sheet)}hash(e){const 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){const t=this.toSimpleCellAddress(e);if((0,s.invalidSimpleCellAddress)(t))return;const r=(0,o.columnIndexToLabel)(t.col),i=this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_ROW?"$":"";return`${this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_COL?"$":""}${r}${i}${t.row+1}`}exceedsSheetSizeLimits(e,t){return this.row>=t||this.col>=e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ColumnAddress:()=>i,ReferenceType:()=>n});var n,s=r(3),o=r(8);!function(e){e.RELATIVE="RELATIVE",e.ABSOLUTE="ABSOLUTE"}(n||(n={}));class i{constructor(e,t,r){this.type=e,this.col=t,this.sheet=r}static absolute(e,t){return new i(n.ABSOLUTE,e,t)}static relative(e,t){return new i(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){const n=void 0===this.sheet?void 0:e;return new i(this.type,this.col+t,n)}shiftedByColumns(e){return new i(this.type,this.col+e,this.sheet)}toSimpleColumnAddress(e){const t=(0,s.absoluteSheetReference)(this,e);let r=this.col;return this.isColumnRelative()&&(r=e.col+this.col),(0,s.simpleColumnAddress)(t,r)}shiftRelativeDimensions(e,t){const r=this.isColumnRelative()?this.col+e:this.col;return new i(this.type,r,this.sheet)}shiftAbsoluteDimensions(e,t){const r=this.isColumnAbsolute()?this.col+e:this.col;return new i(this.type,r,this.sheet)}withSheet(e){return new i(this.type,this.col,e)}isInvalid(e){return this.toSimpleColumnAddress(e).col<0}hash(e){const 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){const t=this.toSimpleColumnAddress(e);if((0,s.invalidSimpleColumnAddress)(t))return;const r=(0,o.columnIndexToLabel)(t.col);return`${this.type===n.ABSOLUTE?"$":""}${r}`}exceedsSheetSizeLimits(e){return this.col>=e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RowAddress:()=>o});var n=r(3),s=r(10);class o{constructor(e,t,r){this.type=e,this.row=t,this.sheet=r}static absolute(e,t){return new o(s.ReferenceType.ABSOLUTE,e,t)}static relative(e,t){return new o(s.ReferenceType.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,r)=>t.toSimpleRowAddress(e).row-r.toSimpleRowAddress(e).row}isRowAbsolute(){return this.type===s.ReferenceType.ABSOLUTE}isRowRelative(){return this.type===s.ReferenceType.RELATIVE}isAbsolute(){return this.type===s.ReferenceType.ABSOLUTE&&void 0!==this.sheet}moved(e,t,r){const n=void 0===this.sheet?void 0:e;return new o(this.type,this.row+r,n)}shiftedByRows(e){return new o(this.type,this.row+e,this.sheet)}toSimpleRowAddress(e){const t=(0,n.absoluteSheetReference)(this,e);let r=this.row;return this.isRowRelative()&&(r=e.row+this.row),(0,n.simpleRowAddress)(t,r)}shiftRelativeDimensions(e,t){const r=this.isRowRelative()?this.row+t:this.row;return new o(this.type,r,this.sheet)}shiftAbsoluteDimensions(e,t){const 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){const t=e&&void 0!==this.sheet?`#${this.sheet}`:"";switch(this.type){case s.ReferenceType.RELATIVE:return`${t}#ROWR${this.row}`;case s.ReferenceType.ABSOLUTE:return`${t}#ROWA${this.row}`}}unparse(e){const t=this.toSimpleRowAddress(e);if((0,n.invalidSimpleRowAddress)(t))return;return`${this.type===s.ReferenceType.ABSOLUTE?"$":""}${t.row+1}`}exceedsSheetSizeLimits(e){return this.row>=e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ABSOLUTE_OPERATOR:()=>s,ALL_DIGITS_ARRAY:()=>E,ALL_UNICODE_LETTERS_ARRAY:()=>C,ALL_WHITESPACE_PATTERN:()=>o,CELL_REFERENCE_PATTERN:()=>d,CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN:()=>f,COLUMN_REFERENCE_PATTERN:()=>p,NAMED_EXPRESSION_PATTERN:()=>y,NON_RESERVED_CHARACTER_PATTERN:()=>l,ODFF_WHITESPACE_PATTERN:()=>i,QUOTED_SHEET_NAME_PATTERN:()=>h,R1C1_CELL_REFERENCE_PATTERN:()=>m,RANGE_OPERATOR:()=>n,ROW_REFERENCE_PATTERN:()=>g,SHEET_NAME_PATTERN:()=>c,UNICODE_LETTER_PATTERN:()=>a,UNQUOTED_SHEET_NAME_PATTERN:()=>u});const n=":",s="$",o="\\s+",i="[ \\t\\n\\r]+",a="A-Za-zÀ-ʯ",l=`${a}0-9_.`,u=`[${a}0-9_]+`,h="'(((?!').|'')*)'",c=`(${u}|${h})!`,d=`(${c})?\\${s}?[A-Za-z]+\\${s}?[0-9]+`,p=`(${c})?\\${s}?[A-Za-z]+`,g=`(${c})?\\${s}?[0-9]+`,m="[rR][0-9]*[cC][0-9]*",f=`(${d})[^${l}]`,y=`[${a}_][${l}]*`,E=["0","1","2","3","4","5","6","7","8","9"],C=[...Array.from(Array(26)).map(((e,t)=>t+"A".charCodeAt(0))),...Array.from(Array(26)).map(((e,t)=>t+"a".charCodeAt(0))),...Array.from(Array(496)).map(((e,t)=>t+192))].map((e=>String.fromCharCode(e)))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ParserWithCaching:()=>m});var n=r(14),s=r(3),o=r(7),i=r(8),a=r(57),l=r(58),u=r(59),h=r(60),c=r(62),d=r(65),p=r(10),g=r(11);class m{constructor(e,t,r){this.config=e,this.functionRegistry=t,this.sheetMapping=r,this.statsCacheUsed=0,this.lexerConfig=(0,c.buildLexerConfig)(e),this.lexer=new h.FormulaLexer(this.lexerConfig),this.formulaParser=new h.FormulaParser(this.lexerConfig,this.sheetMapping),this.cache=new u.Cache(this.functionRegistry)}parse(e,t){this.formulaAddress=t;const r=this.tokenizeFormula(e);if(r.errors.length>0){const e=r.errors.map((e=>({type:a.ParsingErrorType.LexingError,message:e.message})));return{ast:(0,o.buildParsingErrorAst)(),errors:e,hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]}}const n=this.computeHashFromTokens(r.tokens,t);let s=this.cache.get(n);if(void 0!==s)++this.statsCacheUsed;else{const 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:[]});s=this.cache.set(n,o.ast)}const{ast:i,hasVolatileFunction:l,hasStructuralChangeFunction:u}=s,h=this.convertReversedRangesToRegularRanges(i);return{ast:h,errors:[],hasVolatileFunction:l,hasStructuralChangeFunction:u,dependencies:(0,o.collectDependencies)(h,this.functionRegistry)}}convertReversedRangesToRegularRanges(e){switch(e.type){case o.AstNodeType.EMPTY:case o.AstNodeType.NUMBER:case o.AstNodeType.STRING:case o.AstNodeType.ERROR:case o.AstNodeType.ERROR_WITH_RAW_INPUT:case o.AstNodeType.CELL_REFERENCE:case o.AstNodeType.NAMED_EXPRESSION:return e;case o.AstNodeType.CELL_RANGE:{const{start:t,end:r}=e,n=this.orderCellRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case o.AstNodeType.COLUMN_RANGE:{const{start:t,end:r}=e,n=this.orderColumnRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case o.AstNodeType.ROW_RANGE:{const{start:t,end:r}=e,n=this.orderRowRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case o.AstNodeType.PERCENT_OP:case o.AstNodeType.PLUS_UNARY_OP:case o.AstNodeType.MINUS_UNARY_OP:{const t=this.convertReversedRangesToRegularRanges(e.value);return Object.assign(Object.assign({},e),{value:t})}case o.AstNodeType.CONCATENATE_OP:case o.AstNodeType.EQUALS_OP:case o.AstNodeType.NOT_EQUAL_OP:case o.AstNodeType.LESS_THAN_OP:case o.AstNodeType.GREATER_THAN_OP:case o.AstNodeType.LESS_THAN_OR_EQUAL_OP:case o.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case o.AstNodeType.MINUS_OP:case o.AstNodeType.PLUS_OP:case o.AstNodeType.TIMES_OP:case o.AstNodeType.DIV_OP:case o.AstNodeType.POWER_OP:{const t=this.convertReversedRangesToRegularRanges(e.left),r=this.convertReversedRangesToRegularRanges(e.right);return Object.assign(Object.assign({},e),{left:t,right:r})}case o.AstNodeType.PARENTHESIS:{const t=this.convertReversedRangesToRegularRanges(e.expression);return Object.assign(Object.assign({},e),{expression:t})}case o.AstNodeType.FUNCTION_CALL:{const t=e.args.map((e=>this.convertReversedRangesToRegularRanges(e)));return Object.assign(Object.assign({},e),{args:t})}case o.AstNodeType.ARRAY:{const t=e.args.map((e=>e.map((e=>this.convertReversedRangesToRegularRanges(e)))));return Object.assign(Object.assign({},e),{args:t})}}}orderCellRangeEnds(e,t){const r=[e,t],[n,s]=r.map((e=>e.toColumnAddress())).sort(p.ColumnAddress.compareByAbsoluteAddress(this.formulaAddress)),[i,a]=r.map((e=>e.toRowAddress())).sort(g.RowAddress.compareByAbsoluteAddress(this.formulaAddress)),[l,u]=r.map((e=>e.sheet)).sort(m.compareSheetIds.bind(this));return{start:o.CellAddress.fromColAndRow(n,i,l),end:o.CellAddress.fromColAndRow(s,a,u)}}orderColumnRangeEnds(e,t){const r=[e,t],[n,s]=r.sort(p.ColumnAddress.compareByAbsoluteAddress(this.formulaAddress)),[o,i]=r.map((e=>e.sheet)).sort(m.compareSheetIds.bind(this));return{start:new p.ColumnAddress(n.type,n.col,o),end:new p.ColumnAddress(s.type,s.col,i)}}orderRowRangeEnds(e,t){const r=[e,t],[n,s]=r.sort(g.RowAddress.compareByAbsoluteAddress(this.formulaAddress)),[o,i]=r.map((e=>e.sheet)).sort(m.compareSheetIds.bind(this));return{start:new g.RowAddress(n.type,n.row,o),end:new g.RowAddress(s.type,s.row,i)}}static compareSheetIds(e,t){return(e=null!=e?e:1/0)-(t=null!=t?t:1/0)}fetchCachedResultForAst(e){const t=this.computeHashFromAst(e);return this.fetchCachedResult(t)}fetchCachedResult(e){const t=this.cache.get(e);if(void 0===t)throw new Error("There is no AST with such key in the cache");{const{ast:e,hasVolatileFunction:r,hasStructuralChangeFunction:n,relativeDependencies:s}=t;return{ast:e,errors:[],hasVolatileFunction:r,hasStructuralChangeFunction:n,dependencies:s}}}computeHashFromTokens(e,t){var r;let s="",o=0;for(;o<e.length;){const a=e[o];if((0,n.tokenMatcher)(a,c.CellReference)){const e=(0,i.cellAddressFromString)(this.sheetMapping,a.image,t);s=void 0===e?s.concat(a.image):s.concat(e.hash(!0))}else if((0,n.tokenMatcher)(a,c.ProcedureName)){const e=a.image.toUpperCase().slice(0,-1),t=null!==(r=this.lexerConfig.functionMapping[e])&&void 0!==r?r:e;s=s.concat(t,"(")}else if((0,n.tokenMatcher)(a,c.ColumnRange)){const[e,r]=a.image.split(":"),n=(0,i.columnAddressFromString)(this.sheetMapping,e,t),o=(0,i.columnAddressFromString)(this.sheetMapping,r,t);s=void 0===n||void 0===o?s.concat("!REF"):s.concat(n.hash(!0),":",o.hash(!0))}else if((0,n.tokenMatcher)(a,c.RowRange)){const[e,r]=a.image.split(":"),n=(0,i.rowAddressFromString)(this.sheetMapping,e,t),o=(0,i.rowAddressFromString)(this.sheetMapping,r,t);s=void 0===n||void 0===o?s.concat("!REF"):s.concat(n.hash(!0),":",o.hash(!0))}else s=s.concat(a.image);o++}return s}rememberNewAst(e){const t=this.computeHashFromAst(e);return this.cache.maybeSetAndThenGet(t,e)}computeHashFromAst(e){return"="+this.computeHashOfAstNode(e)}computeHashOfAstNode(e){switch(e.type){case o.AstNodeType.EMPTY:return e.leadingWhitespace||"";case o.AstNodeType.NUMBER:return(0,a.imageWithWhitespace)((0,d.formatNumber)(e.value,this.config.decimalSeparator),e.leadingWhitespace);case o.AstNodeType.STRING:return(0,a.imageWithWhitespace)('"'+e.value+'"',e.leadingWhitespace);case o.AstNodeType.NAMED_EXPRESSION:return(0,a.imageWithWhitespace)(e.expressionName,e.leadingWhitespace);case o.AstNodeType.FUNCTION_CALL:{const t=e.args.map((e=>this.computeHashOfAstNode(e))).join(this.config.functionArgSeparator),r=e.procedureName+"("+t+(0,a.imageWithWhitespace)(")",e.internalWhitespace);return(0,a.imageWithWhitespace)(r,e.leadingWhitespace)}case o.AstNodeType.CELL_REFERENCE:return(0,a.imageWithWhitespace)(e.reference.hash(!0),e.leadingWhitespace);case o.AstNodeType.COLUMN_RANGE:case o.AstNodeType.ROW_RANGE:case o.AstNodeType.CELL_RANGE:{const t=e.start.hash(e.sheetReferenceType!==a.RangeSheetReferenceType.RELATIVE),r=e.end.hash(e.sheetReferenceType===a.RangeSheetReferenceType.BOTH_ABSOLUTE);return(0,a.imageWithWhitespace)(t+":"+r,e.leadingWhitespace)}case o.AstNodeType.MINUS_UNARY_OP:return(0,a.imageWithWhitespace)("-"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case o.AstNodeType.PLUS_UNARY_OP:return(0,a.imageWithWhitespace)("+"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case o.AstNodeType.PERCENT_OP:return this.computeHashOfAstNode(e.value)+(0,a.imageWithWhitespace)("%",e.leadingWhitespace);case o.AstNodeType.ERROR:{const t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:s.ErrorType.ERROR);return(0,a.imageWithWhitespace)(t,e.leadingWhitespace)}case o.AstNodeType.ERROR_WITH_RAW_INPUT:return(0,a.imageWithWhitespace)(e.rawInput,e.leadingWhitespace);case o.AstNodeType.ARRAY:{const t=e.args.map((e=>e.map((e=>this.computeHashOfAstNode(e))).join(","))).join(";");return(0,a.imageWithWhitespace)("{"+t+(0,a.imageWithWhitespace)("}",e.internalWhitespace),e.leadingWhitespace)}case o.AstNodeType.PARENTHESIS:{const t="("+this.computeHashOfAstNode(e.expression)+(0,a.imageWithWhitespace)(")",e.internalWhitespace);return(0,a.imageWithWhitespace)(t,e.leadingWhitespace)}default:return this.computeHashOfAstNode(e.left)+(0,a.imageWithWhitespace)(l.binaryOpTokenMap[e.type],e.leadingWhitespace)+this.computeHashOfAstNode(e.right)}}bindWhitespacesToTokens(e){const t=[],r=e[0];(0,n.tokenMatcher)(r,this.lexerConfig.WhiteSpace)||t.push(r);for(let r=1;r<e.length;++r){const s=e[r];if((0,n.tokenMatcher)(s,this.lexerConfig.WhiteSpace))continue;const o=e[r-1];(0,n.tokenMatcher)(o,this.lexerConfig.WhiteSpace)&&(s.leadingWhitespace=o),t.push(s)}return t}tokenizeFormula(e){return this.lexer.tokenizeFormula(e)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Alternation:()=>h.Alternation,CstParser:()=>s.CstParser,EMPTY_ALT:()=>s.EMPTY_ALT,EOF:()=>i.EOF,EarlyExitException:()=>l.EarlyExitException,EmbeddedActionsParser:()=>s.EmbeddedActionsParser,Flat:()=>h.Flat,GAstVisitor:()=>c.GAstVisitor,Lexer:()=>o.Lexer,LexerDefinitionErrorType:()=>o.LexerDefinitionErrorType,MismatchedTokenException:()=>l.MismatchedTokenException,NoViableAltException:()=>l.NoViableAltException,NonTerminal:()=>h.NonTerminal,NotAllInputParsedException:()=>l.NotAllInputParsedException,Option:()=>h.Option,Parser:()=>s.Parser,ParserDefinitionErrorType:()=>s.ParserDefinitionErrorType,Repetition:()=>h.Repetition,RepetitionMandatory:()=>h.RepetitionMandatory,RepetitionMandatoryWithSeparator:()=>h.RepetitionMandatoryWithSeparator,RepetitionWithSeparator:()=>h.RepetitionWithSeparator,Rule:()=>h.Rule,Terminal:()=>h.Terminal,VERSION:()=>n.VERSION,assignOccurrenceIndices:()=>d.assignOccurrenceIndices,clearCache:()=>m,createSyntaxDiagramsCode:()=>p.createSyntaxDiagramsCode,createToken:()=>i.createToken,createTokenInstance:()=>i.createTokenInstance,defaultGrammarResolverErrorProvider:()=>a.defaultGrammarResolverErrorProvider,defaultGrammarValidatorErrorProvider:()=>a.defaultGrammarValidatorErrorProvider,defaultLexerErrorProvider:()=>u.defaultLexerErrorProvider,defaultParserErrorProvider:()=>a.defaultParserErrorProvider,generateParserFactory:()=>g.generateParserFactory,generateParserModule:()=>g.generateParserModule,isRecognitionException:()=>l.isRecognitionException,resolveGrammar:()=>d.resolveGrammar,serializeGrammar:()=>h.serializeGrammar,serializeProduction:()=>h.serializeProduction,tokenLabel:()=>i.tokenLabel,tokenMatcher:()=>i.tokenMatcher,tokenName:()=>i.tokenName,validateGrammar:()=>d.validateGrammar});var n=r(15),s=r(16),o=r(22),i=r(21),a=r(35),l=r(42),u=r(28),h=r(20),c=r(31),d=r(39),p=r(54),g=r(55);function m(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{VERSION:()=>n});var n="6.5.0"},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CstParser:()=>O,DEFAULT_PARSER_CONFIG:()=>S,DEFAULT_RULE_CONFIG:()=>v,EMPTY_ALT:()=>A,END_OF_FILE:()=>R,EmbeddedActionsParser:()=>M,Parser:()=>N,ParserDefinitionErrorType:()=>w});var n,s=r(17),o=r(18),i=r(21),a=r(33),l=r(35),u=r(39),h=r(41),c=r(43),d=r(44),p=r(47),g=r(48),m=r(49),f=r(50),y=r(51),E=r(52),C=r(53),T=(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])},n(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)}),R=(0,i.createTokenInstance)(i.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(R);var w,S=Object.freeze({recoveryEnabled:!1,maxLookahead:4,ignoredIssues:{},dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:l.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),v=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function A(e){return void 0===e&&(e=void 0),function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.INVALID_NESTED_RULE_NAME=10]="INVALID_NESTED_RULE_NAME",e[e.DUPLICATE_NESTED_NAME=11]="DUPLICATE_NESTED_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=12]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=13]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=14]="TOO_MANY_ALTS"}(w||(w={}));var N=function(){function e(e,t){void 0===t&&(t=S),this.ignoredIssues=S.ignoredIssues,this.definitionErrors=[],this.selfAnalysisDone=!1;var r=this;r.initErrorHandler(t),r.initLexerAdapter(),r.initLooksAhead(t),r.initRecognizerEngine(e,t),r.initRecoverable(t),r.initTreeBuilder(t),r.initContentAssist(),r.initGastRecorder(t),r.initPerformanceTracer(t),(0,s.has)(t,"ignoredIssues")&&t.ignoredIssues!==S.ignoredIssues&&(0,s.PRINT_WARNING)("The <ignoredIssues> IParserConfig property is soft-deprecated and will be removed in future versions.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead."),this.ignoredIssues=(0,s.has)(t,"ignoredIssues")?t.ignoredIssues:S.ignoredIssues,this.skipValidations=(0,s.has)(t,"skipValidations")?t.skipValidations:S.skipValidations}return e.performSelfAnalysis=function(e){e.performSelfAnalysis()},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var r;t.selfAnalysisDone=!0;var n=t.className;t.TRACE_INIT("toFastProps",(function(){(0,s.toFastProperties)(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),(0,s.forEach)(t.definedRulesNames,(function(e){var r=t[e].originalGrammarAction,n=void 0;t.TRACE_INIT(e+" Rule",(function(){n=t.topLevelRuleRecord(e,r)})),t.gastProductionsCache[e]=n}))}finally{t.disableRecording()}}));var i=[];if(t.TRACE_INIT("Grammar Resolving",(function(){i=(0,u.resolveGrammar)({rules:(0,s.values)(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,i)})),t.TRACE_INIT("Grammar Validations",(function(){if((0,s.isEmpty)(i)&&!1===t.skipValidations){var e=(0,u.validateGrammar)({rules:(0,s.values)(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:(0,s.values)(t.tokensMap),ignoredIssues:t.ignoredIssues,errMsgProvider:l.defaultGrammarValidatorErrorProvider,grammarName:n});t.definitionErrors.push.apply(t.definitionErrors,e)}})),(0,s.isEmpty)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e=(0,o.computeAllProdsFollows)((0,s.values)(t.gastProductionsCache));t.resyncFollows=e})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){t.preComputeLookaheadFunctions((0,s.values)(t.gastProductionsCache))}))),t.TRACE_INIT("expandAllNestedRuleNames",(function(){var e=(0,a.expandAllNestedRuleNames)((0,s.values)(t.gastProductionsCache),t.fullRuleNameToShort);t.allRuleNames=e.allRuleNames})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,s.isEmpty)(t.definitionErrors))throw r=(0,s.map)(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n "+r.join("\n-------------------------------\n"))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();(0,s.applyMixins)(N,[h.Recoverable,c.LooksAhead,d.TreeBuilder,p.LexerAdapter,m.RecognizerEngine,g.RecognizerApi,f.ErrorHandler,y.ContentAssist,E.GastRecorder,C.PerformanceTracer]);var O=function(e){function t(t,r){void 0===r&&(r=S);var n=(0,s.cloneObj)(r);return n.outputCst=!0,e.call(this,t,n)||this}return T(t,e),t}(N),M=function(e){function t(t,r){void 0===r&&(r=S);var n=(0,s.cloneObj)(r);return n.outputCst=!1,e.call(this,t,n)||this}return T(t,e),t}(N)},(e,t,r)=>{"use strict";function n(e){return e&&0===e.length}function s(e){return null==e?[]:Object.keys(e)}function o(e){for(var t=[],r=Object.keys(e),n=0;n<r.length;n++)t.push(e[r[n]]);return t}function i(e,t){for(var r=[],n=s(e),o=0;o<n.length;o++){var i=n[o];r.push(t.call(null,e[i],i))}return r}function a(e,t){for(var r=[],n=0;n<e.length;n++)r.push(t.call(null,e[n],n));return r}function l(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];Array.isArray(n)?t=t.concat(l(n)):t.push(n)}return t}function u(e){return n(e)?void 0:e[0]}function h(e){var t=e&&e.length;return t?e[t-1]:void 0}function c(e,t){if(Array.isArray(e))for(var r=0;r<e.length;r++)t.call(null,e[r],r);else{if(!x(e))throw Error("non exhaustive match");var n=s(e);for(r=0;r<n.length;r++){var o=n[r],i=e[o];t.call(null,i,o)}}}function d(e){return"string"==typeof e}function p(e){return void 0===e}function g(e){return e instanceof Function}function m(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 y(e,t){var r=[];if(Array.isArray(e))for(var n=0;n<e.length;n++){var s=e[n];t.call(null,s)&&r.push(s)}return r}function E(e,t){return y(e,(function(e){return!t(e)}))}function C(e,t){for(var r=Object.keys(e),n={},s=0;s<r.length;s++){var o=r[s],i=e[o];t(i)&&(n[o]=i)}return n}function T(e,t){return!!x(e)&&e.hasOwnProperty(t)}function R(e,t){return void 0!==v(e,(function(e){return e===t}))}function w(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t}function S(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}function v(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t.call(null,n))return n}}function A(e,t){for(var r=[],n=0;n<e.length;n++){var s=e[n];t.call(null,s)&&r.push(s)}return r}function N(e,t,r){for(var n=Array.isArray(e),i=n?e:o(e),a=n?[]:s(e),l=r,u=0;u<i.length;u++)l=t.call(null,l,i[u],n?u:a[u]);return l}function O(e){return E(e,(function(e){return null==e}))}function M(e,t){void 0===t&&(t=function(e){return e});var r=[];return N(e,(function(e,n){var s=t(n);return R(r,s)?e:(r.push(s),e.concat(n))}),[])}function b(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=[null].concat(t);return Function.bind.apply(e,n)}function I(e){return Array.isArray(e)}function _(e){return e instanceof RegExp}function x(e){return e instanceof Object}function P(e,t){for(var r=0;r<e.length;r++)if(!t(e[r],r))return!1;return!0}function L(e,t){return E(e,(function(e){return R(t,e)}))}function D(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return!0;return!1}function F(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1}function k(e,t){var r=w(e);return r.sort((function(e,r){return t(e)-t(r)})),r}function H(e,t){if(e.length!==t.length)throw Error("can't zipObject with different number of keys and values!");for(var r={},n=0;n<e.length;n++)r[e[n]]=t[n];return r}function U(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++)for(var o=t[n],i=s(o),a=0;a<i.length;a++){var l=i[a];e[l]=o[l]}return e}function V(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var o=t[n];if(!p(o))for(var i=s(o),a=0;a<i.length;a++){var l=i[a];T(e,l)||(e[l]=o[l])}}return e}function B(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return V.apply(null,[{}].concat(e))}function W(e,t){var r={};return c(e,(function(e){var n=t(e),s=r[n];s?s.push(e):r[n]=[e]})),r}function G(e,t){for(var r=S(e),n=s(t),o=0;o<n.length;o++){var i=n[o],a=t[i];r[i]=a}return r}function Y(){}function j(e){return e}function z(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(void 0!==n?n:void 0)}return t}function $(e){console&&console.error&&console.error("Error: "+e)}function K(e){console&&console.warn&&console.warn("Warning: "+e)}function X(){return"function"==typeof Map}function q(e,t){t.forEach((function(t){var r=t.prototype;Object.getOwnPropertyNames(r).forEach((function(n){if("constructor"!==n){var s=Object.getOwnPropertyDescriptor(r,n);s&&(s.get||s.set)?Object.defineProperty(e.prototype,n,s):e.prototype[n]=t.prototype[n]}}))}))}function Q(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.bar}return n(),n(),e}function Z(e){return e[e.length-1]}function J(e){var t=(new Date).getTime(),r=e();return{time:(new Date).getTime()-t,value:r}}r.r(t),r.d(t,{IDENTITY:()=>j,NOOP:()=>Y,PRINT_ERROR:()=>$,PRINT_WARNING:()=>K,applyMixins:()=>q,assign:()=>U,assignNoOverwrite:()=>V,cloneArr:()=>w,cloneObj:()=>S,compact:()=>O,contains:()=>R,defaults:()=>B,difference:()=>L,drop:()=>m,dropRight:()=>f,every:()=>P,filter:()=>y,find:()=>v,findAll:()=>A,first:()=>u,flatten:()=>l,forEach:()=>c,groupBy:()=>W,has:()=>T,indexOf:()=>F,isArray:()=>I,isES2015MapSupported:()=>X,isEmpty:()=>n,isFunction:()=>g,isObject:()=>x,isRegExp:()=>_,isString:()=>d,isUndefined:()=>p,keys:()=>s,last:()=>h,map:()=>a,mapValues:()=>i,merge:()=>G,packArray:()=>z,partial:()=>b,peek:()=>Z,pick:()=>C,reduce:()=>N,reject:()=>E,some:()=>D,sortBy:()=>k,timer:()=>J,toFastProperties:()=>Q,uniq:()=>M,values:()=>o,zipObject:()=>H})},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ResyncFollowsWalker:()=>h,buildBetweenProdsFollowPrefix:()=>d,buildInProdFollowPrefix:()=>p,computeAllProdsFollows:()=>c});var n,s=r(19),o=r(29),i=r(17),a=r(32),l=r(20),u=(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])},n(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=function(e){function t(t){var r=e.call(this)||this;return r.topProd=t,r.follows={},r}return u(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 n=d(e.referencedRule,e.idx)+this.topProd.name,s=t.concat(r),i=new l.Flat({definition:s}),a=(0,o.first)(i);this.follows[n]=a},t}(s.RestWalker);function c(e){var t={};return(0,i.forEach)(e,(function(e){var r=new h(e).startWalking();(0,i.assign)(t,r)})),t}function d(e,t){return e.name+t+a.IN}function p(e){return e.terminalType.name+e.idx+a.IN}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RestWalker:()=>o});var n=r(17),s=r(20),o=function(){function e(){}return e.prototype.walk=function(e,t){var r=this;void 0===t&&(t=[]),(0,n.forEach)(e.definition,(function(o,i){var a=(0,n.drop)(e.definition,i+1);if(o instanceof s.NonTerminal)r.walkProdRef(o,a,t);else if(o instanceof s.Terminal)r.walkTerminal(o,a,t);else if(o instanceof s.Flat)r.walkFlat(o,a,t);else if(o instanceof s.Option)r.walkOption(o,a,t);else if(o instanceof s.RepetitionMandatory)r.walkAtLeastOne(o,a,t);else if(o instanceof s.RepetitionMandatoryWithSeparator)r.walkAtLeastOneSep(o,a,t);else if(o instanceof s.RepetitionWithSeparator)r.walkManySep(o,a,t);else if(o instanceof s.Repetition)r.walkMany(o,a,t);else{if(!(o instanceof s.Alternation))throw Error("non exhaustive match");r.walkOr(o,a,t)}}))},e.prototype.walkTerminal=function(e,t,r){},e.prototype.walkProdRef=function(e,t,r){},e.prototype.walkFlat=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkOption=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkAtLeastOne=function(e,t,r){var n=[new s.Option({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkAtLeastOneSep=function(e,t,r){var n=i(e,t,r);this.walk(e,n)},e.prototype.walkMany=function(e,t,r){var n=[new s.Option({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkManySep=function(e,t,r){var n=i(e,t,r);this.walk(e,n)},e.prototype.walkOr=function(e,t,r){var o=this,i=t.concat(r);(0,n.forEach)(e.definition,(function(e){var t=new s.Flat({definition:[e]});o.walk(t,i)}))},e}();function i(e,t,r){return[new s.Option({definition:[new s.Terminal({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractProduction:()=>a,Alternation:()=>f,Flat:()=>h,NonTerminal:()=>l,Option:()=>c,Repetition:()=>g,RepetitionMandatory:()=>d,RepetitionMandatoryWithSeparator:()=>p,RepetitionWithSeparator:()=>m,Rule:()=>u,Terminal:()=>y,serializeGrammar:()=>E,serializeProduction:()=>C});var n,s=r(17),o=r(21),i=(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])},n(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)}),a=function(){function e(e){this.definition=e}return e.prototype.accept=function(e){e.visit(this),(0,s.forEach)(this.definition,(function(t){t.accept(e)}))},e}(),l=function(e){function t(t){var r=e.call(this,[])||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(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}(a),u=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.orgText="",(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),h=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),c=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),d=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),p=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),g=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),m=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),f=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,(0,s.assign)(r,(0,s.pick)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(a),y=function(){function e(e){this.idx=1,(0,s.assign)(this,(0,s.pick)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function E(e){return(0,s.map)(e,C)}function C(e){function t(e){return(0,s.map)(e,C)}if(e instanceof l)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof h)return{type:"Flat",definition:t(e.definition)};if(e instanceof c)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof d)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof p)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:e.idx,separator:C(new y({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof m)return{type:"RepetitionWithSeparator",name:e.name,idx:e.idx,separator:C(new y({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof g)return{type:"Repetition",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof f)return{type:"Alternation",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof y){var r={type:"Terminal",name:e.terminalType.name,label:(0,o.tokenLabel)(e.terminalType),idx:e.idx},n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=(0,s.isRegExp)(n)?n.source:n),r}if(e instanceof u)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EOF:()=>C,createToken:()=>E,createTokenInstance:()=>T,hasTokenLabel:()=>l,tokenLabel:()=>i,tokenMatcher:()=>R,tokenName:()=>a});var n=r(17),s=r(22),o=r(27);function i(e){return l(e)?e.LABEL:e.name}function a(e){return e.name}function l(e){return(0,n.isString)(e.LABEL)&&""!==e.LABEL}var u="parent",h="categories",c="label",d="group",p="push_mode",g="pop_mode",m="longer_alt",f="line_breaks",y="start_chars_hint";function E(e){return function(e){var t=e.pattern,r={};r.name=e.name,(0,n.isUndefined)(t)||(r.PATTERN=t);if((0,n.has)(e,u))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";(0,n.has)(e,h)&&(r.CATEGORIES=e[h]);(0,o.augmentTokenTypes)([r]),(0,n.has)(e,c)&&(r.LABEL=e[c]);(0,n.has)(e,d)&&(r.GROUP=e[d]);(0,n.has)(e,g)&&(r.POP_MODE=e[g]);(0,n.has)(e,p)&&(r.PUSH_MODE=e[p]);(0,n.has)(e,m)&&(r.LONGER_ALT=e[m]);(0,n.has)(e,f)&&(r.LINE_BREAKS=e[f]);(0,n.has)(e,y)&&(r.START_CHARS_HINT=e[y]);return r}(e)}var C=E({name:"EOF",pattern:s.Lexer.NA});function T(e,t,r,n,s,o,i,a){return{image:t,startOffset:r,endOffset:n,startLine:s,endLine:o,startColumn:i,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function R(e,t){return(0,o.tokenStructuredMatcher)(e,t)}(0,o.augmentTokenTypes)([C])},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Lexer:()=>h,LexerDefinitionErrorType:()=>n});var n,s=r(23),o=r(17),i=r(27),a=r(28),l=r(26);!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(n||(n={}));var u={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:a.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(u);var h=function(){function e(e,t){var r=this;if(void 0===t&&(t=u),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,o.merge)(u,t);var n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var n,a=!0;r.TRACE_INIT("Lexer Config handling",(function(){if(r.config.lineTerminatorsPattern===u.lineTerminatorsPattern)r.config.lineTerminatorsPattern=s.LineTerminatorOptimizedTester;else if(r.config.lineTerminatorCharacters===u.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor 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,o.isArray)(e)?((n={modes:{}}).modes[s.DEFAULT_MODE]=(0,o.cloneArr)(e),n[s.DEFAULT_MODE]=s.DEFAULT_MODE):(a=!1,n=(0,o.cloneObj)(e))})),!1===r.config.skipValidations&&(r.TRACE_INIT("performRuntimeChecks",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((0,s.performRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))})),r.TRACE_INIT("performWarningRuntimeChecks",(function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat((0,s.performWarningRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},(0,o.forEach)(n.modes,(function(e,t){n.modes[t]=(0,o.reject)(e,(function(e){return(0,o.isUndefined)(e)}))}));var h=(0,o.keys)(n.modes);if((0,o.forEach)(n.modes,(function(e,n){r.TRACE_INIT("Mode: <"+n+"> processing",(function(){var a;(r.modes.push(n),!1===r.config.skipValidations&&r.TRACE_INIT("validatePatterns",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat((0,s.validatePatterns)(e,h))})),(0,o.isEmpty)(r.lexerDefinitionErrors))&&((0,i.augmentTokenTypes)(e),r.TRACE_INIT("analyzeTokenTypes",(function(){a=(0,s.analyzeTokenTypes)(e,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:r.TRACE_INIT.bind(r)})})),r.patternIdxToConfig[n]=a.patternIdxToConfig,r.charCodeToPatternIdxToConfig[n]=a.charCodeToPatternIdxToConfig,r.emptyGroups=(0,o.merge)(r.emptyGroups,a.emptyGroups),r.hasCustom=a.hasCustom||r.hasCustom,r.canModeBeOptimized[n]=a.canBeOptimized)}))})),r.defaultMode=n.defaultMode,!(0,o.isEmpty)(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var c=(0,o.map)(r.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+c)}(0,o.forEach)(r.lexerDefinitionWarning,(function(e){(0,o.PRINT_WARNING)(e.message)})),r.TRACE_INIT("Choosing sub-methods implementations",(function(){if(s.SUPPORT_STICKY?(r.chopInput=o.IDENTITY,r.match=r.matchWithTest):(r.updateLastIndex=o.NOOP,r.match=r.matchWithExec),a&&(r.handleModes=o.NOOP),!1===r.trackStartLines&&(r.computeNewColumn=o.IDENTITY),!1===r.trackEndLines&&(r.updateTokenEndLineColumnLocation=o.NOOP),/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))throw Error('Invalid <positionTracking> config option: "'+r.config.positionTracking+'"');r.createTokenInstance=r.createOffsetOnlyToken}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,o.reduce)(r.canModeBeOptimized,(function(e,t,r){return!1===t&&e.push(r),e}),[]);if(t.ensureOptimizations&&!(0,o.isEmpty)(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),r.TRACE_INIT("clearRegExpParserCache",(function(){(0,l.clearRegExpParserCache)()})),r.TRACE_INIT("toFastProperties",(function(){(0,o.toFastProperties)(r)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!(0,o.isEmpty)(this.lexerDefinitionErrors)){var r=(0,o.map)(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+r)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var r,n,i,a,l,u,h,c,d,p,g,m,f,y,E=this,C=e,T=C.length,R=0,w=0,S=this.hasCustom?0:Math.floor(e.length/10),v=new Array(S),A=[],N=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0,M=(0,s.cloneEmptyGroups)(this.emptyGroups),b=this.trackStartLines,I=this.config.lineTerminatorsPattern,_=0,x=[],P=[],L=[],D=[];Object.freeze(D);var F=void 0;function k(){return x}function H(e){var t=(0,s.charCodeToOptimizedIndex)(e),r=P[t];return void 0===r?D:r}var U,V=function(e){if(1===L.length&&void 0===e.tokenType.PUSH_MODE){var t=E.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);A.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{L.pop();var r=(0,o.last)(L);x=E.patternIdxToConfig[r],P=E.charCodeToPatternIdxToConfig[r],_=x.length;var n=E.canModeBeOptimized[r]&&!1===E.config.safeMode;F=P&&n?H:k}};function B(e){L.push(e),P=this.charCodeToPatternIdxToConfig[e],x=this.patternIdxToConfig[e],_=x.length,_=x.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;F=P&&t?H:k}for(B.call(this,t);R<T;){l=null;var W=C.charCodeAt(R),G=F(W),Y=G.length;for(r=0;r<Y;r++){var j=(U=G[r]).pattern;if(u=null,!1!==(te=U.short)?W===te&&(l=j):!0===U.isCustom?null!==(y=j.exec(C,R,v,M))?(l=y[0],void 0!==y.payload&&(u=y.payload)):l=null:(this.updateLastIndex(j,R),l=this.match(j,e,R)),null!==l){if(void 0!==(a=U.longerAlt)){var z=x[a],$=z.pattern;h=null,!0===z.isCustom?null!==(y=$.exec(C,R,v,M))?(i=y[0],void 0!==y.payload&&(h=y.payload)):i=null:(this.updateLastIndex($,R),i=this.match($,e,R)),i&&i.length>l.length&&(l=i,u=h,U=z)}break}}if(null!==l){if(c=l.length,void 0!==(d=U.group)&&(p=U.tokenTypeIdx,g=this.createTokenInstance(l,R,p,U.tokenType,N,O,c),this.handlePayload(g,u),!1===d?w=this.addToken(v,w,g):M[d].push(g)),e=this.chopInput(e,c),R+=c,O=this.computeNewColumn(O,c),!0===b&&!0===U.canLineTerminator){var K=0,X=void 0,q=void 0;I.lastIndex=0;do{!0===(X=I.test(l))&&(q=I.lastIndex-1,K++)}while(!0===X);0!==K&&(N+=K,O=c-q,this.updateTokenEndLineColumnLocation(g,d,q,K,N,O,c))}this.handleModes(U,V,B,g)}else{for(var Q=R,Z=N,J=O,ee=!1;!ee&&R<T;)for(C.charCodeAt(R),e=this.chopInput(e,1),R++,n=0;n<_;n++){var te,re=x[n];j=re.pattern;if(!1!==(te=re.short)?C.charCodeAt(R)===te&&(ee=!0):!0===re.isCustom?ee=null!==j.exec(C,R,v,M):(this.updateLastIndex(j,R),ee=null!==j.exec(e)),!0===ee)break}m=R-Q,f=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(C,Q,m,Z,J),A.push({offset:Q,line:Z,column:J,length:m,message:f})}}return this.hasCustom||(v.length=w),{tokens:v,groups:M,errors:A}},e.prototype.handleModes=function(e,t,r,n){if(!0===e.pop){var s=e.push;t(n),void 0!==s&&r.call(this,s)}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,n,s,o,i){var a,l;void 0!==t&&(l=(a=r===i-1)?-1:0,1===n&&!0===a||(e.endLine=s+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,n){return{image:e,startOffset:t,tokenTypeIdx:r,tokenType:n}},e.prototype.createStartOnlyToken=function(e,t,r,n,s,o){return{image:e,startOffset:t,startLine:s,startColumn:o,tokenTypeIdx:r,tokenType:n}},e.prototype.createFullToken=function(e,t,r,n,s,o,i){return{image:e,startOffset:t,endOffset:t+i-1,startLine:s,endLine:s,startColumn:o,endColumn:o+i-1,tokenTypeIdx:r,tokenType:n}},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){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--\x3e <"+e+">");var n=(0,o.timer)(t),s=n.time,i=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(r+"<-- <"+e+"> time: "+s+"ms"),this.traceInitIndent--,i}return t()},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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DEFAULT_MODE:()=>c,LineTerminatorOptimizedTester:()=>k,MODES:()=>d,SUPPORT_STICKY:()=>p,addStartOfInput:()=>I,addStickyFlag:()=>_,analyzeTokenTypes:()=>f,buildLineBreakIssueMessage:()=>U,charCodeToOptimizedIndex:()=>G,cloneEmptyGroups:()=>L,disableSticky:()=>g,enableSticky:()=>m,findDuplicatePatterns:()=>N,findEmptyMatchRegExps:()=>w,findEndOfInputAnchor:()=>R,findInvalidGroupType:()=>O,findInvalidPatterns:()=>C,findMissingPatterns:()=>E,findModesThatDoNotExist:()=>M,findStartOfInputAnchor:()=>v,findUnreachablePatterns:()=>b,findUnsupportedFlags:()=>A,isCustomPattern:()=>D,isShortPattern:()=>F,minOptimizationVal:()=>W,performRuntimeChecks:()=>x,performWarningRuntimeChecks:()=>P,validatePatterns:()=>y});var n,s=r(24),o=r(22),i=r(17),a=r(25),l=r(26),u=(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])},n(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",c="defaultMode",d="modes",p="boolean"==typeof new RegExp("(?:)").sticky;function g(){p=!1}function m(){p=!0}function f(e,t){var r,n=(t=(0,i.defaults)(t,{useSticky:p,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;n("initCharCodeToOptimizedIndexMap",(function(){!function(){if((0,i.isEmpty)(Y)){Y=new Array(65536);for(var e=0;e<65536;e++)Y[e]=e>255?255+~~(e/255):e}}()})),n("Reject Lexer.NA",(function(){r=(0,i.reject)(e,(function(e){return e[h]===o.Lexer.NA}))}));var s,l,u,c,d,g,m,f,y,E,C,T=!1;n("Transform Patterns",(function(){T=!1,s=(0,i.map)(r,(function(e){var r=e[h];if((0,i.isRegExp)(r)){var n=r.source;return 1===n.length&&"^"!==n&&"$"!==n&&"."!==n?n:2!==n.length||"\\"!==n[0]||(0,i.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],n[1])?t.useSticky?_(r):I(r):n[1]}if((0,i.isFunction)(r))return T=!0,{exec:r};if((0,i.has)(r,"exec"))return T=!0,r;if("string"==typeof r){if(1===r.length)return r;var s=r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),o=new RegExp(s);return t.useSticky?_(o):I(o)}throw Error("non exhaustive match")}))})),n("misc mapping",(function(){l=(0,i.map)(r,(function(e){return e.tokenTypeIdx})),u=(0,i.map)(r,(function(e){var t=e.GROUP;if(t!==o.Lexer.SKIPPED){if((0,i.isString)(t))return t;if((0,i.isUndefined)(t))return!1;throw Error("non exhaustive match")}})),c=(0,i.map)(r,(function(e){var t=e.LONGER_ALT;if(t)return(0,i.indexOf)(r,t)})),d=(0,i.map)(r,(function(e){return e.PUSH_MODE})),g=(0,i.map)(r,(function(e){return(0,i.has)(e,"POP_MODE")}))})),n("Line Terminator Handling",(function(){var e=V(t.lineTerminatorCharacters);m=(0,i.map)(r,(function(e){return!1})),"onlyOffset"!==t.positionTracking&&(m=(0,i.map)(r,(function(t){return(0,i.has)(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===H(t,e)?(0,a.canMatchCharCode)(e,t.PATTERN):void 0})))})),n("Misc Mapping #2",(function(){f=(0,i.map)(r,D),y=(0,i.map)(s,F),E=(0,i.reduce)(r,(function(e,t){var r=t.GROUP;return(0,i.isString)(r)&&r!==o.Lexer.SKIPPED&&(e[r]=[]),e}),{}),C=(0,i.map)(s,(function(e,t){return{pattern:s[t],longerAlt:c[t],canLineTerminator:m[t],isCustom:f[t],short:y[t],group:u[t],push:d[t],pop:g[t],tokenTypeIdx:l[t],tokenType:r[t]}}))}));var R=!0,w=[];return t.safeMode||n("First Char Optimization",(function(){w=(0,i.reduce)(r,(function(e,r,n){if("string"==typeof r.PATTERN){var s=G(r.PATTERN.charCodeAt(0));B(e,s,C[n])}else if((0,i.isArray)(r.START_CHARS_HINT)){var o;(0,i.forEach)(r.START_CHARS_HINT,(function(t){var r=G("string"==typeof t?t.charCodeAt(0):t);o!==r&&(o=r,B(e,r,C[n]))}))}else if((0,i.isRegExp)(r.PATTERN))if(r.PATTERN.unicode)R=!1,t.ensureOptimizations&&(0,i.PRINT_ERROR)(a.failedOptimizationPrefixMsg+"\tUnable to analyze < "+r.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var l=(0,a.getOptimizedStartCodesIndices)(r.PATTERN,t.ensureOptimizations);(0,i.isEmpty)(l)&&(R=!1),(0,i.forEach)(l,(function(t){B(e,t,C[n])}))}else t.ensureOptimizations&&(0,i.PRINT_ERROR)(a.failedOptimizationPrefixMsg+"\tTokenType: <"+r.name+"> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),R=!1;return e}),[])})),n("ArrayPacking",(function(){w=(0,i.packArray)(w)})),{emptyGroups:E,patternIdxToConfig:C,charCodeToPatternIdxToConfig:w,hasCustom:T,canBeOptimized:R}}function y(e,t){var r=[],n=E(e);r=r.concat(n.errors);var s=C(n.valid),o=s.valid;return r=(r=r.concat(s.errors)).concat(function(e){var t=[],r=(0,i.filter)(e,(function(e){return(0,i.isRegExp)(e[h])}));return t=t.concat(R(r)),t=t.concat(v(r)),t=t.concat(A(r)),t=t.concat(N(r)),t=t.concat(w(r)),t}(o)),r=(r=(r=r.concat(O(o))).concat(M(o,t))).concat(b(o))}function E(e){var t=(0,i.filter)(e,(function(e){return!(0,i.has)(e,h)}));return{errors:(0,i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:o.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[e]}})),valid:(0,i.difference)(e,t)}}function C(e){var t=(0,i.filter)(e,(function(e){var t=e[h];return!((0,i.isRegExp)(t)||(0,i.isFunction)(t)||(0,i.has)(t,"exec")||(0,i.isString)(t))}));return{errors:(0,i.map)(t,(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:o.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[e]}})),valid:(0,i.difference)(e,t)}}var T=/[^\\][\$]/;function R(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return u(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(s.BaseRegExpVisitor),r=(0,i.filter)(e,(function(e){var r=e[h];try{var n=(0,l.getRegExpAst)(r),s=new t;return s.visit(n),s.found}catch(e){return T.test(r.source)}}));return(0,i.map)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:o.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function w(e){var t=(0,i.filter)(e,(function(e){return e[h].test("")}));return(0,i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:o.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}))}var S=/[^\\[][\^]|^\^/;function v(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return u(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(s.BaseRegExpVisitor),r=(0,i.filter)(e,(function(e){var r=e[h];try{var n=(0,l.getRegExpAst)(r),s=new t;return s.visit(n),s.found}catch(e){return S.test(r.source)}}));return(0,i.map)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:o.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function A(e){var t=(0,i.filter)(e,(function(e){var t=e[h];return t instanceof RegExp&&(t.multiline||t.global)}));return(0,i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:o.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}))}function N(e){var t=[],r=(0,i.map)(e,(function(r){return(0,i.reduce)(e,(function(e,n){return r.PATTERN.source!==n.PATTERN.source||(0,i.contains)(t,n)||n.PATTERN===o.Lexer.NA||(t.push(n),e.push(n)),e}),[])}));r=(0,i.compact)(r);var n=(0,i.filter)(r,(function(e){return e.length>1}));return(0,i.map)(n,(function(e){var t=(0,i.map)(e,(function(e){return e.name}));return{message:"The same RegExp pattern ->"+(0,i.first)(e).PATTERN+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:o.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}))}function O(e){var t=(0,i.filter)(e,(function(e){if(!(0,i.has)(e,"GROUP"))return!1;var t=e.GROUP;return t!==o.Lexer.SKIPPED&&t!==o.Lexer.NA&&!(0,i.isString)(t)}));return(0,i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:o.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}))}function M(e,t){var r=(0,i.filter)(e,(function(e){return void 0!==e.PUSH_MODE&&!(0,i.contains)(t,e.PUSH_MODE)}));return(0,i.map)(r,(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:o.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}))}function b(e){var t=[],r=(0,i.reduce)(e,(function(e,t,r){var n,s,a=t.PATTERN;return a===o.Lexer.NA||((0,i.isString)(a)?e.push({str:a,idx:r,tokenType:t}):(0,i.isRegExp)(a)&&(n=a,s=[".","\\","[","]","|","^","$","(",")","?","*","+","{"],void 0===(0,i.find)(s,(function(e){return-1!==n.source.indexOf(e)})))&&e.push({str:a.source,idx:r,tokenType:t})),e}),[]);return(0,i.forEach)(e,(function(e,n){(0,i.forEach)(r,(function(r){var s=r.str,a=r.idx,l=r.tokenType;if(n<a&&function(e,t){if((0,i.isRegExp)(t)){var r=t.exec(e);return null!==r&&0===r.index}if((0,i.isFunction)(t))return t(e,0,[],{});if((0,i.has)(t,"exec"))return t.exec(e,0,[],{});if("string"==typeof t)return t===e;throw Error("non exhaustive match")}(s,e.PATTERN)){var u="Token: ->"+l.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";t.push({message:u,type:o.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[e,l]})}}))})),t}function I(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function _(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function x(e,t,r){var n=[];return(0,i.has)(e,c)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+c+"> property in its definition\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,i.has)(e,d)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+d+"> property in its definition\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,i.has)(e,d)&&(0,i.has)(e,c)&&!(0,i.has)(e.modes,e.defaultMode)&&n.push({message:"A MultiMode Lexer cannot be initialized with a "+c+": <"+e.defaultMode+">which does not exist\n",type:o.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,i.has)(e,d)&&(0,i.forEach)(e.modes,(function(e,t){(0,i.forEach)(e,(function(e,r){(0,i.isUndefined)(e)&&n.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+t+"> at index: <"+r+">\n",type:o.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}))})),n}function P(e,t,r){var n=[],s=!1,l=(0,i.compact)((0,i.flatten)((0,i.mapValues)(e.modes,(function(e){return e})))),u=(0,i.reject)(l,(function(e){return e[h]===o.Lexer.NA})),c=V(r);return t&&(0,i.forEach)(u,(function(e){var t=H(e,c);if(!1!==t){var r={message:U(e,t),type:t.issue,tokenType:e};n.push(r)}else(0,i.has)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(s=!0):(0,a.canMatchCharCode)(c,e.PATTERN)&&(s=!0)})),t&&!s&&n.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:o.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n}function L(e){var t={},r=(0,i.keys)(e);return(0,i.forEach)(r,(function(r){var n=e[r];if(!(0,i.isArray)(n))throw Error("non exhaustive match");t[r]=[]})),t}function D(e){var t=e.PATTERN;if((0,i.isRegExp)(t))return!1;if((0,i.isFunction)(t))return!0;if((0,i.has)(t,"exec"))return!0;if((0,i.isString)(t))return!1;throw Error("non exhaustive match")}function F(e){return!(!(0,i.isString)(e)||1!==e.length)&&e.charCodeAt(0)}var k={test:function(e){for(var t=e.length,r=this.lastIndex;r<t;r++){var n=e.charCodeAt(r);if(10===n)return this.lastIndex=r+1,!0;if(13===n)return 10===e.charCodeAt(r+1)?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function H(e,t){if((0,i.has)(e,"LINE_BREAKS"))return!1;if((0,i.isRegExp)(e.PATTERN)){try{(0,a.canMatchCharCode)(t,e.PATTERN)}catch(e){return{issue:o.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if((0,i.isString)(e.PATTERN))return!1;if(D(e))return{issue:o.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function U(e,t){if(t.issue===o.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+e.name+"> Token Type\n\t Root cause: "+t.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===o.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <"+e.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function V(e){return(0,i.map)(e,(function(e){return(0,i.isString)(e)&&e.length>0?e.charCodeAt(0):e}))}function B(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}var W=256;function G(e){return e<W?e:Y[e]}var Y=[]},function(e,t){var r,n,s;"undefined"!=typeof self&&self,n=[],void 0===(s="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"(":var e;switch(this.consumeChar("?"),this.popChar()){case"=":e="Lookahead";break;case"!":e="NegativeLookahead"}l(e);var t=this.disjunction();return this.consumeChar(")"),{type:e,value:t}}u()},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=d;break;case"S":e=d,t=!0;break;case"w":e=c;break;case"W":e=c,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("\t");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 ");return{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 n=this.classAtom();if("Character"===n.type){if(n.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:n.value})}else i(r.value,e),e.push(o("-")),i(n.value,e)}else i(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===s.test(e))throw Error("Expecting a positive integer");for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(!1===n.test(e))throw Error("Expecting an integer");for(;n.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 n.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="",n=0;n<e;n++){var s=this.popChar();if(!1===r.test(s))throw Error("Expecting a HexDecimal digits");t+=s}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]/,n=/[0-9]/,s=/[1-9]/;function o(e){return e.charCodeAt(0)}function i(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}function l(e){if(void 0===e)throw Error("Internal Error - Should never get here!")}function u(){throw Error("Internal Error - Should never get here!")}var h=[];for(t=o("0");t<=o("9");t++)h.push(t);var c=[o("_")].concat(h);for(t=o("a");t<=o("z");t++)c.push(t);for(t=o("A");t<=o("Z");t++)c.push(t);var d=[o(" "),o("\f"),o("\n"),o("\r"),o("\t"),o("\v"),o("\t"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\ufeff")];function p(){}return p.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))}},p.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)},p.prototype.visitPattern=function(e){},p.prototype.visitFlags=function(e){},p.prototype.visitDisjunction=function(e){},p.prototype.visitAlternative=function(e){},p.prototype.visitStartAnchor=function(e){},p.prototype.visitEndAnchor=function(e){},p.prototype.visitWordBoundary=function(e){},p.prototype.visitNonWordBoundary=function(e){},p.prototype.visitLookahead=function(e){},p.prototype.visitNegativeLookahead=function(e){},p.prototype.visitCharacter=function(e){},p.prototype.visitSet=function(e){},p.prototype.visitGroup=function(e){},p.prototype.visitGroupBackReference=function(e){},p.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:p,VERSION:"0.4.0"}})?r.apply(t,n):r)||(e.exports=s)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{canMatchCharCode:()=>y,failedOptimizationPrefixMsg:()=>h,firstCharOptimizedIndices:()=>d,getOptimizedStartCodesIndices:()=>c});var n,s=r(24),o=r(17),i=r(26),a=r(23),l=(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])},n(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)}),u="Complement Sets are not supported for first char optimization",h='Unable to use "first char" lexer optimizations:\n';function c(e,t){void 0===t&&(t=!1);try{var r=(0,i.getRegExpAst)(e);return d(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===u)t&&(0,o.PRINT_WARNING)(h+"\tUnable to optimize: < "+e.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),(0,o.PRINT_ERROR)(h+"\n\tFailed parsing: < "+e.toString()+" >\n\tUsing the regexp-to-ast library version: "+s.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}function d(e,t,r){switch(e.type){case"Disjunction":for(var n=0;n<e.value.length;n++)d(e.value[n],t,r);break;case"Alternative":var s=e.value;for(n=0;n<s.length;n++){var i=s[n];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var l=i;switch(l.type){case"Character":p(l.value,t,r);break;case"Set":if(!0===l.complement)throw Error(u);(0,o.forEach)(l.value,(function(e){if("number"==typeof e)p(e,t,r);else{var n=e;if(!0===r)for(var s=n.from;s<=n.to;s++)p(s,t,r);else{for(s=n.from;s<=n.to&&s<a.minOptimizationVal;s++)p(s,t,r);if(n.to>=a.minOptimizationVal)for(var o=n.from>=a.minOptimizationVal?n.from:a.minOptimizationVal,i=n.to,l=(0,a.charCodeToOptimizedIndex)(o),u=(0,a.charCodeToOptimizedIndex)(i),h=l;h<=u;h++)t[h]=h}}}));break;case"Group":d(l.value,t,r);break;default:throw Error("Non Exhaustive Match")}var h=void 0!==l.quantifier&&0===l.quantifier.atLeast;if("Group"===l.type&&!1===m(l)||"Group"!==l.type&&!1===h)break}break;default:throw Error("non exhaustive match!")}return(0,o.values)(t)}function p(e,t,r){var n=(0,a.charCodeToOptimizedIndex)(e);t[n]=n,!0===r&&function(e,t){var r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){t[s=(0,a.charCodeToOptimizedIndex)(n.charCodeAt(0))]=s}else{var s,o=r.toLowerCase();if(o!==r)t[s=(0,a.charCodeToOptimizedIndex)(o.charCodeAt(0))]=s}}(e,t)}function g(e,t){return(0,o.find)(e.value,(function(e){if("number"==typeof e)return(0,o.contains)(t,e);var r=e;return void 0!==(0,o.find)(t,(function(e){return r.from<=e&&e<=r.to}))}))}function m(e){return!(!e.quantifier||0!==e.quantifier.atLeast)||!!e.value&&((0,o.isArray)(e.value)?(0,o.every)(e.value,m):m(e.value))}var f=function(e){function t(t){var r=e.call(this)||this;return r.targetCharCodes=t,r.found=!1,r}return l(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){(0,o.contains)(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===g(e,this.targetCharCodes)&&(this.found=!0):void 0!==g(e,this.targetCharCodes)&&(this.found=!0)},t}(s.BaseRegExpVisitor);function y(e,t){if(t instanceof RegExp){var r=(0,i.getRegExpAst)(t),n=new f(e);return n.visit(r),n.found}return void 0!==(0,o.find)(t,(function(t){return(0,o.contains)(e,t.charCodeAt(0))}))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearRegExpParserCache:()=>a,getRegExpAst:()=>i});var n=r(24),s={},o=new n.RegExpParser;function i(e){var t=e.toString();if(s.hasOwnProperty(t))return s[t];var r=o.pattern(t);return s[t]=r,r}function a(){s={}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{assignCategoriesMapProp:()=>d,assignCategoriesTokensProp:()=>c,assignTokenDefaultProps:()=>h,augmentTokenTypes:()=>l,expandCategories:()=>u,hasCategoriesProperty:()=>m,hasExtendingTokensTypesMapProperty:()=>y,hasExtendingTokensTypesProperty:()=>f,hasShortKeyProperty:()=>g,isTokenType:()=>E,singleAssignCategoriesToksMap:()=>p,tokenIdxToClass:()=>a,tokenShortNameIdx:()=>i,tokenStructuredMatcher:()=>s,tokenStructuredMatcherNoCategories:()=>o});var n=r(17);function s(e,t){var r=e.tokenTypeIdx;return r===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[r]}function o(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var i=1,a={};function l(e){var t=u(e);h(t),d(t),c(t),(0,n.forEach)(t,(function(e){e.isParent=e.categoryMatches.length>0}))}function u(e){for(var t=(0,n.cloneArr)(e),r=e,s=!0;s;){r=(0,n.compact)((0,n.flatten)((0,n.map)(r,(function(e){return e.CATEGORIES}))));var o=(0,n.difference)(r,t);t=t.concat(o),(0,n.isEmpty)(o)?s=!1:r=o}return t}function h(e){(0,n.forEach)(e,(function(e){g(e)||(a[i]=e,e.tokenTypeIdx=i++),m(e)&&!(0,n.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),m(e)||(e.CATEGORIES=[]),f(e)||(e.categoryMatches=[]),y(e)||(e.categoryMatchesMap={})}))}function c(e){(0,n.forEach)(e,(function(e){e.categoryMatches=[],(0,n.forEach)(e.categoryMatchesMap,(function(t,r){e.categoryMatches.push(a[r].tokenTypeIdx)}))}))}function d(e){(0,n.forEach)(e,(function(e){p([],e)}))}function p(e,t){(0,n.forEach)(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),(0,n.forEach)(t.CATEGORIES,(function(r){var s=e.concat(t);(0,n.contains)(s,r)||p(s,r)}))}function g(e){return(0,n.has)(e,"tokenTypeIdx")}function m(e){return(0,n.has)(e,"CATEGORIES")}function f(e){return(0,n.has)(e,"categoryMatches")}function y(e){return(0,n.has)(e,"categoryMatchesMap")}function E(e){return(0,n.has)(e,"tokenTypeIdx")}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{defaultLexerErrorProvider:()=>n});var n={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,r,n,s){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+r+" characters."}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{first:()=>i,firstForBranching:()=>l,firstForSequence:()=>a,firstForTerminal:()=>u});var n=r(17),s=r(20),o=r(30);function i(e){if(e instanceof s.NonTerminal)return i(e.referencedRule);if(e instanceof s.Terminal)return u(e);if((0,o.isSequenceProd)(e))return a(e);if((0,o.isBranchingProd)(e))return l(e);throw Error("non exhaustive match")}function a(e){for(var t,r=[],s=e.definition,a=0,l=s.length>a,u=!0;l&&u;)t=s[a],u=(0,o.isOptionalProd)(t),r=r.concat(i(t)),a+=1,l=s.length>a;return(0,n.uniq)(r)}function l(e){var t=(0,n.map)(e.definition,(function(e){return i(e)}));return(0,n.uniq)((0,n.flatten)(t))}function u(e){return[e.terminalType]}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DslMethodsCollectorVisitor:()=>d,collectMethods:()=>g,getProductionDslName:()=>c,isBranchingProd:()=>h,isOptionalProd:()=>u,isSequenceProd:()=>l});var n,s=r(17),o=r(20),i=r(31),a=(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])},n(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)});function l(e){return e instanceof o.Flat||e instanceof o.Option||e instanceof o.Repetition||e instanceof o.RepetitionMandatory||e instanceof o.RepetitionMandatoryWithSeparator||e instanceof o.RepetitionWithSeparator||e instanceof o.Terminal||e instanceof o.Rule}function u(e,t){return void 0===t&&(t=[]),!!(e instanceof o.Option||e instanceof o.Repetition||e instanceof o.RepetitionWithSeparator)||(e instanceof o.Alternation?(0,s.some)(e.definition,(function(e){return u(e,t)})):!(e instanceof o.NonTerminal&&(0,s.contains)(t,e))&&(e instanceof o.AbstractProduction&&(e instanceof o.NonTerminal&&t.push(e),(0,s.every)(e.definition,(function(e){return u(e,t)})))))}function h(e){return e instanceof o.Alternation}function c(e){if(e instanceof o.NonTerminal)return"SUBRULE";if(e instanceof o.Option)return"OPTION";if(e instanceof o.Alternation)return"OR";if(e instanceof o.RepetitionMandatory)return"AT_LEAST_ONE";if(e instanceof o.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(e instanceof o.RepetitionWithSeparator)return"MANY_SEP";if(e instanceof o.Repetition)return"MANY";if(e instanceof o.Terminal)return"CONSUME";throw Error("non exhaustive match")}var d=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 a(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,s.has)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";(0,s.has)(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}(i.GAstVisitor),p=new d;function g(e){p.reset(),e.accept(p);var t=p.dslMethods;return p.reset(),t}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{GAstVisitor:()=>s});var n=r(20),s=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case n.NonTerminal:return this.visitNonTerminal(t);case n.Flat:return this.visitFlat(t);case n.Option:return this.visitOption(t);case n.RepetitionMandatory:return this.visitRepetitionMandatory(t);case n.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case n.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case n.Repetition:return this.visitRepetition(t);case n.Alternation:return this.visitAlternation(t);case n.Terminal:return this.visitTerminal(t);case n.Rule:return this.visitRule(t);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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{IN:()=>n});var n="_~IN~_"},(e,t,r)=>{"use strict";r.r(t),r.d(t,{NamedDSLMethodsCollectorVisitor:()=>p,addNoneTerminalToCst:()=>d,addTerminalToCst:()=>c,expandAllNestedRuleNames:()=>g,setNodeLocationFull:()=>h,setNodeLocationOnlyOffset:()=>u});var n,s=r(17),o=r(34),i=r(20),a=r(31),l=(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])},n(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)});function u(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==!0&&(e.endOffset=t.endOffset)}function h(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 c(e,t,r){void 0===e.children[r]?e.children[r]=[t]:e.children[r].push(t)}function d(e,t,r){void 0===e.children[t]?e.children[t]=[r]:e.children[t].push(r)}var p=function(e){function t(t){var r=e.call(this)||this;return r.result=[],r.ruleIdx=t,r}return l(t,e),t.prototype.collectNamedDSLMethod=function(e,t,r){if(!(0,s.isUndefined)(e.name)){var n=void 0;if(e instanceof i.Option||e instanceof i.Repetition||e instanceof i.RepetitionMandatory||e instanceof i.Alternation)n=new t({definition:e.definition,idx:e.idx});else{if(!(e instanceof i.RepetitionMandatoryWithSeparator||e instanceof i.RepetitionWithSeparator))throw Error("non exhaustive match");n=new t({definition:e.definition,idx:e.idx,separator:e.separator})}var a=[n],l=(0,o.getKeyForAutomaticLookahead)(this.ruleIdx,r,e.idx);this.result.push({def:a,key:l,name:e.name,orgProd:e})}},t.prototype.visitOption=function(e){this.collectNamedDSLMethod(e,i.Option,o.OPTION_IDX)},t.prototype.visitRepetition=function(e){this.collectNamedDSLMethod(e,i.Repetition,o.MANY_IDX)},t.prototype.visitRepetitionMandatory=function(e){this.collectNamedDSLMethod(e,i.RepetitionMandatory,o.AT_LEAST_ONE_IDX)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.collectNamedDSLMethod(e,i.RepetitionMandatoryWithSeparator,o.AT_LEAST_ONE_SEP_IDX)},t.prototype.visitRepetitionWithSeparator=function(e){this.collectNamedDSLMethod(e,i.RepetitionWithSeparator,o.MANY_SEP_IDX)},t.prototype.visitAlternation=function(e){var t=this;this.collectNamedDSLMethod(e,i.Alternation,o.OR_IDX);var r=e.definition.length>1;(0,s.forEach)(e.definition,(function(n,a){if(!(0,s.isUndefined)(n.name)){var l=n.definition;l=r?[new i.Option({definition:n.definition})]:n.definition;var u=(0,o.getKeyForAltIndex)(t.ruleIdx,o.OR_IDX,e.idx,a);t.result.push({def:l,key:u,name:n.name,orgProd:n})}}))},t}(a.GAstVisitor);function g(e,t){var r={allRuleNames:[]};return(0,s.forEach)(e,(function(e){var n=t[e.name];r.allRuleNames.push(e.name);var o=new p(n);e.accept(o),(0,s.forEach)(o.result,(function(t){t.def,t.key;var n=t.name;r.allRuleNames.push(e.name+n)}))})),r}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AT_LEAST_ONE_IDX:()=>h,AT_LEAST_ONE_SEP_IDX:()=>d,BITS_FOR_ALT_IDX:()=>i,BITS_FOR_METHOD_TYPE:()=>n,BITS_FOR_OCCURRENCE_IDX:()=>s,BITS_FOR_RULE_IDX:()=>o,MANY_IDX:()=>u,MANY_SEP_IDX:()=>c,OPTION_IDX:()=>l,OR_IDX:()=>a,getKeyForAltIndex:()=>m,getKeyForAutomaticLookahead:()=>p});var n=4,s=8,o=12,i=8,a=1<<s,l=2<<s,u=3<<s,h=4<<s,c=5<<s,d=6<<s;function p(e,t,r){return r|t|e}var g=32-i;function m(e,t,r,n){var s=n+1<<g;return p(e,t,r)|s}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{defaultGrammarResolverErrorProvider:()=>u,defaultGrammarValidatorErrorProvider:()=>h,defaultParserErrorProvider:()=>l});var n=r(21),s=r(17),o=r(20),i=r(30),a=r(36),l={buildMismatchTokenMessage:function(e){var t=e.expected,r=e.actual;e.previous,e.ruleName;return"Expecting "+((0,n.hasTokenLabel)(t)?"--\x3e "+(0,n.tokenLabel)(t)+" <--":"token of type --\x3e "+t.name+" <--")+" but found --\x3e '"+r.image+"' <--"},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,r=e.actual,o=(e.previous,e.customUserDescription),i=(e.ruleName,"Expecting: "),a="\nbut found: '"+(0,s.first)(r).image+"'";if(o)return i+o+a;var l=(0,s.reduce)(t,(function(e,t){return e.concat(t)}),[]),u=(0,s.map)(l,(function(e){return"["+(0,s.map)(e,(function(e){return(0,n.tokenLabel)(e)})).join(", ")+"]"}));return i+("one of these possible Token sequences:\n"+(0,s.map)(u,(function(e,t){return" "+(t+1)+". "+e})).join("\n"))+a},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,r=e.actual,o=e.customUserDescription,i=(e.ruleName,"Expecting: "),a="\nbut found: '"+(0,s.first)(r).image+"'";return o?i+o+a:i+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+(0,s.map)(t,(function(e){return"["+(0,s.map)(e,(function(e){return(0,n.tokenLabel)(e)})).join(",")+"]"})).join(" ,")+">")+a}};Object.freeze(l);var u={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},h={buildDuplicateFoundError:function(e,t){var r,n=e.name,a=(0,s.first)(t),l=a.idx,u=(0,i.getProductionDslName)(a),h=(r=a)instanceof o.Terminal?r.terminalType.name:r instanceof o.NonTerminal?r.nonTerminalName:"",c="->"+u+(l>0?l:"")+"<- "+(h?"with argument: ->"+h+"<-":"")+"\n appears more than once ("+t.length+" times) in the top level rule: ->"+n+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return c=(c=c.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: ->"+a.validNestedRuleName.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,s.first)(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,s.map)(e.prefixPath,(function(e){return(0,n.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin <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,s.map)(e.prefixPath,(function(e){return(0,n.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx,o="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.\n";return o+="See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=(0,i.getProductionDslName)(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;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 "+(t+" --\x3e "+s.map(e.leftRecursionPath,(function(e){return e.name})).concat([t]).join(" --\x3e "))+"\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 o.Rule?e.topLevelRule.name:e.topLevelRule)+"<- is already defined in the grammar: ->"+e.grammarName+"<-"}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{OccurrenceValidationCollector:()=>f,RepetionCollector:()=>b,checkPrefixAlternativesAmbiguities:()=>x,getFirstNoneTerminal:()=>A,identifyProductionForDuplicates:()=>g,validNestedRuleName:()=>E,validTermsPattern:()=>y,validateAmbiguousAlternationAlternatives:()=>M,validateEmptyOrAlternative:()=>O,validateGrammar:()=>p,validateNestedRuleName:()=>T,validateNoLeftRecursion:()=>v,validateRuleDoesNotAlreadyExist:()=>w,validateRuleIsOverridden:()=>S,validateRuleName:()=>C,validateSomeNonEmptyLookaheadPath:()=>_,validateTokenName:()=>R,validateTooManyAlts:()=>I});var n,s=r(17),o=r(16),i=r(30),a=r(37),l=r(33),u=r(38),h=r(20),c=r(31),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])},n(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)});function p(e,t,r,n,a,u){var h=s.map(e,(function(e){return function(e,t){var r=new f;e.accept(r);var n=r.allProductions,a=s.groupBy(n,g),l=s.pick(a,(function(e){return e.length>1})),u=s.map(s.values(l),(function(r){var n=s.first(r),a=t.buildDuplicateFoundError(e,r),l=(0,i.getProductionDslName)(n),u={message:a,type:o.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:l,occurrence:n.idx},h=m(n);return h&&(u.parameter=h),u}));return u}(e,a)})),c=s.map(e,(function(e){return v(e,e,a)})),d=[],p=[],y=[];(0,s.every)(c,s.isEmpty)&&(d=(0,s.map)(e,(function(e){return O(e,a)})),p=(0,s.map)(e,(function(e){return M(e,t,n,a)})),y=_(e,t,a));var E=function(e,t,r){var n=[],i=(0,s.map)(t,(function(e){return e.name}));return(0,s.forEach)(e,(function(e){var t=e.name;if((0,s.contains)(i,t)){var a=r.buildNamespaceConflictError(e);n.push({message:a,type:o.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),n}(e,r,a),S=s.map(r,(function(e){return R(e,a)})),A=function(e,t){var r=[];return(0,s.forEach)(e,(function(e){var n=new l.NamedDSLMethodsCollectorVisitor("");e.accept(n);var o=(0,s.map)(n.result,(function(e){return e.orgProd}));r.push((0,s.map)(o,(function(r){return T(e,r,t)})))})),(0,s.flatten)(r)}(e,a),N=function(e,t){var r=[];return(0,s.forEach)(e,(function(e){var n=new l.NamedDSLMethodsCollectorVisitor("");e.accept(n);var i=(0,s.groupBy)(n.result,(function(e){return e.name})),a=(0,s.pick)(i,(function(e){return e.length>1}));(0,s.forEach)((0,s.values)(a),(function(n){var i=(0,s.map)(n,(function(e){return e.orgProd})),a=t.buildDuplicateNestedRuleNameError(e,i);r.push({message:a,type:o.ParserDefinitionErrorType.DUPLICATE_NESTED_NAME,ruleName:e.name})}))})),r}(e,a),b=(0,s.map)(e,(function(e){return I(e,a)})),x=(0,s.map)(e,(function(e){return C(e,a)})),P=(0,s.map)(e,(function(t){return w(t,e,u,a)}));return s.flatten(h.concat(S,A,N,y,c,d,p,E,b,x,P))}function g(e){return(0,i.getProductionDslName)(e)+"_#_"+e.idx+"_#_"+m(e)}function m(e){return e instanceof h.Terminal?e.terminalType.name:e instanceof h.NonTerminal?e.nonTerminalName:""}var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return d(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}(c.GAstVisitor),y=/^[a-zA-Z_]\w*$/,E=new RegExp(y.source.replace("^","^\\$"));function C(e,t){var r=[],n=e.name;return n.match(y)||r.push({message:t.buildInvalidRuleNameError({topLevelRule:e,expectedPattern:y}),type:o.ParserDefinitionErrorType.INVALID_RULE_NAME,ruleName:n}),r}function T(e,t,r){var n,s=[];return t.name.match(E)||(n=r.buildInvalidNestedRuleNameError(e,t),s.push({message:n,type:o.ParserDefinitionErrorType.INVALID_NESTED_RULE_NAME,ruleName:e.name})),s}function R(e,t){var r=[];return e.name.match(y)||r.push({message:t.buildTokenNameError({tokenType:e,expectedPattern:y}),type:o.ParserDefinitionErrorType.INVALID_TOKEN_NAME}),r}function w(e,t,r,n){var i=[];if((0,s.reduce)(t,(function(t,r){return r.name===e.name?t+1:t}),0)>1){var a=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:a,type:o.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function S(e,t,r){var n,i=[];return s.contains(t,e)||(n="Invalid rule override, rule: ->"+e+"<- cannot be overridden in the grammar: ->"+r+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:o.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:e})),i}function v(e,t,r,n){void 0===n&&(n=[]);var i=[],a=A(t.definition);if(s.isEmpty(a))return[];var l=e.name;s.contains(a,e)&&i.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:o.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:l});var u=s.difference(a,n.concat([e])),h=s.map(u,(function(t){var o=s.cloneArr(n);return o.push(t),v(e,t,r,o)}));return i.concat(s.flatten(h))}function A(e){var t=[];if(s.isEmpty(e))return t;var r=s.first(e);if(r instanceof h.NonTerminal)t.push(r.referencedRule);else if(r instanceof h.Flat||r instanceof h.Option||r instanceof h.RepetitionMandatory||r instanceof h.RepetitionMandatoryWithSeparator||r instanceof h.RepetitionWithSeparator||r instanceof h.Repetition)t=t.concat(A(r.definition));else if(r instanceof h.Alternation)t=s.flatten(s.map(r.definition,(function(e){return A(e.definition)})));else if(!(r instanceof h.Terminal))throw Error("non exhaustive match");var n=(0,i.isOptionalProd)(r),o=e.length>1;if(n&&o){var a=s.drop(e);return t.concat(A(a))}return t}var N=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return d(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(c.GAstVisitor);function O(e,t){var r=new N;e.accept(r);var n=r.alternations;return s.reduce(n,(function(r,n){var i=s.dropRight(n.definition),a=s.map(i,(function(r,i){var a=(0,u.nextPossibleTokensAfter)([r],[],null,1);return s.isEmpty(a)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:o.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}:null}));return r.concat(s.compact(a))}),[])}function M(e,t,r,n){var l=new N;e.accept(l);var u=l.alternations,h=r[e.name];h&&(u=(0,s.reject)(u,(function(e){return h[(0,i.getProductionDslName)(e)+(0===e.idx?"":e.idx)]}))),u=(0,s.reject)(u,(function(e){return!0===e.ignoreAmbiguities}));var c=s.reduce(u,(function(r,i){var l=i.idx,u=i.maxLookahead||t,h=(0,a.getLookaheadPathsForOr)(l,e,u,i),c=function(e,t,r,n){var i=[],l=(0,s.reduce)(e,(function(r,n,o){return!0===t.definition[o].ignoreAmbiguities||(0,s.forEach)(n,(function(n){var l=[o];(0,s.forEach)(e,(function(e,r){o!==r&&(0,a.containsPath)(e,n)&&!0!==t.definition[r].ignoreAmbiguities&&l.push(r)})),l.length>1&&!(0,a.containsPath)(i,n)&&(i.push(n),r.push({alts:l,path:n}))})),r}),[]),u=s.map(l,(function(e){var i=(0,s.map)(e.alts,(function(e){return e+1}));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:o.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:[e.alts]}}));return u}(h,i,e,n),d=x(h,i,e,n);return r.concat(c,d)}),[]);return c}var b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return d(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}(c.GAstVisitor);function I(e,t){var r=new N;e.accept(r);var n=r.alternations;return s.reduce(n,(function(r,n){return n.definition.length>255&&r.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:o.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}),r}),[])}function _(e,t,r){var n=[];return(0,s.forEach)(e,(function(e){var i=new b;e.accept(i);var l=i.allProductions;(0,s.forEach)(l,(function(i){var l=(0,a.getProdType)(i),u=i.maxLookahead||t,h=i.idx,c=(0,a.getLookaheadPathsForOptionalProd)(h,e,l,u)[0];if((0,s.isEmpty)((0,s.flatten)(c))){var d=r.buildEmptyRepetitionError({topLevelRule:e,repetition:i});n.push({message:d,type:o.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),n}function x(e,t,r,n){var i=[],l=(0,s.reduce)(e,(function(e,t,r){var n=(0,s.map)(t,(function(e){return{idx:r,path:e}}));return e.concat(n)}),[]);return(0,s.forEach)(l,(function(e){if(!0!==t.definition[e.idx].ignoreAmbiguities){var u=e.idx,h=e.path,c=(0,s.findAll)(l,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<u&&(0,a.isStrictPrefixOfPath)(e.path,h)})),d=(0,s.map)(c,(function(e){var s=[e.idx+1,u+1],i=0===t.idx?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:s,prefixPath:e.path}),type:o.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:i,alternatives:s}}));i=i.concat(d)}})),i}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{PROD_TYPE:()=>s,areTokenCategoriesNotUsed:()=>O,buildAlternativesLookAheadFunc:()=>m,buildLookaheadFuncForOptionalProd:()=>g,buildLookaheadFuncForOr:()=>p,buildSingleAlternativeLookaheadFunction:()=>f,containsPath:()=>A,getLookaheadPathsForOptionalProd:()=>v,getLookaheadPathsForOr:()=>S,getProdType:()=>d,isStrictPrefixOfPath:()=>N,lookAheadSequenceFromAlternatives:()=>w});var n,s,o=r(17),i=r(38),a=r(19),l=r(27),u=r(20),h=r(31),c=(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])},n(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)});function d(e){if(e instanceof u.Option)return s.OPTION;if(e instanceof u.Repetition)return s.REPETITION;if(e instanceof u.RepetitionMandatory)return s.REPETITION_MANDATORY;if(e instanceof u.RepetitionMandatoryWithSeparator)return s.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof u.RepetitionWithSeparator)return s.REPETITION_WITH_SEPARATOR;if(e instanceof u.Alternation)return s.ALTERNATION;throw Error("non exhaustive match")}function p(e,t,r,n,s,o){var i=S(e,t,r);return o(i,n,O(i)?l.tokenStructuredMatcherNoCategories:l.tokenStructuredMatcher,s)}function g(e,t,r,n,s,o){var i=v(e,t,s,r),a=O(i)?l.tokenStructuredMatcherNoCategories:l.tokenStructuredMatcher;return o(i[0],a,n)}function m(e,t,r,n){var s=e.length,i=(0,o.every)(e,(function(e){return(0,o.every)(e,(function(e){return 1===e.length}))}));if(t)return function(t){for(var n=(0,o.map)(t,(function(e){return e.GATE})),i=0;i<s;i++){var a=e[i],l=a.length,u=n[i];if(void 0===u||!1!==u.call(this))e:for(var h=0;h<l;h++){for(var c=a[h],d=c.length,p=0;p<d;p++){var g=this.LA(p+1);if(!1===r(g,c[p]))continue e}return i}}};if(i&&!n){var a=(0,o.map)(e,(function(e){return(0,o.flatten)(e)})),l=(0,o.reduce)(a,(function(e,t,r){return(0,o.forEach)(t,(function(t){(0,o.has)(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=r),(0,o.forEach)(t.categoryMatches,(function(t){(0,o.has)(e,t)||(e[t]=r)}))})),e}),[]);return function(){var e=this.LA(1);return l[e.tokenTypeIdx]}}return function(){for(var t=0;t<s;t++){var n=e[t],o=n.length;e:for(var i=0;i<o;i++){for(var a=n[i],l=a.length,u=0;u<l;u++){var h=this.LA(u+1);if(!1===r(h,a[u]))continue e}return t}}}}function f(e,t,r){var n=(0,o.every)(e,(function(e){return 1===e.length})),s=e.length;if(n&&!r){var i=(0,o.flatten)(e);if(1===i.length&&(0,o.isEmpty)(i[0].categoryMatches)){var a=i[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}var l=(0,o.reduce)(i,(function(e,t,r){return e[t.tokenTypeIdx]=!0,(0,o.forEach)(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===l[e.tokenTypeIdx]}}return function(){e:for(var r=0;r<s;r++){for(var n=e[r],o=n.length,i=0;i<o;i++){var a=this.LA(i+1);if(!1===t(a,n[i]))continue e}return!0}return!1}}!function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"}(s||(s={}));var y=function(e){function t(t,r,n){var s=e.call(this)||this;return s.topProd=t,s.targetOccurrence=r,s.targetProdType=n,s}return c(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,r,n){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=r.concat(n),!0)},t.prototype.walkOption=function(t,r,n){this.checkIsTarget(t,s.OPTION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOne=function(t,r,n){this.checkIsTarget(t,s.REPETITION_MANDATORY,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOneSep=function(t,r,n){this.checkIsTarget(t,s.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkMany=function(t,r,n){this.checkIsTarget(t,s.REPETITION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkManySep=function(t,r,n){this.checkIsTarget(t,s.REPETITION_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t}(a.RestWalker),E=function(e){function t(t,r,n){var s=e.call(this)||this;return s.targetOccurrence=t,s.targetProdType=r,s.targetRef=n,s.result=[],s}return c(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,s.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,s.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,s.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,s.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,s.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,s.ALTERNATION)},t}(h.GAstVisitor);function C(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=[];return t}function T(e){for(var t=[""],r=0;r<e.length;r++){for(var n=e[r],s=[],o=0;o<t.length;o++){var i=t[o];s.push(i+"_"+n.tokenTypeIdx);for(var a=0;a<n.categoryMatches.length;a++){var l="_"+n.categoryMatches[a];s.push(i+l)}}t=s}return t}function R(e,t,r){for(var n=0;n<e.length;n++)if(n!==r)for(var s=e[n],o=0;o<t.length;o++){if(!0===s[t[o]])return!1}return!0}function w(e,t){for(var r=(0,o.map)(e,(function(e){return(0,i.possiblePathsFrom)([e],1)})),n=C(r.length),s=(0,o.map)(r,(function(e){var t={};return(0,o.forEach)(e,(function(e){var r=T(e.partialPath);(0,o.forEach)(r,(function(e){t[e]=!0}))})),t})),a=r,l=1;l<=t;l++){var u=a;a=C(u.length);for(var h=function(e){for(var r=u[e],h=0;h<r.length;h++){var c=r[h].partialPath,d=r[h].suffixDef,p=T(c);if(R(s,p,e)||(0,o.isEmpty)(d)||c.length===t){var g=n[e];if(!1===A(g,c)){g.push(c);for(var m=0;m<p.length;m++){var f=p[m];s[e][f]=!0}}}else{var y=(0,i.possiblePathsFrom)(d,l+1,c);a[e]=a[e].concat(y),(0,o.forEach)(y,(function(t){var r=T(t.partialPath);(0,o.forEach)(r,(function(t){s[e][t]=!0}))}))}}},c=0;c<u.length;c++)h(c)}return n}function S(e,t,r,n){var o=new E(e,s.ALTERNATION,n);return t.accept(o),w(o.result,r)}function v(e,t,r,n){var s=new E(e,r);t.accept(s);var o=s.result,i=new y(t,e,r).startWalking();return w([new u.Flat({definition:o}),new u.Flat({definition:i})],n)}function A(e,t){e:for(var r=0;r<e.length;r++){var n=e[r];if(n.length===t.length){for(var s=0;s<n.length;s++){var o=t[s],i=n[s];if(!1===(o===i||void 0!==i.categoryMatchesMap[o.tokenTypeIdx]))continue e}return!0}}return!1}function N(e,t){return e.length<t.length&&(0,o.every)(e,(function(e,r){var n=t[r];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}))}function O(e){return(0,o.every)(e,(function(e){return(0,o.every)(e,(function(e){return(0,o.every)(e,(function(e){return(0,o.isEmpty)(e.categoryMatches)}))}))}))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractNextPossibleTokensWalker:()=>u,AbstractNextTerminalAfterProductionWalker:()=>c,NextAfterTokenWalker:()=>h,NextTerminalAfterAtLeastOneSepWalker:()=>m,NextTerminalAfterAtLeastOneWalker:()=>g,NextTerminalAfterManySepWalker:()=>p,NextTerminalAfterManyWalker:()=>d,nextPossibleTokensAfter:()=>y,possiblePathsFrom:()=>f});var n,s=r(19),o=r(17),i=r(29),a=r(20),l=(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])},n(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)}),u=function(e){function t(t,r){var n=e.call(this)||this;return n.topProd=t,n.path=r,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return l(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,o.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,o.cloneArr)(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 n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}},t.prototype.updateExpectedNext=function(){(0,o.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(s.RestWalker),h=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.path=r,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return l(t,e),t.prototype.walkTerminal=function(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var n=t.concat(r),s=new a.Flat({definition:n});this.possibleTokTypes=(0,i.first)(s),this.found=!0}},t}(u),c=function(e){function t(t,r){var n=e.call(this)||this;return n.topRule=t,n.occurrence=r,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return l(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(s.RestWalker),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.walkMany=function(t,r,n){if(t.idx===this.occurrence){var s=(0,o.first)(r.concat(n));this.result.isEndOfRule=void 0===s,s instanceof a.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else e.prototype.walkMany.call(this,t,r,n)},t}(c),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.walkManySep=function(t,r,n){if(t.idx===this.occurrence){var s=(0,o.first)(r.concat(n));this.result.isEndOfRule=void 0===s,s instanceof a.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else e.prototype.walkManySep.call(this,t,r,n)},t}(c),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.walkAtLeastOne=function(t,r,n){if(t.idx===this.occurrence){var s=(0,o.first)(r.concat(n));this.result.isEndOfRule=void 0===s,s instanceof a.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else e.prototype.walkAtLeastOne.call(this,t,r,n)},t}(c),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.walkAtLeastOneSep=function(t,r,n){if(t.idx===this.occurrence){var s=(0,o.first)(r.concat(n));this.result.isEndOfRule=void 0===s,s instanceof a.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,r,n)},t}(c);function f(e,t,r){void 0===r&&(r=[]),r=(0,o.cloneArr)(r);var n=[],s=0;function i(i){var a=f(i.concat((0,o.drop)(e,s+1)),t,r);return n.concat(a)}for(;r.length<t&&s<e.length;){var l=e[s];if(l instanceof a.Flat)return i(l.definition);if(l instanceof a.NonTerminal)return i(l.definition);if(l instanceof a.Option)n=i(l.definition);else{if(l instanceof a.RepetitionMandatory)return i(u=l.definition.concat([new a.Repetition({definition:l.definition})]));if(l instanceof a.RepetitionMandatoryWithSeparator)return i(u=[new a.Flat({definition:l.definition}),new a.Repetition({definition:[new a.Terminal({terminalType:l.separator})].concat(l.definition)})]);if(l instanceof a.RepetitionWithSeparator){var u=l.definition.concat([new a.Repetition({definition:[new a.Terminal({terminalType:l.separator})].concat(l.definition)})]);n=i(u)}else if(l instanceof a.Repetition){u=l.definition.concat([new a.Repetition({definition:l.definition})]);n=i(u)}else{if(l instanceof a.Alternation)return(0,o.forEach)(l.definition,(function(e){n=i(e.definition)})),n;if(!(l instanceof a.Terminal))throw Error("non exhaustive match");r.push(l.terminalType)}}s++}return n.push({partialPath:r,suffixDef:(0,o.drop)(e,s)}),n}function y(e,t,r,n){var s="EXIT_NONE_TERMINAL",i=[s],l="EXIT_ALTERNATIVE",u=!1,h=t.length,c=h-n-1,d=[],p=[];for(p.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!(0,o.isEmpty)(p);){var g=p.pop();if(g!==l){var m=g.def,f=g.idx,y=g.ruleStack,C=g.occurrenceStack;if(!(0,o.isEmpty)(m)){var T=m[0];if(T===s){var R={idx:f,def:(0,o.drop)(m),ruleStack:(0,o.dropRight)(y),occurrenceStack:(0,o.dropRight)(C)};p.push(R)}else if(T instanceof a.Terminal)if(f<h-1){var w=f+1;if(r(t[w],T.terminalType)){R={idx:w,def:(0,o.drop)(m),ruleStack:y,occurrenceStack:C};p.push(R)}}else{if(f!==h-1)throw Error("non exhaustive match");d.push({nextTokenType:T.terminalType,nextTokenOccurrence:T.idx,ruleStack:y,occurrenceStack:C}),u=!0}else if(T instanceof a.NonTerminal){var S=(0,o.cloneArr)(y);S.push(T.nonTerminalName);var v=(0,o.cloneArr)(C);v.push(T.idx);R={idx:f,def:T.definition.concat(i,(0,o.drop)(m)),ruleStack:S,occurrenceStack:v};p.push(R)}else if(T instanceof a.Option){var A={idx:f,def:(0,o.drop)(m),ruleStack:y,occurrenceStack:C};p.push(A),p.push(l);var N={idx:f,def:T.definition.concat((0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(N)}else if(T instanceof a.RepetitionMandatory){var O=new a.Repetition({definition:T.definition,idx:T.idx});R={idx:f,def:T.definition.concat([O],(0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(R)}else if(T instanceof a.RepetitionMandatoryWithSeparator){var M=new a.Terminal({terminalType:T.separator});O=new a.Repetition({definition:[M].concat(T.definition),idx:T.idx}),R={idx:f,def:T.definition.concat([O],(0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(R)}else if(T instanceof a.RepetitionWithSeparator){A={idx:f,def:(0,o.drop)(m),ruleStack:y,occurrenceStack:C};p.push(A),p.push(l);M=new a.Terminal({terminalType:T.separator});var b=new a.Repetition({definition:[M].concat(T.definition),idx:T.idx});N={idx:f,def:T.definition.concat([b],(0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(N)}else if(T instanceof a.Repetition){A={idx:f,def:(0,o.drop)(m),ruleStack:y,occurrenceStack:C};p.push(A),p.push(l);b=new a.Repetition({definition:T.definition,idx:T.idx}),N={idx:f,def:T.definition.concat([b],(0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(N)}else if(T instanceof a.Alternation)for(var I=T.definition.length-1;I>=0;I--){var _={idx:f,def:T.definition[I].definition.concat((0,o.drop)(m)),ruleStack:y,occurrenceStack:C};p.push(_),p.push(l)}else if(T instanceof a.Flat)p.push({idx:f,def:T.definition.concat((0,o.drop)(m)),ruleStack:y,occurrenceStack:C});else{if(!(T instanceof a.Rule))throw Error("non exhaustive match");p.push(E(T,f,y,C))}}}else u&&(0,o.last)(p).idx<=c&&p.pop()}return d}function E(e,t,r,n){var s=(0,o.cloneArr)(r);s.push(e.name);var i=(0,o.cloneArr)(n);return i.push(1),{idx:t,def:e.definition,ruleStack:s,occurrenceStack:i}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{assignOccurrenceIndices:()=>h,resolveGrammar:()=>l,validateGrammar:()=>u});var n=r(17),s=r(40),o=r(36),i=r(35),a=r(30);function l(e){e=(0,n.defaults)(e,{errMsgProvider:i.defaultGrammarResolverErrorProvider});var t={};return(0,n.forEach)(e.rules,(function(e){t[e.name]=e})),(0,s.resolveGrammar)(t,e.errMsgProvider)}function u(e){return e=(0,n.defaults)(e,{errMsgProvider:i.defaultGrammarValidatorErrorProvider,ignoredIssues:{}}),(0,o.validateGrammar)(e.rules,e.maxLookahead,e.tokenTypes,e.ignoredIssues,e.errMsgProvider,e.grammarName)}function h(e){(0,n.forEach)(e.rules,(function(e){var t=new a.DslMethodsCollectorVisitor;e.accept(t),(0,n.forEach)(t.dslMethods,(function(e){(0,n.forEach)(e,(function(e,t){e.idx=t+1}))}))}))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{GastRefResolverVisitor:()=>u,resolveGrammar:()=>l});var n,s=r(16),o=r(17),i=r(31),a=(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])},n(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)});function l(e,t){var r=new u(e,t);return r.resolveRefs(),r.errors}var u=function(e){function t(t,r){var n=e.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=r,n.errors=[],n}return a(t,e),t.prototype.resolveRefs=function(){var e=this;(0,o.forEach)((0,o.values)(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:s.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(i.GAstVisitor)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EOF_FOLLOW_KEY:()=>l,IN_RULE_RECOVERY_EXCEPTION:()=>u,InRuleRecoveryException:()=>h,Recoverable:()=>c,attemptInRepetitionRecovery:()=>d});var n=r(21),s=r(17),o=r(42),i=r(32),a=r(16),l={},u="InRuleRecoveryException";function h(e){this.name=u,this.message=e}h.prototype=Error.prototype;var c=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,s.has)(e,"recoveryEnabled")?e.recoveryEnabled:a.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=d)},e.prototype.getTokenToInsert=function(e){var t=(0,n.createTokenInstance)(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,n){for(var i=this,a=this.findReSyncTokenType(),l=this.exportLexerState(),u=[],h=!1,c=this.LA(1),d=this.LA(1),p=function(){var e=i.LA(0),t=i.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:c,previous:e,ruleName:i.getCurrRuleFullName()}),r=new o.MismatchedTokenException(t,c,i.LA(0));r.resyncedTokens=(0,s.dropRight)(u),i.SAVE_ERROR(r)};!h;){if(this.tokenMatcher(d,n))return void p();if(r.call(this))return p(),void e.apply(this,t);this.tokenMatcher(d,a)?h=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,u))}this.importLexerState(l)},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 h("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))return!1;if((0,s.isEmpty)(t))return!1;var n=this.LA(1);return void 0!==(0,s.find)(t,(function(e){return r.tokenMatcher(n,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,s.contains)(r,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var n=t.tokenType;if((0,s.contains)(e,n))return n;t=this.LA(r),r++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return l;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return(0,s.isEmpty)(this.LAST_EXPLICIT_RULE_STACK)||(t=(0,s.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_STACK[t]})),r=(0,s.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_OCCURRENCE_STACK[t]}))),(0,s.map)(t,(function(n,s){return 0===s?l:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:r[s],inRule:e.shortRuleNameToFullName(t[s-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=(0,s.map)(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return(0,s.flatten)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===l)return[n.EOF];var t=e.ruleName+e.idxInCallingRule+i.IN+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,n.EOF)||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,s.dropRight)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,r,n,s,o,i){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,s.cloneArr)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,s.isEmpty)(this.LAST_EXPLICIT_RULE_STACK)?(0,s.map)(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)})):(0,s.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.shortRuleNameToFullName(e.RULE_STACK[t])}))},e}();function d(e,t,r,s,o,i,a){var l=this.getKeyForAutomaticLookahead(s,o),u=this.firstAfterRepMap[l];if(void 0===u){var h=this.getCurrRuleFullName();u=new i(this.getGAstProductions()[h],o).startWalking(),this.firstAfterRepMap[l]=u}var c=u.token,d=u.occurrence,p=u.isEndOfRule;1===this.RULE_STACK.length&&p&&void 0===c&&(c=n.EOF,d=1),this.shouldInRepetitionRecoveryBeTried(c,d,a)&&this.tryInRepetitionRecovery(e,t,r,c)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EarlyExitException:()=>p,MismatchedTokenException:()=>h,NoViableAltException:()=>c,NotAllInputParsedException:()=>d,isRecognitionException:()=>u});var n=r(17),s="MismatchedTokenException",o="NoViableAltException",i="EarlyExitException",a="NotAllInputParsedException",l=[s,o,i,a];function u(e){return(0,n.contains)(l,e.name)}function h(e,t,r){this.name=s,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function c(e,t,r){this.name=o,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function d(e,t){this.name=a,this.message=e,this.token=t,this.resyncedTokens=[]}function p(e,t,r){this.name=i,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}Object.freeze(l),h.prototype=Error.prototype,c.prototype=Error.prototype,d.prototype=Error.prototype,p.prototype=Error.prototype},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LooksAhead:()=>l});var n=r(37),s=r(17),o=r(16),i=r(34),a=r(30),l=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,s.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:o.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,s.has)(e,"maxLookahead")?e.maxLookahead:o.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,s.isES2015MapSupported)()?new Map:[],(0,s.isES2015MapSupported)()?(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,s.forEach)(e,(function(e){t.TRACE_INIT(e.name+" Rule Lookahead",(function(){var r=(0,a.collectMethods)(e),o=r.alternation,l=r.repetition,u=r.option,h=r.repetitionMandatory,c=r.repetitionMandatoryWithSeparator,d=r.repetitionWithSeparator;(0,s.forEach)(o,(function(r){var s=0===r.idx?"":r.idx;t.TRACE_INIT(""+(0,a.getProductionDslName)(r)+s,(function(){var s=(0,n.buildLookaheadFuncForOr)(r.idx,e,r.maxLookahead||t.maxLookahead,r.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),o=(0,i.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[e.name],i.OR_IDX,r.idx);t.setLaFuncCache(o,s)}))})),(0,s.forEach)(l,(function(r){t.computeLookaheadFunc(e,r.idx,i.MANY_IDX,n.PROD_TYPE.REPETITION,r.maxLookahead,(0,a.getProductionDslName)(r))})),(0,s.forEach)(u,(function(r){t.computeLookaheadFunc(e,r.idx,i.OPTION_IDX,n.PROD_TYPE.OPTION,r.maxLookahead,(0,a.getProductionDslName)(r))})),(0,s.forEach)(h,(function(r){t.computeLookaheadFunc(e,r.idx,i.AT_LEAST_ONE_IDX,n.PROD_TYPE.REPETITION_MANDATORY,r.maxLookahead,(0,a.getProductionDslName)(r))})),(0,s.forEach)(c,(function(r){t.computeLookaheadFunc(e,r.idx,i.AT_LEAST_ONE_SEP_IDX,n.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,r.maxLookahead,(0,a.getProductionDslName)(r))})),(0,s.forEach)(d,(function(r){t.computeLookaheadFunc(e,r.idx,i.MANY_SEP_IDX,n.PROD_TYPE.REPETITION_WITH_SEPARATOR,r.maxLookahead,(0,a.getProductionDslName)(r))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,r,s,o,a){var l=this;this.TRACE_INIT(""+a+(0===t?"":t),(function(){var a=(0,n.buildLookaheadFuncForOptionalProd)(t,e,o||l.maxLookahead,l.dynamicTokensEnabled,s,l.lookAheadBuilderForOptional),u=(0,i.getKeyForAutomaticLookahead)(l.fullRuleNameToShort[e.name],r,t);l.setLaFuncCache(u,a)}))},e.prototype.lookAheadBuilderForOptional=function(e,t,r){return(0,n.buildSingleAlternativeLookaheadFunction)(e,t,r)},e.prototype.lookAheadBuilderForAlternatives=function(e,t,r,s){return(0,n.buildAlternativesLookAheadFunc)(e,t,r,s)},e.prototype.getKeyForAutomaticLookahead=function(e,t){var r=this.getLastExplicitRuleShortName();return(0,i.getKeyForAutomaticLookahead)(r,e,t)},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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TreeBuilder:()=>l});var n=r(33),s=r(17),o=r(45),i=r(34),a=r(16),l=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.outputCst=(0,s.has)(e,"outputCst")?e.outputCst:a.DEFAULT_PARSER_CONFIG.outputCst,this.nodeLocationTracking=(0,s.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:a.DEFAULT_PARSER_CONFIG.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=n.setNodeLocationFull,this.setNodeLocationFromNode=n.setNodeLocationFull,this.cstPostRule=s.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=s.NOOP,this.setNodeLocationFromNode=s.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=n.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=n.setNodeLocationOnlyOffset,this.cstPostRule=s.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=s.NOOP,this.setNodeLocationFromNode=s.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"');this.setNodeLocationFromToken=s.NOOP,this.setNodeLocationFromNode=s.NOOP,this.cstPostRule=s.NOOP,this.setInitialNodeLocation=s.NOOP}else this.cstInvocationStateUpdate=s.NOOP,this.cstFinallyStateUpdate=s.NOOP,this.cstPostTerminal=s.NOOP,this.cstPostNonTerminal=s.NOOP,this.cstPostRule=s.NOOP,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];(0,n.addTerminalToCst)(r,t,e),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];(0,n.addNoneTerminalToCst)(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}},e.prototype.getBaseCstVisitorConstructor=function(){if((0,s.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,o.createBaseSemanticVisitorConstructor)(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,s.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,o.createBaseVisitorConstructorWithDefaults)(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}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,n){var s,o=this.getLastExplicitRuleShortName(),a=(0,i.getKeyForAltIndex)(o,r,t,n);return void 0!==e.NAME?(s=e.NAME,this.nestedRuleInvocationStateUpdate(s,a),{shortName:a,nestedName:s}):void 0},e.prototype.nestedRuleFinallyClause=function(e,t){var r=this.CST_STACK,s=r[r.length-1];this.nestedRuleFinallyStateUpdate();var o=r[r.length-1];(0,n.addNoneTerminalToCst)(o,t,s),this.setNodeLocationFromNode(o.location,s.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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CstVisitorDefinitionError:()=>n,createBaseSemanticVisitorConstructor:()=>l,createBaseVisitorConstructorWithDefaults:()=>u,defaultVisit:()=>a,validateMissingCstMethods:()=>c,validateRedundantMethods:()=>p,validateVisitor:()=>h});var n,s=r(17),o=r(46),i=r(36);function a(e,t){for(var r=(0,s.keys)(e),n=r.length,o=0;o<n;o++)for(var i=e[r[o]],a=i.length,l=0;l<a;l++){var u=i[l];void 0===u.tokenTypeIdx&&(void 0!==u.fullName?this[u.fullName](u.children,t):this[u.name](u.children,t))}}function l(e,t){var r=function(){};return(0,o.defineNameProp)(r,e+"BaseSemantics"),(r.prototype={visit:function(e,t){if((0,s.isArray)(e)&&(e=e[0]),!(0,s.isUndefined)(e))return void 0!==e.fullName?this[e.fullName](e.children,t):this[e.name](e.children,t)},validateVisitor:function(){var e=h(this,t);if(!(0,s.isEmpty)(e)){var r=(0,s.map)(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <"+(0,o.functionName)(this.constructor)+">:\n\t"+r.join("\n\n").replace(/\n/g,"\n\t"))}}}).constructor=r,r._RULE_NAMES=t,r}function u(e,t,r){var n=function(){};(0,o.defineNameProp)(n,e+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,s.forEach)(t,(function(e){i[e]=a})),(n.prototype=i).constructor=n,n}function h(e,t){var r=c(e,t),n=p(e,t);return r.concat(n)}function c(e,t){var r=(0,s.map)(t,(function(t){if(!(0,s.isFunction)(e[t]))return{msg:"Missing visitor method: <"+t+"> on "+(0,o.functionName)(e.constructor)+" CST Visitor.",type:n.MISSING_METHOD,methodName:t}}));return(0,s.compact)(r)}!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(n||(n={}));var d=["constructor","visit","validateVisitor"];function p(e,t){var r=[];for(var a in e)i.validTermsPattern.test(a)&&(0,s.isFunction)(e[a])&&!(0,s.contains)(d,a)&&!(0,s.contains)(t,a)&&r.push({msg:"Redundant visitor method: <"+a+"> on "+(0,o.functionName)(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 /"+i.validTermsPattern.source+"/.",type:n.REDUNDANT_METHOD,methodName:a});return r}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{classNameFromInstance:()=>s,defineNameProp:()=>l,functionName:()=>a});var n=r(17);function s(e){return a(e.constructor)}var o=/^\s*function\s*(\S*)\s*\(/,i="name";function a(e){var t=e.name;return t||e.toString().match(o)[1]}function l(e,t){var r=Object.getOwnPropertyDescriptor(e,i);return!(!(0,n.isUndefined)(r)&&!r.configurable)&&(Object.defineProperty(e,i,{enumerable:!1,configurable:!0,writable:!1,value:t}),!0)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LexerAdapter:()=>s});var n=r(16),s=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)):n.END_OF_FILE},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?n.END_OF_FILE: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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RecognizerApi:()=>u});var n=r(17),s=r(42),o=r(16),i=r(35),a=r(36),l=r(20),u=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=o.DEFAULT_RULE_CONFIG),(0,n.contains)(this.definedRulesNames,e)){var s={message:i.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:o.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);var a=this.defineRule(e,t,r);return this[e]=a,a},e.prototype.OVERRIDE_RULE=function(e,t,r){void 0===r&&(r=o.DEFAULT_RULE_CONFIG);var n=[];n=n.concat((0,a.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,n);var s=this.defineRule(e,t,r);return this[e]=s,s},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((0,s.isRecognitionException)(e))return!1;throw e}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return(0,l.serializeGrammar)((0,n.values)(this.gastProductionsCache))},e}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RecognizerEngine:()=>p});var n=r(17),s=r(34),o=r(42),i=r(37),a=r(38),l=r(16),u=r(41),h=r(21),c=r(27),d=r(46),p=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=(0,d.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=c.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,n.has)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,n.isArray)(e)){if((0,n.isEmpty)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis 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\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if((0,n.isArray)(e))this.tokensMap=(0,n.reduce)(e,(function(e,t){return e[t.name]=t,e}),{});else if((0,n.has)(e,"modes")&&(0,n.every)((0,n.flatten)((0,n.values)(e.modes)),c.isTokenType)){var r=(0,n.flatten)((0,n.values)(e.modes)),s=(0,n.uniq)(r);this.tokensMap=(0,n.reduce)(s,(function(e,t){return e[t.name]=t,e}),{})}else{if(!(0,n.isObject)(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,n.cloneObj)(e)}this.tokensMap.EOF=h.EOF;var o=(0,n.every)((0,n.values)(e),(function(e){return(0,n.isEmpty)(e.categoryMatches)}));this.tokenMatcher=o?c.tokenStructuredMatcherNoCategories:c.tokenStructuredMatcher,(0,c.augmentTokenTypes)((0,n.values)(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 o,i=(0,n.has)(r,"resyncEnabled")?r.resyncEnabled:l.DEFAULT_RULE_CONFIG.resyncEnabled,a=(0,n.has)(r,"recoveryValueFunc")?r.recoveryValueFunc:l.DEFAULT_RULE_CONFIG.recoveryValueFunc,u=this.ruleShortNameIdx<<s.BITS_FOR_METHOD_TYPE+s.BITS_FOR_OCCURRENCE_IDX;function h(e){try{if(!0===this.outputCst){t.apply(this,e);var r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}return t.apply(this,e)}catch(e){return this.invokeRuleCatch(e,i,a)}finally{this.ruleFinallyStateUpdate()}}this.ruleShortNameIdx++,this.shortRuleNameToFull[u]=e,this.fullRuleNameToShort[e]=u;return(o=function(t,r){return void 0===t&&(t=0),this.ruleInvocationStateUpdate(u,e,t),h.call(this,r)}).ruleName=e,o.originalGrammarAction=t,o},e.prototype.invokeRuleCatch=function(e,t,r){var n=1===this.RULE_STACK.length,s=t&&!this.isBackTracking()&&this.recoveryEnabled;if((0,o.isRecognitionException)(e)){var i=e;if(s){var a,l=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(l))return i.resyncedTokens=this.reSyncTo(l),this.outputCst?((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,a):r();throw this.outputCst&&((a=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,i.partialCstResult=a),i}if(n)return this.moveToTerminatedState(),r();throw i}throw e},e.prototype.optionInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.OPTION_IDX,t),n=this.nestedRuleBeforeClause(e,r);try{return this.optionInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.optionInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.OPTION_IDX,t);return this.optionInternalLogic(e,t,r)},e.prototype.optionInternalLogic=function(e,t,r){var n,s,o=this,i=this.getLaFuncFromCache(r);if(void 0!==e.DEF){if(n=e.DEF,void 0!==(s=e.GATE)){var a=i;i=function(){return s.call(o)&&a.call(o)}}}else n=e;if(!0===i.call(this))return n.call(this)},e.prototype.atLeastOneInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.AT_LEAST_ONE_IDX,e),n=this.nestedRuleBeforeClause(t,r);try{return this.atLeastOneInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.atLeastOneInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.AT_LEAST_ONE_IDX,e);this.atLeastOneInternalLogic(e,t,r)},e.prototype.atLeastOneInternalLogic=function(e,t,r){var n,o,l=this,u=this.getLaFuncFromCache(r);if(void 0!==t.DEF){if(n=t.DEF,void 0!==(o=t.GATE)){var h=u;u=function(){return o.call(l)&&h.call(l)}}}else n=t;if(!0!==u.call(this))throw this.raiseEarlyExitException(e,i.PROD_TYPE.REPETITION_MANDATORY,t.ERR_MSG);for(var c=this.doSingleRepetition(n);!0===u.call(this)&&!0===c;)c=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],u,s.AT_LEAST_ONE_IDX,e,a.NextTerminalAfterAtLeastOneWalker)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.AT_LEAST_ONE_SEP_IDX,e),n=this.nestedRuleBeforeClause(t,r);try{this.atLeastOneSepFirstInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.atLeastOneSepFirstInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,t,r)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,r){var n=this,o=t.DEF,l=t.SEP;if(!0!==this.getLaFuncFromCache(r).call(this))throw this.raiseEarlyExitException(e,i.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);o.call(this);for(var u=function(){return n.tokenMatcher(n.LA(1),l)};!0===this.tokenMatcher(this.LA(1),l);)this.CONSUME(l),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,l,u,o,a.NextTerminalAfterAtLeastOneSepWalker],u,s.AT_LEAST_ONE_SEP_IDX,e,a.NextTerminalAfterAtLeastOneSepWalker)},e.prototype.manyInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.MANY_IDX,e),n=this.nestedRuleBeforeClause(t,r);try{return this.manyInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.manyInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.MANY_IDX,e);return this.manyInternalLogic(e,t,r)},e.prototype.manyInternalLogic=function(e,t,r){var n,o,i=this,l=this.getLaFuncFromCache(r);if(void 0!==t.DEF){if(n=t.DEF,void 0!==(o=t.GATE)){var u=l;l=function(){return o.call(i)&&u.call(i)}}}else n=t;for(var h=!0;!0===l.call(this)&&!0===h;)h=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],l,s.MANY_IDX,e,a.NextTerminalAfterManyWalker,h)},e.prototype.manySepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.MANY_SEP_IDX,e),n=this.nestedRuleBeforeClause(t,r);try{this.manySepFirstInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.manySepFirstInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(s.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,t,r)},e.prototype.manySepFirstInternalLogic=function(e,t,r){var n=this,o=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){o.call(this);for(var l=function(){return n.tokenMatcher(n.LA(1),i)};!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,l,o,a.NextTerminalAfterManySepWalker],l,s.MANY_SEP_IDX,e,a.NextTerminalAfterManySepWalker)}},e.prototype.repetitionSepSecondInternal=function(e,t,r,n,o){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,o],r,s.AT_LEAST_ONE_SEP_IDX,e,o)},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,n.isArray)(e)?e:e.DEF,o=this.getKeyForAutomaticLookahead(s.OR_IDX,t),i=this.getLaFuncFromCache(o).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.orInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(s.OR_IDX,t),o=this.nestedRuleBeforeClause(e,r);try{var i=(0,n.isArray)(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(void 0!==a){var l=i[a],u=this.nestedAltBeforeClause(l,t,s.OR_IDX,a);try{return l.ALT.call(this)}finally{void 0!==u&&this.nestedRuleFinallyClause(u.shortName,u.nestedName)}}this.raiseNoAltException(t,e.ERR_MSG)}finally{void 0!==o&&this.nestedRuleFinallyClause(r,o)}},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 o.NotAllInputParsedException(t,e))}},e.prototype.subruleInternal=function(e,t,r){var n;try{var s=void 0!==r?r.ARGS:void 0;return n=e.call(this,t,s),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:e.ruleName),n}catch(t){this.subruleInternalError(t,r,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,r){throw(0,o.isRecognitionException)(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 n;try{var s=this.LA(1);!0===this.tokenMatcher(s,e)?(this.consumeToken(),n=s):this.consumeInternalError(e,s,r)}catch(r){n=this.consumeInternalRecovery(e,t,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:e.name,n),n},e.prototype.consumeInternalError=function(e,t,r){var n,s=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new o.MismatchedTokenException(n,t,s))},e.prototype.consumeInternalRecovery=function(e,t,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(e){throw e.name===u.IN_RULE_RECOVERY_EXCEPTION?r:e}},e.prototype.saveRecogState=function(){var e=this.errors,t=(0,n.cloneArr)(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),h.EOF)},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}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorHandler:()=>a});var n=r(42),s=r(17),o=r(37),i=r(16),a=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,s.defaults)(e.errorMessageProvider,i.DEFAULT_PARSER_CONFIG.errorMessageProvider)},e.prototype.SAVE_ERROR=function(e){if((0,n.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,s.cloneArr)(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,s.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!0,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,r){for(var s=this.getCurrRuleFullName(),i=this.getGAstProductions()[s],a=(0,o.getLookaheadPathsForOptionalProd)(e,i,t,this.maxLookahead)[0],l=[],u=1;u<=this.maxLookahead;u++)l.push(this.LA(u));var h=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:s});throw this.SAVE_ERROR(new n.EarlyExitException(h,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var r=this.getCurrRuleFullName(),s=this.getGAstProductions()[r],i=(0,o.getLookaheadPathsForOr)(e,s,this.maxLookahead),a=[],l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));var u=this.LA(0),h=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:u,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new n.NoViableAltException(h,this.LA(1),u))},e}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ContentAssist:()=>o});var n=r(38),s=r(17),o=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var r=this.gastProductionsCache[e];if((0,s.isUndefined)(r))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,n.nextPossibleTokensAfter)([r],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=(0,s.first)(e.ruleStack),r=this.getGAstProductions()[t];return new n.NextAfterTokenWalker(r,e).startWalking()},e}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{GastRecorder:()=>m});var n=r(17),s=r(20),o=r(22),i=r(27),a=r(21),l=r(16),u=r(34),h={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(h);var c=Math.pow(2,u.BITS_FOR_OCCURRENCE_IDX)-1,d=(0,a.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:o.Lexer.NA});(0,i.augmentTokenTypes)([d]);var p=(0,a.createTokenInstance)(d,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(p);var g={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},m=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 l.END_OF_FILE},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new s.Rule({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\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return f.call(this,s.Option,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){f.call(this,s.RepetitionMandatory,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){f.call(this,s.RepetitionMandatoryWithSeparator,t,e,true)},e.prototype.manyInternalRecord=function(e,t){f.call(this,s.Repetition,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){f.call(this,s.RepetitionWithSeparator,t,e,true)},e.prototype.orInternalRecord=function(e,t){return y.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,r){if(C(t),!e||!1===(0,n.has)(e,"ruleName")){var o=new Error("<SUBRULE"+E(t)+"> argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw o.KNOWN_RECORDER_ERROR=!0,o}var i=(0,n.peek)(this.recordingProdStack),a=e.ruleName,l=new s.NonTerminal({idx:t,nonTerminalName:a,referencedRule:void 0});return i.definition.push(l),this.outputCst?g:h},e.prototype.consumeInternalRecord=function(e,t,r){if(C(t),!(0,i.hasShortKeyProperty)(e)){var o=new Error("<CONSUME"+E(t)+"> argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw o.KNOWN_RECORDER_ERROR=!0,o}var a=(0,n.peek)(this.recordingProdStack),l=new s.Terminal({idx:t,terminalType:e});return a.definition.push(l),p},e}();function f(e,t,r,s){void 0===s&&(s=!1),C(r);var o=(0,n.peek)(this.recordingProdStack),i=(0,n.isFunction)(t)?t:t.DEF,a=new e({definition:[],idx:r});return(0,n.has)(t,"NAME")&&(a.name=t.NAME),s&&(a.separator=t.SEP),(0,n.has)(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(a),i.call(this),o.definition.push(a),this.recordingProdStack.pop(),h}function y(e,t){var r=this;C(t);var o=(0,n.peek)(this.recordingProdStack),i=!1===(0,n.isArray)(e),a=!1===i?e:e.DEF,l=new s.Alternation({definition:[],idx:t,ignoreAmbiguities:i&&!0===e.IGNORE_AMBIGUITIES});(0,n.has)(e,"NAME")&&(l.name=e.NAME),(0,n.has)(e,"MAX_LOOKAHEAD")&&(l.maxLookahead=e.MAX_LOOKAHEAD);var u=(0,n.some)(a,(function(e){return(0,n.isFunction)(e.GATE)}));return l.hasPredicates=u,o.definition.push(l),(0,n.forEach)(a,(function(e){var t=new s.Flat({definition:[]});l.definition.push(t),(0,n.has)(e,"NAME")&&(t.name=e.NAME),(0,n.has)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,n.has)(e,"GATE")&&(t.ignoreAmbiguities=!0),r.recordingProdStack.push(t),e.ALT.call(r),r.recordingProdStack.pop()})),h}function E(e){return 0===e?"":""+e}function C(e){if(e<0||e>c){var t=new Error("Invalid DSL Method idx value: <"+e+">\n\tIdx value must be a none negative value smaller than "+(c+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{PerformanceTracer:()=>o});var n=r(17),s=r(16),o=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if((0,n.has)(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=s.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--\x3e <"+e+">");var s=(0,n.timer)(t),o=s.time,i=s.value,a=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(r+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,i}return t()},e}()},(e,t,r)=>{"use strict";r.r(t),r.d(t,{createSyntaxDiagramsCode:()=>s});var n=r(15);function s(e,t){var r=void 0===t?{}:t,s=r.resourceBase,o=void 0===s?"https://unpkg.com/chevrotain@"+n.VERSION+"/diagrams/":s,i=r.css;return'\n\x3c!-- This is a generated file --\x3e\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===i?"https://unpkg.com/chevrotain@"+n.VERSION+"/diagrams/diagrams.css":i)+"'>\n")+("\n<script src='"+o+"vendor/railroad-diagrams.js'><\/script>\n<script src='"+o+"src/diagrams_builder.js'><\/script>\n<script src='"+o+"src/diagrams_behavior.js'><\/script>\n<script src='"+o+"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'}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{generateParserFactory:()=>s,generateParserModule:()=>o});var n=r(56);function s(e){var t=(0,n.genWrapperFunction)({name:e.name,rules:e.rules}),s=new Function("tokenVocabulary","config","chevrotain",t);return function(t){return s(e.tokenVocabulary,t,r(14))}}function o(e){return(0,n.genUmdModule)({name:e.name,rules:e.rules})}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{genAllRules:()=>u,genAlternation:()=>p,genClass:()=>l,genNonTerminal:()=>d,genRule:()=>h,genSingleAlt:()=>g,genTerminal:()=>c,genUmdModule:()=>i,genWrapperFunction:()=>a});var n=r(17),s=r(20),o="\n";function i(e){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"+l(e)+"\n \nreturn {\n "+e.name+": "+e.name+" \n}\n}));\n"}function a(e){return" \n"+l(e)+"\nreturn new "+e.name+"(tokenVocabulary, config) \n"}function l(e){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 "+u(e.rules)+"\n\n // very important to call this after all the rules have been defined.\n // otherwise the parser may not 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 u(e){return(0,n.map)(e,(function(e){return h(e,1)})).join("\n")}function h(e,t){var r=E(t,'$.RULE("'+e.name+'", function() {')+o;return r+=y(e.definition,t+1),r+=E(t+1,"})")+o}function c(e,t){var r=e.terminalType.name;return E(t,"$.CONSUME"+e.idx+"(this.tokensMap."+r+")"+o)}function d(e,t){return E(t,"$.SUBRULE"+e.idx+"($."+e.nonTerminalName+")"+o)}function p(e,t){var r=E(t,"$.OR"+e.idx+"([")+o;return r+=(0,n.map)(e.definition,(function(e){return g(e,t+1)})).join(","+o),r+=o+E(t,"])"+o)}function g(e,t){var r=E(t,"{")+o;return e.name&&(r+=E(t+1,'NAME: "'+e.name+'",')+o),r+=E(t+1,"ALT: function() {")+o,r+=y(e.definition,t+1),r+=E(t+1,"}")+o,r+=E(t,"}")}function m(e,t,r){var n=E(r,"$."+(e+t.idx)+"(");return t.name||t.separator?(n+="{"+o,t.name&&(n+=E(r+1,'NAME: "'+t.name+'"')+","+o),t.separator&&(n+=E(r+1,"SEP: this.tokensMap."+t.separator.name)+","+o),n+="DEF: "+f(t.definition,r+2)+o,n+=E(r,"}")+o):n+=f(t.definition,r+1),n+=E(r,")")+o}function f(e,t){var r="function() {"+o;return r+=y(e,t),r+=E(t,"}")+o}function y(e,t){var r="";return(0,n.forEach)(e,(function(e){r+=function(e,t){if(e instanceof s.NonTerminal)return d(e,t);if(e instanceof s.Option)return m("OPTION",e,t);if(e instanceof s.RepetitionMandatory)return m("AT_LEAST_ONE",e,t);if(e instanceof s.RepetitionMandatoryWithSeparator)return m("AT_LEAST_ONE_SEP",e,t);if(e instanceof s.RepetitionWithSeparator)return m("MANY_SEP",e,t);if(e instanceof s.Repetition)return m("MANY",e,t);if(e instanceof s.Alternation)return p(e,t);if(e instanceof s.Terminal)return c(e,t);if(e instanceof s.Flat)return y(e.definition,t);throw Error("non exhaustive match")}(e,t+1)})),r}function E(e,t){return Array(4*e+1).join(" ")+t}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AstNodeType:()=>i,ParsingErrorType:()=>o,RangeSheetReferenceType:()=>a,buildArrayAst:()=>_,buildCellErrorAst:()=>L,buildCellRangeAst:()=>d,buildCellReferenceAst:()=>c,buildColumnRangeAst:()=>p,buildConcatenateOpAst:()=>m,buildDivOpAst:()=>A,buildEmptyArgAst:()=>l,buildEqualsOpAst:()=>f,buildErrorWithRawInputAst:()=>D,buildGreaterThanOpAst:()=>E,buildGreaterThanOrEqualOpAst:()=>T,buildLessThanOpAst:()=>C,buildLessThanOrEqualOpAst:()=>R,buildMinusOpAst:()=>S,buildMinusUnaryOpAst:()=>O,buildNamedExpressionAst:()=>x,buildNotEqualOpAst:()=>y,buildNumberAst:()=>u,buildParenthesisAst:()=>P,buildParsingErrorAst:()=>F,buildPercentOpAst:()=>b,buildPlusOpAst:()=>w,buildPlusUnaryOpAst:()=>M,buildPowerOpAst:()=>N,buildProcedureAst:()=>I,buildRowRangeAst:()=>g,buildStringAst:()=>h,buildTimesOpAst:()=>v,imageWithWhitespace:()=>H,parsingError:()=>s});var n=r(3);const s=(e,t)=>({type:e,message:t});var o,i,a;!function(e){e.LexingError="LexingError",e.ParserError="ParsingError",e.StaticOffsetError="StaticOffsetError",e.StaticOffsetOutOfRangeError="StaticOffsetOutOfRangeError",e.RangeOffsetNotAllowed="RangeOffsetNotAllowed"}(o||(o={})),function(e){e.EMPTY="EMPTY",e.NUMBER="NUMBER",e.STRING="STRING",e.MINUS_UNARY_OP="MINUS_UNARY_OP",e.PLUS_UNARY_OP="PLUS_UNARY_OP",e.PERCENT_OP="PERCENT_OP",e.CONCATENATE_OP="CONCATENATE_OP",e.EQUALS_OP="EQUALS_OP",e.NOT_EQUAL_OP="NOT_EQUAL_OP",e.GREATER_THAN_OP="GREATER_THAN_OP",e.LESS_THAN_OP="LESS_THAN_OP",e.GREATER_THAN_OR_EQUAL_OP="GREATER_THAN_OR_EQUAL_OP",e.LESS_THAN_OR_EQUAL_OP="LESS_THAN_OR_EQUAL_OP",e.PLUS_OP="PLUS_OP",e.MINUS_OP="MINUS_OP",e.TIMES_OP="TIMES_OP",e.DIV_OP="DIV_OP",e.POWER_OP="POWER_OP",e.FUNCTION_CALL="FUNCTION_CALL",e.NAMED_EXPRESSION="NAMED_EXPRESSION",e.PARENTHESIS="PARENTHESES",e.CELL_REFERENCE="CELL_REFERENCE",e.CELL_RANGE="CELL_RANGE",e.COLUMN_RANGE="COLUMN_RANGE",e.ROW_RANGE="ROW_RANGE",e.ERROR="ERROR",e.ERROR_WITH_RAW_INPUT="ERROR_WITH_RAW_INPUT",e.ARRAY="ARRAY"}(i||(i={})),function(e){e[e.RELATIVE=0]="RELATIVE",e[e.START_ABSOLUTE=1]="START_ABSOLUTE",e[e.BOTH_ABSOLUTE=2]="BOTH_ABSOLUTE"}(a||(a={}));const l=e=>({type:i.EMPTY,leadingWhitespace:null==e?void 0:e.image}),u=(e,t)=>({type:i.NUMBER,value:e,leadingWhitespace:null==t?void 0:t.image}),h=e=>{var t;return{type:i.STRING,value:e.image.slice(1,-1),leadingWhitespace:null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image}},c=(e,t)=>({type:i.CELL_REFERENCE,reference:e,leadingWhitespace:null==t?void 0:t.image}),d=(e,t,r,n)=>(k(e,t,r),{type:i.CELL_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:n}),p=(e,t,r,n)=>(k(e,t,r),{type:i.COLUMN_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:null==n?void 0:n.image}),g=(e,t,r,n)=>(k(e,t,r),{type:i.ROW_RANGE,start:e,end:t,sheetReferenceType:r,leadingWhitespace:null==n?void 0:n.image}),m=(e,t,r)=>({type:i.CONCATENATE_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),f=(e,t,r)=>({type:i.EQUALS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),y=(e,t,r)=>({type:i.NOT_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),E=(e,t,r)=>({type:i.GREATER_THAN_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),C=(e,t,r)=>({type:i.LESS_THAN_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),T=(e,t,r)=>({type:i.GREATER_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),R=(e,t,r)=>({type:i.LESS_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),w=(e,t,r)=>({type:i.PLUS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),S=(e,t,r)=>({type:i.MINUS_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),v=(e,t,r)=>({type:i.TIMES_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),A=(e,t,r)=>({type:i.DIV_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),N=(e,t,r)=>({type:i.POWER_OP,left:e,right:t,leadingWhitespace:null==r?void 0:r.image}),O=(e,t)=>({type:i.MINUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),M=(e,t)=>({type:i.PLUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),b=(e,t)=>({type:i.PERCENT_OP,value:e,leadingWhitespace:null==t?void 0:t.image}),I=(e,t,r,n,s)=>({type:i.FUNCTION_CALL,procedureName:e,args:t,leadingWhitespace:null==r?void 0:r.image,internalWhitespace:null==n?void 0:n.image,hyperlink:s}),_=(e,t,r)=>({type:i.ARRAY,args:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==r?void 0:r.image}),x=(e,t)=>({type:i.NAMED_EXPRESSION,expressionName:e,leadingWhitespace:null==t?void 0:t.image}),P=(e,t,r)=>({type:i.PARENTHESIS,expression:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==r?void 0:r.image}),L=(e,t)=>({type:i.ERROR,error:e,leadingWhitespace:null==t?void 0:t.image}),D=(e,t,r)=>({type:i.ERROR_WITH_RAW_INPUT,error:t,rawInput:e,leadingWhitespace:null==r?void 0:r.image}),F=()=>({type:i.ERROR,error:n.CellError.parsingError()});function k(e,t,r){if(void 0!==e.sheet&&void 0===t.sheet||void 0===e.sheet&&void 0!==t.sheet)throw new Error("Start address inconsistent with end address");if(void 0===e.sheet&&r!==a.RELATIVE||void 0!==e.sheet&&r===a.RELATIVE)throw new Error("Sheet address inconsistent with sheet reference type")}function H(e,t){return(null!=t?t:"")+e}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{binaryOpTokenMap:()=>s});var n=r(57);const s={[n.AstNodeType.PLUS_OP]:"+",[n.AstNodeType.MINUS_OP]:"-",[n.AstNodeType.TIMES_OP]:"*",[n.AstNodeType.DIV_OP]:"/",[n.AstNodeType.CONCATENATE_OP]:"&",[n.AstNodeType.POWER_OP]:"^",[n.AstNodeType.EQUALS_OP]:"=",[n.AstNodeType.NOT_EQUAL_OP]:"<>",[n.AstNodeType.GREATER_THAN_OP]:">",[n.AstNodeType.GREATER_THAN_OR_EQUAL_OP]:">=",[n.AstNodeType.LESS_THAN_OP]:"<",[n.AstNodeType.LESS_THAN_OR_EQUAL_OP]:"<="}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Cache:()=>s,doesContainFunctions:()=>o});var n=r(7);class s{constructor(e){this.functionRegistry=e,this.cache=new Map}set(e,t){const r=((e,t,r,n)=>({ast:e,relativeDependencies:t,hasVolatileFunction:r,hasStructuralChangeFunction:n}))(t,(0,n.collectDependencies)(t,this.functionRegistry),o(t,this.functionRegistry.isFunctionVolatile),o(t,this.functionRegistry.isFunctionDependentOnSheetStructureChange));return this.cache.set(e,r),r}get(e){return this.cache.get(e)}maybeSetAndThenGet(e,t){const r=this.cache.get(e);return void 0!==r?r.ast:(this.set(e,t),t)}}const o=(e,t)=>{switch(e.type){case n.AstNodeType.EMPTY:case n.AstNodeType.NUMBER:case n.AstNodeType.STRING:case n.AstNodeType.ERROR:case n.AstNodeType.ERROR_WITH_RAW_INPUT:case n.AstNodeType.CELL_REFERENCE:case n.AstNodeType.CELL_RANGE:case n.AstNodeType.COLUMN_RANGE:case n.AstNodeType.ROW_RANGE:case n.AstNodeType.NAMED_EXPRESSION:return!1;case n.AstNodeType.PERCENT_OP:case n.AstNodeType.PLUS_UNARY_OP:case n.AstNodeType.MINUS_UNARY_OP:return o(e.value,t);case n.AstNodeType.CONCATENATE_OP:case n.AstNodeType.EQUALS_OP:case n.AstNodeType.NOT_EQUAL_OP:case n.AstNodeType.LESS_THAN_OP:case n.AstNodeType.GREATER_THAN_OP:case n.AstNodeType.LESS_THAN_OR_EQUAL_OP:case n.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case n.AstNodeType.MINUS_OP:case n.AstNodeType.PLUS_OP:case n.AstNodeType.TIMES_OP:case n.AstNodeType.DIV_OP:case n.AstNodeType.POWER_OP:return o(e.left,t)||o(e.right,t);case n.AstNodeType.PARENTHESIS:return o(e.expression,t);case n.AstNodeType.FUNCTION_CALL:return!!t(e.procedureName)||e.args.some((e=>o(e,t)));case n.AstNodeType.ARRAY:return e.args.some((e=>e.some((e=>o(e,t)))))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FormulaLexer:()=>c,FormulaParser:()=>h});var n=r(14),s=r(3),o=r(61),i=r(8),a=r(57),l=r(9),u=r(62);class h extends n.EmbeddedActionsParser{constructor(e,t){super(e.allTokens,{outputCst:!1,maxLookahead:7}),this.booleanExpressionOrEmpty=this.RULE("booleanExpressionOrEmpty",(()=>this.OR([{ALT:()=>this.SUBRULE(this.booleanExpression)},{ALT:(0,n.EMPTY_ALT)((0,a.buildEmptyArgAst)())}]))),this.procedureExpression=this.RULE("procedureExpression",(()=>{var e;const t=this.CONSUME(u.ProcedureName),r=t.image.toUpperCase().slice(0,-1),n=null!==(e=this.lexerConfig.functionMapping[r])&&void 0!==e?e:r,s=[];let o=this.SUBRULE(this.booleanExpressionOrEmpty);this.MANY((()=>{var e;const t=this.CONSUME(this.lexerConfig.ArgSeparator);o.type===a.AstNodeType.EMPTY&&(o.leadingWhitespace=null===(e=t.leadingWhitespace)||void 0===e?void 0:e.image),s.push(o),o=this.SUBRULE2(this.booleanExpressionOrEmpty)})),s.push(o),1===s.length&&s[0].type===a.AstNodeType.EMPTY&&(s.length=0);const i=this.CONSUME(u.RParen);return(0,a.buildProcedureAst)(n,s,t.leadingWhitespace,i.leadingWhitespace)})),this.namedExpressionExpression=this.RULE("namedExpressionExpression",(()=>{const e=this.CONSUME(u.NamedExpression);return(0,a.buildNamedExpressionAst)(e.image,e.leadingWhitespace)})),this.offsetProcedureExpression=this.RULE("offsetProcedureExpression",(()=>{const e=[];return this.CONSUME(this.lexerConfig.OffsetProcedureName),this.CONSUME(u.LParen),this.MANY_SEP({SEP:this.lexerConfig.ArgSeparator,DEF:()=>{e.push(this.SUBRULE(this.booleanExpression))}}),this.CONSUME(u.RParen),this.handleOffsetHeuristic(e)})),this.columnRangeExpression=this.RULE("columnRangeExpression",(()=>{const e=this.CONSUME(u.ColumnRange),[t,r]=e.image.split(":"),n=this.ACTION((()=>(0,i.columnAddressFromString)(this.sheetMapping,t,this.formulaAddress))),o=this.ACTION((()=>(0,i.columnAddressFromString)(this.sheetMapping,r,this.formulaAddress)));if(void 0===n||void 0===o)return(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF));if(n.exceedsSheetSizeLimits(this.lexerConfig.maxColumns)||o.exceedsSheetSizeLimits(this.lexerConfig.maxColumns))return(0,a.buildErrorWithRawInputAst)(e.image,new s.CellError(s.ErrorType.NAME),e.leadingWhitespace);if(void 0===n.sheet&&void 0!==o.sheet)return this.parsingError(a.ParsingErrorType.ParserError,"Malformed range expression");const{firstEnd:l,secondEnd:c,sheetRefType:d}=h.fixSheetIdsForRangeEnds(n,o);return(0,a.buildColumnRangeAst)(l,c,d,e.leadingWhitespace)})),this.rowRangeExpression=this.RULE("rowRangeExpression",(()=>{const e=this.CONSUME(u.RowRange),[t,r]=e.image.split(":"),n=this.ACTION((()=>(0,i.rowAddressFromString)(this.sheetMapping,t,this.formulaAddress))),o=this.ACTION((()=>(0,i.rowAddressFromString)(this.sheetMapping,r,this.formulaAddress)));if(void 0===n||void 0===o)return(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF));if(n.exceedsSheetSizeLimits(this.lexerConfig.maxRows)||o.exceedsSheetSizeLimits(this.lexerConfig.maxRows))return(0,a.buildErrorWithRawInputAst)(e.image,new s.CellError(s.ErrorType.NAME),e.leadingWhitespace);if(void 0===n.sheet&&void 0!==o.sheet)return this.parsingError(a.ParsingErrorType.ParserError,"Malformed range expression");const{firstEnd:l,secondEnd:c,sheetRefType:d}=h.fixSheetIdsForRangeEnds(n,o);return(0,a.buildRowRangeAst)(l,c,d,e.leadingWhitespace)})),this.cellReference=this.RULE("cellReference",(()=>{const e=this.CONSUME(u.CellReference),t=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress)));return void 0===t?(0,a.buildErrorWithRawInputAst)(e.image,new s.CellError(s.ErrorType.REF),e.leadingWhitespace):t.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?(0,a.buildErrorWithRawInputAst)(e.image,new s.CellError(s.ErrorType.NAME),e.leadingWhitespace):(0,a.buildCellReferenceAst)(t,e.leadingWhitespace)})),this.endRangeReference=this.RULE("endRangeReference",(e=>{var t;const r=this.CONSUME(u.CellReference),n=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress))),o=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,r.image,this.formulaAddress)));return void 0===n||void 0===o?this.ACTION((()=>(0,a.buildErrorWithRawInputAst)(`${e.image}:${r.image}`,new s.CellError(s.ErrorType.REF),e.leadingWhitespace))):n.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)||o.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?this.ACTION((()=>(0,a.buildErrorWithRawInputAst)(`${e.image}:${r.image}`,new s.CellError(s.ErrorType.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;const r=this.SUBRULE(this.offsetProcedureExpression),n=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,e.image,this.formulaAddress)));return void 0===n?(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF)):r.type===a.AstNodeType.CELL_REFERENCE?this.buildCellRange(n,r.reference,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image):this.parsingError(a.ParsingErrorType.RangeOffsetNotAllowed,"Range offset not allowed here")}}]))),this.cellRangeExpression=this.RULE("cellRangeExpression",(()=>{const e=this.CONSUME(u.CellReference);return this.CONSUME2(u.RangeSeparator),this.SUBRULE(this.endOfRangeExpression,{ARGS:[e]})})),this.endRangeWithOffsetStartReference=this.RULE("endRangeWithOffsetStartReference",(e=>{const t=this.CONSUME(u.CellReference),r=this.ACTION((()=>(0,i.cellAddressFromString)(this.sheetMapping,t.image,this.formulaAddress)));return void 0===r?this.ACTION((()=>(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF)))):this.buildCellRange(e.reference,r,e.leadingWhitespace)})),this.endOfRangeWithOffsetStartExpression=this.RULE("endOfRangeWithOffsetStartExpression",(e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeWithOffsetStartReference,{ARGS:[e]})},{ALT:()=>{const t=this.SUBRULE(this.offsetProcedureExpression);return t.type===a.AstNodeType.CELL_REFERENCE?this.buildCellRange(e.reference,t.reference,e.leadingWhitespace):this.parsingError(a.ParsingErrorType.RangeOffsetNotAllowed,"Range offset not allowed here")}}]))),this.offsetExpression=this.RULE("offsetExpression",(()=>{const e=this.SUBRULE(this.offsetProcedureExpression);let t;return this.OPTION((()=>{this.CONSUME(u.RangeSeparator),t=e.type===a.AstNodeType.CELL_RANGE?this.parsingError(a.ParsingErrorType.RangeOffsetNotAllowed,"Range offset not allowed here"):this.SUBRULE(this.endOfRangeWithOffsetStartExpression,{ARGS:[e]})})),void 0!==t?t:e})),this.insideArrayExpression=this.RULE("insideArrayExpression",(()=>{const 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.buildArrayAst)(e)})),this.parenthesisExpression=this.RULE("parenthesisExpression",(()=>{const e=this.CONSUME(u.LParen),t=this.SUBRULE(this.booleanExpression),r=this.CONSUME(u.RParen);return(0,a.buildParenthesisAst)(t,e.leadingWhitespace,r.leadingWhitespace)})),this.arrayExpression=this.RULE("arrayExpression",(()=>this.OR([{ALT:()=>{const e=this.CONSUME(u.ArrayLParen),t=this.SUBRULE(this.insideArrayExpression),r=this.CONSUME(u.ArrayRParen);return(0,a.buildArrayAst)(t.args,e.leadingWhitespace,r.leadingWhitespace)}},{ALT:()=>this.SUBRULE(this.parenthesisExpression)}]))),this.numericStringToNumber=e=>{const t=e.replace(this.lexerConfig.decimalSeparator,".");return Number(t)},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:()=>{const e=this.CONSUME(this.lexerConfig.NumberLiteral);return(0,a.buildNumberAst)(this.numericStringToNumber(e.image),e.leadingWhitespace)}},{ALT:()=>{const e=this.CONSUME(u.StringLiteral);return(0,a.buildStringAst)(e)}},{ALT:()=>{const e=this.CONSUME(u.ErrorLiteral),t=e.image.toUpperCase(),r=this.lexerConfig.errorMapping[t];return r?(0,a.buildCellErrorAst)(new s.CellError(r),e.leadingWhitespace):this.parsingError(a.ParsingErrorType.ParserError,"Unknown error literal")}}])})),this.rightUnaryOpAtomicExpression=this.RULE("rightUnaryOpAtomicExpression",(()=>{const e=this.SUBRULE(this.positiveAtomicExpression),t=this.OPTION((()=>this.CONSUME(u.PercentOp)));return t?(0,a.buildPercentOpAst)(e,t.leadingWhitespace):e})),this.atomicExpression=this.RULE("atomicExpression",(()=>this.OR([{ALT:()=>{const e=this.CONSUME(u.AdditionOp),t=this.SUBRULE(this.atomicExpression);return(0,n.tokenMatcher)(e,u.PlusOp)?(0,a.buildPlusUnaryOpAst)(t,e.leadingWhitespace):(0,n.tokenMatcher)(e,u.MinusOp)?(0,a.buildMinusUnaryOpAst)(t,e.leadingWhitespace):(this.customParsingError=(0,a.parsingError)(a.ParsingErrorType.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((()=>{const t=this.CONSUME(u.PowerOp),r=this.SUBRULE2(this.atomicExpression);(0,n.tokenMatcher)(t,u.PowerOp)?e=(0,a.buildPowerOpAst)(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((()=>{const t=this.CONSUME(u.MultiplicationOp),r=this.SUBRULE2(this.powerExpression);(0,n.tokenMatcher)(t,u.TimesOp)?e=(0,a.buildTimesOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.DivOp)?e=(0,a.buildDivOpAst)(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((()=>{const t=this.CONSUME(u.AdditionOp),r=this.SUBRULE2(this.multiplicationExpression);(0,n.tokenMatcher)(t,u.PlusOp)?e=(0,a.buildPlusOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.MinusOp)?e=(0,a.buildMinusOpAst)(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((()=>{const t=this.CONSUME(u.ConcatenateOp),r=this.SUBRULE2(this.additionExpression);e=(0,a.buildConcatenateOpAst)(e,r,t.leadingWhitespace)})),e})),this.booleanExpression=this.RULE("booleanExpression",(()=>{let e=this.SUBRULE(this.concatenateExpression);return this.MANY((()=>{const t=this.CONSUME(u.BooleanOp),r=this.SUBRULE2(this.concatenateExpression);(0,n.tokenMatcher)(t,u.EqualsOp)?e=(0,a.buildEqualsOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.NotEqualOp)?e=(0,a.buildNotEqualOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.GreaterThanOp)?e=(0,a.buildGreaterThanOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.LessThanOp)?e=(0,a.buildLessThanOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.GreaterThanOrEqualOp)?e=(0,a.buildGreaterThanOrEqualOpAst)(e,r,t.leadingWhitespace):(0,n.tokenMatcher)(t,u.LessThanOrEqualOp)?e=(0,a.buildLessThanOrEqualOpAst)(e,r,t.leadingWhitespace):this.ACTION((()=>{throw Error("Operator not supported")}))})),e})),this.formula=this.RULE("formula",(()=>(this.CONSUME(u.EqualsOp),this.SUBRULE(this.booleanExpression)))),this.lexerConfig=e,this.sheetMapping=t,this.formulaAddress=(0,s.simpleCellAddress)(0,0,0),this.performSelfAnalysis()}parseFromTokens(e,t){this.input=e;let r=this.formulaWithContext(t),n=[];return this.customParsingError&&n.push(this.customParsingError),n=n.concat(this.errors.map((e=>({type:a.ParsingErrorType.ParserError,message:e.message})))),n.length>0&&(r=(0,a.buildParsingErrorAst)()),{ast:r,errors:n}}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.ParsingErrorType.ParserError,"Malformed range expression");const{firstEnd:n,secondEnd:s,sheetRefType:o}=h.fixSheetIdsForRangeEnds(e,t);return(0,a.buildCellRangeAst)(n,s,o,r)}static fixSheetIdsForRangeEnds(e,t){const r=h.rangeSheetReferenceType(e.sheet,t.sheet);return{firstEnd:e,secondEnd:void 0!==e.sheet&&void 0===t.sheet?t.withSheet(e.sheet):t,sheetRefType:r}}handleOffsetHeuristic(e){const t=e[0];if(t.type!==a.AstNodeType.CELL_REFERENCE)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"First argument to OFFSET is not a reference");const r=e[1];let n;if(r.type===a.AstNodeType.NUMBER&&Number.isInteger(r.value))n=r.value;else if(r.type===a.AstNodeType.PLUS_UNARY_OP&&r.value.type===a.AstNodeType.NUMBER&&Number.isInteger(r.value.value))n=r.value.value;else{if(r.type!==a.AstNodeType.MINUS_UNARY_OP||r.value.type!==a.AstNodeType.NUMBER||!Number.isInteger(r.value.value))return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Second argument to OFFSET is not a static number");n=-r.value.value}const i=e[2];let u;if(i.type===a.AstNodeType.NUMBER&&Number.isInteger(i.value))u=i.value;else if(i.type===a.AstNodeType.PLUS_UNARY_OP&&i.value.type===a.AstNodeType.NUMBER&&Number.isInteger(i.value.value))u=i.value.value;else{if(i.type!==a.AstNodeType.MINUS_UNARY_OP||i.value.type!==a.AstNodeType.NUMBER||!Number.isInteger(i.value.value))return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Third argument to OFFSET is not a static number");u=-i.value.value}const h=e[3];let c;if(void 0===h)c=1;else{if(h.type!==a.AstNodeType.NUMBER)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fourth argument to OFFSET is not a static number");if(c=h.value,c<1)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fourth argument to OFFSET is too small number");if(!Number.isInteger(c))return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fourth argument to OFFSET is not integer")}const d=e[4];let p;if(void 0===d)p=1;else{if(d.type!==a.AstNodeType.NUMBER)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fifth argument to OFFSET is not a static number");if(p=d.value,p<1)return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fifth argument to OFFSET is too small number");if(!Number.isInteger(p))return this.parsingError(a.ParsingErrorType.StaticOffsetError,"Fifth argument to OFFSET is not integer")}const g=new l.CellAddress(t.reference.col+u,t.reference.row+n,t.reference.type);let m=g.col,f=g.row;if(t.reference.type!==l.CellReferenceType.CELL_REFERENCE_RELATIVE&&t.reference.type!==l.CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL||(f+=this.formulaAddress.row),t.reference.type!==l.CellReferenceType.CELL_REFERENCE_RELATIVE&&t.reference.type!==l.CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW||(m+=this.formulaAddress.col),m<0||f<0)return(0,a.buildCellErrorAst)(new s.CellError(s.ErrorType.REF,o.ErrorMessage.OutOfSheet));if(1===p&&1===c)return(0,a.buildCellReferenceAst)(g);{const e=new l.CellAddress(g.col+p-1,g.row+c-1,g.type);return(0,a.buildCellRangeAst)(g,e,a.RangeSheetReferenceType.RELATIVE)}}parsingError(e,t){return this.customParsingError=(0,a.parsingError)(e,t),(0,a.buildParsingErrorAst)()}static rangeSheetReferenceType(e,t){return void 0===e?a.RangeSheetReferenceType.RELATIVE:void 0===t?a.RangeSheetReferenceType.START_ABSOLUTE:a.RangeSheetReferenceType.BOTH_ABSOLUTE}}class c{constructor(e){this.lexerConfig=e,this.lexer=new n.Lexer(e.allTokens,{ensureOptimizations:!0})}tokenizeFormula(e){const t=this.lexer.tokenize(e);let r=t.tokens;return r=this.trimTrailingWhitespaces(r),r=this.skipWhitespacesInsideRanges(r),r=this.skipWhitespacesBeforeArgSeparators(r),t.tokens=r,t}skipWhitespacesInsideRanges(e){return c.filterTokensByNeighbors(e,((e,t,r)=>((0,n.tokenMatcher)(e,u.CellReference)||(0,n.tokenMatcher)(e,u.RangeSeparator))&&(0,n.tokenMatcher)(t,this.lexerConfig.WhiteSpace)&&((0,n.tokenMatcher)(r,u.CellReference)||(0,n.tokenMatcher)(r,u.RangeSeparator))))}skipWhitespacesBeforeArgSeparators(e){return c.filterTokensByNeighbors(e,((e,t,r)=>!(0,n.tokenMatcher)(e,this.lexerConfig.ArgSeparator)&&(0,n.tokenMatcher)(t,this.lexerConfig.WhiteSpace)&&(0,n.tokenMatcher)(r,this.lexerConfig.ArgSeparator)))}static filterTokensByNeighbors(e,t){if(e.length<3)return e;let r=0;const n=[e[r++]];for(;r<e.length-1;)t(e[r-1],e[r],e[r+1])||n.push(e[r]),++r;return n.push(e[r]),n}trimTrailingWhitespaces(e){return e.length>0&&(0,n.tokenMatcher)(e[e.length-1],this.lexerConfig.WhiteSpace)&&e.pop(),e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorMessage:()=>n});class n{}n.DistinctSigns="Distinct signs.",n.WrongArgNumber="Wrong number of arguments.",n.EmptyArg="Empty function argument.",n.EmptyArray="Empty array not allowed.",n.ArrayDimensions="Array dimensions are not compatible.",n.NoSpaceForArrayResult="No space for array result.",n.ValueSmall="Value too small.",n.ValueLarge="Value too large.",n.BadCriterion="Incorrect criterion.",n.RangeManySheets="Range spans more than one sheet.",n.CellRangeExpected="Cell range expected.",n.WrongDimension="Wrong range dimension.",n.ScalarExpected="Cell range not allowed.",n.NumberCoercion="Value cannot be coerced to number.",n.NumberExpected="Number argument expected.",n.IntegerExpected="Value needs to be an integer.",n.BadMode="Mode not recognized.",n.DateBounds="Date outside of bounds.",n.OutOfSheet="Resulting reference is out of the sheet.",n.WrongType="Wrong type of argument.",n.NaN="NaN or infinite value encountered.",n.EqualLength="Ranges need to be of equal length.",n.Negative="Value cannot be negative.",n.NotBinary="String does not represent a binary number.",n.NotOctal="String does not represent an octal number.",n.NotHex="String does not represent a hexadecimal number.",n.EndStartPeriod="End period needs to be at least start period.",n.CellRefExpected="Cell reference expected.",n.EmptyRange="Empty range not allowed.",n.BadRef="Address is not correct.",n.NumberRange="Number-only range expected.",n.ValueNotFound="Value not found.",n.ValueBaseLarge="Value in base too large.",n.ValueBaseSmall="Value in base too small.",n.ValueBaseLong="Value in base too long.",n.NegativeLength="Length cannot be negative.",n.PatternNotFound="Pattern not found.",n.OneValue="Needs at least one value.",n.TwoValues="Range needs to contain at least two elements.",n.ThreeValues="Range needs to contain at least three elements.",n.IndexBounds="Index out of bounds.",n.IndexLarge="Index too large.",n.Formula="Expected formula.",n.NegativeCount="Count cannot be negative.",n.ParseError="Parsing error.",n.SheetRef="Sheet does not exist.",n.PeriodLong="Period number cannot exceed life length.",n.InvalidDate="Invalid date.",n.BitshiftLong="Result of bitshift is too long.",n.EmptyString="Empty-string argument not allowed.",n.LengthBounds="Length out of bounds.",n.NegativeTime="Time cannot be negative.",n.NoDefault="No default option.",n.NoConditionMet="None of the conditions were met.",n.Selector="Selector cannot exceed the number of arguments.",n.StartEndDate="Start date needs to be earlier than end date.",n.IncorrectDateTime="String does not represent correct DateTime.",n.CharacterCodeBounds="Character code out of bounds.",n.NonZero="Argument cannot be 0.",n.LessThanOne="Argument cannot be less than 1.",n.WeekendString="Incorrect weekend bitmask string.",n.InvalidRoman="Invalid roman numeral.",n.WrongOrder="Wrong order of values.",n.ComplexNumberExpected="Complex number expected.",n.ShouldBeIorJ="Should be 'i' or 'j'.",n.SizeMismatch="Array dimensions mismatched.",n.FunctionName=e=>`Function name ${e} not recognized.`,n.NamedExpressionName=e=>`Named expression ${e} not recognized.`,n.LicenseKey=e=>`License key is ${e}.`},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AdditionOp:()=>a,ArrayLParen:()=>A,ArrayRParen:()=>N,BooleanOp:()=>m,CellReference:()=>L,ColumnRange:()=>I,ConcatenateOp:()=>w,DivOp:()=>d,EqualsOp:()=>f,ErrorLiteral:()=>M,GreaterThanOp:()=>E,GreaterThanOrEqualOp:()=>T,LParen:()=>S,LessThanOp:()=>C,LessThanOrEqualOp:()=>R,MinusOp:()=>u,MultiplicationOp:()=>h,NamedExpression:()=>F,NotEqualOp:()=>y,PercentOp:()=>g,PlusOp:()=>l,PowerOp:()=>p,ProcedureName:()=>x,RParen:()=>v,RangeSeparator:()=>b,RowRange:()=>_,StringLiteral:()=>O,TimesOp:()=>c,buildLexerConfig:()=>k});var n=r(14),s=r(12),o=r(63),i=r(64);const a=(0,n.createToken)({name:"AdditionOp",pattern:n.Lexer.NA}),l=(0,n.createToken)({name:"PlusOp",pattern:/\+/,categories:a}),u=(0,n.createToken)({name:"MinusOp",pattern:/-/,categories:a}),h=(0,n.createToken)({name:"MultiplicationOp",pattern:n.Lexer.NA}),c=(0,n.createToken)({name:"TimesOp",pattern:/\*/,categories:h}),d=(0,n.createToken)({name:"DivOp",pattern:/\//,categories:h}),p=(0,n.createToken)({name:"PowerOp",pattern:/\^/}),g=(0,n.createToken)({name:"PercentOp",pattern:/%/}),m=(0,n.createToken)({name:"BooleanOp",pattern:n.Lexer.NA}),f=(0,n.createToken)({name:"EqualsOp",pattern:/=/,categories:m}),y=(0,n.createToken)({name:"NotEqualOp",pattern:/<>/,categories:m}),E=(0,n.createToken)({name:"GreaterThanOp",pattern:/>/,categories:m}),C=(0,n.createToken)({name:"LessThanOp",pattern:/</,categories:m}),T=(0,n.createToken)({name:"GreaterThanOrEqualOp",pattern:/>=/,categories:m}),R=(0,n.createToken)({name:"LessThanOrEqualOp",pattern:/<=/,categories:m}),w=(0,n.createToken)({name:"ConcatenateOp",pattern:/&/}),S=(0,n.createToken)({name:"LParen",pattern:/\(/}),v=(0,n.createToken)({name:"RParen",pattern:/\)/}),A=(0,n.createToken)({name:"ArrayLParen",pattern:/{/}),N=(0,n.createToken)({name:"ArrayRParen",pattern:/}/}),O=(0,n.createToken)({name:"StringLiteral",pattern:/"([^"\\]*(\\.[^"\\]*)*)"/}),M=(0,n.createToken)({name:"ErrorLiteral",pattern:/#[A-Za-z0-9\/]+[?!]?/}),b=(0,n.createToken)({name:"RangeSeparator",pattern:new RegExp(s.RANGE_OPERATOR)}),I=(0,n.createToken)({name:"ColumnRange",pattern:new RegExp(`${s.COLUMN_REFERENCE_PATTERN}${s.RANGE_OPERATOR}${s.COLUMN_REFERENCE_PATTERN}`)}),_=(0,n.createToken)({name:"RowRange",pattern:new RegExp(`${s.ROW_REFERENCE_PATTERN}${s.RANGE_OPERATOR}${s.ROW_REFERENCE_PATTERN}`)}),x=(0,n.createToken)({name:"ProcedureName",pattern:new RegExp(`([${s.UNICODE_LETTER_PATTERN}][${s.NON_RESERVED_CHARACTER_PATTERN}]*)\\(`)}),P=new o.CellReferenceMatcher,L=(0,n.createToken)({name:"CellReference",pattern:P.match.bind(P),start_chars_hint:P.POSSIBLE_START_CHARACTERS,line_breaks:!1}),D=new i.NamedExpressionMatcher,F=(0,n.createToken)({name:"NamedExpression",pattern:D.match.bind(D),start_chars_hint:D.POSSIBLE_START_CHARACTERS,line_breaks:!1}),k=e=>{const t=e.translationPackage.getFunctionTranslation("OFFSET"),r=e.errorMapping,o=e.translationPackage.buildFunctionMapping(),i=new RegExp("standard"===e.ignoreWhiteSpace?s.ODFF_WHITESPACE_PATTERN:s.ALL_WHITESPACE_PATTERN),P=(0,n.createToken)({name:"WhiteSpace",pattern:i}),D=(0,n.createToken)({name:"ArrayRowSep",pattern:e.arrayRowSeparator}),k=(0,n.createToken)({name:"ArrayColSep",pattern:e.arrayColumnSeparator}),H=(0,n.createToken)({name:"NumberLiteral",pattern:new RegExp(`(([${e.decimalSeparator}]\\d+)|(\\d+([${e.decimalSeparator}]\\d*)?))(e[+-]?\\d+)?`)}),U=(0,n.createToken)({name:"OffsetProcedureName",pattern:new RegExp(t,"i")});let V,B;e.functionArgSeparator===e.arrayColumnSeparator?(V=k,B=[]):e.functionArgSeparator===e.arrayRowSeparator?(V=D,B=[]):(V=(0,n.createToken)({name:"ArgSeparator",pattern:e.functionArgSeparator}),B=[V]);return{ArgSeparator:V,NumberLiteral:H,OffsetProcedureName:U,ArrayRowSeparator:D,ArrayColSeparator:k,WhiteSpace:P,allTokens:[P,l,u,c,d,p,f,y,g,T,R,E,C,S,v,A,N,U,x,b,...B,I,_,H,O,M,w,m,a,h,L,F,D,k],errorMapping:r,functionMapping:o,decimalSeparator:e.decimalSeparator,maxColumns:e.maxColumns,maxRows:e.maxRows}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CellReferenceMatcher:()=>s});var n=r(12);class s{constructor(){this.POSSIBLE_START_CHARACTERS=[...n.ALL_UNICODE_LETTERS_ARRAY,...n.ALL_DIGITS_ARRAY,n.ABSOLUTE_OPERATOR,"'","_"],this.cellReferenceRegexp=new RegExp(n.CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN,"y")}match(e,t){this.cellReferenceRegexp.lastIndex=t;const r=this.cellReferenceRegexp.exec(e+"@");return null==r||null==r[1]?null:(r[0]=r[1],r)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{NamedExpressionMatcher:()=>s});var n=r(12);class s{constructor(){this.POSSIBLE_START_CHARACTERS=[...n.ALL_UNICODE_LETTERS_ARRAY,"_"],this.namedExpressionRegexp=new RegExp(n.NAMED_EXPRESSION_PATTERN,"y"),this.r1c1CellRefRegexp=new RegExp(`^${n.R1C1_CELL_REFERENCE_PATTERN}$`)}match(e,t){this.namedExpressionRegexp.lastIndex=t;const r=this.namedExpressionRegexp.exec(e);return null==r||null==r[0]||this.r1c1CellRefRegexp.test(r[0])?null:r}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Unparser:()=>l,formatNumber:()=>u});var n=r(3),s=r(0),o=r(8),i=r(57),a=r(58);class l{constructor(e,t,r,n){this.config=e,this.lexerConfig=t,this.sheetMappingFn=r,this.namedExpressions=n}unparse(e,t){return"="+this.unparseAst(e,t)}unparseAst(e,t){var r,s;switch(e.type){case i.AstNodeType.EMPTY:return(0,i.imageWithWhitespace)("",e.leadingWhitespace);case i.AstNodeType.NUMBER:return(0,i.imageWithWhitespace)(u(e.value,this.config.decimalSeparator),e.leadingWhitespace);case i.AstNodeType.STRING:return(0,i.imageWithWhitespace)('"'+e.value+'"',e.leadingWhitespace);case i.AstNodeType.FUNCTION_CALL:{const r=e.args.map((e=>void 0!==e?this.unparseAst(e,t):"")).join(this.config.functionArgSeparator),n=(this.config.translationPackage.isFunctionTranslated(e.procedureName)?this.config.translationPackage.getFunctionTranslation(e.procedureName):e.procedureName)+"("+r+(0,i.imageWithWhitespace)(")",e.internalWhitespace);return(0,i.imageWithWhitespace)(n,e.leadingWhitespace)}case i.AstNodeType.NAMED_EXPRESSION:{const n=null===(r=this.namedExpressions.nearestNamedExpression(e.expressionName,t.sheet))||void 0===r?void 0:r.displayName;return(0,i.imageWithWhitespace)(n||e.expressionName,e.leadingWhitespace)}case i.AstNodeType.CELL_REFERENCE:{let r;return r=void 0!==e.reference.sheet?this.unparseSheetName(e.reference.sheet)+"!":"",r+=null!==(s=e.reference.unparse(t))&&void 0!==s?s:this.config.translationPackage.getErrorTranslation(n.ErrorType.REF),(0,i.imageWithWhitespace)(r,e.leadingWhitespace)}case i.AstNodeType.COLUMN_RANGE:case i.AstNodeType.ROW_RANGE:case i.AstNodeType.CELL_RANGE:return(0,i.imageWithWhitespace)(this.formatRange(e,t),e.leadingWhitespace);case i.AstNodeType.PLUS_UNARY_OP:{const r=this.unparseAst(e.value,t);return(0,i.imageWithWhitespace)("+",e.leadingWhitespace)+r}case i.AstNodeType.MINUS_UNARY_OP:{const r=this.unparseAst(e.value,t);return(0,i.imageWithWhitespace)("-",e.leadingWhitespace)+r}case i.AstNodeType.PERCENT_OP:return this.unparseAst(e.value,t)+(0,i.imageWithWhitespace)("%",e.leadingWhitespace);case i.AstNodeType.ERROR:{const t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:n.ErrorType.ERROR);return(0,i.imageWithWhitespace)(t,e.leadingWhitespace)}case i.AstNodeType.ERROR_WITH_RAW_INPUT:return(0,i.imageWithWhitespace)(e.rawInput,e.leadingWhitespace);case i.AstNodeType.PARENTHESIS:{const r="("+this.unparseAst(e.expression,t)+(0,i.imageWithWhitespace)(")",e.internalWhitespace);return(0,i.imageWithWhitespace)(r,e.leadingWhitespace)}case i.AstNodeType.ARRAY:{const r="{"+e.args.map((e=>e.map((e=>this.unparseAst(e,t))).join(this.config.arrayColumnSeparator))).join(this.config.arrayRowSeparator)+(0,i.imageWithWhitespace)("}",e.internalWhitespace);return(0,i.imageWithWhitespace)(r,e.leadingWhitespace)}default:{const r=this.unparseAst(e.left,t),n=this.unparseAst(e.right,t);return r+(0,i.imageWithWhitespace)(a.binaryOpTokenMap[e.type],e.leadingWhitespace)+n}}}unparseSheetName(e){const t=(0,o.sheetIndexToString)(e,this.sheetMappingFn);if(void 0===t)throw new s.NoSheetWithIdError(e);return t}formatRange(e,t){let r="",s="";void 0!==e.start.sheet&&e.sheetReferenceType!==i.RangeSheetReferenceType.RELATIVE&&(r=this.unparseSheetName(e.start.sheet)+"!"),void 0!==e.end.sheet&&e.sheetReferenceType===i.RangeSheetReferenceType.BOTH_ABSOLUTE&&(s=this.unparseSheetName(e.end.sheet)+"!");const o=e.start.unparse(t),a=e.end.unparse(t);return void 0===o||void 0===a?this.config.translationPackage.getErrorTranslation(n.ErrorType.REF):`${r}${o}:${s}${a}`}}function u(e,t){return e.toString().replace(".",t)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{collectDependencies:()=>o});var n=r(7);const s=(e,t,r,o)=>{switch(e.type){case n.AstNodeType.EMPTY:case n.AstNodeType.NUMBER:case n.AstNodeType.STRING:case n.AstNodeType.ERROR:return;case n.AstNodeType.NAMED_EXPRESSION:return void(o&&r.push(new n.NamedExpressionDependency(e.expressionName)));case n.AstNodeType.CELL_REFERENCE:return void(o&&r.push(new n.AddressDependency(e.reference)));case n.AstNodeType.CELL_RANGE:return void(o&&e.start.sheet===e.end.sheet&&r.push(new n.CellRangeDependency(e.start,e.end)));case n.AstNodeType.COLUMN_RANGE:return void(o&&e.start.sheet===e.end.sheet&&r.push(new n.ColumnRangeDependency(e.start,e.end)));case n.AstNodeType.ROW_RANGE:return void(o&&e.start.sheet===e.end.sheet&&r.push(new n.RowRangeDependency(e.start,e.end)));case n.AstNodeType.PERCENT_OP:case n.AstNodeType.PLUS_UNARY_OP:case n.AstNodeType.MINUS_UNARY_OP:return void s(e.value,t,r,!0);case n.AstNodeType.CONCATENATE_OP:case n.AstNodeType.EQUALS_OP:case n.AstNodeType.NOT_EQUAL_OP:case n.AstNodeType.LESS_THAN_OP:case n.AstNodeType.GREATER_THAN_OP:case n.AstNodeType.LESS_THAN_OR_EQUAL_OP:case n.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case n.AstNodeType.MINUS_OP:case n.AstNodeType.PLUS_OP:case n.AstNodeType.TIMES_OP:case n.AstNodeType.DIV_OP:case n.AstNodeType.POWER_OP:return s(e.left,t,r,!0),void s(e.right,t,r,!0);case n.AstNodeType.PARENTHESIS:return void s(e.expression,t,r,o);case n.AstNodeType.FUNCTION_CALL:{const n=!t.doesFunctionNeedArgumentToBeComputed(e.procedureName);return void e.args.forEach((e=>s(e,t,r,n)))}}},o=(e,t)=>{const r=new Array;return s(e,t,r,!0),r}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressDependency:()=>s,CellRangeDependency:()=>o,ColumnRangeDependency:()=>i,NamedExpressionDependency:()=>l,RowRangeDependency:()=>a});var n=r(2);class s{constructor(e){this.dependency=e}absolutize(e){return this.dependency.toSimpleCellAddress(e)}}class o{constructor(e,t){this.start=e,this.end=t}absolutize(e){return new n.AbsoluteCellRange(this.start.toSimpleCellAddress(e),this.end.toSimpleCellAddress(e))}}class i{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleColumnAddress(e),r=this.end.toSimpleColumnAddress(e);return new n.AbsoluteColumnRange(t.sheet,t.col,r.col)}}class a{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleRowAddress(e),r=this.end.toSimpleRowAddress(e);return new n.AbsoluteRowRange(t.sheet,t.row,r.row)}}class l{constructor(e){this.name=e}absolutize(e){return this}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ContentChanges:()=>o});var n=r(3),s=r(69);class o{constructor(){this.changes=new Map}static empty(){return new o}addAll(e){for(const 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=[];return this.changes.forEach((r=>{const n=e.exportChange(r);Array.isArray(n)?t=t.concat(n):t.push(n)})),t}getChanges(){return Array.from(this.changes.values())}isEmpty(){return 0===this.changes.size}add(e,t){const r=t.value;if(r instanceof s.SimpleRangeValue)for(const t of r.effectiveAddressesFromData(e))this.changes.delete(`${t.sheet},${t.col},${t.row}`);this.changes.set((0,n.addressKey)(e),t)}addInterpreterValue(e,t,r){this.add(t,{address:t,value:e,oldValue:r})}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SimpleRangeValue:()=>a});var n=r(1),s=r(3),o=r(61),i=r(70);class a{constructor(e,t,r,s){this._data=e,this.range=t,this.dependencyGraph=r,this._hasOnlyNumbers=s,this.size=void 0===e?new n.ArraySize(t.effectiveWidth(r),t.effectiveHeight(r)):new n.ArraySize(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();const 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){const r=this.data[t];for(let n=0;n<r.length;++n)yield(0,s.simpleCellAddress)(e.sheet,e.col+n,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,s.simpleCellAddress)(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){this._hasOnlyNumbers=!0;for(const e of this.data)for(const 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=>{const t=this.dependencyGraph.getCellValue(e);return t instanceof a?(this._hasOnlyNumbers=!1,new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.ScalarExpected)):((0,i.isExtendedNumber)(t)||(this._hasOnlyNumbers=!1),t)})))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CurrencyNumber:()=>l,DateNumber:()=>a,DateTimeNumber:()=>h,EmptyValue:()=>n,NumberType:()=>p,PercentNumber:()=>c,RichNumber:()=>o,TimeNumber:()=>u,cloneNumber:()=>i,getFormatOfExtendedNumber:()=>m,getRawValue:()=>s,getTypeFormatOfExtendedNumber:()=>f,getTypeOfExtendedNumber:()=>g,isExtendedNumber:()=>d});const n=Symbol("Empty value");function s(e){return e instanceof o?e.val:e}class o{constructor(e,t){this.val=e,this.format=t}fromNumber(e){return new this.constructor(e)}}function i(e,t){if("number"==typeof e)return t;{const r=e.fromNumber(t);return r.format=e.format,r}}class a extends o{getDetailedType(){return p.NUMBER_DATE}}class l extends o{getDetailedType(){return p.NUMBER_CURRENCY}}class u extends o{getDetailedType(){return p.NUMBER_TIME}}class h extends o{getDetailedType(){return p.NUMBER_DATETIME}}class c extends o{getDetailedType(){return p.NUMBER_PERCENT}}function d(e){return"number"==typeof e||e instanceof o}var p;function g(e){return e instanceof o?e.getDetailedType():p.NUMBER_RAW}function m(e){return e instanceof o?e.format:void 0}function f(e){return e instanceof o?{type:e.getDetailedType(),format:e.format}:{type:p.NUMBER_RAW}}!function(e){e.NUMBER_RAW="NUMBER_RAW",e.NUMBER_DATE="NUMBER_DATE",e.NUMBER_TIME="NUMBER_TIME",e.NUMBER_DATETIME="NUMBER_DATETIME",e.NUMBER_CURRENCY="NUMBER_CURRENCY",e.NUMBER_PERCENT="NUMBER_PERCENT"}(p||(p={}))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ColumnsSpan:()=>s,RowsSpan:()=>n});class n{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 n(e,t,t+r-1)}static fromRowStartAndEnd(e,t,r){return new n(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");const t=Math.max(this.rowStart,e.rowStart),r=Math.min(this.rowEnd,e.rowEnd);return t>r?null:new n(this.sheet,t,r)}firstRow(){return new n(this.sheet,this.rowStart,this.rowStart)}}class s{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 s(e,t,t+r-1)}static fromColumnStartAndEnd(e,t,r){return new s(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");const t=Math.max(this.columnStart,e.columnStart),r=Math.min(this.columnEnd,e.columnEnd);return t>r?null:new s(this.sheet,t,r)}firstColumn(){return new s(this.sheet,this.columnStart,this.columnStart)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EmptyStatistics:()=>n.EmptyStatistics,StatType:()=>o.StatType,Statistics:()=>s.Statistics});var n=r(73),s=r(74),o=r(75)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EmptyStatistics:()=>s});var n=r(74);class s extends n.Statistics{incrementCriterionFunctionFullCacheUsed(){}incrementCriterionFunctionPartialCacheUsed(){}start(e){}end(e){}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Statistics:()=>s});var n=r(75);class s{constructor(){this.stats=new Map([[n.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,0],[n.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0]]),this.startTimes=new Map}incrementCriterionFunctionFullCacheUsed(){var e;const t=(null!==(e=this.stats.get(n.StatType.CRITERION_FUNCTION_FULL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(n.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,t)}incrementCriterionFunctionPartialCacheUsed(){var e;const t=(null!==(e=this.stats.get(n.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(n.StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED,t)}reset(){this.stats.clear(),this.startTimes.clear(),this.stats.set(n.StatType.CRITERION_FUNCTION_FULL_CACHE_USED,0),this.stats.set(n.StatType.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;const r=Date.now(),n=this.startTimes.get(e);if(!n)throw Error(`Statistics ${e} not started`);{let s=null!==(t=this.stats.get(e))&&void 0!==t?t:0;s+=r-n,this.stats.set(e,s),this.startTimes.delete(e)}}measure(e,t){this.start(e);const r=t();return this.end(e),r}snapshot(){return new Map(this.stats)}}},(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{StatType:()=>n}),function(e){e.BUILD_ENGINE_TOTAL="BUILD_ENGINE_TOTAL",e.PARSER="PARSER",e.GRAPH_BUILD="GRAPH_BUILD",e.COLLECT_DEPENDENCIES="COLLECT_DEPENDENCIES",e.PROCESS_DEPENDENCIES="PROCESS_DEPENDENCIES",e.TOP_SORT="TOP_SORT",e.BUILD_COLUMN_INDEX="BUILD_COLUMN_INDEX",e.EVALUATION="EVALUATION",e.VLOOKUP="VLOOKUP",e.TRANSFORM_ASTS="TRANSFORM_ASTS",e.TRANSFORM_ASTS_POSTPONED="TRANSFORM_ASTS_POSTPONED",e.ADJUSTING_ADDRESS_MAPPING="ADJUSTING_ADDRESS_MAPPING",e.ADJUSTING_ARRAY_MAPPING="ADJUSTING_ARRAY_MAPPING",e.ADJUSTING_RANGES="ADJUSTING_RANGES",e.ADJUSTING_GRAPH="ADJUSTING_GRAPH",e.CRITERION_FUNCTION_FULL_CACHE_USED="CRITERION_FUNCTION_FULL_CACHE_USED",e.CRITERION_FUNCTION_PARTIAL_CACHE_USED="CRITERION_FUNCTION_PARTIAL_CACHE_USED"}(n||(n={}))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressMapping:()=>i});var n=r(77),s=r(70),o=r(4);class i{constructor(e){this.policy=e,this.mapping=new Map}getCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new n.NoSheetWithIdError(e.sheet);return t.getCell(e)}fetchCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new n.NoSheetWithIdError(e.sheet);const r=t.getCell(e);if(!r)throw Error("Vertex for address missing in AddressMapping");return r}strategyFor(e){const t=this.mapping.get(e);if(void 0===t)throw new n.NoSheetWithIdError(e);return t}addSheet(e,t){if(this.mapping.has(e))throw Error("Sheet already added");this.mapping.set(e,t)}autoAddSheet(e,t,r){const{height:n,width:s,fill:o}=r,i=this.policy.call(o);this.addSheet(e,new i(s,n))}getCellValue(e){const t=this.getCell(e);return void 0===t?s.EmptyValue:t instanceof o.ArrayVertex?t.getArrayCellValue(e):t.getCellValue()}getRawValue(e){const t=this.getCell(e);return t instanceof o.ValueCellVertex?t.getValues().rawValue:t instanceof o.ArrayVertex?t.getArrayCellRawValue(e):null}setCell(e,t){const r=this.mapping.get(e.sheet);if(!r)throw Error("Sheet not initialized");r.setCell(e,t)}moveCell(e,t){const r=this.mapping.get(e.sheet);if(!r)throw Error("Sheet not initialized.");if(e.sheet!==t.sheet)throw Error("Cannot move cells between sheets.");if(r.has(t))throw new Error("Cannot move cell. Destination already occupied.");const n=r.getCell(e);if(void 0===n)throw new Error("Cannot move cell. No cell with such address.");this.setCell(t,n),this.removeCell(e)}removeCell(e){const t=this.mapping.get(e.sheet);if(!t)throw Error("Sheet not initialized");t.removeCell(e)}has(e){const t=this.mapping.get(e.sheet);return void 0!==t&&t.has(e)}getHeight(e){const t=this.mapping.get(e);if(void 0===t)throw new n.NoSheetWithIdError(e);return t.getHeight()}getWidth(e){const t=this.mapping.get(e);if(!t)throw new n.NoSheetWithIdError(e);return t.getWidth()}addRows(e,t,r){const s=this.mapping.get(e);if(void 0===s)throw new n.NoSheetWithIdError(e);s.addRows(t,r)}removeRows(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new n.NoSheetWithIdError(e.sheet);t.removeRows(e)}removeSheet(e){this.mapping.delete(e)}addColumns(e,t,r){const s=this.mapping.get(e);if(void 0===s)throw new n.NoSheetWithIdError(e);s.addColumns(t,r)}removeColumns(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new n.NoSheetWithIdError(e.sheet);t.removeColumns(e)}*verticesFromRowsSpan(e){yield*this.mapping.get(e.sheet).verticesFromRowsSpan(e)}*verticesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).verticesFromColumnsSpan(e)}*entriesFromRowsSpan(e){yield*this.mapping.get(e.sheet).entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).entriesFromColumnsSpan(e)}*entries(){for(const[e,t]of this.mapping.entries())yield*t.getEntries(e)}*sheetEntries(e){const t=this.mapping.get(e);if(void 0===t)throw new n.NoSheetWithIdError(e);yield*t.getEntries(e)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AliasAlreadyExisting:()=>L,ConfigValueEmpty:()=>T,ConfigValueTooBigError:()=>w,ConfigValueTooSmallError:()=>R,EvaluationSuspendedError:()=>v,ExpectedOneOfValuesError:()=>S,ExpectedValueOfTypeError:()=>C,FunctionPluginValidationError:()=>b,InvalidAddressError:()=>l,InvalidArgumentsError:()=>u,LanguageAlreadyRegisteredError:()=>M,LanguageNotRegisteredError:()=>O,MissingTranslationError:()=>A,NamedExpressionDoesNotExistError:()=>p,NamedExpressionNameIsAlreadyTakenError:()=>c,NamedExpressionNameIsInvalidError:()=>d,NoOperationToRedoError:()=>m,NoOperationToUndoError:()=>g,NoRelativeAddressesAllowedError:()=>P,NoSheetWithIdError:()=>n,NoSheetWithNameError:()=>s,NotAFormulaError:()=>a,NothingToPasteError:()=>f,ProtectedFunctionError:()=>I,ProtectedFunctionTranslationError:()=>N,SheetNameAlreadyTakenError:()=>o,SheetSizeLimitExceededError:()=>i,SheetsNotEqual:()=>h,SourceLocationHasArrayError:()=>_,TargetLocationHasArrayError:()=>x,UnableToParseError:()=>E});class n extends Error{constructor(e){super(`There's no sheet with id = ${e}`)}}class s 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 i 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}) is invalid`)}}class u extends Error{constructor(e){super(`Invalid arguments, expected ${e}`)}}class h 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 p extends Error{constructor(e){super(`Named Expression '${e}' does not exist`)}}class g extends Error{constructor(){super("There is no operation to undo")}}class m extends Error{constructor(){super("There is no operation to redo")}}class f 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:return t instanceof RegExp?"RegExp("+t.toString()+")":t}}class E extends Error{constructor(e){super(`Unable to parse value: ${JSON.stringify(e,y,4)}`)}}class C extends Error{constructor(e,t){super(`Expected value of type: ${e} for config parameter: ${t}`)}}class T extends Error{constructor(e){super(`Config parameter ${e} cannot be empty.`)}}class R extends Error{constructor(e,t){super(`Config parameter ${e} should be at least ${t}`)}}class w extends Error{constructor(e,t){super(`Config parameter ${e} should be at most ${t}`)}}class S extends Error{constructor(e,t){super(`Expected one of ${e} for config parameter: ${t}`)}}class v extends Error{constructor(){super("Computations are suspended")}}class A extends Error{constructor(e){super(`Translation for ${e} is missing in the translation package you're using.`)}}class N extends Error{constructor(e){super(`Cannot register translation for function with id: ${e}`)}}class O extends Error{constructor(){super("Language not registered.")}}class M extends Error{constructor(){super("Language already registered.")}}class b extends Error{static functionNotDeclaredInPlugin(e,t){return new b(`Function with id ${e} not declared in plugin ${t}`)}static functionMethodNotFound(e,t){return new b(`Function method ${e} not found in plugin ${t}`)}}class I extends Error{static cannotRegisterFunctionWithId(e){return new I(`Cannot register function with id ${e}`)}static cannotUnregisterFunctionWithId(e){return new I(`Cannot unregister function with id ${e}`)}static cannotUnregisterProtectedPlugin(){return new I("Cannot unregister protected plugin")}}class _ extends Error{constructor(){super("Cannot perform this operation, source location has an array inside.")}}class x extends Error{constructor(){super("Cannot perform this operation, target location has an array inside.")}}class P extends Error{constructor(){super("Relative addresses not allowed in named expressions.")}}class L extends Error{constructor(e,t){super(`Alias id ${e} in plugin ${t} already defined as a function or alias.`)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArrayMapping:()=>s});var n=r(3);class s{constructor(){this.arrayMapping=new Map}getArray(e){const t=this.getArrayByCorner(e.start);if(null==t?void 0:t.getRange().sameAs(e))return t}getArrayByCorner(e){return this.arrayMapping.get((0,n.addressKey)(e))}setArray(e,t){this.arrayMapping.set((0,n.addressKey)(e.start),t)}removeArray(e){"string"==typeof e?this.arrayMapping.delete(e):this.arrayMapping.delete((0,n.addressKey)(e.start))}count(){return this.arrayMapping.size}*arraysInRows(e){for(const[t,r]of this.arrayMapping.entries())r.spansThroughSheetRows(e.sheet,e.rowStart,e.rowEnd)&&(yield[t,r])}*arraysInCols(e){for(const[t,r]of this.arrayMapping.entries())r.spansThroughSheetColumn(e.sheet,e.columnStart,e.columnEnd)&&(yield[t,r])}isFormulaArrayInRow(e,t){for(const r of this.arrayMapping.values())if(r.spansThroughSheetRows(e,t))return!0;return!1}isFormulaArrayInAllRows(e){let t=!0;for(const r of e.rows())this.isFormulaArrayInRow(e.sheet,r)||(t=!1);return t}isFormulaArrayInColumn(e,t){for(const r of this.arrayMapping.values())if(r.spansThroughSheetColumn(e,t))return!0;return!1}isFormulaArrayInAllColumns(e){let t=!0;for(const r of e.columns())this.isFormulaArrayInColumn(e.sheet,r)||(t=!1);return t}isFormulaArrayInRange(e){for(const t of this.arrayMapping.values())if(t.getRange().doesOverlap(e))return!0;return!1}isFormulaArrayAtAddress(e){for(const t of this.arrayMapping.values())if(t.getRange().addressInRange(e))return!0;return!1}moveArrayVerticesAfterRowByRows(e,t,r){this.updateArrayVerticesInSheet(e,((e,n)=>{const s=n.getRange();return t<=s.start.row?[s.shifted(0,r),n]:void 0}))}moveArrayVerticesAfterColumnByColumns(e,t,r){this.updateArrayVerticesInSheet(e,((e,n)=>{const s=n.getRange();return t<=s.start.col?[s.shifted(r,0),n]:void 0}))}updateArrayVerticesInSheet(e,t){const r=Array();for(const[n,s]of this.arrayMapping.entries()){if(s.sheet!==e)continue;const o=t(n,s);void 0!==o&&(this.removeArray(n),r.push(o))}r.forEach((([e,t])=>{this.setArray(e,t)}))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{collectAddressesDependentToRange:()=>i});var n=r(7),s=r(80),o=r(82);const i=(e,t,r,i,a)=>{if(t instanceof o.RangeVertex){const e=t.range.intersectionWith(r);return void 0!==e?Array.from(e.addresses(a)):[]}let l,u;return t instanceof s.FormulaVertex?(l=t.getFormula(i),u=t.getAddress(i),(0,n.collectDependencies)(l,e).filter((e=>e instanceof n.AddressDependency)).map((e=>e.dependency.toSimpleCellAddress(u))).filter((e=>r.addressInRange(e)))):[]}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArrayVertex:()=>c,FormulaCellVertex:()=>d,FormulaVertex:()=>h});var n=r(2),s=r(1),o=r(81),i=r(3),a=r(61),l=r(70),u=r(71);class h{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,n){return r.isScalar()?new d(e,t,n):new c(e,t,r,n)}getFormula(e){return this.ensureRecentData(e),this.formula}ensureRecentData(e){if(this.version!=e.version()){const[t,r,n]=e.applyTransformations(this.formula,this.cellAddress,this.version);this.formula=t,this.cellAddress=r,this.version=n}}getAddress(e){return this.ensureRecentData(e),this.cellAddress}}class c extends h{constructor(e,t,r,n=0){super(e,t,n),r.isRef?this.array=new o.ErroredArray(new i.CellError(i.ErrorType.REF,a.ErrorMessage.NoSpaceForArrayResult),s.ArraySize.error()):this.array=new o.NotComputedArray(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 i.CellError)return this.setErrorValue(e),e;const t=o.ArrayValue.fromInterpreterValue(e);return t.resize(this.array.size),this.array=t,e}getCellValue(){if(this.array instanceof o.NotComputedArray)throw Error("Array not computed yet.");return this.array.simpleRangeValue()}valueOrUndef(){if(!(this.array instanceof o.NotComputedArray))return this.array.simpleRangeValue()}getArrayCellValue(e){const t=e.col-this.cellAddress.col,r=e.row-this.cellAddress.row;try{return this.array.get(t,r)}catch(e){return new i.CellError(i.ErrorType.REF)}}getArrayCellRawValue(e){const t=this.getArrayCellValue(e);return t instanceof i.CellError||t===l.EmptyValue?void 0:(0,l.getRawValue)(t)}setArrayCellValue(e,t){const r=e.col-this.cellAddress.col,n=e.row-this.cellAddress.row;this.array instanceof o.ArrayValue&&this.array.set(r,n,t)}setNoSpace(){return this.array=new o.ErroredArray(new i.CellError(i.ErrorType.SPILL,a.ErrorMessage.NoSpaceForArrayResult),s.ArraySize.error()),this.getCellValue()}getRange(){return n.AbsoluteCellRange.spanFrom(this.cellAddress,this.width,this.height)}getRangeOrUndef(){return n.AbsoluteCellRange.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.NotComputedArray)}columnsFromArray(){return u.ColumnsSpan.fromNumberOfColumns(this.cellAddress.sheet,this.cellAddress.col,this.width)}rowsFromArray(){return u.RowsSpan.fromNumberOfRows(this.cellAddress.sheet,this.cellAddress.row,this.height)}ensureRecentData(e){}isLeftCorner(e){return(0,i.equalSimpleCellAddress)(this.cellAddress,e)}setErrorValue(e){this.array=new o.ErroredArray(e,this.array.size)}}class d extends h{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}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArrayValue:()=>a,ErroredArray:()=>l,NotComputedArray:()=>i});var n=r(1),s=r(70),o=r(69);class i{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){this.size=new n.ArraySize(e.length>0?e[0].length:0,e.length),this.array=e}static fromInterpreterValue(e){return e instanceof o.SimpleRangeValue?new a(e.data):new a([[e]])}simpleRangeValue(){return o.SimpleRangeValue.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,...new Array(t).fill(s.EmptyValue));this.size.width+=t}removeRows(e,t){if(this.outOfBound(0,e)||this.outOfBound(0,t))throw Error("Array index out of bound");const 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");const r=t-e+1;for(const t of this.array)t.splice(e,r);this.size.width-=r}nullArrays(e,t){const r=[];for(let n=0;n<e;++n)r.push(new Array(t).fill(s.EmptyValue));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)throw Error("Resizing to smaller array");if(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}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RangeVertex:()=>n});class n{constructor(e){this.range=e,this.functionCache=new Map,this.criterionFunctionCache=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()}getStart(){return this.start}getEnd(){return this.end}}},(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{Graph:()=>s}),function(e){e[e.ON_STACK=0]="ON_STACK",e[e.PROCESSED=1]="PROCESSED",e[e.POPPED=2]="POPPED"}(n||(n={}));class s{constructor(e){this.dependencyQuery=e,this.nodes=new Set,this.specialNodes=new Set,this.specialNodesStructuralChanges=new Set,this.specialNodesRecentlyChanged=new Set,this.infiniteRanges=new Set,this.edges=new Map}addNode(e){this.nodes.add(e),this.edges.has(e)||this.edges.set(e,new Set)}addEdge(e,t){if(!this.nodes.has(e))throw new Error(`Unknown node ${e}`);if(!this.nodes.has(t))throw new Error(`Unknown node ${t}`);this.edges.get(e).add(t)}removeEdge(e,t){if(!this.existsEdge(e,t))throw new Error("Edge does not exist");this.edges.get(e).delete(t)}softRemoveEdge(e,t){var r;null===(r=this.edges.get(e))||void 0===r||r.delete(t)}removeIncomingEdges(e){this.edges.forEach((t=>{t.delete(e)}))}adjacentNodes(e){return this.edges.get(e)}adjacentNodesCount(e){return this.adjacentNodes(e).size}hasNode(e){return this.nodes.has(e)}nodesCount(){return this.nodes.size}edgesCount(){let e=0;return this.edges.forEach((t=>e+=t.size)),e}removeNode(e){for(const t of this.adjacentNodes(e).values())this.markNodeAsSpecialRecentlyChanged(t);return this.edges.delete(e),this.nodes.delete(e),this.specialNodes.delete(e),this.specialNodesRecentlyChanged.delete(e),this.specialNodesStructuralChanges.delete(e),this.infiniteRanges.delete(e),this.removeDependencies(e)}markNodeAsSpecial(e){this.specialNodes.add(e)}markNodeAsSpecialRecentlyChanged(e){this.nodes.has(e)&&this.specialNodesRecentlyChanged.add(e)}markNodeAsChangingWithStructure(e){this.specialNodesStructuralChanges.add(e)}clearSpecialNodesRecentlyChanged(){this.specialNodesRecentlyChanged.clear()}markNodeAsInfiniteRange(e){this.infiniteRanges.add(e)}existsEdge(e,t){var r,n;return null!==(n=null===(r=this.edges.get(e))||void 0===r?void 0:r.has(t))&&void 0!==n&&n}topSortWithScc(){return this.getTopSortedWithSccSubgraphFrom(Array.from(this.nodes),(()=>!0),(()=>{}))}getTopSortedWithSccSubgraphFrom(e,t,r){const s=new Map,o=new Map,i=new Map,a=new Set,l=new Map,u=[];let h=0;const c=new Set;e.reverse(),e.forEach((e=>{if(void 0!==l.get(e))return;const t=[e],r=[];for(l.set(e,n.ON_STACK);t.length>0;){const e=t[t.length-1];switch(l.get(e)){case n.ON_STACK:s.set(e,h),o.set(e,h),r.push(e),h++,this.adjacentNodes(e).forEach((r=>{void 0===s.get(r)&&(t.push(r),i.set(r,e),l.set(r,n.ON_STACK))})),l.set(e,n.PROCESSED);break;case n.PROCESSED:{let h;if(h=s.get(e),this.adjacentNodes(e).forEach((t=>{a.has(t)||(h=i.get(t)===e?Math.min(h,o.get(t)):Math.min(h,s.get(t)))})),o.set(e,h),h===s.get(e)){const t=[];do{t.push(r[r.length-1]),r.pop()}while(t[t.length-1]!==e);t.forEach((e=>{a.add(e)})),u.push(...t),t.length>1&&t.forEach((e=>{c.add(e)}))}t.pop(),l.set(e,n.POPPED);break}case n.POPPED:t.pop()}}}));const d=new Set(e),p=[],g=[];return u.reverse(),u.forEach((e=>{c.has(e)||this.adjacentNodes(e).has(e)?(g.push(e),r(e),this.adjacentNodes(e).forEach((e=>d.add(e)))):(p.push(e),d.has(e)&&t(e)&&this.adjacentNodes(e).forEach((e=>d.add(e))))})),{sorted:p,cycled:g}}getDependencies(e){const t=[];return this.edges.forEach(((r,n)=>{r.has(e)&&t.push(n)})),t}removeDependencies(e){const t=this.dependencyQuery(e);for(const[r,n]of t)this.softRemoveEdge(n,e);return t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RangeMapping:()=>o});var n=r(2),s=r(3);class o{constructor(){this.rangeMapping=new Map}getMappingSize(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}setRange(e){let t=this.rangeMapping.get(e.getStart().sheet);void 0===t&&(t=new Map,this.rangeMapping.set(e.getStart().sheet,t));const r=i(e.getStart(),e.getEnd());t.set(r,e)}removeRange(e){const t=e.getStart().sheet,r=this.rangeMapping.get(t);if(void 0===r)return;const n=i(e.getStart(),e.getEnd());r.delete(n),0===r.size&&this.rangeMapping.delete(t)}getRange(e,t){const r=this.rangeMapping.get(e.sheet),n=i(e,t);return null==r?void 0:r.get(n)}fetchRange(e,t){const r=this.getRange(e,t);if(!r)throw Error("Range does not exist");return r}truncateRanges(e,t){const r=Array(),n=Array(),s=Array(),o=e.sheet;for(const[i,a]of this.entriesFromSheet(e.sheet)){const l=a.range;e.start<=t(a.range.end)&&(l.removeSpan(e),l.shouldBeRemoved()?(this.removeByKey(o,i),r.push(a)):n.push([i,a]),s.push(a))}const l=[];n.sort(((e,r)=>a(e[1],r[1],t)));for(const[e,t]of n){const r=i((u=t.range).start,u.end);if(r===e)continue;const n=this.getByKey(o,r);this.removeByKey(o,e),void 0!==n&&t!=n?l.push([n,t]):this.setRange(t)}var u;return{verticesToRemove:r,verticesToMerge:l,verticesWithChangedSize:s}}moveAllRangesInSheetAfterRowByRows(e,t,r){return this.updateVerticesFromSheet(e,((e,n)=>t<=n.start.row?(n.range.shiftByRows(r),{changedSize:!1,vertex:n}):t>n.start.row&&t<=n.end.row?(n.range.expandByRows(r),{changedSize:!0,vertex:n}):void 0))}moveAllRangesInSheetAfterColumnByColumns(e,t,r){return this.updateVerticesFromSheet(e,((e,n)=>t<=n.start.col?(n.range.shiftByColumns(r),{changedSize:!1,vertex:n}):t>n.start.col&&t<=n.end.col?(n.range.expandByColumns(r),{changedSize:!0,vertex:n}):void 0))}moveRangesInsideSourceRange(e,t,r,n){this.updateVerticesFromSheet(e.sheet,((s,o)=>e.containsRange(o.range)?(o.range.shiftByColumns(t),o.range.shiftByRows(r),o.range.moveToSheet(n),{changedSize:!1,vertex:o}):void 0))}removeRangesInSheet(e){if(this.rangeMapping.has(e)){const t=this.rangeMapping.get(e).values();return this.rangeMapping.delete(e),t}return[][Symbol.iterator]()}*rangesInSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.values())}*rangeVerticesContainedInRange(e){for(const t of this.rangesInSheet(e.sheet))e.containsRange(t.range)&&(yield t)}findSmallerRange(e){if(e.height()>1&&Number.isFinite(e.height())){const t=(0,s.simpleCellAddress)(e.end.sheet,e.end.col,e.end.row-1),r=this.getRange(e.start,t);if(void 0!==r){return{smallerRangeVertex:r,restRange:n.AbsoluteCellRange.fromSimpleCellAddresses((0,s.simpleCellAddress)(e.start.sheet,e.start.col,e.end.row),e.end)}}}return{restRange:e}}*entriesFromSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.entries())}removeByKey(e,t){this.rangeMapping.get(e).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){const r=Array();for(const[n,s]of this.entriesFromSheet(e)){const o=t(n,s);void 0!==o&&(this.removeByKey(e,n),r.push(o))}return r.forEach((e=>{this.setRange(e.vertex)})),{verticesWithChangedSize:r.filter((e=>e.changedSize)).map((e=>e.vertex))}}}function i(e,t){return`${e.col},${e.row},${t.col},${t.row}`}const a=(e,t,r)=>{const n=r(e.range.start),s=r(e.range.start);if(n===s){return r(e.range.end)-r(t.range.end)}return n-s}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SheetMapping:()=>a});var n=r(77),s=r(86);function o(e){return e.toLowerCase()}class i{constructor(e,t){this.id=e,this.displayName=t}get canonicalName(){return o(this.displayName)}}class a{constructor(e){this.languages=e,this.mappingFromCanonicalName=new Map,this.mappingFromId=new Map,this.lastSheetId=-1,this.fetch=e=>{const t=this.mappingFromCanonicalName.get(o(e));if(void 0===t)throw new n.NoSheetWithNameError(e);return t.id},this.get=e=>{var t;return null===(t=this.mappingFromCanonicalName.get(o(e)))||void 0===t?void 0:t.id},this.fetchDisplayName=e=>this.fetchSheetById(e).displayName,this.sheetNamePrefix=e.getUITranslation(s.UIElement.NEW_SHEET_PREFIX)}addSheet(e=`${this.sheetNamePrefix}${this.lastSheetId+2}`){const t=o(e);if(this.mappingFromCanonicalName.has(t))throw new n.SheetNameAlreadyTakenError(e);this.lastSheetId++;const r=new i(this.lastSheetId,e);return this.store(r),r.id}removeSheet(e){const t=this.fetchSheetById(e);e==this.lastSheetId&&--this.lastSheetId,this.mappingFromCanonicalName.delete(t.canonicalName),this.mappingFromId.delete(t.id)}getDisplayName(e){var t;return null===(t=this.mappingFromId.get(e))||void 0===t?void 0:t.displayName}*displayNames(){for(const e of this.mappingFromCanonicalName.values())yield e.displayName}numberOfSheets(){return this.mappingFromCanonicalName.size}hasSheetWithId(e){return this.mappingFromId.has(e)}hasSheetWithName(e){return this.mappingFromCanonicalName.has(o(e))}renameSheet(e,t){const r=this.fetchSheetById(e),s=r.displayName;if(s===t)return;const i=this.mappingFromCanonicalName.get(o(t));if(void 0!==i&&i.id!==r.id)throw new n.SheetNameAlreadyTakenError(t);const a=r.canonicalName;return this.mappingFromCanonicalName.delete(a),r.displayName=t,this.store(r),s}sheetNames(){return Array.from(this.mappingFromId.values()).map((e=>e.displayName))}store(e){this.mappingFromId.set(e.id,e),this.mappingFromCanonicalName.set(e.canonicalName,e)}fetchSheetById(e){const t=this.mappingFromId.get(e);if(void 0===t)throw new n.NoSheetWithIdError(e);return t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TranslationPackage:()=>s.TranslationPackage,UIElement:()=>n,buildTranslationPackage:()=>s.buildTranslationPackage});var n,s=r(87);!function(e){e.NEW_SHEET_PREFIX="NEW_SHEET_PREFIX"}(n||(n={}))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TranslationPackage:()=>i,buildTranslationPackage:()=>a});var n=r(3),s=r(77),o=r(86);class i{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)=>(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){const t=[];for(const r of e)this.isFunctionTranslated(r)&&t.push(this.functions[r]);return t}getFunctionTranslation(e){const t=this.functions[e];if(void 0===t)throw new s.MissingTranslationError(`functions.${e}`);return t}getMaybeFunctionTranslation(e){return this.functions[e]}getErrorTranslation(e){if(e===n.ErrorType.LIC)return`#${n.ErrorType.LIC}!`;const t=this.errors[e];if(void 0===t)throw new s.MissingTranslationError(`errors.${e}`);return t}getUITranslation(e){const t=this.ui[e];if(void 0===t)throw new s.MissingTranslationError(`ui.${e}`);return t}checkUI(){for(const e of Object.values(o.UIElement))if(!(e in this.ui))throw new s.MissingTranslationError(`ui.${e}`)}checkErrors(){for(const e of Object.values(n.ErrorType))if(!(e in this.errors)&&e!==n.ErrorType.LIC)throw new s.MissingTranslationError(`errors.${e}`)}checkFunctionTranslations(e){const t=new Set(Object.getOwnPropertyNames(e));for(const e of Object.getOwnPropertyNames(this._protectedTranslations))if(t.has(e))throw new s.ProtectedFunctionTranslationError(e)}}function a(e){return new i(Object.assign({},e.functions),Object.assign({},e.errors),Object.assign({},e.ui))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{EmptyCellVertex:()=>s});var n=r(70);class s{constructor(){}getCellValue(){return n.EmptyValue}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ValueCellVertex:()=>n});class n{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}setCellValue(e){throw Error("SetCellValue is deprecated for ValueCellVertex")}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ParsingErrorVertex:()=>s});var n=r(3);class s{constructor(e,t){this.errors=e,this.rawInput=t}getCellValue(){return n.CellError.parsingError()}getFormula(){return this.rawInput}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SparseStrategy:()=>s});var n=r(3);class s{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=>{const n=new Map;r.forEach(((s,o)=>{o>=e&&(n.set(o+t,s),r.delete(o))})),n.forEach(((e,t)=>{r.set(t,e)}))})),this.height+=t}addColumns(e,t){const r=new Map;this.mapping.forEach(((n,s)=>{s>=e&&(r.set(s+t,n),this.mapping.delete(s))})),r.forEach(((e,t)=>{this.mapping.set(t,e)})),this.width+=t}removeRows(e){this.mapping.forEach((t=>{const r=new Map;t.forEach(((n,s)=>{s>=e.rowStart&&(t.delete(s),s>e.rowEnd&&r.set(s-e.numberOfRows,n))})),r.forEach(((e,r)=>{t.set(r,e)}))}));const t=Math.min(this.height-1,e.rowEnd),r=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-r)}removeColumns(e){const t=new Map;this.mapping.forEach(((r,n)=>{n>=e.columnStart&&(this.mapping.delete(n),n>e.columnEnd&&t.set(n-e.numberOfColumns,r))})),t.forEach(((e,t)=>{this.mapping.set(t,e)}));const r=Math.min(this.width-1,e.columnEnd),n=Math.max(0,r-e.columnStart+1);this.width=Math.max(0,this.width-n)}*getEntries(e){for(const[t,r]of this.mapping)for(const[s,o]of r)yield[(0,n.simpleCellAddress)(e,t,s),o]}*verticesFromColumn(e){const t=this.mapping.get(e);if(void 0!==t)for(const[e,r]of t)yield r}*verticesFromRow(e){for(const t of this.mapping.values()){const r=t.get(e);void 0!==r&&(yield r)}}*verticesFromColumnsSpan(e){for(const t of e.columns()){const e=this.mapping.get(t);if(void 0!==e)for(const[t,r]of e)yield r}}*verticesFromRowsSpan(e){for(const t of this.mapping.values())for(const r of e.rows()){const e=t.get(r);void 0!==e&&(yield e)}}*entriesFromRowsSpan(e){for(const[t,r]of this.mapping.entries())for(const s of e.rows()){const o=r.get(s);void 0!==o&&(yield[(0,n.simpleCellAddress)(e.sheet,t,s),o])}}*entriesFromColumnsSpan(e){for(const t of e.columns()){const r=this.mapping.get(t);if(void 0!==r)for(const[s,o]of r.entries())yield[(0,n.simpleCellAddress)(e.sheet,t,s),o]}}*vertices(){for(const[e,t]of this.mapping)for(const[e,r]of t)void 0!==r&&(yield r)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DenseStrategy:()=>s});var n=r(3);class s{constructor(e,t){this.width=e,this.height=t,this.mapping=new Array(t);for(let r=0;r<t;r++)this.mapping[r]=new 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]=new Array(this.width)),this.mapping[e.row][e.col]=t}has(e){const 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){const r=[];for(let e=0;e<t;e++)r.push(new Array(this.width));this.mapping.splice(e,0,...r),this.height+=t}addColumns(e,t){for(let r=0;r<this.height;r++)this.mapping[r].splice(e,0,...new Array(t));this.width+=t}removeRows(e){this.mapping.splice(e.rowStart,e.numberOfRows);const t=Math.min(this.height-1,e.rowEnd),r=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-r)}removeColumns(e){for(let t=0;t<this.height;t++)this.mapping[t].splice(e.columnStart,e.numberOfColumns);const t=Math.min(this.width-1,e.columnEnd),r=Math.max(0,t-e.columnStart+1);this.width=Math.max(0,this.width-r)}*getEntries(e){for(let t=0;t<this.height;++t)for(let r=0;r<this.width;++r){const s=this.getCellVertex(r,t);s&&(yield[(0,n.simpleCellAddress)(e,r,t),s])}}*verticesFromColumn(e){for(let t=0;t<this.height;++t){const r=this.getCellVertex(e,t);r&&(yield r)}}*verticesFromRow(e){for(let t=0;t<this.width;++t){const 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){const 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){const 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){const s=this.getCellVertex(t,r);s&&(yield[(0,n.simpleCellAddress)(e.sheet,t,r),s])}}*entriesFromColumnsSpan(e){for(let t=e.columnStart;t<=e.columnEnd;++t)for(let r=0;r<this.height;++r){const s=this.getCellVertex(t,r);s&&(yield[(0,n.simpleCellAddress)(e.sheet,t,r),s])}}*vertices(){for(let e=0;e<this.height;++e)for(let t=0;t<this.width;++t){const 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]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{InterpreterState:()=>n});class n{constructor(e,t,r){this.formulaAddress=e,this.arraysFlag=t,this.formulaVertex=r}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FunctionArgumentType:()=>n,FunctionPlugin:()=>c});var n,s=r(2),o=r(3),i=r(61),a=r(7),l=r(95),u=r(70),h=r(69);!function(e){e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.SCALAR="SCALAR",e.NOERROR="NOERROR",e.RANGE="RANGE",e.INTEGER="INTEGER",e.COMPLEX="COMPLEX",e.ANY="ANY"}(n||(n={}));class c{constructor(e){this.coerceScalarToNumberOrError=e=>this.arithmeticHelper.coerceScalarToNumberOrError(e),this.runFunction=(e,t,r,n)=>{const s=this.evaluateArguments(e,t,r),a=s.map((([e,t])=>e)),l=s.map((([e,t])=>t)),u=this.buildMetadataForEachArgumentValue(a.length,r),c=t.arraysFlag&&!r.vectorizationForbidden;if(!this.isNumberOfArgumentValuesValid(u,a.length))return new o.CellError(o.ErrorType.NA,i.ErrorMessage.WrongArgNumber);const[d,p]=c?this.calculateSizeOfVectorizedResultArray(a,u):[1,1];if(1===d&&1===p){const e=this.vectorizeAndBroadcastArgumentsIfNecessary(c,a,u,0,0);return this.calculateSingleCellOfResultArray(t,e,u,l,n,r.returnNumberType)}const g=[...Array(d).keys()].map((e=>[...Array(p).keys()].map((s=>{const o=this.vectorizeAndBroadcastArgumentsIfNecessary(c,a,u,e,s),i=this.calculateSingleCellOfResultArray(t,o,u,l,n,r.returnNumberType);if(i instanceof h.SimpleRangeValue)throw new Error("Function returning array cannot be vectorized.");return i}))));return h.SimpleRangeValue.onlyValues(g)},this.runFunctionWithReferenceArgument=(e,t,r,n,l,u=(()=>new o.CellError(o.ErrorType.NA,i.ErrorMessage.CellRefExpected)))=>{if(0===e.length)return this.returnNumberWrapper(n(),r.returnNumberType);if(e.length>1)return new o.CellError(o.ErrorType.NA,i.ErrorMessage.WrongArgNumber);let h,c=e[0];for(;c.type===a.AstNodeType.PARENTHESIS;)c=c.expression;if(c.type===a.AstNodeType.CELL_REFERENCE)h=c.reference.toSimpleCellAddress(t.formulaAddress);else if(c.type===a.AstNodeType.CELL_RANGE||c.type===a.AstNodeType.COLUMN_RANGE||c.type===a.AstNodeType.ROW_RANGE)try{h=s.AbsoluteCellRange.fromAst(c,t.formulaAddress).start}catch(e){return new o.CellError(o.ErrorType.REF,i.ErrorMessage.CellRefExpected)}return void 0!==h?this.returnNumberWrapper(l(h),r.returnNumberType):this.runFunction(e,t,r,u)},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){const r=[];for(const n of e){const e=this.evaluateAst(n,t);if(e instanceof h.SimpleRangeValue)for(const t of e.valuesFromTopLeftCorner())r.push([t,!0]);else r.push([e,!1])}return r}coerceToType(e,t,r){let s;if(e instanceof h.SimpleRangeValue)switch(t.argumentType){case n.RANGE:case n.ANY:s=e;break;default:{const t=(0,l.coerceRangeToScalar)(e,r);if(void 0===t)return;e=t}}if(!(e instanceof h.SimpleRangeValue))switch(t.argumentType){case n.INTEGER:case n.NUMBER:const r=this.coerceScalarToNumberOrError(e);if(!(0,u.isExtendedNumber)(r)){s=r;break}const a=(0,u.getRawValue)(r);if(void 0!==t.maxValue&&a>t.maxValue)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ValueLarge);if(void 0!==t.minValue&&a<t.minValue)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ValueSmall);if(void 0!==t.lessThan&&a>=t.lessThan)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ValueLarge);if(void 0!==t.greaterThan&&a<=t.greaterThan)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ValueSmall);if(t.argumentType===n.INTEGER&&!Number.isInteger(a))return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.IntegerExpected);s=r;break;case n.STRING:s=(0,l.coerceScalarToString)(e);break;case n.BOOLEAN:s=(0,l.coerceScalarToBoolean)(e);break;case n.SCALAR:case n.NOERROR:case n.ANY:s=e;break;case n.RANGE:if(e instanceof o.CellError)return e;s=(0,l.coerceToRange)(e);break;case n.COMPLEX:return this.arithmeticHelper.coerceScalarToComplex((0,u.getRawValue)(e))}return t.passSubtype||void 0===s?s:(0,u.getRawValue)(s)}calculateSingleCellOfResultArray(e,t,r,n,s,i){const a=this.coerceArgumentsToRequiredTypes(e,t,r,n);if(a instanceof o.CellError)return a;const l=s(...a);return this.returnNumberWrapper(l,i)}coerceArgumentsToRequiredTypes(e,t,r,s){const a=[];for(let l=0;l<r.length;l++){const u=r[l],h=void 0!==t[l]?t[l]:null==u?void 0:u.defaultValue;if(void 0===h){a.push(void 0);continue}const c=this.coerceToType(h,u,e);if(void 0===c&&!s[l])return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.WrongType);if(c instanceof o.CellError&&u.argumentType!==n.SCALAR)return c;a.push(c)}return a}vectorizeAndBroadcastArgumentsIfNecessary(e,t,r,n,s){return t.map(((t,o)=>e&&this.isRangePassedAsAScalarArgument(t,r[o])?this.vectorizeAndBroadcastRangeArgument(t,n,s):t))}vectorizeAndBroadcastRangeArgument(e,t,r){var n;const s=1===e.height()?0:t,o=1===e.width()?0:r;return null===(n=e.data[s])||void 0===n?void 0:n[o]}evaluateArguments(e,t,r){return r.expandRanges?this.listOfScalarValues(e,t):e.map((e=>[this.evaluateAst(e,t),!1]))}buildMetadataForEachArgumentValue(e,t){const 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){if(t>e.length)return!1;if(t<e.length){return e.slice(t).every((e=>(null==e?void 0:e.optionalArg)||void 0!==(null==e?void 0:e.defaultValue)))}return!0}calculateSizeOfVectorizedResultArray(e,t){const 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 h.SimpleRangeValue&&![n.RANGE,n.ANY].includes(t.argumentType))}metadata(e){const t=this.constructor.implementedFunctions[e];if(void 0!==t)return t;throw new Error(`No metadata for function ${e}.`)}returnNumberWrapper(e,t,r){return void 0!==t&&(0,u.isExtendedNumber)(e)?this.arithmeticHelper.ExtendedNumberFactory((0,u.getRawValue)(e),{type:t,format:r}):e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArithmeticHelper:()=>d,coerceBooleanToNumber:()=>f,coerceComplexToString:()=>p,coerceEmptyToValue:()=>y,coerceRangeToScalar:()=>I,coerceScalarToBoolean:()=>E,coerceScalarToString:()=>C,coerceToRange:()=>g,coerceToRangeNumbersOrError:()=>m,fixNegativeZero:()=>S,forceNormalizeString:()=>b,isNumberOverflow:()=>w,normalizeString:()=>_,numberCmp:()=>R,zeroIfEmpty:()=>T});var n=r(96),s=r.n(n),o=r(3),i=r(61),a=r(97),l=r(70),u=r(69);const h="i",c=/^\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij]))\s*(([+-])\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij])))?$/;class d{constructor(e,t,r){this.config=e,this.dateTimeHelper=t,this.numberLiteralsHelper=r,this.lt=(e,t)=>this.compare(e,t)<0,this.leq=(e,t)=>this.compare(e,t)<=0,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,l.getRawValue)(e),(0,l.getRawValue)(t)),this.addWithEpsilonRaw=(e,t)=>{const r=e+t;return Math.abs(r)<this.actualEps*Math.abs(e)?0:r},this.addWithEpsilon=(e,t)=>{const r=O(e,t);return this.ExtendedNumberFactory(this.addWithEpsilonRaw((0,l.getRawValue)(e),(0,l.getRawValue)(t)),r)},this.unaryMinus=e=>(0,l.cloneNumber)(e,-(0,l.getRawValue)(e)),this.unaryPlus=e=>e,this.unaryPercent=e=>new l.PercentNumber((0,l.getRawValue)(e)/100),this.concat=(e,t)=>e.concat(t),this.nonstrictadd=(e,t)=>e instanceof o.CellError?e:t instanceof o.CellError?t:"number"==typeof e?"number"==typeof t?this.addWithEpsilonRaw(e,t):e:"number"==typeof t?t:0,this.subtract=(e,t)=>{const r=O(e,t),n=(0,l.getRawValue)(e);let s=n-(0,l.getRawValue)(t);return Math.abs(s)<this.actualEps*Math.abs(n)&&(s=0),this.ExtendedNumberFactory(s,r)},this.divide=(e,t)=>{const r=(0,l.getRawValue)(e),n=(0,l.getRawValue)(t);if(0===n)return new o.CellError(o.ErrorType.DIV_BY_ZERO);{const s=M(e,t);return this.ExtendedNumberFactory(r/n,s)}},this.multiply=(e,t)=>{const r=M(e,t);return this.ExtendedNumberFactory((0,l.getRawValue)(e)*(0,l.getRawValue)(t),r)},this.manyToExactComplex=e=>{const t=[];for(const r of e){if(r instanceof o.CellError)return r;if((0,l.isExtendedNumber)(r)||"string"==typeof r){const e=this.coerceScalarToComplex(r);e instanceof o.CellError||t.push(e)}}return t},this.coerceNumbersExactRanges=e=>this.manyToNumbers(e,this.manyToExactNumbers),this.coerceNumbersCoerceRangesDropNulls=e=>this.manyToNumbers(e,this.manyToCoercedNumbersDropNulls),this.manyToExactNumbers=e=>{const t=[];for(const r of e){if(r instanceof o.CellError)return r;(0,l.isExtendedNumber)(r)&&t.push((0,l.getRawValue)(r))}return t},this.manyToOnlyNumbersDropNulls=e=>{const t=[];for(const r of e){if(r instanceof o.CellError)return r;if((0,l.isExtendedNumber)(r))t.push((0,l.getRawValue)(r));else if(r!==l.EmptyValue)return new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.NumberExpected)}return t},this.manyToCoercedNumbersDropNulls=e=>{const t=[];for(const r of e){if(r instanceof o.CellError)return r;if(r===l.EmptyValue)continue;const e=this.coerceScalarToNumberOrError(r);(0,l.isExtendedNumber)(e)&&t.push((0,l.getRawValue)(e))}return t},this.collator=(0,a.collatorFromConfig)(e),this.actualEps=e.smartRounding?e.precisionEpsilon:0}eqMatcherFunction(e){const t=this.buildRegex(e);return e=>"string"==typeof e&&t.test(this.normalizeString(e))}neqMatcherFunction(e){const t=this.buildRegex(e);return e=>!("string"==typeof e&&t.test(this.normalizeString(e)))}searchString(e,t){var r;const n=this.buildRegex(e,!1).exec(t);return null!==(r=null==n?void 0:n.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++){const r=e.charAt(t);if(v(r)||this.config.useRegularExpressions&&N(r))return!0}return!1}floatCmp(e,t){const r=(0,l.getRawValue)(e),n=(0,l.getRawValue)(t),s=1+this.actualEps;return n>=0&&r*s>=n&&r<=n*s||n<=0&&r*s<=n&&r>=n*s?0:r>n?1:-1}coerceScalarToNumberOrError(e){var t;return e instanceof o.CellError?e:null!==(t=this.coerceToMaybeNumber(e))&&void 0!==t?t:new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.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===l.EmptyValue)return 0;if("string"==typeof e){if(""===e)return 0;const t=this.coerceStringToMaybePercentNumber(e);if(void 0!==t)return t;const r=this.coerceStringToMaybeCurrencyNumber(e);return void 0!==r?r:this.numberLiteralsHelper.numericStringToMaybeNumber(e.trim())}return(0,l.isExtendedNumber)(e)?e:"boolean"==typeof e?Number(e):void 0}coerceStringToMaybePercentNumber(e){const t=e.trim();if(t.endsWith("%")){const e=t.slice(0,t.length-1).trim(),r=this.numberLiteralsHelper.numericStringToMaybeNumber(e);if(void 0!==r)return new l.PercentNumber(r/100)}}coerceStringToMaybeCurrencyNumber(e){const t=this.currencyMatcher(e.trim());if(void 0!==t){const[e,r]=t,n=this.numberLiteralsHelper.numericStringToMaybeNumber(r);if(void 0!==n)return new l.CurrencyNumber(n,e)}}currencyMatcher(e){for(const 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){const t=[];for(const r of e)if(r instanceof u.SimpleRangeValue)t.push(r);else if(r!==l.EmptyValue){const e=this.coerceScalarToComplex(r);if(e instanceof o.CellError)return e;t.push(e)}const r=[];for(const e of t)if(e instanceof u.SimpleRangeValue){const t=this.manyToExactComplex(e.valuesFromTopLeftCorner());if(t instanceof o.CellError)return t;r.push(...t)}else r.push(e);return r}coerceScalarToComplex(e){return e instanceof o.CellError?e:e===l.EmptyValue?[0,0]:(0,l.isExtendedNumber)(e)?[(0,l.getRawValue)(e),0]:"string"==typeof e?this.coerceStringToComplex(e):new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ComplexNumberExpected)}ExtendedNumberFactory(e,t){const{type:r,format:n}=t;switch(r){case l.NumberType.NUMBER_RAW:return e;case l.NumberType.NUMBER_CURRENCY:return new l.CurrencyNumber(e,null!=n?n:this.config.currencySymbol[0]);case l.NumberType.NUMBER_DATE:return new l.DateNumber(e,n);case l.NumberType.NUMBER_DATETIME:return new l.DateTimeNumber(e,n);case l.NumberType.NUMBER_TIME:return new l.TimeNumber(e,n);case l.NumberType.NUMBER_PERCENT:return new l.PercentNumber(e,n)}}buildRegex(e,t=!0){let r;e=this.normalizeString(e);let n=this.config.useWildcards,s=this.config.useRegularExpressions;if(s)try{RegExp(e)}catch(e){s=!1,n=!1}return r=s?function(e,t){let r="";for(let n=0;n<e.length;n++){const s=e.charAt(n);v(s)||N(s)?r+=s:r+=t?s:s.toLowerCase()}return r}(e,this.config.caseSensitive):n?function(e,t){let r="";for(let n=0;n<e.length;n++){const s=e.charAt(n);if("~"===s){if(n==e.length-1){r+="~";continue}const t=e.charAt(n+1);v(t)||N(t)?(r+="\\"+t,n++):(r+=t,n++)}else v(s)?r+="."+s:N(s)?r+="\\"+s:r+=t?s:s.toLowerCase()}return r}(e,this.config.caseSensitive):function(e,t){let r="";for(let n=0;n<e.length;n++){const s=e.charAt(n);v(s)||N(s)?r+="\\"+s:r+=t?s:s.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=_(e,"nfd").replace(/[\u0300-\u036f]/g,"")),e}compare(e,t){if("string"==typeof e||"string"==typeof t){const r="string"==typeof e?this.dateTimeHelper.dateStringToDateNumber(e):e,n="string"==typeof t?this.dateTimeHelper.dateStringToDateNumber(t):t;if((0,l.isExtendedNumber)(r)&&(0,l.isExtendedNumber)(n))return this.floatCmp(r,n)}return e===l.EmptyValue?e=y(t):t===l.EmptyValue&&(t=y(e)),"string"==typeof e&&"string"==typeof t?this.stringCmp(e,t):"boolean"==typeof e&&"boolean"==typeof t?R(f(e),f(t)):(0,l.isExtendedNumber)(e)&&(0,l.isExtendedNumber)(t)?this.floatCmp(e,t):e===l.EmptyValue&&t===l.EmptyValue?0:R((0,o.CellValueTypeOrd)((0,o.getCellValueType)(e)),(0,o.CellValueTypeOrd)((0,o.getCellValueType)(t)))}stringCmp(e,t){return this.collator.compare(e,t)}manyToNumbers(e,t){const r=[];for(const t of e)if(t instanceof u.SimpleRangeValue)r.push(t);else{const e=(0,l.getRawValue)(this.coerceScalarToNumberOrError(t));if(e instanceof o.CellError)return e;r.push(e)}const n=[];for(const e of r)if(e instanceof u.SimpleRangeValue){const r=t(e.valuesFromTopLeftCorner());if(r instanceof o.CellError)return r;n.push(...r)}else n.push(e);return n}coerceStringToComplex(e){const t=c.exec(e);if(null===t)return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ComplexNumberExpected);let r,n;return r=void 0!==t[6]?"-"===t[1]?[0,-1]:[0,1]:this.parseComplexToken(t[1]+t[3],t[5]),r instanceof o.CellError||void 0===t[8]?r:(n=void 0!==t[14]?"-"===t[9]?[0,-1]:[0,1]:this.parseComplexToken(t[9]+t[11],t[13]),n instanceof o.CellError?n:""!==t[5]||""===t[13]?new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ComplexNumberExpected):"+"===t[8]?[r[0]+n[0],r[1]+n[1]]:[r[0]-n[0],r[1]-n[1]])}parseComplexToken(e,t){const r=(0,l.getRawValue)(this.coerceNonDateScalarToMaybeNumber(e));return void 0===r?new o.CellError(o.ErrorType.NUM,i.ErrorMessage.ComplexNumberExpected):""===t?[r,0]:[0,r]}}function p([e,t],r){if(!isFinite(e)||!isFinite(t))return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.NaN);if(r=null!=r?r:h,0===t)return`${e}`;const n=`${-1===t||1===t?"":Math.abs(t)}${r}`;return 0===e?`${t<0?"-":""}${n}`:`${e}${t<0?"-":"+"}${n}`}function g(e){return e instanceof u.SimpleRangeValue?e:u.SimpleRangeValue.fromScalar(e)}function m(e){return e instanceof u.SimpleRangeValue&&e.hasOnlyNumbers()||e instanceof o.CellError?e:(0,l.isExtendedNumber)(e)?u.SimpleRangeValue.fromScalar(e):null}function f(e){return Number(e)}function y(e){return"string"==typeof e?"":(0,l.isExtendedNumber)(e)?0:"boolean"!=typeof e&&l.EmptyValue}function E(e){if(e instanceof o.CellError||"boolean"==typeof e)return e;if(e===l.EmptyValue)return!1;if((0,l.isExtendedNumber)(e))return 0!==(0,l.getRawValue)(e);{const t=e.toUpperCase();return"TRUE"===t||"FALSE"!==t&&(""!==t&&void 0)}}function C(e){return e instanceof o.CellError||"string"==typeof e?e:e===l.EmptyValue?"":(0,l.isExtendedNumber)(e)?(0,l.getRawValue)(e).toString():e?"TRUE":"FALSE"}function T(e){return e===l.EmptyValue?0:e}function R(e,t){const r=(0,l.getRawValue)(e),n=(0,l.getRawValue)(t);return r>n?1:r<n?-1:0}function w(e){return isNaN(e)||e===1/0||e===-1/0}function S(e){return 0===e?0:e}function v(e){return["*","?"].includes(e)}const A=["{","}","[","]","(",")","<",">","=",".","+","-",",","\\","$","^","!"];function N(e){return A.includes(e)}function O(e,t){const{type:r,format:n}=(0,l.getTypeFormatOfExtendedNumber)(e),{type:s,format:o}=(0,l.getTypeFormatOfExtendedNumber)(t);if(r===l.NumberType.NUMBER_RAW)return{type:s,format:o};if(s===l.NumberType.NUMBER_RAW)return{type:r,format:n};if(!(r!==l.NumberType.NUMBER_DATETIME&&r!==l.NumberType.NUMBER_DATE||s!==l.NumberType.NUMBER_DATETIME&&s!==l.NumberType.NUMBER_DATE))return{type:l.NumberType.NUMBER_RAW};if(r===l.NumberType.NUMBER_TIME){if(s===l.NumberType.NUMBER_DATE)return{type:l.NumberType.NUMBER_DATETIME,format:`${o} ${n}`};if(s===l.NumberType.NUMBER_DATETIME)return{type:l.NumberType.NUMBER_DATETIME,format:o}}if(s===l.NumberType.NUMBER_TIME){if(r===l.NumberType.NUMBER_DATE)return{type:l.NumberType.NUMBER_DATETIME,format:`${n} ${o}`};if(r===l.NumberType.NUMBER_DATETIME)return{type:l.NumberType.NUMBER_DATETIME,format:n}}return{type:r,format:n}}function M(e,t){let{type:r,format:n}=(0,l.getTypeFormatOfExtendedNumber)(e),{type:s,format:o}=(0,l.getTypeFormatOfExtendedNumber)(t);return r===l.NumberType.NUMBER_PERCENT&&(r=l.NumberType.NUMBER_RAW,n=void 0),s===l.NumberType.NUMBER_PERCENT&&(s=l.NumberType.NUMBER_RAW,o=void 0),r===l.NumberType.NUMBER_RAW?{type:s,format:o}:s===l.NumberType.NUMBER_RAW?{type:r,format:n}:{type:l.NumberType.NUMBER_RAW}}function b(e){return _(e.toLowerCase(),"nfd").replace(/[\u0300-\u036f]/g,"")}function I(e,t){var r;if(e.isAdHoc())return null===(r=e.data[0])||void 0===r?void 0:r[0];const n=e.range;if(t.formulaAddress.sheet===n.sheet)if(1===n.width()){const r=t.formulaAddress.row-n.start.row;if(r>=0&&r<n.height())return e.data[r][0]}else if(1===n.height()){const r=t.formulaAddress.col-n.start.col;if(r>=0&&r<n.width())return e.data[0][r]}}function _(e,t){return"function"==typeof e.normalize?e.normalize(t.toUpperCase()):s()[t](e)}},function(e){!function(t){"use strict";for(var r=[null,0,{}],n=44032,s=4352,o=function(e,t){this.codepoint=e,this.feature=t},i={},a=[],l=0;l<=255;++l)a[l]=0;var u=[function(e,t,n){return t<60||13311<t&&t<42607?new o(t,r):e(t,n)},function(e,t,r){var n=i[t];return n||(n=e(t,r)).feature&&++a[t>>8&255]>10&&(i[t]=n),n},function(e,t,r){return r?e(t,r):new o(t,null)},function(e,t,r){var i;if(t<s||4371<=t&&t<n||55204<t)return e(t,r);if(s<=t&&t<4371){var a={},l=21*(t-s);for(i=0;i<21;++i)a[4449+i]=n+28*(i+l);return new o(t,[,,a])}var u=t-n,h=u%28,c=[];if(0!==h)c[0]=[n+u-h,4519+h];else for(c[0]=[s+Math.floor(u/588),4449+Math.floor(u%588/28)],c[2]={},i=1;i<28;++i)c[2][4519+i]=t+i;return new o(t,c)},function(e,t,n){var s=(o.udata[65280&t]||{})[t];return new o(t,s||r)}];o.fromCharCode=u.reduceRight((function(e,t){return function(r,n){return t(e,r,n)}}),null),o.isHighSurrogate=function(e){return e>=55296&&e<=56319},o.isLowSurrogate=function(e){return e>=56320&&e<=57343},o.prototype.prepFeature=function(){this.feature||(this.feature=o.fromCharCode(this.codepoint,!0).feature)},o.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var e=this.codepoint-65536;return String.fromCharCode(Math.floor(e/1024)+55296,e%1024+56320)},o.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},o.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},o.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},o.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},o.prototype.getComposite=function(e){if(this.prepFeature(),!this.feature[2])return null;var t=this.feature[2][e.codepoint];return t?o.fromCharCode(t):null};var h=function(e){this.str=e,this.cursor=0};h.prototype.next=function(){if(this.str&&this.cursor<this.str.length){var e,t=this.str.charCodeAt(this.cursor++);return o.isHighSurrogate(t)&&this.cursor<this.str.length&&o.isLowSurrogate(e=this.str.charCodeAt(this.cursor))&&(t=1024*(t-55296)+(e-56320)+65536,++this.cursor),o.fromCharCode(t)}return this.str=null,null};var c=function(e,t){this.it=e,this.canonical=t,this.resBuf=[]};c.prototype.next=function(){if(0===this.resBuf.length){var e=this.it.next();if(!e)return null;this.resBuf=function e(t,r){var n=r.getDecomp();if(!n||t&&r.isCompatibility())return[r];for(var s=[],i=0;i<n.length;++i){var a=e(t,o.fromCharCode(n[i]));s=s.concat(a)}return s}(this.canonical,e)}return this.resBuf.shift()};var d=function(e){this.it=e,this.resBuf=[]};d.prototype.next=function(){var e;if(0===this.resBuf.length)do{var t=this.it.next();if(!t)break;e=t.getCanonicalClass();var r=this.resBuf.length;if(0!==e)for(;r>0;--r){if(this.resBuf[r-1].getCanonicalClass()<=e)break}this.resBuf.splice(r,0,t)}while(0!==e);return this.resBuf.shift()};var p=function(e){this.it=e,this.procBuf=[],this.resBuf=[],this.lastClass=null};p.prototype.next=function(){for(;0===this.resBuf.length;){var e=this.it.next();if(!e){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=e.getCanonicalClass(),this.procBuf.push(e);else{var t=this.procBuf[0].getComposite(e),r=e.getCanonicalClass();t&&(this.lastClass<r||0===this.lastClass)?this.procBuf[0]=t:(0===r&&(this.resBuf=this.procBuf,this.procBuf=[]),this.lastClass=r,this.procBuf.push(e))}}return this.resBuf.shift()};var g=function(e,t){for(var r,n=function(e,t){switch(e){case"NFD":return new d(new c(new h(t),!0));case"NFKD":return new d(new c(new h(t),!1));case"NFC":return new p(new d(new c(new h(t),!0)));case"NFKC":return new p(new d(new c(new h(t),!1)))}throw e+" is invalid"}(e,t),s="";r=n.next();)s+=r.toString();return s};o.udata={0:{60:[,,{824:8814}],61:[,,{824:8800}],62:[,,{824:8815}],65:[,,{768:192,769:193,770:194,771:195,772:256,774:258,775:550,776:196,777:7842,778:197,780:461,783:512,785:514,803:7840,805:7680,808:260}],66:[,,{775:7682,803:7684,817:7686}],67:[,,{769:262,770:264,775:266,780:268,807:199}],68:[,,{775:7690,780:270,803:7692,807:7696,813:7698,817:7694}],69:[,,{768:200,769:201,770:202,771:7868,772:274,774:276,775:278,776:203,777:7866,780:282,783:516,785:518,803:7864,807:552,808:280,813:7704,816:7706}],70:[,,{775:7710}],71:[,,{769:500,770:284,772:7712,774:286,775:288,780:486,807:290}],72:[,,{770:292,775:7714,776:7718,780:542,803:7716,807:7720,814:7722}],73:[,,{768:204,769:205,770:206,771:296,772:298,774:300,775:304,776:207,777:7880,780:463,783:520,785:522,803:7882,808:302,816:7724}],74:[,,{770:308}],75:[,,{769:7728,780:488,803:7730,807:310,817:7732}],76:[,,{769:313,780:317,803:7734,807:315,813:7740,817:7738}],77:[,,{769:7742,775:7744,803:7746}],78:[,,{768:504,769:323,771:209,775:7748,780:327,803:7750,807:325,813:7754,817:7752}],79:[,,{768:210,769:211,770:212,771:213,772:332,774:334,775:558,776:214,777:7886,779:336,780:465,783:524,785:526,795:416,803:7884,808:490}],80:[,,{769:7764,775:7766}],82:[,,{769:340,775:7768,780:344,783:528,785:530,803:7770,807:342,817:7774}],83:[,,{769:346,770:348,775:7776,780:352,803:7778,806:536,807:350}],84:[,,{775:7786,780:356,803:7788,806:538,807:354,813:7792,817:7790}],85:[,,{768:217,769:218,770:219,771:360,772:362,774:364,776:220,777:7910,778:366,779:368,780:467,783:532,785:534,795:431,803:7908,804:7794,808:370,813:7798,816:7796}],86:[,,{771:7804,803:7806}],87:[,,{768:7808,769:7810,770:372,775:7814,776:7812,803:7816}],88:[,,{775:7818,776:7820}],89:[,,{768:7922,769:221,770:374,771:7928,772:562,775:7822,776:376,777:7926,803:7924}],90:[,,{769:377,770:7824,775:379,780:381,803:7826,817:7828}],97:[,,{768:224,769:225,770:226,771:227,772:257,774:259,775:551,776:228,777:7843,778:229,780:462,783:513,785:515,803:7841,805:7681,808:261}],98:[,,{775:7683,803:7685,817:7687}],99:[,,{769:263,770:265,775:267,780:269,807:231}],100:[,,{775:7691,780:271,803:7693,807:7697,813:7699,817:7695}],101:[,,{768:232,769:233,770:234,771:7869,772:275,774:277,775:279,776:235,777:7867,780:283,783:517,785:519,803:7865,807:553,808:281,813:7705,816:7707}],102:[,,{775:7711}],103:[,,{769:501,770:285,772:7713,774:287,775:289,780:487,807:291}],104:[,,{770:293,775:7715,776:7719,780:543,803:7717,807:7721,814:7723,817:7830}],105:[,,{768:236,769:237,770:238,771:297,772:299,774:301,776:239,777:7881,780:464,783:521,785:523,803:7883,808:303,816:7725}],106:[,,{770:309,780:496}],107:[,,{769:7729,780:489,803:7731,807:311,817:7733}],108:[,,{769:314,780:318,803:7735,807:316,813:7741,817:7739}],109:[,,{769:7743,775:7745,803:7747}],110:[,,{768:505,769:324,771:241,775:7749,780:328,803:7751,807:326,813:7755,817:7753}],111:[,,{768:242,769:243,770:244,771:245,772:333,774:335,775:559,776:246,777:7887,779:337,780:466,783:525,785:527,795:417,803:7885,808:491}],112:[,,{769:7765,775:7767}],114:[,,{769:341,775:7769,780:345,783:529,785:531,803:7771,807:343,817:7775}],115:[,,{769:347,770:349,775:7777,780:353,803:7779,806:537,807:351}],116:[,,{775:7787,776:7831,780:357,803:7789,806:539,807:355,813:7793,817:7791}],117:[,,{768:249,769:250,770:251,771:361,772:363,774:365,776:252,777:7911,778:367,779:369,780:468,783:533,785:535,795:432,803:7909,804:7795,808:371,813:7799,816:7797}],118:[,,{771:7805,803:7807}],119:[,,{768:7809,769:7811,770:373,775:7815,776:7813,778:7832,803:7817}],120:[,,{775:7819,776:7821}],121:[,,{768:7923,769:253,770:375,771:7929,772:563,775:7823,776:255,777:7927,778:7833,803:7925}],122:[,,{769:378,770:7825,775:380,780:382,803:7827,817:7829}],160:[[32],256],168:[[32,776],256,{768:8173,769:901,834:8129}],170:[[97],256],175:[[32,772],256],178:[[50],256],179:[[51],256],180:[[32,769],256],181:[[956],256],184:[[32,807],256],185:[[49],256],186:[[111],256],188:[[49,8260,52],256],189:[[49,8260,50],256],190:[[51,8260,52],256],192:[[65,768]],193:[[65,769]],194:[[65,770],,{768:7846,769:7844,771:7850,777:7848}],195:[[65,771]],196:[[65,776],,{772:478}],197:[[65,778],,{769:506}],198:[,,{769:508,772:482}],199:[[67,807],,{769:7688}],200:[[69,768]],201:[[69,769]],202:[[69,770],,{768:7872,769:7870,771:7876,777:7874}],203:[[69,776]],204:[[73,768]],205:[[73,769]],206:[[73,770]],207:[[73,776],,{769:7726}],209:[[78,771]],210:[[79,768]],211:[[79,769]],212:[[79,770],,{768:7890,769:7888,771:7894,777:7892}],213:[[79,771],,{769:7756,772:556,776:7758}],214:[[79,776],,{772:554}],216:[,,{769:510}],217:[[85,768]],218:[[85,769]],219:[[85,770]],220:[[85,776],,{768:475,769:471,772:469,780:473}],221:[[89,769]],224:[[97,768]],225:[[97,769]],226:[[97,770],,{768:7847,769:7845,771:7851,777:7849}],227:[[97,771]],228:[[97,776],,{772:479}],229:[[97,778],,{769:507}],230:[,,{769:509,772:483}],231:[[99,807],,{769:7689}],232:[[101,768]],233:[[101,769]],234:[[101,770],,{768:7873,769:7871,771:7877,777:7875}],235:[[101,776]],236:[[105,768]],237:[[105,769]],238:[[105,770]],239:[[105,776],,{769:7727}],241:[[110,771]],242:[[111,768]],243:[[111,769]],244:[[111,770],,{768:7891,769:7889,771:7895,777:7893}],245:[[111,771],,{769:7757,772:557,776:7759}],246:[[111,776],,{772:555}],248:[,,{769:511}],249:[[117,768]],250:[[117,769]],251:[[117,770]],252:[[117,776],,{768:476,769:472,772:470,780:474}],253:[[121,769]],255:[[121,776]]},256:{256:[[65,772]],257:[[97,772]],258:[[65,774],,{768:7856,769:7854,771:7860,777:7858}],259:[[97,774],,{768:7857,769:7855,771:7861,777:7859}],260:[[65,808]],261:[[97,808]],262:[[67,769]],263:[[99,769]],264:[[67,770]],265:[[99,770]],266:[[67,775]],267:[[99,775]],268:[[67,780]],269:[[99,780]],270:[[68,780]],271:[[100,780]],274:[[69,772],,{768:7700,769:7702}],275:[[101,772],,{768:7701,769:7703}],276:[[69,774]],277:[[101,774]],278:[[69,775]],279:[[101,775]],280:[[69,808]],281:[[101,808]],282:[[69,780]],283:[[101,780]],284:[[71,770]],285:[[103,770]],286:[[71,774]],287:[[103,774]],288:[[71,775]],289:[[103,775]],290:[[71,807]],291:[[103,807]],292:[[72,770]],293:[[104,770]],296:[[73,771]],297:[[105,771]],298:[[73,772]],299:[[105,772]],300:[[73,774]],301:[[105,774]],302:[[73,808]],303:[[105,808]],304:[[73,775]],306:[[73,74],256],307:[[105,106],256],308:[[74,770]],309:[[106,770]],310:[[75,807]],311:[[107,807]],313:[[76,769]],314:[[108,769]],315:[[76,807]],316:[[108,807]],317:[[76,780]],318:[[108,780]],319:[[76,183],256],320:[[108,183],256],323:[[78,769]],324:[[110,769]],325:[[78,807]],326:[[110,807]],327:[[78,780]],328:[[110,780]],329:[[700,110],256],332:[[79,772],,{768:7760,769:7762}],333:[[111,772],,{768:7761,769:7763}],334:[[79,774]],335:[[111,774]],336:[[79,779]],337:[[111,779]],340:[[82,769]],341:[[114,769]],342:[[82,807]],343:[[114,807]],344:[[82,780]],345:[[114,780]],346:[[83,769],,{775:7780}],347:[[115,769],,{775:7781}],348:[[83,770]],349:[[115,770]],350:[[83,807]],351:[[115,807]],352:[[83,780],,{775:7782}],353:[[115,780],,{775:7783}],354:[[84,807]],355:[[116,807]],356:[[84,780]],357:[[116,780]],360:[[85,771],,{769:7800}],361:[[117,771],,{769:7801}],362:[[85,772],,{776:7802}],363:[[117,772],,{776:7803}],364:[[85,774]],365:[[117,774]],366:[[85,778]],367:[[117,778]],368:[[85,779]],369:[[117,779]],370:[[85,808]],371:[[117,808]],372:[[87,770]],373:[[119,770]],374:[[89,770]],375:[[121,770]],376:[[89,776]],377:[[90,769]],378:[[122,769]],379:[[90,775]],380:[[122,775]],381:[[90,780]],382:[[122,780]],383:[[115],256,{775:7835}],416:[[79,795],,{768:7900,769:7898,771:7904,777:7902,803:7906}],417:[[111,795],,{768:7901,769:7899,771:7905,777:7903,803:7907}],431:[[85,795],,{768:7914,769:7912,771:7918,777:7916,803:7920}],432:[[117,795],,{768:7915,769:7913,771:7919,777:7917,803:7921}],439:[,,{780:494}],452:[[68,381],256],453:[[68,382],256],454:[[100,382],256],455:[[76,74],256],456:[[76,106],256],457:[[108,106],256],458:[[78,74],256],459:[[78,106],256],460:[[110,106],256],461:[[65,780]],462:[[97,780]],463:[[73,780]],464:[[105,780]],465:[[79,780]],466:[[111,780]],467:[[85,780]],468:[[117,780]],469:[[220,772]],470:[[252,772]],471:[[220,769]],472:[[252,769]],473:[[220,780]],474:[[252,780]],475:[[220,768]],476:[[252,768]],478:[[196,772]],479:[[228,772]],480:[[550,772]],481:[[551,772]],482:[[198,772]],483:[[230,772]],486:[[71,780]],487:[[103,780]],488:[[75,780]],489:[[107,780]],490:[[79,808],,{772:492}],491:[[111,808],,{772:493}],492:[[490,772]],493:[[491,772]],494:[[439,780]],495:[[658,780]],496:[[106,780]],497:[[68,90],256],498:[[68,122],256],499:[[100,122],256],500:[[71,769]],501:[[103,769]],504:[[78,768]],505:[[110,768]],506:[[197,769]],507:[[229,769]],508:[[198,769]],509:[[230,769]],510:[[216,769]],511:[[248,769]],66045:[,220]},512:{512:[[65,783]],513:[[97,783]],514:[[65,785]],515:[[97,785]],516:[[69,783]],517:[[101,783]],518:[[69,785]],519:[[101,785]],520:[[73,783]],521:[[105,783]],522:[[73,785]],523:[[105,785]],524:[[79,783]],525:[[111,783]],526:[[79,785]],527:[[111,785]],528:[[82,783]],529:[[114,783]],530:[[82,785]],531:[[114,785]],532:[[85,783]],533:[[117,783]],534:[[85,785]],535:[[117,785]],536:[[83,806]],537:[[115,806]],538:[[84,806]],539:[[116,806]],542:[[72,780]],543:[[104,780]],550:[[65,775],,{772:480}],551:[[97,775],,{772:481}],552:[[69,807],,{774:7708}],553:[[101,807],,{774:7709}],554:[[214,772]],555:[[246,772]],556:[[213,772]],557:[[245,772]],558:[[79,775],,{772:560}],559:[[111,775],,{772:561}],560:[[558,772]],561:[[559,772]],562:[[89,772]],563:[[121,772]],658:[,,{780:495}],688:[[104],256],689:[[614],256],690:[[106],256],691:[[114],256],692:[[633],256],693:[[635],256],694:[[641],256],695:[[119],256],696:[[121],256],728:[[32,774],256],729:[[32,775],256],730:[[32,778],256],731:[[32,808],256],732:[[32,771],256],733:[[32,779],256],736:[[611],256],737:[[108],256],738:[[115],256],739:[[120],256],740:[[661],256],66272:[,220]},768:{768:[,230],769:[,230],770:[,230],771:[,230],772:[,230],773:[,230],774:[,230],775:[,230],776:[,230,{769:836}],777:[,230],778:[,230],779:[,230],780:[,230],781:[,230],782:[,230],783:[,230],784:[,230],785:[,230],786:[,230],787:[,230],788:[,230],789:[,232],790:[,220],791:[,220],792:[,220],793:[,220],794:[,232],795:[,216],796:[,220],797:[,220],798:[,220],799:[,220],800:[,220],801:[,202],802:[,202],803:[,220],804:[,220],805:[,220],806:[,220],807:[,202],808:[,202],809:[,220],810:[,220],811:[,220],812:[,220],813:[,220],814:[,220],815:[,220],816:[,220],817:[,220],818:[,220],819:[,220],820:[,1],821:[,1],822:[,1],823:[,1],824:[,1],825:[,220],826:[,220],827:[,220],828:[,220],829:[,230],830:[,230],831:[,230],832:[[768],230],833:[[769],230],834:[,230],835:[[787],230],836:[[776,769],230],837:[,240],838:[,230],839:[,220],840:[,220],841:[,220],842:[,230],843:[,230],844:[,230],845:[,220],846:[,220],848:[,230],849:[,230],850:[,230],851:[,220],852:[,220],853:[,220],854:[,220],855:[,230],856:[,232],857:[,220],858:[,220],859:[,230],860:[,233],861:[,234],862:[,234],863:[,233],864:[,234],865:[,234],866:[,233],867:[,230],868:[,230],869:[,230],870:[,230],871:[,230],872:[,230],873:[,230],874:[,230],875:[,230],876:[,230],877:[,230],878:[,230],879:[,230],884:[[697]],890:[[32,837],256],894:[[59]],900:[[32,769],256],901:[[168,769]],902:[[913,769]],903:[[183]],904:[[917,769]],905:[[919,769]],906:[[921,769]],908:[[927,769]],910:[[933,769]],911:[[937,769]],912:[[970,769]],913:[,,{768:8122,769:902,772:8121,774:8120,787:7944,788:7945,837:8124}],917:[,,{768:8136,769:904,787:7960,788:7961}],919:[,,{768:8138,769:905,787:7976,788:7977,837:8140}],921:[,,{768:8154,769:906,772:8153,774:8152,776:938,787:7992,788:7993}],927:[,,{768:8184,769:908,787:8008,788:8009}],929:[,,{788:8172}],933:[,,{768:8170,769:910,772:8169,774:8168,776:939,788:8025}],937:[,,{768:8186,769:911,787:8040,788:8041,837:8188}],938:[[921,776]],939:[[933,776]],940:[[945,769],,{837:8116}],941:[[949,769]],942:[[951,769],,{837:8132}],943:[[953,769]],944:[[971,769]],945:[,,{768:8048,769:940,772:8113,774:8112,787:7936,788:7937,834:8118,837:8115}],949:[,,{768:8050,769:941,787:7952,788:7953}],951:[,,{768:8052,769:942,787:7968,788:7969,834:8134,837:8131}],953:[,,{768:8054,769:943,772:8145,774:8144,776:970,787:7984,788:7985,834:8150}],959:[,,{768:8056,769:972,787:8e3,788:8001}],961:[,,{787:8164,788:8165}],965:[,,{768:8058,769:973,772:8161,774:8160,776:971,787:8016,788:8017,834:8166}],969:[,,{768:8060,769:974,787:8032,788:8033,834:8182,837:8179}],970:[[953,776],,{768:8146,769:912,834:8151}],971:[[965,776],,{768:8162,769:944,834:8167}],972:[[959,769]],973:[[965,769]],974:[[969,769],,{837:8180}],976:[[946],256],977:[[952],256],978:[[933],256,{769:979,776:980}],979:[[978,769]],980:[[978,776]],981:[[966],256],982:[[960],256],1008:[[954],256],1009:[[961],256],1010:[[962],256],1012:[[920],256],1013:[[949],256],1017:[[931],256],66422:[,230],66423:[,230],66424:[,230],66425:[,230],66426:[,230]},1024:{1024:[[1045,768]],1025:[[1045,776]],1027:[[1043,769]],1030:[,,{776:1031}],1031:[[1030,776]],1036:[[1050,769]],1037:[[1048,768]],1038:[[1059,774]],1040:[,,{774:1232,776:1234}],1043:[,,{769:1027}],1045:[,,{768:1024,774:1238,776:1025}],1046:[,,{774:1217,776:1244}],1047:[,,{776:1246}],1048:[,,{768:1037,772:1250,774:1049,776:1252}],1049:[[1048,774]],1050:[,,{769:1036}],1054:[,,{776:1254}],1059:[,,{772:1262,774:1038,776:1264,779:1266}],1063:[,,{776:1268}],1067:[,,{776:1272}],1069:[,,{776:1260}],1072:[,,{774:1233,776:1235}],1075:[,,{769:1107}],1077:[,,{768:1104,774:1239,776:1105}],1078:[,,{774:1218,776:1245}],1079:[,,{776:1247}],1080:[,,{768:1117,772:1251,774:1081,776:1253}],1081:[[1080,774]],1082:[,,{769:1116}],1086:[,,{776:1255}],1091:[,,{772:1263,774:1118,776:1265,779:1267}],1095:[,,{776:1269}],1099:[,,{776:1273}],1101:[,,{776:1261}],1104:[[1077,768]],1105:[[1077,776]],1107:[[1075,769]],1110:[,,{776:1111}],1111:[[1110,776]],1116:[[1082,769]],1117:[[1080,768]],1118:[[1091,774]],1140:[,,{783:1142}],1141:[,,{783:1143}],1142:[[1140,783]],1143:[[1141,783]],1155:[,230],1156:[,230],1157:[,230],1158:[,230],1159:[,230],1217:[[1046,774]],1218:[[1078,774]],1232:[[1040,774]],1233:[[1072,774]],1234:[[1040,776]],1235:[[1072,776]],1238:[[1045,774]],1239:[[1077,774]],1240:[,,{776:1242}],1241:[,,{776:1243}],1242:[[1240,776]],1243:[[1241,776]],1244:[[1046,776]],1245:[[1078,776]],1246:[[1047,776]],1247:[[1079,776]],1250:[[1048,772]],1251:[[1080,772]],1252:[[1048,776]],1253:[[1080,776]],1254:[[1054,776]],1255:[[1086,776]],1256:[,,{776:1258}],1257:[,,{776:1259}],1258:[[1256,776]],1259:[[1257,776]],1260:[[1069,776]],1261:[[1101,776]],1262:[[1059,772]],1263:[[1091,772]],1264:[[1059,776]],1265:[[1091,776]],1266:[[1059,779]],1267:[[1091,779]],1268:[[1063,776]],1269:[[1095,776]],1272:[[1067,776]],1273:[[1099,776]]},1280:{1415:[[1381,1410],256],1425:[,220],1426:[,230],1427:[,230],1428:[,230],1429:[,230],1430:[,220],1431:[,230],1432:[,230],1433:[,230],1434:[,222],1435:[,220],1436:[,230],1437:[,230],1438:[,230],1439:[,230],1440:[,230],1441:[,230],1442:[,220],1443:[,220],1444:[,220],1445:[,220],1446:[,220],1447:[,220],1448:[,230],1449:[,230],1450:[,220],1451:[,230],1452:[,230],1453:[,222],1454:[,228],1455:[,230],1456:[,10],1457:[,11],1458:[,12],1459:[,13],1460:[,14],1461:[,15],1462:[,16],1463:[,17],1464:[,18],1465:[,19],1466:[,19],1467:[,20],1468:[,21],1469:[,22],1471:[,23],1473:[,24],1474:[,25],1476:[,230],1477:[,220],1479:[,18]},1536:{1552:[,230],1553:[,230],1554:[,230],1555:[,230],1556:[,230],1557:[,230],1558:[,230],1559:[,230],1560:[,30],1561:[,31],1562:[,32],1570:[[1575,1619]],1571:[[1575,1620]],1572:[[1608,1620]],1573:[[1575,1621]],1574:[[1610,1620]],1575:[,,{1619:1570,1620:1571,1621:1573}],1608:[,,{1620:1572}],1610:[,,{1620:1574}],1611:[,27],1612:[,28],1613:[,29],1614:[,30],1615:[,31],1616:[,32],1617:[,33],1618:[,34],1619:[,230],1620:[,230],1621:[,220],1622:[,220],1623:[,230],1624:[,230],1625:[,230],1626:[,230],1627:[,230],1628:[,220],1629:[,230],1630:[,230],1631:[,220],1648:[,35],1653:[[1575,1652],256],1654:[[1608,1652],256],1655:[[1735,1652],256],1656:[[1610,1652],256],1728:[[1749,1620]],1729:[,,{1620:1730}],1730:[[1729,1620]],1746:[,,{1620:1747}],1747:[[1746,1620]],1749:[,,{1620:1728}],1750:[,230],1751:[,230],1752:[,230],1753:[,230],1754:[,230],1755:[,230],1756:[,230],1759:[,230],1760:[,230],1761:[,230],1762:[,230],1763:[,220],1764:[,230],1767:[,230],1768:[,230],1770:[,220],1771:[,230],1772:[,230],1773:[,220]},1792:{1809:[,36],1840:[,230],1841:[,220],1842:[,230],1843:[,230],1844:[,220],1845:[,230],1846:[,230],1847:[,220],1848:[,220],1849:[,220],1850:[,230],1851:[,220],1852:[,220],1853:[,230],1854:[,220],1855:[,230],1856:[,230],1857:[,230],1858:[,220],1859:[,230],1860:[,220],1861:[,230],1862:[,220],1863:[,230],1864:[,220],1865:[,230],1866:[,230],2027:[,230],2028:[,230],2029:[,230],2030:[,230],2031:[,230],2032:[,230],2033:[,230],2034:[,220],2035:[,230]},2048:{2070:[,230],2071:[,230],2072:[,230],2073:[,230],2075:[,230],2076:[,230],2077:[,230],2078:[,230],2079:[,230],2080:[,230],2081:[,230],2082:[,230],2083:[,230],2085:[,230],2086:[,230],2087:[,230],2089:[,230],2090:[,230],2091:[,230],2092:[,230],2093:[,230],2137:[,220],2138:[,220],2139:[,220],2276:[,230],2277:[,230],2278:[,220],2279:[,230],2280:[,230],2281:[,220],2282:[,230],2283:[,230],2284:[,230],2285:[,220],2286:[,220],2287:[,220],2288:[,27],2289:[,28],2290:[,29],2291:[,230],2292:[,230],2293:[,230],2294:[,220],2295:[,230],2296:[,230],2297:[,220],2298:[,220],2299:[,230],2300:[,230],2301:[,230],2302:[,230],2303:[,230]},2304:{2344:[,,{2364:2345}],2345:[[2344,2364]],2352:[,,{2364:2353}],2353:[[2352,2364]],2355:[,,{2364:2356}],2356:[[2355,2364]],2364:[,7],2381:[,9],2385:[,230],2386:[,220],2387:[,230],2388:[,230],2392:[[2325,2364],512],2393:[[2326,2364],512],2394:[[2327,2364],512],2395:[[2332,2364],512],2396:[[2337,2364],512],2397:[[2338,2364],512],2398:[[2347,2364],512],2399:[[2351,2364],512],2492:[,7],2503:[,,{2494:2507,2519:2508}],2507:[[2503,2494]],2508:[[2503,2519]],2509:[,9],2524:[[2465,2492],512],2525:[[2466,2492],512],2527:[[2479,2492],512]},2560:{2611:[[2610,2620],512],2614:[[2616,2620],512],2620:[,7],2637:[,9],2649:[[2582,2620],512],2650:[[2583,2620],512],2651:[[2588,2620],512],2654:[[2603,2620],512],2748:[,7],2765:[,9],68109:[,220],68111:[,230],68152:[,230],68153:[,1],68154:[,220],68159:[,9],68325:[,230],68326:[,220]},2816:{2876:[,7],2887:[,,{2878:2891,2902:2888,2903:2892}],2888:[[2887,2902]],2891:[[2887,2878]],2892:[[2887,2903]],2893:[,9],2908:[[2849,2876],512],2909:[[2850,2876],512],2962:[,,{3031:2964}],2964:[[2962,3031]],3014:[,,{3006:3018,3031:3020}],3015:[,,{3006:3019}],3018:[[3014,3006]],3019:[[3015,3006]],3020:[[3014,3031]],3021:[,9]},3072:{3142:[,,{3158:3144}],3144:[[3142,3158]],3149:[,9],3157:[,84],3158:[,91],3260:[,7],3263:[,,{3285:3264}],3264:[[3263,3285]],3270:[,,{3266:3274,3285:3271,3286:3272}],3271:[[3270,3285]],3272:[[3270,3286]],3274:[[3270,3266],,{3285:3275}],3275:[[3274,3285]],3277:[,9]},3328:{3398:[,,{3390:3402,3415:3404}],3399:[,,{3390:3403}],3402:[[3398,3390]],3403:[[3399,3390]],3404:[[3398,3415]],3405:[,9],3530:[,9],3545:[,,{3530:3546,3535:3548,3551:3550}],3546:[[3545,3530]],3548:[[3545,3535],,{3530:3549}],3549:[[3548,3530]],3550:[[3545,3551]]},3584:{3635:[[3661,3634],256],3640:[,103],3641:[,103],3642:[,9],3656:[,107],3657:[,107],3658:[,107],3659:[,107],3763:[[3789,3762],256],3768:[,118],3769:[,118],3784:[,122],3785:[,122],3786:[,122],3787:[,122],3804:[[3755,3737],256],3805:[[3755,3745],256]},3840:{3852:[[3851],256],3864:[,220],3865:[,220],3893:[,220],3895:[,220],3897:[,216],3907:[[3906,4023],512],3917:[[3916,4023],512],3922:[[3921,4023],512],3927:[[3926,4023],512],3932:[[3931,4023],512],3945:[[3904,4021],512],3953:[,129],3954:[,130],3955:[[3953,3954],512],3956:[,132],3957:[[3953,3956],512],3958:[[4018,3968],512],3959:[[4018,3969],256],3960:[[4019,3968],512],3961:[[4019,3969],256],3962:[,130],3963:[,130],3964:[,130],3965:[,130],3968:[,130],3969:[[3953,3968],512],3970:[,230],3971:[,230],3972:[,9],3974:[,230],3975:[,230],3987:[[3986,4023],512],3997:[[3996,4023],512],4002:[[4001,4023],512],4007:[[4006,4023],512],4012:[[4011,4023],512],4025:[[3984,4021],512],4038:[,220]},4096:{4133:[,,{4142:4134}],4134:[[4133,4142]],4151:[,7],4153:[,9],4154:[,9],4237:[,220],4348:[[4316],256],69702:[,9],69759:[,9],69785:[,,{69818:69786}],69786:[[69785,69818]],69787:[,,{69818:69788}],69788:[[69787,69818]],69797:[,,{69818:69803}],69803:[[69797,69818]],69817:[,9],69818:[,7]},4352:{69888:[,230],69889:[,230],69890:[,230],69934:[[69937,69927]],69935:[[69938,69927]],69937:[,,{69927:69934}],69938:[,,{69927:69935}],69939:[,9],69940:[,9],70003:[,7],70080:[,9]},4608:{70197:[,9],70198:[,7],70377:[,7],70378:[,9]},4864:{4957:[,230],4958:[,230],4959:[,230],70460:[,7],70471:[,,{70462:70475,70487:70476}],70475:[[70471,70462]],70476:[[70471,70487]],70477:[,9],70502:[,230],70503:[,230],70504:[,230],70505:[,230],70506:[,230],70507:[,230],70508:[,230],70512:[,230],70513:[,230],70514:[,230],70515:[,230],70516:[,230]},5120:{70841:[,,{70832:70844,70842:70843,70845:70846}],70843:[[70841,70842]],70844:[[70841,70832]],70846:[[70841,70845]],70850:[,9],70851:[,7]},5376:{71096:[,,{71087:71098}],71097:[,,{71087:71099}],71098:[[71096,71087]],71099:[[71097,71087]],71103:[,9],71104:[,7]},5632:{71231:[,9],71350:[,9],71351:[,7]},5888:{5908:[,9],5940:[,9],6098:[,9],6109:[,230]},6144:{6313:[,228]},6400:{6457:[,222],6458:[,230],6459:[,220]},6656:{6679:[,230],6680:[,220],6752:[,9],6773:[,230],6774:[,230],6775:[,230],6776:[,230],6777:[,230],6778:[,230],6779:[,230],6780:[,230],6783:[,220],6832:[,230],6833:[,230],6834:[,230],6835:[,230],6836:[,230],6837:[,220],6838:[,220],6839:[,220],6840:[,220],6841:[,220],6842:[,220],6843:[,230],6844:[,230],6845:[,220]},6912:{6917:[,,{6965:6918}],6918:[[6917,6965]],6919:[,,{6965:6920}],6920:[[6919,6965]],6921:[,,{6965:6922}],6922:[[6921,6965]],6923:[,,{6965:6924}],6924:[[6923,6965]],6925:[,,{6965:6926}],6926:[[6925,6965]],6929:[,,{6965:6930}],6930:[[6929,6965]],6964:[,7],6970:[,,{6965:6971}],6971:[[6970,6965]],6972:[,,{6965:6973}],6973:[[6972,6965]],6974:[,,{6965:6976}],6975:[,,{6965:6977}],6976:[[6974,6965]],6977:[[6975,6965]],6978:[,,{6965:6979}],6979:[[6978,6965]],6980:[,9],7019:[,230],7020:[,220],7021:[,230],7022:[,230],7023:[,230],7024:[,230],7025:[,230],7026:[,230],7027:[,230],7082:[,9],7083:[,9],7142:[,7],7154:[,9],7155:[,9]},7168:{7223:[,7],7376:[,230],7377:[,230],7378:[,230],7380:[,1],7381:[,220],7382:[,220],7383:[,220],7384:[,220],7385:[,220],7386:[,230],7387:[,230],7388:[,220],7389:[,220],7390:[,220],7391:[,220],7392:[,230],7394:[,1],7395:[,1],7396:[,1],7397:[,1],7398:[,1],7399:[,1],7400:[,1],7405:[,220],7412:[,230],7416:[,230],7417:[,230]},7424:{7468:[[65],256],7469:[[198],256],7470:[[66],256],7472:[[68],256],7473:[[69],256],7474:[[398],256],7475:[[71],256],7476:[[72],256],7477:[[73],256],7478:[[74],256],7479:[[75],256],7480:[[76],256],7481:[[77],256],7482:[[78],256],7484:[[79],256],7485:[[546],256],7486:[[80],256],7487:[[82],256],7488:[[84],256],7489:[[85],256],7490:[[87],256],7491:[[97],256],7492:[[592],256],7493:[[593],256],7494:[[7426],256],7495:[[98],256],7496:[[100],256],7497:[[101],256],7498:[[601],256],7499:[[603],256],7500:[[604],256],7501:[[103],256],7503:[[107],256],7504:[[109],256],7505:[[331],256],7506:[[111],256],7507:[[596],256],7508:[[7446],256],7509:[[7447],256],7510:[[112],256],7511:[[116],256],7512:[[117],256],7513:[[7453],256],7514:[[623],256],7515:[[118],256],7516:[[7461],256],7517:[[946],256],7518:[[947],256],7519:[[948],256],7520:[[966],256],7521:[[967],256],7522:[[105],256],7523:[[114],256],7524:[[117],256],7525:[[118],256],7526:[[946],256],7527:[[947],256],7528:[[961],256],7529:[[966],256],7530:[[967],256],7544:[[1085],256],7579:[[594],256],7580:[[99],256],7581:[[597],256],7582:[[240],256],7583:[[604],256],7584:[[102],256],7585:[[607],256],7586:[[609],256],7587:[[613],256],7588:[[616],256],7589:[[617],256],7590:[[618],256],7591:[[7547],256],7592:[[669],256],7593:[[621],256],7594:[[7557],256],7595:[[671],256],7596:[[625],256],7597:[[624],256],7598:[[626],256],7599:[[627],256],7600:[[628],256],7601:[[629],256],7602:[[632],256],7603:[[642],256],7604:[[643],256],7605:[[427],256],7606:[[649],256],7607:[[650],256],7608:[[7452],256],7609:[[651],256],7610:[[652],256],7611:[[122],256],7612:[[656],256],7613:[[657],256],7614:[[658],256],7615:[[952],256],7616:[,230],7617:[,230],7618:[,220],7619:[,230],7620:[,230],7621:[,230],7622:[,230],7623:[,230],7624:[,230],7625:[,230],7626:[,220],7627:[,230],7628:[,230],7629:[,234],7630:[,214],7631:[,220],7632:[,202],7633:[,230],7634:[,230],7635:[,230],7636:[,230],7637:[,230],7638:[,230],7639:[,230],7640:[,230],7641:[,230],7642:[,230],7643:[,230],7644:[,230],7645:[,230],7646:[,230],7647:[,230],7648:[,230],7649:[,230],7650:[,230],7651:[,230],7652:[,230],7653:[,230],7654:[,230],7655:[,230],7656:[,230],7657:[,230],7658:[,230],7659:[,230],7660:[,230],7661:[,230],7662:[,230],7663:[,230],7664:[,230],7665:[,230],7666:[,230],7667:[,230],7668:[,230],7669:[,230],7676:[,233],7677:[,220],7678:[,230],7679:[,220]},7680:{7680:[[65,805]],7681:[[97,805]],7682:[[66,775]],7683:[[98,775]],7684:[[66,803]],7685:[[98,803]],7686:[[66,817]],7687:[[98,817]],7688:[[199,769]],7689:[[231,769]],7690:[[68,775]],7691:[[100,775]],7692:[[68,803]],7693:[[100,803]],7694:[[68,817]],7695:[[100,817]],7696:[[68,807]],7697:[[100,807]],7698:[[68,813]],7699:[[100,813]],7700:[[274,768]],7701:[[275,768]],7702:[[274,769]],7703:[[275,769]],7704:[[69,813]],7705:[[101,813]],7706:[[69,816]],7707:[[101,816]],7708:[[552,774]],7709:[[553,774]],7710:[[70,775]],7711:[[102,775]],7712:[[71,772]],7713:[[103,772]],7714:[[72,775]],7715:[[104,775]],7716:[[72,803]],7717:[[104,803]],7718:[[72,776]],7719:[[104,776]],7720:[[72,807]],7721:[[104,807]],7722:[[72,814]],7723:[[104,814]],7724:[[73,816]],7725:[[105,816]],7726:[[207,769]],7727:[[239,769]],7728:[[75,769]],7729:[[107,769]],7730:[[75,803]],7731:[[107,803]],7732:[[75,817]],7733:[[107,817]],7734:[[76,803],,{772:7736}],7735:[[108,803],,{772:7737}],7736:[[7734,772]],7737:[[7735,772]],7738:[[76,817]],7739:[[108,817]],7740:[[76,813]],7741:[[108,813]],7742:[[77,769]],7743:[[109,769]],7744:[[77,775]],7745:[[109,775]],7746:[[77,803]],7747:[[109,803]],7748:[[78,775]],7749:[[110,775]],7750:[[78,803]],7751:[[110,803]],7752:[[78,817]],7753:[[110,817]],7754:[[78,813]],7755:[[110,813]],7756:[[213,769]],7757:[[245,769]],7758:[[213,776]],7759:[[245,776]],7760:[[332,768]],7761:[[333,768]],7762:[[332,769]],7763:[[333,769]],7764:[[80,769]],7765:[[112,769]],7766:[[80,775]],7767:[[112,775]],7768:[[82,775]],7769:[[114,775]],7770:[[82,803],,{772:7772}],7771:[[114,803],,{772:7773}],7772:[[7770,772]],7773:[[7771,772]],7774:[[82,817]],7775:[[114,817]],7776:[[83,775]],7777:[[115,775]],7778:[[83,803],,{775:7784}],7779:[[115,803],,{775:7785}],7780:[[346,775]],7781:[[347,775]],7782:[[352,775]],7783:[[353,775]],7784:[[7778,775]],7785:[[7779,775]],7786:[[84,775]],7787:[[116,775]],7788:[[84,803]],7789:[[116,803]],7790:[[84,817]],7791:[[116,817]],7792:[[84,813]],7793:[[116,813]],7794:[[85,804]],7795:[[117,804]],7796:[[85,816]],7797:[[117,816]],7798:[[85,813]],7799:[[117,813]],7800:[[360,769]],7801:[[361,769]],7802:[[362,776]],7803:[[363,776]],7804:[[86,771]],7805:[[118,771]],7806:[[86,803]],7807:[[118,803]],7808:[[87,768]],7809:[[119,768]],7810:[[87,769]],7811:[[119,769]],7812:[[87,776]],7813:[[119,776]],7814:[[87,775]],7815:[[119,775]],7816:[[87,803]],7817:[[119,803]],7818:[[88,775]],7819:[[120,775]],7820:[[88,776]],7821:[[120,776]],7822:[[89,775]],7823:[[121,775]],7824:[[90,770]],7825:[[122,770]],7826:[[90,803]],7827:[[122,803]],7828:[[90,817]],7829:[[122,817]],7830:[[104,817]],7831:[[116,776]],7832:[[119,778]],7833:[[121,778]],7834:[[97,702],256],7835:[[383,775]],7840:[[65,803],,{770:7852,774:7862}],7841:[[97,803],,{770:7853,774:7863}],7842:[[65,777]],7843:[[97,777]],7844:[[194,769]],7845:[[226,769]],7846:[[194,768]],7847:[[226,768]],7848:[[194,777]],7849:[[226,777]],7850:[[194,771]],7851:[[226,771]],7852:[[7840,770]],7853:[[7841,770]],7854:[[258,769]],7855:[[259,769]],7856:[[258,768]],7857:[[259,768]],7858:[[258,777]],7859:[[259,777]],7860:[[258,771]],7861:[[259,771]],7862:[[7840,774]],7863:[[7841,774]],7864:[[69,803],,{770:7878}],7865:[[101,803],,{770:7879}],7866:[[69,777]],7867:[[101,777]],7868:[[69,771]],7869:[[101,771]],7870:[[202,769]],7871:[[234,769]],7872:[[202,768]],7873:[[234,768]],7874:[[202,777]],7875:[[234,777]],7876:[[202,771]],7877:[[234,771]],7878:[[7864,770]],7879:[[7865,770]],7880:[[73,777]],7881:[[105,777]],7882:[[73,803]],7883:[[105,803]],7884:[[79,803],,{770:7896}],7885:[[111,803],,{770:7897}],7886:[[79,777]],7887:[[111,777]],7888:[[212,769]],7889:[[244,769]],7890:[[212,768]],7891:[[244,768]],7892:[[212,777]],7893:[[244,777]],7894:[[212,771]],7895:[[244,771]],7896:[[7884,770]],7897:[[7885,770]],7898:[[416,769]],7899:[[417,769]],7900:[[416,768]],7901:[[417,768]],7902:[[416,777]],7903:[[417,777]],7904:[[416,771]],7905:[[417,771]],7906:[[416,803]],7907:[[417,803]],7908:[[85,803]],7909:[[117,803]],7910:[[85,777]],7911:[[117,777]],7912:[[431,769]],7913:[[432,769]],7914:[[431,768]],7915:[[432,768]],7916:[[431,777]],7917:[[432,777]],7918:[[431,771]],7919:[[432,771]],7920:[[431,803]],7921:[[432,803]],7922:[[89,768]],7923:[[121,768]],7924:[[89,803]],7925:[[121,803]],7926:[[89,777]],7927:[[121,777]],7928:[[89,771]],7929:[[121,771]]},7936:{7936:[[945,787],,{768:7938,769:7940,834:7942,837:8064}],7937:[[945,788],,{768:7939,769:7941,834:7943,837:8065}],7938:[[7936,768],,{837:8066}],7939:[[7937,768],,{837:8067}],7940:[[7936,769],,{837:8068}],7941:[[7937,769],,{837:8069}],7942:[[7936,834],,{837:8070}],7943:[[7937,834],,{837:8071}],7944:[[913,787],,{768:7946,769:7948,834:7950,837:8072}],7945:[[913,788],,{768:7947,769:7949,834:7951,837:8073}],7946:[[7944,768],,{837:8074}],7947:[[7945,768],,{837:8075}],7948:[[7944,769],,{837:8076}],7949:[[7945,769],,{837:8077}],7950:[[7944,834],,{837:8078}],7951:[[7945,834],,{837:8079}],7952:[[949,787],,{768:7954,769:7956}],7953:[[949,788],,{768:7955,769:7957}],7954:[[7952,768]],7955:[[7953,768]],7956:[[7952,769]],7957:[[7953,769]],7960:[[917,787],,{768:7962,769:7964}],7961:[[917,788],,{768:7963,769:7965}],7962:[[7960,768]],7963:[[7961,768]],7964:[[7960,769]],7965:[[7961,769]],7968:[[951,787],,{768:7970,769:7972,834:7974,837:8080}],7969:[[951,788],,{768:7971,769:7973,834:7975,837:8081}],7970:[[7968,768],,{837:8082}],7971:[[7969,768],,{837:8083}],7972:[[7968,769],,{837:8084}],7973:[[7969,769],,{837:8085}],7974:[[7968,834],,{837:8086}],7975:[[7969,834],,{837:8087}],7976:[[919,787],,{768:7978,769:7980,834:7982,837:8088}],7977:[[919,788],,{768:7979,769:7981,834:7983,837:8089}],7978:[[7976,768],,{837:8090}],7979:[[7977,768],,{837:8091}],7980:[[7976,769],,{837:8092}],7981:[[7977,769],,{837:8093}],7982:[[7976,834],,{837:8094}],7983:[[7977,834],,{837:8095}],7984:[[953,787],,{768:7986,769:7988,834:7990}],7985:[[953,788],,{768:7987,769:7989,834:7991}],7986:[[7984,768]],7987:[[7985,768]],7988:[[7984,769]],7989:[[7985,769]],7990:[[7984,834]],7991:[[7985,834]],7992:[[921,787],,{768:7994,769:7996,834:7998}],7993:[[921,788],,{768:7995,769:7997,834:7999}],7994:[[7992,768]],7995:[[7993,768]],7996:[[7992,769]],7997:[[7993,769]],7998:[[7992,834]],7999:[[7993,834]],8e3:[[959,787],,{768:8002,769:8004}],8001:[[959,788],,{768:8003,769:8005}],8002:[[8e3,768]],8003:[[8001,768]],8004:[[8e3,769]],8005:[[8001,769]],8008:[[927,787],,{768:8010,769:8012}],8009:[[927,788],,{768:8011,769:8013}],8010:[[8008,768]],8011:[[8009,768]],8012:[[8008,769]],8013:[[8009,769]],8016:[[965,787],,{768:8018,769:8020,834:8022}],8017:[[965,788],,{768:8019,769:8021,834:8023}],8018:[[8016,768]],8019:[[8017,768]],8020:[[8016,769]],8021:[[8017,769]],8022:[[8016,834]],8023:[[8017,834]],8025:[[933,788],,{768:8027,769:8029,834:8031}],8027:[[8025,768]],8029:[[8025,769]],8031:[[8025,834]],8032:[[969,787],,{768:8034,769:8036,834:8038,837:8096}],8033:[[969,788],,{768:8035,769:8037,834:8039,837:8097}],8034:[[8032,768],,{837:8098}],8035:[[8033,768],,{837:8099}],8036:[[8032,769],,{837:8100}],8037:[[8033,769],,{837:8101}],8038:[[8032,834],,{837:8102}],8039:[[8033,834],,{837:8103}],8040:[[937,787],,{768:8042,769:8044,834:8046,837:8104}],8041:[[937,788],,{768:8043,769:8045,834:8047,837:8105}],8042:[[8040,768],,{837:8106}],8043:[[8041,768],,{837:8107}],8044:[[8040,769],,{837:8108}],8045:[[8041,769],,{837:8109}],8046:[[8040,834],,{837:8110}],8047:[[8041,834],,{837:8111}],8048:[[945,768],,{837:8114}],8049:[[940]],8050:[[949,768]],8051:[[941]],8052:[[951,768],,{837:8130}],8053:[[942]],8054:[[953,768]],8055:[[943]],8056:[[959,768]],8057:[[972]],8058:[[965,768]],8059:[[973]],8060:[[969,768],,{837:8178}],8061:[[974]],8064:[[7936,837]],8065:[[7937,837]],8066:[[7938,837]],8067:[[7939,837]],8068:[[7940,837]],8069:[[7941,837]],8070:[[7942,837]],8071:[[7943,837]],8072:[[7944,837]],8073:[[7945,837]],8074:[[7946,837]],8075:[[7947,837]],8076:[[7948,837]],8077:[[7949,837]],8078:[[7950,837]],8079:[[7951,837]],8080:[[7968,837]],8081:[[7969,837]],8082:[[7970,837]],8083:[[7971,837]],8084:[[7972,837]],8085:[[7973,837]],8086:[[7974,837]],8087:[[7975,837]],8088:[[7976,837]],8089:[[7977,837]],8090:[[7978,837]],8091:[[7979,837]],8092:[[7980,837]],8093:[[7981,837]],8094:[[7982,837]],8095:[[7983,837]],8096:[[8032,837]],8097:[[8033,837]],8098:[[8034,837]],8099:[[8035,837]],8100:[[8036,837]],8101:[[8037,837]],8102:[[8038,837]],8103:[[8039,837]],8104:[[8040,837]],8105:[[8041,837]],8106:[[8042,837]],8107:[[8043,837]],8108:[[8044,837]],8109:[[8045,837]],8110:[[8046,837]],8111:[[8047,837]],8112:[[945,774]],8113:[[945,772]],8114:[[8048,837]],8115:[[945,837]],8116:[[940,837]],8118:[[945,834],,{837:8119}],8119:[[8118,837]],8120:[[913,774]],8121:[[913,772]],8122:[[913,768]],8123:[[902]],8124:[[913,837]],8125:[[32,787],256],8126:[[953]],8127:[[32,787],256,{768:8141,769:8142,834:8143}],8128:[[32,834],256],8129:[[168,834]],8130:[[8052,837]],8131:[[951,837]],8132:[[942,837]],8134:[[951,834],,{837:8135}],8135:[[8134,837]],8136:[[917,768]],8137:[[904]],8138:[[919,768]],8139:[[905]],8140:[[919,837]],8141:[[8127,768]],8142:[[8127,769]],8143:[[8127,834]],8144:[[953,774]],8145:[[953,772]],8146:[[970,768]],8147:[[912]],8150:[[953,834]],8151:[[970,834]],8152:[[921,774]],8153:[[921,772]],8154:[[921,768]],8155:[[906]],8157:[[8190,768]],8158:[[8190,769]],8159:[[8190,834]],8160:[[965,774]],8161:[[965,772]],8162:[[971,768]],8163:[[944]],8164:[[961,787]],8165:[[961,788]],8166:[[965,834]],8167:[[971,834]],8168:[[933,774]],8169:[[933,772]],8170:[[933,768]],8171:[[910]],8172:[[929,788]],8173:[[168,768]],8174:[[901]],8175:[[96]],8178:[[8060,837]],8179:[[969,837]],8180:[[974,837]],8182:[[969,834],,{837:8183}],8183:[[8182,837]],8184:[[927,768]],8185:[[908]],8186:[[937,768]],8187:[[911]],8188:[[937,837]],8189:[[180]],8190:[[32,788],256,{768:8157,769:8158,834:8159}]},8192:{8192:[[8194]],8193:[[8195]],8194:[[32],256],8195:[[32],256],8196:[[32],256],8197:[[32],256],8198:[[32],256],8199:[[32],256],8200:[[32],256],8201:[[32],256],8202:[[32],256],8209:[[8208],256],8215:[[32,819],256],8228:[[46],256],8229:[[46,46],256],8230:[[46,46,46],256],8239:[[32],256],8243:[[8242,8242],256],8244:[[8242,8242,8242],256],8246:[[8245,8245],256],8247:[[8245,8245,8245],256],8252:[[33,33],256],8254:[[32,773],256],8263:[[63,63],256],8264:[[63,33],256],8265:[[33,63],256],8279:[[8242,8242,8242,8242],256],8287:[[32],256],8304:[[48],256],8305:[[105],256],8308:[[52],256],8309:[[53],256],8310:[[54],256],8311:[[55],256],8312:[[56],256],8313:[[57],256],8314:[[43],256],8315:[[8722],256],8316:[[61],256],8317:[[40],256],8318:[[41],256],8319:[[110],256],8320:[[48],256],8321:[[49],256],8322:[[50],256],8323:[[51],256],8324:[[52],256],8325:[[53],256],8326:[[54],256],8327:[[55],256],8328:[[56],256],8329:[[57],256],8330:[[43],256],8331:[[8722],256],8332:[[61],256],8333:[[40],256],8334:[[41],256],8336:[[97],256],8337:[[101],256],8338:[[111],256],8339:[[120],256],8340:[[601],256],8341:[[104],256],8342:[[107],256],8343:[[108],256],8344:[[109],256],8345:[[110],256],8346:[[112],256],8347:[[115],256],8348:[[116],256],8360:[[82,115],256],8400:[,230],8401:[,230],8402:[,1],8403:[,1],8404:[,230],8405:[,230],8406:[,230],8407:[,230],8408:[,1],8409:[,1],8410:[,1],8411:[,230],8412:[,230],8417:[,230],8421:[,1],8422:[,1],8423:[,230],8424:[,220],8425:[,230],8426:[,1],8427:[,1],8428:[,220],8429:[,220],8430:[,220],8431:[,220],8432:[,230]},8448:{8448:[[97,47,99],256],8449:[[97,47,115],256],8450:[[67],256],8451:[[176,67],256],8453:[[99,47,111],256],8454:[[99,47,117],256],8455:[[400],256],8457:[[176,70],256],8458:[[103],256],8459:[[72],256],8460:[[72],256],8461:[[72],256],8462:[[104],256],8463:[[295],256],8464:[[73],256],8465:[[73],256],8466:[[76],256],8467:[[108],256],8469:[[78],256],8470:[[78,111],256],8473:[[80],256],8474:[[81],256],8475:[[82],256],8476:[[82],256],8477:[[82],256],8480:[[83,77],256],8481:[[84,69,76],256],8482:[[84,77],256],8484:[[90],256],8486:[[937]],8488:[[90],256],8490:[[75]],8491:[[197]],8492:[[66],256],8493:[[67],256],8495:[[101],256],8496:[[69],256],8497:[[70],256],8499:[[77],256],8500:[[111],256],8501:[[1488],256],8502:[[1489],256],8503:[[1490],256],8504:[[1491],256],8505:[[105],256],8507:[[70,65,88],256],8508:[[960],256],8509:[[947],256],8510:[[915],256],8511:[[928],256],8512:[[8721],256],8517:[[68],256],8518:[[100],256],8519:[[101],256],8520:[[105],256],8521:[[106],256],8528:[[49,8260,55],256],8529:[[49,8260,57],256],8530:[[49,8260,49,48],256],8531:[[49,8260,51],256],8532:[[50,8260,51],256],8533:[[49,8260,53],256],8534:[[50,8260,53],256],8535:[[51,8260,53],256],8536:[[52,8260,53],256],8537:[[49,8260,54],256],8538:[[53,8260,54],256],8539:[[49,8260,56],256],8540:[[51,8260,56],256],8541:[[53,8260,56],256],8542:[[55,8260,56],256],8543:[[49,8260],256],8544:[[73],256],8545:[[73,73],256],8546:[[73,73,73],256],8547:[[73,86],256],8548:[[86],256],8549:[[86,73],256],8550:[[86,73,73],256],8551:[[86,73,73,73],256],8552:[[73,88],256],8553:[[88],256],8554:[[88,73],256],8555:[[88,73,73],256],8556:[[76],256],8557:[[67],256],8558:[[68],256],8559:[[77],256],8560:[[105],256],8561:[[105,105],256],8562:[[105,105,105],256],8563:[[105,118],256],8564:[[118],256],8565:[[118,105],256],8566:[[118,105,105],256],8567:[[118,105,105,105],256],8568:[[105,120],256],8569:[[120],256],8570:[[120,105],256],8571:[[120,105,105],256],8572:[[108],256],8573:[[99],256],8574:[[100],256],8575:[[109],256],8585:[[48,8260,51],256],8592:[,,{824:8602}],8594:[,,{824:8603}],8596:[,,{824:8622}],8602:[[8592,824]],8603:[[8594,824]],8622:[[8596,824]],8653:[[8656,824]],8654:[[8660,824]],8655:[[8658,824]],8656:[,,{824:8653}],8658:[,,{824:8655}],8660:[,,{824:8654}]},8704:{8707:[,,{824:8708}],8708:[[8707,824]],8712:[,,{824:8713}],8713:[[8712,824]],8715:[,,{824:8716}],8716:[[8715,824]],8739:[,,{824:8740}],8740:[[8739,824]],8741:[,,{824:8742}],8742:[[8741,824]],8748:[[8747,8747],256],8749:[[8747,8747,8747],256],8751:[[8750,8750],256],8752:[[8750,8750,8750],256],8764:[,,{824:8769}],8769:[[8764,824]],8771:[,,{824:8772}],8772:[[8771,824]],8773:[,,{824:8775}],8775:[[8773,824]],8776:[,,{824:8777}],8777:[[8776,824]],8781:[,,{824:8813}],8800:[[61,824]],8801:[,,{824:8802}],8802:[[8801,824]],8804:[,,{824:8816}],8805:[,,{824:8817}],8813:[[8781,824]],8814:[[60,824]],8815:[[62,824]],8816:[[8804,824]],8817:[[8805,824]],8818:[,,{824:8820}],8819:[,,{824:8821}],8820:[[8818,824]],8821:[[8819,824]],8822:[,,{824:8824}],8823:[,,{824:8825}],8824:[[8822,824]],8825:[[8823,824]],8826:[,,{824:8832}],8827:[,,{824:8833}],8828:[,,{824:8928}],8829:[,,{824:8929}],8832:[[8826,824]],8833:[[8827,824]],8834:[,,{824:8836}],8835:[,,{824:8837}],8836:[[8834,824]],8837:[[8835,824]],8838:[,,{824:8840}],8839:[,,{824:8841}],8840:[[8838,824]],8841:[[8839,824]],8849:[,,{824:8930}],8850:[,,{824:8931}],8866:[,,{824:8876}],8872:[,,{824:8877}],8873:[,,{824:8878}],8875:[,,{824:8879}],8876:[[8866,824]],8877:[[8872,824]],8878:[[8873,824]],8879:[[8875,824]],8882:[,,{824:8938}],8883:[,,{824:8939}],8884:[,,{824:8940}],8885:[,,{824:8941}],8928:[[8828,824]],8929:[[8829,824]],8930:[[8849,824]],8931:[[8850,824]],8938:[[8882,824]],8939:[[8883,824]],8940:[[8884,824]],8941:[[8885,824]]},8960:{9001:[[12296]],9002:[[12297]]},9216:{9312:[[49],256],9313:[[50],256],9314:[[51],256],9315:[[52],256],9316:[[53],256],9317:[[54],256],9318:[[55],256],9319:[[56],256],9320:[[57],256],9321:[[49,48],256],9322:[[49,49],256],9323:[[49,50],256],9324:[[49,51],256],9325:[[49,52],256],9326:[[49,53],256],9327:[[49,54],256],9328:[[49,55],256],9329:[[49,56],256],9330:[[49,57],256],9331:[[50,48],256],9332:[[40,49,41],256],9333:[[40,50,41],256],9334:[[40,51,41],256],9335:[[40,52,41],256],9336:[[40,53,41],256],9337:[[40,54,41],256],9338:[[40,55,41],256],9339:[[40,56,41],256],9340:[[40,57,41],256],9341:[[40,49,48,41],256],9342:[[40,49,49,41],256],9343:[[40,49,50,41],256],9344:[[40,49,51,41],256],9345:[[40,49,52,41],256],9346:[[40,49,53,41],256],9347:[[40,49,54,41],256],9348:[[40,49,55,41],256],9349:[[40,49,56,41],256],9350:[[40,49,57,41],256],9351:[[40,50,48,41],256],9352:[[49,46],256],9353:[[50,46],256],9354:[[51,46],256],9355:[[52,46],256],9356:[[53,46],256],9357:[[54,46],256],9358:[[55,46],256],9359:[[56,46],256],9360:[[57,46],256],9361:[[49,48,46],256],9362:[[49,49,46],256],9363:[[49,50,46],256],9364:[[49,51,46],256],9365:[[49,52,46],256],9366:[[49,53,46],256],9367:[[49,54,46],256],9368:[[49,55,46],256],9369:[[49,56,46],256],9370:[[49,57,46],256],9371:[[50,48,46],256],9372:[[40,97,41],256],9373:[[40,98,41],256],9374:[[40,99,41],256],9375:[[40,100,41],256],9376:[[40,101,41],256],9377:[[40,102,41],256],9378:[[40,103,41],256],9379:[[40,104,41],256],9380:[[40,105,41],256],9381:[[40,106,41],256],9382:[[40,107,41],256],9383:[[40,108,41],256],9384:[[40,109,41],256],9385:[[40,110,41],256],9386:[[40,111,41],256],9387:[[40,112,41],256],9388:[[40,113,41],256],9389:[[40,114,41],256],9390:[[40,115,41],256],9391:[[40,116,41],256],9392:[[40,117,41],256],9393:[[40,118,41],256],9394:[[40,119,41],256],9395:[[40,120,41],256],9396:[[40,121,41],256],9397:[[40,122,41],256],9398:[[65],256],9399:[[66],256],9400:[[67],256],9401:[[68],256],9402:[[69],256],9403:[[70],256],9404:[[71],256],9405:[[72],256],9406:[[73],256],9407:[[74],256],9408:[[75],256],9409:[[76],256],9410:[[77],256],9411:[[78],256],9412:[[79],256],9413:[[80],256],9414:[[81],256],9415:[[82],256],9416:[[83],256],9417:[[84],256],9418:[[85],256],9419:[[86],256],9420:[[87],256],9421:[[88],256],9422:[[89],256],9423:[[90],256],9424:[[97],256],9425:[[98],256],9426:[[99],256],9427:[[100],256],9428:[[101],256],9429:[[102],256],9430:[[103],256],9431:[[104],256],9432:[[105],256],9433:[[106],256],9434:[[107],256],9435:[[108],256],9436:[[109],256],9437:[[110],256],9438:[[111],256],9439:[[112],256],9440:[[113],256],9441:[[114],256],9442:[[115],256],9443:[[116],256],9444:[[117],256],9445:[[118],256],9446:[[119],256],9447:[[120],256],9448:[[121],256],9449:[[122],256],9450:[[48],256]},10752:{10764:[[8747,8747,8747,8747],256],10868:[[58,58,61],256],10869:[[61,61],256],10870:[[61,61,61],256],10972:[[10973,824],512]},11264:{11388:[[106],256],11389:[[86],256],11503:[,230],11504:[,230],11505:[,230]},11520:{11631:[[11617],256],11647:[,9],11744:[,230],11745:[,230],11746:[,230],11747:[,230],11748:[,230],11749:[,230],11750:[,230],11751:[,230],11752:[,230],11753:[,230],11754:[,230],11755:[,230],11756:[,230],11757:[,230],11758:[,230],11759:[,230],11760:[,230],11761:[,230],11762:[,230],11763:[,230],11764:[,230],11765:[,230],11766:[,230],11767:[,230],11768:[,230],11769:[,230],11770:[,230],11771:[,230],11772:[,230],11773:[,230],11774:[,230],11775:[,230]},11776:{11935:[[27597],256],12019:[[40863],256]},12032:{12032:[[19968],256],12033:[[20008],256],12034:[[20022],256],12035:[[20031],256],12036:[[20057],256],12037:[[20101],256],12038:[[20108],256],12039:[[20128],256],12040:[[20154],256],12041:[[20799],256],12042:[[20837],256],12043:[[20843],256],12044:[[20866],256],12045:[[20886],256],12046:[[20907],256],12047:[[20960],256],12048:[[20981],256],12049:[[20992],256],12050:[[21147],256],12051:[[21241],256],12052:[[21269],256],12053:[[21274],256],12054:[[21304],256],12055:[[21313],256],12056:[[21340],256],12057:[[21353],256],12058:[[21378],256],12059:[[21430],256],12060:[[21448],256],12061:[[21475],256],12062:[[22231],256],12063:[[22303],256],12064:[[22763],256],12065:[[22786],256],12066:[[22794],256],12067:[[22805],256],12068:[[22823],256],12069:[[22899],256],12070:[[23376],256],12071:[[23424],256],12072:[[23544],256],12073:[[23567],256],12074:[[23586],256],12075:[[23608],256],12076:[[23662],256],12077:[[23665],256],12078:[[24027],256],12079:[[24037],256],12080:[[24049],256],12081:[[24062],256],12082:[[24178],256],12083:[[24186],256],12084:[[24191],256],12085:[[24308],256],12086:[[24318],256],12087:[[24331],256],12088:[[24339],256],12089:[[24400],256],12090:[[24417],256],12091:[[24435],256],12092:[[24515],256],12093:[[25096],256],12094:[[25142],256],12095:[[25163],256],12096:[[25903],256],12097:[[25908],256],12098:[[25991],256],12099:[[26007],256],12100:[[26020],256],12101:[[26041],256],12102:[[26080],256],12103:[[26085],256],12104:[[26352],256],12105:[[26376],256],12106:[[26408],256],12107:[[27424],256],12108:[[27490],256],12109:[[27513],256],12110:[[27571],256],12111:[[27595],256],12112:[[27604],256],12113:[[27611],256],12114:[[27663],256],12115:[[27668],256],12116:[[27700],256],12117:[[28779],256],12118:[[29226],256],12119:[[29238],256],12120:[[29243],256],12121:[[29247],256],12122:[[29255],256],12123:[[29273],256],12124:[[29275],256],12125:[[29356],256],12126:[[29572],256],12127:[[29577],256],12128:[[29916],256],12129:[[29926],256],12130:[[29976],256],12131:[[29983],256],12132:[[29992],256],12133:[[3e4],256],12134:[[30091],256],12135:[[30098],256],12136:[[30326],256],12137:[[30333],256],12138:[[30382],256],12139:[[30399],256],12140:[[30446],256],12141:[[30683],256],12142:[[30690],256],12143:[[30707],256],12144:[[31034],256],12145:[[31160],256],12146:[[31166],256],12147:[[31348],256],12148:[[31435],256],12149:[[31481],256],12150:[[31859],256],12151:[[31992],256],12152:[[32566],256],12153:[[32593],256],12154:[[32650],256],12155:[[32701],256],12156:[[32769],256],12157:[[32780],256],12158:[[32786],256],12159:[[32819],256],12160:[[32895],256],12161:[[32905],256],12162:[[33251],256],12163:[[33258],256],12164:[[33267],256],12165:[[33276],256],12166:[[33292],256],12167:[[33307],256],12168:[[33311],256],12169:[[33390],256],12170:[[33394],256],12171:[[33400],256],12172:[[34381],256],12173:[[34411],256],12174:[[34880],256],12175:[[34892],256],12176:[[34915],256],12177:[[35198],256],12178:[[35211],256],12179:[[35282],256],12180:[[35328],256],12181:[[35895],256],12182:[[35910],256],12183:[[35925],256],12184:[[35960],256],12185:[[35997],256],12186:[[36196],256],12187:[[36208],256],12188:[[36275],256],12189:[[36523],256],12190:[[36554],256],12191:[[36763],256],12192:[[36784],256],12193:[[36789],256],12194:[[37009],256],12195:[[37193],256],12196:[[37318],256],12197:[[37324],256],12198:[[37329],256],12199:[[38263],256],12200:[[38272],256],12201:[[38428],256],12202:[[38582],256],12203:[[38585],256],12204:[[38632],256],12205:[[38737],256],12206:[[38750],256],12207:[[38754],256],12208:[[38761],256],12209:[[38859],256],12210:[[38893],256],12211:[[38899],256],12212:[[38913],256],12213:[[39080],256],12214:[[39131],256],12215:[[39135],256],12216:[[39318],256],12217:[[39321],256],12218:[[39340],256],12219:[[39592],256],12220:[[39640],256],12221:[[39647],256],12222:[[39717],256],12223:[[39727],256],12224:[[39730],256],12225:[[39740],256],12226:[[39770],256],12227:[[40165],256],12228:[[40565],256],12229:[[40575],256],12230:[[40613],256],12231:[[40635],256],12232:[[40643],256],12233:[[40653],256],12234:[[40657],256],12235:[[40697],256],12236:[[40701],256],12237:[[40718],256],12238:[[40723],256],12239:[[40736],256],12240:[[40763],256],12241:[[40778],256],12242:[[40786],256],12243:[[40845],256],12244:[[40860],256],12245:[[40864],256]},12288:{12288:[[32],256],12330:[,218],12331:[,228],12332:[,232],12333:[,222],12334:[,224],12335:[,224],12342:[[12306],256],12344:[[21313],256],12345:[[21316],256],12346:[[21317],256],12358:[,,{12441:12436}],12363:[,,{12441:12364}],12364:[[12363,12441]],12365:[,,{12441:12366}],12366:[[12365,12441]],12367:[,,{12441:12368}],12368:[[12367,12441]],12369:[,,{12441:12370}],12370:[[12369,12441]],12371:[,,{12441:12372}],12372:[[12371,12441]],12373:[,,{12441:12374}],12374:[[12373,12441]],12375:[,,{12441:12376}],12376:[[12375,12441]],12377:[,,{12441:12378}],12378:[[12377,12441]],12379:[,,{12441:12380}],12380:[[12379,12441]],12381:[,,{12441:12382}],12382:[[12381,12441]],12383:[,,{12441:12384}],12384:[[12383,12441]],12385:[,,{12441:12386}],12386:[[12385,12441]],12388:[,,{12441:12389}],12389:[[12388,12441]],12390:[,,{12441:12391}],12391:[[12390,12441]],12392:[,,{12441:12393}],12393:[[12392,12441]],12399:[,,{12441:12400,12442:12401}],12400:[[12399,12441]],12401:[[12399,12442]],12402:[,,{12441:12403,12442:12404}],12403:[[12402,12441]],12404:[[12402,12442]],12405:[,,{12441:12406,12442:12407}],12406:[[12405,12441]],12407:[[12405,12442]],12408:[,,{12441:12409,12442:12410}],12409:[[12408,12441]],12410:[[12408,12442]],12411:[,,{12441:12412,12442:12413}],12412:[[12411,12441]],12413:[[12411,12442]],12436:[[12358,12441]],12441:[,8],12442:[,8],12443:[[32,12441],256],12444:[[32,12442],256],12445:[,,{12441:12446}],12446:[[12445,12441]],12447:[[12424,12426],256],12454:[,,{12441:12532}],12459:[,,{12441:12460}],12460:[[12459,12441]],12461:[,,{12441:12462}],12462:[[12461,12441]],12463:[,,{12441:12464}],12464:[[12463,12441]],12465:[,,{12441:12466}],12466:[[12465,12441]],12467:[,,{12441:12468}],12468:[[12467,12441]],12469:[,,{12441:12470}],12470:[[12469,12441]],12471:[,,{12441:12472}],12472:[[12471,12441]],12473:[,,{12441:12474}],12474:[[12473,12441]],12475:[,,{12441:12476}],12476:[[12475,12441]],12477:[,,{12441:12478}],12478:[[12477,12441]],12479:[,,{12441:12480}],12480:[[12479,12441]],12481:[,,{12441:12482}],12482:[[12481,12441]],12484:[,,{12441:12485}],12485:[[12484,12441]],12486:[,,{12441:12487}],12487:[[12486,12441]],12488:[,,{12441:12489}],12489:[[12488,12441]],12495:[,,{12441:12496,12442:12497}],12496:[[12495,12441]],12497:[[12495,12442]],12498:[,,{12441:12499,12442:12500}],12499:[[12498,12441]],12500:[[12498,12442]],12501:[,,{12441:12502,12442:12503}],12502:[[12501,12441]],12503:[[12501,12442]],12504:[,,{12441:12505,12442:12506}],12505:[[12504,12441]],12506:[[12504,12442]],12507:[,,{12441:12508,12442:12509}],12508:[[12507,12441]],12509:[[12507,12442]],12527:[,,{12441:12535}],12528:[,,{12441:12536}],12529:[,,{12441:12537}],12530:[,,{12441:12538}],12532:[[12454,12441]],12535:[[12527,12441]],12536:[[12528,12441]],12537:[[12529,12441]],12538:[[12530,12441]],12541:[,,{12441:12542}],12542:[[12541,12441]],12543:[[12467,12488],256]},12544:{12593:[[4352],256],12594:[[4353],256],12595:[[4522],256],12596:[[4354],256],12597:[[4524],256],12598:[[4525],256],12599:[[4355],256],12600:[[4356],256],12601:[[4357],256],12602:[[4528],256],12603:[[4529],256],12604:[[4530],256],12605:[[4531],256],12606:[[4532],256],12607:[[4533],256],12608:[[4378],256],12609:[[4358],256],12610:[[4359],256],12611:[[4360],256],12612:[[4385],256],12613:[[4361],256],12614:[[4362],256],12615:[[4363],256],12616:[[4364],256],12617:[[4365],256],12618:[[4366],256],12619:[[4367],256],12620:[[4368],256],12621:[[4369],256],12622:[[4370],256],12623:[[4449],256],12624:[[4450],256],12625:[[4451],256],12626:[[4452],256],12627:[[4453],256],12628:[[4454],256],12629:[[4455],256],12630:[[4456],256],12631:[[4457],256],12632:[[4458],256],12633:[[4459],256],12634:[[4460],256],12635:[[4461],256],12636:[[4462],256],12637:[[4463],256],12638:[[4464],256],12639:[[4465],256],12640:[[4466],256],12641:[[4467],256],12642:[[4468],256],12643:[[4469],256],12644:[[4448],256],12645:[[4372],256],12646:[[4373],256],12647:[[4551],256],12648:[[4552],256],12649:[[4556],256],12650:[[4558],256],12651:[[4563],256],12652:[[4567],256],12653:[[4569],256],12654:[[4380],256],12655:[[4573],256],12656:[[4575],256],12657:[[4381],256],12658:[[4382],256],12659:[[4384],256],12660:[[4386],256],12661:[[4387],256],12662:[[4391],256],12663:[[4393],256],12664:[[4395],256],12665:[[4396],256],12666:[[4397],256],12667:[[4398],256],12668:[[4399],256],12669:[[4402],256],12670:[[4406],256],12671:[[4416],256],12672:[[4423],256],12673:[[4428],256],12674:[[4593],256],12675:[[4594],256],12676:[[4439],256],12677:[[4440],256],12678:[[4441],256],12679:[[4484],256],12680:[[4485],256],12681:[[4488],256],12682:[[4497],256],12683:[[4498],256],12684:[[4500],256],12685:[[4510],256],12686:[[4513],256],12690:[[19968],256],12691:[[20108],256],12692:[[19977],256],12693:[[22235],256],12694:[[19978],256],12695:[[20013],256],12696:[[19979],256],12697:[[30002],256],12698:[[20057],256],12699:[[19993],256],12700:[[19969],256],12701:[[22825],256],12702:[[22320],256],12703:[[20154],256]},12800:{12800:[[40,4352,41],256],12801:[[40,4354,41],256],12802:[[40,4355,41],256],12803:[[40,4357,41],256],12804:[[40,4358,41],256],12805:[[40,4359,41],256],12806:[[40,4361,41],256],12807:[[40,4363,41],256],12808:[[40,4364,41],256],12809:[[40,4366,41],256],12810:[[40,4367,41],256],12811:[[40,4368,41],256],12812:[[40,4369,41],256],12813:[[40,4370,41],256],12814:[[40,4352,4449,41],256],12815:[[40,4354,4449,41],256],12816:[[40,4355,4449,41],256],12817:[[40,4357,4449,41],256],12818:[[40,4358,4449,41],256],12819:[[40,4359,4449,41],256],12820:[[40,4361,4449,41],256],12821:[[40,4363,4449,41],256],12822:[[40,4364,4449,41],256],12823:[[40,4366,4449,41],256],12824:[[40,4367,4449,41],256],12825:[[40,4368,4449,41],256],12826:[[40,4369,4449,41],256],12827:[[40,4370,4449,41],256],12828:[[40,4364,4462,41],256],12829:[[40,4363,4457,4364,4453,4523,41],256],12830:[[40,4363,4457,4370,4462,41],256],12832:[[40,19968,41],256],12833:[[40,20108,41],256],12834:[[40,19977,41],256],12835:[[40,22235,41],256],12836:[[40,20116,41],256],12837:[[40,20845,41],256],12838:[[40,19971,41],256],12839:[[40,20843,41],256],12840:[[40,20061,41],256],12841:[[40,21313,41],256],12842:[[40,26376,41],256],12843:[[40,28779,41],256],12844:[[40,27700,41],256],12845:[[40,26408,41],256],12846:[[40,37329,41],256],12847:[[40,22303,41],256],12848:[[40,26085,41],256],12849:[[40,26666,41],256],12850:[[40,26377,41],256],12851:[[40,31038,41],256],12852:[[40,21517,41],256],12853:[[40,29305,41],256],12854:[[40,36001,41],256],12855:[[40,31069,41],256],12856:[[40,21172,41],256],12857:[[40,20195,41],256],12858:[[40,21628,41],256],12859:[[40,23398,41],256],12860:[[40,30435,41],256],12861:[[40,20225,41],256],12862:[[40,36039,41],256],12863:[[40,21332,41],256],12864:[[40,31085,41],256],12865:[[40,20241,41],256],12866:[[40,33258,41],256],12867:[[40,33267,41],256],12868:[[21839],256],12869:[[24188],256],12870:[[25991],256],12871:[[31631],256],12880:[[80,84,69],256],12881:[[50,49],256],12882:[[50,50],256],12883:[[50,51],256],12884:[[50,52],256],12885:[[50,53],256],12886:[[50,54],256],12887:[[50,55],256],12888:[[50,56],256],12889:[[50,57],256],12890:[[51,48],256],12891:[[51,49],256],12892:[[51,50],256],12893:[[51,51],256],12894:[[51,52],256],12895:[[51,53],256],12896:[[4352],256],12897:[[4354],256],12898:[[4355],256],12899:[[4357],256],12900:[[4358],256],12901:[[4359],256],12902:[[4361],256],12903:[[4363],256],12904:[[4364],256],12905:[[4366],256],12906:[[4367],256],12907:[[4368],256],12908:[[4369],256],12909:[[4370],256],12910:[[4352,4449],256],12911:[[4354,4449],256],12912:[[4355,4449],256],12913:[[4357,4449],256],12914:[[4358,4449],256],12915:[[4359,4449],256],12916:[[4361,4449],256],12917:[[4363,4449],256],12918:[[4364,4449],256],12919:[[4366,4449],256],12920:[[4367,4449],256],12921:[[4368,4449],256],12922:[[4369,4449],256],12923:[[4370,4449],256],12924:[[4366,4449,4535,4352,4457],256],12925:[[4364,4462,4363,4468],256],12926:[[4363,4462],256],12928:[[19968],256],12929:[[20108],256],12930:[[19977],256],12931:[[22235],256],12932:[[20116],256],12933:[[20845],256],12934:[[19971],256],12935:[[20843],256],12936:[[20061],256],12937:[[21313],256],12938:[[26376],256],12939:[[28779],256],12940:[[27700],256],12941:[[26408],256],12942:[[37329],256],12943:[[22303],256],12944:[[26085],256],12945:[[26666],256],12946:[[26377],256],12947:[[31038],256],12948:[[21517],256],12949:[[29305],256],12950:[[36001],256],12951:[[31069],256],12952:[[21172],256],12953:[[31192],256],12954:[[30007],256],12955:[[22899],256],12956:[[36969],256],12957:[[20778],256],12958:[[21360],256],12959:[[27880],256],12960:[[38917],256],12961:[[20241],256],12962:[[20889],256],12963:[[27491],256],12964:[[19978],256],12965:[[20013],256],12966:[[19979],256],12967:[[24038],256],12968:[[21491],256],12969:[[21307],256],12970:[[23447],256],12971:[[23398],256],12972:[[30435],256],12973:[[20225],256],12974:[[36039],256],12975:[[21332],256],12976:[[22812],256],12977:[[51,54],256],12978:[[51,55],256],12979:[[51,56],256],12980:[[51,57],256],12981:[[52,48],256],12982:[[52,49],256],12983:[[52,50],256],12984:[[52,51],256],12985:[[52,52],256],12986:[[52,53],256],12987:[[52,54],256],12988:[[52,55],256],12989:[[52,56],256],12990:[[52,57],256],12991:[[53,48],256],12992:[[49,26376],256],12993:[[50,26376],256],12994:[[51,26376],256],12995:[[52,26376],256],12996:[[53,26376],256],12997:[[54,26376],256],12998:[[55,26376],256],12999:[[56,26376],256],13e3:[[57,26376],256],13001:[[49,48,26376],256],13002:[[49,49,26376],256],13003:[[49,50,26376],256],13004:[[72,103],256],13005:[[101,114,103],256],13006:[[101,86],256],13007:[[76,84,68],256],13008:[[12450],256],13009:[[12452],256],13010:[[12454],256],13011:[[12456],256],13012:[[12458],256],13013:[[12459],256],13014:[[12461],256],13015:[[12463],256],13016:[[12465],256],13017:[[12467],256],13018:[[12469],256],13019:[[12471],256],13020:[[12473],256],13021:[[12475],256],13022:[[12477],256],13023:[[12479],256],13024:[[12481],256],13025:[[12484],256],13026:[[12486],256],13027:[[12488],256],13028:[[12490],256],13029:[[12491],256],13030:[[12492],256],13031:[[12493],256],13032:[[12494],256],13033:[[12495],256],13034:[[12498],256],13035:[[12501],256],13036:[[12504],256],13037:[[12507],256],13038:[[12510],256],13039:[[12511],256],13040:[[12512],256],13041:[[12513],256],13042:[[12514],256],13043:[[12516],256],13044:[[12518],256],13045:[[12520],256],13046:[[12521],256],13047:[[12522],256],13048:[[12523],256],13049:[[12524],256],13050:[[12525],256],13051:[[12527],256],13052:[[12528],256],13053:[[12529],256],13054:[[12530],256]},13056:{13056:[[12450,12497,12540,12488],256],13057:[[12450,12523,12501,12449],256],13058:[[12450,12531,12506,12450],256],13059:[[12450,12540,12523],256],13060:[[12452,12491,12531,12464],256],13061:[[12452,12531,12481],256],13062:[[12454,12457,12531],256],13063:[[12456,12473,12463,12540,12489],256],13064:[[12456,12540,12459,12540],256],13065:[[12458,12531,12473],256],13066:[[12458,12540,12512],256],13067:[[12459,12452,12522],256],13068:[[12459,12521,12483,12488],256],13069:[[12459,12525,12522,12540],256],13070:[[12460,12525,12531],256],13071:[[12460,12531,12510],256],13072:[[12462,12460],256],13073:[[12462,12491,12540],256],13074:[[12461,12517,12522,12540],256],13075:[[12462,12523,12480,12540],256],13076:[[12461,12525],256],13077:[[12461,12525,12464,12521,12512],256],13078:[[12461,12525,12513,12540,12488,12523],256],13079:[[12461,12525,12527,12483,12488],256],13080:[[12464,12521,12512],256],13081:[[12464,12521,12512,12488,12531],256],13082:[[12463,12523,12476,12452,12525],256],13083:[[12463,12525,12540,12493],256],13084:[[12465,12540,12473],256],13085:[[12467,12523,12490],256],13086:[[12467,12540,12509],256],13087:[[12469,12452,12463,12523],256],13088:[[12469,12531,12481,12540,12512],256],13089:[[12471,12522,12531,12464],256],13090:[[12475,12531,12481],256],13091:[[12475,12531,12488],256],13092:[[12480,12540,12473],256],13093:[[12487,12471],256],13094:[[12489,12523],256],13095:[[12488,12531],256],13096:[[12490,12494],256],13097:[[12494,12483,12488],256],13098:[[12495,12452,12484],256],13099:[[12497,12540,12475,12531,12488],256],13100:[[12497,12540,12484],256],13101:[[12496,12540,12524,12523],256],13102:[[12500,12450,12473,12488,12523],256],13103:[[12500,12463,12523],256],13104:[[12500,12467],256],13105:[[12499,12523],256],13106:[[12501,12449,12521,12483,12489],256],13107:[[12501,12451,12540,12488],256],13108:[[12502,12483,12471,12455,12523],256],13109:[[12501,12521,12531],256],13110:[[12504,12463,12479,12540,12523],256],13111:[[12506,12477],256],13112:[[12506,12491,12498],256],13113:[[12504,12523,12484],256],13114:[[12506,12531,12473],256],13115:[[12506,12540,12472],256],13116:[[12505,12540,12479],256],13117:[[12509,12452,12531,12488],256],13118:[[12508,12523,12488],256],13119:[[12507,12531],256],13120:[[12509,12531,12489],256],13121:[[12507,12540,12523],256],13122:[[12507,12540,12531],256],13123:[[12510,12452,12463,12525],256],13124:[[12510,12452,12523],256],13125:[[12510,12483,12495],256],13126:[[12510,12523,12463],256],13127:[[12510,12531,12471,12519,12531],256],13128:[[12511,12463,12525,12531],256],13129:[[12511,12522],256],13130:[[12511,12522,12496,12540,12523],256],13131:[[12513,12460],256],13132:[[12513,12460,12488,12531],256],13133:[[12513,12540,12488,12523],256],13134:[[12516,12540,12489],256],13135:[[12516,12540,12523],256],13136:[[12518,12450,12531],256],13137:[[12522,12483,12488,12523],256],13138:[[12522,12521],256],13139:[[12523,12500,12540],256],13140:[[12523,12540,12502,12523],256],13141:[[12524,12512],256],13142:[[12524,12531,12488,12466,12531],256],13143:[[12527,12483,12488],256],13144:[[48,28857],256],13145:[[49,28857],256],13146:[[50,28857],256],13147:[[51,28857],256],13148:[[52,28857],256],13149:[[53,28857],256],13150:[[54,28857],256],13151:[[55,28857],256],13152:[[56,28857],256],13153:[[57,28857],256],13154:[[49,48,28857],256],13155:[[49,49,28857],256],13156:[[49,50,28857],256],13157:[[49,51,28857],256],13158:[[49,52,28857],256],13159:[[49,53,28857],256],13160:[[49,54,28857],256],13161:[[49,55,28857],256],13162:[[49,56,28857],256],13163:[[49,57,28857],256],13164:[[50,48,28857],256],13165:[[50,49,28857],256],13166:[[50,50,28857],256],13167:[[50,51,28857],256],13168:[[50,52,28857],256],13169:[[104,80,97],256],13170:[[100,97],256],13171:[[65,85],256],13172:[[98,97,114],256],13173:[[111,86],256],13174:[[112,99],256],13175:[[100,109],256],13176:[[100,109,178],256],13177:[[100,109,179],256],13178:[[73,85],256],13179:[[24179,25104],256],13180:[[26157,21644],256],13181:[[22823,27491],256],13182:[[26126,27835],256],13183:[[26666,24335,20250,31038],256],13184:[[112,65],256],13185:[[110,65],256],13186:[[956,65],256],13187:[[109,65],256],13188:[[107,65],256],13189:[[75,66],256],13190:[[77,66],256],13191:[[71,66],256],13192:[[99,97,108],256],13193:[[107,99,97,108],256],13194:[[112,70],256],13195:[[110,70],256],13196:[[956,70],256],13197:[[956,103],256],13198:[[109,103],256],13199:[[107,103],256],13200:[[72,122],256],13201:[[107,72,122],256],13202:[[77,72,122],256],13203:[[71,72,122],256],13204:[[84,72,122],256],13205:[[956,8467],256],13206:[[109,8467],256],13207:[[100,8467],256],13208:[[107,8467],256],13209:[[102,109],256],13210:[[110,109],256],13211:[[956,109],256],13212:[[109,109],256],13213:[[99,109],256],13214:[[107,109],256],13215:[[109,109,178],256],13216:[[99,109,178],256],13217:[[109,178],256],13218:[[107,109,178],256],13219:[[109,109,179],256],13220:[[99,109,179],256],13221:[[109,179],256],13222:[[107,109,179],256],13223:[[109,8725,115],256],13224:[[109,8725,115,178],256],13225:[[80,97],256],13226:[[107,80,97],256],13227:[[77,80,97],256],13228:[[71,80,97],256],13229:[[114,97,100],256],13230:[[114,97,100,8725,115],256],13231:[[114,97,100,8725,115,178],256],13232:[[112,115],256],13233:[[110,115],256],13234:[[956,115],256],13235:[[109,115],256],13236:[[112,86],256],13237:[[110,86],256],13238:[[956,86],256],13239:[[109,86],256],13240:[[107,86],256],13241:[[77,86],256],13242:[[112,87],256],13243:[[110,87],256],13244:[[956,87],256],13245:[[109,87],256],13246:[[107,87],256],13247:[[77,87],256],13248:[[107,937],256],13249:[[77,937],256],13250:[[97,46,109,46],256],13251:[[66,113],256],13252:[[99,99],256],13253:[[99,100],256],13254:[[67,8725,107,103],256],13255:[[67,111,46],256],13256:[[100,66],256],13257:[[71,121],256],13258:[[104,97],256],13259:[[72,80],256],13260:[[105,110],256],13261:[[75,75],256],13262:[[75,77],256],13263:[[107,116],256],13264:[[108,109],256],13265:[[108,110],256],13266:[[108,111,103],256],13267:[[108,120],256],13268:[[109,98],256],13269:[[109,105,108],256],13270:[[109,111,108],256],13271:[[80,72],256],13272:[[112,46,109,46],256],13273:[[80,80,77],256],13274:[[80,82],256],13275:[[115,114],256],13276:[[83,118],256],13277:[[87,98],256],13278:[[86,8725,109],256],13279:[[65,8725,109],256],13280:[[49,26085],256],13281:[[50,26085],256],13282:[[51,26085],256],13283:[[52,26085],256],13284:[[53,26085],256],13285:[[54,26085],256],13286:[[55,26085],256],13287:[[56,26085],256],13288:[[57,26085],256],13289:[[49,48,26085],256],13290:[[49,49,26085],256],13291:[[49,50,26085],256],13292:[[49,51,26085],256],13293:[[49,52,26085],256],13294:[[49,53,26085],256],13295:[[49,54,26085],256],13296:[[49,55,26085],256],13297:[[49,56,26085],256],13298:[[49,57,26085],256],13299:[[50,48,26085],256],13300:[[50,49,26085],256],13301:[[50,50,26085],256],13302:[[50,51,26085],256],13303:[[50,52,26085],256],13304:[[50,53,26085],256],13305:[[50,54,26085],256],13306:[[50,55,26085],256],13307:[[50,56,26085],256],13308:[[50,57,26085],256],13309:[[51,48,26085],256],13310:[[51,49,26085],256],13311:[[103,97,108],256]},27136:{92912:[,1],92913:[,1],92914:[,1],92915:[,1],92916:[,1]},27392:{92976:[,230],92977:[,230],92978:[,230],92979:[,230],92980:[,230],92981:[,230],92982:[,230]},42496:{42607:[,230],42612:[,230],42613:[,230],42614:[,230],42615:[,230],42616:[,230],42617:[,230],42618:[,230],42619:[,230],42620:[,230],42621:[,230],42652:[[1098],256],42653:[[1100],256],42655:[,230],42736:[,230],42737:[,230]},42752:{42864:[[42863],256],43e3:[[294],256],43001:[[339],256]},43008:{43014:[,9],43204:[,9],43232:[,230],43233:[,230],43234:[,230],43235:[,230],43236:[,230],43237:[,230],43238:[,230],43239:[,230],43240:[,230],43241:[,230],43242:[,230],43243:[,230],43244:[,230],43245:[,230],43246:[,230],43247:[,230],43248:[,230],43249:[,230]},43264:{43307:[,220],43308:[,220],43309:[,220],43347:[,9],43443:[,7],43456:[,9]},43520:{43696:[,230],43698:[,230],43699:[,230],43700:[,220],43703:[,230],43704:[,230],43710:[,230],43711:[,230],43713:[,230],43766:[,9]},43776:{43868:[[42791],256],43869:[[43831],256],43870:[[619],256],43871:[[43858],256],44013:[,9]},48128:{113822:[,1]},53504:{119134:[[119127,119141],512],119135:[[119128,119141],512],119136:[[119135,119150],512],119137:[[119135,119151],512],119138:[[119135,119152],512],119139:[[119135,119153],512],119140:[[119135,119154],512],119141:[,216],119142:[,216],119143:[,1],119144:[,1],119145:[,1],119149:[,226],119150:[,216],119151:[,216],119152:[,216],119153:[,216],119154:[,216],119163:[,220],119164:[,220],119165:[,220],119166:[,220],119167:[,220],119168:[,220],119169:[,220],119170:[,220],119173:[,230],119174:[,230],119175:[,230],119176:[,230],119177:[,230],119178:[,220],119179:[,220],119210:[,230],119211:[,230],119212:[,230],119213:[,230],119227:[[119225,119141],512],119228:[[119226,119141],512],119229:[[119227,119150],512],119230:[[119228,119150],512],119231:[[119227,119151],512],119232:[[119228,119151],512]},53760:{119362:[,230],119363:[,230],119364:[,230]},54272:{119808:[[65],256],119809:[[66],256],119810:[[67],256],119811:[[68],256],119812:[[69],256],119813:[[70],256],119814:[[71],256],119815:[[72],256],119816:[[73],256],119817:[[74],256],119818:[[75],256],119819:[[76],256],119820:[[77],256],119821:[[78],256],119822:[[79],256],119823:[[80],256],119824:[[81],256],119825:[[82],256],119826:[[83],256],119827:[[84],256],119828:[[85],256],119829:[[86],256],119830:[[87],256],119831:[[88],256],119832:[[89],256],119833:[[90],256],119834:[[97],256],119835:[[98],256],119836:[[99],256],119837:[[100],256],119838:[[101],256],119839:[[102],256],119840:[[103],256],119841:[[104],256],119842:[[105],256],119843:[[106],256],119844:[[107],256],119845:[[108],256],119846:[[109],256],119847:[[110],256],119848:[[111],256],119849:[[112],256],119850:[[113],256],119851:[[114],256],119852:[[115],256],119853:[[116],256],119854:[[117],256],119855:[[118],256],119856:[[119],256],119857:[[120],256],119858:[[121],256],119859:[[122],256],119860:[[65],256],119861:[[66],256],119862:[[67],256],119863:[[68],256],119864:[[69],256],119865:[[70],256],119866:[[71],256],119867:[[72],256],119868:[[73],256],119869:[[74],256],119870:[[75],256],119871:[[76],256],119872:[[77],256],119873:[[78],256],119874:[[79],256],119875:[[80],256],119876:[[81],256],119877:[[82],256],119878:[[83],256],119879:[[84],256],119880:[[85],256],119881:[[86],256],119882:[[87],256],119883:[[88],256],119884:[[89],256],119885:[[90],256],119886:[[97],256],119887:[[98],256],119888:[[99],256],119889:[[100],256],119890:[[101],256],119891:[[102],256],119892:[[103],256],119894:[[105],256],119895:[[106],256],119896:[[107],256],119897:[[108],256],119898:[[109],256],119899:[[110],256],119900:[[111],256],119901:[[112],256],119902:[[113],256],119903:[[114],256],119904:[[115],256],119905:[[116],256],119906:[[117],256],119907:[[118],256],119908:[[119],256],119909:[[120],256],119910:[[121],256],119911:[[122],256],119912:[[65],256],119913:[[66],256],119914:[[67],256],119915:[[68],256],119916:[[69],256],119917:[[70],256],119918:[[71],256],119919:[[72],256],119920:[[73],256],119921:[[74],256],119922:[[75],256],119923:[[76],256],119924:[[77],256],119925:[[78],256],119926:[[79],256],119927:[[80],256],119928:[[81],256],119929:[[82],256],119930:[[83],256],119931:[[84],256],119932:[[85],256],119933:[[86],256],119934:[[87],256],119935:[[88],256],119936:[[89],256],119937:[[90],256],119938:[[97],256],119939:[[98],256],119940:[[99],256],119941:[[100],256],119942:[[101],256],119943:[[102],256],119944:[[103],256],119945:[[104],256],119946:[[105],256],119947:[[106],256],119948:[[107],256],119949:[[108],256],119950:[[109],256],119951:[[110],256],119952:[[111],256],119953:[[112],256],119954:[[113],256],119955:[[114],256],119956:[[115],256],119957:[[116],256],119958:[[117],256],119959:[[118],256],119960:[[119],256],119961:[[120],256],119962:[[121],256],119963:[[122],256],119964:[[65],256],119966:[[67],256],119967:[[68],256],119970:[[71],256],119973:[[74],256],119974:[[75],256],119977:[[78],256],119978:[[79],256],119979:[[80],256],119980:[[81],256],119982:[[83],256],119983:[[84],256],119984:[[85],256],119985:[[86],256],119986:[[87],256],119987:[[88],256],119988:[[89],256],119989:[[90],256],119990:[[97],256],119991:[[98],256],119992:[[99],256],119993:[[100],256],119995:[[102],256],119997:[[104],256],119998:[[105],256],119999:[[106],256],12e4:[[107],256],120001:[[108],256],120002:[[109],256],120003:[[110],256],120005:[[112],256],120006:[[113],256],120007:[[114],256],120008:[[115],256],120009:[[116],256],120010:[[117],256],120011:[[118],256],120012:[[119],256],120013:[[120],256],120014:[[121],256],120015:[[122],256],120016:[[65],256],120017:[[66],256],120018:[[67],256],120019:[[68],256],120020:[[69],256],120021:[[70],256],120022:[[71],256],120023:[[72],256],120024:[[73],256],120025:[[74],256],120026:[[75],256],120027:[[76],256],120028:[[77],256],120029:[[78],256],120030:[[79],256],120031:[[80],256],120032:[[81],256],120033:[[82],256],120034:[[83],256],120035:[[84],256],120036:[[85],256],120037:[[86],256],120038:[[87],256],120039:[[88],256],120040:[[89],256],120041:[[90],256],120042:[[97],256],120043:[[98],256],120044:[[99],256],120045:[[100],256],120046:[[101],256],120047:[[102],256],120048:[[103],256],120049:[[104],256],120050:[[105],256],120051:[[106],256],120052:[[107],256],120053:[[108],256],120054:[[109],256],120055:[[110],256],120056:[[111],256],120057:[[112],256],120058:[[113],256],120059:[[114],256],120060:[[115],256],120061:[[116],256],120062:[[117],256],120063:[[118],256]},54528:{120064:[[119],256],120065:[[120],256],120066:[[121],256],120067:[[122],256],120068:[[65],256],120069:[[66],256],120071:[[68],256],120072:[[69],256],120073:[[70],256],120074:[[71],256],120077:[[74],256],120078:[[75],256],120079:[[76],256],120080:[[77],256],120081:[[78],256],120082:[[79],256],120083:[[80],256],120084:[[81],256],120086:[[83],256],120087:[[84],256],120088:[[85],256],120089:[[86],256],120090:[[87],256],120091:[[88],256],120092:[[89],256],120094:[[97],256],120095:[[98],256],120096:[[99],256],120097:[[100],256],120098:[[101],256],120099:[[102],256],120100:[[103],256],120101:[[104],256],120102:[[105],256],120103:[[106],256],120104:[[107],256],120105:[[108],256],120106:[[109],256],120107:[[110],256],120108:[[111],256],120109:[[112],256],120110:[[113],256],120111:[[114],256],120112:[[115],256],120113:[[116],256],120114:[[117],256],120115:[[118],256],120116:[[119],256],120117:[[120],256],120118:[[121],256],120119:[[122],256],120120:[[65],256],120121:[[66],256],120123:[[68],256],120124:[[69],256],120125:[[70],256],120126:[[71],256],120128:[[73],256],120129:[[74],256],120130:[[75],256],120131:[[76],256],120132:[[77],256],120134:[[79],256],120138:[[83],256],120139:[[84],256],120140:[[85],256],120141:[[86],256],120142:[[87],256],120143:[[88],256],120144:[[89],256],120146:[[97],256],120147:[[98],256],120148:[[99],256],120149:[[100],256],120150:[[101],256],120151:[[102],256],120152:[[103],256],120153:[[104],256],120154:[[105],256],120155:[[106],256],120156:[[107],256],120157:[[108],256],120158:[[109],256],120159:[[110],256],120160:[[111],256],120161:[[112],256],120162:[[113],256],120163:[[114],256],120164:[[115],256],120165:[[116],256],120166:[[117],256],120167:[[118],256],120168:[[119],256],120169:[[120],256],120170:[[121],256],120171:[[122],256],120172:[[65],256],120173:[[66],256],120174:[[67],256],120175:[[68],256],120176:[[69],256],120177:[[70],256],120178:[[71],256],120179:[[72],256],120180:[[73],256],120181:[[74],256],120182:[[75],256],120183:[[76],256],120184:[[77],256],120185:[[78],256],120186:[[79],256],120187:[[80],256],120188:[[81],256],120189:[[82],256],120190:[[83],256],120191:[[84],256],120192:[[85],256],120193:[[86],256],120194:[[87],256],120195:[[88],256],120196:[[89],256],120197:[[90],256],120198:[[97],256],120199:[[98],256],120200:[[99],256],120201:[[100],256],120202:[[101],256],120203:[[102],256],120204:[[103],256],120205:[[104],256],120206:[[105],256],120207:[[106],256],120208:[[107],256],120209:[[108],256],120210:[[109],256],120211:[[110],256],120212:[[111],256],120213:[[112],256],120214:[[113],256],120215:[[114],256],120216:[[115],256],120217:[[116],256],120218:[[117],256],120219:[[118],256],120220:[[119],256],120221:[[120],256],120222:[[121],256],120223:[[122],256],120224:[[65],256],120225:[[66],256],120226:[[67],256],120227:[[68],256],120228:[[69],256],120229:[[70],256],120230:[[71],256],120231:[[72],256],120232:[[73],256],120233:[[74],256],120234:[[75],256],120235:[[76],256],120236:[[77],256],120237:[[78],256],120238:[[79],256],120239:[[80],256],120240:[[81],256],120241:[[82],256],120242:[[83],256],120243:[[84],256],120244:[[85],256],120245:[[86],256],120246:[[87],256],120247:[[88],256],120248:[[89],256],120249:[[90],256],120250:[[97],256],120251:[[98],256],120252:[[99],256],120253:[[100],256],120254:[[101],256],120255:[[102],256],120256:[[103],256],120257:[[104],256],120258:[[105],256],120259:[[106],256],120260:[[107],256],120261:[[108],256],120262:[[109],256],120263:[[110],256],120264:[[111],256],120265:[[112],256],120266:[[113],256],120267:[[114],256],120268:[[115],256],120269:[[116],256],120270:[[117],256],120271:[[118],256],120272:[[119],256],120273:[[120],256],120274:[[121],256],120275:[[122],256],120276:[[65],256],120277:[[66],256],120278:[[67],256],120279:[[68],256],120280:[[69],256],120281:[[70],256],120282:[[71],256],120283:[[72],256],120284:[[73],256],120285:[[74],256],120286:[[75],256],120287:[[76],256],120288:[[77],256],120289:[[78],256],120290:[[79],256],120291:[[80],256],120292:[[81],256],120293:[[82],256],120294:[[83],256],120295:[[84],256],120296:[[85],256],120297:[[86],256],120298:[[87],256],120299:[[88],256],120300:[[89],256],120301:[[90],256],120302:[[97],256],120303:[[98],256],120304:[[99],256],120305:[[100],256],120306:[[101],256],120307:[[102],256],120308:[[103],256],120309:[[104],256],120310:[[105],256],120311:[[106],256],120312:[[107],256],120313:[[108],256],120314:[[109],256],120315:[[110],256],120316:[[111],256],120317:[[112],256],120318:[[113],256],120319:[[114],256]},54784:{120320:[[115],256],120321:[[116],256],120322:[[117],256],120323:[[118],256],120324:[[119],256],120325:[[120],256],120326:[[121],256],120327:[[122],256],120328:[[65],256],120329:[[66],256],120330:[[67],256],120331:[[68],256],120332:[[69],256],120333:[[70],256],120334:[[71],256],120335:[[72],256],120336:[[73],256],120337:[[74],256],120338:[[75],256],120339:[[76],256],120340:[[77],256],120341:[[78],256],120342:[[79],256],120343:[[80],256],120344:[[81],256],120345:[[82],256],120346:[[83],256],120347:[[84],256],120348:[[85],256],120349:[[86],256],120350:[[87],256],120351:[[88],256],120352:[[89],256],120353:[[90],256],120354:[[97],256],120355:[[98],256],120356:[[99],256],120357:[[100],256],120358:[[101],256],120359:[[102],256],120360:[[103],256],120361:[[104],256],120362:[[105],256],120363:[[106],256],120364:[[107],256],120365:[[108],256],120366:[[109],256],120367:[[110],256],120368:[[111],256],120369:[[112],256],120370:[[113],256],120371:[[114],256],120372:[[115],256],120373:[[116],256],120374:[[117],256],120375:[[118],256],120376:[[119],256],120377:[[120],256],120378:[[121],256],120379:[[122],256],120380:[[65],256],120381:[[66],256],120382:[[67],256],120383:[[68],256],120384:[[69],256],120385:[[70],256],120386:[[71],256],120387:[[72],256],120388:[[73],256],120389:[[74],256],120390:[[75],256],120391:[[76],256],120392:[[77],256],120393:[[78],256],120394:[[79],256],120395:[[80],256],120396:[[81],256],120397:[[82],256],120398:[[83],256],120399:[[84],256],120400:[[85],256],120401:[[86],256],120402:[[87],256],120403:[[88],256],120404:[[89],256],120405:[[90],256],120406:[[97],256],120407:[[98],256],120408:[[99],256],120409:[[100],256],120410:[[101],256],120411:[[102],256],120412:[[103],256],120413:[[104],256],120414:[[105],256],120415:[[106],256],120416:[[107],256],120417:[[108],256],120418:[[109],256],120419:[[110],256],120420:[[111],256],120421:[[112],256],120422:[[113],256],120423:[[114],256],120424:[[115],256],120425:[[116],256],120426:[[117],256],120427:[[118],256],120428:[[119],256],120429:[[120],256],120430:[[121],256],120431:[[122],256],120432:[[65],256],120433:[[66],256],120434:[[67],256],120435:[[68],256],120436:[[69],256],120437:[[70],256],120438:[[71],256],120439:[[72],256],120440:[[73],256],120441:[[74],256],120442:[[75],256],120443:[[76],256],120444:[[77],256],120445:[[78],256],120446:[[79],256],120447:[[80],256],120448:[[81],256],120449:[[82],256],120450:[[83],256],120451:[[84],256],120452:[[85],256],120453:[[86],256],120454:[[87],256],120455:[[88],256],120456:[[89],256],120457:[[90],256],120458:[[97],256],120459:[[98],256],120460:[[99],256],120461:[[100],256],120462:[[101],256],120463:[[102],256],120464:[[103],256],120465:[[104],256],120466:[[105],256],120467:[[106],256],120468:[[107],256],120469:[[108],256],120470:[[109],256],120471:[[110],256],120472:[[111],256],120473:[[112],256],120474:[[113],256],120475:[[114],256],120476:[[115],256],120477:[[116],256],120478:[[117],256],120479:[[118],256],120480:[[119],256],120481:[[120],256],120482:[[121],256],120483:[[122],256],120484:[[305],256],120485:[[567],256],120488:[[913],256],120489:[[914],256],120490:[[915],256],120491:[[916],256],120492:[[917],256],120493:[[918],256],120494:[[919],256],120495:[[920],256],120496:[[921],256],120497:[[922],256],120498:[[923],256],120499:[[924],256],120500:[[925],256],120501:[[926],256],120502:[[927],256],120503:[[928],256],120504:[[929],256],120505:[[1012],256],120506:[[931],256],120507:[[932],256],120508:[[933],256],120509:[[934],256],120510:[[935],256],120511:[[936],256],120512:[[937],256],120513:[[8711],256],120514:[[945],256],120515:[[946],256],120516:[[947],256],120517:[[948],256],120518:[[949],256],120519:[[950],256],120520:[[951],256],120521:[[952],256],120522:[[953],256],120523:[[954],256],120524:[[955],256],120525:[[956],256],120526:[[957],256],120527:[[958],256],120528:[[959],256],120529:[[960],256],120530:[[961],256],120531:[[962],256],120532:[[963],256],120533:[[964],256],120534:[[965],256],120535:[[966],256],120536:[[967],256],120537:[[968],256],120538:[[969],256],120539:[[8706],256],120540:[[1013],256],120541:[[977],256],120542:[[1008],256],120543:[[981],256],120544:[[1009],256],120545:[[982],256],120546:[[913],256],120547:[[914],256],120548:[[915],256],120549:[[916],256],120550:[[917],256],120551:[[918],256],120552:[[919],256],120553:[[920],256],120554:[[921],256],120555:[[922],256],120556:[[923],256],120557:[[924],256],120558:[[925],256],120559:[[926],256],120560:[[927],256],120561:[[928],256],120562:[[929],256],120563:[[1012],256],120564:[[931],256],120565:[[932],256],120566:[[933],256],120567:[[934],256],120568:[[935],256],120569:[[936],256],120570:[[937],256],120571:[[8711],256],120572:[[945],256],120573:[[946],256],120574:[[947],256],120575:[[948],256]},55040:{120576:[[949],256],120577:[[950],256],120578:[[951],256],120579:[[952],256],120580:[[953],256],120581:[[954],256],120582:[[955],256],120583:[[956],256],120584:[[957],256],120585:[[958],256],120586:[[959],256],120587:[[960],256],120588:[[961],256],120589:[[962],256],120590:[[963],256],120591:[[964],256],120592:[[965],256],120593:[[966],256],120594:[[967],256],120595:[[968],256],120596:[[969],256],120597:[[8706],256],120598:[[1013],256],120599:[[977],256],120600:[[1008],256],120601:[[981],256],120602:[[1009],256],120603:[[982],256],120604:[[913],256],120605:[[914],256],120606:[[915],256],120607:[[916],256],120608:[[917],256],120609:[[918],256],120610:[[919],256],120611:[[920],256],120612:[[921],256],120613:[[922],256],120614:[[923],256],120615:[[924],256],120616:[[925],256],120617:[[926],256],120618:[[927],256],120619:[[928],256],120620:[[929],256],120621:[[1012],256],120622:[[931],256],120623:[[932],256],120624:[[933],256],120625:[[934],256],120626:[[935],256],120627:[[936],256],120628:[[937],256],120629:[[8711],256],120630:[[945],256],120631:[[946],256],120632:[[947],256],120633:[[948],256],120634:[[949],256],120635:[[950],256],120636:[[951],256],120637:[[952],256],120638:[[953],256],120639:[[954],256],120640:[[955],256],120641:[[956],256],120642:[[957],256],120643:[[958],256],120644:[[959],256],120645:[[960],256],120646:[[961],256],120647:[[962],256],120648:[[963],256],120649:[[964],256],120650:[[965],256],120651:[[966],256],120652:[[967],256],120653:[[968],256],120654:[[969],256],120655:[[8706],256],120656:[[1013],256],120657:[[977],256],120658:[[1008],256],120659:[[981],256],120660:[[1009],256],120661:[[982],256],120662:[[913],256],120663:[[914],256],120664:[[915],256],120665:[[916],256],120666:[[917],256],120667:[[918],256],120668:[[919],256],120669:[[920],256],120670:[[921],256],120671:[[922],256],120672:[[923],256],120673:[[924],256],120674:[[925],256],120675:[[926],256],120676:[[927],256],120677:[[928],256],120678:[[929],256],120679:[[1012],256],120680:[[931],256],120681:[[932],256],120682:[[933],256],120683:[[934],256],120684:[[935],256],120685:[[936],256],120686:[[937],256],120687:[[8711],256],120688:[[945],256],120689:[[946],256],120690:[[947],256],120691:[[948],256],120692:[[949],256],120693:[[950],256],120694:[[951],256],120695:[[952],256],120696:[[953],256],120697:[[954],256],120698:[[955],256],120699:[[956],256],120700:[[957],256],120701:[[958],256],120702:[[959],256],120703:[[960],256],120704:[[961],256],120705:[[962],256],120706:[[963],256],120707:[[964],256],120708:[[965],256],120709:[[966],256],120710:[[967],256],120711:[[968],256],120712:[[969],256],120713:[[8706],256],120714:[[1013],256],120715:[[977],256],120716:[[1008],256],120717:[[981],256],120718:[[1009],256],120719:[[982],256],120720:[[913],256],120721:[[914],256],120722:[[915],256],120723:[[916],256],120724:[[917],256],120725:[[918],256],120726:[[919],256],120727:[[920],256],120728:[[921],256],120729:[[922],256],120730:[[923],256],120731:[[924],256],120732:[[925],256],120733:[[926],256],120734:[[927],256],120735:[[928],256],120736:[[929],256],120737:[[1012],256],120738:[[931],256],120739:[[932],256],120740:[[933],256],120741:[[934],256],120742:[[935],256],120743:[[936],256],120744:[[937],256],120745:[[8711],256],120746:[[945],256],120747:[[946],256],120748:[[947],256],120749:[[948],256],120750:[[949],256],120751:[[950],256],120752:[[951],256],120753:[[952],256],120754:[[953],256],120755:[[954],256],120756:[[955],256],120757:[[956],256],120758:[[957],256],120759:[[958],256],120760:[[959],256],120761:[[960],256],120762:[[961],256],120763:[[962],256],120764:[[963],256],120765:[[964],256],120766:[[965],256],120767:[[966],256],120768:[[967],256],120769:[[968],256],120770:[[969],256],120771:[[8706],256],120772:[[1013],256],120773:[[977],256],120774:[[1008],256],120775:[[981],256],120776:[[1009],256],120777:[[982],256],120778:[[988],256],120779:[[989],256],120782:[[48],256],120783:[[49],256],120784:[[50],256],120785:[[51],256],120786:[[52],256],120787:[[53],256],120788:[[54],256],120789:[[55],256],120790:[[56],256],120791:[[57],256],120792:[[48],256],120793:[[49],256],120794:[[50],256],120795:[[51],256],120796:[[52],256],120797:[[53],256],120798:[[54],256],120799:[[55],256],120800:[[56],256],120801:[[57],256],120802:[[48],256],120803:[[49],256],120804:[[50],256],120805:[[51],256],120806:[[52],256],120807:[[53],256],120808:[[54],256],120809:[[55],256],120810:[[56],256],120811:[[57],256],120812:[[48],256],120813:[[49],256],120814:[[50],256],120815:[[51],256],120816:[[52],256],120817:[[53],256],120818:[[54],256],120819:[[55],256],120820:[[56],256],120821:[[57],256],120822:[[48],256],120823:[[49],256],120824:[[50],256],120825:[[51],256],120826:[[52],256],120827:[[53],256],120828:[[54],256],120829:[[55],256],120830:[[56],256],120831:[[57],256]},59392:{125136:[,220],125137:[,220],125138:[,220],125139:[,220],125140:[,220],125141:[,220],125142:[,220]},60928:{126464:[[1575],256],126465:[[1576],256],126466:[[1580],256],126467:[[1583],256],126469:[[1608],256],126470:[[1586],256],126471:[[1581],256],126472:[[1591],256],126473:[[1610],256],126474:[[1603],256],126475:[[1604],256],126476:[[1605],256],126477:[[1606],256],126478:[[1587],256],126479:[[1593],256],126480:[[1601],256],126481:[[1589],256],126482:[[1602],256],126483:[[1585],256],126484:[[1588],256],126485:[[1578],256],126486:[[1579],256],126487:[[1582],256],126488:[[1584],256],126489:[[1590],256],126490:[[1592],256],126491:[[1594],256],126492:[[1646],256],126493:[[1722],256],126494:[[1697],256],126495:[[1647],256],126497:[[1576],256],126498:[[1580],256],126500:[[1607],256],126503:[[1581],256],126505:[[1610],256],126506:[[1603],256],126507:[[1604],256],126508:[[1605],256],126509:[[1606],256],126510:[[1587],256],126511:[[1593],256],126512:[[1601],256],126513:[[1589],256],126514:[[1602],256],126516:[[1588],256],126517:[[1578],256],126518:[[1579],256],126519:[[1582],256],126521:[[1590],256],126523:[[1594],256],126530:[[1580],256],126535:[[1581],256],126537:[[1610],256],126539:[[1604],256],126541:[[1606],256],126542:[[1587],256],126543:[[1593],256],126545:[[1589],256],126546:[[1602],256],126548:[[1588],256],126551:[[1582],256],126553:[[1590],256],126555:[[1594],256],126557:[[1722],256],126559:[[1647],256],126561:[[1576],256],126562:[[1580],256],126564:[[1607],256],126567:[[1581],256],126568:[[1591],256],126569:[[1610],256],126570:[[1603],256],126572:[[1605],256],126573:[[1606],256],126574:[[1587],256],126575:[[1593],256],126576:[[1601],256],126577:[[1589],256],126578:[[1602],256],126580:[[1588],256],126581:[[1578],256],126582:[[1579],256],126583:[[1582],256],126585:[[1590],256],126586:[[1592],256],126587:[[1594],256],126588:[[1646],256],126590:[[1697],256],126592:[[1575],256],126593:[[1576],256],126594:[[1580],256],126595:[[1583],256],126596:[[1607],256],126597:[[1608],256],126598:[[1586],256],126599:[[1581],256],126600:[[1591],256],126601:[[1610],256],126603:[[1604],256],126604:[[1605],256],126605:[[1606],256],126606:[[1587],256],126607:[[1593],256],126608:[[1601],256],126609:[[1589],256],126610:[[1602],256],126611:[[1585],256],126612:[[1588],256],126613:[[1578],256],126614:[[1579],256],126615:[[1582],256],126616:[[1584],256],126617:[[1590],256],126618:[[1592],256],126619:[[1594],256],126625:[[1576],256],126626:[[1580],256],126627:[[1583],256],126629:[[1608],256],126630:[[1586],256],126631:[[1581],256],126632:[[1591],256],126633:[[1610],256],126635:[[1604],256],126636:[[1605],256],126637:[[1606],256],126638:[[1587],256],126639:[[1593],256],126640:[[1601],256],126641:[[1589],256],126642:[[1602],256],126643:[[1585],256],126644:[[1588],256],126645:[[1578],256],126646:[[1579],256],126647:[[1582],256],126648:[[1584],256],126649:[[1590],256],126650:[[1592],256],126651:[[1594],256]},61696:{127232:[[48,46],256],127233:[[48,44],256],127234:[[49,44],256],127235:[[50,44],256],127236:[[51,44],256],127237:[[52,44],256],127238:[[53,44],256],127239:[[54,44],256],127240:[[55,44],256],127241:[[56,44],256],127242:[[57,44],256],127248:[[40,65,41],256],127249:[[40,66,41],256],127250:[[40,67,41],256],127251:[[40,68,41],256],127252:[[40,69,41],256],127253:[[40,70,41],256],127254:[[40,71,41],256],127255:[[40,72,41],256],127256:[[40,73,41],256],127257:[[40,74,41],256],127258:[[40,75,41],256],127259:[[40,76,41],256],127260:[[40,77,41],256],127261:[[40,78,41],256],127262:[[40,79,41],256],127263:[[40,80,41],256],127264:[[40,81,41],256],127265:[[40,82,41],256],127266:[[40,83,41],256],127267:[[40,84,41],256],127268:[[40,85,41],256],127269:[[40,86,41],256],127270:[[40,87,41],256],127271:[[40,88,41],256],127272:[[40,89,41],256],127273:[[40,90,41],256],127274:[[12308,83,12309],256],127275:[[67],256],127276:[[82],256],127277:[[67,68],256],127278:[[87,90],256],127280:[[65],256],127281:[[66],256],127282:[[67],256],127283:[[68],256],127284:[[69],256],127285:[[70],256],127286:[[71],256],127287:[[72],256],127288:[[73],256],127289:[[74],256],127290:[[75],256],127291:[[76],256],127292:[[77],256],127293:[[78],256],127294:[[79],256],127295:[[80],256],127296:[[81],256],127297:[[82],256],127298:[[83],256],127299:[[84],256],127300:[[85],256],127301:[[86],256],127302:[[87],256],127303:[[88],256],127304:[[89],256],127305:[[90],256],127306:[[72,86],256],127307:[[77,86],256],127308:[[83,68],256],127309:[[83,83],256],127310:[[80,80,86],256],127311:[[87,67],256],127338:[[77,67],256],127339:[[77,68],256],127376:[[68,74],256]},61952:{127488:[[12411,12363],256],127489:[[12467,12467],256],127490:[[12469],256],127504:[[25163],256],127505:[[23383],256],127506:[[21452],256],127507:[[12487],256],127508:[[20108],256],127509:[[22810],256],127510:[[35299],256],127511:[[22825],256],127512:[[20132],256],127513:[[26144],256],127514:[[28961],256],127515:[[26009],256],127516:[[21069],256],127517:[[24460],256],127518:[[20877],256],127519:[[26032],256],127520:[[21021],256],127521:[[32066],256],127522:[[29983],256],127523:[[36009],256],127524:[[22768],256],127525:[[21561],256],127526:[[28436],256],127527:[[25237],256],127528:[[25429],256],127529:[[19968],256],127530:[[19977],256],127531:[[36938],256],127532:[[24038],256],127533:[[20013],256],127534:[[21491],256],127535:[[25351],256],127536:[[36208],256],127537:[[25171],256],127538:[[31105],256],127539:[[31354],256],127540:[[21512],256],127541:[[28288],256],127542:[[26377],256],127543:[[26376],256],127544:[[30003],256],127545:[[21106],256],127546:[[21942],256],127552:[[12308,26412,12309],256],127553:[[12308,19977,12309],256],127554:[[12308,20108,12309],256],127555:[[12308,23433,12309],256],127556:[[12308,28857,12309],256],127557:[[12308,25171,12309],256],127558:[[12308,30423,12309],256],127559:[[12308,21213,12309],256],127560:[[12308,25943,12309],256],127568:[[24471],256],127569:[[21487],256]},63488:{194560:[[20029]],194561:[[20024]],194562:[[20033]],194563:[[131362]],194564:[[20320]],194565:[[20398]],194566:[[20411]],194567:[[20482]],194568:[[20602]],194569:[[20633]],194570:[[20711]],194571:[[20687]],194572:[[13470]],194573:[[132666]],194574:[[20813]],194575:[[20820]],194576:[[20836]],194577:[[20855]],194578:[[132380]],194579:[[13497]],194580:[[20839]],194581:[[20877]],194582:[[132427]],194583:[[20887]],194584:[[20900]],194585:[[20172]],194586:[[20908]],194587:[[20917]],194588:[[168415]],194589:[[20981]],194590:[[20995]],194591:[[13535]],194592:[[21051]],194593:[[21062]],194594:[[21106]],194595:[[21111]],194596:[[13589]],194597:[[21191]],194598:[[21193]],194599:[[21220]],194600:[[21242]],194601:[[21253]],194602:[[21254]],194603:[[21271]],194604:[[21321]],194605:[[21329]],194606:[[21338]],194607:[[21363]],194608:[[21373]],194609:[[21375]],194610:[[21375]],194611:[[21375]],194612:[[133676]],194613:[[28784]],194614:[[21450]],194615:[[21471]],194616:[[133987]],194617:[[21483]],194618:[[21489]],194619:[[21510]],194620:[[21662]],194621:[[21560]],194622:[[21576]],194623:[[21608]],194624:[[21666]],194625:[[21750]],194626:[[21776]],194627:[[21843]],194628:[[21859]],194629:[[21892]],194630:[[21892]],194631:[[21913]],194632:[[21931]],194633:[[21939]],194634:[[21954]],194635:[[22294]],194636:[[22022]],194637:[[22295]],194638:[[22097]],194639:[[22132]],194640:[[20999]],194641:[[22766]],194642:[[22478]],194643:[[22516]],194644:[[22541]],194645:[[22411]],194646:[[22578]],194647:[[22577]],194648:[[22700]],194649:[[136420]],194650:[[22770]],194651:[[22775]],194652:[[22790]],194653:[[22810]],194654:[[22818]],194655:[[22882]],194656:[[136872]],194657:[[136938]],194658:[[23020]],194659:[[23067]],194660:[[23079]],194661:[[23e3]],194662:[[23142]],194663:[[14062]],194664:[[14076]],194665:[[23304]],194666:[[23358]],194667:[[23358]],194668:[[137672]],194669:[[23491]],194670:[[23512]],194671:[[23527]],194672:[[23539]],194673:[[138008]],194674:[[23551]],194675:[[23558]],194676:[[24403]],194677:[[23586]],194678:[[14209]],194679:[[23648]],194680:[[23662]],194681:[[23744]],194682:[[23693]],194683:[[138724]],194684:[[23875]],194685:[[138726]],194686:[[23918]],194687:[[23915]],194688:[[23932]],194689:[[24033]],194690:[[24034]],194691:[[14383]],194692:[[24061]],194693:[[24104]],194694:[[24125]],194695:[[24169]],194696:[[14434]],194697:[[139651]],194698:[[14460]],194699:[[24240]],194700:[[24243]],194701:[[24246]],194702:[[24266]],194703:[[172946]],194704:[[24318]],194705:[[140081]],194706:[[140081]],194707:[[33281]],194708:[[24354]],194709:[[24354]],194710:[[14535]],194711:[[144056]],194712:[[156122]],194713:[[24418]],194714:[[24427]],194715:[[14563]],194716:[[24474]],194717:[[24525]],194718:[[24535]],194719:[[24569]],194720:[[24705]],194721:[[14650]],194722:[[14620]],194723:[[24724]],194724:[[141012]],194725:[[24775]],194726:[[24904]],194727:[[24908]],194728:[[24910]],194729:[[24908]],194730:[[24954]],194731:[[24974]],194732:[[25010]],194733:[[24996]],194734:[[25007]],194735:[[25054]],194736:[[25074]],194737:[[25078]],194738:[[25104]],194739:[[25115]],194740:[[25181]],194741:[[25265]],194742:[[25300]],194743:[[25424]],194744:[[142092]],194745:[[25405]],194746:[[25340]],194747:[[25448]],194748:[[25475]],194749:[[25572]],194750:[[142321]],194751:[[25634]],194752:[[25541]],194753:[[25513]],194754:[[14894]],194755:[[25705]],194756:[[25726]],194757:[[25757]],194758:[[25719]],194759:[[14956]],194760:[[25935]],194761:[[25964]],194762:[[143370]],194763:[[26083]],194764:[[26360]],194765:[[26185]],194766:[[15129]],194767:[[26257]],194768:[[15112]],194769:[[15076]],194770:[[20882]],194771:[[20885]],194772:[[26368]],194773:[[26268]],194774:[[32941]],194775:[[17369]],194776:[[26391]],194777:[[26395]],194778:[[26401]],194779:[[26462]],194780:[[26451]],194781:[[144323]],194782:[[15177]],194783:[[26618]],194784:[[26501]],194785:[[26706]],194786:[[26757]],194787:[[144493]],194788:[[26766]],194789:[[26655]],194790:[[26900]],194791:[[15261]],194792:[[26946]],194793:[[27043]],194794:[[27114]],194795:[[27304]],194796:[[145059]],194797:[[27355]],194798:[[15384]],194799:[[27425]],194800:[[145575]],194801:[[27476]],194802:[[15438]],194803:[[27506]],194804:[[27551]],194805:[[27578]],194806:[[27579]],194807:[[146061]],194808:[[138507]],194809:[[146170]],194810:[[27726]],194811:[[146620]],194812:[[27839]],194813:[[27853]],194814:[[27751]],194815:[[27926]]},63744:{63744:[[35912]],63745:[[26356]],63746:[[36554]],63747:[[36040]],63748:[[28369]],63749:[[20018]],63750:[[21477]],63751:[[40860]],63752:[[40860]],63753:[[22865]],63754:[[37329]],63755:[[21895]],63756:[[22856]],63757:[[25078]],63758:[[30313]],63759:[[32645]],63760:[[34367]],63761:[[34746]],63762:[[35064]],63763:[[37007]],63764:[[27138]],63765:[[27931]],63766:[[28889]],63767:[[29662]],63768:[[33853]],63769:[[37226]],63770:[[39409]],63771:[[20098]],63772:[[21365]],63773:[[27396]],63774:[[29211]],63775:[[34349]],63776:[[40478]],63777:[[23888]],63778:[[28651]],63779:[[34253]],63780:[[35172]],63781:[[25289]],63782:[[33240]],63783:[[34847]],63784:[[24266]],63785:[[26391]],63786:[[28010]],63787:[[29436]],63788:[[37070]],63789:[[20358]],63790:[[20919]],63791:[[21214]],63792:[[25796]],63793:[[27347]],63794:[[29200]],63795:[[30439]],63796:[[32769]],63797:[[34310]],63798:[[34396]],63799:[[36335]],63800:[[38706]],63801:[[39791]],63802:[[40442]],63803:[[30860]],63804:[[31103]],63805:[[32160]],63806:[[33737]],63807:[[37636]],63808:[[40575]],63809:[[35542]],63810:[[22751]],63811:[[24324]],63812:[[31840]],63813:[[32894]],63814:[[29282]],63815:[[30922]],63816:[[36034]],63817:[[38647]],63818:[[22744]],63819:[[23650]],63820:[[27155]],63821:[[28122]],63822:[[28431]],63823:[[32047]],63824:[[32311]],63825:[[38475]],63826:[[21202]],63827:[[32907]],63828:[[20956]],63829:[[20940]],63830:[[31260]],63831:[[32190]],63832:[[33777]],63833:[[38517]],63834:[[35712]],63835:[[25295]],63836:[[27138]],63837:[[35582]],63838:[[20025]],63839:[[23527]],63840:[[24594]],63841:[[29575]],63842:[[30064]],63843:[[21271]],63844:[[30971]],63845:[[20415]],63846:[[24489]],63847:[[19981]],63848:[[27852]],63849:[[25976]],63850:[[32034]],63851:[[21443]],63852:[[22622]],63853:[[30465]],63854:[[33865]],63855:[[35498]],63856:[[27578]],63857:[[36784]],63858:[[27784]],63859:[[25342]],63860:[[33509]],63861:[[25504]],63862:[[30053]],63863:[[20142]],63864:[[20841]],63865:[[20937]],63866:[[26753]],63867:[[31975]],63868:[[33391]],63869:[[35538]],63870:[[37327]],63871:[[21237]],63872:[[21570]],63873:[[22899]],63874:[[24300]],63875:[[26053]],63876:[[28670]],63877:[[31018]],63878:[[38317]],63879:[[39530]],63880:[[40599]],63881:[[40654]],63882:[[21147]],63883:[[26310]],63884:[[27511]],63885:[[36706]],63886:[[24180]],63887:[[24976]],63888:[[25088]],63889:[[25754]],63890:[[28451]],63891:[[29001]],63892:[[29833]],63893:[[31178]],63894:[[32244]],63895:[[32879]],63896:[[36646]],63897:[[34030]],63898:[[36899]],63899:[[37706]],63900:[[21015]],63901:[[21155]],63902:[[21693]],63903:[[28872]],63904:[[35010]],63905:[[35498]],63906:[[24265]],63907:[[24565]],63908:[[25467]],63909:[[27566]],63910:[[31806]],63911:[[29557]],63912:[[20196]],63913:[[22265]],63914:[[23527]],63915:[[23994]],63916:[[24604]],63917:[[29618]],63918:[[29801]],63919:[[32666]],63920:[[32838]],63921:[[37428]],63922:[[38646]],63923:[[38728]],63924:[[38936]],63925:[[20363]],63926:[[31150]],63927:[[37300]],63928:[[38584]],63929:[[24801]],63930:[[20102]],63931:[[20698]],63932:[[23534]],63933:[[23615]],63934:[[26009]],63935:[[27138]],63936:[[29134]],63937:[[30274]],63938:[[34044]],63939:[[36988]],63940:[[40845]],63941:[[26248]],63942:[[38446]],63943:[[21129]],63944:[[26491]],63945:[[26611]],63946:[[27969]],63947:[[28316]],63948:[[29705]],63949:[[30041]],63950:[[30827]],63951:[[32016]],63952:[[39006]],63953:[[20845]],63954:[[25134]],63955:[[38520]],63956:[[20523]],63957:[[23833]],63958:[[28138]],63959:[[36650]],63960:[[24459]],63961:[[24900]],63962:[[26647]],63963:[[29575]],63964:[[38534]],63965:[[21033]],63966:[[21519]],63967:[[23653]],63968:[[26131]],63969:[[26446]],63970:[[26792]],63971:[[27877]],63972:[[29702]],63973:[[30178]],63974:[[32633]],63975:[[35023]],63976:[[35041]],63977:[[37324]],63978:[[38626]],63979:[[21311]],63980:[[28346]],63981:[[21533]],63982:[[29136]],63983:[[29848]],63984:[[34298]],63985:[[38563]],63986:[[40023]],63987:[[40607]],63988:[[26519]],63989:[[28107]],63990:[[33256]],63991:[[31435]],63992:[[31520]],63993:[[31890]],63994:[[29376]],63995:[[28825]],63996:[[35672]],63997:[[20160]],63998:[[33590]],63999:[[21050]],194816:[[27966]],194817:[[28023]],194818:[[27969]],194819:[[28009]],194820:[[28024]],194821:[[28037]],194822:[[146718]],194823:[[27956]],194824:[[28207]],194825:[[28270]],194826:[[15667]],194827:[[28363]],194828:[[28359]],194829:[[147153]],194830:[[28153]],194831:[[28526]],194832:[[147294]],194833:[[147342]],194834:[[28614]],194835:[[28729]],194836:[[28702]],194837:[[28699]],194838:[[15766]],194839:[[28746]],194840:[[28797]],194841:[[28791]],194842:[[28845]],194843:[[132389]],194844:[[28997]],194845:[[148067]],194846:[[29084]],194847:[[148395]],194848:[[29224]],194849:[[29237]],194850:[[29264]],194851:[[149e3]],194852:[[29312]],194853:[[29333]],194854:[[149301]],194855:[[149524]],194856:[[29562]],194857:[[29579]],194858:[[16044]],194859:[[29605]],194860:[[16056]],194861:[[16056]],194862:[[29767]],194863:[[29788]],194864:[[29809]],194865:[[29829]],194866:[[29898]],194867:[[16155]],194868:[[29988]],194869:[[150582]],194870:[[30014]],194871:[[150674]],194872:[[30064]],194873:[[139679]],194874:[[30224]],194875:[[151457]],194876:[[151480]],194877:[[151620]],194878:[[16380]],194879:[[16392]],194880:[[30452]],194881:[[151795]],194882:[[151794]],194883:[[151833]],194884:[[151859]],194885:[[30494]],194886:[[30495]],194887:[[30495]],194888:[[30538]],194889:[[16441]],194890:[[30603]],194891:[[16454]],194892:[[16534]],194893:[[152605]],194894:[[30798]],194895:[[30860]],194896:[[30924]],194897:[[16611]],194898:[[153126]],194899:[[31062]],194900:[[153242]],194901:[[153285]],194902:[[31119]],194903:[[31211]],194904:[[16687]],194905:[[31296]],194906:[[31306]],194907:[[31311]],194908:[[153980]],194909:[[154279]],194910:[[154279]],194911:[[31470]],194912:[[16898]],194913:[[154539]],194914:[[31686]],194915:[[31689]],194916:[[16935]],194917:[[154752]],194918:[[31954]],194919:[[17056]],194920:[[31976]],194921:[[31971]],194922:[[32e3]],194923:[[155526]],194924:[[32099]],194925:[[17153]],194926:[[32199]],194927:[[32258]],194928:[[32325]],194929:[[17204]],194930:[[156200]],194931:[[156231]],194932:[[17241]],194933:[[156377]],194934:[[32634]],194935:[[156478]],194936:[[32661]],194937:[[32762]],194938:[[32773]],194939:[[156890]],194940:[[156963]],194941:[[32864]],194942:[[157096]],194943:[[32880]],194944:[[144223]],194945:[[17365]],194946:[[32946]],194947:[[33027]],194948:[[17419]],194949:[[33086]],194950:[[23221]],194951:[[157607]],194952:[[157621]],194953:[[144275]],194954:[[144284]],194955:[[33281]],194956:[[33284]],194957:[[36766]],194958:[[17515]],194959:[[33425]],194960:[[33419]],194961:[[33437]],194962:[[21171]],194963:[[33457]],194964:[[33459]],194965:[[33469]],194966:[[33510]],194967:[[158524]],194968:[[33509]],194969:[[33565]],194970:[[33635]],194971:[[33709]],194972:[[33571]],194973:[[33725]],194974:[[33767]],194975:[[33879]],194976:[[33619]],194977:[[33738]],194978:[[33740]],194979:[[33756]],194980:[[158774]],194981:[[159083]],194982:[[158933]],194983:[[17707]],194984:[[34033]],194985:[[34035]],194986:[[34070]],194987:[[160714]],194988:[[34148]],194989:[[159532]],194990:[[17757]],194991:[[17761]],194992:[[159665]],194993:[[159954]],194994:[[17771]],194995:[[34384]],194996:[[34396]],194997:[[34407]],194998:[[34409]],194999:[[34473]],195e3:[[34440]],195001:[[34574]],195002:[[34530]],195003:[[34681]],195004:[[34600]],195005:[[34667]],195006:[[34694]],195007:[[17879]],195008:[[34785]],195009:[[34817]],195010:[[17913]],195011:[[34912]],195012:[[34915]],195013:[[161383]],195014:[[35031]],195015:[[35038]],195016:[[17973]],195017:[[35066]],195018:[[13499]],195019:[[161966]],195020:[[162150]],195021:[[18110]],195022:[[18119]],195023:[[35488]],195024:[[35565]],195025:[[35722]],195026:[[35925]],195027:[[162984]],195028:[[36011]],195029:[[36033]],195030:[[36123]],195031:[[36215]],195032:[[163631]],195033:[[133124]],195034:[[36299]],195035:[[36284]],195036:[[36336]],195037:[[133342]],195038:[[36564]],195039:[[36664]],195040:[[165330]],195041:[[165357]],195042:[[37012]],195043:[[37105]],195044:[[37137]],195045:[[165678]],195046:[[37147]],195047:[[37432]],195048:[[37591]],195049:[[37592]],195050:[[37500]],195051:[[37881]],195052:[[37909]],195053:[[166906]],195054:[[38283]],195055:[[18837]],195056:[[38327]],195057:[[167287]],195058:[[18918]],195059:[[38595]],195060:[[23986]],195061:[[38691]],195062:[[168261]],195063:[[168474]],195064:[[19054]],195065:[[19062]],195066:[[38880]],195067:[[168970]],195068:[[19122]],195069:[[169110]],195070:[[38923]],195071:[[38923]]},64e3:{64e3:[[20999]],64001:[[24230]],64002:[[25299]],64003:[[31958]],64004:[[23429]],64005:[[27934]],64006:[[26292]],64007:[[36667]],64008:[[34892]],64009:[[38477]],64010:[[35211]],64011:[[24275]],64012:[[20800]],64013:[[21952]],64016:[[22618]],64018:[[26228]],64021:[[20958]],64022:[[29482]],64023:[[30410]],64024:[[31036]],64025:[[31070]],64026:[[31077]],64027:[[31119]],64028:[[38742]],64029:[[31934]],64030:[[32701]],64032:[[34322]],64034:[[35576]],64037:[[36920]],64038:[[37117]],64042:[[39151]],64043:[[39164]],64044:[[39208]],64045:[[40372]],64046:[[37086]],64047:[[38583]],64048:[[20398]],64049:[[20711]],64050:[[20813]],64051:[[21193]],64052:[[21220]],64053:[[21329]],64054:[[21917]],64055:[[22022]],64056:[[22120]],64057:[[22592]],64058:[[22696]],64059:[[23652]],64060:[[23662]],64061:[[24724]],64062:[[24936]],64063:[[24974]],64064:[[25074]],64065:[[25935]],64066:[[26082]],64067:[[26257]],64068:[[26757]],64069:[[28023]],64070:[[28186]],64071:[[28450]],64072:[[29038]],64073:[[29227]],64074:[[29730]],64075:[[30865]],64076:[[31038]],64077:[[31049]],64078:[[31048]],64079:[[31056]],64080:[[31062]],64081:[[31069]],64082:[[31117]],64083:[[31118]],64084:[[31296]],64085:[[31361]],64086:[[31680]],64087:[[32244]],64088:[[32265]],64089:[[32321]],64090:[[32626]],64091:[[32773]],64092:[[33261]],64093:[[33401]],64094:[[33401]],64095:[[33879]],64096:[[35088]],64097:[[35222]],64098:[[35585]],64099:[[35641]],64100:[[36051]],64101:[[36104]],64102:[[36790]],64103:[[36920]],64104:[[38627]],64105:[[38911]],64106:[[38971]],64107:[[24693]],64108:[[148206]],64109:[[33304]],64112:[[20006]],64113:[[20917]],64114:[[20840]],64115:[[20352]],64116:[[20805]],64117:[[20864]],64118:[[21191]],64119:[[21242]],64120:[[21917]],64121:[[21845]],64122:[[21913]],64123:[[21986]],64124:[[22618]],64125:[[22707]],64126:[[22852]],64127:[[22868]],64128:[[23138]],64129:[[23336]],64130:[[24274]],64131:[[24281]],64132:[[24425]],64133:[[24493]],64134:[[24792]],64135:[[24910]],64136:[[24840]],64137:[[24974]],64138:[[24928]],64139:[[25074]],64140:[[25140]],64141:[[25540]],64142:[[25628]],64143:[[25682]],64144:[[25942]],64145:[[26228]],64146:[[26391]],64147:[[26395]],64148:[[26454]],64149:[[27513]],64150:[[27578]],64151:[[27969]],64152:[[28379]],64153:[[28363]],64154:[[28450]],64155:[[28702]],64156:[[29038]],64157:[[30631]],64158:[[29237]],64159:[[29359]],64160:[[29482]],64161:[[29809]],64162:[[29958]],64163:[[30011]],64164:[[30237]],64165:[[30239]],64166:[[30410]],64167:[[30427]],64168:[[30452]],64169:[[30538]],64170:[[30528]],64171:[[30924]],64172:[[31409]],64173:[[31680]],64174:[[31867]],64175:[[32091]],64176:[[32244]],64177:[[32574]],64178:[[32773]],64179:[[33618]],64180:[[33775]],64181:[[34681]],64182:[[35137]],64183:[[35206]],64184:[[35222]],64185:[[35519]],64186:[[35576]],64187:[[35531]],64188:[[35585]],64189:[[35582]],64190:[[35565]],64191:[[35641]],64192:[[35722]],64193:[[36104]],64194:[[36664]],64195:[[36978]],64196:[[37273]],64197:[[37494]],64198:[[38524]],64199:[[38627]],64200:[[38742]],64201:[[38875]],64202:[[38911]],64203:[[38923]],64204:[[38971]],64205:[[39698]],64206:[[40860]],64207:[[141386]],64208:[[141380]],64209:[[144341]],64210:[[15261]],64211:[[16408]],64212:[[16441]],64213:[[152137]],64214:[[154832]],64215:[[163539]],64216:[[40771]],64217:[[40846]],195072:[[38953]],195073:[[169398]],195074:[[39138]],195075:[[19251]],195076:[[39209]],195077:[[39335]],195078:[[39362]],195079:[[39422]],195080:[[19406]],195081:[[170800]],195082:[[39698]],195083:[[4e4]],195084:[[40189]],195085:[[19662]],195086:[[19693]],195087:[[40295]],195088:[[172238]],195089:[[19704]],195090:[[172293]],195091:[[172558]],195092:[[172689]],195093:[[40635]],195094:[[19798]],195095:[[40697]],195096:[[40702]],195097:[[40709]],195098:[[40719]],195099:[[40726]],195100:[[40763]],195101:[[173568]]},64256:{64256:[[102,102],256],64257:[[102,105],256],64258:[[102,108],256],64259:[[102,102,105],256],64260:[[102,102,108],256],64261:[[383,116],256],64262:[[115,116],256],64275:[[1396,1398],256],64276:[[1396,1381],256],64277:[[1396,1387],256],64278:[[1406,1398],256],64279:[[1396,1389],256],64285:[[1497,1460],512],64286:[,26],64287:[[1522,1463],512],64288:[[1506],256],64289:[[1488],256],64290:[[1491],256],64291:[[1492],256],64292:[[1499],256],64293:[[1500],256],64294:[[1501],256],64295:[[1512],256],64296:[[1514],256],64297:[[43],256],64298:[[1513,1473],512],64299:[[1513,1474],512],64300:[[64329,1473],512],64301:[[64329,1474],512],64302:[[1488,1463],512],64303:[[1488,1464],512],64304:[[1488,1468],512],64305:[[1489,1468],512],64306:[[1490,1468],512],64307:[[1491,1468],512],64308:[[1492,1468],512],64309:[[1493,1468],512],64310:[[1494,1468],512],64312:[[1496,1468],512],64313:[[1497,1468],512],64314:[[1498,1468],512],64315:[[1499,1468],512],64316:[[1500,1468],512],64318:[[1502,1468],512],64320:[[1504,1468],512],64321:[[1505,1468],512],64323:[[1507,1468],512],64324:[[1508,1468],512],64326:[[1510,1468],512],64327:[[1511,1468],512],64328:[[1512,1468],512],64329:[[1513,1468],512],64330:[[1514,1468],512],64331:[[1493,1465],512],64332:[[1489,1471],512],64333:[[1499,1471],512],64334:[[1508,1471],512],64335:[[1488,1500],256],64336:[[1649],256],64337:[[1649],256],64338:[[1659],256],64339:[[1659],256],64340:[[1659],256],64341:[[1659],256],64342:[[1662],256],64343:[[1662],256],64344:[[1662],256],64345:[[1662],256],64346:[[1664],256],64347:[[1664],256],64348:[[1664],256],64349:[[1664],256],64350:[[1658],256],64351:[[1658],256],64352:[[1658],256],64353:[[1658],256],64354:[[1663],256],64355:[[1663],256],64356:[[1663],256],64357:[[1663],256],64358:[[1657],256],64359:[[1657],256],64360:[[1657],256],64361:[[1657],256],64362:[[1700],256],64363:[[1700],256],64364:[[1700],256],64365:[[1700],256],64366:[[1702],256],64367:[[1702],256],64368:[[1702],256],64369:[[1702],256],64370:[[1668],256],64371:[[1668],256],64372:[[1668],256],64373:[[1668],256],64374:[[1667],256],64375:[[1667],256],64376:[[1667],256],64377:[[1667],256],64378:[[1670],256],64379:[[1670],256],64380:[[1670],256],64381:[[1670],256],64382:[[1671],256],64383:[[1671],256],64384:[[1671],256],64385:[[1671],256],64386:[[1677],256],64387:[[1677],256],64388:[[1676],256],64389:[[1676],256],64390:[[1678],256],64391:[[1678],256],64392:[[1672],256],64393:[[1672],256],64394:[[1688],256],64395:[[1688],256],64396:[[1681],256],64397:[[1681],256],64398:[[1705],256],64399:[[1705],256],64400:[[1705],256],64401:[[1705],256],64402:[[1711],256],64403:[[1711],256],64404:[[1711],256],64405:[[1711],256],64406:[[1715],256],64407:[[1715],256],64408:[[1715],256],64409:[[1715],256],64410:[[1713],256],64411:[[1713],256],64412:[[1713],256],64413:[[1713],256],64414:[[1722],256],64415:[[1722],256],64416:[[1723],256],64417:[[1723],256],64418:[[1723],256],64419:[[1723],256],64420:[[1728],256],64421:[[1728],256],64422:[[1729],256],64423:[[1729],256],64424:[[1729],256],64425:[[1729],256],64426:[[1726],256],64427:[[1726],256],64428:[[1726],256],64429:[[1726],256],64430:[[1746],256],64431:[[1746],256],64432:[[1747],256],64433:[[1747],256],64467:[[1709],256],64468:[[1709],256],64469:[[1709],256],64470:[[1709],256],64471:[[1735],256],64472:[[1735],256],64473:[[1734],256],64474:[[1734],256],64475:[[1736],256],64476:[[1736],256],64477:[[1655],256],64478:[[1739],256],64479:[[1739],256],64480:[[1733],256],64481:[[1733],256],64482:[[1737],256],64483:[[1737],256],64484:[[1744],256],64485:[[1744],256],64486:[[1744],256],64487:[[1744],256],64488:[[1609],256],64489:[[1609],256],64490:[[1574,1575],256],64491:[[1574,1575],256],64492:[[1574,1749],256],64493:[[1574,1749],256],64494:[[1574,1608],256],64495:[[1574,1608],256],64496:[[1574,1735],256],64497:[[1574,1735],256],64498:[[1574,1734],256],64499:[[1574,1734],256],64500:[[1574,1736],256],64501:[[1574,1736],256],64502:[[1574,1744],256],64503:[[1574,1744],256],64504:[[1574,1744],256],64505:[[1574,1609],256],64506:[[1574,1609],256],64507:[[1574,1609],256],64508:[[1740],256],64509:[[1740],256],64510:[[1740],256],64511:[[1740],256]},64512:{64512:[[1574,1580],256],64513:[[1574,1581],256],64514:[[1574,1605],256],64515:[[1574,1609],256],64516:[[1574,1610],256],64517:[[1576,1580],256],64518:[[1576,1581],256],64519:[[1576,1582],256],64520:[[1576,1605],256],64521:[[1576,1609],256],64522:[[1576,1610],256],64523:[[1578,1580],256],64524:[[1578,1581],256],64525:[[1578,1582],256],64526:[[1578,1605],256],64527:[[1578,1609],256],64528:[[1578,1610],256],64529:[[1579,1580],256],64530:[[1579,1605],256],64531:[[1579,1609],256],64532:[[1579,1610],256],64533:[[1580,1581],256],64534:[[1580,1605],256],64535:[[1581,1580],256],64536:[[1581,1605],256],64537:[[1582,1580],256],64538:[[1582,1581],256],64539:[[1582,1605],256],64540:[[1587,1580],256],64541:[[1587,1581],256],64542:[[1587,1582],256],64543:[[1587,1605],256],64544:[[1589,1581],256],64545:[[1589,1605],256],64546:[[1590,1580],256],64547:[[1590,1581],256],64548:[[1590,1582],256],64549:[[1590,1605],256],64550:[[1591,1581],256],64551:[[1591,1605],256],64552:[[1592,1605],256],64553:[[1593,1580],256],64554:[[1593,1605],256],64555:[[1594,1580],256],64556:[[1594,1605],256],64557:[[1601,1580],256],64558:[[1601,1581],256],64559:[[1601,1582],256],64560:[[1601,1605],256],64561:[[1601,1609],256],64562:[[1601,1610],256],64563:[[1602,1581],256],64564:[[1602,1605],256],64565:[[1602,1609],256],64566:[[1602,1610],256],64567:[[1603,1575],256],64568:[[1603,1580],256],64569:[[1603,1581],256],64570:[[1603,1582],256],64571:[[1603,1604],256],64572:[[1603,1605],256],64573:[[1603,1609],256],64574:[[1603,1610],256],64575:[[1604,1580],256],64576:[[1604,1581],256],64577:[[1604,1582],256],64578:[[1604,1605],256],64579:[[1604,1609],256],64580:[[1604,1610],256],64581:[[1605,1580],256],64582:[[1605,1581],256],64583:[[1605,1582],256],64584:[[1605,1605],256],64585:[[1605,1609],256],64586:[[1605,1610],256],64587:[[1606,1580],256],64588:[[1606,1581],256],64589:[[1606,1582],256],64590:[[1606,1605],256],64591:[[1606,1609],256],64592:[[1606,1610],256],64593:[[1607,1580],256],64594:[[1607,1605],256],64595:[[1607,1609],256],64596:[[1607,1610],256],64597:[[1610,1580],256],64598:[[1610,1581],256],64599:[[1610,1582],256],64600:[[1610,1605],256],64601:[[1610,1609],256],64602:[[1610,1610],256],64603:[[1584,1648],256],64604:[[1585,1648],256],64605:[[1609,1648],256],64606:[[32,1612,1617],256],64607:[[32,1613,1617],256],64608:[[32,1614,1617],256],64609:[[32,1615,1617],256],64610:[[32,1616,1617],256],64611:[[32,1617,1648],256],64612:[[1574,1585],256],64613:[[1574,1586],256],64614:[[1574,1605],256],64615:[[1574,1606],256],64616:[[1574,1609],256],64617:[[1574,1610],256],64618:[[1576,1585],256],64619:[[1576,1586],256],64620:[[1576,1605],256],64621:[[1576,1606],256],64622:[[1576,1609],256],64623:[[1576,1610],256],64624:[[1578,1585],256],64625:[[1578,1586],256],64626:[[1578,1605],256],64627:[[1578,1606],256],64628:[[1578,1609],256],64629:[[1578,1610],256],64630:[[1579,1585],256],64631:[[1579,1586],256],64632:[[1579,1605],256],64633:[[1579,1606],256],64634:[[1579,1609],256],64635:[[1579,1610],256],64636:[[1601,1609],256],64637:[[1601,1610],256],64638:[[1602,1609],256],64639:[[1602,1610],256],64640:[[1603,1575],256],64641:[[1603,1604],256],64642:[[1603,1605],256],64643:[[1603,1609],256],64644:[[1603,1610],256],64645:[[1604,1605],256],64646:[[1604,1609],256],64647:[[1604,1610],256],64648:[[1605,1575],256],64649:[[1605,1605],256],64650:[[1606,1585],256],64651:[[1606,1586],256],64652:[[1606,1605],256],64653:[[1606,1606],256],64654:[[1606,1609],256],64655:[[1606,1610],256],64656:[[1609,1648],256],64657:[[1610,1585],256],64658:[[1610,1586],256],64659:[[1610,1605],256],64660:[[1610,1606],256],64661:[[1610,1609],256],64662:[[1610,1610],256],64663:[[1574,1580],256],64664:[[1574,1581],256],64665:[[1574,1582],256],64666:[[1574,1605],256],64667:[[1574,1607],256],64668:[[1576,1580],256],64669:[[1576,1581],256],64670:[[1576,1582],256],64671:[[1576,1605],256],64672:[[1576,1607],256],64673:[[1578,1580],256],64674:[[1578,1581],256],64675:[[1578,1582],256],64676:[[1578,1605],256],64677:[[1578,1607],256],64678:[[1579,1605],256],64679:[[1580,1581],256],64680:[[1580,1605],256],64681:[[1581,1580],256],64682:[[1581,1605],256],64683:[[1582,1580],256],64684:[[1582,1605],256],64685:[[1587,1580],256],64686:[[1587,1581],256],64687:[[1587,1582],256],64688:[[1587,1605],256],64689:[[1589,1581],256],64690:[[1589,1582],256],64691:[[1589,1605],256],64692:[[1590,1580],256],64693:[[1590,1581],256],64694:[[1590,1582],256],64695:[[1590,1605],256],64696:[[1591,1581],256],64697:[[1592,1605],256],64698:[[1593,1580],256],64699:[[1593,1605],256],64700:[[1594,1580],256],64701:[[1594,1605],256],64702:[[1601,1580],256],64703:[[1601,1581],256],64704:[[1601,1582],256],64705:[[1601,1605],256],64706:[[1602,1581],256],64707:[[1602,1605],256],64708:[[1603,1580],256],64709:[[1603,1581],256],64710:[[1603,1582],256],64711:[[1603,1604],256],64712:[[1603,1605],256],64713:[[1604,1580],256],64714:[[1604,1581],256],64715:[[1604,1582],256],64716:[[1604,1605],256],64717:[[1604,1607],256],64718:[[1605,1580],256],64719:[[1605,1581],256],64720:[[1605,1582],256],64721:[[1605,1605],256],64722:[[1606,1580],256],64723:[[1606,1581],256],64724:[[1606,1582],256],64725:[[1606,1605],256],64726:[[1606,1607],256],64727:[[1607,1580],256],64728:[[1607,1605],256],64729:[[1607,1648],256],64730:[[1610,1580],256],64731:[[1610,1581],256],64732:[[1610,1582],256],64733:[[1610,1605],256],64734:[[1610,1607],256],64735:[[1574,1605],256],64736:[[1574,1607],256],64737:[[1576,1605],256],64738:[[1576,1607],256],64739:[[1578,1605],256],64740:[[1578,1607],256],64741:[[1579,1605],256],64742:[[1579,1607],256],64743:[[1587,1605],256],64744:[[1587,1607],256],64745:[[1588,1605],256],64746:[[1588,1607],256],64747:[[1603,1604],256],64748:[[1603,1605],256],64749:[[1604,1605],256],64750:[[1606,1605],256],64751:[[1606,1607],256],64752:[[1610,1605],256],64753:[[1610,1607],256],64754:[[1600,1614,1617],256],64755:[[1600,1615,1617],256],64756:[[1600,1616,1617],256],64757:[[1591,1609],256],64758:[[1591,1610],256],64759:[[1593,1609],256],64760:[[1593,1610],256],64761:[[1594,1609],256],64762:[[1594,1610],256],64763:[[1587,1609],256],64764:[[1587,1610],256],64765:[[1588,1609],256],64766:[[1588,1610],256],64767:[[1581,1609],256]},64768:{64768:[[1581,1610],256],64769:[[1580,1609],256],64770:[[1580,1610],256],64771:[[1582,1609],256],64772:[[1582,1610],256],64773:[[1589,1609],256],64774:[[1589,1610],256],64775:[[1590,1609],256],64776:[[1590,1610],256],64777:[[1588,1580],256],64778:[[1588,1581],256],64779:[[1588,1582],256],64780:[[1588,1605],256],64781:[[1588,1585],256],64782:[[1587,1585],256],64783:[[1589,1585],256],64784:[[1590,1585],256],64785:[[1591,1609],256],64786:[[1591,1610],256],64787:[[1593,1609],256],64788:[[1593,1610],256],64789:[[1594,1609],256],64790:[[1594,1610],256],64791:[[1587,1609],256],64792:[[1587,1610],256],64793:[[1588,1609],256],64794:[[1588,1610],256],64795:[[1581,1609],256],64796:[[1581,1610],256],64797:[[1580,1609],256],64798:[[1580,1610],256],64799:[[1582,1609],256],64800:[[1582,1610],256],64801:[[1589,1609],256],64802:[[1589,1610],256],64803:[[1590,1609],256],64804:[[1590,1610],256],64805:[[1588,1580],256],64806:[[1588,1581],256],64807:[[1588,1582],256],64808:[[1588,1605],256],64809:[[1588,1585],256],64810:[[1587,1585],256],64811:[[1589,1585],256],64812:[[1590,1585],256],64813:[[1588,1580],256],64814:[[1588,1581],256],64815:[[1588,1582],256],64816:[[1588,1605],256],64817:[[1587,1607],256],64818:[[1588,1607],256],64819:[[1591,1605],256],64820:[[1587,1580],256],64821:[[1587,1581],256],64822:[[1587,1582],256],64823:[[1588,1580],256],64824:[[1588,1581],256],64825:[[1588,1582],256],64826:[[1591,1605],256],64827:[[1592,1605],256],64828:[[1575,1611],256],64829:[[1575,1611],256],64848:[[1578,1580,1605],256],64849:[[1578,1581,1580],256],64850:[[1578,1581,1580],256],64851:[[1578,1581,1605],256],64852:[[1578,1582,1605],256],64853:[[1578,1605,1580],256],64854:[[1578,1605,1581],256],64855:[[1578,1605,1582],256],64856:[[1580,1605,1581],256],64857:[[1580,1605,1581],256],64858:[[1581,1605,1610],256],64859:[[1581,1605,1609],256],64860:[[1587,1581,1580],256],64861:[[1587,1580,1581],256],64862:[[1587,1580,1609],256],64863:[[1587,1605,1581],256],64864:[[1587,1605,1581],256],64865:[[1587,1605,1580],256],64866:[[1587,1605,1605],256],64867:[[1587,1605,1605],256],64868:[[1589,1581,1581],256],64869:[[1589,1581,1581],256],64870:[[1589,1605,1605],256],64871:[[1588,1581,1605],256],64872:[[1588,1581,1605],256],64873:[[1588,1580,1610],256],64874:[[1588,1605,1582],256],64875:[[1588,1605,1582],256],64876:[[1588,1605,1605],256],64877:[[1588,1605,1605],256],64878:[[1590,1581,1609],256],64879:[[1590,1582,1605],256],64880:[[1590,1582,1605],256],64881:[[1591,1605,1581],256],64882:[[1591,1605,1581],256],64883:[[1591,1605,1605],256],64884:[[1591,1605,1610],256],64885:[[1593,1580,1605],256],64886:[[1593,1605,1605],256],64887:[[1593,1605,1605],256],64888:[[1593,1605,1609],256],64889:[[1594,1605,1605],256],64890:[[1594,1605,1610],256],64891:[[1594,1605,1609],256],64892:[[1601,1582,1605],256],64893:[[1601,1582,1605],256],64894:[[1602,1605,1581],256],64895:[[1602,1605,1605],256],64896:[[1604,1581,1605],256],64897:[[1604,1581,1610],256],64898:[[1604,1581,1609],256],64899:[[1604,1580,1580],256],64900:[[1604,1580,1580],256],64901:[[1604,1582,1605],256],64902:[[1604,1582,1605],256],64903:[[1604,1605,1581],256],64904:[[1604,1605,1581],256],64905:[[1605,1581,1580],256],64906:[[1605,1581,1605],256],64907:[[1605,1581,1610],256],64908:[[1605,1580,1581],256],64909:[[1605,1580,1605],256],64910:[[1605,1582,1580],256],64911:[[1605,1582,1605],256],64914:[[1605,1580,1582],256],64915:[[1607,1605,1580],256],64916:[[1607,1605,1605],256],64917:[[1606,1581,1605],256],64918:[[1606,1581,1609],256],64919:[[1606,1580,1605],256],64920:[[1606,1580,1605],256],64921:[[1606,1580,1609],256],64922:[[1606,1605,1610],256],64923:[[1606,1605,1609],256],64924:[[1610,1605,1605],256],64925:[[1610,1605,1605],256],64926:[[1576,1582,1610],256],64927:[[1578,1580,1610],256],64928:[[1578,1580,1609],256],64929:[[1578,1582,1610],256],64930:[[1578,1582,1609],256],64931:[[1578,1605,1610],256],64932:[[1578,1605,1609],256],64933:[[1580,1605,1610],256],64934:[[1580,1581,1609],256],64935:[[1580,1605,1609],256],64936:[[1587,1582,1609],256],64937:[[1589,1581,1610],256],64938:[[1588,1581,1610],256],64939:[[1590,1581,1610],256],64940:[[1604,1580,1610],256],64941:[[1604,1605,1610],256],64942:[[1610,1581,1610],256],64943:[[1610,1580,1610],256],64944:[[1610,1605,1610],256],64945:[[1605,1605,1610],256],64946:[[1602,1605,1610],256],64947:[[1606,1581,1610],256],64948:[[1602,1605,1581],256],64949:[[1604,1581,1605],256],64950:[[1593,1605,1610],256],64951:[[1603,1605,1610],256],64952:[[1606,1580,1581],256],64953:[[1605,1582,1610],256],64954:[[1604,1580,1605],256],64955:[[1603,1605,1605],256],64956:[[1604,1580,1605],256],64957:[[1606,1580,1581],256],64958:[[1580,1581,1610],256],64959:[[1581,1580,1610],256],64960:[[1605,1580,1610],256],64961:[[1601,1605,1610],256],64962:[[1576,1581,1610],256],64963:[[1603,1605,1605],256],64964:[[1593,1580,1605],256],64965:[[1589,1605,1605],256],64966:[[1587,1582,1610],256],64967:[[1606,1580,1610],256],65008:[[1589,1604,1746],256],65009:[[1602,1604,1746],256],65010:[[1575,1604,1604,1607],256],65011:[[1575,1603,1576,1585],256],65012:[[1605,1581,1605,1583],256],65013:[[1589,1604,1593,1605],256],65014:[[1585,1587,1608,1604],256],65015:[[1593,1604,1610,1607],256],65016:[[1608,1587,1604,1605],256],65017:[[1589,1604,1609],256],65018:[[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605],256],65019:[[1580,1604,32,1580,1604,1575,1604,1607],256],65020:[[1585,1740,1575,1604],256]},65024:{65040:[[44],256],65041:[[12289],256],65042:[[12290],256],65043:[[58],256],65044:[[59],256],65045:[[33],256],65046:[[63],256],65047:[[12310],256],65048:[[12311],256],65049:[[8230],256],65056:[,230],65057:[,230],65058:[,230],65059:[,230],65060:[,230],65061:[,230],65062:[,230],65063:[,220],65064:[,220],65065:[,220],65066:[,220],65067:[,220],65068:[,220],65069:[,220],65072:[[8229],256],65073:[[8212],256],65074:[[8211],256],65075:[[95],256],65076:[[95],256],65077:[[40],256],65078:[[41],256],65079:[[123],256],65080:[[125],256],65081:[[12308],256],65082:[[12309],256],65083:[[12304],256],65084:[[12305],256],65085:[[12298],256],65086:[[12299],256],65087:[[12296],256],65088:[[12297],256],65089:[[12300],256],65090:[[12301],256],65091:[[12302],256],65092:[[12303],256],65095:[[91],256],65096:[[93],256],65097:[[8254],256],65098:[[8254],256],65099:[[8254],256],65100:[[8254],256],65101:[[95],256],65102:[[95],256],65103:[[95],256],65104:[[44],256],65105:[[12289],256],65106:[[46],256],65108:[[59],256],65109:[[58],256],65110:[[63],256],65111:[[33],256],65112:[[8212],256],65113:[[40],256],65114:[[41],256],65115:[[123],256],65116:[[125],256],65117:[[12308],256],65118:[[12309],256],65119:[[35],256],65120:[[38],256],65121:[[42],256],65122:[[43],256],65123:[[45],256],65124:[[60],256],65125:[[62],256],65126:[[61],256],65128:[[92],256],65129:[[36],256],65130:[[37],256],65131:[[64],256],65136:[[32,1611],256],65137:[[1600,1611],256],65138:[[32,1612],256],65140:[[32,1613],256],65142:[[32,1614],256],65143:[[1600,1614],256],65144:[[32,1615],256],65145:[[1600,1615],256],65146:[[32,1616],256],65147:[[1600,1616],256],65148:[[32,1617],256],65149:[[1600,1617],256],65150:[[32,1618],256],65151:[[1600,1618],256],65152:[[1569],256],65153:[[1570],256],65154:[[1570],256],65155:[[1571],256],65156:[[1571],256],65157:[[1572],256],65158:[[1572],256],65159:[[1573],256],65160:[[1573],256],65161:[[1574],256],65162:[[1574],256],65163:[[1574],256],65164:[[1574],256],65165:[[1575],256],65166:[[1575],256],65167:[[1576],256],65168:[[1576],256],65169:[[1576],256],65170:[[1576],256],65171:[[1577],256],65172:[[1577],256],65173:[[1578],256],65174:[[1578],256],65175:[[1578],256],65176:[[1578],256],65177:[[1579],256],65178:[[1579],256],65179:[[1579],256],65180:[[1579],256],65181:[[1580],256],65182:[[1580],256],65183:[[1580],256],65184:[[1580],256],65185:[[1581],256],65186:[[1581],256],65187:[[1581],256],65188:[[1581],256],65189:[[1582],256],65190:[[1582],256],65191:[[1582],256],65192:[[1582],256],65193:[[1583],256],65194:[[1583],256],65195:[[1584],256],65196:[[1584],256],65197:[[1585],256],65198:[[1585],256],65199:[[1586],256],65200:[[1586],256],65201:[[1587],256],65202:[[1587],256],65203:[[1587],256],65204:[[1587],256],65205:[[1588],256],65206:[[1588],256],65207:[[1588],256],65208:[[1588],256],65209:[[1589],256],65210:[[1589],256],65211:[[1589],256],65212:[[1589],256],65213:[[1590],256],65214:[[1590],256],65215:[[1590],256],65216:[[1590],256],65217:[[1591],256],65218:[[1591],256],65219:[[1591],256],65220:[[1591],256],65221:[[1592],256],65222:[[1592],256],65223:[[1592],256],65224:[[1592],256],65225:[[1593],256],65226:[[1593],256],65227:[[1593],256],65228:[[1593],256],65229:[[1594],256],65230:[[1594],256],65231:[[1594],256],65232:[[1594],256],65233:[[1601],256],65234:[[1601],256],65235:[[1601],256],65236:[[1601],256],65237:[[1602],256],65238:[[1602],256],65239:[[1602],256],65240:[[1602],256],65241:[[1603],256],65242:[[1603],256],65243:[[1603],256],65244:[[1603],256],65245:[[1604],256],65246:[[1604],256],65247:[[1604],256],65248:[[1604],256],65249:[[1605],256],65250:[[1605],256],65251:[[1605],256],65252:[[1605],256],65253:[[1606],256],65254:[[1606],256],65255:[[1606],256],65256:[[1606],256],65257:[[1607],256],65258:[[1607],256],65259:[[1607],256],65260:[[1607],256],65261:[[1608],256],65262:[[1608],256],65263:[[1609],256],65264:[[1609],256],65265:[[1610],256],65266:[[1610],256],65267:[[1610],256],65268:[[1610],256],65269:[[1604,1570],256],65270:[[1604,1570],256],65271:[[1604,1571],256],65272:[[1604,1571],256],65273:[[1604,1573],256],65274:[[1604,1573],256],65275:[[1604,1575],256],65276:[[1604,1575],256]},65280:{65281:[[33],256],65282:[[34],256],65283:[[35],256],65284:[[36],256],65285:[[37],256],65286:[[38],256],65287:[[39],256],65288:[[40],256],65289:[[41],256],65290:[[42],256],65291:[[43],256],65292:[[44],256],65293:[[45],256],65294:[[46],256],65295:[[47],256],65296:[[48],256],65297:[[49],256],65298:[[50],256],65299:[[51],256],65300:[[52],256],65301:[[53],256],65302:[[54],256],65303:[[55],256],65304:[[56],256],65305:[[57],256],65306:[[58],256],65307:[[59],256],65308:[[60],256],65309:[[61],256],65310:[[62],256],65311:[[63],256],65312:[[64],256],65313:[[65],256],65314:[[66],256],65315:[[67],256],65316:[[68],256],65317:[[69],256],65318:[[70],256],65319:[[71],256],65320:[[72],256],65321:[[73],256],65322:[[74],256],65323:[[75],256],65324:[[76],256],65325:[[77],256],65326:[[78],256],65327:[[79],256],65328:[[80],256],65329:[[81],256],65330:[[82],256],65331:[[83],256],65332:[[84],256],65333:[[85],256],65334:[[86],256],65335:[[87],256],65336:[[88],256],65337:[[89],256],65338:[[90],256],65339:[[91],256],65340:[[92],256],65341:[[93],256],65342:[[94],256],65343:[[95],256],65344:[[96],256],65345:[[97],256],65346:[[98],256],65347:[[99],256],65348:[[100],256],65349:[[101],256],65350:[[102],256],65351:[[103],256],65352:[[104],256],65353:[[105],256],65354:[[106],256],65355:[[107],256],65356:[[108],256],65357:[[109],256],65358:[[110],256],65359:[[111],256],65360:[[112],256],65361:[[113],256],65362:[[114],256],65363:[[115],256],65364:[[116],256],65365:[[117],256],65366:[[118],256],65367:[[119],256],65368:[[120],256],65369:[[121],256],65370:[[122],256],65371:[[123],256],65372:[[124],256],65373:[[125],256],65374:[[126],256],65375:[[10629],256],65376:[[10630],256],65377:[[12290],256],65378:[[12300],256],65379:[[12301],256],65380:[[12289],256],65381:[[12539],256],65382:[[12530],256],65383:[[12449],256],65384:[[12451],256],65385:[[12453],256],65386:[[12455],256],65387:[[12457],256],65388:[[12515],256],65389:[[12517],256],65390:[[12519],256],65391:[[12483],256],65392:[[12540],256],65393:[[12450],256],65394:[[12452],256],65395:[[12454],256],65396:[[12456],256],65397:[[12458],256],65398:[[12459],256],65399:[[12461],256],65400:[[12463],256],65401:[[12465],256],65402:[[12467],256],65403:[[12469],256],65404:[[12471],256],65405:[[12473],256],65406:[[12475],256],65407:[[12477],256],65408:[[12479],256],65409:[[12481],256],65410:[[12484],256],65411:[[12486],256],65412:[[12488],256],65413:[[12490],256],65414:[[12491],256],65415:[[12492],256],65416:[[12493],256],65417:[[12494],256],65418:[[12495],256],65419:[[12498],256],65420:[[12501],256],65421:[[12504],256],65422:[[12507],256],65423:[[12510],256],65424:[[12511],256],65425:[[12512],256],65426:[[12513],256],65427:[[12514],256],65428:[[12516],256],65429:[[12518],256],65430:[[12520],256],65431:[[12521],256],65432:[[12522],256],65433:[[12523],256],65434:[[12524],256],65435:[[12525],256],65436:[[12527],256],65437:[[12531],256],65438:[[12441],256],65439:[[12442],256],65440:[[12644],256],65441:[[12593],256],65442:[[12594],256],65443:[[12595],256],65444:[[12596],256],65445:[[12597],256],65446:[[12598],256],65447:[[12599],256],65448:[[12600],256],65449:[[12601],256],65450:[[12602],256],65451:[[12603],256],65452:[[12604],256],65453:[[12605],256],65454:[[12606],256],65455:[[12607],256],65456:[[12608],256],65457:[[12609],256],65458:[[12610],256],65459:[[12611],256],65460:[[12612],256],65461:[[12613],256],65462:[[12614],256],65463:[[12615],256],65464:[[12616],256],65465:[[12617],256],65466:[[12618],256],65467:[[12619],256],65468:[[12620],256],65469:[[12621],256],65470:[[12622],256],65474:[[12623],256],65475:[[12624],256],65476:[[12625],256],65477:[[12626],256],65478:[[12627],256],65479:[[12628],256],65482:[[12629],256],65483:[[12630],256],65484:[[12631],256],65485:[[12632],256],65486:[[12633],256],65487:[[12634],256],65490:[[12635],256],65491:[[12636],256],65492:[[12637],256],65493:[[12638],256],65494:[[12639],256],65495:[[12640],256],65498:[[12641],256],65499:[[12642],256],65500:[[12643],256],65504:[[162],256],65505:[[163],256],65506:[[172],256],65507:[[175],256],65508:[[166],256],65509:[[165],256],65510:[[8361],256],65512:[[9474],256],65513:[[8592],256],65514:[[8593],256],65515:[[8594],256],65516:[[8595],256],65517:[[9632],256],65518:[[9675],256]}};var m={nfc:function(e){return g("NFC",e)},nfd:function(e){return g("NFD",e)},nfkc:function(e){return g("NFKC",e)},nfkd:function(e){return g("NFKD",e)}};e.exports=m,m.shimApplied=!1,String.prototype.normalize||(Object.defineProperty(String.prototype,"normalize",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=""+this,t=void 0===arguments[0]?"NFC":arguments[0];if(null==this)throw new TypeError("Cannot call method on "+Object.prototype.toString.call(this));if("NFC"===t)return m.nfc(e);if("NFD"===t)return m.nfd(e);if("NFKC"===t)return m.nfkc(e);if("NFKD"===t)return m.nfkd(e);throw new RangeError("Invalid normalization form: "+t)}}),m.shimApplied=!0)}()},(e,t,r)=>{"use strict";function n(e){const t=e.caseSensitive?e.accentSensitive?"variant":"case":e.accentSensitive?"accent":"base",r=e.caseFirst,n=e.ignorePunctuation;return new Intl.Collator(e.localeLang,{sensitivity:t,caseFirst:r,ignorePunctuation:n})}r.r(t),r.d(t,{collatorFromConfig:()=>n})},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DetailedCellError:()=>n});class n{constructor(e,t,r){var n;this.value=t,this.address=r,this.type=e.type,this.message=null!==(n=e.message)&&void 0!==n?n:""}toString(){return this.value}valueOf(){return this.value}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Config:()=>d,getDefaultConfig:()=>g});var n=r(100),s=r(101),o=r(102),i=r(103),a=r(77),l=r(104),u=r(106),h=r(108);const c=new WeakMap;class d{constructor(e={},t=!0){const{accentSensitive:r,binarySearchThreshold:s,caseSensitive:i,caseFirst:a,chooseAddressMappingPolicy:l,currencySymbol:p,dateFormats:g,decimalSeparator:m,evaluateNullToZero:f,functionArgSeparator:y,functionPlugins:E,ignorePunctuation:C,leapYear1900:T,localeLang:R,language:w,ignoreWhiteSpace:S,licenseKey:v,matchWholeCell:A,arrayColumnSeparator:N,arrayRowSeparator:O,maxRows:M,maxColumns:b,nullYear:I,nullDate:_,parseDateTime:x,precisionEpsilon:P,precisionRounding:L,stringifyDateTime:D,stringifyDuration:F,smartRounding:k,timeFormats:H,thousandSeparator:U,useArrayArithmetic:V,useStats:B,undoLimit:W,useColumnIndex:G,useRegularExpressions:Y,useWildcards:j}=e;t&&d.warnDeprecatedOptions(e),this.useArrayArithmetic=(0,n.configValueFromParam)(V,"boolean","useArrayArithmetic"),this.accentSensitive=(0,n.configValueFromParam)(r,"boolean","accentSensitive"),this.caseSensitive=(0,n.configValueFromParam)(i,"boolean","caseSensitive"),this.caseFirst=(0,n.configValueFromParam)(a,["upper","lower","false"],"caseFirst"),this.ignorePunctuation=(0,n.configValueFromParam)(C,"boolean","ignorePunctuation"),this.chooseAddressMappingPolicy=null!=l?l:d.defaultConfig.chooseAddressMappingPolicy,this.dateFormats=[...(0,n.configValueFromParamCheck)(g,Array.isArray,"array","dateFormats")],this.timeFormats=[...(0,n.configValueFromParamCheck)(H,Array.isArray,"array","timeFormats")],this.functionArgSeparator=(0,n.configValueFromParam)(y,"string","functionArgSeparator"),this.decimalSeparator=(0,n.configValueFromParam)(m,[".",","],"decimalSeparator"),this.language=(0,n.configValueFromParam)(w,"string","language"),this.ignoreWhiteSpace=(0,n.configValueFromParam)(S,["standard","any"],"ignoreWhiteSpace"),this.licenseKey=(0,n.configValueFromParam)(v,"string","licenseKey"),this.thousandSeparator=(0,n.configValueFromParam)(U,["",","," ","."],"thousandSeparator"),this.arrayColumnSeparator=(0,n.configValueFromParam)(N,[",",";"],"arrayColumnSeparator"),this.arrayRowSeparator=(0,n.configValueFromParam)(O,[";","|"],"arrayRowSeparator"),this.localeLang=(0,n.configValueFromParam)(R,"string","localeLang"),this.functionPlugins=[...null!=E?E:d.defaultConfig.functionPlugins],this.smartRounding=(0,n.configValueFromParam)(k,"boolean","smartRounding"),this.evaluateNullToZero=(0,n.configValueFromParam)(f,"boolean","evaluateNullToZero"),this.nullYear=(0,n.configValueFromParam)(I,"number","nullYear"),(0,n.validateNumberToBeAtLeast)(this.nullYear,"nullYear",0),(0,n.validateNumberToBeAtMost)(this.nullYear,"nullYear",100),this.precisionRounding=(0,n.configValueFromParam)(L,"number","precisionRounding"),(0,n.validateNumberToBeAtLeast)(this.precisionRounding,"precisionRounding",0),this.precisionEpsilon=(0,n.configValueFromParam)(P,"number","precisionEpsilon"),(0,n.validateNumberToBeAtLeast)(this.precisionEpsilon,"precisionEpsilon",0),this.useColumnIndex=(0,n.configValueFromParam)(G,"boolean","useColumnIndex"),this.useStats=(0,n.configValueFromParam)(B,"boolean","useStats"),this.binarySearchThreshold=null!=s?s:d.defaultConfig.binarySearchThreshold,this.parseDateTime=(0,n.configValueFromParam)(x,"function","parseDateTime"),this.stringifyDateTime=(0,n.configValueFromParam)(D,"function","stringifyDateTime"),this.stringifyDuration=(0,n.configValueFromParam)(F,"function","stringifyDuration"),this.translationPackage=h.HyperFormula.getLanguage(this.language),this.errorMapping=this.translationPackage.buildErrorMapping(),this.nullDate=(0,n.configValueFromParamCheck)(_,o.instanceOfSimpleDate,"IDate","nullDate"),this.leapYear1900=(0,n.configValueFromParam)(T,"boolean","leapYear1900"),this.undoLimit=(0,n.configValueFromParam)(W,"number","undoLimit"),this.useRegularExpressions=(0,n.configValueFromParam)(Y,"boolean","useRegularExpressions"),this.useWildcards=(0,n.configValueFromParam)(j,"boolean","useWildcards"),this.matchWholeCell=(0,n.configValueFromParam)(A,"boolean","matchWholeCell"),(0,n.validateNumberToBeAtLeast)(this.undoLimit,"undoLimit",0),this.maxRows=(0,n.configValueFromParam)(M,"number","maxRows"),(0,n.validateNumberToBeAtLeast)(this.maxRows,"maxRows",1),this.maxColumns=(0,n.configValueFromParam)(b,"number","maxColumns"),this.currencySymbol=this.setupCurrencySymbol(p),(0,n.validateNumberToBeAtLeast)(this.maxColumns,"maxColumns",1),c.set(this,{licenseKeyValidityState:(0,u.checkLicenseKeyValidity)(this.licenseKey)}),(0,n.configCheckIfParametersNotInConflict)({value:this.decimalSeparator,name:"decimalSeparator"},{value:this.functionArgSeparator,name:"functionArgSeparator"},{value:this.thousandSeparator,name:"thousandSeparator"}),(0,n.configCheckIfParametersNotInConflict)({value:this.arrayRowSeparator,name:"arrayRowSeparator"},{value:this.arrayColumnSeparator,name:"arrayColumnSeparator"})}setupCurrencySymbol(e){const t=[...(0,n.configValueFromParamCheck)(e,Array.isArray,"array","currencySymbol")];return t.forEach((e=>{if("string"!=typeof e)throw new a.ExpectedValueOfTypeError("string[]","currencySymbol");if(""===e)throw new a.ConfigValueEmpty("currencySymbol")})),t}get licenseKeyValidityState(){return c.get(this).licenseKeyValidityState}getConfig(){return p(this)}mergeConfig(e){const t=Object.assign({},this.getConfig(),e);return d.warnDeprecatedOptions(e),new d(t,!1)}static warnDeprecatedOptions(e){d.warnDeprecatedIfUsed(e.binarySearchThreshold,"binarySearchThreshold","1.1")}static warnDeprecatedIfUsed(e,t,r,n){void 0!==e&&(void 0===n?console.warn(`${t} option is deprecated since ${r}`):console.warn(`${t} option is deprecated since ${r}, please use ${n}`))}}function p(e){var t;const r={};for(const n in d.defaultConfig){const s=null!==(t=e[n])&&void 0!==t?t:d.defaultConfig[n];Array.isArray(s)?r[n]=[...s]:r[n]=s}return r}function g(){return p({})}d.defaultConfig={accentSensitive:!1,binarySearchThreshold:20,currencySymbol:["$"],caseSensitive:!1,caseFirst:"lower",chooseAddressMappingPolicy:new i.AlwaysDense,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:s.defaultParseToDateTime,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,stringifyDateTime:l.defaultStringifyDateTime,stringifyDuration:l.defaultStringifyDuration,timeFormats:["hh:mm","hh:mm:ss.sss"],thousandSeparator:"",undoLimit:20,useRegularExpressions:!1,useWildcards:!0,useColumnIndex:!1,useStats:!1,useArrayArithmetic:!1}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{configCheckIfParametersNotInConflict:()=>u,configValueFromParam:()=>o,configValueFromParamCheck:()=>l,validateArgToType:()=>h,validateNumberToBeAtLeast:()=>i,validateNumberToBeAtMost:()=>a});var n=r(99),s=r(77);function o(e,t,r){if(void 0===e)return n.Config.defaultConfig[r];if("string"==typeof t){if(typeof e===t)return e;throw new s.ExpectedValueOfTypeError(t,r)}if(t.includes(e))return e;throw new s.ExpectedOneOfValuesError(t.map((e=>`'${e}'`)).join(" "),r)}function i(e,t,r){if(e<r)throw new s.ConfigValueTooSmallError(t,r)}function a(e,t,r){if(e>r)throw new s.ConfigValueTooBigError(t,r)}function l(e,t,r,o){if(t(e))return e;if(void 0===e)return n.Config.defaultConfig[o];throw new s.ExpectedValueOfTypeError(r,o)}function u(...e){const t=new Map;e.forEach((e=>{const r=t.get(e.value)||[];r.push(e.name),t.set(e.value,r)}));const r=[];for(const e of t.values())e.length>1&&r.push(e);if(r.length>0){r.forEach((e=>e.sort()));const e=r.map((e=>`[${e}]`)).join("; ");throw new Error(`Config initialization failed. Parameters in conflict: ${e}`)}}function h(e,t,r){if(typeof e!==t)throw new s.ExpectedValueOfTypeError(t,r)}},(e,t,r)=>{"use strict";function n(e,t,r){let n=(e=e.replace(/\s\s+/g," ").trim().toLowerCase()).substring(e.length-2);"am"===n||"pm"===n?e=e.substring(0,e.length-2).trim():(n=e.substring(e.length-1),"a"===n||"p"===n?e=e.substring(0,e.length-1).trim():n=void 0);const s=e.split(/[ /.-]/g);s.length>=2&&s[s.length-2].includes(":")&&(s[s.length-2]=s[s.length-2]+"."+s[s.length-1],s.pop());const a=s[s.length-1].split(":");if(void 0!==n&&a.push(n),1===s.length)return o(a,r);if(1===a.length)return i(s,t);const l=i(s.slice(0,s.length-1),t),u=o(a,r);return void 0===l||void 0===u?void 0:Object.assign(Object.assign({},l),u)}r.r(t),r.d(t,{defaultParseToDateTime:()=>n,secondsExtendedRegexp:()=>s});const s=/^ss(\.(s+|0+))?$/;function o(e,t){if(void 0===t)return;(t=t.toLowerCase()).endsWith("am/pm")?t=t.substring(0,t.length-5).trim():t.endsWith("a/p")&&(t=t.substring(0,t.length-3).trim());const r=t.split(":");let n;if("am"===e[e.length-1]||"a"===e[e.length-1]?(n=!1,e.pop()):"pm"!==e[e.length-1]&&"p"!==e[e.length-1]||(n=!0,e.pop()),e.length!==r.length)return;const o=r.indexOf("hh"),i=r.indexOf("mm"),a=r.findIndex((e=>s.test(e))),l=-1!==o?e[o]:"0";if(!/^\d+$/.test(l))return;let u=Number(l);if(void 0!==n){if(u<0||u>12)return;u%=12,n&&(u+=12)}const h=-1!==i?e[i]:"0";if(!/^\d+$/.test(h))return;const c=Number(h),d=-1!==a?e[a]:"0";if(!/^\d+(\.\d+)?$/.test(d))return;return{hours:u,minutes:c,seconds:Math.round(1e3*Number(d))/1e3}}function i(e,t){if(void 0===t)return;const r=t.toLowerCase().split(/[ /.-]/g);if(e.length!==r.length)return;const n=r.indexOf("mm"),s=r.indexOf("dd"),o=r.indexOf("yyyy"),i=r.indexOf("yy");if(!(n in e)||!(s in e)||!(o in e)&&!(i in e))return;if(o in e&&i in e)return;let a;if(o in e){const t=e[o];if(!/^\d+$/.test(t))return;if(a=Number(t),a<1e3||a>9999)return}else{const t=e[i];if(!/^\d+$/.test(t))return;if(a=Number(t),a<0||a>99)return}const l=e[n];if(!/^\d+$/.test(l))return;const u=Number(l),h=e[s];if(!/^\d+$/.test(h))return;return{year:a,month:u,day:Number(h)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DateTimeHelper:()=>d,instanceOfSimpleDate:()=>u,instanceOfSimpleTime:()=>h,maxDate:()=>c,numberToSimpleTime:()=>f,offsetMonth:()=>p,roundToNearestSecond:()=>m,timeToNumber:()=>y,toBasisEU:()=>E,truncateDayInMonth:()=>g});var n=r(70);const s=[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],i=60,a=60,l=24;function u(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 h(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)}const c={year:9999,month:12,day:31};class d{constructor(e){this.config=e,this.minDateAbsoluteValue=this.dateToNumberFromZero(e.nullDate),this.maxDateValue=this.dateToNumber(c),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){const{dateTime:t,dateFormat:r="",timeFormat:s=""}=this.parseDateTimeFromConfigFormats(e);if(void 0!==t)return h(t)?u(t)?new n.DateTimeNumber(y(t)+this.dateToNumber(t),r+" "+s):new n.TimeNumber(y(t),s):u(t)?new n.DateNumber(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<=s[e.month-1])))))}dateToNumber(e){return this.dateToNumberFromZero(e)-this.minDateAbsoluteValue}relativeNumberToAbsoluteNumber(e){return e+this.minDateAbsoluteValue-(this.leapYear1900?1:0)}numberToSimpleDate(e){const t=Math.floor(e)+this.minDateAbsoluteValue;let r=Math.floor(t/365.2425);this.dateToNumberFromZero({year:r+1,month:1,day:1})<=t?r++:this.dateToNumberFromZero({year:r-1,month:1,day:1})>t&&r--;const n=t-this.dateToNumberFromZero({year:r,month:1,day:1}),s=function(e){let t=0;o[t+6]<=e&&(t+=6);o[t+3]<=e&&(t+=3);o[t+2]<=e?t+=2:o[t+1]<=e&&(t+=1);return t}(n-(this.isLeapYear(r)&&n>=59?1:0));return{year:r,month:s+1,day:n-o[s]-(this.isLeapYear(r)&&s>1?1:0)+1}}numberToSimpleDateTime(e){const t=f(e%1),r=Math.floor(t.hours/l);t.hours=t.hours%l;const n=this.numberToSimpleDate(Math.floor(e)+r);return Object.assign(Object.assign({},n),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:s[t-1]}endOfMonth(e){return{year:e.year,month:e.month,day:this.daysInMonth(e.year,e.month)}}toBasisUS(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){const n=this.parseDateTime(e,t,r);if(!u(n)||(n.year>=0&&n.year<100&&(n.year<this.getNullYear()?n.year+=2e3:n.year+=1900),this.isValidDate(n)))return n}parseDateTimeFromFormats(e,t,r){const n=0===t.length?[void 0]:t,s=0===r.length?[void 0]:r;for(const t of n)for(const r of s){const n=this.parseSingleFormat(e,t,r);if(void 0!==n)return{dateTime:n,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 p(e,t){const r=12*e.year+e.month-1+t;return{year:Math.floor(r/12),month:r%12+1,day:e.day}}function g(e){return{year:e.year,month:e.month,day:Math.min(e.day,s[e.month-1])}}function m(e){return Math.round(3600*e*24)/86400}function f(e){const t=e*l*a*i,r=function(e,t=1){return Math.round(e*t)/t}(t%i,1e5)%i,n=(t-r)/i,s=Math.round(n%a)%a,o=(n-s)/a;return{hours:Math.round(o),minutes:s,seconds:r}}function y(e){return((e.seconds/60+e.minutes)/60+e.hours)/24}function E(e){return{year:e.year,month:e.month,day:Math.min(30,e.day)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AlwaysDense:()=>a,AlwaysSparse:()=>i,DenseSparseChooseBasedOnThreshold:()=>o});var n=r(92),s=r(91);class o{constructor(e){this.threshold=e}call(e){return e>this.threshold?n.DenseStrategy:s.SparseStrategy}}class i{call(){return s.SparseStrategy}}class a{call(){return n.DenseStrategy}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{defaultStringifyDateTime:()=>c,defaultStringifyDuration:()=>h,format:()=>i,padLeft:()=>a,padRight:()=>l});var n=r(101),s=r(102),o=r(105);function i(e,t,r,n){const i=r.stringifyDateTime(n.numberToSimpleDateTime(e),t);if(void 0!==i)return i;const h=r.stringifyDuration((0,s.numberToSimpleTime)(e),t);if(void 0!==h)return h;const c=(0,o.parseForNumberFormat)(t);return void 0!==c?function(e,t){let r="";for(let n=0;n<e.length;++n){const s=e[n];if(s.type===o.TokenType.FREE_TEXT){r+=s.value;continue}const i=s.value.split("."),h=i[0],c=i[1]||"",d=i[1]?".":"",p=Number(t.toFixed(c.length)).toString().split(".");let g=p[0]||"",m=p[1]||"";if(h.length>g.length){g=a(g,u(h.substr(0,h.length-g.length),"0")+g.length)}m=l(m,u(c.substr(m.length,c.length-m.length),"0")+m.length),r+=g+d+m}return r}(c.tokens,e):t}function a(e,t){let r=`${e}`;for(;r.length<t;)r="0"+r;return r}function l(e,t){let r=`${e}`;for(;r.length<t;)r+="0";return r}function u(e,t){return e.split(t).length-1}function h(e,t){const r=(0,o.parseForDateTimeFormat)(t);if(void 0===r)return;const s=r.tokens;let i="";for(const t of s)if(t.type!==o.TokenType.FREE_TEXT)switch(t.value.toLowerCase()){case"h":case"hh":i+=a(e.hours,t.value.length),e.hours=0;break;case"[hh]":i+=a(e.hours,t.value.length-2),e.hours=0;break;case"m":case"mm":i+=a(e.minutes,t.value.length),e.minutes=0;break;case"[mm]":i+=a(e.minutes+60*e.hours,t.value.length-2),e.minutes=0,e.hours=0;break;case"s":case"ss":i+=a(Math.floor(e.seconds),t.value.length);break;default:if(n.secondsExtendedRegexp.test(t.value)){const r=Math.max(t.value.length-3,0);i+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,r))/Math.pow(10,r)}`;continue}return}else i+=t.value;return i}function c(e,t){const r=(0,o.parseForDateTimeFormat)(t);if(void 0===r)return;const s=r.tokens;let i="",l=!1;const u=s.some((e=>e.type===o.TokenType.FORMAT&&("a/p"===e.value||"A/P"===e.value||"am/pm"===e.value||"AM/PM"===e.value)));for(let t=0;t<s.length;t++){const r=s[t];if(r.type!==o.TokenType.FREE_TEXT)switch(r.value.toLowerCase()){case"h":case"hh":l=!0,i+=a(u?(e.hours+11)%12+1:e.hours,r.value.length);break;case"d":case"dd":i+=a(e.day,r.value.length);break;case"s":case"ss":i+=a(Math.floor(e.seconds),r.value.length);break;case"m":case"mm":t+1<s.length&&s[t+1].value.startsWith(":")&&(l=!0),i+=a(l?e.minutes:e.month,r.value.length),l=!0;break;case"yy":i+=a(e.year%100,r.value.length);break;case"yyyy":i+=e.year;break;case"am/pm":case"a/p":{const[t,n]=r.value.split("/");i+=e.hours<12?t:n;break}default:if(n.secondsExtendedRegexp.test(r.value)){const t=r.value.length-3;i+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,t))/Math.pow(10,t)}`;continue}return}else i+=r.value}return i}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FormatExpressionType:()=>i,TokenType:()=>o,formatToken:()=>a,isEscapeToken:()=>d,parse:()=>c,parseForDateTimeFormat:()=>u,parseForNumberFormat:()=>h});const n=/(\\.|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,s=/(\\.|[#0]+(\.[#0]*)?)/g;var o,i;function a(e,t){return{type:e,value:t}}function l(e,t){const r=[];let n=0;for(let s=0;s<e.length;++s){const i=e[s];if(i.index!==n){const e=t.substr(n,i.index-n);r.push(a(o.FREE_TEXT,e))}i[0].startsWith("\\")?r.push(a(o.FREE_TEXT,i[0])):r.push(a(o.FORMAT,i[0])),n=i.index+i[0].length}const s=e[e.length-1];if(s.index+s[0].length<t.length){const e=t.substr(s.index+s[0].length,t.length);r.push(a(o.FREE_TEXT,e))}return r}function u(e){const t=function(e){n.lastIndex=0;const t=[];let r;do{r=n.exec(e),null!==r&&t.push(r)}while(r);return t}(e);return t.every((e=>d(e)))?void 0:{type:i.DATE,tokens:l(t,e)}}function h(e){const t=function(e){s.lastIndex=0;const t=s.exec(e);return null!==t?[t]:[]}(e);return t.every((e=>d(e)))?void 0:{type:i.NUMBER,tokens:l(t,e)}}function c(e){var t,r;return null!==(r=null!==(t=u(e))&&void 0!==t?t:h(e))&&void 0!==r?r:{type:i.STRING,tokens:[{type:o.FREE_TEXT,value:e}]}}function d(e){return e[0].startsWith("\\")}!function(e){e.FORMAT="FORMAT",e.FREE_TEXT="FREE_TEXT"}(o||(o={})),function(e){e.DATE="DATE",e.NUMBER="NUMBER",e.STRING="STRING"}(i||(i={}))},(e,t,r)=>{"use strict";r.r(t),r.d(t,{checkLicenseKeyValidity:()=>i});var n=r(107);const s={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."};let o=!1;function i(e){const t={template:"missing",vars:{}};if("gpl-v3"===e||"internal-use-in-handsontable"===e)t.template="valid";else if("string"==typeof e&&(0,n.checkKeySchema)(e)){const[r,s,o]="29/05/2023".split("/"),i=Math.floor(new Date(`${s}/${r}/${o}`).getTime()/864e5),a=(0,n.extractTime)(e);t.vars.keyValidityDate=function(e){const t=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],r=e.getDate(),n=e.getFullYear();return`${t} ${r}, ${n}`}(new Date(864e5*(a+1))),t.template=i>a?"expired":"valid"}else""!==e&&(t.template="invalid");return o||"valid"===t.template||(console.warn(s[t.template](t.vars)),o=!0),t.template}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{checkKeySchema:()=>h,extractTime:()=>u});const n="length",s=e=>parseInt(e,16),o=e=>parseInt(e,10),i=e=>(e+"").replace(/\-/g,""),a=(e,t,r)=>e.substr(t,r),l=e=>e.codePointAt(0)-65;function u(e){return 25===i(e)[n]?s(a(i(e),s("12"),l("F")))/(s(a(i(e),l("C"),l("Y")>>4))||1+(~~![][n]<<3)):0}function h(e){if((e=(e+"").replace(/\-/g,""))[n]!==l("Z"))return!1;let t=0;return[[0,l("G")+1],[l("H"),l("H")-1],[l("G")+l("H"),l("G")]].reduce(((r,[n,i],l)=>(r|=(o(`${o(s(a(e,t+n-(0===l?0:2),i+(l?2:0)))+(s(a(e,t+n+i,2))+[]).padStart(2,"0"))}`)%97||2)>>1,t+=2,r)),l("A"))===[]+1>>1}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{HyperFormula:()=>y});var n=r(2),s=r(100),o=r(109),i=r(3),a=r(110),l=r(99),u=r(102),h=r(141),c=r(142),d=r(77),p=r(86),g=r(128),m=r(114),f=r(7);class y{constructor(e,t,r,n,s,o,i,a,l,u,h,d,p,g){this._config=e,this._stats=t,this._dependencyGraph=r,this._columnSearch=n,this._parser=s,this._unparser=o,this._cellContentParser=i,this._evaluator=a,this._lazilyTransformingAstService=l,this._crudOperations=u,this._exporter=h,this._namedExpressions=d,this._serialization=p,this._functionRegistry=g,this._emitter=new c.Emitter,this._evaluationSuspended=!1}static get defaultConfig(){return(0,l.getDefaultConfig)()}get graph(){return this.dependencyGraph.graph}get rangeMapping(){return this.dependencyGraph.rangeMapping}get arrayMapping(){return this.dependencyGraph.arrayMapping}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}get dependencyGraph(){return this._dependencyGraph}get evaluator(){return this._evaluator}get columnSearch(){return this._columnSearch}get lazilyTransformingAstService(){return this._lazilyTransformingAstService}get licenseKeyValidityState(){return this._config.licenseKeyValidityState}static buildFromArray(e,t={},r=[]){return this.buildFromEngineState(o.BuildEngineFactory.buildFromSheet(e,t,r))}static buildFromSheets(e,t={},r=[]){return this.buildFromEngineState(o.BuildEngineFactory.buildFromSheets(e,t,r))}static buildEmpty(e={},t=[]){return this.buildFromEngineState(o.BuildEngineFactory.buildEmpty(e,t))}static getLanguage(e){(0,s.validateArgToType)(e,"string","languageCode");const t=this.registeredLanguages.get(e);if(void 0===t)throw new d.LanguageNotRegisteredError;return t}static registerLanguage(e,t){if((0,s.validateArgToType)(e,"string","languageCode"),this.registeredLanguages.has(e))throw new d.LanguageAlreadyRegisteredError;this.registeredLanguages.set(e,(0,p.buildTranslationPackage)(t))}static unregisterLanguage(e){if((0,s.validateArgToType)(e,"string","languageCode"),!this.registeredLanguages.has(e))throw new d.LanguageNotRegisteredError;this.registeredLanguages.delete(e)}static getRegisteredLanguagesCodes(){return Array.from(this.registeredLanguages.keys())}static registerFunctionPlugin(e,t){g.FunctionRegistry.registerFunctionPlugin(e,t)}static unregisterFunctionPlugin(e){g.FunctionRegistry.unregisterFunctionPlugin(e)}static registerFunction(e,t,r){(0,s.validateArgToType)(e,"string","functionId"),g.FunctionRegistry.registerFunction(e,t,r)}static unregisterFunction(e){(0,s.validateArgToType)(e,"string","functionId"),g.FunctionRegistry.unregisterFunction(e)}static unregisterAllFunctions(){g.FunctionRegistry.unregisterAll()}static getRegisteredFunctionNames(e){(0,s.validateArgToType)(e,"string","code");const t=g.FunctionRegistry.getRegisteredFunctionIds();return this.getLanguage(e).getFunctionTranslations(t)}static getFunctionPlugin(e){return(0,s.validateArgToType)(e,"string","functionId"),g.FunctionRegistry.getFunctionPlugin(e)}static getAllFunctionPlugins(){return g.FunctionRegistry.getPlugins()}static buildFromEngineState(e){return new y(e.config,e.stats,e.dependencyGraph,e.columnSearch,e.parser,e.unparser,e.cellContentParser,e.evaluator,e.lazilyTransformingAstService,e.crudOperations,e.exporter,e.namedExpressions,e.serialization,e.functionRegistry)}getCellValue(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellValue(e)}getCellFormula(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this._serialization.getCellFormula(e)}getCellHyperlink(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellHyperlink(e)}getCellSerialized(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellSerialized(e)}getSheetValues(e){return(0,s.validateArgToType)(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetValues(e)}getSheetFormulas(e){return(0,s.validateArgToType)(e,"number","sheetId"),this._serialization.getSheetFormulas(e)}getSheetSerialized(e){return(0,s.validateArgToType)(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetSerialized(e)}getAllSheetsDimensions(){return this._serialization.genericAllSheetsGetter((e=>this.getSheetDimensions(e)))}getSheetDimensions(e){return(0,s.validateArgToType)(e,"number","sheetId"),{width:this.dependencyGraph.getSheetWidth(e),height:this.dependencyGraph.getSheetHeight(e)}}getAllSheetsValues(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsValues()}getAllSheetsFormulas(){return this._serialization.getAllSheetsFormulas()}getAllSheetsSerialized(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsSerialized()}updateConfig(e){Object.entries(e).every((([e,t])=>this._config[e]===t))||this.rebuildWithConfig(e)}getConfig(){return this._config.getConfig()}rebuildAndRecalculate(){this.rebuildWithConfig({})}getStats(){return this._stats.snapshot()}undo(){return this._crudOperations.undo(),this.recomputeIfDependencyGraphNeedsIt()}redo(){return this._crudOperations.redo(),this.recomputeIfDependencyGraphNeedsIt()}isThereSomethingToUndo(){return this._crudOperations.isThereSomethingToUndo()}isThereSomethingToRedo(){return this._crudOperations.isThereSomethingToRedo()}isItPossibleToSetCellContents(e){let t;if((0,i.isSimpleCellAddress)(e))t=new n.AbsoluteCellRange(e,e);else{if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange","address");t=new n.AbsoluteCellRange(e.start,e.end)}try{this._crudOperations.ensureRangeInSizeLimits(t);for(const e of t.addresses(this._dependencyGraph))this._crudOperations.ensureItIsPossibleToChangeContent(e)}catch(e){return!1}return!0}setCellContents(e,t){return this._crudOperations.setCellContents(e,t),this.recomputeIfDependencyGraphNeedsIt()}swapRowIndexes(e,t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.setRowOrder(e,t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToSwapRowIndexes(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.validateSwapRowIndexes(e,t),this._crudOperations.testRowOrderForArrays(e,t),!0}catch(e){return!1}}setRowOrder(e,t){(0,s.validateArgToType)(e,"number","sheetId");const r=this._crudOperations.mappingFromOrder(e,t,"row");return this.swapRowIndexes(e,r)}isItPossibleToSetRowOrder(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{const r=this._crudOperations.mappingFromOrder(e,t,"row");return this._crudOperations.validateSwapRowIndexes(e,r),this._crudOperations.testRowOrderForArrays(e,r),!0}catch(e){return!1}}swapColumnIndexes(e,t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.setColumnOrder(e,t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToSwapColumnIndexes(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.validateSwapColumnIndexes(e,t),this._crudOperations.testColumnOrderForArrays(e,t),!0}catch(e){return!1}}setColumnOrder(e,t){(0,s.validateArgToType)(e,"number","sheetId");const r=this._crudOperations.mappingFromOrder(e,t,"column");return this.swapColumnIndexes(e,r)}isItPossibleToSetColumnOrder(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{const r=this._crudOperations.mappingFromOrder(e,t,"column");return this._crudOperations.validateSwapColumnIndexes(e,r),this._crudOperations.testColumnOrderForArrays(e,r),!0}catch(e){return!1}}isItPossibleToAddRows(e,...t){(0,s.validateArgToType)(e,"number","sheetId");const r=(0,m.normalizeAddedIndexes)(t);try{return this._crudOperations.ensureItIsPossibleToAddRows(e,...r),!0}catch(e){return!1}}addRows(e,...t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.addRows(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveRows(e,...t){(0,s.validateArgToType)(e,"number","sheetId");const r=(0,m.normalizeRemovedIndexes)(t);try{return this._crudOperations.ensureItIsPossibleToRemoveRows(e,...r),!0}catch(e){return!1}}removeRows(e,...t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.removeRows(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToAddColumns(e,...t){(0,s.validateArgToType)(e,"number","sheetId");const r=(0,m.normalizeAddedIndexes)(t);try{return this._crudOperations.ensureItIsPossibleToAddColumns(e,...r),!0}catch(e){return!1}}addColumns(e,...t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.addColumns(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveColumns(e,...t){(0,s.validateArgToType)(e,"number","sheetId");const r=(0,m.normalizeRemovedIndexes)(t);try{return this._crudOperations.ensureItIsPossibleToRemoveColumns(e,...r),!0}catch(e){return!1}}removeColumns(e,...t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.removeColumns(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveCells(e,t){if(!(0,i.isSimpleCellAddress)(t))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","destinationLeftCorner");if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");try{const r=new n.AbsoluteCellRange(e.start,e.end);return this._crudOperations.operations.ensureItIsPossibleToMoveCells(r.start,r.width(),r.height(),t),!0}catch(e){return!1}}moveCells(e,t){if(!(0,i.isSimpleCellAddress)(t))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","destinationLeftCorner");if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");const r=new n.AbsoluteCellRange(e.start,e.end);return this._crudOperations.moveCells(r.start,r.width(),r.height(),t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveRows(e,t,r,n){(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"number","startRow"),(0,s.validateArgToType)(r,"number","numberOfRows"),(0,s.validateArgToType)(n,"number","targetRow");try{return this._crudOperations.ensureItIsPossibleToMoveRows(e,t,r,n),!0}catch(e){return!1}}moveRows(e,t,r,n){return(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"number","startRow"),(0,s.validateArgToType)(r,"number","numberOfRows"),(0,s.validateArgToType)(n,"number","targetRow"),this._crudOperations.moveRows(e,t,r,n),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveColumns(e,t,r,n){(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"number","startColumn"),(0,s.validateArgToType)(r,"number","numberOfColumns"),(0,s.validateArgToType)(n,"number","targetColumn");try{return this._crudOperations.ensureItIsPossibleToMoveColumns(e,t,r,n),!0}catch(e){return!1}}moveColumns(e,t,r,n){return(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"number","startColumn"),(0,s.validateArgToType)(r,"number","numberOfColumns"),(0,s.validateArgToType)(n,"number","targetColumn"),this._crudOperations.moveColumns(e,t,r,n),this.recomputeIfDependencyGraphNeedsIt()}copy(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");const t=new n.AbsoluteCellRange(e.start,e.end);return this._crudOperations.copy(t.start,t.width(),t.height()),this.getRangeValues(e)}cut(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");const t=new n.AbsoluteCellRange(e.start,e.end);return this._crudOperations.cut(t.start,t.width(),t.height()),this.getRangeValues(e)}paste(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","targetLeftCorner");return this.ensureEvaluationIsNotSuspended(),this._crudOperations.paste(e),this.recomputeIfDependencyGraphNeedsIt()}isClipboardEmpty(){return this._crudOperations.isClipboardEmpty()}clearClipboard(){this._crudOperations.clearClipboard()}clearRedoStack(){this._crudOperations.undoRedo.clearRedoStack()}clearUndoStack(){this._crudOperations.undoRedo.clearUndoStack()}getRangeValues(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");return new n.AbsoluteCellRange(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellValue(e)))))}getRangeFormulas(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");return new n.AbsoluteCellRange(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellFormula(e)))))}getRangeSerialized(e){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");return new n.AbsoluteCellRange(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellSerialized(e)))))}getFillRangeData(e,t,r=!1){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","source");if(!(0,n.isSimpleCellRange)(t))throw new d.ExpectedValueOfTypeError("SimpleCellRange","target");const s=new n.AbsoluteCellRange(e.start,e.end),o=new n.AbsoluteCellRange(t.start,t.end);return this.ensureEvaluationIsNotSuspended(),o.arrayOfAddressesInRange().map((n=>n.map((n=>{const o=((n.row-(r?t:e).start.row)%s.height()+s.height())%s.height()+e.start.row,i=((n.col-(r?t:e).start.col)%s.width()+s.width())%s.width()+e.start.col;return this._serialization.getCellSerialized({row:o,col:i,sheet:s.sheet},n)}))))}isItPossibleToAddSheet(e){(0,s.validateArgToType)(e,"string","sheetName");try{return this._crudOperations.ensureItIsPossibleToAddSheet(e),!0}catch(e){return!1}}addSheet(e){void 0!==e&&(0,s.validateArgToType)(e,"string","sheetName");const t=this._crudOperations.addSheet(e);return this._emitter.emit(c.Events.SheetAdded,t),t}isItPossibleToRemoveSheet(e){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),!0}catch(e){return!1}}removeSheet(e){(0,s.validateArgToType)(e,"number","sheetId");const t=this.sheetMapping.getDisplayName(e);this._crudOperations.removeSheet(e);const r=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(c.Events.SheetRemoved,t,r),r}isItPossibleToClearSheet(e){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),!0}catch(e){return!1}}clearSheet(e){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.clearSheet(e),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToReplaceSheetContent(e,t){(0,s.validateArgToType)(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),this._crudOperations.ensureItIsPossibleToChangeSheetContents(e,t),!0}catch(e){return!1}}setSheetContent(e,t){return(0,s.validateArgToType)(e,"number","sheetId"),this._crudOperations.setSheetContent(e,t),this.recomputeIfDependencyGraphNeedsIt()}simpleCellAddressFromString(e,t){return(0,s.validateArgToType)(e,"string","cellAddress"),(0,s.validateArgToType)(t,"number","sheetId"),(0,f.simpleCellAddressFromString)(this.sheetMapping.get,e,t)}simpleCellRangeFromString(e,t){return(0,s.validateArgToType)(e,"string","cellRange"),(0,s.validateArgToType)(t,"number","sheetId"),(0,f.simpleCellRangeFromString)(this.sheetMapping.get,e,t)}simpleCellAddressToString(e,t){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return(0,s.validateArgToType)(t,"number","sheetId"),(0,f.simpleCellAddressToString)(this.sheetMapping.fetchDisplayName,e,t)}simpleCellRangeToString(e,t){if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellRange","cellRange");return(0,s.validateArgToType)(t,"number","sheetId"),(0,f.simpleCellRangeToString)(this.sheetMapping.fetchDisplayName,e,t)}getCellDependents(e){let t;if((0,i.isSimpleCellAddress)(e))t=this._dependencyGraph.addressMapping.getCell(e);else{if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange",e);t=this._dependencyGraph.rangeMapping.getRange(e.start,e.end)}return void 0===t?[]:this._dependencyGraph.getAdjacentNodesAddresses(t)}getCellPrecedents(e){let t;if((0,i.isSimpleCellAddress)(e))t=this._dependencyGraph.addressMapping.getCell(e);else{if(!(0,n.isSimpleCellRange)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange",e);t=this._dependencyGraph.rangeMapping.getRange(e.start,e.end)}return void 0===t?[]:this._dependencyGraph.dependencyQueryAddresses(t)}getSheetName(e){return(0,s.validateArgToType)(e,"number","sheetId"),this.sheetMapping.getDisplayName(e)}getSheetNames(){return this.sheetMapping.sheetNames()}getSheetId(e){return(0,s.validateArgToType)(e,"string","sheetName"),this.sheetMapping.get(e)}doesSheetExist(e){return(0,s.validateArgToType)(e,"string","sheetName"),this.sheetMapping.hasSheetWithName(e)}getCellType(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");const t=this.dependencyGraph.getCell(e);return(0,i.getCellType)(t,e)}doesCellHaveSimpleValue(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.getCellType(e)===i.CellType.VALUE}doesCellHaveFormula(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");const t=this.getCellType(e);return t===i.CellType.FORMULA||t===i.CellType.ARRAYFORMULA}isCellEmpty(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");return this.getCellType(e)===i.CellType.EMPTY}isCellPartOfArray(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");const t=this.getCellType(e);return t===i.CellType.ARRAY||t===i.CellType.ARRAYFORMULA}getCellValueType(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return(0,i.getCellValueType)(t)}getCellValueDetailedType(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return(0,i.getCellValueDetailedType)(t)}getCellValueFormat(e){if(!(0,i.isSimpleCellAddress)(e))throw new d.ExpectedValueOfTypeError("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return(0,i.getCellValueFormat)(t)}countSheets(){return this.sheetMapping.numberOfSheets()}isItPossibleToRenameSheet(e,t){(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"string","newName");try{return this._crudOperations.ensureItIsPossibleToRenameSheet(e,t),!0}catch(e){return!1}}renameSheet(e,t){(0,s.validateArgToType)(e,"number","sheetId"),(0,s.validateArgToType)(t,"string","newName");const r=this._crudOperations.renameSheet(e,t);void 0!==r&&this._emitter.emit(c.Events.SheetRenamed,r,t)}batch(e){this.suspendEvaluation(),this._crudOperations.beginUndoRedoBatchMode();try{e()}catch(e){throw this._crudOperations.commitUndoRedoBatchMode(),this.resumeEvaluation(),e}return this._crudOperations.commitUndoRedoBatchMode(),this.resumeEvaluation()}suspendEvaluation(){this._evaluationSuspended=!0,this._emitter.emit(c.Events.EvaluationSuspended)}resumeEvaluation(){this._evaluationSuspended=!1;const e=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(c.Events.EvaluationResumed,e),e}isEvaluationSuspended(){return this._evaluationSuspended}isItPossibleToAddNamedExpression(e,t,r){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==r&&(0,s.validateArgToType)(r,"number","scope");try{return this._crudOperations.ensureItIsPossibleToAddNamedExpression(e,t,r),!0}catch(e){return!1}}addNamedExpression(e,t,r,n){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==r&&(0,s.validateArgToType)(r,"number","scope"),this._crudOperations.addNamedExpression(e,t,r,n);const o=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(c.Events.NamedExpressionAdded,e,o),o}getNamedExpressionValue(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope"),this.ensureEvaluationIsNotSuspended(),this._crudOperations.ensureScopeIdIsValid(t);const r=this._namedExpressions.namedExpressionForScope(e,t);return r?this._serialization.getCellValue(r.address):void 0}getNamedExpressionFormula(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope"),this._crudOperations.ensureScopeIdIsValid(t);const r=this._namedExpressions.namedExpressionForScope(e,t);return void 0===r?void 0:this._serialization.getCellFormula(r.address)}getNamedExpression(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope");const r=this._namedExpressions.namedExpressionForScope(e,t);if(void 0===r)return;return{name:e,scope:t,expression:this._serialization.getCellFormula(r.address),options:r.options}}isItPossibleToChangeNamedExpression(e,t,r){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==r&&(0,s.validateArgToType)(r,"number","scope");try{return this._crudOperations.ensureItIsPossibleToChangeNamedExpression(e,t,r),!0}catch(e){return!1}}changeNamedExpression(e,t,r,n){return(0,s.validateArgToType)(e,"string","expressionName"),void 0!==r&&(0,s.validateArgToType)(r,"number","scope"),this._crudOperations.changeNamedExpressionExpression(e,r,t,n),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveNamedExpression(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope");try{return this._crudOperations.isItPossibleToRemoveNamedExpression(e,t),!0}catch(e){return!1}}removeNamedExpression(e,t){(0,s.validateArgToType)(e,"string","expressionName"),void 0!==t&&(0,s.validateArgToType)(t,"number","scope");const r=this._crudOperations.removeNamedExpression(e,t);if(r){const e=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(c.Events.NamedExpressionRemoved,r.displayName,e),e}return[]}listNamedExpressions(e){return void 0!==e&&(0,s.validateArgToType)(e,"number","scope"),this._crudOperations.ensureScopeIdIsValid(e),this._namedExpressions.getAllNamedExpressionsNamesInScope(e)}getAllNamedExpressionsSerialized(){return this._serialization.getAllNamedExpressionsSerialized()}normalizeFormula(e){(0,s.validateArgToType)(e,"string","formulaString");const{ast:t,address:r}=this.extractTemporaryFormula(e);if(void 0===t)throw new d.NotAFormulaError;return this._unparser.unparse(t,r)}calculateFormula(e,t){(0,s.validateArgToType)(e,"string","formulaString"),(0,s.validateArgToType)(t,"number","sheetId"),this._crudOperations.ensureScopeIdIsValid(t);const{ast:r,address:n,dependencies:o}=this.extractTemporaryFormula(e,t);if(void 0===r)throw new d.NotAFormulaError;const i=this.evaluator.runAndForget(r,n,o);return this._exporter.exportScalarOrRange(i)}validateFormula(e){(0,s.validateArgToType)(e,"string","formulaString");const{ast:t}=this.extractTemporaryFormula(e);return void 0!==t&&!(t.type===f.AstNodeType.ERROR&&!t.error)}getRegisteredFunctionNames(){return y.getLanguage(this._config.language).getFunctionTranslations(this._functionRegistry.getRegisteredFunctionIds())}getFunctionPlugin(e){return(0,s.validateArgToType)(e,"string","functionId"),this._functionRegistry.getFunctionPlugin(e)}getAllFunctionPlugins(){return this._functionRegistry.getPlugins()}numberToDateTime(e){return(0,s.validateArgToType)(e,"number","val"),this._evaluator.interpreter.dateTimeHelper.numberToSimpleDateTime(e)}numberToDate(e){return(0,s.validateArgToType)(e,"number","val"),this._evaluator.interpreter.dateTimeHelper.numberToSimpleDate(e)}numberToTime(e){return(0,s.validateArgToType)(e,"number","val"),(0,u.numberToSimpleTime)(e)}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}destroy(){(0,h.objectDestroy)(this)}ensureEvaluationIsNotSuspended(){if(this._evaluationSuspended)throw new d.EvaluationSuspendedError}extractTemporaryFormula(e,t=1){const r=this._cellContentParser.parse(e),n={sheet:t,col:0,row:0};if(!(r instanceof a.CellContent.Formula))return{address:n,dependencies:[]};const{ast:s,errors:o,dependencies:i}=this._parser.parse(r.formula,n);return o.length>0?{address:n,dependencies:[]}:{ast:s,address:n,dependencies:i}}rebuildWithConfig(e){const t=this._config.mergeConfig(e),r=this._config.mergeConfig({language:e.language}),n=this._serialization.withNewConfig(r,this._namedExpressions).getAllSheetsSerialized(),s=this._serialization.getAllNamedExpressionsSerialized(),i=o.BuildEngineFactory.rebuildWithConfig(t,n,s,this._stats);this._config=i.config,this._stats=i.stats,this._dependencyGraph=i.dependencyGraph,this._columnSearch=i.columnSearch,this._parser=i.parser,this._unparser=i.unparser,this._cellContentParser=i.cellContentParser,this._evaluator=i.evaluator,this._lazilyTransformingAstService=i.lazilyTransformingAstService,this._crudOperations=i.crudOperations,this._exporter=i.exporter,this._namedExpressions=i.namedExpressions,this._serialization=i.serialization,this._functionRegistry=i.functionRegistry}recomputeIfDependencyGraphNeedsIt(){if(this._evaluationSuspended)return[];{const e=this._crudOperations.getAndClearContentChanges(),t=Array.from(this.dependencyGraph.verticesToRecompute());this.dependencyGraph.clearRecentlyChangedVertices(),t.length>0&&e.addAll(this.evaluator.partialRun(t));const r=e.exportChanges(this._exporter);return e.isEmpty()||this._emitter.emit(c.Events.ValuesUpdated,r),r}}}y.version="2.5.0",y.buildDate="29/05/2023 09:32:33",y.releaseDate="29/05/2023",y.languages={},y.registeredLanguages=new Map},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BuildEngineFactory:()=>M});var n=r(1),s=r(110),o=r(111),i=r(99),a=r(112),l=r(102),u=r(4),h=r(77),c=r(125),d=r(126),p=r(127),g=r(86),m=r(95),f=r(128),y=r(130),E=r(132),C=r(134),T=r(113),R=r(139),w=r(114),S=r(7),v=r(140),A=r(123),N=r(72),O=r(124);class M{static buildFromSheets(e,t={},r=[]){const n=new i.Config(t);return this.buildEngine(n,e,r)}static buildFromSheet(e,t={},r=[]){const n=new i.Config(t),s=n.translationPackage.getUITranslation(g.UIElement.NEW_SHEET_PREFIX)+"1";return this.buildEngine(n,{[s]:e},r)}static buildEmpty(e={},t=[]){return this.buildEngine(new i.Config(e),{},t)}static rebuildWithConfig(e,t,r,n){return this.buildEngine(e,t,r,n)}static buildEngine(e,t={},r=[],i=(e.useStats?new N.Statistics:new N.EmptyStatistics)){i.start(N.StatType.BUILD_ENGINE_TOTAL);const g=new T.NamedExpressions,M=new f.FunctionRegistry(e),b=new E.LazilyTransformingAstService(i),I=u.DependencyGraph.buildEmpty(b,e,M,g,i),_=(0,C.buildColumnSearchStrategy)(I,e,i),x=I.sheetMapping,P=I.addressMapping;for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=t[r];(0,A.validateAsSheet)(n);const s=(0,A.findBoundaries)(n);if(s.height>e.maxRows||s.width>e.maxColumns)throw new h.SheetSizeLimitExceededError;const o=x.addSheet(r);P.autoAddSheet(o,n,s)}const L=new S.ParserWithCaching(e,M,x.get);b.parser=L;const D=new S.Unparser(e,(0,S.buildLexerConfig)(e),x.fetchDisplayName,g),F=new l.DateTimeHelper(e),k=new R.NumberLiteralHelper(e),H=new m.ArithmeticHelper(e,F,k),U=new s.CellContentParser(e,F,k),V=new n.ArraySizePredictor(e,M),B=new w.Operations(e,I,_,U,L,i,b,g,V),W=new O.UndoRedo(e,B);b.undoRedo=W;const G=new o.ClipboardOperations(e,I,B),Y=new a.CrudOperations(e,B,W,G,I,_,L,U,b,g);r.forEach((e=>{Y.ensureItIsPossibleToAddNamedExpression(e.name,e.expression,e.scope),Y.operations.addNamedExpression(e.name,e.expression,e.scope,e.options)}));const j=new d.Exporter(e,g,x.fetchDisplayName,b),z=new v.Serialization(I,D,j),$=new y.Interpreter(e,I,_,i,H,M,g,z,V,F);i.measure(N.StatType.GRAPH_BUILD,(()=>{new p.GraphBuilder(I,_,L,U,i,V).buildGraph(t,i)}));const K=new c.Evaluator(e,i,$,b,I,_);return K.run(),i.end(N.StatType.BUILD_ENGINE_TOTAL),{config:e,stats:i,dependencyGraph:I,columnSearch:_,parser:L,unparser:D,cellContentParser:U,evaluator:K,lazilyTransformingAstService:b,crudOperations:Y,exporter:j,namedExpressions:g,serialization:z,functionRegistry:M}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CellContent:()=>n,CellContentParser:()=>p,isBoolean:()=>c,isError:()=>d,isFormula:()=>h});var n,s=r(3),o=r(102),i=r(61),a=r(77),l=r(95),u=r(70);function h(e){return e.startsWith("=")}function c(e){const t=e.toLowerCase();return"true"===t||"false"===t}function d(e,t){const r=e.toUpperCase();return/#[A-Za-z0-9\/]+[?!]?/.test(r)&&Object.prototype.hasOwnProperty.call(t,r)}!function(e){e.Number=class{constructor(e){this.value=e,this.value=(0,u.cloneNumber)(this.value,(0,l.fixNegativeZero)((0,u.getRawValue)(this.value)))}};e.String=class{constructor(e){this.value=e}};e.Boolean=class{constructor(e){this.value=e}};class t{static getSingletonInstance(){return t.instance||(t.instance=new t),t.instance}}e.Empty=t;e.Formula=class{constructor(e){this.formula=e}};e.Error=class{constructor(e,t){this.value=new s.CellError(e,t)}}}(n||(n={}));class p{constructor(e,t,r){this.config=e,this.dateHelper=t,this.numberLiteralsHelper=r}parse(e){if(null==e)return n.Empty.getSingletonInstance();if("number"==typeof e)return(0,l.isNumberOverflow)(e)?new n.Error(s.ErrorType.NUM,i.ErrorMessage.ValueLarge):new n.Number(e);if("boolean"==typeof e)return new n.Boolean(e);if(e instanceof Date){const t=this.dateHelper.dateToNumber({day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear()})+(0,o.timeToNumber)({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()+e.getMilliseconds()/1e3});return t<0?new n.Error(s.ErrorType.NUM,i.ErrorMessage.DateBounds):t%1==0?new n.Number(new u.DateNumber(t,"Date()")):t<1?new n.Number(new u.TimeNumber(t,"Date()")):new n.Number(new u.DateTimeNumber(t,"Date()"))}if("string"==typeof e){if(c(e))return new n.Boolean("true"===e.toLowerCase());if(h(e))return new n.Formula(e);if(d(e,this.config.errorMapping))return new n.Error(this.config.errorMapping[e.toUpperCase()]);{let t,r=e.trim(),s=0;if(r.endsWith("%"))s=1,r=r.slice(0,r.length-1);else{const e=this.currencyMatcher(r);void 0!==e&&(s=2,[t,r]=e)}const o=this.numberLiteralsHelper.numericStringToMaybeNumber(r);if(void 0!==o){let e;return e=1===s?new u.PercentNumber(o/100):2===s?new u.CurrencyNumber(o,t):o,new n.Number(e)}const i=this.dateHelper.dateStringToDateNumber(r);return void 0!==i?new n.Number(i):new n.String(e.startsWith("'")?e.slice(1):e)}}throw new a.UnableToParseError(e)}currencyMatcher(e){for(const 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)]}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClipboardCellType:()=>s,ClipboardOperations:()=>u});var n,s,o=r(2),i=r(3),a=r(77);!function(e){e[e.COPY=0]="COPY",e[e.CUT=1]="CUT"}(n||(n={})),function(e){e[e.VALUE=0]="VALUE",e[e.EMPTY=1]="EMPTY",e[e.FORMULA=2]="FORMULA",e[e.PARSING_ERROR=3]="PARSING_ERROR"}(s||(s={}));class l{constructor(e,t,r,n,s){this.sourceLeftCorner=e,this.width=t,this.height=r,this.type=n,this.content=s}*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,i.simpleCellAddress)(e.sheet,e.col+r,e.row+t),this.content[t][r]]}}class u{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 l(e,t,r,n.CUT)}copy(e,t,r){const s=[];for(let n=0;n<r;++n){s[n]=[];for(let r=0;r<t;++r){const t=this.operations.getClipboardCell((0,i.simpleCellAddress)(e.sheet,e.col+r,e.row+n));s[n].push(t)}}this.clipboard=new l(e,t,r,n.COPY,s)}abortCut(){this.clipboard&&this.clipboard.type===n.CUT&&this.clear()}clear(){this.clipboard=void 0}ensureItIsPossibleToCopyPaste(e){if(void 0===this.clipboard)return;if((0,i.invalidSimpleCellAddress)(e)||!this.dependencyGraph.sheetMapping.hasSheetWithId(e.sheet))throw new a.InvalidArgumentsError("a valid target address.");const t=o.AbsoluteCellRange.spanFrom(e,this.clipboard.width,this.clipboard.height);if(t.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new a.SheetSizeLimitExceededError;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new Error("It is not possible to paste onto an array")}isCutClipboard(){return void 0!==this.clipboard&&this.clipboard.type===n.CUT}isCopyClipboard(){return void 0!==this.clipboard&&this.clipboard.type===n.COPY}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CrudOperations:()=>d});var n=r(2),s=r(3),o=r(110),i=r(77),a=r(113),l=r(114),u=r(123),h=r(71),c=r(124);class d{constructor(e,t,r,n,s,o,i,a,l,u){this.operations=t,this.undoRedo=r,this.clipboardOperations=n,this.dependencyGraph=s,this.columnSearch=o,this.parser=i,this.cellContentParser=a,this.lazilyTransformingAstService=l,this.namedExpressions=u,this.maxRows=e.maxRows,this.maxColumns=e.maxColumns}get sheetMapping(){return this.dependencyGraph.sheetMapping}addRows(e,...t){const r=new l.AddRowsCommand(e,t);this.ensureItIsPossibleToAddRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addRows(r),this.undoRedo.saveOperation(new c.AddRowsUndoEntry(r))}removeRows(e,...t){const r=new l.RemoveRowsCommand(e,t);this.ensureItIsPossibleToRemoveRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const n=this.operations.removeRows(r);this.undoRedo.saveOperation(new c.RemoveRowsUndoEntry(r,n))}addColumns(e,...t){const r=new l.AddColumnsCommand(e,t);this.ensureItIsPossibleToAddColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addColumns(r),this.undoRedo.saveOperation(new c.AddColumnsUndoEntry(r))}removeColumns(e,...t){const r=new l.RemoveColumnsCommand(e,t);this.ensureItIsPossibleToRemoveColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const n=this.operations.removeColumns(r);this.undoRedo.saveOperation(new c.RemoveColumnsUndoEntry(r,n))}moveCells(e,t,r,n){this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const{version:s,overwrittenCellsData:o,addedGlobalNamedExpressions:i}=this.operations.moveCells(e,t,r,n);this.undoRedo.saveOperation(new c.MoveCellsUndoEntry(e,t,r,n,o,i,s))}moveRows(e,t,r,n){this.ensureItIsPossibleToMoveRows(e,t,r,n),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const s=this.operations.moveRows(e,t,r,n);this.undoRedo.saveOperation(new c.MoveRowsUndoEntry(e,t,r,n,s))}moveColumns(e,t,r,n){this.ensureItIsPossibleToMoveColumns(e,t,r,n),this.undoRedo.clearRedoStack();const s=this.operations.moveColumns(e,t,r,n);this.undoRedo.saveOperation(new c.MoveColumnsUndoEntry(e,t,r,n,s))}cut(e,t,r){this.clipboardOperations.cut(e,t,r)}ensureItIsPossibleToCopy(e,t,r){if(!p(t))throw new i.InvalidArgumentsError("width to be positive integer.");if(!p(r))throw new i.InvalidArgumentsError("height to be positive integer.")}copy(e,t,r){this.ensureItIsPossibleToCopy(e,t,r),this.clipboardOperations.copy(e,t,r)}paste(e){const t=this.clipboardOperations.clipboard;if(void 0===t)throw new i.NothingToPasteError;if(this.clipboardOperations.isCutClipboard())this.moveCells(t.sourceLeftCorner,t.width,t.height,e);else if(this.clipboardOperations.isCopyClipboard()){this.clipboardOperations.ensureItIsPossibleToCopyPaste(e);const r=n.AbsoluteCellRange.spanFrom(e,t.width,t.height),s=this.operations.getRangeClipboardCells(r);this.undoRedo.clearRedoStack();const o=this.operations.restoreClipboardCells(t.sourceLeftCorner.sheet,t.getContent(e));this.undoRedo.saveOperation(new c.PasteUndoEntry(e,s,t.content,o))}}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();const t=this.operations.addSheet(e);return this.undoRedo.saveOperation(new c.AddSheetUndoEntry(t)),t}removeSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const t=this.sheetMapping.fetchDisplayName(e),r=this.operations.getSheetClipboardCells(e),{version:n,scopedNamedExpressions:s}=this.operations.removeSheet(e);this.undoRedo.saveOperation(new c.RemoveSheetUndoEntry(t,e,r,s,n))}renameSheet(e,t){this.ensureItIsPossibleToRenameSheet(e,t);const r=this.operations.renameSheet(e,t);return void 0!==r&&(this.undoRedo.clearRedoStack(),this.undoRedo.saveOperation(new c.RenameSheetUndoEntry(e,r,t))),r}clearSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const t=this.operations.getSheetClipboardCells(e);this.operations.clearSheet(e),this.undoRedo.saveOperation(new c.ClearSheetUndoEntry(e,t))}setCellContents(e,t){if(t instanceof Array){for(let e=0;e<t.length;e++)if(!(t[e]instanceof Array))throw new i.InvalidArgumentsError("an array of arrays or a raw cell value.")}else t=[[t]];this.ensureItIsPossibleToChangeCellContents(e,t),this.undoRedo.clearRedoStack();const r=[];for(let n=0;n<t.length;n++)for(let s=0;s<t[n].length;s++){const o={sheet:e.sheet,row:e.row+n,col:e.col+s},i=t[n][s];this.clipboardOperations.abortCut();const a=this.operations.setCellContent(o,i);r.push({address:o,newContent:i,oldContent:a})}this.undoRedo.saveOperation(new c.SetCellContentsUndoEntry(r))}setSheetContent(e,t){this.ensureScopeIdIsValid(e),this.ensureItIsPossibleToChangeSheetContents(e,t),(0,u.validateAsSheet)(t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.getSheetClipboardCells(e);this.operations.setSheetContent(e,t),this.undoRedo.saveOperation(new c.SetSheetContentUndoEntry(e,r,t))}setRowOrder(e,t){this.validateSwapRowIndexes(e,t),this.testRowOrderForArrays(e,t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.setRowOrder(e,t);this.undoRedo.saveOperation(new c.SetRowOrderUndoEntry(e,t,r))}validateSwapRowIndexes(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);this.validateRowOrColumnMapping(e,t,"row")}testColumnOrderForArrays(e,t){for(const[r,s]of t)if(r!==s){const t=n.AbsoluteCellRange.spanFrom({sheet:e,col:r,row:0},1,1/0);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new i.SourceLocationHasArrayError}}setColumnOrder(e,t){this.validateSwapColumnIndexes(e,t),this.testColumnOrderForArrays(e,t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.setColumnOrder(e,t);this.undoRedo.saveOperation(new c.SetColumnOrderUndoEntry(e,t,r))}validateSwapColumnIndexes(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);this.validateRowOrColumnMapping(e,t,"column")}testRowOrderForArrays(e,t){for(const[r,s]of t)if(r!==s){const t=n.AbsoluteCellRange.spanFrom({sheet:e,col:0,row:r},1/0,1);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new i.SourceLocationHasArrayError}}mappingFromOrder(e,t,r){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);const n="row"===r?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e);if(t.length!==n)throw new i.InvalidArgumentsError(`number of ${r}s provided to be sheet ${"row"===r?"height":"width"}.`);const s=[];for(let e=0;e<n;e++)t[e]!==e&&s.push([e,t[e]]);return s}undo(){if(this.undoRedo.isUndoStackEmpty())throw new i.NoOperationToUndoError;this.clipboardOperations.abortCut(),this.undoRedo.undo()}redo(){if(this.undoRedo.isRedoStackEmpty())throw new i.NoOperationToRedoError;this.clipboardOperations.abortCut(),this.undoRedo.redo()}addNamedExpression(e,t,r,n){this.ensureItIsPossibleToAddNamedExpression(e,t,r),this.operations.addNamedExpression(e,t,r,n),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new c.AddNamedExpressionUndoEntry(e,t,r,n))}changeNamedExpressionExpression(e,t,r,n){this.ensureItIsPossibleToChangeNamedExpression(e,r,t);const[s,o]=this.operations.changeNamedExpressionExpression(e,r,t,n);this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new c.ChangeNamedExpressionUndoEntry(s,r,o,t,n))}removeNamedExpression(e,t){this.ensureScopeIdIsValid(t);const[r,n]=this.operations.removeNamedExpression(e,t);return this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new c.RemoveNamedExpressionUndoEntry(r,n,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 i.NamedExpressionDoesNotExistError(e);this.ensureNamedExpressionIsValid(t)}isItPossibleToRemoveNamedExpression(e,t){if(this.ensureScopeIdIsValid(t),void 0===this.namedExpressions.namedExpressionForScope(e,t))throw new i.NamedExpressionDoesNotExistError(e)}ensureItIsPossibleToAddRows(e,...t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);if(this.dependencyGraph.getSheetHeight(e)+t.map((e=>e[1])).reduce(((e,t)=>e+t),0)>this.maxRows)throw new i.SheetSizeLimitExceededError;for(const[e,r]of t)if(!g(e)||!p(r))throw new i.InvalidArgumentsError("row number to be nonnegative and number of rows to add to be positive.")}ensureItIsPossibleToRemoveRows(e,...t){for(const[r,n]of t){const t=r+n-1;if(!g(r)||!g(t))throw new i.InvalidArgumentsError("starting and ending row to be nonnegative.");if(t<r)throw new i.InvalidArgumentsError("starting row to be smaller than the ending row.");if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e)}}ensureItIsPossibleToAddColumns(e,...t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);if(this.dependencyGraph.getSheetWidth(e)+t.map((e=>e[1])).reduce(((e,t)=>e+t),0)>this.maxColumns)throw new i.SheetSizeLimitExceededError;for(const[e,r]of t)if(!g(e)||!p(r))throw new i.InvalidArgumentsError("column number to be nonnegative and number of columns to add to be positive.")}ensureItIsPossibleToRemoveColumns(e,...t){for(const[r,n]of t){const t=r+n-1;if(!g(r)||!g(t))throw new i.InvalidArgumentsError("starting and ending column to be nonnegative.");if(t<r)throw new i.InvalidArgumentsError("starting column to be smaller than the ending column.");if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e)}}ensureItIsPossibleToMoveRows(e,t,r,o){this.ensureItIsPossibleToAddRows(e,[o,r]);const a=(0,s.simpleCellAddress)(e,0,t),l=(0,s.simpleCellAddress)(e,0,o);if(!this.sheetMapping.hasSheetWithId(e)||(0,s.invalidSimpleCellAddress)(a)||(0,s.invalidSimpleCellAddress)(l)||!p(r)||o<=t+r&&o>=t)throw new i.InvalidArgumentsError("a valid range of rows to move.");const u=this.dependencyGraph.getSheetWidth(e),c=n.AbsoluteCellRange.spanFrom(a,u,r);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(c))throw new i.SourceLocationHasArrayError;if(o>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllRows(h.RowsSpan.fromNumberOfRows(e,o-1,2)))throw new i.TargetLocationHasArrayError}ensureItIsPossibleToMoveColumns(e,t,r,o){this.ensureItIsPossibleToAddColumns(e,[o,r]);const a=(0,s.simpleCellAddress)(e,t,0),l=(0,s.simpleCellAddress)(e,o,0);if(!this.sheetMapping.hasSheetWithId(e)||(0,s.invalidSimpleCellAddress)(a)||(0,s.invalidSimpleCellAddress)(l)||!p(r)||o<=t+r&&o>=t)throw new i.InvalidArgumentsError("a valid range of columns to move.");const u=this.dependencyGraph.getSheetHeight(e),c=n.AbsoluteCellRange.spanFrom(a,r,u);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(c))throw new i.SourceLocationHasArrayError;if(o>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllColumns(h.ColumnsSpan.fromNumberOfColumns(e,o-1,2)))throw new i.TargetLocationHasArrayError}ensureItIsPossibleToAddSheet(e){if(this.sheetMapping.hasSheetWithName(e))throw new i.SheetNameAlreadyTakenError(e)}ensureItIsPossibleToRenameSheet(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new i.NoSheetWithIdError(e);const r=this.sheetMapping.get(t);if(void 0!==r&&r!==e)throw new i.SheetNameAlreadyTakenError(t)}ensureItIsPossibleToChangeContent(e){if((0,s.invalidSimpleCellAddress)(e))throw new i.InvalidAddressError(e);if(!this.sheetMapping.hasSheetWithId(e.sheet))throw new i.NoSheetWithIdError(e.sheet)}ensureItIsPossibleToChangeCellContents(e,t){const r=(0,u.findBoundaries)(t),s=n.AbsoluteCellRange.spanFrom(e,r.width,r.height);this.ensureRangeInSizeLimits(s);for(const e of s.addresses(this.dependencyGraph))this.ensureItIsPossibleToChangeContent(e)}ensureItIsPossibleToChangeSheetContents(e,t){const r=(0,u.findBoundaries)(t),o=n.AbsoluteCellRange.spanFrom((0,s.simpleCellAddress)(e,0,0),r.width,r.height);this.ensureRangeInSizeLimits(o)}ensureRangeInSizeLimits(e){if(e.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new i.SheetSizeLimitExceededError}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 i.NoSheetWithIdError(e)}validateRowOrColumnMapping(e,t,r){const n="row"===r?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e),s=t.map((([e,t])=>e)).sort(((e,t)=>e-t)),o=t.map((([e,t])=>t)).sort(((e,t)=>e-t));for(let e=0;e<s.length;e++){if(!g(s[e])||s[e]>=n)throw new i.InvalidArgumentsError(`${r} numbers to be nonnegative integers and less than sheet ${"row"===r?"height":"width"}.`);if(s[e]===s[e+1])throw new i.InvalidArgumentsError(`source ${r} numbers to be unique.`);if(s[e]!==o[e])throw new i.InvalidArgumentsError(`target ${r} numbers to be permutation of source ${r} numbers.`)}}ensureNamedExpressionNameIsValid(e,t){if(!this.namedExpressions.isNameValid(e))throw new i.NamedExpressionNameIsInvalidError(e);if(!this.namedExpressions.isNameAvailable(e,t))throw new i.NamedExpressionNameIsAlreadyTakenError(e)}ensureNamedExpressionIsValid(e){const t=this.cellContentParser.parse(e);if(t instanceof o.CellContent.Formula){const e=this.parser.parse(t.formula,(0,s.simpleCellAddress)(-1,0,0));if((0,a.doesContainRelativeReferences)(e.ast))throw new i.NoRelativeAddressesAllowedError}}}function p(e){return Number.isInteger(e)&&e>0}function g(e){return Number.isInteger(e)&&e>=0}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{InternalNamedExpression:()=>i,NamedExpressions:()=>u,doesContainRelativeReferences:()=>h});var n=r(3),s=r(7),o=r(12);class i{constructor(e,t,r,n){this.displayName=e,this.address=t,this.added=r,this.options=n}normalizeExpressionName(){return this.displayName.toLowerCase()}copy(){return new i(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){const 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){const t=this.mapping.get(this.normalizeExpressionName(e));return t&&t.added?t:void 0}remove(e){const 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){const t=this.normalizeExpressionName(e);return!this.mapping.has(t)}remove(e){const t=this.normalizeExpressionName(e);this.mapping.get(t)&&this.mapping.delete(t)}normalizeExpressionName(e){return e.toLowerCase()}}class u{constructor(){this.nextNamedExpressionRow=0,this.workbookStore=new a,this.worksheetStores=new Map,this.addressCache=new Map}isNameAvailable(e,t){var r,n;return void 0===t?this.workbookStore.isNameAvailable(e):null===(n=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.isNameAvailable(e))||void 0===n||n}namedExpressionInAddress(e){const 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,n;return null!==(n=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.get(e))&&void 0!==n?n:this.workbookStore.getExisting(e)}isExpressionInScope(e,t){var r,n;return null!==(n=null===(r=this.worksheetStore(t))||void 0===r?void 0:r.has(e))&&void 0!==n&&n}isNameValid(e){const t=new RegExp(`^${o.CELL_REFERENCE_PATTERN}$`),r=new RegExp(`^${o.R1C1_CELL_REFERENCE_PATTERN}$`),n=new RegExp(`^${o.NAMED_EXPRESSION_PATTERN}$`);return!t.test(e)&&!r.test(e)&&n.test(e)}addNamedExpression(e,t,r){const n=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);let s=n.get(e);return void 0!==s?(s.added=!0,s.displayName=e,s.options=r):(s=new i(e,this.nextAddress(),!0,r),n.add(s)),this.addressCache.set(s.address.row,s),s}restoreNamedExpression(e,t){const 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 i(e,this.nextAddress(),!1),this.workbookStore.add(t)),t}remove(e,t){let r;r=void 0===t?this.workbookStore:this.worksheetStore(t);const n=null==r?void 0:r.get(e);if(void 0===r||void 0===n||!n.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(n.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(){const 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)}nextAddress(){return(0,n.simpleCellAddress)(u.SHEET_FOR_WORKBOOK_EXPRESSIONS,0,this.nextNamedExpressionRow++)}}u.SHEET_FOR_WORKBOOK_EXPRESSIONS=-1;const h=e=>{switch(e.type){case s.AstNodeType.EMPTY:case s.AstNodeType.NUMBER:case s.AstNodeType.STRING:case s.AstNodeType.ERROR:case s.AstNodeType.ERROR_WITH_RAW_INPUT:return!1;case s.AstNodeType.CELL_REFERENCE:return!e.reference.isAbsolute();case s.AstNodeType.CELL_RANGE:case s.AstNodeType.COLUMN_RANGE:case s.AstNodeType.ROW_RANGE:return!e.start.isAbsolute();case s.AstNodeType.NAMED_EXPRESSION:return!1;case s.AstNodeType.PERCENT_OP:case s.AstNodeType.PLUS_UNARY_OP:case s.AstNodeType.MINUS_UNARY_OP:return h(e.value);case s.AstNodeType.CONCATENATE_OP:case s.AstNodeType.EQUALS_OP:case s.AstNodeType.NOT_EQUAL_OP:case s.AstNodeType.LESS_THAN_OP:case s.AstNodeType.GREATER_THAN_OP:case s.AstNodeType.LESS_THAN_OR_EQUAL_OP:case s.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case s.AstNodeType.MINUS_OP:case s.AstNodeType.PLUS_OP:case s.AstNodeType.TIMES_OP:case s.AstNodeType.DIV_OP:case s.AstNodeType.POWER_OP:return h(e.left)||h(e.right);case s.AstNodeType.PARENTHESIS:return h(e.expression);case s.AstNodeType.FUNCTION_CALL:return e.args.some((e=>h(e)));case s.AstNodeType.ARRAY:return e.args.some((e=>e.some((e=>h(e)))))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddColumnsCommand:()=>M,AddRowsCommand:()=>O,Operations:()=>I,RemoveColumnsCommand:()=>b,RemoveRowsCommand:()=>N,normalizeAddedIndexes:()=>x,normalizeRemovedIndexes:()=>_});var n=r(2),s=r(6),o=r(1),i=r(3),a=r(110),l=r(111),u=r(68),h=r(4),c=r(80),d=r(115),p=r(117),g=r(118),m=r(119),f=r(120),y=r(121),E=r(122),C=r(77),T=r(70),R=r(113),w=r(7),S=r(123),v=r(71),A=r(72);class N{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return _(this.indexes)}rowsSpans(){return this.normalizedIndexes().map((e=>v.RowsSpan.fromNumberOfRows(this.sheet,e[0],e[1])))}}class O{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return x(this.indexes)}rowsSpans(){return this.normalizedIndexes().map((e=>v.RowsSpan.fromNumberOfRows(this.sheet,e[0],e[1])))}}class M{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return x(this.indexes)}columnsSpans(){return this.normalizedIndexes().map((e=>v.ColumnsSpan.fromNumberOfColumns(this.sheet,e[0],e[1])))}}class b{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return _(this.indexes)}columnsSpans(){return this.normalizedIndexes().map((e=>v.ColumnsSpan.fromNumberOfColumns(this.sheet,e[0],e[1])))}}class I{constructor(e,t,r,n,s,o,i,a,l){this.dependencyGraph=t,this.columnSearch=r,this.cellContentParser=n,this.parser=s,this.stats=o,this.lazilyTransformingAstService=i,this.namedExpressions=a,this.arraySizePredictor=l,this.changes=u.ContentChanges.empty(),this.allocateNamedExpressionAddressSpace(),this.maxColumns=e.maxColumns,this.maxRows=e.maxRows}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}removeRows(e){const t=[];for(const r of e.rowsSpans()){const e=this.doRemoveRows(r);e&&t.push(e)}return t}addRows(e){for(const t of e.rowsSpans())this.doAddRows(t)}addColumns(e){for(const t of e.columnsSpans())this.doAddColumns(t)}removeColumns(e){const t=[];for(const r of e.columnsSpans()){const e=this.doRemoveColumns(r);e&&t.push(e)}return t}removeSheet(e){let t;this.dependencyGraph.removeSheet(e),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const r=new E.RemoveSheetTransformer(e);r.performEagerTransformations(this.dependencyGraph,this.parser),t=this.lazilyTransformingAstService.addTransformation(r)})),this.sheetMapping.removeSheet(e),this.columnSearch.removeSheet(e);const r=this.namedExpressions.getAllNamedExpressionsForScope(e).map((t=>this.removeNamedExpression(t.normalizeExpressionName(),e)));return{version:t,scopedNamedExpressions:r}}removeSheetByName(e){const t=this.sheetMapping.fetch(e);return this.removeSheet(t)}clearSheet(e){this.dependencyGraph.clearSheet(e),this.columnSearch.removeSheet(e)}addSheet(e){const t=this.sheetMapping.addSheet(e),r=[];return this.dependencyGraph.addressMapping.autoAddSheet(t,r,(0,S.findBoundaries)(r)),this.sheetMapping.fetchDisplayName(t)}renameSheet(e,t){return this.sheetMapping.renameSheet(e,t)}moveRows(e,t,r,n){const s=v.RowsSpan.fromNumberOfRows(e,n,r);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddRows(s),n<t&&(t+=r);const o=(0,i.simpleCellAddress)(e,0,t),a=(0,i.simpleCellAddress)(e,0,n);this.moveCells(o,Number.POSITIVE_INFINITY,r,a);const l=v.RowsSpan.fromNumberOfRows(e,t,r);return this.doRemoveRows(l),this.lazilyTransformingAstService.commitCombinedMode()}moveColumns(e,t,r,n){const s=v.ColumnsSpan.fromNumberOfColumns(e,n,r);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddColumns(s),n<t&&(t+=r);const o=(0,i.simpleCellAddress)(e,t,0),a=(0,i.simpleCellAddress)(e,n,0);this.moveCells(o,r,Number.POSITIVE_INFINITY,a);const l=v.ColumnsSpan.fromNumberOfColumns(e,t,r);return this.doRemoveColumns(l),this.lazilyTransformingAstService.commitCombinedMode()}moveCells(e,t,r,s){this.ensureItIsPossibleToMoveCells(e,t,r,s);const o=n.AbsoluteCellRange.spanFrom(e,t,r),i=n.AbsoluteCellRange.spanFrom(s,t,r),a=s.col-e.col,l=s.row-e.row,u=s.sheet,h=this.getRangeClipboardCells(i),c=this.dependencyGraph.rawValuesFromRange(i);this.columnSearch.removeValues(c);const d=this.dependencyGraph.rawValuesFromRange(o);let p;this.columnSearch.moveValues(d,a,l,u),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const e=new m.MoveCellsTransformer(o,a,l,u);e.performEagerTransformations(this.dependencyGraph,this.parser),p=this.lazilyTransformingAstService.addTransformation(e)})),this.dependencyGraph.moveCells(o,a,l,u);const g=this.updateNamedExpressionsForMovedCells(e,t,r,s);return{version:p,overwrittenCellsData:h,addedGlobalNamedExpressions:g}}setRowOrder(e,t){const r=[];let s=[];for(const[o,i]of t)if(o!==i){const t=n.AbsoluteCellRange.spanFrom({sheet:e,col:0,row:o},1/0,1),a=this.getRangeClipboardCells(t);s=s.concat(a),r.push(a.map((([{sheet:e,col:t},r])=>[{sheet:e,col:t,row:i},r])))}return r.forEach((t=>this.restoreClipboardCells(e,t.values()))),s}setColumnOrder(e,t){const r=[];let s=[];for(const[o,i]of t)if(o!==i){const t=n.AbsoluteCellRange.spanFrom({sheet:e,col:o,row:0},1,1/0),a=this.getRangeClipboardCells(t);s=s.concat(a),r.push(a.map((([{sheet:e,col:t,row:r},n])=>[{sheet:e,col:i,row:r},n])))}return r.forEach((t=>this.restoreClipboardCells(e,t.values()))),s}addNamedExpression(e,t,r,n){const s=this.namedExpressions.addNamedExpression(e,r,n);this.storeNamedExpressionInCell(s.address,t),this.adjustNamedExpressionEdges(s,e,r)}restoreNamedExpression(e,t,r){const n=e.displayName;this.restoreCell(e.address,t);const s=this.namedExpressions.restoreNamedExpression(e,r);this.adjustNamedExpressionEdges(s,n,r)}changeNamedExpressionExpression(e,t,r,n){const s=this.namedExpressions.namedExpressionForScope(e,r);if(!s)throw new C.NamedExpressionDoesNotExistError(e);const o=s.copy();s.options=n;const i=this.getClipboardCell(s.address);return this.storeNamedExpressionInCell(s.address,t),[o,i]}removeNamedExpression(e,t){const r=this.namedExpressions.namedExpressionForScope(e,t);if(!r)throw new C.NamedExpressionDoesNotExistError(e);this.namedExpressions.remove(r.displayName,t);const n=this.getClipboardCell(r.address);if(void 0!==t){const t=this.namedExpressions.workbookNamedExpressionOrPlaceholder(e);this.dependencyGraph.exchangeNode(r.address,t.address)}else this.dependencyGraph.setCellEmpty(r.address);return[r,n]}ensureItIsPossibleToMoveCells(e,t,r,s){if((0,i.invalidSimpleCellAddress)(e)||!(P(t)&&P(r)||function(e,t,r){return 0===e.row&&P(t)&&r===Number.POSITIVE_INFINITY||0===e.col&&P(r)&&t===Number.POSITIVE_INFINITY}(e,t,r))||(0,i.invalidSimpleCellAddress)(s)||!this.sheetMapping.hasSheetWithId(e.sheet)||!this.sheetMapping.hasSheetWithId(s.sheet))throw new C.InvalidArgumentsError("a valid range of cells to move.");const o=n.AbsoluteCellRange.spanFrom(e,t,r),a=n.AbsoluteCellRange.spanFrom(s,t,r);if(a.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new C.SheetSizeLimitExceededError;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(o))throw new C.SourceLocationHasArrayError;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new C.TargetLocationHasArrayError}restoreClipboardCells(e,t){const r=[];for(const[n,s]of t)if(this.restoreCell(n,s),s.type===l.ClipboardCellType.FORMULA){const{dependencies:t}=this.parser.fetchCachedResult(s.hash);r.push(...this.updateNamedExpressionsForTargetAddress(e,n,t))}return r}restoreCell(e,t){switch(t.type){case l.ClipboardCellType.VALUE:this.setValueToCell(t,e);break;case l.ClipboardCellType.FORMULA:this.setFormulaToCellFromCache(t.hash,e);break;case l.ClipboardCellType.EMPTY:this.setCellEmpty(e);break;case l.ClipboardCellType.PARSING_ERROR:this.setParsingErrorToCell(t.rawInput,t.errors,e)}}getOldContent(e){const t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof h.EmptyCellVertex)return[e,{type:l.ClipboardCellType.EMPTY}];if(t instanceof h.ValueCellVertex)return[e,Object.assign({type:l.ClipboardCellType.VALUE},t.getValues())];if(t instanceof c.FormulaVertex)return[t.getAddress(this.lazilyTransformingAstService),{type:l.ClipboardCellType.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))}];if(t instanceof h.ParsingErrorVertex)return[e,{type:l.ClipboardCellType.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors}];throw Error("Trying to copy unsupported type")}getClipboardCell(e){const t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof h.EmptyCellVertex)return{type:l.ClipboardCellType.EMPTY};if(t instanceof h.ValueCellVertex)return Object.assign({type:l.ClipboardCellType.VALUE},t.getValues());if(t instanceof h.ArrayVertex){const r=t.getArrayCellValue(e);return r===T.EmptyValue?{type:l.ClipboardCellType.EMPTY}:{type:l.ClipboardCellType.VALUE,parsedValue:r,rawValue:t.getArrayCellRawValue(e)}}if(t instanceof h.FormulaCellVertex)return{type:l.ClipboardCellType.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))};if(t instanceof h.ParsingErrorVertex)return{type:l.ClipboardCellType.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors};throw Error("Trying to copy unsupported type")}getSheetClipboardCells(e){const t=this.dependencyGraph.getSheetHeight(e),r=this.dependencyGraph.getSheetWidth(e),n=new Array(t);for(let s=0;s<t;s++){n[s]=new Array(r);for(let t=0;t<r;t++){const r=(0,i.simpleCellAddress)(e,t,s);n[s][t]=this.getClipboardCell(r)}}return n}getRangeClipboardCells(e){const t=[];for(const r of e.addresses(this.dependencyGraph))t.push([r,this.getClipboardCell(r)]);return t}setCellContent(e,t){const r=this.cellContentParser.parse(t),n=this.getOldContent(e);if(r instanceof a.CellContent.Formula){const t=this.parser.parse(r.formula,e),{ast:n,errors:s}=t;if(s.length>0)this.setParsingErrorToCell(r.formula,s,e);else{const r=this.arraySizePredictor.checkArraySize(n,e);this.setFormulaToCell(e,r,t)}}else r instanceof a.CellContent.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:r.value,rawValue:t},e);return n}setSheetContent(e,t){this.clearSheet(e);for(let r=0;r<t.length;r++)for(let n=0;n<t[r].length;n++){const s=(0,i.simpleCellAddress)(e,n,r);this.setCellContent(s,t[r][n])}}setParsingErrorToCell(e,t,r){const n=this.dependencyGraph.getCellValue(r),s=new h.ParsingErrorVertex(t,e),o=this.dependencyGraph.setParsingErrorToCell(r,s);this.columnSearch.remove((0,T.getRawValue)(n),r),this.columnSearch.applyChanges(o.getChanges()),this.changes.addAll(o),this.changes.addChange(s.getCellValue(),r)}setFormulaToCell(e,t,{ast:r,hasVolatileFunction:n,hasStructuralChangeFunction:o,dependencies:i}){const a=this.dependencyGraph.getCellValue(e),l=this.dependencyGraph.setFormulaToCell(e,r,(0,s.absolutizeDependencies)(i,e),t,n,o);this.columnSearch.remove((0,T.getRawValue)(a),e),this.columnSearch.applyChanges(l.getChanges()),this.changes.addAll(l)}setValueToCell(e,t){const r=this.dependencyGraph.getCellValue(t),n=this.dependencyGraph.setValueToCell(t,e);this.columnSearch.change((0,T.getRawValue)(r),(0,T.getRawValue)(e.parsedValue),t),this.columnSearch.applyChanges(n.getChanges().filter((e=>!(0,i.equalSimpleCellAddress)(e.address,t)))),this.changes.addAll(n),this.changes.addChange(e.parsedValue,t)}setCellEmpty(e){if(this.dependencyGraph.isArrayInternalCell(e))return;const t=this.dependencyGraph.getCellValue(e),r=this.dependencyGraph.setCellEmpty(e);this.columnSearch.remove((0,T.getRawValue)(t),e),this.columnSearch.applyChanges(r.getChanges()),this.changes.addAll(r),this.changes.addChange(T.EmptyValue,e)}setFormulaToCellFromCache(e,t){const{ast:r,hasVolatileFunction:n,hasStructuralChangeFunction:o,dependencies:i}=this.parser.fetchCachedResult(e),a=(0,s.absolutizeDependencies)(i,t),[l]=new g.CleanOutOfScopeDependenciesTransformer(t.sheet).transformSingleAst(r,t);this.parser.rememberNewAst(l);const u=(0,s.filterDependenciesOutOfScope)(a),h=this.arraySizePredictor.checkArraySize(r,t);this.dependencyGraph.setFormulaToCell(t,l,u,h,n,o)}rowEffectivelyNotInSheet(e,t){return e>=this.dependencyGraph.addressMapping.getHeight(t)}getAndClearContentChanges(){const e=this.changes;return this.changes=u.ContentChanges.empty(),e}forceApplyPostponedTransformations(){this.dependencyGraph.forceApplyPostponedTransformations()}doRemoveRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;const t=[];for(const[r]of this.dependencyGraph.entriesFromRowsSpan(e))t.push({address:r,cellType:this.getClipboardCell(r)});const{affectedArrays:r,contentChanges:n}=this.dependencyGraph.removeRows(e);let s;return this.columnSearch.applyChanges(n.getChanges()),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const t=new y.RemoveRowsTransformer(e);t.performEagerTransformations(this.dependencyGraph,this.parser),s=this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(r),{version:s,removedCells:t,rowFrom:e.rowStart,rowCount:e.numberOfRows}}doRemoveColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;const t=[];for(const[r]of this.dependencyGraph.entriesFromColumnsSpan(e))t.push({address:r,cellType:this.getClipboardCell(r)});const{affectedArrays:r,contentChanges:n}=this.dependencyGraph.removeColumns(e);let s;return this.columnSearch.applyChanges(n.getChanges()),this.columnSearch.removeColumns(e),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const t=new f.RemoveColumnsTransformer(e);t.performEagerTransformations(this.dependencyGraph,this.parser),s=this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(r),{version:s,removedCells:t,columnFrom:e.columnStart,columnCount:e.numberOfColumns}}doAddRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;const{affectedArrays:t}=this.dependencyGraph.addRows(e);this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const t=new p.AddRowsTransformer(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(t)}rewriteAffectedArrays(e){for(const t of e.values()){if(t.array.size.isRef)continue;const e=t.getFormula(this.lazilyTransformingAstService),r=t.getAddress(this.lazilyTransformingAstService),n=this.parser.computeHashFromAst(e);this.setFormulaToCellFromCache(n,r)}}doAddColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;const{affectedArrays:t,contentChanges:r}=this.dependencyGraph.addColumns(e);this.columnSearch.addColumns(e),this.columnSearch.applyChanges(r.getChanges()),this.stats.measure(A.StatType.TRANSFORM_ASTS,(()=>{const t=new d.AddColumnsTransformer(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(t)}columnEffectivelyNotInSheet(e,t){return e>=this.dependencyGraph.addressMapping.getWidth(t)}adjustNamedExpressionEdges(e,t,r){if(void 0===r)return;const n=this.dependencyGraph.fetchCellOrCreateEmpty(e.address),o=this.namedExpressions.workbookNamedExpressionOrPlaceholder(t),i=this.dependencyGraph.fetchCellOrCreateEmpty(o.address);for(const t of this.dependencyGraph.graph.adjacentNodes(i))if(t instanceof h.FormulaCellVertex&&t.getAddress(this.lazilyTransformingAstService).sheet===r){const r=t.getFormula(this.lazilyTransformingAstService),o=t.getAddress(this.lazilyTransformingAstService),{dependencies:a}=this.parser.fetchCachedResultForAst(r);for(const r of(0,s.absolutizeDependencies)(a,o))r instanceof w.NamedExpressionDependency&&r.name.toLowerCase()===e.displayName.toLowerCase()&&(this.dependencyGraph.graph.removeEdge(i,t),this.dependencyGraph.graph.addEdge(n,t))}}storeNamedExpressionInCell(e,t){const r=this.cellContentParser.parse(t);if(r instanceof a.CellContent.Formula){const t=this.parser.parse(r.formula,(0,i.simpleCellAddress)(-1,0,0));if((0,R.doesContainRelativeReferences)(t.ast))throw new C.NoRelativeAddressesAllowedError;const{ast:n,hasVolatileFunction:a,hasStructuralChangeFunction:l,dependencies:u}=t;this.dependencyGraph.setFormulaToCell(e,n,(0,s.absolutizeDependencies)(u,e),o.ArraySize.scalar(),a,l)}else r instanceof a.CellContent.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:r.value,rawValue:t},e)}updateNamedExpressionsForMovedCells(e,t,r,s){if(e.sheet===s.sheet)return[];const o=[],i=n.AbsoluteCellRange.spanFrom(s,t,r);for(const t of i.addresses(this.dependencyGraph)){const r=this.addressMapping.fetchCell(t);if(r instanceof h.FormulaCellVertex&&t.sheet!==e.sheet){const n=r.getFormula(this.lazilyTransformingAstService),{dependencies:s}=this.parser.fetchCachedResultForAst(n);o.push(...this.updateNamedExpressionsForTargetAddress(e.sheet,t,s))}}return o}updateNamedExpressionsForTargetAddress(e,t,r){if(e===t.sheet)return[];const n=[],o=this.addressMapping.fetchCell(t);for(const i of(0,s.absolutizeDependencies)(r,t)){if(!(i instanceof w.NamedExpressionDependency))continue;const r=i.name,s=this.dependencyGraph.fetchNamedExpressionVertex(r,e),a=this.namedExpressions.isExpressionInScope(r,t.sheet)?this.dependencyGraph.fetchNamedExpressionVertex(r,t.sheet):this.copyOrFetchGlobalNamedExpressionVertex(r,s,n);a!==s&&(this.dependencyGraph.graph.softRemoveEdge(s,o),this.dependencyGraph.graph.addEdge(a,o))}return n}allocateNamedExpressionAddressSpace(){this.dependencyGraph.addressMapping.addSheet(R.NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS,new h.SparseStrategy(0,0))}copyOrFetchGlobalNamedExpressionVertex(e,t,r){let n=this.namedExpressions.namedExpressionForScope(e);if(void 0===n)if(n=this.namedExpressions.addNamedExpression(e),r.push(n.normalizeExpressionName()),t instanceof h.FormulaCellVertex){const e=this.parser.fetchCachedResultForAst(t.getFormula(this.lazilyTransformingAstService)),{ast:r,hasVolatileFunction:i,hasStructuralChangeFunction:a,dependencies:l}=e;this.dependencyGraph.setFormulaToCell(n.address,r,(0,s.absolutizeDependencies)(l,n.address),o.ArraySize.scalar(),i,a)}else t instanceof h.EmptyCellVertex?this.setCellEmpty(n.address):t instanceof h.ValueCellVertex&&this.setValueToCell(t.getValues(),n.address);return this.dependencyGraph.fetchCellOrCreateEmpty(n.address)}}function _(e){if(e.length<=1)return e;const t=[...e].sort((([e],[t])=>e-t)),r=t.reduce(((e,[t,r])=>{const n=e[e.length-1],s=n[0]+n[1];return t<=s?n[1]+=Math.max(0,r-(s-t)):e.push([t,r]),e}),[t[0]]);let n=0;for(let e=0;e<r.length;++e)r[e][0]-=n,n+=r[e][1];return r}function x(e){if(e.length<=1)return e;const t=[...e].sort((([e],[t])=>e-t)),r=t.reduce(((e,[t,r])=>{const n=e[e.length-1];return t===n[0]?n[1]=Math.max(n[1],r):e.push([t,r]),e}),[t[0]]);let n=0;for(let e=0;e<r.length;++e)r[e][0]+=n,n+=r[e][1];return r}function P(e){return Number.isInteger(e)&&e>0}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddColumnsTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{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){const r=(0,n.absoluteSheetReference)(e,t);if(r!==this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return!1;const s=e.toSimpleColumnAddress(t);if(r===this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return this.columnsSpan.columnStart<=s.col&&e.shiftedByColumns(this.columnsSpan.numberOfColumns);if(t.sheet===this.columnsSpan.sheet&&r!==this.columnsSpan.sheet)return!e.isColumnAbsolute()&&(!(t.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(-this.columnsSpan.numberOfColumns));if(e.isColumnAbsolute())return!(e.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(this.columnsSpan.numberOfColumns);return 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){const s=this.transformCellAddress(e,r),o=this.transformCellAddress(t,r);return s===n.ErrorType.REF||o===n.ErrorType.REF?n.ErrorType.REF:!(!s&&!o)&&[s||e,o||t]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Transformer:()=>o});var n=r(3),s=r(7);class o{performEagerTransformations(e,t){for(const r of e.arrayFormulaNodes()){const[n,s]=this.transformSingleAst(r.getFormula(e.lazilyTransformingAstService),r.getAddress(e.lazilyTransformingAstService)),o=t.rememberNewAst(n);r.setFormula(o),r.setAddress(s)}}transformSingleAst(e,t){return[this.transformAst(e,t),this.fixNodeAddress(t)]}transformAst(e,t){switch(e.type){case s.AstNodeType.CELL_REFERENCE:return this.transformCellReferenceAst(e,t);case s.AstNodeType.CELL_RANGE:return this.transformCellRangeAst(e,t);case s.AstNodeType.COLUMN_RANGE:return this.transformColumnRangeAst(e,t);case s.AstNodeType.ROW_RANGE:return this.transformRowRangeAst(e,t);case s.AstNodeType.EMPTY:case s.AstNodeType.ERROR:case s.AstNodeType.NUMBER:case s.AstNodeType.NAMED_EXPRESSION:case s.AstNodeType.ERROR_WITH_RAW_INPUT:case s.AstNodeType.STRING:return e;case s.AstNodeType.PERCENT_OP:case s.AstNodeType.MINUS_UNARY_OP:case s.AstNodeType.PLUS_UNARY_OP:return Object.assign(Object.assign({},e),{value:this.transformAst(e.value,t)});case s.AstNodeType.FUNCTION_CALL:return Object.assign(Object.assign({},e),{procedureName:e.procedureName,args:e.args.map((e=>this.transformAst(e,t)))});case s.AstNodeType.PARENTHESIS:return Object.assign(Object.assign({},e),{expression:this.transformAst(e.expression,t)});case s.AstNodeType.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){const r=this.transformCellAddress(e.reference,t);return r instanceof s.CellAddress?Object.assign(Object.assign({},e),{reference:r}):r===n.ErrorType.REF?(0,s.buildCellErrorAst)(new n.CellError(n.ErrorType.REF)):e}transformCellRangeAst(e,t){const r=this.transformCellRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===n.ErrorType.REF?(0,s.buildCellErrorAst)(new n.CellError(n.ErrorType.REF)):e}transformColumnRangeAst(e,t){const r=this.transformColumnRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===n.ErrorType.REF?(0,s.buildCellErrorAst)(new n.CellError(n.ErrorType.REF)):e}transformRowRangeAst(e,t){const r=this.transformRowRange(e.start,e.end,t);return Array.isArray(r)?Object.assign(Object.assign({},e),{start:r[0],end:r[1]}):r===n.ErrorType.REF?(0,s.buildCellErrorAst)(new n.CellError(n.ErrorType.REF)):e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddRowsTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{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){const r=(0,n.absoluteSheetReference)(e,t);if(r!==this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet)return!1;const s=e.toSimpleRowAddress(t);return r===this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet?this.rowsSpan.rowStart<=s.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):s.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){const s=this.transformCellAddress(e,r),o=this.transformCellAddress(t,r);return s===n.ErrorType.REF||o===n.ErrorType.REF?n.ErrorType.REF:!(!s&&!o)&&[s||e,o||t]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CleanOutOfScopeDependenciesTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}fixNodeAddress(e){return e}transformCellAddress(e,t){return!!e.isInvalid(t)&&n.ErrorType.REF}transformCellRange(e,t,r){return!(!e.isInvalid(r)&&!t.isInvalid(r))&&n.ErrorType.REF}transformColumnRange(e,t,r){return!(!e.isInvalid(r)&&!t.isInvalid(r))&&n.ErrorType.REF}transformRowRange(e,t,r){return!(!e.isInvalid(r)&&!t.isInvalid(r))&&n.ErrorType.REF}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DependentFormulaTransformer:()=>l,MoveCellsTransformer:()=>a});var n=r(3),s=r(7),o=r(11),i=r(116);class a extends i.Transformer{constructor(e,t,r,n){super(),this.sourceRange=e,this.toRight=t,this.toBottom=r,this.toSheet=n,this.dependentFormulaTransformer=new l(e,t,r,n)}get sheet(){return this.sourceRange.sheet}isIrreversible(){return!0}transformSingleAst(e,t){if(this.sourceRange.addressInRange(t)){return[this.transformAst(e,t),this.fixNodeAddress(t)]}return this.dependentFormulaTransformer.transformSingleAst(e,t)}fixNodeAddress(e){return(0,n.simpleCellAddress)(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){const r=this.sourceRange;if(e instanceof s.CellAddress){const n=e.toSimpleCellAddress(t);if(r.addressInRange(n))return e.shiftAbsoluteDimensions(this.toRight,this.toBottom)}return e.shiftRelativeDimensions(-this.toRight,-this.toBottom)}transformRange(e,t,r){const n=this.sourceRange;if(e instanceof s.CellAddress&&t instanceof s.CellAddress){const s=e.toSimpleCellAddress(r),o=t.toSimpleCellAddress(r);if(n.addressInRange(s)&&n.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)]}}class l extends i.Transformer{constructor(e,t,r,n){super(),this.sourceRange=e,this.toRight=t,this.toBottom=r,this.toSheet=n}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 s.CellAddress?this.sourceRange.addressInRange(e.toSimpleCellAddress(t)):e instanceof o.RowAddress?this.sourceRange.rowInRange(e.toSimpleRowAddress(t))&&!this.sourceRange.isFinite():this.sourceRange.columnInRange(e.toSimpleColumnAddress(t))&&!this.sourceRange.isFinite()}transformRange(e,t,r){const n=this.transformCellAddress(e,r),s=this.transformCellAddress(t,r);return!(!n||!s)&&[n,s]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RemoveColumnsTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{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){const r=(0,n.absoluteSheetReference)(e,t);if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet!==r)return!1;if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet===r){const 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())return!1;if(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{const 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 n.ErrorType.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){const s=(0,n.absoluteSheetReference)(e,r);let o=e,i=t;if(this.columnsSpan.sheet===s){const s=e.toSimpleColumnAddress(r),a=t.toSimpleColumnAddress(r);if(this.columnsSpan.columnStart<=s.col&&this.columnsSpan.columnEnd>=a.col)return n.ErrorType.REF;s.col>=this.columnsSpan.columnStart&&s.col<=this.columnsSpan.columnEnd&&(o=e.shiftedByColumns(this.columnsSpan.columnEnd-s.col+1)),a.col>=this.columnsSpan.columnStart&&a.col<=this.columnsSpan.columnEnd&&(i=t.shiftedByColumns(-(a.col-this.columnsSpan.columnStart+1)))}const a=this.transformCellAddress(o,r),l=this.transformCellAddress(i,r);if(!1===a&&!1===l)return[o,i];if(a===n.ErrorType.REF||l===n.ErrorType.REF)throw Error("Cannot happen");return[a||o,l||i]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RemoveRowsTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!0}transformColumnRangeAst(e,t){return e}transformCellAddress(e,t){const r=(0,n.absoluteSheetReference)(e,t);if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet!==r)return!1;if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet===r){const 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())return!1;if(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{const 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 n.ErrorType.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){const s=(0,n.absoluteSheetReference)(e,r);let o=e,i=t;if(this.rowsSpan.sheet===s){const s=e.toSimpleRowAddress(r),a=t.toSimpleRowAddress(r);if(this.rowsSpan.rowStart<=s.row&&this.rowsSpan.rowEnd>=a.row)return n.ErrorType.REF;s.row>=this.rowsSpan.rowStart&&s.row<=this.rowsSpan.rowEnd&&(o=e.shiftedByRows(this.rowsSpan.rowEnd-s.row+1)),a.row>=this.rowsSpan.rowStart&&a.row<=this.rowsSpan.rowEnd&&(i=t.shiftedByRows(-(a.row-this.rowsSpan.rowStart+1)))}const a=this.transformCellAddress(o,r),l=this.transformCellAddress(i,r);return!1===a&&!1===l?[o,i]:a===n.ErrorType.REF||l===n.ErrorType.REF?n.ErrorType.REF:[a||o,l||i]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RemoveSheetTransformer:()=>o});var n=r(3),s=r(116);class o extends s.Transformer{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}performEagerTransformations(e,t){for(const t of e.arrayFormulaNodes()){const[r]=this.transformSingleAst(t.getFormula(e.lazilyTransformingAstService),t.getAddress(e.lazilyTransformingAstService));t.setFormula(r)}}fixNodeAddress(e){return e}transformCellAddress(e,t){return this.transformAddress(e)}transformCellRange(e,t,r){return this.transformAddress(e)}transformColumnRange(e,t,r){return this.transformAddress(e)}transformRowRange(e,t,r){return this.transformAddress(e)}transformAddress(e){return e.sheet===this.sheet&&n.ErrorType.REF}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{findBoundaries:()=>o,validateAsSheet:()=>s});var n=r(77);function s(e){if(!Array.isArray(e))throw new n.InvalidArgumentsError("an array of arrays.");for(let t=0;t<e.length;t++)if(!Array.isArray(e[t]))throw new n.InvalidArgumentsError("an array of arrays.")}function o(e){let t=0,r=0,n=0;for(let s=0;s<e.length;s++){let o=0;for(let t=0;t<e[s].length;t++){const r=e[s][t];null!=r&&(o=t+1,++n)}t=Math.max(t,o),o>0&&(r=s+1)}const s=t*r;return{height:r,width:t,fill:0===s?0:n/s}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddColumnsUndoEntry:()=>g,AddNamedExpressionUndoEntry:()=>w,AddRowsUndoEntry:()=>l,AddSheetUndoEntry:()=>f,BaseUndoEntry:()=>o,BatchUndoEntry:()=>A,ChangeNamedExpressionUndoEntry:()=>v,ClearSheetUndoEntry:()=>C,MoveCellsUndoEntry:()=>a,MoveColumnsUndoEntry:()=>p,MoveRowsUndoEntry:()=>d,PasteUndoEntry:()=>R,RemoveColumnsUndoEntry:()=>m,RemoveNamedExpressionUndoEntry:()=>S,RemoveRowsUndoEntry:()=>i,RemoveSheetUndoEntry:()=>y,RenameSheetUndoEntry:()=>E,SetCellContentsUndoEntry:()=>T,SetColumnOrderUndoEntry:()=>h,SetRowOrderUndoEntry:()=>u,SetSheetContentUndoEntry:()=>c,UndoRedo:()=>N});var n=r(3),s=r(114);class o{}class i extends o{constructor(e,t){super(),this.command=e,this.rowsRemovals=t}doUndo(e){e.undoRemoveRows(this)}doRedo(e){e.redoRemoveRows(this)}}class a extends o{constructor(e,t,r,n,s,o,i){super(),this.sourceLeftCorner=e,this.width=t,this.height=r,this.destinationLeftCorner=n,this.overwrittenCellsData=s,this.addedGlobalNamedExpressions=o,this.version=i}doUndo(e){e.undoMoveCells(this)}doRedo(e){e.redoMoveCells(this)}}class l extends o{constructor(e){super(),this.command=e}doUndo(e){e.undoAddRows(this)}doRedo(e){e.redoAddRows(this)}}class u extends o{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 h extends o{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 c extends o{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 d extends o{constructor(e,t,r,n,s){super(),this.sheet=e,this.startRow=t,this.numberOfRows=r,this.targetRow=n,this.version=s,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 p extends o{constructor(e,t,r,n,s){super(),this.sheet=e,this.startColumn=t,this.numberOfColumns=r,this.targetColumn=n,this.version=s,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 g extends o{constructor(e){super(),this.command=e}doUndo(e){e.undoAddColumns(this)}doRedo(e){e.redoAddColumns(this)}}class m extends o{constructor(e,t){super(),this.command=e,this.columnsRemovals=t}doUndo(e){e.undoRemoveColumns(this)}doRedo(e){e.redoRemoveColumns(this)}}class f extends o{constructor(e){super(),this.sheetName=e}doUndo(e){e.undoAddSheet(this)}doRedo(e){e.redoAddSheet(this)}}class y extends o{constructor(e,t,r,n,s){super(),this.sheetName=e,this.sheetId=t,this.oldSheetContent=r,this.scopedNamedExpressions=n,this.version=s}doUndo(e){e.undoRemoveSheet(this)}doRedo(e){e.redoRemoveSheet(this)}}class E extends o{constructor(e,t,r){super(),this.sheetId=e,this.oldName=t,this.newName=r}doUndo(e){e.undoRenameSheet(this)}doRedo(e){e.redoRenameSheet(this)}}class C extends o{constructor(e,t){super(),this.sheetId=e,this.oldSheetContent=t}doUndo(e){e.undoClearSheet(this)}doRedo(e){e.redoClearSheet(this)}}class T extends o{constructor(e){super(),this.cellContents=e}doUndo(e){e.undoSetCellContents(this)}doRedo(e){e.redoSetCellContents(this)}}class R extends o{constructor(e,t,r,n){super(),this.targetLeftCorner=e,this.oldContent=t,this.newContent=r,this.addedGlobalNamedExpressions=n}doUndo(e){e.undoPaste(this)}doRedo(e){e.redoPaste(this)}}class w extends o{constructor(e,t,r,n){super(),this.name=e,this.newContent=t,this.scope=r,this.options=n}doUndo(e){e.undoAddNamedExpression(this)}doRedo(e){e.redoAddNamedExpression(this)}}class S extends o{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 v extends o{constructor(e,t,r,n,s){super(),this.namedExpression=e,this.newContent=t,this.oldContent=r,this.scope=n,this.options=s}doUndo(e){e.undoChangeNamedExpression(this)}doRedo(e){e.redoChangeNamedExpression(this)}}class A extends o{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 N{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 A}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(){const 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(const t of e.reversedOperations())this.undoEntry(t)}undoRemoveRows(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},rowsRemovals:r}=e;for(let e=r.length-1;e>=0;--e){const n=r[e];this.operations.addRows(new s.AddRowsCommand(t,[[n.rowFrom,n.rowCount]]));for(const{address:e,cellType:t}of n.removedCells)this.operations.restoreCell(e,t);this.restoreOldDataFromVersion(n.version-1)}}undoRemoveColumns(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},columnsRemovals:r}=e;for(let e=r.length-1;e>=0;--e){const n=r[e];this.operations.addColumns(new s.AddColumnsCommand(t,[[n.columnFrom,n.columnCount]]));for(const{address:e,cellType:t}of n.removedCells)this.operations.restoreCell(e,t);this.restoreOldDataFromVersion(n.version-1)}}undoAddRows(e){const t=e.command.rowsSpans();for(let r=t.length-1;r>=0;--r){const n=t[r];this.operations.removeRows(new s.RemoveRowsCommand(e.command.sheet,[[n.rowStart,n.numberOfRows]]))}}undoAddColumns(e){const t=e.command.columnsSpans();for(let r=t.length-1;r>=0;--r){const n=t[r];this.operations.removeColumns(new s.RemoveColumnsCommand(e.command.sheet,[[n.columnStart,n.numberOfColumns]]))}}undoSetCellContents(e){for(const t of e.cellContents){const e=t.address,[r,s]=t.oldContent;(0,n.equalSimpleCellAddress)(e,r)||this.operations.setCellEmpty(e),this.operations.restoreCell(r,s)}}undoPaste(e){this.restoreOperationOldContent(e.oldContent);for(const t of e.addedGlobalNamedExpressions)this.operations.removeNamedExpression(t)}undoMoveRows(e){const{sheet:t}=e;this.operations.moveRows(t,e.undoStart,e.numberOfRows,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveColumns(e){const{sheet:t}=e;this.operations.moveColumns(t,e.undoStart,e.numberOfColumns,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveCells(e){this.operations.forceApplyPostponedTransformations(),this.operations.moveCells(e.destinationLeftCorner,e.width,e.height,e.sourceLeftCorner),this.restoreOperationOldContent(e.overwrittenCellsData),this.restoreOldDataFromVersion(e.version-1);for(const t of e.addedGlobalNamedExpressions)this.operations.removeNamedExpression(t)}undoAddSheet(e){const{sheetName:t}=e;this.operations.removeSheetByName(t)}undoRemoveSheet(e){this.operations.forceApplyPostponedTransformations();const{oldSheetContent:t,sheetId:r}=e;this.operations.addSheet(e.sheetName);for(let e=0;e<t.length;e++){const s=t[e];for(let t=0;t<s.length;t++){const o=s[t],i=(0,n.simpleCellAddress)(r,t,e);this.operations.restoreCell(i,o)}}for(const[t,n]of e.scopedNamedExpressions)this.operations.restoreNamedExpression(t,n,r);this.restoreOldDataFromVersion(e.version-1)}undoRenameSheet(e){this.operations.renameSheet(e.sheetId,e.oldName)}undoClearSheet(e){const{oldSheetContent:t,sheetId:r}=e;for(let e=0;e<t.length;e++){const s=t[e];for(let t=0;t<s.length;t++){const o=s[t],i=(0,n.simpleCellAddress)(r,t,e);this.operations.restoreCell(i,o)}}}undoSetSheetContent(e){const{oldSheetContent:t,sheetId:r}=e;this.operations.clearSheet(r);for(let e=0;e<t.length;e++){const s=t[e];for(let t=0;t<s.length;t++){const o=s[t],i=(0,n.simpleCellAddress)(r,t,e);this.operations.restoreCell(i,o)}}}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(){const 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(const 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){const{targetLeftCorner:t,newContent:r}=e,s=r.length,o=r[0].length;for(let e=0;e<s;++e)for(let s=0;s<o;++s){const o=(0,n.simpleCellAddress)(t.sheet,t.col+s,t.row+e);this.operations.restoreCell(o,r[e][s])}}redoSetCellContents(e){for(const 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.addSheet(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){const{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)}redoChangeNamedExpression(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(const[t,r]of e)this.operations.restoreCell(t,r)}redoEntry(e){e.doRedo(this)}restoreOldDataFromVersion(e){const t=this.oldData.get(e)||[];for(const e of t){const[t,r]=e;this.operations.setFormulaToCellFromCache(r,t)}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Evaluator:()=>p});var n=r(2),s=r(6),o=r(3),i=r(68),a=r(4),l=r(80),u=r(93),h=r(70),c=r(69),d=r(72);class p{constructor(e,t,r,n,s,o){this.config=e,this.stats=t,this.interpreter=r,this.lazilyTransformingAstService=n,this.dependencyGraph=s,this.columnSearch=o}run(){this.stats.start(d.StatType.TOP_SORT);const{sorted:e,cycled:t}=this.dependencyGraph.topSortWithScc();this.stats.end(d.StatType.TOP_SORT),this.stats.measure(d.StatType.EVALUATION,(()=>{this.recomputeFormulas(t,e)}))}partialRun(e){const t=i.ContentChanges.empty();return this.stats.measure(d.StatType.EVALUATION,(()=>{this.dependencyGraph.graph.getTopSortedWithSccSubgraphFrom(e,(e=>{if(e instanceof l.FormulaVertex){const r=e.isComputed()?e.getCellValue():void 0,n=this.recomputeFormulaVertexValue(e);if(n!==r){const s=e.getAddress(this.lazilyTransformingAstService);return t.addChange(n,s),this.columnSearch.change((0,h.getRawValue)(r),(0,h.getRawValue)(n),s),!0}return!1}return!(e instanceof a.RangeVertex)||(e.clearCache(),!0)}),(e=>{if(e instanceof a.RangeVertex)e.clearCache();else if(e instanceof l.FormulaVertex){const r=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.remove((0,h.getRawValue)(e.valueOrUndef()),r);const n=new o.CellError(o.ErrorType.CYCLE,void 0,e);e.setCellValue(n),t.addChange(n,r)}}))})),t}runAndForget(e,t,r){const o=[];for(const e of(0,s.absolutizeDependencies)(r,t))if(e instanceof n.AbsoluteCellRange){const t=e;if(void 0===this.dependencyGraph.getRange(t.start,t.end)){const e=new a.RangeVertex(t);this.dependencyGraph.rangeMapping.setRange(e),o.push(e)}}const i=this.evaluateAstToCellValue(e,new u.InterpreterState(t,this.config.useArrayArithmetic));return o.forEach((e=>{this.dependencyGraph.rangeMapping.removeRange(e)})),i}recomputeFormulas(e,t){e.forEach((e=>{e instanceof l.FormulaVertex&&e.setCellValue(new o.CellError(o.ErrorType.CYCLE,void 0,e))})),t.forEach((e=>{if(e instanceof l.FormulaVertex){const t=this.recomputeFormulaVertexValue(e),r=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.add((0,h.getRawValue)(t),r)}else e instanceof a.RangeVertex&&e.clearCache()}))}recomputeFormulaVertexValue(e){const t=e.getAddress(this.lazilyTransformingAstService);if(e instanceof a.ArrayVertex&&(e.array.size.isRef||!this.dependencyGraph.isThereSpaceForArray(e)))return e.setNoSpace();{const r=e.getFormula(this.lazilyTransformingAstService),n=this.evaluateAstToCellValue(r,new u.InterpreterState(t,this.config.useArrayArithmetic,e));return e.setCellValue(n)}}evaluateAstToCellValue(e,t){const r=this.interpreter.evaluateAst(e,t);return r instanceof c.SimpleRangeValue?r:r===h.EmptyValue&&this.config.evaluateNullToZero?0:r}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ExportedCellChange:()=>h,ExportedNamedExpressionChange:()=>c,Exporter:()=>d});var n=r(3),s=r(98),o=r(61),i=r(70),a=r(69),l=r(113),u=r(8);class h{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}}class d{constructor(e,t,r,n){this.config=e,this.namedExpressions=t,this.sheetIndexMapping=r,this.lazilyTransformingService=n}exportChange(e){const t=e.value,r=e.address;if(r.sheet===l.NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS){const e=this.namedExpressions.namedExpressionInAddress(r.row);if(!e)throw new Error("Missing named expression");return new c(e.displayName,this.exportScalarOrRange(t))}if(t instanceof a.SimpleRangeValue){const e=[];for(const[n,s]of t.entriesFromTopLeftCorner(r))e.push(new h(s,this.exportValue(n)));return e}return new h(r,this.exportValue(t))}exportValue(e){return e instanceof a.SimpleRangeValue?this.detailedError(new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.ScalarExpected)):this.config.smartRounding&&(0,i.isExtendedNumber)(e)?this.cellValueRounding((0,i.getRawValue)(e)):e instanceof n.CellError?this.detailedError(e):e===i.EmptyValue?null:(0,i.getRawValue)(e)}exportScalarOrRange(e){return e instanceof a.SimpleRangeValue?e.rawData().map((e=>e.map((e=>this.exportValue(e))))):this.exportValue(e)}detailedError(e){var t,r;let n;const o=null===(t=e.root)||void 0===t?void 0:t.getAddress(this.lazilyTransformingService);return void 0!==o&&(n=o.sheet===l.NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS?null===(r=this.namedExpressions.namedExpressionInAddress(o.row))||void 0===r?void 0:r.displayName:(0,u.simpleCellAddressToString)(this.sheetIndexMapping,o,-1)),new s.DetailedCellError(e,this.config.translationPackage.getErrorTranslation(e.type),n)}cellValueRounding(e){if(0===e)return e;const t=Math.floor(Math.log10(Math.abs(e))),r=Math.pow(10,this.config.precisionRounding-t);return e<0?-Math.round(-e*r)/r:Math.round(e*r)/r}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{GraphBuilder:()=>h,SimpleStrategy:()=>c});var n=r(6),s=r(1),o=r(3),i=r(110),a=r(4),l=r(70),u=r(72);class h{constructor(e,t,r,n,s,o){this.dependencyGraph=e,this.columnSearch=t,this.parser=r,this.cellContentParser=n,this.stats=s,this.arraySizePredictor=o,this.buildStrategy=new c(e,t,r,s,n,o)}buildGraph(e,t){const r=t.measure(u.StatType.COLLECT_DEPENDENCIES,(()=>this.buildStrategy.run(e)));this.dependencyGraph.getAndClearContentChanges(),t.measure(u.StatType.PROCESS_DEPENDENCIES,(()=>this.processDependencies(r)))}processDependencies(e){e.forEach(((e,t)=>{this.dependencyGraph.processCellDependencies(e,t)}))}}class c{constructor(e,t,r,n,s,o){this.dependencyGraph=e,this.columnIndex=t,this.parser=r,this.stats=n,this.cellContentParser=s,this.arraySizePredictor=o}run(e){const t=new Map;for(const r in e){const h=this.dependencyGraph.getSheetId(r),c=e[r];for(let e=0;e<c.length;++e){const r=c[e];for(let c=0;c<r.length;++c){const d=r[c],p=(0,o.simpleCellAddress)(h,c,e),g=this.cellContentParser.parse(d);if(g instanceof i.CellContent.Formula){const e=this.stats.measure(u.StatType.PARSER,(()=>this.parser.parse(g.formula,p)));if(e.errors.length>0){this.shrinkArrayIfNeeded(p);const t=new a.ParsingErrorVertex(e.errors,g.formula);this.dependencyGraph.addVertex(p,t)}else{this.shrinkArrayIfNeeded(p);const r=this.arraySizePredictor.checkArraySize(e.ast,p);if(r.isScalar()){const r=new a.FormulaCellVertex(e.ast,p,0);t.set(r,(0,n.absolutizeDependencies)(e.dependencies,p)),this.dependencyGraph.addVertex(p,r),e.hasVolatileFunction&&this.dependencyGraph.markAsVolatile(r),e.hasStructuralChangeFunction&&this.dependencyGraph.markAsDependentOnStructureChange(r)}else{const o=new a.ArrayVertex(e.ast,p,new s.ArraySize(r.width,r.height));t.set(o,(0,n.absolutizeDependencies)(e.dependencies,p)),this.dependencyGraph.addArrayVertex(p,o)}}}else if(g instanceof i.CellContent.Empty);else{this.shrinkArrayIfNeeded(p);const e=new a.ValueCellVertex(g.value,d);this.columnIndex.add((0,l.getRawValue)(g.value),p),this.dependencyGraph.addVertex(p,e)}}}}return t}shrinkArrayIfNeeded(e){const t=this.dependencyGraph.getCell(e);t instanceof a.ArrayVertex&&this.dependencyGraph.shrinkArrayToCorner(t)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FunctionRegistry:()=>a});var n=r(77),s=r(108),o=r(129);function i(e,t){var r;let s=t.implementedFunctions[e];const o=null===(r=t.aliases)||void 0===r?void 0:r[e];if(void 0!==o){if(void 0!==s)throw new n.AliasAlreadyExisting(e,t.name);s=t.implementedFunctions[o]}if(void 0===s)throw n.FunctionPluginValidationError.functionNotDeclaredInPlugin(e,t.name);return s}class a{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){this.instancePlugins=new Map;for(const t of e.functionPlugins)a.loadPluginFunctions(t,this.instancePlugins)}else this.instancePlugins=new Map(a.plugins);for(const[e,t]of a.protectedFunctions())a.loadFunctionUnprotected(t,e,this.instancePlugins);for(const[e,t]of this.instancePlugins.entries())this.categorizeFunction(e,i(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 n.ProtectedFunctionError.cannotUnregisterFunctionWithId(e);this.plugins.delete(e)}static unregisterFunctionPlugin(e){for(const t of this.protectedPlugins())if(t===e)throw n.ProtectedFunctionError.cannotUnregisterProtectedPlugin();for(const[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){return this.functionIsProtected(e)?void 0:this.plugins.get(e)}static functionIsProtected(e){return this._protectedPlugins.has(e)}static loadTranslations(e){const t=new Set(s.HyperFormula.getRegisteredLanguagesCodes());Object.keys(e).forEach((r=>{t.has(r)&&s.HyperFormula.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 n.ProtectedFunctionError.cannotRegisterFunctionWithId(t);this.loadFunctionUnprotected(e,t,r)}static loadFunctionUnprotected(e,t,r){const s=i(t,e).method;if(!Object.prototype.hasOwnProperty.call(e.prototype,s))throw n.FunctionPluginValidationError.functionMethodNotFound(s,e.name);r.set(t,e)}static*protectedFunctions(){for(const[e,t]of this._protectedPlugins)void 0!==t&&(yield[e,t])}static*protectedPlugins(){for(const[,e]of this._protectedPlugins)void 0!==e&&(yield e)}initializePlugins(e){const t=[];for(const[r,n]of this.instancePlugins.entries()){let s=t.find((e=>e instanceof n));void 0===s&&(s=new n(e),t.push(s));const o=i(r,n),a=o.method;this.functions.set(r,[a,s]);const l=o.arraySizeMethod;void 0!==l&&this.arraySizeFunctions.set(r,[l,s])}}getFunctionPlugin(e){if(!a.functionIsProtected(e))return this.instancePlugins.get(e)}getFunction(e){const t=this.functions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,r]=t;return(t,n)=>r[e](t,n)}}getArraySizeFunction(e){const t=this.arraySizeFunctions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,r]=t;return(t,n)=>r[e](t,n)}}getMetadata(e){return this.functionsMetadata.get(e)}getPlugins(){const e=new Set;for(const[t,r]of this.instancePlugins)a.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.arrayFunction&&this.arrayFunctions.add(e),t.doesNotNeedArgumentsToBeComputed&&this.functionsWhichDoesNotNeedArgumentsToBeComputed.add(e),t.isDependentOnSheetStructureChange&&this.structuralChangeFunctions.add(e),this.functionsMetadata.set(e,t)}}a.plugins=new Map,a._protectedPlugins=new Map([["VERSION",o.VersionPlugin],["OFFSET",void 0]])},(e,t,r)=>{"use strict";r.r(t),r.d(t,{VersionPlugin:()=>i});var n=r(108),s=r(94);const o=new Map([["gpl-v3",1],["missing",2],["invalid",3],["expired",4]]);class i extends s.FunctionPlugin{version(e,t){return this.runFunction(e.args,t,this.metadata("VERSION"),(()=>{const{licenseKeyValidityState:e,licenseKey:t}=this.config;let r;return o.has(t)?r=o.get(t):o.has(e)?r=o.get(e):"valid"===e&&(r=t.slice(-5)),`HyperFormula v${n.HyperFormula.version}, ${r}`}))}}i.implementedFunctions={VERSION:{method:"version",parameters:[]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Interpreter:()=>g});var n=r(2),s=r(81),o=r(3),i=r(61),a=r(57),l=r(95),u=r(131),h=r(128),c=r(93),d=r(70),p=r(69);class g{constructor(e,t,r,n,s,o,i,a,h,c){this.config=e,this.dependencyGraph=t,this.columnSearch=r,this.stats=n,this.arithmeticHelper=s,this.functionRegistry=o,this.namedExpressions=i,this.serialization=a,this.arraySizePredictor=h,this.dateTimeHelper=c,this.equalOp=(e,t)=>f(this.arithmeticHelper.eq,e,t),this.notEqualOp=(e,t)=>f(this.arithmeticHelper.neq,e,t),this.greaterThanOp=(e,t)=>f(this.arithmeticHelper.gt,e,t),this.lessThanOp=(e,t)=>f(this.arithmeticHelper.lt,e,t),this.greaterThanOrEqualOp=(e,t)=>f(this.arithmeticHelper.geq,e,t),this.lessThanOrEqualOp=(e,t)=>f(this.arithmeticHelper.leq,e,t),this.concatOp=(e,t)=>f(this.arithmeticHelper.concat,(0,l.coerceScalarToString)(e),(0,l.coerceScalarToString)(t)),this.plusOp=(e,t)=>f(this.arithmeticHelper.addWithEpsilon,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.minusOp=(e,t)=>f(this.arithmeticHelper.subtract,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.timesOp=(e,t)=>f(this.arithmeticHelper.multiply,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.powerOp=(e,t)=>f(this.arithmeticHelper.pow,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.divOp=(e,t)=>f(this.arithmeticHelper.divide,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.unaryMinusOp=e=>m(this.arithmeticHelper.unaryMinus,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.percentOp=e=>m(this.arithmeticHelper.unaryPercent,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.unaryPlusOp=e=>this.arithmeticHelper.unaryPlus(e),this.functionRegistry.initializePlugins(this),this.criterionBuilder=new u.CriterionBuilder(e)}evaluateAst(e,t){let r=this.evaluateAstWithoutPostprocessing(e,t);if((0,d.isExtendedNumber)(r)){if((0,l.isNumberOverflow)((0,d.getRawValue)(r)))return new o.CellError(o.ErrorType.NUM,i.ErrorMessage.NaN);r=(0,d.cloneNumber)(r,(0,l.fixNegativeZero)((0,d.getRawValue)(r)))}return r instanceof p.SimpleRangeValue&&1===r.height()&&1===r.width()&&([[r]]=r.data),function(e,t){if(e instanceof o.CellError&&void 0!==t)return e.attachRootVertex(t);return e}(r,t.formulaVertex)}evaluateAstWithoutPostprocessing(e,t){switch(e.type){case a.AstNodeType.EMPTY:return d.EmptyValue;case a.AstNodeType.CELL_REFERENCE:{const r=e.reference.toSimpleCellAddress(t.formulaAddress);return(0,o.invalidSimpleCellAddress)(r)?new o.CellError(o.ErrorType.REF,i.ErrorMessage.BadRef):this.dependencyGraph.getCellValue(r)}case a.AstNodeType.NUMBER:case a.AstNodeType.STRING:return e.value;case a.AstNodeType.CONCATENATE_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.concatOp,r,n,t)}case a.AstNodeType.EQUALS_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.equalOp,r,n,t)}case a.AstNodeType.NOT_EQUAL_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.notEqualOp,r,n,t)}case a.AstNodeType.GREATER_THAN_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOp,r,n,t)}case a.AstNodeType.LESS_THAN_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOp,r,n,t)}case a.AstNodeType.GREATER_THAN_OR_EQUAL_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOrEqualOp,r,n,t)}case a.AstNodeType.LESS_THAN_OR_EQUAL_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOrEqualOp,r,n,t)}case a.AstNodeType.PLUS_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.plusOp,r,n,t)}case a.AstNodeType.MINUS_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.minusOp,r,n,t)}case a.AstNodeType.TIMES_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.timesOp,r,n,t)}case a.AstNodeType.POWER_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.powerOp,r,n,t)}case a.AstNodeType.DIV_OP:{const r=this.evaluateAst(e.left,t),n=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.divOp,r,n,t)}case a.AstNodeType.PLUS_UNARY_OP:{const r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryPlusOp,r,t)}case a.AstNodeType.MINUS_UNARY_OP:{const r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryMinusOp,r,t)}case a.AstNodeType.PERCENT_OP:{const r=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.percentOp,r,t)}case a.AstNodeType.FUNCTION_CALL:{if("valid"!==this.config.licenseKeyValidityState&&!h.FunctionRegistry.functionIsProtected(e.procedureName))return new o.CellError(o.ErrorType.LIC,i.ErrorMessage.LicenseKey(this.config.licenseKeyValidityState));const r=this.functionRegistry.getFunction(e.procedureName);return void 0!==r?r(e,new c.InterpreterState(t.formulaAddress,t.arraysFlag||this.functionRegistry.isArrayFunction(e.procedureName),t.formulaVertex)):new o.CellError(o.ErrorType.NAME,i.ErrorMessage.FunctionName(e.procedureName))}case a.AstNodeType.NAMED_EXPRESSION:{const r=this.namedExpressions.nearestNamedExpression(e.expressionName,t.formulaAddress.sheet);return r?this.dependencyGraph.getCellValue(r.address):new o.CellError(o.ErrorType.NAME,i.ErrorMessage.NamedExpressionName(e.expressionName))}case a.AstNodeType.CELL_RANGE:{if(!this.rangeSpansOneSheet(e))return new o.CellError(o.ErrorType.REF,i.ErrorMessage.RangeManySheets);const r=n.AbsoluteCellRange.fromCellRange(e,t.formulaAddress),a=this.dependencyGraph.getArray(r);if(a){const e=a.array;if(e instanceof s.NotComputedArray)throw new Error("Array should be already computed");if(e instanceof o.CellError)return e;if(e instanceof s.ArrayValue)return p.SimpleRangeValue.fromRange(e.raw(),r,this.dependencyGraph);throw new Error("Unknown array")}return p.SimpleRangeValue.onlyRange(r,this.dependencyGraph)}case a.AstNodeType.COLUMN_RANGE:{if(!this.rangeSpansOneSheet(e))return new o.CellError(o.ErrorType.REF,i.ErrorMessage.RangeManySheets);const r=n.AbsoluteColumnRange.fromColumnRange(e,t.formulaAddress);return p.SimpleRangeValue.onlyRange(r,this.dependencyGraph)}case a.AstNodeType.ROW_RANGE:{if(!this.rangeSpansOneSheet(e))return new o.CellError(o.ErrorType.REF,i.ErrorMessage.RangeManySheets);const r=n.AbsoluteRowRange.fromRowRangeAst(e,t.formulaAddress);return p.SimpleRangeValue.onlyRange(r,this.dependencyGraph)}case a.AstNodeType.PARENTHESIS:return this.evaluateAst(e.expression,t);case a.AstNodeType.ARRAY:{let r;const n=[];for(const s of e.args){let e;const a=[];for(const r of s){const n=(0,l.coerceToRange)(this.evaluateAst(r,t)),s=n.height();if(void 0===e)e=s,a.push(...n.data);else{if(e!==s)return new o.CellError(o.ErrorType.REF,i.ErrorMessage.SizeMismatch);for(let e=0;e<s;e++)a[e].push(...n.data[e])}}const u=a[0].length;if(void 0===r)r=u,n.push(...a);else{if(r!==u)return new o.CellError(o.ErrorType.REF,i.ErrorMessage.SizeMismatch);n.push(...a)}}return p.SimpleRangeValue.onlyValues(n)}case a.AstNodeType.ERROR_WITH_RAW_INPUT:case a.AstNodeType.ERROR:return e.error}}rangeSpansOneSheet(e){return e.start.sheet===e.end.sheet}unaryRangeWrapper(e,t,r){var n;if(t instanceof p.SimpleRangeValue&&!r.arraysFlag&&(t=null!==(n=(0,l.coerceRangeToScalar)(t,r))&&void 0!==n?n:new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.ScalarExpected)),t instanceof o.CellError)return t;if(t instanceof p.SimpleRangeValue){const r=t.data.map((t=>t.map(e)));return p.SimpleRangeValue.onlyValues(r)}return e(t)}binaryRangeWrapper(e,t,r,n){var s,a;if(t instanceof p.SimpleRangeValue&&!n.arraysFlag&&(t=null!==(s=(0,l.coerceRangeToScalar)(t,n))&&void 0!==s?s:new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.ScalarExpected)),t instanceof o.CellError)return t;if(r instanceof p.SimpleRangeValue&&!n.arraysFlag&&(r=null!==(a=(0,l.coerceRangeToScalar)(r,n))&&void 0!==a?a:new o.CellError(o.ErrorType.VALUE,i.ErrorMessage.ScalarExpected)),r instanceof o.CellError)return r;if(t instanceof p.SimpleRangeValue||r instanceof p.SimpleRangeValue){if(!(t instanceof p.SimpleRangeValue)){if(r.isAdHoc()){const n=r.data;for(let r=0;r<n.length;r++)for(let s=0;s<n[0].length;s++)n[r][s]=e(t,n[r][s]);return p.SimpleRangeValue.onlyValues(n)}t=p.SimpleRangeValue.fromScalar(t)}if(!(r instanceof p.SimpleRangeValue)){if(t.isAdHoc()){const n=t.data;for(let t=0;t<n.length;t++)for(let s=0;s<n[0].length;s++)n[t][s]=e(n[t][s],r);return p.SimpleRangeValue.onlyValues(n)}r=p.SimpleRangeValue.fromScalar(r)}if(t.width()===r.width()&&t.height()===r.height()){if(t.isAdHoc()){const n=t.data,s=r.data;for(let t=0;t<n.length;t++)for(let r=0;r<n[0].length;r++)n[t][r]=e(n[t][r],s[t][r]);return p.SimpleRangeValue.onlyValues(n)}if(r.isAdHoc()){const n=t.data,s=r.data;for(let t=0;t<n.length;t++)for(let r=0;r<n[0].length;r++)s[t][r]=e(n[t][r],s[t][r]);return p.SimpleRangeValue.onlyValues(s)}}const n=Math.max(t.width(),r.width()),s=Math.max(t.height(),r.height()),i=Array(s);for(let e=0;e<s;e++)i[e]=Array(n);for(let a=0;a<s;a++){const s=1!==t.height()?a:0,l=1!==r.height()?a:0;for(let u=0;u<n;u++){const n=1!==t.width()?u:0,h=1!==r.width()?u:0;s<t.height()&&l<r.height()&&n<t.width()&&h<r.width()?i[a][u]=e(t.data[s][n],r.data[l][h]):i[a][u]=new o.CellError(o.ErrorType.NA)}}return p.SimpleRangeValue.onlyValues(i)}return e(t,r)}}function m(e,t){return t instanceof o.CellError?t:e(t)}function f(e,t,r){return t instanceof o.CellError?t:r instanceof o.CellError?r:e(t,r)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CriterionBuilder:()=>i,CriterionType:()=>n,buildCriterion:()=>o,buildCriterionLambda:()=>l});var n,s=r(70);!function(e){e.GREATER_THAN="GREATER_THAN",e.GREATER_THAN_OR_EQUAL="GREATER_THAN_OR_EQUAL",e.LESS_THAN="LESS_THAN",e.LESS_THAN_OR_EQUAL="LESS_THAN_OR_EQUAL",e.NOT_EQUAL="NOT_EQUAL",e.EQUAL="EQUAL"}(n||(n={}));const o=(e,t)=>({operator:e,value:t});class i{constructor(e){var t,r,n,s;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!==(s=null===(n=e.translationPackage.getMaybeFunctionTranslation("FALSE"))||void 0===n?void 0:n.toLowerCase())&&void 0!==s?s:"false"}fromCellValue(e,t){if("string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e)return;const r=this.parseCriterion(e,t);return void 0!==r?{raw:e,lambda:l(r,t)}:void 0}parseCriterion(e,t){if("number"==typeof e||"boolean"==typeof e)return o(n.EQUAL,e);if("string"==typeof e){const r=a.exec(e);let i,l;r?(l=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}}(r[1]),i=r[2]):(l=n.EQUAL,i=e);const u=t.coerceToMaybeNumber(i),h=i.toLowerCase()===this.trueString||i.toLowerCase()!==this.falseString&&void 0;if(void 0===l)return;if(""===i)return o(l,null);if(void 0!==u)return o(l,(0,s.getRawValue)(u));if(l===n.EQUAL||l===n.NOT_EQUAL)return o(l,null!=h?h:i)}}}const a=/([<>=]+)(.*)/;const l=(e,t)=>{switch(e.operator){case n.GREATER_THAN:return"number"==typeof e.value?r=>"number"==typeof r&&t.floatCmp(r,e.value)>0:e=>!1;case n.GREATER_THAN_OR_EQUAL:return"number"==typeof e.value?r=>"number"==typeof r&&t.floatCmp(r,e.value)>=0:e=>!1;case n.LESS_THAN:return"number"==typeof e.value?r=>"number"==typeof r&&t.floatCmp(r,e.value)<0:e=>!1;case n.LESS_THAN_OR_EQUAL:return"number"==typeof e.value?r=>"number"==typeof r&&t.floatCmp(r,e.value)<=0:e=>!1;case n.EQUAL:return"number"==typeof e.value?r=>{if("number"==typeof r)return 0===t.floatCmp(r,e.value);if("string"==typeof r){if(""===r)return!1;const n=t.coerceToMaybeNumber(r);return void 0!==n&&0===t.floatCmp(n,e.value)}return!1}:"string"==typeof e.value?t.eqMatcherFunction(e.value):"boolean"==typeof e.value?t=>"boolean"==typeof t&&t===e.value:e=>e===s.EmptyValue;case n.NOT_EQUAL:return"number"==typeof e.value?r=>{if("number"==typeof r)return 0!==t.floatCmp(r,e.value);if("string"==typeof r){if(""===r)return!0;const n=t.coerceToMaybeNumber(r);return void 0===n||0!==t.floatCmp(n,e.value)}return!0}:"string"==typeof e.value?t.neqMatcherFunction(e.value):"boolean"==typeof e.value?t=>"boolean"!=typeof t||t!==e.value:e=>e!==s.EmptyValue}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LazilyTransformingAstService:()=>o});var n=r(133),s=r(72);class o{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 n.CombinedTransformer(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(s.StatType.TRANSFORM_ASTS_POSTPONED);for(let n=r;n<this.transformations.length;n++){const r=this.transformations[n];r.isIrreversible()&&(this.undoRedo.storeDataForVersion(n,t,this.parser.computeHashFromAst(e)),this.parser.rememberNewAst(e));const[s,o]=r.transformSingleAst(e,t);e=s,t=o}const n=this.parser.rememberNewAst(e);return this.stats.end(s.StatType.TRANSFORM_ASTS_POSTPONED),[n,t,this.transformations.length]}*getTransformationsFrom(e,t){for(let r=e;r<this.transformations.length;r++){const e=this.transformations[r];t&&!t(e)||(yield e)}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CombinedTransformer:()=>n});class n{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,n]=[e,t];return this.transformations.forEach((e=>{[r,n]=e.transformSingleAst(r,n)})),[r,n]}isIrreversible(){return!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{buildColumnSearchStrategy:()=>o});var n=r(135),s=r(138);function o(e,t,r){return t.useColumnIndex?new s.ColumnIndex(e,t,r):new n.ColumnBinarySearch(e)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ColumnBinarySearch:()=>s});var n=r(136);class s extends n.AdvancedFind{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,n){}removeValues(e){}find(e,t,r){return this.basicFind(e,t,"row",r)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AdvancedFind:()=>i});var n=r(70),s=r(95),o=r(137);class i{constructor(e){this.dependencyGraph=e}advancedFind(e,t){let r;const s=t.range;r=void 0===s?t.valuesFromTopLeftCorner():this.dependencyGraph.computeListOfValuesInRange(s);for(let t=0;t<r.length;t++)if(e((0,n.getRawValue)(r[t])))return t;return-1}basicFind(e,t,r,{ordering:n,matchExactly:i}){const a="string"==typeof e?(0,s.forceNormalizeString)(e):e,l=t.range;return void 0===l?this.findNormalizedValue(a,t.valuesFromTopLeftCorner()):"none"===n?this.findNormalizedValue(a,this.dependencyGraph.computeListOfValuesInRange(l)):(0,o.findLastOccurrenceInOrderedRange)(a,l,{searchCoordinate:r,orderingDirection:n,matchExactly:i},this.dependencyGraph)}findNormalizedValue(e,t){return t.map(n.getRawValue).map((e=>"string"==typeof e?(0,s.forceNormalizeString)(e):e)).indexOf(e)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{compare:()=>u,findLastMatchingIndex:()=>l,findLastOccurrenceInOrderedArray:()=>a,findLastOccurrenceInOrderedRange:()=>i});var n=r(3),s=r(70);const o=-1;function i(e,t,{searchCoordinate:r,orderingDirection:i,matchExactly:a},h){const c=t.start[r],d="col"===r?t.effectiveEndColumn(h):t.effectiveEndRow(h),p="col"===r?e=>(0,s.getRawValue)(h.getCellValue((0,n.simpleCellAddress)(t.sheet,e,t.start.row))):e=>(0,s.getRawValue)(h.getCellValue((0,n.simpleCellAddress)(t.sheet,t.start.col,e))),g="asc"===i?(e,t)=>u(e,t):(e,t)=>-u(e,t),m=l((t=>g(e,p(t))>=0),c,d),f=p(m);return m===o||typeof f!=typeof e||a&&f!==e?o:m-c}function a(e,t,r="asc"){return l("asc"===r?r=>u(e,t[r])>=0:r=>-u(e,t[r])>=0,0,t.length-1)}function l(e,t,r){let n=t,s=r;for(;n<s;){const t=Math.ceil((n+s)/2);e(t)?n=t:s=t-1}return n===s&&e(n)?n:o}function u(e,t){return typeof e==typeof t?e===s.EmptyValue?0:e<t?-1:e>t?1:0:e===s.EmptyValue?-1:t===s.EmptyValue?1:t instanceof n.CellError||"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}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ColumnIndex:()=>c,findInOrderedArray:()=>d});var n=r(3),s=r(117),o=r(121),i=r(95),a=r(70),l=r(69),u=r(72),h=r(135);class c{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 h.ColumnBinarySearch(e)}add(e,t){if(!(e===a.EmptyValue||e instanceof n.CellError))if(e instanceof l.SimpleRangeValue)for(const[r,n]of e.entriesFromTopLeftCorner(t))this.addSingleCellValue((0,a.getRawValue)(r),n);else this.addSingleCellValue(e,t)}remove(e,t){if(void 0!==e)if(e instanceof l.SimpleRangeValue)for(const[r,n]of e.entriesFromTopLeftCorner(t))this.removeSingleValue((0,a.getRawValue)(r),n);else this.removeSingleValue(e,t)}change(e,t,r){e!==t&&(this.remove(e,r),this.add(t,r))}applyChanges(e){for(const t of e)void 0!==t.oldValue&&this.change((0,a.getRawValue)(t.oldValue),(0,a.getRawValue)(t.value),t.address)}moveValues(e,t,r,s){for(const[o,i]of e){const e=(0,n.movedSimpleCellAddress)(i,s,t,r);this.remove(o,i),this.add(o,e)}}removeValues(e){for(const[t,r]of e)this.remove(t,r)}find(e,t,{ordering:r,matchExactly:n}){const s=!0===n?"findFirst":"findLast",o=this.findUsingColumnIndex(e,t,s);return void 0!==o?o:this.binarySearchStrategy.find(e,t,{ordering:r,matchExactly:n})}findUsingColumnIndex(e,t,r){const n=t.range;if(void 0===n)return;this.ensureRecentData(n.sheet,n.start.col,e);const s=this.getColumnMap(n.sheet,n.start.col);if(!s)return-1;const o="string"==typeof e?(0,i.forceNormalizeString)(e):e,a=s.get(o);if(!a||!a.index||0===a.index.length)return;const l=c.findRowBelongingToRange(a,n,r);return void 0!==l?l-n.start.row:void 0}static findRowBelongingToRange(e,t,r){const n=t.start.row,s=t.end.row,o="findFirst"===r?d(n,e.index,"upperBound"):d(s,e.index,"lowerBound");if(-1===o)return;const i=e.index[o];return i>=n&&i<=s?i:void 0}advancedFind(e,t){return this.binarySearchStrategy.advancedFind(e,t)}addColumns(e){const t=this.index.get(e.sheet);t&&t.splice(e.columnStart,0,...Array(e.numberOfColumns))}removeColumns(e){const 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,[]);const r=this.index.get(e);let n=r[t];return n||(n=new Map,r[t]=n),n}getValueIndex(e,t,r){const n=this.getColumnMap(e,t);let s=this.getColumnMap(e,t).get(r);return s||(s={version:this.transformingService.version(),index:[]},n.set(r,s)),s}ensureRecentData(e,t,r){const n=this.getValueIndex(e,t,r),i=this.transformingService.version();if(n.version===i)return;const a=this.transformingService.getTransformationsFrom(n.version,(t=>t.sheet===e&&(t instanceof s.AddRowsTransformer||t instanceof o.RemoveRowsTransformer)));for(const e of a)e instanceof s.AddRowsTransformer?this.addRows(t,e.rowsSpan,r):e instanceof o.RemoveRowsTransformer&&this.removeRows(t,e.rowsSpan,r);n.version=i}addSingleCellValue(e,t){this.stats.measure(u.StatType.BUILD_COLUMN_INDEX,(()=>{this.ensureRecentData(t.sheet,t.col,e),"string"==typeof e&&(e=(0,i.forceNormalizeString)(e));const r=this.getValueIndex(t.sheet,t.col,e);c.addValue(r,t.row)}))}removeSingleValue(e,t){this.stats.measure(u.StatType.BUILD_COLUMN_INDEX,(()=>{this.ensureRecentData(t.sheet,t.col,e);const r=this.getColumnMap(t.sheet,t.col);"string"==typeof e&&(e=(0,i.forceNormalizeString)(e));const n=r.get(e);if(!n)return;const s=d(t.row,n.index);s>-1&&n.index.splice(s,1),0===n.index.length&&r.delete(e),0===r.size&&delete this.index.get(t.sheet)[t.col]}))}addRows(e,t,r){const n=this.getValueIndex(t.sheet,e,r);c.shiftRows(n,t.rowStart,t.numberOfRows)}removeRows(e,t,r){const n=this.getValueIndex(t.sheet,e,r);c.removeRowsFromValues(n,t),c.shiftRows(n,t.rowEnd+1,-t.numberOfRows)}static addValue(e,t){const r=d(t,e.index,"lowerBound");e.index[r]===t||e.index.splice(r+1,0,t)}static removeRowsFromValues(e,t){const r=d(t.rowStart,e.index,"upperBound"),n=d(t.rowEnd,e.index,"lowerBound");r>-1&&n>-1&&r<=n&&e.index[r]<=t.rowEnd&&e.index.splice(r,n-r+1)}static shiftRows(e,t,r){const n=d(t,e.index,"upperBound");if(-1!==n)for(let t=n;t<e.index.length;++t)e.index[t]+=r}}function d(e,t,r="upperBound"){let n=0,s=t.length-1;for(;n<=s;){const r=Math.floor((n+s)/2);if(e>t[r])n=r+1;else{if(!(e<t[r]))return r;s=r-1}}const o="lowerBound"===r?s:n;return o>=0&&o<=t.length?o:-1}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{NumberLiteralHelper:()=>n});class n{constructor(e){this.config=e;const t="."===this.config.thousandSeparator?`\\${this.config.thousandSeparator}`:this.config.thousandSeparator,r="."===this.config.decimalSeparator?`\\${this.config.decimalSeparator}`:this.config.decimalSeparator;this.numberPattern=new RegExp(`^([+-]?((${r}\\d+)|(\\d+(${t}\\d{3,})*(${r}\\d*)?)))(e[+-]?\\d+)?$`),this.allThousandSeparatorsRegex=new RegExp(`${t}`,"g")}numericStringToMaybeNumber(e){if(this.numberPattern.test(e)){const t=this.numericStringToNumber(e);if(isNaN(t))return;return t}}numericStringToNumber(e){const t=e.replace(this.allThousandSeparatorsRegex,"").replace(this.config.decimalSeparator,".");return Number(t)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Serialization:()=>i});var n=r(3),s=r(4),o=r(7);class i{constructor(e,t,r){this.dependencyGraph=e,this.unparser=t,this.exporter=r}getCellHyperlink(e){const t=this.dependencyGraph.getCell(e);if(t instanceof s.FormulaCellVertex){const e=t.getFormula(this.dependencyGraph.lazilyTransformingAstService);if("HYPERLINK"===e.procedureName)return e.hyperlink}}getCellFormula(e,t){const r=this.dependencyGraph.getCell(e);if(r instanceof s.FormulaCellVertex){const n=r.getFormula(this.dependencyGraph.lazilyTransformingAstService);return t=null!=t?t:e,this.unparser.unparse(n,t)}if(r instanceof s.ArrayVertex){const n=r.getAddress(this.dependencyGraph.lazilyTransformingAstService);if(n.row!==e.row||n.col!==e.col||n.sheet!==e.sheet)return;t=null!=t?t:e;const s=r.getFormula(this.dependencyGraph.lazilyTransformingAstService);if(void 0!==s)return this.unparser.unparse(s,t)}else if(r instanceof s.ParsingErrorVertex)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){const r=this.dependencyGraph.getSheetHeight(e),s=this.dependencyGraph.getSheetWidth(e),o=new Array(r);for(let i=0;i<r;i++){o[i]=new Array(s);for(let r=0;r<s;r++){const s=(0,n.simpleCellAddress)(e,r,i);o[i][r]=t(s)}for(let e=s-1;e>=0&&(null===o[i][e]||void 0===o[i][e]);e--)o[i].pop()}for(let e=r-1;e>=0&&0===o[e].length;e--)o.pop();return o}genericAllSheetsGetter(e){const t={};for(const r of this.dependencyGraph.sheetMapping.displayNames()){const n=this.dependencyGraph.sheetMapping.fetch(r);t[r]=e(n)}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(){const e=[];let t=0;for(const r of this.dependencyGraph.sheetMapping.displayNames()){const n=this.dependencyGraph.sheetMapping.fetch(r);e[n]=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){const r=new o.Unparser(e,(0,o.buildLexerConfig)(e),this.dependencyGraph.sheetMapping.fetchDisplayName,t);return new i(this.dependencyGraph,r,this.exporter)}}},(e,t,r)=>{"use strict";function n(e){for(const[t,r]of Object.entries(e))r instanceof Function?e[t]=s(r):delete e[t]}function s(e){return()=>{throw new Error(`The "${e}" method cannot be called because this HyperFormula instance has been destroyed`)}}r.r(t),r.d(t,{objectDestroy:()=>n})},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Emitter:()=>o,Events:()=>n});var n,s=r(143);!function(e){e.SheetAdded="sheetAdded",e.SheetRemoved="sheetRemoved",e.SheetRenamed="sheetRenamed",e.NamedExpressionAdded="namedExpressionAdded",e.NamedExpressionRemoved="namedExpressionRemoved",e.ValuesUpdated="valuesUpdated",e.EvaluationSuspended="evaluationSuspended",e.EvaluationResumed="evaluationResumed"}(n||(n={}));class o extends s.TinyEmitter{emit(e,...t){return super.emit(e,...t),this}}},e=>{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function s(){n.off(e,s),t.apply(r,arguments)}return s._=t,this.on(e,s,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,s=r.length;n<s;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],s=[];if(n&&t)for(var o=0,i=n.length;o<i;o++)n[o].fn!==t&&n[o].fn._!==t&&s.push(n[o]);return s.length?r[e]=s:delete r[e],this}},e.exports=t,e.exports.TinyEmitter=t},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n={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",YEAR:"YEAR",YEARFRAC:"YEARFRAC","HF.ADD":"HF.ADD","HF.CONCAT":"HF.CONCAT","HF.DIVIDE":"HF.DIVIDE","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"}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FunctionArgumentType:()=>n.FunctionArgumentType,FunctionPlugin:()=>n.FunctionPlugin});var n=r(94)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbsPlugin:()=>o.AbsPlugin,AddressPlugin:()=>n.AddressPlugin,ArrayPlugin:()=>s.ArrayPlugin,BitShiftPlugin:()=>i.BitShiftPlugin,BitwiseLogicOperationsPlugin:()=>a.BitwiseLogicOperationsPlugin,BooleanPlugin:()=>l.BooleanPlugin,CharPlugin:()=>u.CharPlugin,CodePlugin:()=>h.CodePlugin,ComplexPlugin:()=>Y.ComplexPlugin,ConditionalAggregationPlugin:()=>D.ConditionalAggregationPlugin,CountBlankPlugin:()=>c.CountBlankPlugin,CountUniquePlugin:()=>d.CountUniquePlugin,DateTimePlugin:()=>p.DateTimePlugin,DegreesPlugin:()=>g.DegreesPlugin,DeltaPlugin:()=>m.DeltaPlugin,ExpPlugin:()=>f.ExpPlugin,FinancialPlugin:()=>y.FinancialPlugin,FormulaTextPlugin:()=>E.FormulaTextPlugin,HyperlinkPlugin:()=>C.HyperlinkPlugin,InformationPlugin:()=>T.InformationPlugin,IsEvenPlugin:()=>R.IsEvenPlugin,IsOddPlugin:()=>w.IsOddPlugin,LogarithmPlugin:()=>S.LogarithmPlugin,LookupPlugin:()=>U.LookupPlugin,MathConstantsPlugin:()=>v.MathConstantsPlugin,MathPlugin:()=>G.MathPlugin,MatrixPlugin:()=>A.MatrixPlugin,MedianPlugin:()=>N.MedianPlugin,ModuloPlugin:()=>O.ModuloPlugin,NumericAggregationPlugin:()=>M.NumericAggregationPlugin,PowerPlugin:()=>b.PowerPlugin,RadiansPlugin:()=>I.RadiansPlugin,RadixConversionPlugin:()=>_.RadixConversionPlugin,RandomPlugin:()=>x.RandomPlugin,RomanPlugin:()=>V.RomanPlugin,RoundingPlugin:()=>P.RoundingPlugin,SimpleArithmerticPlugin:()=>B.SimpleArithmerticPlugin,SqrtPlugin:()=>L.SqrtPlugin,StatisticalAggregationPlugin:()=>j.StatisticalAggregationPlugin,StatisticalPlugin:()=>W.StatisticalPlugin,SumprodPlugin:()=>F.SumprodPlugin,TextPlugin:()=>k.TextPlugin,TrigonometryPlugin:()=>H.TrigonometryPlugin});var n=r(147),s=r(148),o=r(149),i=r(150),a=r(151),l=r(152),u=r(153),h=r(154),c=r(155),d=r(156),p=r(157),g=r(158),m=r(159),f=r(160),y=r(161),E=r(162),C=r(163),T=r(164),R=r(165),w=r(166),S=r(167),v=r(168),A=r(169),N=r(170),O=r(171),M=r(172),b=r(173),I=r(174),_=r(175),x=r(176),P=r(177),L=r(178),D=r(179),F=r(182),k=r(183),H=r(184),U=r(185),V=r(187),B=r(188),W=r(189),G=r(192),Y=r(193),j=r(194)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressPlugin:()=>l});var n,s=r(8),o=r(94),i=r(3),a=r(61);!function(e){e[e.FullyAbsolute=1]="FullyAbsolute",e[e.RowAbsoluteColRelative=2]="RowAbsoluteColRelative",e[e.RowRelativeColAbsolute=3]="RowRelativeColAbsolute",e[e.FullyRelative=4]="FullyRelative"}(n||(n={}));class l extends o.FunctionPlugin{verifyAddressArguments(e,t,r,s){if(s){if(e<1||t<1)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.LessThanOne)}else if(n.FullyAbsolute==r){if(e<1||t<1)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.LessThanOne)}else if(n.RowAbsoluteColRelative==r){if(e<1)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.LessThanOne)}else if(n.RowRelativeColAbsolute==r&&t<1)return new i.CellError(i.ErrorType.VALUE,a.ErrorMessage.LessThanOne)}address(e,t){return this.runFunction(e.args,t,this.metadata("ADDRESS"),((e,t,r,o,i)=>{const a=this.verifyAddressArguments(e,t,r,o);if(void 0!==a)return a;const l=(0,s.columnIndexToLabel)(t-1);let u="";null!=i&&(u=`${i}!`);const h=0==t?"C":`C[${t}]`,c=0==e?"R":`R[${e}]`;return n.FullyRelative==r?o?`${u}${l}${e}`:`${u}${c}${h}`:n.RowRelativeColAbsolute==r?o?`${u}$${l}${e}`:`${u}${c}C${t}`:n.RowAbsoluteColRelative==r?o?`${u}${l}$${e}`:`${u}R${e}${h}`:o?`${u}$${l}$${e}`:`${u}R${e}C${t}`}))}}l.implementedFunctions={ADDRESS:{method:"address",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,optionalArg:!0,defaultValue:1,minValue:1,maxValue:4},{argumentType:o.FunctionArgumentType.BOOLEAN,optionalArg:!0,defaultValue:!0},{argumentType:o.FunctionArgumentType.STRING,optionalArg:!0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ArrayPlugin:()=>c});var n=r(1),s=r(3),o=r(61),i=r(7),a=r(95),l=r(93),u=r(69),h=r(94);class c extends h.FunctionPlugin{arrayformula(e,t){return this.runFunction(e.args,t,this.metadata("ARRAYFORMULA"),(e=>e))}arrayformulaArraySize(e,t){if(1!==e.args.length)return n.ArraySize.error();const r=this.metadata("ARRAYFORMULA");return e.args.map((e=>{var n;return this.arraySizeForAst(e,new l.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))}))[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());const n=e.data,s=[];for(let e=0;e<t;e++)s.push(n[e].slice(0,r));return u.SimpleRangeValue.onlyValues(s)}))}arrayconstrainArraySize(e,t){if(3!==e.args.length)return n.ArraySize.error();const r=this.metadata("ARRAY_CONSTRAIN"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new l.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))}));let{height:o,width:a}=s[0];return e.args[1].type===i.AstNodeType.NUMBER&&(o=Math.min(o,e.args[1].value)),e.args[2].type===i.AstNodeType.NUMBER&&(a=Math.min(a,e.args[2].value)),o<1||a<1||!Number.isInteger(o)||!Number.isInteger(a)?n.ArraySize.error():new n.ArraySize(a,o)}filter(e,t){return this.runFunction(e.args,t,this.metadata("FILTER"),((e,...t)=>{for(const r of t)if(e.width()!==r.width()||e.height()!==r.height())return new s.CellError(s.ErrorType.NA,o.ErrorMessage.EqualLength);if(e.width()>1&&e.height()>1)return new s.CellError(s.ErrorType.NA,o.ErrorMessage.WrongDimension);const r=e.data,n=[];for(let s=0;s<e.height();s++){const o=[];for(let n=0;n<e.width();n++){let e=!0;for(const r of t){if(!0!==(0,a.coerceScalarToBoolean)(r.data[s][n])){e=!1;break}}e&&o.push(r[s][n])}o.length>0&&n.push(o)}return n.length>0?u.SimpleRangeValue.onlyValues(n):new s.CellError(s.ErrorType.NA,o.ErrorMessage.EmptyRange)}))}filterArraySize(e,t){if(e.args.length<=1)return n.ArraySize.error();const r=this.metadata("FILTER"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new l.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))})),o=Math.max(...s.map((e=>e.width))),i=Math.max(...s.map((e=>e.height)));return new n.ArraySize(o,i)}}c.implementedFunctions={ARRAYFORMULA:{method:"arrayformula",arraySizeMethod:"arrayformulaArraySize",arrayFunction:!0,parameters:[{argumentType:h.FunctionArgumentType.ANY}]},ARRAY_CONSTRAIN:{method:"arrayconstrain",arraySizeMethod:"arrayconstrainArraySize",parameters:[{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.INTEGER,minValue:1},{argumentType:h.FunctionArgumentType.INTEGER,minValue:1}],vectorizationForbidden:!0},FILTER:{method:"filter",arraySizeMethod:"filterArraySize",arrayFunction:!0,parameters:[{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.RANGE}],repeatLastArgs:1}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbsPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{abs(e,t){return this.runFunction(e.args,t,this.metadata("ABS"),Math.abs)}}s.implementedFunctions={ABS:{method:"abs",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BitShiftPlugin:()=>a});var n=r(3),s=r(61),o=r(94);const i=0xffffffffffff;class a extends o.FunctionPlugin{bitlshift(e,t){return this.runFunction(e.args,t,this.metadata("BITLSHIFT"),l)}bitrshift(e,t){return this.runFunction(e.args,t,this.metadata("BITRSHIFT"),u)}}function l(e,t){return t<0?u(e,-t):h(e*Math.pow(2,t))}function u(e,t){return t<0?l(e,-t):h(Math.floor(e/Math.pow(2,t)))}function h(e){return e>i?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.BitshiftLong):e}a.implementedFunctions={BITLSHIFT:{method:"bitlshift",parameters:[{argumentType:o.FunctionArgumentType.INTEGER,minValue:0},{argumentType:o.FunctionArgumentType.INTEGER,minValue:-53,maxValue:53}]},BITRSHIFT:{method:"bitrshift",parameters:[{argumentType:o.FunctionArgumentType.INTEGER,minValue:0},{argumentType:o.FunctionArgumentType.INTEGER,minValue:-53,maxValue:53}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BitwiseLogicOperationsPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{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))}}s.implementedFunctions={BITAND:{method:"bitand",parameters:[{argumentType:n.FunctionArgumentType.INTEGER,minValue:0},{argumentType:n.FunctionArgumentType.INTEGER,minValue:0}]},BITOR:{method:"bitor",parameters:[{argumentType:n.FunctionArgumentType.INTEGER,minValue:0},{argumentType:n.FunctionArgumentType.INTEGER,minValue:0}]},BITXOR:{method:"bitxor",parameters:[{argumentType:n.FunctionArgumentType.INTEGER,minValue:0},{argumentType:n.FunctionArgumentType.INTEGER,minValue:0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BooleanPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{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 n.CellError(n.ErrorType.NA,s.ErrorMessage.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=>void 0!==e)).forEach((e=>{e&&t++})),t%2==1}))}switch(e,t){return this.runFunction(e.args,t,this.metadata("SWITCH"),((e,...t)=>{const r=t.length;let o=0;for(;o+1<r;o+=2)if(!(t[o]instanceof n.CellError)&&this.arithmeticHelper.eq(e,t[o]))return t[o+1];return o<r?t[o]:new n.CellError(n.ErrorType.NA,s.ErrorMessage.NoDefault)}))}iferror(e,t){return this.runFunction(e.args,t,this.metadata("IFERROR"),((e,t)=>e instanceof n.CellError?t:e))}ifna(e,t){return this.runFunction(e.args,t,this.metadata("IFNA"),((e,t)=>e instanceof n.CellError&&e.type===n.ErrorType.NA?t:e))}choose(e,t){return this.runFunction(e.args,t,this.metadata("CHOOSE"),((e,...t)=>e>t.length?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.Selector):t[e-1]))}}i.implementedFunctions={TRUE:{method:"literalTrue",parameters:[]},FALSE:{method:"literalFalse",parameters:[]},IF:{method:"conditionalIf",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:o.FunctionArgumentType.SCALAR,defaultValue:!1,passSubtype:!0}]},IFS:{method:"ifs",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:2},AND:{method:"and",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},OR:{method:"or",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},XOR:{method:"xor",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},NOT:{method:"not",parameters:[{argumentType:o.FunctionArgumentType.BOOLEAN}]},SWITCH:{method:"switch",parameters:[{argumentType:o.FunctionArgumentType.NOERROR},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:1},IFERROR:{method:"iferror",parameters:[{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}]},IFNA:{method:"ifna",parameters:[{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}]},CHOOSE:{method:"choose",parameters:[{argumentType:o.FunctionArgumentType.INTEGER,minValue:1},{argumentType:o.FunctionArgumentType.SCALAR,passSubtype:!0}],repeatLastArgs:1}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CharPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{char(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),(e=>e<1||e>=256?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.CharacterCodeBounds):String.fromCharCode(Math.trunc(e))))}unichar(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),(e=>e<1||e>=1114112?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.CharacterCodeBounds):String.fromCodePoint(Math.trunc(e))))}}i.implementedFunctions={CHAR:{method:"char",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},UNICHAR:{method:"unichar",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CodePlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{code(e,t){return this.runFunction(e.args,t,this.metadata("CODE"),(e=>0===e.length?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.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 n.CellError(n.ErrorType.VALUE,s.ErrorMessage.EmptyString)}))}}i.implementedFunctions={CODE:{method:"code",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},UNICODE:{method:"unicode",parameters:[{argumentType:o.FunctionArgumentType.STRING}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CountBlankPlugin:()=>o});var n=r(70),s=r(94);class o extends s.FunctionPlugin{countblank(e,t){return this.runFunction(e.args,t,this.metadata("COUNTBLANK"),((...e)=>{let t=0;return e.forEach((e=>{e===n.EmptyValue&&t++})),t}))}}o.implementedFunctions={COUNTBLANK:{method:"countblank",parameters:[{argumentType:s.FunctionArgumentType.SCALAR}],repeatLastArgs:1,expandRanges:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CountUniquePlugin:()=>o});var n=r(3),s=r(94);class o extends s.FunctionPlugin{countunique(e,t){return this.runFunction(e.args,t,this.metadata("COUNTUNIQUE"),((...e)=>{const t=new Set,r=new Set;for(const s of e)s instanceof n.CellError?r.add(s.type):""!==s&&t.add(s);return t.size+r.size}))}}o.implementedFunctions={COUNTUNIQUE:{method:"countunique",parameters:[{argumentType:s.FunctionArgumentType.SCALAR}],repeatLastArgs:1,expandRanges:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DateTimePlugin:()=>u});var n=r(3),s=r(102),o=r(61),i=r(104),a=r(70),l=r(94);class u extends l.FunctionPlugin{constructor(){super(...arguments),this.isoweeknumCore=e=>{const t=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),r=this.dateTimeHelper.numberToSimpleDate(e),n=this.dateTimeHelper.dateToNumber({year:r.year,month:1,day:1}),s=this.dateTimeHelper.relativeNumberToAbsoluteNumber(n),o=s+((4-s)%7+7)%7,i=Math.floor((t-1)/7)-Math.floor((o-1)/7)+1;return 0===i?this.isoweeknumCore(e-7)+1:i},this.days360Core=(e,t,r)=>{const n=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);let i,a;return r?(i=(0,s.toBasisEU)(n),a=(0,s.toBasisEU)(o)):[i,a]=this.dateTimeHelper.toBasisUS(n,o),360*(a.year-i.year)+30*(a.month-i.month)+a.day-i.day}}date(e,t){return this.runFunction(e.args,t,this.metadata("DATE"),((e,t,r)=>{const s=Math.trunc(r);let i=Math.trunc(t),a=Math.trunc(e);a<this.dateTimeHelper.getEpochYearZero()&&(a+=this.dateTimeHelper.getEpochYearZero());const l=Math.floor((i-1)/12);a+=l,i-=12*l;const u={year:a,month:i,day:1};if(this.dateTimeHelper.isValidDate(u)){let e=this.dateTimeHelper.dateToNumber(u)+(s-1);return e=this.dateTimeHelper.getWithinBounds(e),void 0===e?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.DateBounds):e}return new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.InvalidDate)}))}time(e,t){return this.runFunction(e.args,t,this.metadata("TIME"),((e,t,r)=>{const i=(0,s.timeToNumber)({hours:Math.trunc(e),minutes:Math.trunc(t),seconds:Math.trunc(r)});return i<0?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.NegativeTime):i%1}))}eomonth(e,t){return this.runFunction(e.args,t,this.metadata("EOMONTH"),((e,t)=>{const r=this.dateTimeHelper.numberToSimpleDate(e);let i=this.dateTimeHelper.dateToNumber(this.dateTimeHelper.endOfMonth((0,s.offsetMonth)(r,t)));return i=this.dateTimeHelper.getWithinBounds(i),void 0===i?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.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,s.numberToSimpleTime)((0,s.roundToNearestSecond)(e)%1).hours))}minute(e,t){return this.runFunction(e.args,t,this.metadata("MINUTE"),(e=>(0,s.numberToSimpleTime)((0,s.roundToNearestSecond)(e)%1).minutes))}second(e,t){return this.runFunction(e.args,t,this.metadata("SECOND"),(e=>(0,s.numberToSimpleTime)((0,s.roundToNearestSecond)(e)%1).seconds))}text(e,t){return this.runFunction(e.args,t,this.metadata("TEXT"),((e,t)=>(0,i.format)(e,t,this.config,this.dateTimeHelper)))}weekday(e,t){return this.runFunction(e.args,t,this.metadata("WEEKDAY"),((e,t)=>{const r=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));if(3===t)return(r-1)%7;const s=d.get(t);return void 0===s?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.BadMode):(r-s)%7+1}))}weeknum(e,t){return this.runFunction(e.args,t,this.metadata("WEEKNUM"),((e,t)=>{const r=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),s=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.dateToNumber({year:s.year,month:1,day:1}),a=this.dateTimeHelper.relativeNumberToAbsoluteNumber(i);if(21===t)return this.isoweeknumCore(e);const l=d.get(t);return void 0===l?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.BadMode):Math.floor((r-l)/7)-Math.floor((a-l)/7)+1}))}isoweeknum(e,t){return this.runFunction(e.args,t,this.metadata("ISOWEEKNUM"),this.isoweeknumCore)}datevalue(e,t){return this.runFunction(e.args,t,this.metadata("DATEVALUE"),(e=>{const{dateTime:t}=this.dateTimeHelper.parseDateTimeFromConfigFormats(e);return void 0===t?new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.IncorrectDateTime):(0,s.instanceOfSimpleDate)(t)?((0,s.instanceOfSimpleTime)(t)?Math.trunc((0,s.timeToNumber)(t)):0)+this.dateTimeHelper.dateToNumber(t):0}))}timevalue(e,t){return this.runFunction(e.args,t,this.metadata("TIMEVALUE"),(e=>{const t=this.dateTimeHelper.dateStringToDateNumber(e);return void 0===t?new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.IncorrectDateTime):(0,a.getRawValue)(t)%1}))}now(e,t){return this.runFunction(e.args,t,this.metadata("NOW"),(()=>{const e=new Date(Date.now());return(0,s.timeToNumber)({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"),(()=>{const 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)=>{const r=this.dateTimeHelper.numberToSimpleDate(e),i=(0,s.truncateDayInMonth)((0,s.offsetMonth)(r,t));let a=this.dateTimeHelper.dateToNumber(i);return a=this.dateTimeHelper.getWithinBounds(a),void 0===a?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.DateBounds):a}))}datedif(e,t){return this.runFunction(e.args,t,this.metadata("DATEDIF"),((e,t,r)=>{if(e>t)return new n.CellError(n.ErrorType.NUM,o.ErrorMessage.StartEndDate);if("D"===r)return Math.floor(t)-Math.floor(e);const s=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);switch(r){case"M":return 12*(i.year-s.year)+(i.month-s.month)-(i.day<s.day?1:0);case"YM":return(i.month-s.month+12-(i.day<s.day?1:0))%12;case"Y":return i.month>s.month||i.month===s.month&&i.day>=s.day?i.year-s.year:i.year-s.year-1;case"MD":if(i.day>=s.day)return i.day-s.day;{const e=1===i.month?12:i.month-1,t=1===i.month?i.year-1:i.year;return this.dateTimeHelper.daysInMonth(t,e)+i.day-s.day}case"YD":return i.month>s.month||i.month===s.month&&i.day>=s.day?Math.floor(t)-this.dateTimeHelper.dateToNumber({year:i.year,month:s.month,day:s.day}):Math.floor(t)-Math.floor(e)-365*(i.year-s.year-1)-this.dateTimeHelper.leapYearsCount(i.year-1)+this.dateTimeHelper.leapYearsCount(s.year);default:return new n.CellError(n.ErrorType.NUM,o.ErrorMessage.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 new Error("Should not be reachable.")}))}interval(e,t){return this.runFunction(e.args,t,this.metadata("INTERVAL"),(e=>{const t=(e=Math.trunc(e))%60,r=(e=Math.trunc(e/60))%60,n=(e=Math.trunc(e/60))%24,s=(e=Math.trunc(e/24))%30,o=(e=Math.trunc(e/30))%12,i=Math.trunc(e/12);return"P"+(i>0?`${i}Y`:"")+(o>0?`${o}M`:"")+(s>0?`${s}D`:"")+"T"+(n>0?`${n}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,n)=>this.networkdayscore(e,t,r,n)))}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,n)=>this.workdaycore(e,t,r,n)))}networkdayscore(e,t,r,s){let o=1;(e=Math.trunc(e))>(t=Math.trunc(t))&&([e,t]=[t,e],o=-1);const i=c(r);if(i instanceof n.CellError)return i;const a=this.simpleRangeToFilteredHolidays(i,s);return a instanceof n.CellError?a:o*this.countWorkdays(e,t,i,a)}workdaycore(e,t,r,s){e=Math.trunc(e),t=Math.trunc(t);const o=c(r);if(o instanceof n.CellError)return o;const i=this.simpleRangeToFilteredHolidays(o,s);if(i instanceof n.CellError)return i;if(t>0){let r=1;for(;this.countWorkdays(e+1,e+r,o,i)<t;)r*=2;let n=1;for(;n+1<r;){const s=Math.trunc((n+r)/2);this.countWorkdays(e+1,e+s,o,i)<t?n=s:r=s}return e+r}if(t<0){t*=-1;let r=1;for(;this.countWorkdays(e-r,e-1,o,i)<t;)r*=2;let n=1;for(;n+1<r;){const s=Math.trunc((n+r)/2);this.countWorkdays(e-s,e-1,o,i)<t?n=s:r=s}return e-r}return e}countWorkdays(e,t,r,n){const s=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(t)),o=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));let i=0;for(let e=0;e<7;e++)"0"===r.charAt(e)&&(i+=Math.floor((s+6-e)/7),i-=Math.floor((o-1+6-e)/7));return i-=h(t+1,n)-h(e,n),i}simpleRangeToFilteredHolidays(e,t){var r;const s=null!==(r=null==t?void 0:t.valuesFromTopLeftCorner())&&void 0!==r?r:[];for(const e of s)if(e instanceof n.CellError)return e;const i=[];for(const e of s)if(e!==a.EmptyValue){if(!(0,a.isExtendedNumber)(e))return new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.WrongType);i.push(Math.trunc((0,a.getRawValue)(e)))}return[...new Set(i)].sort(((e,t)=>e-t)).filter((t=>{const r=(this.dateTimeHelper.relativeNumberToAbsoluteNumber(t)-1)%7;return"0"===e.charAt(r)}))}}function h(e,t){if(0===t.length)return 0;if(e<=t[0])return 0;if(t[t.length-1]<e)return t.length;let r=0,n=t.length-1;for(;r+1<n;){const s=Math.floor((n+r)/2);t[s]>=e?n=s:r=s}return n}function c(e){var t;return"number"!=typeof e&&"string"!=typeof e?new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.WrongType):"string"==typeof e?7===e.length&&/^(0|1)*$/.test(e)&&"1111111"!==e?e:new n.CellError(n.ErrorType.NUM,o.ErrorMessage.WeekendString):null!==(t=p.get(e))&&void 0!==t?t:new n.CellError(n.ErrorType.NUM,o.ErrorMessage.BadMode)}u.implementedFunctions={DATE:{method:"date",parameters:[{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER}],returnNumberType:a.NumberType.NUMBER_DATE},TIME:{method:"time",parameters:[{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NUMBER}],returnNumberType:a.NumberType.NUMBER_TIME},MONTH:{method:"month",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},YEAR:{method:"year",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},HOUR:{method:"hour",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},MINUTE:{method:"minute",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},SECOND:{method:"second",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},TEXT:{method:"text",parameters:[{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.STRING}]},EOMONTH:{method:"eomonth",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER}],returnNumberType:a.NumberType.NUMBER_DATE},DAY:{method:"day",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},DAYS:{method:"days",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},WEEKDAY:{method:"weekday",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,defaultValue:1}]},WEEKNUM:{method:"weeknum",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,defaultValue:1}]},ISOWEEKNUM:{method:"isoweeknum",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},DATEVALUE:{method:"datevalue",parameters:[{argumentType:l.FunctionArgumentType.STRING}],returnNumberType:a.NumberType.NUMBER_DATE},TIMEVALUE:{method:"timevalue",parameters:[{argumentType:l.FunctionArgumentType.STRING}],returnNumberType:a.NumberType.NUMBER_TIME},NOW:{method:"now",parameters:[],isVolatile:!0,returnNumberType:a.NumberType.NUMBER_DATETIME},TODAY:{method:"today",parameters:[],isVolatile:!0,returnNumberType:a.NumberType.NUMBER_DATE},EDATE:{method:"edate",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER}],returnNumberType:a.NumberType.NUMBER_DATE},DAYS360:{method:"days360",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.BOOLEAN,defaultValue:!1}]},DATEDIF:{method:"datedif",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.STRING}]},YEARFRAC:{method:"yearfrac",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.INTEGER,defaultValue:0,minValue:0,maxValue:4}]},INTERVAL:{method:"interval",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0}]},NETWORKDAYS:{method:"networkdays",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.RANGE,optionalArg:!0}]},"NETWORKDAYS.INTL":{method:"networkdaysintl",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NOERROR,defaultValue:1},{argumentType:l.FunctionArgumentType.RANGE,optionalArg:!0}]},WORKDAY:{method:"workday",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.RANGE,optionalArg:!0}]},"WORKDAY.INTL":{method:"workdayintl",parameters:[{argumentType:l.FunctionArgumentType.NUMBER,minValue:0},{argumentType:l.FunctionArgumentType.NUMBER},{argumentType:l.FunctionArgumentType.NOERROR,defaultValue:1},{argumentType:l.FunctionArgumentType.RANGE,optionalArg:!0}]}};const d=new Map([[1,0],[2,1],[11,1],[12,2],[13,3],[14,4],[15,5],[16,6],[17,0]]),p=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"]])},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DegreesPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{degrees(e,t){return this.runFunction(e.args,t,this.metadata("DEGREES"),(e=>e*(180/Math.PI)))}}s.implementedFunctions={DEGREES:{method:"degrees",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeltaPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{delta(e,t){return this.runFunction(e.args,t,this.metadata("DELTA"),((e,t)=>e===t?1:0))}}s.implementedFunctions={DELTA:{method:"delta",parameters:[{argumentType:n.FunctionArgumentType.NUMBER},{argumentType:n.FunctionArgumentType.NUMBER,defaultValue:0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ExpPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{exp(e,t){return this.runFunction(e.args,t,this.metadata("EXP"),Math.exp)}}s.implementedFunctions={EXP:{method:"exp",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FinancialPlugin:()=>a});var n=r(3),s=r(61),o=r(70),i=r(94);class a extends i.FunctionPlugin{pmt(e,t){return this.runFunction(e.args,t,this.metadata("PMT"),l)}ipmt(e,t){return this.runFunction(e.args,t,this.metadata("IPMT"),u)}ppmt(e,t){return this.runFunction(e.args,t,this.metadata("PPMT"),c)}fv(e,t){return this.runFunction(e.args,t,this.metadata("FV"),h)}cumipmt(e,t){return this.runFunction(e.args,t,this.metadata("CUMIPMT"),((e,t,r,o,i,a)=>{if(o>i)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.EndStartPeriod);let l=0;for(let n=o;n<=i;n++)l+=u(e,n,t,r,0,a);return l}))}cumprinc(e,t){return this.runFunction(e.args,t,this.metadata("CUMPRINC"),((e,t,r,o,i,a)=>{if(o>i)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.EndStartPeriod);let l=0;for(let n=o;n<=i;n++)l+=c(e,n,t,r,0,a);return l}))}db(e,t){return this.runFunction(e.args,t,this.metadata("DB"),((e,t,r,o,i)=>{if(12===i&&o>r||o>r+1)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.PeriodLong);if(t>=e)return 0;const a=Math.round(1e3*(1-Math.pow(t/e,1/r)))/1e3,l=e*a*i/12;if(1===o)return l;let u=l;for(let t=0;t<o-2;t++)u+=(e-u)*a;return o===r+1?(e-u)*a*(12-i)/12:(e-u)*a}))}ddb(e,t){return this.runFunction(e.args,t,this.metadata("DDB"),((e,t,r,s,o)=>{if(s>r)return new n.CellError(n.ErrorType.NUM);let i,a=o/r;a>=1?(a=1,i=1===s?e:0):i=e*Math.pow(1-a,s-1);const l=e*Math.pow(1-a,s);return Math.max(i-Math.max(t,l),0)}))}dollarde(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARDE"),((e,t)=>{if(t<1)return new n.CellError(n.ErrorType.DIV_BY_ZERO);for(t=Math.trunc(t);t>10;)t/=10;return Math.trunc(e)+10*(e-Math.trunc(e))/t}))}dollarfr(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARFR"),((e,t)=>{if(t<1)return new n.CellError(n.ErrorType.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)=>(t=Math.trunc(t),Math.pow(1+e/t,t)-1)))}ispmt(e,t){return this.runFunction(e.args,t,this.metadata("ISPMT"),((e,t,r,s)=>0===r?new n.CellError(n.ErrorType.DIV_BY_ZERO):s*e*(t/r-1)))}nominal(e,t){return this.runFunction(e.args,t,this.metadata("NOMINAL"),((e,t)=>(t=Math.trunc(t),(Math.pow(e+1,1/t)-1)*t)))}nper(e,t){return this.runFunction(e.args,t,this.metadata("NPER"),((e,t,r,s,o)=>0===e?0===t?new n.CellError(n.ErrorType.DIV_BY_ZERO):(-r-s)/t:(o&&(t*=1+e),Math.log((t-s*e)/(r*e+t))/Math.log(1+e))))}rate(e,t){return this.runFunction(e.args,t,this.metadata("RATE"),((e,t,r,s,o,i)=>{if(i<=-1)return new n.CellError(n.ErrorType.VALUE);const a=1e-7;let l=i;o=o?1:0;for(let i=0;i<50;i++){if(l<=-1)return new n.CellError(n.ErrorType.NUM);let i,u;if(Math.abs(l)<a)i=r*(1+e*l)+t*(1+l*o)*e+s;else{const n=Math.pow(1+l,e);i=r*n+t*(1/l+o)*(n-1)+s}if(Math.abs(i)<a)return l;if(Math.abs(l)<a)u=r*e+t*o*e;else{const n=Math.pow(1+l,e),s=e*Math.pow(1+l,e-1);u=r*s+t*(1/l+o)*s+t*(-1/(l*l))*(n-1)}l-=i/u}return new n.CellError(n.ErrorType.NUM)}))}pv(e,t){return this.runFunction(e.args,t,this.metadata("PV"),((e,t,r,s,o)=>(o=o?1:0,-1===e?0===t?new n.CellError(n.ErrorType.NUM):new n.CellError(n.ErrorType.DIV_BY_ZERO):0===e?-r*t-s:((1-Math.pow(1+e,t))*r*(1+e*o)/e-s)/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 n.CellError(n.ErrorType.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 n.CellError(n.ErrorType.DIV_BY_ZERO):(e-t)/r))}syd(e,t){return this.runFunction(e.args,t,this.metadata("SYD"),((e,t,r,s)=>s>r?new n.CellError(n.ErrorType.NUM):(e-t)*(r-s+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 n.CellError(n.ErrorType.NUM);const s=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);if(o.year>s.year+1||o.year===s.year+1&&(o.month>s.month||o.month===s.month&&o.day>s.day))return new n.CellError(n.ErrorType.NUM);const i=360-r*(t-e);return 0===i?0:i<0?new n.CellError(n.ErrorType.NUM):365*r/i}))}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 n.CellError(n.ErrorType.NUM);const s=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);if(o.year>s.year+1||o.year===s.year+1&&(o.month>s.month||o.month===s.month&&o.day>s.day))return new n.CellError(n.ErrorType.NUM);const i=360-r*(t-e);return 0===i?0:i<0?new n.CellError(n.ErrorType.NUM):100*(1-r*(t-e)/360)}))}tbillyield(e,t){return this.runFunction(e.args,t,this.metadata("TBILLYIELD"),((e,t,r)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new n.CellError(n.ErrorType.NUM);const s=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);return o.year>s.year+1||o.year===s.year+1&&(o.month>s.month||o.month===s.month&&o.day>s.day)?new n.CellError(n.ErrorType.NUM):360*(100-r)/(r*(t-e))}))}fvschedule(e,t){return this.runFunction(e.args,t,this.metadata("FVSCHEDULE"),((e,t)=>{const r=t.valuesFromTopLeftCorner();for(const e of r)if(e instanceof n.CellError)return e;for(const t of r)if((0,o.isExtendedNumber)(t))e*=1+(0,o.getRawValue)(t);else if(t!==o.EmptyValue)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NumberExpected);return e}))}npv(e,t){return this.runFunction(e.args,t,this.metadata("NPV"),((e,...t)=>{const r=this.arithmeticHelper.coerceNumbersExactRanges(t);return r instanceof n.CellError?r:d(e,r)}))}mirr(e,t){return this.runFunction(e.args,t,this.metadata("MIRR"),((e,t,r)=>{const s=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(s instanceof n.CellError)return s;let o=!1,i=!1;const a=[],l=[];for(const e of s)e>0?(o=!0,a.push(e),l.push(0)):e<0?(i=!0,l.push(e),a.push(0)):(l.push(0),a.push(0));if(!o||!i)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const u=s.length,h=d(r,a);if(h instanceof n.CellError)return h;const c=d(t,l);return c instanceof n.CellError?c:Math.pow(-h*Math.pow(1+r,u)/c/(1+t),1/(u-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)=>{const o=t.valuesFromTopLeftCorner();for(const e of o)if("number"!=typeof e)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NumberExpected);const i=o,a=r.valuesFromTopLeftCorner();for(const e of a)if("number"!=typeof e)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NumberExpected);const l=a;if(l.length!==i.length)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.EqualLength);const u=l.length;let h=0;if(l[0]<0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);for(let t=0;t<u;t++){if(l[t]=Math.floor(l[t]),l[t]<l[0])return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);h+=i[t]/Math.pow(1+e,(l[t]-l[0])/365)}return h}))}}function l(e,t,r,n,s){if(0===e)return(-r-n)/t;{const o=Math.pow(1+e,t);return(n*e+r*e*o)*(s?1/(1+e):1)/(1-o)}}function u(e,t,r,n,s,o){const i=l(e,r,n,s,o);return 1===t?e*(o?0:-n):e*(o?h(e,t-2,i,n,o)-i:h(e,t-1,i,n,o))}function h(e,t,r,n,s){if(0===e)return-n-r*t;{const o=Math.pow(1+e,t);return r*(s?1+e:1)*(1-o)/e-n*o}}function c(e,t,r,n,s,o){return l(e,r,n,s,o)-u(e,t,r,n,s,o)}function d(e,t){let r=0;for(let s=t.length-1;s>=0;s--){if(r+=t[s],-1===e){if(0===r)continue;return new n.CellError(n.ErrorType.DIV_BY_ZERO)}r/=1+e}return r}a.implementedFunctions={PMT:{method:"pmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},IPMT:{method:"ipmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},PPMT:{method:"ppmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},FV:{method:"fv",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},CUMIPMT:{method:"cumipmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0,maxValue:1}],returnNumberType:o.NumberType.NUMBER_CURRENCY},CUMPRINC:{method:"cumprinc",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0,maxValue:1}],returnNumberType:o.NumberType.NUMBER_CURRENCY},DB:{method:"db",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:1,maxValue:12,defaultValue:12}],returnNumberType:o.NumberType.NUMBER_CURRENCY},DDB:{method:"ddb",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.INTEGER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0,defaultValue:2}],returnNumberType:o.NumberType.NUMBER_CURRENCY},DOLLARDE:{method:"dollarde",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0}]},DOLLARFR:{method:"dollarfr",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0}]},EFFECT:{method:"effect",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:1}],returnNumberType:o.NumberType.NUMBER_PERCENT},ISPMT:{method:"ispmt",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}]},NOMINAL:{method:"nominal",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:1}],returnNumberType:o.NumberType.NUMBER_PERCENT},NPER:{method:"nper",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}]},PV:{method:"pv",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},RATE:{method:"rate",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:i.FunctionArgumentType.NUMBER,defaultValue:.1}],returnNumberType:o.NumberType.NUMBER_PERCENT},RRI:{method:"rri",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}],returnNumberType:o.NumberType.NUMBER_PERCENT},SLN:{method:"sln",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}],returnNumberType:o.NumberType.NUMBER_CURRENCY},SYD:{method:"syd",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},TBILLEQ:{method:"tbilleq",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}],returnNumberType:o.NumberType.NUMBER_PERCENT},TBILLPRICE:{method:"tbillprice",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}],returnNumberType:o.NumberType.NUMBER_CURRENCY},TBILLYIELD:{method:"tbillyield",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}],returnNumberType:o.NumberType.NUMBER_PERCENT},FVSCHEDULE:{method:"fvschedule",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.RANGE}],returnNumberType:o.NumberType.NUMBER_CURRENCY},NPV:{method:"npv",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1,returnNumberType:o.NumberType.NUMBER_CURRENCY},MIRR:{method:"mirr",parameters:[{argumentType:i.FunctionArgumentType.RANGE},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER}],returnNumberType:o.NumberType.NUMBER_PERCENT},PDURATION:{method:"pduration",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:0}]},XNPV:{method:"xnpv",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,greaterThan:-1},{argumentType:i.FunctionArgumentType.RANGE},{argumentType:i.FunctionArgumentType.RANGE}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FormulaTextPlugin:()=>a});var n=r(3),s=r(61),o=r(145),i=r(94);class a extends o.FunctionPlugin{formulatext(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("FORMULATEXT"),(()=>new n.CellError(n.ErrorType.NA,s.ErrorMessage.WrongArgNumber)),(e=>{var t;return null!==(t=this.serialization.getCellFormula(e))&&void 0!==t?t:new n.CellError(n.ErrorType.NA,s.ErrorMessage.Formula)}))}}a.implementedFunctions={FORMULATEXT:{method:"formulatext",parameters:[{argumentType:i.FunctionArgumentType.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,isDependentOnSheetStructureChange:!0,vectorizationForbidden:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{HyperlinkPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{hyperlink(e,t){return this.runFunction(e.args,t,this.metadata("HYPERLINK"),((t,r)=>(e.hyperlink=t,null!=r?r:t)))}}s.implementedFunctions={HYPERLINK:{method:"hyperlink",parameters:[{argumentType:n.FunctionArgumentType.STRING},{argumentType:n.FunctionArgumentType.STRING,optionalArg:!0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{InformationPlugin:()=>h});var n=r(3),s=r(80),o=r(61),i=r(7),a=r(70),l=r(69),u=r(94);class h extends u.FunctionPlugin{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 n.CellError&&e.type!==n.ErrorType.NA))}iserror(e,t){return this.runFunction(e.args,t,this.metadata("ISERROR"),(e=>e instanceof n.CellError))}isformula(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ISFORMULA"),(()=>new n.CellError(n.ErrorType.NA,o.ErrorMessage.WrongArgNumber)),(e=>this.dependencyGraph.addressMapping.getCell(e)instanceof s.FormulaVertex))}isblank(e,t){return this.runFunction(e.args,t,this.metadata("ISBLANK"),(e=>e===a.EmptyValue))}isna(e,t){return this.runFunction(e.args,t,this.metadata("ISNA"),(e=>e instanceof n.CellError&&e.type==n.ErrorType.NA))}isnumber(e,t){return this.runFunction(e.args,t,this.metadata("ISNUMBER"),a.isExtendedNumber)}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 n.CellError&&(e.type==n.ErrorType.REF||e.type==n.ErrorType.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 n.CellError(n.ErrorType.NA,o.ErrorMessage.WrongArgNumber);if(e.args.some((e=>e.type===i.AstNodeType.EMPTY)))return new n.CellError(n.ErrorType.NUM,o.ErrorMessage.EmptyArg);let r=e.args[0];for(;r.type===i.AstNodeType.PARENTHESIS;)r=r.expression;if(r.type===i.AstNodeType.CELL_RANGE||r.type===i.AstNodeType.COLUMN_RANGE)return r.end.col-r.start.col+1;if(r.type===i.AstNodeType.CELL_REFERENCE)return 1;if(r.type===i.AstNodeType.ROW_RANGE)return this.config.maxColumns;{const e=this.evaluateAst(r,t);return e instanceof l.SimpleRangeValue?e.width():e instanceof n.CellError?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 n.CellError(n.ErrorType.NA,o.ErrorMessage.WrongArgNumber);if(e.args.some((e=>e.type===i.AstNodeType.EMPTY)))return new n.CellError(n.ErrorType.NUM,o.ErrorMessage.EmptyArg);let r=e.args[0];for(;r.type===i.AstNodeType.PARENTHESIS;)r=r.expression;if(r.type===i.AstNodeType.CELL_RANGE||r.type===i.AstNodeType.ROW_RANGE)return r.end.row-r.start.row+1;if(r.type===i.AstNodeType.CELL_REFERENCE)return 1;if(r.type===i.AstNodeType.COLUMN_RANGE)return this.config.maxRows;{const e=this.evaluateAst(r,t);return e instanceof l.SimpleRangeValue?e.height():e instanceof n.CellError?e:1}}index(e,t){return this.runFunction(e.args,t,this.metadata("INDEX"),((e,t,r)=>{var s,i,a,l,u,h;return r<1||t<1?new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.LessThanOne):r>e.width()||t>e.height()?new n.CellError(n.ErrorType.NUM,o.ErrorMessage.ValueLarge):null!==(h=null!==(a=null===(i=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s[t-1])||void 0===i?void 0:i[r-1])&&void 0!==a?a:null===(u=null===(l=null==e?void 0:e.data)||void 0===l?void 0:l[0])||void 0===u?void 0:u[0])&&void 0!==h?h:new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.CellRangeExpected)}))}na(e,t){return new n.CellError(n.ErrorType.NA)}sheet(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEET"),(()=>t.formulaAddress.sheet+1),(e=>e.sheet+1),(e=>{const t=this.dependencyGraph.sheetMapping.get(e);return void 0!==t?t+1:new n.CellError(n.ErrorType.NA,o.ErrorMessage.SheetRef)}))}sheets(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEETS"),(()=>this.dependencyGraph.sheetMapping.numberOfSheets()),(()=>1),(()=>new n.CellError(n.ErrorType.VALUE,o.ErrorMessage.CellRefExpected)))}}h.implementedFunctions={COLUMN:{method:"column",parameters:[{argumentType:u.FunctionArgumentType.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},COLUMNS:{method:"columns",parameters:[{argumentType:u.FunctionArgumentType.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISBINARY:{method:"isbinary",parameters:[{argumentType:u.FunctionArgumentType.STRING}]},ISERR:{method:"iserr",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISFORMULA:{method:"isformula",parameters:[{argumentType:u.FunctionArgumentType.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISNA:{method:"isna",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISREF:{method:"isref",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}],vectorizationForbidden:!0},ISERROR:{method:"iserror",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISBLANK:{method:"isblank",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISNUMBER:{method:"isnumber",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISLOGICAL:{method:"islogical",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISTEXT:{method:"istext",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},ISNONTEXT:{method:"isnontext",parameters:[{argumentType:u.FunctionArgumentType.SCALAR}]},INDEX:{method:"index",parameters:[{argumentType:u.FunctionArgumentType.RANGE},{argumentType:u.FunctionArgumentType.NUMBER},{argumentType:u.FunctionArgumentType.NUMBER,defaultValue:1}]},NA:{method:"na",parameters:[]},ROW:{method:"row",parameters:[{argumentType:u.FunctionArgumentType.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ROWS:{method:"rows",parameters:[{argumentType:u.FunctionArgumentType.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEET:{method:"sheet",parameters:[{argumentType:u.FunctionArgumentType.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEETS:{method:"sheets",parameters:[{argumentType:u.FunctionArgumentType.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{IsEvenPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{iseven(e,t){return this.runFunction(e.args,t,this.metadata("ISEVEN"),(e=>e%2==0))}}s.implementedFunctions={ISEVEN:{method:"iseven",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{IsOddPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{isodd(e,t){return this.runFunction(e.args,t,this.metadata("ISODD"),(e=>e%2==1))}}s.implementedFunctions={ISODD:{method:"isodd",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LogarithmPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{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)}}s.implementedFunctions={LOG10:{method:"log10",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]},LOG:{method:"log",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:n.FunctionArgumentType.NUMBER,defaultValue:10,greaterThan:0}]},LN:{method:"ln",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{MathConstantsPlugin:()=>o,PI:()=>s});var n=r(94);const s=parseFloat(Math.PI.toFixed(14));class o extends n.FunctionPlugin{pi(e,t){return this.runFunction(e.args,t,this.metadata("PI"),(()=>s))}sqrtpi(e,t){return this.runFunction(e.args,t,this.metadata("SQRTPI"),(e=>Math.sqrt(s*e)))}}o.implementedFunctions={PI:{method:"pi",parameters:[]},SQRTPI:{method:"sqrtpi",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,minValue:0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{MatrixPlugin:()=>d});var n=r(1),s=r(3),o=r(61),i=r(7),a=r(93),l=r(69),u=r(94);function h(e,t){return new n.ArraySize(t.width,e.height)}function c(e,t,r){return new n.ArraySize(1+(e.width-t)/r,1+(e.height-t)/r)}class d extends u.FunctionPlugin{mmult(e,t){return this.runFunction(e.args,t,this.metadata("MMULT"),((e,t)=>{if(!e.hasOnlyNumbers()||!t.hasOnlyNumbers())return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.NumberRange);if(t.height()!==e.width())return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.ArrayDimensions);const r=h(e.size,t.size),n=this.createKernel((function(e,t,r){let n=0;for(let s=0;s<r;++s)n+=e[this.thread.y][s]*t[s][this.thread.x];return n}),r)(e.rawNumbers(),t.rawNumbers(),e.width());return l.SimpleRangeValue.onlyNumbers(n)}))}mmultArraySize(e,t){if(2!==e.args.length)return n.ArraySize.error();const r=this.metadata("MMULT"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new a.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))})),[o,i]=s;return h(o,i)}maxpool(e,t){return this.runFunction(e.args,t,this.metadata("MAXPOOL"),((e,t,r=t)=>{if(!e.hasOnlyNumbers())return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.NumberRange);const n=c(e.size,t,r),i=this.createKernel((function(e,t,r){const n=this.thread.x*r,s=this.thread.y*r;let o=e[s][n];for(let r=0;r<t;r++)for(let i=0;i<t;i++)o=Math.max(o,e[s+r][n+i]);return o}),n)(e.rawNumbers(),t,r);return l.SimpleRangeValue.onlyNumbers(i)}))}medianpool(e,t){return this.runFunction(e.args,t,this.metadata("MEDIANPOOL"),((e,t,r=t)=>{if(!e.hasOnlyNumbers())return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.NumberRange);const n=c(e.size,t,r),i=this.createKernel((function(e,t,r){const n=this.thread.x*r,s=this.thread.y*r;let o=e[s][n];for(let r=0;r<t;r++)for(let i=0;i<t;i++)o=Math.max(o,e[s+r][n+i]);let i=e[s][n];for(let r=0;r<t;r++)for(let o=0;o<t;o++)i=Math.min(i,e[s+r][n+o]);const a=t*t;let l=i,u=o,h=42;for(let r=0;r<32;r++){const r=(l+u)/2;let o=0;for(let i=0;i<t;i++)for(let a=0;a<t;a++)e[s+i][n+a]>r&&o++;if(t%2==0){if(o===a/2){h=r;break}o>a/2?l=r:u=r}else{if(o===(a-1)/2){h=r;break}o>(a-1)/2?l=r:u=r}}return h}),n)(e.rawNumbers(),t,r);return l.SimpleRangeValue.onlyNumbers(i)}))}maxpoolArraySize(e,t){if(e.args.length<2||e.args.length>3)return n.ArraySize.error();const r=this.metadata("MAXPOOL"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new a.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))}))[0],o=e.args[1];let l;l=o.type===i.AstNodeType.NUMBER?o.value:1;let u=l;if(3===e.args.length){const t=e.args[2];u=t.type===i.AstNodeType.NUMBER?t.value:1}return l>s.width||l>s.height||u>l||(s.width-l)%u!=0||(s.height-l)%u!=0?n.ArraySize.error():c(s,l,u)}medianpoolArraySize(e,t){return this.maxpoolArraySize(e,t)}transpose(e,t){return this.runFunction(e.args,t,this.metadata("TRANSPOSE"),(e=>{const t=e.rawData(),r=e.size,n=[];for(let e=0;e<r.width;++e){n[e]=[];for(let s=0;s<r.height;++s)n[e][s]=t[s][e]}return l.SimpleRangeValue.onlyValues(n)}))}transposeArraySize(e,t){if(1!==e.args.length)return n.ArraySize.error();const r=this.metadata("MMULT"),s=e.args.map((e=>{var n;return this.arraySizeForAst(e,new a.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))})),[o]=s;return new n.ArraySize(o.height,o.width)}createKernel(e,t){return function(...r){const n=[];for(let s=0;s<t.height;++s){n.push([]);for(let o=0;o<t.width;++o)n[s][o]=e.apply({thread:{x:o,y:s}},r)}return n}}}d.implementedFunctions={MMULT:{method:"mmult",arraySizeMethod:"mmultArraySize",parameters:[{argumentType:u.FunctionArgumentType.RANGE},{argumentType:u.FunctionArgumentType.RANGE}],vectorizationForbidden:!0},TRANSPOSE:{method:"transpose",arraySizeMethod:"transposeArraySize",parameters:[{argumentType:u.FunctionArgumentType.RANGE}],vectorizationForbidden:!0},MAXPOOL:{method:"maxpool",arraySizeMethod:"maxpoolArraySize",parameters:[{argumentType:u.FunctionArgumentType.RANGE},{argumentType:u.FunctionArgumentType.NUMBER},{argumentType:u.FunctionArgumentType.NUMBER,optionalArg:!0}],vectorizationForbidden:!0},MEDIANPOOL:{method:"medianpool",arraySizeMethod:"medianpoolArraySize",parameters:[{argumentType:u.FunctionArgumentType.RANGE},{argumentType:u.FunctionArgumentType.NUMBER},{argumentType:u.FunctionArgumentType.NUMBER,optionalArg:!0}],vectorizationForbidden:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{MedianPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{median(e,t){return this.runFunction(e.args,t,this.metadata("MEDIAN"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof n.CellError?t:0===t.length?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.OneValue):(t.sort(((e,t)=>e-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)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return r instanceof n.CellError?r:(r.sort(((e,t)=>e-t)),(t=Math.trunc(t))>r.length?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):r[r.length-t])}))}small(e,t){return this.runFunction(e.args,t,this.metadata("SMALL"),((e,t)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return r instanceof n.CellError?r:(r.sort(((e,t)=>e-t)),(t=Math.trunc(t))>r.length?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):r[t-1])}))}}i.implementedFunctions={MEDIAN:{method:"median",parameters:[{argumentType:o.FunctionArgumentType.ANY}],repeatLastArgs:1},LARGE:{method:"large",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.NUMBER,minValue:1}]},SMALL:{method:"small",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.NUMBER,minValue:1}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ModuloPlugin:()=>o});var n=r(3),s=r(94);class o extends s.FunctionPlugin{mod(e,t){return this.runFunction(e.args,t,this.metadata("MOD"),((e,t)=>0===t?new n.CellError(n.ErrorType.DIV_BY_ZERO):e%t))}}o.implementedFunctions={MOD:{method:"mod",parameters:[{argumentType:s.FunctionArgumentType.NUMBER},{argumentType:s.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{NumericAggregationPlugin:()=>g});var n=r(2),s=r(3),o=r(61),i=r(77),a=r(7),l=r(95),u=r(70),h=r(69),c=r(94);function d(e){return(0,u.isExtendedNumber)(e)&&!Number.isFinite((0,u.getRawValue)(e))?0:e}class p{constructor(e,t,r){this.sumsq=e,this.sum=t,this.count=r}static single(e){return new p(e*e,e,1)}compose(e){return new p(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}}p.empty=new p(0,0,0);class g extends c.FunctionPlugin{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,u.getRawValue)(e),2)),m)}max(e,t){return this.doMax(e.args,t)}maxa(e,t){return d(this.reduce(e.args,t,Number.NEGATIVE_INFINITY,"MAXA",((e,t)=>Math.max(e,t)),u.getRawValue,f))}min(e,t){return this.doMin(e.args,t)}mina(e,t){return d(this.reduce(e.args,t,Number.POSITIVE_INFINITY,"MINA",((e,t)=>Math.min(e,t)),u.getRawValue,f))}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;const n=this.reduce(e.args,t,p.empty,"_AGGREGATE_A",((e,t)=>e.compose(t)),(e=>p.single((0,u.getRawValue)(e))),f);return n instanceof s.CellError?n:null!==(r=n.averageValue())&&void 0!==r?r:new s.CellError(s.ErrorType.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;const n=this.reduceAggregateA(e.args,t);return n instanceof s.CellError?n:null!==(r=n.varSValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}varpa(e,t){var r;const n=this.reduceAggregateA(e.args,t);return n instanceof s.CellError?n:null!==(r=n.varPValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}stdevs(e,t){return this.doStdevS(e.args,t)}stdevp(e,t){return this.doStdevP(e.args,t)}stdeva(e,t){const r=this.reduceAggregateA(e.args,t);if(r instanceof s.CellError)return r;{const e=r.varSValue();return void 0===e?new s.CellError(s.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}stdevpa(e,t){const r=this.reduceAggregateA(e.args,t);if(r instanceof s.CellError)return r;{const e=r.varPValue();return void 0===e?new s.CellError(s.ErrorType.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 s.CellError(s.ErrorType.NA,o.ErrorMessage.WrongArgNumber);const r=this.coerceToType(this.evaluateAst(e.args[0],t),{argumentType:c.FunctionArgumentType.NUMBER},t),n=e.args.slice(1);switch(r){case 1:case 101:return this.doAverage(n,t);case 2:case 102:return this.doCount(n,t);case 3:case 103:return this.doCounta(n,t);case 4:case 104:return this.doMax(n,t);case 5:case 105:return this.doMin(n,t);case 6:case 106:return this.doProduct(n,t);case 7:case 107:return this.doStdevS(n,t);case 8:case 108:return this.doStdevP(n,t);case 9:case 109:return this.doSum(n,t);case 10:case 110:return this.doVarS(n,t);case 11:case 111:return this.doVarP(n,t);default:return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.BadMode)}}reduceAggregate(e,t){return this.reduce(e,t,p.empty,"_AGGREGATE",((e,t)=>e.compose(t)),(e=>p.single((0,u.getRawValue)(e))),m)}reduceAggregateA(e,t){return this.reduce(e,t,p.empty,"_AGGREGATE_A",((e,t)=>e.compose(t)),(e=>p.single((0,u.getRawValue)(e))),f)}doAverage(e,t){var r;const n=this.reduceAggregate(e,t);return n instanceof s.CellError?n:null!==(r=n.averageValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}doVarS(e,t){var r;const n=this.reduceAggregate(e,t);return n instanceof s.CellError?n:null!==(r=n.varSValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}doVarP(e,t){var r;const n=this.reduceAggregate(e,t);return n instanceof s.CellError?n:null!==(r=n.varPValue())&&void 0!==r?r:new s.CellError(s.ErrorType.DIV_BY_ZERO)}doStdevS(e,t){const r=this.reduceAggregate(e,t);if(r instanceof s.CellError)return r;{const e=r.varSValue();return void 0===e?new s.CellError(s.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}doStdevP(e,t){const r=this.reduceAggregate(e,t);if(r instanceof s.CellError)return r;{const e=r.varPValue();return void 0===e?new s.CellError(s.ErrorType.DIV_BY_ZERO):Math.sqrt(e)}}doCount(e,t){return this.reduce(e,t,0,"COUNT",((e,t)=>e+t),u.getRawValue,(e=>(0,u.isExtendedNumber)(e)?1:0))}doCounta(e,t){return this.reduce(e,t,0,"COUNTA",((e,t)=>e+t),u.getRawValue,(e=>e===u.EmptyValue?0:1))}doMax(e,t){return d(this.reduce(e,t,Number.NEGATIVE_INFINITY,"MAX",((e,t)=>Math.max(e,t)),u.getRawValue,m))}doMin(e,t){return d(this.reduce(e,t,Number.POSITIVE_INFINITY,"MIN",((e,t)=>Math.min(e,t)),u.getRawValue,m))}doSum(e,t){return this.reduce(e,t,0,"SUM",this.addWithEpsilonRaw,u.getRawValue,m)}doProduct(e,t){return this.reduce(e,t,1,"PRODUCT",((e,t)=>e*t),u.getRawValue,m)}reduce(e,t,r,n,i,l,u){return e.length<1?new s.CellError(s.ErrorType.NA,o.ErrorMessage.WrongArgNumber):e.reduce(((e,o)=>{if(e instanceof s.CellError)return e;if(o.type===a.AstNodeType.CELL_RANGE||o.type===a.AstNodeType.COLUMN_RANGE||o.type===a.AstNodeType.ROW_RANGE){const a=this.evaluateRange(o,t,r,n,i,l,u);return a instanceof s.CellError?a:i(a,e)}let c;if(c=this.evaluateAst(o,t),c instanceof h.SimpleRangeValue){const t=Array.from(c.valuesFromTopLeftCorner()).map(u).filter((e=>void 0!==e));return t.map((e=>e instanceof s.CellError?e:l(e))).reduce(((e,t)=>e instanceof s.CellError?e:t instanceof s.CellError?t:i(e,t)),e)}if(o.type===a.AstNodeType.CELL_REFERENCE){if(c=u(c),void 0===c)return e}else if(c=this.coerceScalarToNumberOrError(c),c=u(c),void 0===c)return e;return c instanceof s.CellError?c:i(e,l(c))}),r)}evaluateRange(e,t,r,a,l,u,h){let c;try{c=n.AbsoluteCellRange.fromAst(e,t.formulaAddress)}catch(e){if(e instanceof i.SheetsNotEqual)return new s.CellError(s.ErrorType.REF,o.ErrorMessage.RangeManySheets);throw e}const d=this.dependencyGraph.getRange(c.start,c.end);if(void 0===d)throw new Error("Range does not exists in graph");let p=d.getFunctionValue(a);if(void 0===p){p=this.getRangeValues(a,c,d,u,h).reduce(((e,t)=>e instanceof s.CellError?e:t instanceof s.CellError?t:l(e,t)),r),d.setFunctionValue(a,p)}return p}getRangeValues(e,t,r,n,o){const i=[],{smallerRangeVertex:a,restRange:l}=this.dependencyGraph.rangeMapping.findSmallerRange(t);let u;if(void 0!==a&&this.dependencyGraph.existsEdge(a,r)){const t=a.getFunctionValue(e);if(void 0!==t)i.push(t);else for(const e of a.range.addresses(this.dependencyGraph)){const t=o(this.dependencyGraph.getScalarValue(e));t instanceof s.CellError?i.push(t):void 0!==t&&i.push(n(t))}u=l}else u=t;for(const e of u.addresses(this.dependencyGraph)){const t=o(this.dependencyGraph.getScalarValue(e));t instanceof s.CellError?i.push(t):void 0!==t&&i.push(n(t))}return i}}function m(e){return(0,u.isExtendedNumber)(e)||e instanceof s.CellError?e:void 0}function f(e){return"boolean"==typeof e?(0,l.coerceBooleanToNumber)(e):(0,u.isExtendedNumber)(e)||e instanceof s.CellError?e:"string"==typeof e?0:void 0}g.implementedFunctions={SUM:{method:"sum",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},SUMSQ:{method:"sumsq",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},MAX:{method:"max",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},MIN:{method:"min",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},MAXA:{method:"maxa",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},MINA:{method:"mina",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},COUNT:{method:"count",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},COUNTA:{method:"counta",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},AVERAGE:{method:"average",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},AVERAGEA:{method:"averagea",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},PRODUCT:{method:"product",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},"VAR.S":{method:"vars",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},"VAR.P":{method:"varp",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},VARA:{method:"vara",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},VARPA:{method:"varpa",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},"STDEV.S":{method:"stdevs",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},"STDEV.P":{method:"stdevp",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},STDEVA:{method:"stdeva",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},STDEVPA:{method:"stdevpa",parameters:[{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1},SUBTOTAL:{method:"subtotal",parameters:[{argumentType:c.FunctionArgumentType.NUMBER},{argumentType:c.FunctionArgumentType.ANY}],repeatLastArgs:1}},g.aliases={VAR:"VAR.S",VARP:"VAR.P",STDEV:"STDEV.S",STDEVP:"STDEV.P",VARS:"VAR.S",STDEVS:"STDEV.S"}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{PowerPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{power(e,t){return this.runFunction(e.args,t,this.metadata("POWER"),Math.pow)}}s.implementedFunctions={POWER:{method:"power",parameters:[{argumentType:n.FunctionArgumentType.NUMBER},{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RadiansPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{radians(e,t){return this.runFunction(e.args,t,this.metadata("RADIANS"),(e=>e*(Math.PI/180)))}}s.implementedFunctions={RADIANS:{method:"radians",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RadixConversionPlugin:()=>l});var n=r(3),s=r(61),o=r(104),i=r(94);const a=10;class l extends i.FunctionPlugin{dec2bin(e,t){return this.runFunction(e.args,t,this.metadata("DEC2BIN"),((e,t)=>h(e,2,t)))}dec2oct(e,t){return this.runFunction(e.args,t,this.metadata("DEC2OCT"),((e,t)=>h(e,8,t)))}dec2hex(e,t){return this.runFunction(e.args,t,this.metadata("DEC2HEX"),((e,t)=>h(e,16,t)))}bin2dec(e,t){return this.runFunction(e.args,t,this.metadata("BIN2DEC"),(e=>{const t=u(e,2,a);return void 0===t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotBinary):g(t,2)}))}bin2oct(e,t){return this.runFunction(e.args,t,this.metadata("BIN2OCT"),((e,t)=>{const r=u(e,2,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotBinary):h(g(r,2),8,t)}))}bin2hex(e,t){return this.runFunction(e.args,t,this.metadata("BIN2HEX"),((e,t)=>{const r=u(e,2,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotBinary):h(g(r,2),16,t)}))}oct2dec(e,t){return this.runFunction(e.args,t,this.metadata("OCT2DEC"),(e=>{const t=u(e,8,a);return void 0===t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotOctal):g(t,8)}))}oct2bin(e,t){return this.runFunction(e.args,t,this.metadata("OCT2BIN"),((e,t)=>{const r=u(e,8,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotOctal):h(g(r,8),2,t)}))}oct2hex(e,t){return this.runFunction(e.args,t,this.metadata("OCT2HEX"),((e,t)=>{const r=u(e,8,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotOctal):h(g(r,8),16,t)}))}hex2dec(e,t){return this.runFunction(e.args,t,this.metadata("HEX2DEC"),(e=>{const t=u(e,16,a);return void 0===t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotHex):g(t,16)}))}hex2bin(e,t){return this.runFunction(e.args,t,this.metadata("HEX2BIN"),((e,t)=>{const r=u(e,16,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotHex):h(g(r,16),2,t)}))}hex2oct(e,t){return this.runFunction(e.args,t,this.metadata("HEX2OCT"),((e,t)=>{const r=u(e,16,a);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotHex):h(g(r,16),8,t)}))}base(e,t){return this.runFunction(e.args,t,this.metadata("BASE"),d)}decimal(e,t){return this.runFunction(e.args,t,this.metadata("DECIMAL"),((e,t)=>{const r=u(e,t,255);return void 0===r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NotHex):parseInt(r,t)}))}}function u(e,t,r){const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".substr(0,t),s=new RegExp(`^[${n}]+$`);if(!(e.length>r)&&s.test(e))return e}function h(e,t,r){if(e>function(e){return-c(e)-1}(t))return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueBaseLarge);if(e<c(t))return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueBaseSmall);const i=p(e,t);return void 0===r||e<0?i:i.length>r?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueBaseLong):(0,o.padLeft)(i,r)}function c(e){return-Math.pow(e,a)/2}function d(e,t,r){const n=p(e,t);return void 0!==r&&r>n.length?(0,o.padLeft)(n,r):n}function p(e,t){return(e+(e<0?Math.pow(t,a):0)).toString(t).toUpperCase()}function g(e,t){const r=parseInt(e,t),n=Math.pow(t,a);return r>=n/2?r-n:r}l.implementedFunctions={DEC2BIN:{method:"dec2bin",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2OCT:{method:"dec2oct",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2HEX:{method:"dec2hex",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},BIN2DEC:{method:"bin2dec",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},BIN2OCT:{method:"bin2oct",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},BIN2HEX:{method:"bin2hex",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},OCT2DEC:{method:"oct2dec",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},OCT2BIN:{method:"oct2bin",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},OCT2HEX:{method:"oct2hex",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},HEX2DEC:{method:"hex2dec",parameters:[{argumentType:i.FunctionArgumentType.STRING}]},HEX2BIN:{method:"hex2bin",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},HEX2OCT:{method:"hex2oct",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:a}]},DECIMAL:{method:"decimal",parameters:[{argumentType:i.FunctionArgumentType.STRING},{argumentType:i.FunctionArgumentType.NUMBER,minValue:2,maxValue:36}]},BASE:{method:"base",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:0},{argumentType:i.FunctionArgumentType.NUMBER,minValue:2,maxValue:36},{argumentType:i.FunctionArgumentType.NUMBER,optionalArg:!0,minValue:0,maxValue:255}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RandomPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{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 n.CellError(n.ErrorType.NUM,s.ErrorMessage.WrongOrder):((e=Math.ceil(e))===(t=Math.floor(t)+1)&&(t+=1),e+Math.floor(Math.random()*(t-e)))))}}i.implementedFunctions={RAND:{method:"rand",parameters:[],isVolatile:!0},RANDBETWEEN:{method:"randbetween",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}],isVolatile:!0}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RoundingPlugin:()=>l,findNextEvenNumber:()=>a,findNextOddNumber:()=>i});var n=r(3),s=r(61),o=r(94);function i(e){const t=Math.ceil(e);return t%2==1?t:t+1}function a(e){const t=Math.ceil(e);return t%2==0?t:t+1}class l extends o.FunctionPlugin{roundup(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),((e,t)=>{const 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)=>{const 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)=>{const 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?-a(-e):a(e)))}odd(e,t){return this.runFunction(e.args,t,this.metadata("ODD"),(e=>e<0?-i(-e):i(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"),((e,t)=>0===e?0:0===t?new n.CellError(n.ErrorType.DIV_BY_ZERO):e>0&&t<0?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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:(t=Math.abs(t),Math.ceil(e/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 n.CellError(n.ErrorType.DIV_BY_ZERO):e>0&&t<0?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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:(t=Math.abs(t),Math.floor(e/t)*t)))}}l.implementedFunctions={ROUNDUP:{method:"roundup",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},ROUNDDOWN:{method:"rounddown",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},ROUND:{method:"round",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},INT:{method:"intFunc",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},EVEN:{method:"even",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ODD:{method:"odd",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},"CEILING.MATH":{method:"ceilingmath",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},CEILING:{method:"ceiling",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},"CEILING.PRECISE":{method:"ceilingprecise",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},"FLOOR.MATH":{method:"floormath",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:0}]},FLOOR:{method:"floor",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},"FLOOR.PRECISE":{method:"floorprecise",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]}},l.aliases={"ISO.CEILING":"CEILING.PRECISE",TRUNC:"ROUNDDOWN"}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SqrtPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{sqrt(e,t){return this.runFunction(e.args,t,this.metadata("SQRT"),Math.sqrt)}}s.implementedFunctions={SQRT:{method:"sqrt",parameters:[{argumentType:n.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ConditionalAggregationPlugin:()=>c});var n=r(3),s=r(61),o=r(180),i=r(70),a=r(94);class l{constructor(e,t){this.sum=e,this.count=t}static single(e){return new l(e,1)}compose(e){return new l(this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}}function u(e){return(0,i.isExtendedNumber)(e)&&!Number.isFinite((0,i.getRawValue)(e))?0:e}function h(e){return e instanceof n.CellError?e:(0,i.isExtendedNumber)(e)?(0,i.getRawValue)(e):void 0}l.empty=new l(0,0);class c extends a.FunctionPlugin{sumif(e,t){const r="SUMIF";return this.runFunction(e.args,t,this.metadata(r),((e,t,n)=>this.computeConditionalAggregationFunction(null!=n?n:e,[e,t],r,0,((e,t)=>this.arithmeticHelper.nonstrictadd(e,t)),h)))}sumifs(e,t){const 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)),h)))}averageif(e,t){const r="AVERAGEIF";return this.runFunction(e.args,t,this.metadata(r),((e,t,s)=>{const o=this.computeConditionalAggregationFunction(null!=s?s:e,[e,t],r,l.empty,((e,t)=>e.compose(t)),(e=>(0,i.isExtendedNumber)(e)?l.single((0,i.getRawValue)(e)):l.empty));return o instanceof n.CellError?o:o.averageValue()||new n.CellError(n.ErrorType.DIV_BY_ZERO)}))}countif(e,t){const 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){const 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){const r="MINIFS",n=(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)=>u(this.computeConditionalAggregationFunction(e,t,r,Number.POSITIVE_INFINITY,n,h))))}maxifs(e,t){const r="MAXIFS",n=(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)=>u(this.computeConditionalAggregationFunction(e,t,r,Number.NEGATIVE_INFINITY,n,h))))}computeConditionalAggregationFunction(e,t,r,i,a,l){const u=[];for(let e=0;e<t.length;e+=2){const r=t[e],i=this.interpreter.criterionBuilder.fromCellValue(t[e+1],this.arithmeticHelper);if(void 0===i)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.BadCriterion);u.push(new o.Condition(r,i))}return new o.CriterionFunctionCompute(this.interpreter,function(e){return t=>{const r=t.map((e=>`${e.conditionRange.range.sheet},${e.conditionRange.range.start.col},${e.conditionRange.range.start.row}`));return[e,...r].join(",")}}(r),i,a,l).compute(e,u)}}c.implementedFunctions={SUMIF:{method:"sumif",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR},{argumentType:a.FunctionArgumentType.RANGE,optionalArg:!0}]},COUNTIF:{method:"countif",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}]},AVERAGEIF:{method:"averageif",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR},{argumentType:a.FunctionArgumentType.RANGE,optionalArg:!0}]},SUMIFS:{method:"sumifs",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}],repeatLastArgs:2},COUNTIFS:{method:"countifs",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}],repeatLastArgs:2},MINIFS:{method:"minifs",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}],repeatLastArgs:2},MAXIFS:{method:"maxifs",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NOERROR}],repeatLastArgs:2}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Condition:()=>l,CriterionFunctionCompute:()=>a});var n=r(3),s=r(61),o=r(181),i=r(70);class a{constructor(e,t,r,n,s){this.interpreter=e,this.cacheKey=t,this.reduceInitialValue=r,this.composeFunction=n,this.mapFunction=s,this.dependencyGraph=this.interpreter.dependencyGraph}compute(e,t){for(const r of t)if(!r.conditionRange.sameDimensionsAs(e))return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.EqualLength);const r=this.tryToGetRangeVertexForRangeValue(e),o=t.map((e=>this.tryToGetRangeVertexForRangeValue(e.conditionRange)));if(r&&o.every((e=>void 0!==e))){const n=t.map((e=>e.criterionPackage.raw)).join(","),s=this.findAlreadyComputedValueInCache(r,this.cacheKey(t),n);if(void 0!==s)return this.interpreter.stats.incrementCriterionFunctionFullCacheUsed(),s;const i=this.buildNewCriterionCache(this.cacheKey(t),t.map((e=>e.conditionRange.range)),e.range);return i.has(n)||i.set(n,[this.evaluateRangeValue(e,t),t.map((e=>e.criterionPackage.lambda))]),r.setCriterionFunctionValues(this.cacheKey(t),i),o.forEach((e=>{void 0!==e&&e.addDependentCacheRange(r)})),i.get(n)[0]}return this.evaluateRangeValue(e,t)}tryToGetRangeVertexForRangeValue(e){const t=e.range;return void 0===t?void 0:this.dependencyGraph.getRange(t.start,t.end)}reduceFunction(e){let t=this.reduceInitialValue;for(const r of e)t=this.composeFunction(t,r);return t}findAlreadyComputedValueInCache(e,t,r){return e.getCriterionFunctionValue(t,r)}evaluateRangeValue(e,t){const r=t.map((e=>e.criterionPackage.lambda)),n=Array.from(e.valuesFromTopLeftCorner()).map(this.mapFunction)[Symbol.iterator](),s=h(r,t.map((e=>e.conditionRange.iterateValuesFromTopLeftCorner())),n);return this.reduceFunction(s)}buildNewCriterionCache(e,t,r){const s=this.dependencyGraph.getRange(r.start,r.end),{smallerRangeVertex:o,restConditionRanges:i,restValuesRange:a}=((e,t,r)=>{if(r.end.row>r.start.row){const s=(0,n.simpleCellAddress)(r.end.sheet,r.end.col,r.end.row-1),o=e.getRange(r.start,s);if(void 0!==o)return{smallerRangeVertex:o,restValuesRange:r.withStart((0,n.simpleCellAddress)(r.start.sheet,r.start.col,r.end.row)),restConditionRanges:t.map((e=>e.withStart((0,n.simpleCellAddress)(e.start.sheet,e.start.col,e.end.row))))}}return{restValuesRange:r,restConditionRanges:t}})(this.dependencyGraph,t,r);let l;l=void 0!==o&&this.dependencyGraph.existsEdge(o,s)?o.getCriterionFunctionValues(e):new Map;const c=new Map;return l.forEach((([e,t],r)=>{const n=h(t,i.map((e=>u(this.dependencyGraph,e))),Array.from(u(this.dependencyGraph,a)).map(this.mapFunction)[Symbol.iterator]()),s=this.composeFunction(e,this.reduceFunction(n));this.interpreter.stats.incrementCriterionFunctionPartialCacheUsed(),c.set(r,[s,t])})),c}}class l{constructor(e,t){this.conditionRange=e,this.criterionPackage=t}}function*u(e,t){for(const r of t.addresses(e))yield(0,i.getRawValue)(e.getScalarValue(r))}function*h(e,t,r){for(const n of r){const r=t.map((e=>(0,o.split)(e)));if(!r.every((e=>Object.prototype.hasOwnProperty.call(e,"value"))))return;c(r.map((e=>(0,i.getRawValue)(e.value))),e).every((([e,t])=>t(e)))&&(yield n),t=r.map((e=>e.rest))}}function c(e,t){const r=[];for(let n=0;n<Math.min(e.length,t.length);n++)r.push([e[n],t[n]]);return r}},(e,t,r)=>{"use strict";function*n(){}function s(e){const t=e[Symbol.iterator](),{done:r,value:s}=t.next();return r?{rest:n()}:{value:s,rest:t}}function o(e){const t=e[Symbol.iterator](),{done:r,value:n}=t.next();if(!r)return n}r.r(t),r.d(t,{empty:()=>n,first:()=>o,split:()=>s})},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SumprodPlugin:()=>a});var n=r(3),s=r(61),o=r(70),i=r(94);class a extends i.FunctionPlugin{sumproduct(e,t){return this.runFunction(e.args,t,this.metadata("SUMPRODUCT"),((...e)=>{const t=e[0].width(),r=e[0].height();for(const o of e)if(o.width()!==t||o.height()!==r)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.EqualLength);let i=0;const a=e.map((e=>e.iterateValuesFromTopLeftCorner()));for(let e=0;e<t*r;e++){let e=1;for(const t of a){const r=t.next().value;if(r instanceof n.CellError)return r;const s=this.coerceScalarToNumberOrError(r);(0,o.isExtendedNumber)(s)?e*=(0,o.getRawValue)(s):e=0}i+=e}return i}))}}a.implementedFunctions={SUMPRODUCT:{method:"sumproduct",parameters:[{argumentType:i.FunctionArgumentType.RANGE}],repeatLastArgs:1}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TextPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{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)=>{const r=e.split(" ");return t>=r.length||t<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.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," ")))}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 n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeCount):e.repeat(t)))}right(e,t){return this.runFunction(e.args,t,this.metadata("RIGHT"),((e,t)=>t<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeLength):0===t?"":e.slice(-t)))}left(e,t){return this.runFunction(e.args,t,this.metadata("LEFT"),((e,t)=>t<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeLength):e.slice(0,t)))}mid(e,t){return this.runFunction(e.args,t,this.metadata("MID"),((e,t,r)=>t<1?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.LessThanOne):r<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeLength):e.substring(t-1,t+r-1)))}replace(e,t){return this.runFunction(e.args,t,this.metadata("REPLACE"),((e,t,r,o)=>t<1?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.LessThanOne):r<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.NegativeLength):e.substring(0,t-1)+o+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 n.CellError(n.ErrorType.VALUE,s.ErrorMessage.LengthBounds);const o=e.toLowerCase(),i=t.substring(r-1).toLowerCase(),a=this.arithmeticHelper.requiresRegex(o)?this.arithmeticHelper.searchString(o,i):i.indexOf(o);return a>-1?a+r:new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.PatternNotFound)}))}substitute(e,t){return this.runFunction(e.args,t,this.metadata("SUBSTITUTE"),((e,t,r,o)=>{const i=new RegExp(t,"g");if(void 0===o)return e.replace(i,r);if(o<1)return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.LessThanOne);let a,l=0;for(;null!==(a=i.exec(e));)if(o===++l)return e.substring(0,a.index)+r+e.substring(i.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 n.CellError(n.ErrorType.VALUE,s.ErrorMessage.IndexBounds);const o=t.substring(r-1).indexOf(e)+r;return o>0?o:new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.PatternNotFound)}))}t(e,t){return this.runFunction(e.args,t,this.metadata("T"),(e=>e instanceof n.CellError||"string"==typeof e?e:""))}upper(e,t){return this.runFunction(e.args,t,this.metadata("UPPER"),(e=>e.toUpperCase()))}}i.implementedFunctions={CONCATENATE:{method:"concatenate",parameters:[{argumentType:o.FunctionArgumentType.STRING}],repeatLastArgs:1,expandRanges:!0},EXACT:{method:"exact",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING}]},SPLIT:{method:"split",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER}]},LEN:{method:"len",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},LOWER:{method:"lower",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},MID:{method:"mid",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},TRIM:{method:"trim",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},T:{method:"t",parameters:[{argumentType:o.FunctionArgumentType.SCALAR}]},PROPER:{method:"proper",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},CLEAN:{method:"clean",parameters:[{argumentType:o.FunctionArgumentType.STRING}]},REPT:{method:"rept",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER}]},RIGHT:{method:"right",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},LEFT:{method:"left",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},REPLACE:{method:"replace",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.STRING}]},SEARCH:{method:"search",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},SUBSTITUTE:{method:"substitute",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,optionalArg:!0}]},FIND:{method:"find",parameters:[{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.STRING},{argumentType:o.FunctionArgumentType.NUMBER,defaultValue:1}]},UPPER:{method:"upper",parameters:[{argumentType:o.FunctionArgumentType.STRING}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{TrigonometryPlugin:()=>a});var n=r(3),s=r(61),o=r(94),i=r(168);class a extends o.FunctionPlugin{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 n.CellError(n.ErrorType.DIV_BY_ZERO):Math.atan2(t,e)))}cot(e,t){return this.runFunction(e.args,t,this.metadata("COT"),(e=>0===e?new n.CellError(n.ErrorType.DIV_BY_ZERO):1/Math.tan(e)))}acot(e,t){return this.runFunction(e.args,t,this.metadata("ACOT"),(e=>0===e?i.PI/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 n.CellError(n.ErrorType.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 n.CellError(n.ErrorType.DIV_BY_ZERO):1/Math.tanh(e)))}acoth(e,t){return this.runFunction(e.args,t,this.metadata("ACOTH"),(e=>0===e?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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 n.CellError(n.ErrorType.DIV_BY_ZERO):1/Math.sinh(e)))}}a.implementedFunctions={ACOS:{method:"acos",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ASIN:{method:"asin",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},COS:{method:"cos",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SIN:{method:"sin",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},TAN:{method:"tan",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ATAN:{method:"atan",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ATAN2:{method:"atan2",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},COT:{method:"cot",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SEC:{method:"sec",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},CSC:{method:"csc",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SINH:{method:"sinh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},COSH:{method:"cosh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},TANH:{method:"tanh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},COTH:{method:"coth",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SECH:{method:"sech",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},CSCH:{method:"csch",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ACOT:{method:"acot",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ASINH:{method:"asinh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ACOSH:{method:"acosh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ATANH:{method:"atanh",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},ACOTH:{method:"acoth",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{LookupPlugin:()=>c});var n=r(2),s=r(3),o=r(61),i=r(186),a=r(72),l=r(95),u=r(69),h=r(94);class c extends h.FunctionPlugin{constructor(){super(...arguments),this.rowSearch=new i.RowSearchStrategy(this.dependencyGraph)}vlookup(e,t){return this.runFunction(e.args,t,this.metadata("VLOOKUP"),((e,t,r,n)=>{const i=t.range;return void 0===i?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.WrongType):r<1?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.LessThanOne):r>i.width()?new s.CellError(s.ErrorType.REF,o.ErrorMessage.IndexLarge):this.doVlookup((0,l.zeroIfEmpty)(e),t,r-1,n)}))}hlookup(e,t){return this.runFunction(e.args,t,this.metadata("HLOOKUP"),((e,t,r,n)=>{const i=t.range;return void 0===i?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.WrongType):r<1?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.LessThanOne):r>i.height()?new s.CellError(s.ErrorType.REF,o.ErrorMessage.IndexLarge):this.doHlookup((0,l.zeroIfEmpty)(e),t,r-1,n)}))}match(e,t){return this.runFunction(e.args,t,this.metadata("MATCH"),((e,t,r)=>this.doMatch((0,l.zeroIfEmpty)(e),t,r)))}searchInRange(e,t,r,n){if(!r&&"string"==typeof e&&this.arithmeticHelper.requiresRegex(e))return n.advancedFind(this.arithmeticHelper.eqMatcherFunction(e),t);{const s=r?{ordering:"asc"}:{ordering:"none",matchExactly:!0};return n.find(e,t,s)}}doVlookup(e,t,r,i){this.dependencyGraph.stats.start(a.StatType.VLOOKUP);const l=t.range;let h;h=void 0===l?u.SimpleRangeValue.onlyValues(t.data.map((e=>[e[0]]))):u.SimpleRangeValue.onlyRange(n.AbsoluteCellRange.spanFrom(l.start,1,l.height()),this.dependencyGraph);const c=this.searchInRange(e,h,i,this.columnSearch);if(this.dependencyGraph.stats.end(a.StatType.VLOOKUP),-1===c)return new s.CellError(s.ErrorType.NA,o.ErrorMessage.ValueNotFound);let d;if(void 0===l)d=t.data[c][r];else{const e=(0,s.simpleCellAddress)(l.sheet,l.start.col+r,l.start.row+c);d=this.dependencyGraph.getCellValue(e)}return d instanceof u.SimpleRangeValue?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.WrongType):d}doHlookup(e,t,r,i){const a=t.range;let l;l=void 0===a?u.SimpleRangeValue.onlyValues([t.data[0]]):u.SimpleRangeValue.onlyRange(n.AbsoluteCellRange.spanFrom(a.start,a.width(),1),this.dependencyGraph);const h=this.searchInRange(e,l,i,this.rowSearch);if(-1===h)return new s.CellError(s.ErrorType.NA,o.ErrorMessage.ValueNotFound);let c;if(void 0===a)c=t.data[r][h];else{const e=(0,s.simpleCellAddress)(a.sheet,a.start.col+h,a.start.row+r);c=this.dependencyGraph.getCellValue(e)}return c instanceof u.SimpleRangeValue?new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.WrongType):c}doMatch(e,t,r){if(![-1,0,1].includes(r))return new s.CellError(s.ErrorType.VALUE,o.ErrorMessage.BadMode);if(t.width()>1&&t.height()>1)return new s.CellError(s.ErrorType.NA);const n=0===r?{ordering:"none",matchExactly:!0}:{ordering:-1===r?"desc":"asc"},i=(1===t.width()?this.columnSearch:this.rowSearch).find(e,t,n);return-1===i?new s.CellError(s.ErrorType.NA,o.ErrorMessage.ValueNotFound):i+1}}c.implementedFunctions={VLOOKUP:{method:"vlookup",parameters:[{argumentType:h.FunctionArgumentType.NOERROR},{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.NUMBER},{argumentType:h.FunctionArgumentType.BOOLEAN,defaultValue:!0}]},HLOOKUP:{method:"hlookup",parameters:[{argumentType:h.FunctionArgumentType.NOERROR},{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.NUMBER},{argumentType:h.FunctionArgumentType.BOOLEAN,defaultValue:!0}]},MATCH:{method:"match",parameters:[{argumentType:h.FunctionArgumentType.NOERROR},{argumentType:h.FunctionArgumentType.RANGE},{argumentType:h.FunctionArgumentType.NUMBER,defaultValue:1}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RowSearchStrategy:()=>s});var n=r(136);class s extends n.AdvancedFind{constructor(e){super(e),this.dependencyGraph=e}find(e,t,r){return this.basicFind(e,t,"col",r)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RomanPlugin:()=>a});var n=r(3),s=r(61),o=r(70),i=r(94);class a extends i.FunctionPlugin{roman(e,t){return this.runFunction(e.args,t,this.metadata("ROMAN"),((e,t)=>(e=Math.trunc(e),!1===t?t=4:!0===t&&(t=0),(t=(0,o.getRawValue)(this.coerceScalarToNumberOrError(t)))instanceof n.CellError?t:(t=Math.trunc(t))<0?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.ValueSmall):t>4?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.ValueLarge):function(e,t){const r={val:e%1e3,acc:"M".repeat(Math.floor(e/1e3))};4===t&&(u(r,"IM",999,1e3),u(r,"ID",499,500));t>=3&&(u(r,"VM",995,1e3),u(r,"VD",495,500));t>=2&&(u(r,"XM",990,1e3),u(r,"XD",490,500));t>=1&&(u(r,"LM",950,1e3),u(r,"LD",450,500));u(r,"CM",900,1e3),u(r,"CD",400,500),u(r,"D",500,900),r.acc+="C".repeat(Math.floor(r.val/100)),r.val%=100,t>=2&&(u(r,"IC",99,100),u(r,"IL",49,50));t>=1&&(u(r,"VC",95,100),u(r,"VL",45,50));return u(r,"XC",90,100),u(r,"XL",40,50),u(r,"L",50,90),r.acc+="X".repeat(Math.floor(r.val/10)),r.val%=10,u(r,"IX",9,10),u(r,"IV",4,5),u(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=>{let t=!1;if((e=e.trim().toUpperCase()).startsWith("-")&&(t=!0,""===(e=e.slice(1))))return new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.InvalidRoman);const r={input:e,acc:0};return l(r,{token:"MMM",val:3e3},{token:"MM",val:2e3},{token:"M",val:1e3}),l(r,{token:"IM",val:999},{token:"VM",val:995},{token:"XM",val:990},{token:"LM",val:950},{token:"CM",val:900}),l(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}),l(r,{token:"CCC",val:300},{token:"CC",val:200},{token:"C",val:100}),l(r,{token:"IC",val:99},{token:"VC",val:95},{token:"XC",val:90}),l(r,{token:"L",val:50},{token:"IL",val:49},{token:"VL",val:45},{token:"XL",val:40}),l(r,{token:"XXX",val:30},{token:"XX",val:20},{token:"X",val:10}),l(r,{token:"IX",val:9}),l(r,{token:"V",val:5},{token:"IV",val:4}),l(r,{token:"III",val:3},{token:"II",val:2},{token:"I",val:1}),""!==r.input?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.InvalidRoman):t?-r.acc:r.acc}))}}function l(e,...t){for(const r of t)if(e.input.startsWith(r.token)){e.input=e.input.slice(r.token.length),e.acc+=r.val;break}}function u(e,t,r,n){e.val>=r&&e.val<n&&(e.val-=r,e.acc+=t)}a.implementedFunctions={ROMAN:{method:"roman",parameters:[{argumentType:i.FunctionArgumentType.NUMBER,minValue:1,lessThan:4e3},{argumentType:i.FunctionArgumentType.NOERROR,optionalArg:!0,defaultValue:0}]},ARABIC:{method:"arabic",parameters:[{argumentType:i.FunctionArgumentType.STRING}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{SimpleArithmerticPlugin:()=>s});var n=r(94);class s extends n.FunctionPlugin{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)}}s.implementedFunctions={"HF.ADD":{method:"add",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.CONCAT":{method:"concat",parameters:[{argumentType:n.FunctionArgumentType.STRING,passSubtype:!0},{argumentType:n.FunctionArgumentType.STRING,passSubtype:!0}]},"HF.DIVIDE":{method:"divide",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.EQ":{method:"eq",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.GT":{method:"gt",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.GTE":{method:"gte",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.LT":{method:"lt",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.LTE":{method:"lte",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.MINUS":{method:"minus",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.MULTIPLY":{method:"multiply",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.NE":{method:"ne",parameters:[{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0},{argumentType:n.FunctionArgumentType.NOERROR,passSubtype:!0}]},"HF.POW":{method:"pow",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0},{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UMINUS":{method:"uminus",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UNARY_PERCENT":{method:"upercent",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]},"HF.UPLUS":{method:"uplus",parameters:[{argumentType:n.FunctionArgumentType.NUMBER,passSubtype:!0}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{StatisticalPlugin:()=>l});var n=r(3),s=r(61),o=r(190),i=r(191),a=r(94);class l extends a.FunctionPlugin{erf(e,t){return this.runFunction(e.args,t,this.metadata("ERF"),((e,t)=>void 0===t?(0,i.erf)(e):(0,i.erf)(t)-(0,i.erf)(e)))}erfc(e,t){return this.runFunction(e.args,t,this.metadata("ERFC"),i.erfc)}expondist(e,t){return this.runFunction(e.args,t,this.metadata("EXPON.DIST"),((e,t,r)=>r?i.exponential.cdf(e,t):i.exponential.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"),i.gammafn)}gammadist(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.DIST"),((e,t,r,n)=>n?i.gamma.cdf(e,t,r):i.gamma.pdf(e,t,r)))}gammaln(e,t){return this.runFunction(e.args,t,this.metadata("GAMMALN"),i.gammaln)}gammainv(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.INV"),i.gamma.inv)}gauss(e,t){return this.runFunction(e.args,t,this.metadata("GAUSS"),(e=>i.normal.cdf(e,0,1)-.5))}betadist(e,t){return this.runFunction(e.args,t,this.metadata("BETA.DIST"),((e,t,r,o,a,l)=>e<=a?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall):e>=l?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):(e=(e-a)/(l-a),o?i.beta.cdf(e,t,r):i.beta.pdf(e,t,r))))}betainv(e,t){return this.runFunction(e.args,t,this.metadata("BETA.INV"),((e,t,r,o,a)=>o>=a?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.WrongOrder):i.beta.inv(e,t,r)*(a-o)+o))}binomialdist(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.DIST"),((e,t,r,o)=>e>t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.WrongOrder):(e=Math.trunc(e),t=Math.trunc(t),o?i.binomial.cdf(e,t,r):i.binomial.pdf(e,t,r))))}binomialinv(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.INV"),((e,t,r)=>{let n=-1,s=e=Math.trunc(e);for(;s>n+1;){const o=Math.trunc((n+s)/2);i.binomial.cdf(o,e,t)>=r?s=o:n=o}return s}))}besselifn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELI"),((e,t)=>(0,o.besseli)(e,Math.trunc(t))))}besseljfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELJ"),((e,t)=>(0,o.besselj)(e,Math.trunc(t))))}besselkfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELK"),((e,t)=>(0,o.besselk)(e,Math.trunc(t))))}besselyfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELY"),((e,t)=>(0,o.bessely)(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?i.chisquare.cdf(e,t):i.chisquare.pdf(e,t))))}chisqdistrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST.RT"),((e,t)=>1-i.chisquare.cdf(e,Math.trunc(t))))}chisqinv(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV"),((e,t)=>i.chisquare.inv(e,Math.trunc(t))))}chisqinvrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV.RT"),((e,t)=>i.chisquare.inv(1-e,Math.trunc(t))))}fdist(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST"),((e,t,r,n)=>(t=Math.trunc(t),r=Math.trunc(r),n?i.centralF.cdf(e,t,r):i.centralF.pdf(e,t,r))))}fdistrt(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST.RT"),((e,t,r)=>1-i.centralF.cdf(e,Math.trunc(t),Math.trunc(r))))}finv(e,t){return this.runFunction(e.args,t,this.metadata("F.INV"),((e,t,r)=>i.centralF.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)=>i.centralF.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,n)=>n?i.weibull.cdf(e,r,t):i.weibull.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?i.poisson.cdf(e,t):i.poisson.pdf(e,t))))}hypgeomdist(e,t){return this.runFunction(e.args,t,this.metadata("HYPGEOM.DIST"),((e,t,r,o,a)=>e>t||e>r||t>o||r>o||e+o<r+t?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):(e=Math.trunc(e),t=Math.trunc(t),r=Math.trunc(r),o=Math.trunc(o),a?i.hypgeom.cdf(e,o,r,t):i.hypgeom.pdf(e,o,r,t))))}tdist(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST"),((e,t,r)=>(t=Math.trunc(t),r?i.studentt.cdf(e,t):i.studentt.pdf(e,t))))}tdist2t(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.2T"),((e,t)=>2*(1-i.studentt.cdf(e,Math.trunc(t)))))}tdistrt(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.RT"),((e,t)=>1-i.studentt.cdf(e,Math.trunc(t))))}tdistold(e,t){return this.runFunction(e.args,t,this.metadata("TDIST"),((e,t,r)=>r*(1-i.studentt.cdf(e,Math.trunc(t)))))}tinv(e,t){return this.runFunction(e.args,t,this.metadata("T.INV"),((e,t)=>i.studentt.inv(e,Math.trunc(t))))}tinv2t(e,t){return this.runFunction(e.args,t,this.metadata("T.INV.2T"),((e,t)=>i.studentt.inv(1-e/2,Math.trunc(t))))}lognormdist(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.DIST"),((e,t,r,n)=>n?i.lognormal.cdf(e,t,r):i.lognormal.pdf(e,t,r)))}lognorminv(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.INV"),((e,t,r)=>i.lognormal.inv(e,t,r)))}normdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.DIST"),((e,t,r,n)=>n?i.normal.cdf(e,t,r):i.normal.pdf(e,t,r)))}norminv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.INV"),((e,t,r)=>i.normal.inv(e,t,r)))}normsdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.DIST"),((e,t)=>t?i.normal.cdf(e,0,1):i.normal.pdf(e,0,1)))}normsinv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.INV"),(e=>i.normal.inv(e,0,1)))}phi(e,t){return this.runFunction(e.args,t,this.metadata("PHI"),(e=>i.normal.pdf(e,0,1)))}negbinomdist(e,t){return this.runFunction(e.args,t,this.metadata("NEGBINOM.DIST"),((e,t,r,n)=>(e=Math.trunc(e),t=Math.trunc(t),n?i.negbin.cdf(e,t,r):i.negbin.pdf(e,t,r))))}confidencenorm(e,t){return this.runFunction(e.args,t,this.metadata("CONFIDENCE.NORM"),((e,t,r)=>(0,i.normalci)(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 n.CellError(n.ErrorType.DIV_BY_ZERO):(0,i.tci)(1,e,t,r)[1]-1))}standardize(e,t){return this.runFunction(e.args,t,this.metadata("STANDARDIZE"),((e,t,r)=>(e-t)/r))}}l.implementedFunctions={ERF:{method:"erf",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0}]},ERFC:{method:"erfc",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},"EXPON.DIST":{method:"expondist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},FISHER:{method:"fisher",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:-1,lessThan:1}]},FISHERINV:{method:"fisherinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},GAMMA:{method:"gamma",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},"GAMMA.DIST":{method:"gammadist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},GAMMALN:{method:"gammaln",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]},"GAMMA.INV":{method:"gammainv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]},GAUSS:{method:"gauss",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},"BETA.DIST":{method:"betadist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN},{argumentType:a.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:a.FunctionArgumentType.NUMBER,defaultValue:1}]},"BETA.INV":{method:"betainv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,defaultValue:0},{argumentType:a.FunctionArgumentType.NUMBER,defaultValue:1}]},"BINOM.DIST":{method:"binomialdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"BINOM.INV":{method:"binomialinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1}]},BESSELI:{method:"besselifn",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0}]},BESSELJ:{method:"besseljfn",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0}]},BESSELK:{method:"besselkfn",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0}]},BESSELY:{method:"besselyfn",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0}]},"CHISQ.DIST":{method:"chisqdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1,maxValue:1e10},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"CHISQ.DIST.RT":{method:"chisqdistrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV":{method:"chisqinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV.RT":{method:"chisqinvrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"F.DIST":{method:"fdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"F.DIST.RT":{method:"fdistrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"F.INV":{method:"finv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"F.INV.RT":{method:"finvrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"WEIBULL.DIST":{method:"weibulldist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"POISSON.DIST":{method:"poissondist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"HYPGEOM.DIST":{method:"hypgeomdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"T.DIST":{method:"tdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"T.DIST.2T":{method:"tdist2t",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"T.DIST.RT":{method:"tdistrt",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},TDIST:{method:"tdistold",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.INTEGER,minValue:1,maxValue:2}]},"T.INV":{method:"tinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"T.INV.2T":{method:"tinv2t",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,maxValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"LOGNORM.DIST":{method:"lognormdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"LOGNORM.INV":{method:"lognorminv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]},"NORM.DIST":{method:"normdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"NORM.INV":{method:"norminv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]},"NORM.S.DIST":{method:"normsdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"NORM.S.INV":{method:"normsinv",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1}]},PHI:{method:"phi",parameters:[{argumentType:a.FunctionArgumentType.NUMBER}]},"NEGBINOM.DIST":{method:"negbinomdist",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,minValue:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1},{argumentType:a.FunctionArgumentType.NUMBER,minValue:0,maxValue:1},{argumentType:a.FunctionArgumentType.BOOLEAN}]},"CONFIDENCE.NORM":{method:"confidencenorm",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},"CONFIDENCE.T":{method:"confidencet",parameters:[{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0,lessThan:1},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0},{argumentType:a.FunctionArgumentType.NUMBER,minValue:1}]},STANDARDIZE:{method:"standardize",parameters:[{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,greaterThan:0}]}},l.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"}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{besseli:()=>w,besselj:()=>T,besselk:()=>S,bessely:()=>R});var n=Math;function s(e,t){for(var r=0,n=0;r<e.length;++r)n=t*n+e[r];return n}function o(e,t,r,n,s){if(0===t)return r;if(1===t)return n;for(var o=2/e,i=n,a=1;a<t;++a)i=n*a*o+s*r,r=n,n=i;return i}function i(e,t,r,n,s){return function(r,i){if(n){if(0===r)return 1==n?-1/0:1/0;if(r<0)return NaN}return 0===i?e(r):1===i?t(r):i<0?NaN:o(r,i|=0,e(r),t(r),s)}}var a,l,u,h,c,d,p,g,m,f,y,E,C,T=function(){var e=.636619772,t=[57568490574,-13362590354,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),r=[57568490411,1029532985,9494680.718,59272.64853,267.8532712,1].reverse(),i=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),a=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34935152e-8].reverse();function l(o){var l=0,u=0,h=0,c=o*o;if(o<8)l=(u=s(t,c))/(h=s(r,c));else{var d=o-.785398164;u=s(i,c=64/c),h=s(a,c),l=n.sqrt(e/o)*(n.cos(d)*u-n.sin(d)*h*8/o)}return l}var u=[72362614232,-7895059235,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),h=[144725228442,2300535178,18583304.74,99447.43394,376.9991397,1].reverse(),c=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),d=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();function p(t){var r=0,o=0,i=0,a=t*t,l=n.abs(t)-2.356194491;return Math.abs(t)<8?r=(o=t*s(u,a))/(i=s(h,a)):(o=s(c,a=64/a),i=s(d,a),r=n.sqrt(e/n.abs(t))*(n.cos(l)*o-n.sin(l)*i*8/n.abs(t)),t<0&&(r=-r)),r}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 l(t);if(1===r)return p(t);if(0===t)return 0;var s=0;if(t>r)s=o(t,r,l(t),p(t),-1);else{for(var i=!1,a=0,u=0,h=1,c=0,d=2/t,g=2*n.floor((r+n.floor(n.sqrt(40*r)))/2);g>0;g--)c=g*d*h-a,a=h,h=c,n.abs(h)>1e10&&(h*=1e-10,a*=1e-10,s*=1e-10,u*=1e-10),i&&(u+=h),i=!i,g==r&&(s=a);s/=u=2*u-h}return s}}(),R=(a=.636619772,l=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),u=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),h=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),c=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse(),d=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),p=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),g=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),m=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse(),i((function(e){var t=0,r=0,o=0,i=e*e,d=e-.785398164;return e<8?t=(r=s(l,i))/(o=s(u,i))+a*T(e,0)*n.log(e):(r=s(h,i=64/i),o=s(c,i),t=n.sqrt(a/e)*(n.sin(d)*r+n.cos(d)*o*8/e)),t}),(function(e){var t=0,r=0,o=0,i=e*e,l=e-2.356194491;return e<8?t=(r=e*s(d,i))/(o=s(p,i))+a*(T(e,1)*n.log(e)-1/e):(r=s(g,i=64/i),o=s(m,i),t=n.sqrt(a/e)*(n.sin(l)*r+n.cos(l)*o*8/e)),t}),0,1,-1)),w=(f=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),y=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),E=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),C=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse(),function e(t,r){if(0===(r=Math.round(r)))return function(e){return e<=3.75?s(f,e*e/14.0625):n.exp(n.abs(e))/n.sqrt(n.abs(e))*s(y,3.75/n.abs(e))}(t);if(1===r)return function(e){return e<3.75?e*s(E,e*e/14.0625):(e<0?-1:1)*n.exp(n.abs(e))/n.sqrt(n.abs(e))*s(C,3.75/n.abs(e))}(t);if(r<0)return NaN;if(0===n.abs(t))return 0;if(t==1/0)return 1/0;var o,i=0,a=2/n.abs(t),l=0,u=1,h=0;for(o=2*n.round((r+n.round(n.sqrt(40*r)))/2);o>0;o--)h=o*a*u+l,l=u,u=h,n.abs(u)>1e10&&(u*=1e-10,l*=1e-10,i*=1e-10),o==r&&(i=l);return i*=e(t,0)/u,t<0&&r%2?-i:i}),S=function(){var e=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),t=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();var r=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),o=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();return i((function(r){return r<=2?-n.log(r/2)*w(r,0)+s(e,r*r/4):n.exp(-r)/n.sqrt(r)*s(t,2/r)}),(function(e){return e<=2?n.log(e/2)*w(e,1)+1/e*s(r,e*e/4):n.exp(-e)/n.sqrt(e)*s(o,2/e)}),0,2,1)}()},(e,t,r)=>{"use strict";function n(e){const t=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18];let r,n,s,o,i=t.length-1,a=!1,l=0,u=0;if(0===e)return 0;for(e<0&&(e=-e,a=!0),r=2/(2+e),n=4*r-2;i>0;i--)s=l,l=n*l-u+t[i],u=s;return o=r*Math.exp(-e*e+.5*(t[0]+n*l)-u),a?o-1:1-o}function s(e){return 1-n(e)}function o(e){let t,r,n,o,i=0;if(e>=2)return-100;if(e<=0)return 100;for(o=e<1?e:2-e,n=Math.sqrt(-2*Math.log(o/2)),t=-.70711*((2.30753+.27061*n)/(1+n*(.99229+.04481*n))-n);i<2;i++)r=s(t)-o,t+=r/(1.1283791670955126*Math.exp(-t*t)-t*r);return e<1?t:-t}r.r(t),r.d(t,{beta:()=>p,binomial:()=>C,centralF:()=>A,chisquare:()=>v,corrcoeff:()=>B,covariance:()=>V,erf:()=>n,erfc:()=>s,exponential:()=>i,factorial:()=>S,factorialln:()=>w,gamma:()=>l,gammafn:()=>a,gammaln:()=>u,geomean:()=>U,hypgeom:()=>M,lognormal:()=>I,mean:()=>P,negbin:()=>_,normal:()=>d,normalci:()=>k,poisson:()=>O,stdev:()=>F,studentt:()=>b,sumsqerr:()=>L,tci:()=>H,variance:()=>D,weibull:()=>N});const i={pdf:(e,t)=>e<0?0:t*Math.exp(-t*e),cdf:(e,t)=>e<0?0:1-Math.exp(-t*e)};function a(e){const t=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],r=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535];let n,s,o,i,a=!1,l=0,u=0,h=0,c=e;if(e>171.6243769536076)return 1/0;if(c<=0){if(i=c%1,!i)return 1/0;a=(1&c?-1:1)*Math.PI/Math.sin(Math.PI*i),c=1-c}for(o=c,s=c<1?c++:(c-=l=(0|c)-1)-1,n=0;n<8;++n)h=(h+t[n])*s,u=u*s+r[n];if(i=h/u+1,o<c)i/=o;else if(o>c)for(n=0;n<l;++n)i*=c,c++;return a&&(i=a/i),i}const l={pdf:function(e,t,r){return e<0?0:0===e&&1===t?1/r:Math.exp((t-1)*Math.log(e)-e/r-u(t)-t*Math.log(r))},cdf:function(e,t,r){return e<0?0:h(t,e/r)},inv:function(e,t,r){return c(e,t)*r}};function u(e){let t=0;const r=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];let n,s,o,i=1.000000000190015;for(o=(s=n=e)+5.5,o-=(n+.5)*Math.log(o);t<6;t++)i+=r[t]/++s;return Math.log(2.5066282746310007*i/n)-o}function h(e,t){const r=u(e);let n=e,s=1/e,o=s,i=t+1-e,a=1/1e-30,l=1/i,h=l,c=1;const d=-~(8.5*Math.log(e>=1?e:1/e)+.4*e+17);let p;if(t<0||e<=0)return NaN;if(t<e+1){for(;c<=d;c++)s+=o*=t/++n;return s*Math.exp(-t+e*Math.log(t)-r)}for(;c<=d;c++)p=-c*(c-e),i+=2,l=p*l+i,a=i+p/a,l=1/l,h*=l*a;return 1-h*Math.exp(-t+e*Math.log(t)-r)}function c(e,t){let r=0;const n=t-1,s=u(t);let o,i,a,l,c,d,p;if(e>=1)return Math.max(100,t+100*Math.sqrt(t));if(e<=0)return 0;for(t>1?(d=Math.log(n),p=Math.exp(n*(d-1)-s),c=e<.5?e:1-e,a=Math.sqrt(-2*Math.log(c)),o=(2.30753+.27061*a)/(1+a*(.99229+.04481*a))-a,e<.5&&(o=-o),o=Math.max(.001,t*Math.pow(1-1/(9*t)-o/(3*Math.sqrt(t)),3))):(a=1-t*(.253+.12*t),o=e<a?Math.pow(e/a,1/t):1-Math.log(1-(e-a)/(1-a)));r<12;r++){if(o<=0)return 0;if(i=h(t,o)-e,a=t>1?p*Math.exp(-(o-n)+n*(Math.log(o)-d)):Math.exp(-o+n*Math.log(o)-s),l=i/a,o-=a=l/(1-.5*Math.min(1,l*((t-1)/o-1))),o<=0&&(o=.5*(o+a)),Math.abs(a)<1e-8*o)break}return o}const d={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+n((e-t)/Math.sqrt(2*r*r)))},inv:function(e,t,r){return-1.4142135623730951*r*o(2*e)+t}},p={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)/g(t,r):Math.exp((t-1)*Math.log(e)+(r-1)*Math.log(1-e)-m(t,r))},cdf:function(e,t,r){return e>1||e<0?+(e>1):y(e,t,r)},inv:function(e,t,r){return f(e,t,r)}};function g(e,t){if(!(e<=0||t<=0))return e+t>170?Math.exp(m(e,t)):a(e)*a(t)/a(e+t)}function m(e,t){return u(e)+u(t)-u(e+t)}function f(e,t,r){var n,s,o,i,a,l,h,c,d,p,g=t-1,m=r-1,f=0;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&r>=1?(o=e<.5?e:1-e,l=(2.30753+.27061*(i=Math.sqrt(-2*Math.log(o))))/(1+i*(.99229+.04481*i))-i,e<.5&&(l=-l),h=(l*l-3)/6,c=2/(1/(2*t-1)+1/(2*r-1)),d=l*Math.sqrt(h+c)/c-(1/(2*r-1)-1/(2*t-1))*(h+5/6-2/(3*c)),l=t/(t+r*Math.exp(2*d))):(n=Math.log(t/(t+r)),s=Math.log(r/(t+r)),l=e<(i=Math.exp(t*n)/t)/(d=i+(a=Math.exp(r*s)/r))?Math.pow(t*d*e,1/t):1-Math.pow(r*d*(1-e),1/r)),p=-u(t)-u(r)+u(t+r);f<10;f++){if(0===l||1===l)return l;if((l-=i=(a=(y(l,t,r)-e)/(i=Math.exp(g*Math.log(l)+m*Math.log(1-l)+p)))/(1-.5*Math.min(1,a*(g/l-m/(1-l)))))<=0&&(l=.5*(l+i)),l>=1&&(l=.5*(l+i+1)),Math.abs(i)<1e-8*l&&f>0)break}return l}function y(e,t,r){var n=0===e||1===e?0:Math.exp(u(t+r)-u(t)-u(r)+t*Math.log(e)+r*Math.log(1-e));return!(e<0||e>1)&&(e<(t+1)/(t+r+2)?n*E(e,t,r)/t:1-n*E(1-e,r,t)/r)}function E(e,t,r){var n,s,o,i,a=1e-30,l=1,u=t+r,h=t+1,c=t-1,d=1,p=1-u*e/h;for(Math.abs(p)<a&&(p=a),i=p=1/p;l<=100&&(p=1+(s=l*(r-l)*e/((c+(n=2*l))*(t+n)))*p,Math.abs(p)<a&&(p=a),d=1+s/d,Math.abs(d)<a&&(d=a),i*=(p=1/p)*d,p=1+(s=-(t+l)*(u+l)*e/((t+n)*(h+n)))*p,Math.abs(p)<a&&(p=a),d=1+s/d,Math.abs(d)<a&&(d=a),i*=o=(p=1/p)*d,!(Math.abs(o-1)<3e-7));l++);return i}const C={pdf:function(e,t,r){return 0===r||1===r?t*r===e?1:0:R(t,e)*Math.pow(r,e)*Math.pow(1-r,t-e)},cdf:function(e,t,r){var n,s=1e-10;if(e<0)return 0;if(e>=t)return 1;if(r<0||r>1||t<=0)return NaN;var o=r,i=(e=Math.floor(e))+1,a=t-e,l=i+a,h=Math.exp(u(l)-u(a)-u(i)+i*Math.log(o)+a*Math.log(1-o));return n=o<(i+1)/(l+2)?h*T(o,i,a,s):1-h*T(1-o,a,i,s),Math.round(1/s*(1-n))/(1/s)}};function T(e,t,r,n){for(var s,o=0,i=1,a=1,l=1,u=0,h=0;Math.abs((a-h)/a)>n;)h=a,i=l+(s=-(t+u)*(t+r+u)*e/(t+2*u)/(t+2*u+1))*i,a=(o=a+s*o)+(s=(u+=1)*(r-u)*e/(t+2*u-1)/(t+2*u))*a,o/=l=i+s*l,i/=l,a/=l,l=1;return a/t}function R(e,t){return e>170||t>170?Math.exp(function(e,t){return w(e)-w(t)-w(e-t)}(e,t)):S(e)/S(t)/S(e-t)}function w(e){return e<0?NaN:u(e+1)}function S(e){return e<0?NaN:a(e+1)}const v={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)-u(t/2))},cdf:function(e,t){return e<0?0:h(t/2,e/2)},inv:function(e,t){return 2*c(e,.5*t)}},A={pdf:function(e,t,r){var n;return e<0?0:t<=2?0===e&&t<2?1/0:0===e&&2===t?1:1/g(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):(n=t*e/(r+e*t),t*(r/(r+e*t))/2*C.pdf((t-2)/2,(t+r-2)/2,n))},cdf:function(e,t,r){return e<0?0:y(t*e/(t*e+r),t/2,r/2)},inv:function(e,t,r){return r/(t*(1/f(e,t/2,r/2)-1))}},N={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))}},O={pdf:function(e,t){return t<0||e%1!=0||e<0?0:Math.pow(t,e)*Math.exp(-t)/S(e)},cdf:function(e,t){var r=0;if(e<0)return 0;for(var n=0;r<=e;r++)n+=O.pdf(r,t);return n}},M={pdf:function(e,t,r,n){if(e<0||e<r-(t-n))return 0;if(e>n||e>r)return 0;if(2*r>t)return 2*n>t?M.pdf(t-r-n+e,t,t-r,t-n):M.pdf(n-e,t,t-r,n);if(2*n>t)return M.pdf(r-e,t,r,t-n);if(r<n)return M.pdf(e,t,n,r);for(var s=1,o=0,i=0;i<e;i++){for(;s>1&&o<n;)s*=1-r/(t-o),o++;s*=(n-i)*(r-i)/((i+1)*(t-r-n+i+1))}for(;o<n;o++)s*=1-r/(t-o);return Math.min(1,Math.max(0,s))},cdf:function e(t,r,n,s){if(t<0||t<n-(r-s))return 0;if(t>=s||t>=n)return 1;if(2*n>r)return 2*s>r?e(r-n-s+t,r,r-n,r-s):1-M.cdf(s-t-1,r,r-n,s);if(2*s>r)return 1-M.cdf(n-t-1,r,n,r-s);if(n<s)return M.cdf(t,r,s,n);for(var o=1,i=1,a=0,l=0;l<t;l++){for(;o>1&&a<s;){var u=1-n/(r-a);i*=u,o*=u,a++}o+=i*=(s-l)*(n-l)/((l+1)*(r-n-s+l+1))}for(;a<s;a++)o*=1-n/(r-a);return Math.min(1,Math.max(0,o))}},b={pdf:function(e,t){return t=t>1e100?1e100:t,1/(Math.sqrt(t)*g(.5,t/2))*Math.pow(1+e*e/t,-(t+1)/2)},cdf:function(e,t){var r=t/2;return y((e+Math.sqrt(e*e+t))/(2*Math.sqrt(e*e+t)),r,r)},inv:function(e,t){var r=f(2*Math.min(e,1-e),.5*t,.5);return r=Math.sqrt(t*(1-r)/r),e>.5?r:-r}},I={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*n((Math.log(e)-t)/Math.sqrt(2*r*r))},inv:function(e,t,r){return Math.exp(-1.4142135623730951*r*o(2*e)+t)}},_={pdf:function(e,t,r){return e===e>>>0&&(e<0?0:R(e+t-1,t-1)*Math.pow(1-r,e)*Math.pow(r,t))},cdf:function(e,t,r){var n=0,s=0;if(e<0)return 0;for(;s<=e;s++)n+=_.pdf(s,t,r);return n}};function x(e){for(var t=0,r=e.length;--r>=0;)t+=e[r];return t}function P(e){return x(e)/e.length}function L(e){for(var t,r=P(e),n=0,s=e.length;--s>=0;)n+=(t=e[s]-r)*t;return n}function D(e,t){return L(e)/(e.length-(t?1:0))}function F(e,t){return Math.sqrt(D(e,t))}function k(){var e,t=[].slice.call(arguments),r=new Array(2);return e=4===t.length?Math.abs(d.inv(t[1]/2,0,1)*t[2]/Math.sqrt(t[3])):Math.abs(d.inv(t[1]/2,0,1)*F(t[2])/Math.sqrt(t[2].length)),r[0]=t[0]-e,r[1]=t[0]+e,r}function H(){var e,t=[].slice.call(arguments),r=new Array(2);return e=4===t.length?Math.abs(b.inv(t[1]/2,t[3]-1)*t[2]/Math.sqrt(t[3])):Math.abs(b.inv(t[1]/2,t[2].length-1)*F(t[2],!0)/Math.sqrt(t[2].length)),r[0]=t[0]-e,r[1]=t[0]+e,r}function U(e){return Math.pow(function(e){for(var t=1,r=e.length;--r>=0;)t*=e[r];return t}(e),1/e.length)}function V(e,t){var r,n=P(e),s=P(t),o=e.length,i=new Array(o);for(r=0;r<o;r++)i[r]=(e[r]-n)*(t[r]-s);return x(i)/(o-1)}function B(e,t){return V(e,t)/F(e,1)/F(t,1)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{MathPlugin:()=>i});var n=r(3),s=r(61),o=r(94);class i extends o.FunctionPlugin{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=>{let t=1;for(let r=e=Math.trunc(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 n.CellError(n.ErrorType.NUM,s.ErrorMessage.WrongOrder):a(e=Math.trunc(e),t=Math.trunc(t))))}combina(e,t){return this.runFunction(e.args,t,this.metadata("COMBINA"),((e,t)=>(e=Math.trunc(e))+(t=Math.trunc(t))-1>=1030?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):0===e&&0===t?1:a(e+t-1,t)))}gcd(e,t){return this.runFunction(e.args,t,this.metadata("GCD"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof n.CellError)return t;let r=0;for(const e of t){if(e<0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);r=l(r,Math.trunc(e))}return r>Number.MAX_SAFE_INTEGER?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueLarge):r}))}lcm(e,t){return this.runFunction(e.args,t,this.metadata("LCM"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof n.CellError)return t;let r=1;for(const e of t){if(e<0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);r=u(r,Math.trunc(e))}return r>Number.MAX_SAFE_INTEGER?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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 n.CellError(n.ErrorType.NUM,s.ErrorMessage.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 o of e){if(o<0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);o=Math.trunc(o);for(let e=1;e<=o;e++)r*=(t+e)/e;t+=o}return Math.round(r)}))}quotient(e,t){return this.runFunction(e.args,t,this.metadata("QUOTIENT"),((e,t)=>0===t?new n.CellError(n.ErrorType.DIV_BY_ZERO):Math.trunc(e/t)))}seriessum(e,t){return this.runFunction(e.args,t,this.metadata("SERIESSUM"),((e,t,r,s)=>{const o=this.arithmeticHelper.manyToOnlyNumbersDropNulls(s.valuesFromTopLeftCorner());if(o instanceof n.CellError)return o;let i=0;o.reverse();for(const t of o)i*=Math.pow(e,r),i+=t;return i*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)=>{const r=e.valuesFromTopLeftCorner(),o=t.valuesFromTopLeftCorner();if(r.length!==o.length)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const i=r.length;let a=0;for(let e=0;e<i;e++){const t=r[e],s=o[e];if(t instanceof n.CellError)return t;if(s instanceof n.CellError)return s;"number"==typeof t&&"number"==typeof s&&(a+=Math.pow(t,2)-Math.pow(s,2))}return a}))}sumx2py2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2PY2"),((e,t)=>{const r=e.valuesFromTopLeftCorner(),o=t.valuesFromTopLeftCorner();if(r.length!==o.length)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const i=r.length;let a=0;for(let e=0;e<i;e++){const t=r[e],s=o[e];if(t instanceof n.CellError)return t;if(s instanceof n.CellError)return s;"number"==typeof t&&"number"==typeof s&&(a+=Math.pow(t,2)+Math.pow(s,2))}return a}))}sumxmy2(e,t){return this.runFunction(e.args,t,this.metadata("SUMXMY2"),((e,t)=>{const r=e.valuesFromTopLeftCorner(),o=t.valuesFromTopLeftCorner();if(r.length!==o.length)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const i=r.length;let a=0;for(let e=0;e<i;e++){const t=r[e],s=o[e];if(t instanceof n.CellError)return t;if(s instanceof n.CellError)return s;"number"==typeof t&&"number"==typeof s&&(a+=Math.pow(t-s,2))}return a}))}}function a(e,t){2*t>e&&(t=e-t);let r=1;for(let n=1;n<=t;n++)r*=(e-t+n)/n;return Math.round(r)}function l(e,t){for(e<t&&([e,t]=[t,e]);t>0;)[e,t]=[t,e%t];return e}function u(e,t){return 0===e||0===t?0:e*(t/l(e,t))}i.implementedFunctions={FACT:{method:"fact",parameters:[{argumentType:o.FunctionArgumentType.NUMBER,minValue:0,maxValue:170}]},FACTDOUBLE:{method:"factdouble",parameters:[{argumentType:o.FunctionArgumentType.NUMBER,minValue:0,maxValue:288}]},COMBIN:{method:"combin",parameters:[{argumentType:o.FunctionArgumentType.NUMBER,minValue:0,lessThan:1030},{argumentType:o.FunctionArgumentType.NUMBER,minValue:0}]},COMBINA:{method:"combina",parameters:[{argumentType:o.FunctionArgumentType.NUMBER,minValue:0},{argumentType:o.FunctionArgumentType.NUMBER,minValue:0}]},GCD:{method:"gcd",parameters:[{argumentType:o.FunctionArgumentType.ANY}],repeatLastArgs:1},LCM:{method:"lcm",parameters:[{argumentType:o.FunctionArgumentType.ANY}],repeatLastArgs:1},MROUND:{method:"mround",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},MULTINOMIAL:{method:"multinomial",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}],repeatLastArgs:1,expandRanges:!0},QUOTIENT:{method:"quotient",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER}]},SERIESSUM:{method:"seriessum",parameters:[{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.NUMBER},{argumentType:o.FunctionArgumentType.RANGE}]},SIGN:{method:"sign",parameters:[{argumentType:o.FunctionArgumentType.NUMBER}]},SUMX2MY2:{method:"sumx2my2",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.RANGE}]},SUMX2PY2:{method:"sumx2py2",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.RANGE}]},SUMXMY2:{method:"sumxmy2",parameters:[{argumentType:o.FunctionArgumentType.RANGE},{argumentType:o.FunctionArgumentType.RANGE}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ComplexPlugin:()=>a});var n=r(3),s=r(61),o=r(95),i=r(94);class a extends i.FunctionPlugin{complex(e,t){return this.runFunction(e.args,t,this.metadata("COMPLEX"),((e,t,r)=>"i"!==r&&"j"!==r?new n.CellError(n.ErrorType.VALUE,s.ErrorMessage.ShouldBeIorJ):(0,o.coerceComplexToString)([e,t],r)))}imabs(e,t){return this.runFunction(e.args,t,this.metadata("IMABS"),f)}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 n.CellError(n.ErrorType.DIV_BY_ZERO):Math.atan2(t,e)))}imconjugate(e,t){return this.runFunction(e.args,t,this.metadata("IMCONJUGATE"),(([e,t])=>(0,o.coerceComplexToString)([e,-t])))}imcos(e,t){return this.runFunction(e.args,t,this.metadata("IMCOS"),(e=>(0,o.coerceComplexToString)(c(e))))}imcosh(e,t){return this.runFunction(e.args,t,this.metadata("IMCOSH"),(e=>(0,o.coerceComplexToString)(d(e))))}imcot(e,t){return this.runFunction(e.args,t,this.metadata("IMCOT"),(e=>(0,o.coerceComplexToString)(h(c(e),p(e)))))}imcsc(e,t){return this.runFunction(e.args,t,this.metadata("IMCSC"),(e=>(0,o.coerceComplexToString)(h([1,0],p(e)))))}imcsch(e,t){return this.runFunction(e.args,t,this.metadata("IMCSCH"),(e=>(0,o.coerceComplexToString)(h([1,0],g(e)))))}imsec(e,t){return this.runFunction(e.args,t,this.metadata("IMSEC"),(e=>(0,o.coerceComplexToString)(h([1,0],c(e)))))}imsech(e,t){return this.runFunction(e.args,t,this.metadata("IMSECH"),(e=>(0,o.coerceComplexToString)(h([1,0],d(e)))))}imsin(e,t){return this.runFunction(e.args,t,this.metadata("IMSIN"),(e=>(0,o.coerceComplexToString)(p(e))))}imsinh(e,t){return this.runFunction(e.args,t,this.metadata("IMSINH"),(e=>(0,o.coerceComplexToString)(g(e))))}imtan(e,t){return this.runFunction(e.args,t,this.metadata("IMTAN"),(e=>(0,o.coerceComplexToString)(h(p(e),c(e)))))}imdiv(e,t){return this.runFunction(e.args,t,this.metadata("IMDIV"),((e,t)=>(0,o.coerceComplexToString)(h(e,t))))}improduct(e,t){return this.runFunction(e.args,t,this.metadata("IMPRODUCT"),((...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof n.CellError)return t;let r=[1,0];for(const e of t)r=u(r,e);return(0,o.coerceComplexToString)(r)}))}imsum(e,t){return this.runFunction(e.args,t,this.metadata("IMSUM"),((...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof n.CellError)return t;let r=[0,0];for(const e of t)r=l(r,e);return(0,o.coerceComplexToString)(r)}))}imsub(e,t){return this.runFunction(e.args,t,this.metadata("IMSUB"),((e,t)=>(0,o.coerceComplexToString)(function([e,t],[r,n]){return[e-r,t-n]}(e,t))))}imexp(e,t){return this.runFunction(e.args,t,this.metadata("IMEXP"),(e=>(0,o.coerceComplexToString)(m(e))))}imln(e,t){return this.runFunction(e.args,t,this.metadata("IMLN"),(e=>(0,o.coerceComplexToString)(y(e))))}imlog10(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG10"),(e=>{const[t,r]=y(e),n=Math.log(10);return(0,o.coerceComplexToString)([t/n,r/n])}))}imlog2(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG2"),(e=>{const[t,r]=y(e),n=Math.log(2);return(0,o.coerceComplexToString)([t/n,r/n])}))}impower(e,t){return this.runFunction(e.args,t,this.metadata("IMPOWER"),((e,t)=>(0,o.coerceComplexToString)(E(e,t))))}imsqrt(e,t){return this.runFunction(e.args,t,this.metadata("IMSQRT"),(e=>(0,o.coerceComplexToString)(E(e,.5))))}}function l([e,t],[r,n]){return[e+r,t+n]}function u([e,t],[r,n]){return[e*r-t*n,e*n+r*t]}function h([e,t],[r,n]){const s=Math.pow(r,2)+Math.pow(n,2),[o,i]=u([e,t],[r,-n]);return[o/s,i/s]}function c([e,t]){return[Math.cos(e)*Math.cosh(t),-Math.sin(e)*Math.sinh(t)]}function d([e,t]){return[Math.cosh(e)*Math.cos(t),Math.sinh(e)*Math.sin(t)]}function p([e,t]){return[Math.sin(e)*Math.cosh(t),Math.cos(e)*Math.sinh(t)]}function g([e,t]){return[Math.sinh(e)*Math.cos(t),Math.cosh(e)*Math.sin(t)]}function m([e,t]){return[Math.exp(e)*Math.cos(t),Math.exp(e)*Math.sin(t)]}function f([e,t]){return Math.sqrt(e*e+t*t)}function y([e,t]){return[Math.log(f([e,t])),Math.atan2(t,e)]}function E(e,t){const[r,n]=y(e);return m([t*r,t*n])}a.implementedFunctions={COMPLEX:{method:"complex",parameters:[{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.NUMBER},{argumentType:i.FunctionArgumentType.STRING,defaultValue:"i"}]},IMABS:{method:"imabs",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMAGINARY:{method:"imaginary",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMREAL:{method:"imreal",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMARGUMENT:{method:"imargument",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCONJUGATE:{method:"imconjugate",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCOS:{method:"imcos",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCOSH:{method:"imcosh",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCOT:{method:"imcot",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCSC:{method:"imcsc",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMCSCH:{method:"imcsch",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMSEC:{method:"imsec",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMSECH:{method:"imsech",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMSIN:{method:"imsin",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMSINH:{method:"imsinh",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMTAN:{method:"imtan",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMDIV:{method:"imdiv",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX},{argumentType:i.FunctionArgumentType.COMPLEX}]},IMPRODUCT:{method:"improduct",parameters:[{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1},IMSUM:{method:"imsum",parameters:[{argumentType:i.FunctionArgumentType.ANY}],repeatLastArgs:1},IMSUB:{method:"imsub",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX},{argumentType:i.FunctionArgumentType.COMPLEX}]},IMEXP:{method:"imexp",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMLN:{method:"imln",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMLOG10:{method:"imlog10",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMLOG2:{method:"imlog2",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]},IMPOWER:{method:"impower",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX},{argumentType:i.FunctionArgumentType.NUMBER}]},IMSQRT:{method:"imsqrt",parameters:[{argumentType:i.FunctionArgumentType.COMPLEX}]}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{StatisticalAggregationPlugin:()=>l});var n=r(3),s=r(61),o=r(70),i=r(191),a=r(94);class l extends a.FunctionPlugin{avedev(e,t){return this.runFunction(e.args,t,this.metadata("AVEDEV"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;if(0===t.length)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const r=(0,i.mean)(t);return t.reduce(((e,t)=>e+Math.abs(t-r)),0)/t.length}))}devsq(e,t){return this.runFunction(e.args,t,this.metadata("DEVSQ"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof n.CellError?t:0===t.length?0:(0,i.sumsqerr)(t)}))}geomean(e,t){return this.runFunction(e.args,t,this.metadata("GEOMEAN"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;if(0===t.length)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.OneValue);for(const e of t)if(e<=0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.ValueSmall);return(0,i.geomean)(t)}))}harmean(e,t){return this.runFunction(e.args,t,this.metadata("HARMEAN"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;if(0===t.length)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.OneValue);for(const e of t)if(e<=0)return new n.CellError(n.ErrorType.NUM,s.ErrorMessage.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 n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;return r[0].length<=1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues):(0,i.corrcoeff)(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 n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;return r[0].length<=1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues):Math.pow((0,i.corrcoeff)(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 n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;const o=r[0].length;return o<1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.OneValue):1===o?0:(0,i.covariance)(r[0],r[1])*(o-1)/o}))}covariances(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.S"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;return r[0].length<=1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues):(0,i.covariance)(r[0],r[1])}))}ztest(e,t){return this.runFunction(e.args,t,this.metadata("Z.TEST"),((e,t,r)=>{const o=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(o instanceof n.CellError)return o;const a=o.length;if(void 0===r){if(a<2)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);r=(0,i.stdev)(o,!0)}return a<1?new n.CellError(n.ErrorType.NA,s.ErrorMessage.OneValue):0===r?new n.CellError(n.ErrorType.DIV_BY_ZERO):1-i.normal.cdf(((0,i.mean)(o)-t)/(r/Math.sqrt(a)),0,1)}))}ftest(e,t){return this.runFunction(e.args,t,this.metadata("F.TEST"),((e,t)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),s=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(r instanceof n.CellError)return r;if(s instanceof n.CellError)return s;if(r.length<=1||s.length<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const o=(0,i.variance)(r,!0),a=(0,i.variance)(s,!0);if(0===o||0===a)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const l=o/a,u=i.centralF.cdf(l,r.length-1,s.length-1);return 2*Math.min(u,1-u)}))}steyx(e,t){return this.runFunction(e.args,t,this.metadata("STEYX"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;const o=r[0].length;return o<=2?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.ThreeValues):Math.sqrt(((0,i.sumsqerr)(r[0])-Math.pow((0,i.covariance)(r[0],r[1])*(o-1),2)/(0,i.sumsqerr)(r[1]))/(o-2))}))}slope(e,t){return this.runFunction(e.args,t,this.metadata("SLOPE"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const r=u(e,t);if(r instanceof n.CellError)return r;const o=r[0].length;return o<=1?new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues):(0,i.covariance)(r[0],r[1])*(o-1)/(0,i.sumsqerr)(r[1])}))}chisqtest(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.TEST"),((e,t)=>{const r=e.height(),o=e.width();if(t.height()!==r||t.width()!==o)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);const a=u(e,t);if(a instanceof n.CellError)return a;if(a[0].length<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);let l=0;for(let e=0;e<a[0].length;e++){if(0===a[1][e])return new n.CellError(n.ErrorType.DIV_BY_ZERO);l+=Math.pow(a[0][e]-a[1][e],2)/a[1][e]}return l<0?new n.CellError(n.ErrorType.NUM,s.ErrorMessage.NaN):1-i.chisquare.cdf(l,r>1&&o>1?(r-1)*(o-1):r*o-1)}))}ttest(e,t){return this.runFunction(e.args,t,this.metadata("T.TEST"),((e,t,r,o)=>{const a=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),l=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(a instanceof n.CellError)return a;if(l instanceof n.CellError)return l;const u=a.length,h=l.length;if(1===o){if(h!==u)return new n.CellError(n.ErrorType.NA,s.ErrorMessage.EqualLength);if(u<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);const e=Array(u);for(let t=0;t<u;t++)e[t]=a[t]-l[t];const t=(0,i.stdev)(e,!0);if(0===t)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const o=Math.abs(Math.sqrt(u)*(0,i.mean)(e)/t);return r*(1-i.studentt.cdf(o,u-1))}if(2===o){if(u<=1||h<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);const e=((0,i.sumsqerr)(a)+(0,i.sumsqerr)(l))/(u+h-2);if(0===e)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const t=Math.abs(((0,i.mean)(a)-(0,i.mean)(l))/Math.sqrt(e*(1/u+1/h)));return r*(1-i.studentt.cdf(t,u+h-2))}{if(u<=1||h<=1)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.TwoValues);const e=(0,i.variance)(a,!0),t=(0,i.variance)(l,!0);if(0===e&&0===t)return new n.CellError(n.ErrorType.DIV_BY_ZERO);const o=Math.abs(((0,i.mean)(a)-(0,i.mean)(l))/Math.sqrt(e/u+t/h)),c=Math.pow(e/u+t/h,2)/(Math.pow(e/u,2)/(u-1)+Math.pow(t/h,2)/(h-1));return r*(1-i.studentt.cdf(o,c))}}))}skew(e,t){return this.runFunction(e.args,t,this.metadata("SKEW"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;const r=t.length;if(r<3)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.ThreeValues);const o=(0,i.mean)(t),a=(0,i.stdev)(t,!0);return 0===a?new n.CellError(n.ErrorType.DIV_BY_ZERO):t.reduce(((e,t)=>e+Math.pow((t-o)/a,3)),0)*r/(r-1)/(r-2)}))}skewp(e,t){return this.runFunction(e.args,t,this.metadata("SKEW.P"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof n.CellError)return t;const r=t.length;if(r<3)return new n.CellError(n.ErrorType.DIV_BY_ZERO,s.ErrorMessage.ThreeValues);const o=(0,i.mean)(t),a=(0,i.stdev)(t,!1);return 0===a?new n.CellError(n.ErrorType.DIV_BY_ZERO):t.reduce(((e,t)=>e+Math.pow((t-o)/a,3)),0)/r}))}}function u(e,t){const r=e.iterateValuesFromTopLeftCorner(),s=t.iterateValuesFromTopLeftCorner();let i,a;const l=[],u=[];for(;i=r.next(),a=s.next(),!i.done&&!a.done;){const e=i.value,t=a.value;if(e instanceof n.CellError)return e;if(t instanceof n.CellError)return t;(0,o.isExtendedNumber)(e)&&(0,o.isExtendedNumber)(t)&&(l.push((0,o.getRawValue)(e)),u.push((0,o.getRawValue)(t)))}return[l,u]}l.implementedFunctions={AVEDEV:{method:"avedev",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},DEVSQ:{method:"devsq",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},GEOMEAN:{method:"geomean",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},HARMEAN:{method:"harmean",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},CORREL:{method:"correl",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},RSQ:{method:"rsq",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"COVARIANCE.P":{method:"covariancep",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"COVARIANCE.S":{method:"covariances",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"Z.TEST":{method:"ztest",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.NUMBER},{argumentType:a.FunctionArgumentType.NUMBER,optionalArg:!0}]},"F.TEST":{method:"ftest",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},STEYX:{method:"steyx",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},SLOPE:{method:"slope",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"CHISQ.TEST":{method:"chisqtest",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE}]},"T.TEST":{method:"ttest",parameters:[{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.RANGE},{argumentType:a.FunctionArgumentType.INTEGER,minValue:1,maxValue:2},{argumentType:a.FunctionArgumentType.INTEGER,minValue:1,maxValue:3}]},SKEW:{method:"skew",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1},"SKEW.P":{method:"skewp",parameters:[{argumentType:a.FunctionArgumentType.ANY}],repeatLastArgs:1}},l.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"}},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0;var s=F(r(197));t.CellCoords=s.CellCoords,t.CellRange=s.CellRange;var o,i,a,l,u,h=r(620),c=F(r(457)),d=r(543),p=n(r(920)),g=n(r(690)),m=F(r(458)),f=F(r(444)),y=F(r(446)),E=F(r(542)),C=F(r(663)),T=F(r(490)),R=F(r(445)),w=F(r(305)),S=F(r(461)),v=F(r(447)),A=F(r(303)),N=F(r(451)),O=F(r(302)),M=F(r(452)),b=r(453),I=r(464),_=r(465),x=r(591),P=r(459),L=r(688);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(D=function(e){return e?r:t})(e)}function F(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=D(t);if(r&&r.has(e))return r.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=s?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(0,h.registerAllModules)(),(0,p.default)(s.default),s.default.__GhostTable=g.default,s.default._getListenersCounter=c.getListenersCounter,s.default._getRegisteredMapsCounter=d.getRegisteredMapsCounter,s.default.EventManager=c.default;const k=[f,y,E,C,T,R,w,S,v,A,N,m],H=[O,M];s.default.helper={},s.default.dom={},f.arrayEach(k,(e=>{f.arrayEach(Object.getOwnPropertyNames(e),(t=>{"_"!==t.charAt(0)&&(s.default.helper[t]=e[t])}))})),f.arrayEach(H,(e=>{f.arrayEach(Object.getOwnPropertyNames(e),(t=>{"_"!==t.charAt(0)&&(s.default.dom[t]=e[t])}))})),s.default.cellTypes=null!==(o=s.default.cellTypes)&&void 0!==o?o:{},f.arrayEach((0,x.getRegisteredCellTypeNames)(),(e=>{s.default.cellTypes[e]=(0,x.getCellType)(e)})),s.default.cellTypes.registerCellType=x.registerCellType,s.default.cellTypes.getCellType=x.getCellType,s.default.editors=null!==(i=s.default.editors)&&void 0!==i?i:{},f.arrayEach((0,b.getRegisteredEditorNames)(),(e=>{s.default.editors[`${A.toUpperCaseFirst(e)}Editor`]=(0,b.getEditor)(e)})),s.default.editors.registerEditor=b.registerEditor,s.default.editors.getEditor=b.getEditor,s.default.renderers=null!==(a=s.default.renderers)&&void 0!==a?a:{},f.arrayEach((0,I.getRegisteredRendererNames)(),(e=>{const t=(0,I.getRenderer)(e);"base"===e&&(s.default.renderers.cellDecorator=t),s.default.renderers[`${A.toUpperCaseFirst(e)}Renderer`]=t})),s.default.renderers.registerRenderer=I.registerRenderer,s.default.renderers.getRenderer=I.getRenderer,s.default.validators=null!==(l=s.default.validators)&&void 0!==l?l:{},f.arrayEach((0,_.getRegisteredValidatorNames)(),(e=>{s.default.validators[`${A.toUpperCaseFirst(e)}Validator`]=(0,_.getValidator)(e)})),s.default.validators.registerValidator=_.registerValidator,s.default.validators.getValidator=_.getValidator,s.default.plugins=null!==(u=s.default.plugins)&&void 0!==u?u:{},f.arrayEach((0,P.getPluginsNames)(),(e=>{s.default.plugins[e]=(0,P.getPlugin)(e)})),s.default.plugins[`${A.toUpperCaseFirst(L.BasePlugin.PLUGIN_KEY)}Plugin`]=L.BasePlugin,s.default.plugins.registerPlugin=P.registerPlugin,s.default.plugins.getPlugin=P.getPlugin;var U=s.default;t.default=U},e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0,r(198),r(199),r(200),r(201);var s=n(r(202)),o=r(540),i=r(584),a=n(r(454)),l=r(563),u=r(591),h=r(606),c=r(610),d=r(476);function p(e,t){const r=new s.default(e,t||{},o.rootInstanceSymbol);return r.init(),r}t.CellCoords=d.CellCoords,t.CellRange=d.CellRange,(0,u.registerCellType)(h.TextCellType),p.editors={BaseEditor:c.BaseEditor},p.Core=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new s.default(e,t,o.rootInstanceSymbol)},p.DefaultSettings=(0,i.metaSchemaFactory)(),p.hooks=a.default.getSingleton(),p.CellCoords=d.CellCoords,p.CellRange=d.CellRange,p.packageName="handsontable",p.buildDate="18/08/2023 11:07:11",p.version="13.1.0-next-28622ff-20230818",p.languages={dictionaryKeys:l.dictionaryKeys,getLanguageDictionary:l.getLanguageDictionary,getLanguagesDictionaries:l.getLanguagesDictionaries,registerLanguageDictionary:l.registerLanguageDictionary,getTranslatedPhrase:l.getTranslatedPhrase};var g=p;t.default=g},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0,t.default=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],L=!1,D=this;const F=new u.default(D);let k,H,U,V,B=!0;(0,S.hasValidParameter)(n)&&(0,S.registerAsRootInstance)(this);this.rootElement=e,this.rootDocument=e.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const W=null!==(r=null==t?void 0:t.layoutDirection)&&void 0!==r?r:"inherit",G=["rtl","ltr"].includes(W)?W:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",G),this.isRtl=function(){return"rtl"===G},this.isLtr=function(){return!D.isRtl()},this.getDirectionFactor=function(){return D.isLtr()?1:-1},t.language=(0,N.getValidLanguageCode)(t.language);const Y=new b.MetaManager(D,t,[b.DynamicCellMetaMod,b.ExtendMetaPropertiesMod]),j=Y.getTableMeta(),z=Y.getGlobalMeta(),$=(0,I.createUniqueMap)();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),(0,S.isRootInstance)(this)&&(0,i._injectProductInfo)(t.licenseKey,e);this.guid=`ht_${(0,y.randomString)()}`,this.columnIndexMapper=new w.IndexMapper,this.rowIndexMapper=new w.IndexMapper,this.columnIndexMapper.addLocalHook("indexesSequenceChange",(e=>{D.runHooks("afterColumnSequenceChange",e)})),this.rowIndexMapper.addLocalHook("indexesSequenceChange",(e=>{D.runHooks("afterRowSequenceChange",e)})),H=new T.default(D),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid);const K=e=>{const{row:t,col:r}=e;return D._createCellCoords(t>=0?D.rowIndexMapper.getRenderableFromVisualIndex(t):t,r>=0?D.columnIndexMapper.getRenderableFromVisualIndex(r):r)};let X=new M.Selection(j,{rowIndexMapper:()=>D.rowIndexMapper,columnIndexMapper:()=>D.columnIndexMapper,countCols:()=>D.countCols(),countRows:()=>D.countRows(),propToCol:e=>k.propToCol(e),isEditorOpened:()=>!!D.getActiveEditor()&&D.getActiveEditor().isOpened(),countColsTranslated:()=>this.view.countRenderableColumns(),countRowsTranslated:()=>this.view.countRenderableRows(),getShortcutManager:()=>D.getShortcutManager(),createCellCoords:(e,t)=>D._createCellCoords(e,t),createCellRange:(e,t,r)=>D._createCellRange(e,t,r),visualToRenderableCoords:K,renderableToVisualCoords:e=>{const{row:t,col:r}=e;return D._createCellCoords(t>=0?D.rowIndexMapper.getVisualFromRenderableIndex(t):t,r>=0?D.columnIndexMapper.getVisualFromRenderableIndex(r):r)},isDisabledCellSelection:(e,t)=>D.getCellMeta(e,t).disableVisualSelection});this.selection=X;const q=e=>{let{hiddenIndexesChanged:t}=e;t&&this.selection.refresh()};function Q(e){const t=(0,O.normalizeLanguageCode)(e);(0,N.hasLanguageDictionary)(t)?(D.runHooks("beforeLanguageChange",t),z.language=t,D.runHooks("afterLanguageChange",t)):(0,O.warnUserAboutLanguageRegistration)(e)}function Z(e,t){const r="className"===e?D.rootElement:D.table;if(B)(0,s.addClass)(r,t);else{let n=[],o=[];z[e]&&(n=Array.isArray(z[e])?z[e]:(0,c.stringToArray)(z[e])),t&&(o=Array.isArray(t)?t:(0,c.stringToArray)(t));const i=(0,c.getDifferenceOfArrays)(n,o),a=(0,c.getDifferenceOfArrays)(o,n);i.length&&(0,s.removeClass)(r,i),a.length&&(0,s.addClass)(r,a)}z[e]=t}function J(){let e=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,e=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){0===this.validatorsInQueue&&!1===e&&(e=!0,this.onQueueEmpty(this.valid))}}}function ee(e){const t=e.replace(",",".");return!1===isNaN(parseFloat(t))?parseFloat(t):e}function te(e,t,r){if(!e.length)return;const n=D.getActiveEditor(),o=new J;let i=!0;o.onQueueEmpty=e=>{n&&i&&n.cancelChanges(),r(e)};for(let r=e.length-1;r>=0;r--){const[n,a,,l]=e[r],u=k.propToCol(a),h=D.getCellMeta(n,u);"numeric"===h.type&&"string"==typeof l&&(0,E.isNumericLike)(l)&&(e[r][3]=ee(l)),D.getCellValidator(h)&&(o.addValidatorToQueue(),D.validateCell(e[r][3],h,function(t,r){return function(n){if("boolean"!=typeof n)throw new Error("Validation error: result is not boolean");if(!1===n&&!1===r.allowInvalid){i=!1,e.splice(t,1),r.valid=!0;const n=D.getCell(r.visualRow,r.visualCol);null!==n&&(0,s.removeClass)(n,j.invalidCellClassName)}o.removeValidatorFormQueue()}}(r,h),t))}o.checkIfQueueIsEmpty()}function re(e,t){let r=e.length-1;if(r<0)return;for(;r>=0;r--){let n=!1;if(null!==e[r]){if(null!==e[r][2]&&void 0!==e[r][2]||null!==e[r][3]&&void 0!==e[r][3]){if(j.allowInsertRow)for(;e[r][0]>D.countRows()-1;){const{delta:e}=k.createRow(void 0,void 0,{source:t});if(0===e){n=!0;break}}if("array"===D.dataType&&(!j.columns||0===j.columns.length)&&j.allowInsertColumn)for(;k.propToCol(e[r][1])>D.countCols()-1;){const{delta:e}=k.createCol(void 0,void 0,{source:t});if(0===e){n=!0;break}}n||k.set(e[r][0],e[r][1],e[r][3])}}else e.splice(r,1)}D.forceFullRender=!0,U.adjustRowsAndCols(),D.runHooks("beforeChangeRender",e,t),V.lockEditor(),D._refreshBorders(null),V.unlockEditor(),D.view.adjustElementsSize(),D.runHooks("afterChange",e,t||"edit");const n=D.getActiveEditor();n&&(0,i.isDefined)(n.refreshValue)&&n.refreshValue()}function ne(e,t,r){return Array.isArray(e)?e:[[e,t,r]]}function se(e,t){const r=D.getActiveEditor(),n=D.runHooks("beforeChange",e,t||"edit"),s=e.filter((e=>null!==e));return!1===n||0===s.length?(r&&r.cancelChanges(),[]):s}this.columnIndexMapper.addLocalHook("cacheUpdated",q),this.rowIndexMapper.addLocalHook("cacheUpdated",q),this.selection.addLocalHook("beforeSetRangeStart",(e=>{this.runHooks("beforeSetRangeStart",e)})),this.selection.addLocalHook("beforeSetRangeStartOnly",(e=>{this.runHooks("beforeSetRangeStartOnly",e)})),this.selection.addLocalHook("beforeSetRangeEnd",(e=>{this.runHooks("beforeSetRangeEnd",e),e.row<0&&(e.row=this.view._wt.wtTable.getFirstVisibleRow()),e.col<0&&(e.col=this.view._wt.wtTable.getFirstVisibleColumn())})),this.selection.addLocalHook("afterSetRangeEnd",(e=>{const t=(0,h.createObjectPropListener)(!1),r=this.selection.getSelectedRange(),{from:n,to:o}=r.current(),i=r.size()-1;this.runHooks("afterSelection",n.row,n.col,o.row,o.col,t,i),this.runHooks("afterSelectionByProp",n.row,D.colToProp(n.col),o.row,D.colToProp(o.col),t,i);const a=this.selection.isSelectedByAnyHeader(),l=this.selection.selectedRange.current();let u=!0;L&&(u=!1),t.isTouched()&&(u=!t.value);const c=this.selection.isSelectedByRowHeader(),d=this.selection.isSelectedByColumnHeader();!1!==u&&(a?c?this.view.scrollViewportVertically(D.rowIndexMapper.getRenderableFromVisualIndex(e.row)):d&&this.view.scrollViewportHorizontally(D.columnIndexMapper.getRenderableFromVisualIndex(e.col)):l&&!this.selection.isMultiple()?this.view.scrollViewport(K(l.from)):this.view.scrollViewport(K(e))),c&&d?(0,s.addClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]):c?((0,s.removeClass)(this.rootElement,"ht__selection--columns"),(0,s.addClass)(this.rootElement,"ht__selection--rows")):d?((0,s.removeClass)(this.rootElement,"ht__selection--rows"),(0,s.addClass)(this.rootElement,"ht__selection--columns")):(0,s.removeClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this._refreshBorders(null)})),this.selection.addLocalHook("afterSelectionFinished",(e=>{const t=e.length-1,{from:r,to:n}=e[t];this.runHooks("afterSelectionEnd",r.row,r.col,n.row,n.col,t),this.runHooks("afterSelectionEndByProp",r.row,D.colToProp(r.col),n.row,D.colToProp(n.col),t)})),this.selection.addLocalHook("afterIsMultipleSelection",(e=>{const t=this.runHooks("afterIsMultipleSelection",e.value);e.value&&(e.value=t)})),this.selection.addLocalHook("beforeModifyTransformStart",(e=>{this.runHooks("modifyTransformStart",e)})),this.selection.addLocalHook("afterModifyTransformStart",((e,t,r)=>{this.runHooks("afterModifyTransformStart",e,t,r)})),this.selection.addLocalHook("beforeModifyTransformEnd",(e=>{this.runHooks("modifyTransformEnd",e)})),this.selection.addLocalHook("afterModifyTransformEnd",((e,t,r)=>{this.runHooks("afterModifyTransformEnd",e,t,r)})),this.selection.addLocalHook("afterDeselect",(()=>{V.destroyEditor(),this._refreshBorders(),(0,s.removeClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")})),this.selection.addLocalHook("insertRowRequire",(e=>{this.alter("insert_row_above",e,1,"auto")})),this.selection.addLocalHook("insertColRequire",(e=>{this.alter("insert_col_start",e,1,"auto")})),U={alter(e,t){var r,n;let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;const l=e=>{if(0===e.length)return[];const t=[...e];t.sort(((e,t)=>{let[r]=e,[n]=t;return r===n?0:r>n?1:-1}));return(0,c.arrayReduce)(t,((e,t)=>{let[r,n]=t;const s=e[e.length-1],[o,i]=s,a=o+i;if(r<=a){const e=Math.max(n-(a-r),0);s[1]+=e}else e.push([r,n]);return e}),[t[0]])};switch(e){case"insert_row_below":case"insert_row_above":const a=D.countSourceRows();if(j.maxRows===a)return;const u="insert_row_below"===e?"below":"above";t=null!==(r=t)&&void 0!==r?r:"below"===u?a:0;const{delta:h,startPhysicalIndex:d}=k.createRow(t,s,{source:o,mode:u});if(h){const e=X.selectedRange.current(),t=null==e?void 0:e.from,r=null==t?void 0:t.row,n=D.toVisualRow(d);if(X.isSelectedByCorner())D.selectAll();else if((0,i.isDefined)(r)&&r>=n){const{row:n,col:s}=e.to;let o=t.col;X.isSelectedByRowHeader()&&(o=-1),X.getSelectedRange().pop(),X.setRangeStartOnly(D._createCellCoords(r+h,o),!0),X.setRangeEnd(D._createCellCoords(n+h,s))}else D._refreshBorders()}break;case"insert_col_start":case"insert_col_end":const p="insert_col_end"===e?"end":"start";t=null!==(n=t)&&void 0!==n?n:"end"===p?D.countSourceCols():0;const{delta:g,startPhysicalIndex:m}=k.createCol(t,s,{source:o,mode:p});if(g){if(Array.isArray(j.colHeaders)){const e=[D.toVisualColumn(m),0];e.length+=g,Array.prototype.splice.apply(j.colHeaders,e)}const e=X.selectedRange.current(),t=null==e?void 0:e.from,r=null==t?void 0:t.col,n=D.toVisualColumn(m);if(X.isSelectedByCorner())D.selectAll();else if((0,i.isDefined)(r)&&r>=n){const{row:n,col:s}=e.to;let o=t.row;X.isSelectedByColumnHeader()&&(o=-1),X.getSelectedRange().pop(),X.setRangeStartOnly(D._createCellCoords(o,r+g),!0),X.setRangeEnd(D._createCellCoords(n,s+g))}else D._refreshBorders()}break;case"remove_row":const f=e=>{let t=0;(0,c.arrayEach)(e,(e=>{let[r,n]=e;const s=(0,i.isEmpty)(r)?D.countRows()-1:Math.max(r-t,0);Number.isInteger(r)&&(r=Math.max(r-t,0));if(!k.removeRow(r,n,o))return;const a=D.countRows(),l=j.fixedRowsTop;l>=s+1&&(j.fixedRowsTop-=Math.min(n,l-s));const u=j.fixedRowsBottom;u&&s>=a-u&&(j.fixedRowsBottom-=Math.min(n,u)),t+=n}))};Array.isArray(t)?f(l(t)):f([[t,s]]),U.adjustRowsAndCols(),D._refreshBorders();break;case"remove_col":const y=e=>{let t=0;(0,c.arrayEach)(e,(e=>{let[r,n]=e;const s=(0,i.isEmpty)(r)?D.countCols()-1:Math.max(r-t,0);let a=D.toPhysicalColumn(s);Number.isInteger(r)&&(r=Math.max(r-t,0));if(!k.removeCol(r,n,o))return;const l=j.fixedColumnsStart;l>=s+1&&(j.fixedColumnsStart-=Math.min(n,l-s)),Array.isArray(j.colHeaders)&&(void 0===a&&(a=-1),j.colHeaders.splice(a,n)),t+=n}))};Array.isArray(t)?y(l(t)):y([[t,s]]),U.adjustRowsAndCols(),D._refreshBorders();break;default:throw new Error(`There is no such action "${e}"`)}a||U.adjustRowsAndCols()},adjustRowsAndCols(){const e=j.minRows,t=j.minSpareRows,r=j.minCols,n=j.minSpareCols;if(0===D.countRows()&&0===D.countCols()&&X.deselect(),e){const t=D.countRows();t<e&&k.createRow(t,e-t,{source:"auto"})}if(t){const e=D.countEmptyRows(!0);if(e<t){const r=t-e,n=Math.min(r,j.maxRows-D.countSourceRows());k.createRow(D.countRows(),n,{source:"auto"})}}{let e;(r||n)&&(e=D.countEmptyCols(!0));let t=D.countCols();if(r&&!j.columns&&t<r){const n=r-t;e+=n,k.createCol(t,n,{source:"auto"})}if(n&&!j.columns&&"array"===D.dataType&&e<n){t=D.countCols();const r=n-e,s=Math.min(r,j.maxCols-t);k.createCol(t,s,{source:"auto"})}}if(X.isSelected()){const e=D.countRows(),t=D.countCols();(0,c.arrayEach)(X.selectedRange,(r=>{let n=!1,s=r.from.row,o=r.from.col,i=r.to.row,a=r.to.col;s>e-1?(s=e-1,n=!0,i>s&&(i=s)):i>e-1&&(i=e-1,n=!0,s>i&&(s=i)),o>t-1?(o=t-1,n=!0,a>o&&(a=o)):a>t-1&&(a=t-1,n=!0,o>a&&(o=a)),n&&D.selectCell(s,o,i,a)}))}D.view&&D.view.adjustElementsSize()},populateFromArray(e,t,r,n,s){let o,i,a,l;const u=[],d={},p=[],g=e.row,m=e.col;if(i=t.length,0===i)return!1;let f=0,y=0;switch((0,h.isObject)(r)&&(f=r.col-m+1,y=r.row-g+1),s){case"shift_down":const s=(0,c.pivot)(t),E=s.length,C=Math.max(E,f),T=D.getData().slice(g),R=(0,c.pivot)(T).slice(m,m+C);for(a=0;a<C;a+=1)if(a<E){for(o=0,i=s[a].length;o<y-i;o+=1)s[a].push(s[a][o%i]);a<R.length?p.push(s[a].concat(R[a])):p.push(s[a].concat(new Array(T.length).fill(null)))}else p.push(s[a%E].concat(R[a]));D.populateFromArray(g,m,(0,c.pivot)(p));break;case"shift_right":const w=t.length,S=Math.max(w,y),v=D.getData().slice(g).map((e=>e.slice(m)));for(o=0;o<S;o+=1)if(o<w){for(a=0,l=t[o].length;a<f-l;a+=1)t[o].push(t[o][a%l]);if(o<v.length)for(let e=0;e<v[o].length;e+=1)t[o].push(v[o][e]);else t[o].push(...new Array(v[0].length).fill(null))}else t.push(t[o%i].slice(0,S).concat(v[o]));D.populateFromArray(g,m,t);break;default:d.row=e.row,d.col=e.col;let A,N=0,O=0,M=!0;const b=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=t[e%t.length];return null!==r?n[r%n.length]:n},I=t.length,_=r?r.row-e.row+1:0;for(i=r?_:Math.max(I,_),o=0;o<i&&!(r&&d.row>r.row&&_>I||!j.allowInsertRow&&d.row>D.countRows()-1||d.row>=j.maxRows);o++){const t=o-N,s=b(t).length,c=r?r.col-e.col+1:0;if(l=r?c:Math.max(s,c),d.col=e.col,A=D.getCellMeta(d.row,d.col),"CopyPaste.paste"!==n&&"Autofill.fill"!==n||!A.skipRowOnPaste){for(O=0,a=0;a<l&&!(r&&d.col>r.col&&c>s||!j.allowInsertColumn&&d.col>D.countCols()-1||d.col>=j.maxCols);a++){if(A=D.getCellMeta(d.row,d.col),("CopyPaste.paste"===n||"Autofill.fill"===n)&&A.skipColumnOnPaste){O+=1,d.col+=1,l+=1;continue}if(A.readOnly&&"UndoRedo.undo"!==n){d.col+=1;continue}let e=b(t,a-O),r=D.getDataAtCell(d.row,d.col);if(null!==e&&"object"==typeof e)if(Array.isArray(e)&&null===r&&(r=[]),null===r||"object"!=typeof r)M=!1;else{const t=(0,h.duckSchema)(Array.isArray(r)?r:r[0]||r),n=(0,h.duckSchema)(Array.isArray(e)?e:e[0]||e);(0,h.isObjectEqual)(t,n)||Array.isArray(t)&&Array.isArray(n)?e=(0,h.deepClone)(e):M=!1}else null!==r&&"object"==typeof r&&(M=!1);M&&u.push([d.row,d.col,e]),M=!0,d.col+=1}d.row+=1}else N+=1,d.row+=1,i+=1}D.setDataAtCell(u,null,null,n||"populateFromArray")}}},this.init=function(){H.setData(j.data),D.runHooks("beforeInit"),((0,a.isMobileBrowser)()||(0,a.isIpadOS)())&&(0,s.addClass)(D.rootElement,"mobile"),this.updateSettings(j,!0),this.view=new C.default(this),V=l.default.getInstance(D,j,X),D.runHooks("init"),this.forceFullRender=!0,this.view.render(),B&&null===D.rootElement.offsetParent&&(0,s.observeVisibilityChangeOnce)(D.rootElement,(()=>{D.view._wt.wtOverlays.updateLastSpreaderSize(),D.render(),D.view.adjustElementsSize()})),"object"==typeof B&&(D.runHooks("afterChange",B[0],B[1]),B=!1),D.runHooks("afterInit")},this._createCellCoords=function(e,t){return D.view._wt.createCellCoords(e,t)},this._createCellRange=function(e,t,r){return D.view._wt.createCellRange(e,t,r)},this.validateCell=function(e,t,r,n){let s=D.getCellValidator(t);function a(e){if(!(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])||!0===t.hidden)return void r(e);const n=t.visualCol,s=t.visualRow,o=D.getCell(s,n,!0);if(o&&"TH"!==o.nodeName){const e=D.rowIndexMapper.getRenderableFromVisualIndex(s),t=D.columnIndexMapper.getRenderableFromVisualIndex(n);D.view._wt.getSetting("cellRenderer",e,t,o)}r(e)}var l;(0,i.isRegExp)(s)&&(l=s,s=function(e,t){t(l.test(e))}),(0,o.isFunction)(s)?(e=D.runHooks("beforeValidate",e,t.visualRow,t.prop,n),D._registerImmediate((()=>{s.call(t,e,(r=>{D&&(r=D.runHooks("afterValidate",r,e,t.visualRow,t.prop,n),t.valid=r,a(r),D.runHooks("postAfterValidate",r,e,t.visualRow,t.prop,n))}))}))):D._registerImmediate((()=>{t.valid=!0,a(t.valid,!1)}))},this.setDataAtCell=function(e,t,r,n){const s=ne(e,t,r),o=[];let i,a,l,u=n;for(i=0,a=s.length;i<a;i++){if("object"!=typeof s[i])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof s[i][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");l=s[i][1]>=this.countCols()?s[i][1]:k.colToProp(s[i][1]),o.push([s[i][0],l,H.getAtCell(this.toPhysicalRow(s[i][0]),s[i][1]),s[i][2]])}u||"object"!=typeof e||(u=t);const h=se(o,n);D.runHooks("afterSetDataAtCell",h,u),te(h,u,(()=>{re(h,u)}))},this.setDataAtRowProp=function(e,t,r,n){const s=ne(e,t,r),o=[];let i,a,l=n;for(i=0,a=s.length;i<a;i++)o.push([s[i][0],s[i][1],H.getAtCell(this.toPhysicalRow(s[i][0]),s[i][1]),s[i][2]]);l||"object"!=typeof e||(l=t);const u=se(o,n);D.runHooks("afterSetDataAtRowProp",u,l),te(u,l,(()=>{re(u,l)}))},this.listen=function(){D&&!D.isListening()&&(P=D.guid,D.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(P=null,D.runHooks("afterUnlisten"))},this.isListening=function(){return P===D.guid},this.destroyEditor=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];D._refreshBorders(e,t)},this.populateFromArray=function(e,t,r,n,s,o,i){if("object"!=typeof r||"object"!=typeof r[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");const a="number"==typeof n?D._createCellCoords(n,s):null;return U.populateFromArray(D._createCellCoords(e,t),r,a,o,i)},this.spliceCol=function(e,t,r){for(var n=arguments.length,s=new Array(n>3?n-3:0),o=3;o<n;o++)s[o-3]=arguments[o];return k.spliceCol(e,t,r,...s)},this.spliceRow=function(e,t,r){for(var n=arguments.length,s=new Array(n>3?n-3:0),o=3;o<n;o++)s[o-3]=arguments[o];return k.spliceRow(e,t,r,...s)},this.getSelected=function(){if(X.isSelected())return(0,c.arrayMap)(X.getSelectedRange(),(e=>{let{from:t,to:r}=e;return[t.row,t.col,r.row,r.col]}))},this.getSelectedLast=function(){const e=this.getSelected();let t;return e&&e.length>0&&(t=e[e.length-1]),t},this.getSelectedRange=function(){if(X.isSelected())return Array.from(X.getSelectedRange())},this.getSelectedRangeLast=function(){const e=this.getSelectedRange();let t;return e&&e.length>0&&(t=e[e.length-1]),t},this.emptySelectedCells=function(e){if(!X.isSelected()||0===this.countRows()||0===this.countCols())return;const t=[];(0,c.arrayEach)(X.getSelectedRange(),(e=>{const r=e.getTopStartCorner(),n=e.getBottomEndCorner();(0,E.rangeEach)(r.row,n.row,(e=>{(0,E.rangeEach)(r.col,n.col,(r=>{this.getCellMeta(e,r).readOnly||t.push([e,r,null])}))}))})),t.length>0&&this.setDataAtCell(t,e)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const e=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(e,0),this.isRenderSuspended()||e!==this.renderSuspendedCounter||(this.renderCall?this.render():this._refreshBorders(null))},this.render=function(){this.view&&(this.renderCall=!0,this.forceFullRender=!0,this.isRenderSuspended()||(V.lockEditor(),this._refreshBorders(null),V.unlockEditor()))},this.batchRender=function(e){this.suspendRender();const t=e();return this.resumeRender(),t},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(t,0),(!this.isExecutionSuspended()&&t===this.executionSuspendedCounter||e)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.suspendExecution();const r=e();return this.resumeExecution(t),r},this.batch=function(e){this.suspendRender(),this.suspendExecution();const t=e();return this.resumeExecution(),this.resumeRender(),t},this.refreshDimensions=function(){if(!D.view)return;const{width:e,height:t}=D.view.getLastSize(),{width:r,height:n}=D.rootElement.getBoundingClientRect(),s=r!==e||n!==t;!1===D.runHooks("beforeRefreshDimensions",{width:e,height:t},{width:r,height:n},s)||((s||D.view._wt.wtOverlays.scrollableElement===D.rootWindow)&&(D.view.setLastSize(r,n),D.render()),D.runHooks("afterRefreshDimensions",{width:e,height:t},{width:r,height:n},s))},this.updateData=function(e,t){(0,b.replaceData)(e,(e=>{k=e}),(e=>{k=e,D.columnIndexMapper.fitToLength(this.getInitialColumnCount()),D.rowIndexMapper.fitToLength(this.countSourceRows()),U.adjustRowsAndCols()}),{hotInstance:D,dataMap:k,dataSource:H,internalSource:"updateData",source:t,metaManager:Y,firstRun:B})},this.loadData=function(e,t){(0,b.replaceData)(e,(e=>{k=e}),(()=>{Y.clearCellsCache(),D.initIndexMappers(),U.adjustRowsAndCols(),B&&(B=[null,"loadData"])}),{hotInstance:D,dataMap:k,dataSource:H,internalSource:"loadData",source:t,metaManager:Y,firstRun:B})},this.getInitialColumnCount=function(){const e=j.columns;let t=0;if(Array.isArray(e))t=e.length;else if((0,o.isFunction)(e))if("array"===D.dataType){const r=this.countSourceCols();for(let n=0;n<r;n+=1)e(n)&&(t+=1)}else"object"!==D.dataType&&"function"!==D.dataType||(t=k.colToPropCache.length);else if((0,i.isDefined)(j.dataSchema)){const e=k.getSchema();t=Array.isArray(e)?e.length:(0,h.deepObjectSize)(e)}else t=this.countSourceCols();return t},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(e,t,r,n){return(0,i.isUndefined)(e)?k.getAll():k.getRange(D._createCellCoords(e,t),D._createCellCoords(r,n),k.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,r,n){return k.getCopyableText(D._createCellCoords(e,t),D._createCellCoords(r,n))},this.getCopyableData=function(e,t){return k.getCopyable(e,k.colToProp(t))},this.getSchema=function(){return k.getSchema()},this.updateSettings=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=(B?D.loadData:D.updateData).bind(this);let n,s,a=!1;if((0,i.isDefined)(e.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if((0,i.isDefined)(e.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if((0,i.isDefined)(e.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(n in e)"data"===n||("language"===n?Q(e.language):"className"===n?Z("className",e.className):"tableClassName"===n&&D.table?(Z("tableClassName",e.tableClassName),D.view._wt.wtOverlays.syncOverlayTableClassNames()):A.default.getSingleton().isRegistered(n)||A.default.getSingleton().isDeprecated(n)?((0,o.isFunction)(e[n])||Array.isArray(e[n]))&&(e[n].initialHook=!0,D.addHook(n,e[n])):!t&&(0,h.hasOwnProperty)(e,n)&&(z[n]=e[n]));void 0===e.data&&void 0===j.data?r(null,"updateSettings"):void 0!==e.data?r(e.data,"updateSettings"):void 0!==e.columns&&(k.createMap(),D.initIndexMappers());const l=D.countCols(),u=j.columns;if(u&&(0,o.isFunction)(u)&&(a=!0),void 0===e.cell&&void 0===e.cells&&void 0===e.columns||Y.clearCache(),l>0)for(n=0,s=0;n<l;n++){if(u){const e=a?u(n):u[s];e&&Y.updateColumnMeta(s,e)}s+=1}(0,i.isDefined)(e.cell)&&(0,h.objectEach)(e.cell,(e=>{D.setCellMetaObject(e.row,e.col,e)})),D.runHooks("afterCellMetaReset");let c=D.rootElement.style.height;""!==c&&(c=parseInt(D.rootElement.style.height,10));let d=e.height;if((0,o.isFunction)(d)&&(d=d()),t){D.rootElement.getAttribute("style")&&D.rootElement.setAttribute("data-initialstyle",D.rootElement.getAttribute("style"))}if(null===d){const e=D.rootElement.getAttribute("data-initialstyle");e&&(e.indexOf("height")>-1||e.indexOf("overflow")>-1)?D.rootElement.setAttribute("style",e):(D.rootElement.style.height="",D.rootElement.style.overflow="")}else void 0!==d&&(D.rootElement.style.height=isNaN(d)?`${d}`:`${d}px`,D.rootElement.style.overflow="hidden");if(void 0!==e.width){let t=e.width;(0,o.isFunction)(t)&&(t=t()),D.rootElement.style.width=isNaN(t)?`${t}`:`${t}px`}t||(D.view&&(D.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),D.view._wt.exportSettingsAsClassNames()),D.runHooks("afterUpdateSettings",e)),U.adjustRowsAndCols(),D.view&&!B&&(D.forceFullRender=!0,V.lockEditor(),D._refreshBorders(null),D.view._wt.wtOverlays.adjustElementsSize(),V.unlockEditor()),t||!D.view||""!==c&&""!==d&&void 0!==d||c===d||D.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const e=D.getSelectedLast();if(j.getValue){if((0,o.isFunction)(j.getValue))return j.getValue.call(D);if(e)return D.getData()[e[0][0]][j.getValue]}else if(e)return D.getDataAtCell(e[0],e[1])},this.getSettings=function(){return j},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(e,t,r,n,s){U.alter(e,t,r,n,s)},this.getCell=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t,s=e;if(t>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(t)))return null;n=this.columnIndexMapper.getRenderableFromVisualIndex(t)}if(e>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(e)))return null;s=this.rowIndexMapper.getRenderableFromVisualIndex(e)}return null===s||null===n?null:D.view.getCellAtCoords(D._createCellCoords(s,n),r)},this.getCoords=function(e){const t=this.view._wt.wtTable.getCoords(e);if(null===t)return null;const{row:r,col:n}=t;let s=r,o=n;return r>=0&&(s=this.rowIndexMapper.getVisualFromRenderableIndex(r)),n>=0&&(o=this.columnIndexMapper.getVisualFromRenderableIndex(n)),D._createCellCoords(s,o)},this.colToProp=function(e){return k.colToProp(e)},this.propToCol=function(e){return k.propToCol(e)},this.toVisualRow=e=>this.rowIndexMapper.getVisualFromPhysicalIndex(e),this.toVisualColumn=e=>this.columnIndexMapper.getVisualFromPhysicalIndex(e),this.toPhysicalRow=e=>this.rowIndexMapper.getPhysicalFromVisualIndex(e),this.toPhysicalColumn=e=>this.columnIndexMapper.getPhysicalFromVisualIndex(e),this.getDataAtCell=function(e,t){return k.get(e,k.colToProp(t))},this.getDataAtRowProp=function(e,t){return k.get(e,t)},this.getDataAtCol=function(e){const t=[],r=k.getRange(D._createCellCoords(0,e),D._createCellCoords(j.data.length-1,e),k.DESTINATION_RENDERER);for(let e=0;e<r.length;e+=1)for(let n=0;n<r[e].length;n+=1)t.push(r[e][n]);return t},this.getDataAtProp=function(e){const t=[],r=k.getRange(D._createCellCoords(0,k.propToCol(e)),D._createCellCoords(j.data.length-1,k.propToCol(e)),k.DESTINATION_RENDERER);for(let e=0;e<r.length;e+=1)for(let n=0;n<r[e].length;n+=1)t.push(r[e][n]);return t},this.getSourceData=function(e,t,r,n){let s;return s=void 0===e?H.getData():H.getByRange(D._createCellCoords(e,t),D._createCellCoords(r,n)),s},this.getSourceDataArray=function(e,t,r,n){let s;return s=void 0===e?H.getData(!0):H.getByRange(D._createCellCoords(e,t),D._createCellCoords(r,n),!0),s},this.getSourceDataAtCol=function(e){return H.getAtColumn(e)},this.setSourceDataAtCell=function(e,t,r,n){const s=ne(e,t,r),o=this.hasHook("afterSetSourceDataAtCell"),a=[];o&&(0,c.arrayEach)(s,(e=>{let[t,r,n]=e;a.push([t,r,H.getAtCell(t,r),n])})),(0,c.arrayEach)(s,(e=>{let[t,r,n]=e;H.setAtCell(t,r,n)})),o&&this.runHooks("afterSetSourceDataAtCell",a,n),this.render();const l=D.getActiveEditor();l&&(0,i.isDefined)(l.refreshValue)&&l.refreshValue()},this.getSourceDataAtRow=function(e){return H.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return H.getAtCell(e,t)},this.getDataAtRow=function(e){return k.getRange(D._createCellCoords(e,0),D._createCellCoords(e,this.countCols()-1),k.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(e,t,r,n){const s=void 0===e?[0,0,this.countRows(),this.countCols()]:[e,t,r,n],[o,i]=s;let[,,a,l]=s,u=null,h=null;void 0===a&&(a=o),void 0===l&&(l=i);let c="mixed";return(0,E.rangeEach)(Math.max(Math.min(o,a),0),Math.max(o,a),(e=>{let t=!0;return(0,E.rangeEach)(Math.max(Math.min(i,l),0),Math.max(i,l),(r=>{const n=this.getCellMeta(e,r);return h=n.type,u?t=u===h:u=h,t})),c=t?h:"mixed",t})),c},this.removeCellMeta=function(e,t,r){const[n,s]=[this.toPhysicalRow(e),this.toPhysicalColumn(t)];let o=Y.getCellMetaKeyValue(n,s,r);!1!==D.runHooks("beforeRemoveCellMeta",e,t,r,o)&&(Y.removeCellMeta(n,s,r),D.runHooks("afterRemoveCellMeta",e,t,r,o)),o=null},this.spliceCellsMeta=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(n.length>0&&!Array.isArray(n[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");t>0&&Y.removeRow(this.toPhysicalRow(e),t),n.length>0&&(0,c.arrayEach)(n.reverse(),(t=>{Y.createRow(this.toPhysicalRow(e)),(0,c.arrayEach)(t,((t,r)=>this.setCellMetaObject(e,r,t)))})),D.render()},this.setCellMetaObject=function(e,t,r){"object"==typeof r&&(0,h.objectEach)(r,((r,n)=>{this.setCellMeta(e,t,n,r)}))},this.setCellMeta=function(e,t,r,n){if(!1===D.runHooks("beforeSetCellMeta",e,t,r,n))return;let s=e,o=t;e<this.countRows()&&(s=this.toPhysicalRow(e)),t<this.countCols()&&(o=this.toPhysicalColumn(t)),Y.setCellMeta(s,o,r,n),D.runHooks("afterSetCellMeta",e,t,r,n)},this.getCellsMeta=function(){return Y.getCellsMeta()},this.getCellMeta=function(e,t){let r=this.toPhysicalRow(e),n=this.toPhysicalColumn(t);return null===r&&(r=e),null===n&&(n=t),Y.getCellMeta(r,n,{visualRow:e,visualColumn:t})},this.getCellMetaAtRow=function(e){return Y.getCellsMetaAtRow(e)},this.isColumnModificationAllowed=function(){return!("object"===D.dataType||j.columns)},this.getCellRenderer=function(e,t){const r="number"==typeof e?D.getCellMeta(e,t).renderer:e.renderer;return"string"==typeof r?(0,g.getRenderer)(r):(0,i.isUndefined)(r)?(0,g.getRenderer)("text"):r},this.getCellEditor=function(e,t){const r="number"==typeof e?D.getCellMeta(e,t).editor:e.editor;return"string"==typeof r?(0,m.getEditor)(r):(0,i.isUndefined)(r)?(0,m.getEditor)("text"):r},this.getCellValidator=function(e,t){const r="number"==typeof e?D.getCellMeta(e,t).validator:e.validator;return"string"==typeof r?(0,f.getValidator)(r):r},this.validateCells=function(e){this._validateCells(e)},this.validateRows=function(e,t){if(!Array.isArray(e))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(t,e)},this.validateColumns=function(e,t){if(!Array.isArray(e))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(t,void 0,e)},this._validateCells=function(e,t,r){const n=new J;e&&(n.onQueueEmpty=e);let s=D.countRows()-1;for(;s>=0;){if(void 0!==t&&-1===t.indexOf(s)){s-=1;continue}let e=D.countCols()-1;for(;e>=0;)void 0===r||-1!==r.indexOf(e)?(n.addValidatorToQueue(),D.validateCell(D.getDataAtCell(s,e),D.getCellMeta(s,e),(e=>{if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");!1===e&&(n.valid=!1),n.removeValidatorFormQueue()}),"validateCells"),e-=1):e-=1;s-=1}n.checkIfQueueIsEmpty()},this.getRowHeader=function(e){let t=j.rowHeaders,r=e;return void 0!==r&&(r=D.runHooks("modifyRowHeader",r)),void 0===r?(t=[],(0,E.rangeEach)(D.countRows()-1,(e=>{t.push(D.getRowHeader(e))}))):Array.isArray(t)&&void 0!==t[r]?t=t[r]:(0,o.isFunction)(t)?t=t(r):t&&"string"!=typeof t&&"number"!=typeof t&&(t=r+1),t},this.hasRowHeaders=function(){return!!j.rowHeaders},this.hasColHeaders=function(){if(void 0!==j.colHeaders&&null!==j.colHeaders)return!!j.colHeaders;for(let e=0,t=D.countCols();e<t;e++)if(D.getColHeader(e))return!0;return!1},this.getColHeader=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;const r=D.runHooks("modifyColHeader",e);if(void 0===r){const e=[],t=D.countCols();for(let r=0;r<t;r++)e.push(D.getColHeader(r));return e}let n=j.colHeaders;const s=D.toPhysicalColumn(r),i=function(e){const t=[],r=D.countCols();let n=0;for(;n<r;n++)(0,o.isFunction)(j.columns)&&j.columns(n)&&t.push(n);return t[e]}(s);return!1===j.colHeaders?n=null:j.columns&&(0,o.isFunction)(j.columns)&&j.columns(i)&&j.columns(i).title?n=j.columns(i).title:j.columns&&j.columns[s]&&j.columns[s].title?n=j.columns[s].title:Array.isArray(j.colHeaders)&&void 0!==j.colHeaders[s]?n=j.colHeaders[s]:(0,o.isFunction)(j.colHeaders)?n=j.colHeaders(s):j.colHeaders&&"string"!=typeof j.colHeaders&&"number"!=typeof j.colHeaders&&(n=(0,R.spreadsheetColumnLabel)(r)),n=D.runHooks("modifyColumnHeaderValue",n,e,t),n},this._getColWidthFromSettings=function(e){let t;if(e>=0){t=D.getCellMeta(0,e).width}if(void 0!==t&&t!==j.width||(t=j.colWidths),null!=t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getColWidth=function(e){let t=D._getColWidthFromSettings(e);return t=D.runHooks("modifyColWidth",t,e),void 0===t&&(t=v.ViewportColumnsCalculator.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){let t=j.rowHeights;if(null!=t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){let t=D._getRowHeightFromSettings(e);return t=D.runHooks("modifyRowHeight",t,e),t},this.countSourceRows=function(){return H.countRows()},this.countSourceCols=function(){return H.countFirstRowKeys()},this.countRows=function(){return k.getLength()},this.countCols=function(){const e=j.maxCols,t=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(e,t)},this.countRenderedRows=function(){return D.view._wt.drawn?D.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return D.view._wt.drawn?D.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return D.view._wt.drawn?D.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return D.view._wt.drawn?D.view._wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;return(0,E.rangeEachReverse)(D.countRows()-1,(r=>{if(D.isEmptyRow(r))t+=1;else if(!0===e)return!1})),t},this.countEmptyCols=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;return(0,E.rangeEachReverse)(D.countCols()-1,(r=>{if(D.isEmptyCol(r))t+=1;else if(!0===e)return!1})),t},this.isEmptyRow=function(e){return j.isEmptyRow.call(D,e)},this.isEmptyCol=function(e){return j.isEmptyCol.call(D,e)},this.selectCell=function(e,t,r,n){let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];return!(0,i.isUndefined)(e)&&!(0,i.isUndefined)(t)&&this.selectCells([[e,t,r,n]],s,o)},this.selectCells=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[[]],t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(L=!0);const r=X.selectCells(e);return r&&t&&D.listen(),L=!1,r},this.selectColumns=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return X.selectColumns(e,t)},this.selectRows=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return X.selectRows(e,t)},this.deselectCell=function(){X.deselect()},this.selectAll=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e&&this.hasRowHeaders(),r=e&&this.hasColHeaders();L=!0,X.selectAll(t,r),L=!1};const oe=(e,t)=>e.getNearestNotHiddenIndex(t,1,!0);this.scrollViewportTo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=!r,o=!n;let i=e,a=t;if(!(arguments.length>4&&void 0!==arguments[4])||arguments[4]){const r=Number.isInteger(e),n=Number.isInteger(t),s=r?oe(this.rowIndexMapper,e):void 0,o=n?oe(this.columnIndexMapper,t):void 0;if(null===s||null===o)return!1;i=r?D.rowIndexMapper.getRenderableFromVisualIndex(s):void 0,a=n?D.columnIndexMapper.getRenderableFromVisualIndex(o):void 0}const l=Number.isInteger(i),u=Number.isInteger(a);return l&&u?D.view.scrollViewport(D._createCellCoords(i,a),s,n,r,o):l&&!1===u?D.view.scrollViewportVertically(i,s,r):!(!u||!1!==l)&&D.view.scrollViewportHorizontally(a,n,o)},this.destroy=function(){if(D._clearTimeouts(),D._clearImmediates(),D.view&&D.view.destroy(),H&&H.destroy(),H=null,this.getShortcutManager().destroy(),Y.clearCache(),(0,S.isRootInstance)(D)){const e=this.rootDocument.querySelector(".hot-display-license-info");e&&e.parentNode.removeChild(e)}(0,s.empty)(D.rootElement),F.destroy(),V&&V.destroy(),D.batchExecution((()=>{D.rowIndexMapper.unregisterAll(),D.columnIndexMapper.unregisterAll(),$.getItems().forEach((e=>{let[,t]=e;t.destroy()})),$.clear(),D.runHooks("afterDestroy")}),!0),A.default.getSingleton().destroy(D),(0,h.objectEach)(D,((e,t,r)=>{var n;(0,o.isFunction)(e)?r[t]=(n=t,()=>{throw new Error(`The "${n}" method cannot be called because this Handsontable instance has been destroyed`)}):"guid"!==t&&(r[t]=null)})),D.isDestroyed=!0,k&&k.destroy(),k=null,U=null,X=null,V=null,D=null},this.getActiveEditor=function(){return V.getActiveEditor()},this.getPlugin=function(e){const t=(0,y.toUpperCaseFirst)(e);return"UndoRedo"===t?this.undoRedo:$.getItem(t)},this.getPluginName=function(e){return e===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:$.getId(e)},this.getInstance=function(){return D},this.addHook=function(e,t){A.default.getSingleton().add(e,t,D)},this.hasHook=function(e){return A.default.getSingleton().has(e,D)||A.default.getSingleton().has(e)},this.addHookOnce=function(e,t){A.default.getSingleton().once(e,t,D)},this.removeHook=function(e,t){A.default.getSingleton().remove(e,t,D)},this.runHooks=function(e,t,r,n,s,o,i){return A.default.getSingleton().run(D,e,t,r,n,s,o,i)},this.getTranslatedPhrase=function(e,t){return(0,N.getTranslatedPhrase)(j.language,e,t)},this.toHTML=()=>(0,d.instanceToHTML)(this),this.toTableElement=()=>{const e=this.rootDocument.createElement("div");return e.insertAdjacentHTML("afterbegin",(0,d.instanceToHTML)(this)),e.firstElementChild},this.timeouts=[],this._registerTimeout=function(e){let t=e;"function"==typeof t&&(t=setTimeout(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)),this.timeouts.push(t)},this._clearTimeouts=function(){(0,c.arrayEach)(this.timeouts,(e=>{clearTimeout(e)}))},this.immediates=[],this._registerImmediate=function(e){this.immediates.push(setImmediate(e))},this._clearImmediates=function(){(0,c.arrayEach)(this.immediates,(e=>{clearImmediate(e)}))},this._refreshBorders=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];V.destroyEditor(e),D.view.render(),t&&X.isSelected()&&V.prepareEditor()},this.isRtl=function(){return"rtl"===D.rootWindow.getComputedStyle(D.rootElement).direction},this.isLtr=function(){return!D.isRtl()},this.getDirectionFactor=function(){return D.isLtr()?1:-1};const ie=(0,_.createShortcutManager)({handleEvent(e){const t=D.isListening(),r=void 0!==(null==e?void 0:e.key);return t&&r},beforeKeyDown:e=>this.runHooks("beforeKeyDown",e),afterKeyDown:e=>{this.isDestroyed||D.runHooks("afterDocumentKeyDown",e)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",(e=>{!1===e.ctrlKey&&!1===e.metaKey&&ie.releasePressedKeys()})),this.getShortcutManager=function(){return ie};const ae=ie.addContext("grid"),le={runOnlyIf:()=>(0,i.isDefined)(D.getSelected())&&D.countRenderedRows()>0&&D.countRenderedCols()>0,group:x};ie.setActiveContextName("grid"),ae.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>{D.selectAll()}},{keys:[["Control/Meta","Enter"]],callback:()=>{const e=D.getSelectedRange(),{row:t,col:r}=e[e.length-1].highlight,n=D.getDataAtCell(t,r),s=new Map;for(let o=0;o<e.length;o++)e[o].forAll(((e,o)=>{if(e>=0&&o>=0&&(e!==t||o!==r)){const{readOnly:t}=D.getCellMeta(e,o);t||s.set(`${e}x${o}`,[e,o,n])}}));D.setDataAtCell(Array.from(s.values()))},runOnlyIf:()=>D.getSelectedRangeLast().getCellsCount()>1},{keys:[["ArrowUp"]],callback:()=>{X.transformStart(-1,0)}},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>{X.setRangeStart(D._createCellCoords(D.rowIndexMapper.getNearestNotHiddenIndex(0,1),D.getSelectedRangeLast().highlight.col))}},{keys:[["ArrowUp","Shift"]],callback:()=>{X.transformEnd(-1,0)}},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>{const{from:e,to:t}=D.getSelectedRangeLast(),r=D.rowIndexMapper.getNearestNotHiddenIndex(0,1);X.setRangeStart(e.clone()),X.setRangeEnd(D._createCellCoords(r,t.col))},runOnlyIf:()=>!(D.selection.isSelectedByCorner()||D.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>{X.transformStart(1,0)}},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>{X.setRangeStart(D._createCellCoords(D.rowIndexMapper.getNearestNotHiddenIndex(D.countRows()-1,-1),D.getSelectedRangeLast().highlight.col))}},{keys:[["ArrowDown","Shift"]],callback:()=>{X.transformEnd(1,0)}},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>{const{from:e,to:t}=D.getSelectedRangeLast(),r=D.rowIndexMapper.getNearestNotHiddenIndex(D.countRows()-1,-1);X.setRangeStart(e.clone()),X.setRangeEnd(D._createCellCoords(r,t.col))},runOnlyIf:()=>!(D.selection.isSelectedByCorner()||D.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>{X.transformStart(0,-1*D.getDirectionFactor())}},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>{const e=D.getSelectedRangeLast().highlight.row,t=D.columnIndexMapper.getNearestNotHiddenIndex(...D.isRtl()?[D.countCols()-1,-1]:[0,1]);X.setRangeStart(D._createCellCoords(e,t))}},{keys:[["ArrowLeft","Shift"]],callback:()=>{X.transformEnd(0,-1*D.getDirectionFactor())}},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>{const{from:e,to:t}=D.getSelectedRangeLast(),r=D.columnIndexMapper.getNearestNotHiddenIndex(...D.isRtl()?[D.countCols()-1,-1]:[0,1]);X.setRangeStart(e.clone()),X.setRangeEnd(D._createCellCoords(t.row,r))},runOnlyIf:()=>!(D.selection.isSelectedByCorner()||D.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>{X.transformStart(0,D.getDirectionFactor())}},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>{const e=D.getSelectedRangeLast().highlight.row,t=D.columnIndexMapper.getNearestNotHiddenIndex(...D.isRtl()?[0,1]:[D.countCols()-1,-1]);X.setRangeStart(D._createCellCoords(e,t))}},{keys:[["ArrowRight","Shift"]],callback:()=>{X.transformEnd(0,D.getDirectionFactor())}},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>{const{from:e,to:t}=D.getSelectedRangeLast(),r=D.columnIndexMapper.getNearestNotHiddenIndex(...D.isRtl()?[0,1]:[D.countCols()-1,-1]);X.setRangeStart(e.clone()),X.setRangeEnd(D._createCellCoords(t.row,r))},runOnlyIf:()=>!(D.selection.isSelectedByCorner()||D.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>{const e=parseInt(D.getSettings().fixedColumnsStart,10),t=D.getSelectedRangeLast().highlight.row,r=D.columnIndexMapper.getNearestNotHiddenIndex(e,1);X.setRangeStart(D._createCellCoords(t,r))},runOnlyIf:()=>D.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>{X.setRangeEnd(D._createCellCoords(X.selectedRange.current().from.row,D.columnIndexMapper.getNearestNotHiddenIndex(0,1)))}},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>{const e=parseInt(D.getSettings().fixedRowsTop,10),t=parseInt(D.getSettings().fixedColumnsStart,10),r=D.rowIndexMapper.getNearestNotHiddenIndex(e,1),n=D.columnIndexMapper.getNearestNotHiddenIndex(t,1);X.setRangeStart(D._createCellCoords(r,n))},runOnlyIf:()=>D.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>{X.setRangeStart(D._createCellCoords(D.getSelectedRangeLast().highlight.row,D.columnIndexMapper.getNearestNotHiddenIndex(D.countCols()-1,-1)))},runOnlyIf:()=>D.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>{X.setRangeEnd(D._createCellCoords(X.selectedRange.current().from.row,D.columnIndexMapper.getNearestNotHiddenIndex(D.countCols()-1,-1)))}},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>{const e=parseInt(D.getSettings().fixedRowsBottom,10),t=D.rowIndexMapper.getNearestNotHiddenIndex(D.countRows()-e-1,-1),r=D.columnIndexMapper.getNearestNotHiddenIndex(D.countCols()-1,-1);X.setRangeStart(D._createCellCoords(t,r))},runOnlyIf:()=>D.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>{X.transformStart(-D.countVisibleRows(),0)}},{keys:[["PageUp","Shift"]],callback:()=>{const{to:e}=D.getSelectedRangeLast(),t=Math.max(e.row-D.countVisibleRows(),0),r=D.rowIndexMapper.getNearestNotHiddenIndex(t,1);if(null!==r){const t=D._createCellCoords(r,e.col),n=e.row-D.view.getFirstFullyVisibleRow(),s=Math.max(t.row-n,0);X.setRangeEnd(t),D.scrollViewportTo(s)}}},{keys:[["PageDown"]],callback:()=>{X.transformStart(D.countVisibleRows(),0)}},{keys:[["PageDown","Shift"]],callback:()=>{const{to:e}=D.getSelectedRangeLast(),t=Math.min(e.row+D.countVisibleRows(),D.countRows()-1),r=D.rowIndexMapper.getNearestNotHiddenIndex(t,-1);if(null!==r){const t=D._createCellCoords(r,e.col),n=e.row-D.view.getFirstFullyVisibleRow(),s=Math.min(t.row-n,D.countRows()-1);X.setRangeEnd(t),D.scrollViewportTo(s)}}},{keys:[["Tab"]],callback:e=>{const t="function"==typeof j.tabMoves?j.tabMoves(e):j.tabMoves;X.transformStart(t.row,t.col,!0)}},{keys:[["Shift","Tab"]],callback:e=>{const t="function"==typeof j.tabMoves?j.tabMoves(e):j.tabMoves;X.transformStart(-t.row,-t.col)}}],le),(0,p.getPluginsNames)().forEach((e=>{const t=(0,p.getPlugin)(e);$.addItem(e,new t(this))})),A.default.getSingleton().run(D,"construct")},r(203),r(273),r(289);var s=r(302),o=r(445),i=r(305),a=r(446),l=n(r(450)),u=n(r(457)),h=r(447),c=r(444),d=r(458),p=r(459),g=r(464),m=r(453),f=r(465),y=r(303),E=r(461),C=n(r(466)),T=n(r(541)),R=r(542),w=r(543),S=r(540),v=r(476),A=n(r(454)),N=r(563),O=r(564),M=r(569),b=r(584),I=r(462),_=r(600);const x="gridDefault";let P=null;new Set},(e,t,r)=>{"use strict";var n=r(204),s=r(241),o=r(265),i=r(270),a=r(272);n({target:"Array",proto:!0,arity:1,forced:r(208)((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=s(this),r=o(t),n=arguments.length;a(r+n);for(var l=0;l<n;l++)t[r]=arguments[l],r++;return i(t,r),r}})},(e,t,r)=>{"use strict";var n=r(205),s=r(206).f,o=r(245),i=r(249),a=r(239),l=r(257),u=r(269);e.exports=function(e,t){var r,h,c,d,p,g=e.target,m=e.global,f=e.stat;if(r=m?n:f?n[g]||a(g,{}):(n[g]||{}).prototype)for(h in t){if(d=t[h],c=e.dontCallGetSet?(p=s(r,h))&&p.value:r[h],!u(m?h:g+(f?".":"#")+h,e.forced)&&void 0!==c){if(typeof d==typeof c)continue;l(d,c)}(e.sham||c&&c.sham)&&o(d,"sham",!0),i(r,h,d,e)}}},function(e){"use strict";var t=function(e){return e&&e.Math==Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(e,t,r)=>{"use strict";var n=r(207),s=r(209),o=r(211),i=r(212),a=r(213),l=r(219),u=r(240),h=r(243),c=Object.getOwnPropertyDescriptor;t.f=n?c:function(e,t){if(e=a(e),t=l(t),h)try{return c(e,t)}catch(e){}if(u(e,t))return i(!s(o.f,e,t),e[t])}},(e,t,r)=>{"use strict";var n=r(208);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,r)=>{"use strict";var n=r(210),s=Function.prototype.call;e.exports=n?s.bind(s):function(){return s.apply(s,arguments)}},(e,t,r)=>{"use strict";var n=r(208);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!r.call({1:2},1);t.f=s?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},(e,t,r)=>{"use strict";var n=r(214),s=r(217);e.exports=function(e){return n(s(e))}},(e,t,r)=>{"use strict";var n=r(215),s=r(208),o=r(216),i=Object,a=n("".split);e.exports=s((function(){return!i("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a(e,""):i(e)}:i},(e,t,r)=>{"use strict";var n=r(210),s=Function.prototype,o=s.call,i=n&&s.bind.bind(o,o);e.exports=n?i:function(e){return function(){return o.apply(e,arguments)}}},(e,t,r)=>{"use strict";var n=r(215),s=n({}.toString),o=n("".slice);e.exports=function(e){return o(s(e),8,-1)}},(e,t,r)=>{"use strict";var n=r(218),s=TypeError;e.exports=function(e){if(n(e))throw s("Can't call method on "+e);return e}},e=>{"use strict";e.exports=function(e){return null==e}},(e,t,r)=>{"use strict";var n=r(220),s=r(224);e.exports=function(e){var t=n(e,"string");return s(t)?t:t+""}},(e,t,r)=>{"use strict";var n=r(209),s=r(221),o=r(224),i=r(231),a=r(234),l=r(235),u=TypeError,h=l("toPrimitive");e.exports=function(e,t){if(!s(e)||o(e))return e;var r,l=i(e,h);if(l){if(void 0===t&&(t="default"),r=n(l,e,t),!s(r)||o(r))return r;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},(e,t,r)=>{"use strict";var n=r(222),s=r(223),o=s.all;e.exports=s.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===o}:function(e){return"object"==typeof e?null!==e:n(e)}},(e,t,r)=>{"use strict";var n=r(223),s=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===s}:function(e){return"function"==typeof e}},e=>{"use strict";var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},(e,t,r)=>{"use strict";var n=r(225),s=r(222),o=r(226),i=r(227),a=Object;e.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return s(t)&&o(t.prototype,a(e))}},(e,t,r)=>{"use strict";var n=r(205),s=r(222);e.exports=function(e,t){return arguments.length<2?(r=n[e],s(r)?r:void 0):n[e]&&n[e][t];var r}},(e,t,r)=>{"use strict";var n=r(215);e.exports=n({}.isPrototypeOf)},(e,t,r)=>{"use strict";var n=r(228);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(e,t,r)=>{"use strict";var n=r(229),s=r(208),o=r(205).String;e.exports=!!Object.getOwnPropertySymbols&&!s((function(){var e=Symbol();return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},(e,t,r)=>{"use strict";var n,s,o=r(205),i=r(230),a=o.process,l=o.Deno,u=a&&a.versions||l&&l.version,h=u&&u.v8;h&&(s=(n=h.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!s&&i&&(!(n=i.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=i.match(/Chrome\/(\d+)/))&&(s=+n[1]),e.exports=s},e=>{"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(e,t,r)=>{"use strict";var n=r(232),s=r(218);e.exports=function(e,t){var r=e[t];return s(r)?void 0:n(r)}},(e,t,r)=>{"use strict";var n=r(222),s=r(233),o=TypeError;e.exports=function(e){if(n(e))return e;throw o(s(e)+" is not a function")}},e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},(e,t,r)=>{"use strict";var n=r(209),s=r(222),o=r(221),i=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&s(r=e.toString)&&!o(a=n(r,e)))return a;if(s(r=e.valueOf)&&!o(a=n(r,e)))return a;if("string"!==t&&s(r=e.toString)&&!o(a=n(r,e)))return a;throw i("Can't convert object to primitive value")}},(e,t,r)=>{"use strict";var n=r(205),s=r(236),o=r(240),i=r(242),a=r(228),l=r(227),u=n.Symbol,h=s("wks"),c=l?u.for||u:u&&u.withoutSetter||i;e.exports=function(e){return o(h,e)||(h[e]=a&&o(u,e)?u[e]:c("Symbol."+e)),h[e]}},(e,t,r)=>{"use strict";var n=r(237),s=r(238);(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.32.0",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE",source:"https://github.com/zloirock/core-js"})},e=>{"use strict";e.exports=!1},(e,t,r)=>{"use strict";var n=r(205),s=r(239),o="__core-js_shared__",i=n[o]||s(o,{});e.exports=i},(e,t,r)=>{"use strict";var n=r(205),s=Object.defineProperty;e.exports=function(e,t){try{s(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},(e,t,r)=>{"use strict";var n=r(215),s=r(241),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(s(e),t)}},(e,t,r)=>{"use strict";var n=r(217),s=Object;e.exports=function(e){return s(n(e))}},(e,t,r)=>{"use strict";var n=r(215),s=0,o=Math.random(),i=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+i(++s+o,36)}},(e,t,r)=>{"use strict";var n=r(207),s=r(208),o=r(244);e.exports=!n&&!s((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},(e,t,r)=>{"use strict";var n=r(205),s=r(221),o=n.document,i=s(o)&&s(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},(e,t,r)=>{"use strict";var n=r(207),s=r(246),o=r(212);e.exports=n?function(e,t,r){return s.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},(e,t,r)=>{"use strict";var n=r(207),s=r(243),o=r(247),i=r(248),a=r(219),l=TypeError,u=Object.defineProperty,h=Object.getOwnPropertyDescriptor,c="enumerable",d="configurable",p="writable";t.f=n?o?function(e,t,r){if(i(e),t=a(t),i(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=h(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:c in r?r[c]:n[c],writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(i(e),t=a(t),i(r),s)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},(e,t,r)=>{"use strict";var n=r(207),s=r(208);e.exports=n&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(e,t,r)=>{"use strict";var n=r(221),s=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw o(s(e)+" is not an object")}},(e,t,r)=>{"use strict";var n=r(222),s=r(246),o=r(250),i=r(239);e.exports=function(e,t,r,a){a||(a={});var l=a.enumerable,u=void 0!==a.name?a.name:t;if(n(r)&&o(r,u,a),a.global)l?e[t]=r:i(t,r);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=r:s.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},(e,t,r)=>{"use strict";var n=r(215),s=r(208),o=r(222),i=r(240),a=r(207),l=r(251).CONFIGURABLE,u=r(252),h=r(253),c=h.enforce,d=h.get,p=String,g=Object.defineProperty,m=n("".slice),f=n("".replace),y=n([].join),E=a&&!s((function(){return 8!==g((function(){}),"length",{value:8}).length})),C=String(String).split("String"),T=e.exports=function(e,t,r){"Symbol("===m(p(t),0,7)&&(t="["+f(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!i(e,"name")||l&&e.name!==t)&&(a?g(e,"name",{value:t,configurable:!0}):e.name=t),E&&r&&i(r,"arity")&&e.length!==r.arity&&g(e,"length",{value:r.arity});try{r&&i(r,"constructor")&&r.constructor?a&&g(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=c(e);return i(n,"source")||(n.source=y(C,"string"==typeof t?t:"")),e};Function.prototype.toString=T((function(){return o(this)&&d(this).source||u(this)}),"toString")},(e,t,r)=>{"use strict";var n=r(207),s=r(240),o=Function.prototype,i=n&&Object.getOwnPropertyDescriptor,a=s(o,"name"),l=a&&"something"===function(){}.name,u=a&&(!n||n&&i(o,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:u}},(e,t,r)=>{"use strict";var n=r(215),s=r(222),o=r(238),i=n(Function.toString);s(o.inspectSource)||(o.inspectSource=function(e){return i(e)}),e.exports=o.inspectSource},(e,t,r)=>{"use strict";var n,s,o,i=r(254),a=r(205),l=r(221),u=r(245),h=r(240),c=r(238),d=r(255),p=r(256),g="Object already initialized",m=a.TypeError,f=a.WeakMap;if(i||c.state){var y=c.state||(c.state=new f);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw m(g);return t.facade=e,y.set(e,t),t},s=function(e){return y.get(e)||{}},o=function(e){return y.has(e)}}else{var E=d("state");p[E]=!0,n=function(e,t){if(h(e,E))throw m(g);return t.facade=e,u(e,E,t),t},s=function(e){return h(e,E)?e[E]:{}},o=function(e){return h(e,E)}}e.exports={set:n,get:s,has:o,enforce:function(e){return o(e)?s(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=s(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return r}}}},(e,t,r)=>{"use strict";var n=r(205),s=r(222),o=n.WeakMap;e.exports=s(o)&&/native code/.test(String(o))},(e,t,r)=>{"use strict";var n=r(236),s=r(242),o=n("keys");e.exports=function(e){return o[e]||(o[e]=s(e))}},e=>{"use strict";e.exports={}},(e,t,r)=>{"use strict";var n=r(240),s=r(258),o=r(206),i=r(246);e.exports=function(e,t,r){for(var a=s(t),l=i.f,u=o.f,h=0;h<a.length;h++){var c=a[h];n(e,c)||r&&n(r,c)||l(e,c,u(t,c))}}},(e,t,r)=>{"use strict";var n=r(225),s=r(215),o=r(259),i=r(268),a=r(248),l=s([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),r=i.f;return r?l(t,r(e)):t}},(e,t,r)=>{"use strict";var n=r(260),s=r(267).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},(e,t,r)=>{"use strict";var n=r(215),s=r(240),o=r(213),i=r(261).indexOf,a=r(256),l=n([].push);e.exports=function(e,t){var r,n=o(e),u=0,h=[];for(r in n)!s(a,r)&&s(n,r)&&l(h,r);for(;t.length>u;)s(n,r=t[u++])&&(~i(h,r)||l(h,r));return h}},(e,t,r)=>{"use strict";var n=r(213),s=r(262),o=r(265),i=function(e){return function(t,r,i){var a,l=n(t),u=o(l),h=s(i,u);if(e&&r!=r){for(;u>h;)if((a=l[h++])!=a)return!0}else for(;u>h;h++)if((e||h in l)&&l[h]===r)return e||h||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},(e,t,r)=>{"use strict";var n=r(263),s=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?s(r+t,0):o(r,t)}},(e,t,r)=>{"use strict";var n=r(264);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},(e,t,r)=>{"use strict";var n=r(266);e.exports=function(e){return n(e.length)}},(e,t,r)=>{"use strict";var n=r(263),s=Math.min;e.exports=function(e){return e>0?s(n(e),9007199254740991):0}},e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},(e,t,r)=>{"use strict";var n=r(208),s=r(222),o=/#|\.prototype\./,i=function(e,t){var r=l[a(e)];return r==h||r!=u&&(s(t)?n(t):!!t)},a=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=i.data={},u=i.NATIVE="N",h=i.POLYFILL="P";e.exports=i},(e,t,r)=>{"use strict";var n=r(207),s=r(271),o=TypeError,i=Object.getOwnPropertyDescriptor,a=n&&!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(s(e)&&!i(e,"length").writable)throw o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},(e,t,r)=>{"use strict";var n=r(216);e.exports=Array.isArray||function(e){return"Array"==n(e)}},e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},(e,t,r)=>{"use strict";var n=r(204),s=r(205),o=r(274),i=r(275),a="WebAssembly",l=s[a],u=7!==Error("e",{cause:7}).cause,h=function(e,t){var r={};r[e]=i(e,t,u),n({global:!0,constructor:!0,arity:1,forced:u},r)},c=function(e,t){if(l&&l[e]){var r={};r[e]=i(a+"."+e,t,u),n({target:a,stat:!0,constructor:!0,arity:1,forced:u},r)}};h("Error",(function(e){return function(t){return o(e,this,arguments)}})),h("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),h("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),h("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),h("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),h("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),h("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)}}))},(e,t,r)=>{"use strict";var n=r(210),s=Function.prototype,o=s.apply,i=s.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?i.bind(o):function(){return i.apply(o,arguments)})},(e,t,r)=>{"use strict";var n=r(225),s=r(240),o=r(245),i=r(226),a=r(276),l=r(257),u=r(279),h=r(280),c=r(281),d=r(285),p=r(286),g=r(207),m=r(237);e.exports=function(e,t,r,f){var y="stackTraceLimit",E=f?2:1,C=e.split("."),T=C[C.length-1],R=n.apply(null,C);if(R){var w=R.prototype;if(!m&&s(w,"cause")&&delete w.cause,!r)return R;var S=n("Error"),v=t((function(e,t){var r=c(f?t:e,void 0),n=f?new R(e):new R;return void 0!==r&&o(n,"message",r),p(n,v,n.stack,2),this&&i(w,this)&&h(n,this,v),arguments.length>E&&d(n,arguments[E]),n}));if(v.prototype=w,"Error"!==T?a?a(v,S):l(v,S,{name:!0}):g&&y in R&&(u(v,R,y),u(v,R,"prepareStackTrace")),l(v,R),!m)try{w.name!==T&&o(w,"name",T),w.constructor=v}catch(e){}return v}}},(e,t,r)=>{"use strict";var n=r(277),s=r(248),o=r(278);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return s(r),o(n),t?e(r,n):r.__proto__=n,r}}():void 0)},(e,t,r)=>{"use strict";var n=r(215),s=r(232);e.exports=function(e,t,r){try{return n(s(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},(e,t,r)=>{"use strict";var n=r(222),s=String,o=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw o("Can't set "+s(e)+" as a prototype")}},(e,t,r)=>{"use strict";var n=r(246).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},(e,t,r)=>{"use strict";var n=r(222),s=r(221),o=r(276);e.exports=function(e,t,r){var i,a;return o&&n(i=t.constructor)&&i!==r&&s(a=i.prototype)&&a!==r.prototype&&o(e,a),e}},(e,t,r)=>{"use strict";var n=r(282);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},(e,t,r)=>{"use strict";var n=r(283),s=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return s(e)}},(e,t,r)=>{"use strict";var n=r(284),s=r(222),o=r(216),i=r(235)("toStringTag"),a=Object,l="Arguments"==o(function(){return arguments}());e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),i))?r:l?o(t):"Object"==(n=o(t))&&s(t.callee)?"Arguments":n}},(e,t,r)=>{"use strict";var n={};n[r(235)("toStringTag")]="z",e.exports="[object z]"===String(n)},(e,t,r)=>{"use strict";var n=r(221),s=r(245);e.exports=function(e,t){n(t)&&"cause"in t&&s(e,"cause",t.cause)}},(e,t,r)=>{"use strict";var n=r(245),s=r(287),o=r(288),i=Error.captureStackTrace;e.exports=function(e,t,r,a){o&&(i?i(e,t):n(e,"stack",s(r,a)))}},(e,t,r)=>{"use strict";var n=r(215),s=Error,o=n("".replace),i=String(s("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(i);e.exports=function(e,t){if(l&&"string"==typeof e&&!s.prepareStackTrace)for(;t--;)e=o(e,a,"");return e}},(e,t,r)=>{"use strict";var n=r(208),s=r(212);e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",s(1,7)),7!==e.stack)}))},(e,t,r)=>{"use strict";r(290),r(299)},(e,t,r)=>{"use strict";var n=r(204),s=r(205),o=r(291).clear;n({global:!0,bind:!0,enumerable:!0,forced:s.clearImmediate!==o},{clearImmediate:o})},(e,t,r)=>{"use strict";var n,s,o,i,a=r(205),l=r(274),u=r(292),h=r(222),c=r(240),d=r(208),p=r(294),g=r(295),m=r(244),f=r(296),y=r(297),E=r(298),C=a.setImmediate,T=a.clearImmediate,R=a.process,w=a.Dispatch,S=a.Function,v=a.MessageChannel,A=a.String,N=0,O={},M="onreadystatechange";d((function(){n=a.location}));var b=function(e){if(c(O,e)){var t=O[e];delete O[e],t()}},I=function(e){return function(){b(e)}},_=function(e){b(e.data)},x=function(e){a.postMessage(A(e),n.protocol+"//"+n.host)};C&&T||(C=function(e){f(arguments.length,1);var t=h(e)?e:S(e),r=g(arguments,1);return O[++N]=function(){l(t,void 0,r)},s(N),N},T=function(e){delete O[e]},E?s=function(e){R.nextTick(I(e))}:w&&w.now?s=function(e){w.now(I(e))}:v&&!y?(i=(o=new v).port2,o.port1.onmessage=_,s=u(i.postMessage,i)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!d(x)?(s=x,a.addEventListener("message",_,!1)):s=M in m("script")?function(e){p.appendChild(m("script"))[M]=function(){p.removeChild(this),b(e)}}:function(e){setTimeout(I(e),0)}),e.exports={set:C,clear:T}},(e,t,r)=>{"use strict";var n=r(293),s=r(232),o=r(210),i=n(n.bind);e.exports=function(e,t){return s(e),void 0===t?e:o?i(e,t):function(){return e.apply(t,arguments)}}},(e,t,r)=>{"use strict";var n=r(216),s=r(215);e.exports=function(e){if("Function"===n(e))return s(e)}},(e,t,r)=>{"use strict";var n=r(225);e.exports=n("document","documentElement")},(e,t,r)=>{"use strict";var n=r(215);e.exports=n([].slice)},e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw t("Not enough arguments");return e}},(e,t,r)=>{"use strict";var n=r(230);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},(e,t,r)=>{"use strict";var n=r(216);e.exports="undefined"!=typeof process&&"process"==n(process)},(e,t,r)=>{"use strict";var n=r(204),s=r(205),o=r(291).set,i=r(300),a=s.setImmediate?i(o,!1):o;n({global:!0,bind:!0,enumerable:!0,forced:s.setImmediate!==a},{setImmediate:a})},(e,t,r)=>{"use strict";var n,s=r(205),o=r(274),i=r(222),a=r(301),l=r(230),u=r(295),h=r(296),c=s.Function,d=/MSIE .\./.test(l)||a&&((n=s.Bun.version.split(".")).length<3||0==n[0]&&(n[1]<3||3==n[1]&&0==n[2]));e.exports=function(e,t){var r=t?2:1;return d?function(n,s){var a=h(arguments.length,1)>r,l=i(n)?n:c(n),d=a?u(arguments,r):[],p=a?function(){o(l,this,d)}:l;return t?e(p,s):e(p)}:e}},e=>{"use strict";e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},(e,t,r)=>{"use strict";t.__esModule=!0,t.addClass=function(e,t){"string"==typeof t&&(t=t.split(" "));(t=i(t)).length>0&&e.classList.add(...t)},t.addEvent=function(e,t,r){e.addEventListener(t,r,!1)},t.clearTextSelection=function(){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())},t.closest=o,t.closestDown=function(e,t,r){const n=[];let s=e;for(;s&&(s=o(s,t,r),s&&(!r||r.contains(s)));)n.push(s),s=s.host&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s.host:s.parentNode;const i=n.length;return i?n[i-1]:null},t.empty=a,t.fastInnerHTML=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];l.test(t)?e.innerHTML=r?(0,n.sanitize)(t):t:u(e,t)},t.fastInnerText=u,t.getCaretPosition=function(e){if(e.selectionStart)return e.selectionStart;return 0},t.getComputedStyle=d,t.getCssTransform=function(e){let t;if(e.style.transform&&""!==(t=e.style.transform))return["transform",t];return-1},t.getFrameElement=s,t.getParent=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=-1,n=null,s=e;for(;null!==s;){if(r===t){n=s;break}s.host&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s=s.host:(r+=1,s=s.parentNode)}return n},t.getParentWindow=function(e){return s(e)&&e.parent},t.getScrollLeft=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(e===t)return c(t);return e.scrollLeft},t.getScrollTop=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(e===t)return h(t);return e.scrollTop},t.getScrollableElement=function(e){let t=e.ownerDocument,r=t?t.defaultView:void 0;t||(t=e.document?e.document:e,r=t.defaultView);const n=["auto","scroll"];let s=e.parentNode;for(;s&&s.style&&t.body!==s;){let{overflow:e,overflowX:t,overflowY:o}=s.style;if([e,t,o].includes("scroll"))return s;if(({overflow:e,overflowX:t,overflowY:o}=r.getComputedStyle(s)),n.includes(e)||n.includes(t)||n.includes(o))return s;if(s.clientHeight<=s.scrollHeight+1&&(n.includes(o)||n.includes(e)))return s;if(s.clientWidth<=s.scrollWidth+1&&(n.includes(t)||n.includes(e)))return s;s=s.parentNode}return r},t.getScrollbarWidth=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;void 0===p&&(p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;const t=e.createElement("div");t.style.height="200px",t.style.width="100%";const r=e.createElement("div");r.style.boxSizing="content-box",r.style.height="150px",r.style.left="0px",r.style.overflow="hidden",r.style.position="absolute",r.style.top="0px",r.style.width="200px",r.style.visibility="hidden",r.appendChild(t),(e.body||e.documentElement).appendChild(r);const n=t.offsetWidth;r.style.overflow="scroll";let s=t.offsetWidth;n===s&&(s=r.clientWidth);return(e.body||e.documentElement).removeChild(r),n-s}(e));return p},t.getSelectionEndPosition=function(e){if(e.selectionEnd)return e.selectionEnd;return 0},t.getSelectionText=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=e.document;let r="";e.getSelection?r=e.getSelection().toString():t.selection&&"Control"!==t.selection.type&&(r=t.selection.createRange().text);return r},t.getStyle=function(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;const n=e.style[t];if(""!==n&&void 0!==n)return n;const s=d(e,r);if(""!==s[t]&&void 0!==s[t])return s[t]},t.getTrimmingContainer=function(e){const t=e.ownerDocument,r=t.defaultView;let n=e.parentNode;for(;n&&n.style&&t.body!==n;){if("visible"!==n.style.overflow&&""!==n.style.overflow)return n;const e=d(n,r),t=["scroll","hidden","auto"],s=e.getPropertyValue("overflow"),o=e.getPropertyValue("overflow-y"),i=e.getPropertyValue("overflow-x");if(t.includes(s)||t.includes(o)||t.includes(i))return n;n=n.parentNode}return r},t.getWindowScrollLeft=c,t.getWindowScrollTop=h,t.hasAccessToParentWindow=function(e){return!!Object.getPrototypeOf(e.parent)},t.hasClass=function(e,t){if(void 0===e.classList||"string"!=typeof t||""===t)return!1;return e.classList.contains(t)},t.hasHorizontalScrollbar=function(e){return e.offsetHeight!==e.clientHeight},t.hasVerticalScrollbar=function(e){return e.offsetWidth!==e.clientWidth},t.index=function(e){let t=0,r=e;if(r.previousSibling)for(;r=r.previousSibling;)t+=1;return t},t.innerHeight=function(e){return e.clientHeight||e.innerHeight},t.innerWidth=function(e){return e.clientWidth||e.innerWidth},t.isChildOf=function(e,t){let r=e.parentNode,n=[];"string"==typeof t?n=e.defaultView?Array.prototype.slice.call(e.querySelectorAll(t),0):Array.prototype.slice.call(e.ownerDocument.querySelectorAll(t),0):n.push(t);for(;null!==r;){if(n.indexOf(r)>-1)return!0;r=r.parentNode}return!1},t.isDetached=function(e){return!e.parentNode},t.isInput=g,t.isOutsideInput=m,t.isVisible=function e(t){const r=t.ownerDocument.documentElement;let n=t;for(;n!==r;){if(null===n)return!1;if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(n.host){if(n.host.impl)return e(n.host.impl);if(n.host)return e(n.host);throw new Error("Lost in Web Components world")}return!1}if(n.style&&"none"===n.style.display)return!1;n=n.parentNode}return!0},t.matchesCSSRules=function(e,t){const{selectorText:r}=t;let n=!1;t.type===CSSRule.STYLE_RULE&&r&&(e.msMatchesSelector?n=e.msMatchesSelector(r):e.matches&&(n=e.matches(r)));return n},t.observeVisibilityChangeOnce=function(e,t){new IntersectionObserver(((r,n)=>{r.forEach((r=>{r.isIntersecting&&null!==e.offsetParent&&(t(),n.unobserve(e))}))}),{root:e.ownerDocument.body}).observe(e)},t.offset=function(e){const t=e.ownerDocument,r=t.defaultView,n=t.documentElement;let s,o,i,a=e;s=a.offsetLeft,o=a.offsetTop,i=a;for(;(a=a.offsetParent)&&a!==t.body;)s+=a.offsetLeft,o+=a.offsetTop,i=a;i&&"fixed"===i.style.position&&(s+=r.pageXOffset||n.scrollLeft,o+=r.pageYOffset||n.scrollTop);return{left:s,top:o}},t.outerHeight=function(e){return e.offsetHeight},t.outerWidth=function(e){return e.offsetWidth},t.overlayContainsElement=function(e,t,r){const n=r.parentElement.querySelector(`.ht_clone_${e}`);return n?n.contains(t):null},t.removeClass=function(e,t){"string"==typeof t&&(t=t.split(" "));(t=i(t)).length>0&&e.classList.remove(...t)},t.removeEvent=function(e,t,r){e.removeEventListener(t,r,!1)},t.removeTextNodes=function e(t){if(3===t.nodeType)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const r=t.childNodes;for(let t=r.length-1;t>=0;t--)e(r[t])}},t.resetCssTransform=function(e){e.style.transform&&""!==e.style.transform&&(e.style.transform="")},t.selectElementIfAllowed=function(e){m(e.ownerDocument.activeElement)||e.select()},t.setCaretPosition=function(e,t,r){void 0===r&&(r=t);if(e.setSelectionRange){e.focus();try{e.setSelectionRange(t,r)}catch(n){const s=e.parentNode,o=s.style.display;s.style.display="block",e.setSelectionRange(t,r),s.style.display=o}}},t.setOverlayPosition=function(e,t,r){e.style.transform=`translate3d(${t},${r},0)`},r(203),r(273);var n=r(303);function s(e){return Object.getPrototypeOf(e.parent)&&e.frameElement}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:n,DOCUMENT_FRAGMENT_NODE:s}=Node;let o=e;for(;null!=o&&o!==r;){const{nodeType:e,nodeName:r}=o;if(e===n&&(t.includes(r)||t.includes(o)))return o;const{host:i}=o;o=i&&e===s?i:o.parentNode}return null}function i(e){return e&&e.length?e.filter((e=>!!e)):[]}function a(e){let t;for(;t=e.lastChild;)e.removeChild(t)}const l=/(<(.*)>|&(.*);)/;function u(e,t){const r=e.firstChild;r&&3===r.nodeType&&null===r.nextSibling?r.textContent=t:(a(e),e.appendChild(e.ownerDocument.createTextNode(t)))}function h(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).scrollY}function c(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).scrollX}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e.currentStyle||t.getComputedStyle(e)}let p;function g(e){return e&&(["INPUT","SELECT","TEXTAREA"].indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function m(e){return g(e)&&!1===e.hasAttribute("data-hot-input")}t.HTML_CHARACTERS=l},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0,t.equalsIgnoreCase=function(){const e=[];for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];let s=r.length;for(;s;){s-=1;const t=(0,o.stringify)(r[s]).toLowerCase();-1===e.indexOf(t)&&e.push(t)}return 1===e.length},t.isPercentValue=function(e){return/^([0-9][0-9]?%$)|(^100%$)/.test(e)},t.randomString=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},t.sanitize=i,t.stripTags=function(e){return i(`${e}`,{ALLOWED_TAGS:[]})},t.substitute=function(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]))},t.toUpperCaseFirst=function(e){return e[0].toUpperCase()+e.substr(1)},r(203);var s=n(r(304)),o=r(305);function i(e,t){return s.default.sanitize(e,t)}},function(e,t,r){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,r){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,r)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function n(e,s,o){return n=r()?Reflect.construct:function(e,r,n){var s=[null];s.push.apply(s,r);var o=new(Function.bind.apply(e,s));return n&&t(o,n.prototype),o},n.apply(null,arguments)}function s(e){return o(e)||i(e)||a(e)||u()}function o(e){if(Array.isArray(e))return l(e)}function i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.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)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h=Object.hasOwnProperty,c=Object.setPrototypeOf,d=Object.isFrozen,p=Object.getPrototypeOf,g=Object.getOwnPropertyDescriptor,m=Object.freeze,f=Object.seal,y=Object.create,E="undefined"!=typeof Reflect&&Reflect,C=E.apply,T=E.construct;C||(C=function(e,t,r){return e.apply(t,r)}),m||(m=function(e){return e}),f||(f=function(e){return e}),T||(T=function(e,t){return n(e,s(t))});var R=x(Array.prototype.forEach),w=x(Array.prototype.pop),S=x(Array.prototype.push),v=x(String.prototype.toLowerCase),A=x(String.prototype.toString),N=x(String.prototype.match),O=x(String.prototype.replace),M=x(String.prototype.indexOf),b=x(String.prototype.trim),I=x(RegExp.prototype.test),_=P(TypeError);function x(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return C(e,t,n)}}function P(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return T(e,r)}}function L(e,t,r){var n;r=null!==(n=r)&&void 0!==n?n:v,c&&c(e,null);for(var s=t.length;s--;){var o=t[s];if("string"==typeof o){var i=r(o);i!==o&&(d(t)||(t[s]=i),o=i)}e[o]=!0}return e}function D(e){var t,r=y(null);for(t in e)!0===C(h,e,[t])&&(r[t]=e[t]);return r}function F(e,t){for(;null!==e;){var r=g(e,t);if(r){if(r.get)return x(r.get);if("function"==typeof r.value)return x(r.value)}e=p(e)}function n(e){return console.warn("fallback value for",e),null}return n}var k=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),H=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),U=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),V=m(["animate","color-profile","cursor","discard","fedropshadow","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"]),B=m(["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"]),W=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),G=m(["#text"]),Y=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),j=m(["accent-height","accumulate","additive","alignment-baseline","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","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","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","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","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"]),z=m(["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"]),$=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),K=f(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X=f(/<%[\w\W]*|[\w\W]*%>/gm),q=f(/\${[\w\W]*}/gm),Q=f(/^data-[\-\w.\u00B7-\uFFFF]/),Z=f(/^aria-[\-\w]+$/),J=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ee=f(/^(?:\w+script|data):/i),te=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),re=f(/^html$/i),ne=function(){return"undefined"==typeof window?null:window},se=function(t,r){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var n=null,s="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(s)&&(n=r.currentScript.getAttribute(s));var o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function oe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ne(),r=function(e){return oe(e)};if(r.version="2.4.7",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;var n=t.document,o=t.document,i=t.DocumentFragment,a=t.HTMLTemplateElement,l=t.Node,u=t.Element,h=t.NodeFilter,c=t.NamedNodeMap,d=void 0===c?t.NamedNodeMap||t.MozNamedAttrMap:c,p=t.HTMLFormElement,g=t.DOMParser,f=t.trustedTypes,y=u.prototype,E=F(y,"cloneNode"),C=F(y,"nextSibling"),T=F(y,"childNodes"),x=F(y,"parentNode");if("function"==typeof a){var P=o.createElement("template");P.content&&P.content.ownerDocument&&(o=P.content.ownerDocument)}var ie=se(f,n),ae=ie?ie.createHTML(""):"",le=o,ue=le.implementation,he=le.createNodeIterator,ce=le.createDocumentFragment,de=le.getElementsByTagName,pe=n.importNode,ge={};try{ge=D(o).documentMode?o.documentMode:{}}catch(e){}var me={};r.isSupported="function"==typeof x&&ue&&void 0!==ue.createHTMLDocument&&9!==ge;var fe,ye,Ee=K,Ce=X,Te=q,Re=Q,we=Z,Se=ee,ve=te,Ae=J,Ne=null,Oe=L({},[].concat(s(k),s(H),s(U),s(B),s(G))),Me=null,be=L({},[].concat(s(Y),s(j),s(z),s($))),Ie=Object.seal(Object.create(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}})),_e=null,xe=null,Pe=!0,Le=!0,De=!1,Fe=!0,ke=!1,He=!1,Ue=!1,Ve=!1,Be=!1,We=!1,Ge=!1,Ye=!0,je=!1,ze="user-content-",$e=!0,Ke=!1,Xe={},qe=null,Qe=L({},["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"]),Ze=null,Je=L({},["audio","video","img","source","image","track"]),et=null,tt=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml",ot=st,it=!1,at=null,lt=L({},[rt,nt,st],A),ut=["application/xhtml+xml","text/html"],ht="text/html",ct=null,dt=o.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},gt=function(t){ct&&ct===t||(t&&"object"===e(t)||(t={}),t=D(t),fe=fe=-1===ut.indexOf(t.PARSER_MEDIA_TYPE)?ht:t.PARSER_MEDIA_TYPE,ye="application/xhtml+xml"===fe?A:v,Ne="ALLOWED_TAGS"in t?L({},t.ALLOWED_TAGS,ye):Oe,Me="ALLOWED_ATTR"in t?L({},t.ALLOWED_ATTR,ye):be,at="ALLOWED_NAMESPACES"in t?L({},t.ALLOWED_NAMESPACES,A):lt,et="ADD_URI_SAFE_ATTR"in t?L(D(tt),t.ADD_URI_SAFE_ATTR,ye):tt,Ze="ADD_DATA_URI_TAGS"in t?L(D(Je),t.ADD_DATA_URI_TAGS,ye):Je,qe="FORBID_CONTENTS"in t?L({},t.FORBID_CONTENTS,ye):Qe,_e="FORBID_TAGS"in t?L({},t.FORBID_TAGS,ye):{},xe="FORBID_ATTR"in t?L({},t.FORBID_ATTR,ye):{},Xe="USE_PROFILES"in t&&t.USE_PROFILES,Pe=!1!==t.ALLOW_ARIA_ATTR,Le=!1!==t.ALLOW_DATA_ATTR,De=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ke=t.SAFE_FOR_TEMPLATES||!1,He=t.WHOLE_DOCUMENT||!1,Be=t.RETURN_DOM||!1,We=t.RETURN_DOM_FRAGMENT||!1,Ge=t.RETURN_TRUSTED_TYPE||!1,Ve=t.FORCE_BODY||!1,Ye=!1!==t.SANITIZE_DOM,je=t.SANITIZE_NAMED_PROPS||!1,$e=!1!==t.KEEP_CONTENT,Ke=t.IN_PLACE||!1,Ae=t.ALLOWED_URI_REGEXP||Ae,ot=t.NAMESPACE||st,Ie=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ie.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ie.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ie.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(Le=!1),We&&(Be=!0),Xe&&(Ne=L({},s(G)),Me=[],!0===Xe.html&&(L(Ne,k),L(Me,Y)),!0===Xe.svg&&(L(Ne,H),L(Me,j),L(Me,$)),!0===Xe.svgFilters&&(L(Ne,U),L(Me,j),L(Me,$)),!0===Xe.mathMl&&(L(Ne,B),L(Me,z),L(Me,$))),t.ADD_TAGS&&(Ne===Oe&&(Ne=D(Ne)),L(Ne,t.ADD_TAGS,ye)),t.ADD_ATTR&&(Me===be&&(Me=D(Me)),L(Me,t.ADD_ATTR,ye)),t.ADD_URI_SAFE_ATTR&&L(et,t.ADD_URI_SAFE_ATTR,ye),t.FORBID_CONTENTS&&(qe===Qe&&(qe=D(qe)),L(qe,t.FORBID_CONTENTS,ye)),$e&&(Ne["#text"]=!0),He&&L(Ne,["html","head","body"]),Ne.table&&(L(Ne,["tbody"]),delete _e.tbody),m&&m(t),ct=t)},mt=L({},["mi","mo","mn","ms","mtext"]),ft=L({},["foreignobject","desc","title","annotation-xml"]),yt=L({},["title","style","font","a","script"]),Et=L({},H);L(Et,U),L(Et,V);var Ct=L({},B);L(Ct,W);var Tt=function(e){var t=x(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});var r=v(e.tagName),n=v(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===st?"svg"===r:t.namespaceURI===rt?"svg"===r&&("annotation-xml"===n||mt[n]):Boolean(Et[r]):e.namespaceURI===rt?t.namespaceURI===st?"math"===r:t.namespaceURI===nt?"math"===r&&ft[n]:Boolean(Ct[r]):e.namespaceURI===st?!(t.namespaceURI===nt&&!ft[n])&&!(t.namespaceURI===rt&&!mt[n])&&!Ct[r]&&(yt[r]||!Et[r]):!("application/xhtml+xml"!==fe||!at[e.namespaceURI]))},Rt=function(e){S(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},wt=function(e,t){try{S(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){S(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Me[e])if(Be||We)try{Rt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},St=function(e){var t,r;if(Ve)e="<remove></remove>"+e;else{var n=N(e,/^[\r\n\t ]+/);r=n&&n[0]}"application/xhtml+xml"===fe&&ot===st&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var s=ie?ie.createHTML(e):e;if(ot===st)try{t=(new g).parseFromString(s,fe)}catch(e){}if(!t||!t.documentElement){t=ue.createDocument(ot,"template",null);try{t.documentElement.innerHTML=it?ae:s}catch(e){}}var i=t.body||t.documentElement;return e&&r&&i.insertBefore(o.createTextNode(r),i.childNodes[0]||null),ot===st?de.call(t,He?"html":"body")[0]:He?t.documentElement:i},vt=function(e){return he.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT,null,!1)},At=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Ot=function(e,t,n){me[e]&&R(me[e],(function(e){e.call(r,t,n,ct)}))},Mt=function(e){var t;if(Ot("beforeSanitizeElements",e,null),At(e))return Rt(e),!0;if(I(/[\u0080-\uFFFF]/,e.nodeName))return Rt(e),!0;var n=ye(e.nodeName);if(Ot("uponSanitizeElement",e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&(!Nt(e.content)||!Nt(e.content.firstElementChild))&&I(/<[/\w]/g,e.innerHTML)&&I(/<[/\w]/g,e.textContent))return Rt(e),!0;if("select"===n&&I(/<template/i,e.innerHTML))return Rt(e),!0;if(!Ne[n]||_e[n]){if(!_e[n]&&It(n)){if(Ie.tagNameCheck instanceof RegExp&&I(Ie.tagNameCheck,n))return!1;if(Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(n))return!1}if($e&&!qe[n]){var s=x(e)||e.parentNode,o=T(e)||e.childNodes;if(o&&s)for(var i=o.length-1;i>=0;--i)s.insertBefore(E(o[i],!0),C(e))}return Rt(e),!0}return e instanceof u&&!Tt(e)?(Rt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!I(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&3===e.nodeType&&(t=e.textContent,t=O(t,Ee," "),t=O(t,Ce," "),t=O(t,Te," "),e.textContent!==t&&(S(r.removed,{element:e.cloneNode()}),e.textContent=t)),Ot("afterSanitizeElements",e,null),!1):(Rt(e),!0)},bt=function(e,t,r){if(Ye&&("id"===t||"name"===t)&&(r in o||r in dt))return!1;if(Le&&!xe[t]&&I(Re,t));else if(Pe&&I(we,t));else if(!Me[t]||xe[t]){if(!(It(e)&&(Ie.tagNameCheck instanceof RegExp&&I(Ie.tagNameCheck,e)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(e))&&(Ie.attributeNameCheck instanceof RegExp&&I(Ie.attributeNameCheck,t)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(t))||"is"===t&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&I(Ie.tagNameCheck,r)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(r))))return!1}else if(et[t]);else if(I(Ae,O(r,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==M(r,"data:")||!Ze[e])if(De&&!I(Se,O(r,ve,"")));else if(r)return!1;return!0},It=function(e){return e.indexOf("-")>0},_t=function(t){var n,s,o,i;Ot("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Me};for(i=a.length;i--;){var u=n=a[i],h=u.name,c=u.namespaceURI;if(s="value"===h?n.value:b(n.value),o=ye(h),l.attrName=o,l.attrValue=s,l.keepAttr=!0,l.forceKeepAttr=void 0,Ot("uponSanitizeAttribute",t,l),s=l.attrValue,!l.forceKeepAttr&&(wt(h,t),l.keepAttr))if(Fe||!I(/\/>/i,s)){ke&&(s=O(s,Ee," "),s=O(s,Ce," "),s=O(s,Te," "));var d=ye(t.nodeName);if(bt(d,o,s)){if(!je||"id"!==o&&"name"!==o||(wt(h,t),s=ze+s),ie&&"object"===e(f)&&"function"==typeof f.getAttributeType)if(c);else switch(f.getAttributeType(d,o)){case"TrustedHTML":s=ie.createHTML(s);break;case"TrustedScriptURL":s=ie.createScriptURL(s)}try{c?t.setAttributeNS(c,h,s):t.setAttribute(h,s),w(r.removed)}catch(e){}}}else wt(h,t)}Ot("afterSanitizeAttributes",t,null)}},xt=function e(t){var r,n=vt(t);for(Ot("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)Ot("uponSanitizeShadowNode",r,null),Mt(r)||(r.content instanceof i&&e(r.content),_t(r));Ot("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(s){var o,a,u,h,c,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((it=!s)&&(s="\x3c!--\x3e"),"string"!=typeof s&&!Nt(s)){if("function"!=typeof s.toString)throw _("toString is not a function");if("string"!=typeof(s=s.toString()))throw _("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof s)return t.toStaticHTML(s);if(Nt(s))return t.toStaticHTML(s.outerHTML)}return s}if(Ue||gt(d),r.removed=[],"string"==typeof s&&(Ke=!1),Ke){if(s.nodeName){var p=ye(s.nodeName);if(!Ne[p]||_e[p])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(s instanceof l)1===(a=(o=St("\x3c!----\x3e")).ownerDocument.importNode(s,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!Be&&!ke&&!He&&-1===s.indexOf("<"))return ie&&Ge?ie.createHTML(s):s;if(!(o=St(s)))return Be?null:Ge?ae:""}o&&Ve&&Rt(o.firstChild);for(var g=vt(Ke?s:o);u=g.nextNode();)3===u.nodeType&&u===h||Mt(u)||(u.content instanceof i&&xt(u.content),_t(u),h=u);if(h=null,Ke)return s;if(Be){if(We)for(c=ce.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(Me.shadowroot||Me.shadowrootmod)&&(c=pe.call(n,c,!0)),c}var m=He?o.outerHTML:o.innerHTML;return He&&Ne["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&I(re,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),ke&&(m=O(m,Ee," "),m=O(m,Ce," "),m=O(m,Te," ")),ie&&Ge?ie.createHTML(m):m},r.setConfig=function(e){gt(e),Ue=!0},r.clearConfig=function(){ct=null,Ue=!1},r.isValidAttribute=function(e,t,r){ct||gt({});var n=ye(e),s=ye(t);return bt(n,s,r)},r.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],S(me[e],t))},r.removeHook=function(e){if(me[e])return w(me[e])},r.removeHooks=function(e){me[e]&&(me[e]=[])},r.removeAllHooks=function(){me={}},r}return oe()}(),window.DOMPurify=r(304)},(e,t,r)=>{"use strict";var n=r(196);t.__esModule=!0,t._injectProductInfo=function(e,t){const r=!a(e),n="string"==typeof e&&"non-commercial-and-evaluation"===e.toLowerCase(),o="13.1.0-next-28622ff-20230818";let i,C="invalid",T="invalid";const R=function(e){let t=[][l],r=t;if(e[l]!==d("Z"))return!1;for(let t="",n="B<H4P+".split(""),s=d(n.shift());s;s=d(n.shift()||"A"))--s<""[l]?r|=(h(`${h(u(t)+(u(c(e,Math.abs(s),2))+[]).padStart(2,"0"))}`)%97||2)>>1:t=c(e,s,s?1===n[l]?9:8:6);return r===t}(e=p(e||""));if(r||n||R)if(R){const t=(0,s.default)("23/08/2023","DD/MM/YYYY"),r=Math.floor(t.toDate().getTime()/864e5),n=g(e);i=(0,s.default)(864e5*(n+1),"x").format("MMMM DD, YYYY"),r>n?(C="expired",T="expired"):(C="valid",T="valid")}else n?(C="non_commercial",T="valid"):(C="invalid",T="invalid");else C="missing",T="missing";m()&&(C="valid",T="valid");if(!f&&"valid"!==C){y[C]({keyValidityDate:i,hotVersion:o})&&console["non_commercial"===C?"info":"warn"](y[C]({keyValidityDate:i,hotVersion:o})),f=!0}if("valid"!==T&&t.parentNode){if(E[T]({keyValidityDate:i,hotVersion:o})){const e=document.createElement("div");e.className="hot-display-license-info",e.innerHTML=E[T]({keyValidityDate:i,hotVersion:o}),t.parentNode.insertBefore(e,t.nextSibling)}}},t.isDefined=function(e){return void 0!==e},t.isEmpty=a,t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isUndefined=i,t.stringify=function(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};var s=n(r(306)),o=r(443);function i(e){return void 0===e}function a(e){return null===e||""===e||i(e)}const l="length",u=e=>parseInt(e,16),h=e=>parseInt(e,10),c=(e,t,r)=>e.substr(t,r),d=e=>e.codePointAt(0)-65,p=e=>`${e}`.replace(/\-/g,""),g=e=>u(c(p(e),u("12"),d("F")))/(u(c(p(e),d("B"),~~![][l]))||9),m=()=>"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);let f=!1;const y={invalid:()=>o.toSingleLine`
2
2
  The license key for Handsontable is invalid.\x20
3
3
  If you need any help, contact us at support@handsontable.com.`,expired:e=>{let{keyValidityDate:t,hotVersion:r}=e;return o.toSingleLine`
4
4
  The license key for Handsontable expired on ${t}, and is not valid for the installed\x20