efficient-shell 12.18.0 → 12.19.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 (196) hide show
  1. package/dist/{Browser-U6V2IAOZ.js → Browser-AUAKVIMA.js} +14 -14
  2. package/dist/Calculator-OUPD7SZV.js +29 -0
  3. package/dist/{CurrencyConverter-34AMD4W7.js → CurrencyConverter-CNGYEKE3.js} +9 -9
  4. package/dist/Files-QL6GDJGG.js +141 -0
  5. package/dist/{Notepad-F3Z4ZFVY.js → Notepad-FFGF3MKM.js} +9 -9
  6. package/dist/{PdfViewer-F2TCC5UD.js → PdfViewer-UY5SRC63.js} +1 -1
  7. package/dist/{PomodoroTimer-6WR3UOOM.js → PomodoroTimer-I53C5QYM.js} +65 -65
  8. package/dist/{Preview-HSW3BKA5.js → Preview-76X3G42U.js} +34 -34
  9. package/dist/{Sidebar-ADAIERCI.js → Sidebar-BKNCPUOE.js} +37 -37
  10. package/dist/{Stock-UAGSFAKY.js → Stock-JY3PJI2M.js} +2 -2
  11. package/dist/{Weather-G2VGEQX2.js → Weather-POQXLYFA.js} +17 -17
  12. package/dist/{WorldClock-43KK7OTT.js → WorldClock-FUJOPJ5G.js} +6 -6
  13. package/dist/ai/index.d.ts +59 -3
  14. package/dist/ai/index.js +110 -91
  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/{chunk-MFJHLC5M.js → chunk-34EBBZFK.js} +1 -1
  22. package/dist/{chunk-T3JSUBIF.js → chunk-34TQBJ7I.js} +1 -1
  23. package/dist/{chunk-EEAY7FJW.js → chunk-3CKYFCX4.js} +18 -18
  24. package/dist/{chunk-FQHPGREQ.js → chunk-3E3LR2PM.js} +12 -12
  25. package/dist/{chunk-KSMEWOCE.js → chunk-3J3FBYIZ.js} +1 -1
  26. package/dist/{chunk-JAVTQART.js → chunk-3JL4TCA7.js} +1 -1
  27. package/dist/{chunk-DVYBJOD3.js → chunk-436PJFHC.js} +10 -10
  28. package/dist/{chunk-DCNSQGHJ.js → chunk-4ZLFAXOC.js} +11 -11
  29. package/dist/{chunk-24LO6OH4.js → chunk-4ZRGMK7Y.js} +1 -1
  30. package/dist/{chunk-7ARBBWPQ.js → chunk-6FZ5JTBY.js} +2 -2
  31. package/dist/{chunk-7X2P6IH3.js → chunk-6GWYFUME.js} +5 -5
  32. package/dist/{chunk-ZKGUBIBT.js → chunk-6RK6R3RY.js} +1 -1
  33. package/dist/{chunk-XJW65EIG.js → chunk-7LTU5TJD.js} +1 -1
  34. package/dist/chunk-7U3BSTN2.js +1 -0
  35. package/dist/{chunk-4KXATGI3.js → chunk-B4GCTNGM.js} +5 -5
  36. package/dist/{chunk-XKJGJNY2.js → chunk-B4GRHE44.js} +3 -3
  37. package/dist/{chunk-ZE7OVMDM.js → chunk-BM2QIV64.js} +22 -22
  38. package/dist/{chunk-QPYVCG74.js → chunk-CCK2UWQ5.js} +10 -10
  39. package/dist/{chunk-WQ4YKWN2.js → chunk-CJHYOHMU.js} +1 -1
  40. package/dist/chunk-D2WJAF62.js +4 -0
  41. package/dist/{chunk-6TIJH2M6.js → chunk-DCCYUCBM.js} +1 -1
  42. package/dist/{chunk-Y6E7IRK2.js → chunk-DK5SXOXJ.js} +1 -1
  43. package/dist/{chunk-Z62RBVEJ.js → chunk-DTSOYFQE.js} +1 -1
  44. package/dist/{chunk-I76W4ZNU.js → chunk-FBUFB536.js} +4 -4
  45. package/dist/{chunk-RMDVKQJE.js → chunk-FE5DH5OM.js} +2 -2
  46. package/dist/{chunk-LQVQX5B2.js → chunk-FQ4IRBMA.js} +1 -1
  47. package/dist/{chunk-W7DYKTHE.js → chunk-FTMCNC66.js} +1 -1
  48. package/dist/{chunk-LNZMA4PB.js → chunk-GEZM6ARD.js} +1 -1
  49. package/dist/{chunk-RAOM3WIQ.js → chunk-GLRRX4AL.js} +1 -1
  50. package/dist/chunk-HMT3MES3.js +27 -0
  51. package/dist/{chunk-3A6FYWFQ.js → chunk-HOEHV2J5.js} +1 -1
  52. package/dist/{chunk-5MH5N76F.js → chunk-I7JU4IU3.js} +4 -4
  53. package/dist/{chunk-MBCUICY3.js → chunk-ILDPJ26Y.js} +1 -1
  54. package/dist/{chunk-XG5ER6GJ.js → chunk-JGRDG7CB.js} +5 -5
  55. package/dist/{chunk-HYPYNVQQ.js → chunk-JN5NUZ6D.js} +1 -1
  56. package/dist/chunk-JUXPKGO3.js +28 -0
  57. package/dist/{chunk-VYRVSTI6.js → chunk-KBI3T6UC.js} +9 -9
  58. package/dist/{chunk-UULBPDAH.js → chunk-KP2JYXEU.js} +8 -8
  59. package/dist/{chunk-H4ABSQS6.js → chunk-L543DFHF.js} +1 -1
  60. package/dist/chunk-LCEQIFPK.js +3 -0
  61. package/dist/{chunk-2DQHXJPM.js → chunk-LPPJNZQ6.js} +3 -3
  62. package/dist/{chunk-GJLN4NRB.js → chunk-ME7XHU3P.js} +6 -6
  63. package/dist/{chunk-NKP5WCEA.js → chunk-MFEPLP7Y.js} +6 -6
  64. package/dist/{chunk-WYGUHCJ2.js → chunk-N32LNPPP.js} +8 -8
  65. package/dist/{chunk-YU52WMSH.js → chunk-N3R6N7LG.js} +1 -1
  66. package/dist/{chunk-ZQT3GNRU.js → chunk-NAN2IW2H.js} +2 -2
  67. package/dist/{chunk-ZTRKM3B5.js → chunk-OG53D3R5.js} +9 -9
  68. package/dist/{chunk-OFYNPYY2.js → chunk-OGWQABFP.js} +1 -1
  69. package/dist/{chunk-EDX55XGV.js → chunk-OLCRYT3N.js} +8 -8
  70. package/dist/chunk-OQ6TECLX.js +6 -0
  71. package/dist/{chunk-J2YURAQY.js → chunk-QG37GJP2.js} +6 -6
  72. package/dist/{chunk-42XSMAIK.js → chunk-QI4235JY.js} +1 -1
  73. package/dist/{chunk-JTGRLXZN.js → chunk-QMSINDXL.js} +1 -1
  74. package/dist/{chunk-H32UNWVU.js → chunk-QPSJYSET.js} +5 -5
  75. package/dist/{chunk-HJF4UZOA.js → chunk-QZCLHKCI.js} +8 -8
  76. package/dist/{chunk-3ZQT26GZ.js → chunk-R62JKPYY.js} +1 -1
  77. package/dist/{chunk-5DQE6RQJ.js → chunk-RKXCB5ZJ.js} +1 -1
  78. package/dist/{chunk-6A26HUVK.js → chunk-RY7JCGLI.js} +1 -1
  79. package/dist/{chunk-GOEHP2XM.js → chunk-S7MNRAYS.js} +4 -4
  80. package/dist/{chunk-YVHEKEHJ.js → chunk-SET3R227.js} +1 -1
  81. package/dist/chunk-SFULX4E3.js +7 -0
  82. package/dist/{chunk-YK64FFLW.js → chunk-SSNTJ3M4.js} +4 -4
  83. package/dist/{chunk-3FNBUOZK.js → chunk-SY66VJAI.js} +1 -1
  84. package/dist/{chunk-4I4WZHMV.js → chunk-T2TZBTSM.js} +1 -1
  85. package/dist/{chunk-35CKKH2S.js → chunk-T6EB54LL.js} +1 -1
  86. package/dist/{chunk-ZICGXJUB.js → chunk-THLXDI76.js} +8 -8
  87. package/dist/{chunk-MJVFIH3J.js → chunk-TKUJUQK4.js} +9 -9
  88. package/dist/chunk-TM4CRQ3W.js +19 -0
  89. package/dist/chunk-TUPPFC74.js +14 -0
  90. package/dist/chunk-UP4HLGMZ.js +9 -0
  91. package/dist/{chunk-WLUJQLXG.js → chunk-UR2ECNBB.js} +1 -1
  92. package/dist/{chunk-OVD3ECM7.js → chunk-VLMBXPRM.js} +1 -1
  93. package/dist/{chunk-MRLXGLNZ.js → chunk-VQ4X3OBR.js} +1 -1
  94. package/dist/{chunk-PDA77NNC.js → chunk-X34ZBXIU.js} +3 -3
  95. package/dist/{chunk-TKPUYQ3Q.js → chunk-XQNZJNEJ.js} +73 -73
  96. package/dist/{chunk-DQMRPTGY.js → chunk-XVIJHDZ4.js} +3 -3
  97. package/dist/{chunk-JOAKKXTL.js → chunk-XZXFUZIK.js} +3 -2
  98. package/dist/{chunk-56XKHWNL.js → chunk-Y523KUQC.js} +1 -1
  99. package/dist/{chunk-ILIPEY3D.js → chunk-YI6SYUAK.js} +1 -1
  100. package/dist/{chunk-B2KQ3T7Q.js → chunk-YIUWX2IU.js} +6 -6
  101. package/dist/{chunk-PJE75B66.js → chunk-YRY64DQV.js} +1 -1
  102. package/dist/{chunk-I3TVRNUT.js → chunk-Z3CTYK3U.js} +1 -1
  103. package/dist/{chunk-YTZFWV2W.js → chunk-ZLKEPDJE.js} +1 -1
  104. package/dist/chunk-ZQ24H5UO.js +13 -0
  105. package/dist/data/EntityList.js +1 -1
  106. package/dist/data/ListLoadError.js +1 -1
  107. package/dist/data/ResizableTable.js +1 -1
  108. package/dist/forms/BorderInput.js +1 -1
  109. package/dist/forms/BrandAssetEditor.js +1 -1
  110. package/dist/forms/Calendar.js +1 -1
  111. package/dist/forms/ColorPicker.js +1 -1
  112. package/dist/forms/ComposerAttachments.js +1 -1
  113. package/dist/forms/CornersInput.js +1 -1
  114. package/dist/forms/DatePicker.js +1 -1
  115. package/dist/forms/DateRangePicker.js +1 -1
  116. package/dist/forms/DisplayChips.js +1 -1
  117. package/dist/forms/FilePicker.js +1 -1
  118. package/dist/forms/IconPicker.js +1 -1
  119. package/dist/forms/Input.js +1 -1
  120. package/dist/forms/InputNumber.js +1 -1
  121. package/dist/forms/LinkPicker.js +1 -1
  122. package/dist/forms/MediaLibrary.js +1 -1
  123. package/dist/forms/MediaUploadField.js +1 -1
  124. package/dist/forms/MediaUploadGrid.js +1 -1
  125. package/dist/forms/MediaUsedInList.js +1 -1
  126. package/dist/forms/PositionInput.js +1 -1
  127. package/dist/forms/RenameField.js +1 -1
  128. package/dist/forms/Select.js +1 -1
  129. package/dist/forms/SidesInput.js +1 -1
  130. package/dist/forms/Slider.js +1 -1
  131. package/dist/forms/Snippet.js +1 -1
  132. package/dist/forms/SplitButton.js +1 -1
  133. package/dist/forms/TagInput.js +1 -1
  134. package/dist/forms/TextToolbar.js +1 -1
  135. package/dist/forms/UnitMenu.js +1 -1
  136. package/dist/forms/WidthsBar.js +1 -1
  137. package/dist/forms/mediaLibraryMenu.js +1 -1
  138. package/dist/forms/textAlign.js +1 -1
  139. package/dist/icons/index.js +1 -1
  140. package/dist/index.js +492 -492
  141. package/dist/map/index.js +2 -2
  142. package/dist/markdown/index.js +1 -1
  143. package/dist/page-tabs/index.js +5 -5
  144. package/dist/pdf/index.js +1 -1
  145. package/dist/shell/AppUpdateBanner.js +1 -1
  146. package/dist/shell/Banner.js +1 -1
  147. package/dist/shell/Breadcrumbs.js +1 -1
  148. package/dist/shell/ColoredBadge.js +1 -1
  149. package/dist/shell/ConfirmDialog.js +1 -1
  150. package/dist/shell/ContextMenu.js +1 -1
  151. package/dist/shell/Dialog.js +1 -1
  152. package/dist/shell/Drawer.js +1 -1
  153. package/dist/shell/DropdownMenu.js +1 -1
  154. package/dist/shell/EmptyState.js +1 -1
  155. package/dist/shell/HelpCenter.js +1 -1
  156. package/dist/shell/ImageLightbox.js +1 -1
  157. package/dist/shell/LanguageSelect.js +1 -1
  158. package/dist/shell/Markdown.js +1 -1
  159. package/dist/shell/PageHeader.js +1 -1
  160. package/dist/shell/PopupMenu.js +1 -1
  161. package/dist/shell/ProductionTimeline.js +1 -1
  162. package/dist/shell/Result.js +1 -1
  163. package/dist/shell/SearchableSelect.js +1 -1
  164. package/dist/shell/SettingReset.js +1 -1
  165. package/dist/shell/SidebarLayout.js +1 -1
  166. package/dist/shell/SidebarNav.js +1 -1
  167. package/dist/shell/SortableList.js +1 -1
  168. package/dist/shell/StepChain.js +1 -1
  169. package/dist/shell/Stepper.js +1 -1
  170. package/dist/shell/TopNav.js +1 -1
  171. package/dist/shell/Tree.js +1 -1
  172. package/dist/shell/discardGuard.js +1 -1
  173. package/dist/telemetry/index.js +1 -1
  174. package/dist/templates/AuthScreen.js +1 -1
  175. package/dist/templates/ChatTemplate.js +1 -1
  176. package/dist/templates/CheckoutTemplate.js +1 -1
  177. package/dist/templates/DataTablePage.js +1 -1
  178. package/dist/templates/EmailTemplate.js +1 -1
  179. package/dist/templates/FormLayoutPage.js +1 -1
  180. package/dist/ui/index.js +1 -1
  181. package/dist/version.js +1 -1
  182. package/package.json +1 -1
  183. package/dist/Calculator-4VBPCGRP.js +0 -29
  184. package/dist/Files-V67UDEO6.js +0 -141
  185. package/dist/chunk-25QDSYH5.js +0 -13
  186. package/dist/chunk-3PSLQJWR.js +0 -1
  187. package/dist/chunk-5QYKF7NK.js +0 -27
  188. package/dist/chunk-L7MWAC2P.js +0 -6
  189. package/dist/chunk-PMBCQWJW.js +0 -4
  190. package/dist/chunk-PZSVISYY.js +0 -28
  191. package/dist/chunk-QBWMWK2W.js +0 -7
  192. package/dist/chunk-RMKC5POE.js +0 -3
  193. package/dist/chunk-S3OCHYGE.js +0 -14
  194. package/dist/chunk-VJXPT53M.js +0 -19
  195. package/dist/chunk-YFUY3VDW.js +0 -9
  196. /package/dist/{chunk-2VFSYSDS.js → chunk-5WK56FA3.js} +0 -0
