semiotic 3.8.4 → 3.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/CLAUDE.md +6 -3
  2. package/README.md +44 -38
  3. package/ai/componentMetadata.cjs +1 -1
  4. package/ai/dist/mcp-server.js +4 -2
  5. package/ai/examples.md +167 -0
  6. package/ai/schema.json +1004 -1
  7. package/ai/surface-manifest.json +6 -4
  8. package/ai/system-prompt.md +1 -1
  9. package/dist/chunk-chartContainerDataAudit-74TLKIP6.module.min.js +2 -0
  10. package/dist/{chunk-chunk-LQBSXO7K.module.min.js → chunk-chunk-4AANPFOX.module.min.js} +1 -1
  11. package/dist/{chunk-chunk-N6VKKF3A.module.min.js → chunk-chunk-5I3UZV4Q.module.min.js} +1 -1
  12. package/dist/chunk-chunk-74CCPVXB.module.min.js +1 -0
  13. package/dist/{chunk-chunk-6TPGFL7M.module.min.js → chunk-chunk-BANTPINB.module.min.js} +1 -1
  14. package/dist/chunk-chunk-CKMD5NV3.module.min.js +2 -0
  15. package/dist/chunk-chunk-CO5KQMGH.module.min.js +1 -0
  16. package/dist/{chunk-chunk-BFHUYEOS.module.min.js → chunk-chunk-CWQ5YIHX.module.min.js} +1 -1
  17. package/dist/chunk-chunk-E6TXX6MI.module.min.js +1 -0
  18. package/dist/{chunk-chunk-JDXT6ORT.module.min.js → chunk-chunk-I36PJ4OC.module.min.js} +1 -1
  19. package/dist/chunk-chunk-K3DMEW22.module.min.js +1 -0
  20. package/dist/chunk-chunk-KT2VAZMZ.module.min.js +1 -0
  21. package/dist/{chunk-chunk-AQPQN2HH.module.min.js → chunk-chunk-L6EA5V3G.module.min.js} +1 -1
  22. package/dist/{chunk-chunk-FBGHXL72.module.min.js → chunk-chunk-LJLS6DY7.module.min.js} +1 -1
  23. package/dist/chunk-chunk-LJPCLYSC.module.min.js +2 -0
  24. package/dist/{chunk-chunk-7RYBCTK5.module.min.js → chunk-chunk-N5DDKCCF.module.min.js} +1 -1
  25. package/dist/chunk-chunk-NLO44TOS.module.min.js +2 -0
  26. package/dist/{chunk-chunk-F5V4UIE6.module.min.js → chunk-chunk-PZJ2SBLL.module.min.js} +1 -1
  27. package/dist/chunk-chunk-QUJ6TTLY.module.min.js +1 -0
  28. package/dist/chunk-chunk-RBIDBUT4.module.min.js +2 -0
  29. package/dist/chunk-chunk-RFLAG356.module.min.js +1 -0
  30. package/dist/{chunk-chunk-7KZJUTKP.module.min.js → chunk-chunk-RPU4IZAV.module.min.js} +1 -1
  31. package/dist/{chunk-chunk-PLIDPQNG.module.min.js → chunk-chunk-SKMBCFIL.module.min.js} +1 -1
  32. package/dist/{chunk-chunk-SR4ZXOWR.module.min.js → chunk-chunk-TAE7W424.module.min.js} +1 -1
  33. package/dist/{chunk-chunk-KQ546MKE.module.min.js → chunk-chunk-TMWIZL3K.module.min.js} +1 -1
  34. package/dist/chunk-chunk-TUBMTZMU.module.min.js +2 -0
  35. package/dist/chunk-chunk-UFFEXJQY.module.min.js +1 -0
  36. package/dist/chunk-chunk-XSCHTS4D.module.min.js +2 -0
  37. package/dist/{chunk-chunk-F7WFPD4O.module.min.js → chunk-chunk-XXWSHGPL.module.min.js} +1 -1
  38. package/dist/chunk-chunk-ZXIXAPRE.module.min.js +2 -0
  39. package/dist/components/ChartContainer.d.ts +10 -0
  40. package/dist/components/ai/chartCapabilities.d.ts +2 -1
  41. package/dist/components/ai/chartCapabilityTypes.d.ts +14 -0
  42. package/dist/components/chartContainerDataAudit.d.ts +10 -0
  43. package/dist/components/charts/geo/DistanceCartogram.d.ts +29 -3
  44. package/dist/components/charts/index.d.ts +1 -0
  45. package/dist/components/charts/network/ForceDirectedGraph.d.ts +36 -1
  46. package/dist/components/charts/physics/CrucibleChart.capability.d.ts +8 -0
  47. package/dist/components/charts/physics/CrucibleChart.d.ts +63 -0
  48. package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +27 -0
  49. package/dist/components/charts/physics/crucibleChartProps.d.ts +90 -0
  50. package/dist/components/charts/physics/crucibleChrome.d.ts +47 -0
  51. package/dist/components/charts/physics/crucibleController.d.ts +59 -0
  52. package/dist/components/charts/physics/crucibleEffects.d.ts +30 -0
  53. package/dist/components/charts/physics/cruciblePhysics.d.ts +54 -0
  54. package/dist/components/charts/physics/crucibleProgram.d.ts +38 -0
  55. package/dist/components/charts/physics/crucibleTypes.d.ts +415 -0
  56. package/dist/components/charts/shared/chartSpecCore.d.ts +8 -0
  57. package/dist/components/charts/shared/crucibleWireSchema.d.ts +5 -0
  58. package/dist/components/charts/shared/diagnoseTypes.d.ts +10 -0
  59. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  60. package/dist/components/data/auditData.d.ts +51 -0
  61. package/dist/components/data/dataAuditPresentation.d.ts +18 -0
  62. package/dist/components/data/dataAuditSources.d.ts +9 -0
  63. package/dist/components/data/numericContracts.d.ts +59 -0
  64. package/dist/components/data/numericFieldProfiler.d.ts +23 -0
  65. package/dist/components/recipes/netEnsembleLayout.d.ts +167 -0
  66. package/dist/components/recipes/netEnsembleOverlays.d.ts +20 -0
  67. package/dist/components/recipes/wordTrails.d.ts +156 -0
  68. package/dist/components/recipes/wordTrailsProgressiveReveal.d.ts +42 -0
  69. package/dist/components/semiotic-ai-core.d.ts +3 -0
  70. package/dist/components/semiotic-ai-data-audit.d.ts +4 -0
  71. package/dist/components/semiotic-ai.d.ts +7 -5
  72. package/dist/components/semiotic-physics.d.ts +1 -0
  73. package/dist/components/semiotic-recipes-core.d.ts +4 -0
  74. package/dist/components/semiotic-utils-core.d.ts +3 -0
  75. package/dist/components/semiotic.d.ts +1 -1
  76. package/dist/components/server/renderEvidence.d.ts +27 -0
  77. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  78. package/dist/components/server/serverChartConfigsPhysics.d.ts +9 -0
  79. package/dist/components/server/staticAnnotations.d.ts +12 -0
  80. package/dist/components/stream/GeoPipelineStore.d.ts +1 -0
  81. package/dist/components/stream/GeoSVGOverlay.d.ts +7 -0
  82. package/dist/components/stream/geoCartogram.d.ts +7 -0
  83. package/dist/components/stream/geoTypes.d.ts +17 -2
  84. package/dist/components/stream/networkFrameHandleTypes.d.ts +4 -0
  85. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +8 -0
  86. package/dist/components/useChartContainerDataAudit.d.ts +7 -0
  87. package/dist/geo.min.js +1 -1
  88. package/dist/geo.module.min.js +1 -1
  89. package/dist/network.min.js +1 -1
  90. package/dist/network.module.min.js +1 -1
  91. package/dist/ordinal.module.min.js +1 -1
  92. package/dist/physics.min.js +1 -1
  93. package/dist/physics.module.min.js +1 -1
  94. package/dist/realtime.min.js +1 -1
  95. package/dist/realtime.module.min.js +1 -1
  96. package/dist/semiotic-ai-core.d.ts +3 -0
  97. package/dist/semiotic-ai-core.min.js +1 -1
  98. package/dist/semiotic-ai-core.module.min.js +1 -1
  99. package/dist/semiotic-ai.d.ts +7 -5
  100. package/dist/semiotic-ai.min.js +1 -1
  101. package/dist/semiotic-ai.module.min.js +1 -1
  102. package/dist/semiotic-experimental.min.js +1 -1
  103. package/dist/semiotic-experimental.module.min.js +1 -1
  104. package/dist/semiotic-physics.d.ts +1 -0
  105. package/dist/semiotic-realtime-core.min.js +1 -1
  106. package/dist/semiotic-realtime-core.module.min.js +1 -1
  107. package/dist/semiotic-recipes-core.d.ts +4 -0
  108. package/dist/semiotic-recipes-core.min.js +1 -1
  109. package/dist/semiotic-recipes-core.module.min.js +1 -1
  110. package/dist/semiotic-recipes.min.js +1 -1
  111. package/dist/semiotic-recipes.module.min.js +1 -1
  112. package/dist/semiotic-server-edge.min.js +1 -1
  113. package/dist/semiotic-server-edge.module.min.js +1 -1
  114. package/dist/semiotic-server-node.min.js +1 -1
  115. package/dist/semiotic-server-node.module.min.js +1 -1
  116. package/dist/semiotic-utils-core.d.ts +3 -0
  117. package/dist/semiotic-utils-core.min.js +1 -1
  118. package/dist/semiotic-utils-core.module.min.js +1 -1
  119. package/dist/semiotic-utils.min.js +1 -1
  120. package/dist/semiotic-utils.module.min.js +1 -1
  121. package/dist/semiotic.d.ts +1 -1
  122. package/dist/semiotic.min.js +1 -1
  123. package/dist/semiotic.module.min.js +1 -1
  124. package/dist/server.min.js +1 -1
  125. package/dist/server.module.min.js +1 -1
  126. package/dist/xy.module.min.js +1 -1
  127. package/package.json +2 -2
  128. package/dist/chunk-chunk-3ILKBVVQ.module.min.js +0 -1
  129. package/dist/chunk-chunk-ASKSE5F5.module.min.js +0 -1
  130. package/dist/chunk-chunk-B3DRZPBK.module.min.js +0 -2
  131. package/dist/chunk-chunk-FP44FHFO.module.min.js +0 -2
  132. package/dist/chunk-chunk-HKXUAEPJ.module.min.js +0 -2
  133. package/dist/chunk-chunk-ICEXPNDC.module.min.js +0 -2
  134. package/dist/chunk-chunk-JMVEIZXP.module.min.js +0 -1
  135. package/dist/chunk-chunk-KHCOJMGK.module.min.js +0 -1
  136. package/dist/chunk-chunk-MFHF4J2Z.module.min.js +0 -1
  137. package/dist/chunk-chunk-NKZ75IM5.module.min.js +0 -2
  138. package/dist/chunk-chunk-QGZGZI4X.module.min.js +0 -1
  139. package/dist/chunk-chunk-RP7WTID5.module.min.js +0 -1
  140. package/dist/chunk-chunk-S7KLNUO6.module.min.js +0 -1
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{resolveCSSColor as n}from"./chunk-chunk-BFHUYEOS.module.min.js";function r(n){const{background:r,hasBackgroundGraphics:t=!1,themeBackground:c=""}=n;return"transparent"===r||t?null:r||(c&&"transparent"!==c?c:"")||null}function t(t,c){const{background:o,hasBackgroundGraphics:u=!1,themeBackground:i="",x:a=0,y:e=0,width:d,height:h}=c,s=r({background:o,hasBackgroundGraphics:u,themeBackground:i});if(!s)return!1;const g=n(t,s);return!!g&&(t.fillStyle=g,t.fillRect(a,e,d,h),!0)}function c(n){return!!(n.dirtyOrRebuilt||n.transitioning||n.animationTicked||n.continuous||n.liveEncoding||n.forced)}function o(n,r){return n||r}export{r as resolveCanvasBackground,t as paintCanvasBackground,c as needsDataCanvasPaint,o as needsInteractionCanvasPaint};
2
+ import{resolveCSSColor as n}from"./chunk-chunk-CWQ5YIHX.module.min.js";function r(n){const{background:r,hasBackgroundGraphics:t=!1,themeBackground:c=""}=n;return"transparent"===r||t?null:r||(c&&"transparent"!==c?c:"")||null}function t(t,c){const{background:o,hasBackgroundGraphics:u=!1,themeBackground:i="",x:a=0,y:e=0,width:d,height:h}=c,s=r({background:o,hasBackgroundGraphics:u,themeBackground:i});if(!s)return!1;const g=n(t,s);return!!g&&(t.fillStyle=g,t.fillRect(a,e,d,h),!0)}function c(n){return!!(n.dirtyOrRebuilt||n.transitioning||n.animationTicked||n.continuous||n.liveEncoding||n.forced)}function o(n,r){return n||r}export{r as resolveCanvasBackground,t as paintCanvasBackground,c as needsDataCanvasPaint,o as needsInteractionCanvasPaint};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{validateNetworkData as e,validateObjectData as t}from"./chunk-chunk-JCG72SGW.module.min.js";import{mergeShapeStyle as o,useCustomChartScaffold as n,useFrameImperativeHandle as i,useResolvedSelection as r}from"./chunk-chunk-SKMBCFIL.module.min.js";import{StreamNetworkFrame_default as s,buildRibbonGeometry as a}from"./chunk-chunk-4AANPFOX.module.min.js";import{buildBaseMetadataProps as l,buildCustomBehaviorProps as c}from"./chunk-chunk-XXWSHGPL.module.min.js";import{mulberry32 as d}from"./chunk-chunk-SIRIJ3DY.module.min.js";import{composeStyleRules as m,makeNodeRuleContext as h}from"./chunk-chunk-EMO5NUGE.module.min.js";import{COLOR_SCHEMES as g,DEFAULT_COLORS as u,DEFAULT_SELECTION_OPACITY as f,DEPTH_PALETTE_COLORS as p,filterSparseArray as b,getColor as y,normalizeTooltip as v,resolveAxisFreeMarginDefaults as k,resolveCategoricalPalette as S,resolveDefaultFill as w,resolveMobileInteraction as C,useChartLegendAndMargin as T,useChartMode as I,useChartSelection as A,useColorScale as M,useLegendInteraction as H,useThemeCategorical as x}from"./chunk-chunk-CWQ5YIHX.module.min.js";import{getMin as B}from"./chunk-chunk-JJ2OOIET.module.min.js";import{ChartError as N,SafeRender as O,renderEmptyState as D,renderLoadingState as L}from"./chunk-chunk-ACLDBMRH.module.min.js";import{forwardRef as P,useMemo as E}from"react";import{jsx as W}from"react/jsx-runtime";var R=P(function(e,t){const{nodes:o,edges:i,layout:r,layoutConfig:a,onLayoutError:d,nodeIDAccessor:m="id",sourceAccessor:h="source",targetAccessor:g="target",margin:u,className:f,colorBy:p,colorScheme:y,selection:v,linkedHover:k,onObservation:S,onClick:w,chartId:T,annotations:I,autoPlaceAnnotations:M,frameProps:H={}}=e,{frameRef:x,resolved:B,normalizedMargin:N}=n({imperativeRef:t,imperativeVariant:"network",margin:u,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),P=E(()=>b(o),[o]),R=E(()=>b(i),[i]),z=E(()=>void 0===o&&void 0===i?void 0:[...P,...R],[i,o,R,P]),F=C(e.mobileInteraction,{mode:e.mode,width:B.width,mobileSemantics:e.mobileSemantics}),{customHoverBehavior:j,customClickBehavior:$,activeSelectionHook:_}=A({selection:v,linkedHover:k,fallbackFields:"string"==typeof p?[p]:[],onObservation:S,onClick:w,chartType:"NetworkCustomChart",chartId:T,colorByField:"string"==typeof p?p:void 0,mobileInteraction:F}),G=E(()=>_?.isActive?{isActive:!0,predicate:_.predicate}:null,[_?.isActive,_?.predicate]),{width:q,height:X,enableHover:J,title:Y,description:K,summary:Q,accessibleTable:Z}=B,U=L(e.loading,q,X,e.loadingContent),V=U?null:D(z,q,X,e.emptyContent);if(U||V)return U||V;const ee={chartType:"force",...null!=o&&{nodes:P},...null!=i&&{edges:R},customNetworkLayout:r,layoutConfig:a,onLayoutError:d,nodeIDAccessor:m,sourceAccessor:h,targetAccessor:g,colorBy:p,colorScheme:y,size:[q,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:N,enableHover:J,...l({title:Y,description:K,summary:Q,accessibleTable:Z,className:f,animate:e.animate,autoPlaceAnnotations:M}),...c({linkedHover:k,selection:v,onObservation:S,onClick:w,mobileInteraction:F,customHoverBehavior:j,customClickBehavior:$,linkedHoverInClickPredicate:!1}),layoutSelection:G,...null!=I&&{annotations:I},...H};return W(O,{componentName:"NetworkCustomChart",width:q,height:X,children:W(s,{ref:x,...ee})})});R.displayName="NetworkCustomChart";import{useMemo as z,forwardRef as F,useRef as j}from"react";import{useMemo as $}from"react";function _(e,t){if(!e)return[];const o=[],n=e=>{o.push(e);const i="function"==typeof t?t(e):e[t];i&&Array.isArray(i)&&i.forEach(n)};return n(e),o}function G(e,t,o,n){if(e&&e.length>0)return e;const i=new Set;return t.forEach(e=>{const t="function"==typeof o?o(e):e[o],r="function"==typeof n?n(e):e[n];i.add(t),i.add(r)}),Array.from(i).map(e=>({id:e}))}function q(e){return"function"==typeof e?e:t=>t[e]||1}function X({edgeColorBy:e,colorBy:t,colorScale:o,nodeStyleFn:n,edgeOpacity:i,baseStyle:r={}}){return s=>{const a={fillOpacity:i,...r};if("function"==typeof e)a.fill=e(s);else if("source"===e){const e="object"==typeof s.source?s.source:null;t&&e?a.fill=y(e.data||e,t,o):e&&(a.fill=n(e,e.index).fill)}else if("target"===e){const e="object"==typeof s.target?s.target:null;t&&e?a.fill=y(e.data||e,t,o):e&&(a.fill=n(e,e.index).fill)}else"gradient"===e&&(a.fill="#999",a.fillOpacity=.7*i);return a}}function J(e){const{nodes:t,edges:o,inferNodes:n=!0,sourceAccessor:i="source",targetAccessor:r="target",colorBy:s,colorScheme:a,showLegend:l,legendPosition:c,legendInteraction:d,selection:m,linkedHover:h,onObservation:g,onClick:f,mobileInteraction:p,mobileSemantics:y,chartType:v,chartId:k,marginDefaults:w,userMargin:I,width:B,height:N,loading:O,loadingContent:P,emptyContent:E,emptyDataKey:W="edges"}=e,R=$(()=>b(o),[o]),z=$(()=>b(t),[t]),F=L(O,B,N,P),j=F?null:D("nodes"===W?void 0===t?void 0:z:void 0===o?void 0:R,B,N,E),_=$(()=>n?G(z,R,i,r):z,[n,z,R,i,r]),q=M(_,s,a),X=x(),J=$(()=>Array.isArray(a)&&a.length>0?a:[...S(a,X,u)],[a,X]),Y=$(()=>{if(!s)return[];const e=new Set;for(const t of _){const o="function"==typeof s?s(t):t[s];null!=o&&e.add(o+"")}return Array.from(e)},[_,s]),K=H(d,s,Y),{legend:Q,margin:Z,legendPosition:U}=T({data:_,colorBy:s,colorScale:q,showLegend:l,legendPosition:c,userMargin:I,defaults:w,categories:Y}),V=$(()=>C(p,{width:B,mobileSemantics:y}),[p,B,y]),ee=A({selection:m,linkedHover:h,fallbackFields:s?["string"==typeof s?s:""]:[],unwrapData:!0,onObservation:g,onClick:f,mobileInteraction:V,chartType:v,chartId:k}),{customHoverBehavior:te,customClickBehavior:oe,activeSelectionHook:ne,hoverSelectionHook:ie,crosshairSourceId:re}=ee;return{safeNodes:_,safeEdges:R,colorScale:q,effectivePalette:J,themeCategorical:X,allCategories:Y,legendState:K,legend:Q,margin:Z,legendPosition:U,mobileInteraction:V,customHoverBehavior:te,customClickBehavior:oe,activeSelectionHook:ne,hoverSelectionHook:ie,crosshairSourceId:re,loadingEl:F,emptyEl:j}}import{jsx as Y}from"react/jsx-runtime";var K=F(function(t,n){const r=j(null);i(n,{variant:"network",frameRef:r});const a=I(t.mode,{width:t.width,height:t.height,enableHover:t.enableHover,showLegend:t.showLegend,showLabels:t.showLabels,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules},{width:600,height:600}),{nodes:l,edges:d,margin:g,className:u,nodeIdAccessor:f,nodeIDAccessor:p,sourceAccessor:b="source",targetAccessor:k="target",nodeLabel:S,colorBy:C,colorScheme:T,styleRules:A,nodeSize:M=8,nodeSizeRange:H=[5,20],nodeStroke:x,nodeStrokeWidth:B,edgeWidth:D,edgeColor:L,edgeOpacity:P,iterations:E=300,forceStrength:W=.1,layoutExecution:R="auto",layoutLoadingContent:F,onLayoutStateChange:$,tooltip:_,frameProps:G={},onObservation:q,onClick:X,chartId:K,selection:Q,linkedHover:Z,loading:U,loadingContent:V,emptyContent:ee,legendInteraction:te,legendPosition:oe,stroke:ne,strokeWidth:ie,opacity:re}=t,se=f??p??"id",{width:ae,height:le,enableHover:ce,showLegend:de,showLabels:me=!1,title:he,description:ge,summary:ue,accessibleTable:fe}=a,pe=J({nodes:l,edges:d,inferNodes:!1,nodeIdAccessor:se,sourceAccessor:b,targetAccessor:k,colorBy:C,colorScheme:T,showLegend:de,legendPosition:oe,legendInteraction:te,selection:Q,linkedHover:Z,onObservation:q,onClick:X,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ForceDirectedGraph",chartId:K,marginDefaults:a.marginDefaults,userMargin:g,width:ae,height:le,loading:U,loadingContent:V,emptyContent:ee,emptyDataKey:"nodes"}),be=z(()=>new Map,[]),ye=z(()=>e=>{const t={};return t.fill=C?y(e.data||e,C,pe.colorScale):w(void 0,pe.themeCategorical,T,void 0,be),"number"==typeof M&&(t.r=M),t},[C,pe.colorScale,M,pe.themeCategorical,T,be]),ve=z(()=>h(C,"number"==typeof M?void 0:M),[C,M]),ke=z(()=>o(m(ye,A,ve,e=>e.data||e),{stroke:x??ne,strokeWidth:B??ie,opacity:re}),[ye,A,ve,x,ne,B,ie,re]),Se=L??ne??"#999",we=P??re??.6,Ce=ie??1,Te=z(()=>e=>{const t=e.data||e;let o;if(void 0===D)o=Ce;else if("number"==typeof D)o=D;else if("function"==typeof D)o=D(t);else{const e=t[D],n="number"==typeof e?e:Number(e);o=Number.isFinite(n)&&n>0?n:Ce}return{stroke:Se,strokeWidth:o,opacity:we}},[D,Se,we,Ce]),Ie=z(()=>{if(me&&S)return"function"==typeof S?S:e=>e.data?.[S]??e[S]??e.id},[me,S]),Ae=e({componentName:"ForceDirectedGraph",nodes:l,edges:d,nodesRequired:!0,edgesRequired:!0,accessors:{nodeIDAccessor:se}});return Ae?Y(N,{componentName:"ForceDirectedGraph",message:Ae,width:ae,height:le}):pe.loadingEl?pe.loadingEl:pe.emptyEl?pe.emptyEl:Y(O,{componentName:"ForceDirectedGraph",width:ae,height:le,children:Y(s,{ref:r,chartType:"force",...null!=l&&{nodes:pe.safeNodes},...null!=d&&{edges:pe.safeEdges},size:[ae,le],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:pe.margin,nodeIDAccessor:se,sourceAccessor:b,targetAccessor:k,iterations:E,forceStrength:W,layoutExecution:R,layoutLoadingContent:F,onLayoutStateChange:$,nodeStyle:ke,edgeStyle:Te,colorBy:C,colorScheme:pe.effectivePalette,nodeSize:M,nodeSizeRange:H,nodeLabel:Ie,showLabels:me,enableHover:ce,tooltipContent:!1===_?()=>null:v(_)||void 0,...c({linkedHover:Z,selection:Q,onObservation:q,onClick:X,mobileInteraction:pe.mobileInteraction,customHoverBehavior:pe.customHoverBehavior,customClickBehavior:pe.customClickBehavior,linkedHoverInClickPredicate:!1}),legend:pe.legend,legendPosition:pe.legendPosition,...te&&"none"!==te&&{legendHoverBehavior:pe.legendState.onLegendHover,legendClickBehavior:pe.legendState.onLegendClick,legendHighlightedCategory:pe.legendState.highlightedCategory,legendIsolatedCategories:pe.legendState.isolatedCategories},className:u,title:he,description:ge,summary:ue,accessibleTable:fe,...null!=t.animate&&{animate:t.animate},...G})})});K.displayName="ForceDirectedGraph";import{useMemo as Q,forwardRef as Z,useRef as U}from"react";import{jsx as V}from"react/jsx-runtime";var ee=Z(function(t,n){const r=U(null);i(n,{variant:"network",frameRef:r,overrides:{getData:()=>r.current?.getTopology()?.edges?.map(e=>e.data)??[]}});const a=I(t.mode,{width:t.width,height:t.height,enableHover:t.enableHover,showLabels:t.showLabels,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules},{width:600,height:600}),{nodes:l,edges:d,margin:f,className:p,sourceAccessor:b="source",targetAccessor:k="target",valueAccessor:S="value",nodeIdAccessor:C="id",colorBy:T,colorScheme:A,styleRules:M,edgeColorBy:H="source",padAngle:x=.01,groupWidth:B=20,sortGroups:D,nodeLabel:L,edgeOpacity:P=.5,tooltip:E,frameProps:W={},onObservation:R,onClick:z,chartId:F,selection:j,linkedHover:$,loading:_,loadingContent:G,emptyContent:q,legendInteraction:Y,stroke:K,strokeWidth:Z,opacity:ee}=t,{width:te,height:oe,enableHover:ne,showLabels:ie=!0,title:re,description:se,summary:ae,accessibleTable:le}=a,ce=J({nodes:l,edges:d,inferNodes:!0,nodeIdAccessor:C,sourceAccessor:b,targetAccessor:k,colorBy:T,colorScheme:A,showLegend:!1,legendInteraction:Y,selection:j,linkedHover:$,onObservation:R,onClick:z,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ChordDiagram",chartId:F,marginDefaults:a.marginDefaults,userMargin:f,width:te,height:oe,loading:_,loadingContent:G,emptyContent:q}),de=Q(()=>new Map,[]),me=Q(()=>new Map,[]),he=ce.safeNodes.length>0,ge=Q(()=>{if(he)return(e,t)=>{const o={stroke:"black",strokeWidth:1};if(T)o.fill=y(e.data||e,T,ce.colorScale);else{const n=Array.isArray(A)?A:g[A]||u,i=Array.isArray(n)?n:u,r=(e.id??e.data?.[C]??"")+"";me.has(r)||me.set(r,me.size);const s=e.index??t??me.get(r);o.fill=i[s%i.length]}return o}},[he,T,ce.colorScale,A,C,me]),ue=Q(()=>h(T),[T]),fe=Q(()=>{if(ge||M&&M.length>0)return o(m(ge,M,ue,e=>e.data||e),{stroke:K,strokeWidth:Z,opacity:ee})},[ge,M,ue,K,Z,ee]),pe=Q(()=>{if(he)return X({edgeColorBy:H,colorBy:T,colorScale:ce.colorScale,nodeStyleFn:fe||(e=>({fill:w(void 0,ce.themeCategorical,A,void 0,de)})),edgeOpacity:P,baseStyle:{stroke:"black",strokeWidth:.5,strokeOpacity:P}})},[he,H,T,ce.colorScale,fe,P,ce.themeCategorical,A,de]),be=Q(()=>pe?o(pe,{stroke:K,strokeWidth:Z,opacity:ee}):void 0,[pe,K,Z,ee]),ye=Q(()=>{if(!ie)return;const e=L||C;return"function"==typeof e?e:t=>t.data?.[e]??t[e]??t.id},[ie,L,C]),ve=e({componentName:"ChordDiagram",edges:d,edgesRequired:!0});return ve?V(N,{componentName:"ChordDiagram",message:ve,width:te,height:oe}):ce.loadingEl?ce.loadingEl:ce.emptyEl?ce.emptyEl:V(O,{componentName:"ChordDiagram",width:te,height:oe,children:V(s,{ref:r,chartType:"chord",...ce.safeNodes.length>0&&{nodes:ce.safeNodes},...null!=d&&{edges:ce.safeEdges},size:[te,oe],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ce.margin,nodeIDAccessor:C,sourceAccessor:b,targetAccessor:k,valueAccessor:S,padAngle:x,groupWidth:B,sortGroups:D,nodeStyle:fe,edgeStyle:be,colorBy:T,colorScheme:ce.effectivePalette,edgeColorBy:H,edgeOpacity:P,nodeLabel:ye,showLabels:ie,enableHover:ne,tooltipContent:!1===E?()=>null:v(E)||void 0,...c({linkedHover:$,selection:j,onObservation:R,onClick:z,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior,linkedHoverInClickPredicate:!1}),...Y&&"none"!==Y&&{legendHoverBehavior:ce.legendState.onLegendHover,legendClickBehavior:ce.legendState.onLegendClick,legendHighlightedCategory:ce.legendState.highlightedCategory,legendIsolatedCategories:ce.legendState.isolatedCategories},className:p,title:re,description:se,summary:ae,accessibleTable:le,...null!=t.animate&&{animate:t.animate},...W})})});ee.displayName="ChordDiagram";import{useMemo as te,forwardRef as oe,useRef as ne}from"react";import{jsx as ie}from"react/jsx-runtime";var re=oe(function(t,n){const r=ne(null);i(n,{variant:"network",frameRef:r,overrides:{getData:()=>r.current?.getTopology()?.edges?.map(e=>e.data)??[]}});const a=I(t.mode,{width:t.width,height:t.height,enableHover:t.enableHover,showLabels:t.showLabels,title:t.title,description:t.description,accessibleTable:t.accessibleTable,summary:t.summary,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules},{width:800,height:600}),{nodes:l,edges:d,margin:g,className:u,sourceAccessor:f="source",targetAccessor:p="target",valueAccessor:b="value",nodeIdAccessor:k="id",colorBy:S,colorScheme:C,styleRules:T,edgeColorBy:A="source",orientation:M="horizontal",nodeAlign:H="justify",nodePaddingRatio:x=.05,nodeWidth:B=15,nodeLabel:D,edgeOpacity:L=.5,edgeSort:P,tooltip:E,frameProps:W={},onObservation:R,onClick:z,chartId:F,selection:j,linkedHover:$,loading:_,loadingContent:G,emptyContent:q,showLegend:Y,legendPosition:K,legendInteraction:Q,stroke:Z,strokeWidth:U,opacity:V}=t,{width:ee,height:oe,enableHover:re,showLabels:se=!0,title:ae,description:le,summary:ce,accessibleTable:de}=a,me=J({nodes:l,edges:d,inferNodes:!0,nodeIdAccessor:k,sourceAccessor:f,targetAccessor:p,colorBy:S,colorScheme:C,showLegend:Y,legendPosition:K,legendInteraction:Q,selection:j,linkedHover:$,onObservation:R,onClick:z,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"SankeyDiagram",chartId:F,marginDefaults:a.marginDefaults,userMargin:g,width:ee,height:oe,loading:_,loadingContent:G,emptyContent:q}),he=te(()=>new Map,[]),ge=te(()=>e=>{const t={stroke:"black",strokeWidth:1};return t.fill=S?y(e.data||e,S,me.colorScale):w(void 0,me.themeCategorical,C,void 0,he),t},[S,me.colorScale,me.themeCategorical,C,he]),ue=te(()=>h(S,b),[S,b]),fe=te(()=>o(m(ge,T,ue,e=>e.data||e),{stroke:Z,strokeWidth:U,opacity:V}),[ge,T,ue,Z,U,V]),pe=te(()=>X({edgeColorBy:A,colorBy:S,colorScale:me.colorScale,nodeStyleFn:fe,edgeOpacity:L,baseStyle:{stroke:"none",strokeWidth:0}}),[A,S,me.colorScale,fe,L]),be=te(()=>o(pe,{stroke:Z,strokeWidth:U,opacity:V}),[pe,Z,U,V]),ye=te(()=>{if(!se)return;const e=D||k;return"function"==typeof e?e:t=>t.data?.[e]??t[e]??t.id},[se,D,k]),ve=e({componentName:"SankeyDiagram",edges:d,edgesRequired:!0});return ve?ie(N,{componentName:"SankeyDiagram",message:ve,width:ee,height:oe}):me.loadingEl?me.loadingEl:me.emptyEl?me.emptyEl:ie(O,{componentName:"SankeyDiagram",width:ee,height:oe,children:ie(s,{ref:r,chartType:"sankey",...me.safeNodes.length>0&&{nodes:me.safeNodes},...null!=d&&{edges:me.safeEdges},size:[ee,oe],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:me.margin,nodeIDAccessor:k,sourceAccessor:f,targetAccessor:p,valueAccessor:b,orientation:M,nodeAlign:H,nodePaddingRatio:x,nodeWidth:B,nodeStyle:fe,edgeStyle:be,colorBy:S,colorScheme:me.effectivePalette,edgeColorBy:A,edgeOpacity:L,edgeSort:P,nodeLabel:ye,showLabels:se,enableHover:re,tooltipContent:!1===E?()=>null:v(E)||void 0,...c({linkedHover:$,selection:j,onObservation:R,onClick:z,mobileInteraction:me.mobileInteraction,customHoverBehavior:me.customHoverBehavior,customClickBehavior:me.customClickBehavior,linkedHoverInClickPredicate:!1}),legend:me.legend,legendPosition:me.legendPosition,...Q&&"none"!==Q&&{legendHoverBehavior:me.legendState.onLegendHover,legendClickBehavior:me.legendState.onLegendClick,legendHighlightedCategory:me.legendState.highlightedCategory,legendIsolatedCategories:me.legendState.isolatedCategories},className:u,title:ae,description:le,summary:ce,accessibleTable:de,...null!=t.animate&&{animate:t.animate},...W})})});function se(e,t,o){const n=[],i=new Set(e.map(e=>e.id)),r=Array.isArray(o)&&2===o.length,s=r&&Number.isFinite(o[0])&&Number.isFinite(o[1]);r&&s&&s&&o[1]>=o[0]||n.push({kind:"invalid-domain"});for(const t of e)null!=t.xExtent&&(Array.isArray(t.xExtent)&&2===t.xExtent.length&&Number.isFinite(t.xExtent[0])&&Number.isFinite(t.xExtent[1])&&t.xExtent[1]>=t.xExtent[0]||n.push({kind:"invalid-node-time",id:t.id}));for(const e of t)i.has(e.source)||n.push({kind:"missing-node",id:e.id,endpoint:"source",nodeId:e.source}),i.has(e.target)||n.push({kind:"missing-node",id:e.id,endpoint:"target",nodeId:e.target}),Number.isFinite(e.startTime)&&Number.isFinite(e.endTime)?(Number.isFinite(e.value)&&e.value>0||n.push({kind:"invalid-value",id:e.id}),e.endTime>e.startTime||n.push({kind:"backward-edge",id:e.id,source:e.source,target:e.target})):n.push({kind:"invalid-edge-time",id:e.id});return n}function ae(e){return"invalid-node-time"===e.kind?`node ${e.id} has an invalid xExtent (must be [start, end] with start <= end)`:"invalid-edge-time"===e.kind?`edge ${e.id} has an invalid startTime or endTime`:"invalid-domain"===e.kind?"time domain must be a 2-tuple of finite times [start, end] with start <= end":"invalid-value"===e.kind?`edge ${e.id} must have a positive finite value`:"missing-node"===e.kind?`edge ${e.id} references missing ${e.endpoint} node "${e.nodeId}"`:"backward-edge"===e.kind?`edge ${e.id} (${e.source}->${e.target}) ends before it starts`:e.kind}function le(e,t,o){const n=t.incoming[e.id],i=t.outgoing[e.id],r=[];for(const e of n)r.push({time:e.endTime,delta:+e.value,edge:e,kind:"in",side:o.get(e.id).targetSide});for(const e of i)r.push({time:e.startTime,delta:-e.value,edge:e,kind:"out",side:o.get(e.id).sourceSide});const s={create:0,in:1,"transfer-out":2,"transfer-in":3,out:4},a=()=>{r.sort((e,t)=>e.time-t.time||(s[e.kind]??99)-(s[t.kind]??99))},l=r.length?B(r.map(e=>e.time)):null,c=Array.isArray(e.xExtent)&&Number.isFinite(e.xExtent[0])?e.xExtent[0]:null,d=null!=c?c-1:null!=l&&Number.isFinite(l)?l-1:null,m=[...new Set(r.map(e=>e.time))].sort((e,t)=>e-t),h=new Map;for(let e=1;m.length>e;e++)h.set(m[e],m[e-1]);const g=e=>{const t=h.get(e);return null!=t?(t+e)/2:null!=d?d:e};a();const u=[];let f=0,p=0;for(const e of r)if("out"===e.kind){const t=Math.abs(e.delta);let o=t-("top"===e.side?f:p);if(o>0){const t="top"===e.side?"bot":"top",n=Math.min(o,"top"===t?f:p);if(n>0){const i=g(e.time);u.push({time:i,delta:-n,kind:"transfer-out",side:t}),u.push({time:i,delta:+n,kind:"transfer-in",side:e.side}),"top"===t?f-=n:p-=n,"top"===e.side?f+=n:p+=n,o-=n}o>0&&null!==d&&(u.push({time:d,delta:+o,kind:"create",side:e.side}),"top"===e.side?f+=o:p+=o)}"top"===e.side?f-=t:p-=t}else if("in"===e.kind){const t=Math.abs(e.delta);"top"===e.side?f+=t:p+=t}r.push(...u),a();let b=0,y=0,v=0,k=0,S=0;const w=[],C=new Map;for(const e of r){if(w.push({t:e.time,topMass:b,botMass:y}),("in"===e.kind||"out"===e.kind)&&e.edge){const t="top"===e.side?b:y;C.set(e.edge.id,{side:e.side,time:e.time,sideMassBefore:t,sideMassAfter:t+e.delta,kind:e.kind,value:Math.abs(e.delta)})}"top"===e.side?b+=e.delta:y+=e.delta,b+y>v&&(v=b+y),b>k&&(k=b),y>S&&(S=y),w.push({t:e.time,topMass:b,botMass:y})}const T=[];let I=0;for(;w.length>I;){let e=I;for(;w.length>e+1&&w[e+1].t===w[I].t;)e++;T.push(w[I]);for(let t=I+1;e>=t;t++){const e=T[T.length-1];w[t].topMass===e.topMass&&w[t].botMass===e.botMass||T.push(w[t])}I=e+1}const A=Array.isArray(e.xExtent)&&Number.isFinite(e.xExtent[1])?e.xExtent[1]:null;let M=null;for(const e of i)null!=e.systemInTime&&Number.isFinite(e.systemInTime)&&e.startTime>e.systemInTime&&(null===M||M>e.systemInTime)&&(M=e.systemInTime);let H=null;for(const e of n)null!=e.systemOutTime&&Number.isFinite(e.systemOutTime)&&e.systemOutTime>e.endTime&&(null===H||e.systemOutTime>H)&&(H=e.systemOutTime);if(T.length>0){const e=T[T.length-1],t=Math.max(null!=A?A:-1/0,null!=H?H:-1/0);Number.isFinite(t)&&t>e.t&&e.topMass+e.botMass>0&&T.push({t:t,topMass:e.topMass,botMass:e.botMass});const o=T[0],n=Math.min(null!=c?c:1/0,null!=M?M:1/0);Number.isFinite(n)&&o.t>n&&o.topMass+o.botMass>0&&T.unshift({t:n,topMass:o.topMass,botMass:o.botMass})}return{samples:T,peak:v,topPeak:k,botPeak:S,localAttachments:C}}function ce(e,t){return t?Math.max(t[0],Math.min(t[1],e)):e}function de(e,t){return e.map(e=>({t:ce(e.t,t),topMass:e.topMass,botMass:e.botMass}))}function me(e,t,o){const n=e.value*o;if("out"===e.kind){const i=e.sideMassBefore*o;if("top"===e.side){const e=t-i;return[e,e+n]}const r=t+i;return[r-n,r]}const i=e.sideMassAfter*o;if("top"===e.side){const e=t-i;return[e,e+n]}const r=t+i;return[r-n,r]}function he(e,t){let o=0;for(let n=0;t.length>n;n++)for(let i=n+1;t.length>i;i++){const r=t[n],s=t[i];r.source!==s.source&&r.target!==s.target&&r.source!==s.target&&r.target!==s.source&&(Math.min(r.endTime,s.endTime)>Math.max(r.startTime,s.startTime)&&e[s.source]>e[r.source]!=e[s.target]>e[r.target]&&o++)}return o}function ge(e,t){let o=0;for(const n of t)o+=Math.abs(e[n.source]-e[n.target])*(n.value||1);return o}function ue(e,t){return 1e3*he(e,t)+ge(e,t)}function fe(e,t){return{slots:e.map(e=>({peak:{...e.peak},occupants:e.occupants.slice()})),map:{...t}}}function pe(e,t,o){e.length>8||o.length>40?(function(e,t,o,n=6){const i=e.length;if(1>=i)return;let r=fe(e,t),s=ue(t,o);for(let a=0;n>a;a++){const n=Array(i).fill(0),a=Array(i).fill(0);for(const e of o){const o=t[e.source],i=t[e.target];n[o]+=i*(e.value||1),a[o]+=e.value||1,n[i]+=o*(e.value||1),a[i]+=e.value||1}const l=Array.from({length:i},(e,t)=>t).sort((e,t)=>(a[e]>0?n[e]/a[e]:e)-(a[t]>0?n[t]/a[t]:t)),c=l.map(t=>e[t]),d=new Map;l.forEach((e,t)=>d.set(e,t));for(const e of Object.keys(t))t[e]=d.get(t[e]);e.length=0;for(const t of c)e.push(t);const m=ue(t,o);if(s>m)s=m,r=fe(e,t);else if(m===s)break}!function(e,t,o){e.length=0;for(const t of o.slots)e.push(t);for(const e of Object.keys(t))delete t[e];for(const e of Object.keys(o.map))t[e]=o.map[e]}(e,t,r)}(e,t,o,6),function(e,t,o,n=6){const i=e.length;if(1>=i)return;let r=ue(t,o);for(let s=0;n>s;s++){let n=!1;for(let s=0;i-1>s;s++){const i=e[s];e[s]=e[s+1],e[s+1]=i;for(const e of Object.keys(t))t[e]===s?t[e]=s+1:t[e]===s+1&&(t[e]=s);const a=ue(t,o);if(r>a)r=a,n=!0;else{const o=e[s];e[s]=e[s+1],e[s+1]=o;for(const e of Object.keys(t))t[e]===s?t[e]=s+1:t[e]===s+1&&(t[e]=s)}}if(!n)break}}(e,t,o,6)):function(e,t,o){const n=e.length;if(1>=n)return;const i={...t},r=Object.keys(i),s=Array.from({length:n},(e,t)=>t),a=s.slice(),l={...i};let c=s.slice(),d=1/0;const m=()=>{for(const e of r)l[e]=a[i[e]];const e=ue(l,o);d>e&&(d=e,c=s.slice())},h=(e,t)=>{const o=s[e],n=s[t];s[e]=n,s[t]=o,a[o]=t,a[n]=e};m();const g=Array(n).fill(0);let u=0;for(;n>u;)u>g[u]?(h(u%2==0?0:g[u],u),m(),g[u]++,u=0):(g[u]=0,u++);const f=c.map(t=>e[t]),p=new Map;c.forEach((e,t)=>p.set(e,t));for(const e of Object.keys(t))t[e]=p.get(t[e]);e.length=0;for(const t of f)e.push(t)}(e,t,o)}function be(e,t,o,n,i){const{plotH:r,padding:s,valueScale:a,packing:l,laneOrder:c,lifetimeMode:d="full"}=i,m={},h={};for(const t of e)m[t.id]=o[t.id].topPeak||0,h[t.id]=o[t.id].botPeak||0;const g="half"===d,u={};for(const t of e){const e=Array.isArray(t.xExtent)?t.xExtent[0]:null,o=Array.isArray(t.xExtent)?t.xExtent[1]:null;let i=null!=e&&Number.isFinite(e)?e:1/0,r=null!=o&&Number.isFinite(o)?o:-1/0;for(const e of n.outgoing[t.id]){i>e.startTime&&(i=e.startTime),null!=e.systemInTime&&Number.isFinite(e.systemInTime)&&i>e.systemInTime&&(i=e.systemInTime);const t=g?(e.startTime+e.endTime)/2:e.endTime;t>r&&(r=t)}for(const e of n.incoming[t.id]){const t=g?(e.startTime+e.endTime)/2:e.startTime;i>t&&(i=t),e.endTime>r&&(r=e.endTime),null!=e.systemOutTime&&Number.isFinite(e.systemOutTime)&&e.systemOutTime>r&&(r=e.systemOutTime)}u[t.id]={start:Number.isFinite(i)?i:null,end:Number.isFinite(r)?r:null}}const f={},p=[];if("reuse"===l){const o=new Map;for(const t of e)o.set(t.id,0);const i=new Map;for(const t of e)i.set(t.id,0);for(const e of t)i.set(e.target,(i.get(e.target)??0)+1);const r=[];for(const t of e)0===(i.get(t.id)??0)&&r.push(t.id);for(;r.length;){const e=r.shift();for(const t of n.outgoing[e]??[]){const n=(o.get(e)??0)+1;n>(o.get(t.target)??0)&&o.set(t.target,n),i.set(t.target,i.get(t.target)-1),0===i.get(t.target)&&r.push(t.target)}}const s=[...e].filter(e=>null!==u[e.id].start).sort((e,t)=>{const n=o.get(e.id)??0,i=o.get(t.id)??0;return n!==i?n-i:u[e.id].start-u[t.id].start}),a=e.filter(e=>null===u[e.id].start);for(const e of[...s,...a]){const t=u[e.id];let o=-1;for(let e=0;p.length>e;e++){const n=p[e].occupants[p[e].occupants.length-1];if(null===t.start||void 0===n||t.start>=n.end){o=e;break}}-1===o&&(p.push({occupants:[],peak:{topPeak:0,botPeak:0}}),o=p.length-1),p[o].occupants.push({id:e.id,end:t?.end??-1/0}),p[o].peak.topPeak=Math.max(p[o].peak.topPeak,m[e.id]),p[o].peak.botPeak=Math.max(p[o].peak.botPeak,h[e.id]),f[e.id]=o}}else e.forEach((e,t)=>{p.push({occupants:[{id:e.id,end:u[e.id]?.end??-1/0}],peak:{topPeak:m[e.id],botPeak:h[e.id]}}),f[e.id]=t});let b=null,y=null,v=null,k=null;const S=()=>{b=he(f,t),v=ge(f,t)},w=()=>{y=he(f,t),k=ge(f,t)};"crossing-min"===c?(S(),pe(p,f,t),w()):"inside-out"===c?(S(),function(e,t){const o=e.length;if(1>=o)return;const n=e=>e.peak.topPeak+e.peak.botPeak,i=e.map((e,t)=>({slot:e,idx:t})).sort((e,t)=>n(t.slot)-n(e.slot)),r=Array(o),s=Math.floor((o-1)/2);r[s]=i[0].idx;let a=s-1,l=s+1;for(let e=1;i.length>e;e++)e%2==1&&o>l||0>a?r[l++]=i[e].idx:r[a--]=i[e].idx;const c=r.map(t=>e[t]),d=new Map;r.forEach((e,t)=>d.set(e,t));for(const e of Object.keys(t))t[e]=d.get(t[e]);e.length=0;for(const t of c)e.push(t)}(p,f),w()):"crossing-min+inside-out"===c&&(S(),pe(p,f,t),function(e,t,o){const n=e.length;if(1>=n)return;const i=e.map(e=>{return{slot:e,size:(t=e,t.peak.topPeak+t.peak.botPeak)};var t}).sort((e,t)=>t.size-e.size),r=Math.floor((n-1)/2);let s=ue(t,o);for(const{slot:a}of i){const i=e.indexOf(a);if(0>i)continue;const l=r;if(i===l)continue;const c=e[i];e.splice(i,1),e.splice(l,0,c);const d=new Map;for(let e=0;n>e;e++)d.set(e,e);if(l>i){for(let e=i+1;l>=e;e++)d.set(e,e-1);d.set(i,l)}else{for(let e=l;i>e;e++)d.set(e,e+1);d.set(i,l)}for(const e of Object.keys(t))t[e]=d.get(t[e]);const m=ue(t,o);if(m>s){const o=e[l];e.splice(l,1),e.splice(i,0,o);const r=new Map;for(let e=0;n>e;e++)r.set(e,e);if(i>l){for(let e=l+1;i>=e;e++)r.set(e,e-1);r.set(l,i)}else{for(let e=i;l>e;e++)r.set(e,e+1);r.set(l,i)}for(const e of Object.keys(t))t[e]=r.get(t[e])}else s=m}}(p,f,t),w());const C=p.map(e=>{const t=new Map;for(const n of e.occupants){const e=o[n.id];if(e)for(const o of e.samples){const e=t.get(o.t)||{top:0,bot:0};t.set(o.t,{top:Math.max(e.top,o.topMass),bot:Math.max(e.bot,o.botMass)})}}return[...t.entries()].sort((e,t)=>e[0]-t[0])}),T=(e,t)=>{let o={top:0,bot:0};for(const[n,i]of e){if(n>t)break;o=i}return o},I=[];for(let e=0;p.length-1>e;e++){const t=C[e],o=C[e+1],n=new Set([...t.map(e=>e[0]),...o.map(e=>e[0])]);let i=0;for(const e of n){const n=T(t,e),r=T(o,e);n.bot+r.top>i&&(i=n.bot+r.top)}I.push(i)}const A=[];let M=s+(p[0]?.peak.topPeak??0)*a;p.length>0&&A.push(M);for(let e=1;p.length>e;e++)M+=I[e-1]*a+s,A.push(M);if(p.length>0&&(M+=p[p.length-1].peak.botPeak*a+s),M>r){const e=r/M;for(let t=0;A.length>t;t++)A[t]*=e}const H=0===p.length?0:p[0].peak.topPeak+I.reduce((e,t)=>e+t,0)+p[p.length-1].peak.botPeak,x={};for(const t of e)x[t.id]=A[f[t.id]];return{effectiveSlotsHeight:H,centerlines:x,laneLifetime:u,slots:p,slotByNode:f,slotCenter:A,crossingsBefore:b,crossingsAfter:y,lengthBefore:v,lengthAfter:k}}re.displayName="SankeyDiagram";import{useMemo as ye,useState as ve,useRef as ke,useCallback as Se}from"react";import{scaleTime as we}from"d3-scale";import{forwardRef as Ce}from"react";var Te=e=>{const{bands:t=[],ribbons:o=[],showLabels:n=!0}=e.config,i=[];for(const e of o)i.push({type:"bezier",pathD:e.pathD,...e.bezier&&{bezierCache:e.bezier},style:{fill:e.fill,opacity:e.opacity,stroke:"none"},datum:{__kind:"ribbon",data:e.rawDatum,id:e.id}});for(const e of t)if(e.gradientStubs)for(let t=0;e.gradientStubs.length>t;t++){const o=e.gradientStubs[t];i.push({type:"bezier",pathD:o.pathD,interactive:!1,style:{fill:e.fill,fillOpacity:.86,stroke:"none"},_gradient:{x0:o.x0,x1:o.x1,from:o.from,to:o.to},datum:{__kind:"band",data:e.rawDatum,id:`${e.id}__stub${t}`}})}for(const e of t)i.push({type:"bezier",pathD:e.pathD,style:{...e.gradientStubs&&e.gradientStubs.length>0?{fill:"none"}:{fill:e.fill,fillOpacity:.86},stroke:e.stroke??e.fill,strokeWidth:e.strokeWidth??.5},datum:{__kind:"band",data:e.rawDatum,id:e.id}});const r=n?t.map(e=>({x:e.labelX,y:e.labelY,text:e.labelText,anchor:"end",baseline:"middle",fontSize:11,fontWeight:600})):[];return{sceneNodes:t.map(e=>({type:"circle",id:e.id,cx:-1e4,cy:-1e4,r:0,style:{fill:e.fill},datum:{__kind:"band",data:e.rawDatum,id:e.id}})),sceneEdges:i,labels:r}};function Ie(e){return"object"==typeof e&&null!==e&&"__kind"in e&&("band"===e.__kind||"ribbon"===e.__kind)}import{Fragment as Ae,jsx as Me,jsxs as He}from"react/jsx-runtime";function xe(e){return null==e?NaN:e instanceof Date?e.getTime():"number"==typeof e?e:new Date(e).getTime()}function Be(e,t){return"function"==typeof e?e(t):t[e]}var Ne=Ce(function(e,t){const{nodes:o,edges:n,domain:r,axisTicks:l=[],nodeIdAccessor:c="id",sourceAccessor:d="source",targetAccessor:m="target",valueAccessor:h="value",startTimeAccessor:g="startTime",endTimeAccessor:u="endTime",systemInTimeAccessor:f,systemOutTimeAccessor:p,xExtentAccessor:k="xExtent",edgeIdAccessor:S="id",colorBy:w,colorScheme:C,showLegend:T,legendPosition:I="right",pairing:A="temporal",packing:M="reuse",laneOrder:H="crossing-min",ribbonLane:x="both",lifetimeMode:B="half",showLaneRails:N=!1,showQualityReadout:O=!1,showLabels:D=!0,width:L=600,height:P=400,margin:E,title:W,description:R,summary:z,accessibleTable:F,responsiveWidth:j,responsiveHeight:$,loading:_,loadingContent:q,emptyContent:X,edgeOpacity:Y=.35,timeFormat:K,valueFormat:Q,tooltip:Z,enableHover:U=!0,onObservation:V,onClick:ee,showParticles:te=!1,particleStyle:oe,chartId:ne,frameProps:ie={}}=e,[re,he]=ve([]),[ge,ue]=ve([]),fe=ke(re),pe=ke(ge);fe.current=re,pe.current=ge;const Ce=Se(e=>{fe.current=e,he(e)},[]),Ne=Se(e=>{pe.current=e,ue(e)},[]),Oe=void 0!==n,De=b(Oe?n:re),Le=ye(()=>{const e=b(o??[]),t=ge;if(0===e.length&&0===t.length)return G([],De,d,m);const n=new Set,i=[];for(const t of e){const e=Be(c,t)+"";n.has(e)||(n.add(e),i.push(t))}for(const e of t){const t=Be(c,e)+"";n.has(t)||(n.add(t),i.push(e))}const r=G([],De,d,m);for(const e of r)n.has(e.id)||(n.add(e.id),i.push(e));return i},[o,ge,De,c,d,m]),Pe=ke(null),Ee=Se((e,t)=>{const o=Be(S,e);return null!=o?o+"":`${Be(d,e)}-${Be(m,e)}-${t}`},[S,d,m]),We=Se(e=>{if(null==e)return!1;const t=e;return null!=Be(d,t)&&null!=Be(m,t)},[d,m]);i(t,{variant:"network",frameRef:Pe,overrides:{push(e){if(We(e)){if(Oe)return void console.warn("ProcessSankey.push: edge ignored — `edges` prop is controlled.");Ce([...fe.current,e])}else Ne([...pe.current,e])},pushMany(e){const t=[],o=[];for(const n of e)We(n)?t.push(n):o.push(n);t.length>0&&(Oe?console.warn("ProcessSankey.pushMany: edges ignored — `edges` prop is controlled."):Ce([...fe.current,...t])),o.length>0&&Ne([...pe.current,...o])},remove(e){const t=new Set(Array.isArray(e)?e:[e]),o=[];if(!Oe){const e=fe.current,n=[];for(let i=0;e.length>i;i++){const r=e[i];t.has(Ee(r,i))?o.push(r):n.push(r)}n.length!==e.length&&Ce(n)}const n=pe.current,i=[];for(const e of n){const n=Be(c,e)+"";t.has(n)?o.push(e):i.push(e)}return i.length!==n.length&&Ne(i),o},update(e,t){const o=new Set(Array.isArray(e)?e:[e]),n=[];if(!Oe){let e=!1;const i=fe.current.map((i,r)=>o.has(Ee(i,r))?(n.push(i),e=!0,t(i)):i);e&&Ce(i)}let i=!1;const r=pe.current.map(e=>{const r=Be(c,e)+"";return o.has(r)?(n.push(e),i=!0,t(e)):e});return i&&Ne(r),n},clear(){Oe||Ce([]),Ne([]),Pe.current?.clear()},getData:()=>De??[],getScales:()=>null}});const Re=Ee,ze=Se(e=>Be(c,e)+"",[c]),{nodes:Fe,edges:je,domain:$e,rawNodeById:_e,rawEdgeById:Ge}=ye(()=>{const e=(Le??[]).map(e=>{const t={id:ze(e),__raw:e},o=k?Be(k,e):null;if(Array.isArray(o)&&2===o.length){const e=xe(o[0]),n=xe(o[1]);Number.isFinite(e)&&Number.isFinite(n)&&(t.xExtent=[e,n])}return t}),t=(De??[]).map((e,t)=>{const o={id:Re(e,t),source:Be(d,e)+"",target:Be(m,e)+"",value:Number(Be(h,e)),startTime:xe(Be(g,e)),endTime:xe(Be(u,e)),__raw:e};if(f){const t=xe(Be(f,e));Number.isFinite(t)&&(o.systemInTime=t)}if(p){const t=xe(Be(p,e));Number.isFinite(t)&&(o.systemOutTime=t)}return o}),o=[xe(r[0]),xe(r[1])],n=new Map;for(const t of e)null!=t.__raw&&n.set(t.id,t.__raw);const i=new Map;for(const e of t)null!=e.__raw&&i.set(e.id,e.__raw);return{nodes:e,edges:t,domain:o,rawNodeById:n,rawEdgeById:i}},[Le,De,r,ze,Re,k,d,m,h,g,u,f,p]),qe=J({nodes:Le,edges:De,inferNodes:!1,nodeIdAccessor:c,sourceAccessor:d,targetAccessor:m,colorBy:w,colorScheme:C,showLegend:!1,legendPosition:I,selection:void 0,linkedHover:void 0,onObservation:V,onClick:ee,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"ProcessSankey",chartId:ne,marginDefaults:{top:30,right:80,bottom:40,left:80},userMargin:E,width:L,height:P,loading:_,loadingContent:q,emptyContent:X}),Xe=(T??!!w)&&!!w,Je=Se(e=>null!=E&&("number"==typeof E||null!=E[e]),[E]),Ye=ye(()=>{const e={...qe.margin};return Xe&&("right"===I&&!Je("right")&&140>e.right?e.right=140:"bottom"===I&&!Je("bottom")&&80>e.bottom&&(e.bottom=80)),e},[qe.margin,Xe,I,Je]),Ke=L-Ye.left-Ye.right,Qe=P-Ye.top-Ye.bottom,Ze=ye(()=>se(Fe,je,$e),[Fe,je,$e]),Ue=ye(()=>Ze.length>0?null:function(e,t,o){const{plotH:n,pairing:i="temporal",packing:r="reuse",laneOrder:s="crossing-min",lifetimeMode:a="half"}=o,l=function(e,t){const o={},n={};for(const t of e)o[t.id]=[],n[t.id]=[];for(const e of t)n[e.source]&&n[e.source].push(e),o[e.target]&&o[e.target].push(e);return{incoming:o,outgoing:n}}(e,t),c=function(e,t,o,n="value"){const i="temporal"===n?(e,t)=>e.endTime-t.endTime:(e,t)=>t.value-e.value,r="temporal"===n?(e,t)=>e.startTime-t.startTime:(e,t)=>t.value-e.value,s=new Map;for(const e of t)s.set(e.id,{});const a=(e,t)=>{const o=new Map;for(const n of e){const e=n[t];o.has(e)||o.set(e,{partner:e,edges:[],total:0,earliestStart:1/0,latestEnd:-1/0});const i=o.get(e);i.edges.push(n),i.total+=n.value,i.earliestStart=Math.min(i.earliestStart,n.startTime),i.latestEnd=Math.max(i.latestEnd,n.endTime)}const s=[...o.values()];s.sort("temporal"===n?(e,o)=>"target"===t?e.earliestStart-o.earliestStart:e.latestEnd-o.latestEnd:(e,t)=>t.total-e.total);for(const e of s)e.edges.sort("target"===t?r:i);return s};for(const t of e){const e=o.outgoing[t.id],n=o.incoming[t.id];if(0===n.length)a(e,"target").forEach((e,t)=>{const o=t%2==0?"top":"bot";for(const t of e.edges)s.get(t.id).sourceSide=o});else if(0===e.length)a(n,"source").forEach((e,t)=>{const o=t%2==0?"top":"bot";for(const t of e.edges)s.get(t.id).targetSide=o});else{const t=a(n,"source"),o=a(e,"target"),i=Math.max(t.length,o.length);for(let e=0;i>e;e++){const n=e%2==0?"top":"bot";if(t[e])for(const o of t[e].edges)s.get(o.id).targetSide=n;if(o[e])for(const t of o[e].edges)s.get(t.id).sourceSide=n}}}return s}(e,t,l,i);let d={};for(const t of e)d[t.id]=le(t,l,c);const m=be(e,t,d,l,{plotH:n,padding:12,valueScale:1,packing:r,laneOrder:s,lifetimeMode:a}),h=new Set;for(const e of t){const t=m.slotByNode[e.source],o=m.slotByNode[e.target];if(void 0===t||void 0===o)continue;const n=c.get(e.id);t!==o?t>o?(n.sourceSide="top",n.targetSide="bot"):(n.sourceSide="bot",n.targetSide="top"):(h.add(e.id),n.sourceSide="bot",n.targetSide="bot")}for(const t of e){const e=l.outgoing[t.id],o=l.incoming[t.id],n=new Set(e.map(e=>c.get(e.id).sourceSide)),i=new Set(o.map(e=>c.get(e.id).targetSide));if(1===n.size&&o.length>0){const e=[...n][0];for(const t of o)m.slotByNode[t.source]===m.slotByNode[t.target]&&(c.get(t.id).targetSide=e)}if(1===i.size&&e.length>0){const t=[...i][0];for(const o of e)m.slotByNode[o.source]===m.slotByNode[o.target]&&(c.get(o.id).sourceSide=t)}}for(const t of e){const e=l.incoming[t.id],o=l.outgoing[t.id];if(0===e.length||0===o.length)continue;const n=()=>{const t={inTop:0,inBot:0,outTop:0,outBot:0};for(const o of e)"top"===c.get(o.id).targetSide?t.inTop+=o.value:t.inBot+=o.value;for(const e of o)"top"===c.get(e.id).sourceSide?t.outTop+=e.value:t.outBot+=e.value;return t},i=(e,t)=>{const i=n(),r="top"===e?i.outTop-i.inTop:i.outBot-i.inBot,s="top"===t?i.inTop-i.outTop:i.inBot-i.outBot;if(0>=r||0>=s)return!1;const a=Math.min(r,s),l=o.filter(t=>!h.has(t.id)&&c.get(t.id).sourceSide===e&&a>=t.value).sort((e,t)=>t.value-e.value);return 0!==l.length&&(c.get(l[0].id).sourceSide=t,!0)};let r=o.length+1;for(;r-- >0&&(i("top","bot")||i("bot","top")););}d={};for(const t of e)d[t.id]=le(t,l,c);const g=be(e,t,d,l,{plotH:n,padding:12,valueScale:1,packing:r,laneOrder:s,lifetimeMode:a}),u=g.effectiveSlotsHeight??g.slots.reduce((e,t)=>e+t.peak.topPeak+t.peak.botPeak,0),f=Math.min(12,.35*n/Math.max(g.slots.length+1,1)),p=u>0?Math.max(0,(n-f*(g.slots.length+1))/u):1,b=be(e,t,d,l,{plotH:n,padding:f,valueScale:p,packing:r,laneOrder:s,lifetimeMode:a});return{nodeData:d,sides:c,valueScale:p,padding:f,compressedPadding:12>f,centerlines:b.centerlines,laneLifetime:b.laneLifetime,slots:b.slots,slotByNode:b.slotByNode,crossingsBefore:b.crossingsBefore,crossingsAfter:b.crossingsAfter,lengthBefore:b.lengthBefore,lengthAfter:b.lengthAfter}}(Fe,je,{plotH:Qe,pairing:A,packing:M,laneOrder:H,lifetimeMode:B}),[Ze,Fe,je,Qe,A,M,H,B]),Ve=ye(()=>we().domain($e).range([0,Ke]),[$e,Ke]),et=Se((e,t)=>{if(w&&Le){const t=_e.get(e);if(t)return y(t,w,qe.colorScale)}return qe.effectivePalette[t%qe.effectivePalette.length]||"#475569"},[w,Le,_e,qe.colorScale,qe.effectivePalette]),tt=ye(()=>{const e=new Map;return Fe.forEach((t,o)=>e.set(t.id,o)),e},[Fe]),ot=ye(()=>{if(!Ue)return{bands:[],ribbons:[]};const{centerlines:e,nodeData:t,valueScale:o}=Ue,n=[],i=[];return Fe.forEach((i,r)=>{const s=t[i.id];if(!s||0===s.samples.length)return;const a=function(e,t,o,n,i){if(0===e.length)return null;const r=de(e,i),s=e=>t-r[e].topMass*o,a=e=>t+r[e].botMass*o;let l=`M${n(r[0].t)},${s(0)}`;for(let e=1;r.length>e;e++)l+=` L${n(r[e].t)},${s(e)}`;l+=` L${n(r[r.length-1].t)},${a(r.length-1)}`;for(let e=r.length-2;e>=0;e--)l+=` L${n(r[e].t)},${a(e)}`;return l+" Z"}(s.samples,e[i.id],o,Ve,$e);if(!a)return;const l=de(s.samples,$e),c=l.find(e=>e.topMass+e.botMass>0)||l[0],d=e[i.id]+(c.botMass-c.topMass)*o/2,m=et(i.id,r),h=_e.get(i.id)??i,g=function(e,t,o,n,i){const r=o.nodeData[e];if(!r||0===r.samples.length)return[];const s=o.valueScale,a=o.centerlines[e],l=de(r.samples,i),c=l.find(e=>e.topMass+e.botMass>0)||l[0],d=[...l].reverse().find(e=>e.topMass+e.botMass>0)||l[l.length-1],m=n(c.t),h=n(d.t),g=e=>n(ce(e,i)),u=[],f=(e,t,o,n)=>`M${e},${t} L${o},${t} L${o},${n} L${e},${n} Z`;for(const o of t){if(o.source===e&&null!=o.systemInTime&&Number.isFinite(o.systemInTime)){const e=r.localAttachments.get(o.id);if(e&&"out"===e.kind&&o.startTime>o.systemInTime){const t=g(o.systemInTime),n=g(o.startTime),i=t-20,r=Math.max(m,i);if(n>r){const[o,l]=me(e,a,s);u.push({pathD:f(r,o,n,l),x0:i,x1:t,from:0,to:1})}}}if(o.target===e&&null!=o.systemOutTime&&Number.isFinite(o.systemOutTime)){const e=r.localAttachments.get(o.id);if(e&&"in"===e.kind&&o.systemOutTime>o.endTime){const t=g(o.systemOutTime),n=g(o.endTime),i=t+20,r=Math.min(h,i);if(r>n){const[o,l]=me(e,a,s);u.push({pathD:f(n,o,r,l),x0:t,x1:i,from:1,to:0})}}}}return u}(i.id,je,Ue,Ve,$e);n.push({id:i.id,pathD:a,fill:m,stroke:m,strokeWidth:.5,...g.length>0&&{gradientStubs:g},rawDatum:h,labelX:Ve(c.t)-4,labelY:d,labelText:i.id})}),je.forEach(n=>{const r=t[n.source]?.localAttachments.get(n.id),s=t[n.target]?.localAttachments.get(n.id);if(!r||!s)return;const l=tt.get(n.source)??0,c=et(n.source,l),d=function(e,t,o,n,i,r,s,a){const l=i,c=e=>a?Math.max(a[0],Math.min(a[1],e)):e,d=r(c(e.time)),m=r(c(o.time)),h=e.value*l,g=o.value*l,u=e.sideMassBefore*l,f=o.sideMassAfter*l;let p,b,y,v;"top"===e.side?(p=t-u,b=p+h):(b=t+u,p=b-h),"top"===o.side?(y=n-f,v=y+g):(v=n+f,y=v-g);const k="source"===s?d+.85*(m-d):"target"===s?d+.15*(m-d):(d+m)/2;return{sx:d,sTop:p,sBot:b,tx:m,tTop:y,tBot:v,cp1X:k,cp2X:k}}(r,e[n.source],s,e[n.target],o,Ve,x,$e),{pathD:m,bezier:h}=a(d),g=Ge.get(n.id)??n;i.push({id:n.id,pathD:m,fill:c,opacity:Y,rawDatum:g,bezier:h})}),{bands:n,ribbons:i}},[Ue,Fe,je,Ve,$e,et,_e,Ge,x,Y,tt]),nt=ye(()=>({bands:ot.bands,ribbons:ot.ribbons,showLabels:D}),[ot,D]),it=ye(()=>{if(!Xe||!w)return;const e=new Map;(Le??[]).forEach((t,o)=>{const n=Be(w,t),i=null==n?"":n+"";i&&!e.has(i)&&e.set(i,{label:i,color:et(ze(t),o)})});const t=Array.from(e.values());return 0!==t.length?{legendGroups:[{type:"fill",label:"",items:t,styleFn:e=>{const t=e.color||"#333";return{fill:t,stroke:t}}}]}:void 0},[Xe,w,Le,et,ze]),rt=ye(()=>!1!==Z&&U?void 0===Z||!0===Z?null:v(Z)||null:null,[Z,U]),st=Se(e=>K?K(new Date(e)):Number.isFinite(e)?1e10>Math.abs(e)?Number.isInteger(e)?e+"":e.toFixed(2):new Date(e).toISOString().slice(0,10):"",[K]),at=Se(e=>Q?Q(e):e+"",[Q]),lt=Se(e=>{if(!e||!e.data)return null;const t=e.data;if(!Ie(t))return null;const o=t.data;if(rt)return rt(o);if("band"===t.__kind){const e=t.id,o=Ue?function(e){if(!e)return[];const t=new Set,o=[];for(const n of e.samples){const e=n.topMass+n.botMass,i=`${n.t}:${e}`;t.has(i)||(t.add(i),o.push({t:n.t,total:e}))}return o}(Ue.nodeData[e]):[],n=5,i=o.length>n?o.length:null,r=function(e,t=5){if(t>=e.length)return e.slice();const o=[...e].sort((e,t)=>e.total-t.total),n=o.length-1,i=[{...o[0],mark:"min"},{...o[Math.floor(.25*n)],mark:"q25"},{...o[Math.floor(.5*n)],mark:"median"},{...o[Math.floor(.75*n)],mark:"q75"},{...o[n],mark:"max"}],r=new Set,s=[];for(const e of i)r.has(e.t)||(r.add(e.t),s.push(e));return s.sort((e,t)=>e.t-t.t)}(o,n);return He("div",{style:{minWidth:160},children:[Me("div",{style:{fontWeight:600,marginBottom:4},children:e}),r.length>0&&He("table",{style:{borderCollapse:"collapse",fontSize:11,width:"100%"},children:[Me("thead",{children:He("tr",{style:{opacity:.6},children:[Me("th",{style:{textAlign:"left",fontWeight:500,paddingRight:8},children:"Time"}),Me("th",{style:{textAlign:"right",fontWeight:500},children:"Mass"}),null!=i&&Me("th",{})]})}),Me("tbody",{children:r.map((e,t)=>He("tr",{children:[Me("td",{style:{paddingRight:8},children:st(e.t)}),Me("td",{style:{textAlign:"right"},children:at(e.total)}),null!=i&&Me("td",{style:{textAlign:"right",paddingLeft:8,opacity:.55},children:e.mark})]},t))})]}),null!=i&&He("div",{style:{marginTop:4,fontSize:10,opacity:.55},children:["showing ",r.length," of ",i," samples"]})]})}const n=o,i=Be(d,n),r=Be(m,n),s=Be(h,n),a=Be(g,n),l=Be(u,n);return He("div",{style:{minWidth:160},children:[He("div",{style:{fontWeight:600,marginBottom:4},children:[i+""," → ",r+""]}),He("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:8,fontSize:11},children:[null!=s&&He(Ae,{children:[Me("span",{style:{opacity:.6},children:"value"}),Me("span",{style:{textAlign:"right"},children:at(Number(s))})]}),null!=a&&He(Ae,{children:[Me("span",{style:{opacity:.6},children:"start"}),Me("span",{style:{textAlign:"right"},children:st(xe(a))})]}),null!=l&&He(Ae,{children:[Me("span",{style:{opacity:.6},children:"end"}),Me("span",{style:{textAlign:"right"},children:st(xe(l))})]})]})]})},[Ue,rt,st,at,d,m,h,g,u]),ct=ye(()=>{if(!Ue)return null;const{centerlines:e,laneLifetime:t,nodeData:o,valueScale:n,compressedPadding:i,crossingsBefore:r,crossingsAfter:s,lengthBefore:a,lengthAfter:c}=Ue;let d=null,m=null;for(const e of Fe){const o=t[e.id];if(!o||null===o.start||null===o.end)continue;const n=Ve(o.start),i=Ve(o.end);(null===d||d>n)&&(d=n),(null===m||i>m)&&(m=i)}const h=e=>Math.max(0,Math.min(Ke,e)),g=h(d??0),u=Math.max(g,h(m??Ke));return He("g",{children:[O&&null!==(s??null)&&He("text",{x:Ke,y:-12,fontSize:10,fill:"#94a3b8",textAnchor:"end",children:["crossings: ",r," → ",s," ","edge length: ",Math.round(a)," → ",Math.round(c)]}),i&&Me("text",{x:Ke,y:2,fontSize:10,fill:"#94a3b8",textAnchor:"end",children:"dense layout: lane gaps compressed"}),l.map((e,t)=>{const o=Ve(xe(e.date));return g-.5>o||o>u+.5?null:Me("line",{x1:o,y1:0,x2:o,y2:Qe,stroke:"#94a3b8",strokeOpacity:.15,strokeDasharray:"2 4"},"grid-"+t)}),N&&Fe.map((i,r)=>{const s=t[i.id];if(!s||null===s.start)return null;const a=o[i.id],l=a?{topPeak:a.topPeak,botPeak:a.botPeak}:{topPeak:0,botPeak:0},c=e[i.id]+(l.botPeak-l.topPeak)*n/2,d=Ve(s.start),m=Ve(s.end),h=et(i.id,r);return He("g",{children:[Me("line",{x1:d,y1:c,x2:m,y2:c,stroke:h,strokeOpacity:.35,strokeWidth:1,strokeDasharray:"3 3"}),Me("line",{x1:d,y1:c-4,x2:d,y2:c+4,stroke:h,strokeOpacity:.5}),Me("line",{x1:m,y1:c-4,x2:m,y2:c+4,stroke:h,strokeOpacity:.5})]},"lane-"+i.id)}),Me("line",{x1:g,y1:Qe+4,x2:u,y2:Qe+4,stroke:"#94a3b8"}),l.map((e,t)=>{const o=xe(e.date),n=Ve(o);if(g-.5>n||n>u+.5)return null;const i=null!=e.label?e.label:K?K(new Date(o)):"";return He("g",{transform:`translate(${n},${Qe+4})`,children:[Me("line",{y2:6,stroke:"#94a3b8"}),Me("text",{y:20,textAnchor:"middle",fontSize:11,fill:"#475569",children:i})]},t)})]})},[Ue,l,Ve,Ke,Qe,N,Fe,et,O,K]),dt=ye(()=>(Le??[]).map(e=>({id:ze(e),data:e})),[Le,ze]),mt=ye(()=>{const e=new Map;for(const t of ot.ribbons)t.bezier&&e.set(t.id,t.bezier);return e},[ot]),ht=ye(()=>(De??[]).map((e,t)=>{const o=Re(e,t),n=Number(Be(h,e));return{id:o,source:Be(d,e)+"",target:Be(m,e)+"",value:Number.isFinite(n)?n:0,bezier:mt.get(o),data:e}}),[De,Re,d,m,h,mt]),gt=qe.loadingEl,ut=qe.emptyEl;return Ze.length>0?He("svg",{width:L,height:P,role:"img","aria-label":W??"Process Sankey validation failed",children:[Me("text",{x:20,y:30,fontSize:13,fontWeight:600,fill:"var(--semiotic-danger, #dc2626)",children:"ProcessSankey: data invalid"}),Ze.map((e,t)=>Me("text",{x:20,y:56+18*t,fontSize:12,fill:"#64748b",children:"• "+ae(e)},t))]}):gt||ut||Me(s,{ref:Pe,chartType:"force",nodes:dt,edges:ht,customNetworkLayout:Te,layoutConfig:nt,size:[L,P],responsiveWidth:j,responsiveHeight:$,margin:Ye,title:W,description:R??"Temporal process flow with lifetime-bounded node lanes, mass bands, and value-scaled ribbons.",summary:z,accessibleTable:F,enableHover:U,tooltipContent:!1===Z?()=>null:lt,backgroundGraphics:ct,showParticles:te,particleStyle:oe,legend:it,legendPosition:I,onObservation:V,...ee&&{customClickBehavior:e=>{if(!e||!e.data||!ee)return;const t=e.data;Ie(t)&&ee(t.data,{x:e.x,y:e.y})}},chartId:ne,colorScheme:Array.isArray(C)?C:void 0,...ie})});Ne.displayName="ProcessSankey";import{useMemo as Oe}from"react";import{jsx as De}from"react/jsx-runtime";function Le(e){const n=I(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLabels:e.showLabels,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:600,height:600}),{data:i,margin:r,className:a,layout:l="tree",orientation:d="vertical",childrenAccessor:m="children",valueAccessor:h="value",nodeIdAccessor:g="name",colorBy:u,colorScheme:f,colorByDepth:b=!1,edgeStyle:k="curve",nodeLabel:S,nodeSize:C=5,tooltip:T,frameProps:A={},onObservation:M,onClick:H,chartId:x,selection:B,linkedHover:D,loading:L,loadingContent:P,legendInteraction:E,stroke:W,strokeWidth:R,opacity:z}=e,{width:F,height:j,enableHover:$,showLabels:G=!0,title:X,description:Y,summary:K,accessibleTable:Q}=n,Z=J({nodes:Oe(()=>_(i??null,m),[i,m]),edges:void 0,inferNodes:!1,colorBy:b?void 0:u,colorScheme:f,showLegend:!1,legendInteraction:E,selection:B,linkedHover:D,onObservation:M,onClick:H,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"TreeDiagram",chartId:x,marginDefaults:n.marginDefaults,userMargin:r,width:F,height:j,loading:L,loadingContent:P}),U=Oe(()=>new Map,[]),V=Oe(()=>e=>{const t={stroke:"black",strokeWidth:1};return t.fill=b?p[(e.depth||0)%p.length]:u?y(e.data||e,u,Z.colorScale):w(void 0,Z.themeCategorical,f,void 0,U),t},[u,b,Z.colorScale,Z.themeCategorical,f,U]),ee=Oe(()=>o(V,{stroke:W,strokeWidth:R,opacity:z}),[V,W,R,z]),te=Oe(()=>()=>({stroke:"#999",strokeWidth:1,fill:"none"}),[]),oe=Oe(()=>o(te,{stroke:W,strokeWidth:R,opacity:z}),[te,W,R,z]),ne=Oe(()=>{if("treemap"===l||"circlepack"===l||"partition"===l)return q(h)},[l,h]),ie=t({componentName:"TreeDiagram",data:i});return ie?De(N,{componentName:"TreeDiagram",message:ie,width:F,height:j}):Z.loadingEl?Z.loadingEl:De(O,{componentName:"TreeDiagram",width:F,height:j,children:De(s,{chartType:l,...null!=i&&{data:i},size:[F,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,nodeIDAccessor:g,childrenAccessor:m,hierarchySum:ne,treeOrientation:d,edgeType:k,nodeStyle:ee,edgeStyle:oe,colorBy:u,colorScheme:Z.effectivePalette,colorByDepth:b,nodeSize:C,nodeLabel:G?S||g:void 0,showLabels:G,enableHover:$,tooltipContent:!1===T?()=>null:v(T)||void 0,...c({linkedHover:D,selection:B,onObservation:M,onClick:H,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior,linkedHoverInClickPredicate:!1}),...E&&"none"!==E&&{legendHoverBehavior:Z.legendState.onLegendHover,legendClickBehavior:Z.legendState.onLegendClick,legendHighlightedCategory:Z.legendState.highlightedCategory,legendIsolatedCategories:Z.legendState.isolatedCategories},className:a,title:X,description:Y,summary:K,accessibleTable:Q,...null!=e.animate&&{animate:e.animate},...A})})}Le.displayName="TreeDiagram";import{useMemo as Pe,useCallback as Ee}from"react";import{jsx as We}from"react/jsx-runtime";function Re(e){const n=I(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLabels:e.showLabels,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:600,height:600}),{data:i,margin:a,className:l,childrenAccessor:d="children",valueAccessor:m="value",nodeIdAccessor:h="name",colorBy:g,colorScheme:u,colorByDepth:b=!1,labelMode:k="leaf",nodeLabel:S,padding:C=4,paddingTop:T,nodeStyle:A,tooltip:M,frameProps:H={},selection:x,linkedHover:B,onObservation:D,onClick:L,chartId:P,loading:E,loadingContent:W,legendInteraction:R,stroke:z,strokeWidth:F,opacity:j}=e,{nodeStyle:$,...G}=H,{width:X,height:Y,enableHover:K,showLabels:Q=!0,title:Z,description:U,summary:V,accessibleTable:ee}=n,te=J({nodes:Pe(()=>_(i??null,d),[i,d]),edges:void 0,inferNodes:!1,colorBy:b?void 0:g,colorScheme:u,showLegend:!1,legendInteraction:R,selection:x,linkedHover:B,onObservation:D,onClick:L,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"Treemap",chartId:P,marginDefaults:n.marginDefaults,userMargin:a,width:X,height:Y,loading:E,loadingContent:W}),oe=r(x),ne=te.customHoverBehavior,ie=Ee(e=>{if(!e)return ne(null);const t=e.data||e;ne({data:t?.data||t})},[ne]),re=Pe(()=>new Map,[]),se=Pe(()=>e=>{const t={stroke:"var(--semiotic-cell-border, var(--semiotic-border, #fff))",strokeWidth:1,strokeOpacity:.8};return t.fill=b?p[(e.depth||0)%p.length]:g?y(e.data||e,g,te.colorScale):w(void 0,te.themeCategorical,u,void 0,re),t},[g,b,te.colorScale,te.themeCategorical,u,re]),ae=Pe(()=>A||$?e=>({...se(e),...$?$(e)??{}:{},...A?A(e)??{}:{}}):se,[se,A,$]),le=Pe(()=>o(ae,{stroke:z,strokeWidth:F,opacity:j}),[ae,z,F,j]),ce=Pe(()=>te.activeSelectionHook?e=>{const t={...le(e)};if(te.activeSelectionHook.isActive)if(te.activeSelectionHook.predicate(e.data||e))oe?.selectedStyle&&Object.assign(t,oe.selectedStyle);else{const e=oe?.unselectedOpacity??f;t.opacity=e,t.fillOpacity=e,t.strokeOpacity=e,oe?.unselectedStyle&&Object.assign(t,oe.unselectedStyle)}return t}:le,[le,te.activeSelectionHook,oe]),de=Pe(()=>q(m),[m]),me=void 0!==T?T:!Q||"parent"!==k&&"all"!==k?void 0:18,he=t({componentName:"Treemap",data:i});return he?We(N,{componentName:"Treemap",message:he,width:X,height:Y}):te.loadingEl?te.loadingEl:We(O,{componentName:"Treemap",width:X,height:Y,children:We(s,{chartType:"treemap",...null!=i&&{data:i},size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,nodeIDAccessor:h,childrenAccessor:d,hierarchySum:de,padding:C,paddingTop:me,nodeStyle:ce,colorBy:g,colorScheme:te.effectivePalette,colorByDepth:b,nodeLabel:Q?S||h:void 0,showLabels:Q,labelMode:k,enableHover:K,tooltipContent:!1===M?()=>null:v(M)||void 0,...c({linkedHover:B,selection:x,onObservation:D,onClick:L,mobileInteraction:te.mobileInteraction,customHoverBehavior:ie,customClickBehavior:te.customClickBehavior,linkedHoverInClickPredicate:!1}),...R&&"none"!==R&&{legendHoverBehavior:te.legendState.onLegendHover,legendClickBehavior:te.legendState.onLegendClick,legendHighlightedCategory:te.legendState.highlightedCategory,legendIsolatedCategories:te.legendState.isolatedCategories},className:l,title:Z,description:U,summary:V,accessibleTable:ee,...null!=e.animate&&{animate:e.animate},...G})})}Re.displayName="Treemap";import{useMemo as ze}from"react";import{jsx as Fe}from"react/jsx-runtime";function je(e){const n=I(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLabels:e.showLabels,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:600,height:600}),{data:i,margin:r,className:a,childrenAccessor:l="children",valueAccessor:d="value",nodeIdAccessor:m="name",colorBy:h,colorScheme:g,colorByDepth:u=!1,nodeLabel:f,circleOpacity:b=.7,padding:k=4,tooltip:S,frameProps:C={},onObservation:T,onClick:A,chartId:M,selection:H,linkedHover:x,loading:B,loadingContent:D,legendInteraction:L,stroke:P,strokeWidth:E,opacity:W}=e,{width:R,height:z,enableHover:F,showLabels:j=!0,title:$,description:G,summary:X,accessibleTable:Y}=n,K=J({nodes:ze(()=>_(i??null,l),[i,l]),edges:void 0,inferNodes:!1,colorBy:u?void 0:h,colorScheme:g,showLegend:!1,legendInteraction:L,selection:H,linkedHover:x,onObservation:T,onClick:A,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"CirclePack",chartId:M,marginDefaults:n.marginDefaults,userMargin:r,width:R,height:z,loading:B,loadingContent:D}),Q=ze(()=>new Map,[]),Z=ze(()=>e=>{const t={stroke:"currentColor",strokeWidth:1,strokeOpacity:.3,fillOpacity:b};return t.fill=u?p[(e.depth||0)%p.length]:h?y(e.data||e,h,K.colorScale):w(void 0,K.themeCategorical,g,void 0,Q),t},[h,u,K.colorScale,b,K.themeCategorical,g,Q]),U=ze(()=>o(Z,{stroke:P,strokeWidth:E,opacity:W}),[Z,P,E,W]),V=ze(()=>q(d),[d]),ee=t({componentName:"CirclePack",data:i});return ee?Fe(N,{componentName:"CirclePack",message:ee,width:R,height:z}):K.loadingEl?K.loadingEl:Fe(O,{componentName:"CirclePack",width:R,height:z,children:Fe(s,{chartType:"circlepack",...null!=i&&{data:i},size:[R,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:K.margin,nodeIDAccessor:m,childrenAccessor:l,hierarchySum:V,padding:k,nodeStyle:U,colorBy:h,colorScheme:K.effectivePalette,colorByDepth:u,nodeLabel:j?f||m:void 0,showLabels:j,enableHover:F,tooltipContent:!1===S?()=>null:v(S)||void 0,...c({linkedHover:x,selection:H,onObservation:T,onClick:A,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior,linkedHoverInClickPredicate:!1}),...L&&"none"!==L&&{legendHoverBehavior:K.legendState.onLegendHover,legendClickBehavior:K.legendState.onLegendClick,legendHighlightedCategory:K.legendState.highlightedCategory,legendIsolatedCategories:K.legendState.isolatedCategories},className:a,title:$,description:G,summary:X,accessibleTable:Y,...null!=e.animate&&{animate:e.animate},...C})})}je.displayName="CirclePack";import{useMemo as $e}from"react";import{jsx as _e}from"react/jsx-runtime";var Ge=p;function qe(e){const n=I(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLabels:e.showLabels,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:600,height:600}),{data:i,margin:r,className:a,childrenAccessor:l="children",nodeIdAccessor:d="name",colorBy:m,colorScheme:h,colorByDepth:f=!1,orbitMode:p="flat",orbitSize:b=2.95,speed:S=.25,revolution:C,revolutionStyle:T,eccentricity:A=1,showRings:M=!0,nodeRadius:H=6,showLabels:x=!1,animated:B=!0,tooltip:D,foregroundGraphics:L,annotations:P,frameProps:E={},onObservation:W,onClick:R,chartId:z,selection:F,linkedHover:j,loading:$,loadingContent:G,stroke:q,strokeWidth:X,opacity:Y}=e,{width:K,height:Q,enableHover:Z,title:U,description:V,summary:ee,accessibleTable:te}=n,oe=J({nodes:$e(()=>_(i,l),[i,l]),edges:void 0,inferNodes:!1,colorBy:f?void 0:m,colorScheme:h,showLegend:!1,legendInteraction:void 0,selection:F,linkedHover:j,onObservation:W,onClick:R,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"OrbitDiagram",chartId:z,marginDefaults:k(n),userMargin:r,width:K,height:Q,loading:$,loadingContent:G}),ne=$e(()=>new Map,[]),{colorScale:ie,customClickBehavior:re,customHoverBehavior:se,themeCategorical:ae}=oe,le=$e(()=>{if(Array.isArray(h))return h;const e=g[h];return Array.isArray(e)?e:u},[h]),ce=$e(()=>e=>{const t={stroke:"#fff",strokeWidth:1},o=0===(e.depth??0);return t.fill=f?o?le[0]:Ge[(e.depth||0)%Ge.length]:m?y(e.data||e,m,ie):w(void 0,ae,h,void 0,ne),t.opacity=o?1:.85,t},[m,f,ie,le,ae,h,ne]),de=$e(()=>o(ce,{stroke:q,strokeWidth:X,opacity:Y}),[ce,q,X,Y]),me=$e(()=>()=>({stroke:"rgba(128,128,128,0.35)",strokeWidth:.5,opacity:1}),[]),he=$e(()=>e=>{se(e&&e.data&&void 0!==e.data.data?{...e,data:e.data.data}:e)},[se]),ge=$e(()=>e=>{re(e&&e.data&&void 0!==e.data.data?{...e,data:e.data.data}:e)},[re]),ue=t({componentName:"OrbitDiagram",data:i});return ue?_e(N,{componentName:"OrbitDiagram",message:ue,width:K,height:Q}):oe.loadingEl?oe.loadingEl:_e(O,{componentName:"OrbitDiagram",width:K,height:Q,children:_e(s,{chartType:"orbit",...null!=i&&{data:i},size:[K,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:oe.margin,nodeIDAccessor:d,childrenAccessor:l,nodeStyle:de,edgeStyle:me,colorBy:m,colorScheme:oe.effectivePalette,colorByDepth:f,nodeSize:H,nodeLabel:x?d:void 0,showLabels:x,enableHover:!B&&Z,tooltipContent:B?void 0:!1===D?()=>null:v(D)||void 0,...c({linkedHover:j,selection:F,onObservation:W,onClick:R,mobileInteraction:oe.mobileInteraction,customHoverBehavior:he,customClickBehavior:ge,linkedHoverInClickPredicate:!1}),foregroundGraphics:L,annotations:P,className:a,title:U,description:V,summary:ee,orbitMode:p,orbitSize:b,orbitSpeed:S,orbitRevolution:C,orbitRevolutionStyle:T,orbitEccentricity:A,orbitShowRings:M,orbitAnimated:B,accessibleTable:te,...null!=e.animate&&{animate:e.animate},...E})})}qe.displayName="OrbitDiagram";import{forceCenter as Xe,forceCollide as Je,forceLink as Ye,forceManyBody as Ke,forceSimulation as Qe,forceX as Ze,forceY as Ue}from"d3-force";function Ve(e,t,o={}){const n=o.iterations??260,i=o.repulsion??5200,r=o.linkDistance??165,s=o.linkStrength??.045,a=o.centerStrength??.018,l=o.damping??.84,c=o.nodeRadius??12,m=o.nodePadding??3,h=o.inset??.06,g=d(o.seed??1),u=new Map;for(const t of e)u.set(t.id,0);for(const e of t)u.set(e.source,(u.get(e.source)??0)+1),u.set(e.target,(u.get(e.target)??0)+1);const f=500,p=e.map(e=>({id:e.id,data:e,x:200+600*g(),y:200+600*g()})),b=new Set(e.map(e=>e.id)),y=t.filter(e=>b.has(e.source)&&b.has(e.target)).map(e=>({source:e.source,target:e.target}));if(n>0){const e=Qe(p).randomSource(g).alphaDecay(1-Math.pow(.001,1/n)).velocityDecay(Math.max(0,Math.min(1,1-l))).force("charge",Ke().strength(e=>{const t=u.get(e.id)??0;return 2.5*-Math.sqrt(i)*Math.sqrt(t+1)})).force("collide",Je(e=>(e=>"function"==typeof c?c(e.data):c)(e)+m).strength(.9).iterations(2)).force("center",Xe(f,f).strength(.8)).force("x",Ze(f).strength(a)).force("y",Ue(f).strength(a));y.length>0&&e.force("link",Ye(y).id(e=>e.id).distance(r).strength(e=>{const t="string"==typeof e.target?e.target:e.target.id,o=Math.max(1,Math.min(u.get("string"==typeof e.source?e.source:e.source.id)??1,u.get(t)??1));return s/.045/o})),e.stop();for(let t=0;n>t;t+=1)e.tick()}let v=1/0,k=1/0,S=-1/0,w=-1/0;for(const e of p){const t=e.x??f,o=e.y??f;v>t&&(v=t),k>o&&(k=o),t>S&&(S=t),o>w&&(w=o)}const C=S-v,T=w-k,I={};for(const e of p)I[e.id]={x:0===C?.5:h+((e.x??f)-v)/C*(1-2*h),y:0===T?.5:h+((e.y??f)-k)/T*(1-2*h)};return I}export{R as NetworkCustomChart,K as ForceDirectedGraph,ee as ChordDiagram,re as SankeyDiagram,se as validateProcessSankey,ae as formatProcessSankeyIssue,Ne as ProcessSankey,Le as TreeDiagram,Re as Treemap,je as CirclePack,qe as OrbitDiagram,Ve as forceLayout};