efficient-shell 12.10.0 → 12.12.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 (198) hide show
  1. package/README.md +7 -2
  2. package/dist/{Browser-G2HGYZVD.js → Browser-KPVR5Z6J.js} +16 -16
  3. package/dist/Calculator-RP4UPGG7.js +29 -0
  4. package/dist/{CurrencyConverter-KBY2OXQ2.js → CurrencyConverter-HZWRB62S.js} +11 -11
  5. package/dist/Files-4DVFS74H.js +141 -0
  6. package/dist/{Notepad-CRHG5FLI.js → Notepad-ZQF2NRZZ.js} +8 -8
  7. package/dist/{PdfViewer-L4FJS3M6.js → PdfViewer-BFP2WCMQ.js} +1 -1
  8. package/dist/PomodoroTimer-ME3BMHKR.js +91 -0
  9. package/dist/{Preview-BVTWP7RW.js → Preview-DBXNCPGO.js} +35 -35
  10. package/dist/{Sidebar-QOGK5LJ2.js → Sidebar-FU7TD5FQ.js} +32 -32
  11. package/dist/{Stock-O7AQ2WUN.js → Stock-WK45DFIC.js} +2 -2
  12. package/dist/{Weather-WHXA5TTP.js → Weather-BVKZQI4R.js} +15 -15
  13. package/dist/{WorldClock-CZCIVYKB.js → WorldClock-L3BQXXQX.js} +6 -6
  14. package/dist/ai/index.js +56 -56
  15. package/dist/apps/index.d.ts +60 -2
  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-VWNHSLFY.js → chunk-3FNBUOZK.js} +1 -1
  22. package/dist/{chunk-TKFINWY6.js → chunk-3MMMN3U4.js} +2 -2
  23. package/dist/{chunk-MPTOEXED.js → chunk-3ZQT26GZ.js} +1 -1
  24. package/dist/{chunk-67BWG353.js → chunk-44VAZ2EL.js} +9 -9
  25. package/dist/{chunk-OSQ5NRV3.js → chunk-45HQXTA6.js} +1 -1
  26. package/dist/{chunk-INFL4YZF.js → chunk-4CKPY72R.js} +1 -1
  27. package/dist/{chunk-A2JYBUPB.js → chunk-4NLCXHWN.js} +6 -6
  28. package/dist/{chunk-2WNTDGOP.js → chunk-5EKNXSQG.js} +1 -1
  29. package/dist/{chunk-RLGPIJHB.js → chunk-5NCR64CE.js} +1 -1
  30. package/dist/chunk-5POLDDQW.js +14 -0
  31. package/dist/{chunk-LFWRHBTM.js → chunk-5T4WTFBC.js} +1 -1
  32. package/dist/{chunk-ZC6MXV4L.js → chunk-5ZQY42QX.js} +1 -1
  33. package/dist/{chunk-J4IT5C3A.js → chunk-654DGV5Q.js} +1 -1
  34. package/dist/{chunk-5YPCZLBW.js → chunk-6BNLDGST.js} +1 -1
  35. package/dist/{chunk-LFW3CQMF.js → chunk-6ET6JVNL.js} +4 -4
  36. package/dist/{chunk-HD7OBASH.js → chunk-6TIJH2M6.js} +1 -1
  37. package/dist/{chunk-457SK2XV.js → chunk-6VB4TBU6.js} +5 -5
  38. package/dist/{chunk-KRUI4LVW.js → chunk-73XILSFF.js} +1 -1
  39. package/dist/chunk-7ADTFFEM.js +5 -0
  40. package/dist/{chunk-QSK2OWT3.js → chunk-7ARBBWPQ.js} +2 -2
  41. package/dist/{chunk-RAQBZUU2.js → chunk-AG6Y62TP.js} +61 -61
  42. package/dist/{chunk-Y4YXZIES.js → chunk-AXFNOY2L.js} +9 -9
  43. package/dist/{chunk-J7BMSKOM.js → chunk-B7HTKDT3.js} +6 -6
  44. package/dist/{chunk-PHJFGLXB.js → chunk-BET6KEY2.js} +8 -8
  45. package/dist/{chunk-7Q4DE4CT.js → chunk-BFCIOWYI.js} +1 -1
  46. package/dist/{chunk-RGKSJBXJ.js → chunk-BGBSEPPH.js} +8 -8
  47. package/dist/{chunk-2X4U3VX2.js → chunk-BM5QI2L6.js} +5 -5
  48. package/dist/{chunk-AMSE4PMQ.js → chunk-C5SK5OYU.js} +4 -4
  49. package/dist/{chunk-HRDR56SK.js → chunk-CU3ZE25J.js} +1 -1
  50. package/dist/chunk-EAIHBASJ.js +28 -0
  51. package/dist/{chunk-2NZBQOA6.js → chunk-EAXPSAHZ.js} +9 -9
  52. package/dist/{chunk-KPHYWZXL.js → chunk-EO6MOQOZ.js} +9 -9
  53. package/dist/{chunk-C3E6XFIC.js → chunk-EQ2KTDOU.js} +3 -3
  54. package/dist/{chunk-5WCHUZ6O.js → chunk-FSZ3TNAR.js} +1 -1
  55. package/dist/{chunk-QIMMZVWV.js → chunk-GCVIUXKL.js} +1 -1
  56. package/dist/{chunk-LS6VU6F7.js → chunk-GOKJZKLV.js} +1 -1
  57. package/dist/{chunk-Z334LCCX.js → chunk-ICZUWLVU.js} +1 -1
  58. package/dist/chunk-ITGFHWYG.js +13 -0
  59. package/dist/chunk-J2YURAQY.js +13 -0
  60. package/dist/chunk-J7CHHY7O.js +6 -0
  61. package/dist/{chunk-T3NLFOLW.js → chunk-JOAKKXTL.js} +14 -6
  62. package/dist/{chunk-TVVSFXWY.js → chunk-JZKACEXW.js} +8 -8
  63. package/dist/chunk-KCAUYEYR.js +7 -0
  64. package/dist/{chunk-5MFWM6L4.js → chunk-L6LWO5NQ.js} +1 -1
  65. package/dist/{chunk-RHD4V6CE.js → chunk-LMUB2EAD.js} +9 -9
  66. package/dist/{chunk-4GTXRVDF.js → chunk-LO6TYB5E.js} +2 -2
  67. package/dist/{chunk-UMZJRZFN.js → chunk-LTN4AQYG.js} +1 -1
  68. package/dist/{chunk-6ITEA6SX.js → chunk-LTUVKDTO.js} +1 -1
  69. package/dist/{chunk-F7BXUVN4.js → chunk-LY55C5UI.js} +6 -6
  70. package/dist/chunk-LZKPV3XR.js +3 -0
  71. package/dist/{chunk-OW5LQWPU.js → chunk-MFZPTS7W.js} +2 -2
  72. package/dist/{chunk-6BK3KRT5.js → chunk-MXITMJCT.js} +16 -16
  73. package/dist/{chunk-PICRPJBL.js → chunk-NBUL37WB.js} +1 -1
  74. package/dist/{chunk-W5B7UNMJ.js → chunk-NGQZI7HP.js} +1 -1
  75. package/dist/{chunk-NAWIVFAN.js → chunk-NHIP2S4E.js} +8 -8
  76. package/dist/{chunk-RIF6BFEH.js → chunk-NOEAEXIZ.js} +1 -1
  77. package/dist/{chunk-NKZINXHG.js → chunk-OTXJ6VWX.js} +2 -2
  78. package/dist/{chunk-FOCQEWUH.js → chunk-P3GBQBDC.js} +1 -1
  79. package/dist/{chunk-TDMZFQRB.js → chunk-PDCCNHTP.js} +1 -1
  80. package/dist/{chunk-POOPWYJL.js → chunk-Q64F2EXW.js} +6 -6
  81. package/dist/{chunk-UD4NESX7.js → chunk-QCOXJXGZ.js} +1 -1
  82. package/dist/{chunk-ICNGLA5O.js → chunk-QGFAQVUO.js} +4 -4
  83. package/dist/{chunk-63J2MBXV.js → chunk-QQ5XCRZM.js} +10 -10
  84. package/dist/chunk-QULE4LAC.js +31 -0
  85. package/dist/chunk-QV4M7EOV.js +1 -0
  86. package/dist/{chunk-Q3RJMQYE.js → chunk-RAOM3WIQ.js} +1 -1
  87. package/dist/{chunk-3RDJFCIZ.js → chunk-SEMV4NCH.js} +1 -1
  88. package/dist/{chunk-5Z6XJPAX.js → chunk-SWB32OKH.js} +1 -1
  89. package/dist/{chunk-5QVCBAK2.js → chunk-SXHNZFUY.js} +1 -1
  90. package/dist/chunk-TCMAWDBL.js +19 -0
  91. package/dist/{chunk-NDAZPAQL.js → chunk-TJCJLKJB.js} +1 -1
  92. package/dist/chunk-U35TIWEP.js +23 -0
  93. package/dist/{chunk-22LU6FKN.js → chunk-UDYVA5DV.js} +10 -10
  94. package/dist/{chunk-JOD5ISTB.js → chunk-W7DYKTHE.js} +1 -1
  95. package/dist/{chunk-BJAJOIVY.js → chunk-WQV7VQ5Z.js} +1 -1
  96. package/dist/{chunk-VN3A43SA.js → chunk-XDJQWP5K.js} +1 -1
  97. package/dist/{chunk-NOCOLZ2W.js → chunk-XJW65EIG.js} +1 -1
  98. package/dist/{chunk-5G4CB3E6.js → chunk-Y23BITKG.js} +1 -1
  99. package/dist/{chunk-C7M7KYNY.js → chunk-YFDS6KF3.js} +1 -1
  100. package/dist/{chunk-WDAOTHX5.js → chunk-YMJOFWW6.js} +3 -3
  101. package/dist/{chunk-KZ7RR7EU.js → chunk-YPZXE67U.js} +1 -1
  102. package/dist/{chunk-CRRC72EE.js → chunk-ZICGXJUB.js} +7 -7
  103. package/dist/{chunk-IIMFLLYT.js → chunk-ZLFZJX6M.js} +9 -9
  104. package/dist/{chunk-OAFFHLJ4.js → chunk-ZV6WLVD3.js} +6 -6
  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 +359 -359
  141. package/dist/map/index.js +3 -3
  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-ALPNISJT.js +0 -29
  184. package/dist/Files-OY5TSWUZ.js +0 -126
  185. package/dist/PomodoroTimer-NGQPYDI3.js +0 -91
  186. package/dist/chunk-5RT5XDHG.js +0 -6
  187. package/dist/chunk-6BQUSUNK.js +0 -14
  188. package/dist/chunk-7XGUX3TH.js +0 -3
  189. package/dist/chunk-BR7L5NE3.js +0 -13
  190. package/dist/chunk-EHVBJUQI.js +0 -28
  191. package/dist/chunk-HV4VQ5XV.js +0 -13
  192. package/dist/chunk-KVU5IQOZ.js +0 -7
  193. package/dist/chunk-OSNHRKX6.js +0 -5
  194. package/dist/chunk-PEIRPNXT.js +0 -23
  195. package/dist/chunk-PY7GHIYF.js +0 -19
  196. package/dist/chunk-Z6KW4WZ6.js +0 -31
  197. package/dist/chunk-ZPHUMLET.js +0 -1
  198. /package/dist/{chunk-MBXCXFQO.js → chunk-27ZJQUDS.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{DEFAULT_FLOW_CHART_LABELS,FlowChart as default,flowDescription,flowFileName}from"../chunk-HD7OBASH.js";import"../chunk-FAERBT6Y.js";import"../chunk-EVYD6UFQ.js";import"../chunk-M5K4AX4E.js";import"../chunk-T3NLFOLW.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-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";
2
+ export{DEFAULT_FLOW_CHART_LABELS,FlowChart as default,flowDescription,flowFileName}from"../chunk-6TIJH2M6.js";import"../chunk-FAERBT6Y.js";import"../chunk-EVYD6UFQ.js";import"../chunk-M5K4AX4E.js";import"../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-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-T3NLFOLW.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var a=()=>/* @__PURE__ */t(e,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function i({items:e,value:i,onChange:n,"aria-label":l,className:s=""}){const c=Math.max(0,e.findIndex(e=>e.id===i));/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-JOAKKXTL.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var a=()=>/* @__PURE__ */t(e,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function i({items:e,value:i,onChange:n,"aria-label":l,className:s=""}){const c=Math.max(0,e.findIndex(e=>e.id===i));/* @__PURE__ */
2
2
  return t("ol",{"aria-label":l,className:`grid items-start ${s}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((i,l)=>{const s=l<c?"complete":l===c?"current":"upcoming",o="complete"===s&&!!n,m=/* @__PURE__ */t("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===s?"bg-blue-600 text-white":"","current"===s?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===s?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===s?/* @__PURE__ */t(a,{}):l+1}),d=/* @__PURE__ */r("span",{className:"min-w-0 text-center",children:[
3
3
  /* @__PURE__ */t("span",{className:"block text-sm font-medium "+("upcoming"===s?"text-gray-400":"text-gray-900"),children:i.label}),i.description&&/* @__PURE__ */t("span",{className:"block text-xs text-gray-500",children:i.description})]});/* @__PURE__ */
4
4
  return r("li",{"aria-current":"current"===s?"step":void 0,className:"relative flex min-w-0 justify-center",children:[l<e.length-1&&/* @__PURE__ */t("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(l<c?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),o?/* @__PURE__ */r("button",{type:"button",onClick:()=>n?.(i.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[m,d]}):/* @__PURE__ */r("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[m,d]})]},i.id)})})}export{i as Stepper};
@@ -1,3 +1,3 @@
1
- import{IconPicker as e}from"./chunk-C3E6XFIC.js";import{ColorPicker as t}from"./chunk-22LU6FKN.js";import{InputNumber_default as r}from"./chunk-4GTXRVDF.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as l}from"./chunk-T3NLFOLW.js";import{jsxs as a,Fragment as i,jsx as s}from"react/jsx-runtime";var n=["top","right","bottom","left"];function d(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function m(e,t){const r=e??{},o=d(t),l=n.some(e=>"number"==typeof r[e]),a=n.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:l?0:o[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(l,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(l,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(l,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(l,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(l,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(l,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(l,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(l,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:l,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:g=!0,min:y=0,max:N=20,step:v=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,k=(e,t)=>{const r={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(r[e]=d.width);r[e]=t,delete r.width,m(r)},C=(e,t,o,l,a,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(r,{value:l,onChange:i,min:y,max:N,step:v,precision:0,steppers:"compact",readOnly:x,placeholder:a,prefix:o,suffix:b.unit,"aria-label":t})}),O=n.map(j),S="number"==typeof d.width?d.width:O.every(e=>null!==e&&e===O[0])?O[0]:null,F=null===S&&O.some(e=>null!==e),L=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",T=e=>j(e)??("number"==typeof d.width?d.width:null),E=d.style??u.style;/* @__PURE__ */
2
- return a("div",{role:"group","aria-label":l,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(i,{children:[C("left",b.sides.left,h.left,T("left"),String(u.sides.left),e=>k("left",e)),C("top",b.sides.top,h.top,T("top"),String(u.sides.top),e=>k("top",e)),C("right",b.sides.right,h.right,T("right"),String(u.sides.right),e=>k("right",e)),C("bottom",b.sides.bottom,h.bottom,T("bottom"),String(u.sides.bottom),e=>k("bottom",e))]}):C("all",b.width,h.all,S,F?"–":L,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,g&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(e,{label:b.style,value:E,disabled:x,onChange:e=>{x||m({...d,style:e})},options:o.map(e=>({value:e,label:b.styles[e],icon:p[e]}))})}),
1
+ import{IconPicker as e}from"./chunk-EQ2KTDOU.js";import{ColorPicker as t}from"./chunk-UDYVA5DV.js";import{InputNumber_default as r}from"./chunk-LO6TYB5E.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as l}from"./chunk-JOAKKXTL.js";import{jsxs as a,Fragment as i,jsx as s}from"react/jsx-runtime";var n=["top","right","bottom","left"];function d(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function m(e,t){const r=e??{},o=d(t),l=n.some(e=>"number"==typeof r[e]),a=n.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:l?0:o[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(l,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(l,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(l,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(l,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(l,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(l,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(l,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(l,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:l,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:g=!0,min:y=0,max:v=20,step:N=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,O=(e,t)=>{const r={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(r[e]=d.width);r[e]=t,delete r.width,m(r)},k=(e,t,o,l,a,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(r,{value:l,onChange:i,min:y,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:a,prefix:o,suffix:b.unit,"aria-label":t})}),S=n.map(j),C="number"==typeof d.width?d.width:S.every(e=>null!==e&&e===S[0])?S[0]:null,T=null===C&&S.some(e=>null!==e),D=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",E=e=>j(e)??("number"==typeof d.width?d.width:null),K=d.style??u.style;/* @__PURE__ */
2
+ return a("div",{role:"group","aria-label":l,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(i,{children:[k("left",b.sides.left,h.left,E("left"),String(u.sides.left),e=>O("left",e)),k("top",b.sides.top,h.top,E("top"),String(u.sides.top),e=>O("top",e)),k("right",b.sides.right,h.right,E("right"),String(u.sides.right),e=>O("right",e)),k("bottom",b.sides.bottom,h.bottom,E("bottom"),String(u.sides.bottom),e=>O("bottom",e))]}):k("all",b.width,h.all,C,T?"–":D,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,g&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(e,{label:b.style,value:K,disabled:x,onChange:e=>{x||m({...d,style:e})},options:o.map(e=>({value:e,label:b.styles[e],icon:p[e]}))})}),
3
3
  /* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(t,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"md",disabled:x})})]})}export{u as BorderInput,d as borderSides,m as borderStartEach};
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-T3NLFOLW.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-JOAKKXTL.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,11 +1,11 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-RIF6BFEH.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-Z7RXWXR5.js";import{useShellStrings as l}from"./chunk-TJSJVC6P.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},C){const F=m(),R=l().files,$=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),z=j?`${F}-error`:N?`${F}-hint`:void 0;/* @__PURE__ */
2
- return o(e,{label:g,htmlFor:F,hint:N,error:j,required:k,className:v,children:[
3
- /* @__PURE__ */o("button",{ref:C,type:"button",id:F,disabled:y,onClick:$.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":z,...$.zoneProps,className:t($.dragOver,y,a(y),"px-4 py-6"),children:[
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-NOEAEXIZ.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-Z7RXWXR5.js";import{useShellStrings as l}from"./chunk-TJSJVC6P.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},C){const $=m(),z=l().files,O=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),R=j?`${$}-error`:N?`${$}-hint`:void 0;/* @__PURE__ */
2
+ return o(e,{label:g,htmlFor:$,hint:N,error:j,required:k,className:v,children:[
3
+ /* @__PURE__ */o("button",{ref:C,type:"button",id:$,disabled:y,onClick:O.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":R,...O.zoneProps,className:t(O.dragOver,y,a(y),"px-4 py-6"),children:[
4
4
  /* @__PURE__ */o("span",{children:[
5
- /* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x?R.chooseMany:R.chooseOne}),
6
- /* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x?R.dragMany:R.dragOne}`})]}),h&&/* @__PURE__ */d("span",{className:"text-xs text-gray-400",children:h})]}),
7
- /* @__PURE__ */d("input",{...$.inputProps}),c.length>0&&/* @__PURE__ */d("ul",{className:"mt-2 flex flex-col gap-1",children:c.map((e,t)=>/* @__PURE__ */o("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
5
+ /* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x?z.chooseMany:z.chooseOne}),
6
+ /* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x?z.dragMany:z.dragOne}`})]}),h&&/* @__PURE__ */d("span",{className:"text-xs text-gray-400",children:h})]}),
7
+ /* @__PURE__ */d("input",{...O.inputProps}),c.length>0&&/* @__PURE__ */d("ul",{className:"mt-2 flex flex-col gap-1",children:c.map((e,t)=>/* @__PURE__ */o("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
8
8
  /* @__PURE__ */d("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:e.name,children:e.name}),
9
- /* @__PURE__ */d("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:i(e.size,R)}),
10
- /* @__PURE__ */d("button",{type:"button",disabled:y,onClick:()=>{$.clearRejections(),p(c.filter((e,a)=>a!==t))},"aria-label":R.remove(e.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */d(r,{})})]},`${e.name}-${t}`))}),
11
- /* @__PURE__ */d(s,{rejections:$.rejections})]})});export{p as FilePicker_default};
9
+ /* @__PURE__ */d("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:i(e.size,z)}),
10
+ /* @__PURE__ */d("button",{type:"button",disabled:y,onClick:()=>{O.clearRejections(),p(c.filter((e,a)=>a!==t))},"aria-label":z.remove(e.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */d(r,{})})]},`${e.name}-${t}`))}),
11
+ /* @__PURE__ */d(s,{rejections:O.rejections})]})});export{p as FilePicker_default};
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-2X4U3VX2.js";import{Avatar as t}from"./chunk-QMNDKNK2.js";import{ItemCount as r}from"./chunk-KWTK6TGH.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-BM5QI2L6.js";import{Avatar as t}from"./chunk-QMNDKNK2.js";import{ItemCount as r}from"./chunk-KWTK6TGH.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
2
2
  return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
