efficient-shell 7.64.0 → 7.66.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/dist/{Browser-DEK65GGL.js → Browser-VIPLAZPA.js} +14 -14
- package/dist/Calculator-P5ZRUIZJ.js +29 -0
- package/dist/ConfirmDialog-EORVHGKM.js +1 -0
- package/dist/{CurrencyConverter-N237EF2N.js → CurrencyConverter-AVOUJJFV.js} +9 -9
- package/dist/{Documents-T6L323BV.js → Documents-KCBZ7VP3.js} +23 -23
- package/dist/Files-D5534EA4.js +87 -0
- package/dist/Notepad-5TSOFDJX.js +25 -0
- package/dist/PdfViewer-RTV6NP6H.js +1 -0
- package/dist/{PomodoroTimer-DMP6EY5F.js → PomodoroTimer-HZ5CSLSS.js} +59 -59
- package/dist/{Preview-RKQVILVT.js → Preview-IZQQA4S7.js} +55 -55
- package/dist/Sidebar-463ZRYGR.js +43 -0
- package/dist/{Spreadsheet-RN6ROHUK.js → Spreadsheet-5RKYWPI6.js} +14 -14
- package/dist/{Stock-MC3S66WG.js → Stock-2IPMYPPX.js} +3 -3
- package/dist/{Weather-UKY7EJO2.js → Weather-CQHVBFKT.js} +17 -17
- package/dist/{WorldClock-R7MIP7F6.js → WorldClock-M3DXVIZL.js} +6 -6
- package/dist/ai/index.js +13 -13
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-BVFQGLAJ.js → chunk-2SUZLDPO.js} +2 -2
- package/dist/{chunk-R2FANVKE.js → chunk-3LZCNWKD.js} +15 -15
- package/dist/chunk-3RZU7NQB.js +1 -0
- package/dist/{chunk-35UBO4T7.js → chunk-5DTPO25W.js} +3 -3
- package/dist/{chunk-LW5XF5JD.js → chunk-5SXGTGQE.js} +1 -1
- package/dist/{chunk-JQ2345TZ.js → chunk-73726UPK.js} +1 -1
- package/dist/{chunk-BJ4APV4M.js → chunk-BDJ5ITX6.js} +1 -1
- package/dist/{chunk-AAHMUDUP.js → chunk-BE6F2GAI.js} +2 -2
- package/dist/{chunk-BHKRSEVI.js → chunk-CPDR5VYL.js} +1 -1
- package/dist/chunk-ENVRURGD.js +2 -0
- package/dist/{chunk-4RUTVPTH.js → chunk-GGDCR6GM.js} +1 -1
- package/dist/{chunk-OF7EOZVS.js → chunk-HI2ZOE6K.js} +12 -12
- package/dist/chunk-HVZDUIFB.js +14 -0
- package/dist/chunk-HWH4UHIU.js +2 -0
- package/dist/{chunk-2YLR3CWQ.js → chunk-HWNAQ5MF.js} +14 -14
- package/dist/{chunk-T5J7AFTD.js → chunk-JNNGFK5N.js} +1 -1
- package/dist/chunk-M4RQIHBG.js +2 -0
- package/dist/chunk-N4YDKF7A.js +14 -0
- package/dist/{chunk-KOBUXTHU.js → chunk-PHUMA5ME.js} +20 -20
- package/dist/chunk-Q4L6E3PQ.js +27 -0
- package/dist/{chunk-RFANAC7P.js → chunk-Q4VC5ZVW.js} +16 -16
- package/dist/{chunk-7KBOLC6O.js → chunk-S3IYYSTT.js} +1 -1
- package/dist/chunk-SB5KBKVJ.js +1 -0
- package/dist/{chunk-R4XNK5UJ.js → chunk-SE6QT4NG.js} +9 -9
- package/dist/{chunk-LPGG6DRT.js → chunk-SQTXJESD.js} +68 -75
- package/dist/chunk-VM4TA3CI.js +1040 -0
- package/dist/{chunk-GMZ2J6XQ.js → chunk-VUX5EQN5.js} +1 -1
- package/dist/{chunk-4TJ6N5QS.js → chunk-W7HCERPE.js} +1 -1
- package/dist/{chunk-4A4GD2NL.js → chunk-YWGXQERP.js} +5 -5
- package/dist/file-intake/index.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/{index-D6mP2zYB.d.ts → index-BddrJwtq.d.ts} +13 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +687 -688
- package/dist/locales/zh-Hans.d.ts +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +7 -7
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/{strings-BYsxAKI5.d.ts → strings-BXfu1R53.d.ts} +4 -0
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-2TQXXQTL.js +0 -29
- package/dist/ConfirmDialog-BSUSUHKJ.js +0 -1
- package/dist/Files-HNE3DY3I.js +0 -87
- package/dist/Notepad-TLPBE3NP.js +0 -25
- package/dist/PdfViewer-NT3MMNPO.js +0 -1
- package/dist/Sidebar-75YOMDJZ.js +0 -44
- package/dist/chunk-3IML3Y3Y.js +0 -1
- package/dist/chunk-5BFEZCIV.js +0 -1039
- package/dist/chunk-BRK2GETX.js +0 -14
- package/dist/chunk-HQJSOBDE.js +0 -15
- package/dist/chunk-LHHIRTEG.js +0 -2
- package/dist/chunk-QXAPPMUE.js +0 -1
- package/dist/chunk-TT6QOFWA.js +0 -2
- package/dist/chunk-ZOJJB5BQ.js +0 -27
package/dist/chunk-BRK2GETX.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{useInsideTooltip as t,Tooltip as e}from"./chunk-RDLWLATO.js";import{useHydrated as r,useBrowserState as n}from"./chunk-D65T4H6J.js";import{useShellStrings as o}from"./chunk-3IML3Y3Y.js";import{Icon as s}from"./chunk-76DRQSJM.js";import{createContext as a,useSyncExternalStore as i,useRef as l,useState as c,useContext as u,useCallback as d,useMemo as f}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";var v="(max-width: 767px), (pointer: coarse)",g="(max-width: 767px)";function p(t){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(t).matches}var w=()=>p(v),x=()=>p(g);function b(){return!1}var y=t=>_(v,t),C=t=>_(g,t);function _(t,e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const r=window.matchMedia(t);return r.addEventListener?(r.addEventListener("change",e),()=>r.removeEventListener("change",e)):(r.addListener(e),()=>r.removeListener(e))}function k(){return i(y,w,b)}function L(){return i(C,x,b)}var N="whitespace-nowrap";function D({children:r}){const n=t(),o=l(null),[s,a]=c(!1),i=/* @__PURE__ */m("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const t=o.current;a(!!t&&t.scrollWidth>t.clientWidth+1)},children:r});return n?i:/* @__PURE__ */m(e,{content:s?r:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:i})}var M="inline-flex max-w-full items-center whitespace-nowrap rounded-full",S={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},E={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function T(t,e="subtle"){return"solid"===e?E[t]:S[t]}var A=a({}),I=a(void 0);function j(t){return t.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function F({groups:t,labelFor:e,children:r}){/* @__PURE__ */
|
|
2
|
-
return m(A.Provider,{value:t,children:/* @__PURE__ */m(I.Provider,{value:e,children:r})})}function H(){const t=u(I);return d(e=>t?.(e)??j(e),[t])}function P({status:t,label:e,emphasis:r="subtle"}){const n=T(u(A)[t]??"neutral",r),o=u(I),s=e??o?.(t)??j(t);/* @__PURE__ */
|
|
3
|
-
return m("span",{className:`${M} px-3 py-0.5 text-xs font-medium ${n}`,children:/* @__PURE__ */m(D,{children:s})})}var O={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},Z={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},z={404:t=>t.notFound,403:t=>t.noAccess,500:t=>t.serverError};function R({tone:t}){const e={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(t){case"success":/* @__PURE__ */
|
|
4
|
-
return m(s,{name:"check",...e});case"error":/* @__PURE__ */
|
|
5
|
-
return m(s,{name:"close",...e});case"warning":/* @__PURE__ */
|
|
6
|
-
return m(s,{name:"error",...e});default:/* @__PURE__ */
|
|
7
|
-
return m(s,{name:"info",...e})}}function q({status:t="info",title:e,subTitle:r,extra:n,icon:s,children:a,className:i=""}){const l=O[t],c=o().errors;/* @__PURE__ */
|
|
8
|
-
return h("div",{role:"error"===l?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${i}`.trim(),children:[
|
|
9
|
-
/* @__PURE__ */m("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${Z[l]}`,children:s??/* @__PURE__ */m(R,{tone:l})}),
|
|
10
|
-
/* @__PURE__ */m("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:e??z[t]?.(c)??""}),r&&/* @__PURE__ */m("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:r}),a&&/* @__PURE__ */m("div",{className:"mt-4 w-full max-w-md text-left",children:a}),n&&/* @__PURE__ */m("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:n})]})}function W({colorClass:t,tone:e,children:r,size:n="sm",capitalize:a=!1,closable:i=!1,onClose:l,closeLabel:c,className:u=""}){const d=t??S[e??"neutral"],f="xs"===n?"px-2 py-0.5 text-3xs":"md"===n?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",v=a?"capitalize":"",g=o().badge,p=c??("string"==typeof r?g.removeItem(r):g.remove),w="xs"===n?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
11
|
-
return h("span",{className:[M,"font-medium",f,v,d,u].filter(Boolean).join(" "),children:[
|
|
12
|
-
/* @__PURE__ */m(D,{children:r}),i&&/* @__PURE__ */m("button",{type:"button",onClick:l,"aria-label":p,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */m(s,{name:"close",look:"mini",className:w,"aria-hidden":"true"})})]})}var J="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),K={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},U=J?0:1,$=K.MOD[U],B=K.ALT[U],Y="⇧",Q="⏎",G=K.CMD_ENTER[U],V=K.CMD_S[U],X=K.CMD_K[U],tt=K.CMD_DOT[U],et=K.CMD_A[U],rt=K.CMD_Z[U],nt=K.CMD_SHIFT_Z[U],ot=K.ALT_SHIFT_D[U],st=K.ALT_SHIFT_E[U],at=K.ALT_SHIFT_N[U],it=new Map(J?Object.values(K).map(([t,e])=>[t,e]):[]);function lt(t){return r()?t:it.get(t)??t}var ct={neutral:"inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},ut={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function dt({keys:t,size:e="md",tone:r="neutral",className:n=""}){const o=lt(t);/* @__PURE__ */
|
|
13
|
-
return m("kbd",{className:[ct[r],ut[e],n].filter(Boolean).join(" "),children:o})}var ft=a(null);function mt({value:t,children:e}){/* @__PURE__ */
|
|
14
|
-
return m(ft.Provider,{value:t,children:e})}function ht(t="react-os-shell:prefs",e){const[r,o]=n(()=>{try{const r=JSON.parse(localStorage.getItem(t)||"{}");return{...e??{},...r}}catch{return{...e??{}}}},{...e??{}});return{prefs:r,save:d(e=>{o(r=>{const n={...r,...e};try{localStorage.setItem(t,JSON.stringify(n))}catch{}return n})},[t])}}var vt={prefs:{},save:()=>{}};function gt(){return u(ft)??vt}function pt(){const{prefs:t,save:e}=gt(),r=d(t=>{const r=e(t);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[e]);return f(()=>({prefs:t,save:r}),[t,r])}var wt="react-os-shell:stale-chunk-reload-at",xt=3e4,bt="vite:preloadError",yt="/_next/static/",Ct=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function _t(t){if(t instanceof Error&&"ChunkLoadError"===t.name)return!0;const e=t instanceof Error?t.message:"string"==typeof t?t:"";return Ct.test(e)}function kt(t={}){if("undefined"==typeof window)return()=>{};const e=t.cooldownMs??3e4,r=t.reload??(()=>window.location.reload()),n=t.now??Date.now,o=void 0===t.storage?function(){try{const t=window.sessionStorage;return t.getItem(wt),t}catch{return null}}():t.storage,s=void 0===t.chunkPathPrefix?yt:t.chunkPathPrefix,a=t=>{const r=n(),s=function(t){if(!t)return null;try{const e=t.getItem(wt),r=null===e?NaN:Number(e);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==s&&r-s<e?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",t),!1):(function(t,e){if(t)try{t.setItem(wt,String(e))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",t),!0)},i=t=>{const e=t.payload;_t(e)&&a(e)&&(t.preventDefault(),r())};let l=!0,c=!1;const u=/* @__PURE__ */new Set,d=null===s?null:t=>{const e=function(t,e){const r=t.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(t){const e=t.rel.toLowerCase().split(/\s+/);if(e.includes("stylesheet")||e.includes("modulepreload"))return!0;const r=(t.getAttribute("as")??"").toLowerCase();return e.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:t instanceof window.ErrorEvent&&"SyntaxError"===t.error?.name&&(n=t.filename),!n)return null;try{const t=new URL(e,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(t)?r:null}catch{return null}}(t,s);!e||c||u.has(e)||(u.add(e),async function(t){try{const e=await fetch(t,{method:"HEAD",cache:"no-store"});return 404===e.status||410===e.status||e.ok&&/\btext\/html\b/i.test(e.headers.get("content-type")??"")}catch{return!1}}(e).then(t=>{u.delete(e),t&&l&&!c&&a(e)&&(c=!0,r())}))};return window.addEventListener(bt,i),d&&window.addEventListener("error",d,!0),()=>{l=!1,window.removeEventListener(bt,i),d&&window.removeEventListener("error",d,!0)}}export{B as ALT,ot as ALT_SHIFT_D,st as ALT_SHIFT_E,at as ALT_SHIFT_N,et as CMD_A,tt as CMD_DOT,G as CMD_ENTER,X as CMD_K,V as CMD_S,nt as CMD_SHIFT_Z,rt as CMD_Z,W as ColoredBadge,Q as ENTER,S as GROUP_COLORS,E as GROUP_COLORS_SOLID,dt as Kbd,$ as MOD,yt as NEXT_CHUNK_PATH_PREFIX,D as OneLineLabel,q as Result,Y as SHIFT,xt as STALE_CHUNK_RELOAD_COOLDOWN_MS,wt as STALE_CHUNK_RELOAD_KEY,mt as ShellPrefsProvider,P as StatusBadge,F as StatusBadgeProvider,N as TH_ONE_LINE,bt as VITE_PRELOAD_ERROR_EVENT,T as groupColors,kt as installStaleChunkReload,J as isMac,_t as isStaleChunkError,k as useIsMobile,L as useIsPhone,ht as useLocalStoragePrefs,pt as useShellPrefs,gt as useShellPrefsAdapter,lt as useShortcutLabel,H as useStatusLabel};
|
package/dist/chunk-HQJSOBDE.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{useIsPhone as e}from"./chunk-BRK2GETX.js";import{Tooltip as r}from"./chunk-RDLWLATO.js";import{useBrowserLayoutEffect as t,useBrowserState as n}from"./chunk-D65T4H6J.js";import{useShellStrings as o}from"./chunk-3IML3Y3Y.js";import{Icon as l}from"./chunk-76DRQSJM.js";import{createContext as i,useRef as a,useEffect as s,useCallback as c,useContext as u,useState as d,useReducer as h,useMemo as m,Fragment as f}from"react";import{jsx as p,jsxs as b}from"react/jsx-runtime";var g=(e,r,t)=>Math.min(t,Math.max(r,e));function v(e,r,t,n,o){return Math.round(g("left"===t||"top"===t?e+r:e-r,n,o))}function x(e,r,t){let n=null;try{n=window.localStorage.getItem(e)}catch{return null}const o=n?parseInt(n,10):NaN;return Number.isNaN(o)?null:g(o,r,t)}function w({width:e,onResize:n,orientation:l="vertical",side:i,min:u,max:d,defaultWidth:h=u,step:m=16,storageKey:f,label:b,hint:w,controls:y,className:N=""}){const z="horizontal"===l,k=o().resizeHandle,P=a(null),C=a({onResize:n,min:u,max:d,side:i});C.current={onResize:n,min:u,max:d,side:i},t(()=>{if(!f)return;const r=x(f,u,d);null!==r&&r!==e&&n(r)},[f]),s(()=>{if(!f)return;const r=window.setTimeout(()=>{try{window.localStorage.setItem(f,String(Math.round(e)))}catch{}},200);return()=>window.clearTimeout(r)},[e,f]);const D=c(()=>{P.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);s(()=>D,[D]);const M=e=>{P.current&&(e.currentTarget.hasPointerCapture?.(P.current.pointer)&&e.currentTarget.releasePointerCapture(P.current.pointer),D())},I="left"===i?"right-0":"right"===i?"left-0":"top"===i?"bottom-0":"top-0",T="left"===i?"right":"right"===i?"left":"top"===i?"bottom":"top",$=z?`absolute inset-x-0 ${I} z-10 flex h-2`:`absolute inset-y-0 ${I} z-10 flex w-2`;/* @__PURE__ */
|
|
2
|
-
return p(r,{content:w??k.hint,side:T,delay:600,className:`${$} ${N}`.trim(),children:/* @__PURE__ */p("div",{role:"separator",tabIndex:0,"aria-orientation":l,"aria-label":b??k.label,"aria-valuenow":Math.round(e),"aria-valuemin":u,"aria-valuemax":d,"aria-controls":y,"data-resize-handle":i,onPointerDown:r=>{0===r.button&&(r.preventDefault(),P.current={x:z?r.clientY:r.clientX,width:e,moved:!1,pointer:r.pointerId},r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor=z?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=P.current;if(!r)return;if(0===e.buttons)return void D();const t=(z?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:n,min:o,max:l,side:i}=C.current;n(v(r.width,t,i,o,l))},onPointerUp:M,onPointerCancel:M,onLostPointerCapture:()=>{P.current&&D()},onDoubleClick:()=>n(g(h,u,d)),onKeyDown:r=>{const t=z?"ArrowDown":"ArrowRight",o=z?"ArrowUp":"ArrowLeft",l=r.key===t?m:r.key===o?-m:null,a=null!==l?v(e,l,i,u,d):"Home"===r.key?u:"End"===r.key?d:"Enter"===r.key?g(h,u,d):null;null!==a&&(r.preventDefault(),a!==e&&n(a))},className:z?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */p("div",{"aria-hidden":"true",className:z?`absolute inset-x-0 ${I} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${I} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}var y=i(null),N=i(!1);function z(){return u(y)}function k(){return u(N)}var P=(e,r,t)=>Math.min(Math.max(e,r),t);function C({sidebar:r,sidebarTop:t,sidebarBottom:l,children:i,side:s="left",storageKey:c,defaultWidth:u=256,minWidth:f=180,maxWidth:g=480,className:v="",sidebarClassName:y=("right"===s?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:N="bg-white"}){const z="right"===s,k=o().sidebar,C=e(),I=function(){const[e,r]=d(!1),t=a(null),n=a(/* @__PURE__ */new Map),[,o]=h(e=>e+1,0),l=m(()=>({report(e,r,t){const l={label:r,el:t};return n.current.set(e,l),o(),()=>{n.current.get(e)===l&&(n.current.delete(e),o())}}}),[]);return{api:l,open:e,setOpen:r,current:()=>[...n.current.values()].sort((e,r)=>e.el&&r.el&&e.el.compareDocumentPosition(r.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:t}}(),[T,$]=n(()=>(c?x(c,f,g):null)??P(u,f,g),P(u,f,g)),R=null!=t||null!=l,E=/* @__PURE__ */b("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:T},children:[
|
|
3
|
-
/* @__PURE__ */b("div",{className:`flex h-full flex-col ${R?"overflow-hidden":"overflow-y-auto"} ${y}`,children:[null!=t&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:t}),R?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r}):r,null!=l&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:l})]}),
|
|
4
|
-
/* @__PURE__ */p(w,{side:s,width:T,onResize:$,min:f,max:g,defaultWidth:P(u,f,g),storageKey:c,hint:k.resize})]}),L=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${N}`,children:i});/* @__PURE__ */
|
|
5
|
-
return b("div",C?{className:`relative flex h-full w-full flex-col overflow-hidden ${v}`,children:[
|
|
6
|
-
/* @__PURE__ */p(D,{phone:I,top:t,fallback:k.sections}),L,
|
|
7
|
-
/* @__PURE__ */p(M,{phone:I,bottom:l,label:k.sections,closeLabel:k.closeSections,children:r})]}:{className:`flex h-full w-full overflow-hidden ${v}`,children:[z?null:E,L,z?E:null]})}function D({phone:e,top:r,fallback:t}){const n=e.current();/* @__PURE__ */
|
|
8
|
-
return b("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
9
|
-
/* @__PURE__ */b("button",{ref:e.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":e.open,onClick:()=>e.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
10
|
-
/* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===n.length?t:n.map((e,r)=>/* @__PURE__ */b(f,{children:[r>0&&" · ",e]},r))}),
|
|
11
|
-
/* @__PURE__ */p(l,{name:"chevron-down",className:"size-4 shrink-0",strokeWidth:2,"aria-hidden":"true"})]}),null!=r&&/* @__PURE__ */p(N.Provider,{value:!0,children:/* @__PURE__ */p("div",{className:"flex min-w-0 max-w-[60%] shrink-0 items-center gap-2",children:r})})]})}function M({phone:e,bottom:r,label:t,closeLabel:n,children:o}){const l=a(null),{open:i,setOpen:c,trigger:u}=e,d=()=>{c(!1),l.current?.contains(document.activeElement)&&u.current?.focus()};return s(()=>{i&&l.current?.focus()},[i]),
|
|
12
|
-
/* @__PURE__ */b(y.Provider,{value:e.api,children:[i&&/* @__PURE__ */p("button",{type:"button","aria-label":n,onClick:d,className:"absolute inset-0 z-(--z-in-box) cursor-default bg-gray-900/40"}),
|
|
13
|
-
/* @__PURE__ */b("div",{ref:l,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,"data-sidebar-section-sheet":!0,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),d())},onClick:e=>{const r=e.target.closest("button, a");!r||r.hasAttribute("aria-expanded")||r.closest("[data-sheet-keep-open]")||d()},className:(i?"flex":"hidden")+" absolute inset-x-0 bottom-0 z-(--z-in-box) max-h-[75%] flex-col rounded-t-2xl bg-white pt-2 shadow-(--elevation-dialog)",children:[
|
|
14
|
-
/* @__PURE__ */p("div",{className:"mx-auto mb-2 h-1 w-9 shrink-0 rounded-full bg-gray-300","aria-hidden":"true"}),
|
|
15
|
-
/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:o}),null!=r&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:r})]})]})}export{w as ResizeHandle,C as SidebarLayout,k as useInSidebarBar,z as useSidebarSheet};
|
package/dist/chunk-LHHIRTEG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createContext as t,useContext as e}from"react";import{jsx as r}from"react/jsx-runtime";var n={},o=new Proxy(n,{get:(t,e)=>n[e],has:(t,e)=>e in n,ownKeys:()=>Object.keys(n),getOwnPropertyDescriptor(t,e){if(e in n)return{configurable:!0,enumerable:!0,value:n[e]}}});function a(t){for(const t of Object.keys(n))delete n[t];Object.assign(n,t)}var u={},i=[],c={erp:[],system:[],virtual:[],footer:[]},s=t({hasAnyPerm:()=>!0});function d({value:t,children:e}){/* @__PURE__ */
|
|
2
|
-
return r(s.Provider,{value:t,children:e})}function m(){return e(s)}var l=240,h=68,f=40,p="react-os-shell:work-area-changed";function w(){const t=getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--taskbar-height"))||0,r=parseInt(t.getPropertyValue("--taskbar-width"))||0,n=t.getPropertyValue("--taskbar-position")?.trim()||"bottom",o=parseInt(t.getPropertyValue("--sidebar-width"))||0;return{x:("left"===n?r:0)+o,y:"top"===n?e:0,w:window.innerWidth-("left"===n||"right"===n?r:0)-o,h:window.innerHeight-("top"===n||"bottom"===n?e:0)}}function y(t,e,r){const n=r?e.w+280:e.w-280,o=Math.abs(t.w-e.w)<=4||Math.abs(t.w-n)<=4;return Math.abs(t.h-e.h)<=4&&o}function g({over:t,residual:e},r){return e<=1||t-e>=r-2}function b(t,e,r){let n=t;for(const o of r)g(o,e)&&(n=Math.max(n,t+o.over));return Math.ceil(n)}function v(t,e,r,n){const o=Math.min(e,r.w-2*n);if(o<=t.w+1)return t;const a=r.x+n,u=r.x+r.w-n-o,i=Math.min(Math.max(t.x-(o-t.w)/2,a),u);return{...t,x:Math.round(i),w:Math.round(o)}}function x(){return(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width"))||0)>0}function M(){return"undefined"!=typeof document&&"sidebar"===getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim()}export{h as RAIL_COLLAPSED_W,l as RAIL_W,d as ShellAuthProvider,f as TAB_STRIP_H,p as WORK_AREA_CHANGED_EVENT,y as boxFillsWorkArea,w as computeMaximizedBox,v as growBoxToWidth,x as isSidebarStripReserved,o as navIcons,i as navSections,M as readAlwaysMaximizedFlag,g as scrollerIsFluid,u as sectionIcons,a as setShellNavIcons,c as startMenuCategories,m as useShellAuth,b as widthToFit};
|
package/dist/chunk-QXAPPMUE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="7.64.0",a=r;export{a as APP_VERSION,r as VERSION};
|
package/dist/chunk-TT6QOFWA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useShellAuth as e}from"./chunk-LHHIRTEG.js";var t={};function r(e){t=e}function n(){const{hasAnyPerm:r}=e();return{user:t.user,logout:t.logout??(()=>{}),hasAnyPerm:r}}var o="react-os-shell:sidebar-collapsed",c="react-os-shell:sidebar-open-sections";function s(e,t){return"true"===e||"false"!==e&&t<1024}function a(e){if(!e)/* @__PURE__ */return new Set;try{const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e))return new Set(t)}catch{}/* @__PURE__ */
|
|
2
|
-
return new Set}function u(e,t){const r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r}function l(e){try{return localStorage.getItem(e)}catch{return null}}function i(e,t){try{localStorage.setItem(e,t)}catch{}}export{o as RAIL_COLLAPSED_KEY,c as RAIL_OPEN_SECTIONS_KEY,s as initialRailCollapsed,a as parseOpenSections,l as readStored,r as setShellAuthBridge,u as toggleOpenSection,n as useAuth,i as writeStored};
|
package/dist/chunk-ZOJJB5BQ.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{useDismissPopupsOnOpen as a}from"./chunk-UVBK6YSR.js";import{glassStyle as l}from"./chunk-7IQ3B77H.js";import{Z_LAYERS as o}from"./chunk-FIEA5CGB.js";import{useShellStrings as s}from"./chunk-3IML3Y3Y.js";import{SpinnerRing as i,LoadingSpinner as c}from"./chunk-2J6F4EE7.js";import{useState as d,useEffect as u,useRef as p,useMemo as y,useId as f,useCallback as m}from"react";import{jsx as h,jsxs as b}from"react/jsx-runtime";import{createPortal as g}from"react-dom";var k={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function x(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function v(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 w={"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 N(e,t,n){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:n}}function L({src:e,fallbackSrc:t,fallbackHasAlpha:n=null,fallbackIsLight:r=null,fallbackAdaptive:a,alt:l,slot:o="compact",surface:s="light",size:i,width:c,height:p,decorative:y=!1,fallbackMode:f="monogram",adaptive:m=!1,hasAlpha:b=null,isLight:g=null,treatmentPadding:L=4,treatmentRadius:_=8,className:A="",style:C}){const[E,$]=d(e||t||"");u(()=>{$(e||t||"")},[e,t]);const I=Boolean(t&&E===t&&E!==e),T=(I?a??m:m)?v(I?n:b,I?r:g,s):"bare",j=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==i&&null==c&&null==p?k[o]:"","dark"===s?"text-white":"text-gray-700",w[T],A].filter(Boolean).join(" "),S={...N(T,_,L),...null==i?{width:c,height:p}:{width:i,height:i},...C};return E?/* @__PURE__ */h("span",{className:j,"data-brand-treatment":T,style:S,children:/* @__PURE__ */h("img",{src:E,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>$(e=>t&&e!==t?t:"")})}):"none"===f?null:/* @__PURE__ */h("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:x(l)})}function _(n,r){return e(n,r)?n.items.filter(n=>e(n,r)&&t(n,r)):[]}function A(e,r){return n(e,r).filter(e=>t(e,r))}function C(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)&&_(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 E(e,t,n){return!!t&&e.some(e=>e.to===t||E(A(e,n),t,n))}var $="__page__";function I(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=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,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:$,entity_id:e.to}))}return l.slice(0,8)},{destinations:r})}function j(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?$:r.entityType,entity_id:r.entityId})}return n}var S="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function M(e){return e.typeKey??e.type}function R(e,t){return t?.[M(e)]??e.type}function K(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 B(e,t,n,r){return{type:e,label:t,entity_type:$,entity_id:`${n}?search=${encodeURIComponent(r.trim())}`}}function D(e,t,n,r,a){const l=function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=M(n),r=t.get(e);r?r.results.push(n):t.set(e,{type:n.type,results:[n]})}return Array.from(t,([e,t])=>({key:e,...t}))}(e).map(e=>{const t=e.results.map((t,n)=>({kind:"result",key:`result:${e.key}:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,result:t})),r=!!a?.truncatedTypes?.includes(e.key),l=r?a?.listRoutes?.[e.key]:void 0,o=a?.typeLabels?.[e.key]??e.type;if(a&&l){const r=a.seeAllLabel(l.label);t.push({kind:"seeAll",key:`seeall:${e.key}`,label:r,result:B(o,r,l.path,n)})}return{key:`type:${e.key}`,title:o,rows:t,count:e.results.length,truncated:r}}),o=K("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 P(e,t,n){return 0===n?0:Math.min(Math.max(e+t,0),n-1)}var z=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function F(e,t,n=8){return[t,...e.filter(e=>!z(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),"string"==typeof e.typeKey&&(r.typeKey=e.typeKey),t.some(e=>z(e,r))||t.push(r)}return t.slice(0,8)}function U(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 W=[];function Y(e,t,n){const[r,a]=d([]),[l,o]=d(W),[s,i]=d(!1),[c,y]=d("none"),f=p(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}}());u(()=>{const r=f.current;if(e.length<n||!t||0===t.length)return r.cancel(),a(e=>0===e.length?e:[]),o(W),y("none"),void i(!1);i(!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,...U(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),y(0===l.failed?"none":l.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(l),r.cancel()}},[e,t,n]);return{results:r,truncatedTypes:l,loading:s,failure:c,reset:m(()=>{f.current.cancel(),a(e=>0===e.length?e:[]),o(W),y("none"),i(!1)},[])}}var G=(e,t)=>`${e}-opt-${t}`;function O(e,t){if("seeAll"===e.kind)return"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3";if("action"===e.kind)return e.icon??S;if(e.icon)return e.icon;const n=t?.[M(e.result)];return n||S}function V({sections:e,activeIdx:t,listId:n,label:r,typeIcons:a,groupCount:l,groupLabel:o,onHover:s,onPick:i}){let c=0;/* @__PURE__ */
|
|
2
|
-
return h("div",{id:n,role:"listbox","aria-label":r,className:"py-1",children:e.map(e=>/* @__PURE__ */b("div",{role:"group","aria-label":o(e.title,e.count,!!e.truncated),children:[
|
|
3
|
-
/* @__PURE__ */b("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
4
|
-
/* @__PURE__ */h("span",{children:e.title}),
|
|
5
|
-
/* @__PURE__ */h("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 b("div",{id:G(n,r),role:"option","aria-selected":l,className:"flex items-center gap-3 w-full px-4 py-3 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__ */h("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__ */h("path",{strokeLinecap:"round",strokeLinejoin:"round",d:O(e,a)})}),
|
|
8
|
-
/* @__PURE__ */b("div",{className:"flex-1 min-w-0",children:[
|
|
9
|
-
/* @__PURE__ */h("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */h("p",{className:"text-xs text-gray-400 truncate",children:d})]}),o&&/* @__PURE__ */h("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-gray-500",children:o})]},e.key)})]},e.key))})}var X="react-os-shell:open-global-search";function q(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(X))}function J({providers:e,typeIcons:t,typeLabels:n,listRoutes:r,placeholder:k,quickActions:x,onSelect:v,recent:w,onRecord:N,favorites:L,hotkey:_=!0}={}){const A=s().search,C=k??A.placeholder,[E,$]=d(!1),[I,T]=d(""),[j,M]=d(0),B=p(null),{results:z,truncatedTypes:F,loading:H,failure:U,reset:W}=Y(I,e,2);u(()=>{const e=e=>{_&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),$(e=>!e)),"Escape"===e.key&&E&&$(!1)},t=()=>$(!0);return window.addEventListener("keydown",e),window.addEventListener(X,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(X,t)}},[E,_]),a(E);const[O,q]=d(!1);E!==O&&(q(E),E&&(T(""),M(0),W())),u(()=>{E?setTimeout(()=>B.current?.focus(),50):T("")},[E]),u(()=>{M(0)},[z]);const J=I.length>=2,Q=y(()=>J?D(z,x,I,A.actions,{truncatedTypes:F,listRoutes:r,typeLabels:n,seeAllLabel:A.seeAll}):function(e,t){const n=[];e.recent?.length&&n.push({key:"recent",title:t.recent,rows:e.recent.map((t,n)=>({kind:"recent",key:`recent:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,badge:R(t,e.typeLabels),result:t})),count:e.recent.length}),e.favorites?.length&&n.push({key:"favorites",title:t.favorites,rows:e.favorites.map((t,n)=>({kind:"favorite",key:`favorite:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,badge:R(t,e.typeLabels)||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:t})),count:e.favorites.length});const r=K("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:w,favorites:L,actions:x,typeLabels:n},A),[J,z,F,r,n,x,I,w,L,A]),Z=y(()=>function(e){return e.flatMap(e=>e.rows)}(Q),[Q]),ee=Math.min(j,Math.max(Z.length-1,0)),te=f(),ne=Z.length>0;u(()=>{E&&0!==Z.length&&document.getElementById(G(te,ee))?.scrollIntoView?.({block:"nearest"})},[E,ee,Z.length,te]);const re=m(e=>{$(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||N?.(e.result),v?.(e.result)):e.action.onSelect()},[v,N]);return E?g(
|
|
10
|
-
/* @__PURE__ */b("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:o.overlay},onClick:()=>$(!1),children:[
|
|
11
|
-
/* @__PURE__ */h("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
|
|
12
|
-
/* @__PURE__ */b("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:l(),children:[
|
|
13
|
-
/* @__PURE__ */b("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
|
|
14
|
-
/* @__PURE__ */h("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */h("path",{strokeLinecap:"round",strokeLinejoin:"round",d:S})}),
|
|
15
|
-
/* @__PURE__ */h("input",{ref:B,type:"text",value:I,onChange:e=>{T(e.target.value),M(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),M(P(ee,1,Z.length))):"ArrowUp"===e.key?(e.preventDefault(),M(P(ee,-1,Z.length))):"Tab"===e.key&&Z.length>0?(e.preventDefault(),M(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]}(Q.map(e=>e.rows.length),ee,e.shiftKey?-1:1))):"Enter"===e.key&&Z[ee]&&re(Z[ee])},placeholder:C,role:"combobox","aria-expanded":ne,"aria-controls":ne?te:void 0,"aria-activedescendant":ne?G(te,ee):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),H&&/* @__PURE__ */h("span",{"data-global-search-spinner":"",role:"status","aria-label":A.searching,className:"flex shrink-0",children:/* @__PURE__ */h(i,{className:"h-4 w-4",ink:"text-gray-500"})}),
|
|
16
|
-
/* @__PURE__ */h("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-2 py-0.5 text-2xs font-medium text-gray-400",children:A.escBadge})]}),
|
|
17
|
-
/* @__PURE__ */b("div",{className:"max-h-[50vh] overflow-y-auto",children:[H&&0===Z.length&&/* @__PURE__ */h(c,{size:"sm",padding:"py-6",label:A.searching}),!H&&"all"===U&&J&&/* @__PURE__ */h("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:A.searchFailed}),!H&&J&&0===Z.length&&"all"!==U&&/* @__PURE__ */h("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:A.noResults}),ne&&/* @__PURE__ */h(V,{sections:Q,activeIdx:ee,listId:te,label:A.listLabel,typeIcons:t,groupCount:A.groupCount,groupLabel:A.groupLabel,onHover:M,onPick:re}),!H&&"some"===U&&J&&/* @__PURE__ */h("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:A.partialFailure}),!H&&!J&&0===Z.length&&/* @__PURE__ */h("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:A.minChars(2)})]}),
|
|
18
|
-
/* @__PURE__ */b("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-2xs text-gray-400",children:[
|
|
19
|
-
/* @__PURE__ */b("div",{className:"flex items-center gap-3",children:[
|
|
20
|
-
/* @__PURE__ */b("span",{className:"flex items-center gap-1",children:[
|
|
21
|
-
/* @__PURE__ */h("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
|
|
22
|
-
/* @__PURE__ */h("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${A.navigate}`]}),
|
|
23
|
-
/* @__PURE__ */b("span",{className:"flex items-center gap-1",children:[
|
|
24
|
-
/* @__PURE__ */h("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:A.enterKey}),` ${A.open}`]}),Q.length>1&&/* @__PURE__ */b("span",{className:"flex items-center gap-1",children:[
|
|
25
|
-
/* @__PURE__ */h("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:A.tabKey}),` ${A.nextGroup}`]})]}),
|
|
26
|
-
/* @__PURE__ */b("span",{className:"flex items-center gap-1",children:[
|
|
27
|
-
/* @__PURE__ */h("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:A.escKey}),` ${A.close}`]})]})]})]}),document.body):null}export{L as BrandMark,J as GlobalSearch,$ as PAGE_RESULT_ENTITY,j as favoritesToResults,T as navPagesProvider,q as openGlobalSearch,I as parsePageResultTarget,C as partitionNav,F as pushRecent,v as resolveBrandMarkTreatment,E as rowsContainRoute,H as sanitizeRecent,A as visibleNavChildren,_ as visibleSectionItems};
|