efficient-shell 10.20.0 → 10.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-3BZPV4OH.js → Browser-RMXGMX4E.js} +12 -12
- package/dist/{Documents-N2OS46II.js → Documents-YAKAFEDY.js} +5 -5
- package/dist/{Files-6MMOX77N.js → Files-FJAFKP6V.js} +38 -38
- package/dist/{Notepad-QSF2MA3I.js → Notepad-YGYSYF3R.js} +7 -7
- package/dist/{Preview-YJPVKRQU.js → Preview-UEZPFGON.js} +12 -12
- package/dist/{Spreadsheet-3P3BL6CS.js → Spreadsheet-AEFR6TFD.js} +11 -11
- package/dist/ai/index.d.ts +10 -1
- package/dist/ai/index.js +30 -30
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-43L5K2IX.js → chunk-2EYXE5XK.js} +1 -1
- package/dist/{chunk-XLWMM53L.js → chunk-6T2CL4JT.js} +2 -2
- package/dist/{chunk-VQCSHJEF.js → chunk-ALF3GC7A.js} +5 -5
- package/dist/{chunk-UYRMW5MO.js → chunk-DPYBV5PU.js} +5 -5
- package/dist/{chunk-JIGFR7Z3.js → chunk-GO2ZUVQD.js} +6 -6
- package/dist/{chunk-NFB7PARJ.js → chunk-I35NCNAF.js} +1 -1
- package/dist/{chunk-EJUNGVK2.js → chunk-M5A7723Z.js} +16 -16
- package/dist/{chunk-S74LKSUB.js → chunk-MMYWBTYP.js} +1 -1
- package/dist/{chunk-O47HKK6E.js → chunk-Q32Q44DX.js} +1 -1
- package/dist/{chunk-DYNJ2H6R.js → chunk-RNPCHEXO.js} +4 -4
- package/dist/{chunk-PW52RXPI.js → chunk-S6Y4I22Q.js} +1 -1
- package/dist/chunk-TD76YFXE.js +1 -0
- package/dist/{chunk-XLCZHPCQ.js → chunk-X2N6UARO.js} +1 -1
- package/dist/{chunk-QDKAA3HR.js → chunk-XZJK5DFD.js} +2 -2
- package/dist/{chunk-QO5E33DH.js → chunk-YTGNGX3D.js} +4 -4
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +79 -79
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-RMUSRDWV.js +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return P("div",{className:wt,ref:Dt,children:/* @__PURE__ */P(
|
|
3
|
-
return P("div",{className:wt,ref:Dt,children:/* @__PURE__ */P("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:H},children:Ct})});const Zt=J.map((t,e)=>Jt.reduce((t,a)=>t+(Y(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Zt[e]>0?t/Zt[e]:null,qt=[];if(Z){let t=J.map(()=>0);for(const e of Jt)t=t.map((t,a)=>t+(Y(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!Z&&!_t&&void 0===et&&Jt.some(te)&&Jt.some(t=>!te(t)),ae=gt&&!Z?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Jt.filter(t=>!te(t)):Jt).filter(t=>!re(t)),le=ee?Jt.filter(te).flatMap(t=>t.data.filter(Y)):[],ne=Z?(qt.at(-1)??[]).filter(Y):oe.flatMap(t=>t.data.filter(Y)),ie=ee?
|
|
1
|
+
import{ChartDot as t}from"./chunk-CK2YOGUS.js";import{stepPath as e,curvePath as a,areaBetween as r,areaFrom as o}from"./chunk-VFC6QUEN.js";import{ChartDefs as l,MOTION as n,stagger as i,fillFor as s,dashFor as c,maskId as d}from"./chunk-465RRWBY.js";import{ChartSkeleton as m}from"./chunk-3IUPYCW3.js";import{useHighlight as h,highlightOpacity as u}from"./chunk-CNYAHYE6.js";import{ChartTooltip as f}from"./chunk-G4GVLK44.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-C764JODK.js";import{pairedAxes as x,niceAxis as v,niceMax as b,linearScale as M,axisGutter as N,bandScale as w,ladderScale as j}from"./chunk-2JWPNR2U.js";import{usePlotWidth as $}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as V}from"./chunk-TWVUQUUD.js";import{ChartBrush as z}from"./chunk-E6GDAV5R.js";import{resolveSeriesColor as A,CHART_INK as C,STATUS_VARS as D}from"./chunk-TZFACUMR.js";import{useShellStrings as L,useShellLocale as R}from"./chunk-GDQJBQ5B.js";import{formatPercent as W,formatPlain as E}from"./chunk-C3QOHMR6.js";import{useRef as S,useState as U,useId as T,useEffect as I}from"react";import{jsx as P,jsxs as B}from"react/jsx-runtime";var O=12,F=16,G=26,Q=52,Y=t=>"number"==typeof t&&Number.isFinite(t);function K({series:K,labels:J,height:H=200,stacked:Z=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=L().charts,Vt=R(),zt=rt??(t=>E(t,Vt)),At=ot??zt,Ct=jt??$t.noData,Dt=S(null),Lt=$(Dt),Rt=Nt??Lt,[Wt,Et]=U(null),[St,Ut]=U(null),{highlighted:Tt}=h(),It=T(),Pt=ut??St,Bt=p(ht&&Pt?Pt[1]-Pt[0]+1:J.length,pt);if(I(()=>{if(null!==Wt)return V(t=>"Escape"===t.key&&(Et(null),!0))},[Wt]),kt)/* @__PURE__ */
|
|
2
|
+
return P("div",{className:wt,ref:Dt,children:/* @__PURE__ */P(m,{height:H,width:Nt??Lt})});const Ot=J,Ft=ut??St??[0,Math.max(0,Ot.length-1)],[Gt,Qt]=Ft,Yt=t=>Bt.slice(ht?t.slice(Gt,Qt+1):t),Kt=lt?Yt(lt):void 0,Jt=K.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(Y)).map(t=>({...t,data:Yt(t.data),pointTones:t.pointTones?Yt(t.pointTones):void 0})),Ht=t=>(ht?Gt:0)+(Bt.view?.[0]??0)+t;if(J=Yt(Ot),0===Jt.length||0===J.length)/* @__PURE__ */
|
|
3
|
+
return P("div",{className:wt,ref:Dt,children:/* @__PURE__ */P("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:H},children:Ct})});const Zt=J.map((t,e)=>Jt.reduce((t,a)=>t+(Y(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Zt[e]>0?t/Zt[e]:null,qt=[];if(Z){let t=J.map(()=>0);for(const e of Jt)t=t.map((t,a)=>t+(Y(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!Z&&!_t&&void 0===et&&Jt.some(te)&&Jt.some(t=>!te(t)),ae=gt&&!Z?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Jt.filter(t=>!te(t)):Jt).filter(t=>!re(t)),le=ee?Jt.filter(te).flatMap(t=>t.data.filter(Y)):[],ne=Z?(qt.at(-1)??[]).filter(Y):oe.flatMap(t=>t.data.filter(Y)),ie=ee?x([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:Z&&"percent"===X||_t||void 0!==et?null:v(Z?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=Z&&"percent"===X?1:se?se.hi:et??b(Math.max(...ne,0)),me=Z&&"percent"===X?t=>W(Math.round(100*t),0,Vt):zt,he=_t?q:se?se.ticks:M([ce,de],{from:0,to:1}).ticks(at+1),ue=N(he.map(me),Q),fe=ie?N(ie.right.ticks.map(zt),F):F,pe={left:ue,right:Math.max(ue+1,Rt-fe),top:O,bottom:H-G},ge=w(J.length,{from:pe.left,to:pe.right}),ye=_t?j(q,{from:pe.bottom,to:pe.top}):null,ke=M([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Jt.filter(re),Me=Math.max(0,...J.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?M([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),Et(e=>{const a=(e??0)+t;return Math.min(J.length-1,Math.max(0,a))})},ze=Math.max(1,Math.ceil(J.length/Math.max(1,Math.floor(Rt/96))));/* @__PURE__ */
|
|
4
4
|
return B("div",{className:`relative ${wt??""}`,ref:Dt,children:[
|
|
5
5
|
/* @__PURE__ */B("svg",{width:"100%",height:H,viewBox:`0 0 ${Rt} ${H}`,role:"img","aria-label":$t.overIntervals(Jt.map(t=>t.label),J.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Et(null),onBlur:()=>Et(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Wt&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Ht(Wt));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
|
|
6
6
|
/* @__PURE__ */P("defs",{children:/* @__PURE__ */P("clipPath",{id:It,children:/* @__PURE__ */P("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
-
/* @__PURE__ */P(
|
|
8
|
-
/* @__PURE__ */P("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:
|
|
9
|
-
/* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${
|
|
10
|
-
return P("path",{d:a
|
|
11
|
-
return P("rect",{x:ge.center(
|
|
12
|
-
return P("rect",{x:ge.center(
|
|
7
|
+
/* @__PURE__ */P(l,{id:It,fills:Jt.map((t,e)=>({color:A(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:Z?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:C.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:C.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */P("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:C.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */P("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:C.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */P("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:C.label,children:nt}),
|
|
9
|
+
/* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${d(It)})`:void 0,children:Jt.map((t,l)=>{const d=A(t.slot,t.color,t.tone),m=t.mode??(Z?"area":"line"),h=u(t.key,Tt);if("step"===m){const a=J.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>Y(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
|
|
10
|
+
return P("path",{d:e(a),fill:"none",stroke:d,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const f=J.map((e,a)=>{const r=Z?qt[l]?.[a]:t.data[a];return Y(r)?[ge.center(a),je(t)(r)]:null}).filter(t=>null!==t);if(0===f.length)return null;if("column"===m){const e=Math.max(1,.62*ge.bandwidth),a="solid"===t.fillVariant,r=je(t);return re(t)?/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((r,o)=>{const n=t.data[o];if(!Y(n)||n<=0)return null;const i=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Jt[t]?.key)).reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))(l,o),s=Ne(i+n),c=Ne(i)-(i>0?1:0);/* @__PURE__ */
|
|
11
|
+
return P("rect",{x:ge.center(o)-e/2,y:s,width:e,height:Math.max(0,c-s),rx:2,fill:t.pointTones?.[o]?D[t.pointTones[o]]:d,fillOpacity:a?1:.55},o)})},t.key):/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((o,s)=>{const c=Z?qt[l]?.[s]:t.data[s];if(!Y(c))return null;const m=r(c);/* @__PURE__ */
|
|
12
|
+
return P("rect",{x:ge.center(s)-e/2,y:Math.min(m,xe),width:e,height:Math.abs(xe-m),rx:2,fill:d,fillOpacity:a?1:.35,className:xt?n.rise:void 0,style:xt?i(s,26):void 0},s)})},t.key)}const p=a(f,_,tt),g=Z&&l>0?J.map((t,e)=>[ge.center(e),ve(qt[l-1]?.[e]??0)-2]):null,y=g?r(p,g):o(p,f,xe);/* @__PURE__ */
|
|
13
13
|
return B("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||Z)&&
|
|
14
|
-
/* @__PURE__ */P("path",{d:y,fill:
|
|
15
|
-
/* @__PURE__ */P("path",{d:p,fill:"none",stroke:
|
|
14
|
+
/* @__PURE__ */P("path",{d:y,fill:s(It,l,t.fillVariant??bt,d),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */P("path",{d:p,fill:"none",stroke:d,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:c(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?n.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??D[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
16
|
return B("g",{children:[
|
|
17
|
-
/* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Jt.map((
|
|
18
|
-
return B("g",{children:[n.map(r=>{const n=Z?qt[a]?.[r]:
|
|
17
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Jt.map((e,a)=>{if("column"===e.mode)return null;const r=ct??(st?"last":"none"),o=A(e.slot,e.color,e.tone),l=[...e.data].map(Y).lastIndexOf(!0),n="all"===r?J.map((t,e)=>e).filter(t=>Y(Z?qt[a]?.[t]:e.data[t])):l>=0?[l]:[];/* @__PURE__ */
|
|
18
|
+
return B("g",{children:[n.map(r=>{const n=Z?qt[a]?.[r]:e.data[r];return Y(n)?/* @__PURE__ */P(t,{cx:ge.center(r),cy:je(e)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${J[r]}: ${e.label} ${zt(n)}`},r):null}),st&&l>=0&&Y(Z?qt[a]?.[l]:e.data[l])&&/* @__PURE__ */P("text",{x:ge.center(l)-10,y:je(e)(Z?qt[a]?.[l]:e.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:C.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Z?qt[a]?.[l]:e.data[l])})]},`dots-${e.key}`)}),J.map((t,e)=>e%ze===0?/* @__PURE__ */P("text",{x:ge.center(e),y:H-8,textAnchor:"middle",fontSize:11,fill:C.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Wt&&/* @__PURE__ */P("line",{x1:ge.center(Wt),y1:pe.top,x2:ge.center(Wt),y2:pe.bottom,stroke:C.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
19
|
/* @__PURE__ */B("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
|
-
/* @__PURE__ */P("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:
|
|
21
|
-
/* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:
|
|
22
|
-
/* @__PURE__ */P("div",{className:"pointer-events-none absolute top-2 z-10",style:
|
|
20
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:C.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
+
/* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:C.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Me)})]}),Bt.drag&&/* @__PURE__ */P(g,{x0:ge(Bt.drag[0]),x1:ge(Bt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),J.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Et(e),onPointerDown:()=>Bt.press(e),onPointerEnter:()=>Bt.over(e),onPointerUp:Bt.release,onClick:yt?()=>yt(Ht(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Bt.view&&/* @__PURE__ */P(y,{from:Kt?.[0]??J[0],to:Kt?.at(-1)??J[J.length-1],count:J.length,total:Z&&"percent"!==X?At(Zt.reduce((t,e)=>t+e,0)):ae?At(be.reduce((t,e)=>t+e.data.filter(Y).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Jt).filter(t=>t.data.some(Y)).map(t=>{const e=t.data.filter(Y),a=A(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=Z||"column"===t.mode?At(r):$t.zoomLevel(At(r/e.length),At(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Bt.clear}),ht&&Ot.length>2&&/* @__PURE__ */P(z,{className:"mt-1",labels:Ot,width:Rt,data:K[0]?.data??[],range:Ft,onRangeChange:t=>{ft?ft(t):Ut(t)}}),null!==Wt&&
|
|
22
|
+
/* @__PURE__ */P("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(Wt),ge.bandwidth,Rt),children:/* @__PURE__ */P(f,{title:Kt?.[Wt]??J[Wt],rows:Jt.map((t,e)=>({key:t.key,label:t.label,color:A(t.slot,t.color,t.tone),value:Y(t.data[Wt])?Z&&"percent"===X?`${W(100*(Xt(t.data[Wt],Wt)??0),1,Vt)} · ${At(t.data[Wt])}`:At(t.data[Wt]):void 0})),footnote:Z&&"percent"===X?$t.inBucket(At(Zt[Wt])):void 0})})]})}export{K as TimeSeriesChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Avatar as e}from"./chunk-AFYLVV74.js";import{StatCard as a,Card as t}from"./chunk-P3RXXWXN.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-VWIYC2NB.js";import{ColumnChart as l}from"./chunk-
|
|
1
|
+
import{Avatar as e}from"./chunk-AFYLVV74.js";import{StatCard as a,Card as t}from"./chunk-P3RXXWXN.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-VWIYC2NB.js";import{ColumnChart as l}from"./chunk-DPYBV5PU.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-TXDA7TTP.js";import{Button_default as c}from"./chunk-I4VIEGCX.js";import{TH_ONE_LINE as n}from"./chunk-MVZRZTQP.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
|
|
2
2
|
return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */m("div",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as t}from"./chunk-
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as t}from"./chunk-YTGNGX3D.js";import{resolveSeriesColor as i,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as a}from"./chunk-GDQJBQ5B.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{jsx as m,jsxs as n}from"react/jsx-runtime";function s({boxes:s,height:c=240,width:h,color:u,tone:x,formatValue:d,yAxisLabel:y,label:k,className:b,emptyLabel:f}){const p=r().charts,q=a(),g=d??(e=>o(e,q)),v=k??p.distribution,W=i(0,u,x),j=s.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
2
2
|
return m(t,{labels:s.map(e=>e.label),values:j,height:c,width:h,bandPadding:.5,formatValue:g,yAxisLabel:y,className:b,emptyLabel:f,ariaLabel:p.fiveNumber(v,s.length),tooltip:t=>{const i=s[t];/* @__PURE__ */
|
|
3
3
|
return m(e,{title:i.label,rows:[{key:"max",label:p.maximum,color:W,value:g(i.max)},{key:"q3",label:p.q3,color:W,value:g(i.q3)},{key:"median",label:p.median,color:W,value:g(i.median)},{key:"q1",label:p.q1,color:W,value:g(i.q1)},{key:"min",label:p.minimum,color:W,value:g(i.min)}],emphasisKey:"median",footnote:i.outliers?.length?p.outliers(i.outliers.length):void 0})},children:({x:e,y:t,active:i})=>/* @__PURE__ */m("g",{children:s.map((r,a)=>{const o=e.center(a),s=Math.max(6,e.bandwidth);/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:null!==i&&i!==a?.45:1,children:[
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{CHART_INK as s,resolveSeriesColorWithin as c}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-GDQJBQ5B.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:$,xDomain:j,yDomain:w,xScale:N="linear",yScale:R="linear",radiusRange:D=[4,22],className:L,emptyLabel:S}){const U=m().charts,B=h(),P=z??(e=>f(e,B)),Q=$??(e=>f(e,B)),V=S??U.noObservations,W=u(null),C=n(W),E=v??C,G=p(),[O,F]=d(null);x(()=>{if(null!==O)return a(e=>"Escape"===e.key&&(F(null),!0))},[O]);const I=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),J=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),K=j||w?J.map(e=>({...e,points:e.points.filter(e=>I(e.x,j)&&I(e.y,w))})).filter(e=>e.points.length>0):J,T=J.reduce((e,t)=>e+t.points.length,0)-K.reduce((e,t)=>e+t.points.length,0);if(0===K.length)/* @__PURE__ */
|
|
2
2
|
return y("div",{className:L,ref:W,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const X=K.flatMap(e=>e.points),Z=X.some(e=>null!=e.size),H=14,Y=20,q=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(X.map(e=>e.y),w,R,{from:k-q,to:H}),ie=t(te.ticks(5).map(Q),_),le=Math.max(ie+1,E-Y),re=ee(X.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...X.map(e=>e.size??1))],{from:D[0],to:D[1]}),ne=O?K[O.s]:void 0,ae=O&&ne?ne.points[O.i]:void 0,se=K.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
3
|
return g("div",{className:`relative ${L??""}`,ref:W,children:[
|
|
4
4
|
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${E} ${k}`,role:"img","aria-label":U.scatter(K.map(e=>e.label),A??U.yAxis,M??U.xAxis)+(T>0?`. ${U.outsideRange(T)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>F(null),onBlur:()=>F(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=O?se.findIndex(e=>e.s===O.s&&e.i===O.i):0;F(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
5
|
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:G,children:/* @__PURE__ */y("rect",{x:ie-D[1],y:H-D[1],width:le-ie+2*D[1],height:k-q-H+2*D[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
6
|
-
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:
|
|
7
|
-
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:
|
|
8
|
-
/* @__PURE__ */y("g",{clipPath:`url(#${G})`,children:K.map((e,t)=>{const i=
|
|
6
|
+
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:s.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
+
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:P(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:s.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:s.label,children:A}),
|
|
8
|
+
/* @__PURE__ */y("g",{clipPath:`url(#${G})`,children:K.map((e,t)=>{const i=c(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:Z?oe(l.size??0):D[0]+1,fill:i,fillOpacity:O&&O.s!==t?.25:.62,stroke:s.surface,strokeWidth:2,onMouseEnter:()=>F({s:t,i:r})},`${e.key}-${r}`))})})]}),O&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??U.xAxis,color:c(ne.slot,3,ne.color,ne.tone),value:P(ae.x)},{key:"y",label:A??U.yAxis,color:c(ne.slot,3,ne.color,ne.tone),value:Q(ae.y)},...null!=ae.size?[{key:"size",label:U.size,color:s.muted,value:f(ae.size,B)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-
|
|
1
|
+
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-M5A7723Z.js";import{ChartFrame as a}from"./chunk-VAK5FQXH.js";import{ColumnChart as l}from"./chunk-DPYBV5PU.js";import{TH_ONE_LINE as s}from"./chunk-MVZRZTQP.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
|
|
2
2
|
/* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
|
|
3
3
|
/* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
|
|
4
4
|
/* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="10.21.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-RMUSRDWV.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,R=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})}},Z=[200,500],F=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,R),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)=>{_(()=>{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/_:.\-[\]{}*@~]+$/,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,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,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("//")&&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;_(()=>{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),F(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&&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(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};
|
|
1
|
+
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-TD76YFXE.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},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();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,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?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}},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,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,W=/\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&&O.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("//")&&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=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);C(()=>{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(V,"[id]").replace(W,"[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,2 +1,2 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-G4GVLK44.js";import{CartesianPlot as o}from"./chunk-
|
|
2
|
-
return l(o,{labels:C,values:
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-G4GVLK44.js";import{CartesianPlot as o}from"./chunk-YTGNGX3D.js";import{binValues as r}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as e,useShellLocale as i}from"./chunk-GDQJBQ5B.js";import{formatPlain as m,formatFixed as n}from"./chunk-C3QOHMR6.js";import{jsx as l}from"react/jsx-runtime";function c({values:c,bins:s=10,precomputed:h,height:u=220,width:p,color:b,tone:f,formatBound:d,formatCount:x,yAxisLabel:g,label:k,className:y,emptyLabel:j}){const L=e().charts,v=i(),w=d??(t=>Number.isInteger(t)?m(t,v):n(t,1,v)),A=x??(t=>m(t,v)),G=g??L.countAxis,N=k??L.distribution,M=h??r(c??[],s),B=a(0,b,f),C=M.map(t=>w(t.from)),Q=M.map(t=>t.count);/* @__PURE__ */
|
|
2
|
+
return l(o,{labels:C,values:Q,height:u,width:p,bandPadding:0,xTickAnchor:"start",formatValue:A,yAxisLabel:G,className:y,emptyLabel:j,ariaLabel:L.histogram(N,M.length,(c??[]).length),tooltip:o=>/* @__PURE__ */l(t,{title:`${w(M[o].from)} – ${w(M[o].to)}`,rows:[{key:"count",label:L.observations,color:B,value:A(M[o].count)}]}),children:({x:t,y:o,bottom:r,active:a})=>/* @__PURE__ */l("g",{children:M.map((e,i)=>/* @__PURE__ */l("rect",{x:t(i)+.5,y:o(e.count),width:Math.max(1,t.bandwidth-1),height:Math.max(0,r-o(e.count)),fill:B,fillOpacity:null===a||a===i?.85:.42},i))})})}export{c as HistogramChart};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{DragBand as e,tooltipBesideBand as t}from"./chunk-C764JODK.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{
|
|
1
|
+
import{DragBand as e,tooltipBesideBand as t}from"./chunk-C764JODK.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{CHART_INK as s}from"./chunk-TZFACUMR.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-GDQJBQ5B.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:k=220,width:M,bandPadding:w=.24,min:N,max:A,yTickCount:$=4,formatValue:j,yAxisLabel:D,xTickAnchor:P="center",children:E,overlay:R,tooltip:U,onSelect:z,zoom:C,ariaLabel:L,className:S,emptyLabel:B}){const F=c().charts,I=m(),Q=j??(e=>d(e,I)),T=B??F.noData,V=u(null),W=a(V),J=M??W,[K,O]=f(null),Z=g();if(p(()=>{if(null!==K)return h(e=>"Escape"===e.key&&(O(null),!0))},[K]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
|
|
2
2
|
return x("div",{className:S,ref:V,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:T})});const G=b.filter(Number.isFinite),H=G.every(Number.isInteger),X=void 0===N&&void 0===A?r(Math.min(0,...G),Math.max(0,...G),{intervals:$+1,integer:H}):null,q=void 0!==N&&void 0===A?r(N,Math.max(N,...G),{intervals:$+1,integer:H,zero:!1}):null,Y=X?X.lo:N??Math.min(0,...G),_=X?X.hi:q?q.hi:A??i(Math.max(...G,0)),ee=X?X.ticks:q?[Y,...q.ticks.filter(e=>e>Y)]:n([Y,_],{from:0,to:1}).ticks($+1),te={top:12,right:16,bottom:26,left:o(ee.map(Q),48)+(D?10:0)},re=te.left,ie=Math.max(re+1,J-te.right),ne=te.top,oe=k-te.bottom,le=n([Y,_],{from:oe,to:ne}),ae=l(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(J/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
3
3
|
return y("div",{className:`relative ${S??""}`,ref:V,children:[
|
|
4
4
|
/* @__PURE__ */y("svg",{width:"100%",height:k,viewBox:`0 0 ${J} ${k}`,role:"img","aria-label":L,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>O(null),onBlur:()=>O(null),onKeyDown:e=>{if(z&&null!==K&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void z(K);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;O(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:C?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
|
|
5
|
-
/* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:Z,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:
|
|
6
|
-
/* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:
|
|
7
|
-
/* @__PURE__ */x("g",{clipPath:`url(#${Z})`,children:E({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:J,height:k,clipId:Z,active:K})}),R?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:J,height:k,clipId:Z,active:K}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===P?ae(t):ae.center(t),y:k-8,textAnchor:"middle",fontSize:11,fill:
|
|
5
|
+
/* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:Z,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:s.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
6
|
+
/* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:s.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ee.map(e=>/* @__PURE__ */x("text",{x:re-8,y:le(e)+4,textAnchor:"end",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(e)},`t${e}`)),D&&/* @__PURE__ */x("text",{x:14,y:(ne+oe)/2,transform:`rotate(-90 14 ${(ne+oe)/2})`,textAnchor:"middle",fontSize:11,fill:s.label,children:D}),
|
|
7
|
+
/* @__PURE__ */x("g",{clipPath:`url(#${Z})`,children:E({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:J,height:k,clipId:Z,active:K})}),R?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:J,height:k,clipId:Z,active:K}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===P?ae(t):ae.center(t),y:k-8,textAnchor:"middle",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e)},`x${t}`):null),C?.drag&&/* @__PURE__ */x(e,{x0:ae.center(C.drag[0])-(ie-re)/v.length/2,x1:ae.center(C.drag[1])+(ie-re)/v.length/2,top:ne,bottom:oe}),v.map((e,t)=>/* @__PURE__ */x("rect",{x:ae.center(t)-(ie-re)/v.length/2,y:ne,width:(ie-re)/v.length,height:oe-ne,fill:"transparent",onMouseEnter:()=>O(t),onPointerDown:C?()=>C.press(t):void 0,onPointerEnter:C?()=>C.over(t):void 0,onPointerUp:C?.release,onClick:z?()=>z(t):void 0,style:z?{cursor:"pointer"}:void 0},`h${t}`))]}),U&&null!==K&&
|
|
8
8
|
/* @__PURE__ */x("div",{className:"pointer-events-none absolute top-2 z-10",style:t(ae.center(K),ae.bandwidth,J),children:U(K)})]})}export{v as CartesianPlot};
|
package/dist/hooks/useTheme.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ declare function applyThemePrefs(p: {
|
|
|
67
67
|
}): void;
|
|
68
68
|
declare function useTheme(): {
|
|
69
69
|
theme: Theme;
|
|
70
|
-
resolved: "
|
|
70
|
+
resolved: "dark" | "light" | "blue" | "green" | "grey" | "pink";
|
|
71
71
|
corners: Corners;
|
|
72
72
|
iconSet: string | null;
|
|
73
73
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -215,7 +215,7 @@ export { VERSION } from './version.js';
|
|
|
215
215
|
import { W as WindowRegistry, E as EditState } from './types-ClT92-8Z.js';
|
|
216
216
|
export { M as ModalRegistryEntry, P as PageRegistryEntry, a as WindowRegistryEntry, i as isEntityEntry, b as isPageEntry, s as setShellWindowRegistry } from './types-ClT92-8Z.js';
|
|
217
217
|
import * as react from 'react';
|
|
218
|
-
import react__default, { ReactNode, Component, ErrorInfo, Dispatch, SetStateAction, RefObject,
|
|
218
|
+
import react__default, { ReactNode, Component, ErrorInfo, Dispatch, SetStateAction, RefObject, useLayoutEffect } from 'react';
|
|
219
219
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
220
220
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
221
221
|
import { AxiosInstance } from 'axios';
|
|
@@ -772,7 +772,7 @@ declare class WindowErrorBoundary extends Component<WindowErrorBoundaryProps, {
|
|
|
772
772
|
};
|
|
773
773
|
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
774
774
|
reset: () => void;
|
|
775
|
-
render(): string | number | boolean |
|
|
775
|
+
render(): string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
776
776
|
}
|
|
777
777
|
|
|
778
778
|
declare function ShortcutHelp(): react_jsx_runtime.JSX.Element;
|
|
@@ -2715,7 +2715,7 @@ declare function useModalDuplicate(callback: (() => void) | null): void;
|
|
|
2715
2715
|
* `useLayoutEffect` it meets, once per component per render. Chosen at module
|
|
2716
2716
|
* scope, so the hook order is the same on every render either way.
|
|
2717
2717
|
*/
|
|
2718
|
-
declare const useBrowserLayoutEffect: typeof
|
|
2718
|
+
declare const useBrowserLayoutEffect: typeof useLayoutEffect;
|
|
2719
2719
|
|
|
2720
2720
|
/**
|
|
2721
2721
|
* Undo/redo for one open form — the pure half.
|