efficient-shell 8.35.0 → 8.38.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 (194) hide show
  1. package/README.md +11 -0
  2. package/dist/{Browser-ERZNOFN7.js → Browser-5TOAZTHJ.js} +14 -14
  3. package/dist/Calculator-I4P2BWR7.js +29 -0
  4. package/dist/CurrencyConverter-K2IIOVHM.js +21 -0
  5. package/dist/{Documents-POWS4L44.js → Documents-IYGZXCU2.js} +14 -14
  6. package/dist/Files-EMPEGBMQ.js +87 -0
  7. package/dist/Notepad-VYJZ2XA4.js +25 -0
  8. package/dist/PdfViewer-KJCJ6EPG.js +1 -0
  9. package/dist/{PomodoroTimer-GLYNCO4H.js → PomodoroTimer-BEVXP5KG.js} +28 -28
  10. package/dist/{Preview-WZDFVBNJ.js → Preview-AVQQI32Z.js} +36 -36
  11. package/dist/Sidebar-6I4FC5AK.js +43 -0
  12. package/dist/Spreadsheet-EM6OOJ6I.js +37 -0
  13. package/dist/Stock-YJNQMFSV.js +16 -0
  14. package/dist/{Weather-UKLNJ3VF.js → Weather-XDT4ZEHN.js} +19 -19
  15. package/dist/{WorldClock-OZ3I7D2M.js → WorldClock-7PTVRQ2A.js} +6 -6
  16. package/dist/ai/index.d.ts +118 -3
  17. package/dist/ai/index.js +53 -43
  18. package/dist/ai.css +1 -1
  19. package/dist/apps/index.js +1 -1
  20. package/dist/bin/media-host-check.js +1 -1
  21. package/dist/bin/ui-check.js +1 -1
  22. package/dist/{chunk-ZRHQGFO5.js → chunk-3CST4ZDP.js} +2 -2
  23. package/dist/chunk-454DAGYG.js +19 -0
  24. package/dist/{chunk-TRD22FC7.js → chunk-45S6M77O.js} +6 -6
  25. package/dist/chunk-4AJRHTTB.js +1 -0
  26. package/dist/chunk-4IVT244O.js +8 -0
  27. package/dist/{chunk-G2MJTE6X.js → chunk-4OFD6ICH.js} +10 -10
  28. package/dist/{chunk-5N5DBTTF.js → chunk-4SZDP3JF.js} +12 -12
  29. package/dist/{chunk-FMKTVZAO.js → chunk-4Y4PWKMM.js} +1 -1
  30. package/dist/{chunk-DIN3EFOM.js → chunk-5BZMSSOV.js} +8 -8
  31. package/dist/{chunk-64ZHCEZN.js → chunk-5TFTSYOD.js} +1 -1
  32. package/dist/{chunk-GK3QH63P.js → chunk-63EK6S3W.js} +1 -1
  33. package/dist/{chunk-ECCUEG3J.js → chunk-6BCFVOG7.js} +1 -1
  34. package/dist/{chunk-M2KV4WKR.js → chunk-6GWZ5UPX.js} +1 -1
  35. package/dist/{chunk-EBC4XFL2.js → chunk-6SMQNPWS.js} +1 -1
  36. package/dist/{chunk-EW6FRPFJ.js → chunk-6WWAQC5V.js} +1 -1
  37. package/dist/{chunk-TTY62G5D.js → chunk-7C56GLLI.js} +16 -16
  38. package/dist/{chunk-MICWRC72.js → chunk-7MSFHQAY.js} +7 -7
  39. package/dist/{chunk-XZL3HCWH.js → chunk-7OCNF4AI.js} +1 -1
  40. package/dist/chunk-AAW27HJY.js +3 -0
  41. package/dist/{chunk-WME5DFB6.js → chunk-BIJ7ADTZ.js} +1 -1
  42. package/dist/{chunk-SEXLHFMR.js → chunk-BMPBVI7P.js} +1 -1
  43. package/dist/{chunk-TOVHLONK.js → chunk-BT3XDH3L.js} +4 -4
  44. package/dist/{chunk-JVIOAZHW.js → chunk-BUGAWNOC.js} +4 -4
  45. package/dist/{chunk-R4C3GGCS.js → chunk-BVW5U7QQ.js} +3 -3
  46. package/dist/{chunk-AF7R2MV4.js → chunk-CKZ6ZDU5.js} +1 -1
  47. package/dist/{chunk-IHEEJO5S.js → chunk-CPK7JTN3.js} +1 -1
  48. package/dist/{chunk-EVB35JP5.js → chunk-DOCUM3K7.js} +1 -1
  49. package/dist/{chunk-FKZEGBLK.js → chunk-DXTKNHWG.js} +11 -11
  50. package/dist/{chunk-2U2GJCSP.js → chunk-EL2RLUT6.js} +7 -7
  51. package/dist/{chunk-4GVH4ZUH.js → chunk-ET2EF5CI.js} +1 -1
  52. package/dist/{chunk-MC43PRTL.js → chunk-EXWGPXOS.js} +1 -1
  53. package/dist/{chunk-2SHYR3RA.js → chunk-FSPFV4MI.js} +9 -4
  54. package/dist/{chunk-YBB56N6X.js → chunk-G63BCOQ6.js} +1 -1
  55. package/dist/{chunk-DG2WU3BU.js → chunk-GSBIJLTD.js} +2 -2
  56. package/dist/{chunk-ZXSMSVLU.js → chunk-I7HDD4IM.js} +1 -1
  57. package/dist/chunk-J47HXHSL.js +8 -0
  58. package/dist/{chunk-2WL3Q7VW.js → chunk-J7FZAOKT.js} +16 -16
  59. package/dist/{chunk-RB2F65YJ.js → chunk-JPRJQ6B7.js} +11 -11
  60. package/dist/{chunk-S4IW5OL3.js → chunk-K52WWA5G.js} +1 -1
  61. package/dist/{chunk-M2LLVSBR.js → chunk-KWX6NAOR.js} +1 -1
  62. package/dist/{chunk-OFKWTOXK.js → chunk-L7FDYGGF.js} +3 -3
  63. package/dist/{chunk-6ANFVX4M.js → chunk-L7IKTEOC.js} +11 -11
  64. package/dist/{chunk-EZY4CO4A.js → chunk-LGAN7DNC.js} +5 -5
  65. package/dist/{chunk-PCKYNZ5Y.js → chunk-LGLZTJ2W.js} +6 -6
  66. package/dist/{chunk-WKRFD4E4.js → chunk-LSISFKKS.js} +8 -8
  67. package/dist/{chunk-7ACSSYEZ.js → chunk-MEJK6PBN.js} +1 -1
  68. package/dist/{chunk-4RNF6MNW.js → chunk-MGXE75N5.js} +2 -2
  69. package/dist/{chunk-IUCIYWTT.js → chunk-NDO24PK6.js} +8 -8
  70. package/dist/{chunk-XDDTFV32.js → chunk-NESJOC3R.js} +1 -1
  71. package/dist/{chunk-BYCOB6WT.js → chunk-NGBT7AHL.js} +6 -6
  72. package/dist/chunk-NLWS7HMX.js +29 -0
  73. package/dist/chunk-O4Q475GF.js +1 -0
  74. package/dist/chunk-PCQPV6MS.js +6 -0
  75. package/dist/{chunk-CCPNMYCK.js → chunk-Q23EHOXW.js} +1 -1
  76. package/dist/{chunk-ACW3J77L.js → chunk-Q7HN6T3H.js} +1 -1
  77. package/dist/{chunk-NUSSZJF2.js → chunk-REVC6YPT.js} +5 -5
  78. package/dist/{chunk-2AHHM4SK.js → chunk-RJ4KZGAT.js} +56 -56
  79. package/dist/{chunk-EM6BEHAD.js → chunk-RWGSMZGS.js} +1 -1
  80. package/dist/{chunk-4MO375G3.js → chunk-S2OIRC5H.js} +3 -3
  81. package/dist/chunk-SG3ILR7W.js +4 -0
  82. package/dist/{chunk-FTKKGGOQ.js → chunk-SR4XAYLC.js} +1 -1
  83. package/dist/{chunk-RPJ2GC3K.js → chunk-SRKSGUGT.js} +20 -20
  84. package/dist/{chunk-2F7ZOMKK.js → chunk-SZIENHKR.js} +1 -1
  85. package/dist/{chunk-UZ3CZQA4.js → chunk-TGLHJS3M.js} +1 -1
  86. package/dist/{chunk-O2YAB6WK.js → chunk-TIQKDAON.js} +6 -6
  87. package/dist/{chunk-TANR67XF.js → chunk-TVJRENCQ.js} +9 -9
  88. package/dist/{chunk-SWHRP52Y.js → chunk-TZMJEOZA.js} +1 -1
  89. package/dist/{chunk-MY755PTJ.js → chunk-UZMZ2EDW.js} +1 -1
  90. package/dist/{chunk-S4J4B7LY.js → chunk-WCKZHEFC.js} +5 -5
  91. package/dist/{chunk-5OX6KXWY.js → chunk-WIW2547G.js} +1 -1
  92. package/dist/{chunk-AZU7YOES.js → chunk-WRORJNS5.js} +8 -8
  93. package/dist/{chunk-XB2YPUKR.js → chunk-XLD53X4P.js} +8 -8
  94. package/dist/{chunk-4HCRZHIX.js → chunk-XSPDPN5O.js} +1 -1
  95. package/dist/{chunk-TZHWF3P5.js → chunk-Y6IQYQYN.js} +2 -2
  96. package/dist/chunk-YALPQIBR.js +7 -0
  97. package/dist/{chunk-HAIMJAI4.js → chunk-ZCHBOAPA.js} +2 -2
  98. package/dist/{chunk-M2AIC7IK.js → chunk-ZEKM6HAA.js} +2 -2
  99. package/dist/{chunk-5YELPBUT.js → chunk-ZK2SULCA.js} +1 -1
  100. package/dist/{chunk-BHMUOWAE.js → chunk-ZSFUNXRD.js} +4 -4
  101. package/dist/{chunk-JDKRQG7X.js → chunk-ZWAVSUWT.js} +2 -2
  102. package/dist/data/ListLoadError.js +1 -1
  103. package/dist/format/index.js +1 -1
  104. package/dist/forms/BorderInput.js +1 -1
  105. package/dist/forms/BrandAssetEditor.js +1 -1
  106. package/dist/forms/Calendar.js +1 -1
  107. package/dist/forms/ColorPicker.js +1 -1
  108. package/dist/forms/ComposerAttachments.js +1 -1
  109. package/dist/forms/CornersInput.js +1 -1
  110. package/dist/forms/DatePicker.js +1 -1
  111. package/dist/forms/DateRangePicker.js +1 -1
  112. package/dist/forms/DisplayChips.js +1 -1
  113. package/dist/forms/FilePicker.js +1 -1
  114. package/dist/forms/IconPicker.js +1 -1
  115. package/dist/forms/InputNumber.js +1 -1
  116. package/dist/forms/LinkPicker.js +1 -1
  117. package/dist/forms/MediaLibrary.js +1 -1
  118. package/dist/forms/MediaUploadField.js +1 -1
  119. package/dist/forms/MediaUploadGrid.js +1 -1
  120. package/dist/forms/MediaUsedInList.js +1 -1
  121. package/dist/forms/PositionInput.js +1 -1
  122. package/dist/forms/Select.js +1 -1
  123. package/dist/forms/SidesInput.js +1 -1
  124. package/dist/forms/Slider.js +1 -1
  125. package/dist/forms/Snippet.js +1 -1
  126. package/dist/forms/SplitButton.js +1 -1
  127. package/dist/forms/TagInput.js +1 -1
  128. package/dist/forms/TextToolbar.js +1 -1
  129. package/dist/forms/WidthsBar.js +1 -1
  130. package/dist/forms/mediaLibraryMenu.js +1 -1
  131. package/dist/forms/textAlign.js +1 -1
  132. package/dist/icons/index.js +1 -1
  133. package/dist/index.js +169 -169
  134. package/dist/map/index.js +3 -3
  135. package/dist/markdown/index.js +1 -1
  136. package/dist/page-tabs/index.js +5 -5
  137. package/dist/pdf/index.js +1 -1
  138. package/dist/shell/Accordion.js +1 -1
  139. package/dist/shell/AppUpdateBanner.js +1 -1
  140. package/dist/shell/Banner.js +1 -1
  141. package/dist/shell/Breadcrumbs.js +1 -1
  142. package/dist/shell/ColoredBadge.js +1 -1
  143. package/dist/shell/ConfirmDialog.js +1 -1
  144. package/dist/shell/ContextMenu.js +1 -1
  145. package/dist/shell/Dialog.d.ts +2 -2
  146. package/dist/shell/Dialog.js +1 -1
  147. package/dist/shell/Drawer.d.ts +2 -2
  148. package/dist/shell/Drawer.js +1 -1
  149. package/dist/shell/DropdownMenu.js +1 -1
  150. package/dist/shell/EmptyState.js +1 -1
  151. package/dist/shell/HelpCenter.js +1 -1
  152. package/dist/shell/ImageLightbox.js +1 -1
  153. package/dist/shell/LanguageSelect.js +1 -1
  154. package/dist/shell/Markdown.js +1 -1
  155. package/dist/shell/PageHeader.js +1 -1
  156. package/dist/shell/PopupMenu.js +1 -1
  157. package/dist/shell/ProductionTimeline.js +1 -1
  158. package/dist/shell/Result.js +1 -1
  159. package/dist/shell/SearchableSelect.js +1 -1
  160. package/dist/shell/SettingReset.js +1 -1
  161. package/dist/shell/SettingRow.js +1 -1
  162. package/dist/shell/SidebarLayout.js +1 -1
  163. package/dist/shell/SidebarNav.js +1 -1
  164. package/dist/shell/SortableList.js +1 -1
  165. package/dist/shell/StepChain.js +1 -1
  166. package/dist/shell/Stepper.js +1 -1
  167. package/dist/shell/TopNav.js +1 -1
  168. package/dist/shell/Tree.js +1 -1
  169. package/dist/telemetry/index.js +1 -1
  170. package/dist/templates/ChatTemplate.js +1 -1
  171. package/dist/templates/CheckoutTemplate.js +1 -1
  172. package/dist/templates/DataTablePage.js +1 -1
  173. package/dist/templates/EmailTemplate.js +1 -1
  174. package/dist/templates/FormLayoutPage.js +1 -1
  175. package/dist/ui/index.js +1 -1
  176. package/dist/version.js +1 -1
  177. package/package.json +1 -1
  178. package/dist/Calculator-NXIOZMML.js +0 -29
  179. package/dist/CurrencyConverter-57WUTV4H.js +0 -21
  180. package/dist/Files-O44UH6ZF.js +0 -87
  181. package/dist/Notepad-66ZCGUHC.js +0 -25
  182. package/dist/PdfViewer-KSLOYXMD.js +0 -1
  183. package/dist/Sidebar-QQFJJWE2.js +0 -43
  184. package/dist/Spreadsheet-OYAVNRCT.js +0 -37
  185. package/dist/Stock-CIHUZOQS.js +0 -16
  186. package/dist/chunk-2PWZNFFP.js +0 -19
  187. package/dist/chunk-5FCEBKT2.js +0 -7
  188. package/dist/chunk-BZMZTPS6.js +0 -1
  189. package/dist/chunk-CAMLFCGY.js +0 -29
  190. package/dist/chunk-HMHL27AU.js +0 -6
  191. package/dist/chunk-JBQWR4SX.js +0 -8
  192. package/dist/chunk-NKZNPYDB.js +0 -3
  193. package/dist/chunk-QPWD5CCS.js +0 -8
  194. package/dist/chunk-TW6WYYBC.js +0 -3
