efficient-shell 7.36.0 → 7.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +60 -2
  2. package/dist/{Browser-GL5LSI47.js → Browser-WFF3V5XN.js} +14 -14
  3. package/dist/Calculator-L6726KWL.js +29 -0
  4. package/dist/ConfirmDialog-V7JRHNK7.js +1 -0
  5. package/dist/{CurrencyConverter-HOHIYM4N.js → CurrencyConverter-5LXIRNZG.js} +12 -12
  6. package/dist/{Documents-U6ZBCYXP.js → Documents-73VBBEBF.js} +24 -24
  7. package/dist/{Files-YSWLVOAC.js → Files-FFNF3QZ7.js} +40 -40
  8. package/dist/{Notepad-5CO7KAHW.js → Notepad-XIG4KJA5.js} +10 -10
  9. package/dist/PdfViewer-BS5UDROT.js +1 -0
  10. package/dist/{PomodoroTimer-JQNFGA3S.js → PomodoroTimer-LHHDM6ML.js} +40 -40
  11. package/dist/{Preview-WUJSCN5P.js → Preview-C2ZC2SM3.js} +32 -32
  12. package/dist/{Sidebar-ON4DBXVI.js → Sidebar-XMH2FKCU.js} +27 -27
  13. package/dist/{Spreadsheet-32KRT3LH.js → Spreadsheet-FZV4FL6H.js} +10 -10
  14. package/dist/{Stock-EUD5OG3O.js → Stock-PWDOGWFR.js} +7 -7
  15. package/dist/{Weather-GA2K5LGB.js → Weather-WRNKDPM2.js} +16 -16
  16. package/dist/{WorldClock-THKDQYUL.js → WorldClock-L43LQEXI.js} +6 -6
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/{chunk-6IMYNQCU.js → chunk-3K5JZXDC.js} +14 -14
  21. package/dist/{chunk-6OXNDFJE.js → chunk-4755JEGD.js} +1 -1
  22. package/dist/{chunk-JLAK6FVZ.js → chunk-4TOFAEAW.js} +28 -28
  23. package/dist/{chunk-I2BPCXPL.js → chunk-7D6TZW44.js} +6 -6
  24. package/dist/{chunk-P6WZ24CB.js → chunk-CXF2BVXH.js} +1 -1
  25. package/dist/{chunk-2CTK44IB.js → chunk-E3JFDVQ5.js} +8 -8
  26. package/dist/{chunk-LF7FHR6U.js → chunk-E4FJNJ2I.js} +101 -101
  27. package/dist/chunk-ENMILDMH.js +1 -0
  28. package/dist/{chunk-K6VLDHTD.js → chunk-F5BQTXGY.js} +1 -1
  29. package/dist/{chunk-YXNO6PLF.js → chunk-F7OP5E6L.js} +1 -1
  30. package/dist/{chunk-YIEGC2CL.js → chunk-FBXOKW33.js} +2 -2
  31. package/dist/{chunk-YVECLMNT.js → chunk-FY3H52BM.js} +1 -1
  32. package/dist/chunk-IL4TXZ2Z.js +1041 -0
  33. package/dist/chunk-IZWMK4LP.js +1 -0
  34. package/dist/{chunk-MWAPICLX.js → chunk-KEZYLOFK.js} +1 -1
  35. package/dist/{chunk-PMUU2VHD.js → chunk-KNGFJOQD.js} +1 -1
  36. package/dist/chunk-LVCRH3K6.js +1 -0
  37. package/dist/{chunk-WCGEABUZ.js → chunk-OTFHGJSO.js} +6 -6
  38. package/dist/{chunk-XUHJRDNO.js → chunk-PBZ2VHS3.js} +1 -1
  39. package/dist/{chunk-K3LAW5NH.js → chunk-TRNQNGYE.js} +18 -18
  40. package/dist/{chunk-GKI4SVYL.js → chunk-UAG5IEAY.js} +1 -1
  41. package/dist/{chunk-OKHHHI4N.js → chunk-UONWRDS7.js} +1 -1
  42. package/dist/{chunk-XEHXBWEP.js → chunk-UQVSH226.js} +1 -1
  43. package/dist/{chunk-UBRW43AM.js → chunk-VHHZHNJC.js} +8 -8
  44. package/dist/{chunk-PYNMOS2E.js → chunk-WSRZRWN7.js} +1 -1
  45. package/dist/{chunk-I5JYRYAY.js → chunk-XKANXONN.js} +2 -2
  46. package/dist/{chunk-B527AYLS.js → chunk-Y6V2JPN3.js} +1 -1
  47. package/dist/{chunk-CMUDEROF.js → chunk-ZELMENOO.js} +8 -8
  48. package/dist/file-intake/index.js +1 -1
  49. package/dist/i18n/index.d.ts +1 -1
  50. package/dist/icons/efficient-looks.js +38 -14
  51. package/dist/icons/efficient.d.ts +28 -4
  52. package/dist/icons/efficient.js +333 -311
  53. package/dist/icons/iconoir.js +7 -1
  54. package/dist/icons/index.d.ts +1 -1
  55. package/dist/icons/index.js +1 -1
  56. package/dist/icons/lucide.js +24 -9
  57. package/dist/icons/phosphor.js +14 -10
  58. package/dist/icons/tabler.js +54 -19
  59. package/dist/{index-9qfNoZ-O.d.ts → index-CFyMUpku.d.ts} +236 -128
  60. package/dist/index.d.ts +3 -3
  61. package/dist/index.js +194 -194
  62. package/dist/locales/zh-Hans.d.ts +1 -1
  63. package/dist/locales/zh-Hans.js +1 -1
  64. package/dist/map/index.js +2 -2
  65. package/dist/markdown/index.js +1 -1
  66. package/dist/page-tabs/index.js +5 -5
  67. package/dist/pdf/index.js +1 -1
  68. package/dist/{strings-Cn5SsfWm.d.ts → strings-BOGLdj8k.d.ts} +4 -0
  69. package/dist/telemetry/index.js +1 -1
  70. package/dist/ui/index.d.ts +2 -2
  71. package/dist/ui/index.js +1 -1
  72. package/package.json +1 -1
  73. package/dist/Calculator-HQNPFH7T.js +0 -29
  74. package/dist/ConfirmDialog-DHHLXNMV.js +0 -1
  75. package/dist/PdfViewer-KA4YIRIO.js +0 -1
  76. package/dist/chunk-7ZKLBRHL.js +0 -1
  77. package/dist/chunk-DJ3Z66LK.js +0 -1
  78. package/dist/chunk-KLGZ3O7B.js +0 -1035
  79. package/dist/chunk-PUCDNUFR.js +0 -1
