efficient-shell 4.164.0 → 4.166.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.
- package/README.md +146 -4
- package/dist/{Browser-AZSXQEJ2.js → Browser-2MBG34IR.js} +13 -13
- package/dist/Calculator-R3WJTNZ6.js +29 -0
- package/dist/ConfirmDialog-ZDVMT74Y.js +1 -0
- package/dist/{CurrencyConverter-VT2SZDA3.js → CurrencyConverter-PEXSQQUK.js} +7 -7
- package/dist/{Documents-WIYSUFCQ.js → Documents-YL4RIOZO.js} +10 -10
- package/dist/{Files-FAO4MFCO.js → Files-3ZRUTRSB.js} +30 -30
- package/dist/Notepad-3ZM2FR6C.js +25 -0
- package/dist/PdfViewer-S2B2DZYB.js +1 -0
- package/dist/{PomodoroTimer-4JBDIQZK.js → PomodoroTimer-5QHA5UOY.js} +40 -40
- package/dist/{Preview-FBVFDTPN.js → Preview-32F4DTCK.js} +23 -23
- package/dist/Sidebar-QQSRLMJG.js +44 -0
- package/dist/Spreadsheet-GOZI7I4L.js +37 -0
- package/dist/{Stock-NIM7MAYG.js → Stock-XJFITZZA.js} +4 -4
- package/dist/{Weather-RLISJWFA.js → Weather-BDC633GV.js} +18 -18
- package/dist/{WorldClock-G4L5OLOT.js → WorldClock-ROOVRRCJ.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-6ZUAHFK3.js → chunk-3U47BTEV.js} +14 -14
- package/dist/{chunk-6NG4TM3E.js → chunk-4P3IWZUC.js} +14 -14
- package/dist/{chunk-Z43BI2JI.js → chunk-5J2TKKGH.js} +1 -1
- package/dist/{chunk-XY25UBVS.js → chunk-7TQ7NMT3.js} +1 -1
- package/dist/{chunk-YLJ7AZON.js → chunk-7YFAFXQG.js} +8 -8
- package/dist/chunk-AFYQTVZO.js +1 -0
- package/dist/chunk-BKDE67DB.js +12 -0
- package/dist/{chunk-T7DDT2Z6.js → chunk-CRI4UFBU.js} +6 -6
- package/dist/{chunk-DGWWPVEQ.js → chunk-DTRXR6JQ.js} +11 -11
- package/dist/{chunk-J5E4VMLJ.js → chunk-FZRQBHTK.js} +1 -1
- package/dist/chunk-G5J6YSN5.js +5 -0
- package/dist/{chunk-I3CQI462.js → chunk-HA2WG27U.js} +2 -2
- package/dist/{chunk-RKOTKWWU.js → chunk-HGG5M5AB.js} +1 -1
- package/dist/chunk-HZZNJHRH.js +1 -0
- package/dist/chunk-JKVDTKBE.js +988 -0
- package/dist/{chunk-IY4CP2HO.js → chunk-KSSAVLO7.js} +1 -1
- package/dist/chunk-M4DB7UBZ.js +29 -0
- package/dist/{chunk-YS57MJFM.js → chunk-NCQLGQYR.js} +1 -1
- package/dist/{chunk-U7ZDZXOJ.js → chunk-QASZIYLG.js} +1 -1
- package/dist/{chunk-37QZZRDT.js → chunk-QZG72OVX.js} +1 -1
- package/dist/chunk-SOI4LR67.js +27 -0
- package/dist/chunk-UVZIPXIA.js +10 -0
- package/dist/chunk-VRHUY4P4.js +1 -0
- package/dist/{chunk-TJ4YXVQQ.js → chunk-VXBJNMAA.js} +94 -94
- package/dist/chunk-X4FJ54PP.js +1 -0
- package/dist/file-intake/index.js +1 -1
- package/dist/{index-CFLEu3eh.d.ts → index-DcLqfJX3.d.ts} +285 -16
- package/dist/index.d.ts +3 -13
- package/dist/index.js +114 -114
- package/dist/map/index.js +6 -6
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-GRNWTZIZ.js +0 -29
- package/dist/ConfirmDialog-LSFNIGKM.js +0 -1
- package/dist/Notepad-APW5DX37.js +0 -25
- package/dist/PdfViewer-3NWOBXPP.js +0 -1
- package/dist/Sidebar-KRN5ZV3F.js +0 -44
- package/dist/Spreadsheet-IQF6QAWU.js +0 -37
- package/dist/chunk-4UCRT4ST.js +0 -5
- package/dist/chunk-ELSUXC3N.js +0 -1
- package/dist/chunk-HQREOTKI.js +0 -9
- package/dist/chunk-L2W5XPZ3.js +0 -1
- package/dist/chunk-LZIS72CF.js +0 -9
- package/dist/chunk-MAIHBBWT.js +0 -1
- package/dist/chunk-MHGFTCEA.js +0 -971
- package/dist/chunk-NNUE7M5G.js +0 -29
- package/dist/chunk-SVJN7WWF.js +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
import{currentShellStrings as t}from"./chunk-
|
|
1
|
+
import{currentShellStrings as t}from"./chunk-NCQLGQYR.js";var e="http://www.w3.org/2000/svg",n={},o=/* @__PURE__ */new Map;function s(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var r={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",loading:"M12 3a9 9 0 019 9",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function i(t,n){const o=document.createElementNS(e,"svg");o.setAttribute("class",n),o.setAttribute("fill","none"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2");const s=document.createElementNS(e,"path");return s.setAttribute("stroke-linecap","round"),"loading"!==t&&s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",r[t]),o.appendChild(s),o}function a(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function c(t,e,r){const c={...n,...r},l=c.placement??"top",d=c.sticky??!1,u=`${l}|${t}|${e}`;if(c.dedupe){const t=o.get(u);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==t&&!1!==c.sound&&import("./sounds-OMHXVVQ4.js").then(e=>{"success"===t?e.playSuccess():"error"===t?e.playError():e.playNotification()}).catch(()=>{});const m="bottom"===l?s("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col-reverse gap-2 items-center pointer-events-none"):s("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col gap-2 items-center pointer-events-none"),p="bottom"===l?"translateY(10px)":"translateY(-10px)",f=a("pointer-events-auto cursor-pointer rosh-toast");f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,f.setAttribute("role","error"===t?"alert":"status"),f.setAttribute("aria-atomic","true"),f.appendChild(i(t,`h-4 w-4 rosh-tone-${t}${"loading"===t?" animate-spin":""}`));const h=document.createElement("span");let y;h.textContent=e,f.appendChild(h),m.appendChild(f),requestAnimationFrame(()=>{f.style.opacity="1",f.style.transform="translateY(0) scale(1)"});let v=!1;const g=()=>{v||(v=!0,y&&clearTimeout(y),o.delete(u),f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,setTimeout(()=>f.remove(),300))},b=c.duration??("info"===t?4500:3e3),x=()=>{y&&clearTimeout(y),d||(y=setTimeout(g,b))};return x(),f.addEventListener("mouseenter",()=>{y&&clearTimeout(y)}),f.addEventListener("mouseleave",()=>{v||x()}),f.addEventListener("click",g),o.set(u,{el:f,restart:x,dismiss:g}),{dismiss:g}}var l={success:(t,e)=>c("success",t,e),error:(t,e)=>c("error",t,e),warning:(t,e)=>c("warning",t,e),info:(t,e)=>c("info",t,e),notify:(e,o)=>function(e,o){!1!==(o?.sound??n.sound)&&import("./sounds-OMHXVVQ4.js").then(t=>t.playNotification()).catch(()=>{});const r=s("notif-container","fixed top-4 right-4 z-[9999] flex flex-col gap-3 items-end pointer-events-none"),c=a("pointer-events-auto cursor-pointer rosh-notif");c.style.opacity="0",c.style.transform="translateX(30px) scale(0.95)";const l=a("rosh-notif-badge");l.appendChild(i("bell","h-5 w-5"));const d=a("rosh-notif-body");d.append(a("rosh-notif-title",t().toast.notification),a("notif-msg rosh-notif-msg",e));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",c.append(l,d,u);const m=()=>{c.style.opacity="0",c.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>c.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),c.addEventListener("click",m),r.appendChild(c),requestAnimationFrame(()=>{c.style.opacity="1",c.style.transform="translateX(0) scale(1)"}),setTimeout(m,o?.duration??1e4)}(e,o),promise:(t,e,n)=>{const o=c("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),c("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),c("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{n={...t}}};export{l as toast_default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{useDismissPopupsOnOpen as e}from"./chunk-AFYQTVZO.js";import{registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-X4FJ54PP.js";import{useShellStrings as r,splitAround as o}from"./chunk-NCQLGQYR.js";import{createContext as l,useEffect as i,useRef as a,useId as s,useContext as c,useState as d,useCallback as u}from"react";import{jsxs as m,jsx as f,Fragment as h}from"react/jsx-runtime";var b=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function g(e){return Array.from(e.querySelectorAll(b)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var p=[];function v(e){const t=p.findIndex(t=>t!==e&&e.contains(t));-1===t?p.push(e):p.splice(t,0,e)}function x(e){const t=p.lastIndexOf(e);-1!==t&&p.splice(t,1)}var y=/* @__PURE__ */new WeakSet;function w(e){return g(e)}function N(e,t){i(()=>{if(!t)return;const n=e.current;return n?(y.add(n),v(n),()=>{x(n),y.delete(n)}):void 0},[e,t])}function k(e,t){const n=p.lastIndexOf(t),r=n>0?p[n-1]:-1===n?p[p.length-1]??null:null,o=g(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),l=o.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return l||(r&&!y.has(r)?o[0]??null:null)}function C(e,t,n){i(()=>{if(!t)return;const r=e.current;if(!r)return;const o=document.activeElement,l=n?.current??g(r)[0]??r;l!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),l.focus();const i=e=>{if("Tab"!==e.key)return;if(p[p.length-1]!==r)return;const t=g(r);if(0===t.length)return void e.preventDefault();const n=t[0],o=t[t.length-1],l=document.activeElement;!e.shiftKey||l!==n&&r.contains(l)?e.shiftKey||l!==o&&r.contains(l)||(e.preventDefault(),n.focus()):(e.preventDefault(),o.focus())};return v(r),document.addEventListener("keydown",i,!0),()=>{x(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&o?.focus?.()}},[e,t,n])}var L=0,E=null;function P(e){i(()=>{if(!e)return;const t=document.body;if(0===L){E={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return L+=1,()=>{0===(L-=1)&&E&&(t.style.overflow=E.overflow,t.style.paddingRight=E.paddingRight,E=null)}},[e])}var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function F({open:o,onClose:l,title:c,description:d,role:u="dialog",children:h,footer:b,blocking:g=!1,size:p="md",initialFocus:v,"aria-label":x,"aria-labelledby":y,"aria-describedby":w,className:N=""}){const k=a(null),L=s(),E=s(),F=!g&&!b,T=s(),D=r().dialog;return e(o),C(k,o,v),P(o),i(()=>{if(o)return t(()=>(g||l(),!0),()=>k.current)},[o,g,l]),o?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:n.overlay},role:"presentation",children:[
|
|
2
|
+
/* @__PURE__ */f("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
3
|
+
/* @__PURE__ */f("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:g?void 0:e=>{e.target===e.currentTarget&&l()},children:/* @__PURE__ */m("div",{ref:k,role:u,"aria-modal":"true","aria-labelledby":c?T:y,"aria-label":c||y?void 0:x,"aria-describedby":w??(d?E:h?L:void 0),className:`relative max-h-full w-full ${j[p]} overflow-y-auto overscroll-contain rounded-lg bg-white p-6 shadow-xl ${N}`.trim(),children:[c&&/* @__PURE__ */f("h2",{id:T,className:(F?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:c}),d&&/* @__PURE__ */f("p",{id:E,className:((c?"mt-1":F?"pr-8":"")+" text-sm text-gray-500").trim(),children:d}),h&&/* @__PURE__ */f("div",{id:L,className:"mt-2 text-sm text-gray-600",children:h}),b&&/* @__PURE__ */f("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:b}),F&&/* @__PURE__ */f("button",{type:"button",onClick:l,"aria-label":D.close,className:"absolute right-3 top-3 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */f("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})})]}):null}var T=l(()=>Promise.resolve(!1)),D=()=>c(T),O=()=>Promise.resolve(!1),W=e=>O(e),I=()=>Promise.resolve(!1),M=e=>I(e),$=()=>Promise.resolve(null),R=e=>$(e),A={danger:{icon:"text-red-600 bg-red-100",button:"bg-red-600 hover:bg-red-700 text-white"},warning:{icon:"text-yellow-600 bg-yellow-100",button:"bg-yellow-600 hover:bg-yellow-700 text-white"},info:{icon:"text-blue-600 bg-blue-100",button:"bg-blue-600 hover:bg-blue-700 text-white"}},z="bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50";function K(){/* @__PURE__ */
|
|
4
|
+
return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}function B(){/* @__PURE__ */
|
|
5
|
+
return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}function Q({children:e}){const[t,n]=d(!1),[l,s]=d({message:""}),[c,b]=d(0),g=a(),p=a(null),v=a(0),x=a([]),y=a(null),w=a(null),N=u(e=>{p.current=e.id,g.current=e.resolve,b(e.id),s(e.options),n(!0)},[]),k=u(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++v.current,options:t,resolve:e};null===p.current?N(n):x.current.push(n)})},[N]),[C,L]=d(!1),[E,P]=d({message:""}),[j,D]=d(""),W=a(),M=u(e=>(P(e),D(""),L(!0),new Promise(e=>{W.current=e})),[]),[R,Q]=d(!1),[S,G]=d({}),[V,Y]=d(""),_=a(),q=u(e=>{const t="string"==typeof e?{message:e}:e;return G(t),Y(t.defaultValue??""),Q(!0),new Promise(e=>{_.current=e})},[]);i(()=>{O=k,I=M,$=q},[k,M,q]);const H=(e,t)=>{if(p.current!==e)return;const r=g.current,o=x.current.shift();o?N(o):(p.current=null,g.current=void 0,n(!1)),r?.(t)},J=e=>{L(!1),D(""),W.current?.(e)},U=e=>{if(e){const e=V.trim();if(!e&&!S.allowEmpty)return Q(!1),void _.current?.(null);Q(!1),_.current?.(e)}else Q(!1),_.current?.(null)},X=l.variant||(l.confirmLabel?.toLowerCase().includes("delete")||l.message.toLowerCase().includes("delete")?"danger":"info"),Z=A[X],ee=A["warning"===E.variant?"warning":"danger"],te=E.confirmWord,ne=null==te||j===te,re=r().dialog,[oe,le]=o(re.typeToConfirm);/* @__PURE__ */
|
|
6
|
+
return m(T.Provider,{value:k,children:[e,
|
|
7
|
+
/* @__PURE__ */f(F,{open:t,onClose:()=>H(c,!1),initialFocus:y,footer:/* @__PURE__ */m(h,{children:[
|
|
8
|
+
/* @__PURE__ */f("button",{ref:y,type:"button",onClick:()=>H(c,!1),className:z,children:l.cancelLabel||re.cancel}),
|
|
9
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>H(c,!0),className:`px-4 py-2 text-sm font-medium rounded-lg ${Z.button}`,children:l.confirmLabel||re.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
10
|
+
/* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${Z.icon}`,children:/* @__PURE__ */f(K,{})}),
|
|
11
|
+
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
12
|
+
/* @__PURE__ */f("h2",{className:"text-base font-semibold text-gray-900",children:l.title||re.confirmTitle}),
|
|
13
|
+
/* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:l.message})]})]})}),
|
|
14
|
+
/* @__PURE__ */m(F,{open:C,onClose:()=>J(!1),initialFocus:null!=te?void 0:w,footer:/* @__PURE__ */m(h,{children:[
|
|
15
|
+
/* @__PURE__ */f("button",{ref:w,type:"button",onClick:()=>J(!1),className:z,children:E.cancelLabel||re.destructiveCancel}),
|
|
16
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>J(!0),disabled:!ne,className:`px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40 ${ee.button}`,children:te??E.confirmLabel??re.destructiveConfirm})]}),children:[
|
|
17
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>J(!1),"aria-label":re.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */f(B,{})}),
|
|
18
|
+
/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
19
|
+
/* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ee.icon}`,children:/* @__PURE__ */f(K,{})}),
|
|
20
|
+
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
21
|
+
/* @__PURE__ */f("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:E.title||re.destructiveTitle}),
|
|
22
|
+
/* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:E.message}),null!=te&&/* @__PURE__ */m(h,{children:[
|
|
23
|
+
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[oe,
|
|
24
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-1.5 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),le]}),
|
|
25
|
+
/* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:j,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===te&&J(!0)},placeholder:te,className:"mt-2 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-red-500"})]})]})]})]}),
|
|
26
|
+
/* @__PURE__ */m(F,{open:R,onClose:()=>U(!1),title:S.title||re.promptTitle,footer:/* @__PURE__ */m(h,{children:[
|
|
27
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>U(!1),className:z,children:S.cancelLabel||re.cancel}),
|
|
28
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>U(!0),disabled:!S.allowEmpty&&!V.trim(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40",children:S.confirmLabel||re.ok})]}),children:[S.message&&/* @__PURE__ */f("p",{className:"text-sm text-gray-600",children:S.message}),
|
|
29
|
+
/* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:V,onChange:e=>Y(e.target.value),onKeyDown:e=>{"Enter"===e.key?U(!0):"Escape"===e.key&&U(!1)},onFocus:e=>e.target.select(),placeholder:S.placeholder,className:"mt-3 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})]})}export{Q as ConfirmProvider,F as Dialog,W as confirm,M as confirmDestructive,w as focusableIn,R as prompt,k as stopAfter,D as useConfirm,C as useFocusTrap,P as useScrollLock,N as useTabLayer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as e,useContext as o,useMemo as t,useEffect as a}from"react";import{jsx as n}from"react/jsx-runtime";var i=/* @__PURE__ */new Map;function r(e,o){const t=`${e}|${JSON.stringify(o)}`;let a=i.get(t);return a||(a=new Intl.NumberFormat(e,o),i.set(t,a)),a}function s(e,o){return o?r(o,{maximumFractionDigits:20}).format(e):String(e)}function l(e,o,t){return t?r(t,{minimumFractionDigits:o,maximumFractionDigits:o}).format(e):e.toFixed(o)}function d(e,o,t){return t?r(t,{style:"percent",minimumFractionDigits:o,maximumFractionDigits:o}).format(e/100):`${e.toFixed(o)}%`}function c(e){const o=o=>s(o,e),t=o=>function(e,o){return o?r(o,{}).format(e):e.toLocaleString()}(o,e),a=(o,t)=>l(o,t,e),n=(o,t)=>d(o,t,e);return{window:{minimize:"Minimize",restore:"Restore",maximize:"Maximize",windowed:"Windowed",pinOnTop:"Pin on top",unpin:"Unpin from top",close:"Close",windowSuffix:"window",prev:"Prev",next:"Next",snapLayouts:"Snap layouts",snapLeft:"Snap left half",snapRight:"Snap right half",snapTopLeft:"Snap top-left quarter",snapTopRight:"Snap top-right quarter",snapBottomLeft:"Snap bottom-left quarter",snapBottomRight:"Snap bottom-right quarter"},taskbar:{closeWindow:"Close window",offscreenHint:"This window is off screen — click to bring it back",offscreenDot:"Off screen — click to bring this window back",expose:"Exposé — show all open windows as thumbnails",addToDesktop:"Add to desktop",removeFromDesktop:"Remove from desktop",minimizeAllWindows:"Minimize all",restoreAllWindows:"Restore all",closeAllWindows:"Close all"},logout:{goodbye:"Goodbye",seeYou:"See you next time"},about:{aboutPrefix:"About",thisApp:"this app",openSourceLicenses:"Open Source Licenses",whatsNew:"What's New",noChangelog:"No changelog available."},table:{empty:"Nothing to show",loading:"Loading",selectAll:"Select all rows",selectRow:"Select row"},select:{none:"— None —",noMatches:"No matches",allSelected:"All options selected",clear:"Clear selection",remove:"Remove"},notifications:{title:"Notifications",markAllRead:"Mark all read",dnd:"Do not disturb",dndOn:"Do not disturb is on",caughtUp:"All caught up",empty:"No notifications yet",viewAll:"View all notifications",cardLabel:"Notification",dismiss:"Dismiss notification"},form:{errorSummaryTitle:"There is a problem"},help:{title:"Help",searchPlaceholder:"Search help…",empty:"No help articles yet.",noResults:"No articles match your search.",loading:"Loading…",pickArticle:"Pick a help article from the left.",noBody:"This article has no body yet.",draft:"Draft",newArticle:"+ New",edit:"Edit"},update:{available:"A new version is available.",refreshNow:"Refresh now"},pageTabs:{label:"Open pages",close:"Close",closeOthers:"Close other tabs",closeRight:"Close tabs to the right",closeAll:"Close all tabs",unsaved:"Unsaved changes",copy:e=>`Copy ${e}`,copied:"Copied",tabMenu:"Window menu",discardTitle:"Discard unsaved changes?",discardOne:"This page has changes that have not been saved. Close it anyway?",discardMany:"pages have changes that have not been saved. Close them anyway?",discardConfirm:"Discard and close",keepEditing:"Keep editing"},dialog:{close:"Close",cancel:"Cancel",ok:"OK",confirmTitle:"Confirm",destructiveTitle:"Confirm Action",destructiveCancel:"Dismiss",destructiveConfirm:"Delete",typeToConfirm:e=>`Type ${e} to confirm:`,promptTitle:"Enter a value"},calendar:{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",monthPanel:"Choose a month",yearPanel:"Choose a year",chooseMonth:e=>`Choose a month, currently ${e}`,chooseYear:e=>`Choose a year, currently ${e}`},datePicker:{placeholder:"Select a date",dialog:"Choose a date",clear:"Clear",today:"Today",required:"Required"},dateRange:{placeholder:"Date Range",clearRange:"Clear date range",dialog:"Date range",from:"From",to:"To",start:"Start",end:"End",fromOnly:e=>`From ${e}`,toOnly:e=>`To ${e}`,range:(e,o)=>`${e} to ${o}`,required:"Required",last2Weeks:"Last 2 Weeks",lastMonth:"Last Month",last3Months:"Last 3 Months",last6Months:"Last 6 Months",last12Months:"Last 12 Months",custom:"Custom",clear:"Clear",cancel:"Cancel",apply:"Apply"},pagination:{label:"Pagination",first:"First page",previous:"Previous page",next:"Next page",last:"Last page"},list:{selected:e=>`${o(e)} selected`,selectedNotShown:(e,t)=>`${o(e)} selected, ${o(t)} not shown`,allLoaded:(e,o)=>`All ${t(e)} ${o} loaded`,count:(e,o)=>`${t(e)} ${o}`,loadedOf:(e,o,a)=>`${t(e)} of ${t(o)} ${a}`,loadingMore:"Loading more...",loadError:"Couldn't load this list",loadErrorMessage:"Something went wrong fetching these records. Check your connection and try again.",retry:"Try again"},kanban:{loading:"Loading…",empty:"No items.",dropHere:"Drop here",addItem:"Add item"},files:{attach:"Attach files",drop:"Drop files to attach",remove:e=>`Remove ${e}`,chooseMany:"Choose files",chooseOne:"Choose a file",dragMany:"or drag them here",dragOne:"or drag it here",notAccepted:(e,o)=>`${e} is not an accepted file type${o?` (${o})`:""}`,tooLarge:(e,o,t)=>`${e} is ${o} — the limit is ${t}`,tooMany:(e,t)=>`${e} was not added — ${o(t)} ${1===t?"file":"files"} is the limit`,bytes:e=>`${o(e)} B`,kilobytes:e=>`${o(e)} KB`,megabytes:e=>`${a(e,1)} MB`},media:{uploadImage:"Upload an image",uploadVideo:"Upload a video",uploadFile:"Upload a file",upload:"Upload media",cta:"Choose from library or upload",replace:"Replace",remove:"Remove",uploading:"Uploading…",cover:"Cover",add:"Add",addMedia:"Add media",empty:"No media.",removeItem:e=>`Remove ${e}`,reorder:(e,t,a)=>`${e}, item ${o(t)} of ${o(a)}. Use arrow keys to reorder.`},brandAsset:{save:e=>`Save ${e}`,remove:e=>`Remove ${e}`,discard:"Discard change",saveFailed:e=>`Could not save ${e}.`,removeFailed:e=>`Could not remove ${e}.`,region:(e,o)=>`${e} for ${o}`,usedFor:e=>`Used for ${e}.`,previews:e=>`${e} previews`,preview:"Preview",alt:(e,o)=>`${e} ${o}`},copy:{copy:"Copy",copyLabel:e=>`Copy ${e}`,copied:"Copied",copiedLabel:e=>`${e} copied`,failed:"Could not copy to the clipboard"},keypad:{backspace:"Backspace",enter:"Enter"},banner:{dismiss:"Dismiss"},badge:{remove:"Remove",removeItem:e=>`Remove ${e}`},breadcrumbs:{label:"Breadcrumb",hidden:"Hidden crumbs"},emptyState:{message:"Nothing here yet."},errors:{notFound:"Page not found",notFoundBody:"The page you're looking for doesn't exist or was moved.",forbidden:"Access denied",forbiddenBody:"You don't have permission to view this page.",noAccess:"You don't have access to this",serverError:"Something went wrong",serverErrorBody:"An unexpected error occurred. Please try again.",retry:"Try again",details:"Error details"},search:{placeholder:"Search...",escBadge:"ESC",searching:"Searching...",noResults:"No results found.",minChars:e=>`Type at least ${o(e)} characters to search...`,navigate:"navigate",open:"open",close:"close",enterKey:"Enter",escKey:"Esc",recent:"Recent",favorites:"Favorites",actions:"Actions",listLabel:"Search results",groupCount:(e,t)=>`${o(e)}${t?"+":""}`,groupLabel:(e,t,a)=>`${e}, ${o(t)}${a?"+":""}`,seeAll:e=>`See all ${e}`,searchFailed:"Search failed — check your connection and try again.",partialFailure:"Some results could not be loaded.",tabKey:"Tab",nextGroup:"next group"},grid:{selectAll:"Select all",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:e=>`Delete row ${e}`,insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteColumn:e=>`Delete column ${e}`,resize:"Drag to resize · double-click to auto-fit",fill:"Drag to fill"},sidebar:{resize:"Drag to resize · double-click to reset"},resizeHandle:{label:"Resize panel",hint:"Drag to resize · double-click to reset"},number:{increase:"Increase",decrease:"Decrease"},slider:{value:e=>`${e} value`},color:{swatch:(e,o)=>`${e}: ${o}`,none:"None",panel:e=>`${e} picker`,square:"Saturation and brightness",squareValue:(e,o)=>`Saturation ${n(e,0)}, brightness ${n(o,0)}`,hue:"Hue",hex:e=>`${e} hex code`,presets:"Presets",clear:"No color"},tree:{empty:"Nothing here yet",dropHere:"Drop here"},layout:{desktop:"Desktop",sidebar:"Sidebar",switchToDesktop:"Switch to Desktop",switchToSidebar:"Switch to Sidebar",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",search:"Search…",navLabel:"Main menu",openWindows:"Open windows",pageResult:"Page",accountMenu:e=>`Account menu for ${e}`,profile:"My Profile",notifications:"Notifications",reportIssue:"Suggestion or Bug",signOut:"Sign Out",signOutTitle:"Sign Out",signOutMessage:"Do you want to log out? All windows will reopen when you log back in."},markdown:{screenshot:"Screenshot"},severity:{success:"ok",warning:"warning",danger:"critical",unrecognised:e=>`unrecognised severity ${e}`},meter:{noData:"no data",warningAt:e=>`warning ≥ ${o(e)}`,criticalAt:e=>`critical ≥ ${o(e)}`,noReading:"no reading",noBudget:"no budget",ofBudget:e=>`${e} of budget`,budget:"budget",hoursMinutes:(e,t)=>`${o(e)}h ${o(t)}m`,minutesSeconds:(e,t)=>`${o(e)}m ${o(t)}s`,seconds:e=>`${o(e)}s`},charts:{showTable:"Show the data as a table",loading:"Loading chart data",noData:"No data in this window.",windowStart:"Window start",windowEnd:"Window end",window:(e,t,a)=>`Time window — showing ${e} to ${t} of ${o(a)} intervals`,overIntervals:(e,t)=>`${e.join(", ")} over ${o(t)} intervals`,acrossCategories:(e,t)=>`${e.join(", ")} across ${o(t)} categories`,acrossMeasures:(e,t)=>`${e.join(", ")} across ${o(t)} measures`,breakdown:(e,t)=>`Breakdown of ${e} across ${o(t)} segments`,funnel:(e,t,a)=>`Funnel of ${o(e)} stages, ${t} down to ${a}`,radialTrack:e=>`${o(e)} categories, as concentric proportions`,radialCycle:e=>`${o(e)} categories, around a cycle`,tableFrom:"From",tableTo:"To",tableItem:"Item",tableLevel:"Level",tableSeries:"Series",inBucket:e=>`${e} in this bucket`,inCategory:e=>`${e} in this category`,value:"Value",share:"Share",count:"Count",flow:"Flow",totalFlow:"Total flow",throughput:"Throughput",open:"Open",high:"High",low:"Low",close:"Close",maximum:"Maximum",q3:"Q3",median:"Median",q1:"Q1",minimum:"Minimum",distribution:"Distribution",fiveNumber:(e,t)=>`${e}: five-number summary for ${o(t)} categories`,outliers:e=>`${o(e)} outlier${e>1?"s":""} beyond the whiskers`,price:"Price",ohlc:(e,t)=>`${e}: open, high, low and close across ${o(t)} periods`,closedAbove:"Closed above its open",closedBelow:"Closed below its open",noFlows:"No flows to chart.",chord:e=>`Flows between ${o(e)} participants`,noStages:"No stages to chart.",ofFirstStage:"Of first stage",droppedHere:"Dropped here",intensity:"Intensity",noActivity:"No activity in this window.",heatmap:(e,t,a)=>`${e} across ${o(t)} rows and ${o(a)} columns`,countAxis:"count",histogram:(e,t,a)=>`${e}: ${o(t)} bins over ${o(a)} observations`,observations:"Observations",notEnough:"Not enough eligible requests to judge.",objectiveMet:e=>`objective ${e} met`,objectiveMissed:e=>`objective ${e} missed`,nothingToPlot:"Nothing to plot.",nothingToCompare:"Nothing to compare.",other:"Other",nothingToBreakDown:"Nothing to break down.",range:"Range",rangeLabel:(e,t)=>`${e}: low and high across ${o(t)} categories`,nothingToRank:"Nothing to rank in this window.",emphasised:"(emphasised)",sankey:(e,t)=>`Flow between ${o(e)} nodes over ${o(t)} links`,noObservations:"No observations in this window.",xAxis:"x",yAxis:"y",size:"Size",scatter:(e,o,t)=>`${e.join(", ")}: ${o} against ${t}`,outsideRange:e=>`${o(e)} ${1===e?"point":"points"} outside the shown range`,waterfall:(e,t,a)=>`Waterfall of ${o(e)} steps from ${t} to ${a}`,balance:"Balance",increase:"Increase",decrease:"Decrease",runningTotal:"Running total",sunburst:(e,t)=>`Hierarchy of ${e} across ${o(t)} levels`,treemap:e=>`Treemap of ${o(e)} items`,trendUp:"up",trendDown:"down",trendFlat:"flat"},timeline:{days:e=>`${t(e)} days`,daysToToday:e=>`${t(e)} days to today`,notReached:"Not yet reached",next:"Next",more:e=>`+${o(e)} more`,today:"Today",todayTitle:e=>`Today — ${e}`,open:e=>`Open ${e}`,openButton:"Open",scrub:"Scrub the timeline",alsoToCome:e=>`Also to come: ${e.join(", ")}`,start:e=>`Start · ${e}`,events:(e,t)=>`${o(e)} events · ${t.join(", ")}`,started:e=>`started ${e}`,duration:e=>`${t(e)} day${1===e?"":"s"}`,reached:(e,t)=>`${o(e)} of ${o(t)} milestones`,milestones:e=>`${e} milestones`},production:{heading:"Production progress",start:"Start",estimated:"Estimated",estimatedCompletion:"Estimated completion",estDone:"Est. done",play:"Play",pause:"Pause",playTitle:"Play the timeline, report by report",backTo:e=>`Back to ${e}`,showing:e=>`Showing ${e}`,overall:e=>`${n(e,0)} overall`,inStock:e=>`${t(e)} pc in stock`,noReport:"No production report filed yet",leadTime:e=>`${t(e)} day${1===e?"":"s"} lead time`,report:"Production report",shipment:"Shipment",inspection:"Inspection",invoice:"Invoice",scrub:"Scrub the production timeline",label:(e,o)=>`Production reports and events, ${e} to ${o}`},containers:{items:e=>`${o(e)} items`,pieces:e=>`${o(e)} pcs`,split:(e,t)=>`(${o(e)} instr / ${o(t)} loaded)`,added:(e,t)=>`${o(e)} new (${o(t)} pcs)`,fill:(e,t)=>`${a(e,1)} / ${o(t)} m³`,total:"Total:",instructed:e=>`${a(e,2)} m³ instruction`,loaded:e=>`${a(e,2)} m³ loaded`,volume:e=>`${a(e,2)} m³`,noVolume:"Volume: N/A (no volume data for these part numbers)"},toast:{notification:"Notification"},map:{failed:"The map could not be drawn here. The list has everything it shows.",approximate:e=>`${e}, approximate location`,approximateTitle:e=>`${e} (approximate)`,places:e=>1===e?"place":"places",group:(e,t)=>`${o(e)} ${t} here`,stops:e=>`Stops ${e}`,closeBy:(e,t)=>`${o(e)} more ${t} close by, drawn when the map is closer`,spread:"Press to see them apart",cycle:"They stand on one spot: press for the next of them",fullScreen:"Full screen",leaveFullScreen:"Leave full screen",chosen:e=>`${e}, chosen on the map`,closeCard:"Close",openRecord:"Open"},pdf:{previousPage:"Previous page",nextPage:"Next page",pageOf:(e,t)=>`${o(e)} / ${o(t)}`,zoomOut:"Zoom out",zoomIn:"Zoom in",zoom:"Zoom",fitWidth:"Fit width",fitPage:"Fit page",fit:"Fit",fitHint:"Fit to the pane: follows its size until you zoom by hand",print:"Print",download:"Download",email:"Email",loading:"Loading PDF…",loadFailed:"Failed to load PDF",allowPopups:"Allow popups to print"}}}var p=c(),u=/* @__PURE__ */new Map;var h=e(p),m=e(null),g=/* @__PURE__ */new Set;var $=p,f={};function w(){return $}function b({value:e=f,locale:i,children:r}){const s=o(m),l=t(()=>function(e){if(e)try{return Intl.getCanonicalLocales(e)[0]}catch{return void(g.has(e)||(g.add(e),console.error(`[efficient-shell] ShellStringsProvider: locale="${e}" is not a BCP 47 language tag, so it is ignored and numbers and dates keep their default formatting. Pass a tag such as "de-DE" or "ja".`)))}}(i),[i]),d=void 0===i?s?.locale:l,w=t(()=>{const o=function(e){if(!e)return p;let o=u.get(e);return o||(o=c(e),u.set(e,o)),o}(d),t={};for(const a of Object.keys(o))t[a]={...o[a],...e[a]??{}};return t},[e,d]),b=t(()=>({locale:d}),[d]),y=null!==s;return a(()=>{if(!y)return $=w,()=>{$===w&&($=p)}},[w,y]),/* @__PURE__ */n(m.Provider,{value:b,children:/* @__PURE__ */n(h.Provider,{value:w,children:r})})}function y(){return o(h)}function v(){return o(m)?.locale}function S(e){const[o="",...t]=e("\0").split("\0");return[o,t.join("")]}export{p as DEFAULT_SHELL_STRINGS,b as ShellStringsProvider,w as currentShellStrings,l as formatFixed,d as formatPercent,s as formatPlain,S as splitAround,v as useShellLocale,y as useShellStrings};
|
|
1
|
+
import{createContext as e,useContext as o,useMemo as t,useEffect as a}from"react";import{jsx as n}from"react/jsx-runtime";var i=/* @__PURE__ */new Map;function r(e,o){const t=`${e}|${JSON.stringify(o)}`;let a=i.get(t);return a||(a=new Intl.NumberFormat(e,o),i.set(t,a)),a}function s(e,o){return o?r(o,{maximumFractionDigits:20}).format(e):String(e)}function l(e,o,t){return t?r(t,{minimumFractionDigits:o,maximumFractionDigits:o}).format(e):e.toFixed(o)}function d(e,o,t){return t?r(t,{style:"percent",minimumFractionDigits:o,maximumFractionDigits:o}).format(e/100):`${e.toFixed(o)}%`}function c(e){const o=o=>s(o,e),t=o=>function(e,o){return o?r(o,{}).format(e):e.toLocaleString()}(o,e),a=(o,t)=>l(o,t,e),n=(o,t)=>d(o,t,e);return{window:{minimize:"Minimize",restore:"Restore",maximize:"Maximize",windowed:"Windowed",pinOnTop:"Pin on top",unpin:"Unpin from top",close:"Close",windowSuffix:"window",prev:"Prev",next:"Next",snapLayouts:"Snap layouts",snapLeft:"Snap left half",snapRight:"Snap right half",snapTopLeft:"Snap top-left quarter",snapTopRight:"Snap top-right quarter",snapBottomLeft:"Snap bottom-left quarter",snapBottomRight:"Snap bottom-right quarter"},taskbar:{closeWindow:"Close window",offscreenHint:"This window is off screen — click to bring it back",offscreenDot:"Off screen — click to bring this window back",expose:"Exposé — show all open windows as thumbnails",addToDesktop:"Add to desktop",removeFromDesktop:"Remove from desktop",minimizeAllWindows:"Minimize all",restoreAllWindows:"Restore all",closeAllWindows:"Close all"},logout:{goodbye:"Goodbye",seeYou:"See you next time"},about:{aboutPrefix:"About",thisApp:"this app",openSourceLicenses:"Open Source Licenses",whatsNew:"What's New",noChangelog:"No changelog available."},table:{empty:"Nothing to show",loading:"Loading",selectAll:"Select all rows",selectRow:"Select row"},select:{none:"— None —",noMatches:"No matches",allSelected:"All options selected",clear:"Clear selection",remove:"Remove"},notifications:{title:"Notifications",markAllRead:"Mark all read",dnd:"Do not disturb",dndOn:"Do not disturb is on",caughtUp:"All caught up",empty:"No notifications yet",viewAll:"View all notifications",cardLabel:"Notification",dismiss:"Dismiss notification"},form:{errorSummaryTitle:"There is a problem"},help:{title:"Help",searchPlaceholder:"Search help…",empty:"No help articles yet.",noResults:"No articles match your search.",loading:"Loading…",pickArticle:"Pick a help article from the left.",noBody:"This article has no body yet.",draft:"Draft",newArticle:"+ New",edit:"Edit"},update:{available:"A new version is available.",refreshNow:"Refresh now"},pageTabs:{label:"Open pages",close:"Close",closeOthers:"Close other tabs",closeRight:"Close tabs to the right",closeAll:"Close all tabs",unsaved:"Unsaved changes",copy:e=>`Copy ${e}`,copied:"Copied",tabMenu:"Window menu",discardTitle:"Discard unsaved changes?",discardOne:"This page has changes that have not been saved. Close it anyway?",discardMany:"pages have changes that have not been saved. Close them anyway?",discardConfirm:"Discard and close",keepEditing:"Keep editing"},dialog:{close:"Close",cancel:"Cancel",ok:"OK",confirmTitle:"Confirm",destructiveTitle:"Confirm Action",destructiveCancel:"Dismiss",destructiveConfirm:"Delete",typeToConfirm:e=>`Type ${e} to confirm:`,promptTitle:"Enter a value"},calendar:{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",monthPanel:"Choose a month",yearPanel:"Choose a year",chooseMonth:e=>`Choose a month, currently ${e}`,chooseYear:e=>`Choose a year, currently ${e}`},datePicker:{placeholder:"Select a date",dialog:"Choose a date",clear:"Clear",today:"Today",required:"Required"},dateRange:{placeholder:"Date Range",clearRange:"Clear date range",dialog:"Date range",from:"From",to:"To",start:"Start",end:"End",fromOnly:e=>`From ${e}`,toOnly:e=>`To ${e}`,range:(e,o)=>`${e} to ${o}`,required:"Required",last2Weeks:"Last 2 Weeks",lastMonth:"Last Month",last3Months:"Last 3 Months",last6Months:"Last 6 Months",last12Months:"Last 12 Months",custom:"Custom",clear:"Clear",cancel:"Cancel",apply:"Apply"},pagination:{label:"Pagination",first:"First page",previous:"Previous page",next:"Next page",last:"Last page"},list:{selected:e=>`${o(e)} selected`,selectedNotShown:(e,t)=>`${o(e)} selected, ${o(t)} not shown`,allLoaded:(e,o)=>`All ${t(e)} ${o} loaded`,count:(e,o)=>`${t(e)} ${o}`,loadedOf:(e,o,a)=>`${t(e)} of ${t(o)} ${a}`,loadingMore:"Loading more...",loadError:"Couldn't load this list",loadErrorMessage:"Something went wrong fetching these records. Check your connection and try again.",retry:"Try again"},kanban:{loading:"Loading…",empty:"No items.",dropHere:"Drop here",addItem:"Add item"},files:{attach:"Attach files",drop:"Drop files to attach",remove:e=>`Remove ${e}`,chooseMany:"Choose files",chooseOne:"Choose a file",dragMany:"or drag them here",dragOne:"or drag it here",notAccepted:(e,o)=>`${e} is not an accepted file type${o?` (${o})`:""}`,tooLarge:(e,o,t)=>`${e} is ${o} — the limit is ${t}`,tooMany:(e,t)=>`${e} was not added — ${o(t)} ${1===t?"file":"files"} is the limit`,bytes:e=>`${o(e)} B`,kilobytes:e=>`${o(e)} KB`,megabytes:e=>`${a(e,1)} MB`},media:{uploadImage:"Upload an image",uploadVideo:"Upload a video",uploadFile:"Upload a file",upload:"Upload media",cta:"Choose from library or upload",replace:"Replace",remove:"Remove",uploading:"Uploading…",cover:"Cover",add:"Add",addMedia:"Add media",empty:"No media.",removeItem:e=>`Remove ${e}`,reorder:(e,t,a)=>`${e}, item ${o(t)} of ${o(a)}. Use arrow keys to reorder.`},brandAsset:{save:e=>`Save ${e}`,remove:e=>`Remove ${e}`,discard:"Discard change",saveFailed:e=>`Could not save ${e}.`,removeFailed:e=>`Could not remove ${e}.`,region:(e,o)=>`${e} for ${o}`,usedFor:e=>`Used for ${e}.`,previews:e=>`${e} previews`,preview:"Preview",alt:(e,o)=>`${e} ${o}`},copy:{copy:"Copy",copyLabel:e=>`Copy ${e}`,copied:"Copied",copiedLabel:e=>`${e} copied`,failed:"Could not copy to the clipboard"},keypad:{backspace:"Backspace",enter:"Enter"},banner:{dismiss:"Dismiss"},badge:{remove:"Remove",removeItem:e=>`Remove ${e}`},breadcrumbs:{label:"Breadcrumb",hidden:"Hidden crumbs"},emptyState:{message:"Nothing here yet."},errors:{notFound:"Page not found",notFoundBody:"The page you're looking for doesn't exist or was moved.",forbidden:"Access denied",forbiddenBody:"You don't have permission to view this page.",noAccess:"You don't have access to this",serverError:"Something went wrong",serverErrorBody:"An unexpected error occurred. Please try again.",retry:"Try again",details:"Error details"},search:{placeholder:"Search...",escBadge:"ESC",searching:"Searching...",noResults:"No results found.",minChars:e=>`Type at least ${o(e)} characters to search...`,navigate:"navigate",open:"open",close:"close",enterKey:"Enter",escKey:"Esc",recent:"Recent",favorites:"Favorites",actions:"Actions",listLabel:"Search results",groupCount:(e,t)=>`${o(e)}${t?"+":""}`,groupLabel:(e,t,a)=>`${e}, ${o(t)}${a?"+":""}`,seeAll:e=>`See all ${e}`,searchFailed:"Search failed — check your connection and try again.",partialFailure:"Some results could not be loaded.",tabKey:"Tab",nextGroup:"next group"},grid:{selectAll:"Select all",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:e=>`Delete row ${e}`,insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteColumn:e=>`Delete column ${e}`,resize:"Drag to resize · double-click to auto-fit",fill:"Drag to fill"},sidebar:{resize:"Drag to resize · double-click to reset"},resizeHandle:{label:"Resize panel",hint:"Drag to resize · double-click to reset"},number:{increase:"Increase",decrease:"Decrease"},slider:{value:e=>`${e} value`},color:{swatch:(e,o)=>`${e}: ${o}`,none:"None",panel:e=>`${e} picker`,square:"Saturation and brightness",squareValue:(e,o)=>`Saturation ${n(e,0)}, brightness ${n(o,0)}`,hue:"Hue",hex:e=>`${e} hex code`,presets:"Presets",clear:"No color"},tree:{empty:"Nothing here yet",dropHere:"Drop here",dragHint:"Drag to move",moveHint:"Alt+Arrow Up or Alt+Arrow Down moves it",insertHere:"Insert here"},layout:{desktop:"Desktop",sidebar:"Sidebar",switchToDesktop:"Switch to Desktop",switchToSidebar:"Switch to Sidebar",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",search:"Search…",navLabel:"Main menu",openWindows:"Open windows",pageResult:"Page",accountMenu:e=>`Account menu for ${e}`,profile:"My Profile",notifications:"Notifications",reportIssue:"Suggestion or Bug",signOut:"Sign Out",signOutTitle:"Sign Out",signOutMessage:"Do you want to log out? All windows will reopen when you log back in."},markdown:{screenshot:"Screenshot"},severity:{success:"ok",warning:"warning",danger:"critical",unrecognised:e=>`unrecognised severity ${e}`},meter:{noData:"no data",warningAt:e=>`warning ≥ ${o(e)}`,criticalAt:e=>`critical ≥ ${o(e)}`,noReading:"no reading",noBudget:"no budget",ofBudget:e=>`${e} of budget`,budget:"budget",hoursMinutes:(e,t)=>`${o(e)}h ${o(t)}m`,minutesSeconds:(e,t)=>`${o(e)}m ${o(t)}s`,seconds:e=>`${o(e)}s`},charts:{showTable:"Show the data as a table",loading:"Loading chart data",noData:"No data in this window.",windowStart:"Window start",windowEnd:"Window end",window:(e,t,a)=>`Time window — showing ${e} to ${t} of ${o(a)} intervals`,overIntervals:(e,t)=>`${e.join(", ")} over ${o(t)} intervals`,acrossCategories:(e,t)=>`${e.join(", ")} across ${o(t)} categories`,acrossMeasures:(e,t)=>`${e.join(", ")} across ${o(t)} measures`,breakdown:(e,t)=>`Breakdown of ${e} across ${o(t)} segments`,funnel:(e,t,a)=>`Funnel of ${o(e)} stages, ${t} down to ${a}`,radialTrack:e=>`${o(e)} categories, as concentric proportions`,radialCycle:e=>`${o(e)} categories, around a cycle`,tableFrom:"From",tableTo:"To",tableItem:"Item",tableLevel:"Level",tableSeries:"Series",inBucket:e=>`${e} in this bucket`,inCategory:e=>`${e} in this category`,value:"Value",share:"Share",count:"Count",flow:"Flow",totalFlow:"Total flow",throughput:"Throughput",open:"Open",high:"High",low:"Low",close:"Close",maximum:"Maximum",q3:"Q3",median:"Median",q1:"Q1",minimum:"Minimum",distribution:"Distribution",fiveNumber:(e,t)=>`${e}: five-number summary for ${o(t)} categories`,outliers:e=>`${o(e)} outlier${e>1?"s":""} beyond the whiskers`,price:"Price",ohlc:(e,t)=>`${e}: open, high, low and close across ${o(t)} periods`,closedAbove:"Closed above its open",closedBelow:"Closed below its open",noFlows:"No flows to chart.",chord:e=>`Flows between ${o(e)} participants`,noStages:"No stages to chart.",ofFirstStage:"Of first stage",droppedHere:"Dropped here",intensity:"Intensity",noActivity:"No activity in this window.",heatmap:(e,t,a)=>`${e} across ${o(t)} rows and ${o(a)} columns`,countAxis:"count",histogram:(e,t,a)=>`${e}: ${o(t)} bins over ${o(a)} observations`,observations:"Observations",notEnough:"Not enough eligible requests to judge.",objectiveMet:e=>`objective ${e} met`,objectiveMissed:e=>`objective ${e} missed`,nothingToPlot:"Nothing to plot.",nothingToCompare:"Nothing to compare.",other:"Other",nothingToBreakDown:"Nothing to break down.",range:"Range",rangeLabel:(e,t)=>`${e}: low and high across ${o(t)} categories`,nothingToRank:"Nothing to rank in this window.",emphasised:"(emphasised)",sankey:(e,t)=>`Flow between ${o(e)} nodes over ${o(t)} links`,noObservations:"No observations in this window.",xAxis:"x",yAxis:"y",size:"Size",scatter:(e,o,t)=>`${e.join(", ")}: ${o} against ${t}`,outsideRange:e=>`${o(e)} ${1===e?"point":"points"} outside the shown range`,waterfall:(e,t,a)=>`Waterfall of ${o(e)} steps from ${t} to ${a}`,balance:"Balance",increase:"Increase",decrease:"Decrease",runningTotal:"Running total",sunburst:(e,t)=>`Hierarchy of ${e} across ${o(t)} levels`,treemap:e=>`Treemap of ${o(e)} items`,trendUp:"up",trendDown:"down",trendFlat:"flat"},timeline:{days:e=>`${t(e)} days`,daysToToday:e=>`${t(e)} days to today`,notReached:"Not yet reached",next:"Next",more:e=>`+${o(e)} more`,today:"Today",todayTitle:e=>`Today — ${e}`,open:e=>`Open ${e}`,openButton:"Open",scrub:"Scrub the timeline",alsoToCome:e=>`Also to come: ${e.join(", ")}`,start:e=>`Start · ${e}`,events:(e,t)=>`${o(e)} events · ${t.join(", ")}`,started:e=>`started ${e}`,duration:e=>`${t(e)} day${1===e?"":"s"}`,reached:(e,t)=>`${o(e)} of ${o(t)} milestones`,milestones:e=>`${e} milestones`},production:{heading:"Production progress",start:"Start",estimated:"Estimated",estimatedCompletion:"Estimated completion",estDone:"Est. done",play:"Play",pause:"Pause",playTitle:"Play the timeline, report by report",backTo:e=>`Back to ${e}`,showing:e=>`Showing ${e}`,overall:e=>`${n(e,0)} overall`,inStock:e=>`${t(e)} pc in stock`,noReport:"No production report filed yet",leadTime:e=>`${t(e)} day${1===e?"":"s"} lead time`,report:"Production report",shipment:"Shipment",inspection:"Inspection",invoice:"Invoice",scrub:"Scrub the production timeline",label:(e,o)=>`Production reports and events, ${e} to ${o}`},containers:{items:e=>`${o(e)} items`,pieces:e=>`${o(e)} pcs`,split:(e,t)=>`(${o(e)} instr / ${o(t)} loaded)`,added:(e,t)=>`${o(e)} new (${o(t)} pcs)`,fill:(e,t)=>`${a(e,1)} / ${o(t)} m³`,total:"Total:",instructed:e=>`${a(e,2)} m³ instruction`,loaded:e=>`${a(e,2)} m³ loaded`,volume:e=>`${a(e,2)} m³`,noVolume:"Volume: N/A (no volume data for these part numbers)"},toast:{notification:"Notification"},map:{failed:"The map could not be drawn here. The list has everything it shows.",approximate:e=>`${e}, approximate location`,approximateTitle:e=>`${e} (approximate)`,places:e=>1===e?"place":"places",group:(e,t)=>`${o(e)} ${t} here`,stops:e=>`Stops ${e}`,closeBy:(e,t)=>`${o(e)} more ${t} close by, drawn when the map is closer`,spread:"Press to see them apart",cycle:"They stand on one spot: press for the next of them",fullScreen:"Full screen",leaveFullScreen:"Leave full screen",chosen:e=>`${e}, chosen on the map`,closeCard:"Close",openRecord:"Open"},pdf:{previousPage:"Previous page",nextPage:"Next page",pageOf:(e,t)=>`${o(e)} / ${o(t)}`,zoomOut:"Zoom out",zoomIn:"Zoom in",zoom:"Zoom",fitWidth:"Fit width",fitPage:"Fit page",fit:"Fit",fitHint:"Fit to the pane: follows its size until you zoom by hand",print:"Print",download:"Download",email:"Email",loading:"Loading PDF…",loadFailed:"Failed to load PDF",allowPopups:"Allow popups to print"}}}var p=c(),u=/* @__PURE__ */new Map;var h=e(p),m=e(null),g=/* @__PURE__ */new Set;var $=p,f={};function w(){return $}function b({value:e=f,locale:i,children:r}){const s=o(m),l=t(()=>function(e){if(e)try{return Intl.getCanonicalLocales(e)[0]}catch{return void(g.has(e)||(g.add(e),console.error(`[efficient-shell] ShellStringsProvider: locale="${e}" is not a BCP 47 language tag, so it is ignored and numbers and dates keep their default formatting. Pass a tag such as "de-DE" or "ja".`)))}}(i),[i]),d=void 0===i?s?.locale:l,w=t(()=>{const o=function(e){if(!e)return p;let o=u.get(e);return o||(o=c(e),u.set(e,o)),o}(d),t={};for(const a of Object.keys(o))t[a]={...o[a],...e[a]??{}};return t},[e,d]),b=t(()=>({locale:d}),[d]),v=null!==s;return a(()=>{if(!v)return $=w,()=>{$===w&&($=p)}},[w,v]),/* @__PURE__ */n(m.Provider,{value:b,children:/* @__PURE__ */n(h.Provider,{value:w,children:r})})}function v(){return o(h)}function y(){return o(m)?.locale}function S(e){const[o="",...t]=e("\0").split("\0");return[o,t.join("")]}export{p as DEFAULT_SHELL_STRINGS,b as ShellStringsProvider,w as currentShellStrings,l as formatFixed,d as formatPercent,s as formatPlain,S as splitAround,y as useShellLocale,v as useShellStrings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-VXBJNMAA.js";import{keepsNativeMenu as a}from"./chunk-UVZIPXIA.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{toast_default as t}from"./chunk-
|
|
1
|
+
import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{toast_default as t}from"./chunk-KSSAVLO7.js";import{setSpreadsheetPreview as n}from"./chunk-VTVSMRFX.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return t.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();n({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return t.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{useDismissPopupsOnOpen as a}from"./chunk-AFYQTVZO.js";import{glassStyle as l}from"./chunk-HZZNJHRH.js";import{Z_LAYERS as o}from"./chunk-X4FJ54PP.js";import{useShellStrings as s}from"./chunk-NCQLGQYR.js";import{useState as i,useEffect as c,useRef as d,useMemo as u,useId as p,useCallback as y}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";var b={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function g(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function x(e,t,n){return!1===e?"framed":null==e||null==t?"plate-light":t?"light"===n?"plate-dark":"bare":"dark"===n?"plate-light":"bare"}var v={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function k(e,t,n){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:n}}function w({src:e,fallbackSrc:t,fallbackHasAlpha:n=null,fallbackIsLight:r=null,fallbackAdaptive:a,alt:l,slot:o="compact",surface:s="light",size:d,width:u,height:p,decorative:y=!1,fallbackMode:m="monogram",adaptive:h=!1,hasAlpha:w=null,isLight:N=null,treatmentPadding:_=4,treatmentRadius:A=8,className:L="",style:C}){const[$,T]=i(e||t||"");c(()=>{T(e||t||"")},[e,t]);const E=Boolean(t&&$===t&&$!==e),I=(E?a??h:h)?x(E?n:w,E?r:N,s):"bare",j=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==d&&null==u&&null==p?b[o]:"","dark"===s?"text-white":"text-gray-700",v[I],L].filter(Boolean).join(" "),S={...k(I,A,_),...null==d?{width:u,height:p}:{width:d,height:d},...C};return $?/* @__PURE__ */f("span",{className:j,"data-brand-treatment":I,style:S,children:/* @__PURE__ */f("img",{src:$,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>T(e=>t&&e!==t?t:"")})}):"none"===m?null:/* @__PURE__ */f("span",{"data-brand-fallback":!0,"data-brand-slot":o,"aria-label":y?void 0:l,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${j} rounded-md bg-gray-100 font-semibold`,style:S,children:y?null:g(l)})}function N(n,r){return e(n,r)?n.items.filter(n=>e(n,r)&&t(n,r)):[]}function _(e,r){return n(e,r).filter(e=>t(e,r))}function A(n,a,l){const o=new Set(a.erp),s=new Set(a.system),i=new Set(a.footer??[]),c=n.filter(r),d=e=>c.filter(t=>e.has(t.label)&&N(t,l).length>0);return{topItems:n.filter(e=>!r(e)).filter(n=>e(n,l)&&t(n,l)),erpSections:d(o),systemSections:d(s),virtualSections:(a.virtual??[]).filter(e=>e.items.length>0),footerSections:d(i),footerItems:(a.footerItems??[]).filter(n=>e(n,l)&&t(n,l))}}function L(e,t,n){return!!t&&e.some(e=>e.to===t||L(_(e,n),t,n))}var C="__page__";function $(e){const t=e.indexOf("?");if(t<0)return{path:e,search:""};const n=new URLSearchParams(e.slice(t+1));return{path:e.slice(0,t),search:n.get("search")??""}}function T(e,t,n){const r=function(e,t){const n=[],r=e=>{const a=_(e,t);0===a.length?n.push(e):a.forEach(r)};e.topItems.forEach(r);for(const n of[...e.erpSections,...e.systemSections,...e.footerSections])N(n,t).forEach(r);for(const t of e.virtualSections)t.items.forEach(r);return e.footerItems.forEach(r),n}(e,t);return Object.assign(async e=>{const t=e.trim().toLowerCase();if(!t)return[];const a=/* @__PURE__ */new Set,l=[];for(const e of r){const r=e.menuLabel??e.label;a.has(e.to)||!e.label.toLowerCase().includes(t)&&!r.toLowerCase().includes(t)||(a.add(e.to),l.push({type:n,label:e.label,entity_type:C,entity_id:e.to}))}return l.slice(0,8)},{destinations:r})}function E(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(!r||"string"!=typeof r.entityType||"string"!=typeof r.entityId||"string"!=typeof r.label)continue;if("preview-file"===r.entityType)continue;const e="page"===r.entityType;n.push({type:e?t:"",label:r.label,entity_type:e?C:r.entityType,entity_id:r.entityId})}return n}var I="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function j(e,t,n){return 0===n.length?null:{key:e,title:t,rows:n.map((e,t)=>({kind:"action",key:`action:${t}:${e.label}`,label:e.label,icon:e.icon,action:e})),count:n.length}}function S(e,t,n,r){return{type:e,label:t,entity_type:C,entity_id:`${n}?search=${encodeURIComponent(r.trim())}`}}function M(e,t,n,r,a){const l=function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=t.get(n.type);e?e.push(n):t.set(n.type,[n])}return Array.from(t,([e,t])=>({type:e,results:t}))}(e).map(e=>{const t=e.results.map((t,n)=>({kind:"result",key:`result:${e.type}:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,result:t})),r=!!a?.truncatedTypes?.includes(e.type),l=r?a?.listRoutes?.[e.type]:void 0;if(a&&l){const r=a.seeAllLabel(l.label);t.push({kind:"seeAll",key:`seeall:${e.type}`,label:r,result:S(e.type,r,l.path,n)})}return{key:`type:${e.type}`,title:e.type,rows:t,count:e.results.length,truncated:r}}),o=j("actions",r,function(e,t){const n=t.trim().toLowerCase();return e&&n?e.filter(e=>e.label.toLowerCase().includes(n)||(e.keywords??[]).some(e=>e.toLowerCase().includes(n))):[]}(t,n));return o?[...l,o]:l}function R(e,t,n){return 0===n?0:Math.min(Math.max(e+t,0),n-1)}var D=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function P(e,t,n=8){return[t,...e.filter(e=>!D(e,t))].slice(0,n)}function H(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e=n;if("string"!=typeof e.type||"string"!=typeof e.label||"string"!=typeof e.entity_type||"string"!=typeof e.entity_id)continue;const r={type:e.type,label:e.label,entity_type:e.entity_type,entity_id:e.entity_id};"string"==typeof e.sub&&(r.sub=e.sub),t.some(e=>D(e,r))||t.push(r)}return t.slice(0,8)}function K(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:n}=e;return{results:t,truncatedTypes:Array.isArray(n)?n:[]}}return{results:[],truncatedTypes:[]}}var B=[];function z(e,t,n){const[r,a]=i([]),[l,o]=i(B),[s,u]=i(!1),[p,f]=i("none"),m=d(function(){let e=0,t=null;const n=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{n();const r=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>r===e}},cancel:n}}());c(()=>{const r=m.current;if(e.length<n||!t||0===t.length)return r.cancel(),a(e=>0===e.length?e:[]),o(B),f("none"),void u(!1);u(!0);const l=setTimeout(async()=>{const n=r.begin(),l=await async function(e,t,n){const r=await Promise.all(e.map(async e=>{try{return{failed:!1,...K(await e(t,{signal:n}))}}catch(e){const t=n.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:n}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===n}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:r.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(r.flatMap(e=>e.truncatedTypes))),failed:r.filter(e=>e.failed).length}}(t,e,n.signal);n.isCurrent()&&(a(l.results),o(l.truncatedTypes),f(0===l.failed?"none":l.failed>=t.length?"all":"some"),u(!1))},250);return()=>{clearTimeout(l),r.cancel()}},[e,t,n]);return{results:r,truncatedTypes:l,loading:s,failure:p,reset:y(()=>{m.current.cancel(),a(e=>0===e.length?e:[]),o(B),f("none"),u(!1)},[])}}var F=(e,t)=>`${e}-opt-${t}`;function U(e,t){return"seeAll"===e.kind?"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3":"action"===e.kind?e.icon??I:e.icon?e.icon:t?.[e.result.type]?t[e.result.type]:I}function O({sections:e,activeIdx:t,listId:n,label:r,typeIcons:a,groupCount:l,groupLabel:o,onHover:s,onPick:i}){let c=0;/* @__PURE__ */
|
|
2
|
+
return f("div",{id:n,role:"listbox","aria-label":r,className:"py-1",children:e.map(e=>/* @__PURE__ */m("div",{role:"group","aria-label":o(e.title,e.count,!!e.truncated),children:[
|
|
3
|
+
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
4
|
+
/* @__PURE__ */f("span",{children:e.title}),
|
|
5
|
+
/* @__PURE__ */f("span",{className:"font-medium normal-case tracking-normal",children:l(e.count,!!e.truncated)})]}),e.rows.map(e=>{const r=c++,l=r===t,o="action"===e.kind||"seeAll"===e.kind?void 0:e.badge,d="action"===e.kind||"seeAll"===e.kind?void 0:e.sub,u="seeAll"===e.kind;/* @__PURE__ */
|
|
6
|
+
return m("div",{id:F(n,r),role:"option","aria-selected":l,className:"flex items-center gap-3 w-full px-4 py-2.5 text-left cursor-pointer transition-colors "+(l?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>s(r),children:[
|
|
7
|
+
/* @__PURE__ */f("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:U(e,a)})}),
|
|
8
|
+
/* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[
|
|
9
|
+
/* @__PURE__ */f("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */f("p",{className:"text-xs text-gray-400 truncate",children:d})]}),o&&/* @__PURE__ */f("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-500",children:o})]},e.key)})]},e.key))})}var Q="react-os-shell:open-global-search";function W(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(Q))}function X({providers:e,typeIcons:t,listRoutes:n,placeholder:r,quickActions:b,onSelect:g,recent:x,onRecord:v,favorites:k}={}){const w=s().search,N=r??w.placeholder,[_,A]=i(!1),[L,C]=i(""),[$,T]=i(0),E=d(null),{results:S,truncatedTypes:D,loading:P,failure:H,reset:K}=z(L,e,2);c(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),A(e=>!e)),"Escape"===e.key&&_&&A(!1)},t=()=>A(!0);return window.addEventListener("keydown",e),window.addEventListener(Q,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(Q,t)}},[_]),a(_);const[B,U]=i(!1);_!==B&&(U(_),_&&(C(""),T(0),K())),c(()=>{_?setTimeout(()=>E.current?.focus(),50):C("")},[_]),c(()=>{T(0)},[S]);const W=L.length>=2,X=u(()=>W?M(S,b,L,w.actions,{truncatedTypes:D,listRoutes:n,seeAllLabel:w.seeAll}):function(e,t){const n=[];e.recent?.length&&n.push({key:"recent",title:t.recent,rows:e.recent.map((e,t)=>({kind:"recent",key:`recent:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type,result:e})),count:e.recent.length}),e.favorites?.length&&n.push({key:"favorites",title:t.favorites,rows:e.favorites.map((e,t)=>({kind:"favorite",key:`favorite:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type||void 0,icon:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",result:e})),count:e.favorites.length});const r=j("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:x,favorites:k,actions:b},w),[W,S,D,n,b,L,x,k,w]),Z=u(()=>function(e){return e.flatMap(e=>e.rows)}(X),[X]),G=Math.min($,Math.max(Z.length-1,0)),J=p(),V=Z.length>0;c(()=>{_&&0!==Z.length&&document.getElementById(F(J,G))?.scrollIntoView?.({block:"nearest"})},[_,G,Z.length,J]);const Y=y(e=>{A(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||v?.(e.result),g?.(e.result)):e.action.onSelect()},[g,v]);return _?h(
|
|
10
|
+
/* @__PURE__ */m("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:o.overlay},onClick:()=>A(!1),children:[
|
|
11
|
+
/* @__PURE__ */f("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
|
|
12
|
+
/* @__PURE__ */m("div",{className:"relative z-10 w-full max-w-xl rounded-2xl overflow-hidden",onClick:e=>e.stopPropagation(),style:l(),children:[
|
|
13
|
+
/* @__PURE__ */m("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
|
|
14
|
+
/* @__PURE__ */f("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:I})}),
|
|
15
|
+
/* @__PURE__ */f("input",{ref:E,type:"text",value:L,onChange:e=>{C(e.target.value),T(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),T(R(G,1,Z.length))):"ArrowUp"===e.key?(e.preventDefault(),T(R(G,-1,Z.length))):"Tab"===e.key&&Z.length>0?(e.preventDefault(),T(function(e,t,n){const r=e.length;if(0===r)return 0;const a=[];let l=0;for(const t of e)a.push(l),l+=t;let o=0;for(let e=0;e<r;e++)t>=a[e]&&(o=e);return a[(o+n+r)%r]}(X.map(e=>e.rows.length),G,e.shiftKey?-1:1))):"Enter"===e.key&&Z[G]&&Y(Z[G])},placeholder:N,role:"combobox","aria-expanded":V,"aria-controls":V?J:void 0,"aria-activedescendant":V?F(J,G):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),P&&/* @__PURE__ */f("span",{"data-global-search-spinner":"",role:"status","aria-label":w.searching,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-500"}),
|
|
16
|
+
/* @__PURE__ */f("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:w.escBadge})]}),
|
|
17
|
+
/* @__PURE__ */m("div",{className:"max-h-[50vh] overflow-y-auto",children:[P&&0===Z.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.searching}),!P&&"all"===H&&W&&/* @__PURE__ */f("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:w.searchFailed}),!P&&W&&0===Z.length&&"all"!==H&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.noResults}),V&&/* @__PURE__ */f(O,{sections:X,activeIdx:G,listId:J,label:w.listLabel,typeIcons:t,groupCount:w.groupCount,groupLabel:w.groupLabel,onHover:T,onPick:Y}),!P&&"some"===H&&W&&/* @__PURE__ */f("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:w.partialFailure}),!P&&!W&&0===Z.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.minChars(2)})]}),
|
|
18
|
+
/* @__PURE__ */m("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-[11px] text-gray-400",children:[
|
|
19
|
+
/* @__PURE__ */m("div",{className:"flex items-center gap-3",children:[
|
|
20
|
+
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
21
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
|
|
22
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${w.navigate}`]}),
|
|
23
|
+
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
24
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.enterKey}),` ${w.open}`]}),X.length>1&&/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
25
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.tabKey}),` ${w.nextGroup}`]})]}),
|
|
26
|
+
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
27
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.escKey}),` ${w.close}`]})]})]})]}),document.body):null}export{w as BrandMark,X as GlobalSearch,C as PAGE_RESULT_ENTITY,E as favoritesToResults,T as navPagesProvider,W as openGlobalSearch,$ as parsePageResultTarget,A as partitionNav,P as pushRecent,x as resolveBrandMarkTreatment,L as rowsContainRoute,H as sanitizeRecent,_ as visibleNavChildren,N as visibleSectionItems};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-HZZNJHRH.js";import{useHydrated as n,useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{onOverlayOpen as o,registerModalEscapeInterceptor as i,Z_LAYERS as l}from"./chunk-X4FJ54PP.js";import{createContext as a,forwardRef as u,useContext as c,useRef as s,useId as d,useState as p,useEffect as m,useMemo as h,useCallback as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as y,jsx as x,Fragment as w}from"react/jsx-runtime";var b=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),v="data-native-context-menu";function k(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function C(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(k(t,`[${v}]`))return!0;if(k(t,"textarea"))return!0;if(k(t,"img, picture, canvas, video, audio"))return!0;const n=k(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(b.has(e))return!0}const r=k(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var N=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function L(e,t,n){const r=k(e,"a[href]"),o=(t||"").trim(),i=function(e,t){if(e&&"#"!==e)try{const n=new URL(e,t??("undefined"!=typeof document?document.baseURI:void 0));return N.has(n.protocol)?n.href:void 0}catch{return}}(r?.getAttribute("href"),n);return{kind:o?"selection":i?"link":"default",...o?{selectionText:o}:{},...i?{linkUrl:i}:{}}}function T(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return C(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function M(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function E(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function B(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function $(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),l=e-i/2;return l<n?n:l+i>r?Math.max(n,r-i):l}function P(e,t,n,r,o,i=!1,l=8){const a=t+o,u=e-o-n,c=u>=l;return i&&c?{left:u,flipped:!0}:a+n<=r-l?{left:a,flipped:!1}:c?{left:u,flipped:!0}:i?{left:l,flipped:!0}:{left:Math.max(l,r-l-n),flipped:!1}}function R(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var W=a(null),A=a(!1);function H({children:t,style:r,className:a="",onClose:u,minWidth:c=180,portal:f=!1}){const y=s(null),w=d(),[b,v]=p([]),k=s();m(()=>()=>clearTimeout(k.current),[]);const N=n(),L=h(()=>{const e=()=>clearTimeout(k.current);return{id:w,depth:0,path:b,open:(t,n)=>{e(),v(e=>M(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>v(e=>E(e,t)),200)},closeBelow:t=>{e(),v(e=>E(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),u?.()},root:y}},[w,b,u]);m(()=>{if(!u)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${w}"]`)||y.current&&!y.current.contains(e.target)&&u()},t=e=>{"Escape"===e.key&&u()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=o(u),r=i(()=>!1,()=>y.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),r()}},[u,w]),m(()=>{const e=y.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const T=R(),B=/(^|[\s:])!?z-/.test(a),$=/* @__PURE__ */x("div",{ref:y,"data-popup-menu-tree":w,className:`fixed rounded-2xl ${"tight"===T?"py-1":"large"===T?"py-2":"py-1.5"} ${a}`,onContextMenu:e=>{C(e.target)||e.preventDefault()},style:{...B?{}:{zIndex:l.menu},minWidth:c,animation:"popup-in 0.12s ease-out",...e(),...r},children:/* @__PURE__ */x(W.Provider,{value:L,children:t})});return f?N?g($,document.body):null:$}function j(e,t,n,r=!1){const o=R(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":"max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))";return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-blue-50 hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i}}}var D=/* @__PURE__ */x("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});function F({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
+
return x("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&D}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&D})}var S=u(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:l,tabIndex:a,id:u,onMouseEnter:s},d){const p=c(W),m=c(A),h=j(r,o,n),f=void 0===l?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
+
return y("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?l:void 0,tabIndex:a,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),s?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */x(F,{kind:f,checked:!!l}),t]})}),I=/* @__PURE__ */x("svg",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function z(e){let t=l.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function q(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function U({label:t,icon:n,children:o,disabled:l,className:a="",minWidth:u=180,maxHeight:p}){const b=c(W),v=d(),k=s(null),N=s(null),L=s(),T=s(!1),M=`${v}-menu`;m(()=>()=>clearTimeout(L.current),[]);const E=b?.depth??0,B=b?.path[E],A=!!B&&B.key===v&&!l,H=f(e=>{if(!b||l||!k.current)return;clearTimeout(L.current),T.current=e;const t=k.current.getBoundingClientRect(),n=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,o=E>0&&(b.path[E-1]?.flipped??!1),i=P(r.left,r.right,u,window.innerWidth,4,o);b.open(E,{key:v,y:t.top,...i})},[b,l,E,v,u]),D=e=>{b?.closeBelow(E),k.current?.focus()};m(()=>{if(A)return i(e=>"Escape"===e.key&&(!(b&&b.path.length>E+1)&&(D(),!0)),()=>N.current)}),r(()=>{if(!A||!B)return;const e=()=>{const e=N.current;if(!e||!k.current)return;const t=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??k.current.getBoundingClientRect(),r=E>0&&(b?.path[E-1]?.flipped??!1),o=e.offsetWidth||u,i=P(n.left,n.right,o,window.innerWidth,4,r,8),l=e.offsetHeight,a=$(k.current.getBoundingClientRect().top+l/2,l,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${a}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),m(()=>{A&&T.current&&(T.current=!1,q(N.current)[0]?.focus())},[A]);const F=h(()=>b&&{...b,depth:E+1},[b,E]);if(!b)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=j(!1,l,a,A),U=R();/* @__PURE__ */
|
|
4
|
+
return y(w,{children:[
|
|
5
|
+
/* @__PURE__ */y("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":A,"aria-controls":A?M:void 0,disabled:l,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;A?t&&q(N.current)[0]?.focus():H(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),H(!0))},onMouseEnter:()=>{l||(b.cancelClose(),A?b.closeBelow(E+1):(clearTimeout(L.current),L.current=setTimeout(()=>H(!1),120)))},onMouseLeave:()=>{clearTimeout(L.current),b.scheduleClose(E)},children:[n,
|
|
6
|
+
/* @__PURE__ */x("span",{className:"min-w-0 flex-1 truncate",children:t}),I]}),A&&g(
|
|
7
|
+
/* @__PURE__ */x("div",{ref:N,id:M,role:"menu","data-popup-menu-tree":b.id,"data-popup-submenu-panel":!0,className:"fixed rounded-2xl overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===U?"py-1":"large"===U?"py-2":"py-1.5"),style:{left:B.left,top:B.y,minWidth:u,maxHeight:void 0===p?"calc(100vh - 16px)":`min(${"number"==typeof p?`${p}px`:p}, calc(100vh - 16px))`,zIndex:z(b.root.current)+E+1,animation:(B.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...e()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=q(N.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),D())},onMouseEnter:()=>{b.cancelClose(),clearTimeout(L.current)},onMouseLeave:()=>b.scheduleClose(E+1),onContextMenu:e=>{C(e.target)||e.preventDefault()},children:/* @__PURE__ */x(W.Provider,{value:F,children:o})}),document.body)]})}function J(){const e=R();/* @__PURE__ */
|
|
8
|
+
return x("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function K({children:e}){const t=R(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
|
|
9
|
+
return x("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function Z({d:e,className:t="h-4 w-4 text-gray-400"}){/* @__PURE__ */
|
|
10
|
+
return x("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{F as MenuCheckMark,Z as MenuIcon,A as MenuSemanticsContext,v as NATIVE_MENU_ATTR,H as PopupMenu,J as PopupMenuDivider,S as PopupMenuItem,K as PopupMenuLabel,U as PopupSubmenu,$ as clampMenuTop,E as closeMenuBelow,L as describeContextTarget,j as itemLook,C as keepsNativeMenu,T as leavesContextMenuAlone,P as menuPanelLeft,M as openMenuLevel,B as resolveMenuLevels};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="4.166.0",a=r;export{a as APP_VERSION,r as VERSION};
|