@sheetxl/studio-vanilla 0.1.98
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/LICENSE.md +11 -0
- package/README.md +100 -0
- package/build/browser/cjs/1q6_3-jGNZllbF3R.cjs +6 -0
- package/build/browser/cjs/5KDindu3wyLVvG7F.cjs +6 -0
- package/build/browser/cjs/87m5i_TKPbDn6tke.cjs +30 -0
- package/build/browser/cjs/B0L2YQ9agsyHWOu2.cjs +6 -0
- package/build/browser/cjs/B3HvYH5kqySWdJ0f.cjs +6 -0
- package/build/browser/cjs/B6AOUko0HYRy2MPw.cjs +6 -0
- package/build/browser/cjs/BC5MKXBhHGdPeiJ3.cjs +21 -0
- package/build/browser/cjs/BG0RxkPyZY6Be7Lk.cjs +6 -0
- package/build/browser/cjs/BJsJYwvFiJBFxTov.cjs +6 -0
- package/build/browser/cjs/BMVMyi5NiMBuQrl9.cjs +52 -0
- package/build/browser/cjs/BS_QXQWoKRl_7MiR.cjs +17 -0
- package/build/browser/cjs/BZPhmHWsFBTIA3BQ.cjs +210 -0
- package/build/browser/cjs/B_5ro-VEKfZDMSn_.cjs +6 -0
- package/build/browser/cjs/B_c3i0fXSlX7dH12.cjs +1521 -0
- package/build/browser/cjs/BarieqwSecnaFn0d.cjs +6 -0
- package/build/browser/cjs/BfNo_1u55uW2HhAa.cjs +6 -0
- package/build/browser/cjs/Bl6FyLoMkFiQqhvc.cjs +7 -0
- package/build/browser/cjs/Bsyzteo6tD31A45e.cjs +11 -0
- package/build/browser/cjs/Btzizuqo7zQ_grdS.cjs +16 -0
- package/build/browser/cjs/BxBOlXY9P3Ymi6oT.cjs +6 -0
- package/build/browser/cjs/C0AP85yKTJU5XzPW.cjs +6 -0
- package/build/browser/cjs/C0Pjx18ua-OCdtpy.cjs +6 -0
- package/build/browser/cjs/CA2wSX6txFrM5nXD.cjs +6 -0
- package/build/browser/cjs/CB3jEtNo5ZsjfE5p.cjs +6 -0
- package/build/browser/cjs/CDiYZ1cSoLW8U5Mz.cjs +6 -0
- package/build/browser/cjs/CHD5c5FdcMm6vLyG.cjs +155 -0
- package/build/browser/cjs/COCpf8tSdkj2O19V.cjs +134 -0
- package/build/browser/cjs/CTV1KRGhkieiY4Rf.cjs +42 -0
- package/build/browser/cjs/CUw8AoM-rVbp1W3s.cjs +6 -0
- package/build/browser/cjs/CVTydWBioXRZeoNf.cjs +6 -0
- package/build/browser/cjs/C_uXPPlfjY68-QA8.cjs +6 -0
- package/build/browser/cjs/CaNR-X0TWW9OF1S0.cjs +33 -0
- package/build/browser/cjs/CiySKEsfDr8XnkZh.cjs +6 -0
- package/build/browser/cjs/CtBikymnhpcCzP3X.cjs +6 -0
- package/build/browser/cjs/CyF7bxA0DO13ETpx.cjs +30 -0
- package/build/browser/cjs/D-vkFAlNHXwUvmUT.cjs +16 -0
- package/build/browser/cjs/D2OU29-ZPOAWFVJB.cjs +22 -0
- package/build/browser/cjs/DFX31uXp449or-Xs.cjs +6 -0
- package/build/browser/cjs/DLqNXuHYff_kQuj1.cjs +6 -0
- package/build/browser/cjs/DMKZDMHHXLePvLy3.cjs +524 -0
- package/build/browser/cjs/DP8biA0GQqyPKLyq.cjs +6 -0
- package/build/browser/cjs/DcYrNx0uy99yQNMl.cjs +21 -0
- package/build/browser/cjs/Dcyg_YxTfBgi_6cp.cjs +26 -0
- package/build/browser/cjs/DeR9YbwO2xDBKVWN.cjs +21 -0
- package/build/browser/cjs/DfNbgyjaLMn81dqP.cjs +6 -0
- package/build/browser/cjs/DirazCTz5IsFWrUv.cjs +22 -0
- package/build/browser/cjs/Dix4vuDuOzj4WGCJ.cjs +19 -0
- package/build/browser/cjs/DqbTRjj97q78RuGC.cjs +6 -0
- package/build/browser/cjs/Dy28YI90qj65PHFO.cjs +17 -0
- package/build/browser/cjs/Nkl33Tt1_oEy9kjk.cjs +6 -0
- package/build/browser/cjs/S1S-AvD0w8s-LV8O.cjs +6 -0
- package/build/browser/cjs/bnPgbgGBTq7DESzd.cjs +6 -0
- package/build/browser/cjs/d9tJGmGw-3KZjpAx.cjs +17 -0
- package/build/browser/cjs/dke2gbIUS44QXwEl.cjs +6 -0
- package/build/browser/cjs/index.cjs +6 -0
- package/build/browser/cjs/mPpQR06-jf99r2jM.cjs +6 -0
- package/build/browser/cjs/wq0Sm3fu9rxt43OK.cjs +6 -0
- package/build/browser/cjs/xM54FRmGddZFVTTI.cjs +6 -0
- package/build/browser/cjs/xgGpGg5b8fu3GAnL.cjs +33 -0
- package/build/browser/esm/1Jl9rrRJdbPsUP_1.mjs +13222 -0
- package/build/browser/esm/3RX6dP_O-47yXKHQ.mjs +1492 -0
- package/build/browser/esm/5F5MTh8R-sIiPq0h.mjs +22 -0
- package/build/browser/esm/B3_l6_TLa9ImyRmW.mjs +5572 -0
- package/build/browser/esm/B7odLLxNfEmKGWX6.mjs +49 -0
- package/build/browser/esm/BAjCWyggrIkCz6wr.mjs +22 -0
- package/build/browser/esm/BE4io65W825i_dzC.mjs +58 -0
- package/build/browser/esm/BEZ41ST3hkC4W-_9.mjs +22 -0
- package/build/browser/esm/BKkD05hqNTBap4Oc.mjs +22 -0
- package/build/browser/esm/BOiR2dTlvcgYjz8P.mjs +402 -0
- package/build/browser/esm/BOjAZRs_NVerYv4t.mjs +22 -0
- package/build/browser/esm/BRkMPyIUXMixnL8d.mjs +22 -0
- package/build/browser/esm/BSS_RvWzDRX8_EJd.mjs +1684 -0
- package/build/browser/esm/BXC9rQVV2gq5x8br.mjs +22 -0
- package/build/browser/esm/BYmMkbrRTsNuR3aY.mjs +1358 -0
- package/build/browser/esm/BaSzK17p3_gCvNVV.mjs +24 -0
- package/build/browser/esm/BdtlmF31h4Y7RgUj.mjs +22 -0
- package/build/browser/esm/Be3zRnYQ13HUcsRW.mjs +150 -0
- package/build/browser/esm/BiSk8LRROMF0Bl4-.mjs +92 -0
- package/build/browser/esm/BlfHOASL_bJ6Hy0y.mjs +40 -0
- package/build/browser/esm/C-jC-wgAoMOxrVvv.mjs +1377 -0
- package/build/browser/esm/C0Lw5hMgKbooA6Jl.mjs +22 -0
- package/build/browser/esm/C32FpMEFLbDnBtO3.mjs +22 -0
- package/build/browser/esm/C9uN8RnLjnGSimTA.mjs +439 -0
- package/build/browser/esm/CB0UHheTgg0735hj.mjs +52 -0
- package/build/browser/esm/CU55zbw8Xbwap6Tl.mjs +22 -0
- package/build/browser/esm/CWRCdxOg103AFis3.mjs +3926 -0
- package/build/browser/esm/CpJdzwQYkBw7IPnN.mjs +22 -0
- package/build/browser/esm/CprFmxuwGvaUtLG2.mjs +22 -0
- package/build/browser/esm/CtZxtE4tRmMGFT5o.mjs +22 -0
- package/build/browser/esm/D-Oj36iQScXAKSMA.mjs +53 -0
- package/build/browser/esm/D2yyUr4KbJEFsxKC.mjs +21 -0
- package/build/browser/esm/D8HF2X8hvAkV29oq.mjs +55 -0
- package/build/browser/esm/DCauh523moR7slpq.mjs +22 -0
- package/build/browser/esm/DIA-Gy5mdjefjUaA.mjs +22 -0
- package/build/browser/esm/DJjdfX9aUyVGMkri.mjs +47 -0
- package/build/browser/esm/DMWb8cCaNVRcm-tT.mjs +2352 -0
- package/build/browser/esm/DP7HVKT0w_4L2vMQ.mjs +844 -0
- package/build/browser/esm/DToiYU1jffn1g7TH.mjs +639 -0
- package/build/browser/esm/DgSuz0WKGy36a2cp.mjs +22 -0
- package/build/browser/esm/Dgw3FTbNKuo2CIxP.mjs +22 -0
- package/build/browser/esm/DnV_Y9xoMPSav0-o.mjs +56 -0
- package/build/browser/esm/Do7pHqmnwO45_ymt.mjs +22 -0
- package/build/browser/esm/DqvZDTDIyX-qv4r9.mjs +29 -0
- package/build/browser/esm/Ds8V__cRAClpmjZn.mjs +1714 -0
- package/build/browser/esm/DtQdtXJDZgNEIz9d.mjs +440 -0
- package/build/browser/esm/DtpBQqwK7XXBMTB-.mjs +1598 -0
- package/build/browser/esm/DuzJ1k0LbZ29l8oN.mjs +945 -0
- package/build/browser/esm/Dxl4WJXcEhDAw_yE.mjs +42 -0
- package/build/browser/esm/LblYfFi1ns9H1ueN.mjs +28 -0
- package/build/browser/esm/NBkvFJzfLU32Pkup.mjs +496 -0
- package/build/browser/esm/SrBQAOpMKiDW0mGB.mjs +22 -0
- package/build/browser/esm/VLa1cYMb7h6UD253.mjs +64 -0
- package/build/browser/esm/YOEDF-U1QTzbXeMV.mjs +3826 -0
- package/build/browser/esm/a3tuiJ83MwzLMWaL.mjs +22 -0
- package/build/browser/esm/ai2Jw3PRL29E1T8h.mjs +22 -0
- package/build/browser/esm/ajBoEmoL9hCBQYYm.mjs +2175 -0
- package/build/browser/esm/index.mjs +13 -0
- package/build/browser/esm/k9kWmEk0ZT8y9Gii.mjs +48740 -0
- package/build/cdn/assets/1Jl9rrRJdbPsUP_1.js +13222 -0
- package/build/cdn/assets/4u46flV9M6Bwb7d3.js +29 -0
- package/build/cdn/assets/5F5MTh8R-sIiPq0h.js +22 -0
- package/build/cdn/assets/B3oMCEEls1lRVrGd.js +5572 -0
- package/build/cdn/assets/B4QYfmNd300iFLAx.js +945 -0
- package/build/cdn/assets/BAjCWyggrIkCz6wr.js +22 -0
- package/build/cdn/assets/BEZ41ST3hkC4W-_9.js +22 -0
- package/build/cdn/assets/BJIsFTUdHtUKsFJs.js +28 -0
- package/build/cdn/assets/BKkD05hqNTBap4Oc.js +22 -0
- package/build/cdn/assets/BOiR2dTlvcgYjz8P.js +402 -0
- package/build/cdn/assets/BOjAZRs_NVerYv4t.js +22 -0
- package/build/cdn/assets/BPFW3UexkNNh1lLK.js +2352 -0
- package/build/cdn/assets/BRkMPyIUXMixnL8d.js +22 -0
- package/build/cdn/assets/BSS_RvWzDRX8_EJd.js +1684 -0
- package/build/cdn/assets/BXC9rQVV2gq5x8br.js +22 -0
- package/build/cdn/assets/BY2sO3ExW1ShzKnX.js +1714 -0
- package/build/cdn/assets/BYmMkbrRTsNuR3aY.js +1358 -0
- package/build/cdn/assets/BaSzK17p3_gCvNVV.js +24 -0
- package/build/cdn/assets/BbpmcI-KEp3PqrdL.js +496 -0
- package/build/cdn/assets/BdtlmF31h4Y7RgUj.js +22 -0
- package/build/cdn/assets/BjgtkLR9U00HgSRn.js +58 -0
- package/build/cdn/assets/BlfHOASL_bJ6Hy0y.js +40 -0
- package/build/cdn/assets/C-jC-wgAoMOxrVvv.js +1377 -0
- package/build/cdn/assets/C0Lw5hMgKbooA6Jl.js +22 -0
- package/build/cdn/assets/C32FpMEFLbDnBtO3.js +22 -0
- package/build/cdn/assets/C7CDwp-nhN2WFzUs.js +844 -0
- package/build/cdn/assets/C9uN8RnLjnGSimTA.js +439 -0
- package/build/cdn/assets/CEq_C1Sim0pQ6fj0.js +56 -0
- package/build/cdn/assets/CLdcRW7BQK3JCguC.js +48587 -0
- package/build/cdn/assets/CU55zbw8Xbwap6Tl.js +22 -0
- package/build/cdn/assets/C_L_pvQemfhI00iS.js +150 -0
- package/build/cdn/assets/CkhSGQneqlTRflfQ.js +47 -0
- package/build/cdn/assets/CpJdzwQYkBw7IPnN.js +22 -0
- package/build/cdn/assets/CprFmxuwGvaUtLG2.js +22 -0
- package/build/cdn/assets/CtZxtE4tRmMGFT5o.js +22 -0
- package/build/cdn/assets/CvbyGDitUPabmYBl.js +64 -0
- package/build/cdn/assets/D06aHumWZLILF489.js +3926 -0
- package/build/cdn/assets/D2pceTwrS_dagByu.js +21 -0
- package/build/cdn/assets/D4ZBjoUG2QO1RO3t.js +1492 -0
- package/build/cdn/assets/DARyg_kqL8Eu81Fa.js +2175 -0
- package/build/cdn/assets/DCauh523moR7slpq.js +22 -0
- package/build/cdn/assets/DIA-Gy5mdjefjUaA.js +22 -0
- package/build/cdn/assets/DLHK1pMyNN3B2g-j.js +52 -0
- package/build/cdn/assets/DMoEzt3UKZedfext.js +1598 -0
- package/build/cdn/assets/DMwOymY267-LxmJ_.js +49 -0
- package/build/cdn/assets/DToiYU1jffn1g7TH.js +639 -0
- package/build/cdn/assets/DUUO52IRQCve_iCM.js +440 -0
- package/build/cdn/assets/DgSuz0WKGy36a2cp.js +22 -0
- package/build/cdn/assets/Dgw3FTbNKuo2CIxP.js +22 -0
- package/build/cdn/assets/Do7pHqmnwO45_ymt.js +22 -0
- package/build/cdn/assets/Dxl4WJXcEhDAw_yE.js +42 -0
- package/build/cdn/assets/QXzPuadwi3BBJC2-.js +53 -0
- package/build/cdn/assets/SrBQAOpMKiDW0mGB.js +22 -0
- package/build/cdn/assets/W3SqjN4yIzwYTvvj.js +55 -0
- package/build/cdn/assets/YOEDF-U1QTzbXeMV.js +3826 -0
- package/build/cdn/assets/a3tuiJ83MwzLMWaL.js +22 -0
- package/build/cdn/assets/ai2Jw3PRL29E1T8h.js +22 -0
- package/build/cdn/assets/fWcbv7BXhriCYeod.js +92 -0
- package/build/cdn/index.js +171 -0
- package/build/cdn/loader.js +6 -0
- package/build/licenses/dependencies.txt +1 -0
- package/build/package.json +61 -0
- package/build/types/index.d.ts +151 -0
- package/package.json +92 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.0.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./DMKZDMHHXLePvLy3.cjs"),g=require("./xgGpGg5b8fu3GAnL.cjs");/**
|
|
7
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
|
|
8
|
+
*
|
|
9
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
11
|
+
*//**
|
|
12
|
+
* @license @sheetxl/io - IO - Import/Export Libraries for SheetXL. - v0.0.0
|
|
13
|
+
*
|
|
14
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
15
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
16
|
+
*/class z{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let s=0;s<this.list.length;s++)t(this.list[s],s,this)}}const G=u=>u===!0||u==="1"||u==="on"||u==="true"||u!==!1&&u!=="0"&&u!=="off"&&u!=="false"&&null,W=u=>{const t=parseInt(u);return isNaN(t)?null:t},X=u=>{const t=parseFloat(u);return isNaN(t)?null:t},$=new Map;class S{constructor(t,e,s,r,o,i=null,n){const l=(c,h,d)=>n?.getRef?.(c,h,d,n?.parsedRefs),a=c=>n?.getRefs?.(c,n?.parsedRefs);this._parent=t,this.sharedShared=e,this.currentPath=s,this.elemRoot=r,this.jsonRoot=o,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs):(i&&(this._fileLocation=i),l&&a&&(this._getRef=l),a&&(this._getRefs=a),this._onWarning=n?.onWarning,this._addPerson=n?.addPerson)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??$}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let s=[e];const r=t.split("/");for(let o=0;o<r.length;o++){const i=r[o];if(i===""||i===".")continue;let n=[];for(let l=0;l<s.length;l++){const a=s[l],c=a.childNodes;for(let h=0;c&&h<c.length;h++){const d=a.childNodes[h];d.localName!==i&&i!=="*"||n.push(d)}}s=n}return s.length===1?s[0]:s.length===0?null:new z(s)}getFromPath(t,e){return p.dn.getFromPath(t,e)}setToPath(t,e,s){return p.dn.setToPath(t,e,s)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return o==null?s:o==="1"||o==="on"||o==="true"||o!=="0"&&o!=="off"&&o!=="false"&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return G}get INT_COPY(){return W}get FLOAT_COPY(){return X}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o){if(Array.isArray(o)){for(let n=0;n<o.length;n++)if(i==null||(i=o[n](i),i==null))return}else if(i==null||(i=o(i),i==null))return}this.setToPath(s,r,i)}}class V{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class K{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);i.nodeType===1&&i.localName==="Relationship"&&this.processRelationship(t,i,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const D=(u,t)=>{if(u||!u.hasAttribute("rot"))return;const e=u.getAttribute("rot"),s=p.dn.roundAccurately(g.p(e),2);s!==-1e3&&(t.rotation=s)},f=(u,t,e,s,r)=>{const o=u.getValAttrAsString(s,t);o!==null&&(e[r]=o)},A=(u,t,e,s,r=s,o=null)=>{const i=u.getValAttrAsBoolean(s,t,o);i!==null&&(e[r]=i)},C=(u,t,e,s,r)=>{const o=u.getValAttrAsInteger(s,t);o!==null&&(e[r]=o)},y=(u,t,e,s,r,o=1)=>{const i=u.getValAttrAsFloat(s,t);i!==null&&(e[r]=i*o)};class q{visit(t,e,s){return A(t,e,s,"roundedCorners","roundedCorners"),C(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let m=0;m<c.length;m++){const b=c[m];if(b.xAxisId){const v=b.xAxisId,P=a.get(v);o[m+""]=P,b.offsetXAxis=m,delete b.xAxisId,s.xAxes=o,o.length=++i}if(b.yAxisId){const v=b.yAxisId,P=a.get(v);n[m+""]=P,b.offsetYAxis=m,delete b.yAxisId,s.yAxes=n,n.length=++l}r[m+""]=b}r.length=c.length;const h=t.getVisitorParamsState().get("series");if(!h||h.length===0)return;const d={};s.series=d;for(let m=0;m<h.length;m++)d[m+""]=h[m];d.length=h.length}}class H{visit(t,e,s){return A(t,e,s,"plotVisOnly","plotVisOnly"),f(t,e,s,"dispBlanksAs","dispBlanksAs"),A(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),A(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(r===!0||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",i!==null)}catch(r){throw new Error("Unexpected Error parsing Chart: "+r)}}}class J{visit(t,e,s){let r={};return s.plotArea=r,r}}class O{EnumMappings(){}static fromOoxmlGradientType(t){return t==="circle"?"radial":t}static fromOoxmlLineCap(t){if(t==="rnd")return"round";if(t==="flat")return"butt";if(t==="sq")return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return t==="sng"?"single":t}static fromOoxmlAlignment(t){return t==="ctr"?"center":t}}class Y{visit(t,e,s){}processStroke(t,e,s){const r={},o=t.evaluate("ln",e);if(o){o.hasAttribute("algn")&&(r.align=O.fromOoxmlAlignment(o.getAttribute("algn"))),o.hasAttribute("cap")&&(r.lineCap=O.fromOoxmlLineCap(o.getAttribute("cap"))),o.hasAttribute("cmpd")&&(r.compound=O.fromOoxmlCompound(o.getAttribute("cmpd"))),o.hasAttribute("w")&&(r.width=g.t(o.getAttribute("w")));const i=t.evaluate("miter",o);i&&(r.lineJoin="miter",i.hasAttribute("lim")&&(r.miter=parseFloat(i.getAttribute("lim")))),t.evaluate("bevel",o)&&(r.lineJoin="bevel"),t.evaluate("round",o)&&(r.lineJoin="round");const n=t.evaluate("custDash",o);if(n){const c=t.evaluate("ds",n);if(c&&c.length>0){let h="";for(let d=0;d<c.length;d++){const m=c.item(d);h+=g.a(m.getAttribute("d"))+","+g.a(m.getAttribute("sp"))}r.dash=h}}const l=t.evaluate("prstDash",o);l&&l.hasAttribute("val")&&(r.dash=l.getAttribute("val")),this.parseEndElement(t,o,r,"headEnd","head"),this.parseEndElement(t,o,r,"tailEnd","tail");const a=this.processFill(t,o,s);r.fill=a}return r}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const n=i.getAttribute("len")?i.getAttribute("len"):"med",l=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=n+"-"+l}}processFill(t,e,s){const r={};if(t.evaluate("noFill",e))return r.none=!0,r;const o=t.evaluate("solidFill",e);if(o){const a=this.processAdjColor(t,o);return a&&(r.solid=a),r}const i=t.evaluate("gradFill",e);if(i){i.hasAttribute("rotWithShape")&&(r.isRotated=i.getAttribute("rotWithShape")==="1");const a=this.processGradFill(t,i);return r.gradient=a,r}const n=t.evaluate("pattFill",e);if(n){const a=this.processPatternFill(t,n);return r.pattern=a,r}const l=t.evaluate("blipFill",e);if(l){l.hasAttribute("rotWithShape")&&(r.isRotated=g.b(l.getAttribute("rotWithShape"))),l.hasAttribute("dpi")&&(r.dpi=l.getAttribute("dpi"));const a=this.processImageFill(t,l);return r.image=a,r}return r.none=!0,r}processGradFill(t,e){const s={},r=t.evaluate("lin",e);if(r){if(s.type="linear",r.hasAttribute("ang")){const c=g.p(r.getAttribute("ang"));s.angle=c}if(r.hasAttribute("scaled")){const c=g.b(r.getAttribute("scaled"));s.scaled=c}}const o={};e.hasAttribute("flip")&&(o.mirror=e.getAttribute("flip")),Object.keys(o).length>0&&(s.tile=o);const i=t.evaluate("path",e);if(i){i.hasAttribute("path")&&(s.type=O.fromOoxmlGradientType(i.getAttribute("path")));const c=t.evaluate("fillToRect",i);c&&(s.fillTo=this.getRect(c))}const n=t.evaluate("tileRect",e);n&&(s.tile.bounds=this.getRect(n));const l=[],a=t.evaluate("gsLst/gs",e);for(let c=0;a&&c<a.length;c++){const h=a.item(c),d={offset:g.a(h.getAttribute("pos")),color:this.processAdjColor(t,h)};l.push(d)}return l.length>0&&(s.stops=l),s}getRect(t){const e={};return t.hasAttribute("t")&&(e.t=g.a(t.getAttribute("t"))),t.hasAttribute("l")&&(e.l=g.a(t.getAttribute("l"))),t.hasAttribute("b")&&(e.b=g.a(t.getAttribute("b"))),t.hasAttribute("r")&&(e.r=g.a(t.getAttribute("r"))),Object.keys(e).length===0?null:e}processImageFill(t,e){return{ref:"https://cdn.sheetxl.com/public/logo-color-square-onwhite.png",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const n=this.processAdjColor(t,o);n&&(s.background=n)}const i=t.evaluate("fgClr",e);if(i){let n=this.processAdjColor(t,i);n&&(s.foreground=n)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,e){let s="lrgba("+g.a(e.getAttribute("r"))+","+g.a(e.getAttribute("g"))+","+g.a(e.getAttribute("b"))+")";return s+=this.processAdjustments(t,e),s}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,e){let s="hsl("+g.p(e.getAttribute("hue"))+","+g.a(e.getAttribute("sat"))+","+g.a(e.getAttribute("lum"))+")";return s+=this.processAdjustments(t,e),s}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1){let n=i.localName;s+=n==="hue"||n==="hueOff"||n==="hueMod"?this.processAdjustmentElement(t,e,n,6e4):n==="gray"||n==="comp"||n==="inv"||n==="gamma"||n==="invGamma"?this.processAdjustmentElement(t,e,n,1):this.processAdjustmentElement(t,e,n)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class L extends Y{visit(t,e,s){try{const r=t.evaluate("xfrm",e);if(r){D(r,s);const l={x:0,y:0,width:0,height:0},a=t.evaluate("off",r);a&&(l.x=g.c(a.getAttribute("x"))??0,l.y=g.c(a.getAttribute("y"))??0);const c=t.evaluate("ext",r);a&&(l.width=g.c(c.getAttribute("cx"))??0,l.height=g.c(c.getAttribute("cy"))??0),s.bounds=l}const o=t.evaluate("prstGeom",e);o?.hasAttribute("prst")?s.geometry=o?.getAttribute("prst"):t.evaluate("customGeom",e)&&console.warn("customGeom not supported yet");const i=this.processFill(t,e,s);i&&Object.keys(i).length>0&&(s.fill=i);const n=this.processStroke(t,e,s);return n&&Object.keys(n).length>0&&(s.stroke=n),s}catch(r){throw console.warn(r),new Error("Unexpected Error parsing Shape Properties element")}}}class N{visit(t,e,s){let r={};if(f(t,e,r,"grouping","grouping"),A(t,e,r,"varyColors","varyColors"),y(t,e,r,"gapWidth","gapWidth",.01),y(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),C(t,e,r,"bubbleScale","bubbleScale"),A(t,e,r,"showNegBubbles","showNegativeBubbleValues"),A(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),C(t,e,r,"firstSliceAng","startAngle"),C(t,e,r,"holeSize","holeSize"),f(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let o=t.getVisitorParamsState().get("types");o||(o=[],t.getVisitorParamsState().set("types",o)),o.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(r.length===0)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class Q extends N{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type=r==="col"?"column":"bar")}}class w{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);i!==null&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),n===!0?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(A(t,e,r,"showBubbleSize","showBubbleSize"),A(t,e,r,"showCatName","showCatName"),A(t,e,r,"showLeaderLines","showLeaderLines"),A(t,e,r,"showPercent","showPercentage"),A(t,e,r,"showSerName","showSerName"),A(t,e,r,"showVal","showVal"),A(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return l!==null&&(r.separator=l.textContent),f(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const o=r.getAttribute("formatCode");s.formatCode=o,r.hasAttribute("sourceLinked")&&(s.sourceLinked=r.getAttribute("sourceLinked")==="1")}}}const M=(u,t,e)=>{if(u.getValAttrAsBoolean("invertIfNegative",t)===!0)if(u.evaluate("extLst/ext/invertSolidFillFmt",t)){if(e.fill&&e.fillNegative){const s=u.getFromPath(e,"fill.solid.adjs");s&&u.setToPath(e,"fillNegative.solid.adjs",s)}}else{const s={val:"FFFFFF"},r={};r.solid=s,e.fillNegative=r;const o={val:"000000"},i={};i.solid=o;const n={};n.fill=i,e.strokeNegative=n}};class Z{visit(t,e,s){const r={};C(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;o!==null&&o.firstChild!==null&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),i!==null&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),n!==null&&(l=this.parsePointsAsString(t,n))),l!==null&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),C(t,e,r,"idx","idx"),A(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(r!==null){const o=r.firstChild.nodeValue;t.setToPath(s,"title.range",o)}else{const o=t.evaluate("tx/v",e);o!==null&&t.setToPath(s,"title.text.simpleRun",o.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let n=0;o&&r&&n<r;n++){let l=null,a=t.evaluate("pt[@idx='"+n+"']/v",e);a instanceof Node&&(l=a.textContent),i[n]=l}for(let n=0;n<i.length;n++)n>0&&(s+=","),i[n]!==void 0&&(s+=i[n]);return s+="}",s}afterVisit(t,e,s){M(t,e,s);let r=t.getFromPath(s,"points");if(r){const o=Object.keys(r);for(let i=0;i<o.length;i++){const n=o[i],l=t.getFromPath(r,n);if(!l)continue;let a=t.getFromPath(l,"markers");a&&(t.setToPath(s,"markers.points."+n,a),delete l.markers)}}}}class tt{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return n!==null&&(o[n]=i),A(t,e,i,"bubble3D","bubble3D"),C(t,e,i,"explosion","explosion"),M(t,e,i),i}}class et{visit(t,e,s){const r=e.parentNode.localName;if(r==="ser"||r==="dPt"){const o={},i=t.getValAttrAsString("size",e);i!==null&&(o.size=i);const n=t.getValAttrAsString("symbol",e);return n&&(o.type=n),s.markers=o,o}return null}}class k{visit(t,e,s){let r={};this.parseScaling(t,e,r),y(t,e,r,"majorUnit","majorUnits"),y(t,e,r,"minorUnit","minorUnits"),A(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),f(t,e,r,"majorTickMark","majorTickMarks"),f(t,e,r,"minorTickMark","minorTickMarks"),f(t,e,r,"crosses","crosses"),y(t,e,r,"crossesAt","crosses"),f(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),C(t,e,r,"lblOffset","labelOffset"),f(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=o!==null&&o===0,C(t,e,r,"tickMarkSkip","tickMarkSkip"),C(t,e,r,"tickLblSkip","labelInterval"),this.parseDisplayCustOrBuiltInUnit(e,t,r),this.parseTimeUnits(t,e,r,"majorUnitDates","majorTimeUnit","majorUnit"),this.parseTimeUnits(t,e,r,"minorUnitDates","minorTimeUnit","minorUnit"),f(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(l!==null){n.dem=l;let a=t.getValAttrAsString(i,e);n.amt=a}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);r!==null&&(r==="ctr"?s.labelAlign="center":r==="l"?s.labelAlign="left":r==="r"&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);r!==null&&(r==="b"?s.orientation="bottom":r==="l"?s.orientation="left":r==="r"?s.orientation="right":r==="t"&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);o!==null&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked=o.getAttribute("sourceLinked")==="1")),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);r!==null&&(s.inverted=r!=="minMax");const o=t.getValAttrAsFloat("scaling/logBase",e);o!==null&&(s.logBase=o,s.scaleType="log"),y(t,e,s,"scaling/max","max"),y(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);r!==null&&(t.setToPath(s,"labels.shown",r!==!0),t.setToPath(s,"shown",r!==!0));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",i!==null);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",n!==null);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",l!==null)}}class F{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),new L().visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=c=>{const h={};let d=t.evaluate("t",c);const m=t.evaluate("rPr",c);m&&this.parseTextProperties(t,m,h),d?h.text=d.firstChild.textContent??"":c.textContent&&(h.text=c.textContent??""),i.push(h)};if(n?.length!==void 0)for(let c=0;n&&c<n.length;c++)l(n.item(c));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&D(a,s)}parseTextProperties(t,e,s){if(!e)return;e.hasAttribute("sz")&&(s.size=parseFloat(e.getAttribute("sz"))/100),e.hasAttribute("b")&&(s.weight=e.getAttribute("b")==="1"?700:400),e.hasAttribute("i")&&(s.italic=e.getAttribute("i")==="1"),e.hasAttribute("u")&&(s.underline=e.getAttribute("u")),e.hasAttribute("strike")&&(s.strike=e.getAttribute("strike"));const r=t.evaluate("latin",e);if(r&&!r.getAttribute("typeface").startsWith("+")){const o=s.font??{};if(r.hasAttribute("typeface")&&(o.family=r.getAttribute("typeface")),r.hasAttribute("panose")){const i=r.getAttribute("panose");i&&(o.fallbacks=[p.ct.getPanoseFallback(i)])}r.hasAttribute("pitchFamily")&&(o.pitch=r.getAttribute("pitchFamily")),r.hasAttribute("charset")&&(o.charset=r.getAttribute("charset")),Object.keys(o).length>0&&(s.font=o)}}}class rt{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let o=t.getFromPath(r,"title");o||(o={},t.setToPath(r,"title",o));let i=o,n=t.getValAttrAsBoolean("delete",e);return n!==null&&(i.shown=!n),i}return s}}class st{visit(t,e,s){const r={};return A(t,e,r,"overlay","overlay"),f(t,e,r,"legendPos","position"),s.legend=r,r}}class ot extends L{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class E extends F{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const o=r.firstElementChild.nodeValue;t.setToPath(s,"range",o)}}visit(t,e,s){const r={};A(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const r=s.text?.rotation??null;r!==null&&(s.rotation=parseInt(r),delete s.title.rotation)}}}class it{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let o={};y(t,r,o,"x","x"),y(t,r,o,"y","y"),y(t,r,o,"w","w"),y(t,r,o,"h","h"),f(t,r,o,"xMode","xMode"),f(t,r,o,"yMode","yMode"),f(t,r,o,"wMode","wMode"),f(t,r,o,"hMode","hMode"),Object.keys(o).length>0&&(s.manualLayout=o)}return s}}class nt{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class lt extends Y{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1){let l=n.localName;const a=t.evaluate(l,e),c=this.processAdjColor(t,a);r[l]=c}}return Object.keys(r).length>0&&(s.colors=r),r}}class at{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(t,e,s){if(!e)return;const r=t.evaluate("latin",e);if(!r)return;const o=r.getAttribute("typeface");o&&(s.family=o);const i=r.getAttribute("panose");return i&&(s.fallbacks=[p.ct.getPanoseFallback(i)]),s}}class ct{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const i=t.getRef(o);typeof i=="string"&&(r.address=i)}return t.copyFromAttribute(e,"tooltip",r),t.copyFromAttribute(e,"history",r,"history",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tgtFrame",r,"target"),s.hyperlink=r,r}}class ut{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(t,e){const s={type:p.iy.Type.Color};return t.copyFromAttribute(e,"cellColor",s,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(e,"dxfId",s,"styleId",t.INT_COPY),s}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(t,e){const s={type:p.iy.Type.Custom};t.copyFromAttribute(e,"and",s,"and",t.BOOLEAN_COPY);const r=e.childNodes;s.filters=[];for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType!==1)continue;let n=null;i.localName==="customFilter"&&(n=this.processCustomFilter(t,i)),n&&s.filters.push(n)}return s}processDynamicFilter(t,e){const s={type:p.iy.Type.Dynamic};return t.copyFromAttribute(e,"type",s,"dynamicType"),t.copyFromAttribute(e,"val",s,"val",t.INT_COPY),t.copyFromAttribute(e,"maxVal",s,"maxVal",t.INT_COPY),s}processDateGroupItem(t,e){const s={};return t.copyFromAttribute(e,"dateTimeGrouping",s,"group"),t.copyFromAttribute(e,"day",s,"day",t.INT_COPY),t.copyFromAttribute(e,"hour",s,"hour",t.INT_COPY),t.copyFromAttribute(e,"minute",s,"minute",t.INT_COPY),t.copyFromAttribute(e,"month",s,"month",t.INT_COPY),t.copyFromAttribute(e,"second",s,"second",t.INT_COPY),t.copyFromAttribute(e,"year",s,"year",t.INT_COPY),s}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(t,e){const s={type:p.iy.Type.Items};t.copyFromAttribute(e,"blank",s,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(e,"calendarType",s,"calendarType");let r=[],o=[];const i=e.childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1){if(l.localName==="dateGroupItem"){const a=this.processDateGroupItem(t,l);a&&r.push(a)}else if(l.localName==="filter"){const a=this.processFilterItem(t,l);a!==void 0&&o.push(a)}}}return r.length>0&&(s.dateGroups=r),o.length>0&&(s.items=o),s}processIcon(t,e){const s={type:p.iy.Type.Icon};return t.copyFromAttribute(e,"iconId",s,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",s),s}processTop10(t,e){const s={type:p.iy.Type.Top10};return t.copyFromAttribute(e,"filterVal",s,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(e,"percent",s,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(e,"top",s,"top",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val",t.FLOAT_COPY),s}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType!==1)continue;let l=null;n.localName==="colorFilter"?l=this.processColorFilter(t,n):n.localName==="customFilters"?l=this.processCustomFilters(t,n):n.localName==="dynamicFilter"?l=this.processDynamicFilter(t,n):n.localName==="filters"?l=this.processFilters(t,n):n.localName==="iconFilter"?l=this.processIcon(t,n):n.localName==="top10"&&(l=this.processTop10(t,n)),l&&o.push(l)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,e){if(!e)return null;const s={};if(!e.hasAttribute("colId"))return;s.offset=parseInt(e.getAttribute("colId"));let r=!1;return e.hasAttribute("hiddenButton")&&(r=g.b(e.getAttribute("hiddenButton"))),r&&(s.hiddenButton=!0),e.hasAttribute("showButton")&&(s.showButton=g.b(e.getAttribute("showButton"))),this.processFilterCriteria(t,e,s),s}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType===1&&n.localName==="filterColumn"){const l=this.processFilterColumn(t,n);l&&o.push(l)}}return o.length>0&&(s.fields=o),o}}class ht{visit(t,e,s){if(!e)return;const r={};if(t.copyFromAttribute(e,"ref",r),e.hasAttribute("caseSensitive")){const n=g.b(e.getAttribute("caseSensitive"));r.collatorOptions=n?p.pc.CaseSensitiveOptions:p.pc.CaseInsensitiveOptions}const o=e.getAttribute("sortMethod");o!=null&&o!=="none"&&(o==="stroke"?r.collatorOptions={...r.collatorOptions,collation:"stroke"}:o==="pinYin"&&(r.collatorOptions={...r.collatorOptions,collation:"pinyin"})),e.hasAttribute("columnSort")&&g.b(e.getAttribute("columnSort"))&&(r.orientation=p.q.Orientation.Column);const i=p.Sc.fastStringToRange(r.ref);return this.processSortConditions(t,e,r,i),Object.keys(r).length>0&&(s.sort=r),r}processSortCondition(t,e,s){if(!e)return null;const r={};if(e.hasAttribute("ref")){if(e.hasAttribute("ref")){const o=e.getAttribute("ref"),i=p.Sc.fastStringToRange(o);r.offset=s?i.colStart-s.colStart:i.colStart}return r.reverse=!1,e.hasAttribute("descending")&&(r.reverse=g.b(e.getAttribute("descending"))),t.copyFromAttribute(e,"sortBy",r,"sortOn"),t.copyFromAttribute(e,"dxfId",r),t.copyFromAttribute(e,"iconSet",r),t.copyFromAttribute(e,"customList",r),r}console.warn("no ref for sort conditional",t.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let n=0;n<o.length;n++){const l=o.item(n);if(l.nodeType===1&&l.localName==="sortCondition"){const a=this.processSortCondition(t,l,r);a&&i.push(a)}}return i.length>0&&(s.fields=i),i}}class U{visit(t,e,s){}processDataBarColor(t,e,s,r,o="dk1"){if(!e)return;const i=g.d(n=>e.getAttribute(n),o);return i&&(s[r]=i),s}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType===1&&n.localName==="font"){const l={};this.processFont(t,n,l),s[o++]=l}}return s}processFont(t,e,s){t.getValAttrAsBoolean("b",e,!0)&&(s.weight=700),t.getValAttrAsBoolean("i",e,!0)&&(s.style=p.ct.Style.Italic),t.getValAttrAsBoolean("strike",e,!0)&&(s.strike=!0);const r=t.evaluate("u",e);if(r){const n=r.getAttribute("val");s.underline=n||p.ct.UnderlineStyle.Single}f(t,e,s,"vertAlign","verticalAlign"),s.verticalAlign==="superscript"?s.verticalAlign=p.ct.VerticalAlignment.Super:s.verticalAlign==="subscript"&&(s.verticalAlign=p.ct.VerticalAlignment.Sub),y(t,e,s,"sz","size");const o=t.evaluate("color",e);this.processDataBarColor(t,o,s,"fill"),s.fill||(s.fill="dk1"),f(t,e,s,"name","family"),f(t,e,s,"rFont","family");const i=t.evaluate("family",e);if(i){const n=i.getAttribute("val");if(n)switch(n){case"1":s.fallbacks=["serif"];break;case"2":s.fallbacks=["sans-serif"];break;case"3":s.fallbacks=["monospace"];break;case"4":s.fallbacks=["cursive"];break;case"5":s.fallbacks=["fantasy"]}}return f(t,e,s,"scheme","scheme"),A(t,e,s,"shadow","shadow",!0),A(t,e,s,"outline","outline",!0),t.getValAttrAsBoolean("condense",e,!0)&&(s.letterSpacing=-1),t.getValAttrAsBoolean("extend",e,!0)&&(s.letterSpacing=1),f(t,e,s,"charset","charset"),s}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="fill"&&this.processFill(t,n,s,o++)}return s}processFill(t,e,s,r){const o={type:p.Et.Type.None},i=e.childNodes;let n=!1;for(let l=0;!n&&l<i.length;l++){const a=i.item(l);a.nodeType===1&&(a.localName==="gradientFill"?(this.processGradientFill(t,a,o),n=!0):a.localName==="patternFill"&&(this.processPatternFill(t,a,o),n=!0))}return s[r]=o,s}processGradientFill(t,e,s){if(!e)return;s.type=p.Et.Type.Gradient;const r=[];s.stops=r,s.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const o=e.getAttribute("type");o&&(s.gradientType=o);const i=l=>{if(!l)return 0;const a=parseFloat(l);return isNaN(a)?0:a};(e.hasAttribute("left")||e.hasAttribute("top")||e.hasAttribute("right")||e.hasAttribute("bottom"))&&(s.fillTo={left:i(e.getAttribute("left")),top:i(e.getAttribute("top")),right:i(e.getAttribute("right")),bottom:i(e.getAttribute("bottom"))});const n=e.childNodes;for(let l=0;l<n.length;l++){const a=n.item(l);if(a.nodeType===1&&a.localName==="stop"){const c={};r.push(c);const h=parseFloat(a.getAttribute("position"));c.offset=h;const d=t.evaluate("color",a);this.processDataBarColor(t,d,c,"color")}}return s}processPatternFill(t,e,s){if(!e)return;const r=t.getVisitorParamsState().get("processingDXFs"),o=e.getAttribute("patternType")||(r?p.Et.BuiltInSheetPattern.Solid:p.Et.BuiltInSheetPattern.None);if(o===p.Et.BuiltInSheetPattern.None)return{none:!0};s.type=p.Et.Type.Pattern,o&&(s.patternType=o);let i,n="foreground",l="background";const a=s.patternType===p.Et.BuiltInSheetPattern.Solid&&r;if(a){i="lt1";const d=n;n=l,l=d}const c=t.evaluate("fgColor",e);this.processDataBarColor(t,c,s,n,i);const h=t.evaluate("bgColor",e);return this.processDataBarColor(t,h,s,l,i),a&&!s.foreground&&(s.foreground=i),s}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let n=0;n<o.length;n++){const l=o.item(n);l.nodeType===1&&l.localName==="border"&&this.processBorder(t,l,s,i++,r)}return s}processBorder(t,e,s,r,o){if(!e)return;const i={};return this.processBorderStroke(t,e,i,p.De.Edge.Left),this.processBorderStroke(t,e,i,p.De.Edge.Right),o?(i.right||i.left)&&(i.right?i.vertical={...i.right}:i.vertical={...i.left}):this.processBorderStroke(t,e,i,p.De.Edge.Vertical),this.processBorderStroke(t,e,i,p.De.Edge.Top),this.processBorderStroke(t,e,i,p.De.Edge.Bottom),o?(i.bottom||i.top)&&(i.right?i.horizontal={...i.bottom}:i.horizontal={...i.top}):this.processBorderStroke(t,e,i,p.De.Edge.Horizontal),s[r]=i,s}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class pt extends U{visit(t,e,s){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const r={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),r.fonts),this.processFills(t,t.evaluate("fills",e),r.fills),this.processBorders(t,t.evaluate("borders",e),r.borders,!0),r.fills[0]={type:p.Et.Type.None},r.fills[1]={type:p.Et.Type.Pattern,patternType:p.Et.BuiltInSheetPattern.Gray125},r.borders[0]={};const o=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),o,r,null,!1);const i=new Map;if(o.length>0){const a=[];this.processCellStyles(t,t.evaluate("cellStyles",e),a,o,i),s.named=a}const n=[];this.processXFs(t,t.evaluate("cellXfs",e),n,r,i),Object.keys(n).length>0&&(s.direct=n);const l=[];return this.processDXFs(t,t.evaluate("dxfs",e),l),this.processTableStyles(t,t.evaluate("tableStyles",e),s,l),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),s),this.processMruColors(t,t.evaluate("colors/mruColors",e),s),s}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="rgbColor"){const l={color:null};this.processDataBarColor(t,n,l,"color"),l.color&&r.push(l.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="color"){const l={color:null};this.processDataBarColor(t,n,l,"color"),l.color&&r.push(l.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="numFmt"){const l=n.getAttribute("numFmtId"),a=n.getAttribute("formatCode");if(l&&a){const c=a.replace(/\\(.)/g,"$1");r.set(parseInt(l),c)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let l=0;l<n.length;l++){const a=n.item(l);if(a.nodeType===1&&a.localName==="xf"){const c={};this.processXF(t,a,c,r,o,i),s.push(c)}}}processXF(t,e,s,r,o,i){if(!e)return;const n=e.getAttribute("xfId");if(n&&o){const c=o.get(parseInt(n));c&&c!==p.dt.BuiltInName.Normal&&(s.named=c)}const l=c=>!(!i&&e.hasAttribute(c))||g.b(e.getAttribute("applyFont"));if(l("applyFont")){const c=r.fonts[e.getAttribute("fontId")];c&&(s.font=c)}if(l("applyFill")){const c=r.fills[e.getAttribute("fillId")];c&&Object.keys(c).length>0&&(s.fill=c)}if(l("applyBorder")){const c=r.borders[e.getAttribute("borderId")];c&&Object.keys(c).length>0&&(s.border=c)}if(l("applyNumberFormat")){const c=e.getAttribute("numFmtId");if(c){const h=parseInt(c);let d;const m=t.getVisitorParamsState();if(m){const b=m.get("numFmts");b&&(d=b.get(h)),s.numberFormat=d??h}else console.warn("no visitor params state")}}l("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",e),s),l("applyProtection")&&this.processProtection(t,t.evaluate("protection",e),s);const a=g.b(e.getAttribute("quotePrefix"));a&&(s.quotePrefix=a)}processAlignment(t,e,s){const r={};if(e?.hasAttribute("horizontal")?r.horizontal=e.getAttribute("horizontal"):r.horizontal=p.Ae.HorizontalAlignment.General,e?.hasAttribute("vertical")?r.vertical=e.getAttribute("vertical"):r.vertical=p.Ae.VerticalAlignment.Bottom,e?.hasAttribute("indent")?r.indent=parseInt(e.getAttribute("indent")):r.indent=0,e?.hasAttribute("relativeIndent")?r.relativeIndent=parseInt(e.getAttribute("relativeIndent")):r.relativeIndent=0,g.b(e?.getAttribute("wrapText"))?r.overflow=p.Ae.Overflow.Wrap:r.overflow=p.Ae.Overflow.Visible,g.b(e?.getAttribute("shrinkToFit"))&&(r.overflow=p.Ae.Overflow.Shrink),e?.hasAttribute("textRotation")){let i=parseFloat(e.getAttribute("textRotation"));i>0&&i<=90?i=360-i:i>90&&i<=180?i-=90:i===255&&(i=0,r.stacked=!0),r.rotation=i}else r.rotation=0;e?.hasAttribute("justifyLastLine")&&(r.justifyLastLine=g.b(e.getAttribute("justifyLastLine")));const o=e?.getAttribute("readingOrder");return o&&(o==="0"?r.readingDirection=p.Ae.ReadingDirection.Auto:o==="1"?r.readingDirection=p.Ae.ReadingDirection.LeftToRight:o==="2"?r.readingDirection=p.Ae.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${o}`)),Object.keys(r).length>0&&(s.alignment=r),s}processProtection(t,e,s){if(!e)return;const r={},o=e.getAttribute("locked");o&&!g.b(o)&&(r.edit=!0);const i=e.getAttribute("hidden");return i&&g.b(i)&&(r.formulaHidden=!0),Object.keys(r).length>0&&(s.protection=r),s}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="font"){const n={};this.processFont(t,i,n),s.font=n}else if(i.nodeType===1&&i.localName==="fill"){const n=[];this.processFill(t,i,n,0),n.length>0&&n[0]&&(s.fill=n[0])}else if(i.nodeType===1&&i.localName==="border"){const n=[];this.processBorder(t,i,n,0,!1),n.length>0&&n[0]&&(s.border=n[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="dxf"){const l={};this.processDXF(t,n,l);const a=s.length;r.set(a,l),s.push(l)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,e,s,r,o=!1){const i=e.getAttribute("name"),n={name:i};e.hasAttribute("table")&&(n.table=g.b(e.getAttribute("table"))),e.hasAttribute("pivot")&&(n.pivot=g.b(e.getAttribute("pivot"))),o&&!n.pivot&&r.unshift(null);const l=e.childNodes;for(let a=0;a<l.length;a++){const c=l.item(a);if(c.nodeType===1&&c.localName==="tableStyleElement"){const h=c.getAttribute("type"),d=c.getAttribute("dxfId");let m=r?.[d];m||(console.warn("invalid dfx id",d),m={}),n[h]=m;let b=null;c.hasAttribute("size")&&(b=parseInt(c.getAttribute("size"))),b&&!isNaN(b)&&(m.size=b)}}delete n.name,s[i]=n}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let h=0;h<a.length;h++){const d=a.item(h);d.nodeType===1&&d.localName==="tableStyle"&&this.processTableStyle(t,d,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,e,s,r,o){if(!e)return;const i=e.childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1&&l.localName==="cellStyle"){const a=parseInt(l.getAttribute("xfId")),c=l.getAttribute("name");if(o.set(a,c),!r[a])continue;const h={name:c,style:r[a]};l.getAttribute("hidden")&&(h.hidden=g.b(l.getAttribute("hidden"))),l.getAttribute("iLevel")&&(h.iLevel=parseInt(l.getAttribute("iLevel"))),s.push(h)}}}afterVisit(t,e,s){}}class gt extends U{visit(t,e,s){return this.processSheetRefs(t,t.evaluate("sheets",e),s),this.processBookViews(t,t.evaluate("bookViews",e),s),this.processDefinedNames(t,t.evaluate("definedNames",e),s),this.processCalcPr(t,t.evaluate("calcPr",e),s),this.processWorkbookProtection(t,t.evaluate("workbookProtection",e),s),this.processWorkbookPr(t,t.evaluate("workbookPr",e),s),s}processPassword(t,e,s,r="password"){if(!e)return;const o={};t.copyFromAttribute(e,"algorithmName",o,"algorithmName"),t.copyFromAttribute(e,"hashValue",o,"hashValue"),t.copyFromAttribute(e,"saltValue",o,"saltValue",t.BOOLEAN_COPY),t.copyFromAttribute(e,"spinCount",o,"spinCount",t.INT_COPY),Object.keys(o).length>0&&(s[r]=o)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=i=>i!==!0&&i!=="1"&&i!=="on"&&i!=="true"&&(i===!1||i==="0"||i==="off"||i==="false"||null);return t.copyFromAttribute(e,"lockStructure",r,"structure",o),t.copyFromAttribute(e,"lockWindows",r,"windows",o),t.copyFromAttribute(e,"lockRevision",r,"revision",o),s.protection=r,s}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);n.nodeType===1&&n.localName==="sheet"&&this.processSheetRef(t,n,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="workbookView"&&(this.processWorkbookView(t,n,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,o=>o+1]),e.hasAttribute("activeTab")||(r.activeSheetId=1),t.copyFromAttribute(e,"showHorizontalScroll",r,"showHorizontalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showVerticalScroll",r,"showVerticalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showSheetTabs",r,"showTabs",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tabRatio",r,"tabRatio",[t.FLOAT_COPY,o=>o]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&i.nodeType===3&&(o.ref=i.textContent),t.copyFromAttribute(e,"name",o),t.copyFromAttribute(e,"comment",o),t.copyFromAttribute(e,"hidden",o,"hidden",t.BOOLEAN_COPY),e.hasAttribute("localSheetId")){const n=e.getAttribute("localSheetId");if(!r[n]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);o.scope=r[n].name}t.copyFromAttribute(e,"customMenu",o),t.copyFromAttribute(e,"description",o),t.copyFromAttribute(e,"statusBar",o),t.copyFromAttribute(e,"help",o),t.copyFromAttribute(e,"shortcutKey",o),t.copyFromAttribute(e,"function",o,"function",t.BOOLEAN_COPY),t.copyFromAttribute(e,"functionGroupId",o,"functionGroupId",t.INT_COPY),t.copyFromAttribute(e,"publishToServer",o,"publishToServer",t.BOOLEAN_COPY),t.copyFromAttribute(e,"vbProcedure",o,"vbProcedure",t.BOOLEAN_COPY),t.copyFromAttribute(e,"xlm",o,"xlm",t.BOOLEAN_COPY),Object.keys(o).length>0&&s.push(o)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);n.nodeType===1&&n.localName==="definedName"&&this.processDefineName(t,n,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class dt{visit(t,e,s){return t.copyFromAttribute(e,"name",s),t.copyFromAttribute(e,"displayName",s),t.copyFromAttribute(e,"ref",s),t.copyFromAttribute(e,"headerRowCount",s,"headerRowCount",t.INT_COPY),t.copyFromAttribute(e,"totalsRowCount",s,"totalsRowCount",t.INT_COPY),this.processTableColumns(t,e,s),this.processTableStyleInfo(t,e,s),s}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="tableStyleInfo"&&(t.copyFromAttribute(n,"name",o),t.copyFromAttribute(n,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="tableColumn"){const n={};t.copyFromAttribute(i,"name",n),t.copyFromAttribute(i,"uniqueName",n),s.push(n)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="tableColumns"&&this.processTableColumn(t,n,o)}o.length>0&&(s.columns=o)}}class mt{visit(t,e,s){return s}}class x{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"editAs",r,"anchorType"),r.anchor={},this.processOffsetCoord(t,t.evaluate("from",e),r.anchor,"from"),this.processOffsetCoord(t,t.evaluate("to",e),r.anchor,"to"),s.movables||(s.movables=[]),s.movables.push(r),r}processOffsetCoord(t,e,s,r){if(!e)return;const o={c:0,r:0,x:0,y:0};return t.evaluate("col",e)&&(o.c=parseInt(t.evaluate("col",e).textContent)),t.evaluate("row",e)&&(o.r=parseInt(t.evaluate("row",e).textContent)),t.evaluate("colOff",e)&&(o.x=g.c(t.evaluate("colOff",e).textContent)),t.evaluate("rowOff",e)&&(o.y=g.c(t.evaluate("rowOff",e).textContent)),r==="from"?s.tl=o:s.br=o,s}}class I{visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);return r&&(t.copyFromAttribute(r,"name",s),t.copyFromAttribute(r,"desc",s),t.copyFromAttribute(r,"hidden",s,"hidden",t.BOOLEAN_COPY),t.copyFromAttribute(r,"id",s)),s}}class bt extends I{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const n=t.evaluate("graphicFrameLocks",r);if(n){n.hasAttribute("noChangeAspect")&&(s.lockAspect=n.getAttribute("noChangeAspect")==="1");const l={};Object.keys(l).length>0&&(s.locks=l)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1)try{let a=l.localName;a==="chart"&&(a="chart"),o.type=a;const c=l.getAttribute("r:id");c&&(o.json=t.getRef(c))}catch(a){console.warn("Unable to parse graphicFrame",a)}}return o&&(s.content=o),o}}class B extends I{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const i=t.evaluate("spLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class At extends I{visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const a=t.evaluate("picLocks",o);if(a){a.hasAttribute("noChangeAspect")&&(r.lockAspect=a.getAttribute("noChangeAspect")==="1");const c={};t.copyFromAttribute(a,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(c).length>0&&(r.locks=c)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const a=i.getAttribute("r:embed")??i.getAttribute("embed");if(!a)return void console.warn("no rId found for blip",i);n=t.getRef(a,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class ft extends B{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const i=t.evaluate("grpSpLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class yt extends B{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const i=t.evaluate("cxnSpLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const _="richTypes";class vt{visit(t,e,s){let r=t.getVisitorParamsState().get(_);r||(r=[],t.getVisitorParamsState().set(_,r));const o=e.childNodes,i=o.length;for(let n=0;n<i;n++){const l=o.item(n);if(l.nodeType===1&&l.localName==="s"){const a={type:l.getAttribute("t")??"n",keys:[]};this.processKeys(t,l,a),r.push(a)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let n=0;n<o;n++){const l=r.item(n);if(l.nodeType===1&&l.localName==="k"){const a=l.getAttribute("n"),c=l.getAttribute("t");i.push([a,c])}}}}const j="richData";class Ft{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(j);o||(o=[],t.getVisitorParamsState().set(j,o));const i=e.childNodes,n=i.length;for(let l=0;l<n;l++){const a=i.item(l);if(a.nodeType===1&&a.localName==="rv"){const c=r[a.getAttribute("s")],h={type:c.type};this.processValues(t,a,h,c);const d=this.mapType(t,h);o.push(d)}}return s.richData=o,o}mapType(t,e){if(e.type==="_error"){const s=e.errorType;if(s)try{e=p.Mt.getBuiltInById(s+1)}catch{}}return e}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let l=0;l<i;l++){const a=o.item(l);if(a.nodeType===1&&a.localName==="v"){const c=n[l];if(!c)return void t.warn("Invalid richData");const h=c[0],d=c[1];let m=a.textContent;d==="i"&&(m=Number(m)),s[h]=m}}}}class Ct{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="author"){const n=i.firstChild;n&&n.nodeType===3&&s.push(n.textContent)}}}}class wt{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"authorId",r,"authorId",t.INT_COPY),r.asNote=!0,s.comments||(s.comments=[]),s.comments.push(r),r}}class Pt{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class Nt{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"id",r,"id",g.r),t.copyFromAttribute(e,"personId",r,"personId",g.r),t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"parentId",r,"parentId",g.r),t.copyFromAttribute(e,"dT",r),e.hasAttribute("done")&&(r.done=g.b(e.getAttribute("done"))),s.push(r),r}}class Ot{visit(t,e,s){const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="person"){const l={};t.copyFromAttribute(n,"id",l,"id",g.r),t.copyFromAttribute(n,"displayName",l),t.copyFromAttribute(n,"userId",l,"userId",g.r),t.copyFromAttribute(n,"providerId",l),r.push(l)}}return r.length>0&&(s.persons=r),r}}const Tt={};class St{constructor(t,e){this.path=t,this.visitor=e}}class R{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new K),this.registerVisitor("spPr",new L),this.registerVisitor("txBody",new F),this.registerVisitor("txPr",new F),this.registerVisitor("c:chartSpace",new q),this.registerVisitor("c:chartSpace",new H,"chart"),this.registerVisitor("c:plotArea",new J),this.registerVisitor("c:barChart",new Q),this.registerVisitor("c:doughnutChart",new N),this.registerVisitor("c:lineChart",new N),this.registerVisitor("c:ofPieType",new N),this.registerVisitor("c:pieChart",new N),this.registerVisitor("c:scatterChart",new N),this.registerVisitor("c:barChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new w("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new Z),this.registerVisitor("c:dPt",new tt),this.registerVisitor("c:marker",new et),this.registerVisitor("c:catAx",new k),this.registerVisitor("c:valAx",new k),this.registerVisitor("c:dateAx",new k),this.registerVisitor("c:majorGridlines",new V("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new V("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new F("labels.text"),"txPr"),this.registerVisitor("c:valAx",new F("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new F("labels.text"),"txPr"),this.registerVisitor("c:legend",new st),this.registerVisitor("c:legend",new F("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new rt),this.registerVisitor("c:ser",new ot,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new w("labels"),"dLbls"),this.registerVisitor("c:dLbl",new w("points")),this.registerVisitor("c:title",new E),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new it),this.registerVisitor("c:dispUnits",new V("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new E("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new F,"tx/rich"),this.registerVisitor("a:theme",new nt),this.registerVisitor("a:theme",new lt,"themeElements/clrScheme"),this.registerVisitor("a:theme",new at,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new ut),this.registerVisitor("sortState",new ht),this.registerVisitor("s:workbook",new gt),this.registerVisitor("styleSheet",new pt),this.registerVisitor("table",new dt),this.registerVisitor("hlinkClick",new ct),this.registerVisitor("wsDr",new mt),this.registerVisitor("twoCellAnchor",new x),this.registerVisitor("oneCellAnchor",new x),this.registerVisitor("absoluteAnchor",new x),this.registerVisitor("graphicFrame",new bt),this.registerVisitor("sp",new B),this.registerVisitor("grpSp",new ft),this.registerVisitor("cxnSp",new yt),this.registerVisitor("pic",new At),this.registerVisitor("rvStructures",new vt),this.registerVisitor("rvData",new Ft),this.registerVisitor("comments",new Ct),this.registerVisitor("commentList",new wt,"comment"),this.registerVisitor("comment",new F("content"),"text"),this.registerVisitor("ThreadedComments",new Pt),this.registerVisitor("threadedComment",new Nt),this.registerVisitor("threadedComment",new F("content"),"text"),this.registerVisitor("personList",new Ot)}registerVisitor(t,e,s=null){t.indexOf(":")===-1&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new St(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=Tt){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);if(i||(i=this.visitorsByXmlTagName.get(r.localName)),!i)throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);const n="/"+r.localName,l=new S(null,this,n,r,o,e,s),a=[];this._doWalk(i,l,a,r,o,e,s);for(let c=0;c<a.length;c++){const h=a[c];try{h.visitor?.afterVisit?.(h.context,h.elemParent,h.jsonParent)}catch(d){console.warn(`Error in afterVisit: ${h.context.getPath()}`,d)}}return o}_walkScoped(t,e,s,r,o,i,n){const l=this.scopedVisitorsByXmlTagName.get(t);for(let a=0;l&&a<l.length;a++){const c=l[a];let h=null;try{h=e.evaluate(c.path,r)}catch{console.warn(`"Invalid path '${c.path}' for '${t}'.`)}if(!h)continue;const d=m=>{let b=m.localName,v=m.parentNode;for(;v&&v!==r;)b=v.localName+"/"+b,v=v.parentNode;const P=e.getPath()+"/"+b;if(c.visitor){const T=new S(e,this,P,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c.visitor,T,s,m,o,i,n)}};if(h.length>0){const m=h;for(let b=0;b<m.length;b++)d(m.item(b))}else d(h)}}_doWalk(t,e,s,r,o,i,n){let l=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),l=t.visit(e,r,o)),l||(l=o);const a=r.localName;this._walkScoped(a,e,s,r,l,i,n);const c=r.childNodes;for(let h=0;h<c.length;h++){const d=c.item(h);if(d.nodeType===1){const m=d,b=m.localName,v=this.visitorsByXmlTagName.get(b),P=e.getPath()+"/"+b,T=new S(e,this,P,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(v,T,s,m,l??o,i,n)}}return l}}exports.FromOOXMLConverter=R,exports.default=R;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.0.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*//**
|
|
7
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
|
|
8
|
+
*
|
|
9
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
11
|
+
*//**
|
|
12
|
+
* @license @sheetxl/io - IO - Import/Export Libraries for SheetXL. - v0.0.0
|
|
13
|
+
*
|
|
14
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
15
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
16
|
+
*//**
|
|
17
|
+
* @license
|
|
18
|
+
* web-streams-polyfill v4.1.0
|
|
19
|
+
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
|
|
20
|
+
* This code is released under the MIT license.
|
|
21
|
+
* SPDX-License-Identifier: MIT
|
|
22
|
+
*/function Pe(){}function q(e){return typeof e=="object"&&e!==null||typeof e=="function"}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const er=Pe;function p(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch{}}const gt=Promise,Zr=Promise.resolve.bind(gt),eo=Promise.prototype.then,to=Promise.reject.bind(gt),ro=Zr;function C(e){return new gt(e)}function y(e){return C(t=>t(e))}function c(e){return to(e)}function B(e,t,r){return eo.call(e,t,r)}function z(e,t,r){B(B(e,t,r),void 0,er)}function ot(e,t){z(e,t)}function ft(e,t){z(e,void 0,t)}function ae(e,t,r){return B(e,t,r)}function Ae(e){B(e,void 0,er)}let se=e=>{if(typeof queueMicrotask=="function")se=queueMicrotask;else{const t=y(void 0);se=r=>B(t,r)}return se(e)};function pe(e,t,r){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function we(e,t,r){try{return y(pe(e,t,r))}catch(o){return c(o)}}class k{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(t){const r=this._back;let o=r;r._elements.length===16383&&(o={_elements:[],_next:void 0}),r._elements.push(t),o!==r&&(this._back=o,r._next=o),++this._size}shift(){const t=this._front;let r=t;const o=this._cursor;let i=o+1;const n=t._elements,s=n[o];return i===16384&&(r=t._next,i=0),--this._size,this._cursor=i,t!==r&&(this._front=r),n[o]=void 0,s}forEach(t){let r=this._cursor,o=this._front,i=o._elements;for(;!(r===i.length&&o._next===void 0||r===i.length&&(o=o._next,i=o._elements,r=0,i.length===0));)t(i[r]),++r}peek(){const t=this._front,r=this._cursor;return t._elements[r]}}const tr=Symbol("[[AbortSteps]]"),rr=Symbol("[[ErrorSteps]]"),St=Symbol("[[CancelSteps]]"),Rt=Symbol("[[PullSteps]]"),Tt=Symbol("[[ReleaseSteps]]");function or(e,t){var r;e._ownerReadableStream=t,t._reader=e,t._state==="readable"?bt(e):t._state==="closed"?(bt(r=e),ir(r)):nr(e,t._storedError)}function qt(e,t){return W(e._ownerReadableStream,t)}function M(e){const t=e._ownerReadableStream;t._state==="readable"?Et(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):nr(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),t._readableStreamController[Tt](),t._reader=void 0,e._ownerReadableStream=void 0}function Ge(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function bt(e){e._closedPromise=C((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r})}function nr(e,t){bt(e),Et(e,t)}function Et(e,t){e._closedPromise_reject!==void 0&&(Ae(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function ir(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}const Mt=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},oo=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function U(e,t){if(e!==void 0&&typeof(r=e)!="object"&&typeof r!="function")throw new TypeError(`${t} is not an object.`);var r}function J(e,t){if(typeof e!="function")throw new TypeError(`${t} is not a function.`)}function ar(e,t){if(!function(r){return typeof r=="object"&&r!==null||typeof r=="function"}(e))throw new TypeError(`${t} is not an object.`)}function le(e,t,r){if(e===void 0)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function xt(e,t,r){if(e===void 0)throw new TypeError(`${t} is required in '${r}'.`)}function sr(e){return Number(e)}function Nt(e){return e===0?0:e}function Pt(e,t){const r=Number.MAX_SAFE_INTEGER;let o=Number(e);if(o=Nt(o),!Mt(o))throw new TypeError(`${t} is not a finite number`);if(o=Nt(oo(o)),o<0||o>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return Mt(o)&&o!==0?o:0}function Ct(e,t){if(!N(e))throw new TypeError(`${t} is not a ReadableStream.`)}function fe(e){return new Y(e)}function lr(e,t){e._reader._readRequests.push(t)}function Ot(e,t,r){const o=e._reader._readRequests.shift();r?o._closeSteps():o._chunkSteps(t)}function Ze(e){return e._reader._readRequests.length}function ur(e){const t=e._reader;return t!==void 0&&!!H(t)}class Y{constructor(t){if(le(t,1,"ReadableStreamDefaultReader"),Ct(t,"First parameter"),G(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");or(this,t),this._readRequests=new k}get closed(){return H(this)?this._closedPromise:c(ze("closed"))}cancel(t=void 0){return H(this)?this._ownerReadableStream===void 0?c(Ge("cancel")):qt(this,t):c(ze("cancel"))}read(){if(!H(this))return c(ze("read"));if(this._ownerReadableStream===void 0)return c(Ge("read from"));let t,r;const o=C((i,n)=>{t=i,r=n});return Ce(this,{_chunkSteps:i=>t({value:i,done:!1}),_closeSteps:()=>t({value:void 0,done:!0}),_errorSteps:i=>r(i)}),o}releaseLock(){if(!H(this))throw ze("releaseLock");this._ownerReadableStream!==void 0&&(M(this),cr(this,new TypeError("Reader was released")))}}function H(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof Y}function Ce(e,t){const r=e._ownerReadableStream;r._disturbed=!0,r._state==="closed"?t._closeSteps():r._state==="errored"?t._errorSteps(r._storedError):r._readableStreamController[Rt](t)}function cr(e,t){const r=e._readRequests;e._readRequests=new k,r.forEach(o=>{o._errorSteps(t)})}function ze(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}var nt,it,at;function Se(e){return e.slice()}function dr(e,t,r,o,i){new Uint8Array(e).set(new Uint8Array(r,o,i),t)}Object.defineProperties(Y.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),p(Y.prototype.cancel,"cancel"),p(Y.prototype.read,"read"),p(Y.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Y.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});let ue=e=>(ue=typeof e.transfer=="function"?t=>t.transfer():typeof structuredClone=="function"?t=>structuredClone(t,{transfer:[t]}):t=>t,ue(e)),ce=e=>(ce=typeof e.detached=="boolean"?t=>t.detached:t=>t.byteLength===0,ce(e));function fr(e,t,r){if(e.slice)return e.slice(t,r);const o=r-t,i=new ArrayBuffer(o);return dr(i,0,e,t,o),i}function Te(e,t){const r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(`${String(t)} is not a function`);return r}}function Yt(e){try{const t=e.done,r=e.value;return B(ro(r),o=>({done:t,value:o}))}catch(t){return c(t)}}const ke=(at=(nt=Symbol.asyncIterator)!==null&&nt!==void 0?nt:(it=Symbol.for)===null||it===void 0?void 0:it.call(Symbol,"Symbol.asyncIterator"))!==null&&at!==void 0?at:"@@asyncIterator";function br(e,t="sync",r){if(r===void 0)if(t==="async"){if((r=Te(e,ke))===void 0)return function(i){const n={next(){let s;try{s=hr(i)}catch(a){return c(a)}return Yt(s)},return(s){let a;try{const l=Te(i.iterator,"return");if(l===void 0)return y({done:!0,value:s});a=pe(l,i.iterator,[s])}catch(l){return c(l)}return q(a)?Yt(a):c(new TypeError("The iterator.return() method must return an object"))}};return{iterator:n,nextMethod:n.next,done:!1}}(br(e,"sync",Te(e,Symbol.iterator)))}else r=Te(e,Symbol.iterator);if(r===void 0)throw new TypeError("The object is not iterable");const o=pe(r,e,[]);if(!q(o))throw new TypeError("The iterator method must return an object");return{iterator:o,nextMethod:o.next,done:!1}}function hr(e){const t=pe(e.nextMethod,e.iterator,[]);if(!q(t))throw new TypeError("The iterator.next() method must return an object");return t}class _r{constructor(t,r){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=t,this._preventCancel=r}next(){const t=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?ae(this._ongoingPromise,t,t):t(),this._ongoingPromise}return(t){const r=()=>this._returnSteps(t);return this._ongoingPromise=this._ongoingPromise?ae(this._ongoingPromise,r,r):r(),this._ongoingPromise}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const t=this._reader;let r,o;const i=C((n,s)=>{r=n,o=s});return Ce(t,{_chunkSteps:n=>{this._ongoingPromise=void 0,se(()=>r({value:n,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,M(t),r({value:void 0,done:!0})},_errorSteps:n=>{this._ongoingPromise=void 0,this._isFinished=!0,M(t),o(n)}}),i}_returnSteps(t){if(this._isFinished)return Promise.resolve({value:t,done:!0});this._isFinished=!0;const r=this._reader;if(!this._preventCancel){const o=qt(r,t);return M(r),ae(o,()=>({value:t,done:!0}))}return M(r),y({value:t,done:!0})}}const pr={next(){return Vt(this)?this._asyncIteratorImpl.next():c(Ut("next"))},return(e){return Vt(this)?this._asyncIteratorImpl.return(e):c(Ut("return"))},[ke](){return this}};function Vt(e){if(!q(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof _r}catch{return!1}}function Ut(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(pr,ke,{enumerable:!1});const mr=Number.isNaN||function(e){return e!=e};function Ht(e){const t=fr(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function ht(e){const t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function jt(e,t,r){if(typeof(o=r)!="number"||mr(o)||o<0||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var o;e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function K(e){e._queue=new k,e._queueTotalSize=0}function yr(e){return e===DataView}class ne{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!st(this))throw lt("view");return this._view}respond(t){if(!st(this))throw lt("respond");if(le(t,1,"respond"),t=Pt(t,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(ce(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Ve(this._associatedReadableByteStreamController,t)}respondWithNewView(t){if(!st(this))throw lt("respondWithNewView");if(le(t,1,"respondWithNewView"),!ArrayBuffer.isView(t))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(ce(t.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Ue(this._associatedReadableByteStreamController,t)}}Object.defineProperties(ne.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),p(ne.prototype.respond,"respond"),p(ne.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ne.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class ${constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!re(this))throw Re("byobRequest");return pt(this)}get desiredSize(){if(!re(this))throw Re("desiredSize");return Or(this)}close(){if(!re(this))throw Re("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const t=this._controlledReadableByteStream._state;if(t!=="readable")throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be closed`);qe(this)}enqueue(t){if(!re(this))throw Re("enqueue");if(le(t,1,"enqueue"),!ArrayBuffer.isView(t))throw new TypeError("chunk must be an array buffer view");if(t.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(t.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const r=this._controlledReadableByteStream._state;if(r!=="readable")throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`);Ye(this,t)}error(t=void 0){if(!re(this))throw Re("error");A(this,t)}[St](t){vr(this),K(this);const r=this._cancelAlgorithm(t);return et(this),r}[Rt](t){const r=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void Cr(this,t);const o=this._autoAllocateChunkSize;if(o!==void 0){let i;try{i=new ArrayBuffer(o)}catch(s){return void t._errorSteps(s)}const n={buffer:i,bufferByteLength:o,byteOffset:0,byteLength:o,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}lr(r,t),de(this)}[Tt](){if(this._pendingPullIntos.length>0){const t=this._pendingPullIntos.peek();t.readerType="none",this._pendingPullIntos=new k,this._pendingPullIntos.push(t)}}}function re(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof $}function st(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof ne}function de(e){(function(t){const r=t._controlledReadableByteStream;return!(r._state!=="readable"||t._closeRequested||!t._started)&&(!!(ur(r)&&Ze(r)>0||kt(r)&&Ar(r)>0)||Or(t)>0)})(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,z(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,de(e)),null),t=>(A(e,t),null))))}function vr(e){At(e),e._pendingPullIntos=new k}function wr(e,t){let r=!1;e._state==="closed"&&(r=!0);const o=gr(t);t.readerType==="default"?Ot(e,o,r):function(i,n,s){const a=i._reader._readIntoRequests.shift();s?a._closeSteps(n):a._chunkSteps(n)}(e,o,r)}function xe(e,t){for(let r=0;r<t.length;++r)wr(e,t[r])}function gr(e){const t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Ne(e,t,r,o){e._queue.push({buffer:t,byteOffset:r,byteLength:o}),e._queueTotalSize+=o}function Sr(e,t,r,o){let i;try{i=fr(t,r,r+o)}catch(n){throw A(e,n),n}Ne(e,i,0,o)}function Rr(e,t){t.bytesFilled>0&&Sr(e,t.buffer,t.byteOffset,t.bytesFilled),he(e)}function Tr(e,t){const r=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),o=t.bytesFilled+r;let i=r,n=!1;const s=o-o%t.elementSize;s>=t.minimumFill&&(i=s-t.bytesFilled,n=!0);const a=e._queue;for(;i>0;){const l=a.peek(),u=Math.min(i,l.byteLength),b=t.byteOffset+t.bytesFilled;dr(t.buffer,b,l.buffer,l.byteOffset,u),l.byteLength===u?a.shift():(l.byteOffset+=u,l.byteLength-=u),e._queueTotalSize-=u,qr(e,u,t),i-=u}return n}function qr(e,t,r){r.bytesFilled+=t}function Er(e){e._queueTotalSize===0&&e._closeRequested?(et(e),We(e._controlledReadableByteStream)):de(e)}function At(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function _t(e){const t=[];for(;e._pendingPullIntos.length>0&&e._queueTotalSize!==0;){const r=e._pendingPullIntos.peek();Tr(e,r)&&(he(e),t.push(r))}return t}function Pr(e,t){const r=e._pendingPullIntos.peek();At(e),e._controlledReadableByteStream._state==="closed"?function(o,i){i.readerType==="none"&&he(o);const n=o._controlledReadableByteStream;if(kt(n)){const s=[];for(let a=0;a<Ar(n);++a)s.push(he(o));xe(n,s)}}(e,r):function(o,i,n){if(qr(0,i,n),n.readerType==="none"){Rr(o,n);const l=_t(o);return void xe(o._controlledReadableByteStream,l)}if(n.bytesFilled<n.minimumFill)return;he(o);const s=n.bytesFilled%n.elementSize;if(s>0){const l=n.byteOffset+n.bytesFilled;Sr(o,n.buffer,l-s,s)}n.bytesFilled-=s;const a=_t(o);wr(o._controlledReadableByteStream,n),xe(o._controlledReadableByteStream,a)}(e,t,r),de(e)}function he(e){return e._pendingPullIntos.shift()}function et(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function qe(e){const t=e._controlledReadableByteStream;if(!e._closeRequested&&t._state==="readable")if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){const r=e._pendingPullIntos.peek();if(r.bytesFilled%r.elementSize!=0){const o=new TypeError("Insufficient bytes to fill elements in the given buffer");throw A(e,o),o}}et(e),We(t)}}function Ye(e,t){const r=e._controlledReadableByteStream;if(e._closeRequested||r._state!=="readable")return;const{buffer:o,byteOffset:i,byteLength:n}=t;if(ce(o))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");const s=ue(o);if(e._pendingPullIntos.length>0){const a=e._pendingPullIntos.peek();if(ce(a.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");At(e),a.buffer=ue(a.buffer),a.readerType==="none"&&Rr(e,a)}if(ur(r))(function(a){const l=a._controlledReadableByteStream._reader;for(;l._readRequests.length>0;){if(a._queueTotalSize===0)return;Cr(a,l._readRequests.shift())}})(e),Ze(r)===0?Ne(e,s,i,n):(e._pendingPullIntos.length>0&&he(e),Ot(r,new Uint8Array(s,i,n),!1));else if(kt(r)){Ne(e,s,i,n);const a=_t(e);xe(e._controlledReadableByteStream,a)}else Ne(e,s,i,n);de(e)}function A(e,t){const r=e._controlledReadableByteStream;r._state==="readable"&&(vr(e),K(e),et(e),Kr(r,t))}function Cr(e,t){const r=e._queue.shift();e._queueTotalSize-=r.byteLength,Er(e);const o=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);t._chunkSteps(o)}function pt(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){const i=e._pendingPullIntos.peek(),n=new Uint8Array(i.buffer,i.byteOffset+i.bytesFilled,i.byteLength-i.bytesFilled),s=Object.create(ne.prototype);r=e,o=n,(t=s)._associatedReadableByteStreamController=r,t._view=o,e._byobRequest=s}var t,r,o;return e._byobRequest}function Or(e){const t=e._controlledReadableByteStream._state;return t==="errored"?null:t==="closed"?0:e._strategyHWM-e._queueTotalSize}function Ve(e,t){const r=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(t!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(t===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=ue(r.buffer),Pr(e,t)}function Ue(e,t){const r=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(t.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(t.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");const o=t.byteLength;r.buffer=ue(t.buffer),Pr(e,o)}function jr(e,t,r,o,i,n,s){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,K(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=n,t._pullAlgorithm=o,t._cancelAlgorithm=i,t._autoAllocateChunkSize=s,t._pendingPullIntos=new k,e._readableStreamController=t,z(y(r()),()=>(t._started=!0,de(t),null),a=>(A(t,a),null))}function lt(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Re(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function no(e,t){if((e=`${e}`)!="byob")throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Gt(e){return new V(e)}function Xt(e,t){e._reader._readIntoRequests.push(t)}function Ar(e){return e._reader._readIntoRequests.length}function kt(e){const t=e._reader;return t!==void 0&&!!ie(t)}Object.defineProperties($.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),p($.prototype.close,"close"),p($.prototype.enqueue,"enqueue"),p($.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class V{constructor(t){if(le(t,1,"ReadableStreamBYOBReader"),Ct(t,"First parameter"),G(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!re(t._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");or(this,t),this._readIntoRequests=new k}get closed(){return ie(this)?this._closedPromise:c(Be("closed"))}cancel(t=void 0){return ie(this)?this._ownerReadableStream===void 0?c(Ge("cancel")):qt(this,t):c(Be("cancel"))}read(t,r={}){if(!ie(this))return c(Be("read"));if(!ArrayBuffer.isView(t))return c(new TypeError("view must be an array buffer view"));if(t.byteLength===0)return c(new TypeError("view must have non-zero byteLength"));if(t.buffer.byteLength===0)return c(new TypeError("view's buffer must have non-zero byteLength"));if(ce(t.buffer))return c(new TypeError("view's buffer has been detached"));let o;try{U(i=r,"options"),o={min:Pt((n=i?.min)!==null&&n!==void 0?n:1,"options has member 'min' that")}}catch(d){return c(d)}var i,n;const s=o.min;if(s===0)return c(new TypeError("options.min must be greater than 0"));if(yr((a=t).constructor)){if(s>t.byteLength)return c(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(s>t.length)return c(new RangeError("options.min must be less than or equal to view's length"));var a;if(this._ownerReadableStream===void 0)return c(Ge("read from"));let l,u;const b=C((d,h)=>{l=d,u=h});return kr(this,t,s,{_chunkSteps:d=>l({value:d,done:!1}),_closeSteps:d=>l({value:d,done:!0}),_errorSteps:d=>u(d)}),b}releaseLock(){if(!ie(this))throw Be("releaseLock");this._ownerReadableStream!==void 0&&(M(this),Wr(this,new TypeError("Reader was released")))}}function ie(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof V}function kr(e,t,r,o){const i=e._ownerReadableStream;i._disturbed=!0,i._state==="errored"?o._errorSteps(i._storedError):function(n,s,a,l){const u=n._controlledReadableByteStream,b=s.constructor,d=yr(g=b)?1:g.BYTES_PER_ELEMENT,{byteOffset:h,byteLength:R}=s,E=a*d;var g;let w;try{w=ue(s.buffer)}catch(T){return void l._errorSteps(T)}const _={buffer:w,bufferByteLength:w.byteLength,byteOffset:h,byteLength:R,bytesFilled:0,minimumFill:E,elementSize:d,viewConstructor:b,readerType:"byob"};if(n._pendingPullIntos.length>0)return n._pendingPullIntos.push(_),void Xt(u,l);if(u._state!=="closed"){if(n._queueTotalSize>0){if(Tr(n,_)){const T=gr(_);return Er(n),void l._chunkSteps(T)}if(n._closeRequested){const T=new TypeError("Insufficient bytes to fill elements in the given buffer");return A(n,T),void l._errorSteps(T)}}n._pendingPullIntos.push(_),Xt(u,l),de(n)}else{const T=new b(_.buffer,_.byteOffset,0);l._closeSteps(T)}}(i._readableStreamController,t,r,o)}function Wr(e,t){const r=e._readIntoRequests;e._readIntoRequests=new k,r.forEach(o=>{o._errorSteps(t)})}function Be(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function mt(e,t){const{highWaterMark:r}=e;if(r===void 0)return t;if(mr(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function zr(e){const{size:t}=e;return t||(()=>1)}function Br(e,t){U(e,t);const r=e?.highWaterMark,o=e?.size;return{highWaterMark:r===void 0?void 0:sr(r),size:o===void 0?void 0:io(o,`${t} has member 'size' that`)}}function io(e,t){return J(e,t),r=>sr(e(r))}function ao(e,t,r){return J(e,r),o=>we(e,t,[o])}function so(e,t,r){return J(e,r),()=>we(e,t,[])}function lo(e,t,r){return J(e,r),o=>pe(e,t,[o])}function uo(e,t,r){return J(e,r),(o,i)=>we(e,t,[o,i])}function Fr(e,t){if(!be(e))throw new TypeError(`${t} is not a WritableStream.`)}Object.defineProperties(V.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),p(V.prototype.cancel,"cancel"),p(V.prototype.read,"read"),p(V.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class oe{constructor(t={},r={}){t===void 0?t=null:ar(t,"First parameter");const o=Br(r,"Second parameter"),i=function(a,l){U(a,l);const u=a?.abort,b=a?.close,d=a?.start,h=a?.type,R=a?.write;return{abort:u===void 0?void 0:ao(u,a,`${l} has member 'abort' that`),close:b===void 0?void 0:so(b,a,`${l} has member 'close' that`),start:d===void 0?void 0:lo(d,a,`${l} has member 'start' that`),write:R===void 0?void 0:uo(R,a,`${l} has member 'write' that`),type:h}}(t,"First parameter");if((n=this)._state="writable",n._storedError=void 0,n._writer=void 0,n._writableStreamController=void 0,n._writeRequests=new k,n._inFlightWriteRequest=void 0,n._closeRequest=void 0,n._inFlightCloseRequest=void 0,n._pendingAbortRequest=void 0,n._backpressure=!1,i.type!==void 0)throw new RangeError("Invalid type is specified");var n;const s=zr(o);(function(a,l,u,b){const d=Object.create(Oe.prototype);let h,R,E,g;h=l.start!==void 0?()=>l.start(d):()=>{},R=l.write!==void 0?w=>l.write(w,d):()=>y(void 0),E=l.close!==void 0?()=>l.close():()=>y(void 0),g=l.abort!==void 0?w=>l.abort(w):()=>y(void 0),function(w,_,T,I,v,f,m,S){_._controlledWritableStream=w,w._writableStreamController=_,_._queue=void 0,_._queueTotalSize=void 0,K(_),_._abortReason=void 0,_._abortController=function(){if(typeof AbortController=="function")return new AbortController}(),_._started=!1,_._strategySizeAlgorithm=S,_._strategyHWM=m,_._writeAlgorithm=I,_._closeAlgorithm=v,_._abortAlgorithm=f;const O=Ft(_);Bt(w,O),z(y(T()),()=>(_._started=!0,tt(_),null),j=>(_._started=!0,yt(w,j),null))}(a,d,h,R,E,g,u,b)})(this,i,mt(o,1),s)}get locked(){if(!be(this))throw Ie("locked");return _e(this)}abort(t=void 0){return be(this)?_e(this)?c(new TypeError("Cannot abort a stream that already has a writer")):Xe(this,t):c(Ie("abort"))}close(){return be(this)?_e(this)?c(new TypeError("Cannot close a stream that already has a writer")):F(this)?c(new TypeError("Cannot close an already-closing stream")):Lr(this):c(Ie("close"))}getWriter(){if(!be(this))throw Ie("getWriter");return Ir(this)}}function Ir(e){return new L(e)}function be(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof oe}function _e(e){return e._writer!==void 0}function Xe(e,t){var r;if(e._state==="closed"||e._state==="errored")return y(void 0);e._writableStreamController._abortReason=t,(r=e._writableStreamController._abortController)===null||r===void 0||r.abort(t);const o=e._state;if(o==="closed"||o==="errored")return y(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let i=!1;o==="erroring"&&(i=!0,t=void 0);const n=C((s,a)=>{e._pendingAbortRequest={_promise:void 0,_resolve:s,_reject:a,_reason:t,_wasAlreadyErroring:i}});return e._pendingAbortRequest._promise=n,i||Wt(e,t),n}function Lr(e){const t=e._state;if(t==="closed"||t==="errored")return c(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));const r=C((n,s)=>{const a={_resolve:n,_reject:s};e._closeRequest=a}),o=e._writer;var i;return o!==void 0&&e._backpressure&&t==="writable"&&Lt(o),jt(i=e._writableStreamController,Nr,0),tt(i),r}function yt(e,t){e._state!=="writable"?zt(e):Wt(e,t)}function Wt(e,t){const r=e._writableStreamController;e._state="erroring",e._storedError=t;const o=e._writer;var i;o!==void 0&&Dr(o,t),(i=e)._inFlightWriteRequest===void 0&&i._inFlightCloseRequest===void 0&&r._started&&zt(e)}function zt(e){e._state="errored",e._writableStreamController[rr]();const t=e._storedError;if(e._writeRequests.forEach(o=>{o._reject(t)}),e._writeRequests=new k,e._pendingAbortRequest===void 0)return void Fe(e);const r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void Fe(e);z(e._writableStreamController[tr](r._reason),()=>(r._resolve(),Fe(e),null),o=>(r._reject(o),Fe(e),null))}function F(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function Fe(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);const t=e._writer;t!==void 0&&It(t,e._storedError)}function Bt(e,t){const r=e._writer;r!==void 0&&t!==e._backpressure&&(t?rt(r):Lt(r)),e._backpressure=t}Object.defineProperties(oe.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),p(oe.prototype.abort,"abort"),p(oe.prototype.close,"close"),p(oe.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(oe.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});class L{constructor(t){if(le(t,1,"WritableStreamDefaultWriter"),Fr(t,"First parameter"),_e(t))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=t,t._writer=this;const r=t._state;if(r==="writable")!F(t)&&t._backpressure?rt(this):Jt(this),He(this);else if(r==="erroring")wt(this,t._storedError),He(this);else if(r==="closed")Jt(this),He(this),Hr(this);else{const o=t._storedError;wt(this,o),Ur(this,o)}}get closed(){return Q(this)?this._closedPromise:c(Z("closed"))}get desiredSize(){if(!Q(this))throw Z("desiredSize");if(this._ownerWritableStream===void 0)throw Ee("desiredSize");return function(t){const r=t._ownerWritableStream,o=r._state;return o==="errored"||o==="erroring"?null:o==="closed"?0:Yr(r._writableStreamController)}(this)}get ready(){return Q(this)?this._readyPromise:c(Z("ready"))}abort(t=void 0){return Q(this)?this._ownerWritableStream===void 0?c(Ee("abort")):(r=t,Xe(this._ownerWritableStream,r)):c(Z("abort"));var r}close(){if(!Q(this))return c(Z("close"));const t=this._ownerWritableStream;return t===void 0?c(Ee("close")):F(t)?c(new TypeError("Cannot close an already-closing stream")):$r(this)}releaseLock(){if(!Q(this))throw Z("releaseLock");this._ownerWritableStream!==void 0&&Mr(this)}write(t=void 0){return Q(this)?this._ownerWritableStream===void 0?c(Ee("write to")):xr(this,t):c(Z("write"))}}function Q(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof L}function $r(e){return Lr(e._ownerWritableStream)}function Dr(e,t){e._readyPromiseState==="pending"?Gr(e,t):wt(e,t)}function Mr(e){const t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");var o,i;Dr(e,r),i=r,(o=e)._closedPromiseState==="pending"?It(o,i):Ur(o,i),t._writer=void 0,e._ownerWritableStream=void 0}function xr(e,t){const r=e._ownerWritableStream,o=r._writableStreamController,i=function(l,u){if(l._strategySizeAlgorithm===void 0)return 1;try{return l._strategySizeAlgorithm(u)}catch(b){return vt(l,b),1}}(o,t);if(r!==e._ownerWritableStream)return c(Ee("write to"));const n=r._state;if(n==="errored")return c(r._storedError);if(F(r)||n==="closed")return c(new TypeError("The stream is closing or closed and cannot be written to"));if(n==="erroring")return c(r._storedError);const s=(a=r,C((l,u)=>{const b={_resolve:l,_reject:u};a._writeRequests.push(b)}));var a;return function(l,u,b){try{jt(l,u,b)}catch(h){return void vt(l,h)}const d=l._controlledWritableStream;F(d)||d._state!=="writable"||Bt(d,Ft(l)),tt(l)}(o,t,i),s}Object.defineProperties(L.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),p(L.prototype.abort,"abort"),p(L.prototype.close,"close"),p(L.prototype.releaseLock,"releaseLock"),p(L.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(L.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const Nr={};class Oe{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ut(this))throw ct("abortReason");return this._abortReason}get signal(){if(!ut(this))throw ct("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(t=void 0){if(!ut(this))throw ct("error");this._controlledWritableStream._state==="writable"&&Vr(this,t)}[tr](t){const r=this._abortAlgorithm(t);return Je(this),r}[rr](){K(this)}}function ut(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Oe}function Je(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Yr(e){return e._strategyHWM-e._queueTotalSize}function tt(e){const t=e._controlledWritableStream;if(!e._started||t._inFlightWriteRequest!==void 0)return;if(t._state==="erroring")return void zt(t);if(e._queue.length===0)return;const r=e._queue.peek().value;r===Nr?function(o){const i=o._controlledWritableStream;var n;(n=i)._inFlightCloseRequest=n._closeRequest,n._closeRequest=void 0,ht(o);const s=o._closeAlgorithm();Je(o),z(s,()=>(function(a){a._inFlightCloseRequest._resolve(void 0),a._inFlightCloseRequest=void 0,a._state==="erroring"&&(a._storedError=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._resolve(),a._pendingAbortRequest=void 0)),a._state="closed";const l=a._writer;l!==void 0&&Hr(l)}(i),null),a=>{return u=a,(l=i)._inFlightCloseRequest._reject(u),l._inFlightCloseRequest=void 0,l._pendingAbortRequest!==void 0&&(l._pendingAbortRequest._reject(u),l._pendingAbortRequest=void 0),yt(l,u),null;var l,u})}(e):function(o,i){const n=o._controlledWritableStream;var s;(s=n)._inFlightWriteRequest=s._writeRequests.shift(),z(o._writeAlgorithm(i),()=>{var a;(a=n)._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0;const l=n._state;if(ht(o),!F(n)&&l==="writable"){const u=Ft(o);Bt(n,u)}return tt(o),null},a=>{return n._state==="writable"&&Je(o),u=a,(l=n)._inFlightWriteRequest._reject(u),l._inFlightWriteRequest=void 0,yt(l,u),null;var l,u})}(e,r)}function vt(e,t){e._controlledWritableStream._state==="writable"&&Vr(e,t)}function Ft(e){return Yr(e)<=0}function Vr(e,t){const r=e._controlledWritableStream;Je(e),Wt(r,t)}function Ie(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function ct(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Z(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Ee(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function He(e){e._closedPromise=C((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"})}function Ur(e,t){He(e),It(e,t)}function It(e,t){e._closedPromise_reject!==void 0&&(Ae(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function Hr(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function rt(e){e._readyPromise=C((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r}),e._readyPromiseState="pending"}function wt(e,t){rt(e),Gr(e,t)}function Jt(e){rt(e),Lt(e)}function Gr(e,t){e._readyPromise_reject!==void 0&&(Ae(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Lt(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Oe.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Oe.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const co=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:void 0,fo=function(){const e=co?.DOMException;return function(t){if(typeof t!="function"&&typeof t!="object"||t.name!=="DOMException")return!1;try{return new t,!0}catch{return!1}}(e)?e:void 0}()||function(){const e=function(t,r){this.message=t||"",this.name=r||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return p(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Kt(e,t,r,o,i,n){const s=fe(e),a=Ir(t);e._disturbed=!0;let l=!1,u=y(void 0);return C((b,d)=>{let h;if(n!==void 0){if(h=()=>{const f=n.reason!==void 0?n.reason:new fo("Aborted","AbortError"),m=[];o||m.push(()=>t._state==="writable"?Xe(t,f):y(void 0)),i||m.push(()=>e._state==="readable"?W(e,f):y(void 0)),T(()=>Promise.all(m.map(S=>S())),!0,f)},n.aborted)return void h();n.addEventListener("abort",h)}var R,E,g;if(_(e,s._closedPromise,f=>(o?I(!0,f):T(()=>Xe(t,f),!0,f),null)),_(t,a._closedPromise,f=>(i?I(!0,f):T(()=>W(e,f),!0,f),null)),R=e,E=s._closedPromise,g=()=>(r?I():T(()=>function(f){const m=f._ownerWritableStream,S=m._state;return F(m)||S==="closed"?y(void 0):S==="errored"?c(m._storedError):$r(f)}(a)),null),R._state==="closed"?g():ot(E,g),F(t)||t._state==="closed"){const f=new TypeError("the destination writable stream closed before all data could be piped to it");i?I(!0,f):T(()=>W(e,f),!0,f)}function w(){const f=u;return B(u,()=>f!==u?w():void 0)}function _(f,m,S){f._state==="errored"?S(f._storedError):ft(m,S)}function T(f,m,S){function O(){return z(f(),()=>v(m,S),j=>v(!0,j)),null}l||(l=!0,t._state!=="writable"||F(t)?O():ot(w(),O))}function I(f,m){l||(l=!0,t._state!=="writable"||F(t)?v(f,m):ot(w(),()=>v(f,m)))}function v(f,m){return Mr(a),M(s),n!==void 0&&n.removeEventListener("abort",h),f?d(m):b(void 0),null}Ae(C((f,m)=>{(function S(O){O?f():B(l?y(!0):B(a._readyPromise,()=>C((j,x)=>{Ce(s,{_chunkSteps:ge=>{u=B(xr(a,ge),void 0,Pe),j(!1)},_closeSteps:()=>j(!0),_errorSteps:x})})),S,m)})(!1)}))})}class D{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Le(this))throw $e("desiredSize");return $t(this)}close(){if(!Le(this))throw $e("close");if(!ve(this))throw new TypeError("The stream is not in a state that permits close");me(this)}enqueue(t=void 0){if(!Le(this))throw $e("enqueue");if(!ve(this))throw new TypeError("The stream is not in a state that permits enqueue");return ye(this,t)}error(t=void 0){if(!Le(this))throw $e("error");X(this,t)}[St](t){K(this);const r=this._cancelAlgorithm(t);return Ke(this),r}[Rt](t){const r=this._controlledReadableStream;if(this._queue.length>0){const o=ht(this);this._closeRequested&&this._queue.length===0?(Ke(this),We(r)):je(this),t._chunkSteps(o)}else lr(r,t),je(this)}[Tt](){}}function Le(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof D}function je(e){Xr(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,z(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,je(e)),null),t=>(X(e,t),null))))}function Xr(e){const t=e._controlledReadableStream;return!!ve(e)&&!!e._started&&(!!(G(t)&&Ze(t)>0)||$t(e)>0)}function Ke(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function me(e){if(!ve(e))return;const t=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Ke(e),We(t))}function ye(e,t){if(!ve(e))return;const r=e._controlledReadableStream;if(G(r)&&Ze(r)>0)Ot(r,t,!1);else{let o;try{o=e._strategySizeAlgorithm(t)}catch(i){throw X(e,i),i}try{jt(e,t,o)}catch(i){throw X(e,i),i}}je(e)}function X(e,t){const r=e._controlledReadableStream;r._state==="readable"&&(K(e),Ke(e),Kr(r,t))}function $t(e){const t=e._controlledReadableStream._state;return t==="errored"?null:t==="closed"?0:e._strategyHWM-e._queueTotalSize}function ve(e){const t=e._controlledReadableStream._state;return!e._closeRequested&&t==="readable"}function Jr(e,t,r,o,i,n,s){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,K(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=s,t._strategyHWM=n,t._pullAlgorithm=o,t._cancelAlgorithm=i,e._readableStreamController=t,z(y(r()),()=>(t._started=!0,je(t),null),a=>(X(t,a),null))}function $e(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function bo(e){return q(t=e)&&t.getReader!==void 0?function(r){let o;return o=Qe(Pe,function(){let i;try{i=r.read()}catch(n){return c(n)}return ae(i,n=>{if(!q(n))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(n.done)me(o._readableStreamController);else{const s=n.value;ye(o._readableStreamController,s)}})},function(i){try{return y(r.cancel(i))}catch(n){return c(n)}},0),o}(e.getReader()):function(r){let o;const i=br(r,"async");return o=Qe(Pe,function(){let n;try{n=hr(i)}catch(s){return c(s)}return ae(y(n),s=>{if(!q(s))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(s.done)me(o._readableStreamController);else{const a=s.value;ye(o._readableStreamController,a)}})},function(n){const s=i.iterator;let a;try{a=Te(s,"return")}catch(l){return c(l)}return a===void 0?y(void 0):ae(we(a,s,[n]),l=>{if(!q(l))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})},0),o}(e);var t}function ho(e,t,r){return J(e,r),o=>we(e,t,[o])}function _o(e,t,r){return J(e,r),o=>we(e,t,[o])}function po(e,t,r){return J(e,r),o=>pe(e,t,[o])}function mo(e,t){if((e=`${e}`)!="bytes")throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function Qt(e,t){U(e,t);const r=e?.preventAbort,o=e?.preventCancel,i=e?.preventClose,n=e?.signal;return n!==void 0&&function(s,a){if(!function(l){if(typeof l!="object"||l===null)return!1;try{return typeof l.aborted=="boolean"}catch{return!1}}(s))throw new TypeError(`${a} is not an AbortSignal.`)}(n,`${t} has member 'signal' that`),{preventAbort:!!r,preventCancel:!!o,preventClose:!!i,signal:n}}Object.defineProperties(D.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),p(D.prototype.close,"close"),p(D.prototype.enqueue,"enqueue"),p(D.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(D.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class P{constructor(t={},r={}){t===void 0?t=null:ar(t,"First parameter");const o=Br(r,"Second parameter"),i=function(n,s){U(n,s);const a=n,l=a?.autoAllocateChunkSize,u=a?.cancel,b=a?.pull,d=a?.start,h=a?.type;return{autoAllocateChunkSize:l===void 0?void 0:Pt(l,`${s} has member 'autoAllocateChunkSize' that`),cancel:u===void 0?void 0:ho(u,a,`${s} has member 'cancel' that`),pull:b===void 0?void 0:_o(b,a,`${s} has member 'pull' that`),start:d===void 0?void 0:po(d,a,`${s} has member 'start' that`),type:h===void 0?void 0:mo(h,`${s} has member 'type' that`)}}(t,"First parameter");if(Dt(this),i.type==="bytes"){if(o.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");(function(n,s,a){const l=Object.create($.prototype);let u,b,d;u=s.start!==void 0?()=>s.start(l):()=>{},b=s.pull!==void 0?()=>s.pull(l):()=>y(void 0),d=s.cancel!==void 0?R=>s.cancel(R):()=>y(void 0);const h=s.autoAllocateChunkSize;if(h===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");jr(n,l,u,b,d,a,h)})(this,i,mt(o,0))}else{const n=zr(o);(function(s,a,l,u){const b=Object.create(D.prototype);let d,h,R;d=a.start!==void 0?()=>a.start(b):()=>{},h=a.pull!==void 0?()=>a.pull(b):()=>y(void 0),R=a.cancel!==void 0?E=>a.cancel(E):()=>y(void 0),Jr(s,b,d,h,R,l,u)})(this,i,mt(o,1),n)}}get locked(){if(!N(this))throw ee("locked");return G(this)}cancel(t=void 0){return N(this)?G(this)?c(new TypeError("Cannot cancel a stream that already has a reader")):W(this,t):c(ee("cancel"))}getReader(t=void 0){if(!N(this))throw ee("getReader");return function(r,o){U(r,o);const i=r?.mode;return{mode:i===void 0?void 0:no(i,`${o} has member 'mode' that`)}}(t,"First parameter").mode===void 0?fe(this):Gt(this)}pipeThrough(t,r={}){if(!N(this))throw ee("pipeThrough");le(t,1,"pipeThrough");const o=function(n,s){U(n,s);const a=n?.readable;xt(a,"readable","ReadableWritablePair"),Ct(a,`${s} has member 'readable' that`);const l=n?.writable;return xt(l,"writable","ReadableWritablePair"),Fr(l,`${s} has member 'writable' that`),{readable:a,writable:l}}(t,"First parameter"),i=Qt(r,"Second parameter");if(G(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(_e(o.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Ae(Kt(this,o.writable,i.preventClose,i.preventAbort,i.preventCancel,i.signal)),o.readable}pipeTo(t,r={}){if(!N(this))return c(ee("pipeTo"));if(t===void 0)return c("Parameter 1 is required in 'pipeTo'.");if(!be(t))return c(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let o;try{o=Qt(r,"Second parameter")}catch(i){return c(i)}return G(this)?c(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):_e(t)?c(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Kt(this,t,o.preventClose,o.preventAbort,o.preventCancel,o.signal)}tee(){if(!N(this))throw ee("tee");return Se(re(this._readableStreamController)?function(t){let r,o,i,n,s,a=fe(t),l=!1,u=!1,b=!1,d=!1,h=!1;const R=C(v=>{s=v});function E(v){ft(v._closedPromise,f=>(v!==a||(A(i._readableStreamController,f),A(n._readableStreamController,f),d&&h||s(void 0)),null))}function g(){ie(a)&&(M(a),a=fe(t),E(a)),Ce(a,{_chunkSteps:v=>{se(()=>{u=!1,b=!1;const f=v;let m=v;if(!d&&!h)try{m=Ht(v)}catch(S){return A(i._readableStreamController,S),A(n._readableStreamController,S),void s(W(t,S))}d||Ye(i._readableStreamController,f),h||Ye(n._readableStreamController,m),l=!1,u?_():b&&T()})},_closeSteps:()=>{l=!1,d||qe(i._readableStreamController),h||qe(n._readableStreamController),i._readableStreamController._pendingPullIntos.length>0&&Ve(i._readableStreamController,0),n._readableStreamController._pendingPullIntos.length>0&&Ve(n._readableStreamController,0),d&&h||s(void 0)},_errorSteps:()=>{l=!1}})}function w(v,f){H(a)&&(M(a),a=Gt(t),E(a));const m=f?n:i,S=f?i:n;kr(a,v,1,{_chunkSteps:O=>{se(()=>{u=!1,b=!1;const j=f?h:d;if(f?d:h)j||Ue(m._readableStreamController,O);else{let x;try{x=Ht(O)}catch(ge){return A(m._readableStreamController,ge),A(S._readableStreamController,ge),void s(W(t,ge))}j||Ue(m._readableStreamController,O),Ye(S._readableStreamController,x)}l=!1,u?_():b&&T()})},_closeSteps:O=>{l=!1;const j=f?h:d,x=f?d:h;j||qe(m._readableStreamController),x||qe(S._readableStreamController),O!==void 0&&(j||Ue(m._readableStreamController,O),!x&&S._readableStreamController._pendingPullIntos.length>0&&Ve(S._readableStreamController,0)),j&&x||s(void 0)},_errorSteps:()=>{l=!1}})}function _(){if(l)return u=!0,y(void 0);l=!0;const v=pt(i._readableStreamController);return v===null?g():w(v._view,!1),y(void 0)}function T(){if(l)return b=!0,y(void 0);l=!0;const v=pt(n._readableStreamController);return v===null?g():w(v._view,!0),y(void 0)}function I(){}return i=Zt(I,_,function(v){if(d=!0,r=v,h){const f=Se([r,o]),m=W(t,f);s(m)}return R}),n=Zt(I,T,function(v){if(h=!0,o=v,d){const f=Se([r,o]),m=W(t,f);s(m)}return R}),E(a),[i,n]}(this):function(t){const r=fe(t);let o,i,n,s,a,l=!1,u=!1,b=!1,d=!1;const h=C(g=>{a=g});function R(){return l?(u=!0,y(void 0)):(l=!0,Ce(r,{_chunkSteps:g=>{se(()=>{u=!1;const w=g,_=g;b||ye(n._readableStreamController,w),d||ye(s._readableStreamController,_),l=!1,u&&R()})},_closeSteps:()=>{l=!1,b||me(n._readableStreamController),d||me(s._readableStreamController),b&&d||a(void 0)},_errorSteps:()=>{l=!1}}),y(void 0))}function E(){}return n=Qe(E,R,function(g){if(b=!0,o=g,d){const w=Se([o,i]),_=W(t,w);a(_)}return h}),s=Qe(E,R,function(g){if(d=!0,i=g,b){const w=Se([o,i]),_=W(t,w);a(_)}return h}),ft(r._closedPromise,g=>(X(n._readableStreamController,g),X(s._readableStreamController,g),b&&d||a(void 0),null)),[n,s]}(this))}values(t=void 0){if(!N(this))throw ee("values");return function(o,i){const n=fe(o),s=new _r(n,i),a=Object.create(pr);return a._asyncIteratorImpl=s,a}(this,(r=t,U(r,"First parameter"),{preventCancel:!!r?.preventCancel}).preventCancel);var r}[ke](t){return this.values(t)}static from(t){return bo(t)}}function Qe(e,t,r,o=1,i=()=>1){const n=Object.create(P.prototype);return Dt(n),Jr(n,Object.create(D.prototype),e,t,r,o,i),n}function Zt(e,t,r){const o=Object.create(P.prototype);return Dt(o),jr(o,Object.create($.prototype),e,t,r,0,void 0),o}function Dt(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function N(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof P}function G(e){return e._reader!==void 0}function W(e,t){if(e._disturbed=!0,e._state==="closed")return y(void 0);if(e._state==="errored")return c(e._storedError);We(e);const r=e._reader;if(r!==void 0&&ie(r)){const o=r._readIntoRequests;r._readIntoRequests=new k,o.forEach(i=>{i._closeSteps(void 0)})}return ae(e._readableStreamController[St](t),Pe)}function We(e){e._state="closed";const t=e._reader;if(t!==void 0&&(ir(t),H(t))){const r=t._readRequests;t._readRequests=new k,r.forEach(o=>{o._closeSteps()})}}function Kr(e,t){e._state="errored",e._storedError=t;const r=e._reader;r!==void 0&&(Et(r,t),H(r)?cr(r,t):Wr(r,t))}function ee(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function dt(e,t){var r,o;(r=e._transformStreamController)._transformAlgorithm=void 0,r._flushAlgorithm=void 0,r._cancelAlgorithm=void 0,vt(e._writable._writableStreamController,t),(o=e)._backpressure&&Qr(o,!1)}function Qr(e,t){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=C(r=>{e._backpressureChangePromise_resolve=r}),e._backpressure=t}Object.defineProperties(P,{from:{enumerable:!0}}),Object.defineProperties(P.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),p(P.from,"from"),p(P.prototype.cancel,"cancel"),p(P.prototype.getReader,"getReader"),p(P.prototype.pipeThrough,"pipeThrough"),p(P.prototype.pipeTo,"pipeTo"),p(P.prototype.tee,"tee"),p(P.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(P.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(P.prototype,ke,{value:P.prototype.values,writable:!0,configurable:!0}),p(e=>e.byteLength,"size"),p(()=>1,"size");class te{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!De(this))throw Me("desiredSize");return $t(this._controlledTransformStream._readable._readableStreamController)}enqueue(t=void 0){if(!De(this))throw Me("enqueue");(function(r,o){const i=r._controlledTransformStream,n=i._readable._readableStreamController;if(!ve(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{ye(n,o)}catch(s){throw dt(i,s),i._readable._storedError}!Xr(n)!==i._backpressure&&Qr(i,!0)})(this,t)}error(t=void 0){if(!De(this))throw Me("error");var r,o;o=t,X((r=this._controlledTransformStream)._readable._readableStreamController,o),dt(r,o)}terminate(){if(!De(this))throw Me("terminate");(function(t){const r=t._controlledTransformStream;me(r._readable._readableStreamController),dt(r,new TypeError("TransformStream terminated"))})(this)}}function De(e){return!!q(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof te}function Me(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}Object.defineProperties(te.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),p(te.prototype.enqueue,"enqueue"),p(te.prototype.error,"error"),p(te.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(te.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0}),exports.ReadableByteStreamController=$,exports.ReadableStream=P,exports.ReadableStreamBYOBReader=V,exports.ReadableStreamBYOBRequest=ne,exports.ReadableStreamDefaultController=D,exports.ReadableStreamDefaultReader=Y,exports.TransformStreamDefaultController=te,exports.WritableStream=oe,exports.WritableStreamDefaultController=Oe,exports.WritableStreamDefaultWriter=L;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.0.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.default={DELAY:{s:"Returns the input value after a delay.",p:{time:{d:"the delay time in milliseconds. Default is 1000ms (1 second)."},input:{d:"returns the input."},label:{d:"optional label for the delay function.",v:"No label"}},h:"Testing"},WAIT:{s:"Starts waiting for event",p:{type:{d:"the type of message."},input:{d:"an optional dependency."}},h:"Testing"}};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.0.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.default={DATE:{s:"Returns the number that represents the date in Microsoft Excel date-time code",p:{year:{d:"is a number from 1900 or 1904 (depending on the workbook's date system) to 9999"},month:{d:"is a number from 1 to 12 representing the month of the year"},day:{d:"is a number from 1 to 31 representing the day of the month"}}},DATEDIF:{s:"Returns the number of days between two dates",p:{startDate:{d:"is a serial date number that represents the start date"},endDate:{d:"is a serial date number that represents the end date"},unit:{d:"is a string that specifies the unit of time to use"}},h:"Legacy"},DATESTRING:{s:"Returns NA.",p:{number:{d:"is a number that is ignored"}},h:"Legacy"},DATEVALUE:{s:"Converts a date in the form of text to a number that represents the date in Microsoft Excel date-time code",p:{dateText:{d:"is text that represents a date in a Microsoft Excel date format, between 1/1/1900 or 1/1/1904 (depending on the workbook's date system) and 12/31/9999"}}},DAY:{s:"Returns the day of the month, a number from 1 to 31.",p:{serialOrString:{d:"is a number in the date-time code used by Excel or text in time format, such as 16:48:00 or 4:48:00 PM"}}},DAYS:{s:"Returns the number of days between the two dates.",p:{endDate:{d:"start_date and end_date are the two dates between which you want to know the number of days"},startDate:{d:"start_date and end_date are the two dates between which you want to know the number of days"}}},DAYS360:{s:"Returns the number of days between two dates based on a 360-day year (twelve 30-day months)",p:{startDate:{d:"start_date and end_date are the two dates between which you want to know the number of days"},endDate:{d:"start_date and end_date are the two dates between which you want to know the number of days"},method:{d:"is a logical value specifying the calculation method: U.S. (NASD) = FALSE; European = TRUE.",v:!1}}},EDATE:{s:"Returns the serial number of the date that is the indicated number of months before or after the start date",p:{startDate:{d:"is a serial date number that represents the start date"},months:{d:"is the number of months before or after start_date"}}},EOMONTH:{s:"Returns the serial number of the last day of the month before or after a specified number of months",p:{startDate:{d:"is a serial date number that represents the start date"},months:{d:"is the number of months before or after the start_date"}}},HOUR:{s:"Returns the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.).",p:{serialOrString:{d:"is a number in the date-time code used by Excel or text in time format, such as 16:48:00 or 4:48:00 PM"}}},ISOWEEKNUM:{s:"Returns the ISO week number in the year for a given date",p:{serialOrString:{d:"is a number in the date-time code used by Excel or text in time format, such as 16:48:00 or 4:48:00 PM"}}},MINUTE:{s:"Returns the minute, a number from 0 to 59.",p:{serialOrString:{d:"is a number in the date-time code used by Excel or text in time format, such as 16:48:00 or 4:48:00 PM"}}},MONTH:{s:"Returns the month, a number from 1 (January) to 12 (December).",p:{serialOrString:{d:"is a number in the date-time code used by Excel"}}},NETWORKDAYS:{s:"Returns the number of whole workdays between two dates",p:{startDate:{d:"is a serial date number that represents the start date"},endDate:{d:"is a serial date number that represents the end date"},holidays:{d:"is an optional set of one or more serial date numbers to exclude from the working calendar, such as state and federal holidays and floating holidays",v:null}}},"NETWORKDAYS.INTL":{s:"Returns the number of whole workdays between two dates with custom weekend parameters",p:{startDate:{d:"is a serial date number that represents the start date"},endDate:{d:"is a serial date number that represents the end date"},weekend:{d:"is a number or string specifying when weekends occur",v:1},holidays:{d:"is an optional set of one or more serial date numbers to exclude from the working calendar, such as state and federal holidays and floating holidays",v:null}}},NOW:{s:"Returns the current date and time formatted as a date and time.",p:{}},SECOND:{s:"Returns the second, a number from 0 to 59.",p:{serialOrString:{d:"is a number in the date-time code used by Excel or text in time format, such as 16:48:23 or 4:48:47 PM"}}},TIME:{s:"Converts hours, minutes, and seconds given as numbers to an Excel serial number, formatted with a time format",p:{hour:{d:"is a number from 0 to 23 representing the hour"},minute:{d:"is a number from 0 to 59 representing the minute"},second:{d:"is a number from 0 to 59 representing the second"}}},TIMEVALUE:{s:"Converts a text time to an Excel serial number for a time, a number from 0 (12:00:00 AM) to 0.999988426 (11:59:59 PM). Format the number with a time format after entering the formula",p:{timeText:{d:"is a text string that gives a time in any one of the Excel time formats (date information in the string is ignored)"}}},TODAY:{s:"Returns the current date formatted as a date.",p:{}},WEEKDAY:{s:"Returns a number from 1 to 7 identifying the day of the week of a date.",p:{serialOrString:{d:"is a number that represents a date"},returnType:{d:"is a number: for Sunday=1 through Saturday=7, use 1; for Monday=1 through Sunday=7, use 2; for Monday=0 through Sunday=6, use 3",v:1}}},WEEKNUM:{s:"Returns the week number in the year",p:{serialOrString:{d:"is the date-time code used by Excel for date and time calculation"},returnType:{d:"is a number (1 or 2) that determines the type of the return value",v:1}}},WORKDAY:{s:"Returns the serial number of the date before or after a specified number of workdays",p:{startDate:{d:"is a serial date number that represents the start date"},days:{d:"is the number of nonweekend and non-holiday days before or after start_date"},holidays:{d:"is an optional array of one or more serial date numbers to exclude from the working calendar, such as state and federal holidays and floating holidays",v:null}}},"WORKDAY.INTL":{s:"Returns the serial number of the date before or after a specified number of workdays with custom weekend parameters",p:{startDate:{d:"is a serial date number that represents the start date"},days:{d:"is the number of nonweekend and non-holiday days before or after start_date"},weekend:{d:"is a number or string specifying when weekends occur",v:1},holidays:{d:"is an optional array of one or more serial date numbers to exclude from the working calendar, such as state and federal holidays and floating holidays",v:null}}},YEAR:{s:"Returns the year of a date, an integer in the range 1900 - 9999.",p:{serialOrString:{d:"is a number in the date-time code used by Excel"}}},YEARFRAC:{s:"Returns the year fraction representing the number of whole days between start_date and end_date",p:{startDate:{d:"is a serial date number that represents the start date"},endDate:{d:"is a serial date number that represents the end date"},basis:{d:"is the type of day count basis to use",v:0}}}};
|