@stlite/desktop 0.96.0 → 0.98.1

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 (182) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/bin/dump_artifacts.js +1 -1
  3. package/build/assets/9897c61aa169e10d-BSbTZIlv.woff2 +0 -0
  4. package/build/assets/{ErrorOutline.esm-_LuTQzkr-BFWi9Uuj.js → ErrorOutline.esm-DV80JhHP-XkDmlp3T.js} +1 -1
  5. package/build/assets/{FileDownload.esm-CUqXYNk4-DieQ2Qle.js → FileDownload.esm-Bg0DSX1Z-tYB-VhDd.js} +1 -1
  6. package/build/assets/FileHelper-6E1AHofU-qrMXF9BJ.js +5 -0
  7. package/build/assets/{FormClearHelper-C58X4iX0-CI3cpm91.js → FormClearHelper-CbmTijuR-BhfBTvx4.js} +1 -1
  8. package/build/assets/InputInstructions-GG_DznKT-BTS6NlIa.js +5 -0
  9. package/build/assets/{Particles-6ak5Hlgw-4VTgCETZ.js → Particles-ByFZ9kUC-B_aeMYcp.js} +1 -1
  10. package/build/assets/{ProgressBar-CQHaVJeY-Bo6RDYz5.js → ProgressBar-uLtuFXoi-C547ZD3U.js} +2 -2
  11. package/build/assets/StreamlitSyntaxHighlighter-0BOUSobY-CgsoE1gN.js +9 -0
  12. package/build/assets/TableChart.esm-CoMoidiP-DrT_rrb0.js +1 -0
  13. package/build/assets/UploadFileInfo-DdcsXhjv-m2CBXl3F.js +1 -0
  14. package/build/assets/WidgetLabel-CoLw86qs-CNbX-e3H.js +1 -0
  15. package/build/assets/WidgetLabelHelpIcon-DGQ_r-QQ-BpBcjxpA.js +1 -0
  16. package/build/assets/WidgetLabelHelpIconInline-CBvJmNo2-CLxNkiVd.js +1 -0
  17. package/build/assets/_baseAssignValue-DQhmkaDt-Bl1quFU6.js +1 -0
  18. package/build/assets/assertThisInitialized-C1dAyb4j-CzYfxWZp.js +1 -0
  19. package/build/assets/{base-input-CAXjxi6E-LJzeEbPm.js → base-input-BdLA32iO-A9B9vy_-.js} +4 -4
  20. package/build/assets/{checkbox-OEhCo8NJ-C1rXZb97.js → checkbox-DFREjf9t-Bj1xZr4O.js} +2 -2
  21. package/build/assets/constants-Dj7RTpUo-BGkidDJo.js +2 -0
  22. package/build/assets/createDownloadLinkElement-DdPyJxB4-BwUogbJk.js +1 -0
  23. package/build/assets/createSuper-BZpABwIl-CzqIX_hj.js +1 -0
  24. package/build/assets/data-grid-overlay-editor-QHhShSfm-3TuDDPoi.js +1 -0
  25. package/build/assets/{downloader-DcCTL3Wz-Dj-02g6N.js → downloader-DcCTL3Wz-BV_PV8FK.js} +1 -1
  26. package/build/assets/embed-DsUNNyuf-iklb31Eb.js +193 -0
  27. package/build/assets/{es6--XPcqeHG-2BbC2xK9.js → es6--XPcqeHG-CHWR2W_o.js} +2 -2
  28. package/build/assets/formatMoment-DEtsTHwA-BeQagUzn.js +1 -0
  29. package/build/assets/formatNumber-C0_e-CAH-GlcLbdL6.js +1 -0
  30. package/build/assets/iconPosition-DC20xXN5-Dq1FtUtw.js +1 -0
  31. package/build/assets/iframeResizer.contentWindow-CK2JqAeV-DqbaJEzN.js +1 -0
  32. package/build/assets/index-9BL32MjC-d0WHvbzb.js +1 -0
  33. package/build/assets/index-B0C1EJi--C9vASPz3.js +2 -0
  34. package/build/assets/index-B4B1qPeD-B4iZ3Hle.js +1 -0
  35. package/build/assets/index-B5UL-R7r-CWJT9KeA.js +1 -0
  36. package/build/assets/{index-CF9SDiIL-0Yw8O39Y.js → index-BGnBFvx7-CovA4PPU.js} +1 -1
  37. package/build/assets/index-BLF4SOe9-BATezQGi.js +1 -0
  38. package/build/assets/index-BVqn7psP-DOIOIfGO.js +1 -0
  39. package/build/assets/index-BWXbSx5b-3ZGL6YOx.js +9 -0
  40. package/build/assets/index-BWq44yej-BLlqoxJR.js +2 -0
  41. package/build/assets/index-BXKF9Na4-e8_T7zol.js +27 -0
  42. package/build/assets/index-BYY96E5j-Bp1H9cgU.js +1 -0
  43. package/build/assets/index-BZJBZSAA-DFqiOZai.js +2 -0
  44. package/build/assets/index-BjrlCNX2-LTYqrHHV.js +1 -0
  45. package/build/assets/index-BmK3aM70-BtZtyb9b.js +2 -0
  46. package/build/assets/index-BuOHAFyU-CgkpNrjG.js +1 -0
  47. package/build/assets/index-BwVivyUp-BMVGZ9_Q.js +1 -0
  48. package/build/assets/index-C2tfS9CH-BRrFBwHT.js +3 -0
  49. package/build/assets/index-CDQEgcT1-DtNnQE5Q.js +3 -0
  50. package/build/assets/index-CKw_lXVb-3dsfAMaj.js +9 -0
  51. package/build/assets/index-CSHbNsrd-CaeMETbK.js +1 -0
  52. package/build/assets/index-CStypS2h-ZcgczjKg.js +1 -0
  53. package/build/assets/index-CTUrfAxj--v8quZkn.js +2 -0
  54. package/build/assets/{index-CY18be0x-Bq4JW-41.js → index-CYGEb27Q-2USI782v.js} +1 -1
  55. package/build/assets/index-CZIHO3Hi-CIp8gy8I.js +1 -0
  56. package/build/assets/index-Cqst7YJT-C9v2_kdG.js +1 -0
  57. package/build/assets/index-CrKJRmJv-Bg5NDALn.js +1 -0
  58. package/build/assets/{index-DfPnrVLL-B6NKOBTt.js → index-CxYiRuXO-CRK1FQiS.js} +1 -1
  59. package/build/assets/{index-DttfDE80-GomZzukD.js → index-CzaX93h_-B-_1QLd4.js} +1 -1
  60. package/build/assets/index-D52Jf8Ey-SgTlRv8T.js +1 -0
  61. package/build/assets/{index-CJA4Tdig-Rs7zFCTh.js → index-D8-_3_8b-1KPkAAUR.js} +1 -1
  62. package/build/assets/{index-99W3Zegr-DhiLonYo.js → index-D84Izf2I-C_zQnNB2.js} +1 -1
  63. package/build/assets/index-DCNthJH_-DBm0ode_.js +1 -0
  64. package/build/assets/index-DKp3_2FO-qvF0epur.js +1 -0
  65. package/build/assets/{index-BwqdV017-BaIzlXlX.js → index-DXEnufEK-CPeh905k.js} +2 -2
  66. package/build/assets/index-Dd99Pbav-BGjrs667.js +1 -0
  67. package/build/assets/index-DegoUuPm.js +171 -0
  68. package/build/assets/index-Df-1Z3LJ-bsVAaBS1.js +1 -0
  69. package/build/assets/index-DlNfwH7j-Ciae2OLh.js +3789 -0
  70. package/build/assets/index-DnMeTGk7-X2HPuQXI.js +17 -0
  71. package/build/assets/index-DpazIH3n-D6BMkmZF.js +1 -0
  72. package/build/assets/{index-R0bDPfYF-CRQIdCoC.js → index-DuHJMwJD-Bsr8Y8w7.js} +2 -2
  73. package/build/assets/index-DuuHtz-x-Caurorud.js +3 -0
  74. package/build/assets/{index-Cp-N8m1m-CSwdpflI.js → index-Dxtfs80M-s0TmhiEk.js} +213 -213
  75. package/build/assets/index-LfSwL_C3-BhFtSxQv.js +1 -0
  76. package/build/assets/index-SfqmeEwF-Dq9F6PRu.js +1 -0
  77. package/build/assets/index-Zh4mTo6Q-BW_atvXh.js +1 -0
  78. package/build/assets/index-dDzvj0X4-DcwcRJ2U.js +1 -0
  79. package/build/assets/index-ebIdPrk5-uPj-BdYi.js +1 -0
  80. package/build/assets/index-glyZT6vh-DgW3Iulb.js +11 -0
  81. package/build/assets/index-hpzROwMA-mo9c0M0y.js +1 -0
  82. package/build/assets/index-rCmWIVzf.css +1 -0
  83. package/build/assets/index-t2JVnYeR-CxNAko6c.js +198 -0
  84. package/build/assets/{input-5gXdrXd2-J6HaBKjM.js → input-vJKt6Tqs-D1h27UxA.js} +2 -2
  85. package/build/assets/{main-DvFfgny--BkQIK2a9.js → main-B1Ej7gwo-CcTKNe5S.js} +1 -1
  86. package/build/assets/{memory-B3L1Fctl-mli5o0A1.js → memory-B3L1Fctl-Cn5y4VWL.js} +1 -1
  87. package/build/assets/number-overlay-editor-DJYV-edd-B_O-Ktcq.js +9 -0
  88. package/build/assets/numbro-CBbENDeu-C6X7Pww4.js +1 -0
  89. package/build/assets/{pandasStylerUtils-BvB3vP-L-D9viw-G9.js → pandasStylerUtils-GHHHScPD-CTKMoUtV.js} +1 -1
  90. package/build/assets/possibleConstructorReturn-E3G46ZYb-Lz9Rlt8w.js +1 -0
  91. package/build/assets/record-CvRL89xC-Cpipd1Kv.js +1 -0
  92. package/build/assets/{sandbox-ChAzL-i--CSnZJIg8.js → sandbox-ChAzL-i--BIq4nttm.js} +1 -1
  93. package/build/assets/select-Pj-68ff--fhVXPkd8.js +14 -0
  94. package/build/assets/sprintfjs-BB1ejNgh-D_XlFCD8.js +1 -0
  95. package/build/assets/styled-components-BF-9yHWP-Fq0Myn8O.js +1 -0
  96. package/build/assets/styled-components-BPyosp2h-CHa8nolL.js +1 -0
  97. package/build/assets/styled-components-UJ_u5XUO-B68esmwJ.js +1 -0
  98. package/build/assets/{timepicker-BMxsIjZb-Uq5-wJ6H.js → timepicker-BJ4MpQyD-d8465QWp.js} +3 -3
  99. package/build/assets/toConsumableArray-fI4JT57_-CqtYDc1p.js +3 -0
  100. package/build/assets/uniqueId-DvP0IaTe-DffbsNAr.js +1 -0
  101. package/build/assets/useBasicWidgetState-JbPrIror-Bu87DmaN.js +1 -0
  102. package/build/assets/{useIntlLocale-5C0LAQxq-ow_F-T5t.js → useIntlLocale-CYWMTZ3s-Bfz8l4j_.js} +5 -5
  103. package/build/assets/useSelectCommon-DTdQ2TWs-DMezB-1T.js +1 -0
  104. package/build/assets/useTextInputAutoExpand-DKFPNBDa-Cb0YY3m0.js +2 -0
  105. package/build/assets/{useUpdateUiValue-BtVkPggP-4VTS40xs.js → useUpdateUiValue-DMih0kWV-BWZ6Saew.js} +1 -1
  106. package/build/assets/useWaveformController-BeUcMXLl-DLfXFMqt.js +1 -0
  107. package/build/assets/wavesurfer.esm-idh1jvYE-D4Wwdy60.js +74 -0
  108. package/build/assets/withCalculatedWidth-Du6RrD8E-CIxv0z4S.js +1 -0
  109. package/build/assets/withFullScreenWrapper-uh7txjJc-CYEgnXN4.js +1 -0
  110. package/build/index.html +2 -2
  111. package/package.json +4 -4
  112. package/wheels/stlite_lib-0.1.0-py3-none-any.whl +0 -0
  113. package/wheels/streamlit-1.55.0-cp313-none-any.whl +0 -0
  114. package/build/assets/7249f9261aa0c06e-C7IFxh57.woff2 +0 -0
  115. package/build/assets/FileHelper-DbeeBEs5-Co0d-OBP.js +0 -5
  116. package/build/assets/InputInstructions-BSpH125g-CSupbuK3.js +0 -5
  117. package/build/assets/StreamlitSyntaxHighlighter-DSYWFRjz-B77VB7yz.js +0 -8
  118. package/build/assets/Toolbar-Cr9ArNQU-D5-awBnv.js +0 -1
  119. package/build/assets/UploadFileInfo-B5SttewO-BfvME59S.js +0 -1
  120. package/build/assets/_baseAssignValue-3fAevQ7t-BOcc6F75.js +0 -1
  121. package/build/assets/createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js +0 -1
  122. package/build/assets/createSuper-bIcQlS98-B8MWK81T.js +0 -1
  123. package/build/assets/data-grid-overlay-editor-DbHL3o_S-CiO7EIHu.js +0 -1
  124. package/build/assets/embed-DJe7ZhON-C4OnDOK-.js +0 -195
  125. package/build/assets/iframeResizer.contentWindow-9ByjY9IM-BBpPzlnE.js +0 -1
  126. package/build/assets/index-10RiWKwV-Cn-PcXb4.js +0 -3
  127. package/build/assets/index-47jAZmzN-8ZV_muwb.js +0 -1
  128. package/build/assets/index-BGCCnxH2-jQwb1QhH.js +0 -1
  129. package/build/assets/index-BHN72E4J-BztQAHMJ.js +0 -17
  130. package/build/assets/index-BSOGSXpv-Bd9gyoUy.js +0 -27
  131. package/build/assets/index-BVhYQGzc-Do7aV0dQ.js +0 -1
  132. package/build/assets/index-BVuioNdm-CVDd_GaD.js +0 -1
  133. package/build/assets/index-BYGDMULw-4dwQq_lE.js +0 -1
  134. package/build/assets/index-B_94eI3S-ADuW4ppz.js +0 -6
  135. package/build/assets/index-Bck9VlwE-zB2PlFuX.js +0 -3
  136. package/build/assets/index-Bdi0ug4X.js +0 -181
  137. package/build/assets/index-BrYfiXJ9-D7No2wma.js +0 -9
  138. package/build/assets/index-C6MBr137-B6bz_i6a.js +0 -1
  139. package/build/assets/index-CAtZcI5--D0BcKLsl.js +0 -2
  140. package/build/assets/index-CFA5JkEa-DUK-7VD7.js +0 -1
  141. package/build/assets/index-CaWaI2PT-DvorZu2G.js +0 -2
  142. package/build/assets/index-Cbq5ClnA-Ct1ftt5G.js +0 -1
  143. package/build/assets/index-CceTm1nk-D-m7sDsR.js +0 -1
  144. package/build/assets/index-CucLKMvI-CdFsTlcF.js +0 -1
  145. package/build/assets/index-CxZCITs0-CLi85oo1.js +0 -1
  146. package/build/assets/index-D3vT_IC--BZlisRXs.js +0 -3789
  147. package/build/assets/index-D5L-gN8f-Bny7-WhK.js +0 -11
  148. package/build/assets/index-D7zRUNKG-2cwkh8qP.js +0 -1
  149. package/build/assets/index-D8RPh1xj-BLIXkU4c.js +0 -1
  150. package/build/assets/index-DNE2UpRK-CMtd92Tg.js +0 -1
  151. package/build/assets/index-D_5mY4iN-C3O2lE89.js +0 -1
  152. package/build/assets/index-DnTjZ9IR.css +0 -1
  153. package/build/assets/index-Do4wh7Iw-cPdQGRDQ.js +0 -1
  154. package/build/assets/index-DwedDN1c-C-Y3cCQP.js +0 -1
  155. package/build/assets/index-Fvxtopfe-CxLnCat0.js +0 -1
  156. package/build/assets/index-G4vqu33f-DO7BfNY6.js +0 -1
  157. package/build/assets/index-KWOwopwF-CN_5PcLU.js +0 -2
  158. package/build/assets/index-NPM6VaN3-C-0cbqN2.js +0 -3
  159. package/build/assets/index-Q4xI4OhR-D81jje-l.js +0 -1
  160. package/build/assets/index-R1QyBsfg-tcyjJ4fb.js +0 -1
  161. package/build/assets/index-YOustUZZ-CX09XTf8.js +0 -2
  162. package/build/assets/index-b6W2ubHd-BapgUWLx.js +0 -1
  163. package/build/assets/index-h-ZgFEXT-DdL6EMUv.js +0 -2
  164. package/build/assets/index-lGTf3abu-B6CGTEed.js +0 -1
  165. package/build/assets/index-nXfHwIms-cOwCevci.js +0 -198
  166. package/build/assets/index-tU7dWFCN-DURbp79P.js +0 -1
  167. package/build/assets/inherits-Byw8NQvD-DdaLbWVP.js +0 -1
  168. package/build/assets/number-overlay-editor-BQ0qCmxT-5g_cUv4i.js +0 -9
  169. package/build/assets/record-DJsfODTt-CK8X1liM.js +0 -1
  170. package/build/assets/slicedToArray-CrkrjOeW-7_omneg6.js +0 -2
  171. package/build/assets/sprintf-D5E86llw-6tzWM3a-.js +0 -1
  172. package/build/assets/styled-components-DkuYntx5-DrGZZlKf.js +0 -1
  173. package/build/assets/toConsumableArray-BpgQ3N5A-AHKfFeLf.js +0 -2
  174. package/build/assets/uniqueId-BrCTHDA7-CGglDaT_.js +0 -1
  175. package/build/assets/unsupportedIterableToArray-CFN3yOc2-C4SckrTc.js +0 -1
  176. package/build/assets/useBasicWidgetState-CzHHKP20-CGMCneWD.js +0 -1
  177. package/build/assets/useTextInputAutoExpand-BMCOrWKx-DmoV3o2_.js +0 -2
  178. package/build/assets/useWaveformController-DuJh2iwj-BQGl9KsR.js +0 -1
  179. package/build/assets/wavesurfer.esm-CzjpjtNs-CtBzisOM.js +0 -74
  180. package/build/assets/withCalculatedWidth-C0lBnc3E-BAFtxM9t.js +0 -1
  181. package/build/assets/withFullScreenWrapper-wajYPLRg-e8FnO2xN.js +0 -1
  182. package/wheels/streamlit-1.52.2-cp313-none-any.whl +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/downloader-DcCTL3Wz-Dj-02g6N.js","assets/index-Bdi0ug4X.js","assets/index-DnTjZ9IR.css","assets/sandbox-ChAzL-i--CSnZJIg8.js","assets/memory-B3L1Fctl-mli5o0A1.js"])))=>i.map(i=>d[i]);
