efficient-shell 12.26.0 → 12.28.0

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 (210) hide show
  1. package/dist/{Browser-3CEYK5AG.js → Browser-PC45PVTN.js} +15 -15
  2. package/dist/{Calculator-LSDVIJVQ.js → Calculator-5TRNFPY4.js} +21 -21
  3. package/dist/{CurrencyConverter-G5IYUCN7.js → CurrencyConverter-BB4QWNER.js} +6 -6
  4. package/dist/Files-BKEREVQK.js +141 -0
  5. package/dist/{Notepad-H6NVBIDA.js → Notepad-BLUA2254.js} +9 -9
  6. package/dist/{PdfViewer-UY5SRC63.js → PdfViewer-4YLDY4JY.js} +1 -1
  7. package/dist/{PomodoroTimer-SFTPXEDV.js → PomodoroTimer-KIJKDHVO.js} +6 -6
  8. package/dist/{Preview-BHQH5CSY.js → Preview-JVL2N5GN.js} +29 -29
  9. package/dist/Sidebar-SAGLPIOC.js +44 -0
  10. package/dist/{Stock-YCPMLYPR.js → Stock-JQEJMIMG.js} +3 -3
  11. package/dist/{Weather-TLFNIPDG.js → Weather-FAQX55XL.js} +16 -16
  12. package/dist/{WorldClock-66IRFS2W.js → WorldClock-YSZNGEL2.js} +6 -6
  13. package/dist/ai/index.d.ts +170 -6
  14. package/dist/ai/index.js +134 -115
  15. package/dist/ai.css +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/charts/FlowChart.js +1 -1
  21. package/dist/charts/PieChart.js +1 -1
  22. package/dist/charts/RadarChart.js +1 -1
  23. package/dist/charts/RadialBarChart.js +1 -1
  24. package/dist/charts/SpecChart.js +1 -1
  25. package/dist/charts/TimeSeriesChart.js +1 -1
  26. package/dist/chunk-24Y5JHIR.js +4 -0
  27. package/dist/{chunk-34TQBJ7I.js → chunk-2OUAPOLK.js} +1 -1
  28. package/dist/chunk-2SGOKMUU.js +13 -0
  29. package/dist/{chunk-3CKYFCX4.js → chunk-34L5SRM7.js} +17 -17
  30. package/dist/chunk-3DSGJIC7.js +7 -0
  31. package/dist/{chunk-CALBDO7B.js → chunk-3FBXJO77.js} +1 -1
  32. package/dist/{chunk-DK5SXOXJ.js → chunk-47UH3D4B.js} +1 -1
  33. package/dist/{chunk-7LTU5TJD.js → chunk-4EFIUJ7X.js} +1 -1
  34. package/dist/{chunk-AQCUGTOR.js → chunk-56XCGOX5.js} +6 -6
  35. package/dist/{chunk-LBKKKZ4M.js → chunk-63IGYBCQ.js} +2 -2
  36. package/dist/chunk-64J7TYJ3.js +4 -0
  37. package/dist/{chunk-3JL4TCA7.js → chunk-6KOMF6WL.js} +1 -1
  38. package/dist/{chunk-RY7JCGLI.js → chunk-6Q7L32LL.js} +1 -1
  39. package/dist/{chunk-VLMBXPRM.js → chunk-7GJIIBJD.js} +1 -1
  40. package/dist/{chunk-DCCYUCBM.js → chunk-7NO4IENQ.js} +1 -1
  41. package/dist/{chunk-I7JU4IU3.js → chunk-7TNZ3DTT.js} +2 -2
  42. package/dist/{chunk-KP2JYXEU.js → chunk-AFWLCXQD.js} +9 -9
  43. package/dist/{chunk-34EBBZFK.js → chunk-AMIMNRYU.js} +1 -1
  44. package/dist/chunk-ASDYAASN.js +3 -0
  45. package/dist/{chunk-N3R6N7LG.js → chunk-ATZ262BR.js} +1 -1
  46. package/dist/{chunk-KZRZYLN7.js → chunk-BC4FE77W.js} +49 -49
  47. package/dist/chunk-BFRGDRFK.js +23 -0
  48. package/dist/{chunk-CCK2UWQ5.js → chunk-BKYRHQK2.js} +10 -10
  49. package/dist/{chunk-X34ZBXIU.js → chunk-BT2YPDQL.js} +3 -3
  50. package/dist/{chunk-YW3UKSON.js → chunk-CON5NRCO.js} +2 -2
  51. package/dist/{chunk-JUFCEWE3.js → chunk-DG2TGWXI.js} +5 -5
  52. package/dist/{chunk-4ZRGMK7Y.js → chunk-DIHHV6T6.js} +1 -1
  53. package/dist/{chunk-N32LNPPP.js → chunk-EATV7FMU.js} +8 -8
  54. package/dist/{chunk-VXDW6ZPG.js → chunk-EEB5XPWP.js} +2 -2
  55. package/dist/{chunk-JN5NUZ6D.js → chunk-EWVE5XG6.js} +1 -1
  56. package/dist/chunk-FFUTSMF5.js +28 -0
  57. package/dist/{chunk-RB7IU7ZK.js → chunk-FVKXDF2Q.js} +5 -5
  58. package/dist/{chunk-THLXDI76.js → chunk-GOAFMGUI.js} +10 -10
  59. package/dist/{chunk-MEN4B6NP.js → chunk-H2CPT6K3.js} +10 -10
  60. package/dist/{chunk-3J3FBYIZ.js → chunk-HLE4LTRU.js} +1 -1
  61. package/dist/{chunk-Y523KUQC.js → chunk-HNEI2RKX.js} +1 -1
  62. package/dist/{chunk-Z3CTYK3U.js → chunk-HSUTZCRT.js} +1 -1
  63. package/dist/{chunk-UR2ECNBB.js → chunk-HVYXJLAV.js} +1 -1
  64. package/dist/chunk-IATKDC52.js +9 -0
  65. package/dist/{chunk-G2Y5I5OR.js → chunk-IB3LLQZC.js} +1 -1
  66. package/dist/{chunk-XZXFUZIK.js → chunk-ISVODSRP.js} +6 -3
  67. package/dist/chunk-JJ2OXUK7.js +14 -0
  68. package/dist/{chunk-QMSINDXL.js → chunk-JLRF6FN7.js} +1 -1
  69. package/dist/{chunk-BZHP645G.js → chunk-K5PDLRYH.js} +8 -8
  70. package/dist/{chunk-GLRRX4AL.js → chunk-K5YT5PMJ.js} +1 -1
  71. package/dist/{chunk-SY66VJAI.js → chunk-KTO427N3.js} +1 -1
  72. package/dist/{chunk-6GWYFUME.js → chunk-LAO6GLBY.js} +6 -6
  73. package/dist/{chunk-RJF4A3LJ.js → chunk-LL4KF43W.js} +1 -1
  74. package/dist/{chunk-FQ4IRBMA.js → chunk-MKNDDB6U.js} +1 -1
  75. package/dist/{chunk-4ZLFAXOC.js → chunk-MTYEY7HT.js} +11 -11
  76. package/dist/{chunk-ILDPJ26Y.js → chunk-N2FX4O3H.js} +1 -1
  77. package/dist/{chunk-WBGJ4XB7.js → chunk-N5RV73CI.js} +4 -4
  78. package/dist/{chunk-CJHYOHMU.js → chunk-NN32QUCE.js} +1 -1
  79. package/dist/{chunk-B76GRJW5.js → chunk-NUPK6CUV.js} +1 -1
  80. package/dist/{chunk-KBI3T6UC.js → chunk-O4YKOS74.js} +1 -1
  81. package/dist/{chunk-VQ4X3OBR.js → chunk-OMFYTCBI.js} +1 -1
  82. package/dist/{chunk-YRY64DQV.js → chunk-OXRQIWRT.js} +1 -1
  83. package/dist/{chunk-6RK6R3RY.js → chunk-PT4GMPUB.js} +1 -1
  84. package/dist/{chunk-PLPMCE44.js → chunk-QB2GJNGB.js} +9 -9
  85. package/dist/{chunk-GEZM6ARD.js → chunk-QIPO4EVJ.js} +1 -1
  86. package/dist/{chunk-6FZ5JTBY.js → chunk-QMBMK6PP.js} +2 -2
  87. package/dist/{chunk-TOVEZAIM.js → chunk-QOYKBINM.js} +1 -1
  88. package/dist/{chunk-63TCQAGE.js → chunk-RVVQDBV7.js} +5 -5
  89. package/dist/{chunk-OM42AUMS.js → chunk-S6AN76R3.js} +1 -1
  90. package/dist/{chunk-B4GRHE44.js → chunk-SS3CROPR.js} +3 -3
  91. package/dist/{chunk-7MJYT6IW.js → chunk-TDXRG43I.js} +1 -1
  92. package/dist/{chunk-T2TZBTSM.js → chunk-TKIYZE7V.js} +1 -1
  93. package/dist/{chunk-WVMCKM5Z.js → chunk-UEFIUTOU.js} +1 -1
  94. package/dist/chunk-UFM4YBZ7.js +1 -0
  95. package/dist/{chunk-436PJFHC.js → chunk-UH5ZGWSA.js} +10 -10
  96. package/dist/{chunk-FTMCNC66.js → chunk-UZFFSZFI.js} +1 -1
  97. package/dist/{chunk-3E3LR2PM.js → chunk-V3XS6BTJ.js} +13 -13
  98. package/dist/{chunk-YIUWX2IU.js → chunk-VLBIM33E.js} +5 -5
  99. package/dist/{chunk-QZCLHKCI.js → chunk-VLKJN6HX.js} +10 -10
  100. package/dist/{chunk-OHSRZLRD.js → chunk-VP2GI3UP.js} +2 -2
  101. package/dist/{chunk-QG37GJP2.js → chunk-WBAWJIVM.js} +4 -4
  102. package/dist/{chunk-QPSJYSET.js → chunk-WKYNPGFB.js} +5 -5
  103. package/dist/{chunk-JGRDG7CB.js → chunk-WN3JHPJI.js} +6 -6
  104. package/dist/{chunk-XHZVUO6F.js → chunk-WX2Q76WC.js} +6 -6
  105. package/dist/{chunk-6DGUJ2OI.js → chunk-X5MUSNKH.js} +2 -2
  106. package/dist/{chunk-YI6SYUAK.js → chunk-XAEI36TW.js} +1 -1
  107. package/dist/{chunk-H6WXTJOT.js → chunk-XAF5ZI7H.js} +1 -1
  108. package/dist/{chunk-TM4CRQ3W.js → chunk-XMY2HKVD.js} +15 -15
  109. package/dist/{chunk-F37II2EH.js → chunk-XQWHKXLS.js} +13 -13
  110. package/dist/{chunk-SSNTJ3M4.js → chunk-XSVQ5V7L.js} +9 -9
  111. package/dist/chunk-Y4FWTYZS.js +6 -0
  112. package/dist/{chunk-HMT3MES3.js → chunk-YWNHK6Z5.js} +18 -18
  113. package/dist/{chunk-LPPJNZQ6.js → chunk-YYGJJ6EI.js} +1 -1
  114. package/dist/{chunk-R62JKPYY.js → chunk-Z2Z653OO.js} +1 -1
  115. package/dist/{chunk-L543DFHF.js → chunk-ZBJ7FTA5.js} +1 -1
  116. package/dist/{chunk-OLCRYT3N.js → chunk-ZGCCV4WE.js} +10 -10
  117. package/dist/data/EntityList.js +1 -1
  118. package/dist/data/ListLoadError.js +1 -1
  119. package/dist/data/ResizableTable.js +1 -1
  120. package/dist/forms/BorderInput.js +1 -1
  121. package/dist/forms/BrandAssetEditor.js +1 -1
  122. package/dist/forms/Calendar.js +1 -1
  123. package/dist/forms/ColorPicker.js +1 -1
  124. package/dist/forms/ComposerAttachments.js +1 -1
  125. package/dist/forms/CornersInput.js +1 -1
  126. package/dist/forms/DatePicker.js +1 -1
  127. package/dist/forms/DateRangePicker.js +1 -1
  128. package/dist/forms/DisplayChips.js +1 -1
  129. package/dist/forms/FilePicker.js +1 -1
  130. package/dist/forms/IconPicker.js +1 -1
  131. package/dist/forms/Input.js +1 -1
  132. package/dist/forms/InputNumber.js +1 -1
  133. package/dist/forms/LinkPicker.js +1 -1
  134. package/dist/forms/MediaLibrary.js +1 -1
  135. package/dist/forms/MediaUploadField.js +1 -1
  136. package/dist/forms/MediaUploadGrid.js +1 -1
  137. package/dist/forms/MediaUsedInList.js +1 -1
  138. package/dist/forms/PositionInput.js +1 -1
  139. package/dist/forms/RenameField.js +1 -1
  140. package/dist/forms/Select.js +1 -1
  141. package/dist/forms/SidesInput.js +1 -1
  142. package/dist/forms/Slider.js +1 -1
  143. package/dist/forms/Snippet.js +1 -1
  144. package/dist/forms/SplitButton.js +1 -1
  145. package/dist/forms/TagInput.js +1 -1
  146. package/dist/forms/TextToolbar.js +1 -1
  147. package/dist/forms/UnitMenu.js +1 -1
  148. package/dist/forms/WidthsBar.js +1 -1
  149. package/dist/forms/mediaLibraryMenu.js +1 -1
  150. package/dist/forms/textAlign.js +1 -1
  151. package/dist/icons/index.js +1 -1
  152. package/dist/index.js +665 -665
  153. package/dist/map/index.js +5 -5
  154. package/dist/markdown/index.js +1 -1
  155. package/dist/page-tabs/index.js +5 -5
  156. package/dist/pdf/index.js +1 -1
  157. package/dist/shell/AppUpdateBanner.js +1 -1
  158. package/dist/shell/Avatar.js +1 -1
  159. package/dist/shell/Banner.js +1 -1
  160. package/dist/shell/Breadcrumbs.js +1 -1
  161. package/dist/shell/ColoredBadge.js +1 -1
  162. package/dist/shell/ConfirmDialog.js +1 -1
  163. package/dist/shell/ContextMenu.js +1 -1
  164. package/dist/shell/Dialog.js +1 -1
  165. package/dist/shell/Drawer.js +1 -1
  166. package/dist/shell/DropdownMenu.js +1 -1
  167. package/dist/shell/EmptyState.js +1 -1
  168. package/dist/shell/HelpCenter.js +1 -1
  169. package/dist/shell/ImageLightbox.js +1 -1
  170. package/dist/shell/LanguageSelect.js +1 -1
  171. package/dist/shell/Markdown.js +1 -1
  172. package/dist/shell/PageHeader.js +1 -1
  173. package/dist/shell/PopupMenu.js +1 -1
  174. package/dist/shell/ProductionTimeline.js +1 -1
  175. package/dist/shell/Result.js +1 -1
  176. package/dist/shell/SearchableSelect.js +1 -1
  177. package/dist/shell/SettingReset.js +1 -1
  178. package/dist/shell/SidebarLayout.js +1 -1
  179. package/dist/shell/SidebarNav.js +1 -1
  180. package/dist/shell/SortableList.js +1 -1
  181. package/dist/shell/StepChain.js +1 -1
  182. package/dist/shell/Stepper.js +1 -1
  183. package/dist/shell/TopNav.js +1 -1
  184. package/dist/shell/Tree.js +1 -1
  185. package/dist/shell/discardGuard.js +1 -1
  186. package/dist/telemetry/index.js +1 -1
  187. package/dist/templates/AuthScreen.js +1 -1
  188. package/dist/templates/ChatTemplate.js +1 -1
  189. package/dist/templates/CheckoutTemplate.js +1 -1
  190. package/dist/templates/DashboardTemplate.js +1 -1
  191. package/dist/templates/DataTablePage.js +1 -1
  192. package/dist/templates/EmailTemplate.js +1 -1
  193. package/dist/templates/FormLayoutPage.js +1 -1
  194. package/dist/ui/index.js +1 -1
  195. package/dist/version.js +1 -1
  196. package/package.json +1 -1
  197. package/dist/Files-T56P5JDC.js +0 -141
  198. package/dist/Sidebar-BKNCPUOE.js +0 -44
  199. package/dist/chunk-BM2QIV64.js +0 -23
  200. package/dist/chunk-D2WJAF62.js +0 -4
  201. package/dist/chunk-GJGR267P.js +0 -1
  202. package/dist/chunk-INADSWOF.js +0 -28
  203. package/dist/chunk-LCEQIFPK.js +0 -3
  204. package/dist/chunk-LDVDNAXP.js +0 -4
  205. package/dist/chunk-OQ6TECLX.js +0 -6
  206. package/dist/chunk-SFULX4E3.js +0 -7
  207. package/dist/chunk-TUPPFC74.js +0 -14
  208. package/dist/chunk-UP4HLGMZ.js +0 -9
  209. package/dist/chunk-ZQ24H5UO.js +0 -13
  210. /package/dist/{chunk-5WK56FA3.js → chunk-TGLUENXE.js} +0 -0
