@sheetxl/studio-vanilla 0.4.9 → 0.4.11

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.
Files changed (133) hide show
  1. package/README.md +1 -1
  2. package/browser/cjs/B0rdyyttE2Aibsag.cjs +7 -0
  3. package/browser/cjs/B2e7dDI-zKoqXpIW.cjs +107 -0
  4. package/browser/cjs/BAyEOOtO-9sHQQRW.cjs +7 -0
  5. package/browser/cjs/BPTHTRDvNOVkUJGa.cjs +7 -0
  6. package/browser/cjs/BlSFY6zLlebuejdV.cjs +7 -0
  7. package/browser/cjs/BplA5pDzOJpfTZuA.cjs +7 -0
  8. package/browser/cjs/BshvMtUxTJHj3JQN.cjs +7 -0
  9. package/browser/cjs/BuWtGFX0HiBezGjw.cjs +7 -0
  10. package/browser/cjs/C5FXOMLhAu_KTjVe.cjs +7 -0
  11. package/browser/cjs/C7EZCTczsC-gkRcq.cjs +7 -0
  12. package/browser/cjs/CFcjX5-nVsgzdZ4F.cjs +7 -0
  13. package/browser/cjs/CjZbhk41S1qO_74G.cjs +7 -0
  14. package/browser/cjs/CuTW2Pt-L5n-hNxV.cjs +7 -0
  15. package/browser/cjs/D3iOk-Q2tRdUeTcn.cjs +7 -0
  16. package/browser/cjs/DFspSkki779xN-Ey.cjs +7 -0
  17. package/browser/cjs/DFtyXc7YFh9dIp74.cjs +7 -0
  18. package/browser/cjs/Db_Ew1r6yOMYylvA.cjs +7 -0
  19. package/browser/cjs/DgBn3aW39yjgm0X_.cjs +7 -0
  20. package/browser/cjs/DiBy6-IxLscyMW2y.cjs +7 -0
  21. package/browser/cjs/DrlS1oz9Nea8Pm3j.cjs +7 -0
  22. package/browser/cjs/Dx-jp_LJxWbAScyA.cjs +7 -0
  23. package/browser/cjs/SzxJv7OUs5ojl8gx.cjs +7 -0
  24. package/browser/cjs/T4SHYo66xDT3l9JN.cjs +7 -0
  25. package/browser/cjs/index.cjs +4 -3
  26. package/browser/cjs/vfUix5Di0Ro8tEID.cjs +7 -0
  27. package/browser/esm/B5kkStdEkTczERyM.mjs +7 -0
  28. package/browser/esm/B905wKzTtod-jbsD.mjs +7 -0
  29. package/browser/esm/BALnKy2Fp7fyk-lc.mjs +7 -0
  30. package/browser/esm/BDVJ7eOPpW5FnEAP.mjs +7 -0
  31. package/browser/esm/BGpv6Kq7eBlJy43T.mjs +7 -0
  32. package/browser/esm/BUSR_OK5Qi6hRPfw.mjs +7 -0
  33. package/browser/esm/BXUGsC1Mo3FP8vnW.mjs +7 -0
  34. package/browser/esm/BlGoi1_x9rUMpWMd.mjs +7 -0
  35. package/browser/esm/Bo_ZPRrOQrqOVHAF.mjs +7 -0
  36. package/browser/esm/BuURCm92KsyGHG9e.mjs +7 -0
  37. package/browser/esm/CFFC0SNc24a0Dxnh.mjs +7 -0
  38. package/browser/esm/CGZ5MX7afzMxDkCe.mjs +7 -0
  39. package/browser/esm/Cc_VWd0wF5-39LsI.mjs +7 -0
  40. package/browser/esm/Cq8D_M0jeHLcnRjg.mjs +7 -0
  41. package/browser/esm/CzmNwV9tfFYUp_gS.mjs +7 -0
  42. package/browser/esm/De6RPxc4p_jXLlT5.mjs +7 -0
  43. package/browser/esm/DlVZFM9ZR5jGyG0_.mjs +7 -0
  44. package/browser/esm/DqXxZP6yKF4U1YfY.mjs +7 -0
  45. package/browser/esm/DtmE60AvstK9u0Ta.mjs +107 -0
  46. package/browser/esm/Dz2OVgq3kxi1TkfX.mjs +7 -0
  47. package/browser/esm/PS0cqYnlMVEGOQpI.mjs +7 -0
  48. package/browser/esm/QBGUD1XS5_pysBLL.mjs +7 -0
  49. package/browser/esm/index.mjs +2 -8
  50. package/browser/esm/tFhROdVSw9KLQfUN.mjs +7 -0
  51. package/browser/esm/uGDCdtqxjqRCo4Xn.mjs +7 -0
  52. package/cdn/index.js +40 -44
  53. package/cdn/loader.js +1 -1
  54. package/package.json +5 -5
  55. package/types/index.d.ts +9 -9
  56. package/browser/cjs/3GhIDU8JK1oBJrCA.cjs +0 -6
  57. package/browser/cjs/5hPVyVAXmITQCRAG.cjs +0 -6
  58. package/browser/cjs/7PlrLPQx1lct0mdN.cjs +0 -6
  59. package/browser/cjs/B4K6KuggSdXj-V8g.cjs +0 -6
  60. package/browser/cjs/B5Qc3gXLEhscRsFm.cjs +0 -12
  61. package/browser/cjs/B7eW1GQgFvphlLGY.cjs +0 -6
  62. package/browser/cjs/BQPFxJ77OaD_sBIX.cjs +0 -6
  63. package/browser/cjs/Ba3O1f0NYbzEwNAd.cjs +0 -6
  64. package/browser/cjs/BoojmbbjqixMVu2H.cjs +0 -6
  65. package/browser/cjs/CSGVl8EBCRhxcFm1.cjs +0 -15
  66. package/browser/cjs/CalnqtYH48_x2rcI.cjs +0 -301
  67. package/browser/cjs/CjDsO4sQWUHbIX1N.cjs +0 -6
  68. package/browser/cjs/CsCaFaiySArzEfdH.cjs +0 -7
  69. package/browser/cjs/D6AUUY9awlTRjjqd.cjs +0 -11
  70. package/browser/cjs/D8lN5Mv3J4SwSpLP.cjs +0 -161
  71. package/browser/cjs/D9RQ5oYv7U38wSI7.cjs +0 -11
  72. package/browser/cjs/DCd2rPNFkSHDaRcM.cjs +0 -7
  73. package/browser/cjs/DGQrcBvjSGwwoZEv.cjs +0 -6
  74. package/browser/cjs/DIXyMJKaeCGuWxjZ.cjs +0 -12
  75. package/browser/cjs/Dmw7xaaV85s72QZe.cjs +0 -145
  76. package/browser/cjs/DzCXPcqV1oKbCcLO.cjs +0 -16
  77. package/browser/cjs/EoaX6dPoS-Mb-ITO.cjs +0 -42
  78. package/browser/cjs/Y6OgkWqbIB761o5q.cjs +0 -6
  79. package/browser/cjs/gbABnN2zW1kHo3_I.cjs +0 -19
  80. package/browser/cjs/kfV5Cli9oE9IsCtx.cjs +0 -6
  81. package/browser/cjs/nURb18uhj9rScsHa.cjs +0 -6
  82. package/browser/esm/2NQDbhor1Nuzndgq.mjs +0 -3756
  83. package/browser/esm/4aC35Q2XPOwifBRR.mjs +0 -1365
  84. package/browser/esm/5zFDFBAgT-aPgQQ0.mjs +0 -1665
  85. package/browser/esm/B3I_TrFN_pAK5Mdh.mjs +0 -2346
  86. package/browser/esm/BD9GKsR-k4aEK2tx.mjs +0 -421
  87. package/browser/esm/BQpsMTJvguy6LMIq.mjs +0 -43
  88. package/browser/esm/BfCWogOnq8R-c3dD.mjs +0 -21
  89. package/browser/esm/BkGQPKMRPIVUVTLO.mjs +0 -944
  90. package/browser/esm/C81J50HcankGTOIj.mjs +0 -390
  91. package/browser/esm/CO_s27056nua6qzN.mjs +0 -1346
  92. package/browser/esm/CPEjlDUTxckVS1rp.mjs +0 -50
  93. package/browser/esm/CY7astxzrfb7uZqy.mjs +0 -2178
  94. package/browser/esm/CZVzRhflTpwAAl1o.mjs +0 -22
  95. package/browser/esm/CaWZXQsmKl4hTNq5.mjs +0 -46
  96. package/browser/esm/CxcLNXXaxyFyUzyb.mjs +0 -633
  97. package/browser/esm/D0icxW0WVNoeVRLH.mjs +0 -58
  98. package/browser/esm/DFQvqk5r1uf_z0h_.mjs +0 -24994
  99. package/browser/esm/DRL5s4S0fIXi1aU7.mjs +0 -84
  100. package/browser/esm/DRmeb1VC4YCzKKWd.mjs +0 -13208
  101. package/browser/esm/DTwhl4v5YnZrUSgI.mjs +0 -24
  102. package/browser/esm/DmpPAs6w-XNWGTIN.mjs +0 -1703
  103. package/browser/esm/Dx-GS3XDBkRaMNG-.mjs +0 -151
  104. package/browser/esm/V5CA7xqGOB7-Qx4Y.mjs +0 -1467
  105. package/browser/esm/gsfI5CGYr7LCQxRx.mjs +0 -41
  106. package/browser/esm/tOBqasyBAnd7O4qE.mjs +0 -46
  107. package/browser/esm/tPrnEcHW_czJDZOT.mjs +0 -50
  108. package/cdn/assets/2NQDbhor1Nuzndgq.js +0 -3756
  109. package/cdn/assets/4aC35Q2XPOwifBRR.js +0 -1365
  110. package/cdn/assets/5zFDFBAgT-aPgQQ0.js +0 -1665
  111. package/cdn/assets/B0w_moB3pDJd-a6V.js +0 -24
  112. package/cdn/assets/BD9GKsR-k4aEK2tx.js +0 -421
  113. package/cdn/assets/BJVOhUH_XL03H6ZD.js +0 -22
  114. package/cdn/assets/BWJOkXXB6Tr-jYUS.js +0 -46
  115. package/cdn/assets/BapFqJyAb3cblvJM.js +0 -50
  116. package/cdn/assets/Bg88bG-JM9EHeyYX.js +0 -41
  117. package/cdn/assets/C81J50HcankGTOIj.js +0 -390
  118. package/cdn/assets/CO_s27056nua6qzN.js +0 -1346
  119. package/cdn/assets/CXa9u-7w14dyPYxk.js +0 -1703
  120. package/cdn/assets/CkcETdiKdTsZAzma.js +0 -1467
  121. package/cdn/assets/CxcLNXXaxyFyUzyb.js +0 -633
  122. package/cdn/assets/D0PaU6F-TNaTWj-a.js +0 -43
  123. package/cdn/assets/D4hoypx6_sZbvrC_.js +0 -2346
  124. package/cdn/assets/D5exf1RvCqvUoJ3X.js +0 -2178
  125. package/cdn/assets/DKLitAhDj5Ibh2cc.js +0 -24841
  126. package/cdn/assets/DRL5s4S0fIXi1aU7.js +0 -84
  127. package/cdn/assets/DRmeb1VC4YCzKKWd.js +0 -13208
  128. package/cdn/assets/DYkBvlMlZjOASUJs.js +0 -58
  129. package/cdn/assets/ON5--a75QdEU99y_.js +0 -151
  130. package/cdn/assets/PIZDjyqIbvmHXs1T.js +0 -46
  131. package/cdn/assets/TOkIJFYhNg78FdJa.js +0 -21
  132. package/cdn/assets/b9dlFmoFz8tJhV0Z.js +0 -50
  133. package/cdn/assets/d1PG-QPA1GcQ_RuH.js +0 -944
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.9
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 I=require("./CalnqtYH48_x2rcI.cjs"),p=require("./D9RQ5oYv7U38wSI7.cjs"),d=require("@sheetxl/sdk");class G{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 W=u=>u===!0||u==="1"||u==="on"||u==="true"||u!==!1&&u!=="0"&&u!=="off"&&u!=="false"&&null,X=u=>{const t=parseInt(u);return isNaN(t)?null:t},$=u=>{const t=parseFloat(u);return isNaN(t)?null:t},K=new Map;class S{constructor(t,e,s,r,o,i=null,n){const l=(c,h,g)=>n?.getRef?.(c,h,g,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)??K}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 g=a.childNodes[h];g.localName!==i&&i!=="*"||n.push(g)}}s=n}return s.length===1?s[0]:s.length===0?null:new G(s)}getFromPath(t,e){return I.Jt.getFromPath(t,e)}setToPath(t,e,s){return I.Jt.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 W}get INT_COPY(){return X}get FLOAT_COPY(){return $}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 H{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=I.Jt.roundAccurately(p.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 J{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 g={};s.series=g;for(let m=0;m<h.length;m++)g[m+""]=h[m];g.length=h.length}}class q{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 Q{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 M{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=p.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 g=0;g<c.length;g++){const m=c.item(g);h+=p.a(m.getAttribute("d"))+","+p.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=p.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=p.p(r.getAttribute("ang"));s.angle=c}if(r.hasAttribute("scaled")){const c=p.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),g={offset:p.a(h.getAttribute("pos")),color:this.processAdjColor(t,h)};l.push(g)}return l.length>0&&(s.stops=l),s}getRect(t){const e={};return t.hasAttribute("t")&&(e.t=p.a(t.getAttribute("t"))),t.hasAttribute("l")&&(e.l=p.a(t.getAttribute("l"))),t.hasAttribute("b")&&(e.b=p.a(t.getAttribute("b"))),t.hasAttribute("r")&&(e.r=p.a(t.getAttribute("r"))),Object.keys(e).length===0?null:e}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",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("+p.a(e.getAttribute("r"))+","+p.a(e.getAttribute("g"))+","+p.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("+p.p(e.getAttribute("hue"))+","+p.a(e.getAttribute("sat"))+","+p.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 M{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=p.c(a.getAttribute("x"))??0,l.y=p.c(a.getAttribute("y"))??0);const c=t.evaluate("ext",r);a&&(l.width=p.c(c.getAttribute("cx"))??0,l.height=p.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 Z 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 U=(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 tt{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){U(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 et{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"),U(t,e,i),i}}class rt{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 x{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 g=t.evaluate("t",c);const m=t.evaluate("rPr",c);m&&this.parseTextProperties(t,m,h),g?h.text=g.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=[d.IFont.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 st{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 ot{visit(t,e,s){const r={};return A(t,e,r,"overlay","overlay"),f(t,e,r,"legendPos","position"),s.legend=r,r}}class it 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 j 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 nt{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 lt{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class at extends M{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 ct{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=[d.IFont.getPanoseFallback(i)]),s}}class ut{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 ht{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:d.IAutoFilter.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:d.IAutoFilter.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:d.IAutoFilter.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:d.IAutoFilter.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:d.IAutoFilter.Type.Icon};return t.copyFromAttribute(e,"iconId",s,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",s),s}processTop10(t,e){const s={type:d.IAutoFilter.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=p.b(e.getAttribute("hiddenButton"))),r&&(s.hiddenButton=!0),e.hasAttribute("showButton")&&(s.showButton=p.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 pt{visit(t,e,s){if(!e)return;const r={};if(t.copyFromAttribute(e,"ref",r),e.hasAttribute("caseSensitive")){const n=p.b(e.getAttribute("caseSensitive"));r.collatorOptions=n?d.Sort.CaseSensitiveOptions:d.Sort.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")&&p.b(e.getAttribute("columnSort"))&&(r.orientation=d.IRange.Orientation.Column);const i=d.AddressUtils.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=d.AddressUtils.fastStringToRange(o);r.offset=s?i.colStart-s.colStart:i.colStart}return r.reverse=!1,e.hasAttribute("descending")&&(r.reverse=p.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 z{visit(t,e,s){}processDataBarColor(t,e,s,r,o="dk1"){if(!e)return;const i=p.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=d.IFont.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||d.IFont.UnderlineStyle.Single}f(t,e,s,"vertAlign","verticalAlign"),s.verticalAlign==="superscript"?s.verticalAlign=d.IFont.VerticalAlignment.Super:s.verticalAlign==="subscript"&&(s.verticalAlign=d.IFont.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:d.IFill.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=d.IFill.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 g=t.evaluate("color",a);this.processDataBarColor(t,g,c,"color")}}return s}processPatternFill(t,e,s){if(!e)return;const r=t.getVisitorParamsState().get("processingDXFs"),o=e.getAttribute("patternType")||(r?d.IFill.BuiltInSheetPattern.Solid:d.IFill.BuiltInSheetPattern.None);if(o===d.IFill.BuiltInSheetPattern.None)return{none:!0};s.type=d.IFill.Type.Pattern,o&&(s.patternType=o);let i,n="foreground",l="background";const a=s.patternType===d.IFill.BuiltInSheetPattern.Solid&&r;if(a){i="lt1";const g=n;n=l,l=g}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,d.IBorder.Edge.Left),this.processBorderStroke(t,e,i,d.IBorder.Edge.Right),o?(i.right||i.left)&&(i.right?i.vertical={...i.right}:i.vertical={...i.left}):this.processBorderStroke(t,e,i,d.IBorder.Edge.Vertical),this.processBorderStroke(t,e,i,d.IBorder.Edge.Top),this.processBorderStroke(t,e,i,d.IBorder.Edge.Bottom),o?(i.bottom||i.top)&&(i.right?i.horizontal={...i.bottom}:i.horizontal={...i.top}):this.processBorderStroke(t,e,i,d.IBorder.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 gt extends z{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:d.IFill.Type.None},r.fills[1]={type:d.IFill.Type.Pattern,patternType:d.IFill.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!==d.IStyle.BuiltInName.Normal&&(s.named=c)}const l=c=>!(!i&&e.hasAttribute(c))||p.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 g;const m=t.getVisitorParamsState();if(m){const b=m.get("numFmts");b&&(g=b.get(h)),s.numberFormat=g??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=p.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=d.ITextFrame.HorizontalAlignment.General,e?.hasAttribute("vertical")?r.vertical=e.getAttribute("vertical"):r.vertical=d.ITextFrame.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,p.b(e?.getAttribute("wrapText"))?r.overflow=d.ITextFrame.Overflow.Wrap:r.overflow=d.ITextFrame.Overflow.Visible,p.b(e?.getAttribute("shrinkToFit"))&&(r.overflow=d.ITextFrame.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=p.b(e.getAttribute("justifyLastLine")));const o=e?.getAttribute("readingOrder");return o&&(o==="0"?r.readingDirection=d.ITextFrame.ReadingDirection.Auto:o==="1"?r.readingDirection=d.ITextFrame.ReadingDirection.LeftToRight:o==="2"?r.readingDirection=d.ITextFrame.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&&!p.b(o)&&(r.edit=!0);const i=e.getAttribute("hidden");return i&&p.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=p.b(e.getAttribute("table"))),e.hasAttribute("pivot")&&(n.pivot=p.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"),g=c.getAttribute("dxfId");let m=r?.[g];m||(console.warn("invalid dfx id",g),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 g=a.item(h);g.nodeType===1&&g.localName==="tableStyle"&&this.processTableStyle(t,g,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=p.b(l.getAttribute("hidden"))),l.getAttribute("iLevel")&&(h.iLevel=parseInt(l.getAttribute("iLevel"))),s.push(h)}}}afterVisit(t,e,s){}}class dt extends z{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 mt{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 bt{visit(t,e,s){return s}}class k{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=p.c(t.evaluate("colOff",e).textContent)),t.evaluate("rowOff",e)&&(o.y=p.c(t.evaluate("rowOff",e).textContent)),r==="from"?s.tl=o:s.br=o,s}}class B{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 At extends B{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 _ extends B{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 ft extends B{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 yt extends _{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 vt extends _{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 R="richTypes";class Ft{visit(t,e,s){let r=t.getVisitorParamsState().get(R);r||(r=[],t.getVisitorParamsState().set(R,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 E="richData";class Ct{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(E);o||(o=[],t.getVisitorParamsState().set(E,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 g=this.mapType(t,h);o.push(g)}}return s.richData=o,o}mapType(t,e){if(e.type==="_error"){const s=e.errorType;if(s)try{e=d.FormulaError.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],g=c[1];let m=a.textContent;g==="i"&&(m=Number(m)),s[h]=m}}}}class wt{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 Pt{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 Nt{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class Ot{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"id",r,"id",p.r),t.copyFromAttribute(e,"personId",r,"personId",p.r),t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"parentId",r,"parentId",p.r),t.copyFromAttribute(e,"dT",r),e.hasAttribute("done")&&(r.done=p.b(e.getAttribute("done"))),s.push(r),r}}class Tt{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",p.r),t.copyFromAttribute(n,"displayName",l),t.copyFromAttribute(n,"userId",l,"userId",p.r),t.copyFromAttribute(n,"providerId",l),r.push(l)}}return r.length>0&&(s.persons=r),r}}const St={};class Vt{constructor(t,e){this.path=t,this.visitor=e}}class Y{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new H),this.registerVisitor("spPr",new L),this.registerVisitor("txBody",new F),this.registerVisitor("txPr",new F),this.registerVisitor("c:chartSpace",new J),this.registerVisitor("c:chartSpace",new q,"chart"),this.registerVisitor("c:plotArea",new Q),this.registerVisitor("c:barChart",new Z),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 tt),this.registerVisitor("c:dPt",new et),this.registerVisitor("c:marker",new rt),this.registerVisitor("c:catAx",new x),this.registerVisitor("c:valAx",new x),this.registerVisitor("c:dateAx",new x),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 ot),this.registerVisitor("c:legend",new F("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new st),this.registerVisitor("c:ser",new it,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new w("labels"),"dLbls"),this.registerVisitor("c:dLbl",new w("points")),this.registerVisitor("c:title",new j),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new nt),this.registerVisitor("c:dispUnits",new V("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new j("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new F,"tx/rich"),this.registerVisitor("a:theme",new lt),this.registerVisitor("a:theme",new at,"themeElements/clrScheme"),this.registerVisitor("a:theme",new ct,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new ht),this.registerVisitor("sortState",new pt),this.registerVisitor("s:workbook",new dt),this.registerVisitor("styleSheet",new gt),this.registerVisitor("table",new mt),this.registerVisitor("hlinkClick",new ut),this.registerVisitor("wsDr",new bt),this.registerVisitor("twoCellAnchor",new k),this.registerVisitor("oneCellAnchor",new k),this.registerVisitor("absoluteAnchor",new k),this.registerVisitor("graphicFrame",new At),this.registerVisitor("sp",new _),this.registerVisitor("grpSp",new yt),this.registerVisitor("cxnSp",new vt),this.registerVisitor("pic",new ft),this.registerVisitor("rvStructures",new Ft),this.registerVisitor("rvData",new Ct),this.registerVisitor("comments",new wt),this.registerVisitor("commentList",new Pt,"comment"),this.registerVisitor("comment",new F("content"),"text"),this.registerVisitor("ThreadedComments",new Nt),this.registerVisitor("threadedComment",new Ot),this.registerVisitor("threadedComment",new F("content"),"text"),this.registerVisitor("personList",new Tt)}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 Vt(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=St){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(g){console.warn(`Error in afterVisit: ${h.context.getPath()}`,g)}}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 g=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++)g(m.item(b))}else g(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 g=c.item(h);if(g.nodeType===1){const m=g,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=Y,exports.default=Y;
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.9
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */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;
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.9
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 i=require("react/jsx-runtime"),a=require("react"),t=require("./CalnqtYH48_x2rcI.cjs"),w=["Ok","Cancel"],k=a.memo(C=>{const{initialHyperlink:l=null,initialDisplay:b=null,onUpdateHyperlink:g,context:s,onOption:x,onValidateOption:p,onDone:u,options:f=w,defaultOption:d=f?.[0],cancelOption:r="Cancel",sx:F,...O}=C,P=a.useMemo(()=>(l??s?.()?.getHyperlink())!==null,[]),m=a.useMemo(()=>{let e=null,o=null;l&&(typeof l=="string"?o=l:e=l);const T=e??s?.()?.getHyperlink();return{address:o??T?.getAddress()??"",textToDisplay:T?.getDisplayText()??""}},[l,s]),[n,D]=a.useState(m.address),[c,$]=a.useState(()=>{const e=s?.().toTextUnformatted()??b;return e===m.address?"":e}),[j,h]=a.useState(!1),v=a.useCallback(e=>{$(e.target.value)},[]),y=a.useCallback(async(e,o)=>null,[]),H=t.fe(async e=>{e!==r&&g?.(n===""?null:{address:n},c),x?.(e,e===r,e===d),u?.()},[n,c,g,u,x,d,r]),I=t.fe(e=>{D(e.target.value),y(e.target.value,null)},[p]),M=t.fe(async e=>{let o=await Promise.resolve(p?.(e));try{o!==!1&&(o=await y(n,e))}catch{}return o??!0},[p]);return i.jsx(t.b4,{title:(P?"Edit":"Insert")+" Link",options:f,onDone:u,onOption:e=>H(e),onValidateOption:M,defaultOption:d,cancelOption:r,autoFocusSel:".autoFocus",sx:{width:"480px",...F},...O,children:i.jsxs(t.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[i.jsx(t.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:i.jsx(t.TextField,{label:"Address",placeholder:"Enter a url or cell reference.",onFocus:e=>{j||e.target?.select(),h(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${t.alpha("#fff",t.$n(5))}, ${t.alpha("#fff",t.$n(5))})`}}},value:n,onChange:I,onContextMenu:e=>{e.stopPropagation()}})}),i.jsx(t.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:i.jsx(t.TextField,{label:"Display Text",placeholder:n?.startsWith("#")?n.substring(1):n,onFocus:()=>{h(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${t.alpha("#fff",t.$n(5))}, ${t.alpha("#fff",t.$n(5))})`}}},value:c,onChange:v,onContextMenu:e=>{e.stopPropagation()}})})]})})});exports.HyperlinkDialog=k,exports.default=k;
@@ -1,15 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.9
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"});var ct,pt={exports:{}};const _t=function(Y,Q){for(var b=0;b<Q.length;b++){const P=Q[b];if(typeof P!="string"&&!Array.isArray(P)){for(const B in P)if(B!=="default"&&!(B in Y)){const J=Object.getOwnPropertyDescriptor(P,B);J&&Object.defineProperty(Y,B,J.get?J:{enumerable:!0,get:()=>P[B]})}}}return Object.freeze(Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}))}({__proto__:null},[(ct||(ct=1,pt.exports=function Y(){var Q,b=typeof self<"u"?self:typeof window<"u"?window:b!==void 0?b:{},P=!b.document&&!!b.postMessage,B=b.IS_PAPA_WORKER||!1,J={},gt=0,a={};function K(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var i=at(e);i.chunkSize=parseInt(i.chunkSize),e.step||e.chunk||(i.chunkSize=null),this._handle=new ht(i),(this._handle.streamer=this)._config=i}.call(this,t),this.parseChunk=function(e,i){var n=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<n){let l=this._config.newline;l||(r=this._config.quoteChar||'"',l=this._handle.guessLineEndings(e,r)),e=[...e.split(l).slice(n)].join(l)}this.isFirstChunk&&y(this._config.beforeFirstChunk)&&(r=this._config.beforeFirstChunk(e))!==void 0&&(e=r),this.isFirstChunk=!1,this._halted=!1,n=this._partialLine+e;var r=(this._partialLine="",this._handle.parse(n,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=r.meta.cursor,this._finished||(this._partialLine=n.substring(e-this._baseIndex),this._baseIndex=e),r&&r.data&&(this._rowCount+=r.data.length),n=this._finished||this._config.preview&&this._rowCount>=this._config.preview,B)b.postMessage({results:r,workerId:a.WORKER_ID,finished:n});else if(y(this._config.chunk)&&!i){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=r=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),this._completed||!n||!y(this._config.complete)||r&&r.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||r&&r.meta.paused||this._nextChunk(),r}this._halted=!0},this._sendError=function(e){y(this._config.error)?this._config.error(e):B&&this._config.error&&b.postMessage({workerId:a.WORKER_ID,error:e,finished:!1})}}function it(t){var e;(t=t||{}).chunkSize||(t.chunkSize=a.RemoteChunkSize),K.call(this,t),this._nextChunk=P?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(i){this._input=i,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),P||(e.onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!P),this._config.downloadRequestHeaders){var i,n=this._config.downloadRequestHeaders;for(i in n)e.setRequestHeader(i,n[i])}var r;this._config.chunkSize&&(r=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+r));try{e.send(this._config.downloadRequestBody)}catch(l){this._chunkError(l.message)}P&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){var i;e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=((i=(i=e).getResponseHeader("Content-Range"))!==null?parseInt(i.substring(i.lastIndexOf("/")+1)):-1),this.parseChunk(e.responseText)))},this._chunkError=function(i){i=e.statusText||i,this._sendError(new Error(i))}}function rt(t){(t=t||{}).chunkSize||(t.chunkSize=a.LocalChunkSize),K.call(this,t);var e,i,n=typeof FileReader<"u";this.stream=function(r){this._input=r,i=r.slice||r.webkitSlice||r.mozSlice,n?((e=new FileReader).onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var r=this._input,l=(this._config.chunkSize&&(l=Math.min(this._start+this._config.chunkSize,this._input.size),r=i.call(r,this._start,l)),e.readAsText(r,this._config.encoding));n||this._chunkLoaded({target:{result:l}})},this._chunkLoaded=function(r){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(r.target.result)},this._chunkError=function(){this._sendError(e.error)}}function X(t){var e;K.call(this,t=t||{}),this.stream=function(i){return e=i,this._nextChunk()},this._nextChunk=function(){var i,n;if(!this._finished)return i=this._config.chunkSize,e=i?(n=e.substring(0,i),e.substring(i)):(n=e,""),this._finished=!e,this.parseChunk(n)}}function nt(t){K.call(this,t=t||{});var e=[],i=!0,n=!1;this.pause=function(){K.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){K.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(r){this._input=r,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):i=!0},this._streamData=$(function(r){try{e.push(typeof r=="string"?r:r.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(l){this._streamError(l)}},this),this._streamError=$(function(r){this._streamCleanUp(),this._sendError(r)},this),this._streamEnd=$(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=$(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function ht(t){var e,i,n,r,l=Math.pow(2,53),p=-l,M=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,w=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,_=this,T=0,o=0,j=!1,u=!1,g=[],s={data:[],errors:[],meta:{}};function C(h){return t.skipEmptyLines==="greedy"?h.join("").trim()==="":h.length===1&&h[0].length===0}function R(){if(s&&n&&(z("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines&&(s.data=s.data.filter(function(f){return!C(f)})),L()){let f=function(O,A){y(t.transformHeader)&&(O=t.transformHeader(O,A)),g.push(O)};if(s)if(Array.isArray(s.data[0])){for(var h=0;L()&&h<s.data.length;h++)s.data[h].forEach(f);s.data.splice(0,1)}else s.data.forEach(f)}function c(f,O){for(var A=t.header?{}:[],v=0;v<f.length;v++){var k=v,m=f[v];m=((U,d)=>{return S=U,t.dynamicTypingFunction&&t.dynamicTyping[S]===void 0&&(t.dynamicTyping[S]=t.dynamicTypingFunction(S)),(t.dynamicTyping[S]||t.dynamicTyping)===!0?d==="true"||d==="TRUE"||d!=="false"&&d!=="FALSE"&&((I=>{if(M.test(I)&&(I=parseFloat(I),p<I&&I<l))return 1})(d)?parseFloat(d):w.test(d)?new Date(d):d===""?null:d):d;var S})(k=t.header?v>=g.length?"__parsed_extra":g[v]:k,m=t.transform?t.transform(m,k):m),k==="__parsed_extra"?(A[k]=A[k]||[],A[k].push(m)):A[k]=m}return t.header&&(v>g.length?z("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+v,o+O):v<g.length&&z("FieldMismatch","TooFewFields","Too few fields: expected "+g.length+" fields but parsed "+v,o+O)),A}var E;s&&(t.header||t.dynamicTyping||t.transform)&&(E=1,!s.data.length||Array.isArray(s.data[0])?(s.data=s.data.map(c),E=s.data.length):s.data=c(s.data,0),t.header&&s.meta&&(s.meta.fields=g),o+=E)}function L(){return t.header&&g.length===0}function z(h,c,E,f){h={type:h,code:c,message:E},f!==void 0&&(h.row=f),s.errors.push(h)}y(t.step)&&(r=t.step,t.step=function(h){s=h,L()?R():(R(),s.data.length!==0&&(T+=h.data.length,t.preview&&T>t.preview?i.abort():(s.data=s.data[0],r(s,_))))}),this.parse=function(h,c,E){var f=t.quoteChar||'"';return t.newline||(t.newline=this.guessLineEndings(h,f)),n=!1,t.delimiter?y(t.delimiter)&&(t.delimiter=t.delimiter(h),s.meta.delimiter=t.delimiter):((f=((O,A,v,k,m)=>{var U,d,S,I;m=m||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var Z=0;Z<m.length;Z++){for(var W,tt=m[Z],F=0,q=0,x=0,D=(S=void 0,new st({comments:k,delimiter:tt,newline:A,preview:10}).parse(O)),H=0;H<D.data.length;H++)v&&C(D.data[H])?x++:(q+=W=D.data[H].length,S===void 0?S=W:0<W&&(F+=Math.abs(W-S),S=W));0<D.data.length&&(q/=D.data.length-x),(d===void 0||F<=d)&&(I===void 0||I<q)&&1.99<q&&(d=F,U=tt,I=q)}return{successful:!!(t.delimiter=U),bestDelimiter:U}})(h,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=f.bestDelimiter:(n=!0,t.delimiter=a.DefaultDelimiter),s.meta.delimiter=t.delimiter),f=at(t),t.preview&&t.header&&f.preview++,e=h,i=new st(f),s=i.parse(e,c,E),R(),j?{meta:{paused:!0}}:s||{meta:{paused:!1}}},this.paused=function(){return j},this.pause=function(){j=!0,i.abort(),e=y(t.chunk)?"":e.substring(i.getCharIndex())},this.resume=function(){_.streamer._halted?(j=!1,_.streamer.parseChunk(e,!0)):setTimeout(_.resume,3)},this.aborted=function(){return u},this.abort=function(){u=!0,i.abort(),s.meta.aborted=!0,y(t.complete)&&t.complete(s),e=""},this.guessLineEndings=function(h,c){h=h.substring(0,1048576),c=new RegExp(V(c)+"([^]*?)"+V(c),"gm");var E=(h=h.replace(c,"")).split("\r");if(h=1<(c=h.split(`
7
- `)).length&&c[0].length<E[0].length,E.length===1||h)return`
8
- `;for(var f=0,O=0;O<E.length;O++)E[O][0]===`
9
- `&&f++;return f>=E.length/2?`\r
10
- `:"\r"}}function V(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(t){var e=(t=t||{}).delimiter,i=t.newline,n=t.comments,r=t.step,l=t.preview,p=t.fastMode,M=null,w=!1,_=t.quoteChar==null?'"':t.quoteChar,T=_;if(t.escapeChar!==void 0&&(T=t.escapeChar),(typeof e!="string"||-1<a.BAD_DELIMITERS.indexOf(e))&&(e=","),n===e)throw new Error("Comment character same as delimiter");n===!0?n="#":(typeof n!="string"||-1<a.BAD_DELIMITERS.indexOf(n))&&(n=!1),i!==`
11
- `&&i!=="\r"&&i!==`\r
12
- `&&(i=`
13
- `);var o=0,j=!1;this.parse=function(u,g,s){if(typeof u!="string")throw new Error("Input must be a string");var C=u.length,R=e.length,L=i.length,z=n.length,h=y(r),c=[],E=[],f=[],O=o=0;if(!u)return F();if(p||p!==!1&&u.indexOf(_)===-1){for(var A=u.split(i),v=0;v<A.length;v++){if(f=A[v],o+=f.length,v!==A.length-1)o+=i.length;else if(s)return F();if(!n||f.substring(0,z)!==n){if(h){if(c=[],I(f.split(e)),q(),j)return F()}else I(f.split(e));if(l&&l<=v)return c=c.slice(0,l),F(!0)}}return F()}for(var k=u.indexOf(e,o),m=u.indexOf(i,o),U=new RegExp(V(T)+V(_),"g"),d=u.indexOf(_,o);;)if(u[o]===_)for(d=o,o++;;){if((d=u.indexOf(_,d+1))===-1)return s||E.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:c.length,index:o}),W();if(d===C-1)return W(u.substring(o,d).replace(U,_));if(_===T&&u[d+1]===T)d++;else if(_===T||d===0||u[d-1]!==T){k!==-1&&k<d+1&&(k=u.indexOf(e,d+1));var S=Z((m=m!==-1&&m<d+1?u.indexOf(i,d+1):m)===-1?k:Math.min(k,m));if(u.substr(d+1+S,R)===e){f.push(u.substring(o,d).replace(U,_)),u[o=d+1+S+R]!==_&&(d=u.indexOf(_,o)),k=u.indexOf(e,o),m=u.indexOf(i,o);break}if(S=Z(m),u.substring(d+1+S,d+1+S+L)===i){if(f.push(u.substring(o,d).replace(U,_)),tt(d+1+S+L),k=u.indexOf(e,o),d=u.indexOf(_,o),h&&(q(),j))return F();if(l&&c.length>=l)return F(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:c.length,index:o}),d++}}else if(n&&f.length===0&&u.substring(o,o+z)===n){if(m===-1)return F();o=m+L,m=u.indexOf(i,o),k=u.indexOf(e,o)}else if(k!==-1&&(k<m||m===-1))f.push(u.substring(o,k)),o=k+R,k=u.indexOf(e,o);else{if(m===-1)break;if(f.push(u.substring(o,m)),tt(m+L),h&&(q(),j))return F();if(l&&c.length>=l)return F(!0)}return W();function I(x){c.push(x),O=o}function Z(x){return x!==-1&&(x=u.substring(d+1,x))&&x.trim()===""?x.length:0}function W(x){return s||(x===void 0&&(x=u.substring(o)),f.push(x),o=C,I(f),h&&q()),F()}function tt(x){o=x,I(f),f=[],m=u.indexOf(i,o)}function F(x){if(t.header&&!g&&c.length&&!w){var D=c[0],H=Object.create(null),ot=new Set(D);let ft=!1;for(let G=0;G<D.length;G++){let N=D[G];if(H[N=y(t.transformHeader)?t.transformHeader(N,G):N]){let et,lt=H[N];for(;et=N+"_"+lt,lt++,ot.has(et););ot.add(et),D[G]=et,H[N]++,ft=!0,(M=M===null?{}:M)[et]=N}else H[N]=1,D[G]=N;ot.add(N)}ft&&console.warn("Duplicate headers found and renamed."),w=!0}return{data:c,errors:E,meta:{delimiter:e,linebreak:i,aborted:j,truncated:!!x,cursor:O+(g||0),renamedHeaders:M}}}function q(){r(F()),c=[],E=[]}},this.abort=function(){j=!0},this.getCharIndex=function(){return o}}function mt(t){var e=t.data,i=J[e.workerId],n=!1;if(e.error)i.userError(e.error,e.file);else if(e.results&&e.results.data){var r={abort:function(){n=!0,ut(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:dt,resume:dt};if(y(i.userStep)){for(var l=0;l<e.results.data.length&&(i.userStep({data:e.results.data[l],errors:e.results.errors,meta:e.results.meta},r),!n);l++);delete e.results}else y(i.userChunk)&&(i.userChunk(e.results,r,e.file),delete e.results)}e.finished&&!n&&ut(e.workerId,e.results)}function ut(t,e){var i=J[t];y(i.userComplete)&&i.userComplete(e),i.terminate(),delete J[t]}function dt(){throw new Error("Not implemented.")}function at(t){if(typeof t!="object"||t===null)return t;var e,i=Array.isArray(t)?[]:{};for(e in t)i[e]=at(t[e]);return i}function $(t,e){return function(){t.apply(e,arguments)}}function y(t){return typeof t=="function"}return a.parse=function(t,e){var i,n,r,l,p=(e=e||{}).dynamicTyping||!1;if(y(p)&&(e.dynamicTypingFunction=p,p={}),e.dynamicTyping=p,e.transform=!!y(e.transform)&&e.transform,!e.worker||!a.WORKERS_SUPPORTED)return p=null,a.NODE_STREAM_INPUT,typeof t=="string"?(t=(i=t).charCodeAt(0)!==65279?i:i.slice(1),p=new(e.download?it:X)(e)):t.readable===!0&&y(t.read)&&y(t.on)?p=new nt(e):(b.File&&t instanceof File||t instanceof Object)&&(p=new rt(e)),p.stream(t);(p=!!a.WORKERS_SUPPORTED&&(r=b.URL||b.webkitURL||null,l=Y.toString(),n=a.BLOB_URL||(a.BLOB_URL=r.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",l,")();"],{type:"text/javascript"}))),(n=new b.Worker(n)).onmessage=mt,n.id=gt++,J[n.id]=n)).userStep=e.step,p.userChunk=e.chunk,p.userComplete=e.complete,p.userError=e.error,e.step=y(e.step),e.chunk=y(e.chunk),e.complete=y(e.complete),e.error=y(e.error),delete e.worker,p.postMessage({input:t,config:e,workerId:p.id})},a.unparse=function(t,e){var i=!1,n=!0,r=",",l=`\r
14
- `,p='"',M=p+p,w=!1,_=null,T=!1,o=((()=>{if(typeof e=="object"){if(typeof e.delimiter!="string"||a.BAD_DELIMITERS.filter(function(g){return e.delimiter.indexOf(g)!==-1}).length||(r=e.delimiter),typeof e.quotes!="boolean"&&typeof e.quotes!="function"&&!Array.isArray(e.quotes)||(i=e.quotes),typeof e.skipEmptyLines!="boolean"&&typeof e.skipEmptyLines!="string"||(w=e.skipEmptyLines),typeof e.newline=="string"&&(l=e.newline),typeof e.quoteChar=="string"&&(p=e.quoteChar),typeof e.header=="boolean"&&(n=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");_=e.columns}e.escapeChar!==void 0&&(M=e.escapeChar+p),e.escapeFormulae instanceof RegExp?T=e.escapeFormulae:typeof e.escapeFormulae=="boolean"&&e.escapeFormulae&&(T=/^[=+\-@\t\r].*$/)}})(),new RegExp(V(p),"g"));if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return j(null,t,w);if(typeof t[0]=="object")return j(_||Object.keys(t[0]),t,w)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||_),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||typeof t.data[0]=="object"||(t.data=[t.data])),j(t.fields||[],t.data||[],w);throw new Error("Unable to serialize unrecognized input");function j(g,s,C){var R="",L=(typeof g=="string"&&(g=JSON.parse(g)),typeof s=="string"&&(s=JSON.parse(s)),Array.isArray(g)&&0<g.length),z=!Array.isArray(s[0]);if(L&&n){for(var h=0;h<g.length;h++)0<h&&(R+=r),R+=u(g[h],h);0<s.length&&(R+=l)}for(var c=0;c<s.length;c++){var E=(L?g:s[c]).length,f=!1,O=L?Object.keys(s[c]).length===0:s[c].length===0;if(C&&!L&&(f=C==="greedy"?s[c].join("").trim()==="":s[c].length===1&&s[c][0].length===0),C==="greedy"&&L){for(var A=[],v=0;v<E;v++){var k=z?g[v]:v;A.push(s[c][k])}f=A.join("").trim()===""}if(!f){for(var m=0;m<E;m++){0<m&&!O&&(R+=r);var U=L&&z?g[m]:m;R+=u(s[c][U],m)}c<s.length-1&&(!C||0<E&&!O)&&(R+=l)}}return R}function u(g,s){var C,R;return g==null?"":g.constructor===Date?JSON.stringify(g).slice(1,25):(R=!1,T&&typeof g=="string"&&T.test(g)&&(g="'"+g,R=!0),C=g.toString().replace(o,M),(R=R||i===!0||typeof i=="function"&&i(g,s)||Array.isArray(i)&&i[s]||((L,z)=>{for(var h=0;h<z.length;h++)if(-1<L.indexOf(z[h]))return!0;return!1})(C,a.BAD_DELIMITERS)||-1<C.indexOf(r)||C.charAt(0)===" "||C.charAt(C.length-1)===" ")?p+C+p:C)}},a.RECORD_SEP="",a.UNIT_SEP="",a.BYTE_ORDER_MARK="\uFEFF",a.BAD_DELIMITERS=["\r",`
15
- `,'"',a.BYTE_ORDER_MARK],a.WORKERS_SUPPORTED=!P&&!!b.Worker,a.NODE_STREAM_INPUT=1,a.LocalChunkSize=10485760,a.RemoteChunkSize=5242880,a.DefaultDelimiter=",",a.Parser=st,a.ParserHandle=ht,a.NetworkStreamer=it,a.FileStreamer=rt,a.StringStreamer=X,a.ReadableStreamStreamer=nt,b.jQuery&&((Q=b.jQuery).fn.parse=function(t){var e=t.config||{},i=[];return this.each(function(l){if(Q(this).prop("tagName").toUpperCase()!=="INPUT"||Q(this).attr("type").toLowerCase()!=="file"||!b.FileReader||!this.files||this.files.length===0)return!0;for(var p=0;p<this.files.length;p++)i.push({file:this.files[p],inputElem:this,instanceConfig:Q.extend({},e)})}),n(),this;function n(){if(i.length===0)y(t.complete)&&t.complete();else{var l,p,M,w=i[0];if(y(t.before)){var _=t.before(w.file,w.inputElem);if(typeof _=="object"){if(_.action==="abort")return l=w.file,p=w.inputElem,M=_.reason,void(y(t.error)&&t.error({name:"AbortError"},l,p,M));if(_.action==="skip")return void r();typeof _.config=="object"&&(w.instanceConfig=Q.extend(w.instanceConfig,_.config))}else if(_==="skip")return void r()}var T=w.instanceConfig.complete;w.instanceConfig.complete=function(o){y(T)&&T(o,w.file,w.inputElem),r()},a.parse(w.file,w.instanceConfig)}}function r(){i.splice(0,1),n()}}),B&&(b.onmessage=function(t){t=t.data,a.WORKER_ID===void 0&&t&&(a.WORKER_ID=t.workerId),typeof t.input=="string"?b.postMessage({workerId:a.WORKER_ID,results:a.parse(t.input,t.config),finished:!0}):(b.File&&t.input instanceof File||t.input instanceof Object)&&(t=a.parse(t.input,t.config))&&b.postMessage({workerId:a.WORKER_ID,results:t,finished:!0})}),(it.prototype=Object.create(K.prototype)).constructor=it,(rt.prototype=Object.create(K.prototype)).constructor=rt,(X.prototype=Object.create(X.prototype)).constructor=X,(nt.prototype=Object.create(K.prototype)).constructor=nt,a}()),pt.exports)]);exports.p=_t;