2
- import{bH as b}from"./index-Bdi0ug4X.js";const k=globalThis.showDirectoryPicker;async function j(i={}){if(k&&!i._preferPolyfill)return k(i);const e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0,e.style.position="fixed",e.style.top="-100000px",e.style.left="-100000px",document.body.appendChild(e);const t=Promise.resolve().then(()=>A);return await new Promise(r=>{e.addEventListener("change",r),e.click()}),t.then(r=>r.getDirHandlesFromInput(e))}const N={accepts:[]},x=globalThis.showOpenFilePicker;async function L(i={}){const e={...N,...i};if(x&&!i._preferPolyfill)return x(e);const t=document.createElement("input");t.type="file",t.multiple=e.multiple,t.accept=(e.accepts||[]).map(n=>[...(n.extensions||[]).map(s=>"."+s),...n.mimeTypes||[]]).flat().join(","),Object.assign(t.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(t);const r=Promise.resolve().then(()=>A);return await new Promise(n=>{t.addEventListener("change",n,{once:!0}),t.click()}),t.remove(),r.then(n=>n.getFileHandlesFromInput(t))}const I=globalThis.showSaveFilePicker;async function W(i={}){if(I&&!i._preferPolyfill)return I(i);i._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),i.suggestedName=i._name);const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h),{FileHandle:t}=await b(async()=>{const{FileHandle:r}=await import("./downloader-DcCTL3Wz-Dj-02g6N.js");return{FileHandle:r}},__vite__mapDeps([0,1,2]));return new e(new t(i.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const i=this.webkitGetAsEntry(),[{FileHandle:e,FolderHandle:t},{FileSystemDirectoryHandle:r},{FileSystemFileHandle:n}]=await Promise.all([b(()=>import("./sandbox-ChAzL-i--CSnZJIg8.js"),__vite__mapDeps([3,1,2])),Promise.resolve().then(()=>_),Promise.resolve().then(()=>h)]);return i.isFile?new n(new e(i,!1)):new r(new t(i,!1))});async function R(i,e={}){if(!i)return globalThis.navigator?.storage?.getDirectory()||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:t}=await Promise.resolve().then(()=>_),r=await i,n=await(r.default?r.default(e):r(e));return new t(n)}const q={WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:z}=q;class m extends z{#e;constructor(e){super(e),this.#e=e,Object.setPrototypeOf(this,m.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),t=e.close();return e.releaseLock(),t}seek(e){return this.write({type:"seek",position:e})}truncate(e){return this.write({type:"truncate",size:e})}write(e){if(this._closed)return Promise.reject(new TypeError("Cannot write to a CLOSED writable stream"));const t=this.getWriter(),r=t.write(e);return t.releaseLock(),r}}Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"FileSystemWritableFileStream",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(m.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}});globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=m);const y=Symbol("adapter");class T{[y];name;kind;constructor(e){this.kind=e.kind,this.name=e.name,this[y]=e}async queryPermission(e={}){const{mode:t="read"}=e,r=this[y];if(r.queryPermission)return r.queryPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return r.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async requestPermission({mode:e="read"}={}){const t=this[y];if(t.requestPermission)return t.requestPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return t.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async remove(e={}){await this[y].remove(e)}async isSameEntry(e){return this===e?!0:!e||typeof e!="object"||this.kind!==e.kind||!e[y]?!1:this[y].isSameEntry(e[y])}}Object.defineProperty(T.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});globalThis.FileSystemHandle&&(globalThis.FileSystemHandle.prototype.queryPermission??=function(i){return"granted"});const O={INVALID:["seeking position failed.","InvalidStateError"],GONE:["A requested file or directory could not be found at the time an operation was processed.","NotFoundError"],MISMATCH:["The path supplied exists, but was not an entry of requested type.","TypeMismatchError"],MOD_ERR:["The object can not be modified in this way.","InvalidModificationError"],SYNTAX:i=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${i}`,"SyntaxError"],SECURITY:["It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.","SecurityError"],DISALLOWED:["The request is not allowed by the user agent or the platform in the current context.","NotAllowedError"]},U={writable:globalThis.WritableStream};async function V(i){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[e,t,r]=await Promise.all([b(()=>import("./memory-B3L1Fctl-mli5o0A1.js"),__vite__mapDeps([4,1,2])),b(()=>import("./sandbox-ChAzL-i--CSnZJIg8.js"),__vite__mapDeps([3,1,2])),Promise.resolve().then(()=>_)]),n=new e.FolderHandle("",!1);return n._entries=i.map(s=>s.isFile?new t.FileHandle(s,!1):new t.FolderHandle(s,!1)),new r.FileSystemDirectoryHandle(n)}async function B(i){const{FolderHandle:e,FileHandle:t}=await b(async()=>{const{FolderHandle:c,FileHandle:o}=await import("./memory-B3L1Fctl-mli5o0A1.js");return{FolderHandle:c,FileHandle:o}},__vite__mapDeps([4,1,2])),{FileSystemDirectoryHandle:r}=await Promise.resolve().then(()=>_),n=Array.from(i.files),s=n[0].webkitRelativePath.split("/",1)[0],l=new e(s,!1);return n.forEach(c=>{const o=c.webkitRelativePath.split("/");o.shift();const d=o.pop(),p=o.reduce((f,w)=>(f._entries[w]||(f._entries[w]=new e(w,!1)),f._entries[w]),l);p._entries[d]=new t(c.name,c,!1)}),new r(l)}async function C(i){const{FileHandle:e}=await b(async()=>{const{FileHandle:r}=await import("./memory-B3L1Fctl-mli5o0A1.js");return{FileHandle:r}},__vite__mapDeps([4,1,2])),{FileSystemFileHandle:t}=await Promise.resolve().then(()=>h);return Array.from(i.files).map(r=>new t(new e(r.name,r,!1)))}const A=Object.freeze(Object.defineProperty({__proto__:null,config:U,errors:O,fromDataTransfer:V,getDirHandlesFromInput:B,getFileHandlesFromInput:C},Symbol.toStringTag,{value:"Module"})),{GONE:G,MOD_ERR:$}=O,u=Symbol("adapter");let S=class v extends T{[u];constructor(e){super(e),this[u]=e}async getDirectoryHandle(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const r=await this[u].getDirectoryHandle(e,t);return new v(r)}async*entries(){const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h);for await(const[t,r]of this[u].entries())yield[r.name,r.kind==="file"?new e(r):new v(r)]}async*getEntries(){const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h);console.warn("deprecated, use .entries() instead");for await(let t of this[u].entries())yield t.kind==="file"?new e(t):new v(t)}async getFileHandle(e,t={}){const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>h);if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const n=await this[u].getFileHandle(e,t);return new r(n)}async removeEntry(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");return t.recursive=!!t.recursive,this[u].removeEntry(e,t)}async resolve(e){if(await e.isSameEntry(this))return[];const t=[{handle:this,path:[]}];for(;t.length;){let{handle:r,path:n}=t.pop();for await(const s of r.values()){if(await s.isSameEntry(e))return[...n,s.name];s.kind==="directory"&&t.push({handle:s,path:[...n,s.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,t]of this)yield t}[Symbol.asyncIterator](){return this.entries()}};Object.defineProperty(S.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(S.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const i=globalThis.FileSystemDirectoryHandle.prototype;i.resolve=async function(n){if(await n.isSameEntry(this))return[];const s=[{handle:this,path:[]}];for(;s.length;){let{handle:l,path:c}=s.pop();for await(const o of l.values()){if(await o.isSameEntry(n))return[...c,o.name];o.kind==="directory"&&s.push({handle:o,path:[...c,o.name]})}}return null};async function e(n){if(await(await navigator.storage.getDirectory()).resolve(n)===null)throw new DOMException(...G)}const t=i.entries;i.entries=async function*(){await e(this),yield*t.call(this)},i[Symbol.asyncIterator]=async function*(){yield*this.entries()};const r=i.removeEntry;i.removeEntry=async function(n,s={}){return r.call(this,n,s).catch(async l=>{throw l instanceof DOMException&&l.name==="UnknownError"&&!s.recursive&&!(await t.call(this).next()).done?new DOMException(...$):l})}}const _=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:S,default:S},Symbol.toStringTag,{value:"Module"})),{INVALID:Y,SYNTAX:D,GONE:X}=O,H=Symbol("adapter");class E extends T{[H];constructor(e){super(e),this[H]=e}async createWritable(e={}){return new m(await this[H].createWritable(e))}async getFile(){return this[H].getFile()}}Object.defineProperty(E.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(E.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const i=new WeakMap;let e;const t=()=>{let n,s;onmessage=async l=>{const c=l.ports[0],o=l.data;switch(o.type){case"open":const d=o.name;let p=await navigator.storage.getDirectory();for(const f of o.path)p=await p.getDirectoryHandle(f);n=await p.getFileHandle(d),s=await n.createSyncAccessHandle();break;case"write":s.write(o.data,{at:o.position}),s.flush();break;case"truncate":s.truncate(o.size);break;case"abort":case"close":s.close();break}c.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(n){if(!e){const a=`(${t.toString()})()`,g=new Blob([a],{type:"text/javascript"});e=URL.createObjectURL(g)}const s=new Worker(e,{type:"module"});let l=0;const c=new TextEncoder;let o=await this.getFile().then(a=>a.size);const d=a=>new Promise((g,M)=>{const F=new MessageChannel;F.port1.onmessage=P=>{P.data instanceof Error?M(P.data):g(P.data),F.port1.close(),F.port2.close(),F.port1.onmessage=null},s.postMessage(a,[F.port2])}),p=await navigator.storage.getDirectory(),f=await i.get(this),w=await p.resolve(f);if(w===null)throw new DOMException(...X);return await d({type:"open",path:w,name:this.name}),n?.keepExistingData===!1&&(await d({type:"truncate",size:0}),o=0),new m({start:a=>{},async write(a){if(a?.constructor===Object?a={...a}:a={type:"write",data:a,position:l},a.type==="write"){if(!("data"in a))throw await d({type:"close"}),new DOMException(...D("write requires a data argument"));if(a.position??=l,typeof a.data=="string")a.data=c.encode(a.data);else if(a.data instanceof ArrayBuffer)a.data=new Uint8Array(a.data);else if(!(a.data instanceof Uint8Array)&&ArrayBuffer.isView(a.data))a.data=new Uint8Array(a.data.buffer,a.data.byteOffset,a.data.byteLength);else if(!(a.data instanceof Uint8Array)){const g=await new Response(a.data).arrayBuffer();a.data=new Uint8Array(g)}Number.isInteger(a.position)&&a.position>=0&&(l=a.position),l+=a.data.byteLength,o+=a.data.byteLength}else if(a.type==="seek")if(Number.isInteger(a.position)&&a.position>=0){if(o<a.position)throw new DOMException(...Y);console.log("seeking",a),l=a.position;return}else throw await d({type:"close"}),new DOMException(...D("seek requires a position argument"));else if(a.type==="truncate")if(Number.isInteger(a.size)&&a.size>=0)o=a.size,l>o&&(l=o);else throw await d({type:"close"}),new DOMException(...D("truncate requires a size argument"));await d(a)},async close(){await d({type:"close"}),s.terminate()},async abort(a){await d({type:"abort",reason:a}),s.terminate()}})};const r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...n){const s=await r.call(this,...n);return i.set(s,this),s}}const h=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:E,default:E},Symbol.toStringTag,{value:"Module"})),K=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:S,FileSystemFileHandle:E,FileSystemHandle:T,FileSystemWritableFileStream:m,getOriginPrivateDirectory:R,showDirectoryPicker:j,showOpenFilePicker:L,showSaveFilePicker:W},Symbol.toStringTag,{value:"Module"}));export{K as a,q as c,O as e};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/downloader-DcCTL3Wz-BV_PV8FK.js","assets/index-DegoUuPm.js","assets/index-rCmWIVzf.css","assets/sandbox-ChAzL-i--BIq4nttm.js","assets/memory-B3L1Fctl-Cn5y4VWL.js"])))=>i.map(i=>d[i]);
2
+ import{bG as b}from"./index-DegoUuPm.js";const k=globalThis.showDirectoryPicker;async function j(i={}){if(k&&!i._preferPolyfill)return k(i);const e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0,e.style.position="fixed",e.style.top="-100000px",e.style.left="-100000px",document.body.appendChild(e);const t=Promise.resolve().then(()=>A);return await new Promise(r=>{e.addEventListener("change",r),e.click()}),t.then(r=>r.getDirHandlesFromInput(e))}const N={accepts:[]},x=globalThis.showOpenFilePicker;async function L(i={}){const e={...N,...i};if(x&&!i._preferPolyfill)return x(e);const t=document.createElement("input");t.type="file",t.multiple=e.multiple,t.accept=(e.accepts||[]).map(n=>[...(n.extensions||[]).map(s=>"."+s),...n.mimeTypes||[]]).flat().join(","),Object.assign(t.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(t);const r=Promise.resolve().then(()=>A);return await new Promise(n=>{t.addEventListener("change",n,{once:!0}),t.click()}),t.remove(),r.then(n=>n.getFileHandlesFromInput(t))}const I=globalThis.showSaveFilePicker;async function W(i={}){if(I&&!i._preferPolyfill)return I(i);i._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),i.suggestedName=i._name);const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h),{FileHandle:t}=await b(async()=>{const{FileHandle:r}=await import("./downloader-DcCTL3Wz-BV_PV8FK.js");return{FileHandle:r}},__vite__mapDeps([0,1,2]));return new e(new t(i.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const i=this.webkitGetAsEntry(),[{FileHandle:e,FolderHandle:t},{FileSystemDirectoryHandle:r},{FileSystemFileHandle:n}]=await Promise.all([b(()=>import("./sandbox-ChAzL-i--BIq4nttm.js"),__vite__mapDeps([3,1,2])),Promise.resolve().then(()=>_),Promise.resolve().then(()=>h)]);return i.isFile?new n(new e(i,!1)):new r(new t(i,!1))});async function R(i,e={}){if(!i)return globalThis.navigator?.storage?.getDirectory()||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:t}=await Promise.resolve().then(()=>_),r=await i,n=await(r.default?r.default(e):r(e));return new t(n)}const q={WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:z}=q;class m extends z{#e;constructor(e){super(e),this.#e=e,Object.setPrototypeOf(this,m.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),t=e.close();return e.releaseLock(),t}seek(e){return this.write({type:"seek",position:e})}truncate(e){return this.write({type:"truncate",size:e})}write(e){if(this._closed)return Promise.reject(new TypeError("Cannot write to a CLOSED writable stream"));const t=this.getWriter(),r=t.write(e);return t.releaseLock(),r}}Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"FileSystemWritableFileStream",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(m.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}});globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=m);const y=Symbol("adapter");class T{[y];name;kind;constructor(e){this.kind=e.kind,this.name=e.name,this[y]=e}async queryPermission(e={}){const{mode:t="read"}=e,r=this[y];if(r.queryPermission)return r.queryPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return r.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async requestPermission({mode:e="read"}={}){const t=this[y];if(t.requestPermission)return t.requestPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return t.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async remove(e={}){await this[y].remove(e)}async isSameEntry(e){return this===e?!0:!e||typeof e!="object"||this.kind!==e.kind||!e[y]?!1:this[y].isSameEntry(e[y])}}Object.defineProperty(T.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});globalThis.FileSystemHandle&&(globalThis.FileSystemHandle.prototype.queryPermission??=function(i){return"granted"});const O={INVALID:["seeking position failed.","InvalidStateError"],GONE:["A requested file or directory could not be found at the time an operation was processed.","NotFoundError"],MISMATCH:["The path supplied exists, but was not an entry of requested type.","TypeMismatchError"],MOD_ERR:["The object can not be modified in this way.","InvalidModificationError"],SYNTAX:i=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${i}`,"SyntaxError"],SECURITY:["It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.","SecurityError"],DISALLOWED:["The request is not allowed by the user agent or the platform in the current context.","NotAllowedError"]},U={writable:globalThis.WritableStream};async function V(i){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[e,t,r]=await Promise.all([b(()=>import("./memory-B3L1Fctl-Cn5y4VWL.js"),__vite__mapDeps([4,1,2])),b(()=>import("./sandbox-ChAzL-i--BIq4nttm.js"),__vite__mapDeps([3,1,2])),Promise.resolve().then(()=>_)]),n=new e.FolderHandle("",!1);return n._entries=i.map(s=>s.isFile?new t.FileHandle(s,!1):new t.FolderHandle(s,!1)),new r.FileSystemDirectoryHandle(n)}async function B(i){const{FolderHandle:e,FileHandle:t}=await b(async()=>{const{FolderHandle:c,FileHandle:o}=await import("./memory-B3L1Fctl-Cn5y4VWL.js");return{FolderHandle:c,FileHandle:o}},__vite__mapDeps([4,1,2])),{FileSystemDirectoryHandle:r}=await Promise.resolve().then(()=>_),n=Array.from(i.files),s=n[0].webkitRelativePath.split("/",1)[0],l=new e(s,!1);return n.forEach(c=>{const o=c.webkitRelativePath.split("/");o.shift();const d=o.pop(),p=o.reduce((f,w)=>(f._entries[w]||(f._entries[w]=new e(w,!1)),f._entries[w]),l);p._entries[d]=new t(c.name,c,!1)}),new r(l)}async function C(i){const{FileHandle:e}=await b(async()=>{const{FileHandle:r}=await import("./memory-B3L1Fctl-Cn5y4VWL.js");return{FileHandle:r}},__vite__mapDeps([4,1,2])),{FileSystemFileHandle:t}=await Promise.resolve().then(()=>h);return Array.from(i.files).map(r=>new t(new e(r.name,r,!1)))}const A=Object.freeze(Object.defineProperty({__proto__:null,config:U,errors:O,fromDataTransfer:V,getDirHandlesFromInput:B,getFileHandlesFromInput:C},Symbol.toStringTag,{value:"Module"})),{GONE:G,MOD_ERR:$}=O,u=Symbol("adapter");let S=class H extends T{[u];constructor(e){super(e),this[u]=e}async getDirectoryHandle(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const r=await this[u].getDirectoryHandle(e,t);return new H(r)}async*entries(){const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h);for await(const[t,r]of this[u].entries())yield[r.name,r.kind==="file"?new e(r):new H(r)]}async*getEntries(){const{FileSystemFileHandle:e}=await Promise.resolve().then(()=>h);console.warn("deprecated, use .entries() instead");for await(let t of this[u].entries())yield t.kind==="file"?new e(t):new H(t)}async getFileHandle(e,t={}){const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>h);if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const n=await this[u].getFileHandle(e,t);return new r(n)}async removeEntry(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");return t.recursive=!!t.recursive,this[u].removeEntry(e,t)}async resolve(e){if(await e.isSameEntry(this))return[];const t=[{handle:this,path:[]}];for(;t.length;){let{handle:r,path:n}=t.pop();for await(const s of r.values()){if(await s.isSameEntry(e))return[...n,s.name];s.kind==="directory"&&t.push({handle:s,path:[...n,s.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,t]of this)yield t}[Symbol.asyncIterator](){return this.entries()}};Object.defineProperty(S.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(S.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const i=globalThis.FileSystemDirectoryHandle.prototype;i.resolve=async function(n){if(await n.isSameEntry(this))return[];const s=[{handle:this,path:[]}];for(;s.length;){let{handle:l,path:c}=s.pop();for await(const o of l.values()){if(await o.isSameEntry(n))return[...c,o.name];o.kind==="directory"&&s.push({handle:o,path:[...c,o.name]})}}return null};async function e(n){if(await(await navigator.storage.getDirectory()).resolve(n)===null)throw new DOMException(...G)}const t=i.entries;i.entries=async function*(){await e(this),yield*t.call(this)},i[Symbol.asyncIterator]=async function*(){yield*this.entries()};const r=i.removeEntry;i.removeEntry=async function(n,s={}){return r.call(this,n,s).catch(async l=>{throw l instanceof DOMException&&l.name==="UnknownError"&&!s.recursive&&!(await t.call(this).next()).done?new DOMException(...$):l})}}const _=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:S,default:S},Symbol.toStringTag,{value:"Module"})),{INVALID:Y,SYNTAX:D,GONE:X}=O,v=Symbol("adapter");class E extends T{[v];constructor(e){super(e),this[v]=e}async createWritable(e={}){return new m(await this[v].createWritable(e))}async getFile(){return this[v].getFile()}}Object.defineProperty(E.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(E.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const i=new WeakMap;let e;const t=()=>{let n,s;onmessage=async l=>{const c=l.ports[0],o=l.data;switch(o.type){case"open":const d=o.name;let p=await navigator.storage.getDirectory();for(const f of o.path)p=await p.getDirectoryHandle(f);n=await p.getFileHandle(d),s=await n.createSyncAccessHandle();break;case"write":s.write(o.data,{at:o.position}),s.flush();break;case"truncate":s.truncate(o.size);break;case"abort":case"close":s.close();break}c.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(n){if(!e){const a=`(${t.toString()})()`,g=new Blob([a],{type:"text/javascript"});e=URL.createObjectURL(g)}const s=new Worker(e,{type:"module"});let l=0;const c=new TextEncoder;let o=await this.getFile().then(a=>a.size);const d=a=>new Promise((g,M)=>{const F=new MessageChannel;F.port1.onmessage=P=>{P.data instanceof Error?M(P.data):g(P.data),F.port1.close(),F.port2.close(),F.port1.onmessage=null},s.postMessage(a,[F.port2])}),p=await navigator.storage.getDirectory(),f=await i.get(this),w=await p.resolve(f);if(w===null)throw new DOMException(...X);return await d({type:"open",path:w,name:this.name}),n?.keepExistingData===!1&&(await d({type:"truncate",size:0}),o=0),new m({start:a=>{},async write(a){if(a?.constructor===Object?a={...a}:a={type:"write",data:a,position:l},a.type==="write"){if(!("data"in a))throw await d({type:"close"}),new DOMException(...D("write requires a data argument"));if(a.position??=l,typeof a.data=="string")a.data=c.encode(a.data);else if(a.data instanceof ArrayBuffer)a.data=new Uint8Array(a.data);else if(!(a.data instanceof Uint8Array)&&ArrayBuffer.isView(a.data))a.data=new Uint8Array(a.data.buffer,a.data.byteOffset,a.data.byteLength);else if(!(a.data instanceof Uint8Array)){const g=await new Response(a.data).arrayBuffer();a.data=new Uint8Array(g)}Number.isInteger(a.position)&&a.position>=0&&(l=a.position),l+=a.data.byteLength,o+=a.data.byteLength}else if(a.type==="seek")if(Number.isInteger(a.position)&&a.position>=0){if(o<a.position)throw new DOMException(...Y);console.log("seeking",a),l=a.position;return}else throw await d({type:"close"}),new DOMException(...D("seek requires a position argument"));else if(a.type==="truncate")if(Number.isInteger(a.size)&&a.size>=0)o=a.size,l>o&&(l=o);else throw await d({type:"close"}),new DOMException(...D("truncate requires a size argument"));await d(a)},async close(){await d({type:"close"}),s.terminate()},async abort(a){await d({type:"abort",reason:a}),s.terminate()}})};const r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...n){const s=await r.call(this,...n);return i.set(s,this),s}}const h=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:E,default:E},Symbol.toStringTag,{value:"Module"})),K=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:S,FileSystemFileHandle:E,FileSystemHandle:T,FileSystemWritableFileStream:m,getOriginPrivateDirectory:R,showDirectoryPicker:j,showOpenFilePicker:L,showSaveFilePicker:W},Symbol.toStringTag,{value:"Module"}));export{K as a,q as c,O as e};
@@ -0,0 +1 @@
1
+ function m(t,e,a="datetime"){if(e==="localized"){const n=navigator.languages,i=a==="time"?void 0:"medium",o=a==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(n,{dateStyle:i,timeStyle:o}).format(t.toDate())}catch(r){if(r instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(t.toDate());throw r}}else{if(e==="distance")return t.fromNow();if(e==="calendar")return t.calendar();if(e==="iso8601")return a==="date"?t.format("YYYY-MM-DD"):a==="time"?t.format("HH:mm:ss.SSS[Z]"):t.toISOString()}return t.format(e)}export{m as s};
@@ -0,0 +1 @@
1
+ import{i as n}from"./numbro-CBbENDeu-C6X7Pww4.js";import{I as s}from"./sprintfjs-BB1ejNgh-D_XlFCD8.js";import{i as o,P as e}from"./index-DegoUuPm.js";function u(i){if(i===0||Math.abs(i)>=1e-4)return 4;const a=i.toExponential().split("e");return Math.abs(parseInt(a[1],10))}function r(i,a={}){const t=navigator.languages;try{return new Intl.NumberFormat(t,a).format(i)}catch(m){if(m instanceof RangeError)return new Intl.NumberFormat(void 0,a).format(i);throw m}}function y(i,a,t){return Number.isNaN(i)||!Number.isFinite(i)?"":o(a)||a===""?e(t)?(t===0&&(i=Math.round(i)),n(i).format({thousandSeparated:!1,mantissa:t,trimMantissa:!1})):n(i).format({thousandSeparated:!1,mantissa:u(i),trimMantissa:!0}):a==="plain"?n(i).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):a==="localized"?r(i,{minimumFractionDigits:t??void 0,maximumFractionDigits:t??void 0}):a==="percent"?r(i,{style:"percent",minimumFractionDigits:e(t)?Math.max(t-2,0):0,maximumFractionDigits:e(t)?Math.max(t-2,0):2}):a==="dollar"?r(i,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:t??2,maximumFractionDigits:t??2}):a==="euro"?r(i,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:t??2,maximumFractionDigits:t??2}):a==="yen"?r(i,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:t??0,maximumFractionDigits:t??0}):["compact","scientific","engineering"].includes(a)?r(i,{notation:a}):a==="accounting"?n(i).format({thousandSeparated:!0,negative:"parenthesis",mantissa:t??2,trimMantissa:!1}):a==="bytes"?r(i,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):s(a,i)}function p(i){if(i.trim()==="")return!1;const a=Number(i);return!Number.isNaN(a)&&Number.isFinite(a)}export{y as p,p as y};
@@ -0,0 +1 @@
1
+ import{bT as t}from"./index-DegoUuPm.js";const i={[t.ButtonLikeIconPosition.LEFT]:"left",[t.ButtonLikeIconPosition.RIGHT]:"right"};function e(o){return i[o??t.ButtonLikeIconPosition.LEFT]}export{e as s};
@@ -0,0 +1 @@
1
+ import{aa as it}from"./index-DegoUuPm.js";function rt(z,u){for(var p=0;p<u.length;p++){const S=u[p];if(typeof S!="string"&&!Array.isArray(S)){for(const O in S)if(O!=="default"&&!(O in z)){const M=Object.getOwnPropertyDescriptor(S,O);M&&Object.defineProperty(z,O,M.get?M:{enumerable:!0,get:()=>S[O]})}}}return Object.freeze(Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}))}var ke={exports:{}},Le;function at(){return Le||(Le=1,(function(z){(function(u){if(typeof window>"u")return;var p=!0,S=10,O="",M=0,j="",J=null,ie="",D=!1,Pe={resize:1,click:1},U=128,re=!0,R=1,_="bodyOffset",h=_,ae=!0,ce="",k={},I=32,ue=null,V=!1,X=!1,q="[iFrameSizer]",se=q.length,H="",le={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",fe=window.parent,L="*",K=0,W=!1,de=null,F=16,P=1,me="scroll",v=me,je=window,Q=function(){T("onMessage function not defined")},G=function(){},Z=function(){},$={height:function(){return T("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return T("Custom width calculation function not defined"),document.body.scrollWidth}},ee={},ge=!1;function he(){}try{var pe=Object.create({},{passive:{get:function(){ge=!0}}});window.addEventListener("test",he,pe),window.removeEventListener("test",he,pe)}catch{}function C(e,t,n,o){e.addEventListener(t,n,ge?o||{}:!1)}function De(e,t,n){e.removeEventListener(t,n,!1)}function ve(e){return e.charAt(0).toUpperCase()+e.slice(1)}function qe(e){var t,n,o,a=null,l=0,m=function(){l=Date.now(),a=null,o=e.apply(t,n),a||(t=n=null)};return function(){var d=Date.now();l||(l=d);var c=F-(d-l);return t=this,n=arguments,c<=0||c>F?(a&&(clearTimeout(a),a=null),l=d,o=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,c)),o}}function ye(e){return q+"["+H+"] "+e}function i(e){V&&typeof window.console=="object"&&console.log(ye(e))}function T(e){typeof window.console=="object"&&console.warn(ye(e))}function He(){We(),i("Initialising iFrame ("+window.location.href+")"),Je(),_e(),te("background",O),te("padding",ie),Ke(),Te(),Ee(),Ve(),Ze(),Ge(),Oe(),k=Qe(),A("init","Init message from host page"),G()}function We(){function e(n){return n==="true"}var t=ce.slice(se).split(":");H=t[0],M=u===t[1]?M:Number(t[1]),D=u===t[2]?D:e(t[2]),V=u===t[3]?V:e(t[3]),I=u===t[4]?I:Number(t[4]),p=u===t[6]?p:e(t[6]),j=t[7],h=u===t[8]?h:t[8],O=t[9],ie=t[10],K=u===t[11]?K:Number(t[11]),k.enable=u===t[12]?!1:e(t[12]),Y=u===t[13]?Y:t[13],v=u===t[14]?v:t[14],X=u===t[15]?X:e(t[15])}function Be(e){var t=e.split("Callback");if(t.length===2){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],T("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function Je(){function e(){var n=window.iFrameResizer;i("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(Be,n),Q="onMessage"in n?n.onMessage:Q,G="onReady"in n?n.onReady:G,L="targetOrigin"in n?n.targetOrigin:L,h="heightCalculationMethod"in n?n.heightCalculationMethod:h,v="widthCalculationMethod"in n?n.widthCalculationMethod:v}function t(n,o){return typeof n=="function"&&(i("Setup custom "+o+"CalcMethod"),$[o]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),h=t(h,"height"),v=t(v,"width")),i("TargetOrigin for parent set to: "+L)}function Ue(e,t){return t.indexOf("-")!==-1&&(T("Negative CSS value ignored for "+e),t=""),t}function te(e,t){u!==t&&t!==""&&t!=="null"&&(document.body.style[e]=t,i("Body "+e+' set to "'+t+'"'))}function _e(){u===j&&(j=M+"px"),te("margin",Ue("margin",j))}function Ve(){document.documentElement.style.height="",document.body.style.height="",i('HTML & body height set to "auto"')}function g(e){var t={add:function(n){function o(){A(e.eventName,e.eventType)}ee[n]=o,C(window,n,o,{passive:!0})},remove:function(n){var o=ee[n];delete ee[n],De(window,n,o)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),i(ve(e.method)+" event listener: "+e.eventType)}function we(e){g({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),g({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),g({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),g({method:e,eventType:"Input",eventName:"input"}),g({method:e,eventType:"Mouse Up",eventName:"mouseup"}),g({method:e,eventType:"Mouse Down",eventName:"mousedown"}),g({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),g({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),g({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),g({method:e,eventType:"Touch Start",eventName:"touchstart"}),g({method:e,eventType:"Touch End",eventName:"touchend"}),g({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),g({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),g({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),g({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),Y==="child"&&g({method:e,eventType:"IFrame Resized",eventName:"resize"})}function be(e,t,n,o){return t!==e&&(e in n||(T(e+" is not a valid option for "+o+"CalculationMethod."),e=t),i(o+' calculation method set to "'+e+'"')),e}function Te(){h=be(h,_,E,"height")}function Ee(){v=be(v,me,N,"width")}function Oe(){p===!0?(we("add"),et()):i("Auto Resize disabled")}function Xe(){J!==null&&J.disconnect()}function Ye(){we("remove"),Xe(),clearInterval(ue)}function Ke(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Qe(){function e(){return{x:window.pageXOffset===u?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===u?document.documentElement.scrollTop:window.pageYOffset}}function t(c){var s=c.getBoundingClientRect(),f=e();return{x:parseInt(s.left,10)+parseInt(f.x,10),y:parseInt(s.top,10)+parseInt(f.y,10)}}function n(c){function s(b){var x=t(b);i("Moving to in page link (#"+f+") at x: "+x.x+" y: "+x.y),y(x.y,x.x,"scrollToOffset")}var f=c.split("#")[1]||c,r=decodeURIComponent(f),w=document.getElementById(r)||document.getElementsByName(r)[0];u===w?(i("In page link (#"+f+") not found in iFrame, so sending to parent"),y(0,0,"inPageLink","#"+f)):s(w)}function o(){var c=window.location.hash,s=window.location.href;c!==""&&c!=="#"&&n(s)}function a(){function c(s){function f(r){r.preventDefault(),n(this.getAttribute("href"))}s.getAttribute("href")!=="#"&&C(s,"click",f)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),c)}function l(){C(window,"hashchange",o)}function m(){setTimeout(o,U)}function d(){Array.prototype.forEach&&document.querySelectorAll?(i("Setting up location.hash handlers"),a(),l(),m()):T("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?d():i("In page linking not enabled"),{findTarget:n}}function Ge(){if(X!==!0)return;function e(n){y(0,0,n.type,n.screenY+":"+n.screenX)}function t(n,o){i("Add event listener: "+o),C(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ze(){i("Enable public methods"),je.parentIFrame={autoResize:function(e){return e===!0&&p===!1?(p=!0,Oe()):e===!1&&p===!0&&(p=!1,Ye()),y(0,0,"autoResize",JSON.stringify(p)),p},close:function(){y(0,0,"close")},getId:function(){return H},getPageInfo:function(e){typeof e=="function"?(Z=e,y(0,0,"pageInfo")):(Z=function(){},y(0,0,"pageInfoStop"))},moveToAnchor:function(e){k.findTarget(e)},reset:function(){xe("parentIFrame.reset")},scrollTo:function(e,t){y(t,e,"scrollTo")},scrollToOffset:function(e,t){y(t,e,"scrollToOffset")},sendMessage:function(e,t){y(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){h=e,Te()},setWidthCalculationMethod:function(e){v=e,Ee()},setTargetOrigin:function(e){i("Set targetOrigin: "+e),L=e},size:function(e,t){var n=""+(e||"")+(t?","+t:"");A("size","parentIFrame.size("+n+")",e,t)}}}function Se(){I!==0&&(i("setInterval: "+I+"ms"),ue=setInterval(function(){A("interval","setInterval: "+I)},Math.abs(I)))}function $e(){function e(r){function w(b){b.complete===!1&&(i("Attach listeners to "+b.src),b.addEventListener("load",a,!1),b.addEventListener("error",l,!1),c.push(b))}r.type==="attributes"&&r.attributeName==="src"?w(r.target):r.type==="childList"&&Array.prototype.forEach.call(r.target.querySelectorAll("img"),w)}function t(r){c.splice(c.indexOf(r),1)}function n(r){i("Remove listeners from "+r.src),r.removeEventListener("load",a,!1),r.removeEventListener("error",l,!1),t(r)}function o(r,w,b){n(r.target),A(w,b+": "+r.target.src)}function a(r){o(r,"imageLoad","Image loaded")}function l(r){o(r,"imageLoadFailed","Image load failed")}function m(r){A("mutationObserver","mutationObserver: "+r[0].target+" "+r[0].type),r.forEach(e)}function d(){var r=document.querySelector("body"),w={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};return f=new s(m),i("Create body MutationObserver"),f.observe(r,w),f}var c=[],s=window.MutationObserver||window.WebKitMutationObserver,f=d();return{disconnect:function(){"disconnect"in f&&(i("Disconnect body MutationObserver"),f.disconnect(),c.forEach(n))}}}function et(){var e=0>I;window.MutationObserver||window.WebKitMutationObserver?e?Se():J=$e():(i("MutationObserver not supported in this browser!"),Se())}function ne(e,t){var n=0;return t=t||document.body,n=document.defaultView.getComputedStyle(t,null),n=n===null?0:n[e],parseInt(n,S)}function tt(e){e>F/2&&(F=2*e,i("Event throttle increased to "+F+"ms"))}function oe(e,t){for(var n=t.length,o=0,a=0,l=ve(e),m=Date.now(),d=0;d<n;d++)o=t[d].getBoundingClientRect()[e]+ne("margin"+l,t[d]),o>a&&(a=o);return m=Date.now()-m,i("Parsed "+n+" HTML elements"),i("Element position calculated in "+m+"ms"),tt(m),a}function B(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Me(e,t){function n(){return T("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var o=document.querySelectorAll("["+t+"]");return o.length===0&&n(),oe(e,o)}function Ie(){return document.querySelectorAll("body *")}var E={bodyOffset:function(){return document.body.offsetHeight+ne("marginTop")+ne("marginBottom")},offset:function(){return E.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return $.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,B(E))},min:function(){return Math.min.apply(null,B(E))},grow:function(){return E.max()},lowestElement:function(){return Math.max(E.bodyOffset()||E.documentElementOffset(),oe("bottom",Ie()))},taggedElement:function(){return Me("bottom","data-iframe-height")}},N={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return $.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(N.bodyScroll(),N.documentElementScroll())},max:function(){return Math.max.apply(null,B(N))},min:function(){return Math.min.apply(null,B(N))},rightMostElement:function(){return oe("right",Ie())},taggedElement:function(){return Me("right","data-iframe-width")}};function Ne(e,t,n,o){function a(){R=f,P=r,y(R,P,e)}function l(){function w(b,x){var ot=Math.abs(b-x)<=K;return!ot}return f=u===n?E[h]():n,r=u===o?N[v]():o,w(R,f)||D&&w(P,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in le||D&&v in le}function c(){i("No change in size detected")}function s(){m()&&d()?xe(t):e in{interval:1}||c()}var f,r;l()||e==="init"?(Ae(),a()):s()}var nt=qe(Ne);function A(e,t,n,o){function a(){e in{reset:1,resetPage:1,init:1}||i("Trigger event: "+t)}function l(){return W&&e in Pe}l()?i("Trigger event cancelled: "+e):(a(),e==="init"?Ne(e,t,n,o):nt(e,t,n,o))}function Ae(){W||(W=!0,i("Trigger event lock on")),clearTimeout(de),de=setTimeout(function(){W=!1,i("Trigger event lock off"),i("--")},U)}function Ce(e){R=E[h](),P=N[v](),y(R,P,e)}function xe(e){var t=h;h=_,i("Reset trigger event: "+e),Ae(),Ce("reset"),h=t}function y(e,t,n,o,a){function l(){u===a?a=L:i("Message targetOrigin: "+a)}function m(){var d=e+":"+t,c=H+":"+d+":"+n+(u===o?"":":"+o);i("Sending message to host page ("+c+")"),fe.postMessage(q+c,a)}l(),m()}function ze(e){var t={init:function(){ce=e.data,fe=e.source,He(),re=!1,setTimeout(function(){ae=!1},U)},reset:function(){ae?i("Page reset ignored by init"):(i("Page size reset by host page"),Ce("resetPage"))},resize:function(){A("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var s=a();i("PageInfoFromParent called from parent: "+s),Z(JSON.parse(s)),i(" --")},message:function(){var s=a();i("onMessage called from parent: "+s),Q(JSON.parse(s)),i(" --")}};function n(){return q===(""+e.data).slice(0,se)}function o(){return e.data.split("]")[1].split(":")[0]}function a(){return e.data.slice(e.data.indexOf(":")+1)}function l(){return!z.exports&&"iFrameResize"in window||window.jQuery!==u&&"iFrameResize"in window.jQuery.prototype}function m(){return e.data.split(":")[2]in{true:1,false:1}}function d(){var s=o();s in t?t[s]():!l()&&!m()&&T("Unexpected message ("+e.data+")")}function c(){re===!1?d():m()?t.init():i('Ignored message of type "'+o()+'". Received before initialization.')}n()&&c()}function Re(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){ze({data:e})},C(window,"message",ze),C(window,"readystatechange",Re),Re())})()})(ke)),ke.exports}var Fe=at();const ct=it(Fe),st=rt({__proto__:null,default:ct},[Fe]);export{st as i};
@@ -0,0 +1 @@
1
+ import{r as u,H as j,j as c,x as h,aj as C,cp as s}from"./index-DegoUuPm.js";import{U as A}from"./useBasicWidgetState-JbPrIror-Bu87DmaN.js";import"./FormClearHelper-CbmTijuR-BhfBTvx4.js";const R=h("div",{target:"e1b8h3j92"})(({containerWidth:e})=>({width:e?"100%":"auto",minWidth:"fit-content"}),""),W=h("div",{target:"e1b8h3j91"})(({theme:e})=>({display:"flex",flexWrap:"nowrap",gap:e.spacing.threeXS,minWidth:"fit-content"}),""),_=h("button",{target:"e1b8h3j90"})(({theme:e,isSelected:t})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",padding:e.spacing.threeXS,margin:e.spacing.none,backgroundColor:e.colors.transparent,color:t?e.colors.bodyText:e.colors.fadedText60,border:"none",borderRadius:e.radii.button,cursor:"pointer",userSelect:"none",minHeight:"unset",flex:"0 0 fit-content","&:focus":{boxShadow:"none",outline:"none"},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover:not(:disabled)":{color:e.colors.bodyText},"&:disabled":{color:t?e.colors.fadedText40:e.colors.fadedText10,cursor:"not-allowed",img:{opacity:.4}}}),""),f=[":material/thumb_up:",":material/thumb_down:"],D=[":material/sentiment_sad:",":material/sentiment_dissatisfied:",":material/sentiment_neutral:",":material/sentiment_satisfied:",":material/sentiment_very_satisfied:"],U=":material/star:",M=":material/star_filled:",y=5;function V(e){switch(e){case s.FeedbackType.FACES:return D.map((t,a)=>({icon:t,selectedIcon:t,value:a}));case s.FeedbackType.STARS:return Array.from({length:y},(t,a)=>({icon:U,selectedIcon:M,value:a}));default:return[{icon:f[0],selectedIcon:f[0],value:1},{icon:f[1],selectedIcon:f[1],value:0}]}}function $(e,t){switch(t){case s.FeedbackType.THUMBS:return e===1?"Thumbs up":"Thumbs down";case s.FeedbackType.FACES:return["Very dissatisfied","Dissatisfied","Neutral","Satisfied","Very satisfied"][e]??`Rating ${e+1}`;case s.FeedbackType.STARS:return`${e+1} out of ${y} stars`;default:return`Rating ${e+1}`}}function B(e,t,a){return t===null?!1:a===s.FeedbackType.STARS?e<=t:e===t}function E(e,t){const a=e.getStringValue(t);if(a!==void 0)return a===""?null:parseInt(a,10)}function H(e){return e.default??null}function N(e){return e.value??null}function X(e,t,a,m){const g=a.value===null?"":String(a.value);t.setStringValue(e,g,{fromUi:a.fromUi},m)}function z(e){const{disabled:t,element:a,fragmentId:m,widgetMgr:g,widthConfig:x}=e,{type:d}=a,[k,v]=A({getStateFromWidgetMgr:E,getDefaultStateFromProto:H,getCurrStateFromProto:N,updateWidgetMgrState:X,element:a,widgetMgr:g,fragmentId:m,formClearBehavior:"resetValueOnly"}),o=a.value??k,w=j(x),l=u.useMemo(()=>V(d),[d]),S=u.useRef([]),b=u.useCallback(r=>{v({value:o===r?null:r,fromUi:!0})},[o,v]),F=u.useCallback((r,n)=>{let i;switch(r.key){case"ArrowLeft":case"ArrowUp":r.preventDefault(),i=n>0?n-1:l.length-1;break;case"ArrowRight":case"ArrowDown":r.preventDefault(),i=n<l.length-1?n+1:0;break;case" ":case"Enter":r.preventDefault(),b(l[n].value);return;default:return}S.current[i]?.focus()},[l,b]);return c.jsx(R,{className:"stFeedback","data-testid":"stFeedback",containerWidth:w,children:c.jsx(W,{role:"radiogroup","aria-label":"Feedback rating",children:l.map((r,n)=>{const i=B(r.value,o,d),T=i?r.selectedIcon:r.icon;return c.jsx(_,{ref:p=>{S.current[n]=p},type:"button",role:"radio","aria-checked":o===r.value,"aria-label":$(r.value,d),tabIndex:o===r.value||o===null&&n===0?0:-1,disabled:t,isSelected:i,onClick:()=>b(r.value),onKeyDown:p=>F(p,n),"data-testid":i?"stFeedbackButtonActive":"stFeedbackButton",children:c.jsx(C,{iconValue:T,size:"lg"})},r.value)})})})}const P=u.memo(z);export{P as default};
@@ -0,0 +1,2 @@
1
+ import{r as k,j as ee,x as $t}from"./index-DegoUuPm.js";const{entries:At,setPrototypeOf:mt,isFrozen:Vt,getPrototypeOf:Zt,getOwnPropertyDescriptor:Jt}=Object;let{freeze:E,seal:S,create:pe}=Object,{apply:He,construct:ze}=typeof Reflect<"u"&&Reflect;E||(E=function(r){return r});S||(S=function(r){return r});He||(He=function(r,o){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return r.apply(o,a)});ze||(ze=function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return new r(...i)});const me=_(Array.prototype.forEach),Qt=_(Array.prototype.lastIndexOf),ft=_(Array.prototype.pop),$=_(Array.prototype.push),en=_(Array.prototype.splice),de=_(String.prototype.toLowerCase),Oe=_(String.prototype.toString),ke=_(String.prototype.match),V=_(String.prototype.replace),tn=_(String.prototype.indexOf),nn=_(String.prototype.trim),N=_(Object.prototype.hasOwnProperty),A=_(RegExp.prototype.test),Z=rn(TypeError);function _(r){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var i=arguments.length,a=new Array(i>1?i-1:0),c=1;c<i;c++)a[c-1]=arguments[c];return He(r,o,a)}}function rn(r){return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return ze(r,i)}}function l(r,o){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de;mt&&mt(r,null);let a=o.length;for(;a--;){let c=o[a];if(typeof c=="string"){const b=i(c);b!==c&&(Vt(o)||(o[a]=b),c=b)}r[c]=!0}return r}function on(r){for(let o=0;o<r.length;o++)N(r,o)||(r[o]=null);return r}function w(r){const o=pe(null);for(const[i,a]of At(r))N(r,i)&&(Array.isArray(a)?o[i]=on(a):a&&typeof a=="object"&&a.constructor===Object?o[i]=w(a):o[i]=a);return o}function J(r,o){for(;r!==null;){const a=Jt(r,o);if(a){if(a.get)return _(a.get);if(typeof a.value=="function")return _(a.value)}r=Zt(r)}function i(){return null}return i}const pt=E(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ie=E(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Me=E(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),an=E(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ue=E(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ln=E(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dt=E(["#text"]),gt=E(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Pe=E(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ht=E(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fe=E(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sn=S(/\{\{[\w\W]*|[\w\W]*\}\}/gm),cn=S(/<%[\w\W]*|[\w\W]*%>/gm),un=S(/\$\{[\w\W]*/gm),mn=S(/^data-[\-\w.\u00B7-\uFFFF]+$/),fn=S(/^aria-[\-\w]+$/),Et=S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pn=S(/^(?:\w+script|data):/i),dn=S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_t=S(/^html$/i),gn=S(/^[a-z][.\w]*(-[.\w]+)+$/i);var Tt=Object.freeze({__proto__:null,ARIA_ATTR:fn,ATTR_WHITESPACE:dn,CUSTOM_ELEMENT:gn,DATA_ATTR:mn,DOCTYPE_NAME:_t,ERB_EXPR:cn,IS_ALLOWED_URI:Et,IS_SCRIPT_OR_DATA:pn,MUSTACHE_EXPR:sn,TMPLIT_EXPR:un});const Q={element:1,text:3,progressingInstruction:7,comment:8,document:9},hn=function(){return typeof window>"u"?null:window},Tn=function(r,o){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";o&&o.hasAttribute(a)&&(i=o.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return r.createPolicy(c,{createHTML(b){return b},createScriptURL(b){return b}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},yt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function bt(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn();const o=e=>bt(e);if(o.version="3.3.3",o.removed=[],!r||!r.document||r.document.nodeType!==Q.document||!r.Element)return o.isSupported=!1,o;let{document:i}=r;const a=i,c=a.currentScript,{DocumentFragment:b,HTMLTemplateElement:he,Node:B,Element:Ge,NodeFilter:W,NamedNodeMap:Rt=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:Dt,DOMParser:Ct,trustedTypes:te}=r,j=Ge.prototype,wt=J(j,"cloneNode"),xt=J(j,"remove"),vt=J(j,"nextSibling"),Lt=J(j,"childNodes"),ne=J(j,"parentNode");if(typeof he=="function"){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let T,Y="";const{implementation:Te,createNodeIterator:Ot,createDocumentFragment:kt,getElementsByTagName:It}=i,{importNode:Mt}=a;let y=yt();o.isSupported=typeof At=="function"&&typeof ne=="function"&&Te&&Te.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ye,ERB_EXPR:Ae,TMPLIT_EXPR:Ee,DATA_ATTR:Ut,ARIA_ATTR:Pt,IS_SCRIPT_OR_DATA:Ht,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:zt}=Tt;let{IS_ALLOWED_URI:We}=Tt,p=null;const je=l({},[...pt,...Ie,...Me,...Ue,...dt]);let d=null;const Ye=l({},[...gt,...Pe,...ht,...fe]);let m=Object.seal(pe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),X=null,re=null;const O=Object.seal(pe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Xe=!0,_e=!0,qe=!1,Ke=!0,P=!1,oe=!0,I=!1,be=!1,Ne=!1,H=!1,ae=!1,ie=!1,$e=!0,Ve=!1;const Ft="user-content-";let Se=!0,q=!1,z={},C=null;const Re=l({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ze=null;const Je=l({},["audio","video","img","source","image","track"]);let De=null;const Qe=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),le="http://www.w3.org/1998/Math/MathML",se="http://www.w3.org/2000/svg",x="http://www.w3.org/1999/xhtml";let F=x,Ce=!1,we=null;const Gt=l({},[le,se,x],Oe);let ce=l({},["mi","mo","mn","ms","mtext"]),ue=l({},["annotation-xml"]);const Bt=l({},["title","style","font","a","script"]);let K=null;const Wt=["application/xhtml+xml","text/html"],jt="text/html";let f=null,G=null;const Yt=i.createElement("form"),et=function(e){return e instanceof RegExp||e instanceof Function},xe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(G&&G===e)){if((!e||typeof e!="object")&&(e={}),e=w(e),K=Wt.indexOf(e.PARSER_MEDIA_TYPE)===-1?jt:e.PARSER_MEDIA_TYPE,f=K==="application/xhtml+xml"?Oe:de,p=N(e,"ALLOWED_TAGS")?l({},e.ALLOWED_TAGS,f):je,d=N(e,"ALLOWED_ATTR")?l({},e.ALLOWED_ATTR,f):Ye,we=N(e,"ALLOWED_NAMESPACES")?l({},e.ALLOWED_NAMESPACES,Oe):Gt,De=N(e,"ADD_URI_SAFE_ATTR")?l(w(Qe),e.ADD_URI_SAFE_ATTR,f):Qe,Ze=N(e,"ADD_DATA_URI_TAGS")?l(w(Je),e.ADD_DATA_URI_TAGS,f):Je,C=N(e,"FORBID_CONTENTS")?l({},e.FORBID_CONTENTS,f):Re,X=N(e,"FORBID_TAGS")?l({},e.FORBID_TAGS,f):w({}),re=N(e,"FORBID_ATTR")?l({},e.FORBID_ATTR,f):w({}),z=N(e,"USE_PROFILES")?e.USE_PROFILES:!1,Xe=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,qe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ke=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,oe=e.SAFE_FOR_XML!==!1,I=e.WHOLE_DOCUMENT||!1,H=e.RETURN_DOM||!1,ae=e.RETURN_DOM_FRAGMENT||!1,ie=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,$e=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,q=e.IN_PLACE||!1,We=e.ALLOWED_URI_REGEXP||Et,F=e.NAMESPACE||x,ce=e.MATHML_TEXT_INTEGRATION_POINTS||ce,ue=e.HTML_INTEGRATION_POINTS||ue,m=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&et(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(m.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&et(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(m.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(m.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),ae&&(H=!0),z&&(p=l({},dt),d=pe(null),z.html===!0&&(l(p,pt),l(d,gt)),z.svg===!0&&(l(p,Ie),l(d,Pe),l(d,fe)),z.svgFilters===!0&&(l(p,Me),l(d,Pe),l(d,fe)),z.mathMl===!0&&(l(p,Ue),l(d,ht),l(d,fe))),N(e,"ADD_TAGS")||(O.tagCheck=null),N(e,"ADD_ATTR")||(O.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?O.tagCheck=e.ADD_TAGS:(p===je&&(p=w(p)),l(p,e.ADD_TAGS,f))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?O.attributeCheck=e.ADD_ATTR:(d===Ye&&(d=w(d)),l(d,e.ADD_ATTR,f))),e.ADD_URI_SAFE_ATTR&&l(De,e.ADD_URI_SAFE_ATTR,f),e.FORBID_CONTENTS&&(C===Re&&(C=w(C)),l(C,e.FORBID_CONTENTS,f)),e.ADD_FORBID_CONTENTS&&(C===Re&&(C=w(C)),l(C,e.ADD_FORBID_CONTENTS,f)),Se&&(p["#text"]=!0),I&&l(p,["html","head","body"]),p.table&&(l(p,["tbody"]),delete X.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=e.TRUSTED_TYPES_POLICY,Y=T.createHTML("")}else T===void 0&&(T=Tn(te,c)),T!==null&&typeof Y=="string"&&(Y=T.createHTML(""));E&&E(e),G=e}},tt=l({},[...Ie,...Me,...an]),nt=l({},[...Ue,...ln]),Xt=function(e){let n=ne(e);(!n||!n.tagName)&&(n={namespaceURI:F,tagName:"template"});const t=de(e.tagName),s=de(n.tagName);return we[e.namespaceURI]?e.namespaceURI===se?n.namespaceURI===x?t==="svg":n.namespaceURI===le?t==="svg"&&(s==="annotation-xml"||ce[s]):!!tt[t]:e.namespaceURI===le?n.namespaceURI===x?t==="math":n.namespaceURI===se?t==="math"&&ue[s]:!!nt[t]:e.namespaceURI===x?n.namespaceURI===se&&!ue[s]||n.namespaceURI===le&&!ce[s]?!1:!nt[t]&&(Bt[t]||!tt[t]):!!(K==="application/xhtml+xml"&&we[e.namespaceURI]):!1},M=function(e){$(o.removed,{element:e});try{ne(e).removeChild(e)}catch{xt(e)}},U=function(e,n){try{$(o.removed,{attribute:n.getAttributeNode(e),from:n})}catch{$(o.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e==="is")if(H||ae)try{M(n)}catch{}else try{n.setAttribute(e,"")}catch{}},rt=function(e){let n=null,t=null;if(Ne)e="<remove></remove>"+e;else{const u=ke(e,/^[\r\n\t ]+/);t=u&&u[0]}K==="application/xhtml+xml"&&F===x&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const s=T?T.createHTML(e):e;if(F===x)try{n=new Ct().parseFromString(s,K)}catch{}if(!n||!n.documentElement){n=Te.createDocument(F,"template",null);try{n.documentElement.innerHTML=Ce?Y:s}catch{}}const g=n.body||n.documentElement;return e&&t&&g.insertBefore(i.createTextNode(t),g.childNodes[0]||null),F===x?It.call(n,I?"html":"body")[0]:I?n.documentElement:g},ot=function(e){return Ot.call(e.ownerDocument||e,e,W.SHOW_ELEMENT|W.SHOW_COMMENT|W.SHOW_TEXT|W.SHOW_PROCESSING_INSTRUCTION|W.SHOW_CDATA_SECTION,null)},ve=function(e){return e instanceof Dt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Rt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},at=function(e){return typeof B=="function"&&e instanceof B};function v(e,n,t){me(e,s=>{s.call(o,n,t,G)})}const it=function(e){let n=null;if(v(y.beforeSanitizeElements,e,null),ve(e))return M(e),!0;const t=f(e.nodeName);if(v(y.uponSanitizeElement,e,{tagName:t,allowedTags:p}),oe&&e.hasChildNodes()&&!at(e.firstElementChild)&&A(/<[/\w!]/g,e.innerHTML)&&A(/<[/\w!]/g,e.textContent)||e.nodeType===Q.progressingInstruction||oe&&e.nodeType===Q.comment&&A(/<[/\w]/g,e.data))return M(e),!0;if(!(O.tagCheck instanceof Function&&O.tagCheck(t))&&(!p[t]||X[t])){if(!X[t]&&st(t)&&(m.tagNameCheck instanceof RegExp&&A(m.tagNameCheck,t)||m.tagNameCheck instanceof Function&&m.tagNameCheck(t)))return!1;if(Se&&!C[t]){const s=ne(e)||e.parentNode,g=Lt(e)||e.childNodes;if(g&&s){const u=g.length;for(let L=u-1;L>=0;--L){const R=wt(g[L],!0);R.__removalCount=(e.__removalCount||0)+1,s.insertBefore(R,vt(e))}}}return M(e),!0}return e instanceof Ge&&!Xt(e)||(t==="noscript"||t==="noembed"||t==="noframes")&&A(/<\/no(script|embed|frames)/i,e.innerHTML)?(M(e),!0):(P&&e.nodeType===Q.text&&(n=e.textContent,me([ye,Ae,Ee],s=>{n=V(n,s," ")}),e.textContent!==n&&($(o.removed,{element:e.cloneNode()}),e.textContent=n)),v(y.afterSanitizeElements,e,null),!1)},lt=function(e,n,t){if(re[n]||$e&&(n==="id"||n==="name")&&(t in i||t in Yt))return!1;if(!(_e&&!re[n]&&A(Ut,n))&&!(Xe&&A(Pt,n))&&!(O.attributeCheck instanceof Function&&O.attributeCheck(n,e))){if(!d[n]||re[n]){if(!(st(e)&&(m.tagNameCheck instanceof RegExp&&A(m.tagNameCheck,e)||m.tagNameCheck instanceof Function&&m.tagNameCheck(e))&&(m.attributeNameCheck instanceof RegExp&&A(m.attributeNameCheck,n)||m.attributeNameCheck instanceof Function&&m.attributeNameCheck(n,e))||n==="is"&&m.allowCustomizedBuiltInElements&&(m.tagNameCheck instanceof RegExp&&A(m.tagNameCheck,t)||m.tagNameCheck instanceof Function&&m.tagNameCheck(t))))return!1}else if(!De[n]&&!A(We,V(t,Be,""))&&!((n==="src"||n==="xlink:href"||n==="href")&&e!=="script"&&tn(t,"data:")===0&&Ze[e])&&!(qe&&!A(Ht,V(t,Be,"")))&&t)return!1}return!0},st=function(e){return e!=="annotation-xml"&&ke(e,zt)},ct=function(e){v(y.beforeSanitizeAttributes,e,null);const{attributes:n}=e;if(!n||ve(e))return;const t={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d,forceKeepAttr:void 0};let s=n.length;for(;s--;){const g=n[s],{name:u,namespaceURI:L,value:R}=g,D=f(u),Le=R;let h=u==="value"?Le:nn(Le);if(t.attrName=D,t.attrValue=h,t.keepAttr=!0,t.forceKeepAttr=void 0,v(y.uponSanitizeAttribute,e,t),h=t.attrValue,Ve&&(D==="id"||D==="name")&&(U(u,e),h=Ft+h),oe&&A(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,h)){U(u,e);continue}if(D==="attributename"&&ke(h,"href")){U(u,e);continue}if(t.forceKeepAttr)continue;if(!t.keepAttr){U(u,e);continue}if(!Ke&&A(/\/>/i,h)){U(u,e);continue}P&&me([ye,Ae,Ee],Kt=>{h=V(h,Kt," ")});const ut=f(e.nodeName);if(!lt(ut,D,h)){U(u,e);continue}if(T&&typeof te=="object"&&typeof te.getAttributeType=="function"&&!L)switch(te.getAttributeType(ut,D)){case"TrustedHTML":{h=T.createHTML(h);break}case"TrustedScriptURL":{h=T.createScriptURL(h);break}}if(h!==Le)try{L?e.setAttributeNS(L,u,h):e.setAttribute(u,h),ve(e)?M(e):ft(o.removed)}catch{U(u,e)}}v(y.afterSanitizeAttributes,e,null)},qt=function e(n){let t=null;const s=ot(n);for(v(y.beforeSanitizeShadowDOM,n,null);t=s.nextNode();)v(y.uponSanitizeShadowNode,t,null),it(t),ct(t),t.content instanceof b&&e(t.content);v(y.afterSanitizeShadowDOM,n,null)};return o.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,s=null,g=null,u=null;if(Ce=!e,Ce&&(e="<!-->"),typeof e!="string"&&!at(e))if(typeof e.toString=="function"){if(e=e.toString(),typeof e!="string")throw Z("dirty is not a string, aborting")}else throw Z("toString is not a function");if(!o.isSupported)return e;if(be||xe(n),o.removed=[],typeof e=="string"&&(q=!1),q){if(e.nodeName){const D=f(e.nodeName);if(!p[D]||X[D])throw Z("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof B)t=rt("<!---->"),s=t.ownerDocument.importNode(e,!0),s.nodeType===Q.element&&s.nodeName==="BODY"||s.nodeName==="HTML"?t=s:t.appendChild(s);else{if(!H&&!P&&!I&&e.indexOf("<")===-1)return T&&ie?T.createHTML(e):e;if(t=rt(e),!t)return H?null:ie?Y:""}t&&Ne&&M(t.firstChild);const L=ot(q?e:t);for(;g=L.nextNode();)it(g),ct(g),g.content instanceof b&&qt(g.content);if(q)return e;if(H){if(ae)for(u=kt.call(t.ownerDocument);t.firstChild;)u.appendChild(t.firstChild);else u=t;return(d.shadowroot||d.shadowrootmode)&&(u=Mt.call(a,u,!0)),u}let R=I?t.outerHTML:t.innerHTML;return I&&p["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&A(_t,t.ownerDocument.doctype.name)&&(R="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
2
+ `+R),P&&me([ye,Ae,Ee],D=>{R=V(R,D," ")}),T&&ie?T.createHTML(R):R},o.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xe(e),be=!0},o.clearConfig=function(){G=null,be=!1},o.isValidAttribute=function(e,n,t){G||xe({});const s=f(e),g=f(n);return lt(s,g,t)},o.addHook=function(e,n){typeof n=="function"&&$(y[e],n)},o.removeHook=function(e,n){if(n!==void 0){const t=Qt(y[e],n);return t===-1?void 0:en(y[e],t,1)[0]}return ft(y[e])},o.removeHooks=function(e){y[e]=[]},o.removeAllHooks=function(){y=yt()},o}var ge=bt();const Fe="data-temp-href-target";ge.addHook("beforeSanitizeAttributes",function(r){r instanceof HTMLElement&&r.hasAttribute("target")&&r.getAttribute("target")==="_blank"&&r.setAttribute(Fe,"_blank")});ge.addHook("afterSanitizeAttributes",function(r){r instanceof HTMLElement&&r.hasAttribute(Fe)&&(r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer"),r.removeAttribute(Fe))});const Nt={USE_PROFILES:{html:!0},FORCE_BODY:!0},yn=$t("div",{target:"e18540fl0"})(({theme:r})=>({width:"100%","ul, ol, dl":{paddingLeft:r.spacing.threeXL}}),""),St=k.forwardRef(function(r,o){return ee.jsx(yn,{className:"stHtml","data-testid":"stHtml",ref:o,...r})}),An={...Nt,ADD_TAGS:["script","style"],ADD_ATTR:["src","type","async","defer","nonce","crossorigin","referrerpolicy","integrity"]};function En(r){return ge.sanitize(r,An)}const _n=({body:r})=>{const o=k.useRef(null),i=k.useMemo(()=>En(r),[r]);return k.useEffect(()=>{const a=o.current;return a?(a.innerHTML=i,Array.from(a.querySelectorAll("script")).forEach(c=>{const b=document.createElement("script");for(const{name:he,value:B}of Array.from(c.attributes))try{b.setAttribute(he,B)}catch{}c.src||(b.textContent=c.textContent),c.parentNode?.replaceChild(b,c)}),()=>{a.innerHTML=""}):void 0},[i]),ee.jsx(St,{ref:o})},bn=k.memo(_n);function Nn(r){return ge.sanitize(r,Nt)}function Sn({body:r}){const o=k.useMemo(()=>Nn(r),[r]);return o?ee.jsx(St,{dangerouslySetInnerHTML:{__html:o}}):null}const Rn=k.memo(Sn);function Dn({element:r}){const{body:o,unsafeAllowJavascript:i}=r;return i?ee.jsx(bn,{body:o}):ee.jsx(Rn,{body:o})}const wn=k.memo(Dn);export{wn as default};
@@ -0,0 +1 @@
1
+ import{r as p,aB as h,N as f,j as i,an as b,at as m,x as s,aj as g,z as k}from"./index-DegoUuPm.js";import{s as y}from"./iconPosition-DC20xXN5-Dq1FtUtw.js";const C=s("div",{target:"e11k5jya2"})({name:"b6wrti",styles:"display:flex;flex-direction:column;width:100%"}),j=s("a",{target:"e11k5jya1"})(({disabled:o,isCurrentPage:r,theme:e})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:r?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:r?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...o?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),S=s("span",{target:"e11k5jya0"})(({disabled:o,theme:r})=>({color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...o?{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function v(o){let r=o.page;if(o.queryString)if(o.external)try{const e=new URL(o.page);new URLSearchParams(o.queryString).forEach((a,n)=>e.searchParams.append(n,a)),r=e.toString()}catch{const[e,a]=r.split("#");r=e+(e.includes("?")?"&":"?")+o.queryString+(a?"#"+a:"")}else r+=(r.includes("?")?"&":"?")+o.queryString;return r}function w(o){const{onPageChange:r,currentPageScriptHash:e}=p.useContext(h),{colors:a}=f(),{disabled:n,element:t}=o,l=e===t.pageScriptHash,u=d=>{t.external?n&&d.preventDefault():(d.preventDefault(),n||r(t.pageScriptHash,t.queryString))},c=y(t.iconPosition),x=v(t);return i.jsx("div",{className:"stPageLink","data-testid":"stPageLink",children:i.jsx(b,{help:t.help,placement:m.TOP_RIGHT,containerWidth:!0,children:i.jsx(C,{children:i.jsxs(j,{"data-testid":"stPageLink-NavLink",disabled:n,isCurrentPage:l,href:x,target:t.external?"_blank":"",rel:"noreferrer",onClick:u,children:[t.icon&&c==="left"&&i.jsx(g,{size:"lg",color:n?a.fadedText40:a.bodyText,iconValue:t.icon}),i.jsx(S,{disabled:n,children:i.jsx(k,{source:t.label,allowHTML:!1,isLabel:!0,boldLabel:l,largerLabel:!0,disableLinks:!0})}),t.icon&&c==="right"&&i.jsx(g,{size:"lg",color:n?a.fadedText40:a.bodyText,iconValue:t.icon})]})})})})}const P=p.memo(w);export{P as default};
@@ -0,0 +1 @@
1
+ import{F as b,ak as i,r as l,j as o,al as h,am as x,an as S,aU as f,ao as F,ap as R,cs as C,ct as M}from"./index-DegoUuPm.js";import{cu as E}from"./index-DegoUuPm.js";import{s as j}from"./iconPosition-DC20xXN5-Dq1FtUtw.js";import{d as k,m as O}from"./FormClearHelper-CbmTijuR-BhfBTvx4.js";function I(a){const{disabled:d,element:t,widgetMgr:e,fragmentId:u}=a,{formId:s}=t,m=t.shortcut?t.shortcut:void 0,{formsData:B}=b(M),p=B.formsWithUploads.has(s);let n=i.SECONDARY_FORM_SUBMIT;t.type==="primary"?n=i.PRIMARY_FORM_SUBMIT:t.type==="tertiary"&&(n=i.TERTIARY_FORM_SUBMIT);const r=d||p;l.useEffect(()=>(e.addSubmitButton(s,t),()=>e.removeSubmitButton(s,t)),[e,s,t]);const c=l.useCallback(()=>{r||e.submitForm(t.formId,u,t)},[r,e,t,u]);return h({shortcut:m,disabled:r,onActivate:c}),o.jsx(x,{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",children:o.jsx(S,{help:t.help,containerWidth:!0,children:o.jsx(f,{kind:n,size:F.SMALL,containerWidth:!0,disabled:r,onClick:c,children:o.jsx(R,{icon:t.icon,iconPosition:j(t.iconPosition),label:t.label,shortcut:m})})})})}function _(a){return o.jsx(C,{children:o.jsx(I,{...a})})}export{k as FormClearHelper,I as FormSubmitButton,_ as FormSubmitContent,E as default,O as useFormClearHelper};
@@ -1 +1 @@
1
- import{r as t,R as s,m as a,B as i,l as c}from"./index-Bdi0ug4X.js";import{a as d,o as l}from"./IFrameUtil-8kJzIdKx-BKMrKnrz.js";const m=i("iframe",{target:"e1u6k47s0"})(({theme:e,disableScrolling:o})=>({width:"100%",height:"100%",colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,overflow:o?"hidden":void 0}),"");function n(e){return c(e)||e===""?void 0:e}function g({element:e}){const o=n(e.src),r=s(o)?void 0:n(e.srcdoc);return a.jsx(m,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!e.scrolling,src:o,srcDoc:r,scrolling:e.scrolling?"auto":"no",sandbox:d,title:"st.iframe",tabIndex:e.tabIndex??void 0})}const p=t.memo(g);export{p as default};
1
+ import{r as t,P as s,j as a,x as i,i as c}from"./index-DegoUuPm.js";import{a as d,o as l}from"./IFrameUtil-8kJzIdKx-BKMrKnrz.js";const m=i("iframe",{target:"e1u6k47s0"})(({theme:e,disableScrolling:o})=>({width:"100%",height:"100%",colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,overflow:o?"hidden":void 0}),"");function n(e){return c(e)||e===""?void 0:e}function g({element:e}){const o=n(e.src),r=s(o)?void 0:n(e.srcdoc);return a.jsx(m,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!e.scrolling,src:o,srcDoc:r,scrolling:e.scrolling?"auto":"no",sandbox:d,title:"st.iframe",tabIndex:e.tabIndex??void 0})}const x=t.memo(g);export{x as default};
@@ -0,0 +1 @@
1
+ import{r as j,ac as C,F as I,j as r,K as x,L as y,x as c,$ as E,z as L,B as v}from"./index-DegoUuPm.js";import{v as k,d as M}from"./withFullScreenWrapper-uh7txjJc-CYEgnXN4.js";const R=c("div",{target:"e115fcil3"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:t?"100%":"fit-content"}),""),W=c("div",{target:"e115fcil2"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:t?"100%":"auto",flexGrow:t?1:0,">img":{borderRadius:e.radii.default}}),""),T=c("div",{target:"e115fcil1"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS}),""),F=c("a",{target:"e115fcil0"})(({theme:e})=>({display:"block",borderRadius:e.radii.default,overflow:"hidden","&:hover":{opacity:.85},"&:focus-visible":{boxShadow:e.shadows.focusRing}}),""),H=v.getLogger("ImageList");function U(e,t){if(e){if(e.useStretch)return t;if(e.useContent)return;if(e.pixelWidth)return e.pixelWidth}}const $=({itemKey:e,image:t,imgStyle:a,buildMediaURL:h,handleImageError:g,shouldStretch:s,link:o})=>{const n=E(t.url),l=r.jsx("img",{style:a,src:h(t.url),alt:e,onError:g,crossOrigin:n});return r.jsxs(W,{"data-testid":"stImageContainer",shouldStretch:s,children:[o?r.jsx(F,{href:o,target:"_blank",rel:"noreferrer","aria-label":t.caption||o,"data-testid":"stImageLink",children:l}):l,t.caption&&r.jsx(T,{"data-testid":"stImageCaption",style:a,children:r.jsx(L,{source:t.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function K({element:e,endpoints:t,widthConfig:a,disableFullscreenMode:h}){const g=C(e.imgs),{expanded:s,width:o,height:n,expand:l,collapse:f}=I(M),m=o||0,b=U(a,m),p=a?.useStretch??!1,i={};n&&s?(i.maxHeight=n,i.objectFit="contain",i.width="100%"):(i.width=b??"100%",i.maxWidth="100%");const w=u=>{const d=u.currentTarget.src;H.error(`Client Error: Image source error - ${d}`),t.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",d)};return r.jsxs(x,{width:m,height:n,useContainerWidth:s,topCentered:!0,children:[r.jsx(y,{target:x,isFullScreen:s,onExpand:l,onCollapse:f,disableFullscreenMode:h}),r.jsx(R,{className:"stImage","data-testid":"stImage",shouldStretch:p,children:g.map((u,d)=>r.jsx($,{itemKey:d.toString(),image:u,imgStyle:i,buildMediaURL:S=>t.buildMediaURL(S),handleImageError:w,shouldStretch:p,link:e.imgs.length===1?e.link:void 0},d))})]})}const O=k(K),B=j.memo(O);export{B as default};
@@ -0,0 +1 @@
1
+ import{r,N as lt,G as st,bm as ct,bE as dt,B as ut,i as ne,aT as Ee,aS as pt,bF as y,w as gt,j as i,x as f,au as V,aj as Ve,bD as ce,at as de,aR as ft,E as C,_ as z,a4 as Fe,aU as ht,ak as mt}from"./index-DegoUuPm.js";import{S as xt,F as K,E as ke,q as Se,T as le,C as wt,x as Re,a as vt}from"./FileHelper-6E1AHofU-qrMXF9BJ.js";import{c as bt}from"./useWaveformController-BeUcMXLl-DLfXFMqt.js";import{m as yt}from"./InputInstructions-GG_DznKT-BTS6NlIa.js";import{y as Ct,r as zt}from"./useTextInputAutoExpand-DKFPNBDa-Cb0YY3m0.js";import{r as jt}from"./inputUtils-DCYiajnz-DsrlAoKH.js";import{c as Et}from"./TableChart.esm-CoMoidiP-DrT_rrb0.js";import{i as St}from"./ErrorOutline.esm-DV80JhHP-XkDmlp3T.js";import{t as Me}from"./UploadFileInfo-DdcsXhjv-m2CBXl3F.js";import"./styled-components-UJ_u5XUO-B68esmwJ.js";import"./base-input-BdLA32iO-A9B9vy_-.js";import"./constants-Dj7RTpUo-BGkidDJo.js";var He=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),r.createElement("path",{d:"M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}))});He.displayName="Article";var Ae=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}))});Ae.displayName="Code";var Te=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"}))});Te.displayName="Description";var Le=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.17 6l2 2H20v10H4V6h5.17M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}))});Le.displayName="Folder";var Be=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}))});Be.displayName="Image";var Ue=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 3l.01 10.55c-.59-.34-1.27-.55-2-.55a4.001 4.001 0 100 8c2.22 0 3.99-1.79 3.99-4V7h4V3h-6zm-1.99 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}))});Ue.displayName="MusicNote";var De=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm-1-9c0-.55.45-1 1-1s1 .45 1 1v6c0 .55-.45 1-1 1s-1-.45-1-1V5zm6 6c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});De.displayName="MicNone";var Ne=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M15 8v8H5V8h10m1-2H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4V7c0-.55-.45-1-1-1z"}))});Ne.displayName="Videocam";var Pe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}))});Pe.displayName="Add";var $e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0a.996.996 0 000-1.41l-6.59-6.59a.996.996 0 00-1.41 0l-6.6 6.58a.996.996 0 101.41 1.41L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1z"}))});$e.displayName="ArrowUpward";var We=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.29 12.89a.996.996 0 11-1.41 1.41L12 13.41 9.11 16.3a.996.996 0 11-1.41-1.41L10.59 12 7.71 9.11A.996.996 0 119.12 7.7L12 10.59l2.89-2.89a.996.996 0 111.41 1.41L13.41 12l2.88 2.89z"}))});We.displayName="Cancel";var Oe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z"}))});Oe.displayName="Check";var Ie=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))});Ie.displayName="Close";var Xe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(C,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}))});Xe.displayName="ErrorOutline";const X=ut.getLogger("ChatInput"),Rt=f("div",{target:"e1d2x3se10"})({name:"16hjiy4",styles:"position:relative;display:flex;flex-direction:column"}),Vt=f("div",{target:"e1d2x3se9"})(({theme:e})=>({backgroundColor:e.colors.secondaryBg,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,position:"relative",display:"flex",flexDirection:"column",alignItems:"stretch",flex:1,paddingTop:e.spacing.md,paddingBottom:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg,gap:e.spacing.sm,borderRadius:e.radii.default,boxSizing:"border-box",":focus-within":{borderColor:e.colors.primary}}),""),Ft=f("div",{target:"e1d2x3se8"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm}),""),kt=f("div",{target:"e1d2x3se7"})(({theme:e,isStacked:t})=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",gap:e.spacing.sm,flexWrap:t?"wrap":"nowrap"}),""),Mt=f("div",{target:"e1d2x3se6"})(({isStacked:e})=>({flex:e?"none":1,width:e?"100%":"auto",order:e?-1:0,display:"flex",alignItems:"center",minWidth:0}),""),Ht=f("div",{target:"e1d2x3se5"})(({theme:e})=>({display:"flex",flexDirection:"row",flexShrink:0,gap:e.spacing.sm,alignItems:"center"}),""),At=f("div",{target:"e1d2x3se4"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.sm,alignItems:"center"}),""),Tt=f("div",{target:"e1d2x3se3"})(({theme:e})=>({position:"absolute",top:e.spacing.twoXS,right:e.spacing.lg,color:e.colors.fadedText60,fontSize:e.fontSizes.twoSm,textAlign:"right",whiteSpace:"nowrap",pointerEvents:"auto",cursor:"text",zIndex:e.zIndices.priority,"& .stChatInputInstructions":{position:"static"}}),""),M=f("button",{target:"e1d2x3se2"})(({theme:e,disabled:t,hasError:o,primary:d})=>{if(d)return{border:"none",backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary,borderRadius:e.radii.button,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.xs,width:e.sizes.chatInputPrimaryButtonSize,height:e.sizes.chatInputPrimaryButtonSize,color:t?e.colors.fadedText40:e.colors.white,cursor:t?"not-allowed":"pointer",transition:"background-color 200ms ease","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover":{backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary}};const c=()=>o?e.colors.redTextColor:t?e.colors.fadedText40:e.colors.fadedText60;return{border:"none",backgroundColor:e.colors.transparent,borderRadius:e.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.none,color:c(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:e.shadows.focusRing},"&:hover":{color:o?e.colors.redColor:e.colors.bodyText},"&:active":{color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"},"& svg":{width:e.iconSizes.lg,height:e.iconSizes.lg}}},""),Lt=f("div",{target:"e1d2x3se1"})(({isRecording:e})=>({display:e?"flex":"none",flex:1,alignItems:"center",minWidth:0}),""),Bt=f("div",{target:"e1d2x3se0"})(({theme:e})=>({position:"relative",width:"100%",height:e.sizes.chatInputPrimaryButtonSize,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}}),""),Ke=(e,t)=>t===y.Directory?{...e,webkitdirectory:"",multiple:!0}:e,Ut=(e,t)=>{if(!t||t.length===0)return!0;const o=e.name.toLowerCase(),d=o.lastIndexOf(".");if(d===-1||d===o.length-1)return t.some(p=>p===""||p===".");const c=o.substring(d),h=o.substring(d+1);return t.some(p=>{const x=p.toLowerCase();return x.startsWith(".")?c===x:h===x})},Dt=(e,t)=>Ut(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},se=e=>{switch(e){case y.None:return"a file";case y.Single:return"a file";case y.Multiple:return"files";case y.Directory:return"a directory";default:return Fe(e),"a file"}},Nt=f("div",{target:"e3id6jz13"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"absolute",inset:0,zIndex:e.zIndices.priority,borderRadius:e.radii.chatInput}),""),Pt=f("div",{target:"e3id6jz12"})(({theme:e})=>({position:"absolute",inset:0,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:e.fontWeights.bold,pointerEvents:"none",zIndex:e.zIndices.priority}),""),$t=f("div",{target:"e3id6jz11"})(({disabled:e})=>({pointerEvents:e?"none":"auto"}),""),Wt=f("div",{target:"e3id6jz10"})(({theme:e})=>({lineHeight:e.lineHeights.tight}),""),Ot=f("div",{target:"e3id6jz9"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm}),""),It=f("div",{target:"e3id6jz8"})({name:"193lomy",styles:"flex:0 0 auto;max-width:100%"}),Xt=f("div",{target:"e3id6jz7"})(({theme:e,isError:t,isClickable:o})=>({position:"relative",display:"inline-flex",alignItems:"center",width:"fit-content",minWidth:"9rem",maxWidth:"100%",backgroundColor:t?e.colors.redBackgroundColor:e.colors.bgColor,padding:e.spacing.twoXS,paddingRight:e.spacing.twoXL,borderRadius:e.radii.default,gap:e.spacing.sm,cursor:o?"pointer":"default"}),""),Kt=f("div",{target:"e3id6jz6"})({name:"1ojnsow",styles:"display:flex;flex-direction:column;min-width:0"}),Zt=f("div",{target:"e3id6jz5"})(({theme:e,fileStatus:t})=>({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.default,width:e.sizes.chatInputFileIconSize,height:e.sizes.chatInputFileIconSize,flexShrink:0,overflow:"hidden",...t==="uploaded"&&{backgroundColor:e.colors.bodyText,color:e.colors.bgColor},...t==="uploading"&&{backgroundColor:e.colors.fadedText10,color:e.colors.fadedText60},...t==="error"&&{backgroundColor:e.colors.redBackgroundColor,color:e.colors.redTextColor}}),""),qt=f("img",{target:"e3id6jz4"})({name:"4uwt2b",styles:"width:100%;height:100%;object-fit:cover"}),Yt=f("div",{target:"e3id6jz3"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploading"?e.colors.fadedText60:e.colors.bodyText}),""),_t=f("div",{target:"e3id6jz2"})(({theme:e})=>({color:e.colors.fadedText60,fontSize:e.fontSizes.sm}),""),Qt=f("small",{target:"e3id6jz1"})(({theme:e,isError:t})=>({position:"absolute",top:e.spacing.twoXS,right:e.spacing.twoXS,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,"& button":{display:"flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content",minHeight:"unset",minWidth:"unset",maxHeight:"unset",maxWidth:"unset",borderRadius:"50%",backgroundColor:"transparent",color:t?e.colors.redTextColor:e.colors.fadedText60,padding:0,overflow:"hidden",boxSizing:"border-box",lineHeight:0,"&:hover":{backgroundColor:"transparent",color:t?e.colors.redColor:e.colors.bodyText}}}),""),Jt=f("span",{target:"e3id6jz0"})({name:"1dja9su",styles:"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0"}),Gt=({onDrop:e,multiple:t,accept:o,maxSize:d,acceptFile:c,disabled:h})=>{const{getRootProps:p,getInputProps:x}=ke({onDrop:e,multiple:t,accept:o,maxSize:d,useFsAccessApi:!1}),v=Ke(x(),c),s=p({tabIndex:-1});return i.jsxs($t,{"data-testid":"stChatInputFileUploadButton",disabled:h,...s,children:[i.jsx("input",{...v}),i.jsx(ce,{content:`Upload or drag and drop ${se(c)}`,placement:de.TOP,onMouseEnterDelay:500,children:i.jsx(M,{type:"button",disabled:h,"aria-label":`Upload ${se(c)}`,children:i.jsx(V,{content:Pe,size:"xl",color:"inherit"})})})]})},er=r.memo(Gt),tr=({getRootProps:e,getInputProps:t,acceptFile:o})=>{const d=Ke(t(),o);return i.jsxs(i.Fragment,{children:[i.jsx(Nt,{...e(),children:i.jsx("input",{...d})}),i.jsx(Pt,{children:`Drag and drop ${se(o)} here`})]})},rr=r.memo(tr),Ze=new Set(["jpg","jpeg","png","gif","webp","svg","bmp"]),or=new Set(["pdf"]),nr=new Set(["csv","tsv","xlsx","xls"]),ir=new Set(["txt","md","json","xml","yaml","yml"]),ar=new Set(["py","js","ts","jsx","tsx","css","html","java","cpp","c","go","rs","rb","php","swift","kt","scala","sh","bash","sql"]),lr=new Set(["mp3","wav","m4a","ogg","flac","aac"]),sr=new Set(["mp4","webm","mov","avi","mkv","wmv"]),cr=new Set(["zip","tar","gz","rar","7z","bz2"]);function qe(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()}function dr(e){const t=qe(e);return Ze.has(t)?Be:or.has(t)?He:nr.has(t)?Et:ir.has(t)?Te:ar.has(t)?Ae:lr.has(t)?Ue:sr.has(t)?Ne:cr.has(t)?Le:vt}function ur(e){const t=qe(e);return Ze.has(t)}const pr=20;function gr(e,t=pr){if(e.length<=t)return e;const o=e.lastIndexOf(".");if(!(o>0&&o<e.length-1)){const s=Math.floor((t-3)/2),w=s>0?e.slice(-s):"";return`${e.slice(0,s)}...${w}`}const d=e.slice(o),c=e.slice(0,o),h=t-d.length-3;if(h<=0){const s=Math.floor((t-3)/2),w=s>0?e.slice(-s):"";return`${e.slice(0,s)}...${w}`}const p=Math.ceil(h/2),x=Math.floor(h/2),v=x>0?c.slice(-x):"";return`${c.slice(0,p)}...${v}${d}`}function fr(e,t){const o=r.useMemo(()=>!e||!ur(t)?null:URL.createObjectURL(e),[e,t]);return r.useEffect(()=>()=>{o&&URL.revokeObjectURL(o)},[o]),o}const hr=({fileInfo:e,imagePreviewUrl:t})=>{const{type:o}=e.status;switch(o){case"uploading":return i.jsx(Ve,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return i.jsx(V,{content:St,size:"lg",testid:"stChatInputFileIconError"});case"uploaded":return t?i.jsx(qt,{src:t,alt:e.name,"data-testid":"stChatInputFileImagePreview"}):i.jsx(V,{content:dr(e.name),size:"lg"});default:return Fe(o),null}},mr=({fileInfo:e,onDelete:t,onRetry:o})=>{const d=e.status.type,c=d==="error",h=d==="uploading",p=c&&o!==void 0&&e.file!==void 0,x=r.useId(),v=fr(e.file,e.name),s=e.status.type==="error"?e.status.errorMessage:"Upload failed",w=r.useCallback(()=>{p&&o(e)},[p,o,e]),m=r.useCallback(b=>{p&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),o(e))},[p,o,e]),g=r.useCallback(b=>{b.stopPropagation(),t(e.id)},[t,e.id]),H=h?`Cancel upload of ${e.name}`:`Remove ${e.name}`,Z=Re(e.size,K.Byte),N=`${e.name}, ${Z}`,A=i.jsxs(Xt,{className:"stChatInputFile","data-testid":"stChatInputFile",isError:c,isClickable:p,onClick:p?w:void 0,onKeyDown:p?m:void 0,title:p?"Click to retry upload":void 0,role:p?"button":void 0,tabIndex:p?0:void 0,"aria-label":N,"aria-invalid":c||void 0,"aria-describedby":c?x:void 0,children:[i.jsx(Zt,{fileStatus:d,children:i.jsx(hr,{fileInfo:e,imagePreviewUrl:v})}),i.jsxs(Kt,{children:[i.jsx(Yt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:gr(e.name)}),i.jsx(_t,{children:Re(e.size,K.Byte)})]}),i.jsx(Qt,{"data-testid":"stChatInputDeleteBtn",isError:c,children:i.jsx(ht,{onClick:g,kind:mt.MINIMAL,"aria-label":H,children:i.jsx(V,{content:We,size:"md"})})}),c&&i.jsxs(Jt,{id:x,role:"alert",children:["Error: ",s]})]});return c?i.jsx(ce,{content:s,placement:de.TOP,error:!0,children:A}):A},xr=r.memo(mr),wr=({items:e,onDelete:t,onRetry:o})=>i.jsx(Wt,{"data-testid":"stChatUploadedFiles",children:i.jsx(Ot,{children:e.map(d=>i.jsx(It,{children:i.jsx(xr,{fileInfo:d,onDelete:t,onRetry:o})},d.id))})}),vr=r.memo(wr),br=(e,t,o)=>{const d=[],c=[];return e.forEach(h=>{if(h.size>o){c.push({file:h,errors:[{code:le.FileTooLarge,message:`File is too large. Maximum size is ${o} bytes.`}]});return}const p=Dt(h,t.fileType);if(!p.isValid){c.push({file:h,errors:[{code:le.FileInvalidType,message:p.errorMessage||"File type not allowed."}]});return}d.push(h)}),{accepted:d,rejected:c}},yr=({acceptMultipleFiles:e,maxFileSize:t,uploadClient:o,uploadFile:d,addFiles:c,getNextLocalFileId:h,deleteExistingFiles:p,onUploadComplete:x,element:v})=>(s,w)=>{if(s.length>0){const{accepted:m,rejected:g}=br(s,v,t);s=m,w=[...w,...g]}if(!e&&s.length===0&&w.length>1){const m=w.findIndex(g=>g.errors?.[0].code===le.TooManyFiles);m>=0&&(s.push(w[m].file),w.splice(m,1))}if(!e&&s.length>0&&p(),o.fetchFileURLs(s).then(m=>{ft(m,s).forEach(([g,H])=>{d(g,H)})}).catch(m=>{c(s.map(g=>new Me(g.name,g.size,h(),{type:"error",errorMessage:m},g)))}),w.length>0){const m=w.map(g=>wt(g,h(),t));c(m)}x()},Cr=({getNextLocalFileId:e,addFiles:t,updateFile:o,uploadClient:d,element:c,onUploadProgress:h,onUploadComplete:p})=>(x,v)=>{const s=v.webkitRelativePath||v.name,w=new AbortController,m=new Me(s,v.size,e(),{type:"uploading",abortController:w,progress:1},v);t([m]),d.uploadFile({formId:"",...c},x.uploadUrl,v,g=>h(g,m.id),w.signal).then(()=>p(m.id,x)).catch(g=>{g instanceof DOMException&&g.name==="AbortError"||o(m.id,m.setStatus({type:"error",errorMessage:g?g.toString():"Unknown error"}))})};function zr(e,t,o){return{Root:{style:{minHeight:e.sizes.chatInputTextareaMinHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",...o}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:e.fontWeights.normal,lineHeight:e.lineHeights.inputWidget,"::placeholder":{color:e.colors.fadedText60},height:t.isExtended?t.height:"auto",maxHeight:t.maxHeight,overflowY:"auto",paddingLeft:e.spacing.none,paddingRight:e.spacing.none,paddingBottom:e.spacing.twoXS,paddingTop:e.spacing.twoXS,width:"100%"}}}}const ie=(e,t,o)=>o.map(d=>d.id===e?t:d),ae=(e,t)=>t.find(o=>o.id===e);function jr({disabled:e,element:t,widgetMgr:o,fragmentId:d,uploadClient:c}){const h=lt(),{placeholder:p,maxChars:x}=t,v=r.useRef(0),s=r.useRef(null),w=r.useRef(!1),m=r.useRef(null),g=r.useRef(null),{width:H,elementRef:Z}=st(),{innerWidth:N,innerHeight:A}=ct(),[b,q]=r.useState(t.default),[S,F]=r.useState([]),[T,Y]=r.useState(!1),[L,ue]=r.useState(!1),[_,B]=r.useState(null),[k,Q]=r.useState(!1),[Ye,pe]=r.useState(0),J=t.acceptAudio??!1;r.useEffect(()=>()=>{g.current&&g.current.abort()},[]);const P=Ct({textareaRef:s,dependencies:[p,k]}),$=r.useRef(""),W=r.useRef(0),G=r.useRef(null),ge=r.useRef(null),U=r.useCallback(n=>{const a=getComputedStyle(n);$.current=`${a.fontWeight} ${a.fontSize} ${a.fontFamily}`;const u=parseFloat(a.paddingLeft)||0,l=parseFloat(a.paddingRight)||0;W.current=n.clientWidth-u-l},[]);r.useLayoutEffect(()=>{const n=s.current;if(!n)return;U(n);const a=new ResizeObserver(()=>U(n));return a.observe(n),()=>a.disconnect()},[U,k]),r.useEffect(()=>{if(b===""){Q(!1);return}if(k)return;const n=s.current;if(!n||((W.current<=0||!$.current)&&U(n),W.current<=0||!$.current))return;G.current||(G.current=document.createElement("canvas"),ge.current=G.current.getContext("2d"));const a=ge.current;a&&(a.font=$.current,a.measureText(b).width>W.current-10&&Q(!0))},[b,k,U]);const O=r.useMemo(()=>S.some(n=>n.status.type==="uploading")?!1:b!==""||S.length>0,[S,b]),E=dt(t.acceptFile),ee=xt(t.maxUploadSizeMb,K.Megabyte,K.Byte),fe=r.useCallback(n=>F(a=>[...a,...n]),[]),he=r.useCallback(n=>{n.status.type==="uploading"&&n.status.abortController.abort(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&c.deleteFile(n.status.fileUrls.deleteUrl).catch(a=>{X.error("Failed to delete file from server:",a)})},[c]),me=r.useCallback(n=>{F(a=>{const u=ae(n,a);if(ne(u))return a;he(u);const l=a.filter(j=>j.id!==n);return l.length===0&&pe(j=>j+1),l})},[he]),te=r.useRef(null),_e=r.useCallback(n=>{!n.file||n.status.type!=="error"||(F(a=>a.filter(u=>u.id!==n.id)),te.current&&te.current([n.file],[]))},[]),xe=r.useCallback(()=>{const n=S.filter(a=>a.status.type==="uploaded").map(a=>{const{name:u,size:l,status:j}=a,{fileId:oe,fileUrls:at}=j;return new Ee({fileId:oe,fileUrls:at,name:u,size:l})});return new pt({uploadedFileInfo:n})},[S]),we=()=>v.current++,re=yr({acceptMultipleFiles:E===y.Multiple||E===y.Directory,maxFileSize:ee,uploadClient:c,uploadFile:Cr({getNextLocalFileId:we,addFiles:fe,updateFile:(n,a)=>{F(u=>ie(n,a,u))},uploadClient:c,element:t,onUploadProgress:(n,a)=>{F(u=>{const l=ae(a,u);if(ne(l)||l.status.type!=="uploading")return u;const j=Math.round(n.loaded*100/n.total);return l.status.progress===j?u:ie(a,l.setStatus({type:"uploading",abortController:l.status.abortController,progress:j}),u)})},onUploadComplete:(n,a)=>{F(u=>{const l=ae(n,u);return ne(l)||l.status.type!=="uploading"?u:ie(l.id,l.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}),u)})}}),addFiles:fe,getNextLocalFileId:we,deleteExistingFiles:()=>S.forEach(n=>me(n.id)),onUploadComplete:()=>{s.current&&s.current.focus()},element:t});te.current=re;const{getRootProps:Qe,getInputProps:Je}=ke({onDrop:re,multiple:E===y.Multiple||E===y.Directory,accept:Se(t.fileType),maxSize:ee,useFsAccessApi:!1}),I=r.useCallback(n=>{if(s.current&&s.current.focus(),!O&&!n||e)return;const a=xe(),u={data:b,fileUploaderState:a,audioFileInfo:n};o.setChatInputValue(t,u,{fromUi:!0},d),S.length>0&&pe(l=>l+1),F([]),q(""),Q(!1),P.clearScrollHeight()},[O,e,b,S.length,xe,o,t,d,P]),ve=r.useCallback(async n=>{const a=new Date().toISOString().replace(/[:.]/g,"-"),u=new File([n],`audio-${a}.wav`,{type:"audio/wav"});try{ue(!0);const l=await c.fetchFileURLs([u]);if(l.length===0)throw new Error("Failed to get upload URL for audio file");const j=l[0];g.current=new AbortController,await c.uploadFile({formId:"",...t},j.uploadUrl,u,()=>{},g.current.signal);const oe=new Ee({fileId:j.fileId,fileUrls:j,name:u.name,size:u.size});I(oe)}catch(l){X.error("Audio upload failed:",l),B("Recording failed"),s.current&&s.current.focus()}finally{ue(!1)}},[c,t,I]),Ge=r.useMemo(()=>({onApprove:ve,onPermissionDenied:()=>{const n="Microphone access denied";B(n),X.error("Permission denied:",n)},onError:n=>{B("Recording failed"),X.error("Recording error:",n)},onRecordStart:()=>{B(null)}}),[ve]),R=bt({containerRef:m,sampleRate:t.audioSampleRate??void 0,events:Ge}),be=r.useCallback(()=>{I()},[I]),et=n=>{const{metaKey:a,ctrlKey:u,shiftKey:l}=n;jt(n)&&!l&&!u&&!a&&(n.preventDefault(),be())},tt=n=>{const{value:a}=n.target;x!==0&&a.length>x||(q(a),P.updateScrollHeight(),_&&B(null))},ye=r.useCallback(async n=>{n.preventDefault(),n.stopPropagation(),!(!J||e||R.state==="recording")&&await R.start()},[J,e,R]),rt=r.useCallback(()=>{R.cancel(),s.current&&s.current.focus()},[R]),Ce=r.useCallback(async()=>{const{blob:n}=await R.stop();await R.approve(n)},[R]),ze=r.useCallback(n=>{ye(n)},[ye]),ot=r.useCallback(()=>{Ce()},[Ce]),nt=r.useCallback(()=>{s.current&&s.current.focus()},[]);r.useEffect(()=>{if(t.setValue&&!w.current){w.current=!0;const n=t.value||"";q(n)}},[t.setValue,t.value]),r.useEffect(()=>{w.current=!1},[t]),r.useEffect(()=>{const n=l=>{l.preventDefault(),l.stopPropagation(),!T&&l.dataTransfer?.types.includes("Files")&&Y(!0)},a=l=>{l.preventDefault(),l.stopPropagation(),T&&(l.clientX<=0&&l.clientY<=0||l.clientX>=N&&l.clientY>=A)&&Y(!1)},u=l=>{l.preventDefault(),l.stopPropagation(),T&&Y(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",u),window.addEventListener("dragleave",a),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",u),window.removeEventListener("dragleave",a)}},[T,N,A]);const it=E!==y.None&&T,D=R.state==="recording",je=!D&&H>gt(h.breakpoints.hideWidgetDetails)&&x>0;return i.jsx(Rt,{className:"stChatInput","data-testid":"stChatInput",ref:Z,children:i.jsxs(Vt,{children:[je&&i.jsx(Tt,{onClick:nt,id:"stChatInputInstructions",children:i.jsx(yt,{dirty:O,value:b,maxLength:x,type:"chat",inForm:!1,className:"stChatInputInstructions"})}),it&&i.jsx(rr,{getRootProps:Qe,getInputProps:Je,acceptFile:E}),E!==y.None&&S.length>0&&i.jsx(Ft,{children:i.jsx(vr,{items:[...S],onDelete:me,onRetry:_e})}),i.jsxs(kt,{isStacked:k,children:[i.jsx(Ht,{children:E!==y.None&&!D&&i.jsx(er,{onDrop:re,multiple:E===y.Multiple||E===y.Directory,accept:Se(t.fileType),maxSize:ee,acceptFile:E,disabled:e},Ye)}),i.jsx(Lt,{isRecording:D,children:i.jsx(Bt,{ref:m})}),!D&&i.jsx(Mt,{isStacked:k,children:i.jsx(zt,{inputRef:s,value:b,placeholder:p,onChange:tt,onKeyDown:et,"aria-label":p,disabled:e,rows:1,"aria-describedby":je?"stChatInputInstructions":void 0,overrides:zr(h,P,{width:"100%"})})}),i.jsx(At,{children:D?i.jsxs(i.Fragment,{children:[i.jsx(M,{onClick:rt,disabled:e,"data-testid":"stChatInputCancelButton","aria-label":"Cancel recording",children:i.jsx(V,{content:Ie,size:"lg",color:"inherit"})}),i.jsx(M,{onClick:ot,disabled:e||L,"data-testid":"stChatInputApproveButton","aria-label":"Submit recording",children:L?i.jsx(Ve,{size:"lg",iconValue:"spinner"}):i.jsx(V,{content:Oe,size:"lg",color:"inherit"})})]}):i.jsxs(i.Fragment,{children:[J&&i.jsx(i.Fragment,{children:_?i.jsx(ce,{content:_,placement:de.TOP,error:!0,children:i.jsx(M,{onClick:ze,disabled:e||L,hasError:!0,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:i.jsx(V,{content:Xe,size:"xl",color:"inherit"})})}):i.jsx(M,{onClick:ze,disabled:e||L,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:i.jsx(V,{content:De,size:"xl",color:"inherit"})})}),i.jsx(M,{onClick:be,disabled:!O||e||L,"data-testid":"stChatInputSubmitButton","aria-label":"Send message",primary:!0,children:i.jsx(V,{content:$e,size:"lg",color:"inherit"})})]})})]})]})})}const Ur=r.memo(jr);export{Ur as default};
@@ -0,0 +1,9 @@
1
+ function Ve(e,t){return function(){return e.apply(t,arguments)}}const{toString:bt}=Object.prototype,{getPrototypeOf:ge}=Object,{iterator:te,toStringTag:$e}=Symbol,re=(e=>t=>{const r=bt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),v=e=>(e=e.toLowerCase(),t=>re(t)===e),ne=e=>t=>typeof t===e,{isArray:q}=Array,k=ne("undefined");function z(e){return e!==null&&!k(e)&&e.constructor!==null&&!k(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ke=v("ArrayBuffer");function gt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ke(e.buffer),t}const yt=ne("string"),T=ne("function"),Xe=ne("number"),H=e=>e!==null&&typeof e=="object",wt=e=>e===!0||e===!1,Q=e=>{if(re(e)!=="object")return!1;const t=ge(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!($e in e)&&!(te in e)},Et=e=>{if(!H(e)||z(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Rt=v("Date"),Ot=v("File"),St=e=>!!(e&&typeof e.uri<"u"),Tt=e=>e&&typeof e.getParts<"u",At=v("Blob"),Ct=v("FileList"),vt=e=>H(e)&&T(e.pipe);function Nt(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const xe=Nt(),_e=typeof xe.FormData<"u"?xe.FormData:void 0,xt=e=>{let t;return e&&(_e&&e instanceof _e||T(e.append)&&((t=re(e))==="formdata"||t==="object"&&T(e.toString)&&e.toString()==="[object FormData]"))},_t=v("URLSearchParams"),[Pt,jt,Ut,Ft]=["ReadableStream","Request","Response","Headers"].map(v),Lt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function J(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),q(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(z(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let c;for(n=0;n<s;n++)c=i[n],t.call(null,e[c],c,e)}}function Ge(e,t){if(z(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const F=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Qe=e=>!k(e)&&e!==F;function pe(){const{caseless:e,skipUndefined:t}=Qe(this)&&this||{},r={},n=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=e&&Ge(r,i)||i;Q(r[s])&&Q(o)?r[s]=pe(r[s],o):Q(o)?r[s]=pe({},o):q(o)?r[s]=o.slice():(!t||!k(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&J(arguments[o],n);return r}const Dt=(e,t,r,{allOwnKeys:n}={})=>(J(t,(o,i)=>{r&&T(o)?Object.defineProperty(e,i,{value:Ve(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Bt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),kt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},qt=(e,t,r,n)=>{let o,i,s;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=r!==!1&&ge(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},It=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Mt=e=>{if(!e)return null;if(q(e))return e;let t=e.length;if(!Xe(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},zt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ge(Uint8Array)),Ht=(e,t)=>{const r=(e&&e[te]).call(e);let n;for(;(n=r.next())&&!n.done;){const o=n.value;t.call(e,o[0],o[1])}},Jt=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Wt=v("HTMLFormElement"),Vt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),Pe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$t=v("RegExp"),Ye=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};J(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Kt=e=>{Ye(e,(t,r)=>{if(T(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(T(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Xt=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return q(e)?n(e):n(String(e).split(t)),r},Gt=()=>{},Qt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Yt(e){return!!(e&&T(e.append)&&e[$e]==="FormData"&&e[te])}const Zt=e=>{const t=new Array(10),r=(n,o)=>{if(H(n)){if(t.indexOf(n)>=0)return;if(z(n))return n;if(!("toJSON"in n)){t[o]=n;const i=q(n)?[]:{};return J(n,(s,c)=>{const f=r(s,o+1);!k(f)&&(i[c]=f)}),t[o]=void 0,i}}return n};return r(e,0)},er=v("AsyncFunction"),tr=e=>e&&(H(e)||T(e))&&T(e.then)&&T(e.catch),Ze=((e,t)=>e?setImmediate:t?((r,n)=>(F.addEventListener("message",({source:o,data:i})=>{o===F&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),F.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",T(F.postMessage)),rr=typeof queueMicrotask<"u"?queueMicrotask.bind(F):typeof process<"u"&&process.nextTick||Ze,nr=e=>e!=null&&T(e[te]),a={isArray:q,isArrayBuffer:Ke,isBuffer:z,isFormData:xt,isArrayBufferView:gt,isString:yt,isNumber:Xe,isBoolean:wt,isObject:H,isPlainObject:Q,isEmptyObject:Et,isReadableStream:Pt,isRequest:jt,isResponse:Ut,isHeaders:Ft,isUndefined:k,isDate:Rt,isFile:Ot,isReactNativeBlob:St,isReactNative:Tt,isBlob:At,isRegExp:$t,isFunction:T,isStream:vt,isURLSearchParams:_t,isTypedArray:zt,isFileList:Ct,forEach:J,merge:pe,extend:Dt,trim:Lt,stripBOM:Bt,inherits:kt,toFlatObject:qt,kindOf:re,kindOfTest:v,endsWith:It,toArray:Mt,forEachEntry:Ht,matchAll:Jt,isHTMLForm:Wt,hasOwnProperty:Pe,hasOwnProp:Pe,reduceDescriptors:Ye,freezeMethods:Kt,toObjectSet:Xt,toCamelCase:Vt,noop:Gt,toFiniteNumber:Qt,findKey:Ge,global:F,isContextDefined:Qe,isSpecCompliantForm:Yt,toJSONObject:Zt,isAsyncFn:er,isThenable:tr,setImmediate:Ze,asap:rr,isIterable:nr};let m=class et extends Error{static from(t,r,n,o,i,s){const c=new et(t.message,r||t.code,n,o,i);return c.cause=t,c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),s&&Object.assign(c,s),c}constructor(t,r,n,o,i){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}};m.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";m.ERR_BAD_OPTION="ERR_BAD_OPTION";m.ECONNABORTED="ECONNABORTED";m.ETIMEDOUT="ETIMEDOUT";m.ERR_NETWORK="ERR_NETWORK";m.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";m.ERR_DEPRECATED="ERR_DEPRECATED";m.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";m.ERR_BAD_REQUEST="ERR_BAD_REQUEST";m.ERR_CANCELED="ERR_CANCELED";m.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";m.ERR_INVALID_URL="ERR_INVALID_URL";const or=null;function he(e){return a.isPlainObject(e)||a.isArray(e)}function tt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function le(e,t,r){return e?e.concat(t).map(function(n,o){return n=tt(n),!r&&o?"["+n+"]":n}).join(r?".":""):t}function sr(e){return a.isArray(e)&&!e.some(he)}const ir=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function oe(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,p){return!a.isUndefined(p[h])});const n=r.metaTokens,o=r.visitor||l,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function f(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!c&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,p,d){let y=h;if(a.isReactNative(t)&&a.isReactNativeBlob(h))return t.append(le(d,p,i),f(h)),!1;if(h&&!d&&typeof h=="object"){if(a.endsWith(p,"{}"))p=n?p:p.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&sr(h)||(a.isFileList(h)||a.endsWith(p,"[]"))&&(y=a.toArray(h)))return p=tt(p),y.forEach(function(R,E){!(a.isUndefined(R)||R===null)&&t.append(s===!0?le([p],E,i):s===null?p:p+"[]",f(R))}),!1}return he(h)?!0:(t.append(le(d,p,i),f(h)),!1)}const u=[],b=Object.assign(ir,{defaultVisitor:l,convertValue:f,isVisitable:he});function g(h,p){if(!a.isUndefined(h)){if(u.indexOf(h)!==-1)throw Error("Circular reference detected in "+p.join("."));u.push(h),a.forEach(h,function(d,y){(!(a.isUndefined(d)||d===null)&&o.call(t,d,a.isString(y)?y.trim():y,p,b))===!0&&g(d,p?p.concat(y):[y])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ye(e,t){this._pairs=[],e&&oe(e,this,t)}const rt=ye.prototype;rt.append=function(e,t){this._pairs.push([e,t])};rt.toString=function(e){const t=e?function(r){return e.call(this,r,je)}:je;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function ar(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nt(e,t,r){if(!t)return e;const n=r&&r.encode||ar,o=a.isFunction(r)?{serialize:r}:r,i=o&&o.serialize;let s;if(i?s=i(t,o):s=a.isURLSearchParams(t)?t.toString():new ye(t,o).toString(n),s){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Ue{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const we={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},cr=typeof URLSearchParams<"u"?URLSearchParams:ye,lr=typeof FormData<"u"?FormData:null,ur=typeof Blob<"u"?Blob:null,fr={isBrowser:!0,classes:{URLSearchParams:cr,FormData:lr,Blob:ur},protocols:["http","https","file","blob","url","data"]},Ee=typeof window<"u"&&typeof document<"u",me=typeof navigator=="object"&&navigator||void 0,dr=Ee&&(!me||["ReactNative","NativeScript","NS"].indexOf(me.product)<0),pr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hr=Ee&&window.location.href||"http://localhost",mr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ee,hasStandardBrowserEnv:dr,hasStandardBrowserWebWorkerEnv:pr,navigator:me,origin:hr},Symbol.toStringTag,{value:"Module"})),O={...mr,...fr};function br(e,t){return oe(e,new O.classes.URLSearchParams,{visitor:function(r,n,o,i){return O.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function gr(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function yr(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function ot(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const c=Number.isFinite(+s),f=i>=r.length;return s=!s&&a.isArray(o)?o.length:s,f?(a.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!c):((!o[s]||!a.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&a.isArray(o[s])&&(o[s]=yr(o[s])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const r={};return a.forEachEntry(e,(n,o)=>{t(gr(n),o,r,0)}),r}return null}function wr(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const W={transitional:we,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=a.isObject(e);if(o&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return n?JSON.stringify(ot(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return br(e,this.formSerializer).toString();if((i=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){const s=this.env&&this.env.FormData;return oe(i?{"files[]":e}:e,s&&new s,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),wr(e)):e}],transformResponse:[function(e){const t=this.transitional||W.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||n)){const o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(i){if(o)throw i.name==="SyntaxError"?m.from(i,m.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{W.headers[e]={}});const Er=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rr=e=>{const t={};let r,n,o;return e&&e.split(`
2
+ `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Er[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Fe=Symbol("internals"),Or=e=>!/[\r\n]/.test(e);function st(e,t){if(!(e===!1||e==null)){if(a.isArray(e)){e.forEach(r=>st(r,t));return}if(!Or(String(e)))throw new Error(`Invalid character in header content ["${t}"]`)}}function M(e){return e&&String(e).trim().toLowerCase()}function Sr(e){let t=e.length;for(;t>0;){const r=e.charCodeAt(t-1);if(r!==10&&r!==13)break;t-=1}return t===e.length?e:e.slice(0,t)}function Y(e){return e===!1||e==null?e:a.isArray(e)?e.map(Y):Sr(String(e))}function Tr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Ar=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ue(e,t,r,n,o){if(a.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!a.isString(t)){if(a.isString(n))return t.indexOf(n)!==-1;if(a.isRegExp(n))return n.test(t)}}function Cr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function vr(e,t){const r=a.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let A=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(s,c,f){const l=M(c);if(!l)throw new Error("header name must be a non-empty string");const u=a.findKey(n,l);(!u||n[u]===void 0||f===!0||f===void 0&&n[u]!==!1)&&(st(s,c),n[u||c]=Y(s))}const i=(s,c)=>a.forEach(s,(f,l)=>o(f,l,c));if(a.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(a.isString(e)&&(e=e.trim())&&!Ar(e))i(Rr(e),t);else if(a.isObject(e)&&a.isIterable(e)){let s={},c,f;for(const l of e){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");s[f=l[0]]=(c=s[f])?a.isArray(c)?[...c,l[1]]:[c,l[1]]:l[1]}i(s,t)}else e!=null&&o(t,e,r);return this}get(e,t){if(e=M(e),e){const r=a.findKey(this,e);if(r){const n=this[r];if(!t)return n;if(t===!0)return Tr(n);if(a.isFunction(t))return t.call(this,n,r);if(a.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=M(e),e){const r=a.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||ue(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let n=!1;function o(i){if(i=M(i),i){const s=a.findKey(r,i);s&&(!t||ue(r,r[s],s,t))&&(delete r[s],n=!0)}}return a.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];(!e||ue(this,this[o],o,e,!0))&&(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return a.forEach(this,(n,o)=>{const i=a.findKey(r,o);if(i){t[i]=Y(n),delete t[o];return}const s=e?Cr(o):String(o).trim();s!==o&&delete t[o],t[s]=Y(n),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return a.forEach(this,(r,n)=>{r!=null&&r!==!1&&(t[n]=e&&a.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(n=>r.set(n)),r}static accessor(e){const t=(this[Fe]=this[Fe]={accessors:{}}).accessors,r=this.prototype;function n(o){const i=M(o);t[i]||(vr(r,o),t[i]=!0)}return a.isArray(e)?e.forEach(n):n(e),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(A.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});a.freezeMethods(A);function fe(e,t){const r=this||W,n=t||r,o=A.from(n.headers);let i=n.data;return a.forEach(e,function(s){i=s.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function it(e){return!!(e&&e.__CANCEL__)}let V=class extends m{constructor(e,t,r){super(e??"canceled",m.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function at(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new m("Request failed with status code "+r.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Nr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),l=n[i];s||(s=f),r[o]=c,n[o]=f;let u=i,b=0;for(;u!==o;)b+=r[u++],u=u%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),f-s<t)return;const g=l&&f-l;return g?Math.round(b*1e3/g):void 0}}function _r(e,t){let r=0,n=1e3/t,o,i;const s=(c,f=Date.now())=>{r=f,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const f=Date.now(),l=f-r;l>=n?s(c,f):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},n-l)))},()=>o&&s(o)]}const ee=(e,t,r=3)=>{let n=0;const o=xr(50,250);return _r(i=>{const s=i.loaded,c=i.lengthComputable?i.total:void 0,f=s-n,l=o(f),u=s<=c;n=s;const b={loaded:s,total:c,progress:c?s/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-s)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(b)},r)},Le=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},De=e=>(...t)=>a.asap(()=>e(...t)),Pr=O.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,O.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,jr=O.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(o)&&c.push(`domain=${o}`),i===!0&&c.push("secure"),a.isString(s)&&c.push(`SameSite=${s}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ur(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Fr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ct(e,t,r){let n=!Ur(t);return e&&(n||r==!1)?Fr(e,t):t}const Be=e=>e instanceof A?{...e}:e;function D(e,t){t=t||{};const r={};function n(l,u,b,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function o(l,u,b,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l,b,g)}else return n(l,u,b,g)}function i(l,u){if(!a.isUndefined(u))return n(void 0,u)}function s(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function c(l,u,b){if(b in t)return n(l,u);if(b in e)return n(void 0,l)}const f={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c,headers:(l,u,b)=>o(Be(l),Be(u),b,!0)};return a.forEach(Object.keys({...e,...t}),function(l){if(l==="__proto__"||l==="constructor"||l==="prototype")return;const u=a.hasOwnProp(f,l)?f[l]:o,b=u(e[l],t[l],l);a.isUndefined(b)&&u!==c||(r[l]=b)}),r}const lt=e=>{const t=D({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:c}=t;if(t.headers=s=A.from(s),t.url=nt(ct(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(a.isFunction(r.getHeaders)){const f=r.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,b])=>{l.includes(u.toLowerCase())&&s.set(u,b)})}}if(O.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(t)),n||n!==!1&&Pr(t.url))){const f=o&&i&&jr.read(i);f&&s.set(o,f)}return t},Lr=typeof XMLHttpRequest<"u",Dr=Lr&&function(e){return new Promise(function(t,r){const n=lt(e);let o=n.data;const i=A.from(n.headers).normalize();let{responseType:s,onUploadProgress:c,onDownloadProgress:f}=n,l,u,b,g,h;function p(){g&&g(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(l),n.signal&&n.signal.removeEventListener("abort",l)}let d=new XMLHttpRequest;d.open(n.method.toUpperCase(),n.url,!0),d.timeout=n.timeout;function y(){if(!d)return;const E=A.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),N={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:E,config:e,request:d};at(function(x){t(x),p()},function(x){r(x),p()},N),d=null}"onloadend"in d?d.onloadend=y:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(y)},d.onabort=function(){d&&(r(new m("Request aborted",m.ECONNABORTED,e,d)),d=null)},d.onerror=function(E){const N=E&&E.message?E.message:"Network Error",x=new m(N,m.ERR_NETWORK,e,d);x.event=E||null,r(x),d=null},d.ontimeout=function(){let E=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const N=n.transitional||we;n.timeoutErrorMessage&&(E=n.timeoutErrorMessage),r(new m(E,N.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,d)),d=null},o===void 0&&i.setContentType(null),"setRequestHeader"in d&&a.forEach(i.toJSON(),function(E,N){d.setRequestHeader(N,E)}),a.isUndefined(n.withCredentials)||(d.withCredentials=!!n.withCredentials),s&&s!=="json"&&(d.responseType=n.responseType),f&&([b,h]=ee(f,!0),d.addEventListener("progress",b)),c&&d.upload&&([u,g]=ee(c),d.upload.addEventListener("progress",u),d.upload.addEventListener("loadend",g)),(n.cancelToken||n.signal)&&(l=E=>{d&&(r(!E||E.type?new V(null,e,d):E),d.abort(),d=null)},n.cancelToken&&n.cancelToken.subscribe(l),n.signal&&(n.signal.aborted?l():n.signal.addEventListener("abort",l)));const R=Nr(n.url);if(R&&O.protocols.indexOf(R)===-1){r(new m("Unsupported protocol "+R+":",m.ERR_BAD_REQUEST,e));return}d.send(o||null)})},Br=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(l){if(!o){o=!0,c();const u=l instanceof Error?l:this.reason;n.abort(u instanceof m?u:new V(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new m(`timeout of ${t}ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:f}=n;return f.unsubscribe=()=>a.asap(c),f}},kr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},qr=async function*(e,t){for await(const r of Ir(e))yield*kr(r,t)},Ir=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},ke=(e,t,r,n)=>{const o=qr(e,t);let i=0,s,c=f=>{s||(s=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await o.next();if(l){c(),f.close();return}let b=u.byteLength;if(r){let g=i+=b;r(g)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),o.return()}},{highWaterMark:2})},qe=64*1024,{isFunction:G}=a,Mr=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Ie,TextEncoder:Me}=a.global,ze=(e,...t)=>{try{return!!e(...t)}catch{return!1}},zr=e=>{e=a.merge.call({skipUndefined:!0},Mr,e);const{fetch:t,Request:r,Response:n}=e,o=t?G(t):typeof fetch=="function",i=G(r),s=G(n);if(!o)return!1;const c=o&&G(Ie),f=o&&(typeof Me=="function"?(p=>d=>p.encode(d))(new Me):async p=>new Uint8Array(await new r(p).arrayBuffer())),l=i&&c&&ze(()=>{let p=!1;const d=new Ie,y=new r(O.origin,{body:d,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return d.cancel(),p&&!y}),u=s&&c&&ze(()=>a.isReadableStream(new n("").body)),b={stream:u&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!b[p]&&(b[p]=(d,y)=>{let R=d&&d[p];if(R)return R.call(d);throw new m(`Response type '${p}' is not supported`,m.ERR_NOT_SUPPORT,y)})});const g=async p=>{if(p==null)return 0;if(a.isBlob(p))return p.size;if(a.isSpecCompliantForm(p))return(await new r(O.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(a.isArrayBufferView(p)||a.isArrayBuffer(p))return p.byteLength;if(a.isURLSearchParams(p)&&(p=p+""),a.isString(p))return(await f(p)).byteLength},h=async(p,d)=>a.toFiniteNumber(p.getContentLength())??g(d);return async p=>{let{url:d,method:y,data:R,signal:E,cancelToken:N,timeout:x,onDownloadProgress:ie,onUploadProgress:Oe,responseType:_,headers:ae,withCredentials:$="same-origin",fetchOptions:Se}=lt(p),Te=t||fetch;_=_?(_+"").toLowerCase():"text";let K=Br([E,N&&N.toAbortSignal()],x),I=null;const U=K&&K.unsubscribe&&(()=>{K.unsubscribe()});let Ae;try{if(Oe&&l&&y!=="get"&&y!=="head"&&(Ae=await h(ae,R))!==0){let j=new r(d,{method:"POST",body:R,duplex:"half"}),B;if(a.isFormData(R)&&(B=j.headers.get("content-type"))&&ae.setContentType(B),j.body){const[ce,X]=Le(Ae,ee(De(Oe)));R=ke(j.body,qe,ce,X)}}a.isString($)||($=$?"include":"omit");const S=i&&"credentials"in r.prototype,Ce={...Se,signal:K,method:y.toUpperCase(),headers:ae.normalize().toJSON(),body:R,duplex:"half",credentials:S?$:void 0};I=i&&new r(d,Ce);let P=await(i?Te(I,Se):Te(d,Ce));const ve=u&&(_==="stream"||_==="response");if(u&&(ie||ve&&U)){const j={};["status","statusText","headers"].forEach(Ne=>{j[Ne]=P[Ne]});const B=a.toFiniteNumber(P.headers.get("content-length")),[ce,X]=ie&&Le(B,ee(De(ie),!0))||[];P=new n(ke(P.body,qe,ce,()=>{X&&X(),U&&U()}),j)}_=_||"text";let mt=await b[a.findKey(b,_)||"text"](P,p);return!ve&&U&&U(),await new Promise((j,B)=>{at(j,B,{data:mt,headers:A.from(P.headers),status:P.status,statusText:P.statusText,config:p,request:I})})}catch(S){throw U&&U(),S&&S.name==="TypeError"&&/Load failed|fetch/i.test(S.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,p,I,S&&S.response),{cause:S.cause||S}):m.from(S,S&&S.code,p,I,S&&S.response)}}},Hr=new Map,ut=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,c=s,f,l,u=Hr;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:zr(t)),u=l;return l};ut();const Re={http:or,xhr:Dr,fetch:{get:ut}};a.forEach(Re,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const He=e=>`- ${e}`,Jr=e=>a.isFunction(e)||e===null||e===!1;function Wr(e,t){e=a.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let c;if(o=n,!Jr(n)&&(o=Re[(c=String(n)).toLowerCase()],o===void 0))throw new m(`Unknown adapter '${c}'`);if(o&&(a.isFunction(o)||(o=o.get(t))))break;i[c||"#"+s]=o}if(!o){const s=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=r?s.length>1?`since :
4
+ `+s.map(He).join(`
5
+ `):" "+He(s[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}const ft={getAdapter:Wr,adapters:Re};function de(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new V(null,e)}function Je(e){return de(e),e.headers=A.from(e.headers),e.data=fe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ft.getAdapter(e.adapter||W.adapter,e)(e).then(function(t){return de(e),t.data=fe.call(e,e.transformResponse,t),t.headers=A.from(t.headers),t},function(t){return it(t)||(de(e),t&&t.response&&(t.response.data=fe.call(e,e.transformResponse,t.response),t.response.headers=A.from(t.response.headers))),Promise.reject(t)})}const dt="1.15.0",se={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{se[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const We={};se.transitional=function(e,t,r){function n(o,i){return"[Axios v"+dt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,s)=>{if(e===!1)throw new m(n(i," has been removed"+(t?" in "+t:"")),m.ERR_DEPRECATED);return t&&!We[i]&&(We[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,i,s):!0}};se.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Vr(e,t,r){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const c=e[i],f=c===void 0||s(c,i,e);if(f!==!0)throw new m("option "+i+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const Z={assertOptions:Vr,validators:se},C=Z.validators;let L=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ue,response:new Ue}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const o=(()=>{if(!n.stack)return"";const i=n.stack.indexOf(`
6
+ `);return i===-1?"":n.stack.slice(i+1)})();try{if(!r.stack)r.stack=o;else if(o){const i=o.indexOf(`
7
+ `),s=i===-1?-1:o.indexOf(`
8
+ `,i+1),c=s===-1?"":o.slice(s+1);String(r.stack).endsWith(c)||(r.stack+=`
9
+ `+o)}}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=D(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;r!==void 0&&Z.assertOptions(r,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean),legacyInterceptorReqResOrdering:C.transitional(C.boolean)},!1),n!=null&&(a.isFunction(n)?t.paramsSerializer={serialize:n}:Z.assertOptions(n,{encode:C.function,serialize:C.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Z.assertOptions(t,{baseUrl:C.spelling("baseURL"),withXsrfToken:C.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[t.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),t.headers=A.concat(i,o);const s=[];let c=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(t)===!1)return;c=c&&h.synchronous;const p=t.transitional||we;p&&p.legacyInterceptorReqResOrdering?s.unshift(h.fulfilled,h.rejected):s.push(h.fulfilled,h.rejected)});const f=[];this.interceptors.response.forEach(function(h){f.push(h.fulfilled,h.rejected)});let l,u=0,b;if(!c){const h=[Je.bind(this),void 0];for(h.unshift(...s),h.push(...f),b=h.length,l=Promise.resolve(t);u<b;)l=l.then(h[u++],h[u++]);return l}b=s.length;let g=t;for(;u<b;){const h=s[u++],p=s[u++];try{g=h(g)}catch(d){p.call(this,d);break}}try{l=Je.call(this,g)}catch(h){return Promise.reject(h)}for(u=0,b=f.length;u<b;)l=l.then(f[u++],f[u++]);return l}getUri(e){e=D(this.defaults,e);const t=ct(e.baseURL,e.url,e.allowAbsoluteUrls);return nt(t,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){L.prototype[e]=function(t,r){return this.request(D(r||{},{method:e,url:t,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(e){function t(r){return function(n,o,i){return this.request(D(i||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}L.prototype[e]=t(),L.prototype[e+"Form"]=t(!0)});let $r=class pt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(c=>{n.subscribe(c),i=c}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(o,i,s){n.reason||(n.reason=new V(o,i,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new pt(function(r){t=r}),cancel:t}}};function Kr(e){return function(t){return e.apply(null,t)}}function Xr(e){return a.isObject(e)&&e.isAxiosError===!0}const be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(be).forEach(([e,t])=>{be[t]=e});function ht(e){const t=new L(e),r=Ve(L.prototype.request,t);return a.extend(r,L.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return ht(D(e,n))},r}const w=ht(W);w.Axios=L;w.CanceledError=V;w.CancelToken=$r;w.isCancel=it;w.VERSION=dt;w.toFormData=oe;w.AxiosError=m;w.Cancel=w.CanceledError;w.all=function(e){return Promise.all(e)};w.spread=Kr;w.isAxiosError=Xr;w.mergeConfig=D;w.AxiosHeaders=A;w.formToJSON=e=>ot(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=ft.getAdapter;w.HttpStatusCode=be;w.default=w;const{Axios:Gr,AxiosError:Qr,CanceledError:Yr,isCancel:Zr,CancelToken:en,VERSION:tn,all:rn,Cancel:nn,isAxiosError:on,spread:sn,toFormData:an,AxiosHeaders:cn,HttpStatusCode:ln,formToJSON:un,getAdapter:fn,mergeConfig:dn}=w;export{Gr as Axios,Qr as AxiosError,cn as AxiosHeaders,nn as Cancel,en as CancelToken,Yr as CanceledError,ln as HttpStatusCode,tn as VERSION,rn as all,w as default,un as formToJSON,fn as getAdapter,on as isAxiosError,Zr as isCancel,dn as mergeConfig,sn as spread,an as toFormData};
@@ -0,0 +1,2 @@
1
+ import{r as s,j as p,x as L,B as ie,ae as le,N as ce,F as k,af as V,a4 as ue,$ as de,d0 as ge,d1 as W,bf as J}from"./index-DegoUuPm.js";function fe(e,t,r,n){for(var o=-1,a=e==null?0:e.length;++o<a;)r=t(r,e[o],o,e);return r}function me(e){return function(t){return e?.[t]}}var he={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ce=me(he),pe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xe="\\u0300-\\u036f",Se="\\ufe20-\\ufe2f",ye="\\u20d0-\\u20ff",Fe=xe+Se+ye,be="["+Fe+"]",we=RegExp(be,"g");function Ee(e){return e=J(e),e&&e.replace(pe,Ce).replace(we,"")}var Ie=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Be(e){return e.match(Ie)||[]}var ve=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Re(e){return ve.test(e)}var P="\\ud800-\\udfff",je="\\u0300-\\u036f",ke="\\ufe20-\\ufe2f",ze="\\u20d0-\\u20ff",Te=je+ke+ze,_="\\u2700-\\u27bf",D="a-z\\xdf-\\xf6\\xf8-\\xff",We="\\xac\\xb1\\xd7\\xf7",Me="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ae="\\u2000-\\u206f",$e=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Z="A-Z\\xc0-\\xd6\\xd8-\\xde",Ne="\\ufe0e\\ufe0f",H=We+Me+Ae+$e,q="['’]",M="["+H+"]",Ue="["+Te+"]",G="\\d+",Oe="["+_+"]",Y="["+D+"]",K="[^"+P+H+G+_+D+Z+"]",Le="\\ud83c[\\udffb-\\udfff]",Ve="(?:"+Ue+"|"+Le+")",Je="[^"+P+"]",Q="(?:\\ud83c[\\udde6-\\uddff]){2}",X="[\\ud800-\\udbff][\\udc00-\\udfff]",E="["+Z+"]",Pe="\\u200d",A="(?:"+Y+"|"+K+")",_e="(?:"+E+"|"+K+")",$="(?:"+q+"(?:d|ll|m|re|s|t|ve))?",N="(?:"+q+"(?:D|LL|M|RE|S|T|VE))?",ee=Ve+"?",te="["+Ne+"]?",De="(?:"+Pe+"(?:"+[Je,Q,X].join("|")+")"+te+ee+")*",Ze="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",He="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qe=te+ee+De,Ge="(?:"+[Oe,Q,X].join("|")+")"+qe,Ye=RegExp([E+"?"+Y+"+"+$+"(?="+[M,E,"$"].join("|")+")",_e+"+"+N+"(?="+[M,E+A,"$"].join("|")+")",E+"?"+A+"+"+$,E+"+"+N,He,Ze,G,Ge].join("|"),"g");function Ke(e){return e.match(Ye)||[]}function Qe(e,t,r){return e=J(e),t=t,t===void 0?Re(e)?Ke(e):Be(e):e.match(t)||[]}var Xe="['’]",et=RegExp(Xe,"g");function tt(e){return function(t){return fe(Qe(Ee(t).replace(et,"")),e,"")}}var rt=tt(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()});const B=s.createContext(null);B.displayName="BidiComponentContext";const I=ie.getLogger("BidiComponent"),U="__",R="__streamlit_arrow_ref__",ot="$$STREAMLIT_INTERNAL_KEY",nt=(e,t)=>{if(e&&typeof e=="object"&&!Array.isArray(e)){if(typeof e[R]=="string"){const n=e[R],o=t[n];if(o)try{return W(o)}catch{return null}return null}const r={};for(const[n,o]of Object.entries(e))if(o&&typeof o=="object"&&!Array.isArray(o)&&typeof o[R]=="string"){const a=o[R],i=t[a];if(i)try{r[n]=W(i)}catch{r[n]=null}else r[n]=null}else r[n]=o;return r}return e},at=({arrowBlobs:e,arrowData:t,bytes:r,data:n,json:o,mixedJson:a})=>{switch(n){case"json":return o?JSON.parse(o):null;case"arrowData":return t??null;case"bytes":return r??null;case"mixed":{if(a&&e){const i=JSON.parse(a),l={};return Object.entries(e).forEach(([g,u])=>{u?.data&&(l[g]=u.data)}),nt(i,l)}return null}case"any":case void 0:return null;default:ue(n)}},st=(e,t="--st")=>{const r={};return Object.entries(e).forEach(([n,o])=>{const a=rt(n),i=`${t}-${a}`;if(typeof o=="boolean"){r[i]=o?"1":"0";return}if(o==null){r[i]="unset";return}if(Array.isArray(o)){r[i]=o.join(",");return}if(typeof o=="number"||typeof o=="string"){r[i]=String(o);return}r[i]="unset"}),r},it=e=>{const t=[e.fontSizes.h1FontSize,e.fontSizes.h2FontSize,e.fontSizes.h3FontSize,e.fontSizes.h4FontSize,e.fontSizes.h5FontSize,e.fontSizes.h6FontSize],r=[e.fontWeights.h1FontWeight,e.fontWeights.h2FontWeight,e.fontWeights.h3FontWeight,e.fontWeights.h4FontWeight,e.fontWeights.h5FontWeight,e.fontWeights.h6FontWeight];return{primaryColor:e.colors.primary,backgroundColor:e.colors.bgColor,secondaryBackgroundColor:e.colors.secondaryBg,textColor:e.colors.bodyText,linkColor:e.colors.link,linkUnderline:e.linkUnderline,headingFont:e.genericFonts.headingFont,codeFont:e.genericFonts.codeFont,baseRadius:e.radii.default,buttonRadius:e.radii.button,baseFontSize:typeof e.fontSizes.baseFontSize=="number"?`${e.fontSizes.baseFontSize}px`:String(e.fontSizes.baseFontSize),baseFontWeight:e.fontWeights.normal,codeFontWeight:e.fontWeights.code,codeFontSize:e.fontSizes.codeFontSize,headingFontSizes:t,headingFontSize1:t[0],headingFontSize2:t[1],headingFontSize3:t[2],headingFontSize4:t[3],headingFontSize5:t[4],headingFontSize6:t[5],headingFontWeights:r,headingFontWeight1:r[0],headingFontWeight2:r[1],headingFontWeight3:r[2],headingFontWeight4:r[3],headingFontWeight5:r[4],headingFontWeight6:r[5],borderColor:e.colors.borderColor,dataframeBorderColor:e.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:e.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:e.colors.codeBackgroundColor,font:e.genericFonts.bodyFont,chartCategoricalColors:e.colors.chartCategoricalColors,chartSequentialColors:e.colors.chartSequentialColors,chartDivergingColors:e.colors.chartDivergingColors,headingColor:e.colors.headingColor,borderColorLight:e.colors.borderColorLight,codeTextColor:e.colors.codeTextColor,widgetBorderColor:e.colors.widgetBorderColor||"transparent",redColor:e.colors.redColor,orangeColor:e.colors.orangeColor,yellowColor:e.colors.yellowColor,blueColor:e.colors.blueColor,greenColor:e.colors.greenColor,violetColor:e.colors.violetColor,grayColor:e.colors.grayColor,redBackgroundColor:e.colors.redBackgroundColor,orangeBackgroundColor:e.colors.orangeBackgroundColor,yellowBackgroundColor:e.colors.yellowBackgroundColor,blueBackgroundColor:e.colors.blueBackgroundColor,greenBackgroundColor:e.colors.greenBackgroundColor,violetBackgroundColor:e.colors.violetBackgroundColor,grayBackgroundColor:e.colors.grayBackgroundColor,redTextColor:e.colors.redTextColor,orangeTextColor:e.colors.orangeTextColor,yellowTextColor:e.colors.yellowTextColor,blueTextColor:e.colors.blueTextColor,greenTextColor:e.colors.greenTextColor,violetTextColor:e.colors.violetTextColor,grayTextColor:e.colors.grayTextColor,metricValueFontSize:e.metricValueFontSize??null,metricValueFontWeight:e.metricValueFontWeight??null}},lt=s.memo(({element:e,children:t,widgetMgr:r,fragmentId:n,componentRegistry:o})=>{const{arrowData:a,bytes:i,componentName:l,cssContent:g,cssSourcePath:u,data:d,htmlContent:m,id:c,jsContent:C,json:x,jsSourcePath:f,mixed:S}=e,w=s.useMemo(()=>({id:e.id,formId:e.formId}),[e.id,e.formId]),v=s.useCallback(()=>{const F=r.getJsonValue(w);if(!F)return{};try{return JSON.parse(F)}catch(ae){const se=le(ae);return I.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:w.id,formId:w.formId,error:se.message}),{}}},[w,r]),b=s.useMemo(()=>at({arrowBlobs:S?.arrowBlobs||void 0,arrowData:a?.data||void 0,bytes:i,data:d,json:x,mixedJson:S?.json||void 0}),[d,x,a?.data,i,S?.json,S?.arrowBlobs]),h=ce(),y=s.useMemo(()=>it(h),[h]),z=s.useMemo(()=>({componentName:l,componentRegistry:o,cssContent:g?.trim(),cssSourcePath:u||void 0,data:b,fragmentId:n,getWidgetValue:v,htmlContent:m?.trim(),id:c,formId:e.formId||void 0,jsContent:C||void 0,jsSourcePath:f||void 0,theme:y,widgetMgr:r}),[l,o,g,u,n,v,m,c,e.formId,C,f,b,y,r]);return p.jsx(B.Provider,{value:z,children:t})}),re=(e,t)=>{if(e instanceof Error)return e;const r=t?`${t}: ${String(e)}`:String(e);return new Error(r)},j=(e,t,r)=>{const n=re(e,r);I.error(`BidiComponent Error: ${n.message}`,e),t(n)},ct=(e,t)=>{try{const r=document.createRange().createContextualFragment(e);t.appendChild(r)}catch(r){I.warn("createContextualFragment failed, falling back to innerHTML",r),t.innerHTML=e}},oe=({containerRef:e,setError:t,skip:r=!1})=>{const n=s.useRef(null),{htmlContent:o,cssContent:a,cssSourcePath:i,componentName:l,componentRegistry:{getBidiComponentURL:g}}=k(B),u=s.useMemo(()=>{if(i)return g(l,i)},[l,i,g]),d=de(u);return s.useEffect(()=>{if(r)return;const m=e.current;if(m)try{if(n.current?.parentNode===m&&m.removeChild(n.current),n.current=document.createElement("div"),o){const c=document.createElement("div");ct(o,c),n.current.appendChild(c)}if(a){const c=document.createElement("style");c.textContent=a,n.current.appendChild(c)}else if(u){const c=document.createElement("link");c.href=u,c.rel="stylesheet",d&&(c.crossOrigin=d),c.onerror=()=>{j(new Error(`Failed to load CSS from ${u}`),t)},n.current.appendChild(c)}m.appendChild(n.current)}catch(c){j(c,t,"Failed to process HTML/CSS content")}},[o,a,e,d,u,t,r]),n};class ut{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(t){let r=this.hashSeed;for(let n=0;n<t.length;n++)r^=t.charCodeAt(n),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(t,r){const n=this.computeHash(t),o=this.cache.get(n);if(o)return{url:o,hash:n};const a=`${t}
2
+ //# sourceURL=${r}-${n}.js`,i=new Blob([a],{type:"text/javascript"}),l=URL.createObjectURL(i);return this.cache.set(n,l),{url:l,hash:n}}}const dt=new ut,gt="events";function ft(e){if(e.includes(U))throw new Error("Base component id must not contain the delimiter sequence");return`${ot}_${e}${U}${gt}`}const O=async({componentId:e,componentIdForWidgetMgr:t,componentName:r,data:n,formId:o,fragmentId:a,getWidgetValue:i,moduleUrl:l,parentElement:g,widgetMgr:u})=>{const d=await import(l);if(!d)throw new Error("JS module does not exist.");if(!d.default||typeof d.default!="function")throw new Error("JS module does not have a default export function.");const m=(C,x)=>{let f={};try{f={...i(),[C]:x}}catch(S){I.error(`Failed to get existing value for ${C}`,S),f={[C]:x}}u.setJsonValue({id:t,formId:o},f,{fromUi:!0},a)},c=(C,x)=>{if(o){I.warn("BidiComponent: setTriggerValue ignored inside st.form. Triggers are not allowed in forms; use setStateValue and form submit instead.");return}const f=ft(t);u.setTriggerValue({id:f,formId:o},{fromUi:!0},a,{event:C,value:x})};return d.default({name:r,data:n,key:e,parentElement:g,setStateValue:m,setTriggerValue:c})},ne=({containerRef:e,setError:t,skip:r=!1})=>{const n=`st-bidi-component-${s.useMemo(()=>ge(),[])}`,{componentName:o,data:a,formId:i,fragmentId:l,getWidgetValue:g,id:u,jsContent:d,jsSourcePath:m,theme:c,widgetMgr:C,componentRegistry:{getBidiComponentURL:x}}=k(B),f=s.useMemo(()=>{if(m)return x(o,m)},[o,m,x]),S=s.useRef(),w=s.useRef(),v=s.useRef(!1);s.useEffect(()=>{const{current:b}=e;r||!d&&!f||!b||(async()=>{try{if(d){const{url:h}=dt.getOrCreateUrlForJs(d,`st-bidi-${o}`);S.current=await O({componentId:n,componentIdForWidgetMgr:u,componentName:o,data:a,formId:i,fragmentId:l,getWidgetValue:g,moduleUrl:h,parentElement:b,widgetMgr:C})}else if(f){const h=f;try{await new Promise((y,z)=>{const F=document.createElement("script");F.type="module",F.src=h,F.async=!0,F.onload=()=>y(),F.onerror=()=>z(new Error(`Failed to load script from ${f}`)),document.head.appendChild(F),w.current=F}),S.current=await O({componentId:n,componentIdForWidgetMgr:u,componentName:o,data:a,formId:i,fragmentId:l,getWidgetValue:g,moduleUrl:h,parentElement:b,widgetMgr:C})}catch(y){throw re(y,`Failed to load or execute script from ${f}`)}}}catch(h){v.current||j(h,t)}})()},[n,o,e,a,i,l,g,u,d,f,t,r,C,c]),s.useEffect(()=>()=>{v.current=!0;const b=S.current;b&&Promise.resolve(b).then(y=>{y?.()}).catch(y=>{I.error("Failed to run custom component cleanup",y)});const h=w.current;h?.parentNode&&h.parentNode.removeChild(h)},[])},mt=L("div",{target:"e1tun2hk1"})(({cssCustomProperties:e})=>({...e,display:"contents"}),""),T=L("div",{target:"e1tun2hk0"})({name:"w1atjl",styles:"width:100%;height:100%"}),ht=s.memo(()=>{const e=s.useRef(null),t=s.useRef(null),[r,n]=s.useState(!1),[o,a]=s.useState(null),{id:i}=k(B);s.useEffect(()=>{if(e.current)try{if(e.current.shadowRoot){t.current=e.current.shadowRoot,n(!0);return}t.current=e.current.attachShadow({mode:"open"}),n(!0)}catch(g){j(g,a,"Failed to create shadow DOM")}},[i]);const l=!r||!!o;return oe({containerRef:t,setError:a,skip:l}),ne({containerRef:t,setError:a,skip:l}),o?p.jsx(V,{name:"BidiComponent Error",message:o.message,stack:o.stack}):p.jsx(T,{ref:e,"data-testid":"stBidiComponentIsolated"})}),Ct=s.memo(()=>{const e=s.useRef(null),[t,r]=s.useState(null),n=!!t;return oe({containerRef:e,setError:r,skip:n}),ne({containerRef:e,setError:r,skip:n}),t?p.jsx(V,{name:"BidiComponent Error",message:t.message,stack:t.stack}):p.jsx(T,{ref:e,"data-testid":"stBidiComponentRegular"})}),pt=({children:e})=>{const{theme:t}=k(B),r=s.useMemo(()=>st(t),[t]);return p.jsx(mt,{cssCustomProperties:r,children:e})},xt=({element:e,widgetMgr:t,fragmentId:r,componentRegistry:n})=>{const{isolateStyles:o}=e;return p.jsx(lt,{element:e,widgetMgr:t,fragmentId:r,componentRegistry:n,children:p.jsx(T,{className:"stBidiComponent",children:p.jsx(pt,{children:o?p.jsx(ht,{}):p.jsx(Ct,{})})})})},yt=s.memo(xt);export{B as BidiComponentContext,yt as default};