@phin-tech/dottie 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PARITY.md +1 -1
- package/README.md +7 -2
- package/dist/compile.js +14 -7
- package/dist/dottie-compile.mjs +21 -9
- package/dist/dottie-logic.min.js +1 -1
- package/dist/dottie-player.js +70 -10
- package/dist/dottie-player.min.js +34 -34
- package/dist/dottie-sim.min.js +1 -1
- package/dist/dottie.js +70 -10
- package/dist/types/clicks.d.ts +10 -3
- package/dist/types/compile.d.ts +5 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/player.d.ts +10 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! dottie.js 0.11.
|
|
2
|
-
(function dottiePlayerScript(){"use strict";(()=>{var _r=Object.defineProperty;var Zo=(e,t,n)=>t in e?_r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xo=(e,t)=>{for(var n in t)_r(e,n,{get:t[n],enumerable:!0})};var
|
|
3
|
-
\r`.includes(this.s[this.i]);)this.i++}eat(t){this.skip();let n=[...t];if(this.i+n.length>this.s.length)return!1;for(let r=0;r<n.length;r++)if(this.s[this.i+r]!==n[r])return!1;return n.length===1&&this.s[this.i+1]==="="&&"<>!=".includes(n[0])?!1:(this.i+=n.length,!0)}or(){let t=this.and();if(!t)return null;for(;this.eat("||");){let n=this.and();if(!n)return null;t={k:"bin",op:"||",l:t,r:n}}return t}and(){let t=this.compare();if(!t)return null;for(;this.eat("&&");){let n=this.compare();if(!n)return null;t={k:"bin",op:"&&",l:t,r:n}}return t}compare(){let t=this.sum();if(!t)return null;for(let n of["<=",">=","==","!=","<",">"])if(this.eat(n)){let r=this.sum();return r?{k:"bin",op:n,l:t,r}:null}return t}sum(){let t=this.product();if(!t)return null;for(;;){let n=this.eat("+")?"+":this.eat("-")?"-":null;if(!n)return t;let r=this.product();if(!r)return null;t={k:"bin",op:n,l:t,r}}}product(){let t=this.unary();if(!t)return null;for(;;){let n=["*","/","%"].find(i=>this.eat(i));if(!n)return t;let r=this.unary();if(!r)return null;t={k:"bin",op:n,l:t,r}}}unary(){if(this.eat("!")){let t=this.unary();return t?{k:"not",e:t}:null}if(this.eat("-")){let t=this.unary();return t?{k:"neg",e:t}:null}return this.primary()}primary(){if(this.skip(),this.i>=this.s.length)return null;if(this.eat("(")){let l=this.or();return l&&this.eat(")")?l:null}let t=this.s,n=t[this.i];if(ke(n)){let l=this.i;for(;ke(t[this.i]);)this.i++;if(t[this.i]==="."&&ke(t[this.i+1]))for(this.i++;ke(t[this.i]);)this.i++;return{k:"lit",v:Number(t.slice(l,this.i).join(""))}}if(!Qr(n))return null;let r=this.i;for(;Qr(t[this.i])||ke(t[this.i]);)this.i++;let i=t.slice(r,this.i).join("");if(i.length>Ho)return null;let o=this.i;for(;t[o]===" "||t[o]===" ";)o++;let s=t[o]==="(";if(Ko.includes(i)){if(!s)return{k:"metric",metric:i,target:""};this.eat("(");let l=this.i;for(;this.i<t.length&&t[this.i]!==")"&&t[this.i]!=="(";)this.i++;if(t[this.i]!==")")return null;let a=t.slice(l,this.i).join("").replace(/^[ \t]+|[ \t]+$/g,"");return this.i++,{k:"metric",metric:i,target:a}}if(i in qr){if(!s||!this.eat("("))return null;let l=[];if(!this.eat(")")){do{let c=this.or();if(!c)return null;l.push(c)}while(this.eat(","));if(!this.eat(")"))return null}let a=qr[i];return(a!==null?l.length!==a:l.length===0)?null:{k:"call",fn:i,args:l}}return s?null:i==="true"?{k:"lit",v:!0}:i==="false"?{k:"lit",v:!1}:{k:"name",name:i}}};function Jo(e){return typeof e=="boolean"?e?"true":"false":_o(e)}function _o(e){let t=Math.floor(Math.abs(e)*100+.5);if(!(t<1e15))return e<0?"-\u221E":"\u221E";let n=Math.floor(t/100),r=t-n*100,i=String(n);return r>0&&(i+="."+String(r).padStart(2,"0").replace(/0+$/,"")),(e<0&&t>0?"-":"")+i}function ei(e,t){if(!e.includes("{"))return e;let n="",r=e;for(let i=r.indexOf("{");i>=0;i=r.indexOf("{")){n+=r.slice(0,i);let o=r.indexOf("}",i);if(o<0){n+=r.slice(i),r="";break}let s=r.slice(i+1,o),l=s.includes("{")?null:we(s),a=l?ti(l):[];l&&Dn(l).length===0&&a.length>0&&a.every(c=>t[c]!==void 0)?n+=Jo(bt(l,t)):n+=r.slice(i,o+1),r=r.slice(o+1)}return n+r}var qo=64;function Ke(e){return e.length<=qo&&/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)}function oe(e){let t=we(e);return t!==null&&Dn(t).length>0}function se(e,t,n=null){let r=we(e);return r?$t(bt(r,t,n?(i,o)=>n({metric:i,target:o,op:"",value:0}):null)):!1}function Vn(e,t){return t==="all"?null:t==="initial"?{...e.variables??{}}:{...e.variables??{},...t}}function ni(e,t){let n=Vn(e,t),r=new Set;if(!n)return r;for(let i of e.elements)i.when!==null&&!se(i.when,n)&&r.add(i.id);return r}function ri(e,t){return!t||!e.overrides?[]:e.overrides.filter(n=>!oe(n.when)&&se(n.when,t))}function ii(e){return{...e,reroute:null,offline:null,cost:null,capacity:null,delay:null}}function He(e,t){let n=mt(t);if(e.stroke&&(n.style.stroke={...e.stroke}),e.fill&&(n.style.fill={...e.fill}),e.textColor&&(n.style.textColor={...e.textColor}),e.strokeWidth!==null&&(n.style.strokeWidth=Math.max(0,e.strokeWidth)),e.dash!==null&&(n.style.dash=e.dash),e.text!==null&&(n.text=e.text),e.cost!==null&&n.connector&&(n.connector.cost=Math.min(Math.max(e.cost,0),1e6)),e.capacity!==null&&(n.capacity=Math.max(e.capacity,0)),e.delay!==null&&n.kind!=="connector"&&(n.delay=Math.max(e.delay,0)),e.opacity!==null){let r=Math.min(Math.max(e.opacity,0),1)*(n.style.opacity??1);n.style.opacity=r>=1?null:r}return n}function oi(e){return!!e&&(e.reset===!0||Object.keys(e.set??{}).length>0||(e.toggle??[]).length>0||!!e.run)}function si(e,t,n={}){let r={...t};if(e.reset===!0){r={};for(let o of Object.keys(t))r[o]=!1;Object.assign(r,n)}let i={...r};for(let[o,s]of Object.entries(e.set??{}))r[o]=Qo(s,i,i[o]);for(let o of e.toggle??[])r[o]=!$t(r[o]??!1);return r}function Qo(e,t,n){if(typeof e!="string")return e;let r=we(e);return r?bt(r,t):n??!1}var Pt=(e,t,n)=>({r:e,g:t,b:n,a:1});function ts(e){let t=parseInt(e.slice(1),16);return{r:(t>>16&255)/255,g:(t>>8&255)/255,b:(t&255)/255,a:1}}var es=["accent","muted","danger","warning","success","info"],Nn=e=>es.map((t,n)=>({name:t,color:ts(e[n])})),Yn=Nn(["#2563eb","#6b7280","#dc2626","#d97706","#16a34a","#0891b2"]),Wn=Nn(["#93c5fd","#cbd5e1","#fca5a5","#fcd34d","#86efac","#67e8f9"]),Gn=[{id:"paper",name:"Paper",background:Pt(.984,.98,.965),ink:Pt(.12,.12,.13),palette:Yn},{id:"white",name:"White",background:Pt(1,1,1),ink:Pt(.12,.12,.13),palette:Yn},{id:"sepia",name:"Sepia",background:Pt(.953,.914,.824),ink:Pt(.23,.18,.13),palette:Nn(["#9a3412","#78716c","#b91c1c","#b45309","#4d7c0f","#0e7490"])},{id:"blueprint",name:"Blueprint",background:Pt(.106,.227,.361),ink:Pt(.91,.945,.984),palette:Wn},{id:"chalkboard",name:"Chalkboard",background:Pt(.169,.227,.2),ink:Pt(.945,.945,.918),palette:Wn},{id:"midnight",name:"Midnight",background:Pt(.082,.086,.102),ink:Pt(.925,.925,.94),palette:Wn}];function $n(e){return Gn.find(t=>t.id===e)??null}function zt(e){let t=e.customTheme;return t?{id:"custom",name:t.name,background:t.background,ink:t.ink,palette:t.palette}:$n(e.theme)}function Me(e,t){let n=t.trim().toLowerCase();return(zt(e)?.palette??Yn).find(r=>r.name.toLowerCase()===n)?.color??null}function li(e){let t=r=>!!r.style.named;if(!e.elements.some(t)&&!(e.symbols??[]).some(r=>r.elements.some(t)))return e;let n=r=>{let i=r.style.named;if(!i)return r;let o={...r.style},s=i.fill!==null?Me(e,i.fill):null,l=i.stroke!==null?Me(e,i.stroke):null,a=i.textColor!==null?Me(e,i.textColor):null;return s&&(o.fill={...s}),l&&(o.stroke={...l}),a&&(o.textColor={...a}),{...r,style:o}};return{...e,elements:e.elements.map(n),symbols:e.symbols?e.symbols.map(r=>({...r,elements:r.elements.map(n)})):e.symbols}}var zn=3,ci=["rectangle","ellipse","diamond","text","connector","freehand","path","note","image","symbol"],ns=["linear","easeIn","easeOut","easeInOut","hold","spring","bounce","elastic"],hi={file:["version","pages","images"],page:["id","name","layers","elements","theme","customTheme","logic","guidesX","guidesY","guidesLocked","timeline","symbols","variables","flows"],flow:["id","from","to","every","speed","color","size","when","spread","volume","overrides"],flowOverride:["when","volume"],symbol:["id","name","width","height","layers","elements","timeline","button","params"],layer:["id","name","visible","locked"],rgba:["r","g","b","a"],style:["stroke","fill","fillStyle","strokeWidth","dash","roughness","bowing","fontSize","font","gridSize","opacity","dashOffset","textColor","named"],colorNames:["fill","stroke","textColor"],customTheme:["name","background","ink","palette","base"],paletteColor:["name","color"],element:["id","kind","x","y","width","height","style","seed","layerID","text","connector","groupID","points","path","subpaths","evenOdd","rotation","link","url","anchor","click","hover","when","overrides","symbol","playback","offset","args","image","reveal","ports","labelRect","extension","capacity","delay","queue","gauge","containerID","container"],container:["fixed","lanes"],gauge:["metric","of","max","warn","alarm","style","label"],strokePoint:["x","y"],subpath:["closed","coords"],inlineImage:["data","format"],endpoint:["elementID","port","portIndex","x","y"],extensionRef:["id","shape","version","params"],normalizedPoint:["x","y"],normalizedRect:["x","y","width","height"],connector:["start","end","routing","startHead","endHead","waypoints","hops","avoid","cost"],waypoint:["x","y"],timeline:["fps","duration","boil","settle","poster","tracks","camera","markers"],track:["element","keys","boil","follow","repeats","march"],keyframe:["t","x","y","width","height","rotation","strokeWidth","stroke","fill","visible","reveal","opacity","ease"],follow:["path","start","end","ease","reverse","orient","laps"],repeat:["start","end","count"],cameraKey:["t","x","y","width","height","ease"],marker:["t","name","loop"],click:["scene","url","set","toggle","reset","run"],hover:["stroke","fill","opacity"],override:["when","stroke","fill","textColor","opacity","strokeWidth","dash","text","reroute","offline","cost","capacity","delay"]},le=3600,Bn=1e4,fi=e=>e===void 0||!Number.isFinite(e)||e===0?null:Math.min(Math.max(e,-Bn),Bn),jn=3,_t={r:.12,g:.12,b:.13,a:1},mi={r:0,g:0,b:0,a:0},di={r:.93,g:.93,b:.94,a:1},Ot=class extends Error{},G=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),C=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,N=e=>typeof e=="string"?e:void 0,ai=e=>G(e)&&Object.values(e).every(t=>typeof t=="string")?{...e}:null,xt=e=>typeof e=="boolean"?e:void 0,ui="00000000-0000-0000-0000-000000000000",Pe=/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/,kt=e=>typeof e=="string"?e.toUpperCase():void 0;function dt(e){return Number.isFinite(e)?Math.min(Math.max(e,0),le):e===1/0?le:0}function ue(e){return Number.isFinite(e)?Math.min(Math.max(e,1),60):12}function qt(e){let t=e.trim();return!/^(https?:\/\/|mailto:)/i.test(t)||[...t].length<=7||/[\u0000-\u001f\u007f-\u009f]/.test(t)?null:t}function ve(e){return e?qt(e):null}function yt(e){if(!G(e))return;let t=C(e.r),n=C(e.g),r=C(e.b);if(!(t===void 0||n===void 0||r===void 0))return{r:t,g:n,b:r,a:C(e.a)??1}}var Un=class{constructor(){T(this,"warnings",[]);T(this,"seen",new Set)}warn(t){this.seen.has(t)||(this.seen.add(t),this.warnings.push(t))}fields(t,n){let r=hi[n];for(let i of Object.keys(t))r.includes(i)||this.warn(`Unknown field "${i}" on ${n}, ignored`)}style(t){let n=G(t)?t:{};this.fields(n,"style");let r=N(n.fillStyle)??"solid",i=N(n.dash)??"solid";return["solid","hachure","crossHatch","grid"].includes(r)||this.warn(`Unknown fill style "${r}", drawn solid`),["solid","dashed","dotted"].includes(i)||this.warn(`Unknown dash "${i}", drawn solid`),{stroke:yt(n.stroke)??{..._t},fill:yt(n.fill)??{...mi},fillStyle:["solid","hachure","crossHatch","grid"].includes(r)?r:"solid",strokeWidth:C(n.strokeWidth)??2,dash:["solid","dashed","dotted"].includes(i)?i:"solid",roughness:C(n.roughness)??1,bowing:C(n.bowing)??1,fontSize:C(n.fontSize)??18,font:N(n.font)||null,gridSize:C(n.gridSize)??null,opacity:C(n.opacity)??null,dashOffset:C(n.dashOffset)??null,textColor:yt(n.textColor)??null,named:this.colorNames(n.named)}}container(t){return G(t)?(this.fields(t,"container"),{fixed:t.fixed===!0?!0:null,lanes:t.lanes==="rows"||t.lanes==="columns"?t.lanes:null}):null}colorNames(t){if(!G(t))return null;this.fields(t,"colorNames");let n={fill:N(t.fill)??null,stroke:N(t.stroke)??null,textColor:N(t.textColor)??null};return n.fill===null&&n.stroke===null&&n.textColor===null?null:n}customTheme(t){if(!G(t))return null;this.fields(t,"customTheme");let n=yt(t.background),r=yt(t.ink);if(!n||!r)return this.warn("A custom theme needs a background and an ink; drawn without it"),null;let i=(Array.isArray(t.palette)?t.palette:[]).filter(G).flatMap(o=>{this.fields(o,"paletteColor");let s=N(o.name),l=yt(o.color);return s&&l?[{name:s,color:l}]:[]});return{name:N(t.name)??"Custom",background:n,ink:r,palette:i,base:N(t.base)??null}}endpoint(t){let n=G(t)?t:{},r=N(n.port),i=C(n.portIndex);return{elementID:kt(n.elementID)??null,port:r&&["top","right","bottom","left"].includes(r)?r:null,portIndex:i!==void 0&&Number.isInteger(i)&&i>=0?i:null,x:C(n.x)??0,y:C(n.y)??0}}connector(t){if(!G(t))return null;this.fields(t,"connector");let n=(i,o)=>{let s=N(i);return s&&["none","arrow","triangle","dot","bar"].includes(s)?s:o},r=N(t.routing);return{start:this.endpoint(t.start),end:this.endpoint(t.end),routing:r&&["straight","curved","elbow"].includes(r)?r:"straight",startHead:n(t.startHead,"none"),endHead:n(t.endHead,"arrow"),waypoints:Array.isArray(t.waypoints)?t.waypoints.filter(G).map(i=>(this.fields(i,"waypoint"),{x:C(i.x)??0,y:C(i.y)??0})):null,hops:typeof t.hops=="boolean"?t.hops:null,avoid:typeof t.avoid=="boolean"?t.avoid:null,cost:typeof t.cost=="number"&&Number.isFinite(t.cost)?t.cost:null}}image(t,n){if(!G(t))return null;let r=N(t.ref);if(r!==void 0)return n[r]??{data:"",format:"png"};let i=N(t.data);return i===void 0?null:this.picture(i,N(t.format))}picture(t,n){return rs.test(t)?{data:t.replace(/\s+/g,""),format:n==="jpeg"?"jpeg":"png"}:(this.warn("Skipped a picture whose data isn't base64"),{data:"",format:"png"})}element(t,n){if(!G(t))return null;this.fields(t,"element");let r=kt(t.id),i=N(t.kind),o=kt(t.layerID);if(!r||!i||!o)return this.warn("Skipped an element without an id, kind or layer"),null;ci.includes(i)||this.warn(`Unknown element kind "${i}", drawn as a placeholder`);let s=Array.isArray(t.subpaths)?t.subpaths.filter(G).map(l=>({closed:xt(l.closed)??!1,coords:Array.isArray(l.coords)?l.coords.filter(a=>typeof a=="number"):[]})):null;return{id:r,kind:i,layerID:o,x:C(t.x)??0,y:C(t.y)??0,width:C(t.width)??0,height:C(t.height)??0,style:this.style(t.style),seed:(C(t.seed)??1)>>>0,text:N(t.text)??null,connector:this.connector(t.connector),groupID:kt(t.groupID)??null,points:Array.isArray(t.points)?t.points.filter(G).map(l=>({x:C(l.x)??0,y:C(l.y)??0})):null,path:Array.isArray(t.path)?t.path.filter(l=>typeof l=="number"):null,subpaths:s,evenOdd:xt(t.evenOdd)??null,rotation:C(t.rotation)??null,link:kt(t.link)??null,url:N(t.url)??null,anchor:N(t.anchor)??null,click:this.click(t.click),hover:this.hover(t.hover),when:N(t.when)??null,overrides:this.overrides(t.overrides),symbol:kt(t.symbol)??null,playback:this.playback(t.playback),offset:C(t.offset)??null,args:ai(t.args),image:this.image(t.image,n),reveal:C(t.reveal)??null,ports:Array.isArray(t.ports)?t.ports.map(l=>{let a=G(l)?l:{};return{x:C(a.x)??0,y:C(a.y)??0}}):null,labelRect:this.labelRect(t.labelRect),extension:this.extension(t.extension),capacity:C(t.capacity)??null,delay:C(t.delay)??null,queue:t.queue===!0?!0:null,gauge:this.gauge(t.gauge),containerID:kt(t.containerID)??null,container:this.container(t.container)}}gauge(t){if(!G(t))return null;this.fields(t,"gauge");let n=i=>typeof i=="number"&&Number.isFinite(i)?i:null,r=N(t.style);return{metric:N(t.metric)??"",of:typeof t.of=="string"&&Pe.test(t.of)?t.of.toUpperCase():ui,max:n(t.max),warn:n(t.warn),alarm:n(t.alarm),style:r==="number"||r==="bar"||r==="dial"?r:null,label:N(t.label)??null}}labelRect(t){return G(t)?(this.fields(t,"normalizedRect"),{x:C(t.x)??0,y:C(t.y)??0,width:C(t.width)??0,height:C(t.height)??0}):null}extension(t){if(!G(t))return null;this.fields(t,"extensionRef");let n=N(t.id),r=N(t.shape),i=N(t.version);if(n===void 0||r===void 0||i===void 0)return this.warn("Skipped an extension without an id, shape or version"),null;let o={};if(G(t.params))for(let[s,l]of Object.entries(t.params))(typeof l=="number"||typeof l=="boolean"||typeof l=="string")&&(o[s]=l);return{id:n,shape:r,version:i,params:o}}variables(t){if(!G(t))return null;let n={};for(let[r,i]of Object.entries(t))(typeof i=="boolean"||typeof i=="number"&&Number.isFinite(i))&&(n[r]=i);return Object.keys(n).length>0?n:null}click(t){if(!G(t))return null;this.fields(t,"click");let n=N(t.url),r=n===void 0?null:qt(n);n!==void 0&&r===null&&this.warn("Skipped a click link that isn't http, https or mailto");let i=null;if(G(t.set)){i={};for(let[a,c]of Object.entries(t.set))Ke(a)&&(typeof c=="boolean"||typeof c=="string"||typeof c=="number"&&Number.isFinite(c))&&(i[a]=c);Object.keys(i).length===0&&(i=null)}let o=typeof t.toggle=="string"?[t.toggle]:Array.isArray(t.toggle)&&t.toggle.every(a=>typeof a=="string")?t.toggle:null,s=o?o.filter(Ke):null,l=N(t.run);return{scene:N(t.scene)??null,url:r,set:i,toggle:s&&s.length>0?s:null,reset:t.reset===!0?!0:null,run:l!==void 0&&Ke(l)?l:null}}playback(t){let n=N(t);return n===void 0?null:["loop","once","still","click"].includes(n)?n:"loop"}symbol(t,n){if(!G(t))return null;this.fields(t,"symbol");let r=kt(t.id);if(!r)return this.warn("Skipped a symbol without an id"),null;let i=s=>{let l=C(s);return Math.max(1,l??100)},o=(Array.isArray(t.layers)?t.layers:[]).filter(G).flatMap(s=>{let l=kt(s.id);return l?[{id:l,name:N(s.name)??"",visible:xt(s.visible)??!0,locked:xt(s.locked)??!1}]:[]});return o.length===0&&o.push({id:`${r}-LAYER`,name:"Layer 1",visible:!0,locked:!1}),{id:r,name:N(t.name)??"Symbol",width:i(t.width),height:i(t.height),layers:o,elements:(Array.isArray(t.elements)?t.elements:[]).map(s=>this.element(s,n)).filter(s=>s!==null),timeline:this.timeline(t.timeline),button:xt(t.button)??null,params:ai(t.params)}}overrides(t){return Array.isArray(t)?t.filter(G).map(n=>{this.fields(n,"override");let r=N(n.dash),i=null;if(G(n.reroute)&&Object.values(n.reroute).every(o=>typeof o=="string"&&Pe.test(o))){i={};for(let[o,s]of Object.entries(n.reroute))Pe.test(o)&&(i[o.toUpperCase()]=s.toUpperCase());Object.keys(i).length===0&&(i=null)}return{when:N(n.when)??"",stroke:yt(n.stroke)??null,fill:yt(n.fill)??null,textColor:yt(n.textColor)??null,opacity:C(n.opacity)??null,strokeWidth:C(n.strokeWidth)??null,dash:r!==void 0&&["solid","dashed","dotted"].includes(r)?r:null,text:N(n.text)??null,reroute:i,offline:n.offline===!0?!0:null,cost:typeof n.cost=="number"&&Number.isFinite(n.cost)?n.cost:null,capacity:typeof n.capacity=="number"&&Number.isFinite(n.capacity)?n.capacity:null,delay:typeof n.delay=="number"&&Number.isFinite(n.delay)?n.delay:null}}):null}hover(t){return G(t)?(this.fields(t,"hover"),{stroke:yt(t.stroke)??null,fill:yt(t.fill)??null,opacity:C(t.opacity)??null}):null}ease(t){let n=N(t);return n===void 0?null:ns.includes(n)?n:(this.warn(`Unknown ease "${n}", played linear`),null)}keyframe(t){if(!G(t))return null;this.fields(t,"keyframe");let n=C(t.t);if(n===void 0)return null;let r={t:n};for(let a of["x","y","width","height","rotation","strokeWidth","reveal","opacity"]){let c=C(t[a]);c!==void 0&&(r[a]=c)}let i=yt(t.stroke),o=yt(t.fill),s=xt(t.visible),l=this.ease(t.ease);return i&&(r.stroke=i),o&&(r.fill=o),s!==void 0&&(r.visible=s),l&&(r.ease=l),r}track(t){if(!G(t))return null;this.fields(t,"track");let n=kt(t.element);if(!n)return null;let r=(Array.isArray(t.keys)?t.keys:[]).map(s=>this.keyframe(s)).filter(s=>s!==null&&s.t>=0&&s.t<=le);Je(r,s=>s.t);let i=Array.isArray(t.follow)?t.follow.filter(G).flatMap(s=>{let l=kt(s.path),a=C(s.start),c=C(s.end);return!l||a===void 0||c===void 0||a<0||c>le?[]:[{path:l,start:a,end:c,ease:this.ease(s.ease),reverse:xt(s.reverse)??null,orient:xt(s.orient)??null,laps:C(s.laps)??null}]}):null,o=Array.isArray(t.repeats)?t.repeats.filter(G).flatMap(s=>{let l=C(s.start),a=C(s.end);if(l===void 0||a===void 0)return[];let c=C(s.count),u={start:l,end:a,count:c===void 0?null:Math.trunc(c)};return _e(u)?[u]:[]}):null;return{element:n,keys:r,boil:xt(t.boil)??null,follow:i,repeats:o,march:fi(C(t.march))}}timeline(t){if(!G(t))return null;this.fields(t,"timeline");let n=C(t.boil),r=Array.isArray(t.camera)?t.camera.filter(G).flatMap(s=>{let l=C(s.t),a=C(s.x),c=C(s.y),u=C(s.width),h=C(s.height);return l===void 0||a===void 0||c===void 0||u===void 0||h===void 0?[]:u>1&&h>1&&l>=0?[{t:l,x:a,y:c,width:u,height:h,ease:this.ease(s.ease)}]:[]}):null;r&&Je(r,s=>s.t);let i=Array.isArray(t.markers)?t.markers.filter(G).flatMap(s=>{let l=C(s.t);return l!==void 0&&l>=0?[{t:l,name:N(s.name)??"",loop:xt(s.loop)??null}]:[]}):null;i&&Je(i,s=>s.t);let o=C(t.poster);return{fps:ue(C(t.fps)??12),duration:dt(C(t.duration)??0),boil:n!==void 0&&Number.isInteger(n)&&n>0?Math.min(n,1e4):null,settle:xt(t.settle)??null,poster:o===void 0?null:dt(o),tracks:(Array.isArray(t.tracks)?t.tracks:[]).map(s=>this.track(s)).filter(s=>s!==null),camera:r,markers:i}}page(t,n,r){if(!G(t))throw new Ot(`Page ${r} is not an object`);this.fields(t,"page");let i=(Array.isArray(t.layers)?t.layers:[]).filter(G).flatMap(o=>{let s=kt(o.id);return s?[{id:s,name:N(o.name)??"",visible:xt(o.visible)??!0,locked:xt(o.locked)??!1}]:[]});return i.length===0&&(this.warn(`Page ${r} has no layers`),i.push({id:"LAYER",name:"Layer 1",visible:!0,locked:!1})),{id:kt(t.id)??`PAGE-${r}`,name:N(t.name)??`Page ${r}`,layers:i,elements:(Array.isArray(t.elements)?t.elements:[]).map(o=>this.element(o,n)).filter(o=>o!==null),theme:N(t.theme)??null,customTheme:this.customTheme(t.customTheme),logic:typeof t.logic=="string"&&t.logic.length>0?t.logic:null,timeline:this.timeline(t.timeline),symbols:Array.isArray(t.symbols)?t.symbols.map(o=>this.symbol(o,n)).filter(o=>o!==null):null,variables:this.variables(t.variables),flows:Array.isArray(t.flows)?t.flows.filter(G).map(o=>this.flow(o)):null}}flow(t){this.fields(t,"flow");let n=i=>typeof i=="string"&&Pe.test(i)?i.toUpperCase():ui,r=i=>{let o=C(i);return o!==void 0&&Number.isFinite(o)?o:null};return{id:n(t.id),from:n(t.from),to:Array.isArray(t.to)&&t.to.every(i=>typeof i=="string")?t.to.filter(i=>Pe.test(i)).map(i=>i.toUpperCase()):[],every:r(t.every),speed:r(t.speed),size:r(t.size),color:G(t.color)&&["r","g","b","a"].every(i=>typeof t.color[i]=="number")?yt(t.color)??null:null,when:N(t.when)??null,spread:t.spread===!0?!0:null,volume:r(t.volume),overrides:Array.isArray(t.overrides)&&t.overrides.length>0?t.overrides.filter(G).map(i=>(this.fields(i,"flowOverride"),{when:N(i.when)??"",volume:r(i.volume)})):null}}},rs=/^[A-Za-z0-9+/=\s]*$/;function _e(e){return Number.isFinite(e.start)&&Number.isFinite(e.end)&&e.start>=0&&e.end-e.start>.001&&e.end<=le&&(e.count===null||e.count>=1&&e.count<=1e4)}function Je(e,t){let n=e.map((r,i)=>[r,i]);n.sort((r,i)=>t(r[0])-t(i[0])||r[1]-i[1]);for(let r=0;r<e.length;r++)e[r]=n[r][0]}function Ee(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){throw new Ot(`Not JSON: ${s.message}`)}if(!G(t))throw new Ot("Not a Dottie drawing");let n=C(t.version);if(n===void 0)throw new Ot("Not a Dottie drawing (no version)");if(!Array.isArray(t.pages)||t.pages.length===0)throw new Ot("A drawing needs at least one page");let r=new Un;r.fields(t,"file"),n>zn&&r.warn(`File version ${n} is newer than this player knows (${zn}); some things may not show`);let i={};if(G(t.images))for(let[s,l]of Object.entries(t.images))G(l)&&typeof l.data=="string"&&(i[s]=r.picture(l.data,N(l.format)));let o=t.pages.map((s,l)=>li(r.page(s,i,l+1)));if(new Set(o.map(s=>s.id)).size!==o.length)throw new Ot("Two pages share an id");return{version:n,pages:o,warnings:r.warnings}}function ce(e){return .2126*e.r+.7152*e.g+.0722*e.b}function ae(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}function Re(e){return ae(e,_t)||ae(e,di)}function mt(e){return{...e,style:{...e.style,stroke:{...e.style.stroke},fill:{...e.style.fill},textColor:e.style.textColor?{...e.style.textColor}:null,named:e.style.named?{...e.style.named}:e.style.named},connector:e.connector?{...e.connector,start:{...e.connector.start},end:{...e.connector.end},waypoints:e.connector.waypoints?.map(t=>({...t}))??null}:null,gauge:e.gauge?{...e.gauge}:e.gauge}}function Dt(e){if(e.layers.length<=1)return e.elements;let t=new Map;e.layers.forEach((r,i)=>{t.has(r.id)||t.set(r.id,i)});let n=e.layers.map(()=>[]);for(let r of e.elements)n[t.get(r.layerID)??0].push(r);return n.flat()}function is(e){let t=new Map;for(let n of e.elements)t.has(n.id)||t.set(n.id,n);return t}var pi=.60205078125,gi=.92822265625,yi=.23583984375,Qt={"Architects Daughter":{faces:{regular:{ascent:.986328125,descent:.4033203125,k:{},leading:0,w:{" ":400.39,_:686.52,"-":310.55,"\u2013":310.55,"\u2014":411.13,",":177.73,";":124.02,":":166.99,"!":134.77,"?":505.86,".":140.63,"\u2026":422.85,"\xB7":140.63,"'":162.11,"\u2018":162.11,"\u2019":162.11,'"':236.33,"\u201C":236.33,"\u201D":236.33,"(":297.85,")":351.56,"[":424.8,"]":541.02,"{":352.54,"}":478.52,"@":1042.97,"*":507.81,"/":455.08,"\\":501.95,"&":669.92,"#":637.7,"%":518.55,"\u2022":192.38,"`":171.88,"^":306.64,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":524.41,"\xD7":470.7,"<":475.59,"=":492.19,">":471.68,"|":145.51,"~":444.34,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556.64,0:630.86,1:127.93,2:572.27,3:508.79,4:680.66,5:708.01,6:626.95,7:615.23,8:648.44,9:569.34,a:508.79,A:640.63,b:561.52,B:710.94,c:632.81,C:708.01,d:512.7,D:648.44,e:541.02,E:591.8,\u00E9:541.02,f:593.75,F:692.38,g:515.63,G:692.38,h:495.12,H:605.47,i:151.37,I:151.37,j:177.73,J:529.3,k:614.26,K:605.47,l:157.23,L:692.38,m:778.32,M:827.15,n:500,N:626.95,o:562.5,O:669.92,p:556.64,P:637.7,q:513.67,Q:712.89,r:551.76,R:712.89,s:501.95,S:642.58,t:404.3,T:623.05,u:507.81,U:561.52,v:518.55,V:626.95,w:808.59,W:940.43,x:470.7,X:599.61,y:548.83,Y:534.18,z:495.12,Z:784.18}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},Caveat:{faces:{bold:{ascent:.9600067138671875,descent:.3000030517578125,k:{AC:-20,AE:-10,AG:-10,AH:-10,AI:10,Aj:10,AJ:10,AL:-10,AM:10,An:-10,AO:-20,AP:-10,Aq:-10,AQ:-20,Ar:-10,As:-10,AS:-35,AT:-50,Au:-10,AU:-20,av:-20,Av:-5,AV:-40,aw:-10,AW:-20,Ax:10,AX:-10,ay:-20,Ay:-10,AY:-65,Az:20,AZ:-10,ba:-10,bc:-10,BC:-20,bd:-10,Bf:10,BF:-20,Bg:10,bh:-5,Bi:10,BI:-10,bj:-5,Bj:10,BJ:-10,Bk:10,Bl:10,Bm:10,BP:-10,BR:-10,BS:-20,BT:-40,bu:-10,BU:-20,BV:-50,BW:-50,bx:-10,Bx:10,BX:-40,by:-10,BY:-65,Bz:40,BZ:-30,CA:-20,Cc:-5,CC:-10,Cd:-10,CE:-10,CG:-10,Cj:10,CJ:-10,CK:-10,cl:10,Cl:5,Cn:-5,CO:-10,CP:-10,CQ:-20,Cs:-10,CS:-10,Ct:10,CT:-20,Cu:-10,CU:-10,Cv:-20,CV:-20,cw:-10,Cw:-10,CW:-20,Cx:20,CX:-30,cy:-5,CY:-35,Cz:20,CZ:-40,DA:-10,Db:10,Dc:10,De:10,Df:20,DF:-10,Dg:10,Dh:10,Di:15,DI:-10,Dj:5,DJ:-10,Dk:10,Dl:10,Dm:20,DM:-5,dn:-10,Do:10,Dp:10,Dq:10,Dr:10,Ds:10,dt:10,Dt:20,DT:-40,du:-10,Dv:30,DV:-30,Dw:20,DW:-10,Dx:20,DX:-50,Dy:10,DY:-50,Dz:30,DZ:-30,EC:-10,ED:-10,EG:-10,EJ:-10,el:10,EO:-10,EQ:-20,ES:-40,ET:-10,EU:-20,Ev:-10,EV:-25,Ew:-10,EW:-30,Ex:10,EX:-40,Ey:-10,EY:-50,Ez:20,EZ:-20,fa:-10,Fa:-30,FA:-40,Fc:-20,FC:-10,Fd:-20,FD:20,Fe:-15,ff:10,Ff:10,FF:20,Fg:-10,fh:10,Fh:20,fi:10,Fi:10,FI:10,fj:10,Fj:10,FJ:20,Fk:10,fl:20,Fl:20,FL:10,fm:10,FM:-10,Fn:-20,FN:10,Fo:-20,FO:10,Fp:-10,FP:-10,Fq:-10,FQ:10,Fr:-10,FS:10,ft:40,Ft:10,FT:-30,Fu:-10,fv:10,Fv:10,FV:10,FW:10,fy:10,FY:10,Fz:10,FZ:-10,GA:-10,Gf:10,Gh:10,gi:10,Gi:10,GI:-10,Gj:10,GJ:-10,Gk:10,Gl:10,Gm:10,GM:-10,GN:10,GP:-20,GS:-10,Gt:10,GU:-10,Gv:10,GV:-10,GW:-20,Gx:10,GX:-40,gy:10,GY:-40,Gz:10,GZ:-20,Hb:10,hf:-10,Hf:10,hg:-20,Hh:10,Hi:10,Hj:20,Hk:10,Hl:10,Hm:10,hq:-10,hs:-10,Ht:20,hv:-30,Hv:10,hw:-15,Hx:20,hy:-30,Hy:10,Hz:20,Ia:-10,IA:10,Ib:10,Ic:-10,Id:-10,ID:30,Ie:-10,if:10,If:20,IF:40,Ig:-10,Ih:30,Ii:20,II:30,Ij:30,IJ:40,Ik:20,IK:10,Il:20,IL:10,IM:30,In:-10,IN:20,Io:-10,Ip:10,Iq:-20,Ir:-10,IR:10,Is:-10,It:10,Iu:-10,IU:10,iv:10,Iv:-20,IV:30,Iw:-25,IW:20,Ix:10,IX:10,Iy:-10,IY:30,Iz:20,IZ:20,Ja:-10,Jb:10,Jc:-10,Jd:-10,Je:-10,Jf:10,Jh:10,Ji:10,JI:-10,Jj:20,JJ:10,Jk:10,Jl:20,Jn:-10,Jo:-10,JO:-10,Jp:10,JP:-10,Jq:-10,JQ:-10,JR:-10,jt:10,Jt:20,JT:10,ju:-10,Ju:-20,JU:-10,jx:10,JX:-25,jy:10,JY:-20,jz:10,Jz:10,JZ:-20,Ka:-40,kc:20,Kc:-40,KC:-10,Kd:-40,KD:10,ke:10,Ke:-40,kf:20,Kf:10,KF:20,Kg:-40,KG:-10,kh:10,Kh:10,ki:10,Ki:10,Kj:40,KJ:20,kk:20,Kk:10,kl:20,Kl:10,km:10,KM:20,Kn:-40,ko:10,Ko:-50,KO:-10,Kp:10,Kq:-50,kr:10,Ks:-40,kt:10,Kt:10,KT:-10,ku:10,Ku:-60,kv:10,Kv:-30,Kw:-40,Kx:-10,KX:-10,ky:-10,Ky:-30,kz:10,Lb:-10,LC:-20,LE:-20,Lf:10,Lg:-10,LG:-20,Lh:-10,Li:10,LI:-40,Lj:20,Lk:10,ll:10,Ll:10,LL:-20,Ln:-20,LO:-25,Lp:10,Lq:-40,LQ:-30,Ls:-10,LS:-65,lt:10,Lt:-10,LT:-70,Lu:-40,LU:-45,Lv:-60,LV:-70,Lw:-40,LW:-40,Lx:10,Ly:-20,LY:-90,lz:20,Lz:30,LZ:-10,Mb:10,md:10,Mf:10,Mh:10,Mi:10,MJ:10,Mk:10,Ml:10,mo:20,Mp:10,MP:-10,Mq:-10,MQ:-10,MS:-20,Mt:20,MT:-30,Mu:-10,MU:-20,mv:-15,Mv:10,MV:-20,mw:-10,MW:-30,Mx:10,MX:-10,my:-10,My:-10,MY:-50,Mz:10,MZ:-10,nb:-15,Nb:10,Ne:10,Nf:10,Ng:10,Nh:10,Ni:20,Nj:20,Nk:20,Nl:20,Nm:10,Nq:10,ns:-5,nt:-10,Nt:20,nu:-10,nv:-20,Nv:30,nw:-20,NW:-10,Nx:30,NX:-20,ny:-20,Ny:10,NY:-20,Nz:40,NZ:-10,OA:-10,OD:-10,Of:20,Og:20,Oh:10,Oi:20,OI:-10,oj:-5,Oj:20,Ok:10,Ol:20,OL:10,Om:20,Oo:10,Op:10,Oq:10,OQ:10,Os:10,Ot:20,OT:-10,ou:-10,ov:5,Ov:30,OV:-10,ow:-10,Ow:10,OW:-10,Ox:30,OX:-40,oy:-10,Oy:20,OY:-40,Oz:30,OZ:-20,Pa:-40,PA:-40,Pc:-30,Pd:-40,PD:-10,Pe:-20,Pf:10,Pg:-10,Ph:10,Pi:10,PI:-10,Pj:20,PJ:-10,Pk:10,Pl:10,Pm:10,PM:-30,pn:-10,Pn:-10,PN:-10,Po:-30,Pq:-30,Ps:-20,PS:10,Pt:20,pu:-10,Pu:-30,Pv:10,Px:10,PX:-35,py:-10,PY:-20,Pz:10,PZ:-50,Qb:10,Qf:20,Qg:20,qh:-10,Qh:10,Qi:20,qj:10,Qj:90,QJ:80,Qk:10,Ql:20,Qm:20,qn:-10,qo:-10,Qp:20,Qt:30,QT:-10,qu:-10,Qv:20,QV:-10,QW:-10,Qx:20,QX:-20,Qy:50,QY:-30,Qz:40,QZ:-10,ra:-5,Ra:-10,RA:-25,RB:-10,Rc:-10,RC:-20,Rd:-10,RD:10,Re:-10,RE:-20,Rf:20,RF:10,Rg:-10,RG:-10,ri:5,RI:-10,Rj:30,RJ:30,RL:-10,RM:-20,Rn:-10,RN:10,Ro:-10,RO:-10,Rp:20,Rq:-30,RQ:-10,Rr:-10,Rs:-10,Rt:10,RT:-10,Ru:-30,RU:-20,rv:20,RV:-10,Rw:-10,RW:-10,Rx:10,RX:-20,Ry:10,RY:-30,Rz:20,RZ:-45,Sa:-10,Sb:10,Sc:-20,Sd:-25,SD:20,Se:-20,SE:-10,sf:10,Sf:20,SF:30,Sg:-20,Sh:20,Si:20,SI:10,Sj:30,SJ:30,Sk:10,Sl:20,SL:20,Sn:-20,SN:10,So:-10,SO:10,Sq:-20,Sr:-10,Ss:-10,st:10,St:20,Su:-20,sv:20,Sv:-50,SV:20,Sw:-30,SW:10,sx:15,Sx:10,Sy:-15,SY:10,sz:20,Sz:20,SZ:-10,Ta:-90,TA:-50,Tc:-80,TC:-10,Td:-110,TD:10,Te:-90,TE:-10,Tf:20,TF:30,Tg:-80,TG:-10,Th:20,ti:5,TI:10,Tj:20,Tk:10,Tl:20,Tm:-50,TM:-30,Tn:-90,To:-90,Tp:-80,Tq:-120,Tr:-80,Ts:-80,Tt:10,TT:-30,Tu:-90,tv:10,Tv:-70,TV:10,Tw:-100,tx:20,Tx:-60,TX:-10,Ty:-50,tz:30,Tz:-40,TZ:-10,ub:-10,Ub:20,UE:10,uf:10,Uf:30,UF:10,Ug:10,Uh:30,ui:10,Ui:30,Uj:40,uk:10,Uk:20,ul:10,Ul:30,Um:30,Up:10,UQ:30,Ur:10,UR:10,Us:10,Ut:50,UT:20,Uu:10,UU:10,Uv:50,UV:10,Uw:10,ux:10,Ux:30,UX:-10,Uy:10,UY:-10,uz:30,Uz:30,UZ:-10,va:-10,Va:-50,VA:-55,Vc:-30,VC:-20,Vd:-30,Ve:-30,VE:-20,vf:10,VF:10,Vg:-30,VG:-10,vi:10,Vm:-10,VM:-30,Vn:-30,VN:-10,Vo:-30,VO:-10,Vp:-20,VP:-20,Vq:-30,VQ:-10,Vr:-20,Vs:-30,vt:10,VT:20,Vu:-30,VU:-10,vv:20,Vw:-30,vx:20,VX:-20,vy:10,VY:-10,vz:10,VZ:-20,WA:-20,Wb:20,Wd:-10,WD:20,We:10,Wf:30,WF:20,Wh:30,wi:10,Wi:30,WI:10,Wj:40,WJ:20,Wk:20,Wl:40,WL:10,Wm:10,WM:-10,WS:10,Wt:40,WT:30,Wv:30,WV:10,wx:10,Wx:20,WX:-10,Wy:20,WY:10,Wz:30,WZ:-10,XA:-25,XC:-20,Xe:-10,XE:-10,xf:10,Xf:10,Xg:-10,XG:-20,xi:10,Xi:10,XI:-10,Xj:30,xk:10,Xk:10,xl:10,Xl:20,Xm:10,XM:-25,xn:-10,XN:-10,Xo:-10,XO:-20,xp:10,Xp:10,XP:-10,xq:-10,Xq:-40,XQ:-25,XS:-20,xu:-5,Xu:-30,XU:-20,xv:10,Xv:-20,Xw:-30,xx:15,Xx:10,XX:-30,xy:-10,Xy:-20,XY:-20,xz:10,Xz:30,ya:-10,Ya:-70,YA:-55,Yc:-60,YC:-30,yd:-10,Yd:-60,YD:10,ye:10,Ye:-60,YE:-30,YF:20,Yg:-60,YG:-30,YH:-10,YI:10,YJ:10,Ym:-30,YM:-35,yn:-10,Yn:-60,Yo:-60,YO:-20,Yp:-50,YP:-10,Yq:-60,YQ:-10,Yr:-60,YR:-10,Ys:-60,YS:-10,yt:10,YT:-15,yu:-10,Yu:-60,yv:10,Yv:-20,Yw:-50,yx:10,Yx:-50,YX:-30,Yy:-40,YY:-10,Yz:-30,YZ:-40,Za:-20,ZA:-20,Zb:-10,ZB:-10,Zc:-10,ZC:-20,Zd:-30,ZD:-10,Ze:-40,ZE:-20,zf:10,Zg:-40,ZG:-20,zi:10,Zj:10,Zk:10,ZL:-10,Zm:-10,Zn:-50,Zo:-30,ZO:-30,Zp:-10,ZP:-10,Zq:-50,ZQ:-10,Zr:-40,ZR:-10,Zs:-30,ZS:-20,zt:10,Zt:-10,Zu:-30,ZU:-10,zv:10,Zv:-20,Zw:-40,ZW:-10,zx:10,Zx:-10,ZX:-10,Zy:-30,ZY:-20,zz:20,Zz:10,ZZ:-10},leading:0,w:{" ":242,_:446,"-":326,"\u2013":446,"\u2014":566,",":198,";":198,":":198,"!":210,"?":374,".":198,"\u2026":594,"\xB7":187,"'":117,"\u2018":117,"\u2019":117,'"':237,"\u201C":267,"\u201D":267,"(":330,")":330,"[":330,"]":330,"{":330,"}":330,"@":643,"*":363,"/":330,"\\":330,"&":564,"#":559,"%":600,"\u2022":187,"`":353,"^":446,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":446,"\xD7":446,"<":446,"=":446,">":446,"|":330,"~":446,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:450,0:450,1:450,2:450,3:450,4:450,5:434,6:471,7:446,8:450,9:438,a:446,A:511,b:444,B:523,c:364,C:477,d:402,D:587,e:334,E:534,\u00E9:325,f:300,F:466,g:364,G:494,h:473,H:574,i:196,I:409,j:213,J:315,k:374,K:508,l:178,L:426,m:569,M:729,n:459,N:619,o:362,O:505,p:378,P:468,q:377,Q:492,r:360,R:544,s:350,S:495,t:331,T:458,u:370,U:482,v:331,V:490,w:517,W:720,x:343,X:524,y:341,Y:504,z:315,Z:522}},regular:{ascent:.9600067138671875,descent:.3000030517578125,k:{AC:-20,AE:-10,AG:-10,AH:-10,AI:10,Aj:10,AJ:10,AL:-10,AM:10,An:-10,AO:-20,AP:-10,Aq:-10,AQ:-20,Ar:-10,As:-10,AS:-35,AT:-50,Au:-10,AU:-20,av:-20,Av:-5,AV:-40,aw:-10,AW:-20,Ax:10,AX:-10,ay:-20,Ay:-10,AY:-65,Az:20,AZ:-10,ba:-10,bc:-10,BC:-20,bd:-10,Bf:10,BF:-20,Bg:10,bh:-5,Bi:10,BI:-10,bj:-5,Bj:10,BJ:-10,Bk:10,Bl:10,Bm:10,BP:-10,BR:-10,BS:-20,BT:-40,bu:-10,BU:-20,BV:-50,BW:-50,bx:-10,Bx:10,BX:-40,by:-10,BY:-65,Bz:40,BZ:-30,CA:-20,Cc:-5,CC:-10,Cd:-10,CE:-10,CG:-10,Cj:10,CJ:-10,CK:-10,cl:10,Cl:5,Cn:-5,CO:-10,CP:-10,CQ:-20,Cs:-10,CS:-10,Ct:10,CT:-20,Cu:-10,CU:-10,Cv:-20,CV:-20,cw:-10,Cw:-10,CW:-20,Cx:20,CX:-30,cy:-5,CY:-35,Cz:20,CZ:-40,DA:-10,Db:10,Dc:10,De:10,Df:20,DF:-10,Dg:10,Dh:10,Di:15,DI:-10,Dj:5,DJ:-10,Dk:10,Dl:10,Dm:20,DM:-5,dn:-10,Do:10,Dp:10,Dq:10,Dr:10,Ds:10,dt:10,Dt:20,DT:-40,du:-10,Dv:30,DV:-30,Dw:20,DW:-10,Dx:20,DX:-50,Dy:10,DY:-50,Dz:30,DZ:-30,EC:-10,ED:-10,EG:-10,EJ:-10,el:10,EO:-10,EQ:-20,ES:-40,ET:-10,EU:-20,Ev:-10,EV:-25,Ew:-10,EW:-30,Ex:10,EX:-40,Ey:-10,EY:-50,Ez:20,EZ:-20,fa:-10,Fa:-30,FA:-40,Fc:-20,FC:-10,Fd:-20,FD:20,Fe:-15,ff:10,Ff:10,FF:20,Fg:-10,fh:10,Fh:20,fi:10,Fi:10,FI:10,fj:10,Fj:10,FJ:20,Fk:10,fl:20,Fl:20,FL:10,fm:10,FM:-10,Fn:-20,FN:10,Fo:-20,FO:10,Fp:-10,FP:-10,Fq:-10,FQ:10,Fr:-10,FS:10,ft:40,Ft:10,FT:-30,Fu:-10,fv:10,Fv:10,FV:10,FW:10,fy:10,FY:10,Fz:10,FZ:-10,GA:-10,Gf:10,Gh:10,gi:10,Gi:10,GI:-10,Gj:10,GJ:-10,Gk:10,Gl:10,Gm:10,GM:-10,GN:10,GP:-20,GS:-10,Gt:10,GU:-10,Gv:10,GV:-10,GW:-20,Gx:10,GX:-40,gy:10,GY:-40,Gz:10,GZ:-20,Hb:10,hf:-10,Hf:10,hg:-20,Hh:10,Hi:10,Hj:20,Hk:10,Hl:10,Hm:10,hq:-10,hs:-10,Ht:20,hv:-30,Hv:10,hw:-15,Hx:20,hy:-30,Hy:10,Hz:20,Ia:-10,IA:10,Ib:10,Ic:-10,Id:-10,ID:30,Ie:-10,if:10,If:20,IF:40,Ig:-10,Ih:30,Ii:20,II:30,Ij:30,IJ:40,Ik:20,IK:10,Il:20,IL:10,IM:30,In:-10,IN:20,Io:-10,Ip:10,Iq:-20,Ir:-10,IR:10,Is:-10,It:10,Iu:-10,IU:10,iv:10,Iv:-20,IV:30,Iw:-25,IW:20,Ix:10,IX:10,Iy:-10,IY:30,Iz:20,IZ:20,Ja:-10,Jb:10,Jc:-10,Jd:-10,Je:-10,Jf:10,Jh:10,Ji:10,JI:-10,Jj:20,JJ:10,Jk:10,Jl:20,Jn:-10,Jo:-10,JO:-10,Jp:10,JP:-10,Jq:-10,JQ:-10,JR:-10,jt:10,Jt:20,JT:10,ju:-10,Ju:-20,JU:-10,jx:10,JX:-25,jy:10,JY:-20,jz:10,Jz:10,JZ:-20,Ka:-40,kc:20,Kc:-40,KC:-10,Kd:-40,KD:10,ke:10,Ke:-40,kf:20,Kf:10,KF:20,Kg:-40,KG:-10,kh:10,Kh:10,ki:10,Ki:10,Kj:40,KJ:20,kk:20,Kk:10,kl:20,Kl:10,km:10,KM:20,Kn:-40,ko:10,Ko:-50,KO:-10,Kp:10,Kq:-50,kr:10,Ks:-40,kt:10,Kt:10,KT:-10,ku:10,Ku:-60,kv:10,Kv:-30,Kw:-40,Kx:-10,KX:-10,ky:-10,Ky:-30,kz:10,Lb:-10,LC:-20,LE:-20,Lf:10,Lg:-10,LG:-20,Lh:-10,Li:10,LI:-40,Lj:20,Lk:10,ll:10,Ll:10,LL:-20,Ln:-20,LO:-25,Lp:10,Lq:-40,LQ:-30,Ls:-10,LS:-65,lt:10,Lt:-10,LT:-70,Lu:-40,LU:-45,Lv:-60,LV:-70,Lw:-40,LW:-40,Lx:10,Ly:-20,LY:-90,lz:20,Lz:30,LZ:-10,Mb:10,md:10,Mf:10,Mh:10,Mi:10,MJ:10,Mk:10,Ml:10,mo:20,Mp:10,MP:-10,Mq:-10,MQ:-10,MS:-20,Mt:20,MT:-30,Mu:-10,MU:-20,mv:-15,Mv:10,MV:-20,mw:-10,MW:-30,Mx:10,MX:-10,my:-10,My:-10,MY:-50,Mz:10,MZ:-10,nb:-15,Nb:10,Ne:10,Nf:10,Ng:10,Nh:10,Ni:20,Nj:20,Nk:20,Nl:20,Nm:10,Nq:10,ns:-5,nt:-10,Nt:20,nu:-10,nv:-20,Nv:30,nw:-20,NW:-10,Nx:30,NX:-20,ny:-20,Ny:10,NY:-20,Nz:40,NZ:-10,OA:-10,OD:-10,Of:20,Og:20,Oh:10,Oi:20,OI:-10,oj:-5,Oj:20,Ok:10,Ol:20,OL:10,Om:20,Oo:10,Op:10,Oq:10,OQ:10,Os:10,Ot:20,OT:-10,ou:-10,ov:5,Ov:30,OV:-10,ow:-10,Ow:10,OW:-10,Ox:30,OX:-40,oy:-10,Oy:20,OY:-40,Oz:30,OZ:-20,Pa:-40,PA:-40,Pc:-30,Pd:-40,PD:-10,Pe:-20,Pf:10,Pg:-10,Ph:10,Pi:10,PI:-10,Pj:20,PJ:-10,Pk:10,Pl:10,Pm:10,PM:-30,pn:-10,Pn:-10,PN:-10,Po:-30,Pq:-30,Ps:-20,PS:10,Pt:20,pu:-10,Pu:-30,Pv:10,Px:10,PX:-35,py:-10,PY:-20,Pz:10,PZ:-50,Qb:10,Qf:20,Qg:20,qh:-10,Qh:10,Qi:20,qj:10,Qj:90,QJ:80,Qk:10,Ql:20,Qm:20,qn:-10,qo:-10,Qp:20,Qt:30,QT:-10,qu:-10,Qv:20,QV:-10,QW:-10,Qx:20,QX:-20,Qy:50,QY:-30,Qz:40,QZ:-10,ra:-5,Ra:-10,RA:-25,RB:-10,Rc:-10,RC:-20,Rd:-10,RD:10,Re:-10,RE:-20,Rf:20,RF:10,Rg:-10,RG:-10,ri:5,RI:-10,Rj:30,RJ:30,RL:-10,RM:-20,Rn:-10,RN:10,Ro:-10,RO:-10,Rp:20,Rq:-30,RQ:-10,Rr:-10,Rs:-10,Rt:10,RT:-10,Ru:-30,RU:-20,rv:20,RV:-10,Rw:-10,RW:-10,Rx:10,RX:-20,Ry:10,RY:-30,Rz:20,RZ:-45,Sa:-10,Sb:10,Sc:-20,Sd:-25,SD:20,Se:-20,SE:-10,sf:10,Sf:20,SF:30,Sg:-20,Sh:20,Si:20,SI:10,Sj:30,SJ:30,Sk:10,Sl:20,SL:20,Sn:-20,SN:10,So:-10,SO:10,Sq:-20,Sr:-10,Ss:-10,st:10,St:20,Su:-20,sv:20,Sv:-50,SV:20,Sw:-30,SW:10,sx:15,Sx:10,Sy:-15,SY:10,sz:20,Sz:20,SZ:-10,Ta:-90,TA:-50,Tc:-80,TC:-10,Td:-110,TD:10,Te:-90,TE:-10,Tf:20,TF:30,Tg:-80,TG:-10,Th:20,ti:5,TI:10,Tj:20,Tk:10,Tl:20,Tm:-50,TM:-30,Tn:-90,To:-90,Tp:-80,Tq:-120,Tr:-80,Ts:-80,Tt:10,TT:-30,Tu:-90,tv:10,Tv:-70,TV:10,Tw:-100,tx:20,Tx:-60,TX:-10,Ty:-50,tz:30,Tz:-40,TZ:-10,ub:-10,Ub:20,UE:10,uf:10,Uf:30,UF:10,Ug:10,Uh:30,ui:10,Ui:30,Uj:40,uk:10,Uk:20,ul:10,Ul:30,Um:30,Up:10,UQ:30,Ur:10,UR:10,Us:10,Ut:50,UT:20,Uu:10,UU:10,Uv:50,UV:10,Uw:10,ux:10,Ux:30,UX:-10,Uy:10,UY:-10,uz:30,Uz:30,UZ:-10,va:-10,Va:-50,VA:-55,Vc:-30,VC:-20,Vd:-30,Ve:-30,VE:-20,vf:10,VF:10,Vg:-30,VG:-10,vi:10,Vm:-10,VM:-30,Vn:-30,VN:-10,Vo:-30,VO:-10,Vp:-20,VP:-20,Vq:-30,VQ:-10,Vr:-20,Vs:-30,vt:10,VT:20,Vu:-30,VU:-10,vv:20,Vw:-30,vx:20,VX:-20,vy:10,VY:-10,vz:10,VZ:-20,WA:-20,Wb:20,Wd:-10,WD:20,We:10,Wf:30,WF:20,Wh:30,wi:10,Wi:30,WI:10,Wj:40,WJ:20,Wk:20,Wl:40,WL:10,Wm:10,WM:-10,WS:10,Wt:40,WT:30,Wv:30,WV:10,wx:10,Wx:20,WX:-10,Wy:20,WY:10,Wz:30,WZ:-10,XA:-25,XC:-20,Xe:-10,XE:-10,xf:10,Xf:10,Xg:-10,XG:-20,xi:10,Xi:10,XI:-10,Xj:30,xk:10,Xk:10,xl:10,Xl:20,Xm:10,XM:-25,xn:-10,XN:-10,Xo:-10,XO:-20,xp:10,Xp:10,XP:-10,xq:-10,Xq:-40,XQ:-25,XS:-20,xu:-5,Xu:-30,XU:-20,xv:10,Xv:-20,Xw:-30,xx:15,Xx:10,XX:-30,xy:-10,Xy:-20,XY:-20,xz:10,Xz:30,ya:-10,Ya:-70,YA:-55,Yc:-60,YC:-30,yd:-10,Yd:-60,YD:10,ye:10,Ye:-60,YE:-30,YF:20,Yg:-60,YG:-30,YH:-10,YI:10,YJ:10,Ym:-30,YM:-35,yn:-10,Yn:-60,Yo:-60,YO:-20,Yp:-50,YP:-10,Yq:-60,YQ:-10,Yr:-60,YR:-10,Ys:-60,YS:-10,yt:10,YT:-15,yu:-10,Yu:-60,yv:10,Yv:-20,Yw:-50,yx:10,Yx:-50,YX:-30,Yy:-40,YY:-10,Yz:-30,YZ:-40,Za:-20,ZA:-20,Zb:-10,ZB:-10,Zc:-10,ZC:-20,Zd:-30,ZD:-10,Ze:-40,ZE:-20,zf:10,Zg:-40,ZG:-20,zi:10,Zj:10,Zk:10,ZL:-10,Zm:-10,Zn:-50,Zo:-30,ZO:-30,Zp:-10,ZP:-10,Zq:-50,ZQ:-10,Zr:-40,ZR:-10,Zs:-30,ZS:-20,zt:10,Zt:-10,Zu:-30,ZU:-10,zv:10,Zv:-20,Zw:-40,ZW:-10,zx:10,Zx:-10,ZX:-10,Zy:-30,ZY:-20,zz:20,Zz:10,ZZ:-10},leading:0,w:{" ":242,_:446,"-":326,"\u2013":446,"\u2014":566,",":198,";":198,":":198,"!":210,"?":374,".":198,"\u2026":594,"\xB7":187,"'":117,"\u2018":117,"\u2019":117,'"':237,"\u201C":267,"\u201D":267,"(":330,")":330,"[":330,"]":330,"{":330,"}":330,"@":643,"*":363,"/":330,"\\":330,"&":564,"#":559,"%":600,"\u2022":187,"`":353,"^":446,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":446,"\xD7":446,"<":446,"=":446,">":446,"|":330,"~":446,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:450,0:450,1:450,2:450,3:450,4:450,5:450,6:450,7:450,8:450,9:450,a:437,A:502,b:435,B:520,c:355,C:472,d:393,D:578,e:325,E:529,\u00E9:325,f:291,F:454,g:355,G:487,h:464,H:563,i:187,I:400,j:204,J:306,k:365,K:498,l:169,L:426,m:560,M:720,n:450,N:599,o:353,O:496,p:378,P:464,q:377,Q:502,r:360,R:537,s:341,S:486,t:331,T:458,u:370,U:482,v:331,V:490,w:517,W:720,x:343,X:524,y:341,Y:504,z:315,Z:522}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},"Helvetica Neue":{faces:{bold:{ascent:.975006103515625,descent:.2169952392578125,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-30,fi:20,fl:20,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0290069580078125,w:{" ":278,_:500,"-":407,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":278,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':463,"\u201C":463,"\u201D":463,"(":296,")":296,"[":333,"]":333,"{":333,"}":333,"@":800,"*":407,"/":371,"\\":371,"&":685,"#":556,"%":1e3,"\u2022":350,"`":259,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":223,"~":600,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:574,A:685,b:611,B:704,c:574,C:741,d:611,D:741,e:574,E:648,\u00E9:574,f:333,F:593,g:611,G:759,h:593,H:741,i:258,I:295,j:278,J:556,k:574,K:722,l:258,L:593,m:906,M:907,n:593,N:741,o:611,O:778,p:611,P:667,q:611,Q:778,r:389,R:722,s:537,S:649,t:352,T:611,u:593,U:741,v:520,V:630,w:814,W:944,x:537,X:667,y:519,Y:667,z:519,Z:648}},boldItalic:{ascent:.975006103515625,descent:.2169952392578125,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-68,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0290069580078125,w:{" ":278,_:500,"-":407,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":296,"?":574,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':481,"\u201C":481,"\u201D":481,"(":296,")":296,"[":333,"]":333,"{":333,"}":333,"@":800,"*":407,"/":389,"\\":389,"&":685,"#":556,"%":963,"\u2022":350,"`":259,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:574,A:685,b:611,B:722,c:556,C:741,d:611,D:741,e:574,E:667,\u00E9:574,f:352,F:593,g:611,G:759,h:611,H:741,i:259,I:296,j:259,J:556,k:556,K:722,l:259,L:574,m:907,M:907,n:611,N:741,o:593,O:778,p:611,P:667,q:611,Q:778,r:389,R:722,s:519,S:648,t:370,T:611,u:611,U:741,v:519,V:630,w:815,W:944,x:519,X:667,y:519,Y:648,z:500,Z:648}},italic:{ascent:.957000732421875,descent:.2129974365234375,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-15,fi:1,fl:1,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0279998779296875,w:{" ":278,_:500,"-":389,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":259,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':426,"\u201C":426,"\u201D":426,"(":259,")":259,"[":259,"]":259,"{":333,"}":333,"@":800,"*":352,"/":333,"\\":333,"&":630,"#":556,"%":926,"\u2022":500,"`":222,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:519,A:667,b:593,B:685,c:537,C:722,d:593,D:704,e:537,E:611,\u00E9:537,f:296,F:574,g:574,G:759,h:556,H:722,i:222,I:259,j:222,J:519,k:481,K:667,l:222,L:556,m:852,M:870,n:556,N:722,o:574,O:759,p:593,P:648,q:593,Q:759,r:333,R:685,s:481,S:648,t:315,T:574,u:556,U:722,v:481,V:611,w:759,W:926,x:481,X:611,y:481,Y:611,z:444,Z:611}},regular:{ascent:.951995849609375,descent:.2129974365234375,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-15,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0279998779296875,w:{" ":278,_:500,"-":389,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":259,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':426,"\u201C":426,"\u201D":426,"(":259,")":259,"[":259,"]":259,"{":333,"}":333,"@":800,"*":352,"/":333,"\\":333,"&":630,"#":556,"%":1e3,"\u2022":350,"`":222,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:537,A:648,b:593,B:685,c:537,C:722,d:593,D:704,e:537,E:611,\u00E9:537,f:296,F:574,g:574,G:759,h:556,H:722,i:222,I:259,j:222,J:519,k:519,K:667,l:222,L:556,m:853,M:871,n:556,N:722,o:574,O:760,p:593,P:648,q:593,Q:760,r:333,R:685,s:500,S:648,t:315,T:574,u:556,U:722,v:500,V:611,w:758,W:926,x:518,X:611,y:500,Y:648,z:480,Z:611}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},"Patrick Hand":{faces:{regular:{ascent:1.0420074462890625,descent:.3119964599609375,k:{},leading:0,w:{" ":230,_:571,"-":404,"\u2013":420,"\u2014":648,",":202,";":232,":":232,"!":247,"?":368,".":214,"\u2026":571,"\xB7":200,"'":164,"\u2018":190,"\u2019":220,'"':303,"\u201C":315,"\u201D":303,"(":334,")":364,"[":303,"]":296,"{":339,"}":328,"@":550,"*":404,"/":423,"\\":420,"&":530,"#":457,"%":643,"\u2022":352,"`":220,"^":370,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":480,"\xD7":490,"<":396,"=":572,">":400,"|":176,"~":529,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:507,0:448,1:363,2:468,3:448,4:375,5:423,6:399,7:495,8:433,9:367,a:392,A:488,b:412,B:507,c:388,C:548,d:390,D:475,e:398,E:442,\u00E9:398,f:359,F:375,g:445,G:480,h:420,H:468,i:224,I:235,j:235,J:370,k:415,K:523,l:266,L:372,m:680,M:595,n:452,N:532,o:403,O:556,p:428,P:481,q:463,Q:655,r:385,R:454,s:385,S:459,t:344,T:468,u:400,U:550,v:400,V:562,w:463,W:616,x:448,X:601,y:423,Y:442,z:428,Z:507}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}}};var qe="Helvetica Neue",Zn="Helvetica Neue, Helvetica, Arial, sans-serif",Te=Object.keys(Qt).filter(e=>e!==qe).sort();function Se(e){if(!e)return null;let t=e.toLowerCase();return Te.find(n=>n.toLowerCase()===t)??null}function Ae(e){return Qt[Se(e)??qe]}function Ie(e,t,n){let r=t?n?"boldItalic":"bold":n?"italic":"regular";return e.faces[r]?r:"regular"}function Qe(e){if(!e)return Zn;let t=[...Se(e)??e].filter(n=>!`"'<>&;{}\\`.includes(n)).join("");return t===""?Zn:`${/^[\p{L}\p{N} -]+$/u.test(t)?t:`'${t}'`}, ${Zn}`}function bi(e,t,n="regular",r){let i=Ae(r),o=i.faces[n]??i.faces.regular,s=o.w.n,l=0,a="";for(let c of e)l+=o.w[c]??s,a&&(l+=o.k[a+c]??0),a=c;return l*t/1e3}function os(e,t){let n=Ae(t).faces.regular,r=Math.round(n.ascent*e),i=Math.round(n.descent*e),o=Math.round(n.leading*e);return[r+Math.ceil(n.descent*e-1e-9),r+i+o]}function Xn(e,t){return e===" "?!0:(e==="/"||e==="-")&&t!==""&&!/[\d\s/-]/.test(t)}function ss(e){let t=[...e],n=[],r="";return t.forEach((i,o)=>{r+=i;let s=t[o+1]??"";Xn(i,s)&&s!==" "&&(n.push(r),r="")}),(r||n.length===0)&&n.push(r),n}function ls(e,t,n,r){let i=Ae(r),o=i.faces[n]??i.faces.regular,s=o.w.n,l=[0],a=0,c="";for(let u of e)a+=o.w[u]??s,c&&(a+=o.k[c+u]??0),c=u,l.push(a*t/1e3);return l}function as(e,t,n,r="regular",i){let o=l=>bi(l,t,r,i),s=[];for(let l of e.split(/\r\n|\n|\r|\u2028|\u2029/)){let a="";for(let c of ss(l)){let u=a+c;for(a===""||o(u.trimEnd())<=n?a=u:(s.push(a),a=c);o(a.trimEnd())>n&&[...a.trimEnd()].length>1;){let h=[...a],f=ls(h,t,r,i),m=h.length-1;for(;m>1&&f[m]>n;)m--;s.push(h.slice(0,m).join("")),a=h.slice(m).join("")}}s.push(a)}return s}function xi(e,t,n,r){if(e==="")return{width:0,height:0};let i=as(e,t,n,"regular",r),o=Math.max(...i.map(a=>bi(a.trimEnd(),t,"regular",r))),[s,l]=os(t,r);return{width:Math.ceil(o-1e-9),height:Math.ceil(s+l*(i.length-1)-1e-9)}}var us=["bold","boldItalic","italic","regular"];function Hn(e,t){return`${e.toLowerCase().replaceAll(" ","-")}-${t}.woff2`}function Jn(e){return us.filter(t=>Qt[e]?.faces[t]!==void 0)}function tn(e){let t=new Set,n=r=>{for(let i of r){let o=Se(i.style.font);o&&t.add(o)}};n(e.elements);for(let r of e.symbols??[])n(r.elements);return Te.filter(r=>t.has(r))}function cs(){try{let e=typeof document>"u"?null:document.currentScript;if(e?.src)return new URL("fonts/",e.src).href;let t=void 0;return t?new URL("fonts/",t).href:null}catch{return null}}var Kn=cs(),ki=new Set;function wi(e){Kn=e.endsWith("/")?e:`${e}/`}function en(e,t={}){if(!(typeof document>"u"||typeof FontFace>"u"||!document.fonts))for(let n of e){let r=Se(n);if(!r||ki.has(r))continue;let i=t[r];if(!(!i&&!Kn)){ki.add(r);for(let o of Jn(r)){let s=i?.[o],l;if(s)l=Uint8Array.from(atob(s),c=>c.charCodeAt(0));else if(!i)l=`url(${JSON.stringify(Kn+Hn(r,o))}) format("woff2")`;else continue;let a={weight:o.startsWith("bold")?"bold":"normal",style:o==="italic"||o==="boldItalic"?"italic":"normal"};document.fonts.add(new FontFace(r,l,a))}}}}var Mi=.5522847498307936,K=class e{constructor(){T(this,"segments",[])}get isEmpty(){return this.segments.length===0}moveTo(t){return this.segments.push({op:"M",p:t}),this}lineTo(t){return this.segments.push({op:"L",p:t}),this}quadTo(t,n){return this.segments.push({op:"Q",c:n,p:t}),this}curveTo(t,n,r){return this.segments.push({op:"C",c1:n,c2:r,p:t}),this}close(){return this.segments.push({op:"Z"}),this}addPath(t){return this.segments.push(...t.segments),this}addLines(t){return t.forEach((n,r)=>r===0?this.moveTo(n):this.lineTo(n)),this}static rect(t){return new e().addLines([{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}]).close()}addEllipse(t){let n=t.x+t.width/2,r=t.y+t.height/2,i=t.width/2,o=t.height/2,s=i*Mi,l=o*Mi;return this.moveTo({x:n+i,y:r}),this.curveTo({x:n,y:r+o},{x:n+i,y:r+l},{x:n+s,y:r+o}),this.curveTo({x:n-i,y:r},{x:n-s,y:r+o},{x:n-i,y:r+l}),this.curveTo({x:n,y:r-o},{x:n-i,y:r-l},{x:n-s,y:r-o}),this.curveTo({x:n+i,y:r},{x:n+s,y:r-o},{x:n+i,y:r-l}),this.close()}static ellipse(t){return new e().addEllipse(t)}translated(t,n){let r=o=>({x:o.x+t,y:o.y+n}),i=new e;return i.segments=this.segments.map(o=>{switch(o.op){case"M":case"L":return{op:o.op,p:r(o.p)};case"Q":return{op:"Q",c:r(o.c),p:r(o.p)};case"C":return{op:"C",c1:r(o.c1),c2:r(o.c2),p:r(o.p)};case"Z":return o}}),i}contours(){let t=[],n=[],r={x:0,y:0};for(let i of this.segments){let o=n.length?n[n.length-1]:r;switch(i.op){case"M":n.length>1&&t.push(n),r=i.p,n=[i.p];break;case"L":n.push(i.p);break;case"Q":for(let s=1;s<=12;s++){let l=s/12,a=1-l;n.push({x:a*a*o.x+2*a*l*i.c.x+l*l*i.p.x,y:a*a*o.y+2*a*l*i.c.y+l*l*i.p.y})}break;case"C":for(let s=1;s<=16;s++){let l=s/16,a=1-l;n.push({x:a*a*a*o.x+3*a*a*l*i.c1.x+3*a*l*l*i.c2.x+l*l*l*i.p.x,y:a*a*a*o.y+3*a*a*l*i.c1.y+3*a*l*l*i.c2.y+l*l*l*i.p.y})}break;case"Z":n.push(r),n.length>1&&t.push(n),n=[r];break}}return n.length>1&&t.push(n),t}trimmed(t){let n=this.contours().map(o=>new Bt(o)),r=Math.min(Math.max(t,0),1)*n.reduce((o,s)=>o+s.length,0),i=new e;for(let o of n){if(!(r>0))break;i.moveTo(o.points[0]);for(let s=1;s<o.points.length;s++){let l=o.lengths[s]-o.lengths[s-1];if(l<=r){i.lineTo(o.points[s]),r-=l;continue}let a=o.points[s-1],c=o.points[s],u=r/l;i.lineTo({x:a.x+(c.x-a.x)*u,y:a.y+(c.y-a.y)*u}),r=0;break}}return i}data(){let t=[];for(let n of this.segments)switch(n.op){case"M":t.push(`M${I(n.p.x)} ${I(n.p.y)}`);break;case"L":t.push(`L${I(n.p.x)} ${I(n.p.y)}`);break;case"Q":t.push(`Q${I(n.c.x)} ${I(n.c.y)} ${I(n.p.x)} ${I(n.p.y)}`);break;case"C":t.push(`C${I(n.c1.x)} ${I(n.c1.y)} ${I(n.c2.x)} ${I(n.c2.y)} ${I(n.p.x)} ${I(n.p.y)}`);break;case"Z":t.push("Z");break}return t.join(" ")}};function Fe(e){return e<0?-Math.round(-e):Math.round(e)}function I(e){let t=Fe(e*100)/100;return Number.isInteger(t)?String(t===0?0:t):String(t)}var Bt=class{constructor(t){T(this,"points");T(this,"lengths");this.points=t;let n=0;this.lengths=t.map((r,i)=>(i>0&&(n+=Math.hypot(r.x-t[i-1].x,r.y-t[i-1].y)),n))}get length(){return this.lengths.length?this.lengths[this.lengths.length-1]:0}point(t){if(this.points.length<=1||!(this.length>0))return this.points[0]??{x:0,y:0};let n=Math.min(Math.max(t,0),1)*this.length,r=1;for(;r<this.lengths.length-1&&this.lengths[r]<n;)r++;let i=this.lengths[r]-this.lengths[r-1],o=i>0?(n-this.lengths[r-1])/i:0,s=this.points[r-1],l=this.points[r];return{x:s.x+(l.x-s.x)*o,y:s.y+(l.y-s.y)*o}}},Rt=e=>e.x+e.width/2,Tt=e=>e.y+e.height/2,vt=e=>e.x+e.width,Et=e=>e.y+e.height;function _n(e,t){if(!e)return{...t};let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(vt(e),vt(t))-n,height:Math.max(Et(e),Et(t))-r}}function he(e,t,n){return{x:e.x+t,y:e.y+n,width:e.width-2*t,height:e.height-2*n}}function Ut(e,t,n){if(n===0)return e;let r=e.x-t.x,i=e.y-t.y;return{x:t.x+r*Math.cos(n)-i*Math.sin(n),y:t.y+r*Math.sin(n)+i*Math.cos(n)}}function qn(e,t){let n=1-t;return{x:e[0].x*(n*n*n)+e[1].x*(3*t*n*n)+e[2].x*(3*t*t*n)+e[3].x*(t*t*t),y:e[0].y*(n*n*n)+e[1].y*(3*t*n*n)+e[2].y*(3*t*t*n)+e[3].y*(t*t*t)}}function Pi(e,t){let n=[e[0]];for(let r=0;r<Math.floor((e.length-1)/3);r++){let i=e.slice(3*r,3*r+4),o=0;for(let l=1;l<i.length;l++)o+=Math.hypot(i[l].x-i[l-1].x,i[l].y-i[l-1].y);let s=Math.min(400,Math.max(4,Math.ceil(o/Math.max(t,.5))));for(let l=1;l<=s;l++)n.push(qn(i,l/s))}return n}var st=e=>({x:e.x,y:e.y,width:e.width,height:e.height}),wt=e=>e.rotation??0,Ce=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),Ft=(e,t)=>Ut(t,Ce(e),wt(e)),vi=(e,t)=>Ut(t,Ce(e),-wt(e));function nn(e){let t=st(e);if(wt(e)===0)return t;let n=[{x:t.x,y:t.y},{x:vt(t),y:t.y},{x:vt(t),y:Et(t)},{x:t.x,y:Et(t)}].map(l=>Ft(e,l)),r=n.map(l=>l.x),i=n.map(l=>l.y),o=Math.min(...r),s=Math.min(...i);return{x:o,y:s,width:Math.max(...r)-o,height:Math.max(...i)-s}}function Ei(e,t){let n=e.style.textColor!==null&&Re(e.style.textColor);if(!Re(e.style.stroke)&&!n)return e;let r=mt(e),o=(e.style.fillStyle==="solid"||e.style.fillStyle==="grid")&&e.style.fill.a>=.5&&ce(e.style.fill)>.5,s=ce(t)>.5&&o?_t:t;return Re(e.style.stroke)&&(r.style.stroke={...s}),n&&(r.style.textColor={...s}),r}function Ri(e){return e.kind==="text"||e.kind==="note"?e.style.stroke:e.style.textColor??e.style.stroke}function fe(e){if(e.kind!=="path"||!e.subpaths)return[];let t=[];for(let n of e.subpaths){if(n.coords.length<8||(n.coords.length-2)%6!==0)continue;let r=[];for(let i=0;i<n.coords.length;i+=2)r.push({x:e.x+n.coords[i]*e.width,y:e.y+n.coords[i+1]*e.height});t.push({closed:n.closed,points:r})}return t}function Qn(e){let t=new K;for(let n of fe(e)){t.moveTo(n.points[0]);for(let r=0;r<(n.points.length-1)/3;r++)t.curveTo(n.points[3*r+3],n.points[3*r+1],n.points[3*r+2]);n.closed&&t.close()}return t}var rn=16,hs=24,Ti=24,fs=48;function ms(e){if(e.kind==="connector"||e.kind==="text"||e.kind==="freehand"||e.kind==="path"&&!e.extension||e.style.opacity!==null&&e.style.opacity<=0)return null;let t=nn(e);return t.width<Ti||t.height<Ti?null:t}function tr(e,t){let n=t.x+t.width,r=t.y+t.height;for(let i=1;i<e.length;i++){let o=e[i-1],s=e[i];if(o.y===s.y){if(t.y<o.y&&o.y<r&&Math.min(o.x,s.x)<n&&Math.max(o.x,s.x)>t.x)return!0}else if(o.x===s.x&&t.x<o.x&&o.x<n&&Math.min(o.y,s.y)<r&&Math.max(o.y,s.y)>t.y)return!0}return!1}var er=e=>({x:e.x-rn,y:e.y-rn,width:e.width+2*rn,height:e.height+2*rn}),Si=(e,t)=>t.x<e.x&&e.x<t.x+t.width&&t.y<e.y&&e.y<t.y+t.height,on=new Map;function Ai(e,t,n,r,i,o,s){let l=m=>!Si(t,er(m))&&!Si(n,er(m)),a=[],c=!1;for(let m of o){if(s.has(m.id))continue;let p=ms(m);!p||!l(p)||(a.push(p),!c&&tr(e,p)&&(c=!0))}if(!c)return e;let u=JSON.stringify([t.x,t.y,n.x,n.y,r,i,a.map(m=>[m.x,m.y,m.width,m.height])]),h=on.get(u);if(h)return h;let f=ds(e,t,n,r,i,a);return on.size>=512&&on.clear(),on.set(u,f),f}function ds(e,t,n,r,i,o){let s=o.map((l,a)=>a).filter(l=>tr(e,o[l]));if(s.length===0)return e;for(let l=0;l<4;l++){if(s.length>fs)return e;let a=ps(t,n,r,i,s.map(u=>er(o[u])));if(!a)return e;let c=o.map((u,h)=>h).filter(u=>!s.includes(u)&&tr(a,o[u]));if(c.length===0)return a;s=[...s,...c].sort((u,h)=>u-h)}return e}function ps(e,t,n,r,i){let o=[e.x,t.x,(e.x+t.x)/2],s=[e.y,t.y,(e.y+t.y)/2];for(let F of i)o.push(F.x,F.x+F.width),s.push(F.y,F.y+F.height);o=[...new Set(o)].sort((F,D)=>F-D),s=[...new Set(s)].sort((F,D)=>F-D);let l=o.length,a=s.length,c=o.indexOf(e.x),u=s.indexOf(e.y),h=o.indexOf(t.x),f=s.indexOf(t.y);if(c<0||u<0||h<0||f<0)return null;let m=new Map(o.map((F,D)=>[F,D])),p=new Map(s.map((F,D)=>[F,D])),k=new Uint8Array(l*a),y=new Uint8Array(l*a),M=new Uint8Array(l*a);for(let F of i){let D=m.get(F.x),v=m.get(F.x+F.width),S=p.get(F.y),Y=p.get(F.y+F.height);if(!(D===void 0||v===void 0||S===void 0||Y===void 0))for(let O=D;O<v;O++)for(let V=S;V<Y;V++)V>S&&(y[O*a+V]=1),O>D&&(M[O*a+V]=1),O>D&&V>S&&(k[O*a+V]=1)}let E=(F,D)=>k[F*a+D]===1,b=(F,D,v)=>y[Math.min(F,D)*a+v]===1,R=(F,D,v)=>M[v*a+Math.min(F,D)]===1,x=l*a*2,w=new Array(x).fill(1/0),d=new Array(x).fill(-1),g=new Array(x).fill(!1),P=new nr,A=(c*a+u)*2+(n?1:0);w[A]=0,P.push(0,A);let L=(h*a+f)*2+(r?1:0);for(let F=P.pop();F;F=P.pop()){let[D,v]=F;if(g[v])continue;if(g[v]=!0,v===L)break;let S=Math.floor(v/2),Y=v%2,O=Math.floor(S/a),V=S%a;for(let[$,_]of[[1,0],[-1,0],[0,1],[0,-1]]){let Q=O+$,j=V+_;if(Q<0||Q>=l||j<0||j>=a||E(Q,j))continue;let ct=$!==0?0:1;if($!==0?b(O,Q,V):R(V,j,O))continue;let Z=Math.abs(o[Q]-o[O])+Math.abs(s[j]-s[V]),lt=D+Z+(ct!==Y?hs:0),gt=(Q*a+j)*2+ct;lt<w[gt]&&(w[gt]=lt,d[gt]=v,P.push(lt,gt))}}if(!g[L])return null;let W=[];for(let F=L;F>=0;F=d[F]){let D=Math.floor(F/2);W.push({x:o[Math.floor(D/a)],y:s[D%a]})}return W.reverse()}var nr=class{constructor(){T(this,"heap",[]);T(this,"next",0)}less(t,n){let r=this.heap[t],i=this.heap[n];return r[0]<i[0]||r[0]===i[0]&&r[1]<i[1]}push(t,n){this.heap.push([t,this.next++,n]);for(let r=this.heap.length-1;r>0;){let i=r-1>>1;if(!this.less(r,i))break;[this.heap[r],this.heap[i]]=[this.heap[i],this.heap[r]],r=i}}pop(){if(this.heap.length===0)return null;let t=this.heap[0],n=this.heap.pop();if(this.heap.length>0){this.heap[0]=n;for(let r=0;;){let i=2*r+1,o=i+1,s=r;if(i<this.heap.length&&this.less(i,s)&&(s=i),o<this.heap.length&&this.less(o,s)&&(s=o),s===r)break;[this.heap[r],this.heap[s]]=[this.heap[s],this.heap[r]],r=s}}return[t[0],t[2]]}};function gs(e,t){let n=st(e),r=t==="top"?{x:Rt(n),y:n.y}:t==="right"?{x:vt(n),y:Tt(n)}:t==="bottom"?{x:Rt(n),y:Et(n)}:{x:n.x,y:Tt(n)};return Ft(e,r)}function ys(e){let t=[];for(let n=0;n+3<e.length;n+=3){let r=e.slice(n,n+4);for(let i=0;i<16;i++)t.push(qn(r,i/16))}return t.push(e[e.length-1]),t}function bs(e,t,n){let r=null,i=null;for(let s of fe(e)){let l=ys(s.points),a=l.length,c=s.closed?a:a-1;for(let u=0;u<c;u++){let h=l[u],f=l[(u+1)%a],m={x:f.x-h.x,y:f.y-h.y},p={x:h.x-t.x,y:h.y-t.y},k=m.x*n.y-n.x*m.y;if(k===0)continue;let y=(m.x*p.y-m.y*p.x)/k,M=(n.x*p.y-n.y*p.x)/k;y>0&&M>=0&&M<=1&&((r===null||y<r)&&(r=y),y<=1&&(i===null||y>i)&&(i=y))}}let o=i??r;return o===null?null:{x:t.x+n.x*o,y:t.y+n.y*o}}function xs(e,t){let n=st(e),r=Ce(e),i=vi(e,t),o=i.x-r.x,s=i.y-r.y;if(!((o!==0||s!==0)&&n.width>0&&n.height>0))return r;if(e.kind==="path"){let u=bs(e,r,{x:o,y:s});if(u)return Ft(e,u)}let l=n.width/2,a=n.height/2,c;return e.kind==="ellipse"?c=1/Math.sqrt(o*o/(l*l)+s*s/(a*a)):e.kind==="diamond"?c=1/(Math.abs(o)/l+Math.abs(s)/a):c=Math.min(o!==0?l/Math.abs(o):1/0,s!==0?a/Math.abs(s):1/0),Ft(e,{x:r.x+o*c,y:r.y+s*c})}function Ii(e,t){let n=e.elementID?t.get(e.elementID):void 0;return n?Ce(n):{x:e.x,y:e.y}}function ks(e,t){let n=st(e);return Ft(e,{x:n.x+t.x*n.width,y:n.y+t.y*n.height})}function Fi(e,t,n){let r=e.elementID?n.get(e.elementID):void 0;if(!r)return{x:e.x,y:e.y};let i=e.portIndex,o=r.ports??[];return typeof i=="number"&&Number.isInteger(i)&&i>=0&&i<o.length?ks(r,o[i]):e.port?gs(r,e.port):xs(r,t)}function Vt(e,t){let n=e.connector;if(!n)return[{x:0,y:0},{x:0,y:0}];let r=n.waypoints??[];return[Fi(n.start,r.length>0?r[0]:Ii(n.end,t),t),Fi(n.end,r.length>0?r[r.length-1]:Ii(n.start,t),t)]}function Wt(e){if(e.kind==="polyline")return e.points;let t=[],n=e.points;for(let r=0;r<Math.floor((n.length-1)/3);r++){let i=n[3*r],o=n[3*r+1],s=n[3*r+2],l=n[3*r+3];for(let a=r===0?0:1;a<=24;a++){let c=a/24,u=1-c;t.push({x:u*u*u*i.x+3*u*u*c*o.x+3*u*c*c*s.x+c*c*c*l.x,y:u*u*u*i.y+3*u*u*c*o.y+3*u*c*c*s.y+c*c*c*l.y})}}return t}var sn=e=>e===null?null:e==="top"||e==="bottom";function Ci(e){let t=[];for(let n of e){let r=t[t.length-1];if(!(r&&Math.abs(r.x-n.x)<.5&&Math.abs(r.y-n.y)<.5)){if(t.length>=2){let i=t[t.length-2],o=t[t.length-1];if(Math.abs(i.x-o.x)<.5&&Math.abs(o.x-n.x)<.5||Math.abs(i.y-o.y)<.5&&Math.abs(o.y-n.y)<.5){t[t.length-1]=n;continue}}t.push(n)}}return t.length>=2?t:e}function ws(e,t){switch(t.routing){case"straight":return{kind:"polyline",points:e};case"curved":{let n=[e[0]];for(let r=0;r<e.length-1;r++){let i=e[Math.max(r-1,0)],o=e[r],s=e[r+1],l=e[Math.min(r+2,e.length-1)];n.push({x:o.x+(s.x-i.x)/6,y:o.y+(s.y-i.y)/6}),n.push({x:s.x-(l.x-o.x)/6,y:s.y-(l.y-o.y)/6}),n.push(s)}return{kind:"curve",points:n}}case"elbow":{let n=e[0],r=e[1],i=sn(t.start.port)??Math.abs(r.y-n.y)>Math.abs(r.x-n.x),o=sn(t.end.port),s=[n];for(let l=1;l<e.length;l++){let a=e[l],c=s[s.length-1],u=Math.abs(c.x-a.x)<.5,h=Math.abs(c.y-a.y)<.5;if(u||h){s.push(a),u!==h&&(i=!u);continue}let f=l===e.length-1&&o!==null?!o:i;s.push(f?{x:c.x,y:a.y}:{x:a.x,y:c.y},a),i=f}return{kind:"polyline",points:Ci(s)}}}}function Yt(e,t){let n=e.connector;if(!n)return{kind:"polyline",points:[]};let[r,i]=Vt(e,t);if(n.waypoints&&n.waypoints.length>0)return ws([r,...n.waypoints.map(a=>({x:a.x,y:a.y})),i],n);let o=i.x-r.x,s=i.y-r.y,l=Math.abs(o)>=Math.abs(s);switch(n.routing){case"straight":return{kind:"polyline",points:[r,i]};case"curved":return l?{kind:"curve",points:[r,{x:r.x+o/2,y:r.y},{x:i.x-o/2,y:i.y},i]}:{kind:"curve",points:[r,{x:r.x,y:r.y+s/2},{x:i.x,y:i.y-s/2},i]};case"elbow":{let a=sn(n.start.port)??!l,c=sn(n.end.port)??!l,u;if(a&&c){let m=r.y+s/2;u=[r,{x:r.x,y:m},{x:i.x,y:m},i]}else if(!a&&!c){let m=r.x+o/2;u=[r,{x:m,y:r.y},{x:m,y:i.y},i]}else a?u=[r,{x:r.x,y:i.y},i]:u=[r,{x:i.x,y:r.y},i];if(n.avoid!==!0)return{kind:"polyline",points:u};let h=new Set([n.start.elementID,n.end.elementID].filter(m=>m!==null)),f=Ai(u,r,i,a,c,t.values(),h);return{kind:"polyline",points:f===u?u:Ci(f)}}}}function Li(e,t,n){let r=Math.atan2(e.y-t.y,e.x-t.x),i=Math.PI/7,o=s=>({x:e.x-n*Math.cos(r+s),y:e.y-n*Math.sin(r+s)});return[o(i),o(-i)]}function Oi(e,t){let n=Wt(Yt(e,t));if(n.length===0)return{x:0,y:0,width:0,height:0};let r=n[0].x,i=n[0].y,o=r,s=i;for(let l of n)r=Math.min(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),s=Math.max(s,l.y);return{x:r,y:i,width:o-r,height:s-i}}function Di(e,t){let n=Wt(Yt(e,t));if(n.length<=1)return n[0]??{x:0,y:0};let r=[],i=0;for(let s=0;s<n.length-1;s++){let l=Math.hypot(n[s+1].x-n[s].x,n[s+1].y-n[s].y);r.push(l),i+=l}let o=i/2;for(let s=0;s<r.length;s++){let l=r[s];if(o<=l||s===r.length-1){let a=l===0?0:o/l;return{x:n[s].x+(n[s+1].x-n[s].x)*a,y:n[s].y+(n[s+1].y-n[s].y)*a}}o-=l}return n[0]}var rr=new WeakMap;function ir(e,t){return rr.get(e.elements)?.index===t}function Mt(e){let t=e.elements,n=rr.get(t);if(n&&n.members.length===t.length&&n.members.every((i,o)=>i===t[o]))return n.index;let r=new Map;for(let i of t)r.has(i.id)||r.set(i.id,i);return rr.set(t,{members:[...t],index:r}),r}function sr(e,t,n){let r=e[1]+n>>>0,i=r<e[1]?1:0;return[e[0]+t+i>>>0,r]}function Ms(e,t){let n=e&65535,r=e>>>16,i=t&65535,o=t>>>16,s=n*i,l=n*o,a=r*i,c=r*o,u=l+a,h=s+u%65536*65536;return[c+Math.floor(u/65536)+Math.floor(h/4294967296)>>>0,h>>>0]}function lr(e,t,n){let r=Ms(e[1],n);return[r[0]+Math.imul(e[0],n)+Math.imul(e[1],t)>>>0,r[1]]}function or(e,t){let n=(e[1]>>>t|e[0]<<32-t)>>>0;return[(e[0]^e[0]>>>t)>>>0,(e[1]^n)>>>0]}function Vi(e){return e=lr(or(e,30),3210233709,484763065),e=lr(or(e,27),2496678331,321982955),or(e,31)}var jt=class{constructor(t){T(this,"state");this.state=sr([0,t>>>0],2654435769,2135587861)}next(){return this.state=sr(this.state,2654435769,2135587861),Vi(this.state)}top53(){let[t,n]=this.next();return t*2097152+(n>>>11)}signed(){return Math.floor(this.top53())/2**52-1}unit(){return this.top53()/2**53}};function ln(e,t){let n=sr([0,e>>>0],...Ps(t));return n=Vi(n),Math.max(1,n[1]>>>0)}function Ps(e){let t=lr([0,e>>>0],2654435769,2135587861);return[t[0],t[1]]}var Yi=.5,cr=160,hr=12,fr={r:.95,g:.36,b:.33,a:1},te=(e,t,n,r)=>e===null||!Number.isFinite(e)?t:Math.min(Math.max(e,n),r);function Le(e,t){let n=(t+1099511627776)%281474976710656;return e.slice(0,24)+(n<0?n+2**48:n).toString(16).toUpperCase().padStart(12,"0")}var un=e=>e===null||!Number.isFinite(e)?1:Math.min(Math.max(e,0),1e6),Wi=new WeakMap,an=new Map;function vs(e){let t=e.elements,n=Wi.get(t);if(n&&n.members.length===t.length&&n.members.every((l,a)=>l===t[a]))return n.graph;let r=new Set(t.filter(l=>l.kind!=="connector").map(l=>l.id)),i=[];for(let l of t){let a=l.connector;a&&i.push([l.id,a.start.elementID,a.end.elementID,String(un(a.cost)),a.startHead!=="none"?"both":"one"])}let o=JSON.stringify([[...r],i]),s=an.get(o);if(!s){let l=new Map,a=(c,u)=>{let h=l.get(c);h?h.push(u):l.set(c,[u])};for(let c of t){let u=c.connector,h=u?.start.elementID??null,f=u?.end.elementID??null;if(!u||h===null||f===null||h===f||!r.has(h)||!r.has(f))continue;let m=un(u.cost);a(h,{to:f,via:c.id,back:!1,cost:m}),u.startHead!=="none"&&a(f,{to:h,via:c.id,back:!0,cost:m})}s={shapes:r,next:l,trees:new Map},an.size>=16&&an.clear(),an.set(o,s)}return Wi.set(t,{members:[...t],graph:s}),s}var ar=class{constructor(){T(this,"heap",[])}get size(){return this.heap.length}less(t,n){let r=this.heap[t],i=this.heap[n];return r.dist<i.dist||r.dist===i.dist&&r.order<i.order}swap(t,n){[this.heap[t],this.heap[n]]=[this.heap[n],this.heap[t]]}push(t,n,r){this.heap.push({id:t,dist:n,order:r});for(let i=this.heap.length-1;i>0;){let o=i-1>>1;if(!this.less(i,o))break;this.swap(i,o),i=o}}pop(){let t=this.heap[0],n=this.heap.pop();if(this.heap.length>0){this.heap[0]=n;for(let r=0;;){let i=2*r+1,o=i+1,s=r;if(i<this.heap.length&&this.less(i,s)&&(s=i),o<this.heap.length&&this.less(o,s)&&(s=o),s===r)break;this.swap(r,s),r=s}}return t}};function cn(e,t,n=new Set,r){let i=vs(t),o=JSON.stringify([e,r??null,[...n].sort()]);if(i.trees.has(o))return i.trees.get(o);let s=Es(i,e,n,r);return i.trees.size>=4096&&i.trees.clear(),i.trees.set(o,s),s}function Es({shapes:e,next:t},n,r,i){if(!e.has(n)||r.has(n))return null;let o=new Map([[n,0]]),s=new Map([[n,0]]),l=1,a=new ur(n),c=new ar;for(c.push(n,0,0);c.size>0;){let{id:u,order:h}=c.pop();if(!(a.settled.has(u)||s.get(u)!==h)){if(a.settled.add(u),u===i&&u!==n)break;for(let f of t.get(u)??[]){if(r.has(f.via)||r.has(f.to)||a.settled.has(f.to))continue;let m=o.get(u)+f.cost,p=o.get(f.to);p!==void 0&&p<=m||(o.set(f.to,m),s.set(f.to,l),c.push(f.to,m,l++),a.came.set(f.to,{from:u,via:f.via,back:f.back}))}}}return a}var ur=class{constructor(t){T(this,"settled",new Set);T(this,"came",new Map);T(this,"from");this.from=t}goals(t,n){let r=t.filter(i=>i!==this.from&&this.settled.has(i));return r.length===0?[]:n&&r[0]!==t[0]?r:[r[0]]}hops(t){let n=[];for(let r=t,i=this.came.get(r);i;r=i.from,i=this.came.get(r))n.push([i.via,i.back]);return n.reverse()}};var hn=()=>({elements:new Map,flows:new Map,carry:{}});function zi(e,t,n){let r=e.flows.get(n);if(r)switch(t){case"throughput":return r.placed;case"backlog":return r.backlog;case"backup":return r.backup;case"transit":return r.transit;default:return null}let i=e.elements.get(n);if(!i)return null;switch(t){case"throughput":return i.throughput;case"load":return i.load;case"delay":return i.delay;case"backlog":return i.backlog;case"inFlight":return i.inFlight;case"depth":return i.depth;default:return null}}var nt=1e-9,br=e=>te(e.volume,1,0,1e12);function mr(e,t){if(t===null||!e.overrides)return br(e);let n=null;for(let r of e.overrides)r.volume!==null&&!oe(r.when)&&se(r.when,t)&&(n=r.volume);return n===null?br(e):Math.min(Math.max(Number.isFinite(n)?n:1,0),1e12)}function Ni(e){let t=e.delay??null;return e.kind==="connector"||t===null||!Number.isFinite(t)?0:Math.min(Math.max(t,0),3600)}var dr=(e,t)=>e+"|"+t;function Bi(e,t,n,r,i=new Set,o=null,s={}){let l=Math.max(0,Math.min(o??n,1e6)),a=Mt(t),c=new Map,u=v=>{let S=c.get(v.id);return S||(S=xr(v,t,a).points,c.set(v.id,S)),S},h=hn(),f=new Map;for(let v of t.elements)v.kind==="connector"&&!v.connector||h.elements.set(v.id,{throughput:0,load:null,delay:v.kind!=="connector"?Ni(v):0,backlog:0,inFlight:0,depth:0});let m=e??[],p=new Map;for(let v of t.elements){let S=v.capacity??null;S!==null&&Number.isFinite(S)&&p.set(v.id,Math.max(S,0))}let k=()=>new Set([...p].filter(([,v])=>v<=nt).map(([v])=>v)),y=(v,S)=>{let Y=[],O=[],V=S;for(let $=v.came.get(V);$;$=v.came.get(V))Y.push([$.via,$.back]),O.push(V),V=$.from;return O.push(V),{hops:Y.reverse(),shapes:O.reverse()}},M=(v,S)=>{let Y=[],O=[],V=[],$=0;return v.forEach(([_,Q],j)=>{let ct=a.get(_);if(!ct)return;let Z=Q?[...u(ct)].reverse():u(ct);if(Z.length===0)return;let lt=Y[Y.length-1];if(lt){let ht=Math.hypot(Z[0].x-lt.x,Z[0].y-lt.y),It=a.get(S[j]);O.push([$,$+ht,It?Ni(It):0]),$+=ht}let gt=$;for(let ht=1;ht<Z.length;ht++)$+=Math.hypot(Z[ht].x-Z[ht-1].x,Z[ht].y-Z[ht-1].y);V.push([_,gt,$]),Y.push(...Z)}),$>0?{line:new Bt(Y),length:$,inside:O,stretches:V}:null},E=(v,S,Y)=>{let O=S,V=0;for(let[$,_,Q]of v.inside){let j=($-V)/Y;if(O<=j)break;O-=j,V=$;let ct=(_-$)/Y+Q;if(O<ct)return null;O-=ct,V=_}return V+=O*Y,V>=0&&V<=v.length?V:null},b=(v,S)=>new Set([...v,...S]),R=(v,S)=>{let Y=h.elements.get(v);Y&&S(Y)},x=new Map,w=[];for(let v of m){let S=x.get(v.from)??0;w.push(S),x.set(v.from,S+1)}let d=m.length>0?Math.max(...m.map(br)):1,g=[],P=new Map,A=v=>Math.min(Math.max(te(v.every,Yi,.05,60)*d/Math.max(mr(v,r),nt),.05),60),L=new Map,W=v=>(L.has(v)||L.set(v,cn(v,t,i)),L.get(v));for(let[v,S]of m.entries()){if(S.when!==null&&r!==null&&!se(S.when,r))continue;let Y=a.get(S.from),O=Y?W(S.from):null;if(f.set(S.id,[]),!Y||!O)continue;let V=mr(S,r),$={volume:V,placed:0,backlog:0,backup:0,transit:null},_=[],Q=[],j=O.goals(S.to,S.spread===!0),ct=j.length>1?j.map(B=>[[B],V/j.length]):[[S.to,V]];for(let[B,U]of ct){if(!(U>nt))continue;let X=U;for(let H=0;H<32&&X>nt;H++){let ot=cn(S.from,t,b(i,k()),B[0]),at=ot?.goals(B,!1)[0];if(!ot||at===void 0)break;let J=y(ot,at),et=[...J.shapes,...J.hops.map(([z])=>z)],rt=et.filter(z=>p.has(z)).map(z=>p.get(z)),q=Math.min(X,rt.length>0?Math.min(...rt):1/0);if(!(q>nt))break;for(let z of et)p.has(z)&&p.set(z,p.get(z)-q);_.push({hops:J.hops,shapes:J.shapes,goal:at,amount:q}),X-=q}if(!(X>nt))continue;let it=S.from,Lt=O.goals(B,!1)[0];if(Lt!==void 0){let H=y(O,Lt),ot=k(),at=[[H.shapes[0],H.shapes[0]]];H.hops.forEach(([rt],q)=>{at.push([rt,H.shapes[q]],[H.shapes[q+1],H.shapes[q]])});let J=at.find(([rt])=>ot.has(rt));if(J){it=J[1];let rt=H.shapes.indexOf(it);for(let q=rt;q>=0;q--){let z=a.get(H.shapes[q]);if(z&&z.queue===!0&&z.kind!=="connector"){it=H.shapes[q];break}}}let et=H.shapes.indexOf(it);if(it!==S.from&&et>=0){let rt=H.shapes.slice(0,et+1),q=H.hops.slice(0,et);for(let z of[...rt,...q.map(([Ln])=>Ln)])p.has(z)&&p.set(z,Math.max(0,p.get(z)-X));_.push({hops:q,shapes:rt,goal:it,amount:X,waits:!0})}}let ut=Q.find(([H])=>H===it);ut?ut[1]+=X:Q.push([it,X])}P.set(S.id,Q),f.set(S.id,_.map(B=>({goal:B.goal,hops:B.hops,amount:B.amount,waits:B.waits===!0,cost:B.hops.reduce((U,[X])=>U+un(a.get(X)?.connector?.cost??null),0)})));for(let B of _){for(let U of[...B.shapes,...B.hops.map(([X])=>X)])R(U,X=>{X.throughput+=B.amount});B.waits||($.placed+=B.amount)}for(let[B,U]of Q)R(B,X=>{X.backlog+=U}),$.backlog+=U;let Z=_.filter(B=>!B.waits&&B.goal===S.to[0]).reduce((B,U)=>B+U.amount,0);$.backup=V>nt?Math.max(0,(V-Z)/V):0;let lt=A(S),gt=te(S.speed,cr,1,1e4),ht=te(S.size,hr,2,200),It=w[v]/x.get(S.from)*lt,Jt=S.color??fr,ft=[],xe=0;for(let B of _)xe+=B.amount/Math.max(V,nt),ft.push(xe);ft.length>0&&Math.abs(ft[ft.length-1]-1)<1e-9&&(ft[ft.length-1]=1);let je=0;_.forEach((B,U)=>{let X=M(B.hops,B.shapes);if(!X)return;let it=X.length/gt+X.inside.reduce((J,et)=>J+et[2],0);B.waits||(je+=it*B.amount);let Lt=Math.ceil((n-It-it)/lt),ut=Math.floor((n-It)/lt),H=U===0?0:ft[U-1],ot=ft[U],at=(J,et)=>Math.floor((et+1)*J)-Math.floor(et*J);for(let J=Math.max(Lt,ut-3999);J<=ut;J++){if(at(ot,J)-at(H,J)!==1)continue;let et=E(X,n-J*lt-It,gt);if(et===null)continue;let rt=X.stretches.find(([,z,Ln])=>et>=z&&et<=Ln);rt&&R(rt[0],z=>{z.inFlight+=1});let q=X.line.point(et/X.length);g.push(pr(Le(S.id,J),q.x-ht/2,q.y-ht/2,ht,Jt,Y.layerID))}}),$.transit=$.placed>nt?je/$.placed:null,h.flows.set(S.id,$)}let F=new Map,D=Object.keys(s).filter(v=>s[v]>nt);for(let v of m){let S=P.get(v.id)??[],Y=S.map(([Z])=>Z),O="|"+v.id;if(D.some(Z=>Z.endsWith(O)))for(let Z of t.elements){let lt=s[dr(Z.id,v.id)];lt!==void 0&<>nt&&!Y.includes(Z.id)&&Y.push(Z.id)}if(Y.length===0)continue;let V=mr(v,r),_=A(v)*Math.max(V,nt),Q=te(v.speed,cr,1,1e4),j=te(v.size,hr,2,200),ct=v.color??fr;Y.forEach((Z,lt)=>{let gt=a.get(Z);if(!gt)return;let ht=a.get(v.from)?.layerID??gt.layerID,It=S.find(([U])=>U===Z)?.[1]??0,Jt=Math.max(0,s[dr(Z,v.id)]??0),ft=Jt+It*l;if(It<=nt&&Jt>nt){let U=new Map(p),X=[],it=0;for(let Lt=0;Lt<32;Lt++){let ut=new Set([...U].filter(([,z])=>z<=nt).map(([z])=>z)),H=cn(Z,t,b(i,ut),v.to[0]),ot=H?.goals(v.to,!1)[0];if(!H||ot===void 0)break;let at=y(H,ot),J=[...at.shapes.slice(1),...at.hops.map(([z])=>z)],et=J.filter(z=>U.has(z)).map(z=>U.get(z)),rt=et.length>0?Math.min(...et):1/0,q=Number.isFinite(rt)?rt:Math.max(Jt/.5-it,nt*2);if(!(q>nt))break;for(let z of J)U.has(z)&&U.set(z,U.get(z)-q);if(X.push({hops:at.hops,shapes:at.shapes,rate:q}),it+=q,!Number.isFinite(rt))break}if(it>nt){if(ft=Math.max(0,Jt-it*l),ft>nt){for(let[ut,H]of U)p.set(ut,H);for(let ut of X)for(let H of[...ut.shapes,...ut.hops.map(([ot])=>ot)])R(H,ot=>{ot.throughput+=ut.rate})}let Lt=Jt/it;X.forEach((ut,H)=>{let ot=M(ut.hops,ut.shapes);if(!ot)return;let at=Math.max(_/ut.rate,.05);for(let J=0;J*at<Lt&&J*at<=l&&J<2048;J++){let et=E(ot,l-J*at,Q);if(et===null)continue;let rt=ot.line.point(et/ot.length);g.push(pr(Le(v.id,2**39+2**20+lt*2**14+H*2**11+J),rt.x-j/2,rt.y-j/2,j,ct,ht))}})}}if(!(ft>nt||It>nt))return;R(Z,U=>{U.depth+=ft}),ft>nt&&(h.carry[dr(Z,v.id)]=ft);let xe=Math.min(Math.max(Math.ceil(ft/_-1e-9),1),30),je=Math.trunc((xe+9)/10),B=F.get(Z)??0;F.set(Z,B+je);for(let U=0;U<xe;U++){let X=gt.x+2+j/2+U%10*(j+3),it=gt.y-4-j/2-(B+Math.trunc(U/10))*(j+3);g.push(pr(Le(v.id,2**39+lt*64+U),X-j/2,it-j/2,j,ct,ht))}})}for(let v of t.elements){let S=v.capacity??null,Y=h.elements.get(v.id);S===null||!Number.isFinite(S)||!Y||(Y.load=S>0?Y.throughput/S:1)}return{packets:g,metrics:h,routes:f}}var Ui={seed:1,text:null,connector:null,groupID:null,points:null,path:null,subpaths:null,evenOdd:null,rotation:null,link:null,url:null,anchor:null,click:null,hover:null,when:null,overrides:null,symbol:null,playback:null,offset:null,args:null,image:null,reveal:null};function ji(e,t,n,r="solid",i=null){return{stroke:{...e},fill:{...t},fillStyle:r,strokeWidth:n,dash:"solid",roughness:0,bowing:1,fontSize:18,font:null,gridSize:null,opacity:i,dashOffset:null,textColor:null}}function pr(e,t,n,r,i,o){return{...Ui,id:e,kind:"ellipse",layerID:o,x:t,y:n,width:r,height:r,style:ji(i,i,1.5)}}function Rs(e,t){let n=new Map;for(let i of t.elements)i.anchor!==null&&!n.has(i.anchor)&&n.set(i.anchor,i.id);let r=/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/;return(i,o)=>{let s=i.target===""?o:n.get(i.target)??(r.test(i.target)?i.target.toUpperCase():null);return s===null?null:zi(e,i.metric,s)}}function Ts(e,t,n,r,i=1/0,o={}){let s=Rs(t,r),l=[],a={};for(let c of e){let u=[];n!==null&&c.overrides&&c.overrides.forEach((p,k)=>{oe(p.when)&&se(p.when,n,y=>s(y,c.id))&&u.push(k)});let h=n===null?null:c.gauge;if(!h){l.push({applied:u,gauge:null});continue}let f=zi(t,h.metric,h.of),m=o[Gi(c.id)];if(f!==null&&m!==void 0&&h.metric!=="depth"&&h.metric!=="inFlight"&&i<$i){let p=Math.max(0,i/$i),k=p*p*(3-2*p);f=m+(f-m)*k}f!==null&&(a[Gi(c.id)]=f),l.push({applied:u,gauge:{value:f}})}return{plan:l,readings:a}}function Zi(e,t,n,r,i,o=1/0,s={}){let{plan:l,readings:a}=Ts(e,t,n,r,o,s),c=[];return e.forEach((u,h)=>{for(let m of l[h].applied)u=He(ii(u.overrides[m]),u);let f=l[h].gauge;f&&u.gauge?c.push(...Os(u,u.gauge,f.value,r,i)):c.push(u)}),{elements:c,readings:a}}var Gi=e=>"gauge|"+e,$i=1,me=e=>{let t=parseInt(e.slice(1),16);return{r:(t>>16&255)/255,g:(t>>8&255)/255,b:(t&255)/255,a:1}},Ss=me("#16a34a"),As=me("#d97706"),Is=me("#dc2626"),Fs=me("#2f6fdf"),gr=me("#e5e7eb"),Cs=me("#9ca3af");function Ls(e,t){if(t===null||!Number.isFinite(t))return"\u2013";switch(e){case"load":case"backup":return yr(t*100,0)+"%";case"transit":case"delay":return yr(t,Math.abs(t)>=10?1:2)+"s";default:return yr(t,Math.abs(t)>=100?0:Math.abs(t)>=10?1:2)}}function yr(e,t){let n=t===0?1:t===1?10:100,r=Math.floor(Math.abs(e)*n+.5);if(!(r<1e15))return e<0?"-\u221E":"\u221E";let i=Math.trunc(r/n),o=r-i*n,s=String(i);if(t>0&&o>0){let l=String(o);for(;l.length<t;)l="0"+l;for(;l.endsWith("0");)l=l.slice(0,-1);s+="."+l}return(e<0&&r>0?"-":"")+s}function Os(e,t,n,r,i){let o=r.elements.find(x=>x.id===t.of),s=t.max??(t.metric==="load"?1:o?.capacity??n??1),l=n===null?0:s>0?Math.min(Math.max(n/s,0),1):0,a=t.warn??(t.metric==="load"?.7:null),c=t.alarm??(t.metric==="load"?.9:null),u=a===null&&c===null?Fs:Ss;n!==null&&a!==null&&n>=a&&(u=As),n!==null&&c!==null&&n>=c&&(u=Is),n===null&&(u=Cs);let h=t.label;if(h===null){let x=o?o.text!==null?o.text.split(`
|
|
4
|
-
`)[0]:o.anchor:null;h=`${t.metric} ${x??(i.some(w=>w.id===t.of)?"flow":"?")}`}let f=t.style??"number",m=Math.max(e.width,1),p=Math.max(e.height,1),k=(x,w)=>[x.x/m,x.y/p,(x.x+(w.x-x.x)/3)/m,(x.y+(w.y-x.y)/3)/p,(x.x+2*(w.x-x.x)/3)/m,(x.y+2*(w.y-x.y)/3)/p,w.x/m,w.y/p],y=(x,w,d,g)=>{let P=[{x,y:w},{x:x+d,y:w},{x:x+d,y:w+g},{x,y:w+g}],A=k(P[0],P[1]);for(let L=1;L<4;L++)A=A.concat(k(P[L],P[(L+1)%4]).slice(2));return{closed:!0,coords:A}},M=(x,w,d,g)=>{let P=Math.max(1,Math.ceil(Math.abs(g-d)/(Math.PI/2)-1e-9)),A=(g-d)/P,L=4/3*Math.tan(A/4),W=v=>({x:x.x+w*Math.cos(v),y:x.y+w*Math.sin(v)}),F=W(d),D=[F.x/m,F.y/p];for(let v=0;v<P;v++){let
|
|
5
|
-
`+Ls(t.metric,n),style:{...e.style}},R=[];if(f==="number")b.labelRect={x:0,y:0,width:1,height:1},b.style.textColor={...u};else if(f==="bar"){b.labelRect={x:0,y:0,width:1,height:.66};let x=Math.min(10,m*.08),w=Math.min(12,p*.18),d=p*.72,g=m-2*x;R.push(E(1,[y(x,d,g,w)],gr,gr,.5)),l>0&&R.push(E(2,[y(x,d,g*l,w)],u,u,.5))}else{b.labelRect={x:0,y:.54,width:1,height:.46};let x=Math.min(m*.38,p*.4),w={x:m/2,y:p*.5},d=Math.max(2,x*.16);R.push(E(1,[M(w,x,Math.PI,2*Math.PI)],gr,null,d)),l>0&&R.push(E(2,[M(w,x,Math.PI,Math.PI+Math.PI*l)],u,null,d));let g=Math.PI+Math.PI*l,P={x:w.x+x*.85*Math.cos(g),y:w.y+x*.85*Math.sin(g)};R.push(E(3,[{closed:!1,coords:k(w,P)}],{r:.2,g:.2,b:.2,a:1},null,2))}return[b,...R]}var Xi=(e,t,n)=>e.signed()*t*n;function Nt(e,t,n,r,i,o,s){let l=Math.hypot(t.x-e.x,t.y-e.y);if(!(l>.5))return;let a=l<200?1:l>500?.4:-.0016668*l+1.233334,c=l<20?l/10:2;for(let u=0;u<2;u++){let h=(u===0?1:.5)*a,f=()=>Xi(n,c,r)*h,m=n.unit()*.4+.3,p=Xi(n,l/60,r)*i*a,k=t.x-e.x,y=t.y-e.y,M=-y/l,E=k/l,b=o?e:{x:e.x+f(),y:e.y+f()},R=o?t:{x:t.x+f(),y:t.y+f()},x=e.x+k*m*.66+M*p+f()*.5,w=e.y+y*m*.66+E*p+f()*.5,d=e.x+k*(.5+m*.5)+M*p+f()*.5,g=e.y+y*(.5+m*.5)+E*p+f()*.5;s.moveTo(b),s.curveTo(R,{x,y:w},{x:d,y:g})}}function kr(e,t,n,r){let i=new K;for(let o=0;o<e.length;o++)Nt(e[o],e[(o+1)%e.length],t,n,r,!1,i);return i}function Ki(e,t,n){let r=new K,i=e.x+e.width/2,o=e.y+e.height/2,s=e.width/2,l=e.height/2;if(!(s>.5&&l>.5))return r;let a=Math.max(8,Math.min(24,Math.trunc((s+l)/6))),c=Math.min(2.5,(s+l)/25)*n;for(let u=0;u<2;u++){let h=t.unit()*2*Math.PI,f=2*Math.PI*(u===0?1:1.04),m=Math.trunc(a*f/(2*Math.PI))+1,p=[];for(let k=0;k<m;k++){let y=h+f*k/a,M=t.signed()*c,E=t.signed()*c;p.push({x:i+s*Math.cos(y)+M,y:o+l*Math.sin(y)+E})}Ds(p,r)}return r}function Ds(e,t){if(!(e.length<=2)){t.moveTo(e[0]);for(let n=0;n<e.length-1;n++){let r=e[Math.max(n-1,0)],i=e[n],o=e[n+1],s=e[Math.min(n+2,e.length-1)];t.curveTo(o,{x:i.x+(o.x-r.x)/6,y:i.y+(o.y-r.y)/6},{x:o.x-(s.x-i.x)/6,y:o.y-(s.y-i.y)/6})}}}var wr=-41*Math.PI/180;function Hi(e,t,n){if(!(n>0))return[];let r=Math.cos(t),i=Math.sin(t),o=e.filter(f=>f.length>=3).map(f=>f.map(m=>({x:m.x*r+m.y*i,y:-m.x*i+m.y*r}))),s=o.flat();if(s.length===0)return[];let l=1/0,a=-1/0;for(let f of s)l=Math.min(l,f.y),a=Math.max(a,f.y);let c=(f,m)=>({x:f*r-m*i,y:f*i+m*r}),u=[],h=l+n/2;for(;h<a;){let f=[];for(let m of o)for(let p=0;p<m.length;p++){let k=m[p],y=m[(p+1)%m.length];(k.y<=h&&h<y.y||y.y<=h&&h<k.y)&&f.push(k.x+(h-k.y)/(y.y-k.y)*(y.x-k.x))}f.sort((m,p)=>m-p);for(let m=0;m+1<f.length;m+=2)f[m+1]-f[m]>.5&&u.push([c(f[m],h),c(f[m+1],h)]);h+=n}return u}var Qi=2,Mr=.75,Vs=.8,_i=.6;function to(e,t){return[...qi(e,t,!1),...qi(e,t,!0)]}function qi(e,t,n){if(!(t>0))return[];let r=c=>n?{x:c.y,y:c.x}:c,i=e.filter(c=>c.length>=3).map(c=>c.map(r)),o=i.flat().map(c=>c.y);if(o.length===0)return[];let s=Math.min(...o),l=Math.max(...o),a=[];for(let c=Math.floor(s/t)*t;c<l-.5;c+=t){if(!(c>s+.5))continue;let u=[];for(let h of i)for(let f=0;f<h.length;f++){let m=h[f],p=h[(f+1)%h.length];(m.y<=c&&c<p.y||p.y<=c&&c<m.y)&&u.push(m.x+(c-m.y)/(p.y-m.y)*(p.x-m.x))}u.sort((h,f)=>h-f);for(let h=0;h+1<u.length;h+=2)u[h+1]-u[h]>.5&&a.push([r({x:u[h],y:c}),r({x:u[h+1],y:c})])}return a}function eo(e){return .2126*e.r+.7152*e.g+.0722*e.b>.5?{r:e.r*.84,g:e.g*.84,b:e.b*.8,a:e.a}:{r:e.r+(1-e.r)*.25,g:e.g+(1-e.g)*.25,b:e.b+(1-e.b)*.25,a:e.a}}function Pr(e){return e.style.fillStyle==="grid"&&e.style.fill.a>0&&["rectangle","ellipse","diamond","path"].includes(e.kind)}function mn(e,t,n){let r=(Math.imul(e,668265261)^Math.imul(t,374761393)^Math.imul(n,2654435761))>>>0;return r=Math.imul(r^r>>>15,2246822507)>>>0,r=Math.imul(r^r>>>13,3266489909)>>>0,r=(r^r>>>16)>>>0,r/4294967296}function no(e,t,n){let r=n/Qi;return{x:(e+.5+(mn(e,t,1)-.5)*_i)*r,y:(t+.5+(mn(e,t,2)-.5)*_i)*r}}function Ws(e,t,n,r){let i=1/0;for(let o=-1;o<=1;o++)for(let s=-1;s<=1;s++){if(o===0&&s===0)continue;let l=no(e+o,t+s,r);i=Math.min(i,Math.hypot(l.x-n.x,l.y-n.y))}return i*Vs}function Ys(e,t,n){let r=Math.cos(t),i=Math.sin(t),o=n*.8,s=n*.5;return[-1,0,1].map(l=>{let a=e.x-i*s*l,c=e.y+r*s*l;return[{x:a-r*o,y:c-i*o},{x:a+r*o,y:c+i*o}]})}function Ns(e,t){let n=!1;for(let r of e){if(r.length<3)continue;let i=r.length-1;for(let o=0;o<r.length;o++){let s=r[o],l=r[i];s.y>t.y!=l.y>t.y&&t.x<(l.x-s.x)*(t.y-s.y)/(l.y-s.y)+s.x&&(n=!n),i=o}}return n}function Gs(e,t){let n=1/0;for(let r of t)if(!(r.length<2))for(let i=0;i<r.length;i++){let o=r[i],s=r[(i+1)%r.length],l=s.x-o.x,a=s.y-o.y,c=l*l+a*a,u=c>0?Math.max(0,Math.min(1,((e.x-o.x)*l+(e.y-o.y)*a)/c)):0;n=Math.min(n,Math.hypot(e.x-(o.x+u*l),e.y-(o.y+u*a)))}return n}var $s=(e,t)=>t.x>=e.x&&t.x<e.x+e.width&&t.y>=e.y&&t.y<e.y+e.height,fn=new Map;function ro(e){if(e.length===0)return[];let t=e.map(i=>[i.kind,i.x,i.y,i.width,i.height,i.rotation??0,ee(i),JSON.stringify(i.subpaths??null),i.style.stroke.r,i.style.stroke.g,i.style.stroke.b,i.style.stroke.a,i.style.roughness,i.style.strokeWidth].join(",")).join(";"),n=fn.get(t);if(n)return n;let r=zs(e);return fn.size>=16&&fn.clear(),fn.set(t,r),r}function zs(e){let t=e.map(o=>{let s=vr(o).map(m=>m.map(p=>Ft(o,p))),l=s.flat(),a=l.map(m=>m.x),c=l.map(m=>m.y),u=a.length?Math.min(...a):0,h=c.length?Math.min(...c):0,f={x:u,y:h,width:(a.length?Math.max(...a):0)-u,height:(c.length?Math.max(...c):0)-h};return{contours:s,box:f,cell:ee(o),element:o}}),n=t.map(()=>[]),r=new Set;for(let o of t){let s=o.cell/Qi,l=he(o.box,-o.cell,-o.cell),a=Math.floor(l.x/s),c=Math.ceil((l.x+l.width)/s),u=Math.floor(l.y/s),h=Math.ceil((l.y+l.height)/s),f=Mr*o.cell;for(let m=a;m<c;m++)for(let p=u;p<h;p++){let k=`${o.cell}|${m}|${p}`;if(r.has(k))continue;r.add(k);let y=no(m,p,o.cell),M=1/0,E=-1;for(let w=0;w<t.length;w++){let d=t[w];if(!$s(he(d.box,-f,-f),y))continue;if(Ns(d.contours,y)){M=0;break}let g=Gs(y,d.contours);g<M&&(M=g,E=w)}if(!(M>0&&M<=f&&E>=0))continue;let b=mn(m,p,3)*Math.PI,R=Ws(m,p,y,o.cell),x=Math.trunc(mn(m,p,4)*4294967296)>>>0;for(let[w,d]of Ys(y,b,R))n[E].push([w,d,x])}}let i=[];return t.forEach((o,s)=>{if(n[s].length===0)return;let l=o.element,a=new K;for(let[c,u,h]of n[s])l.style.roughness<=0?a.moveTo(c).lineTo(u):Nt(c,u,new jt(h),l.style.roughness*.35,.2,!1,a);i.push({ink:{...l.style.stroke,a:l.style.stroke.a*.6},width:Math.max(.8,l.style.strokeWidth*.45),path:a})}),i}var dn=class{constructor(t=6e3){T(this,"map",new Map);T(this,"limit");this.limit=t}get(t,n){let r=this.map.get(t);if(r!==void 0)return r;let i=n();return this.map.size>=this.limit&&this.map.clear(),this.map.set(t,i),i}},ao=new dn,Bs=new dn;function uo(e,t){let n=e.style;return[t,e.kind,e.x,e.y,e.width,e.height,e.seed,n.roughness,n.bowing,n.strokeWidth,n.fillStyle,n.fillStyle==="grid"?ee(e):0,e.path?e.path.join(","):e.subpaths?JSON.stringify(e.subpaths):""].join("|")}var ee=e=>Math.max(8,e.style.gridSize??50);function ne(e){return e.kind==="freehand"&&e.path===null?io(e):ao.get(uo(e,0),()=>io(e))}function co(e){return[{x:e.x,y:e.y},{x:vt(e),y:e.y},{x:vt(e),y:Et(e)},{x:e.x,y:Et(e)}]}function pn(e){return[{x:Rt(e),y:e.y},{x:vt(e),y:Tt(e)},{x:Rt(e),y:Et(e)},{x:e.x,y:Tt(e)}]}function io(e){let t=st(e),n=new jt(e.seed),r=e.style.roughness;switch(e.kind){case"ellipse":return r<=0?K.ellipse(t):Ki(t,n,r);case"diamond":return r<=0?new K().addLines(pn(t)).close():kr(pn(t),n,r,e.style.bowing);case"text":case"connector":return K.rect(t);case"freehand":return js(e);case"path":return r<=0?Qn(e):Us(e,n);default:return r<=0?K.rect(t):kr(co(t),n,r,e.style.bowing)}}function Us(e,t){let n=e.style.roughness,r=new K;for(let i of fe(e)){let o=i.points;for(let s=0;s<(o.length-1)/3;s++){let l=o[3*s],a=o[3*s+1],c=o[3*s+2],u=o[3*s+3];if(a.x===l.x&&a.y===l.y&&c.x===u.x&&c.y===u.y){Nt(l,u,t,n,e.style.bowing,!0,r);continue}let h=Math.hypot(a.x-l.x,a.y-l.y)+Math.hypot(c.x-a.x,c.y-a.y)+Math.hypot(u.x-c.x,u.y-c.y),f=Math.min(2.5,h/30)*n;for(let m=0;m<2;m++){let p=m===0?1:.5,k=()=>t.signed()*f*p;r.moveTo(l);let y=a.x+k(),M=a.y+k(),E=c.x+k(),b=c.y+k();r.curveTo(u,{x:y,y:M},{x:E,y:b})}}}return r}function js(e){let t=st(e),n=e.path;if(n&&n.length>=8&&(n.length-2)%6===0){let o=l=>({x:t.x+n[2*l]*t.width,y:t.y+n[2*l+1]*t.height}),s=new K().moveTo(o(0));for(let l=0;l<Math.floor((n.length/2-1)/3);l++)s.curveTo(o(3*l+3),o(3*l+1),o(3*l+2));return s}let r=(e.points??[]).map(o=>({x:t.x+o.x*t.width,y:t.y+o.y*t.height})),i=new K;if(r.length===0)return i;if(i.moveTo(r[0]),r.length===1)return i.lineTo(r[0]);if(r.length===2)return i.lineTo(r[1]);for(let o=1;o<r.length-1;o++)i.quadTo({x:(r[o].x+r[o+1].x)/2,y:(r[o].y+r[o+1].y)/2},r[o]);return i.lineTo(r[r.length-1])}function vr(e){return e.kind!=="path"?[Zs(e)]:fe(e).map(t=>Pi(t.points,3))}function Zs(e){let t=st(e);if(e.kind==="ellipse"){let n=[];for(let r=0;r<48;r++){let i=2*Math.PI*r/48;n.push({x:Rt(t)+t.width/2*Math.cos(i),y:Tt(t)+t.height/2*Math.sin(i)})}return n}return e.kind==="diamond"?pn(t):co(t)}function gn(e){let t=st(e);return e.kind==="ellipse"?K.ellipse(t):e.kind==="path"?Qn(e):e.kind==="diamond"?new K().addLines(pn(t)).close():K.rect(t)}function Tr(e){return e.style.fillStyle==="solid"||["freehand","connector","text","image"].includes(e.kind)?new K:ao.get(uo(e,1),()=>Xs(e))}function Xs(e){let t=vr(e),n=new jt((e.seed^1540483477)>>>0),r=new K;if(e.style.fillStyle==="grid"){for(let[s,l]of to(t,ee(e)))e.style.roughness<=0?r.moveTo(s).lineTo(l):Nt(s,l,n,e.style.roughness*.3,.3,!1,r);return r}let i=Math.max(4,e.style.strokeWidth*4),o=[wr];e.style.fillStyle==="crossHatch"&&o.push(wr+Math.PI/2);for(let s of o)for(let[l,a]of Hi(t,s,i))e.style.roughness<=0?r.moveTo(l).lineTo(a):Nt(l,a,n,e.style.roughness*.6,.5,!1,r);return r}function yn(e,t){switch(e){case"solid":return null;case"dashed":return[Math.max(8,t*4),Math.max(6,t*3)];case"dotted":return[.01,Math.max(5,t*2.6)]}}function Sr(e,t,n){let r=e.connector;if(!r)return[new K,new K];let[i,o]=Vt(e,t),s=Yt(e,t),l=r.hops===!0&&n?Hs(e,s,n,t):[],a=[e.seed,e.style.roughness,e.style.bowing,e.style.strokeWidth,r.routing,r.startHead,r.endHead,r.start.port,r.end.port,i.x,i.y,o.x,o.y,JSON.stringify(r.waypoints),JSON.stringify(l)].join("|");return Bs.get(a,()=>Js(e,s,l))}function ho(e){return Math.max(8,e*4)}function fo(e){let t=e.points,n=[];if(e.kind==="polyline"){for(let r=0;r<t.length-1;r++)n.push([t[r],t[r+1]]);return n}for(let r=0;r<Math.floor((t.length-1)/3);r++){let i=t.slice(3*r,3*r+4),o=[];for(let s=0;s<=24;s++)o.push(Er(i,s/24));n.push(o)}return n}function mo(e){let t=[0];for(let n=1;n<e.length;n++)t.push(t[n-1]+Math.hypot(e[n].x-e[n-1].x,e[n].y-e[n-1].y));return t}function Er(e,t){let n=1-t;return{x:n*n*n*e[0].x+3*n*n*t*e[1].x+3*n*t*t*e[2].x+t*t*t*e[3].x,y:n*n*n*e[0].y+3*n*n*t*e[1].y+3*n*t*t*e[2].y+t*t*t*e[3].y}}function oo(e,t,n){let r=(o,s)=>{let l=(p,k)=>({x:p.x+(k.x-p.x)*s,y:p.y+(k.y-p.y)*s}),a=l(o[0],o[1]),c=l(o[1],o[2]),u=l(o[2],o[3]),h=l(a,c),f=l(c,u),m=l(h,f);return[[o[0],a,h,m],[m,f,u,o[3]]]},i=r(e,n)[0];return n>0?r(i,t/n)[1]:[e[0],e[0],e[0],e[0]]}function Rr(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let o of e)t=Math.min(t,o.x),n=Math.min(n,o.y),r=Math.max(r,o.x),i=Math.max(i,o.y);return{x0:t,y0:n,x1:r,y1:i}}function so(e,t){return e.x0<=t.x1+1e-6&&t.x0<=e.x1+1e-6&&e.y0<=t.y1+1e-6&&t.y0<=e.y1+1e-6}var lo=new WeakMap;function Ks(e,t,n){let r=lo.get(n);if(!r||r.layers!==t.layers||!ir(t,n)){let o=new Set(t.layers.filter(a=>a.visible).map(a=>a.id)),s=new Map,l=[];for(let a of Dt(t))s.has(a.id)||s.set(a.id,l.length),a.kind==="connector"&&o.has(a.layerID)&&l.push(a);r={layers:t.layers,first:s,under:l,lines:[]},ir(t,n)&&lo.set(n,r)}let i=r.first.get(e.id)??r.under.length;for(;r.lines.length<i;){let o=Wt(Yt(r.under[r.lines.length],n));r.lines.push({points:o,box:Rr(o)})}return{lines:r.lines,count:i}}function Hs(e,t,n,r){let i=fo(t);if(i.length===0)return[];let{lines:o,count:s}=Ks(e,n,r),l=ho(e.style.strokeWidth),a=[];for(let c of i){let u=mo(c),h=u[u.length-1],f=[],m=[],p=Rr(c);for(let y=0;y<s;y++)so(p,o[y].box)&&m.push(o[y]);for(let y=0;y<c.length-1;y++){let M=c[y],E=c[y+1],b=E.x-M.x,R=E.y-M.y,x=Rr([M,E]);for(let{points:w,box:d}of m)if(so(x,d))for(let g=0;g<w.length-1;g++){let P=w[g],A=w[g+1],L=A.x-P.x,W=A.y-P.y,F=b*W-R*L;if(Math.abs(F)<1e-9)continue;let D=P.x-M.x,v=P.y-M.y,S=(D*W-v*L)/F,Y=(D*R-v*b)/F;S>0&&S<1&&Y>=0&&Y<=1&&f.push(u[y]+S*(u[y+1]-u[y]))}}let k=[];for(let y of f.sort((M,E)=>M-E))y<l+2||y>h-l-2||k.length>0&&y-k[k.length-1]<2*l+2||k.push(y);a.push(k)}return a}function Js(e,t,n){let r=e.connector,i=new jt(e.seed),o=e.style.roughness,s=e.style.bowing,l=new K,a=new K,c=o*3,u=()=>i.signed()*c,h=(M,E,b,R)=>{let x={x:b.y,y:-b.x};(x.y>1e-9||Math.abs(x.y)<=1e-9&&x.x>0)&&(x={x:-x.x,y:-x.y});let w=R*.5523,d={x:(M.x+E.x)/2,y:(M.y+E.y)/2},g={x:d.x+x.x*R,y:d.y+x.y*R};l.moveTo(M);let P=M.x+x.x*w+u(),A=M.y+x.y*w+u(),L=g.x-b.x*w+u(),W=g.y-b.y*w+u();l.curveTo(g,{x:P,y:A},{x:L,y:W});let F=g.x+b.x*w+u(),D=g.y+b.y*w+u(),v=E.x+x.x*w+u(),S=E.y+x.y*w+u();l.curveTo(E,{x:F,y:D},{x:v,y:S})},f=ho(e.style.strokeWidth);if(t.kind==="polyline"){let M=t.points,E=(b,R)=>{o<=0?l.moveTo(b).lineTo(R):Nt(b,R,i,o,s,!0,l)};for(let b=0;b<Math.max(M.length-1,0);b++){let R=M[b],x=M[b+1],w=Math.hypot(x.x-R.x,x.y-R.y),d=w>0?{x:(x.x-R.x)/w,y:(x.y-R.y)/w}:{x:0,y:0},g=A=>({x:R.x+d.x*A,y:R.y+d.y*A}),P=R;for(let A of b<n.length?n[b]:[]){let L=g(A-f),W=g(A+f);E(P,L),h(L,W,d,f),P=W}E(P,x)}}else{let M=t.points,E=fo(t);l.moveTo(M[0]);for(let b=0;b<Math.floor((M.length-1)/3);b++){let R=M[3*b+1],x=M[3*b+2],w=M[3*b+3],d=R.x+u(),g=R.y+u(),P=x.x+u(),A=x.y+u(),L=b<n.length?n[b]:[];if(L.length===0){l.curveTo(w,{x:d,y:g},{x:P,y:A});continue}let W=[M[3*b],{x:d,y:g},{x:P,y:A},w],F=mo(E[b]),D=Y=>{let O=0;for(;O<F.length-2&&F[O+1]<Y;)O++;let V=F[O+1]-F[O];return(O+(V>0?(Y-F[O])/V:0))/24},v=0;for(let Y of L){let O=D(Y-f),V=D(Y+f),$=oo(W,v,O);(b>0||v>0)&&l.moveTo($[0]),l.curveTo($[3],$[1],$[2]);let _=Er(W,O),Q=Er(W,V),j=Math.hypot(Q.x-_.x,Q.y-_.y),ct=j>0?{x:(Q.x-_.x)/j,y:(Q.y-_.y)/j}:{x:0,y:0};h(_,Q,ct,j/2),v=V}let S=oo(W,v,1);l.moveTo(S[0]).curveTo(S[3],S[1],S[2])}}let m=Wt(t),p=Math.max(10,e.style.strokeWidth*5),k=(M,E)=>{o<=0?l.moveTo(M).lineTo(E):Nt(M,E,i,o*.5,0,!0,l)},y=(M,E,b)=>{let[R,x]=Li(E,b,p);switch(M){case"arrow":k(R,E),k(x,E);break;case"triangle":k(R,E),k(x,E),k(R,x),a.moveTo(E).lineTo(R).lineTo(x).close();break;case"dot":{let w=p*.32,d=Math.atan2(E.y-b.y,E.x-b.x),g=E.x-w*Math.cos(d),P=E.y-w*Math.sin(d);a.addEllipse({x:g-w,y:P-w,width:2*w,height:2*w});break}case"bar":{let w=Math.atan2(E.y-b.y,E.x-b.x)+Math.PI/2,d=p*.5;k({x:E.x-d*Math.cos(w),y:E.y-d*Math.sin(w)},{x:E.x+d*Math.cos(w),y:E.y+d*Math.sin(w)});break}}};return m.length>1&&(y(r.endHead,m[m.length-1],m[m.length-2]),y(r.startHead,m[0],m[1])),[l,a]}function Fr(e,t){switch(e){case"linear":return t;case"easeIn":return t*t*t;case"easeOut":return 1-Math.pow(1-t,3);case"easeInOut":return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;case"hold":return 0;case"spring":return _s(t);case"bounce":return qs(t);case"elastic":return Qs(t)}}function _s(e){if(e<=0)return 0;if(e>=1)return 1;let t=n=>1-Math.exp(-6*n)*(Math.cos(3*Math.PI*n)+6/(3*Math.PI)*Math.sin(3*Math.PI*n));return t(e)+e*(1-t(1))}function qs(e){if(e<=0)return 0;if(e>=1)return 1;let t=7.5625,n=2.75;if(e<1/n)return t*e*e;if(e<2/n){let i=e-1.5/n;return t*i*i+.75}if(e<2.5/n){let i=e-2.25/n;return t*i*i+.9375}let r=e-2.625/n;return t*r*r+.984375}function Qs(e){return e<=0?0:e>=1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1}var Oe=(e,t)=>e%t;function De(e,t){let n=(e.repeats??[]).filter(_e).slice().sort((r,i)=>r.start-i.start);if(n.length===0)return t;for(let r of n){if(!(t>=r.end))continue;let i=r.end-r.start;if(r.count===null)return r.start+Oe(t-r.start,i);let o=i*r.count;if(t<r.start+o)return r.start+Oe(t-r.start,i);t-=o-i}return t}function Ar(e,t,n,r,i){t=De(e,t);let o,s;for(let u of e.keys)if(n(u)!==void 0)if(u.t<=t)o=u;else{s=u;break}if(!o&&!s)return r;if(o&&!s)return n(o);if(!o&&s)return n(s);let l=o,a=s,c=a.t-l.t>0?(t-l.t)/(a.t-l.t):1;return i(n(l),n(a),Fr(l.ease??"linear",c))}var tl=(e,t,n)=>e+(t-e)*n,bn=(e,t,n)=>Math.min(Math.max(e+(t-e)*n,0),1),po=(e,t,n)=>({r:bn(e.r,t.r,n),g:bn(e.g,t.g,n),b:bn(e.b,t.b,n),a:bn(e.a,t.a,n)});function Zt(e,t,n,r){return Ar(e,t,i=>i[n],r,tl)}function el(e,t){t=De(e,t);let n=(i,o)=>{let s;for(let a of e.keys)a.t<=t&&i(a)!==void 0&&(s=a);let l=e.keys.find(a=>a.t>t&&i(a)!==void 0);return!s||!l?!1:s.ease!=="hold"&&!o(i(s),i(l))},r=i=>n(o=>o[i],(o,s)=>o===s);return r("x")||r("y")||r("width")||r("height")||r("rotation")||r("strokeWidth")||n(i=>i.stroke,ae)||n(i=>i.fill,ae)||r("reveal")||r("opacity")}function Ir(e,t){t=De(e,t);let n=e.keys.filter(i=>i.visible!==void 0);if(n.length===0)return!0;let r;for(let i of n)i.t<=t&&(r=i);return r?r.visible:!n[0].visible}function nl(e,t,n){if(t=mt(t),e.keys.some(r=>r.reveal!==void 0)){let r=Zt(e,n,"reveal",t.reveal??1);t.reveal=r>=1?null:Math.max(0,r)}if(e.keys.some(r=>r.opacity!==void 0)){let r=Math.min(Math.max(Zt(e,n,"opacity",t.style.opacity??1),0),1);t.style.opacity=r>=1?null:r}return t.kind==="connector"||(t.x=Zt(e,n,"x",t.x),t.y=Zt(e,n,"y",t.y),t.width=Math.max(0,Zt(e,n,"width",t.width)),t.height=Math.max(0,Zt(e,n,"height",t.height)),e.keys.some(r=>r.rotation!==void 0)&&(t.rotation=Zt(e,n,"rotation",wt(t))),t.style.strokeWidth=Math.max(0,Zt(e,n,"strokeWidth",t.style.strokeWidth)),t.style.stroke=Ar(e,n,r=>r.stroke,t.style.stroke,po),t.style.fill=Ar(e,n,r=>r.fill,t.style.fill,po)),t}function rl(e,t){t=De(e,t);let n=null;for(let i of e.follow??[])i.start<=t&&(n===null||i.start>n.start)&&(n=i);if(!n)return null;let r=n;return e.keys.some(i=>i.t>=r.end&&i.t<=t&&(i.x!==void 0||i.y!==void 0))?null:n}function xr(e,t,n=Mt(t)){if(e.kind==="connector")return new Bt(Wt(Yt(e,n)));let r=mt(e);r.style.roughness=0;let i=ne(r).contours()[0]??[];return new Bt(wt(e)===0?i:i.map(o=>Ft(e,o)))}function il(e,t,n,r){let i=rl(e,n);if(!i)return t;n=De(e,n);let o=Mt(r),s=o.get(i.path);if(!s||s.id===t.id)return t;let l=xr(s,r,o),a=i.end-i.start,c=Math.min(Math.max(Fr(i.ease??"easeInOut",a>0?Math.min(1,(n-i.start)/a):1),0),1)*(i.laps??1);c>1&&(c=Oe(c,1)===0?1:Oe(c,1)),i.reverse===!0&&(c=1-c);let u=l.point(c),h=mt(t);if(h.x=u.x-t.width/2,h.y=u.y-t.height/2,i.orient===!0){let f=i.reverse===!0?-.01:.01,m=l.point(c-f/2),p=l.point(c+f/2);(m.x!==p.x||m.y!==p.y)&&(h.rotation=Math.atan2(p.y-m.y,p.x-m.x))}return h}function ol(e,t,n,r){if(!(n>0))return 0;let i=dt(e.duration);if(i>0){let s=Fe(t*i/n);s!==0&&(t=s*n/i)}let o=Oe(t*r,n);return o<0?-o:o===0?0:n-o}function sl(e){let t=new Map;for(let n of e.tracks)t.has(n.element)||t.set(n.element,n);return t}function Ct(e,t,n="initial",r=null,i={}){return St(de(e,t,n,r,i),dt(t))}var ll={fps:12,duration:0,boil:null,settle:null,poster:null,tracks:[],camera:null,markers:null};function de(e,t,n="initial",r=null,i={}){return Cr(e,t,n,r,i).frame}function Cr(e,t,n="initial",r=null,i={}){let o=ni(e,n),s=Vn(e,n),l=new Map;for(let d of e.elements){let g=ri(d,s);g.length>0&&l.set(d.id,g)}let c=(e.flows??[]).length>0||e.elements.some(d=>d.gauge||(d.overrides??[]).some(g=>oe(g.when))),u=s!==null&&Object.keys(s).length>0&&e.elements.some(d=>d.text?.includes("{")||(d.overrides??[]).some(g=>g.text?.includes("{"))),h=e.timeline??(o.size===0&&l.size===0&&!c&&!u?null:ll);if(!h)return{frame:e,metrics:hn()};t=dt(t);let f=sl(h);for(let[d,g]of l){let P=f.get(d);!P?.follow||!g.some(A=>A.reroute)||f.set(d,{...P,follow:P.follow.map(A=>{let L=A.path;for(let W of g)L=W.reroute?.[L]??L;return{...A,path:L}})})}let m=h.boil===null?null:Math.trunc(Math.floor(t*ue(h.fps)+1e-9)/Math.max(1,h.boil))%jn>>>0,p=new Set;for(let d of f.values())Ir(d,t)||p.add(d.element);for(let d of o)p.add(d);let k=null;if(h.settle===!0){k=new Set;for(let d of f.values())el(d,t)&&k.add(d.element)}let y=d=>{let g=f.get(d.id)?.boil;return g??(k?d.connector?[d.connector.start.elementID,d.connector.end.elementID].some(P=>P!==null&&k.has(P)):k.has(d.id):!0)},M=e.elements.map(d=>{let g=f.get(d.id),P=g?nl(g,d,t):d;for(let W of l.get(d.id)??[])P=He(W,P);if(u&&s&&P.text){let W=ei(P.text,s);W!==P.text&&(P={...P,text:W})}let A=l.get(d.id);if(A){let W=A.map(D=>D.capacity).filter(D=>D!==null&&Number.isFinite(D)),F=A.map(D=>D.delay).filter(D=>D!==null&&Number.isFinite(D));W.length>0&&(P.capacity=Math.max(Math.min(...W),0)),F.length>0&&P.kind!=="connector"&&(P.delay=Math.max(Math.max(...F),0))}m!==null&&m>0&&y(d)&&(P===d&&(P=mt(d)),P.seed=ln(d.seed,m));let L=g?.march!=null?yn(P.style.dash,P.style.strokeWidth):null;return g?.march!=null&&L&&(P===d&&(P=mt(d)),P.style.dashOffset=ol(h,g.march,L.reduce((W,F)=>W+F,0),t)),P});M=M.map((d,g)=>p.has(d.id)?e.elements[g]:d);let E={...e,elements:M,timeline:null};M=M.map(d=>{let g=f.get(d.id);return g?il(g,d,t,E):d});let b={...e,elements:M,timeline:null},R=Mt(b),x=new Set(p);M=M.map(d=>{let g=d.connector;if(!g||![g.start.elementID,g.end.elementID].some(W=>W!==null&&p.has(W)))return d;if(!(f.get(d.id)?.keys.some(W=>W.visible!==void 0)??!1)||[g.start.elementID,g.end.elementID].some(W=>W!==null&&o.has(W)))return x.add(d.id),d;let[P,A]=Vt(d,R),L=mt(d);return L.connector.start={elementID:null,port:g.start.port,x:P.x,y:P.y},L.connector.end={elementID:null,port:g.end.port,x:A.x,y:A.y},L}),M=M.filter(d=>!x.has(d.id));let w=hn();if(c){let d=new Set([...l].filter(([,L])=>L.some(W=>W.offline===!0)).map(([L])=>L)),g={...e,elements:M,timeline:null},P=Bi(e.flows,g,t,s,d,r,i);w=P.metrics;let A=Zi(M,P.metrics,s,g,e.flows??[],Math.max(0,Math.min(r??t,1e6)),i);Object.assign(w.carry,A.readings),M=[...A.elements,...P.packets]}return{frame:{...e,elements:M,timeline:null,flows:c?null:e.flows},metrics:w}}function Xt(e){return e.timeline?e.timeline.poster??e.timeline.duration:0}function yo(e){return e.timeline?Ct(e,Xt(e)):St(de(e,0),0)}function al(e,t){let n=e.camera??[];if(n.length===0)return null;let r;for(let l of n)l.t<=t&&(r=l);let i=n.find(l=>l.t>t);if(!r)return go(n[0]);if(!i)return go(r);let o=Fr(r.ease??"easeInOut",(t-r.t)/Math.max(i.t-r.t,1e-9)),s=(l,a)=>l+(a-l)*o;return{x:s(r.x,i.x),y:s(r.y,i.y),width:Math.max(1,s(r.width,i.width)),height:Math.max(1,s(r.height,i.height))}}var go=e=>({x:e.x,y:e.y,width:e.width,height:e.height});function pe(e,t){let n=e.camera?.[0],r=al(e,t);return!n||!r||!(r.width>0&&r.height>0)?null:ul(r,n.width/n.height)}function ul(e,t){if(!(e.width>0&&e.height>0&&t>0))return e;let n=e.width,r=e.height;return e.width/e.height<t?n=e.height*t:r=e.width/t,{x:e.x+e.width/2-n/2,y:e.y+e.height/2-r/2,width:n,height:r}}function cl(e){return Math.max(1,Math.ceil(dt(e.duration)*ue(e.fps)))}function ge(e){let t=ue(e.fps),n=[];for(let i=0;i<cl(e);i++)n.push(i/t);let r=n[n.length-1];return e.duration-r>1e-6&&n.push(e.duration),n}function bo(e,t){let n=-1;return(e.markers??[]).forEach((r,i)=>{r.t<=t&&(n=i)}),n}function xo(e){let t=e.timeline;if(!t)return new Set;let n=t.poster??t.duration;return new Set(t.tracks.filter(r=>!Ir(r,0)&&!Ir(r,n)).map(r=>r.element))}var hl=8,fl=2e4,Lr=1e-9;function xn(e,t){let n=(e.timeline?.markers??[]).find(r=>r.name.toLowerCase()===t);return n?Math.min(Math.max(n.t,0),dt(e.timeline?.duration??0)):null}function We(e,t){switch(t){case"up":return xn(e,"up")??0;case"over":return xn(e,"over")??We(e,"up");case"down":return xn(e,"down")??We(e,"over");default:return xn(e,"hit")}}function ml(e,t,n,r){let i=dt(e.timeline?.duration??0);if(e.button===!0)return We(e,"up")??0;let o=r!==null&&Number.isFinite(r)?r:0;switch(n??"loop"){case"still":return Math.min(e.timeline?.poster??i,i);case"click":return Math.min(Math.max(o,0),i);case"once":return Math.min(Math.max(t+o,0),i);default:{if(i<=0)return 0;let s=t+o,l=s%i;return l<0&&(l+=i),s>Lr&&(l<Lr||i-l<Lr)?i:l}}}function dl(e,t){let n=e.params;if(!n||Object.keys(n).length===0)return e;let r=new Map(Object.entries(n));for(let[o,s]of Object.entries(t??{}))r.has(o)&&r.set(o,s);let i=o=>o.includes("{{")?o.replace(/\{\{\s*([^{}]*?)\s*\}\}/g,(s,l)=>r.get(l)??s):o;return{...e,elements:e.elements.map(o=>{if(o.text===null&&o.args===null)return o;let s=mt(o);return s.text!==null&&(s.text=i(s.text)),s.args!==null&&(s.args=Object.fromEntries(Object.entries(s.args).map(([l,a])=>[l,i(a)]))),s})}}function pl(e){return{id:e.id,name:e.name,layers:e.layers,elements:e.elements,theme:null,timeline:e.timeline,symbols:null,variables:null,flows:null}}function wn(e){return e.elements.some(t=>t.kind==="symbol")}var kn=class{constructor(t,n,r){T(this,"page");T(this,"t");T(this,"posing");T(this,"made",new Map);this.page=t,this.t=n,this.posing=r}};function St(e,t,n=!0,r=new Map,i){if(!wn(e))return e;let o={left:fl},s=i&&i.page===e&&i.t===t&&i.posing===n?i:void 0;return{...e,elements:wo(e.elements,e,t,Vr(e),[],n,o,r,s)}}function Vr(e){let t=new Map;for(let n of e.symbols??[])t.has(n.id)||t.set(n.id,n);return t}function wo(e,t,n,r,i,o,s,l=new Map,a){let c=new Set(e.filter(f=>f.kind==="symbol").map(f=>f.id));if(c.size===0)return s.left-=e.length,e;let u=Mt(t),h=[];for(let f of e){if(s.left<=0)break;let m=f.connector;if(f.kind==="connector"&&m&&[m.start.elementID,m.end.elementID].some(A=>A!==null&&c.has(A))){let[A,L]=Vt(f,u),W=mt(f);m.start.elementID!==null&&c.has(m.start.elementID)&&(W.connector.start={elementID:null,port:m.start.port,x:A.x,y:A.y}),m.end.elementID!==null&&c.has(m.end.elementID)&&(W.connector.end={elementID:null,port:m.end.port,x:L.x,y:L.y}),h.push(W),s.left-=1;continue}if(f.kind!=="symbol"){h.push(f),s.left-=1;continue}let p=i.length===0?l.get(f.id):void 0,k=a?.made.get(f);if(k&&k.override===p&&k.after>0&&s.left-(k.before-k.after)>0){s.left-=k.before-k.after;for(let A of k.out)h.push(A);continue}let y=s.left,M=h.length;s.left-=1;let E=f.symbol,b=E===null?void 0:r.get(E);if(E===null||!b||i.includes(E)||i.length>=hl)continue;let R=i.length===0?l.get(f.id):void 0,x=R!==void 0?Math.min(Math.max(R,0),dt(b.timeline?.duration??0)):ml(b,n,f.playback,f.offset),w=pl(dl(b,f.args)),d=o?de(w,x):w,g=new Set(d.layers.filter(A=>A.visible).map(A=>A.id)),P={...d,elements:Dt(d).filter(A=>g.has(A.layerID)),layers:[{id:f.layerID,name:"",visible:!0,locked:!1}]};for(let A of wo(P.elements,P,x,r,[...i,E],o,s))h.push(gl(A,f,b));a&&i.length===0&&!k&&a.made.set(f,{override:p,before:y,after:s.left,out:h.slice(M)})}return h}function gl(e,t,n){let r={x:t.x,y:t.y,width:t.width,height:t.height},i=r.width/n.width,o=r.height/n.height,s=Math.sqrt(Math.abs(i*o)),l={x:r.x+r.width/2,y:r.y+r.height/2},a=wt(t),c=m=>Ut({x:r.x+m.x*i,y:r.y+m.y*o},l,a),u=mt(e);u.id=Dr(t.id,e.id),u.layerID=t.layerID,u.groupID=null,u.link=e.link===null?null:Dr(t.id,e.link),u.seed=ln(e.seed,t.seed),u.click=null,u.hover=null;let h={x:r.x+e.x*i,y:r.y+e.y*o,width:e.width*i,height:e.height*o},f=Ut({x:h.x+h.width/2,y:h.y+h.height/2},l,a);if(u.x=f.x-h.width/2,u.y=f.y-h.height/2,u.width=h.width,u.height=h.height,(a!==0||e.rotation!==null)&&(u.rotation=wt(e)+a),u.style.strokeWidth=e.style.strokeWidth*s,u.style.fontSize=e.style.fontSize*s,e.style.gridSize!==null&&(u.style.gridSize=e.style.gridSize*s),t.style.opacity!==null&&(u.style.opacity=(e.style.opacity??1)*t.style.opacity),e.connector){let m=p=>{if(p.elementID!==null)return{elementID:Dr(t.id,p.elementID),port:p.port,x:p.x,y:p.y};let k=c(p);return{elementID:null,port:p.port,x:k.x,y:k.y}};u.connector={...e.connector,start:m(e.connector.start),end:m(e.connector.end),waypoints:e.connector.waypoints?.map(c)??null}}return u}var Or=(1n<<64n)-1n;function Ve(e){let t=e+0x9e3779b97f4a7c15n⩔return t=(t^t>>30n)*0xbf58476d1ce4e5b9n&Or,t=(t^t>>27n)*0x94d049bb133111ebn&Or,t^t>>31n}function ko(e){let t=e.replace(/-/g,"").padStart(32,"0").slice(-32);return[BigInt(`0x${t.slice(0,16)}`),BigInt(`0x${t.slice(16)}`)]}function Dr(e,t){let[n,r]=ko(e),[i,o]=ko(t),s=Ve(Ve(Ve(Ve(n)^r)^i)^o),l=Ve(s^0x6a09e667f3bcc909n),a=s.toString(16).padStart(16,"0")+l.toString(16).padStart(16,"0");return`${a.slice(0,8)}-${a.slice(8,12)}-${a.slice(12,16)}-${a.slice(16,20)}-${a.slice(20)}`.toUpperCase()}function yl(e,t){let n=t.findIndex(r=>r.name===e);return n>=0?n:t.findIndex(r=>r.name.toLowerCase()===e.toLowerCase())}function Mo(e,t){let n=e.timeline?.markers??[],r=new Map,i=null;for(let o of e.elements){let s=o.click,l=s&&oi(s)?{...s.set?{set:s.set}:{},...s.toggle?{toggle:s.toggle}:{},...s.reset?{reset:!0}:{},...s.run?{run:s.run}:{}}:null;if(s?.scene){let c=yl(s.scene,n);if(c>=0){r.set(o.id,{scene:c,...l});continue}}let a=(s?.url?qt(s.url):null)??ve(o.url);if(a){r.set(o.id,{url:a,...l});continue}if(l){r.set(o.id,{state:!0,...l});continue}if(o.link&&t&&t.pages.length>1){i||(i=new Map,t.pages.forEach((u,h)=>{for(let f of u.elements)i.has(f.id)||i.set(f.id,h)}));let c=i.get(o.link);c!==void 0&&t.pages[c]!==e&&r.set(o.id,{page:c})}}return r}function bl(e){let t=e.hover;if(!t)return e;let n={...e.style};if(t.stroke&&(n.stroke=t.stroke),t.fill&&(n.fill=t.fill),t.opacity!==null&&Number.isFinite(t.opacity)){let r=Math.min(Math.max(t.opacity,0),1);n.opacity=r>=1?null:r}return{...e,style:n}}function Po(e,t){return{...e,elements:e.elements.map(n=>t.has(n.id)?bl(n):n)}}function vo(e){return!!e.hover&&(e.hover.stroke!==null||e.hover.fill!==null||e.hover.opacity!==null)}function Eo(e,t){let n=(e.text??"").split(`
|
|
6
|
-
`).find(r=>r.length>0);return n||(e.anchor?e.anchor:t||e.kind)}function Ro(e,t){let n=new Map;for(let r of e.elements){if(!t.has(r.id)||r.kind!=="symbol")continue;let i={...e,layers:[{id:r.layerID,name:"",visible:!0,locked:!1}],elements:[r]};for(let o of
|
|
1
|
+
/*! dottie.js 0.11.1 | Apache-2.0 | https://github.com/phin-tech/dottie */
|
|
2
|
+
(function dottiePlayerScript(){"use strict";(()=>{var _r=Object.defineProperty;var Zo=(e,t,n)=>t in e?_r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xo=(e,t)=>{for(var n in t)_r(e,n,{get:t[n],enumerable:!0})};var R=(e,t,n)=>Zo(e,typeof t!="symbol"?t+"":t,n);var Jr={};Xo(Jr,{BOIL_DRAWINGS:()=>jn,BUNDLED_FONTS:()=>Se,DottieFormatError:()=>Ot,DottiePlayer:()=>be,KINDS:()=>ci,KNOWN_FIELDS:()=>hi,MAX_DURATION:()=>le,MAX_MARCH:()=>Bn,Playback:()=>$e,SUPPORTED_VERSION:()=>zn,VERSION:()=>Hl,addFonts:()=>en,allowedURL:()=>qt,black:()=>_t,bounds:()=>Gt,cameraView:()=>pe,clampFPS:()=>ue,clampMarch:()=>fi,clampTime:()=>dt,clear:()=>mi,cloneElement:()=>mt,definePlayer:()=>Cn,elementIndex:()=>is,fontFaces:()=>Jn,fontFile:()=>Hn,frameTimes:()=>ge,inkOnDark:()=>di,inspect:()=>jo,inspectFrame:()=>Kr,inspectPage:()=>Hr,isAutomaticInk:()=>Re,luminance:()=>ce,orderedElements:()=>Dt,pageIndex:()=>ze,pageTheme:()=>zt,paletteColor:()=>Me,parseDottie:()=>Ee,plan:()=>Kt,posterTime:()=>Xt,render:()=>Xl,repeatIsValid:()=>_e,resolved:()=>Ct,sameColor:()=>ae,sampleTimes:()=>Xr,sceneAt:()=>bo,setFontBase:()=>wi,stableSortBy:()=>Je,still:()=>yo,svg:()=>An,svgParts:()=>Ht,themeNamed:()=>$n,themes:()=>Gn,transientElements:()=>xo,usedFonts:()=>tn,webLink:()=>ve,withRoughness:()=>Be});var Ko=["throughput","load","delay","backlog","depth","inFlight","transit","backup"],qr={min:null,max:null,abs:1,floor:1,ceil:1,round:1,clamp:3},Ho=64,$t=e=>typeof e=="boolean"?e:e!==0&&!Number.isNaN(e),Ze=e=>typeof e=="boolean"?e?1:0:e,Xe=new Map;function we(e){let t=Xe.get(e);if(t!==void 0)return t;let n=new On(e),r=n.or();return r&&!n.atEnd()&&(r=null),Xe.size>4096&&Xe.clear(),Xe.set(e,r),r}function bt(e,t,n=null){switch(e.k){case"lit":return e.v;case"name":return t[e.name]??!1;case"metric":return n?.(e.metric,e.target)??NaN;case"not":return!$t(bt(e.e,t,n));case"neg":return-Ze(bt(e.e,t,n));case"call":{let r=e.args.map(o=>Ze(bt(o,t,n))),i=o=>{if(r.some(Number.isNaN))return NaN;let s=r[0];for(let l of r.slice(1))o(l,s)&&(s=l);return s};switch(e.fn){case"min":return i((o,s)=>o<s);case"max":return i((o,s)=>o>s);case"abs":return Math.abs(r[0]);case"floor":return Math.floor(r[0]);case"ceil":return Math.ceil(r[0]);case"round":return Math.floor(r[0]+.5);default:return r.some(Number.isNaN)?NaN:r[0]<r[1]?r[1]:r[0]>r[2]?r[2]:r[0]}}case"bin":{if(e.op==="&&")return $t(bt(e.l,t,n))&&$t(bt(e.r,t,n));if(e.op==="||")return $t(bt(e.l,t,n))||$t(bt(e.r,t,n));let r=bt(e.l,t,n),i=bt(e.r,t,n),o=Ze(r),s=Ze(i);switch(e.op){case"+":return o+s;case"-":return o-s;case"*":return o*s;case"/":return o/s;case"%":return o%s}if(Number.isNaN(o)||Number.isNaN(s))return!1;switch(e.op){case"<":return o<s;case"<=":return o<=s;case">":return o>s;case">=":return o>=s;case"==":return typeof r=="boolean"&&typeof i=="boolean"?r===i:o===s;default:return typeof r=="boolean"&&typeof i=="boolean"?r!==i:o!==s}}}}function ti(e){let t=[],n=r=>{switch(r.k){case"name":t.includes(r.name)||t.push(r.name);break;case"not":case"neg":n(r.e);break;case"bin":n(r.l),n(r.r);break;case"call":r.args.forEach(n);break}};return n(e),t}function Dn(e){let t=[],n=r=>{switch(r.k){case"metric":t.push({metric:r.metric,target:r.target});break;case"not":case"neg":n(r.e);break;case"bin":n(r.l),n(r.r);break;case"call":r.args.forEach(n);break}};return n(e),t}var ke=e=>e!==void 0&&e>="0"&&e<="9",Qr=e=>e!==void 0&&(e==="_"||e>="a"&&e<="z"||e>="A"&&e<="Z"),On=class{constructor(t){R(this,"s");R(this,"i",0);this.s=[...t]}atEnd(){return this.skip(),this.i===this.s.length}skip(){for(;this.i<this.s.length&&`
|
|
3
|
+
\r`.includes(this.s[this.i]);)this.i++}eat(t){this.skip();let n=[...t];if(this.i+n.length>this.s.length)return!1;for(let r=0;r<n.length;r++)if(this.s[this.i+r]!==n[r])return!1;return n.length===1&&this.s[this.i+1]==="="&&"<>!=".includes(n[0])?!1:(this.i+=n.length,!0)}or(){let t=this.and();if(!t)return null;for(;this.eat("||");){let n=this.and();if(!n)return null;t={k:"bin",op:"||",l:t,r:n}}return t}and(){let t=this.compare();if(!t)return null;for(;this.eat("&&");){let n=this.compare();if(!n)return null;t={k:"bin",op:"&&",l:t,r:n}}return t}compare(){let t=this.sum();if(!t)return null;for(let n of["<=",">=","==","!=","<",">"])if(this.eat(n)){let r=this.sum();return r?{k:"bin",op:n,l:t,r}:null}return t}sum(){let t=this.product();if(!t)return null;for(;;){let n=this.eat("+")?"+":this.eat("-")?"-":null;if(!n)return t;let r=this.product();if(!r)return null;t={k:"bin",op:n,l:t,r}}}product(){let t=this.unary();if(!t)return null;for(;;){let n=["*","/","%"].find(i=>this.eat(i));if(!n)return t;let r=this.unary();if(!r)return null;t={k:"bin",op:n,l:t,r}}}unary(){if(this.eat("!")){let t=this.unary();return t?{k:"not",e:t}:null}if(this.eat("-")){let t=this.unary();return t?{k:"neg",e:t}:null}return this.primary()}primary(){if(this.skip(),this.i>=this.s.length)return null;if(this.eat("(")){let l=this.or();return l&&this.eat(")")?l:null}let t=this.s,n=t[this.i];if(ke(n)){let l=this.i;for(;ke(t[this.i]);)this.i++;if(t[this.i]==="."&&ke(t[this.i+1]))for(this.i++;ke(t[this.i]);)this.i++;return{k:"lit",v:Number(t.slice(l,this.i).join(""))}}if(!Qr(n))return null;let r=this.i;for(;Qr(t[this.i])||ke(t[this.i]);)this.i++;let i=t.slice(r,this.i).join("");if(i.length>Ho)return null;let o=this.i;for(;t[o]===" "||t[o]===" ";)o++;let s=t[o]==="(";if(Ko.includes(i)){if(!s)return{k:"metric",metric:i,target:""};this.eat("(");let l=this.i;for(;this.i<t.length&&t[this.i]!==")"&&t[this.i]!=="(";)this.i++;if(t[this.i]!==")")return null;let a=t.slice(l,this.i).join("").replace(/^[ \t]+|[ \t]+$/g,"");return this.i++,{k:"metric",metric:i,target:a}}if(i in qr){if(!s||!this.eat("("))return null;let l=[];if(!this.eat(")")){do{let c=this.or();if(!c)return null;l.push(c)}while(this.eat(","));if(!this.eat(")"))return null}let a=qr[i];return(a!==null?l.length!==a:l.length===0)?null:{k:"call",fn:i,args:l}}return s?null:i==="true"?{k:"lit",v:!0}:i==="false"?{k:"lit",v:!1}:{k:"name",name:i}}};function Jo(e){return typeof e=="boolean"?e?"true":"false":_o(e)}function _o(e){let t=Math.floor(Math.abs(e)*100+.5);if(!(t<1e15))return e<0?"-\u221E":"\u221E";let n=Math.floor(t/100),r=t-n*100,i=String(n);return r>0&&(i+="."+String(r).padStart(2,"0").replace(/0+$/,"")),(e<0&&t>0?"-":"")+i}function ei(e,t){if(!e.includes("{"))return e;let n="",r=e;for(let i=r.indexOf("{");i>=0;i=r.indexOf("{")){n+=r.slice(0,i);let o=r.indexOf("}",i);if(o<0){n+=r.slice(i),r="";break}let s=r.slice(i+1,o),l=s.includes("{")?null:we(s),a=l?ti(l):[];l&&Dn(l).length===0&&a.length>0&&a.every(c=>t[c]!==void 0)?n+=Jo(bt(l,t)):n+=r.slice(i,o+1),r=r.slice(o+1)}return n+r}var qo=64;function Ke(e){return e.length<=qo&&/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)}function oe(e){let t=we(e);return t!==null&&Dn(t).length>0}function se(e,t,n=null){let r=we(e);return r?$t(bt(r,t,n?(i,o)=>n({metric:i,target:o,op:"",value:0}):null)):!1}function Vn(e,t){return t==="all"?null:t==="initial"?{...e.variables??{}}:{...e.variables??{},...t}}function ni(e,t){let n=Vn(e,t),r=new Set;if(!n)return r;for(let i of e.elements)i.when!==null&&!se(i.when,n)&&r.add(i.id);return r}function ri(e,t){return!t||!e.overrides?[]:e.overrides.filter(n=>!oe(n.when)&&se(n.when,t))}function ii(e){return{...e,reroute:null,offline:null,cost:null,capacity:null,delay:null}}function He(e,t){let n=mt(t);if(e.stroke&&(n.style.stroke={...e.stroke}),e.fill&&(n.style.fill={...e.fill}),e.textColor&&(n.style.textColor={...e.textColor}),e.strokeWidth!==null&&(n.style.strokeWidth=Math.max(0,e.strokeWidth)),e.dash!==null&&(n.style.dash=e.dash),e.text!==null&&(n.text=e.text),e.cost!==null&&n.connector&&(n.connector.cost=Math.min(Math.max(e.cost,0),1e6)),e.capacity!==null&&(n.capacity=Math.max(e.capacity,0)),e.delay!==null&&n.kind!=="connector"&&(n.delay=Math.max(e.delay,0)),e.opacity!==null){let r=Math.min(Math.max(e.opacity,0),1)*(n.style.opacity??1);n.style.opacity=r>=1?null:r}return n}function oi(e){return!!e&&(e.reset===!0||Object.keys(e.set??{}).length>0||(e.toggle??[]).length>0||!!e.run)}function si(e,t,n={}){let r={...t};if(e.reset===!0){r={};for(let o of Object.keys(t))r[o]=!1;Object.assign(r,n)}let i={...r};for(let[o,s]of Object.entries(e.set??{}))r[o]=Qo(s,i,i[o]);for(let o of e.toggle??[])r[o]=!$t(r[o]??!1);return r}function Qo(e,t,n){if(typeof e!="string")return e;let r=we(e);return r?bt(r,t):n??!1}var Pt=(e,t,n)=>({r:e,g:t,b:n,a:1});function ts(e){let t=parseInt(e.slice(1),16);return{r:(t>>16&255)/255,g:(t>>8&255)/255,b:(t&255)/255,a:1}}var es=["accent","muted","danger","warning","success","info"],Yn=e=>es.map((t,n)=>({name:t,color:ts(e[n])})),Nn=Yn(["#2563eb","#6b7280","#dc2626","#d97706","#16a34a","#0891b2"]),Wn=Yn(["#93c5fd","#cbd5e1","#fca5a5","#fcd34d","#86efac","#67e8f9"]),Gn=[{id:"paper",name:"Paper",background:Pt(.984,.98,.965),ink:Pt(.12,.12,.13),palette:Nn},{id:"white",name:"White",background:Pt(1,1,1),ink:Pt(.12,.12,.13),palette:Nn},{id:"sepia",name:"Sepia",background:Pt(.953,.914,.824),ink:Pt(.23,.18,.13),palette:Yn(["#9a3412","#78716c","#b91c1c","#b45309","#4d7c0f","#0e7490"])},{id:"blueprint",name:"Blueprint",background:Pt(.106,.227,.361),ink:Pt(.91,.945,.984),palette:Wn},{id:"chalkboard",name:"Chalkboard",background:Pt(.169,.227,.2),ink:Pt(.945,.945,.918),palette:Wn},{id:"midnight",name:"Midnight",background:Pt(.082,.086,.102),ink:Pt(.925,.925,.94),palette:Wn}];function $n(e){return Gn.find(t=>t.id===e)??null}function zt(e){let t=e.customTheme;return t?{id:"custom",name:t.name,background:t.background,ink:t.ink,palette:t.palette}:$n(e.theme)}function Me(e,t){let n=t.trim().toLowerCase();return(zt(e)?.palette??Nn).find(r=>r.name.toLowerCase()===n)?.color??null}function li(e){let t=r=>!!r.style.named;if(!e.elements.some(t)&&!(e.symbols??[]).some(r=>r.elements.some(t)))return e;let n=r=>{let i=r.style.named;if(!i)return r;let o={...r.style},s=i.fill!==null?Me(e,i.fill):null,l=i.stroke!==null?Me(e,i.stroke):null,a=i.textColor!==null?Me(e,i.textColor):null;return s&&(o.fill={...s}),l&&(o.stroke={...l}),a&&(o.textColor={...a}),{...r,style:o}};return{...e,elements:e.elements.map(n),symbols:e.symbols?e.symbols.map(r=>({...r,elements:r.elements.map(n)})):e.symbols}}var zn=3,ci=["rectangle","ellipse","diamond","text","connector","freehand","path","note","image","symbol"],ns=["linear","easeIn","easeOut","easeInOut","hold","spring","bounce","elastic"],hi={file:["version","pages","images"],page:["id","name","layers","elements","theme","customTheme","logic","guidesX","guidesY","guidesLocked","timeline","symbols","variables","flows"],flow:["id","from","to","every","speed","color","size","when","spread","volume","overrides"],flowOverride:["when","volume"],symbol:["id","name","width","height","layers","elements","timeline","button","params"],layer:["id","name","visible","locked"],rgba:["r","g","b","a"],style:["stroke","fill","fillStyle","strokeWidth","dash","roughness","bowing","fontSize","font","gridSize","opacity","dashOffset","textColor","named"],colorNames:["fill","stroke","textColor"],customTheme:["name","background","ink","palette","base"],paletteColor:["name","color"],element:["id","kind","x","y","width","height","style","seed","layerID","text","connector","groupID","points","path","subpaths","evenOdd","rotation","link","url","anchor","click","hover","when","overrides","symbol","playback","offset","args","image","reveal","ports","labelRect","extension","capacity","delay","queue","gauge","containerID","container"],container:["fixed","lanes"],gauge:["metric","of","max","warn","alarm","style","label"],strokePoint:["x","y"],subpath:["closed","coords"],inlineImage:["data","format"],endpoint:["elementID","port","portIndex","x","y"],extensionRef:["id","shape","version","params"],normalizedPoint:["x","y"],normalizedRect:["x","y","width","height"],connector:["start","end","routing","startHead","endHead","waypoints","hops","avoid","cost"],waypoint:["x","y"],timeline:["fps","duration","boil","settle","poster","tracks","camera","markers"],track:["element","keys","boil","follow","repeats","march"],keyframe:["t","x","y","width","height","rotation","strokeWidth","stroke","fill","visible","reveal","opacity","ease"],follow:["path","start","end","ease","reverse","orient","laps"],repeat:["start","end","count"],cameraKey:["t","x","y","width","height","ease"],marker:["t","name","loop"],click:["scene","url","set","toggle","reset","run"],hover:["stroke","fill","opacity"],override:["when","stroke","fill","textColor","opacity","strokeWidth","dash","text","reroute","offline","cost","capacity","delay"]},le=3600,Bn=1e4,fi=e=>e===void 0||!Number.isFinite(e)||e===0?null:Math.min(Math.max(e,-Bn),Bn),jn=3,_t={r:.12,g:.12,b:.13,a:1},mi={r:0,g:0,b:0,a:0},di={r:.93,g:.93,b:.94,a:1},Ot=class extends Error{},G=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),C=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Y=e=>typeof e=="string"?e:void 0,ai=e=>G(e)&&Object.values(e).every(t=>typeof t=="string")?{...e}:null,xt=e=>typeof e=="boolean"?e:void 0,ui="00000000-0000-0000-0000-000000000000",Pe=/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/,kt=e=>typeof e=="string"?e.toUpperCase():void 0;function dt(e){return Number.isFinite(e)?Math.min(Math.max(e,0),le):e===1/0?le:0}function ue(e){return Number.isFinite(e)?Math.min(Math.max(e,1),60):12}function qt(e){let t=e.trim();return!/^(https?:\/\/|mailto:)/i.test(t)||[...t].length<=7||/[\u0000-\u001f\u007f-\u009f]/.test(t)?null:t}function ve(e){return e?qt(e):null}function yt(e){if(!G(e))return;let t=C(e.r),n=C(e.g),r=C(e.b);if(!(t===void 0||n===void 0||r===void 0))return{r:t,g:n,b:r,a:C(e.a)??1}}var Un=class{constructor(){R(this,"warnings",[]);R(this,"seen",new Set)}warn(t){this.seen.has(t)||(this.seen.add(t),this.warnings.push(t))}fields(t,n){let r=hi[n];for(let i of Object.keys(t))r.includes(i)||this.warn(`Unknown field "${i}" on ${n}, ignored`)}style(t){let n=G(t)?t:{};this.fields(n,"style");let r=Y(n.fillStyle)??"solid",i=Y(n.dash)??"solid";return["solid","hachure","crossHatch","grid"].includes(r)||this.warn(`Unknown fill style "${r}", drawn solid`),["solid","dashed","dotted"].includes(i)||this.warn(`Unknown dash "${i}", drawn solid`),{stroke:yt(n.stroke)??{..._t},fill:yt(n.fill)??{...mi},fillStyle:["solid","hachure","crossHatch","grid"].includes(r)?r:"solid",strokeWidth:C(n.strokeWidth)??2,dash:["solid","dashed","dotted"].includes(i)?i:"solid",roughness:C(n.roughness)??1,bowing:C(n.bowing)??1,fontSize:C(n.fontSize)??18,font:Y(n.font)||null,gridSize:C(n.gridSize)??null,opacity:C(n.opacity)??null,dashOffset:C(n.dashOffset)??null,textColor:yt(n.textColor)??null,named:this.colorNames(n.named)}}container(t){return G(t)?(this.fields(t,"container"),{fixed:t.fixed===!0?!0:null,lanes:t.lanes==="rows"||t.lanes==="columns"?t.lanes:null}):null}colorNames(t){if(!G(t))return null;this.fields(t,"colorNames");let n={fill:Y(t.fill)??null,stroke:Y(t.stroke)??null,textColor:Y(t.textColor)??null};return n.fill===null&&n.stroke===null&&n.textColor===null?null:n}customTheme(t){if(!G(t))return null;this.fields(t,"customTheme");let n=yt(t.background),r=yt(t.ink);if(!n||!r)return this.warn("A custom theme needs a background and an ink; drawn without it"),null;let i=(Array.isArray(t.palette)?t.palette:[]).filter(G).flatMap(o=>{this.fields(o,"paletteColor");let s=Y(o.name),l=yt(o.color);return s&&l?[{name:s,color:l}]:[]});return{name:Y(t.name)??"Custom",background:n,ink:r,palette:i,base:Y(t.base)??null}}endpoint(t){let n=G(t)?t:{},r=Y(n.port),i=C(n.portIndex);return{elementID:kt(n.elementID)??null,port:r&&["top","right","bottom","left"].includes(r)?r:null,portIndex:i!==void 0&&Number.isInteger(i)&&i>=0?i:null,x:C(n.x)??0,y:C(n.y)??0}}connector(t){if(!G(t))return null;this.fields(t,"connector");let n=(i,o)=>{let s=Y(i);return s&&["none","arrow","triangle","dot","bar"].includes(s)?s:o},r=Y(t.routing);return{start:this.endpoint(t.start),end:this.endpoint(t.end),routing:r&&["straight","curved","elbow"].includes(r)?r:"straight",startHead:n(t.startHead,"none"),endHead:n(t.endHead,"arrow"),waypoints:Array.isArray(t.waypoints)?t.waypoints.filter(G).map(i=>(this.fields(i,"waypoint"),{x:C(i.x)??0,y:C(i.y)??0})):null,hops:typeof t.hops=="boolean"?t.hops:null,avoid:typeof t.avoid=="boolean"?t.avoid:null,cost:typeof t.cost=="number"&&Number.isFinite(t.cost)?t.cost:null}}image(t,n){if(!G(t))return null;let r=Y(t.ref);if(r!==void 0)return n[r]??{data:"",format:"png"};let i=Y(t.data);return i===void 0?null:this.picture(i,Y(t.format))}picture(t,n){return rs.test(t)?{data:t.replace(/\s+/g,""),format:n==="jpeg"?"jpeg":"png"}:(this.warn("Skipped a picture whose data isn't base64"),{data:"",format:"png"})}element(t,n){if(!G(t))return null;this.fields(t,"element");let r=kt(t.id),i=Y(t.kind),o=kt(t.layerID);if(!r||!i||!o)return this.warn("Skipped an element without an id, kind or layer"),null;ci.includes(i)||this.warn(`Unknown element kind "${i}", drawn as a placeholder`);let s=Array.isArray(t.subpaths)?t.subpaths.filter(G).map(l=>({closed:xt(l.closed)??!1,coords:Array.isArray(l.coords)?l.coords.filter(a=>typeof a=="number"):[]})):null;return{id:r,kind:i,layerID:o,x:C(t.x)??0,y:C(t.y)??0,width:C(t.width)??0,height:C(t.height)??0,style:this.style(t.style),seed:(C(t.seed)??1)>>>0,text:Y(t.text)??null,connector:this.connector(t.connector),groupID:kt(t.groupID)??null,points:Array.isArray(t.points)?t.points.filter(G).map(l=>({x:C(l.x)??0,y:C(l.y)??0})):null,path:Array.isArray(t.path)?t.path.filter(l=>typeof l=="number"):null,subpaths:s,evenOdd:xt(t.evenOdd)??null,rotation:C(t.rotation)??null,link:kt(t.link)??null,url:Y(t.url)??null,anchor:Y(t.anchor)??null,click:this.click(t.click),hover:this.hover(t.hover),when:Y(t.when)??null,overrides:this.overrides(t.overrides),symbol:kt(t.symbol)??null,playback:this.playback(t.playback),offset:C(t.offset)??null,args:ai(t.args),image:this.image(t.image,n),reveal:C(t.reveal)??null,ports:Array.isArray(t.ports)?t.ports.map(l=>{let a=G(l)?l:{};return{x:C(a.x)??0,y:C(a.y)??0}}):null,labelRect:this.labelRect(t.labelRect),extension:this.extension(t.extension),capacity:C(t.capacity)??null,delay:C(t.delay)??null,queue:t.queue===!0?!0:null,gauge:this.gauge(t.gauge),containerID:kt(t.containerID)??null,container:this.container(t.container)}}gauge(t){if(!G(t))return null;this.fields(t,"gauge");let n=i=>typeof i=="number"&&Number.isFinite(i)?i:null,r=Y(t.style);return{metric:Y(t.metric)??"",of:typeof t.of=="string"&&Pe.test(t.of)?t.of.toUpperCase():ui,max:n(t.max),warn:n(t.warn),alarm:n(t.alarm),style:r==="number"||r==="bar"||r==="dial"?r:null,label:Y(t.label)??null}}labelRect(t){return G(t)?(this.fields(t,"normalizedRect"),{x:C(t.x)??0,y:C(t.y)??0,width:C(t.width)??0,height:C(t.height)??0}):null}extension(t){if(!G(t))return null;this.fields(t,"extensionRef");let n=Y(t.id),r=Y(t.shape),i=Y(t.version);if(n===void 0||r===void 0||i===void 0)return this.warn("Skipped an extension without an id, shape or version"),null;let o={};if(G(t.params))for(let[s,l]of Object.entries(t.params))(typeof l=="number"||typeof l=="boolean"||typeof l=="string")&&(o[s]=l);return{id:n,shape:r,version:i,params:o}}variables(t){if(!G(t))return null;let n={};for(let[r,i]of Object.entries(t))(typeof i=="boolean"||typeof i=="number"&&Number.isFinite(i))&&(n[r]=i);return Object.keys(n).length>0?n:null}click(t){if(!G(t))return null;this.fields(t,"click");let n=Y(t.url),r=n===void 0?null:qt(n);n!==void 0&&r===null&&this.warn("Skipped a click link that isn't http, https or mailto");let i=null;if(G(t.set)){i={};for(let[a,c]of Object.entries(t.set))Ke(a)&&(typeof c=="boolean"||typeof c=="string"||typeof c=="number"&&Number.isFinite(c))&&(i[a]=c);Object.keys(i).length===0&&(i=null)}let o=typeof t.toggle=="string"?[t.toggle]:Array.isArray(t.toggle)&&t.toggle.every(a=>typeof a=="string")?t.toggle:null,s=o?o.filter(Ke):null,l=Y(t.run);return{scene:Y(t.scene)??null,url:r,set:i,toggle:s&&s.length>0?s:null,reset:t.reset===!0?!0:null,run:l!==void 0&&Ke(l)?l:null}}playback(t){let n=Y(t);return n===void 0?null:["loop","once","still","click"].includes(n)?n:"loop"}symbol(t,n){if(!G(t))return null;this.fields(t,"symbol");let r=kt(t.id);if(!r)return this.warn("Skipped a symbol without an id"),null;let i=s=>{let l=C(s);return Math.max(1,l??100)},o=(Array.isArray(t.layers)?t.layers:[]).filter(G).flatMap(s=>{let l=kt(s.id);return l?[{id:l,name:Y(s.name)??"",visible:xt(s.visible)??!0,locked:xt(s.locked)??!1}]:[]});return o.length===0&&o.push({id:`${r}-LAYER`,name:"Layer 1",visible:!0,locked:!1}),{id:r,name:Y(t.name)??"Symbol",width:i(t.width),height:i(t.height),layers:o,elements:(Array.isArray(t.elements)?t.elements:[]).map(s=>this.element(s,n)).filter(s=>s!==null),timeline:this.timeline(t.timeline),button:xt(t.button)??null,params:ai(t.params)}}overrides(t){return Array.isArray(t)?t.filter(G).map(n=>{this.fields(n,"override");let r=Y(n.dash),i=null;if(G(n.reroute)&&Object.values(n.reroute).every(o=>typeof o=="string"&&Pe.test(o))){i={};for(let[o,s]of Object.entries(n.reroute))Pe.test(o)&&(i[o.toUpperCase()]=s.toUpperCase());Object.keys(i).length===0&&(i=null)}return{when:Y(n.when)??"",stroke:yt(n.stroke)??null,fill:yt(n.fill)??null,textColor:yt(n.textColor)??null,opacity:C(n.opacity)??null,strokeWidth:C(n.strokeWidth)??null,dash:r!==void 0&&["solid","dashed","dotted"].includes(r)?r:null,text:Y(n.text)??null,reroute:i,offline:n.offline===!0?!0:null,cost:typeof n.cost=="number"&&Number.isFinite(n.cost)?n.cost:null,capacity:typeof n.capacity=="number"&&Number.isFinite(n.capacity)?n.capacity:null,delay:typeof n.delay=="number"&&Number.isFinite(n.delay)?n.delay:null}}):null}hover(t){return G(t)?(this.fields(t,"hover"),{stroke:yt(t.stroke)??null,fill:yt(t.fill)??null,opacity:C(t.opacity)??null}):null}ease(t){let n=Y(t);return n===void 0?null:ns.includes(n)?n:(this.warn(`Unknown ease "${n}", played linear`),null)}keyframe(t){if(!G(t))return null;this.fields(t,"keyframe");let n=C(t.t);if(n===void 0)return null;let r={t:n};for(let a of["x","y","width","height","rotation","strokeWidth","reveal","opacity"]){let c=C(t[a]);c!==void 0&&(r[a]=c)}let i=yt(t.stroke),o=yt(t.fill),s=xt(t.visible),l=this.ease(t.ease);return i&&(r.stroke=i),o&&(r.fill=o),s!==void 0&&(r.visible=s),l&&(r.ease=l),r}track(t){if(!G(t))return null;this.fields(t,"track");let n=kt(t.element);if(!n)return null;let r=(Array.isArray(t.keys)?t.keys:[]).map(s=>this.keyframe(s)).filter(s=>s!==null&&s.t>=0&&s.t<=le);Je(r,s=>s.t);let i=Array.isArray(t.follow)?t.follow.filter(G).flatMap(s=>{let l=kt(s.path),a=C(s.start),c=C(s.end);return!l||a===void 0||c===void 0||a<0||c>le?[]:[{path:l,start:a,end:c,ease:this.ease(s.ease),reverse:xt(s.reverse)??null,orient:xt(s.orient)??null,laps:C(s.laps)??null}]}):null,o=Array.isArray(t.repeats)?t.repeats.filter(G).flatMap(s=>{let l=C(s.start),a=C(s.end);if(l===void 0||a===void 0)return[];let c=C(s.count),u={start:l,end:a,count:c===void 0?null:Math.trunc(c)};return _e(u)?[u]:[]}):null;return{element:n,keys:r,boil:xt(t.boil)??null,follow:i,repeats:o,march:fi(C(t.march))}}timeline(t){if(!G(t))return null;this.fields(t,"timeline");let n=C(t.boil),r=Array.isArray(t.camera)?t.camera.filter(G).flatMap(s=>{let l=C(s.t),a=C(s.x),c=C(s.y),u=C(s.width),h=C(s.height);return l===void 0||a===void 0||c===void 0||u===void 0||h===void 0?[]:u>1&&h>1&&l>=0?[{t:l,x:a,y:c,width:u,height:h,ease:this.ease(s.ease)}]:[]}):null;r&&Je(r,s=>s.t);let i=Array.isArray(t.markers)?t.markers.filter(G).flatMap(s=>{let l=C(s.t);return l!==void 0&&l>=0?[{t:l,name:Y(s.name)??"",loop:xt(s.loop)??null}]:[]}):null;i&&Je(i,s=>s.t);let o=C(t.poster);return{fps:ue(C(t.fps)??12),duration:dt(C(t.duration)??0),boil:n!==void 0&&Number.isInteger(n)&&n>0?Math.min(n,1e4):null,settle:xt(t.settle)??null,poster:o===void 0?null:dt(o),tracks:(Array.isArray(t.tracks)?t.tracks:[]).map(s=>this.track(s)).filter(s=>s!==null),camera:r,markers:i}}page(t,n,r){if(!G(t))throw new Ot(`Page ${r} is not an object`);this.fields(t,"page");let i=(Array.isArray(t.layers)?t.layers:[]).filter(G).flatMap(o=>{let s=kt(o.id);return s?[{id:s,name:Y(o.name)??"",visible:xt(o.visible)??!0,locked:xt(o.locked)??!1}]:[]});return i.length===0&&(this.warn(`Page ${r} has no layers`),i.push({id:"LAYER",name:"Layer 1",visible:!0,locked:!1})),{id:kt(t.id)??`PAGE-${r}`,name:Y(t.name)??`Page ${r}`,layers:i,elements:(Array.isArray(t.elements)?t.elements:[]).map(o=>this.element(o,n)).filter(o=>o!==null),theme:Y(t.theme)??null,customTheme:this.customTheme(t.customTheme),logic:typeof t.logic=="string"&&t.logic.length>0?t.logic:null,timeline:this.timeline(t.timeline),symbols:Array.isArray(t.symbols)?t.symbols.map(o=>this.symbol(o,n)).filter(o=>o!==null):null,variables:this.variables(t.variables),flows:Array.isArray(t.flows)?t.flows.filter(G).map(o=>this.flow(o)):null}}flow(t){this.fields(t,"flow");let n=i=>typeof i=="string"&&Pe.test(i)?i.toUpperCase():ui,r=i=>{let o=C(i);return o!==void 0&&Number.isFinite(o)?o:null};return{id:n(t.id),from:n(t.from),to:Array.isArray(t.to)&&t.to.every(i=>typeof i=="string")?t.to.filter(i=>Pe.test(i)).map(i=>i.toUpperCase()):[],every:r(t.every),speed:r(t.speed),size:r(t.size),color:G(t.color)&&["r","g","b","a"].every(i=>typeof t.color[i]=="number")?yt(t.color)??null:null,when:Y(t.when)??null,spread:t.spread===!0?!0:null,volume:r(t.volume),overrides:Array.isArray(t.overrides)&&t.overrides.length>0?t.overrides.filter(G).map(i=>(this.fields(i,"flowOverride"),{when:Y(i.when)??"",volume:r(i.volume)})):null}}},rs=/^[A-Za-z0-9+/=\s]*$/;function _e(e){return Number.isFinite(e.start)&&Number.isFinite(e.end)&&e.start>=0&&e.end-e.start>.001&&e.end<=le&&(e.count===null||e.count>=1&&e.count<=1e4)}function Je(e,t){let n=e.map((r,i)=>[r,i]);n.sort((r,i)=>t(r[0])-t(i[0])||r[1]-i[1]);for(let r=0;r<e.length;r++)e[r]=n[r][0]}function Ee(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){throw new Ot(`Not JSON: ${s.message}`)}if(!G(t))throw new Ot("Not a Dottie drawing");let n=C(t.version);if(n===void 0)throw new Ot("Not a Dottie drawing (no version)");if(!Array.isArray(t.pages)||t.pages.length===0)throw new Ot("A drawing needs at least one page");let r=new Un;r.fields(t,"file"),n>zn&&r.warn(`File version ${n} is newer than this player knows (${zn}); some things may not show`);let i={};if(G(t.images))for(let[s,l]of Object.entries(t.images))G(l)&&typeof l.data=="string"&&(i[s]=r.picture(l.data,Y(l.format)));let o=t.pages.map((s,l)=>li(r.page(s,i,l+1)));if(new Set(o.map(s=>s.id)).size!==o.length)throw new Ot("Two pages share an id");return{version:n,pages:o,warnings:r.warnings}}function ce(e){return .2126*e.r+.7152*e.g+.0722*e.b}function ae(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}function Re(e){return ae(e,_t)||ae(e,di)}function mt(e){return{...e,style:{...e.style,stroke:{...e.style.stroke},fill:{...e.style.fill},textColor:e.style.textColor?{...e.style.textColor}:null,named:e.style.named?{...e.style.named}:e.style.named},connector:e.connector?{...e.connector,start:{...e.connector.start},end:{...e.connector.end},waypoints:e.connector.waypoints?.map(t=>({...t}))??null}:null,gauge:e.gauge?{...e.gauge}:e.gauge}}function Dt(e){if(e.layers.length<=1)return e.elements;let t=new Map;e.layers.forEach((r,i)=>{t.has(r.id)||t.set(r.id,i)});let n=e.layers.map(()=>[]);for(let r of e.elements)n[t.get(r.layerID)??0].push(r);return n.flat()}function is(e){let t=new Map;for(let n of e.elements)t.has(n.id)||t.set(n.id,n);return t}var pi=.60205078125,gi=.92822265625,yi=.23583984375,Qt={"Architects Daughter":{faces:{regular:{ascent:.986328125,descent:.4033203125,k:{},leading:0,w:{" ":400.39,_:686.52,"-":310.55,"\u2013":310.55,"\u2014":411.13,",":177.73,";":124.02,":":166.99,"!":134.77,"?":505.86,".":140.63,"\u2026":422.85,"\xB7":140.63,"'":162.11,"\u2018":162.11,"\u2019":162.11,'"':236.33,"\u201C":236.33,"\u201D":236.33,"(":297.85,")":351.56,"[":424.8,"]":541.02,"{":352.54,"}":478.52,"@":1042.97,"*":507.81,"/":455.08,"\\":501.95,"&":669.92,"#":637.7,"%":518.55,"\u2022":192.38,"`":171.88,"^":306.64,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":524.41,"\xD7":470.7,"<":475.59,"=":492.19,">":471.68,"|":145.51,"~":444.34,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556.64,0:630.86,1:127.93,2:572.27,3:508.79,4:680.66,5:708.01,6:626.95,7:615.23,8:648.44,9:569.34,a:508.79,A:640.63,b:561.52,B:710.94,c:632.81,C:708.01,d:512.7,D:648.44,e:541.02,E:591.8,\u00E9:541.02,f:593.75,F:692.38,g:515.63,G:692.38,h:495.12,H:605.47,i:151.37,I:151.37,j:177.73,J:529.3,k:614.26,K:605.47,l:157.23,L:692.38,m:778.32,M:827.15,n:500,N:626.95,o:562.5,O:669.92,p:556.64,P:637.7,q:513.67,Q:712.89,r:551.76,R:712.89,s:501.95,S:642.58,t:404.3,T:623.05,u:507.81,U:561.52,v:518.55,V:626.95,w:808.59,W:940.43,x:470.7,X:599.61,y:548.83,Y:534.18,z:495.12,Z:784.18}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},Caveat:{faces:{bold:{ascent:.9600067138671875,descent:.3000030517578125,k:{AC:-20,AE:-10,AG:-10,AH:-10,AI:10,Aj:10,AJ:10,AL:-10,AM:10,An:-10,AO:-20,AP:-10,Aq:-10,AQ:-20,Ar:-10,As:-10,AS:-35,AT:-50,Au:-10,AU:-20,av:-20,Av:-5,AV:-40,aw:-10,AW:-20,Ax:10,AX:-10,ay:-20,Ay:-10,AY:-65,Az:20,AZ:-10,ba:-10,bc:-10,BC:-20,bd:-10,Bf:10,BF:-20,Bg:10,bh:-5,Bi:10,BI:-10,bj:-5,Bj:10,BJ:-10,Bk:10,Bl:10,Bm:10,BP:-10,BR:-10,BS:-20,BT:-40,bu:-10,BU:-20,BV:-50,BW:-50,bx:-10,Bx:10,BX:-40,by:-10,BY:-65,Bz:40,BZ:-30,CA:-20,Cc:-5,CC:-10,Cd:-10,CE:-10,CG:-10,Cj:10,CJ:-10,CK:-10,cl:10,Cl:5,Cn:-5,CO:-10,CP:-10,CQ:-20,Cs:-10,CS:-10,Ct:10,CT:-20,Cu:-10,CU:-10,Cv:-20,CV:-20,cw:-10,Cw:-10,CW:-20,Cx:20,CX:-30,cy:-5,CY:-35,Cz:20,CZ:-40,DA:-10,Db:10,Dc:10,De:10,Df:20,DF:-10,Dg:10,Dh:10,Di:15,DI:-10,Dj:5,DJ:-10,Dk:10,Dl:10,Dm:20,DM:-5,dn:-10,Do:10,Dp:10,Dq:10,Dr:10,Ds:10,dt:10,Dt:20,DT:-40,du:-10,Dv:30,DV:-30,Dw:20,DW:-10,Dx:20,DX:-50,Dy:10,DY:-50,Dz:30,DZ:-30,EC:-10,ED:-10,EG:-10,EJ:-10,el:10,EO:-10,EQ:-20,ES:-40,ET:-10,EU:-20,Ev:-10,EV:-25,Ew:-10,EW:-30,Ex:10,EX:-40,Ey:-10,EY:-50,Ez:20,EZ:-20,fa:-10,Fa:-30,FA:-40,Fc:-20,FC:-10,Fd:-20,FD:20,Fe:-15,ff:10,Ff:10,FF:20,Fg:-10,fh:10,Fh:20,fi:10,Fi:10,FI:10,fj:10,Fj:10,FJ:20,Fk:10,fl:20,Fl:20,FL:10,fm:10,FM:-10,Fn:-20,FN:10,Fo:-20,FO:10,Fp:-10,FP:-10,Fq:-10,FQ:10,Fr:-10,FS:10,ft:40,Ft:10,FT:-30,Fu:-10,fv:10,Fv:10,FV:10,FW:10,fy:10,FY:10,Fz:10,FZ:-10,GA:-10,Gf:10,Gh:10,gi:10,Gi:10,GI:-10,Gj:10,GJ:-10,Gk:10,Gl:10,Gm:10,GM:-10,GN:10,GP:-20,GS:-10,Gt:10,GU:-10,Gv:10,GV:-10,GW:-20,Gx:10,GX:-40,gy:10,GY:-40,Gz:10,GZ:-20,Hb:10,hf:-10,Hf:10,hg:-20,Hh:10,Hi:10,Hj:20,Hk:10,Hl:10,Hm:10,hq:-10,hs:-10,Ht:20,hv:-30,Hv:10,hw:-15,Hx:20,hy:-30,Hy:10,Hz:20,Ia:-10,IA:10,Ib:10,Ic:-10,Id:-10,ID:30,Ie:-10,if:10,If:20,IF:40,Ig:-10,Ih:30,Ii:20,II:30,Ij:30,IJ:40,Ik:20,IK:10,Il:20,IL:10,IM:30,In:-10,IN:20,Io:-10,Ip:10,Iq:-20,Ir:-10,IR:10,Is:-10,It:10,Iu:-10,IU:10,iv:10,Iv:-20,IV:30,Iw:-25,IW:20,Ix:10,IX:10,Iy:-10,IY:30,Iz:20,IZ:20,Ja:-10,Jb:10,Jc:-10,Jd:-10,Je:-10,Jf:10,Jh:10,Ji:10,JI:-10,Jj:20,JJ:10,Jk:10,Jl:20,Jn:-10,Jo:-10,JO:-10,Jp:10,JP:-10,Jq:-10,JQ:-10,JR:-10,jt:10,Jt:20,JT:10,ju:-10,Ju:-20,JU:-10,jx:10,JX:-25,jy:10,JY:-20,jz:10,Jz:10,JZ:-20,Ka:-40,kc:20,Kc:-40,KC:-10,Kd:-40,KD:10,ke:10,Ke:-40,kf:20,Kf:10,KF:20,Kg:-40,KG:-10,kh:10,Kh:10,ki:10,Ki:10,Kj:40,KJ:20,kk:20,Kk:10,kl:20,Kl:10,km:10,KM:20,Kn:-40,ko:10,Ko:-50,KO:-10,Kp:10,Kq:-50,kr:10,Ks:-40,kt:10,Kt:10,KT:-10,ku:10,Ku:-60,kv:10,Kv:-30,Kw:-40,Kx:-10,KX:-10,ky:-10,Ky:-30,kz:10,Lb:-10,LC:-20,LE:-20,Lf:10,Lg:-10,LG:-20,Lh:-10,Li:10,LI:-40,Lj:20,Lk:10,ll:10,Ll:10,LL:-20,Ln:-20,LO:-25,Lp:10,Lq:-40,LQ:-30,Ls:-10,LS:-65,lt:10,Lt:-10,LT:-70,Lu:-40,LU:-45,Lv:-60,LV:-70,Lw:-40,LW:-40,Lx:10,Ly:-20,LY:-90,lz:20,Lz:30,LZ:-10,Mb:10,md:10,Mf:10,Mh:10,Mi:10,MJ:10,Mk:10,Ml:10,mo:20,Mp:10,MP:-10,Mq:-10,MQ:-10,MS:-20,Mt:20,MT:-30,Mu:-10,MU:-20,mv:-15,Mv:10,MV:-20,mw:-10,MW:-30,Mx:10,MX:-10,my:-10,My:-10,MY:-50,Mz:10,MZ:-10,nb:-15,Nb:10,Ne:10,Nf:10,Ng:10,Nh:10,Ni:20,Nj:20,Nk:20,Nl:20,Nm:10,Nq:10,ns:-5,nt:-10,Nt:20,nu:-10,nv:-20,Nv:30,nw:-20,NW:-10,Nx:30,NX:-20,ny:-20,Ny:10,NY:-20,Nz:40,NZ:-10,OA:-10,OD:-10,Of:20,Og:20,Oh:10,Oi:20,OI:-10,oj:-5,Oj:20,Ok:10,Ol:20,OL:10,Om:20,Oo:10,Op:10,Oq:10,OQ:10,Os:10,Ot:20,OT:-10,ou:-10,ov:5,Ov:30,OV:-10,ow:-10,Ow:10,OW:-10,Ox:30,OX:-40,oy:-10,Oy:20,OY:-40,Oz:30,OZ:-20,Pa:-40,PA:-40,Pc:-30,Pd:-40,PD:-10,Pe:-20,Pf:10,Pg:-10,Ph:10,Pi:10,PI:-10,Pj:20,PJ:-10,Pk:10,Pl:10,Pm:10,PM:-30,pn:-10,Pn:-10,PN:-10,Po:-30,Pq:-30,Ps:-20,PS:10,Pt:20,pu:-10,Pu:-30,Pv:10,Px:10,PX:-35,py:-10,PY:-20,Pz:10,PZ:-50,Qb:10,Qf:20,Qg:20,qh:-10,Qh:10,Qi:20,qj:10,Qj:90,QJ:80,Qk:10,Ql:20,Qm:20,qn:-10,qo:-10,Qp:20,Qt:30,QT:-10,qu:-10,Qv:20,QV:-10,QW:-10,Qx:20,QX:-20,Qy:50,QY:-30,Qz:40,QZ:-10,ra:-5,Ra:-10,RA:-25,RB:-10,Rc:-10,RC:-20,Rd:-10,RD:10,Re:-10,RE:-20,Rf:20,RF:10,Rg:-10,RG:-10,ri:5,RI:-10,Rj:30,RJ:30,RL:-10,RM:-20,Rn:-10,RN:10,Ro:-10,RO:-10,Rp:20,Rq:-30,RQ:-10,Rr:-10,Rs:-10,Rt:10,RT:-10,Ru:-30,RU:-20,rv:20,RV:-10,Rw:-10,RW:-10,Rx:10,RX:-20,Ry:10,RY:-30,Rz:20,RZ:-45,Sa:-10,Sb:10,Sc:-20,Sd:-25,SD:20,Se:-20,SE:-10,sf:10,Sf:20,SF:30,Sg:-20,Sh:20,Si:20,SI:10,Sj:30,SJ:30,Sk:10,Sl:20,SL:20,Sn:-20,SN:10,So:-10,SO:10,Sq:-20,Sr:-10,Ss:-10,st:10,St:20,Su:-20,sv:20,Sv:-50,SV:20,Sw:-30,SW:10,sx:15,Sx:10,Sy:-15,SY:10,sz:20,Sz:20,SZ:-10,Ta:-90,TA:-50,Tc:-80,TC:-10,Td:-110,TD:10,Te:-90,TE:-10,Tf:20,TF:30,Tg:-80,TG:-10,Th:20,ti:5,TI:10,Tj:20,Tk:10,Tl:20,Tm:-50,TM:-30,Tn:-90,To:-90,Tp:-80,Tq:-120,Tr:-80,Ts:-80,Tt:10,TT:-30,Tu:-90,tv:10,Tv:-70,TV:10,Tw:-100,tx:20,Tx:-60,TX:-10,Ty:-50,tz:30,Tz:-40,TZ:-10,ub:-10,Ub:20,UE:10,uf:10,Uf:30,UF:10,Ug:10,Uh:30,ui:10,Ui:30,Uj:40,uk:10,Uk:20,ul:10,Ul:30,Um:30,Up:10,UQ:30,Ur:10,UR:10,Us:10,Ut:50,UT:20,Uu:10,UU:10,Uv:50,UV:10,Uw:10,ux:10,Ux:30,UX:-10,Uy:10,UY:-10,uz:30,Uz:30,UZ:-10,va:-10,Va:-50,VA:-55,Vc:-30,VC:-20,Vd:-30,Ve:-30,VE:-20,vf:10,VF:10,Vg:-30,VG:-10,vi:10,Vm:-10,VM:-30,Vn:-30,VN:-10,Vo:-30,VO:-10,Vp:-20,VP:-20,Vq:-30,VQ:-10,Vr:-20,Vs:-30,vt:10,VT:20,Vu:-30,VU:-10,vv:20,Vw:-30,vx:20,VX:-20,vy:10,VY:-10,vz:10,VZ:-20,WA:-20,Wb:20,Wd:-10,WD:20,We:10,Wf:30,WF:20,Wh:30,wi:10,Wi:30,WI:10,Wj:40,WJ:20,Wk:20,Wl:40,WL:10,Wm:10,WM:-10,WS:10,Wt:40,WT:30,Wv:30,WV:10,wx:10,Wx:20,WX:-10,Wy:20,WY:10,Wz:30,WZ:-10,XA:-25,XC:-20,Xe:-10,XE:-10,xf:10,Xf:10,Xg:-10,XG:-20,xi:10,Xi:10,XI:-10,Xj:30,xk:10,Xk:10,xl:10,Xl:20,Xm:10,XM:-25,xn:-10,XN:-10,Xo:-10,XO:-20,xp:10,Xp:10,XP:-10,xq:-10,Xq:-40,XQ:-25,XS:-20,xu:-5,Xu:-30,XU:-20,xv:10,Xv:-20,Xw:-30,xx:15,Xx:10,XX:-30,xy:-10,Xy:-20,XY:-20,xz:10,Xz:30,ya:-10,Ya:-70,YA:-55,Yc:-60,YC:-30,yd:-10,Yd:-60,YD:10,ye:10,Ye:-60,YE:-30,YF:20,Yg:-60,YG:-30,YH:-10,YI:10,YJ:10,Ym:-30,YM:-35,yn:-10,Yn:-60,Yo:-60,YO:-20,Yp:-50,YP:-10,Yq:-60,YQ:-10,Yr:-60,YR:-10,Ys:-60,YS:-10,yt:10,YT:-15,yu:-10,Yu:-60,yv:10,Yv:-20,Yw:-50,yx:10,Yx:-50,YX:-30,Yy:-40,YY:-10,Yz:-30,YZ:-40,Za:-20,ZA:-20,Zb:-10,ZB:-10,Zc:-10,ZC:-20,Zd:-30,ZD:-10,Ze:-40,ZE:-20,zf:10,Zg:-40,ZG:-20,zi:10,Zj:10,Zk:10,ZL:-10,Zm:-10,Zn:-50,Zo:-30,ZO:-30,Zp:-10,ZP:-10,Zq:-50,ZQ:-10,Zr:-40,ZR:-10,Zs:-30,ZS:-20,zt:10,Zt:-10,Zu:-30,ZU:-10,zv:10,Zv:-20,Zw:-40,ZW:-10,zx:10,Zx:-10,ZX:-10,Zy:-30,ZY:-20,zz:20,Zz:10,ZZ:-10},leading:0,w:{" ":242,_:446,"-":326,"\u2013":446,"\u2014":566,",":198,";":198,":":198,"!":210,"?":374,".":198,"\u2026":594,"\xB7":187,"'":117,"\u2018":117,"\u2019":117,'"':237,"\u201C":267,"\u201D":267,"(":330,")":330,"[":330,"]":330,"{":330,"}":330,"@":643,"*":363,"/":330,"\\":330,"&":564,"#":559,"%":600,"\u2022":187,"`":353,"^":446,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":446,"\xD7":446,"<":446,"=":446,">":446,"|":330,"~":446,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:450,0:450,1:450,2:450,3:450,4:450,5:434,6:471,7:446,8:450,9:438,a:446,A:511,b:444,B:523,c:364,C:477,d:402,D:587,e:334,E:534,\u00E9:325,f:300,F:466,g:364,G:494,h:473,H:574,i:196,I:409,j:213,J:315,k:374,K:508,l:178,L:426,m:569,M:729,n:459,N:619,o:362,O:505,p:378,P:468,q:377,Q:492,r:360,R:544,s:350,S:495,t:331,T:458,u:370,U:482,v:331,V:490,w:517,W:720,x:343,X:524,y:341,Y:504,z:315,Z:522}},regular:{ascent:.9600067138671875,descent:.3000030517578125,k:{AC:-20,AE:-10,AG:-10,AH:-10,AI:10,Aj:10,AJ:10,AL:-10,AM:10,An:-10,AO:-20,AP:-10,Aq:-10,AQ:-20,Ar:-10,As:-10,AS:-35,AT:-50,Au:-10,AU:-20,av:-20,Av:-5,AV:-40,aw:-10,AW:-20,Ax:10,AX:-10,ay:-20,Ay:-10,AY:-65,Az:20,AZ:-10,ba:-10,bc:-10,BC:-20,bd:-10,Bf:10,BF:-20,Bg:10,bh:-5,Bi:10,BI:-10,bj:-5,Bj:10,BJ:-10,Bk:10,Bl:10,Bm:10,BP:-10,BR:-10,BS:-20,BT:-40,bu:-10,BU:-20,BV:-50,BW:-50,bx:-10,Bx:10,BX:-40,by:-10,BY:-65,Bz:40,BZ:-30,CA:-20,Cc:-5,CC:-10,Cd:-10,CE:-10,CG:-10,Cj:10,CJ:-10,CK:-10,cl:10,Cl:5,Cn:-5,CO:-10,CP:-10,CQ:-20,Cs:-10,CS:-10,Ct:10,CT:-20,Cu:-10,CU:-10,Cv:-20,CV:-20,cw:-10,Cw:-10,CW:-20,Cx:20,CX:-30,cy:-5,CY:-35,Cz:20,CZ:-40,DA:-10,Db:10,Dc:10,De:10,Df:20,DF:-10,Dg:10,Dh:10,Di:15,DI:-10,Dj:5,DJ:-10,Dk:10,Dl:10,Dm:20,DM:-5,dn:-10,Do:10,Dp:10,Dq:10,Dr:10,Ds:10,dt:10,Dt:20,DT:-40,du:-10,Dv:30,DV:-30,Dw:20,DW:-10,Dx:20,DX:-50,Dy:10,DY:-50,Dz:30,DZ:-30,EC:-10,ED:-10,EG:-10,EJ:-10,el:10,EO:-10,EQ:-20,ES:-40,ET:-10,EU:-20,Ev:-10,EV:-25,Ew:-10,EW:-30,Ex:10,EX:-40,Ey:-10,EY:-50,Ez:20,EZ:-20,fa:-10,Fa:-30,FA:-40,Fc:-20,FC:-10,Fd:-20,FD:20,Fe:-15,ff:10,Ff:10,FF:20,Fg:-10,fh:10,Fh:20,fi:10,Fi:10,FI:10,fj:10,Fj:10,FJ:20,Fk:10,fl:20,Fl:20,FL:10,fm:10,FM:-10,Fn:-20,FN:10,Fo:-20,FO:10,Fp:-10,FP:-10,Fq:-10,FQ:10,Fr:-10,FS:10,ft:40,Ft:10,FT:-30,Fu:-10,fv:10,Fv:10,FV:10,FW:10,fy:10,FY:10,Fz:10,FZ:-10,GA:-10,Gf:10,Gh:10,gi:10,Gi:10,GI:-10,Gj:10,GJ:-10,Gk:10,Gl:10,Gm:10,GM:-10,GN:10,GP:-20,GS:-10,Gt:10,GU:-10,Gv:10,GV:-10,GW:-20,Gx:10,GX:-40,gy:10,GY:-40,Gz:10,GZ:-20,Hb:10,hf:-10,Hf:10,hg:-20,Hh:10,Hi:10,Hj:20,Hk:10,Hl:10,Hm:10,hq:-10,hs:-10,Ht:20,hv:-30,Hv:10,hw:-15,Hx:20,hy:-30,Hy:10,Hz:20,Ia:-10,IA:10,Ib:10,Ic:-10,Id:-10,ID:30,Ie:-10,if:10,If:20,IF:40,Ig:-10,Ih:30,Ii:20,II:30,Ij:30,IJ:40,Ik:20,IK:10,Il:20,IL:10,IM:30,In:-10,IN:20,Io:-10,Ip:10,Iq:-20,Ir:-10,IR:10,Is:-10,It:10,Iu:-10,IU:10,iv:10,Iv:-20,IV:30,Iw:-25,IW:20,Ix:10,IX:10,Iy:-10,IY:30,Iz:20,IZ:20,Ja:-10,Jb:10,Jc:-10,Jd:-10,Je:-10,Jf:10,Jh:10,Ji:10,JI:-10,Jj:20,JJ:10,Jk:10,Jl:20,Jn:-10,Jo:-10,JO:-10,Jp:10,JP:-10,Jq:-10,JQ:-10,JR:-10,jt:10,Jt:20,JT:10,ju:-10,Ju:-20,JU:-10,jx:10,JX:-25,jy:10,JY:-20,jz:10,Jz:10,JZ:-20,Ka:-40,kc:20,Kc:-40,KC:-10,Kd:-40,KD:10,ke:10,Ke:-40,kf:20,Kf:10,KF:20,Kg:-40,KG:-10,kh:10,Kh:10,ki:10,Ki:10,Kj:40,KJ:20,kk:20,Kk:10,kl:20,Kl:10,km:10,KM:20,Kn:-40,ko:10,Ko:-50,KO:-10,Kp:10,Kq:-50,kr:10,Ks:-40,kt:10,Kt:10,KT:-10,ku:10,Ku:-60,kv:10,Kv:-30,Kw:-40,Kx:-10,KX:-10,ky:-10,Ky:-30,kz:10,Lb:-10,LC:-20,LE:-20,Lf:10,Lg:-10,LG:-20,Lh:-10,Li:10,LI:-40,Lj:20,Lk:10,ll:10,Ll:10,LL:-20,Ln:-20,LO:-25,Lp:10,Lq:-40,LQ:-30,Ls:-10,LS:-65,lt:10,Lt:-10,LT:-70,Lu:-40,LU:-45,Lv:-60,LV:-70,Lw:-40,LW:-40,Lx:10,Ly:-20,LY:-90,lz:20,Lz:30,LZ:-10,Mb:10,md:10,Mf:10,Mh:10,Mi:10,MJ:10,Mk:10,Ml:10,mo:20,Mp:10,MP:-10,Mq:-10,MQ:-10,MS:-20,Mt:20,MT:-30,Mu:-10,MU:-20,mv:-15,Mv:10,MV:-20,mw:-10,MW:-30,Mx:10,MX:-10,my:-10,My:-10,MY:-50,Mz:10,MZ:-10,nb:-15,Nb:10,Ne:10,Nf:10,Ng:10,Nh:10,Ni:20,Nj:20,Nk:20,Nl:20,Nm:10,Nq:10,ns:-5,nt:-10,Nt:20,nu:-10,nv:-20,Nv:30,nw:-20,NW:-10,Nx:30,NX:-20,ny:-20,Ny:10,NY:-20,Nz:40,NZ:-10,OA:-10,OD:-10,Of:20,Og:20,Oh:10,Oi:20,OI:-10,oj:-5,Oj:20,Ok:10,Ol:20,OL:10,Om:20,Oo:10,Op:10,Oq:10,OQ:10,Os:10,Ot:20,OT:-10,ou:-10,ov:5,Ov:30,OV:-10,ow:-10,Ow:10,OW:-10,Ox:30,OX:-40,oy:-10,Oy:20,OY:-40,Oz:30,OZ:-20,Pa:-40,PA:-40,Pc:-30,Pd:-40,PD:-10,Pe:-20,Pf:10,Pg:-10,Ph:10,Pi:10,PI:-10,Pj:20,PJ:-10,Pk:10,Pl:10,Pm:10,PM:-30,pn:-10,Pn:-10,PN:-10,Po:-30,Pq:-30,Ps:-20,PS:10,Pt:20,pu:-10,Pu:-30,Pv:10,Px:10,PX:-35,py:-10,PY:-20,Pz:10,PZ:-50,Qb:10,Qf:20,Qg:20,qh:-10,Qh:10,Qi:20,qj:10,Qj:90,QJ:80,Qk:10,Ql:20,Qm:20,qn:-10,qo:-10,Qp:20,Qt:30,QT:-10,qu:-10,Qv:20,QV:-10,QW:-10,Qx:20,QX:-20,Qy:50,QY:-30,Qz:40,QZ:-10,ra:-5,Ra:-10,RA:-25,RB:-10,Rc:-10,RC:-20,Rd:-10,RD:10,Re:-10,RE:-20,Rf:20,RF:10,Rg:-10,RG:-10,ri:5,RI:-10,Rj:30,RJ:30,RL:-10,RM:-20,Rn:-10,RN:10,Ro:-10,RO:-10,Rp:20,Rq:-30,RQ:-10,Rr:-10,Rs:-10,Rt:10,RT:-10,Ru:-30,RU:-20,rv:20,RV:-10,Rw:-10,RW:-10,Rx:10,RX:-20,Ry:10,RY:-30,Rz:20,RZ:-45,Sa:-10,Sb:10,Sc:-20,Sd:-25,SD:20,Se:-20,SE:-10,sf:10,Sf:20,SF:30,Sg:-20,Sh:20,Si:20,SI:10,Sj:30,SJ:30,Sk:10,Sl:20,SL:20,Sn:-20,SN:10,So:-10,SO:10,Sq:-20,Sr:-10,Ss:-10,st:10,St:20,Su:-20,sv:20,Sv:-50,SV:20,Sw:-30,SW:10,sx:15,Sx:10,Sy:-15,SY:10,sz:20,Sz:20,SZ:-10,Ta:-90,TA:-50,Tc:-80,TC:-10,Td:-110,TD:10,Te:-90,TE:-10,Tf:20,TF:30,Tg:-80,TG:-10,Th:20,ti:5,TI:10,Tj:20,Tk:10,Tl:20,Tm:-50,TM:-30,Tn:-90,To:-90,Tp:-80,Tq:-120,Tr:-80,Ts:-80,Tt:10,TT:-30,Tu:-90,tv:10,Tv:-70,TV:10,Tw:-100,tx:20,Tx:-60,TX:-10,Ty:-50,tz:30,Tz:-40,TZ:-10,ub:-10,Ub:20,UE:10,uf:10,Uf:30,UF:10,Ug:10,Uh:30,ui:10,Ui:30,Uj:40,uk:10,Uk:20,ul:10,Ul:30,Um:30,Up:10,UQ:30,Ur:10,UR:10,Us:10,Ut:50,UT:20,Uu:10,UU:10,Uv:50,UV:10,Uw:10,ux:10,Ux:30,UX:-10,Uy:10,UY:-10,uz:30,Uz:30,UZ:-10,va:-10,Va:-50,VA:-55,Vc:-30,VC:-20,Vd:-30,Ve:-30,VE:-20,vf:10,VF:10,Vg:-30,VG:-10,vi:10,Vm:-10,VM:-30,Vn:-30,VN:-10,Vo:-30,VO:-10,Vp:-20,VP:-20,Vq:-30,VQ:-10,Vr:-20,Vs:-30,vt:10,VT:20,Vu:-30,VU:-10,vv:20,Vw:-30,vx:20,VX:-20,vy:10,VY:-10,vz:10,VZ:-20,WA:-20,Wb:20,Wd:-10,WD:20,We:10,Wf:30,WF:20,Wh:30,wi:10,Wi:30,WI:10,Wj:40,WJ:20,Wk:20,Wl:40,WL:10,Wm:10,WM:-10,WS:10,Wt:40,WT:30,Wv:30,WV:10,wx:10,Wx:20,WX:-10,Wy:20,WY:10,Wz:30,WZ:-10,XA:-25,XC:-20,Xe:-10,XE:-10,xf:10,Xf:10,Xg:-10,XG:-20,xi:10,Xi:10,XI:-10,Xj:30,xk:10,Xk:10,xl:10,Xl:20,Xm:10,XM:-25,xn:-10,XN:-10,Xo:-10,XO:-20,xp:10,Xp:10,XP:-10,xq:-10,Xq:-40,XQ:-25,XS:-20,xu:-5,Xu:-30,XU:-20,xv:10,Xv:-20,Xw:-30,xx:15,Xx:10,XX:-30,xy:-10,Xy:-20,XY:-20,xz:10,Xz:30,ya:-10,Ya:-70,YA:-55,Yc:-60,YC:-30,yd:-10,Yd:-60,YD:10,ye:10,Ye:-60,YE:-30,YF:20,Yg:-60,YG:-30,YH:-10,YI:10,YJ:10,Ym:-30,YM:-35,yn:-10,Yn:-60,Yo:-60,YO:-20,Yp:-50,YP:-10,Yq:-60,YQ:-10,Yr:-60,YR:-10,Ys:-60,YS:-10,yt:10,YT:-15,yu:-10,Yu:-60,yv:10,Yv:-20,Yw:-50,yx:10,Yx:-50,YX:-30,Yy:-40,YY:-10,Yz:-30,YZ:-40,Za:-20,ZA:-20,Zb:-10,ZB:-10,Zc:-10,ZC:-20,Zd:-30,ZD:-10,Ze:-40,ZE:-20,zf:10,Zg:-40,ZG:-20,zi:10,Zj:10,Zk:10,ZL:-10,Zm:-10,Zn:-50,Zo:-30,ZO:-30,Zp:-10,ZP:-10,Zq:-50,ZQ:-10,Zr:-40,ZR:-10,Zs:-30,ZS:-20,zt:10,Zt:-10,Zu:-30,ZU:-10,zv:10,Zv:-20,Zw:-40,ZW:-10,zx:10,Zx:-10,ZX:-10,Zy:-30,ZY:-20,zz:20,Zz:10,ZZ:-10},leading:0,w:{" ":242,_:446,"-":326,"\u2013":446,"\u2014":566,",":198,";":198,":":198,"!":210,"?":374,".":198,"\u2026":594,"\xB7":187,"'":117,"\u2018":117,"\u2019":117,'"':237,"\u201C":267,"\u201D":267,"(":330,")":330,"[":330,"]":330,"{":330,"}":330,"@":643,"*":363,"/":330,"\\":330,"&":564,"#":559,"%":600,"\u2022":187,"`":353,"^":446,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":446,"\xD7":446,"<":446,"=":446,">":446,"|":330,"~":446,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:450,0:450,1:450,2:450,3:450,4:450,5:450,6:450,7:450,8:450,9:450,a:437,A:502,b:435,B:520,c:355,C:472,d:393,D:578,e:325,E:529,\u00E9:325,f:291,F:454,g:355,G:487,h:464,H:563,i:187,I:400,j:204,J:306,k:365,K:498,l:169,L:426,m:560,M:720,n:450,N:599,o:353,O:496,p:378,P:464,q:377,Q:502,r:360,R:537,s:341,S:486,t:331,T:458,u:370,U:482,v:331,V:490,w:517,W:720,x:343,X:524,y:341,Y:504,z:315,Z:522}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},"Helvetica Neue":{faces:{bold:{ascent:.975006103515625,descent:.2169952392578125,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-30,fi:20,fl:20,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0290069580078125,w:{" ":278,_:500,"-":407,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":278,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':463,"\u201C":463,"\u201D":463,"(":296,")":296,"[":333,"]":333,"{":333,"}":333,"@":800,"*":407,"/":371,"\\":371,"&":685,"#":556,"%":1e3,"\u2022":350,"`":259,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":223,"~":600,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:574,A:685,b:611,B:704,c:574,C:741,d:611,D:741,e:574,E:648,\u00E9:574,f:333,F:593,g:611,G:759,h:593,H:741,i:258,I:295,j:278,J:556,k:574,K:722,l:258,L:593,m:906,M:907,n:593,N:741,o:611,O:778,p:611,P:667,q:611,Q:778,r:389,R:722,s:537,S:649,t:352,T:611,u:593,U:741,v:520,V:630,w:814,W:944,x:537,X:667,y:519,Y:667,z:519,Z:648}},boldItalic:{ascent:.975006103515625,descent:.2169952392578125,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-68,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0290069580078125,w:{" ":278,_:500,"-":407,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":296,"?":574,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':481,"\u201C":481,"\u201D":481,"(":296,")":296,"[":333,"]":333,"{":333,"}":333,"@":800,"*":407,"/":389,"\\":389,"&":685,"#":556,"%":963,"\u2022":350,"`":259,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:574,A:685,b:611,B:722,c:556,C:741,d:611,D:741,e:574,E:667,\u00E9:574,f:352,F:593,g:611,G:759,h:611,H:741,i:259,I:296,j:259,J:556,k:556,K:722,l:259,L:574,m:907,M:907,n:611,N:741,o:593,O:778,p:611,P:667,q:611,Q:778,r:389,R:722,s:519,S:648,t:370,T:611,u:611,U:741,v:519,V:630,w:815,W:944,x:519,X:667,y:519,Y:648,z:500,Z:648}},italic:{ascent:.957000732421875,descent:.2129974365234375,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-15,fi:1,fl:1,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0279998779296875,w:{" ":278,_:500,"-":389,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":259,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':426,"\u201C":426,"\u201D":426,"(":259,")":259,"[":259,"]":259,"{":333,"}":333,"@":800,"*":352,"/":333,"\\":333,"&":630,"#":556,"%":926,"\u2022":500,"`":222,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:519,A:667,b:593,B:685,c:537,C:722,d:593,D:704,e:537,E:611,\u00E9:537,f:296,F:574,g:574,G:759,h:556,H:722,i:222,I:259,j:222,J:519,k:481,K:667,l:222,L:556,m:852,M:870,n:556,N:722,o:574,O:759,p:593,P:648,q:593,Q:759,r:333,R:685,s:481,S:648,t:315,T:574,u:556,U:722,v:481,V:611,w:759,W:926,x:481,X:611,y:481,Y:611,z:444,Z:611}},regular:{ascent:.951995849609375,descent:.2129974365234375,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-15,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0279998779296875,w:{" ":278,_:500,"-":389,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":259,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':426,"\u201C":426,"\u201D":426,"(":259,")":259,"[":259,"]":259,"{":333,"}":333,"@":800,"*":352,"/":333,"\\":333,"&":630,"#":556,"%":1e3,"\u2022":350,"`":222,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:537,A:648,b:593,B:685,c:537,C:722,d:593,D:704,e:537,E:611,\u00E9:537,f:296,F:574,g:574,G:759,h:556,H:722,i:222,I:259,j:222,J:519,k:519,K:667,l:222,L:556,m:853,M:871,n:556,N:722,o:574,O:760,p:593,P:648,q:593,Q:760,r:333,R:685,s:500,S:648,t:315,T:574,u:556,U:722,v:500,V:611,w:758,W:926,x:518,X:611,y:500,Y:648,z:480,Z:611}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},"Patrick Hand":{faces:{regular:{ascent:1.0420074462890625,descent:.3119964599609375,k:{},leading:0,w:{" ":230,_:571,"-":404,"\u2013":420,"\u2014":648,",":202,";":232,":":232,"!":247,"?":368,".":214,"\u2026":571,"\xB7":200,"'":164,"\u2018":190,"\u2019":220,'"':303,"\u201C":315,"\u201D":303,"(":334,")":364,"[":303,"]":296,"{":339,"}":328,"@":550,"*":404,"/":423,"\\":420,"&":530,"#":457,"%":643,"\u2022":352,"`":220,"^":370,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":480,"\xD7":490,"<":396,"=":572,">":400,"|":176,"~":529,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:507,0:448,1:363,2:468,3:448,4:375,5:423,6:399,7:495,8:433,9:367,a:392,A:488,b:412,B:507,c:388,C:548,d:390,D:475,e:398,E:442,\u00E9:398,f:359,F:375,g:445,G:480,h:420,H:468,i:224,I:235,j:235,J:370,k:415,K:523,l:266,L:372,m:680,M:595,n:452,N:532,o:403,O:556,p:428,P:481,q:463,Q:655,r:385,R:454,s:385,S:459,t:344,T:468,u:400,U:550,v:400,V:562,w:463,W:616,x:448,X:601,y:423,Y:442,z:428,Z:507}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}}};var qe="Helvetica Neue",Zn="Helvetica Neue, Helvetica, Arial, sans-serif",Se=Object.keys(Qt).filter(e=>e!==qe).sort();function Te(e){if(!e)return null;let t=e.toLowerCase();return Se.find(n=>n.toLowerCase()===t)??null}function Ae(e){return Qt[Te(e)??qe]}function Ie(e,t,n){let r=t?n?"boldItalic":"bold":n?"italic":"regular";return e.faces[r]?r:"regular"}function Qe(e){if(!e)return Zn;let t=[...Te(e)??e].filter(n=>!`"'<>&;{}\\`.includes(n)).join("");return t===""?Zn:`${/^[\p{L}\p{N} -]+$/u.test(t)?t:`'${t}'`}, ${Zn}`}function bi(e,t,n="regular",r){let i=Ae(r),o=i.faces[n]??i.faces.regular,s=o.w.n,l=0,a="";for(let c of e)l+=o.w[c]??s,a&&(l+=o.k[a+c]??0),a=c;return l*t/1e3}function os(e,t){let n=Ae(t).faces.regular,r=Math.round(n.ascent*e),i=Math.round(n.descent*e),o=Math.round(n.leading*e);return[r+Math.ceil(n.descent*e-1e-9),r+i+o]}function Xn(e,t){return e===" "?!0:(e==="/"||e==="-")&&t!==""&&!/[\d\s/-]/.test(t)}function ss(e){let t=[...e],n=[],r="";return t.forEach((i,o)=>{r+=i;let s=t[o+1]??"";Xn(i,s)&&s!==" "&&(n.push(r),r="")}),(r||n.length===0)&&n.push(r),n}function ls(e,t,n,r){let i=Ae(r),o=i.faces[n]??i.faces.regular,s=o.w.n,l=[0],a=0,c="";for(let u of e)a+=o.w[u]??s,c&&(a+=o.k[c+u]??0),c=u,l.push(a*t/1e3);return l}function as(e,t,n,r="regular",i){let o=l=>bi(l,t,r,i),s=[];for(let l of e.split(/\r\n|\n|\r|\u2028|\u2029/)){let a="";for(let c of ss(l)){let u=a+c;for(a===""||o(u.trimEnd())<=n?a=u:(s.push(a),a=c);o(a.trimEnd())>n&&[...a.trimEnd()].length>1;){let h=[...a],f=ls(h,t,r,i),m=h.length-1;for(;m>1&&f[m]>n;)m--;s.push(h.slice(0,m).join("")),a=h.slice(m).join("")}}s.push(a)}return s}function xi(e,t,n,r){if(e==="")return{width:0,height:0};let i=as(e,t,n,"regular",r),o=Math.max(...i.map(a=>bi(a.trimEnd(),t,"regular",r))),[s,l]=os(t,r);return{width:Math.ceil(o-1e-9),height:Math.ceil(s+l*(i.length-1)-1e-9)}}var us=["bold","boldItalic","italic","regular"];function Hn(e,t){return`${e.toLowerCase().replaceAll(" ","-")}-${t}.woff2`}function Jn(e){return us.filter(t=>Qt[e]?.faces[t]!==void 0)}function tn(e){let t=new Set,n=r=>{for(let i of r){let o=Te(i.style.font);o&&t.add(o)}};n(e.elements);for(let r of e.symbols??[])n(r.elements);return Se.filter(r=>t.has(r))}function cs(){try{let e=typeof document>"u"?null:document.currentScript;if(e?.src)return new URL("fonts/",e.src).href;let t=void 0;return t?new URL("fonts/",t).href:null}catch{return null}}var Kn=cs(),ki=new Set;function wi(e){Kn=e.endsWith("/")?e:`${e}/`}function en(e,t={}){if(!(typeof document>"u"||typeof FontFace>"u"||!document.fonts))for(let n of e){let r=Te(n);if(!r||ki.has(r))continue;let i=t[r];if(!(!i&&!Kn)){ki.add(r);for(let o of Jn(r)){let s=i?.[o],l;if(s)l=Uint8Array.from(atob(s),c=>c.charCodeAt(0));else if(!i)l=`url(${JSON.stringify(Kn+Hn(r,o))}) format("woff2")`;else continue;let a={weight:o.startsWith("bold")?"bold":"normal",style:o==="italic"||o==="boldItalic"?"italic":"normal"};document.fonts.add(new FontFace(r,l,a))}}}}var Mi=.5522847498307936,K=class e{constructor(){R(this,"segments",[])}get isEmpty(){return this.segments.length===0}moveTo(t){return this.segments.push({op:"M",p:t}),this}lineTo(t){return this.segments.push({op:"L",p:t}),this}quadTo(t,n){return this.segments.push({op:"Q",c:n,p:t}),this}curveTo(t,n,r){return this.segments.push({op:"C",c1:n,c2:r,p:t}),this}close(){return this.segments.push({op:"Z"}),this}addPath(t){return this.segments.push(...t.segments),this}addLines(t){return t.forEach((n,r)=>r===0?this.moveTo(n):this.lineTo(n)),this}static rect(t){return new e().addLines([{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}]).close()}addEllipse(t){let n=t.x+t.width/2,r=t.y+t.height/2,i=t.width/2,o=t.height/2,s=i*Mi,l=o*Mi;return this.moveTo({x:n+i,y:r}),this.curveTo({x:n,y:r+o},{x:n+i,y:r+l},{x:n+s,y:r+o}),this.curveTo({x:n-i,y:r},{x:n-s,y:r+o},{x:n-i,y:r+l}),this.curveTo({x:n,y:r-o},{x:n-i,y:r-l},{x:n-s,y:r-o}),this.curveTo({x:n+i,y:r},{x:n+s,y:r-o},{x:n+i,y:r-l}),this.close()}static ellipse(t){return new e().addEllipse(t)}translated(t,n){let r=o=>({x:o.x+t,y:o.y+n}),i=new e;return i.segments=this.segments.map(o=>{switch(o.op){case"M":case"L":return{op:o.op,p:r(o.p)};case"Q":return{op:"Q",c:r(o.c),p:r(o.p)};case"C":return{op:"C",c1:r(o.c1),c2:r(o.c2),p:r(o.p)};case"Z":return o}}),i}contours(){let t=[],n=[],r={x:0,y:0};for(let i of this.segments){let o=n.length?n[n.length-1]:r;switch(i.op){case"M":n.length>1&&t.push(n),r=i.p,n=[i.p];break;case"L":n.push(i.p);break;case"Q":for(let s=1;s<=12;s++){let l=s/12,a=1-l;n.push({x:a*a*o.x+2*a*l*i.c.x+l*l*i.p.x,y:a*a*o.y+2*a*l*i.c.y+l*l*i.p.y})}break;case"C":for(let s=1;s<=16;s++){let l=s/16,a=1-l;n.push({x:a*a*a*o.x+3*a*a*l*i.c1.x+3*a*l*l*i.c2.x+l*l*l*i.p.x,y:a*a*a*o.y+3*a*a*l*i.c1.y+3*a*l*l*i.c2.y+l*l*l*i.p.y})}break;case"Z":n.push(r),n.length>1&&t.push(n),n=[r];break}}return n.length>1&&t.push(n),t}trimmed(t){let n=this.contours().map(o=>new Bt(o)),r=Math.min(Math.max(t,0),1)*n.reduce((o,s)=>o+s.length,0),i=new e;for(let o of n){if(!(r>0))break;i.moveTo(o.points[0]);for(let s=1;s<o.points.length;s++){let l=o.lengths[s]-o.lengths[s-1];if(l<=r){i.lineTo(o.points[s]),r-=l;continue}let a=o.points[s-1],c=o.points[s],u=r/l;i.lineTo({x:a.x+(c.x-a.x)*u,y:a.y+(c.y-a.y)*u}),r=0;break}}return i}data(){let t=[];for(let n of this.segments)switch(n.op){case"M":t.push(`M${I(n.p.x)} ${I(n.p.y)}`);break;case"L":t.push(`L${I(n.p.x)} ${I(n.p.y)}`);break;case"Q":t.push(`Q${I(n.c.x)} ${I(n.c.y)} ${I(n.p.x)} ${I(n.p.y)}`);break;case"C":t.push(`C${I(n.c1.x)} ${I(n.c1.y)} ${I(n.c2.x)} ${I(n.c2.y)} ${I(n.p.x)} ${I(n.p.y)}`);break;case"Z":t.push("Z");break}return t.join(" ")}};function Fe(e){return e<0?-Math.round(-e):Math.round(e)}function I(e){let t=Fe(e*100)/100;return Number.isInteger(t)?String(t===0?0:t):String(t)}var Bt=class{constructor(t){R(this,"points");R(this,"lengths");this.points=t;let n=0;this.lengths=t.map((r,i)=>(i>0&&(n+=Math.hypot(r.x-t[i-1].x,r.y-t[i-1].y)),n))}get length(){return this.lengths.length?this.lengths[this.lengths.length-1]:0}point(t){if(this.points.length<=1||!(this.length>0))return this.points[0]??{x:0,y:0};let n=Math.min(Math.max(t,0),1)*this.length,r=1;for(;r<this.lengths.length-1&&this.lengths[r]<n;)r++;let i=this.lengths[r]-this.lengths[r-1],o=i>0?(n-this.lengths[r-1])/i:0,s=this.points[r-1],l=this.points[r];return{x:s.x+(l.x-s.x)*o,y:s.y+(l.y-s.y)*o}}},Rt=e=>e.x+e.width/2,St=e=>e.y+e.height/2,vt=e=>e.x+e.width,Et=e=>e.y+e.height;function _n(e,t){if(!e)return{...t};let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(vt(e),vt(t))-n,height:Math.max(Et(e),Et(t))-r}}function he(e,t,n){return{x:e.x+t,y:e.y+n,width:e.width-2*t,height:e.height-2*n}}function Ut(e,t,n){if(n===0)return e;let r=e.x-t.x,i=e.y-t.y;return{x:t.x+r*Math.cos(n)-i*Math.sin(n),y:t.y+r*Math.sin(n)+i*Math.cos(n)}}function qn(e,t){let n=1-t;return{x:e[0].x*(n*n*n)+e[1].x*(3*t*n*n)+e[2].x*(3*t*t*n)+e[3].x*(t*t*t),y:e[0].y*(n*n*n)+e[1].y*(3*t*n*n)+e[2].y*(3*t*t*n)+e[3].y*(t*t*t)}}function Pi(e,t){let n=[e[0]];for(let r=0;r<Math.floor((e.length-1)/3);r++){let i=e.slice(3*r,3*r+4),o=0;for(let l=1;l<i.length;l++)o+=Math.hypot(i[l].x-i[l-1].x,i[l].y-i[l-1].y);let s=Math.min(400,Math.max(4,Math.ceil(o/Math.max(t,.5))));for(let l=1;l<=s;l++)n.push(qn(i,l/s))}return n}var st=e=>({x:e.x,y:e.y,width:e.width,height:e.height}),wt=e=>e.rotation??0,Ce=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),Ft=(e,t)=>Ut(t,Ce(e),wt(e)),vi=(e,t)=>Ut(t,Ce(e),-wt(e));function nn(e){let t=st(e);if(wt(e)===0)return t;let n=[{x:t.x,y:t.y},{x:vt(t),y:t.y},{x:vt(t),y:Et(t)},{x:t.x,y:Et(t)}].map(l=>Ft(e,l)),r=n.map(l=>l.x),i=n.map(l=>l.y),o=Math.min(...r),s=Math.min(...i);return{x:o,y:s,width:Math.max(...r)-o,height:Math.max(...i)-s}}function Ei(e,t){let n=e.style.textColor!==null&&Re(e.style.textColor);if(!Re(e.style.stroke)&&!n)return e;let r=mt(e),o=(e.style.fillStyle==="solid"||e.style.fillStyle==="grid")&&e.style.fill.a>=.5&&ce(e.style.fill)>.5,s=ce(t)>.5&&o?_t:t;return Re(e.style.stroke)&&(r.style.stroke={...s}),n&&(r.style.textColor={...s}),r}function Ri(e){return e.kind==="text"||e.kind==="note"?e.style.stroke:e.style.textColor??e.style.stroke}function fe(e){if(e.kind!=="path"||!e.subpaths)return[];let t=[];for(let n of e.subpaths){if(n.coords.length<8||(n.coords.length-2)%6!==0)continue;let r=[];for(let i=0;i<n.coords.length;i+=2)r.push({x:e.x+n.coords[i]*e.width,y:e.y+n.coords[i+1]*e.height});t.push({closed:n.closed,points:r})}return t}function Qn(e){let t=new K;for(let n of fe(e)){t.moveTo(n.points[0]);for(let r=0;r<(n.points.length-1)/3;r++)t.curveTo(n.points[3*r+3],n.points[3*r+1],n.points[3*r+2]);n.closed&&t.close()}return t}var rn=16,hs=24,Si=24,fs=48;function ms(e){if(e.kind==="connector"||e.kind==="text"||e.kind==="freehand"||e.kind==="path"&&!e.extension||e.style.opacity!==null&&e.style.opacity<=0)return null;let t=nn(e);return t.width<Si||t.height<Si?null:t}function tr(e,t){let n=t.x+t.width,r=t.y+t.height;for(let i=1;i<e.length;i++){let o=e[i-1],s=e[i];if(o.y===s.y){if(t.y<o.y&&o.y<r&&Math.min(o.x,s.x)<n&&Math.max(o.x,s.x)>t.x)return!0}else if(o.x===s.x&&t.x<o.x&&o.x<n&&Math.min(o.y,s.y)<r&&Math.max(o.y,s.y)>t.y)return!0}return!1}var er=e=>({x:e.x-rn,y:e.y-rn,width:e.width+2*rn,height:e.height+2*rn}),Ti=(e,t)=>t.x<e.x&&e.x<t.x+t.width&&t.y<e.y&&e.y<t.y+t.height,on=new Map;function Ai(e,t,n,r,i,o,s){let l=m=>!Ti(t,er(m))&&!Ti(n,er(m)),a=[],c=!1;for(let m of o){if(s.has(m.id))continue;let p=ms(m);!p||!l(p)||(a.push(p),!c&&tr(e,p)&&(c=!0))}if(!c)return e;let u=JSON.stringify([t.x,t.y,n.x,n.y,r,i,a.map(m=>[m.x,m.y,m.width,m.height])]),h=on.get(u);if(h)return h;let f=ds(e,t,n,r,i,a);return on.size>=512&&on.clear(),on.set(u,f),f}function ds(e,t,n,r,i,o){let s=o.map((l,a)=>a).filter(l=>tr(e,o[l]));if(s.length===0)return e;for(let l=0;l<4;l++){if(s.length>fs)return e;let a=ps(t,n,r,i,s.map(u=>er(o[u])));if(!a)return e;let c=o.map((u,h)=>h).filter(u=>!s.includes(u)&&tr(a,o[u]));if(c.length===0)return a;s=[...s,...c].sort((u,h)=>u-h)}return e}function ps(e,t,n,r,i){let o=[e.x,t.x,(e.x+t.x)/2],s=[e.y,t.y,(e.y+t.y)/2];for(let F of i)o.push(F.x,F.x+F.width),s.push(F.y,F.y+F.height);o=[...new Set(o)].sort((F,D)=>F-D),s=[...new Set(s)].sort((F,D)=>F-D);let l=o.length,a=s.length,c=o.indexOf(e.x),u=s.indexOf(e.y),h=o.indexOf(t.x),f=s.indexOf(t.y);if(c<0||u<0||h<0||f<0)return null;let m=new Map(o.map((F,D)=>[F,D])),p=new Map(s.map((F,D)=>[F,D])),k=new Uint8Array(l*a),y=new Uint8Array(l*a),M=new Uint8Array(l*a);for(let F of i){let D=m.get(F.x),v=m.get(F.x+F.width),T=p.get(F.y),N=p.get(F.y+F.height);if(!(D===void 0||v===void 0||T===void 0||N===void 0))for(let O=D;O<v;O++)for(let V=T;V<N;V++)V>T&&(y[O*a+V]=1),O>D&&(M[O*a+V]=1),O>D&&V>T&&(k[O*a+V]=1)}let E=(F,D)=>k[F*a+D]===1,b=(F,D,v)=>y[Math.min(F,D)*a+v]===1,S=(F,D,v)=>M[v*a+Math.min(F,D)]===1,x=l*a*2,w=new Array(x).fill(1/0),d=new Array(x).fill(-1),g=new Array(x).fill(!1),P=new nr,A=(c*a+u)*2+(n?1:0);w[A]=0,P.push(0,A);let L=(h*a+f)*2+(r?1:0);for(let F=P.pop();F;F=P.pop()){let[D,v]=F;if(g[v])continue;if(g[v]=!0,v===L)break;let T=Math.floor(v/2),N=v%2,O=Math.floor(T/a),V=T%a;for(let[$,_]of[[1,0],[-1,0],[0,1],[0,-1]]){let Q=O+$,j=V+_;if(Q<0||Q>=l||j<0||j>=a||E(Q,j))continue;let ct=$!==0?0:1;if($!==0?b(O,Q,V):S(V,j,O))continue;let Z=Math.abs(o[Q]-o[O])+Math.abs(s[j]-s[V]),lt=D+Z+(ct!==N?hs:0),gt=(Q*a+j)*2+ct;lt<w[gt]&&(w[gt]=lt,d[gt]=v,P.push(lt,gt))}}if(!g[L])return null;let W=[];for(let F=L;F>=0;F=d[F]){let D=Math.floor(F/2);W.push({x:o[Math.floor(D/a)],y:s[D%a]})}return W.reverse()}var nr=class{constructor(){R(this,"heap",[]);R(this,"next",0)}less(t,n){let r=this.heap[t],i=this.heap[n];return r[0]<i[0]||r[0]===i[0]&&r[1]<i[1]}push(t,n){this.heap.push([t,this.next++,n]);for(let r=this.heap.length-1;r>0;){let i=r-1>>1;if(!this.less(r,i))break;[this.heap[r],this.heap[i]]=[this.heap[i],this.heap[r]],r=i}}pop(){if(this.heap.length===0)return null;let t=this.heap[0],n=this.heap.pop();if(this.heap.length>0){this.heap[0]=n;for(let r=0;;){let i=2*r+1,o=i+1,s=r;if(i<this.heap.length&&this.less(i,s)&&(s=i),o<this.heap.length&&this.less(o,s)&&(s=o),s===r)break;[this.heap[r],this.heap[s]]=[this.heap[s],this.heap[r]],r=s}}return[t[0],t[2]]}};function gs(e,t){let n=st(e),r=t==="top"?{x:Rt(n),y:n.y}:t==="right"?{x:vt(n),y:St(n)}:t==="bottom"?{x:Rt(n),y:Et(n)}:{x:n.x,y:St(n)};return Ft(e,r)}function ys(e){let t=[];for(let n=0;n+3<e.length;n+=3){let r=e.slice(n,n+4);for(let i=0;i<16;i++)t.push(qn(r,i/16))}return t.push(e[e.length-1]),t}function bs(e,t,n){let r=null,i=null;for(let s of fe(e)){let l=ys(s.points),a=l.length,c=s.closed?a:a-1;for(let u=0;u<c;u++){let h=l[u],f=l[(u+1)%a],m={x:f.x-h.x,y:f.y-h.y},p={x:h.x-t.x,y:h.y-t.y},k=m.x*n.y-n.x*m.y;if(k===0)continue;let y=(m.x*p.y-m.y*p.x)/k,M=(n.x*p.y-n.y*p.x)/k;y>0&&M>=0&&M<=1&&((r===null||y<r)&&(r=y),y<=1&&(i===null||y>i)&&(i=y))}}let o=i??r;return o===null?null:{x:t.x+n.x*o,y:t.y+n.y*o}}function xs(e,t){let n=st(e),r=Ce(e),i=vi(e,t),o=i.x-r.x,s=i.y-r.y;if(!((o!==0||s!==0)&&n.width>0&&n.height>0))return r;if(e.kind==="path"){let u=bs(e,r,{x:o,y:s});if(u)return Ft(e,u)}let l=n.width/2,a=n.height/2,c;return e.kind==="ellipse"?c=1/Math.sqrt(o*o/(l*l)+s*s/(a*a)):e.kind==="diamond"?c=1/(Math.abs(o)/l+Math.abs(s)/a):c=Math.min(o!==0?l/Math.abs(o):1/0,s!==0?a/Math.abs(s):1/0),Ft(e,{x:r.x+o*c,y:r.y+s*c})}function Ii(e,t){let n=e.elementID?t.get(e.elementID):void 0;return n?Ce(n):{x:e.x,y:e.y}}function ks(e,t){let n=st(e);return Ft(e,{x:n.x+t.x*n.width,y:n.y+t.y*n.height})}function Fi(e,t,n){let r=e.elementID?n.get(e.elementID):void 0;if(!r)return{x:e.x,y:e.y};let i=e.portIndex,o=r.ports??[];return typeof i=="number"&&Number.isInteger(i)&&i>=0&&i<o.length?ks(r,o[i]):e.port?gs(r,e.port):xs(r,t)}function Vt(e,t){let n=e.connector;if(!n)return[{x:0,y:0},{x:0,y:0}];let r=n.waypoints??[];return[Fi(n.start,r.length>0?r[0]:Ii(n.end,t),t),Fi(n.end,r.length>0?r[r.length-1]:Ii(n.start,t),t)]}function Wt(e){if(e.kind==="polyline")return e.points;let t=[],n=e.points;for(let r=0;r<Math.floor((n.length-1)/3);r++){let i=n[3*r],o=n[3*r+1],s=n[3*r+2],l=n[3*r+3];for(let a=r===0?0:1;a<=24;a++){let c=a/24,u=1-c;t.push({x:u*u*u*i.x+3*u*u*c*o.x+3*u*c*c*s.x+c*c*c*l.x,y:u*u*u*i.y+3*u*u*c*o.y+3*u*c*c*s.y+c*c*c*l.y})}}return t}var sn=e=>e===null?null:e==="top"||e==="bottom";function Ci(e){let t=[];for(let n of e){let r=t[t.length-1];if(!(r&&Math.abs(r.x-n.x)<.5&&Math.abs(r.y-n.y)<.5)){if(t.length>=2){let i=t[t.length-2],o=t[t.length-1];if(Math.abs(i.x-o.x)<.5&&Math.abs(o.x-n.x)<.5||Math.abs(i.y-o.y)<.5&&Math.abs(o.y-n.y)<.5){t[t.length-1]=n;continue}}t.push(n)}}return t.length>=2?t:e}function ws(e,t){switch(t.routing){case"straight":return{kind:"polyline",points:e};case"curved":{let n=[e[0]];for(let r=0;r<e.length-1;r++){let i=e[Math.max(r-1,0)],o=e[r],s=e[r+1],l=e[Math.min(r+2,e.length-1)];n.push({x:o.x+(s.x-i.x)/6,y:o.y+(s.y-i.y)/6}),n.push({x:s.x-(l.x-o.x)/6,y:s.y-(l.y-o.y)/6}),n.push(s)}return{kind:"curve",points:n}}case"elbow":{let n=e[0],r=e[1],i=sn(t.start.port)??Math.abs(r.y-n.y)>Math.abs(r.x-n.x),o=sn(t.end.port),s=[n];for(let l=1;l<e.length;l++){let a=e[l],c=s[s.length-1],u=Math.abs(c.x-a.x)<.5,h=Math.abs(c.y-a.y)<.5;if(u||h){s.push(a),u!==h&&(i=!u);continue}let f=l===e.length-1&&o!==null?!o:i;s.push(f?{x:c.x,y:a.y}:{x:a.x,y:c.y},a),i=f}return{kind:"polyline",points:Ci(s)}}}}function Nt(e,t){let n=e.connector;if(!n)return{kind:"polyline",points:[]};let[r,i]=Vt(e,t);if(n.waypoints&&n.waypoints.length>0)return ws([r,...n.waypoints.map(a=>({x:a.x,y:a.y})),i],n);let o=i.x-r.x,s=i.y-r.y,l=Math.abs(o)>=Math.abs(s);switch(n.routing){case"straight":return{kind:"polyline",points:[r,i]};case"curved":return l?{kind:"curve",points:[r,{x:r.x+o/2,y:r.y},{x:i.x-o/2,y:i.y},i]}:{kind:"curve",points:[r,{x:r.x,y:r.y+s/2},{x:i.x,y:i.y-s/2},i]};case"elbow":{let a=sn(n.start.port)??!l,c=sn(n.end.port)??!l,u;if(a&&c){let m=r.y+s/2;u=[r,{x:r.x,y:m},{x:i.x,y:m},i]}else if(!a&&!c){let m=r.x+o/2;u=[r,{x:m,y:r.y},{x:m,y:i.y},i]}else a?u=[r,{x:r.x,y:i.y},i]:u=[r,{x:i.x,y:r.y},i];if(n.avoid!==!0)return{kind:"polyline",points:u};let h=new Set([n.start.elementID,n.end.elementID].filter(m=>m!==null)),f=Ai(u,r,i,a,c,t.values(),h);return{kind:"polyline",points:f===u?u:Ci(f)}}}}function Li(e,t,n){let r=Math.atan2(e.y-t.y,e.x-t.x),i=Math.PI/7,o=s=>({x:e.x-n*Math.cos(r+s),y:e.y-n*Math.sin(r+s)});return[o(i),o(-i)]}function Oi(e,t){let n=Wt(Nt(e,t));if(n.length===0)return{x:0,y:0,width:0,height:0};let r=n[0].x,i=n[0].y,o=r,s=i;for(let l of n)r=Math.min(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),s=Math.max(s,l.y);return{x:r,y:i,width:o-r,height:s-i}}function Di(e,t){let n=Wt(Nt(e,t));if(n.length<=1)return n[0]??{x:0,y:0};let r=[],i=0;for(let s=0;s<n.length-1;s++){let l=Math.hypot(n[s+1].x-n[s].x,n[s+1].y-n[s].y);r.push(l),i+=l}let o=i/2;for(let s=0;s<r.length;s++){let l=r[s];if(o<=l||s===r.length-1){let a=l===0?0:o/l;return{x:n[s].x+(n[s+1].x-n[s].x)*a,y:n[s].y+(n[s+1].y-n[s].y)*a}}o-=l}return n[0]}var rr=new WeakMap;function ir(e,t){return rr.get(e.elements)?.index===t}function Mt(e){let t=e.elements,n=rr.get(t);if(n&&n.members.length===t.length&&n.members.every((i,o)=>i===t[o]))return n.index;let r=new Map;for(let i of t)r.has(i.id)||r.set(i.id,i);return rr.set(t,{members:[...t],index:r}),r}function sr(e,t,n){let r=e[1]+n>>>0,i=r<e[1]?1:0;return[e[0]+t+i>>>0,r]}function Ms(e,t){let n=e&65535,r=e>>>16,i=t&65535,o=t>>>16,s=n*i,l=n*o,a=r*i,c=r*o,u=l+a,h=s+u%65536*65536;return[c+Math.floor(u/65536)+Math.floor(h/4294967296)>>>0,h>>>0]}function lr(e,t,n){let r=Ms(e[1],n);return[r[0]+Math.imul(e[0],n)+Math.imul(e[1],t)>>>0,r[1]]}function or(e,t){let n=(e[1]>>>t|e[0]<<32-t)>>>0;return[(e[0]^e[0]>>>t)>>>0,(e[1]^n)>>>0]}function Vi(e){return e=lr(or(e,30),3210233709,484763065),e=lr(or(e,27),2496678331,321982955),or(e,31)}var jt=class{constructor(t){R(this,"state");this.state=sr([0,t>>>0],2654435769,2135587861)}next(){return this.state=sr(this.state,2654435769,2135587861),Vi(this.state)}top53(){let[t,n]=this.next();return t*2097152+(n>>>11)}signed(){return Math.floor(this.top53())/2**52-1}unit(){return this.top53()/2**53}};function ln(e,t){let n=sr([0,e>>>0],...Ps(t));return n=Vi(n),Math.max(1,n[1]>>>0)}function Ps(e){let t=lr([0,e>>>0],2654435769,2135587861);return[t[0],t[1]]}var Ni=.5,cr=160,hr=12,fr={r:.95,g:.36,b:.33,a:1},te=(e,t,n,r)=>e===null||!Number.isFinite(e)?t:Math.min(Math.max(e,n),r);function Le(e,t){let n=(t+1099511627776)%281474976710656;return e.slice(0,24)+(n<0?n+2**48:n).toString(16).toUpperCase().padStart(12,"0")}var un=e=>e===null||!Number.isFinite(e)?1:Math.min(Math.max(e,0),1e6),Wi=new WeakMap,an=new Map;function vs(e){let t=e.elements,n=Wi.get(t);if(n&&n.members.length===t.length&&n.members.every((l,a)=>l===t[a]))return n.graph;let r=new Set(t.filter(l=>l.kind!=="connector").map(l=>l.id)),i=[];for(let l of t){let a=l.connector;a&&i.push([l.id,a.start.elementID,a.end.elementID,String(un(a.cost)),a.startHead!=="none"?"both":"one"])}let o=JSON.stringify([[...r],i]),s=an.get(o);if(!s){let l=new Map,a=(c,u)=>{let h=l.get(c);h?h.push(u):l.set(c,[u])};for(let c of t){let u=c.connector,h=u?.start.elementID??null,f=u?.end.elementID??null;if(!u||h===null||f===null||h===f||!r.has(h)||!r.has(f))continue;let m=un(u.cost);a(h,{to:f,via:c.id,back:!1,cost:m}),u.startHead!=="none"&&a(f,{to:h,via:c.id,back:!0,cost:m})}s={shapes:r,next:l,trees:new Map},an.size>=16&&an.clear(),an.set(o,s)}return Wi.set(t,{members:[...t],graph:s}),s}var ar=class{constructor(){R(this,"heap",[])}get size(){return this.heap.length}less(t,n){let r=this.heap[t],i=this.heap[n];return r.dist<i.dist||r.dist===i.dist&&r.order<i.order}swap(t,n){[this.heap[t],this.heap[n]]=[this.heap[n],this.heap[t]]}push(t,n,r){this.heap.push({id:t,dist:n,order:r});for(let i=this.heap.length-1;i>0;){let o=i-1>>1;if(!this.less(i,o))break;this.swap(i,o),i=o}}pop(){let t=this.heap[0],n=this.heap.pop();if(this.heap.length>0){this.heap[0]=n;for(let r=0;;){let i=2*r+1,o=i+1,s=r;if(i<this.heap.length&&this.less(i,s)&&(s=i),o<this.heap.length&&this.less(o,s)&&(s=o),s===r)break;this.swap(r,s),r=s}}return t}};function cn(e,t,n=new Set,r){let i=vs(t),o=JSON.stringify([e,r??null,[...n].sort()]);if(i.trees.has(o))return i.trees.get(o);let s=Es(i,e,n,r);return i.trees.size>=4096&&i.trees.clear(),i.trees.set(o,s),s}function Es({shapes:e,next:t},n,r,i){if(!e.has(n)||r.has(n))return null;let o=new Map([[n,0]]),s=new Map([[n,0]]),l=1,a=new ur(n),c=new ar;for(c.push(n,0,0);c.size>0;){let{id:u,order:h}=c.pop();if(!(a.settled.has(u)||s.get(u)!==h)){if(a.settled.add(u),u===i&&u!==n)break;for(let f of t.get(u)??[]){if(r.has(f.via)||r.has(f.to)||a.settled.has(f.to))continue;let m=o.get(u)+f.cost,p=o.get(f.to);p!==void 0&&p<=m||(o.set(f.to,m),s.set(f.to,l),c.push(f.to,m,l++),a.came.set(f.to,{from:u,via:f.via,back:f.back}))}}}return a}var ur=class{constructor(t){R(this,"settled",new Set);R(this,"came",new Map);R(this,"from");this.from=t}goals(t,n){let r=t.filter(i=>i!==this.from&&this.settled.has(i));return r.length===0?[]:n&&r[0]!==t[0]?r:[r[0]]}hops(t){let n=[];for(let r=t,i=this.came.get(r);i;r=i.from,i=this.came.get(r))n.push([i.via,i.back]);return n.reverse()}};var hn=()=>({elements:new Map,flows:new Map,carry:{}});function zi(e,t,n){let r=e.flows.get(n);if(r)switch(t){case"throughput":return r.placed;case"backlog":return r.backlog;case"backup":return r.backup;case"transit":return r.transit;default:return null}let i=e.elements.get(n);if(!i)return null;switch(t){case"throughput":return i.throughput;case"load":return i.load;case"delay":return i.delay;case"backlog":return i.backlog;case"inFlight":return i.inFlight;case"depth":return i.depth;default:return null}}var nt=1e-9,br=e=>te(e.volume,1,0,1e12);function mr(e,t){if(t===null||!e.overrides)return br(e);let n=null;for(let r of e.overrides)r.volume!==null&&!oe(r.when)&&se(r.when,t)&&(n=r.volume);return n===null?br(e):Math.min(Math.max(Number.isFinite(n)?n:1,0),1e12)}function Yi(e){let t=e.delay??null;return e.kind==="connector"||t===null||!Number.isFinite(t)?0:Math.min(Math.max(t,0),3600)}var dr=(e,t)=>e+"|"+t;function Bi(e,t,n,r,i=new Set,o=null,s={}){let l=Math.max(0,Math.min(o??n,1e6)),a=Mt(t),c=new Map,u=v=>{let T=c.get(v.id);return T||(T=xr(v,t,a).points,c.set(v.id,T)),T},h=hn(),f=new Map;for(let v of t.elements)v.kind==="connector"&&!v.connector||h.elements.set(v.id,{throughput:0,load:null,delay:v.kind!=="connector"?Yi(v):0,backlog:0,inFlight:0,depth:0});let m=e??[],p=new Map;for(let v of t.elements){let T=v.capacity??null;T!==null&&Number.isFinite(T)&&p.set(v.id,Math.max(T,0))}let k=()=>new Set([...p].filter(([,v])=>v<=nt).map(([v])=>v)),y=(v,T)=>{let N=[],O=[],V=T;for(let $=v.came.get(V);$;$=v.came.get(V))N.push([$.via,$.back]),O.push(V),V=$.from;return O.push(V),{hops:N.reverse(),shapes:O.reverse()}},M=(v,T)=>{let N=[],O=[],V=[],$=0;return v.forEach(([_,Q],j)=>{let ct=a.get(_);if(!ct)return;let Z=Q?[...u(ct)].reverse():u(ct);if(Z.length===0)return;let lt=N[N.length-1];if(lt){let ht=Math.hypot(Z[0].x-lt.x,Z[0].y-lt.y),It=a.get(T[j]);O.push([$,$+ht,It?Yi(It):0]),$+=ht}let gt=$;for(let ht=1;ht<Z.length;ht++)$+=Math.hypot(Z[ht].x-Z[ht-1].x,Z[ht].y-Z[ht-1].y);V.push([_,gt,$]),N.push(...Z)}),$>0?{line:new Bt(N),length:$,inside:O,stretches:V}:null},E=(v,T,N)=>{let O=T,V=0;for(let[$,_,Q]of v.inside){let j=($-V)/N;if(O<=j)break;O-=j,V=$;let ct=(_-$)/N+Q;if(O<ct)return null;O-=ct,V=_}return V+=O*N,V>=0&&V<=v.length?V:null},b=(v,T)=>new Set([...v,...T]),S=(v,T)=>{let N=h.elements.get(v);N&&T(N)},x=new Map,w=[];for(let v of m){let T=x.get(v.from)??0;w.push(T),x.set(v.from,T+1)}let d=m.length>0?Math.max(...m.map(br)):1,g=[],P=new Map,A=v=>Math.min(Math.max(te(v.every,Ni,.05,60)*d/Math.max(mr(v,r),nt),.05),60),L=new Map,W=v=>(L.has(v)||L.set(v,cn(v,t,i)),L.get(v));for(let[v,T]of m.entries()){if(T.when!==null&&r!==null&&!se(T.when,r))continue;let N=a.get(T.from),O=N?W(T.from):null;if(f.set(T.id,[]),!N||!O)continue;let V=mr(T,r),$={volume:V,placed:0,backlog:0,backup:0,transit:null},_=[],Q=[],j=O.goals(T.to,T.spread===!0),ct=j.length>1?j.map(B=>[[B],V/j.length]):[[T.to,V]];for(let[B,U]of ct){if(!(U>nt))continue;let X=U;for(let H=0;H<32&&X>nt;H++){let ot=cn(T.from,t,b(i,k()),B[0]),at=ot?.goals(B,!1)[0];if(!ot||at===void 0)break;let J=y(ot,at),et=[...J.shapes,...J.hops.map(([z])=>z)],rt=et.filter(z=>p.has(z)).map(z=>p.get(z)),q=Math.min(X,rt.length>0?Math.min(...rt):1/0);if(!(q>nt))break;for(let z of et)p.has(z)&&p.set(z,p.get(z)-q);_.push({hops:J.hops,shapes:J.shapes,goal:at,amount:q}),X-=q}if(!(X>nt))continue;let it=T.from,Lt=O.goals(B,!1)[0];if(Lt!==void 0){let H=y(O,Lt),ot=k(),at=[[H.shapes[0],H.shapes[0]]];H.hops.forEach(([rt],q)=>{at.push([rt,H.shapes[q]],[H.shapes[q+1],H.shapes[q]])});let J=at.find(([rt])=>ot.has(rt));if(J){it=J[1];let rt=H.shapes.indexOf(it);for(let q=rt;q>=0;q--){let z=a.get(H.shapes[q]);if(z&&z.queue===!0&&z.kind!=="connector"){it=H.shapes[q];break}}}let et=H.shapes.indexOf(it);if(it!==T.from&&et>=0){let rt=H.shapes.slice(0,et+1),q=H.hops.slice(0,et);for(let z of[...rt,...q.map(([Ln])=>Ln)])p.has(z)&&p.set(z,Math.max(0,p.get(z)-X));_.push({hops:q,shapes:rt,goal:it,amount:X,waits:!0})}}let ut=Q.find(([H])=>H===it);ut?ut[1]+=X:Q.push([it,X])}P.set(T.id,Q),f.set(T.id,_.map(B=>({goal:B.goal,hops:B.hops,amount:B.amount,waits:B.waits===!0,cost:B.hops.reduce((U,[X])=>U+un(a.get(X)?.connector?.cost??null),0)})));for(let B of _){for(let U of[...B.shapes,...B.hops.map(([X])=>X)])S(U,X=>{X.throughput+=B.amount});B.waits||($.placed+=B.amount)}for(let[B,U]of Q)S(B,X=>{X.backlog+=U}),$.backlog+=U;let Z=_.filter(B=>!B.waits&&B.goal===T.to[0]).reduce((B,U)=>B+U.amount,0);$.backup=V>nt?Math.max(0,(V-Z)/V):0;let lt=A(T),gt=te(T.speed,cr,1,1e4),ht=te(T.size,hr,2,200),It=w[v]/x.get(T.from)*lt,Jt=T.color??fr,ft=[],xe=0;for(let B of _)xe+=B.amount/Math.max(V,nt),ft.push(xe);ft.length>0&&Math.abs(ft[ft.length-1]-1)<1e-9&&(ft[ft.length-1]=1);let je=0;_.forEach((B,U)=>{let X=M(B.hops,B.shapes);if(!X)return;let it=X.length/gt+X.inside.reduce((J,et)=>J+et[2],0);B.waits||(je+=it*B.amount);let Lt=Math.ceil((n-It-it)/lt),ut=Math.floor((n-It)/lt),H=U===0?0:ft[U-1],ot=ft[U],at=(J,et)=>Math.floor((et+1)*J)-Math.floor(et*J);for(let J=Math.max(Lt,ut-3999);J<=ut;J++){if(at(ot,J)-at(H,J)!==1)continue;let et=E(X,n-J*lt-It,gt);if(et===null)continue;let rt=X.stretches.find(([,z,Ln])=>et>=z&&et<=Ln);rt&&S(rt[0],z=>{z.inFlight+=1});let q=X.line.point(et/X.length);g.push(pr(Le(T.id,J),q.x-ht/2,q.y-ht/2,ht,Jt,N.layerID))}}),$.transit=$.placed>nt?je/$.placed:null,h.flows.set(T.id,$)}let F=new Map,D=Object.keys(s).filter(v=>s[v]>nt);for(let v of m){let T=P.get(v.id)??[],N=T.map(([Z])=>Z),O="|"+v.id;if(D.some(Z=>Z.endsWith(O)))for(let Z of t.elements){let lt=s[dr(Z.id,v.id)];lt!==void 0&<>nt&&!N.includes(Z.id)&&N.push(Z.id)}if(N.length===0)continue;let V=mr(v,r),_=A(v)*Math.max(V,nt),Q=te(v.speed,cr,1,1e4),j=te(v.size,hr,2,200),ct=v.color??fr;N.forEach((Z,lt)=>{let gt=a.get(Z);if(!gt)return;let ht=a.get(v.from)?.layerID??gt.layerID,It=T.find(([U])=>U===Z)?.[1]??0,Jt=Math.max(0,s[dr(Z,v.id)]??0),ft=Jt+It*l;if(It<=nt&&Jt>nt){let U=new Map(p),X=[],it=0;for(let Lt=0;Lt<32;Lt++){let ut=new Set([...U].filter(([,z])=>z<=nt).map(([z])=>z)),H=cn(Z,t,b(i,ut),v.to[0]),ot=H?.goals(v.to,!1)[0];if(!H||ot===void 0)break;let at=y(H,ot),J=[...at.shapes.slice(1),...at.hops.map(([z])=>z)],et=J.filter(z=>U.has(z)).map(z=>U.get(z)),rt=et.length>0?Math.min(...et):1/0,q=Number.isFinite(rt)?rt:Math.max(Jt/.5-it,nt*2);if(!(q>nt))break;for(let z of J)U.has(z)&&U.set(z,U.get(z)-q);if(X.push({hops:at.hops,shapes:at.shapes,rate:q}),it+=q,!Number.isFinite(rt))break}if(it>nt){if(ft=Math.max(0,Jt-it*l),ft>nt){for(let[ut,H]of U)p.set(ut,H);for(let ut of X)for(let H of[...ut.shapes,...ut.hops.map(([ot])=>ot)])S(H,ot=>{ot.throughput+=ut.rate})}let Lt=Jt/it;X.forEach((ut,H)=>{let ot=M(ut.hops,ut.shapes);if(!ot)return;let at=Math.max(_/ut.rate,.05);for(let J=0;J*at<Lt&&J*at<=l&&J<2048;J++){let et=E(ot,l-J*at,Q);if(et===null)continue;let rt=ot.line.point(et/ot.length);g.push(pr(Le(v.id,2**39+2**20+lt*2**14+H*2**11+J),rt.x-j/2,rt.y-j/2,j,ct,ht))}})}}if(!(ft>nt||It>nt))return;S(Z,U=>{U.depth+=ft}),ft>nt&&(h.carry[dr(Z,v.id)]=ft);let xe=Math.min(Math.max(Math.ceil(ft/_-1e-9),1),30),je=Math.trunc((xe+9)/10),B=F.get(Z)??0;F.set(Z,B+je);for(let U=0;U<xe;U++){let X=gt.x+2+j/2+U%10*(j+3),it=gt.y-4-j/2-(B+Math.trunc(U/10))*(j+3);g.push(pr(Le(v.id,2**39+lt*64+U),X-j/2,it-j/2,j,ct,ht))}})}for(let v of t.elements){let T=v.capacity??null,N=h.elements.get(v.id);T===null||!Number.isFinite(T)||!N||(N.load=T>0?N.throughput/T:1)}return{packets:g,metrics:h,routes:f}}var Ui={seed:1,text:null,connector:null,groupID:null,points:null,path:null,subpaths:null,evenOdd:null,rotation:null,link:null,url:null,anchor:null,click:null,hover:null,when:null,overrides:null,symbol:null,playback:null,offset:null,args:null,image:null,reveal:null};function ji(e,t,n,r="solid",i=null){return{stroke:{...e},fill:{...t},fillStyle:r,strokeWidth:n,dash:"solid",roughness:0,bowing:1,fontSize:18,font:null,gridSize:null,opacity:i,dashOffset:null,textColor:null}}function pr(e,t,n,r,i,o){return{...Ui,id:e,kind:"ellipse",layerID:o,x:t,y:n,width:r,height:r,style:ji(i,i,1.5)}}function Rs(e,t){let n=new Map;for(let i of t.elements)i.anchor!==null&&!n.has(i.anchor)&&n.set(i.anchor,i.id);let r=/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/;return(i,o)=>{let s=i.target===""?o:n.get(i.target)??(r.test(i.target)?i.target.toUpperCase():null);return s===null?null:zi(e,i.metric,s)}}function Ss(e,t,n,r,i=1/0,o={}){let s=Rs(t,r),l=[],a={};for(let c of e){let u=[];n!==null&&c.overrides&&c.overrides.forEach((p,k)=>{oe(p.when)&&se(p.when,n,y=>s(y,c.id))&&u.push(k)});let h=n===null?null:c.gauge;if(!h){l.push({applied:u,gauge:null});continue}let f=zi(t,h.metric,h.of),m=o[Gi(c.id)];if(f!==null&&m!==void 0&&h.metric!=="depth"&&h.metric!=="inFlight"&&i<$i){let p=Math.max(0,i/$i),k=p*p*(3-2*p);f=m+(f-m)*k}f!==null&&(a[Gi(c.id)]=f),l.push({applied:u,gauge:{value:f}})}return{plan:l,readings:a}}function Zi(e,t,n,r,i,o=1/0,s={}){let{plan:l,readings:a}=Ss(e,t,n,r,o,s),c=[];return e.forEach((u,h)=>{for(let m of l[h].applied)u=He(ii(u.overrides[m]),u);let f=l[h].gauge;f&&u.gauge?c.push(...Os(u,u.gauge,f.value,r,i)):c.push(u)}),{elements:c,readings:a}}var Gi=e=>"gauge|"+e,$i=1,me=e=>{let t=parseInt(e.slice(1),16);return{r:(t>>16&255)/255,g:(t>>8&255)/255,b:(t&255)/255,a:1}},Ts=me("#16a34a"),As=me("#d97706"),Is=me("#dc2626"),Fs=me("#2f6fdf"),gr=me("#e5e7eb"),Cs=me("#9ca3af");function Ls(e,t){if(t===null||!Number.isFinite(t))return"\u2013";switch(e){case"load":case"backup":return yr(t*100,0)+"%";case"transit":case"delay":return yr(t,Math.abs(t)>=10?1:2)+"s";default:return yr(t,Math.abs(t)>=100?0:Math.abs(t)>=10?1:2)}}function yr(e,t){let n=t===0?1:t===1?10:100,r=Math.floor(Math.abs(e)*n+.5);if(!(r<1e15))return e<0?"-\u221E":"\u221E";let i=Math.trunc(r/n),o=r-i*n,s=String(i);if(t>0&&o>0){let l=String(o);for(;l.length<t;)l="0"+l;for(;l.endsWith("0");)l=l.slice(0,-1);s+="."+l}return(e<0&&r>0?"-":"")+s}function Os(e,t,n,r,i){let o=r.elements.find(x=>x.id===t.of),s=t.max??(t.metric==="load"?1:o?.capacity??n??1),l=n===null?0:s>0?Math.min(Math.max(n/s,0),1):0,a=t.warn??(t.metric==="load"?.7:null),c=t.alarm??(t.metric==="load"?.9:null),u=a===null&&c===null?Fs:Ts;n!==null&&a!==null&&n>=a&&(u=As),n!==null&&c!==null&&n>=c&&(u=Is),n===null&&(u=Cs);let h=t.label;if(h===null){let x=o?o.text!==null?o.text.split(`
|
|
4
|
+
`)[0]:o.anchor:null;h=`${t.metric} ${x??(i.some(w=>w.id===t.of)?"flow":"?")}`}let f=t.style??"number",m=Math.max(e.width,1),p=Math.max(e.height,1),k=(x,w)=>[x.x/m,x.y/p,(x.x+(w.x-x.x)/3)/m,(x.y+(w.y-x.y)/3)/p,(x.x+2*(w.x-x.x)/3)/m,(x.y+2*(w.y-x.y)/3)/p,w.x/m,w.y/p],y=(x,w,d,g)=>{let P=[{x,y:w},{x:x+d,y:w},{x:x+d,y:w+g},{x,y:w+g}],A=k(P[0],P[1]);for(let L=1;L<4;L++)A=A.concat(k(P[L],P[(L+1)%4]).slice(2));return{closed:!0,coords:A}},M=(x,w,d,g)=>{let P=Math.max(1,Math.ceil(Math.abs(g-d)/(Math.PI/2)-1e-9)),A=(g-d)/P,L=4/3*Math.tan(A/4),W=v=>({x:x.x+w*Math.cos(v),y:x.y+w*Math.sin(v)}),F=W(d),D=[F.x/m,F.y/p];for(let v=0;v<P;v++){let T=d+v*A,N=T+A,O=W(T),V=W(N),$={x:O.x-L*w*Math.sin(T),y:O.y+L*w*Math.cos(T)},_={x:V.x+L*w*Math.sin(N),y:V.y-L*w*Math.cos(N)};D.push($.x/m,$.y/p,_.x/m,_.y/p,V.x/m,V.y/p)}return{closed:!1,coords:D}},E=(x,w,d,g,P)=>({...Ui,id:Le(e.id,-(2**38)-x),kind:"path",layerID:e.layerID,x:e.x,y:e.y,width:e.width,height:e.height,style:ji(d,g??{r:0,g:0,b:0,a:0},P,"solid",e.style.opacity),subpaths:w}),b={...e,gauge:null,kind:"path",subpaths:[y(0,0,m,p)],text:h+`
|
|
5
|
+
`+Ls(t.metric,n),style:{...e.style}},S=[];if(f==="number")b.labelRect={x:0,y:0,width:1,height:1},b.style.textColor={...u};else if(f==="bar"){b.labelRect={x:0,y:0,width:1,height:.66};let x=Math.min(10,m*.08),w=Math.min(12,p*.18),d=p*.72,g=m-2*x;S.push(E(1,[y(x,d,g,w)],gr,gr,.5)),l>0&&S.push(E(2,[y(x,d,g*l,w)],u,u,.5))}else{b.labelRect={x:0,y:.54,width:1,height:.46};let x=Math.min(m*.38,p*.4),w={x:m/2,y:p*.5},d=Math.max(2,x*.16);S.push(E(1,[M(w,x,Math.PI,2*Math.PI)],gr,null,d)),l>0&&S.push(E(2,[M(w,x,Math.PI,Math.PI+Math.PI*l)],u,null,d));let g=Math.PI+Math.PI*l,P={x:w.x+x*.85*Math.cos(g),y:w.y+x*.85*Math.sin(g)};S.push(E(3,[{closed:!1,coords:k(w,P)}],{r:.2,g:.2,b:.2,a:1},null,2))}return[b,...S]}var Xi=(e,t,n)=>e.signed()*t*n;function Yt(e,t,n,r,i,o,s){let l=Math.hypot(t.x-e.x,t.y-e.y);if(!(l>.5))return;let a=l<200?1:l>500?.4:-.0016668*l+1.233334,c=l<20?l/10:2;for(let u=0;u<2;u++){let h=(u===0?1:.5)*a,f=()=>Xi(n,c,r)*h,m=n.unit()*.4+.3,p=Xi(n,l/60,r)*i*a,k=t.x-e.x,y=t.y-e.y,M=-y/l,E=k/l,b=o?e:{x:e.x+f(),y:e.y+f()},S=o?t:{x:t.x+f(),y:t.y+f()},x=e.x+k*m*.66+M*p+f()*.5,w=e.y+y*m*.66+E*p+f()*.5,d=e.x+k*(.5+m*.5)+M*p+f()*.5,g=e.y+y*(.5+m*.5)+E*p+f()*.5;s.moveTo(b),s.curveTo(S,{x,y:w},{x:d,y:g})}}function kr(e,t,n,r){let i=new K;for(let o=0;o<e.length;o++)Yt(e[o],e[(o+1)%e.length],t,n,r,!1,i);return i}function Ki(e,t,n){let r=new K,i=e.x+e.width/2,o=e.y+e.height/2,s=e.width/2,l=e.height/2;if(!(s>.5&&l>.5))return r;let a=Math.max(8,Math.min(24,Math.trunc((s+l)/6))),c=Math.min(2.5,(s+l)/25)*n;for(let u=0;u<2;u++){let h=t.unit()*2*Math.PI,f=2*Math.PI*(u===0?1:1.04),m=Math.trunc(a*f/(2*Math.PI))+1,p=[];for(let k=0;k<m;k++){let y=h+f*k/a,M=t.signed()*c,E=t.signed()*c;p.push({x:i+s*Math.cos(y)+M,y:o+l*Math.sin(y)+E})}Ds(p,r)}return r}function Ds(e,t){if(!(e.length<=2)){t.moveTo(e[0]);for(let n=0;n<e.length-1;n++){let r=e[Math.max(n-1,0)],i=e[n],o=e[n+1],s=e[Math.min(n+2,e.length-1)];t.curveTo(o,{x:i.x+(o.x-r.x)/6,y:i.y+(o.y-r.y)/6},{x:o.x-(s.x-i.x)/6,y:o.y-(s.y-i.y)/6})}}}var wr=-41*Math.PI/180;function Hi(e,t,n){if(!(n>0))return[];let r=Math.cos(t),i=Math.sin(t),o=e.filter(f=>f.length>=3).map(f=>f.map(m=>({x:m.x*r+m.y*i,y:-m.x*i+m.y*r}))),s=o.flat();if(s.length===0)return[];let l=1/0,a=-1/0;for(let f of s)l=Math.min(l,f.y),a=Math.max(a,f.y);let c=(f,m)=>({x:f*r-m*i,y:f*i+m*r}),u=[],h=l+n/2;for(;h<a;){let f=[];for(let m of o)for(let p=0;p<m.length;p++){let k=m[p],y=m[(p+1)%m.length];(k.y<=h&&h<y.y||y.y<=h&&h<k.y)&&f.push(k.x+(h-k.y)/(y.y-k.y)*(y.x-k.x))}f.sort((m,p)=>m-p);for(let m=0;m+1<f.length;m+=2)f[m+1]-f[m]>.5&&u.push([c(f[m],h),c(f[m+1],h)]);h+=n}return u}var Qi=2,Mr=.75,Vs=.8,_i=.6;function to(e,t){return[...qi(e,t,!1),...qi(e,t,!0)]}function qi(e,t,n){if(!(t>0))return[];let r=c=>n?{x:c.y,y:c.x}:c,i=e.filter(c=>c.length>=3).map(c=>c.map(r)),o=i.flat().map(c=>c.y);if(o.length===0)return[];let s=Math.min(...o),l=Math.max(...o),a=[];for(let c=Math.floor(s/t)*t;c<l-.5;c+=t){if(!(c>s+.5))continue;let u=[];for(let h of i)for(let f=0;f<h.length;f++){let m=h[f],p=h[(f+1)%h.length];(m.y<=c&&c<p.y||p.y<=c&&c<m.y)&&u.push(m.x+(c-m.y)/(p.y-m.y)*(p.x-m.x))}u.sort((h,f)=>h-f);for(let h=0;h+1<u.length;h+=2)u[h+1]-u[h]>.5&&a.push([r({x:u[h],y:c}),r({x:u[h+1],y:c})])}return a}function eo(e){return .2126*e.r+.7152*e.g+.0722*e.b>.5?{r:e.r*.84,g:e.g*.84,b:e.b*.8,a:e.a}:{r:e.r+(1-e.r)*.25,g:e.g+(1-e.g)*.25,b:e.b+(1-e.b)*.25,a:e.a}}function Pr(e){return e.style.fillStyle==="grid"&&e.style.fill.a>0&&["rectangle","ellipse","diamond","path"].includes(e.kind)}function mn(e,t,n){let r=(Math.imul(e,668265261)^Math.imul(t,374761393)^Math.imul(n,2654435761))>>>0;return r=Math.imul(r^r>>>15,2246822507)>>>0,r=Math.imul(r^r>>>13,3266489909)>>>0,r=(r^r>>>16)>>>0,r/4294967296}function no(e,t,n){let r=n/Qi;return{x:(e+.5+(mn(e,t,1)-.5)*_i)*r,y:(t+.5+(mn(e,t,2)-.5)*_i)*r}}function Ws(e,t,n,r){let i=1/0;for(let o=-1;o<=1;o++)for(let s=-1;s<=1;s++){if(o===0&&s===0)continue;let l=no(e+o,t+s,r);i=Math.min(i,Math.hypot(l.x-n.x,l.y-n.y))}return i*Vs}function Ns(e,t,n){let r=Math.cos(t),i=Math.sin(t),o=n*.8,s=n*.5;return[-1,0,1].map(l=>{let a=e.x-i*s*l,c=e.y+r*s*l;return[{x:a-r*o,y:c-i*o},{x:a+r*o,y:c+i*o}]})}function Ys(e,t){let n=!1;for(let r of e){if(r.length<3)continue;let i=r.length-1;for(let o=0;o<r.length;o++){let s=r[o],l=r[i];s.y>t.y!=l.y>t.y&&t.x<(l.x-s.x)*(t.y-s.y)/(l.y-s.y)+s.x&&(n=!n),i=o}}return n}function Gs(e,t){let n=1/0;for(let r of t)if(!(r.length<2))for(let i=0;i<r.length;i++){let o=r[i],s=r[(i+1)%r.length],l=s.x-o.x,a=s.y-o.y,c=l*l+a*a,u=c>0?Math.max(0,Math.min(1,((e.x-o.x)*l+(e.y-o.y)*a)/c)):0;n=Math.min(n,Math.hypot(e.x-(o.x+u*l),e.y-(o.y+u*a)))}return n}var $s=(e,t)=>t.x>=e.x&&t.x<e.x+e.width&&t.y>=e.y&&t.y<e.y+e.height,fn=new Map;function ro(e){if(e.length===0)return[];let t=e.map(i=>[i.kind,i.x,i.y,i.width,i.height,i.rotation??0,ee(i),JSON.stringify(i.subpaths??null),i.style.stroke.r,i.style.stroke.g,i.style.stroke.b,i.style.stroke.a,i.style.roughness,i.style.strokeWidth].join(",")).join(";"),n=fn.get(t);if(n)return n;let r=zs(e);return fn.size>=16&&fn.clear(),fn.set(t,r),r}function zs(e){let t=e.map(o=>{let s=vr(o).map(m=>m.map(p=>Ft(o,p))),l=s.flat(),a=l.map(m=>m.x),c=l.map(m=>m.y),u=a.length?Math.min(...a):0,h=c.length?Math.min(...c):0,f={x:u,y:h,width:(a.length?Math.max(...a):0)-u,height:(c.length?Math.max(...c):0)-h};return{contours:s,box:f,cell:ee(o),element:o}}),n=t.map(()=>[]),r=new Set;for(let o of t){let s=o.cell/Qi,l=he(o.box,-o.cell,-o.cell),a=Math.floor(l.x/s),c=Math.ceil((l.x+l.width)/s),u=Math.floor(l.y/s),h=Math.ceil((l.y+l.height)/s),f=Mr*o.cell;for(let m=a;m<c;m++)for(let p=u;p<h;p++){let k=`${o.cell}|${m}|${p}`;if(r.has(k))continue;r.add(k);let y=no(m,p,o.cell),M=1/0,E=-1;for(let w=0;w<t.length;w++){let d=t[w];if(!$s(he(d.box,-f,-f),y))continue;if(Ys(d.contours,y)){M=0;break}let g=Gs(y,d.contours);g<M&&(M=g,E=w)}if(!(M>0&&M<=f&&E>=0))continue;let b=mn(m,p,3)*Math.PI,S=Ws(m,p,y,o.cell),x=Math.trunc(mn(m,p,4)*4294967296)>>>0;for(let[w,d]of Ns(y,b,S))n[E].push([w,d,x])}}let i=[];return t.forEach((o,s)=>{if(n[s].length===0)return;let l=o.element,a=new K;for(let[c,u,h]of n[s])l.style.roughness<=0?a.moveTo(c).lineTo(u):Yt(c,u,new jt(h),l.style.roughness*.35,.2,!1,a);i.push({ink:{...l.style.stroke,a:l.style.stroke.a*.6},width:Math.max(.8,l.style.strokeWidth*.45),path:a})}),i}var dn=class{constructor(t=6e3){R(this,"map",new Map);R(this,"limit");this.limit=t}get(t,n){let r=this.map.get(t);if(r!==void 0)return r;let i=n();return this.map.size>=this.limit&&this.map.clear(),this.map.set(t,i),i}},ao=new dn,Bs=new dn;function uo(e,t){let n=e.style;return[t,e.kind,e.x,e.y,e.width,e.height,e.seed,n.roughness,n.bowing,n.strokeWidth,n.fillStyle,n.fillStyle==="grid"?ee(e):0,e.path?e.path.join(","):e.subpaths?JSON.stringify(e.subpaths):""].join("|")}var ee=e=>Math.max(8,e.style.gridSize??50);function ne(e){return e.kind==="freehand"&&e.path===null?io(e):ao.get(uo(e,0),()=>io(e))}function co(e){return[{x:e.x,y:e.y},{x:vt(e),y:e.y},{x:vt(e),y:Et(e)},{x:e.x,y:Et(e)}]}function pn(e){return[{x:Rt(e),y:e.y},{x:vt(e),y:St(e)},{x:Rt(e),y:Et(e)},{x:e.x,y:St(e)}]}function io(e){let t=st(e),n=new jt(e.seed),r=e.style.roughness;switch(e.kind){case"ellipse":return r<=0?K.ellipse(t):Ki(t,n,r);case"diamond":return r<=0?new K().addLines(pn(t)).close():kr(pn(t),n,r,e.style.bowing);case"text":case"connector":return K.rect(t);case"freehand":return js(e);case"path":return r<=0?Qn(e):Us(e,n);default:return r<=0?K.rect(t):kr(co(t),n,r,e.style.bowing)}}function Us(e,t){let n=e.style.roughness,r=new K;for(let i of fe(e)){let o=i.points;for(let s=0;s<(o.length-1)/3;s++){let l=o[3*s],a=o[3*s+1],c=o[3*s+2],u=o[3*s+3];if(a.x===l.x&&a.y===l.y&&c.x===u.x&&c.y===u.y){Yt(l,u,t,n,e.style.bowing,!0,r);continue}let h=Math.hypot(a.x-l.x,a.y-l.y)+Math.hypot(c.x-a.x,c.y-a.y)+Math.hypot(u.x-c.x,u.y-c.y),f=Math.min(2.5,h/30)*n;for(let m=0;m<2;m++){let p=m===0?1:.5,k=()=>t.signed()*f*p;r.moveTo(l);let y=a.x+k(),M=a.y+k(),E=c.x+k(),b=c.y+k();r.curveTo(u,{x:y,y:M},{x:E,y:b})}}}return r}function js(e){let t=st(e),n=e.path;if(n&&n.length>=8&&(n.length-2)%6===0){let o=l=>({x:t.x+n[2*l]*t.width,y:t.y+n[2*l+1]*t.height}),s=new K().moveTo(o(0));for(let l=0;l<Math.floor((n.length/2-1)/3);l++)s.curveTo(o(3*l+3),o(3*l+1),o(3*l+2));return s}let r=(e.points??[]).map(o=>({x:t.x+o.x*t.width,y:t.y+o.y*t.height})),i=new K;if(r.length===0)return i;if(i.moveTo(r[0]),r.length===1)return i.lineTo(r[0]);if(r.length===2)return i.lineTo(r[1]);for(let o=1;o<r.length-1;o++)i.quadTo({x:(r[o].x+r[o+1].x)/2,y:(r[o].y+r[o+1].y)/2},r[o]);return i.lineTo(r[r.length-1])}function vr(e){return e.kind!=="path"?[Zs(e)]:fe(e).map(t=>Pi(t.points,3))}function Zs(e){let t=st(e);if(e.kind==="ellipse"){let n=[];for(let r=0;r<48;r++){let i=2*Math.PI*r/48;n.push({x:Rt(t)+t.width/2*Math.cos(i),y:St(t)+t.height/2*Math.sin(i)})}return n}return e.kind==="diamond"?pn(t):co(t)}function gn(e){let t=st(e);return e.kind==="ellipse"?K.ellipse(t):e.kind==="path"?Qn(e):e.kind==="diamond"?new K().addLines(pn(t)).close():K.rect(t)}function Sr(e){return e.style.fillStyle==="solid"||["freehand","connector","text","image"].includes(e.kind)?new K:ao.get(uo(e,1),()=>Xs(e))}function Xs(e){let t=vr(e),n=new jt((e.seed^1540483477)>>>0),r=new K;if(e.style.fillStyle==="grid"){for(let[s,l]of to(t,ee(e)))e.style.roughness<=0?r.moveTo(s).lineTo(l):Yt(s,l,n,e.style.roughness*.3,.3,!1,r);return r}let i=Math.max(4,e.style.strokeWidth*4),o=[wr];e.style.fillStyle==="crossHatch"&&o.push(wr+Math.PI/2);for(let s of o)for(let[l,a]of Hi(t,s,i))e.style.roughness<=0?r.moveTo(l).lineTo(a):Yt(l,a,n,e.style.roughness*.6,.5,!1,r);return r}function yn(e,t){switch(e){case"solid":return null;case"dashed":return[Math.max(8,t*4),Math.max(6,t*3)];case"dotted":return[.01,Math.max(5,t*2.6)]}}function Tr(e,t,n){let r=e.connector;if(!r)return[new K,new K];let[i,o]=Vt(e,t),s=Nt(e,t),l=r.hops===!0&&n?Hs(e,s,n,t):[],a=[e.seed,e.style.roughness,e.style.bowing,e.style.strokeWidth,r.routing,r.startHead,r.endHead,r.start.port,r.end.port,i.x,i.y,o.x,o.y,JSON.stringify(r.waypoints),JSON.stringify(l)].join("|");return Bs.get(a,()=>Js(e,s,l))}function ho(e){return Math.max(8,e*4)}function fo(e){let t=e.points,n=[];if(e.kind==="polyline"){for(let r=0;r<t.length-1;r++)n.push([t[r],t[r+1]]);return n}for(let r=0;r<Math.floor((t.length-1)/3);r++){let i=t.slice(3*r,3*r+4),o=[];for(let s=0;s<=24;s++)o.push(Er(i,s/24));n.push(o)}return n}function mo(e){let t=[0];for(let n=1;n<e.length;n++)t.push(t[n-1]+Math.hypot(e[n].x-e[n-1].x,e[n].y-e[n-1].y));return t}function Er(e,t){let n=1-t;return{x:n*n*n*e[0].x+3*n*n*t*e[1].x+3*n*t*t*e[2].x+t*t*t*e[3].x,y:n*n*n*e[0].y+3*n*n*t*e[1].y+3*n*t*t*e[2].y+t*t*t*e[3].y}}function oo(e,t,n){let r=(o,s)=>{let l=(p,k)=>({x:p.x+(k.x-p.x)*s,y:p.y+(k.y-p.y)*s}),a=l(o[0],o[1]),c=l(o[1],o[2]),u=l(o[2],o[3]),h=l(a,c),f=l(c,u),m=l(h,f);return[[o[0],a,h,m],[m,f,u,o[3]]]},i=r(e,n)[0];return n>0?r(i,t/n)[1]:[e[0],e[0],e[0],e[0]]}function Rr(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let o of e)t=Math.min(t,o.x),n=Math.min(n,o.y),r=Math.max(r,o.x),i=Math.max(i,o.y);return{x0:t,y0:n,x1:r,y1:i}}function so(e,t){return e.x0<=t.x1+1e-6&&t.x0<=e.x1+1e-6&&e.y0<=t.y1+1e-6&&t.y0<=e.y1+1e-6}var lo=new WeakMap;function Ks(e,t,n){let r=lo.get(n);if(!r||r.layers!==t.layers||!ir(t,n)){let o=new Set(t.layers.filter(a=>a.visible).map(a=>a.id)),s=new Map,l=[];for(let a of Dt(t))s.has(a.id)||s.set(a.id,l.length),a.kind==="connector"&&o.has(a.layerID)&&l.push(a);r={layers:t.layers,first:s,under:l,lines:[]},ir(t,n)&&lo.set(n,r)}let i=r.first.get(e.id)??r.under.length;for(;r.lines.length<i;){let o=Wt(Nt(r.under[r.lines.length],n));r.lines.push({points:o,box:Rr(o)})}return{lines:r.lines,count:i}}function Hs(e,t,n,r){let i=fo(t);if(i.length===0)return[];let{lines:o,count:s}=Ks(e,n,r),l=ho(e.style.strokeWidth),a=[];for(let c of i){let u=mo(c),h=u[u.length-1],f=[],m=[],p=Rr(c);for(let y=0;y<s;y++)so(p,o[y].box)&&m.push(o[y]);for(let y=0;y<c.length-1;y++){let M=c[y],E=c[y+1],b=E.x-M.x,S=E.y-M.y,x=Rr([M,E]);for(let{points:w,box:d}of m)if(so(x,d))for(let g=0;g<w.length-1;g++){let P=w[g],A=w[g+1],L=A.x-P.x,W=A.y-P.y,F=b*W-S*L;if(Math.abs(F)<1e-9)continue;let D=P.x-M.x,v=P.y-M.y,T=(D*W-v*L)/F,N=(D*S-v*b)/F;T>0&&T<1&&N>=0&&N<=1&&f.push(u[y]+T*(u[y+1]-u[y]))}}let k=[];for(let y of f.sort((M,E)=>M-E))y<l+2||y>h-l-2||k.length>0&&y-k[k.length-1]<2*l+2||k.push(y);a.push(k)}return a}function Js(e,t,n){let r=e.connector,i=new jt(e.seed),o=e.style.roughness,s=e.style.bowing,l=new K,a=new K,c=o*3,u=()=>i.signed()*c,h=(M,E,b,S)=>{let x={x:b.y,y:-b.x};(x.y>1e-9||Math.abs(x.y)<=1e-9&&x.x>0)&&(x={x:-x.x,y:-x.y});let w=S*.5523,d={x:(M.x+E.x)/2,y:(M.y+E.y)/2},g={x:d.x+x.x*S,y:d.y+x.y*S};l.moveTo(M);let P=M.x+x.x*w+u(),A=M.y+x.y*w+u(),L=g.x-b.x*w+u(),W=g.y-b.y*w+u();l.curveTo(g,{x:P,y:A},{x:L,y:W});let F=g.x+b.x*w+u(),D=g.y+b.y*w+u(),v=E.x+x.x*w+u(),T=E.y+x.y*w+u();l.curveTo(E,{x:F,y:D},{x:v,y:T})},f=ho(e.style.strokeWidth);if(t.kind==="polyline"){let M=t.points,E=(b,S)=>{o<=0?l.moveTo(b).lineTo(S):Yt(b,S,i,o,s,!0,l)};for(let b=0;b<Math.max(M.length-1,0);b++){let S=M[b],x=M[b+1],w=Math.hypot(x.x-S.x,x.y-S.y),d=w>0?{x:(x.x-S.x)/w,y:(x.y-S.y)/w}:{x:0,y:0},g=A=>({x:S.x+d.x*A,y:S.y+d.y*A}),P=S;for(let A of b<n.length?n[b]:[]){let L=g(A-f),W=g(A+f);E(P,L),h(L,W,d,f),P=W}E(P,x)}}else{let M=t.points,E=fo(t);l.moveTo(M[0]);for(let b=0;b<Math.floor((M.length-1)/3);b++){let S=M[3*b+1],x=M[3*b+2],w=M[3*b+3],d=S.x+u(),g=S.y+u(),P=x.x+u(),A=x.y+u(),L=b<n.length?n[b]:[];if(L.length===0){l.curveTo(w,{x:d,y:g},{x:P,y:A});continue}let W=[M[3*b],{x:d,y:g},{x:P,y:A},w],F=mo(E[b]),D=N=>{let O=0;for(;O<F.length-2&&F[O+1]<N;)O++;let V=F[O+1]-F[O];return(O+(V>0?(N-F[O])/V:0))/24},v=0;for(let N of L){let O=D(N-f),V=D(N+f),$=oo(W,v,O);(b>0||v>0)&&l.moveTo($[0]),l.curveTo($[3],$[1],$[2]);let _=Er(W,O),Q=Er(W,V),j=Math.hypot(Q.x-_.x,Q.y-_.y),ct=j>0?{x:(Q.x-_.x)/j,y:(Q.y-_.y)/j}:{x:0,y:0};h(_,Q,ct,j/2),v=V}let T=oo(W,v,1);l.moveTo(T[0]).curveTo(T[3],T[1],T[2])}}let m=Wt(t),p=Math.max(10,e.style.strokeWidth*5),k=(M,E)=>{o<=0?l.moveTo(M).lineTo(E):Yt(M,E,i,o*.5,0,!0,l)},y=(M,E,b)=>{let[S,x]=Li(E,b,p);switch(M){case"arrow":k(S,E),k(x,E);break;case"triangle":k(S,E),k(x,E),k(S,x),a.moveTo(E).lineTo(S).lineTo(x).close();break;case"dot":{let w=p*.32,d=Math.atan2(E.y-b.y,E.x-b.x),g=E.x-w*Math.cos(d),P=E.y-w*Math.sin(d);a.addEllipse({x:g-w,y:P-w,width:2*w,height:2*w});break}case"bar":{let w=Math.atan2(E.y-b.y,E.x-b.x)+Math.PI/2,d=p*.5;k({x:E.x-d*Math.cos(w),y:E.y-d*Math.sin(w)},{x:E.x+d*Math.cos(w),y:E.y+d*Math.sin(w)});break}}};return m.length>1&&(y(r.endHead,m[m.length-1],m[m.length-2]),y(r.startHead,m[0],m[1])),[l,a]}function Fr(e,t){switch(e){case"linear":return t;case"easeIn":return t*t*t;case"easeOut":return 1-Math.pow(1-t,3);case"easeInOut":return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;case"hold":return 0;case"spring":return _s(t);case"bounce":return qs(t);case"elastic":return Qs(t)}}function _s(e){if(e<=0)return 0;if(e>=1)return 1;let t=n=>1-Math.exp(-6*n)*(Math.cos(3*Math.PI*n)+6/(3*Math.PI)*Math.sin(3*Math.PI*n));return t(e)+e*(1-t(1))}function qs(e){if(e<=0)return 0;if(e>=1)return 1;let t=7.5625,n=2.75;if(e<1/n)return t*e*e;if(e<2/n){let i=e-1.5/n;return t*i*i+.75}if(e<2.5/n){let i=e-2.25/n;return t*i*i+.9375}let r=e-2.625/n;return t*r*r+.984375}function Qs(e){return e<=0?0:e>=1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1}var Oe=(e,t)=>e%t;function De(e,t){let n=(e.repeats??[]).filter(_e).slice().sort((r,i)=>r.start-i.start);if(n.length===0)return t;for(let r of n){if(!(t>=r.end))continue;let i=r.end-r.start;if(r.count===null)return r.start+Oe(t-r.start,i);let o=i*r.count;if(t<r.start+o)return r.start+Oe(t-r.start,i);t-=o-i}return t}function Ar(e,t,n,r,i){t=De(e,t);let o,s;for(let u of e.keys)if(n(u)!==void 0)if(u.t<=t)o=u;else{s=u;break}if(!o&&!s)return r;if(o&&!s)return n(o);if(!o&&s)return n(s);let l=o,a=s,c=a.t-l.t>0?(t-l.t)/(a.t-l.t):1;return i(n(l),n(a),Fr(l.ease??"linear",c))}var tl=(e,t,n)=>e+(t-e)*n,bn=(e,t,n)=>Math.min(Math.max(e+(t-e)*n,0),1),po=(e,t,n)=>({r:bn(e.r,t.r,n),g:bn(e.g,t.g,n),b:bn(e.b,t.b,n),a:bn(e.a,t.a,n)});function Zt(e,t,n,r){return Ar(e,t,i=>i[n],r,tl)}function el(e,t){t=De(e,t);let n=(i,o)=>{let s;for(let a of e.keys)a.t<=t&&i(a)!==void 0&&(s=a);let l=e.keys.find(a=>a.t>t&&i(a)!==void 0);return!s||!l?!1:s.ease!=="hold"&&!o(i(s),i(l))},r=i=>n(o=>o[i],(o,s)=>o===s);return r("x")||r("y")||r("width")||r("height")||r("rotation")||r("strokeWidth")||n(i=>i.stroke,ae)||n(i=>i.fill,ae)||r("reveal")||r("opacity")}function Ir(e,t){t=De(e,t);let n=e.keys.filter(i=>i.visible!==void 0);if(n.length===0)return!0;let r;for(let i of n)i.t<=t&&(r=i);return r?r.visible:!n[0].visible}function nl(e,t,n){if(t=mt(t),e.keys.some(r=>r.reveal!==void 0)){let r=Zt(e,n,"reveal",t.reveal??1);t.reveal=r>=1?null:Math.max(0,r)}if(e.keys.some(r=>r.opacity!==void 0)){let r=Math.min(Math.max(Zt(e,n,"opacity",t.style.opacity??1),0),1);t.style.opacity=r>=1?null:r}return t.kind==="connector"||(t.x=Zt(e,n,"x",t.x),t.y=Zt(e,n,"y",t.y),t.width=Math.max(0,Zt(e,n,"width",t.width)),t.height=Math.max(0,Zt(e,n,"height",t.height)),e.keys.some(r=>r.rotation!==void 0)&&(t.rotation=Zt(e,n,"rotation",wt(t))),t.style.strokeWidth=Math.max(0,Zt(e,n,"strokeWidth",t.style.strokeWidth)),t.style.stroke=Ar(e,n,r=>r.stroke,t.style.stroke,po),t.style.fill=Ar(e,n,r=>r.fill,t.style.fill,po)),t}function rl(e,t){t=De(e,t);let n=null;for(let i of e.follow??[])i.start<=t&&(n===null||i.start>n.start)&&(n=i);if(!n)return null;let r=n;return e.keys.some(i=>i.t>=r.end&&i.t<=t&&(i.x!==void 0||i.y!==void 0))?null:n}function xr(e,t,n=Mt(t)){if(e.kind==="connector")return new Bt(Wt(Nt(e,n)));let r=mt(e);r.style.roughness=0;let i=ne(r).contours()[0]??[];return new Bt(wt(e)===0?i:i.map(o=>Ft(e,o)))}function il(e,t,n,r){let i=rl(e,n);if(!i)return t;n=De(e,n);let o=Mt(r),s=o.get(i.path);if(!s||s.id===t.id)return t;let l=xr(s,r,o),a=i.end-i.start,c=Math.min(Math.max(Fr(i.ease??"easeInOut",a>0?Math.min(1,(n-i.start)/a):1),0),1)*(i.laps??1);c>1&&(c=Oe(c,1)===0?1:Oe(c,1)),i.reverse===!0&&(c=1-c);let u=l.point(c),h=mt(t);if(h.x=u.x-t.width/2,h.y=u.y-t.height/2,i.orient===!0){let f=i.reverse===!0?-.01:.01,m=l.point(c-f/2),p=l.point(c+f/2);(m.x!==p.x||m.y!==p.y)&&(h.rotation=Math.atan2(p.y-m.y,p.x-m.x))}return h}function ol(e,t,n,r){if(!(n>0))return 0;let i=dt(e.duration);if(i>0){let s=Fe(t*i/n);s!==0&&(t=s*n/i)}let o=Oe(t*r,n);return o<0?-o:o===0?0:n-o}function sl(e){let t=new Map;for(let n of e.tracks)t.has(n.element)||t.set(n.element,n);return t}function Ct(e,t,n="initial",r=null,i={}){return Tt(de(e,t,n,r,i),dt(t))}var ll={fps:12,duration:0,boil:null,settle:null,poster:null,tracks:[],camera:null,markers:null};function de(e,t,n="initial",r=null,i={}){return Cr(e,t,n,r,i).frame}function Cr(e,t,n="initial",r=null,i={}){let o=ni(e,n),s=Vn(e,n),l=new Map;for(let d of e.elements){let g=ri(d,s);g.length>0&&l.set(d.id,g)}let c=(e.flows??[]).length>0||e.elements.some(d=>d.gauge||(d.overrides??[]).some(g=>oe(g.when))),u=s!==null&&Object.keys(s).length>0&&e.elements.some(d=>d.text?.includes("{")||(d.overrides??[]).some(g=>g.text?.includes("{"))),h=e.timeline??(o.size===0&&l.size===0&&!c&&!u?null:ll);if(!h)return{frame:e,metrics:hn()};t=dt(t);let f=sl(h);for(let[d,g]of l){let P=f.get(d);!P?.follow||!g.some(A=>A.reroute)||f.set(d,{...P,follow:P.follow.map(A=>{let L=A.path;for(let W of g)L=W.reroute?.[L]??L;return{...A,path:L}})})}let m=h.boil===null?null:Math.trunc(Math.floor(t*ue(h.fps)+1e-9)/Math.max(1,h.boil))%jn>>>0,p=new Set;for(let d of f.values())Ir(d,t)||p.add(d.element);for(let d of o)p.add(d);let k=null;if(h.settle===!0){k=new Set;for(let d of f.values())el(d,t)&&k.add(d.element)}let y=d=>{let g=f.get(d.id)?.boil;return g??(k?d.connector?[d.connector.start.elementID,d.connector.end.elementID].some(P=>P!==null&&k.has(P)):k.has(d.id):!0)},M=e.elements.map(d=>{let g=f.get(d.id),P=g?nl(g,d,t):d;for(let W of l.get(d.id)??[])P=He(W,P);if(u&&s&&P.text){let W=ei(P.text,s);W!==P.text&&(P={...P,text:W})}let A=l.get(d.id);if(A){let W=A.map(D=>D.capacity).filter(D=>D!==null&&Number.isFinite(D)),F=A.map(D=>D.delay).filter(D=>D!==null&&Number.isFinite(D));W.length>0&&(P.capacity=Math.max(Math.min(...W),0)),F.length>0&&P.kind!=="connector"&&(P.delay=Math.max(Math.max(...F),0))}m!==null&&m>0&&y(d)&&(P===d&&(P=mt(d)),P.seed=ln(d.seed,m));let L=g?.march!=null?yn(P.style.dash,P.style.strokeWidth):null;return g?.march!=null&&L&&(P===d&&(P=mt(d)),P.style.dashOffset=ol(h,g.march,L.reduce((W,F)=>W+F,0),t)),P});M=M.map((d,g)=>p.has(d.id)?e.elements[g]:d);let E={...e,elements:M,timeline:null};M=M.map(d=>{let g=f.get(d.id);return g?il(g,d,t,E):d});let b={...e,elements:M,timeline:null},S=Mt(b),x=new Set(p);M=M.map(d=>{let g=d.connector;if(!g||![g.start.elementID,g.end.elementID].some(W=>W!==null&&p.has(W)))return d;if(!(f.get(d.id)?.keys.some(W=>W.visible!==void 0)??!1)||[g.start.elementID,g.end.elementID].some(W=>W!==null&&o.has(W)))return x.add(d.id),d;let[P,A]=Vt(d,S),L=mt(d);return L.connector.start={elementID:null,port:g.start.port,x:P.x,y:P.y},L.connector.end={elementID:null,port:g.end.port,x:A.x,y:A.y},L}),M=M.filter(d=>!x.has(d.id));let w=hn();if(c){let d=new Set([...l].filter(([,L])=>L.some(W=>W.offline===!0)).map(([L])=>L)),g={...e,elements:M,timeline:null},P=Bi(e.flows,g,t,s,d,r,i);w=P.metrics;let A=Zi(M,P.metrics,s,g,e.flows??[],Math.max(0,Math.min(r??t,1e6)),i);Object.assign(w.carry,A.readings),M=[...A.elements,...P.packets]}return{frame:{...e,elements:M,timeline:null,flows:c?null:e.flows},metrics:w}}function Xt(e){return e.timeline?e.timeline.poster??e.timeline.duration:0}function yo(e){return e.timeline?Ct(e,Xt(e)):Tt(de(e,0),0)}function al(e,t){let n=e.camera??[];if(n.length===0)return null;let r;for(let l of n)l.t<=t&&(r=l);let i=n.find(l=>l.t>t);if(!r)return go(n[0]);if(!i)return go(r);let o=Fr(r.ease??"easeInOut",(t-r.t)/Math.max(i.t-r.t,1e-9)),s=(l,a)=>l+(a-l)*o;return{x:s(r.x,i.x),y:s(r.y,i.y),width:Math.max(1,s(r.width,i.width)),height:Math.max(1,s(r.height,i.height))}}var go=e=>({x:e.x,y:e.y,width:e.width,height:e.height});function pe(e,t){let n=e.camera?.[0],r=al(e,t);return!n||!r||!(r.width>0&&r.height>0)?null:ul(r,n.width/n.height)}function ul(e,t){if(!(e.width>0&&e.height>0&&t>0))return e;let n=e.width,r=e.height;return e.width/e.height<t?n=e.height*t:r=e.width/t,{x:e.x+e.width/2-n/2,y:e.y+e.height/2-r/2,width:n,height:r}}function cl(e){return Math.max(1,Math.ceil(dt(e.duration)*ue(e.fps)))}function ge(e){let t=ue(e.fps),n=[];for(let i=0;i<cl(e);i++)n.push(i/t);let r=n[n.length-1];return e.duration-r>1e-6&&n.push(e.duration),n}function bo(e,t){let n=-1;return(e.markers??[]).forEach((r,i)=>{r.t<=t&&(n=i)}),n}function xo(e){let t=e.timeline;if(!t)return new Set;let n=t.poster??t.duration;return new Set(t.tracks.filter(r=>!Ir(r,0)&&!Ir(r,n)).map(r=>r.element))}var hl=8,fl=2e4,Lr=1e-9;function xn(e,t){let n=(e.timeline?.markers??[]).find(r=>r.name.toLowerCase()===t);return n?Math.min(Math.max(n.t,0),dt(e.timeline?.duration??0)):null}function We(e,t){switch(t){case"up":return xn(e,"up")??0;case"over":return xn(e,"over")??We(e,"up");case"down":return xn(e,"down")??We(e,"over");default:return xn(e,"hit")}}function ml(e,t,n,r){let i=dt(e.timeline?.duration??0);if(e.button===!0)return We(e,"up")??0;let o=r!==null&&Number.isFinite(r)?r:0;switch(n??"loop"){case"still":return Math.min(e.timeline?.poster??i,i);case"click":return Math.min(Math.max(o,0),i);case"once":return Math.min(Math.max(t+o,0),i);default:{if(i<=0)return 0;let s=t+o,l=s%i;return l<0&&(l+=i),s>Lr&&(l<Lr||i-l<Lr)?i:l}}}function dl(e,t){let n=e.params;if(!n||Object.keys(n).length===0)return e;let r=new Map(Object.entries(n));for(let[o,s]of Object.entries(t??{}))r.has(o)&&r.set(o,s);let i=o=>o.includes("{{")?o.replace(/\{\{\s*([^{}]*?)\s*\}\}/g,(s,l)=>r.get(l)??s):o;return{...e,elements:e.elements.map(o=>{if(o.text===null&&o.args===null)return o;let s=mt(o);return s.text!==null&&(s.text=i(s.text)),s.args!==null&&(s.args=Object.fromEntries(Object.entries(s.args).map(([l,a])=>[l,i(a)]))),s})}}function pl(e){return{id:e.id,name:e.name,layers:e.layers,elements:e.elements,theme:null,timeline:e.timeline,symbols:null,variables:null,flows:null}}function wn(e){return e.elements.some(t=>t.kind==="symbol")}var kn=class{constructor(t,n,r){R(this,"page");R(this,"t");R(this,"posing");R(this,"made",new Map);this.page=t,this.t=n,this.posing=r}};function Tt(e,t,n=!0,r=new Map,i){if(!wn(e))return e;let o={left:fl},s=i&&i.page===e&&i.t===t&&i.posing===n?i:void 0;return{...e,elements:wo(e.elements,e,t,Vr(e),[],n,o,r,s)}}function Vr(e){let t=new Map;for(let n of e.symbols??[])t.has(n.id)||t.set(n.id,n);return t}function wo(e,t,n,r,i,o,s,l=new Map,a){let c=new Set(e.filter(f=>f.kind==="symbol").map(f=>f.id));if(c.size===0)return s.left-=e.length,e;let u=Mt(t),h=[];for(let f of e){if(s.left<=0)break;let m=f.connector;if(f.kind==="connector"&&m&&[m.start.elementID,m.end.elementID].some(A=>A!==null&&c.has(A))){let[A,L]=Vt(f,u),W=mt(f);m.start.elementID!==null&&c.has(m.start.elementID)&&(W.connector.start={elementID:null,port:m.start.port,x:A.x,y:A.y}),m.end.elementID!==null&&c.has(m.end.elementID)&&(W.connector.end={elementID:null,port:m.end.port,x:L.x,y:L.y}),h.push(W),s.left-=1;continue}if(f.kind!=="symbol"){h.push(f),s.left-=1;continue}let p=i.length===0?l.get(f.id):void 0,k=a?.made.get(f);if(k&&k.override===p&&k.after>0&&s.left-(k.before-k.after)>0){s.left-=k.before-k.after;for(let A of k.out)h.push(A);continue}let y=s.left,M=h.length;s.left-=1;let E=f.symbol,b=E===null?void 0:r.get(E);if(E===null||!b||i.includes(E)||i.length>=hl)continue;let S=i.length===0?l.get(f.id):void 0,x=S!==void 0?Math.min(Math.max(S,0),dt(b.timeline?.duration??0)):ml(b,n,f.playback,f.offset),w=pl(dl(b,f.args)),d=o?de(w,x):w,g=new Set(d.layers.filter(A=>A.visible).map(A=>A.id)),P={...d,elements:Dt(d).filter(A=>g.has(A.layerID)),layers:[{id:f.layerID,name:"",visible:!0,locked:!1}]};for(let A of wo(P.elements,P,x,r,[...i,E],o,s))h.push(gl(A,f,b));a&&i.length===0&&!k&&a.made.set(f,{override:p,before:y,after:s.left,out:h.slice(M)})}return h}function gl(e,t,n){let r={x:t.x,y:t.y,width:t.width,height:t.height},i=r.width/n.width,o=r.height/n.height,s=Math.sqrt(Math.abs(i*o)),l={x:r.x+r.width/2,y:r.y+r.height/2},a=wt(t),c=m=>Ut({x:r.x+m.x*i,y:r.y+m.y*o},l,a),u=mt(e);u.id=Dr(t.id,e.id),u.layerID=t.layerID,u.groupID=null,u.link=e.link===null?null:Dr(t.id,e.link),u.seed=ln(e.seed,t.seed),u.click=null,u.hover=null;let h={x:r.x+e.x*i,y:r.y+e.y*o,width:e.width*i,height:e.height*o},f=Ut({x:h.x+h.width/2,y:h.y+h.height/2},l,a);if(u.x=f.x-h.width/2,u.y=f.y-h.height/2,u.width=h.width,u.height=h.height,(a!==0||e.rotation!==null)&&(u.rotation=wt(e)+a),u.style.strokeWidth=e.style.strokeWidth*s,u.style.fontSize=e.style.fontSize*s,e.style.gridSize!==null&&(u.style.gridSize=e.style.gridSize*s),t.style.opacity!==null&&(u.style.opacity=(e.style.opacity??1)*t.style.opacity),e.connector){let m=p=>{if(p.elementID!==null)return{elementID:Dr(t.id,p.elementID),port:p.port,x:p.x,y:p.y};let k=c(p);return{elementID:null,port:p.port,x:k.x,y:k.y}};u.connector={...e.connector,start:m(e.connector.start),end:m(e.connector.end),waypoints:e.connector.waypoints?.map(c)??null}}return u}var Or=(1n<<64n)-1n;function Ve(e){let t=e+0x9e3779b97f4a7c15n⩔return t=(t^t>>30n)*0xbf58476d1ce4e5b9n&Or,t=(t^t>>27n)*0x94d049bb133111ebn&Or,t^t>>31n}function ko(e){let t=e.replace(/-/g,"").padStart(32,"0").slice(-32);return[BigInt(`0x${t.slice(0,16)}`),BigInt(`0x${t.slice(16)}`)]}function Dr(e,t){let[n,r]=ko(e),[i,o]=ko(t),s=Ve(Ve(Ve(Ve(n)^r)^i)^o),l=Ve(s^0x6a09e667f3bcc909n),a=s.toString(16).padStart(16,"0")+l.toString(16).padStart(16,"0");return`${a.slice(0,8)}-${a.slice(8,12)}-${a.slice(12,16)}-${a.slice(16,20)}-${a.slice(20)}`.toUpperCase()}function yl(e,t){let n=t.findIndex(r=>r.name===e);return n>=0?n:t.findIndex(r=>r.name.toLowerCase()===e.toLowerCase())}function Mo(e,t,n){let r=e.timeline?.markers??[],i=new Map,o=null;for(let s of e.elements){let l=s.click,a=l&&oi(l)?{...l.set?{set:l.set}:{},...l.toggle?{toggle:l.toggle}:{},...l.reset?{reset:!0}:{},...l.run?{run:l.run}:{}}:null;if(l?.scene){let h=yl(l.scene,r);if(h>=0){i.set(s.id,{scene:h,...a});continue}}let c=(l?.url?qt(l.url):null)??ve(s.url);if(c){i.set(s.id,{url:c,...a});continue}if(a){i.set(s.id,{state:!0,...a});continue}if(s.link&&t&&t.pages.length>1){o||(o=new Map,t.pages.forEach((f,m)=>{for(let p of f.elements)o.has(p.id)||o.set(p.id,m)}));let h=o.get(s.link);if(h!==void 0&&t.pages[h]!==e){i.set(s.id,{page:h});continue}}let u=s.link&&n&&Object.prototype.hasOwnProperty.call(n,s.link)?bl(n[s.link]):null;u&&i.set(s.id,{href:u})}return i}function bl(e){return typeof e=="string"&&/^[A-Za-z0-9._~%/-]+\.html(#[^\s:]*)?$/.test(e)&&!e.startsWith("//")?e:null}function xl(e){let t=e.hover;if(!t)return e;let n={...e.style};if(t.stroke&&(n.stroke=t.stroke),t.fill&&(n.fill=t.fill),t.opacity!==null&&Number.isFinite(t.opacity)){let r=Math.min(Math.max(t.opacity,0),1);n.opacity=r>=1?null:r}return{...e,style:n}}function Po(e,t){return{...e,elements:e.elements.map(n=>t.has(n.id)?xl(n):n)}}function vo(e){return!!e.hover&&(e.hover.stroke!==null||e.hover.fill!==null||e.hover.opacity!==null)}function Eo(e,t){let n=(e.text??"").split(`
|
|
6
|
+
`).find(r=>r.length>0);return n||(e.anchor?e.anchor:t||e.kind)}function Ro(e,t){let n=new Map;for(let r of e.elements){if(!t.has(r.id)||r.kind!=="symbol")continue;let i={...e,layers:[{id:r.layerID,name:"",visible:!0,locked:!1}],elements:[r]};for(let o of Tt(i,0,!1).elements)n.set(o.id,r.id)}return n}var So=`
|
|
7
7
|
.dottie-a { cursor: pointer; outline: none; }
|
|
8
8
|
.dottie-a .dottie-h { display: none; }
|
|
9
9
|
.dottie-a:hover .dottie-h, .dottie-a.dottie-hover .dottie-h, .dottie-a:focus-visible .dottie-h { display: inline; }
|
|
@@ -13,48 +13,48 @@
|
|
|
13
13
|
.dottie-a .dottie-d { display: none; }
|
|
14
14
|
.dottie-b:active .dottie-n, .dottie-b:active .dottie-h, .dottie-b.dottie-press .dottie-n, .dottie-b.dottie-press .dottie-h { display: none; }
|
|
15
15
|
.dottie-b:active .dottie-d, .dottie-b.dottie-press .dottie-d { display: inline; }
|
|
16
|
-
`;function pt(e){let t=n=>Math.round(Math.min(Math.max(n,0),1)*255).toString(16).padStart(2,"0");return`#${t(e.r)}${t(e.g)}${t(e.b)}`}function
|
|
16
|
+
`;function pt(e){let t=n=>Math.round(Math.min(Math.max(n,0),1)*255).toString(16).padStart(2,"0");return`#${t(e.r)}${t(e.g)}${t(e.b)}`}function Ne(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var To=12,re="\u2028";function kl(e){let t=Math.min(To,e.width/2),n=Math.min(To,e.height/2);return{x:e.x+t,y:e.y+n,width:e.width-2*t,height:e.height-2*n}}var Nr=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,Co=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,Yr=/^ {0,3}(`{3,}|~{3,})/,Ye=/^( *)([-*+]|\d{1,9}[.)])([ \t]+|$)(.*)$/,Mn=/^ {0,3}> ?(.*)$/,wl=/^ *\|? *:?-+:? *(\| *:?-+:? *)*\|? *$/;function Wr(e){let t=e.trim();return t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&!t.endsWith("\\|")&&(t=t.slice(0,-1)),t.split(/(?<!\\)\|/).map(n=>n.trim())}function Ml(e){return Br(e.replace(/\r\n?/g,`
|
|
17
17
|
`).split(`
|
|
18
18
|
`))}function Br(e){let t=[],n=0,r=null,i=()=>{r&&(t.push({kind:"paragraph",inline:At(r.join(`
|
|
19
|
-
`))}),r=null)};for(;n<e.length;){let o=e[n];if(o.trim()===""){i(),n++;continue}let s=
|
|
20
|
-
`)});continue}let l=
|
|
21
|
-
`))}),r=null,n++;continue}if(Co.test(o)){i(),t.push({kind:"rule"}),n++;continue}if(Mn.test(o)){i();let c=[];for(;n<e.length&&e[n].trim()!=="";){let u=Mn.exec(e[n]);c.push(u?u[1]:e[n]),n++}t.push({kind:"quote",children:Br(c)});continue}let a=
|
|
19
|
+
`))}),r=null)};for(;n<e.length;){let o=e[n];if(o.trim()===""){i(),n++;continue}let s=Yr.exec(o);if(s){i();let c=new RegExp(`^ {0,3}${s[1][0]==="`"?"`":"~"}{${s[1].length},}[ \\t]*$`),u=[];for(n++;n<e.length&&!c.test(e[n]);)u.push(e[n++]);n++,t.push({kind:"code",text:u.join(`
|
|
20
|
+
`)});continue}let l=Nr.exec(o);if(l){i(),t.push({kind:"heading",level:l[1].length,inline:At(l[2]??"")}),n++;continue}if(r&&/^ {0,3}(=+|-+)[ \t]*$/.test(o)){let c=o.trim()[0]==="="?1:2;t.push({kind:"heading",level:c,inline:At(r.join(`
|
|
21
|
+
`))}),r=null,n++;continue}if(Co.test(o)){i(),t.push({kind:"rule"}),n++;continue}if(Mn.test(o)){i();let c=[];for(;n<e.length&&e[n].trim()!=="";){let u=Mn.exec(e[n]);c.push(u?u[1]:e[n]),n++}t.push({kind:"quote",children:Br(c)});continue}let a=Ye.exec(o);if(a&&(!r||a[4].trim()!=="")){i();let c=Pl(e,n);t.push(c.block),n=c.next;continue}if(!r&&o.includes("|")&&n+1<e.length&&wl.test(e[n+1])&&e[n+1].includes("-")){let c=Wr(o),u=Wr(e[n+1]).map(f=>f.startsWith(":")&&f.endsWith(":")?"center":f.endsWith(":")?"right":f.startsWith(":")?"left":null),h=[];for(n+=2;n<e.length&&e[n].trim()!==""&&!Nr.test(e[n])&&!Mn.test(e[n])&&!Yr.test(e[n]);)h.push(Wr(e[n]).slice(0,c.length).map(f=>At(f))),n++;t.push({kind:"table",align:u,head:c.map(f=>At(f)),rows:h});continue}r||(r=[]),r.push(o.replace(/^ +/,"")),n++}return i(),t}function Pl(e,t){let n=Ye.exec(e[t]),r=n[1].length,i=/^\d/.test(n[2])?null:n[2],o=i===null?parseInt(n[2],10):null,s=[],l=t;for(;l<e.length;){let a=Ye.exec(e[l]);if(!a||a[1].length!==r||i===null!==/^\d/.test(a[2])||i!==null&&a[2]!==i)break;let c=a[1].length+a[2].length+Math.max(1,Math.min(a[3].length,4)),u=[a[4]];l++;let h=!1;for(;l<e.length;){let p=e[l];if(p.trim()===""){h=!0,u.push(""),l++;continue}if(p.length-p.trimStart().length>=c){u.push(p.slice(c)),h=!1,l++;continue}if(!h&&!Ye.test(p)&&!Nr.test(p)&&!Mn.test(p)&&!Yr.test(p)&&!Co.test(p)){u.push(p.trimStart()),l++;continue}break}for(;u.length&&u[u.length-1].trim()==="";)u.pop();let f=null,m=/^\[([ xX])\](?:[ \t]+|$)/.exec(u[0]??"");if(m&&(f=m[1]!==" ",u[0]=u[0].slice(m[0].length)),s.push({checkbox:f,children:Br(u)}),h&&l<e.length&&e[l-1]?.trim()===""){let p=Ye.exec(e[l]);if(!p||p[1].length!==r)break}}return{block:{kind:"list",ordered:o,items:s},next:l}}function At(e,t={}){let n=[],r=(l,a)=>{l&&n.push({...a,text:l})},i=0,o="",s=()=>{r(o,t),o=""};for(;i<e.length;){let l=e.slice(i),a;if(l[0]==="\\"&&/^\\[\\`*_{}[\]()#+\-.!|~>]/.test(l)){o+=l[1],i+=2;continue}if(l.startsWith(`\\
|
|
22
22
|
`)){for(o+=re,i+=2;e[i]===" ";)i++;continue}if(l[0]===`
|
|
23
|
-
`){for(o=o.replace(/ +$/,""),o+=re,i++;e[i]===" ";)i++;continue}if(a=/^(`+)([\s\S]*?[^`])\1(?!`)/.exec(l)){s();let c=a[2].replace(/\n/g," ");/^ .* $/.test(c)&&(c=c.slice(1,-1)),r(c,{...t,mono:!0}),i+=a[0].length;continue}if(a=/^!\[([^\]]*)\]\([^)]*\)/.exec(l)){s(),n.push(...At(a[1],t)),i+=a[0].length;continue}if(a=/^\[([^\]]+)\]\([^)]*\)/.exec(l)){s(),n.push(...At(a[1],{...t,link:!0})),i+=a[0].length;continue}if(a=/^<((?:https?|ftp|mailto):[^>\s]+)>/.exec(l)){s(),r(a[1],{...t,link:!0}),i+=a[0].length;continue}if(a=/^~~(?=\S)([\s\S]*?\S)~~/.exec(l)){s(),n.push(...At(a[1],{...t,strike:!0})),i+=a[0].length;continue}if(a=/^(\*\*\*|___)(?=\S)([\s\S]*?\S)\1(?!\*|_)/.exec(l)){s(),n.push(...At(a[2],{...t,bold:!0,italic:!0})),i+=a[0].length;continue}if(a=/^(\*\*|__)(?=\S)([\s\S]*?\S)\1/.exec(l)){let c=a[2],u=a[0].length;a[1]==="**"&&l[u]==="*"&&(c.replace(/\*\*/g,"").match(/\*/g)??[]).length%2===1&&(c+="*",u++),s(),n.push(...At(c,{...t,bold:!0})),i+=u;continue}if((a=/^(\*|_)(?=\S)([\s\S]*?\S)\1(?!\1)/.exec(l))&&(a[1]==="*"||!/\w/.test(e[i-1]??""))){s(),n.push(...At(a[2],{...t,italic:!0})),i+=a[0].length;continue}o+=l[0],i++}return s(),
|
|
23
|
+
`){for(o=o.replace(/ +$/,""),o+=re,i++;e[i]===" ";)i++;continue}if(a=/^(`+)([\s\S]*?[^`])\1(?!`)/.exec(l)){s();let c=a[2].replace(/\n/g," ");/^ .* $/.test(c)&&(c=c.slice(1,-1)),r(c,{...t,mono:!0}),i+=a[0].length;continue}if(a=/^!\[([^\]]*)\]\([^)]*\)/.exec(l)){s(),n.push(...At(a[1],t)),i+=a[0].length;continue}if(a=/^\[([^\]]+)\]\([^)]*\)/.exec(l)){s(),n.push(...At(a[1],{...t,link:!0})),i+=a[0].length;continue}if(a=/^<((?:https?|ftp|mailto):[^>\s]+)>/.exec(l)){s(),r(a[1],{...t,link:!0}),i+=a[0].length;continue}if(a=/^~~(?=\S)([\s\S]*?\S)~~/.exec(l)){s(),n.push(...At(a[1],{...t,strike:!0})),i+=a[0].length;continue}if(a=/^(\*\*\*|___)(?=\S)([\s\S]*?\S)\1(?!\*|_)/.exec(l)){s(),n.push(...At(a[2],{...t,bold:!0,italic:!0})),i+=a[0].length;continue}if(a=/^(\*\*|__)(?=\S)([\s\S]*?\S)\1/.exec(l)){let c=a[2],u=a[0].length;a[1]==="**"&&l[u]==="*"&&(c.replace(/\*\*/g,"").match(/\*/g)??[]).length%2===1&&(c+="*",u++),s(),n.push(...At(c,{...t,bold:!0})),i+=u;continue}if((a=/^(\*|_)(?=\S)([\s\S]*?\S)\1(?!\1)/.exec(l))&&(a[1]==="*"||!/\w/.test(e[i-1]??""))){s(),n.push(...At(a[2],{...t,italic:!0})),i+=a[0].length;continue}o+=l[0],i++}return s(),vl(n)}function vl(e){let t=/\b(?:(?:https?|ftp):\/\/|www\.)[^\s<]*[^\s<.,:;"')\]!?]/g;return e.flatMap(n=>{if(n.link||n.mono||!(n.text.includes("://")||n.text.includes("www.")))return[n];let r=[],i=0;for(let o of n.text.matchAll(t))o.index>i&&r.push({...n,text:n.text.slice(i,o.index)}),r.push({...n,text:o[0],link:!0}),i=o.index+o[0].length;return i<n.text.length&&r.push({...n,text:n.text.slice(i)}),r})}function vn(e,t){return e.mono?Qt[qe]:t}function Pn(e,t,n){let r=vn(t,n);if(t.mono&&r.fallback[e]===void 0)return pi*t.size;let i=r.faces[Ie(r,t.bold,t.italic)];return(i.w[e]??r.faces.regular.w[e]??i.w.n)*t.size/1e3}function Gr(e,t,n,r){return n.mono?0:(r.faces[Ie(r,n.bold,n.italic)].k[e+t]??0)*n.size/1e3}function $r(e,t,n){let r=vn(t,n).fallback[e];if(r)return[r[0]*t.size,r[1]*t.size,r[2]*t.size];if(t.mono)return[gi*t.size,yi*t.size,0];let i=n.faces[Ie(n,t.bold,t.italic)];return[i.ascent*t.size,i.descent*t.size,i.leading*t.size]}var zr=class{constructor(t,n,r){R(this,"paras",[]);R(this,"nextSpacing",null);R(this,"fontSize");R(this,"width");R(this,"fam");this.fontSize=t,this.width=n,this.fam=r}get gap(){return this.fontSize*.5}spacing(t){return this.paras.length===0?0:this.nextSpacing??t}run(t,n,r,i={}){let o=!!t.mono;return{text:t.text,size:o?n*.9:n,bold:!!(t.bold||i.bold),italic:!!(t.italic||i.italic),mono:o,strike:!!t.strike,underline:!!t.link,alpha:r}}paragraph(t,n){this.paras.push({tabs:[],rule:null,tableRule:null,...t,quote:n}),this.nextSpacing=null}text(t,n,r,i={}){if(n.marker){let o={text:n.marker.text+" ",size:this.fontSize,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1};this.paragraph({runs:[o,...t],spacing:r,firstIndent:n.marker.start,indent:n.marker.hang,tabs:[{align:"left",x:n.marker.hang}],...i},n.quote)}else this.paragraph({runs:t,spacing:r,firstIndent:n.indent,indent:n.indent,...i},n.quote)}block(t,n){let r=n.quote!==null,i=r?.7:1;switch(t.kind){case"heading":{let o=[1.5,1.3,1.15,1.05,1,1][Math.min(Math.max(t.level,1),6)-1];this.text(t.inline.map(s=>this.run(s,this.fontSize*o,i,{bold:!0,italic:r})),n,this.spacing(this.gap*1.4));break}case"paragraph":this.text(t.inline.map(o=>this.run(o,this.fontSize,i,{italic:r})),n,this.spacing(this.gap));break;case"list":{let o=t.items.map((c,u)=>c.checkbox===!0?"\u2611":c.checkbox===!1?"\u2610":t.ordered!==null?`${t.ordered+u}.`:n.listDepth%2===0?"\u2022":"\u25E6"),s=c=>Ao({text:c,size:this.fontSize,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1},this.fam),l=Math.max(0,...o.map(s)),a=n.indent+Math.max(l+this.fontSize*.45,this.fontSize*1.2);t.items.forEach((c,u)=>{(u>0||n.listDepth>0||n.marker)&&(this.nextSpacing=this.fontSize*.15);let h={...n,marker:{text:o[u],start:n.indent,hang:a},indent:a,listDepth:n.listDepth+1};c.children.length===0&&this.text([],h,this.spacing(this.gap));for(let f of c.children)this.block(f,h),h.marker=null,this.nextSpacing=this.fontSize*.3;this.nextSpacing=null});break}case"quote":{let o={...n,quote:n.indent+3,indent:n.indent+this.fontSize};for(let s of t.children)this.block(s,o);break}case"code":{let s={text:t.text===""?" ":t.text.replace(/\n/g,re),size:this.fontSize*.85,bold:!1,italic:!1,mono:!0,strike:!1,underline:!1,alpha:i};this.text([s],{...n,indent:n.indent+this.fontSize*.5},this.spacing(this.gap));break}case"rule":{let o={text:" ",size:this.fontSize*.6,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1};this.text([o],n,this.spacing(this.gap),{rule:n.indent});break}case"table":this.table(t,n);break}}table(t,n){let r=[{cells:t.head,header:!0},...t.rows.map(b=>({cells:b,header:!1}))],i=Math.max(1,...r.map(b=>b.cells.length)),o=n.quote!==null,s=(b,S,x)=>b.map(w=>({...this.run({...w,text:w.text.replaceAll(re," ")},x,o?.7:1,{bold:S,italic:o})})),l=b=>{let S=new Array(i).fill(0);for(let x of r)x.cells.forEach((w,d)=>{d<i&&(S[d]=Math.max(S[d],s(w,x.header,b).reduce((g,P)=>g+Ao(P,this.fam),0)))});return S},a=Math.max(this.width-n.indent,1),c=this.fontSize,u=l(c),h=c*1.2,f=u.reduce((b,S)=>b+S,0)+h*(i-1);f>a&&(c=Math.max(this.fontSize*a/f,Math.min(this.fontSize,9)),u=l(c),h=c*1.2);let m=[],p=n.indent;for(let b of u)m.push(p),p+=b+h;let k=p-h-n.indent,y=[],M=!1;for(let b=0;b<i;b++){let S=t.align[b]??null;S==="center"?y.push({align:"center",x:m[b]+u[b]/2}):S==="right"?y.push({align:"right",x:m[b]+u[b]}):b>0&&y.push({align:"left",x:m[b]}),b===0&&(S==="center"||S==="right")&&(M=!0)}let E=b=>({text:b,size:c,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1});r.forEach((b,S)=>{let x=[];M&&x.push(E(" "));for(let d=0;d<i;d++)d>0&&x.push(E(" ")),d<b.cells.length&&x.push(...s(b.cells[d],b.header,c));x.length===0&&x.push(E(" "));let w=S===0?this.spacing(this.gap):S===1?c*.45:c*.2;this.paragraph({runs:x,spacing:w,firstIndent:n.indent,indent:n.indent,tabs:y,tableRule:b.header?[n.indent,k]:null},n.quote)})}};function Ao(e,t){let n=0,r="";for(let i of e.text)n+=Pn(i,e,t),r&&(n+=Gr(r,i,e,t)),r=i;return n}var Io=28;function El(e,t,n,r,i){let o=[],s=0,l=null;return e.forEach((a,c)=>{let u=c<e.length-1?[...a.runs,{text:`
|
|
24
24
|
`,size:r,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1}]:a.runs,h=[];u.forEach((p,k)=>{for(let y of p.text)h.push({ch:y,run:k})});let f=0,m=!0;for(;f<h.length||m&&h.length===0;){let p=m?a.firstIndent:a.indent,k=t,y=[],M=p,E=-1,b=f;for(;b<h.length;b++){let{ch:g,run:P}=h[b],A=u[P];if(g===re||g===`
|
|
25
|
-
`){y.push({ch:g,run:P,x:M,w:0}),b++;break}if(g===" "){let D=a.tabs.find(
|
|
26
|
-
`&&h[O].ch!==re;O++){let V=u[h[O].run];
|
|
27
|
-
`,"").replaceAll(re,"");if(b.trim()!==""){let
|
|
25
|
+
`){y.push({ch:g,run:P,x:M,w:0}),b++;break}if(g===" "){let D=a.tabs.find(T=>T.x>M+.01),v;if(D)if(D.align==="left")v=D.x;else{let T=0,N="";for(let O=b+1;O<h.length&&h[O].ch!==" "&&h[O].ch!==`
|
|
26
|
+
`&&h[O].ch!==re;O++){let V=u[h[O].run];T+=Pn(h[O].ch,V,i)+(N?Gr(N,h[O].ch,V,i):0),N=h[O].ch}v=Math.max(M,D.align==="right"?D.x-T:D.x-T/2)}else v=(Math.floor(M/Io)+1)*Io;y.push({ch:g,run:P,x:M,w:v-M}),M=v;continue}let L=y[y.length-1],W=L&&L.run===P&&L.ch!==" "?Gr(L.ch,g,A,i):0;L&&(L.w+=W,M+=W);let F=Pn(g,A,i);if(g!==" "&&M+F>k+.01&&y.some(D=>D.ch!==" ")){E>=0&&(y.length=E+1,b=f+E+1),L&&(L.w-=W);break}y.push({ch:g,run:P,x:M,w:F}),M+=F,Xn(g,h[b+1]?.ch??"")&&(E=y.length-1)}if(y.length===0&&b===f&&f<h.length){let{ch:g,run:P}=h[f];y.push({ch:g,run:P,x:p,w:Pn(g,u[P],i)}),b=f+1}let S=0,x=0,w=0;for(let g of y){let[P,A,L]=$r(g.ch,u[g.run],i);S=Math.max(S,P),x=Math.max(x,A),w=Math.max(w,L)}if(y.length===0&&([S,x,w]=$r(" ",u[0]??{text:" ",size:r,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1},i)),s=l?s+Math.round(l.desc)+Math.round(l.lead)+(m?a.spacing:0)+Math.round(S):Math.round(S),s+x>n+.5)return;let d={glyphs:y,asc:S,desc:x,lead:w,baseline:s,para:a,first:m};if(d.glyphs.forEach(g=>{g.r=u[g.run]}),o.push(d),l=d,m=!1,f=b,h.length===0)break}}),o}var En=class{constructor(t){R(this,"map",new Map);R(this,"limit");this.limit=t}get(t,n){let r=this.map.get(t);if(r!==void 0)return r;let i=n();return this.map.size>=this.limit&&this.map.clear(),this.map.set(t,i),i}},Rl=new En(500),Sl=new En(500);function Lo(e,t){let n=t.style,r=n.stroke,i=JSON.stringify([...[t.x,t.y,t.width,t.height,n.fontSize,r.r,r.g,r.b,r.a].map(String),n.font??"",e]);return Sl.get(i,()=>Tl(e,t))}function Tl(e,t){let n=kl({x:t.x,y:t.y,width:t.width,height:t.height});if(!(n.width>1&&n.height>1))return"";let r=Ae(t.style.font),i=JSON.stringify([...[n.width,n.height,t.style.fontSize].map(String),t.style.font??"",e]),o=Rl.get(i,()=>{let u=new zr(t.style.fontSize,n.width,r);for(let h of Ml(e))u.block(h,{indent:0,marker:null,quote:null,listDepth:0});return El(u.paras,n.width,n.height,t.style.fontSize,r)}),s=pt(t.style.stroke),l="",a=[];for(let u of o){let h=u.para;if(h.quote!==null&&a.push([n.x+h.quote,n.y+u.baseline-u.asc,n.x+h.quote,n.y+u.baseline+u.desc]),h.rule!==null&&a.push([n.x+h.rule,n.y+u.baseline-3,n.x+n.width,n.y+u.baseline-3]),h.tableRule){let k=n.y+u.baseline+u.desc+2;a.push([n.x+h.tableRule[0],k,Math.min(n.x+n.width,n.x+h.tableRule[0]+h.tableRule[1]),k])}let f="",m=0,p=u.glyphs;for(;m<p.length;){let k=p[m].r,y=m,M="",E=Fo(p[m].ch,vn(k,r));for(;y<p.length&&Al(p[y].r,k)&&p[y].ch!==" "&&Fo(p[y].ch,vn(k,r))===E;)M+=p[y].ch,y++;let b=M.replaceAll(`
|
|
27
|
+
`,"").replaceAll(re,"");if(b.trim()!==""){let S=`font-size="${I(k.size)}"`;k.mono&&(S+=' font-family="Menlo, Consolas, monospace"');let x=k.mono?"regular":Ie(r,k.bold,k.italic);(k.mono?k.bold:x==="bold"||x==="boldItalic")&&(S+=' font-weight="bold"'),(k.mono?k.italic:x==="italic"||x==="boldItalic")&&(S+=' font-style="italic"'),k.underline&&(S+=' text-decoration="underline"'),k.alpha<1&&(S+=` fill-opacity="${I(k.alpha*t.style.stroke.a)}"`),f+=`<tspan x="${I(n.x+p[m].x)}" ${S}>${Ne(b)}</tspan>`}if(k.strike&&y>m){let S=u.baseline-$r(p[m].ch,k,r)[0]*.32;a.push([n.x+p[m].x,n.y+S,n.x+p[y-1].x+p[y-1].w,n.y+S])}y===m&&y++,m=y}f&&(l+=`<text y="${I(n.y+u.baseline)}" font-family="${Qe(t.style.font)}" fill="${s}" xml:space="preserve">${f}</text>
|
|
28
28
|
`)}let c=I(Math.max(1,t.style.fontSize/14));for(let[u,h,f,m]of a)l+=`<line x1="${I(u)}" y1="${I(h)}" x2="${I(f)}" y2="${I(m)}" stroke="${s}" stroke-width="${c}"/>
|
|
29
|
-
`;return l}function Fo(e,t){return t.fallback[e]?`fb:${e}`:""}function
|
|
29
|
+
`;return l}function Fo(e,t){return t.fallback[e]?`fb:${e}`:""}function Al(e,t){return e===t||e.size===t.size&&e.bold===t.bold&&e.italic===t.italic&&e.mono===t.mono&&e.strike===t.strike&&e.underline===t.underline&&e.alpha===t.alpha}function Gt(e,t=24){if(wn(e))return Gt(Tt(e,0),t);let n=Mt(e),r=s=>{if(s.kind==="connector")return Oi(s,n);let l=Pr(s)?(Mr+.25)*ee(s):0;return he(nn(s),-l,-l)};if(e.elements.length===0)return{x:0,y:0,width:200,height:200};let i=e.elements.filter(s=>(s.style.opacity??1)>0),o=null;for(let s of i.length?i:e.elements)o=_n(o,r(s));return he(o,-t,-t)}function Kt(e){let t=Sn.get(e);if(t&&Tn(e,t.fields))return t.plan;let n=Il(e);return Sn.set(e,{fields:{...e},plan:n}),n}var Sn=new WeakMap;function Oo(e){let t=Sn.get(e);return!!t&&Tn(e,t.fields)}function Do(e,t){Sn.set(e,{fields:{...e},plan:t})}function Tn(e,t){let n=e,r=t,i=Object.keys(n);return i.length===Object.keys(r).length&&i.every(o=>n[o]===r[o])}function Il(e){let t=e.timeline??{fps:12,duration:0,boil:null,settle:null,poster:null,tracks:[],camera:null,markers:null},n=ge(t),r=t.camera?.find(o=>o.width>1&&o.height>1);if(r){let o=r.width/r.height,s=n.map(a=>pe(t,a)??{x:r.x,y:r.y,width:r.width,height:r.height}),l=Math.min(Math.max(...s.map(a=>a.width)),4096);return{times:n,rects:s,size:{width:l,height:l/o}}}let i=null;for(let o of n){let s=Ct(e,o);s.elements.length>0&&(i=_n(i,Gt(s)))}return i||(i=Gt(Ct(e,n[0]))),{times:n,rects:n.map(()=>i),size:{width:i.width,height:i.height}}}var Ge=(e,t)=>e.a<1?` ${t}="${I(e.a)}"`:"";function Fl(e,t,n){let r=`<svg xmlns="http://www.w3.org/2000/svg" width="${I(e.width)}" height="${I(e.height)}" viewBox="${I(e.x)} ${I(e.y)} ${I(e.width)} ${I(e.height)}">
|
|
30
30
|
`;return n&&t&&(r+=`<rect x="${I(e.x)}" y="${I(e.y)}" width="${I(e.width)}" height="${I(e.height)}" fill="${pt(t)}"/>
|
|
31
|
-
`),r}function Ht(e,t,n,r=!1,i){if(wn(e))return Ht(
|
|
32
|
-
`).join("");k&&h.push({key:"rock",markup:k});for(let y of m){if(!u.has(y.layerID)||i&&!i(y.id))continue;let M=Math.min(Math.max(y.style.opacity??1,0),1);if(M<=0)continue;let E=
|
|
31
|
+
`),r}function Ht(e,t,n,r=!1,i){if(wn(e))return Ht(Tt(e,0),t,n,r,i);let o=zt(e),s=t?o?.background??t:null,l=o?.ink??_t,a={...e,elements:e.elements.map(y=>Ei(y,l))},c=n??Gt(a),u=new Set(a.layers.filter(y=>y.visible).map(y=>y.id)),h=[],f=Mt(a),m=Dt(a),p=m.filter(y=>u.has(y.layerID)&&Pr(y)),k=i&&!i("rock")?"":ro(p).map(y=>`<path d="${y.path.data()}" fill="none" stroke="${pt(y.ink)}"${Ge(y.ink,"stroke-opacity")} stroke-width="${I(y.width)}" stroke-linecap="round"/>
|
|
32
|
+
`).join("");k&&h.push({key:"rock",markup:k});for(let y of m){if(!u.has(y.layerID)||i&&!i(y.id))continue;let M=Math.min(Math.max(y.style.opacity??1,0),1);if(M<=0)continue;let E=Dl(y,f,s,a);wt(y)!==0&&y.kind!=="connector"&&(E=`<g transform="rotate(${I(wt(y)*180/Math.PI)} ${I(Rt(st(y)))} ${I(St(st(y)))})">
|
|
33
33
|
${E}</g>
|
|
34
34
|
`),M<1&&(E=`<g opacity="${I(M)}">
|
|
35
35
|
${E}</g>
|
|
36
|
-
`);let b=r?(y.click?.url?qt(y.click.url):null)??ve(y.url):null;b&&(E=`<a href="${
|
|
36
|
+
`);let b=r?(y.click?.url?qt(y.click.url):null)??ve(y.url):null;b&&(E=`<a href="${Ne(b).replace(/"/g,""")}" target="_blank">
|
|
37
37
|
${E}</a>
|
|
38
|
-
`),h.push({key:y.id,markup:E})}return{bounds:c,parts:h}}function An(e,t={r:1,g:1,b:1,a:1},n){let{bounds:r,parts:i}=Ht(e,t,n,!0);return
|
|
39
|
-
`}function
|
|
38
|
+
`),h.push({key:y.id,markup:E})}return{bounds:c,parts:h}}function An(e,t={r:1,g:1,b:1,a:1},n){let{bounds:r,parts:i}=Ht(e,t,n,!0);return Fl(r,zt(e)?.background??t,t!==null)+i.map(o=>o.markup).join("")+`</svg>
|
|
39
|
+
`}function Cl(e,t){let n=Di(e,t),r=e.text??"",i=xi(r===""?"Label":r,e.style.fontSize,200,e.style.font),o=Math.max(i.width+12,44),s=i.height+6;return{x:n.x-o/2,y:n.y-s/2,width:o,height:s}}function Ll(e,t){let n=[...e];return n.slice(0,Math.floor(n.length*t)).join("")}function Ol(e){return e.reveal!==null&&e.reveal<1?Math.max(0,e.reveal):null}function Dl(e,t,n,r){let i=pt(e.style.stroke),o=`stroke="${i}" stroke-width="${I(e.style.strokeWidth)}" stroke-linecap="round" stroke-linejoin="round"`,s=yn(e.style.dash,e.style.strokeWidth);s&&(o+=` stroke-dasharray="${s.map(I).join(" ")}"`),s&&e.style.dashOffset!==null&&I(e.style.dashOffset)!=="0"&&(o+=` stroke-dashoffset="${I(e.style.dashOffset)}"`);let l=e.text,a=Ol(e);if(a!==null)if(e.kind==="text")l=Ll(l??"",a);else return e.kind==="connector"?`<path d="${Tr(e,t,r)[0].trimmed(a).data()}" fill="none" ${o}/>
|
|
40
40
|
`:`<path d="${ne(e).trimmed(a).data()}" fill="none" ${o}/>
|
|
41
|
-
`;switch(e.kind){case"connector":{let[c,u]=
|
|
41
|
+
`;switch(e.kind){case"connector":{let[c,u]=Tr(e,t,r),h=`<path d="${c.data()}" fill="none" ${o}/>
|
|
42
42
|
`;if(u.isEmpty||(h+=`<path d="${u.data()}" fill="${i}" stroke="none"/>
|
|
43
|
-
`),l){let f=
|
|
43
|
+
`),l){let f=Cl(e,t);n&&(h+=`<rect x="${I(f.x)}" y="${I(f.y)}" width="${I(f.width)}" height="${I(f.height)}" fill="${pt(n)}"/>
|
|
44
44
|
`),h+=Rn(l,f,e,!0)}return h}case"text":return Rn(l??"",st(e),e,!1);case"image":{let c=st(e),u="";if(e.image){let h=e.image.format==="jpeg"?"image/jpeg":"image/png";u+=`<image x="${I(c.x)}" y="${I(c.y)}" width="${I(c.width)}" height="${I(c.height)}" preserveAspectRatio="none" href="data:${h};base64,${e.image.data}"/>
|
|
45
45
|
`}return e.style.stroke.a>0&&e.style.strokeWidth>0&&(u+=`<path d="${ne(e).data()}" fill="none" ${o}/>
|
|
46
46
|
`),u}case"freehand":return`<path d="${ne(e).data()}" fill="none" ${o}/>
|
|
47
47
|
`;case"rectangle":case"ellipse":case"diamond":case"path":case"note":{let c="";if(e.kind==="note"&&e.style.fill.a>0&&(c+=`<path d="${gn(e).translated(2,3).data()}" fill="#000000" fill-opacity="${I(.14*e.style.fill.a)}" stroke="none"/>
|
|
48
48
|
`),e.style.fill.a>0){let u=e.evenOdd===!0?' fill-rule="evenodd"':"";if(e.style.fillStyle==="solid")c+=`<path d="${gn(e).data()}" fill="${pt(e.style.fill)}"${Ge(e.style.fill,"fill-opacity")}${u} stroke="none"/>
|
|
49
49
|
`;else if(e.style.fillStyle==="grid"){let h=eo(e.style.fill);c+=`<path d="${gn(e).data()}" fill="${pt(e.style.fill)}"${Ge(e.style.fill,"fill-opacity")}${u} stroke="none"/>
|
|
50
|
-
`,c+=`<path d="${
|
|
51
|
-
`}else c+=`<path d="${
|
|
50
|
+
`,c+=`<path d="${Sr(e).data()}" fill="none" stroke="${pt(h)}"${Ge(h,"stroke-opacity")} stroke-width="1" stroke-linecap="round"/>
|
|
51
|
+
`}else c+=`<path d="${Sr(e).data()}" fill="none" stroke="${pt(e.style.fill)}"${Ge(e.style.fill,"stroke-opacity")} stroke-width="${I(Math.max(1,e.style.strokeWidth/2))}" stroke-linecap="round"/>
|
|
52
52
|
`}return c+=`<path d="${ne(e).data()}" fill="none" ${o}/>
|
|
53
|
-
`,l&&(c+=e.kind==="note"?Lo(l,e):Rn(l,e.kind==="path"||e.kind==="rectangle"?
|
|
54
|
-
`+Rn(`${e.kind}${e.text?`: ${e.text}`:""}`,n,{...e,style:{...e.style,fontSize:Math.min(e.style.fontSize,12)}},!0)}function
|
|
55
|
-
`),s=i*1.2,l=s*o.length,a=r?Rt(t):t.x,c=r?
|
|
56
|
-
`}var
|
|
57
|
-
`;return()=>{let t=URL.createObjectURL(new Blob([e],{type:"text/javascript"}));try{return new Worker(t)}finally{setTimeout(()=>URL.revokeObjectURL(t),6e4)}}}return null}var In,ye=null,Ur=!1
|
|
53
|
+
`,l&&(c+=e.kind==="note"?Lo(l,e):Rn(l,e.kind==="path"||e.kind==="rectangle"?Wl(e):st(e),e,!0)),c}default:return Vl(e,o)}}function Vl(e,t){let n=st(e);return`<path d="${K.rect(n).moveTo({x:n.x,y:n.y}).lineTo({x:n.x+n.width,y:n.y+n.height}).data()}" fill="none" ${t} stroke-opacity="0.5" stroke-dasharray="6 4"/>
|
|
54
|
+
`+Rn(`${e.kind}${e.text?`: ${e.text}`:""}`,n,{...e,style:{...e.style,fontSize:Math.min(e.style.fontSize,12)}},!0)}function Wl(e){let t=st(e),n=e.labelRect;return n?{x:t.x+n.x*t.width,y:t.y+n.y*t.height,width:n.width*t.width,height:n.height*t.height}:t}function Rn(e,t,n,r){let i=n.style.fontSize,o=e.split(`
|
|
55
|
+
`),s=i*1.2,l=s*o.length,a=r?Rt(t):t.x,c=r?St(t)-l/2:t.y,u=`<text x="${I(a)}" font-family="${Qe(n.style.font)}" font-size="${I(i)}" fill="${pt(Ri(n))}"${r?' text-anchor="middle"':""}>`;return o.forEach((h,f)=>{u+=`<tspan x="${I(a)}" y="${I(c+s*(f+.8))}">${Ne(h)}</tspan>`}),u+`</text>
|
|
56
|
+
`}var Nl=3e4;function Yl(e){let t=e.timeline;if(!t||t.camera?.some(r=>r.width>1&&r.height>1))return 0;let n=e.elements.length+(e.symbols??[]).reduce((r,i)=>r+i.elements.length,0);return ge(t).length*n}function Gl(){if(typeof Worker>"u")return null;if(typeof dottiePlayerScript=="function"){let e=`(${dottiePlayerScript.toString()})();
|
|
57
|
+
`;return()=>{let t=URL.createObjectURL(new Blob([e],{type:"text/javascript"}));try{return new Worker(t)}finally{setTimeout(()=>URL.revokeObjectURL(t),6e4)}}}return null}var In,ye=null,Ur=!1,$l=1,ie=new Map;function Vo(e){return Ur||Oo(e)||Yl(e)<Nl?!1:(In===void 0&&(In=Gl()),In!==null)}function Wo(e){return new Promise(t=>{let n=o=>{o&&Do(e,o),t()},r;try{r=ye??zl()}catch{Ur=!0,n(null);return}let i=$l++;ie.set(i,{page:e,done:n});try{r.postMessage({dottiePlan:i,page:e})}catch{ie.delete(i),n(null)}})}function zl(){let e=In();return e.onmessage=t=>{let{dottiePlan:n,plan:r}=t.data??{},i=n===void 0?void 0:ie.get(n);i&&(ie.delete(n),i.done(r??null),ie.size===0&&ye===e&&(e.terminate(),ye=null))},e.onerror=t=>{t.preventDefault?.(),Ur=!0,ye===e&&(ye=null),e.terminate();let n=[...ie.values()];ie.clear();for(let r of n)r.done(null)},ye=e,e}function No(){let e=globalThis;typeof e.WorkerGlobalScope>"u"||!(e instanceof e.WorkerGlobalScope)||e.addEventListener("message",t=>{let n=t.data?.dottiePlan;if(typeof n!="number")return;let r=null;try{r=Kt(t.data.page)}catch{r=null}e.postMessage({dottiePlan:n,plan:r})})}var Bl=typeof document<"u"?document.currentScript?.src??null:null,Fn=null,Yo=()=>globalThis.DottieLogic;function Go(){return Fn??(Fn=(async()=>{if(!Yo()){let n=Bl;if(!n)throw new Error("No dottie-logic.min.js on the page, and no address to find it from");let r=new URL("./dottie-logic.min.js",n).href;await new Promise((i,o)=>{let s=document.createElement("script");s.src=r,s.onload=()=>i(),s.onerror=()=>o(new Error(`Couldn't load ${r}`)),document.head.append(s)})}let e=Yo();if(!e)throw new Error("dottie-logic.min.js didn't load");return await e.loadLogic(),e})()),Fn.catch(()=>{Fn=null}),Fn}var Ul={r:1,g:1,b:1,a:1};function ze(e,t){let n=(t??"").trim();if(!n)return 0;let r=e.pages.findIndex(o=>o.name.toLowerCase()===n.toLowerCase());if(r>=0)return r;let i=Number(n);return Number.isInteger(i)&&i>=1&&i<=e.pages.length?i-1:0}function Be(e,t){return{...e,elements:e.elements.map(n=>({...n,style:{...n.style,roughness:t}}))}}var jl=`
|
|
58
58
|
:host { display: block; position: relative; color: var(--dottie-ink); background: var(--dottie-page);
|
|
59
59
|
font: 14px -apple-system, system-ui, sans-serif; border-radius: var(--dottie-radius, 0); }
|
|
60
60
|
:host([hidden]) { display: none; }
|
|
@@ -69,7 +69,7 @@ input[type=range] { flex: 1; min-width: 60px; accent-color: currentColor; }
|
|
|
69
69
|
output { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
|
|
70
70
|
.scene { min-width: 0; flex: 0 1 auto; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
71
71
|
.error { padding: 16px; font-family: ui-monospace, Menlo, monospace; white-space: pre-wrap; }
|
|
72
|
-
${
|
|
72
|
+
${So}`,$e=class{constructor(t,n,r={}){R(this,"page");R(this,"plan");R(this,"scenes");R(this,"sceneNames");R(this,"sceneLoops");R(this,"state");R(this,"stateSince",typeof performance>"u"?0:performance.now());R(this,"still",!1);R(this,"carried",{});R(this,"background");R(this,"ink");R(this,"clicks");R(this,"replays",new Map);R(this,"replayStarts",new Map);R(this,"hoverIDs");R(this,"labels",new Map);R(this,"owner",new Map);R(this,"partsOfOwner",new Map);R(this,"overTimes",new Map);R(this,"downTimes",new Map);R(this,"hitTimes",new Map);R(this,"last",{t:0,i:0});R(this,"svg");R(this,"groups",new Map);R(this,"order",[]);R(this,"frame",-1);R(this,"onFrame",null);this.page=r.clean?Uo(t):t,en(tn(this.page)),this.plan=Kt(this.page),this.clicks=Mo(t,r.file,r.hrefs);let i=Vr(this.page);for(let u of this.page.elements){let h=u.kind==="symbol"&&u.symbol!==null?i.get(u.symbol):void 0;if(h)if(h.button===!0)for(let[f,m]of[["over",this.overTimes],["down",this.downTimes],["hit",this.hitTimes]]){let p=We(h,f);p!==null&&m.set(u.id,p)}else u.playback==="click"&&(h.timeline?.duration??0)>0&&this.replays.set(u.id,h.timeline.duration)}let o=new Set([...this.clicks.keys(),...this.replays.keys()]);this.hoverIDs=new Set(this.page.elements.filter(u=>o.has(u.id)&&u.kind!=="symbol"&&vo(u)).map(u=>u.id));let s=new Set(this.page.elements.filter(u=>o.has(u.id)&&u.kind==="symbol").map(u=>u.id));for(let u of this.page.elements)o.has(u.id)&&(this.labels.set(u.id,Eo(u,u.symbol!==null?i.get(u.symbol)?.name:void 0)),u.kind!=="symbol"&&this.owner.set(u.id,u.id));for(let[u,h]of Ro(this.page,s))this.owner.set(u,h);for(let[u,h]of this.owner)this.partsOfOwner.set(h,[...this.partsOfOwner.get(h)??[],u]);let l=u=>{let h=0;return this.plan.times.forEach((f,m)=>{Math.abs(f-u)<Math.abs(this.plan.times[h]-u)&&(h=m)}),h};this.scenes=(t.timeline?.markers??[]).map(u=>l(u.t)),this.sceneNames=(t.timeline?.markers??[]).map(u=>u.name),this.sceneLoops=(t.timeline?.markers??[]).map(u=>u.loop===!0),this.state={...t.variables??{}};let a=zt(t);this.background=a?.background??Ul,this.ink=a?.ink??{r:.12,g:.12,b:.13,a:1};let c="http://www.w3.org/2000/svg";this.svg=document.createElementNS(c,"svg"),this.svg.setAttribute("width",I(this.plan.size.width)),this.svg.setAttribute("height",I(this.plan.size.height)),this.svg.style.maxWidth=`${Math.ceil(this.plan.size.width)}px`,n.replaceChildren(this.svg)}sinceChange(t=typeof performance>"u"?0:performance.now()){return this.still||typeof performance>"u"?null:(t-this.stateSince)/1e3}get frameCount(){return this.plan.times.length}get posterFrame(){let t=Xt(this.page),n=0;return this.plan.times.forEach((r,i)=>{Math.abs(r-t)<Math.abs(this.plan.times[n]-t)&&(n=i)}),n}show(t){let n=this.frameCount;t=(t%n+n)%n,this.drawAt(this.plan.times[t],t),this.frame=t,this.onFrame?.(t)}replay(t,n){this.replays.has(t)&&this.replayStarts.set(t,n)}replaying(t=performance.now()){for(let[n,r]of this.replayStarts)if(t-r<(this.replays.get(n)??0)*1e3)return!0;return!1}redraw(){this.drawAt(this.last.t,this.last.i)}drawAt(t,n=0){this.last={t,i:n};let r=this.plan.rects[Math.min(n,this.plan.rects.length-1)],i=typeof performance>"u"?0:performance.now(),o=new Map;for(let[d,g]of this.replayStarts)o.set(d,Math.min((i-g)/1e3,this.replays.get(d)??0));let s=dt(t),l=de(this.page,s,this.state,this.sinceChange(i),this.carried),a=new kn(l,s,!0),c=Tt(l,s,!0,o,a),{parts:u}=Ht(c,this.background,r),h=(d,g)=>{for(let P of g)this.owner.has(P.key)&&d.set(P.key,P.markup);return d},f=d=>d.size===0?new Map:h(new Map,Ht(Tt(l,s,!0,new Map([...o,...d]),a),this.background,r,!1,g=>d.has(this.owner.get(g)??"")).parts),m=this.hoverIDs.size===0?new Map:h(new Map,Ht(Po(c,this.hoverIDs),this.background,r,!1,d=>this.hoverIDs.has(d)).parts),p=f(this.overTimes),k=f(this.downTimes),y=f(this.hitTimes),M=h(new Map,u),E=[],b=new Set;for(let d of u){let g=this.owner.get(d.key);if(g===void 0){E.push(d);continue}b.has(g)||(b.add(g),E.push(this.buttonPart(g,M,m,p,k,y,l)))}this.svg.setAttribute("viewBox",`${I(r.x)} ${I(r.y)} ${I(r.width)} ${I(r.height)}`);let S="http://www.w3.org/2000/svg",x=E.map(d=>d.key);for(let d of E){let g=d.markup,P=this.groups.get(d.key);if(P)P.markup!==g&&(P.g.innerHTML=g,P.markup=g),d.button!==void 0&&P.g.classList.toggle("dottie-b",d.button);else{let A=document.createElementNS(S,"g");A.innerHTML=g,d.button!==void 0&&(A.setAttribute("class",d.button?"dottie-a dottie-b":"dottie-a"),A.setAttribute("data-a",d.key),A.setAttribute("tabindex","0"),A.setAttribute("role","button"),A.setAttribute("aria-label",this.labels.get(d.key)??"")),this.groups.set(d.key,{g:A,markup:g})}}let w=new Set(x);for(let[d,g]of this.groups)w.has(d)||(g.g.remove(),this.groups.delete(d));if(x.length!==this.order.length||x.some((d,g)=>d!==this.order[g])){let d=this.svg.firstChild;for(let g of x){let P=this.groups.get(g).g;P===d?d=d.nextSibling:this.svg.insertBefore(P,d)}for(;d;){let g=d.nextSibling;d.remove(),d=g}this.order=x}}buttonPart(t,n,r,i,o,s,l){let a=this.partsOfOwner.get(t)??[t],c=E=>{let b=a.map(S=>E.get(S)??"").join("");return b===""?null:b},u=c(n)??"",h=l.elements.find(E=>E.id===t&&E.kind==="symbol"),f=c(h?i:r),m=h?c(o):null,p=f!==null&&f!==u?f:null,k=m!==null&&m!==(f??u)?m:null;if(!h&&p===null)return{key:t,markup:u,button:!1};let y=h?' pointer-events="none"':"",M=`<g class="dottie-n"${y}>
|
|
73
73
|
${u}</g>
|
|
74
74
|
`;if(p!==null&&(M+=`<g class="dottie-h"${y}>
|
|
75
75
|
${p}</g>
|
|
@@ -77,8 +77,8 @@ ${p}</g>
|
|
|
77
77
|
${k}</g>
|
|
78
78
|
`),h){let E=c(s);if(E!==null)M+=`<g class="dottie-hit" opacity="0" pointer-events="all">
|
|
79
79
|
${E}</g>
|
|
80
|
-
`;else{let b={x:h.x+h.width/2,y:h.y+h.height/2},
|
|
81
|
-
`}}return{key:t,markup:M,button:k!==null}}sceneAt(t){let n=-1;return this.scenes.forEach((r,i)=>{r<=t&&(n=i)}),n}sceneEnd(t){return this.scenes.find((n,r)=>r>t&&n>this.scenes[t])??this.frameCount}step(t,n){let r=t+1,i=this.sceneAt(t);if(i>=0&&this.sceneLoops[i]&&r>=this.sceneEnd(i))return{frame:this.scenes[i],stop:!1};if(r>=this.frameCount)return{frame:0,stop:!n||this.scenes.length>0};let o=this.scenes.indexOf(r);return{frame:r,stop:o>=0&&!this.sceneLoops[o]}}},$o=new WeakMap;function Uo(e){let t=$o.get(e);if(t&&
|
|
80
|
+
`;else{let b={x:h.x+h.width/2,y:h.y+h.height/2},S=h.rotation??0,x=[[h.x,h.y],[h.x+h.width,h.y],[h.x+h.width,h.y+h.height],[h.x,h.y+h.height]].map(([d,g])=>Ut({x:d,y:g},b,S)),w=new K().moveTo(x[0]).lineTo(x[1]).lineTo(x[2]).lineTo(x[3]).close();M+=`<path class="dottie-hit" d="${w.data()}" fill="none" stroke="none" pointer-events="all"/>
|
|
81
|
+
`}}return{key:t,markup:M,button:k!==null}}sceneAt(t){let n=-1;return this.scenes.forEach((r,i)=>{r<=t&&(n=i)}),n}sceneEnd(t){return this.scenes.find((n,r)=>r>t&&n>this.scenes[t])??this.frameCount}step(t,n){let r=t+1,i=this.sceneAt(t);if(i>=0&&this.sceneLoops[i]&&r>=this.sceneEnd(i))return{frame:this.scenes[i],stop:!1};if(r>=this.frameCount)return{frame:0,stop:!n||this.scenes.length>0};let o=this.scenes.indexOf(r);return{frame:r,stop:o>=0&&!this.sceneLoops[o]}}},$o=new WeakMap;function Uo(e){let t=$o.get(e);if(t&&Tn(e,t.fields))return t.page;let n=Be(e,0);return $o.set(e,{fields:{...e},page:n}),n}var Zl=typeof HTMLElement>"u"?class{}:HTMLElement,be=class extends Zl{constructor(){super();R(this,"file",null);R(this,"playback",null);R(this,"root");R(this,"stage");R(this,"bar");R(this,"playButton");R(this,"scrub");R(this,"time");R(this,"sceneLabel");R(this,"prev");R(this,"next");R(this,"playing",!1);R(this,"last",0);R(this,"acc",0);R(this,"raf",0);R(this,"replayRaf",0);R(this,"loadToken",0);R(this,"mountToken",0);R(this,"stillTime",null);R(this,"visible",!0);R(this,"observer",null);R(this,"shownPage",null);R(this,"onPopState",()=>{this.file&&this.mount()});R(this,"logicQueue",Promise.resolve());this.root=this.attachShadow({mode:"open"}),this.root.innerHTML=`<style>${jl}</style><div class="stage" part="stage" role="img"></div>
|
|
82
82
|
<div class="bar" part="controls" hidden>
|
|
83
83
|
<button class="play" aria-label="Play">\u25B6</button>
|
|
84
84
|
<button class="prev" aria-label="Previous scene" hidden>\u23EE</button>
|
|
@@ -86,5 +86,5 @@ ${E}</g>
|
|
|
86
86
|
<button class="next" aria-label="Next scene" hidden>\u23ED</button>
|
|
87
87
|
<input class="scrub" type="range" min="0" max="0" value="0" aria-label="Frame">
|
|
88
88
|
<output class="time">0.0s</output>
|
|
89
|
-
</div>`;let n=r=>this.root.querySelector(r);this.stage=n(".stage"),this.bar=n(".bar"),this.playButton=n(".play"),this.scrub=n(".scrub"),this.time=n(".time"),this.sceneLabel=n(".scene"),this.prev=n(".prev"),this.next=n(".next"),this.playButton.onclick=()=>{let r=this.playback;r&&!this.playing&&r.scenes.length&&r.frame>=r.frameCount-1&&r.show(0),this.setPlaying(!this.playing)},this.scrub.oninput=()=>{this.setPlaying(!1),this.playback?.show(Number(this.scrub.value))},this.next.onclick=()=>this.nextScene(),this.prev.onclick=()=>this.prevScene(),this.stage.addEventListener("click",r=>{let i=zo(r.target);i&&this.activate(i.getAttribute("data-a")??"")}),this.addEventListener("keydown",r=>this.key(r))}connectedCallback(){this.hasAttribute("tabindex")||(this.tabIndex=0),"IntersectionObserver"in window&&(this.observer=new IntersectionObserver(n=>{this.visible=n.some(r=>r.isIntersecting),this.schedule()}),this.observer.observe(this)),this.load()}disconnectedCallback(){cancelAnimationFrame(this.raf),this.raf=0,this.observer?.disconnect()}attributeChangedCallback(n,r,i){r===i||!this.isConnected||(n==="src"?this.load():n==="label"?this.stage.setAttribute("aria-label",i??""):this.file&&this.mount())}async load(){let n=++this.loadToken;try{let r,i=this.getAttribute("src");if(i){let o=await fetch(i);if(!o.ok)throw new Error(`${i}: ${o.status} ${o.statusText}`);r=await o.text()}else{let o=this.querySelector('script[type="application/json"], script[type="application/vnd.dottie+json"]');if(!o)return;r=o.textContent??""}if(n!==this.loadToken)return;this.showFile(Ee(r))}catch(r){if(n!==this.loadToken)return;this.setPlaying(!1),cancelAnimationFrame(this.raf),cancelAnimationFrame(this.replayRaf),this.raf=0,this.replayRaf=0,this.playback=null,this.file=null,this.mountToken++,this.stillTime=null,this.bar.hidden=!0,this.stage.innerHTML="";let i=document.createElement("div");i.className="error",i.textContent=`Couldn't show this drawing: ${r.message}`,this.stage.append(i),this.dispatchEvent(new CustomEvent("error",{detail:r}))}}setFile(n){this.loadToken++,this.showFile(n)}showFile(n){this.file=n;for(let r of n.warnings)console.warn(`dottie-player: ${r}`);this.mount(()=>this.dispatchEvent(new CustomEvent("load",{detail:{file:n}})))}mount(n){let r=this.file,i=r.pages[ze(r,this.getAttribute("page"))],o=this.hasAttribute("clean"),s=++this.mountToken,l=o?Uo(i):i;if(!Vo(l)){this.mountPage(r,i,o),n?.();return}Wo(l).then(()=>{s!==this.mountToken||this.file!==r||(this.mountPage(r,i,o),n?.())})}mountPage(n,r,i){let o=new $e(r,this.stage,{clean:i,file:n});o.still=this.hasAttribute("at"),this.playback=o,this.style.setProperty("--dottie-page",pt(o.background)),this.style.setProperty("--dottie-ink",pt(o.ink)),this.style.colorScheme=ce(o.background)<.5?"dark":"light",this.stage.setAttribute("aria-label",this.getAttribute("label")??r.name);let s=this.getAttribute("at"),l=r.timeline!==null&&o.frameCount>1&&s===null;this.bar.hidden=!l||this.hasAttribute("no-controls");let a=o.scenes.length>0;if(this.prev.hidden=this.next.hidden=this.sceneLabel.hidden=!a,this.scrub.max=String(o.frameCount-1),o.onFrame=u=>{if(this.scrub.value=String(u),this.time.textContent=`${o.plan.times[u].toFixed(1)}s`,a){let h=o.sceneAt(u);this.sceneLabel.textContent=h<0?"":o.sceneNames[h]}this.dispatchEvent(new CustomEvent("frame",{detail:{frame:u,time:o.plan.times[u]}}))},!l){let u=s!==null?Bo(o,Number(s)||0):o.posterFrame;this.stillTime=s!==null?Number(s)||0:Xt(r),o.drawAt(this.stillTime,u),o.frame=u,this.setPlaying(!1);return}if(this.stillTime=null,o.show(0),typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches){o.show(o.posterFrame),this.setPlaying(!1);return}this.setPlaying(!this.hasAttribute("no-autoplay")&&(!o.scenes.includes(0)||o.sceneLoops[o.scenes.indexOf(0)]))}get paused(){return!this.playing}get currentTime(){let n=this.playback;return n&&this.stillTime!==null?this.stillTime:n&&n.frame>=0?n.plan.times[n.frame]:0}set currentTime(n){let r=this.playback;r&&(this.setPlaying(!1),r.show(Bo(r,n)))}get duration(){return this.playback?.page.timeline?.duration??0}play(){this.setPlaying(!0)}pause(){this.setPlaying(!1)}nextScene(){let n=this.playback;if(!n)return;let r=n.sceneAt(n.frame);r>=0&&n.sceneLoops[r]?n.show(r+1<n.scenes.length?n.scenes[r+1]:0):n.frame>=n.frameCount-1&&n.show(0),this.setPlaying(!0)}prevScene(){let n=this.playback;if(!n)return;let r=n.sceneAt(n.frame);r>=0&&n.scenes[r]===n.frame&&(r-=1),this.setPlaying(!1),n.show(r>=0?n.scenes[r]:0)}activate(n){let r=this.playback,i=r?.clicks.get(n),o=r?.replays.has(n)??!1;if(!r||!i&&!o)return;let s={element:n,...i??{},...o?{replay:!0}:{}};if(!this.dispatchEvent(new CustomEvent("action",{detail:s,cancelable:!0})))return;let l=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(o){let a=performance.now();r.replay(n,l?a-r.replays.get(n)*1e3:a),r.redraw(),this.scheduleReplay()}i&&(i.run&&r.page.logic&&this.hasAttribute("allow-logic")?this.runLogic(i.run,n,i.reset===!0):(i.set||i.toggle||i.reset)&&this.setState(si({scene:null,url:null,set:i.set??null,toggle:i.toggle??null,reset:i.reset??null},r.state,r.page.variables??{})),!("state"in i)
|
|
90
|
-
`)[0]??null,time:this.currentTime,scene:l<0?null:o.sceneNames[l]};this.logicQueue=this.logicQueue.then(async()=>{let c=await Go(),u=this.playback;if(!u||u!==o||!u.page.logic)return;let h=u.state;if(i){h={};for(let m of Object.keys(u.state))h[m]=!1;Object.assign(h,u.page.variables??{})}let f=c.runLogic(u.page.logic,n,h,a);f.ok?this.setState({...h,...f.set}):this.dispatchEvent(new CustomEvent("logicerror",{detail:{element:r,handler:n,error:f.error}}))}).catch(c=>{this.dispatchEvent(new CustomEvent("logicerror",{detail:{element:r,handler:n,error:c.message}}))})}get variables(){return{...this.playback?.state??{}}}setState(n){let r=this.playback;if(!r)return;let i={...r.state,...n};if(Object.keys(i).every(s=>i[s]===r.state[s]))return;let o=dt(r.last.t);r.carried=Cr(r.page,o,r.state,r.sinceChange(),r.carried).metrics.carry,r.state=i,r.stateSince=performance.now(),r.redraw(),this.dispatchEvent(new CustomEvent("state",{detail:{variables:{...i}}}))}scheduleReplay(){if(this.replayRaf)return;let n=()=>{this.replayRaf=0;let r=this.playback;!r||!this.isConnected||(this.playing||r.redraw(),r.replaying()?this.replayRaf=requestAnimationFrame(n):this.playing||r.redraw())};this.replayRaf=requestAnimationFrame(n)}setPlaying(n){let r=this.playback;this.playing=n&&!!r&&r.frameCount>1&&r.page.timeline!==null,this.playButton.textContent=this.playing?"\u275A\u275A":"\u25B6",this.playButton.setAttribute("aria-label",this.playing?"Pause":"Play"),this.last=0,this.acc=0,this.schedule()}schedule(){this.playing&&this.visible&&!this.raf&&this.isConnected&&(this.raf=requestAnimationFrame(n=>this.tick(n)))}tick(n){this.raf=0;let r=this.playback;if(!this.playing||!r)return;let i=1e3/(r.page.timeline?.fps??12);this.last&&(this.acc+=Math.min(n-this.last,1e3)),this.last=n;let o=!1;for(;this.playing&&this.acc>=i;){this.acc-=i;let{frame:s,stop:l}=r.step(r.frame,!this.hasAttribute("no-loop"));if(l&&s===0&&r.frame+1>=r.frameCount){this.setPlaying(!1);break}if(r.frame=s,o=!0,l){this.setPlaying(!1);break}}o&&r.show(r.frame),this.playing&&!this.visible&&(this.last=0),this.schedule()}key(n){let r=this.playback,i=n.composedPath()[0],o=zo(i);if(r&&o&&(n.key==="Enter"||n.key===" ")){n.preventDefault(),this.activate(o.getAttribute("data-a")??"");return}if(!r||r.page.timeline===null||r.frameCount<=1||this.hasAttribute("at")||i===this.scrub&&n.key!==" ")return;let s=r.scenes.length>0,l=!0;n.key===" "?s?this.playing?this.setPlaying(!1):this.nextScene():this.setPlaying(!this.playing):n.key==="ArrowRight"?s?this.nextScene():(this.setPlaying(!1),r.show(r.frame+1)):n.key==="ArrowLeft"?s?this.prevScene():(this.setPlaying(!1),r.show(r.frame-1)):n.key==="."?(this.setPlaying(!1),r.show(r.frame+1)):n.key===","?(this.setPlaying(!1),r.show(r.frame-1)):l=!1,l&&n.preventDefault()}};
|
|
89
|
+
</div>`;let n=r=>this.root.querySelector(r);this.stage=n(".stage"),this.bar=n(".bar"),this.playButton=n(".play"),this.scrub=n(".scrub"),this.time=n(".time"),this.sceneLabel=n(".scene"),this.prev=n(".prev"),this.next=n(".next"),this.playButton.onclick=()=>{let r=this.playback;r&&!this.playing&&r.scenes.length&&r.frame>=r.frameCount-1&&r.show(0),this.setPlaying(!this.playing)},this.scrub.oninput=()=>{this.setPlaying(!1),this.playback?.show(Number(this.scrub.value))},this.next.onclick=()=>this.nextScene(),this.prev.onclick=()=>this.prevScene(),this.stage.addEventListener("click",r=>{let i=zo(r.target);i&&this.activate(i.getAttribute("data-a")??"")}),this.addEventListener("keydown",r=>this.key(r))}connectedCallback(){this.hasAttribute("tabindex")||(this.tabIndex=0),"IntersectionObserver"in window&&(this.observer=new IntersectionObserver(n=>{this.visible=n.some(r=>r.isIntersecting),this.schedule()}),this.observer.observe(this)),this.hasAttribute("history")&&window.addEventListener("popstate",this.onPopState),this.load()}disconnectedCallback(){cancelAnimationFrame(this.raf),this.raf=0,this.observer?.disconnect(),window.removeEventListener("popstate",this.onPopState)}attributeChangedCallback(n,r,i){r===i||!this.isConnected||(n==="history"&&(i===null?window.removeEventListener("popstate",this.onPopState):window.addEventListener("popstate",this.onPopState)),n==="src"?this.load():n==="label"?this.stage.setAttribute("aria-label",i??""):this.file&&this.mount())}async load(){let n=++this.loadToken;try{let r,i=this.getAttribute("src");if(i){let o=await fetch(i);if(!o.ok)throw new Error(`${i}: ${o.status} ${o.statusText}`);r=await o.text()}else{let o=this.querySelector('script[type="application/json"], script[type="application/vnd.dottie+json"]');if(!o)return;r=o.textContent??""}if(n!==this.loadToken)return;this.showFile(Ee(r))}catch(r){if(n!==this.loadToken)return;this.setPlaying(!1),cancelAnimationFrame(this.raf),cancelAnimationFrame(this.replayRaf),this.raf=0,this.replayRaf=0,this.playback=null,this.file=null,this.mountToken++,this.stillTime=null,this.bar.hidden=!0,this.stage.innerHTML="";let i=document.createElement("div");i.className="error",i.textContent=`Couldn't show this drawing: ${r.message}`,this.stage.append(i),this.dispatchEvent(new CustomEvent("error",{detail:r}))}}setFile(n){this.loadToken++,this.showFile(n)}showFile(n){this.file=n,this.shownPage=null;for(let r of n.warnings)console.warn(`dottie-player: ${r}`);this.mount(()=>this.dispatchEvent(new CustomEvent("load",{detail:{file:n}})))}mount(n){let r=this.file,i=r.pages[this.addressedPage(r)??ze(r,this.getAttribute("page"))],o=this.hasAttribute("clean"),s=++this.mountToken,l=o?Uo(i):i;if(!Vo(l)){this.mountPage(r,i,o),n?.();return}Wo(l).then(()=>{s!==this.mountToken||this.file!==r||(this.mountPage(r,i,o),n?.())})}addressedPage(n){if(!this.hasAttribute("history")||typeof location>"u"||location.hash.length<2)return null;let r;try{r=decodeURIComponent(location.hash.slice(1))}catch{return null}let i=n.pages.findIndex(o=>o.name.toLowerCase()===r.toLowerCase());return i>=0?i:null}hrefs(){let n=this.getAttribute("links");if(!n)return;let r;try{r=JSON.parse(n)}catch{console.warn("dottie-player: links isn't JSON");return}if(!(r===null||typeof r!="object"||Array.isArray(r)))return r}mountPage(n,r,i){let o=new $e(r,this.stage,{clean:i,file:n,hrefs:this.hrefs()});if(o.still=this.hasAttribute("at"),this.playback=o,this.shownPage!==r){let u=this.shownPage===null;this.shownPage=r,queueMicrotask(()=>this.dispatchEvent(new CustomEvent("page",{detail:{index:n.pages.indexOf(r),name:r.name,first:u}})))}this.style.setProperty("--dottie-page",pt(o.background)),this.style.setProperty("--dottie-ink",pt(o.ink)),this.style.colorScheme=ce(o.background)<.5?"dark":"light",this.stage.setAttribute("aria-label",this.getAttribute("label")??r.name);let s=this.getAttribute("at"),l=r.timeline!==null&&o.frameCount>1&&s===null;this.bar.hidden=!l||this.hasAttribute("no-controls");let a=o.scenes.length>0;if(this.prev.hidden=this.next.hidden=this.sceneLabel.hidden=!a,this.scrub.max=String(o.frameCount-1),o.onFrame=u=>{if(this.scrub.value=String(u),this.time.textContent=`${o.plan.times[u].toFixed(1)}s`,a){let h=o.sceneAt(u);this.sceneLabel.textContent=h<0?"":o.sceneNames[h]}this.dispatchEvent(new CustomEvent("frame",{detail:{frame:u,time:o.plan.times[u]}}))},!l){let u=s!==null?Bo(o,Number(s)||0):o.posterFrame;this.stillTime=s!==null?Number(s)||0:Xt(r),o.drawAt(this.stillTime,u),o.frame=u,this.setPlaying(!1);return}if(this.stillTime=null,o.show(0),typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches){o.show(o.posterFrame),this.setPlaying(!1);return}this.setPlaying(!this.hasAttribute("no-autoplay")&&(!o.scenes.includes(0)||o.sceneLoops[o.scenes.indexOf(0)]))}get paused(){return!this.playing}get currentTime(){let n=this.playback;return n&&this.stillTime!==null?this.stillTime:n&&n.frame>=0?n.plan.times[n.frame]:0}set currentTime(n){let r=this.playback;r&&(this.setPlaying(!1),r.show(Bo(r,n)))}get duration(){return this.playback?.page.timeline?.duration??0}play(){this.setPlaying(!0)}pause(){this.setPlaying(!1)}nextScene(){let n=this.playback;if(!n)return;let r=n.sceneAt(n.frame);r>=0&&n.sceneLoops[r]?n.show(r+1<n.scenes.length?n.scenes[r+1]:0):n.frame>=n.frameCount-1&&n.show(0),this.setPlaying(!0)}prevScene(){let n=this.playback;if(!n)return;let r=n.sceneAt(n.frame);r>=0&&n.scenes[r]===n.frame&&(r-=1),this.setPlaying(!1),n.show(r>=0?n.scenes[r]:0)}activate(n){let r=this.playback,i=r?.clicks.get(n),o=r?.replays.has(n)??!1;if(!r||!i&&!o)return;let s={element:n,...i??{},...o?{replay:!0}:{}};if(!this.dispatchEvent(new CustomEvent("action",{detail:s,cancelable:!0})))return;let l=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(o){let a=performance.now();r.replay(n,l?a-r.replays.get(n)*1e3:a),r.redraw(),this.scheduleReplay()}if(i&&(i.run&&r.page.logic&&this.hasAttribute("allow-logic")?this.runLogic(i.run,n,i.reset===!0):(i.set||i.toggle||i.reset)&&this.setState(si({scene:null,url:null,set:i.set??null,toggle:i.toggle??null,reset:i.reset??null},r.state,r.page.variables??{})),!("state"in i)))if("url"in i)/^(https?:|mailto:)/i.test(i.url)&&window.open(i.url,"_blank","noopener");else if("page"in i){let a=this.file?.pages[i.page];this.hasAttribute("history")&&a?(history.pushState(null,"","#"+encodeURIComponent(a.name)),this.mount()):this.setAttribute("page",String(i.page+1))}else"href"in i?location.assign(i.href):i.scene>=0&&i.scene<r.scenes.length&&(l||this.hasAttribute("at")||r.frameCount<2?(this.setPlaying(!1),r.show(r.sceneLoops[i.scene]?r.scenes[i.scene]:i.scene+1<r.scenes.length?r.scenes[i.scene+1]:r.frameCount-1)):(r.show(r.scenes[i.scene]),this.setPlaying(!0)))}runLogic(n,r,i){let o=this.playback;if(!o)return;let s=o.page.elements.find(c=>c.id===r),l=o.sceneAt(o.frame),a={id:r,anchor:s?.anchor??null,text:s?.text?.split(`
|
|
90
|
+
`)[0]??null,time:this.currentTime,scene:l<0?null:o.sceneNames[l]};this.logicQueue=this.logicQueue.then(async()=>{let c=await Go(),u=this.playback;if(!u||u!==o||!u.page.logic)return;let h=u.state;if(i){h={};for(let m of Object.keys(u.state))h[m]=!1;Object.assign(h,u.page.variables??{})}let f=c.runLogic(u.page.logic,n,h,a);f.ok?this.setState({...h,...f.set}):this.dispatchEvent(new CustomEvent("logicerror",{detail:{element:r,handler:n,error:f.error}}))}).catch(c=>{this.dispatchEvent(new CustomEvent("logicerror",{detail:{element:r,handler:n,error:c.message}}))})}get variables(){return{...this.playback?.state??{}}}setState(n){let r=this.playback;if(!r)return;let i={...r.state,...n};if(Object.keys(i).every(s=>i[s]===r.state[s]))return;let o=dt(r.last.t);r.carried=Cr(r.page,o,r.state,r.sinceChange(),r.carried).metrics.carry,r.state=i,r.stateSince=performance.now(),r.redraw(),this.dispatchEvent(new CustomEvent("state",{detail:{variables:{...i}}}))}scheduleReplay(){if(this.replayRaf)return;let n=()=>{this.replayRaf=0;let r=this.playback;!r||!this.isConnected||(this.playing||r.redraw(),r.replaying()?this.replayRaf=requestAnimationFrame(n):this.playing||r.redraw())};this.replayRaf=requestAnimationFrame(n)}setPlaying(n){let r=this.playback;this.playing=n&&!!r&&r.frameCount>1&&r.page.timeline!==null,this.playButton.textContent=this.playing?"\u275A\u275A":"\u25B6",this.playButton.setAttribute("aria-label",this.playing?"Pause":"Play"),this.last=0,this.acc=0,this.schedule()}schedule(){this.playing&&this.visible&&!this.raf&&this.isConnected&&(this.raf=requestAnimationFrame(n=>this.tick(n)))}tick(n){this.raf=0;let r=this.playback;if(!this.playing||!r)return;let i=1e3/(r.page.timeline?.fps??12);this.last&&(this.acc+=Math.min(n-this.last,1e3)),this.last=n;let o=!1;for(;this.playing&&this.acc>=i;){this.acc-=i;let{frame:s,stop:l}=r.step(r.frame,!this.hasAttribute("no-loop"));if(l&&s===0&&r.frame+1>=r.frameCount){this.setPlaying(!1);break}if(r.frame=s,o=!0,l){this.setPlaying(!1);break}}o&&r.show(r.frame),this.playing&&!this.visible&&(this.last=0),this.schedule()}key(n){let r=this.playback,i=n.composedPath()[0],o=zo(i);if(r&&o&&(n.key==="Enter"||n.key===" ")){n.preventDefault(),this.activate(o.getAttribute("data-a")??"");return}if(!r||r.page.timeline===null||r.frameCount<=1||this.hasAttribute("at")||i===this.scrub&&n.key!==" ")return;let s=r.scenes.length>0,l=!0;n.key===" "?s?this.playing?this.setPlaying(!1):this.nextScene():this.setPlaying(!this.playing):n.key==="ArrowRight"?s?this.nextScene():(this.setPlaying(!1),r.show(r.frame+1)):n.key==="ArrowLeft"?s?this.prevScene():(this.setPlaying(!1),r.show(r.frame-1)):n.key==="."?(this.setPlaying(!1),r.show(r.frame+1)):n.key===","?(this.setPlaying(!1),r.show(r.frame-1)):l=!1,l&&n.preventDefault()}};R(be,"observedAttributes",["src","page","at","clean","no-controls","label","allow-logic","history","links"]);function zo(e){let t=e;return t&&typeof t.closest=="function"?t.closest(".dottie-a"):null}function Bo(e,t){let n=0;return e.plan.times.forEach((r,i)=>{Math.abs(r-t)<Math.abs(e.plan.times[n]-t)&&(n=i)}),n}function Cn(e="dottie-player"){typeof customElements<"u"&&!customElements.get(e)&&customElements.define(e,class extends be{})}var tt=e=>{let t=Fe(e*1e4)/1e4;return t===0?0:t},jr=e=>[tt(e.x),tt(e.y)],Ue=e=>[tt(e.x),tt(e.y),tt(e.width),tt(e.height)],Zr=e=>[tt(e.r),tt(e.g),tt(e.b),tt(e.a)];function Xr(e){let t=e.timeline;if(!t)return[0];let n=t.duration,r=[0,n];for(let i=1;i<16;i++)r.push(n*(i+.37)/16);for(let i of t.markers??[])r.push(i.t);return t.poster!==null&&r.push(t.poster),[...new Set(r.map(tt))].filter(i=>i>=0&&i<=n).sort((i,o)=>i-o)}function Kr(e,t){let n=Ct(e,t),r=Mt(n),i=new Set(n.layers.filter(l=>l.visible).map(l=>l.id)),o={t:tt(t)},s=e.timeline;if(s){let l=pe(s,t);o.view=l?Ue(l):null;let a=-1;(s.markers??[]).forEach((c,u)=>{c.t<=t&&(a=u)}),o.scene=a}return s?.camera?.length||(o.bounds=Ue(Gt(n))),o.elements=Dt(n).map((l,a)=>{let c={id:l.id,kind:l.kind,z:a,seed:l.seed,frame:Ue({x:l.x,y:l.y,width:l.width,height:l.height})};if(i.has(l.layerID)||(c.hiddenLayer=!0),l.rotation!==null&&(c.rotation=tt(l.rotation)),l.style.opacity!==null&&(c.opacity=tt(l.style.opacity)),l.reveal!==null&&(c.reveal=tt(l.reveal)),l.style.dashOffset!==null&&(c.dashOffset=tt(l.style.dashOffset)),c.strokeWidth=tt(l.style.strokeWidth),c.stroke=Zr(l.style.stroke),c.fill=Zr(l.style.fill),l.style.textColor!==null&&(c.textColor=Zr(l.style.textColor)),l.kind==="connector"){let[u,h]=Vt(l,r);c.start=jr(u),c.end=jr(h),c.route=Wt(Nt(l,r)).map(jr)}return c}),o}function Hr(e,t,n){let r={page:t+1,name:e.name,id:e.id},i=e.timeline;if(i){let o=Kt(e);r.duration=tt(i.duration),r.fps=tt(i.fps),r.frameCount=o.times.length,r.poster=tt(i.poster??i.duration),r.size=[tt(o.size.width),tt(o.size.height)],i.camera?.length||(r.bounds=Ue(o.rects[0])),r.markers=(i.markers??[]).map(s=>({t:tt(s.t),name:s.name}))}else r.bounds=Ue(Gt(e));return r.frames=n.map(o=>Kr(e,o)),r}function jo(e,t){return{version:e.version,pages:e.pages.map((n,r)=>Hr(n,r,t??Xr(n)))}}function Xl(e,t={}){let n=Kl(e)?e:Ee(e),r=n.pages[ze(n,t.page===void 0?null:String(t.page))];return r=Ct(r,t.at??Xt(r)),t.clean&&(r=Be(r,0)),An(r,t.background===void 0?{r:1,g:1,b:1,a:1}:t.background)}function Kl(e){return typeof e=="object"&&e!==null&&Array.isArray(e.pages)&&Array.isArray(e.warnings)}var Hl="0.11.1";No();Cn();globalThis.Dottie??(globalThis.Dottie=Jr);})();})();
|