openwork-server 0.18.71 → 0.18.72

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 (98) hide show
  1. package/dist/opencode-plugin-deps-1.18.33.tgz +0 -0
  2. package/dist/opencode-plugins/agent-instruction-compose.js +0 -24
  3. package/dist/opencode-plugins/approval-loopback-fetch.js +0 -9
  4. package/dist/opencode-plugins/browser-tool-args.js +37 -0
  5. package/dist/opencode-plugins/computer-listing-files.js +0 -19
  6. package/dist/opencode-plugins/drive-file-tools.js +0 -4
  7. package/dist/opencode-plugins/gmail-attachment-fulfillment.js +0 -14
  8. package/dist/opencode-plugins/managed-policy-client.js +0 -2
  9. package/dist/opencode-plugins/opencode-stop-fence-client.js +0 -1
  10. package/dist/opencode-plugins/openwork-agent-questions.js +2 -10
  11. package/dist/opencode-plugins/openwork-capabilities-knowledge.js +2 -2
  12. package/dist/opencode-plugins/openwork-chrome-devtools.js +47 -4
  13. package/dist/opencode-plugins/openwork-cloud-skills-v2.js +34 -49
  14. package/dist/opencode-plugins/openwork-codemode-discovery-v2.js +0 -7
  15. package/dist/opencode-plugins/openwork-context-v2.js +81 -12
  16. package/dist/opencode-plugins/openwork-extensions-preview-steering.js +0 -16
  17. package/dist/opencode-plugins/openwork-extensions-preview.js +1 -1
  18. package/dist/opencode-plugins/openwork-office-attachments.js +1401 -10
  19. package/dist/opencode-plugins/openwork-provider-adapters.js +0 -11
  20. package/dist/opencode-plugins/openwork-session-groups.js +0 -13
  21. package/dist/opencode-plugins/openwork-spreadsheets.js +1401 -10
  22. package/dist/opencode-plugins/openwork-ui-bridge.js +1 -6
  23. package/dist/opencode-plugins/provider-safe-tool-schema.js +0 -10
  24. package/dist/opencode-plugins/session-read-detail.js +0 -36
  25. package/dist/opencode-plugins/workspace-file-destinations.js +0 -5
  26. package/dist/openwork-server.mjs +3190 -1101
  27. package/package.json +1 -1
  28. package/web/assets/{abnfDiagram-VCTEODGH-DlWncS8i.js → abnfDiagram-VCTEODGH-Bk2JrJ3j.js} +1 -1
  29. package/web/assets/app-BinIaXyk.css +32 -0
  30. package/web/assets/{app-DSUHKGsm.js → app-CNo6L1tq.js} +487 -479
  31. package/web/assets/{arc-BtZC6wuw.js → arc-BeMgz_zn.js} +1 -1
  32. package/web/assets/{architectureDiagram-5GKGNRK7-DTbl4Rnl.js → architectureDiagram-5GKGNRK7-CRxylST_.js} +1 -1
  33. package/web/assets/{artifact-code-view-Ck4sjscy.js → artifact-code-view-BwBuxnOh.js} +1 -1
  34. package/web/assets/artifact-office-preview-v_N9yGCg.js +6 -0
  35. package/web/assets/artifact-spreadsheet-editor-5lpd49cl.js +4 -0
  36. package/web/assets/{artifact-text-editor-DjSmnNjJ.js → artifact-text-editor-Dj0SDUYJ.js} +1 -1
  37. package/web/assets/{blockDiagram-OSKFZWR5-DAYSy6DL.js → blockDiagram-OSKFZWR5-CYcFpnr1.js} +1 -1
  38. package/web/assets/{c4Diagram-7LVT6UL2-CjyvESYl.js → c4Diagram-7LVT6UL2-KL6win2t.js} +1 -1
  39. package/web/assets/channel-C7q2VHY_.js +1 -0
  40. package/web/assets/{chunk-2Q5K7J3B-CcMgFZAV.js → chunk-2Q5K7J3B-CjBMu5Dk.js} +1 -1
  41. package/web/assets/{chunk-5VM5RSS4-D4c8XRGl.js → chunk-5VM5RSS4-CVfSxxeV.js} +1 -1
  42. package/web/assets/{chunk-F27PBJKO-BnyyjaCS.js → chunk-F27PBJKO-Da-CK7uS.js} +1 -1
  43. package/web/assets/{chunk-HLEWEB6X-JXz7B5zc.js → chunk-HLEWEB6X-DaBpQjxM.js} +1 -1
  44. package/web/assets/{chunk-JWPE2WC7-CYcnmDz7.js → chunk-JWPE2WC7-eZhhKb-9.js} +1 -1
  45. package/web/assets/{chunk-POPQ4Y6H-2llTUUN7.js → chunk-POPQ4Y6H-BuQza4Dl.js} +1 -1
  46. package/web/assets/{chunk-SVP7TREG-BnWFSOpJ.js → chunk-SVP7TREG-MuA1wNzK.js} +1 -1
  47. package/web/assets/{chunk-XXDRQBXY-XqHzbo0u.js → chunk-XXDRQBXY-CIpJOQtx.js} +1 -1
  48. package/web/assets/{chunk-ZLD2IHE6-Dz_IjbQJ.js → chunk-ZLD2IHE6-NhKoLW1Y.js} +1 -1
  49. package/web/assets/classDiagram-CYGNFDIV-DKD7FwJZ.js +1 -0
  50. package/web/assets/classDiagram-v2-TLXNO2FR-DKD7FwJZ.js +1 -0
  51. package/web/assets/{cose-bilkent-JH36ORCC--bD81EP5.js → cose-bilkent-JH36ORCC-B_lNY9db.js} +1 -1
  52. package/web/assets/{cynefin-OW5HDTMX-tTD-HcrI.js → cynefin-OW5HDTMX-BmqyCndA.js} +1 -1
  53. package/web/assets/{cynefinDiagram-5FMLGOSQ-CMslIrwy.js → cynefinDiagram-5FMLGOSQ-By2KC7b4.js} +1 -1
  54. package/web/assets/{dagre-OS7QT2EB-B__oM1cx.js → dagre-OS7QT2EB-By7csWyW.js} +1 -1
  55. package/web/assets/{diagram-S7CK7UJ4-D2ghWE6t.js → diagram-S7CK7UJ4-5_mhvlGk.js} +1 -1
  56. package/web/assets/{diagram-UQ7AKVKN-BanDxdhW.js → diagram-UQ7AKVKN-BPHF9t90.js} +1 -1
  57. package/web/assets/{diagram-VSXAHHWV-DGvbp0xT.js → diagram-VSXAHHWV-CyVv5z8B.js} +1 -1
  58. package/web/assets/{diagram-VX7I27RA-CThCeJli.js → diagram-VX7I27RA-BdfxwGwk.js} +1 -1
  59. package/web/assets/{diagram-Z3DM3KII-CAt65CmM.js → diagram-Z3DM3KII-BXg_HOys.js} +1 -1
  60. package/web/assets/{ebnfDiagram-PWID7BFC-Cp5nPs03.js → ebnfDiagram-PWID7BFC-57--ZiB5.js} +1 -1
  61. package/web/assets/{erDiagram-2YWLMYGG-HLBdDnlf.js → erDiagram-2YWLMYGG-2WR_i4mr.js} +1 -1
  62. package/web/assets/{flowDiagram-T62WH6J4-CELW8hlc.js → flowDiagram-T62WH6J4-1qB430Tj.js} +1 -1
  63. package/web/assets/{ganttDiagram-EL5Y4UJY-C7R0OzTb.js → ganttDiagram-EL5Y4UJY-DlsKL-gN.js} +1 -1
  64. package/web/assets/{gitGraphDiagram-WWUBYQGX-qBuuQIor.js → gitGraphDiagram-WWUBYQGX-DQ8IU_wC.js} +1 -1
  65. package/web/assets/{infoDiagram-FKFFQAWI-iEzBkgjk.js → infoDiagram-FKFFQAWI-kh9s5sRC.js} +1 -1
  66. package/web/assets/{ishikawaDiagram-5VMMS53U-DrK4XY4T.js → ishikawaDiagram-5VMMS53U-CaknQUcm.js} +1 -1
  67. package/web/assets/{journeyDiagram-EYS64GPL-CGd8HUPB.js → journeyDiagram-EYS64GPL-DenZYZs9.js} +1 -1
  68. package/web/assets/{kanban-definition-UXKFOSKX-DQmiyxel.js → kanban-definition-UXKFOSKX-ptoI6qD1.js} +1 -1
  69. package/web/assets/{layout-DLjmmpHK.js → layout-B4UdHd1t.js} +1 -1
  70. package/web/assets/{linear-DHJPnkfR.js → linear-DbhtXtCn.js} +1 -1
  71. package/web/assets/{mermaid.core-PQNy-dHT.js → mermaid.core-BoXM2BMZ.js} +6 -6
  72. package/web/assets/{mindmap-definition-THT77NOG-B5jNdC9x.js → mindmap-definition-THT77NOG-Bcw34klO.js} +1 -1
  73. package/web/assets/{pegDiagram-XKGWAZYB-wbhF-roR.js → pegDiagram-XKGWAZYB-CZ49Cylj.js} +1 -1
  74. package/web/assets/{pieDiagram-E7YTZNPT-2HAV5f46.js → pieDiagram-E7YTZNPT-F5Tl-jOo.js} +1 -1
  75. package/web/assets/{quadrantDiagram-AXDQQJYC-CLDLYWPn.js → quadrantDiagram-AXDQQJYC-BindC9Ln.js} +1 -1
  76. package/web/assets/{railroadDiagram-O6MQD6OU-Be5VkSOo.js → railroadDiagram-O6MQD6OU-BHfARQKt.js} +1 -1
  77. package/web/assets/{requirementDiagram-IS5BZ75X-qBk4BaLm.js → requirementDiagram-IS5BZ75X-DeyyjrFZ.js} +1 -1
  78. package/web/assets/{sankeyDiagram-P5KCCOFB-a-kGn14g.js → sankeyDiagram-P5KCCOFB-Bf4RYjdY.js} +1 -1
  79. package/web/assets/{sequenceDiagram-WJ2MYXX4-B19t616Z.js → sequenceDiagram-WJ2MYXX4-D0I5Iail.js} +1 -1
  80. package/web/assets/{sizeCapture-INFHLROL-CGM0ZmNa.js → sizeCapture-INFHLROL-ZMHjeD6L.js} +1 -1
  81. package/web/assets/{stateDiagram-XQSTLZYL-CQYuKN4p.js → stateDiagram-XQSTLZYL-XMu0akCC.js} +1 -1
  82. package/web/assets/stateDiagram-v2-IH3M54BS-CNv5Ofd5.js +1 -0
  83. package/web/assets/{swimlanes-V6O3JKXN-CvzknNlU.js → swimlanes-V6O3JKXN-BX1vgjAt.js} +1 -1
  84. package/web/assets/swimlanesDiagram-JKAHXJPX-yIR7kUmA.js +8 -0
  85. package/web/assets/{timeline-definition-24CTP7MA-BhF3gzcl.js → timeline-definition-24CTP7MA-B-V8Y7U9.js} +1 -1
  86. package/web/assets/{vennDiagram-4TSXK5OY-6DNrrc2_.js → vennDiagram-4TSXK5OY-iHvsobDU.js} +1 -1
  87. package/web/assets/{wardleyDiagram-VM6X3IG4-DO0onK3t.js → wardleyDiagram-VM6X3IG4-BTl7bSNi.js} +1 -1
  88. package/web/assets/{workspace-file-tree-BCpC4HYD.js → workspace-file-tree-EJaUSokl.js} +1 -1
  89. package/web/assets/xlsx-workbook-DVIQLEdk.js +9 -0
  90. package/web/assets/{xychartDiagram-S5SC5T6Z-44sg_69l.js → xychartDiagram-S5SC5T6Z-BKhJK0Av.js} +1 -1
  91. package/web/index.html +2 -2
  92. package/web/assets/app-CfKQPy_C.css +0 -32
  93. package/web/assets/artifact-spreadsheet-editor-O5R5Qt-8.js +0 -11
  94. package/web/assets/channel-OiorT9Re.js +0 -1
  95. package/web/assets/classDiagram-CYGNFDIV-CLY7M0C9.js +0 -1
  96. package/web/assets/classDiagram-v2-TLXNO2FR-CLY7M0C9.js +0 -1
  97. package/web/assets/stateDiagram-v2-IH3M54BS-CVq-yI8K.js +0 -1
  98. package/web/assets/swimlanesDiagram-JKAHXJPX-YWNRXT7V.js +0 -8
