efficient-shell 7.45.0 → 7.46.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 +65 -0
- package/dist/{Browser-7M22OFSW.js → Browser-VNDS2FSD.js} +14 -14
- package/dist/Calculator-YGJ7I5VT.js +29 -0
- package/dist/ConfirmDialog-OJLZG4QL.js +1 -0
- package/dist/{CurrencyConverter-4QTVWEFM.js → CurrencyConverter-PH75TBDL.js} +6 -6
- package/dist/{Documents-LELK7IBM.js → Documents-KSO66MP3.js} +22 -22
- package/dist/Files-TGXFG2JF.js +87 -0
- package/dist/{Notepad-CLHKYQ34.js → Notepad-OUMZHB2S.js} +14 -14
- package/dist/PdfViewer-D4GRPG4G.js +1 -0
- package/dist/{PomodoroTimer-L45QS5OR.js → PomodoroTimer-BUKDNFPJ.js} +24 -24
- package/dist/{Preview-47BCBIP4.js → Preview-SGYKP5VY.js} +66 -66
- package/dist/Sidebar-A3UG662D.js +44 -0
- package/dist/{Spreadsheet-6NX5WA4J.js → Spreadsheet-OVBIGF7S.js} +12 -12
- package/dist/{Stock-ZZ6AM43M.js → Stock-FB5VIBVY.js} +3 -3
- package/dist/{Weather-K3BZD2NX.js → Weather-2MOP5LTK.js} +17 -17
- package/dist/{WorldClock-5STYQA56.js → WorldClock-KMMKBE4B.js} +6 -6
- package/dist/ai/index.d.ts +271 -0
- package/dist/ai/index.js +37 -0
- package/dist/ai.css +2 -0
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-JJBFXVOY.js → chunk-3RKM5ZGV.js} +2 -2
- package/dist/{chunk-YRLOXHKG.js → chunk-3ZZ2UPNR.js} +1 -1
- package/dist/{chunk-DENNF2LM.js → chunk-4FQTMGCA.js} +2 -2
- package/dist/{chunk-M2AM6DAA.js → chunk-4QW4I2XQ.js} +1 -1
- package/dist/{chunk-GM2ASLIK.js → chunk-4TOFAEAW.js} +29 -29
- package/dist/{chunk-G4UIEBPD.js → chunk-BFJRKFOH.js} +13 -13
- package/dist/{chunk-HPUHB47C.js → chunk-BMYURA2N.js} +1 -1
- package/dist/chunk-CLYMUTNF.js +27 -0
- package/dist/{chunk-PR7MCFEU.js → chunk-EZTEOTUD.js} +95 -95
- package/dist/{chunk-FQIZMZDX.js → chunk-FBXOKW33.js} +3 -3
- package/dist/{chunk-K6YIBHZN.js → chunk-FGPEAC7B.js} +16 -16
- package/dist/{chunk-XYG3CVL5.js → chunk-FY3H52BM.js} +1 -1
- package/dist/{chunk-ABKFLSHY.js → chunk-G32MW4IF.js} +1 -1
- package/dist/{chunk-UNLQRUWP.js → chunk-GFWRYNPX.js} +18 -18
- package/dist/{chunk-LK7BWXYY.js → chunk-JFZLYYAN.js} +1 -1
- package/dist/{chunk-JXMYF3JR.js → chunk-JGWOY2KV.js} +9 -9
- package/dist/chunk-KRAJDKZC.js +1 -0
- package/dist/{chunk-UNA3BQJI.js → chunk-MMLU5ZHI.js} +9 -9
- package/dist/{chunk-XDR3Y3WU.js → chunk-RNPURBKT.js} +5 -5
- package/dist/chunk-RWNNFCSA.js +1 -0
- package/dist/chunk-UBXRSOQ6.js +47 -0
- package/dist/{chunk-CWCKDF37.js → chunk-VJ6KJYRS.js} +3 -3
- package/dist/{chunk-LTEM56OL.js → chunk-WSRZRWN7.js} +1 -1
- package/dist/chunk-XGOXX466.js +1020 -0
- package/dist/{chunk-3G5TA3IF.js → chunk-YT4B3NSV.js} +4 -3
- package/dist/{chunk-HQ74L5MM.js → chunk-YWJD6RUT.js} +1 -1
- package/dist/{chunk-X6NYTLYX.js → chunk-ZELMENOO.js} +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/{index-BWDtKUcA.d.ts → index-BI54lOAz.d.ts} +30 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +682 -682
- package/dist/map/index.js +8 -8
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +21 -4
- package/dist/Calculator-LKWOOCNC.js +0 -29
- package/dist/ConfirmDialog-ZT3XT66V.js +0 -1
- package/dist/Files-LAWZGFQQ.js +0 -87
- package/dist/PdfViewer-VJ743BW7.js +0 -1
- package/dist/Sidebar-AYYJL3IJ.js +0 -44
- package/dist/chunk-NGWXT4QX.js +0 -1
- package/dist/chunk-NZBFQTOB.js +0 -27
- package/dist/chunk-WGSCC6QU.js +0 -1050
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-3E27HV76.js";import{
|
|
2
|
-
return s(e,{content:x??k.hint,side:R,delay:600,className:`${T} ${z}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":c,"aria-label":w??k.label,"aria-valuenow":Math.round(
|
|
3
|
-
/* @__PURE__ */a("div",{className:`flex h-full flex-col ${k?"overflow-hidden":"overflow-y-auto"} ${p}`,children:[null!=
|
|
1
|
+
import{Tooltip as e}from"./chunk-3E27HV76.js";import{useBrowserLayoutEffect as r,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as o}from"./chunk-LVCRH3K6.js";import{useRef as n,useEffect as i,useCallback as l}from"react";import{jsx as s,jsxs as a,Fragment as c}from"react/jsx-runtime";var u=(e,r,t)=>Math.min(t,Math.max(r,e));function d(e,r,t,o,n){return Math.round(u("left"===t||"top"===t?e+r:e-r,o,n))}function h(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:u(n,r,t)}function f({width:t,onResize:a,orientation:c="vertical",side:f,min:m,max:v,defaultWidth:g=m,step:b=16,storageKey:p,label:w,hint:x,controls:y,className:z=""}){const N="horizontal"===c,k=o().resizeHandle,P=n(null),$=n({onResize:a,min:m,max:v,side:f});$.current={onResize:a,min:m,max:v,side:f},r(()=>{if(!p)return;const e=h(p,m,v);null!==e&&e!==t&&a(e)},[p]),i(()=>{if(!p)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(p,String(Math.round(t)))}catch{}},200);return()=>window.clearTimeout(e)},[t,p]);const C=l(()=>{P.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);i(()=>C,[C]);const M=e=>{P.current&&(e.currentTarget.hasPointerCapture?.(P.current.pointer)&&e.currentTarget.releasePointerCapture(P.current.pointer),C())},D="left"===f?"right-0":"right"===f?"left-0":"top"===f?"bottom-0":"top-0",R="left"===f?"right":"right"===f?"left":"top"===f?"bottom":"top",T=N?`absolute inset-x-0 ${D} z-10 flex h-2`:`absolute inset-y-0 ${D} z-10 flex w-2`;/* @__PURE__ */
|
|
2
|
+
return s(e,{content:x??k.hint,side:R,delay:600,className:`${T} ${z}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":c,"aria-label":w??k.label,"aria-valuenow":Math.round(t),"aria-valuemin":m,"aria-valuemax":v,"aria-controls":y,"data-resize-handle":f,onPointerDown:e=>{0===e.button&&(e.preventDefault(),P.current={x:N?e.clientY:e.clientX,width:t,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=N?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=P.current;if(!r)return;if(0===e.buttons)return void C();const t=(N?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:l}=$.current;o(d(r.width,t,l,n,i))},onPointerUp:M,onPointerCancel:M,onLostPointerCapture:()=>{P.current&&C()},onDoubleClick:()=>a(u(g,m,v)),onKeyDown:e=>{const r=N?"ArrowDown":"ArrowRight",o=N?"ArrowUp":"ArrowLeft",n=e.key===r?b:e.key===o?-b:null,i=null!==n?d(t,n,f,m,v):"Home"===e.key?m:"End"===e.key?v:"Enter"===e.key?u(g,m,v):null;null!==i&&(e.preventDefault(),i!==t&&a(i))},className:N?"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__ */s("div",{"aria-hidden":"true",className:N?`absolute inset-x-0 ${D} 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 ${D} 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 m=(e,r,t)=>Math.min(Math.max(e,r),t);function v({sidebar:e,sidebarTop:r,sidebarBottom:n,children:i,side:l="left",storageKey:u,defaultWidth:d=256,minWidth:v=180,maxWidth:g=480,className:b="",sidebarClassName:p=("right"===l?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:w="bg-white"}){const x="right"===l,y=o().sidebar,[z,N]=t(()=>(u?h(u,v,g):null)??m(d,v,g),m(d,v,g)),k=null!=r||null!=n,P=/* @__PURE__ */a("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:z},children:[
|
|
3
|
+
/* @__PURE__ */a("div",{className:`flex h-full flex-col ${k?"overflow-hidden":"overflow-y-auto"} ${p}`,children:[null!=r&&/* @__PURE__ */s("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:r}),k?/* @__PURE__ */s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */s("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
|
|
4
4
|
/* @__PURE__ */s(f,{side:l,width:z,onResize:N,min:v,max:g,defaultWidth:m(d,v,g),storageKey:u,hint:y.resize})]}),$=/* @__PURE__ */s("div",{className:`flex min-w-0 flex-1 flex-col ${w}`,children:i});/* @__PURE__ */
|
|
5
5
|
return s("div",{className:`flex h-full w-full overflow-hidden ${b}`,children:/* @__PURE__ */a(c,x?{children:[$,P]}:{children:[P,$]})})}export{f as ResizeHandle,v as SidebarLayout};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=n().pdf,k=i(null),C=i(null),N=i(null),[E
|
|
1
|
+
import{toast_default as e}from"./chunk-WSRZRWN7.js";import{Icon as t}from"./chunk-YT4B3NSV.js";import{useShellStrings as n}from"./chunk-LVCRH3K6.js";import{LoadingSpinner as r}from"./chunk-2J6F4EE7.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
|
|
2
|
+
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=n().pdf,k=i(null),C=i(null),N=i(null),[j,E]=s(null),[M,z]=s(1),[W,_]=s(0),[P,S]=s(1),[D,L]=s(!0),[T,$]=s(!0),A=i(x.loadFailed);A.current=x.loadFailed,l(()=>{let t=!1;return $(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(E(e),_(e.numPages),$(!1))}).catch(()=>{t||(e.error(A.current),$(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!j||!D||!N.current)return;const e=()=>{const e=N.current;e&&j.getPage(M).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});S(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[j,M,D,d]),l(()=>{if(!j||!k.current)return;let e=!1,t=null,n=null;return j.getPage(M).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:P}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[j,M,P]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const O="page"===d?x.fitPage:x.fitWidth,R="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
|
|
3
3
|
return m("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */m(f,{children:[
|
|
5
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:M<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(
|
|
6
|
-
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(M,
|
|
7
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(
|
|
5
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:M<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
6
|
+
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(M,W)}),
|
|
7
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(W,e+1)),disabled:M>=W,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
8
8
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
9
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{
|
|
10
|
-
/* @__PURE__ */m("select",{value:
|
|
11
|
-
/* @__PURE__ */u("option",{value:"fit",children:O}),!
|
|
12
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{
|
|
13
|
-
/* @__PURE__ */u("button",{type:"button",onClick:()=>
|
|
9
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{L(!1),S(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:R,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */m("select",{value:D?"fit":v.includes(Math.round(100*P))?Math.round(100*P):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(L(!1),S(Number(t)/100)):L(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
|
|
11
|
+
/* @__PURE__ */u("option",{value:"fit",children:O}),!D&&!v.includes(Math.round(100*P))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*P),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
|
|
12
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{L(!1),S(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:R,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
+
/* @__PURE__ */u("button",{type:"button",onClick:()=>L(!0),"aria-pressed":D,className:R+(D?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
|
|
14
14
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!
|
|
16
|
-
/* @__PURE__ */u(
|
|
17
|
-
/* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:
|
|
18
|
-
/* @__PURE__ */u(
|
|
19
|
-
/* @__PURE__ */u(
|
|
20
|
-
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!j)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=W;e++)n.push(j.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:R,children:[
|
|
16
|
+
/* @__PURE__ */u(t,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
|
|
17
|
+
/* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:R,children:[
|
|
18
|
+
/* @__PURE__ */u(t,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:R,children:[
|
|
19
|
+
/* @__PURE__ */u(t,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
|
|
20
|
+
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!j)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&M<W?(e.preventDefault(),z(e=>Math.min(W,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!j)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?M<W&&(e.preventDefault(),z(e=>Math.min(W,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(W)))},children:T?/* @__PURE__ */u(r,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
|
|
21
21
|
/* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
|
|
22
22
|
/* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
|
|
23
23
|
/* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-
|
|
1
|
+
import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-WSRZRWN7.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 n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({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 n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{VERSION as e}from"./chunk-NGWXT4QX.js";import{setBoundaryErrorReporter as t}from"./chunk-KNUR2UEG.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},x=class{p;l;h(e){this.p?.(e)}},N=[2500,4e3],j=[800,1800],B=e=>{document.prerendering?C(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,W=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,D=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,G=/\d{4,}/g,V=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Q=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(X,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Q.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(X,"").split(/[?#]/,1)[0].replace(V,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=t.getAccessToken();i&&n(t.endpoint??"/api/client-telemetry/web-batches/",{method:"POST",keepalive:!0,credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const d=n.fetch??window.fetch.bind(window),l=new q({app:n.app,release:n.release,shell_version:H.test(e)?e:""}),u=ne(n.routeKey()),f=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let v=!1;const m=()=>{for(const e of l.drain())oe(e,n,d)},E=e=>{v||(l.addError(e),l.size>=50&&m())},L=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(W,"[url]").replace(D,"[id]").replace(G,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a},k=e=>{v||(l.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,u,()=>ne(n.routeKey()),f)),l.size>=50&&m())},S=n.vitalsSampleRate??1;S>0&&(S>=1||(n.random??Math.random)()<S)&&(((e,t={})=>{let n=!1;const s=w(t);C(()=>{let d,l=h(),u=g("LCP");const f=p(t,x),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,N,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,N,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,N,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(k),R(k),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(k),P(k),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,j,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,j,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,j,t.reportAllChanges),d(!0))})},t)}})})(k));const z=e=>{const{error:t,message:n,filename:i,lineno:a,colno:r}=e;if(null!=t)return void E(L(t,"onerror"));const o=i?ee(`at ${i}:${a??0}:${r??0}`):[];E({...L(n??"","onerror"),frames:o})},M=e=>E(L(e.reason,"unhandledrejection")),$=()=>{"hidden"===document.visibilityState&&m()};window.addEventListener("error",z),window.addEventListener("unhandledrejection",M),document.addEventListener("visibilitychange",$),window.addEventListener("pagehide",m);const _=window.setInterval(m,n.flushIntervalMs??6e4),F=t(e=>E(L(e,"boundary"))),U={flush:m,reportError:e=>E(L(e,"boundary")),stop(){v||(m(),v=!0,window.removeEventListener("error",z),window.removeEventListener("unhandledrejection",M),document.removeEventListener("visibilitychange",$),window.removeEventListener("pagehide",m),window.clearInterval(_),F(),ae===U&&(ae=null))}};return ae=U,U}export{se as startClientTelemetry};
|
|
1
|
+
import{VERSION as e}from"./chunk-KRAJDKZC.js";import{setBoundaryErrorReporter as t}from"./chunk-KNUR2UEG.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},R=[200,500],F=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,R,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,R,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},x=class{p;l;h(e){this.p?.(e)}},j=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var K=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},q=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,J=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,D=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,V=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=t.getAccessToken();i&&n(t.endpoint??"/api/client-telemetry/web-batches/",{method:"POST",keepalive:!0,credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const d=n.fetch??window.fetch.bind(window),l=new K({app:n.app,release:n.release,shell_version:H.test(e)?e:""}),u=ne(n.routeKey()),f=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let v=!1;const m=()=>{for(const e of l.drain())oe(e,n,d)},C=e=>{v||(l.addError(e),l.size>=50&&m())},L=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(q,"[redacted]").replace(J,"[redacted]").replace(D,"[url]").replace(W,"[id]").replace(V,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a},k=e=>{v||(l.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,u,()=>ne(n.routeKey()),f)),l.size>=50&&m())},S=n.vitalsSampleRate??1;S>0&&(S>=1||(n.random??Math.random)()<S)&&(((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,x),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,j,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,j,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;_(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,j,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(k),F(k),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(k),P(k),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(k));const z=e=>{const{error:t,message:n,filename:i,lineno:a,colno:r}=e;if(null!=t)return void C(L(t,"onerror"));const o=i?ee(`at ${i}:${a??0}:${r??0}`):[];C({...L(n??"","onerror"),frames:o})},M=e=>C(L(e.reason,"unhandledrejection")),$=()=>{"hidden"===document.visibilityState&&m()};window.addEventListener("error",z),window.addEventListener("unhandledrejection",M),document.addEventListener("visibilitychange",$),window.addEventListener("pagehide",m);const Z=window.setInterval(m,n.flushIntervalMs??6e4),R=t(e=>C(L(e,"boundary"))),U={flush:m,reportError:e=>C(L(e,"boundary")),stop(){v||(m(),v=!0,window.removeEventListener("error",z),window.removeEventListener("unhandledrejection",M),document.removeEventListener("visibilitychange",$),window.removeEventListener("pagehide",m),window.clearInterval(Z),R(),ae===U&&(ae=null))}};return ae=U,U}export{se as startClientTelemetry};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{useDismissPopupsOnOpen as e}from"./chunk-UVBK6YSR.js";import{registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-FIEA5CGB.js";import{buttonClasses as r}from"./chunk-K7PQXJO7.js";import{
|
|
1
|
+
import{useDismissPopupsOnOpen as e}from"./chunk-UVBK6YSR.js";import{registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-FIEA5CGB.js";import{buttonClasses as r}from"./chunk-K7PQXJO7.js";import{Icon as l}from"./chunk-YT4B3NSV.js";import{useShellStrings as o,splitAround as i}from"./chunk-LVCRH3K6.js";import{createContext as a,useEffect as s,useRef as c,useId as d,useContext as u,useState as m,useCallback as f}from"react";import{jsxs as h,jsx as b,Fragment as g}from"react/jsx-runtime";var v=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function p(e){return Array.from(e.querySelectorAll(v)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var y=[];function x(e){const t=y.findIndex(t=>t!==e&&e.contains(t));-1===t?y.push(e):y.splice(t,0,e)}function w(e){const t=y.lastIndexOf(e);-1!==t&&y.splice(t,1)}var N=/* @__PURE__ */new WeakSet;function k(e){return p(e)}function C(e,t){s(()=>{if(!t)return;const n=e.current;return n?(N.add(n),x(n),()=>{w(n),N.delete(n)}):void 0},[e,t])}function E(e,t){const n=y.lastIndexOf(t),r=n>0?y[n-1]:-1===n?y[y.length-1]??null:null,l=p(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),o=l.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return o||(r&&!N.has(r)?l[0]??null:null)}function L(e,t,n){s(()=>{if(!t)return;const r=e.current;if(!r)return;const l=document.activeElement,o=n?.current??p(r)[0]??r;o!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),o.focus();const i=e=>{if("Tab"!==e.key)return;if(y[y.length-1]!==r)return;const t=p(r);if(0===t.length)return void e.preventDefault();const n=t[0],l=t[t.length-1],o=document.activeElement;!e.shiftKey||o!==n&&r.contains(o)?e.shiftKey||o!==l&&r.contains(o)||(e.preventDefault(),n.focus()):(e.preventDefault(),l.focus())};return x(r),document.addEventListener("keydown",i,!0),()=>{w(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&l?.focus?.()}},[e,t,n])}var P=0,j=null;function I(e){s(()=>{if(!e)return;const t=document.body;if(0===P){j={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 P+=1,()=>{0===(P-=1)&&j&&(t.style.overflow=j.overflow,t.style.paddingRight=j.paddingRight,j=null)}},[e])}function T({role:e="dialog",modal:t,titleId:n,labelledBy:r,label:l}){const o=n??r;return{role:e,"aria-modal":!!t||void 0,"aria-labelledby":o,"aria-label":o?void 0:l}}var D={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function F({open:r,onClose:i,title:a,description:u,role:m="dialog",children:f,footer:g,blocking:v=!1,size:p="md",initialFocus:y,"aria-label":x,"aria-labelledby":w,"aria-describedby":N,className:k=""}){const C=c(null),E=d(),P=d(),j=!v&&!g,F=d(),O=o().dialog;return e(r),L(C,r,y),I(r),s(()=>{if(r)return t(()=>(v||i(),!0),()=>C.current)},[r,v,i]),r?/* @__PURE__ */h("div",{className:"fixed inset-0",style:{zIndex:n.overlay},role:"presentation",children:[
|
|
2
2
|
/* @__PURE__ */b("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
3
|
-
/* @__PURE__ */b("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:v?void 0:e=>{e.target===e.currentTarget&&
|
|
4
|
-
return b(
|
|
5
|
-
return b(
|
|
3
|
+
/* @__PURE__ */b("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:v?void 0:e=>{e.target===e.currentTarget&&i()},children:/* @__PURE__ */h("div",{ref:C,...T({role:m,modal:!0,titleId:a?F:void 0,labelledBy:w,label:x}),"aria-describedby":N??(u?P:f?E:void 0),className:`relative max-h-full w-full ${D[p]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${k}`.trim(),children:[a&&/* @__PURE__ */b("h2",{id:F,className:(j?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:a}),u&&/* @__PURE__ */b("p",{id:P,className:((a?"mt-1":j?"pr-8":"")+" text-sm text-gray-500").trim(),children:u}),f&&/* @__PURE__ */b("div",{id:E,className:"mt-2 text-sm text-gray-600",children:f}),g&&/* @__PURE__ */b("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:g}),j&&/* @__PURE__ */b("button",{type:"button",onClick:i,"aria-label":O.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */b(l,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}var O=a(()=>Promise.resolve(!1)),W=()=>u(O),K=()=>Promise.resolve(!1),R=e=>K(e),$=()=>Promise.resolve(!1),A=e=>$(e),B=()=>Promise.resolve(null),S=e=>B(e),V={danger:{icon:"text-red-600 bg-red-100",button:r({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:r({variant:"warning"})},info:{icon:"text-blue-600 bg-blue-100",button:r({variant:"primary"})}},z=r({variant:"secondary"}),G=r({variant:"primary"}),U="w-full rounded-md border border-gray-300 h-8 px-3 text-sm";function Y(){/* @__PURE__ */
|
|
4
|
+
return b(l,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function _(){/* @__PURE__ */
|
|
5
|
+
return b(l,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function q({children:e}){const[t,n]=m(!1),[r,l]=m({message:""}),[a,d]=m(0),u=c(),v=c(null),p=c(0),y=c([]),x=c(null),w=c(null),N=f(e=>{v.current=e.id,u.current=e.resolve,d(e.id),l(e.options),n(!0)},[]),k=f(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++p.current,options:t,resolve:e};null===v.current?N(n):y.current.push(n)})},[N]),[C,E]=m(!1),[L,P]=m({message:""}),[j,I]=m(""),T=c(),D=f(e=>(P(e),I(""),E(!0),new Promise(e=>{T.current=e})),[]),[W,R]=m(!1),[A,S]=m({}),[q,H]=m(""),J=c(),M=f(e=>{const t="string"==typeof e?{message:e}:e;return S(t),H(t.defaultValue??""),R(!0),new Promise(e=>{J.current=e})},[]);s(()=>{K=k,$=D,B=M},[k,D,M]);const Q=(e,t)=>{if(v.current!==e)return;const r=u.current,l=y.current.shift();l?N(l):(v.current=null,u.current=void 0,n(!1)),r?.(t)},X=e=>{E(!1),I(""),T.current?.(e)},Z=e=>{if(e){const e=q.trim();if(!e&&!A.allowEmpty)return R(!1),void J.current?.(null);R(!1),J.current?.(e)}else R(!1),J.current?.(null)},ee=r.variant||(r.confirmLabel?.toLowerCase().includes("delete")||r.message.toLowerCase().includes("delete")?"danger":"info"),te=V[ee],ne=V["warning"===L.variant?"warning":"danger"],re=L.confirmWord,le=null==re||j===re,oe=o().dialog,[ie,ae]=i(oe.typeToConfirm);/* @__PURE__ */
|
|
6
6
|
return h(O.Provider,{value:k,children:[e,
|
|
7
|
-
/* @__PURE__ */b(
|
|
8
|
-
/* @__PURE__ */b("button",{ref:x,type:"button",onClick:()=>
|
|
9
|
-
/* @__PURE__ */b("button",{type:"button",onClick:()=>
|
|
10
|
-
/* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */b(
|
|
7
|
+
/* @__PURE__ */b(F,{open:t,onClose:()=>Q(a,!1),initialFocus:x,footer:/* @__PURE__ */h(g,{children:[
|
|
8
|
+
/* @__PURE__ */b("button",{ref:x,type:"button",onClick:()=>Q(a,!1),className:z,children:r.cancelLabel||oe.cancel}),
|
|
9
|
+
/* @__PURE__ */b("button",{type:"button",onClick:()=>Q(a,!0),className:te.button,children:r.confirmLabel||oe.ok})]}),children:/* @__PURE__ */h("div",{className:"flex gap-4",children:[
|
|
10
|
+
/* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */b(Y,{})}),
|
|
11
11
|
/* @__PURE__ */h("div",{className:"flex-1",children:[
|
|
12
12
|
/* @__PURE__ */b("h2",{className:"text-base font-semibold text-gray-900",children:r.title||oe.confirmTitle}),
|
|
13
13
|
/* @__PURE__ */b("p",{className:"mt-2 text-sm text-gray-600",children:r.message})]})]})}),
|
|
14
|
-
/* @__PURE__ */h(
|
|
15
|
-
/* @__PURE__ */b("button",{ref:w,type:"button",onClick:()=>
|
|
16
|
-
/* @__PURE__ */b("button",{type:"button",onClick:()=>
|
|
17
|
-
/* @__PURE__ */b("button",{type:"button",onClick:()=>
|
|
14
|
+
/* @__PURE__ */h(F,{open:C,onClose:()=>X(!1),initialFocus:null!=re?void 0:w,footer:/* @__PURE__ */h(g,{children:[
|
|
15
|
+
/* @__PURE__ */b("button",{ref:w,type:"button",onClick:()=>X(!1),className:z,children:L.cancelLabel||oe.destructiveCancel}),
|
|
16
|
+
/* @__PURE__ */b("button",{type:"button",onClick:()=>X(!0),disabled:!le,className:ne.button,children:re??L.confirmLabel??oe.destructiveConfirm})]}),children:[
|
|
17
|
+
/* @__PURE__ */b("button",{type:"button",onClick:()=>X(!1),"aria-label":oe.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */b(_,{})}),
|
|
18
18
|
/* @__PURE__ */h("div",{className:"flex gap-4",children:[
|
|
19
|
-
/* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */b(
|
|
19
|
+
/* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */b(Y,{})}),
|
|
20
20
|
/* @__PURE__ */h("div",{className:"flex-1",children:[
|
|
21
21
|
/* @__PURE__ */b("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:L.title||oe.destructiveTitle}),
|
|
22
22
|
/* @__PURE__ */b("p",{className:"mt-2 text-sm text-gray-600",children:L.message}),null!=re&&/* @__PURE__ */h(g,{children:[
|
|
23
23
|
/* @__PURE__ */h("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
24
24
|
/* @__PURE__ */b("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:re}),ae]}),
|
|
25
|
-
/* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:j,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===re&&
|
|
26
|
-
/* @__PURE__ */h(
|
|
27
|
-
/* @__PURE__ */b("button",{type:"button",onClick:()=>Z(!1),className:
|
|
28
|
-
/* @__PURE__ */b("button",{type:"button",onClick:()=>Z(!0),disabled:!A.allowEmpty&&!
|
|
29
|
-
/* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:
|
|
25
|
+
/* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:j,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===re&&X(!0)},placeholder:re,className:`mt-2 ${U} focus:border-red-500`})]})]})]})]}),
|
|
26
|
+
/* @__PURE__ */h(F,{open:W,onClose:()=>Z(!1),title:A.title||oe.promptTitle,footer:/* @__PURE__ */h(g,{children:[
|
|
27
|
+
/* @__PURE__ */b("button",{type:"button",onClick:()=>Z(!1),className:z,children:A.cancelLabel||oe.cancel}),
|
|
28
|
+
/* @__PURE__ */b("button",{type:"button",onClick:()=>Z(!0),disabled:!A.allowEmpty&&!q.trim(),className:G,children:A.confirmLabel||oe.ok})]}),children:[A.message&&/* @__PURE__ */b("p",{className:"text-sm text-gray-600",children:A.message}),
|
|
29
|
+
/* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:q,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key?Z(!0):"Escape"===e.key&&Z(!1)},onFocus:e=>e.target.select(),placeholder:A.placeholder,className:`mt-3 ${U} 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,R as confirm,A as confirmDestructive,T as dialogA11y,k as focusableIn,S as prompt,E as stopAfter,W as useConfirm,L as useFocusTrap,I as useScrollLock,C as useTabLayer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-EZTEOTUD.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return u(
|
|
3
|
-
return u(
|
|
4
|
-
return u(
|
|
5
|
-
return u(
|
|
1
|
+
import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{Icon as r}from"./chunk-YT4B3NSV.js";import{useShellStrings as n}from"./chunk-LVCRH3K6.js";import{createContext as o,useSyncExternalStore as i,useCallback as a,useContext as s,useMemo as c}from"react";import{jsxs as l,jsx as u}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)",f="(max-width: 767px)";function m(e){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(e).matches}var h=()=>m(d),w=()=>m(f);function g(){return!1}var p=e=>y(d,e),v=e=>y(f,e);function y(e,t){if("undefined"==typeof window||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?(r.addEventListener("change",t),()=>r.removeEventListener("change",t)):(r.addListener(t),()=>r.removeListener(t))}function x(){return i(p,h,g)}function b(){return i(v,w,g)}var _={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},S={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"},C={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function D({tone:e}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
2
|
+
return u(r,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
|
+
return u(r,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
|
+
return u(r,{name:"error",...t});default:/* @__PURE__ */
|
|
5
|
+
return u(r,{name:"info",...t})}}function E({status:e="info",title:t,subTitle:r,extra:o,icon:i,children:a,className:s=""}){const c=_[e],d=n().errors;/* @__PURE__ */
|
|
6
6
|
return l("div",{role:"error"===c?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
|
|
7
|
-
/* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${
|
|
8
|
-
/* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:
|
|
9
|
-
return u("kbd",{className:[
|
|
10
|
-
return u(
|
|
7
|
+
/* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${S[c]}`,children:i??/* @__PURE__ */u(D,{tone:c})}),
|
|
8
|
+
/* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??C[e]?.(d)??""}),r&&/* @__PURE__ */u("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:r}),a&&/* @__PURE__ */u("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}var L="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),M={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"]},T=L?0:1,N=M.MOD[T],A=M.ALT[T],k="⇧",I="⏎",H=M.CMD_ENTER[T],j=M.CMD_S[T],F=M.CMD_K[T],Z=M.CMD_DOT[T],O=M.CMD_A[T],P=M.CMD_Z[T],K=M.CMD_SHIFT_Z[T],R=M.ALT_SHIFT_D[T],z=M.ALT_SHIFT_E[T],J=M.ALT_SHIFT_N[T],U=new Map(L?Object.values(M).map(([e,t])=>[e,t]):[]);function B(t){return e()?t:U.get(t)??t}var V={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"},W={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function $({keys:e,size:t="md",tone:r="neutral",className:n=""}){const o=B(e);/* @__PURE__ */
|
|
9
|
+
return u("kbd",{className:[V[r],W[t],n].filter(Boolean).join(" "),children:o})}var Y=o(null);function q({value:e,children:t}){/* @__PURE__ */
|
|
10
|
+
return u(Y.Provider,{value:e,children:t})}function G(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:a(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var Q={prefs:{},save:()=>{}};function X(){return s(Y)??Q}function ee(){const{prefs:e,save:t}=X(),r=a(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return c(()=>({prefs:e,save:r}),[e,r])}var te="react-os-shell:stale-chunk-reload-at",re=3e4,ne="vite:preloadError",oe="/_next/static/",ie=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ae(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return ie.test(t)}function se(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(te),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?oe:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(te),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(te,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;ae(t)&&a(t)&&(e.preventDefault(),r())};let c=!0,l=!1;const u=/* @__PURE__ */new Set,d=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||l||u.has(t)||(u.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{u.delete(t),e&&c&&!l&&a(t)&&(l=!0,r())}))};return window.addEventListener(ne,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(ne,s),d&&window.removeEventListener("error",d,!0)}}export{A as ALT,R as ALT_SHIFT_D,z as ALT_SHIFT_E,J as ALT_SHIFT_N,O as CMD_A,Z as CMD_DOT,H as CMD_ENTER,F as CMD_K,j as CMD_S,K as CMD_SHIFT_Z,P as CMD_Z,I as ENTER,$ as Kbd,N as MOD,oe as NEXT_CHUNK_PATH_PREFIX,E as Result,k as SHIFT,re as STALE_CHUNK_RELOAD_COOLDOWN_MS,te as STALE_CHUNK_RELOAD_KEY,q as ShellPrefsProvider,ne as VITE_PRELOAD_ERROR_EVENT,se as installStaleChunkReload,L as isMac,ae as isStaleChunkError,x as useIsMobile,b as useIsPhone,G as useLocalStoragePrefs,ee as useShellPrefs,X as useShellPrefsAdapter,B as useShortcutLabel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="7.46.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-7IQ3B77H.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-FIEA5CGB.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{Icon as l}from"./chunk-
|
|
2
|
-
return w("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&&
|
|
3
|
-
return b("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?a:void 0,tabIndex:l,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),c?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */w(j,{kind:f,checked:!!a}),t]})}),z=/* @__PURE__ */w(l,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function q(e){let t=o.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 U(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function K({label:t,icon:n,children:o,disabled:i,className:l="",minWidth:u=180,maxHeight:c}){const m=s(H),v=p(),k=d(null),C=d(null),T=d(),E=d(!1),
|
|
1
|
+
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-7IQ3B77H.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-FIEA5CGB.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{Icon as l}from"./chunk-YT4B3NSV.js";import{createContext as u,forwardRef as c,useContext as s,useRef as d,useId as p,useState as m,useEffect as h,useMemo as f,useCallback as g}from"react";import{createPortal as y}from"react-dom";import{jsxs as b,jsx as w,Fragment as x}from"react/jsx-runtime";var v=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),k="data-native-context-menu";function C(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function N(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(C(t,`[${k}]`))return!0;if(C(t,"textarea"))return!0;if(C(t,"img, picture, canvas, video, audio"))return!0;const n=C(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(v.has(e))return!0}const r=C(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var T=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function E(e,t,n){const r=C(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 T.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 B(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return N(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function L(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function M(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function $(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 A(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function W(e,t,n,r,o,i=!1,a=8){const l=t+o,u=e-o-n,c=u>=a;return i&&c?{left:u,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:c?{left:u,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function R(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var H=u(null),P=u(!1);function D({children:t,style:a,className:l="",onClose:u,minWidth:c=180,portal:s=!1}){const g=d(null),b=p(),[x,v]=m([]),k=d();h(()=>()=>clearTimeout(k.current),[]);const C=i(),T=f(()=>{const e=()=>clearTimeout(k.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>L(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>v(e=>M(e,t)),200)},closeBelow:t=>{e(),v(e=>M(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),u?.()},root:g}},[b,x,u]);h(()=>{if(!u)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||g.current&&!g.current.contains(e.target)&&u()},t=e=>{"Escape"===e.key&&u()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const o=n(u),i=r(()=>!1,()=>g.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),o(),i()}},[u,b]),h(()=>{const e=g.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 E=R(),B=/(^|[\s:])!?z-/.test(l),$=/* @__PURE__ */w("div",{ref:g,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===E?"py-1":"large"===E?"py-2":"py-1"} ${l}`,onContextMenu:e=>{N(e.target)||e.preventDefault()},style:{...B?{}:{zIndex:o.menu},minWidth:c,animation:"popup-in 0.12s ease-out",...e(),...a},children:/* @__PURE__ */w(H.Provider,{value:T,children:t})});return s?C?y($,document.body):null:$}function I(e,t,n,r=!1){const o=R(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 not-disabled:not-aria-disabled:hover:bg-blue-50 not-disabled:not-aria-disabled: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,..."normal"===o?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var S=/* @__PURE__ */w(l,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function j({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
+
return w("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&&S}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&S})}var F=c(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:a,tabIndex:l,id:u,onMouseEnter:c},d){const p=s(H),m=s(P),h=I(r,o,n),f=void 0===a?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
+
return b("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?a:void 0,tabIndex:l,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),c?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */w(j,{kind:f,checked:!!a}),t]})}),z=/* @__PURE__ */w(l,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function q(e){let t=o.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 U(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function K({label:t,icon:n,children:o,disabled:i,className:l="",minWidth:u=180,maxHeight:c}){const m=s(H),v=p(),k=d(null),C=d(null),T=d(),E=d(!1),B=`${v}-menu`;h(()=>()=>clearTimeout(T.current),[]);const L=m?.depth??0,M=m?.path[L],$=!!M&&M.key===v&&!i,P=g(e=>{if(!m||i||!k.current)return;clearTimeout(T.current),E.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=L>0&&(m.path[L-1]?.flipped??!1),a=W(r.left,r.right,u,window.innerWidth,4,o);m.open(L,{key:v,y:t.top,...a})},[m,i,L,v,u]),D=e=>{m?.closeBelow(L),k.current?.focus()};h(()=>{if($)return r(e=>"Escape"===e.key&&(!(m&&m.path.length>L+1)&&(D(),!0)),()=>C.current)}),a(()=>{if(!$||!M)return;const e=()=>{const e=C.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=L>0&&(m?.path[L-1]?.flipped??!1),o=e.offsetWidth||u,i=W(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=A(k.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),h(()=>{$&&E.current&&(E.current=!1,U(C.current)[0]?.focus())},[$]);const S=f(()=>m&&{...m,depth:L+1},[m,L]);if(!m)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const j=I(!1,i,l,$),F=R();/* @__PURE__ */
|
|
4
4
|
return b(x,{children:[
|
|
5
|
-
/* @__PURE__ */b("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded"
|
|
6
|
-
/* @__PURE__ */w("span",{className:"min-w-0 flex-1 truncate",children:t}),z]})
|
|
7
|
-
/* @__PURE__ */w("div",{ref:C,id:
|
|
8
|
-
return w("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function
|
|
9
|
-
return w("div",{className:"text-xs font-medium uppercase tracking-wide",style:
|
|
10
|
-
return w("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{j as MenuCheckMark,
|
|
5
|
+
/* @__PURE__ */b("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":$,"aria-controls":$?B:void 0,disabled:i,"data-popup-submenu-row":!0,className:j.className,style:j.style,onClick:e=>{const t=0===e.detail;$?t&&U(C.current)[0]?.focus():P(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),P(!0))},onMouseEnter:()=>{i||(m.cancelClose(),$?m.closeBelow(L+1):(clearTimeout(T.current),T.current=setTimeout(()=>P(!1),120)))},onMouseLeave:()=>{clearTimeout(T.current),m.scheduleClose(L)},children:[n,
|
|
6
|
+
/* @__PURE__ */w("span",{className:"min-w-0 flex-1 truncate",children:t}),z]}),$&&y(
|
|
7
|
+
/* @__PURE__ */w("div",{ref:C,id:B,role:"menu","data-popup-menu-tree":m.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===F?"py-1":"large"===F?"py-2":"py-1"),style:{left:M.left,top:M.y,minWidth:u,maxHeight:void 0===c?"calc(100vh - 16px)":`min(${"number"==typeof c?`${c}px`:c}, calc(100vh - 16px))`,zIndex:q(m.root.current)+L+1,animation:(M.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=U(C.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:()=>{m.cancelClose(),clearTimeout(T.current)},onMouseLeave:()=>m.scheduleClose(L+1),onContextMenu:e=>{N(e.target)||e.preventDefault()},children:/* @__PURE__ */w(H.Provider,{value:S,children:o})}),document.body)]})}function V(){const e=R();/* @__PURE__ */
|
|
8
|
+
return w("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function G(){const e=R(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function J({children:e}){/* @__PURE__ */
|
|
9
|
+
return w("div",{className:"text-xs font-medium uppercase tracking-wide",style:G(),children:e})}function O({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
|
|
10
|
+
return w("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{j as MenuCheckMark,O as MenuIcon,P as MenuSemanticsContext,k as NATIVE_MENU_ATTR,D as PopupMenu,V as PopupMenuDivider,F as PopupMenuItem,J as PopupMenuLabel,K as PopupSubmenu,A as clampMenuTop,M as closeMenuBelow,E as describeContextTarget,I as itemLook,N as keepsNativeMenu,B as leavesContextMenuAlone,W as menuPanelLeft,G as menuTextRowStyle,L as openMenuLevel,$ as resolveMenuLevels};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return p(
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-EZTEOTUD.js";import{VERSION as r}from"./chunk-KRAJDKZC.js";import{navIcons as s}from"./chunk-DSSLOQDW.js";import{Icon as o}from"./chunk-YT4B3NSV.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as i,splitAround as a}from"./chunk-LVCRH3K6.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var u=n.aboutApp,f={spreadsheet:{name:"Spreadsheets",version:"1.1.3",route:"/spreadsheet",description:u.spreadsheet},notepad:{name:"Notepad",version:"1.0.2",route:"/notepad",description:u.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:u.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:u.preview},files:{name:"Files",version:"1.1.3",route:"/files",description:u.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:u.browser}},x=/* @__PURE__ */p(o,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(o,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:o}){const n=f[o],[u,w]=m(!1),N=c(()=>w(!0),[]),g=i().aboutApp,b=g.title(n.name);if(e(b,N,x),!u)return null;const y=s[n.route],k=l(y)?d(y,{className:"h-9 w-9"}):v,[j,D]=a(g.partOf);/* @__PURE__ */
|
|
2
|
+
return p(t,{open:!0,onClose:()=>w(!1),title:b,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:k}),
|
|
4
|
-
/* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:
|
|
5
|
-
/* @__PURE__ */p("p",{className:"text-2xs font-mono text-gray-400",children:g.version(
|
|
4
|
+
/* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:n.name}),
|
|
5
|
+
/* @__PURE__ */p("p",{className:"text-2xs font-mono text-gray-400",children:g.version(n.version)}),
|
|
6
6
|
/* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:g[o]}),
|
|
7
7
|
/* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */h("p",{className:"text-2xs text-gray-500",children:[j,
|
|
9
|
-
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),D]}),r&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-gray-400",children:g.shellVersion(r)})]})]})})}export{w as AboutApp,f as BUILTIN_APP_INFO};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isAriaDisabled as e,swallowPress as r,describedByWith as a,OffWithReason as i}from"./chunk-3E27HV76.js";import{iconButtonClasses as s}from"./chunk-K7PQXJO7.js";import{forwardRef as d,useId as n}from"react";import{jsx as o}from"react/jsx-runtime";var t=d(function({children:d,variant:t="ghost",size:c="md",type:l="button",className:m="",pressed:b,disabledReason:p,ink:u,disabled:f,onClick:h,"aria-disabled":k,"aria-describedby":v,...y},j){const N=n(),x=(Boolean(f)||e(k))&&null!=p&&""!==p,z=x||e(k),C=/* @__PURE__ */o("button",{ref:j,type:l,className:s({variant:t,size:c,pressed:b??(!0===y["aria-pressed"]||"true"===y["aria-pressed"]),ink:u,className:m}),...y,disabled:x?void 0:f,"aria-disabled":!!z||k,"aria-describedby":a(v,x?N:void 0),onClick:z?r:h,children:d});return x?/* @__PURE__ */o(i,{reason:p,id:N,children:C}):C});export{t as IconButton_default};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{inputClasses as e}from"./chunk-HJQAE6SP.js";import{isSafeLinkHref as t}from"./chunk-PJPK2ADX.js";import{Icon as r}from"./chunk-YT4B3NSV.js";import{useShellStrings as n}from"./chunk-LVCRH3K6.js";import{SpinnerRing as a}from"./chunk-2J6F4EE7.js";import{forwardRef as s,useCallback as i,useState as l,useId as o}from"react";import{jsx as c,jsxs as d,Fragment as m}from"react/jsx-runtime";var u=s(function({invalid:t,autoGrow:r,className:n="",onInput:a,rows:s=3,size:l,readOnly:o,...d},m){const u=i(e=>{if(r){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}a?.(e)},[r,a]);/* @__PURE__ */
|
|
2
|
+
return c("textarea",{ref:m,"aria-invalid":t||void 0,rows:s,onInput:u,readOnly:o,className:e({invalid:t,size:l,readOnly:o,multiline:!0,className:`${r?"resize-none overflow-hidden":""} ${n}`.trim()}),...d})}),h={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},p={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function g({tone:e}){const t={className:"h-5 w-5","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
3
|
+
return c(r,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
|
|
4
|
+
return c(r,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
|
|
5
|
+
return c(r,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
|
|
6
|
+
return c(r,{name:"info",look:"mini",...t})}}function x({tone:e="info",emphasis:t="subtle",title:a,children:s,icon:i,action:l,onDismiss:o,sticky:u=!1,className:x=""}){const b=h[e],f="solid"===t,y=n().banner,v=f?p[e]:b.box,N=u?"sticky top-0 z-30":"",k=/* @__PURE__ */d(m,{children:[a&&/* @__PURE__ */c("div",{className:("font-semibold "+(f?"":"text-gray-900")).trim(),children:a}),s&&/* @__PURE__ */c("div",{className:`${f?"":"text-gray-700"} ${a?"mt-0.5":""}`.trim(),children:s})]});/* @__PURE__ */
|
|
7
|
+
return d("div",{role:"danger"===e?"alert":"status",className:`${N} flex items-start gap-3 rounded-lg border px-4 py-3 ${v} ${x}`.trim(),children:[
|
|
8
|
+
/* @__PURE__ */c("span",{className:`mt-0.5 shrink-0 ${f?"":b.icon}`.trim(),children:i??/* @__PURE__ */c(g,{tone:e})}),null==l?/* @__PURE__ */c("div",{className:"min-w-0 flex-1 text-sm",children:k}):
|
|
9
|
+
/* @__PURE__ */d("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
10
|
+
/* @__PURE__ */c("div",{className:"min-w-0 grow basis-48 text-sm",children:k}),
|
|
11
|
+
/* @__PURE__ */c("div",{className:"shrink-0 self-center",children:l})]}),o&&/* @__PURE__ */c("button",{type:"button",onClick:o,"aria-label":y.dismiss,className:"shrink-0 "+(f?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */c(r,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}function b({summary:e,busy:t=!1,open:n,onOpenChange:a,label:s="Steps",className:i="",children:m}){const[u,h]=l(null),p=o(),g=n??u??t;/* @__PURE__ */
|
|
12
|
+
return d("div",{className:`text-xs text-gray-500 ${i}`.trim(),children:[
|
|
13
|
+
/* @__PURE__ */d("button",{type:"button",onClick:()=>{h(!g),a?.(!g)},"aria-expanded":g,"aria-controls":g?p:void 0,className:"flex w-full items-center gap-2 rounded text-left hover:text-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",children:[
|
|
14
|
+
/* @__PURE__ */c(r,{name:"chevron-right",size:12,className:"shrink-0 motion-safe:transition-transform "+(g?"rotate-90":"")}),
|
|
15
|
+
/* @__PURE__ */c("span",{"aria-live":"polite",className:"min-w-0 flex-1 truncate",children:e})]}),g&&/* @__PURE__ */c("ol",{id:p,"aria-label":s,className:"mt-2 ml-2 space-y-2 border-l border-gray-200 pl-3",children:m})]})}var f={pending:"text-gray-400",active:"text-gray-800",complete:"text-gray-600",failed:"text-red-600",stopped:"text-gray-500",waiting:"text-amber-700",skipped:"text-gray-400"},y={pending:"Pending",active:"In progress",complete:"Done",failed:"Failed",stopped:"Stopped",waiting:"Waiting for you",skipped:"Skipped"};function v({status:e}){switch(e){case"active":/* @__PURE__ */
|
|
16
|
+
return c(a,{className:"size-3 motion-reduce:animate-none"});case"complete":/* @__PURE__ */
|
|
17
|
+
return c(r,{name:"check-circle",size:14,tone:"success"});case"failed":/* @__PURE__ */
|
|
18
|
+
return c(r,{name:"close-circle",size:14,tone:"danger"});case"stopped":/* @__PURE__ */
|
|
19
|
+
return c(r,{name:"no-symbol",size:14,tone:"muted"});case"waiting":/* @__PURE__ */
|
|
20
|
+
return c(r,{name:"pause",size:14,tone:"warning"});case"skipped":/* @__PURE__ */
|
|
21
|
+
return c(r,{name:"remove",size:14,tone:"muted"});default:/* @__PURE__ */
|
|
22
|
+
return c("span",{className:"block size-3 rounded-full border border-gray-300"})}}function N({label:e,description:t,status:r="complete",statusWord:n,icon:a,children:s}){/* @__PURE__ */
|
|
23
|
+
return d("li",{className:`flex items-start gap-2 ${f[r]}`,"data-status":r,children:[
|
|
24
|
+
/* @__PURE__ */c("span",{"aria-hidden":"true",className:"mt-1 flex size-3.5 shrink-0 items-center justify-center",children:a??/* @__PURE__ */c(v,{status:r})}),
|
|
25
|
+
/* @__PURE__ */d("div",{className:"min-w-0 flex-1",children:[
|
|
26
|
+
/* @__PURE__ */d("span",{className:"sr-only",children:[n??y[r],": "]}),
|
|
27
|
+
/* @__PURE__ */c("div",{className:"break-words",children:e}),t&&/* @__PURE__ */c("div",{className:"break-words text-gray-500",children:t}),s&&/* @__PURE__ */c("div",{className:"mt-1",children:s})]})]})}var k=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,w=e=>t(e.trim());function $(e){const t=[];let r,n=0,a=0;for(k.lastIndex=0;null!==(r=k.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
|
|
28
|
+
/* @__PURE__ */d("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
|
|
29
|
+
/* @__PURE__ */c("a",{href:w(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
|
|
30
|
+
/* @__PURE__ */c("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
|
|
31
|
+
/* @__PURE__ */c("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */c("em",{children:r[7]},a++)),n=k.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function z({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),a=n().markdown;/* @__PURE__ */
|
|
32
|
+
return d("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-3 text-gray-500",children:[
|
|
33
|
+
/* @__PURE__ */c(r,{name:"camera",look:"mini",className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),
|
|
34
|
+
/* @__PURE__ */d("span",{className:"text-xs",children:[
|
|
35
|
+
/* @__PURE__ */c("span",{className:"font-medium text-gray-600",children:`${a.screenshot} — `}),t]})]})}function j(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var I=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function S(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
|
|
36
|
+
return c(`h${e}`,{className:2===e?"mt-2 text-sm font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:$(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
|
|
37
|
+
return c("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=I(e[0]),n=e.slice(2).map(I);/* @__PURE__ */
|
|
38
|
+
return c("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */d("table",{className:"w-full border-collapse text-sm",children:[
|
|
39
|
+
/* @__PURE__ */c("thead",{children:/* @__PURE__ */c("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */c("th",{className:"border-b border-gray-200 px-3 py-2 text-left font-semibold text-gray-700",children:$(e)},t))})}),
|
|
40
|
+
/* @__PURE__ */c("tbody",{children:n.map((e,t)=>/* @__PURE__ */c("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */c("td",{className:"border-t border-gray-100 px-3 h-8 align-top text-gray-700",children:$(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
|
|
41
|
+
return c("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:$(e)},t)}const s=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(s&&1===r.length)/* @__PURE__ */
|
|
42
|
+
return c(z,{alt:s[1]},t);if(/^[-*]\s+/.test(n)){const e=j(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
|
|
43
|
+
return c("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */c("li",{children:$(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=j(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
|
|
44
|
+
return c("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */c("li",{className:"pl-1",children:$(e)},t))},t)}/* @__PURE__ */
|
|
45
|
+
return c("p",{children:$(r.join(" "))},t)}var C=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function E(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const s=C.exec(t[e]);if(!(null!==s&&!("`"===s[2][0]&&s[3].includes("`")))){n.push(t[e]);continue}a();const[,i,l,o]=s,c=[];for(e+=1;e<t.length;e+=1){const r=C.exec(t[e]);if(null!==r&&r[2][0]===l[0]&&r[2].length>=l.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:o.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function O({children:e,className:t}){/* @__PURE__ */
|
|
46
|
+
return c("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:E(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
|
|
47
|
+
return c("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */c("code",{children:t})},r)}(e.fence,t):S(e.text,t))})}export{x as Banner,O as Markdown,b as StepChain,N as StepChainItem,u as Textarea_default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return n(t
|
|
3
|
-
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(
|
|
1
|
+
import{Icon as e}from"./chunk-YT4B3NSV.js";import{useShellStrings as t}from"./chunk-LVCRH3K6.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
|
+
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
|
+
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|