efficient-shell 13.24.0 → 13.25.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 (101) hide show
  1. package/README.md +14 -3
  2. package/dist/Browser-W2WVSAEN.js +44 -0
  3. package/dist/Calculator-PKAM5ERT.js +29 -0
  4. package/dist/CurrencyConverter-VH4UVYLO.js +21 -0
  5. package/dist/Files-6QZFFGSH.js +141 -0
  6. package/dist/Notepad-YU4HIJD2.js +24 -0
  7. package/dist/PomodoroTimer-PBSAKRX5.js +91 -0
  8. package/dist/{Preview-FXOWT52M.js → Preview-H7N2MMAI.js} +39 -39
  9. package/dist/{Sidebar-MY66ILZY.js → Sidebar-HAIHWIJD.js} +22 -22
  10. package/dist/{Stock-SHKXRWJQ.js → Stock-YL732PKW.js} +5 -5
  11. package/dist/{Weather-WMKWOPBU.js → Weather-3CBRXNNM.js} +18 -18
  12. package/dist/{WorldClock-GZYOF4B2.js → WorldClock-LONNWCRG.js} +6 -6
  13. package/dist/ai/index.js +117 -117
  14. package/dist/apps/index.js +1 -1
  15. package/dist/bin/browser-check.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/{chunk-GAEQYCLS.js → chunk-26KHYLJN.js} +1 -1
  19. package/dist/{chunk-SAHRIE35.js → chunk-2Y4AH7NC.js} +1 -1
  20. package/dist/{chunk-7G5HKAGV.js → chunk-3WUVYXCF.js} +5 -5
  21. package/dist/chunk-44ERJYNW.js +6 -0
  22. package/dist/{chunk-XYQFTFI7.js → chunk-4VFEPP2W.js} +9 -9
  23. package/dist/{chunk-TSCJG6UM.js → chunk-527WMFTR.js} +1 -1
  24. package/dist/{chunk-VLIXI42G.js → chunk-77N3REYY.js} +2 -2
  25. package/dist/chunk-AAFPAQXH.js +13 -0
  26. package/dist/{chunk-ZL654Y6H.js → chunk-AAJSE5HA.js} +1 -1
  27. package/dist/{chunk-J5OAQAAD.js → chunk-B5KX7PDG.js} +4 -4
  28. package/dist/{chunk-UJY5RUZ5.js → chunk-BQQEQCSK.js} +1 -1
  29. package/dist/{chunk-JJYTN72U.js → chunk-CCZHSISF.js} +3 -3
  30. package/dist/{chunk-WNX6EVJ4.js → chunk-EXDSYFHB.js} +1 -1
  31. package/dist/chunk-FLQXMCB3.js +8 -0
  32. package/dist/{chunk-GPU7LLTJ.js → chunk-HPKQYUQT.js} +1 -1
  33. package/dist/{chunk-LRMDLZMM.js → chunk-JVENCUUG.js} +4 -4
  34. package/dist/{chunk-23YQNCZ4.js → chunk-K4KUGKWP.js} +16 -16
  35. package/dist/chunk-LG6NDTHZ.js +2 -0
  36. package/dist/{chunk-ZBGPAUOH.js → chunk-N4LMFGRI.js} +5 -5
  37. package/dist/chunk-O5ZBRG2G.js +1 -0
  38. package/dist/{chunk-7N6CVTWO.js → chunk-P6H2B635.js} +1 -1
  39. package/dist/{chunk-Z6J4KXY3.js → chunk-PWOVSR7N.js} +6 -6
  40. package/dist/chunk-PWX64YBI.js +28 -0
  41. package/dist/{chunk-F3EBYHIE.js → chunk-S5MTTJ3F.js} +10 -10
  42. package/dist/{chunk-ONWFKCMB.js → chunk-SRI2D23Y.js} +8 -8
  43. package/dist/{chunk-LUARJHUK.js → chunk-TJG76Y7I.js} +8 -8
  44. package/dist/{chunk-TT7KXS2Q.js → chunk-UQV4TSWB.js} +1 -1
  45. package/dist/{chunk-AFYLMXOJ.js → chunk-UU42O5ON.js} +5 -5
  46. package/dist/{chunk-H2Q7G5D6.js → chunk-VGUB7LPF.js} +28 -28
  47. package/dist/{chunk-QPVYBN4J.js → chunk-VLBLDSA6.js} +1 -1
  48. package/dist/{chunk-L744YF4X.js → chunk-VMAIZU5S.js} +1 -1
  49. package/dist/{chunk-6CFI4YGI.js → chunk-VP2IQJUD.js} +4 -4
  50. package/dist/chunk-VY6OQRZA.js +1 -0
  51. package/dist/{chunk-FMBUR4EU.js → chunk-XC2GUCTG.js} +1 -1
  52. package/dist/data/EntityList.js +1 -1
  53. package/dist/data/ResizableTable.js +1 -1
  54. package/dist/format/index.js +1 -1
  55. package/dist/forms/BorderInput.js +1 -1
  56. package/dist/forms/ColorPicker.js +1 -1
  57. package/dist/forms/ComposerAttachments.js +1 -1
  58. package/dist/forms/CornersInput.js +1 -1
  59. package/dist/forms/DateRangePicker.js +1 -1
  60. package/dist/forms/IconPicker.js +1 -1
  61. package/dist/forms/Input.js +1 -1
  62. package/dist/forms/InputNumber.js +1 -1
  63. package/dist/forms/LinkPicker.js +1 -1
  64. package/dist/forms/MediaLibrary.js +1 -1
  65. package/dist/forms/PositionInput.js +1 -1
  66. package/dist/forms/RenameField.js +1 -1
  67. package/dist/forms/SidesInput.js +1 -1
  68. package/dist/forms/Slider.js +1 -1
  69. package/dist/forms/WidthsBar.js +1 -1
  70. package/dist/icons/index.js +1 -1
  71. package/dist/index.js +516 -516
  72. package/dist/page-tabs/index.js +5 -5
  73. package/dist/shell/ConfirmDialog.js +1 -1
  74. package/dist/shell/Dialog.js +1 -1
  75. package/dist/shell/Drawer.js +1 -1
  76. package/dist/shell/LanguageSelect.js +1 -1
  77. package/dist/shell/SearchableSelect.js +1 -1
  78. package/dist/shell/SettingRow.js +1 -1
  79. package/dist/shell/discardGuard.js +1 -1
  80. package/dist/telemetry/index.js +1 -1
  81. package/dist/templates/AuthScreen.js +1 -1
  82. package/dist/templates/ChatTemplate.js +1 -1
  83. package/dist/templates/CheckoutTemplate.js +1 -1
  84. package/dist/templates/DataTablePage.js +1 -1
  85. package/dist/templates/FormLayoutPage.js +1 -1
  86. package/dist/ui/index.js +1 -1
  87. package/dist/version.js +1 -1
  88. package/package.json +1 -1
  89. package/dist/Browser-NZ32TN3O.js +0 -44
  90. package/dist/Calculator-PHIOJNTS.js +0 -29
  91. package/dist/CurrencyConverter-WZXN6WTD.js +0 -21
  92. package/dist/Files-BKNIV43J.js +0 -141
  93. package/dist/Notepad-XJTIS3J5.js +0 -24
  94. package/dist/PomodoroTimer-WVIAWG5E.js +0 -91
  95. package/dist/chunk-3ZX5DC2S.js +0 -1
  96. package/dist/chunk-CJQPC2P3.js +0 -2
  97. package/dist/chunk-M36B3M2H.js +0 -8
  98. package/dist/chunk-MRZLFZNJ.js +0 -6
  99. package/dist/chunk-OFMZ6JM6.js +0 -13
  100. package/dist/chunk-QKVPKLDN.js +0 -28
  101. /package/dist/{chunk-UAXL44HH.js → chunk-4BYJABCX.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-D5PXRJHA.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-OSMRYND3.js";import{Input_default as c}from"./chunk-J5OAQAAD.js";import{Button_default as s}from"./chunk-UTISUEO4.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-D5PXRJHA.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-OSMRYND3.js";import{Input_default as c}from"./chunk-B5KX7PDG.js";import{Button_default as s}from"./chunk-UTISUEO4.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -1,6 +1,6 @@
1
- import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-QPVYBN4J.js";import{textWidth as l}from"./chunk-UVCMV2TL.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useId as s,useRef as c,useState as u,useEffect as d,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,r,t)=>Math.min(t,Math.max(r,e)),g=e=>e.reduce((e,r)=>e+r,0),v=(e,r)=>e.length===r.length&&e.every((e,t)=>e===r[t]);var b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:R=!1,className:M=""}){const j=a().widths,z=s(),A=p(Math.round(x)||1,1,n),B=e($,A),S=B??[...r[A]??[]],D=[...S,100-g(S)],G=P||R,K=c(null),O=c({onChange:k,shown:S,locked:G,n:A,stored:B});O.current={onChange:k,shown:S,locked:G,n:A,stored:B};const T=r=>{const{onChange:t,shown:n,locked:o,n:l}=O.current;if(o)return!1;const i=e(r,l);return!(!i||v(i,n))&&(t(i),!0)},H=(e,r,n)=>{const o=e[r]+e[r+1],l=[...e];l[r]=p(Math.round(n),t,o-t),l[r+1]=o-l[r],T(l.slice(0,-1))&&(ne.current=null)},I=e=>r=>{if(r.altKey||r.ctrlKey||r.metaKey)return;const n=r.shiftKey?10:1,o=D[e]+D[e+1],l="ArrowRight"===r.key?D[e]+n:"ArrowLeft"===r.key?D[e]-n:"PageUp"===r.key?D[e]+10:"PageDown"===r.key?D[e]-10:"Home"===r.key?t:"End"===r.key?o-t:null;null!==l&&(r.preventDefault(),H(D,e,l))},L=c(null),[V,E]=u(null),F=()=>{L.current=null,E(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};d(()=>F,[]);const U=e=>r=>{if(0!==r.button||G)return;r.preventDefault();const t=K.current?.getBoundingClientRect().width??0;t<=0||(L.current={i:e,x:r.clientX,width:t,from:D,moved:!1,pointer:r.pointerId},E(e),r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},J=e=>{const r=L.current;if(!r)return;if(0===e.buttons)return void F();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}H(r.from,r.i,r.from[r.i]+t/r.width*100)},Q=e=>{const r=L.current;r&&(e.currentTarget.hasPointerCapture?.(r.pointer)&&e.currentTarget.releasePointerCapture(r.pointer),F())},W=(e,r)=>{const{shown:n}=O.current,o=function(e,r,n){const o=e.length,l=[...e];if(o<2)return l;const i=p(Math.round(n),t,100-(o-1)*t);let a=i-l[r];l[r]=i;const s=[...Array.from({length:o-1-r},(e,t)=>r+1+t),...Array.from({length:r},(e,t)=>r-1-t)];if(a<0)return l[s[0]]-=a,l;for(const e of s){if(a<=0)break;const r=Math.min(a,l[e]-t);l[e]-=r,a-=r}return l}([...n,100-g(n)],e,r);return T(o.slice(0,-1))?o:null},[X,q]=u(0);d(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>q(e.getBoundingClientRect().width));return r.observe(e),()=>r.disconnect()},[]);const Y=c(null),[Z,_]=u(null),[ee,re]=u([]),te=(e,r)=>_(t=>r?e:t===e?null:t),ne=c(null),oe=(e,r)=>{const t=ne.current;if(!t||t.column!==e||t.share!==r)return!1;const{onChange:n,locked:o,stored:l}=O.current;var i,a;return o||(i=l,a=t.stored,void 0===i||void 0===a?i===a:v(i,a))||n(t.stored),!0},le=D.join(",");d(()=>{const e=null===Z?[]:function(e,r){if(!e)return[];const t=Array.from(e.querySelectorAll("input[data-widths-label]")),n=t[r]?.getBoundingClientRect();return n&&0!==n.width?null===l("","12px sans-serif")?[]:t.flatMap((e,t)=>{if(t===r)return[];const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=(l(e.value,`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`)??0)/2,s=(o.left+o.right)/2;return s+a>n.left&&s-a<n.right?[t]:[]}):[]}(Y.current,Z);re(r=>v(r,e)?r:e)},[Z,le,X]);const ie=j.hint(A,t),ae=D.slice(0,-1).map((e,r)=>g(D.slice(0,r+1)));/* @__PURE__ */
2
- return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":A>1?z:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${R?"opacity-60":""} ${M}`.trim(),children:[
1
+ import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-VLBLDSA6.js";import{textWidth as l}from"./chunk-UVCMV2TL.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useId as s,useRef as c,useState as u,useEffect as d,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,r,t)=>Math.min(t,Math.max(r,e)),g=e=>e.reduce((e,r)=>e+r,0),v=(e,r)=>e.length===r.length&&e.every((e,t)=>e===r[t]);var b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:R=!1,className:M=""}){const j=a().widths,A=s(),z=p(Math.round(x)||1,1,n),B=e($,z),S=B??[...r[z]??[]],D=[...S,100-g(S)],L=P||R,G=c(null),K=c({onChange:k,shown:S,locked:L,n:z,stored:B});K.current={onChange:k,shown:S,locked:L,n:z,stored:B};const O=r=>{const{onChange:t,shown:n,locked:o,n:l}=K.current;if(o)return!1;const i=e(r,l);return!(!i||v(i,n))&&(t(i),!0)},T=(e,r,n)=>{const o=e[r]+e[r+1],l=[...e];l[r]=p(Math.round(n),t,o-t),l[r+1]=o-l[r],O(l.slice(0,-1))&&(ne.current=null)},H=e=>r=>{if(r.altKey||r.ctrlKey||r.metaKey)return;const n=r.shiftKey?10:1,o=D[e]+D[e+1],l="ArrowRight"===r.key?D[e]+n:"ArrowLeft"===r.key?D[e]-n:"PageUp"===r.key?D[e]+10:"PageDown"===r.key?D[e]-10:"Home"===r.key?t:"End"===r.key?o-t:null;null!==l&&(r.preventDefault(),T(D,e,l))},I=c(null),[V,E]=u(null),F=()=>{I.current=null,E(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};d(()=>F,[]);const U=e=>r=>{if(0!==r.button||L)return;r.preventDefault();const t=G.current?.getBoundingClientRect().width??0;t<=0||(I.current={i:e,x:r.clientX,width:t,from:D,moved:!1,pointer:r.pointerId},E(e),r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},W=e=>{const r=I.current;if(!r)return;if(0===e.buttons)return void F();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}T(r.from,r.i,r.from[r.i]+t/r.width*100)},X=e=>{const r=I.current;r&&(e.currentTarget.hasPointerCapture?.(r.pointer)&&e.currentTarget.releasePointerCapture(r.pointer),F())},q=(e,r)=>{const{shown:n}=K.current,o=function(e,r,n){const o=e.length,l=[...e];if(o<2)return l;const i=p(Math.round(n),t,100-(o-1)*t);let a=i-l[r];l[r]=i;const s=[...Array.from({length:o-1-r},(e,t)=>r+1+t),...Array.from({length:r},(e,t)=>r-1-t)];if(a<0)return l[s[0]]-=a,l;for(const e of s){if(a<=0)break;const r=Math.min(a,l[e]-t);l[e]-=r,a-=r}return l}([...n,100-g(n)],e,r);return O(o.slice(0,-1))?o:null},[J,Q]=u(0);d(()=>{const e=G.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>Q(e.getBoundingClientRect().width));return r.observe(e),()=>r.disconnect()},[]);const Y=c(null),[Z,_]=u(null),[ee,re]=u([]),te=(e,r)=>_(t=>r?e:t===e?null:t),ne=c(null),oe=(e,r)=>{const t=ne.current;if(!t||t.column!==e||t.share!==r)return!1;const{onChange:n,locked:o,stored:l}=K.current;var i,a;return o||(i=l,a=t.stored,void 0===i||void 0===a?i===a:v(i,a))||n(t.stored),!0},le=D.join(",");d(()=>{const e=null===Z?[]:function(e,r){if(!e)return[];const t=Array.from(e.querySelectorAll("input[data-widths-label]")),n=t[r]?.getBoundingClientRect();return n&&0!==n.width?null===l("","12px sans-serif")?[]:t.flatMap((e,t)=>{if(t===r)return[];const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=(l(e.value,`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`)??0)/2,s=(o.left+o.right)/2;return s+a>n.left&&s-a<n.right?[t]:[]}):[]}(Y.current,Z);re(r=>v(r,e)?r:e)},[Z,le,J]);const ie=j.hint(z,t),ae=D.slice(0,-1).map((e,r)=>g(D.slice(0,r+1)));/* @__PURE__ */
2
+ return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?A:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${R?"opacity-60":""} ${M}`.trim(),children:[
3
3
  /* @__PURE__ */f("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
4
- /* @__PURE__ */m("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:D.map((e,r)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[r%2]} ${r%2==0?"bg-accent-tint":""}`,children:1===A&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},r))}),
5
- /* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),A>1&&D.map((e,r)=>/* @__PURE__ */f(h,{children:[(()=>{const n=Z===r,l=g(D.slice(0,r)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
- return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>X>0&&X*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:t,max:100-(A-1)*t,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:R,"aria-label":j.column(r+1),"aria-describedby":z,"data-widths-label":"",onChange:e=>{null===e||oe(r,e)||W(r,e)},onRevert:e=>((e,r)=>{O.current.locked||null===r||oe(e,r)||W(e,r)})(r,e),onFocus:()=>{ne.current={column:r,share:e,stored:O.current.stored},te(r,!0)},onBlur:()=>te(r,!1),className:`absolute inset-0 text-xs font-medium ${w[r%2]} ${ee.includes(r)&&!n?"opacity-0":""}`})})})})(),r<A-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[r]}%`},children:/* @__PURE__ */m(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:R?-1:0,"aria-orientation":"vertical","aria-label":j.divider(r+1,r+2),"aria-valuenow":D[r],"aria-valuemin":t,"aria-valuemax":D[r]+D[r+1]-t,"aria-valuetext":j.dividerValue(r+1,D[r],r+2,D[r+1]),"aria-disabled":G||void 0,onKeyDown:G?void 0:I(r),onPointerDown:U(r),onPointerMove:J,onPointerUp:Q,onPointerCancel:Q,onLostPointerCapture:()=>{L.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(G?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(G?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${V===r?"w-1":y}`)})})})})]},r))]}),A>1&&/* @__PURE__ */m("span",{id:z,className:"sr-only",children:ie})]})}export{x as WidthsBar};
4
+ /* @__PURE__ */m("div",{ref:G,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:D.map((e,r)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[r%2]} ${r%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},r))}),
5
+ /* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&D.map((e,r)=>/* @__PURE__ */f(h,{children:[(()=>{const n=Z===r,l=g(D.slice(0,r)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
+ return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>J>0&&J*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:t,max:100-(z-1)*t,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:R,"aria-label":j.column(r+1),"aria-describedby":A,"data-widths-label":"",onChange:e=>{null===e||oe(r,e)||q(r,e)},onRevert:e=>((e,r)=>{K.current.locked||null===r||oe(e,r)||q(e,r)})(r,e),onFocus:()=>{ne.current={column:r,share:e,stored:K.current.stored},te(r,!0)},onBlur:()=>te(r,!1),className:`absolute inset-0 text-xs font-medium ${w[r%2]} ${ee.includes(r)&&!n?"opacity-0":""}`})})})})(),r<z-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[r]}%`},children:/* @__PURE__ */m(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:R?-1:0,"aria-orientation":"vertical","aria-label":j.divider(r+1,r+2),"aria-valuenow":D[r],"aria-valuemin":t,"aria-valuemax":D[r]+D[r+1]-t,"aria-valuetext":j.dividerValue(r+1,D[r],r+2,D[r+1]),"aria-disabled":L||void 0,onKeyDown:L?void 0:H(r),onPointerDown:U(r),onPointerMove:W,onPointerUp:X,onPointerCancel:X,onLostPointerCapture:()=>{I.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(L?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(L?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${V===r?"w-1":y}`)})})})})]},r))]}),z>1&&/* @__PURE__ */m("span",{id:A,className:"sr-only",children:ie})]})}export{x as WidthsBar};
@@ -0,0 +1,6 @@
1
+ import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as l,usePopupLevel as t,usePopupLevelBindings as i,windowScrimStyle as a,OverlayLayerProvider as o,scrimHasCorners as n,popupLayerStyle as s,POPUP_GUTTER as d}from"./chunk-VY6OQRZA.js";import{CloseButton as c}from"./chunk-LG6NDTHZ.js";import{useDiscardGuard as m}from"./chunk-4BYJABCX.js";import{dialogA11y as p}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as u}from"./chunk-UVHXVSB2.js";import{useFocusTrap as f,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as x,DESCRIPTION_TEXT as v,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{useHydrated as w}from"./chunk-WCCS4VFE.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as $}from"./chunk-NRHG4R2Q.js";import{useRef as g,useId as N,useState as j,useEffect as k}from"react";import{createPortal as C}from"react-dom";import{jsxs as B,Fragment as V,jsx as W}from"react/jsx-runtime";var H=`calc(100% - ${2*d}px)`,Z="grid grid-cols-[minmax(0,1fr)_auto]",A="bg-black/30 backdrop-blur-sm",D={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl",full:"max-w-none"};function G({open:d,onClose:G,title:T,description:U,role:Y="dialog",children:E,footer:Q,headerActions:R,blocking:_=!1,size:F="md",aside:J=!1,dirty:O=!1,initialFocus:S,"aria-label":X,"aria-labelledby":z,"aria-describedby":I,className:L=""}){const q=g(null),K=N(),M=N(),P=!_,ee="full"===F,re=ee||null!=R,le=Boolean(T||U),te=N();$().dialog;const ie=e(w()),[ae,oe]=j(null),ne=m({open:d,dirty:O,onClose:G,title:T,layer:ae}),se=g(null),de=r(d&&null!==ie,se),ce=l(de,q),me=t(d&&null!==ie,se),pe=i(me,ae),ue=a(me),fe=null!==me.host;if(u(d),f(q,d&&null!==ie,S,pe),h(d),k(()=>{if(d)return y(()=>!pe.current?.(document.activeElement)&&(_||ne(),!0),()=>q.current)},[d,_,ne,pe]),!d||!ie)return null;/* @__PURE__ */
2
+ return B(V,{children:[/* @__PURE__ */W("span",{ref:se,hidden:!0,"data-popup-anchor":""}),C(
3
+ /* @__PURE__ */W(o,{value:ae,children:/* @__PURE__ */B("div",{ref:oe,className:"fixed inset-0"+(J?" pointer-events-none opacity-0":fe?" pointer-events-none":""),style:s(me),role:"presentation","data-overlay-layer":"","data-aside":J?"":void 0,children:[!fe&&/* @__PURE__ */W("div",{className:`fixed inset-0 ${A}`,"aria-hidden":"true","data-popup-scrim":"system"}),ue&&/* @__PURE__ */W("div",{className:`fixed ${A}${J?"":" pointer-events-auto"}${n(me)?" rounded-(--radius-window)":""}`,style:ue,onClick:_?void 0:ne,"aria-hidden":"true","data-popup-scrim":"window"}),
4
+ /* @__PURE__ */W("div",{className:de?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:_||fe?void 0:e=>{e.target===e.currentTarget&&ne()},children:/* @__PURE__ */B("div",{ref:q,"data-popup-panel":"",style:de?{left:ce?.left??0,top:ce?.top??0,visibility:ce?void 0:"hidden",width:H,[ee?"height":"maxHeight"]:H}:void 0,...p({role:Y,modal:!0,titleId:T?te:void 0,labelledBy:z,label:X}),"aria-describedby":I??(U?M:E?K:void 0),className:(ee?`${de?"absolute":"relative h-full w-full max-h-full"} ${D[F]} ${Z} grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-(--radius-popup) ${b}`:`${de?"absolute":"relative max-h-full w-full"} ${D[F]}${re?` ${Z} content-start gap-x-2`:""} overflow-y-auto overscroll-contain rounded-(--radius-card) ${b} p-6`)+`${fe&&!J?" pointer-events-auto":""} ${L}`.trimEnd(),children:[ee?le&&
5
+ /* @__PURE__ */B("div",{className:"col-start-1 row-start-1 flex min-h-(--row-height-window-bar) flex-col justify-center border-b border-line py-2 pl-6 pr-4",children:[T&&/* @__PURE__ */W("h2",{id:te,className:x,children:T}),U&&/* @__PURE__ */W("p",{id:M,className:`${T?"mt-1 ":""}${v}`,children:U})]}):T&&/* @__PURE__ */W("h2",{id:te,className:`${re?"col-start-1 row-start-1 ":P?"pr-8 ":""}${x}`,children:T}),!ee&&U&&/* @__PURE__ */W("p",{id:M,className:`${re?"col-start-1 ":""}${T?"mt-1":P&&!re?"pr-8":""} ${v}`.trim(),children:U}),E&&/* @__PURE__ */W("div",{id:K,className:ee?"col-span-2 row-start-2 min-h-0 overflow-auto":(re?"col-span-2 ":"")+"mt-2 text-sm text-gray-600",children:E}),Q&&/* @__PURE__ */W("div",{className:ee?"col-span-2 row-start-3 flex flex-wrap justify-end gap-3 border-t border-line px-6 py-4":(re?"col-span-2 ":"")+"mt-6 flex flex-wrap justify-end gap-3",children:Q}),re?
6
+ /* @__PURE__ */B("div",{className:"col-start-2 row-start-1 flex items-center gap-1 "+(ee?(le?"border-b border-line ":"")+"pr-3":"-mr-3 -mt-3 self-start"),children:[R,P&&/* @__PURE__ */W(c,{onClose:ne})]}):P&&/* @__PURE__ */W(c,{onClose:ne,className:"absolute right-3 top-3"})]})})]})}),ie)]})}export{G as Dialog};
@@ -1,14 +1,14 @@
1
- import{Dialog as e}from"./chunk-MRZLFZNJ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{useShellStrings as o,splitAround as l}from"./chunk-NRHG4R2Q.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},C=t({variant:"secondary"}),L=t({variant:"primary"}),P="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
2
- return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),F=a(null),E=a(0),T=a([]),$=a(null),R=a(null),Z=u(e=>{F.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),D=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++E.current,options:r,resolve:e};null===F.current?Z(n):T.current.push(n)})},[Z]),[W,H]=c(!1),[J,K]=c({message:""}),[Q,S]=c(""),V=a(),Y=u(e=>(K(e),S(""),H(!0),new Promise(e=>{V.current=e})),[]),[B,G]=c(!1),[I,M]=c({}),[O,U]=c(""),q=a(),z=u(e=>{const r="string"==typeof e?{message:e}:e;return M(r),U(r.defaultValue??""),G(!0),new Promise(e=>{q.current=e})},[]);d(()=>{b=D,y=Y,N=z},[D,Y,z]);const A=(e,r)=>{if(F.current!==e)return;const n=k.current,t=T.current.shift();t?Z(t):(F.current=null,k.current=void 0,i(!1)),n?.(r)},X=e=>{H(!1),S(""),V.current?.(e)},_=e=>{if(e){const e=O.trim();if(!e&&!I.allowEmpty)return G(!1),void q.current?.(null);G(!1),q.current?.(e)}else G(!1),q.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===J.variant?"warning":"danger"],te=J.confirmWord,oe=null==te||Q===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
1
+ import{Dialog as e}from"./chunk-44ERJYNW.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{useShellStrings as o,splitAround as l}from"./chunk-NRHG4R2Q.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},C=t({variant:"secondary"}),P=t({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
2
+ return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function E({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),E=a(null),F=a(0),T=a([]),$=a(null),R=a(null),W=u(e=>{E.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),D=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++F.current,options:r,resolve:e};null===E.current?W(n):T.current.push(n)})},[W]),[Y,H]=c(!1),[J,K]=c({message:""}),[Q,S]=c(""),V=a(),Z=u(e=>(K(e),S(""),H(!0),new Promise(e=>{V.current=e})),[]),[B,G]=c(!1),[I,O]=c({}),[U,q]=c(""),z=a(),A=u(e=>{const r="string"==typeof e?{message:e}:e;return O(r),q(r.defaultValue??""),G(!0),new Promise(e=>{z.current=e})},[]);d(()=>{b=D,y=Z,N=A},[D,Z,A]);const M=(e,r)=>{if(E.current!==e)return;const n=k.current,t=T.current.shift();t?W(t):(E.current=null,k.current=void 0,i(!1)),n?.(r)},X=e=>{H(!1),S(""),V.current?.(e)},_=e=>{if(e){const e=U.trim();if(!e&&!I.allowEmpty)return G(!1),void z.current?.(null);G(!1),z.current?.(e)}else G(!1),z.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===J.variant?"warning":"danger"],te=J.confirmWord,oe=null==te||Q===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
3
3
  return m(p.Provider,{value:D,children:[r,
4
- /* @__PURE__ */h(e,{open:t,onClose:()=>A(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
5
- /* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>A(v,!1),className:C,children:s.cancelLabel||le.cancel}),
6
- /* @__PURE__ */h("button",{type:"button",onClick:()=>A(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
4
+ /* @__PURE__ */h(e,{open:t,onClose:()=>M(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
5
+ /* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>M(v,!1),className:C,children:s.cancelLabel||le.cancel}),
6
+ /* @__PURE__ */h("button",{type:"button",onClick:()=>M(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
7
7
  /* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */h(j,{})}),
8
8
  /* @__PURE__ */m("div",{className:"flex-1",children:[
9
9
  /* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
10
10
  /* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
11
- /* @__PURE__ */h(e,{open:W,onClose:()=>X(!1),initialFocus:null!=te?void 0:R,footer:/* @__PURE__ */m(f,{children:[
11
+ /* @__PURE__ */h(e,{open:Y,onClose:()=>X(!1),initialFocus:null!=te?void 0:R,footer:/* @__PURE__ */m(f,{children:[
12
12
  /* @__PURE__ */h("button",{ref:R,type:"button",onClick:()=>X(!1),className:C,children:J.cancelLabel||le.destructiveCancel}),
13
13
  /* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??J.confirmLabel??le.destructiveConfirm})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
14
14
  /* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
@@ -17,8 +17,8 @@ return m(p.Provider,{value:D,children:[r,
17
17
  /* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:J.message}),null!=te&&/* @__PURE__ */m(f,{children:[
18
18
  /* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
19
19
  /* @__PURE__ */h("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),se]}),
20
- /* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:Q,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Q===te&&X(!0)},placeholder:te,className:`mt-2 ${P} focus:border-red-500`})]})]})]})}),
20
+ /* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:Q,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Q===te&&X(!0)},placeholder:te,className:`mt-2 ${L} focus:border-red-500`})]})]})]})}),
21
21
  /* @__PURE__ */m(e,{open:B,onClose:()=>_(!1),title:I.title||le.promptTitle,footer:/* @__PURE__ */m(f,{children:[
22
22
  /* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:I.cancelLabel||le.cancel}),
23
- /* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!I.allowEmpty&&!O.trim(),className:L,children:I.confirmLabel||le.ok})]}),children:[I.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:I.message}),
24
- /* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:O,onChange:e=>U(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:I.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
23
+ /* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!I.allowEmpty&&!U.trim(),className:P,children:I.confirmLabel||le.ok})]}),children:[I.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:I.message}),
24
+ /* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:U,onChange:e=>q(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:I.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{E as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-RKSCB5BJ.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-D5PXRJHA.js";import{FormField as n}from"./chunk-6KBDNYRW.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Input_default as c}from"./chunk-J5OAQAAD.js";import{Button_default as o}from"./chunk-UTISUEO4.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-RKSCB5BJ.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-D5PXRJHA.js";import{FormField as n}from"./chunk-6KBDNYRW.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Input_default as c}from"./chunk-B5KX7PDG.js";import{Button_default as o}from"./chunk-UTISUEO4.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
2
2
  return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
3
3
  /* @__PURE__ */d("div",{children:[
4
4
  /* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-H2Q7G5D6.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-3ZX5DC2S.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-NRHG4R2Q.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.5.1",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.1",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,C]=a(b.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-VGUB7LPF.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-O5ZBRG2G.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-NRHG4R2Q.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.5.1",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.1",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,G]=a(b.partOf);/* @__PURE__ */
2
2
  return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
4
  /* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
@@ -6,4 +6,4 @@ return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
6
6
  /* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
7
7
  /* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
8
  /* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
9
- /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),C]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
9
+ /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),G]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
@@ -0,0 +1,13 @@
1
+ import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-K5YT5PMJ.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-B5KX7PDG.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-UTISUEO4.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-F2RAIGCG.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as v,MENU_MAX_HEIGHT as w}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as y}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{GLASS_DIVIDER as k,glassStyle as j}from"./chunk-5FYDNH4Y.js";import{useShellStrings as $}from"./chunk-NRHG4R2Q.js";import{useState as N,useId as D,useRef as C,useMemo as S,useEffect as R}from"react";import{createPortal as W}from"react-dom";import{jsxs as M,jsx as A}from"react/jsx-runtime";function E(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var F=["right-2","right-8","right-16"],T=[8,32,64];function Y(Y){const{options:z,placeholder:O,emptyOptionLabel:I,className:L="",disabled:U,id:G,filter:H=!1,allowFreeText:B=!1,freeTextOption:K,onSearchChange:P,loading:V=!1,error:X,onRetry:Z,rightAdornment:J,endAction:Q,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=Y,re=!0===Y.multiple,le=Y.multiple?Y.value:Y.value?[Y.value]:[],oe=Y.multiple?"":Y.value,ie=e=>{Y.multiple?Y.onChange(e):Y.onChange(e[0]??"")},ae=le.length>0,se=H&&ae&&!U,ce=re||H,ue=null!=K,de=B||ue,[he,pe]=N(!1),[me,fe]=N(-1),be=D(),ge=G??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=N(""),ke=$(),je=I??ke.select.none,$e=e=>{xe(e),fe(-1),P?.(e)},Ne=C(null),De=C(null),Ce=C(null),Se=C(null),Re=C(he);Re.current=he;const We=C(!1),Me=e=>{Re.current&&(Re.current=!1,e&&B&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),$e(""))},Ae=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?$e(""):fe(t));ie([e.value]),Me(!1)}},[Ee,Fe]=N(null);y(()=>{if(!J||he)return void Fe(null);const e=Se.current?.offsetWidth??0;Fe(e?e+T[Ue]+6:null)});const Te=v(De,he,ce?{popupRef:Ce}:{matchTriggerWidth:!0}),Ye=S(()=>t(z),[z]),ze=le.join("\0"),Oe=S(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Ye)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[Ye,ze,de]),Ie=Oe.join(", "),Le=_&&ae&&!U,Ue=(Le?1:0)+(Q?1:0),[Ge,He]=N(null),Be=C(null),Ke=C(""),Pe=C(()=>{});Pe.current=()=>{const e=De.current,t=Be.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Oe.join("\0")}`;if(o===Ke.current)return;Ke.current=o;let i=null;r>0&&Oe.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=E(Oe,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),He(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},y(()=>{Pe.current()}),R(()=>{const e=De.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Pe.current());return t.observe(e),()=>t.disconnect()},[re]);const Ve=Oe.length,Xe=!re||!Ge||Ge.shown>=Ve?Ie:0===Ge.shown?ke.select.selectedCount(Ve):`${Oe.slice(0,Ge.shown).join(", ")} +${Ve-Ge.shown}`,Ze=re&&null!==Ge&&(Ge.shown<Ve||Ge.cut),Je=he&&ae&&ce;R(()=>{if(!he)return;const e=e=>{const t=e.target;Ne.current?.contains(t)||Ce.current?.contains(t)||Me(!0)};document.addEventListener("mousedown",e);const t=b(()=>Me(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,B,ye,ze,Y.onChange]),R(()=>{if(he)return x(e=>!("Escape"!==e.key||!Re.current)&&(Me(!1),De.current?.blur(),!0),()=>Ce.current)},[he]);const Qe=S(()=>{const e=/* @__PURE__ */new Set;return n(z,t=>!e.has(t.value)&&(e.add(t.value),!0))},[z]),qe=S(()=>{if(P)return Qe;const e=ye.trim().toLowerCase();return e?n(Qe,t=>r(t,e)):Qe},[Qe,ye,P]),_e=S(()=>t(qe),[qe]),et=ye.trim(),tt=S(()=>ue&&et?Ye.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,Ye,ze]),nt=S(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
2
+ return M("div",{ref:Ne,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Ne.current?.contains(t)||Ce.current?.contains(t))||We.current||document.activeElement!==De.current&&Me(!0)},children:[(rt=/* @__PURE__ */A("input",{id:ge,ref:De,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Xe,onChange:e=>{$e(e.target.value),pe(!0)},onFocus:()=>{U||($e(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(U)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Ae(nt[me],me):1!==_e.length||_e[0].disabled?B&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),$e("")):(ie([et]),Me(!1),De.current?.blur())):Ae(_e[0],0)):"Escape"===t.key?(Me(!1),De.current?.blur()):"Tab"===t.key&&Me(!0)},placeholder:Je?Xe:O||je,className:`${se?u:d} ${L} ${a[Ue]}${U?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Je?" rosh-field-shows-choice":""}`,style:Ee?{paddingRight:Ee}:void 0,disabled:U}),re?/* @__PURE__ */A(f,{content:!he&&Ze?Ie:null,className:"block",children:rt}):rt),re&&
3
+ /* @__PURE__ */A("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */A("span",{ref:Be,className:"whitespace-pre"})}),Ue>0&&
4
+ /* @__PURE__ */M(s,{children:[Le&&
5
+ /* @__PURE__ */A("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */A(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */A(p,{name:"close"}),onClick:()=>{ie([]),Me(!1)}}})}),Q&&/* @__PURE__ */A("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */A(c,{action:Q})})]}),J&&!he&&/* @__PURE__ */A("div",{ref:Se,className:`absolute top-1/2 -translate-y-1/2 ${F[Ue]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:J}),he&&W(
6
+ /* @__PURE__ */M("div",{ref:Ce,onMouseDownCapture:()=>{We.current=!0,setTimeout(()=>{We.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:g.popup,left:Te?.left,right:Te?.right,top:Te?.top,bottom:Te?.bottom,minWidth:Te?.minWidth,width:Te?.width,...ce&&{maxWidth:Te?.maxWidth},visibility:Te?void 0:"hidden",...j()},children:[re&&ae&&_&&!U&&
7
+ /* @__PURE__ */A("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${k}`,children:ke.select.clearAll}),V?
8
+ /* @__PURE__ */A(m,{size:"sm",padding:"py-2",label:ke.search.searching}):X?/* @__PURE__ */M("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
9
+ /* @__PURE__ */A("span",{className:"min-w-0 flex-1",children:X}),Z&&/* @__PURE__ */A(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:Z,className:"shrink-0",children:ke.list.retry})]}):null,
10
+ /* @__PURE__ */M("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:Te?.maxHeight??w},children:[0===nt.length?V||X?null:/* @__PURE__ */A("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
11
+ return M("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Ae(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */A(o,{selected:n}),
12
+ /* @__PURE__ */A("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */A(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&K&&
13
+ /* @__PURE__ */A("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Ae(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${k}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:K(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{Y as SearchableSelect,E as fitChoice};
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-3ZX5DC2S.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,D=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,W=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Q=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(X,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Q.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(X,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;_(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(D,"[url]").replace(V,"[id]").replace(W,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
1
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-O5ZBRG2G.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},R=[200,500],F=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,R,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,R,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var O=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,U=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,G=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,W=/\d{4,}/g,D=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&U.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(D,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&O.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;_(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),F(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(G,"[url]").replace(V,"[id]").replace(W,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
@@ -1,5 +1,5 @@
1
- import{IconButton_default as e}from"./chunk-NWS5G7FE.js";import{inputClasses as r,PLACEHOLDER_INK as n}from"./chunk-AYZY3YNC.js";import{DropdownMenu as t}from"./chunk-EX3DARI3.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as s}from"react";import{jsx as o,jsxs as l}from"react/jsx-runtime";var c={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},m={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function p({children:e}){/* @__PURE__ */
1
+ import{inputClasses as e,PLACEHOLDER_INK as r}from"./chunk-AYZY3YNC.js";import{DropdownMenu as n}from"./chunk-EX3DARI3.js";import{IconButton_default as t}from"./chunk-NWS5G7FE.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as s}from"react";import{jsx as o,jsxs as l}from"react/jsx-runtime";var c={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},m={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function p({children:e}){/* @__PURE__ */
2
2
  return o("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-1",children:e})}function d({action:e,size:r="md"}){/* @__PURE__ */
3
- return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:r,size:n}){const{label:s,icon:l,onClick:c,menu:m}=r;/* @__PURE__ */
4
- return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(t,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:n})}):/* @__PURE__ */o(e,{"aria-label":s,size:n,onClick:c,children:l})})}var f=s(function({invalid:e,leftIcon:t,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",N=`${t?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),v=
5
- /* @__PURE__ */o("input",{ref:f,"aria-invalid":e||void 0,readOnly:u,className:r({invalid:e,size:s,readOnly:u,className:[N,c].filter(Boolean).join(" ")}),...h});return t||i||a?/* @__PURE__ */l("div",{className:"relative",children:[t&&/* @__PURE__ */o("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${n}`,children:t}),v,a?/* @__PURE__ */o(p,{children:/* @__PURE__ */o(d,{action:a,size:g})}):i&&/* @__PURE__ */o("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:i})]}):v});export{u as END_ACTIONS_PAD,c as INPUT_END_ACTION_SIZE,d as InputEndActionButton,p as InputEndActionSlot,f as Input_default};
3
+ return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:e,size:r}){const{label:s,icon:l,onClick:c,menu:m}=e;/* @__PURE__ */
4
+ return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(n,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:r})}):/* @__PURE__ */o(t,{"aria-label":s,size:r,onClick:c,children:l})})}var f=s(function({invalid:n,leftIcon:t,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",N=`${t?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),v=
5
+ /* @__PURE__ */o("input",{ref:f,"aria-invalid":n||void 0,readOnly:u,className:e({invalid:n,size:s,readOnly:u,className:[N,c].filter(Boolean).join(" ")}),...h});return t||i||a?/* @__PURE__ */l("div",{className:"relative",children:[t&&/* @__PURE__ */o("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${r}`,children:t}),v,a?/* @__PURE__ */o(p,{children:/* @__PURE__ */o(d,{action:a,size:g})}):i&&/* @__PURE__ */o("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:i})]}):v});export{u as END_ACTIONS_PAD,c as INPUT_END_ACTION_SIZE,d as InputEndActionButton,p as InputEndActionSlot,f as Input_default};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-J5OAQAAD.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
1
+ import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-B5KX7PDG.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
2
2
  return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
3
3
  /* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
4
4
  /* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
@@ -1,3 +1,3 @@
1
- import{IconPicker as e}from"./chunk-GZRNOIEE.js";import{ColorPicker as t}from"./chunk-F3EBYHIE.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-QPVYBN4J.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:x=1,readOnly:j,units:S}){const k=e=>"number"==typeof m[e]?m[e]:null,O=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},E=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:x,...l(x),steppers:"compact",readOnly:j,placeholder:i,prefix:o,suffix:w.unit,units:S,"aria-label":t})}),C=d.map(k),I="number"==typeof m.width?m.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,B=null===I&&C.some(e=>null!==e),H=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",J=e=>k(e)??("number"==typeof m.width?m.width:null),P=m.style??f.style;/* @__PURE__ */
2
- return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[E("left",w.sides.left,u.left,J("left"),String(f.sides.left),e=>O("left",e)),E("top",w.sides.top,u.top,J("top"),String(f.sides.top),e=>O("top",e)),E("right",w.sides.right,u.right,J("right"),String(f.sides.right),e=>O("right",e)),E("bottom",w.sides.bottom,u.bottom,J("bottom"),String(f.sides.bottom),e=>O("bottom",e))]}):E("all",w.width,u.all,I,B?"–":H,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:P,disabled:j,onChange:e=>{j||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
3
- /* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{j||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:j})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
1
+ import{IconPicker as e}from"./chunk-GZRNOIEE.js";import{ColorPicker as t}from"./chunk-S5MTTJ3F.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-VLBLDSA6.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:S=1,readOnly:x,units:j}){const k=e=>"number"==typeof m[e]?m[e]:null,O=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},C=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:S,...l(S),steppers:"compact",readOnly:x,placeholder:i,prefix:o,suffix:w.unit,units:j,"aria-label":t})}),E=d.map(k),I="number"==typeof m.width?m.width:E.every(e=>null!==e&&e===E[0])?E[0]:null,T=null===I&&E.some(e=>null!==e),D=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",J=e=>k(e)??("number"==typeof m.width?m.width:null),L=m.style??f.style;/* @__PURE__ */
2
+ return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[C("left",w.sides.left,u.left,J("left"),String(f.sides.left),e=>O("left",e)),C("top",w.sides.top,u.top,J("top"),String(f.sides.top),e=>O("top",e)),C("right",w.sides.right,u.right,J("right"),String(f.sides.right),e=>O("right",e)),C("bottom",w.sides.bottom,u.bottom,J("bottom"),String(f.sides.bottom),e=>O("bottom",e))]}):C("all",w.width,u.all,I,T?"–":D,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:L,disabled:x,onChange:e=>{x||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
3
+ /* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{x||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:x})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-MCLVTQSF.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{Input_default as a}from"./chunk-J5OAQAAD.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-MCLVTQSF.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{Input_default as a}from"./chunk-B5KX7PDG.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
2
2
  return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
3
3
  /* @__PURE__ */n(t,{name:e.name,status:e.status}),
4
4
  /* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
@@ -0,0 +1,8 @@
1
+ import{useOverlayTarget as e,usePopupAnchor as i,usePopupLevel as t,usePopupLevelBindings as r,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as d}from"./chunk-VY6OQRZA.js";import{CloseButton as s}from"./chunk-LG6NDTHZ.js";import{useDiscardGuard as a}from"./chunk-4BYJABCX.js";import{dialogA11y as m}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-UVHXVSB2.js";import{useFocusTrap as p,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as u,DESCRIPTION_TEXT as f,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{useHydrated as y}from"./chunk-WCCS4VFE.js";import{registerModalEscapeInterceptor as v}from"./chunk-TWVUQUUD.js";import{useRef as x,useId as w,useState as g,useEffect as k}from"react";import{createPortal as j}from"react-dom";import{jsxs as N,Fragment as C,jsx as W}from"react/jsx-runtime";var B={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},V={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function H(e,i){const t=window.innerHeight-(i.top+i.height);if("bottom"===e)return{left:i.left,width:i.width,bottom:t};const r={top:i.top,height:i.height};return"left"===e?{...r,left:i.left}:{...r,right:window.innerWidth-(i.left+i.width)}}function Z({open:Z,onClose:$,side:D="right",size:U="md",title:Y,description:A,footer:G,children:T,blocking:z=!1,dirty:E=!1,initialFocus:F,"aria-label":J,"aria-labelledby":O,"aria-describedby":Q,className:S=""}){const X=x(null),I=w(),L=w(),R=w(),q=e(y()),[K,M]=g(null),P=a({open:Z,dirty:E,onClose:$,title:Y,layer:K}),_=x(null),ee=i(Z&&null!==q,_),ie=t(Z&&null!==q,_),te=r(ie,K),re=o(ie),oe=null!==ie.host;if(c(Z),p(X,Z&&null!==q,F,te),h(Z),k(()=>{if(Z)return v(()=>!te.current?.(document.activeElement)&&(z||P(),!0),()=>X.current)},[Z,z,P,te]),!Z||!q)return null;const ne="bottom"===D,le={...ne?{maxHeight:"85vh"}:{},...ee?H(D,ee):{}};/* @__PURE__ */
2
+ return N(C,{children:[/* @__PURE__ */W("span",{ref:_,hidden:!0,"data-popup-anchor":""}),j(
3
+ /* @__PURE__ */W(n,{value:K,children:/* @__PURE__ */N("div",{ref:M,className:oe?"fixed inset-0 pointer-events-none":"fixed inset-0",style:d(ie),role:"presentation","data-overlay-layer":"",children:[
4
+ /* @__PURE__ */W("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(oe?"pointer-events-auto"+(l(ie)?" rounded-(--radius-window)":""):"inset-0"),style:re??void 0,hidden:oe&&!re,onClick:z?void 0:P,"aria-hidden":"true","data-popup-scrim":oe?"window":"system"}),
5
+ /* @__PURE__ */N("div",{ref:X,...m({modal:!0,titleId:Y?R:void 0,labelledBy:O,label:J}),"aria-describedby":Q??(A?L:T?I:void 0),"data-drawer-side":D,"data-popup-panel":"",style:le,className:[`fixed flex flex-col ${b}`,oe?"pointer-events-auto":"",ne?"":`w-full max-w-full ${B[U]}`,ee?"":V[D],ne?"rounded-t-xl":"",S].filter(Boolean).join(" "),children:[Y?/* @__PURE__ */N("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
6
+ /* @__PURE__ */N("div",{className:"min-w-0",children:[
7
+ /* @__PURE__ */W("h2",{id:R,className:u,children:Y}),A&&/* @__PURE__ */W("p",{id:L,className:`mt-0.5 ${f}`,children:A})]}),!z&&/* @__PURE__ */W(s,{onClose:P})]}):!z&&/* @__PURE__ */W("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */W(s,{onClose:P})}),
8
+ /* @__PURE__ */N("div",{id:I,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[A&&!Y&&/* @__PURE__ */W("p",{id:L,className:`mb-3 ${f} ${z?"":"pr-8"}`.trim(),children:A}),T]}),G&&/* @__PURE__ */W("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:G})]})]})}),q)]})}export{Z as Drawer};
@@ -1,2 +1,2 @@
1
- import{Input_default as e}from"./chunk-J5OAQAAD.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
1
+ import{Input_default as e}from"./chunk-B5KX7PDG.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
2
2
  return o(e,{size:"sm",autoFocus:!0,"aria-label":a,value:l,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),p(l.trim()||n)):"Escape"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(l.trim()||n),onClick:e=>e.stopPropagation()})}export{n as RenameField};
@@ -1,9 +1,9 @@
1
- import{CountBadge as e}from"./chunk-PFOTEDSQ.js";import{SettingRowNameContext as i,SettingAutoContext as n}from"./chunk-2NMW66P5.js";import{isShown as a}from"./chunk-HCP7WOAL.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:T,className:A=""}){const F=t();if(!a(j,P,T))return null;const W="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:F.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
1
+ import{CountBadge as e}from"./chunk-PFOTEDSQ.js";import{isShown as i}from"./chunk-HCP7WOAL.js";import{SettingRowNameContext as n,SettingAutoContext as a}from"./chunk-2NMW66P5.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:T,className:A=""}){const F=t();if(!i(j,P,T))return null;const W="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:F.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
2
2
  /* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
3
- /* @__PURE__ */s("span",{className:"sr-only",children:F.settingView.edited})]}):null,H=null!=f&&!1!==f;if("compact"===k){const e=m(u),a=m(h);if(!e&&!a)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),A&&c.push(A);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
4
- /* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),W]}),y=e=>/* @__PURE__ */s(i.Provider,{value:t,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
3
+ /* @__PURE__ */s("span",{className:"sr-only",children:F.settingView.edited})]}):null,H=null!=f&&!1!==f;if("compact"===k){const e=m(u),i=m(h);if(!e&&!i)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),A&&c.push(A);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
4
+ /* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),W]}),y=e=>/* @__PURE__ */s(n.Provider,{value:t,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
5
5
  return r("div",{className:c.join(" "),children:[
6
- /* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),H&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),a&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const I=c,O=void 0!==u||void 0===N&&null==h,Q=null==u||""===u,R=y?"text-gray-500":"text-gray-800",S=Q?"text-gray-400":y?"text-gray-500":"text-gray-900",V=`${I.text} font-medium ${R}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:V,children:l}):/* @__PURE__ */s("span",{id:g,className:V,children:l}),z=/* @__PURE__ */s(i.Provider,{value:g,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:Q?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",I.pad,A].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${I.bodyTop} border-t border-line-subtle ${I.bodyPad}`,children:N});/* @__PURE__ */
6
+ /* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),H&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),i&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const I=c,O=void 0!==u||void 0===N&&null==h,Q=null==u||""===u,R=y?"text-gray-500":"text-gray-800",S=Q?"text-gray-400":y?"text-gray-500":"text-gray-900",V=`${I.text} font-medium ${R}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:V,children:l}):/* @__PURE__ */s("span",{id:g,className:V,children:l}),z=/* @__PURE__ */s(n.Provider,{value:g,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:Q?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",I.pad,A].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${I.bodyTop} border-t border-line-subtle ${I.bodyPad}`,children:N});/* @__PURE__ */
7
7
  return r("div",H?{className:B,children:[
8
8
  /* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
9
9
  /* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${R}`,children:[null!=o&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,W]})}),
@@ -1,23 +1,23 @@
1
- import{Calendar as e}from"./chunk-RFWBNKKB.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-J5OAQAAD.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as b}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as x}from"./chunk-ZDXRSY2Y.js";import{buttonClasses as v}from"./chunk-UQYNPYF4.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as N,useShellLocale as w}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as C,useId as j,useEffect as D}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as $,jsx as Y}from"react/jsx-runtime";var F=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],R=d;function S(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function O(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function A(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var H=/* @__PURE__ */new Map;function B({from:d,to:u,onChange:h,formatDisplay:R,clearable:B,required:I=!1,name:L,id:T,"aria-labelledby":V,"aria-label":E,weekStartsOn:G,placeholder:K,fullWidth:P=!1,min:Q,max:U,disabled:q=!1,allowOpenEnd:J=!1}){const Z=N().dateRange,X=w(),z=R??(X?function(e){let t=H.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),H.set(e,t));const r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(X):A),_=K??Z.placeholder,ee=B??!I,[te,re]=k(!1),[ne,ae]=k(d),[oe,ie]=k(u),[le,se]=k(null),[ce,de]=k("from"),me=C(null),ue=C(null),he=C(null),pe=j(),fe=j(),ge=j(),[be,xe]=k(!1),ve=b(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=C(null),Ne=C(null),[we,ke]=k(!0);x(()=>{const e=Ne.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==we&&ke(o)});const Ce=C(null);x(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[je,De]=k(!1);x(()=>{const e=!!T&&(ue.current?.labels?.length??0)>0;e!==je&&De(e)});const Me=!!E||!!V||je,We=m(s())??/* @__PURE__ */new Date(0),[$e,Ye]=k(()=>d?d.slice(0,7):O(We,Q,U)),Fe=F.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(S(e,We),Q,U)),Re=e=>e?z(e):"";D(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),D(()=>{q&&re(!1)},[q]);const Se=()=>{h("",""),re(!1)},Oe=ee&&!q&&Boolean(d||u),Ae=d&&u?`${Re(d)} — ${Re(u)}`:d?Z.fromOnly(Re(d)):u?Z.toOnly(Re(u)):"",He=c(X),Be=e=>{const t=m(e);return t?He.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ie=d&&u?Z.range(Be(d),Be(u)):d?Z.fromOnly(Be(d)):u?Z.toOnly(Be(u)):_,Le=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Te=/* @__PURE__ */W($,{children:[Fe.map(e=>/* @__PURE__ */Y("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=S(e,We);ae(t.from),ie(t.to),se(e),Ye(t.from.slice(0,7))})(e),className:Le(e),"aria-label":be?Z[e]:void 0,children:be?we?Z[e]:Z[`${e}Short`]:Z[e]},e)),
2
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:Le("Custom"),children:Z.custom})]}),Ve=(e,t)=>J?/* @__PURE__ */Y("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Y("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ee=e=>J&&ce===e?" ring-1 ring-blue-400":"",Ge=
3
- /* @__PURE__ */Y(e,{mode:"range",min:Q,max:U,value:ne||null,endValue:oe||null,month:$e,onMonthChange:Ye,onSelect:e=>{se("Custom"),J?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:G,"aria-label":Z.dialog});/* @__PURE__ */
4
- return W("div",{className:"relative"+(P?" w-full":""),ref:me,children:[
5
- /* @__PURE__ */W("div",{className:`relative ${P?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Oe?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${q?" cursor-not-allowed opacity-60":""}`,children:[
6
- /* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{q||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),Ye(d?d.slice(0,7):O(We,Q,U)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:T,disabled:q||void 0,"aria-label":E,"aria-labelledby":V,"aria-describedby":[Me?fe:void 0,I?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(P?" min-w-0 flex-1 justify-start":""),children:[
1
+ import{Calendar as e}from"./chunk-RFWBNKKB.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-B5KX7PDG.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as b}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as x}from"./chunk-ZDXRSY2Y.js";import{buttonClasses as v}from"./chunk-UQYNPYF4.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as N,useShellLocale as w}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as C,useId as j,useEffect as D}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as $,jsx as Y}from"react/jsx-runtime";var F=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],R=d;function S(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function H(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function O(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var B=/* @__PURE__ */new Map;function A({from:d,to:u,onChange:h,formatDisplay:R,clearable:A,required:G=!1,name:I,id:K,"aria-labelledby":L,"aria-label":P,weekStartsOn:T,placeholder:V,fullWidth:E=!1,min:U,max:q,disabled:Q=!1,allowOpenEnd:X=!1}){const Z=N().dateRange,J=w(),z=R??(J?function(e){let t=B.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),B.set(e,t));const r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(J):O),_=V??Z.placeholder,ee=A??!G,[te,re]=k(!1),[ne,ae]=k(d),[oe,ie]=k(u),[le,se]=k(null),[ce,de]=k("from"),me=C(null),ue=C(null),he=C(null),pe=j(),fe=j(),ge=j(),[be,xe]=k(!1),ve=b(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=C(null),Ne=C(null),[we,ke]=k(!0);x(()=>{const e=Ne.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==we&&ke(o)});const Ce=C(null);x(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[je,De]=k(!1);x(()=>{const e=!!K&&(ue.current?.labels?.length??0)>0;e!==je&&De(e)});const Me=!!P||!!L||je,We=m(s())??/* @__PURE__ */new Date(0),[$e,Ye]=k(()=>d?d.slice(0,7):H(We,U,q)),Fe=F.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(S(e,We),U,q)),Re=e=>e?z(e):"";D(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),D(()=>{Q&&re(!1)},[Q]);const Se=()=>{h("",""),re(!1)},He=ee&&!Q&&Boolean(d||u),Oe=d&&u?`${Re(d)} — ${Re(u)}`:d?Z.fromOnly(Re(d)):u?Z.toOnly(Re(u)):"",Be=c(J),Ae=e=>{const t=m(e);return t?Be.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ge=d&&u?Z.range(Ae(d),Ae(u)):d?Z.fromOnly(Ae(d)):u?Z.toOnly(Ae(u)):_,Ie=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ke=/* @__PURE__ */W($,{children:[Fe.map(e=>/* @__PURE__ */Y("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=S(e,We);ae(t.from),ie(t.to),se(e),Ye(t.from.slice(0,7))})(e),className:Ie(e),"aria-label":be?Z[e]:void 0,children:be?we?Z[e]:Z[`${e}Short`]:Z[e]},e)),
2
+ /* @__PURE__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:Ie("Custom"),children:Z.custom})]}),Le=(e,t)=>X?/* @__PURE__ */Y("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Y("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Pe=e=>X&&ce===e?" ring-1 ring-blue-400":"",Te=
3
+ /* @__PURE__ */Y(e,{mode:"range",min:U,max:q,value:ne||null,endValue:oe||null,month:$e,onMonthChange:Ye,onSelect:e=>{se("Custom"),X?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:T,"aria-label":Z.dialog});/* @__PURE__ */
4
+ return W("div",{className:"relative"+(E?" w-full":""),ref:me,children:[
5
+ /* @__PURE__ */W("div",{className:`relative ${E?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${He?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${Q?" cursor-not-allowed opacity-60":""}`,children:[
6
+ /* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{Q||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),Ye(d?d.slice(0,7):H(We,U,q)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:K,disabled:Q||void 0,"aria-label":P,"aria-labelledby":L,"aria-describedby":[Me?fe:void 0,G?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(E?" min-w-0 flex-1 justify-start":""),children:[
7
7
  /* @__PURE__ */Y(p,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
- /* @__PURE__ */Y("span",{className:"truncate",children:Ae||_})]}),Oe&&/* @__PURE__ */Y(n,{children:/* @__PURE__ */Y(a,{action:{label:Z.clearRange,icon:/* @__PURE__ */Y(p,{name:"close"}),onClick:Se}})})]}),Me&&/* @__PURE__ */Y("span",{id:fe,className:"sr-only",children:Ie}),I&&/* @__PURE__ */Y("span",{id:ge,className:"sr-only",children:Z.required}),L&&/* @__PURE__ */W($,{children:[
9
- /* @__PURE__ */Y("input",{type:"hidden",name:L.from,value:d,disabled:q||void 0}),
10
- /* @__PURE__ */Y("input",{type:"hidden",name:L.to,value:u,disabled:q||void 0})]}),te&&M(
8
+ /* @__PURE__ */Y("span",{className:"truncate",children:Oe||_})]}),He&&/* @__PURE__ */Y(n,{children:/* @__PURE__ */Y(a,{action:{label:Z.clearRange,icon:/* @__PURE__ */Y(p,{name:"close"}),onClick:Se}})})]}),Me&&/* @__PURE__ */Y("span",{id:fe,className:"sr-only",children:Ge}),G&&/* @__PURE__ */Y("span",{id:ge,className:"sr-only",children:Z.required}),I&&/* @__PURE__ */W($,{children:[
9
+ /* @__PURE__ */Y("input",{type:"hidden",name:I.from,value:d,disabled:Q||void 0}),
10
+ /* @__PURE__ */Y("input",{type:"hidden",name:I.to,value:u,disabled:Q||void 0})]}),te&&M(
11
11
  /* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":Z.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:g.popup,left:ve?.left,right:ve?.right,top:ve?.top,bottom:ve?.bottom,width:be&&ve?ve.maxWidth:"max-content",maxWidth:ve?.maxWidth,maxHeight:ve?.maxHeight,overflowY:"auto",visibility:ve?void 0:"hidden",...y()},children:[
12
- /* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ve("from",/* @__PURE__ */W($,{children:[
12
+ /* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Le("from",/* @__PURE__ */W($,{children:[
13
13
  /* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:Z.from}),
14
- /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ee("from")}`,children:ne?Re(ne):Z.start})]})),!be&&/* @__PURE__ */Y("span",{className:"text-gray-300",children:"—"}),Ve("to",/* @__PURE__ */W($,{children:[
14
+ /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Pe("from")}`,children:ne?Re(ne):Z.start})]})),!be&&/* @__PURE__ */Y("span",{className:"text-gray-300",children:"—"}),Le("to",/* @__PURE__ */W($,{children:[
15
15
  /* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:Z.to}),
16
- /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ee("to")}`,children:oe?Re(oe):Z.end})]}))]}),be?/* @__PURE__ */W($,{children:[Fe.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!we&&/* @__PURE__ */Y("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:Z.lastHeading}),
17
- /* @__PURE__ */W("div",{ref:Ne,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Te,Fe.map(e=>/* @__PURE__ */Y("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:Z[e]},e))]})]}),
18
- /* @__PURE__ */Y("div",{className:"w-full",children:Ge})]}):
16
+ /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Pe("to")}`,children:oe?Re(oe):Z.end})]}))]}),be?/* @__PURE__ */W($,{children:[Fe.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!we&&/* @__PURE__ */Y("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:Z.lastHeading}),
17
+ /* @__PURE__ */W("div",{ref:Ne,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ke,Fe.map(e=>/* @__PURE__ */Y("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:Z[e]},e))]})]}),
18
+ /* @__PURE__ */Y("div",{className:"w-full",children:Te})]}):
19
19
  /* @__PURE__ */W("div",{ref:ye,className:"flex w-max gap-4",children:[
20
- /* @__PURE__ */Y("div",{className:"w-64",children:Ge}),Fe.length>0&&/* @__PURE__ */Y("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Te})]}),
20
+ /* @__PURE__ */Y("div",{className:"w-64",children:Te}),Fe.length>0&&/* @__PURE__ */Y("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ke})]}),
21
21
  /* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */Y("button",{type:"button",onClick:Se,className:v({variant:"ghost"}),children:Z.clear}),
22
22
  /* @__PURE__ */Y("button",{type:"button",onClick:()=>re(!1),className:v({variant:"secondary"}),children:Z.cancel}),
23
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:J?!ne&&!oe:!ne||!oe,className:v({variant:"primary"}),children:Z.apply})]})]}),document.body)]})}export{B as DateRangePicker,S as presetRange,R as toISODate};
23
+ /* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:X?!ne&&!oe:!ne||!oe,className:v({variant:"primary"}),children:Z.apply})]})]}),document.body)]})}export{A as DateRangePicker,S as presetRange,R as toISODate};
@@ -0,0 +1,2 @@
1
+ import{IconButton_default as o}from"./chunk-NWS5G7FE.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as e}from"./chunk-NRHG4R2Q.js";import{jsx as a}from"react/jsx-runtime";function s({onClose:s,className:i,label:t}){const n=e().dialog;/* @__PURE__ */
2
+ return a(o,{variant:"ghost",onClick:s,"aria-label":t??n.close,className:i,children:/* @__PURE__ */a(r,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})})}export{s as CloseButton};
@@ -1,6 +1,6 @@
1
- import{InputNumber_default as e}from"./chunk-QPVYBN4J.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{createContext as o,useState as l,useMemo as a,useId as u,useRef as s,useEffect as c,useContext as d}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";var p=(e,t,n)=>Math.min(n,Math.max(t,e));function h(e){const t=String(e),n=/e-(\d+)$/.exec(t);return n?Number(n[1]):t.split(".")[1]?.length??0}var x={sm:{left:10,plain:8,unit:40,text:"text-xs"},md:{left:14,plain:12,unit:40,text:"text-sm"}},v={"--rosh-slider-gap":"var(--space-12)","--rosh-slider-floor":"4rem"},b={position:"absolute",left:0,top:0,width:"max-content",height:0,overflow:"hidden",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre"},g={display:"block",width:"max-content"},y=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function w(e){return Math.max(1,...e.map(e=>[...e??""].reduce((e,t)=>e+(y.test(t)?2:1),0)))}function S(e,t,n,r){return Number(p(e,t,n).toFixed(r))}var F=o(null);function z({children:e}){const[t,n]=l({}),r=a(()=>(e,t)=>n(n=>{if(null===t){if(!(e in n))return n;const t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}}),[]),i=a(()=>{const e=Object.values(t);return{set:r,width:e.length?`max(${e.join(", ")})`:null}},[t,r]);/* @__PURE__ */
2
- return f(F.Provider,{value:i,children:e})}function N({value:o,onChange:a,min:y,max:z,step:N=1,shiftStep:k,precision:R,inputMin:L,inputMax:j,suffix:C,units:E,onCommit:$,showInput:B=!0,emptyLabel:K,placeholderValue:M,stepFrom:A,label:W,"aria-labelledby":D,valueText:O,id:P,disabled:V,size:q="md",boxSize:H="sm",className:G="",auto:I}){const U=i(),Y=u(),Q=s(o);r(()=>{Q.current=o},[o]);const T=s(o),J=e=>{Q.current=e,a(e)},X=()=>{T.current=Q.current},Z=()=>{$&&Q.current!==T.current&&(T.current=Q.current,$(Q.current))},_=s(null),ee=s(Z);ee.current=Z;const te=Boolean($);c(()=>{const e=_.current;if(!te||!e)return;const t=()=>ee.current();return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[te]);const ne=t(),re=I??ne,ie=u(),oe=P??Y,le=R??h(N),ae=L??y,ue=j??z,se=void 0!==K||void 0!==M,ce=A??M,de=p(o??M??y,y,z),fe=[y.toFixed(le),z.toFixed(le),o?.toFixed(le),K,M?.toFixed(le)],me=null!=o?o.toFixed(le):K||(null!=M?M.toFixed(le):void 0),pe=s(null),he=s(null),[xe,ve]=l(null),be=s(null),ge=Boolean(C);r(()=>{if(!B)return;const e=()=>{const e=pe.current?.querySelector("input"),t=he.current;if(!e||!t)return;const n=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,t)=>e+(parseFloat(n[t])||0),0);if(r<=0)return;Object.assign(t.style,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,fontVariantNumeric:n.fontVariantNumeric,letterSpacing:n.letterSpacing});const i=Math.ceil(t.getBoundingClientRect().width);if(i<=0)return;const o=t.querySelector("[data-shown]"),l=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),a=!!o&&o.getBoundingClientRect().width>l+.5,u=be.current;if(be.current={box:u?.box??{frame:r,fontSize:n.fontSize,text:i,cut:a},room:l},u&&u.box.frame===r&&u.box.fontSize===n.fontSize&&u.box.text===i&&u.box.cut===a)return;const s={frame:r,fontSize:n.fontSize,text:i,cut:a};be.current={box:s,room:l},ve(s)};e(),window.addEventListener("resize",e);const t="undefined"!=typeof document?document.fonts:void 0;t?.addEventListener?.("loadingdone",e);let n=null;if("undefined"!=typeof ResizeObserver){n=new ResizeObserver(()=>e());const t=pe.current?.querySelector("input");t&&n.observe(t),he.current&&n.observe(he.current)}return()=>{window.removeEventListener("resize",e),t?.removeEventListener?.("loadingdone",e),n?.disconnect()}},[ge,B,H]),r(()=>{const e=be.current;if(!e)return;const t=e.box.text<=e.room+.5?null:he.current?.querySelector("[data-shown]"),n=!!t&&t.getBoundingClientRect().width>e.room+.5;if(n===e.box.cut)return;const r={...e.box,cut:n};be.current={box:r,room:e.room},ve(r)},[me]);const ye=e=>O?O(e):"string"==typeof C?`${e.toFixed(le)} ${C}`:void 0,we=null==o?K??(null!=M?ye(M)??String(M):void 0):ye(o),Se=x[H],Fe=fe.filter(e=>Boolean(e)),ze=void 0===me?-1:Fe.indexOf(me),Ne=xe?`${xe.text+xe.frame+2}px`:`calc(${w(fe)}ch + ${Se.left+(ge?Se.unit:Se.plain)+2}px)`,ke=d(F),Re=u(),Le=ke?.set;return r(()=>{Le&&Le(Re,B?Ne:null)},[Le,Re,Ne,B]),c(()=>()=>Le?.(Re,null),[Le,Re]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${G}`.trim(),style:v,children:[
3
- /* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:z,step:N,value:de,disabled:V,"aria-label":D?void 0:W,"aria-labelledby":D,"aria-valuetext":we,"aria-describedby":re?ie: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 n=e.shiftKey&&null!=k;if(!n&&!(null==o&&null!=ce))return;e.preventDefault();J(S((o??ce??de)+t*(n?k??N:N),y,z,le)),Z()},ref:_,onFocus:$&&X,onPointerDown:$&&X,onChange:e=>J(S(Number(e.target.value),y,z,le)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===q?"h-1":"h-1.5")}),B&&
4
- /* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:$&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&Z()}),onFocus:$&&X,className:`relative min-w-0 max-w-full shrink-0 ${Se.text}`,style:{position:"relative",width:ke?.width??Ne,...xe?{fontSize:xe.fontSize}:{}},children:[
1
+ import{InputNumber_default as e}from"./chunk-VLBLDSA6.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{createContext as o,useState as l,useMemo as a,useId as u,useRef as s,useEffect as c,useContext as d}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";var p=(e,t,n)=>Math.min(n,Math.max(t,e));function h(e){const t=String(e),n=/e-(\d+)$/.exec(t);return n?Number(n[1]):t.split(".")[1]?.length??0}var x={sm:{left:10,plain:8,unit:40,text:"text-xs"},md:{left:14,plain:12,unit:40,text:"text-sm"}},v={"--rosh-slider-gap":"var(--space-12)","--rosh-slider-floor":"4rem"},b={position:"absolute",left:0,top:0,width:"max-content",height:0,overflow:"hidden",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre"},g={display:"block",width:"max-content"},y=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function w(e){return Math.max(1,...e.map(e=>[...e??""].reduce((e,t)=>e+(y.test(t)?2:1),0)))}function S(e,t,n,r){return Number(p(e,t,n).toFixed(r))}var F=o(null);function z({children:e}){const[t,n]=l({}),r=a(()=>(e,t)=>n(n=>{if(null===t){if(!(e in n))return n;const t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}}),[]),i=a(()=>{const e=Object.values(t);return{set:r,width:e.length?`max(${e.join(", ")})`:null}},[t,r]);/* @__PURE__ */
2
+ return f(F.Provider,{value:i,children:e})}function k({value:o,onChange:a,min:y,max:z,step:k=1,shiftStep:N,precision:L,inputMin:R,inputMax:j,suffix:C,units:E,onCommit:$,showInput:B=!0,emptyLabel:A,placeholderValue:K,stepFrom:M,label:D,"aria-labelledby":W,valueText:O,id:V,disabled:q,size:H="md",boxSize:P="sm",className:G="",auto:I}){const U=i(),T=u(),Y=s(o);r(()=>{Y.current=o},[o]);const Q=s(o),X=e=>{Y.current=e,a(e)},Z=()=>{Q.current=Y.current},J=()=>{$&&Y.current!==Q.current&&(Q.current=Y.current,$(Y.current))},_=s(null),ee=s(J);ee.current=J;const te=Boolean($);c(()=>{const e=_.current;if(!te||!e)return;const t=()=>ee.current();return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[te]);const ne=t(),re=I??ne,ie=u(),oe=V??T,le=L??h(k),ae=R??y,ue=j??z,se=void 0!==A||void 0!==K,ce=M??K,de=p(o??K??y,y,z),fe=[y.toFixed(le),z.toFixed(le),o?.toFixed(le),A,K?.toFixed(le)],me=null!=o?o.toFixed(le):A||(null!=K?K.toFixed(le):void 0),pe=s(null),he=s(null),[xe,ve]=l(null),be=s(null),ge=Boolean(C);r(()=>{if(!B)return;const e=()=>{const e=pe.current?.querySelector("input"),t=he.current;if(!e||!t)return;const n=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,t)=>e+(parseFloat(n[t])||0),0);if(r<=0)return;Object.assign(t.style,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,fontVariantNumeric:n.fontVariantNumeric,letterSpacing:n.letterSpacing});const i=Math.ceil(t.getBoundingClientRect().width);if(i<=0)return;const o=t.querySelector("[data-shown]"),l=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),a=!!o&&o.getBoundingClientRect().width>l+.5,u=be.current;if(be.current={box:u?.box??{frame:r,fontSize:n.fontSize,text:i,cut:a},room:l},u&&u.box.frame===r&&u.box.fontSize===n.fontSize&&u.box.text===i&&u.box.cut===a)return;const s={frame:r,fontSize:n.fontSize,text:i,cut:a};be.current={box:s,room:l},ve(s)};e(),window.addEventListener("resize",e);const t="undefined"!=typeof document?document.fonts:void 0;t?.addEventListener?.("loadingdone",e);let n=null;if("undefined"!=typeof ResizeObserver){n=new ResizeObserver(()=>e());const t=pe.current?.querySelector("input");t&&n.observe(t),he.current&&n.observe(he.current)}return()=>{window.removeEventListener("resize",e),t?.removeEventListener?.("loadingdone",e),n?.disconnect()}},[ge,B,P]),r(()=>{const e=be.current;if(!e)return;const t=e.box.text<=e.room+.5?null:he.current?.querySelector("[data-shown]"),n=!!t&&t.getBoundingClientRect().width>e.room+.5;if(n===e.box.cut)return;const r={...e.box,cut:n};be.current={box:r,room:e.room},ve(r)},[me]);const ye=e=>O?O(e):"string"==typeof C?`${e.toFixed(le)} ${C}`:void 0,we=null==o?A??(null!=K?ye(K)??String(K):void 0):ye(o),Se=x[P],Fe=fe.filter(e=>Boolean(e)),ze=void 0===me?-1:Fe.indexOf(me),ke=xe?`${xe.text+xe.frame+2}px`:`calc(${w(fe)}ch + ${Se.left+(ge?Se.unit:Se.plain)+2}px)`,Ne=d(F),Le=u(),Re=Ne?.set;return r(()=>{Re&&Re(Le,B?ke:null)},[Re,Le,ke,B]),c(()=>()=>Re?.(Le,null),[Re,Le]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${G}`.trim(),style:v,children:[
3
+ /* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:z,step:k,value:de,disabled:q,"aria-label":W?void 0:D,"aria-labelledby":W,"aria-valuetext":we,"aria-describedby":re?ie: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 n=e.shiftKey&&null!=N;if(!n&&!(null==o&&null!=ce))return;e.preventDefault();X(S((o??ce??de)+t*(n?N??k:k),y,z,le)),J()},ref:_,onFocus:$&&Z,onPointerDown:$&&Z,onChange:e=>X(S(Number(e.target.value),y,z,le)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===H?"h-1":"h-1.5")}),B&&
4
+ /* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:$&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&J()}),onFocus:$&&Z,className:`relative min-w-0 max-w-full shrink-0 ${Se.text}`,style:{position:"relative",width:Ne?.width??ke,...xe?{fontSize:xe.fontSize}:{}},children:[
5
5
  /* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:Fe.map((e,t)=>/* @__PURE__ */f("span",{"data-shown":t===ze?"":void 0,style:g,children:e},t))}),
6
- /* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||J(e):se&&J(null)},min:ae,max:ue,step:N,shiftStep:k,stepFrom:ce,precision:le,snap:!0,allowEmpty:se,suffix:C,units:E,onBlur:$&&Z,disabled:V,placeholder:K??(null!=M?M.toFixed(le):void 0),size:H,auto:re,"aria-label":W?U.slider.value(W):void 0,"aria-labelledby":W?void 0:D})]})}),re&&/* @__PURE__ */f("span",{id:ie,hidden:!0,children:U.settingView.auto})]})}export{N as Slider,z as SliderGroup,S as settleSliderValue,w as sliderBoxChars,h as stepDecimals};
6
+ /* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||X(e):se&&X(null)},min:ae,max:ue,step:k,shiftStep:N,stepFrom:ce,precision:le,snap:!0,allowEmpty:se,suffix:C,units:E,onBlur:$&&J,disabled:q,placeholder:A??(null!=K?K.toFixed(le):void 0),size:P,auto:re,"aria-label":D?U.slider.value(D):void 0,"aria-labelledby":D?void 0:W})]})}),re&&/* @__PURE__ */f("span",{id:ie,hidden:!0,children:U.settingView.auto})]})}export{k as Slider,z as SliderGroup,S as settleSliderValue,w as sliderBoxChars,h as stepDecimals};
@@ -0,0 +1 @@
1
+ var r="13.25.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,4 +1,4 @@
1
- import{useColumnConfig as e}from"./chunk-C5OPAULN.js";import{useClickOutside as t}from"./chunk-SI26KESU.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:R,onResizeStart:_,onDragStart:z,onDragOver:P,onDrop:$,onDragEnd:I,toggleColumn:L,resetColumns:T,draggedIdx:A,dropGap:O}=e(f,S),{hasAnyPerm:E}=r(),G=i().columns,[Q,U]=c(!1),[W,Y]=c(!1),[B,F]=c(!1),H=m(null),J=k.length>0&&E(k);t(H,h(()=>{Q&&U(!1)},[Q]));const K=C.reduce((e,t)=>e+t.width,0),V=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:K,minWidth:"100%"},Z=m(null),q=h(e=>{const t=Z.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),X=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
1
+ import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-C5OPAULN.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:R,onResizeStart:_,onDragStart:z,onDragOver:P,onDrop:$,onDragEnd:I,toggleColumn:L,resetColumns:T,draggedIdx:A,dropGap:O}=t(f,S),{hasAnyPerm:E}=r(),G=i().columns,[Q,U]=c(!1),[W,Y]=c(!1),[B,F]=c(!1),H=m(null),J=k.length>0&&E(k);e(H,h(()=>{Q&&U(!1)},[Q]));const K=C.reduce((e,t)=>e+t.width,0),V=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:K,minWidth:"100%"},Z=m(null),q=h(e=>{const t=Z.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),X=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
2
2
  return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
3
3
  /* @__PURE__ */p("div",{ref:Z,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
4
4
  /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[t]}},e.key))}),