@sheetxl/studio-vanilla 0.4.11 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{BlSFY6zLlebuejdV.cjs → B35OZ0mE8aINQPP9.cjs} +2 -2
- package/browser/cjs/{DiBy6-IxLscyMW2y.cjs → BPzEQNENF-gEBkg9.cjs} +2 -2
- package/browser/cjs/{C7EZCTczsC-gkRcq.cjs → BUokV6yuzE-_8MyK.cjs} +2 -2
- package/browser/cjs/{T4SHYo66xDT3l9JN.cjs → BeZHmOKfa37mFNAu.cjs} +2 -2
- package/browser/cjs/{BplA5pDzOJpfTZuA.cjs → BflJ_0gT9lQtDvY_.cjs} +2 -2
- package/browser/cjs/{DFspSkki779xN-Ey.cjs → BwN8vKi5o3-PbIMo.cjs} +2 -2
- package/browser/cjs/{D3iOk-Q2tRdUeTcn.cjs → C3OizZPVuxO2fjSG.cjs} +1 -1
- package/browser/cjs/{BshvMtUxTJHj3JQN.cjs → CBL6KkiWI2RPflEN.cjs} +2 -2
- package/browser/cjs/CN6-6xpZMpFqSS8M.cjs +7 -0
- package/browser/cjs/{vfUix5Di0Ro8tEID.cjs → CTrEV_UpxC0W6cZZ.cjs} +2 -2
- package/browser/cjs/{CFcjX5-nVsgzdZ4F.cjs → CU30GVjjFXl44vEU.cjs} +1 -1
- package/browser/cjs/{DgBn3aW39yjgm0X_.cjs → CZWBxvUXzfpn_zmc.cjs} +2 -2
- package/browser/cjs/{DrlS1oz9Nea8Pm3j.cjs → Ccs2ouvlLekaLGH0.cjs} +2 -2
- package/browser/cjs/{B0rdyyttE2Aibsag.cjs → Ce-8L4Viq3I_6j0i.cjs} +2 -2
- package/browser/cjs/{SzxJv7OUs5ojl8gx.cjs → CtNjLzIHB8WX63Bl.cjs} +2 -2
- package/browser/cjs/{Dx-jp_LJxWbAScyA.cjs → DAHpsyykuPBkoh-Z.cjs} +1 -1
- package/browser/cjs/{B2e7dDI-zKoqXpIW.cjs → DJbKKxeeTEHHA1gR.cjs} +20 -20
- package/browser/cjs/{CjZbhk41S1qO_74G.cjs → D_VQzwC1zzTJyKtG.cjs} +1 -1
- package/browser/cjs/{Db_Ew1r6yOMYylvA.cjs → GrsZZ_mEdsM5dEMA.cjs} +2 -2
- package/browser/cjs/{BPTHTRDvNOVkUJGa.cjs → JKEGlXjMwGnXk_Gv.cjs} +2 -2
- package/browser/cjs/{C5FXOMLhAu_KTjVe.cjs → L1iE_VcelYZIy0wI.cjs} +1 -1
- package/browser/cjs/{DFtyXc7YFh9dIp74.cjs → Q_VvA-yUQx3xFKiJ.cjs} +1 -1
- package/browser/cjs/{BAyEOOtO-9sHQQRW.cjs → fTGpiXzFm3K_u2Fm.cjs} +2 -2
- package/browser/cjs/{CuTW2Pt-L5n-hNxV.cjs → hwDUzorB6aCvH1eL.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{BuWtGFX0HiBezGjw.cjs → no5c2H18QD2qmOH6.cjs} +2 -2
- package/browser/esm/{BALnKy2Fp7fyk-lc.mjs → B4Mm5gczpI_k2zzN.mjs} +2 -2
- package/browser/esm/{BXUGsC1Mo3FP8vnW.mjs → B8ISUdOxsJMYWzNN.mjs} +2 -2
- package/browser/esm/{BGpv6Kq7eBlJy43T.mjs → BnJiF38TGudjoHzT.mjs} +1 -1
- package/browser/esm/Bts4nCgfCAUpTfxz.mjs +7 -0
- package/browser/esm/{DtmE60AvstK9u0Ta.mjs → C3cyAbIH8Qc8MIFN.mjs} +20 -20
- package/browser/esm/C4jlaVv8bELgiHyE.mjs +7 -0
- package/browser/esm/{CFFC0SNc24a0Dxnh.mjs → CYIhGb86r-kKOrP5.mjs} +2 -2
- package/browser/esm/{B905wKzTtod-jbsD.mjs → CcpskguvlvemArQn.mjs} +2 -2
- package/browser/esm/CeRfALx1iU5fqOUg.mjs +7 -0
- package/browser/esm/CfYWmP_Hots5f0f6.mjs +7 -0
- package/browser/esm/CkarbqNx_lhlBnw7.mjs +7 -0
- package/browser/esm/D2PlWNQjrTgf6GuR.mjs +7 -0
- package/browser/esm/{Cc_VWd0wF5-39LsI.mjs → D3KNxvnrwR6_fTJE.mjs} +1 -1
- package/browser/esm/{Bo_ZPRrOQrqOVHAF.mjs → DIJyH94oCzUnlcNZ.mjs} +2 -2
- package/browser/esm/{De6RPxc4p_jXLlT5.mjs → DVAG1NxFe3cMjLE1.mjs} +1 -1
- package/browser/esm/DVqga7g7j0FUiM6p.mjs +7 -0
- package/browser/esm/{PS0cqYnlMVEGOQpI.mjs → DcX8yGEBX6qi9RCe.mjs} +2 -2
- package/browser/esm/{BUSR_OK5Qi6hRPfw.mjs → DeXfOSxGE_Ez7DZq.mjs} +1 -1
- package/browser/esm/{Cq8D_M0jeHLcnRjg.mjs → DzgM_rkwyIHsCb6I.mjs} +1 -1
- package/browser/esm/{BDVJ7eOPpW5FnEAP.mjs → M4hZ25330e96seUM.mjs} +1 -1
- package/browser/esm/Qp2Toeh_EbJH_f_6.mjs +7 -0
- package/browser/esm/SAyRTPVprOHZ8Up8.mjs +7 -0
- package/browser/esm/_ft7JYO6QdDbIu3d.mjs +7 -0
- package/browser/esm/{BlGoi1_x9rUMpWMd.mjs → dpdy0BU4GGI5lZrX.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{tFhROdVSw9KLQfUN.mjs → oLCocGFRAwsVsOSE.mjs} +2 -2
- package/cdn/assets/7_O6nILzn1fSVvkO.js +13449 -0
- package/cdn/assets/B3kbBB6oxKBErwzn.js +27 -0
- package/cdn/assets/BB66NDz7S3ocEfRB.js +150 -0
- package/cdn/assets/BCK7yhx9JfzU2rF0.js +22 -0
- package/cdn/assets/BSAH88RG1oubICau.js +84 -0
- package/cdn/assets/BT5EcMEFBsphczwC.js +1469 -0
- package/cdn/assets/BcWoqhD_sX85c7Mh.js +1701 -0
- package/cdn/assets/BoOefjrM4kZ-YXxa.js +90 -0
- package/cdn/assets/BtweFYnoj_aEfydW.js +1371 -0
- package/cdn/assets/Bv0Xb6DdcQbPYJKo.js +24 -0
- package/cdn/assets/CC-S4NMYhLg3WgqO.js +3875 -0
- package/cdn/assets/CJhyHcQcrhbtC33r.js +50 -0
- package/cdn/assets/CUc6gRjjRGTFWSHD.js +50 -0
- package/cdn/assets/CfObTzh8pGdd8D23.js +2183 -0
- package/cdn/assets/CiY3HumGDc_5bMtR.js +58 -0
- package/cdn/assets/CpPLN0-hDsTIFHZV.js +46 -0
- package/cdn/assets/Cq94woVmlxhjWVRI.js +21 -0
- package/cdn/assets/CsjftXmSYQRHNKdq.js +41 -0
- package/cdn/assets/DBL4jY0AVc53RGNm.js +637 -0
- package/cdn/assets/DDW1WJ2IM_9ZUfKm.js +36 -0
- package/cdn/assets/DJQOS9qxVAlpgDMt.js +1704 -0
- package/cdn/assets/DWJE3K3jMKMTCi3o.js +393 -0
- package/cdn/assets/D_5RgqgwXsoqLJDR.js +241 -0
- package/cdn/assets/DfmaL8DmDaFAv8M_.js +6481 -0
- package/cdn/assets/DgLPO_EQ9DYoGgec.js +423 -0
- package/cdn/assets/DkS6quwH1okWaho6.js +46 -0
- package/cdn/assets/DxMu6URURFWj9aXM.js +2373 -0
- package/cdn/assets/Jhm2DAcrfAqiM-Y-.js +26490 -0
- package/cdn/assets/MRBi3juXAW0lA_mj.js +1358 -0
- package/cdn/assets/dk2teWHDODYNarJY.js +27 -0
- package/cdn/assets/phYz0vGgqIEQ2hco.js +12 -0
- package/cdn/assets/qA23x9VVBL9R4qxN.js +43 -0
- package/cdn/index.js +41 -37
- package/cdn/loader.js +1 -1
- package/package.json +3 -3
- package/browser/esm/B5kkStdEkTczERyM.mjs +0 -7
- package/browser/esm/BuURCm92KsyGHG9e.mjs +0 -7
- package/browser/esm/CGZ5MX7afzMxDkCe.mjs +0 -7
- package/browser/esm/CzmNwV9tfFYUp_gS.mjs +0 -7
- package/browser/esm/DlVZFM9ZR5jGyG0_.mjs +0 -7
- package/browser/esm/DqXxZP6yKF4U1YfY.mjs +0 -7
- package/browser/esm/Dz2OVgq3kxi1TkfX.mjs +0 -7
- package/browser/esm/QBGUD1XS5_pysBLL.mjs +0 -7
- package/browser/esm/uGDCdtqxjqRCo4Xn.mjs +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B2e7dDI-zKoqXpIW.cjs");function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach(function(r){t(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function o(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 c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,n=new Array(e),c=0;c<e;c++)n[c]=arguments[c];return t.apply(r,[].concat(o,n))}}}function l(e){return{}.toString.call(e).includes("Object")}function s(e){return"function"==typeof e}var f=a(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),d=function(e,t){return l(t)||f("changeType"),Object.keys(t).some(function(t){return r=e,n=t,!Object.prototype.hasOwnProperty.call(r,n);var r,n})&&f("changeField"),t};function p(e,t){return s(t)?t(e.current):t}function g(e,t){return e.current=u(u({},e.current),t),t}function h(e,t,r){return s(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null===(n=t[r])||void 0===n?void 0:n.call(t,e.current[r])}),r}var y,m={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},v=(y=function(e,t){throw new Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.length>=y.length?y.apply(this,n):function(){for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return e.apply(t,[].concat(n,o))}})(m);function b(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],b(e[r],t[r]))}),n(n({},e),t)}var E={type:"cancelation",msg:"operation is manually canceled"};function w(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(E):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var O,j=function(e){if(Array.isArray(e))return e}(O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(function(e){var t;e||f("initialIsRequired"),l(e)||f("initialType"),t=e,Object.keys(t).length||f("initialContent")})(e),function(e){s(e)||l(e)||f("handlerType"),l(e)&&Object.values(e).some(function(e){return!s(e)})&&f("handlersType")}(t);var r={current:e},n=a(h)(r,t),o=a(g)(r),c=a(d)(e),i=a(p)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return function(e){s(e)||f("selectorType")}(e),e(r.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(n,o,c,i)(e)}]}({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var t=[],r=!0,n=!1,o=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(t.push(c.value),2!==t.length);r=!0);}catch(e){n=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw o}}return t}}(O)||function(e){if(e){if("string"==typeof e)return o(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,2):void 0}}(O)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),x=j[0],M=j[1];function P(e){return document.body.appendChild(e)}function S(e){var t,r,n=x(function(e){return{config:e.config,reject:e.reject}}),o=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return o.onload=function(){return e()},o.onerror=n.reject,o}function R(){var e=x(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){k(t),e.resolve(t)},function(t){e.reject(t)})}function k(e){x().monaco||M({monaco:e})}var T=new Promise(function(e,t){return M({resolve:e,reject:t})}),I={config:function(e){var t=function(e){var t;return e||v("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||v("configType"),e.urls?(console.warn(m.deprecation),{paths:{vs:e.urls.monacoBase}}):e}(e),r=t.monaco,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,["monaco"]);M(function(e){return{config:b(e.config,n),monaco:r}})},init:function(){var e=x(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(M({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),w(T);if(window.monaco&&window.monaco.editor)return k(window.monaco),e.resolve(window.monaco),w(T);!function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(P,S)(R)}return w(T)},__getMonacoInstance:function(){return x(function(e){return e.monaco})}},C={display:"flex",position:"relative",textAlign:"initial"},z={width:"100%"},A={display:"none"},D={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},V=function({children:t}){return e.z.createElement("div",{style:D.container},t)},L=e.reactExports.memo(function({width:t,height:r,isEditorReady:n,loading:o,_ref:c,className:i,wrapperProps:u}){return e.z.createElement("section",{style:{...C,width:t,height:r},...u},!n&&e.z.createElement(V,null,o),e.z.createElement("div",{ref:c,style:{...z,...!n&&A},className:i}))}),q=function(t){e.reactExports.useEffect(t,[])},_=function(t,r,n=!0){let o=e.reactExports.useRef(!0);e.reactExports.useEffect(o.current||!n?()=>{o.current=!1}:t,r)};function N(){}function F(e,t,r,n){return function(e,t){return e.editor.getModel(U(e,t))}(e,n)||function(e,t,r,n){return e.editor.createModel(t,r,n?U(e,n):void 0)}(e,t,r,n)}function U(e,t){return e.Uri.parse(t)}var B=e.reactExports.memo(function({original:t,modified:r,language:n,originalLanguage:o,modifiedLanguage:c,originalModelPath:i,modifiedModelPath:u,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:s="light",loading:f="Loading...",options:d={},height:p="100%",width:g="100%",className:h,wrapperProps:y={},beforeMount:m=N,onMount:v=N}){let[b,E]=e.reactExports.useState(!1),[w,O]=e.reactExports.useState(!0),j=e.reactExports.useRef(null),x=e.reactExports.useRef(null),M=e.reactExports.useRef(null),P=e.reactExports.useRef(v),S=e.reactExports.useRef(m),R=e.reactExports.useRef(!1);q(()=>{let e=I.init();return e.then(e=>(x.current=e)&&O(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>j.current?function(){let e=j.current?.getModel();a||e?.original?.dispose(),l||e?.modified?.dispose(),j.current?.dispose()}():e.cancel()}),_(()=>{if(j.current&&x.current){let e=j.current.getOriginalEditor(),r=F(x.current,t||"",o||n||"text",i||"");r!==e.getModel()&&e.setModel(r)}},[i],b),_(()=>{if(j.current&&x.current){let e=j.current.getModifiedEditor(),t=F(x.current,r||"",c||n||"text",u||"");t!==e.getModel()&&e.setModel(t)}},[u],b),_(()=>{let e=j.current.getModifiedEditor();e.getOption(x.current.editor.EditorOption.readOnly)?e.setValue(r||""):r!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:r||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[r],b),_(()=>{j.current?.getModel()?.original.setValue(t||"")},[t],b),_(()=>{let{original:e,modified:t}=j.current.getModel();x.current.editor.setModelLanguage(e,o||n||"text"),x.current.editor.setModelLanguage(t,c||n||"text")},[n,o,c],b),_(()=>{x.current?.editor.setTheme(s)},[s],b),_(()=>{j.current?.updateOptions(d)},[d],b);let k=e.reactExports.useCallback(()=>{if(!x.current)return;S.current(x.current);let e=F(x.current,t||"",o||n||"text",i||""),a=F(x.current,r||"",c||n||"text",u||"");j.current?.setModel({original:e,modified:a})},[n,r,c,t,o,i,u]),T=e.reactExports.useCallback(()=>{!R.current&&M.current&&(j.current=x.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...d}),k(),x.current?.editor.setTheme(s),E(!0),R.current=!0)},[d,s,k]);return e.reactExports.useEffect(()=>{b&&P.current(j.current,x.current)},[b]),e.reactExports.useEffect(()=>{!w&&!b&&T()},[w,b,T]),e.z.createElement(L,{width:g,height:p,isEditorReady:b,loading:f,_ref:M,className:h,wrapperProps:y})}),Y=new Map,$=e.reactExports.memo(function({defaultValue:t,defaultLanguage:r,defaultPath:n,value:o,language:c,path:i,theme:u="light",line:a,loading:l="Loading...",options:s={},overrideServices:f={},saveViewState:d=!0,keepCurrentModel:p=!1,width:g="100%",height:h="100%",className:y,wrapperProps:m={},beforeMount:v=N,onMount:b=N,onChange:E,onValidate:w=N}){let[O,j]=e.reactExports.useState(!1),[x,M]=e.reactExports.useState(!0),P=e.reactExports.useRef(null),S=e.reactExports.useRef(null),R=e.reactExports.useRef(null),k=e.reactExports.useRef(b),T=e.reactExports.useRef(v),C=e.reactExports.useRef(),z=e.reactExports.useRef(o),A=function(t){let r=e.reactExports.useRef();return e.reactExports.useEffect(()=>{r.current=t},[t]),r.current}(i),D=e.reactExports.useRef(!1),V=e.reactExports.useRef(!1);q(()=>{let e=I.init();return e.then(e=>(P.current=e)&&M(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>S.current?(C.current?.dispose(),p?d&&Y.set(i,S.current.saveViewState()):S.current.getModel()?.dispose(),void S.current.dispose()):e.cancel()}),_(()=>{let e=F(P.current,t||o||"",r||c||"",i||n||"");e!==S.current?.getModel()&&(d&&Y.set(A,S.current?.saveViewState()),S.current?.setModel(e),d&&S.current?.restoreViewState(Y.get(i)))},[i],O),_(()=>{S.current?.updateOptions(s)},[s],O),_(()=>{!S.current||void 0===o||(S.current.getOption(P.current.editor.EditorOption.readOnly)?S.current.setValue(o):o!==S.current.getValue()&&(V.current=!0,S.current.executeEdits("",[{range:S.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),S.current.pushUndoStop(),V.current=!1))},[o],O),_(()=>{let e=S.current?.getModel();e&&c&&P.current?.editor.setModelLanguage(e,c)},[c],O),_(()=>{void 0!==a&&S.current?.revealLine(a)},[a],O),_(()=>{P.current?.editor.setTheme(u)},[u],O);let U=e.reactExports.useCallback(()=>{if(R.current&&P.current&&!D.current){T.current(P.current);let e=i||n,l=F(P.current,o||t||"",r||c||"",e||"");S.current=P.current?.editor.create(R.current,{model:l,automaticLayout:!0,...s},f),d&&S.current.restoreViewState(Y.get(e)),P.current.editor.setTheme(u),void 0!==a&&S.current.revealLine(a),j(!0),D.current=!0}},[t,r,n,o,c,i,s,f,d,u,a]);return e.reactExports.useEffect(()=>{O&&k.current(S.current,P.current)},[O]),e.reactExports.useEffect(()=>{!x&&!O&&U()},[x,O,U]),z.current=o,e.reactExports.useEffect(()=>{O&&E&&(C.current?.dispose(),C.current=S.current?.onDidChangeModelContent(e=>{V.current||E(S.current.getValue(),e)}))},[O,E]),e.reactExports.useEffect(()=>{if(O){let e=P.current.editor.onDidChangeMarkers(e=>{let t=S.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=P.current.editor.getModelMarkers({resource:t});w?.(e)}});return()=>{e?.dispose()}}return()=>{}},[O,w]),e.z.createElement(L,{width:g,height:h,isEditorReady:O,loading:l,_ref:R,className:y,wrapperProps:m})}),G=$;exports.DiffEditor=B,exports.Editor=$,exports.default=G,exports.loader=I,exports.useMonaco=function(){let[t,r]=e.reactExports.useState(I.__getMonacoInstance());return q(()=>{let e;return t||(e=I.init(),e.then(e=>{r(e)})),()=>e?.cancel()}),t};
|
|
7
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DJbKKxeeTEHHA1gR.cjs");function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach(function(r){t(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function o(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 c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,n=new Array(e),c=0;c<e;c++)n[c]=arguments[c];return t.apply(r,[].concat(o,n))}}}function l(e){return{}.toString.call(e).includes("Object")}function s(e){return"function"==typeof e}var f=a(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),d=function(e,t){return l(t)||f("changeType"),Object.keys(t).some(function(t){return r=e,n=t,!Object.prototype.hasOwnProperty.call(r,n);var r,n})&&f("changeField"),t};function p(e,t){return s(t)?t(e.current):t}function g(e,t){return e.current=u(u({},e.current),t),t}function h(e,t,r){return s(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null===(n=t[r])||void 0===n?void 0:n.call(t,e.current[r])}),r}var y,m={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},v=(y=function(e,t){throw new Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.length>=y.length?y.apply(this,n):function(){for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return e.apply(t,[].concat(n,o))}})(m);function b(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],b(e[r],t[r]))}),n(n({},e),t)}var E={type:"cancelation",msg:"operation is manually canceled"};function w(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(E):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var O,j=function(e){if(Array.isArray(e))return e}(O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(function(e){var t;e||f("initialIsRequired"),l(e)||f("initialType"),t=e,Object.keys(t).length||f("initialContent")})(e),function(e){s(e)||l(e)||f("handlerType"),l(e)&&Object.values(e).some(function(e){return!s(e)})&&f("handlersType")}(t);var r={current:e},n=a(h)(r,t),o=a(g)(r),c=a(d)(e),i=a(p)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return function(e){s(e)||f("selectorType")}(e),e(r.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(n,o,c,i)(e)}]}({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var t=[],r=!0,n=!1,o=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(t.push(c.value),2!==t.length);r=!0);}catch(e){n=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw o}}return t}}(O)||function(e){if(e){if("string"==typeof e)return o(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,2):void 0}}(O)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),x=j[0],M=j[1];function P(e){return document.body.appendChild(e)}function S(e){var t,r,n=x(function(e){return{config:e.config,reject:e.reject}}),o=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return o.onload=function(){return e()},o.onerror=n.reject,o}function R(){var e=x(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){k(t),e.resolve(t)},function(t){e.reject(t)})}function k(e){x().monaco||M({monaco:e})}var T=new Promise(function(e,t){return M({resolve:e,reject:t})}),I={config:function(e){var t=function(e){var t;return e||v("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||v("configType"),e.urls?(console.warn(m.deprecation),{paths:{vs:e.urls.monacoBase}}):e}(e),r=t.monaco,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,["monaco"]);M(function(e){return{config:b(e.config,n),monaco:r}})},init:function(){var e=x(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(M({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),w(T);if(window.monaco&&window.monaco.editor)return k(window.monaco),e.resolve(window.monaco),w(T);!function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(P,S)(R)}return w(T)},__getMonacoInstance:function(){return x(function(e){return e.monaco})}},C={display:"flex",position:"relative",textAlign:"initial"},z={width:"100%"},A={display:"none"},D={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},V=function({children:t}){return e.z.createElement("div",{style:D.container},t)},L=e.reactExports.memo(function({width:t,height:r,isEditorReady:n,loading:o,_ref:c,className:i,wrapperProps:u}){return e.z.createElement("section",{style:{...C,width:t,height:r},...u},!n&&e.z.createElement(V,null,o),e.z.createElement("div",{ref:c,style:{...z,...!n&&A},className:i}))}),q=function(t){e.reactExports.useEffect(t,[])},_=function(t,r,n=!0){let o=e.reactExports.useRef(!0);e.reactExports.useEffect(o.current||!n?()=>{o.current=!1}:t,r)};function N(){}function F(e,t,r,n){return function(e,t){return e.editor.getModel(U(e,t))}(e,n)||function(e,t,r,n){return e.editor.createModel(t,r,n?U(e,n):void 0)}(e,t,r,n)}function U(e,t){return e.Uri.parse(t)}var B=e.reactExports.memo(function({original:t,modified:r,language:n,originalLanguage:o,modifiedLanguage:c,originalModelPath:i,modifiedModelPath:u,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:s="light",loading:f="Loading...",options:d={},height:p="100%",width:g="100%",className:h,wrapperProps:y={},beforeMount:m=N,onMount:v=N}){let[b,E]=e.reactExports.useState(!1),[w,O]=e.reactExports.useState(!0),j=e.reactExports.useRef(null),x=e.reactExports.useRef(null),M=e.reactExports.useRef(null),P=e.reactExports.useRef(v),S=e.reactExports.useRef(m),R=e.reactExports.useRef(!1);q(()=>{let e=I.init();return e.then(e=>(x.current=e)&&O(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>j.current?function(){let e=j.current?.getModel();a||e?.original?.dispose(),l||e?.modified?.dispose(),j.current?.dispose()}():e.cancel()}),_(()=>{if(j.current&&x.current){let e=j.current.getOriginalEditor(),r=F(x.current,t||"",o||n||"text",i||"");r!==e.getModel()&&e.setModel(r)}},[i],b),_(()=>{if(j.current&&x.current){let e=j.current.getModifiedEditor(),t=F(x.current,r||"",c||n||"text",u||"");t!==e.getModel()&&e.setModel(t)}},[u],b),_(()=>{let e=j.current.getModifiedEditor();e.getOption(x.current.editor.EditorOption.readOnly)?e.setValue(r||""):r!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:r||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[r],b),_(()=>{j.current?.getModel()?.original.setValue(t||"")},[t],b),_(()=>{let{original:e,modified:t}=j.current.getModel();x.current.editor.setModelLanguage(e,o||n||"text"),x.current.editor.setModelLanguage(t,c||n||"text")},[n,o,c],b),_(()=>{x.current?.editor.setTheme(s)},[s],b),_(()=>{j.current?.updateOptions(d)},[d],b);let k=e.reactExports.useCallback(()=>{if(!x.current)return;S.current(x.current);let e=F(x.current,t||"",o||n||"text",i||""),a=F(x.current,r||"",c||n||"text",u||"");j.current?.setModel({original:e,modified:a})},[n,r,c,t,o,i,u]),T=e.reactExports.useCallback(()=>{!R.current&&M.current&&(j.current=x.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...d}),k(),x.current?.editor.setTheme(s),E(!0),R.current=!0)},[d,s,k]);return e.reactExports.useEffect(()=>{b&&P.current(j.current,x.current)},[b]),e.reactExports.useEffect(()=>{!w&&!b&&T()},[w,b,T]),e.z.createElement(L,{width:g,height:p,isEditorReady:b,loading:f,_ref:M,className:h,wrapperProps:y})}),Y=new Map,$=e.reactExports.memo(function({defaultValue:t,defaultLanguage:r,defaultPath:n,value:o,language:c,path:i,theme:u="light",line:a,loading:l="Loading...",options:s={},overrideServices:f={},saveViewState:d=!0,keepCurrentModel:p=!1,width:g="100%",height:h="100%",className:y,wrapperProps:m={},beforeMount:v=N,onMount:b=N,onChange:E,onValidate:w=N}){let[O,j]=e.reactExports.useState(!1),[x,M]=e.reactExports.useState(!0),P=e.reactExports.useRef(null),S=e.reactExports.useRef(null),R=e.reactExports.useRef(null),k=e.reactExports.useRef(b),T=e.reactExports.useRef(v),C=e.reactExports.useRef(),z=e.reactExports.useRef(o),A=function(t){let r=e.reactExports.useRef();return e.reactExports.useEffect(()=>{r.current=t},[t]),r.current}(i),D=e.reactExports.useRef(!1),V=e.reactExports.useRef(!1);q(()=>{let e=I.init();return e.then(e=>(P.current=e)&&M(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>S.current?(C.current?.dispose(),p?d&&Y.set(i,S.current.saveViewState()):S.current.getModel()?.dispose(),void S.current.dispose()):e.cancel()}),_(()=>{let e=F(P.current,t||o||"",r||c||"",i||n||"");e!==S.current?.getModel()&&(d&&Y.set(A,S.current?.saveViewState()),S.current?.setModel(e),d&&S.current?.restoreViewState(Y.get(i)))},[i],O),_(()=>{S.current?.updateOptions(s)},[s],O),_(()=>{!S.current||void 0===o||(S.current.getOption(P.current.editor.EditorOption.readOnly)?S.current.setValue(o):o!==S.current.getValue()&&(V.current=!0,S.current.executeEdits("",[{range:S.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),S.current.pushUndoStop(),V.current=!1))},[o],O),_(()=>{let e=S.current?.getModel();e&&c&&P.current?.editor.setModelLanguage(e,c)},[c],O),_(()=>{void 0!==a&&S.current?.revealLine(a)},[a],O),_(()=>{P.current?.editor.setTheme(u)},[u],O);let U=e.reactExports.useCallback(()=>{if(R.current&&P.current&&!D.current){T.current(P.current);let e=i||n,l=F(P.current,o||t||"",r||c||"",e||"");S.current=P.current?.editor.create(R.current,{model:l,automaticLayout:!0,...s},f),d&&S.current.restoreViewState(Y.get(e)),P.current.editor.setTheme(u),void 0!==a&&S.current.revealLine(a),j(!0),D.current=!0}},[t,r,n,o,c,i,s,f,d,u,a]);return e.reactExports.useEffect(()=>{O&&k.current(S.current,P.current)},[O]),e.reactExports.useEffect(()=>{!x&&!O&&U()},[x,O,U]),z.current=o,e.reactExports.useEffect(()=>{O&&E&&(C.current?.dispose(),C.current=S.current?.onDidChangeModelContent(e=>{V.current||E(S.current.getValue(),e)}))},[O,E]),e.reactExports.useEffect(()=>{if(O){let e=P.current.editor.onDidChangeMarkers(e=>{let t=S.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=P.current.editor.getModelMarkers({resource:t});w?.(e)}});return()=>{e?.dispose()}}return()=>{}},[O,w]),e.z.createElement(L,{width:g,height:h,isEditorReady:O,loading:l,_ref:R,className:y,wrapperProps:m})}),G=$;exports.DiffEditor=B,exports.Editor=$,exports.default=G,exports.loader=I,exports.useMonaco=function(){let[t,r]=e.reactExports.useState(I.__getMonacoInstance());return q(()=>{let e;return t||(e=I.init(),e.then(e=>{r(e)})),()=>e?.cancel()}),t};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@sheetxl/sdk"),e=require("./B2e7dDI-zKoqXpIW.cjs"),s=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",i=new RegExp(`^[${s}][-${s}.0-9·̀-ͯ‿-⁀]*$`,"u");function o(t){return t>=65&&t<=90||t>=97&&t<=122||58===t||95===t||8204===t||8205===t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}const r="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",n=new RegExp(`^[${r}][-${r}.0-9·̀-ͯ‿-⁀]*$`,"u");function a(t){return t>=65&&t<=90||95===t||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}const l=function(t){return 32===t||10===t||13===t||9===t},c=function(t){return t>=32&&t<=55295||10===t||13===t||9===t||t>=57344&&t<=65533||t>=65536&&t<=1114111},h=o,u=function(t){return o(t)||t>=48&&t<=57||45===t||46===t||183===t||t>=768&&t<=879||t>=8255&&t<=8256},d=[32,10,13,9],p=i,g=function(t){return t>=1&&t<=55295||t>=57344&&t<=65533||t>=65536&&t<=1114111},f=a,m=function(t){return a(t)||45===t||46===t||t>=48&&t<=57||183===t||t>=768&&t<=879||t>=8255&&t<=8256},T=n,y="http://www.w3.org/XML/1998/namespace",b="http://www.w3.org/2000/xmlns/",x={__proto__:null,xml:y,xmlns:b},w={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},v=-1,S=-2,C=13,k=33,A=10,E=60,D=61,P=62,I=63,O=93,V=t=>34===t||39===t,N=[34,39],L=[...N,91,P],R=[...N,E,O],$=[D,I,...d],F=[...d,P,38,E];function M(t,e,s){switch(e){case"xml":s!==y&&t.fail(`xml prefix must be bound to ${y}.`);break;case"xmlns":s!==b&&t.fail(`xmlns prefix must be bound to ${b}.`)}switch(s){case b:t.fail(""===e?`the default namespace may not be set to ${s}.`:`may not assign a prefix (even "xmlns") to the URI ${b}.`);break;case y:switch(e){case"xml":break;case"":t.fail(`the default namespace may not be set to ${s}.`);break;default:t.fail("may not assign the xml namespace to another prefix.")}}}const j=t=>T.test(t),H=t=>p.test(t),X={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class B{constructor(t){this.i=0,this.prevI=0,this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;const e=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=!1!==this.opt.position,this.fileName=this.opt.fileName,e){this.nameStartCheck=f,this.nameCheck=m,this.isName=j,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns={__proto__:null,...x};const t=this.opt.additionalNamespaces;null!=t&&(function(t,e){for(const s of Object.keys(e))M(t,s,e[s])}(this,t),Object.assign(this.ns,t))}else this.nameStartCheck=h,this.nameCheck=u,this.isName=H,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];const{fragmentOpt:t}=this;this.state=t?C:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:e}=this.opt;if(void 0===e){if(!0===this.opt.forceXMLVersion)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");e="1.0"}this.setXMLVersion(e),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(w),this.readyHandler?.()}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,e){this[X[t]]=e}off(t){this[X[t]]=void 0}makeError(t){let e=this.fileName??"";return this.trackPosition&&(e.length>0&&(e+=":"),e+=`${this.line}:${this.column}`),e.length>0&&(e+=": "),new Error(e+t)}fail(t){const e=this.makeError(t),s=this.errorHandler;if(void 0===s)throw e;return s(e),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let e=!1;null===t?(e=!0,t=""):"object"==typeof t&&(t=t.toString()),void 0!==this.carriedFromPrevious&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let s=t.length;const i=t.charCodeAt(s-1);!e&&(13===i||i>=55296&&i<=56319)&&(this.carriedFromPrevious=t[s-1],s--,t=t.slice(0,s));const{stateTable:o}=this;for(this.chunk=t,this.i=0;this.i<s;)o[this.state].call(this);return this.chunkPosition+=s,e?this.end():this}close(){return this.write(null)}getCode10(){const t=this.chunk,e=this.i;if(this.prevI=e,this.i++,e>=t.length)return v;const s=t.charCodeAt(e);if(this.column++,s<55296){if(s>=32||9===s)return s;switch(s){case A:return this.line++,this.column=0,this.positionAtNewLine=this.position,A;case 13:return t.charCodeAt(e+1)===A&&(this.i=e+2),this.line++,this.column=0,this.positionAtNewLine=this.position,S;default:return this.fail("disallowed character."),s}}if(s>56319)return s>=57344&&s<=65533||this.fail("disallowed character."),s;const i=65536+1024*(s-55296)+(t.charCodeAt(e+1)-56320);return this.i=e+2,i>1114111&&this.fail("disallowed character."),i}getCode11(){const{chunk:t,i:e}=this;if(this.prevI=e,this.i=e+1,e>=t.length)return v;const s=t.charCodeAt(e);if(this.column++,s<55296){if(s>31&&s<127||s>159&&8232!==s||9===s)return s;switch(s){case A:return this.line++,this.column=0,this.positionAtNewLine=this.position,A;case 13:{const s=t.charCodeAt(e+1);s!==A&&133!==s||(this.i=e+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,S;default:return this.fail("disallowed character."),s}}if(s>56319)return s>=57344&&s<=65533||this.fail("disallowed character."),s;const i=65536+1024*(s-55296)+(t.charCodeAt(e+1)-56320);return this.i=e+2,i>1114111&&this.fail("disallowed character."),i}getCodeNorm(){const t=this.getCode();return t===S?A:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:e}=this;const{chunk:s}=this;for(;;){const i=this.getCode(),o=i===S,r=o?A:i;if(r===v||t.includes(r))return this.text+=s.slice(e,this.prevI),r;o&&(this.text+=`${s.slice(e,this.prevI)}\n`,e=this.i)}}captureToChar(t){let{i:e}=this;const{chunk:s}=this;for(;;){let i=this.getCode();switch(i){case S:this.text+=`${s.slice(e,this.prevI)}\n`,e=this.i,i=A;break;case v:return this.text+=s.slice(e),!1}if(i===t)return this.text+=s.slice(e,this.prevI),!0}}captureNameChars(){const{chunk:t,i:e}=this;for(;;){const s=this.getCode();if(s===v)return this.name+=t.slice(e),v;if(!u(s))return this.name+=t.slice(e,this.prevI),s===S?A:s}}skipSpaces(){for(;;){const t=this.getCodeNorm();if(t===v||!l(t))return t}}setXMLVersion(t){this.currentXMLVersion=t,"1.0"===t?(this.isChar=c,this.getCode=this.getCode10):(this.isChar=g,this.getCode=this.getCode11)}sBegin(){65279===this.chunk.charCodeAt(0)&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){const t=this.i,e=this.skipSpaces();switch(this.prevI!==t&&(this.xmlDeclPossible=!1),e){case E:if(this.state=15,0!==this.text.length)throw new Error("no-empty text at start");break;case v:break;default:this.unget(),this.state=C,this.xmlDeclPossible=!1}}sDoctype(){const t=this.captureTo(L);switch(t){case P:this.doctypeHandler?.(this.text),this.text="",this.state=C,this.doctype=!0;break;case v:break;default:this.text+=String.fromCodePoint(t),91===t?this.state=4:V(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.q=null,this.state=2)}sDTD(){const t=this.captureTo(R);t!==v&&(this.text+=String.fromCodePoint(t),t===O?this.state=2:t===E?this.state=6:V(t)&&(this.state=5,this.q=t))}sDTDQuoted(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.state=4,this.q=null)}sDTDOpenWaka(){const t=this.getCodeNorm();switch(this.text+=String.fromCodePoint(t),t){case 33:this.state=7,this.openWakaBang="";break;case I:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){const t=String.fromCodePoint(this.getCodeNorm()),e=this.openWakaBang+=t;this.text+=t,"-"!==e&&(this.state="--"===e?8:4,this.openWakaBang="")}sDTDComment(){this.captureToChar(45)&&(this.text+="-",this.state=9)}sDTDCommentEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),this.state=45===t?10:8}sDTDCommentEnded(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===P?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(I)&&(this.text+="?",this.state=12)}sDTDPIEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===P&&(this.state=4)}sText(){0!==this.tags.length?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:t}=this;const{chunk:e}=this;t:for(;;)switch(this.getCode()){case S:this.entity+=`${e.slice(t,this.prevI)}\n`,t=this.i;break;case 59:{const{entityReturnState:s}=this,i=this.entity+e.slice(t,this.prevI);let o;this.state=s,""===i?(this.fail("empty entity name."),o="&;"):(o=this.parseEntity(i),this.entity=""),s===C&&void 0===this.textHandler||(this.text+=o);break t}case v:this.entity+=e.slice(t);break t}}sOpenWaka(){const t=this.getCode();if(h(t))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(t){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang="",this.xmlDeclPossible=!1;break;case I:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=C,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang="";break;case"--":this.state=17,this.openWakaBang="";break;case"DOCTYPE":this.state=2,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){const t=this.getCodeNorm();45===t?(this.state=19,this.commentHandler?.(this.text),this.text=""):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){const t=this.getCodeNorm();t!==P?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(t)}`,this.state=17):this.state=C}sCData(){this.captureToChar(O)&&(this.state=21)}sCDataEnding(){const t=this.getCodeNorm();t===O?this.state=22:(this.text+=`]${String.fromCodePoint(t)}`,this.state=20)}sCDataEnding2(){const t=this.getCodeNorm();switch(t){case P:this.cdataHandler?.(this.text),this.text="",this.state=C;break;case O:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){const t=this.getCodeNorm();this.nameStartCheck(t)?(this.piTarget+=String.fromCodePoint(t),this.state=24):t===I||l(t)?(this.fail("processing instruction without a target."),this.state=t===I?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(t),this.state=24)}sPIRest(){const{chunk:t,i:e}=this;for(;;){const s=this.getCodeNorm();if(s===v)return void(this.piTarget+=t.slice(e));if(!this.nameCheck(s)){this.piTarget+=t.slice(e,this.prevI);const i=s===I;i||l(s)?"xml"===this.piTarget?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=i?k:27):this.state=i?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(s));break}}}sPIBody(){if(0===this.text.length){const t=this.getCodeNorm();t===I?this.state=26:l(t)||(this.text=String.fromCodePoint(t))}else this.captureToChar(I)&&(this.state=26)}sPIEnding(){const t=this.getCodeNorm();if(t===P){const{piTarget:t}=this;"xml"===t.toLowerCase()&&this.fail("the XML declaration must appear at the start of the document."),this.piHandler?.({target:t,body:this.text}),this.piTarget=this.text="",this.state=C}else t===I?this.text+="?":(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const t=this.skipSpaces();t!==I?t!==v&&(this.state=28,this.name=String.fromCodePoint(t)):this.state=k}sXMLDeclName(){const t=this.captureTo($);if(t===I)return this.state=k,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(l(t)||t===D){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=t===D?30:29}}sXMLDeclEq(){const t=this.getCodeNorm();if(t===I)return this.state=k,void this.fail("XML declaration is incomplete.");l(t)||(t!==D&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){const t=this.getCodeNorm();if(t===I)return this.state=k,void this.fail("XML declaration is incomplete.");l(t)||(V(t)?this.q=t:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){const t=this.captureTo([this.q,I]);if(t===I)return this.state=k,this.text="",void this.fail("XML declaration is incomplete.");if(t===v)return;const e=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const t=e;this.xmlDecl.version=t,/^1\.[0-9]+$/.test(t)?this.opt.forceXMLVersion||this.setXMLVersion(t):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(e)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=e;break;case"standalone":"yes"!==e&&"no"!==e&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=e}this.name="",this.state=32}sXMLDeclSeparator(){const t=this.getCodeNorm();t!==I?(l(t)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=k}sXMLDeclEnding(){this.getCodeNorm()===P?("xml"!==this.piTarget?this.fail("processing instructions are not allowed before root."):"version"!==this.name&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),this.xmldeclHandler?.(this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=C):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){const t=this.captureNameChars();if(t===v)return;const e=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=e.ns=Object.create(null)),this.openTagStartHandler?.(e),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),t){case P:this.openTag();break;case 47:this.state=35;break;default:l(t)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){this.getCode()===P?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){const t=this.skipSpaces();t!==v&&(h(t)?(this.unget(),this.state=37):t===P?this.openTag():47===t?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){const t=this.captureNameChars();t===D?this.state=39:l(t)?this.state=38:t===P?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):t!==v&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const t=this.skipSpaces();switch(t){case v:return;case D:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",t===P?this.openTag():h(t)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){const t=this.getCodeNorm();V(t)?(this.q=t,this.state=40):l(t)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){const{q:t,chunk:e}=this;let{i:s}=this;for(;;)switch(this.getCode()){case t:return this.pushAttrib(this.name,this.text+e.slice(s,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=e.slice(s,this.prevI),this.state=14,void(this.entityReturnState=40);case A:case S:case 9:this.text+=`${e.slice(s,this.prevI)} `,s=this.i;break;case E:return this.text+=e.slice(s,this.prevI),void this.fail("disallowed character.");case v:return void(this.text+=e.slice(s))}}sAttribValueClosed(){const t=this.getCodeNorm();l(t)?this.state=36:t===P?this.openTag():47===t?this.state=35:h(t)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const t=this.captureTo(F);switch(t){case 38:this.state=14,this.entityReturnState=42;break;case E:this.fail("disallowed character.");break;case v:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",t===P?this.openTag():this.state=36}}sCloseTag(){const t=this.captureNameChars();t===P?this.closeTag():l(t)?this.state=44:t!==v&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case P:this.closeTag();break;case v:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:t,forbiddenState:e}=this;const{chunk:s,textHandler:i}=this;t:for(;;)switch(this.getCode()){case E:if(this.state=15,void 0!==i){const{text:e}=this,o=s.slice(t,this.prevI);0!==e.length?(i(e+o),this.text=""):0!==o.length&&i(o)}e=0;break t;case 38:this.state=14,this.entityReturnState=C,void 0!==i&&(this.text+=s.slice(t,this.prevI)),e=0;break t;case O:switch(e){case 0:e=1;break;case 1:e=2;break;case 2:break;default:throw new Error("impossible state")}break;case P:2===e&&this.fail('the string "]]>" is disallowed in char data.'),e=0;break;case S:void 0!==i&&(this.text+=`${s.slice(t,this.prevI)}\n`),t=this.i,e=0;break;case v:void 0!==i&&(this.text+=s.slice(t));break t;default:e=0}this.forbiddenState=e}handleTextOutsideRoot(){let{i:t}=this;const{chunk:e,textHandler:s}=this;let i=!1;t:for(;;){const o=this.getCode();switch(o){case E:if(this.state=15,void 0!==s){const{text:i}=this,o=e.slice(t,this.prevI);0!==i.length?(s(i+o),this.text=""):0!==o.length&&s(o)}break t;case 38:this.state=14,this.entityReturnState=C,void 0!==s&&(this.text+=e.slice(t,this.prevI)),i=!0;break t;case S:void 0!==s&&(this.text+=`${e.slice(t,this.prevI)}\n`),t=this.i;break;case v:void 0!==s&&(this.text+=e.slice(t));break t;default:l(o)||(i=!0)}}i&&(this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(t,e){const{prefix:s,local:i}=this.qname(t),o={name:t,prefix:s,local:i,value:e};if(this.attribList.push(o),this.attributeHandler?.(o),"xmlns"===s){const t=e.trim();"1.0"===this.currentXMLVersion&&""===t&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[i]=t,M(this,i,t)}else if("xmlns"===t){const t=e.trim();this.topNS[""]=t,M(this,"",t)}}pushAttribPlain(t,e){const s={name:t,value:e};this.attribList.push(s),this.attributeHandler?.(s)}end(){this.sawRoot||this.fail("document must contain a root element.");const{tags:t}=this;for(;t.length>0;){const e=t.pop();this.fail(`unclosed tag: ${e.name}`)}0!==this.state&&this.state!==C&&this.fail("unexpected end.");const{text:e}=this;return 0!==e.length&&(this.textHandler?.(e),this.text=""),this._closed=!0,this.endHandler?.(),this._init(),this}resolve(t){let e=this.topNS[t];if(void 0!==e)return e;const{tags:s}=this;for(let i=s.length-1;i>=0;i--)if(e=s[i].ns[t],void 0!==e)return e;return e=this.ns[t],void 0!==e?e:this.opt.resolvePrefix?.(t)}qname(t){const e=t.indexOf(":");if(-1===e)return{prefix:"",local:t};const s=t.slice(e+1),i=t.slice(0,e);return(""===i||""===s||s.includes(":"))&&this.fail(`malformed name: ${t}.`),{prefix:i,local:s}}processAttribsNS(){const{attribList:t}=this,e=this.tag;{const{prefix:t,local:s}=this.qname(e.name);e.prefix=t,e.local=s;const i=e.uri=this.resolve(t)??"";""!==t&&("xmlns"===t&&this.fail('tags may not have "xmlns" as prefix.'),""===i&&(this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`),e.uri=t))}if(0===t.length)return;const{attributes:s}=e,i=new Set;for(const e of t){const{name:t,prefix:o,local:r}=e;let n,a;""===o?(n="xmlns"===t?b:"",a=t):(n=this.resolve(o),void 0===n&&(this.fail(`unbound namespace prefix: ${JSON.stringify(o)}.`),n=o),a=`{${n}}${r}`),i.has(a)&&this.fail(`duplicate attribute: ${a}.`),i.add(a),e.uri=n,s[t]=e}this.attribList=[]}processAttribsPlain(){const{attribList:t}=this,e=this.tag.attributes;for(const{name:s,value:i}of t)void 0!==e[s]&&this.fail(`duplicate attribute: ${s}.`),e[s]=i;this.attribList=[]}openTag(){this.processAttribs();const{tags:t}=this,e=this.tag;e.isSelfClosing=!1,this.openTagHandler?.(e),t.push(e),this.state=C,this.name=""}openSelfClosingTag(){this.processAttribs();const{tags:t}=this,e=this.tag;e.isSelfClosing=!0,this.openTagHandler?.(e),this.closeTagHandler?.(e),null===(this.tag=t[t.length-1]??null)&&(this.closedRoot=!0),this.state=C,this.name=""}closeTag(){const{tags:t,name:e}=this;if(this.state=C,this.name="",""===e)return this.fail("weird empty close tag."),void(this.text+="</>");const s=this.closeTagHandler;let i=t.length;for(;i-- >0;){const i=this.tag=t.pop();if(this.topNS=i.ns,s?.(i),i.name===e)break;this.fail("unexpected close tag.")}0===i?this.closedRoot=!0:i<0&&(this.fail(`unmatched closing tag: ${e}.`),this.text+=`</${e}>`)}parseEntity(t){if("#"!==t[0]){const e=this.ENTITIES[t];return void 0!==e?e:(this.fail(this.isName(t)?"undefined entity.":"disallowed character in entity name."),`&${t};`)}let e=NaN;return"x"===t[1]&&/^#x[0-9a-f]+$/i.test(t)?e=parseInt(t.slice(2),16):/^#[0-9]+$/.test(t)&&(e=parseInt(t.slice(1),10)),this.isChar(e)?String.fromCodePoint(e):(this.fail("malformed character entity."),`&${t};`)}}var W,q;(q=W||(W={})).Events={XmlDecl:"xmldecl",Text:"text",ProcessingInstruction:"processinginstruction",Doctype:"doctype",Comment:"comment",OpenTagStart:"opentagstart",Attribute:"attribute",OpenTag:"opentag",CloseTag:"closetag",CDdata:"cdata",Error:"error",End:"end",Ready:"ready"},q.parseStream=async(t,e,s)=>{const i=new B({position:!1,...s});let o;if(e.onOpenTagStart&&i.on(q.Events.OpenTagStart,e.onOpenTagStart),e.onOpenTag&&i.on(q.Events.OpenTag,e.onOpenTag),e.onCloseTag&&i.on(q.Events.CloseTag,e.onCloseTag),e.onAttribute&&i.on(q.Events.Attribute,e.onAttribute),e.onText&&i.on(q.Events.Text,e.onText),e.onError&&i.on(q.Events.Error,e.onError),e.onEnd){e.onEnd;const t=()=>{o=e.onEnd()};i.on(q.Events.End,t)}for(;;){const{value:e,done:s}=await t.read();if(s)break;i.write(e)}return i.close(),o};const _=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,U=t=>{const e=parseInt(t);return isNaN(e)?null:e},z=t=>{const e=parseFloat(t);return isNaN(e)?null:e},G=null;class Z{constructor(){this._registeredVisitors=new Map}registerVisitor(t){this._registeredVisitors.set(t.from,t)}createEventHandler(t,e,s){const i=this._registeredVisitors,o=[];let r=null,n=null,a=null,l=null;const c=[],h={key:null,source:t};let u=null,d=!1;const p=(t,e)=>{let s=a.attributes[t];if(e)if(Array.isArray(e))for(let t=0;t<e.length;t++){if(null==s)return;if(s=e[t](s),null==s)return}else{if(null==s)return;if(s=e(s),null==s)return}return s},g={getSource:()=>u.source,setSource:t=>{u.source=t},setKey:t=>{u.key=t},getFrom:()=>a,getAttribute:(t,e)=>p(t,e)??null,hasAttribute:t=>null!==g.getAttribute(t),getParent:()=>c[c.length-2].source,getPath:()=>{const t=[];for(let e=0;e<o.length;e++)t.push(o[e].local);return t.join("\\")},parseAttribute:p,copyToObject:(t,e,s,i)=>{const o=p(i??e,s);void 0!==o&&(t[e]=o)},copyTo:(t,e,s)=>{const i=p(s??t,e);void 0!==i&&(u.source[t]=i)},warn:t=>{s?s?.(t):console.warn(t)}};return{onOpenTag:t=>{let e=t.name;const s=e.indexOf(":");-1!==s&&(e=e.slice(s+1));const p=i.get(e);if(r={local:e,visitor:p,tag:t,destination:null},d)return o.push(r),n=e,void(a=t);l=r?.visitor??null,p&&(u=0===o.length?h:null!==l?.to?{key:null,source:{}}:null,r.destination=u,u&&c.push(u)),o.push(r),n=e,a=t,d=null===l?.to,l?.openTag?.(g)},onCloseTag:t=>{let e=t.name;const i=e.indexOf(":");if(-1!==i&&(e=e.slice(i+1)),e!==n)throw new Error(`mismatch open/close tag: '${e}'/'${n}'`);d||l?.closeTag?.(g);const p=o.pop()??null;r=o[o.length-1]??null;const f=p?.destination;if(f){c.pop(),u=c[c.length-1]??h;const t=p.visitor;t&&t.to&&void 0!==f.source&&(Array.isArray(t.to)?u.source.push?u.source.push(f.source):s?.(`Unable to parse array for ${t.from} at ${g.getPath()}`):f.key?u.source[f.key]=f.source:"string"==typeof t.to&&(u.source[t.to]=f.source))}n=r?.local??null,a=r?.tag??null,l=r?.visitor??null,d=!r?.destination},onText:t=>{l?.text?.(t,g)},onEnd:e}}}const J=(t,e,s,i=null)=>{if(!t)return null;let o=t;o.startsWith("/")&&(o=o.substring(1));let r=i?.parsedRefs?.get(t);if(void 0!==r)return r;const n=e(o);if(!n)return null;let a=n.content;try{s&&(a=s(a))}catch(t){console.warn(t)}return i?.parsedRefs?.set(t,a),a},Q=(t,e,s,i,o=null)=>{if(!t)return null;let r=t;r.startsWith("/")&&(r=r.substring(1));let n=o?.parsedRefs?.get(t);if(void 0!==n)return n;const a=e(r);if(!a)return null;const l=a.content;try{const e=(new TextDecoder).decode(l),r=s.parseFromString(e,"text/xml"),n=i.convert(r,t,o);return o?.parsedRefs?.set(t,n),n}catch(t){console.warn(t)}return null},K=(t,e,s,i,o=null)=>{const r=new Map;let n=e.Directory[t];const a=n?n.length:0;for(let t=0;t<a;t++){const a=n[t];if(!a)continue;let l=a;l.startsWith("/")&&(l=l.substring(1));const c=Q(l,t=>e.files[t],s,i,o);r.set(l,c)}return r},Y=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],tt=(e,s="dk1")=>{let i;const o=e("auto");void 0===o||"1"!==o&&"true"!==o||(i=s);const r=e("indexed");r&&(i=`index${r}`);const n=e("rgb");n&&(i=n.toLowerCase(),8!==n.length||n.startsWith("FF")||(i="FF"+n.substring(2,n.length)));const a=e("theme");a&&(i=Y[a]);let l=e("tint");if(l&&(i+=` ${t.IColor.AdjustmentType.ETint} ${parseFloat(l)}`),i)return i},et=t=>t?t.replace(/^\{([\s\S]+)\}$/,"$1"):t,st=t=>"true"===t||"1"===t;class it{static{this.Collapsed=1}static{this.CustomFormat=2}static{this.CustomHeight=4}static{this.Hidden=8}static{this.Ht=16}static{this.OutlineLevel=32}static{this.Ph=64}static{this.R=128}static{this.S=256}static{this.Spans=512}static{this.ThickBot=1024}static{this.ThickTop=2048}}const ot=(t,e,s)=>{if(t[0].value[0]===t[1].value[0])return e},rt={colStart:0,colEnd:0,rowStart:0,rowEnd:0},nt=Object.freeze(Object.defineProperty({__proto__:null,fromBufferXLSX:async(e,s)=>{const{password:i,onWarning:o,createWorkbookOptions:r={},...n}=s??{},a=Promise.resolve().then(()=>require("./Dx-jp_LJxWbAScyA.cjs")),l=Promise.resolve().then(()=>require("./SzxJv7OUs5ojl8gx.cjs"));let c=null;try{c=new DOMParser}catch(e){}let h=null;c||(h=Promise.resolve().then(()=>require("./DFtyXc7YFh9dIp74.cjs")).then(t=>t.i));let u=null,d=null,p=null;try{const t=await Promise.all([a,l,h]);u=t[0],d=t[1],p=t[2]}catch(e){throw new Error("Unable to load XLSX parser.",{cause:e})}try{const s=u.read(e,{type:"array",sheets:[],cellStyles:!1,bookFiles:!0});if(!s.Directory)throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");s.Directory.richstructure=["/xl/richData/rdrichvaluestructure.xml"],s.Directory.richdata=["/xl/richData/rdrichvalue.xml"];const i=new d.FromOOXMLConverter,n=c??new p.DOMParser,a=r?.resources??new t.ResourceCollection,l=a.beginPersist(),h={},g=new Set,f=new Map;f.set("richTypes",[]);const m=new Map,T=[],y=t=>s.files[t],b=(t,e)=>{const s=t.lastIndexOf("/"),o=t.substring(0,s+1)+"_rels/"+t.substring(s+1,t.length)+".rels";let r=e.get(o);return r||(r=((t,e,s,i,o=null)=>{if(!t)return null;const r=Q(t,e,s,i,o);if(!r)return null;const n=new Map,a=Object.keys(r),l=a.length;for(let t=0;t<l;t++){const e=a[t],s=r[e];n.set(e,s)}return n})(o,y,n,i,w),e.set(o,r)),r},x=(e,s,r,c=m)=>{let u=b(s,c).get(e),d=u?.target;if(!d)return null;if("External"===u.targetMode)return u.target;const p=s.lastIndexOf("/"),v=s.substring(0,p+1);d.startsWith("/")||(d=v+d),d=(t=>{const e=t.split(/\/+/),s=e.reduce((t,e,s)=>("."===e?t.splice(s,1):".."===e&&t.splice(s-1,2),t),e);return s.join("/")})(d);const S=i?.getVisitorParamsState().get("dxfs");let C=c.get(d);if(!C){const e="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";if(u.type===e){const e={};C=e;const s=async()=>{const s=((e,s,i,o,r,n,a)=>{const l=new Z,c=new t.Tuple.TransposedBuilder;let h=null;l.registerVisitor({from:"autoFilter",to:"filter",openTag:t=>{t.copyTo("ref",G)}}),l.registerVisitor({from:"conditionalFormatting",to:{},openTag:t=>{const e=t.getParent();e.conditionals||(e.conditionals=[]),e.conditionals.push(t.getSource());const s=t.getAttribute("sqref");s&&(t.getSource().ref=s.split(" ").join(",")),t.copyTo("pivot",_)},closeTag:t=>{const e=t.getSource();if(e.rule){const t=Object.keys(e.rule);for(let s=0;s<t.length;s++){const i=t[s];"rule"!==i&&(e[i]=e.rule[i])}}delete e.rule}}),l.registerVisitor({from:"cfRule",to:"rule",openTag:t=>{const e=t.getParent();t.copyToObject(e,"type",G),t.copyToObject(e,"priority",U),t.copyToObject(e,"stopIfTrue",_);const s=t.getAttribute("dxfId",U);if(null!==s){let i=o?.get(s);i||(n?.(`Unable to load conditional color. Invalid dxfI: '${s}' at '${t.getPath()}'.`),i={}),e.style=i}t.copyToObject(e,"aboveAverage",_),t.copyToObject(e,"equalAverage",_),t.copyToObject(e,"stdDev",U),t.copyToObject(e,"bottom",_),t.copyToObject(e,"percent",_),t.copyToObject(e,"rank",U),t.copyToObject(e,"operator",G),t.copyToObject(e,"text",G),t.copyToObject(e,"timePeriod",G)}}),l.registerVisitor({from:"colorScale",to:"colorScale"}),l.registerVisitor({from:"dataBar",to:"dataBar",openTag:t=>{t.copyTo("maxLength",U),t.copyTo("minLength",U),t.copyTo("showValue",_)}}),l.registerVisitor({from:"iconSet",to:"iconSet",openTag:t=>{t.copyTo("iconSet",G),t.copyTo("reverse",_),t.copyTo("showValue",_)}}),l.registerVisitor({from:"formula",to:null,text:(t,e)=>{const s=e.getParent();let i=s.formulas;i||(i=[],s.formulas=i),i.push(t)}}),l.registerVisitor({from:"cfvo",to:{},openTag:t=>{const e=t.getParent();e.conditions||(e.conditions=[]),e.conditions.push(t.getSource()),t.copyTo("type",G),t.copyTo("value",z,"val"),t.copyTo("gte",_)}}),l.registerVisitor({from:"color",to:{},openTag:t=>{const e=t.getParent();e.colors||(e.colors=[]);const s=tt(e=>t.getAttribute(e));e.colors.push(s)}}),l.registerVisitor({from:"filterColumn",to:"filterColumn",openTag:t=>{const e=t.getParent();e.fields||(e.fields=[]),e.fields.push(t.getSource()),t.copyTo("offset",U,"colId"),t.copyTo("hiddenButton",_),t.copyTo("showButton",_)}}),l.registerVisitor({from:"colorFilter",to:"colorFilter",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Color,e.copyTo("cellColor",_),e.copyTo("styleId",U,"dxfId")}}),l.registerVisitor({from:"dynamicFilter",to:"dynamicFilter",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Dynamic,e.copyTo("dynamicType",G,"type"),e.copyTo("val",z),e.copyTo("maxVal",z,"maxVal")}}),l.registerVisitor({from:"iconFilter",to:"iconFilter",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Icon,e.copyTo("iconId",U),e.copyTo("iconSet",G)}}),l.registerVisitor({from:"top10",to:"top10",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Top10,e.copyTo("filterVal",z),e.copyTo("percent",_),e.copyTo("top",_),e.copyTo("val",z)}}),l.registerVisitor({from:"filters",to:"filters",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Items,e.copyTo("blank",_),e.copyTo("calendarType",G)}}),l.registerVisitor({from:"dateGroupItem",to:"dateGroupItem",openTag:t=>{const e=t.getParent();e.dateGroups||(e.dateGroups=[]),e.dateGroups.push(t.getSource()),t.copyTo("group",G,"dateTimeGrouping"),t.copyTo("day",U),t.copyTo("hour",U),t.copyTo("minute",U),t.copyTo("month",U),t.copyTo("second",U),t.copyTo("year",U)}}),l.registerVisitor({from:"filter",to:"filter",openTag:t=>{const e=t.getParent();e.items||(e.items=[]),e.items.push(t.getAttribute("val",z))}}),l.registerVisitor({from:"customFilters",to:"customFilters",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Custom,e.copyTo("and",_)}}),l.registerVisitor({from:"customFilter",to:"customFilter",openTag:t=>{const e=t.getParent();e.filters||(e.filters=[]),e.filters.push(t.getSource()),t.copyTo("operator",G),t.copyTo("value",z,"val")}}),l.registerVisitor({from:"sortState",to:"sort",openTag:t=>{t.copyTo("ref",G)}}),l.registerVisitor({from:"sortCondition",to:"sortCondition",openTag:e=>{const s=e.getParent();s.fields||(s.fields=[]);const i=e.getSource();s.fields.push(i),e.copyTo("sortOn",G,"sortBy"),e.copyTo("dxfId",G,"sortBy"),e.copyTo("iconSet",G),e.copyTo("customList",G);const o=e.getAttribute("ref");if(o){const e=t.AddressUtils.fastStringToRange(o,rt).colStart,r=t.AddressUtils.fastStringToRange(s.ref,rt),n=r.colStart;i.offset=r?e-n:e}i.reverse=e.getAttribute("descending",_)??!1}}),l.registerVisitor({from:"AlternateContent",to:null});const u=t=>{h=t.getSource(),t.copyTo("topLeft",G,"topLeftCell");const e=st(t.getAttribute("defaultGridColor")),s=t.getAttribute("colorId");null===s||e||(t.getSource().gridLineColor="index"+parseFloat(s)),t.copyTo("showZeros",_),t.copyTo("showFormulas",_),t.copyTo("zoomScale",U),t.copyTo("showRowHeaders",_,"showRowColHeaders"),t.copyTo("showColumnHeaders",_,"showRowColHeaders"),t.copyTo("showRowGridlines",_,"showGridLines"),t.copyTo("showColumnGridlines",_,"showGridLines")};l.registerVisitor({from:"sheetView",to:"view",openTag:t=>{u(t)},closeTag:()=>{h=null}}),l.registerVisitor({from:"customSheetViews",to:"customSheetViews",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"customSheetView",to:[],openTag:t=>{u(t)},closeTag:()=>{h=null}}),l.registerVisitor({from:"selection",to:"selection",openTag:t=>{if(!h)return;t.copyTo("cell",G,"activeCell"),t.copyTo("rangeIndex",U,"activeCellId");const e=t.getAttribute("activeCell"),s=t.getAttribute("sqref");s&&s!==e&&(t.getSource().ranges=s.split(" "))}}),l.registerVisitor({from:"pane",to:"pane",openTag:e=>{if(h&&"frozen"===e.getAttribute("state")){const s={};h.freezePanes=s,e.copyToObject(s,"topLeft",G,"topLeftCell");const i=h.topLeft?t.AddressUtils.fastStringToCell(h.topLeft):{colIndex:0,rowIndex:0},o={colIndex:0,rowIndex:0};e.copyToObject(o,"colIndex",U,"xSplit"),e.copyToObject(o,"rowIndex",U,"ySplit");const r={colIndex:i.colIndex+o.colIndex,rowIndex:i.rowIndex+o.rowIndex};s.coords=t.AddressUtils.cellToString(r)}}}),l.registerVisitor({from:"tabColor",to:null,openTag:t=>{const s=tt(e=>t.getAttribute(e));s&&(e.tabColor=s)}}),l.registerVisitor({from:"pageSetUpPr",to:"pageSetUpPr",openTag:t=>{}}),l.registerVisitor({from:"outlinePr",to:"outlinePr",openTag:t=>{}}),l.registerVisitor({from:"pageMargins",to:"pageMargins",openTag:t=>{}}),l.registerVisitor({from:"pageSetup",to:"pageSetup",openTag:t=>{}}),l.registerVisitor({from:"printOptions",to:"printOptions",openTag:t=>{}}),l.registerVisitor({from:"mergeCells",to:"merges",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"mergeCell",to:[],openTag:t=>{const e=t.getAttribute("ref");t.setSource(e)}}),l.registerVisitor({from:"hyperlinks",to:"hyperlinks",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"hyperlink",to:[],openTag:t=>{const e=t.getAttribute("r:id"),i=t.getAttribute("ref");if(!i)return void console.warn("No ref found for hyperlink");t.setKey(i);let o=e?s(e):"";if("string"!=typeof o)return void console.warn("Invalid address ",o);const r=t.getAttribute("location");o.endsWith("\\")&&(o=o.substring(0,o.length-1));const n=t.getAttribute("location");if(n&&(r&&r!==n&&console.warn("display and location are different",r,n),o+="#"+n),!o)return void console.warn("No address found for hyperlink. r:id",e);let a;const l=t.getAttribute("tooltip");a=l?{address:o,tooltip:l}:o,t.setSource({r:i,v:a})}}),l.registerVisitor({from:"drawing",to:"movables",openTag:t=>{const e=t.getAttribute("r:id");if(!e)return;const i=s(e);i?t.setSource(i.movables):console.warn("no drawing found for rId",e)}}),l.registerVisitor({from:"tableParts",to:"tables",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"tablePart",to:[],openTag:t=>{const e=t.getAttribute("r:id");if(!e)return;const i=s(e);i?t.setSource(i):console.warn("no table found for rId",e)}}),l.registerVisitor({from:"worksheet",to:"worksheet",openTag:t=>{}}),l.registerVisitor({from:"sheetProtection",to:"protection",openTag:t=>{let e=!1;if(t.hasAttribute("sheet")&&_(t.getAttribute("sheet"))&&(e=!0),!e)return void t.setSource(void 0);const s=t=>!0===t||"1"===t||"on"===t||"true"===t||!1===t||"0"===t||"off"===t||"false"===t||null;t.copyTo("autoFilter",s),t.copyTo("deleteColumns",s),t.copyTo("formatCells",s),t.copyTo("formatColumns",s),t.copyTo("formatRows",s),t.copyTo("insertColumns",s),t.copyTo("insertHyperlinks",s),t.copyTo("insertRows",s),t.copyTo("objects",s),t.copyTo("pivotTables",s),t.copyTo("scenarios",s),t.copyTo("selectUnlockedCells",s),t.copyTo("selectUnlockedCells",s),t.copyTo("sort",s);const i={};t.copyToObject(i,"hash",G,"hashValue"),t.copyToObject(i,"algorithm",G,"algorithmName"),t.copyToObject(i,"salt",G,"saltValue"),t.copyToObject(i,"spinCount",U),Object.keys(i).length>0&&(t.getSource().password=i)}}),l.registerVisitor({from:"protectedRanges",to:"protectedRanges",openTag:t=>{t.setSource({})}}),l.registerVisitor({from:"protectedRange",to:{},openTag:t=>{const e=t.getAttribute("sqref");t.setKey(e),t.copyTo("name"),t.copyTo("securityDescriptor");const s={};t.copyToObject(s,"hash",G,"hashValue"),t.copyToObject(s,"algorithm",G,"algorithmName"),t.copyToObject(s,"salt",G,"saltValue"),t.copyToObject(s,"spinCount",U),Object.keys(s).length>0&&(t.getSource().password=s)}}),l.registerVisitor({from:"sheetFormatPr",to:"sheetFormatPr",openTag:t=>{t.copyToObject(e,"defaultColSize",z,"defaultColWidth"),t.copyToObject(e,"outlineLevelCol",U,"outlineLevelCol");const s=t.getAttribute("customHeight");"1"!==s&&"true"!==s||t.copyToObject(e,"defaultRowSize",z,"defaultRowHeight"),t.copyToObject(e,"outlineLevelRow",U,"outlineLevelRow")}}),l.registerVisitor({from:"cols",to:"cols",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"col",to:[],openTag:t=>{t.copyTo("min",t=>parseInt(t)-1),t.copyTo("max",t=>parseInt(t)-1),t.copyTo("sz",z,"width"),t.copyTo("cs",_,"customWidth"),t.copyTo("h",_,"hidden"),t.copyTo("l",U,"outlineLevel"),t.copyTo("s",U,"style")}}),l.registerVisitor({from:"oleObjects",to:null,openTag:t=>{t.warn("'OLE Objects' are not supported.")}});let d=null;const p={onOpenTag:t=>{null===d&&(d="")},onText:t=>{d+=t},onEnd:()=>{const t=i(d);return d=null,t},onError:t=>{}};return((e,s,i,o,r,n)=>{let a=!1,l=!1,c=[],h=!1,u=null,d=null,p=null,g=null,f=null,m=null;const T=n?.get("richData")??[],y=t.AddressUtils.normalizeA1ToR1C1,b=t.CoordUtils.createConflatingRanges(),x=new Map,w=[];let v=null;const S=t.CoordUtils.createConflatingRanges();let C,k=!1,A=-1,E=-1,D=null,P=null;const I=[];let O=null,V=-2,N=0,L="",R="",$="",F="",M="",j="",H="",X="",B="",W="",q="",_="",U="",z="",G=!0,Z=null;return{...i,onEnd:()=>{I.length>0&&(s.rows=I);let o=b.done(ot);const r=o.length;if(r>0){const e=new Array(r);for(let s=0;s<r;s++){const i=o[s],r=t.AddressUtils.rangeToString(i),n=i.value[1],a=t.AddressUtils.resolveRelativeToA1(n,i.rowStart,i.colStart);e[s]=[r,a]}s.formulas=e}const n=S.done(!0),a=n.length;if(a>0){const e=new Array(a);for(let s=0;s<a;s++){const i=n[s],o=t.AddressUtils.rangeToString(i);e[s]=o}s.volatile=e}if(w.length>0&&(s.dynamicArray=[...w]),c.length>0){c.sort(t.CoordUtils.createRangeComparator(t.IRange.Orientation.Column));const e=[];let i=null,o=-1,r=-1,n=-1,a=-1,l=null;const h=c.length;h>0&&(i=c[0],o=i.colStart,r=i.colEnd,n=i.rowEnd,a=i.value,e.push(i));for(let t=1;t<h;t++)l=c[t],a!==l.value||o!==l.colStart||r!==l.colEnd||n+1!==l.rowEnd?(e.push(l),i=l,o=i.colStart,r=i.colEnd,n=i.rowEnd,a=i.value):(n=l.rowEnd,i.rowEnd=n);let u=[];for(let t=0;t<e.length;t++){const s=e[t];u.push({r:{colStart:s.colStart,colEnd:s.colEnd,rowStart:s.rowStart,rowEnd:s.rowEnd},v:s.value})}s.directStyles=u}const l=e.build();if(l){const t=l.tuples;s.data=t}i?.onEnd?.()},onOpenTag:e=>{let s=e.name;const o=s.indexOf(":");if(-1!==o&&(s=s.slice(o+1)),C){const t=e.attributes;switch(s){case"v":l=!0;break;case"f":switch(t.t??null){case null:case"normal":h=!0;break;case"shared":const e=t.si;d=t.ref,u=e;break;case"array":h=!0,d=t.ref,v=[d,!1];break;case"datatable":h=!0,d=t.ref,h=!0}void 0!==t.ca&&S.append(A,E);break;case"is":return void(k=!0)}return void(k&&r?.onOpenTag(e))}if(a){if("c"===s){C=e;const s=e.attributes.r;E=t.AddressUtils.fastStringToCol(s);const i=e.attributes.t;void 0===i?P=null:(P=i,"str"===P&&(k=!0));let o=e.attributes.s;void 0!==o&&(o=parseInt(o),Z&&Z.value===o&&Z.colEnd+1===E?Z.colEnd=E:(Z={colStart:E,rowStart:A,colEnd:E,rowEnd:A,value:o},c.push(Z)))}}else{if("row"===s){a=!0;const t=e.attributes.r;if(A=parseInt(t)-1,N=0,R=e.attributes.customHeight,void 0!==R&&(N|=it.CustomHeight),R!==B&&(G=!0,B=R),L=e.attributes.ht,void 0!==L&&(N|=it.Ht),L!==X&&(G=!0,X=L),$=e.attributes.hidden,void 0!==$&&(N|=it.Hidden),$!==W&&(G=!0,W=$),M=e.attributes.s,void 0!==M&&(N|=it.S),M!==_&&(G=!0,_=M),F=e.attributes.customFormat,void 0!==F&&(N|=it.CustomFormat),F!==q&&(G=!0,q=F),j=e.attributes.outlineLevel,void 0!==j&&(N|=it.OutlineLevel),j!==U&&(G=!0,U=j),H=e.attributes.collapsed,void 0!==H&&(N|=it.Collapsed),H!==z&&(G=!0,z=H),0!==N)if(V+1!==A||G){const t=void 0!==R&&("1"===R||"true"===R),e=void 0!==F&&("1"===F||"true"===F);O={min:A,max:A,sz:t&&void 0!==L?parseFloat(L):-1,csz:t,h:void 0!==$&&("1"===$||"true"===$),s:t&&void 0!==M&&"0"!==M?parseInt(M):0,cs:e,l:void 0===j||"0"===j?0:parseInt(j),cl:void 0!==H&&("1"===H||"true"===H)},I.push(O)}else O.max=A;return V=A,void(G=!1)}i?.onOpenTag(e)}},onCloseTag:t=>{if(C){let s=t.name;const i=s.indexOf(":");if(-1!==i&&(s=s.slice(i+1)),k)if("is"===s||"v"===s){const t=r?.onEnd();null!==t&&e.addValue(A,E,""+t)}else r?.onCloseTag?.(t);return l&&(l=!1),void("c"===s&&(C=null,k=!1))}if(a)return a=!1,void(Z=null);i?.onCloseTag(t)},onText:s=>{if(s=s.trim(),l){switch(D=null,P){case null:case"n":D=parseFloat(s);break;case"b":D="1"===s||"true"===s;break;case"s":D=s;break;case"e":if("#VALUE!"===s){const e=C.attributes.vm;if(void 0!==e){const s=T[parseInt(e)-1];if(s&&s.isFormulaError){D={t:t.ScalarType.Error,v:s.getCode()};break}}}const e=t.FormulaError.getBuiltInByLabel(s);e?D={t:t.ScalarType.Error,v:e.getCode()}:(D=s,o?.(`Unknown formula error '${s}' in cell ${t.AddressUtils.cellToString({colIndex:E,rowIndex:A})}`));break;case"str":case"inlineStr":k=!0}null!==D&&e.addValue(A,E,D)}if(v&&("e"===P&&(v[1]=!0),w.push(v),v=null),u)if(f===u)g=m;else{if(g=x.get(u),!g){const t=[];p=y(s,A,E,t),g=[p,t,s],x.set(u,g)}f=u,m=g}if(h){const t=[];p=y(s,A,E,t),g=[p,t,s]}if(g)return b.append(A,E,g),g=null,h=!1,u=null,void(d=null);k?r?.onText(s):a||i?.onText(s)}}})(c,e,l.createEventHandler(e,()=>{},n),n,p,a)})(e,(t,e=!1)=>x(t,d,e)??null,E,S,0,t=>{o&&(t=d+": "+t,o?.(t))},f),i=J(d,y),r=await(async(t,e=8388608)=>{await(async()=>{if("undefined"==typeof ReadableStream)if("undefined"==typeof window){const{ReadableStream:t}=await Promise.resolve().then(()=>require("./CjZbhk41S1qO_74G.cjs"));globalThis.ReadableStream=t}else console.warn("Browser does not support ReadableStream; consider loading a polyfill.")})();const s=new TextDecoder("utf-8");let i=0;const o=t instanceof Uint8Array?t:new Uint8Array(t);return new ReadableStream({pull(t){if(i>=o.byteLength)return void t.close();const r=o.subarray(i,Math.min(i+e,o.byteLength)),n=s.decode(r,{stream:i+e<o.byteLength});t.enqueue(n),i+=r.length}}).getReader()})(i);try{await W.parseStream(r,s,{xmlns:!1})}catch(t){throw console.warn(`Error parsing sheet: '${d}'`,t),new Error(`Error parsing sheet: '${d}'`,{cause:t})}const n=b(d,c);let a,l=new Map;if(n){const s="http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";let i;n.forEach((t,e)=>{if(t.type===s){const t=x(e,d,!1,c);a=t?.comments,a&&a.forEach(t=>{l.set(t.id,t)})}});const o="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";if(n.forEach((t,e)=>{if(t.type===o){const t=x(e,d,!1,c);i=t}}),i||a){const s=a??[],o=i?.comments;if(o){const e=i?.authors;for(let i=0;i<o.length;i++){const r=o[i];let n=void 0!==r.authorId?e[r.authorId]:void 0;if((!n||n.startsWith("tc="))&&(n=et(n.substring(3)),l.has(n)))continue;let a=D.get(n);a||(a=P.get(n)),a||(a={id:t.CommonUtils.uuidV4(),displayName:n},P.set(a.displayName,a),D.set(a.id,a)),n=a?.id??null;const c={id:t.CommonUtils.uuidV4(),personId:n,ref:r.ref,done:!1,asNote:!0,content:r.content};s.push(c)}}e.comments=s}}};T.push(s())}else C=r?J(d,y,t=>{const e=a.add({buffer:t});return e.addReference(h),g.add(e),l.toResourceId(e)},w):Q(d,y,n,i,w)}return C},w={paramMap:f,getRefs:b,getRef:x,parsedRefs:m,onWarning:o,addPerson:t=>null},v=[];let S=0;s.Strings&&(S=parseInt(s.Strings.Unique??s.Strings.length??0));const C=s.Strings??[];for(let t=0;t<S;t++)v.push(C[t]?.t??"");const k=new Map;let A=S;const E=t=>{const e=k.get(t);if(void 0!==e)return e;const s=A;return k.set(t,A++),v.push(t),s},D=(K("richstructure",s,n,i,w),K("richdata",s,n,i,w),new Map),P=new Map,I=K("people",s,n,i);let O=null;if(I.size>0&&(O=I.entries().next()?.value?.[1]?.persons,O)){const t=O.length;for(let e=0;e<t;e++){const t=O[e];D.set(t.id,t),D.set(t.displayName,t)}}const V=K("themes",s,n,i,w);let N=null;if(V&&V.entries){let t=V.entries().next();t?.value?.[1]&&(N=t.value[1])}const L=new t.Theme(N),R=K("styles",s,n,i,w);let $=R.entries().next()?.value[1];$&&($=JSON.parse(t.JSONStableStringify($)));const F=K("workbooks",s,n,i,w);await Promise.all(T);const M={...F.entries().next().value[1],styles:$,theme:L.toJSON()};v.length>0&&(M.strings=v),O&&O.length>0&&(M.people=O);const j={...r,resources:a,json:M},H=new t.Workbook(j);return g.forEach(t=>{t.deleteReference(h)}),l.endPersist(),H}catch(e){let s="Unable to parse XLSX.";throw e instanceof t.OutOfBoundsError&&(s="Unable to open XLSX. There are too many rows or columns."),new Error(s,{cause:e})}},toBufferXLSX:async(e,s)=>{const i=await Promise.resolve().then(()=>require("./Dx-jp_LJxWbAScyA.cjs")),o=await e.toJSON(!0),r=i.utils.book_new();for(let s=0;s<o.sheets.length;s++){const n=o.sheets[s],a=i.utils.json_to_sheet([{}]);i.utils.book_append_sheet(r,a,n.name);const l=n.sheet,c=e.getSheetAt(s),h=c.getUsedRange();if(h?(a["!ref"]=h.getA1(),h.forEach((e,s)=>{const i={t:"z"},o=s.getCell().getStyle();if(!o.isNormal()){let e=o.getNumberFormat();e!==t.NumberFormat.Type.General&&(e===t.NumberFormat.Type.ShortDate?e="m/d/yyyy":e===t.NumberFormat.Type.MediumDate?e="d-mmm-yy":e===t.NumberFormat.Type.LongDate?e="[$-x-sysdate]dddd, mmmm dd, yyyy":e===t.NumberFormat.Type.ShortTime?e="h:mm":e===t.NumberFormat.Type.MediumTime?e="h:mm AM/PM":e===t.NumberFormat.Type.LongTime&&(e="h:mm:ss AM/PM"),i.z=e)}if(null!==e)switch(s.getType()){case t.ScalarType.Number:i.t="n",i.v=e;break;case t.ScalarType.String:i.t="s",i.v=e;break;case t.ScalarType.Boolean:i.t="b",i.v=e;break;case t.ScalarType.Error:i.t="e",i.v=e.toString();case t.ScalarType.RichData:}a[s.getA1()]=i})):a["!ref"]="A1:A1",l.merges?.length>0){const t=[];a["!merges"]=t;for(let e=0;e<l.merges.length;e++)t.push(i.utils.decode_range(l.merges[e]))}if(l.cols?.length>0){const t=[];a["!cols"]=t;const e=l.cols,s={width:l.defaultColSize??c.getColumnWidthAsFontUnit(c.getColumnHeaders().getDefaultSize())};for(let i=0;i<e.length;i++){const o=e[i];for(let e=t.length;e<=o.min-1;e++)t.push(s);const r={};void 0!==o.sz&&(r.width=o.sz),void 0!==o.h&&(r.hidden=o.h),void 0!==o.l&&(r.level=o.l);for(let e=o.min;e<=o.max;e++)t.push(r)}}}return i.write(r,{type:"array",bookType:"xlsx"}),i.write(r,{type:"array",bookType:"xlsx"})}},Symbol.toStringTag,{value:"Module"}));exports.a=t=>parseFloat(t)/1e3,exports.b=st,exports.c=t=>t?e._n.roundAccurately(parseFloat(t)/9525,1):null,exports.d=tt,exports.i=nt,exports.p=t=>parseFloat(t)/6e4,exports.r=et,exports.t=t=>t?e._n.roundAccurately(parseFloat(t)/12700,4):null;
|
|
7
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@sheetxl/sdk"),e=require("./DJbKKxeeTEHHA1gR.cjs"),s=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",i=new RegExp(`^[${s}][-${s}.0-9·̀-ͯ‿-⁀]*$`,"u");function o(t){return t>=65&&t<=90||t>=97&&t<=122||58===t||95===t||8204===t||8205===t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}const r="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",n=new RegExp(`^[${r}][-${r}.0-9·̀-ͯ‿-⁀]*$`,"u");function a(t){return t>=65&&t<=90||95===t||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}const l=function(t){return 32===t||10===t||13===t||9===t},c=function(t){return t>=32&&t<=55295||10===t||13===t||9===t||t>=57344&&t<=65533||t>=65536&&t<=1114111},h=o,u=function(t){return o(t)||t>=48&&t<=57||45===t||46===t||183===t||t>=768&&t<=879||t>=8255&&t<=8256},d=[32,10,13,9],p=i,g=function(t){return t>=1&&t<=55295||t>=57344&&t<=65533||t>=65536&&t<=1114111},f=a,m=function(t){return a(t)||45===t||46===t||t>=48&&t<=57||183===t||t>=768&&t<=879||t>=8255&&t<=8256},T=n,y="http://www.w3.org/XML/1998/namespace",b="http://www.w3.org/2000/xmlns/",x={__proto__:null,xml:y,xmlns:b},w={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},v=-1,S=-2,C=13,k=33,A=10,E=60,D=61,P=62,I=63,O=93,V=t=>34===t||39===t,N=[34,39],L=[...N,91,P],R=[...N,E,O],$=[D,I,...d],F=[...d,P,38,E];function M(t,e,s){switch(e){case"xml":s!==y&&t.fail(`xml prefix must be bound to ${y}.`);break;case"xmlns":s!==b&&t.fail(`xmlns prefix must be bound to ${b}.`)}switch(s){case b:t.fail(""===e?`the default namespace may not be set to ${s}.`:`may not assign a prefix (even "xmlns") to the URI ${b}.`);break;case y:switch(e){case"xml":break;case"":t.fail(`the default namespace may not be set to ${s}.`);break;default:t.fail("may not assign the xml namespace to another prefix.")}}}const j=t=>T.test(t),H=t=>p.test(t),X={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class B{constructor(t){this.i=0,this.prevI=0,this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;const e=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=!1!==this.opt.position,this.fileName=this.opt.fileName,e){this.nameStartCheck=f,this.nameCheck=m,this.isName=j,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns={__proto__:null,...x};const t=this.opt.additionalNamespaces;null!=t&&(function(t,e){for(const s of Object.keys(e))M(t,s,e[s])}(this,t),Object.assign(this.ns,t))}else this.nameStartCheck=h,this.nameCheck=u,this.isName=H,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];const{fragmentOpt:t}=this;this.state=t?C:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:e}=this.opt;if(void 0===e){if(!0===this.opt.forceXMLVersion)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");e="1.0"}this.setXMLVersion(e),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(w),this.readyHandler?.()}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,e){this[X[t]]=e}off(t){this[X[t]]=void 0}makeError(t){let e=this.fileName??"";return this.trackPosition&&(e.length>0&&(e+=":"),e+=`${this.line}:${this.column}`),e.length>0&&(e+=": "),new Error(e+t)}fail(t){const e=this.makeError(t),s=this.errorHandler;if(void 0===s)throw e;return s(e),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let e=!1;null===t?(e=!0,t=""):"object"==typeof t&&(t=t.toString()),void 0!==this.carriedFromPrevious&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let s=t.length;const i=t.charCodeAt(s-1);!e&&(13===i||i>=55296&&i<=56319)&&(this.carriedFromPrevious=t[s-1],s--,t=t.slice(0,s));const{stateTable:o}=this;for(this.chunk=t,this.i=0;this.i<s;)o[this.state].call(this);return this.chunkPosition+=s,e?this.end():this}close(){return this.write(null)}getCode10(){const t=this.chunk,e=this.i;if(this.prevI=e,this.i++,e>=t.length)return v;const s=t.charCodeAt(e);if(this.column++,s<55296){if(s>=32||9===s)return s;switch(s){case A:return this.line++,this.column=0,this.positionAtNewLine=this.position,A;case 13:return t.charCodeAt(e+1)===A&&(this.i=e+2),this.line++,this.column=0,this.positionAtNewLine=this.position,S;default:return this.fail("disallowed character."),s}}if(s>56319)return s>=57344&&s<=65533||this.fail("disallowed character."),s;const i=65536+1024*(s-55296)+(t.charCodeAt(e+1)-56320);return this.i=e+2,i>1114111&&this.fail("disallowed character."),i}getCode11(){const{chunk:t,i:e}=this;if(this.prevI=e,this.i=e+1,e>=t.length)return v;const s=t.charCodeAt(e);if(this.column++,s<55296){if(s>31&&s<127||s>159&&8232!==s||9===s)return s;switch(s){case A:return this.line++,this.column=0,this.positionAtNewLine=this.position,A;case 13:{const s=t.charCodeAt(e+1);s!==A&&133!==s||(this.i=e+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,S;default:return this.fail("disallowed character."),s}}if(s>56319)return s>=57344&&s<=65533||this.fail("disallowed character."),s;const i=65536+1024*(s-55296)+(t.charCodeAt(e+1)-56320);return this.i=e+2,i>1114111&&this.fail("disallowed character."),i}getCodeNorm(){const t=this.getCode();return t===S?A:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:e}=this;const{chunk:s}=this;for(;;){const i=this.getCode(),o=i===S,r=o?A:i;if(r===v||t.includes(r))return this.text+=s.slice(e,this.prevI),r;o&&(this.text+=`${s.slice(e,this.prevI)}\n`,e=this.i)}}captureToChar(t){let{i:e}=this;const{chunk:s}=this;for(;;){let i=this.getCode();switch(i){case S:this.text+=`${s.slice(e,this.prevI)}\n`,e=this.i,i=A;break;case v:return this.text+=s.slice(e),!1}if(i===t)return this.text+=s.slice(e,this.prevI),!0}}captureNameChars(){const{chunk:t,i:e}=this;for(;;){const s=this.getCode();if(s===v)return this.name+=t.slice(e),v;if(!u(s))return this.name+=t.slice(e,this.prevI),s===S?A:s}}skipSpaces(){for(;;){const t=this.getCodeNorm();if(t===v||!l(t))return t}}setXMLVersion(t){this.currentXMLVersion=t,"1.0"===t?(this.isChar=c,this.getCode=this.getCode10):(this.isChar=g,this.getCode=this.getCode11)}sBegin(){65279===this.chunk.charCodeAt(0)&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){const t=this.i,e=this.skipSpaces();switch(this.prevI!==t&&(this.xmlDeclPossible=!1),e){case E:if(this.state=15,0!==this.text.length)throw new Error("no-empty text at start");break;case v:break;default:this.unget(),this.state=C,this.xmlDeclPossible=!1}}sDoctype(){const t=this.captureTo(L);switch(t){case P:this.doctypeHandler?.(this.text),this.text="",this.state=C,this.doctype=!0;break;case v:break;default:this.text+=String.fromCodePoint(t),91===t?this.state=4:V(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.q=null,this.state=2)}sDTD(){const t=this.captureTo(R);t!==v&&(this.text+=String.fromCodePoint(t),t===O?this.state=2:t===E?this.state=6:V(t)&&(this.state=5,this.q=t))}sDTDQuoted(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.state=4,this.q=null)}sDTDOpenWaka(){const t=this.getCodeNorm();switch(this.text+=String.fromCodePoint(t),t){case 33:this.state=7,this.openWakaBang="";break;case I:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){const t=String.fromCodePoint(this.getCodeNorm()),e=this.openWakaBang+=t;this.text+=t,"-"!==e&&(this.state="--"===e?8:4,this.openWakaBang="")}sDTDComment(){this.captureToChar(45)&&(this.text+="-",this.state=9)}sDTDCommentEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),this.state=45===t?10:8}sDTDCommentEnded(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===P?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(I)&&(this.text+="?",this.state=12)}sDTDPIEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===P&&(this.state=4)}sText(){0!==this.tags.length?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:t}=this;const{chunk:e}=this;t:for(;;)switch(this.getCode()){case S:this.entity+=`${e.slice(t,this.prevI)}\n`,t=this.i;break;case 59:{const{entityReturnState:s}=this,i=this.entity+e.slice(t,this.prevI);let o;this.state=s,""===i?(this.fail("empty entity name."),o="&;"):(o=this.parseEntity(i),this.entity=""),s===C&&void 0===this.textHandler||(this.text+=o);break t}case v:this.entity+=e.slice(t);break t}}sOpenWaka(){const t=this.getCode();if(h(t))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(t){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang="",this.xmlDeclPossible=!1;break;case I:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=C,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang="";break;case"--":this.state=17,this.openWakaBang="";break;case"DOCTYPE":this.state=2,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){const t=this.getCodeNorm();45===t?(this.state=19,this.commentHandler?.(this.text),this.text=""):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){const t=this.getCodeNorm();t!==P?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(t)}`,this.state=17):this.state=C}sCData(){this.captureToChar(O)&&(this.state=21)}sCDataEnding(){const t=this.getCodeNorm();t===O?this.state=22:(this.text+=`]${String.fromCodePoint(t)}`,this.state=20)}sCDataEnding2(){const t=this.getCodeNorm();switch(t){case P:this.cdataHandler?.(this.text),this.text="",this.state=C;break;case O:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){const t=this.getCodeNorm();this.nameStartCheck(t)?(this.piTarget+=String.fromCodePoint(t),this.state=24):t===I||l(t)?(this.fail("processing instruction without a target."),this.state=t===I?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(t),this.state=24)}sPIRest(){const{chunk:t,i:e}=this;for(;;){const s=this.getCodeNorm();if(s===v)return void(this.piTarget+=t.slice(e));if(!this.nameCheck(s)){this.piTarget+=t.slice(e,this.prevI);const i=s===I;i||l(s)?"xml"===this.piTarget?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=i?k:27):this.state=i?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(s));break}}}sPIBody(){if(0===this.text.length){const t=this.getCodeNorm();t===I?this.state=26:l(t)||(this.text=String.fromCodePoint(t))}else this.captureToChar(I)&&(this.state=26)}sPIEnding(){const t=this.getCodeNorm();if(t===P){const{piTarget:t}=this;"xml"===t.toLowerCase()&&this.fail("the XML declaration must appear at the start of the document."),this.piHandler?.({target:t,body:this.text}),this.piTarget=this.text="",this.state=C}else t===I?this.text+="?":(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const t=this.skipSpaces();t!==I?t!==v&&(this.state=28,this.name=String.fromCodePoint(t)):this.state=k}sXMLDeclName(){const t=this.captureTo($);if(t===I)return this.state=k,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(l(t)||t===D){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=t===D?30:29}}sXMLDeclEq(){const t=this.getCodeNorm();if(t===I)return this.state=k,void this.fail("XML declaration is incomplete.");l(t)||(t!==D&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){const t=this.getCodeNorm();if(t===I)return this.state=k,void this.fail("XML declaration is incomplete.");l(t)||(V(t)?this.q=t:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){const t=this.captureTo([this.q,I]);if(t===I)return this.state=k,this.text="",void this.fail("XML declaration is incomplete.");if(t===v)return;const e=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const t=e;this.xmlDecl.version=t,/^1\.[0-9]+$/.test(t)?this.opt.forceXMLVersion||this.setXMLVersion(t):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(e)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=e;break;case"standalone":"yes"!==e&&"no"!==e&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=e}this.name="",this.state=32}sXMLDeclSeparator(){const t=this.getCodeNorm();t!==I?(l(t)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=k}sXMLDeclEnding(){this.getCodeNorm()===P?("xml"!==this.piTarget?this.fail("processing instructions are not allowed before root."):"version"!==this.name&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),this.xmldeclHandler?.(this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=C):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){const t=this.captureNameChars();if(t===v)return;const e=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=e.ns=Object.create(null)),this.openTagStartHandler?.(e),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),t){case P:this.openTag();break;case 47:this.state=35;break;default:l(t)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){this.getCode()===P?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){const t=this.skipSpaces();t!==v&&(h(t)?(this.unget(),this.state=37):t===P?this.openTag():47===t?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){const t=this.captureNameChars();t===D?this.state=39:l(t)?this.state=38:t===P?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):t!==v&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const t=this.skipSpaces();switch(t){case v:return;case D:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",t===P?this.openTag():h(t)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){const t=this.getCodeNorm();V(t)?(this.q=t,this.state=40):l(t)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){const{q:t,chunk:e}=this;let{i:s}=this;for(;;)switch(this.getCode()){case t:return this.pushAttrib(this.name,this.text+e.slice(s,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=e.slice(s,this.prevI),this.state=14,void(this.entityReturnState=40);case A:case S:case 9:this.text+=`${e.slice(s,this.prevI)} `,s=this.i;break;case E:return this.text+=e.slice(s,this.prevI),void this.fail("disallowed character.");case v:return void(this.text+=e.slice(s))}}sAttribValueClosed(){const t=this.getCodeNorm();l(t)?this.state=36:t===P?this.openTag():47===t?this.state=35:h(t)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const t=this.captureTo(F);switch(t){case 38:this.state=14,this.entityReturnState=42;break;case E:this.fail("disallowed character.");break;case v:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",t===P?this.openTag():this.state=36}}sCloseTag(){const t=this.captureNameChars();t===P?this.closeTag():l(t)?this.state=44:t!==v&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case P:this.closeTag();break;case v:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:t,forbiddenState:e}=this;const{chunk:s,textHandler:i}=this;t:for(;;)switch(this.getCode()){case E:if(this.state=15,void 0!==i){const{text:e}=this,o=s.slice(t,this.prevI);0!==e.length?(i(e+o),this.text=""):0!==o.length&&i(o)}e=0;break t;case 38:this.state=14,this.entityReturnState=C,void 0!==i&&(this.text+=s.slice(t,this.prevI)),e=0;break t;case O:switch(e){case 0:e=1;break;case 1:e=2;break;case 2:break;default:throw new Error("impossible state")}break;case P:2===e&&this.fail('the string "]]>" is disallowed in char data.'),e=0;break;case S:void 0!==i&&(this.text+=`${s.slice(t,this.prevI)}\n`),t=this.i,e=0;break;case v:void 0!==i&&(this.text+=s.slice(t));break t;default:e=0}this.forbiddenState=e}handleTextOutsideRoot(){let{i:t}=this;const{chunk:e,textHandler:s}=this;let i=!1;t:for(;;){const o=this.getCode();switch(o){case E:if(this.state=15,void 0!==s){const{text:i}=this,o=e.slice(t,this.prevI);0!==i.length?(s(i+o),this.text=""):0!==o.length&&s(o)}break t;case 38:this.state=14,this.entityReturnState=C,void 0!==s&&(this.text+=e.slice(t,this.prevI)),i=!0;break t;case S:void 0!==s&&(this.text+=`${e.slice(t,this.prevI)}\n`),t=this.i;break;case v:void 0!==s&&(this.text+=e.slice(t));break t;default:l(o)||(i=!0)}}i&&(this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(t,e){const{prefix:s,local:i}=this.qname(t),o={name:t,prefix:s,local:i,value:e};if(this.attribList.push(o),this.attributeHandler?.(o),"xmlns"===s){const t=e.trim();"1.0"===this.currentXMLVersion&&""===t&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[i]=t,M(this,i,t)}else if("xmlns"===t){const t=e.trim();this.topNS[""]=t,M(this,"",t)}}pushAttribPlain(t,e){const s={name:t,value:e};this.attribList.push(s),this.attributeHandler?.(s)}end(){this.sawRoot||this.fail("document must contain a root element.");const{tags:t}=this;for(;t.length>0;){const e=t.pop();this.fail(`unclosed tag: ${e.name}`)}0!==this.state&&this.state!==C&&this.fail("unexpected end.");const{text:e}=this;return 0!==e.length&&(this.textHandler?.(e),this.text=""),this._closed=!0,this.endHandler?.(),this._init(),this}resolve(t){let e=this.topNS[t];if(void 0!==e)return e;const{tags:s}=this;for(let i=s.length-1;i>=0;i--)if(e=s[i].ns[t],void 0!==e)return e;return e=this.ns[t],void 0!==e?e:this.opt.resolvePrefix?.(t)}qname(t){const e=t.indexOf(":");if(-1===e)return{prefix:"",local:t};const s=t.slice(e+1),i=t.slice(0,e);return(""===i||""===s||s.includes(":"))&&this.fail(`malformed name: ${t}.`),{prefix:i,local:s}}processAttribsNS(){const{attribList:t}=this,e=this.tag;{const{prefix:t,local:s}=this.qname(e.name);e.prefix=t,e.local=s;const i=e.uri=this.resolve(t)??"";""!==t&&("xmlns"===t&&this.fail('tags may not have "xmlns" as prefix.'),""===i&&(this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`),e.uri=t))}if(0===t.length)return;const{attributes:s}=e,i=new Set;for(const e of t){const{name:t,prefix:o,local:r}=e;let n,a;""===o?(n="xmlns"===t?b:"",a=t):(n=this.resolve(o),void 0===n&&(this.fail(`unbound namespace prefix: ${JSON.stringify(o)}.`),n=o),a=`{${n}}${r}`),i.has(a)&&this.fail(`duplicate attribute: ${a}.`),i.add(a),e.uri=n,s[t]=e}this.attribList=[]}processAttribsPlain(){const{attribList:t}=this,e=this.tag.attributes;for(const{name:s,value:i}of t)void 0!==e[s]&&this.fail(`duplicate attribute: ${s}.`),e[s]=i;this.attribList=[]}openTag(){this.processAttribs();const{tags:t}=this,e=this.tag;e.isSelfClosing=!1,this.openTagHandler?.(e),t.push(e),this.state=C,this.name=""}openSelfClosingTag(){this.processAttribs();const{tags:t}=this,e=this.tag;e.isSelfClosing=!0,this.openTagHandler?.(e),this.closeTagHandler?.(e),null===(this.tag=t[t.length-1]??null)&&(this.closedRoot=!0),this.state=C,this.name=""}closeTag(){const{tags:t,name:e}=this;if(this.state=C,this.name="",""===e)return this.fail("weird empty close tag."),void(this.text+="</>");const s=this.closeTagHandler;let i=t.length;for(;i-- >0;){const i=this.tag=t.pop();if(this.topNS=i.ns,s?.(i),i.name===e)break;this.fail("unexpected close tag.")}0===i?this.closedRoot=!0:i<0&&(this.fail(`unmatched closing tag: ${e}.`),this.text+=`</${e}>`)}parseEntity(t){if("#"!==t[0]){const e=this.ENTITIES[t];return void 0!==e?e:(this.fail(this.isName(t)?"undefined entity.":"disallowed character in entity name."),`&${t};`)}let e=NaN;return"x"===t[1]&&/^#x[0-9a-f]+$/i.test(t)?e=parseInt(t.slice(2),16):/^#[0-9]+$/.test(t)&&(e=parseInt(t.slice(1),10)),this.isChar(e)?String.fromCodePoint(e):(this.fail("malformed character entity."),`&${t};`)}}var W,q;(q=W||(W={})).Events={XmlDecl:"xmldecl",Text:"text",ProcessingInstruction:"processinginstruction",Doctype:"doctype",Comment:"comment",OpenTagStart:"opentagstart",Attribute:"attribute",OpenTag:"opentag",CloseTag:"closetag",CDdata:"cdata",Error:"error",End:"end",Ready:"ready"},q.parseStream=async(t,e,s)=>{const i=new B({position:!1,...s});let o;if(e.onOpenTagStart&&i.on(q.Events.OpenTagStart,e.onOpenTagStart),e.onOpenTag&&i.on(q.Events.OpenTag,e.onOpenTag),e.onCloseTag&&i.on(q.Events.CloseTag,e.onCloseTag),e.onAttribute&&i.on(q.Events.Attribute,e.onAttribute),e.onText&&i.on(q.Events.Text,e.onText),e.onError&&i.on(q.Events.Error,e.onError),e.onEnd){e.onEnd;const t=()=>{o=e.onEnd()};i.on(q.Events.End,t)}for(;;){const{value:e,done:s}=await t.read();if(s)break;i.write(e)}return i.close(),o};const _=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,U=t=>{const e=parseInt(t);return isNaN(e)?null:e},z=t=>{const e=parseFloat(t);return isNaN(e)?null:e},G=null;class Z{constructor(){this._registeredVisitors=new Map}registerVisitor(t){this._registeredVisitors.set(t.from,t)}createEventHandler(t,e,s){const i=this._registeredVisitors,o=[];let r=null,n=null,a=null,l=null;const c=[],h={key:null,source:t};let u=null,d=!1;const p=(t,e)=>{let s=a.attributes[t];if(e)if(Array.isArray(e))for(let t=0;t<e.length;t++){if(null==s)return;if(s=e[t](s),null==s)return}else{if(null==s)return;if(s=e(s),null==s)return}return s},g={getSource:()=>u.source,setSource:t=>{u.source=t},setKey:t=>{u.key=t},getFrom:()=>a,getAttribute:(t,e)=>p(t,e)??null,hasAttribute:t=>null!==g.getAttribute(t),getParent:()=>c[c.length-2].source,getPath:()=>{const t=[];for(let e=0;e<o.length;e++)t.push(o[e].local);return t.join("\\")},parseAttribute:p,copyToObject:(t,e,s,i)=>{const o=p(i??e,s);void 0!==o&&(t[e]=o)},copyTo:(t,e,s)=>{const i=p(s??t,e);void 0!==i&&(u.source[t]=i)},warn:t=>{s?s?.(t):console.warn(t)}};return{onOpenTag:t=>{let e=t.name;const s=e.indexOf(":");-1!==s&&(e=e.slice(s+1));const p=i.get(e);if(r={local:e,visitor:p,tag:t,destination:null},d)return o.push(r),n=e,void(a=t);l=r?.visitor??null,p&&(u=0===o.length?h:null!==l?.to?{key:null,source:{}}:null,r.destination=u,u&&c.push(u)),o.push(r),n=e,a=t,d=null===l?.to,l?.openTag?.(g)},onCloseTag:t=>{let e=t.name;const i=e.indexOf(":");if(-1!==i&&(e=e.slice(i+1)),e!==n)throw new Error(`mismatch open/close tag: '${e}'/'${n}'`);d||l?.closeTag?.(g);const p=o.pop()??null;r=o[o.length-1]??null;const f=p?.destination;if(f){c.pop(),u=c[c.length-1]??h;const t=p.visitor;t&&t.to&&void 0!==f.source&&(Array.isArray(t.to)?u.source.push?u.source.push(f.source):s?.(`Unable to parse array for ${t.from} at ${g.getPath()}`):f.key?u.source[f.key]=f.source:"string"==typeof t.to&&(u.source[t.to]=f.source))}n=r?.local??null,a=r?.tag??null,l=r?.visitor??null,d=!r?.destination},onText:t=>{l?.text?.(t,g)},onEnd:e}}}const J=(t,e,s,i=null)=>{if(!t)return null;let o=t;o.startsWith("/")&&(o=o.substring(1));let r=i?.parsedRefs?.get(t);if(void 0!==r)return r;const n=e(o);if(!n)return null;let a=n.content;try{s&&(a=s(a))}catch(t){console.warn(t)}return i?.parsedRefs?.set(t,a),a},Q=(t,e,s,i,o=null)=>{if(!t)return null;let r=t;r.startsWith("/")&&(r=r.substring(1));let n=o?.parsedRefs?.get(t);if(void 0!==n)return n;const a=e(r);if(!a)return null;const l=a.content;try{const e=(new TextDecoder).decode(l),r=s.parseFromString(e,"text/xml"),n=i.convert(r,t,o);return o?.parsedRefs?.set(t,n),n}catch(t){console.warn(t)}return null},K=(t,e,s,i,o=null)=>{const r=new Map;let n=e.Directory[t];const a=n?n.length:0;for(let t=0;t<a;t++){const a=n[t];if(!a)continue;let l=a;l.startsWith("/")&&(l=l.substring(1));const c=Q(l,t=>e.files[t],s,i,o);r.set(l,c)}return r},Y=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],tt=(e,s="dk1")=>{let i;const o=e("auto");void 0===o||"1"!==o&&"true"!==o||(i=s);const r=e("indexed");r&&(i=`index${r}`);const n=e("rgb");n&&(i=n.toLowerCase(),8!==n.length||n.startsWith("FF")||(i="FF"+n.substring(2,n.length)));const a=e("theme");a&&(i=Y[a]);let l=e("tint");if(l&&(i+=` ${t.IColor.AdjustmentType.ETint} ${parseFloat(l)}`),i)return i},et=t=>t?t.replace(/^\{([\s\S]+)\}$/,"$1"):t,st=t=>"true"===t||"1"===t;class it{static{this.Collapsed=1}static{this.CustomFormat=2}static{this.CustomHeight=4}static{this.Hidden=8}static{this.Ht=16}static{this.OutlineLevel=32}static{this.Ph=64}static{this.R=128}static{this.S=256}static{this.Spans=512}static{this.ThickBot=1024}static{this.ThickTop=2048}}const ot=(t,e,s)=>{if(t[0].value[0]===t[1].value[0])return e},rt={colStart:0,colEnd:0,rowStart:0,rowEnd:0},nt=Object.freeze(Object.defineProperty({__proto__:null,fromBufferXLSX:async(e,s)=>{const{password:i,onWarning:o,createWorkbookOptions:r={},...n}=s??{},a=Promise.resolve().then(()=>require("./DAHpsyykuPBkoh-Z.cjs")),l=Promise.resolve().then(()=>require("./CtNjLzIHB8WX63Bl.cjs"));let c=null;try{c=new DOMParser}catch(e){}let h=null;c||(h=Promise.resolve().then(()=>require("./Q_VvA-yUQx3xFKiJ.cjs")).then(t=>t.i));let u=null,d=null,p=null;try{const t=await Promise.all([a,l,h]);u=t[0],d=t[1],p=t[2]}catch(e){throw new Error("Unable to load XLSX parser.",{cause:e})}try{const s=u.read(e,{type:"array",sheets:[],cellStyles:!1,bookFiles:!0});if(!s.Directory)throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");s.Directory.richstructure=["/xl/richData/rdrichvaluestructure.xml"],s.Directory.richdata=["/xl/richData/rdrichvalue.xml"];const i=new d.FromOOXMLConverter,n=c??new p.DOMParser,a=r?.resources??new t.ResourceCollection,l=a.beginPersist(),h={},g=new Set,f=new Map;f.set("richTypes",[]);const m=new Map,T=[],y=t=>s.files[t],b=(t,e)=>{const s=t.lastIndexOf("/"),o=t.substring(0,s+1)+"_rels/"+t.substring(s+1,t.length)+".rels";let r=e.get(o);return r||(r=((t,e,s,i,o=null)=>{if(!t)return null;const r=Q(t,e,s,i,o);if(!r)return null;const n=new Map,a=Object.keys(r),l=a.length;for(let t=0;t<l;t++){const e=a[t],s=r[e];n.set(e,s)}return n})(o,y,n,i,w),e.set(o,r)),r},x=(e,s,r,c=m)=>{let u=b(s,c).get(e),d=u?.target;if(!d)return null;if("External"===u.targetMode)return u.target;const p=s.lastIndexOf("/"),v=s.substring(0,p+1);d.startsWith("/")||(d=v+d),d=(t=>{const e=t.split(/\/+/),s=e.reduce((t,e,s)=>("."===e?t.splice(s,1):".."===e&&t.splice(s-1,2),t),e);return s.join("/")})(d);const S=i?.getVisitorParamsState().get("dxfs");let C=c.get(d);if(!C){const e="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";if(u.type===e){const e={};C=e;const s=async()=>{const s=((e,s,i,o,r,n,a)=>{const l=new Z,c=new t.Tuple.TransposedBuilder;let h=null;l.registerVisitor({from:"autoFilter",to:"filter",openTag:t=>{t.copyTo("ref",G)}}),l.registerVisitor({from:"conditionalFormatting",to:{},openTag:t=>{const e=t.getParent();e.conditionals||(e.conditionals=[]),e.conditionals.push(t.getSource());const s=t.getAttribute("sqref");s&&(t.getSource().ref=s.split(" ").join(",")),t.copyTo("pivot",_)},closeTag:t=>{const e=t.getSource();if(e.rule){const t=Object.keys(e.rule);for(let s=0;s<t.length;s++){const i=t[s];"rule"!==i&&(e[i]=e.rule[i])}}delete e.rule}}),l.registerVisitor({from:"cfRule",to:"rule",openTag:t=>{const e=t.getParent();t.copyToObject(e,"type",G),t.copyToObject(e,"priority",U),t.copyToObject(e,"stopIfTrue",_);const s=t.getAttribute("dxfId",U);if(null!==s){let i=o?.get(s);i||(n?.(`Unable to load conditional color. Invalid dxfI: '${s}' at '${t.getPath()}'.`),i={}),e.style=i}t.copyToObject(e,"aboveAverage",_),t.copyToObject(e,"equalAverage",_),t.copyToObject(e,"stdDev",U),t.copyToObject(e,"bottom",_),t.copyToObject(e,"percent",_),t.copyToObject(e,"rank",U),t.copyToObject(e,"operator",G),t.copyToObject(e,"text",G),t.copyToObject(e,"timePeriod",G)}}),l.registerVisitor({from:"colorScale",to:"colorScale"}),l.registerVisitor({from:"dataBar",to:"dataBar",openTag:t=>{t.copyTo("maxLength",U),t.copyTo("minLength",U),t.copyTo("showValue",_)}}),l.registerVisitor({from:"iconSet",to:"iconSet",openTag:t=>{t.copyTo("iconSet",G),t.copyTo("reverse",_),t.copyTo("showValue",_)}}),l.registerVisitor({from:"formula",to:null,text:(t,e)=>{const s=e.getParent();let i=s.formulas;i||(i=[],s.formulas=i),i.push(t)}}),l.registerVisitor({from:"cfvo",to:{},openTag:t=>{const e=t.getParent();e.conditions||(e.conditions=[]),e.conditions.push(t.getSource()),t.copyTo("type",G),t.copyTo("value",z,"val"),t.copyTo("gte",_)}}),l.registerVisitor({from:"color",to:{},openTag:t=>{const e=t.getParent();e.colors||(e.colors=[]);const s=tt(e=>t.getAttribute(e));e.colors.push(s)}}),l.registerVisitor({from:"filterColumn",to:"filterColumn",openTag:t=>{const e=t.getParent();e.fields||(e.fields=[]),e.fields.push(t.getSource()),t.copyTo("offset",U,"colId"),t.copyTo("hiddenButton",_),t.copyTo("showButton",_)}}),l.registerVisitor({from:"colorFilter",to:"colorFilter",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Color,e.copyTo("cellColor",_),e.copyTo("styleId",U,"dxfId")}}),l.registerVisitor({from:"dynamicFilter",to:"dynamicFilter",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Dynamic,e.copyTo("dynamicType",G,"type"),e.copyTo("val",z),e.copyTo("maxVal",z,"maxVal")}}),l.registerVisitor({from:"iconFilter",to:"iconFilter",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Icon,e.copyTo("iconId",U),e.copyTo("iconSet",G)}}),l.registerVisitor({from:"top10",to:"top10",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Top10,e.copyTo("filterVal",z),e.copyTo("percent",_),e.copyTo("top",_),e.copyTo("val",z)}}),l.registerVisitor({from:"filters",to:"filters",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Items,e.copyTo("blank",_),e.copyTo("calendarType",G)}}),l.registerVisitor({from:"dateGroupItem",to:"dateGroupItem",openTag:t=>{const e=t.getParent();e.dateGroups||(e.dateGroups=[]),e.dateGroups.push(t.getSource()),t.copyTo("group",G,"dateTimeGrouping"),t.copyTo("day",U),t.copyTo("hour",U),t.copyTo("minute",U),t.copyTo("month",U),t.copyTo("second",U),t.copyTo("year",U)}}),l.registerVisitor({from:"filter",to:"filter",openTag:t=>{const e=t.getParent();e.items||(e.items=[]),e.items.push(t.getAttribute("val",z))}}),l.registerVisitor({from:"customFilters",to:"customFilters",openTag:e=>{const s=e.getParent();s.criteria||(s.criteria=[]),s.criteria.push(e.getSource()),e.getSource().type=t.IAutoFilter.Type.Custom,e.copyTo("and",_)}}),l.registerVisitor({from:"customFilter",to:"customFilter",openTag:t=>{const e=t.getParent();e.filters||(e.filters=[]),e.filters.push(t.getSource()),t.copyTo("operator",G),t.copyTo("value",z,"val")}}),l.registerVisitor({from:"sortState",to:"sort",openTag:t=>{t.copyTo("ref",G)}}),l.registerVisitor({from:"sortCondition",to:"sortCondition",openTag:e=>{const s=e.getParent();s.fields||(s.fields=[]);const i=e.getSource();s.fields.push(i),e.copyTo("sortOn",G,"sortBy"),e.copyTo("dxfId",G,"sortBy"),e.copyTo("iconSet",G),e.copyTo("customList",G);const o=e.getAttribute("ref");if(o){const e=t.AddressUtils.fastStringToRange(o,rt).colStart,r=t.AddressUtils.fastStringToRange(s.ref,rt),n=r.colStart;i.offset=r?e-n:e}i.reverse=e.getAttribute("descending",_)??!1}}),l.registerVisitor({from:"AlternateContent",to:null});const u=t=>{h=t.getSource(),t.copyTo("topLeft",G,"topLeftCell");const e=st(t.getAttribute("defaultGridColor")),s=t.getAttribute("colorId");null===s||e||(t.getSource().gridLineColor="index"+parseFloat(s)),t.copyTo("showZeros",_),t.copyTo("showFormulas",_),t.copyTo("zoomScale",U),t.copyTo("showRowHeaders",_,"showRowColHeaders"),t.copyTo("showColumnHeaders",_,"showRowColHeaders"),t.copyTo("showRowGridlines",_,"showGridLines"),t.copyTo("showColumnGridlines",_,"showGridLines")};l.registerVisitor({from:"sheetView",to:"view",openTag:t=>{u(t)},closeTag:()=>{h=null}}),l.registerVisitor({from:"customSheetViews",to:"customSheetViews",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"customSheetView",to:[],openTag:t=>{u(t)},closeTag:()=>{h=null}}),l.registerVisitor({from:"selection",to:"selection",openTag:t=>{if(!h)return;t.copyTo("cell",G,"activeCell"),t.copyTo("rangeIndex",U,"activeCellId");const e=t.getAttribute("activeCell"),s=t.getAttribute("sqref");s&&s!==e&&(t.getSource().ranges=s.split(" "))}}),l.registerVisitor({from:"pane",to:"pane",openTag:e=>{if(h&&"frozen"===e.getAttribute("state")){const s={};h.freezePanes=s,e.copyToObject(s,"topLeft",G,"topLeftCell");const i=h.topLeft?t.AddressUtils.fastStringToCell(h.topLeft):{colIndex:0,rowIndex:0},o={colIndex:0,rowIndex:0};e.copyToObject(o,"colIndex",U,"xSplit"),e.copyToObject(o,"rowIndex",U,"ySplit");const r={colIndex:i.colIndex+o.colIndex,rowIndex:i.rowIndex+o.rowIndex};s.coords=t.AddressUtils.cellToString(r)}}}),l.registerVisitor({from:"tabColor",to:null,openTag:t=>{const s=tt(e=>t.getAttribute(e));s&&(e.tabColor=s)}}),l.registerVisitor({from:"pageSetUpPr",to:"pageSetUpPr",openTag:t=>{}}),l.registerVisitor({from:"outlinePr",to:"outlinePr",openTag:t=>{}}),l.registerVisitor({from:"pageMargins",to:"pageMargins",openTag:t=>{}}),l.registerVisitor({from:"pageSetup",to:"pageSetup",openTag:t=>{}}),l.registerVisitor({from:"printOptions",to:"printOptions",openTag:t=>{}}),l.registerVisitor({from:"mergeCells",to:"merges",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"mergeCell",to:[],openTag:t=>{const e=t.getAttribute("ref");t.setSource(e)}}),l.registerVisitor({from:"hyperlinks",to:"hyperlinks",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"hyperlink",to:[],openTag:t=>{const e=t.getAttribute("r:id"),i=t.getAttribute("ref");if(!i)return void console.warn("No ref found for hyperlink");t.setKey(i);let o=e?s(e):"";if("string"!=typeof o)return void console.warn("Invalid address ",o);const r=t.getAttribute("location");o.endsWith("\\")&&(o=o.substring(0,o.length-1));const n=t.getAttribute("location");if(n&&(r&&r!==n&&console.warn("display and location are different",r,n),o+="#"+n),!o)return void console.warn("No address found for hyperlink. r:id",e);let a;const l=t.getAttribute("tooltip");a=l?{address:o,tooltip:l}:o,t.setSource({r:i,v:a})}}),l.registerVisitor({from:"drawing",to:"movables",openTag:t=>{const e=t.getAttribute("r:id");if(!e)return;const i=s(e);i?t.setSource(i.movables):console.warn("no drawing found for rId",e)}}),l.registerVisitor({from:"tableParts",to:"tables",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"tablePart",to:[],openTag:t=>{const e=t.getAttribute("r:id");if(!e)return;const i=s(e);i?t.setSource(i):console.warn("no table found for rId",e)}}),l.registerVisitor({from:"worksheet",to:"worksheet",openTag:t=>{}}),l.registerVisitor({from:"sheetProtection",to:"protection",openTag:t=>{let e=!1;if(t.hasAttribute("sheet")&&_(t.getAttribute("sheet"))&&(e=!0),!e)return void t.setSource(void 0);const s=t=>!0===t||"1"===t||"on"===t||"true"===t||!1===t||"0"===t||"off"===t||"false"===t||null;t.copyTo("autoFilter",s),t.copyTo("deleteColumns",s),t.copyTo("formatCells",s),t.copyTo("formatColumns",s),t.copyTo("formatRows",s),t.copyTo("insertColumns",s),t.copyTo("insertHyperlinks",s),t.copyTo("insertRows",s),t.copyTo("objects",s),t.copyTo("pivotTables",s),t.copyTo("scenarios",s),t.copyTo("selectUnlockedCells",s),t.copyTo("selectUnlockedCells",s),t.copyTo("sort",s);const i={};t.copyToObject(i,"hash",G,"hashValue"),t.copyToObject(i,"algorithm",G,"algorithmName"),t.copyToObject(i,"salt",G,"saltValue"),t.copyToObject(i,"spinCount",U),Object.keys(i).length>0&&(t.getSource().password=i)}}),l.registerVisitor({from:"protectedRanges",to:"protectedRanges",openTag:t=>{t.setSource({})}}),l.registerVisitor({from:"protectedRange",to:{},openTag:t=>{const e=t.getAttribute("sqref");t.setKey(e),t.copyTo("name"),t.copyTo("securityDescriptor");const s={};t.copyToObject(s,"hash",G,"hashValue"),t.copyToObject(s,"algorithm",G,"algorithmName"),t.copyToObject(s,"salt",G,"saltValue"),t.copyToObject(s,"spinCount",U),Object.keys(s).length>0&&(t.getSource().password=s)}}),l.registerVisitor({from:"sheetFormatPr",to:"sheetFormatPr",openTag:t=>{t.copyToObject(e,"defaultColSize",z,"defaultColWidth"),t.copyToObject(e,"outlineLevelCol",U,"outlineLevelCol");const s=t.getAttribute("customHeight");"1"!==s&&"true"!==s||t.copyToObject(e,"defaultRowSize",z,"defaultRowHeight"),t.copyToObject(e,"outlineLevelRow",U,"outlineLevelRow")}}),l.registerVisitor({from:"cols",to:"cols",openTag:t=>{t.setSource([])}}),l.registerVisitor({from:"col",to:[],openTag:t=>{t.copyTo("min",t=>parseInt(t)-1),t.copyTo("max",t=>parseInt(t)-1),t.copyTo("sz",z,"width"),t.copyTo("cs",_,"customWidth"),t.copyTo("h",_,"hidden"),t.copyTo("l",U,"outlineLevel"),t.copyTo("s",U,"style")}}),l.registerVisitor({from:"oleObjects",to:null,openTag:t=>{t.warn("'OLE Objects' are not supported.")}});let d=null;const p={onOpenTag:t=>{null===d&&(d="")},onText:t=>{d+=t},onEnd:()=>{const t=i(d);return d=null,t},onError:t=>{}};return((e,s,i,o,r,n)=>{let a=!1,l=!1,c=[],h=!1,u=null,d=null,p=null,g=null,f=null,m=null;const T=n?.get("richData")??[],y=t.AddressUtils.normalizeA1ToR1C1,b=t.CoordUtils.createConflatingRanges(),x=new Map,w=[];let v=null;const S=t.CoordUtils.createConflatingRanges();let C,k=!1,A=-1,E=-1,D=null,P=null;const I=[];let O=null,V=-2,N=0,L="",R="",$="",F="",M="",j="",H="",X="",B="",W="",q="",_="",U="",z="",G=!0,Z=null;return{...i,onEnd:()=>{I.length>0&&(s.rows=I);let o=b.done(ot);const r=o.length;if(r>0){const e=new Array(r);for(let s=0;s<r;s++){const i=o[s],r=t.AddressUtils.rangeToString(i),n=i.value[1],a=t.AddressUtils.resolveRelativeToA1(n,i.rowStart,i.colStart);e[s]=[r,a]}s.formulas=e}const n=S.done(!0),a=n.length;if(a>0){const e=new Array(a);for(let s=0;s<a;s++){const i=n[s],o=t.AddressUtils.rangeToString(i);e[s]=o}s.volatile=e}if(w.length>0&&(s.dynamicArray=[...w]),c.length>0){c.sort(t.CoordUtils.createRangeComparator(t.IRange.Orientation.Column));const e=[];let i=null,o=-1,r=-1,n=-1,a=-1,l=null;const h=c.length;h>0&&(i=c[0],o=i.colStart,r=i.colEnd,n=i.rowEnd,a=i.value,e.push(i));for(let t=1;t<h;t++)l=c[t],a!==l.value||o!==l.colStart||r!==l.colEnd||n+1!==l.rowEnd?(e.push(l),i=l,o=i.colStart,r=i.colEnd,n=i.rowEnd,a=i.value):(n=l.rowEnd,i.rowEnd=n);let u=[];for(let t=0;t<e.length;t++){const s=e[t];u.push({r:{colStart:s.colStart,colEnd:s.colEnd,rowStart:s.rowStart,rowEnd:s.rowEnd},v:s.value})}s.directStyles=u}const l=e.build();if(l){const t=l.tuples;s.data=t}i?.onEnd?.()},onOpenTag:e=>{let s=e.name;const o=s.indexOf(":");if(-1!==o&&(s=s.slice(o+1)),C){const t=e.attributes;switch(s){case"v":l=!0;break;case"f":switch(t.t??null){case null:case"normal":h=!0;break;case"shared":const e=t.si;d=t.ref,u=e;break;case"array":h=!0,d=t.ref,v=[d,!1];break;case"datatable":h=!0,d=t.ref,h=!0}void 0!==t.ca&&S.append(A,E);break;case"is":return void(k=!0)}return void(k&&r?.onOpenTag(e))}if(a){if("c"===s){C=e;const s=e.attributes.r;E=t.AddressUtils.fastStringToCol(s);const i=e.attributes.t;void 0===i?P=null:(P=i,"str"===P&&(k=!0));let o=e.attributes.s;void 0!==o&&(o=parseInt(o),Z&&Z.value===o&&Z.colEnd+1===E?Z.colEnd=E:(Z={colStart:E,rowStart:A,colEnd:E,rowEnd:A,value:o},c.push(Z)))}}else{if("row"===s){a=!0;const t=e.attributes.r;if(A=parseInt(t)-1,N=0,R=e.attributes.customHeight,void 0!==R&&(N|=it.CustomHeight),R!==B&&(G=!0,B=R),L=e.attributes.ht,void 0!==L&&(N|=it.Ht),L!==X&&(G=!0,X=L),$=e.attributes.hidden,void 0!==$&&(N|=it.Hidden),$!==W&&(G=!0,W=$),M=e.attributes.s,void 0!==M&&(N|=it.S),M!==_&&(G=!0,_=M),F=e.attributes.customFormat,void 0!==F&&(N|=it.CustomFormat),F!==q&&(G=!0,q=F),j=e.attributes.outlineLevel,void 0!==j&&(N|=it.OutlineLevel),j!==U&&(G=!0,U=j),H=e.attributes.collapsed,void 0!==H&&(N|=it.Collapsed),H!==z&&(G=!0,z=H),0!==N)if(V+1!==A||G){const t=void 0!==R&&("1"===R||"true"===R),e=void 0!==F&&("1"===F||"true"===F);O={min:A,max:A,sz:t&&void 0!==L?parseFloat(L):-1,csz:t,h:void 0!==$&&("1"===$||"true"===$),s:t&&void 0!==M&&"0"!==M?parseInt(M):0,cs:e,l:void 0===j||"0"===j?0:parseInt(j),cl:void 0!==H&&("1"===H||"true"===H)},I.push(O)}else O.max=A;return V=A,void(G=!1)}i?.onOpenTag(e)}},onCloseTag:t=>{if(C){let s=t.name;const i=s.indexOf(":");if(-1!==i&&(s=s.slice(i+1)),k)if("is"===s||"v"===s){const t=r?.onEnd();null!==t&&e.addValue(A,E,""+t)}else r?.onCloseTag?.(t);return l&&(l=!1),void("c"===s&&(C=null,k=!1))}if(a)return a=!1,void(Z=null);i?.onCloseTag(t)},onText:s=>{if(s=s.trim(),l){switch(D=null,P){case null:case"n":D=parseFloat(s);break;case"b":D="1"===s||"true"===s;break;case"s":D=s;break;case"e":if("#VALUE!"===s){const e=C.attributes.vm;if(void 0!==e){const s=T[parseInt(e)-1];if(s&&s.isFormulaError){D={t:t.ScalarType.Error,v:s.getCode()};break}}}const e=t.FormulaError.getBuiltInByLabel(s);e?D={t:t.ScalarType.Error,v:e.getCode()}:(D=s,o?.(`Unknown formula error '${s}' in cell ${t.AddressUtils.cellToString({colIndex:E,rowIndex:A})}`));break;case"str":case"inlineStr":k=!0}null!==D&&e.addValue(A,E,D)}if(v&&("e"===P&&(v[1]=!0),w.push(v),v=null),u)if(f===u)g=m;else{if(g=x.get(u),!g){const t=[];p=y(s,A,E,t),g=[p,t,s],x.set(u,g)}f=u,m=g}if(h){const t=[];p=y(s,A,E,t),g=[p,t,s]}if(g)return b.append(A,E,g),g=null,h=!1,u=null,void(d=null);k?r?.onText(s):a||i?.onText(s)}}})(c,e,l.createEventHandler(e,()=>{},n),n,p,a)})(e,(t,e=!1)=>x(t,d,e)??null,E,S,0,t=>{o&&(t=d+": "+t,o?.(t))},f),i=J(d,y),r=await(async(t,e=8388608)=>{await(async()=>{if("undefined"==typeof ReadableStream)if("undefined"==typeof window){const{ReadableStream:t}=await Promise.resolve().then(()=>require("./D_VQzwC1zzTJyKtG.cjs"));globalThis.ReadableStream=t}else console.warn("Browser does not support ReadableStream; consider loading a polyfill.")})();const s=new TextDecoder("utf-8");let i=0;const o=t instanceof Uint8Array?t:new Uint8Array(t);return new ReadableStream({pull(t){if(i>=o.byteLength)return void t.close();const r=o.subarray(i,Math.min(i+e,o.byteLength)),n=s.decode(r,{stream:i+e<o.byteLength});t.enqueue(n),i+=r.length}}).getReader()})(i);try{await W.parseStream(r,s,{xmlns:!1})}catch(t){throw console.warn(`Error parsing sheet: '${d}'`,t),new Error(`Error parsing sheet: '${d}'`,{cause:t})}const n=b(d,c);let a,l=new Map;if(n){const s="http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";let i;n.forEach((t,e)=>{if(t.type===s){const t=x(e,d,!1,c);a=t?.comments,a&&a.forEach(t=>{l.set(t.id,t)})}});const o="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";if(n.forEach((t,e)=>{if(t.type===o){const t=x(e,d,!1,c);i=t}}),i||a){const s=a??[],o=i?.comments;if(o){const e=i?.authors;for(let i=0;i<o.length;i++){const r=o[i];let n=void 0!==r.authorId?e[r.authorId]:void 0;if((!n||n.startsWith("tc="))&&(n=et(n.substring(3)),l.has(n)))continue;let a=D.get(n);a||(a=P.get(n)),a||(a={id:t.CommonUtils.uuidV4(),displayName:n},P.set(a.displayName,a),D.set(a.id,a)),n=a?.id??null;const c={id:t.CommonUtils.uuidV4(),personId:n,ref:r.ref,done:!1,asNote:!0,content:r.content};s.push(c)}}e.comments=s}}};T.push(s())}else C=r?J(d,y,t=>{const e=a.add({buffer:t});return e.addReference(h),g.add(e),l.toResourceId(e)},w):Q(d,y,n,i,w)}return C},w={paramMap:f,getRefs:b,getRef:x,parsedRefs:m,onWarning:o,addPerson:t=>null},v=[];let S=0;s.Strings&&(S=parseInt(s.Strings.Unique??s.Strings.length??0));const C=s.Strings??[];for(let t=0;t<S;t++)v.push(C[t]?.t??"");const k=new Map;let A=S;const E=t=>{const e=k.get(t);if(void 0!==e)return e;const s=A;return k.set(t,A++),v.push(t),s},D=(K("richstructure",s,n,i,w),K("richdata",s,n,i,w),new Map),P=new Map,I=K("people",s,n,i);let O=null;if(I.size>0&&(O=I.entries().next()?.value?.[1]?.persons,O)){const t=O.length;for(let e=0;e<t;e++){const t=O[e];D.set(t.id,t),D.set(t.displayName,t)}}const V=K("themes",s,n,i,w);let N=null;if(V&&V.entries){let t=V.entries().next();t?.value?.[1]&&(N=t.value[1])}const L=new t.Theme(N),R=K("styles",s,n,i,w);let $=R.entries().next()?.value[1];$&&($=JSON.parse(t.JSONStableStringify($)));const F=K("workbooks",s,n,i,w);await Promise.all(T);const M={...F.entries().next().value[1],styles:$,theme:L.toJSON()};v.length>0&&(M.strings=v),O&&O.length>0&&(M.people=O);const j={...r,resources:a,json:M},H=new t.Workbook(j);return g.forEach(t=>{t.deleteReference(h)}),l.endPersist(),H}catch(e){let s="Unable to parse XLSX.";throw e instanceof t.OutOfBoundsError&&(s="Unable to open XLSX. There are too many rows or columns."),new Error(s,{cause:e})}},toBufferXLSX:async(e,s)=>{const i=await Promise.resolve().then(()=>require("./DAHpsyykuPBkoh-Z.cjs")),o=await e.toJSON(!0),r=i.utils.book_new();for(let s=0;s<o.sheets.length;s++){const n=o.sheets[s],a=i.utils.json_to_sheet([{}]);i.utils.book_append_sheet(r,a,n.name);const l=n.sheet,c=e.getSheetAt(s),h=c.getUsedRange();if(h?(a["!ref"]=h.getA1(),h.forEach((e,s)=>{const i={t:"z"},o=s.getCell().getStyle();if(!o.isNormal()){let e=o.getNumberFormat();e!==t.NumberFormat.Type.General&&(e===t.NumberFormat.Type.ShortDate?e="m/d/yyyy":e===t.NumberFormat.Type.MediumDate?e="d-mmm-yy":e===t.NumberFormat.Type.LongDate?e="[$-x-sysdate]dddd, mmmm dd, yyyy":e===t.NumberFormat.Type.ShortTime?e="h:mm":e===t.NumberFormat.Type.MediumTime?e="h:mm AM/PM":e===t.NumberFormat.Type.LongTime&&(e="h:mm:ss AM/PM"),i.z=e)}if(null!==e)switch(s.getType()){case t.ScalarType.Number:i.t="n",i.v=e;break;case t.ScalarType.String:i.t="s",i.v=e;break;case t.ScalarType.Boolean:i.t="b",i.v=e;break;case t.ScalarType.Error:i.t="e",i.v=e.toString();case t.ScalarType.RichData:}a[s.getA1()]=i})):a["!ref"]="A1:A1",l.merges?.length>0){const t=[];a["!merges"]=t;for(let e=0;e<l.merges.length;e++)t.push(i.utils.decode_range(l.merges[e]))}if(l.cols?.length>0){const t=[];a["!cols"]=t;const e=l.cols,s={width:l.defaultColSize??c.getColumnWidthAsFontUnit(c.getColumnHeaders().getDefaultSize())};for(let i=0;i<e.length;i++){const o=e[i];for(let e=t.length;e<=o.min-1;e++)t.push(s);const r={};void 0!==o.sz&&(r.width=o.sz),void 0!==o.h&&(r.hidden=o.h),void 0!==o.l&&(r.level=o.l);for(let e=o.min;e<=o.max;e++)t.push(r)}}}return i.write(r,{type:"array",bookType:"xlsx"}),i.write(r,{type:"array",bookType:"xlsx"})}},Symbol.toStringTag,{value:"Module"}));exports.a=t=>parseFloat(t)/1e3,exports.b=st,exports.c=t=>t?e._n.roundAccurately(parseFloat(t)/9525,1):null,exports.d=tt,exports.i=nt,exports.p=t=>parseFloat(t)/6e4,exports.r=et,exports.t=t=>t?e._n.roundAccurately(parseFloat(t)/12700,4):null;
|