@@ -1,5 +1,5 @@
1
- import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-XZXFUZIK.js";import{isValidElement as n,cloneElement as r}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var a="react-os-shell:spreadsheet-preview-update",s=null,l=0;function d(e){const t=++l,n={token:t,data:e};return s=n,{update(e){s===n&&(n.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(a,{detail:{token:t,data:e}}))}}}function c(){return s}function p(e){s===e&&(s=null)}var u={document:".docx",spreadsheet:".sheet",deck:".slides"},f=class extends Error{limit;used;attempted;constructor(e,t,n){super("Not enough space"),this.name="FilesQuotaError",this.limit=e,this.used=t,this.attempted=n}};function h(e,t){return e&&"/"!==e?e.replace(/\/$/,"")+"/"+t:"/"+t}async function m(e,t){const n=await e.json().catch(()=>({}));return new Error(n.error||`${t} failed (${e.status})`)}function w(e){const t=()=>(e??(("undefined"!=typeof window?window.__REACT_OS_SHELL_FILE_SERVER__:void 0)||"http://localhost:4000").replace(/\/$/,"")).replace(/\/$/,""),n=(e,n={})=>fetch(`${t()}${e}`,{...n,credentials:"include"}),r=e=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{async quota(){const e=await n("/api/quota");if(!e.ok)throw await m(e,"Quota");const t=await e.json();return{used:t.used,limit:t.limit}},async list(e){const t=e??"/",r=await n(`/api/files?path=${encodeURIComponent(t)}`);if(!r.ok)throw await m(r,"Listing");const o=await r.json(),i=o.path||t,a=i.split("/").filter(Boolean);return{folder:{id:"/"===i?null:i,name:a[a.length-1]??"",role:"owner",path:[{id:null,name:""},...a.map((e,t)=>({id:"/"+a.slice(0,t+1).join("/"),name:e}))]},entries:(o.entries||[]).map(e=>({id:h(i,e.name),name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modifiedAt}))}},async upload(e,t){const r=new FormData;r.append("file",t);const o=await n(`/api/upload?path=${encodeURIComponent(e??"/")}`,{method:"POST",body:r});if(413===o.status){const e=await o.json().catch(()=>({}));throw new f(e.limit||0,e.used||0,e.attempted||t.size)}if(!o.ok)throw await m(o,"Upload")},async createFolder(e,t){const o=await n("/api/folder",r({path:h(e,t)}));if(!o.ok)throw await m(o,"Create folder")},async rename(e,t){const o=e.replace(/\/[^/]*$/,"")||"/",i=await n("/api/rename",r({from:e,to:h(o,t)}));if(!i.ok)throw await m(i,"Rename")},async remove(e){const t=await n(`/api/files?path=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await m(t,"Delete")},async read(e){const t=await n(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw await m(t,"Download");return t.blob()},async trash(){const e=await n("/api/trash");if(!e.ok)throw await m(e,"Listing trash");return(await e.json()).entries||[]},async restore(e){const t=await n("/api/trash/restore",r({id:e}));if(!t.ok)throw await m(t,"Restore")},async purge(e){const t=await n(`/api/trash/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await m(t,"Delete")},async emptyTrash(){const e=await n("/api/trash",{method:"DELETE"});if(!e.ok)throw await m(e,"Empty trash")}}}var y=null;function g(e){y=e}function x(){return y??w()}function b(){return null!==y}var v=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function _(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return v[Math.abs(t)%v.length]}var k={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},E={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},C={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},N={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function j({className:e}){/* @__PURE__ */
2
- return o(t,{name:"folder",look:"solid",className:e})}function T(t,n){return n&&e[n]||(t?e[t]:void 0)}var I=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function L({entityType:e,isSelected:t,entityId:a,label:s,fileKind:l}){const d="preview-file"===e&&l,c=d?N[l]:null,p=d?C[l]:null;if("folder"===e)/* @__PURE__ */
1
+ import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{isValidElement as n,cloneElement as r}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var a="react-os-shell:spreadsheet-preview-update",s=null,l=0;function d(e){const t=++l,n={token:t,data:e};return s=n,{update(e){s===n&&(n.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(a,{detail:{token:t,data:e}}))}}}function c(){return s}function p(e){s===e&&(s=null)}var u={document:".docx",spreadsheet:".sheet",deck:".slides"},f=class extends Error{limit;used;attempted;constructor(e,t,n){super("Not enough space"),this.name="FilesQuotaError",this.limit=e,this.used=t,this.attempted=n}};function h(e,t){return e&&"/"!==e?e.replace(/\/$/,"")+"/"+t:"/"+t}async function m(e,t){const n=await e.json().catch(()=>({}));return new Error(n.error||`${t} failed (${e.status})`)}function w(e){const t=()=>(e??(("undefined"!=typeof window?window.__REACT_OS_SHELL_FILE_SERVER__:void 0)||"http://localhost:4000").replace(/\/$/,"")).replace(/\/$/,""),n=(e,n={})=>fetch(`${t()}${e}`,{...n,credentials:"include"}),r=e=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{async quota(){const e=await n("/api/quota");if(!e.ok)throw await m(e,"Quota");const t=await e.json();return{used:t.used,limit:t.limit}},async list(e){const t=e??"/",r=await n(`/api/files?path=${encodeURIComponent(t)}`);if(!r.ok)throw await m(r,"Listing");const o=await r.json(),i=o.path||t,a=i.split("/").filter(Boolean);return{folder:{id:"/"===i?null:i,name:a[a.length-1]??"",role:"owner",path:[{id:null,name:""},...a.map((e,t)=>({id:"/"+a.slice(0,t+1).join("/"),name:e}))]},entries:(o.entries||[]).map(e=>({id:h(i,e.name),name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modifiedAt}))}},async upload(e,t){const r=new FormData;r.append("file",t);const o=await n(`/api/upload?path=${encodeURIComponent(e??"/")}`,{method:"POST",body:r});if(413===o.status){const e=await o.json().catch(()=>({}));throw new f(e.limit||0,e.used||0,e.attempted||t.size)}if(!o.ok)throw await m(o,"Upload")},async createFolder(e,t){const o=await n("/api/folder",r({path:h(e,t)}));if(!o.ok)throw await m(o,"Create folder")},async rename(e,t){const o=e.replace(/\/[^/]*$/,"")||"/",i=await n("/api/rename",r({from:e,to:h(o,t)}));if(!i.ok)throw await m(i,"Rename")},async remove(e){const t=await n(`/api/files?path=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await m(t,"Delete")},async read(e){const t=await n(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw await m(t,"Download");return t.blob()},async trash(){const e=await n("/api/trash");if(!e.ok)throw await m(e,"Listing trash");return(await e.json()).entries||[]},async restore(e){const t=await n("/api/trash/restore",r({id:e}));if(!t.ok)throw await m(t,"Restore")},async purge(e){const t=await n(`/api/trash/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await m(t,"Delete")},async emptyTrash(){const e=await n("/api/trash",{method:"DELETE"});if(!e.ok)throw await m(e,"Empty trash")}}}var y=null;function g(e){y=e}function x(){return y??w()}function b(){return null!==y}var v=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function _(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return v[Math.abs(t)%v.length]}var k={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},E={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},C={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},N={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function j({className:e}){/* @__PURE__ */
2
+ return o(t,{name:"folder",look:"solid",className:e})}function T(t,n){return n&&e[n]||(t?e[t]:void 0)}var I=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function S({entityType:e,isSelected:t,entityId:a,label:s,fileKind:l}){const d="preview-file"===e&&l,c=d?N[l]:null,p=d?C[l]:null;if("folder"===e)/* @__PURE__ */
3
3
  return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(j,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=T(a,s),i=_(a||s||"page");/* @__PURE__ */
4
4
  return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&n(e)?r(e,{className:"h-7 w-7 text-white"}):I})})}/* @__PURE__ */