3
3
  /* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
4
4
  /* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
@@ -1,2 +1,2 @@
1
- import{InputNumber_default as a}from"./chunk-4GTXRVDF.js";import{Icon as e}from"./chunk-T3NLFOLW.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
1
+ import{InputNumber_default as a}from"./chunk-LO6TYB5E.js";import{Icon as e}from"./chunk-JOAKKXTL.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
2
2
  return r("div",{role:"group","aria-label":e,className:"grid min-w-0 grid-cols-2 gap-2",children:[u("x"),u("y")]})}export{s as PositionInput};
@@ -1,7 +1,7 @@
1
- import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-WM2BBRT6.js";import{Icon as i}from"./chunk-T3NLFOLW.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
- return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:P=""}){const T=x||!!p,W=n(u),$=l(null),A=s(),I=[B?.["aria-describedby"],j?A:void 0].filter(Boolean).join(" ")||void 0,K=B?.tabIndex;a(()=>{const e=$.current;if(!e||void 0!==K)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const L="comfortable"===W?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},M=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
1
+ import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-WM2BBRT6.js";import{Icon as i}from"./chunk-JOAKKXTL.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
+ return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:K=""}){const P=x||!!p,T=n(u),A=l(null),$=s(),I=[B?.["aria-describedby"],j?$:void 0].filter(Boolean).join(" ")||void 0,J=B?.tabIndex;a(()=>{const e=A.current;if(!e||void 0!==J)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const M="comfortable"===T?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},R=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
3
3
  /* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
4
- return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":T||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":T?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${L[k]}`}),
5
- /* @__PURE__ */c("div",{...B,ref:e=>{var r,t;$.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":B?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":I,onKeyDown:e=>{if(B?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",P].filter(Boolean).join(" "),children:[
6
- /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[M&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[M,
7
- /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:M})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:A})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
4
+ return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":P||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":P?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${M[k]}`}),
5
+ /* @__PURE__ */c("div",{...B,ref:e=>{var r,t;A.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":B?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":I,onKeyDown:e=>{if(B?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",K].filter(Boolean).join(" "),children:[
6
+ /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[R&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[R,
7
+ /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:R})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:$})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
@@ -1,4 +1,4 @@
1
- import{useShellLanguage as e}from"./chunk-SEHKTBVM.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-PY7GHIYF.js";import{Icon as t}from"./chunk-T3NLFOLW.js";import{useShellStrings as l}from"./chunk-TJSJVC6P.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
1
+ import{useShellLanguage as e}from"./chunk-SEHKTBVM.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-TCMAWDBL.js";import{Icon as t}from"./chunk-JOAKKXTL.js";import{useShellStrings as l}from"./chunk-TJSJVC6P.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
2
2
  /* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
4
4
  /* @__PURE__ */s("div",{children:[
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-BYDSBDVS.js";import{Select_default as a}from"./chunk-PY7GHIYF.js";import{Pagination as r}from"./chunk-EVEGK57J.js";import{Input_default as t}from"./chunk-HRDR56SK.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-JMGDGNM7.js";import{Button_default as l}from"./chunk-EVYD6UFQ.js";import{Icon as c}from"./chunk-T3NLFOLW.js";import{TH_ONE_LINE as m}from"./chunk-G67CJAQ2.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-BYDSBDVS.js";import{Select_default as a}from"./chunk-TCMAWDBL.js";import{Pagination as r}from"./chunk-EVEGK57J.js";import{Input_default as t}from"./chunk-CU3ZE25J.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-JMGDGNM7.js";import{Button_default as l}from"./chunk-EVYD6UFQ.js";import{Icon as c}from"./chunk-JOAKKXTL.js";import{TH_ONE_LINE as m}from"./chunk-G67CJAQ2.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
2
2
  return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
3
3
  /* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
@@ -0,0 +1,14 @@
1
+ import{SearchableSelect as e}from"./chunk-ITGFHWYG.js";import{Select_default as a}from"./chunk-TCMAWDBL.js";import{labelClasses as l}from"./chunk-EQKUFYX6.js";import{isSafeLinkHref as t}from"./chunk-Q5Z3KHT2.js";import{Input_default as r}from"./chunk-CU3ZE25J.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{Icon as o}from"./chunk-JOAKKXTL.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-TJSJVC6P.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:C,readOnly:N,placeholder:F,className:j="",tidyAddress:O,addressAddon:T}=t,A=void 0!==t.onApply,E=u().link,$=y.isSafe??k,z=d(),D=c(null),K=c(null),[U,Y]=p({url:n}),W=A?U.url:n,[J,L]=p(!1),[P,Q]=p(null),[B,H]=p(null),[M,S]=p(!1),V=c(null),Z=c(()=>{});Z.current=A?t.onCancel:()=>{},m(()=>{if(A)return s(e=>{const a=D.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(Z.current(),!0)},()=>D.current)},[A]),m(()=>{if(!A)return;const e=K.current;e?(e.focus(),e.select()):D.current?.querySelector("button, input")?.focus()},[]);const G=o??[{value:b,label:E.address,target:{type:"text"}}],R=P&&P.against===W?P.kind:y.kindOf(W),X=G.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===R),q=X.find(e=>"text"===e.target.type),I=X.find(e=>e.value===R)??q??X[0];if(!I)return null;const _="text"!==I.target.type,ee=_?y.targetOf(W):W,ae=h(I.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:E.unavailable(e)}),re="select"===I.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(W):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=B&&B.against===W?B.text:W,se=_?W:O?O(oe.trim()).trim():oe.trim(),ue=A&&O?se:oe,de=!_&&""!==ue.trim()&&!$(ue),ce=de&&(!A||J);_&&M&&S(!1);const pe=(e,a)=>{A?Y({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{Q(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{L(!1);const a=e.trim();a?$(e)?(H({text:e,against:a}),me(a)):H({text:e,against:W}):(H({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===K.current||V.current?.contains(a)))return;if(S(!1),A||!O||N)return;const l=O(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!A||!se)return;if(!_&&de)return void L(!0);const e=_&&U.url===se?U.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(l,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const a=r.some(e=>""===e.value);/* @__PURE__ */
2
+ return f(e,{"aria-label":l,value:t,options:o,disabled:N,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
3
+ return f(a,{size:"sm","aria-label":l,value:t,options:o,readOnly:N,onChange:n})};let ke;if("text"===I.target.type)ke=/* @__PURE__ */f(r,{ref:K,id:`${z}-address`,size:"sm",type:"text",invalid:ce,"aria-label":E.address,"aria-describedby":ce?`${z}-why`:void 0,placeholder:F??E.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:N,onChange:e=>ve(e.target.value),onFocus:()=>S(!0),onBlur:ge,onKeyDown:O&&!A?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===I.target.type?I.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):I.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:I.target.placeholder},...be(e,ee)];ke=xe(I.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(E.linkType,I.value,X.map(e=>({value:e.value,label:e.label})),e=>{H(null),L(!1);const a=X.find(a=>a.value===e);if(!a||"text"===a.target.type)return void Q({kind:e,against:W});const l=h(a.target)[0];Q({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,T&&M&&!N&&"text"===I.target.type&&/* @__PURE__ */f("div",{ref:V,onBlur:ge,children:T({url:oe,onChange:ve})}),re&&xe(E.filter,ne?.param??"",[{value:"",label:E.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(E.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${z}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:E.unsafe}),I.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:I.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:E.filterHint})]});if(!A)/* @__PURE__ */
4
+ return f("div",{ref:D,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:C?"group":void 0,"aria-label":C,children:ye});const we=t.onRemove;/* @__PURE__ */
5
+ return v("div",{ref:D,role:"dialog","aria-label":C??E.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:l({inline:!0}),children:E.title}):/* @__PURE__ */f("label",{htmlFor:`${z}-address`,className:l({inline:!0}),children:E.title}),ye,
6
+ /* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:E.remove}):null,
7
+ /* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
8
+ /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>Z.current(),children:E.cancel}),
9
+ /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:N||""===se,children:E.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,C]=p(!1),N=c(null),F=d(),j=()=>{C(!1),N.current?.focus()};/* @__PURE__ */
10
+ return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
11
+ /* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
12
+ /* @__PURE__ */v("button",{ref:N,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>C(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
13
+ /* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
14
+ /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:t?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{y as LinkPicker,w as TextLinkField};
@@ -1,4 +1,4 @@
1
- import{IconButton_default as e}from"./chunk-SV5RRBVA.js";import{CloseGlyph as t}from"./chunk-RIF6BFEH.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-Z7RXWXR5.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{Icon as i}from"./chunk-T3NLFOLW.js";import{useShellStrings as c}from"./chunk-TJSJVC6P.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
1
+ import{IconButton_default as e}from"./chunk-SV5RRBVA.js";import{CloseGlyph as t}from"./chunk-NOEAEXIZ.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-Z7RXWXR5.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{Icon as i}from"./chunk-JOAKKXTL.js";import{useShellStrings as c}from"./chunk-TJSJVC6P.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
2
2
  return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
3
3
  return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
4
4
  return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-RAQBZUU2.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-AG6Y62TP.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-T3NLFOLW.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-TJSJVC6P.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-JOAKKXTL.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-TJSJVC6P.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
2
2
  return r(e,{name:"align-left"});case"center":/* @__PURE__ */
3
3
  return r(e,{name:"align-center"});case"right":/* @__PURE__ */
4
4
  return r(e,{name:"align-right"});case"justify":/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{Button_default as e}from"./chunk-EVYD6UFQ.js";import{Icon as r}from"./chunk-T3NLFOLW.js";import{useShellStrings as t}from"./chunk-TJSJVC6P.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-JOAKKXTL.js";import{useShellStrings as t}from"./chunk-TJSJVC6P.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{InputNumber_default as e}from"./chunk-4GTXRVDF.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-TJSJVC6P.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
2
- return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:j,showInput:$=!0,emptyLabel:L,placeholderValue:M,stepFrom:C,label:D,"aria-labelledby":K,valueText:A,id:R,disabled:T,size:V="md",boxSize:E="sm",className:J="",auto:P}){const W=n(),q=o(),B=t(),G=P??B,H=o(),I=R??q,O=F??p(S),U=k??w,X=N??g,Q=void 0!==L||void 0!==M,Y=C??M,Z=f(r??M??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(j);i(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,$]);const ne=e=>A?A(e):"string"==typeof j?`${e.toFixed(O)} ${j}`:void 0,re=null==r?L??(null!=M?ne(M)??String(M):void 0):ne(r),le=`calc(${x([w.toFixed(O),g.toFixed(O),r?.toFixed(O),L,M?.toFixed(O)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,$?le:null)},[de,oe,le,$]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${J}`.trim(),children:[
3
- /* @__PURE__ */c("input",{id:I,type:"range",min:w,max:g,step:S,value:Z,disabled:T,"aria-label":K?void 0:D,"aria-labelledby":K,"aria-valuetext":re,"aria-describedby":G?H:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=Y))return;e.preventDefault();a(b((r??Y??Z)+t*(i?z??S:S),w,g,O))},onChange:e=>a(b(Number(e.target.value),w,g,O)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===V?"h-1":"h-1.5")}),$&&
4
- /* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<U||e>X||a(e):Q&&a(null)},min:U,max:X,step:S,shiftStep:z,stepFrom:Y,precision:O,snap:!0,allowEmpty:Q,suffix:j,disabled:T,placeholder:L??(null!=M?M.toFixed(O):void 0),size:E,auto:G,"aria-label":D?W.slider.value(D):void 0,"aria-labelledby":D?void 0:K})}),G&&/* @__PURE__ */c("span",{id:H,hidden:!0,children:W.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
1
+ import{InputNumber_default as e}from"./chunk-LO6TYB5E.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-TJSJVC6P.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
2
+ return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:j,showInput:L=!0,emptyLabel:$,placeholderValue:M,stepFrom:C,label:K,"aria-labelledby":A,valueText:D,id:E,disabled:T,size:J="md",boxSize:P="sm",className:R="",auto:V}){const W=n(),B=o(),O=t(),q=V??O,H=o(),I=E??B,U=F??p(S),Y=k??w,G=N??g,Q=void 0!==$||void 0!==M,X=C??M,Z=f(r??M??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(j);i(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,L]);const ne=e=>D?D(e):"string"==typeof j?`${e.toFixed(U)} ${j}`:void 0,re=null==r?$??(null!=M?ne(M)??String(M):void 0):ne(r),le=`calc(${x([w.toFixed(U),g.toFixed(U),r?.toFixed(U),$,M?.toFixed(U)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,L?le:null)},[de,oe,le,L]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${R}`.trim(),children:[
3
+ /* @__PURE__ */c("input",{id:I,type:"range",min:w,max:g,step:S,value:Z,disabled:T,"aria-label":A?void 0:K,"aria-labelledby":A,"aria-valuetext":re,"aria-describedby":q?H:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=X))return;e.preventDefault();a(b((r??X??Z)+t*(i?z??S:S),w,g,U))},onChange:e=>a(b(Number(e.target.value),w,g,U)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===J?"h-1":"h-1.5")}),L&&
4
+ /* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<Y||e>G||a(e):Q&&a(null)},min:Y,max:G,step:S,shiftStep:z,stepFrom:X,precision:U,snap:!0,allowEmpty:Q,suffix:j,disabled:T,placeholder:$??(null!=M?M.toFixed(U):void 0),size:P,auto:q,"aria-label":K?W.slider.value(K):void 0,"aria-labelledby":K?void 0:A})}),q&&/* @__PURE__ */c("span",{id:H,hidden:!0,children:W.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
@@ -1,4 +1,4 @@
1
- import{layoutFlow as e}from"./chunk-FAERBT6Y.js";import{Button_default as t}from"./chunk-EVYD6UFQ.js";import{Icon as n}from"./chunk-T3NLFOLW.js";import{CHART_INK as r,STATUS_VARS as o,SERIES_VARS as i}from"./chunk-TZFACUMR.js";import{useMemo as l,useRef as a,useId as c}from"react";import{jsxs as d,jsx as s}from"react/jsx-runtime";var h={downloadPng:"Download PNG",downloadSvg:"Download SVG",toPdf:"Add to the PDF"},m={label:"var(--ink-strong)",note:r.label,line:r.label},f={step:i[0],decision:o.warning,start:r.muted,end:r.muted};function u(e,t){return`${(e.title??"flowchart").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"flowchart"}.${t}`}function g(e){const t=new Map(e.nodes.map(e=>[e.id,e.label]));return e.edges.map(e=>`${t.get(e.from)} to ${t.get(e.to)}${e.label?` (${e.label})`:""}`).join("; ")}function w({node:e}){const t=f[e.kind],n=e.x+e.width/2,r=e.y+e.height/2,o=e.note?[...e.lines,e.note]:e.lines,i=r-15*(o.length-1)/2,l="decision"===e.kind?/* @__PURE__ */s("polygon",{points:`${n},${e.y} ${e.x+e.width},${r} ${n},${e.y+e.height} ${e.x},${r}`}):/* @__PURE__ */s("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:"step"===e.kind?4:e.height/2});/* @__PURE__ */
1
+ import{layoutFlow as e}from"./chunk-FAERBT6Y.js";import{Button_default as t}from"./chunk-EVYD6UFQ.js";import{Icon as n}from"./chunk-JOAKKXTL.js";import{CHART_INK as r,STATUS_VARS as o,SERIES_VARS as i}from"./chunk-TZFACUMR.js";import{useMemo as l,useRef as a,useId as c}from"react";import{jsxs as d,jsx as s}from"react/jsx-runtime";var h={downloadPng:"Download PNG",downloadSvg:"Download SVG",toPdf:"Add to the PDF"},m={label:"var(--ink-strong)",note:r.label,line:r.label},f={step:i[0],decision:o.warning,start:r.muted,end:r.muted};function u(e,t){return`${(e.title??"flowchart").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"flowchart"}.${t}`}function g(e){const t=new Map(e.nodes.map(e=>[e.id,e.label]));return e.edges.map(e=>`${t.get(e.from)} to ${t.get(e.to)}${e.label?` (${e.label})`:""}`).join("; ")}function w({node:e}){const t=f[e.kind],n=e.x+e.width/2,r=e.y+e.height/2,o=e.note?[...e.lines,e.note]:e.lines,i=r-15*(o.length-1)/2,l="decision"===e.kind?/* @__PURE__ */s("polygon",{points:`${n},${e.y} ${e.x+e.width},${r} ${n},${e.y+e.height} ${e.x},${r}`}):/* @__PURE__ */s("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:"step"===e.kind?4:e.height/2});/* @__PURE__ */
2
2
  return d("g",{fill:t,fillOpacity:.14,stroke:t,strokeWidth:1,children:[l,o.map((t,r)=>{const l=void 0!==e.note&&r===o.length-1;/* @__PURE__ */
3
3
  return s("text",{x:n,y:i+15*r,textAnchor:"middle",dominantBaseline:"central",fontSize:l?11:12.5,fontWeight:l?400:600,fill:l?m.note:m.label,fillOpacity:1,stroke:"none",children:t},r)})]})}function p(e){const t=e.cloneNode(!0),n=[e,...Array.from(e.querySelectorAll("*"))],r=[t,...Array.from(t.querySelectorAll("*"))],o=e.ownerDocument.defaultView;n.forEach((e,t)=>{for(const n of["fill","stroke"]){const i=e.getAttribute(n);i&&i.includes("var(")&&o&&r[t].setAttribute(n,o.getComputedStyle(e).getPropertyValue(n)||i)}});const i=o?.getComputedStyle(e).getPropertyValue("--viz-surface").trim();if(i){const n=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("fill",i),t.insertBefore(n,t.firstChild)}return t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("font-family","system-ui, -apple-system, Segoe UI, sans-serif"),(new XMLSerializer).serializeToString(t)}function b(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function y({spec:r,labels:o,onToPdf:i,bare:f=!1,className:y}){const k={...h,...o},v=l(()=>e(r),[r]),x=a(null),$=r.title??"Flowchart",A=`flow-arrow-${c().replace(/:/g,"")}`;/* @__PURE__ */
4
4
  return d("figure",{className:`my-2 ${y??""}`,children:[
@@ -1,9 +1,9 @@
1
- import{Segmented as e}from"./chunk-QAS22BIS.js";import{ImageFocusPoint as a}from"./chunk-YX4MRM7A.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-RIF6BFEH.js";import{TransferProgress as u}from"./chunk-JVNJCRHM.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-Z7RXWXR5.js";import{Icon as p}from"./chunk-T3NLFOLW.js";import{useShellStrings as b}from"./chunk-TJSJVC6P.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as N,Fragment as j}from"react/jsx-runtime";var x=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:F,label:C,hint:U,error:O,required:P,className:$,accept:z="image/*",maxSizeBytes:B,fit:H="cover",height:S=112,placeholder:I,cta:J,acceptHint:W,showFilename:q=!0,allowReplace:A=!0,allowRemove:M=!0,replaceLabel:V,removeLabel:X,busy:K=!1,busyLabel:T,choosingLabel:Y,pickFailedLabel:_,progress:D,disabled:E=!1,kind:Q,onKindChange:Z,focus:G,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=J??ie.cta,oe=Q??(/video/.test(z)&&!/image/.test(z)?"video":"image"),re="string"==typeof X&&X?X:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=K||ne,me=ne&&!K?Y??ie.choosing:T??ie.uploading,he=O??(se?_??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=E||ue,ke=!!w&&(t(w,z)||w===ve),Ne=I??o(z,ie),je=V??(ke||"video"===oe?ie.changeVideo:ie.changeImage),xe=e=>{R?pe(e):F?F(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:z,maxSizeBytes:B,acceptHint:W,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Fe=w?r(w):"",Ce=!ke&&!!ee,Ue=E||!A&&!M?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[A&&/* @__PURE__ */k("button",{id:Ce?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
1
+ import{Segmented as e}from"./chunk-QAS22BIS.js";import{ImageFocusPoint as a}from"./chunk-YX4MRM7A.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-NOEAEXIZ.js";import{TransferProgress as u}from"./chunk-JVNJCRHM.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-Z7RXWXR5.js";import{Icon as p}from"./chunk-JOAKKXTL.js";import{useShellStrings as b}from"./chunk-TJSJVC6P.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as N,Fragment as j}from"react/jsx-runtime";var x=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:F,hint:U,error:O,required:P,className:$,accept:z="image/*",maxSizeBytes:A,fit:J="cover",height:S=112,placeholder:X,cta:B,acceptHint:H,showFilename:I=!0,allowReplace:K=!0,allowRemove:q=!0,replaceLabel:M,removeLabel:V,busy:W=!1,busyLabel:E,choosingLabel:T,pickFailedLabel:Y,progress:Z,disabled:_=!1,kind:D,onKindChange:Q,focus:G,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=B??ie.cta,oe=D??(/video/.test(z)&&!/image/.test(z)?"video":"image"),re="string"==typeof V&&V?V:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=W||ne,me=ne&&!W?T??ie.choosing:E??ie.uploading,he=O??(se?Y??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=_||ue,ke=!!w&&(t(w,z)||w===ve),Ne=X??o(z,ie),je=M??(ke||"video"===oe?ie.changeVideo:ie.changeImage),xe=e=>{R?pe(e):C?C(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:z,maxSizeBytes:A,acceptHint:H,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ce=w?r(w):"",Fe=!ke&&!!ee,Ue=_||!K&&!q?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[K&&/* @__PURE__ */k("button",{id:Fe?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
2
2
  /* @__PURE__ */N(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
- /* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),M&&/* @__PURE__ */N("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */N(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ce?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Ce?void 0:{height:S},children:[Ce?
4
- /* @__PURE__ */N(a,{value:G??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */N("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Fe||void 0,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */N("img",{src:w??void 0,alt:Fe,className:"h-full w-full",style:{objectFit:H,objectPosition:G||void 0}}),q&&w&&/* @__PURE__ */N(n,{children:Fe}),Ue,ue&&/* @__PURE__ */N(l,{label:me,progress:D,rounded:"rounded-md"})]}),Pe=/* @__PURE__ */N("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof Ne?Ne:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":P||void 0,"aria-describedby":he?`${be}-error`:U?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:S},children:ue?/* @__PURE__ */N(u,{state:"busy",verb:me,pct:D}):/* @__PURE__ */k(j,{children:[
3
+ /* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),q&&/* @__PURE__ */N("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */N(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Fe?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Fe?void 0:{height:S},children:[Fe?
4
+ /* @__PURE__ */N(a,{value:G??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */N("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ce||void 0,className:"h-full w-full",style:{objectFit:J}}):/* @__PURE__ */N("img",{src:w??void 0,alt:Ce,className:"h-full w-full",style:{objectFit:J,objectPosition:G||void 0}}),I&&w&&/* @__PURE__ */N(n,{children:Ce}),Ue,ue&&/* @__PURE__ */N(l,{label:me,progress:Z,rounded:"rounded-md"})]}),Pe=/* @__PURE__ */N("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof Ne?Ne:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":P||void 0,"aria-describedby":he?`${be}-error`:U?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:S},children:ue?/* @__PURE__ */N(u,{state:"busy",verb:me,pct:Z}):/* @__PURE__ */k(j,{children:[
5
5
  /* @__PURE__ */N("span",{className:"text-ink-faintest",children:/* @__PURE__ */N(s,{})}),
6
6
  /* @__PURE__ */N("span",{className:"px-3 text-xs text-ink-faint",children:Ne}),
7
- /* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),W&&/* @__PURE__ */N("span",{className:"text-xs text-ink-faintest",children:W})]})});/* @__PURE__ */
8
- return k(i,{label:C,htmlFor:be,hint:U,error:he,required:P,className:$,children:[Z&&/* @__PURE__ */N("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */N(e,{value:oe,onChange:e=>Z(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */N(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */N(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof C&&C?C:ie.upload})}),w?Oe:Pe,!R&&/* @__PURE__ */N("input",{...we.inputProps}),
7
+ /* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),H&&/* @__PURE__ */N("span",{className:"text-xs text-ink-faintest",children:H})]})});/* @__PURE__ */
8
+ return k(i,{label:F,htmlFor:be,hint:U,error:he,required:P,className:$,children:[Q&&/* @__PURE__ */N("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */N(e,{value:oe,onChange:e=>Q(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */N(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */N(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof F&&F?F:ie.upload})}),w?Oe:Pe,!R&&/* @__PURE__ */N("input",{...we.inputProps}),
9
9
  /* @__PURE__ */N(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
@@ -1,4 +1,4 @@
1
- import{UnitMenu as e}from"./chunk-Z334LCCX.js";import{InputNumber_default as a}from"./chunk-4GTXRVDF.js";import{IconButton_default as i}from"./chunk-SV5RRBVA.js";import{Icon as t}from"./chunk-T3NLFOLW.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var s="h-3.5 w-3.5",l={padding:{top:/* @__PURE__ */n(t,{name:"padding-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */n(t,{name:"padding-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */n(t,{name:"padding-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */n(t,{name:"padding-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */n(t,{name:"padding-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */n(t,{name:"padding-left-right","aria-hidden":"true",className:s})},crop:{top:/* @__PURE__ */n(t,{name:"crop-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */n(t,{name:"crop-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */n(t,{name:"crop-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */n(t,{name:"crop-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */n(t,{name:"crop-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */n(t,{name:"crop-left-right","aria-hidden":"true",className:s})}},m=/* @__PURE__ */n(t,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var c=(e,a,i)=>null===e[i]?a[i]:String(e[i]);function h(e,a){const i=i=>c(e,a,i);return i("left")!==i("right")||i("top")!==i("bottom")}function p({label:i,value:t,onChange:r,each:s,placeholder:m,words:h,min:p=0,max:u=200,step:g=4,readOnly:f,glyphs:b="padding",units:N}){const v=l[b],x=(i,o,d)=>{const s=function(e,a){const i=a.map(a=>e[a]);return i.every(e=>e===i[0])?i[0]:"mixed"}(t,i),l=i.map(e=>c(t,m,e)),b="mixed"!==s&&l.every(e=>e===l[0])?l[0]:"–";/* @__PURE__ */
1
+ import{UnitMenu as e}from"./chunk-ICZUWLVU.js";import{InputNumber_default as a}from"./chunk-LO6TYB5E.js";import{IconButton_default as i}from"./chunk-SV5RRBVA.js";import{Icon as t}from"./chunk-JOAKKXTL.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var s="h-3.5 w-3.5",l={padding:{top:/* @__PURE__ */n(t,{name:"padding-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */n(t,{name:"padding-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */n(t,{name:"padding-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */n(t,{name:"padding-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */n(t,{name:"padding-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */n(t,{name:"padding-left-right","aria-hidden":"true",className:s})},crop:{top:/* @__PURE__ */n(t,{name:"crop-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */n(t,{name:"crop-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */n(t,{name:"crop-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */n(t,{name:"crop-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */n(t,{name:"crop-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */n(t,{name:"crop-left-right","aria-hidden":"true",className:s})}},m=/* @__PURE__ */n(t,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var c=(e,a,i)=>null===e[i]?a[i]:String(e[i]);function h(e,a){const i=i=>c(e,a,i);return i("left")!==i("right")||i("top")!==i("bottom")}function p({label:i,value:t,onChange:r,each:s,placeholder:m,words:h,min:p=0,max:u=200,step:g=4,readOnly:f,glyphs:b="padding",units:N}){const v=l[b],x=(i,o,d)=>{const s=function(e,a){const i=a.map(a=>e[a]);return i.every(e=>e===i[0])?i[0]:"mixed"}(t,i),l=i.map(e=>c(t,m,e)),b="mixed"!==s&&l.every(e=>e===l[0])?l[0]:"–";/* @__PURE__ */
2
2
  return n("div",{"data-side":i.join("-"),className:"min-w-0",children:/* @__PURE__ */n(a,{value:"mixed"===s?null:s,onChange:e=>((e,a)=>{const i={...t};for(const t of e)i[t]=a;r(i)})(i,e),min:p,max:u,step:g,snap:!0,precision:0,steppers:"compact",readOnly:f,placeholder:b,prefix:d,suffix:h.unit,suffixControl:N&&/* @__PURE__ */n(e,{value:h.unit,options:N.options,onChange:N.onChange,label:N.label,disabled:f}),"aria-label":o})})};/* @__PURE__ */
3
3
  return n("div",{role:"group","aria-label":i,"data-sides":s?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */o(d,s?{children:[x(["left"],h.sides.left,v.left),x(["top"],h.sides.top,v.top),x(["right"],h.sides.right,v.right),x(["bottom"],h.sides.bottom,v.bottom)]}:{children:[x(["left","right"],h.horizontal,v.horizontal),x(["top","bottom"],h.vertical,v.vertical)]})})}function u({each:e,onChange:a,label:t,disabled:o}){/* @__PURE__ */
4
4
  return n(r,{content:t,children:/* @__PURE__ */n(i,{size:"md","aria-label":t,"aria-pressed":e,disabled:o,onClick:()=>a(!e),children:m})})}export{u as SidesEachToggle,p as SidesInput,h as sidesStartEach};
@@ -0,0 +1,5 @@
1
+ import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as l}from"./chunk-27ZJQUDS.js";import{dialogA11y as a}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-7QSDPSXP.js";import{useFocusTrap as s,useScrollLock as n}from"./chunk-CDAJKLGL.js";import{Icon as d}from"./chunk-JOAKKXTL.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useHydrated as m}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-TJSJVC6P.js";import{useRef as f,useId as h,useState as x,useEffect as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,Fragment as g,jsx as k}from"react/jsx-runtime";var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function N({open:N,onClose:w,title:J,description:C,role:D="dialog",children:T,footer:L,blocking:W=!1,size:S="md",aside:U=!1,dirty:V=!1,initialFocus:A,"aria-label":K,"aria-labelledby":P,"aria-describedby":Q,className:X=""}){const $=f(null),z=h(),F=h(),G=!W,I=h(),Z=p().dialog,B=e(m()),[H,O]=x(null),Y=l({open:N,dirty:V,onClose:w,title:J,layer:H}),q=f(null),E=r(N&&null!==B,q),M=i(E,$);if(o(N),s($,N&&null!==B,A),n(N),b(()=>{if(N)return u(()=>(W||Y(),!0),()=>$.current)},[N,W,Y]),!N||!B)return null;/* @__PURE__ */
2
+ return y(g,{children:[/* @__PURE__ */k("span",{ref:q,hidden:!0,"data-popup-anchor":""}),v(
3
+ /* @__PURE__ */k(t,{value:H,children:/* @__PURE__ */y("div",{ref:O,className:"fixed inset-0"+(U?" pointer-events-none opacity-0":""),style:{zIndex:c.overlay},role:"presentation","data-overlay-layer":"","data-aside":U?"":void 0,children:[
4
+ /* @__PURE__ */k("div",{className:"fixed inset-0 bg-black/30 backdrop-blur-sm","aria-hidden":"true"}),
5
+ /* @__PURE__ */k("div",{className:E?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:W?void 0:e=>{e.target===e.currentTarget&&Y()},children:/* @__PURE__ */y("div",{ref:$,"data-popup-panel":"",style:E?{left:M?.left??0,top:M?.top??0,visibility:M?void 0:"hidden"}:void 0,...a({role:D,modal:!0,titleId:J?I:void 0,labelledBy:P,label:K}),"aria-describedby":Q??(C?F:T?z:void 0),className:`${E?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${j[S]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${X}`.trim(),children:[J&&/* @__PURE__ */k("h2",{id:I,className:(G?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:J}),C&&/* @__PURE__ */k("p",{id:F,className:((J?"mt-1":G?"pr-8":"")+" text-sm text-gray-500").trim(),children:C}),T&&/* @__PURE__ */k("div",{id:z,className:"mt-2 text-sm text-gray-600",children:T}),L&&/* @__PURE__ */k("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:L}),G&&/* @__PURE__ */k("button",{type:"button",onClick:Y,"aria-label":Z.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */k(d,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),B)]})}export{N as Dialog};
@@ -1,2 +1,2 @@
1
- import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-JOD5ISTB.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-CRRC72EE.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:D="",autoFocus:H=!0}){const L=s(null),S=a(),[j,A]=d(null),C=s(w);C.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});A(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const U=s(null),T=s(!1);m(()=>(U.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||U.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!T.current&&H&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[j,H]),m(()=>{if(H)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[H]),m(()=>u(e=>"Escape"===e.key&&(C.current(),!0),()=>L.current),[]),m(()=>{const e=()=>C.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const W=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void C.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),B=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
- return p(n,{portal:!0,minWidth:x,style:B,onClose:w,className:D,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:S,role:"menu","aria-label":b,"aria-describedby":y?t(y,S):void 0,"data-context-menu":"",onKeyDown:W,children:[y&&e(y,{menuId:S,choose:e=>{e.disabled||(C.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>C.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
1
+ import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-W7DYKTHE.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-ZICGXJUB.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),j=a(),[A,S]=d(null),U=s(w);U.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),T=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{A&&!T.current&&D&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[A,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>L.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const W=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),B=A?{left:A.left,top:A.top,maxHeight:A.maxHeight,...A.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
+ return p(n,{portal:!0,minWidth:x,style:B,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:j,role:"menu","aria-label":b,"aria-describedby":y?t(y,j):void 0,"data-context-menu":"",onKeyDown:W,children:[y&&e(y,{menuId:j,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};