@@ -0,0 +1 @@
1
+ import{loadThemeIconSet as e}from"./chunk-4755JEGD.js";var r=["academic-cap","accent","account","account-circle","add","add-circle","add-person","adjust","align-center","align-justify","align-left","align-right","align-separate","alignment","anchor","animation","apps","archive-box","arrow","arrow-down","arrow-left","arrow-left-end-on-rectangle","arrow-long-right","arrow-right","arrow-trending-down","arrow-trending-up","arrow-up","arrow-up-right","at-symbol","attach","background","bag","bank","bars-3-bottom-left","battery","beaker","bell","bell-alert","bell-plus","billing","black-and-white","block-badge","block-banner","block-box","block-button","block-column","block-coupon","block-divider","block-footer","block-heading","block-image","block-included-list","block-layered-images","block-product","block-product-title","block-section","block-social","block-spacer","block-text","block-video","blog-post","bold","bolt","book-open","bookmark","bookmark-square","braces","breadcrumb","briefcase","bug","bug-ant","building-library","building-office-2","button","button-arrow","button-icon","calculator","calendar","calendar-check","camera","caption","car","card-payment","caret","cart","case","case-capitalized","case-lower","case-normal","case-upper","category","chart","chart-bar","chart-bar-square","chart-line","chat","chat-bubble-left-right","chat-bubble-oval-left-ellipsis","check","check-circle","checkbox","chevron","chevron-double","chevron-double-left","chevron-double-right","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle-stack","clear-marks","clipboard","clipboard-check","clipboard-document-list","clipboard-list","clock","close","close-circle","cloud","cloud-alert","cloud-arrow-up","cloud-check","cloud-download","cloud-pause","cloud-slash","code","code-bracket","collapse","collapse-all","column-gap","column-widths","columns","company","compose","contrast","cookie","copied","copy","copy-style","copy-to-page","corner","crop","cube-transparent","cursor","cursor-arrow-rays","cursor-click","dashboard","date","desktop","diagram","direction","direction-down","direction-left","direction-right","direction-up","document","document-check","document-magnifying-glass","dollar","dot","download","drag","drop","duplicate","edit","email","emphasis","eraser","error","expand","external","eye","eye-off","face-smile","filter","finish","fire","flag","folder","folder-open","folder-plus","forward","full-width","gap","gem","gift","globe","grid","ground","hand","hand-thumb-up","hash","headquarters","heart","height","help","help-off","hexagon","home","hover","icon-after-text","icon-before-text","identification","image","image-off","images","inbox","info","italic","key","layers","layout","letter-spacing","lightbulb","line-between","line-dashed","line-dotted","line-solid","line-spacing","line-style","link","link-slash","list","list-format","location","lock","logo","logout","map","media","megaphone","menu","meta","microphone","money","moon","more","more-vertical","move-down","move-up","newspaper","no-symbol","note","nudge","numbered-list","opacity","own-text","package","package-open","padding-bottom","padding-left","padding-right","padding-top","padding-x","padding-y","page","paint-brush","panel-left","panel-right","paragraph-spacing","parcel","paste","paste-style","pause","pen","people","percent","phone","phone-hidden","placement","play","plus-minus","power","presentation-chart-bar","print","product","product-field","product-size","progress","quiet","radio-dot","radius","receipt","receipt-percent","receipt-refund","rectangle-group","redo","refresh","remove","remove-circle","rename","reply","reply-all","revert","robot","rotate","scale","scroll-point","scroll-text","search","select-all","send","server","settings","shadow","shape-ellipse","shape-rect","share","shield-check","shield-exclamation","signal","signal-slash","sitemap","slide-arrows-bare","slide-arrows-round","slide-arrows-square","slide-picker-bar","slide-picker-cards","slide-picker-dots","slide-picker-numbers","sort","sparkles","speaker","speaker-wave","spec-table","spinner","split","square","star","state","status-circle","status-dot","sticky","stop-circle","store","strike","styles","subscript","success-burst","sun","superscript","swap","swatch","table","tablet","tabs","tag","target","team","telephone","template","text-color","text-lines","text-size","text-small","text-value","texture","theme","ticket","title","trash","trigger","truck","tv","type","tyre","underline","undo","upload","v-align","verified","video-off","view-columns","wallet","warning","weight","wheel","widgets","width","window","windows","words-from","wrap","wrench","wrench-screwdriver","zoom-in"],o=new Set(r),a=e=>"string"==typeof e&&o.has(e),t=[{name:"phosphor",label:"Phosphor"},{name:"iconoir",label:"Iconoir"},{name:"lucide",label:"Lucide"},{name:"tabler",label:"Tabler"}],l={pink:"phosphor",green:"iconoir",grey:"lucide",blue:"tabler"};function c(r){return e(r)}function i(e,r,o){return o?"string"==typeof r&&r?r:null:l[e]??null}export{r as ICON_NAMES,l as ICON_SET_FOR_THEME,t as THEME_ICON_SETS,i as iconSetFor,a as isIconName,c as loadIconSet};
@@ -1,3 +1,3 @@
1
- import{Icon as e}from"./chunk-6OXNDFJE.js";import{useShellStrings as t}from"./chunk-DJ3Z66LK.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__ */
1
+ import{Icon as e}from"./chunk-4755JEGD.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
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
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};
@@ -1 +1 @@
1
- import{VERSION as e}from"./chunk-PUCDNUFR.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,_=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})}},R=[200,500],Z=(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,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)=>{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,R,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},U=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],N=[800,1800],j=e=>{document.prerendering?E(()=>j(e)):"complete"!==document.readyState?addEventListener("load",()=>j(e),!0):setTimeout(e)};var B=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,D=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,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("//")&&B.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)},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(J,"[redacted]").replace(K,"[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,U),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)})})}})})(k),Z(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,N,t.reportAllChanges);j(()=>{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,N,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,N,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 _=window.setInterval(m,n.flushIntervalMs??6e4),R=t(e=>C(L(e,"boundary"))),B={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(_),R(),ae===B&&(ae=null))}};return ae=B,B}export{se as startClientTelemetry};
1
+ import{VERSION as e}from"./chunk-IZWMK4LP.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,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},x=class{p;l;h(e){this.p?.(e)}},j=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?C(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},K=/[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,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,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 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(K,"[redacted]").replace(J,"[redacted]").replace(W,"[url]").replace(D,"[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);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,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),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,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 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 Z=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(Z),F(),ae===U&&(ae=null))}};return ae=U,U}export{se as startClientTelemetry};
@@ -1,5 +1,5 @@
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-DJ3Z66LK.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 M=l(()=>{P.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);i(()=>M,[M]);const C=e=>{P.current&&(e.currentTarget.hasPointerCapture?.(P.current.pointer)&&e.currentTarget.releasePointerCapture(P.current.pointer),M())},D="left"===f?"right-0":"right"===f?"left-0":"top"===f?"bottom-0":"top-0",T="left"===f?"right":"right"===f?"left":"top"===f?"bottom":"top",I=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:T,delay:600,className:`${I} ${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 M();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:C,onPointerCancel:C,onLostPointerCapture:()=>{P.current&&M()},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:[
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
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 +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-PYNMOS2E.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
+ 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};