semiotic 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +55 -59
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/componentMetadata.cjs +3 -1
  4. package/ai/dist/mcp-server.js +45 -45
  5. package/ai/examples.md +67 -0
  6. package/ai/reference.md +75 -1
  7. package/ai/schema.json +5199 -1
  8. package/ai/surface-manifest.json +24 -3
  9. package/ai/task-packets/compare-category-totals.json +6 -6
  10. package/ai/task-packets/compare-category-totals.md +3 -3
  11. package/ai/task-packets/correct-published-chart.json +6 -6
  12. package/ai/task-packets/correct-published-chart.md +3 -3
  13. package/ai/task-packets/index.json +6 -6
  14. package/ai/task-packets/update-live-chart.json +6 -6
  15. package/ai/task-packets/update-live-chart.md +3 -3
  16. package/dist/c-2RL2QPZJ.min.js +1 -0
  17. package/dist/c-45CQWZZ6.min.js +1 -0
  18. package/dist/{c-PP6VY3QU.min.js → c-4BRHKVKV.min.js} +1 -1
  19. package/dist/c-7DVPSB5C.min.js +1 -0
  20. package/dist/{c-XDQKXPX4.min.js → c-A7OGOFSL.min.js} +1 -1
  21. package/dist/{c-AZKPVBOC.min.js → c-AH5HWZWS.min.js} +1 -1
  22. package/dist/c-B7GW7IHJ.min.js +1 -0
  23. package/dist/{c-ROEHCIGV.min.js → c-C3TZLTZK.min.js} +1 -1
  24. package/dist/c-CGQAQWBV.min.js +1 -0
  25. package/dist/c-DIPEYUOW.min.js +1 -0
  26. package/dist/{c-WNGH47HF.min.js → c-E72OTUZU.min.js} +1 -1
  27. package/dist/{c-DY2676CR.min.js → c-EUMPMDCS.min.js} +1 -1
  28. package/dist/c-EZZT2WAE.min.js +1 -0
  29. package/dist/c-FHBVFCQB.min.js +1 -0
  30. package/dist/{c-E32M6XW5.min.js → c-G4HCO2IQ.min.js} +1 -1
  31. package/dist/{c-ZYPXQF7B.min.js → c-G5VIJEOK.min.js} +1 -1
  32. package/dist/c-GHVOXAYH.min.js +1 -0
  33. package/dist/{c-EBOQ7ER7.min.js → c-HP4ZFM47.min.js} +1 -1
  34. package/dist/{c-IDJV3CZK.min.js → c-HYDTS5OP.min.js} +1 -1
  35. package/dist/c-IK33LNZ6.min.js +1 -0
  36. package/dist/c-IK3PZHRY.min.js +1 -0
  37. package/dist/{c-JO2UGTCP.min.js → c-J6DVC236.min.js} +1 -1
  38. package/dist/{c-MXCP7GNZ.min.js → c-JIMJF6F6.min.js} +1 -1
  39. package/dist/{c-4FN7Q6VQ.min.js → c-KKPMHAZC.min.js} +1 -1
  40. package/dist/c-L6WNDBHV.min.js +1 -0
  41. package/dist/c-LDEX5OFW.min.js +1 -0
  42. package/dist/{c-CPSPZH6A.min.js → c-LESEUVC5.min.js} +1 -1
  43. package/dist/c-MB6CV5NC.min.js +1 -0
  44. package/dist/{c-OO5QLMJC.min.js → c-MOKJOIPE.min.js} +1 -1
  45. package/dist/{c-BNG5ECK5.min.js → c-N3FXLRNT.min.js} +1 -1
  46. package/dist/c-N5NPTJVJ.min.js +1 -0
  47. package/dist/{c-DE5Q3U2X.min.js → c-NHBL4J67.min.js} +1 -1
  48. package/dist/{c-LMGSSD2E.min.js → c-ODG6TFSY.min.js} +1 -1
  49. package/dist/{c-HXDKPIKR.min.js → c-PSKKFZNP.min.js} +1 -1
  50. package/dist/{c-NYZ2QNAM.min.js → c-R2P4RR7Q.min.js} +1 -1
  51. package/dist/{c-KCRJGUHP.min.js → c-RFC7UAG7.min.js} +1 -1
  52. package/dist/c-SGAURYHG.min.js +1 -0
  53. package/dist/{c-DK662R77.min.js → c-SJMWU6UX.min.js} +1 -1
  54. package/dist/c-STIIGQOD.min.js +1 -0
  55. package/dist/c-T2ASIJVZ.min.js +1 -0
  56. package/dist/c-TX3THUTO.min.js +1 -0
  57. package/dist/{c-55BAJ333.min.js → c-TX7XJM3Z.min.js} +1 -1
  58. package/dist/c-UMXSJIOV.min.js +1 -0
  59. package/dist/{c-JLGRHXGZ.min.js → c-VRSXMLYF.min.js} +1 -1
  60. package/dist/c-VSLWSAN2.min.js +1 -0
  61. package/dist/{c-33QOXEUG.min.js → c-WCBRPILW.min.js} +1 -1
  62. package/dist/{c-WH2O53VI.min.js → c-WGHT7OCY.min.js} +1 -1
  63. package/dist/c-WWCW3APR.min.js +1 -0
  64. package/dist/c-Y6PYUMFU.min.js +1 -0
  65. package/dist/c-ZIVPFTOC.min.js +1 -0
  66. package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
  67. package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
  68. package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
  69. package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
  70. package/dist/components/charts/shared/hooks.d.ts +3 -1
  71. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  72. package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
  73. package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
  74. package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
  75. package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
  76. package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
  77. package/dist/components/recipes/atlas/braid.d.ts +62 -0
  78. package/dist/components/recipes/atlas/capsules.d.ts +18 -0
  79. package/dist/components/recipes/atlas/compare.d.ts +4 -0
  80. package/dist/components/recipes/atlas/completeness.d.ts +2 -0
  81. package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
  82. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
  83. package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
  84. package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
  85. package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
  86. package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
  87. package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
  88. package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
  89. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
  90. package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
  91. package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
  92. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
  93. package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
  94. package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
  95. package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
  96. package/dist/components/recipes/atlas/forests.d.ts +11 -0
  97. package/dist/components/recipes/atlas/ids.d.ts +6 -0
  98. package/dist/components/recipes/atlas/index.d.ts +26 -0
  99. package/dist/components/recipes/atlas/ledger.d.ts +7 -0
  100. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
  101. package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
  102. package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
  103. package/dist/components/recipes/atlas/motifs.d.ts +3 -0
  104. package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
  105. package/dist/components/recipes/atlas/prepare.d.ts +14 -0
  106. package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
  107. package/dist/components/recipes/atlas/profile.d.ts +19 -0
  108. package/dist/components/recipes/atlas/publish.d.ts +10 -0
  109. package/dist/components/recipes/atlas/queries.d.ts +34 -0
  110. package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
  111. package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
  112. package/dist/components/recipes/atlas/sections.d.ts +3 -0
  113. package/dist/components/recipes/atlas/support.d.ts +7 -0
  114. package/dist/components/recipes/atlas/types.d.ts +278 -0
  115. package/dist/components/recipes/atlas/validate.d.ts +12 -0
  116. package/dist/components/semiotic-atlas-core.d.ts +20 -0
  117. package/dist/components/semiotic-atlas.d.ts +8 -0
  118. package/dist/components/semiotic-recipes-core.d.ts +9 -0
  119. package/dist/components/server/serverChartConfigs.d.ts +3 -0
  120. package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
  121. package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
  122. package/dist/components/stream/canvasSetup.d.ts +1 -2
  123. package/dist/components/stream/fontLoading.d.ts +4 -0
  124. package/dist/components/stream/networkCustomLayout.d.ts +8 -0
  125. package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
  126. package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
  127. package/dist/components/stream/physics/physicsSemanticUI.d.ts +2 -0
  128. package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
  129. package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
  130. package/dist/components/stream/shallowEqual.d.ts +2 -0
  131. package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
  132. package/dist/geo.min.js +1 -1
  133. package/dist/geo.module.min.js +1 -1
  134. package/dist/network.module.min.js +1 -1
  135. package/dist/ordinal.module.min.js +1 -1
  136. package/dist/physics.module.min.js +1 -1
  137. package/dist/rough.module.min.js +1 -1
  138. package/dist/semiotic-access.module.min.js +1 -1
  139. package/dist/semiotic-ai-core.min.js +1 -1
  140. package/dist/semiotic-ai-core.module.min.js +1 -1
  141. package/dist/semiotic-ai.module.min.js +1 -1
  142. package/dist/semiotic-artifact.min.js +1 -1
  143. package/dist/semiotic-artifact.module.min.js +1 -1
  144. package/dist/semiotic-atlas-core.d.ts +20 -0
  145. package/dist/semiotic-atlas-core.min.js +1 -0
  146. package/dist/semiotic-atlas-core.module.min.js +1 -0
  147. package/dist/semiotic-atlas-selection.module.min.js +2 -0
  148. package/dist/semiotic-atlas.d.ts +8 -0
  149. package/dist/semiotic-atlas.min.js +2 -0
  150. package/dist/semiotic-atlas.module.min.js +2 -0
  151. package/dist/semiotic-client-cjs-shared.min.js +1 -1
  152. package/dist/semiotic-evidence.min.js +1 -1
  153. package/dist/semiotic-evidence.module.min.js +1 -1
  154. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  155. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  156. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  157. package/dist/semiotic-experimental-vacp.min.js +1 -1
  158. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  159. package/dist/semiotic-line.module.min.js +1 -1
  160. package/dist/semiotic-realtime-core.module.min.js +1 -1
  161. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  162. package/dist/semiotic-recipes-core.d.ts +9 -0
  163. package/dist/semiotic-recipes-core.module.min.js +1 -1
  164. package/dist/semiotic-server-edge-node.module.min.js +1 -1
  165. package/dist/semiotic-server-edge.min.js +1 -1
  166. package/dist/semiotic-server-edge.module.min.js +1 -1
  167. package/dist/semiotic-server-node.min.js +1 -1
  168. package/dist/semiotic-server-node.module.min.js +1 -1
  169. package/dist/semiotic-text.min.js +1 -1
  170. package/dist/semiotic-text.module.min.js +1 -1
  171. package/dist/semiotic-utils-core.min.js +1 -1
  172. package/dist/semiotic-utils-core.module.min.js +1 -1
  173. package/dist/semiotic.module.min.js +1 -1
  174. package/dist/server.min.js +1 -1
  175. package/dist/server.module.min.js +1 -1
  176. package/dist/xy.module.min.js +1 -1
  177. package/package.json +16 -1
  178. package/dist/c-447VIMRO.min.js +0 -1
  179. package/dist/c-553QUDKA.min.js +0 -1
  180. package/dist/c-7HP7MB2I.min.js +0 -1
  181. package/dist/c-7NBU5ZKS.min.js +0 -1
  182. package/dist/c-CCTGN5CK.min.js +0 -1
  183. package/dist/c-GSZRZRD6.min.js +0 -1
  184. package/dist/c-GWX7JGMF.min.js +0 -1
  185. package/dist/c-ITKX3RC5.min.js +0 -1
  186. package/dist/c-JG2JCQLP.min.js +0 -1
  187. package/dist/c-LYVKDBQJ.min.js +0 -1
  188. package/dist/c-NG7BLZTR.min.js +0 -1
  189. package/dist/c-PYNW54D2.min.js +0 -1
  190. package/dist/c-TIXX5CAU.min.js +0 -1
  191. /package/dist/{c-OOVX2JPQ.min.js → c-UC7SIU2W.min.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- function e(e){return"default"in e?e.default:e}async function t(t){let i=Be.get(t);if(i)return i;let{topology:o,objectName:r}=await async function(t){try{switch(t){case"world-110m":return{topology:e(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:e(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:e(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:e(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${t}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(e){throw/Cannot find module|Failed to resolve|world-atlas/i.test(e instanceof Error?e.message:e+"")?Error(`resolveReferenceGeography("${t}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:e}):e}}(t);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${t}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);let n=Te(o,o.objects[r]),a="features"in n?n.features:[n];return Be.set(t,a),a}function i(e){let i=De(()=>Array.isArray(e)?e:void 0,[e]),[o,r]=We(null);return Oe(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(i=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(i)){let i=!1;return r(null),t(e).then(e=>{i||r(e)}),()=>{i=!0}}var i;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),r(null)}else r(null)},[e]),void 0!==i?i:o}function o(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function r(e){let t=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=ve(),{areas:n,valueAccessor:a,styleRules:l,colorScheme:s,projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:f,tileURL:g,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:k,legendInteraction:w,legendPosition:S,margin:M,className:A,selection:C,linkedHover:N,onObservation:R,onClick:j,chartId:F,loading:P,loadingContent:L,emptyContent:H,frameProps:I={},stroke:z,strokeWidth:W,opacity:O}=e,D=m??!!g,T=i(n),E=Ie(()=>T&&ee(T),[T]),G=Ie(()=>"function"==typeof a?a:e=>e?.properties?.[a]??e?.[a],[a]),Z=s??r??"blues",q=Ie(()=>{if(!E)return ze(Me(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(let i of E){let o=G(i);null==o||!isFinite(o)||(e>o&&(e=o),o>t&&(t=o))}let i=Me(Z);return ze(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[E,G,Z]),J=Ie(()=>{let e=q.domain();return[e[0]??0,e[1]??1]},[q]),V=ye(w,G,J),{activeSelectionHook:Y,hoverSelectionHook:te,customHoverBehavior:ie,customClickBehavior:oe}=ge({selection:C,linkedHover:N,onObservation:R,onClick:j,chartType:"ChoroplethMap",chartId:F,mobileInteraction:t.mobileInteraction}),re=U(C),ne=te||V.legendSelectionHook||Y,ue=Ie(()=>{let e=X(e=>{let t=G(e);return{fill:null!=t&&isFinite(t)?q(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},l,e=>({value:G(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=K(e,{stroke:z,strokeWidth:W,opacity:O});return ne?ke(t,ne,re,o):t},[G,q,ne,re,x,z,W,O,l]),de=Ie(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=G(e);return Ge("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ee("div",{style:{fontWeight:600},children:t}),null!=i&&Ee("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):(o??"")+"")})]});var o},[G]),me=ce(t),he=Ie(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>q(e),domain:J,label:"string"==typeof a?a:"value"}},[q,t.showLegend,a,J]),{legend:be,margin:xe,legendPosition:we,legendMarginReserved:Se}=pe({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:S,userMargin:M,defaults:me,additionalLegend:he,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),Ae=se(P,t.width,t.height,L)||(E?null:se(!0,t.width,t.height,L)),Ce=Ae?null:le(E,t.width,t.height,H);if(Array.isArray(E)&&E.length>0){let e=E[0];if(!e||"object"!=typeof e||!e.geometry)return Ee(_,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let Ne={projection:c,areas:E,areaStyle:ue,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:xe,enableHover:t.enableHover,...be&&{legend:be,legendPosition:we},...Se&&{__legendMarginReservedFor:be},legendHoverBehavior:V.onLegendHover,legendClickBehavior:V.onLegendClick,legendHighlightedCategory:V.highlightedCategory,legendIsolatedCategories:"isolate"===w?V.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?de:ae(v)||de,...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...D&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=f&&{dragRotate:f},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...$({linkedHover:N,selection:C,onObservation:R,onClick:j,mobileInteraction:t.mobileInteraction,customHoverBehavior:ie,customClickBehavior:oe,linkedHoverInClickPredicate:!1}),...k&&k.length>0&&{annotations:k},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...A&&{className:A},...null!=e.animate&&{animate:e.animate},...I};return Ae||Ce||Ee(Q,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:Ee(B,{...Ne})})}function n(e,t,i){let[o,r]=i;if(!t)return o;let[n,a]=t,l=a>n?a-n:0,s=Number(e),c=Number.isFinite(s)?s:n;return o+Math.max(0,Math.min(1,l>0?(c-n)/l:0))*(r-o)}function a({bottomMargin:e,costLabel:t,layout:{cx:i,cy:o,maxCost:r,availableRadius:n,layout:a},ringStyle:l,ringValues:s,showNorth:c,showRingLabels:u,showRings:d}){let m="strip"===a,h={stroke:m?"var(--semiotic-border, #999)":"#999",strokeWidth:m?1:.8,strokeDasharray:m?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:m?8:10,...l};return pt("g",m?{children:[ht("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),ht("line",{x1:i,y1:o-3.5,x2:i,y2:o+3.5,stroke:h.stroke,strokeWidth:h.strokeWidth,opacity:.9}),d&&s.map(a=>{let l=i+(r>0?a/r*n:0);return pt("g",{children:[ht("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&pt("text",{x:l,y:o+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?" "+t:""]})]},a)})]}:{children:[s.map(e=>{let a=e/r*n;return pt("g",{children:[ht("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&pt("text",{x:i+a+3,y:o-2,fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?" "+t:""]})]},e)}),c&&pt("g",{transform:"translate(24, 24)",children:[ht("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),ht("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),ht("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),ht("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),ht("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),ht("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function l(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function s(e,t,i){return Math.max(t,Math.min(i,e))}function c(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(t>o&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function u(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function d(e,t={}){let i=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===i.length)return[];let o=s(Number.isFinite(t.occupancy)?Number(t.occupancy):.72,.2,1),r=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):1.8,n=l(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=l(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));i.length>n*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(i.length/n):null!=t.rows&&null==t.columns?n=Math.ceil(i.length/a):a=Math.ceil(i.length/n));let d=c(i.map(e=>e.x)),m=c(i.map(e=>e.y)),h=i.map(e=>({...e,desiredColumn:u(e.x,d)*Math.max(0,n-1),desiredRow:u(e.y,m)*Math.max(0,a-1)})),p=(n-1)/2,f=(a-1)/2;h.sort((e,t)=>(t.desiredColumn-p)**2+(t.desiredRow-f)**2-((e.desiredColumn-p)**2+(e.desiredRow-f)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);let g=new Set;for(let e=0;a>e;e+=1)for(let t=0;n>t;t+=1)g.add(e*n+t);let y=[];for(let e of h){let t=-1,i=1/0;for(let o of g){let r=(o%n-e.desiredColumn)**2+(Math.floor(o/n)-e.desiredRow)**2;(i>r||r===i&&t>o)&&(t=o,i=r)}0>t||(g.delete(t),y.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return y.sort((e,t)=>e.index-t.index),y.map(({index:e,...t})=>t)}function m(e,t,i=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(let t of i)if(null!=e[t])return e[t]}function h(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function p(e,t,i){let o=[];for(let r=0;6>r;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return h(o)}function f({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=Z();return vt("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);return vt("text",{x:e.x,y:e.y,fill:t,fontFamily:o,fontSize:i,fontWeight:r,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function g(e,t,i){return Math.max(t,Math.min(i,e))}function y(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function b(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function v(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function x(e,t){let i=v(e);return(e.id??i.id??i.name??"feature-"+t)+""}function k(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function w(e){if(!e)return 0;let t=Ct.get(e);if(t)return t;let i=Nt;return Nt+=1,Ct.set(e,i),i}function S(e,t){return!t||!(t[0][1]>e[1]||e[1]>t[1][1]||(i=e[0],o=t[0][0],r=t[1][0],o>r?o>i&&i>r:o>i||i>r));var i,o,r}function M(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&S(t,i.bounds))try{if(wt(e,t))return{feature:e,index:o}}catch{}}return null}function A(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=function(e,t){if(0===e.length)return null;let i=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(i[0][0])&&Number.isFinite(i[0][1])&&Number.isFinite(i[1][0])&&Number.isFinite(i[1][1])?i:null}(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[g(n[0][0],a,Math.max(a,i.width-a)),g(n[0][1],a,Math.max(a,i.height-a))],[g(n[1][0],a,Math.max(a,i.width-a)),g(n[1][1],a,Math.max(a,i.height-a))]],s=Math.max(0,l[1][0]-l[0][0]),c=Math.max(0,l[1][1]-l[0][1]);if(0===s||0===c)return{dots:[],cellSize:10,features:r};let u=y(o.columns),d=Math.max(2,u?s/u:y(o.cellSize)??10),m=Math.max(100,Math.round(y(o.maxSamples)??25e3)),h=Math.ceil(s/d)*Math.ceil(c/d);h>m&&(d*=Math.sqrt(h/m));let p=o.gridOrigin?.[0]??0,f=o.gridOrigin?.[1]??0,[b,w]=k(l[0][0],l[1][0],p,d),[S,A]=k(l[0][1],l[1][1],f,d),C=[],N=function(e){return e.map((e,t)=>{if(At.has(e))return{feature:e,index:t,bounds:At.get(e)??null};try{let i=kt(e);return At.set(e,i),{feature:e,index:t,bounds:i}}catch{return At.set(e,null),{feature:e,index:t,bounds:null}}})}(r);for(let e=S;A>=e;e+=1){let i=f+(e+.5)*d;for(let r=b;w>=r;r+=1){let n=t.invertedPoint(p+(r+.5)*d,i);if(!n||!Number.isFinite(n[0])||!Number.isFinite(n[1]))continue;let a=M(N,n);if(!a)continue;let l={...v(a.feature),featureId:x(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:r,longitude:n[0],latitude:n[1],dotIndex:C.length};o.dotFilter&&!o.dotFilter(l,C.length)||C.push(l)}}return{dots:C,cellSize:d,features:r}}function C(e){return Math.round(1e4*e)/1e4}function N(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${C(Number(e[0]))},${C(Number(e[1]))}`:"null"}function R(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function j(e){return"number"==typeof e&&Number.isFinite(e)?C(e)+"":null===e?"null":"unavailable"}function F(e){let t=e.scales.projection;return[j(R(t,"scale")),N(R(t,"translate")),N(R(t,"center")),(i=R(t,"rotate"),Array.isArray(i)&&i.every(Number.isFinite)?i.map(e=>C(Number(e))).join(","):"unavailable"),j(R(t,"clipAngle")),j(R(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>N(e.scales.projectedPoint(t,i)))].join("|");var i}function P(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function L(e,t,i){return P([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function H(e,t,i){return P(Array.from({length:6},(o,r)=>{let n=-Math.PI/2+r*(Math.PI/3);return[e+Math.cos(n)*i,t+Math.sin(n)*i]}))}function I(e,t,i){let{featureKey:o,dataKey:r}=i,n=new Map;for(let e of t){let t=(Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0)+"";n.set(t,e)}return e.map(e=>{let t=(e=>{let t=o.split("."),i=e;for(let e of t)i=null!==i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;return(i??"")+""})(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}import{DEFAULT_HIT_RADIUS as z,geoAreaHitTarget as W,geoHitTarget as O,hitTargetPoint as D}from"./c-HLLFJYTY.min.js";import{GeoCustomChart as T,StreamGeoFrame_default as B}from"./c-CCTGN5CK.min.js";import"./c-55BAJ333.min.js";import{useChartSetup as E,useFrameImperativeHandle as G,useResolvedSelection as U}from"./c-KCRJGUHP.min.js";import"./c-ORLEBW72.min.js";import"./c-NYZ2QNAM.min.js";import"./c-BNG5ECK5.min.js";import"./c-TKG2NP7G.min.js";import"./c-OO5QLMJC.min.js";import"./c-V4XMSLC3.min.js";import"./c-4FN7Q6VQ.min.js";import{buildCustomBehaviorProps as $,mergeShapeStyle as K}from"./c-ITKX3RC5.min.js";import{useCustomLayoutSelection as Z}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-EUBTECGM.min.js";import{ChartError as _,EMPTY_ARRAY as q,MultiLineTooltip as J,SafeRender as Q,Tooltip as V,TooltipRoot as Y,composeStyleRules as X,filterSparseArray as ee,makeNodeRuleContext as te,makeRuleValueResolver as ie,markTooltipChrome as oe,matchesThreshold as re,normalizeLinkedHover as ne,normalizeTooltip as ae,renderEmptyState as le,renderLoadingState as se,resolveAxisFreeMarginDefaults as ce,resolveResponsiveRules as ue,resolveStyleRules as de,responsiveRuleMatches as me,ruleMatches as he,useChartLegendAndMargin as pe,useChartMode as fe,useChartSelection as ge,useGradientLegendInteraction as ye,useLinkedHover as be,useThemeSequential as ve,warnMissingField as xe,wrapStyleWithSelection as ke}from"./c-LMGSSD2E.min.js";import{DEFAULT_COLOR as we,getColor as Se,getSequentialInterpolator as Me,getSize as Ae}from"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import{useObservationSelector as Ce}from"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import{getMinMax as Ne}from"./c-QA3HMQJP.min.js";import{glyphExtent as Re,glyphPlacement as je,hatchFillId as Fe,hatchPatternDef as Pe,isHatchFill as Le,resolveSvgFill as He}from"./c-553QUDKA.min.js";import{useMemo as Ie}from"react";import{scaleSequential as ze}from"d3-scale";import{useState as We,useEffect as Oe,useMemo as De}from"react";import{feature as Te}from"topojson-client";var Be=new Map;import{jsx as Ee,jsxs as Ge}from"react/jsx-runtime";r.displayName="ChoroplethMap";import{useMemo as Ue,useRef as $e,forwardRef as Ke}from"react";var Ze={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as _e,jsxs as qe}from"react/jsx-runtime";var Je=[3,30],Qe=[1,4],Ve=Ke(function(e,t){let o=$e(null);G(t,{variant:"geo-points",frameRef:o});let r=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,areas:S,areaStyle:M=Ze,tooltip:A,annotations:C,margin:N,className:R,selection:j,linkedHover:F,onObservation:P,onClick:L,chartId:H,loading:I,loadingContent:z,emptyContent:W,legendInteraction:O,legendPosition:D,frameProps:T={},stroke:U,strokeWidth:Z,opacity:_}=e,J=c??("sparkline"===r.mode?Qe:Je),V="sparkline"===r.mode?1.5:6,Y=g??!!x,ee=i(S),ie=E({data:n??q,rawData:n,colorBy:u,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:T,selection:j,linkedHover:F,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:P,onClick:L,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:H,showLegend:r.showLegend,userMargin:N,marginDefaults:ce(r),loading:I,loadingContent:z,emptyContent:W,width:r.width,height:r.height,hasTitle:!!r.title}),oe=ie.data,re=Ue(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=oe.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?Ne(t):void 0},[oe,s]),ne=Ue(()=>{let e=X(e=>({fill:u?Se(e,u,ie.colorScale):we,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Ae(e,s,J,re):V}),d,te(u,s)),t=K(e,{stroke:U,strokeWidth:Z,opacity:_});return ie.effectiveSelectionHook?ke(t,ie.effectiveSelectionHook,ie.resolvedSelection):t},[u,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,s,J,re,V,U,Z,_,d]),le=Ue(()=>e=>{let t=e?.name||e?.label||e?.NAME||e?.id,i="string"==typeof s?s:null,o=("function"==typeof s?s:e=>e[s])(e),r=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",n="string"==typeof u?u:null,a=n?e?.[n]:null;return qe("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&_e("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&qe("div",{children:[qe("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&qe("div",{children:[qe("span",{style:{opacity:.7},children:[n,": "]}),a+""]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>qe("div",{children:[qe("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(ie.earlyReturn)return ie.earlyReturn;xe("ProportionalSymbolMap",oe,"xAccessor",a),xe("ProportionalSymbolMap",oe,"yAccessor",l);let se={projection:h,...null!=n&&{points:oe},xAccessor:a,yAccessor:l,pointStyle:ne,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ee&&{areas:ee,areaStyle:M},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...Y&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[r.width,r.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:r.enableHover,tooltipContent:!1===A?()=>null:ae(A)||le,...ie.legendBehaviorProps,...$({linkedHover:F,selection:j,onObservation:P,onClick:L,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior,linkedHoverInClickPredicate:!1}),...C&&C.length>0&&{annotations:C},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...r.title&&{title:r.title},...r.description&&{description:r.description},...r.summary&&{summary:r.summary},...void 0!==r.accessibleTable&&{accessibleTable:r.accessibleTable},...R&&{className:R},...null!=e.animate&&{animate:e.animate},...T};return _e(Q,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:_e(B,{ref:o,...se})})});Ve.displayName="ProportionalSymbolMap";import{useMemo as Ye,useCallback as Xe,useRef as et,forwardRef as tt}from"react";import{jsx as it,jsxs as ot}from"react/jsx-runtime";var rt="__semiotic_x",nt="__semiotic_y",at=tt(function(e,t){let o=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:r,nodes:a,nodeIdAccessor:l="id",xAccessor:s="lon",yAccessor:c="lat",valueAccessor:u="value",projection:d="equalEarth",graticule:m,fitPadding:h,zoomable:p,zoomExtent:f,onZoom:g,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:k="geo",flowStyle:w="basic",areas:S,areaStyle:M=Ze,edgeColorBy:A,edgeOpacity:C=.6,edgeWidthRange:N=[1,8],pointRadius:R,edgeLinecap:j="round",colorScheme:F,styleRules:P,showParticles:L,particleStyle:H,tooltip:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:U,onClick:Z,chartId:_,loading:J,loadingContent:V,emptyContent:Y,frameProps:te={},legendInteraction:oe,legendPosition:re,stroke:le,strokeWidth:se,opacity:ue,lineIdAccessor:de}=e,me=p??!!b,he=i(S),pe=Ye(()=>ee(a),[a]),ge=E({data:r??q,rawData:r,colorBy:A,colorScheme:F,legendInteraction:oe,legendPosition:re,frameLegend:te,selection:D,linkedHover:T,fallbackFields:A?["string"==typeof A?A:""]:[],unwrapData:!1,onObservation:U,onClick:Z,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FlowMap",chartId:_,showLegend:o.showLegend,userMargin:W,marginDefaults:ce(o),loading:J,loadingContent:V,emptyContent:Y,width:o.width,height:o.height,hasTitle:!!o.title}),ye=ge.data,ve=ne(T),xe=be({name:ve?.name||"hover",fields:ve?.fields||[]}),Me=Ce(e=>e.pushObservation),Ae=Ye(()=>{let e=new Map;for(let t of pe)e.set(t[l]+"",t);return e},[pe,l]),Re=et(null),je=et(Ae);je.current=Ae;let Fe=et(s);Fe.current=s;let Pe=et(c);Pe.current=c;let Le=Xe(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=je.current,i=t.get(e.source+""),o=t.get(e.target+"");if(!i||!o)return null;let r="function"==typeof Fe.current?Fe.current:e=>e[Fe.current],n="function"==typeof Pe.current?Pe.current:e=>e[Pe.current];return{...e,coordinates:[{[rt]:r(i),[nt]:n(i)},{[rt]:r(o),[nt]:n(o)}]}},[]);G(t,{variant:"geo-lines",frameRef:Re,overrides:{push:e=>{let t=Le(e);t&&Re.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=Le(i);e&&t.push(e)}t.length>0&&Re.current?.pushManyLines(t)}}});let He=Ye(()=>{let e=new Map;for(let t of ye)!t||"object"!=typeof t||(null!=t.source&&!e.has(t.source)&&e.set(t.source,t),null!=t.target&&!e.has(t.target)&&e.set(t.target,t));return e},[ye]),Ie=Xe(e=>{if(T)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=He.get(t[l]+"");e&&xe.onHover(e)}else xe.onHover(t)}else xe.onHover(null);if(U||Me){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:_};if(e){let i=e.data||e.datum||e;Array.isArray(i)&&(i=i[0]);let o={...t,type:"hover",datum:i||{},x:e.x??0,y:e.y??0};U&&U(o),Me&&Me(o)}else{let e={...t,type:"hover-end"};U&&U(e),Me&&Me(e)}}},[T,xe,l,He,U,_,Me]),ze=ge.customClickBehavior,We=Ye(()=>{let e="function"==typeof s?s:e=>e[s],t="function"==typeof c?c:e=>e[c];return ye.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=Ae.get(i.source+""),r=Ae.get(i.target+"");return o&&r?{...i,coordinates:[{[rt]:e(o),[nt]:t(o)},{[rt]:e(r),[nt]:t(r)}]}:null}).filter(Boolean)},[ye,Ae,s,c]),Oe=Ye(()=>{let e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&rt in t?t[rt]:e(t)},[s]),De=Ye(()=>{let e="function"==typeof c?c:e=>e[c];return t=>null!=t&&"object"==typeof t&&nt in t?t[nt]:e(t)},[c]),Te=Ye(()=>{let e=ye.filter(e=>e&&"object"==typeof e).map(e=>Number(e[u]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return Ne(e)},[ye,u]),Be=Ye(()=>function(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:a,edgeLinecap:l,styleRules:s}=e,c=ie(t);return X(e=>({stroke:r(e),strokeWidth:n(e[t],i,o),strokeLinecap:l,opacity:a,fillOpacity:0}),s,e=>({value:c(e)}))}({valueAccessor:u,valueDomain:Te,edgeWidthRange:N,resolveStroke:e=>A?Se(e,A,ge.colorScale):we,edgeOpacity:C,edgeLinecap:j,styleRules:P}),[u,Te,N,A,ge.colorScale,C,j,P]),Ee=Ye(()=>{let e=K(Be,{stroke:le,strokeWidth:se,opacity:ue});if(!ge.effectiveSelectionHook)return e;let t={...ge.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return ke(e,ge.effectiveSelectionHook,{...ge.resolvedSelection||{},unselectedStyle:t})},[Be,ge.effectiveSelectionHook,ge.resolvedSelection,le,se,ue]),Ge=R??("sparkline"===o.mode?1.5:5),Ue=Ye(()=>K(()=>({fill:"#333",r:Ge,fillOpacity:.8}),{stroke:le,strokeWidth:se,opacity:ue}),[Ge,le,se,ue]),$e=Ye(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)return it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:it("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[u];return ot("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[ot("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&it("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[l];return null!=t?it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:it("div",{style:{fontWeight:600},children:t})}):null},[u,l]);if(ge.earlyReturn)return ge.earlyReturn;let Ke={projection:d,...null!=r&&{lines:We},points:pe,xAccessor:Oe,yAccessor:De,lineDataAccessor:"coordinates",...null!=de&&{lineIdAccessor:de},lineType:k,flowStyle:w,lineStyle:Ee,pointStyle:Ue,...he&&{areas:he,areaStyle:M},...null!=m&&{graticule:m},...null!=h&&{fitPadding:h},...me&&{zoomable:!0},...f&&{zoomExtent:f},...g&&{onZoom:g},...null!=y&&{dragRotate:y},...L&&{showParticles:L},...H&&{particleStyle:H},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ge.margin,enableHover:o.enableHover,tooltipContent:!1===I?()=>null:ae(I)||$e,...ge.legendBehaviorProps,...$({linkedHover:T,selection:D,onObservation:U,onClick:Z,mobileInteraction:ge.mobileInteraction,customHoverBehavior:Ie,customClickBehavior:ze,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...te};return it(Q,{componentName:"FlowMap",width:o.width,height:o.height,children:it(B,{ref:Re,...Ke})})});at.displayName="FlowMap";import{useMemo as lt,useRef as st,useState as ct,useEffect as ut,useCallback as dt,forwardRef as mt}from"react";import{jsx as ht,jsxs as pt}from"react/jsx-runtime";import{Fragment as ft,jsx as gt,jsxs as yt}from"react/jsx-runtime";var bt=mt(function(e,t){let i=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:o,lines:r,xAccessor:n="lon",yAccessor:l="lat",nodeIdAccessor:s="id",center:c,costAccessor:u,strength:d=1,lineMode:m="straight",projection:h="mercator",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,transition:S,colorBy:M,styleRules:A,colorScheme:C,pointRadius:N,tooltip:R,showRings:j,showRingLabels:F,ringStyle:P,showNorth:L,costLabel:H,cartogramLayout:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:U,onClick:Z,chartId:_,loading:q,loadingContent:J,emptyContent:V,legendPosition:Y,frameProps:ie={},stroke:oe,strokeWidth:re,opacity:ne}=e,le="sparkline"===i.mode,se=I??(le?"strip":"radial"),ue=N??(le?1.5:5),de=j??!0,me=F??("strip"!==se&&!i.compactMode),he=L??("strip"!==se&&!le),pe=g??!!x,ge=lt(()=>ee(o),[o]),ye=E({data:ge,rawData:o,colorBy:M,colorScheme:C,legendInteraction:void 0,legendPosition:Y,frameLegend:ie,selection:D,linkedHover:T,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:U,onClick:Z,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:_,showLegend:i.showLegend,userMargin:W,marginDefaults:ce(i),loading:q,loadingContent:J,emptyContent:V,width:i.width,height:i.height,hasTitle:!!i.title}),be=lt(()=>{let e=X(e=>{let t=e?.[s],i=null!=t&&t+""==c+"";return{fill:M?Se(e,M,ye.colorScale):we,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*ue:ue}},A,te(M)),t=K(e,{stroke:oe,strokeWidth:re,opacity:ne});return ye.effectiveSelectionHook?ke(t,ye.effectiveSelectionHook,ye.resolvedSelection):t},[M,ye.colorScale,ye.effectiveSelectionHook,ye.resolvedSelection,ue,oe,re,ne,A,c,s]),ve=lt(()=>({center:c,centerAccessor:s,costAccessor:u,strength:d,lineMode:m,layout:se}),[c,s,u,d,m,se]),Me=lt(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof l?l:e=>e[l],i=new Map;for(let e of ge)i.set(e[s]+"",e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(o.source+""),a=i.get(o.target+"");return r&&a?{...o,coordinates:[{[n]:e(r),[l]:t(r)},{[n]:e(a),[l]:t(a)}]}:null}).filter(Boolean)},[r,ge,n,l,s]),Ae=lt(()=>e=>{let t=("function"==typeof u?u:e=>e[u])(e);return yt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[gt("div",{style:{fontWeight:600},children:e[s]||e.name||e.id||"Point"}),null!=t&&yt("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[u,s]),Ce=st(null);G(t,{variant:"geo-points",frameRef:Ce});let[Ne,Re]=ct(null),je=dt(()=>{let e=Ce.current?.getCartogramLayout?.();e&&Re(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);ut(()=>{let e=requestAnimationFrame(je);return()=>cancelAnimationFrame(e)},[je,d,c,i.width,i.height,ge,se]);let Fe=lt(()=>{if(!de||!Ne)return[];let{maxCost:e}=Ne;if(0>=e)return[];if(Array.isArray(de))return de.filter(t=>t>0&&e>=t);let t="number"==typeof de?de:Math.min("strip"===Ne.layout?3:5,Math.max(2,Math.ceil(e/5))),i=e/t,o=[];for(let e=1;t>=e;e++)o.push(Math.round(i*e*10)/10);return o},[de,Ne]),Pe=lt(()=>{if(!Ne)return ie.foregroundGraphics||null;let e=gt(a,{bottomMargin:ye.margin.bottom,costLabel:H,layout:Ne,ringStyle:P,ringValues:Fe,showNorth:he,showRingLabels:me,showRings:de}),t=ie.foregroundGraphics;return"function"==typeof t?i=>yt(ft,{children:[e,t(i)]}):yt(ft,{children:[e,t]})},[Ne,Fe,de,me,he,H,P,ye.margin.bottom,ie.foregroundGraphics]);if(ye.earlyReturn)return ye.earlyReturn;xe("DistanceCartogram",ge,"xAccessor",n),xe("DistanceCartogram",ge,"yAccessor",l);let Le={projection:h,...null!=o&&{points:ge},...Me&&{lines:Me,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:l,pointIdAccessor:s,pointStyle:be,projectionTransform:ve,...S&&{transition:{duration:S}},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...pe&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye.margin,enableHover:i.enableHover,tooltipContent:!1===R?()=>null:ae(R)||Ae,...ye.legendBehaviorProps,...$({linkedHover:T,selection:D,onObservation:U,onClick:Z,mobileInteraction:ye.mobileInteraction,customHoverBehavior:ye.customHoverBehavior,customClickBehavior:ye.customClickBehavior,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...ie,foregroundGraphics:Pe};return gt(Q,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:gt(B,{ref:Ce,...Le})})});bt.displayName="DistanceCartogram";import{jsx as vt}from"react/jsx-runtime";var xt=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?function(e){return e.areas.map((t,i)=>{let o=function(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??"area-"+t;return{...i,id:o+""}}(t,i),r=e.scales.geoPath.centroid(t),n=Number.isFinite(r[0])&&Number.isFinite(r[1])?e.scales.invertedPoint(r[0],r[1]):null;return{datum:{...o,gridLongitude:n?.[0],gridLatitude:n?.[1]},x:r[0],y:r[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=function(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(m(e,t.columnAccessor)),y:Number(m(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return i.length!==e.length?null:i.map(e=>({...e,row:e.y,column:e.x}))}(r.map(e=>e.datum),t),a=o?r:function(e){return e.points.map(t=>{let i=Number(m(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(m(t,e.config.latitudeAccessor,["lat","latitude"])),r=Number.isFinite(i)&&Number.isFinite(o)?e.scales.projectedPoint(i,o):null;return{datum:t,x:r?.[0]??NaN,y:r?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}({...e,points:r.map(e=>e.datum)}),l=n??d(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===l.length)return{nodes:[]};let g=c(l.map(e=>e.row)),y=c(l.map(e=>e.column)),b=Math.max(1,Math.round(g[1]-g[0])+1),v=Math.max(1,Math.round(y[1]-y[0])+1),x=Math.max(0,t.layoutPadding??8),k=Math.max(1,e.dimensions.width-2*x)/v,w=Math.max(1,e.dimensions.height-2*x)/b,S=(e.dimensions.width-k*v)/2,M=(e.dimensions.height-w*b)/2,A=s(t.cellPadding??.12,0,.8),C=Math.max(1,.5*Math.min(k,w)*(1-A)),N=t.sizeAccessor?l.map(e=>Number(m(e.datum,t.sizeAccessor))):[],R=t.sizeDomain??c(N),j=t.sizeRange??[.36,1],F=s(Math.min(j[0],j[1]),.05,1),P=s(Math.max(j[0],j[1]),F,1),L=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=(m(r,t.idAccessor,["id","key","name"])??"grid-"+o)+"",a=(m(r,t.labelAccessor,["abbr","code","label","name","id"])??n)+"",l=Math.max(1,t.maxLabelLength??4),c=a.length>l?a.slice(0,l):a,d=m(r,t.categoryAccessor),h=null==d?void 0:d+"",p=m(r,t.fillAccessor),f=null!=p?p+"":h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",b=t.sizeAccessor?Number(m(r,t.sizeAccessor)):NaN,v=t.sizeAccessor&&Number.isFinite(b)?Math.sqrt(s(u(b,R),0,1)):1,x=C*(F+v*(P-F)),A="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:c,category:h,row:i.row,column:i.column,x:S+(i.column-y[0]+.5)*k,y:M+(i.row-g[0]+.5)*w,radius:x,style:{fill:f,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...A}}}),H=t.shape??"circle";return{nodes:L.map(e=>{return"circle"===H?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===H?p(e.x,e.y,e.radius):(t=e.x,i=e.y,o=e.radius,h([[t-o,i-o],[t+o,i-o],[t+o,i+o],[t-o,i+o]])),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===H?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0};var t,i,o}),overlays:!1===t.showLabels?null:vt(f,{marks:L,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??s(.23*Math.min(k,w),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}};import{geoBounds as kt,geoContains as wt}from"d3-geo";import{jsx as St}from"react/jsx-runtime";var Mt=new WeakMap,At=new WeakMap,Ct=new WeakMap,Nt=1,Rt=e=>{let t=function(e){let t=Mt.get(e.areas);t||(t=new Map,Mt.set(e.areas,t));let i=function(e){let t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",w(t.featureFilter),w(t.dotFilter),F(e)].join("::")}(e),o=t.get(i);if(o)return o;let r=A(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){let e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(i,r),r}(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,y(i.dotRadius)??t.cellSize*g(i.radiusRatio??.24,.05,.5)),n=i.gridOrigin?.[0]??0,a=i.gridOrigin?.[1]??0;return{nodes:t.dots.map((l,s)=>{let c=n+(l.gridColumn+.5)*t.cellSize,u=a+(l.gridRow+.5)*t.cellSize,d=b(l,i.categoryAccessor),m=b(l,i.fillAccessor),h={fill:null!=m?m+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof i.markStyle?i.markStyle(l,s):i.markStyle},p=`dot-${l.gridRow}-${l.gridColumn}`;return"circle"===o?{type:"point",x:c,y:u,r:r,style:h,datum:l,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===o?H(c,u,r):L(c,u,r),centroid:[c,u],bounds:[[c-r,u-r],[c+r,u+r]],screenArea:"hexagon"===o?3*Math.sqrt(3)*r*r/2:(2*r)**2,style:h,datum:l,group:l.featureId,interactive:!1}}),overlays:i.showOutline?St("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?St("path",{d:r,fill:"none",stroke:i.outlineStyle?.stroke??"currentColor",strokeOpacity:i.outlineStyle?.opacity??i.outlineStyle?.fillOpacity??.22,strokeWidth:i.outlineStyle?.strokeWidth??.7,strokeDasharray:i.outlineStyle?.strokeDasharray,strokeLinecap:i.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},x(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{r as ChoroplethMap,z as DEFAULT_HIT_RADIUS,bt as DistanceCartogram,at as FlowMap,T as GeoCustomChart,J as MultiLineTooltip,Ve as ProportionalSymbolMap,B as StreamGeoFrame,V as Tooltip,Y as TooltipRoot,X as composeStyleRules,W as geoAreaHitTarget,O as geoHitTarget,Rt as geographicDotGridLayout,xt as geographicGridLayout,Re as glyphExtent,je as glyphPlacement,d as gridifyGeographicPoints,Fe as hatchFillId,Pe as hatchPatternDef,D as hitTargetPoint,Le as isHatchFill,te as makeNodeRuleContext,ie as makeRuleValueResolver,oe as markTooltipChrome,re as matchesThreshold,I as mergeData,t as resolveReferenceGeography,ue as resolveResponsiveRules,de as resolveStyleRules,He as resolveSvgFill,me as responsiveRuleMatches,he as ruleMatches,A as sampleGeographicDotGrid};
2
+ function e(e){return"default"in e?e.default:e}async function t(t){let i=Be.get(t);if(i)return i;let{topology:o,objectName:r}=await async function(t){try{switch(t){case"world-110m":return{topology:e(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:e(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:e(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:e(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${t}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(e){throw/Cannot find module|Failed to resolve|world-atlas/i.test(e instanceof Error?e.message:e+"")?Error(`resolveReferenceGeography("${t}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:e}):e}}(t);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${t}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);let n=Te(o,o.objects[r]),a="features"in n?n.features:[n];return Be.set(t,a),a}function i(e){let i=De(()=>Array.isArray(e)?e:void 0,[e]),[o,r]=We(null);return Oe(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(i=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(i)){let i=!1;return r(null),t(e).then(e=>{i||r(e)}),()=>{i=!0}}var i;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),r(null)}else r(null)},[e]),void 0!==i?i:o}function o(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function r(e){let t=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),r=ve(),{areas:n,valueAccessor:a,styleRules:l,colorScheme:s,projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:f,tileURL:g,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:k,legendInteraction:w,legendPosition:S,margin:M,className:A,selection:C,linkedHover:R,onObservation:N,onClick:j,chartId:F,loading:P,loadingContent:H,emptyContent:L,frameProps:I={},stroke:z,strokeWidth:W,opacity:O}=e,D=m??!!g,T=i(n),E=Ie(()=>T&&ee(T),[T]),G=Ie(()=>"function"==typeof a?a:e=>e?.properties?.[a]??e?.[a],[a]),K=s??r??"blues",q=Ie(()=>{if(!E)return ze(Me(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(let i of E){let o=G(i);null==o||!isFinite(o)||(e>o&&(e=o),o>t&&(t=o))}let i=Me(K);return ze(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[E,G,K]),V=Ie(()=>{let e=q.domain();return[e[0]??0,e[1]??1]},[q]),Y=ye(w,G,V),{activeSelectionHook:Q,hoverSelectionHook:te,customHoverBehavior:ie,customClickBehavior:oe}=ge({selection:C,linkedHover:R,onObservation:N,onClick:j,chartType:"ChoroplethMap",chartId:F,mobileInteraction:t.mobileInteraction}),re=U(C),ne=te||Y.legendSelectionHook||Q,ue=Ie(()=>{let e=X(e=>{let t=G(e);return{fill:null!=t&&isFinite(t)?q(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},l,e=>({value:G(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=Z(e,{stroke:z,strokeWidth:W,opacity:O});return ne?ke(t,ne,re,o):t},[G,q,ne,re,x,z,W,O,l]),de=Ie(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=G(e);return Ge("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ee("div",{style:{fontWeight:600},children:t}),null!=i&&Ee("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):(o??"")+"")})]});var o},[G]),me=ce(t),he=Ie(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>q(e),domain:V,label:"string"==typeof a?a:"value"}},[q,t.showLegend,a,V]),{legend:be,margin:xe,legendPosition:we,legendMarginReserved:Se}=pe({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:S,userMargin:M,defaults:me,additionalLegend:he,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),Ae=se(P,t.width,t.height,H)||(E?null:se(!0,t.width,t.height,H)),Ce=Ae?null:le(E,t.width,t.height,L);if(Array.isArray(E)&&E.length>0){let e=E[0];if(!e||"object"!=typeof e||!e.geometry)return Ee(_,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let Re={projection:c,areas:E,areaStyle:ue,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:xe,enableHover:t.enableHover,...be&&{legend:be,legendPosition:we},...Se&&{__legendMarginReservedFor:be},legendHoverBehavior:Y.onLegendHover,legendClickBehavior:Y.onLegendClick,legendHighlightedCategory:Y.highlightedCategory,legendIsolatedCategories:"isolate"===w?Y.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?de:ae(v)||de,...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...D&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=f&&{dragRotate:f},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...$({linkedHover:R,selection:C,onObservation:N,onClick:j,mobileInteraction:t.mobileInteraction,customHoverBehavior:ie,customClickBehavior:oe,linkedHoverInClickPredicate:!1}),...k&&k.length>0&&{annotations:k},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...A&&{className:A},...null!=e.animate&&{animate:e.animate},...I};return Ae||Ce||Ee(J,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:Ee(B,{...Re})})}function n(e,t,i){let[o,r]=i;if(!t)return o;let[n,a]=t,l=a>n?a-n:0,s=Number(e),c=Number.isFinite(s)?s:n;return o+Math.max(0,Math.min(1,l>0?(c-n)/l:0))*(r-o)}function a({bottomMargin:e,costLabel:t,layout:{cx:i,cy:o,maxCost:r,availableRadius:n,layout:a},ringStyle:l,ringValues:s,showNorth:c,showRingLabels:u,showRings:d}){let m="strip"===a,h={stroke:m?"var(--semiotic-border, #999)":"#999",strokeWidth:m?1:.8,strokeDasharray:m?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:m?8:10,...l};return pt("g",m?{children:[ht("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),ht("line",{x1:i,y1:o-3.5,x2:i,y2:o+3.5,stroke:h.stroke,strokeWidth:h.strokeWidth,opacity:.9}),d&&s.map(a=>{let l=i+(r>0?a/r*n:0);return pt("g",{children:[ht("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&pt("text",{x:l,y:o+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?" "+t:""]})]},a)})]}:{children:[s.map(e=>{let a=e/r*n;return pt("g",{children:[ht("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&pt("text",{x:i+a+3,y:o-2,fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?" "+t:""]})]},e)}),c&&pt("g",{transform:"translate(24, 24)",children:[ht("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),ht("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),ht("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),ht("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),ht("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),ht("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function l(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function s(e,t,i){return Math.max(t,Math.min(i,e))}function c(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(t>o&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function u(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function d(e,t={}){let i=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===i.length)return[];let o=s(Number.isFinite(t.occupancy)?Number(t.occupancy):.72,.2,1),r=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):1.8,n=l(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=l(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));i.length>n*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(i.length/n):null!=t.rows&&null==t.columns?n=Math.ceil(i.length/a):a=Math.ceil(i.length/n));let d=c(i.map(e=>e.x)),m=c(i.map(e=>e.y)),h=i.map(e=>({...e,desiredColumn:u(e.x,d)*Math.max(0,n-1),desiredRow:u(e.y,m)*Math.max(0,a-1)})),p=(n-1)/2,f=(a-1)/2;h.sort((e,t)=>(t.desiredColumn-p)**2+(t.desiredRow-f)**2-((e.desiredColumn-p)**2+(e.desiredRow-f)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);let g=new Set;for(let e=0;a>e;e+=1)for(let t=0;n>t;t+=1)g.add(e*n+t);let y=[];for(let e of h){let t=-1,i=1/0;for(let o of g){let r=(o%n-e.desiredColumn)**2+(Math.floor(o/n)-e.desiredRow)**2;(i>r||r===i&&t>o)&&(t=o,i=r)}0>t||(g.delete(t),y.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return y.sort((e,t)=>e.index-t.index),y.map(({index:e,...t})=>t)}function m(e,t,i=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(let t of i)if(null!=e[t])return e[t]}function h(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function p(e,t,i){let o=[];for(let r=0;6>r;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return h(o)}function f({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=K();return vt("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);return vt("text",{x:e.x,y:e.y,fill:t,fontFamily:o,fontSize:i,fontWeight:r,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function g(e,t,i){return Math.max(t,Math.min(i,e))}function y(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function b(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function v(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function x(e,t){let i=v(e);return(e.id??i.id??i.name??"feature-"+t)+""}function k(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function w(e){if(!e)return 0;let t=Ct.get(e);if(t)return t;let i=Rt;return Rt+=1,Ct.set(e,i),i}function S(e,t){return!t||!(t[0][1]>e[1]||e[1]>t[1][1]||(i=e[0],o=t[0][0],r=t[1][0],o>r?o>i&&i>r:o>i||i>r));var i,o,r}function M(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&S(t,i.bounds))try{if(wt(e,t))return{feature:e,index:o}}catch{}}return null}function A(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=function(e,t){if(0===e.length)return null;let i=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(i[0][0])&&Number.isFinite(i[0][1])&&Number.isFinite(i[1][0])&&Number.isFinite(i[1][1])?i:null}(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[g(n[0][0],a,Math.max(a,i.width-a)),g(n[0][1],a,Math.max(a,i.height-a))],[g(n[1][0],a,Math.max(a,i.width-a)),g(n[1][1],a,Math.max(a,i.height-a))]],s=Math.max(0,l[1][0]-l[0][0]),c=Math.max(0,l[1][1]-l[0][1]);if(0===s||0===c)return{dots:[],cellSize:10,features:r};let u=y(o.columns),d=Math.max(2,u?s/u:y(o.cellSize)??10),m=Math.max(100,Math.round(y(o.maxSamples)??25e3)),h=Math.ceil(s/d)*Math.ceil(c/d);h>m&&(d*=Math.sqrt(h/m));let p=o.gridOrigin?.[0]??0,f=o.gridOrigin?.[1]??0,[b,w]=k(l[0][0],l[1][0],p,d),[S,A]=k(l[0][1],l[1][1],f,d),C=[],R=function(e){return e.map((e,t)=>{if(At.has(e))return{feature:e,index:t,bounds:At.get(e)??null};try{let i=kt(e);return At.set(e,i),{feature:e,index:t,bounds:i}}catch{return At.set(e,null),{feature:e,index:t,bounds:null}}})}(r);for(let e=S;A>=e;e+=1){let i=f+(e+.5)*d;for(let r=b;w>=r;r+=1){let n=t.invertedPoint(p+(r+.5)*d,i);if(!n||!Number.isFinite(n[0])||!Number.isFinite(n[1]))continue;let a=M(R,n);if(!a)continue;let l={...v(a.feature),featureId:x(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:r,longitude:n[0],latitude:n[1],dotIndex:C.length};o.dotFilter&&!o.dotFilter(l,C.length)||C.push(l)}}return{dots:C,cellSize:d,features:r}}function C(e){return Math.round(1e4*e)/1e4}function R(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${C(Number(e[0]))},${C(Number(e[1]))}`:"null"}function N(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function j(e){return"number"==typeof e&&Number.isFinite(e)?C(e)+"":null===e?"null":"unavailable"}function F(e){let t=e.scales.projection;return[j(N(t,"scale")),R(N(t,"translate")),R(N(t,"center")),(i=N(t,"rotate"),Array.isArray(i)&&i.every(Number.isFinite)?i.map(e=>C(Number(e))).join(","):"unavailable"),j(N(t,"clipAngle")),j(N(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>R(e.scales.projectedPoint(t,i)))].join("|");var i}function P(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function H(e,t,i){return P([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function L(e,t,i){return P(Array.from({length:6},(o,r)=>{let n=-Math.PI/2+r*(Math.PI/3);return[e+Math.cos(n)*i,t+Math.sin(n)*i]}))}function I(e,t,i){let{featureKey:o,dataKey:r}=i,n=new Map;for(let e of t){let t=(Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0)+"";n.set(t,e)}return e.map(e=>{let t=(e=>{let t=o.split("."),i=e;for(let e of t)i=null!==i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;return(i??"")+""})(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}import{DEFAULT_HIT_RADIUS as z,geoAreaHitTarget as W,geoHitTarget as O,hitTargetPoint as D}from"./c-HLLFJYTY.min.js";import{GeoCustomChart as T,StreamGeoFrame_default as B}from"./c-L6WNDBHV.min.js";import"./c-TX7XJM3Z.min.js";import{useChartSetup as E,useFrameImperativeHandle as G,useResolvedSelection as U}from"./c-RFC7UAG7.min.js";import"./c-ORLEBW72.min.js";import"./c-R2P4RR7Q.min.js";import"./c-N3FXLRNT.min.js";import"./c-TKG2NP7G.min.js";import"./c-MOKJOIPE.min.js";import"./c-V4XMSLC3.min.js";import"./c-KKPMHAZC.min.js";import{buildCustomBehaviorProps as $,mergeShapeStyle as Z}from"./c-SGAURYHG.min.js";import{useCustomLayoutSelection as K}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-EUBTECGM.min.js";import{ChartError as _,EMPTY_ARRAY as q,MultiLineTooltip as V,SafeRender as J,Tooltip as Y,TooltipRoot as Q,composeStyleRules as X,filterSparseArray as ee,makeNodeRuleContext as te,makeRuleValueResolver as ie,markTooltipChrome as oe,matchesThreshold as re,normalizeLinkedHover as ne,normalizeTooltip as ae,renderEmptyState as le,renderLoadingState as se,resolveAxisFreeMarginDefaults as ce,resolveResponsiveRules as ue,resolveStyleRules as de,responsiveRuleMatches as me,ruleMatches as he,useChartLegendAndMargin as pe,useChartMode as fe,useChartSelection as ge,useGradientLegendInteraction as ye,useLinkedHover as be,useThemeSequential as ve,warnMissingField as xe,wrapStyleWithSelection as ke}from"./c-ODG6TFSY.min.js";import{DEFAULT_COLOR as we,getColor as Se,getSequentialInterpolator as Me,getSize as Ae}from"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import{useObservationSelector as Ce}from"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import{getMinMax as Re}from"./c-QA3HMQJP.min.js";import{glyphExtent as Ne,glyphPlacement as je,hatchFillId as Fe,hatchPatternDef as Pe,isHatchFill as He,resolveSvgFill as Le}from"./c-MB6CV5NC.min.js";import{useMemo as Ie}from"react";import{scaleSequential as ze}from"d3-scale";import{useState as We,useEffect as Oe,useMemo as De}from"react";import{feature as Te}from"topojson-client";var Be=new Map;import{jsx as Ee,jsxs as Ge}from"react/jsx-runtime";r.displayName="ChoroplethMap";import{useMemo as Ue,useRef as $e,forwardRef as Ze}from"react";var Ke={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as _e,jsxs as qe}from"react/jsx-runtime";var Ve=[3,30],Je=[1,4],Ye=Ze(function(e,t){let o=$e(null);G(t,{variant:"geo-points",frameRef:o});let r=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,areas:S,areaStyle:M=Ke,tooltip:A,annotations:C,margin:R,className:N,selection:j,linkedHover:F,onObservation:P,onClick:H,chartId:L,loading:I,loadingContent:z,emptyContent:W,legendInteraction:O,legendPosition:D,frameProps:T={},stroke:U,strokeWidth:K,opacity:_}=e,V=c??("sparkline"===r.mode?Je:Ve),Y="sparkline"===r.mode?1.5:6,Q=g??!!x,ee=i(S),ie=E({data:n??q,rawData:n,colorBy:u,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:T,selection:j,linkedHover:F,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:P,onClick:H,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:L,showLegend:r.showLegend,userMargin:R,marginDefaults:ce(r),loading:I,loadingContent:z,emptyContent:W,width:r.width,height:r.height,hasTitle:!!r.title}),oe=ie.data,re=Ue(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=oe.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?Re(t):void 0},[oe,s]),ne=Ue(()=>{let e=X(e=>({fill:u?Se(e,u,ie.colorScale):we,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Ae(e,s,V,re):Y}),d,te(u,s)),t=Z(e,{stroke:U,strokeWidth:K,opacity:_});return ie.effectiveSelectionHook?ke(t,ie.effectiveSelectionHook,ie.resolvedSelection):t},[u,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,s,V,re,Y,U,K,_,d]),le=Ue(()=>e=>{let t=e?.name||e?.label||e?.NAME||e?.id,i="string"==typeof s?s:null,o=("function"==typeof s?s:e=>e[s])(e),r=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",n="string"==typeof u?u:null,a=n?e?.[n]:null;return qe("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&_e("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&qe("div",{children:[qe("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&qe("div",{children:[qe("span",{style:{opacity:.7},children:[n,": "]}),a+""]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>qe("div",{children:[qe("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(ie.earlyReturn)return ie.earlyReturn;xe("ProportionalSymbolMap",oe,"xAccessor",a),xe("ProportionalSymbolMap",oe,"yAccessor",l);let se={projection:h,...null!=n&&{points:oe},xAccessor:a,yAccessor:l,pointStyle:ne,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ee&&{areas:ee,areaStyle:M},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...Q&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[r.width,r.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:r.enableHover,tooltipContent:!1===A?()=>null:ae(A)||le,...ie.legendBehaviorProps,...$({linkedHover:F,selection:j,onObservation:P,onClick:H,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior,linkedHoverInClickPredicate:!1}),...C&&C.length>0&&{annotations:C},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...r.title&&{title:r.title},...r.description&&{description:r.description},...r.summary&&{summary:r.summary},...void 0!==r.accessibleTable&&{accessibleTable:r.accessibleTable},...N&&{className:N},...null!=e.animate&&{animate:e.animate},...T};return _e(J,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:_e(B,{ref:o,...se})})});Ye.displayName="ProportionalSymbolMap";import{useMemo as Qe,useCallback as Xe,useRef as et,forwardRef as tt}from"react";import{jsx as it,jsxs as ot}from"react/jsx-runtime";var rt="__semiotic_x",nt="__semiotic_y",at=tt(function(e,t){let o=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:r,nodes:a,nodeIdAccessor:l="id",xAccessor:s="lon",yAccessor:c="lat",valueAccessor:u="value",projection:d="equalEarth",graticule:m,fitPadding:h,zoomable:p,zoomExtent:f,onZoom:g,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:k="geo",flowStyle:w="basic",areas:S,areaStyle:M=Ke,edgeColorBy:A,edgeOpacity:C=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:j="round",colorScheme:F,styleRules:P,showParticles:H,particleStyle:L,tooltip:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:U,onClick:K,chartId:_,loading:V,loadingContent:Y,emptyContent:Q,frameProps:te={},legendInteraction:oe,legendPosition:re,stroke:le,strokeWidth:se,opacity:ue,lineIdAccessor:de}=e,me=p??!!b,he=i(S),pe=Qe(()=>ee(a),[a]),ge=E({data:r??q,rawData:r,colorBy:A,colorScheme:F,legendInteraction:oe,legendPosition:re,frameLegend:te,selection:D,linkedHover:T,fallbackFields:A?["string"==typeof A?A:""]:[],unwrapData:!1,onObservation:U,onClick:K,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FlowMap",chartId:_,showLegend:o.showLegend,userMargin:W,marginDefaults:ce(o),loading:V,loadingContent:Y,emptyContent:Q,width:o.width,height:o.height,hasTitle:!!o.title}),ye=ge.data,ve=ne(T),xe=be({name:ve?.name||"hover",fields:ve?.fields||[]}),Me=Ce(e=>e.pushObservation),Ae=Qe(()=>{let e=new Map;for(let t of pe)e.set(t[l]+"",t);return e},[pe,l]),Ne=et(null),je=et(Ae);je.current=Ae;let Fe=et(s);Fe.current=s;let Pe=et(c);Pe.current=c;let He=Xe(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=je.current,i=t.get(e.source+""),o=t.get(e.target+"");if(!i||!o)return null;let r="function"==typeof Fe.current?Fe.current:e=>e[Fe.current],n="function"==typeof Pe.current?Pe.current:e=>e[Pe.current];return{...e,coordinates:[{[rt]:r(i),[nt]:n(i)},{[rt]:r(o),[nt]:n(o)}]}},[]);G(t,{variant:"geo-lines",frameRef:Ne,overrides:{push:e=>{let t=He(e);t&&Ne.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=He(i);e&&t.push(e)}t.length>0&&Ne.current?.pushManyLines(t)}}});let Le=Qe(()=>{let e=new Map;for(let t of ye)!t||"object"!=typeof t||(null!=t.source&&!e.has(t.source)&&e.set(t.source,t),null!=t.target&&!e.has(t.target)&&e.set(t.target,t));return e},[ye]),Ie=Xe(e=>{if(T)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=Le.get(t[l]+"");e&&xe.onHover(e)}else xe.onHover(t)}else xe.onHover(null);if(U||Me){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:_};if(e){let i=e.data||e.datum||e;Array.isArray(i)&&(i=i[0]);let o={...t,type:"hover",datum:i||{},x:e.x??0,y:e.y??0};U&&U(o),Me&&Me(o)}else{let e={...t,type:"hover-end"};U&&U(e),Me&&Me(e)}}},[T,xe,l,Le,U,_,Me]),ze=ge.customClickBehavior,We=Qe(()=>{let e="function"==typeof s?s:e=>e[s],t="function"==typeof c?c:e=>e[c];return ye.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=Ae.get(i.source+""),r=Ae.get(i.target+"");return o&&r?{...i,coordinates:[{[rt]:e(o),[nt]:t(o)},{[rt]:e(r),[nt]:t(r)}]}:null}).filter(Boolean)},[ye,Ae,s,c]),Oe=Qe(()=>{let e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&rt in t?t[rt]:e(t)},[s]),De=Qe(()=>{let e="function"==typeof c?c:e=>e[c];return t=>null!=t&&"object"==typeof t&&nt in t?t[nt]:e(t)},[c]),Te=Qe(()=>{let e=ye.filter(e=>e&&"object"==typeof e).map(e=>Number(e[u]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return Re(e)},[ye,u]),Be=Qe(()=>function(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:a,edgeLinecap:l,styleRules:s}=e,c=ie(t);return X(e=>({stroke:r(e),strokeWidth:n(e[t],i,o),strokeLinecap:l,opacity:a,fillOpacity:0}),s,e=>({value:c(e)}))}({valueAccessor:u,valueDomain:Te,edgeWidthRange:R,resolveStroke:e=>A?Se(e,A,ge.colorScale):we,edgeOpacity:C,edgeLinecap:j,styleRules:P}),[u,Te,R,A,ge.colorScale,C,j,P]),Ee=Qe(()=>{let e=Z(Be,{stroke:le,strokeWidth:se,opacity:ue});if(!ge.effectiveSelectionHook)return e;let t={...ge.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return ke(e,ge.effectiveSelectionHook,{...ge.resolvedSelection||{},unselectedStyle:t})},[Be,ge.effectiveSelectionHook,ge.resolvedSelection,le,se,ue]),Ge=N??("sparkline"===o.mode?1.5:5),Ue=Qe(()=>Z(()=>({fill:"#333",r:Ge,fillOpacity:.8}),{stroke:le,strokeWidth:se,opacity:ue}),[Ge,le,se,ue]),$e=Qe(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)return it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:it("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[u];return ot("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[ot("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&it("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[l];return null!=t?it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:it("div",{style:{fontWeight:600},children:t})}):null},[u,l]);if(ge.earlyReturn)return ge.earlyReturn;let Ze={projection:d,...null!=r&&{lines:We},points:pe,xAccessor:Oe,yAccessor:De,lineDataAccessor:"coordinates",...null!=de&&{lineIdAccessor:de},lineType:k,flowStyle:w,lineStyle:Ee,pointStyle:Ue,...he&&{areas:he,areaStyle:M},...null!=m&&{graticule:m},...null!=h&&{fitPadding:h},...me&&{zoomable:!0},...f&&{zoomExtent:f},...g&&{onZoom:g},...null!=y&&{dragRotate:y},...H&&{showParticles:H},...L&&{particleStyle:L},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ge.margin,enableHover:o.enableHover,tooltipContent:!1===I?()=>null:ae(I)||$e,...ge.legendBehaviorProps,...$({linkedHover:T,selection:D,onObservation:U,onClick:K,mobileInteraction:ge.mobileInteraction,customHoverBehavior:Ie,customClickBehavior:ze,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...te};return it(J,{componentName:"FlowMap",width:o.width,height:o.height,children:it(B,{ref:Ne,...Ze})})});at.displayName="FlowMap";import{useMemo as lt,useRef as st,useState as ct,useEffect as ut,useCallback as dt,forwardRef as mt}from"react";import{jsx as ht,jsxs as pt}from"react/jsx-runtime";import{Fragment as ft,jsx as gt,jsxs as yt}from"react/jsx-runtime";var bt=mt(function(e,t){let i=fe(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:o,lines:r,xAccessor:n="lon",yAccessor:l="lat",nodeIdAccessor:s="id",center:c,costAccessor:u,strength:d=1,lineMode:m="straight",projection:h="mercator",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,transition:S,colorBy:M,styleRules:A,colorScheme:C,pointRadius:R,tooltip:N,showRings:j,showRingLabels:F,ringStyle:P,showNorth:H,costLabel:L,cartogramLayout:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:U,onClick:K,chartId:_,loading:q,loadingContent:V,emptyContent:Y,legendPosition:Q,frameProps:ie={},stroke:oe,strokeWidth:re,opacity:ne}=e,le="sparkline"===i.mode,se=I??(le?"strip":"radial"),ue=R??(le?1.5:5),de=j??!0,me=F??("strip"!==se&&!i.compactMode),he=H??("strip"!==se&&!le),pe=g??!!x,ge=lt(()=>ee(o),[o]),ye=E({data:ge,rawData:o,colorBy:M,colorScheme:C,legendInteraction:void 0,legendPosition:Q,frameLegend:ie,selection:D,linkedHover:T,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:U,onClick:K,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:_,showLegend:i.showLegend,userMargin:W,marginDefaults:ce(i),loading:q,loadingContent:V,emptyContent:Y,width:i.width,height:i.height,hasTitle:!!i.title}),be=lt(()=>{let e=X(e=>{let t=e?.[s],i=null!=t&&t+""==c+"";return{fill:M?Se(e,M,ye.colorScale):we,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*ue:ue}},A,te(M)),t=Z(e,{stroke:oe,strokeWidth:re,opacity:ne});return ye.effectiveSelectionHook?ke(t,ye.effectiveSelectionHook,ye.resolvedSelection):t},[M,ye.colorScale,ye.effectiveSelectionHook,ye.resolvedSelection,ue,oe,re,ne,A,c,s]),ve=lt(()=>({center:c,centerAccessor:s,costAccessor:u,strength:d,lineMode:m,layout:se}),[c,s,u,d,m,se]),Me=lt(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof l?l:e=>e[l],i=new Map;for(let e of ge)i.set(e[s]+"",e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(o.source+""),a=i.get(o.target+"");return r&&a?{...o,coordinates:[{[n]:e(r),[l]:t(r)},{[n]:e(a),[l]:t(a)}]}:null}).filter(Boolean)},[r,ge,n,l,s]),Ae=lt(()=>e=>{let t=("function"==typeof u?u:e=>e[u])(e);return yt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[gt("div",{style:{fontWeight:600},children:e[s]||e.name||e.id||"Point"}),null!=t&&yt("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[u,s]),Ce=st(null);G(t,{variant:"geo-points",frameRef:Ce});let[Re,Ne]=ct(null),je=dt(()=>{let e=Ce.current?.getCartogramLayout?.();e&&Ne(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);ut(()=>{let e=requestAnimationFrame(je);return()=>cancelAnimationFrame(e)},[je,d,c,i.width,i.height,ge,se]);let Fe=lt(()=>{if(!de||!Re)return[];let{maxCost:e}=Re;if(0>=e)return[];if(Array.isArray(de))return de.filter(t=>t>0&&e>=t);let t="number"==typeof de?de:Math.min("strip"===Re.layout?3:5,Math.max(2,Math.ceil(e/5))),i=e/t,o=[];for(let e=1;t>=e;e++)o.push(Math.round(i*e*10)/10);return o},[de,Re]),Pe=lt(()=>{if(!Re)return ie.foregroundGraphics||null;let e=gt(a,{bottomMargin:ye.margin.bottom,costLabel:L,layout:Re,ringStyle:P,ringValues:Fe,showNorth:he,showRingLabels:me,showRings:de}),t=ie.foregroundGraphics;return"function"==typeof t?i=>yt(ft,{children:[e,t(i)]}):yt(ft,{children:[e,t]})},[Re,Fe,de,me,he,L,P,ye.margin.bottom,ie.foregroundGraphics]);if(ye.earlyReturn)return ye.earlyReturn;xe("DistanceCartogram",ge,"xAccessor",n),xe("DistanceCartogram",ge,"yAccessor",l);let He={projection:h,...null!=o&&{points:ge},...Me&&{lines:Me,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:l,pointIdAccessor:s,pointStyle:be,projectionTransform:ve,...S&&{transition:{duration:S}},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...pe&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:ae(N)||Ae,...ye.legendBehaviorProps,...$({linkedHover:T,selection:D,onObservation:U,onClick:K,mobileInteraction:ye.mobileInteraction,customHoverBehavior:ye.customHoverBehavior,customClickBehavior:ye.customClickBehavior,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...ie,foregroundGraphics:Pe};return gt(J,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:gt(B,{ref:Ce,...He})})});bt.displayName="DistanceCartogram";import{jsx as vt}from"react/jsx-runtime";var xt=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?function(e){return e.areas.map((t,i)=>{let o=function(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??"area-"+t;return{...i,id:o+""}}(t,i),r=e.scales.geoPath.centroid(t),n=Number.isFinite(r[0])&&Number.isFinite(r[1])?e.scales.invertedPoint(r[0],r[1]):null;return{datum:{...o,gridLongitude:n?.[0],gridLatitude:n?.[1]},x:r[0],y:r[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=function(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(m(e,t.columnAccessor)),y:Number(m(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return i.length!==e.length?null:i.map(e=>({...e,row:e.y,column:e.x}))}(r.map(e=>e.datum),t),a=o?r:function(e){return e.points.map(t=>{let i=Number(m(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(m(t,e.config.latitudeAccessor,["lat","latitude"])),r=Number.isFinite(i)&&Number.isFinite(o)?e.scales.projectedPoint(i,o):null;return{datum:t,x:r?.[0]??NaN,y:r?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}({...e,points:r.map(e=>e.datum)}),l=n??d(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===l.length)return{nodes:[]};let g=c(l.map(e=>e.row)),y=c(l.map(e=>e.column)),b=Math.max(1,Math.round(g[1]-g[0])+1),v=Math.max(1,Math.round(y[1]-y[0])+1),x=Math.max(0,t.layoutPadding??8),k=Math.max(1,e.dimensions.width-2*x)/v,w=Math.max(1,e.dimensions.height-2*x)/b,S=(e.dimensions.width-k*v)/2,M=(e.dimensions.height-w*b)/2,A=s(t.cellPadding??.12,0,.8),C=Math.max(1,.5*Math.min(k,w)*(1-A)),R=t.sizeAccessor?l.map(e=>Number(m(e.datum,t.sizeAccessor))):[],N=t.sizeDomain??c(R),j=t.sizeRange??[.36,1],F=s(Math.min(j[0],j[1]),.05,1),P=s(Math.max(j[0],j[1]),F,1),H=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=(m(r,t.idAccessor,["id","key","name"])??"grid-"+o)+"",a=(m(r,t.labelAccessor,["abbr","code","label","name","id"])??n)+"",l=Math.max(1,t.maxLabelLength??4),c=a.length>l?a.slice(0,l):a,d=m(r,t.categoryAccessor),h=null==d?void 0:d+"",p=m(r,t.fillAccessor),f=null!=p?p+"":h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",b=t.sizeAccessor?Number(m(r,t.sizeAccessor)):NaN,v=t.sizeAccessor&&Number.isFinite(b)?Math.sqrt(s(u(b,N),0,1)):1,x=C*(F+v*(P-F)),A="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:c,category:h,row:i.row,column:i.column,x:S+(i.column-y[0]+.5)*k,y:M+(i.row-g[0]+.5)*w,radius:x,style:{fill:f,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...A}}}),L=t.shape??"circle";return{nodes:H.map(e=>{return"circle"===L?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===L?p(e.x,e.y,e.radius):(t=e.x,i=e.y,o=e.radius,h([[t-o,i-o],[t+o,i-o],[t+o,i+o],[t-o,i+o]])),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===L?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0};var t,i,o}),overlays:!1===t.showLabels?null:vt(f,{marks:H,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??s(.23*Math.min(k,w),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}};import{geoBounds as kt,geoContains as wt}from"d3-geo";import{jsx as St}from"react/jsx-runtime";var Mt=new WeakMap,At=new WeakMap,Ct=new WeakMap,Rt=1,Nt=e=>{let t=function(e){let t=Mt.get(e.areas);t||(t=new Map,Mt.set(e.areas,t));let i=function(e){let t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",w(t.featureFilter),w(t.dotFilter),F(e)].join("::")}(e),o=t.get(i);if(o)return o;let r=A(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){let e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(i,r),r}(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,y(i.dotRadius)??t.cellSize*g(i.radiusRatio??.24,.05,.5)),n=i.gridOrigin?.[0]??0,a=i.gridOrigin?.[1]??0;return{nodes:t.dots.map((l,s)=>{let c=n+(l.gridColumn+.5)*t.cellSize,u=a+(l.gridRow+.5)*t.cellSize,d=b(l,i.categoryAccessor),m=b(l,i.fillAccessor),h={fill:null!=m?m+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof i.markStyle?i.markStyle(l,s):i.markStyle},p=`dot-${l.gridRow}-${l.gridColumn}`;return"circle"===o?{type:"point",x:c,y:u,r:r,style:h,datum:l,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===o?L(c,u,r):H(c,u,r),centroid:[c,u],bounds:[[c-r,u-r],[c+r,u+r]],screenArea:"hexagon"===o?3*Math.sqrt(3)*r*r/2:(2*r)**2,style:h,datum:l,group:l.featureId,interactive:!1}}),overlays:i.showOutline?St("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?St("path",{d:r,fill:"none",stroke:i.outlineStyle?.stroke??"currentColor",strokeOpacity:i.outlineStyle?.opacity??i.outlineStyle?.fillOpacity??.22,strokeWidth:i.outlineStyle?.strokeWidth??.7,strokeDasharray:i.outlineStyle?.strokeDasharray,strokeLinecap:i.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},x(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{r as ChoroplethMap,z as DEFAULT_HIT_RADIUS,bt as DistanceCartogram,at as FlowMap,T as GeoCustomChart,V as MultiLineTooltip,Ye as ProportionalSymbolMap,B as StreamGeoFrame,Y as Tooltip,Q as TooltipRoot,X as composeStyleRules,W as geoAreaHitTarget,O as geoHitTarget,Nt as geographicDotGridLayout,xt as geographicGridLayout,Ne as glyphExtent,je as glyphPlacement,d as gridifyGeographicPoints,Fe as hatchFillId,Pe as hatchPatternDef,D as hitTargetPoint,He as isHatchFill,te as makeNodeRuleContext,ie as makeRuleValueResolver,oe as markTooltipChrome,re as matchesThreshold,I as mergeData,t as resolveReferenceGeography,ue as resolveResponsiveRules,de as resolveStyleRules,Le as resolveSvgFill,me as responsiveRuleMatches,he as ruleMatches,A as sampleGeographicDotGrid};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- function m(){J("sankey",D),J("force",Q),J("chord",A),J("tree",W),J("cluster",W),J("treemap",W),J("circlepack",W),J("partition",W),J("orbit",a)}import{useForceLayout as i}from"./c-WH2O53VI.min.js";import"./c-AFBSWT77.min.js";import{DEFAULT_HIT_RADIUS as r,networkEdgeHitTarget as o,networkHitTarget as t}from"./c-HLLFJYTY.min.js";import{ChordDiagram as c,CirclePack as n,ForceDirectedGraph as p,NetworkCustomChart as s,OrbitDiagram as j,ProcessSankey as e,SankeyDiagram as V,TreeDiagram as T,Treemap as f,chordLayoutPlugin as A,diagnoseProcessSankeyLayout as U,diagnoseProcessSankeyProps as C,explainProcessSankeyLayout as K,forceLayoutPlugin as Q,formatProcessSankeyIssue as S,hierarchyLayoutPlugin as W,inventoryAtTime as X,orbitLayoutPlugin as a,sankeyLayoutPlugin as D,toProcessSankeyTime as E,validateProcessSankey as H}from"./c-PP6VY3QU.min.js";import"./c-GXV3C3MO.min.js";import"./c-55BAJ333.min.js";import"./c-D6HAAPTX.min.js";import"./c-KCRJGUHP.min.js";import{StreamNetworkFrame_default as I,registerLayoutPlugin as J}from"./c-TIXX5CAU.min.js";import"./c-MVR3RWF3.min.js";import"./c-V4XMSLC3.min.js";import"./c-HXDKPIKR.min.js";import"./c-4FN7Q6VQ.min.js";import"./c-2N7IU2NY.min.js";import"./c-YLZIV3VS.min.js";import"./c-ITKX3RC5.min.js";import{useCustomLayoutSelection as L}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-HYW2XA4Q.min.js";import"./c-VJTDST2R.min.js";import"./c-EUBTECGM.min.js";import{MultiLineTooltip as P,Tooltip as Y,TooltipRoot as M,composeStyleRules as R,makeNodeRuleContext as F,makeRuleValueResolver as N,markTooltipChrome as O,matchesThreshold as B,resolveResponsiveRules as G,resolveStyleRules as k,responsiveRuleMatches as l,ruleMatches as u,useSelectionActions as Z}from"./c-LMGSSD2E.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{glyphExtent as b,glyphPlacement as d,hatchFillId as h,hatchPatternDef as w,isHatchFill as x,resolveSvgFill as y}from"./c-553QUDKA.min.js";export{c as ChordDiagram,n as CirclePack,r as DEFAULT_HIT_RADIUS,p as ForceDirectedGraph,P as MultiLineTooltip,s as NetworkCustomChart,j as OrbitDiagram,e as ProcessSankey,V as SankeyDiagram,I as StreamNetworkFrame,Y as Tooltip,M as TooltipRoot,T as TreeDiagram,f as Treemap,R as composeStyleRules,U as diagnoseProcessSankeyLayout,C as diagnoseProcessSankeyProps,K as explainProcessSankeyLayout,S as formatProcessSankeyIssue,b as glyphExtent,d as glyphPlacement,h as hatchFillId,w as hatchPatternDef,X as inventoryAtTime,x as isHatchFill,F as makeNodeRuleContext,N as makeRuleValueResolver,O as markTooltipChrome,B as matchesThreshold,o as networkEdgeHitTarget,t as networkHitTarget,m as registerBuiltInNetworkLayouts,G as resolveResponsiveRules,k as resolveStyleRules,y as resolveSvgFill,l as responsiveRuleMatches,u as ruleMatches,E as toProcessSankeyTime,L as useCustomLayoutSelection,i as useForceLayout,Z as useSelectionActions,H as validateProcessSankey};
2
+ function m(){P("sankey",W),P("force",Y),P("chord",f),P("tree",J),P("cluster",J),P("treemap",J),P("circlepack",J),P("partition",J),P("orbit",N)}import{useForceLayout as i}from"./c-WGHT7OCY.min.js";import"./c-AFBSWT77.min.js";import{DEFAULT_HIT_RADIUS as r,networkEdgeHitTarget as o,networkHitTarget as t}from"./c-HLLFJYTY.min.js";import{ChordDiagram as c,CirclePack as n,ForceDirectedGraph as p,NetworkCustomChart as s,OrbitDiagram as j,ProcessSankey as T,SankeyDiagram as V,TreeDiagram as e,Treemap as C,chordLayoutPlugin as f,diagnoseProcessSankeyLayout as A,diagnoseProcessSankeyProps as K,explainProcessSankeyLayout as S,forceLayoutPlugin as Y,formatProcessSankeyIssue as H,hierarchyLayoutPlugin as J,inventoryAtTime as M,orbitLayoutPlugin as N,sankeyLayoutPlugin as W,toProcessSankeyTime as a,validateProcessSankey as F}from"./c-4BRHKVKV.min.js";import"./c-GXV3C3MO.min.js";import"./c-TX7XJM3Z.min.js";import"./c-D6HAAPTX.min.js";import"./c-RFC7UAG7.min.js";import{StreamNetworkFrame_default as G,registerLayoutPlugin as P}from"./c-N5NPTJVJ.min.js";import"./c-MVR3RWF3.min.js";import"./c-V4XMSLC3.min.js";import"./c-PSKKFZNP.min.js";import"./c-KKPMHAZC.min.js";import"./c-2N7IU2NY.min.js";import"./c-YLZIV3VS.min.js";import"./c-SGAURYHG.min.js";import{useCustomLayoutSelection as U}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-HYW2XA4Q.min.js";import"./c-VJTDST2R.min.js";import"./c-EUBTECGM.min.js";import{MultiLineTooltip as E,Tooltip as L,TooltipRoot as O,composeStyleRules as R,makeNodeRuleContext as X,makeRuleValueResolver as B,markTooltipChrome as D,matchesThreshold as Z,resolveResponsiveRules as Q,resolveStyleRules as k,responsiveRuleMatches as I,ruleMatches as l,useSelectionActions as u}from"./c-ODG6TFSY.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{glyphExtent as b,glyphPlacement as d,hatchFillId as h,hatchPatternDef as w,isHatchFill as x,resolveSvgFill as y}from"./c-MB6CV5NC.min.js";export{c as ChordDiagram,n as CirclePack,r as DEFAULT_HIT_RADIUS,p as ForceDirectedGraph,E as MultiLineTooltip,s as NetworkCustomChart,j as OrbitDiagram,T as ProcessSankey,V as SankeyDiagram,G as StreamNetworkFrame,L as Tooltip,O as TooltipRoot,e as TreeDiagram,C as Treemap,R as composeStyleRules,A as diagnoseProcessSankeyLayout,K as diagnoseProcessSankeyProps,S as explainProcessSankeyLayout,H as formatProcessSankeyIssue,b as glyphExtent,d as glyphPlacement,h as hatchFillId,w as hatchPatternDef,M as inventoryAtTime,x as isHatchFill,X as makeNodeRuleContext,B as makeRuleValueResolver,D as markTooltipChrome,Z as matchesThreshold,o as networkEdgeHitTarget,t as networkHitTarget,m as registerBuiltInNetworkLayouts,Q as resolveResponsiveRules,k as resolveStyleRules,y as resolveSvgFill,I as responsiveRuleMatches,l as ruleMatches,a as toProcessSankeyTime,U as useCustomLayoutSelection,i as useForceLayout,u as useSelectionActions,F as validateProcessSankey};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{DEFAULT_HIT_RADIUS as m,hitTargetPoint as i,hitTargetRect as r}from"./c-HLLFJYTY.min.js";import{BarChart as o,BoxPlot as t,DonutChart as n,DotPlot as p,FunnelChart as s,GaugeChart as c,GroupedBarChart as j,Histogram as K,LikertChart as E,OrdinalCustomChart as T,PieChart as C,RadarChart as D,RidgelinePlot as Q,StackedBarChart as G,StreamOrdinalFrame_default as N,SwarmPlot as O,SwimlaneChart as R,ViolinPlot as U}from"./c-DY2676CR.min.js";import"./c-GNTXRXRN.min.js";import"./c-55BAJ333.min.js";import"./c-D6HAAPTX.min.js";import"./c-KCRJGUHP.min.js";import"./c-DE5Q3U2X.min.js";import"./c-DK662R77.min.js";import"./c-ROEHCIGV.min.js";import"./c-AVO3Q7T7.min.js";import"./c-BNG5ECK5.min.js";import"./c-TKG2NP7G.min.js";import"./c-OO5QLMJC.min.js";import"./c-HXDKPIKR.min.js";import"./c-4FN7Q6VQ.min.js";import"./c-2N7IU2NY.min.js";import"./c-YLZIV3VS.min.js";import"./c-ITKX3RC5.min.js";import{useCustomLayoutSelection as V}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-EUBTECGM.min.js";import{AnnotationLabel as A,MultiLineTooltip as J,Tooltip as L,TooltipRoot as H,composeStyleRules as I,estimateLabelWidth as P,makeNodeRuleContext as X,makeRuleValueResolver as Y,makeStyleRuleStyleFn as f,makeXYRuleContext as S,markTooltipChrome as a,matchesThreshold as B,resolveResponsiveRules as M,resolveStyleRules as W,responsiveRuleMatches as e,ruleMatches as F}from"./c-LMGSSD2E.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{createHatchPattern as Z,glyphExtent as d,glyphPlacement as l,hatchFillId as x,hatchPatternDef as b,isHatchFill as g,resolveSvgFill as h}from"./c-553QUDKA.min.js";export{A as AnnotationLabel,o as BarChart,t as BoxPlot,m as DEFAULT_HIT_RADIUS,n as DonutChart,p as DotPlot,s as FunnelChart,c as GaugeChart,j as GroupedBarChart,K as Histogram,E as LikertChart,J as MultiLineTooltip,T as OrdinalCustomChart,C as PieChart,D as RadarChart,Q as RidgelinePlot,G as StackedBarChart,N as StreamOrdinalFrame,O as SwarmPlot,R as SwimlaneChart,L as Tooltip,H as TooltipRoot,U as ViolinPlot,I as composeStyleRules,Z as createHatchPattern,P as estimateLabelWidth,d as glyphExtent,l as glyphPlacement,x as hatchFillId,b as hatchPatternDef,i as hitTargetPoint,r as hitTargetRect,g as isHatchFill,X as makeNodeRuleContext,Y as makeRuleValueResolver,f as makeStyleRuleStyleFn,S as makeXYRuleContext,a as markTooltipChrome,B as matchesThreshold,M as resolveResponsiveRules,W as resolveStyleRules,h as resolveSvgFill,e as responsiveRuleMatches,F as ruleMatches,V as useCustomLayoutSelection};
2
+ import{DEFAULT_HIT_RADIUS as m,hitTargetPoint as i,hitTargetRect as r}from"./c-HLLFJYTY.min.js";import{BarChart as o,BoxPlot as t,DonutChart as n,DotPlot as p,FunnelChart as s,GaugeChart as c,GroupedBarChart as j,Histogram as T,LikertChart as N,OrdinalCustomChart as K,PieChart as U,RadarChart as C,RidgelinePlot as M,StackedBarChart as P,StreamOrdinalFrame_default as A,SwarmPlot as E,SwimlaneChart as G,ViolinPlot as J}from"./c-EUMPMDCS.min.js";import"./c-GNTXRXRN.min.js";import"./c-TX7XJM3Z.min.js";import"./c-D6HAAPTX.min.js";import"./c-RFC7UAG7.min.js";import"./c-NHBL4J67.min.js";import"./c-SJMWU6UX.min.js";import"./c-C3TZLTZK.min.js";import"./c-AVO3Q7T7.min.js";import"./c-N3FXLRNT.min.js";import"./c-TKG2NP7G.min.js";import"./c-MOKJOIPE.min.js";import"./c-PSKKFZNP.min.js";import"./c-KKPMHAZC.min.js";import"./c-2N7IU2NY.min.js";import"./c-YLZIV3VS.min.js";import"./c-SGAURYHG.min.js";import{useCustomLayoutSelection as L}from"./c-YDECTEUW.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-EUBTECGM.min.js";import{AnnotationLabel as O,MultiLineTooltip as S,Tooltip as V,TooltipRoot as X,composeStyleRules as Y,estimateLabelWidth as Z,makeNodeRuleContext as F,makeRuleValueResolver as H,makeStyleRuleStyleFn as f,makeXYRuleContext as D,markTooltipChrome as R,matchesThreshold as W,resolveResponsiveRules as a,resolveStyleRules as B,responsiveRuleMatches as I,ruleMatches as Q}from"./c-ODG6TFSY.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{createHatchPattern as e,glyphExtent as d,glyphPlacement as l,hatchFillId as x,hatchPatternDef as b,isHatchFill as g,resolveSvgFill as h}from"./c-MB6CV5NC.min.js";export{O as AnnotationLabel,o as BarChart,t as BoxPlot,m as DEFAULT_HIT_RADIUS,n as DonutChart,p as DotPlot,s as FunnelChart,c as GaugeChart,j as GroupedBarChart,T as Histogram,N as LikertChart,S as MultiLineTooltip,K as OrdinalCustomChart,U as PieChart,C as RadarChart,M as RidgelinePlot,P as StackedBarChart,A as StreamOrdinalFrame,E as SwarmPlot,G as SwimlaneChart,V as Tooltip,X as TooltipRoot,J as ViolinPlot,Y as composeStyleRules,e as createHatchPattern,Z as estimateLabelWidth,d as glyphExtent,l as glyphPlacement,x as hatchFillId,b as hatchPatternDef,i as hitTargetPoint,r as hitTargetRect,g as isHatchFill,F as makeNodeRuleContext,H as makeRuleValueResolver,f as makeStyleRuleStyleFn,D as makeXYRuleContext,R as markTooltipChrome,W as matchesThreshold,a as resolveResponsiveRules,B as resolveStyleRules,h as resolveSvgFill,I as responsiveRuleMatches,Q as ruleMatches,L as useCustomLayoutSelection};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- function e(e){let{data:t,encoding:i,defaults:n={},scales:r}=e,o=Dt({data:t,encoding:i}),a=[],s=new Map,l=[],u=[],d=new Map;return o.rows.forEach((e,t)=>{let{id:o,datum:p}=e,c=Math.max(0,Vt(i.appearance?.size,p,t)??n.size??6),h=Vt(i.appearance?.shape,p,t)??n.shape??{type:"circle",radius:c},m=e.placement.x??n.x??0,f=e.placement.y??n.y??0,g=r?.x?r.x(m):m,y=r?.y?r.y(f):f,b=Vt(i.appearance?.color,p,t)??n.color,x=Vt(i.appearance?.opacity,p,t)??n.opacity,w=Vt(i.appearance?.stroke,p,t)??n.stroke,v=Vt(i.appearance?.strokeWidth,p,t)??n.strokeWidth,A=Vt(i.time?.spawnAt,p,t)??e.time.arrival,I=e.kinematics.velocityX,M=e.kinematics.velocityY,S=Vt(i.dynamics?.mass,p,t)??n.mass??1,E=Vt(i.dynamics?.friction,p,t),P=Vt(i.dynamics?.restitution,p,t),j=Vt(i.dynamics?.bodyCollisions,p,t),k={id:o,x:g,y:y,mass:S,shape:{...h},datum:p,...null!=A&&{spawnAt:A},...null!=I&&{vx:I},...null!=M&&{vy:M},...null!=E&&{friction:E},...null!=P&&{restitution:P},...null!=j&&{bodyCollisions:j}},R={...null!=b&&{fill:b},...null!=x&&{opacity:x},...null!=w&&{stroke:w},...null!=v&&{strokeWidth:v}},B={id:o,datum:p,appearance:{color:b,opacity:x,shape:h,size:c,stroke:w,strokeWidth:v},placement:{x:g,y:y,lane:e.placement.lane,space:i.placement?.space??"world"},time:{arrival:A,spawnAt:A,basis:i.time?.basis??"simulation",unit:i.time?.unit},kinematics:{velocityX:I,velocityY:M,space:i.kinematics?.space??"world"},dynamics:{bodyCollisions:j,friction:E,mass:S,restitution:P},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:k};a.push(B),s.set(o,B),l.push(k),d.set(o,R),u.push({id:o,bodyId:o,label:e.accessible.label,description:e.accessible.description,datum:p,x:g,y:y,group:e.accessible.group})}),{rows:a,byId:s,spawns:l,semanticItems:u,bodyStyle:e=>d.get(e.id)??{}}}function t(t){return i=>{let n=e({data:i.data,encoding:t.encoding,defaults:t.defaults,scales:i.scales}),r=t.extend?.(i,n)??{};return{...r,initialSpawns:n.spawns,bodyStyle:n.bodyStyle,semanticItems:[...n.semanticItems,...r.semanticItems??[]]}}}function i(e,t){let{layout:i,positiveProperties:n,negativeProperties:r,viability:o,outcome:a}=t,s=function(e){return new Map(e.gates.map(e=>[e.id,e]))}(i),l=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),u=e;for(let e of l){let t=e.gateId?s.get(e.gateId):void 0,l=e.effects??[],d={...rt(e,l),appliedAt:e.time},p=At(u,d);if(p!==u){u=p;for(let i of l){let o={event:e,gate:t,negativeProperties:r,positiveProperties:n,project:u};i.when&&!i.when(o)||(u=ye(u,i,o))}u={...u,viability:o?.(u,{negativeProperties:r,positiveProperties:n})??tt(u,n,r)},e.final&&(u={...u,outcome:e.outcome??a?.(u,{layout:i,negativeProperties:r,positiveProperties:n})??(u.viability>20?"built":"approved_not_built")})}}return u}function n(e){return e.projects.map(t=>i(t,e))}function r(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),i=new Map(t.map(e=>[e.bodyId,e])),n=new Map,r=new Map,o=e.assignmentForce??.45,a=e.returnForce??.35,s=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=new Map,d=0,p=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let i=n.get(e);if(i)return i;let o=t.find(e=>!r.has(e.id));if(!o)return null;let a={resourceId:o.id,resourceBodyId:o.bodyId,caseBodyId:e,assignedAt:d};return n.set(e,a),r.set(o.id,a),p+=1,a},release:e=>{let t=n.get(e);return!!t&&(n.delete(e),r.delete(t.resourceId),p+=1,!0)},getAssignment:e=>n.get(e),tick:e=>{d=Math.max(d,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of n)u.has(e)&&u.has(t.resourceBodyId)||(n.delete(e),r.delete(t.resourceId),p+=1)},getSnapshot:()=>({total:t.length,available:t.length-r.size,assigned:r.size,assignments:Array.from(n.values()),simulatedAt:d,metricRevision:p}),bodyForce:e=>{let t=i.get(e.body.id);if(t){let i=r.get(t.id),n=i?u.get(i.caseBodyId):void 0,s=i?o:a;return{x:((n?n.x+(l.x??0):t.home.x)-e.body.x)*s,y:((n?n.y+(l.y??0):t.home.y)-e.body.y)*s}}let d=n.get(e.body.id);if(!d||0>=s)return null;let p=u.get(d.resourceBodyId);return p?{x:(p.x-e.body.x)*s,y:(p.y-e.body.y)*s}:null}}}function o(e,t){let i="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):$t(e.datum,t.deadlineAccessor)??$t(e,t.deadlineAccessor);return Number.isFinite(Number(i))?Math.max(0,Number(i)):0}function a(e){function t(t){n.set(t.bodyId,t),a+=1,e.onStateChange?.({...t})}function i(e){let i=n.get(e);return!(!i||null!=i.completedAt||(t({...i,completedAt:r,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}let n=new Map,r=0,a=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let i=n.get(e);return!(!i||null!=i.completedAt||"unhappy"===i.state||(t({...i,state:"protected",protectedAt:r}),0))},complete:i,getCase:e=>n.get(e),tick:a=>{r=Math.max(r,a.elapsed);for(let s of a.controls.readBodies()){if(!st(s,e.bodyFilter))continue;if(!n.has(s.id)){let i=o(s,e);t({bodyId:s.id,openedAt:r,deadlineAt:r+i,state:"waiting"})}let l=n.get(s.id);l&&null==l.completedAt&&(e.completionRegionId&&a.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?i(s.id):"waiting"===l.state&&r>=l.deadlineAt&&t({...l,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(n.values()),t=t=>e.filter(e=>e.state===t).length;return{total:e.length,waiting:t("waiting"),protected:t("protected"),unhappy:t("unhappy"),resolved:t("resolved"),resolvedUnhappy:t("resolved-unhappy"),simulatedAt:r,metricRevision:a}}}}function s(e){let t=new Set,i=0,n=0,r=0,o=!1;return{id:e.id??"dependency-gate:"+e.regionId,continuous:!0,tick:a=>{i=Math.max(i,a.elapsed);let s=o;var l;l=i,o=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;let u=a.controls.readBodies(),d=new Map(u.map(e=>[e.id,e]));for(let i of u)!a.getRegionState(i.id)?.activeRegionIds.includes(e.regionId)||!st(i,e.bodyFilter)||!o&&!t.has(i.id)&&(t.add(i.id),r+=1,e.onHeld?.(i));if(o&&!s){for(let i of t){let t=d.get(i);t&&(a.controls.applyImpulse(i,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),n+=1,e.onReleased?.(t))}t.clear(),r+=1}for(let e of t)d.has(e)||(t.delete(e),r+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:o,blocked:t.size,released:n,simulatedAt:i,metricRevision:r}),bodyForce:i=>{if(o||!t.has(i.body.id))return null;let n=i.regions?.find(t=>t.id===e.regionId)?.shape;if(!n||"aabb"!==n.type)return{x:.8*-i.body.vx,y:.8*-i.body.vy};let r=e.holdForce??.4;return{x:(n.x-i.body.x)*r-.45*i.body.vx,y:(n.y-i.body.y)*r-.45*i.body.vy}}}}function l(e,t,i){return Math.max(t,Math.min(i,e))}function u(e,t,i={}){let n=i.random??Math.random,r=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],o=l(i.along??.5,.05,.95),a=i.jitterX??0,s=i.padY??20,u=r.x0+(r.x1-r.x0)*o+(2*n()-1)*a,d=Math.min(1,r.width/2),p=l(u,r.x0+d,r.x1-d),c=e.boundaryY(p,"top")+s,h=e.boundaryY(p,"bottom")-s;return{x:p,y:h>c?c+n()*Math.max(1,h-c):e.midY}}function d(e){return"bowtie"===e.shape?[{id:"incoming",role:"incoming",points:[[e.left,e.topY],[e.centerLeft,e.pinchTop],[e.centerLeft,e.pinchBottom],[e.left,e.bottomY]]},{id:"center",role:"center",points:[[e.centerLeft,e.pinchTop],[e.centerRight,e.pinchTop],[e.centerRight,e.pinchBottom],[e.centerLeft,e.pinchBottom]]},{id:"outgoing",role:"outgoing",points:[[e.centerRight,e.pinchTop],[e.right,e.topY],[e.right,e.bottomY],[e.centerRight,e.pinchBottom]]}]:[{id:"volume",role:"volume",points:[[e.left,e.topY],[e.right,"funnel"===e.shape?e.pinchTop:e.topY],[e.right,"funnel"===e.shape?e.pinchBottom:e.bottomY],[e.left,e.bottomY]]}]}function p(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function c(e,t,i,n,r){return"function"==typeof n?n(e,t,i):function(e,t){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}(e,n??r)}function h(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function m(e,t,i,n){let r=e.flatMap((e,r)=>{let o=p(c(e,r,t,i,"time")),a=p(c(e,r,t,n,"value"));return null==o||null==a?[]:[{time:h(o),value:a,index:r}]});r.sort((e,t)=>e.time-t.time||e.index-t.index);let o=[];for(let e of r){let t=o[o.length-1];t?.time===e.time?t.value=e.value:o.push({time:e.time,value:e.value})}return o}function f(e,t,i,n){if(!e.length)return null;let r=e[0],o=e[e.length-1];if(r.time>t)return"clamp"===n?r.value:null;if(t>o.time)return"clamp"===n?o.value:null;let a=function(e,t){let i=0,n=e.length;for(;n>i;){let r=i+n>>>1;t>e[r].time?i=r+1:n=r}return i}(e,t),s=e[a];if(s?.time===t)return s.value;let l=e[Math.max(0,a-1)];return"step"!==i&&s&&s.time!==l.time?l.value+(t-l.time)/(s.time-l.time)*(s.value-l.value):l.value}function g(e,t){if(1===e.length)return e[0];let i=(e.length-1)*t,n=Math.floor(i),r=Math.ceil(i);return n===r?e[n]:e[n]+(e[r]-e[n])*(i-n)}function y(e){let t=e.interpolation??"step",i=e.outsideDomain??"omit",n=function(e){let t=(e??ei).map(e=>{let t=p(e);if(null==t||0>t||t>1)throw new RangeError("physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received "+e);return h(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),r=function(e){if(Array.isArray(e)){if(e.length>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(p).filter(e=>null!=e).map(h))).sort((e,t)=>e-t)}let t=e,i=p(t.start),n=p(t.end),r=p(t.step);if(null==i||null==n||null==r||0>=r||i>n)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let o=Math.floor((n-i)/r)+1;if(o>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");let a=[],s=1e-10*Math.max(1,Math.abs(n),Math.abs(i));for(let e=0;o>e;e+=1){let t=i+e*r;if(t>n+s)break;a.push(h(Math.min(t,n)))}if((!a.length||Math.abs(a[a.length-1]-n)>s)&&a.push(h(n)),a.length>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(a)).sort((e,t)=>e-t)}(e.sampleAt),o=e.runs.map(t=>m(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:r.map(e=>{let r=o.map(n=>f(n,e,t,i)).filter(e=>null!=e).sort((e,t)=>e-t),a={};for(let e of n)a[e]=r.length?g(r,e):null;return{time:e,count:r.length,min:r.length?r[0]:null,max:r.length?r[r.length-1]:null,median:r.length?g(r,.5):null,quantiles:a}}),quantiles:n,interpolation:t,outsideDomain:i,runCount:e.runs.length}}function b(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function x(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let i=p(t);if(null==i||0>i||i>1)throw new RangeError("comparePhysicsTrace quantile selectors must be from 0 to 1; received "+t);let n=h(i);if(!Object.prototype.hasOwnProperty.call(e.quantiles,n))throw Error(`comparePhysicsTrace could not find quantile ${n} in the reference envelope`);return e.quantiles[n]??null}function w(e,t,i){return t>e?"below":e>i?"above":"inside"}function v(e,t){let i=Math.max(0,t.time-e.time);if(0>=i||null==e.value||null==e.lower||null==e.upper||null==t.value||null==t.lower||null==t.upper)return{below:0,inside:0,above:0,observed:0};let n=e.value-e.lower,r=t.value-t.lower,o=e.value-e.upper,a=t.value-t.upper,s=[0,1];for(let[e,t]of[[n,r],[o,a]])(0>e&&t>0||e>0&&0>t)&&s.push(-e/(t-e));s.sort((e,t)=>e-t);let l=0,u=0,d=0;for(let n=0;s.length-1>n;n+=1){let r=s[n],o=s[n+1];if(r>=o)continue;let a=(r+o)/2,p=(o-r)*i,c=w(e.value+(t.value-e.value)*a,e.lower+(t.lower-e.lower)*a,e.upper+(t.upper-e.upper)*a);"below"===c?l+=p:"above"===c?d+=p:u+=p}return{below:l,inside:u,above:d,observed:i}}function A(e,t,i={}){let n=i.interpolation??t.interpolation,r=i.outsideDomain??t.outsideDomain,o=m(e,i.traceId??"trace",i.timeAccessor,i.valueAccessor),a=i.lower??b(t,"lower"),s=i.upper??b(t,"upper"),l=t.points.map(e=>{let t=f(o,e.time,n,r),i=x(e,a),l=x(e,s);if(null!=i&&null!=l&&i>l)throw new RangeError("comparePhysicsTrace lower band exceeds upper band at time "+e.time);return{time:e.time,value:t,lower:i,upper:l,status:null==t||null==i||null==l?"unobserved":w(t,i,l)}}),u=0,d=0,p=0,c=0,h=null,g=0,y=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?d+=1:"above"===e.status&&(p+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),i=Math.max(0,e.lower-e.value);t>c&&(c=t,h=e.time),i>g&&(g=i,y=e.time)}let A=0,I=0,M=0,S=0;for(let e=0;l.length-1>e;e+=1){let t=l[e],i=l[e+1],r=Math.max(0,i.time-t.time);if(r>0){if("linear"===n){let e=v(t,i);A+=e.below,I+=e.inside,M+=e.above,S+=e.observed;continue}"unobserved"!==t.status&&(S+=r,"below"===t.status?A+=r:"above"===t.status?M+=r:I+=r)}}let E=l[0]?.time,P=l[l.length-1]?.time,j=null==E||null==P?0:Math.max(0,P-E);return{points:l,sampleCount:l.length,observedSamples:u+d+p,belowSamples:u,insideSamples:d,aboveSamples:p,totalDuration:j,observedDuration:S,unobservedDuration:Math.max(0,j-S),belowDuration:A,insideDuration:I,aboveDuration:M,peakExcess:c,peakExcessAt:h,peakDeficit:g,peakDeficitAt:y}}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function M(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function S(e){return!!M(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&M(e.visitsByStage)&&M(e.firstEnteredAt)&&M(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function E(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function P(e){let t=Array.from(new Set(e.bodyIds??[]));return{stages:e.stages.map(e=>({...e})),bodyIds:t,entities:Object.fromEntries(t.map(e=>[e,E(e)]))}}function j(e,t,i={}){if("region-enter"!==t.type)return e;let n=function(e,t){let i=t.stageId?.(e);if(i)return i;let n=e.region.metadata;if(n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,"stageId")){let e=n.stageId;if("string"==typeof e)return e}return e.region.id}(t,i),r=e.stages.findIndex(e=>e.id===n);if(0>r)return e;let o=i.entityId?.(t)??t.bodyId;if(!o)return e;let a=I(e.entities,o),s=S(a)?a:E(o),l=s.currentStageId?e.stages.findIndex(e=>e.id===s.currentStageId):-1,u=!s.visitedStageIds.includes(n),d=Number(t.observation.timestamp),p=Number.isFinite(d)?d:0,c=I(s.visitsByStage,n),h="number"==typeof c&&Number.isFinite(c)?c:0,m={...s,currentStageId:n,furthestStageId:r>s.furthestStageIndex?n:s.furthestStageId,furthestStageIndex:Math.max(s.furthestStageIndex,r),visitedStageIds:u?[...s.visitedStageIds,n]:s.visitedStageIds,visitsByStage:{...s.visitsByStage,[n]:h+1},firstEnteredAt:u?{...s.firstEnteredAt,[n]:p}:s.firstEnteredAt,lastEnteredAt:{...s.lastEnteredAt,[n]:p},regressionCount:l>=0&&l>r?s.regressionCount+1:s.regressionCount};return{...e,bodyIds:e.bodyIds.includes(o)?e.bodyIds:[...e.bodyIds,o],entities:{...e.entities,[o]:m}}}function k(e){let t=e.bodyIds.map(t=>{let i=I(e.entities,t);return S(i)?i:E(t)}),i=t.length,n=i;return e.stages.map((e,r)=>{let o=t.filter(e=>e.furthestStageIndex>=r).length,a=t.filter(t=>t.visitedStageIds.includes(e.id)).length,s=t.reduce((t,i)=>{let n=I(i.visitsByStage,e.id);return t+("number"==typeof n&&Number.isFinite(n)?n:0)},0),l={id:e.id,label:e.label??e.id,reached:o,entered:a,total:i,conversion:i>0?o/i:0,fromPrevious:n>0?o/n:0,dropoff:Math.max(0,n-o),visits:s,repeatVisits:Math.max(0,s-a)};return n=o,l})}function R(e){let[t,i]=e.size,n=e.flow??ii,r=null==(v=e.padding)?{top:ni,right:ni,bottom:ni,left:ni}:"number"==typeof v?{top:v,right:v,bottom:v,left:v}:{top:v.top??0,right:v.right??0,bottom:v.bottom??0,left:v.left??0},o=Math.max(.05,Math.min(1,e.channelRatio??si)),a={x:r.left,y:r.top,width:Math.max(1,t-r.left-r.right),height:Math.max(1,i-r.top-r.bottom)},s="down"===n?a.height:a.width,l=s*Math.max(0,e.chargeExtent??ri),u=s*Math.max(0,e.projectionExtent??ai),d=s*Math.max(0,e.destinationExtent??oi),p=Math.max(0,s-l-d-u),c=function(e){return"number"==typeof e?Array.from({length:Math.max(1,Math.round(e))},(e,t)=>({id:"bin-"+t,label:t+""})):0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??t+""}))}(e.destinations),h=("down"===n?a.width:a.height)/c.length,m="down"===n?(e,t)=>({x:a.x,y:a.y+e,width:a.width,height:t}):(e,t)=>({x:a.x+e,y:a.y,width:t,height:a.height}),f=m(0,l),g=m(l,p),y=l+p,b=m(y,d),x=m(y+d,u),w=c.map((e,t)=>{let i=t*h,r=h*o,s=(h-r)/2;return"down"===n?{id:e.id,label:e.label,order:t,x:a.x+i+s,y:b.y,width:r,height:b.height,centerX:a.x+(t+.5)*h,centerY:b.y+b.height/2}:{id:e.id,label:e.label,order:t,x:b.x,y:a.y+i+s,width:b.width,height:r,centerX:b.x+b.width/2,centerY:a.y+(t+.5)*h}});var v;return{width:t,height:i,flow:n,charge:f,apparatus:g,destinations:w,projection:x}}function B(e,t){return e.destinations.find(e=>e.id===t)}function N(e,t,i){let{charge:n,flow:r}=e,o=Math.max(1,i),a=(t%o+.5)/o;return"down"===r?{x:n.x+n.width*a,y:n.y+n.height/2}:{x:n.x+n.width/2,y:n.y+n.height*a}}function $(e,t={}){let i=t.thickness??4,n=t.idPrefix??"stage",{destinations:r,flow:o,width:a,height:s}=e,l=[];if(r.length>0){let t=r[0];if("down"===o){let o=t.y+t.height;l.push({id:n+"-floor",shape:{type:"segment",x1:e.charge.x,y1:o,x2:e.charge.x+e.charge.width,y2:o,thickness:i}});for(let e=1;r.length>e;e+=1){let a=r[e].centerX-(r[e].centerX-r[e-1].centerX)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:a,y1:t.y,x2:a,y2:o,thickness:i}})}}else{let o=t.x+t.width;l.push({id:n+"-floor",shape:{type:"segment",x1:o,y1:e.charge.y,x2:o,y2:e.charge.y+e.charge.height,thickness:i}});for(let e=1;r.length>e;e+=1){let a=r[e].centerY-(r[e].centerY-r[e-1].centerY)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:a,x2:o,y2:a,thickness:i}})}}}return!1!==t.walls&&l.push({id:n+"-wall-left",shape:{type:"segment",x1:1,y1:0,x2:1,y2:s,thickness:i}},{id:n+"-wall-right",shape:{type:"segment",x1:a-1,y1:0,x2:a-1,y2:s,thickness:i}}),l}function Y(e,t={}){return`${t.charge??"bodies"} enter at the ${"down"===e.flow?"top":"left"}, travel ${"down"===e.flow?"downward":"left to right"} through ${t.apparatus??"the apparatus"}, and come to rest in ${e.destinations.length} ${t.destination??"destinations"}: ${e.destinations.map(e=>e.label).join(", ")}.`}function F(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function O(e,t,i,n){let r="function"==typeof e?e(t,i):e;return Number.isFinite(r)?Number(r):n}function T(e,t,i){return F(e[t])??i}function D(e,t){return"number"==typeof e?e:e?.[t]??0}function C(e){let{band:t,idPrefix:i,plot:n,projection:r}=e,{includeBoundaryWalls:o=!0,includeInteriorWalls:a=!0,wallThickness:s=4}=t,l=function(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,i=new Set;for(let n of e.values){let r=e.scale(n);Number.isFinite(r)&&(i.add(Number(r)),i.add(Number(r)+t))}return Array.from(i).sort((e,t)=>e-t)}(t);if(2>l.length)return[];let u=o?l.length-1:l.length-2,d=[];for(let e=o?0:1;u>=e;e+=1){if(!a&&e>0&&l.length-1>e)continue;let t=l[e];d.push({id:`${i}-wall-${e}`,shape:"x"===r?{type:"aabb",x:t,y:n.y+n.height/2,width:s,height:n.height}:{type:"aabb",x:n.x+n.width/2,y:t,width:n.width,height:s}})}return d}function q(e){let{plot:t,idPrefix:i="physics-scale",bounds:n={},xBins:r,xBands:o,yBands:a}=e,s=[];if(!1!==n&&s.push(...Ce(t,{idPrefix:i,...n})),r){let{idPrefix:e,yTop:n,yBottom:o,...a}=r;s.push(...qe({...a,idPrefix:e??i+"-xbin",yTop:n??t.y,yBottom:o??t.y+t.height}))}return o&&s.push(...C({band:o,idPrefix:o.idPrefix??i+"-xband",plot:t,projection:"x"})),a&&s.push(...C({band:a,idPrefix:a.idPrefix??i+"-yband",plot:t,projection:"y"})),s}function W(e){let{plot:t,rows:i,columns:n=i+1,pegRadius:r=3,idPrefix:o="galton-peg",yStart:a=t.y+.18*t.height,yEnd:s=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:d=.04}=e,p=Math.max(0,Math.floor(i)),c=Math.max(1,Math.floor(n));if(0===p)return[];let h=p>1?(s-a)/(p-1):0,m=t.width/c,f=[];for(let e=0;p>e;e+=1){let i=l&&e%2==1?m/2:0;for(let n=0;c>n;n+=1){let s=t.x+m*(n+.5)+i;t.x+r>s||s>t.x+t.width-r||f.push({id:`${o}-${e}-${n}`,shape:{type:"aabb",x:s,y:a+e*h,width:2*r,height:2*r},restitution:u,friction:d})}}return f}function X(e,t={}){let{idPrefix:i="physics-token",radius:n=5,shape:r,mass:o,vx:a,vy:s,spawnAt:l,seed:u=1,jitter:d,datum:p}=t,c=Yt(u),h=D(d,"x"),m=D(d,"y");return e.map((e,u)=>{let d=O(t.x,e,u,T(e,"x",0)),f=O(t.y,e,u,T(e,"y",0)),g=O(n,e,u,5),y="function"==typeof r?r(e,u):r??{type:"circle",radius:g};return{id:`${i}-${e.index??u}`,x:d+(c()-.5)*h,y:f+(c()-.5)*m,vx:O(a,e,u,0),vy:O(s,e,u,0),mass:O(o,e,u,1),spawnAt:O(l,e,u,void 0),shape:y,datum:p?p(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...i}=e;return i})}function z(e,t={}){let{idPrefix:i="sediment",collider:n=!0,colliderThickness:r=1,restitution:o=.05,friction:a=.2,...s}=t,l=Nt(e,s),u=n?l.filter(e=>e.height>0).map(e=>({id:`${i}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+r/2,width:e.width,height:r},restitution:o,friction:a})):[];return{columns:l,colliders:u}}function L(e,t={}){let{timeAccessor:i="arrivalTime",timeScale:n=1,startAt:r=0,rebase:o=!0,sort:a=!0}=t,s=e.map((e,t)=>({spawn:e,time:function(e,t,i){return F("function"==typeof i?i(e,t):e[i]??e.datum?.[i])}(e,t,i)??e.spawnAt??t})),l=s.length?Math.min(...s.map(e=>e.time)):0;return{initialSpawns:s.map(({spawn:e,time:t})=>({...e,spawnAt:r+(o?t-l:t)})).sort((e,t)=>a?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:r,timeAccessor:"spawnAt",timeScale:n}}}import{BuiltInPhysicsEngineAdapter as V,ChainReactionChart as Q,CollisionSwarmChart as J,CrucibleChart as U,DEFAULT_CRUCIBLE_HEIGHT as H,DEFAULT_CRUCIBLE_OUTLETS as K,DEFAULT_CRUCIBLE_SIZE as G,DEFAULT_CRUCIBLE_WIDTH as _,EventDropChart as Z,GaltonBoardChart as ee,GauntletChart as te,GuantletChart as ie,PacketFlowChart as ne,PhysicalFlowChart as re,PhysicsCustomChart as oe,PhysicsPileChart as ae,PhysicsPipelineStore as se,PhysicsSVGOverlay as le,PhysicsSedimentAccumulator as ue,ProcessFlowChart as de,StreamPhysicsFrame as pe,StreamPhysicsFrame_default as ce,UnitPileChart as he,absorbRegion as me,aggregateRegionCounts as fe,applyCrucibleEvent as ge,applyGauntletEffect as ye,bodiesToAnnotationAnchors as be,bodyGroupSpec as xe,buildCollisionSwarmPhysics as we,buildCrucibleEvidence as ve,buildCrucibleInitialSpawns as Ae,buildCrucibleLayout as Ie,buildCruciblePhysicsConfig as Me,buildCrucibleProductEvents as Se,buildCrucibleProjection as Ee,buildCrucibleStateSpawns as Pe,buildCrucibleTerminalSpawns as je,buildEventDropPhysics as ke,buildGaltonBoardPhysics as Re,buildPhysicalFlowPhysics as Be,buildPhysicsAnnotationContext as Ne,buildPhysicsPile as $e,buildProcessFlowPhysics as Ye,calculateBlockerAmplification as Fe,capacitatedRegion as Oe,chargeGateRegion as Te,cloneCrucibleState as De,collidersFromPlotBounds as Ce,collidersFromXScaleBins as qe,compileCruciblePlan as We,compileDependencyMachine as Xe,composePhysicsControllers as ze,createCapacityQueueController as Le,createDefaultPhysicsEngineAdapter as Ve,createInitialCrucibleState as Qe,createLogicalJoin as Je,createPortalController as Ue,crucibleBondId as He,crucibleBoundaryColliders as Ke,crucibleComponentBodyId as Ge,crucibleProductBodyId as _e,crucibleProjectionRows as Ze,crucibleSemanticKey as et,defaultViability as tt,evaluateCrucibleConservation as it,evaluatePhysicsBodyBudget as nt,eventLogItem as rt,forceFieldRegion as ot,groupCompletionRows as at,matchesPhysicsBodyFilter as st,membraneRegion as lt,normalizePhysicsAnnotations as ut,physicsProcessBoundaryColliders as dt,physicsProcessGroupSemanticItems as pt,physicsProcessRegionSemanticItem as ct,physicsProcessStageSemanticItems as ht,planGauntletPropertyWork as mt,portalRegion as ft,pressureFieldRegion as gt,processChrome as yt,processLaneWalls as bt,processStageLayout as xt,processStageRegions as wt,readEventDropOccupancy as vt,recordGauntletEvent as At,regionCountsToProjectionRows as It,replaceGauntletNegative as Mt,replayCruciblePlan as St,replayStateTransitions as Et,resolveCrucibleSelector as Pt,resolveCrucibleSnapshotAt as jt,resolveCrucibleTime as kt,routeDependencyTracks as Rt,routeSurfaceRegion as Bt,sedimentHeightfield as Nt,valueAtPath as $t}from"./c-447VIMRO.min.js";import"./c-EBOQ7ER7.min.js";import{mulberry32 as Yt}from"./c-HYW2XA4Q.min.js";import"./c-VJTDST2R.min.js";import"./c-EUBTECGM.min.js";import{MultiLineTooltip as Ft,Tooltip as Ot,TooltipRoot as Tt,compileMotionEncoding as Dt,composeStyleRules as Ct,deriveMotionVector as qt,makeRuleValueResolver as Wt,markTooltipChrome as Xt,matchesThreshold as zt,opacityFromAge as Lt,resolveMotionAccessor as Vt,resolveMotionAge as Qt,resolveMotionVector as Jt,resolveStyleRules as Ut,ruleMatches as Ht}from"./c-LMGSSD2E.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{hatchFillId as Kt,hatchPatternDef as Gt,isHatchFill as _t,resolveSvgFill as Zt}from"./c-553QUDKA.min.js";var ei=[.1,.5,.9],ti=1e6,ii="down",ni=24,ri=.12,oi=.55,ai=0,si=1,li=ce;export{V as BuiltInPhysicsEngineAdapter,Q as ChainReactionChart,J as CollisionSwarmChart,U as CrucibleChart,H as DEFAULT_CRUCIBLE_HEIGHT,K as DEFAULT_CRUCIBLE_OUTLETS,G as DEFAULT_CRUCIBLE_SIZE,_ as DEFAULT_CRUCIBLE_WIDTH,Z as EventDropChart,ee as GaltonBoardChart,te as GauntletChart,ie as GuantletChart,Ft as MultiLineTooltip,ne as PacketFlowChart,re as PhysicalFlowChart,oe as PhysicsCustomChart,ae as PhysicsPileChart,se as PhysicsPipelineStore,le as PhysicsSVGOverlay,ue as PhysicsSedimentAccumulator,de as ProcessFlowChart,pe as StreamPhysicsFrame,Ot as Tooltip,Tt as TooltipRoot,he as UnitPileChart,me as absorbRegion,fe as aggregateRegionCounts,ge as applyCrucibleEvent,L as arrivalReplay,be as bodiesToAnnotationAnchors,xe as bodyGroupSpec,we as buildCollisionSwarmPhysics,ve as buildCrucibleEvidence,Ae as buildCrucibleInitialSpawns,Ie as buildCrucibleLayout,Me as buildCruciblePhysicsConfig,Se as buildCrucibleProductEvents,Ee as buildCrucibleProjection,Pe as buildCrucibleStateSpawns,je as buildCrucibleTerminalSpawns,ke as buildEventDropPhysics,Re as buildGaltonBoardPhysics,Be as buildPhysicalFlowPhysics,Ne as buildPhysicsAnnotationContext,$e as buildPhysicsPile,Ye as buildProcessFlowPhysics,Fe as calculateBlockerAmplification,Oe as capacitatedRegion,Te as chargeGateRegion,De as cloneCrucibleState,q as collidersFromScales,A as comparePhysicsTrace,We as compileCruciblePlan,Xe as compileDependencyMachine,Dt as compileMotionEncoding,e as compilePhysicsEncoding,ze as composePhysicsControllers,Ct as composeStyleRules,Le as createCapacityQueueController,Ve as createDefaultPhysicsEngineAdapter,s as createDependencyGateController,Qe as createInitialCrucibleState,Je as createLogicalJoin,t as createPhysicsEncodingLayout,Ue as createPortalController,P as createProcessJourneyLedger,a as createServiceLevelController,r as createServiceResourcePoolController,He as crucibleBondId,Ke as crucibleBoundaryColliders,Ge as crucibleComponentBodyId,_e as crucibleProductBodyId,Ze as crucibleProjectionRows,et as crucibleSemanticKey,li as default,qt as deriveMotionVector,Y as describePhysicsStageGeography,it as evaluateCrucibleConservation,nt as evaluatePhysicsBodyBudget,ot as forceFieldRegion,W as galtonPegs,at as groupCompletionRows,Kt as hatchFillId,Gt as hatchPatternDef,_t as isHatchFill,Wt as makeRuleValueResolver,Xt as markTooltipChrome,zt as matchesThreshold,lt as membraneRegion,ut as normalizePhysicsAnnotations,Lt as opacityFromAge,N as physicsChargePoint,B as physicsDestination,dt as physicsProcessBoundaryColliders,pt as physicsProcessGroupSemanticItems,ct as physicsProcessRegionSemanticItem,ht as physicsProcessStageSemanticItems,y as physicsReferenceEnvelope,$ as physicsStageColliders,R as physicsStageGeography,mt as planGauntletPropertyWork,ft as portalRegion,gt as pressureFieldRegion,yt as processChrome,k as processJourneyRows,bt as processLaneWalls,xt as processStageLayout,wt as processStageRegions,d as processVolumePolygons,vt as readEventDropOccupancy,It as regionCountsToProjectionRows,Mt as replaceGauntletNegative,St as replayCruciblePlan,Et as replayStateTransitions,Pt as resolveCrucibleSelector,jt as resolveCrucibleSnapshotAt,kt as resolveCrucibleTime,i as resolveGauntletTerminalState,n as resolveGauntletTerminalStates,Vt as resolveMotionAccessor,Qt as resolveMotionAge,Jt as resolveMotionVector,Ut as resolveStyleRules,Zt as resolveSvgFill,Rt as routeDependencyTracks,Bt as routeSurfaceRegion,Ht as ruleMatches,z as sedimentBake,Nt as sedimentHeightfield,X as spawnFromTokens,u as stageTargetInVolume,j as updateProcessJourney};
2
+ function e(e){let{data:t,encoding:i,defaults:n={},scales:r}=e,o=Ct({data:t,encoding:i}),a=[],s=new Map,l=[],u=[],d=new Map;return o.rows.forEach((e,t)=>{let{id:o,datum:p}=e,c=Math.max(0,Lt(i.appearance?.size,p,t)??n.size??6),h=Lt(i.appearance?.shape,p,t)??n.shape??{type:"circle",radius:c},m=e.placement.x??n.x??0,f=e.placement.y??n.y??0,g=r?.x?r.x(m):m,y=r?.y?r.y(f):f,b=Lt(i.appearance?.color,p,t)??n.color,x=Lt(i.appearance?.opacity,p,t)??n.opacity,w=Lt(i.appearance?.stroke,p,t)??n.stroke,v=Lt(i.appearance?.strokeWidth,p,t)??n.strokeWidth,A=Lt(i.time?.spawnAt,p,t)??e.time.arrival,I=e.kinematics.velocityX,M=e.kinematics.velocityY,S=Lt(i.dynamics?.mass,p,t)??n.mass??1,P=Lt(i.dynamics?.friction,p,t),E=Lt(i.dynamics?.restitution,p,t),j=Lt(i.dynamics?.bodyCollisions,p,t),k={id:o,x:g,y:y,mass:S,shape:{...h},datum:p,...null!=A&&{spawnAt:A},...null!=I&&{vx:I},...null!=M&&{vy:M},...null!=P&&{friction:P},...null!=E&&{restitution:E},...null!=j&&{bodyCollisions:j}},R={...null!=b&&{fill:b},...null!=x&&{opacity:x},...null!=w&&{stroke:w},...null!=v&&{strokeWidth:v}},B={id:o,datum:p,appearance:{color:b,opacity:x,shape:h,size:c,stroke:w,strokeWidth:v},placement:{x:g,y:y,lane:e.placement.lane,space:i.placement?.space??"world"},time:{arrival:A,spawnAt:A,basis:i.time?.basis??"simulation",unit:i.time?.unit},kinematics:{velocityX:I,velocityY:M,space:i.kinematics?.space??"world"},dynamics:{bodyCollisions:j,friction:P,mass:S,restitution:E},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:k};a.push(B),s.set(o,B),l.push(k),d.set(o,R),u.push({id:o,bodyId:o,label:e.accessible.label,description:e.accessible.description,datum:p,x:g,y:y,group:e.accessible.group})}),{rows:a,byId:s,spawns:l,semanticItems:u,bodyStyle:e=>d.get(e.id)??{}}}function t(t){return i=>{let n=e({data:i.data,encoding:t.encoding,defaults:t.defaults,scales:i.scales}),r=t.extend?.(i,n)??{};return{...r,initialSpawns:n.spawns,bodyStyle:n.bodyStyle,semanticItems:[...n.semanticItems,...r.semanticItems??[]]}}}function i(e,t){let{layout:i,positiveProperties:n,negativeProperties:r,viability:o,outcome:a}=t,s=function(e){return new Map(e.gates.map(e=>[e.id,e]))}(i),l=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),u=e;for(let e of l){let t=e.gateId?s.get(e.gateId):void 0,l=e.effects??[],d={...rt(e,l),appliedAt:e.time},p=At(u,d);if(p!==u){u=p;for(let i of l){let o={event:e,gate:t,negativeProperties:r,positiveProperties:n,project:u};i.when&&!i.when(o)||(u=ye(u,i,o))}u={...u,viability:o?.(u,{negativeProperties:r,positiveProperties:n})??tt(u,n,r)},e.final&&(u={...u,outcome:e.outcome??a?.(u,{layout:i,negativeProperties:r,positiveProperties:n})??(u.viability>20?"built":"approved_not_built")})}}return u}function n(e){return e.projects.map(t=>i(t,e))}function r(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),i=new Map(t.map(e=>[e.bodyId,e])),n=new Map,r=new Map,o=e.assignmentForce??.45,a=e.returnForce??.35,s=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=new Map,d=0,p=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let i=n.get(e);if(i)return i;let o=t.find(e=>!r.has(e.id));if(!o)return null;let a={resourceId:o.id,resourceBodyId:o.bodyId,caseBodyId:e,assignedAt:d};return n.set(e,a),r.set(o.id,a),p+=1,a},release:e=>{let t=n.get(e);return!!t&&(n.delete(e),r.delete(t.resourceId),p+=1,!0)},getAssignment:e=>n.get(e),tick:e=>{d=Math.max(d,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of n)u.has(e)&&u.has(t.resourceBodyId)||(n.delete(e),r.delete(t.resourceId),p+=1)},getSnapshot:()=>({total:t.length,available:t.length-r.size,assigned:r.size,assignments:Array.from(n.values()),simulatedAt:d,metricRevision:p}),bodyForce:e=>{let t=i.get(e.body.id);if(t){let i=r.get(t.id),n=i?u.get(i.caseBodyId):void 0,s=i?o:a;return{x:((n?n.x+(l.x??0):t.home.x)-e.body.x)*s,y:((n?n.y+(l.y??0):t.home.y)-e.body.y)*s}}let d=n.get(e.body.id);if(!d||0>=s)return null;let p=u.get(d.resourceBodyId);return p?{x:(p.x-e.body.x)*s,y:(p.y-e.body.y)*s}:null}}}function o(e,t){let i="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):Ft(e.datum,t.deadlineAccessor)??Ft(e,t.deadlineAccessor);return Number.isFinite(Number(i))?Math.max(0,Number(i)):0}function a(e){function t(t){n.set(t.bodyId,t),a+=1,e.onStateChange?.({...t})}function i(e){let i=n.get(e);return!(!i||null!=i.completedAt||(t({...i,completedAt:r,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}let n=new Map,r=0,a=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let i=n.get(e);return!(!i||null!=i.completedAt||"unhappy"===i.state||(t({...i,state:"protected",protectedAt:r}),0))},complete:i,getCase:e=>n.get(e),tick:a=>{r=Math.max(r,a.elapsed);for(let s of a.controls.readBodies()){if(!st(s,e.bodyFilter))continue;if(!n.has(s.id)){let i=o(s,e);t({bodyId:s.id,openedAt:r,deadlineAt:r+i,state:"waiting"})}let l=n.get(s.id);l&&null==l.completedAt&&(e.completionRegionId&&a.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?i(s.id):"waiting"===l.state&&r>=l.deadlineAt&&t({...l,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(n.values()),t=t=>e.filter(e=>e.state===t).length;return{total:e.length,waiting:t("waiting"),protected:t("protected"),unhappy:t("unhappy"),resolved:t("resolved"),resolvedUnhappy:t("resolved-unhappy"),simulatedAt:r,metricRevision:a}}}}function s(e){let t=new Set,i=0,n=0,r=0,o=!1;return{id:e.id??"dependency-gate:"+e.regionId,continuous:!0,tick:a=>{i=Math.max(i,a.elapsed);let s=o;var l;l=i,o=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;let u=a.controls.readBodies(),d=new Map(u.map(e=>[e.id,e]));for(let i of u)!a.getRegionState(i.id)?.activeRegionIds.includes(e.regionId)||!st(i,e.bodyFilter)||!o&&!t.has(i.id)&&(t.add(i.id),r+=1,e.onHeld?.(i));if(o&&!s){for(let i of t){let t=d.get(i);t&&(a.controls.applyImpulse(i,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),n+=1,e.onReleased?.(t))}t.clear(),r+=1}for(let e of t)d.has(e)||(t.delete(e),r+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:o,blocked:t.size,released:n,simulatedAt:i,metricRevision:r}),bodyForce:i=>{if(o||!t.has(i.body.id))return null;let n=i.regions?.find(t=>t.id===e.regionId)?.shape;if(!n||"aabb"!==n.type)return{x:.8*-i.body.vx,y:.8*-i.body.vy};let r=e.holdForce??.4;return{x:(n.x-i.body.x)*r-.45*i.body.vx,y:(n.y-i.body.y)*r-.45*i.body.vy}}}}function l(e,t,i){return Math.max(t,Math.min(i,e))}function u(e,t,i={}){let n=i.random??Math.random,r=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],o=l(i.along??.5,.05,.95),a=i.jitterX??0,s=i.padY??20,u=r.x0+(r.x1-r.x0)*o+(2*n()-1)*a,d=Math.min(1,r.width/2),p=l(u,r.x0+d,r.x1-d),c=e.boundaryY(p,"top")+s,h=e.boundaryY(p,"bottom")-s;return{x:p,y:h>c?c+n()*Math.max(1,h-c):e.midY}}function d(e){return"bowtie"===e.shape?[{id:"incoming",role:"incoming",points:[[e.left,e.topY],[e.centerLeft,e.pinchTop],[e.centerLeft,e.pinchBottom],[e.left,e.bottomY]]},{id:"center",role:"center",points:[[e.centerLeft,e.pinchTop],[e.centerRight,e.pinchTop],[e.centerRight,e.pinchBottom],[e.centerLeft,e.pinchBottom]]},{id:"outgoing",role:"outgoing",points:[[e.centerRight,e.pinchTop],[e.right,e.topY],[e.right,e.bottomY],[e.centerRight,e.pinchBottom]]}]:[{id:"volume",role:"volume",points:[[e.left,e.topY],[e.right,"funnel"===e.shape?e.pinchTop:e.topY],[e.right,"funnel"===e.shape?e.pinchBottom:e.bottomY],[e.left,e.bottomY]]}]}function p(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function c(e,t,i,n,r){return"function"==typeof n?n(e,t,i):function(e,t){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}(e,n??r)}function h(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function m(e,t,i,n){let r=e.flatMap((e,r)=>{let o=p(c(e,r,t,i,"time")),a=p(c(e,r,t,n,"value"));return null==o||null==a?[]:[{time:h(o),value:a,index:r}]});r.sort((e,t)=>e.time-t.time||e.index-t.index);let o=[];for(let e of r){let t=o[o.length-1];t?.time===e.time?t.value=e.value:o.push({time:e.time,value:e.value})}return o}function f(e,t,i,n){if(!e.length)return null;let r=e[0],o=e[e.length-1];if(r.time>t)return"clamp"===n?r.value:null;if(t>o.time)return"clamp"===n?o.value:null;let a=function(e,t){let i=0,n=e.length;for(;n>i;){let r=i+n>>>1;t>e[r].time?i=r+1:n=r}return i}(e,t),s=e[a];if(s?.time===t)return s.value;let l=e[Math.max(0,a-1)];return"step"!==i&&s&&s.time!==l.time?l.value+(t-l.time)/(s.time-l.time)*(s.value-l.value):l.value}function g(e,t){if(1===e.length)return e[0];let i=(e.length-1)*t,n=Math.floor(i),r=Math.ceil(i);return n===r?e[n]:e[n]+(e[r]-e[n])*(i-n)}function y(e){let t=e.interpolation??"step",i=e.outsideDomain??"omit",n=function(e){let t=(e??ei).map(e=>{let t=p(e);if(null==t||0>t||t>1)throw new RangeError("physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received "+e);return h(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),r=function(e){if(Array.isArray(e)){if(e.length>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(p).filter(e=>null!=e).map(h))).sort((e,t)=>e-t)}let t=e,i=p(t.start),n=p(t.end),r=p(t.step);if(null==i||null==n||null==r||0>=r||i>n)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let o=Math.floor((n-i)/r)+1;if(o>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");let a=[],s=1e-10*Math.max(1,Math.abs(n),Math.abs(i));for(let e=0;o>e;e+=1){let t=i+e*r;if(t>n+s)break;a.push(h(Math.min(t,n)))}if((!a.length||Math.abs(a[a.length-1]-n)>s)&&a.push(h(n)),a.length>ti)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(a)).sort((e,t)=>e-t)}(e.sampleAt),o=e.runs.map(t=>m(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:r.map(e=>{let r=o.map(n=>f(n,e,t,i)).filter(e=>null!=e).sort((e,t)=>e-t),a={};for(let e of n)a[e]=r.length?g(r,e):null;return{time:e,count:r.length,min:r.length?r[0]:null,max:r.length?r[r.length-1]:null,median:r.length?g(r,.5):null,quantiles:a}}),quantiles:n,interpolation:t,outsideDomain:i,runCount:e.runs.length}}function b(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function x(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let i=p(t);if(null==i||0>i||i>1)throw new RangeError("comparePhysicsTrace quantile selectors must be from 0 to 1; received "+t);let n=h(i);if(!Object.prototype.hasOwnProperty.call(e.quantiles,n))throw Error(`comparePhysicsTrace could not find quantile ${n} in the reference envelope`);return e.quantiles[n]??null}function w(e,t,i){return t>e?"below":e>i?"above":"inside"}function v(e,t){let i=Math.max(0,t.time-e.time);if(0>=i||null==e.value||null==e.lower||null==e.upper||null==t.value||null==t.lower||null==t.upper)return{below:0,inside:0,above:0,observed:0};let n=e.value-e.lower,r=t.value-t.lower,o=e.value-e.upper,a=t.value-t.upper,s=[0,1];for(let[e,t]of[[n,r],[o,a]])(0>e&&t>0||e>0&&0>t)&&s.push(-e/(t-e));s.sort((e,t)=>e-t);let l=0,u=0,d=0;for(let n=0;s.length-1>n;n+=1){let r=s[n],o=s[n+1];if(r>=o)continue;let a=(r+o)/2,p=(o-r)*i,c=w(e.value+(t.value-e.value)*a,e.lower+(t.lower-e.lower)*a,e.upper+(t.upper-e.upper)*a);"below"===c?l+=p:"above"===c?d+=p:u+=p}return{below:l,inside:u,above:d,observed:i}}function A(e,t,i={}){let n=i.interpolation??t.interpolation,r=i.outsideDomain??t.outsideDomain,o=m(e,i.traceId??"trace",i.timeAccessor,i.valueAccessor),a=i.lower??b(t,"lower"),s=i.upper??b(t,"upper"),l=t.points.map(e=>{let t=f(o,e.time,n,r),i=x(e,a),l=x(e,s);if(null!=i&&null!=l&&i>l)throw new RangeError("comparePhysicsTrace lower band exceeds upper band at time "+e.time);return{time:e.time,value:t,lower:i,upper:l,status:null==t||null==i||null==l?"unobserved":w(t,i,l)}}),u=0,d=0,p=0,c=0,h=null,g=0,y=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?d+=1:"above"===e.status&&(p+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),i=Math.max(0,e.lower-e.value);t>c&&(c=t,h=e.time),i>g&&(g=i,y=e.time)}let A=0,I=0,M=0,S=0;for(let e=0;l.length-1>e;e+=1){let t=l[e],i=l[e+1],r=Math.max(0,i.time-t.time);if(r>0){if("linear"===n){let e=v(t,i);A+=e.below,I+=e.inside,M+=e.above,S+=e.observed;continue}"unobserved"!==t.status&&(S+=r,"below"===t.status?A+=r:"above"===t.status?M+=r:I+=r)}}let P=l[0]?.time,E=l[l.length-1]?.time,j=null==P||null==E?0:Math.max(0,E-P);return{points:l,sampleCount:l.length,observedSamples:u+d+p,belowSamples:u,insideSamples:d,aboveSamples:p,totalDuration:j,observedDuration:S,unobservedDuration:Math.max(0,j-S),belowDuration:A,insideDuration:I,aboveDuration:M,peakExcess:c,peakExcessAt:h,peakDeficit:g,peakDeficitAt:y}}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function M(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function S(e){return!!M(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&M(e.visitsByStage)&&M(e.firstEnteredAt)&&M(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function P(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function E(e){let t=Array.from(new Set(e.bodyIds??[]));return{stages:e.stages.map(e=>({...e})),bodyIds:t,entities:Object.fromEntries(t.map(e=>[e,P(e)]))}}function j(e,t,i={}){if("region-enter"!==t.type)return e;let n=function(e,t){let i=t.stageId?.(e);if(i)return i;let n=e.region.metadata;if(n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,"stageId")){let e=n.stageId;if("string"==typeof e)return e}return e.region.id}(t,i),r=e.stages.findIndex(e=>e.id===n);if(0>r)return e;let o=i.entityId?.(t)??t.bodyId;if(!o)return e;let a=I(e.entities,o),s=S(a)?a:P(o),l=s.currentStageId?e.stages.findIndex(e=>e.id===s.currentStageId):-1,u=!s.visitedStageIds.includes(n),d=Number(t.observation.timestamp),p=Number.isFinite(d)?d:0,c=I(s.visitsByStage,n),h="number"==typeof c&&Number.isFinite(c)?c:0,m={...s,currentStageId:n,furthestStageId:r>s.furthestStageIndex?n:s.furthestStageId,furthestStageIndex:Math.max(s.furthestStageIndex,r),visitedStageIds:u?[...s.visitedStageIds,n]:s.visitedStageIds,visitsByStage:{...s.visitsByStage,[n]:h+1},firstEnteredAt:u?{...s.firstEnteredAt,[n]:p}:s.firstEnteredAt,lastEnteredAt:{...s.lastEnteredAt,[n]:p},regressionCount:l>=0&&l>r?s.regressionCount+1:s.regressionCount};return{...e,bodyIds:e.bodyIds.includes(o)?e.bodyIds:[...e.bodyIds,o],entities:{...e.entities,[o]:m}}}function k(e){let t=e.bodyIds.map(t=>{let i=I(e.entities,t);return S(i)?i:P(t)}),i=t.length,n=i;return e.stages.map((e,r)=>{let o=t.filter(e=>e.furthestStageIndex>=r).length,a=t.filter(t=>t.visitedStageIds.includes(e.id)).length,s=t.reduce((t,i)=>{let n=I(i.visitsByStage,e.id);return t+("number"==typeof n&&Number.isFinite(n)?n:0)},0),l={id:e.id,label:e.label??e.id,reached:o,entered:a,total:i,conversion:i>0?o/i:0,fromPrevious:n>0?o/n:0,dropoff:Math.max(0,n-o),visits:s,repeatVisits:Math.max(0,s-a)};return n=o,l})}function R(e){let[t,i]=e.size,n=e.flow??ii,r=null==(v=e.padding)?{top:ni,right:ni,bottom:ni,left:ni}:"number"==typeof v?{top:v,right:v,bottom:v,left:v}:{top:v.top??0,right:v.right??0,bottom:v.bottom??0,left:v.left??0},o=Math.max(.05,Math.min(1,e.channelRatio??si)),a={x:r.left,y:r.top,width:Math.max(1,t-r.left-r.right),height:Math.max(1,i-r.top-r.bottom)},s="down"===n?a.height:a.width,l=s*Math.max(0,e.chargeExtent??ri),u=s*Math.max(0,e.projectionExtent??ai),d=s*Math.max(0,e.destinationExtent??oi),p=Math.max(0,s-l-d-u),c=function(e){return"number"==typeof e?Array.from({length:Math.max(1,Math.round(e))},(e,t)=>({id:"bin-"+t,label:t+""})):0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??t+""}))}(e.destinations),h=("down"===n?a.width:a.height)/c.length,m="down"===n?(e,t)=>({x:a.x,y:a.y+e,width:a.width,height:t}):(e,t)=>({x:a.x+e,y:a.y,width:t,height:a.height}),f=m(0,l),g=m(l,p),y=l+p,b=m(y,d),x=m(y+d,u),w=c.map((e,t)=>{let i=t*h,r=h*o,s=(h-r)/2;return"down"===n?{id:e.id,label:e.label,order:t,x:a.x+i+s,y:b.y,width:r,height:b.height,centerX:a.x+(t+.5)*h,centerY:b.y+b.height/2}:{id:e.id,label:e.label,order:t,x:b.x,y:a.y+i+s,width:b.width,height:r,centerX:b.x+b.width/2,centerY:a.y+(t+.5)*h}});var v;return{width:t,height:i,flow:n,charge:f,apparatus:g,destinations:w,projection:x}}function B(e,t){return e.destinations.find(e=>e.id===t)}function N(e,t,i){let{charge:n,flow:r}=e,o=Math.max(1,i),a=(t%o+.5)/o;return"down"===r?{x:n.x+n.width*a,y:n.y+n.height/2}:{x:n.x+n.width/2,y:n.y+n.height*a}}function F(e,t={}){let i=t.thickness??4,n=t.idPrefix??"stage",{destinations:r,flow:o,width:a,height:s}=e,l=[];if(r.length>0){let t=r[0];if("down"===o){let o=t.y+t.height;l.push({id:n+"-floor",shape:{type:"segment",x1:e.charge.x,y1:o,x2:e.charge.x+e.charge.width,y2:o,thickness:i}});for(let e=1;r.length>e;e+=1){let a=r[e].centerX-(r[e].centerX-r[e-1].centerX)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:a,y1:t.y,x2:a,y2:o,thickness:i}})}}else{let o=t.x+t.width;l.push({id:n+"-floor",shape:{type:"segment",x1:o,y1:e.charge.y,x2:o,y2:e.charge.y+e.charge.height,thickness:i}});for(let e=1;r.length>e;e+=1){let a=r[e].centerY-(r[e].centerY-r[e-1].centerY)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:a,x2:o,y2:a,thickness:i}})}}}return!1!==t.walls&&l.push({id:n+"-wall-left",shape:{type:"segment",x1:1,y1:0,x2:1,y2:s,thickness:i}},{id:n+"-wall-right",shape:{type:"segment",x1:a-1,y1:0,x2:a-1,y2:s,thickness:i}}),l}function Y(e,t={}){return`${t.charge??"bodies"} enter at the ${"down"===e.flow?"top":"left"}, travel ${"down"===e.flow?"downward":"left to right"} through ${t.apparatus??"the apparatus"}, and come to rest in ${e.destinations.length} ${t.destination??"destinations"}: ${e.destinations.map(e=>e.label).join(", ")}.`}function $(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function T(e,t,i,n){let r="function"==typeof e?e(t,i):e;return Number.isFinite(r)?Number(r):n}function O(e,t,i){return $(e[t])??i}function C(e,t){return"number"==typeof e?e:e?.[t]??0}function D(e){let{band:t,idPrefix:i,plot:n,projection:r}=e,{includeBoundaryWalls:o=!0,includeInteriorWalls:a=!0,wallThickness:s=4}=t,l=function(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,i=new Set;for(let n of e.values){let r=e.scale(n);Number.isFinite(r)&&(i.add(Number(r)),i.add(Number(r)+t))}return Array.from(i).sort((e,t)=>e-t)}(t);if(2>l.length)return[];let u=o?l.length-1:l.length-2,d=[];for(let e=o?0:1;u>=e;e+=1){if(!a&&e>0&&l.length-1>e)continue;let t=l[e];d.push({id:`${i}-wall-${e}`,shape:"x"===r?{type:"aabb",x:t,y:n.y+n.height/2,width:s,height:n.height}:{type:"aabb",x:n.x+n.width/2,y:t,width:n.width,height:s}})}return d}function q(e){let{plot:t,idPrefix:i="physics-scale",bounds:n={},xBins:r,xBands:o,yBands:a}=e,s=[];if(!1!==n&&s.push(...De(t,{idPrefix:i,...n})),r){let{idPrefix:e,yTop:n,yBottom:o,...a}=r;s.push(...qe({...a,idPrefix:e??i+"-xbin",yTop:n??t.y,yBottom:o??t.y+t.height}))}return o&&s.push(...D({band:o,idPrefix:o.idPrefix??i+"-xband",plot:t,projection:"x"})),a&&s.push(...D({band:a,idPrefix:a.idPrefix??i+"-yband",plot:t,projection:"y"})),s}function W(e){let{plot:t,rows:i,columns:n=i+1,pegRadius:r=3,idPrefix:o="galton-peg",yStart:a=t.y+.18*t.height,yEnd:s=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:d=.04}=e,p=Math.max(0,Math.floor(i)),c=Math.max(1,Math.floor(n));if(0===p)return[];let h=p>1?(s-a)/(p-1):0,m=t.width/c,f=[];for(let e=0;p>e;e+=1){let i=l&&e%2==1?m/2:0;for(let n=0;c>n;n+=1){let s=t.x+m*(n+.5)+i;t.x+r>s||s>t.x+t.width-r||f.push({id:`${o}-${e}-${n}`,shape:{type:"aabb",x:s,y:a+e*h,width:2*r,height:2*r},restitution:u,friction:d})}}return f}function X(e,t={}){let{idPrefix:i="physics-token",radius:n=5,shape:r,mass:o,vx:a,vy:s,spawnAt:l,seed:u=1,jitter:d,datum:p}=t,c=Yt(u),h=C(d,"x"),m=C(d,"y");return e.map((e,u)=>{let d=T(t.x,e,u,O(e,"x",0)),f=T(t.y,e,u,O(e,"y",0)),g=T(n,e,u,5),y="function"==typeof r?r(e,u):r??{type:"circle",radius:g};return{id:`${i}-${e.index??u}`,x:d+(c()-.5)*h,y:f+(c()-.5)*m,vx:T(a,e,u,0),vy:T(s,e,u,0),mass:T(o,e,u,1),spawnAt:T(l,e,u,void 0),shape:y,datum:p?p(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...i}=e;return i})}function z(e,t={}){let{idPrefix:i="sediment",collider:n=!0,colliderThickness:r=1,restitution:o=.05,friction:a=.2,...s}=t,l=Nt(e,s),u=n?l.filter(e=>e.height>0).map(e=>({id:`${i}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+r/2,width:e.width,height:r},restitution:o,friction:a})):[];return{columns:l,colliders:u}}function V(e,t={}){let{timeAccessor:i="arrivalTime",timeScale:n=1,startAt:r=0,rebase:o=!0,sort:a=!0}=t,s=e.map((e,t)=>({spawn:e,time:function(e,t,i){return $("function"==typeof i?i(e,t):e[i]??e.datum?.[i])}(e,t,i)??e.spawnAt??t})),l=s.length?Math.min(...s.map(e=>e.time)):0;return{initialSpawns:s.map(({spawn:e,time:t})=>({...e,spawnAt:r+(o?t-l:t)})).sort((e,t)=>a?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:r,timeAccessor:"spawnAt",timeScale:n}}}import{BuiltInPhysicsEngineAdapter as L,ChainReactionChart as H,CollisionSwarmChart as J,CrucibleChart as Q,DEFAULT_CRUCIBLE_HEIGHT as U,DEFAULT_CRUCIBLE_OUTLETS as G,DEFAULT_CRUCIBLE_SIZE as K,DEFAULT_CRUCIBLE_WIDTH as Z,EventDropChart as _,GaltonBoardChart as ee,GauntletChart as te,GuantletChart as ie,PacketFlowChart as ne,PhysicalFlowChart as re,PhysicsCustomChart as oe,PhysicsPileChart as ae,PhysicsPipelineStore as se,PhysicsSVGOverlay as le,PhysicsSedimentAccumulator as ue,ProcessFlowChart as de,StreamPhysicsFrame as pe,StreamPhysicsFrame_default as ce,UnitPileChart as he,absorbRegion as me,aggregateRegionCounts as fe,applyCrucibleEvent as ge,applyGauntletEffect as ye,bodiesToAnnotationAnchors as be,bodyGroupSpec as xe,buildCollisionSwarmPhysics as we,buildCrucibleEvidence as ve,buildCrucibleInitialSpawns as Ae,buildCrucibleLayout as Ie,buildCruciblePhysicsConfig as Me,buildCrucibleProductEvents as Se,buildCrucibleProjection as Pe,buildCrucibleStateSpawns as Ee,buildCrucibleTerminalSpawns as je,buildEventDropPhysics as ke,buildGaltonBoardPhysics as Re,buildPhysicalFlowPhysics as Be,buildPhysicsAnnotationContext as Ne,buildPhysicsPile as Fe,buildProcessFlowPhysics as Ye,calculateBlockerAmplification as $e,capacitatedRegion as Te,chargeGateRegion as Oe,cloneCrucibleState as Ce,collidersFromPlotBounds as De,collidersFromXScaleBins as qe,compileCruciblePlan as We,compileDependencyMachine as Xe,composePhysicsControllers as ze,createCapacityQueueController as Ve,createDefaultPhysicsEngineAdapter as Le,createInitialCrucibleState as He,createLogicalJoin as Je,createPortalController as Qe,crucibleBondId as Ue,crucibleBoundaryColliders as Ge,crucibleComponentBodyId as Ke,crucibleProductBodyId as Ze,crucibleProjectionRows as _e,crucibleSemanticKey as et,defaultViability as tt,evaluateCrucibleConservation as it,evaluatePhysicsBodyBudget as nt,eventLogItem as rt,forceFieldRegion as ot,groupCompletionRows as at,matchesPhysicsBodyFilter as st,membraneRegion as lt,normalizePhysicsAnnotations as ut,physicsProcessBoundaryColliders as dt,physicsProcessGroupSemanticItems as pt,physicsProcessRegionSemanticItem as ct,physicsProcessStageSemanticItems as ht,planGauntletPropertyWork as mt,portalRegion as ft,pressureFieldRegion as gt,processChrome as yt,processLaneWalls as bt,processStageLayout as xt,processStageRegions as wt,readEventDropOccupancy as vt,recordGauntletEvent as At,regionCountsToProjectionRows as It,replaceGauntletNegative as Mt,replayCruciblePlan as St,replayStateTransitions as Pt,resolveCrucibleSelector as Et,resolveCrucibleSnapshotAt as jt,resolveCrucibleTime as kt,routeDependencyTracks as Rt,routeSurfaceRegion as Bt,sedimentHeightfield as Nt,valueAtPath as Ft}from"./c-ZIVPFTOC.min.js";import"./c-HP4ZFM47.min.js";import{mulberry32 as Yt}from"./c-HYW2XA4Q.min.js";import"./c-VJTDST2R.min.js";import"./c-EUBTECGM.min.js";import{MultiLineTooltip as $t,Tooltip as Tt,TooltipRoot as Ot,compileMotionEncoding as Ct,composeStyleRules as Dt,deriveMotionVector as qt,makeRuleValueResolver as Wt,markTooltipChrome as Xt,matchesThreshold as zt,opacityFromAge as Vt,resolveMotionAccessor as Lt,resolveMotionAge as Ht,resolveMotionVector as Jt,resolveStyleRules as Qt,ruleMatches as Ut}from"./c-ODG6TFSY.min.js";import"./c-CPV4N35K.min.js";import"./c-ELDWAO2V.min.js";import"./c-JUKIWTBJ.min.js";import"./c-T2V7O2LO.min.js";import"./c-QA3HMQJP.min.js";import{hatchFillId as Gt,hatchPatternDef as Kt,isHatchFill as Zt,resolveSvgFill as _t}from"./c-MB6CV5NC.min.js";var ei=[.1,.5,.9],ti=1e6,ii="down",ni=24,ri=.12,oi=.55,ai=0,si=1,li=ce;export{L as BuiltInPhysicsEngineAdapter,H as ChainReactionChart,J as CollisionSwarmChart,Q as CrucibleChart,U as DEFAULT_CRUCIBLE_HEIGHT,G as DEFAULT_CRUCIBLE_OUTLETS,K as DEFAULT_CRUCIBLE_SIZE,Z as DEFAULT_CRUCIBLE_WIDTH,_ as EventDropChart,ee as GaltonBoardChart,te as GauntletChart,ie as GuantletChart,$t as MultiLineTooltip,ne as PacketFlowChart,re as PhysicalFlowChart,oe as PhysicsCustomChart,ae as PhysicsPileChart,se as PhysicsPipelineStore,le as PhysicsSVGOverlay,ue as PhysicsSedimentAccumulator,de as ProcessFlowChart,pe as StreamPhysicsFrame,Tt as Tooltip,Ot as TooltipRoot,he as UnitPileChart,me as absorbRegion,fe as aggregateRegionCounts,ge as applyCrucibleEvent,V as arrivalReplay,be as bodiesToAnnotationAnchors,xe as bodyGroupSpec,we as buildCollisionSwarmPhysics,ve as buildCrucibleEvidence,Ae as buildCrucibleInitialSpawns,Ie as buildCrucibleLayout,Me as buildCruciblePhysicsConfig,Se as buildCrucibleProductEvents,Pe as buildCrucibleProjection,Ee as buildCrucibleStateSpawns,je as buildCrucibleTerminalSpawns,ke as buildEventDropPhysics,Re as buildGaltonBoardPhysics,Be as buildPhysicalFlowPhysics,Ne as buildPhysicsAnnotationContext,Fe as buildPhysicsPile,Ye as buildProcessFlowPhysics,$e as calculateBlockerAmplification,Te as capacitatedRegion,Oe as chargeGateRegion,Ce as cloneCrucibleState,q as collidersFromScales,A as comparePhysicsTrace,We as compileCruciblePlan,Xe as compileDependencyMachine,Ct as compileMotionEncoding,e as compilePhysicsEncoding,ze as composePhysicsControllers,Dt as composeStyleRules,Ve as createCapacityQueueController,Le as createDefaultPhysicsEngineAdapter,s as createDependencyGateController,He as createInitialCrucibleState,Je as createLogicalJoin,t as createPhysicsEncodingLayout,Qe as createPortalController,E as createProcessJourneyLedger,a as createServiceLevelController,r as createServiceResourcePoolController,Ue as crucibleBondId,Ge as crucibleBoundaryColliders,Ke as crucibleComponentBodyId,Ze as crucibleProductBodyId,_e as crucibleProjectionRows,et as crucibleSemanticKey,li as default,qt as deriveMotionVector,Y as describePhysicsStageGeography,it as evaluateCrucibleConservation,nt as evaluatePhysicsBodyBudget,ot as forceFieldRegion,W as galtonPegs,at as groupCompletionRows,Gt as hatchFillId,Kt as hatchPatternDef,Zt as isHatchFill,Wt as makeRuleValueResolver,Xt as markTooltipChrome,zt as matchesThreshold,lt as membraneRegion,ut as normalizePhysicsAnnotations,Vt as opacityFromAge,N as physicsChargePoint,B as physicsDestination,dt as physicsProcessBoundaryColliders,pt as physicsProcessGroupSemanticItems,ct as physicsProcessRegionSemanticItem,ht as physicsProcessStageSemanticItems,y as physicsReferenceEnvelope,F as physicsStageColliders,R as physicsStageGeography,mt as planGauntletPropertyWork,ft as portalRegion,gt as pressureFieldRegion,yt as processChrome,k as processJourneyRows,bt as processLaneWalls,xt as processStageLayout,wt as processStageRegions,d as processVolumePolygons,vt as readEventDropOccupancy,It as regionCountsToProjectionRows,Mt as replaceGauntletNegative,St as replayCruciblePlan,Pt as replayStateTransitions,Et as resolveCrucibleSelector,jt as resolveCrucibleSnapshotAt,kt as resolveCrucibleTime,i as resolveGauntletTerminalState,n as resolveGauntletTerminalStates,Lt as resolveMotionAccessor,Ht as resolveMotionAge,Jt as resolveMotionVector,Qt as resolveStyleRules,_t as resolveSvgFill,Rt as routeDependencyTracks,Bt as routeSurfaceRegion,Ut as ruleMatches,z as sedimentBake,Nt as sedimentHeightfield,X as spawnFromTokens,u as stageTargetInVolume,j as updateProcessJourney};
@@ -1 +1 @@
1
- function e(e){return"number"==typeof e&&Number.isFinite(e)}function t(t){if(!Array.isArray(t))return null;let r=[];for(let i of t){if(!Array.isArray(i)||!e(i[0])||!e(i[1]))return null;r.push([i[0],i[1]])}return r}function r(r){if(r.style?.icon||r.fillGradient||r.strokeGradient||r.colorThresholds||r.clipRect)return null;if("rect"===r.type&&e(r.x)&&e(r.y)&&e(r.w)&&e(r.h))return{kind:"rectangle",x:r.x,y:r.y,width:r.w,height:r.h};if("point"===r.type&&e(r.x)&&e(r.y)&&e(r.r))return{kind:"circle",x:r.x,y:r.y,diameter:2*r.r};if("circle"===r.type&&e(r.cx)&&e(r.cy)&&e(r.r))return{kind:"circle",x:r.cx,y:r.cy,diameter:2*r.r};if("line"===r.type){let i=t(r.path);if(i&&i.length>=2&&!r._decayOpacities)return{kind:"linearPath",points:i};if(e(r.x1)&&e(r.y1)&&e(r.x2)&&e(r.y2))return{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2}}if("area"===r.type){let e=t(r.topPath),i=t(r.bottomPath);if(e&&i&&e.length>1&&i.length>1&&!r._decayOpacities)return{kind:"polygon",points:[...e,...i.slice().reverse()]}}if("geoarea"===r.type&&"string"==typeof r.pathData&&r.pathData)return{kind:"path",d:r.pathData};if(("bezier"===r.type||"ribbon"===r.type||"curved"===r.type)&&"string"==typeof r.pathD&&r.pathD)return{kind:"path",d:r.pathD};if("trapezoid"===r.type){let e=t(r.points);if(e&&e.length>=3)return{kind:"polygon",points:e}}if("connector"===r.type&&e(r.x1)&&e(r.y1)&&e(r.x2)&&e(r.y2))return{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2};if("violin"===r.type&&"string"==typeof r.pathString&&e(r.translateX)&&e(r.translateY))return{kind:"path",d:r.pathString,transform:{x:r.translateX,y:r.translateY}};if("symbol"===r.type&&"string"==typeof r.path){let t=e(r.x)?r.x:r.cx,i=e(r.y)?r.y:r.cy;if(e(t)&&e(i))return{kind:"path",d:r.path,transform:{x:t,y:i,rotation:e(r.rotation)?r.rotation:void 0}}}return"arc"===r.type&&e(r.cx)&&e(r.cy)&&e(r.outerR)&&e(r.startAngle)&&e(r.endAngle)?{kind:"arc",x:r.cx,y:r.cy,width:2*r.outerR,height:2*r.outerR,start:r.startAngle,stop:r.endAngle,closed:!0}:null}function i(e,t=new WeakSet){if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("object"!=typeof e)return e+"";if(t.has(e))return"[Circular]";if(t.add(e),Array.isArray(e))return e.map(e=>i(e,t));let r=e;return Object.fromEntries(Object.keys(r).sort().map(e=>[e,i(r[e],t)]))}function n(e){return JSON.stringify(i(e))??e+""}function a(e){let t="string"==typeof e?e:n(e),r=2166136261;for(let e=0;t.length>e;e+=1)r^=t.charCodeAt(e),r=Math.imul(r,16777619);return(r>>>0)%d+1}function l(e){let t=e.datum&&"object"==typeof e.datum?e.datum:void 0;return e._transitionKey??e.pointId??e.id??e.category??e.group??t?.id??t?.key??t?.name??null}function o(e){return{fill:"string"==typeof e.fill?e.fill:e.fill?"[CanvasPattern]":void 0,fillOpacity:e.fillOpacity,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap}}function s(e){if(!e)return;let t=e.split(/[\s,]+/).map(Number).filter(Number.isFinite);return t.length?t:void 0}function f(e,t,r){switch(t.kind){case"rectangle":return e.rectangle(t.x,t.y,t.width,t.height,r);case"circle":return e.circle(t.x,t.y,t.diameter,r);case"line":return e.line(t.x1,t.y1,t.x2,t.y2,r);case"linearPath":return e.linearPath(t.points,r);case"polygon":return e.polygon(t.points,r);case"path":return e.path(t.d,r);case"arc":return e.arc(t.x,t.y,t.width,t.height,t.start,t.stop,t.closed,r)}}function c(e,t,r){e.beginPath();for(let i of t.ops){let t="number"!=typeof r||0>r?i.data:i.data.map(e=>+e.toFixed(r));"move"===i.op?e.moveTo(t[0],t[1]):"lineTo"===i.op?e.lineTo(t[0],t[1]):"bcurveTo"===i.op&&e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}function p(t={}){function i(e,t){let i=r(e);return n({backend:"roughjs",identity:l(e),type:e.type,geometry:i,style:o(t),options:x,seed:g})}function p(e,t,o){let c=r(e);if(!c)return null;let p=function(e,t){if(t.fill&&"string"!=typeof t.fill||"string"==typeof t.fill&&t.fill.startsWith("url("))return null;let r="string"==typeof t.fill&&"none"!==t.fill?t.fill:void 0,i=t.stroke&&"none"!==t.stroke?t.stroke:void 0;switch(e.type){case"line":case"connector":case"curved":return{stroke:i??"#007bff"};case"bezier":case"ribbon":return{fill:r??"#999999",stroke:i??"none"};case"geoarea":return{fill:r??"#e0e0e0",stroke:i??"none"};case"point":case"circle":case"rect":case"area":case"trapezoid":case"violin":case"arc":return{fill:r??"#4e79a7",stroke:i??"none"};case"symbol":return{fill:r,stroke:i??(r?"none":"#4e79a7")};default:return{fill:r,stroke:i??"#007bff"}}}(e,t);if(!p)return null;let h=o?{fill:p.fill?u(o,p.fill)||p.fill:void 0,stroke:u(o,p.stroke)||p.stroke}:p,y=`${i(e,t)}:${n(h)}`,d=v.get(y);if(d)return v.delete(y),v.set(y,d),d;let x=a(`${g}:${l(e)??n(c)}`),D={...m,seed:x,fill:h.fill,stroke:h.stroke,strokeWidth:t.strokeWidth??1,strokeLineDash:s(t.strokeDasharray)},O={drawable:f(b,c,D),geometry:c,style:t};for(v.set(y,O);v.size>k;){let e=v.keys().next().value;if(void 0===e)break;v.delete(e)}return O}let g=function(t){return e(t)&&Math.trunc(Math.abs(t))%d||1}(t.seed),k=e(t.cacheSize)?Math.max(1,Math.trunc(t.cacheSize)):1e3,m=Object.fromEntries(Object.entries({roughness:t.roughness,bowing:t.bowing,maxRandomnessOffset:t.maxRandomnessOffset,curveFitting:t.curveFitting,curveTightness:t.curveTightness,curveStepCount:t.curveStepCount,fillStyle:t.fillStyle,fillWeight:t.fillWeight,hachureAngle:t.hachureAngle,hachureGap:t.hachureGap,dashOffset:t.dashOffset,dashGap:t.dashGap,zigzagOffset:t.zigzagOffset,disableMultiStroke:t.disableMultiStroke,disableMultiStrokeFill:t.disableMultiStrokeFill,preserveVertices:t.preserveVertices,simplification:t.simplification,fixedDecimalPlaceDigits:t.fixedDecimalPlaceDigits}).filter(([,e])=>void 0!==e)),x=n({...m,seed:g}),b=h.generator(),v=new Map;return{id:"roughjs",seed:g,cacheKey:i,drawCanvas({context:e,node:t,style:r}){let i=p(t,r,e);return!!i&&(function(e,t){let{drawable:r,geometry:i,style:n}=t,a=r.options,l=e.globalAlpha,o="path"===i.kind?i.transform:void 0;o&&(e.translate(o.x,o.y),o.rotation&&e.rotate(o.rotation));for(let t of r.sets){if(e.save(),"path"===t.type)e.strokeStyle="none"===a.stroke?"transparent":a.stroke,e.lineWidth=a.strokeWidth,e.globalAlpha=l*(n.opacity??1),a.strokeLineDash&&e.setLineDash(a.strokeLineDash),a.strokeLineDashOffset&&(e.lineDashOffset=a.strokeLineDashOffset),c(e,t,a.fixedDecimalPlaceDigits),e.stroke();else if("fillPath"===t.type)e.fillStyle=a.fill??"transparent",e.globalAlpha=l*(n.opacity??1)*(n.fillOpacity??1),c(e,t,a.fixedDecimalPlaceDigits),e.fill("curve"===r.shape||"polygon"===r.shape||"path"===r.shape?"evenodd":"nonzero");else{let r=0>a.fillWeight?a.strokeWidth/2:a.fillWeight;e.strokeStyle=a.fill??"transparent",e.lineWidth=r,e.globalAlpha=l*(n.opacity??1)*(n.fillOpacity??1),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),c(e,t,a.fixedDecimalPlaceDigits),e.stroke()}e.restore()}}(e,i),!0)},renderStaticSVG({node:e,style:t,key:r}){let i=p(e,t);if(!i)return null;let n="path"===i.geometry.kind?i.geometry.transform:void 0,a=b.toPaths(i.drawable).map((e,i)=>y("path",{d:e.d,fill:e.fill??"none",fillOpacity:e.fill&&"none"!==e.fill?t.fillOpacity:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:t.opacity,strokeLinecap:t.strokeLinecap,strokeDasharray:t.strokeDasharray},`${r}-path-${i}`));return y("g",{"data-semiotic-render-backend":"roughjs",transform:n?`translate(${n.x} ${n.y})${n.rotation?` rotate(${180*n.rotation/Math.PI})`:""}`:void 0,children:a},r)},clearCache(){v.clear()},get cacheEntries(){return v.size}}}import{resolveCSSColor as u}from"./c-OOVX2JPQ.min.js";import h from"roughjs";import{jsx as y}from"react/jsx-runtime";var d=2147483647;export{p as createRoughRenderMode,a as stableRoughSeed};
1
+ function e(e){return"number"==typeof e&&Number.isFinite(e)}function t(t){if(!Array.isArray(t))return null;let r=[];for(let i of t){if(!Array.isArray(i)||!e(i[0])||!e(i[1]))return null;r.push([i[0],i[1]])}return r}function r(r){if(r.style?.icon||r.fillGradient||r.strokeGradient||r.colorThresholds||r.clipRect)return null;if("rect"===r.type&&e(r.x)&&e(r.y)&&e(r.w)&&e(r.h))return{kind:"rectangle",x:r.x,y:r.y,width:r.w,height:r.h};if("point"===r.type&&e(r.x)&&e(r.y)&&e(r.r))return{kind:"circle",x:r.x,y:r.y,diameter:2*r.r};if("circle"===r.type&&e(r.cx)&&e(r.cy)&&e(r.r))return{kind:"circle",x:r.cx,y:r.cy,diameter:2*r.r};if("line"===r.type){let i=t(r.path);if(i&&i.length>=2&&!r._decayOpacities)return{kind:"linearPath",points:i};if(e(r.x1)&&e(r.y1)&&e(r.x2)&&e(r.y2))return{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2}}if("area"===r.type){let e=t(r.topPath),i=t(r.bottomPath);if(e&&i&&e.length>1&&i.length>1&&!r._decayOpacities)return{kind:"polygon",points:[...e,...i.slice().reverse()]}}if("geoarea"===r.type&&"string"==typeof r.pathData&&r.pathData)return{kind:"path",d:r.pathData};if(("bezier"===r.type||"ribbon"===r.type||"curved"===r.type)&&"string"==typeof r.pathD&&r.pathD)return{kind:"path",d:r.pathD};if("trapezoid"===r.type){let e=t(r.points);if(e&&e.length>=3)return{kind:"polygon",points:e}}if("connector"===r.type&&e(r.x1)&&e(r.y1)&&e(r.x2)&&e(r.y2))return{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2};if("violin"===r.type&&"string"==typeof r.pathString&&e(r.translateX)&&e(r.translateY))return{kind:"path",d:r.pathString,transform:{x:r.translateX,y:r.translateY}};if("symbol"===r.type&&"string"==typeof r.path){let t=e(r.x)?r.x:r.cx,i=e(r.y)?r.y:r.cy;if(e(t)&&e(i))return{kind:"path",d:r.path,transform:{x:t,y:i,rotation:e(r.rotation)?r.rotation:void 0}}}return"arc"===r.type&&e(r.cx)&&e(r.cy)&&e(r.outerR)&&e(r.startAngle)&&e(r.endAngle)?{kind:"arc",x:r.cx,y:r.cy,width:2*r.outerR,height:2*r.outerR,start:r.startAngle,stop:r.endAngle,closed:!0}:null}function i(e,t=new WeakSet){if(null==e||"string"==typeof e||"boolean"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:e+"";if("object"!=typeof e)return e+"";if(t.has(e))return"[Circular]";if(t.add(e),Array.isArray(e))return e.map(e=>i(e,t));let r=e;return Object.fromEntries(Object.keys(r).sort().map(e=>[e,i(r[e],t)]))}function n(e){return JSON.stringify(i(e))??e+""}function a(e){let t="string"==typeof e?e:n(e),r=2166136261;for(let e=0;t.length>e;e+=1)r^=t.charCodeAt(e),r=Math.imul(r,16777619);return(r>>>0)%d+1}function l(e){let t=e.datum&&"object"==typeof e.datum?e.datum:void 0;return e._transitionKey??e.pointId??e.id??e.category??e.group??t?.id??t?.key??t?.name??null}function o(e){return{fill:"string"==typeof e.fill?e.fill:e.fill?"[CanvasPattern]":void 0,fillOpacity:e.fillOpacity,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap}}function s(e){if(!e)return;let t=e.split(/[\s,]+/).map(Number).filter(Number.isFinite);return t.length?t:void 0}function f(e,t,r){switch(t.kind){case"rectangle":return e.rectangle(t.x,t.y,t.width,t.height,r);case"circle":return e.circle(t.x,t.y,t.diameter,r);case"line":return e.line(t.x1,t.y1,t.x2,t.y2,r);case"linearPath":return e.linearPath(t.points,r);case"polygon":return e.polygon(t.points,r);case"path":return e.path(t.d,r);case"arc":return e.arc(t.x,t.y,t.width,t.height,t.start,t.stop,t.closed,r)}}function c(e,t,r){e.beginPath();for(let i of t.ops){let t="number"!=typeof r||0>r?i.data:i.data.map(e=>+e.toFixed(r));"move"===i.op?e.moveTo(t[0],t[1]):"lineTo"===i.op?e.lineTo(t[0],t[1]):"bcurveTo"===i.op&&e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}function p(t={}){function i(e,t){let i=r(e);return n({backend:"roughjs",identity:l(e),type:e.type,geometry:i,style:o(t),options:x,seed:g})}function p(e,t,o){let c=r(e);if(!c)return null;let p=function(e,t){if(t.fill&&"string"!=typeof t.fill||"string"==typeof t.fill&&t.fill.startsWith("url("))return null;let r="string"==typeof t.fill&&"none"!==t.fill?t.fill:void 0,i=t.stroke&&"none"!==t.stroke?t.stroke:void 0;switch(e.type){case"line":case"connector":case"curved":return{stroke:i??"#007bff"};case"bezier":case"ribbon":return{fill:r??"#999999",stroke:i??"none"};case"geoarea":return{fill:r??"#e0e0e0",stroke:i??"none"};case"point":case"circle":case"rect":case"area":case"trapezoid":case"violin":case"arc":return{fill:r??"#4e79a7",stroke:i??"none"};case"symbol":return{fill:r,stroke:i??(r?"none":"#4e79a7")};default:return{fill:r,stroke:i??"#007bff"}}}(e,t);if(!p)return null;let h=o?{fill:p.fill?u(o,p.fill)||p.fill:void 0,stroke:u(o,p.stroke)||p.stroke}:p,y=`${i(e,t)}:${n(h)}`,d=v.get(y);if(d)return v.delete(y),v.set(y,d),d;let x=a(`${g}:${l(e)??n(c)}`),D={...m,seed:x,fill:h.fill,stroke:h.stroke,strokeWidth:t.strokeWidth??1,strokeLineDash:s(t.strokeDasharray)},O={drawable:f(b,c,D),geometry:c,style:t};for(v.set(y,O);v.size>k;){let e=v.keys().next().value;if(void 0===e)break;v.delete(e)}return O}let g=function(t){return e(t)&&Math.trunc(Math.abs(t))%d||1}(t.seed),k=e(t.cacheSize)?Math.max(1,Math.trunc(t.cacheSize)):1e3,m=Object.fromEntries(Object.entries({roughness:t.roughness,bowing:t.bowing,maxRandomnessOffset:t.maxRandomnessOffset,curveFitting:t.curveFitting,curveTightness:t.curveTightness,curveStepCount:t.curveStepCount,fillStyle:t.fillStyle,fillWeight:t.fillWeight,hachureAngle:t.hachureAngle,hachureGap:t.hachureGap,dashOffset:t.dashOffset,dashGap:t.dashGap,zigzagOffset:t.zigzagOffset,disableMultiStroke:t.disableMultiStroke,disableMultiStrokeFill:t.disableMultiStrokeFill,preserveVertices:t.preserveVertices,simplification:t.simplification,fixedDecimalPlaceDigits:t.fixedDecimalPlaceDigits}).filter(([,e])=>void 0!==e)),x=n({...m,seed:g}),b=h.generator(),v=new Map;return{id:"roughjs",seed:g,cacheKey:i,drawCanvas({context:e,node:t,style:r}){let i=p(t,r,e);return!!i&&(function(e,t){let{drawable:r,geometry:i,style:n}=t,a=r.options,l=e.globalAlpha,o="path"===i.kind?i.transform:void 0;o&&(e.translate(o.x,o.y),o.rotation&&e.rotate(o.rotation));for(let t of r.sets){if(e.save(),"path"===t.type)e.strokeStyle="none"===a.stroke?"transparent":a.stroke,e.lineWidth=a.strokeWidth,e.globalAlpha=l*(n.opacity??1),a.strokeLineDash&&e.setLineDash(a.strokeLineDash),a.strokeLineDashOffset&&(e.lineDashOffset=a.strokeLineDashOffset),c(e,t,a.fixedDecimalPlaceDigits),e.stroke();else if("fillPath"===t.type)e.fillStyle=a.fill??"transparent",e.globalAlpha=l*(n.opacity??1)*(n.fillOpacity??1),c(e,t,a.fixedDecimalPlaceDigits),e.fill("curve"===r.shape||"polygon"===r.shape||"path"===r.shape?"evenodd":"nonzero");else{let r=0>a.fillWeight?a.strokeWidth/2:a.fillWeight;e.strokeStyle=a.fill??"transparent",e.lineWidth=r,e.globalAlpha=l*(n.opacity??1)*(n.fillOpacity??1),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),c(e,t,a.fixedDecimalPlaceDigits),e.stroke()}e.restore()}}(e,i),!0)},renderStaticSVG({node:e,style:t,key:r}){let i=p(e,t);if(!i)return null;let n="path"===i.geometry.kind?i.geometry.transform:void 0,a=b.toPaths(i.drawable).map((e,i)=>y("path",{d:e.d,fill:e.fill??"none",fillOpacity:e.fill&&"none"!==e.fill?t.fillOpacity:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:t.opacity,strokeLinecap:t.strokeLinecap,strokeDasharray:t.strokeDasharray},`${r}-path-${i}`));return y("g",{"data-semiotic-render-backend":"roughjs",transform:n?`translate(${n.x} ${n.y})${n.rotation?` rotate(${180*n.rotation/Math.PI})`:""}`:void 0,children:a},r)},clearCache(){v.clear()},get cacheEntries(){return v.size}}}import{resolveCSSColor as u}from"./c-UC7SIU2W.min.js";import h from"roughjs";import{jsx as y}from"react/jsx-runtime";var d=2147483647;export{p as createRoughRenderMode,a as stableRoughSeed};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- function e(e,t){return!0===e?.supportsAccessibleTable&&!1!==t.accessibleTable}function t(e){return"string"==typeof e&&e.trim().length>0}function a(e){if(0===e.length)return;let t=e.map(e=>"idle"===e.status?"no data received":"active"===e.status?"receiving data":"not receiving new data"),a=[...new Set(t)],r=1===a.length?a[0]:t.join(", then ");return`Last ${e.length} stream ${1===e.length?"status":"statuses"}: ${r}.`}function r(e,t){return e?!e.supportsLegend||!1===t.showLegend||!0!==t.showLegend&&null==t.legend&&!["colorBy","lineBy","areaBy","stackBy","groupBy"].some(e=>null!=t[e])?"not-applicable":"isolate"===t.legendInteraction||"highlight"===t.legendInteraction?"built-in":"not-enabled":"unsupported"}function i({component:i,props:u,options:d={}}){let p=c[i],m=p?p.realtime:!0===d.realtime,h=o(i,u,{...d.locale?{locale:d.locale}:{}}),g=l(i,u),v=g||!0===p?.recipeNavigation,b=g&&!1!==d.navigable?n(i,u,{...d.locale?{locale:d.locale}:{}}):void 0,C=s(i,u,{inChartContainer:!0===d.inChartContainer,describe:!0===d.describe||t(u.summary),navigable:!1!==d.navigable&&v}),y=m?function(e){let t=e?.streamStatus;return t?(Array.isArray(t)?t:[t]).filter(e=>!!e&&"string"==typeof e.status).slice(-(e?.streamHistoryLimit??5)):[]}(d):[],f=function(e,t){return e?"delegated"===e.markNavigation||"not-applicable"===e.markNavigation?e.markNavigation:t?"built-in":"unsupported":"unsupported"}(p,v);return{schemaVersion:1,component:i,text:{...t(u.title)?{title:u.title}:{},...t(u.description)?{description:u.description}:{},...t(u.summary)?{summary:u.summary}:{},accessibleTable:e(p,u)},keyboard:{markNavigation:f,legendInteraction:r(p,u),focusRing:f},navigation:{supported:v,composition:"chart-container",...b?{tree:b}:void 0,...b?{}:{note:v?g?"Structured datum navigation is available through ChartContainer; enable its navigable option to materialize the tree.":"Structured datum navigation is declared for this built-in recipe; load its recipe manifest through semiotic/ai before materializing the tree.":"No datum-level structured navigation is registered for this chart. Exact-value table access may still be available."}},table:{enabled:e(p,u),source:"scene",pagination:"built-in"},mediaPreferences:{reducedMotion:p?"built-in":"unknown",forcedColors:p?"css-custom-properties":"unknown",note:p?"Runtime detection is available through useReducedMotion and useHighContrast; canvas styling uses CSS custom properties so forced-colors changes cascade.":"No generated runtime capability record exists for this component; media-preference support is unknown."},streamStatus:m?{supported:!0,status:y.at(-1)?.status??"idle",lastPushTime:y.at(-1)?.lastPushTime??null,history:y,historyLimit:d.streamHistoryLimit??5,...a(y)?{accessibleDescription:a(y)}:{},note:"Hosts may expose this bounded, non-visible description to screen readers or agents. Do not render it in visible UI."}:{supported:!1,note:"Static chart; no push-ingest lifecycle."},ssr:!0===p?.supportsSSR?{supported:!0,evidence:d.ssrEvidence,note:d.ssrEvidence?"Server rendering is registered and attached render evidence records the observed scene.":"Server rendering is registered; supply renderChartWithEvidence output before claiming a non-empty scene."}:{supported:!1,...d.ssrEvidence?{evidence:d.ssrEvidence}:{},note:m?"Live push charts intentionally omit static SSR; capture a supported bounded-window static twin before claiming server evidence.":p?"The chart capability registry does not expose this component through renderChart; do not claim server evidence for the HOC surface.":"No generated capability record exists for this component; SSR support is unknown and therefore reported as unsupported."},evidence:{audit:C,description:h}}}import{auditAccessibility as s}from"./c-IDJV3CZK.min.js";import{buildNavigationTree as n,describeChart as o,supportsStructuredNavigation as l}from"./c-2WK7YJLL.min.js";var c=Object.freeze(Object.fromEntries([["AreaChart",13],["BubbleChart",13],["BumpChart",13],["CandlestickChart",13],["ConnectedScatterplot",13],["DifferenceChart",13],["Heatmap",13],["LineChart",13],["MinimapChart",13,"delegated"],["MultiAxisLineChart",13],["QuadrantChart",13],["Scatterplot",13],["ScatterplotMatrix",13,"delegated"],["StackedAreaChart",13],["WaterfallChart",13],["BarChart",13],["BoxPlot",13],["DonutChart",13],["DotPlot",13],["FunnelChart",13],["GaugeChart",5],["GroupedBarChart",13],["Histogram",13],["LikertChart",13],["PieChart",13],["RadarChart",13],["RidgelinePlot",13],["StackedBarChart",13],["SwarmPlot",13],["SwimlaneChart",13],["ViolinPlot",13],["ChordDiagram",13],["CirclePack",13],["ForceDirectedGraph",13],["OrbitDiagram",13],["ProcessSankey",13],["SankeyDiagram",13],["TreeDiagram",13],["Treemap",13],["ChoroplethMap",13],["DistanceCartogram",13],["FlowMap",13],["ProportionalSymbolMap",13],["RealtimeHeatmap",14],["RealtimeHistogram",14],["RealtimeLineChart",14],["RealtimeSwarmChart",14],["RealtimeWaterfallChart",14],["TemporalHistogram",13],["ChainReactionChart",5],["CollisionSwarmChart",13],["CrucibleChart",5],["EventDropChart",13],["GaltonBoardChart",13],["GauntletChart",5],["PacketFlowChart",13],["ProcessFlowChart",13],["UnitPileChart",13],["BigNumber",1,"not-applicable"],["ParallelCoordinatesRecipe",21],["CalendarHeatmapRecipe",21]].map(([e,t,a="unsupported"])=>[e,{supportsSSR:!!(1&t),realtime:!!(2&t),supportsAccessibleTable:!!(4&t),supportsLegend:!!(8&t),...16&t?{recipeNavigation:!0}:{},markNavigation:a}]))),u=1,d=i({component:"LineChart",props:{data:[{date:"2026-01-01",value:12},{date:"2026-02-01",value:18},{date:"2026-03-01",value:15}],xAccessor:"date",yAccessor:"value",title:"Weekly active users",description:"Daily active users from January through March, with a February peak.",summary:"Use keyboard mark navigation to inspect each point; the linked table lists exact values."},options:{navigable:!0}}),p=i({component:"BarChart",props:{data:[{region:"North",total:42},{region:"South",total:31},{region:"East",total:27}],categoryAccessor:"region",valueAccessor:"total",title:"Orders by region",description:"Three regions compared by order count; North leads and East trails.",summary:"The accessible table preserves category labels and numeric totals for exact reading."},options:{navigable:!0}}),m=i({component:"RealtimeLineChart",props:{data:[{time:1,value:4},{time:2,value:7}],timeAccessor:"time",valueAccessor:"value",title:"Requests per second",description:"A bounded live window of requests per second with stale-state indication available through useStreamStatus.",summary:"The current window is exposed as an accessible table; status changes should be announced by the host application."},options:{realtime:!0,navigable:!1,streamStatus:[{status:"idle",lastPushTime:null},{status:"active",lastPushTime:1e3},{status:"active",lastPushTime:2e3},{status:"active",lastPushTime:3e3},{status:"stale",lastPushTime:4e3}],streamHistoryLimit:5}});export{p as BAR_CHART_ACCESS_CONTRACT,u as CHART_ACCESS_CONTRACT_VERSION,d as LINE_CHART_ACCESS_CONTRACT,m as REALTIME_LINE_CHART_ACCESS_CONTRACT,i as createChartAccessContract};
2
+ function e(e,t){return!0===e?.supportsAccessibleTable&&!1!==t.accessibleTable}function t(e){return"string"==typeof e&&e.trim().length>0}function a(e){if(0===e.length)return;let t=e.map(e=>"idle"===e.status?"no data received":"active"===e.status?"receiving data":"not receiving new data"),a=[...new Set(t)],r=1===a.length?a[0]:t.join(", then ");return`Last ${e.length} stream ${1===e.length?"status":"statuses"}: ${r}.`}function r(e,t){return e?!e.supportsLegend||!1===t.showLegend||!0!==t.showLegend&&null==t.legend&&!["colorBy","lineBy","areaBy","stackBy","groupBy"].some(e=>null!=t[e])?"not-applicable":"isolate"===t.legendInteraction||"highlight"===t.legendInteraction?"built-in":"not-enabled":"unsupported"}function i({component:i,props:u,options:d={}}){let p=c[i],h=p?p.realtime:!0===d.realtime,m=s(i,u,{...d.locale?{locale:d.locale}:{}}),g=l(i,u),v=g||!0===p?.recipeNavigation,b=g&&!1!==d.navigable?o(i,u,{...d.locale?{locale:d.locale}:{}}):void 0,C=n(i,u,{inChartContainer:!0===d.inChartContainer,describe:!0===d.describe||t(u.summary),navigable:!1!==d.navigable&&v}),y=h?function(e){let t=e?.streamStatus;return t?(Array.isArray(t)?t:[t]).filter(e=>!!e&&"string"==typeof e.status).slice(-(e?.streamHistoryLimit??5)):[]}(d):[],f=function(e,t){return e?"delegated"===e.markNavigation||"not-applicable"===e.markNavigation?e.markNavigation:t?"built-in":"unsupported":"unsupported"}(p,v);return{schemaVersion:1,component:i,text:{...t(u.title)?{title:u.title}:{},...t(u.description)?{description:u.description}:{},...t(u.summary)?{summary:u.summary}:{},accessibleTable:e(p,u)},keyboard:{markNavigation:f,legendInteraction:r(p,u),focusRing:f},navigation:{supported:v,composition:"chart-container",...b?{tree:b}:void 0,...b?{}:{note:v?g?"Structured datum navigation is available through ChartContainer; enable its navigable option to materialize the tree.":"Structured datum navigation is declared for this built-in recipe; load its recipe manifest through semiotic/ai before materializing the tree.":"No datum-level structured navigation is registered for this chart. Exact-value table access may still be available."}},table:{enabled:e(p,u),source:"scene",pagination:"built-in"},mediaPreferences:{reducedMotion:p?"built-in":"unknown",forcedColors:p?"css-custom-properties":"unknown",note:p?"Runtime detection is available through useReducedMotion and useHighContrast; canvas styling uses CSS custom properties so forced-colors changes cascade.":"No generated runtime capability record exists for this component; media-preference support is unknown."},streamStatus:h?{supported:!0,status:y.at(-1)?.status??"idle",lastPushTime:y.at(-1)?.lastPushTime??null,history:y,historyLimit:d.streamHistoryLimit??5,...a(y)?{accessibleDescription:a(y)}:{},note:"Hosts may expose this bounded, non-visible description to screen readers or agents. Do not render it in visible UI."}:{supported:!1,note:"Static chart; no push-ingest lifecycle."},ssr:!0===p?.supportsSSR?{supported:!0,evidence:d.ssrEvidence,note:d.ssrEvidence?"Server rendering is registered and attached render evidence records the observed scene.":"Server rendering is registered; supply renderChartWithEvidence output before claiming a non-empty scene."}:{supported:!1,...d.ssrEvidence?{evidence:d.ssrEvidence}:{},note:h?"Live push charts intentionally omit static SSR; capture a supported bounded-window static twin before claiming server evidence.":p?"The chart capability registry does not expose this component through renderChart; do not claim server evidence for the HOC surface.":"No generated capability record exists for this component; SSR support is unknown and therefore reported as unsupported."},evidence:{audit:C,description:m}}}import{auditAccessibility as n}from"./c-HYDTS5OP.min.js";import{buildNavigationTree as o,describeChart as s,supportsStructuredNavigation as l}from"./c-2WK7YJLL.min.js";var c=Object.freeze(Object.fromEntries([["AreaChart",13],["BubbleChart",13],["BumpChart",13],["CandlestickChart",13],["ConnectedScatterplot",13],["DifferenceChart",13],["Heatmap",13],["LineChart",13],["MinimapChart",13,"delegated"],["MultiAxisLineChart",13],["QuadrantChart",13],["Scatterplot",13],["ScatterplotMatrix",13,"delegated"],["StackedAreaChart",13],["WaterfallChart",13],["BarChart",13],["BoxPlot",13],["DonutChart",13],["DotPlot",13],["FunnelChart",13],["GaugeChart",5],["GroupedBarChart",13],["Histogram",13],["LikertChart",13],["PieChart",13],["RadarChart",13],["RidgelinePlot",13],["StackedBarChart",13],["SwarmPlot",13],["SwimlaneChart",13],["ViolinPlot",13],["ChordDiagram",13],["CirclePack",13],["DependencyForestChart",1],["ForceDirectedGraph",13],["MotifBraidChart",1],["OrbitDiagram",13],["ProcessSankey",13],["SankeyDiagram",13],["TreeDiagram",13],["Treemap",13],["ChoroplethMap",13],["DistanceCartogram",13],["FlowMap",13],["ProportionalSymbolMap",13],["RealtimeHeatmap",14],["RealtimeHistogram",14],["RealtimeLineChart",14],["RealtimeSwarmChart",14],["RealtimeWaterfallChart",14],["TemporalHistogram",13],["ChainReactionChart",5],["CollisionSwarmChart",13],["CrucibleChart",5],["EventDropChart",13],["FlowCircuitChart",1],["GaltonBoardChart",13],["GauntletChart",5],["PacketFlowChart",13],["ProcessFlowChart",13],["UnitPileChart",13],["BigNumber",1,"not-applicable"],["ParallelCoordinatesRecipe",21],["CalendarHeatmapRecipe",21]].map(([e,t,a="unsupported"])=>[e,{supportsSSR:!!(1&t),realtime:!!(2&t),supportsAccessibleTable:!!(4&t),supportsLegend:!!(8&t),...16&t?{recipeNavigation:!0}:{},markNavigation:a}]))),u=1,d=i({component:"LineChart",props:{data:[{date:"2026-01-01",value:12},{date:"2026-02-01",value:18},{date:"2026-03-01",value:15}],xAccessor:"date",yAccessor:"value",title:"Weekly active users",description:"Daily active users from January through March, with a February peak.",summary:"Use keyboard mark navigation to inspect each point; the linked table lists exact values."},options:{navigable:!0}}),p=i({component:"BarChart",props:{data:[{region:"North",total:42},{region:"South",total:31},{region:"East",total:27}],categoryAccessor:"region",valueAccessor:"total",title:"Orders by region",description:"Three regions compared by order count; North leads and East trails.",summary:"The accessible table preserves category labels and numeric totals for exact reading."},options:{navigable:!0}}),h=i({component:"RealtimeLineChart",props:{data:[{time:1,value:4},{time:2,value:7}],timeAccessor:"time",valueAccessor:"value",title:"Requests per second",description:"A bounded live window of requests per second with stale-state indication available through useStreamStatus.",summary:"The current window is exposed as an accessible table; status changes should be announced by the host application."},options:{realtime:!0,navigable:!1,streamStatus:[{status:"idle",lastPushTime:null},{status:"active",lastPushTime:1e3},{status:"active",lastPushTime:2e3},{status:"active",lastPushTime:3e3},{status:"stale",lastPushTime:4e3}],streamHistoryLimit:5}});export{p as BAR_CHART_ACCESS_CONTRACT,u as CHART_ACCESS_CONTRACT_VERSION,d as LINE_CHART_ACCESS_CONTRACT,h as REALTIME_LINE_CHART_ACCESS_CONTRACT,i as createChartAccessContract};