@syncfusion/ej2-spreadsheet
Version:
Feature-rich JavaScript Spreadsheet (Excel) control with built-in support for selection, editing, formatting, importing and exporting to Excel
10 lines • 1.58 MB
JavaScript
/*!
* filename: ej2-spreadsheet.umd.min.js
* version : 33.2.7
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-charts")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-popups","@syncfusion/ej2-navigations","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-dropdowns","@syncfusion/ej2-lists","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-grids","@syncfusion/ej2-charts"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Data,e.ej2Popups,e.ej2Navigations,e.ej2Inputs,e.ej2Buttons,e.ej2Dropdowns,e.ej2Lists,e.ej2Splitbuttons,e.ej2Grids,e.ej2Charts)}(this,function($,pe,Z,m,D,S,w,I,g,f,F,J){"use strict";function ce(e,t,n){var r,i,o=[];return e&&(i=void 0,t&&!pe.isNullOrUndefined(n)&&(i=ve(t,n)),e=-1===(e=-1<e.lastIndexOf("!")?e.substring(e.lastIndexOf("!")+1):e).indexOf(":")?e+":"+e:e,new RegExp(/^(?=.*[a-zA-Z])(?=.*\d)/g).test(e)||(t=e.split(":"),e=pe.isNullOrUndefined(e.match(/[0-9]/))?t[0]+"1:"+t[1]+(i?i.rowCount-1:"1"):"A"+t[0]+":"+(i?re(i.colCount):"A")+t[1]),e.split(":").forEach(function(e){r=W(e),o.push(r[0]),o.push(r[1])})),o}function W(e){return[parseInt(e.match(/\d+/)[0],10)-1,P(e.match(/[A-Z]+/i)[0].toUpperCase())]}function P(e){for(var t=0,n=(e=e.split("").reverse().join("")).length-1;0<=n;n--)t+=(e[n].charCodeAt(0)-64)*Math.pow(26,n);return t-1}function G(e,t){return re(t+1)+(e+1)}function ue(e){return G(e[0],e[1])+":"+(pe.isNullOrUndefined(e[2])?G(e[0],e[1]):G(e[2],e[3]))}function re(e){return 1<e/26?re(e%26==0?e/26-1:Math.floor(e/26))+String.fromCharCode(e%26==0?"Z".charCodeAt(0):64+e%26):String.fromCharCode(64+e)}function B(e,t,n){return ce(Q(e),t,n)}function Q(e){var t=e.lastIndexOf("!");return-1<t?e.substring(t+1):e}function v(e){return e.name+"!"+e.selectedRange}function R(e,t){var n=ie(e,t);return{sheetIndex:n,indices:B(t,e,n)}}function ie(e,t){t=-1<t.indexOf("!")?K(e,Ki(t)):e.activeSheetIndex;return t}function fe(e){var t=e.slice();return e[0]>e[2]&&y(t,0,2),e[1]>e[3]&&y(t,1,3),t}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Se(e){return e[0]===e[2]&&e[1]===e[3]}function C(e,t,n,r,i,o){return new b(e,t,n,r,i,o)}x.prototype.terminate=function(){this.worker.terminate(),URL.revokeObjectURL(this.workerUrl)},x.prototype.initWorker=function(){var e=new Blob([this.getFnCode()],{type:"text/javascript"});this.workerUrl=URL.createObjectURL(e),this.worker=new Worker(this.workerUrl),this.worker.onmessage=this.messageFromWorker.bind(this),this.worker.onerror=this.onError.bind(this),this.parent.isVue?(e=JSON.parse(JSON.stringify(this.workerData)),this.worker.postMessage(e)):this.worker.postMessage(this.workerData)},x.prototype.messageFromWorker=function(e){this.terminate(),this.defaultListener.apply(this.context,[e.data])},x.prototype.onError=function(e){if(this.terminate(),!e.message||!e.message.includes("FormData"))throw e.message||e;this.defaultListener.apply(this.context,[{isFormDataError:!0}])},x.prototype.getFnCode=function(){var e,t,n="",r="",i=!1;if("function"==typeof this.workerTask)this.workerTask.toString().indexOf("function")<0?r="function "+this.workerTask.toString():(r=this.workerTask.toString(),i=!0),n+="self.workerTask = "+r+"; \n";else if("object"==typeof this.workerTask)for(t=Object.keys(this.workerTask),e=0;e<t.length;e++)this.workerTask[t[e]].toString().indexOf("function")<0?r="function "+this.workerTask[t[e]].toString():(r=this.workerTask[t[e]].toString(),i=!0),n+=(0===e?"self.workerTask":t[e])+"= "+r+"; \n";return n+="self.onmessage = "+(i?"":" function ")+(this.preventCallback?this.getMessageFn:this.getCallbackMessageFn).toString()+"; \n"},x.prototype.getCallbackMessageFn=function(e){postMessage(this.workerTask.apply(this,e.data))},x.prototype.getMessageFn=function(e){this.workerTask.apply(this,e.data)};var b=x;function x(e,t,n,r,i,o){this.preventCallback=!1,this.context=e,this.workerTask=t,this.defaultListener=n,this.workerData=r,this.parent=o,i&&(this.preventCallback=!0),this.initWorker()}function E(e,t){return(t=void 0===t?[]:t).push({member:"dataBind",args:[e]}),t.push({member:"workbookProtectSheet",args:[e]}),e.allowSave&&t.push({member:"workbookSave",args:[e]}),e.allowPrint&&t.push({member:"print",args:[e]}),e.allowOpen&&t.push({member:"workbookOpen",args:[e]}),e.allowEditing&&(t.push({member:"workbookEdit",args:[e]}),t.push({member:"workbookFormula",args:[e]})),e.allowNumberFormatting&&t.push({member:"workbookNumberFormat",args:[e]}),e.allowCellFormatting&&t.push({member:"workbookcellformat",args:[e]}),e.allowSorting&&t.push({member:"workbookSort",args:[e]}),e.allowHyperlink&&t.push({member:"workbookHyperlink",args:[e]}),e.allowFiltering&&t.push({member:"workbookFilter",args:[e]}),e.allowFindAndReplace&&t.push({member:"workbookfindAndReplace",args:[e]}),e.allowInsert&&t.push({member:"workbookinsert",args:[e]}),e.allowDelete&&t.push({member:"workbookdelete",args:[e]}),e.allowDataValidation&&t.push({member:"workbookDataValidation",args:[e]}),e.allowMerge&&t.push({member:"workbookmerge",args:[e]}),e.allowCellFormatting&&t.push({member:"workbookConditionalFormatting",args:[e]}),e.allowImage&&t.push({member:"workbookImage",args:[e]}),e.allowChart&&t.push({member:"workbookChart",args:[e]}),e.allowAutoFill&&t.push({member:"workbookautofill",args:[e]}),t}N=function(e,t){return(N=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var N,A,O=function(e,t){function n(){this.constructor=e}N(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},e=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;0<=s;s--)(i=e[s])&&(a=(o<3?i(a):3<o?i(t,n,a):i(t,n))||a);return 3<o&&a&&Object.defineProperty(t,n,a),a},k=(A=pe.ChildProperty,O(M,A),e([pe.Property("Calibri")],M.prototype,"fontFamily",void 0),e([pe.Property("bottom")],M.prototype,"verticalAlign",void 0),e([pe.Property("left")],M.prototype,"textAlign",void 0),e([pe.Property("0pt")],M.prototype,"textIndent",void 0),e([pe.Property("#000000")],M.prototype,"color",void 0),e([pe.Property("#ffffff")],M.prototype,"backgroundColor",void 0),e([pe.Property("normal")],M.prototype,"fontWeight",void 0),e([pe.Property("normal")],M.prototype,"fontStyle",void 0),e([pe.Property("11pt")],M.prototype,"fontSize",void 0),e([pe.Property("none")],M.prototype,"textDecoration",void 0),e([pe.Property("")],M.prototype,"border",void 0),e([pe.Property("")],M.prototype,"borderTop",void 0),e([pe.Property("")],M.prototype,"borderBottom",void 0),e([pe.Property("")],M.prototype,"borderLeft",void 0),e([pe.Property("")],M.prototype,"borderRight",void 0),M);function M(){return null!==A&&A.apply(this,arguments)||this}H=pe.ChildProperty,O(V,H),e([pe.Property()],V.prototype,"sheetIndex",void 0),e([pe.Property()],V.prototype,"filterRange",void 0),e([pe.Property(!1)],V.prototype,"hasFilter",void 0),e([pe.Property()],V.prototype,"column",void 0),e([pe.Property()],V.prototype,"criteria",void 0),e([pe.Property()],V.prototype,"value",void 0),e([pe.Property()],V.prototype,"dataType",void 0),e([pe.Property()],V.prototype,"predicates",void 0);var H,U=V;function V(){return null!==H&&H.apply(this,arguments)||this}z=pe.ChildProperty,O(_,z),e([pe.Property()],_.prototype,"sortRange",void 0),e([pe.Property()],_.prototype,"columnIndex",void 0),e([pe.Property()],_.prototype,"order",void 0),e([pe.Property()],_.prototype,"sheetIndex",void 0);var z,j=_;function _(){return null!==z&&z.apply(this,arguments)||this}q=pe.ChildProperty,O(oe,q),e([pe.Property("")],oe.prototype,"name",void 0),e([pe.Property("")],oe.prototype,"scope",void 0),e([pe.Property("")],oe.prototype,"comment",void 0),e([pe.Property("")],oe.prototype,"refersTo",void 0);var q,X=oe;function oe(){return null!==q&&q.apply(this,arguments)||this}ae=pe.ChildProperty,O(le,ae),e([pe.Property(!1)],le.prototype,"selectCells",void 0),e([pe.Property(!1)],le.prototype,"selectUnLockedCells",void 0),e([pe.Property(!1)],le.prototype,"formatCells",void 0),e([pe.Property(!1)],le.prototype,"formatRows",void 0),e([pe.Property(!1)],le.prototype,"formatColumns",void 0),e([pe.Property(!1)],le.prototype,"insertLink",void 0);var ae,se=le;function le(){return null!==ae&&ae.apply(this,arguments)||this}de=pe.ChildProperty,O(we,de),e([pe.Property("")],we.prototype,"address",void 0);var de,he=we;function we(){return null!==de&&de.apply(this,arguments)||this}Ie=pe.ChildProperty,O(Re,Ie),e([pe.Property("WholeNumber")],Re.prototype,"type",void 0),e([pe.Property("Between")],Re.prototype,"operator",void 0),e([pe.Property("0")],Re.prototype,"value1",void 0),e([pe.Property("0")],Re.prototype,"value2",void 0),e([pe.Property(!0)],Re.prototype,"ignoreBlank",void 0),e([pe.Property(!0)],Re.prototype,"inCellDropDown",void 0),e([pe.Property(!1)],Re.prototype,"isHighlighted",void 0),e([pe.Property("")],Re.prototype,"address",void 0);var Ie,Ee=Re;function Re(){return null!==Ie&&Ie.apply(this,arguments)||this}Ne=pe.ChildProperty,O(Fe,Ne),e([pe.Property("General")],Fe.prototype,"format",void 0),e([pe.Complex({},k)],Fe.prototype,"style",void 0),e([pe.Property(!0)],Fe.prototype,"isLocked",void 0);var Ne,Ae=Fe;function Fe(){return null!==Ne&&Ne.apply(this,arguments)||this}Oe=pe.ChildProperty,O(Te,Oe),e([pe.Property("GreaterThan")],Te.prototype,"type",void 0),e([pe.Complex({},Ae)],Te.prototype,"format",void 0),e([pe.Property("RedFT")],Te.prototype,"cFColor",void 0),e([pe.Property("")],Te.prototype,"value",void 0),e([pe.Property("")],Te.prototype,"range",void 0),e([pe.Property("")],Te.prototype,"action",void 0);var Oe,ke=Te;function Te(){return null!==Oe&&Oe.apply(this,arguments)||this}De=pe.ChildProperty,O(Pe,De),e([pe.Property(!0)],Pe.prototype,"visible",void 0),e([pe.Property("Auto")],Pe.prototype,"position",void 0);var De,Le=Pe;function Pe(){return null!==De&&De.apply(this,arguments)||this}Be=pe.ChildProperty,O(He,Be),e([pe.Property(!1)],He.prototype,"visible",void 0),e([pe.Property("Auto")],He.prototype,"position",void 0);var Be,Me=He;function He(){return null!==Be&&Be.apply(this,arguments)||this}Ue=pe.ChildProperty,O(ze,Ue),e([pe.Property("")],ze.prototype,"color",void 0),e([pe.Property(1)],ze.prototype,"width",void 0);var Ue,Ve=ze;function ze(){return null!==Ue&&Ue.apply(this,arguments)||this}je=pe.ChildProperty,O(qe,je),e([pe.Property(!1)],qe.prototype,"visible",void 0),e([pe.Property("Circle")],qe.prototype,"shape",void 0),e([pe.Property(5)],qe.prototype,"size",void 0),e([pe.Property(null)],qe.prototype,"fill",void 0),e([pe.Property(!0)],qe.prototype,"isFilled",void 0),e([pe.Complex({},Ve)],qe.prototype,"border",void 0);var je,_e=qe;function qe(){return null!==je&&je.apply(this,arguments)||this}We=pe.ChildProperty,O(Ye,We),e([pe.Property(0)],Ye.prototype,"width",void 0);var We,Ge=Ye;function Ye(){return null!==We&&We.apply(this,arguments)||this}Xe=pe.ChildProperty,O($e,Xe),e([pe.Property(0)],$e.prototype,"width",void 0);var Xe,Ke=$e;function $e(){return null!==Xe&&Xe.apply(this,arguments)||this}Ze=pe.ChildProperty,O(Qe,Ze),e([pe.Property("")],Qe.prototype,"title",void 0),e([pe.Complex({},Ge)],Qe.prototype,"majorGridLines",void 0),e([pe.Complex({},Ke)],Qe.prototype,"minorGridLines",void 0),e([pe.Property(!0)],Qe.prototype,"visible",void 0);var Ze,Je=Qe;function Qe(){return null!==Ze&&Ze.apply(this,arguments)||this}et=pe.ChildProperty,O(nt,et),e([pe.Property("Line")],nt.prototype,"type",void 0),e([pe.Property("Material")],nt.prototype,"theme",void 0),e([pe.Property(!1)],nt.prototype,"isSeriesInRows",void 0),e([pe.Complex({},_e)],nt.prototype,"markerSettings",void 0),e([pe.Property("")],nt.prototype,"range",void 0),e([pe.Property("")],nt.prototype,"id",void 0),e([pe.Property("")],nt.prototype,"title",void 0),e([pe.Property(290)],nt.prototype,"height",void 0),e([pe.Property(480)],nt.prototype,"width",void 0),e([pe.Property(0)],nt.prototype,"top",void 0),e([pe.Property(0)],nt.prototype,"left",void 0),e([pe.Complex({},Le)],nt.prototype,"legendSettings",void 0),e([pe.Complex({},Je)],nt.prototype,"primaryXAxis",void 0),e([pe.Complex({},Je)],nt.prototype,"primaryYAxis",void 0),e([pe.Complex({},Me)],nt.prototype,"dataLabelSettings",void 0);var et,tt=nt;function nt(){return null!==et&&et.apply(this,arguments)||this}rt=pe.ChildProperty,O(ot,rt),e([pe.Property("")],ot.prototype,"src",void 0),e([pe.Property("")],ot.prototype,"id",void 0),e([pe.Property(300)],ot.prototype,"height",void 0),e([pe.Property(400)],ot.prototype,"width",void 0),e([pe.Property(0)],ot.prototype,"top",void 0),e([pe.Property(0)],ot.prototype,"left",void 0);var rt,it=ot;function ot(){return null!==rt&&rt.apply(this,arguments)||this}at=pe.ChildProperty,O(lt,at),e([pe.Property("")],lt.prototype,"author",void 0),e([pe.Property("")],lt.prototype,"text",void 0),e([pe.Property(null)],lt.prototype,"createdTime",void 0);var at,st=lt;function lt(){return null!==at&&at.apply(this,arguments)||this}dt=pe.ChildProperty,O(pt,dt),e([pe.Property("")],pt.prototype,"author",void 0),e([pe.Property("")],pt.prototype,"text",void 0),e([pe.Property(null)],pt.prototype,"createdTime",void 0),e([pe.Property(!1)],pt.prototype,"isResolved",void 0),e([pe.Collection([],st)],pt.prototype,"replies",void 0);var dt,ht=pt;function pt(){return null!==dt&&dt.apply(this,arguments)||this}ct=pe.ChildProperty,O(ut,ct),e([pe.Property("FillSeries")],ut.prototype,"fillType",void 0),e([pe.Property(!0)],ut.prototype,"showFillOptions",void 0);var ct,O=ut;function ut(){return null!==ct&&ct.apply(this,arguments)||this}var ft="workbookDestroyed",mt="updateSheetFromDataSource",gt="dataSourceChanged",vt="dataChanged",yt="triggerDataChange",Ct="workbookOpen",bt="beginSave",xt="actionBegin",St="sortImport",wt="findToolDlg",It="exportDialog",Et="setFilteredCollection",Rt="saveCompleted",Nt="applyNumber",At="getFormattedCell",Ft="calculateFormula",Ot="refreshCellElem",kt="setCellFormat",Tt="findAllValues",Dt="textDecorationUpdate",Lt="applyCellFormat",Pt="updateRowColCount",me="workbookFormulaOperation",Bt="workbookEditOperation",Mt="checkDateFormat",Ht="checkNumberFormat",Ut="parseDecimalNumber",Vt="getFormattedBarText",zt="activeCellChanged",jt="openSuccess",_t="openFailure",qt="sheetCreated",Wt="sheetsDestroyed",Gt="aggregateComputation",Yt="getUniqueRange",Xt="getSortRange",Kt="removeUniquecol",$t="removeSortcol",Zt="checkUniqueRange",Jt="checkSortRange",Qt="reApplyFormula",en="clearFormulaDependentCells",tn="formulaInValidation",nn="beforeSort",rn="initiateSort",on="updateSortedDataOnCell",an="sortComplete",sn="beforeHyperlinkCreate",ln="afterHyperlinkCreate",dn="beforeHyperlinkClick",hn="afterHyperlinkClick",pn="setLinkModel",cn="initiateFilter",un="filterRangeAlert",fn="wrapText",mn="onSave",gn="insert",vn="delete",yn="insertModel",Cn="deleteModel",bn="isValidation",xn="cellValidation",Sn="addHighlight",wn="find",In="gotoHandler",En="replace",Rn="replaceAll",Nn="showFindAlert",An="findKeyUp",Fn="removeHighlight",On="queryCellInfo",kn="count",Tn="protectSheet",Dn="updateToggleItem",Ln="protectsheetHandler",Pn="replaceAllDialog",Bn="unprotectsheetHandler",Mn="editAlert",Hn="readonlyAlert",Un="setLockCells",Vn="setMerge",zn="applyMerge",jn="mergedRange",_n="activeCellMergedRange",qn="insertMerge",Wn="hideShow",Gn="setCFRule",Yn="applyCF",Xn="clearCFRule",Kn="clear",$n="clearCF",Zn="setImage",Jn="setChart",Qn="initiateChart",er="refreshRibbonIcons",tr="refreshChart",nr="refreshChartSize",rr="deleteChartColl",ir="focusChartBorder",or="saveError",ar="updateHighlight",sr="beforeInsert",lr="beforeDelete",dr="deleteHyperlink",hr="moveOrDuplicateSheet",pr="setAutoFill",cr="refreshCell",ur="getFillInfo",fr="getautofillDDB",mr="rowFillHandler",gr="getTextSpace",vr="refreshClipboard",yr="updateView",Cr="selectionComplete",br="refreshInsertDelete",xr="getUpdatedFormulaOnInsertDelete",Sr="beforeCellUpdate",wr="duplicateSheetFilterHandler",Ir="unMerge",Er="checkFormulaRef",Rr="parseFormulaArgument",Nr="getCellRefValue",Ar="commputeFormulaValue",Fr="getChartRowIdxFromClientY",Or="getChartColIdxFromClientX",kr="refreshChartCellOnInit",Tr="localizedFormatAction",Dr="moveSheetHandler",Lr="addListValidationDropdown",Pr="sheetRenameUpdate",Br="updateSortCollection",Mr="importModelUpdate";function Hr(e,t,n,r,i,o,a){if((s=e.value)&&"string"==typeof s){if(s.includes("\n"))return{isNumber:!1,value:s};if(ee(s))return{isNumber:!0,value:s};if(i&&s.includes(i)&&(a||e.format.includes(i)||e.format.includes("$"))&&(s=s.replace(i,"").trim()),n&&s.includes(n)&&Ur(s,t,n,r)&&(s=s.split(n).join("").trim()),ee(s="."!==(r=r||pe.getNumericObject(t).decimal)&&s.includes(r)?s.replace(r,".").trim():s))return{isNumber:!0,value:s};if(o&&2===s.split("/").length)try{var s,l=s.split(" ");return{isNumber:!0,value:s=2===l.length&&1===l[0].split("/").length?Fi(l[0])+Fi(l[1]):Fi(s)}}catch(e){}}else if(ee(s))return{isNumber:!0,value:s};return{isNumber:!1,value:s}}function Ur(e,t,n,r){for(var i=!1,o=123456..toLocaleString(t).split(n).reverse(),a=e.split(r)[0].split(n),s=0;s<a.length&&(i=s===a.length-1?a[s].length===o[0].length:!pe.isUndefined(o[1])&&(0===s?a[s].length<=o[1].length:a[s].length===o[1].length));s++);return i}function ge(e,t){return e&&("="===e[0]||t&&("+"===e[0]||"-"===e[0]))&&(1<e.length||t)}function Vr(e){if(-1<(e=e.split("$").join("")).indexOf(":")){var t=e.split(":");if(Kr(t[0])&&Kr(t[1]))return!0}else if(e.indexOf(":")<0&&Kr(e))return!0;return!1}function zr(e){return 65<=e.charCodeAt(0)&&e.charCodeAt(0)<=90||97<=e.charCodeAt(0)&&e.charCodeAt(0)<=122}function jr(e,t){return 0===t[1]&&t[3]===e.colCount-1}function _r(e,t){return 0===t[0]&&t[2]===e.rowCount-1}function qr(e,t,n){return e&&t>=e[0]&&t<=e[2]&&n>=e[1]&&n<=e[3]}function Wr(e,t,n){for(var r,i=e.split(" "),o=0,a=i.length;o<a&&!(r=qr(ce(i[o]),t,n));o++);return r}function Gr(e,t,n){var r=e[0]<=t[0]&&e[2]>=t[2]&&e[1]<=t[1]&&e[3]>=t[3];if(r)return!0;if(n){if(t[0]<e[0]&&t[2]<e[0]||t[0]>e[2]&&t[2]>e[2])return!1;if(t[0]<e[0]&&t[2]>e[0]&&(t[0]=e[0],r=!0),t[2]>e[2]&&(t[2]=e[2],r=!0),t[1]<e[1]&&t[3]<e[1]||t[1]>e[3]&&t[3]>e[3])return!1;t[1]<e[1]&&t[3]>e[1]&&(t[1]=e[1],r=!0),t[3]>e[3]&&(t[3]=e[3],r=!0)}return r}function Yr(r,i,e){var o=re(e+1);return r?r.split(" ").forEach(function(e){var t,n=ce(e);Gr(n,i)?r=r.split(e).join(o+(n[0]+1)+":"+o+i[0]+" "+o+(i[2]+2)+":"+o+(n[2]+1)):Gr(n,i,!0)&&(t=void 0,t=i[0]>n[0]?o+(n[0]+1)+":"+o+i[0]:o+(i[2]+2)+":"+o+(n[2]+1),r=r.split(e).join(t))}):r=o+"1:"+o+i[0]+" "+o+(i[2]+2)+":"+o+"1048576",r}function Xr(e,t){return!!(e=e||{}).isLocked||!(!1===e.isLocked||(!t||!t.isLocked)&&(e.isLocked||!t||!1===t.isLocked))}function Kr(e){for(var t=e,n=0,r=t.length,i=0;i<r;i++)zr(t[i])&&n++;var e=t.substring(0,n),o=e.length;if(o!==r&&o<4&&1!==r&&isNaN(parseInt(t,10))){o=$r(e);if(o<1||16384<o)return!1;var a=t.substring(n,r);if(0<a.length){for(var s=!0,l=0;l<a.length;l++){var d=a.charCodeAt(l);if(d<48||57<d){s=!1;break}}if(s){e=parseFloat(a);if(0<e&&e<1048577)return!0}}}return!1}function $r(e){var t=0,n=0;if(t<(e=e.toUpperCase()).length&&"!"===e[t]){for(t++;t<e.length&&"!"!==e[t];)t++;t++}for(;t<e.length&&zr(e[t]);){n=26*n+e[t].charCodeAt(0)-64;t++}return 0===n?-1:n}function Y(e,t,n,r,i){var o;if(void 0===r&&(r="rows"),e)if(n)for(var a=t;a<1/0;a++){if(!(o=e[""+r])[t]||!o[t].hidden){if(!i)break;i--}t++}else for(a=t;-1<a&&((o=e[""+r])[t]&&o[t].hidden);a--)t--;return t}function Zr(e,t){var n=Object.keys(e);return(t?-1<n.indexOf("fontSize"):-1<n.indexOf("fontSize")&&12<Number(e.fontSize.split("pt")[0]))||-1<n.indexOf("fontFamily")||-1<n.indexOf("borderTop")||-1<n.indexOf("borderBottom")}function Jr(e){return 1048575<e?e-1048576:e<0?e+1048576:e}function Qr(e){return 16383<e?e-16384:e<0?e+16384:e}function ei(e,t,n,r,i,o,a){var s;if(l=t?(s=i||ye(t[0],t[1],n,!1,!0)).formula||"":l){o&&r.notify(en,{cellRef:G(t[0],t[1])});for(var l,d=["+","-","*","/",">=","<=","<>",">","<","=","%","&","^"],h=void 0,p=l=(l=0===l.indexOf("=")?l.slice(1):l).split("(").join(r.listSeparator).split(")").join(r.listSeparator),c=0;c<d.length;c++)p=(h=p.split(d[c])).join(r.listSeparator);for(var u,f,m,g,v,h=p.split(r.listSeparator),y=[],C=void 0,b=void 0,x=void 0,S=void 0,w=0;w<h.length;w++)!Vr((S=((v=h[w].includes("!"))?(u=h[w].lastIndexOf("!"),x=h[w].substring(0,u),h[w].substring(u+1)):h[w]).toUpperCase()).trim())||S.includes("$")||o&&v||(u=ti(S),f=ni(S),m=ce(S),g=void 0,C=!((g=a?[Jr(e[0]-(t[0]-m[0])),Qr(e[1]-(t[1]-m[1])),Jr(e[0]-(t[0]-m[2])),Qr(e[1]-(t[1]-m[3]))]:[e[0]-(t[0]-m[0]),e[1]-(t[1]-m[1]),e[0]-(t[0]-m[2]),e[1]-(t[1]-m[3])])[1]<0||g[2]<0||g[3]<0||!o&&g[0]<0)&&(o&&g[0]<0&&(g[0]=g[2]),C=G(g[0],g[1]),S.includes(":")&&(C+=":"+G(g[2],g[3])),Vr(C))?C:"#REF!",(b={})[h[w]]=""+u+(C=v?x+"!"+C:C)+f,h[w].includes(":")?y.splice(0,0,b):y.push(b));for(var I=l=s.formula,w=0;w<y.length;w++){for(var E=Object.keys(y[w])[0],R=y[w][""+E],N=E.length,E=I.indexOf(E),A="",F=0;F<R.length;F++)A+=" ";l=l.slice(0,E)+R+l.slice(E+N),I=I.slice(0,E)+A+I.slice(E+N)}return l}return null}function ti(e){for(var t="",n=0;n<e.length&&" "===e[n];n++)t+=" ";return t}function ni(e){for(var t="",n=e.length-1;0<=n&&" "===e[n];n--)t=" "+t;return t}function ri(e,t,n,r,i){var o,a,s,l,d,h={cell:n.cell,rowIndex:n.rowIdx,colIndex:n.colIdx,cancel:!1,sheet:t.name};return n.preventEvt||e.trigger(Sr,h),n.eventOnly||h.cancel||(n.valChange?(s=ye(h.rowIndex,h.colIndex,t),o=!n.preventEvt&&e.getDisplayText(s),l=!(!s||!s.formula),co(h.rowIndex,h.colIndex,t,h.cell,!n.pvtExtend),d=ye(h.rowIndex,h.colIndex,t,!1,!0),n.mergedCells&&(delete d.value,delete d.formula),d.formattedText&&delete d.formattedText,h.cell&&h.cell.style&&ii(d.style),(a="paste"===n.requestType)&&(s&&(s.notes&&e.notify("processSheetNotes",{sheet:t,id:s.notes.id,isDelete:!0}),s.comment)&&e.notify("processSheetComments",{sheet:t,id:s.comment.id,isDelete:!0}),h.cell)&&(h.cell.notes&&(s={},Object.assign(s,h.cell.notes),delete s.id,s.rowIdx=h.rowIndex,s.colIdx=h.colIndex,e.notify("processSheetNotes",{sheet:t,note:s}),h.cell.notes=s),h.cell.comment)&&(s={},Object.assign(s,h.cell.comment),delete s.id,s.address=[h.rowIndex,h.colIndex],e.notify("processSheetComments",{sheet:t,comment:s}),h.cell.comment=s),s={action:"updateCellValue",address:[h.rowIndex,h.colIndex],sheetIndex:K(e,t.name),value:l&&!d.formula?d.value||(0===d.value?"0":""):d.formula||d.value||(0===d.value?"0":""),skipFormatCheck:n.skipFormatCheck,isRandomFormula:n.isRandomFormula,isDelete:n.isDelete,deletedRange:n.deletedRange,fillType:n.fillType,cellInformation:r,isRedo:!i,actionName:n.fillType,isPaste:a},e.notify(Bt,s),n.isFormulaDependent=s.isFormulaDependent,n.requestType&&null===h.cell&&co(h.rowIndex,h.colIndex,t,h.cell,!n.pvtExtend),n.cellDelete&&(delete d.value,delete d.formula,delete d.hyperlink),n.uiRefresh&&e.serviceLocator.getService("cell").refresh(h.rowIndex,h.colIndex,n.lastCell,n.td,n.checkCF,n.checkWrap,n.skipFormatCheck,n.isRandomFormula,n.fillType),n.preventEvt||(l=e.getDisplayText(d))!==o&&(i={value:r=(r=ye(h.rowIndex,h.colIndex,t,!1,!0).value)||(0===r?"0":""),oldValue:o,formula:d.formula||"",address:t.name+"!"+G(h.rowIndex,h.colIndex),displayText:l},n.requestType&&(i.requestType=n.requestType),e.trigger("cellSave",i))):(co(h.rowIndex,h.colIndex,t,h.cell,!n.pvtExtend),h.cell&&h.cell.style&&ii((d=ye(h.rowIndex,h.colIndex,t,!1,!0)).style))),h.cancel}function ii(e){""===e.border?(delete e.border,delete e.borderTop,delete e.borderBottom,delete e.borderLeft,delete e.borderRight):(""===e.borderTop&&delete e.borderTop,""===e.borderBottom&&delete e.borderBottom,""===e.borderLeft&&delete e.borderLeft,""===e.borderRight&&delete e.borderRight)}function oi(e,t,n){for(var r=0,i=e.length;r<i;){var o=Math.floor((r+i)/2),a=n?e[o].address[0]:e[o].rowIdx,s=n?e[o].address[1]:e[o].colIdx;a<t[0]||a===t[0]&&s<t[1]?r=o+1:i=o}return r}function ai(e,t,n){for(var r=e,i=e,o=t,a=t,s=n.usedRange.rowIndex,l=n.usedRange.colIndex,d=function(e){for(var t=0;t<=l;t++)if(!pe.isUndefined(ye(e,t,n,null,!0).value))return!1;return!0},h=function(e){for(var t=r;t<=i;t++)if(!pe.isUndefined(ye(t,e,n,null,!0).value))return!1;return!0},p=r;p<=s&&(!pe.isUndefined(ye(p,t,n,null,!0).value)||!d(p));p++)i=p;for(p=r;0<=p&&(!pe.isUndefined(ye(p,t,n,null,!0).value)||!d(p));p--)r=p;for(p=o;p<=l&&(!pe.isUndefined(ye(e,p,n,null,!0).value)||!h(p));p++)a=p;for(p=o;0<=p&&(!pe.isUndefined(ye(e,p,n,null,!0).value)||!h(p));p--)o=p;return[r,o,i,a]}function si(e,t,n){var r,i=ce(e.model.selectedRange),o=0,a=0;return"Column"===e.modelType?((n||"before"===e.insertType&&e.isUndoRedo)&&(i=[0,e.start,0,e.end]),"before"===e.insertType?t[1]<=i[1]&&t[3]>=i[1]?(o=0,a=i[3]-i[1]+1):i[1]<t[1]&&(o=a=i[3]-i[1]+1):(e.isUndoRedo&&(r=e.end-e.start+1,i=[0,e.start-r,0,e.end-r]),t[1]<=i[3]&&t[3]>=i[3]?(o=0,a=i[3]-i[1]+1):i[3]<t[3]&&(o=a=i[3]-i[1]+1)),[t[0],t[1]+o,t[2],t[3]+a]):((n||"above"===e.insertType&&e.isUndoRedo)&&(i=[e.start,0,e.end,0]),"above"===e.insertType?t[0]<=i[0]&&t[2]>=i[0]?a=i[2]-i[o=0]+1:i[0]<t[0]&&(o=a=i[2]-i[0]+1):(e.isUndoRedo&&(r=e.end-e.start+1,i=[e.start-r,0,e.end-r,0]),t[0]<=i[2]&&t[2]>=i[2]?a=i[2]-i[o=0]+1:i[2]<t[2]&&(o=a=i[2]-i[0]+1)),[t[0]+o,t[1],t[2]+a,t[3]])}function li(e,t){var n,r=0,i=0;return"Column"===e.modelType?((n=[0,e.start,e.model.usedRange.rowIndex,e.end])[3]<t[1]?r=i=n[3]-n[1]+1:n[1]>=t[1]&&n[3]<=t[3]?i=n[3]-n[1]+1:n[1]>=t[1]&&n[1]<=t[3]?i=t[3]-n[1]+1:n[1]<t[1]&&n[3]>=t[1]?(r=t[1]-n[1],i=n[3]-n[1]+1):n[1]<t[1]&&n[3]<t[3]&&(r=n[3]-t[1]+(n[3]-n[1])+1,i=n[3]-n[1]+1),[t[0],t[1]-r,t[2],t[3]-i]):((n=[e.start,0,e.end,e.model.usedRange.colIndex])[2]<t[0]?r=i=n[2]-n[0]+1:n[0]>=t[0]&&n[2]<=t[2]?i=n[2]-n[0]+1:n[0]>=t[0]&&n[0]<=t[2]?i=t[2]-n[0]+1:n[0]<t[0]&&n[2]>=t[0]?(r=t[0]-n[0],i=n[2]-n[0]+1):n[0]<t[0]&&n[2]<t[2]&&(r=n[2]-t[0]+(n[2]-n[0])+1,i=n[2]-n[0]+1),[t[0]-r,t[1],t[2]-i,t[3]])}function di(e,t,n,r,i,o,a){for(var s,l=e.length-1;0<=l;l--)for(var d=e[l].range.trim().split(","),h=0;h<d.length;h++){if(n>=(s=ce(d[h].includes(":")?d[h]:d[h]+":"+d[h]))[0]&&r>=s[1]&&n<=s[2]&&r<=s[3]){t.push(e[l]),e.splice(l,1);break}if(i&&i[0]>=s[0]&&i[1]>=s[1]&&i[0]<=s[2]&&i[1]<=s[3]){var p={action:"autofillWithCF",cFColor:e[l].cFColor,range:ue(o),type:e[l].type,value:e[l].value};e.splice(l,1);for(var c=0,u=a.conditionalFormats;c<u.length&&("autofillWithCF"!==u[c].action||u[c].range!==p.range);c++)c===u.length-1&&(t.push(p),a.conditionalFormats.push(p));break}}}function hi(e,t){for(var n,r,i,o,a,s=t.trim().split(","),l=0;l<e.length;l++)if(function(e){for(var t=0;t<s.length;t++){if(a=ce(s[t].includes(":")?s[t]:s[t]+":"+s[t]),e[0]<=a[0]&&e[1]<=a[1]&&e[2]>=a[2]&&e[3]>=a[3])return!0;if(i=e[0]>=a[0]&&e[0]<=a[2],o=e[2]>=a[0]&&e[2]<=a[2],n=e[1]>=a[1]&&e[1]<=a[3],r=e[3]>=a[1]&&e[3]<=a[3],i&&o){if(n||r||e[1]<a[1]&&e[3]>a[3]){if(0<e[0]-a[0])return!0;if(0<a[2]-e[2])return!0}if(n&&e[1]!==a[1])return!0;if(r&&e[3]!==a[3])return!0}else if(n&&r){if(i||o||e[0]<a[0]&&e[2]>a[2]){if(0<e[1]-a[1])return!0;if(0<a[3]-e[3])return!0}if(i){if(e[0]!==a[0])return!0}else if(o&&e[2]!==a[2])return!0}else if(i||o){if(n){if(e[1]!==a[1])return!0;if(0<e[0]-a[0])return!0;if(0<a[2]-e[2])return!0}else if(r){if(e[3]!==a[3])return!0;if(0<e[0]-a[0])return!0;if(0<a[2]-e[2])return!0}else if(e[1]<a[1]&&e[3]>a[3])return!0}else if((n||r)&&e[0]<a[0]&&e[2]>a[2])return!0}return!1}(e[l]))return!0;return!1}function pi(e,t,n){var r;n=n||pe.getNumericObject(t.locale);for(var i=0;i<e.length;i++)ee(e[i])?"."===n.group&&(e[i]=e[i].toString(),e[i].indexOf("."))&&Ur(e[i],t.locale,n.group,n.decimal)&&(e[i]=e[i].split(n.group).join("")):(r={formattedText:e[i],value:e[i],format:"General",dataUpdate:!0,cell:{value:e[i],format:"General"},isEdit:!0},t.notify(At,r),ee(r.value)&&(e[i]=r.value.toString()));return e}function ci(e,t){var n,r,i=e.getActiveSheet(),o=[[t.topIndex+e.frozenRowCount(i),t.leftIndex+e.frozenColCount(i),t.bottomIndex,t.rightIndex]];return(i.frozenRows||i.frozenColumns)&&(n=e.frozenRowCount(i),e=e.frozenColCount(i),r=W(i.topLeftCell),n&&e&&(o.push([r[0],r[1],n-1,e-1]),i=W(i.paneTopLeftCell),o.push([i[0],r[1],t.bottomIndex,e-1])),n&&o.push([r[0],t.leftIndex+e,n-1,t.rightIndex]),e)&&o.push([t.topIndex+n,r[1],t.bottomIndex,e-1]),o}function ui(e){var t;te(e.sheet,e.rowIdx)&&(t=Y(e.sheet,e.rowIdx,!0))<e.rowIdx+e.cell.rowSpan&&(e.rowIdx=t,e.isMergedHiddenCell=!0),ne(e.sheet,e.colIdx)&&(t=Y(e.sheet,e.colIdx,!0,"columns"))<e.colIdx+e.cell.colSpan&&(e.colIdx=t,e.isMergedHiddenCell=!0)}function fi(e){return e.workbookOpenModule&&e.workbookOpenModule.preventFormatCheck}function mi(n){var e=new pe.Internationalization,r={intl:e,updateValue:!0,value:"",curSymbol:pe.getNumberDependable(n.locale,pe.defaultCurrencyCode)},i={args:r,intl:e},o=pe.getNumericObject(n.locale);return function(e){var t;e.format||!e.value||ee(e.value)||(r.cell=e,r.value=e.value,n.notify(Mt,r),e.format)||((t=e.value.toString()).includes(i.args.curSymbol)||t.includes(o.group)||t.includes("%")?(i.fResult=t,n.notify(Ht,i)):"."===o.decimal||ee(t)||t.includes(o.decimal)&&ee(t=t.replace(o.decimal,"."))&&(e.value=t))}}function gi(e,t,n){var r=new Z.Query,i=(t.length&&r.where(Z.Predicate.and(t)),e.executeLocal(r));if(n)for(var o=0,a=n.length;o<a&&i.length;o++)r=new Z.Query,n[o].length&&r.where(Z.Predicate.or(n[o])),i=new Z.DataManager(i).executeLocal(r);return i}function vi(e,t,n){return e&&e.isReadOnly||n&&n.isReadOnly||t&&t.isReadOnly}function yi(e,t,n){for(var r=e.getActiveSheet(),i=pe.isNullOrUndefined(t)?fe(ce(r.selectedRange)):t,o=i[0];o<=i[2];o++)for(var a=i[1];a<=i[3];a++)if(vi(ye(o,a,r),Sh(r,a),uh(r,o)))return n&&e.notify(Hn,null),!0;return!1}function Ci(e,t){var t=t||e.selectedRange,n=ce(t),r=e.colCount,e=e.rowCount;return n[2]===e-1&&0===n[0]?t=t.replace(/[0-9]/g,""):n[3]===r-1&&0===n[2]&&(t=t.replace(/\D/g,"")),t}function bi(e){var t;return 0<window.devicePixelRatio%1?e+((t=e*window.devicePixelRatio%1)?(.5<t?1-t:-1*t)/window.devicePixelRatio:0):e}function xi(i,e,t){var o,a,s,l,d,h;e.length&&(o=i.getActiveSheet(),l=(s=i).frozenColCount(o),d=t&&t[0]||(l?W(o.topLeftCell)[1]:s.viewport.leftIndex),h=t&&t[1]||s.viewport.rightIndex,e.forEach(function(e){for(var t=d;t<=h;t++){t===l&&(t+=s.viewport.leftIndex),a=ye(e,t,o,!1,!0).style;var n,r=ye(e-1,t,o,!1,!0);r.rowSpan&&1!==r.rowSpan&&r.colSpan&&1!==r.colSpan||r.style&&r.style.borderBottom&&"none"!==r.style.borderBottom&&(!a||a.borderTop!==r.style.borderBottom)||a&&a.borderTop&&(r=i.getCell(e-1,t))&&r.style.borderBottom&&(n=i.getCell(e,t))&&(r.style.borderBottom="",n.style.borderTop=a.borderTop)}}))}function Si(e){return(void 0===e||(e=e instanceof Date?e:new Date(e),Number.isNaN(e.getTime()))?new Date:e).toISOString().slice(0,-1)}function wi(e,t,o){o=o||500;function a(e){return window.crypto.subtle.digest("SHA-512",e).then(function(e){return new Uint8Array(e)})}function s(e){for(var t="",n=0;n<e.length;n+=32768){var r=e.subarray(n,n+32768);t+=String.fromCharCode.apply(null,Array.from(r))}return btoa(t)}var l=t instanceof Uint8Array?t:function(e){e=new Uint8Array(e);return window.crypto.getRandomValues(e),e}(16),t=function(e){for(var t=new Uint16Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return new Uint8Array(t.buffer)}(e);return a(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e.reduce(function(e,t){return e+t.length},0),r=new Uint8Array(n),i=0,o=0,a=e;o<a.length;o++){var s=a[o];r.set(s,i),i+=s.length}return r}(l,t)).then(function(e){var n=new Uint8Array(68),r=(n.set(e,0),new DataView(n.buffer,n.byteOffset,n.byteLength)),i=function(t,e){return o<=t?Promise.resolve(e):(r.setUint32(64,t,!0),a(n).then(function(e){return n.set(e,0),i(t+1,e)}))};return i(0,e).then(function(e){return{hashValue:s(e),saltValue:s(l)}})})}function Ii(e){var t=e.toString();return e===parseInt(t,10)?parseInt(t,10)+" ":(e=-1<t.indexOf(".")?t.split(".")[1]:0,t=Math.pow(10,e.toString().replace("-","").length),e/(e=Math.abs(Ei(e,t)))+"/"+t/e)}function Ei(e,t){return e=Number(e),(t=Number(t))?Ei(t,e%t):e}function Ri(e){60<(e=0<(e=Number(e))&&e<1?1+e:0===e?1:e)&&--e;var t=new Date("01/01/1900"),t=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return new Date(new Date(864e5*(e-1)+t).toUTCString().replace(" GMT",""))}function Ni(e,t,n){var r=new Date("01/01/1900"),e=Ai(e)?e:new Date(e),r=Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e=(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())-r)/864e5;return(t?e:parseInt(e.toString(),10))+(n?0:60<e?2:1)}function Ai(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function ee(e){return 0<=e-parseFloat(e)}function Fi(e){return Function('"use strict";return ('+e+")")()}function Oi(e,d,t,n,r,i){function h(){"time"===u.type&&(u.dateObj=new Date((o?o.toDateString():"01/01/1900")+" "+u.dateObj.toLocaleTimeString()))}var o,p=pe.IntlBase.getDependables(pe.cldrData,t,null).dateObject,c=p.dateTimeFormats.availableFormats,u={dateObj:null,isCustom:!1,type:""};if(n&&(u.dateObj=d.parseDate(e,{format:n}),u.dateObj)&&(u.type=-1<e.toString().indexOf(":")?"time":"datetime",h(),u.isCustom=!0),pe.isNullOrUndefined(u.dateObj)){if((e=e.toString())&&-1<e.indexOf("/")||0<e.indexOf("-")){t=r&&r.format||n;if(t){r=t.toLowerCase().includes("dd-mm-yy");if((r||t.toLowerCase().includes("dd/mm/yy"))&&(u.dateObj=d.parseDate(e,{format:t=r?"d-M-y":"d/M/y",skeleton:"yMd"}),u.dateObj))return u.type="date",u}}n=function(e){if(e.indexOf(":")<0)for(var t=0,n=Object.keys(p.dateFormats);t<n.length;t++){var r=n[t];if(u.dateObj=d.parseDate(e,{format:p.dateFormats[""+r],skeleton:r}),u.dateObj){u.type="date",u.isCustom=!1;break}}if(pe.isNullOrUndefined(u.dateObj))for(var i=void 0,o=0,a=Object.keys(c);o<a.length;o++){r=a[o],i=c[""+r];if(u.dateObj=d.parseDate(e,{format:i,skeleton:r}),!u.dateObj&&-1<e.indexOf(":")&&-1<i.indexOf(":")&&(u.dateObj=d.parseDate(e,{format:i.split(" ")[0]})),u.dateObj){u.type=-1<e.toString().indexOf(":")?"time":"datetime",h(),u.isCustom=!0;break}}if(pe.isNullOrUndefined(u.dateObj))for(var s=0,l=Object.keys(p.timeFormats);s<l.length;s++){r=l[s];if(u.dateObj=d.parseDate(e,{format:p.timeFormats[""+r],skeleton:r}),u.dateObj){u.type="time",h(),u.isCustom=!1;break}}};i?2<=(r=e.split(" ")).length&&(n(r.shift()),u.dateObj)&&(o=u.dateObj,u.dateObj=null,n(r.join(" ")),u.dateObj)&&(u.type="datetime"):n(e)}return"#DIV/0!"===e||u.dateObj||"Invalid Date"===new Date(e).toString()||(u.dateObj=new Date(e),u.type="date"),u}function ki(e,t,n){if(e&&"."!==e&&"-"!==e){var r=e.toString(),i=Number.MAX_SAFE_INTEGER.toString().length;if(r.startsWith("-")&&(r=(r=r.slice(1)).includes("-")?e:r),/^\d*\.?\d*$/.test(r))return t&&(r.length>i||n&&(r.startsWith("0")||r.endsWith("0")))?e:parseFloat(e)}return e}var Ti="spreadsheetLocale",Di={SortOutOfRangeError:"Select a cell or range inside the used range and try again."};function Li(N,A,F,O,k,T,t,n,D,r,L,P){return void 0===D&&(D=!0),new Promise(function(e){var I,E,R;e((-1<(e=A.lastIndexOf("!"))?(I=K(N,A.substring(0,e)),A=A.substring(e+1)):I=N.activeSheetIndex,E=ve(N,I),R=B(r||A),e={sheet:E,indexes:R,formulaCellRef:t,sheetIndex:n,promise:new Promise(function(e){e(void 0)})},N.notify(mt,e),e.promise.then(function(){var i,o,a=R[0],e=N.frozenRowCount(E),t=N.frozenColCount(E),s=!!P;if(F){var l,d,h,p,c,u,f,m,g=[];O?(u=pe.getNumericObject(N.locale),f=new pe.Internationalization(N.locale)):m=mi(N),A.split(",").forEach(function(e,t){for(R=ce(e),a=R[l=0];a<=R[2];){for(d=g[l]||{},o=uh(E,a),i=R[1];i<=R[3];)if(!D||!te(E,a)||T&&mh(E,a)){p=re(i+1);var n,r=o?ye(a,i,E):null;if(O)r&&(r.value||0===r.value||r.formula)?(r.formattedText&&r.format&&!r.format.includes("*")?vo(r.format,!1)?d[p]=Ri(r.value):d[p]=r.formattedText.toString().trim():d[p]=Pi(N,r,a,i,I,!1,f),"string"==typeof(c=r.value)&&("."!==u.decimal&&c.includes(u.decimal)?ee(h=c.replace(u.decimal,"."))&&(c=parseFloat(h)):ee(c)&&(c=parseFloat(c)))):c=r&&r.hyperlink?"string"==typeof(n=r.hyperlink)?d[p]=n:n.address?(d[p]=n.address,n.address):d[p]="":(d[p]="",null),d[p+"_value"]=c;else if((r&&(r.formula||!pe.isNullOrUndefined(r.value)||r.hyperlink)||Object.keys(d).length)&&(i===L?((c={value:Pi(N,r,a,i,I,!0)}).value&&"string"==typeof c.value&&(ee(c.value)&&!r.value.toString().includes("\n")?r.format&&"@"===r.format||(c.value=parseFloat(c.value)):r.format||(m(r),ee(r.value)&&!r.value.toString().includes("\n")&&(c.value=parseFloat(r.value)))),d[p]=pe.extend({},r,c)):d[p]=r),r&&(r.rowSpan&&1!==r.rowSpan||r.colSpan&&1!==r.colSpan))return void(g=[{throwMergeAlert:!0}]);i===R[3]&&Object.keys(d).length&&(d.__rowIndex=(a+1).toString(),g[l]=d,s&&0===t&&!mh(E,a)&&P.push(d),l++),i++}else a++;a++}})}else{g=new Map;for(var n=!(O||!k||!k.length);a<=R[2];)if(n&&e<=a&&a<k[0])a=k[0];else{if(O||!te(E,a))for(o=uh(E,a),i=R[1];i<=R[3];){var r={cell:ye(a,i,E),address:G(a,i),rowIndex:a,colIndex:i},v=(N.trigger(On,r),ye(a,i,E,!1,!0)),y=(v.formula||"").toUpperCase();if((y.includes("UNIQUE")||y.includes("SORT"))&&N.notify(Ft,{cell:v,rowIdx:a,colIdx:i,sheetIndex:N.activeSheetIndex,address:r.address}),1<v.colSpan&&1<v.rowSpan)for(var C=void 0,b=a,x=a+v.rowSpan;b<x;b++)for(var S=i,w=i+v.colSpan;S<w;S++)b===a&&S===i||(C=new Object,b!==a&&(C.rowSpan=a-b),S!==i&&(C.colSpan=i-S),E.rows[b]&&E.rows[b].cells&&E.rows[b].cells[S]&&(delete E.rows[b].cells[S].value,delete E.rows[b].cells[S].formula),co(b,S,E,C,!0));else if(1<v.colSpan)for(b=i+1,x=i+v.colSpan;b<x;b++)co(a,b,E,{colSpan:i-b},!0),E.rows[a]&&E.rows[a].cells&&E.rows[a].cells[b]&&(delete E.rows[a].cells[b].value,delete E.rows[a].cells[b].formula);else if(1<v.rowSpan)for(b=a+1,x=a+v.rowSpan;b<x;b++)co(b,i,E,{rowSpan:a-b},!0),E.rows[b]&&E.rows[b].cells&&E.rows[b].cells[i]&&(delete E.rows[b].cells[i].value,delete E.rows[b].cells[i].formula);!O&&ne(E,i)?i++:n&&t<=i&&i<k[1]?i=k[1]:(v.style&&(y={},Object.assign(y,v.style),v.style=y),g.set(r.address,v),i++)}a++}}return g})))})}function Pi(e,t,n,r,i,o,a){if(t){if(t.formula&&pe.isNullOrUndefined(t.value)&&e.notify(Ft,{cell:t,rowIdx:n,colIdx:r,sheetIndex:i}),pe.isNullOrUndefined(t.value))return"";if(t.format)return i={value:t.value,formattedText:t.value,cell:t,format:t.format,checkDate:!o,rowIndex:n,colIndex:r,dataUpdate:!0},e.notify(At,i),i.dateObj&&"Invalid Date"!==i.dateObj.toString()?i.dateObj:o?i.value:i.formattedText.toString().trim();if(o)return t.value;n=t.value;if(ee(n))((n=Number(t.value).toString()).includes(".")||11<n.length)&&(e.notify(Ut,r={args:{value:n,updateValue:!0},fResult:n,cellVal:n,intl:a}),n=r.fResult);else if(t.value&&"string"==typeof t.value&&!t.value.trim())return"";return n}return""}function Bi(r,i,o,e,a,s,l){for(var d,h,p,c=0,u=r.length,t=(e&&0<r.length&&r.sort(function(e,t){return pe.isNullOrUndefined(e)||pe.isUndefined(e.index)||pe.isNullOrUndefined(t)||pe.isUndefined(t.index)?0:e.index-t.index}),0);t<u;t++)!function(e){if(pe.isNullOrUndefined(r[e])||pe.isUndefined(r[e].index)||(h=c=r[e].index-e,delete r[e].index),0<c){for(d=0;c--;)i?(o.createSheet(e+d),d++):r.splice(e,0,null);e+=h,u+=h}var t,n;i?(r[e].id<1&&(r[e].id=eo(o.sheets),r[e].properties)&&(r[e].properties.id=r[e].id),r[e].name||o.setSheetPropertyOnMute(r[e],"name","Sheet"+Qi(o)),t=0,r[e].rows.forEach(function(e){t=Math.max(t,e&&e.cells&&e.cells.length-1||0)}),o.setSheetPropertyOnMute(r[e],"usedRange",{rowIndex:r[e].rows.length?r[e].rows.length-1:0,colIndex:t})):void 0!==a&&(l||s)&&(n=r[e],s&&n&&n.comment&&s(n,a,e),l)&&n&&n.notes&&l(n,a,e),p=e}(t),t=p}Mi=function(e,t){return(Mi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var Mi,Hi,e=function(e,t){function n(){this.constructor=e}Mi(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},Ui=function(){return(Ui=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;0<=s;s--)(i=e[s])&&(a=(o<3?i(a):3<o?i(t,n,a):i(t,n))||a);return 3<o&&a&&Object.defineProperty(t,n,a),a},Vi=(Hi=pe.ChildProperty,e(zi,Hi),zi.prototype.setProperties=function(e,t){var n=this;if(this.parentObj.isComplexArraySetter&&this.controlParent&&this.controlParent.isAngular)if(Object.keys(e).length){void 0===this.parentObj.currRangeIdx?this.parentObj.currRangeIdx=0:this.parentObj.currRangeIdx+=1;var r=this.parentObj.ranges[this.parentObj.currRangeIdx];r&&r.info&&(this.info=r.info),setTimeout(function(){void 0!==n.parentObj.currRangeIdx&&delete n.parentObj.currRangeIdx})}else if(this.controlParent.tagObjects[0].instance&&this.controlParent.tagObjects[0].instance.hasChanges&&!this.controlParent.tagObjects[0].instance.isInitChanges){r=this.controlParent.sheets.indexOf(this.parentObj);if(void 0===this.parentObj.changedRangeIdx){for(var i,o=this.controlParent.tagObjects[0].instance.list[r].tagObjects,a=0;a<o.length;a++)if("ranges"===o[a].name){o[a].instance.list.forEach(function(e,t){e.hasChanges&&(i=t)});break}this.parentObj.changedRangeIdx=i}}Hi.prototype.setProperties.call(this,e,t)},t([pe.Property(null)],zi.prototype,"dataSource",void 0),t([pe.Property("A1")],zi.prototype,"startCell",void 0),t([pe.Property(null)],zi.prototype,"query",void 0),t([pe.Property(null)],zi.prototype,"fieldsOrder",void 0),t([pe.Property(!0)],zi.prototype,"showFieldAsHeader",void 0),t([pe.Property("")],zi.prototype,"template",void 0),t([pe.Property("A1")],zi.prototype,"address",void 0),zi);function zi(){return null!==Hi&&Hi.apply(this,arguments)||this}ji=pe.ChildProperty,e(qi,ji),t([pe.Property(0)],qi.prototype,"rowIndex",void 0),t([pe.Property(0)],qi.prototype,"colIndex",void 0);var ji,_i=qi;function qi(){return null!==ji&&ji.apply(this,arguments)||this}Wi=pe.ChildProperty,e(Yi,Wi),t([pe.Property(null)],Yi.prototype,"rows",void 0),t([pe.Property(null)],Yi.prototype,"columns",void 0),t([pe.Complex({},se)],Yi.prototype,"protectSettings",void 0),t([pe.Collection([],Vi)],Yi.prototype,"ranges",void 0),t([pe.Collection([],ke)],Yi.prototype,"conditionalFormats",void 0),t([pe.Property(0)],Yi.prototype,"index",void 0),t([pe.Property("")],Yi.prototype,"name",void 0),t([pe.Property(100)],Yi.prototype,"rowCount",void 0),t([pe.Property(100)],Yi.prototype,"colCount",void 0),t([pe.Property("A1:A1")],Yi.prototype,"selectedRange",void 0),t([pe.Property("A1")],Yi.prototype,"activeCell",void 0),t([pe.Complex({},_i)],Yi.prototype,"usedRange",void 0),t([pe.Property("A1")],Yi.prototype,"topLeftCell",void 0),t([pe.Property(!0)],Yi.prototype,"showHeaders",void 0),t([pe.Property(!0)],Yi.prototype,"showGridLines",void 0),t([pe.Property(!1)],Yi.prototype,"isProtected",void 0),t([pe.Property("Visible")],Yi.prototype,"state",void 0),t([pe.Property(0)],Yi.prototype,"frozenRows",void 0),t([pe.Property(0)],Yi.prototype,"frozenColumns",void 0),t([pe.Property("A1")],Yi.prototype,"paneTopLeftCell",void 0),t([pe.Property("")],Yi.prototype,"password",void 0),t([pe.Property(null)],Yi.prototype,"standardHeight",void 0),t([pe.Property(!1)],Yi.prototype,"isSheetCalculated",void 0),t([pe.Property(null)],Yi.prototype,"hashValue",void 0),t([pe.Property(null)],Yi.prototype,"saltValue",void 0),t([pe.Property(null)],Yi.prototype,"spinCount",void 0);var Wi,Gi=Yi;function Yi(){return null!==Wi&&Wi.apply(this,arguments)||this}function K(e,t){var n;t.startsWith("'")&&t.endsWith("'")&&(t=t.replace(/''/g,"'").replace(/^'|'$/g,""));for(var r=0;r<e.sheets.length;r++)if(e.sheets[r].name.toLowerCase()===t.toLowerCase()){n=r;break}return n}function Xi(e,t){for(var n,r=0;r<e.sheets.length;r++)if(e.sheets[r].id===t){n=r;break}return n}function Ki(e){var t=e.lastIndexOf("!");return(-1<t?e.substring(0,t):e).replace(/'/gi,"")}function $i(e,t,n){for(var r=n.length,i=0;i<r;i++)if(n[i].sheet.toUpperCase()===t.toUpperCase())return n[i].index;return-1}function Zi(e,t,n,r){e.setSheetPropertyOnMute(n=void 0===n?{}:n,"selectedRange",r?n.selectedRange+" "+t:t)}function Ji(e){return e&&e.selectedRange||"A1"}function ve(e,t){return e.sheets[t]}function Qi(e){var t=[];e.sheets.forEach(function(e){t.push(e.name.toLowerCase())});for(var n=0;n<t.length;n++){if(!(-1<t.indexOf("sheet"+e.sheetNameCount)))return e.sheetNameCount++;e.sheetNameCount++}return e.sheetNameCount++}function eo(e){var t=0;return e.forEach(function(e){t=Math.max(e.id,t)}),t+1}function to(l,e,d,h){e=e||l.sheets;e.forEach(function(t){var e,n,r,i,o,a,s;t.id=t.id||0,t.name=t.name||"",l.setSheetPropertyOnMute(t,"rowCount",t.rowCount||100),l.setSheetPropertyOnMute(t,"colCount",t.colCount||100),l.setSheetPropertyOnMute(t,"topLeftCell",t.topLeftCell||"A1"),l.setSheetPropertyOnMute(t,"activeCell",t.activeCell||"A1"),l.setSheetPropertyOnMute(t,"selectedRange",t.selectedRange||t.activeCell+":"+t.activeCell),l.setSheetPropertyOnMute(t,"usedRange",t.usedRange||{rowIndex:0,colIndex:0}),l.setSheetPropertyOnMute(t,"ranges",t.ranges||[]),l.setSheetPropertyOnMute(t,"rows",t.rows&&pe.extend([],t.rows,null,!0)||[]),l.setSheetPropertyOnMute(t,"columns",t.columns||[]),l.setSheetPropertyOnMute(t,"showHeaders",!!pe.isUndefined(t.showHeaders)||t.showHeaders),l.setSheetPropertyOnMute(t,"showGridLines",!!pe.isUndefined(t.showGridLines)||t.showGridLines),l.setSheetPropertyOnMute(t,"state",t.state||"Visible"),t.maxHgts=t.maxHgts||[],t.comments=t.comments||[],t.notes=t.notes||[],t.isImportProtected=t.isProtected&&d,t.protectSettings=t.protectSettings||{selectCells:!1,formatCells:!1,formatRows:!1,formatColumns:!1,insertLink:!1},t.isProtected=t.isProtected||!1,t.password&&0<t.password.length&&wi(t.password).then(function(e){l.setSheetPropertyOnMute(t,"hashValue",e.hashValue),l.setSheetPropertyOnMute(t,"saltValue",e.saltValue),l.setSheetPropertyOnMute(t,"password","")}),t.paneTopLeftCell&&"A1"!==t.paneTopLeftCell||(t.frozenRows=t.frozenRows||0,t.frozenColumns=t.frozenColumns||0,e=W(t.topLeftCell),l.setSheetPropertyOnMute(t,"paneTopLeftCell",G(t.frozenRows?e[0]+t.frozenRows:e[0],t.frozenColumns?e[1]+t.frozenColumns:e[1]))),Bi(t.columns),n=(e=t).rows,i=h,(r=d)?(e.comments.length||(o=no(e)),e.notes.length||(a=ro(e))):(o=no(e,i),a=ro(e,i)),s=-1,n.forEach(function(e){e&&(void 0===e.index?s++:s=e.index,e.cells)&&Bi(e.cells,null,void 0,r,s,o,a)}),Bi(n,null,void 0,r)}),Bi(e,!0,l)}function no(i,o){return function(e,t,n){var r=Ui({},e.comment);r.id||(r.id=pe.getUniqueID("e_spreadsheet_comment")),r.address||(r.address=[t,n]),r.createdTime&&(r.createdTime=Si(r.createdTime)),r.replies&&0<r.replies.length&&r.replies.forEach(function(e){e.id=pe.getUniqueID("e_spreadsheet_reply"),e.createdTime&&(e.createdTime=Si(e.createdTime))}),e.comment=r,o&&i.comments.some(function(e){return e.id===r.id})||i.comments.push(r)}}function ro(i,o){return function(e,t,n){var r;"string"==typeof e.notes?r={id:pe.getUniqueID("e_note"),text:e.notes,rowIdx:t,colIdx:n,isVisible:!1}:((r=Ui({},e.notes)).id||(r.id=pe.getUniqueID("e_note")),r.rowIdx||0===r.rowIdx||(r.rowIdx=t),r.colIdx||0===r.colIdx||(r.colIdx=n),pe.isUndefined(r.isVisible)&&(r.isVisible=!1)),e.notes=r,o&&i.notes.some(function(e){return e.id===r.id})||i.notes.push(r)}}function io(e,t){return ve(e,t=void 0===t?e.activeSheetIndex:t).name}function oo(n,r,e,t,i){var o=!!e,a=(e=e||[n.activeSheetIndex],io(n)),s={action:"moveSheet",eventArgs:{position:r=function(e,t,n){for(var r=t;n?0<=r:r<e.length;n?r--:r++)if("Hidden"!==e[r].state&&"VeryHidden"!==e[r].state){t=r;break}return t}(n.sheets,r,n.activeSheetIndex>r),sheetIndexes:e,cancel:!1}};t&&n.trigger("actionBegin",s),s.eventArgs.cancel||(n.notify(Dr,{prevIndex:n.activeSheetIndex,currentIndex:r}),e.forEach(function(e,t){n.sheets.splice(r+t,0,n.sheets.splice(e+(e<r?-1*t:0),1)[0])}),n.setProperties({activeSheetIndex:i?K(n,a):r>e[0]?r-(e.length-1):r},!0),n.notify(hr,{refresh:o}),t&&(delete s.eventArgs.cancel,n.trigger("actionComplete",s)))}function ao(t,e,n,r){var i={action:"duplicateSheet",eventArgs:{sheetIndex:e=pe.isUndefined(e)?t.activeSheetIndex:e,cancel:!1}};if(n&&t.trigger("actionBegin",i),!i.eventArgs.cancel){var o=ve(t,e),a=o.name,s=pe.extend({},o.properties||o,{},!0),l=(s.id=eo(t.sheets),s.name),d=(/^\(\d+\)$/.test("("+l.split(" (")[1])&&(l=l.split(" (")[0]),[]);t.sheets.forEach(function(e){d.push(e.name)});for(var h=2;;h++){var p=" ("+h+")";if(31<(l+p).length&&(l=l.slice(0,31-p.length)),-1===d.indexOf(l+p)){s.name=l+p;break}}t.notify(wr,{sheetIndex:e,newSheetIndex:e+1}),t.notify(Br,{isDuplicate:!0,curSheetIndex:e,newSheetIndex:e+1}),s.rows.forEach(function(e){e&&e.cells&&e.cells.forEach(function(e){e&&(e.image&&e.image.forEach(function(e){e.id=pe.getUniqueID(t.element.id+"_overlay_picture_")}),e=e.chart)&&e.forEach(function(e){var t=e.range.lastIndexOf("!"),n=e.range.substring(0,t),r=s.name;n.startsWith("'")&&n.endsWith("'")&&(n=n.slice(1,-1),r="'"+r+"'"),n===a&&(e.range=r+e.range.substring(t),e.id=pe.getUniqueID(e.id||"e_spreadsheet_chart"))})})}),t.createSheet(e+1,[s]),t.notify(me,{action:"addSheet",sheetName:"Sheet"+s.id,visibleName:s.name,sheetId:s.id}),r||t.setProperties({activeSheetIndex:e+1},!0),t.notify(hr,{refresh:!0,isDuplicate:!0}),n&&(delete i.eventArgs.cancel,t.trigger("actionComplete",i))}}so=function(e,t){return(so=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){f