efficient-shell 16.4.0 → 16.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-UMVLMXZ2.js → Browser-LCX3F2VY.js} +16 -16
- package/dist/{Calculator-MBHZSFJ6.js → Calculator-ZCDSQCRN.js} +23 -23
- package/dist/{CurrencyConverter-7FPB7WJE.js → CurrencyConverter-ZLHZOLYE.js} +9 -9
- package/dist/{Files-EQXMKPJF.js → Files-TMEV736Q.js} +27 -27
- package/dist/{Notepad-CK5LKAVY.js → Notepad-EWLJWILB.js} +9 -9
- package/dist/{PomodoroTimer-TYSJOYDJ.js → PomodoroTimer-DIIU6KRF.js} +65 -65
- package/dist/{Preview-WD7WYHFF.js → Preview-CG2KGNSM.js} +20 -20
- package/dist/{Stock-Y74YC25V.js → Stock-VW2AUUD6.js} +3 -3
- package/dist/{Weather-EO4LYAPA.js → Weather-ZGQHMHNW.js} +18 -18
- package/dist/{WorldClock-3E3KLHSD.js → WorldClock-GYRJWYQM.js} +7 -7
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-UBUOPMCR.js → chunk-3UCJ6SGP.js} +1 -1
- package/dist/chunk-4MYFHXU7.js +1 -0
- package/dist/{chunk-V77UETV3.js → chunk-HHGSWUGI.js} +1 -1
- package/dist/{chunk-B2AKIOF3.js → chunk-IXGJTYOG.js} +3 -3
- package/dist/{chunk-XNPCOWOO.js → chunk-S5JX4IAP.js} +1 -1
- package/dist/{chunk-ZV2ZAHZV.js → chunk-UJ5772FB.js} +1 -1
- package/dist/index.js +60 -60
- package/dist/routine-index.json +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7TGDGFHO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-7TGDGFHO.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,_=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)}}},F=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})}},Z=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,Z,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)=>{F(()=>{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,Z,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var O=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,U=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,D=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,G=/\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,W=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&U.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(W,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&O.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;F(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(D,"[url]").replace(G,"[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};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
|
|
1
|
+
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-4MYFHXU7.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,_=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)}}},F=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})}},Z=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,Z,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)=>{F(()=>{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,Z,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],U=[800,1800],B=e=>{document.prerendering?E(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var N=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,H=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,O=/^[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,V=/\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,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Y=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Q(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=Y.exec(n.trim()),i=e&&Q(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&&H.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(X,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&N.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;F(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,U,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,U,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,U,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&O.test(e.app),n="string"==typeof e.release&&O.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:O.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="16.4.1",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-S5JX4IAP.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,9 +1,9 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
2
|
-
return d(t,{open:!0,onClose:()=>
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-S5JX4IAP.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-4MYFHXU7.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-NRHG4R2Q.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.5.1",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.1",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,S]=a(b.partOf);/* @__PURE__ */
|
|
2
|
+
return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
|
|
4
4
|
/* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
|
|
5
5
|
/* @__PURE__ */d("p",{className:"text-2xs font-mono text-ink-faintest",children:b.version(i.version)}),
|
|
6
6
|
/* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
|
|
7
7
|
/* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
|
|
9
|
-
/* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),S]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
|
|
@@ -44,7 +44,7 @@ return Ee("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm
|
|
|
44
44
|
return ke("span",{className:"relative inline-flex",onMouseEnter:u,onMouseLeave:d,children:[
|
|
45
45
|
/* @__PURE__ */Ee("button",{onClick:t,onFocus:u,onBlur:d,"aria-label":e?o.windowed:o.maximize,title:e?o.windowed:o.maximize,className:r,children:i}),a&&/* @__PURE__ */Ee("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(c.current),onMouseLeave:d,className:"absolute left-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:Ir.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */Ee("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{s(!1),n(e)},onFocus:()=>clearTimeout(c.current),onBlur:d,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */Ee("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var Or="rosh-gesture-style";var Kr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},jr=4;function Fr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(Or))return;const e=document.createElement("style");e.id=Or,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=_t(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Br(e){const t=D.indexOf(e);if(-1===t)return-1;const n=G.window+t*G.windowStep,r=tr.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of tr){if(!t.root||t.owner!==r.owner)continue;const n=D.indexOf(e);-1!==n&&(o=Math.max(o,G.window+n*G.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=D.length-1;e>=0;e--)yr.has(D[e])||D.splice(e,1);Rn=Rn.filter(e=>{const t=Zn.get(e);return null!=t&&yr.has(t)}),$n(),Qn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Yr="modal-close-request";function qr(e){me(R,_n);const t=ae(I);if(D.length<=1)return!0;if(e){const t=Zn.get(e);if(null!=t)return W()===t}return t?.active??null!=W()}var Hr=!1,Ur=/* @__PURE__ */new Set;function Vr(e){return Ur.add(e),()=>Ur.delete(e)}function Xr(){return Hr}function Gr(e){Hr!==e&&(Hr=e,Ur.forEach(e=>e()))}function Jr(){Gr(!Hr)}function _r(){Gr(!1)}var Qr=null,Zr=/* @__PURE__ */new Set;function eo(e){return Zr.add(e),()=>Zr.delete(e)}function to(){return Qr}function no(e){Qr!==e&&(Qr=e,Zr.forEach(e=>e()))}var ro=null,oo=/* @__PURE__ */new Set;function io(e){return oo.add(e),()=>oo.delete(e)}function ao(){return ro}function so(e){ro!==e&&(ro=e,oo.forEach(e=>e()))}function lo(){if(!ro)return void Gr(!1);no(ro),so(null),Gr(!1)}function co(){Gr(!Hr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function uo(){const e=me(Vr,Xr),[t,n]=de(e),[r,o]=de(e);return ue(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?X(
|
|
46
46
|
/* @__PURE__ */Ee("div",{onMouseDown:e=>{e.stopPropagation(),Gr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:G.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function mo({open:t,onClose:l,title:c,icon:u,copyText:d,size:f="lg",dirty:y=!1,onNext:b,onPrev:x,footer:k,bodyScroll:E,onMinimize:C,initialBox:S,actions:L,actionsLeft:N,editing:P=!1,edit:O,allowPinOnTop:K,initialPosition:j,widget:q,compact:V,appStyle:J,flushBody:_,autoHeight:Z,autoMinHeight:ee,autoWidth:te,widgetMenu:oe,dimensions:ie,windowKey:se,openedFromKey:fe,accentRgb:pe,children:we}){const[ye,be]=de(()=>r()),xe=z()&&!ye,Me=T()&&!!q,[Se,Le]=de(0),[Ne,ze]=de(!1),Te=le(null),Ae=le(0);ue(()=>{Ae.current=Se},[Se]);const De=he(e=>{xe&&(Te.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},ze(!0),qt(fe??null))},[xe,fe]),Pe=me(Ht,Yt);ue(()=>{if(!Ne)return;const e=e=>{if(!Te.current)return;const t=e.clientX-Te.current.startX;if(Math.abs(e.clientY-Te.current.startY)>Math.abs(t)+12)return Te.current=null,ze(!1),Le(0),void qt(null);Le(Math.max(0,t))},t=()=>{if(!Te.current)return;const e=.3*window.innerWidth,t=Ae.current>e;Te.current=null,ze(!1),t?(Le(window.innerWidth),setTimeout(()=>{l(),Le(0),qt(null)},180)):(Le(0),qt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[Ie,Re]=de(c),We=re(),$e=We.window;ue(()=>{Re(c)},[c]);const Ke=ge(()=>gn(Ie).trim()||void 0,[Ie]),je=ve(),[Fe,Be]=de(!1),Ye=le(!1),[qe,He]=de(!1),[Ue,Ve]=de(null),Ge=ae(fn),Je=ae(Oe),{prefs:_e,save:Qe}=A(),Ze=!!_e.window_accent_stripe,et=_e.favorite_documents||[],tt=!!Ge&&et.some(e=>e.entityType===Ge.entityType&&e.entityId===Ge.entityId),nt=he(()=>{if(!Ge)return;const e=tt?et.filter(e=>!(e.entityType===Ge.entityType&&e.entityId===Ge.entityId)):[...et,{entityType:Ge.entityType,entityId:Ge.entityId,label:Ge.label}];Qe({favorite_documents:e})},[Ge,tt,et,Qe]),[rt,ot]=de(null),[it,at]=de("top-right"===j?"right":"left"),st=le(!1),lt=le(null);ce(()=>{const e=lt.current;e&&(pe?e.style.setProperty("--window-accent-rgb",pe):e.style.removeProperty("--window-accent-rgb"))},[pe]);const ct=le(!1),ut=le(null),dt=le(null),ht=le(null),[pt,wt]=de(!1),yt=le(null),gt=le(null),vt=le(null),[bt,xt]=de(!1);ce(()=>{const e=gt.current,t=vt.current;if(!e||!t)return;const n=()=>xt(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=k&&!1!==k]);const kt=!!O&&!q&&!V&&!J&&(O.editing||"hidden"!==O.state),[Et,Ct]=de(null),Mt=kt&&(!!O?.editing||!Et),St=!!(k||L||N)||pt||Mt,Lt=""!==ae(hn),Nt=le(null);Nt.current=Je?{owner:Je.key,tab:Je.tab,root:!Lt}:null;const zt=se||(Je&&!Lt?Je.key:null),Tt=40,{minimize:At,items:Dt,restoreIfMinimized:Pt,openWindows:It}=ft(),Rt=le(`modal-${Math.random().toString(36).slice(2,8)}`).current,Wt=w(Rt);ue(()=>{if(q)return yr.add(Rt),()=>{yr.delete(Rt)}},[q,Rt]),ue(()=>{const e=e=>{const t=e.detail;t?.id===Rt&&Re(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Rt]);const[$t,Ot]=de(G.window),Kt=function(e){const t=me(R,W);return D.length<=1||t===e}(Rt),Ft=le(O);Ft.current=O;const Bt=!!O&&!O.editing&&"enabled"===O.state;ue(()=>{if(!t||!Kt||!Bt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,lt.current)||(e.preventDefault(),e.stopPropagation(),Ft.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Kt,Bt]);const Ut=function(e){return me(R,()=>Vn.has(e))}(Rt);jt({panelRef:lt,bodyRef:ut,open:t,widget:!!q,active:Kt,minimized:Ut});const Vt=me(Vr,Xr),Xt=me(eo,to),Gt=me(io,ao),Jt=!K&&!q,_t=Vt&&Jt,[Qt,Zt]=de(!1),en=_t&&Gt===Rt,[tn,nn]=de(!1),on=tn&&Jt&&Xt===Rt?"picked":null,sn=le(_t);ue(()=>{if(sn.current&&!_t){nn(!0);const e=setTimeout(()=>{nn(!1),Qr===Rt&&no(null)},700);return sn.current=_t,()=>clearTimeout(e)}sn.current=_t},[_t,Rt]),ue(()=>{_t||Zt(!1)},[_t]),ue(()=>{const e=dt.current,t=ht.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>wt(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),ue(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&<.current){const t=lt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=dt.current,n=ht.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const ln=le(!1),un=he(e,[]),dn=he(()=>{const t=e(),n=ie?ie[0]:Bn[f]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Un[Hn()],l=ie?Math.min(ie[1],i):(()=>{const e=("sm"===f?500:"md"===f?600:"lg"===f?700:"xl"===f?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(D.length-1),u=Math.max(Tt,(i-l)/2),d=(o-a)/2,m=t.h-Tt-l-u;return"top-right"===j?{x:t.x+t.w-a-Tt,y:t.y+Tt,w:a,h:l}:"top-left"===j?{x:t.x+Tt,y:t.y+Tt,w:a,h:l}:{x:t.x+Math.max(Tt,(o-a)/2+Tt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[f]),mn=le(!1);t||(mn.current=!1);const pn=se||d||null;ue(()=>{if(!t)return;mr(Rt,pn,Nt.current??void 0),se||pr(Rt),ln.current=!1,Ot(Br(Rt));const e=()=>{Ot(Br(Rt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===se;if(!e.label)return!1;const t=lt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(pr(Rt),Nn.current)return;const t=br(),n=Math.min(Wn.current.w,t.w-40),o=Math.min(Wn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;bn({x:i,y:a,w:n,h:o}),Rn(!1)},i=e=>{const t=e.detail;r(t)&&(pr(Rt),Ve({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==se)return;pr(Rt);const t=Wn.current,n=function(e,t=br()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=lt.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}bn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=D.indexOf(e);-1!==t&&(D.splice(t,1),Qn()),Vn.delete(e),Gn.delete(e),tr.delete(e);const n=er.get(e);n&&(er.delete(e),Zn.delete(n))}(Rt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,Rt,pn,un]);const wn=!q&&"maximized"===Hn(),[vn,bn]=de(()=>{if(pn&&An[pn]){const e={...An[pn]};return ie&&(e.w=ie[0],Z||(e.h=ie[1])),Nr(e)}return S?{x:S.x,y:S.y,w:S.w,h:S.h}:wn?un():dn()}),[kn,En]=de(()=>!Z),Cn=le(ye),Mn=le(null);ue(()=>{const e=()=>{const e=r();e!==Cn.current&&Mn.current?.(e),Cn.current=e,be(e),Ot(Br(Rt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Rt]);const Sn=ye&&!!Je?.tab&&!Lt&&!q&&!xe,Ln=Sn,Nn=le(Ln);Nn.current=Ln;const zn=rr(),Tn=ye&&!!Je?.tab&&!q&&!xe&&!Vt&&zn!==Je.key,Dn=!!q&&ye&&!Vt&&null!==zn,[In,Rn]=de(()=>pn&&An[pn]||S?Ln:Ln||wn),Wn=le(vn);Wn.current=vn;const $n=le(In);ce(()=>{$n.current=In},[In]),ce(()=>{if(kn||Sn)return;const e=lt.current,t=ut.current;if(!e||!t)return;const n=ee??(q?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,m=t.style.overflowY,h=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const f=t.offsetHeight,p=c.offsetHeight;t.style.flex=d,t.style.height=h,t.style.overflowY=m;const w=c.offsetHeight>p+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Wn.current.y)-24),g=w?Math.min(Wn.current.h,y):Math.min(Math.max(n,u+f),y),v=Math.abs(g-o)>1;v&&(o=g,bn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),q||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&En(!0)},160)))},l=new ResizeObserver(s);s(),yt.current&&l.observe(yt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[kn,q,ee,St,Sn]),ce(()=>{if(!Z||!kn||q||!t)return;const e=yt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||In)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ee??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Wn.current.y)-24);bn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[Z,kn,q,t,In,ee]);const On=!1!==te&&!q&&!J&&!xe,[Kn,jn]=de(()=>!On);ce(()=>{if(Kn||!t)return;if(!On||In)return void jn(!0);const n=lt.current,r=ut.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Wn.current.w,c=0;const u=()=>jn(!0),d=()=>{c=0;const t=Wn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),m=d.w-80;if(t.w>=m)return void u();const h=[],f=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(h.push(e),f.push(t))}if(!h.length)return;const p=Math.min(m,t.w+Math.max(...f)),w=p-t.w,y=n.style.width;n.style.width=`${p}px`;const g=h.map((e,t)=>({over:f[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(h[t])});const v=a(t,s(t.w,w,g),d,Tt);v!==t&&(l=v.w,bn(v))};d();const m=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});m.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const h=setTimeout(u,Yn);return()=>{m.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(h)}},[Kn,t,On,In]);const Fn=le(null),qn=!(!Je?.tab||Lt||q||xe);Mn.current=t=>{if(!qn)return;if(t)return Fn.current||(Fn.current={box:{...Wn.current},maximized:$n.current}),void($n.current=!0);const r=Fn.current;Fn.current=null;const o=e();if(r?.maximized)return $n.current=!0,Rn(!0),void bn(o);const i=r?.box??(pn?An[pn]:void 0);if($n.current=!1,Rn(!1),i&&!n(i,o,!1)){const e={...i};ie&&(e.w=ie[0],Z||(e.h=ie[1])),bn(Nr(e))}else bn(dn())},ue(()=>{Ln&&($n.current=!0,Rn(!0),bn(un()))},[Ln,un]),ue(()=>{if(q)return;const e=()=>{const e=pn?An[pn]:void 0;if($n.current=!1,Rn(!1),e){const t={...e};ie&&(t.w=ie[0],Z||(t.h=ie[1])),bn(Nr(t))}else bn(dn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[q,dn,pn]),ue(()=>{t&&pn&&!Sn&&(An[pn]=vn,Pn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[vn,t,pn,Sn]),ue(()=>{if(!t)return;const e=()=>{$n.current?bn(un()):document.body.classList.contains("rosh-gesturing")||bn(Nr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return In&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,In,un]),ue(()=>{if(t&&(Be(!1),Ye.current=!1,st.current=!1,jn(!On),!Nn.current)){if(pn&&An[pn]){const e=An[pn];return void bn(t=>Nr({...e,...Z?{h:t.h}:{},...On?{x:t.x,w:t.w}:{}}))}S&&(bn({x:S.x,y:S.y,w:S.w,h:S.h}),Rn(S.maximized))}},[t]),ue(()=>{if(!t||"auto"!==y)return;let e;const n=t=>{lt.current?.contains(t.target)&&!Ye.current&&(Ye.current=!0,e=setTimeout(()=>Be(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,y]);const Xn="auto"===y?Fe:!0===y,Jn=Je&&!Lt?Je.key:null,_n=ge(()=>rn(Ie),[Ie]),nr=le({shortcutSpec:Ge,isOnDesktop:tt,toggleDesktopShortcut:nt,taskbarStrings:We.taskbar});ce(()=>{nr.current={shortcutSpec:Ge,isOnDesktop:tt,toggleDesktopShortcut:nt,taskbarStrings:We.taskbar}});const or=le(null);or.current||(or.current={open:(e,t)=>Ve({x:e,y:t}),items:()=>{const e=nr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of xn[Rt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),ue(()=>{if(t&&Jn)return()=>{return e=Jn,void(an.delete(e)&&cn());var e}},[t,Jn]),mt(!(se||!t)&&Xn);const ir=he(()=>Xn||"auto"===y&&Ye.current,[Xn,y]),ar=he(async e=>{if(st.current)return!1;if(!ir())return!0;st.current=!0;const t=Ke,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await p({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return st.current=!1,r},[ir,Ke]),sr=he(()=>st.current?Promise.resolve():ir()?ar("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[ir,ar,l]),cr=he(async()=>{await ar("discard")&&(Ye.current=!1,Be(!1),Ft.current?.onDiscard())},[ar]),ur=he(async()=>{const e=await ar("switch");return e&&(Ye.current=!1,Be(!1)),e},[ar]),dr=le(()=>!1);ce(()=>{dr.current=ir}),ce(()=>{if(!t||!se)return;const e={holdsChanges:()=>dr.current(),ask:ur};return lr.set(se,e),()=>{lr.get(se)===e&&lr.delete(se)}},[t,se,ur]),ce(()=>{if(!t||!zt)return;const e=e=>{e.detail?.windowKey===zt&&sr()};return window.addEventListener(Yr,e),()=>window.removeEventListener(Yr,e)},[t,zt,sr]);const hr=le(null),fr=he(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ve(null),pr(Rt),Nn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=lt.current,s=a?.getBoundingClientRect();let l,c,u,d;if(hr.current){const t=hr.current;hr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Wn.current.x,c=s?s.top:Wn.current.y,u=s?s.height:Wn.current.h,d=s?s.width:Wn.current.w;Rn(!1),bn(e=>({...e,x:l,y:c,w:d,h:u}));let m=null;const h=e=>{if(!r){if(Math.abs(e.clientX-o)<jr&&Math.abs(e.clientY-i)<jr)return;r=Fr(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),Wn.current={...Wn.current,x:s,y:u},!q){const t=function(e,t){const n=br(),r=e<=n.x+gr,o=e>=n.x+n.w-gr,i=t<=n.y+gr,a=t>=n.y+n.h-gr,s=e<=n.x+vr,l=e>=n.x+n.w-vr,c=t<=n.y+vr,u=t>=n.y+n.h-vr;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==m&&(m=t,t?Dr(Tr(t)):Pr())}},f=()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",f),r?.(),Pr();const e=Nr({...Wn.current});if(Wn.current=e,!q&&m){hr.current={x:l,y:c,w:d,h:u};const e=Tr(m);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void bn(e)}if(q){const t=e.x+e.w/2,n=window.innerWidth/2;at(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),bn(e)};window.addEventListener("pointermove",h),window.addEventListener("pointerup",f)},[]),Cr=he((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=lt.current,l=s?.getBoundingClientRect(),c=l?l.left:Wn.current.x,u=l?l.top:Wn.current.y,d=l?l.width:Wn.current.w,m=l?l.height:Wn.current.h,h="sw"===t||"nw"===t||"w"===t,f="ne"===t||"nw"===t||"n"===t,p="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Rn(!1),bn({x:c,y:u,w:d,h:m}),Wn.current={x:c,y:u,w:d,h:m};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Wn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<jr&&Math.abs(e.clientY-a)<jr)return;o=Fr(n,r,Kr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=m;if(p&&(o=Math.max(Sr,d+e)),w&&(i=Math.max(Lr,m+t)),h){const t=Math.max(Sr,d-e);n=c+d-t,o=t}if(f){const e=Math.max(Lr,m-t);r=u+m-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),bn({...Wn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),Mr=he(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),pr(Rt),"Enter"===e.key)return void(In?(Rn(!1),bn(dn())):(Rn(!0),bn(un())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{hr.current||(hr.current={...Wn.current})};if(r<0)return e(),Rn(!0),void bn(un());if(r>0){if(In)return Rn(!1),void bn(dn());if(hr.current){const e=Nr(hr.current);return hr.current=null,Wn.current=e,void bn(e)}return void wr(Rt)}e(),Rn(!1);const t=Tr(n<0?"left":"right");return Wn.current=t,void bn(t)}if(In)return;const o=Wn.current,i=e.shiftKey?{...o,w:Math.max(Sr,o.w+24*n),h:Math.max(Lr,o.h+24*r)}:Nr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Wn.current=i,bn(i)},[Rt,In,dn,un]),zr=he(e=>{hr.current||(hr.current={...Wn.current}),Rn(!1);const t=Tr(e);Wn.current=t,bn(t),pr(Rt)},[Rt]),Ar=!q&&!Sn&&!xe,[Ir,Rr]=de(0),Wr=Ar&&!V&&!J&&(!!L||!!N||pt||Mt),Or=Ar&&Ir>0,qr=le(Or);qr.current=Or;const Hr=!!V||!!J,Ur=Hr?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)",Jr=Ar&&!Hr&&!Or&&!_?"h-(--row-height-window-row)":Ur,_r=he(e=>{const t=e.closest("[data-window-body]");if(!t)return null;const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return Math.abs(n.left-r.left)>2||Math.abs(n.top-r.top)>2?null:(Rr(e=>e+1),()=>Rr(e=>Math.max(0,e-1)))},[]),Zr=ge(()=>Ar?{compact:Hr,over:Or,claim:_r,title:Ke,active:Kt}:null,[Ar,Hr,Or,_r,Ke,Kt]),ro=he(e=>{if(_t)return;e.preventDefault(),e.stopPropagation();const t=0===e.clientX&&0===e.clientY,n=e.currentTarget.getBoundingClientRect();Ve(t?{x:n.left,y:n.bottom+4}:{x:e.clientX,y:e.clientY})},[_t]),oo=!!pe&&Ze&&!q&&!xe,so=Ln||_t?{}:{tabIndex:0,role:"group","aria-label":Ke?`${Ke} — ${$e.windowSuffix}`:$e.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Mr},lo=()=>{Rn(!0),bn(un())},co=he(()=>{const e=lt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(yn);t&&!t.disabled&&t.click()}},[]);ue(()=>{if(!t)return;if(q)return;const e=e=>{if(D[D.length-1]===Rt&&!g(e.target,lt.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),co();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&<.current?.contains(t)))return;if(t.closest($))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,co,Rt,q]),ue(()=>{if(!t)return;const e=e=>{D[D.length-1]===Rt&&(g(e.target,lt.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Rt}})),Ye.current=!1,Be(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Rt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),ue(()=>{if(!t)return;if(q)return;const e=e=>{if("Escape"===e.key&&D[D.length-1]===Rt){if(ne(e))return e.preventDefault(),void e.stopPropagation();if(Sn&&!P)return;e.preventDefault(),e.stopPropagation(),sr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,sr,Rt,q,Sn,P]);const uo=t&&(void 0!==b||void 0!==x),[mo]=de(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),ho=Sn&&!Je?.home&&_n.actions.length>0;ue(()=>{t&&Jn&&function(e,t){const n=an.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(an.set(e,t),cn())}(Jn,{title:_n.text||Ke,dirty:Xn,copy:_n.copy,actions:ho&&mo?mo:void 0,menu:or.current??void 0})},[t,Jn,Ke,Xn,_n.text,_n.copy,ho,mo]);const fo=he(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(ue(()=>{if(!t)return;const e=e=>{if(D[D.length-1]!==Rt)return;if(g(e.target,lt.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&uo&&(e.preventDefault(),b?b():fo("bottom")),"k"===e.key&&uo&&(e.preventDefault(),x?x():fo("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,b,x,uo,fo,Rt]),!t||mn.current)return null;const po=_t?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=br(),d=(u.w-20*(o+1))/o,m=(u.h-14*(i+1)-22*i)/i,h=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+h,y:u.y+14+a*(m+14+22),w:d,h:m}}(Rt):null,wo=_t&&po?Q({width:po.w,height:po.h},{width:vn.w,height:vn.h}):1,yo=(()=>{if(_t&&po){const e=wo,t=vn.w*e,n=vn.h*e,r=po.x+(po.w-t)/2-vn.x,o=po.y+(po.h-n)/2-vn.y,i=Qt||en;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:G.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(tn&&Jt){const e="picked"===on;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:G.expose+30}:{}}}return null})(),go=v({modal:!1,titleId:!q&&(Sn?!Je?.home:!xe)?je:void 0,label:_n.text||Ke}),vo=kt&&O&&!O.editing?"object"==typeof O.state?/* @__PURE__ */Ee(H,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:O.state.disabledReason,children:$e.edit}):/* @__PURE__ */Ee(H,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>O.onEdit(),children:$e.edit}):null,bo=/* @__PURE__ */ke("div",{children:[
|
|
47
|
-
/* @__PURE__ */ke("div",{ref:lt,"data-modal-panel":!0,"data-modal-id":Rt,"data-window-key":se||void 0,...K?{"data-utility":""}:{},...qe?{"data-pinned-top":""}:{},...q?{"data-widget":""}:{},...Je?{"data-window-owner":Je.key}:{},...Je&&!Lt?{"data-window-root":""}:{},...Sn?{"data-window-tab":""}:{},...go,className:Sn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(q?Kt?"shadow-xl":"shadow-lg":"border "+(Kt?"shadow-xl border-line":"shadow-lg border-line-strong")),onPointerDown:e=>{if(!qr.current||_t||0!==e.button)return;const t=e.target;if(t.closest("[data-modal-panel]")!==lt.current)return;if(t.closest("[data-window-chrome]"))return;if(t.closest("[data-sidebar-rail]"))return void(t.closest(h)||fr(e));const n=e.currentTarget.getBoundingClientRect(),r=n.height/(e.currentTarget.offsetHeight||n.height),o=(Hr?M.compactBar:M.windowBar)*r;e.clientY-n.top>o||t.closest(h)||fr(e)},onContextMenu:e=>{const t=e.target;t.closest("[data-window-strip]")&&t.closest("[data-modal-panel]")===lt.current&&ro(e)},onMouseDownCapture:e=>{if(ct.current=!1,_t){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),no(Rt),Gr(!1),void pr(Rt)}if(!Kt&&!q&&!qe&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===lt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ct.current=!0,Ve(null),pr(Rt),window.addEventListener("mouseup",()=>{setTimeout(()=>{ct.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ct.current&&(ct.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(_t)return;Ve(null);e.target.closest("[data-modal-panel]")===lt.current&&(e.target.closest("button, input, a, select, textarea")||pr(Rt))},style:xe?{zIndex:$t+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Se}px)`,transition:Ne?"none":"transform 180ms ease-out",...q?{display:"none"}:{},...$t<0?{display:"none"}:{},...Kt||qe||Pe&&se===Pe?{}:{display:"none"},...Wt?{visibility:"hidden",pointerEvents:"none"}:{}}:{zIndex:qe?G.pinnedWindow:$t+1,width:vn.w,height:vn.h,top:vn.y,...q&&"right"===it?{right:window.innerWidth-vn.x-vn.w}:{left:vn.x},...$t<0&&!qe?{display:"none"}:{},...Me?{display:"none"}:{},...Tn||Dn||Wt?{visibility:"hidden",pointerEvents:"none"}:{},...yo??{}},children:[xe&&!q&&/* @__PURE__ */Ee("div",{onPointerDown:De,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),
|
|
47
|
+
/* @__PURE__ */ke("div",{ref:lt,"data-modal-panel":!0,"data-modal-id":Rt,"data-window-key":se||void 0,...K?{"data-utility":""}:{},...qe?{"data-pinned-top":""}:{},...q?{"data-widget":""}:{},...Je?{"data-window-owner":Je.key}:{},...Je&&!Lt?{"data-window-root":""}:{},...Sn?{"data-window-tab":""}:{},...go,className:Sn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(q?Kt?"shadow-xl":"shadow-lg":"border "+(Kt?"shadow-xl border-line":"shadow-lg border-line-strong")),onPointerDown:e=>{if(!qr.current||_t||0!==e.button)return;const t=e.target;if(t.closest("[data-modal-panel]")!==lt.current)return;if(t.closest("[data-window-chrome]"))return;if(t.closest("[data-sidebar-rail]"))return void(t.closest(h)||fr(e));const n=e.currentTarget.getBoundingClientRect(),r=n.height/(e.currentTarget.offsetHeight||n.height),o=(Hr?M.compactBar:M.windowBar)*r;e.clientY-n.top>o||t.closest(h)||fr(e)},onContextMenu:e=>{const t=e.target;t.closest("[data-window-strip]")&&t.closest("[data-modal-panel]")===lt.current&&ro(e)},onMouseDownCapture:e=>{if(ct.current=!1,_t){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),no(Rt),Gr(!1),void pr(Rt)}if(!Kt&&!q&&!qe&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===lt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ct.current=!0,Ve(null),pr(Rt),window.addEventListener("mouseup",()=>{setTimeout(()=>{ct.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ct.current&&(ct.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(_t)return;Ve(null);e.target.closest("[data-modal-panel]")===lt.current&&(e.target.closest("button, input, a, select, textarea")||pr(Rt))},style:xe?{zIndex:$t+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Se}px)`,transition:Ne?"none":"transform 180ms ease-out",...q?{display:"none"}:{},...$t<0?{display:"none"}:{},...Kt||qe||Pe&&se===Pe?{}:{display:"none"},...Wt?{visibility:"hidden",pointerEvents:"none"}:{}}:{zIndex:qe?G.pinnedWindow:$t+1,width:vn.w,height:vn.h,top:vn.y,...In&&!q?{"--radius-window":"0px"}:{},...q&&"right"===it?{right:window.innerWidth-vn.x-vn.w}:{left:vn.x},...$t<0&&!qe?{display:"none"}:{},...Me?{display:"none"}:{},...Tn||Dn||Wt?{visibility:"hidden",pointerEvents:"none"}:{},...yo??{}},children:[xe&&!q&&/* @__PURE__ */Ee("div",{onPointerDown:De,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),
|
|
48
48
|
/* @__PURE__ */ke("div",{"data-window-surface":"",className:"flex min-h-0 flex-1 flex-col "+(Ar?"backdrop-blur-sm":""),style:Ar?{backgroundColor:Kt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"}:void 0,children:[q?null:Sn?Je?.home?null:/* @__PURE__ */ke(Ce,{children:[
|
|
49
49
|
/* @__PURE__ */Ee("h2",{id:je,"data-window-title":!0,className:"sr-only",children:_n.text||Ke}),ho&&mo&&X(
|
|
50
50
|
/* @__PURE__ */Ee(Ce,{children:_n.actions}),mo),_n.badges.length>0&&/* @__PURE__ */Ee("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-2 overflow-hidden border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:_n.badges})]}):xe?null:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-S5JX4IAP.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|