@@ -1,44 +1,44 @@
1
- import{useAuth as e,parseOpenSections as t,readStored as r,RAIL_OPEN_SECTIONS_KEY as n,RAIL_WIDTH_KEY as i,toggleOpenSection as a,writeStored as o}from"./chunk-U6LKNGC6.js";import{ResizeHandle as l}from"./chunk-OOWPLQD5.js";import{openGlobalSearch as s}from"./chunk-N2445WHJ.js";import{partitionNav as c,visibleNavChildren as d,visibleSectionItems as m,rowsContainRoute as u}from"./chunk-HGOWQO63.js";import{BrandMark as h}from"./chunk-MI67DI3H.js";import{IconButton_default as p}from"./chunk-SV5RRBVA.js";import{RAIL_MENU_GAP as b,navSections as f,startMenuCategories as g,RAIL_W as x,TAB_STRIP_H as k,RAIL_COLLAPSED_INSET as y,RAIL_MAX_W as v,RAIL_MIN_W as N,navIcons as w,sectionIcons as j}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import"./chunk-7QSDPSXP.js";import"./chunk-2QY5BJLA.js";import{PopupMenu as C,PopupMenuItem as S,PopupMenuDivider as L}from"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-M5K4AX4E.js";import{Icon as $}from"./chunk-JOAKKXTL.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as W}from"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useMemo as z,useState as A,useRef as T,useEffect as I,isValidElement as H,cloneElement as K}from"react";import{jsx as M,jsxs as J,Fragment as D}from"react/jsx-runtime";var O="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),R=150,P=250;function Q(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+b,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var B=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),U="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",X="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function E({open:e,children:t}){const r=T(null);return I(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */M("div",{ref:r,className:"grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",style:{gridTemplateRows:e?"1fr":"0fr",opacity:e?1:0},"aria-hidden":!e,"data-fold":e?"open":"closed",children:/* @__PURE__ */M("div",{className:"min-h-0 overflow-hidden",children:t})})}function G({open:e}){/* @__PURE__ */
2
- return M($,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function Y({dir:e}){/* @__PURE__ */
3
- return M($,"left"===e?{name:"chevron-double-left",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"})}function Z({className:e}){/* @__PURE__ */
4
- return M($,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var _=e=>.75+1.75*e+"rem";function F({width:b,openWidth:R=x,collapsed:P,onToggleCollapsed:F,onResize:V,onHome:q,onOpen:ee,activeRoute:te,profile:re,user:ne,onLogout:ie,onSwitchToDesktop:ae,onReportBug:oe,onClose:le,navSections:se=f,navIcons:ce=w,sectionIcons:de=j,categories:me=g,productName:ue,productIcon:he,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:fe=null,logoIsLight:ge=null}){const xe=W().layout,{hasAnyPerm:ke}=e(),ye=z(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=A(()=>t(r(n))),we=z(()=>[...ye.topItems.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),...[...ye.erpSections,...ye.systemSections,...ye.virtualSections,...ye.footerSections].map(e=>e.label)],[ye,ke]),je=(e,t=we)=>Ne(r=>{const i=a(r,e,t);return o(n,JSON.stringify([...i])),i}),[Ce,Se]=A(!1),Le=T(null),$e=P&&!le,[We,ze]=A(!1),Ae=T("pointer"),Te=T(void 0),Ie=T(!1),He=T(null),Ke=()=>{clearTimeout(Te.current),Te.current=void 0},Me=e=>{Ke(),Ae.current=e,ze(!0)},Je=()=>{Ke(),ze(!1)};I(()=>{Ke(),ze(!1)},[P]),I(()=>()=>Ke(),[]),I(()=>{if(!We)return;const e=e=>{const t=e.target;t&&(He.current?.contains(t)||t.closest?.('[role="menu"]'))||(Ke(),ze(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[We]);const De=P&&!We,Oe=P&&We?R:b,Re=(e,t)=>{Je(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Pe=(e,t)=>{const r=t[e];/* @__PURE__ */
5
- return M("span",{className:X,"aria-hidden":"true",children:r&&H(r)?K(r,{className:"size-[18px]"}):r})},Qe=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Be=(e,t,r=we)=>{const n=d(e,ke),i=e.menuLabel??e.label;if(n.length>0){const a=`child:${e.to}`,o=ve.has(a),l=!o&&u(n,te,ke);/* @__PURE__ */
6
- return J("div",{children:[
7
- /* @__PURE__ */J("button",{type:"button",onClick:()=>je(a,r),"aria-expanded":o,className:B(l,!1),style:t>0?{paddingLeft:_(t)}:void 0,children:[0===t&&Pe(e.to,ce),
1
+ import{useAuth as e,parseOpenSections as t,readStored as r,RAIL_OPEN_SECTIONS_KEY as n,RAIL_WIDTH_KEY as i,toggleOpenSection as a,writeStored as o}from"./chunk-U6LKNGC6.js";import{ResizeHandle as l}from"./chunk-OOWPLQD5.js";import{openGlobalSearch as s}from"./chunk-N2445WHJ.js";import{partitionNav as c,visibleNavChildren as d,visibleSectionItems as m,rowsContainRoute as u}from"./chunk-HGOWQO63.js";import{BrandMark as h}from"./chunk-MI67DI3H.js";import{IconButton_default as p}from"./chunk-SV5RRBVA.js";import{RAIL_MENU_GAP as b,navSections as f,startMenuCategories as g,RAIL_W as x,TAB_STRIP_H as k,RAIL_COLLAPSED_INSET as y,RAIL_MAX_W as v,RAIL_MIN_W as N,navIcons as w,sectionIcons as j}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import"./chunk-7QSDPSXP.js";import"./chunk-2QY5BJLA.js";import{PopupMenu as C,PopupMenuItem as S,PopupMenuDivider as L}from"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-M5K4AX4E.js";import{Icon as $}from"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as W}from"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useMemo as z,useState as A,useRef as I,useEffect as T,isValidElement as H,cloneElement as K}from"react";import{jsx as M,jsxs as D,Fragment as R}from"react/jsx-runtime";var J="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),O=150,P=250;function Q(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+b,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var X=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),U="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",B="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function E({open:e,children:t}){const r=I(null);return T(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */M("div",{ref:r,className:"grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",style:{gridTemplateRows:e?"1fr":"0fr",opacity:e?1:0},"aria-hidden":!e,"data-fold":e?"open":"closed",children:/* @__PURE__ */M("div",{className:"min-h-0 overflow-hidden",children:t})})}function Z({open:e}){/* @__PURE__ */
2
+ return M($,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function F({dir:e}){/* @__PURE__ */
3
+ return M($,"left"===e?{name:"chevron-double-left",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"})}function Y({className:e}){/* @__PURE__ */
4
+ return M($,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var _=e=>.75+1.75*e+"rem";function G({width:b,openWidth:O=x,collapsed:P,onToggleCollapsed:G,onResize:V,onHome:q,onOpen:ee,activeRoute:te,profile:re,user:ne,onLogout:ie,onSwitchToDesktop:ae,onReportBug:oe,onClose:le,navSections:se=f,navIcons:ce=w,sectionIcons:de=j,categories:me=g,productName:ue,productIcon:he,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:fe=null,logoIsLight:ge=null}){const xe=W().layout,{hasAnyPerm:ke}=e(),ye=z(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=A(()=>t(r(n))),we=z(()=>[...ye.topItems.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),...[...ye.erpSections,...ye.systemSections,...ye.virtualSections,...ye.footerSections].map(e=>e.label)],[ye,ke]),je=(e,t=we)=>Ne(r=>{const i=a(r,e,t);return o(n,JSON.stringify([...i])),i}),[Ce,Se]=A(!1),Le=I(null),$e=P&&!le,[We,ze]=A(!1),Ae=I("pointer"),Ie=I(void 0),Te=I(!1),He=I(null),Ke=()=>{clearTimeout(Ie.current),Ie.current=void 0},Me=e=>{Ke(),Ae.current=e,ze(!0)},De=()=>{Ke(),ze(!1)};T(()=>{Ke(),ze(!1)},[P]),T(()=>()=>Ke(),[]),T(()=>{if(!We)return;const e=e=>{const t=e.target;t&&(He.current?.contains(t)||t.closest?.('[role="menu"]'))||(Ke(),ze(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[We]);const Re=P&&!We,Je=P&&We?O:b,Oe=(e,t)=>{De(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Pe=(e,t)=>{const r=t[e];/* @__PURE__ */
5
+ return M("span",{className:B,"aria-hidden":"true",children:r&&H(r)?K(r,{className:"size-[18px]"}):r})},Qe=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Xe=(e,t,r=we)=>{const n=d(e,ke),i=e.menuLabel??e.label;if(n.length>0){const a=`child:${e.to}`,o=ve.has(a),l=!o&&u(n,te,ke);/* @__PURE__ */
6
+ return D("div",{children:[
7
+ /* @__PURE__ */D("button",{type:"button",onClick:()=>je(a,r),"aria-expanded":o,className:X(l,!1),style:t>0?{paddingLeft:_(t)}:void 0,children:[0===t&&Pe(e.to,ce),
8
8
  /* @__PURE__ */M("span",{className:"min-w-0 flex-1 truncate",children:i}),
9
- /* @__PURE__ */M(G,{open:o})]}),
10
- /* @__PURE__ */M(E,{open:o,children:/* @__PURE__ */M("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Be(e,t+1,Qe(n)))})}),e.dividerAfter&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:_(t)},"aria-hidden":"true"})]},e.to)}const a=e.to===te;/* @__PURE__ */
11
- return J("div",{children:[
12
- /* @__PURE__ */J("button",{type:"button",onClick:t=>Re(e,t),onAuxClick:t=>{1===t.button&&Re(e,t)},"aria-current":a?"page":void 0,className:B(a,!1),style:t>0?{paddingLeft:_(t)}:void 0,children:[0===t&&Pe(e.to,ce),
13
- /* @__PURE__ */M("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:_(t)},"aria-hidden":"true"})]},e.to)},Ue=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */M("span",{className:X,"aria-hidden":"true",children:e.icon}):Pe(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(De)/* @__PURE__ */
14
- return J("div",{children:[
15
- /* @__PURE__ */M("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||je(e.label),Me("tap")},className:B(a,!0),children:n}),o&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const l=ve.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
16
- return J("div",{children:[
17
- /* @__PURE__ */J("button",{type:"button",onClick:()=>je(e.label),"aria-expanded":l,"aria-controls":s,className:B(!l&&a,!1),children:[n,
9
+ /* @__PURE__ */M(Z,{open:o})]}),
10
+ /* @__PURE__ */M(E,{open:o,children:/* @__PURE__ */M("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Xe(e,t+1,Qe(n)))})}),e.dividerAfter&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:_(t)},"aria-hidden":"true"})]},e.to)}const a=e.to===te;/* @__PURE__ */
11
+ return D("div",{children:[
12
+ /* @__PURE__ */D("button",{type:"button",onClick:t=>Oe(e,t),onAuxClick:t=>{1===t.button&&Oe(e,t)},"aria-current":a?"page":void 0,className:X(a,!1),style:t>0?{paddingLeft:_(t)}:void 0,children:[0===t&&Pe(e.to,ce),
13
+ /* @__PURE__ */M("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:_(t)},"aria-hidden":"true"})]},e.to)},Ue=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */M("span",{className:B,"aria-hidden":"true",children:e.icon}):Pe(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(Re)/* @__PURE__ */
14
+ return D("div",{children:[
15
+ /* @__PURE__ */M("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||je(e.label),Me("tap")},className:X(a,!0),children:n}),o&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const l=ve.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
16
+ return D("div",{children:[
17
+ /* @__PURE__ */D("button",{type:"button",onClick:()=>je(e.label),"aria-expanded":l,"aria-controls":s,className:X(!l&&a,!1),children:[n,
18
18
  /* @__PURE__ */M("span",{className:"min-w-0 flex-1 truncate",children:i}),
19
- /* @__PURE__ */M(G,{open:l})]}),
20
- /* @__PURE__ */M(E,{open:l,children:/* @__PURE__ */M("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Be(e,1,Qe(r)))})}),o&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Xe=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Ee=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Ge=re?.avatar_url?/* @__PURE__ */M("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */M("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Ee}),Ye=Ce?Le.current?.getBoundingClientRect():void 0,Ze=De?"":"px-3",_e=De?{paddingInline:y}:void 0,Fe=`${P?xe.expandSidebar:xe.collapseSidebar} (${O?"⌘":"Ctrl"} .)`,Ve=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:F,label:P?xe.expandSidebar:xe.collapseSidebar,title:Fe},qe=/* @__PURE__ */J(D,{children:[he&&/* @__PURE__ */M(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!De&&/* @__PURE__ */J("span",{className:"min-w-0 text-left leading-tight",children:[
19
+ /* @__PURE__ */M(Z,{open:l})]}),
20
+ /* @__PURE__ */M(E,{open:l,children:/* @__PURE__ */M("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Xe(e,1,Qe(r)))})}),o&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Be=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Ee=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Ze=re?.avatar_url?/* @__PURE__ */M("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */M("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Ee}),Fe=Ce?Le.current?.getBoundingClientRect():void 0,Ye=Re?"":"px-3",_e=Re?{paddingInline:y}:void 0,Ge=`${P?xe.expandSidebar:xe.collapseSidebar} (${J?"⌘":"Ctrl"} .)`,Ve=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:G,label:P?xe.expandSidebar:xe.collapseSidebar,title:Ge},qe=/* @__PURE__ */D(R,{children:[he&&/* @__PURE__ */M(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!Re&&/* @__PURE__ */D("span",{className:"min-w-0 text-left leading-tight",children:[
21
21
  /* @__PURE__ */M("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),pe&&/* @__PURE__ */M("span",{className:"block truncate text-2xs font-medium text-gray-500",children:pe})]})]}),et=ye.erpSections.length>0||ye.systemSections.length>0||ye.virtualSections.length>0;/* @__PURE__ */
22
- return J("aside",{ref:He,"aria-label":xe.navLabel,"data-rail-peek":We?"":void 0,className:`fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong ${P?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${We?"rounded-r-(--radius-panel)":""}`,style:{width:Oe,boxShadow:We?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(Ie.current=!0,$e&&(We?Ke():(Ke(),Te.current=setTimeout(()=>Me("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(Ie.current=!1,$e&&(Ke(),We&&!Ce&&"pointer"===Ae.current&&(Te.current=setTimeout(Je,250))))},onFocus:e=>{$e&&!We&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&Me("focus")},onBlur:e=>{if(!We||"focus"!==Ae.current)return;const t=e.relatedTarget;t&&He.current?.contains(t)||Ce||Ie.current||Je()},onKeyDown:e=>{"Escape"===e.key&&We&&Je()},children:[
23
- /* @__PURE__ */J("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(De?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[Ve?/* @__PURE__ */M("button",{type:"button",onClick:Ve.run,"aria-label":Ve.label,title:Ve.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(De?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */M("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */M(p,{onClick:le,"aria-label":xe.closeMenu,children:/* @__PURE__ */M($,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):P?We&&
24
- /* @__PURE__ */M("button",{type:"button",onClick:()=>{Je(),F()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${O?"⌘":"Ctrl"} .)`,className:U,children:/* @__PURE__ */M(Y,{dir:"right"})}):/* @__PURE__ */M("button",{type:"button",onClick:F,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${O?"⌘":"Ctrl"} .)`,className:U,children:/* @__PURE__ */M(Y,{dir:"left"})})]}),
25
- /* @__PURE__ */M("div",{className:`shrink-0 pt-3 ${Ze}`,style:_e,children:De?/* @__PURE__ */M("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${O?"⌘K":"Ctrl K"})`,className:B(!1,!0),children:/* @__PURE__ */M(Z,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */J("button",{type:"button",onClick:s,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-line bg-surface px-3 text-left transition-colors hover:bg-gray-100",children:[
26
- /* @__PURE__ */M(Z,{className:"size-3.5 text-gray-500"}),
22
+ return D("aside",{ref:He,"aria-label":xe.navLabel,"data-rail-peek":We?"":void 0,className:`fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong ${P?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${We?"rounded-r-(--radius-panel)":""}`,style:{width:Je,boxShadow:We?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(Te.current=!0,$e&&(We?Ke():(Ke(),Ie.current=setTimeout(()=>Me("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(Te.current=!1,$e&&(Ke(),We&&!Ce&&"pointer"===Ae.current&&(Ie.current=setTimeout(De,250))))},onFocus:e=>{$e&&!We&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&Me("focus")},onBlur:e=>{if(!We||"focus"!==Ae.current)return;const t=e.relatedTarget;t&&He.current?.contains(t)||Ce||Te.current||De()},onKeyDown:e=>{"Escape"===e.key&&We&&De()},children:[
23
+ /* @__PURE__ */D("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(Re?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[Ve?/* @__PURE__ */M("button",{type:"button",onClick:Ve.run,"aria-label":Ve.label,title:Ve.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(Re?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */M("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */M(p,{onClick:le,"aria-label":xe.closeMenu,children:/* @__PURE__ */M($,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):P?We&&
24
+ /* @__PURE__ */M("button",{type:"button",onClick:()=>{De(),G()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${J?"⌘":"Ctrl"} .)`,className:U,children:/* @__PURE__ */M(F,{dir:"right"})}):/* @__PURE__ */M("button",{type:"button",onClick:G,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${J?"⌘":"Ctrl"} .)`,className:U,children:/* @__PURE__ */M(F,{dir:"left"})})]}),
25
+ /* @__PURE__ */M("div",{className:`shrink-0 pt-3 ${Ye}`,style:_e,children:Re?/* @__PURE__ */M("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${J?"⌘K":"Ctrl K"})`,className:X(!1,!0),children:/* @__PURE__ */M(Y,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */D("button",{type:"button",onClick:s,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-line bg-surface px-3 text-left transition-colors hover:bg-gray-100",children:[
26
+ /* @__PURE__ */M(Y,{className:"size-3.5 text-gray-500"}),
27
27
  /* @__PURE__ */M("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
28
- /* @__PURE__ */M("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:O?"⌘K":"Ctrl K"})]})}),
29
- /* @__PURE__ */J("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ze} ${De?"space-y-1":"space-y-0.5"}`,style:_e,children:[De&&/* @__PURE__ */M("button",{type:"button",onClick:F,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${O?"⌘":"Ctrl"} .)`,className:`${B(!1,!0)} mb-3`,children:/* @__PURE__ */M(Y,{dir:"right"})}),ye.topItems.map(e=>{if(!De)return Be(e,0);const t=d(e,ke),r=e.to===te||u(t,te,ke),n=e.menuLabel??e.label;/* @__PURE__ */
30
- return J("div",{children:[
31
- /* @__PURE__ */M("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Re(e,r);const n=`child:${e.to}`;ve.has(n)||je(n),Me("tap")},className:B(r,!0),children:Pe(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ye.topItems.length>0&&et&&!ye.topItems[ye.topItems.length-1].dividerAfter&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Ue(e,!1)),ye.systemSections.map(e=>Ue(e,!1)),ye.virtualSections.map(e=>Ue(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Ue(e,!1))]}),
32
- /* @__PURE__ */M("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ze}`,style:_e,children:/* @__PURE__ */J("button",{ref:Le,type:"button",onClick:()=>Se(e=>!e),"aria-haspopup":"menu","aria-expanded":Ce,"aria-label":De?xe.accountMenu(Xe):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(De?"justify-center py-2":"px-2 py-2"),children:[Ge,!De&&/* @__PURE__ */J("span",{className:"min-w-0 flex-1 text-left",children:[
33
- /* @__PURE__ */M("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Xe}),ne?.email&&Xe!==ne.email&&/* @__PURE__ */M("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),V&&!P&&!le&&/* @__PURE__ */M(l,{side:"left",width:b,onResize:V,min:N,max:v,defaultWidth:x,storageKey:i,label:xe.resizeSidebar}),Ce&&Ye&&/* @__PURE__ */J(C,{portal:!0,minWidth:224,onClose:()=>{Se(!1),We&&"pointer"===Ae.current&&!Ie.current&&Je()},style:Q(Oe,Ye,window.innerHeight),children:[De&&/* @__PURE__ */J("div",{className:"border-b border-line px-3 py-3",children:[
34
- /* @__PURE__ */M("p",{className:"truncate text-sm font-semibold text-gray-800",children:Xe}),ne?.email&&/* @__PURE__ */M("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
35
- /* @__PURE__ */J(S,{onClick:()=>{Se(!1),Je(),ee("/profile",!1)},children:[
36
- /* @__PURE__ */M($,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */J(S,{onClick:()=>{Se(!1),Re(e)},children:[
37
- /* @__PURE__ */M("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */J(S,{onClick:()=>{Se(!1),Je(),oe()},children:[
28
+ /* @__PURE__ */M("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:J?"⌘K":"Ctrl K"})]})}),
29
+ /* @__PURE__ */D("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ye} ${Re?"space-y-1":"space-y-0.5"}`,style:_e,children:[Re&&/* @__PURE__ */M("button",{type:"button",onClick:G,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${J?"⌘":"Ctrl"} .)`,className:`${X(!1,!0)} mb-3`,children:/* @__PURE__ */M(F,{dir:"right"})}),ye.topItems.map(e=>{if(!Re)return Xe(e,0);const t=d(e,ke),r=e.to===te||u(t,te,ke),n=e.menuLabel??e.label;/* @__PURE__ */
30
+ return D("div",{children:[
31
+ /* @__PURE__ */M("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Oe(e,r);const n=`child:${e.to}`;ve.has(n)||je(n),Me("tap")},className:X(r,!0),children:Pe(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ye.topItems.length>0&&et&&!ye.topItems[ye.topItems.length-1].dividerAfter&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Ue(e,!1)),ye.systemSections.map(e=>Ue(e,!1)),ye.virtualSections.map(e=>Ue(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */M("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Ue(e,!1))]}),
32
+ /* @__PURE__ */M("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ye}`,style:_e,children:/* @__PURE__ */D("button",{ref:Le,type:"button",onClick:()=>Se(e=>!e),"aria-haspopup":"menu","aria-expanded":Ce,"aria-label":Re?xe.accountMenu(Be):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(Re?"justify-center py-2":"px-2 py-2"),children:[Ze,!Re&&/* @__PURE__ */D("span",{className:"min-w-0 flex-1 text-left",children:[
33
+ /* @__PURE__ */M("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Be}),ne?.email&&Be!==ne.email&&/* @__PURE__ */M("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),V&&!P&&!le&&/* @__PURE__ */M(l,{side:"left",width:b,onResize:V,min:N,max:v,defaultWidth:x,storageKey:i,label:xe.resizeSidebar}),Ce&&Fe&&/* @__PURE__ */D(C,{portal:!0,minWidth:224,onClose:()=>{Se(!1),We&&"pointer"===Ae.current&&!Te.current&&De()},style:Q(Je,Fe,window.innerHeight),children:[Re&&/* @__PURE__ */D("div",{className:"border-b border-line px-3 py-3",children:[
34
+ /* @__PURE__ */M("p",{className:"truncate text-sm font-semibold text-gray-800",children:Be}),ne?.email&&/* @__PURE__ */M("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
35
+ /* @__PURE__ */D(S,{onClick:()=>{Se(!1),De(),ee("/profile",!1)},children:[
36
+ /* @__PURE__ */M($,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */D(S,{onClick:()=>{Se(!1),Oe(e)},children:[
37
+ /* @__PURE__ */M("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */D(S,{onClick:()=>{Se(!1),De(),oe()},children:[
38
38
  /* @__PURE__ */M($,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
39
- /* @__PURE__ */M(L,{}),ae&&/* @__PURE__ */J(D,{children:[
40
- /* @__PURE__ */J(S,{onClick:()=>{Se(!1),Je(),ae()},children:[
39
+ /* @__PURE__ */M(L,{}),ae&&/* @__PURE__ */D(R,{children:[
40
+ /* @__PURE__ */D(S,{onClick:()=>{Se(!1),De(),ae()},children:[
41
41
  /* @__PURE__ */M($,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
42
42
  /* @__PURE__ */M(L,{})]}),
43
- /* @__PURE__ */J(S,{danger:!0,onClick:()=>{Se(!1),Je(),ie()},children:[
44
- /* @__PURE__ */M($,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{P as RAIL_PEEK_CLOSE_MS,R as RAIL_PEEK_OPEN_MS,Q as accountMenuPosition,F as default};
43
+ /* @__PURE__ */D(S,{danger:!0,onClick:()=>{Se(!1),De(),ie()},children:[
44
+ /* @__PURE__ */M($,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{P as RAIL_PEEK_CLOSE_MS,O as RAIL_PEEK_OPEN_MS,Q as accountMenuPosition,G as default};
@@ -1,4 +1,4 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-YTZFWV2W.js";import{useWidgetSettings as n}from"./chunk-TKPUYQ3Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y6E7IRK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-WLUJQLXG.js";import"./chunk-5QYKF7NK.js";import"./chunk-PMBCQWJW.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-2VFSYSDS.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WQ4YKWN2.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-JOAKKXTL.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as r,useCallback as c}from"react";import{jsxs as s,Fragment as i,jsx as a}from"react/jsx-runtime";var o=["AAPL","MSFT","GOOGL","TSLA","NVDA"],m="stock_symbols",l="stock_appearance",h={AAPL:{price:229.87,change:1.42,changePct:.62},MSFT:{price:451.16,change:-2.31,changePct:-.51},GOOGL:{price:178.34,change:.89,changePct:.5},AMZN:{price:201.45,change:-1.08,changePct:-.53},TSLA:{price:248.92,change:6.74,changePct:2.78},NVDA:{price:134.81,change:-3.12,changePct:-2.26},META:{price:563.27,change:4.55,changePct:.81}},p=Object.keys(h);function u(){try{const e=JSON.parse(localStorage.getItem(m)||"");if(Array.isArray(e)&&e.length)return e.slice(0,8)}catch{}return o}var d=e=>`${e>=0?"+":""}${e.toFixed(2)}`;function g(){const[o,g]=r(u),[k,x]=r(()=>e(l)),[j,N]=r(!1),[b,f]=r([]),[y,v]=r(k),[S,A]=r(""),D=c(()=>{f([...o]),v({...k}),A(""),N(!0)},[o,k]);n(D);const J=()=>{const e=S.trim().toUpperCase();!e||b.includes(e)||b.length>=8||(f(t=>[...t,e]),A(""))},M=p.filter(e=>!b.includes(e));/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-ZLKEPDJE.js";import{useWidgetSettings as n}from"./chunk-XQNZJNEJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as r,useCallback as c}from"react";import{jsxs as s,Fragment as i,jsx as a}from"react/jsx-runtime";var o=["AAPL","MSFT","GOOGL","TSLA","NVDA"],m="stock_symbols",l="stock_appearance",h={AAPL:{price:229.87,change:1.42,changePct:.62},MSFT:{price:451.16,change:-2.31,changePct:-.51},GOOGL:{price:178.34,change:.89,changePct:.5},AMZN:{price:201.45,change:-1.08,changePct:-.53},TSLA:{price:248.92,change:6.74,changePct:2.78},NVDA:{price:134.81,change:-3.12,changePct:-2.26},META:{price:563.27,change:4.55,changePct:.81}},p=Object.keys(h);function u(){try{const e=JSON.parse(localStorage.getItem(m)||"");if(Array.isArray(e)&&e.length)return e.slice(0,8)}catch{}return o}var d=e=>`${e>=0?"+":""}${e.toFixed(2)}`;function g(){const[o,g]=r(u),[k,x]=r(()=>e(l)),[j,N]=r(!1),[b,f]=r([]),[y,v]=r(k),[A,D]=r(""),S=c(()=>{f([...o]),v({...k}),D(""),N(!0)},[o,k]);n(S);const J=()=>{const e=A.trim().toUpperCase();!e||b.includes(e)||b.length>=8||(f(t=>[...t,e]),D(""))},M=p.filter(e=>!b.includes(e));/* @__PURE__ */
2
2
  return s(i,{children:[
3
3
  /* @__PURE__ */a("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${k.activeOpacity/100})`,backdropFilter:k.activeBlur>0?`blur(${k.activeBlur}px)`:void 0},children:/* @__PURE__ */a("div",{className:"px-4 py-3",children:0===o.length?/* @__PURE__ */a("div",{className:"text-xs text-gray-500 text-center py-6",children:"No symbols yet — add some in settings."}):/* @__PURE__ */a("div",{className:"space-y-0.5",children:o.map(e=>{const t=h[e],n=(t?.change??0)>=0,r=t?t.change>0?"text-green-600":t.change<0?"text-red-600":"text-gray-500":"text-gray-400";/* @__PURE__ */
4
4
  return s("div",{className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0",children:[
@@ -11,6 +11,6 @@ return s("div",{className:"flex items-center justify-between px-2 py-2 border-b
11
11
  /* @__PURE__ */s("div",{className:"space-y-1 mb-2",children:[b.map((e,t)=>/* @__PURE__ */s("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
12
12
  /* @__PURE__ */a("span",{className:"text-sm font-semibold text-gray-700",children:e}),
13
13
  /* @__PURE__ */a("button",{onClick:()=>f(e=>e.filter((e,n)=>n!==t)),className:"text-red-400 hover:text-red-600",children:"×"})]},t)),0===b.length&&/* @__PURE__ */a("p",{className:"text-2xs text-ink-faintest italic",children:"No symbols — add a ticker below."})]}),b.length<8?/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[
14
- /* @__PURE__ */a("input",{value:S,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J()},placeholder:"e.g. NVDA",className:"flex-1 bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm uppercase focus:outline-none focus:ring-1 focus:ring-blue-500"}),
14
+ /* @__PURE__ */a("input",{value:A,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J()},placeholder:"e.g. NVDA",className:"flex-1 bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm uppercase focus:outline-none focus:ring-1 focus:ring-blue-500"}),
15
15
  /* @__PURE__ */a("button",{onClick:J,className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */s("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",8," symbols — remove one to add another."]}),M.length>0&&b.length<8&&/* @__PURE__ */a("div",{className:"flex flex-wrap gap-2 mt-2",children:M.map(e=>/* @__PURE__ */a("button",{onClick:()=>f(t=>t.length<8?[...t,e]:t),className:"text-2xs font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded px-2 py-0.5 transition-colors",children:e},e))}),
16
16
  /* @__PURE__ */a("p",{className:"text-2xs text-ink-faintest mt-2",children:"Demo prices — static sample data, no live feed."})]})})]})}export{g as default};
@@ -1,4 +1,4 @@
1
- import{fetchCityWeather as e,getCondition as t,AVAILABLE_CITIES as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-YTZFWV2W.js";import{pad2 as s}from"./chunk-LF27WIN2.js";import{useWidgetSettings as o}from"./chunk-TKPUYQ3Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y6E7IRK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-WLUJQLXG.js";import"./chunk-5QYKF7NK.js";import"./chunk-PMBCQWJW.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-2VFSYSDS.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WQ4YKWN2.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as l}from"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-JOAKKXTL.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as d,useEffect as m,useCallback as h}from"react";import{jsx as p,jsxs as u,Fragment as f}from"react/jsx-runtime";var y="weather_city",g="weather_appearance",x={useFahrenheit:!1,showLocalTime:!0,use24Hour:!1};function b(){const e="undefined"!=typeof localStorage?localStorage.getItem(y):null;if(e&&a[e])return e;try{const e=JSON.parse(localStorage.getItem("weather_cities")||"");if(Array.isArray(e)&&e[0]&&a[e[0]])return localStorage.setItem(y,e[0]),e[0]}catch{}return function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;for(const[t,r]of Object.entries(a))if(r.tz===e)return t}catch{}return"London"}()}var w=r;function k(e,t=!1){try{if(t){const t=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!1}).formatToParts(/* @__PURE__ */new Date),a=parseInt(t.find(e=>"hour"===e.type)?.value||"0"),r=parseInt(t.find(e=>"minute"===e.type)?.value||"0");return`${s(a)}:${s(r)}`}const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(/* @__PURE__ */new Date),r=parseInt(a.find(e=>"hour"===e.type)?.value||"12"),n=parseInt(a.find(e=>"minute"===e.type)?.value||"0"),i=a.find(e=>"dayPeriod"===e.type)?.value||"";return`${r}:${s(n)} ${i}`}catch{return""}}function v(){/* @__PURE__ */
1
+ import{fetchCityWeather as e,getCondition as t,AVAILABLE_CITIES as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-ZLKEPDJE.js";import{pad2 as s}from"./chunk-LF27WIN2.js";import{useWidgetSettings as o}from"./chunk-XQNZJNEJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as l}from"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as d,useEffect as m,useCallback as h}from"react";import{jsx as p,jsxs as u,Fragment as f}from"react/jsx-runtime";var y="weather_city",g="weather_appearance",x={useFahrenheit:!1,showLocalTime:!0,use24Hour:!1};function b(){const e="undefined"!=typeof localStorage?localStorage.getItem(y):null;if(e&&a[e])return e;try{const e=JSON.parse(localStorage.getItem("weather_cities")||"");if(Array.isArray(e)&&e[0]&&a[e[0]])return localStorage.setItem(y,e[0]),e[0]}catch{}return function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;for(const[t,r]of Object.entries(a))if(r.tz===e)return t}catch{}return"London"}()}var w=r;function k(e,t=!1){try{if(t){const t=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!1}).formatToParts(/* @__PURE__ */new Date),a=parseInt(t.find(e=>"hour"===e.type)?.value||"0"),r=parseInt(t.find(e=>"minute"===e.type)?.value||"0");return`${s(a)}:${s(r)}`}const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(/* @__PURE__ */new Date),r=parseInt(a.find(e=>"hour"===e.type)?.value||"12"),n=parseInt(a.find(e=>"minute"===e.type)?.value||"0"),i=a.find(e=>"dayPeriod"===e.type)?.value||"";return`${r}:${s(n)} ${i}`}catch{return""}}function v(){/* @__PURE__ */
2
2
  return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
3
3
  /* @__PURE__ */p("div",{className:"absolute -top-5 -right-5 w-24 h-24",style:{animation:"wx-sun-rays 70s linear infinite"},children:/* @__PURE__ */p("svg",{viewBox:"0 0 100 100",className:"w-full h-full",children:Array.from({length:12}).map((e,t)=>/* @__PURE__ */p("rect",{x:49,y:3,width:2,height:14,rx:1,fill:"rgba(255, 232, 130, 0.55)",transform:`rotate(${30*t} 50 50)`},t))})}),
4
4
  /* @__PURE__ */p("div",{className:"absolute top-1 right-1 w-10 h-10 rounded-full",style:{background:"radial-gradient(circle at 35% 35%, #fff8cc 0%, #ffd84a 55%, #ff9e2a 100%)",boxShadow:"0 0 18px 5px rgba(255, 200, 80, 0.55)",animation:"wx-sun-pulse 4.5s ease-in-out infinite"}})]})}function N(){const e=Array.from({length:16}).map((e,t)=>({left:(53*t+11)%95+"%",top:(37*t+9)%78+"%",size:1+13*t%3,delay:.41*t%4+"s",duration:2.5+7*t%5*.6+"s"}));/* @__PURE__ */
@@ -17,44 +17,44 @@ return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none"
17
17
  return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
18
18
  /* @__PURE__ */p("div",{className:"absolute",style:{top:"8%",animation:"wx-drift-cloud 42s linear infinite"},children:/* @__PURE__ */p(a,{scale:.9})}),
19
19
  /* @__PURE__ */p("div",{className:"absolute",style:{top:"40%",animation:"wx-drift-cloud 60s linear -22s infinite",opacity:.85},children:/* @__PURE__ */p(a,{scale:1.25})}),
20
- /* @__PURE__ */p("div",{className:"absolute",style:{top:"68%",animation:"wx-drift-cloud 78s linear -45s infinite",opacity:.7},children:/* @__PURE__ */p(a,{scale:.75})})]})}function S({heavy:e=!1}){const t=e?26:16,a=["wx-rain-a","wx-rain-b","wx-rain-c"],r=Array.from({length:t}).map((e,r)=>({left:(100*r/t+11*r%7)%100+"%",delay:.087*r%1.3+"s",height:12+r%4*5+"px",duration:.7+r%3*.18+"s",variant:a[r%a.length]}));/* @__PURE__ */
21
- return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:r.map((e,t)=>/* @__PURE__ */p("div",{className:"absolute",style:{left:e.left,top:"-20px",width:"1px",height:e.height,background:"linear-gradient(180deg, rgba(180,210,255,0) 0%, rgba(220,235,255,0.85) 90%, rgba(255,255,255,0.95) 100%)",transform:"rotate(8deg)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`,transformOrigin:"top"}},t))})}function D(){const e=["wx-snow-a","wx-snow-b","wx-snow-c"],t=Array.from({length:16}).map((t,a)=>({left:(100*a/16+13*a%5)%100+"%",delay:.43*a%5+"s",duration:4.5+a%5+"s",size:3+a%4*1.4,opacity:.65+7*a%4*.08,variant:e[a%e.length]}));/* @__PURE__ */
20
+ /* @__PURE__ */p("div",{className:"absolute",style:{top:"68%",animation:"wx-drift-cloud 78s linear -45s infinite",opacity:.7},children:/* @__PURE__ */p(a,{scale:.75})})]})}function D({heavy:e=!1}){const t=e?26:16,a=["wx-rain-a","wx-rain-b","wx-rain-c"],r=Array.from({length:t}).map((e,r)=>({left:(100*r/t+11*r%7)%100+"%",delay:.087*r%1.3+"s",height:12+r%4*5+"px",duration:.7+r%3*.18+"s",variant:a[r%a.length]}));/* @__PURE__ */
21
+ return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:r.map((e,t)=>/* @__PURE__ */p("div",{className:"absolute",style:{left:e.left,top:"-20px",width:"1px",height:e.height,background:"linear-gradient(180deg, rgba(180,210,255,0) 0%, rgba(220,235,255,0.85) 90%, rgba(255,255,255,0.95) 100%)",transform:"rotate(8deg)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`,transformOrigin:"top"}},t))})}function S(){const e=["wx-snow-a","wx-snow-b","wx-snow-c"],t=Array.from({length:16}).map((t,a)=>({left:(100*a/16+13*a%5)%100+"%",delay:.43*a%5+"s",duration:4.5+a%5+"s",size:3+a%4*1.4,opacity:.65+7*a%4*.08,variant:e[a%e.length]}));/* @__PURE__ */
22
22
  return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:t.map((e,t)=>/* @__PURE__ */p("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:"-12px",width:e.size,height:e.size,opacity:e.opacity,boxShadow:"0 0 4px rgba(255,255,255,0.65)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`}},t))})}function T(){/* @__PURE__ */
23
23
  return u("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
24
- /* @__PURE__ */p(S,{heavy:!0}),
24
+ /* @__PURE__ */p(D,{heavy:!0}),
25
25
  /* @__PURE__ */p("div",{className:"absolute inset-0 bg-white",style:{animation:"wx-flash 6s ease-out infinite"}}),
26
26
  /* @__PURE__ */p("div",{className:"absolute inset-y-0 right-1/3 flex items-center justify-center pointer-events-none",style:{animation:"wx-bolt 6s ease-out infinite"},children:/* @__PURE__ */p("svg",{viewBox:"0 0 18 60",className:"h-4/5",style:{filter:"drop-shadow(0 0 6px rgba(255, 240, 150, 0.95)) drop-shadow(0 0 14px rgba(255, 220, 90, 0.7))"},children:/* @__PURE__ */p("path",{d:"M11 0 L2 28 L8 30 L4 60 L16 24 L9 22 Z",fill:"rgba(255, 250, 200, 0.98)",stroke:"rgba(255, 255, 255, 0.9)",strokeWidth:.3})})})]})}function C(){/* @__PURE__ */
27
27
  return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */p("div",{className:"absolute left-0 right-0",style:{top:10+22*t+"%",height:"14px",background:"linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%)",filter:"blur(2px)",animation:`wx-fog-drift ${10+3*t}s ease-in-out ${.7*t}s infinite alternate`}},t))})}function F({code:e,isDay:t}){return 0===e||1===e?/* @__PURE__ */p(t?v:N,{}):2===e?/* @__PURE__ */u(f,{children:[/* @__PURE__ */p(t?v:N,{}),
28
- /* @__PURE__ */p(j,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */p(j,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */p(C,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */p(S,{}):[55,63,65,82].includes(e)?/* @__PURE__ */p(S,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */p(D,{}):[95,96,99].includes(e)?/* @__PURE__ */p(T,{}):null}function I(){const[r,s]=d(b),[v,N]=d(()=>n(g)),[j,S]=d(null),[D,T]=d(!0),[,C]=d(0);m(()=>{const e=setInterval(()=>C(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[I,L]=d(!1),[W,$]=d(r),[J,A]=d(v),{prefs:M,save:G}=l(),H={...x,...M.weather_prefs??{}},[Q,Z]=d(H);o(h(()=>{$(r),A({...v}),Z({...H}),L(!0)},[r,v,H])),m(()=>{let t=!1;return T(!0),e(r).then(e=>{t||(S(e),T(!1))}),()=>{t=!0}},[r]);const O=e=>H.useFahrenheit?`${w(e)}°F`:`${e}°`;if(D&&!j)/* @__PURE__ */
28
+ /* @__PURE__ */p(j,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */p(j,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */p(C,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */p(D,{}):[55,63,65,82].includes(e)?/* @__PURE__ */p(D,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */p(S,{}):[95,96,99].includes(e)?/* @__PURE__ */p(T,{}):null}function I(){const[r,s]=d(b),[v,N]=d(()=>n(g)),[j,D]=d(null),[S,T]=d(!0),[,C]=d(0);m(()=>{const e=setInterval(()=>C(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[I,J]=d(!1),[L,$]=d(r),[A,H]=d(v),{prefs:M,save:Z}=l(),X={...x,...M.weather_prefs??{}},[O,W]=d(X);o(h(()=>{$(r),H({...v}),W({...X}),J(!0)},[r,v,X])),m(()=>{let t=!1;return T(!0),e(r).then(e=>{t||(D(e),T(!1))}),()=>{t=!0}},[r]);const B=e=>X.useFahrenheit?`${w(e)}°F`:`${e}°`;if(S&&!j)/* @__PURE__ */
29
29
  return p("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-sky-400 to-blue-500 rounded-lg text-on-accent/80 text-xs",style:{minHeight:110},children:/* @__PURE__ */p(c,{size:"sm",padding:"",label:"Loading"})});if(!j)/* @__PURE__ */
30
- return p("div",{className:"flex items-center justify-center h-full bg-slate-700 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Couldn't load weather"});const[B,K,U]=t(j.code,j.isDay);/* @__PURE__ */
30
+ return p("div",{className:"flex items-center justify-center h-full bg-slate-700 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Couldn't load weather"});const[G,U,E]=t(j.code,j.isDay);/* @__PURE__ */
31
31
  return u(f,{children:[
32
32
  /* @__PURE__ */p("style",{children:"\n@keyframes wx-rain-a { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 0.95; } 100% { transform: translate(8px,140px); opacity: 0; } }\n@keyframes wx-rain-b { 0% { transform: translate(0,-20px); opacity: 0; } 12% { opacity: 0.85; } 100% { transform: translate(12px,140px); opacity: 0; } }\n@keyframes wx-rain-c { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(5px,140px); opacity: 0; } }\n@keyframes wx-snow-a { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.9; } 50% { transform: translate(10px,55px) rotate(180deg); } 100% { transform: translate(-4px,140px) rotate(360deg); opacity: 0; } }\n@keyframes wx-snow-b { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.85; } 50% { transform: translate(-12px,55px) rotate(-180deg); } 100% { transform: translate(6px,140px) rotate(-360deg); opacity: 0; } }\n@keyframes wx-snow-c { 0% { transform: translate(0,-12px); opacity: 0; } 10% { opacity: 0.7; } 100% { transform: translate(2px,140px); opacity: 0; } }\n@keyframes wx-drift-cloud { 0% { transform: translateX(-40%); } 100% { transform: translateX(140%); } }\n@keyframes wx-twinkle { 0%, 100% { opacity: 0.25; transform: scale(1); } 50% { opacity: 1; transform: scale(1.6); } }\n@keyframes wx-flash { 0%, 86%, 100% { opacity: 0; } 87% { opacity: 0.95; } 88% { opacity: 0.15; } 89% { opacity: 0.85; } 90% { opacity: 0; } }\n@keyframes wx-bolt { 0%, 86%, 90%, 100% { opacity: 0; } 87% { opacity: 1; } 89% { opacity: 0.85; } }\n@keyframes wx-sun-pulse { 0%, 100% { transform: scale(1); opacity: 0.65; } 50% { transform: scale(1.12); opacity: 0.95; } }\n@keyframes wx-sun-rays { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }\n@keyframes wx-fog-drift { 0% { transform: translateX(-25%); opacity: 0.3; } 50% { opacity: 0.65; } 100% { transform: translateX(25%); opacity: 0.3; } }\n@keyframes wx-shooting-star { 0%, 95% { opacity: 0; transform: translate(0,0) scale(0); } 96% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(40px,30px) scale(1); } }\n"}),
33
- /* @__PURE__ */p("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${v.activeOpacity/100})`,backdropFilter:v.activeBlur>0?`blur(${v.activeBlur}px)`:void 0},children:/* @__PURE__ */u("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${U}`,style:{height:110},children:[
33
+ /* @__PURE__ */p("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${v.activeOpacity/100})`,backdropFilter:v.activeBlur>0?`blur(${v.activeBlur}px)`:void 0},children:/* @__PURE__ */u("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${E}`,style:{height:110},children:[
34
34
  /* @__PURE__ */p(F,{code:j.code,isDay:j.isDay}),
35
35
  /* @__PURE__ */u("div",{className:"relative z-10 px-3 py-3 flex flex-col h-full justify-between",children:[
36
36
  /* @__PURE__ */u("div",{className:"flex items-start justify-between gap-2",children:[
37
37
  /* @__PURE__ */u("div",{className:"min-w-0 flex-1",children:[
38
- /* @__PURE__ */p("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:j.city}),H.showLocalTime&&/* @__PURE__ */p("div",{className:"text-2xs opacity-90 leading-tight tabular-nums drop-shadow-sm",children:k(j.timezone,H.use24Hour)})]}),
39
- /* @__PURE__ */p("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:O(j.temp)})]}),
38
+ /* @__PURE__ */p("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:j.city}),X.showLocalTime&&/* @__PURE__ */p("div",{className:"text-2xs opacity-90 leading-tight tabular-nums drop-shadow-sm",children:k(j.timezone,X.use24Hour)})]}),
39
+ /* @__PURE__ */p("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:B(j.temp)})]}),
40
40
  /* @__PURE__ */u("div",{className:"flex items-end justify-between gap-2",children:[
41
41
  /* @__PURE__ */u("div",{className:"flex items-center gap-2 min-w-0",children:[
42
- /* @__PURE__ */p("span",{className:"text-lg leading-none drop-shadow-sm",children:K}),
43
- /* @__PURE__ */p("span",{className:"text-2xs font-medium drop-shadow-sm truncate",children:B})]}),
44
- /* @__PURE__ */u("span",{className:"text-2xs opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",O(j.high)," L:",O(j.low)]})]})]})]})}),
45
- /* @__PURE__ */u(i,{open:I,onClose:()=>L(!1),title:"Weather Settings",appearance:J,onAppearanceChange:A,onSave:()=>{s(W),N(J),G({weather_prefs:Q}),localStorage.setItem(y,W),localStorage.setItem(g,JSON.stringify(J)),L(!1)},children:[
42
+ /* @__PURE__ */p("span",{className:"text-lg leading-none drop-shadow-sm",children:U}),
43
+ /* @__PURE__ */p("span",{className:"text-2xs font-medium drop-shadow-sm truncate",children:G})]}),
44
+ /* @__PURE__ */u("span",{className:"text-2xs opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",B(j.high)," L:",B(j.low)]})]})]})]})}),
45
+ /* @__PURE__ */u(i,{open:I,onClose:()=>J(!1),title:"Weather Settings",appearance:A,onAppearanceChange:H,onSave:()=>{s(L),N(A),Z({weather_prefs:O}),localStorage.setItem(y,L),localStorage.setItem(g,JSON.stringify(A)),J(!1)},children:[
46
46
  /* @__PURE__ */p("div",{className:"space-y-3",children:/* @__PURE__ */u("div",{children:[
47
47
  /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
48
48
  /* @__PURE__ */u("div",{className:"flex items-center gap-3 mb-2",children:[
49
49
  /* @__PURE__ */p("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
50
- /* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>Z(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(Q.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
50
+ /* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>W(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(O.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
51
51
  /* @__PURE__ */u("div",{className:"flex items-center gap-3 mb-2",children:[
52
52
  /* @__PURE__ */p("span",{className:"text-sm text-gray-600 w-24",children:"Time Format"}),
53
- /* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>Z(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(Q.use24Hour===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
53
+ /* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>W(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(O.use24Hour===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
54
54
  /* @__PURE__ */u("label",{className:"flex items-center gap-2 cursor-pointer",children:[
55
- /* @__PURE__ */p("input",{type:"checkbox",checked:Q.showLocalTime,onChange:e=>Z(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
55
+ /* @__PURE__ */p("input",{type:"checkbox",checked:O.showLocalTime,onChange:e=>W(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
56
56
  /* @__PURE__ */p("span",{className:"text-sm text-gray-600",children:"Show local time"})]})]})}),
57
57
  /* @__PURE__ */u("div",{children:[
58
58
  /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"City"}),
59
- /* @__PURE__ */p("select",{value:W,onChange:e=>$(e.target.value),className:"w-full bg-surface-sunken border border-line rounded px-2 h-8 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:Object.keys(a).map(e=>/* @__PURE__ */p("option",{value:e,children:e},e))}),
59
+ /* @__PURE__ */p("select",{value:L,onChange:e=>$(e.target.value),className:"w-full bg-surface-sunken border border-line rounded px-2 h-8 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:Object.keys(a).map(e=>/* @__PURE__ */p("option",{value:e,children:e},e))}),
60
60
  /* @__PURE__ */p("p",{className:"mt-1 text-2xs text-ink-faintest",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{I as default};
@@ -1,6 +1,6 @@
1
- import{AVAILABLE_CITIES as e,fetchCityWeather as t,getCondition as n,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as s,WidgetSettingsModal as i}from"./chunk-YTZFWV2W.js";import{useWidgetSettings as a}from"./chunk-TKPUYQ3Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y6E7IRK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-WLUJQLXG.js";import"./chunk-5QYKF7NK.js";import"./chunk-PMBCQWJW.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-2VFSYSDS.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WQ4YKWN2.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-JOAKKXTL.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as o}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as m,useEffect as l,useCallback as h}from"react";import{jsxs as p,Fragment as u,jsx as d}from"react/jsx-runtime";var k="world_clock_appearance",g=["London","Shanghai","New York"];function j(){const{prefs:j,save:x}=c(),[b,f]=m(()=>s(k)),[y,N]=m(!1),[v,w]=m([]),[F,C]=m(b),D={useFahrenheit:!!j.weather_prefs?.useFahrenheit},[W,J]=m(D),[S,T]=m(()=>/* @__PURE__ */new Date);l(()=>{const e=setInterval(()=>T(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const Q=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),G=j.world_clocks,M=(()=>{if(!Array.isArray(G)||0===G.length)return g;const t=[];for(const n of G){const r=e[n]?n:Q[n];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[U,K]=m({}),[Y,L]=m(!0);l(()=>{let e=!1;return L(!0),(async()=>{const n={};await Promise.all(M.map(async e=>{const r=await t(e);r&&(n[e]=r)})),e||(K(n),L(!1))})(),()=>{e=!0}},[M.join(",")]),a(h(()=>{w([...M]),C({...b}),J({...D}),N(!0)},[M.join(","),b,D.useFahrenheit]));const O=e=>D.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
1
+ import{AVAILABLE_CITIES as e,fetchCityWeather as t,getCondition as n,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as s,WidgetSettingsModal as i}from"./chunk-ZLKEPDJE.js";import{useWidgetSettings as a}from"./chunk-XQNZJNEJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as o}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as m,useEffect as l,useCallback as h}from"react";import{jsxs as p,Fragment as u,jsx as d}from"react/jsx-runtime";var k="world_clock_appearance",g=["London","Shanghai","New York"];function j(){const{prefs:j,save:x}=c(),[b,f]=m(()=>s(k)),[y,N]=m(!1),[v,w]=m([]),[D,F]=m(b),J={useFahrenheit:!!j.weather_prefs?.useFahrenheit},[C,M]=m(J),[S,T]=m(()=>/* @__PURE__ */new Date);l(()=>{const e=setInterval(()=>T(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const U=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),W=j.world_clocks,Z=(()=>{if(!Array.isArray(W)||0===W.length)return g;const t=[];for(const n of W){const r=e[n]?n:U[n];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[O,A]=m({}),[G,H]=m(!0);l(()=>{let e=!1;return H(!0),(async()=>{const n={};await Promise.all(Z.map(async e=>{const r=await t(e);r&&(n[e]=r)})),e||(A(n),H(!1))})(),()=>{e=!0}},[Z.join(",")]),a(h(()=>{w([...Z]),F({...b}),M({...J}),N(!0)},[Z.join(","),b,J.useFahrenheit]));const X=e=>J.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
2
2
  return p(u,{children:[
3
- /* @__PURE__ */d("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${b.activeOpacity/100})`,backdropFilter:b.activeBlur>0?`blur(${b.activeBlur}px)`:void 0},children:/* @__PURE__ */p("div",{className:"divide-y divide-gray-200",children:[Y&&M.every(e=>!U[e])&&/* @__PURE__ */d(o,{size:"sm",padding:"py-6",label:"Loading"}),M.map(t=>{const r=U[t],s=e[t]?.tz??"UTC",{time:i,ampm:a}=function(e,t){try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(t),r=n.find(e=>"hour"===e.type)?.value||"12";return{time:`${r}:${n.find(e=>"minute"===e.type)?.value||"00"}`,ampm:(n.find(e=>"dayPeriod"===e.type)?.value||"").toUpperCase()}}catch{return{time:"",ampm:""}}}(s,S);if(!r)/* @__PURE__ */
3
+ /* @__PURE__ */d("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${b.activeOpacity/100})`,backdropFilter:b.activeBlur>0?`blur(${b.activeBlur}px)`:void 0},children:/* @__PURE__ */p("div",{className:"divide-y divide-gray-200",children:[G&&Z.every(e=>!O[e])&&/* @__PURE__ */d(o,{size:"sm",padding:"py-6",label:"Loading"}),Z.map(t=>{const r=O[t],s=e[t]?.tz??"UTC",{time:i,ampm:a}=function(e,t){try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(t),r=n.find(e=>"hour"===e.type)?.value||"12";return{time:`${r}:${n.find(e=>"minute"===e.type)?.value||"00"}`,ampm:(n.find(e=>"dayPeriod"===e.type)?.value||"").toUpperCase()}}catch{return{time:"",ampm:""}}}(s,S);if(!r)/* @__PURE__ */
4
4
  return p("div",{className:"px-4 py-3",children:[
5
5
  /* @__PURE__ */p("div",{className:"flex items-baseline justify-between gap-2",children:[
6
6
  /* @__PURE__ */d("span",{className:"text-base font-semibold tracking-tight text-ink-strongest truncate",children:t}),
@@ -10,7 +10,7 @@ return p("div",{className:"px-4 py-3",children:[
10
10
  return p("div",{className:"px-4 py-3",children:[
11
11
  /* @__PURE__ */p("div",{className:"flex items-baseline justify-between gap-2",children:[
12
12
  /* @__PURE__ */d("span",{className:"text-base font-semibold tracking-tight text-ink-strongest truncate",children:t}),
13
- /* @__PURE__ */d("span",{className:"text-2xl font-extralight leading-none tabular-nums tracking-tight text-ink-strongest shrink-0",children:O(r.temp)})]}),
13
+ /* @__PURE__ */d("span",{className:"text-2xl font-extralight leading-none tabular-nums tracking-tight text-ink-strongest shrink-0",children:X(r.temp)})]}),
14
14
  /* @__PURE__ */p("div",{className:"flex items-center justify-between gap-2 mt-2 text-2xs",children:[
15
15
  /* @__PURE__ */p("div",{className:"flex items-center gap-2 min-w-0 text-ink-faint",children:[
16
16
  /* @__PURE__ */d("span",{className:"text-base leading-none shrink-0",children:m}),
@@ -18,13 +18,13 @@ return p("div",{className:"px-4 py-3",children:[
18
18
  /* @__PURE__ */d("span",{className:"text-3xs font-medium ml-0.5 opacity-70",children:a})]}),
19
19
  /* @__PURE__ */d("span",{className:"text-gray-300 shrink-0",children:"·"}),
20
20
  /* @__PURE__ */d("span",{className:"truncate",children:c})]}),
21
- /* @__PURE__ */p("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",O(r.high)," L:",O(r.low)]})]})]},t)})]})}),
22
- /* @__PURE__ */p(i,{open:y,onClose:()=>N(!1),title:"World Clock Settings",appearance:F,onAppearanceChange:C,onSave:()=>{0!==v.length&&(x({world_clocks:v,weather_prefs:{...j.weather_prefs??{},useFahrenheit:W.useFahrenheit}}),f(F),localStorage.setItem(k,JSON.stringify(F)),N(!1))},children:[
21
+ /* @__PURE__ */p("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",X(r.high)," L:",X(r.low)]})]})]},t)})]})}),
22
+ /* @__PURE__ */p(i,{open:y,onClose:()=>N(!1),title:"World Clock Settings",appearance:D,onAppearanceChange:F,onSave:()=>{0!==v.length&&(x({world_clocks:v,weather_prefs:{...j.weather_prefs??{},useFahrenheit:C.useFahrenheit}}),f(D),localStorage.setItem(k,JSON.stringify(D)),N(!1))},children:[
23
23
  /* @__PURE__ */p("div",{children:[
24
24
  /* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
25
25
  /* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
26
26
  /* @__PURE__ */d("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
27
- /* @__PURE__ */d("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */d("button",{onClick:()=>J(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(W.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
27
+ /* @__PURE__ */d("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */d("button",{onClick:()=>M(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(C.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
28
28
  /* @__PURE__ */d("p",{className:"text-2xs text-ink-faintest mt-1",children:"Shared with the Weather widget."})]}),
29
29
  /* @__PURE__ */p("div",{children:[
30
30
  /* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Cities"}),
@@ -59,8 +59,21 @@ interface AssistantPerson {
59
59
  id: string;
60
60
  name: string;
61
61
  }
62
+ /** The message another one quotes, as the server sends it on a history row
63
+ * (`reply_to`): its id, who wrote it, and the start of its text. A message
64
+ * sent in reply carries only the id (`reply_to` on the request). */
65
+ interface AssistantReplyTo {
66
+ id: string;
67
+ author_name: string;
68
+ excerpt: string;
69
+ }
62
70
  interface AssistantMessageMetadata {
63
71
  source?: MessageSource;
72
+ /** When the server saved it (the history row's `created_at`). Only a saved
73
+ * message has the server's id, so only one with this can be quoted. */
74
+ createdAt?: string;
75
+ /** The message this one quotes, drawn above its text. */
76
+ replyTo?: AssistantReplyTo | null;
64
77
  /** In a chat with several people in it: who wrote a message the person did
65
78
  * not, from a restored thread. Absent on the person's own. */
66
79
  author?: AssistantPerson;
@@ -364,8 +377,24 @@ interface AssistantChatLabels {
364
377
  askedBy: string;
365
378
  /** When a message to the people could not be sent. */
366
379
  sayFailed: string;
380
+ /** The rows layout's name for the person's own messages, when the host
381
+ * gives no `selfName`. */
382
+ you: string;
383
+ /** The hover bar's button that quotes a message in the next reply. */
384
+ quote: string;
385
+ /** The hover bar's last button, opening the rest of a message's actions. */
386
+ moreActions: string;
387
+ /** The composer's chip while a reply quotes a message: "{name}" is filled in. */
388
+ replyingTo: string;
389
+ /** The chip's button that drops the quote. */
390
+ clearQuote: string;
367
391
  }
368
392
  type AssistantChatVariant = 'panel' | 'window' | 'bubble';
393
+ /** How the thread draws its messages. `bubbles`: the person's on the right in
394
+ * blue, the assistant's in a card on the left. `rows`: every message a
395
+ * left-aligned row under an avatar, a name and a time, as a team chat does,
396
+ * with a hover bar that can quote it in a reply. */
397
+ type AssistantChatLayout = 'bubbles' | 'rows';
369
398
  /** A host's own action on a piece of the person's text — the admin portal's
370
399
  * "Save this question". The chat hands it the text and knows nothing of what
371
400
  * it does. */
@@ -507,6 +536,13 @@ interface AssistantChatProps {
507
536
  * only" keeps a message from the assistant. Off: only a message that names
508
537
  * the assistant asks it. */
509
538
  assistantDecides?: boolean;
539
+ /** `rows` draws the thread as a team chat: avatar, name and time over
540
+ * each message, a hover bar with Quote, and a quoted message above the
541
+ * reply that quotes it. Default `bubbles`. */
542
+ layout?: AssistantChatLayout;
543
+ /** In `rows`, the name over the person's own messages. Default
544
+ * `labels.you`. */
545
+ selfName?: string;
510
546
  /** Replaces `fetch`, for hosts that need to wrap requests. */
511
547
  fetch?: typeof fetch;
512
548
  className?: string;
@@ -566,8 +602,15 @@ interface MessageProps {
566
602
  onRate?: (runId: string, rating: AssistantAnswerRating | null) => Promise<void> | void;
567
603
  /** Sends the person's words to the assistant (a flowchart's "Add to the PDF"). */
568
604
  onAsk?: (text: string) => void;
569
- }
570
- declare function Message({ message, speaker, toolLabels, labels, showReasoning, showToolOutput, showUsage, live, waitingSince, onApprove, plans, userActions, tableActions, onLinkClick, onOpenAttachment, onOpenFile, renderDataPart, showCopy, answerActions, onRate, onAsk }: MessageProps): react_jsx_runtime.JSX.Element | null;
605
+ /** `rows`: a team chat's row under an avatar, a name and a time, with a
606
+ * hover bar. Default `bubbles`. */
607
+ layout?: AssistantChatLayout;
608
+ /** In `rows`, the name over the person's own messages (default `labels.you`). */
609
+ selfName?: string;
610
+ /** In `rows`, the hover bar's Quote: hands the composer this message. */
611
+ onQuote?: (quote: AssistantReplyTo) => void;
612
+ }
613
+ declare function Message({ message, speaker, toolLabels, labels, showReasoning, showToolOutput, showUsage, live, waitingSince, onApprove, plans, userActions, tableActions, onLinkClick, onOpenAttachment, onOpenFile, renderDataPart, showCopy, answerActions, onRate, onAsk, layout, selfName, onQuote }: MessageProps): react_jsx_runtime.JSX.Element | null;
571
614
 
572
615
  interface ApprovalDecision {
573
616
  approval_id: string;
@@ -580,6 +623,8 @@ interface AssistantChatRequestBody {
580
623
  approvals: ApprovalDecision[];
581
624
  /** Ids of the files sent with `text`; absent when there are none. */
582
625
  attachments?: string[];
626
+ /** The id of the message `text` quotes; absent when it quotes none. */
627
+ reply_to?: string;
583
628
  }
584
629
  /** The tool-part fields the chat reads, whatever the tool is called. */
585
630
  interface ToolPartView {
@@ -618,6 +663,15 @@ declare function buildRequestBody(messages: AssistantUIMessage[], conversationId
618
663
  * ("JARVIS"). An address such as "jarvis@example.com" names nobody. In a chat
619
664
  * with several people in it, such a message always goes to the assistant. */
620
665
  declare function mentionsAssistant(text: string, mention: string, name?: string): boolean;
666
+ /** One stretch of a message's text: plain, or the assistant's `mention`. */
667
+ interface MentionSpan {
668
+ text: string;
669
+ mention: boolean;
670
+ }
671
+ /** A message's text cut where it names the assistant by `mention` ("@JARVIS"),
672
+ * on the same word edges as {@link mentionsAssistant}, so the rows layout can
673
+ * draw each mention as a chip. Without a mention it is one plain span. */
674
+ declare function mentionSpans(text: string, mention: string): MentionSpan[];
621
675
  /** The draft as a question to the assistant: `mention` first, unless it is
622
676
  * already there. */
623
677
  declare function addressedToAssistant(text: string, mention: string): string;
@@ -642,6 +696,8 @@ interface HistoryMessage {
642
696
  author?: AssistantPerson;
643
697
  /** In an invited chat: who asked, on an answer to someone else's question. */
644
698
  asked_by?: AssistantPerson;
699
+ /** The message this one quotes; `null` or absent when it quotes none. */
700
+ reply_to?: AssistantReplyTo | null;
645
701
  }
646
702
  interface HistoryApproval {
647
703
  approval_id: string;
@@ -795,4 +851,4 @@ declare function summarizeChat(messages: AssistantUIMessage[], toolLabels: ToolL
795
851
  /** Compact token counts for the panel: 950, 48.2k, 1.3M. */
796
852
  declare function compactCount(n: number): string;
797
853
 
798
- export { ApprovalCard, type ApprovalDecision, type AssistantAnswerAction, type AssistantAnswerRating, type AssistantAnswerVerdict, type AssistantAttachment, type AssistantAttachmentsConfig, AssistantChat, type AssistantChatDetails, type AssistantChatLabels, type AssistantChatProps, type AssistantChatRequestBody, type AssistantChatVariant, type AssistantConversation, type AssistantDataPart, type AssistantDetailFact, type AssistantErrorCode, Message as AssistantMessage, type AssistantMessageMetadata, type AssistantPerson, type AssistantRateRequest, type AssistantTextAction, type AssistantTurnUsage, type AssistantUIMessage, type ChatDetailsSummary, type ChatFile, type ChatTool, type ChatUsage, type ConversationHistory, DEFAULT_ASSISTANT_CHAT_LABELS, type ErrorDataPart, type FailureView, type FileDataPart, type MessageSource, OWN_DATA_PARTS, PlanApprovalCard, PlanChecklist, type PlanDataPart, type PlanStatus, type PlanStepData, type ToolLabel, type ToolLabelSpec, type ToolLabels, ToolStep, type ToolSummaryDataPart, type ToolSummaryRow, addressedToAssistant, attachmentPart, attachmentsOf, buildRequestBody, compactCount, estimateTokens, failureView, filesOf, finishedStats, isDroppedConnection, liveStats, mentionsAssistant, messagesFromHistory, peopleNames, pinnedPlan, plansOf, summarizeChat, tokensPerSecond, toolSummariesOf };
854
+ export { ApprovalCard, type ApprovalDecision, type AssistantAnswerAction, type AssistantAnswerRating, type AssistantAnswerVerdict, type AssistantAttachment, type AssistantAttachmentsConfig, AssistantChat, type AssistantChatDetails, type AssistantChatLabels, type AssistantChatLayout, type AssistantChatProps, type AssistantChatRequestBody, type AssistantChatVariant, type AssistantConversation, type AssistantDataPart, type AssistantDetailFact, type AssistantErrorCode, Message as AssistantMessage, type AssistantMessageMetadata, type AssistantPerson, type AssistantRateRequest, type AssistantReplyTo, type AssistantTextAction, type AssistantTurnUsage, type AssistantUIMessage, type ChatDetailsSummary, type ChatFile, type ChatTool, type ChatUsage, type ConversationHistory, DEFAULT_ASSISTANT_CHAT_LABELS, type ErrorDataPart, type FailureView, type FileDataPart, type MentionSpan, type MessageSource, OWN_DATA_PARTS, PlanApprovalCard, PlanChecklist, type PlanDataPart, type PlanStatus, type PlanStepData, type ToolLabel, type ToolLabelSpec, type ToolLabels, ToolStep, type ToolSummaryDataPart, type ToolSummaryRow, addressedToAssistant, attachmentPart, attachmentsOf, buildRequestBody, compactCount, estimateTokens, failureView, filesOf, finishedStats, isDroppedConnection, liveStats, mentionSpans, mentionsAssistant, messagesFromHistory, peopleNames, pinnedPlan, plansOf, summarizeChat, tokensPerSecond, toolSummariesOf };