semiotic 3.10.2 → 3.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -27
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/behaviorContracts.cjs +1 -1
- package/ai/dist/mcp-server.js +1 -1
- package/ai/reference.md +4 -4
- package/ai/schema.json +1 -1
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +1 -1
- package/ai/task-packets/compare-category-totals.json +4 -4
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +4 -4
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +4 -4
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/{c-AKLBQMQF.min.js → c-43XNOQNQ.min.js} +50 -50
- package/dist/{c-PZ3NEGNG.min.js → c-5PIKBUMF.min.js} +1 -1
- package/dist/{c-FDUQDCBC.min.js → c-CO4NDAD6.min.js} +23 -23
- package/dist/c-FHNY57SO.min.js +209 -0
- package/dist/c-FMCUQ6JX.min.js +1 -0
- package/dist/{c-C4KIXUWU.min.js → c-GK263BF4.min.js} +1 -1
- package/dist/{c-TTKWXGAI.min.js → c-HNHKIMIV.min.js} +3 -3
- package/dist/c-IJCZGUG6.min.js +31 -0
- package/dist/{c-7LY46QUI.min.js → c-ISA6IJ6V.min.js} +7 -7
- package/dist/{c-4MD53L2J.min.js → c-JC76YAHB.min.js} +28 -28
- package/dist/{c-VXIYF7V2.min.js → c-JOPGDP6N.min.js} +1 -1
- package/dist/c-KXH7LFIL.min.js +26 -0
- package/dist/c-M43PK7K4.min.js +1 -0
- package/dist/{c-7ASK4WBF.min.js → c-PITYSOPK.min.js} +1 -1
- package/dist/{c-2TW5H5PD.min.js → c-QPO24R7Q.min.js} +1 -1
- package/dist/{c-KGROWFT2.min.js → c-SAP5KY6R.min.js} +2 -2
- package/dist/c-UMGHCBH5.min.js +114 -0
- package/dist/{c-6ZU3QVLB.min.js → c-VEMCBQZZ.min.js} +33 -33
- package/dist/{c-IPYGNVN6.min.js → c-WD2RL76M.min.js} +45 -45
- package/dist/{c-PQOZPM4G.min.js → c-YL7HJL5J.min.js} +1 -1
- package/dist/c-Z6GRGS53.min.js +1 -0
- package/dist/{c-SG2Y7EBY.min.js → c-ZVOFLE2P.min.js} +6 -6
- package/dist/components/CategoryColors.d.ts +7 -0
- package/dist/components/LinkedCharts.d.ts +2 -1
- package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -1
- package/dist/components/data/transforms.d.ts +1 -0
- package/dist/geo.min.js +3 -3
- package/dist/geo.module.min.js +10 -10
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +7 -7
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +903 -902
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -2
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +65 -65
- package/dist/semiotic-server-edge.min.js +64 -64
- package/dist/semiotic-server-edge.module.min.js +80 -80
- package/dist/semiotic-server-node.min.js +64 -64
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic.module.min.js +10 -10
- package/dist/server.min.js +64 -64
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +5 -5
- package/dist/c-72CBVNYX.min.js +0 -209
- package/dist/c-F2GGJB2S.min.js +0 -31
- package/dist/c-G53AVC42.min.js +0 -113
- package/dist/c-HQ27AHMC.min.js +0 -1
- package/dist/c-IHWZ2C6D.min.js +0 -26
- package/dist/c-MOP2NGLH.min.js +0 -1
- package/dist/c-PKY4JFY5.min.js +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function e(e){return`${e.getUTCFullYear()}-${t(e.getUTCMonth()+1)}-${t(e.getUTCDate())}`}function t(e){return 10>e?"0"+e:e+""}function i(e){return"function"==typeof e?e:t=>t[e]}function n(e,t,i){let n=e?.data,s=n?n[t]:void 0;if(null!=s)return s;let r=e?.[t];return r??i}function s(e){return null==e?null:e.data??e.datum??e}function r(e,t){let i=/* @__PURE__ */new Map;for(let n of e){let e=t(n),s=i.get(e);s?s.push(n):i.set(e,[n])}return i}function o(e){let t=/* @__PURE__ */Object.create(null);return e((e,i)=>{t[e]=i}),t}function a(e,t){if(!t)return!0;let i=Array.isArray(t)?t:[t],n=e;for(let e of i)if(null!=e.value&&n[e.field]+""!=e.value+"")return!1;return!0}function l(e,t={}){let i=t.baseOpacity??1;return t.highlight||t.predicate?!a(e,t.highlight)||t.predicate&&!t.predicate(e)?t.dimOpacity??.16:Math.min(1,i+(t.brighten??0)):i}function d(e){return e.join("|")}function h(e,t=.72){let i=Qi(e,"#ffffff"),n=Qi(e,"#000000"),s=Qi(e,e)(0);return e=>{let r=0>e?0:e>1?1:e;return.5===r?s:.5>r?i(2*(.5-r)*t):n(2*(r-.5)*t)}}function u(e,t,i=.72){return h(e,i)(t)}function c(e){return o(t=>{for(let[i,n]of Object.entries(e))t(i,n)})}function p(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}function f(e,t,i){return Math.max(t,Math.min(i,e))}function m(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}function y(e){if(0===e.length)return 0;let t=0;for(let i of e)t+=i;return t/e.length}function x(e,t){let i=f(t,0,1),n=e.trim().replace(/^#/,""),s=3===n.length?n.split("").map(e=>e+e).join(""):n;return/^[0-9a-fA-F]{6}$/.test(s)?`rgba(${parseInt(s.slice(0,2),16)}, ${parseInt(s.slice(2,4),16)}, ${parseInt(s.slice(4,6),16)}, ${i})`:e}function g(e){/* @__PURE__ */
|
|
2
|
+
return Ji("rect",{className:e.className,x:e.x,y:e.y,width:Math.max(0,e.width),height:Math.max(0,e.height),rx:e.radius??10,ry:e.radius??10,fill:e.fill??"none",stroke:e.stroke,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray,opacity:e.opacity??.6,style:{pointerEvents:"none"}},e.keyId)}function b(e,t=0){let i=1/0,n=1/0,s=-1/0,r=-1/0;for(let t of e){let e=t.r??0;i>t.x-e&&(i=t.x-e),t.x+e>s&&(s=t.x+e),n>t.y-e&&(n=t.y-e),t.y+e>r&&(r=t.y+e)}return Number.isFinite(i)?{x:i-t,y:n-t,width:s-i+2*t,height:r-n+2*t}:null}function v(e,t=0){if(!e.length)return null;let i="number"==typeof t?t:t.x??0,n="number"==typeof t?t:t.y??0,s=1/0,r=1/0,o=-1/0,a=-1/0;for(let t of e){if(!(Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.width)&&Number.isFinite(t.height)))continue;let e=Math.max(0,t.width),i=Math.max(0,t.height);s>t.x&&(s=t.x),r>t.y&&(r=t.y),t.x+e>o&&(o=t.x+e),t.y+i>a&&(a=t.y+i)}return Number.isFinite(s)?{x:s-i,y:r-n,width:o-s+2*i,height:a-r+2*n}:null}function w(e){let t=e.fontSize??12;return null!=e.maxWidth&&e.text.length*t*.56>e.maxWidth?null:/* @__PURE__ */Ji("text",{className:e.className,x:e.x,y:e.y,textAnchor:e.anchor??"middle",dominantBaseline:e.baseline??"middle",fontSize:t,fontWeight:e.fontWeight,fill:e.color,style:{pointerEvents:"none"},children:e.text},e.keyId)}function S(e){let t=e.spacing??8;return{def:/* @__PURE__ */Ji("pattern",{id:e.id,width:t,height:t,patternUnits:"userSpaceOnUse",patternTransform:`rotate(${e.angle??45})`,children:/* @__PURE__ */Ji("line",{x1:0,y1:0,x2:0,y2:t,stroke:e.color??"currentColor",strokeWidth:e.strokeWidth??1,opacity:e.opacity??.5})},e.id),fill:`url(#${e.id})`}}function M(e){let t=e.orient??"bottom",i="bottom"===t||"top"===t,n=e.offset??0,s=e.tickLength??6,r=e.gridLength??0,o=e.labelGap??4,a=e.fontSize??11,l=e.color??"var(--semiotic-text-secondary, #888)",d=e.gridColor??l,h=e.format??(e=>e+""),u="top"===t||"left"===t?-1:1,c=e.ticks.length-1,p=e.ticks.map((p,f)=>{let m,y=e.scale(p),x=n+u*s,g=n-u*r,b=x+u*o;m=e.labelAnchor?e.labelAnchor:i?e.edgeAnchor&&0===f?"start":e.edgeAnchor&&f===c?"end":"middle":"left"===t?"end":"start";let v=i?"top"===t?"auto":"hanging":"middle",w=i?{x:y,y:b}:{x:b,y:y};/* @__PURE__ */
|
|
3
|
+
return en("g",{children:[(s>0||r>0)&&/* @__PURE__ */Ji("line",{...i?{x1:y,x2:y,y1:x,y2:g}:{x1:x,x2:g,y1:y,y2:y},stroke:r>0?d:l,strokeWidth:1,strokeDasharray:r>0?e.gridDasharray:void 0,opacity:r>0?.7:1}),
|
|
4
|
+
/* @__PURE__ */Ji("text",{x:w.x,y:w.y,textAnchor:m,dominantBaseline:v,fontSize:a,fontWeight:e.fontWeight,fill:l,children:h(p)})]},`tick-${p}-${f}`)});/* @__PURE__ */
|
|
5
|
+
return Ji("g",{className:e.className,style:{pointerEvents:"none"},children:p},e.keyId)}function k(e){let t,i=e.stroke??"var(--semiotic-text, #f4f4f8)",n=e.strokeWidth??1,s=e.markRadius??0,r=e.labelX-e.markX,o=e.labelY-e.markY,a=Math.hypot(r,o)||1,l=e.markX+r/a*s,d=e.markY+o/a*s;return t="elbow"===e.connector?`M${l},${d} L${l},${e.labelY} L${e.labelX},${e.labelY}`:"curve"===e.connector?`M${l},${d} Q${(l+e.labelX)/2},${d} ${e.labelX},${e.labelY}`:`M${l},${d} L${e.labelX},${e.labelY}`,/* @__PURE__ */en("g",{className:e.className,style:{pointerEvents:"none"},children:[s>0&&/* @__PURE__ */Ji("circle",{cx:e.markX,cy:e.markY,r:s,fill:"none",stroke:i,strokeWidth:n}),
|
|
6
|
+
/* @__PURE__ */Ji("path",{d:t,fill:"none",stroke:i,strokeWidth:n}),
|
|
7
|
+
/* @__PURE__ */Ji("text",{x:e.labelX,y:e.labelY,textAnchor:e.labelAnchor??"middle",dominantBaseline:e.labelBaseline??"hanging",fontSize:e.fontSize??11,fontWeight:e.fontWeight,fill:e.color??i,children:e.label})]},e.keyId)}function I(e){let t=e>>>0;return function(){t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function O(e){if(!e||"object"!=typeof e)return!1;let t=e;return"string"==typeof t.id&&(null==t.label||"string"==typeof t.label)&&"number"==typeof t.count&&Number.isFinite(t.count)&&Array.isArray(t.bodyIds)&&t.bodyIds.every(e=>"string"==typeof e)}function A(e,t){if("region-enter"!==t.type)return e;let i=t.region.id,n=B(e,i),s=O(n)?n:{id:i,label:t.region.label??i,count:0,bodyIds:[]};if(s.bodyIds.includes(t.bodyId))return e;let r=[...s.bodyIds,t.bodyId];return{...e,[i]:{...s,count:r.length,bodyIds:r}}}function C(e,t){return(t??Object.keys(e)).map(t=>B(e,t)).filter(O).map(e=>({label:e.label??e.id,value:e.count}))}function $(e,t){let i=t instanceof Set?t:new Set(t);return e.map(e=>{let t=e.bodyIds??[],n=t.filter(e=>!i.has(e)),s=t.length-n.length,r=e.completion?.mode??"allMembersAbsorbed",o=e.completion?.valueByBodyId,a=e=>{let t=o?B(o,e):void 0;return"number"==typeof t&&Number.isFinite(t)&&t>=0?t:1},l=t.reduce((e,t)=>e+a(t),0),d=t.reduce((e,t)=>e+(i.has(t)?a(t):0),0),h=e.completion?.threshold,u="threshold"===r?Number.isFinite(h)&&Number(h)>=0?Number(h):l:void 0;return{id:e.id,label:e.label??e.id,mode:r,complete:t.length>0&&("anyAbsorbed"===r?s>0:"threshold"===r?d>=(u??l):0===n.length),absorbed:s,total:t.length,absorbedValue:d,totalValue:l,threshold:u,missing:n}})}function q(e,t,i){return Math.max(t,Math.min(i,e))}function P(e){let t=e.reduce((e,t)=>e+(t.share??1),0);return t>0?t:e.length}function N(e,t,i,n,s,r={}){return{id:e,friction:r.friction,restitution:r.restitution,bodyFilter:r.bodyFilter,shape:{type:"segment",x1:t,y1:i,x2:n,y2:s,thickness:r.thickness??8}}}function F(e,t,i,n){return{type:"aabb",x:e,y:t,width:i,height:n}}function D(e){let t=e.shape??"lane",i=Math.max(1,Math.round(e.width)),n=Math.max(1,Math.round(e.height)),s=e.padX??46,r=e.padY??72,o=s,a=i-s,l=r,d=n-Math.max(24,Math.round(.45*r)),h=(l+d)/2,u=Math.max(1,d-l),c=q(e.pinchRatio??.18,.06,.5),p=Number(e.pinchHeightOffset??0),f=Number.isFinite(p)?p:0,m=q(u*c+f,.06*u,.5*u),y=m/2,x=h-y,g=h+y,b=e.idPrefix??"process",v=e.friction??.58,w=e.restitution??.18,S=e.wallThickness??8,M=e.stages;if(!M.length)throw Error("processStageLayout requires at least one stage");let k=q(e.centerStageIndex??Math.floor(M.length/2),0,M.length-1),I=P(M),B=a-o,O=o,A=M.map((e,t)=>{let i=O,n=t===M.length-1?a:O+(e.share??1)/I*B;return O=n,{id:e.id,label:e.label,description:e.description,kind:e.kind??"stage",index:t,x0:i,x1:n,x:(i+n)/2,width:n-i,y:h,height:u}}),C=A[k],$=C.x0,F=C.x1,D=(e,i)=>{if("lane"===t)return"top"===i?l:d;if("funnel"===t){let t=q((e-o)/Math.max(1,a-o),0,1);return"top"===i?l+(x-l)*t:d+(g-d)*t}if($>=e){let t=q((e-o)/Math.max(1,$-o),0,1);return"top"===i?l+(x-l)*t:d+(g-d)*t}if(F>=e)return"top"===i?x:g;let n=q((e-F)/Math.max(1,a-F),0,1);return"top"===i?x+(l-x)*n:g+(d-g)*n},T=A.map(e=>{let t=Math.min(D(e.x0,"top"),D(e.x1,"top")),i=Math.max(D(e.x0,"bottom"),D(e.x1,"bottom"));return{...e,y:(t+i)/2,height:Math.max(1,i-t)}}),L={thickness:S,friction:v,restitution:w},E=[];"lane"===t?E.push(N(b+"-top",o,l,a,l,L),N(b+"-bottom",o,d,a,d,L),N(b+"-left",o,l,o,d,{...L,thickness:Math.max(6,S-2)}),N(b+"-right",a,l,a,d,{...L,thickness:Math.max(6,S)})):"funnel"===t?E.push(N(b+"-top",o,l,a,x,L),N(b+"-bottom",o,d,a,g,L),N(b+"-left",o,l,o,d,{...L,thickness:Math.max(6,S-2)}),N(b+"-right",a,x,a,g,{...L,thickness:Math.max(6,S)})):E.push(N(b+"-left-top",o,l,$,x,L),N(b+"-left-bottom",o,d,$,g,L),N(b+"-center-top",$,x,F,x,L),N(b+"-center-bottom",$,g,F,g,L),N(b+"-right-top",F,x,a,l,L),N(b+"-right-bottom",F,g,a,d,L),N(b+"-left",o,l,o,d,{...L,thickness:Math.max(6,S-2)}),N(b+"-right",a,l,a,d,{...L,thickness:Math.max(6,S)}));let R=e.membraneDampingScale??.5,Y=o,W=Math.max(1,("bowtie"===t?$:a)-Y),X=(e.membranes??[]).map(e=>{let t=Y+q(e.offset,0,1)*W,i=e.width??18+18*e.cost,n=u-16,s=h+.25*(e.wobble??0);return{...e,x:t,y:s,width:i,height:n}}),z=!1===e.includeMembraneRegions?[]:X.map(e=>j({id:e.id,label:e.label??e.id,description:e.description??(e.label??e.id)+" is a permeable region. It taxes energy and damps velocity while bodies overlap it.",x:e.x,y:e.y,width:e.width,height:e.height,cost:e.cost,dampingScale:e.dampingScale??R,bodyStyle:e.bodyStyle,metadata:e.metadata,semanticItem:e.semanticItem,color:e.color}));return{shape:t,width:i,height:n,padX:s,padY:r,left:o,right:a,topY:l,bottomY:d,midY:h,centerLeft:$,centerRight:F,pinchHeight:m,pinchTop:x,pinchBottom:g,stages:T,membranes:X,colliders:E,regionEffects:z,boundaryY:D}}function T(e){return{id:e.id,label:e.label,description:e.description,kind:e.kind,shape:F(e.x,e.y,e.width,e.height),bodyFilter:e.bodyFilter,collider:e.collider,colliderThickness:e.colliderThickness,friction:e.friction,restitution:e.restitution,semanticItem:e.semanticItem,metadata:e.metadata,bodyStyle:e.bodyStyle,attributes:e.attributes,onEnter:e.onEnter,onExit:e.onExit}}function L(e,t={}){let i=t.idPrefix??"stage",n=Math.max(0,t.insetX??0),s=Math.max(0,t.insetY??1);return e.stages.map(e=>{let r="function"==typeof t.metadata?t.metadata(e):t.metadata??{};return{...T({id:i?`${i}:${e.id}`:e.id,label:e.label??e.id,description:e.description,kind:"region",x:e.x,y:e.y,width:Math.max(1,e.width-2*n),height:Math.max(1,e.height-2*s),bodyFilter:t.bodyFilter,semanticItem:t.semanticItem,attributes:{primitive:"processStage",stageId:e.id,stageIndex:e.index},metadata:{...r,primitive:"processStage",stageId:e.id,stageIndex:e.index}})}})}function j(e){let t=e.dampingScale??.5,i=e.energyScale??1,n=q(e.cost,0,2);return{...T({...e,kind:e.kind??"membrane",attributes:{primitive:"membrane",membraneCost:n,..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),damping:n*t,energyDelta:-n*i}}function E(e){return{...T({...e,kind:e.kind??"charge-gate",attributes:{primitive:"chargeGate",..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),charge:e.charge??!0,energyDelta:e.energyDelta,impulseOnEnter:e.impulseOnEnter}}function R(e){let t="number"==typeof e.force?{x:e.force,y:0}:e.force??{x:12,y:0};return{...T({...e,kind:e.kind??"force-field",attributes:{primitive:"routeSurface",..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:t,damping:e.damping??.015}}function Y(e){let t=e.pressure??e.occupancy??0,i=e.baseDamping??.08,n=e.dampingPerUnit??.12,s=e.energyPerUnit??0;return{...T({...e,kind:e.kind??"membrane",attributes:{primitive:"pressureField",pressure:t,..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),damping:i+t*n,energyDelta:s?-t*s:void 0,force:e.force}}function W(e){let t="number"==typeof e.force?{x:e.force,y:0}:e.force;return{...T({...e,kind:e.kind??"force-field",attributes:{primitive:"capacitatedSensor",capacity:e.capacity,unitsPerSecond:e.unitsPerSecond??e.capacity,..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:t,damping:e.damping,charge:e.charge??e.capacity}}function X(e){return{...T({...e,kind:e.kind??"force-field",attributes:{primitive:"portal",targetStage:e.targetStage,..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:e.force,impulseOnEnter:e.impulseOnEnter,damping:e.damping??.08}}function z(e){let t="number"==typeof e.force?{x:e.force,y:0}:e.force??{x:24,y:0};return{...T({...e,kind:e.kind??"sink",attributes:{primitive:"absorb",..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:t,damping:e.damping??.02,charge:e.charge??"absorbed"}}function G(e){return{...T({...e,kind:e.kind??"force-field",attributes:{primitive:"forceField",..."object"==typeof e.attributes&&e.attributes?e.attributes:{}}}),force:e.force,damping:e.damping,energyDelta:e.energyDelta}}function H(e){let t=e.x??e.anchor?.x??0,i=e.y??e.anchor?.y??0;return{id:e.id,label:e.label,description:e.description,group:e.group,bodyIds:e.bodyIds,datum:e.datum,state:e.state,x:t,y:i,width:e.width,height:e.height,anchor:e.anchor??{x:t,y:i},completion:e.completion,tether:e.tether,semanticItem:e.semanticItem}}function K(e){let t=e.idPrefix??"lane",i={thickness:e.thickness??8,friction:e.friction??.5,restitution:e.restitution??.16},n=[N(t+"-top",e.left,e.top,e.right,e.top,i),N(t+"-bottom",e.left,e.bottom,e.right,e.bottom,i)];return e.openEnds||n.push(N(t+"-left",e.left,e.top,e.left,e.bottom,i),N(t+"-right",e.right,e.top,e.right,e.bottom,i)),n}function U(e,t,i){return Math.max(t,Math.min(i,e))}function _(e){return 6.2*e.length}function V(e,t){let i=e.trim();if(t>=i.length)return i;if(1>=t)return i.slice(0,1);let n=i.split(/\s+/).filter(Boolean).map(e=>e[0]).join("").toUpperCase();return n.length>1&&t>=n.length?n:t>3?i.slice(0,Math.max(1,t-2))+"..":i.slice(0,t).toUpperCase()}function Q(e,t,i="auto"){let n=Math.max(1,Math.floor(t/6.2)),s="compact"===i||"full"!==i&&_(e)>t?V(e,n):e;return{text:s,textLength:_(s)>t?Math.max(4,t):void 0}}function Z(e){return e.absorb?"absorb":e.portalTarget?"portal":null!=e.capacity?"capacity":"flow"}function J(e){if(null!=e.capacity){let t=null!=e.queueDepth?" · q "+e.queueDepth:"";return e.capacityLabel?`${e.capacityLabel}${t}`:`cap ${Number.isInteger(e.capacity)?e.capacity+"":e.capacity.toFixed(1)}${t}`}return e.absorb?"absorb":e.portalTarget?"portal":"flow"}function ee(e,t={}){let{showFlowSpine:i=!0,showStageCounts:n=!0,showCapacityBadges:s=!0,showGroupSockets:r=!0,stageLabelMode:o="auto",outlineStages:a=!1,testId:l="process-flow-chrome"}=t,{width:d,height:h,left:u,right:c,topY:p,bottomY:f,midY:m,stages:y,groups:x=[]}=e,g=f-p;/* @__PURE__ */
|
|
8
|
+
return an("svg",{"aria-hidden":"true","data-testid":l,"data-outline-stages":a?"true":void 0,width:d,height:h,viewBox:`0 0 ${d} ${h}`,style:{position:"absolute",inset:0,pointerEvents:"none"},className:["semiotic-process-chrome",a?"semiotic-process-chrome--outline-stages":null].filter(Boolean).join(" "),children:[
|
|
9
|
+
/* @__PURE__ */on("defs",{children:/* @__PURE__ */an("linearGradient",{id:"semiotic-process-floor",x1:"0",x2:"0",y1:"0",y2:"1",children:[
|
|
10
|
+
/* @__PURE__ */on("stop",{offset:"0%",stopColor:"var(--semiotic-process-floor, var(--semiotic-bg, #0f172a))",stopOpacity:"0.2"}),
|
|
11
|
+
/* @__PURE__ */on("stop",{offset:"100%",stopColor:"var(--semiotic-process-lane, var(--semiotic-surface, #1e293b))",stopOpacity:"0.55"})]})}),
|
|
12
|
+
/* @__PURE__ */on("rect",{x:0,y:0,width:d,height:h,fill:"url(#semiotic-process-floor)"}),
|
|
13
|
+
/* @__PURE__ */on("rect",{x:u-6,y:p-8,width:c-u+12,height:g+16,rx:14,fill:"var(--semiotic-process-lane, var(--semiotic-surface, #111827))",fillOpacity:.45,stroke:"var(--semiotic-process-border, var(--semiotic-border, #334155))",strokeOpacity:.95}),i?/* @__PURE__ */on("line",{x1:u+8,x2:c-8,y1:m,y2:m,stroke:"var(--semiotic-process-border, var(--semiotic-border, #475569))",strokeWidth:2,strokeDasharray:"6 8",opacity:.55}):null,y.map((e,t)=>{let i=Z(e),r=ln[i],l=Math.max(12,e.width-8),d=U(l-8,22,88),u=Q(e.label,Math.max(8,d-10),o),c="none"!==o&&l-8>=22,x=J(e),b=Q(x,Math.max(16,l-10),"auto"),v=s&&!1!==e.showBadge&&l>=32,w=null!=e.count?`n=${e.count}${null!=e.processed?" done "+e.processed:""}`:"",S=Q(w,Math.max(16,l-8),"auto"),M=Math.max(30,p-15),k=M-13;/* @__PURE__ */
|
|
14
|
+
return an("g",{"data-stage":e.id,"data-role":i,children:[
|
|
15
|
+
/* @__PURE__ */on("rect",{className:"semiotic-process-chrome__stage-bay",x:e.x0+4,y:p+6,width:l,height:g-12,rx:10,fill:a?"none":r.fill,stroke:r.stroke,strokeWidth:a?1.85:"flow"===i?1:1.6}),y.length-1>t?/* @__PURE__ */on("polygon",{points:`${e.x1-2},${m-7} ${e.x1+8},${m} ${e.x1-2},${m+7}`,fill:r.accent,opacity:.85}):null,c?/* @__PURE__ */an(rn,{children:[
|
|
16
|
+
/* @__PURE__ */on("rect",{className:"semiotic-process-chrome__stage-label-bg",x:e.x-d/2,y:k,width:d,height:18,rx:9,fill:"var(--semiotic-bg, #0f172a)",fillOpacity:.75,stroke:r.stroke}),
|
|
17
|
+
/* @__PURE__ */an("text",{x:e.x,y:M,textAnchor:"middle",fill:r.accent,fontSize:10,fontWeight:800,className:"semiotic-process-chrome__stage-label",textLength:u.textLength,lengthAdjust:u.textLength?"spacingAndGlyphs":void 0,children:[
|
|
18
|
+
/* @__PURE__ */on("title",{children:e.label}),u.text]})]}):null,v?/* @__PURE__ */an("text",{x:e.x,y:p+22,textAnchor:"middle",fill:"var(--semiotic-process-muted, var(--semiotic-text-secondary, #94a3b8))",fontSize:9,fontWeight:700,textLength:b.textLength,lengthAdjust:b.textLength?"spacingAndGlyphs":void 0,children:[
|
|
19
|
+
/* @__PURE__ */on("title",{children:x}),b.text]}):null,n&&null!=e.count?/* @__PURE__ */an("text",{x:e.x,y:Math.min(h-8,f+16),textAnchor:"middle",fill:"var(--semiotic-process-text, var(--semiotic-text, #e2e8f0))",fontSize:11,fontWeight:800,textLength:S.textLength,lengthAdjust:S.textLength?"spacingAndGlyphs":void 0,children:[
|
|
20
|
+
/* @__PURE__ */on("title",{children:w}),S.text]}):null]},e.id)}),r?x.map((e,t)=>{let i=e.total??0,n=e.absorbed??0,s=e.complete??(i>0&&n>=i),r=!s&&i>0&&n/i>=.75,o=s?"rgba(52, 211, 153, 0.35)":r?"rgba(251, 191, 36, 0.28)":"rgba(15, 23, 42, 0.75)",a=s?"#34d399":r?"#fbbf24":"var(--semiotic-border, #64748b)",l=i>0?`${n}/${i}${s?" shipped":r?" almost":""}`:"feature "+(t+1),d=U(Math.max(54,_(e.label)+18,_(l)+16),54,104),h=Q(e.label,d-12,"auto"),u=Q(l,d-12,"auto");/* @__PURE__ */
|
|
21
|
+
return an("g",{"data-group":e.id,children:[
|
|
22
|
+
/* @__PURE__ */on("rect",{x:e.x-d/2,y:e.y-22,width:d,height:44,rx:10,fill:o,stroke:a,strokeWidth:1.5}),
|
|
23
|
+
/* @__PURE__ */an("text",{x:e.x,y:e.y-4,textAnchor:"middle",fill:"var(--semiotic-process-text, var(--semiotic-text, #f8fafc))",fontSize:10,fontWeight:800,textLength:h.textLength,lengthAdjust:h.textLength?"spacingAndGlyphs":void 0,children:[
|
|
24
|
+
/* @__PURE__ */on("title",{children:e.label}),h.text]}),
|
|
25
|
+
/* @__PURE__ */an("text",{x:e.x,y:e.y+12,textAnchor:"middle",fill:a,fontSize:9,fontWeight:700,textLength:u.textLength,lengthAdjust:u.textLength?"spacingAndGlyphs":void 0,children:[
|
|
26
|
+
/* @__PURE__ */on("title",{children:l}),u.text]})]},e.id)}):null]})}function te(e,t){let i="function"==typeof t?t(e):e[t];return dn(i)?i:void 0}function ie(e){return[...e].sort((e,t)=>e.localeCompare(t))}function ne(e,t){let i=new Map(e.map(e=>[e,/* @__PURE__ */new Set]));for(let e of t)!i.has(e.source)||!i.has(e.target)||(i.get(e.source)?.add(e.target),i.get(e.target)?.add(e.source));return i}function se(e){let t=new Set(e.keys()),i=[];for(;t.size>0;){let n=ie(t)[0],s=[n],r=[];for(t.delete(n);s.length>0;){let i=s.shift();r.push(i);for(let n of ie(e.get(i)??[]))t.has(n)&&(t.delete(n),s.push(n))}i.push(r.sort((e,t)=>e.localeCompare(t)))}return i.sort((e,t)=>t.length-e.length||e[0].localeCompare(t[0]))}function re(e,t,i){let n=/* @__PURE__ */new Map([[e,0]]),s=[e];for(;s.length>0;){let e=s.shift(),r=n.get(e);for(let o of ie(i.get(e)??[]))!t.has(o)||n.has(o)||(n.set(o,r+1),s.push(o))}return n}function oe(e,t,i){return[...re(e,t,i).entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))[0][0]}function ae(e,t,i){let n=new Set(e),s=e.filter(e=>1>=(t.get(e)?.size??0))[0]??e[0],r=re(i&&n.has(i)?i:oe(oe(s,n,t),n,t),n,t),o=Math.max(0,...r.values()),a=Array.from({length:o+1},()=>[]);for(let t of e)a[r.get(t)??0].push(t);a.forEach(e=>e.sort((e,t)=>e.localeCompare(t)));let l=(e,i)=>{let n=new Map(a[i].map((e,t)=>[e,t])),s=e=>{let i=[...t.get(e)??[]].map(e=>n.get(e)).filter(e=>null!=e);return 0===i.length?1/0:i.reduce((e,t)=>e+t,0)/i.length};a[e].sort((e,t)=>s(e)-s(t)||e.localeCompare(t))};for(let e=0;4>e;e+=1){for(let e=1;a.length>e;e+=1)l(e,e-1);for(let e=a.length-2;e>=0;e-=1)l(e,e+1)}return a}function le(e,t,i,n,s,r){let o=ne(e.map(e=>e.id),t),a=se(o),l=new Map(e.map(e=>[e.id,e.data])),d=/* @__PURE__ */new Map,h=Math.max(0,i.width),u=Math.max(0,i.height),c=Math.min(n,h/2),p=Math.min(n,u/2),f=Math.max(0,u-2*p),m=a.length>1?Math.min(s,f/a.length):0,y=Math.max(0,f-m*Math.max(0,a.length-1)),x=a.reduce((e,t)=>e+Math.sqrt(t.length),0),g=p;for(let e of a){let t=y*(Math.sqrt(e.length)/x),i=ae(e,o,r),n=Math.max(0,h-2*c);i.forEach((e,s)=>{let r=1===i.length?h/2:c+s/(i.length-1)*n;e.forEach((i,n)=>{d.set(i,{id:i,x:r,y:1===e.length?g+t/2:g+n/(e.length-1)*t,data:l.get(i)})})}),g+=t+m}return d}function de(e,t,i,n={}){let s=Math.max(0,n.padding??36),r=Math.max(0,n.componentGap??26),o=n.xAccessor??"x",a=n.yAccessor??"y",l=e.map(e=>({...e,authoredX:te(e.data,o),authoredY:te(e.data,a)})),d=l.length>0&&l.every(e=>dn(e.authoredX)&&dn(e.authoredY)),h="authored"===n.layoutMode||"automatic"!==n.layoutMode&&d,u=[];if(h&&!d&&u.push("Authored transit layout requested, but at least one station has no finite x/y position; using automatic topology layout."),!h||!d){!d&&"automatic"!==n.layoutMode&&u.push("Complete station positions were not supplied; using the deterministic automatic topology layout.");let o=le(e,t,i,s,r,n.rootId);if("right-to-left"===n.direction)for(let e of o.values())e.x=i.width-e.x;return{positions:o,mode:"automatic",warnings:u,projectAuthoredPoint:e=>e}}let c=l.map(e=>e.authoredX),p=l.map(e=>e.authoredY),f=Math.min(...c),m=Math.max(...c),y=Math.min(...p),x=Math.max(...p),g=Math.max(1,i.width-2*s),b=Math.max(1,i.height-2*s),v=e=>({x:m===f?i.width/2:s+(e.x-f)/(m-f)*g,y:x===y?i.height/2:s+(e.y-y)/(x-y)*b}),w=/* @__PURE__ */new Map;for(let e of l){let t=v({x:e.authoredX,y:e.authoredY});w.set(e.id,{id:e.id,...t,data:e.data})}return{positions:w,mode:"authored",warnings:u,projectAuthoredPoint:v}}function he(e,t){let i=t.x-e.x,n=t.y-e.y,s=Math.abs(i),r=Math.abs(n);if(.001>s||.001>r||.001>Math.abs(s-r))return[e,t];let o=Math.sign(i),a=Math.sign(n);if(s>r){let i=(s-r)/2;return[e,{x:e.x+o*i,y:e.y},{x:t.x-o*i,y:t.y},t]}let l=(r-s)/2;return[e,{x:e.x,y:e.y+a*l},{x:t.x,y:t.y-a*l},t]}function ue(e,t){if(0===t||2>e.length)return e.map(e=>({...e}));let i=(e,t)=>{let i=t.x-e.x,n=t.y-e.y,s=Math.hypot(i,n)||1;return{x:-n/s,y:i/s}};return e.map((n,s)=>{let r=s>0?i(e[s-1],n):null,o=e.length-1>s?i(n,e[s+1]):null;if(!r||!o){let e=o??r??{x:0,y:0};return{x:n.x+e.x*t,y:n.y+e.y*t}}let a=r.x+o.x,l=r.y+o.y,d=Math.hypot(a,l);if(.001>d)return{x:n.x+o.x*t,y:n.y+o.y*t};a/=d,l/=d;let h=a*o.x+l*o.y;if(.001>Math.abs(h))return{x:n.x+o.x*t,y:n.y+o.y*t};let u=4*Math.abs(t),c=Math.max(-u,Math.min(u,t/h));return{x:n.x+a*c,y:n.y+l*c}})}function ce(e,t){if(0===e.length)return"";if(1===e.length)return`M${e[0].x},${e[0].y}`;let i=Math.max(0,t),n=`M${e[0].x},${e[0].y}`;for(let t=1;e.length-1>t;t+=1){let s=e[t-1],r=e[t],o=e[t+1],a=Math.hypot(r.x-s.x,r.y-s.y),l=Math.hypot(o.x-r.x,o.y-r.y),d=Math.min(i,a/2,l/2);if(.001>=d){n+=` L${r.x},${r.y}`;continue}let h={x:r.x+(s.x-r.x)/a*d,y:r.y+(s.y-r.y)/a*d},u={x:r.x+(o.x-r.x)/l*d,y:r.y+(o.y-r.y)/l*d};n+=` L${h.x},${h.y} Q${r.x},${r.y} ${u.x},${u.y}`}let s=e[e.length-1];return`${n} L${s.x},${s.y}`}function pe(e){let t=[e[0]];for(let i=1;e.length-1>i;i++){let n=e[i-1],s=e[i],r=e[i+1],o=un(n,s),a=un(s,r),l=Math.min(8,o/2,a/2);if(0===l)continue;let d=hn(s,n,l/o),h=hn(s,r,l/a);t.push(d);for(let e=1;12>=e;e++){let i=e/12;t.push(hn(hn(d,s,i),hn(s,h,i),i))}}return t.push(e[e.length-1]),t.filter((e,i)=>0===i||un(t[i-1],e)>1e-8)}function fe(e,t,i){if(2>e.length)return"";let n=pe(e);if(2>n.length)return"";let s=[0];for(let e=1;n.length>e;e++)s.push(s[e-1]+un(n[e-1],n[e]));let r=s[s.length-1],o=ue(n,1),a=[1,-1].map(e=>n.map((n,a)=>hn(n,o[a],e*(t+(i-t)*s[a]/r)/2)));return[...a[0],...a[1].reverse()].map((e,t)=>`${0===t?"M":"L"}${e.x},${e.y}`).join(" ")+" Z"}function me(e){let t=-(e.reduce((e,t)=>e+t,0)+3*(e.length-1))/2;return e.map(e=>{let i=t+e/2;return t+=e+3,i})}function ye(e){let t="";return e.split(">").map((e,i)=>t=i?`${t}>${e}`:e)}function xe(e){let t=/* @__PURE__ */new Map;for(let i of e){let e=ye(i.signature);i.nodePath.forEach((n,s)=>{let r=e[s],o=t.get(r);o||(o={id:r,state:n,depth:s+1,signatures:/* @__PURE__ */new Set},t.set(r,o)),o.signatures.add(i.signature)})}return[...t.values()]}function ge(e){let{desired:t,minGaps:i,weights:n}=e,s=t.length;if(0===s)return[];if(i.length!==Math.max(0,s-1))throw Error("placeWithMinGap: minGaps must have desired.length - 1 entries");let r=Array(s).fill(0);for(let e=1;s>e;e++)r[e]=r[e-1]+Math.max(0,Number.isFinite(i[e-1])?i[e-1]:0);let o=[];for(let e=0;s>e;e++){let i=Math.max(Number.EPSILON,Number.isFinite(n?.[e])?n[e]:1),s=(Number.isFinite(t[e])?t[e]:0)-r[e];for(o.push({start:e,end:e,weight:i,mean:s});o.length>1;){let e=o[o.length-1],t=o[o.length-2];if(e.mean>=t.mean)break;let i=t.weight+e.weight;o.splice(o.length-2,2,{start:t.start,end:e.end,weight:i,mean:(t.mean*t.weight+e.mean*e.weight)/i})}}let a=Number.isFinite(e.min)?e.min:-1/0,l=Number.isFinite(e.max)?e.max-r[s-1]:1/0,d=a>l?a:l,h=Array(s);for(let e of o){let t=Math.max(a,Math.min(d,e.mean));for(let i=e.start;e.end>=i;i++)h[i]=t+r[i]}return h}function be(e,t){let i=0,n=e.length-1,s=-1;for(;n>=i;){let r=i+n>>>1;e[r].at>t?n=r-1:(s=r,i=r+1)}return 0>s?{at:t,before:0,after:0}:e[s]}function ve(e,t=0){if(0===e.length)return{adjacentClearance:[],positions:[]};let i=[],n=[0];for(let s=0;e.length-1>s;s++){let r=e[s],o=e[s+1],a=[.../* @__PURE__ */new Set([...r.map(e=>e.at),...o.map(e=>e.at)])].sort((e,t)=>e-t),l=0;for(let e of a){let t=be(r,e),i=be(o,e);l=Math.max(l,t.after+i.before)}i.push(l),n.push(n[n.length-1]+l+t)}return{adjacentClearance:i,positions:n}}function we(e,t,i,n={}){let s=[...e];if(1>=s.length)return s;let r=[...s],o=i(s),a=1,l=Math.max(0,n.passes??6),d=Math.max(1,n.maxEvaluations??1/0);for(let e=0;l>e&&d>a;e++){let e=new Map(s.map((e,t)=>[e,t])),l=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map;for(let i of t){let t=e.get(i.source),n=e.get(i.target);if(null==t||null==n)continue;let s=Number.isFinite(i.weight)&&i.weight>0?i.weight:1;l.set(i.source,(l.get(i.source)??0)+n*s),d.set(i.source,(d.get(i.source)??0)+s),l.set(i.target,(l.get(i.target)??0)+t*s),d.set(i.target,(d.get(i.target)??0)+s)}s=s.map((e,t)=>({item:e,index:t,barycenter:(l.get(e)??t)/(d.get(e)??1)})).sort((e,t)=>e.barycenter-t.barycenter||(n.compare?.(e.item,t.item)??e.index-t.index)).map(e=>e.item);let h=i(s);if(a++,o>h)o=h,r=[...s];else if(h===o)break}return r}function Se(e,t,i={}){let n=[...e];if(1>=n.length)return n;let s=t(n),r=1,o=Math.max(0,i.passes??6),a=Math.max(1,i.maxEvaluations??1/0);for(let e=0;o>e&&a>r;e++){let e=!1;for(let i=0;n.length-1>i&&a>r;i++){[n[i],n[i+1]]=[n[i+1],n[i]];let o=t(n);r++,s>o?(s=o,e=!0):[n[i],n[i+1]]=[n[i+1],n[i]]}if(!e)break}return n}function Me(e,t,i={}){let n=[...e],s=n.length;if(1>=s||s>(i.maxItems??8))return n;let r=Math.max(1,i.maxEvaluations??1/0),o=0,a=[...n],l=1/0,d=()=>{if(o>=r)return;let e=t(n);o++,l>e&&(l=e,a=[...n])};d();let h=Array(s).fill(0),u=0;for(;s>u&&r>o;)if(u>h[u]){let e=u%2==0?0:h[u];[n[e],n[u]]=[n[u],n[e]],d(),h[u]++,u=0}else h[u]=0,u++;return a}function ke(e,t,i=()=>!0){let n=0;for(let s=0;e.length>s;s++){let[r,o]=t(e[s]);for(let a=s+1;e.length>a;a++){if(!i(e[s],e[a]))continue;let[l,d]=t(e[a]);0>(r-l)*(o-d)&&n++}}return n}function Ie(e,t,i){if(i)return i;let n=e??"circle";if("chevron"===n)return Ce(t);let s=Object.prototype.hasOwnProperty.call(kn,n)?kn[n]:xn;return yn(s,Math.max(1,t))()??""}function Be(e){return Math.sqrt(Math.max(1,e)/Math.PI)}function Oe(e,t,i){if(!i&&"circle"===(e??"circle"))return Be(t);let n=i?"p:"+i:`s:${e??"circle"}:${t}`,s=On.get(n);if(null!=s)return s;let r=Ie(e,t,i).match(/-?\d*\.?\d+(?:e-?\d+)?/gi),o=0;if(r)for(let e=0;r.length>e+1;e+=2){let t=+r[e],i=+r[e+1],n=Math.sqrt(t*t+i*i);n>o&&(o=n)}return o>0?(On.size>512&&On.clear(),On.set(n,o),o):Be(t)}function Ae(e,t){let i=/* @__PURE__ */new Map,n=0;return s=>{let r=e(s)+"",o=t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(o&&In.has(o))return o;let a=i.get(r);return a||(a=Bn[n%Bn.length],n++,i.set(r,a)),a}}function Ce(e){let t=1.5*Be(e),i=.92*t;return`M0,${-t}L${i},${(.78*t).toFixed(3)}L0,${(.28*t).toFixed(3)}L${-i},${(.78*t).toFixed(3)}Z`}function $e(e,t){let[i,n]=e.viewBox??An,[s,r]=e.anchor??Cn,o=n>0?n:1,a=Math.max(0,t)/o,l=(i>0?i:o)*a,d=o*a;return{width:l,height:d,scale:a,offsetX:-s*l,offsetY:-r*d}}function qe(e,t){let i=$e(e,t),n=[[i.offsetX,i.offsetY],[i.offsetX+i.width,i.offsetY],[i.offsetX,i.offsetY+i.height],[i.offsetX+i.width,i.offsetY+i.height]],s=0;for(let[e,t]of n){let i=Math.sqrt(e*e+t*t);i>s&&(s=i)}return s}function Pe(e,t,i,n){if("none"!==e)return"color"===e||null==e?t??n:"accent"===e?i:e}function Ne(e,t,i=0,n="horizontal"){let[s,r]=e.viewBox??An,o=Math.min(1,Math.max(0,i)),a=Math.min(1,Math.max(0,t));return a>o?o>0||1>a?"vertical"===n?{x:0,y:r*(1-a),width:s,height:r*(a-o)}:{x:s*o,y:0,width:s*(a-o),height:r}:null:{x:0,y:0,width:0,height:0}}function Fe(e,t){let i=$e(e,t);return{centerDx:i.offsetX+i.width/2,centerDy:i.offsetY+i.height/2,halfWidth:i.width/2,halfHeight:i.height/2,radius:Math.hypot(i.width,i.height)/2}}function De(e){return"string"==typeof e?.type?e.type:""}function Te(e){return!!e&&"object"==typeof e&&$n.has(De(e))}function Le(e){return Te(e)}function je(e){return"primary"===e?.emphasis||!0===e?.defensive}function Ee(e,t,i){return Math.max(t,Math.min(i,e))}function Re(e,t,i={}){return"number"==typeof i.maxAnnotations&&Number.isFinite(i.maxAnnotations)?Math.max(0,Math.floor(i.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(i.areaPerAnnotation&&i.areaPerAnnotation>0?i.areaPerAnnotation:2e4))):1/0}function Ye(e){let t,i=e?.emphasis;t="primary"===i?100:"secondary"===i?10:50;let n=e?.provenance?.confidence;switch("number"==typeof n&&Number.isFinite(n)&&(t+=15*Ee(n,0,1)),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function We(e){let{annotations:t,width:i,height:n}=e,s=Math.max(0,e.minVisible??1),r=Re(i,n,e),o=t.map((e,t)=>({annotation:e,index:t,note:Le(e)})),a=o.filter(e=>e.note);if(0===a.length||r>=a.length)return{visible:t.slice(),deferred:[],budget:r};let l=a.filter(e=>je(e.annotation)),d=a.filter(e=>!je(e.annotation)).sort((e,t)=>Ye(t.annotation)-Ye(e.annotation)||e.index-t.index),h=Math.min(d.length,Math.max(Math.max(0,r-l.length),Math.max(0,s-l.length))),u=/* @__PURE__ */new Set([...l.map(e=>e.index),...d.slice(0,h).map(e=>e.index)]),c=[],p=[];for(let{annotation:e,index:t,note:i}of o)!i||u.has(t)?c.push(e):p.push(e);return{visible:c,deferred:p,budget:r}}function Xe(e,t){let i=t.scales?.x??t.scales?.time;return i?null!=e.x?i(e.x):t.xAccessor&&null!=e[t.xAccessor]?i(e[t.xAccessor]):null:null}function ze(e,t){let i=t.scales?.y??t.scales?.value;return i?null!=e.y?i(e.y):t.yAccessor&&null!=e[t.yAccessor]?i(e[t.yAccessor]):null:null}function Ge(e){let t=e.data;if(!t||0===t.length)return null;let i=t[t.length-1],n=e.scales?.x??e.scales?.time,s=e.scales?.y??e.scales?.value;if(!n||!s)return null;let r=i[e.xAccessor||"x"],o=i[e.yAccessor||"y"];return null==r||null==o?null:{x:n(r),y:s(o)}}function He(e){return null==e?null:e+""}function Ke(e){return He(e.provenance?.stableId??e.stableId)}function Ue(e){return He(e.stableId??e.id??e.provenance?.stableId)}function _e(e,t,i){return t.stickyPositionCache?.set(e,i),i}function Ve(e,t,i){let n=Ke(e);if(!n)return null;let s=i.pointNodes?.find(e=>He(e.pointId)===n);if(s)return _e(t,i,{x:s.x,y:s.y});let r=i.data?.find(e=>Ue(e)===n);if(!r)return null;let o=Xe(r,i),a=ze(r,i);return null==o||null==a?null:_e(t,i,{x:o,y:a})}function Qe(e,t,i){let n=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===n){if(null!=e.pointId&&i.pointNodes&&i.pointNodes.length>0)for(let n=i.pointNodes.length-1;n>=0;n--){let s=i.pointNodes[n];if(s.pointId===e.pointId)return _e(t,i,{x:s.x,y:s.y})}let n=Ge(i);return n?_e(t,i,n):null}if("semantic"===n){let n=Ve(e,t,i);if(n)return n}let s=null,r=null;if(null!=e.pointId&&i.pointNodes){let t=i.pointNodes.find(t=>t.pointId===e.pointId);t&&(s=t.x,r=t.y)}if((null==s||null==r)&&(s=Xe(e,i),r=ze(e,i)),null!=s&&null!=r)return _e(t,i,{x:s,y:r});if("sticky"===n){let e=i.stickyPositionCache?.get(t);if(e)return e}return null}function Ze(e,t,i,n=50){return!(-n>e||e>(i.width||0)+n||-n>t||t>(i.height||0)+n)}function Je(e){return{label:e.label,title:e.title,wrap:e.wrap||120,noWrap:"function"==typeof e._noteLayout?e.noWrap:void 0,_noteLayout:e._noteLayout}}function et(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function tt(e,t,i){if(!e)return[];let n=Math.max(1,Math.floor(t/i)),s=[],r="";for(let t of e.split(/\s+/))t&&(r&&r.length+1+t.length>n?(s.push(r),r=t):r=r?`${r} ${t}`:t);return r&&s.push(r),s}function it(e){return"number"==typeof e.dx||"number"==typeof e.dy}function nt(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}function st(e){let t=e?.familiarity;if(!t)return 3;let i=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===i.length?3:i.reduce((e,t)=>e+t,0)/i.length}function rt(e){if(!e)return 1;let t=st(e);return t>2?4>t?1:.6:1.5}function ot(e){let t=e?.provenance;if(!t||"object"!=typeof t)return e;let i="string"==typeof t.source?Object.prototype.hasOwnProperty.call(Ln,t.source)?Ln[t.source]:t.source:null,n="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!i&&!n||null!=e.label&&"string"!=typeof e.label)return e;let s=[i,n].filter(Boolean).join(" · "),r="string"==typeof e.label?e.label:"";return r.includes(`(${s})`)?e:{...e,label:r?`${r} (${s})`:`(${s})`}}function at(e,t){let i=!1,n=e.map(e=>ht(e)&&"blended"!==e.cohesion&&"layer"!==e.cohesion?(i=!0,{...e,cohesion:t}):e);return i?n:e}function lt(e){if(!ht(e))return e;let t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function dt(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}function ht(e){return Te(e)}function ut(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};let t=et(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};let i="number"==typeof e.wrap?e.wrap:120,n=[...tt("string"==typeof e.title?e.title:void 0,i,7),...tt("string"==typeof e.label?e.label:void 0,i,7)],s=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(i,7*s)+10),height:Math.max(18,16*n.length+6)}}function ct(e,t,i,n,s){let r=e+i,o=t+n;return Math.abs(i)>Math.abs(n)?{x:0>i?r-s.width-4:r+4,y:0>n?o-s.height:o,width:s.width,height:s.height}:{x:0>i?r-s.width:r,y:0>n?o-s.height-4:o+4,width:s.width,height:s.height}}function pt(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function ft(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function mt(e,t,i,n){let s=Math.max(0,n-e.x),r=Math.max(0,n-e.y);return(s+Math.max(0,e.x+e.width-(t-n)))*e.height+(r+Math.max(0,e.y+e.height-(i-n)))*e.width}function yt(e){let t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}function xt(e,t){return(e.pointNodes||[]).map(e=>{let i=Math.max(1,e.r||1)+t;return{x:e.x-i,y:e.y-i,width:2*i,height:2*i}})}function gt(e,t,i,n,s,r,o,a){let l=pt(e,o),d=.4*Math.hypot(t.dx,t.dy)+80*mt(l,s,r,a);for(let e of i)d+=12*ft(l,e);for(let e of n)d+=4*ft(l,e);return d}function bt(e,t,i){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};let n=e.pointId??e.nodeId;if(null!=n&&i.pointNodes){let e=i.pointNodes.find(e=>e.pointId===n);if(e)return{x:e.x,y:e.y}}let s=e.coordinates,r=i.scales?.geoProjection;if(Array.isArray(s)&&s.length>=2&&r){let e=s[0],t=s[1];if("number"==typeof e&&"number"==typeof t){let i=r([e,t]);if(i&&"number"==typeof i[0]&&"number"==typeof i[1])return{x:i[0],y:i[1]}}}return i.scales||"number"!=typeof e.x||"number"!=typeof e.y?Qe(e,t,i):{x:e.x,y:e.y}}function vt(e){let{annotations:t,context:i,defaultOffset:n=Pn,notePadding:s=Nn,markPadding:r=Fn,edgePadding:o=Dn,preserveManualOffsets:a=!0,routeLongConnectors:l=!0,connectorThreshold:d=Tn,density:h,progressiveDisclosure:u=!1,redundantCues:c=!1,responsive:p,mobile:f,cohesion:m,audience:y}=e,x=i.width||0,g=i.height||0,b="object"==typeof f?f:{},v=b.breakpoint??480,w=!!f&&v>=x,S=w&&!1!==b.preferShortText?t.map(lt):t,M=w&&!h?{maxAnnotations:b.maxAnnotations??("callout-list"===b.strategy?1:2),minVisible:b.minVisible??1}:h,k=u||w&&(!1!==b.progressiveDisclosure||"callout-list"===b.strategy),I=w&&!p?b.responsive??{minWidth:v}:p,B=w&&!m?b.cohesion:m;if(0===S.length||0>=x||0>=g)return S.slice();let O=[],A=xt(i,r),C=!1,$=S.map((e,t)=>{if(!ht(e))return e;let r=bt(e,t,i);if(!r)return e;let h=ut(!0===e.defensive?ot(e):e);if(a&&it(e)){let t=nt(e);return O.push(pt(ct(r.x,r.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,h),s)),e}let u=null,c=1/0;for(let e of yt(n)){let t=gt(ct(r.x,r.y,e.dx,e.dy,h),e,O,A,x,g,s,o);c>t&&(u=e,c=t)}if(!u)return e;let p=pt(ct(r.x,r.y,u.dx,u.dy,h),s);O.push(p);let f=Math.hypot(u.dx,u.dy),m=l&&f>=d&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return C=!0,{...e,dx:u.dx,dy:u.dy,...m?{connector:m}:{}}}),q=C?$:S.slice(),P=q;if(c){let e=!1,t=q.map(t=>{let i=dt(t);return i!==t&&(e=!0),i});P=e?t:q}{let e=!1,t=P.map(t=>{if(!0!==t?.defensive)return t;let i=ot(t);return i!==t&&(e=!0),i});P=e?t:P}let N,F=/* @__PURE__ */new Set;if(M){let e="object"==typeof M?M:{},t=rt(y),i=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??Re(x,g,e))*t))},{deferred:n}=We({annotations:P,width:x,height:g,...i});for(let e of n)F.add(e)}if(I&&("object"==typeof I&&"number"==typeof I.minWidth?I.minWidth:480)>=x)for(let e of P)ht(e)&&"secondary"===e.emphasis&&F.add(e);if(F.size>0)for(let e of P)!0===e?.defensive&&F.delete(e);return N=0===F.size?P:k?P.map(e=>F.has(e)?{...e,_annotationDeferred:!0}:e):P.filter(e=>!F.has(e)),B?at(N,B):N}function wt(e){let t=e.fixedPosition;Number.isFinite(t?.x)&&(e.x=e.prevX=t.x,e.vx=0),Number.isFinite(t?.y)&&(e.y=e.prevY=t.y,e.vy=0)}function St(e){if(!e)return;let t=Number.isFinite(e.x)?e.x:void 0,i=Number.isFinite(e.y)?e.y:void 0;return null==t&&null==i?void 0:{x:t,y:i}}function Mt(e,t,i){let n,s="x"===i?"y":"x",r=Math.abs(t[i]-e[i]),o=t[s]-e[s],a=(e,t)=>"circle"===e.shape.type?e.shape.radius:("x"===t?e.shape.width:e.shape.height)/2;if("circle"===e.shape.type&&"circle"===t.shape.type){let i=e.shape.radius+t.shape.radius;n=Math.sqrt(Math.max(0,i*i-r*r))}else if("aabb"===e.shape.type&&"aabb"===t.shape.type)n=a(e,s)+a(t,s);else{let o="aabb"===e.shape.type?e:t,l=a("circle"===e.shape.type?e:t,i),d=Math.max(0,r-a(o,i));n=a(o,s)+Math.sqrt(Math.max(0,l*l-d*d))}let l=0>o?-1:1;return{nx:"x"===s?l:0,ny:"y"===s?l:0,penetration:Math.max(0,n-Math.abs(o))}}function kt(e){return"circle"===e.type?{type:"circle",radius:e.radius}:{type:"aabb",width:e.width,height:e.height}}function It(e){return"aabb"===e.type?{type:"aabb",x:e.x,y:e.y,width:e.width,height:e.height}:{type:"segment",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,thickness:e.thickness}}function Bt(e){return{id:e.id,x:e.x,y:e.y,prevX:e.prevX,prevY:e.prevY,vx:e.vx,vy:e.vy,angle:e.angle,mass:e.mass,bodyCollisions:e.bodyCollisions,...e.fixedPosition?{fixedPosition:St(e.fixedPosition)}:{},shape:kt(e.shape),sleeping:e.sleeping,datum:e.datum,index:e.index,sleepTime:e.sleepTime,restitution:e.restitution,friction:e.friction}}function Ot(e){return e&&"function"!=typeof e?{property:e.property,equals:e.equals,notEquals:e.notEquals,oneOf:e.oneOf?.slice(),notOneOf:e.notOneOf?.slice()}:e}function At(e){return{id:e.id,shape:It(e.shape),sensor:e.sensor,restitution:e.restitution,friction:e.friction,bodyFilter:Ot(e.bodyFilter),index:e.index}}function Ct(e,t,i){return Math.max(t,Math.min(i,e))}function $t(e,t,i){return Math.min(e??i,t??i)}function qt(e,t,i){return Ct(Math.max(e??i,t??i),0,1)}function Pt(e){return 0>e?-1:1}function Nt(e){if("circle"===e.shape.type){let t=e.shape.radius;return{minX:e.x-t,minY:e.y-t,maxX:e.x+t,maxY:e.y+t}}let t=e.shape.width/2,i=e.shape.height/2;return{minX:e.x-t,minY:e.y-i,maxX:e.x+t,maxY:e.y+i}}function Ft(e){let t=e.shape;if("aabb"===t.type){let e=t.width/2,i=t.height/2;return{minX:t.x-e,minY:t.y-i,maxX:t.x+e,maxY:t.y+i}}let i=(t.thickness??0)/2;return{minX:Math.min(t.x1,t.x2)-i,minY:Math.min(t.y1,t.y2)-i,maxX:Math.max(t.x1,t.x2)+i,maxY:Math.max(t.y1,t.y2)+i}}function Dt(e,t){return!(e.minX>t.maxX||t.minX>e.maxX||e.minY>t.maxY||t.minY>e.maxY)}function Tt(e,t,i,n,s,r){let o=n-e,a=s-t,l=i+r,d=o*o+a*a;if(d>=l*l)return null;if(En>=d)return{nx:1,ny:0,penetration:l};let h=Math.sqrt(d);return{nx:o/h,ny:a/h,penetration:l-h}}function Lt(e,t,i,n,s,r,o,a){let l=s-e,d=(i+o)/2-Math.abs(l);if(0>=d)return null;let h=r-t,u=(n+a)/2-Math.abs(h);return u>0?u>d?{nx:Pt(l),ny:0,penetration:d}:{nx:0,ny:Pt(h),penetration:u}:null}function jt(e,t,i,n,s,r,o){let a=r/2,l=o/2,d=e-Ct(e,n-a,n+a),h=t-Ct(t,s-l,s+l),u=d*d+h*h;if(u>i*i)return null;if(En>=u){let r=Math.abs(e-(n-a)),o=Math.abs(e-(n+a)),d=Math.abs(t-(s-l)),h=Math.abs(t-(s+l)),u=Math.min(r,o,d,h);return u===r?{nx:-1,ny:0,penetration:i+r}:u===o?{nx:1,ny:0,penetration:i+o}:u===d?{nx:0,ny:-1,penetration:i+d}:{nx:0,ny:1,penetration:i+h}}let c=Math.sqrt(u);return{nx:d/c,ny:h/c,penetration:i-c}}function Et(e,t,i,n,s,r,o,a=0){let l=r-n,d=o-s,h=l*l+d*d,u=h>En?Ct(((e-n)*l+(t-s)*d)/h,0,1):0,c=i+a/2,p=e-(n+l*u),f=t-(s+d*u),m=p*p+f*f;if(m>=c*c)return null;if(En>=m){let e=Math.sqrt(h);return e>En?{nx:-d/e,ny:l/e,penetration:c}:{nx:1,ny:0,penetration:c}}let y=Math.sqrt(m);return{nx:p/y,ny:f/y,penetration:c-y}}function Rt(e,t){if("circle"===e.shape.type&&"circle"===t.shape.type)return Tt(e.x,e.y,e.shape.radius,t.x,t.y,t.shape.radius);if("aabb"===e.shape.type&&"aabb"===t.shape.type)return Lt(e.x,e.y,e.shape.width,e.shape.height,t.x,t.y,t.shape.width,t.shape.height);if("circle"===e.shape.type&&"aabb"===t.shape.type){let i=jt(e.x,e.y,e.shape.radius,t.x,t.y,t.shape.width,t.shape.height);return i?{nx:-i.nx,ny:-i.ny,penetration:i.penetration}:null}return"aabb"===e.shape.type&&"circle"===t.shape.type?jt(t.x,t.y,t.shape.radius,e.x,e.y,e.shape.width,e.shape.height):null}function Yt(e,t){let i=t.shape;return"aabb"===i.type?"circle"===e.shape.type?jt(e.x,e.y,e.shape.radius,i.x,i.y,i.width,i.height):Lt(i.x,i.y,i.width,i.height,e.x,e.y,e.shape.width,e.shape.height):Et(e.x,e.y,"circle"===e.shape.type?e.shape.radius:Math.sqrt(e.shape.width*e.shape.width+e.shape.height*e.shape.height)/2,i.x1,i.y1,i.x2,i.y2,i.thickness??0)}function Wt(e,t){return`${e}\0${t}`}function Xt(e){let t=e.indexOf("\0");return{sensorId:e.slice(0,t),bodyId:e.slice(t+1)}}function zt(e,t){if(!t)return;let i=e;for(let e of t.split(".")){if(null==i||"object"!=typeof i||!Object.prototype.hasOwnProperty.call(i,e))return;i=i[e]}return i}function Gt(e,t){return!!t?.some(t=>Object.is(e,t))}function Ht(e,t){if(!t)return!0;if("function"==typeof t)return t(e);let i=zt(e,t.property);return!("equals"in t&&!Object.is(i,t.equals)||"notEquals"in t&&Object.is(i,t.notEquals)||t.oneOf&&!Gt(i,t.oneOf)||t.notOneOf&&Gt(i,t.notOneOf))}function Kt(e,t){return Ht(t,e.bodyFilter)}function Ut(e,t){if(!Number.isFinite(t))return;e.count+=1,e.total+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t);let i=t-e.mean;e.mean+=i/e.count,e.m2+=i*(t-e.mean)}function _t(e){return{count:e.count,total:e.total,mean:e.count>0?e.mean:0,min:e.count>0?e.min:0,max:e.count>0?e.max:0,variance:e.count>1?e.m2/(e.count-1):0}}function Vt(e){return{count:e.count,total:e.total,mean:e.mean,m2:e.variance*Math.max(0,e.count-1),min:e.count>0?e.min:1/0,max:e.count>0?e.max:-1/0}}function Qt(e,t){if(null!=e[t])return e[t];let i=e.datum;return i&&"object"==typeof i?i[t]:void 0}function Zt(e,t,i){return"function"==typeof e?e(t,i):"string"==typeof e?Qt(t,e):void 0}function Jt(e,t,i){if("number"==typeof e)return e;let n="function"==typeof e?e(t,i):"string"==typeof e?Qt(t,e):1,s="number"==typeof n?n:Number(n);return Number.isFinite(s)?s:1}function ei(e){if(null==e)return;let t=e+"";return t.trim()?t:void 0}function ti(e){for(let t of Wn){let i=ei(Qt(e,t));if(i)return i}return"sediment"}function ii(e){let t=_t(e.value);return{id:e.id,label:e.label,count:t.count,total:t.total,bodyIds:e.bodyIds.slice(),lastBodyId:e.lastBodyId,lastDatum:e.lastDatum,x:_t(e.x),y:_t(e.y),value:t}}function ni(e,t={}){let{baselineY:i=0,binWidth:n=24,gap:s=2,maxHeight:r=80,value:o="count",x:a}=t,l=e.reduce((e,t)=>Math.max(e,t[o]),1);return e.map((e,t)=>{let d=Math.max(0,e[o]/l*r),h=a?.(e,t)??t*(n+s);return{binId:e.id,label:e.label,index:t,count:e.count,total:e.total,x:h,y:i-d,width:n,height:d,meanX:e.x.mean,meanY:e.y.mean}})}function si(e={},t=Gn){return{chartId:e.chartId??t.chartId,chartType:e.chartType??t.chartType,sensors:e.sensors??t.sensors,onObservation:e.onObservation??t.onObservation,onSimulationStateChange:e.onSimulationStateChange??t.onSimulationStateChange}}function ri(e){return{...e,shape:{...e.shape},...e.fixedPosition?{fixedPosition:{...e.fixedPosition}}:{},datum:e.datum,springs:e.springs?.map(e=>({...e,target:{...e.target}}))}}function oi(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:void 0}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function ai(e,t){if(null!=e[t])return e[t];let i=e.datum;return i&&"object"==typeof i?i[t]:void 0}function li(e,t,i){return"function"==typeof i?oi(i(e,t)):"string"==typeof i?oi(ai(e,i)):oi(e.spawnAt)??oi(ai(e,"arrivalTime"))??oi(ai(e,"timestamp"))??oi(ai(e,"time"))??oi(ai(e,"eventTime"))}function di(e,t={}){let i=oi(t.startAt)??0,n=t.pacing??"immediate";if("arrival"===n){let n=1/0,s=e.map((e,i)=>{let s=li(e,i,t.timeAccessor);return null!=s&&(n=Math.min(n,s)),s}),r=oi(t.timeScale)??1,o=r>0?r:1;return e.map((e,t)=>{let r=s[t],a=null==r?0:Math.max(0,r-n);return{...ri(e),spawnAt:i+a/o}})}if("object"==typeof n){let t=oi(n.ratePerSec);if(t&&t>0)return e.map((e,n)=>({...ri(e),spawnAt:i+n/t}))}return e.map(e=>({...ri(e),spawnAt:i}))}function hi(e){return{...ri(e),sequence:e.sequence,spawnAt:e.spawnAt}}function ui(e){return e.map(e=>({...e,shape:{...e.shape},bodyFilter:e.bodyFilter&&"function"!=typeof e.bodyFilter?{...e.bodyFilter,oneOf:e.bodyFilter.oneOf?.slice(),notOneOf:e.bodyFilter.notOneOf?.slice()}:e.bodyFilter}))}function ci(e){return!1!==e&&{...e}}function pi(e,t){return e.spawnAt===t.spawnAt?e.sequence-t.sequence:e.spawnAt-t.spawnAt}function fi(e){return{...e,gravity:{...e.gravity}}}function mi(e,t,i,n){if("circle"===e.shape.type){let s=e.x-t,r=e.y-i,o=e.shape.radius+n,a=s*s+r*r;return a>o*o?null:a}let s=Math.max(Math.abs(t-e.x)-e.shape.width/2,0),r=Math.max(Math.abs(i-e.y)-e.shape.height/2,0),o=s*s+r*r;return o>n*n?null:o}function yi(e,t){return`${e}\0${t}`}function xi(e){let t=e.indexOf("\0");return{sensorId:e.slice(0,t),bodyId:e.slice(t+1)}}function gi(e,t={}){let{idPrefix:i="plot",includeFloor:n=!0,includeCeiling:s=!1,includeLeftWall:r=!0,includeRightWall:o=!0,wallThickness:a=20,floorThickness:l=a}=t,d=[],h=e.x+e.width/2,u=e.y+e.height/2;return n&&d.push({id:i+"-floor",shape:{type:"aabb",x:h,y:e.y+e.height+l/2,width:e.width+2*a,height:l}}),s&&d.push({id:i+"-ceiling",shape:{type:"aabb",x:h,y:e.y-l/2,width:e.width+2*a,height:l}}),r&&d.push({id:i+"-left-wall",shape:{type:"aabb",x:e.x-a/2,y:u,width:a,height:e.height+2*l}}),o&&d.push({id:i+"-right-wall",shape:{type:"aabb",x:e.x+e.width+a/2,y:u,width:a,height:e.height+2*l}}),d}function bi(e){let{idPrefix:t="bin",count:i,domainStart:n,domainStep:s,xScale:r,yTop:o,yBottom:a,wallThickness:l=4,includeBoundaryWalls:d=!0,includeInteriorWalls:h=!0,closedBefore:u,lidY:c=o,lidThickness:p=Math.max(2,l)}=e,f=[],m=o+(a-o)/2,y=Math.abs(a-o),x=d?i:i-1;if(h||d)for(let e=d?0:1;x>=e;e+=1){if(!h&&e>0&&i>e)continue;let o=r(n+e*s);f.push({id:`${t}-wall-${e}`,shape:{type:"aabb",x:o,y:m,width:l,height:y}})}if(null!=u)for(let e=0;i>e;e+=1){let i=n+e*s,o=i+s;if(o>=u)continue;let a=r(i),d=r(o);f.push({id:`${t}-lid-${e}`,shape:{type:"segment",x1:Math.min(a,d)+l/2,y1:c,x2:Math.max(a,d)-l/2,y2:c,thickness:p}})}return f}function vi(e={}){return new Hn(e)}function wi(e,t={}){return e?"function"==typeof e?e(t):(e.init(t),e):vi(t)}function Si(e){let t=Number(e);if(Number.isFinite(t)&&t>0)return Math.floor(t)}function Mi(e,t,i){if(!1===i)return;let n=Si(i?.warnAt);return null!=n?n:null!=e?Math.max(1,Math.floor(.8*e)):null!=t?Math.max(1,Math.floor(.8*t)):void 0}function ki(e){let t=Math.max(0,Math.floor(e.liveBodies)),i=Math.max(0,Math.floor(e.queuedBodies??0)),n=t+i,s=Si(e.bodyLimit),r=Si(e.engineMaxBodiesHint),o=Mi(s,r,e.options),a=null==s?0:Math.max(0,t-s),l=a>0?"overflow":null==o||o>n?"ok":"warning";return{action:"overflow"!==l?"continue":e.sedimentEnabled?"sediment":e.evictionEnabled?"evict":"retain",bodyLimit:s,engineMaxBodiesHint:r,liveBodies:t,overflow:a,projectedBodies:n,queuedBodies:i,state:l,warnAt:o}}function Ii(e,t){let i={...e};for(let e of t)i[Kn[e]]++;return i}function Bi(e,t,i){let n=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:n,revisions:Ii(i,n)}}function Oi(e){let t="preserve",i=/* @__PURE__ */new Set;for(let n of e){let e=ss[n]??rs;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}function Ai(e,t){return e===t||!(!e||!t||e.gravity?.x!==t.gravity?.x||e.gravity?.y!==t.gravity?.y)&&os.every(i=>e[i]===t[i])}function Ci(e,t){return Object.keys(e).filter(i=>"kernel"===i?!Ai(e.kernel,t.kernel):e[i]!==t[i])}function $i(e,t,i){if(0===t.length)return;let n=new Map(e.readState().map(e=>[e.id,e]));for(let e of t){if("sleep"!==e.type)continue;let t=n.get(e.bodyId);i.emit({type:"physics-settle",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,bodyId:e.bodyId,datum:t?.datum,x:t?.x,y:t?.y})}}function qi(e,t,i){let n=new Set(e.activeSensorPairs().map(e=>yi(e.sensorId,e.bodyId)));if(0===n.size&&0===t.size)return n;let s=new Map(e.readState().map(e=>[e.id,e])),r=(e,t)=>{let{sensorId:n,bodyId:r}=xi(t),o=i.observation.sensors[n],a=s.get(r);i.emit({type:"enter"===e?o?.enterType??"physics-bin-enter":o?.exitType??"physics-bin-exit",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,bodyId:r,datum:a?.datum,x:a?.x,y:a?.y,sensorId:n,binId:o?.binId??n})};for(let e of Array.from(n).sort())t.has(e)||r("enter",e);for(let e of Array.from(t).sort())n.has(e)||r("exit",e);return n}function Pi(e,t){for(let i of e)t.has(xi(i).bodyId)&&e.delete(i)}function Ni(e,t,i,n){return e||!t?"paused":i||!n?"running":"settled"}function Fi(e,t,i){i.observation.onSimulationStateChange?.(t,e),("running"===t||"settled"===t)&&i.emit({type:"running"===t?"sim-active":"sim-idle",timestamp:i.elapsedSeconds,chartType:i.observation.chartType,chartId:i.observation.chartId,simulationState:t,previousSimulationState:e})}function Di(e,t){t.emit({type:"overflow"===e.state?"physics-budget-overflow":"physics-budget-warning",timestamp:t.elapsedSeconds,chartType:t.observation.chartType,chartId:t.observation.chartId,budgetAction:e.action,bodyLimit:e.bodyLimit,engineMaxBodiesHint:e.engineMaxBodiesHint,liveBodies:e.liveBodies,overflow:e.overflow,projectedBodies:e.projectedBodies,queuedBodies:e.queuedBodies,warnAt:e.warnAt})}function Ti(e,t,i){if("sleeping-first"!==t)return i.slice();let n=new Map(e.readState().map(e=>[e.id,e.sleeping])),s=[],r=[];for(let e of i)n.get(e)?s.push(e):r.push(e);return[...s,...r]}function Li(e,t,i,n){let s=new Map(e.readState().map(e=>[e.id,e])),r=[];for(let e of i){let i=s.get(e);if(!i)continue;let o=t.add(i);o&&(r.push(e),n.emit({type:"physics-sediment",timestamp:n.elapsedSeconds,chartType:n.observation.chartType,chartId:n.observation.chartId,bodyId:e,datum:i.datum,x:i.x,y:i.y,binId:o.id,count:o.count,total:o.total}))}return r}function ji(e,t,i,n,s,r){let o={evicted:[],sedimented:[],liveBodyOrder:s};if(!1===i)return o;let a=Math.max(0,Math.floor(n));if(!Number.isFinite(a))return o;let l=s.length-a;if(0>=l)return o;let d=Ti(e,i,s).slice(0,l);if(0===d.length)return o;let h=Li(e,t,d,r);e.remove(d);let u=new Set(d);return{evicted:d,sedimented:h,liveBodyOrder:s.filter(e=>!u.has(e))}}function Ei(e){let t=e?.sleepSpeed;return"number"==typeof t&&Number.isFinite(t)&&t>0?t:8}function Ri(e,t){if(!e)return;let i=["spawned","evicted","sedimented","events","observations"],n={spawned:0,evicted:0,sedimented:0,events:0,observations:0},s=s=>{let r=t(s),o={...r,spawned:r.spawned.slice(n.spawned),evicted:r.evicted.slice(n.evicted),sedimented:r.sedimented.slice(n.sedimented),events:r.events.slice(n.events),observations:r.observations.slice(n.observations)};for(let e of i)n[e]=r[e].length;e.onStep(o)};return s(0),()=>s(1)}function Yi(e,t,i,n={}){let s,r=0;for(;t>r&&!n.shouldStop?.()&&(!1===n.stopAtRest||e.queueSize()>0||!e.atRest()||n.continueWhile?.());){e.step(e.fixedDt),e.advanceTime(e.fixedDt);let t=e.drainEvents();i.events&&(i.events.push(...t),e.observeKernelEvents(t,i.observations),e.observeSensorTransitions(i.observations));let o=[];if(e.spawnDue(o,i.observations),o.length>0){i.spawned.push(...o),s=e.observeBodyBudget(i.observations);let t=e.evictOverflow(i.observations);i.evicted?.push(...t.evicted),i.sedimented?.push(...t.sedimented)}r+=1,e.refreshQuiescence(e.fixedDt,o.length),n.afterStep?.()}return{steps:r,budget:s}}function Wi(){let e=(us??(us=ds.createContext(null)),us);return ds.useContext(e)??cs}function Xi(e,t){let i=/* @__PURE__ */new Map;for(let t of e)i.set(t.id,/* @__PURE__ */new Set);for(let e of t)i.has(e.source)||i.set(e.source,/* @__PURE__ */new Set),i.has(e.target)||i.set(e.target,/* @__PURE__ */new Set),i.get(e.source).add(e.target);return i}function zi(e,t,i={}){let n=/* @__PURE__ */new Set,s=[...e.get(t)??[]];for(let t=0;s.length>t;t++){let i=s[t];n.has(i)||(n.add(i),s.push(...e.get(i)??[]))}return i.includeStart&&n.add(t),n}function Gi(e,t,i){if(i.some(e=>null!=e.__forceRadius))return e=>e.__forceRadius??8;if(null==e)return()=>8;if("number"==typeof e)return()=>e;if("function"==typeof e)return t=>e(t)||8;let n=t||[5,20],s=[];for(let t of i){let i=t.data?.[e];"number"==typeof i&&s.push(i)}if(0===s.length)return()=>n[0];let[r,o]=Hi(s);if(r===o)return()=>(n[0]+n[1])/2;let a=ps().domain([r,o]).range(n).clamp(!0);return t=>{let i=t.data?.[e];return null==i||"number"!=typeof i?n[0]:a(i)}}import{a as Hi,c as Ki}from"./c-3PFVJFBK.min.js";import{interpolateRgb as Ui}from"d3-interpolate";var _i=864e5,Vi=t=>{let i=t.config,{plot:n}=t.dimensions;if(0>=n.width||0>=n.height)return{nodes:[]};let s=e=>{let t="function"==typeof i.dateAccessor?i.dateAccessor(e):e[i.dateAccessor];return t instanceof Date?t:new Date(t)},r=e=>{let t="function"==typeof i.valueAccessor?i.valueAccessor(e):e[i.valueAccessor];return Number(t)},o=/* @__PURE__ */new Map,a=null;for(let i of t.data){let t=s(i);if(!isFinite(t.getTime()))continue;null==a&&(a=t.getUTCFullYear());let n=e(t),l=r(i);o.set(n,(o.get(n)??0)+(Number.isFinite(l)?l:0))}let l=i.year??a??/* @__PURE__ */(new Date).getUTCFullYear(),d=1/0,h=-1/0;for(let e of o.values())d>e&&(d=e),e>h&&(h=e);d===1/0&&(d=0,h=0);let[u,c]=i.colorRamp??[t.theme.semantic.surface??"#ebedf0",t.theme.semantic.primary??"#216e39"],p=e=>{if(h===d)return u;let t=(e-d)/(h-d);return Ui(u,c)(t)},f=i.gutter??2,m=i.labelInset??0,y=Math.min((n.width-m-53*f)/54,(n.height-6*f)/7);if(0>=y)return{nodes:[]};let x=new Date(Date.UTC(l,0,1)),g=x.getUTCDay(),b=new Date(x.getTime()-g*_i),v=[];for(let t=0;54>t;t++)for(let i=0;7>i;i++){let s=new Date(b.getTime()+(7*t+i)*_i);if(s.getUTCFullYear()!==l)continue;let r=e(s),a=o.get(r),d=null==a?u:p(a);v.push({type:"rect",x:n.x+m+t*(y+f),y:n.y+i*(y+f),w:y,h:y,style:{fill:d,stroke:"none"},datum:{date:s,value:a??0}})}return{nodes:v}};import{interpolateLab as Qi}from"d3-interpolate";var Zi=class{constructor(e=12){this.maxSize=e,this.store=/* @__PURE__ */new Map}get(e){return this.store.get(e)}set(e,t){this.store.size>=this.maxSize&&this.store.clear(),this.store.set(e,t)}getOrCompute(e,t){let i=this.store.get(e);if(void 0!==i)return i;let n=t();return this.set(e,n),n}clear(){this.store.clear()}get size(){return this.store.size}};import{jsx as Ji,jsxs as en}from"react/jsx-runtime";import*as tn from"react";import{scaleLinear as nn}from"d3-scale";var sn=e=>{let t=e.config,{plot:i}=e.dimensions,n=t.fields??[];if(2>n.length||0>=i.width||0>=i.height)return{nodes:[]};if(0===e.data.length)return{nodes:[]};let s=/* @__PURE__ */Object.create(null);for(let i of n){let n=t.domains&&Object.prototype.hasOwnProperty.call(t.domains,i)?t.domains[i]:void 0;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&Number.isFinite(n[0])&&"number"==typeof n[1]&&Number.isFinite(n[1])){s[i]=[n[0],n[1]];continue}let r=1/0,o=-1/0;for(let t of e.data){let e=Number(t[i]);Number.isFinite(e)&&(r>e&&(r=e),e>o&&(o=e))}if(Number.isFinite(r)&&Number.isFinite(o))if(r===o){let e=Math.max(.01*Math.abs(r),.5);s[i]=[r-e,o+e]}else s[i]=[r,o];else s[i]=[0,1]}let r=!1!==t.showAxes,o=r?t.axisLabelPadding??24:8,a=r?18:8,d=n.map(e=>nn().domain(s[e]).range([i.y+i.height-a,i.y+o])),h=n.map((e,t)=>1===n.length?i.x+i.width/2:i.x+t/(n.length-1)*i.width),u=t.colorBy?"function"==typeof t.colorBy?t.colorBy:e=>(e[t.colorBy]??"")+"":null,c=t.opacity??.45,p=t.strokeWidth??1.25,f=e.theme.semantic.primary??"#3b6cb1",m=t.dimmedOpacity??.08,y=t.highlightFn,x=[],g=[];for(let i of e.data){let s=u?e.resolveColor(u(i)+""):f,r=!y||y(i),o=l(i,{predicate:y,baseOpacity:c,dimOpacity:m,brighten:.4}),a=r?g:x;for(let e=0;n.length-1>e;e++){let t=Number(i[n[e]]),l=Number(i[n[e+1]]);if(!Number.isFinite(t)||!Number.isFinite(l))continue;let u={type:"connector",x1:h[e],y1:d[e](t),x2:h[e+1],y2:d[e+1](l),style:{stroke:s,strokeWidth:y&&r?p+.75:p,opacity:o,fill:"none"},datum:i};a.push(u)}if(t.showPoints)for(let e=0;n.length>e;e++){let t=Number(i[n[e]]);if(!Number.isFinite(t))continue;let r={type:"point",x:h[e],y:d[e](t),r:2.5,style:{fill:s,stroke:"none",opacity:Math.min(1,o+.3)},datum:i};a.push(r)}}let b=null;if(r){let r=`var(--semiotic-border, ${e.theme.semantic.border??"#aaa"})`,l=`var(--semiotic-text, ${e.theme.semantic.text??"currentColor"})`,u=`var(--semiotic-text-secondary, ${e.theme.semantic.textSecondary??"#888"})`,c=i.y+o,p=i.y+i.height-a,f=[];for(let e=0;n.length>e;e++){let a=n[e],m=h[e],y=t.tickFormat&&Object.prototype.hasOwnProperty.call(t.tickFormat,a)?t.tickFormat[a]:void 0,x="function"==typeof y?y:e=>e.toLocaleString();f.push(tn.createElement("line",{key:"pc-axis-line-"+e,x1:m,x2:m,y1:c,y2:p,stroke:r,strokeWidth:1})),f.push(w({keyId:"pc-axis-label-"+e,text:a,x:m,y:i.y+o-8,anchor:"middle",baseline:"auto",fontSize:12,fontWeight:600,color:l}));let[g,b]=s[a],v=5;for(let t=0;v>t;t++){let i=g+(b-g)*t/(v-1),n=d[e](i);f.push(tn.createElement("line",{key:`pc-tick-${e}-${t}`,x1:m-3,x2:m+3,y1:n,y2:n,stroke:r,strokeWidth:1}),w({keyId:`pc-ticktext-${e}-${t}`,text:x(i),x:m+6,y:n+3,anchor:"start",baseline:"auto",fontSize:10,color:u}))}}b=tn.createElement(tn.Fragment,null,...f)}return{nodes:x.concat(g),overlays:b}};import{Fragment as rn,jsx as on,jsxs as an}from"react/jsx-runtime";var ln={flow:{fill:"rgba(59, 130, 246, 0.14)",stroke:"rgba(96, 165, 250, 0.7)",accent:"#60a5fa"},capacity:{fill:"rgba(251, 146, 60, 0.18)",stroke:"rgba(251, 146, 60, 0.85)",accent:"#fb923c"},portal:{fill:"rgba(244, 114, 182, 0.14)",stroke:"rgba(244, 114, 182, 0.7)",accent:"#f472b6"},absorb:{fill:"rgba(52, 211, 153, 0.18)",stroke:"rgba(52, 211, 153, 0.8)",accent:"#34d399"}},dn=e=>"number"==typeof e&&Number.isFinite(e),hn=(e,t,i)=>({x:e.x+(t.x-e.x)*i,y:e.y+(t.y-e.y)*i}),un=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),cn={viewBox:[24,24],parts:[{d:"M5,0 H19 Q24,0 24,5 V19 Q24,24 19,24 H5 Q0,24 0,19 V5 Q0,0 5,0 Z",stroke:"accent"}]},pn=(e,t)=>e.stepEntityCounts?.[t]??e.entityCount,fn=({datum:e},t)=>({opacity:!t?.isActive||t.predicate(e)||null!=e?.fromNodeId&&t.predicate({...e,nodeId:e.fromNodeId})?1:.2}),mn=e=>{let t=e.config.braid,i=e.dimensions.plot,n=t.atlas.spec.comparison?.partitions??[...new Set(t.groups.map(e=>e.partition))],s=t.groups.filter(e=>n.includes(e.partition)&&e.nodePath.length>0),r=[],o=[],a=[];if(0===s.length)return{sceneNodes:o,sceneEdges:r,labels:a};let l=new Set(s.map(e=>e.signature)),d=[...t.signatureOrder.filter(e=>l.delete(e)),...l],h=new Map(d.map((e,t)=>[e,t])),u=[...s].sort((e,t)=>h.get(e.signature)-h.get(t.signature)),c=n.map(e=>u.filter(t=>t.partition===e)),p=xe(u),f=Ki(p.map(e=>e.depth)),m=s.map(e=>Ki(e.stepEntityCounts??[e.entityCount])),x=Ki(m),g=e=>e>0?Math.max(1,10*e/x):0,b=new Map(s.map((e,t)=>[e.id,g(m[t])])),v=i.height/n.length,{semantic:w}=e.theme,S=(e,t,i,n={})=>a.push({x:e,y:t,text:i,fill:w.text??"#333",fontSize:10,anchor:"middle",...n}),M={sourceRevision:t.atlas.provenance.sourceRevision,analysisRevision:t.atlas.analysisRevision,relationScopeId:"directed-admitted"},k=new Map(p.map(e=>{let t=c.map(t=>t.reduce((t,i)=>t+(e.signatures.has(i.signature)?b.get(i.id)+3:0),5));return[e.id,Ki(t,24)]})),I=Ki([...k.values()],24),B=Math.min(i.width/4,I/2+16),O=(i.width-2*B)/Math.max(f-1,1),A=e=>i.x+B+(e-1)*O,C=48+I/2,$=22+I/2,q=(e,t)=>e+C+(h.get(t)+.5)*Math.max(0,v-C-$)/d.length,P=(t,i,n,s,o)=>{let a=pn(i,s),l=pn(i,o),d=g(a),h=g(l);if(0===d&&0===h)return;let u=d!==h,c=e.resolveColor(i.signature);r.push({type:"curved",id:n,pathD:u?fe(t,d,h):ce(t,8),style:{fill:u?c:"none",fillOpacity:1,stroke:u?"none":c,strokeWidth:u?0:d},datum:{...M,id:n,kind:"braid-track",nodeId:i.nodePath[o],fromNodeId:i.nodePath[s],groupId:i.id,signature:i.signature,partition:i.partition,entityCount:i.entityCount,fromStep:s,toStep:o,fromCount:a,toCount:l,falseRoot:!1},accessibleDatum:{journey:i.nodePath.join(" → "),partition:i.partition??"all",fromStep:s+1,toStep:o+1,fromCount:a,toCount:l}})};return n.forEach((e,t)=>{let n=i.y+t*v,s=c[t];if(e&&S(i.x+8,n+14,e,{fontSize:12,fontWeight:600,anchor:"start"}),0===s.length)return;for(let e=1;f>=e;e++)S(A(e),n+34,"Step "+e);let r=/* @__PURE__ */new Map;for(let t of p){let i=s.filter(e=>t.signatures.has(e.signature));if(0===i.length)continue;let a=A(t.depth),l=y([...t.signatures].map(e=>q(n,e))),d=me(i.map(e=>b.get(e.id)));r.set(t.id,new Map(i.map((e,t)=>[e.id,{x:a,y:l+d[t],offset:d[t]}])));let h=k.get(t.id),u={state:t.state,step:t.depth,partition:e??"all"},c=`vertex:${e??"all"}:${t.id}`;o.push({type:"glyph",id:c,cx:a,cy:l,size:h,depth:t.depth,label:`${t.state} (step ${t.depth})`,glyph:cn,accent:w.border??"#888",style:{fill:w.surface??"#fff"},datum:{...M,id:c,nodeId:t.state,kind:"braid-step",prefixId:t.id,...u},accessibleDatum:u}),S(a,l+h/2+12,t.state)}for(let t of s){let i=ye(t.signature);for(let n=1;i.length>n;n++){let s=r.get(i[n-1]).get(t.id),o=r.get(i[n]).get(t.id),a=(s.x+o.x)/2-Math.sign(o.y-s.y)*o.offset;P(1e-8>Math.abs(s.y-o.y)?[s,o]:[s,{x:a,y:s.y},{x:a,y:o.y},o],t,`step:${e??"all"}:${i[n]}:${t.id}`,n-1,n)}}}),{sceneNodes:o,sceneEdges:r,labels:a,restyle:fn,restyleEdge:fn}};import{symbol as yn,symbolCircle as xn,symbolCross as gn,symbolDiamond as bn,symbolSquare as vn,symbolStar as wn,symbolTriangle as Sn,symbolWye as Mn}from"d3-shape";var kn={circle:xn,square:vn,triangle:Sn,diamond:bn,star:wn,cross:gn,wye:Mn},In=/* @__PURE__ */new Set(["circle","square","triangle","diamond","star","cross","wye","chevron"]),Bn=["circle","triangle","diamond","star","square","chevron","cross","wye"],On=/* @__PURE__ */new Map,An=[40,40],Cn=[.5,.5],$n=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),qn=(new Set(["label","callout","callout-circle","callout-rect"]),2e4),Pn=32,Nn=6,Fn=4,Dn=8,Tn=72,Ln={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"},jn={seed:1,gravity:{x:0,y:980},fixedDt:1/120,cellSize:64,collisionIterations:6,velocityDamping:.995,sleepSpeed:8,sleepAfter:.35,restitution:.1,friction:.35,maxVelocity:1600,contactWakeSpeed:200},En=1e-9,Rn=.005,Yn=class{constructor(e={}){this.capabilities={determinism:"strict",sensors:!0,joints:!1,ccd:!1,maxBodiesHint:5e3,worker:!1},this.bodies=/* @__PURE__ */new Map,this.colliders=/* @__PURE__ */new Map,this.springs=/* @__PURE__ */new Map,this.activeSensors=/* @__PURE__ */new Set,this.supportedThisStep=/* @__PURE__ */new Set,this.lastEvents=[],this.nextBodyIndex=0,this.nextColliderIndex=0,this.nextSpringIndex=0,this.options={...jn,...e},this.random=I(this.options.seed)}init(e={}){this.options={...jn,...e},this.random=I(this.options.seed),this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors.clear(),this.lastEvents=[],this.nextBodyIndex=0,this.nextColliderIndex=0,this.nextSpringIndex=0}spawn(e){let t={id:e.id,x:e.x,y:e.y,prevX:e.x,prevY:e.y,vx:e.vx??0,vy:e.vy??0,angle:e.angle??0,mass:Math.max(En,e.mass??1),bodyCollisions:e.bodyCollisions??!0,...e.fixedPosition?{fixedPosition:St(e.fixedPosition)}:{},shape:kt(e.shape),sleeping:!1,datum:e.datum,restitution:e.restitution,friction:e.friction,index:this.nextBodyIndex,sleepTime:0};wt(t),this.nextBodyIndex+=1,this.bodies.set(e.id,t)}remove(e){for(let t of e){this.bodies.delete(t);for(let e of Array.from(this.activeSensors))Xt(e).bodyId===t&&this.activeSensors.delete(e)}}setColliders(e){this.colliders.clear(),this.activeSensors.clear(),this.nextColliderIndex=0;for(let t of e)this.colliders.set(t.id,{...t,shape:It(t.shape),bodyFilter:Ot(t.bodyFilter),index:this.nextColliderIndex}),this.nextColliderIndex+=1}setConstraint(e){let t=e.id??"spring-"+this.nextSpringIndex;return this.springs.set(t,{id:t,bodyId:e.bodyId,target:e.target,restLength:e.restLength??0,stiffness:e.stiffness??40,damping:e.damping??3}),this.nextSpringIndex+=1,t}removeConstraint(e){this.springs.delete(e)}applyImpulse(e,t,i){let n=this.bodies.get(e);n&&(n.vx+=t/n.mass,n.vy+=i/n.mass,wt(n),this.wake(n))}step(e=this.options.fixedDt){let t=Math.max(0,e);if(this.lastEvents=[],0===t)return;let i=this.sortedBodies();for(let e of i)e.prevX=e.x,e.prevY=e.y;this.applySprings(t);let n=this.options.maxVelocity;for(let e of i)if(!e.sleeping){if(e.vx+=this.options.gravity.x*t,e.vy+=this.options.gravity.y*t,e.vx*=this.options.velocityDamping,e.vy*=this.options.velocityDamping,wt(e),n>0){let t=Math.sqrt(e.vx*e.vx+e.vy*e.vy);if(t>n){let i=n/t;e.vx*=i,e.vy*=i}}e.x+=e.vx*t,e.y+=e.vy*t}this.supportedThisStep.clear();let s=this.bodyPairKeys(i),r=this.sortedColliders().filter(e=>!e.sensor);for(let e=0;this.options.collisionIterations>e;e+=1)this.resolveBodyPairs(i,s,0===e),this.resolveColliders(i,r,0===e);this.updateSensors(i),this.updateSleeping(i,t)}settle(e=1200,t=this.options.fixedDt){let i=0;for(;e>i&&!this.allSleeping();)this.step(t),i+=1;return i}readState(e=[]){e.length=0;for(let t of this.sortedBodies())e.push({id:t.id,x:t.x,y:t.y,prevX:t.prevX,prevY:t.prevY,vx:t.vx,vy:t.vy,angle:t.angle,mass:t.mass,...t.fixedPosition?{fixedPosition:St(t.fixedPosition)}:{},shape:kt(t.shape),sleeping:t.sleeping,datum:t.datum});return e}events(){return this.lastEvents.slice()}activeSensorPairs(){return Array.from(this.activeSensors).sort().map(Xt)}allSleeping(){for(let e of this.bodies.values())if(!e.sleeping)return!1;return!0}snapshot(){return{options:{...this.options,gravity:{...this.options.gravity}},bodies:this.sortedBodies().map(Bt),colliders:this.sortedColliders().map(At),springs:Array.from(this.springs.values()).map(e=>({...e,target:{...e.target}})),activeSensors:Array.from(this.activeSensors).sort()}}restore(e){this.options={...e.options,gravity:{...e.options.gravity}},this.random=I(this.options.seed),this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors=new Set(e.activeSensors),this.lastEvents=[],this.nextBodyIndex=0;for(let t of e.bodies){let e=Bt(t);wt(e),this.bodies.set(e.id,e),this.nextBodyIndex=Math.max(this.nextBodyIndex,e.index+1)}this.nextColliderIndex=0;for(let t of e.colliders){let e=At(t);this.colliders.set(e.id,e),this.nextColliderIndex=Math.max(this.nextColliderIndex,e.index+1)}this.nextSpringIndex=0;for(let t of e.springs){this.springs.set(t.id,{...t,target:{...t.target}});let e=/^spring-(\d+)$/.exec(t.id);e&&(this.nextSpringIndex=Math.max(this.nextSpringIndex,Number(e[1])+1))}}dispose(){this.bodies.clear(),this.colliders.clear(),this.springs.clear(),this.activeSensors.clear(),this.lastEvents=[]}sortedBodies(){return Array.from(this.bodies.values()).sort((e,t)=>e.index-t.index)}sortedColliders(){return Array.from(this.colliders.values()).sort((e,t)=>e.index-t.index)}applySprings(e){for(let t of Array.from(this.springs.values()).sort((e,t)=>e.id.localeCompare(t.id))){let i=this.bodies.get(t.bodyId);if(!i||i.sleeping)continue;let n="point"===t.target.type?t.target:this.bodies.get(t.target.bodyId);if(!n)continue;let s=n.x-i.x,r=n.y-i.y,o=Math.sqrt(s*s+r*r);if(En>=o)continue;let a=s/o,l=r/o,d=(o-t.restLength)*t.stiffness+((("vx"in n?n.vx:0)-i.vx)*a+(("vy"in n?n.vy:0)-i.vy)*l)*t.damping;i.vx+=d*a*e/i.mass,i.vy+=d*l*e/i.mass}}resolveBodyPairs(e,t,i){for(let n of t){let[t,s]=n.split(":").map(Number),r=e[t],o=e[s];if(!r||!o)continue;let a=Rt(r,o);a&&(this.resolveDynamicCollision(r,o,a),i&&this.lastEvents.push({type:"contact",bodyId:r.id,otherId:o.id,sensor:!1}))}}bodyPairKeys(e){let t=Math.max(1,this.options.cellSize),i=/* @__PURE__ */new Map;for(let n=0;e.length>n;n+=1){if(!1===e[n].bodyCollisions)continue;let s=Nt(e[n]),r=Math.floor(s.minX/t),o=Math.floor(s.maxX/t),a=Math.floor(s.minY/t),l=Math.floor(s.maxY/t);for(let e=r;o>=e;e+=1)for(let t=a;l>=t;t+=1){let s=`${e}:${t}`,r=i.get(s);r?r.push(n):i.set(s,[n])}}let n=/* @__PURE__ */new Set;for(let t of Array.from(i.keys()).sort()){let s=i.get(t)??[];s.sort((e,t)=>e-t);for(let t=0;s.length>t;t+=1)for(let i=t+1;s.length>i;i+=1){let r=s[t],o=s[i];!1===e[r].bodyCollisions||!1===e[o].bodyCollisions||Dt(Nt(e[r]),Nt(e[o]))&&n.add(`${r}:${o}`)}}return Array.from(n).sort((e,t)=>{let[i,n]=e.split(":").map(Number),[s,r]=t.split(":").map(Number);return i===s?n-r:i-s})}resolveDynamicCollision(e,t,i){(e.fixedPosition||t.fixedPosition)&&(!e.sleeping&&null==e.fixedPosition?.x||!t.sleeping&&null==t.fixedPosition?.x?(e.sleeping||null!=e.fixedPosition?.y)&&(t.sleeping||null!=t.fixedPosition?.y)&&(i=Mt(e,t,"y")):i=Mt(e,t,"x")),e.sleeping&&this.contactOpposesGravity(i.nx,i.ny)&&this.supportedThisStep.add(t.id),t.sleeping&&this.contactOpposesGravity(-i.nx,-i.ny)&&this.supportedThisStep.add(e.id);let n=e.sleeping?0:1/e.mass,s=t.sleeping?0:1/t.mass,r=null==e.fixedPosition?.x?n:0,o=null==e.fixedPosition?.y?n:0,a=null==t.fixedPosition?.x?s:0,l=null==t.fixedPosition?.y?s:0,d=e.fixedPosition||t.fixedPosition?i.nx**2*(r+a)+i.ny**2*(o+l):n+s;if(En>=d)return;let h=Math.max(0,i.penetration-Rn)/d;e.x-=i.nx*h*r,e.y-=i.ny*h*o,t.x+=i.nx*h*a,t.y+=i.ny*h*l;let u=(t.vx-e.vx)*i.nx+(t.vy-e.vy)*i.ny;if(u>0)return;let c=Math.abs(u),p=-(1+$t(e.restitution,t.restitution,this.options.restitution))*u/d,f=p*i.nx,m=p*i.ny;e.vx-=f*r,e.vy-=m*o,t.vx+=f*a,t.vy+=m*l,this.applyFriction(e,t,i,p,n,s),c>this.options.contactWakeSpeed&&(this.wake(e),this.wake(t))}applyFriction(e,t,i,n,s,r){let o=-i.ny,a=i.nx,l=(t.vx-e.vx)*o+(t.vy-e.vy)*a,d=null==e.fixedPosition?.x?s:0,h=null==e.fixedPosition?.y?s:0,u=null==t.fixedPosition?.x?r:0,c=null==t.fixedPosition?.y?r:0,p=e.fixedPosition||t.fixedPosition?o**2*(d+u)+a**2*(h+c):s+r;if(En>=Math.abs(l)||En>=p)return;let f=qt(e.friction,t.friction,this.options.friction),m=Ct(-l/p,-n*f,n*f),y=m*o,x=m*a;e.vx-=y*d,e.vy-=x*h,t.vx+=y*u,t.vy+=x*c}resolveColliders(e,t,i){for(let n of e)for(let e of t){if(!Kt(e,n)||!Dt(Nt(n),Ft(e)))continue;let t=Yt(n,e);t&&(this.resolveStaticCollision(n,e,t),this.contactOpposesGravity(t.nx,t.ny)&&this.supportedThisStep.add(n.id),i&&this.lastEvents.push({type:"contact",bodyId:n.id,otherId:e.id,sensor:!1}))}}resolveStaticCollision(e,t,i){e.x+=i.nx*Math.max(0,i.penetration-Rn),e.y+=i.ny*Math.max(0,i.penetration-Rn);let n=e.vx*i.nx+e.vy*i.ny;if(0>n){let s=$t(e.restitution,t.restitution,this.options.restitution);e.vx-=(1+s)*n*i.nx,e.vy-=(1+s)*n*i.ny;let r=-i.ny,o=i.nx,a=e.vx*r+e.vy*o,l=qt(e.friction,t.friction,this.options.friction);e.vx-=a*r*l,e.vy-=a*o*l}wt(e)}updateSensors(e){let t=/* @__PURE__ */new Set,i=this.sortedColliders().filter(e=>e.sensor);for(let n of e){let e=Nt(n);for(let s of i){if(!Kt(s,n)||!Dt(e,Ft(s))||!Yt(n,s))continue;let i=Wt(s.id,n.id);t.add(i),this.activeSensors.has(i)||this.lastEvents.push({type:"sensor-enter",bodyId:n.id,sensorId:s.id})}}for(let e of Array.from(this.activeSensors).sort()){if(t.has(e))continue;let{sensorId:i,bodyId:n}=Xt(e);this.lastEvents.push({type:"sensor-exit",bodyId:n,sensorId:i})}this.activeSensors=t}updateSleeping(e,t){let i=Math.hypot(this.options.gravity.x,this.options.gravity.y)>1;for(let n of e)this.options.sleepSpeed>Math.sqrt(n.vx*n.vx+n.vy*n.vy)&&this.options.sleepSpeed*t>Math.sqrt((n.x-n.prevX)*(n.x-n.prevX)+(n.y-n.prevY)*(n.y-n.prevY))&&(!i||this.supportedThisStep.has(n.id))?(n.sleepTime+=t,!n.sleeping&&n.sleepTime>=this.options.sleepAfter&&(n.sleeping=!0,n.vx=0,n.vy=0,this.lastEvents.push({type:"sleep",bodyId:n.id}))):n.sleeping?this.wake(n):n.sleepTime=0}contactOpposesGravity(e,t){let{x:i,y:n}=this.options.gravity,s=Math.hypot(i,n);return 1e-9>=s||-.2>(e*i+t*n)/s}wake(e){e.sleeping&&this.lastEvents.push({type:"wake",bodyId:e.id}),e.sleeping=!1,e.sleepTime=0}nextRandom(){return this.random()}},Wn=["binId","targetBin","category","windowIndex","lane","group"],Xn=class{constructor(e=!1){this.bins=/* @__PURE__ */new Map,this.nextIndex=0,this.config=e}updateConfig(e){void 0!==e&&(this.config=e,!1===e&&this.clear())}isEnabled(){return!1!==this.config}add(e){if(!1===this.config)return null;let t=this.nextIndex;this.nextIndex+=1;let i=ei(Zt(this.config.binAccessor,e,t))??ti(e),n=ei(Zt(this.config.labelAccessor,e,t))??i,s=Jt(this.config.valueAccessor,e,t),r=Math.max(0,Math.floor(this.config.retainBodyIds??12)),o=this.bins.get(i);return o||(o={id:i,label:n,bodyIds:[],x:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0},y:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0},value:{count:0,total:0,mean:0,m2:0,min:1/0,max:-1/0}},this.bins.set(i,o)),o.label=n,o.lastBodyId=e.id,o.lastDatum=e.datum,Ut(o.x,e.x),Ut(o.y,e.y),Ut(o.value,s),r>0&&(o.bodyIds.push(e.id),o.bodyIds.length>r&&(o.bodyIds=o.bodyIds.slice(o.bodyIds.length-r))),ii(o)}clear(){this.bins.clear(),this.nextIndex=0}snapshot(){return Array.from(this.bins.values()).map(ii)}restore(e=[]){this.bins.clear();for(let t of e)this.bins.set(t.id,{id:t.id,label:t.label,bodyIds:t.bodyIds.slice(),lastBodyId:t.lastBodyId,lastDatum:t.lastDatum,x:Vt(t.x),y:Vt(t.y),value:Vt(t.value)});this.nextIndex=e.reduce((e,t)=>e+t.count,0)}totals(){let e=this.snapshot();return{bins:e.length,count:e.reduce((e,t)=>e+t.count,0),total:e.reduce((e,t)=>e+t.total,0)}}},zn={bodyLimit:1/0,eviction:"oldest",fixedDt:1/120,maxDeltaSeconds:.1,maxSubsteps:8,settleStepLimit:1200,timeScale:1},Gn={chartId:"physics",chartType:"physics",sensors:{},onObservation:void 0,onSimulationStateChange:void 0},Hn=class{constructor(e={}){this.id="builtin",this.capabilities={...(new Yn).capabilities,engine:"builtin"},this.world=new Yn(e)}init(e={}){this.world.init(e)}spawn(e){this.world.spawn(e)}remove(e){this.world.remove(e)}setColliders(e){this.world.setColliders(e)}setConstraint(e){return this.world.setConstraint(e)}removeConstraint(e){this.world.removeConstraint(e)}applyImpulse(e,t,i){this.world.applyImpulse(e,t,i)}step(e){this.world.step(e)}settle(e,t){return this.world.settle(e,t)}readState(e){return this.world.readState(e)}events(){return this.world.events()}activeSensorPairs(){return this.world.activeSensorPairs()}allSleeping(){return this.world.allSleeping()}snapshot(){return this.world.snapshot()}restore(e){this.world.restore(e)}nextRandom(){return this.world.nextRandom()}dispose(){this.world.dispose()}},Kn={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},Un=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=Bi({kind:"initialize"},[],this.revisions),this.listeners=/* @__PURE__ */new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){let i=Bi(e,t,this.revisions);this.revisions=i.revisions,this.latest=i;for(let e of[...this.listeners])e();return i}};import{quadtree as _n}from"d3-quadtree";var Vn=class{constructor(){this.maxSearchRadius=0,this.revision=-1,this.tree=null}hitTest(e,t,i,n,s,r=0,o){let a=this.ensure(e,t);if(!a)return null;let l=null,d=1/0,h=Math.max(0,o?.searchRadius??Math.max(0,r)+this.maxSearchRadius),u=n-h,c=n+h,p=s-h,f=s+h;return a.visit((e,t,a,h,m)=>{if(u>h||t>c||p>m||a>f)return!0;if(e.length)return!1;let y=e;for(;y;){let e=y.data;if(e&&(!o?.include||o.include(e))){let t=o?.distanceSquared?o.distanceSquared(e,n,s):mi(e,n,s,Math.max(0,r));null!=t&&(d>t||t===d&&i.indexOf(e.id)>i.indexOf(l?.id??""))&&(l=e,d=t)}y=y.next}return!1}),l}ensure(e,t){if(this.tree&&this.revision===t)return this.tree;let i=e.readState();return 0===i.length?(this.tree=null,this.maxSearchRadius=0,this.revision=t,null):(this.maxSearchRadius=i.reduce((e,t)=>{return Math.max(e,"circle"===(i=t).shape.type?i.shape.radius:Math.hypot(i.shape.width,i.shape.height)/2);var i},0),this.tree=_n().x(e=>e.x).y(e=>e.y).addAll(i),this.revision=t,this.tree)}},Qn=["data","scene-geometry","data-paint","accessibility","evidence"],Zn=["scene-geometry","data-paint","accessibility","evidence"],Jn=["overlay","accessibility","evidence"],es=(e,t)=>({retainedData:e,invalidations:t}),ts=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],is=["scene-geometry","data-paint","accessibility","evidence"],ns=[],ss={engine:es("rebuild",["scene-geometry","data-paint","accessibility","evidence"]),kernel:es("preserve",is),colliders:es("preserve",is),sediment:es("preserve",is),bodyBudget:es("preserve",ts),bodyLimit:es("preserve",ts),eviction:es("preserve",ts),fixedDt:es("preserve",ns),maxDeltaSeconds:es("preserve",ns),maxSubsteps:es("preserve",ns),settleStepLimit:es("preserve",ns),timeScale:es("preserve",ns),observation:es("preserve",ns)},rs=es("preserve",ts),os=["seed","fixedDt","cellSize","collisionIterations","velocityDamping","sleepSpeed","sleepAfter","restitution","friction","maxVelocity","contactWakeSpeed"],as=class{constructor(){this.seconds=0,this.speed=8,this.scratch=[]}setKernelOptions(e){this.speed=Ei(e)}reset(){this.seconds=0}isAtRest(){return this.seconds>=.6}refresh(e,t,i){if(i>0)return void(this.seconds=0);let n=e.readState(this.scratch),s=this.speed*this.speed,r=!0;for(let e of n)if(!e.sleeping&&e.vx*e.vx+e.vy*e.vy>=s){r=!1;break}this.seconds=r?this.seconds+Math.max(0,t):0}},ls=class{constructor(e={}){this.activeSensorPairs=/* @__PURE__ */new Set,this.accumulator=0,this.bodyBudgetObservationKey="ok",this.bodySpatialIndex=new Vn,this.elapsedSeconds=0,this.liveBodyOrder=[],this.nextSequence=0,this.paused=!1,this.queue=[],this.revision=0,this.updateResults=new Un,this.simulationState="settled",this.visible=!0,this.quiescence=new as;let{bodyBudget:t,colliders:i,engine:n,kernel:s,observation:r,sediment:o,...a}=e;this.config={...zn,...a},this.configInput={...e},this.bodyBudget=t??{},this.engineInput=n,this.observation=si(r),this.sediment=new Xn(o??!1),this.world=wi(n,{fixedDt:this.config.fixedDt,...s}),this.quiescence.setKernelOptions(s),i&&this.world.setColliders(ui(i))}updateConfig(e){let t=Ci(e,this.configInput),{colliders:i,bodyBudget:n,engine:s,kernel:r,observation:o,sediment:a,...l}=e;if(this.config={...this.config,...l},void 0!==n&&(this.bodyBudget=n,!1===n&&(this.bodyBudgetObservationKey="ok")),s&&s!==this.engineInput){let e=this.world.snapshot();this.world.dispose(),this.engineInput=s,this.world=wi(s,e.options),this.world.restore(e),this.revision+=1}if(r&&!Ai(r,this.configInput.kernel)){let e=this.world.snapshot(),t={...e.options,...r,gravity:{...e.options.gravity,...r.gravity}};this.world.restore({...e,options:t}),this.quiescence.setKernelOptions(t),this.revision+=1}o&&(this.observation=si(o,this.observation)),this.sediment.updateConfig(a),i&&(this.world.setColliders(ui(i)),this.revision+=1),this.configInput={...this.configInput,...e};let d=Oi(t);this.updateResults.record({kind:"config",keys:t},d.invalidations)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setColliders(e){this.world.setColliders(ui(e)),this.revision+=1,this.updateResults.record({kind:"config",keys:["colliders"]},Oi(["colliders"]).invalidations)}enqueue(e,t){let i=Array.isArray(e)?e:[e],n=t?di(i,{...t,startAt:t.startAt??this.elapsedSeconds}):i;for(let e of n)this.queue.push({...ri(e),sequence:this.nextSequence,spawnAt:e.spawnAt??this.elapsedSeconds}),this.nextSequence+=1;this.queue.sort(pi),n.length>0&&(this.revision+=1),this.updateResults.record({kind:"enqueue",count:n.length},n.length?Qn:[])}enqueueWithResult(e,t){return this.enqueue(e,t),this.updateResults.last}spawnNow(e){this.spawnOne(ri(e)),this.nextSequence+=1,this.observeBodyBudget(),this.evictOverflow(),this.revision+=1,this.updateResults.record({kind:"enqueue",count:1},Qn)}materializeDueSpawns(){let e=this.revision,t=[],i=[];return this.spawnDue(t,i),0===t.length||(this.observeBodyBudget(i),this.evictOverflow(i),this.syncSimulationState(i),this.revision+=1,this.updateResults.record({kind:"enqueue",count:t.length},this.revision!==e?Qn:[])),t}clear(){let e=this.world.snapshot().options;this.world.init({...e,fixedDt:this.config.fixedDt}),this.activeSensorPairs.clear(),this.liveBodyOrder=[],this.queue=[],this.accumulator=0,this.elapsedSeconds=0,this.nextSequence=0,this.quiescence.reset(),this.sediment.clear(),this.bodyBudgetObservationKey="ok",this.revision+=1,this.syncSimulationState(),this.updateResults.record({kind:"clear"},Qn)}tick(e,t){let i=this.revision,n=[],s=[],r=[],o=[],a=[];if(this.paused||!this.visible){let e=this.result(0,n,s,r,o,a,!1);return this.updateResults.record({kind:"tick",count:0},[]),e}let l=Math.max(0,Math.min(Number.isFinite(e)?e:0,this.config.maxDeltaSeconds))*this.config.timeScale;this.spawnDue(n,a);let d=this.observeBodyBudget(a),h=this.evictOverflow(a);s.push(...h.evicted),r.push(...h.sedimented),this.syncSimulationState(a),n.length>0&&this.quiescence.reset(),this.accumulator+=l;let u=this.stepObserver(t,{spawned:n,evicted:s,sedimented:r,events:o,observations:a}),c=l>0?Math.floor((this.accumulator+1e-9*this.config.fixedDt)/this.config.fixedDt):0,{steps:p,budget:f}=Yi(this.settleHost(),Math.min(c,this.config.maxSubsteps),{spawned:n,evicted:s,sedimented:r,events:o,observations:a},{stopAtRest:!1,shouldStop:()=>this.paused||!this.visible,afterStep:u});this.accumulator=Math.max(0,this.accumulator-p*this.config.fixedDt),p===this.config.maxSubsteps&&(this.accumulator=Math.min(this.accumulator,this.config.fixedDt)),(p>0||n.length>0||s.length>0||r.length>0||o.length>0)&&(this.revision+=1);let m=this.result(p,n,s,r,o,a,void 0,f??d);return this.updateResults.record({kind:"tick",count:p},this.revision!==i?n.length||s.length||r.length?Qn:Zn:[]),m}settle(e=this.config.settleStepLimit){return this.runSettle(e,!1).steps}settleWithObservations(e=this.config.settleStepLimit,t){return this.runSettle(e,!0,t)}stepObserver(e,t){return Ri(e,e=>(e&&(this.revision+=1),this.result(e,t.spawned,t.evicted,t.sedimented,t.events,t.observations)))}settleHost(){return{fixedDt:this.config.fixedDt,queueSize:()=>this.queue.length,atRest:()=>this.atRest(),advanceTime:e=>{this.elapsedSeconds+=e},spawnDue:(e,t)=>this.spawnDue(e,t),observeBodyBudget:e=>this.observeBodyBudget(e),evictOverflow:e=>this.evictOverflow(e),step:e=>this.world.step(e),drainEvents:()=>this.world.events(),observeKernelEvents:(e,t)=>this.observeKernelEvents(e,t),observeSensorTransitions:e=>this.observeSensorTransitions(e),refreshQuiescence:(e,t)=>this.quiescence.refresh(this.world,e,t)}}runSettle(e,t,i){let n=this.revision,s=[],r=[],o=[],a=[],l=t?[]:void 0;if(t&&(this.paused||!this.visible)){let e=this.result(0,s,r,o,a,l??[],!1);return this.updateResults.record({kind:"settle",count:0},[]),e}this.spawnDue(s,l);let d=this.observeBodyBudget(l),h=this.evictOverflow(l);r.push(...h.evicted),o.push(...h.sedimented),this.syncSimulationState(l),s.length>0&&this.quiescence.reset();let u=t?{spawned:s,evicted:r,sedimented:o,events:a,observations:l}:{spawned:s},c=this.stepObserver(i,{spawned:s,evicted:r,sedimented:o,events:a,observations:l??[]}),{steps:p,budget:f}=Yi(this.settleHost(),e,u,{afterStep:c,continueWhile:i?.continueWhile,shouldStop:t?()=>this.paused||!this.visible:void 0}),m=s.length+r.length+o.length>0;(p>0||m||a.length>0)&&(this.revision+=1);let y=this.result(p,s,r,o,a,l??[],void 0,f??d);return this.updateResults.record({kind:"settle",count:p},this.revision===n?[]:m?Qn:Zn),y}readBodies(e=[]){return this.world.readState(e)}readSediment(){return this.sediment.snapshot()}bodyBudgetStatus(){return this.evaluateBodyBudget()}sedimentTotals(){return this.sediment.totals()}sedimentHeightfield(e={}){return ni(this.readSediment(),e)}hitTest(e,t,i=0,n){return this.bodySpatialIndex.hitTest(this.world,this.revision,this.liveBodyOrder,e,t,i,n)}events(){return this.world.events()}allSleeping(){return this.world.allSleeping()}atRest(){return this.world.allSleeping()||this.quiescence.isAtRest()}hasPendingWork(){return this.queue.length>0||!this.atRest()}queueSize(){return this.queue.length}liveBodyCount(){return this.liveBodyOrder.length}elapsed(){return this.elapsedSeconds}recordObservation(e){let{timestamp:t,chartType:i,chartId:n,...s}=e,r={...s,timestamp:t??this.elapsedSeconds,chartType:i??this.observation.chartType,chartId:n??this.observation.chartId};return this.emitObservation(r),this.updateResults.record({kind:"update",count:1},["evidence"]),r}getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(e){return this.updateResults.subscribe(e)}version(){return this.revision}setPaused(e){let t=this.paused!==e;this.paused=e,this.syncSimulationState(),this.updateResults.record({kind:"pause"},t?Jn:[])}setVisible(e){let t=this.visible!==e;this.visible=e,this.syncSimulationState(),this.updateResults.record({kind:"visibility"},t?Jn:[])}remove(e){let t=new Set(e),i=new Set(this.liveBodyOrder),n=new Set(this.queue.map(e=>e.id));this.queue=this.queue.filter(e=>!t.has(e.id)),this.liveBodyOrder=this.liveBodyOrder.filter(e=>!t.has(e)),this.world.remove(e),this.removeActiveSensorPairsForBodies(t);let s=e.filter(e=>i.has(e)||n.has(e));return s.length>0&&(this.revision+=1,this.syncSimulationState()),this.updateResults.record({kind:"remove",keys:s,count:s.length},s.length?Qn:[]),s}setConstraint(e){let t=this.world.setConstraint(e);return this.revision+=1,this.updateResults.record({kind:"constraint",keys:[t]},Zn),t}removeConstraint(e){this.world.removeConstraint(e),this.revision+=1,this.updateResults.record({kind:"constraint",keys:[e]},Zn)}applyImpulse(e,t,i){this.world.applyImpulse(e,t,i),this.revision+=1,this.updateResults.record({kind:"impulse",keys:[e]},Zn)}nextRandom(){return this.world.nextRandom()}controls(){return e=this,{applyImpulse:(t,i,n)=>e.applyImpulse(t,i,n),clear:()=>e.clear(),hitTest:(t,i,n)=>e.hitTest(t,i,n),pause:()=>e.setPaused(!0),push:(t,i)=>e.enqueue(t,i),pushMany:(t,i)=>e.enqueue(t,i),bodyBudgetStatus:()=>e.bodyBudgetStatus(),readBodies:t=>e.readBodies(t),readSediment:()=>e.readSediment(),recordObservation:t=>e.recordObservation(t),remove:t=>e.remove(t),restore:t=>e.restore(t),resume:()=>e.setPaused(!1),settle:t=>e.settle(t),settleWithObservations:t=>e.settleWithObservations(t),snapshot:()=>e.snapshot(),sedimentHeightfield:t=>e.sedimentHeightfield(t),sedimentTotals:()=>e.sedimentTotals(),step:t=>e.tick(t)};var e}snapshot(){let e=this.world.snapshot();return{accumulator:this.accumulator,activeSensorPairs:Array.from(this.activeSensorPairs).sort(),bodyBudget:ci(this.bodyBudget),config:{...this.config,kernel:fi(e.options)},elapsedSeconds:this.elapsedSeconds,paused:this.paused,queue:this.queue.map(hi),revision:this.revision,sediment:this.readSediment(),simulationState:this.simulationState,liveBodyOrder:this.liveBodyOrder.slice(),visible:this.visible,world:e}}restore(e){let t=this.simulationState;this.config={bodyLimit:e.config.bodyLimit,eviction:e.config.eviction,fixedDt:e.config.fixedDt,maxDeltaSeconds:e.config.maxDeltaSeconds,maxSubsteps:e.config.maxSubsteps,settleStepLimit:e.config.settleStepLimit,timeScale:e.config.timeScale},this.configInput={...e.config,bodyBudget:ci(e.bodyBudget??{}),kernel:fi(e.world.options)},this.bodyBudget=ci(e.bodyBudget??{}),this.bodyBudgetObservationKey="ok",this.quiescence.setKernelOptions(e.world.options),this.quiescence.reset(),this.activeSensorPairs=new Set(e.activeSensorPairs),this.accumulator=e.accumulator,this.elapsedSeconds=e.elapsedSeconds,this.paused=e.paused,this.queue=e.queue.map(hi).sort(pi),this.revision=e.revision,this.sediment.restore(e.sediment??[]),this.simulationState=e.simulationState??Ni(e.paused,e.visible,e.queue.length>0,e.world.bodies.every(e=>e.sleeping)),this.liveBodyOrder=e.liveBodyOrder.slice(),this.visible=e.visible,this.nextSequence=this.queue.reduce((e,t)=>Math.max(e,t.sequence),-1)+1,this.world.restore(e.world),this.updateResults.record({kind:"restore"},Qn),this.simulationState!==t&&this.observation.onSimulationStateChange?.(this.simulationState,t)}spawnDue(e,t){for(;this.queue.length>0&&this.elapsedSeconds+1e-9*this.config.fixedDt>=this.queue[0].spawnAt;){let i=this.queue.shift();if(!i)return;this.spawnOne(i,t),e.push(i.id)}}spawnOne(e,t){this.liveBodyOrder=this.liveBodyOrder.filter(t=>t!==e.id),this.removeActiveSensorPairsForBodies(/* @__PURE__ */new Set([e.id])),this.world.spawn(e),this.liveBodyOrder.push(e.id);for(let t of e.springs??[])this.world.setConstraint({...t,bodyId:e.id});let i=this.world.readState().find(t=>t.id===e.id);this.emitObservation({type:"physics-spawn",timestamp:this.elapsedSeconds,chartType:this.observation.chartType,chartId:this.observation.chartId,bodyId:e.id,datum:i?.datum??e.datum,x:i?.x??e.x,y:i?.y??e.y},t)}result(e,t,i,n,s,r,o,a=this.evaluateBodyBudget()){this.syncSimulationState(r);let l=this.world.allSleeping();return{budget:a,elapsedSeconds:this.elapsedSeconds,evicted:i,events:s,observations:r,queueSize:this.queue.length,revision:this.revision,shouldContinue:o??(!this.paused&&this.visible&&(this.queue.length>0||!this.atRest())),sleeping:l,sedimented:n,spawned:t,steps:e}}observeKernelEvents(e,t){$i(this.world,e,this.observationContext(t))}observeSensorTransitions(e){this.activeSensorPairs=qi(this.world,this.activeSensorPairs,this.observationContext(e))}removeActiveSensorPairsForBodies(e){Pi(this.activeSensorPairs,e)}observationContext(e){return{elapsedSeconds:this.elapsedSeconds,observation:this.observation,emit:t=>this.emitObservation(t,e)}}emitObservation(e,t){t?.push(e),this.observation.onObservation?.(e)}evaluateBodyBudget(){return ki({bodyLimit:this.config.bodyLimit,engineMaxBodiesHint:this.world.capabilities.maxBodiesHint,evictionEnabled:!1!==this.config.eviction,liveBodies:this.liveBodyOrder.length,queuedBodies:this.queue.length,sedimentEnabled:this.sediment.isEnabled(),options:this.bodyBudget})}observeBodyBudget(e){let t=this.evaluateBodyBudget();if("ok"===t.state||!1===this.bodyBudget)return this.bodyBudgetObservationKey="ok",t;let i=`${t.state}:${t.action}`;return i===this.bodyBudgetObservationKey||(this.bodyBudgetObservationKey=i,Di(t,this.observationContext(e))),t}syncSimulationState(e){let t=Ni(this.paused,this.visible,this.queue.length>0,this.atRest());if(t===this.simulationState)return;let i=this.simulationState;this.simulationState=t,Fi(i,t,this.observationContext(e))}evictOverflow(e){let{evicted:t,sedimented:i,liveBodyOrder:n}=ji(this.world,this.sediment,this.config.eviction,this.config.bodyLimit,this.liveBodyOrder,this.observationContext(e));return t.length>0&&(this.liveBodyOrder=n,this.removeActiveSensorPairsForBodies(new Set(t))),{evicted:t,sedimented:i}}};import*as ds from"react";import{jsx as hs}from"react/jsx-runtime";var us,cs={isActive:!1,predicate:()=>!0};import{scaleLinear as ps}from"d3-scale";export{Vi as a,i as b,n as c,s as d,r as e,o as f,a as g,l as h,d as i,Zi as j,h as k,u as l,c as m,p as n,f as o,m as p,y as q,x as r,g as s,b as t,v as u,w as v,S as w,M as x,k as y,sn as z,I as A,zt as B,Ht as C,ni as D,gi as E,bi as F,Un as G,ls as H,A as I,C as J,$ as K,D as L,L as M,j as N,E as O,R as P,Y as Q,W as R,X as S,z as T,G as U,H as V,K as W,ee as X,de as Y,he as Z,ue as _,ce as $,mn as aa,Wi as ba,ge as ca,ve as da,we as ea,Se as fa,Me as ga,ke as ha,Bn as ia,Ie as ja,Be as ka,Oe as la,Ae as ma,An as na,Cn as oa,$e as pa,qe as qa,Pe as ra,Ne as sa,Fe as ta,Je as ua,et as va,tt as wa,Xe as xa,ze as ya,Qe as za,Ze as Aa,Te as Ba,qn as Ca,Re as Da,We as Ea,vt as Fa,Xi as Ga,zi as Ha,Gi as Ia};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let[t,a]=e,n=160>t||116>a,r=n?Math.min(12,Math.max(2,.08*t)):32,i=n?Math.min(8,Math.max(2,.12*a)):24,l=n?i:34;return{width:t,height:a,plot:{x:r,y:i,width:Math.max(1,t-2*r),height:Math.max(1,a-i-l)}}}function t(e){let t=(e??"")+"";if(!t)return"#4e79a7";let a=["#4e79a7","#59a14f","#e15759","#f28e2b","#76b7b2","#edc948","#b07aa1","#ff9da7"],n=0;for(let e=0;t.length>e;e+=1)n=31*n+t.charCodeAt(e)>>>0;return a[n%a.length]}function a(e,t){return t?(a,n)=>({..."function"==typeof e?e(a,n):e,..."function"==typeof t?t(a,n):t}):e}function n(e,a="#4e79a7",n){let r=n?.styleRules,i=!!r&&r.length>0,l=i?b(n?.valueAccessor):void 0;return n=>{let o=n.datum,u=o&&e?"function"==typeof e?e(o,0):o[e]:void 0,s={fill:null==u?a:t(u),stroke:"#111827",strokeWidth:1,opacity:.9};return i&&o&&Object.assign(s,v(o,r,{value:l?l(o):void 0,category:null==u?void 0:u+""})),s}}function r(e,t,a,n){return{fixedDt:1/120,maxSubsteps:8,colliders:t,observation:{chartType:a},kernel:{seed:e,gravity:{x:0,y:760},cellSize:36,collisionIterations:6,velocityDamping:.995,restitution:.08,friction:.4,sleepSpeed:8,sleepAfter:.6,...n}}}function i(t,a,n){if(!t.length)return[];let r=e(a),i=r.plot.width/Math.max(1,t.length),l=t.reduce((e,t)=>Math.max(e,t.value),1),o=.62*r.plot.height,u=r.plot.y+r.plot.height;return t.map((e,t)=>{let a=Math.max(8,e.value/l*o),s=`${n} ${e.label}: ${e.value}${null==e.secondary?"":`, ${e.secondary} secondary`}`;return{id:`${n}-${e.label}`,label:s,description:s,datum:e,x:r.plot.x+(t+.5)*i,y:u-a/2,shape:"rect",width:Math.max(12,.58*i),height:a,group:n}})}function l(e,t,a){return"function"==typeof a?a(e,t):e[a]}function o(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function u(e,t,a){return Math.max(t,Math.min(a,e))}function s(e,t){let a=o(e);return null!=a&&a>0?a:t}function c(e){if(!e)return;let t=o(e[0]),a=o(e[1]);return null!=t&&null!=a?t>a?[a,t]:[t,a]:void 0}function h(e){return((e??"unknown")+"").trim().replace(/[^A-Za-z0-9_-]+/g,"_")||"unknown"}function f(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function m(e,t,a=0){let n=new Set(e.filter(e=>null!=e.id).map(e=>e.id+"")),r=/* @__PURE__ */new Map;for(let i of e){let e=null==i.id?`${t}-${a++}`:i.id+"";for(;null==i.id&&n.has(e);)e=`${t}-${a++}`;n.add(e),r.set(e,null==i.id?{...i,id:e}:i)}return{seed:e,rows:Array.from(r.values()),nextId:a}}function d(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>(e+"").trim()).filter(Boolean),a=t.length?t:["Intake"],n=Math.max(a.length,Math.round(e.count??Math.max(48,12*a.length))),r=s(e.unitValue,1),i=f(e.seed??1),l=e.idPrefix??"mechanical-pile",o=a.map(()=>.65+.9*i()),u=o.reduce((e,t)=>e+t,0)||1,c=n-a.length,h=o.map(e=>e/u*c),m=h.map(e=>1+Math.floor(e)),d=n-m.reduce((e,t)=>e+t,0),p=h.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;d>0;e=(e+1)%p.length)m[p[e].index]+=1,d-=1;return a.map((e,t)=>({id:`${l}-${t}`,category:e,value:m[t]*r,mechanical:!0,unitCount:m[t],unitValue:r,share:m[t]/n}))}function p(e,t){let a=e/t,n=Math.round(a);return Math.ceil(n>0&&Number.EPSILON*a*4>=Math.abs(a-n)?n:a)}function g(e){let t=Math.max(2,Math.round(e.bins)),a=Math.max(1,Math.round(e.pegRows??t-1)),n=Math.max(1,Math.round(e.count??Math.max(64,4*t))),r=u(Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,0,1),i=f(e.seed??1),l=e.idPrefix??"mechanical";return Array.from({length:n},(e,t)=>{let n=0;for(let e=0;a>e;e+=1)i()<r&&(n+=1);let o=a/2;return{id:`${l}-${t}`,value:n,mechanical:!0,pegRows:a,branchProbability:r,pathRights:n,side:o>n?"left":n>o?"right":"center"}})}function M(e){let{windowSize:t,watermark:a,watermarkAtArrivalAccessor:n}=e;if(!Number.isFinite(t)||0>=t)throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:r}=m(e.data,"event"),i=r.flatMap((t,a)=>{let n=o(l(t,a,e.timeAccessor));return null==n?[]:[{datum:t,index:a,eventTime:n,arrivalTime:o(l(t,a,e.arrivalAccessor))??n,watermarkAtArrival:0,late:!1}]}),u="function"==typeof a?null:o(a?.value),s="function"==typeof a?t:o(a?.delay)??t,c=-1/0,h=-1/0;for(let e of i.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){c=Math.max(c,e.eventTime);let r="function"==typeof a?o(a(c)):c-s;h=u??Math.max(h,r??c-t);let i=n?o(l(e.datum,e.index,n)):null;e.watermarkAtArrival=i??h,e.late=e.watermarkAtArrival>=(Math.floor(e.eventTime/t)+1)*t}return{events:i,watermarkValue:i.length?h:u??-s}}import{Ob as b,Tb as v}from"./c-UMGHCBH5.min.js";export{e as a,a as b,n as c,r as d,i as e,l as f,o as g,u as h,s as i,c as j,h as k,f as l,m,d as n,p as o,g as p,M as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){d(h),d(g),d(v)}function t(e){let{colorBy:t,colorScale:o,color:r,pointRadius:a=5,radiusFn:i,fillOpacity:n=1,fallbackFill:s,baseStyleExtras:l,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:p,resolvedSelection:m,colorDatumAccessor:y,selectionDatumAccessor:d,styleRules:h,ruleContext:g}=e,v=$(()=>e=>{let c="function"==typeof l?l(e):l,u=c?{...c}:{};if(void 0===u.fillOpacity&&(u.fillOpacity=n),void 0===u.fill)if(t){if(o){let r=y?y(e):e;u.fill=T(r,t,o)}}else u.fill=s?s(e):r||G;return void 0===u.r&&(u.r=i?i(e):a),h&&h.length>0&&Object.assign(u,B(e,h,g?g(e):{value:void 0})),u},[t,o,r,a,i,n,s,l,y,h,g]),b=$(()=>L(v,{stroke:c,strokeWidth:u,opacity:f}),[v,c,u,f]);return $(()=>F(b,p??null,m,d),[b,p,m,d])}function o(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,u)=>{let f,p={strokeWidth:t},m=!0===n||Array.isArray(n)&&null!=u&&n.includes(u);return i?f=i(e,u):o?r&&(f=T(e,o,r)):f=a||G,void 0!==f&&(p.stroke=f,m&&(p.fill=f,p.fillOpacity=s)),l?.length&&Object.assign(p,B(e,l,c?c(e,u):{value:void 0,category:u})),p}}function r(e){let{lineWidth:t=2,colorBy:r,colorScale:a,color:i,resolveStroke:n,fillArea:s,areaOpacity:l=.3,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:p,resolvedSelection:m,styleRules:y,ruleContext:d}=e,h=X(()=>o({lineWidth:t,colorBy:r,colorScale:a,color:i,resolveStroke:n,fillArea:s,areaOpacity:l,styleRules:y,ruleContext:d}),[t,r,a,i,n,s,l,y,d]),g=X(()=>L(h,{stroke:c,strokeWidth:u,opacity:f}),[h,c,u,f]);return X(()=>F(g,p??null,m),[g,p,m])}async function a(){return U||(U=await(import("./c-JJKRER47.min.js"))),U}async function i(...e){return(await a()).buildForecast(...e)}async function n(...e){return(await a()).buildAnomalyAnnotations(...e)}async function s(...e){return(await a()).createSegmentLineStyle(...e)}function l(e){let{data:t,xAccessor:o,yAccessor:r,forecast:a,anomaly:s,groupBy:l}=e,c="string"==typeof o?o:ee,u="string"==typeof r?r:te,f=q(()=>{if(!a&&!s)return t;let e="function"==typeof o,i="function"==typeof r;return e||i?t.map(t=>{let a={...t};return e&&(a[ee]=o(t)),i&&(a[te]=r(t)),a}):t},[t,a,s,o,r]),[p,m]=Z(null),[y,d]=Z([]),h=Q(a),g=Q(s);return V(()=>{if(!a&&!s)return void((h.current||g.current)&&(m(null),d([]),h.current=a,g.current=s));let e=!1,t=a!==h.current||s!==g.current;if(h.current=a,g.current=s,t&&(m(null),d([])),a){let t=l&&"string"==typeof l&&"object"==typeof a?{...a,_groupBy:l}:a;i(f,c,u,t,s).then(t=>{e||(m(t),d(t.annotations))}).catch(()=>{e||(m(null),d([]))})}else s&&n(s).then(t=>{e||(m(null),d(t))}).catch(()=>{e||d([])});return()=>{e=!0}},[f,a,s,c,u,l]),{effectiveData:p?p.processedData:t,statisticalAnnotations:y,hasForecast:!!p,xAccessorKey:c,yAccessorKey:u}}import{b as c}from"./c-IBRLFKWA.min.js";import{b as u,c as f}from"./c-HQ27AHMC.min.js";import{a as p,d as m,e as y}from"./c-TTKWXGAI.min.js";import{a as d,h,j as g,k as v}from"./c-MTX2AO5S.min.js";import{k as b}from"./c-HK4OSLZA.min.js";import{H as A,J as x,K as S,Y as k,_ as L}from"./c-KGROWFT2.min.js";import{Mb as C,Ob as w,Sa as R,Sb as B,Ua as _,_a as H,ab as D,b as j,db as O,jb as F,v as P,z as W}from"./c-G53AVC42.min.js";import{n as G,r as T}from"./c-Y342FJ6K.min.js";import{c as I}from"./c-U6NLVFN4.min.js";import{useMemo as N,useCallback as M,useState as E,useEffect as K,forwardRef as z,useRef as J}from"react";import{useMemo as $}from"react";import{useMemo as X}from"react";var Y="__forecastSegment",U=null;import{useEffect as V,useMemo as q,useRef as Q,useState as Z}from"react";var ee="__semiotic_resolvedX",te="__semiotic_resolvedY";import{jsx as oe}from"react/jsx-runtime";e();var re="__lineObjectSeries",ae=e=>e.parentLine||e,ie=z(function(e,o){let a=J(null);f(o,{variant:"xy",frameRef:a});let i=C(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:n,margin:d,className:h,xFormat:g,yFormat:v,axisExtent:L,xAccessor:B="x",yAccessor:F="y",lineBy:T,lineDataAccessor:z="coordinates",colorBy:$,colorScheme:X,styleRules:U,curve:V="linear",showPoints:q=!1,pointRadius:Q=3,fillArea:Z=!1,areaOpacity:ee=.3,lineWidth:te=2,lineGradient:ie,tooltip:ne,pointIdAccessor:se,annotations:le,directLabel:ce,gapStrategy:ue="break",anomaly:fe,forecast:pe,band:me,xExtent:ye,yExtent:de,frameProps:he={},selection:ge,linkedHover:ve,linkedBrush:be,brush:Ae,onBrush:xe,onObservation:Se,onClick:ke,hoverHighlight:Le,hoverRadius:Ce,chartId:we,loading:Re,loadingContent:Be,emptyContent:_e,legendInteraction:He,legendPosition:De,legend:je,xScaleType:Oe,yScaleType:Fe,color:Pe,stroke:We,strokeWidth:Ge,opacity:Te}=e,{legend:Ie,...Ne}=he,Me=N(()=>P(Ie,je),[Ie,je]),{width:Ee,height:Ke,enableHover:ze,showGrid:Je,showLegend:$e,title:Xe,description:Ye,summary:Ue,accessibleTable:Ve,xLabel:qe,yLabel:Qe}=i,Ze=N(()=>j(n),[n]),et=Array.isArray(Ze[0]?.[z])?Ze[0][z]:Ze;O("LineChart",et,"xAccessor",B),O("LineChart",et,"yAccessor",F);let{effectiveData:tt,statisticalAnnotations:ot}=l({data:Ze,xAccessor:B,yAccessor:F,forecast:pe,anomaly:fe,groupBy:T}),rt="__compoundGroup",at=!(!pe||!T),it=at?rt:pe?Y:T,nt=N(()=>{if(!at)return tt;let e="function"==typeof T?T:e=>e[T];return tt.map(t=>{let o={...t};return o[rt]=`${e(t)}__${t[Y]||"observed"}`,o})},[tt,at,T]),st=at?nt:tt,lt=$||T,ct=N(()=>{if(!pe)return;let e=pe.upperBounds,t=pe.lowerBounds;if(!e&&!t)return;let o="function"==typeof e?e:"string"==typeof e?t=>t[e]:null,r="function"==typeof t?t:"string"==typeof t?e=>e[t]:null,a=1/0,i=-1/0,n=tt;for(let e of n){let t="function"==typeof F?F(e):+e[F];if(isFinite(t)&&(a>t&&(a=t),t>i&&(i=t)),o){let t=o(e);null!=t&&isFinite(t)&&(t>i&&(i=t),a>t&&(a=t))}if(r){let t=r(e);null!=t&&isFinite(t)&&(a>t&&(a=t),t>i&&(i=t))}}return isFinite(a)&&isFinite(i)?[a,i]:void 0},[pe,tt,F]),ut=M(e=>{let t="function"==typeof B?B(e):e[B],o="function"==typeof F?F(e):e[F];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[B,F]),ft=void 0!==st[0]?.[z],pt=ft?re:it,mt=N(()=>{if(ft)return st.map((e,t)=>{let o="function"==typeof T?T(e):"string"==typeof T?e[T]:void 0,r=null==o?"line-"+t:o+"",a=Array.isArray(e[z])?e[z]:[];return{...e,[re]:r,[z]:a.map(t=>({...t,[re]:r,parentLine:e,..."string"==typeof T&&void 0!==e[T]?{[T]:e[T]}:{}}))}});if(it){let e=st.reduce((e,t)=>{let o="function"==typeof it?it(t):t[it];if(!e[o]){let r={[z]:[]};"string"==typeof it&&(r[it]=o),at&&(r[Y]=t[Y],"string"==typeof T&&(r[T]=t[T])),e[o]=r}return e[o][z].push(t),e},{});return Object.values(e)}return[{[z]:st}]},[ft,it,z,st,T,at]),{gapProcessedLineData:yt,hasGaps:dt}=N(()=>{if("interpolate"===ue){let e=!1,t=[];for(let o of mt){let r=(o[z]||[]).filter(t=>!ut(t)||(e=!0,!1));r.length>0&&t.push({...o,[z]:r})}return{gapProcessedLineData:t,hasGaps:e}}if("break"===ue){let e=!1,t=[];for(let o of mt){let r=o[z]||[],a=[],i=0,n=pt&&"string"==typeof pt?o[pt]:void 0;for(let s of r)if(ut(s))e=!0,a.length>0&&(t.push({...o,[z]:a}),a=[],i++);else{let e=null!=n?`${n}__seg${i}`:"__seg"+i;a.push({...s,_gapSegment:e})}a.length>0&&t.push({...o,[z]:a})}return{gapProcessedLineData:t,hasGaps:e}}if("zero"===ue){let e=!1,t="string"==typeof F?F:"y",o=[];for(let r of mt){let a=r[z]||[],i=[];for(let o of a)ut(o)?(e=!0,i.push({...o,[t]:0})):i.push(o);o.push({...r,[z]:i})}return{gapProcessedLineData:o,hasGaps:e}}return{gapProcessedLineData:mt,hasGaps:!1}},[mt,ue,z,ut,pt,F]),ht="object"==typeof ce?ce:{},gt=ht.position||"end",vt=ht.fontSize||11,bt=u({data:tt,rawData:n,colorBy:lt,colorScheme:X,legendInteraction:He,legendPosition:De,frameLegend:Ne,selection:ge,linkedHover:ve,fallbackFields:lt?["string"==typeof lt?lt:""]:[],unwrapData:!1,onObservation:Se,onClick:ke,hoverHighlight:Le,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"LineChart",chartId:we,showLegend:(!ce||void 0!==$e)&&$e,legend:Me,userMargin:d,marginDefaults:i.marginDefaults,loading:Re,loadingContent:Be,emptyContent:_e,width:Ee,height:Ke,hasTitle:!!Xe,axisChrome:W(he,{showAxes:i.showAxes,xLabel:qe,yLabel:Qe})}),At=bt.categoryColorScale,xt=bt.effectiveSelectionHook,St=bt.resolvedSelection,kt=bt.customHoverBehavior,Lt=bt.customClickBehavior,Ct=bt.crosshairProps,wt=N(()=>{if(lt)return ft?e=>{let t=e.parentLine||e;return"function"==typeof lt?lt(t):t[lt]}:lt},[lt,ft]),Rt=N(()=>w(B,F),[B,F]),Bt=r({lineWidth:te,colorBy:wt,colorScale:At,color:Pe,fillArea:Z,areaOpacity:ee,stroke:We,strokeWidth:Ge,opacity:Te,effectiveSelectionHook:xt,resolvedSelection:St,styleRules:U,ruleContext:Rt}),[_t,Ht]=E(null);K(()=>{if(!pe)return void Ht(null);let e=!1;return s(Bt,pe).then(t=>{e||Ht(()=>t)}).catch(()=>{e||Ht(null)}),()=>{e=!0}},[Bt,pe]);let Dt=_t||Bt,jt=t({colorBy:lt,colorScale:At,color:Pe,pointRadius:Q,colorDatumAccessor:ae,selectionDatumAccessor:I,effectiveSelectionHook:xt,resolvedSelection:St}),Ot=Array.isArray(Z)?"mixed":Z?"area":"line",Ft=N(()=>{if(!ce||!lt)return[];let e={position:gt,fontSize:vt,colorBy:lt,color:e=>At?.(e)??G};return void 0===n?[{type:"text",_directLabelRequest:e}]:p(yt.flatMap(e=>(e[z]||[]).map(t=>({...t,parentLine:t.parentLine||e}))),e,B,F)},[n,ce,lt,At,yt,z,B,F,gt,vt]),Pt=N(()=>{if(!ce)return bt.margin;let e="end"===gt?"right":"left";if("number"==typeof d||"number"==typeof d?.[e])return bt.margin;let t=(void 0===n?bt.allCategories:Ft.map(e=>e.label+"")).reduce((e,t)=>Math.max(e,Array.from(t).length*vt*.65),0);return{...bt.margin,[e]:Math.max(bt.margin[e],t+10)}},[n,ce,Ft,gt,vt,d,bt.margin,bt.allCategories]),Wt=T||$,Gt=N(()=>S([{label:qe||A(B),accessor:B,role:"x",format:g},{label:Qe||A(F),accessor:F,role:"y",format:v},...Wt?[{label:A(Wt),accessor:Wt,role:"group"}]:[],...x(me,v)]),[B,F,qe,Qe,Wt,g,v,me]),Tt=c({componentName:"LineChart",data:ft?tt[0]?.[z]||[]:n,accessors:{xAccessor:B,yAccessor:F}}),{brushStreamProps:It}=y({brush:Ae,onBrush:xe,linkedBrush:be,xAccessor:B,yAccessor:F,defaultDimension:"x"}),Nt=N(()=>ft||pt||dt?yt.flatMap(e=>{let t=e[z]||[];return pt&&"string"==typeof pt?t.map(t=>({...t,[pt]:t[pt]??e[pt]})):t}):st,[yt,z,ft,pt,st,dt]),Mt=b(ie),Et={chartType:Ot,...Array.isArray(Z)&&{areaGroups:Z},...Mt&&{lineGradient:Mt},...null!=n&&{data:Nt},xAccessor:B,yAccessor:F,xScaleType:Oe,yScaleType:Fe,...ye&&{xExtent:ye},...!de||null==de[0]&&null==de[1]?ct?{yExtent:ct}:{}:{yExtent:de},groupAccessor:"break"===ue&&dt?"_gapSegment":pt||void 0,...me&&{band:me},curve:V,lineStyle:Dt,...q&&{pointStyle:jt},size:[Ee,Ke],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:Pt,showAxes:i.showAxes,xLabel:qe,yLabel:Qe,xFormat:g,yFormat:v,...void 0!==L&&{axisExtent:L},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},enableHover:ze,showGrid:Je,...bt.legendBehaviorProps,...Xe&&{title:Xe},...Ye&&{description:Ye},...Ue&&{summary:Ue},...void 0!==Ve&&{accessibleTable:Ve},...h&&{className:h},...null!=e.animate&&{animate:e.animate},...R({tooltip:ne,defaultTooltipContent:Gt,multiDefaultContent:_()}),...k({linkedHover:ve,selection:ge,onObservation:Se,onClick:ke,hoverRadius:Ce,hoverHighlight:Le,mobileInteraction:bt.mobileInteraction,customHoverBehavior:kt,customClickBehavior:Lt}),...se&&{pointIdAccessor:se},...(le?.length||ot.length||Ft.length)&&{annotations:[...le||[],...ot,...Ft]},...Ct,...It,...Ne};return bt.earlyReturn?bt.earlyReturn:Tt?/* @__PURE__ */oe(H,{componentName:"LineChart",message:Tt,width:Ee,height:Ke}):/* @__PURE__ */oe(D,{componentName:"LineChart",width:Ee,height:Ke,children:/* @__PURE__ */oe(m,{ref:a,...Et})})});ie.displayName="LineChart";export{t as a,l as b,e as c,r as d,ie as e};
|
|
1
|
+
function e(){d(h),d(g),d(v)}function t(e){let{colorBy:t,colorScale:o,color:r,pointRadius:a=5,radiusFn:i,fillOpacity:n=1,fallbackFill:s,baseStyleExtras:l,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:p,resolvedSelection:m,colorDatumAccessor:y,selectionDatumAccessor:d,styleRules:h,ruleContext:g}=e,v=U(()=>e=>{let c="function"==typeof l?l(e):l,u=c?{...c}:{};if(void 0===u.fillOpacity&&(u.fillOpacity=n),void 0===u.fill)if(t){if(o){let r=y?y(e):e;u.fill=W(r,t,o)}}else u.fill=s?s(e):r||I;return void 0===u.r&&(u.r=i?i(e):a),h&&h.length>0&&Object.assign(u,B(e,h,g?g(e):{value:void 0})),u},[t,o,r,a,i,n,s,l,y,h,g]),b=U(()=>L(v,{stroke:c,strokeWidth:u,opacity:f}),[v,c,u,f]);return U(()=>F(b,p??null,m,d),[b,p,m,d])}function o(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,u)=>{let f,p={strokeWidth:t},m=!0===n||Array.isArray(n)&&null!=u&&n.includes(u);return i?f=i(e,u):o?r&&(f=W(e,o,r)):f=a||I,void 0!==f&&(p.stroke=f,m&&(p.fill=f,p.fillOpacity=s)),l?.length&&Object.assign(p,B(e,l,c?c(e,u):{value:void 0,category:u})),p}}function r(e){let{lineWidth:t=2,colorBy:r,colorScale:a,color:i,resolveStroke:n,fillArea:s,areaOpacity:l=.3,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:p,resolvedSelection:m,styleRules:y,ruleContext:d}=e,h=Y(()=>o({lineWidth:t,colorBy:r,colorScale:a,color:i,resolveStroke:n,fillArea:s,areaOpacity:l,styleRules:y,ruleContext:d}),[t,r,a,i,n,s,l,y,d]),g=Y(()=>L(h,{stroke:c,strokeWidth:u,opacity:f}),[h,c,u,f]);return Y(()=>F(g,p??null,m),[g,p,m])}async function a(){return X||(X=await(import("./c-JJKRER47.min.js"))),X}async function i(...e){return(await a()).buildForecast(...e)}async function n(...e){return(await a()).buildAnomalyAnnotations(...e)}async function s(...e){return(await a()).createSegmentLineStyle(...e)}function l(e){let{data:t,xAccessor:o,yAccessor:r,forecast:a,anomaly:s,groupBy:l}=e,c="string"==typeof o?o:ee,u="string"==typeof r?r:te,f=q(()=>{if(!a&&!s)return t;let e="function"==typeof o,i="function"==typeof r;return e||i?t.map(t=>{let a={...t};return e&&(a[ee]=o(t)),i&&(a[te]=r(t)),a}):t},[t,a,s,o,r]),[p,m]=Z(null),[y,d]=Z([]),h=Q(a),g=Q(s);return V(()=>{if(!a&&!s)return void((h.current||g.current)&&(m(null),d([]),h.current=a,g.current=s));let e=!1,t=a!==h.current||s!==g.current;if(h.current=a,g.current=s,t&&(m(null),d([])),a){let t=l&&"string"==typeof l&&"object"==typeof a?{...a,_groupBy:l}:a;i(f,c,u,t,s).then(t=>{e||(m(t),d(t.annotations))}).catch(()=>{e||(m(null),d([]))})}else s&&n(s).then(t=>{e||(m(null),d(t))}).catch(()=>{e||d([])});return()=>{e=!0}},[f,a,s,c,u,l]),{effectiveData:p?p.processedData:t,statisticalAnnotations:y,hasForecast:!!p,xAccessorKey:c,yAccessorKey:u}}import{b as c}from"./c-IBRLFKWA.min.js";import{b as u,c as f}from"./c-FMCUQ6JX.min.js";import{a as p,d as m,e as y}from"./c-HNHKIMIV.min.js";import{a as d,h,j as g,k as v}from"./c-MTX2AO5S.min.js";import{k as b}from"./c-HK4OSLZA.min.js";import{H as x,J as A,K as S,Y as k,_ as L}from"./c-SAP5KY6R.min.js";import{Nb as C,Pb as w,Sa as R,Tb as B,Ua as H,_a as _,ab as D,b as P,db as j,kb as F,v as O,z as N}from"./c-UMGHCBH5.min.js";import{n as I,r as W}from"./c-Y342FJ6K.min.js";import{c as G}from"./c-U6NLVFN4.min.js";import{useMemo as T,useCallback as M,useState as E,useEffect as K,forwardRef as z,useRef as J}from"react";import{useMemo as U}from"react";import{useMemo as Y}from"react";var $="__forecastSegment",X=null;import{useEffect as V,useMemo as q,useRef as Q,useState as Z}from"react";var ee="__semiotic_resolvedX",te="__semiotic_resolvedY";import{jsx as oe}from"react/jsx-runtime";e();var re="__lineObjectSeries",ae=e=>e.parentLine||e,ie=z(function(e,o){let a=J(null);f(o,{variant:"xy",frameRef:a});let i=C(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:n,margin:d,className:h,xFormat:g,yFormat:v,axisExtent:L,xAccessor:B="x",yAccessor:F="y",lineBy:W,lineDataAccessor:z="coordinates",colorBy:U,colorScheme:Y,styleRules:X,curve:V="linear",showPoints:q=!1,pointRadius:Q=3,fillArea:Z=!1,areaOpacity:ee=.3,lineWidth:te=2,lineGradient:ie,tooltip:ne,pointIdAccessor:se,annotations:le,directLabel:ce,gapStrategy:ue="break",anomaly:fe,forecast:pe,band:me,xExtent:ye,yExtent:de,frameProps:he={},selection:ge,linkedHover:ve,linkedBrush:be,brush:xe,onBrush:Ae,onObservation:Se,onClick:ke,hoverHighlight:Le,hoverRadius:Ce,chartId:we,loading:Re,loadingContent:Be,emptyContent:He,legendInteraction:_e,legendPosition:De,legend:Pe,xScaleType:je,yScaleType:Fe,color:Oe,stroke:Ne,strokeWidth:Ie,opacity:We}=e,{legend:Ge,...Te}=he,Me=T(()=>O(Ge,Pe),[Ge,Pe]),{width:Ee,height:Ke,enableHover:ze,showGrid:Je,showLegend:Ue,title:Ye,description:$e,summary:Xe,accessibleTable:Ve,xLabel:qe,yLabel:Qe}=i,Ze=T(()=>P(n),[n]),et=Array.isArray(Ze[0]?.[z])?Ze[0][z]:Ze;j("LineChart",et,"xAccessor",B),j("LineChart",et,"yAccessor",F);let{effectiveData:tt,statisticalAnnotations:ot}=l({data:Ze,xAccessor:B,yAccessor:F,forecast:pe,anomaly:fe,groupBy:W}),rt="__compoundGroup",at=!(!pe||!W),it=at?rt:pe?$:W,nt=T(()=>{if(!at)return tt;let e="function"==typeof W?W:e=>e[W];return tt.map(t=>{let o={...t};return o[rt]=`${e(t)}__${t[$]||"observed"}`,o})},[tt,at,W]),st=at?nt:tt,lt=U||W,ct=T(()=>{if(!pe)return;let e=pe.upperBounds,t=pe.lowerBounds;if(!e&&!t)return;let o="function"==typeof e?e:"string"==typeof e?t=>t[e]:null,r="function"==typeof t?t:"string"==typeof t?e=>e[t]:null,a=1/0,i=-1/0,n=tt;for(let e of n){let t="function"==typeof F?F(e):+e[F];if(isFinite(t)&&(a>t&&(a=t),t>i&&(i=t)),o){let t=o(e);null!=t&&isFinite(t)&&(t>i&&(i=t),a>t&&(a=t))}if(r){let t=r(e);null!=t&&isFinite(t)&&(a>t&&(a=t),t>i&&(i=t))}}return isFinite(a)&&isFinite(i)?[a,i]:void 0},[pe,tt,F]),ut=M(e=>{let t="function"==typeof B?B(e):e[B],o="function"==typeof F?F(e):e[F];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[B,F]),ft=void 0!==st[0]?.[z],pt=ft?re:it,mt=T(()=>{if(ft)return st.map((e,t)=>{let o="function"==typeof W?W(e):"string"==typeof W?e[W]:void 0,r=null==o?"line-"+t:o+"",a=Array.isArray(e[z])?e[z]:[];return{...e,[re]:r,[z]:a.map(t=>({...t,[re]:r,parentLine:e,..."string"==typeof W&&void 0!==e[W]?{[W]:e[W]}:{}}))}});if(it){let e=st.reduce((e,t)=>{let o="function"==typeof it?it(t):t[it];if(!e[o]){let r={[z]:[]};"string"==typeof it&&(r[it]=o),at&&(r[$]=t[$],"string"==typeof W&&(r[W]=t[W])),e[o]=r}return e[o][z].push(t),e},{});return Object.values(e)}return[{[z]:st}]},[ft,it,z,st,W,at]),{gapProcessedLineData:yt,hasGaps:dt}=T(()=>{if("interpolate"===ue){let e=!1,t=[];for(let o of mt){let r=(o[z]||[]).filter(t=>!ut(t)||(e=!0,!1));r.length>0&&t.push({...o,[z]:r})}return{gapProcessedLineData:t,hasGaps:e}}if("break"===ue){let e=!1,t=[];for(let o of mt){let r=o[z]||[],a=[],i=0,n=pt&&"string"==typeof pt?o[pt]:void 0;for(let s of r)if(ut(s))e=!0,a.length>0&&(t.push({...o,[z]:a}),a=[],i++);else{let e=null!=n?`${n}__seg${i}`:"__seg"+i;a.push({...s,_gapSegment:e})}a.length>0&&t.push({...o,[z]:a})}return{gapProcessedLineData:t,hasGaps:e}}if("zero"===ue){let e=!1,t="string"==typeof F?F:"y",o=[];for(let r of mt){let a=r[z]||[],i=[];for(let o of a)ut(o)?(e=!0,i.push({...o,[t]:0})):i.push(o);o.push({...r,[z]:i})}return{gapProcessedLineData:o,hasGaps:e}}return{gapProcessedLineData:mt,hasGaps:!1}},[mt,ue,z,ut,pt,F]),ht="object"==typeof ce?ce:{},gt=ht.position||"end",vt=ht.fontSize||11,bt=u({data:tt,rawData:n,colorBy:lt,colorScheme:Y,legendInteraction:_e,legendPosition:De,frameLegend:Te,selection:ge,linkedHover:ve,fallbackFields:lt?["string"==typeof lt?lt:""]:[],unwrapData:!1,onObservation:Se,onClick:ke,hoverHighlight:Le,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"LineChart",chartId:we,showLegend:(!ce||void 0!==Ue)&&Ue,legend:Me,userMargin:d,marginDefaults:i.marginDefaults,loading:Re,loadingContent:Be,emptyContent:He,width:Ee,height:Ke,hasTitle:!!Ye,axisChrome:N(he,{showAxes:i.showAxes,xLabel:qe,yLabel:Qe})}),xt=bt.categoryColorScale,At=bt.effectiveSelectionHook,St=bt.resolvedSelection,kt=bt.customHoverBehavior,Lt=bt.customClickBehavior,Ct=bt.crosshairProps,wt=T(()=>{if(lt)return ft?e=>{let t=e.parentLine||e;return"function"==typeof lt?lt(t):t[lt]}:lt},[lt,ft]),Rt=T(()=>w(B,F),[B,F]),Bt=r({lineWidth:te,colorBy:wt,colorScale:xt,color:Oe,fillArea:Z,areaOpacity:ee,stroke:Ne,strokeWidth:Ie,opacity:We,effectiveSelectionHook:At,resolvedSelection:St,styleRules:X,ruleContext:Rt}),[Ht,_t]=E(null);K(()=>{if(!pe)return void _t(null);let e=!1;return s(Bt,pe).then(t=>{e||_t(()=>t)}).catch(()=>{e||_t(null)}),()=>{e=!0}},[Bt,pe]);let Dt=Ht||Bt,Pt=t({colorBy:lt,colorScale:xt,color:Oe,pointRadius:Q,colorDatumAccessor:ae,selectionDatumAccessor:G,effectiveSelectionHook:At,resolvedSelection:St}),jt=Array.isArray(Z)?"mixed":Z?"area":"line",Ft=T(()=>{if(!ce||!lt)return[];let e={position:gt,fontSize:vt,colorBy:lt,color:e=>xt?.(e)??I};return void 0===n?[{type:"text",_directLabelRequest:e}]:p(yt.flatMap(e=>(e[z]||[]).map(t=>({...t,parentLine:t.parentLine||e}))),e,B,F)},[n,ce,lt,xt,yt,z,B,F,gt,vt]),Ot=T(()=>{if(!ce)return bt.margin;let e="end"===gt?"right":"left";if("number"==typeof d||"number"==typeof d?.[e])return bt.margin;let t=(void 0===n?bt.allCategories:Ft.map(e=>e.label+"")).reduce((e,t)=>Math.max(e,Array.from(t).length*vt*.65),0);return{...bt.margin,[e]:Math.max(bt.margin[e],t+10)}},[n,ce,Ft,gt,vt,d,bt.margin,bt.allCategories]),Nt=W||U,It=T(()=>S([{label:qe||x(B),accessor:B,role:"x",format:g},{label:Qe||x(F),accessor:F,role:"y",format:v},...Nt?[{label:x(Nt),accessor:Nt,role:"group"}]:[],...A(me,v)]),[B,F,qe,Qe,Nt,g,v,me]),Wt=c({componentName:"LineChart",data:ft?tt[0]?.[z]||[]:n,accessors:{xAccessor:B,yAccessor:F}}),{brushStreamProps:Gt}=y({brush:xe,onBrush:Ae,linkedBrush:be,xAccessor:B,yAccessor:F,defaultDimension:"x"}),Tt=T(()=>ft||pt||dt?yt.flatMap(e=>{let t=e[z]||[];return pt&&"string"==typeof pt?t.map(t=>({...t,[pt]:t[pt]??e[pt]})):t}):st,[yt,z,ft,pt,st,dt]),Mt=b(ie),Et={chartType:jt,...Array.isArray(Z)&&{areaGroups:Z},...Mt&&{lineGradient:Mt},...null!=n&&{data:Tt},xAccessor:B,yAccessor:F,xScaleType:je,yScaleType:Fe,...ye&&{xExtent:ye},...!de||null==de[0]&&null==de[1]?ct?{yExtent:ct}:{}:{yExtent:de},groupAccessor:"break"===ue&&dt?"_gapSegment":pt||void 0,...me&&{band:me},curve:V,lineStyle:Dt,...q&&{pointStyle:Pt},size:[Ee,Ke],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:Ot,showAxes:i.showAxes,xLabel:qe,yLabel:Qe,xFormat:g,yFormat:v,...void 0!==L&&{axisExtent:L},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},enableHover:ze,showGrid:Je,...bt.legendBehaviorProps,...Ye&&{title:Ye},...$e&&{description:$e},...Xe&&{summary:Xe},...void 0!==Ve&&{accessibleTable:Ve},...h&&{className:h},...null!=e.animate&&{animate:e.animate},...R({tooltip:ne,defaultTooltipContent:It,multiDefaultContent:H()}),...k({linkedHover:ve,selection:ge,onObservation:Se,onClick:ke,hoverRadius:Ce,hoverHighlight:Le,mobileInteraction:bt.mobileInteraction,customHoverBehavior:kt,customClickBehavior:Lt}),...se&&{pointIdAccessor:se},...(le?.length||ot.length||Ft.length)&&{annotations:[...le||[],...ot,...Ft]},...Ct,...Gt,...Te};return bt.earlyReturn?bt.earlyReturn:Wt?/* @__PURE__ */oe(_,{componentName:"LineChart",message:Wt,width:Ee,height:Ke}):/* @__PURE__ */oe(D,{componentName:"LineChart",width:Ee,height:Ke,children:/* @__PURE__ */oe(m,{ref:a,...Et})})});ie.displayName="LineChart";export{t as a,l as b,e as c,r as d,ie as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(0,Math.floor(t)):5e3}function e(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(1,Math.floor(t)):5e3}function i(t,e,i,a){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:i,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:a,fn:e}:{key:void 0,fn:null}}function a(t,e,i){return a=>{if(!a||!i||!t.fn&&!e.fn)return a;let r=!1,n=a.map(i=>{let a=t.fn&&t.key&&!(t.key in i),n=e.fn&&e.key&&!(e.key in i);if(!a&&!n)return i;r=!0;let h={...i};return a&&(h[t.key]=t.fn(i)),n&&(h[e.key]=e.fn(i)),h});return r?n:a}}function r(t,e){return t.__legendMarginReservedFor===e}function n(t,e){return{legendLayout:t.legendLayout,axisChrome:_({showAxes:t.showAxes,xLabel:t.xLabel,yLabel:t.yLabel,yLabelRight:t.yLabelRight,axes:t.axes}),legendMarginReserved:r(t,e)}}function h(t,e){return{legendLayout:t.legendLayout,axisChrome:g({showAxes:t.showAxes,projection:t.projection,hasCategoryLabel:!!(t.categoryLabel??t.oLabel),hasValueLabel:!!(t.valueLabel??t.rLabel)}),legendMarginReserved:r(t,e)}}function s(t){return new Set(Array.isArray(t)?t:[t])}function l(t){for(let e of t){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("point"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("glyph"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("rect"===e.type||"heatcell"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0);else if("candlestick"===e.type)void 0!==e._targetX&&(e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0);else if("line"===e.type||"area"===e.type){if(e._introClipFraction=void 0,"line"===e.type&&e._targetPath){for(let t=0;e.path.length>t;t++)e.path[t]=e._targetPath[t];e._prevPath=void 0,e._targetPath=void 0}if("area"===e.type){if(e._targetTopPath)for(let t=0;e.topPath.length>t;t++)e.topPath[t]=e._targetTopPath[t];if(e._targetBottomPath)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t]=e._targetBottomPath[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0}}}}function u(t){for(let e of t){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}"point"===e.type?void 0!==e._targetX?(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0):void 0!==e._targetR&&(e.r=e._targetR,e._targetR=void 0):"rect"===e.type?void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0):"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0)}}function o(t,e){let i=t.domain(),a=i[0],r=i[i.length-1],n=a instanceof Date,h=a instanceof Date?a.getTime():a,s=r instanceof Date?r.getTime():r;if(2>e||h===s)return n?[new Date(h),new Date(s)]:[h,s];let l=(s-h)/(e-1),u=Array(e);for(let t=0;e>t;t++){let i=t===e-1?s:h+t*l;u[t]=n?new Date(i):i}return u}function d(t,e,i){return"exact"===i?o(t,e):t.ticks(e)}import{A as g,b as c,y as _}from"./c-
|
|
1
|
+
function t(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(0,Math.floor(t)):5e3}function e(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(1,Math.floor(t)):5e3}function i(t,e,i,a){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:i,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:a,fn:e}:{key:void 0,fn:null}}function a(t,e,i){return a=>{if(!a||!i||!t.fn&&!e.fn)return a;let r=!1,n=a.map(i=>{let a=t.fn&&t.key&&!(t.key in i),n=e.fn&&e.key&&!(e.key in i);if(!a&&!n)return i;r=!0;let h={...i};return a&&(h[t.key]=t.fn(i)),n&&(h[e.key]=e.fn(i)),h});return r?n:a}}function r(t,e){return t.__legendMarginReservedFor===e}function n(t,e){return{legendLayout:t.legendLayout,axisChrome:_({showAxes:t.showAxes,xLabel:t.xLabel,yLabel:t.yLabel,yLabelRight:t.yLabelRight,axes:t.axes}),legendMarginReserved:r(t,e)}}function h(t,e){return{legendLayout:t.legendLayout,axisChrome:g({showAxes:t.showAxes,projection:t.projection,hasCategoryLabel:!!(t.categoryLabel??t.oLabel),hasValueLabel:!!(t.valueLabel??t.rLabel)}),legendMarginReserved:r(t,e)}}function s(t){return new Set(Array.isArray(t)?t:[t])}function l(t){for(let e of t){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("point"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("glyph"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("rect"===e.type||"heatcell"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0);else if("candlestick"===e.type)void 0!==e._targetX&&(e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0);else if("line"===e.type||"area"===e.type){if(e._introClipFraction=void 0,"line"===e.type&&e._targetPath){for(let t=0;e.path.length>t;t++)e.path[t]=e._targetPath[t];e._prevPath=void 0,e._targetPath=void 0}if("area"===e.type){if(e._targetTopPath)for(let t=0;e.topPath.length>t;t++)e.topPath[t]=e._targetTopPath[t];if(e._targetBottomPath)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t]=e._targetBottomPath[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0}}}}function u(t){for(let e of t){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}"point"===e.type?void 0!==e._targetX?(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0):void 0!==e._targetR&&(e.r=e._targetR,e._targetR=void 0):"rect"===e.type?void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0):"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0)}}function o(t,e){let i=t.domain(),a=i[0],r=i[i.length-1],n=a instanceof Date,h=a instanceof Date?a.getTime():a,s=r instanceof Date?r.getTime():r;if(2>e||h===s)return n?[new Date(h),new Date(s)]:[h,s];let l=(s-h)/(e-1),u=Array(e);for(let t=0;e>t;t++){let i=t===e-1?s:h+t*l;u[t]=n?new Date(i):i}return u}function d(t,e,i){return"exact"===i?o(t,e):t.ticks(e)}import{A as g,b as c,y as _}from"./c-UMGHCBH5.min.js";var f=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){(t===this._min||t===this._max)&&(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(let i of t){let t=e?e(i):i;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},m=class{constructor(i,a){this.lastBoundedData=null,this.chunkTimer=null,this.pushBuffer=[],this.flushScheduled=!1,this.callback=i,this.chunkThreshold=t(a?.chunkThreshold),this.chunkSize=e(a?.chunkSize)}updateChunkOptions(i){this.chunkThreshold=t(i.chunkThreshold),this.chunkSize=e(i.chunkSize)}clearLastData(){this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null)}setBoundedData(t){if(t=c(t),this.lastBoundedData===t)return;if(this.lastBoundedData=t,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,totalSize:t.length});let e=this.chunkSize,i=()=>{if(e>=t.length)return void(this.chunkTimer=null);if(t!==this.lastBoundedData)return void(this.chunkTimer=null);let a=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,a),bounded:!1}),e=a,this.chunkTimer=t.length>e?requestAnimationFrame(i):null};this.chunkTimer=t.length>e?requestAnimationFrame(i):null}setReplacementData(t){if(t=c(t),this.lastBoundedData=t,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),this.pushBuffer=[],this.flushScheduled=!1,this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0,preserveCategoryOrder:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,preserveCategoryOrder:!0,totalSize:t.length});let e=this.chunkSize,i=()=>{if(e>=t.length)return void(this.chunkTimer=null);if(t!==this.lastBoundedData)return void(this.chunkTimer=null);let a=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,a),bounded:!1}),e=a,this.chunkTimer=t.length>e?requestAnimationFrame(i):null};this.chunkTimer=t.length>e?requestAnimationFrame(i):null}flushPushBuffer(){if(this.flushScheduled=!1,0===this.pushBuffer.length)return;let t=this.pushBuffer;this.pushBuffer=[],this.callback({inserts:t,bounded:!1})}scheduleFlush(){this.flushScheduled||(this.flushScheduled=!0,queueMicrotask(()=>this.flushPushBuffer()))}push(t){null==t||"object"!=typeof t||(this.pushBuffer.push(t),this.scheduleFlush())}pushMany(t){if(0===t.length)return;let e=0;for(let i=0;t.length>i;i++){let a=t[i];null==a||"object"!=typeof a||(this.pushBuffer.push(a),e++)}0!==e&&this.scheduleFlush()}flush(){this.flushPushBuffer()}clear(){null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1}};export{m as a,f as b,s as c,l as d,u as e,d as f,i as g,a as h,n as i,h as j};
|
|
@@ -5,5 +5,5 @@ return Ge("div",{style:t>0?{marginTop:2}:void 0,children:[
|
|
|
5
5
|
/* @__PURE__ */Le("span",{children:r})]},t)})]})}}function i({categoryAccessor:e,valueAccessor:l,groupAccessor:o,groupLabel:i,pieData:u=!1,valueFormat:s}){return c=>{let f=u?c.data?.[0]||c.data||c:c.data||c,d=a(f,e),h=a(f,l),p=o?a(f,o):void 0;/* @__PURE__ */
|
|
6
6
|
return Ge("div",{className:"semiotic-tooltip",style:je,children:[
|
|
7
7
|
/* @__PURE__ */Le("div",{style:{fontWeight:"bold"},children:r(d)}),
|
|
8
|
-
/* @__PURE__ */Le("div",{style:{marginTop:4},children:n(h,s)}),null!=p&&/* @__PURE__ */Ge("div",{style:{marginTop:2,opacity:.8},children:[i||t(o),": ",r(p)]})]})}}function u(...e){let t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Te.createElement(Te.Fragment,null,...t)}function s(e,t,r,n){ze(()=>{e.current?.updateConfig(t),r.current=!0,n()},[t,n,e,r])}function c(e,t,r,n){let a=$e(null);ze(()=>{let l=e.current;if(!l)return;let o=t??null;a.current!==o&&(a.current=o,l.setLayoutSelection(o),l.hasCustomRestyle?l.restyleScene(o):r.current=!0,n())},[t,n,e,r])}function f(e,t){let r=e?.state??(e?.settling?"settling":void 0);if("live"===r)return Ne;if("stopped"===r||"failed"===r||"stale"===r)return{alpha:e?.dimOpacity??.5,band:"stale",isStale:!0};if("settling"===r)return{alpha:.85,band:"aging",isStale:!1};if(!e||0>=t)return Ne;let n=null!=e.threshold&&e.threshold>0?e.threshold:5e3,a=e.graded;if(a){let e="object"==typeof a?a:{},r=Re(t,n,e.thresholds);return{alpha:{...He,...e.opacities??{}}[r],band:r,isStale:"fresh"!==r}}return t>n?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:Ne}function d(e,t,r,n,a,l,o){let i=
|
|
9
|
-
return Ve("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:l,color:"white"},children:o})}function y(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return m(e,t);if(!x(e)||!x(t))return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;let r=e[n],a=t[n];if(!Object.is(r,a)){if(Array.isArray(r)&&Array.isArray(a)){if(!m(r,a))return!1;continue}if(!x(r)||!x(a)||!g(r,a))return!1}}return!0}function g(e,t){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}function m(e,t){if(e.length!==t.length)return!1;for(let r=0;e.length>r;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function x(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function b(e){let t=Fe(e);return y(t.current,e)||(t.current=e),t.current}function v(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:n=""}=e;return"transparent"===t?null:r?t||null:t||(n&&"transparent"!==n?n:"")||null}function w(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:n=""}=e;return"transparent"===t||r?null:t||(n&&"transparent"!==n?n:"")||null}function k(e,t){let{background:r,hasBackgroundGraphics:n=!1,themeBackground:a="",x:l=0,y:o=0,width:i,height:u}=t,s=w({background:r,hasBackgroundGraphics:n,themeBackground:a});if(!s)return!1;let c=Pe(e,s);return!(!c||"transparent"===c.trim().toLowerCase()||(e.fillStyle=c,e.fillRect(l,o,i,u),0))}function A(e,t,r,n){return"function"==typeof e?e({size:t,margin:r,scales:n}):e}function M({foregroundGraphics:e,backgroundGraphics:t,size:r,margin:n,scales:a,background:l,themeBackgroundColor:o,resolveScaleAwareGraphics:i=!0}){let u=`var(--semiotic-bg, ${o})`;return{resolvedForeground:i||"function"!=typeof e?A(e,r,n,a):null,resolvedBackground:i||"function"!=typeof t?A(t,r,n,a):null,themeBackground:u,surfaceBackground:v({background:l,hasBackgroundGraphics:!!t,themeBackground:u})}}function _(e,t){if(!t)return[];let r=/* @__PURE__ */new Set,n=[];for(let a of e){if(!a||"object"!=typeof a)continue;let e=("function"==typeof t?t(a):a[t])+"";r.has(e)||(r.add(e),n.push(e))}return n}function I(e,t){if(e.length!==t.length)return!1;for(let r=0;e.length>r;r++)if(e[r]!==t[r])return!1;return!0}function O(e,t,r,n){let a=Ze({accessor:t,onChange:r,readData:n}),l=Ze([]);a.current={accessor:t,onChange:r,readData:n};let o=Xe(()=>{let{accessor:t,onChange:r,readData:n}=a.current;if(!r||!t)return;let o=_(e.current?n(e.current):[],t);I(o,l.current)||(l.current=o,r(o))},[e]);return qe(()=>{l.current=[],o()},[t,o,r]),o}function S(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"function"==typeof e.cacheKey&&"function"==typeof e.drawCanvas&&"function"==typeof e.renderStaticSVG}function E(e,t){let r="function"==typeof e?e(t.datum??null,t):e;return S(r)?r:void 0}function R(e,t){if("u">typeof process&&"production"===process.env?.NODE_ENV)return;let r=`${e}:${t}`;Ke.has(r)||(Ke.add(r),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function D(e){let{context:t,nodes:r,renderMode:n,pixelRatio:a,paintBuiltIn:l}=e;if(!n||"sketchy"===n)return void l(r);let o=[],i=()=>{o.length&&(l(o),o=[])};for(let e of r){let r,u=E(n,e);if(u){i(),t.save();try{r=u.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:a})}finally{t.restore()}r||(R(u.id,e.type??"unknown"),l([e]))}else o.push(e)}i()}function B(e){let{node:t,index:r,renderMode:n,fallback:a}=e,l=E(n,t);if(!l)return{element:a(),renderedByBackend:!1};let o=l.renderStaticSVG({node:t,style:t.style??{},key:`${l.id}-${r}`});return null!=o?{element:De(o,t,`${l.id}-${r}-cursor`),renderedByBackend:!0}:(R(l.id,t.type??"unknown"),{element:a(),renderedByBackend:!1})}function j(e){return B(e).element}function C(e){let t=[];return e.nodes.forEach((r,n)=>{let a=B({node:r,index:n,renderMode:e.renderMode,fallback:()=>e.fallback(r,n)});null!=a.element&&!1!==a.element&&t.push({node:r,index:n,...a})}),t}function P(e){let t=/* @__PURE__ */new Map;for(let r of e){let e=r.group??"_default",n=t.get(e);n||(n=[],t.set(e,n)),n.push(r)}for(let e of t.values()){e.sort((e,t)=>e.x-t.x||e.y-t.y);for(let t=0;e.length>t;t++)e[t]._groupIndex=t}let r=Array.from(t.keys()).sort((e,r)=>{let n=t.get(e),a=t.get(r);return(n.length>0?n[0].y:0)-(a.length>0?a[0].y:0)}),n=Array.from(t.values()).flat();n.sort((e,t)=>e.x-t.x||e.y-t.y);let a=/* @__PURE__ */new Map;for(let e=0;n.length>e;e++){n[e]._flatIndex=e;let t=n[e].datum?.id;null!=t&&a.set(t+"",e)}return{flat:n,groups:r,byGroup:t,idToIdx:a}}function L(e,t){if(0===e.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};let r=Math.max(0,Math.min(t,e.flat.length-1)),n=e.flat[r];return{flatIndex:r,group:n.group??"_default",indexInGroup:n._groupIndex??0}}function G(e,t,r){let{group:n,indexInGroup:a}=t,l=r.byGroup.get(n);switch(e){case"ArrowRight":return l.length-1>a?l[a+1]._flatIndex:t.flatIndex;case"ArrowLeft":return a>0?l[a-1]._flatIndex:t.flatIndex;case"ArrowDown":{let e=r.groups.indexOf(n);return r.groups.length-1>e?T(r,r.groups[e+1],l[a]):t.flatIndex}case"ArrowUp":{let e=r.groups.indexOf(n);return e>0?T(r,r.groups[e-1],l[a]):t.flatIndex}case"PageDown":return Math.min(t.flatIndex+Math.max(1,Math.floor(.1*r.flat.length)),r.flat.length-1);case"PageUp":return Math.max(t.flatIndex-Math.max(1,Math.floor(.1*r.flat.length)),0);case"Home":return 0;case"End":return r.flat.length-1;case"Escape":return-1;default:return null}}function T(e,t,r){let n=e.byGroup.get(t),a=0,l=Math.abs(n[0].x-r.x);for(let e=1;n.length>e;e++){let t=Math.abs(n[e].x-r.x);l>t&&(l=t,a=e)}return n[a]._flatIndex}function z(e){let t=[];for(let r of e)switch(r.type){case"point":if(!1===r.interactive)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"symbol":if(0>=r.size)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"glyph":{if(0>=r.size||null==r.datum)break;let e=Ce(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"});break}case"line":{let e=r,n=Array.isArray(e.datum)?e.datum:[],a=e.group??"_default";for(let r=0;e.path.length>r&&n.length>r;r++)t.push({x:e.path[r][0],y:e.path[r][1],datum:n[r],shape:"circle",group:a});break}case"area":{if(!1===r.interactive)break;let e=r,n=Array.isArray(e.datum)?e.datum:[],a=e.group??"_default";for(let r=0;e.topPath.length>r&&n.length>r;r++)t.push({x:e.topPath[r][0],y:e.topPath[r][1],datum:n[r],shape:"circle",group:a});break}case"rect":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.group??"_default"});break;case"heatcell":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function $(e){let t=[];for(let r of e)if("rect"===r.type&&null!=r.x){if(null==r.datum)continue;t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.group??r.datum?.category??""})}else if("point"===r.type){if(!1===r.interactive)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("symbol"===r.type){if(0>=r.size)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("glyph"===r.type){if(0>=r.size||null==r.datum)continue;let e=Ce(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"})}else if("wedge"===r.type&&null!=r.cx){if(null===r.datum)continue;let e=((r.startAngle||0)+(r.endAngle||0))/2,n=((r.innerRadius||0)+(r.outerRadius||50))/2;t.push({x:r.cx+Math.cos(e)*n,y:r.cy+Math.sin(e)*n,datum:r.datum,shape:"wedge",group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function H(e){let t=[];for(let r of e)if(r.datum)if("circle"===r.type&&null!=r.cx){if(0>=r.r)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("rect"===r.type&&null!=r.x){if(0>=r.w||0>=r.h)continue;t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.datum.id??"_default"})}else if("arc"===r.type&&null!=r.cx)t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"});else if("symbol"===r.type&&null!=r.cx){if(0>=r.size)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("glyph"===r.type&&null!=r.cx){if(0>=r.size)continue;let e=Ce(r.glyph,r.size);t.push({x:r.cx+e.centerDx,y:r.cy+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:r.datum.id??"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function N(e,t,r,n,a){let l=r.flat[t.flatIndex];if(!l)return G(e,t,r);let o=l.datum?.id;switch(e){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{let n=W(r,l,"ArrowRight"===e?"right":"ArrowLeft"===e?"left":"ArrowDown"===e?"down":"up")??t.flatIndex;return n!==t.flatIndex&&(a.current=-1),n}case"Enter":{if(null==o)return t.flatIndex;let e=V(o,n);if(0===e.length)return t.flatIndex;let l=r.idToIdx.get(e[(a.current+1)%e.length])??-1;return 0>l?t.flatIndex:(a.current=-1,l)}default:{let n=G(e,t,r);return null!==n&&n!==t.flatIndex&&(a.current=-1),n}}}function W(e,t,r){let n=null,a=1/0;for(let l=0;e.flat.length>l;l++){let o=e.flat[l];if(o===t)continue;let i=o.x-t.x,u=o.y-t.y,s=!1;switch(r){case"right":s=i>0&&Math.abs(i)>=Math.abs(u);break;case"left":s=0>i&&Math.abs(i)>=Math.abs(u);break;case"down":s=u>0&&Math.abs(u)>=Math.abs(i);break;case"up":s=0>u&&Math.abs(u)>=Math.abs(i)}if(!s)continue;let c=i*i+u*u;a>c&&(a=c,n=l)}return n}function U(e){return"object"==typeof e&&null!==e&&"id"in e?e.id:e}function V(e,t){let r=e+"",n=[];for(let e of t){let t=e.datum??e,a=U(t.source),l=U(t.target),o=null!=a,i=null!=l;o&&a+""===r&&i?n.push(l+""):i&&l+""===r&&o&&n.push(a+"")}return n}function Y(e){let t=[];for(let r of e)if("point"===r.type&&null!=r.x&&!1!==r.interactive)t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle"});else if("glyph"===r.type){if(0>=r.size||null==r.datum)continue;let e=Ce(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else"geoarea"===r.type&&r.centroid&&!1!==r.interactive&&t.push({x:r.centroid[0],y:r.centroid[1],datum:r.datum,shape:"geoarea",pathData:r.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function F(e,t,r){switch(e){case"ArrowRight":case"ArrowDown":return r-1>t?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":return Math.min(t+Math.max(1,Math.floor(.1*r)),r-1);case"PageUp":return Math.max(t-Math.max(1,Math.floor(.1*r)),0);case"Home":return 0;case"End":return r-1;case"Escape":return-1;default:return null}}function X(e){return{data:e.datum||{},x:e.x,y:e.y,__semioticHoverData:!0}}function q(e,t,r){let n=e.current;n.inside=!0,n.clientX=t.clientX,n.clientY=t.clientY,n.pointerType=t.pointerType??r}function Z(e,t,r,n,a,l){return q(e,t,l),!(!r&&!n||!r&&"touch"===e.current.pointerType&&(Ee(a),1))}function K(e){let{title:t,description:r,summary:n,accessibleTable:a,className:l,animate:o,maxDevicePixelRatio:i,axisExtent:u,autoPlaceAnnotations:s}=e,c={};return t&&(c.title=t),r&&(c.description=r),n&&(c.summary=n),void 0!==a&&(c.accessibleTable=a),l&&(c.className=l),null!=o&&(c.animate=o),void 0!==i&&(c.maxDevicePixelRatio=i),void 0!==u&&(c.axisExtent=u),void 0!==s&&(c.autoPlaceAnnotations=s),c}function J(e){let{linkedHover:t,selection:r,onObservation:n,onClick:a,hoverRadius:l,hoverHighlight:o,forceHoverBehavior:i,forceClickBehavior:u,mobileInteraction:s,customHoverBehavior:c,customClickBehavior:f,linkedHoverInClickPredicate:d=!0}=e,h={};n&&(h.annotationObservationCallback=n);let p=s?.enabled?Math.max(l??30,Math.ceil((s.targetSize||44)/2),24):l;return(i||t||n||a||o)&&(h.customHoverBehavior=c),f&&(u||(d?n||a||t:n||a)||s?.enabled&&(s.tapToSelect||s.tapToLockTooltip)&&(t||o||r))&&(h.customClickBehavior=f),null!=p&&(h.hoverRadius=p),h}function Q(e){let{tooltip:t,defaultTooltipContent:r}=e;return{tooltipContent:!1===t?()=>null:Se(t)||r}}function ee(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function te(e,t){if(!ee(t))return e??((...e)=>({}));let r={};return void 0!==t.stroke&&(r.stroke=t.stroke),void 0!==t.strokeWidth&&(r.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(r.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...r}):(...e)=>({...r})}function re(e,t,r){if(1>=r)return 1;let n=r-1;return Be({age:n-t,extent:n,type:e.type,halfLife:e.halfLife??r/2,threshold:e.stepThreshold??.5*r,minOpacity:e.minOpacity??.1})}function ne(e){let t=/* @__PURE__ */new Map;for(let r=0;e.length>r;r++)t.set(e[r],r);return t}function ae(e,t,r,n=ne(r)){let a=r.length;if(a>1)for(let r of t){if("line"===r.type){let t=Array.isArray(r.datum)?r.datum:[];if(2>t.length)continue;let l=Array(t.length),o=!1;for(let r=0;t.length>r;r++){let i=n.get(t[r]);null!=i?(l[r]=re(e,i,a),1>l[r]&&(o=!0)):l[r]=1}o&&(r._decayOpacities=l);continue}if("area"===r.type){let t=Array.isArray(r.datum)?r.datum:[],l=r.topPath?r.topPath.length:t.length;if(2>l)continue;if(t.length===l){let o=Array(l),i=!1;for(let r=0;t.length>r;r++){let l=n.get(t[r]);null!=l?(o[r]=re(e,l,a),1>o[r]&&(i=!0)):o[r]=1}i&&(r._decayOpacities=o)}else{let o=1;for(let r of t){let t=n.get(r);if(null!=t){let r=re(e,t,a);o>r&&(o=r)}}if(1>o){let e=Array(l);e.fill(o),r._decayOpacities=e}}continue}let t=n.get(r.datum);if(null==t)continue;let l=re(e,t,a);"candlestick"===r.type?r._decayOpacity=l:r.style={...r.style,opacity:(r.style?.opacity??1)*l}}}function le(e){if("production"===process.env.NODE_ENV)return;let{label:t,nodes:r,overlays:n,warned:a}=e;oe(n)&&0===r.length&&ie(a,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),r.length>0&&r.every(e=>null==e.datum)&&ie(a,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function oe(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(oe))}function ie(e,t,r){e.has(t)||(e.add(t),console.warn(r))}function ue(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:e+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function se(e,t,r,n){let a=ue(t),l="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:l,message:`Semiotic ${e} ${l} failed: ${a.message}`,error:a,recovery:r?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:r,affectedRevision:n}}function ce(e){try{return{kind:"success",result:e.run()}}catch(t){let r=e.hasPreviousResult,n=se(e.family,t,r,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(n)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:n,preservedLastGoodScene:r}}}function fe(){return this.updateResults.last}function de(){return this.updateResults.last}function he(e){return this.updateResults.subscribe(e)}function pe(e){this.config.layoutSelection=e}function ye(){Je.set(this,!0)}function ge(){let e=!0===Je.get(this);return Je.delete(this),e}function me(e){Object.assign(e.prototype,{getLastUpdateResult:fe,getUpdateSnapshot:de,subscribeUpdateResult:he,setLayoutSelection:pe,markStylePaintPending:ye,consumeStylePaintPending:ge})}function xe(e,t,r,n,a,l){let o=a-r,i=l-n,u=o*o+i*i;if(0===u)return Math.sqrt((e-r)**2+(t-n)**2);let s=((e-r)*o+(t-n)*i)/u;return s=Math.max(0,Math.min(1,s)),Math.sqrt((e-(r+s*o))**2+(t-(n+s*i))**2)}function be(e,t,r){return r.x>e||e>r.x+r.w||r.y>t||t>r.y+r.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:r.x+r.w/2,cy:r.y+r.h/2}}function ve(e,t=30){return Math.max((e??4)+5,12,t)}function we(e){return e instanceof Date?e:"number"==typeof e&&e>1e9?new Date(e):null}function ke(e,t){let r=we(e);if(!r)return!1;let n=we(t);return!n||r.getFullYear()!==n.getFullYear()||r.getMonth()!==n.getMonth()}function Ae(e){let t=e%(2*Math.PI);return 0>t&&(t+=2*Math.PI),t}function Me(e,t,r,n,a,l=e=>e.x,o=e=>e.y,i=e=>e.r){let u=Math.max(n,a+5,12),s=t-u,c=t+u,f=r-u,d=r+u,h=null,p=1/0;return e.visit((e,a,u,y,g)=>{if(a>c||s>y||u>d||f>g)return!0;if(!e.length){let a=e;do{let e=a.data,u=l(e)-t,s=o(e)-r,c=Math.sqrt(u*u+s*s);ve(i(e),n)>=c&&p>c&&(h=e,p=c),a=a.next}while(a)}return!1}),h?{node:h,distance:p}:null}function _e(e,t){return"string"==typeof e&&e.length>0?e:t}function Ie(e,t,r){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${r.familyPhrase})`:r.fallback}function Oe(e){let t=(e+"").replace(/[^a-zA-Z0-9_-]/g,"_"),r=/^[A-Za-z_]/.test(t)?t:"c"+t,n=r+"-semiotic-title",a=r+"-semiotic-desc";return{titleId:n,descId:a,labelledBy:`${n} ${a}`}}import{Va as Se,ea as Ee,h as Re,ia as De,l as Be,ya as je}from"./c-G53AVC42.min.js";import{i as Ce,m as Pe}from"./c-3BYZXCX3.min.js";import{jsx as Le,jsxs as Ge}from"react/jsx-runtime";import*as Te from"react";import{useEffect as ze,useRef as $e}from"react";var He={fresh:1,aging:.7,stale:.45,expired:.25},Ne={alpha:1,band:"fresh",isStale:!1};import{useEffect as We,useRef as Ue}from"react";import{jsx as Ve}from"react/jsx-runtime";var Ye={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"};import{useRef as Fe}from"react";import{useCallback as Xe,useEffect as qe,useRef as Ze}from"react";var Ke=/* @__PURE__ */new Set,Je=/* @__PURE__ */new WeakMap;export{re as a,ne as b,ae as c,le as d,ce as e,me as f,u as g,s as h,c as i,xe as j,be as k,ve as l,ke as m,Ae as n,Me as o,f as p,d as q,p as r,e as s,_e as t,Ie as u,Oe as v,y as w,b as x,w as y,k as z,A,M as B,_ as C,O as D,D as E,j as F,C as G,t as H,r as I,l as J,o as K,i as L,P as M,L as N,G as O,z as P,$ as Q,H as R,N as S,Y as T,F as U,X as V,Z as W,K as X,J as Y,Q as Z,te as _};
|
|
8
|
+
/* @__PURE__ */Le("div",{style:{marginTop:4},children:n(h,s)}),null!=p&&/* @__PURE__ */Ge("div",{style:{marginTop:2,opacity:.8},children:[i||t(o),": ",r(p)]})]})}}function u(...e){let t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Te.createElement(Te.Fragment,null,...t)}function s(e,t,r,n){ze(()=>{e.current?.updateConfig(t),r.current=!0,n()},[t,n,e,r])}function c(e,t,r,n){let a=$e(null);ze(()=>{let l=e.current;if(!l)return;let o=t??null;a.current!==o&&(a.current=o,l.setLayoutSelection(o),l.hasCustomRestyle?l.restyleScene(o):r.current=!0,n())},[t,n,e,r])}function f(e,t){let r=e?.state??(e?.settling?"settling":void 0);if("live"===r)return Ne;if("stopped"===r||"failed"===r||"stale"===r)return{alpha:e?.dimOpacity??.5,band:"stale",isStale:!0};if("settling"===r)return{alpha:.85,band:"aging",isStale:!1};if(!e||0>=t)return Ne;let n=null!=e.threshold&&e.threshold>0?e.threshold:5e3,a=e.graded;if(a){let e="object"==typeof a?a:{},r=Re(t,n,e.thresholds);return{alpha:{...He,...e.opacities??{}}[r],band:r,isStale:"fresh"!==r}}return t>n?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:Ne}function d(e,t,r,n,a,l,o){let i=We("fresh");Ue(()=>{if(!e)return void(i.current="fresh");let u=setInterval(()=>{let u=t.current;if(!u||0===u.lastIngestTime)return;let s=f(e,a()-u.lastIngestTime);(s.band!==i.current||s.isStale!==l)&&(i.current=s.band,s.isStale!==l&&o(s.isStale),r.current=!0,n())},1e3);return()=>clearInterval(u)},[e,l,n,a,t,o,r])}function h(e,t,r){return t||(r?"settling":e?"stale":"live")}function p({isStale:e,position:t,state:r,settling:n}){let a=h(e,r,n),l=Ye[a]??Ye.live,o=Object.hasOwn(Ye,a)?a.toUpperCase():"LIVE";/* @__PURE__ */
|
|
9
|
+
return Ve("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:l,color:"white"},children:o})}function y(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return m(e,t);if(!x(e)||!x(t))return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;let r=e[n],a=t[n];if(!Object.is(r,a)){if(Array.isArray(r)&&Array.isArray(a)){if(!m(r,a))return!1;continue}if(!x(r)||!x(a)||!g(r,a))return!1}}return!0}function g(e,t){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}function m(e,t){if(e.length!==t.length)return!1;for(let r=0;e.length>r;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function x(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function b(e){let t=Fe(e);return y(t.current,e)||(t.current=e),t.current}function v(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:n=""}=e;return"transparent"===t?null:r?t||null:t||(n&&"transparent"!==n?n:"")||null}function w(e){let{background:t,hasBackgroundGraphics:r=!1,themeBackground:n=""}=e;return"transparent"===t||r?null:t||(n&&"transparent"!==n?n:"")||null}function k(e,t){let{background:r,hasBackgroundGraphics:n=!1,themeBackground:a="",x:l=0,y:o=0,width:i,height:u}=t,s=w({background:r,hasBackgroundGraphics:n,themeBackground:a});if(!s)return!1;let c=Pe(e,s);return!(!c||"transparent"===c.trim().toLowerCase()||(e.fillStyle=c,e.fillRect(l,o,i,u),0))}function A(e,t,r,n){return"function"==typeof e?e({size:t,margin:r,scales:n}):e}function M({foregroundGraphics:e,backgroundGraphics:t,size:r,margin:n,scales:a,background:l,themeBackgroundColor:o,resolveScaleAwareGraphics:i=!0}){let u=`var(--semiotic-bg, ${o})`;return{resolvedForeground:i||"function"!=typeof e?A(e,r,n,a):null,resolvedBackground:i||"function"!=typeof t?A(t,r,n,a):null,themeBackground:u,surfaceBackground:v({background:l,hasBackgroundGraphics:!!t,themeBackground:u})}}function _(e,t){if(!t)return[];let r=/* @__PURE__ */new Set,n=[];for(let a of e){if(!a||"object"!=typeof a)continue;let e=("function"==typeof t?t(a):a[t])+"";r.has(e)||(r.add(e),n.push(e))}return n}function I(e,t){if(e.length!==t.length)return!1;for(let r=0;e.length>r;r++)if(e[r]!==t[r])return!1;return!0}function O(e,t,r,n){let a=Ze({accessor:t,onChange:r,readData:n}),l=Ze([]);a.current={accessor:t,onChange:r,readData:n};let o=Xe(()=>{let{accessor:t,onChange:r,readData:n}=a.current;if(!r||!t)return;let o=_(e.current?n(e.current):[],t);I(o,l.current)||(l.current=o,r(o))},[e]);return qe(()=>{l.current=[],o()},[t,o,r]),o}function S(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"function"==typeof e.cacheKey&&"function"==typeof e.drawCanvas&&"function"==typeof e.renderStaticSVG}function E(e,t){let r="function"==typeof e?e(t.datum??null,t):e;return S(r)?r:void 0}function R(e,t){if("u">typeof process&&"production"===process.env?.NODE_ENV)return;let r=`${e}:${t}`;Ke.has(r)||(Ke.add(r),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function B(e){let{context:t,nodes:r,renderMode:n,pixelRatio:a,paintBuiltIn:l}=e;if(!n||"sketchy"===n)return void l(r);let o=[],i=()=>{o.length&&(l(o),o=[])};for(let e of r){let r,u=E(n,e);if(u){i(),t.save();try{r=u.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:a})}finally{t.restore()}r||(R(u.id,e.type??"unknown"),l([e]))}else o.push(e)}i()}function D(e){let{node:t,index:r,renderMode:n,fallback:a}=e,l=E(n,t);if(!l)return{element:a(),renderedByBackend:!1};let o=l.renderStaticSVG({node:t,style:t.style??{},key:`${l.id}-${r}`});return null!=o?{element:Be(o,t,`${l.id}-${r}-cursor`),renderedByBackend:!0}:(R(l.id,t.type??"unknown"),{element:a(),renderedByBackend:!1})}function j(e){return D(e).element}function C(e){let t=[];return e.nodes.forEach((r,n)=>{let a=D({node:r,index:n,renderMode:e.renderMode,fallback:()=>e.fallback(r,n)});null!=a.element&&!1!==a.element&&t.push({node:r,index:n,...a})}),t}function P(e){let t=/* @__PURE__ */new Map;for(let r of e){let e=r.group??"_default",n=t.get(e);n||(n=[],t.set(e,n)),n.push(r)}for(let e of t.values()){e.sort((e,t)=>e.x-t.x||e.y-t.y);for(let t=0;e.length>t;t++)e[t]._groupIndex=t}let r=Array.from(t.keys()).sort((e,r)=>{let n=t.get(e),a=t.get(r);return(n.length>0?n[0].y:0)-(a.length>0?a[0].y:0)}),n=Array.from(t.values()).flat();n.sort((e,t)=>e.x-t.x||e.y-t.y);let a=/* @__PURE__ */new Map;for(let e=0;n.length>e;e++){n[e]._flatIndex=e;let t=n[e].datum?.id;null!=t&&a.set(t+"",e)}return{flat:n,groups:r,byGroup:t,idToIdx:a}}function L(e,t){if(0===e.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};let r=Math.max(0,Math.min(t,e.flat.length-1)),n=e.flat[r];return{flatIndex:r,group:n.group??"_default",indexInGroup:n._groupIndex??0}}function G(e,t,r){let{group:n,indexInGroup:a}=t,l=r.byGroup.get(n);switch(e){case"ArrowRight":return l.length-1>a?l[a+1]._flatIndex:t.flatIndex;case"ArrowLeft":return a>0?l[a-1]._flatIndex:t.flatIndex;case"ArrowDown":{let e=r.groups.indexOf(n);return r.groups.length-1>e?T(r,r.groups[e+1],l[a]):t.flatIndex}case"ArrowUp":{let e=r.groups.indexOf(n);return e>0?T(r,r.groups[e-1],l[a]):t.flatIndex}case"PageDown":return Math.min(t.flatIndex+Math.max(1,Math.floor(.1*r.flat.length)),r.flat.length-1);case"PageUp":return Math.max(t.flatIndex-Math.max(1,Math.floor(.1*r.flat.length)),0);case"Home":return 0;case"End":return r.flat.length-1;case"Escape":return-1;default:return null}}function T(e,t,r){let n=e.byGroup.get(t),a=0,l=Math.abs(n[0].x-r.x);for(let e=1;n.length>e;e++){let t=Math.abs(n[e].x-r.x);l>t&&(l=t,a=e)}return n[a]._flatIndex}function z(e){let t=[];for(let r of e)switch(r.type){case"point":if(!1===r.interactive)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"symbol":if(0>=r.size)break;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"});break;case"glyph":{if(0>=r.size||null==r.datum)break;let e=Ce(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"});break}case"line":{let e=r,n=Array.isArray(e.datum)?e.datum:[],a=e.group??"_default";for(let r=0;e.path.length>r&&n.length>r;r++)t.push({x:e.path[r][0],y:e.path[r][1],datum:n[r],shape:"circle",group:a});break}case"area":{if(!1===r.interactive)break;let e=r,n=Array.isArray(e.datum)?e.datum:[],a=e.group??"_default";for(let r=0;e.topPath.length>r&&n.length>r;r++)t.push({x:e.topPath[r][0],y:e.topPath[r][1],datum:n[r],shape:"circle",group:a});break}case"rect":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.group??"_default"});break;case"heatcell":t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function $(e){let t=[];for(let r of e)if("rect"===r.type&&null!=r.x){if(null==r.datum)continue;t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.group??r.datum?.category??""})}else if("point"===r.type){if(!1===r.interactive)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("symbol"===r.type){if(0>=r.size)continue;t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle",group:"_default"})}else if("glyph"===r.type){if(0>=r.size||null==r.datum)continue;let e=Ce(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:"_default"})}else if("wedge"===r.type&&null!=r.cx){if(null===r.datum)continue;let e=((r.startAngle||0)+(r.endAngle||0))/2,n=((r.innerRadius||0)+(r.outerRadius||50))/2;t.push({x:r.cx+Math.cos(e)*n,y:r.cy+Math.sin(e)*n,datum:r.datum,shape:"wedge",group:"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function H(e){let t=[];for(let r of e)if(r.datum)if("circle"===r.type&&null!=r.cx){if(0>=r.r)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("rect"===r.type&&null!=r.x){if(0>=r.w||0>=r.h)continue;t.push({x:r.x+r.w/2,y:r.y+r.h/2,datum:r.datum,shape:"rect",w:r.w,h:r.h,group:r.datum.id??"_default"})}else if("arc"===r.type&&null!=r.cx)t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"});else if("symbol"===r.type&&null!=r.cx){if(0>=r.size)continue;t.push({x:r.cx,y:r.cy,datum:r.datum,shape:"circle",group:r.datum.id??"_default"})}else if("glyph"===r.type&&null!=r.cx){if(0>=r.size)continue;let e=Ce(r.glyph,r.size);t.push({x:r.cx+e.centerDx,y:r.cy+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight,group:r.datum.id??"_default"})}return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function N(e,t,r,n,a){let l=r.flat[t.flatIndex];if(!l)return G(e,t,r);let o=l.datum?.id;switch(e){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{let n=U(r,l,"ArrowRight"===e?"right":"ArrowLeft"===e?"left":"ArrowDown"===e?"down":"up")??t.flatIndex;return n!==t.flatIndex&&(a.current=-1),n}case"Enter":{if(null==o)return t.flatIndex;let e=V(o,n);if(0===e.length)return t.flatIndex;let l=r.idToIdx.get(e[(a.current+1)%e.length])??-1;return 0>l?t.flatIndex:(a.current=-1,l)}default:{let n=G(e,t,r);return null!==n&&n!==t.flatIndex&&(a.current=-1),n}}}function U(e,t,r){let n=null,a=1/0;for(let l=0;e.flat.length>l;l++){let o=e.flat[l];if(o===t)continue;let i=o.x-t.x,u=o.y-t.y,s=!1;switch(r){case"right":s=i>0&&Math.abs(i)>=Math.abs(u);break;case"left":s=0>i&&Math.abs(i)>=Math.abs(u);break;case"down":s=u>0&&Math.abs(u)>=Math.abs(i);break;case"up":s=0>u&&Math.abs(u)>=Math.abs(i)}if(!s)continue;let c=i*i+u*u;a>c&&(a=c,n=l)}return n}function W(e){return"object"==typeof e&&null!==e&&"id"in e?e.id:e}function V(e,t){let r=e+"",n=[];for(let e of t){let t=e.datum??e,a=W(t.source),l=W(t.target),o=null!=a,i=null!=l;o&&a+""===r&&i?n.push(l+""):i&&l+""===r&&o&&n.push(a+"")}return n}function Y(e){let t=[];for(let r of e)if("point"===r.type&&null!=r.x&&!1!==r.interactive)t.push({x:r.x,y:r.y,datum:r.datum,shape:"circle"});else if("glyph"===r.type){if(0>=r.size||null==r.datum)continue;let e=Ce(r.glyph,r.size);t.push({x:r.x+e.centerDx,y:r.y+e.centerDy,datum:r.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else"geoarea"===r.type&&r.centroid&&!1!==r.interactive&&t.push({x:r.centroid[0],y:r.centroid[1],datum:r.datum,shape:"geoarea",pathData:r.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function F(e,t,r){switch(e){case"ArrowRight":case"ArrowDown":return r-1>t?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":return Math.min(t+Math.max(1,Math.floor(.1*r)),r-1);case"PageUp":return Math.max(t-Math.max(1,Math.floor(.1*r)),0);case"Home":return 0;case"End":return r-1;case"Escape":return-1;default:return null}}function X(e){return{data:e.datum||{},x:e.x,y:e.y,__semioticHoverData:!0}}function q(e,t,r){let n=e.current;n.inside=!0,n.clientX=t.clientX,n.clientY=t.clientY,n.pointerType=t.pointerType??r}function Z(e,t,r,n,a,l){return q(e,t,l),!(!r&&!n||!r&&"touch"===e.current.pointerType&&(Ee(a),1))}function K(e){let{title:t,description:r,summary:n,accessibleTable:a,className:l,animate:o,maxDevicePixelRatio:i,axisExtent:u,autoPlaceAnnotations:s}=e,c={};return t&&(c.title=t),r&&(c.description=r),n&&(c.summary=n),void 0!==a&&(c.accessibleTable=a),l&&(c.className=l),null!=o&&(c.animate=o),void 0!==i&&(c.maxDevicePixelRatio=i),void 0!==u&&(c.axisExtent=u),void 0!==s&&(c.autoPlaceAnnotations=s),c}function J(e){let{linkedHover:t,selection:r,onObservation:n,onClick:a,hoverRadius:l,hoverHighlight:o,forceHoverBehavior:i,forceClickBehavior:u,mobileInteraction:s,customHoverBehavior:c,customClickBehavior:f,linkedHoverInClickPredicate:d=!0}=e,h={};n&&(h.annotationObservationCallback=n);let p=s?.enabled?Math.max(l??30,Math.ceil((s.targetSize||44)/2),24):l;return(i||t||n||a||o)&&(h.customHoverBehavior=c),f&&(u||(d?n||a||t:n||a)||s?.enabled&&(s.tapToSelect||s.tapToLockTooltip)&&(t||o||r))&&(h.customClickBehavior=f),null!=p&&(h.hoverRadius=p),h}function Q(e){let{tooltip:t,defaultTooltipContent:r}=e;return{tooltipContent:!1===t?()=>null:Se(t)||r}}function ee(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function te(e,t){if(!ee(t))return e??((...e)=>({}));let r={};return void 0!==t.stroke&&(r.stroke=t.stroke),void 0!==t.strokeWidth&&(r.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(r.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...r}):(...e)=>({...r})}function re(e,t,r){if(1>=r)return 1;let n=r-1;return De({age:n-t,extent:n,type:e.type,halfLife:e.halfLife??r/2,threshold:e.stepThreshold??.5*r,minOpacity:e.minOpacity??.1})}function ne(e){let t=/* @__PURE__ */new Map;for(let r=0;e.length>r;r++)t.set(e[r],r);return t}function ae(e,t,r,n=ne(r)){let a=r.length;if(a>1)for(let r of t){if("line"===r.type){let t=Array.isArray(r.datum)?r.datum:[];if(2>t.length)continue;let l=Array(t.length),o=!1;for(let r=0;t.length>r;r++){let i=n.get(t[r]);null!=i?(l[r]=re(e,i,a),1>l[r]&&(o=!0)):l[r]=1}o&&(r._decayOpacities=l);continue}if("area"===r.type){let t=Array.isArray(r.datum)?r.datum:[],l=r.topPath?r.topPath.length:t.length;if(2>l)continue;if(t.length===l){let o=Array(l),i=!1;for(let r=0;t.length>r;r++){let l=n.get(t[r]);null!=l?(o[r]=re(e,l,a),1>o[r]&&(i=!0)):o[r]=1}i&&(r._decayOpacities=o)}else{let o=1;for(let r of t){let t=n.get(r);if(null!=t){let r=re(e,t,a);o>r&&(o=r)}}if(1>o){let e=Array(l);e.fill(o),r._decayOpacities=e}}continue}let t=n.get(r.datum);if(null==t)continue;let l=re(e,t,a);"candlestick"===r.type?r._decayOpacity=l:r.style={...r.style,opacity:(r.style?.opacity??1)*l}}}function le(e){if("production"===process.env.NODE_ENV)return;let{label:t,nodes:r,overlays:n,warned:a}=e;oe(n)&&0===r.length&&ie(a,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),r.length>0&&r.every(e=>null==e.datum)&&ie(a,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function oe(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(oe))}function ie(e,t,r){e.has(t)||(e.add(t),console.warn(r))}function ue(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:e+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function se(e,t,r,n){let a=ue(t),l="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:l,message:`Semiotic ${e} ${l} failed: ${a.message}`,error:a,recovery:r?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:r,affectedRevision:n}}function ce(e){try{return{kind:"success",result:e.run()}}catch(t){let r=e.hasPreviousResult,n=se(e.family,t,r,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(n)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:n,preservedLastGoodScene:r}}}function fe(){return this.updateResults.last}function de(){return this.updateResults.last}function he(e){return this.updateResults.subscribe(e)}function pe(e){this.config.layoutSelection=e}function ye(){Je.set(this,!0)}function ge(){let e=!0===Je.get(this);return Je.delete(this),e}function me(e){Object.assign(e.prototype,{getLastUpdateResult:fe,getUpdateSnapshot:de,subscribeUpdateResult:he,setLayoutSelection:pe,markStylePaintPending:ye,consumeStylePaintPending:ge})}function xe(e,t,r,n,a,l){let o=a-r,i=l-n,u=o*o+i*i;if(0===u)return Math.sqrt((e-r)**2+(t-n)**2);let s=((e-r)*o+(t-n)*i)/u;return s=Math.max(0,Math.min(1,s)),Math.sqrt((e-(r+s*o))**2+(t-(n+s*i))**2)}function be(e,t,r){return r.x>e||e>r.x+r.w||r.y>t||t>r.y+r.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:r.x+r.w/2,cy:r.y+r.h/2}}function ve(e,t=30){return Math.max((e??4)+5,12,t)}function we(e){return e instanceof Date?e:"number"==typeof e&&e>1e9?new Date(e):null}function ke(e,t){let r=we(e);if(!r)return!1;let n=we(t);return!n||r.getFullYear()!==n.getFullYear()||r.getMonth()!==n.getMonth()}function Ae(e){let t=e%(2*Math.PI);return 0>t&&(t+=2*Math.PI),t}function Me(e,t,r,n,a,l=e=>e.x,o=e=>e.y,i=e=>e.r){let u=Math.max(n,a+5,12),s=t-u,c=t+u,f=r-u,d=r+u,h=null,p=1/0;return e.visit((e,a,u,y,g)=>{if(a>c||s>y||u>d||f>g)return!0;if(!e.length){let a=e;do{let e=a.data,u=l(e)-t,s=o(e)-r,c=Math.sqrt(u*u+s*s);ve(i(e),n)>=c&&p>c&&(h=e,p=c),a=a.next}while(a)}return!1}),h?{node:h,distance:p}:null}function _e(e,t){return"string"==typeof e&&e.length>0?e:t}function Ie(e,t,r){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${r.familyPhrase})`:r.fallback}function Oe(e){let t=(e+"").replace(/[^a-zA-Z0-9_-]/g,"_"),r=/^[A-Za-z_]/.test(t)?t:"c"+t,n=r+"-semiotic-title",a=r+"-semiotic-desc";return{titleId:n,descId:a,labelledBy:`${n} ${a}`}}import{Va as Se,ea as Ee,h as Re,ia as Be,l as De,ya as je}from"./c-UMGHCBH5.min.js";import{i as Ce,m as Pe}from"./c-3BYZXCX3.min.js";import{jsx as Le,jsxs as Ge}from"react/jsx-runtime";import*as Te from"react";import{useEffect as ze,useRef as $e}from"react";var He={fresh:1,aging:.7,stale:.45,expired:.25},Ne={alpha:1,band:"fresh",isStale:!1};import{useEffect as Ue,useRef as We}from"react";import{jsx as Ve}from"react/jsx-runtime";var Ye={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"};import{useRef as Fe}from"react";import{useCallback as Xe,useEffect as qe,useRef as Ze}from"react";var Ke=/* @__PURE__ */new Set,Je=/* @__PURE__ */new WeakMap;export{re as a,ne as b,ae as c,le as d,ce as e,me as f,u as g,s as h,c as i,xe as j,be as k,ve as l,ke as m,Ae as n,Me as o,f as p,d as q,p as r,e as s,_e as t,Ie as u,Oe as v,y as w,b as x,w as y,k as z,A,M as B,_ as C,O as D,B as E,j as F,C as G,t as H,r as I,l as J,o as K,i as L,P as M,L as N,G as O,z as P,$ as Q,H as R,N as S,Y as T,F as U,X as V,Z as W,K as X,J as Y,Q as Z,te as _};
|