@@ -1,11 +0,0 @@
1
- import{T as Xt,f as st,Q as j,j as E,L as zt,B as A,P as rt,c as Ft,u as Zt,r as P,a as jt}from"./app-DSUHKGsm.js";const I=new Set(["input","option","optgroup","select","button","datalist","textarea"]),f=new Set(["p"]),ot=new Set(["thead","tbody"]),it=new Set(["dd","dt"]),at=new Set(["rt","rp"]),Bt=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",f],["h1",f],["h2",f],["h3",f],["h4",f],["h5",f],["h6",f],["select",I],["input",I],["output",I],["button",I],["datalist",I],["textarea",I],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",it],["dt",it],["address",f],["article",f],["aside",f],["blockquote",f],["details",f],["div",f],["dl",f],["fieldset",f],["figcaption",f],["figure",f],["footer",f],["form",f],["header",f],["hr",f],["main",f],["nav",f],["ol",f],["pre",f],["section",f],["table",f],["ul",f],["rt",at],["rp",at],["tbody",ot],["tfoot",ot]]),Vt=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),ct=new Set(["math","svg"]),lt=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),Wt=/\s|\//;class Ht{constructor(t,n={}){var s,r,o,i,a;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=t??{},this.lowerCaseTagNames=(s=n.lowerCaseTags)!==null&&s!==void 0?s:!n.xmlMode,this.lowerCaseAttributeNames=(r=n.lowerCaseAttributeNames)!==null&&r!==void 0?r:!n.xmlMode,this.tokenizer=new((o=n.Tokenizer)!==null&&o!==void 0?o:Xt)(this.options,this),(a=(i=this.cbs).onparserinit)===null||a===void 0||a.call(i,this)}ontext(t,n){var s,r;const o=this.getSlice(t,n);this.endIndex=n-1,(r=(s=this.cbs).ontext)===null||r===void 0||r.call(s,o),this.startIndex=n}ontextentity(t){var n,s;const r=this.tokenizer.getSectionStart();this.endIndex=r-1,(s=(n=this.cbs).ontext)===null||s===void 0||s.call(n,st(t)),this.startIndex=r}isVoidElement(t){return!this.options.xmlMode&&Vt.has(t)}onopentagname(t,n){this.endIndex=n;let s=this.getSlice(t,n);this.lowerCaseTagNames&&(s=s.toLowerCase()),this.emitOpenTag(s)}emitOpenTag(t){var n,s,r,o;this.openTagStart=this.startIndex,this.tagname=t;const i=!this.options.xmlMode&&Bt.get(t);if(i)for(;this.stack.length>0&&i.has(this.stack[this.stack.length-1]);){const a=this.stack.pop();(s=(n=this.cbs).onclosetag)===null||s===void 0||s.call(n,a,!0)}this.isVoidElement(t)||(this.stack.push(t),ct.has(t)?this.foreignContext.push(!0):lt.has(t)&&this.foreignContext.push(!1)),(o=(r=this.cbs).onopentagname)===null||o===void 0||o.call(r,t),this.cbs.onopentag&&(this.attribs={})}endOpenTag(t){var n,s;this.startIndex=this.openTagStart,this.attribs&&((s=(n=this.cbs).onopentag)===null||s===void 0||s.call(n,this.tagname,this.attribs,t),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(t){this.endIndex=t,this.endOpenTag(!1),this.startIndex=t+1}onclosetag(t,n){var s,r,o,i,a,c;this.endIndex=n;let h=this.getSlice(t,n);if(this.lowerCaseTagNames&&(h=h.toLowerCase()),(ct.has(h)||lt.has(h))&&this.foreignContext.pop(),this.isVoidElement(h))!this.options.xmlMode&&h==="br"&&((r=(s=this.cbs).onopentagname)===null||r===void 0||r.call(s,"br"),(i=(o=this.cbs).onopentag)===null||i===void 0||i.call(o,"br",{},!0),(c=(a=this.cbs).onclosetag)===null||c===void 0||c.call(a,"br",!1));else{const u=this.stack.lastIndexOf(h);if(u!==-1)if(this.cbs.onclosetag){let l=this.stack.length-u;for(;l--;)this.cbs.onclosetag(this.stack.pop(),l!==0)}else this.stack.length=u;else!this.options.xmlMode&&h==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(t){this.endIndex=t,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=t+1):this.onopentagend(t)}closeCurrentTag(t){var n,s;const r=this.tagname;this.endOpenTag(t),this.stack[this.stack.length-1]===r&&((s=(n=this.cbs).onclosetag)===null||s===void 0||s.call(n,r,!t),this.stack.pop())}onattribname(t,n){this.startIndex=t;const s=this.getSlice(t,n);this.attribname=this.lowerCaseAttributeNames?s.toLowerCase():s}onattribdata(t,n){this.attribvalue+=this.getSlice(t,n)}onattribentity(t){this.attribvalue+=st(t)}onattribend(t,n){var s,r;this.endIndex=n,(r=(s=this.cbs).onattribute)===null||r===void 0||r.call(s,this.attribname,this.attribvalue,t===j.Double?'"':t===j.Single?"'":t===j.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(t){const n=t.search(Wt);let s=n<0?t:t.substr(0,n);return this.lowerCaseTagNames&&(s=s.toLowerCase()),s}ondeclaration(t,n){this.endIndex=n;const s=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){const r=this.getInstructionName(s);this.cbs.onprocessinginstruction(`!${r}`,`!${s}`)}this.startIndex=n+1}onprocessinginstruction(t,n){this.endIndex=n;const s=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){const r=this.getInstructionName(s);this.cbs.onprocessinginstruction(`?${r}`,`?${s}`)}this.startIndex=n+1}oncomment(t,n,s){var r,o,i,a;this.endIndex=n,(o=(r=this.cbs).oncomment)===null||o===void 0||o.call(r,this.getSlice(t,n-s)),(a=(i=this.cbs).oncommentend)===null||a===void 0||a.call(i),this.startIndex=n+1}oncdata(t,n,s){var r,o,i,a,c,h,u,l,d,m;this.endIndex=n;const b=this.getSlice(t,n-s);this.options.xmlMode||this.options.recognizeCDATA?((o=(r=this.cbs).oncdatastart)===null||o===void 0||o.call(r),(a=(i=this.cbs).ontext)===null||a===void 0||a.call(i,b),(h=(c=this.cbs).oncdataend)===null||h===void 0||h.call(c)):((l=(u=this.cbs).oncomment)===null||l===void 0||l.call(u,`[CDATA[${b}]]`),(m=(d=this.cbs).oncommentend)===null||m===void 0||m.call(d)),this.startIndex=n+1}onend(){var t,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let s=this.stack.length;s>0;this.cbs.onclosetag(this.stack[--s],!0));}(n=(t=this.cbs).onend)===null||n===void 0||n.call(t)}reset(){var t,n,s,r;(n=(t=this.cbs).onreset)===null||n===void 0||n.call(t),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(r=(s=this.cbs).onparserinit)===null||r===void 0||r.call(s,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(t){this.reset(),this.end(t)}getSlice(t,n){for(;t-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let s=this.buffers[0].slice(t-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),s+=this.buffers[0].slice(0,n-this.bufferOffset);return s}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(t){var n,s;if(this.ended){(s=(n=this.cbs).onerror)===null||s===void 0||s.call(n,new Error(".write() after done!"));return}this.buffers.push(t),this.tokenizer.running&&(this.tokenizer.write(t),this.writeIndex++)}end(t){var n,s;if(this.ended){(s=(n=this.cbs).onerror)===null||s===void 0||s.call(n,new Error(".end() after done!"));return}t&&this.write(t),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(t){this.write(t)}done(t){this.end(t)}}const Et=67324752,St=33639248,yt=101010256,Yt=1,Gt=8,Kt=64,Q=0,vt=8,Qt=12*1024*1024,X=128,_t=10*1024*1024,$=2*1024*1024,kt=100,Ct=new TextEncoder,qt=new TextDecoder("utf-8");function k(e){return Ct.encode(e)}function q(e){return qt.decode(e)}function It(e){return Ct.encode(e).byteLength}function T(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Tt(e){const t=e.reduce((r,o)=>r+o.byteLength,0),n=new Uint8Array(t);let s=0;for(const r of e)n.set(r,s),s+=r.byteLength;return n}async function $t(e,t,n){const s=e.getReader(),r=[];let o=0;try{for(;;){const{done:i,value:a}=await s.read();if(i)break;if(o+=a.byteLength,o>t)throw await s.cancel(),new Error(`ZIP entry ${n} inflated beyond its declared size.`);r.push(a)}}finally{s.releaseLock()}return Tt(r)}function Lt(e){const t=new Uint8Array(e.byteLength);return t.set(e),new ReadableStream({start(n){n.enqueue(t),n.close()}})}async function Jt(e,t,n){const s=Lt(e).pipeThrough(new DecompressionStream("deflate-raw"));return await $t(s,t,n)}async function te(e){const t=Lt(e).pipeThrough(new CompressionStream("deflate-raw"));return await $t(t,$+1024,"(deflate)")}function ee(e){const t=T(e),n=Math.max(0,e.byteLength-65535-22);for(let s=e.byteLength-22;s>=n;s-=1){if(s<0||t.getUint32(s,!0)!==yt)continue;const r=t.getUint16(s+20,!0);if(s+22+r===e.byteLength)return s}throw new Error("ZIP end-of-central-directory not found.")}function Rt(e,t){if((e&Yt)!==0)throw new Error(`ZIP entry ${t} is encrypted.`);if((e&Kt)!==0)throw new Error(`ZIP entry ${t} uses strong encryption.`)}function ht(e,t,n){return t===n?!0:(e&Gt)!==0&&t===0}function ne(e){if(e.byteLength>Qt)throw new Error("ZIP input exceeds compressed byte limit.");const t=T(e),n=ee(e),s=t.getUint16(n+4,!0),r=t.getUint16(n+6,!0),o=t.getUint16(n+8,!0),i=t.getUint16(n+10,!0),a=t.getUint32(n+12,!0),c=t.getUint32(n+16,!0),h=c+a;if(s!==0||r!==0||o!==i)throw new Error("Multi-disk ZIP archives are not supported.");if(i===65535||a===4294967295||c===4294967295)throw new Error("ZIP64 archives are not supported.");if(i>X)throw new Error(`ZIP entry count ${i} exceeds limit ${X}.`);if(c+a>e.byteLength)throw new Error("ZIP central directory is out of bounds.");if(h>n)throw new Error("ZIP central directory overlaps the end-of-central-directory record.");const u=[];let l=c,d=0;for(let m=0;m<i;m+=1){if(l+46>h||t.getUint32(l,!0)!==St)throw new Error("Invalid ZIP central directory entry.");const b=t.getUint16(l+8,!0),x=t.getUint16(l+10,!0),w=t.getUint32(l+20,!0),p=t.getUint32(l+24,!0),g=t.getUint16(l+28,!0),_=t.getUint16(l+30,!0),v=t.getUint16(l+32,!0),y=t.getUint32(l+42,!0);if(w===4294967295||p===4294967295||y===4294967295)throw new Error("ZIP64 archives are not supported.");if(l+46+g+_+v>h)throw new Error("ZIP central directory entry is out of bounds.");const S=q(e.subarray(l+46,l+46+g));if(Rt(b,S),x!==Q&&x!==vt)throw new Error(`ZIP entry ${S} uses unsupported compression method ${x}.`);if(p>$)throw new Error(`ZIP entry ${S} exceeds per-entry uncompressed limit.`);if(p>0&&w===0)throw new Error(`ZIP entry ${S} has an invalid compression ratio.`);if(w>0&&p/w>kt)throw new Error(`ZIP entry ${S} exceeds compression ratio limit.`);if(d+=p,d>_t)throw new Error("ZIP archive exceeds total uncompressed limit.");u.push({name:S,flags:b,method:x,compressedSize:w,uncompressedSize:p,localOffset:y}),l+=46+g+_+v}if(l!==h)throw new Error("ZIP central directory size does not match its entries.");return u}async function se(e,t){const n=T(e),s=t.localOffset;if(s+30>e.byteLength||n.getUint32(s,!0)!==Et)throw new Error(`Invalid local ZIP header for ${t.name}.`);const r=n.getUint16(s+6,!0),o=n.getUint16(s+8,!0),i=n.getUint32(s+18,!0),a=n.getUint32(s+22,!0),c=n.getUint16(s+26,!0),h=n.getUint16(s+28,!0);if(Rt(r,t.name),o!==t.method)throw new Error(`ZIP method mismatch for ${t.name}.`);if(!ht(r,i,t.compressedSize)||!ht(r,a,t.uncompressedSize))throw new Error(`ZIP size mismatch for ${t.name}.`);if(s+30+c+h>e.byteLength)throw new Error(`ZIP local header for ${t.name} is out of bounds.`);if(q(e.subarray(s+30,s+30+c))!==t.name)throw new Error(`ZIP local header name mismatch for ${t.name}.`);const l=s+30+c+h;if(l+t.compressedSize>e.byteLength)throw new Error(`ZIP data for ${t.name} is out of bounds.`);const d=e.subarray(l,l+t.compressedSize),m=t.method===Q?d.slice():await Jt(d,t.uncompressedSize,t.name);if(m.byteLength!==t.uncompressedSize)throw new Error(`ZIP uncompressed size mismatch for ${t.name}.`);return m}function re(e){const t=new Map;for(const n of e)t.set(n.name,n);return t}async function L(e,t,n){const s=t.get(n);if(!s)return null;const r=q(await se(e,s));return Nt(r),r}let O=null;function oe(e){if(!O){O=new Uint32Array(256);for(let n=0;n<256;n+=1){let s=n;for(let r=0;r<8;r+=1)s=s&1?3988292384^s>>>1:s>>>1;O[n]=s>>>0}}let t=4294967295;for(const n of e)t=O[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}async function ie(e){if(e.length>X)throw new Error(`ZIP entry count ${e.length} exceeds limit ${X}.`);const t=[],n=[];let s=0,r=0;for(const c of e){if(c.data.byteLength>$)throw new Error(`ZIP entry ${c.name} exceeds per-entry uncompressed limit.`);if(r+=c.data.byteLength,r>_t)throw new Error("ZIP archive exceeds total uncompressed limit.");const h=await te(c.data),u=h.byteLength<c.data.byteLength&&c.data.byteLength/Math.max(1,h.byteLength)<=kt,l=u?h:c.data,d=u?vt:Q,m=k(c.name),b=oe(c.data),x=new Uint8Array(30),w=T(x);w.setUint32(0,Et,!0),w.setUint16(4,20,!0),w.setUint16(6,0,!0),w.setUint16(8,d,!0),w.setUint32(14,b,!0),w.setUint32(18,l.byteLength,!0),w.setUint32(22,c.data.byteLength,!0),w.setUint16(26,m.byteLength,!0),t.push(x,m,l);const p=new Uint8Array(46),g=T(p);g.setUint32(0,St,!0),g.setUint16(4,20,!0),g.setUint16(6,20,!0),g.setUint16(8,0,!0),g.setUint16(10,d,!0),g.setUint32(16,b,!0),g.setUint32(20,l.byteLength,!0),g.setUint32(24,c.data.byteLength,!0),g.setUint16(28,m.byteLength,!0),g.setUint32(42,s,!0),n.push(p,m),s+=x.byteLength+m.byteLength+l.byteLength}const o=n.reduce((c,h)=>c+h.byteLength,0),i=new Uint8Array(22),a=T(i);return a.setUint32(0,yt,!0),a.setUint16(8,e.length,!0),a.setUint16(10,e.length,!0),a.setUint32(12,o,!0),a.setUint32(16,s,!0),Tt([...t,...n,i])}function Nt(e){if(It(e)>$)throw new Error("Office XML exceeds the parser input limit.");const t=e.toLowerCase();if(t.includes("<!doctype")||t.includes("<!entity"))throw new Error("Office XML DTD and entity declarations are not supported.")}function ut(e){const t=e.lastIndexOf(":");return(t===-1?e:e.slice(t+1)).toLowerCase()}function z(e,t){Nt(e);let n="",s=0;const r=t||" ";return new Ht({onopentag(i){s>0?s+=1:ut(i)==="script"||ut(i)==="style"?(n+=r,s=1):n+=t},ontext(i){s===0&&(n+=i)},onclosetag(){s>0?(s-=1,s===0&&(n+=r)):n+=t}},{decodeEntities:!0,xmlMode:!0}).end(e),n}function ae(e){return z(`<openwork-value>${e}</openwork-value>`,"")}function Ut(e){return z(e," ").replace(/\s+/g," ").trim()}function J(e){return`(?:[A-Za-z_][\\w.-]*:)?${e}`}function tt(e){const t={},n=/([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;let s;for(;s=n.exec(e);){const r=s[1],o=s[2]??s[3]??"";t[r]=ae(o)}return t}function N(e,t){const n=J(t),s=new RegExp(`<${n}\\b([^>]*)>([\\s\\S]*?)<\\/${n}>`,"g"),r=[];let o;for(;o=s.exec(e);)r.push({attributes:tt(o[1]),inner:o[2]});return r}function C(e,t){const n=J(t),s=new RegExp(`<${n}\\b([^>]*)\\/?\\s*>`,"g"),r=[];let o;for(;o=s.exec(e);)r.push(tt(o[1]));return r}function ce(e,t){const n=N(e,t)[0];if(n)return z(n.inner,"").trim()}function B(e,t){const n=J(t),s=new RegExp(`<${n}\\b([^>]*?)(\\/>|>([\\s\\S]*?)<\\/${n}>)`,"g"),r=[];let o;for(;o=s.exec(e);)r.push({attributes:tt(o[1]),inner:o[3]??""});return r}function W(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f]/g,"")}function dt(...e){const t=[];for(const n of e.join("/").split("/"))!n||n==="."||(n===".."?t.pop():t.push(n));return t.join("/")}function le(e,t){const n=new Map;if(!e)return n;for(const s of C(e,"Relationship")){const r=s.Id,o=s.Target;!r||!o||s.TargetMode==="External"||/^[a-z][a-z0-9+.-]*:/i.test(o)||n.set(r,o.startsWith("/")?dt(o.slice(1)):dt(t,o))}return n}const he=64,ue=2e5,de=25e4,ft=32,mt=5e4,H=1048576,Y=16384,pt=31,gt=32767,wt=Date.UTC(1899,11,30),fe=Date.UTC(1904,0,1),V=864e5;function G(e){let t=e,n="";for(;t>0;){const s=(t-1)%26;n=String.fromCharCode(65+s)+n,t=Math.floor((t-1)/26)}return n}function me(e){let t=0;for(const n of e.toUpperCase()){const s=n.charCodeAt(0);if(s<65||s>90)return 0;t=t*26+(s-64)}return t}function K(e){const t=/^\$?([A-Za-z]{1,3})\$?(\d{1,7})$/.exec(e.trim());if(!t)return null;const n=me(t[1]),s=Number.parseInt(t[2],10);return n<1||n>Y||s<1||s>H?null:{row:s,column:n}}function pe(e){const t=e.trim(),[n,s=n]=t.split(":"),r=K(n),o=K(s);return!r||!o?null:{firstRow:Math.min(r.row,o.row),lastRow:Math.max(r.row,o.row),firstColumn:Math.min(r.column,o.column),lastColumn:Math.max(r.column,o.column)}}function ge(e,t){const n=le(t,"xl"),s=C(e,"sheet"),r=s.slice(0,he).map((o,i)=>{const a=o["r:id"]??o.id??"",c=a&&n.has(a)?n.get(a)??"":`xl/worksheets/sheet${i+1}.xml`;return{position:i+1,name:o.name??`Sheet${i+1}`,sheetId:o.sheetId??String(i+1),relationshipId:a,path:c,hidden:o.state==="hidden"||o.state==="veryHidden"}});return{sheets:r,omittedSheets:s.length-r.length}}const we=/<(?:[A-Za-z_][\w.-]*:)?rPh\b(?:[^>]*\/>|[^>]*>[\s\S]*?<\/(?:[A-Za-z_][\w.-]*:)?rPh\s*>)/g;function Mt(e){const t=e.replace(we,"");return N(t,"t").map(s=>z(s.inner,"")).join("").trim()||Ut(t)}function be(e){if(!e)return[];const t=[];for(const n of N(e,"si")){if(t.length>=ue)break;t.push(Mt(n.inner))}return t}function xe(e){switch(e){case"0":return"General";case"1":return"0";case"2":return"0.00";case"3":return"#,##0";case"4":return"#,##0.00";case"9":return"0%";case"10":return"0.00%";case"11":return"0.00E+00";case"14":return"mm-dd-yy";case"15":return"d-mmm-yy";case"16":return"d-mmm";case"17":return"mmm-yy";case"18":return"h:mm AM/PM";case"19":return"h:mm:ss AM/PM";case"20":return"h:mm";case"21":return"h:mm:ss";case"22":return"m/d/yy h:mm";case"27":case"28":case"29":case"30":case"31":case"36":case"50":case"51":case"52":case"53":case"54":case"57":case"58":return"yyyy-mm-dd";case"32":case"33":case"34":case"35":case"55":case"56":return"h:mm:ss";case"45":return"mm:ss";case"46":return"[h]:mm:ss";case"47":return"mmss.0";case"49":return"@";default:return""}}function Ee(e){if(!e)return[];const t=new Map;for(const s of C(e,"numFmt"))s.numFmtId&&s.formatCode&&t.set(s.numFmtId,s.formatCode);const n=N(e,"cellXfs")[0]?.inner??"";return C(n,"xf").map(s=>{const r=s.numFmtId??"0";return t.get(r)??xe(r)})}function Se(e){if(!e||e==="General"||e==="@")return!1;const t=e.replace(/"[^"]*"/g,"").replace(/\[[^\]]*\]/g,"").replace(/\\./g,"").replace(/[Ee][+-]/g,"");return/[ymdhs]/i.test(t)}function R(e,t=2){return String(e).padStart(t,"0")}function ye(e,t=!1){if(!Number.isFinite(e)||e<0||e>2958465)return null;const n=t?fe:e<60?wt+V:wt,s=Math.round(e*V),r=new Date(n+s);if(Number.isNaN(r.getTime()))return null;const o=`${R(r.getUTCHours())}:${R(r.getUTCMinutes())}:${R(r.getUTCSeconds())}`;if(e<1&&!t)return o;const i=`${r.getUTCFullYear()}-${R(r.getUTCMonth()+1)}-${R(r.getUTCDate())}`;return s%V===0?i:`${i} ${o}`}function ve(e){return e==="s"?"shared_string":e==="inlineStr"?"inline_string":e==="str"?"formula_string":e==="b"?"boolean":e==="e"?"error":e==="d"?"date":e||"number"}function _e(e,t,n,s,r,o){if(e==="inlineStr")return Mt(n)||void 0;if(e==="s"&&t!==void 0){const i=Number.parseInt(t,10);return Number.isInteger(i)?s[i]:void 0}return e==="b"&&t!==void 0?t==="1"?"TRUE":"FALSE":(e===""||e==="n")&&t!==void 0&&Se(r)?ye(Number(t),o)??t:t}function ke(e,t,n,s,r){const o=C(e,"dimension")[0]?.ref??"",i=[];for(const d of C(e,"mergeCell"))d.ref&&i.push(d.ref);const a=N(e,"sheetData")[0]?.inner??e,c=[];let h=0,u=0,l=0;for(const d of B(a,"row")){const m=Number.parseInt(d.attributes.r??"",10),b=Number.isInteger(m)&&m>0?m:l+1;l=b;let x=0;for(const w of B(d.inner,"c")){const p=w.attributes,g=w.inner,_=p.r?K(p.r):null,v=_?.column??x+1,y=_?.row??b;x=v;const S=B(g,"f")[0],U=ce(g,"v"),F=p.t??"";if(S&&(u+=1),U===void 0&&!S&&F!=="inlineStr")continue;if(c.length>=r){h+=1;continue}const M=p.s,Z=M!==void 0?n[Number.parseInt(M,10)]:void 0,nt=_e(F,U,g,t,Z,s),Dt=S?Ut(S.inner):"";c.push({reference:`${G(v)}${y}`,row:y,column:v,type:ve(F),...M!==void 0?{styleIndex:M}:{},...Z?{numberFormat:Z}:{},...S?{formula:Dt}:{},...S?.attributes.t?{formulaType:S.attributes.t}:{},...S?.attributes.ref?{formulaRef:S.attributes.ref}:{},...U!==void 0?{rawValue:U}:{},...nt!==void 0?{displayedValue:nt}:{}})}}return{dimension:o,mergedRanges:i,cells:c,omittedCells:h,formulaCount:u}}function Ce(e,t){const n=e.length===0&&t?pe(t):null;if(n)return n;if(e.length===0)return{firstRow:0,lastRow:0,firstColumn:0,lastColumn:0};let s=Number.POSITIVE_INFINITY,r=0,o=Number.POSITIVE_INFINITY,i=0;for(const a of e)s=Math.min(s,a.row),r=Math.max(r,a.row),o=Math.min(o,a.column),i=Math.max(i,a.column);return{firstRow:s,lastRow:r,firstColumn:o,lastColumn:i}}async function Ie(e){const t=re(ne(e)),n=await L(e,t,"xl/workbook.xml");if(!n)throw new Error("XLSX workbook.xml was not found.");const s=be(await L(e,t,"xl/sharedStrings.xml")),r=Ee(await L(e,t,"xl/styles.xml")),{sheets:o,omittedSheets:i}=ge(n,await L(e,t,"xl/_rels/workbook.xml.rels"));if(o.length===0)throw new Error("XLSX workbook contained no sheets.");const a=C(n,"workbookPr").some(c=>c.date1904==="1"||c.date1904==="true");return{sheets:o,omittedSheets:i,sharedStringCount:s.length,styleCount:r.length,date1904:a,async readSheet(c,h={}){const u=c.path.startsWith("xl/worksheets/")&&c.path.endsWith(".xml")?c.path:"",l=u?await L(e,t,u):null;if(!l)throw new Error(`Worksheet XML for "${c.name}" was not found or was outside xl/worksheets.`);const d=ke(l,s,r,a,h.cellLimit??de);return{info:c,...d,...Ce(d.cells,d.dimension)}}}}const Te=25e4;function $e(e,t={}){if(e.cells.length===0)return[[""]];const n=t.maxCells??Te;if(e.lastRow*e.lastColumn>n)throw new Error(`This sheet spans ${e.lastRow} rows by ${e.lastColumn} columns, which is too large to show as an editable grid.`);const s=Array.from({length:e.lastRow},()=>Array.from({length:e.lastColumn},()=>""));for(const r of e.cells)s[r.row-1][r.column-1]=t.formulas&&r.formula?`=${r.formula}`:r.displayedValue??r.rawValue??(r.formula?`=${r.formula}`:"");return s}const Le=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/,bt=8192,Re=/\b(DDE|WEBSERVICE|FILTERXML|RTD|CALL|REGISTER(?:\.ID)?|EXEC|SQL\.REQUEST|IMPORT(?:DATA|XML|HTML|FEED|RANGE)|IMAGE)\s*\(/i,Ne=/\[[^\]]*\][^!'"(),;+\-*/^&=<>\[\]{}]*!|'[^']*\[[^\]]*\][^']*'!/u,Ue=/'[^']*(?::\/\/|\\\\)[^']*'!/;function At(e){return typeof e=="object"&&e!==null&&typeof e.formula=="string"}function Me(e){const t=e.trim().replace(/^=/,"");if(!t)return"is empty";if(t.length>bt)return`is longer than ${bt} characters`;if(t.includes("|"))return"contains a DDE-style external command reference";const n=Re.exec(t);return n?`uses ${n[1].toUpperCase()}, which reaches outside the workbook when it recalculates`:Ne.test(t)?"references another workbook":Ue.test(t)?"references a remote or network path":null}function Ae(e,t){const n=Me(e.formula);if(n)throw new Error(`Formula in ${t} ${n}; only calculations inside the workbook are written. Write the value instead.`);return e.formula.trim().replace(/^=/,"")}function Pe(e){if(e==="")return null;if(e==="TRUE")return!0;if(e==="FALSE")return!1;if(Le.test(e)){const t=Number(e);if(Number.isFinite(t))return t}return e}function Oe(e,t,n){let r=(e??"").replace(/[\u0000-\u001f\u007f[\]:*?/\\]/g," ").replace(/\s+/g," ").replace(/^'+|'+$/g,"").trim().slice(0,pt).trim()||`Sheet${t}`,o=2;for(;n.has(r.toLowerCase())||r.toLowerCase()==="history";)r=`${r.slice(0,pt-String(o).length-1)}-${o}`,o+=1;return n.add(r.toLowerCase()),r}function De(e,t,n){const s=n>0?` s="${n}"`:"";if(t===null||t==="")return"";if(typeof t=="number")return Number.isFinite(t)?`<c r="${e}"${s}><v>${t}</v></c>`:`<c r="${e}" t="e"${s}><v>#NUM!</v></c>`;if(typeof t=="boolean")return`<c r="${e}" t="b"${s}><v>${t?1:0}</v></c>`;if(At(t))return`<c r="${e}"${s}><f>${W(Ae(t,e))}</f></c>`;if(t.length>gt)throw new Error(`Cell ${e} holds ${t.length} characters of text; Excel allows ${gt}. Shorten it or split it across cells.`);const r=/^\s|\s$|\n/.test(t)?' xml:space="preserve"':"";return`<c r="${e}" t="inlineStr"${s}><is><t${r}>${W(t)}</t></is></c>`}function Xe(e){return e===null?0:At(e)?12:String(e).split(`
2
- `).reduce((t,n)=>Math.max(t,n.length),0)}function ze(e){const t=e.rows,n=t.reduce((u,l)=>Math.max(u,l.length),0);if(t.length>H)throw new Error(`Sheet "${e.name??""}" has ${t.length} rows; Excel allows ${H}.`);if(n>Y)throw new Error(`Sheet "${e.name??""}" has ${n} columns; Excel allows ${Y}.`);const s=e.header??!0,r=Array.from({length:n},()=>0),o=[];t.forEach((u,l)=>{const d=[];u.forEach((m,b)=>{r[b]=Math.max(r[b],Xe(m));const x=De(`${G(b+1)}${l+1}`,m,s&&l===0?1:0);x&&d.push(x)}),d.length&&o.push(`<row r="${l+1}">${d.join("")}</row>`)});const i=t.length&&n?`A1:${G(n)}${t.length}`:"A1",a=n?`<cols>${r.map((u,l)=>`<col min="${l+1}" max="${l+1}" width="${Math.min(60,Math.max(8,u+2))}" customWidth="1"/>`).join("")}</cols>`:"",c=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
- <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><dimension ref="${i}"/><sheetViews><sheetView workbookViewId="0"${s&&t.length>1?'><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView>':"/>"}</sheetViews><sheetFormatPr defaultRowHeight="15"/>${a}<sheetData>${o.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`,h=It(c);if(h>$)throw new Error(`Sheet ${JSON.stringify(e.name??"")} would be ${h} bytes of worksheet XML; the limit is ${$} bytes (roughly 30,000 text cells). Split the rows across sheets or files, shorten cell text, or write a CSV instead.`);return{xml:c,rows:t.length,columns:n}}const Fe=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
4
- <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fonts count="2"><font><sz val="11"/><name val="Calibri"/></font><font><b/><sz val="11"/><name val="Calibri"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="2"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`;async function Ze(e){if(e.length===0)throw new Error("A workbook needs at least one sheet.");if(e.length>ft)throw new Error(`A workbook may contain at most ${ft} sheets.`);const t=e.reduce((i,a)=>i+a.rows.reduce((c,h)=>c+h.length,0),0);if(t>mt)throw new Error(`Workbook has ${t} cells; spreadsheet_write accepts at most ${mt}. Split the data across files or write a CSV.`);const n=new Set,s=e.map((i,a)=>({...i,name:Oe(i.name,a+1,n)})),r=s.map(i=>ze(i)),o=[{name:"[Content_Types].xml",data:k(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
5
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>${s.map((i,a)=>`<Override PartName="/xl/worksheets/sheet${a+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")}</Types>`)},{name:"_rels/.rels",data:k(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
6
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`)},{name:"xl/workbook.xml",data:k(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
7
- <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><bookViews><workbookView/></bookViews><sheets>${s.map((i,a)=>`<sheet name="${W(i.name)}" sheetId="${a+1}" r:id="rId${a+1}"/>`).join("")}</sheets><calcPr fullCalcOnLoad="1"/></workbook>`)},{name:"xl/_rels/workbook.xml.rels",data:k(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
8
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${s.map((i,a)=>`<Relationship Id="rId${a+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${a+1}.xml"/>`).join("")}<Relationship Id="rId${s.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`)},{name:"xl/styles.xml",data:k(Fe)},...r.map((i,a)=>({name:`xl/worksheets/sheet${a+1}.xml`,data:k(i.xml)}))];return{bytes:await ie(o),sheets:s.map((i,a)=>({name:i.name,rows:r[a].rows,columns:r[a].columns}))}}function et(e){const t=e.toLowerCase().split(/[?#]/)[0]??e.toLowerCase(),n=t.lastIndexOf(".");return n>=0?t.slice(n+1):""}function Pt(e){return et(e)==="tsv"?" ":","}function je(e,t){const n=[];let s=[],r="",o=!1;for(let i=0;i<e.length;i+=1){const a=e[i],c=e[i+1];if(o){a==='"'&&c==='"'?(r+='"',i+=1):a==='"'?o=!1:r+=a;continue}if(a==='"'){o=!0;continue}if(a===t){s.push(r),r="";continue}if(a===`
9
- `){s.push(r),n.push(s),s=[],r="";continue}a!=="\r"&&(r+=a)}return(r||s.length)&&(s.push(r),n.push(s)),n.length?n:[[""]]}function Be(e,t){return e.map(n=>n.map(s=>{const r=String(s??"");return!r.includes(t)&&!/["\r\n]/.test(r)?r:`"${r.replace(/"/g,'""')}"`}).join(t)).join(`
10
- `)+`
11
- `}function Ot(e){return e==="xls"?"Legacy .xls workbooks can't be edited here. Save the file as .xlsx and open it again.":e==="ods"?"OpenDocument spreadsheets can't be edited here. Export the file as .xlsx and open it again.":null}function Ve(e){return new Uint8Array(e.kind==="binary"?e.data:new ArrayBuffer(0))}function We(e){const t=new Uint8Array(e.byteLength);return t.set(e),t.buffer}async function He(e){const t=et(e.name);if(t==="csv"||t==="tsv")return je(e.content.kind==="text"?e.content.data:"",Pt(e.name));const n=Ot(t);if(n)throw new Error(n);const s=await Ie(Ve(e.content)),r=await s.readSheet(s.sheets[0]);return $e(r)}async function Ye(e,t){const n=et(e);if(n==="csv"||n==="tsv")return{kind:"text",data:Be(t,Pt(e))};const s=Ot(n);if(s)throw new Error(s);const{bytes:r}=await Ze([{name:"Sheet1",header:!1,rows:t.map(o=>o.map(i=>Pe(String(i??""))))}]);return{kind:"binary",data:We(r)}}function D(e){return e.map(t=>[...t])}function xt(e){const t=Math.max(1,...e.map(n=>n.length));return e.map(n=>Array.from({length:t},(s,r)=>n[r]??""))}function Ge({name:e,content:t,onSave:n}){const{data:s,error:r,isLoading:o}=Zt({queryKey:["artifact-spreadsheet",e,t],queryFn:async()=>xt(await He({name:e,content:t})),refetchOnReconnect:!1,refetchOnWindowFocus:!1,staleTime:1/0}),[i,a]=P.useState([[""]]),[c,h]=P.useState([[""]]),u=P.useMemo(()=>JSON.stringify(i)!==JSON.stringify(c),[c,i]);P.useEffect(()=>{s&&(a(s),h(D(s)))},[s]);const{mutate:l,isPending:d}=jt({mutationFn:async()=>{const p=await Ye(e,i);await n(p)},onSuccess:()=>{h(D(i))}});return{rows:i,error:r,isLoading:o,updateCell:(p,g,_)=>{a(v=>{const y=D(v);return y[p]=[...y[p]??[]],y[p][g]=_,xt(y)})},addRow:()=>a(p=>[...p,Array.from({length:Math.max(1,p[0]?.length??1)},()=>"")]),addColumn:()=>a(p=>p.map(g=>[...g,""])),discard:()=>a(D(c)),isDirty:u,save:l,isSaving:d}}function Qe(e){const{rows:t,error:n,isLoading:s,updateCell:r,addRow:o,addColumn:i,discard:a,isDirty:c,save:h,isSaving:u}=Ge(e),l=e.saving||u;return s?E.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:E.jsx(zt,{className:"size-4 animate-spin"})}):n?E.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:n instanceof Error?n.message:"Failed to parse spreadsheet"}):E.jsxs("div",{className:Ft("flex h-full min-h-0 flex-col",e.className),children:[E.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-2 border-b border-border",children:[E.jsxs(A,{variant:"ghost",size:"xs",onClick:o,children:[E.jsx(rt,{className:"size-3"})," Row"]}),E.jsxs(A,{variant:"ghost",size:"xs",onClick:i,children:[E.jsx(rt,{className:"size-3"})," Column"]}),E.jsx("div",{className:"min-w-0 flex-1"}),E.jsx(A,{variant:"ghost",size:"xs",onClick:a,disabled:!c||l,children:"Discard"}),E.jsx(A,{variant:"default",size:"xs",onClick:()=>h(),disabled:!c||l,children:l?"Saving":"Save"})]}),E.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:E.jsx("table",{className:"w-full border-collapse text-xs",children:E.jsx("tbody",{children:t.map((d,m)=>E.jsx("tr",{children:d.map((b,x)=>E.jsx("td",{className:"border-b not-first:border-l border-border p-0 align-top",children:E.jsx("input",{className:"h-8 w-full min-w-[120px] bg-transparent px-2 text-foreground outline-none focus:bg-muted/50",value:b,onChange:w=>r(m,x,w.target.value)})},x))},m))})})})]})}export{Qe as ArtifactSpreadsheetEditor};
@@ -1 +0,0 @@
1
- import{U as a,C as n}from"./mermaid.core-PQNy-dHT.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-HLEWEB6X-JXz7B5zc.js";import{_ as i}from"./mermaid.core-PQNy-dHT.js";import"./chunk-5VM5RSS4-D4c8XRGl.js";import"./chunk-XXDRQBXY-XqHzbo0u.js";import"./chunk-POPQ4Y6H-2llTUUN7.js";import"./chunk-F27PBJKO-BnyyjaCS.js";import"./app-DSUHKGsm.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-HLEWEB6X-JXz7B5zc.js";import{_ as i}from"./mermaid.core-PQNy-dHT.js";import"./chunk-5VM5RSS4-D4c8XRGl.js";import"./chunk-XXDRQBXY-XqHzbo0u.js";import"./chunk-POPQ4Y6H-2llTUUN7.js";import"./chunk-F27PBJKO-BnyyjaCS.js";import"./app-DSUHKGsm.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{s as r,b as e,a,S as s}from"./chunk-ZLD2IHE6-Dz_IjbQJ.js";import{_ as i}from"./mermaid.core-PQNy-dHT.js";import"./chunk-XXDRQBXY-XqHzbo0u.js";import"./chunk-POPQ4Y6H-2llTUUN7.js";import"./chunk-F27PBJKO-BnyyjaCS.js";import"./app-DSUHKGsm.js";var u={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1,8 +0,0 @@
1
- import{c as r,s as e}from"./flowDiagram-T62WH6J4-CELW8hlc.js";import{_ as a}from"./mermaid.core-PQNy-dHT.js";import"./chunk-5VM5RSS4-D4c8XRGl.js";import"./chunk-XXDRQBXY-XqHzbo0u.js";import"./chunk-POPQ4Y6H-2llTUUN7.js";import"./chunk-F27PBJKO-BnyyjaCS.js";import"./app-DSUHKGsm.js";import"./channel-OiorT9Re.js";var o=a(t=>`${e(t)}
2
- .swimlane.cluster rect {
3
- stroke: ${t.clusterBorder} !important;
4
- }
5
- [data-look="neo"].cluster rect {
6
- filter: none;
7
- }
8
- `,"getStyles"),s=o,n=r({defaultLayout:"swimlane",styles:s});export{n as diagram};