semiotic 3.10.3 → 3.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -18
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/behaviorContracts.cjs +14 -4
- package/ai/behaviorContracts.d.cts +3 -0
- package/ai/cli.js +17 -166
- package/ai/componentMetadata.cjs +68 -15
- package/ai/componentMetadata.d.cts +3 -0
- package/ai/dist/diagnose-operation.js +3 -0
- package/ai/dist/mcp-server.js +59 -59
- package/ai/reference.md +3 -3
- package/ai/schema.json +1 -1
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +1 -1
- package/ai/task-packets/compare-category-totals.json +7 -7
- package/ai/task-packets/compare-category-totals.md +3 -3
- package/ai/task-packets/correct-published-chart.json +7 -7
- package/ai/task-packets/correct-published-chart.md +3 -3
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +7 -7
- package/ai/task-packets/update-live-chart.md +3 -3
- package/dist/{c-FHNY57SO.min.js → c-2MHSD3TN.min.js} +46 -46
- package/dist/{c-5PIKBUMF.min.js → c-6XGGN5OS.min.js} +1 -1
- package/dist/c-EK6XI2U7.min.js +26 -0
- package/dist/{c-4XLHPQTP.min.js → c-JBWPJNTJ.min.js} +1 -1
- package/dist/c-KWP4QTCM.min.js +4 -0
- package/dist/c-LRV7PO45.min.js +393 -0
- package/dist/c-LVHJJUOF.min.js +1 -0
- package/dist/c-NUBZ63VU.min.js +1 -0
- package/dist/{c-ZVOFLE2P.min.js → c-RWHLEUX6.min.js} +6 -6
- package/dist/{c-4JKDJUYD.min.js → c-S746GRV4.min.js} +1 -1
- package/dist/{c-ISA6IJ6V.min.js → c-UQBWSYKI.min.js} +5 -5
- package/dist/components/ai/chartClinic.d.ts +1 -1
- package/dist/components/ai/chartClinicMetadata.generated.d.ts +2 -2
- package/dist/components/charts/shared/{chartDefinitionPilot.d.ts → chartDefinition.d.ts} +30 -34
- package/dist/components/charts/shared/chartDefinitions.d.ts +10 -0
- package/dist/components/charts/shared/chartDefinitionsNetwork.d.ts +17 -0
- package/dist/components/charts/shared/chartDefinitionsOrdinal.d.ts +23 -0
- package/dist/components/charts/shared/chartDefinitionsPhysics.d.ts +17 -0
- package/dist/components/charts/shared/chartDefinitionsRealtime.d.ts +12 -0
- package/dist/components/charts/shared/chartDefinitionsXY.d.ts +26 -0
- package/dist/components/server/serverChartConfigs.d.ts +36 -36
- package/dist/components/server/serverChartConfigsNetwork.generated.d.ts +17 -0
- package/dist/components/server/serverChartConfigsOrdinal.generated.d.ts +23 -0
- package/dist/components/server/serverChartConfigsPhysics.generated.d.ts +17 -0
- package/dist/components/server/serverChartConfigsRealtime.generated.d.ts +13 -0
- package/dist/components/server/serverChartConfigsXY.generated.d.ts +22 -0
- package/dist/components/stream/physics/PhysicsOptionalEngineAdapters.d.ts +5 -0
- package/dist/network.module.min.js +1 -1
- package/dist/physics-matter.min.js +4 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +4 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +3 -3
- package/dist/semiotic-ai-core.module.min.js +3 -3
- package/dist/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +4 -4
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +13 -13
- package/dist/semiotic-server-edge-node.module.min.js +393 -391
- package/dist/semiotic-server-edge.min.js +393 -391
- package/dist/semiotic-server-edge.module.min.js +374 -372
- package/dist/semiotic-server-node.min.js +393 -391
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic.module.min.js +9 -9
- package/dist/server.min.js +393 -391
- package/dist/server.module.min.js +1 -1
- package/package.json +8 -4
- package/dist/c-3OFVBWQY.min.js +0 -1
- package/dist/c-43XNOQNQ.min.js +0 -391
- package/dist/c-6IVBV5NO.min.js +0 -1
- package/dist/c-KXH7LFIL.min.js +0 -26
- package/dist/c-UBHICVSC.min.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function e(e){let{data:t,encoding:a,defaults:i={},scales:s}=e,n=ea({data:t,encoding:a}),r=[],o=/* @__PURE__ */new Map,l=[],u=[],c=/* @__PURE__ */new Map;return n.rows.forEach((e,t)=>{let{id:n,datum:d}=e,p=Math.max(0,Zt(a.appearance?.size,d,t)??i.size??6),h=Zt(a.appearance?.shape,d,t)??i.shape??{type:"circle",radius:p},m=e.placement.x??i.x??0,y=e.placement.y??i.y??0,f=s?.x?s.x(m):m,g=s?.y?s.y(y):y,b=Zt(a.appearance?.color,d,t)??i.color,v=Zt(a.appearance?.opacity,d,t)??i.opacity,w=Zt(a.appearance?.stroke,d,t)??i.stroke,x=Zt(a.appearance?.strokeWidth,d,t)??i.strokeWidth,I=Zt(a.time?.spawnAt,d,t)??e.time.arrival,S=e.kinematics.velocityX,A=e.kinematics.velocityY,P=Zt(a.dynamics?.mass,d,t)??i.mass??1,C=Zt(a.dynamics?.friction,d,t),M=Zt(a.dynamics?.restitution,d,t),R=Zt(a.dynamics?.bodyCollisions,d,t),E={id:n,x:f,y:g,mass:P,shape:{...h},datum:d,...null!=I&&{spawnAt:I},...null!=S&&{vx:S},...null!=A&&{vy:A},...null!=C&&{friction:C},...null!=M&&{restitution:M},...null!=R&&{bodyCollisions:R}},B={...null!=b&&{fill:b},...null!=v&&{opacity:v},...null!=w&&{stroke:w},...null!=x&&{strokeWidth:x}},F={id:n,datum:d,appearance:{color:b,opacity:v,shape:h,size:p,stroke:w,strokeWidth:x},placement:{x:f,y:g,lane:e.placement.lane,space:a.placement?.space??"world"},time:{arrival:I,spawnAt:I,basis:a.time?.basis??"simulation",unit:a.time?.unit},kinematics:{velocityX:S,velocityY:A,space:a.kinematics?.space??"world"},dynamics:{bodyCollisions:R,friction:C,mass:P,restitution:M},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:E};r.push(F),o.set(n,F),l.push(E),c.set(n,B),u.push({id:n,bodyId:n,label:e.accessible.label,description:e.accessible.description,datum:d,x:f,y:g,group:e.accessible.group})}),{rows:r,byId:o,spawns:l,semanticItems:u,bodyStyle:e=>c.get(e.id)??{}}}function t(t){return a=>{let i=e({data:a.data,encoding:t.encoding,defaults:t.defaults,scales:a.scales}),s=t.extend?.(a,i)??{};return{...s,initialSpawns:i.spawns,bodyStyle:i.bodyStyle,semanticItems:[...i.semanticItems,...s.semanticItems??[]]}}}function a(e){return new Map(e.gates.map(e=>[e.id,e]))}function i(e,t){let{layout:i,positiveProperties:s,negativeProperties:n,viability:r,outcome:o}=t,l=a(i),u=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),c=e;for(let e of u){let t=e.gateId?l.get(e.gateId):void 0,a=e.effects??[],u={..._e(e,a),appliedAt:e.time},d=Ke(c,u);if(d!==c){c=d;for(let i of a){let a={event:e,gate:t,negativeProperties:n,positiveProperties:s,project:c};i.when&&!i.when(a)||(c=ze(c,i,a))}c={...c,viability:r?.(c,{negativeProperties:n,positiveProperties:s})??Xe(c,s,n)},e.final&&(c={...c,outcome:e.outcome??o?.(c,{layout:i,negativeProperties:n,positiveProperties:s})??(c.viability>20?"built":"approved_not_built")})}}return c}function s(e){return e.projects.map(t=>i(t,e))}function n(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),a=new Map(t.map(e=>[e.bodyId,e])),i=/* @__PURE__ */new Map,s=/* @__PURE__ */new Map,n=e.assignmentForce??.45,r=e.returnForce??.35,o=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=/* @__PURE__ */new Map,c=0,d=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let a=i.get(e);if(a)return a;let n=t.find(e=>!s.has(e.id));if(!n)return null;let r={resourceId:n.id,resourceBodyId:n.bodyId,caseBodyId:e,assignedAt:c};return i.set(e,r),s.set(n.id,r),d+=1,r},release:e=>{let t=i.get(e);return!!t&&(i.delete(e),s.delete(t.resourceId),d+=1,!0)},getAssignment:e=>i.get(e),tick:e=>{c=Math.max(c,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of i)u.has(e)&&u.has(t.resourceBodyId)||(i.delete(e),s.delete(t.resourceId),d+=1)},getSnapshot:()=>({total:t.length,available:t.length-s.size,assigned:s.size,assignments:Array.from(i.values()),simulatedAt:c,metricRevision:d}),bodyForce:e=>{let t=a.get(e.body.id);if(t){let a=s.get(t.id),i=a?u.get(a.caseBodyId):void 0,o=a?n:r;return{x:((i?i.x+(l.x??0):t.home.x)-e.body.x)*o,y:((i?i.y+(l.y??0):t.home.y)-e.body.y)*o}}let c=i.get(e.body.id);if(!c||0>=o)return null;let d=u.get(c.resourceBodyId);return d?{x:(d.x-e.body.x)*o,y:(d.y-e.body.y)*o}:null}}}function r(e,t){let a="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):et(e.datum,t.deadlineAccessor)??et(e,t.deadlineAccessor);return Number.isFinite(Number(a))?Math.max(0,Number(a)):0}function o(e){function t(t){i.set(t.bodyId,t),n+=1,e.onStateChange?.({...t})}function a(e){let a=i.get(e);return!(!a||null!=a.completedAt||(t({...a,completedAt:s,state:"unhappy"===a.state?"resolved-unhappy":"resolved"}),0))}let i=/* @__PURE__ */new Map,s=0,n=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let a=i.get(e);return!(!a||null!=a.completedAt||"unhappy"===a.state||(t({...a,state:"protected",protectedAt:s}),0))},complete:a,getCase:e=>i.get(e),tick:n=>{s=Math.max(s,n.elapsed);for(let o of n.controls.readBodies()){if(!at(o,e.bodyFilter))continue;if(!i.has(o.id)){let a=r(o,e);t({bodyId:o.id,openedAt:s,deadlineAt:s+a,state:"waiting"})}let l=i.get(o.id);l&&null==l.completedAt&&(e.completionRegionId&&n.getRegionState(o.id)?.activeRegionIds.includes(e.completionRegionId)?a(o.id):"waiting"===l.state&&s>=l.deadlineAt&&t({...l,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(i.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:s,metricRevision:n}}}}function l(e){function t(t){return e.isOpen?e.isOpen(t):null!=e.opensAt&&t>=e.opensAt}let a=/* @__PURE__ */new Set,i=0,s=0,n=0,r=!1;return{id:e.id??"dependency-gate:"+e.regionId,continuous:!0,tick:o=>{i=Math.max(i,o.elapsed);let l=r;r=t(i);let u=o.controls.readBodies(),c=new Map(u.map(e=>[e.id,e]));for(let t of u)!o.getRegionState(t.id)?.activeRegionIds.includes(e.regionId)||!at(t,e.bodyFilter)||!r&&!a.has(t.id)&&(a.add(t.id),n+=1,e.onHeld?.(t));if(r&&!l){for(let t of a){let a=c.get(t);a&&(o.controls.applyImpulse(t,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),s+=1,e.onReleased?.(a))}a.clear(),n+=1}for(let e of a)c.has(e)||(a.delete(e),n+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:r,blocked:a.size,released:s,simulatedAt:i,metricRevision:n}),bodyForce:t=>{if(r||!a.has(t.body.id))return null;let i=t.regions?.find(t=>t.id===e.regionId)?.shape;if(!i||"aabb"!==i.type)return{x:.8*-t.body.vx,y:.8*-t.body.vy};let s=e.holdForce??.4;return{x:(i.x-t.body.x)*s-.45*t.body.vx,y:(i.y-t.body.y)*s-.45*t.body.vy}}}}function u(e,t,a){return Math.max(t,Math.min(a,e))}function c(e,t,a={}){let i=a.random??Math.random,s=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],n=u(a.along??.5,.05,.95),r=a.jitterX??0,o=a.padY??20,l=s.x0+(s.x1-s.x0)*n+(2*i()-1)*r,c=Math.min(1,s.width/2),d=u(l,s.x0+c,s.x1-c),p=e.boundaryY(d,"top")+o,h=e.boundaryY(d,"bottom")-o;return{x:d,y:h>p?p+i()*Math.max(1,h-p):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 h(e,t){let a=e;for(let e of t.split(".")){if(null==a||"object"!=typeof a||!Object.prototype.hasOwnProperty.call(a,e))return;a=a[e]}return a}function m(e,t,a,i,s){return"function"==typeof i?i(e,t,a):h(e,i??s)}function y(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function f(e){let t=(e??ca).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 y(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}function g(e){if(Array.isArray(e)){if(e.length>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);return Array.from(new Set(e.map(p).filter(e=>null!=e).map(y))).sort((e,t)=>e-t)}let t=e,a=p(t.start),i=p(t.end),s=p(t.step);if(null==a||null==i||null==s||0>=s||a>i)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let n=Math.floor((i-a)/s)+1;if(n>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);let r=[],o=1e-10*Math.max(1,Math.abs(i),Math.abs(a));for(let e=0;n>e;e+=1){let t=a+e*s;if(t>i+o)break;r.push(y(Math.min(t,i)))}if((!r.length||Math.abs(r[r.length-1]-i)>o)&&r.push(y(i)),r.length>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);return Array.from(new Set(r)).sort((e,t)=>e-t)}function b(e,t,a,i){let s=e.flatMap((e,s)=>{let n=p(m(e,s,t,a,"time")),r=p(m(e,s,t,i,"value"));return null==n||null==r?[]:[{time:y(n),value:r,index:s}]});s.sort((e,t)=>e.time-t.time||e.index-t.index);let n=[];for(let e of s){let t=n[n.length-1];t?.time===e.time?t.value=e.value:n.push({time:e.time,value:e.value})}return n}function v(e,t){let a=0,i=e.length;for(;i>a;){let s=a+i>>>1;t>e[s].time?a=s+1:i=s}return a}function w(e,t,a,i){if(!e.length)return null;let s=e[0],n=e[e.length-1];if(s.time>t)return"clamp"===i?s.value:null;if(t>n.time)return"clamp"===i?n.value:null;let r=v(e,t),o=e[r];if(o?.time===t)return o.value;let l=e[Math.max(0,r-1)];return"step"!==a&&o&&o.time!==l.time?l.value+(t-l.time)/(o.time-l.time)*(o.value-l.value):l.value}function x(e,t){if(1===e.length)return e[0];let a=(e.length-1)*t,i=Math.floor(a),s=Math.ceil(a);return i===s?e[i]:e[i]+(e[s]-e[i])*(a-i)}function I(e){let t=e.interpolation??"step",a=e.outsideDomain??"omit",i=f(e.quantiles),s=g(e.sampleAt),n=e.runs.map(t=>b(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:s.map(e=>{let s=n.map(i=>w(i,e,t,a)).filter(e=>null!=e).sort((e,t)=>e-t),r={};for(let e of i)r[e]=s.length?x(s,e):null;return{time:e,count:s.length,min:s.length?s[0]:null,max:s.length?s[s.length-1]:null,median:s.length?x(s,.5):null,quantiles:r}}),quantiles:i,interpolation:t,outsideDomain:a,runCount:e.runs.length}}function S(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function A(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let a=p(t);if(null==a||0>a||a>1)throw new RangeError("comparePhysicsTrace quantile selectors must be from 0 to 1; received "+t);let i=y(a);if(!Object.prototype.hasOwnProperty.call(e.quantiles,i))throw Error(`comparePhysicsTrace could not find quantile ${i} in the reference envelope`);return e.quantiles[i]??null}function P(e,t,a){return t>e?"below":e>a?"above":"inside"}function C(e,t){let a=Math.max(0,t.time-e.time);if(0>=a||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 i=e.value-e.lower,s=t.value-t.lower,n=e.value-e.upper,r=t.value-t.upper,o=[0,1];for(let[e,t]of[[i,s],[n,r]])(0>e&&t>0||e>0&&0>t)&&o.push(-e/(t-e));o.sort((e,t)=>e-t);let l=0,u=0,c=0;for(let i=0;o.length-1>i;i+=1){let s=o[i],n=o[i+1];if(s>=n)continue;let r=(s+n)/2,d=(n-s)*a,p=P(e.value+(t.value-e.value)*r,e.lower+(t.lower-e.lower)*r,e.upper+(t.upper-e.upper)*r);"below"===p?l+=d:"above"===p?c+=d:u+=d}return{below:l,inside:u,above:c,observed:a}}function M(e,t,a={}){let i=a.interpolation??t.interpolation,s=a.outsideDomain??t.outsideDomain,n=b(e,a.traceId??"trace",a.timeAccessor,a.valueAccessor),r=a.lower??S(t,"lower"),o=a.upper??S(t,"upper"),l=t.points.map(e=>{let t=w(n,e.time,i,s),a=A(e,r),l=A(e,o);if(null!=a&&null!=l&&a>l)throw new RangeError("comparePhysicsTrace lower band exceeds upper band at time "+e.time);return{time:e.time,value:t,lower:a,upper:l,status:null==t||null==a||null==l?"unobserved":P(t,a,l)}}),u=0,c=0,d=0,p=0,h=null,m=0,y=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?c+=1:"above"===e.status&&(d+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),a=Math.max(0,e.lower-e.value);t>p&&(p=t,h=e.time),a>m&&(m=a,y=e.time)}let f=0,g=0,v=0,x=0;for(let e=0;l.length-1>e;e+=1){let t=l[e],a=l[e+1],s=Math.max(0,a.time-t.time);if(s>0){if("linear"===i){let e=C(t,a);f+=e.below,g+=e.inside,v+=e.above,x+=e.observed;continue}"unobserved"!==t.status&&(x+=s,"below"===t.status?f+=s:"above"===t.status?v+=s:g+=s)}}let I=l[0]?.time,M=l[l.length-1]?.time,R=null==I||null==M?0:Math.max(0,M-I);return{points:l,sampleCount:l.length,observedSamples:u+c+d,belowSamples:u,insideSamples:c,aboveSamples:d,totalDuration:R,observedDuration:x,unobservedDuration:Math.max(0,R-x),belowDuration:f,insideDuration:g,aboveDuration:v,peakExcess:p,peakExcessAt:h,peakDeficit:m,peakDeficitAt:y}}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function E(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function B(e){return!!E(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&E(e.visitsByStage)&&E(e.firstEnteredAt)&&E(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function F(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function k(e,t){let a=t.stageId?.(e);if(a)return a;let i=e.region.metadata;if(i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,"stageId")){let e=i.stageId;if("string"==typeof e)return e}return e.region.id}function T(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,F(e)]))}}function j(e,t,a={}){if("region-enter"!==t.type)return e;let i=k(t,a),s=e.stages.findIndex(e=>e.id===i);if(0>s)return e;let n=a.entityId?.(t)??t.bodyId;if(!n)return e;let r=R(e.entities,n),o=B(r)?r:F(n),l=o.currentStageId?e.stages.findIndex(e=>e.id===o.currentStageId):-1,u=!o.visitedStageIds.includes(i),c=Number(t.observation.timestamp),d=Number.isFinite(c)?c:0,p=R(o.visitsByStage,i),h="number"==typeof p&&Number.isFinite(p)?p:0,m={...o,currentStageId:i,furthestStageId:s>o.furthestStageIndex?i:o.furthestStageId,furthestStageIndex:Math.max(o.furthestStageIndex,s),visitedStageIds:u?[...o.visitedStageIds,i]:o.visitedStageIds,visitsByStage:{...o.visitsByStage,[i]:h+1},firstEnteredAt:u?{...o.firstEnteredAt,[i]:d}:o.firstEnteredAt,lastEnteredAt:{...o.lastEnteredAt,[i]:d},regressionCount:l>=0&&l>s?o.regressionCount+1:o.regressionCount};return{...e,bodyIds:e.bodyIds.includes(n)?e.bodyIds:[...e.bodyIds,n],entities:{...e.entities,[n]:m}}}function N(e){let t=e.bodyIds.map(t=>{let a=R(e.entities,t);return B(a)?a:F(t)}),a=t.length,i=a;return e.stages.map((e,s)=>{let n=t.filter(e=>e.furthestStageIndex>=s).length,r=t.filter(t=>t.visitedStageIds.includes(e.id)).length,o=t.reduce((t,a)=>{let i=R(a.visitsByStage,e.id);return t+("number"==typeof i&&Number.isFinite(i)?i:0)},0),l={id:e.id,label:e.label??e.id,reached:n,entered:r,total:a,conversion:a>0?n/a:0,fromPrevious:i>0?n/i:0,dropoff:Math.max(0,i-n),visits:o,repeatVisits:Math.max(0,o-r)};return i=n,l})}function D(e){return null==e?{top:ha,right:ha,bottom:ha,left:ha}:"number"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function O(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+""}))}function Y(e){let[t,a]=e.size,i=e.flow??pa,s=D(e.padding),n=Math.max(.05,Math.min(1,e.channelRatio??ga)),r={x:s.left,y:s.top,width:Math.max(1,t-s.left-s.right),height:Math.max(1,a-s.top-s.bottom)},o="down"===i?r.height:r.width,l=o*Math.max(0,e.chargeExtent??ma),u=o*Math.max(0,e.projectionExtent??fa),c=o*Math.max(0,e.destinationExtent??ya),d=Math.max(0,o-l-c-u),p=O(e.destinations),h=("down"===i?r.width:r.height)/p.length,m="down"===i?(e,t)=>({x:r.x,y:r.y+e,width:r.width,height:t}):(e,t)=>({x:r.x+e,y:r.y,width:t,height:r.height}),y=m(0,l),f=m(l,d),g=l+d,b=m(g,c),v=m(g+c,u),w=p.map((e,t)=>{let a=t*h,s=h*n,o=(h-s)/2;return"down"===i?{id:e.id,label:e.label,order:t,x:r.x+a+o,y:b.y,width:s,height:b.height,centerX:r.x+(t+.5)*h,centerY:b.y+b.height/2}:{id:e.id,label:e.label,order:t,x:b.x,y:r.y+a+o,width:b.width,height:s,centerX:b.x+b.width/2,centerY:r.y+(t+.5)*h}});return{width:t,height:a,flow:i,charge:y,apparatus:f,destinations:w,projection:v}}function $(e,t){return e.destinations.find(e=>e.id===t)}function L(e,t,a){let{charge:i,flow:s}=e,n=Math.max(1,a),r=(t%n+.5)/n;return"down"===s?{x:i.x+i.width*r,y:i.y+i.height/2}:{x:i.x+i.width/2,y:i.y+i.height*r}}function G(e,t={}){let a=t.thickness??4,i=t.idPrefix??"stage",{destinations:s,flow:n,width:r,height:o}=e,l=[];if(s.length>0){let t=s[0];if("down"===n){let n=t.y+t.height;l.push({id:i+"-floor",shape:{type:"segment",x1:e.charge.x,y1:n,x2:e.charge.x+e.charge.width,y2:n,thickness:a}});for(let e=1;s.length>e;e+=1){let r=s[e].centerX-(s[e].centerX-s[e-1].centerX)/2;l.push({id:`${i}-divider-${e}`,shape:{type:"segment",x1:r,y1:t.y,x2:r,y2:n,thickness:a}})}}else{let n=t.x+t.width;l.push({id:i+"-floor",shape:{type:"segment",x1:n,y1:e.charge.y,x2:n,y2:e.charge.y+e.charge.height,thickness:a}});for(let e=1;s.length>e;e+=1){let r=s[e].centerY-(s[e].centerY-s[e-1].centerY)/2;l.push({id:`${i}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:r,x2:n,y2:r,thickness:a}})}}}return!1!==t.walls&&l.push({id:i+"-wall-left",shape:{type:"segment",x1:1,y1:0,x2:1,y2:o,thickness:a}},{id:i+"-wall-right",shape:{type:"segment",x1:r-1,y1:0,x2:r-1,y2:o,thickness:a}}),l}function U(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 q(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function X(e,t,a,i){let s="function"==typeof e?e(t,a):e;return Number.isFinite(s)?Number(s):i}function V(e,t,a){return q(e[t])??a}function H(e,t){return"number"==typeof e?e:e?.[t]??0}function z(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,a=/* @__PURE__ */new Set;for(let i of e.values){let s=e.scale(i);Number.isFinite(s)&&(a.add(Number(s)),a.add(Number(s)+t))}return Array.from(a).sort((e,t)=>e-t)}function W(e){let{band:t,idPrefix:a,plot:i,projection:s}=e,{includeBoundaryWalls:n=!0,includeInteriorWalls:r=!0,wallThickness:o=4}=t,l=z(t);if(2>l.length)return[];let u=n?l.length-1:l.length-2,c=[];for(let e=n?0:1;u>=e;e+=1){if(!r&&e>0&&l.length-1>e)continue;let t=l[e];c.push({id:`${a}-wall-${e}`,shape:"x"===s?{type:"aabb",x:t,y:i.y+i.height/2,width:o,height:i.height}:{type:"aabb",x:i.x+i.width/2,y:t,width:i.width,height:o}})}return c}function _(e){let{plot:t,idPrefix:a="physics-scale",bounds:i={},xBins:s,xBands:n,yBands:r}=e,o=[];if(!1!==i&&o.push(...mt(t,{idPrefix:a,...i})),s){let{idPrefix:e,yTop:i,yBottom:n,...r}=s;o.push(...ft({...r,idPrefix:e??a+"-xbin",yTop:i??t.y,yBottom:n??t.y+t.height}))}return n&&o.push(...W({band:n,idPrefix:n.idPrefix??a+"-xband",plot:t,projection:"x"})),r&&o.push(...W({band:r,idPrefix:r.idPrefix??a+"-yband",plot:t,projection:"y"})),o}function J(e){let{plot:t,rows:a,columns:i=a+1,pegRadius:s=3,idPrefix:n="galton-peg",yStart:r=t.y+.18*t.height,yEnd:o=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:c=.04}=e,d=Math.max(0,Math.floor(a)),p=Math.max(1,Math.floor(i));if(0===d)return[];let h=d>1?(o-r)/(d-1):0,m=t.width/p,y=[];for(let e=0;d>e;e+=1){let a=l&&e%2==1?m/2:0;for(let i=0;p>i;i+=1){let o=t.x+m*(i+.5)+a;t.x+s>o||o>t.x+t.width-s||y.push({id:`${n}-${e}-${i}`,shape:{type:"aabb",x:o,y:r+e*h,width:2*s,height:2*s},restitution:u,friction:c})}}return y}function K(e,t={}){let{idPrefix:a="physics-token",radius:i=5,shape:s,mass:n,vx:r,vy:o,spawnAt:l,seed:u=1,jitter:c,datum:d}=t,p=Xt(u),h=H(c,"x"),m=H(c,"y");return e.map((e,u)=>{let c=X(t.x,e,u,V(e,"x",0)),y=X(t.y,e,u,V(e,"y",0)),f=X(i,e,u,5),g="function"==typeof s?s(e,u):s??{type:"circle",radius:f};return{id:`${a}-${e.index??u}`,x:c+(p()-.5)*h,y:y+(p()-.5)*m,vx:X(r,e,u,0),vy:X(o,e,u,0),mass:X(n,e,u,1),spawnAt:X(l,e,u,void 0),shape:g,datum:d?d(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...a}=e;return a})}function Q(e,t={}){let{idPrefix:a="sediment",collider:i=!0,colliderThickness:s=1,restitution:n=.05,friction:r=.2,...o}=t,l=ct(e,o),u=i?l.filter(e=>e.height>0).map(e=>({id:`${a}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+s/2,width:e.width,height:s},restitution:n,friction:r})):[];return{columns:l,colliders:u}}function Z(e,t,a){return q("function"==typeof a?a(e,t):e[a]??e.datum?.[a])}function ee(e,t={}){let{timeAccessor:a="arrivalTime",timeScale:i=1,startAt:s=0,rebase:n=!0,sort:r=!0}=t,o=e.map((e,t)=>({spawn:e,time:Z(e,t,a)??e.spawnAt??t})),l=o.length?Math.min(...o.map(e=>e.time)):0;return{initialSpawns:o.map(({spawn:e,time:t})=>({...e,spawnAt:s+(n?t-l:t)})).sort((e,t)=>r?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:s,timeAccessor:"spawnAt",timeScale:i}}}import{$ as te,A as ae,Aa as ie,B as se,Ba as ne,C as re,Ca as oe,D as le,Da as ue,E as ce,Ea as de,F as pe,Fa as he,G as me,Ga as ye,H as fe,Ha as ge,I as be,Ia as ve,J as we,Ja as xe,K as Ie,Ka as Se,L as Ae,La as Pe,M as Ce,Ma as Me,N as Re,Na as Ee,O as Be,Oa as Fe,P as ke,Pa as Te,Q as je,Qa as Ne,R as De,S as Oe,T as Ye,U as $e,V as Le,W as Ge,X as Ue,Y as qe,Z as Xe,_ as Ve,a as He,aa as ze,b as We,ba as _e,c as Je,ca as Ke,d as Qe,da as Ze,e as et,ea as tt,f as at,fa as it,g as st,ga as nt,h as rt,ha as ot,i as lt,ia as ut,j as ct,ja as dt,k as pt,ka as ht,l as mt,la as yt,m as ft,ma as gt,n as bt,na as vt,o as wt,oa as xt,p as It,pa as St,q as At,qa as Pt,r as Ct,ra as Mt,s as Rt,sa as Et,t as Bt,ta as Ft,u as kt,ua as Tt,v as jt,va as Nt,w as Dt,wa as Ot,x as Yt,xa as $t,y as Lt,ya as Gt,z as Ut,za as qt}from"./c-FHNY57SO.min.js";import"./c-M43PK7K4.min.js";import{a as Xt}from"./c-RHDOOQ4X.min.js";import"./c-UBHICVSC.min.js";import"./c-N5WT7TXG.min.js";import{Aa as Vt,Oa as Ht,Ob as zt,Pa as Wt,Rb as _t,Sb as Jt,Tb as Kt,Ub as Qt,i as Zt,j as ea,k as ta,l as aa,m as ia,n as sa,za as na}from"./c-UMGHCBH5.min.js";import"./c-Y342FJ6K.min.js";import{r as ra,s as oa,t as la,u as ua}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";var ca=[.1,.5,.9],da=1e6,pa="down",ha=24,ma=.12,ya=.55,fa=0,ga=1,ba=Rt;export{st as BuiltInPhysicsEngineAdapter,Ne as ChainReactionChart,$e as CollisionSwarmChart,Se as CrucibleChart,Mt as DEFAULT_CRUCIBLE_HEIGHT,Ft as DEFAULT_CRUCIBLE_OUTLETS,Et as DEFAULT_CRUCIBLE_SIZE,Pt as DEFAULT_CRUCIBLE_WIDTH,je as EventDropChart,ke as GaltonBoardChart,Ze as GauntletChart,tt as GuantletChart,Wt as MultiLineTooltip,it as PacketFlowChart,nt as PhysicalFlowChart,Ye as PhysicsCustomChart,Oe as PhysicsPileChart,bt as PhysicsPipelineStore,Qe as PhysicsSVGOverlay,lt as PhysicsSedimentAccumulator,ut as ProcessFlowChart,Ct as StreamPhysicsFrame,Ht as Tooltip,na as TooltipRoot,De as UnitPileChart,Ie as absorbRegion,Ut as aggregateRegionCounts,yt as applyCrucibleEvent,ee as arrivalReplay,He as bodiesToAnnotationAnchors,Ce as bodyGroupSpec,Yt as buildCollisionSwarmPhysics,St as buildCrucibleEvidence,ne as buildCrucibleInitialSpawns,Nt as buildCrucibleLayout,$t as buildCruciblePhysicsConfig,xe as buildCrucibleProductEvents,gt as buildCrucibleProjection,oe as buildCrucibleStateSpawns,ue as buildCrucibleTerminalSpawns,kt as buildEventDropPhysics,Bt as buildGaltonBoardPhysics,Lt as buildPhysicalFlowPhysics,We as buildPhysicsAnnotationContext,Dt as buildPhysicsPile,Be as buildProcessFlowPhysics,Te as calculateBlockerAmplification,be as capacitatedRegion,pe as chargeGateRegion,dt as cloneCrucibleState,_ as collidersFromScales,M as comparePhysicsTrace,ve as compileCruciblePlan,Pe as compileDependencyMachine,ea as compileMotionEncoding,e as compilePhysicsEncoding,It as composePhysicsControllers,Qt as composeStyleRules,wt as createCapacityQueueController,rt as createDefaultPhysicsEngineAdapter,l as createDependencyGateController,Tt as createInitialCrucibleState,Ee as createLogicalJoin,t as createPhysicsEncodingLayout,At as createPortalController,T as createProcessJourneyLedger,o as createServiceLevelController,n as createServiceResourcePoolController,ie as crucibleBondId,Ot as crucibleBoundaryColliders,Gt as crucibleComponentBodyId,qt as crucibleProductBodyId,vt as crucibleProjectionRows,de as crucibleSemanticKey,ba as default,sa as deriveMotionVector,U as describePhysicsStageGeography,xt as evaluateCrucibleConservation,pt as evaluatePhysicsBodyBudget,Ae as forceFieldRegion,J as galtonPegs,se as groupCompletionRows,oa as hatchFillId,la as hatchPatternDef,ra as isHatchFill,zt as makeRuleValueResolver,Vt as markTooltipChrome,_t as matchesThreshold,ce as membraneRegion,Je as normalizePhysicsAnnotations,aa as opacityFromAge,L as physicsChargePoint,$ as physicsDestination,Le as physicsProcessBoundaryColliders,qe as physicsProcessGroupSemanticItems,Ge as physicsProcessRegionSemanticItem,Ue as physicsProcessStageSemanticItems,I as physicsReferenceEnvelope,G as physicsStageColliders,Y as physicsStageGeography,Ve as planGauntletPropertyWork,we as portalRegion,fe as pressureFieldRegion,ot as processChrome,N as processJourneyRows,Re as processLaneWalls,re as processStageLayout,le as processStageRegions,d as processVolumePolygons,jt as readEventDropOccupancy,ae as regionCountsToProjectionRows,te as replaceGauntletNegative,ge as replayCruciblePlan,Fe as replayStateTransitions,ht as resolveCrucibleSelector,ye as resolveCrucibleSnapshotAt,he as resolveCrucibleTime,i as resolveGauntletTerminalState,s as resolveGauntletTerminalStates,Zt as resolveMotionAccessor,ta as resolveMotionAge,ia as resolveMotionVector,Kt as resolveStyleRules,ua as resolveSvgFill,Me as routeDependencyTracks,me as routeSurfaceRegion,Jt as ruleMatches,Q as sedimentBake,ct as sedimentHeightfield,K as spawnFromTokens,c as stageTargetInVolume,j as updateProcessJourney};
|
|
2
|
+
function e(e){let{data:t,encoding:a,defaults:i={},scales:s}=e,n=ea({data:t,encoding:a}),r=[],o=/* @__PURE__ */new Map,l=[],u=[],c=/* @__PURE__ */new Map;return n.rows.forEach((e,t)=>{let{id:n,datum:d}=e,p=Math.max(0,Zt(a.appearance?.size,d,t)??i.size??6),h=Zt(a.appearance?.shape,d,t)??i.shape??{type:"circle",radius:p},m=e.placement.x??i.x??0,y=e.placement.y??i.y??0,f=s?.x?s.x(m):m,g=s?.y?s.y(y):y,b=Zt(a.appearance?.color,d,t)??i.color,v=Zt(a.appearance?.opacity,d,t)??i.opacity,w=Zt(a.appearance?.stroke,d,t)??i.stroke,x=Zt(a.appearance?.strokeWidth,d,t)??i.strokeWidth,I=Zt(a.time?.spawnAt,d,t)??e.time.arrival,S=e.kinematics.velocityX,A=e.kinematics.velocityY,P=Zt(a.dynamics?.mass,d,t)??i.mass??1,C=Zt(a.dynamics?.friction,d,t),M=Zt(a.dynamics?.restitution,d,t),R=Zt(a.dynamics?.bodyCollisions,d,t),E={id:n,x:f,y:g,mass:P,shape:{...h},datum:d,...null!=I&&{spawnAt:I},...null!=S&&{vx:S},...null!=A&&{vy:A},...null!=C&&{friction:C},...null!=M&&{restitution:M},...null!=R&&{bodyCollisions:R}},B={...null!=b&&{fill:b},...null!=v&&{opacity:v},...null!=w&&{stroke:w},...null!=x&&{strokeWidth:x}},F={id:n,datum:d,appearance:{color:b,opacity:v,shape:h,size:p,stroke:w,strokeWidth:x},placement:{x:f,y:g,lane:e.placement.lane,space:a.placement?.space??"world"},time:{arrival:I,spawnAt:I,basis:a.time?.basis??"simulation",unit:a.time?.unit},kinematics:{velocityX:S,velocityY:A,space:a.kinematics?.space??"world"},dynamics:{bodyCollisions:R,friction:C,mass:P,restitution:M},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:E};r.push(F),o.set(n,F),l.push(E),c.set(n,B),u.push({id:n,bodyId:n,label:e.accessible.label,description:e.accessible.description,datum:d,x:f,y:g,group:e.accessible.group})}),{rows:r,byId:o,spawns:l,semanticItems:u,bodyStyle:e=>c.get(e.id)??{}}}function t(t){return a=>{let i=e({data:a.data,encoding:t.encoding,defaults:t.defaults,scales:a.scales}),s=t.extend?.(a,i)??{};return{...s,initialSpawns:i.spawns,bodyStyle:i.bodyStyle,semanticItems:[...i.semanticItems,...s.semanticItems??[]]}}}function a(e){return new Map(e.gates.map(e=>[e.id,e]))}function i(e,t){let{layout:i,positiveProperties:s,negativeProperties:n,viability:r,outcome:o}=t,l=a(i),u=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),c=e;for(let e of u){let t=e.gateId?l.get(e.gateId):void 0,a=e.effects??[],u={...We(e,a),appliedAt:e.time},d=Ke(c,u);if(d!==c){c=d;for(let i of a){let a={event:e,gate:t,negativeProperties:n,positiveProperties:s,project:c};i.when&&!i.when(a)||(c=ze(c,i,a))}c={...c,viability:r?.(c,{negativeProperties:n,positiveProperties:s})??Xe(c,s,n)},e.final&&(c={...c,outcome:e.outcome??o?.(c,{layout:i,negativeProperties:n,positiveProperties:s})??(c.viability>20?"built":"approved_not_built")})}}return c}function s(e){return e.projects.map(t=>i(t,e))}function n(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),a=new Map(t.map(e=>[e.bodyId,e])),i=/* @__PURE__ */new Map,s=/* @__PURE__ */new Map,n=e.assignmentForce??.45,r=e.returnForce??.35,o=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=/* @__PURE__ */new Map,c=0,d=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let a=i.get(e);if(a)return a;let n=t.find(e=>!s.has(e.id));if(!n)return null;let r={resourceId:n.id,resourceBodyId:n.bodyId,caseBodyId:e,assignedAt:c};return i.set(e,r),s.set(n.id,r),d+=1,r},release:e=>{let t=i.get(e);return!!t&&(i.delete(e),s.delete(t.resourceId),d+=1,!0)},getAssignment:e=>i.get(e),tick:e=>{c=Math.max(c,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of i)u.has(e)&&u.has(t.resourceBodyId)||(i.delete(e),s.delete(t.resourceId),d+=1)},getSnapshot:()=>({total:t.length,available:t.length-s.size,assigned:s.size,assignments:Array.from(i.values()),simulatedAt:c,metricRevision:d}),bodyForce:e=>{let t=a.get(e.body.id);if(t){let a=s.get(t.id),i=a?u.get(a.caseBodyId):void 0,o=a?n:r;return{x:((i?i.x+(l.x??0):t.home.x)-e.body.x)*o,y:((i?i.y+(l.y??0):t.home.y)-e.body.y)*o}}let c=i.get(e.body.id);if(!c||0>=o)return null;let d=u.get(c.resourceBodyId);return d?{x:(d.x-e.body.x)*o,y:(d.y-e.body.y)*o}:null}}}function r(e,t){let a="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):et(e.datum,t.deadlineAccessor)??et(e,t.deadlineAccessor);return Number.isFinite(Number(a))?Math.max(0,Number(a)):0}function o(e){function t(t){i.set(t.bodyId,t),n+=1,e.onStateChange?.({...t})}function a(e){let a=i.get(e);return!(!a||null!=a.completedAt||(t({...a,completedAt:s,state:"unhappy"===a.state?"resolved-unhappy":"resolved"}),0))}let i=/* @__PURE__ */new Map,s=0,n=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let a=i.get(e);return!(!a||null!=a.completedAt||"unhappy"===a.state||(t({...a,state:"protected",protectedAt:s}),0))},complete:a,getCase:e=>i.get(e),tick:n=>{s=Math.max(s,n.elapsed);for(let o of n.controls.readBodies()){if(!at(o,e.bodyFilter))continue;if(!i.has(o.id)){let a=r(o,e);t({bodyId:o.id,openedAt:s,deadlineAt:s+a,state:"waiting"})}let l=i.get(o.id);l&&null==l.completedAt&&(e.completionRegionId&&n.getRegionState(o.id)?.activeRegionIds.includes(e.completionRegionId)?a(o.id):"waiting"===l.state&&s>=l.deadlineAt&&t({...l,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(i.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:s,metricRevision:n}}}}function l(e){function t(t){return e.isOpen?e.isOpen(t):null!=e.opensAt&&t>=e.opensAt}let a=/* @__PURE__ */new Set,i=0,s=0,n=0,r=!1;return{id:e.id??"dependency-gate:"+e.regionId,continuous:!0,tick:o=>{i=Math.max(i,o.elapsed);let l=r;r=t(i);let u=o.controls.readBodies(),c=new Map(u.map(e=>[e.id,e]));for(let t of u)!o.getRegionState(t.id)?.activeRegionIds.includes(e.regionId)||!at(t,e.bodyFilter)||!r&&!a.has(t.id)&&(a.add(t.id),n+=1,e.onHeld?.(t));if(r&&!l){for(let t of a){let a=c.get(t);a&&(o.controls.applyImpulse(t,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),s+=1,e.onReleased?.(a))}a.clear(),n+=1}for(let e of a)c.has(e)||(a.delete(e),n+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:r,blocked:a.size,released:s,simulatedAt:i,metricRevision:n}),bodyForce:t=>{if(r||!a.has(t.body.id))return null;let i=t.regions?.find(t=>t.id===e.regionId)?.shape;if(!i||"aabb"!==i.type)return{x:.8*-t.body.vx,y:.8*-t.body.vy};let s=e.holdForce??.4;return{x:(i.x-t.body.x)*s-.45*t.body.vx,y:(i.y-t.body.y)*s-.45*t.body.vy}}}}function u(e,t,a){return Math.max(t,Math.min(a,e))}function c(e,t,a={}){let i=a.random??Math.random,s=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],n=u(a.along??.5,.05,.95),r=a.jitterX??0,o=a.padY??20,l=s.x0+(s.x1-s.x0)*n+(2*i()-1)*r,c=Math.min(1,s.width/2),d=u(l,s.x0+c,s.x1-c),p=e.boundaryY(d,"top")+o,h=e.boundaryY(d,"bottom")-o;return{x:d,y:h>p?p+i()*Math.max(1,h-p):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 h(e,t){let a=e;for(let e of t.split(".")){if(null==a||"object"!=typeof a||!Object.prototype.hasOwnProperty.call(a,e))return;a=a[e]}return a}function m(e,t,a,i,s){return"function"==typeof i?i(e,t,a):h(e,i??s)}function y(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function f(e){let t=(e??ca).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 y(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}function g(e){if(Array.isArray(e)){if(e.length>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);return Array.from(new Set(e.map(p).filter(e=>null!=e).map(y))).sort((e,t)=>e-t)}let t=e,a=p(t.start),i=p(t.end),s=p(t.step);if(null==a||null==i||null==s||0>=s||a>i)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let n=Math.floor((i-a)/s)+1;if(n>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);let r=[],o=1e-10*Math.max(1,Math.abs(i),Math.abs(a));for(let e=0;n>e;e+=1){let t=a+e*s;if(t>i+o)break;r.push(y(Math.min(t,i)))}if((!r.length||Math.abs(r[r.length-1]-i)>o)&&r.push(y(i)),r.length>da)throw new RangeError(`physicsReferenceEnvelope sampleAt exceeds ${da} points`);return Array.from(new Set(r)).sort((e,t)=>e-t)}function b(e,t,a,i){let s=e.flatMap((e,s)=>{let n=p(m(e,s,t,a,"time")),r=p(m(e,s,t,i,"value"));return null==n||null==r?[]:[{time:y(n),value:r,index:s}]});s.sort((e,t)=>e.time-t.time||e.index-t.index);let n=[];for(let e of s){let t=n[n.length-1];t?.time===e.time?t.value=e.value:n.push({time:e.time,value:e.value})}return n}function v(e,t){let a=0,i=e.length;for(;i>a;){let s=a+i>>>1;t>e[s].time?a=s+1:i=s}return a}function w(e,t,a,i){if(!e.length)return null;let s=e[0],n=e[e.length-1];if(s.time>t)return"clamp"===i?s.value:null;if(t>n.time)return"clamp"===i?n.value:null;let r=v(e,t),o=e[r];if(o?.time===t)return o.value;let l=e[Math.max(0,r-1)];return"step"!==a&&o&&o.time!==l.time?l.value+(t-l.time)/(o.time-l.time)*(o.value-l.value):l.value}function x(e,t){if(1===e.length)return e[0];let a=(e.length-1)*t,i=Math.floor(a),s=Math.ceil(a);return i===s?e[i]:e[i]+(e[s]-e[i])*(a-i)}function I(e){let t=e.interpolation??"step",a=e.outsideDomain??"omit",i=f(e.quantiles),s=g(e.sampleAt),n=e.runs.map(t=>b(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:s.map(e=>{let s=n.map(i=>w(i,e,t,a)).filter(e=>null!=e).sort((e,t)=>e-t),r={};for(let e of i)r[e]=s.length?x(s,e):null;return{time:e,count:s.length,min:s.length?s[0]:null,max:s.length?s[s.length-1]:null,median:s.length?x(s,.5):null,quantiles:r}}),quantiles:i,interpolation:t,outsideDomain:a,runCount:e.runs.length}}function S(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function A(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let a=p(t);if(null==a||0>a||a>1)throw new RangeError("comparePhysicsTrace quantile selectors must be from 0 to 1; received "+t);let i=y(a);if(!Object.prototype.hasOwnProperty.call(e.quantiles,i))throw Error(`comparePhysicsTrace could not find quantile ${i} in the reference envelope`);return e.quantiles[i]??null}function P(e,t,a){return t>e?"below":e>a?"above":"inside"}function C(e,t){let a=Math.max(0,t.time-e.time);if(0>=a||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 i=e.value-e.lower,s=t.value-t.lower,n=e.value-e.upper,r=t.value-t.upper,o=[0,1];for(let[e,t]of[[i,s],[n,r]])(0>e&&t>0||e>0&&0>t)&&o.push(-e/(t-e));o.sort((e,t)=>e-t);let l=0,u=0,c=0;for(let i=0;o.length-1>i;i+=1){let s=o[i],n=o[i+1];if(s>=n)continue;let r=(s+n)/2,d=(n-s)*a,p=P(e.value+(t.value-e.value)*r,e.lower+(t.lower-e.lower)*r,e.upper+(t.upper-e.upper)*r);"below"===p?l+=d:"above"===p?c+=d:u+=d}return{below:l,inside:u,above:c,observed:a}}function M(e,t,a={}){let i=a.interpolation??t.interpolation,s=a.outsideDomain??t.outsideDomain,n=b(e,a.traceId??"trace",a.timeAccessor,a.valueAccessor),r=a.lower??S(t,"lower"),o=a.upper??S(t,"upper"),l=t.points.map(e=>{let t=w(n,e.time,i,s),a=A(e,r),l=A(e,o);if(null!=a&&null!=l&&a>l)throw new RangeError("comparePhysicsTrace lower band exceeds upper band at time "+e.time);return{time:e.time,value:t,lower:a,upper:l,status:null==t||null==a||null==l?"unobserved":P(t,a,l)}}),u=0,c=0,d=0,p=0,h=null,m=0,y=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?c+=1:"above"===e.status&&(d+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),a=Math.max(0,e.lower-e.value);t>p&&(p=t,h=e.time),a>m&&(m=a,y=e.time)}let f=0,g=0,v=0,x=0;for(let e=0;l.length-1>e;e+=1){let t=l[e],a=l[e+1],s=Math.max(0,a.time-t.time);if(s>0){if("linear"===i){let e=C(t,a);f+=e.below,g+=e.inside,v+=e.above,x+=e.observed;continue}"unobserved"!==t.status&&(x+=s,"below"===t.status?f+=s:"above"===t.status?v+=s:g+=s)}}let I=l[0]?.time,M=l[l.length-1]?.time,R=null==I||null==M?0:Math.max(0,M-I);return{points:l,sampleCount:l.length,observedSamples:u+c+d,belowSamples:u,insideSamples:c,aboveSamples:d,totalDuration:R,observedDuration:x,unobservedDuration:Math.max(0,R-x),belowDuration:f,insideDuration:g,aboveDuration:v,peakExcess:p,peakExcessAt:h,peakDeficit:m,peakDeficitAt:y}}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function E(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function B(e){return!!E(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&E(e.visitsByStage)&&E(e.firstEnteredAt)&&E(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function F(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function T(e,t){let a=t.stageId?.(e);if(a)return a;let i=e.region.metadata;if(i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,"stageId")){let e=i.stageId;if("string"==typeof e)return e}return e.region.id}function k(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,F(e)]))}}function j(e,t,a={}){if("region-enter"!==t.type)return e;let i=T(t,a),s=e.stages.findIndex(e=>e.id===i);if(0>s)return e;let n=a.entityId?.(t)??t.bodyId;if(!n)return e;let r=R(e.entities,n),o=B(r)?r:F(n),l=o.currentStageId?e.stages.findIndex(e=>e.id===o.currentStageId):-1,u=!o.visitedStageIds.includes(i),c=Number(t.observation.timestamp),d=Number.isFinite(c)?c:0,p=R(o.visitsByStage,i),h="number"==typeof p&&Number.isFinite(p)?p:0,m={...o,currentStageId:i,furthestStageId:s>o.furthestStageIndex?i:o.furthestStageId,furthestStageIndex:Math.max(o.furthestStageIndex,s),visitedStageIds:u?[...o.visitedStageIds,i]:o.visitedStageIds,visitsByStage:{...o.visitsByStage,[i]:h+1},firstEnteredAt:u?{...o.firstEnteredAt,[i]:d}:o.firstEnteredAt,lastEnteredAt:{...o.lastEnteredAt,[i]:d},regressionCount:l>=0&&l>s?o.regressionCount+1:o.regressionCount};return{...e,bodyIds:e.bodyIds.includes(n)?e.bodyIds:[...e.bodyIds,n],entities:{...e.entities,[n]:m}}}function N(e){let t=e.bodyIds.map(t=>{let a=R(e.entities,t);return B(a)?a:F(t)}),a=t.length,i=a;return e.stages.map((e,s)=>{let n=t.filter(e=>e.furthestStageIndex>=s).length,r=t.filter(t=>t.visitedStageIds.includes(e.id)).length,o=t.reduce((t,a)=>{let i=R(a.visitsByStage,e.id);return t+("number"==typeof i&&Number.isFinite(i)?i:0)},0),l={id:e.id,label:e.label??e.id,reached:n,entered:r,total:a,conversion:a>0?n/a:0,fromPrevious:i>0?n/i:0,dropoff:Math.max(0,i-n),visits:o,repeatVisits:Math.max(0,o-r)};return i=n,l})}function D(e){return null==e?{top:ha,right:ha,bottom:ha,left:ha}:"number"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function L(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+""}))}function O(e){let[t,a]=e.size,i=e.flow??pa,s=D(e.padding),n=Math.max(.05,Math.min(1,e.channelRatio??ga)),r={x:s.left,y:s.top,width:Math.max(1,t-s.left-s.right),height:Math.max(1,a-s.top-s.bottom)},o="down"===i?r.height:r.width,l=o*Math.max(0,e.chargeExtent??ma),u=o*Math.max(0,e.projectionExtent??fa),c=o*Math.max(0,e.destinationExtent??ya),d=Math.max(0,o-l-c-u),p=L(e.destinations),h=("down"===i?r.width:r.height)/p.length,m="down"===i?(e,t)=>({x:r.x,y:r.y+e,width:r.width,height:t}):(e,t)=>({x:r.x+e,y:r.y,width:t,height:r.height}),y=m(0,l),f=m(l,d),g=l+d,b=m(g,c),v=m(g+c,u),w=p.map((e,t)=>{let a=t*h,s=h*n,o=(h-s)/2;return"down"===i?{id:e.id,label:e.label,order:t,x:r.x+a+o,y:b.y,width:s,height:b.height,centerX:r.x+(t+.5)*h,centerY:b.y+b.height/2}:{id:e.id,label:e.label,order:t,x:b.x,y:r.y+a+o,width:b.width,height:s,centerX:b.x+b.width/2,centerY:r.y+(t+.5)*h}});return{width:t,height:a,flow:i,charge:y,apparatus:f,destinations:w,projection:v}}function $(e,t){return e.destinations.find(e=>e.id===t)}function Y(e,t,a){let{charge:i,flow:s}=e,n=Math.max(1,a),r=(t%n+.5)/n;return"down"===s?{x:i.x+i.width*r,y:i.y+i.height/2}:{x:i.x+i.width/2,y:i.y+i.height*r}}function G(e,t={}){let a=t.thickness??4,i=t.idPrefix??"stage",{destinations:s,flow:n,width:r,height:o}=e,l=[];if(s.length>0){let t=s[0];if("down"===n){let n=t.y+t.height;l.push({id:i+"-floor",shape:{type:"segment",x1:e.charge.x,y1:n,x2:e.charge.x+e.charge.width,y2:n,thickness:a}});for(let e=1;s.length>e;e+=1){let r=s[e].centerX-(s[e].centerX-s[e-1].centerX)/2;l.push({id:`${i}-divider-${e}`,shape:{type:"segment",x1:r,y1:t.y,x2:r,y2:n,thickness:a}})}}else{let n=t.x+t.width;l.push({id:i+"-floor",shape:{type:"segment",x1:n,y1:e.charge.y,x2:n,y2:e.charge.y+e.charge.height,thickness:a}});for(let e=1;s.length>e;e+=1){let r=s[e].centerY-(s[e].centerY-s[e-1].centerY)/2;l.push({id:`${i}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:r,x2:n,y2:r,thickness:a}})}}}return!1!==t.walls&&l.push({id:i+"-wall-left",shape:{type:"segment",x1:1,y1:0,x2:1,y2:o,thickness:a}},{id:i+"-wall-right",shape:{type:"segment",x1:r-1,y1:0,x2:r-1,y2:o,thickness:a}}),l}function U(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 q(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function X(e,t,a,i){let s="function"==typeof e?e(t,a):e;return Number.isFinite(s)?Number(s):i}function V(e,t,a){return q(e[t])??a}function H(e,t){return"number"==typeof e?e:e?.[t]??0}function z(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,a=/* @__PURE__ */new Set;for(let i of e.values){let s=e.scale(i);Number.isFinite(s)&&(a.add(Number(s)),a.add(Number(s)+t))}return Array.from(a).sort((e,t)=>e-t)}function J(e){let{band:t,idPrefix:a,plot:i,projection:s}=e,{includeBoundaryWalls:n=!0,includeInteriorWalls:r=!0,wallThickness:o=4}=t,l=z(t);if(2>l.length)return[];let u=n?l.length-1:l.length-2,c=[];for(let e=n?0:1;u>=e;e+=1){if(!r&&e>0&&l.length-1>e)continue;let t=l[e];c.push({id:`${a}-wall-${e}`,shape:"x"===s?{type:"aabb",x:t,y:i.y+i.height/2,width:o,height:i.height}:{type:"aabb",x:i.x+i.width/2,y:t,width:i.width,height:o}})}return c}function W(e){let{plot:t,idPrefix:a="physics-scale",bounds:i={},xBins:s,xBands:n,yBands:r}=e,o=[];if(!1!==i&&o.push(...mt(t,{idPrefix:a,...i})),s){let{idPrefix:e,yTop:i,yBottom:n,...r}=s;o.push(...ft({...r,idPrefix:e??a+"-xbin",yTop:i??t.y,yBottom:n??t.y+t.height}))}return n&&o.push(...J({band:n,idPrefix:n.idPrefix??a+"-xband",plot:t,projection:"x"})),r&&o.push(...J({band:r,idPrefix:r.idPrefix??a+"-yband",plot:t,projection:"y"})),o}function _(e){let{plot:t,rows:a,columns:i=a+1,pegRadius:s=3,idPrefix:n="galton-peg",yStart:r=t.y+.18*t.height,yEnd:o=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:c=.04}=e,d=Math.max(0,Math.floor(a)),p=Math.max(1,Math.floor(i));if(0===d)return[];let h=d>1?(o-r)/(d-1):0,m=t.width/p,y=[];for(let e=0;d>e;e+=1){let a=l&&e%2==1?m/2:0;for(let i=0;p>i;i+=1){let o=t.x+m*(i+.5)+a;t.x+s>o||o>t.x+t.width-s||y.push({id:`${n}-${e}-${i}`,shape:{type:"aabb",x:o,y:r+e*h,width:2*s,height:2*s},restitution:u,friction:c})}}return y}function K(e,t={}){let{idPrefix:a="physics-token",radius:i=5,shape:s,mass:n,vx:r,vy:o,spawnAt:l,seed:u=1,jitter:c,datum:d}=t,p=Xt(u),h=H(c,"x"),m=H(c,"y");return e.map((e,u)=>{let c=X(t.x,e,u,V(e,"x",0)),y=X(t.y,e,u,V(e,"y",0)),f=X(i,e,u,5),g="function"==typeof s?s(e,u):s??{type:"circle",radius:f};return{id:`${a}-${e.index??u}`,x:c+(p()-.5)*h,y:y+(p()-.5)*m,vx:X(r,e,u,0),vy:X(o,e,u,0),mass:X(n,e,u,1),spawnAt:X(l,e,u,void 0),shape:g,datum:d?d(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...a}=e;return a})}function Q(e,t={}){let{idPrefix:a="sediment",collider:i=!0,colliderThickness:s=1,restitution:n=.05,friction:r=.2,...o}=t,l=ct(e,o),u=i?l.filter(e=>e.height>0).map(e=>({id:`${a}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+s/2,width:e.width,height:s},restitution:n,friction:r})):[];return{columns:l,colliders:u}}function Z(e,t,a){return q("function"==typeof a?a(e,t):e[a]??e.datum?.[a])}function ee(e,t={}){let{timeAccessor:a="arrivalTime",timeScale:i=1,startAt:s=0,rebase:n=!0,sort:r=!0}=t,o=e.map((e,t)=>({spawn:e,time:Z(e,t,a)??e.spawnAt??t})),l=o.length?Math.min(...o.map(e=>e.time)):0;return{initialSpawns:o.map(({spawn:e,time:t})=>({...e,spawnAt:s+(n?t-l:t)})).sort((e,t)=>r?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:s,timeAccessor:"spawnAt",timeScale:i}}}import{$ as te,A as ae,Aa as ie,B as se,Ba as ne,C as re,Ca as oe,D as le,Da as ue,E as ce,Ea as de,F as pe,Fa as he,G as me,Ga as ye,H as fe,Ha as ge,I as be,Ia as ve,J as we,Ja as xe,K as Ie,Ka as Se,L as Ae,La as Pe,M as Ce,Ma as Me,N as Re,Na as Ee,O as Be,Oa as Fe,P as Te,Pa as ke,Q as je,Qa as Ne,R as De,S as Le,T as Oe,U as $e,V as Ye,W as Ge,X as Ue,Y as qe,Z as Xe,_ as Ve,a as He,aa as ze,b as Je,ba as We,c as _e,ca as Ke,d as Qe,da as Ze,e as et,ea as tt,f as at,fa as it,g as st,ga as nt,h as rt,ha as ot,i as lt,ia as ut,j as ct,ja as dt,k as pt,ka as ht,l as mt,la as yt,m as ft,ma as gt,n as bt,na as vt,o as wt,oa as xt,p as It,pa as St,q as At,qa as Pt,r as Ct,ra as Mt,s as Rt,sa as Et,t as Bt,ta as Ft,u as Tt,ua as kt,v as jt,va as Nt,w as Dt,wa as Lt,x as Ot,xa as $t,y as Yt,ya as Gt,z as Ut,za as qt}from"./c-2MHSD3TN.min.js";import"./c-M43PK7K4.min.js";import{a as Xt}from"./c-RHDOOQ4X.min.js";import"./c-LVHJJUOF.min.js";import"./c-N5WT7TXG.min.js";import{Aa as Vt,Oa as Ht,Ob as zt,Pa as Jt,Rb as Wt,Sb as _t,Tb as Kt,Ub as Qt,i as Zt,j as ea,k as ta,l as aa,m as ia,n as sa,za as na}from"./c-UMGHCBH5.min.js";import"./c-Y342FJ6K.min.js";import{r as ra,s as oa,t as la,u as ua}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";var ca=[.1,.5,.9],da=1e6,pa="down",ha=24,ma=.12,ya=.55,fa=0,ga=1,ba=Rt;export{st as BuiltInPhysicsEngineAdapter,Ne as ChainReactionChart,$e as CollisionSwarmChart,Se as CrucibleChart,Mt as DEFAULT_CRUCIBLE_HEIGHT,Ft as DEFAULT_CRUCIBLE_OUTLETS,Et as DEFAULT_CRUCIBLE_SIZE,Pt as DEFAULT_CRUCIBLE_WIDTH,je as EventDropChart,Te as GaltonBoardChart,Ze as GauntletChart,tt as GuantletChart,Jt as MultiLineTooltip,it as PacketFlowChart,nt as PhysicalFlowChart,Oe as PhysicsCustomChart,Le as PhysicsPileChart,bt as PhysicsPipelineStore,Qe as PhysicsSVGOverlay,lt as PhysicsSedimentAccumulator,ut as ProcessFlowChart,Ct as StreamPhysicsFrame,Ht as Tooltip,na as TooltipRoot,De as UnitPileChart,Ie as absorbRegion,Ut as aggregateRegionCounts,yt as applyCrucibleEvent,ee as arrivalReplay,He as bodiesToAnnotationAnchors,Ce as bodyGroupSpec,Ot as buildCollisionSwarmPhysics,St as buildCrucibleEvidence,ne as buildCrucibleInitialSpawns,Nt as buildCrucibleLayout,$t as buildCruciblePhysicsConfig,xe as buildCrucibleProductEvents,gt as buildCrucibleProjection,oe as buildCrucibleStateSpawns,ue as buildCrucibleTerminalSpawns,Tt as buildEventDropPhysics,Bt as buildGaltonBoardPhysics,Yt as buildPhysicalFlowPhysics,Je as buildPhysicsAnnotationContext,Dt as buildPhysicsPile,Be as buildProcessFlowPhysics,ke as calculateBlockerAmplification,be as capacitatedRegion,pe as chargeGateRegion,dt as cloneCrucibleState,W as collidersFromScales,M as comparePhysicsTrace,ve as compileCruciblePlan,Pe as compileDependencyMachine,ea as compileMotionEncoding,e as compilePhysicsEncoding,It as composePhysicsControllers,Qt as composeStyleRules,wt as createCapacityQueueController,rt as createDefaultPhysicsEngineAdapter,l as createDependencyGateController,kt as createInitialCrucibleState,Ee as createLogicalJoin,t as createPhysicsEncodingLayout,At as createPortalController,k as createProcessJourneyLedger,o as createServiceLevelController,n as createServiceResourcePoolController,ie as crucibleBondId,Lt as crucibleBoundaryColliders,Gt as crucibleComponentBodyId,qt as crucibleProductBodyId,vt as crucibleProjectionRows,de as crucibleSemanticKey,ba as default,sa as deriveMotionVector,U as describePhysicsStageGeography,xt as evaluateCrucibleConservation,pt as evaluatePhysicsBodyBudget,Ae as forceFieldRegion,_ as galtonPegs,se as groupCompletionRows,oa as hatchFillId,la as hatchPatternDef,ra as isHatchFill,zt as makeRuleValueResolver,Vt as markTooltipChrome,Wt as matchesThreshold,ce as membraneRegion,_e as normalizePhysicsAnnotations,aa as opacityFromAge,Y as physicsChargePoint,$ as physicsDestination,Ye as physicsProcessBoundaryColliders,qe as physicsProcessGroupSemanticItems,Ge as physicsProcessRegionSemanticItem,Ue as physicsProcessStageSemanticItems,I as physicsReferenceEnvelope,G as physicsStageColliders,O as physicsStageGeography,Ve as planGauntletPropertyWork,we as portalRegion,fe as pressureFieldRegion,ot as processChrome,N as processJourneyRows,Re as processLaneWalls,re as processStageLayout,le as processStageRegions,d as processVolumePolygons,jt as readEventDropOccupancy,ae as regionCountsToProjectionRows,te as replaceGauntletNegative,ge as replayCruciblePlan,Fe as replayStateTransitions,ht as resolveCrucibleSelector,ye as resolveCrucibleSnapshotAt,he as resolveCrucibleTime,i as resolveGauntletTerminalState,s as resolveGauntletTerminalStates,Zt as resolveMotionAccessor,ta as resolveMotionAge,ia as resolveMotionVector,Kt as resolveStyleRules,ua as resolveSvgFill,Me as routeDependencyTracks,me as routeSurfaceRegion,_t as ruleMatches,Q as sedimentBake,ct as sedimentHeightfield,K as spawnFromTokens,c as stageTargetInVolume,j as updateProcessJourney};
|