5
5
  return i("div",{className:"w-12 h-12 relative flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:[
@@ -7,7 +7,7 @@ return i("div",{className:"w-12 h-12 relative flex items-center justify-center "
7
7
  /* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",fill:"white",fillOpacity:"0.92"}),
8
8
  /* @__PURE__ */o("path",{d:"M26 0l10 10H30a4 4 0 01-4-4V0z",fill:"currentColor",fillOpacity:"0.2"}),
9
9
  /* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.5"})]}),
10
- /* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??k[e]??"text-gray-600"}`,children:p??E[e]??e.slice(0,3).toUpperCase()})]})}function $({item:e}){if("folder"===e.entityType)/* @__PURE__ */
10
+ /* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??k[e]??"text-gray-600"}`,children:p??E[e]??e.slice(0,3).toUpperCase()})]})}function L({item:e}){if("folder"===e.entityType)/* @__PURE__ */
11
11
  return o(j,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=T(e.entityId,e.label);/* @__PURE__ */
12
12
  return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${_(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&n(t)?r(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?N[e.fileKind]:k[e.entityType])??"text-gray-400";/* @__PURE__ */
13
- return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function S(e){return"preview-file"===e.entityType&&e.fileKind?C[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":E[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var R=null,D=/* @__PURE__ */new Set;function P(e){R=e,D.forEach(e=>e())}function F(e){return D.add(e),()=>{D.delete(e)}}function V(){return R}var O="__REACT_OS_SHELL_FILES_VIEW__",A="react-os-shell:files-show-trash",M="react-os-shell:files-open-desktop-folder";function U(){"undefined"!=typeof window&&(window[O]="trash",window.dispatchEvent(new CustomEvent(A)))}function z(e){"undefined"!=typeof window&&(window[O]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(M,{detail:{folderId:e}})))}function W(){if("undefined"==typeof window)return null;const e=window[O];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function H(){const e=W();return"undefined"!=typeof window&&(window[O]=null),e}export{$ as DesktopItemMiniIcon,u as FILES_OFFICE_EXTENSIONS,M as FILES_OPEN_DESKTOP_FOLDER_EVENT,A as FILES_SHOW_TRASH_EVENT,L as FileIconTile,f as FilesQuotaError,j as FolderGlyph,a as SPREADSHEET_PREVIEW_UPDATE_EVENT,p as claimSpreadsheetPreviewStage,H as consumeFilesViewRequest,w as createFileServerStore,S as desktopItemTypeLabel,V as getDesktopFoldersSnapshot,x as getFilesStore,b as hasHostFilesStore,W as peekFilesViewRequest,c as peekSpreadsheetPreviewStage,P as publishDesktopFolders,z as requestFilesDesktopFolderView,U as requestFilesTrashView,g as setFilesStore,d as setSpreadsheetPreview,F as subscribeDesktopFolders};
13
+ return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function $(e){return"preview-file"===e.entityType&&e.fileKind?C[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":E[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var R=null,D=/* @__PURE__ */new Set;function P(e){R=e,D.forEach(e=>e())}function V(e){return D.add(e),()=>{D.delete(e)}}function F(){return R}var O="__REACT_OS_SHELL_FILES_VIEW__",A="react-os-shell:files-show-trash",M="react-os-shell:files-open-desktop-folder";function U(){"undefined"!=typeof window&&(window[O]="trash",window.dispatchEvent(new CustomEvent(A)))}function z(e){"undefined"!=typeof window&&(window[O]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(M,{detail:{folderId:e}})))}function W(){if("undefined"==typeof window)return null;const e=window[O];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function H(){const e=W();return"undefined"!=typeof window&&(window[O]=null),e}export{L as DesktopItemMiniIcon,u as FILES_OFFICE_EXTENSIONS,M as FILES_OPEN_DESKTOP_FOLDER_EVENT,A as FILES_SHOW_TRASH_EVENT,S as FileIconTile,f as FilesQuotaError,j as FolderGlyph,a as SPREADSHEET_PREVIEW_UPDATE_EVENT,p as claimSpreadsheetPreviewStage,H as consumeFilesViewRequest,w as createFileServerStore,$ as desktopItemTypeLabel,F as getDesktopFoldersSnapshot,x as getFilesStore,b as hasHostFilesStore,W as peekFilesViewRequest,c as peekSpreadsheetPreviewStage,P as publishDesktopFolders,z as requestFilesDesktopFolderView,U as requestFilesTrashView,g as setFilesStore,d as setSpreadsheetPreview,V as subscribeDesktopFolders};
@@ -1,7 +1,7 @@
1
- import{writeClipboard as e}from"./chunk-Y7KDCC6E.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{Icon as t}from"./chunk-XZXFUZIK.js";import{toast_default as n}from"./chunk-3YBXA72C.js";import{useShellStrings as a}from"./chunk-JSHMIMAJ.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
1
+ import{writeClipboard as e}from"./chunk-Y7KDCC6E.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{toast_default as n}from"./chunk-3YBXA72C.js";import{useShellStrings as a}from"./chunk-JSHMIMAJ.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
2
  return s(t,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
- return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":C,className:B=""}){const[A,T]=i(!1),X=o(null),I=a().copy;c(()=>()=>{X.current&&clearTimeout(X.current)},[]);const J=l(async()=>{await e(t)?(T(!0),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{T(!1),X.current=null},2e3),w?.(t)):n.error(I.failed)},[t,w,I]),{box:K,button:M}=p[g],R=!v;/* @__PURE__ */
4
- return m("div",{id:R?void 0:j,"aria-describedby":R?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[k],K,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
3
+ return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":C,className:B=""}){const[S,A]=i(!1),R=o(null),T=a().copy;c(()=>()=>{R.current&&clearTimeout(R.current)},[]);const V=l(async()=>{await e(t)?(A(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{A(!1),R.current=null},2e3),w?.(t)):n.error(T.failed)},[t,w,T]),{box:D,button:I}=p[g],J=!v;/* @__PURE__ */
4
+ return m("div",{id:J?void 0:j,"aria-describedby":J?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[k],D,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
5
  /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(N?"whitespace-pre-wrap break-all":"truncate"),title:N?void 0:t,children:y??t}),!v&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?I.copyLabel(x):I.copy,"aria-describedby":C,onClick:J,className:`${M} text-gray-400`,children:/* @__PURE__ */s(A?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:A?I.copied:""})]})]})}export{y as Snippet};
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?T.copyLabel(x):T.copy,"aria-describedby":C,onClick:V,className:`${I} text-gray-400`,children:/* @__PURE__ */s(S?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:S?T.copied:""})]})]})}export{y as Snippet};
@@ -1,9 +1,9 @@
1
- import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-OOWPLQD5.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-XZXFUZIK.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:O=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:W="bg-white"}){const j="right"===m,z=i().sidebar,C=a(),D=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[I,P]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),M=null!=l||null!=n,E=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:I},children:[
2
- /* @__PURE__ */f("div",{className:`flex h-full flex-col ${M?"overflow-hidden":"overflow-y-auto"} ${O}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),M?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
- /* @__PURE__ */p(t,{side:m,width:I,onResize:P,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:z.resize})]}),K=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${W}`,children:u});/* @__PURE__ */
4
- return f("div",C?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
- /* @__PURE__ */p(g,{phone:D,top:l,fallback:z.sections}),K,
6
- /* @__PURE__ */p(v,{phone:D,bottom:n,label:z.sections,closeLabel:z.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[j?null:E,K,j?E:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
1
+ import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-OOWPLQD5.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:O=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:D="bg-white"}){const P="right"===m,W=i().sidebar,j=a(),z=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[C,I]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),S=null!=l||null!=n,M=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:C},children:[
2
+ /* @__PURE__ */f("div",{className:`flex h-full flex-col ${S?"overflow-hidden":"overflow-y-auto"} ${O}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),S?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
+ /* @__PURE__ */p(t,{side:m,width:C,onResize:I,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:W.resize})]}),R=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${D}`,children:u});/* @__PURE__ */
4
+ return f("div",j?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
+ /* @__PURE__ */p(g,{phone:z,top:l,fallback:W.sections}),R,
6
+ /* @__PURE__ */p(v,{phone:z,bottom:n,label:W.sections,closeLabel:W.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[P?null:M,R,P?M:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
7
7
  return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
8
8
  /* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
9
9
  /* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
@@ -1,6 +1,6 @@
1
- import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-LBKKKZ4M.js";import{Tooltip as i}from"./chunk-SOZCWT6I.js";import{useShellStrings as l}from"./chunk-JSHMIMAJ.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const K=l().widths,R=a(),S=m(Math.round(x)||1,1,n),z=e($,S),A=z??[...t[S]??[]],B=[...A,100-p(A)],O=P||M,T=s(null),D=s({onChange:k,shown:A,locked:O,n:S,stored:z});D.current={onChange:k,shown:A,locked:O,n:S,stored:z};const I=t=>{const{onChange:r,shown:n,locked:o,n:i}=D.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},E=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],I(i.slice(0,-1))&&(ne.current=null)},H=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=B[e]+B[e+1],i="ArrowRight"===t.key?B[e]+n:"ArrowLeft"===t.key?B[e]-n:"PageUp"===t.key?B[e]+10:"PageDown"===t.key?B[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),E(B,e,i))},L=s(null),[J,W]=c(null),F=()=>{L.current=null,W(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>F,[]);const G=e=>t=>{if(0!==t.button||O)return;t.preventDefault();const r=T.current?.getBoundingClientRect().width??0;r<=0||(L.current={i:e,x:t.clientX,width:r,from:B,moved:!1,pointer:t.pointerId},W(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},U=e=>{const t=L.current;if(!t)return;if(0===e.buttons)return void F();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}E(t.from,t.i,t.from[t.i]+r/t.width*100)},X=e=>{const t=L.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),F())},Z=(e,t)=>{const{shown:n}=D.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return I(o.slice(0,-1))?o:null},[q,V]=c(0);u(()=>{const e=T.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Q=s(null),[Y,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=D.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=B.join(",");u(()=>{const e=null===Y?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Q.current,Y);te(t=>v(t,e)?t:e)},[Y,ie,q]);const le=K.hint(S,r),ae=B.slice(0,-1).map((e,t)=>p(B.slice(0,t+1)));/* @__PURE__ */
2
- return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":S>1?R:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
3
- /* @__PURE__ */h("div",{ref:Q,"data-widths-bar":"",className:"relative h-8",children:[
4
- /* @__PURE__ */f("div",{ref:T,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:B.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===S&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
5
- /* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),S>1&&B.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Y===t,l=p(B.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
- return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(S-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":K.column(t+1),"aria-describedby":R,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||Z(t,e)},onRevert:e=>((e,t)=>{D.current.locked||null===t||oe(e,t)||Z(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:D.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<S-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:K.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":K.divider(t+1,t+2),"aria-valuenow":B[t],"aria-valuemin":r,"aria-valuemax":B[t]+B[t+1]-r,"aria-valuetext":K.dividerValue(t+1,B[t],t+2,B[t+1]),"aria-disabled":O||void 0,onKeyDown:O?void 0:H(t),onPointerDown:G(t),onPointerMove:U,onPointerUp:X,onPointerCancel:X,onLostPointerCapture:()=>{L.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(O?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(O?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${J===t?"w-1":y}`)})})})})]},t))]}),S>1&&/* @__PURE__ */f("span",{id:R,className:"sr-only",children:le})]})}export{x as WidthsBar};
1
+ import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-63IGYBCQ.js";import{Tooltip as i}from"./chunk-SOZCWT6I.js";import{useShellStrings as l}from"./chunk-JSHMIMAJ.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const R=l().widths,S=a(),z=m(Math.round(x)||1,1,n),A=e($,z),B=A??[...t[z]??[]],I=[...B,100-p(B)],O=P||M,T=s(null),D=s({onChange:k,shown:B,locked:O,n:z,stored:A});D.current={onChange:k,shown:B,locked:O,n:z,stored:A};const K=t=>{const{onChange:r,shown:n,locked:o,n:i}=D.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},E=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],K(i.slice(0,-1))&&(ne.current=null)},H=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=I[e]+I[e+1],i="ArrowRight"===t.key?I[e]+n:"ArrowLeft"===t.key?I[e]-n:"PageUp"===t.key?I[e]+10:"PageDown"===t.key?I[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),E(I,e,i))},G=s(null),[J,L]=c(null),W=()=>{G.current=null,L(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>W,[]);const F=e=>t=>{if(0!==t.button||O)return;t.preventDefault();const r=T.current?.getBoundingClientRect().width??0;r<=0||(G.current={i:e,x:t.clientX,width:r,from:I,moved:!1,pointer:t.pointerId},L(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},U=e=>{const t=G.current;if(!t)return;if(0===e.buttons)return void W();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}E(t.from,t.i,t.from[t.i]+r/t.width*100)},X=e=>{const t=G.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),W())},q=(e,t)=>{const{shown:n}=D.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return K(o.slice(0,-1))?o:null},[Q,V]=c(0);u(()=>{const e=T.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=D.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=I.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,Q]);const le=R.hint(z,r),ae=I.slice(0,-1).map((e,t)=>p(I.slice(0,t+1)));/* @__PURE__ */
2
+ return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?S:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
3
+ /* @__PURE__ */h("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
4
+ /* @__PURE__ */f("div",{ref:T,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:I.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
5
+ /* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&I.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Z===t,l=p(I.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
+ return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>Q>0&&Q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(z-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":R.column(t+1),"aria-describedby":S,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||q(t,e)},onRevert:e=>((e,t)=>{D.current.locked||null===t||oe(e,t)||q(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:D.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<z-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:R.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":R.divider(t+1,t+2),"aria-valuenow":I[t],"aria-valuemin":r,"aria-valuemax":I[t]+I[t+1]-r,"aria-valuetext":R.dividerValue(t+1,I[t],t+2,I[t+1]),"aria-disabled":O||void 0,onKeyDown:O?void 0:H(t),onPointerDown:F(t),onPointerMove:U,onPointerUp:X,onPointerCancel:X,onLostPointerCapture:()=>{G.current&&W()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(O?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(O?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${J===t?"w-1":y}`)})})})})]},t))]}),z>1&&/* @__PURE__ */f("span",{id:S,className:"sr-only",children:le})]})}export{x as WidthsBar};
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-KZRZYLN7.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-GJGR267P.js";import{Icon as s}from"./chunk-XZXFUZIK.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,Z]=a(b.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-BC4FE77W.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-UFM4YBZ7.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,C]=a(b.partOf);/* @__PURE__ */
2
2
  return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
4
  /* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
@@ -6,4 +6,4 @@ return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
6
6
  /* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
7
7
  /* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
8
  /* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
9
- /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),Z]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
9
+ /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),C]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
@@ -1,4 +1,4 @@
1
- import{Button_default as e}from"./chunk-EVYD6UFQ.js";import{Icon as r}from"./chunk-XZXFUZIK.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
1
+ import{Button_default as e}from"./chunk-EVYD6UFQ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
2
2
  return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
3
3
  /* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
4
4
  /* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-KZRZYLN7.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
1
+ import{Modal as e}from"./chunk-BC4FE77W.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
2
2
  return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
3
3
  /* @__PURE__ */n("div",{children:[
4
4
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
@@ -1,19 +1,19 @@
1
- import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-GLRRX4AL.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-XZXFUZIK.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-JSHMIMAJ.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as H,useEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as I,jsx as C,Fragment as E}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),j=f??D,H=w(),S=/* @__PURE__ */I("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?H:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:i}),
2
- /* @__PURE__ */C(A,{items:r})]});return j?/* @__PURE__ */I(E,{children:[S,
3
- /* @__PURE__ */C("span",{id:H,hidden:!0,children:$.settingView.auto})]}):S});function A({items:e}){const t=e=>/* @__PURE__ */C("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
- return C(E,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */C("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var R=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:R,className:U="",id:K,disabled:B,size:L,touchSize:M,title:V,multiple:F,renderOption:P,renderValue:W,valueText:Y,readOnly:G=!1,footer:J,changed:X=!1,auto:Z,"aria-describedby":q,"aria-label":Q,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!J?.length,me="sm"===L,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=K??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),He=Z??je,Se=`${ke}-auto`,Te=[q,X?De:void 0,He?Se:void 0].filter(Boolean).join(" ")||void 0,Ie=j(()=>n(N),[N]),Ce=F?l:[],Ee=u,Oe=f(oe,re,{matchTriggerWidth:!0,...J?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${N.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Ae=F?Ie.findIndex(e=>Ce.includes(e.value)):Ie.findIndex(e=>e.value===l),Re=F?Ie.filter(e=>Ce.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?Ie[Ae].label:void 0,Ue=!F&&Ae>=0?Ie[Ae].lang:void 0,Ke=F?Ie.filter(e=>Ce.includes(e.value)):Ae>=0?[Ie[Ae]]:[],Be=W&&Ke.length?W(Ke):void 0,Le=void 0!==Be&&Y?Y(Ke):void 0,Me=H((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Ve=H(()=>{B||G||(ae(Ae>=0?Ae:e(Ie)),ie(!0))},[B,G,Ie,Ae]),Fe=H(e=>{const t=Ie[e];if(t&&!t.disabled){if(F){const r=l;return Ee(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ee(t.value),Me()}},[Ie,F,l,Ee,Me]);S(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Me(),!0),ue)},[re,Me]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Me(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Me(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Me]),S(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Pe=H(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Ae,n=t(Ie,r.buffer,i);n<0||(re?ae(n):F?(ae(n),ie(!0)):Fe(n))},[re,ne,Ae,Ie,Fe,F]),We=re?a(N,(e,t)=>{const r=(i=e.value,F?Ce.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
5
- return I("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||P?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Fe(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${F?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[F&&/* @__PURE__ */C(o,{selected:r}),P?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1 truncate",children:P(e,{selected:r,active:n})}):F?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1",children:[
1
+ import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-K5YT5PMJ.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-ISVODSRP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-JSHMIMAJ.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as S,useCallback as j,useEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as I,jsx as C,Fragment as E}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),S=f??D,j=w(),H=/* @__PURE__ */I("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,S?j:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:S,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:i}),
2
+ /* @__PURE__ */C(A,{items:r})]});return S?/* @__PURE__ */I(E,{children:[H,
3
+ /* @__PURE__ */C("span",{id:j,hidden:!0,children:$.settingView.auto})]}):H});function A({items:e}){const t=e=>/* @__PURE__ */C("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
+ return C(E,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */C("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var K=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:K,className:M="",id:P,disabled:R,size:U,touchSize:V,title:B,multiple:Y,renderOption:J,renderValue:W,valueText:F,readOnly:L=!1,footer:G,changed:q=!1,auto:X,"aria-describedby":Q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!G?.length,me="sm"===U,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=P??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,Se=d(),je=X??Se,He=`${ke}-auto`,Te=[Q,q?De:void 0,je?He:void 0].filter(Boolean).join(" ")||void 0,Ie=S(()=>n(N),[N]),Ce=Y?l:[],Ee=u,Oe=f(oe,re,{matchTriggerWidth:!0,...G?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${N.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Ae=Y?Ie.findIndex(e=>Ce.includes(e.value)):Ie.findIndex(e=>e.value===l),Ke=Y?Ie.filter(e=>Ce.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?Ie[Ae].label:void 0,Me=!Y&&Ae>=0?Ie[Ae].lang:void 0,Pe=Y?Ie.filter(e=>Ce.includes(e.value)):Ae>=0?[Ie[Ae]]:[],Re=W&&Pe.length?W(Pe):void 0,Ue=void 0!==Re&&F?F(Pe):void 0,Ve=j((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Be=j(()=>{R||L||(ae(Ae>=0?Ae:e(Ie)),ie(!0))},[R,L,Ie,Ae]),Ye=j(e=>{const t=Ie[e];if(t&&!t.disabled){if(Y){const r=l;return Ee(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ee(t.value),Ve()}},[Ie,Y,l,Ee,Ve]);H(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Ve(),!0),ue)},[re,Ve]),H(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Ve(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ve(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Ve]),H(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Je=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Ae,n=t(Ie,r.buffer,i);n<0||(re?ae(n):Y?(ae(n),ie(!0)):Ye(n))},[re,ne,Ae,Ie,Ye,Y]),We=re?a(N,(e,t)=>{const r=(i=e.value,Y?Ce.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
5
+ return I("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||J?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Ye(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${Y?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[Y&&/* @__PURE__ */C(o,{selected:r}),J?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1 truncate",children:J(e,{selected:r,active:n})}):Y?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1",children:[
6
6
  /* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
7
  /* @__PURE__ */I(E,{children:[
8
- /* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Ye=void 0!==Be?
8
+ /* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Fe=void 0!==Re?
9
9
  /* @__PURE__ */I("span",{className:"relative block min-w-0 truncate",children:[
10
- /* @__PURE__ */C("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Be}),
11
- /* @__PURE__ */C("span",{lang:void 0===Le?Ue:void 0,className:"sr-only",children:Le??Re})]}):/* @__PURE__ */C("span",{lang:Ue,className:`block truncate ${void 0===Re?c:""}`,children:Re??z??" "}),Ge={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...x()},Je=/* @__PURE__ */C("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Q?void 0:we),"aria-label":_?void 0:Q,"aria-multiselectable":F||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Ge,maxHeight:fe}:Ge,children:We}),Xe=pe?/* @__PURE__ */I("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Ge,children:[Je,
12
- /* @__PURE__ */C("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:J.map((e,t)=>/* @__PURE__ */I("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Me(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(J?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Me());case"Escape":return e.preventDefault(),e.stopPropagation(),void Me()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */C(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
- /* @__PURE__ */C("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Je;/* @__PURE__ */
10
+ /* @__PURE__ */C("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Re}),
11
+ /* @__PURE__ */C("span",{lang:void 0===Ue?Me:void 0,className:"sr-only",children:Ue??Ke})]}):/* @__PURE__ */C("span",{lang:Me,className:`block truncate ${void 0===Ke?c:""}`,children:Ke??z??" "}),Le={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...x()},Ge=/* @__PURE__ */C("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":Y||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Le,maxHeight:fe}:Le,children:We}),qe=pe?/* @__PURE__ */I("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Le,children:[Ge,
12
+ /* @__PURE__ */C("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:G.map((e,t)=>/* @__PURE__ */I("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Ve(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(G?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Ve());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ve()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */C(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
+ /* @__PURE__ */C("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Ge;/* @__PURE__ */
14
14
  return I("div",{ref:le,className:"relative",children:[
15
- /* @__PURE__ */C("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":R||void 0,"aria-describedby":Te,"aria-label":Q,"aria-labelledby":_,title:V,disabled:B,"aria-readonly":G||void 0,onClick:()=>re?Me():Ve(),onKeyDown:t=>{if(!B&&!G)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ie,e,1)):Ve());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ie,e,-1)):Ve());case"Home":return void(re&&(t.preventDefault(),ae(e(Ie))));case"End":return void(re&&(t.preventDefault(),ae(r(Ie))));case"Enter":return void(re&&(t.preventDefault(),Fe(ne)));case" ":return t.preventDefault(),void(re?Fe(ne):Ve());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Me()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Me(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Pe(t.key))}},className:s({invalid:R,size:L,readOnly:G,auto:He,className:`${G?"":"pr-8 "}text-left ${U}`.trim()}),children:X?
16
- /* @__PURE__ */I("span",{className:"flex min-w-0 items-center gap-1",children:[Ye,
17
- /* @__PURE__ */C("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ye}),X&&/* @__PURE__ */C("span",{id:De,hidden:!0,children:ge.select.changed}),He&&/* @__PURE__ */C("span",{id:Se,hidden:!0,children:ge.settingView.auto}),!G&&/* @__PURE__ */C(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
- /* @__PURE__ */I("select",{ref:te,value:l,multiple:F||void 0,onChange:e=>Ee(F?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:B,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!F&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:z}),
19
- /* @__PURE__ */C(A,{items:N})]}),re&&T(Xe,document.body)]})}),U=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */C(z,{ref:r,...t,size:n}):/* @__PURE__ */C(R,{ref:r,...t}):/* @__PURE__ */C(R,{ref:r,...t,size:n})});export{z as NativeSelect,U as Select_default};
15
+ /* @__PURE__ */C("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":K||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:B,disabled:R,"aria-readonly":L||void 0,onClick:()=>re?Ve():Be(),onKeyDown:t=>{if(!R&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ie,e,1)):Be());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ie,e,-1)):Be());case"Home":return void(re&&(t.preventDefault(),ae(e(Ie))));case"End":return void(re&&(t.preventDefault(),ae(r(Ie))));case"Enter":return void(re&&(t.preventDefault(),Ye(ne)));case" ":return t.preventDefault(),void(re?Ye(ne):Be());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Ve()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Ve(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Je(t.key))}},className:s({invalid:K,size:U,readOnly:L,auto:je,className:`${L?"":"pr-8 "}text-left ${M}`.trim()}),children:q?
16
+ /* @__PURE__ */I("span",{className:"flex min-w-0 items-center gap-1",children:[Fe,
17
+ /* @__PURE__ */C("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Fe}),q&&/* @__PURE__ */C("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */C("span",{id:He,hidden:!0,children:ge.settingView.auto}),!L&&/* @__PURE__ */C(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
+ /* @__PURE__ */I("select",{ref:te,value:l,multiple:Y||void 0,onChange:e=>Ee(Y?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:R,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!Y&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:z}),
19
+ /* @__PURE__ */C(A,{items:N})]}),re&&T(qe,document.body)]})}),M=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */C(z,{ref:r,...t,size:n}):/* @__PURE__ */C(K,{ref:r,...t}):/* @__PURE__ */C(K,{ref:r,...t,size:n})});export{z as NativeSelect,M as Select_default};
@@ -1,22 +1,22 @@
1
- import{ChartDefs as t,MOTION as e,stagger as a,fillFor as r,dashFor as o,maskId as l}from"./chunk-465RRWBY.js";import{ChartBrush as n}from"./chunk-TU2L7NW3.js";import{ChartDot as i}from"./chunk-CK2YOGUS.js";import{ChartSkeleton as s}from"./chunk-WXZZGHET.js";import{stepPath as c,curvePath as d,areaBetween as m,areaFrom as h}from"./chunk-VFC6QUEN.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-2DYVVHZA.js";import{usePlotWidth as x}from"./chunk-MAFUXCPZ.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{ChartTooltip as V}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as A,CHART_INK as W,STATUS_VARS as z}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as L}from"./chunk-TWVUQUUD.js";import{useShellStrings as S,useShellLocale as D}from"./chunk-JSHMIMAJ.js";import{formatPercent as E,formatPlain as R}from"./chunk-C3QOHMR6.js";import{useRef as C,useState as T,useId as U,useEffect as I}from"react";import{jsx as P,jsxs as F}from"react/jsx-runtime";var H=12,O=16,Y=26,Z=52,B=t=>"number"==typeof t&&Number.isFinite(t);function Q({series:Q,labels:J,height:G=200,stacked:K=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=S().charts,Vt=D(),At=rt??(t=>R(t,Vt)),Wt=ot??At,zt=jt??$t.noData,Lt=C(null),St=x(Lt),Dt=Nt??St,[Et,Rt]=T(null),[Ct,Tt]=T(null),{highlighted:Ut}=u(),It=U(),Pt=ut??Ct,Ft=p(ht&&Pt?Pt[1]-Pt[0]+1:J.length,pt);if(I(()=>{if(null!==Et)return L(t=>"Escape"===t.key&&(Rt(null),!0))},[Et]),kt)/* @__PURE__ */
2
- return P("div",{className:wt,ref:Lt,children:/* @__PURE__ */P(s,{height:G,width:Nt??St})});const Ht=J,Ot=ut??Ct??[0,Math.max(0,Ht.length-1)],[Yt,Zt]=Ot,Bt=t=>Ft.slice(ht?t.slice(Yt,Zt+1):t),Qt=lt?Bt(lt):void 0,Jt=Q.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(B)).map(t=>({...t,data:Bt(t.data),pointTones:t.pointTones?Bt(t.pointTones):void 0})),Gt=t=>(ht?Yt:0)+(Ft.view?.[0]??0)+t;if(J=Bt(Ht),0===Jt.length||0===J.length)/* @__PURE__ */
1
+ import{ChartBrush as t}from"./chunk-TU2L7NW3.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-WXZZGHET.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-2DYVVHZA.js";import{usePlotWidth as x}from"./chunk-MAFUXCPZ.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{ChartTooltip as V}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as A,CHART_INK as W,STATUS_VARS as z}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as L}from"./chunk-TWVUQUUD.js";import{useShellStrings as S,useShellLocale as D}from"./chunk-JSHMIMAJ.js";import{formatPercent as E,formatPlain as R}from"./chunk-C3QOHMR6.js";import{useRef as C,useState as T,useId as U,useEffect as I}from"react";import{jsx as P,jsxs as F}from"react/jsx-runtime";var H=12,O=16,Y=26,Z=52,B=t=>"number"==typeof t&&Number.isFinite(t);function Q({series:Q,labels:J,height:G=200,stacked:K=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=S().charts,Vt=D(),At=rt??(t=>R(t,Vt)),Wt=ot??At,zt=jt??$t.noData,Lt=C(null),St=x(Lt),Dt=Nt??St,[Et,Rt]=T(null),[Ct,Tt]=T(null),{highlighted:Ut}=u(),It=U(),Pt=ut??Ct,Ft=p(ht&&Pt?Pt[1]-Pt[0]+1:J.length,pt);if(I(()=>{if(null!==Et)return L(t=>"Escape"===t.key&&(Rt(null),!0))},[Et]),kt)/* @__PURE__ */
2
+ return P("div",{className:wt,ref:Lt,children:/* @__PURE__ */P(h,{height:G,width:Nt??St})});const Ht=J,Ot=ut??Ct??[0,Math.max(0,Ht.length-1)],[Yt,Zt]=Ot,Bt=t=>Ft.slice(ht?t.slice(Yt,Zt+1):t),Qt=lt?Bt(lt):void 0,Jt=Q.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(B)).map(t=>({...t,data:Bt(t.data),pointTones:t.pointTones?Bt(t.pointTones):void 0})),Gt=t=>(ht?Yt:0)+(Ft.view?.[0]??0)+t;if(J=Bt(Ht),0===Jt.length||0===J.length)/* @__PURE__ */
3
3
  return P("div",{className:wt,ref:Lt,children:/* @__PURE__ */P("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:G},children:zt})});const Kt=J.map((t,e)=>Jt.reduce((t,a)=>t+(B(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Kt[e]>0?t/Kt[e]:null,qt=[];if(K){let t=J.map(()=>0);for(const e of Jt)t=t.map((t,a)=>t+(B(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!K&&!_t&&void 0===et&&Jt.some(te)&&Jt.some(t=>!te(t)),ae=gt&&!K?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Jt.filter(t=>!te(t)):Jt).filter(t=>!re(t)),le=ee?Jt.filter(te).flatMap(t=>t.data.filter(B)):[],ne=K?(qt.at(-1)??[]).filter(B):oe.flatMap(t=>t.data.filter(B)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:K&&"percent"===X||_t||void 0!==et?null:b(K?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=K&&"percent"===X?1:se?se.hi:et??M(Math.max(...ne,0)),me=K&&"percent"===X?t=>E(Math.round(100*t),0,Vt):At,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),Z),fe=ie?w(ie.right.ticks.map(At),O):O,pe={left:ue,right:Math.max(ue+1,Dt-fe),top:H,bottom:G-Y},ge=j(J.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Jt.filter(re),Me=Math.max(0,...J.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,B(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),Rt(e=>{const a=(e??0)+t;return Math.min(J.length-1,Math.max(0,a))})},Ae=Math.max(1,Math.ceil(J.length/Math.max(1,Math.floor(Dt/96))));/* @__PURE__ */
4
4
  return F("div",{className:`relative ${wt??""}`,ref:Lt,children:[
5
5
  /* @__PURE__ */F("svg",{width:"100%",height:G,viewBox:`0 0 ${Dt} ${G}`,role:"img","aria-label":$t.overIntervals(Jt.map(t=>t.label),J.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Rt(null),onBlur:()=>Rt(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Et&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Gt(Et));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
6
6
  /* @__PURE__ */P("defs",{children:/* @__PURE__ */P("clipPath",{id:It,children:/* @__PURE__ */P("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
7
- /* @__PURE__ */P(t,{id:It,fills:Jt.map((t,e)=>({color:A(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:K?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:W.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
7
+ /* @__PURE__ */P(n,{id:It,fills:Jt.map((t,e)=>({color:A(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:K?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:W.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
8
8
  /* @__PURE__ */P("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:W.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */P("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */P("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */P("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:W.label,children:nt}),
9
- /* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${l(It)})`:void 0,children:Jt.map((t,l)=>{const n=A(t.slot,t.color,t.tone),i=t.mode??(K?"area":"line"),s=f(t.key,Ut);if("step"===i){const e=J.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>B(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
10
- return P("path",{d:c(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},t.key)}const u=J.map((e,a)=>{const r=K?qt[l]?.[a]:t.data[a];return B(r)?[ge.center(a),je(t)(r)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===i){const r=Math.max(1,.62*ge.bandwidth),o="solid"===t.fillVariant,i=je(t);return re(t)?/* @__PURE__ */P("g",{opacity:s??void 0,className:"rosh-viz-mark",children:J.map((e,a)=>{const i=t.data[a];if(!B(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Jt[t]?.key)).reduce((t,a)=>t+Math.max(0,B(a.data[e])?a.data[e]:0),0))(l,a),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
11
- return P("rect",{x:ge.center(a)-r/2,y:c,width:r,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[a]?z[t.pointTones[a]]:n,fillOpacity:o?1:.55},a)})},t.key):/* @__PURE__ */P("g",{opacity:s??void 0,className:"rosh-viz-mark",children:J.map((s,c)=>{const d=K?qt[l]?.[c]:t.data[c];if(!B(d))return null;const m=i(d);/* @__PURE__ */
12
- return P("rect",{x:ge.center(c)-r/2,y:Math.min(m,xe),width:r,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:o?1:.35,className:xt?e.rise:void 0,style:xt?a(c,26):void 0},c)})},t.key)}const p=d(u,_,tt),g=K&&l>0?J.map((t,e)=>[ge.center(e),ve(qt[l-1]?.[e]??0)-2]):null,y=g?m(p,g):h(p,u,xe);/* @__PURE__ */
13
- return F("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===i||K)&&
14
- /* @__PURE__ */P("path",{d:y,fill:r(It,l,t.fillVariant??bt,n),stroke:"none"}),
15
- /* @__PURE__ */P("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:o(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?e.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??z[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
9
+ /* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${m(It)})`:void 0,children:Jt.map((t,e)=>{const n=A(t.slot,t.color,t.tone),m=t.mode??(K?"area":"line"),h=f(t.key,Ut);if("step"===m){const e=J.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>B(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
10
+ return P("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=J.map((a,r)=>{const o=K?qt[e]?.[r]:t.data[r];return B(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((o,l)=>{const i=t.data[l];if(!B(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Jt[t]?.key)).reduce((t,a)=>t+Math.max(0,B(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
11
+ return P("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?z[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((l,c)=>{const d=K?qt[e]?.[c]:t.data[c];if(!B(d))return null;const m=o(d);/* @__PURE__ */
12
+ return P("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=K&&e>0?J.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
13
+ return F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||K)&&
14
+ /* @__PURE__ */P("path",{d:y,fill:c(It,e,t.fillVariant??bt,n),stroke:"none"}),
15
+ /* @__PURE__ */P("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??z[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
16
16
  return F("g",{children:[
17
- /* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Jt.map((t,e)=>{if("column"===t.mode)return null;const a=ct??(st?"last":"none"),r=A(t.slot,t.color,t.tone),o=[...t.data].map(B).lastIndexOf(!0),l="all"===a?J.map((t,e)=>e).filter(a=>B(K?qt[e]?.[a]:t.data[a])):o>=0?[o]:[];/* @__PURE__ */
18
- return F("g",{children:[l.map(a=>{const l=K?qt[e]?.[a]:t.data[a];return B(l)?/* @__PURE__ */P(i,{cx:ge.center(a),cy:je(t)(l),color:r,variant:dt,pulse:mt&&a===o,title:`${J[a]}: ${t.label} ${At(l)}`},a):null}),st&&o>=0&&B(K?qt[e]?.[o]:t.data[o])&&/* @__PURE__ */P("text",{x:ge.center(o)-10,y:je(t)(K?qt[e]?.[o]:t.data[o])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(K?qt[e]?.[o]:t.data[o])})]},`dots-${t.key}`)}),J.map((t,e)=>e%Ae===0?/* @__PURE__ */P("text",{x:ge.center(e),y:G-8,textAnchor:"middle",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Et&&/* @__PURE__ */P("line",{x1:ge.center(Et),y1:pe.top,x2:ge.center(Et),y2:pe.bottom,stroke:W.axis,strokeWidth:1}),ae&&Me>0&&
17
+ /* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Jt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=A(t.slot,t.color,t.tone),l=[...t.data].map(B).lastIndexOf(!0),n="all"===r?J.map((t,e)=>e).filter(e=>B(K?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
18
+ return F("g",{children:[n.map(r=>{const n=K?qt[a]?.[r]:t.data[r];return B(n)?/* @__PURE__ */P(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${J[r]}: ${t.label} ${At(n)}`},r):null}),st&&l>=0&&B(K?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */P("text",{x:ge.center(l)-10,y:je(t)(K?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(K?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),J.map((t,e)=>e%Ae===0?/* @__PURE__ */P("text",{x:ge.center(e),y:G-8,textAnchor:"middle",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Et&&/* @__PURE__ */P("line",{x1:ge.center(Et),y1:pe.top,x2:ge.center(Et),y2:pe.bottom,stroke:W.axis,strokeWidth:1}),ae&&Me>0&&
19
19
  /* @__PURE__ */F("g",{pointerEvents:"none","data-column-strip":"true",children:[
20
20
  /* @__PURE__ */P("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:W.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
21
- /* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(Me)})]}),Ft.drag&&/* @__PURE__ */P(g,{x0:ge(Ft.drag[0]),x1:ge(Ft.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),J.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Rt(e),onPointerDown:()=>Ft.press(e),onPointerEnter:()=>Ft.over(e),onPointerUp:Ft.release,onClick:yt?()=>yt(Gt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Ft.view&&/* @__PURE__ */P(y,{from:Qt?.[0]??J[0],to:Qt?.at(-1)??J[J.length-1],count:J.length,total:K&&"percent"!==X?Wt(Kt.reduce((t,e)=>t+e,0)):ae?Wt(be.reduce((t,e)=>t+e.data.filter(B).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Jt).filter(t=>t.data.some(B)).map(t=>{const e=t.data.filter(B),a=A(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=K||"column"===t.mode?Wt(r):$t.zoomLevel(Wt(r/e.length),Wt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Ft.clear}),ht&&Ht.length>2&&/* @__PURE__ */P(n,{className:"mt-1",labels:Ht,width:Dt,data:Q[0]?.data??[],range:Ot,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Et&&
21
+ /* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(Me)})]}),Ft.drag&&/* @__PURE__ */P(g,{x0:ge(Ft.drag[0]),x1:ge(Ft.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),J.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Rt(e),onPointerDown:()=>Ft.press(e),onPointerEnter:()=>Ft.over(e),onPointerUp:Ft.release,onClick:yt?()=>yt(Gt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Ft.view&&/* @__PURE__ */P(y,{from:Qt?.[0]??J[0],to:Qt?.at(-1)??J[J.length-1],count:J.length,total:K&&"percent"!==X?Wt(Kt.reduce((t,e)=>t+e,0)):ae?Wt(be.reduce((t,e)=>t+e.data.filter(B).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Jt).filter(t=>t.data.some(B)).map(t=>{const e=t.data.filter(B),a=A(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=K||"column"===t.mode?Wt(r):$t.zoomLevel(Wt(r/e.length),Wt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Ft.clear}),ht&&Ht.length>2&&/* @__PURE__ */P(t,{className:"mt-1",labels:Ht,width:Dt,data:Q[0]?.data??[],range:Ot,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Et&&
22
22
  /* @__PURE__ */P("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(Et),ge.bandwidth,Dt),children:/* @__PURE__ */P(V,{title:Qt?.[Et]??J[Et],rows:Jt.map((t,e)=>({key:t.key,label:t.label,color:A(t.slot,t.color,t.tone),value:B(t.data[Et])?K&&"percent"===X?`${E(100*(Xt(t.data[Et],Et)??0),1,Vt)} · ${Wt(t.data[Et])}`:Wt(t.data[Et]):void 0})),footnote:K&&"percent"===X?$t.inBucket(Wt(Kt[Et])):void 0})})]})}export{Q as TimeSeriesChart};
@@ -1,21 +1,21 @@
1
- import{Markdown as e}from"./chunk-LPPJNZQ6.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-XZXFUZIK.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-JSHMIMAJ.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),L=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),Z=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),_=n(()=>L.map(e=>({...e,docs:e.docs.filter(Z)})).filter(e=>e.docs.length>0),[L,M]),A=n(()=>_.flatMap(e=>e.docs),[_]),E=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,J=e=>!!M||(C[e]??e===E?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-YYGJJ6EI.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-JSHMIMAJ.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[v,N]=a(""),[w,k]=a(null),[C,j]=a({}),M=v.trim().toLowerCase(),Y=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),A=n(()=>Y.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[Y,M]),E=n(()=>A.flatMap(e=>e.docs),[A]),J=(w?E.find(e=>e.slug===w):void 0)??E[0]??null,L=e=>!!M||(C[e]??e===J?.category);/* @__PURE__ */
2
2
  return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
3
3
  /* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
4
4
  /* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
5
5
  /* @__PURE__ */o("h2",{className:"text-sm font-semibold text-gray-900",children:y.help.title}),u&&g&&/* @__PURE__ */o("button",{type:"button",onClick:g,className:"text-xs text-blue-600 hover:underline",children:y.help.newArticle})]}),
6
6
  /* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
7
7
  /* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
8
- /* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
- /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===_.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):_.map(e=>{const t=J(e.key);/* @__PURE__ */
8
+ /* @__PURE__ */o("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===A.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):A.map(e=>{const t=L(e.key);/* @__PURE__ */
10
10
  return i("div",{className:"py-0.5",children:[
11
- /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!J(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
11
+ /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!L(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
12
12
  /* @__PURE__ */o(d,{open:t}),
13
- /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=E?.slug===e.slug;/* @__PURE__ */
13
+ /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=J?.slug===e.slug;/* @__PURE__ */
14
14
  return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
15
15
  /* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
16
- /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:E?/* @__PURE__ */i(c,{children:[
16
+ /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:J?/* @__PURE__ */i(c,{children:[
17
17
  /* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
18
18
  /* @__PURE__ */i("div",{className:"min-w-0",children:[
19
- /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:E.title}),
20
- /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[E.category_label,!1===E.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(E),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
- /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(E):E.body?/* @__PURE__ */o(e,{children:E.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
19
+ /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:J.title}),
20
+ /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[J.category_label,!1===J.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(J),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(J):J.body?/* @__PURE__ */o(e,{children:J.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
@@ -0,0 +1,6 @@
1
+ import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-HNEI2RKX.js";import{IconButton_default as a}from"./chunk-SV5RRBVA.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useShellStrings as s}from"./chunk-JSHMIMAJ.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
2
+ return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:M,letterCase:D,clear:x,disabled:y=!1,"aria-label":S,windows:I,className:R="",layout:A="grid"}){const j=s().textToolbar,q=w({offered:n,color:k,last:N,alignment:C,list:M,letterCase:D,clear:x});if(!q.words&&!q.paragraph)return null;const B=m(n,k,x,q.cells.paragraph),$=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,K=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:$(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:$(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,L=l(j),T=e.map(e=>[e,L[e],r(e)]),H=C?e.filter(e=>C.allow.includes(e)):[],O=C&&H.includes(C.value)?C.value:H[0],U=[["none",j.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",j.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",j.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],V=x&&B?g(j.clear,/* @__PURE__ */i(a,{className:$(!1),"aria-label":j.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,E=/* @__PURE__ */t(d,{children:[K("bold",j.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),K("italic",j.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),K("underline",j.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),K("strike",j.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(j.color,/* @__PURE__ */i(a,{pressed:k.open,className:$(k.open,"rosh-tb-color"),"aria-label":j.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,K("link",j.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),K("sup",j.sup,/* @__PURE__ */i(o,{name:"superscript"})),K("sub",j.sub,/* @__PURE__ */i(o,{name:"subscript"})),K("code",j.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===B?V:null]}),J=/* @__PURE__ */t(d,{children:[C&&H.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.alignment,onKeyDown:e=>p(e,H,e=>C.onChange(e)),children:T.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:$(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===O?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,M&&n.has("bullet")?g(j.bullet,/* @__PURE__ */i(a,{className:$("bullet"===M.pressed),"aria-label":j.bullet,"aria-pressed":"bullet"===M.pressed,disabled:y,onMouseDown:c,onClick:()=>M.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,M&&n.has("number")?g(j.number,/* @__PURE__ */i(a,{className:$("number"===M.pressed),"aria-label":j.number,"aria-pressed":"number"===M.pressed,disabled:y,onMouseDown:c,onClick:()=>M.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,K("quote",j.quote,/* @__PURE__ */i(o,{name:"quote"})),D?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.letterCase,onKeyDown:e=>p(e,U.map(([e])=>e),e=>D.onChange(e)),children:U.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:D.value===e,className:$(D.value===e),"aria-checked":D.value===e,"aria-label":l,tabIndex:e===(D.value||"none")?0:-1,disabled:y||D.disabled,onMouseDown:c,onClick:()=>D.onChange(D.value===e?"":e),children:r},e)))}):null,"paragraph"===B?V:null]}),P="row"===A,W=P?" is-row":q.flow?" is-flow":q.oneRow?" is-one-row":q.words&&void 0===N&&"words"!==B?" is-eight":"",X=b(n,Boolean(k)),Z={"--rosh-tb-color-col":String(X.color),"--rosh-tb-link-col":String(X.link),...P?{"--rosh-tb-cells":String(q.cells.words+q.cells.paragraph),"--rosh-tb-groupgap":q.words&&q.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let z;return z=P?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:E}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:J}):null]}):q.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[E,
3
+ /* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),J]}):q.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
4
+ /* @__PURE__ */i("div",{className:"rosh-tb-words",children:E}),
5
+ /* @__PURE__ */i("div",{className:"rosh-tb-para",children:J})]}):/* @__PURE__ */t(d,{children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==B?" is-eight":""),children:E}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:J}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${W} ${R}`.trim(),style:Z,children:[
6
+ /* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":S??j.formatting,children:z}),I]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
@@ -1,27 +1,27 @@
1
- import{Dialog as e}from"./chunk-D2WJAF62.js";import{Icon as t}from"./chunk-XZXFUZIK.js";import{buttonClasses as r}from"./chunk-UQYNPYF4.js";import{useShellStrings as n,splitAround as o}from"./chunk-JSHMIMAJ.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:r({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:r({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:r({variant:"primary"})}},w=r({variant:"secondary"}),C=r({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function P(){/* @__PURE__ */
2
- return m(t,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F(){/* @__PURE__ */
3
- return m(t,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),j=a(null),E=a(0),T=a([]),W=a(null),$=a(null),D=c(e=>{j.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),J=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++E.current,options:t,resolve:e};null===j.current?D(r):T.current.push(r)})},[D]),[K,A]=s(!1),[I,M]=s({message:""}),[U,X]=s(""),Y=a(),Z=c(e=>(M(e),X(""),A(!0),new Promise(e=>{Y.current=e})),[]),[H,Q]=s(!1),[S,V]=s({}),[q,z]=s(""),B=a(),G=c(e=>{const t="string"==typeof e?{message:e}:e;return V(t),z(t.defaultValue??""),Q(!0),new Promise(e=>{B.current=e})},[]);u(()=>{g=J,v=Z,x=G},[J,Z,G]);const O=(e,t)=>{if(j.current!==e)return;const r=N.current,n=T.current.shift();n?D(n):(j.current=null,N.current=void 0,l(!1)),r?.(t)},R=e=>{A(!1),X(""),Y.current?.(e)},_=e=>{if(e){const e=q.trim();if(!e&&!S.allowEmpty)return Q(!1),void B.current?.(null);Q(!1),B.current?.(e)}else Q(!1),B.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===I.variant?"warning":"danger"],ne=I.confirmWord,oe=null==ne||U===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
4
- return d(f.Provider,{value:J,children:[t,
5
- /* @__PURE__ */m(e,{open:r,onClose:()=>O(p,!1),initialFocus:W,footer:/* @__PURE__ */d(h,{children:[
6
- /* @__PURE__ */m("button",{ref:W,type:"button",onClick:()=>O(p,!1),className:w,children:i.cancelLabel||le.cancel}),
7
- /* @__PURE__ */m("button",{type:"button",onClick:()=>O(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
8
- /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(P,{})}),
1
+ import{Dialog as e}from"./chunk-64J7TYJ3.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{buttonClasses as r}from"./chunk-UQYNPYF4.js";import{useShellStrings as n,splitAround as o}from"./chunk-JSHMIMAJ.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:r({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:r({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:r({variant:"primary"})}},w=r({variant:"secondary"}),C=r({variant:"primary"}),P="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function L(){/* @__PURE__ */
2
+ return m(t,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j(){/* @__PURE__ */
3
+ return m(t,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),F=a(null),E=a(0),T=a([]),J=a(null),$=a(null),D=c(e=>{F.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),S=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++E.current,options:t,resolve:e};null===F.current?D(r):T.current.push(r)})},[D]),[W,Y]=s(!1),[I,K]=s({message:""}),[M,V]=s(""),A=a(),H=c(e=>(K(e),V(""),Y(!0),new Promise(e=>{A.current=e})),[]),[O,Q]=s(!1),[R,U]=s({}),[q,z]=s(""),B=a(),G=c(e=>{const t="string"==typeof e?{message:e}:e;return U(t),z(t.defaultValue??""),Q(!0),new Promise(e=>{B.current=e})},[]);u(()=>{g=S,v=H,x=G},[S,H,G]);const X=(e,t)=>{if(F.current!==e)return;const r=N.current,n=T.current.shift();n?D(n):(F.current=null,N.current=void 0,l(!1)),r?.(t)},Z=e=>{Y(!1),V(""),A.current?.(e)},_=e=>{if(e){const e=q.trim();if(!e&&!R.allowEmpty)return Q(!1),void B.current?.(null);Q(!1),B.current?.(e)}else Q(!1),B.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===I.variant?"warning":"danger"],ne=I.confirmWord,oe=null==ne||M===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
4
+ return d(f.Provider,{value:S,children:[t,
5
+ /* @__PURE__ */m(e,{open:r,onClose:()=>X(p,!1),initialFocus:J,footer:/* @__PURE__ */d(h,{children:[
6
+ /* @__PURE__ */m("button",{ref:J,type:"button",onClick:()=>X(p,!1),className:w,children:i.cancelLabel||le.cancel}),
7
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>X(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
8
+ /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(L,{})}),
9
9
  /* @__PURE__ */d("div",{className:"flex-1",children:[
10
10
  /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:i.title||le.confirmTitle}),
11
11
  /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:i.message})]})]})}),
12
- /* @__PURE__ */d(e,{open:K,onClose:()=>R(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
13
- /* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>R(!1),className:w,children:I.cancelLabel||le.destructiveCancel}),
14
- /* @__PURE__ */m("button",{type:"button",onClick:()=>R(!0),disabled:!oe,className:re.button,children:ne??I.confirmLabel??le.destructiveConfirm})]}),children:[
15
- /* @__PURE__ */m("button",{type:"button",onClick:()=>R(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(F,{})}),
12
+ /* @__PURE__ */d(e,{open:W,onClose:()=>Z(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
13
+ /* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>Z(!1),className:w,children:I.cancelLabel||le.destructiveCancel}),
14
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!0),disabled:!oe,className:re.button,children:ne??I.confirmLabel??le.destructiveConfirm})]}),children:[
15
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(j,{})}),
16
16
  /* @__PURE__ */d("div",{className:"flex gap-4",children:[
17
- /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(P,{})}),
17
+ /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(L,{})}),
18
18
  /* @__PURE__ */d("div",{className:"flex-1",children:[
19
19
  /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:I.title||le.destructiveTitle}),
20
20
  /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:I.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
21
21
  /* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
22
22
  /* @__PURE__ */m("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),se]}),
23
- /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:U,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key&&U===ne&&R(!0)},placeholder:ne,className:`mt-2 ${L} focus:border-red-500`})]})]})]})]}),
24
- /* @__PURE__ */d(e,{open:H,onClose:()=>_(!1),title:S.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
25
- /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:S.cancelLabel||le.cancel}),
26
- /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!S.allowEmpty&&!q.trim(),className:C,children:S.confirmLabel||le.ok})]}),children:[S.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:S.message}),
27
- /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:q,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:S.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{j as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
23
+ /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:M,onChange:e=>V(e.target.value),onKeyDown:e=>{"Enter"===e.key&&M===ne&&Z(!0)},placeholder:ne,className:`mt-2 ${P} focus:border-red-500`})]})]})]})]}),
24
+ /* @__PURE__ */d(e,{open:O,onClose:()=>_(!1),title:R.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
25
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:R.cancelLabel||le.cancel}),
26
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!R.allowEmpty&&!q.trim(),className:C,children:R.confirmLabel||le.ok})]}),children:[R.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:R.message}),
27
+ /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:q,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:R.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
@@ -1,4 +1,4 @@
1
- import{isSafeLinkHref as e}from"./chunk-Z5TE3MEG.js";import{Button_default as t}from"./chunk-EVYD6UFQ.js";import{Icon as n}from"./chunk-XZXFUZIK.js";import{useShellStrings as r}from"./chunk-JSHMIMAJ.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
1
+ import{isSafeLinkHref as e}from"./chunk-Z5TE3MEG.js";import{Button_default as t}from"./chunk-EVYD6UFQ.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useShellStrings as r}from"./chunk-JSHMIMAJ.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
2
2
  return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
3
3
  /* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
4
4
  /* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-XZXFUZIK.js";import{SpinnerRing as t}from"./chunk-R2VKEMZH.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
1
+ import{Icon as e}from"./chunk-ISVODSRP.js";import{SpinnerRing as t}from"./chunk-R2VKEMZH.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
2
2
  /* @__PURE__ */l("button",{type:"button",onClick:()=>{h(!x),d?.(!x)},"aria-expanded":x,"aria-controls":x?g:void 0,className:"flex w-full items-center gap-2 rounded text-left hover:text-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",children:[
3
3
  /* @__PURE__ */n(e,{name:"chevron-right",size:12,className:"shrink-0 motion-safe:transition-transform "+(x?"rotate-90":"")}),
4
4
  /* @__PURE__ */n("span",{"aria-live":"polite",className:"min-w-0 flex-1 truncate",children:t})]}),x&&/* @__PURE__ */n("ol",{id:g,"aria-label":m,className:"mt-2 ml-2 space-y-2 border-l border-gray-200 pl-3",children:p})]})}var o={pending:"text-gray-400",active:"text-gray-800",complete:"text-gray-600",failed:"text-red-600",stopped:"text-gray-500",waiting:"text-amber-700",skipped:"text-gray-400"},d={pending:"Pending",active:"In progress",complete:"Done",failed:"Failed",stopped:"Stopped",waiting:"Waiting for you",skipped:"Skipped"};function m({status:a}){switch(a){case"active":/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-CEIIQRK5.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-6RK6R3RY.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
1
+ import{Card as e}from"./chunk-CEIIQRK5.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-PT4GMPUB.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
2
2
  return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
3
3
  /* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
4
4
  /* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),