@@ -1,19 +0,0 @@
1
- import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-XZL3HCWH.js";import{useSettingAuto as d}from"./chunk-L65BESIE.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-PF3ANJFI.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-2SHYR3RA.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-E6UCGCOC.js";import{forwardRef as w,useId as k,useState as N,useRef as $,useMemo as D,useCallback as S,useEffect as j,useLayoutEffect as C}from"react";import{createPortal as E}from"react-dom";import{jsxs as H,jsx as I,Fragment as T}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=w(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},w){const N=t,$=x(),D=d(),S=f??D,j=k(),C=/* @__PURE__ */H("select",{ref:w,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,S?j:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:S,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:i}),
2
- /* @__PURE__ */I(z,{items:r})]});return S?/* @__PURE__ */H(T,{children:[C,
3
- /* @__PURE__ */I("span",{id:j,hidden:!0,children:$.settingView.auto})]}):C});function z({items:e}){const t=e=>/* @__PURE__ */I("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
- return I(T,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */I("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var A=w(function({value:l,onChange:u,options:w,placeholder:R,invalid:A,className:B="",id:U,disabled:F,size:K,touchSize:L,title:P,multiple:V,renderOption:W,renderValue:M,valueText:G,readOnly:J=!1,footer:q,changed:Q=!1,auto:X,"aria-describedby":Y,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=N(!1),[ne,ae]=N(-1),le=$(null),oe=$(null),de=$(null),se=$(null),ce=$([]),ue=()=>se.current??de.current,pe=!!q?.length,me="sm"===K,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=N(null),ge=x(),ye=$(re);ye.current=re;const xe=$({buffer:"",timer:null}),we=k(),ke=`${we}-listbox`,Ne=U??`${we}-trigger`,$e=e=>`${we}-opt-${e}`,De=`${we}-changed`,Se=d(),je=X??Se,Ce=`${we}-auto`,Ee=[Y,Q?De:void 0,je?Ce:void 0].filter(Boolean).join(" ")||void 0,He=D(()=>n(w),[w]),Ie=V?l:[],Te=u,Oe=f(oe,re,{matchTriggerWidth:!0,...q?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Re="undefined"==typeof window?j:C,ze=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${w.length}`;Re(()=>{be(null)},[ze]),Re(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Ae=V?He.findIndex(e=>Ie.includes(e.value)):He.findIndex(e=>e.value===l),Be=V?He.filter(e=>Ie.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?He[Ae].label:void 0,Ue=!V&&Ae>=0?He[Ae].lang:void 0,Fe=V?He.filter(e=>Ie.includes(e.value)):Ae>=0?[He[Ae]]:[],Ke=M&&Fe.length?M(Fe):void 0,Le=void 0!==Ke&&G?G(Fe):void 0,Pe=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Ve=S(()=>{F||J||(ae(Ae>=0?Ae:e(He)),ie(!0))},[F,J,He,Ae]),We=S(e=>{const t=He[e];if(t&&!t.disabled){if(V){const r=l;return Te(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Te(t.value),Pe()}},[He,V,l,Te,Pe]);j(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Pe(),!0),ue)},[re,Pe]),j(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Pe(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Pe(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Pe]),j(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Me=S(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Ae,n=t(He,r.buffer,i);n<0||(re?ae(n):V?(ae(n),ie(!0)):We(n))},[re,ne,Ae,He,We,V]),Ge=re?a(w,(e,t)=>{const r=(i=e.value,V?Ie.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
5
- return H("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>We(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${V?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[V&&/* @__PURE__ */I(o,{selected:r}),W?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:n})}):V?/* @__PURE__ */H("span",{className:"block min-w-0 flex-1",children:[
6
- /* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */I("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
- /* @__PURE__ */H(T,{children:[
8
- /* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */I("span",{className:he,children:e.description})]}):e.label]},e.value)},we,"mx-1"):null,Je=void 0!==Ke?
9
- /* @__PURE__ */H("span",{className:"relative block min-w-0 truncate",children:[
10
- /* @__PURE__ */I("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ke}),
11
- /* @__PURE__ */I("span",{lang:void 0===Le?Ue:void 0,className:"sr-only",children:Le??Be})]}):/* @__PURE__ */I("span",{lang:Ue,className:`block truncate ${void 0===Be?c:""}`,children:Be??R??" "}),qe={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...g()},Qe=/* @__PURE__ */I("div",{ref:de,id:ke,role:"listbox","aria-labelledby":_??(Z?void 0:Ne),"aria-label":_?void 0:Z,"aria-multiselectable":V||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...qe,maxHeight:fe}:qe,children:Ge}),Xe=pe?/* @__PURE__ */H("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:qe,children:[Qe,
12
- /* @__PURE__ */I("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:q.map((e,t)=>/* @__PURE__ */H("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Pe(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(q?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Pe());case"Escape":return e.preventDefault(),e.stopPropagation(),void Pe()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */I(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
- /* @__PURE__ */I("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Qe;/* @__PURE__ */
14
- return H("div",{ref:le,className:"relative",children:[
15
- /* @__PURE__ */I("button",{ref:oe,id:Ne,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?ke:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Ee,"aria-label":Z,"aria-labelledby":_,title:P,disabled:F,"aria-readonly":J||void 0,onClick:()=>re?Pe():Ve(),onKeyDown:t=>{if(!F&&!J)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(He,e,1)):Ve());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(He,e,-1)):Ve());case"Home":return void(re&&(t.preventDefault(),ae(e(He))));case"End":return void(re&&(t.preventDefault(),ae(r(He))));case"Enter":return void(re&&(t.preventDefault(),We(ne)));case" ":return t.preventDefault(),void(re?We(ne):Ve());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Pe()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Pe(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Me(t.key))}},className:s({invalid:A,size:K,readOnly:J,auto:je,className:`${J?"":"pr-8 "}text-left ${B}`.trim()}),children:Q?
16
- /* @__PURE__ */H("span",{className:"flex min-w-0 items-center gap-1",children:[Je,
17
- /* @__PURE__ */I("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Je}),Q&&/* @__PURE__ */I("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */I("span",{id:Ce,hidden:!0,children:ge.settingView.auto}),!J&&/* @__PURE__ */I(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
- /* @__PURE__ */H("select",{ref:te,value:l,multiple:V||void 0,onChange:e=>Te(V?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:F,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==R&&!V&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:R}),
19
- /* @__PURE__ */I(z,{items:w})]}),re&&E(Xe,document.body)]})}),B=w(function({touchSize:e="touch",...t},r){const i=u();return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */I(R,{ref:r,...t,size:e}):/* @__PURE__ */I(A,{ref:r,...t}):/* @__PURE__ */I(A,{ref:r,...t,size:e})});export{R as NativeSelect,B as Select_default};
@@ -1,7 +0,0 @@
1
- import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-TZHWF3P5.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-FKZEGBLK.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:L,align:K="end",side:j="bottom","aria-label":E,className:W="",triggerClassName:A,menuClassName:C="",minWidth:S=180,linkAs:H,disabled:$,id:N,"aria-describedby":T,"aria-disabled":U=!1,onOpenChange:B,footer:G,footerLabel:I}){const[J,q]=m(!1),[M,P]=m(-1),z=h(null),F=h(null),R=h(null),Z=h(null),O=h(null),Q=null!=G&&!1!==G,V=h({text:"",at:0}),Y=g(),X=g(),_=N??X,ee=h(B);ee.current=B;const te=h(J);te.current=J;const re=v(e=>{q(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&F.current?.focus()},[]),ne=(t,r)=>{const n=L.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(L[i]))return i}return-1},oe=()=>R.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!J)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[J,re]);const ie=v(()=>{const e=oe(),t=F.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:K,side:j});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=K},[K,j]);p(()=>{J&&ie()}),b(()=>{if(J)return u(()=>F.current,ie)},[J,ie]),b(()=>{if(!J)return;const t=R.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[J,M]),b(()=>{if(J)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>Z.current)},[J,re]),n(Z,J&&Q);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{P(le(e)),q(!0),te.current||(te.current=!0,ae.current=e,B?.(!0))};p(()=>{const e=ae.current;if(!J||!e)return;ae.current=null;const t=le(e);t!==M&&P(t)});const de=t(L,Y),ce="function"==typeof G?G({close:()=>re(!0)}):G,ue={...k.test(C)?{}:{zIndex:s.popup},minWidth:S};/* @__PURE__ */
2
- return y("div",{ref:z,className:`relative inline-flex ${W}`.trim(),children:[
3
- /* @__PURE__ */x("button",{ref:F,id:_,type:"button","aria-haspopup":"menu","aria-expanded":J,"aria-controls":J?Y:void 0,"aria-label":E,"aria-describedby":T,"aria-disabled":U||void 0,disabled:$,onClick:()=>{U||(J?re(!1):se("first"))},onKeyDown:e=>{U||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:A??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(E?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),J&&
4
- /* @__PURE__ */x(i,{portal:!0,className:C,style:ue,children:/* @__PURE__ */y("div",{ref:Z,children:[
5
- /* @__PURE__ */x("div",{ref:R,id:Y,role:"menu","aria-orientation":"vertical","aria-label":E,"aria-labelledby":E?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),P(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),P(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),P(ne(0,1));else if("End"===t.key)t.preventDefault(),P(ne(L.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&O.current?o(O.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-V.current.at<500?V.current.text+n:n;V.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=R.current,d=L.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(L[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void P(n)}})(t)},children:r(L,{menuId:Y,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||O.current?.contains(document.activeElement)||P(e)}}),linkAs:H})}),Q&&/* @__PURE__ */y("div",{ref:O,role:"group","aria-label":I,"data-dropdown-footer":"",onKeyDown:e=>{const t=O.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=R.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??R.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
6
- /* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
7
- /* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
@@ -1 +0,0 @@
1
- var r="8.35.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,29 +0,0 @@
1
- import{Tree as e,TreeRow as l,TreeGroup as n}from"./chunk-2U2GJCSP.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as r}from"./chunk-M2KV4WKR.js";import{ImageLightbox as i}from"./chunk-O2YAB6WK.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-QPWD5CCS.js";import{Breadcrumbs as d}from"./chunk-EBC4XFL2.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-2F7ZOMKK.js";import{useMediaMoveItems as m}from"./chunk-DFDDRKIJ.js";import{copyToClipboard as u}from"./chunk-5PY4H4ZJ.js";import{DropdownMenu as h}from"./chunk-5FCEBKT2.js";import{MediaUploadGrid as p}from"./chunk-WKRFD4E4.js";import{MediaUsedInList as f}from"./chunk-GK3QH63P.js";import{NativeSelect as g}from"./chunk-2PWZNFFP.js";import{Segmented as v}from"./chunk-N6DTTOB6.js";import{useFileIntake as y,FileIntakeAlert as k}from"./chunk-YDYDR72S.js";import{useGridSelection as b}from"./chunk-VLKDWKVR.js";import{useMarquee as w}from"./chunk-OLFYNMTD.js";import{Checkbox_default as x}from"./chunk-CGZBDI6C.js";import{useContextMenu as C,ContextMenu as N}from"./chunk-JDKRQG7X.js";import{Banner as I}from"./chunk-MY755PTJ.js";import{Input_default as D}from"./chunk-GX2GSDJP.js";import{IconButton_default as S}from"./chunk-4CANQ3B3.js";import{ColoredBadge as j}from"./chunk-4GVH4ZUH.js";import{Button_default as z}from"./chunk-4IU5BSVE.js";import{buttonClasses as F}from"./chunk-K7U4RWXJ.js";import{Icon as T}from"./chunk-2SHYR3RA.js";import{Tooltip as P}from"./chunk-22S6LG6D.js";import{usePlotWidth as O}from"./chunk-MAFUXCPZ.js";import{useShellStrings as E}from"./chunk-E6UCGCOC.js";import{useRef as K,useMemo as L,useCallback as A,useState as M,useEffect as R}from"react";import{jsxs as U,Fragment as B,jsx as G}from"react/jsx-runtime";var W="application/x-efficient-media-files",H="application/x-efficient-media-folder",J={type:"all",use:"any",sort:"newest"},V={lock:/* @__PURE__ */G(T,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */G(T,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */G(T,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */G(T,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */G(T,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */G(T,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */G(T,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */G(T,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */G(T,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */G(T,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */G(T,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */G(T,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */G(T,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */G(T,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */G(T,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */G(T,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},Y={link:/* @__PURE__ */G(T,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */G(T,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */G(T,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */G(T,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function $({value:e,label:l,onDone:n}){const[a,r]=M(e),i=K(!1),t=e=>{i.current||(i.current=!0,n(e))};/* @__PURE__ */
2
- return G(D,{size:"sm",autoFocus:!0,"aria-label":l,value:a,onChange:e=>r(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:l=>{l.stopPropagation(),"Enter"===l.key?(l.preventDefault(),t(a.trim()||e)):"Escape"===l.key&&(l.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function Z(T){const{mode:Z="manage",layout:Q="auto",location:X,onLocationChange:q,folders:_,products:ee,allFilesCount:le,trashCount:ne,files:ae,query:re,onQueryChange:ie,filters:te=J,onFiltersChange:oe,extraFilters:de,view:se="grid",onViewChange:ce,selectedIds:me,onSelectionChange:ue,usedIn:he,denied:pe={},accept:fe="image/*,video/*",maxSizeBytes:ge,busy:ve,progress:ye,onUpload:ke,onNewFolder:be,onRename:we,onMove:xe,onTrash:Ce,onDeleteFolder:Ne,onRestore:Ie,onDeleteForever:De,onEmptyTrash:Se,onReplace:je,onCropEdit:ze,onOpenInDesign:Fe,onChoose:Te,onCancel:Pe,pickNote:Oe,className:Ee=""}=T,Ke=E().mediaLibrary,Le=E().media,Ae="pick"===Z,Me=!Ae,Re=K(null),Ue=O(Re,"phone"===Q?343:1200),Be="phone"===Q||"auto"===Q&&Ue<640,Ge=L(()=>function(e=[]){const l=/* @__PURE__ */new Map,n=(e,a)=>{for(const r of e){const e=[...a,r];l.set(r.id,{node:r,path:e}),r.children&&n(r.children,e)}};return n(e,[]),l}(ee),[ee]),We=L(()=>new Map(_.map(e=>[e.id,e])),[_]),He=L(()=>{const e=/* @__PURE__ */new Map;for(const l of _){const n=l.parentId&&We.has(l.parentId)?l.parentId:null;e.set(n,[...e.get(n)??[],l])}return e},[_,We]),Je=A(e=>{const l=[];for(let n=e?We.get(e):void 0;n&&(l.unshift(n),!(l.length>_.length));n=n.parentId?We.get(n.parentId):void 0);return l},[We,_.length]),Ve=A((e,l)=>Je(e).some(e=>e.id===l),[Je]),[Ye,$e]=M(()=>/* @__PURE__ */new Set(["@files"])),Ze=e=>$e(l=>{const n=new Set(l);return n.has(e)?n.delete(e):n.add(e),n}),Qe=A(e=>{$e(l=>e.every(e=>l.has(e))?l:/* @__PURE__ */new Set([...l,...e]))},[]),Xe="files"===(qe=X).place?`files:${qe.folderId??""}`:"products"===qe.place?`products:${qe.nodeId??""}`:"trash";var qe;R(()=>{if("files"===X.place)Qe(["@files",...Je(X.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===X.place){const e=X.nodeId?Ge.get(X.nodeId)?.path??[]:[];Qe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[Xe]);const _e="products"===X.place,el="trash"===X.place,ll="files"===X.place,nl=ll?X.folderId:null,al=_e&&X.nodeId?Ge.get(X.nodeId)?.path[0]:void 0,rl=e=>e?.sharedFrom?`${Ke.readOnly} ${Ke.editedAtHq(e.sharedFrom)}`:Ke.readOnly,il=L(()=>ae.map(e=>e.id),[ae]),tl=L(()=>new Map(ae.map(e=>[e.id,e])),[ae]),ol=b(il),dl=L(()=>il.filter(e=>ol.selected.has(e)),[il,ol.selected]),sl=1===dl.length?tl.get(dl[0]):void 0,cl=K(!0);R(()=>{cl.current?cl.current=!1:ol.clear()},[Xe]);const ml=me?.join("\0");R(()=>{me&&ol.setSelection(me)},[ml]);const ul=K(ml??""),hl=dl.join("\0");R(()=>{ul.current!==hl&&(ul.current=hl,ue?.(dl))},[hl]);const pl=(e,l={})=>{Ae?ol.select(e):ol.select(e,{ctrl:!(!l.ctrlKey&&!l.metaKey),shift:!!l.shiftKey})},[fl,gl]=M(null),vl=e=>{const l=fl;if(gl(null),!l||null==e)return;e!==("folder"===l.kind?We.get(l.id)?.name:tl.get(l.id)?.name)&&we?.(l,e)},yl=async e=>{if(!be)return;const l=await be(e);Qe(["@files",...e?[e]:[]]),"string"==typeof l&&gl({kind:"folder",id:l})},kl=A(e=>{const l=[],n=l=>{if("files"===e.kind)return l===nl&&ll?Ke.alreadyHere:void 0;const n=We.get(e.id);return l===e.id||l&&Ve(l,e.id)?Ke.notIntoItself:(n?.parentId??null)===l?Ke.folderAlreadyHere:void 0};l.push({key:s,label:Ke.allFiles,disabledReason:n(null)});const a=(e,r)=>{for(const i of He.get(e)??[])l.push({key:i.id,label:i.name,depth:r,disabledReason:n(i.id)}),a(i.id,r+1)};return a(null,1),l},[He,We,ll,Ve,nl,Ke]),bl=A(e=>{const l=new Set(e.map(e=>tl.get(e)?.kind??"image"));return 1===l.size?[...l][0]:"file"},[tl]),[wl,xl]=M(null),Cl={words:Ke,media:Le,denied:pe,moveTargets:kl,kindOf:bl,urlOf:e=>tl.get(e)?.url,newSubfolder:be&&Me?e=>{yl(e)}:void 0,rename:we&&Me?e=>{"file"!==e.kind||ol.isSelected(e.id)||ol.select(e.id),gl(e)}:void 0,move:xe&&Me?xe:void 0,trash:Ce&&Me?Ce:void 0,deleteFolder:Ne&&Me?Ne:void 0,folderNotEmpty:e=>!!We.get(e)?.notEmpty,replace:je&&Me?je:void 0,copyUrl:e=>{const l=tl.get(e)?.url;l&&u(Ke.urlLabel,l)},openInDesign:Fe,restore:Ie,deleteForever:De},Nl=e=>c(e,Cl),Il=C(),Dl=(e,l)=>{Ae||(ol.isSelected(e)||ol.select(e),Il.open(l,(e=>{const l=ol.isSelected(e)?dl:[e];return _e?{kind:"render",id:e}:el?{kind:"trashed",ids:l}:{kind:"files",ids:l}})(e)))},[Sl,jl]=M(null),[zl,Fl]=M(null),[Tl,Pl]=M(null);R(()=>{if(!zl&&!Sl)return;const e=()=>{Fl(null),jl(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[zl,Sl]);const Ol=(e,l)=>Array.from(e.dataTransfer?.types??[]).includes(l),El=(e,l)=>!(!xe||pe.move||Ae)&&(!!Ol(e,W)||!(!Ol(e,H)||!Tl)&&(l!==Tl&&!(l&&Ve(l,Tl)))),Kl=(e,l)=>({onDragEnter:n=>{El(n,l)&&(n.preventDefault(),jl(e))},onDragOver:n=>{El(n,l)&&(n.preventDefault(),n.dataTransfer.dropEffect="move",Sl!==e&&jl(e))},onDragLeave:l=>{const n=l.relatedTarget;n&&l.currentTarget.contains(n)||jl(l=>l===e?null:l)},onDrop:e=>{if(El(e,l))if(e.preventDefault(),jl(null),Ol(e,W)){let n;try{n=JSON.parse(e.dataTransfer.getData(W))}catch{n=null}Array.isArray(n)&&n.length&&xe({kind:"files",ids:n.map(String)},l)}else Tl&&(xe({kind:"folder",id:Tl},l),Pl(null))}}),Ll=e=>{const l=e=>Ol(e,W)||Ol(e,H)||Ol(e,"Files");return{onDragEnter:n=>{l(n)&&Fl(e)},onDragOver:n=>{l(n)&&zl!==e&&Fl(e)},onDragLeave:l=>{const n=l.relatedTarget;n&&l.currentTarget.contains(n)||Fl(l=>l===e?null:l)}}},Al=(e,l,n)=>/* @__PURE__ */G(P,{side:"right",content:zl===e?Ke.noDropProducts:rl(n),open:zl===e||!zl&&void 0,children:/* @__PURE__ */G("span",{children:l})}),Ml=e=>({onContextMenu:l=>{Il.open(l,e)}}),Rl=(e,a,r)=>e.map(e=>{const i=`p:${e.id}`,t=r??e,o=Ye.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
3
- return U("div",{role:"none",className:"contents",children:[
4
- /* @__PURE__ */G(l,{label:Al(i,e.name,t),level:a,icon:d&&o?V.folderOpen:V.folder,badge:null!=e.count?e.count:void 0,selected:_e&&X.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>Ze(i):void 0,onSelect:()=>q({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Ll(i),...Me?Ml({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */G(n,{children:Rl(d,a+1,t)})]},e.id)}),Ul=(e,a)=>(He.get(e)??[]).map(e=>{const r=He.get(e.id),i=Ye.has(e.id),t="folder"===fl?.kind&&fl.id===e.id,o=Nl({kind:"folder",id:e.id});/* @__PURE__ */
5
- return U("div",{role:"none",className:"contents",children:[
6
- /* @__PURE__ */G(l,{label:e.name,level:a,icon:r&&i?V.folderOpen:V.folder,badge:null!=e.count?e.count:void 0,selected:t||ll&&X.folderId===e.id,expanded:r?i:void 0,onToggle:r?()=>Ze(e.id):void 0,onSelect:()=>q({place:"files",folderId:e.id}),drop:Sl===e.id?"into":void 0,dragging:Tl===e.id,draggable:Me&&!!xe&&!pe.move,rename:t?/* @__PURE__ */G($,{value:e.name,label:Ke.folderName,onDone:vl}):void 0,actions:Me&&o.length?/* @__PURE__ */G(h,{align:"end","aria-label":Ke.folderActions,trigger:V.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Kl(e.id,e.id),...Me?Ml({kind:"folder",id:e.id}):{},...Me&&xe&&!pe.move?{draggable:!0,onDragStart:l=>{l.dataTransfer.effectAllowed="move",l.dataTransfer.setData(H,e.id),Pl(e.id)},onDragEnd:()=>{Pl(null),jl(null)}}:{}}}),r&&i&&/* @__PURE__ */G(n,{children:Ul(e.id,a+1)})]},e.id)}),Bl=Ye.has("@files"),Gl=Ye.has("@products"),Wl=/* @__PURE__ */U(e,{"aria-label":Ke.folders,children:[ee&&/* @__PURE__ */U(B,{children:[
7
- /* @__PURE__ */G(l,{label:Al("@products",Ke.products),level:1,icon:V.lock,badge:{label:Ke.readOnlyBadge,tone:"neutral"},expanded:ee.length?Gl:void 0,onToggle:()=>Ze("@products"),selected:_e&&null==X.nodeId,onSelect:()=>q({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Ll("@products")}}),Gl&&ee.length>0&&/* @__PURE__ */G(n,{children:Rl(ee,2)})]}),
8
- /* @__PURE__ */G(l,{label:Ke.allFiles,level:1,icon:Bl?V.folderOpen:V.folder,badge:null!=le?le:void 0,expanded:He.get(null)?.length?Bl:void 0,onToggle:()=>Ze("@files"),selected:ll&&null==X.folderId,onSelect:()=>q({place:"files",folderId:null}),drop:"@files"===Sl?"into":void 0,rowProps:{"data-media-row":"@files",...Kl("@files",null)}}),Bl&&(He.get(null)?.length??0)>0&&/* @__PURE__ */G(n,{children:Ul(null,2)}),Me&&/* @__PURE__ */G(l,{label:Ke.trash,level:1,icon:V.trash,badge:null!=ne?ne:void 0,selected:el,onSelect:()=>q({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Hl=(()=>{if(el)return[{label:Ke.trash}];if(_e){const e=X.nodeId?Ge.get(X.nodeId)?.path??[]:[];return[{label:Ke.products,onClick:e.length?()=>q({place:"products",nodeId:null}):void 0},...e.map((l,n)=>({label:l.name,onClick:n<e.length-1?()=>q({place:"products",nodeId:l.id}):void 0}))]}const e=Je(nl);return[{label:Ke.allFiles,onClick:e.length?()=>q({place:"files",folderId:null}):void 0},...e.map((l,n)=>({label:l.name,onClick:n<e.length-1?()=>q({place:"files",folderId:l.id}):void 0}))]})(),Jl=_e?Ke.readOnly:pe.upload,Vl=!!ke&&!el&&!Jl,Yl=y({accept:fe,maxSizeBytes:ge,multiple:!0,disabled:!Vl,onAccept:e=>ke?.(e,nl)}),$l=_e?Ke.noProductFolder:pe.newFolder,Zl=e=>e?{"aria-disabled":!0,disabledReason:e}:{},Ql=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[Me&&be&&!el&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.folderPlus,onClick:()=>{yl(nl)},...Zl($l),children:Ke.newFolder}),ke&&!el&&/* @__PURE__ */G(z,{variant:"primary",size:"sm",leftIcon:V.upload,onClick:()=>Yl.open(),...Zl(Jl),children:Ke.upload}),Me&&el&&Se&&ae.length>0&&/* @__PURE__ */G(z,{variant:"danger",size:"sm",onClick:Se,...Zl(pe.deleteForever),children:Ke.emptyTrash})]}),Xl=(e,l,n,a,r)=>/* @__PURE__ */G("div",{style:{width:Be?void 0:r,flex:Be?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */G(g,{size:"sm","aria-label":e,value:l,onChange:a,options:n})},e),ql=e=>l=>oe?.({...te,[e]:l}),_l=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[ie&&/* @__PURE__ */G("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */G(D,{size:"sm",type:"search",leftIcon:V.search,placeholder:_e?Ke.searchProducts:Ke.search,"aria-label":_e?Ke.searchProducts:Ke.search,value:re??"",onChange:e=>ie(e.target.value)})}),oe&&Xl(Ke.mediaType,te.type,[{value:"all",label:Ke.allTypes},{value:"image",label:Ke.images},{value:"video",label:Ke.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],ql("type"),130),oe&&!_e&&!el&&Xl(Ke.use,te.use,[{value:"any",label:Ke.anyUse},{value:"email",label:Ke.emailOnly},{value:"website",label:Ke.websiteOnly},{value:"unused",label:Ke.notUsed}],ql("use"),130),oe&&Me&&Xl(Ke.sort,te.sort,[{value:"newest",label:Ke.newest},{value:"name",label:Ke.byName},{value:"size",label:Ke.bySize}],ql("sort"),110),de?.map(e=>Xl(e.label,e.value,e.options,e.onChange,120)),ce&&/* @__PURE__ */G(v,{size:"sm",label:Ke.view,value:se,onChange:ce,options:[{value:"grid",label:Ke.grid,icon:V.grid},{value:"list",label:Ke.list,icon:V.list}]})]}),en=e=>{const l=[];return null!=e.trashedDaysAgo&&l.push({key:"t",label:Ke.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:Y.clock,tone:"neutral"}),e.usedCount&&l.push({key:"u",label:Ke.used(e.usedCount),count:e.usedCount,icon:Y.link,tone:"active"}),e.email&&l.push({key:"e",label:Ke.email,icon:Y.email,tone:"queued"}),e.private&&l.push({key:"p",label:Ke.private,icon:Y.lock,tone:"neutral"}),l},ln=e=>en(e).map(e=>/* @__PURE__ */G(j,{tone:e.tone,size:"xs",children:e.label},e.key)),nn=Me&&ll&&!!xe&&!pe.move,an=ae.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:en(e),dragData:nn?JSON.stringify(ol.isSelected(e.id)?dl:[e.id]):void 0})),rn=Be?Math.max(72,Math.floor((Ue-24-16-1)/3)):112,tn=K(null),on=w({containerRef:tn,enabled:Me&&!Be&&ae.length>0,selected:ol.selected,setSelection:e=>ol.setSelection(e),clearSelection:ol.clear}),dn=e=>{if(Ae){const l=tl.get(e);return void(!l||l.private||l.pickDisabledReason||Te?.(l))}const l=il.indexOf(e);l>=0&&xl(l)},sn=ae.length?null:re?/* @__PURE__ */G(r,{variant:"dashed",title:Ke.noMatches}):_e?/* @__PURE__ */G(r,{variant:"dashed",title:Ke.emptyProducts,description:rl(al)}):el?/* @__PURE__ */G(r,{variant:"dashed",title:Ke.trashEmpty}):!Vl||Ae?/* @__PURE__ */G(r,{variant:"dashed",title:Ke.emptyFolder}):null,cn="list"===se&&ae.length>0,mn=sn??(cn?/* @__PURE__ */G("ul",{role:"listbox","aria-multiselectable":Me||void 0,"aria-label":Ke.folders,className:"flex flex-col gap-1",children:ae.map(e=>/* @__PURE__ */U("li",{role:"option","aria-selected":ol.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:l=>pl(e.id,l),onDoubleClick:()=>dn(e.id),onContextMenu:l=>Dl(e.id,l),onKeyDown:l=>{"Enter"!==l.key&&" "!==l.key||(l.preventDefault(),pl(e.id,l))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(ol.isSelected(e.id)?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
9
- /* @__PURE__ */G("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
10
- /* @__PURE__ */G("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
11
- /* @__PURE__ */G("span",{className:"flex shrink-0 items-center gap-1",children:ln(e)}),e.sizeLabel&&/* @__PURE__ */G("span",{className:"w-16 shrink-0 text-right text-xs text-gray-500",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */G(p,{items:an,readOnly:!Vl||Ae,onFiles:Vl&&!Ae?e=>ke(e,nl):void 0,accept:fe,maxSizeBytes:ge,busy:ve,progress:ye,fit:"contain",thumbSize:rn,dragType:nn?W:void 0,selected:ol.selected,onItemClick:pl,onItemDoubleClick:dn,onItemContextMenu:Me?Dl:void 0,menuOnMedia:Me})),un=m({count:dl.length,kind:bl(dl),targets:kl({kind:"files",ids:dl}),onPick:e=>xe?.({kind:"files",ids:dl},e.key===s?null:e.key)}),hn=F({variant:"secondary",size:"sm"}),pn=/* @__PURE__ */G(h,{align:"start",triggerClassName:hn,trigger:/* @__PURE__ */U(B,{children:[V.folder,Ke.moveTo]}),items:un,disabled:!!pe.move}),fn=Me&&dl.length>1&&!_e?/* @__PURE__ */U("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-gray-200 px-3 py-2",children:[
12
- /* @__PURE__ */G(x,{checked:dl.length===ae.length,indeterminate:dl.length<ae.length,onChange:e=>e?ol.selectAll():ol.clear(),label:Ke.selected(dl.length)}),/* @__PURE__ */U(B,el?{children:[Ie&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.undo,onClick:()=>Ie(dl),...Zl(pe.restore),children:Ke.restore}),De&&/* @__PURE__ */G(z,{variant:"secondary-danger",size:"sm",onClick:()=>De(dl),...Zl(pe.deleteForever),children:Ke.deleteForever})]}:{children:[xe&&pn,we&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.edit,disabled:!0,children:Ke.rename}),Ce&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.trash,onClick:()=>Ce({kind:"files",ids:dl}),...Zl(pe.trash),children:Ke.moveFilesToTrash(dl.length)})]}),
13
- /* @__PURE__ */G(z,{variant:"ghost",size:"sm",onClick:ol.clear,children:Ke.clearSelection})]}):null,gn=e=>{const l=[],n=(e,n,a)=>{null!=a&&""!==a&&l.push({key:e,label:n,value:a})},a="file"===fl?.kind&&fl.id===e.id;n("name",Ke.name,a?/* @__PURE__ */G($,{value:e.name,label:Ke.fileName,onDone:vl}):e.name),n("type",Ke.type,e.typeLabel),n("size",Ke.size,e.sizeLabel),n("resolution",Ke.resolution,e.resolution),_e?(n("design",Ke.design,e.design),n("finish",Ke.finish,e.finish),n("angle",Ke.angleLug,e.angleLug),n("owner",Ke.owner,e.owner)):(n("added",Ke.addedBy,e.addedBy),n("folder",Ke.folder,e.folderPath)),n("used",Ke.usedIn,null!=e.usedCount?Ke.places(e.usedCount):void 0);const r=c({kind:"files",ids:[e.id]},Cl).find(e=>"submenu"===e.type);/* @__PURE__ */
14
- return U("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
15
- /* @__PURE__ */G("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),_e&&/* @__PURE__ */G(I,{tone:"neutral",title:Ke.readOnlyBadge,children:rl(al)}),
16
- /* @__PURE__ */G(t,{size:"sm",columns:1,items:l}),!el&&/* @__PURE__ */U("div",{className:"flex gap-2",children:[
17
- /* @__PURE__ */G("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */G(D,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ke.fileUrl,onFocus:e=>e.currentTarget.select()})}),
18
- /* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.copy,onClick:()=>Cl.copyUrl(e.id),children:Ke.copyUrl})]}),ll&&Me&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.swap,onClick:()=>je(e.id),...Zl(pe.replace),children:Ke.replace}),ze&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.crop,onClick:()=>ze(e.id),children:Ke.cropEdit}),xe&&"submenu"===r?.type&&/* @__PURE__ */G(h,{align:"start",triggerClassName:hn,trigger:/* @__PURE__ */U(B,{children:[V.folder,Ke.moveTo]}),items:r.items,disabled:!!pe.move}),we&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.edit,onClick:()=>gl({kind:"file",id:e.id}),...Zl(pe.rename),children:Ke.rename}),Ce&&/* @__PURE__ */G(S,{"aria-label":Ke.moveToTrash,size:"sm",onClick:()=>Ce({kind:"files",ids:[e.id]}),disabledReason:pe.trash,"aria-disabled":!!pe.trash||void 0,children:V.trash})]}),el&&Me&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[Ie&&/* @__PURE__ */G(z,{variant:"primary",size:"sm",leftIcon:V.undo,onClick:()=>Ie([e.id]),...Zl(pe.restore),children:Ke.restore}),De&&/* @__PURE__ */G(z,{variant:"danger",size:"sm",onClick:()=>De([e.id]),...Zl(pe.deleteForever),children:Ke.deleteForever})]}),_e&&Fe&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Ke.openInDesign}),he&&/* @__PURE__ */G(f,{items:he})]})},vn=sl?sl.private?Ke.privateNoPick:sl.pickDisabledReason:void 0,yn=Ae?/* @__PURE__ */U("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-gray-200 px-3 py-2",children:[
19
- /* @__PURE__ */G("span",{className:"min-w-0 truncate text-sm text-gray-500",children:sl?Ke.oneChosen(sl.name):Ke.noneChosen}),
20
- /* @__PURE__ */U("div",{className:"flex gap-2",children:[Pe&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",onClick:Pe,children:Ke.cancel}),
21
- /* @__PURE__ */G(z,{variant:"primary",size:"sm",disabled:!sl,...Zl(vn),onClick:()=>{sl&&!vn&&Te?.(sl)},children:Ke.chooseImage})]})]}):null,kn=Me&&!!sl,bn=/* @__PURE__ */U("div",{className:"flex min-w-0 flex-col gap-3",children:[Oe&&/* @__PURE__ */G(I,{tone:"neutral",children:Oe}),
22
- /* @__PURE__ */U("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
23
- /* @__PURE__ */G(d,{items:Hl}),Ql]}),_l,fn,
24
- /* @__PURE__ */U("div",{ref:tn,className:"relative",onPointerDown:on.onPointerDown,onKeyDown:e=>{Me&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),ol.selectAll()):"Escape"===e.key&&ol.size&&ol.clear()},children:[mn,
25
- /* @__PURE__ */G(a,{rect:on.rect})]}),Vl&&/* @__PURE__ */G("input",{...Yl.inputProps}),
26
- /* @__PURE__ */G(k,{rejections:Yl.rejections})]});/* @__PURE__ */
27
- return U("div",{ref:Re,"data-media-library":"","data-layout":Be?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Ee}`.trim(),children:[/* @__PURE__ */U("div",Be?{className:"flex flex-col gap-3 p-3",children:[Wl,bn]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
28
- /* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-r border-gray-200 p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Wl}),
29
- /* @__PURE__ */G("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:bn}),kn&&/* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-l border-gray-200 p-3",style:{width:300},children:gn(sl)})]}),yn,Be&&/* @__PURE__ */G(o,{open:kn,onClose:ol.clear,side:"bottom",title:sl?.name,children:sl&&gn(sl)}),Il.state&&/* @__PURE__ */G(N,{...Il.props,items:Nl(Il.state.data)}),null!=wl&&ae.length>0&&/* @__PURE__ */G(i,{images:ae.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(wl,ae.length-1),onClose:()=>xl(null)})]})}export{W as MEDIA_FILES_DRAG_TYPE,H as MEDIA_FOLDER_DRAG_TYPE,Z as MediaLibrary};
@@ -1,6 +0,0 @@
1
- import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-64ZHCEZN.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{Tooltip as n}from"./chunk-22S6LG6D.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s}){const i=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),t=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);return{words:i>0,paragraph:t>0,oneRow:i>0&&t>0&&i+1+t<=9,flow:i>0&&t>0&&i+1+t>9&&i<=7,cells:{words:i,paragraph:t}}}function w(e,l){/* @__PURE__ */
2
- return i(n,{content:e,children:l},l.key??void 0)}function g({offered:n,pressed:h,onMark:g,color:f,linkOpen:k=!1,last:v,alignment:N,list:C,letterCase:D,disabled:M=!1,"aria-label":x,windows:y,className:A="",layout:j="grid"}){const R=s().textToolbar,S=m({offered:n,color:f,last:v,alignment:N,list:C,letterCase:D});if(!S.words&&!S.paragraph)return null;const q=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,B=(e,l,r,o)=>n.has(e)?w(l,/* @__PURE__ */i(a,"link"===e?{pressed:k,className:q(k),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":k,"aria-keyshortcuts":o,disabled:M,onMouseDown:c,onClick:()=>g(e),children:r}:{className:q(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:M,onMouseDown:c,onClick:()=>g(e),children:r},e)):null,L=l(R),$=e.map(e=>[e,L[e],r(e)]),I=N?e.filter(e=>N.allow.includes(e)):[],U=N&&I.includes(N.value)?N.value:I[0],E=[["none",R.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",R.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",R.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],H=/* @__PURE__ */t(d,{children:[B("bold",R.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),B("italic",R.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),B("underline",R.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),B("strike",R.strike,/* @__PURE__ */i(o,{name:"strike"})),f?w(R.color,/* @__PURE__ */i(a,{pressed:f.open,className:q(f.open,"rosh-tb-color"),"aria-label":R.color,"aria-haspopup":"dialog","aria-expanded":f.open,disabled:M,style:f.run?{"--rosh-tb-run":f.run}:void 0,onMouseDown:c,onClick:f.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,B("link",R.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),B("sup",R.sup,/* @__PURE__ */i(o,{name:"superscript"})),B("sub",R.sub,/* @__PURE__ */i(o,{name:"subscript"})),B("code",R.code,/* @__PURE__ */i(o,{name:"code"})),u(v)?v:null]}),K=/* @__PURE__ */t(d,{children:[N&&I.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":R.alignment,onKeyDown:e=>p(e,I,e=>N.onChange(e)),children:$.map(([e,l,r])=>N.allow.includes(e)?w(l,/* @__PURE__ */i(a,{role:"radio",pressed:N.value===e,className:q(N.value===e),"aria-checked":N.value===e,"aria-label":l,tabIndex:e===U?0:-1,disabled:M||N.disabled,onMouseDown:c,onClick:()=>N.onChange(e),children:r},e)):null)}):null,C&&n.has("bullet")?w(R.bullet,/* @__PURE__ */i(a,{className:q("bullet"===C.pressed),"aria-label":R.bullet,"aria-pressed":"bullet"===C.pressed,disabled:M,onMouseDown:c,onClick:()=>C.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,C&&n.has("number")?w(R.number,/* @__PURE__ */i(a,{className:q("number"===C.pressed),"aria-label":R.number,"aria-pressed":"number"===C.pressed,disabled:M,onMouseDown:c,onClick:()=>C.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,B("quote",R.quote,/* @__PURE__ */i(o,{name:"quote"})),D?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":R.letterCase,onKeyDown:e=>p(e,E.map(([e])=>e),e=>D.onChange(e)),children:E.map(([e,l,r])=>w(l,/* @__PURE__ */i(a,{role:"radio",pressed:D.value===e,className:q(D.value===e),"aria-checked":D.value===e,"aria-label":l,tabIndex:e===(D.value||"none")?0:-1,disabled:M||D.disabled,onMouseDown:c,onClick:()=>D.onChange(D.value===e?"":e),children:r},e)))}):null]}),T="row"===j,G=T?" is-row":S.flow?" is-flow":S.oneRow?" is-one-row":S.words&&void 0===v?" is-eight":"",O=b(n,Boolean(f)),Z={"--rosh-tb-color-col":String(O.color),"--rosh-tb-link-col":String(O.link),...T?{"--rosh-tb-cells":String(S.cells.words+S.cells.paragraph),"--rosh-tb-groupgap":S.words&&S.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let Q;return Q=T?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[S.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:H}):null,S.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:K}):null]}):S.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[H,
3
- /* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),K]}):S.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
4
- /* @__PURE__ */i("div",{className:"rosh-tb-words",children:H}),
5
- /* @__PURE__ */i("div",{className:"rosh-tb-para",children:K})]}):/* @__PURE__ */t(d,{children:[S.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===v?" is-eight":""),children:H}):null,S.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:K}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${G} ${A}`.trim(),style:Z,children:[
6
- /* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":x??R.formatting,children:Q}),y]})}export{g as TextToolbar,m as textToolbarRows,b as textToolbarWindowColumns};
@@ -1,8 +0,0 @@
1
- import{optionMatches as e,OptionSublabel as t}from"./chunk-XZL3HCWH.js";import{inputClasses as n}from"./chunk-PF3ANJFI.js";import{GROUP_COLORS as r}from"./chunk-D323R2FT.js";import{Tooltip as o}from"./chunk-22S6LG6D.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as a,POPUP_MAX_WIDTH as s,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-E6UCGCOC.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as v,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${r.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:r,onChange:y,options:k=[],placeholder:N,allowFreeText:C=!1,invalid:j,disabled:L,id:D,className:W="",tone:E,tooltip:F,split:$}){const[G,H]=m(!1),[I,J]=m(""),M=d(),S=h(null),T=h(null),B=h(null),R=a(S,G),P=e=>k.find(t=>t.value===e)?.label??e,U=p(()=>{const t=new Set(r),n=[],o=I.trim().toLowerCase();for(const r of k)t.has(r.value)||(t.add(r.value),o&&!e(r,o)||n.push(r));return n},[k,r,I]),z=e=>{const t=[...r];for(const n of e){const e=n.trim();if(!e)continue;const r=e.toLowerCase(),o=k.find(t=>t.value===e||t.label.toLowerCase()===r)?.value,l=o??(C?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==r.length&&y(t)},A=e=>{e&&!r.includes(e)?(y([...r,e]),J("")):J("")},K=e=>y(r.filter(t=>t!==e)),O=()=>{const e=I.trim();if($&&e)return z(e.split($)),void J("");C&&e?A(e):J("")},X=h(()=>{});X.current=()=>{O(),H(!1)},f(()=>{if(!G)return;const e=e=>{const t=e.target;S.current?.contains(t)||B.current?.contains(t)||(O(),H(!1))};document.addEventListener("mousedown",e);const t=l(()=>X.current());return()=>{document.removeEventListener("mousedown",e),t()}});const Z=k.length>0;/* @__PURE__ */
2
- return v("div",{ref:S,className:"relative",children:[
3
- /* @__PURE__ */v("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),T.current?.focus())},className:n({invalid:j,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[r.map(e=>{const t=E?.(e),n=w[t??"accent"],r=/* @__PURE__ */v("span",{"data-tone":t,className:n.chip,children:[
4
- /* @__PURE__ */x("span",{className:"truncate",children:P(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":M.select.removeItem?.(P(e))??`${M.select.remove} ${P(e)}`,onClick:()=>K(e),className:n.remove,children:"×"})]},e),l=F?.(e);return null==l?r:/* @__PURE__ */x(o,{content:l,className:"relative inline-flex max-w-full",children:r},e)}),
5
- /* @__PURE__ */x("input",{id:D,ref:T,type:"text",autoComplete:"off",role:"combobox","aria-expanded":G&&Z,"aria-invalid":j||void 0,disabled:L,value:I,placeholder:0===r.length?N:void 0,onChange:e=>{(e=>{if($){const t=e.split($);if(t.length>1)return z(t.slice(0,-1)),void J(t[t.length-1])}J(e)})(e.target.value),H(!0)},onFocus:()=>{!L&&Z&&H(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&C){t.preventDefault();const n=I.trim(),r=n?U.filter(t=>e(t,n.toLowerCase())):[];1===r.length?A(r[0].value):O()}else"Backspace"===t.key&&""===I&&r.length>0?K(r[r.length-1]):"Escape"===t.key?(H(!1),J(""),T.current?.blur()):"Tab"===t.key&&(O(),H(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),G&&Z&&g(
6
- /* @__PURE__ */x("div",{ref:B,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:R?.left,right:R?.right,top:R?.top,bottom:R?.bottom,minWidth:R?.minWidth,maxWidth:R?.maxWidth??s,width:"max-content",visibility:R?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:R?.maxHeight??c},children:0===U.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&r.length>=k.length?M.select.allSelected:M.select.noMatches}):U.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),A(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */v(b,{children:[
7
- /* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
8
- /* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
@@ -1,3 +0,0 @@
1
- import{DropdownMenu as e}from"./chunk-5FCEBKT2.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{iconButtonClasses as n}from"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{Tooltip as a}from"./chunk-22S6LG6D.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:R,align:W="end",side:z="bottom",menuMinWidth:L,linkAs:A,block:B=!1,className:D=""},F){const I=g&&(null!=N&&""!==N&&!1!==N)&&!v,S=x&&null!=j&&""!==j&&!1!==j,$=o(),E=/* @__PURE__ */t(i,{ref:F,type:b,variant:f,size:p,loading:v,leftIcon:k,block:B,disabled:g&&!I,"aria-disabled":!!I||void 0,disabledReason:I?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),K=B?"relative flex min-w-0 flex-1":"relative inline-flex",M=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
2
- return s("div",{className:[B?"flex w-full":"inline-flex","items-stretch",D].filter(Boolean).join(" "),children:[null==w||""===w||I?E:/* @__PURE__ */t(a,{content:w,className:K,children:E}),
3
- /* @__PURE__ */t(a,{content:S?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":S?$:void 0,items:h,align:W,side:z,minWidth:L,linkAs:A,disabled:x&&!S,"aria-disabled":S,onOpenChange:y,footer:C,footerLabel:R,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:M,strokeWidth:2,"aria-hidden":"true"})})}),S&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
@@ -1,8 +0,0 @@
1
- import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as h}from"react/jsx-runtime";var f={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},u={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function b({onClose:e}){const r=a().dialog;/* @__PURE__ */
2
- return h("button",{type:"button",onClick:e,"aria-label":r.close,className:"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__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:k,blocking:N=!1,initialFocus:w,"aria-label":j,"aria-labelledby":C,"aria-describedby":W,className:L=""}){const U=n(null),z=d(),A=d(),D=d();if(r(o),i(U,o,w),t(o),c(()=>{if(o)return l(()=>(N||a(),!0),()=>U.current)},[o,N,a]),!o)return null;const G="bottom"===p,R=G?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
3
- return m("div",{className:"fixed inset-0",style:{zIndex:s.overlay},role:"presentation",children:[
4
- /* @__PURE__ */h("div",{className:"fixed inset-0 bg-black/30",onClick:N?void 0:a,"aria-hidden":"true"}),
5
- /* @__PURE__ */m("div",{ref:U,...e({modal:!0,titleId:g?D:void 0,labelledBy:C,label:j}),"aria-describedby":W??(y?A:k?z:void 0),"data-drawer-side":p,style:R,className:["fixed flex flex-col bg-white shadow-xl",G?"":`w-full max-w-full ${f[x]}`,u[p],G?"rounded-t-xl":"",L].filter(Boolean).join(" "),children:[g?/* @__PURE__ */m("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
6
- /* @__PURE__ */m("div",{className:"min-w-0",children:[
7
- /* @__PURE__ */h("h2",{id:D,className:"text-base font-semibold text-gray-900",children:g}),y&&/* @__PURE__ */h("p",{id:A,className:"mt-0.5 text-sm text-gray-500",children:y})]}),!N&&/* @__PURE__ */h(b,{onClose:a})]}):!N&&/* @__PURE__ */h("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */h(b,{onClose:a})}),
8
- /* @__PURE__ */m("div",{id:z,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[y&&!g&&/* @__PURE__ */h("p",{id:A,className:("mb-3 text-sm text-gray-500 "+(N?"":"pr-8")).trim(),children:y}),k]}),v&&/* @__PURE__ */h("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:v})]})]})}export{p as Drawer};
@@ -1,3 +0,0 @@
1
- import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as a}from"./chunk-2SHYR3RA.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as o}from"./chunk-TWVUQUUD.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as u}from"react/jsx-runtime";var f={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function h({open:h,onClose:x,title:p,description:b,role:g="dialog",children:v,footer:y,blocking:k=!1,size:N="md",initialFocus:j,"aria-label":w,"aria-labelledby":C,"aria-describedby":W,className:L=""}){const U=n(null),A=d(),D=d(),G=!k,R=d(),z=s().dialog;return r(h),i(U,h,j),t(h),c(()=>{if(h)return o(()=>(k||x(),!0),()=>U.current)},[h,k,x]),h?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:l.overlay},role:"presentation",children:[
2
- /* @__PURE__ */u("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
3
- /* @__PURE__ */u("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:k?void 0:e=>{e.target===e.currentTarget&&x()},children:/* @__PURE__ */m("div",{ref:U,...e({role:g,modal:!0,titleId:p?R:void 0,labelledBy:C,label:w}),"aria-describedby":W??(b?D:v?A:void 0),className:`relative max-h-full w-full ${f[N]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${L}`.trim(),children:[p&&/* @__PURE__ */u("h2",{id:R,className:(G?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:p}),b&&/* @__PURE__ */u("p",{id:D,className:((p?"mt-1":G?"pr-8":"")+" text-sm text-gray-500").trim(),children:b}),v&&/* @__PURE__ */u("div",{id:A,className:"mt-2 text-sm text-gray-600",children:v}),y&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:y}),G&&/* @__PURE__ */u("button",{type:"button",onClick:x,"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__ */u(a,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}export{h as Dialog};