efficient-shell 8.15.0 → 8.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-XELHJME5.js → Browser-QBOH7J6X.js} +10 -10
- package/dist/{Calculator-NPBOUICN.js → Calculator-KKB7EFVO.js} +22 -22
- package/dist/{CurrencyConverter-NTJJAE7V.js → CurrencyConverter-QTFV2RSB.js} +5 -5
- package/dist/{Documents-AVAYAW4T.js → Documents-7TUZDRPO.js} +9 -9
- package/dist/{Files-KZWWBH6Q.js → Files-4KRJX4CJ.js} +5 -5
- package/dist/{Notepad-FJELN7GD.js → Notepad-GBSYEVOZ.js} +10 -10
- package/dist/{PomodoroTimer-LBB7U6QS.js → PomodoroTimer-23O2CBIZ.js} +5 -5
- package/dist/{Preview-ILPASIEM.js → Preview-WEWO3FSN.js} +22 -22
- package/dist/{Spreadsheet-J62PVFXA.js → Spreadsheet-SDDJ3EBT.js} +13 -13
- package/dist/{Stock-NBXKAAIF.js → Stock-AQ2SJRU6.js} +3 -3
- package/dist/{Weather-M7NGMQFP.js → Weather-UHCDMFZE.js} +14 -14
- package/dist/{WorldClock-YQQJXAUG.js → WorldClock-TB3HCUIH.js} +5 -5
- package/dist/ai/index.d.ts +57 -2
- package/dist/ai/index.js +20 -19
- package/dist/ai.css +1 -1
- 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/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-ZKVWQY4V.js → chunk-2HLS7AGL.js} +1 -1
- package/dist/chunk-3WV3CMSU.js +1 -0
- package/dist/{chunk-5PYRVXWN.js → chunk-4MHHPESC.js} +1 -1
- package/dist/{chunk-FEIVDR4M.js → chunk-7GU3LUMW.js} +6 -6
- package/dist/{chunk-3VCAQ72C.js → chunk-B4LK7WL6.js} +2 -2
- package/dist/{chunk-RPAKTBQT.js → chunk-BGVN7HOZ.js} +2 -2
- package/dist/{chunk-LATFMUX6.js → chunk-CXDJXNPZ.js} +1 -1
- package/dist/{chunk-OFXGSEYD.js → chunk-EDYCBXWD.js} +4 -4
- package/dist/{chunk-UCMPHYBP.js → chunk-LPYFS4RV.js} +14 -14
- package/dist/{chunk-VQUMEECM.js → chunk-LRM5XTDF.js} +2 -2
- package/dist/{chunk-XNIMCECI.js → chunk-MNWYPP3F.js} +1 -1
- package/dist/{chunk-FPI7WBMU.js → chunk-PPSIMRJM.js} +4 -4
- package/dist/{chunk-3MZTDNAW.js → chunk-QQVLFDX6.js} +4 -4
- package/dist/{chunk-VCEARTZR.js → chunk-UWHGJTAL.js} +5 -5
- package/dist/{chunk-3WUR24KP.js → chunk-VR5GVM3A.js} +26 -26
- package/dist/{chunk-JM2XJJRB.js → chunk-XMGXVMVS.js} +5 -5
- package/dist/chunk-YEY6YPTM.js +2 -0
- package/dist/index.js +87 -87
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ES4HIX3L.js +0 -2
- package/dist/chunk-YHYL2WSG.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-P5BOTIJU.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-P5BOTIJU.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{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-OVNRVFWS.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:N,xDomain:$,yDomain:j,xScale:w="linear",yScale:R="linear",radiusRange:S=[4,22],className:U,emptyLabel:D}){const L=m().charts,O=h(),P=z??(e=>f(e,O)),V=N??(e=>f(e,O)),W=D??L.noObservations,B=u(null),C=n(B),E=v??C,F=p(),[I,T]=d(null);x(()=>{if(null!==I)return c(e=>"Escape"===e.key&&(T(null),!0))},[I]);const J=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),Q=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),X=$||j?Q.map(e=>({...e,points:e.points.filter(e=>J(e.x,$)&&J(e.y,j))})).filter(e=>e.points.length>0):Q,Z=Q.reduce((e,t)=>e+t.points.length,0)-X.reduce((e,t)=>e+t.points.length,0);if(0===X.length)/* @__PURE__ */
|
|
2
2
|
return y("div",{className:U,ref:B,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:W})});const H=X.flatMap(e=>e.points),K=H.some(e=>null!=e.size),Y=14,q=20,G=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(H.map(e=>e.y),j,R,{from:k-G,to:Y}),ie=t(te.ticks(5).map(V),_),le=Math.max(ie+1,E-q),re=ee(H.map(e=>e.x),$,w,{from:ie,to:le}),oe=i([0,Math.max(...H.map(e=>e.size??1))],{from:S[0],to:S[1]}),ne=I?X[I.s]:void 0,ae=I&&ne?ne.points[I.i]:void 0,se=X.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
3
|
return g("div",{className:`relative ${U??""}`,ref:B,children:[
|
|
4
4
|
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${E} ${k}`,role:"img","aria-label":L.scatter(X.map(e=>e.label),A??L.yAxis,M??L.xAxis)+(Z>0?`. ${L.outsideRange(Z)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>T(null),onBlur:()=>T(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=I?se.findIndex(e=>e.s===I.s&&e.i===I.i):0;T(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
5
|
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:F,children:/* @__PURE__ */y("rect",{x:ie-S[1],y:Y-S[1],width:le-ie+2*S[1],height:k-G-Y+2*S[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(#${F})`,children:X.map((e,t)=>{const i=
|
|
6
|
+
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
+
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:V(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.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:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
|
|
8
|
+
/* @__PURE__ */y("g",{clipPath:`url(#${F})`,children:X.map((e,t)=>{const i=s(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:K?oe(l.size??0):S[0]+1,fill:i,fillOpacity:I&&I.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>T({s:t,i:r})},`${e.key}-${r}`))})})]}),I&&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??L.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.x)},{key:"y",label:A??L.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:V(ae.y)},...null!=ae.size?[{key:"size",label:L.size,color:a.muted,value:f(ae.size,O)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return E("div",{className:yt,ref:Vt,children:/* @__PURE__ */E(
|
|
3
|
-
return E("div",{className:yt,ref:Vt,children:/* @__PURE__ */E("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:K},children:jt})});const Tt=J.map((t,e)=>Ft.reduce((t,a)=>t+(P(a.data[e])?a.data[e]:0),0)),Bt=(t,e)=>Tt[e]>0?t/Tt[e]:null,Ot=[];if(Q){let t=J.map(()=>0);for(const e of Ft)t=t.map((t,a)=>t+(P(e.data[a])?e.data[a]:0)),Ot.push("percent"===G?t.map((t,e)=>Bt(t,e)):[...t])}const Pt=!!H&&H.length>0,Yt=t=>"right"===t.axis,Jt=!Q&&!Pt&&void 0===q&&Ft.some(Yt)&&Ft.some(t=>!Yt(t)),Kt=Jt?Ft.filter(t=>!Yt(t)):Ft,Qt=Jt?Ft.filter(Yt).flatMap(t=>t.data.filter(P)):[],Gt=Q?(Ot.at(-1)??[]).filter(P):Kt.flatMap(t=>t.data.filter(P)),Ht=Jt?
|
|
1
|
+
import{ChartBrush as t}from"./chunk-TWWJLFTD.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as l,areaFrom as n}from"./chunk-VFC6QUEN.js";import{ChartDefs as i,MOTION as o,stagger as s,fillFor as c,dashFor as h,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as d}from"./chunk-EVKBV6IV.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{ChartTooltip as p}from"./chunk-P5BOTIJU.js";import{tooltipBesideBand as g}from"./chunk-MG7A3R75.js";import{pairedAxes as k,niceAxis as y,niceMax as x,linearScale as v,axisGutter as b,bandScale as M,ladderScale as N}from"./chunk-2JWPNR2U.js";import{usePlotWidth as j}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as V,CHART_INK as $,STATUS_VARS as w}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as W}from"./chunk-TWVUQUUD.js";import{useShellStrings as A,useShellLocale as R}from"./chunk-OVNRVFWS.js";import{formatPercent as L,formatPlain as z}from"./chunk-C3QOHMR6.js";import{useRef as C,useState as S,useId as U,useEffect as D}from"react";import{jsx as E,jsxs as I}from"react/jsx-runtime";var F=12,T=16,B=26,O=52,P=t=>"number"==typeof t&&Number.isFinite(t);function Y({series:Y,labels:J,height:K=200,stacked:Q=!1,stackMode:G="value",levels:H,curve:Z="linear",tension:X=0,max:q,yTickCount:_=4,formatValue:tt,formatTooltipValue:et,tooltipLabels:at,yAxisLabel:rt,referenceLines:lt,labelEndpoints:nt=!1,dots:it,dotVariant:ot="border",pulse:st=!1,brush:ct=!1,range:ht,onRangeChange:mt,loading:dt=!1,animate:ut=!0,reveal:ft="left-to-right",fillVariant:pt="gradient",gridStyle:gt="solid",width:kt,className:yt,emptyLabel:xt}){const vt=A().charts,bt=R(),Mt=tt??(t=>z(t,bt)),Nt=et??Mt,jt=xt??vt.noData,Vt=C(null),$t=j(Vt),wt=kt??$t,[Wt,At]=S(null),[Rt,Lt]=S(null),{highlighted:zt}=u(),Ct=U();if(D(()=>{if(null!==Wt)return W(t=>"Escape"===t.key&&(At(null),!0))},[Wt]),dt)/* @__PURE__ */
|
|
2
|
+
return E("div",{className:yt,ref:Vt,children:/* @__PURE__ */E(d,{height:K,width:kt??$t})});const St=J,Ut=ht??Rt??[0,Math.max(0,St.length-1)],[Dt,Et]=Ut,It=t=>ct?t.slice(Dt,Et+1):t,Ft=Y.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(P)).map(t=>({...t,data:It(t.data)}));if(J=It(St),0===Ft.length||0===J.length)/* @__PURE__ */
|
|
3
|
+
return E("div",{className:yt,ref:Vt,children:/* @__PURE__ */E("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:K},children:jt})});const Tt=J.map((t,e)=>Ft.reduce((t,a)=>t+(P(a.data[e])?a.data[e]:0),0)),Bt=(t,e)=>Tt[e]>0?t/Tt[e]:null,Ot=[];if(Q){let t=J.map(()=>0);for(const e of Ft)t=t.map((t,a)=>t+(P(e.data[a])?e.data[a]:0)),Ot.push("percent"===G?t.map((t,e)=>Bt(t,e)):[...t])}const Pt=!!H&&H.length>0,Yt=t=>"right"===t.axis,Jt=!Q&&!Pt&&void 0===q&&Ft.some(Yt)&&Ft.some(t=>!Yt(t)),Kt=Jt?Ft.filter(t=>!Yt(t)):Ft,Qt=Jt?Ft.filter(Yt).flatMap(t=>t.data.filter(P)):[],Gt=Q?(Ot.at(-1)??[]).filter(P):Kt.flatMap(t=>t.data.filter(P)),Ht=Jt?k([Math.min(0,...Gt),Math.max(0,...Gt)],[Math.min(0,...Qt),Math.max(0,...Qt)],{intervals:_+1,integerLeft:Gt.every(Number.isInteger),integerRight:Qt.every(Number.isInteger)}):null,Zt=Ht?Ht.left:Q&&"percent"===G||Pt||void 0!==q?null:y(Q?0:Math.min(0,...Gt),Math.max(0,...Gt),{intervals:_+1,integer:Gt.every(Number.isInteger)}),Xt=Zt?Zt.lo:0,qt=Q&&"percent"===G?1:Zt?Zt.hi:q??x(Math.max(...Gt,0)),_t=Q&&"percent"===G?t=>L(Math.round(100*t),0,bt):Mt,te=Pt?H:Zt?Zt.ticks:v([Xt,qt],{from:0,to:1}).ticks(_+1),ee=b(te.map(_t),O),ae=Ht?b(Ht.right.ticks.map(Mt),T):T,re={left:ee,right:Math.max(ee+1,wt-ae),top:F,bottom:K-B},le=M(J.length,{from:re.left,to:re.right}),ne=Pt?N(H,{from:re.bottom,to:re.top}):null,ie=v([Xt,qt],{from:re.bottom,to:re.top}),oe=ie(Math.max(Xt,0)),se=t=>ne?ne(t):ie(t),ce=Ht?v([Ht.right.lo,Ht.right.hi],{from:re.bottom,to:re.top}):null,he=t=>ce&&Yt(t)?ce:se,me=ne?ne.levels.map(t=>({value:t,y:ne(t)})):te.map(t=>({value:t,y:ie(t)})),de=t=>e=>{e.preventDefault(),At(e=>{const a=(e??0)+t;return Math.min(J.length-1,Math.max(0,a))})},ue=Math.max(1,Math.ceil(J.length/Math.max(1,Math.floor(wt/96))));/* @__PURE__ */
|
|
4
4
|
return I("div",{className:`relative ${yt??""}`,ref:Vt,children:[
|
|
5
5
|
/* @__PURE__ */I("svg",{width:"100%",height:K,viewBox:`0 0 ${wt} ${K}`,role:"img","aria-label":vt.overIntervals(Ft.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:()=>At(null),onBlur:()=>At(null),onKeyDown:t=>{"ArrowRight"===t.key&&de(1)(t),"ArrowLeft"===t.key&&de(-1)(t)},children:[
|
|
6
6
|
/* @__PURE__ */E("defs",{children:/* @__PURE__ */E("clipPath",{id:Ct,children:/* @__PURE__ */E("rect",{x:re.left,y:re.top,width:re.right-re.left,height:re.bottom-re.top})})}),
|
|
7
|
-
/* @__PURE__ */E(
|
|
8
|
-
/* @__PURE__ */E("line",{x1:re.left,y1:oe,x2:re.right,y2:oe,stroke
|
|
9
|
-
/* @__PURE__ */E("g",{clipPath:`url(#${Ct})`,mask:ut&&ft?`url(#${
|
|
10
|
-
return E("path",{d:e
|
|
11
|
-
return E("g",{opacity:d??void 0,className:"rosh-viz-mark",children:J.map((
|
|
12
|
-
return E("rect",{x:le.center(
|
|
7
|
+
/* @__PURE__ */E(i,{id:Ct,fills:Ft.map((t,e)=>({color:V(t.slot,t.color,t.tone),variant:t.fillVariant??pt})),fadeFrom:Q?.42:.3,reveal:!!ut&&ft}),me.map(t=>/* @__PURE__ */E("line",{x1:re.left,y1:t.y,x2:re.right,y2:t.y,stroke:$.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===gt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
+
/* @__PURE__ */E("line",{x1:re.left,y1:oe,x2:re.right,y2:oe,stroke:$.axis,strokeWidth:1,shapeRendering:"crispEdges"}),me.map(t=>/* @__PURE__ */E("text",{x:re.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:$.label,style:{fontVariantNumeric:"tabular-nums"},children:_t(t.value)},`ytick-${t.value}`)),Ht&&me.map((t,e)=>/* @__PURE__ */E("text",{x:re.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:$.label,style:{fontVariantNumeric:"tabular-nums"},children:Mt(Ht.right.ticks[e])},`ytick-r-${t.value}`)),rt&&/* @__PURE__ */E("text",{x:12,y:(re.top+re.bottom)/2,transform:`rotate(-90 12 ${(re.top+re.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:$.label,children:rt}),
|
|
9
|
+
/* @__PURE__ */E("g",{clipPath:`url(#${Ct})`,mask:ut&&ft?`url(#${m(Ct)})`:void 0,children:Ft.map((t,e)=>{const i=V(t.slot,t.color,t.tone),m=t.mode??(Q?"area":"line"),d=f(t.key,zt);if("step"===m){const e=J.map((e,a)=>({start:le(a),end:le.end(a),value:t.data[a]})).filter(t=>P(t.value)).map(e=>({start:e.start,end:e.end,y:he(t)(e.value)}));/* @__PURE__ */
|
|
10
|
+
return E("path",{d:a(e),fill:"none",stroke:i,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:d??void 0,className:"rosh-viz-mark"},t.key)}const u=J.map((a,r)=>{const l=Q?Ot[e]?.[r]:t.data[r];return P(l)?[le.center(r),he(t)(l)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*le.bandwidth),r="solid"===t.fillVariant,l=he(t);/* @__PURE__ */
|
|
11
|
+
return E("g",{opacity:d??void 0,className:"rosh-viz-mark",children:J.map((n,c)=>{const h=Q?Ot[e]?.[c]:t.data[c];if(!P(h))return null;const m=l(h);/* @__PURE__ */
|
|
12
|
+
return E("rect",{x:le.center(c)-a/2,y:Math.min(m,oe),width:a,height:Math.abs(oe-m),rx:2,fill:i,fillOpacity:r?1:.35,className:ut?o.rise:void 0,style:ut?s(c,26):void 0},c)})},t.key)}const p=r(u,Z,X),g=Q&&e>0?J.map((t,a)=>[le.center(a),se(Ot[e-1]?.[a]??0)-2]):null,k=g?l(p,g):n(p,u,oe);/* @__PURE__ */
|
|
13
13
|
return I("g",{opacity:d??void 0,className:"rosh-viz-mark",children:[("area"===m||Q)&&
|
|
14
|
-
/* @__PURE__ */E("path",{d:k,fill:
|
|
15
|
-
/* @__PURE__ */E("path",{d:p,fill:"none",stroke:
|
|
14
|
+
/* @__PURE__ */E("path",{d:k,fill:c(Ct,e,t.fillVariant??pt,i),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */E("path",{d:p,fill:"none",stroke:i,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:h(t.stroke??(t.forecast?"animated-dashed":"solid")),className:ut&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?o.march:void 0})]},t.key)})}),lt?.map((t,e)=>{const a=t.color??w[t.tone??"critical"],r=se(t.value);/* @__PURE__ */
|
|
16
16
|
return I("g",{children:[
|
|
17
|
-
/* @__PURE__ */E("line",{x1:re.left,y1:r,x2:re.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */E("text",{x:re.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(it??(nt?"last":"none"))&&Ft.map((
|
|
18
|
-
return I("g",{children:[i.map(r=>{const i=Q?Ot[a]?.[r]:
|
|
19
|
-
/* @__PURE__ */E("div",{className:"pointer-events-none absolute top-2 z-10",style:
|
|
17
|
+
/* @__PURE__ */E("line",{x1:re.left,y1:r,x2:re.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */E("text",{x:re.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(it??(nt?"last":"none"))&&Ft.map((t,a)=>{if("column"===t.mode)return null;const r=it??(nt?"last":"none"),l=V(t.slot,t.color,t.tone),n=[...t.data].map(P).lastIndexOf(!0),i="all"===r?J.map((t,e)=>e).filter(e=>P(Q?Ot[a]?.[e]:t.data[e])):n>=0?[n]:[];/* @__PURE__ */
|
|
18
|
+
return I("g",{children:[i.map(r=>{const i=Q?Ot[a]?.[r]:t.data[r];return P(i)?/* @__PURE__ */E(e,{cx:le.center(r),cy:he(t)(i),color:l,variant:ot,pulse:st&&r===n,title:`${J[r]}: ${t.label} ${Mt(i)}`},r):null}),nt&&n>=0&&P(Q?Ot[a]?.[n]:t.data[n])&&/* @__PURE__ */E("text",{x:le.center(n)-10,y:he(t)(Q?Ot[a]?.[n]:t.data[n])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:$.label,style:{fontVariantNumeric:"tabular-nums"},children:Mt(Q?Ot[a]?.[n]:t.data[n])})]},`dots-${t.key}`)}),J.map((t,e)=>e%ue===0?/* @__PURE__ */E("text",{x:le.center(e),y:K-8,textAnchor:"middle",fontSize:11,fill:$.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Wt&&/* @__PURE__ */E("line",{x1:le.center(Wt),y1:re.top,x2:le.center(Wt),y2:re.bottom,stroke:$.axis,strokeWidth:1}),J.map((t,e)=>/* @__PURE__ */E("rect",{x:le(e),y:re.top,width:Math.max(1,le.bandwidth),height:re.bottom-re.top,fill:"transparent",onMouseEnter:()=>At(e)},`hit-${e}`))]}),ct&&St.length>2&&/* @__PURE__ */E(t,{className:"mt-1",labels:St,width:wt,data:Y[0]?.data??[],range:Ut,onRangeChange:t=>{mt?mt(t):Lt(t)}}),null!==Wt&&
|
|
19
|
+
/* @__PURE__ */E("div",{className:"pointer-events-none absolute top-2 z-10",style:g(le.center(Wt),le.bandwidth,wt),children:/* @__PURE__ */E(p,{title:at?.[Wt]??J[Wt],rows:Ft.map((t,e)=>({key:t.key,label:t.label,color:V(t.slot,t.color,t.tone),value:P(t.data[Wt])?Q&&"percent"===G?`${L(100*(Bt(t.data[Wt],Wt)??0),1,bt)} · ${Nt(t.data[Wt])}`:Nt(t.data[Wt]):void 0})),footnote:Q&&"percent"===G?vt.inBucket(Nt(Tt[Wt])):void 0})})]})}export{Y as TimeSeriesChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-VR5GVM3A.js";import{navIcons as r}from"./chunk-TPDOOCFS.js";import{VERSION as s}from"./chunk-3WV3CMSU.js";import{Icon as o}from"./chunk-VJPJNCB4.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as i,splitAround as a}from"./chunk-OVNRVFWS.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var u=n.aboutApp,f={spreadsheet:{name:"Spreadsheets",version:"1.1.3",route:"/spreadsheet",description:u.spreadsheet},notepad:{name:"Notepad",version:"1.0.2",route:"/notepad",description:u.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:u.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:u.preview},files:{name:"Files",version:"1.1.3",route:"/files",description:u.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:u.browser}},x=/* @__PURE__ */p(o,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(o,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:o}){const n=f[o],[u,w]=m(!1),N=c(()=>w(!0),[]),g=i().aboutApp,b=g.title(n.name);if(e(b,N,x),!u)return null;const y=r[n.route],k=l(y)?d(y,{className:"h-9 w-9"}):v,[j,V]=a(g.partOf);/* @__PURE__ */
|
|
2
2
|
return p(t,{open:!0,onClose:()=>w(!1),title:b,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:k}),
|
|
4
4
|
/* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:n.name}),
|
|
@@ -6,4 +6,4 @@ return p(t,{open:!0,onClose:()=>w(!1),title:b,size:"sm",compact:!0,bodyScroll:!1
|
|
|
6
6
|
/* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:g[o]}),
|
|
7
7
|
/* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */h("p",{className:"text-2xs text-gray-500",children:[j,
|
|
9
|
-
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),V]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-gray-400",children:g.shellVersion(s)})]})]})})}export{w as AboutApp,f as BUILTIN_APP_INFO};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-VR5GVM3A.js";import{keepsNativeMenu as a}from"./chunk-GZCAFWWB.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{tooltipBesideBand as t}from"./chunk-MG7A3R75.js";import{niceAxis as e,niceMax as i,linearScale as r,axisGutter as n,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{
|
|
1
|
+
import{tooltipBesideBand as t}from"./chunk-MG7A3R75.js";import{niceAxis as e,niceMax as i,linearScale as r,axisGutter as n,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-OVNRVFWS.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useRef as d,useState as u,useId as f,useEffect as x}from"react";import{jsx as g,jsxs as p}from"react/jsx-runtime";function y({labels:y,values:v,height:b=220,width:k,bandPadding:M=.24,min:N,max:w,yTickCount:A=4,formatValue:$,yAxisLabel:j,xTickAnchor:R="center",children:E,overlay:U,tooltip:V,onSelect:z,ariaLabel:C,className:D,emptyLabel:F}){const L=s().charts,P=c(),S=$??(t=>m(t,P)),W=F??L.noData,I=d(null),T=o(I),B=k??T,[O,Q]=u(null),Z=f();if(x(()=>{if(null!==O)return h(t=>"Escape"===t.key&&(Q(null),!0))},[O]),0===y.length||!v.some(Number.isFinite))/* @__PURE__ */
|
|
2
2
|
return g("div",{className:D,ref:I,children:/* @__PURE__ */g("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:b},children:W})});const G=v.filter(Number.isFinite),H=G.every(Number.isInteger),J=void 0===N&&void 0===w?e(Math.min(0,...G),Math.max(0,...G),{intervals:A+1,integer:H}):null,K=void 0!==N&&void 0===w?e(N,Math.max(N,...G),{intervals:A+1,integer:H,zero:!1}):null,X=J?J.lo:N??Math.min(0,...G),q=J?J.hi:K?K.hi:w??i(Math.max(...G,0)),Y=J?J.ticks:K?[X,...K.ticks.filter(t=>t>X)]:r([X,q],{from:0,to:1}).ticks(A+1),_={top:12,right:16,bottom:26,left:n(Y.map(S),48)+(j?10:0)},tt=_.left,et=Math.max(tt+1,B-_.right),it=_.top,rt=b-_.bottom,nt=r([X,q],{from:rt,to:it}),lt=l(y.length,{from:tt,to:et},M),ot=(et-tt)/Math.max(1,y.length),at=ot>=48,ht=at?1:Math.max(1,Math.ceil(y.length/Math.max(1,Math.floor(B/84)))),st=Math.max(2,Math.floor((ot-6)/6.6)),ct=t=>at&&t.length>st?`${t.slice(0,st-1).trimEnd()}…`:t;/* @__PURE__ */
|
|
3
3
|
return p("div",{className:`relative ${D??""}`,ref:I,children:[
|
|
4
4
|
/* @__PURE__ */p("svg",{width:"100%",height:b,viewBox:`0 0 ${B} ${b}`,role:"img","aria-label":C,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Q(null),onBlur:()=>Q(null),onKeyDown:t=>{if(z&&null!==O&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void z(O);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const e="ArrowRight"===t.key?1:-1;Q(t=>Math.min(y.length-1,Math.max(0,(t??0)+e)))},children:[
|
|
5
|
-
/* @__PURE__ */g("defs",{children:/* @__PURE__ */g("clipPath",{id:Z,children:/* @__PURE__ */g("rect",{x:tt,y:it,width:et-tt,height:rt-it})})}),Y.map(t=>/* @__PURE__ */g("line",{x1:tt,y1:nt(t),x2:et,y2:nt(t),stroke:
|
|
6
|
-
/* @__PURE__ */g("line",{x1:tt,y1:nt(Math.max(X,0)),x2:et,y2:nt(Math.max(X,0)),stroke:
|
|
7
|
-
/* @__PURE__ */g("g",{clipPath:`url(#${Z})`,children:E({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Z,active:O})}),U?.({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Z,active:O}),y.map((t,e)=>e%ht===0?/* @__PURE__ */g("text",{x:"start"===R?lt(e):lt.center(e),y:b-8,textAnchor:"middle",fontSize:11,fill:
|
|
5
|
+
/* @__PURE__ */g("defs",{children:/* @__PURE__ */g("clipPath",{id:Z,children:/* @__PURE__ */g("rect",{x:tt,y:it,width:et-tt,height:rt-it})})}),Y.map(t=>/* @__PURE__ */g("line",{x1:tt,y1:nt(t),x2:et,y2:nt(t),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${t}`)),
|
|
6
|
+
/* @__PURE__ */g("line",{x1:tt,y1:nt(Math.max(X,0)),x2:et,y2:nt(Math.max(X,0)),stroke:a.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Y.map(t=>/* @__PURE__ */g("text",{x:tt-8,y:nt(t)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:S(t)},`t${t}`)),j&&/* @__PURE__ */g("text",{x:14,y:(it+rt)/2,transform:`rotate(-90 14 ${(it+rt)/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:j}),
|
|
7
|
+
/* @__PURE__ */g("g",{clipPath:`url(#${Z})`,children:E({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Z,active:O})}),U?.({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Z,active:O}),y.map((t,e)=>e%ht===0?/* @__PURE__ */g("text",{x:"start"===R?lt(e):lt.center(e),y:b-8,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:ct(t)},`x${e}`):null),y.map((t,e)=>/* @__PURE__ */g("rect",{x:lt.center(e)-(et-tt)/y.length/2,y:it,width:(et-tt)/y.length,height:rt-it,fill:"transparent",onMouseEnter:()=>Q(e),onClick:z?()=>z(e):void 0,style:z?{cursor:"pointer"}:void 0},`h${e}`))]}),V&&null!==O&&
|
|
8
8
|
/* @__PURE__ */g("div",{className:"pointer-events-none absolute top-2 z-10",style:t(lt.center(O),lt.bandwidth,B),children:V(O)})]})}export{y as CartesianPlot};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{CartesianPlot as a}from"./chunk-
|
|
2
|
-
return i(a,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(
|
|
3
|
-
return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&
|
|
4
|
-
/* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{CartesianPlot as a}from"./chunk-PPSIMRJM.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-OVNRVFWS.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let M=0;const k=c.map(t=>{if(t.total){const a={from:0,to:M,value:M,total:!0};return{...t,...a}}const a=M;return M+=t.value,{...t,from:a,to:M,value:t.value,total:!1}}),j=k.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
|
|
2
|
+
return i(a,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(k[0]?.from??0),y(M)),tooltip:a=>{const e=k[a],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
|
|
3
|
+
return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&k.slice(0,-1).map((l,o)=>
|
|
4
|
+
/* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),k.map((e,r)=>{const n=e.total?l.neutral:e.value>=0?l.good:l.critical,s=Math.min(a(e.from),a(e.to)),c=Math.max(1,Math.abs(a(e.to)-a(e.from)));/* @__PURE__ */
|
|
5
5
|
return i("rect",{x:t(r),y:s,width:Math.max(1,t.bandwidth),height:c,rx:b,fill:n,fillOpacity:null===o||o===r?1:.45},r)})]})})}export{c as WaterfallChart};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{ChartDefs as t,MOTION as e,stagger as a,glowId as n}from"./chunk-465RRWBY.js";import{ChartSkeleton as i}from"./chunk-EVKBV6IV.js";import{useHighlight as r,autoHighlightIndex as l,highlightOpacity as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as m}from"./chunk-P5BOTIJU.js";import{CartesianPlot as s}from"./chunk-
|
|
1
|
+
import{ChartDefs as t,MOTION as e,stagger as a,glowId as n}from"./chunk-465RRWBY.js";import{ChartSkeleton as i}from"./chunk-EVKBV6IV.js";import{useHighlight as r,autoHighlightIndex as l,highlightOpacity as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as m}from"./chunk-P5BOTIJU.js";import{CartesianPlot as s}from"./chunk-PPSIMRJM.js";import{CHART_INK as u,STATUS_VARS as h,resolveSeriesColor as c}from"./chunk-TZFACUMR.js";import{useShellStrings as d,useShellLocale as f}from"./chunk-OVNRVFWS.js";import{formatPercent as b,formatPlain as p}from"./chunk-C3QOHMR6.js";import{useId as x}from"react";import{jsx as y,jsxs as M}from"react/jsx-runtime";function g({series:g,labels:v,stacked:k=!1,stackMode:N="value",height:$=220,width:w,max:F,formatValue:V,yAxisLabel:j,className:L,emptyLabel:A,radius:S=3,loading:C=!1,animate:R=!0,glow:O=!1,emphasise:z=!1,activeKey:B,highlight:E="none",valueLabels:T=!1,onSelect:I,min:P,formatTooltipValue:W,tooltipLabels:Y,barGap:H=4,seriesLabels:J=!1}){const K=x(),{highlighted:U}=r(),G=d().charts,Q=f(),Z=V??(t=>p(t,Q)),q=W??Z;if(C)/* @__PURE__ */return y(i,{height:$,width:w,variant:"bars",className:L});const D=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const n=t.pointTones?.[e];return n?h[n]:c(t.slot,t.color,t.tone)},X=g.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),_=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},tt=v.map((t,e)=>X.reduce((t,a)=>t+_(a,e),0)),et=v.map((t,e)=>X.reduce((t,a)=>t+Math.max(0,_(a,e)),0)),at=v.map((t,e)=>X.reduce((t,a)=>t+Math.min(0,_(a,e)),0)),nt=k&&"percent"===N,it=(t,e)=>tt[e]>0?t/tt[e]:null,rt=nt?[1]:k?[...et,...at]:X.flatMap(t=>t.data.filter(Number.isFinite)),lt=(t,e)=>{const a=t.bandwidth/Math.max(1,X.length),n=X.length>1?Math.min(H,.25*a):0;return{offset:e*a+n/2,width:Math.max(1,a-n)}},ot=J&&!k?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return v.map((n,i)=>X.map((n,r)=>{const l=n.data[i];if(!Number.isFinite(l))return null;const o=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:m,width:s}=lt(t,r),h=t(i)+m+s/2,c=Math.min(e(o),e(a)),d=Math.max(e(o),e(a));if(s<13)return null;const f=Math.floor((d-c-12)/6.6),b=f>=Math.min(4,n.label.length),p=b&&n.label.length>f?`${n.label.slice(0,f-1).trimEnd()}…`:n.label,x=b?d-6:c-4;/* @__PURE__ */
|
|
2
2
|
return y("text",{"data-series-label":"true",x:h,y:x,transform:`rotate(-90 ${h} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:b?u.surface:u.label,children:p},`n${n.key}-${i}`)}))}:null;/* @__PURE__ */
|
|
3
|
-
return y(s,{labels:v,values:rt,height:$,width:w,max:nt?1:F,min:nt?void 0:
|
|
3
|
+
return y(s,{labels:v,values:rt,height:$,width:w,max:nt?1:F,min:nt?void 0:P,formatValue:nt?t=>b(Math.round(100*t),0,Q):Z,yAxisLabel:j,className:L,emptyLabel:A,onSelect:I,ariaLabel:G.acrossCategories(X.map(t=>t.label),v.length),tooltip:t=>/* @__PURE__ */y(m,{title:Y?.[t]??v[t],rows:X.map(e=>({key:e.key,label:e.label,color:D(e,t),value:Number.isFinite(e.data[t])?nt?`${b(100*(it(e.data[t],t)??0),1,Q)} · ${q(e.data[t])}`:q(e.data[t]):void 0})),footnote:nt?G.inCategory(q(tt[t])):void 0}),overlay:T&&!nt||ot?({x:t,y:e})=>/* @__PURE__ */M("g",{pointerEvents:"none",children:[ot?.({x:t,y:e}),T&&!nt&&v.map((a,n)=>{if(k){if(!X.some(t=>Number.isFinite(t.data[n])))return null;const a=X.reduce((t,e)=>t+_(e,n),0),i=a>=0?et[n]:at[n];/* @__PURE__ */
|
|
4
4
|
return y("text",{"data-value-label":"true",x:t.center(n),y:a>=0?e(i)-4:e(i)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Z(a)},`v${n}`)}return X.map((a,i)=>{const r=a.data[n];if(!Number.isFinite(r))return null;const l=r,{offset:o,width:m}=lt(t,i);/* @__PURE__ */
|
|
5
|
-
return y("text",{"data-value-label":"true",x:t(n)+o+m/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Z(l)},`v${a.key}-${n}`)})})]}):void 0,children:({x:i,y:r,bottom:m,active:s})=>{const h=
|
|
5
|
+
return y("text",{"data-value-label":"true",x:t(n)+o+m/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Z(l)},`v${a.key}-${n}`)})})]}):void 0,children:({x:i,y:r,bottom:m,active:s})=>{const h=B?v.indexOf(B):-1,c=l(k?tt:X[0]?.data??[],E),d=s??(h>=0?h:c);/* @__PURE__ */
|
|
6
6
|
return M("g",{children:[
|
|
7
|
-
/* @__PURE__ */y(t,{id:
|
|
8
|
-
return y("rect",{x:M,y:v,width:g,height:w,rx:
|
|
7
|
+
/* @__PURE__ */y(t,{id:K,glow:O}),v.map((t,l)=>{let m=0,s=0;const h=r(Math.min(r.domain[1],Math.max(r.domain[0],0)));return X.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const b=nt?it(f,l):f;if(null===b)return null;const p=D(t,l),x=lt(i,c),M=k?i(l):i(l)+x.offset,g=k?Math.max(1,i.bandwidth):x.width;let v,N,$=!0;if(k){const t=b>=0?m:s,e=t+b;b>=0?m=e:s=e,v=r(Math.max(t,e)),N=r(Math.min(t,e)),$=0===t}else v=Math.min(r(b),h),N=Math.max(r(b),h);const w=Math.max(0,N-v-(k&&!$?2:0)),F=null===d||d===l,V=F?p:z?u.muted:p,j=o(t.key,U);/* @__PURE__ */
|
|
8
|
+
return y("rect",{x:M,y:v,width:g,height:w,rx:S,fill:V,fillOpacity:j??(F?1:z?.32:.45),filter:O&&d===l?`url(#${n(K)})`:void 0,className:"rosh-viz-mark"+(R?` ${e.rise}`:""),style:R?a(l*(k?1:X.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==s&&!z&&/* @__PURE__ */y("line",{x1:i.center(s),y1:r(r.domain[1]),x2:i.center(s),y2:m,stroke:u.axis,strokeWidth:1})]})}})}export{g as ColumnChart};
|
|
@@ -46,54 +46,54 @@ return Z(Bt.Provider,{value:e,children:t})}var Ut=/* @__PURE__ */new Set(["butto
|
|
|
46
46
|
return Z("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var sn="erp_window_positions",ln={};try{const e=localStorage.getItem(sn);e&&(ln=JSON.parse(e))}catch{}var cn=null;function un(){cn&&clearTimeout(cn),cn=setTimeout(()=>{try{localStorage.setItem(sn,JSON.stringify(ln))}catch{}},500)}var dn="erp_activation_order",hn=[];try{const e=localStorage.getItem(dn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(hn=t)}catch{}var mn=null;function pn(){mn&&clearTimeout(mn),mn=setTimeout(()=>{try{localStorage.setItem(dn,JSON.stringify(hn))}catch{}},500)}function fn(e,t){ln[e]||(ln[e]=t,un())}function wn(e){return ln[e]?{...ln[e]}:null}function yn(e,t){ln[e]=t,un()}function gn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(ln))n(ln[e],r,o)&&(delete ln[e],i=!0);i&&un()}var bn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},vn=4e3,xn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},kn={small:.8,medium:1,large:1.25,maximized:1.25},En=[],Cn=/* @__PURE__ */new Set,Mn=/* @__PURE__ */new Set,Nn=0,Sn=/* @__PURE__ */new Map;var Ln=0;function Tn(){return Ln}function zn(){Ln++,Cn.forEach(e=>e())}var An=/* @__PURE__ */new Map,Dn=/* @__PURE__ */new Map,Pn=/* @__PURE__ */new Map;function In(){for(let e=En.length-1;e>=0;e--){const t=Pn.get(En[e]);if(t?.tab)return t.owner}return null}function Kn(){return q(br,In,()=>null)}var Wn=/* @__PURE__ */new Set;var Rn=null;function $n(e){Rn=null,Xn(e)}function On(e){Rn=e;const t=An.get(e);t&&$n(t)}var Fn=/* @__PURE__ */new Map;function jn(e){return Fn.get(e)?.holdsChanges()??!1}function qn(e){const t=Fn.get(e);return t?t.ask():Promise.resolve(!0)}function Bn(e){Rn===e&&(Rn=null)}function Hn(e,t,n){if(n&&Pn.set(e,n),t)if(An.set(t,e),Dn.set(e,t),Wn.delete(t)){En.unshift(e);const n=hn.indexOf(t);-1!==n&&hn.splice(n,1),hn.unshift(t),pn()}else!function(e,t){const n=hn.indexOf(t);if(-1===n)return void En.push(e);let r=En.length;for(let e=0;e<En.length;e++){const t=Dn.get(En[e]);if(t&&hn.indexOf(t)>n){r=e;break}}En.splice(r,0,e)}(e,t),-1===hn.indexOf(t)&&(hn.push(t),pn());else En.push(e);zn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Rn===t&&$n(e)}function Un(e){return e?Pn.get(e)?.owner??Dn.get(e)??null:null}var Yn=/* @__PURE__ */new Set;function Xn(e){const t=Un(gr()),n=En.indexOf(e);-1!==n&&En.splice(n,1),En.push(e);const o=Pn.get(e);if(o?.root&&o.tab&&r()){const e=En.filter(e=>{const t=Pn.get(e);return!!t&&!t.root&&t.owner===o.owner});for(const t of e)En.splice(En.indexOf(t),1),En.push(t)}Mn.delete(e);const i=Dn.get(e);if(i){const e=hn.indexOf(i);-1!==e&&hn.splice(e,1),hn.push(i),pn(),Rn&&Rn!==i&&(Rn=null)}zn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=Un(gr());a&&a!==t&&Yn.forEach(e=>e(a))}function Vn(e){const t=En.indexOf(e);-1!==t&&En.splice(t,1),Mn.add(e),Sn.set(e,++Nn);const n=Dn.get(e);if(n){const e=hn.indexOf(n);-1!==e&&(hn.splice(e,1),pn())}zn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var Jn=/* @__PURE__ */new Set;var _n=8,Gn=32;function Qn(){return e()}var Zn=u.windowBar,er=80,tr=384,nr=400;function rr(e,t=Qn()){const n=Math.min(Math.max(e.x,t.x+er-e.w),t.x+t.w-er),r=Math.min(Math.max(e.y,t.y),t.y+t.h-Zn);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function or(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=Qn();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function ir(e){const t=Qn(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var ar=null;function sr(e){const t=(ar||((ar=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${D.snapPreview}`,"border-radius: 8px","background: rgba(59, 130, 246, 0.18)","border: 2px solid rgb(59, 130, 246)","transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease","opacity: 0","display: none"].join(";"),document.body.appendChild(ar)),ar);t.style.display="block",t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.width=`${e.w}px`,t.style.height=`${e.h}px`,t.style.opacity="1"}function lr(){ar&&(ar.style.opacity="0",ar.style.display="none")}var cr=[{zone:"left",labelKey:"snapLeft",region:"inset-y-0 left-0 w-1/2"},{zone:"right",labelKey:"snapRight",region:"inset-y-0 right-0 w-1/2"},{zone:"tl",labelKey:"snapTopLeft",region:"top-0 left-0 h-1/2 w-1/2"},{zone:"tr",labelKey:"snapTopRight",region:"top-0 right-0 h-1/2 w-1/2"},{zone:"bl",labelKey:"snapBottomLeft",region:"bottom-0 left-0 h-1/2 w-1/2"},{zone:"br",labelKey:"snapBottomRight",region:"bottom-0 right-0 h-1/2 w-1/2"}],ur=350,dr=200;function hr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=j(!1),s=O(void 0),l=O(void 0);F(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),ur)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),dr)};/* @__PURE__ */
|
|
47
47
|
return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
|
|
48
48
|
/* @__PURE__ */Z("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */Z("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-gray-200 bg-white p-2 shadow-lg",children:cr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */Z("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */Z("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var mr="rosh-gesture-style";var pr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},fr=4;function wr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(mr))return;const e=document.createElement("style");e.id=mr,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=St(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function yr(e){const t=En.indexOf(e);if(-1===t)return-1;const n=D.window+t*D.windowStep,o=Pn.get(e);if(!o||o.root||!o.tab||!r())return n;let i=-1;for(const[e,t]of Pn){if(!t.root||t.owner!==o.owner)continue;const n=En.indexOf(e);-1!==n&&(i=Math.max(i,D.window+n*D.windowStep))}return i>=n?i+2+Math.min(t,7):n}function gr(){return En[En.length-1]||null}function br(e){return Cn.add(e),()=>{Cn.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=En.length-1;e>=0;e--)Jn.has(En[e])||En.splice(e,1);hn=hn.filter(e=>{const t=An.get(e);return null!=t&&Jn.has(t)}),pn(),zn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var vr="modal-close-request";function xr(e){q(br,Tn);const t=W(tn);if(En.length<=1)return!0;if(e){const t=An.get(e);if(null!=t)return gr()===t}return t?.active??null!=gr()}var kr=!1,Er=/* @__PURE__ */new Set;function Cr(e){return Er.add(e),()=>Er.delete(e)}function Mr(){return kr}function Nr(e){kr!==e&&(kr=e,Er.forEach(e=>e()))}function Sr(){Nr(!kr)}function Lr(){Nr(!1)}var Tr=null,zr=/* @__PURE__ */new Set;function Ar(e){return zr.add(e),()=>zr.delete(e)}function Dr(){return Tr}function Pr(e){Tr!==e&&(Tr=e,zr.forEach(e=>e()))}var Ir=null,Kr=/* @__PURE__ */new Set;function Wr(e){return Kr.add(e),()=>Kr.delete(e)}function Rr(){return Ir}function $r(e){Ir!==e&&(Ir=e,Kr.forEach(e=>e()))}function Or(){if(!Ir)return void Nr(!1);Pr(Ir),$r(null),Nr(!1)}function Fr(){Nr(!kr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function jr(){const e=q(Cr,Mr),[t,n]=j(e),[r,o]=j(e);return F(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?te(
|
|
49
|
-
/* @__PURE__ */Z("div",{onMouseDown:e=>{e.stopPropagation(),Nr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:D.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function qr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:y,onMinimize:C,initialBox:S,actions:L,actionsLeft:T,editing:A=!1,allowPinOnTop:K,initialPosition:R,widget:U,compact:Y,appStyle:_,flushBody:G,autoHeight:ne,autoMinHeight:re,autoWidth:oe,widgetMenu:ie,dimensions:ae,windowKey:se,openedFromKey:le,accentRgb:ce,children:ue}){const[de,he]=j(()=>r()),me=M()&&!de,pe=N()&&!!U,[we,ye]=j(0),[ge,be]=j(!1),ve=O(null),xe=O(0);F(()=>{xe.current=we},[we]);const ke=B(e=>{me&&(ve.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},be(!0),vt(le??null))},[me,le]),Me=q(xt,bt);F(()=>{if(!ge)return;const e=e=>{if(!ve.current)return;const t=e.clientX-ve.current.startX;if(Math.abs(e.clientY-ve.current.startY)>Math.abs(t)+12)return ve.current=null,be(!1),ye(0),void vt(null);ye(Math.max(0,t))},t=()=>{if(!ve.current)return;const e=.3*window.innerWidth,t=xe.current>e;ve.current=null,be(!1),t?(ye(window.innerWidth),setTimeout(()=>{i(),ye(0),vt(null)},180)):(ye(0),vt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[ge]);const[Se,Le]=j(c),Te=I(),ze=Te.window;F(()=>{Le(c)},[c]);const Ae=V(()=>Vt(Se).trim()||void 0,[Se]),De=J(),[Pe,Ie]=j(!1),Ke=O(!1),[We,Re]=j(!1),[$e,Oe]=j(null),Fe=W(Bt),je=W(fe),{prefs:Be,save:Ue}=v(),Ye=!!Be.window_accent_stripe,Xe=Be.favorite_documents||[],Ve=!!Fe&&Xe.some(e=>e.entityType===Fe.entityType&&e.entityId===Fe.entityId),Je=B(()=>{if(!Fe)return;const e=Ve?Xe.filter(e=>!(e.entityType===Fe.entityType&&e.entityId===Fe.entityId)):[...Xe,{entityType:Fe.entityType,entityId:Fe.entityId,label:Fe.label}];Ue({favorite_documents:e})},[Fe,Ve,Xe,Ue]),[_e,Ge]=j(null),[Qe,Ze]=j("top-right"===R?"right":"left"),et=O(!1),tt=O(null);$(()=>{const e=tt.current;e&&(ce?e.style.setProperty("--window-accent-rgb",ce):e.style.removeProperty("--window-accent-rgb"))},[ce]);const nt=O(!1),rt=O(null),ot=O(null),it=O(null),[at,st]=j(!1),lt=O(null),ct=!!(w||L||T)||at,ut=W(Ce),dt=""!==W(qt),ht=O(null);ht.current=je?{owner:je.key,tab:je.tab,root:!dt}:null;const mt=se||(je&&!dt?je.key:null),pt=!!ut&&!dt&&ut.enabled&&ut.hasState&&(A||ut.declaredEditable)&&!ut.handMounted&&ct&&!U&&!Y&&!_&&!me,ft=/* @__PURE__ */Z(z,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),yt=u&&H(u)?X(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??ft,gt=()=>/* @__PURE__ */Z("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Oe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:yt}),kt=40,{minimize:Et,items:Ct,restoreIfMinimized:Mt,openWindows:Nt}=He(),St=O(`modal-${Math.random().toString(36).slice(2,8)}`).current;F(()=>{if(U)return Jn.add(St),()=>{Jn.delete(St)}},[U,St]),F(()=>{const e=e=>{const t=e.detail;t?.id===St&&Le(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[St]);const[Lt,Tt]=j(D.window),zt=function(e){const t=q(br,gr);return En.length<=1||t===e}(St),At=function(e){return q(br,()=>Mn.has(e))}(St);wt({panelRef:tt,bodyRef:rt,open:t,widget:!!U,active:zt,minimized:At});const Dt=q(Cr,Mr),It=q(Ar,Dr),Wt=q(Wr,Rr),Rt=!K&&!U,Ot=Dt&&Rt,[Ft,jt]=j(!1),Ht=Ot&&Wt===St,[Ut,Jt]=j(!1),_t=Ut&&Rt&&It===St?"picked":null,Qt=O(Ot);F(()=>{if(Qt.current&&!Ot){Jt(!0);const e=setTimeout(()=>{Jt(!1),Tr===St&&Pr(null)},700);return Qt.current=Ot,()=>clearTimeout(e)}Qt.current=Ot},[Ot,St]),F(()=>{Ot||jt(!1)},[Ot]),F(()=>{const e=ot.current,t=it.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>st(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),F(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&tt.current){const t=tt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ot.current,n=it.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const Zt=O(!1),en=B(e,[]),nn=B(()=>{const t=e(),n=ae?ae[0]:bn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=kn[xn()],l=ae?Math.min(ae[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(En.length-1),u=Math.max(kt,(i-l)/2),d=(o-a)/2,m=t.h-kt-l-u;return"top-right"===R?{x:t.x+t.w-a-kt,y:t.y+kt,w:a,h:l}:"top-left"===R?{x:t.x+kt,y:t.y+kt,w:a,h:l}:{x:t.x+Math.max(kt,(o-a)/2+kt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),rn=O(!1);t||(rn.current=!1);const on=se||d||null;F(()=>{if(!t)return;Hn(St,on,ht.current??void 0),se||Xn(St),Zt.current=!1,Tt(yr(St));const e=()=>{Tt(yr(St))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===se;if(!e.label)return!1;const t=tt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Xn(St),yn.current)return;const t=Qn(),n=Math.min(In.current.w,t.w-40),o=Math.min(In.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;cn({x:i,y:a,w:n,h:o}),Tn(!1)},i=e=>{const t=e.detail;r(t)&&(Xn(St),Oe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==se)return;Xn(St);const t=In.current,n=function(e,t=Qn()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=tt.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}cn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=En.indexOf(e);-1!==t&&(En.splice(t,1),zn()),Mn.delete(e),Sn.delete(e),Pn.delete(e);const n=Dn.get(e);n&&(Dn.delete(e),An.delete(n))}(St),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,St,on,en]);const an=!U&&"maximized"===xn(),[sn,cn]=j(()=>{if(on&&ln[on]){const e={...ln[on]};return ae&&(e.w=ae[0],ne||(e.h=ae[1])),rr(e)}return S?{x:S.x,y:S.y,w:S.w,h:S.h}:an?en():nn()}),[dn,hn]=j(()=>!ne),mn=O(de),pn=O(null);F(()=>{const e=()=>{const e=r();e!==mn.current&&pn.current?.(e),mn.current=e,he(e),Tt(yr(St))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[St]);const fn=de&&!!je?.tab&&!dt&&!U&&!me,wn=fn,yn=O(wn);yn.current=wn;const gn=Kn(),Cn=de&&!!je?.tab&&!U&&!me&&!Dt&&gn!==je.key,Nn=!!U&&de&&!Dt&&null!==gn,[Ln,Tn]=j(()=>on&&ln[on]||S?wn:wn||an),In=O(sn);In.current=sn;const Wn=O(Ln);$(()=>{Wn.current=Ln},[Ln]),$(()=>{if(dn||fn)return;const e=tt.current,t=rt.current;if(!e||!t)return;const n=re??(U?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,In.current.y)-24),g=w?Math.min(In.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,cn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),U||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&hn(!0)},160)))},l=new ResizeObserver(s);s(),lt.current&&l.observe(lt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[dn,U,re,ct,fn]),$(()=>{if(!ne||!dn||U||!t)return;const e=lt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Ln)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=re??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,In.current.y)-24);cn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ne,dn,U,t,Ln,re]);const Rn=!1!==oe&&!U&&!_&&!me,[$n,On]=j(()=>!Rn);$(()=>{if($n||!t)return;if(!Rn||Ln)return void On(!0);const n=tt.current,r=rt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=In.current.w,c=0;const u=()=>On(!0),d=()=>{c=0;const t=In.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{a(e,w)||o.add(m[t])});const b=s(t,l(t.w,w,g),d,kt);b!==t&&(i=b.w,cn(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,vn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[$n,t,Rn,Ln]);const jn=O(null),qn=!(!je?.tab||dt||U||me);pn.current=t=>{if(!qn)return;if(t)return jn.current||(jn.current={box:{...In.current},maximized:Wn.current}),void(Wn.current=!0);const r=jn.current;jn.current=null;const o=e();if(r?.maximized)return Wn.current=!0,Tn(!0),void cn(o);const i=r?.box??(on?ln[on]:void 0);if(Wn.current=!1,Tn(!1),i&&!n(i,o,!1)){const e={...i};ae&&(e.w=ae[0],ne||(e.h=ae[1])),cn(rr(e))}else cn(nn())},F(()=>{wn&&(Wn.current=!0,Tn(!0),cn(en()))},[wn,en]),F(()=>{if(U)return;const e=()=>{const e=on?ln[on]:void 0;if(Wn.current=!1,Tn(!1),e){const t={...e};ae&&(t.w=ae[0],ne||(t.h=ae[1])),cn(rr(t))}else cn(nn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[U,nn,on]),F(()=>{t&&on&&!fn&&(ln[on]=sn,un()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[sn,t,on,fn]),F(()=>{if(!t)return;const e=()=>{Wn.current?cn(en()):document.body.classList.contains("rosh-gesturing")||cn(rr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Ln&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Ln,en]),F(()=>{if(t&&(Ie(!1),Ke.current=!1,et.current=!1,On(!Rn),!yn.current)){if(on&&ln[on]){const e=ln[on];return void cn(t=>rr({...e,...ne?{h:t.h}:{},...Rn?{x:t.x,w:t.w}:{}}))}S&&(cn({x:S.x,y:S.y,w:S.w,h:S.h}),Tn(S.maximized))}},[t]),F(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{tt.current?.contains(t.target)&&!Ke.current&&(Ke.current=!0,e=setTimeout(()=>Ie(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const Bn="auto"===m?Pe:!0===m,Un=je&&!dt?je.key:null,Yn=V(()=>Pt(Se),[Se]),Zn=O({shortcutSpec:Fe,isOnDesktop:Ve,toggleDesktopShortcut:Je,taskbarStrings:Te.taskbar});$(()=>{Zn.current={shortcutSpec:Fe,isOnDesktop:Ve,toggleDesktopShortcut:Je,taskbarStrings:Te.taskbar}});const er=O(null);er.current||(er.current={open:(e,t)=>Oe({x:e,y:t}),items:()=>{const e=Zn.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of Gt[St]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),F(()=>{if(t&&Un)return()=>{return e=Un,void(Kt.delete(e)&&$t());var e}},[t,Un]),qe(!(se||!t)&&Bn);const or=B(async e=>{if(et.current)return!1;if(!(Bn||"auto"===m&&Ke.current))return!0;et.current=!0;const t=Ae,n="close"===e?"Are you sure you want to close?":"Are you sure you want to continue?",r=await g({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return et.current=!1,r},[Bn,m,Ae]),ar=B(async()=>{await or("close")&&i()},[or,i]),cr=B(async()=>{const e=await or("switch");return e&&(Ke.current=!1,Ie(!1)),e},[or]),ur=O(()=>!1);$(()=>{ur.current=()=>Bn||"auto"===m&&Ke.current}),$(()=>{if(!t||!se)return;const e={holdsChanges:()=>ur.current(),ask:cr};return Fn.set(se,e),()=>{Fn.get(se)===e&&Fn.delete(se)}},[t,se,cr]),$(()=>{if(!t||!mt)return;const e=e=>{e.detail?.windowKey===mt&&ar()};return window.addEventListener(vr,e),()=>window.removeEventListener(vr,e)},[t,mt,ar]);const dr=O(null),mr=B(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Oe(null),Xn(St),yn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=tt.current,s=a?.getBoundingClientRect();let l,c,u,d;if(dr.current){const t=dr.current;dr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:In.current.x,c=s?s.top:In.current.y,u=s?s.height:In.current.h,d=s?s.width:In.current.w;Tn(!1),cn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<fr&&Math.abs(e.clientY-i)<fr)return;r=wr(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),In.current={...In.current,x:s,y:u},!U){const t=function(e,t){const n=Qn(),r=e<=n.x+_n,o=e>=n.x+n.w-_n,i=t<=n.y+_n,a=t>=n.y+n.h-_n,s=e<=n.x+Gn,l=e>=n.x+n.w-Gn,c=t<=n.y+Gn,u=t>=n.y+n.h-Gn;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?sr(ir(t)):lr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),lr();const e=rr({...In.current});if(In.current=e,!U&&h){dr.current={x:l,y:c,w:d,h:u};const e=ir(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void cn(e)}if(U){const t=e.x+e.w/2,n=window.innerWidth/2;Ze(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),cn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),xr=B((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=tt.current,l=s?.getBoundingClientRect(),c=l?l.left:In.current.x,u=l?l.top:In.current.y,d=l?l.width:In.current.w,h=l?l.height:In.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Tn(!1),cn({x:c,y:u,w:d,h:h}),In.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,In.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<fr&&Math.abs(e.clientY-a)<fr)return;o=wr(n,r,pr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(tr,d+e)),w&&(i=Math.max(nr,h+t)),m){const t=Math.max(tr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(nr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),cn({...In.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),kr=B(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),Xn(St),"Enter"===e.key)return void(Ln?(Tn(!1),cn(nn())):(Tn(!0),cn(en())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{dr.current||(dr.current={...In.current})};if(r<0)return e(),Tn(!0),void cn(en());if(r>0){if(Ln)return Tn(!1),void cn(nn());if(dr.current){const e=rr(dr.current);return dr.current=null,In.current=e,void cn(e)}return void Vn(St)}e(),Tn(!1);const t=ir(n<0?"left":"right");return In.current=t,void cn(t)}if(Ln)return;const o=In.current,i=e.shiftKey?{...o,w:Math.max(tr,o.w+24*n),h:Math.max(nr,o.h+24*r)}:rr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});In.current=i,cn(i)},[St,Ln,nn,en]),Er=B(e=>{dr.current||(dr.current={...In.current}),Tn(!1);const t=ir(e);In.current=t,cn(t),Xn(St)},[St]),Sr=wn||Ot?{}:{tabIndex:0,role:"group","aria-label":Ae?`${Ae} — ${ze.windowSuffix}`:ze.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:kr},Lr=()=>{Tn(!0),cn(en())},zr=B(()=>{const e=tt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Yt);t&&!t.disabled&&t.click()}},[]);F(()=>{if(!t)return;if(U)return;const e=e=>{if(En[En.length-1]===St&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),zr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&tt.current?.contains(t)))return;if(t.closest(Xt))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,zr,St,U]),F(()=>{if(!t)return;const e=e=>{En[En.length-1]===St&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:St}})),Ke.current=!1,Ie(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:St}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),F(()=>{if(!t)return;if(U)return;const e=e=>{if("Escape"===e.key&&En[En.length-1]===St){if(P(e))return e.preventDefault(),void e.stopPropagation();if(fn&&!A)return;e.preventDefault(),e.stopPropagation(),ar()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,ar,St,U,fn,A]);const Ir=t&&(void 0!==p||void 0!==f),[Kr]=j(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),$r=fn&&!je?.home&&Yn.actions.length>0;F(()=>{t&&Un&&function(e,t){const n=Kt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Kt.set(e,t),$t())}(Un,{title:Yn.text||Ae,dirty:Bn,copy:Yn.copy,actions:$r&&Kr?Kr:void 0,menu:er.current??void 0})},[t,Un,Ae,Bn,Yn.text,Yn.copy,$r,Kr]);const Or=B(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-white flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(F(()=>{if(!t)return;const e=e=>{if(En[En.length-1]!==St)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Ir&&(e.preventDefault(),p?p():Or("bottom")),"k"===e.key&&Ir&&(e.preventDefault(),f?f():Or("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Ir,Or,St]),!t||rn.current)return null;const Fr=Ot?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=Qn(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(St):null,jr=Ot&&Fr?Math.min(Fr.w/sn.w,Fr.h/sn.h):1,qr=(()=>{if(Ot&&Fr){const e=jr,t=sn.w*e,n=sn.h*e,r=Fr.x+(Fr.w-t)/2-sn.x,o=Fr.y+(Fr.h-n)/2-sn.y,i=Ft||Ht;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:D.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(Ut&&Rt){const e="picked"===_t;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:D.expose+30}:{}}}return null})(),Br=b({modal:!1,titleId:!U&&(fn?!je?.home:!me)?De:void 0,label:Yn.text||Ae}),Hr=/* @__PURE__ */Q("div",{children:[
|
|
50
|
-
/* @__PURE__ */Q("div",{ref:tt,"data-modal-panel":!0,"data-modal-id":St,"data-window-key":se||void 0,...K?{"data-utility":""}:{},...We?{"data-pinned-top":""}:{},...U?{"data-widget":""}:{},...je?{"data-window-owner":je.key}:{},...je&&!dt?{"data-window-root":""}:{},...fn?{"data-window-tab":""}:{},...
|
|
51
|
-
/* @__PURE__ */Z("h2",{id:De,"data-window-title":!0,className:"sr-only",children:Yn.text||Ae})
|
|
52
|
-
/* @__PURE__ */Z(ee,{children:Yn.actions})
|
|
53
|
-
/* @__PURE__ */Q("div",Y?{onPointerDown:
|
|
49
|
+
/* @__PURE__ */Z("div",{onMouseDown:e=>{e.stopPropagation(),Nr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:D.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function qr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:y,onMinimize:C,initialBox:S,actions:L,actionsLeft:T,editing:A=!1,allowPinOnTop:K,initialPosition:R,widget:U,compact:Y,appStyle:_,flushBody:G,autoHeight:ne,autoMinHeight:re,autoWidth:oe,widgetMenu:ie,dimensions:ae,windowKey:se,openedFromKey:le,accentRgb:ce,children:ue}){const[de,he]=j(()=>r()),me=M()&&!de,pe=N()&&!!U,[we,ye]=j(0),[ge,be]=j(!1),ve=O(null),xe=O(0);F(()=>{xe.current=we},[we]);const ke=B(e=>{me&&(ve.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},be(!0),vt(le??null))},[me,le]),Me=q(xt,bt);F(()=>{if(!ge)return;const e=e=>{if(!ve.current)return;const t=e.clientX-ve.current.startX;if(Math.abs(e.clientY-ve.current.startY)>Math.abs(t)+12)return ve.current=null,be(!1),ye(0),void vt(null);ye(Math.max(0,t))},t=()=>{if(!ve.current)return;const e=.3*window.innerWidth,t=xe.current>e;ve.current=null,be(!1),t?(ye(window.innerWidth),setTimeout(()=>{i(),ye(0),vt(null)},180)):(ye(0),vt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[ge]);const[Se,Le]=j(c),Te=I(),ze=Te.window;F(()=>{Le(c)},[c]);const Ae=V(()=>Vt(Se).trim()||void 0,[Se]),De=J(),[Pe,Ie]=j(!1),Ke=O(!1),[We,Re]=j(!1),[$e,Oe]=j(null),Fe=W(Bt),je=W(fe),{prefs:Be,save:Ue}=v(),Ye=!!Be.window_accent_stripe,Xe=Be.favorite_documents||[],Ve=!!Fe&&Xe.some(e=>e.entityType===Fe.entityType&&e.entityId===Fe.entityId),Je=B(()=>{if(!Fe)return;const e=Ve?Xe.filter(e=>!(e.entityType===Fe.entityType&&e.entityId===Fe.entityId)):[...Xe,{entityType:Fe.entityType,entityId:Fe.entityId,label:Fe.label}];Ue({favorite_documents:e})},[Fe,Ve,Xe,Ue]),[_e,Ge]=j(null),[Qe,Ze]=j("top-right"===R?"right":"left"),et=O(!1),tt=O(null);$(()=>{const e=tt.current;e&&(ce?e.style.setProperty("--window-accent-rgb",ce):e.style.removeProperty("--window-accent-rgb"))},[ce]);const nt=O(!1),rt=O(null),ot=O(null),it=O(null),[at,st]=j(!1),lt=O(null),ct=!!(w||L||T)||at,ut=W(Ce),dt=""!==W(qt),ht=O(null);ht.current=je?{owner:je.key,tab:je.tab,root:!dt}:null;const mt=se||(je&&!dt?je.key:null),pt=!!ut&&!dt&&ut.enabled&&ut.hasState&&(A||ut.declaredEditable)&&!ut.handMounted&&ct&&!U&&!Y&&!_&&!me,ft=/* @__PURE__ */Z(z,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),yt=u&&H(u)?X(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??ft,gt=()=>/* @__PURE__ */Z("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Oe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:yt}),kt=40,{minimize:Et,items:Ct,restoreIfMinimized:Mt,openWindows:Nt}=He(),St=O(`modal-${Math.random().toString(36).slice(2,8)}`).current;F(()=>{if(U)return Jn.add(St),()=>{Jn.delete(St)}},[U,St]),F(()=>{const e=e=>{const t=e.detail;t?.id===St&&Le(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[St]);const[Lt,Tt]=j(D.window),zt=function(e){const t=q(br,gr);return En.length<=1||t===e}(St),At=function(e){return q(br,()=>Mn.has(e))}(St);wt({panelRef:tt,bodyRef:rt,open:t,widget:!!U,active:zt,minimized:At});const Dt=q(Cr,Mr),It=q(Ar,Dr),Wt=q(Wr,Rr),Rt=!K&&!U,Ot=Dt&&Rt,[Ft,jt]=j(!1),Ht=Ot&&Wt===St,[Ut,Jt]=j(!1),_t=Ut&&Rt&&It===St?"picked":null,Qt=O(Ot);F(()=>{if(Qt.current&&!Ot){Jt(!0);const e=setTimeout(()=>{Jt(!1),Tr===St&&Pr(null)},700);return Qt.current=Ot,()=>clearTimeout(e)}Qt.current=Ot},[Ot,St]),F(()=>{Ot||jt(!1)},[Ot]),F(()=>{const e=ot.current,t=it.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>st(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),F(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&tt.current){const t=tt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ot.current,n=it.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const Zt=O(!1),en=B(e,[]),nn=B(()=>{const t=e(),n=ae?ae[0]:bn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=kn[xn()],l=ae?Math.min(ae[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(En.length-1),u=Math.max(kt,(i-l)/2),d=(o-a)/2,m=t.h-kt-l-u;return"top-right"===R?{x:t.x+t.w-a-kt,y:t.y+kt,w:a,h:l}:"top-left"===R?{x:t.x+kt,y:t.y+kt,w:a,h:l}:{x:t.x+Math.max(kt,(o-a)/2+kt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),rn=O(!1);t||(rn.current=!1);const on=se||d||null;F(()=>{if(!t)return;Hn(St,on,ht.current??void 0),se||Xn(St),Zt.current=!1,Tt(yr(St));const e=()=>{Tt(yr(St))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===se;if(!e.label)return!1;const t=tt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Xn(St),yn.current)return;const t=Qn(),n=Math.min(In.current.w,t.w-40),o=Math.min(In.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;cn({x:i,y:a,w:n,h:o}),Tn(!1)},i=e=>{const t=e.detail;r(t)&&(Xn(St),Oe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==se)return;Xn(St);const t=In.current,n=function(e,t=Qn()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=tt.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}cn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=En.indexOf(e);-1!==t&&(En.splice(t,1),zn()),Mn.delete(e),Sn.delete(e),Pn.delete(e);const n=Dn.get(e);n&&(Dn.delete(e),An.delete(n))}(St),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,St,on,en]);const an=!U&&"maximized"===xn(),[sn,cn]=j(()=>{if(on&&ln[on]){const e={...ln[on]};return ae&&(e.w=ae[0],ne||(e.h=ae[1])),rr(e)}return S?{x:S.x,y:S.y,w:S.w,h:S.h}:an?en():nn()}),[dn,hn]=j(()=>!ne),mn=O(de),pn=O(null);F(()=>{const e=()=>{const e=r();e!==mn.current&&pn.current?.(e),mn.current=e,he(e),Tt(yr(St))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[St]);const fn=de&&!!je?.tab&&!dt&&!U&&!me,wn=fn,yn=O(wn);yn.current=wn;const gn=Kn(),Cn=de&&!!je?.tab&&!U&&!me&&!Dt&&gn!==je.key,Nn=!!U&&de&&!Dt&&null!==gn,[Ln,Tn]=j(()=>on&&ln[on]||S?wn:wn||an),In=O(sn);In.current=sn;const Wn=O(Ln);$(()=>{Wn.current=Ln},[Ln]),$(()=>{if(dn||fn)return;const e=tt.current,t=rt.current;if(!e||!t)return;const n=re??(U?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,In.current.y)-24),g=w?Math.min(In.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,cn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),U||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&hn(!0)},160)))},l=new ResizeObserver(s);s(),lt.current&&l.observe(lt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[dn,U,re,ct,fn]),$(()=>{if(!ne||!dn||U||!t)return;const e=lt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Ln)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=re??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,In.current.y)-24);cn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ne,dn,U,t,Ln,re]);const Rn=!1!==oe&&!U&&!_&&!me,[$n,On]=j(()=>!Rn);$(()=>{if($n||!t)return;if(!Rn||Ln)return void On(!0);const n=tt.current,r=rt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=In.current.w,c=0;const u=()=>On(!0),d=()=>{c=0;const t=In.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{a(e,w)||o.add(m[t])});const b=s(t,l(t.w,w,g),d,kt);b!==t&&(i=b.w,cn(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,vn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[$n,t,Rn,Ln]);const jn=O(null),qn=!(!je?.tab||dt||U||me);pn.current=t=>{if(!qn)return;if(t)return jn.current||(jn.current={box:{...In.current},maximized:Wn.current}),void(Wn.current=!0);const r=jn.current;jn.current=null;const o=e();if(r?.maximized)return Wn.current=!0,Tn(!0),void cn(o);const i=r?.box??(on?ln[on]:void 0);if(Wn.current=!1,Tn(!1),i&&!n(i,o,!1)){const e={...i};ae&&(e.w=ae[0],ne||(e.h=ae[1])),cn(rr(e))}else cn(nn())},F(()=>{wn&&(Wn.current=!0,Tn(!0),cn(en()))},[wn,en]),F(()=>{if(U)return;const e=()=>{const e=on?ln[on]:void 0;if(Wn.current=!1,Tn(!1),e){const t={...e};ae&&(t.w=ae[0],ne||(t.h=ae[1])),cn(rr(t))}else cn(nn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[U,nn,on]),F(()=>{t&&on&&!fn&&(ln[on]=sn,un()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[sn,t,on,fn]),F(()=>{if(!t)return;const e=()=>{Wn.current?cn(en()):document.body.classList.contains("rosh-gesturing")||cn(rr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Ln&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Ln,en]),F(()=>{if(t&&(Ie(!1),Ke.current=!1,et.current=!1,On(!Rn),!yn.current)){if(on&&ln[on]){const e=ln[on];return void cn(t=>rr({...e,...ne?{h:t.h}:{},...Rn?{x:t.x,w:t.w}:{}}))}S&&(cn({x:S.x,y:S.y,w:S.w,h:S.h}),Tn(S.maximized))}},[t]),F(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{tt.current?.contains(t.target)&&!Ke.current&&(Ke.current=!0,e=setTimeout(()=>Ie(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const Bn="auto"===m?Pe:!0===m,Un=je&&!dt?je.key:null,Yn=V(()=>Pt(Se),[Se]),Zn=O({shortcutSpec:Fe,isOnDesktop:Ve,toggleDesktopShortcut:Je,taskbarStrings:Te.taskbar});$(()=>{Zn.current={shortcutSpec:Fe,isOnDesktop:Ve,toggleDesktopShortcut:Je,taskbarStrings:Te.taskbar}});const er=O(null);er.current||(er.current={open:(e,t)=>Oe({x:e,y:t}),items:()=>{const e=Zn.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of Gt[St]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),F(()=>{if(t&&Un)return()=>{return e=Un,void(Kt.delete(e)&&$t());var e}},[t,Un]),qe(!(se||!t)&&Bn);const or=B(()=>Bn||"auto"===m&&Ke.current,[Bn,m]),ar=B(async e=>{if(et.current)return!1;if(!or())return!0;et.current=!0;const t=Ae,n="close"===e?"Are you sure you want to close?":"Are you sure you want to continue?",r=await g({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return et.current=!1,r},[or,Ae]),cr=B(()=>et.current?Promise.resolve():or()?ar("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[or,ar,i]),ur=B(async()=>{const e=await ar("switch");return e&&(Ke.current=!1,Ie(!1)),e},[ar]),dr=O(()=>!1);$(()=>{dr.current=or}),$(()=>{if(!t||!se)return;const e={holdsChanges:()=>dr.current(),ask:ur};return Fn.set(se,e),()=>{Fn.get(se)===e&&Fn.delete(se)}},[t,se,ur]),$(()=>{if(!t||!mt)return;const e=e=>{e.detail?.windowKey===mt&&cr()};return window.addEventListener(vr,e),()=>window.removeEventListener(vr,e)},[t,mt,cr]);const mr=O(null),xr=B(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Oe(null),Xn(St),yn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=tt.current,s=a?.getBoundingClientRect();let l,c,u,d;if(mr.current){const t=mr.current;mr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:In.current.x,c=s?s.top:In.current.y,u=s?s.height:In.current.h,d=s?s.width:In.current.w;Tn(!1),cn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<fr&&Math.abs(e.clientY-i)<fr)return;r=wr(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),In.current={...In.current,x:s,y:u},!U){const t=function(e,t){const n=Qn(),r=e<=n.x+_n,o=e>=n.x+n.w-_n,i=t<=n.y+_n,a=t>=n.y+n.h-_n,s=e<=n.x+Gn,l=e>=n.x+n.w-Gn,c=t<=n.y+Gn,u=t>=n.y+n.h-Gn;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?sr(ir(t)):lr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),lr();const e=rr({...In.current});if(In.current=e,!U&&h){mr.current={x:l,y:c,w:d,h:u};const e=ir(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void cn(e)}if(U){const t=e.x+e.w/2,n=window.innerWidth/2;Ze(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),cn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),kr=B((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=tt.current,l=s?.getBoundingClientRect(),c=l?l.left:In.current.x,u=l?l.top:In.current.y,d=l?l.width:In.current.w,h=l?l.height:In.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Tn(!1),cn({x:c,y:u,w:d,h:h}),In.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,In.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<fr&&Math.abs(e.clientY-a)<fr)return;o=wr(n,r,pr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(tr,d+e)),w&&(i=Math.max(nr,h+t)),m){const t=Math.max(tr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(nr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),cn({...In.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Er=B(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),Xn(St),"Enter"===e.key)return void(Ln?(Tn(!1),cn(nn())):(Tn(!0),cn(en())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{mr.current||(mr.current={...In.current})};if(r<0)return e(),Tn(!0),void cn(en());if(r>0){if(Ln)return Tn(!1),void cn(nn());if(mr.current){const e=rr(mr.current);return mr.current=null,In.current=e,void cn(e)}return void Vn(St)}e(),Tn(!1);const t=ir(n<0?"left":"right");return In.current=t,void cn(t)}if(Ln)return;const o=In.current,i=e.shiftKey?{...o,w:Math.max(tr,o.w+24*n),h:Math.max(nr,o.h+24*r)}:rr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});In.current=i,cn(i)},[St,Ln,nn,en]),Sr=B(e=>{mr.current||(mr.current={...In.current}),Tn(!1);const t=ir(e);In.current=t,cn(t),Xn(St)},[St]),Lr=wn||Ot?{}:{tabIndex:0,role:"group","aria-label":Ae?`${Ae} — ${ze.windowSuffix}`:ze.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Er},zr=()=>{Tn(!0),cn(en())},Ir=B(()=>{const e=tt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Yt);t&&!t.disabled&&t.click()}},[]);F(()=>{if(!t)return;if(U)return;const e=e=>{if(En[En.length-1]===St&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Ir();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&tt.current?.contains(t)))return;if(t.closest(Xt))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Ir,St,U]),F(()=>{if(!t)return;const e=e=>{En[En.length-1]===St&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:St}})),Ke.current=!1,Ie(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:St}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),F(()=>{if(!t)return;if(U)return;const e=e=>{if("Escape"===e.key&&En[En.length-1]===St){if(P(e))return e.preventDefault(),void e.stopPropagation();if(fn&&!A)return;e.preventDefault(),e.stopPropagation(),cr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,cr,St,U,fn,A]);const Kr=t&&(void 0!==p||void 0!==f),[$r]=j(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),Or=fn&&!je?.home&&Yn.actions.length>0;F(()=>{t&&Un&&function(e,t){const n=Kt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Kt.set(e,t),$t())}(Un,{title:Yn.text||Ae,dirty:Bn,copy:Yn.copy,actions:Or&&$r?$r:void 0,menu:er.current??void 0})},[t,Un,Ae,Bn,Yn.text,Yn.copy,Or,$r]);const Fr=B(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-white flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(F(()=>{if(!t)return;const e=e=>{if(En[En.length-1]!==St)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Kr&&(e.preventDefault(),p?p():Fr("bottom")),"k"===e.key&&Kr&&(e.preventDefault(),f?f():Fr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Kr,Fr,St]),!t||rn.current)return null;const jr=Ot?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=Qn(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(St):null,qr=Ot&&jr?Math.min(jr.w/sn.w,jr.h/sn.h):1,Br=(()=>{if(Ot&&jr){const e=qr,t=sn.w*e,n=sn.h*e,r=jr.x+(jr.w-t)/2-sn.x,o=jr.y+(jr.h-n)/2-sn.y,i=Ft||Ht;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:D.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(Ut&&Rt){const e="picked"===_t;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:D.expose+30}:{}}}return null})(),Hr=b({modal:!1,titleId:!U&&(fn?!je?.home:!me)?De:void 0,label:Yn.text||Ae}),Ur=/* @__PURE__ */Q("div",{children:[
|
|
50
|
+
/* @__PURE__ */Q("div",{ref:tt,"data-modal-panel":!0,"data-modal-id":St,"data-window-key":se||void 0,...K?{"data-utility":""}:{},...We?{"data-pinned-top":""}:{},...U?{"data-widget":""}:{},...je?{"data-window-owner":je.key}:{},...je&&!dt?{"data-window-root":""}:{},...fn?{"data-window-tab":""}:{},...Hr,className:fn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(U?zt?"shadow-xl":"shadow-lg":"border "+(zt?"shadow-xl border-gray-200":"shadow-lg border-gray-300")),onMouseDownCapture:e=>{if(nt.current=!1,Ot){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Pr(St),Nr(!1),void Xn(St)}if(!zt&&!U&&!We&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===tt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),nt.current=!0,Oe(null),Xn(St),window.addEventListener("mouseup",()=>{setTimeout(()=>{nt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{nt.current&&(nt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Ot)return;Oe(null);e.target.closest("[data-modal-panel]")===tt.current&&(e.target.closest("button, input, a, select, textarea")||Xn(St))},style:me?{zIndex:Lt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${we}px)`,transition:ge?"none":"transform 180ms ease-out",...U?{display:"none"}:{},...Lt<0?{display:"none"}:{},...zt||We||Me&&se===Me?{}:{display:"none"}}:{zIndex:We?D.pinnedWindow:Lt+1,width:sn.w,height:sn.h,top:sn.y,...U&&"right"===Qe?{right:window.innerWidth-sn.x-sn.w}:{left:sn.x},...Lt<0&&!We?{display:"none"}:{},...pe?{display:"none"}:{},...Cn||Nn?{visibility:"hidden",pointerEvents:"none"}:{},...Br??{}},children:[me&&!U&&/* @__PURE__ */Z("div",{onPointerDown:ke,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),U?null:fn?je?.home?null:/* @__PURE__ */Q(ee,{children:[
|
|
51
|
+
/* @__PURE__ */Z("h2",{id:De,"data-window-title":!0,className:"sr-only",children:Yn.text||Ae}),Or&&$r&&te(
|
|
52
|
+
/* @__PURE__ */Z(ee,{children:Yn.actions}),$r),Yn.badges.length>0&&/* @__PURE__ */Z("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-2 overflow-hidden border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:Yn.badges})]}):me?null:
|
|
53
|
+
/* @__PURE__ */Q("div",Y?{onPointerDown:xr,"data-window-chrome":"",...Lr,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
54
54
|
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Ae,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ot&>(),
|
|
55
55
|
/* @__PURE__ */Z("span",{id:De,className:"truncate",children:Ot?Vt(Se):Se})]}),!Ot&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[K&&/* @__PURE__ */Z("button",{onClick:()=>Re(e=>!e),title:We?ze.unpin:ze.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(We?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3 w-3",fill:We?"currentColor":"none",strokeWidth:1.5})}),
|
|
56
|
-
/* @__PURE__ */Z("button",{type:"button",onClick:
|
|
56
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:cr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"})})]})]}:_?{onPointerDown:xr,"data-window-chrome":"",...Lr,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
57
57
|
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Ae,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ot&>(),
|
|
58
58
|
/* @__PURE__ */Z("span",{id:De,className:"truncate",children:Ot?Vt(Se):Se})]}),!Ot&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[K&&/* @__PURE__ */Z("button",{onClick:()=>Re(e=>!e),title:We?ze.unpin:ze.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(We?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3 w-3",fill:We?"currentColor":"none",strokeWidth:1.5})}),
|
|
59
|
-
/* @__PURE__ */Z("button",{onClick:()=>Vn(St),title:ze.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!wn&&/* @__PURE__ */Z(hr,{maximized:Ln,onToggleMax:()=>{Ln?(Tn(!1),cn(nn())):
|
|
60
|
-
/* @__PURE__ */Z("button",{type:"button",onClick:
|
|
59
|
+
/* @__PURE__ */Z("button",{onClick:()=>Vn(St),title:ze.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!wn&&/* @__PURE__ */Z(hr,{maximized:Ln,onToggleMax:()=>{Ln?(Tn(!1),cn(nn())):zr()},onSnap:Sr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:ze}),
|
|
60
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:cr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:xr,"data-window-chrome":"",...Lr,className:"flex items-center justify-between h-(--row-height-window-bar) px-3 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
61
61
|
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Ae,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ot&>(),
|
|
62
62
|
/* @__PURE__ */Z("span",{id:De,className:"truncate",children:Ot?Vt(Se):Se})]}),!Ot&&/* @__PURE__ */Q("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[K&&/* @__PURE__ */Z("button",{onClick:()=>Re(e=>!e),title:We?ze.unpin:ze.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(We?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:We?"currentColor":"none",strokeWidth:1.5})}),
|
|
63
|
-
/* @__PURE__ */Z("button",{onClick:()=>Vn(St),title:ze.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!wn&&/* @__PURE__ */Z(hr,{maximized:Ln,onToggleMax:()=>{Ln?(Tn(!1),cn(nn())):
|
|
64
|
-
/* @__PURE__ */Z("button",{type:"button",onClick:
|
|
65
|
-
/* @__PURE__ */Z(qt.Provider,{value:St,children:/* @__PURE__ */Z(tn.Provider,{value:{rightRef:ot,leftRef:it,notify:()=>st(!0),active:zt,isDirty:Bn,footerOpen:ct&&!U&&!Y&&!_&&!me},children:/* @__PURE__ */Z("div",{ref:rt,...U?{onPointerDown:
|
|
63
|
+
/* @__PURE__ */Z("button",{onClick:()=>Vn(St),title:ze.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!wn&&/* @__PURE__ */Z(hr,{maximized:Ln,onToggleMax:()=>{Ln?(Tn(!1),cn(nn())):zr()},onSnap:Sr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:ze}),
|
|
64
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:cr,className:"rounded-(--radius-control) text-gray-400 hover:text-gray-600",children:/* @__PURE__ */Z(z,{name:"close",className:"h-5 w-5"})})]})]}),ce&&Ye&&!U&&!me&&/* @__PURE__ */Z("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${zt?.9:.55})`}}),
|
|
65
|
+
/* @__PURE__ */Z(qt.Provider,{value:St,children:/* @__PURE__ */Z(tn.Provider,{value:{rightRef:ot,leftRef:it,notify:()=>st(!0),active:zt,isDirty:Bn,footerOpen:ct&&!U&&!Y&&!_&&!me},children:/* @__PURE__ */Z("div",{ref:rt,...U?{onPointerDown:xr,onContextMenu:e=>{e.preventDefault(),Ge({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${U?"p-0 cursor-move":_||G?"p-0":Y?"p-2":"p-4"} ${U||fn?"":"backdrop-blur-sm"} ${!1===y||_||G?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${U?"rounded-2xl select-none":""}`,style:{...U?{touchAction:"none"}:{},backgroundColor:U?"transparent":fn?"rgb(var(--window-content-rgb))":zt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */Z(Ee,{children:ue})})})}),U&&_e&&/* @__PURE__ */Q(x,{minWidth:160,style:{left:_e.x,top:_e.y},onClose:()=>Ge(null),children:[
|
|
66
66
|
/* @__PURE__ */Z(k,{onClick:()=>{Ge(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:St}))},children:"Settings"}),
|
|
67
67
|
/* @__PURE__ */Z(E,{}),ie&&/* @__PURE__ */Q(ee,{children:[ie,
|
|
68
68
|
/* @__PURE__ */Z(E,{})]}),
|
|
69
69
|
/* @__PURE__ */Q(k,{onClick:()=>{Ge(null),Re(e=>!e)},children:[
|
|
70
70
|
/* @__PURE__ */Z("span",{className:"flex-1",children:"Always on Top"}),We&&/* @__PURE__ */Z(z,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
71
71
|
/* @__PURE__ */Z(E,{}),
|
|
72
|
-
/* @__PURE__ */Z(k,{onClick:()=>{Ge(null),
|
|
73
|
-
/* @__PURE__ */Q("div",{onPointerDown:
|
|
72
|
+
/* @__PURE__ */Z(k,{onClick:()=>{Ge(null),cr()},children:"Close"})]}),
|
|
73
|
+
/* @__PURE__ */Q("div",{onPointerDown:xr,ref:lt,className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${fn?"":" cursor-move"}${zt&&!fn?" backdrop-blur-sm":""}${U||Y||_||me||!ct?" hidden":""}`,style:{touchAction:"none",backgroundColor:fn?"rgb(var(--window-footer-rgb))":zt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
74
74
|
/* @__PURE__ */Q("div",{className:"flex items-center gap-2 min-w-0",children:[pt&&/* @__PURE__ */Z(Ne,{auto:!0}),T,
|
|
75
75
|
/* @__PURE__ */Z("div",{ref:it,"data-modal-actions-left":!0,className:"flex items-center gap-2"}),w]}),
|
|
76
76
|
/* @__PURE__ */Q("div",{className:"flex items-center gap-2 ml-auto",children:[
|
|
77
77
|
/* @__PURE__ */Z("div",{ref:ot,"data-modal-actions":!0,className:"flex items-center gap-2"}),L]})]}),!U&&!me&&!Ot&&zt&&!wn&&/* @__PURE__ */Q(ee,{children:[
|
|
78
|
-
/* @__PURE__ */Z("div",{onPointerDown:e=>
|
|
79
|
-
/* @__PURE__ */Z("div",{onPointerDown:e=>
|
|
80
|
-
/* @__PURE__ */Z("div",{onPointerDown:e=>
|
|
81
|
-
/* @__PURE__ */Z("div",{onPointerDown:e=>
|
|
82
|
-
/* @__PURE__ */Z("div",{onPointerDown:e=>
|
|
83
|
-
/* @__PURE__ */Z("div",{onPointerDown:e=>
|
|
84
|
-
/* @__PURE__ */Z("div",{onPointerDown:e=>
|
|
85
|
-
/* @__PURE__ */Z("div",{onPointerDown:e=>
|
|
78
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
79
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
80
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
81
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
82
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
83
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
84
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
85
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Ot&&/* @__PURE__ */Z("div",{className:"absolute inset-0",style:{zIndex:D.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>jt(!0),onMouseLeave:()=>jt(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Xn(St),Nr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Ft&&/* @__PURE__ */Z("button",{type:"button","data-expose-close":!0,"aria-label":Te.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-white shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/qr})`,transformOrigin:"top right",zIndex:D.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),cr()},children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Ot&&jr&&/* @__PURE__ */Z("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:jr.x,top:jr.y+jr.h+4,width:jr.w,zIndex:D.expose+(Ft?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Vt(Se)})]}),Yr=$e&&/* @__PURE__ */Q(x,{style:{left:$e.x,top:$e.y},onClose:()=>Oe(null),minWidth:160,children:[!U&&!Y&&!fn&&/* @__PURE__ */Q(ee,{children:[
|
|
86
86
|
/* @__PURE__ */Q(k,{onClick:()=>{Vn(St),Oe(null)},children:[
|
|
87
87
|
/* @__PURE__ */Z(z,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),ze.minimize]}),!wn&&/* @__PURE__ */Q(k,Ln?{onClick:()=>{Tn(!1),cn(nn()),Oe(null)},children:[
|
|
88
|
-
/* @__PURE__ */Z("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Z("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),ze.windowed]}:{onClick:()=>{
|
|
88
|
+
/* @__PURE__ */Z("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Z("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),ze.windowed]}:{onClick:()=>{zr(),Oe(null)},children:[
|
|
89
89
|
/* @__PURE__ */Z(z,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),ze.maximize]})]}),K&&!fn&&/* @__PURE__ */Q(k,{onClick:()=>{Re(e=>!e),Oe(null)},children:[
|
|
90
90
|
/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-4 w-4 "+(We?"text-blue-600":""),fill:We?"currentColor":"none",strokeWidth:1.5}),We?ze.unpin:ze.pinOnTop]}),Fe&&/* @__PURE__ */Q(k,{onClick:()=>{Oe(null),Je()},children:[
|
|
91
91
|
/* @__PURE__ */Z(z,{name:"star",className:"h-4 w-4",fill:Ve?"currentColor":"none",strokeWidth:1.5}),Ve?Te.taskbar.removeFromDesktop:Te.taskbar.addToDesktop]}),(Gt[St]||[]).length>0&&/* @__PURE__ */Z(ee,{children:(Gt[St]||[]).map((e,t)=>/* @__PURE__ */Q(k,{onClick:()=>{Oe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(fn&&je?.home)&&/* @__PURE__ */Q(ee,{children:[
|
|
92
92
|
/* @__PURE__ */Z(E,{}),
|
|
93
|
-
/* @__PURE__ */Q(k,{danger:!0,onClick:()=>{Oe(null),
|
|
94
|
-
/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"}),ze.close]})]})]}),
|
|
93
|
+
/* @__PURE__ */Q(k,{danger:!0,onClick:()=>{Oe(null),cr()},children:[
|
|
94
|
+
/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"}),ze.close]})]})]}),Xr=!!se&&Nt.some(e=>e.id===se),Vr=!At||Xr||U?null:/* @__PURE__ */Q("div",{"data-modal-restore-tab":!0,"data-modal-id":St,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-gray-300 bg-white px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
|
|
95
95
|
/* @__PURE__ */Z("button",{type:"button",onClick:()=>Xn(St),title:ze.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:Ae||ze.windowSuffix}),
|
|
96
96
|
/* @__PURE__ */Z("button",{type:"button",onClick:()=>Xn(St),title:ze.restore,"aria-label":ze.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
97
|
-
/* @__PURE__ */Z("button",{type:"button",onClick:()=>{
|
|
98
|
-
/* @__PURE__ */Q(Bt.Provider,{value:null,children:[
|
|
97
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:()=>{cr()},title:ze.close,"aria-label":ze.close,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return te(
|
|
98
|
+
/* @__PURE__ */Q(Bt.Provider,{value:null,children:[Ur,Yr,Vr]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{kr&&"Escape"===e.key&&($r(null),Nr(!1))});var Br=100,Hr={past:[],future:[]};function Ur(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>Br?r.slice(r.length-Br):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:Hr}}var Yr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Xr=500,Vr=250;function Jr({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=_(Ur,Hr),s=O(/* @__PURE__ */new Map),[l,c]=j(0),u=l>0,[d,h]=j(0),[m,p]=j(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===d&&(!(n&&n.length>0)||w(n)),g=O(null),b=O(!1),v=B(()=>{const e={};for(const[t,n]of s.current)e[t]=n.getLast();return e},[]),x=B((e,t)=>{s.current.has(e)||c(e=>e+1),s.current.set(e,t)},[]),k=B(e=>{s.current.delete(e)&&c(e=>e-1)},[]),E=B(e=>{h(t=>t+(e?1:-1))},[]),C=B(e=>{p(t=>t+(e?1:-1))},[]),[M,N]=j(0),S=M>0,L=B(e=>{N(t=>t+(e?1:-1))},[]),T=W(Ce),z=T?.claimReadOnly;F(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const A=T?.claimOwnMount;F(()=>{if(A&&S)return A(!0),()=>A(!1)},[A,S]);const D=O({last:0,count:0,tripped:!1}),P=O(!1),I=B((e,t,n)=>{if(b.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(P.current=!0));if(!y||g.current)return;const r=D.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Vr&&(r.count=0),r.last=o,++r.count>Xr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Xr} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);g.current={values:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=g.current;g.current=null,e&&a({type:"record",step:e})})},[y,v]),K=B(e=>{for(const[t,n]of Object.entries(e)){const e=s.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),R=B(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};K(e.values),a({type:"undo",redoStep:t})},[o.past,v,K]),$=B(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};K(e.values),a({type:"redo",undoStep:t})},[o.future,v,K]),[q,H]=j(0),U=O(0),Y=O(0),X=O(!1),J=B(()=>{b.current=!0,P.current=!1,g.current=null,U.current+=1,Y.current=U.current,H(U.current)},[]),G=O(void 0),ee=B(e=>{void 0!==e&&(void 0!==G.current&&e!==G.current&&(X.current=!0),G.current=e),J()},[J]);F(()=>{b.current&&q===Y.current&&(b.current=!1,g.current=null,(P.current||X.current)&&a({type:"clear"}),P.current=!1,X.current=!1)},[q]);const te=B(()=>{X.current=!0,a({type:"clear"}),J()},[J]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=xr(r),ie=O({undo:R,redo:$,canUndo:ne,canRedo:re});ie.current={undo:R,redo:$,canUndo:ne,canRedo:re},F(()=>{if(!oe||!y)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&Yr.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ie.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe,y]);const ae=V(()=>({register:x,unregister:k,record:I,undo:R,redo:$,clear:te,baseline:ee,canUndo:ne,canRedo:re,enabled:y,hasState:u,handMounted:S,claimOwnMount:L,claimReadOnly:E,declaredEditable:f,claimEditable:C,undoLabel:ne?o.past[o.past.length-1].label:null,redoLabel:re?o.future[0].label:null}),[x,k,I,R,$,te,ee,ne,re,y,u,S,L,E,f,C,o.past,o.future]),se=""!==nn(),le=W(tn)?.footerOpen??!1,ce=se&&y&&u&&!S&≤/* @__PURE__ */
|
|
99
99
|
return Q(Ce.Provider,{value:ae,children:[ce&&/* @__PURE__ */Z(on,{position:"left",quiet:!0,children:/* @__PURE__ */Z(Ne,{auto:!0})}),e]})}function _r(){const e=W(Ce),t=B(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function Gr(e){const t=W(Ce),n=t?.claimReadOnly,r=t?.claimEditable;F(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function Qr(e,t,n){const r=W(Ce),o=J(),i=O(e),a=O(t);a.current=t,F(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:s,coalesceKey:l=null}=n,c=O(r);c.current=r;const u=O({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},F(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function Zr(e,t){const[n,r]=j(e);return Qr(n,e=>r(()=>e),t),[n,r]}export{an as CancelButton,Xe as DocFavStar,Ke as EntityWindowFallback,Pe as EntityWindowLoading,We as EntityWindowState,Xt as KEY_ACTIVATED_SELECTOR,Ae as LoadingSpinner,Yt as MODAL_SUBMIT_SELECTOR,qr as Modal,on as ModalActions,Ne as UndoControls,Jr as UndoProvider,ce as WINDOW_REGISTRY,ke as WindowCrashedFallback,Ee as WindowErrorBoundary,pt as WindowManagerProvider,Zt as WindowTitle,Qe as activateWindowById,St as beginWindowGesture,Bn as cancelWindowFront,pe as client_default,Or as commitExposeHighlight,qn as confirmWindowDiscard,Lt as drainPerfEvents,Lr as exitExposeMode,gn as forgetMaximizedWindowBoxes,gr as getActiveModalId,nt as getActiveWindowRoute,Rr as getExposeHighlight,jt as getWindowChromeVersion,wn as getWindowPosition,$e as isDraftEntityId,Oe as isDraftEntityWindow,ae as isEntityEntry,ie as isPageEntry,he as isShellApiClientConfigured,Ze as isTabWindow,Nt as markMenuOpen,Ot as readWindowChrome,On as requestWindowFront,$r as setExposeHighlight,Mt as setPerfCollecting,de as setShellApiClient,be as setShellHomeRoute,le as setShellWindowRegistry,fn as setWindowDefaultPosition,yn as setWindowPosition,Pt as splitTitle,Wr as subscribeExposeHighlight,Ft as subscribeWindowChrome,Sr as toggleExposeMode,Kn as useCurrentTabKey,nn as useEnclosingModalId,xr as useIsActiveWindow,rn as useModalActive,we as usePageSearch,_r as useUndo,Gr as useUndoCanEdit,Qr as useUndoable,Zr as useUndoableState,_t as useWidgetSettings,qe as useWindowDirty,He as useWindowManager,Qt as useWindowMenuItem,en as useWindowTitle,jn as windowHoldsChanges};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-P5BOTIJU.js";import{CartesianPlot as t}from"./chunk-
|
|
2
|
-
return s(t,{labels:d,values:
|
|
1
|
+
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-P5BOTIJU.js";import{CartesianPlot as t}from"./chunk-PPSIMRJM.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-OVNRVFWS.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:j,tone:v,label:L,className:M,emptyLabel:O,radius:N=3}){const V=o().charts,F=n(),P=w??(e=>h(e,F)),R=L??V.range,W=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),A=r(0,j,v);/* @__PURE__ */
|
|
2
|
+
return s(t,{labels:d,values:W,height:k,width:g,max:b,min:x,formatValue:P,yAxisLabel:y,className:M,emptyLabel:O,bandPadding:"bar"===p?.34:0,ariaLabel:V.rangeLabel(R,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:V.high,color:A,value:null==u[e]?void 0:P(u[e].high)},{key:"low",label:V.low,color:A,value:null==u[e]?void 0:P(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:N,fill:A,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
|
|
3
3
|
return m(c,{children:[
|
|
4
|
-
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:
|
|
5
|
-
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:
|
|
6
|
-
/* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:
|
|
4
|
+
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:A,fillOpacity:.2,stroke:"none"}),
|
|
5
|
+
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:A,strokeWidth:2,strokeLinejoin:"round"}),
|
|
6
|
+
/* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:A,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==r&&/* @__PURE__ */s("line",{x1:l.center(r),y1:t(u[r].high),x2:l.center(r),y2:t(u[r].low),stroke:a.axis,strokeWidth:1})]})})}export{u as RangeChart};
|