@johnoscott/isometric-engine 0.16.0 → 0.17.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.
@@ -0,0 +1,353 @@
1
+ var Pa=`# The default theme: the tokens of the reference pages, verbatim.
2
+ # A theme is data. Every key becomes a CSS custom property (--key) for its mode.
3
+ name: default
4
+
5
+ light:
6
+ bg: "#f5f4ef"
7
+ surface: "#ffffff"
8
+ ink: "#1c1c1f"
9
+ muted: "#66666d"
10
+ line: "#dcd8ce"
11
+ code-bg: "#f0eee7"
12
+ on: "#ffffff" # text on a coloured step number or badge
13
+ # lightness of each block face; hue and saturation come from the node's role
14
+ l-top: 80%
15
+ l-left: 64%
16
+ l-right: 52%
17
+ l-edge: 30%
18
+ slab-top: "#e3dfd4"
19
+ slab-l: "#c9c3b4"
20
+ slab-r: "#b3ac9c"
21
+ pad-top: "#dfe3ea"
22
+ fence-text: "hsl(38 85% 32%)"
23
+ tunnel-text: "hsl(205 80% 32%)"
24
+ # flow kinds
25
+ send: "#2a64d6"
26
+ reply: "#14946a"
27
+ user: "#8446d0"
28
+ token: "#c9820a"
29
+ blocked: "#c8433a"
30
+ control: "#55565e"
31
+ event: "#c2317f"
32
+
33
+ dark:
34
+ bg: "#131316"
35
+ surface: "#1c1c20"
36
+ ink: "#ececf0"
37
+ muted: "#9d9da6"
38
+ line: "#33333a"
39
+ code-bg: "#24242a"
40
+ on: "#111111"
41
+ l-top: 44%
42
+ l-left: 32%
43
+ l-right: 24%
44
+ l-edge: 62%
45
+ slab-top: "#26262c"
46
+ slab-l: "#1d1d22"
47
+ slab-r: "#17171b"
48
+ pad-top: "#22252c"
49
+ fence-text: "hsl(38 90% 62%)"
50
+ tunnel-text: "hsl(205 80% 72%)"
51
+ send: "#6e9bff"
52
+ reply: "#3fcf98"
53
+ user: "#b58bff"
54
+ token: "#f2b33d"
55
+ blocked: "#ff7a6e"
56
+ control: "#b5b6bf"
57
+ event: "#ff86c8"
58
+
59
+ # Flow kinds: colour token, line style, legend text. Files may add more with \`kinds:\`.
60
+ kinds:
61
+ send: { color: send, dash: solid, legend: Message sent }
62
+ reply: { color: reply, dash: solid, legend: Reply or answer }
63
+ user: { color: user, dash: solid, legend: The human }
64
+ token: { color: token, dash: dashed, legend: Token, placeholder or swap }
65
+ blocked: { color: blocked, dash: dotted, legend: Blocked or refused }
66
+ control: { color: control, dash: solid, legend: Setup or control }
67
+ event: { color: event, dash: solid, legend: Wake or event }
68
+ planned: { color: token, dash: dashed, legend: Not built }
69
+
70
+ # Colour roles for nodes and regions: hue and saturation; lightness comes from the face.
71
+ # \`top\` replaces the top face colour; \`tint\` mixes the role colour into pad-top for the top face.
72
+ roles:
73
+ slab: { h: 40, s: 10 }
74
+ pad: { h: 220, s: 12 }
75
+ lead: { h: 218, s: 62 }
76
+ work: { h: 150, s: 45 }
77
+ doz: { h: 228, s: 8 }
78
+ chat: { h: 170, s: 48 }
79
+ mail: { h: 170, s: 48 }
80
+ file: { h: 40, s: 28 }
81
+ folder: { h: 38, s: 35 }
82
+ key: { h: 46, s: 78 }
83
+ gate: { h: 28, s: 85 }
84
+ cloud: { h: 200, s: 50 }
85
+ event: { h: 325, s: 58 }
86
+ placeholder: { h: 38, s: 70 }
87
+ term: { h: 275, s: 35 }
88
+ socket: { h: 205, s: 35 }
89
+ fence: { h: 38, s: 80 }
90
+ sandbox: { h: 170, s: 30, tint: 18 }
91
+ server: { h: 205, s: 22, tint: 13 }
92
+ belt: { h: 38, s: 55, tint: 20 }
93
+ bot: { h: 328, s: 55 }
94
+ cursor: { h: 228, s: 8 }
95
+ grey: { h: 228, s: 8 }
96
+ violet: { h: 250, s: 52 }
97
+ blue: { h: 218, s: 62 }
98
+ green: { h: 150, s: 45 }
99
+ person: { h: 275, s: 35 }
100
+ `;import{createElement as Dn,useId as Pf,useMemo as ga}from"react";import{Sequence as vf,useCurrentFrame as Ll,useVideoConfig as ba}from"remotion";var kr=Symbol.for("yaml.alias"),xr=Symbol.for("yaml.document"),bt=Symbol.for("yaml.map"),Bn=Symbol.for("yaml.pair"),ot=Symbol.for("yaml.scalar"),Ct=Symbol.for("yaml.seq"),He=Symbol.for("yaml.node.type"),wt=s=>!!s&&typeof s=="object"&&s[He]===kr,At=s=>!!s&&typeof s=="object"&&s[He]===xr,et=s=>!!s&&typeof s=="object"&&s[He]===bt,be=s=>!!s&&typeof s=="object"&&s[He]===Bn,de=s=>!!s&&typeof s=="object"&&s[He]===ot,tt=s=>!!s&&typeof s=="object"&&s[He]===Ct;function ve(s){if(s&&typeof s=="object")switch(s[He]){case bt:case Ct:return!0}return!1}function xe(s){if(s&&typeof s=="object")switch(s[He]){case kr:case bt:case ot:case Ct:return!0}return!1}var $r=s=>(de(s)||ve(s))&&!!s.anchor;var st=Symbol("break visit"),va=Symbol("skip children"),Mt=Symbol("remove node");function Nt(s,e){let r=Oa(e);At(s)?hs(null,s.contents,r,Object.freeze([s]))===Mt&&(s.contents=null):hs(null,s,r,Object.freeze([]))}Nt.BREAK=st;Nt.SKIP=va;Nt.REMOVE=Mt;function hs(s,e,r,n){let i=Aa(s,e,r,n);if(xe(i)||be(i))return Ma(s,n,i),hs(s,i,r,n);if(typeof i!="symbol"){if(ve(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let t=hs(o,e.items[o],r,n);if(typeof t=="number")o=t-1;else{if(t===st)return st;t===Mt&&(e.items.splice(o,1),o-=1)}}}else if(be(e)){n=Object.freeze(n.concat(e));let o=hs("key",e.key,r,n);if(o===st)return st;o===Mt&&(e.key=null);let t=hs("value",e.value,r,n);if(t===st)return st;t===Mt&&(e.value=null)}}return i}async function Sr(s,e){let r=Oa(e);At(s)?await ys(null,s.contents,r,Object.freeze([s]))===Mt&&(s.contents=null):await ys(null,s,r,Object.freeze([]))}Sr.BREAK=st;Sr.SKIP=va;Sr.REMOVE=Mt;async function ys(s,e,r,n){let i=await Aa(s,e,r,n);if(xe(i)||be(i))return Ma(s,n,i),ys(s,i,r,n);if(typeof i!="symbol"){if(ve(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let t=await ys(o,e.items[o],r,n);if(typeof t=="number")o=t-1;else{if(t===st)return st;t===Mt&&(e.items.splice(o,1),o-=1)}}}else if(be(e)){n=Object.freeze(n.concat(e));let o=await ys("key",e.key,r,n);if(o===st)return st;o===Mt&&(e.key=null);let t=await ys("value",e.value,r,n);if(t===st)return st;t===Mt&&(e.value=null)}}return i}function Oa(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Aa(s,e,r,n){if(typeof r=="function")return r(s,e,n);if(et(e))return r.Map?.(s,e,n);if(tt(e))return r.Seq?.(s,e,n);if(be(e))return r.Pair?.(s,e,n);if(de(e))return r.Scalar?.(s,e,n);if(wt(e))return r.Alias?.(s,e,n)}function Ma(s,e,r){let n=e[e.length-1];if(ve(n))n.items[s]=r;else if(be(n))s==="key"?n.key=r:n.value=r;else if(At(n))n.contents=r;else{let i=wt(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}var Ul={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Yl=s=>s.replace(/[!,[\]{}]/g,e=>Ul[e]),zt=class s{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,r)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,t]=n;return this.tags[o]=t,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let t=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,t),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let t=e.slice(2,-1);return t==="!"||t==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),t)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(t){return r(String(t)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Yl(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&xe(e.contents)){let o={};Nt(e.contents,(t,a)=>{xe(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,t]of n)o==="!!"&&t==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(t)))&&r.push(`%TAG ${o} ${t}`);return r.join(`
101
+ `)}};zt.defaultYaml={explicit:!1,version:"1.2"};zt.defaultTags={"!!":"tag:yaml.org,2002:"};function Pr(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(r)}return!0}function Kn(s){let e=new Set;return Nt(s,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function Fn(s,e){for(let r=1;;++r){let n=`${s}${r}`;if(!e.has(n))return n}}function Na(s,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=Kn(s));let t=Fn(e,i);return i.add(t),t},setAnchors:()=>{for(let o of r){let t=n.get(o);if(typeof t=="object"&&t.anchor&&(de(t.node)||ve(t.node)))t.node.anchor=t.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}function Gt(s,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let t=n[i],a=Gt(s,n,String(i),t);a===void 0?delete n[i]:a!==t&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),t=Gt(s,n,i,o);t===void 0?n.delete(i):t!==o&&n.set(i,t)}else if(n instanceof Set)for(let i of Array.from(n)){let o=Gt(s,n,i,i);o===void 0?n.delete(i):o!==i&&(n.delete(i),n.add(o))}else for(let[i,o]of Object.entries(n)){let t=Gt(s,n,i,o);t===void 0?delete n[i]:t!==o&&(n[i]=t)}return s.call(e,r,n)}function Ze(s,e,r){if(Array.isArray(s))return s.map((n,i)=>Ze(n,String(i),r));if(s&&typeof s.toJSON=="function"){if(!r||!$r(s))return s.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(s,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=s.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof s=="bigint"&&!r?.keep?Number(s):s}var Jt=class{constructor(e){Object.defineProperty(this,He,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!At(e))throw new TypeError("A document argument is required");let t={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Ze(this,"",t);if(typeof i=="function")for(let{count:d,res:c}of t.anchors.values())i(c,d);return typeof o=="function"?Gt(o,{"":a},"",a):a}};var Lt=class extends Jt{constructor(e){super(kr),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Nt(e,{Node:(o,t)=>{(wt(t)||$r(t))&&n.push(t)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}if(i&&r){let{anchors:o,doc:t,maxAliasCount:a}=r,d=o.get(i);if(d||(Ze(i,null,r),d=o.get(i)),d?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=vr(t,i,o)),d.count*d.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return i}toJSON(e,r){if(!r)return{source:this.source};let n=this.resolve(r.doc,r);if(!n){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return r.anchors.get(n).res}toString(e,r,n){let i=`*${this.source}`;if(e){if(Pr(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function vr(s,e,r){if(wt(e)){let n=e.resolve(s),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(ve(e)){let n=0;for(let i of e.items){let o=vr(s,i,r);o>n&&(n=o)}return n}else if(be(e)){let n=vr(s,e.key,r),i=vr(s,e.value,r);return Math.max(n,i)}return 1}var Or=s=>!s||typeof s!="function"&&typeof s!="object",te=class extends Jt{constructor(e){super(ot),this.value=e}toJSON(e,r){return r?.keep?this.value:Ze(this.value,e,r)}toString(){return String(this.value)}};te.BLOCK_FOLDED="BLOCK_FOLDED";te.BLOCK_LITERAL="BLOCK_LITERAL";te.PLAIN="PLAIN";te.QUOTE_DOUBLE="QUOTE_DOUBLE";te.QUOTE_SINGLE="QUOTE_SINGLE";var Wl="tag:yaml.org,2002:";function Gl(s,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(s)&&!n.format)}function Dt(s,e,r){if(At(s)&&(s=s.contents),xe(s))return s;if(be(s)){let l=r.schema[bt].createNode?.(r.schema,null,r);return l.items.push(s),l}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:t,sourceObjects:a}=r,d;if(n&&s&&typeof s=="object"){if(d=a.get(s),d)return d.anchor??(d.anchor=i(s)),new Lt(d.anchor);d={anchor:null,node:null},a.set(s,d)}e?.startsWith("!!")&&(e=Wl+e.slice(2));let c=Gl(s,e,t.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let l=new te(s);return d&&(d.node=l),l}c=s instanceof Map?t[bt]:Symbol.iterator in Object(s)?t[Ct]:t[bt]}o&&(o(c),delete r.onTagObj);let p=c?.createNode?c.createNode(r.schema,s,r):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(r.schema,s,r):new te(s);return e?p.tag=e:c.default||(p.tag=c.tag),d&&(d.node=p),p}function qs(s,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let t=[];t[o]=n,n=t}else n=new Map([[o,n]])}return Dt(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var bs=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,gs=class extends Jt{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>xe(n)||be(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(bs(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(ve(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,qs(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(ve(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&de(o)?o.value:o:ve(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!be(r))return!1;let n=r.value;return n==null||e&&de(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return ve(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(ve(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,qs(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};var za=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function dt(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var It=(s,e,r)=>s.endsWith(`
102
+ `)?dt(r,e):r.includes(`
103
+ `)?`
104
+ `+dt(r,e):(s.endsWith(" ")?"":" ")+r;var Zn="flow",Ar="block",Bs="quoted";function Ks(s,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:t,onOverflow:a}={}){if(!i||i<0)return s;i<o&&(o=0);let d=Math.max(1+o,1+i-e.length);if(s.length<=d)return s;let c=[],p={},l=i-e.length;typeof n=="number"&&(n>i-Math.max(2,o)?c.push(0):l=i-n);let f,m,h=!1,y=-1,g=-1,k=-1;r===Ar&&(y=Ia(s,y,e.length),y!==-1&&(l=y+d));for(let b;b=s[y+=1];){if(r===Bs&&b==="\\"){switch(g=y,s[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}k=y}if(b===`
105
+ `)r===Ar&&(y=Ia(s,y,e.length)),l=y+e.length+d,f=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
106
+ `&&m!==" "){let x=s[y+1];x&&x!==" "&&x!==`
107
+ `&&x!==" "&&(f=y)}if(y>=l)if(f)c.push(f),l=f+d,f=void 0;else if(r===Bs){for(;m===" "||m===" ";)m=b,b=s[y+=1],h=!0;let x=y>k+1?y-2:g-1;if(p[x])return s;c.push(x),p[x]=!0,l=x+d,f=void 0}else h=!0}m=b}if(h&&a&&a(),c.length===0)return s;t&&t();let u=s.slice(0,c[0]);for(let b=0;b<c.length;++b){let x=c[b],$=c[b+1]||s.length;x===0?u=`
108
+ ${e}${s.slice(0,$)}`:(r===Bs&&p[x]&&(u+=`${s[x]}\\`),u+=`
109
+ ${e}${s.slice(x+1,$)}`)}return u}function Ia(s,e,r){let n=e,i=e+1,o=s[i];for(;o===" "||o===" ";)if(e<i+r)o=s[++e];else{do o=s[++e];while(o&&o!==`
110
+ `);n=e,i=e+1,o=s[i]}return n}var Nr=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),zr=s=>/^(%|---|\.\.\.)/m.test(s);function Jl(s,e,r){if(!e||e<0)return!1;let n=e-r,i=s.length;if(i<=n)return!1;for(let o=0,t=0;o<i;++o)if(s[o]===`
111
+ `){if(o-t>n)return!0;if(t=o+1,i-t<=n)return!1}return!0}function Fs(s,e){let r=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(zr(s)?" ":""),t="",a=0;for(let d=0,c=r[d];c;c=r[++d])if(c===" "&&r[d+1]==="\\"&&r[d+2]==="n"&&(t+=r.slice(a,d)+"\\ ",d+=1,a=d,c="\\"),c==="\\")switch(r[d+1]){case"u":{t+=r.slice(a,d);let p=r.substr(d+2,4);switch(p){case"0000":t+="\\0";break;case"0007":t+="\\a";break;case"000b":t+="\\v";break;case"001b":t+="\\e";break;case"0085":t+="\\N";break;case"00a0":t+="\\_";break;case"2028":t+="\\L";break;case"2029":t+="\\P";break;default:p.substr(0,2)==="00"?t+="\\x"+p.substr(2):t+=r.substr(d,6)}d+=5,a=d+1}break;case"n":if(n||r[d+2]==='"'||r.length<i)d+=1;else{for(t+=r.slice(a,d)+`
112
+
113
+ `;r[d+2]==="\\"&&r[d+3]==="n"&&r[d+4]!=='"';)t+=`
114
+ `,d+=2;t+=o,r[d+2]===" "&&(t+="\\"),d+=1,a=d+1}break;default:d+=1}return t=a?t+r.slice(a):r,n?t:Ks(t,o,Bs,Nr(e,!1))}function Vn(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
115
+ `)||/[ \t]\n|\n[ \t]/.test(s))return Fs(s,e);let r=e.indent||(zr(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
116
+ ${r}`)+"'";return e.implicitKey?n:Ks(n,r,Zn,Nr(e,!1))}function ws(s,e){let{singleQuote:r}=e.options,n;if(r===!1)n=Fs;else{let i=s.includes('"'),o=s.includes("'");i&&!o?n=Vn:o&&!i?n=Fs:n=r?Vn:Fs}return n(s,e)}var Un;try{Un=new RegExp(`(^|(?<!
117
+ ))
118
+ +(?!
119
+ |$)`,"g")}catch{Un=/\n+(?!\n|$)/g}function Mr({comment:s,type:e,value:r},n,i,o){let{blockQuote:t,commentString:a,lineWidth:d}=n.options;if(!t||/\n[\t ]+$/.test(r))return ws(r,n);let c=n.indent||(n.forceBlockIndent||zr(r)?" ":""),p=t==="literal"?!0:t==="folded"||e===te.BLOCK_FOLDED?!1:e===te.BLOCK_LITERAL?!0:!Jl(r,d,c.length);if(!r)return p?`|
120
+ `:`>
121
+ `;let l,f;for(f=r.length;f>0;--f){let $=r[f-1];if($!==`
122
+ `&&$!==" "&&$!==" ")break}let m=r.substring(f),h=m.indexOf(`
123
+ `);h===-1?l="-":r===m||h!==m.length-1?(l="+",o&&o()):l="",m&&(r=r.slice(0,-m.length),m[m.length-1]===`
124
+ `&&(m=m.slice(0,-1)),m=m.replace(Un,`$&${c}`));let y=!1,g,k=-1;for(g=0;g<r.length;++g){let $=r[g];if($===" ")y=!0;else if($===`
125
+ `)k=g;else break}let u=r.substring(0,k<g?k+1:g);u&&(r=r.substring(u.length),u=u.replace(/\n+/g,`$&${c}`));let x=(y?c?"2":"1":"")+l;if(s&&(x+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let $=r.replace(/\n+/g,`
126
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),P=!1,T=Nr(n,!0);t!=="folded"&&e!==te.BLOCK_FOLDED&&(T.onOverflow=()=>{P=!0});let M=Ks(`${u}${$}${m}`,c,Ar,T);if(!P)return`>${x}
127
+ ${c}${M}`}return r=r.replace(/\n+/g,`$&${c}`),`|${x}
128
+ ${c}${u}${r}${m}`}function Hl(s,e,r,n){let{type:i,value:o}=s,{actualString:t,implicitKey:a,indent:d,indentStep:c,inFlow:p}=e;if(a&&o.includes(`
129
+ `)||p&&/[[\]{},]/.test(o))return ws(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||p||!o.includes(`
130
+ `)?ws(o,e):Mr(s,e,r,n);if(!a&&!p&&i!==te.PLAIN&&o.includes(`
131
+ `))return Mr(s,e,r,n);if(zr(o)){if(d==="")return e.forceBlockIndent=!0,Mr(s,e,r,n);if(a&&d===c)return ws(o,e)}let l=o.replace(/\n+/g,`$&
132
+ ${d}`);if(t){let f=y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(l),{compat:m,tags:h}=e.doc.schema;if(h.some(f)||m?.some(f))return ws(o,e)}return a?l:Ks(l,d,Zn,Nr(e,!1))}function os(s,e,r,n){let{implicitKey:i,inFlow:o}=e,t=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==te.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(t.value)&&(a=te.QUOTE_DOUBLE);let d=p=>{switch(p){case te.BLOCK_FOLDED:case te.BLOCK_LITERAL:return i||o?ws(t.value,e):Mr(t,e,r,n);case te.QUOTE_DOUBLE:return Fs(t.value,e);case te.QUOTE_SINGLE:return Vn(t.value,e);case te.PLAIN:return Hl(t,e,r,n);default:return null}},c=d(a);if(c===null){let{defaultKeyType:p,defaultStringType:l}=e.options,f=i&&p||l;if(c=d(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}function Ir(s,e){let r=Object.assign({blockQuote:!0,commentString:za,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Xl(s,e){if(e.tag){let i=s.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(de(e)){n=e.value;let i=s.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(t=>t.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Ql(s,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(de(s)||ve(s))&&s.anchor;o&&Pr(o)&&(r.add(o),i.push(`&${o}`));let t=s.tag??(e.default?null:e.tag);return t&&i.push(n.directives.tagString(t)),i.join(" ")}function qt(s,e,r,n){if(be(s))return s.toString(e,r,n);if(wt(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,o=xe(s)?s:e.doc.createNode(s,{onTagObj:d=>i=d});i??(i=Xl(e.doc.schema.tags,o));let t=Ql(o,i,e);t.length>0&&(e.indentAtStart=(e.indentAtStart??0)+t.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):de(o)?os(o,e,r,n):o.toString(e,r,n);return t?de(o)||a[0]==="{"||a[0]==="["?`${t} ${a}`:`${t}
133
+ ${e.indent}${a}`:a}function Ea({key:s,value:e},r,n,i){let{allNullValues:o,doc:t,indent:a,indentStep:d,options:{commentString:c,indentSeq:p,simpleKeys:l}}=r,f=xe(s)&&s.comment||null;if(l){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(ve(s)||!xe(s)&&typeof s=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!l&&(!s||f&&e==null&&!r.inFlow||ve(s)||(de(s)?s.type===te.BLOCK_FOLDED||s.type===te.BLOCK_LITERAL:typeof s=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(l||!o),indent:a+d});let h=!1,y=!1,g=qt(s,r,()=>h=!0,()=>y=!0);if(!m&&!r.inFlow&&g.length>1024){if(l)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(o||e==null)return h&&n&&n(),g===""?"?":m?`? ${g}`:g}else if(o&&!l||e==null&&m)return g=`? ${g}`,f&&!h?g+=It(g,r.indent,c(f)):y&&i&&i(),g;h&&(f=null),m?(f&&(g+=It(g,r.indent,c(f))),g=`? ${g}
134
+ ${a}:`):(g=`${g}:`,f&&(g+=It(g,r.indent,c(f))));let k,u,b;xe(e)?(k=!!e.spaceBefore,u=e.commentBefore,b=e.comment):(k=!1,u=null,b=null,e&&typeof e=="object"&&(e=t.createNode(e))),r.implicitKey=!1,!m&&!f&&de(e)&&(r.indentAtStart=g.length+1),y=!1,!p&&d.length>=2&&!r.inFlow&&!m&&tt(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,$=qt(e,r,()=>x=!0,()=>y=!0),P=" ";if(f||k||u){if(P=k?`
135
+ `:"",u){let T=c(u);P+=`
136
+ ${dt(T,r.indent)}`}$===""&&!r.inFlow?P===`
137
+ `&&b&&(P=`
138
+
139
+ `):P+=`
140
+ ${r.indent}`}else if(!m&&ve(e)){let T=$[0],M=$.indexOf(`
141
+ `),B=M!==-1,E=r.inFlow??e.flow??e.items.length===0;if(B||!E){let D=!1;if(B&&(T==="&"||T==="!")){let v=$.indexOf(" ");T==="&"&&v!==-1&&v<M&&$[v+1]==="!"&&(v=$.indexOf(" ",v+1)),(v===-1||M<v)&&(D=!0)}D||(P=`
142
+ ${r.indent}`)}}else($===""||$[0]===`
143
+ `)&&(P="");return g+=P+$,r.inFlow?x&&n&&n():b&&!x?g+=It(g,r.indent,c(b)):y&&i&&i(),g}function Er(s,e){(s==="debug"||s==="warn")&&console.warn(e)}var Tr="<<",kt={identify:s=>s===Tr||typeof s=="symbol"&&s.description===Tr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new te(Symbol(Tr)),{addToJSMap:Wn}),stringify:()=>Tr},Ta=(s,e)=>(kt.identify(e)||de(e)&&(!e.type||e.type===te.PLAIN)&&kt.identify(e.value))&&s?.doc.schema.tags.some(r=>r.tag===kt.tag&&r.default);function Wn(s,e,r){let n=ja(s,r);if(tt(n))for(let i of n.items)Yn(s,e,i);else if(Array.isArray(n))for(let i of n)Yn(s,e,i);else Yn(s,e,n)}function Yn(s,e,r){let n=ja(s,r);if(!et(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[o,t]of i)e instanceof Map?e.has(o)||e.set(o,t):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:t,writable:!0,enumerable:!0,configurable:!0});return e}function ja(s,e){return s&&wt(e)?e.resolve(s.doc,s):e}function jr(s,e,{key:r,value:n}){if(xe(r)&&r.addToJSMap)r.addToJSMap(s,e,n);else if(Ta(s,r))Wn(s,e,n);else{let i=Ze(r,"",s);if(e instanceof Map)e.set(i,Ze(n,i,s));else if(e instanceof Set)e.add(i);else{let o=ep(r,i,s),t=Ze(n,o,s);o in e?Object.defineProperty(e,o,{value:t,writable:!0,enumerable:!0,configurable:!0}):e[o]=t}}return e}function ep(s,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(xe(s)&&r?.doc){let n=Ir(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Er(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}function ks(s,e,r){let n=Dt(s,void 0,r),i=Dt(e,void 0,r);return new je(n,i)}var je=class s{constructor(e,r=null){Object.defineProperty(this,He,{value:Bn}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return xe(r)&&(r=r.clone(e)),xe(n)&&(n=n.clone(e)),new s(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return jr(r,n,this)}toString(e,r,n){return e?.doc?Ea(this,e,r,n):JSON.stringify(this)}};function _r(s,e,r){return(e.inFlow??s.flow?sp:tp)(s,e,r)}function tp({comment:s,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:t,onComment:a}){let{indent:d,options:{commentString:c}}=r,p=Object.assign({},r,{indent:o,type:null}),l=!1,f=[];for(let h=0;h<e.length;++h){let y=e[h],g=null;if(xe(y))!l&&y.spaceBefore&&f.push(""),Rr(r,f,y.commentBefore,l),y.comment&&(g=y.comment);else if(be(y)){let u=xe(y.key)?y.key:null;u&&(!l&&u.spaceBefore&&f.push(""),Rr(r,f,u.commentBefore,l))}l=!1;let k=qt(y,p,()=>g=null,()=>l=!0);g&&(k+=It(k,o,c(g))),l&&g&&(l=!1),f.push(n+k)}let m;if(f.length===0)m=i.start+i.end;else{m=f[0];for(let h=1;h<f.length;++h){let y=f[h];m+=y?`
144
+ ${d}${y}`:`
145
+ `}}return s?(m+=`
146
+ `+dt(c(s),d),a&&a()):l&&t&&t(),m}function sp({items:s},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:t,options:{commentString:a}}=e;n+=o;let d=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,p=0,l=[];for(let h=0;h<s.length;++h){let y=s[h],g=null;if(xe(y))y.spaceBefore&&l.push(""),Rr(e,l,y.commentBefore,!1),y.comment&&(g=y.comment);else if(be(y)){let u=xe(y.key)?y.key:null;u&&(u.spaceBefore&&l.push(""),Rr(e,l,u.commentBefore,!1),u.comment&&(c=!0));let b=xe(y.value)?y.value:null;b?(b.comment&&(g=b.comment),b.commentBefore&&(c=!0)):y.value==null&&u?.comment&&(g=u.comment)}g&&(c=!0);let k=qt(y,d,()=>g=null);c||(c=l.length>p||k.includes(`
147
+ `)),h<s.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=l.reduce((u,b)=>u+b.length+2,2)+(k.length+2)>e.options.lineWidth)),c&&(k+=",")),g&&(k+=It(k,n,a(g))),l.push(k),p=l.length}let{start:f,end:m}=r;if(l.length===0)return f+m;if(!c){let h=l.reduce((y,g)=>y+g.length+2,2);c=e.options.lineWidth>0&&h>e.options.lineWidth}if(c){let h=f;for(let y of l)h+=y?`
148
+ ${o}${i}${y}`:`
149
+ `;return`${h}
150
+ ${i}${m}`}else return`${f}${t}${l.join(" ")}${t}${m}`}function Rr({indent:s,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=dt(e(n),s);r.push(o.trimStart())}}function Ht(s,e){let r=de(e)?e.value:e;for(let n of s)if(be(n)&&(n.key===e||n.key===r||de(n.key)&&n.key.value===r))return n}var qe=class extends gs{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(bt,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,t=new this(e),a=(d,c)=>{if(typeof o=="function")c=o.call(r,d,c);else if(Array.isArray(o)&&!o.includes(d))return;(c!==void 0||i)&&t.items.push(ks(d,c,n))};if(r instanceof Map)for(let[d,c]of r)a(d,c);else if(r&&typeof r=="object")for(let d of Object.keys(r))a(d,r[d]);return typeof e.sortMapEntries=="function"&&t.items.sort(e.sortMapEntries),t}add(e,r){let n;be(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new je(e,e?.value):n=new je(e.key,e.value);let i=Ht(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);de(i.value)&&Or(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let t=this.items.findIndex(a=>o(n,a)<0);t===-1?this.items.push(n):this.items.splice(t,0,n)}else this.items.push(n)}delete(e){let r=Ht(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=Ht(this.items,e)?.value;return(!r&&de(i)?i.value:i)??void 0}has(e){return!!Ht(this.items,e)}set(e,r){this.add(new je(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)jr(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!be(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),_r(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};var xt={collection:"map",default:!0,nodeClass:qe,tag:"tag:yaml.org,2002:map",resolve(s,e){return et(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,r)=>qe.from(s,e,r)};var Ge=class extends gs{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ct,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Cr(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Cr(e);if(typeof n!="number")return;let i=this.items[n];return!r&&de(i)?i.value:i}has(e){let r=Cr(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=Cr(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];de(i)&&Or(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let o of this.items)n.push(Ze(o,String(i++),r));return n}toString(e,r,n){return e?_r(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r)){let t=0;for(let a of r){if(typeof i=="function"){let d=r instanceof Set?a:String(t++);a=i.call(r,d,a)}o.items.push(Dt(a,void 0,n))}}return o}};function Cr(s){let e=de(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var $t={collection:"seq",default:!0,nodeClass:Ge,tag:"tag:yaml.org,2002:seq",resolve(s,e){return tt(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,r)=>Ge.from(s,e,r)};var Xt={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,r,n){return e=Object.assign({actualString:!0},e),os(s,e,r,n)}};var ls={identify:s=>s==null,createNode:()=>new te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new te(null),stringify:({source:s},e)=>typeof s=="string"&&ls.test.test(s)?s:e.options.nullStr};var Zs={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new te(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},r){if(s&&Zs.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?r.options.trueStr:r.options.falseStr}};function Je({format:s,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let t=o.indexOf(".");t<0&&(t=o.length,o+=".");let a=e-(o.length-t-1);for(;a-- >0;)o+="0"}return o}var Lr={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Je},Dr={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Je(s)}},qr={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new te(parseFloat(s)),r=s.indexOf(".");return r!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-r-1),e},stringify:Je};var Br=s=>typeof s=="bigint"||Number.isInteger(s),Gn=(s,e,r,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),r);function Ra(s,e,r){let{value:n}=s;return Br(n)&&n>=0?r+n.toString(e):Je(s)}var Kr={identify:s=>Br(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,r)=>Gn(s,2,8,r),stringify:s=>Ra(s,8,"0o")},Fr={identify:Br,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,r)=>Gn(s,0,10,r),stringify:Je},Zr={identify:s=>Br(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,r)=>Gn(s,2,16,r),stringify:s=>Ra(s,16,"0x")};var _a=[xt,$t,Xt,ls,Zs,Kr,Fr,Zr,Lr,Dr,qr];function Ca(s){return typeof s=="bigint"||Number.isInteger(s)}var Vr=({value:s})=>JSON.stringify(s),rp=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Vr},{identify:s=>s==null,createNode:()=>new te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vr},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:Vr},{identify:Ca,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:r})=>r?BigInt(s):parseInt(s,10),stringify:({value:s})=>Ca(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Vr}],np={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},La=[xt,$t].concat(rp,np);var Vs={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof atob=="function"){let r=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:r},n,i,o){if(!r)return"";let t=r,a;if(typeof btoa=="function"){let d="";for(let c=0;c<t.length;++c)d+=String.fromCharCode(t[c]);a=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=te.BLOCK_LITERAL),e!==te.QUOTE_DOUBLE){let d=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/d),p=new Array(c);for(let l=0,f=0;l<c;++l,f+=d)p[l]=a.substr(f,d);a=p.join(e===te.BLOCK_LITERAL?`
151
+ `:" ")}return os({comment:s,type:e,value:a},n,i,o)}};function Jn(s,e){if(tt(s))for(let r=0;r<s.items.length;++r){let n=s.items[r];if(!be(n)){if(et(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new je(new te(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
152
+ ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment}
153
+ ${o.comment}`:n.comment}n=i}s.items[r]=be(n)?n:new je(n)}}else e("Expected a sequence for this tag");return s}function Hn(s,e,r){let{replacer:n}=r,i=new Ge(s);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let t of e){typeof n=="function"&&(t=n.call(e,String(o++),t));let a,d;if(Array.isArray(t))if(t.length===2)a=t[0],d=t[1];else throw new TypeError(`Expected [key, value] tuple: ${t}`);else if(t&&t instanceof Object){let c=Object.keys(t);if(c.length===1)a=c[0],d=t[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=t;i.items.push(ks(a,d,r))}return i}var Us={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Jn,createNode:Hn};var xs=class s extends Ge{constructor(){super(),this.add=qe.prototype.add.bind(this),this.delete=qe.prototype.delete.bind(this),this.get=qe.prototype.get.bind(this),this.has=qe.prototype.has.bind(this),this.set=qe.prototype.set.bind(this),this.tag=s.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,t;if(be(i)?(o=Ze(i.key,"",r),t=Ze(i.value,o,r)):o=Ze(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,t)}return n}static from(e,r,n){let i=Hn(e,r,n),o=new this;return o.items=i.items,o}};xs.tag="tag:yaml.org,2002:omap";var Ys={collection:"seq",identify:s=>s instanceof Map,nodeClass:xs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let r=Jn(s,e),n=[];for(let{key:i}of r.items)de(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new xs,r)},createNode:(s,e,r)=>xs.from(s,e,r)};function Da({value:s,source:e},r){return e&&(s?Xn:Qn).test.test(e)?e:s?r.options.trueStr:r.options.falseStr}var Xn={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new te(!0),stringify:Da},Qn={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new te(!1),stringify:Da};var qa={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Je},Ba={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Je(s)}},Ka={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new te(parseFloat(s.replace(/_/g,""))),r=s.indexOf(".");if(r!==-1){let n=s.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Je};var Ws=s=>typeof s=="bigint"||Number.isInteger(s);function Ur(s,e,r,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(r){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let t=BigInt(s);return i==="-"?BigInt(-1)*t:t}let o=parseInt(s,r);return i==="-"?-1*o:o}function ei(s,e,r){let{value:n}=s;if(Ws(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return Je(s)}var Fa={identify:Ws,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,r)=>Ur(s,2,2,r),stringify:s=>ei(s,2,"0b")},Za={identify:Ws,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,r)=>Ur(s,1,8,r),stringify:s=>ei(s,8,"0")},Va={identify:Ws,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,r)=>Ur(s,0,10,r),stringify:Je},Ua={identify:Ws,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,r)=>Ur(s,2,16,r),stringify:s=>ei(s,16,"0x")};var $s=class s extends qe{constructor(e){super(e),this.tag=s.tag}add(e){let r;be(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new je(e.key,null):r=new je(e,null),Ht(this.items,r.key)||this.items.push(r)}get(e,r){let n=Ht(this.items,e);return!r&&be(n)?de(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Ht(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new je(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let t of r)typeof i=="function"&&(t=i.call(r,t,t)),o.items.push(ks(t,null,n));return o}};$s.tag="tag:yaml.org,2002:set";var Gs={collection:"map",identify:s=>s instanceof Set,nodeClass:$s,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,r)=>$s.from(s,e,r),resolve(s,e){if(et(s)){if(s.hasAllNullValues(!0))return Object.assign(new $s,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function ti(s,e){let r=s[0],n=r==="-"||r==="+"?s.substring(1):s,i=t=>e?BigInt(t):Number(t),o=n.replace(/_/g,"").split(":").reduce((t,a)=>t*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function Ya(s){let{value:e}=s,r=t=>t;if(typeof e=="bigint")r=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return Je(s);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(t=>String(t).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Yr={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:r})=>ti(s,r),stringify:Ya},Wr={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>ti(s,!1),stringify:Ya},Ss={identify:s=>s instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){let e=s.match(Ss.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,t,a]=e.map(Number),d=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(r,n-1,i,o||0,t||0,a||0,d),p=e[8];if(p&&p!=="Z"){let l=ti(p,!1);Math.abs(l)<30&&(l*=60),c-=6e4*l}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var si=[xt,$t,Xt,ls,Xn,Qn,Fa,Za,Va,Ua,qa,Ba,Ka,Vs,kt,Ys,Us,Gs,Yr,Wr,Ss];var Wa=new Map([["core",_a],["failsafe",[xt,$t,Xt]],["json",La],["yaml11",si],["yaml-1.1",si]]),Ga={binary:Vs,bool:Zs,float:qr,floatExp:Dr,floatNaN:Lr,floatTime:Wr,int:Fr,intHex:Zr,intOct:Kr,intTime:Yr,map:xt,merge:kt,null:ls,omap:Ys,pairs:Us,seq:$t,set:Gs,timestamp:Ss},Ja={"tag:yaml.org,2002:binary":Vs,"tag:yaml.org,2002:merge":kt,"tag:yaml.org,2002:omap":Ys,"tag:yaml.org,2002:pairs":Us,"tag:yaml.org,2002:set":Gs,"tag:yaml.org,2002:timestamp":Ss};function Gr(s,e,r){let n=Wa.get(e);if(n&&!s)return r&&!n.includes(kt)?n.concat(kt):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let o=Array.from(Wa.keys()).filter(t=>t!=="yaml11").map(t=>JSON.stringify(t)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(s))for(let o of s)i=i.concat(o);else typeof s=="function"&&(i=s(i.slice()));return r&&(i=i.concat(kt)),i.reduce((o,t)=>{let a=typeof t=="string"?Ga[t]:t;if(!a){let d=JSON.stringify(t),c=Object.keys(Ga).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${c}`)}return o.includes(a)||o.push(a),o},[])}var ip=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,Js=class s{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:t,toStringDefaults:a}){this.compat=Array.isArray(e)?Gr(e,"compat"):e?Gr(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Ja:{},this.tags=Gr(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,bt,{value:xt}),Object.defineProperty(this,ot,{value:Xt}),Object.defineProperty(this,Ct,{value:$t}),this.sortMapEntries=typeof t=="function"?t:t===!0?ip:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function Ha(s,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let d=s.directives.toString(s);d?(r.push(d),n=!0):s.directives.docStart&&(n=!0)}n&&r.push("---");let i=Ir(s,e),{commentString:o}=i.options;if(s.commentBefore){r.length!==1&&r.unshift("");let d=o(s.commentBefore);r.unshift(dt(d,""))}let t=!1,a=null;if(s.contents){if(xe(s.contents)){if(s.contents.spaceBefore&&n&&r.push(""),s.contents.commentBefore){let p=o(s.contents.commentBefore);r.push(dt(p,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let d=a?void 0:()=>t=!0,c=qt(s.contents,i,()=>a=null,d);a&&(c+=It(c,"",o(a))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(qt(s.contents,i));if(s.directives?.docEnd)if(s.comment){let d=o(s.comment);d.includes(`
154
+ `)?(r.push("..."),r.push(dt(d,""))):r.push(`... ${d}`)}else r.push("...");else{let d=s.comment;d&&t&&(d=d.replace(/^\n+/,"")),d&&((!t||a)&&r[r.length-1]!==""&&r.push(""),r.push(dt(o(d),"")))}return r.join(`
155
+ `)+`
156
+ `}var Qt=class s{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,He,{value:xr});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:t}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(t=this.directives.yaml.version)):this.directives=new zt({version:t}),this.setSchema(t,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[He]:{value:xr}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=xe(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ps(this.contents)&&this.contents.add(e)}addIn(e,r){Ps(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Kn(this);e.anchor=!r||n.has(r)?Fn(r||"a",n):r}return new Lt(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=u=>typeof u=="number"||u instanceof String||u instanceof Number,k=r.filter(g).map(String);k.length>0&&(r=r.concat(k)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:t,flow:a,keepUndefined:d,onTagObj:c,tag:p}=n??{},{onAnchor:l,setAnchors:f,sourceObjects:m}=Na(this,t||"a"),h={aliasDuplicateObjects:o??!0,keepUndefined:d??!1,onAnchor:l,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},y=Dt(e,p,h);return a&&ve(y)&&(y.flow=!0),f(),y}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new je(i,o)}delete(e){return Ps(this.contents)?this.contents.delete(e):!1}deleteIn(e){return bs(e)?this.contents==null?!1:(this.contents=null,!0):Ps(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return ve(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return bs(e)?!r&&de(this.contents)?this.contents.value:this.contents:ve(this.contents)?this.contents.getIn(e,r):void 0}has(e){return ve(this.contents)?this.contents.has(e):!1}hasIn(e){return bs(e)?this.contents!==void 0:ve(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=qs(this.schema,[e],r):Ps(this.contents)&&this.contents.set(e,r)}setIn(e,r){bs(e)?this.contents=r:this.contents==null?this.contents=qs(this.schema,Array.from(e),r):Ps(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new zt({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new zt({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Js(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:t}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Ze(this.contents,r??"",a);if(typeof o=="function")for(let{count:c,res:p}of a.anchors.values())o(p,c);return typeof t=="function"?Gt(t,{"":d},"",d):d}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Ha(this,e)}};function Ps(s){if(ve(s))return!0;throw new Error("Expected a YAML collection as document contents")}var Hs=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},St=class extends Hs{constructor(e,r,n){super("YAMLParseError",e,r,n)}},Xs=class extends Hs{constructor(e,r,n){super("YAMLWarning",e,r,n)}},ri=(s,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,t=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&t.length>80){let a=Math.min(o-39,t.length-79);t="\u2026"+t.substring(a),o-=a-1}if(t.length>80&&(t=t.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(t.substring(0,o))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
157
+ `),t=a+t}if(/[^ ]/.test(t)){let a=1,d=r.linePos[1];d?.line===n&&d.col>i&&(a=Math.max(1,Math.min(d.col-i,80-o)));let c=" ".repeat(o)+"^".repeat(a);r.message+=`:
158
+
159
+ ${t}
160
+ ${c}
161
+ `}};function Et(s,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:t,startOnNewline:a}){let d=!1,c=a,p=a,l="",f="",m=!1,h=!1,y=null,g=null,k=null,u=null,b=null,x=null,$=null;for(let M of s)switch(h&&(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma"&&o(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h=!1),y&&(c&&M.type!=="comment"&&M.type!=="newline"&&o(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),M.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&M.source.includes(" ")&&(y=M),p=!0;break;case"comment":{p||o(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=M.source.substring(1)||" ";l?l+=f+B:l=B,f="",c=!1;break}case"newline":c?l?l+=M.source:(!x||r!=="seq-item-ind")&&(d=!0):f+=M.source,c=!0,m=!0,(g||k)&&(u=M),p=!0;break;case"anchor":g&&o(M,"MULTIPLE_ANCHORS","A node can have at most one anchor"),M.source.endsWith(":")&&o(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=M,$??($=M.offset),c=!1,p=!1,h=!0;break;case"tag":{k&&o(M,"MULTIPLE_TAGS","A node can have at most one tag"),k=M,$??($=M.offset),c=!1,p=!1,h=!0;break}case r:(g||k)&&o(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`),x&&o(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${e??"collection"}`),x=M,c=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){b&&o(M,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=M,c=!1,p=!1;break}default:o(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),c=!1,p=!1}let P=s[s.length-1],T=P?P.offset+P.source.length:i;return h&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(c&&y.indent<=t||n?.type==="block-map"||n?.type==="block-seq")&&o(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:x,spaceBefore:d,comment:l,hasNewline:m,anchor:g,tag:k,newlineAfterProp:u,end:T,start:$??T}}function es(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
162
+ `))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(es(e.key)||es(e.value))return!0}return!1;default:return!0}}function Qs(s,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&es(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Jr(s,e,r){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,t)=>o===t||de(o)&&de(t)&&o.value===t.value;return e.some(o=>i(o.key,r))}var Xa="All mapping items must start at the same column";function Qa({composeNode:s,composeEmptyNode:e},r,n,i,o){let t=o?.nodeClass??qe,a=new t(r.schema);r.atRoot&&(r.atRoot=!1);let d=n.offset,c=null;for(let p of n.items){let{start:l,key:f,sep:m,value:h}=p,y=Et(l,{indicator:"explicit-key-ind",next:f??m?.[0],offset:d,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!y.found;if(g){if(f&&(f.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(d,"BAD_INDENT",Xa)),!y.anchor&&!y.tag&&!m){c=y.end,y.comment&&(a.comment?a.comment+=`
163
+ `+y.comment:a.comment=y.comment);continue}(y.newlineAfterProp||es(f))&&i(f??l[l.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==n.indent&&i(d,"BAD_INDENT",Xa);r.atKey=!0;let k=y.end,u=f?s(r,f,y,i):e(r,k,l,null,y,i);r.schema.compat&&Qs(n.indent,f,i),r.atKey=!1,Jr(r,a.items,u)&&i(k,"DUPLICATE_KEY","Map keys must be unique");let b=Et(m??[],{indicator:"map-value-ind",next:h,offset:u.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(d=b.end,b.found){g&&(h?.type==="block-map"&&!b.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start<b.found.offset-1024&&i(u.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=h?s(r,h,b,i):e(r,d,m,null,b,i);r.schema.compat&&Qs(n.indent,h,i),d=x.range[2];let $=new je(u,x);r.options.keepSourceTokens&&($.srcToken=p),a.items.push($)}else{g&&i(u.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(u.comment?u.comment+=`
164
+ `+b.comment:u.comment=b.comment);let x=new je(u);r.options.keepSourceTokens&&(x.srcToken=p),a.items.push(x)}}return c&&c<d&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,d,c??d],a}function eo({composeNode:s,composeEmptyNode:e},r,n,i,o){let t=o?.nodeClass??Ge,a=new t(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset,c=null;for(let{start:p,value:l}of n.items){let f=Et(p,{indicator:"seq-item-ind",next:l,offset:d,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||l)l?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let m=l?s(r,l,f,i):e(r,f.end,p,null,f,i);r.schema.compat&&Qs(n.indent,l,i),d=m.range[2],a.items.push(m)}return a.range=[n.offset,d,c??d],a}function Tt(s,e,r,n){let i="";if(s){let o=!1,t="";for(let a of s){let{source:d,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=d.substring(1)||" ";i?i+=t+p:i=p,t="";break}case"newline":i&&(t+=d),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=d.length}}return{comment:i,offset:e}}var ni="Block collections are not allowed within flow collections",ii=s=>s&&(s.type==="block-map"||s.type==="block-seq");function to({composeNode:s,composeEmptyNode:e},r,n,i,o){let t=n.start.source==="{",a=t?"flow map":"flow sequence",d=o?.nodeClass??(t?qe:Ge),c=new d(r.schema);c.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let l=n.offset+n.start.source.length;for(let g=0;g<n.items.length;++g){let k=n.items[g],{start:u,key:b,sep:x,value:$}=k,P=Et(u,{flow:a,indicator:"explicit-key-ind",next:b??x?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!P.found){if(!P.anchor&&!P.tag&&!x&&!$){g===0&&P.comma?i(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<n.items.length-1&&i(P.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),P.comment&&(c.comment?c.comment+=`
165
+ `+P.comment:c.comment=P.comment),l=P.end;continue}!t&&r.options.strict&&es(b)&&i(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)P.comma&&i(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(P.comma||i(P.start,"MISSING_CHAR",`Missing , between ${a} items`),P.comment){let T="";e:for(let M of u)switch(M.type){case"comma":case"space":break;case"comment":T=M.source.substring(1);break e;default:break e}if(T){let M=c.items[c.items.length-1];be(M)&&(M=M.value??M.key),M.comment?M.comment+=`
166
+ `+T:M.comment=T,P.comment=P.comment.substring(T.length+1)}}if(!t&&!x&&!P.found){let T=$?s(r,$,P,i):e(r,P.end,x,null,P,i);c.items.push(T),l=T.range[2],ii($)&&i(T.range,"BLOCK_IN_FLOW",ni)}else{r.atKey=!0;let T=P.end,M=b?s(r,b,P,i):e(r,T,u,null,P,i);ii(b)&&i(M.range,"BLOCK_IN_FLOW",ni),r.atKey=!1;let B=Et(x??[],{flow:a,indicator:"map-value-ind",next:$,offset:M.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(B.found){if(!t&&!P.found&&r.options.strict){if(x)for(let v of x){if(v===B.found)break;if(v.type==="newline"){i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}P.start<B.found.offset-1024&&i(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else $&&("source"in $&&$.source?.[0]===":"?i($,"MISSING_CHAR",`Missing space after : in ${a}`):i(B.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let E=$?s(r,$,B,i):B.found?e(r,B.end,x,null,B,i):null;E?ii($)&&i(E.range,"BLOCK_IN_FLOW",ni):B.comment&&(M.comment?M.comment+=`
167
+ `+B.comment:M.comment=B.comment);let D=new je(M,E);if(r.options.keepSourceTokens&&(D.srcToken=k),t){let v=c;Jr(r,v.items,M)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),v.items.push(D)}else{let v=new qe(r.schema);v.flow=!0,v.items.push(D);let O=(E??M).range;v.range=[M.range[0],O[1],O[2]],c.items.push(v)}l=E?E.range[2]:B.end}}let f=t?"}":"]",[m,...h]=n.end,y=l;if(m?.source===f)y=m.offset+m.source.length;else{let g=a[0].toUpperCase()+a.substring(1),k=p?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;i(l,p?"MISSING_CHAR":"BAD_INDENT",k),m&&m.source.length!==1&&h.unshift(m)}if(h.length>0){let g=Tt(h,y,r.options.strict,i);g.comment&&(c.comment?c.comment+=`
168
+ `+g.comment:c.comment=g.comment),c.range=[n.offset,y,g.offset]}else c.range=[n.offset,y,y];return c}function ai(s,e,r,n,i,o){let t=r.type==="block-map"?Qa(s,e,r,n,o):r.type==="block-seq"?eo(s,e,r,n,o):to(s,e,r,n,o),a=t.constructor;return i==="!"||i===a.tagName?(t.tag=a.tagName,t):(i&&(t.tag=i),t)}function so(s,e,r,n,i){let o=n.tag,t=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=n,h=f&&o?f.offset>o.offset?f:o:f??o;h&&(!m||m.offset<h.offset)&&i(h,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!t||t==="!"||t===qe.tagName&&a==="map"||t===Ge.tagName&&a==="seq")return ai(s,e,r,i,t);let d=e.schema.tags.find(f=>f.tag===t&&f.collection===a);if(!d){let f=e.schema.knownTags[t];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),d=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,!0),ai(s,e,r,i,t)}let c=ai(s,e,r,i,t,d),p=d.resolve?.(c,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??c,l=xe(p)?p:new te(p);return l.range=c.range,l.tag=t,d?.format&&(l.format=d.format),l}function oi(s,e,r){let n=e.offset,i=ap(e,s.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?te.BLOCK_FOLDED:te.BLOCK_LITERAL,t=e.source?op(e.source):[],a=t.length;for(let y=t.length-1;y>=0;--y){let g=t[y][1];if(g===""||g==="\r")a=y;else break}if(a===0){let y=i.chomp==="+"&&t.length>0?`
169
+ `.repeat(Math.max(1,t.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:y,type:o,comment:i.comment,range:[n,g,g]}}let d=e.indent+i.indent,c=e.offset+i.length,p=0;for(let y=0;y<a;++y){let[g,k]=t[y];if(k===""||k==="\r")i.indent===0&&g.length>d&&(d=g.length);else{g.length<d&&r(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=g.length),p=y,d===0&&!s.atRoot&&r(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+k.length+1}for(let y=t.length-1;y>=a;--y)t[y][0].length>d&&(a=y+1);let l="",f="",m=!1;for(let y=0;y<p;++y)l+=t[y][0].slice(d)+`
170
+ `;for(let y=p;y<a;++y){let[g,k]=t[y];c+=g.length+k.length+1;let u=k[k.length-1]==="\r";if(u&&(k=k.slice(0,-1)),k&&g.length<d){let x=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(c-k.length-(u?2:1),"BAD_INDENT",x),g=""}o===te.BLOCK_LITERAL?(l+=f+g.slice(d)+k,f=`
171
+ `):g.length>d||k[0]===" "?(f===" "?f=`
172
+ `:!m&&f===`
173
+ `&&(f=`
174
+
175
+ `),l+=f+g.slice(d)+k,f=`
176
+ `,m=!0):k===""?f===`
177
+ `?l+=`
178
+ `:f=`
179
+ `:(l+=f+k,f=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let y=a;y<t.length;++y)l+=`
180
+ `+t[y][0].slice(d);l[l.length-1]!==`
181
+ `&&(l+=`
182
+ `);break;default:l+=`
183
+ `}let h=n+i.length+e.source.length;return{value:l,type:o,comment:i.comment,range:[n,h,h]}}function ap({offset:s,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],t=0,a="",d=-1;for(let f=1;f<i.length;++f){let m=i[f];if(!a&&(m==="-"||m==="+"))a=m;else{let h=Number(m);!t&&h?t=h:d===-1&&(d=s+f)}}d!==-1&&n(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",l=i.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":c=!0;case"newline":l+=m.source.length;break;case"comment":r&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),l+=m.source.length,p=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),l+=m.source.length;break;default:{let h=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",h);let y=m.source;y&&typeof y=="string"&&(l+=y.length)}}}return{mode:o,indent:t,chomp:a,comment:p,length:l}}function op(s){let e=s.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),o=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let t=1;t<e.length;t+=2)o.push([e[t],e[t+1]]);return o}function li(s,e,r){let{offset:n,type:i,source:o,end:t}=s,a,d,c=(f,m,h)=>r(n+f,m,h);switch(i){case"scalar":a=te.PLAIN,d=lp(o,c);break;case"single-quoted-scalar":a=te.QUOTE_SINGLE,d=pp(o,c);break;case"double-quoted-scalar":a=te.QUOTE_DOUBLE,d=cp(o,c);break;default:return r(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let p=n+o.length,l=Tt(t,p,e,r);return{value:d,type:a,comment:l.comment,range:[n,p,l.offset]}}function lp(s,e){let r="";switch(s[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${s[0]}`;break}case"@":case"`":{r=`reserved character ${s[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),ro(s)}function pp(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),ro(s.slice(1,-1)).replace(/''/g,"'")}function ro(s){let e=/(.*?)\r?\n/sy,r=e.exec(s);if(!r)return s;let n,i;try{n=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let o=r[1].replace(n,""),t=" ",a=e.lastIndex;for(;r=e.exec(s);){let c=r[1].replace(i,"");c===""?t===`
184
+ `?o+=t:t=`
185
+ `:(o+=t+c,t=" "),a=e.lastIndex}let d=/[ \t]*(.*)/sy;return d.lastIndex=a,r=d.exec(s),o+t+(r?.[1]??"")}function cp(s,e){let r="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
186
+ `))if(i===`
187
+ `){let{fold:o,offset:t}=fp(s,n);r+=o,n=t}else if(i==="\\"){let o=s[++n],t=mp[o];if(t)r+=t;else if(o===`
188
+ `)for(o=s[n+1];o===" "||o===" ";)o=s[++n+1];else if(o==="\r"&&s[n+1]===`
189
+ `)for(o=s[++n+1];o===" "||o===" ";)o=s[++n+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=dp(s,n+1,a,e),n+=a}else{let a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i===" "){let o=n,t=s[n+1];for(;t===" "||t===" ";)t=s[++n+1];t!==`
190
+ `&&!(t==="\r"&&s[n+2]===`
191
+ `)&&(r+=n>o?s.slice(o,n+1):i)}else r+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),r}function fp(s,e){let r="",n=s[e+1];for(;(n===" "||n===" "||n===`
192
+ `||n==="\r")&&!(n==="\r"&&s[e+2]!==`
193
+ `);)n===`
194
+ `&&(r+=`
195
+ `),e+=1,n=s[e+1];return r||(r=" "),{fold:r,offset:e}}var mp={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
196
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function dp(s,e,r,n){let i=s.substr(e,r),t=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(t)}catch{let a=s.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function pi(s,e,r,n){let{value:i,type:o,comment:t,range:a}=e.type==="block-scalar"?oi(s,e,n):li(e,s.options.strict,n),d=r?s.directives.tagName(r.source,l=>n(r,"TAG_RESOLVE_FAILED",l)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[ot]:d?c=up(s.schema,i,d,r,n):e.type==="scalar"?c=hp(s,i,e,n):c=s.schema[ot];let p;try{let l=c.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),s.options);p=de(l)?l:new te(l)}catch(l){let f=l instanceof Error?l.message:String(l);n(r??e,"TAG_RESOLVE_FAILED",f),p=new te(i)}return p.range=a,p.source=i,o&&(p.type=o),d&&(p.tag=d),c.format&&(p.format=c.format),t&&(p.comment=t),p}function up(s,e,r,n,i){if(r==="!")return s[ot];let o=[];for(let a of s.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let t=s.knownTags[r];return t&&!t.collection?(s.tags.push(Object.assign({},t,{default:!1,test:void 0})),t):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),s[ot])}function hp({atKey:s,directives:e,schema:r},n,i,o){let t=r.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||r[ot];if(r.compat){let a=r.compat.find(d=>d.default&&d.test?.test(n))??r[ot];if(t.tag!==a.tag){let d=e.tagString(t.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${d} or ${c}`;o(i,"TAG_RESOLVE_FAILED",p,!0)}}return t}function no(s,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}var yp={composeNode:ci,composeEmptyNode:Hr};function ci(s,e,r,n){let i=s.atKey,{spaceBefore:o,comment:t,anchor:a,tag:d}=r,c,p=!0;switch(e.type){case"alias":c=gp(s,e,n),(a||d)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=pi(s,e,d,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=so(yp,s,e,r,n),a&&(c.anchor=a.source.substring(1))}catch(l){let f=l instanceof Error?l.message:String(l);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let l=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",l),p=!1}}return c??(c=Hr(s,e.offset,void 0,null,r,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!de(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(d??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(c.spaceBefore=!0),t&&(e.type==="scalar"&&e.source===""?c.comment=t:c.commentBefore=t),s.options.keepSourceTokens&&p&&(c.srcToken=e),c}function Hr(s,e,r,n,{spaceBefore:i,comment:o,anchor:t,tag:a,end:d},c){let p={type:"scalar",offset:no(e,r,n),indent:-1,source:""},l=pi(s,p,a,c);return t&&(l.anchor=t.source.substring(1),l.anchor===""&&c(t,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(l.spaceBefore=!0),o&&(l.comment=o,l.range[2]=d),l}function gp({options:s},{offset:e,source:r,end:n},i){let o=new Lt(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let t=e+r.length,a=Tt(n,t,s.strict,i);return o.range=[e,t,a.offset],a.comment&&(o.comment=a.comment),o}function io(s,e,{offset:r,start:n,value:i,end:o},t){let a=Object.assign({_directives:e},s),d=new Qt(void 0,a),c={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=Et(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:t,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&t(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?ci(c,i,p,t):Hr(c,p.end,n,null,p,t);let l=d.contents.range[2],f=Tt(o,l,!1,t);return f.comment&&(d.comment=f.comment),d.range=[r,l,f.offset],d}function er(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:r}=s;return[e,e+(typeof r=="string"?r.length:1)]}function ao(s){let e="",r=!1,n=!1;for(let i=0;i<s.length;++i){let o=s[i];switch(o[0]){case"#":e+=(e===""?"":n?`
197
+
198
+ `:`
199
+ `)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var tr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let t=er(r);o?this.warnings.push(new Xs(t,n,i)):this.errors.push(new St(t,n,i))},this.directives=new zt({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=ao(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment}
200
+ ${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(ve(o)&&!o.flow&&o.items.length>0){let t=o.items[0];be(t)&&(t=t.key);let a=t.commentBefore;t.commentBefore=a?`${n}
201
+ ${a}`:n}else{let t=o.commentBefore;o.commentBefore=t?`${n}
202
+ ${t}`:n}}if(r){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:ao(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let o=er(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=io(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new St(er(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new St(er(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Tt(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
203
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new St(er(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Qt(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};var fi=Symbol("break visit"),bp=Symbol("skip children"),oo=Symbol("remove item");function ps(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),lo(Object.freeze([]),s,e)}ps.BREAK=fi;ps.SKIP=bp;ps.REMOVE=oo;ps.itemAtPath=(s,e)=>{let r=s;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};ps.parentCollection=(s,e)=>{let r=ps.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function lo(s,e,r){let n=r(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let t=0;t<o.items.length;++t){let a=lo(Object.freeze(s.concat([[i,t]])),o.items[t],r);if(typeof a=="number")t=a-1;else{if(a===fi)return fi;a===oo&&(o.items.splice(t,1),t-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}var mi="\uFEFF",di="",ui="",Xr="";function po(s){switch(s){case mi:return"byte-order-mark";case di:return"doc-mode";case ui:return"flow-error-end";case Xr:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
204
+ `:case`\r
205
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Pt(s){switch(s){case void 0:case" ":case`
206
+ `:case"\r":case" ":return!0;default:return!1}}var co=new Set("0123456789ABCDEFabcdef"),kp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qr=new Set(",[]{}"),xp=new Set(` ,[]{}
207
+ \r `),hi=s=>!s||xp.has(s),sr=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
208
+ `?!0:r==="\r"?this.buffer[e+1]===`
209
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
210
+ `||!i&&!this.atEnd)return e+n+1}return r===`
211
+ `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Pt(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
212
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===mi&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let o=e[n-1];if(o===" "||o===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let o=e[r-1];if(o===" "||o===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield di,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Pt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Pt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Pt(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(hi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Pt(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ui,yield*this.parseLineStart();let o=0;for(;i[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),i[o]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(hi),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let t=this.charAt(1);if(this.flowKey||Pt(t)||t===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
213
+ `,this.pos);if(i!==-1){for(;i!==-1;){let o=this.continueScalar(i+1);if(o===-1)break;i=n.indexOf(`
214
+ `,o)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Pt(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case`
215
+ `:e=o,r=0;break;case"\r":{let t=this.buffer[o+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if(t===`
216
+ `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
217
+ `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
218
+ `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let o=e-1,t=this.buffer[o];t==="\r"&&(t=this.buffer[--o]);let a=o;for(;t===" ";)t=this.buffer[--o];if(t===`
219
+ `&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Xr,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Pt(o)||e&&Qr.has(o))break;r=n}else if(Pt(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===`
220
+ `?(n+=1,i=`
221
+ `,o=this.buffer[n+1]):r=n),o==="#"||e&&Qr.has(o))break;if(i===`
222
+ `){let t=this.continueScalar(n+1);if(t===-1)break;n=Math.max(n,t-2)}}else{if(e&&Qr.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Xr,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(hi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Pt(n)||r&&Qr.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Pt(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(kp.has(r))r=this.buffer[++e];else if(r==="%"&&co.has(this.buffer[e+1])&&co.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
223
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
224
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};var cs=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let o=r+n>>1;this.lineStarts[o]<e?r=o+1:n=o}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};function ts(s,e){for(let r=0;r<s.length;++r)if(s[r].type===e)return!0;return!1}function fo(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function uo(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function en(s){switch(s.type){case"document":return s.start;case"block-map":{let e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function vs(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function tn(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let r=0;r<e.length;++r)s.push(e[r])}function mo(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!ts(e.start,"explicit-key-ind")&&!ts(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,uo(e.value)?e.value.end?tn(e.value.end,e.sep):e.value.end=e.sep:tn(e.start,e.sep),delete e.sep)}var rr=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new sr,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=po(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&mo(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&fo(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{fo(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=en(this.peek(2)),n=vs(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
225
+ `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
226
+ `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){tn(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let t=[];for(let a=0;a<r.sep.length;++a){let d=r.sep[a];switch(d.type){case"newline":t.push(a);break;case"space":break;case"comment":d.indent>e.indent&&(t.length=0);break;default:t.length=0}}t.length>=2&&(o=r.sep.splice(t[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ts(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(uo(r.key)&&!ts(r.sep,"newline")){let t=vs(r.start),a=r.key,d=r.sep;d.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:a,sep:d}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(ts(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let t=vs(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):ts(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let t=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:t,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(t):(Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!0);return}default:{let t=this.startBlockValue(e);if(t){if(t.type==="block-seq"){if(!r.explicitKey&&r.sep&&!ts(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(t);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){tn(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||ts(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=en(n),o=vs(i);mo(e);let t=e.end.splice(1,e.end.length);t.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
227
+ `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
228
+ `,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=en(e),n=vs(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=en(e),n=vs(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function $p(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new cs||null,prettyErrors:e}}function sn(s,e={}){let{lineCounter:r,prettyErrors:n}=$p(e),i=new rr(r?.addNewLine),o=new tr(e),t=null;for(let a of o.compose(i.parse(s),!0,s.length))if(!t)t=a;else if(t.options.logLevel!=="silent"){t.errors.push(new St(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(t.errors.forEach(ri(s,r)),t.warnings.forEach(ri(s,r))),t}function yi(s,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=sn(s,r);if(!i)return null;if(i.warnings.forEach(o=>Er(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function ho(s){return s.split("/").slice(1).map(e=>{let r=e.replace(/~1/g,"/").replace(/~0/g,"~");return/^\d+$/.test(r)?Number(r):r})}function yo(s){let e=new cs,r=sn(s,{lineCounter:e,prettyErrors:!1,uniqueKeys:!0}),n=[],i=d=>{let c=e.linePos(d);return{line:c.line,col:c.col}};for(let d of r.errors){let c=i(d.pos[0]),p=d.message.split(`
229
+ `)[0],l=/Nested mappings|Implicit keys|mapping values/i.test(p)?`text that contains ": " (a colon followed by a blank) must be in quotes, e.g. command: 'send "a: b"'`:/Map keys must be unique/i.test(p)?"a key is written twice in the same map":void 0;n.push({severity:"error",message:`YAML: ${p}`,line:c.line,col:c.col,path:"",hint:l})}for(let d of r.warnings){let c=i(d.pos[0]);n.push({severity:"warning",message:`YAML: ${d.message.split(`
230
+ `)[0]}`,line:c.line,col:c.col,path:""})}function o(d,c={}){let p=ho(d),l=r.contents,f={line:1,col:1},m=h=>{let y=h?.range;y&&(f=i(y[0]))};m(l);for(let h=0;h<p.length;h++){let y=p[h];if(et(l)){let g=l.items.find(k=>be(k)&&de(k.key)&&String(k.key.value)===String(y));if(!g)break;if(c.key&&h===p.length-1)return m(g.key),f;m(g.key),l=g.value,l&&m(l)}else if(tt(l)&&typeof y=="number"){if(l=l.items[y],!l)break;m(l)}else break}return f}function t(d){let c=r.contents;for(let m of ho(d)){if(et(c)){let h=c.items.find(y=>be(y)&&de(y.key)&&String(y.key.value)===String(m));if(!h)return;c=h.value}else if(tt(c)&&typeof m=="number")c=c.items[m];else return;if(!c)return}let p=c.range;if(!p)return;let l=e.linePos(Math.max(p[0],p[1]-1)).line,f=s.split(/\r?\n/);for(;l>e.linePos(p[0]).line&&/^\s*(#.*)?$/.test(f[l-1]??"");)l--;return{start:e.linePos(p[0]).line,end:l}}let a=null;return r.errors.length||(a=r.toJS({maxAliasCount:100})),{data:a,locate:o,span:t,diags:n}}var bo=nn,$e={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://isodiag.local/schema/isodiag-1.json",title:"isodiag diagram",description:"A page of isometric, animated diagrams. See docs/FORMAT.md.",type:"object",required:["isodiag","scenes"],additionalProperties:!1,properties:{isodiag:{const:1,description:"Format version. Always 1."},title:{type:"string"},lede:{type:"string"},pills:{type:"array",items:{type:"string"}},theme:{type:"string",description:"'default' or a path to a theme file"},roles:{type:"object",description:"Extra or changed colour roles for nodes and regions",additionalProperties:{$ref:"#/$defs/role"}},kinds:{type:"object",description:"Extra flow kinds, or new legend text for the standard ones",additionalProperties:{$ref:"#/$defs/kindDef"}},after:{type:"string",description:"Markdown shown after all scenes"},grid:{$ref:"#/$defs/grid"},assemble:{type:"boolean",description:"draw each scene by flying its parts in from the nearest edge, then play"},footer:{type:"string"},treatment:{enum:["mono"],description:"How a self-contained drawing (renderSvg, <isometric-diagram>) is painted: mono, black and white. A host may say otherwise. The page isodiag build writes is in colour."},scenes:{type:"array",minItems:1,items:{$ref:"#/$defs/scene"}}},$defs:{motion:{type:"object",additionalProperties:!1,minProperties:1,description:"how this piece (a region: its contents too) moves when the drawing assembles or disassembles",properties:{style:{enum:["edge","drop","rise","fly","pop","scatter","build","fade"],description:"how it arrives"},out:{enum:["explode","lift-off","sink","scatter","fly-out","collapse","fade","reverse"],description:"how it leaves"},easing:{enum:["linear","ease","ease-in","ease-out","settle","spring","bounce"]},from:{enum:["left","right","top","bottom"],description:"fly: the side it comes from"},delay:{type:"number",minimum:0,description:"ms after its turn"},duration:{type:"number",exclusiveMinimum:0,description:"ms its own move takes"}}},variants:{type:"object",minProperties:1,propertyNames:{$ref:"#/$defs/id"},description:"other looks of it, by name, for a motion to switch to (its box stays as it is)",additionalProperties:{type:"object",additionalProperties:!1,minProperties:1,properties:{role:{type:"string"},ghost:{type:"boolean"},label:{type:"string"},sub:{type:"string"},face:{type:"string",pattern:"^[a-z][a-z0-9-]*$"},deco:{type:"array",items:{$ref:"#/$defs/deco"}}}}},id:{type:"string",pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},grid:{type:"object",additionalProperties:!1,properties:{snap:{type:"number",exclusiveMinimum:0,description:"round every placed edge and route waypoint to this step, in grid units"},show:{type:"boolean",description:"draw the floor grid when the page opens (the Grid button toggles it)"},step:{type:"number",exclusiveMinimum:0,description:"spacing of the drawn grid lines; default the snap step, or 1"}}},num:{type:"number"},point2:{type:"array",items:{type:"number"},minItems:2,maxItems:2},size2or3:{type:"array",items:{type:"number",exclusiveMinimum:0},minItems:2,maxItems:3},stepRef:{anyOf:[{type:"string"},{type:"integer",minimum:1}]},side:{enum:["n","e","s","w"]},align:{enum:["start","center","end"]},role:{type:"object",additionalProperties:!1,required:["h","s"],properties:{h:{type:"number",minimum:0,maximum:360,description:"hue"},s:{type:"number",minimum:0,maximum:100,description:"saturation, percent"},top:{type:"string",description:"CSS colour for the top face, overriding the computed one"},tint:{type:"number",minimum:0,maximum:100,description:"percent of the role colour mixed into the pad colour for the top face"}}},kindDef:{type:"object",additionalProperties:!1,properties:{legend:{type:"string"},like:{type:"string",description:"a standard kind whose colour and line style this one uses"},color:{type:"string"},dash:{enum:["solid","dashed","dotted"]}}},placement:{properties:{in:{$ref:"#/$defs/id"},at:{$ref:"#/$defs/point2"},"right-of":{$ref:"#/$defs/id"},"left-of":{$ref:"#/$defs/id"},below:{$ref:"#/$defs/id"},behind:{$ref:"#/$defs/id"},gap:{type:"number"},align:{$ref:"#/$defs/align"},shift:{$ref:"#/$defs/point2",description:"nudge after placement, grid units [dx, dy]"},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}},scene:{type:"object",required:["id","title"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},ants:{description:"its connectors march, showing which way they flow: all that may, these, or with a speed (units a second) and a dash",anyOf:[{type:"boolean"},{type:"array",items:{type:"string"}},{type:"object",additionalProperties:!1,properties:{ids:{type:"array",items:{type:"string"}},speed:{type:"number"},dash:{type:"array",items:{type:"number",exclusiveMinimum:0},minItems:2,maxItems:2}}}]},motion:{type:"object",description:"the scene's motion document (isomotion/1; its `isomotion: 1` may be left out)"},caption:{type:"string"},aria:{type:"string"},gap:{type:"number",exclusiveMinimum:0},flow:{enum:["row","column"]},regions:{type:"array",items:{$ref:"#/$defs/region"}},nodes:{type:"array",items:{$ref:"#/$defs/node"}},routes:{type:"array",items:{$ref:"#/$defs/route"}},notes:{type:"array",items:{$ref:"#/$defs/note"}},steps:{type:"array",items:{$ref:"#/$defs/step"}},legend:{anyOf:[{enum:["auto"]},{const:!1},{type:"array",items:{type:"string"}}]},badges:{type:"boolean"},grid:{$ref:"#/$defs/grid"},assemble:{type:"boolean",description:"draw the scene by flying its parts in from the nearest edge, then play"},loop:{type:"boolean",description:"the player wraps from the last step to the first (default true)"},dim:{enum:["flows","all"],description:"what a step dims: only flows, their labels and marks (default), or nodes too"},after:{type:"string"}}},region:{type:"object",required:["id","kind"],unevaluatedProperties:!1,allOf:[{$ref:"#/$defs/placement"}],properties:{id:{$ref:"#/$defs/id"},kind:{enum:["slab","pad","fence","vm","cloud","zone","platform","tunnel"]},label:{type:"string"},"label-style":{enum:["face","face-right","floor","none"]},ghost:{type:"boolean",description:"drawn as a dashed outline: not there yet, out of reach, or stopped"},role:{type:"string"},size:{$ref:"#/$defs/size2or3"},padding:{type:"number",minimum:0},height:{type:"number",exclusiveMinimum:0},z:{type:"number",description:"lift above the floor it stands on (tunnels)"},flow:{enum:["row","column"]},gate:{type:"object",additionalProperties:!1,required:["side"],properties:{side:{$ref:"#/$defs/side"},at:{type:"number",minimum:0,maximum:1,description:"centre of the gate along the wall, 0..1"},width:{type:"number",exclusiveMinimum:0},height:{type:"number",exclusiveMinimum:0},node:{$ref:"#/$defs/id"}}},around:{type:"array",items:{$ref:"#/$defs/id"},description:"tunnel: routes it wraps"},regions:{type:"array",items:{$ref:"#/$defs/region"}},motion:{$ref:"#/$defs/motion"},variants:{$ref:"#/$defs/variants"},nodes:{type:"array",items:{$ref:"#/$defs/node"}}}},deco:{anyOf:[{enum:["envelope","bubble","file-lines","ghost","terminal"]},{type:"object",additionalProperties:!1,minProperties:1,maxProperties:1,properties:{terminal:{type:"integer",minimum:1,maximum:8},icon:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"an icon the host registers (none by default); one nothing registers is drawn as a placeholder, with a warning"},screen:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"terminal, chat, desktop, tiles, or a face the host registers"}}}]},node:{type:"object",required:["id"],unevaluatedProperties:!1,allOf:[{$ref:"#/$defs/placement"}],properties:{id:{$ref:"#/$defs/id"},asset:{type:"string",description:"asset name from the library; default 'block'"},role:{type:"string",description:"colour role"},label:{type:"string"},sub:{type:"string"},size:{$ref:"#/$defs/size2or3"},z:{type:"number",description:"lift above the floor it stands on"},deco:{type:"array",items:{$ref:"#/$defs/deco"}},ghost:{type:"boolean"},face:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"screen asset: what the screen shows: terminal, chat, desktop, tiles, or a face the host registers"},facing:{type:"number",description:"screen asset: rotation in degrees"},"label-at":{type:"object",additionalProperties:!1,properties:{side:{enum:["above","right","left","below"]},dx:{type:"number"},dy:{type:"number"}}},motion:{$ref:"#/$defs/motion"},variants:{$ref:"#/$defs/variants"},nodes:{type:"array",items:{$ref:"#/$defs/node"},description:"nodes standing on top of this one"}}},endpoint:{type:"string",pattern:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"},route:{type:"object",required:["id","from","to"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},from:{$ref:"#/$defs/endpoint"},to:{$ref:"#/$defs/endpoint"},kind:{type:"string"},via:{type:"array",items:{anyOf:[{$ref:"#/$defs/point2"},{$ref:"#/$defs/endpoint"}]}},points:{type:"array",items:{type:"array",items:{type:"number"},minItems:2,maxItems:3},description:"exact polyline in grid units; skips the router"},lane:{type:"number"},arrow:{type:"boolean"},cross:{type:"boolean",description:"the route may pass through fence walls (it crosses a boundary)"},label:{anyOf:[{type:"string"},{type:"object",additionalProperties:!1,required:["text"],properties:{text:{type:"string"},along:{type:"integer",minimum:1},side:{enum:["left","right"]},at:{type:"array",items:{type:"number"},minItems:2,maxItems:3,description:"exact place [x, y] or [x, y, z]; skips placement"},dir:{enum:["x","y"]},anchor:{enum:["start","middle","end"]}}}]},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}},note:{type:"object",additionalProperties:!1,properties:{floor:{type:"string"},face:{type:"string"},label:{type:"string"},sub:{type:"string"},at:{anyOf:[{$ref:"#/$defs/point2"},{type:"array",items:{type:"number"},minItems:3,maxItems:3}]},on:{$ref:"#/$defs/id",description:"a node, region or route; a note on a route dims and lights with it"},kind:{type:"string"},dir:{enum:["x","y"]},anchor:{enum:["start","middle","end"]},dx:{type:"number"},dy:{type:"number"},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}},routeRef:{anyOf:[{type:"string"},{type:"object",minProperties:1,maxProperties:1,additionalProperties:{type:"string"}}]},phase:{anyOf:[{$ref:"#/$defs/routeRef"},{type:"array",items:{$ref:"#/$defs/routeRef"}}]},step:{type:"object",required:["heading"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},number:{type:"integer",minimum:1,description:"the number shown; defaults to the position"},kind:{type:"string"},heading:{type:"string"},caption:{type:"string"},command:{type:"string"},animate:{type:"array",items:{$ref:"#/$defs/phase"}},pulse:{type:"array",items:{$ref:"#/$defs/id"}},highlight:{type:"array",items:{$ref:"#/$defs/id"}},focus:{type:"array",items:{$ref:"#/$defs/id"},description:"nodes or regions to zoom to for this step; the view eases back on steps without focus"},show:{type:"array",items:{$ref:"#/$defs/id"}},hide:{type:"array",items:{$ref:"#/$defs/id"}},say:{type:"array",items:{type:"object",additionalProperties:!1,required:["at","text"],properties:{at:{anyOf:[{$ref:"#/$defs/id"},{type:"array",items:{type:"number"},minItems:2,maxItems:3}],description:"a node (the callout sits above it) or a grid point [x, y, z]"},text:{type:"string"},kind:{type:"string"},dx:{type:"number"},dy:{type:"number"},anchor:{enum:["start","middle","end"]}}}},mark:{type:"array",items:{type:"object",additionalProperties:!1,properties:{on:{$ref:"#/$defs/id"},at:{type:"array",items:{type:"number"},minItems:2,maxItems:3}}}},badge:{anyOf:[{type:"boolean"},{$ref:"#/$defs/id"},{type:"array",items:{type:"number"},minItems:2,maxItems:3}],description:"false, a route or node id, or a grid point [x, y, z]"},duration:{anyOf:[{const:"auto"},{type:"integer",minimum:500}]}}}}},Be={type:"object",additionalProperties:!1,required:["h","s"],properties:{h:{type:"number",minimum:0,maximum:360,description:"hue"},s:{type:"number",minimum:0,maximum:100,description:"saturation, percent"},top:{type:"string",description:"CSS colour for the top face, overriding the computed one"},tint:{type:"number",minimum:0,maximum:100,description:"percent of the role colour mixed into the pad colour for the top face"}}},ut={type:"object",additionalProperties:!1,properties:{legend:{type:"string"},like:{type:"string",description:"a standard kind whose colour and line style this one uses"},color:{type:"string"},dash:{enum:["solid","dashed","dotted"]}}},_e={type:"object",additionalProperties:!1,properties:{snap:{type:"number",exclusiveMinimum:0,description:"round every placed edge and route waypoint to this step, in grid units"},show:{type:"boolean",description:"draw the floor grid when the page opens (the Grid button toggles it)"},step:{type:"number",exclusiveMinimum:0,description:"spacing of the drawn grid lines; default the snap step, or 1"}}},nr=Object.prototype.hasOwnProperty,Y={type:"object",required:["id","title"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},ants:{description:"its connectors march, showing which way they flow: all that may, these, or with a speed (units a second) and a dash",anyOf:[{type:"boolean"},{type:"array",items:{type:"string"}},{type:"object",additionalProperties:!1,properties:{ids:{type:"array",items:{type:"string"}},speed:{type:"number"},dash:{type:"array",items:{type:"number",exclusiveMinimum:0},minItems:2,maxItems:2}}}]},motion:{type:"object",description:"the scene's motion document (isomotion/1; its `isomotion: 1` may be left out)"},caption:{type:"string"},aria:{type:"string"},gap:{type:"number",exclusiveMinimum:0},flow:{enum:["row","column"]},regions:{type:"array",items:{$ref:"#/$defs/region"}},nodes:{type:"array",items:{$ref:"#/$defs/node"}},routes:{type:"array",items:{$ref:"#/$defs/route"}},notes:{type:"array",items:{$ref:"#/$defs/note"}},steps:{type:"array",items:{$ref:"#/$defs/step"}},legend:{anyOf:[{enum:["auto"]},{const:!1},{type:"array",items:{type:"string"}}]},badges:{type:"boolean"},grid:{$ref:"#/$defs/grid"},assemble:{type:"boolean",description:"draw the scene by flying its parts in from the nearest edge, then play"},loop:{type:"boolean",description:"the player wraps from the last step to the first (default true)"},dim:{enum:["flows","all"],description:"what a step dims: only flows, their labels and marks (default), or nodes too"},after:{type:"string"}}},H={type:"string",pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},Ce=new RegExp("^[A-Za-z][A-Za-z0-9_-]*$","u"),ce={type:"object",required:["id","kind"],unevaluatedProperties:!1,allOf:[{$ref:"#/$defs/placement"}],properties:{id:{$ref:"#/$defs/id"},kind:{enum:["slab","pad","fence","vm","cloud","zone","platform","tunnel"]},label:{type:"string"},"label-style":{enum:["face","face-right","floor","none"]},ghost:{type:"boolean",description:"drawn as a dashed outline: not there yet, out of reach, or stopped"},role:{type:"string"},size:{$ref:"#/$defs/size2or3"},padding:{type:"number",minimum:0},height:{type:"number",exclusiveMinimum:0},z:{type:"number",description:"lift above the floor it stands on (tunnels)"},flow:{enum:["row","column"]},gate:{type:"object",additionalProperties:!1,required:["side"],properties:{side:{$ref:"#/$defs/side"},at:{type:"number",minimum:0,maximum:1,description:"centre of the gate along the wall, 0..1"},width:{type:"number",exclusiveMinimum:0},height:{type:"number",exclusiveMinimum:0},node:{$ref:"#/$defs/id"}}},around:{type:"array",items:{$ref:"#/$defs/id"},description:"tunnel: routes it wraps"},regions:{type:"array",items:{$ref:"#/$defs/region"}},motion:{$ref:"#/$defs/motion"},variants:{$ref:"#/$defs/variants"},nodes:{type:"array",items:{$ref:"#/$defs/node"}}}},rt={type:"array",items:{type:"number",exclusiveMinimum:0},minItems:2,maxItems:3},gi={enum:["n","e","s","w"]},ue={type:"object",additionalProperties:!1,minProperties:1,description:"how this piece (a region: its contents too) moves when the drawing assembles or disassembles",properties:{style:{enum:["edge","drop","rise","fly","pop","scatter","build","fade"],description:"how it arrives"},out:{enum:["explode","lift-off","sink","scatter","fly-out","collapse","fade","reverse"],description:"how it leaves"},easing:{enum:["linear","ease","ease-in","ease-out","settle","spring","bounce"]},from:{enum:["left","right","top","bottom"],description:"fly: the side it comes from"},delay:{type:"number",minimum:0,description:"ms after its turn"},duration:{type:"number",exclusiveMinimum:0,description:"ms its own move takes"}}},go={properties:{in:{$ref:"#/$defs/id"},at:{$ref:"#/$defs/point2"},"right-of":{$ref:"#/$defs/id"},"left-of":{$ref:"#/$defs/id"},below:{$ref:"#/$defs/id"},behind:{$ref:"#/$defs/id"},gap:{type:"number"},align:{$ref:"#/$defs/align"},shift:{$ref:"#/$defs/point2",description:"nudge after placement, grid units [dx, dy]"},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}},Ne={type:"array",items:{type:"number"},minItems:2,maxItems:2},bi={enum:["start","center","end"]},ye={anyOf:[{type:"string"},{type:"integer",minimum:1}]};function Kt(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=Kt.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),s&&typeof s=="object"&&!Array.isArray(s)){if(s.in!==void 0){let l=s.in;if(typeof l=="string"){if(!Ce.test(l)){let f={instancePath:e+"/in",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/in",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}if(s.at!==void 0){let l=s.at;if(Array.isArray(l)){if(l.length>2){let m={instancePath:e+"/at",schemaPath:"#/$defs/point2/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items",schema:2,parentSchema:Ne,data:l};t===null?t=[m]:t.push(m),a++}if(l.length<2){let m={instancePath:e+"/at",schemaPath:"#/$defs/point2/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:Ne,data:l};t===null?t=[m]:t.push(m),a++}let f=l.length;for(let m=0;m<f;m++){let h=l[m];if(typeof h!="number"){let y={instancePath:e+"/at/"+m,schemaPath:"#/$defs/point2/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Ne.items.type,parentSchema:Ne.items,data:h};t===null?t=[y]:t.push(y),a++}}}else{let f={instancePath:e+"/at",schemaPath:"#/$defs/point2/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Ne.type,parentSchema:Ne,data:l};t===null?t=[f]:t.push(f),a++}}if(s["right-of"]!==void 0){let l=s["right-of"];if(typeof l=="string"){if(!Ce.test(l)){let f={instancePath:e+"/right-of",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/right-of",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}if(s["left-of"]!==void 0){let l=s["left-of"];if(typeof l=="string"){if(!Ce.test(l)){let f={instancePath:e+"/left-of",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/left-of",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}if(s.below!==void 0){let l=s.below;if(typeof l=="string"){if(!Ce.test(l)){let f={instancePath:e+"/below",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/below",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}if(s.behind!==void 0){let l=s.behind;if(typeof l=="string"){if(!Ce.test(l)){let f={instancePath:e+"/behind",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/behind",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}if(s.gap!==void 0){let l=s.gap;if(typeof l!="number"){let f={instancePath:e+"/gap",schemaPath:"#/properties/gap/type",keyword:"type",params:{type:"number"},message:"must be number",schema:go.properties.gap.type,parentSchema:go.properties.gap,data:l};t===null?t=[f]:t.push(f),a++}}if(s.align!==void 0){let l=s.align;if(!(l==="start"||l==="center"||l==="end")){let f={instancePath:e+"/align",schemaPath:"#/$defs/align/enum",keyword:"enum",params:{allowedValues:bi.enum},message:"must be equal to one of the allowed values",schema:bi.enum,parentSchema:bi,data:l};t===null?t=[f]:t.push(f),a++}}if(s.shift!==void 0){let l=s.shift;if(Array.isArray(l)){if(l.length>2){let m={instancePath:e+"/shift",schemaPath:"#/$defs/point2/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items",schema:2,parentSchema:Ne,data:l};t===null?t=[m]:t.push(m),a++}if(l.length<2){let m={instancePath:e+"/shift",schemaPath:"#/$defs/point2/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:Ne,data:l};t===null?t=[m]:t.push(m),a++}let f=l.length;for(let m=0;m<f;m++){let h=l[m];if(typeof h!="number"){let y={instancePath:e+"/shift/"+m,schemaPath:"#/$defs/point2/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Ne.items.type,parentSchema:Ne.items,data:h};t===null?t=[y]:t.push(y),a++}}}else{let f={instancePath:e+"/shift",schemaPath:"#/$defs/point2/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Ne.type,parentSchema:Ne,data:l};t===null?t=[f]:t.push(f),a++}}if(s.appears!==void 0){let l=s.appears,f=a,m=!1,h=a;if(typeof l!="string"){let g={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ye.anyOf[0].type,parentSchema:ye.anyOf[0],data:l};t===null?t=[g]:t.push(g),a++}var c=h===a;m=m||c;let y=a;if(!(typeof l=="number"&&!(l%1)&&!isNaN(l))){let g={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/1/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:ye.anyOf[1].type,parentSchema:ye.anyOf[1],data:l};t===null?t=[g]:t.push(g),a++}if(typeof l=="number"&&(l<1||isNaN(l))){let g={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/1/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:ye.anyOf[1],data:l};t===null?t=[g]:t.push(g),a++}var c=y===a;if(m=m||c,m)a=f,t!==null&&(f?t.length=f:t=null);else{let g={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:ye.anyOf,parentSchema:ye,data:l};t===null?t=[g]:t.push(g),a++}}if(s.disappears!==void 0){let l=s.disappears,f=a,m=!1,h=a;if(typeof l!="string"){let g={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ye.anyOf[0].type,parentSchema:ye.anyOf[0],data:l};t===null?t=[g]:t.push(g),a++}var p=h===a;m=m||p;let y=a;if(!(typeof l=="number"&&!(l%1)&&!isNaN(l))){let g={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/1/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:ye.anyOf[1].type,parentSchema:ye.anyOf[1],data:l};t===null?t=[g]:t.push(g),a++}if(typeof l=="number"&&(l<1||isNaN(l))){let g={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/1/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:ye.anyOf[1],data:l};t===null?t=[g]:t.push(g),a++}var p=y===a;if(m=m||p,m)a=f,t!==null&&(f?t.length=f:t=null);else{let g={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:ye.anyOf,parentSchema:ye,data:l};t===null?t=[g]:t.push(g),a++}}}return Kt.errors=t,a===0}Kt.evaluated={props:{in:!0,at:!0,"right-of":!0,"left-of":!0,below:!0,behind:!0,gap:!0,align:!0,shift:!0,appears:!0,disappears:!0},dynamicProps:!1,dynamicItems:!1};var Re={type:"object",minProperties:1,propertyNames:{$ref:"#/$defs/id"},description:"other looks of it, by name, for a motion to switch to (its box stays as it is)",additionalProperties:{type:"object",additionalProperties:!1,minProperties:1,properties:{role:{type:"string"},ghost:{type:"boolean"},label:{type:"string"},sub:{type:"string"},face:{type:"string",pattern:"^[a-z][a-z0-9-]*$"},deco:{type:"array",items:{$ref:"#/$defs/deco"}}}}},ge={anyOf:[{enum:["envelope","bubble","file-lines","ghost","terminal"]},{type:"object",additionalProperties:!1,minProperties:1,maxProperties:1,properties:{terminal:{type:"integer",minimum:1,maximum:8},icon:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"an icon the host registers (none by default); one nothing registers is drawn as a placeholder, with a warning"},screen:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"terminal, chat, desktop, tiles, or a face the host registers"}}}]},Os=new RegExp("^[a-z][a-z0-9-]*$","u");function Ft(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=Ft.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),s&&typeof s=="object"&&!Array.isArray(s)){if(Object.keys(s).length<1){let l={instancePath:e,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit:1},message:"must NOT have fewer than 1 properties",schema:1,parentSchema:Re,data:s};t===null?t=[l]:t.push(l),a++}for(let l in s){let f=a;if(typeof l=="string"){if(!Ce.test(l)){let m={instancePath:e,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:l,propertyName:l};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e,schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:l,propertyName:l};t===null?t=[m]:t.push(m),a++}var c=f===a;if(!c){let m={instancePath:e,schemaPath:"#/propertyNames",keyword:"propertyNames",params:{propertyName:l},message:"property name must be valid",schema:Re.propertyNames,parentSchema:Re,data:s};t===null?t=[m]:t.push(m),a++}}for(let l in s){let f=s[l];if(f&&typeof f=="object"&&!Array.isArray(f)){if(Object.keys(f).length<1){let m={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/minProperties",keyword:"minProperties",params:{limit:1},message:"must NOT have fewer than 1 properties",schema:1,parentSchema:Re.additionalProperties,data:f};t===null?t=[m]:t.push(m),a++}for(let m in f)if(!(m==="role"||m==="ghost"||m==="label"||m==="sub"||m==="face"||m==="deco")){let h={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m},message:"must NOT have additional properties",schema:!1,parentSchema:Re.additionalProperties,data:f};t===null?t=[h]:t.push(h),a++}if(f.role!==void 0){let m=f.role;if(typeof m!="string"){let h={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/role",schemaPath:"#/additionalProperties/properties/role/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Re.additionalProperties.properties.role.type,parentSchema:Re.additionalProperties.properties.role,data:m};t===null?t=[h]:t.push(h),a++}}if(f.ghost!==void 0){let m=f.ghost;if(typeof m!="boolean"){let h={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/ghost",schemaPath:"#/additionalProperties/properties/ghost/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:Re.additionalProperties.properties.ghost.type,parentSchema:Re.additionalProperties.properties.ghost,data:m};t===null?t=[h]:t.push(h),a++}}if(f.label!==void 0){let m=f.label;if(typeof m!="string"){let h={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/label",schemaPath:"#/additionalProperties/properties/label/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Re.additionalProperties.properties.label.type,parentSchema:Re.additionalProperties.properties.label,data:m};t===null?t=[h]:t.push(h),a++}}if(f.sub!==void 0){let m=f.sub;if(typeof m!="string"){let h={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/sub",schemaPath:"#/additionalProperties/properties/sub/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Re.additionalProperties.properties.sub.type,parentSchema:Re.additionalProperties.properties.sub,data:m};t===null?t=[h]:t.push(h),a++}}if(f.face!==void 0){let m=f.face;if(typeof m=="string"){if(!Os.test(m)){let h={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/face",schemaPath:"#/additionalProperties/properties/face/pattern",keyword:"pattern",params:{pattern:"^[a-z][a-z0-9-]*$"},message:'must match pattern "^[a-z][a-z0-9-]*$"',schema:"^[a-z][a-z0-9-]*$",parentSchema:Re.additionalProperties.properties.face,data:m};t===null?t=[h]:t.push(h),a++}}else{let h={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/face",schemaPath:"#/additionalProperties/properties/face/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Re.additionalProperties.properties.face.type,parentSchema:Re.additionalProperties.properties.face,data:m};t===null?t=[h]:t.push(h),a++}}if(f.deco!==void 0){let m=f.deco;if(Array.isArray(m)){let h=m.length;for(let y=0;y<h;y++){let g=m[y],k=a,u=!1,b=a;if(!(g==="envelope"||g==="bubble"||g==="file-lines"||g==="ghost"||g==="terminal")){let $={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y,schemaPath:"#/$defs/deco/anyOf/0/enum",keyword:"enum",params:{allowedValues:ge.anyOf[0].enum},message:"must be equal to one of the allowed values",schema:ge.anyOf[0].enum,parentSchema:ge.anyOf[0],data:g};t===null?t=[$]:t.push($),a++}var p=b===a;u=u||p;let x=a;if(g&&typeof g=="object"&&!Array.isArray(g)){if(Object.keys(g).length>1){let $={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y,schemaPath:"#/$defs/deco/anyOf/1/maxProperties",keyword:"maxProperties",params:{limit:1},message:"must NOT have more than 1 properties",schema:1,parentSchema:ge.anyOf[1],data:g};t===null?t=[$]:t.push($),a++}if(Object.keys(g).length<1){let $={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y,schemaPath:"#/$defs/deco/anyOf/1/minProperties",keyword:"minProperties",params:{limit:1},message:"must NOT have fewer than 1 properties",schema:1,parentSchema:ge.anyOf[1],data:g};t===null?t=[$]:t.push($),a++}for(let $ in g)if(!($==="terminal"||$==="icon"||$==="screen")){let P={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y,schemaPath:"#/$defs/deco/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:$},message:"must NOT have additional properties",schema:!1,parentSchema:ge.anyOf[1],data:g};t===null?t=[P]:t.push(P),a++}if(g.terminal!==void 0){let $=g.terminal;if(!(typeof $=="number"&&!($%1)&&!isNaN($))){let P={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y+"/terminal",schemaPath:"#/$defs/deco/anyOf/1/properties/terminal/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:ge.anyOf[1].properties.terminal.type,parentSchema:ge.anyOf[1].properties.terminal,data:$};t===null?t=[P]:t.push(P),a++}if(typeof $=="number"){if($>8||isNaN($)){let P={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y+"/terminal",schemaPath:"#/$defs/deco/anyOf/1/properties/terminal/maximum",keyword:"maximum",params:{comparison:"<=",limit:8},message:"must be <= 8",schema:8,parentSchema:ge.anyOf[1].properties.terminal,data:$};t===null?t=[P]:t.push(P),a++}if($<1||isNaN($)){let P={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y+"/terminal",schemaPath:"#/$defs/deco/anyOf/1/properties/terminal/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:ge.anyOf[1].properties.terminal,data:$};t===null?t=[P]:t.push(P),a++}}}if(g.icon!==void 0){let $=g.icon;if(typeof $=="string"){if(!Os.test($)){let P={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y+"/icon",schemaPath:"#/$defs/deco/anyOf/1/properties/icon/pattern",keyword:"pattern",params:{pattern:"^[a-z][a-z0-9-]*$"},message:'must match pattern "^[a-z][a-z0-9-]*$"',schema:"^[a-z][a-z0-9-]*$",parentSchema:ge.anyOf[1].properties.icon,data:$};t===null?t=[P]:t.push(P),a++}}else{let P={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y+"/icon",schemaPath:"#/$defs/deco/anyOf/1/properties/icon/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ge.anyOf[1].properties.icon.type,parentSchema:ge.anyOf[1].properties.icon,data:$};t===null?t=[P]:t.push(P),a++}}if(g.screen!==void 0){let $=g.screen;if(typeof $=="string"){if(!Os.test($)){let P={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y+"/screen",schemaPath:"#/$defs/deco/anyOf/1/properties/screen/pattern",keyword:"pattern",params:{pattern:"^[a-z][a-z0-9-]*$"},message:'must match pattern "^[a-z][a-z0-9-]*$"',schema:"^[a-z][a-z0-9-]*$",parentSchema:ge.anyOf[1].properties.screen,data:$};t===null?t=[P]:t.push(P),a++}}else{let P={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y+"/screen",schemaPath:"#/$defs/deco/anyOf/1/properties/screen/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ge.anyOf[1].properties.screen.type,parentSchema:ge.anyOf[1].properties.screen,data:$};t===null?t=[P]:t.push(P),a++}}}else{let $={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y,schemaPath:"#/$defs/deco/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ge.anyOf[1].type,parentSchema:ge.anyOf[1],data:g};t===null?t=[$]:t.push($),a++}var p=x===a;if(u=u||p,u)a=k,t!==null&&(k?t.length=k:t=null);else{let $={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco/"+y,schemaPath:"#/$defs/deco/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:ge.anyOf,parentSchema:ge,data:g};t===null?t=[$]:t.push($),a++}}}else{let h={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1")+"/deco",schemaPath:"#/additionalProperties/properties/deco/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Re.additionalProperties.properties.deco.type,parentSchema:Re.additionalProperties.properties.deco,data:m};t===null?t=[h]:t.push(h),a++}}}else{let m={instancePath:e+"/"+l.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Re.additionalProperties.type,parentSchema:Re.additionalProperties,data:f};t===null?t=[m]:t.push(m),a++}}}else{let l={instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Re.type,parentSchema:Re,data:s};t===null?t=[l]:t.push(l),a++}return Ft.errors=t,a===0}Ft.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};var ke={type:"object",required:["id"],unevaluatedProperties:!1,allOf:[{$ref:"#/$defs/placement"}],properties:{id:{$ref:"#/$defs/id"},asset:{type:"string",description:"asset name from the library; default 'block'"},role:{type:"string",description:"colour role"},label:{type:"string"},sub:{type:"string"},size:{$ref:"#/$defs/size2or3"},z:{type:"number",description:"lift above the floor it stands on"},deco:{type:"array",items:{$ref:"#/$defs/deco"}},ghost:{type:"boolean"},face:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"screen asset: what the screen shows: terminal, chat, desktop, tiles, or a face the host registers"},facing:{type:"number",description:"screen asset: rotation in degrees"},"label-at":{type:"object",additionalProperties:!1,properties:{side:{enum:["above","right","left","below"]},dx:{type:"number"},dy:{type:"number"}}},motion:{$ref:"#/$defs/motion"},variants:{$ref:"#/$defs/variants"},nodes:{type:"array",items:{$ref:"#/$defs/node"},description:"nodes standing on top of this one"}}},wi={validate:jt};function jt(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=jt.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),Kt(s,{instancePath:e,parentData:r,parentDataProperty:n,rootData:i,dynamicAnchors:o})||(t=t===null?Kt.errors:t.concat(Kt.errors),a=t.length),s&&typeof s=="object"&&!Array.isArray(s)){if(s.id===void 0){let p={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'",schema:ke.required,parentSchema:ke,data:s};t===null?t=[p]:t.push(p),a++}if(s.id!==void 0){let p=s.id;if(typeof p=="string"){if(!Ce.test(p)){let l={instancePath:e+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:p};t===null?t=[l]:t.push(l),a++}}if(s.asset!==void 0){let p=s.asset;if(typeof p!="string"){let l={instancePath:e+"/asset",schemaPath:"#/properties/asset/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ke.properties.asset.type,parentSchema:ke.properties.asset,data:p};t===null?t=[l]:t.push(l),a++}}if(s.role!==void 0){let p=s.role;if(typeof p!="string"){let l={instancePath:e+"/role",schemaPath:"#/properties/role/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ke.properties.role.type,parentSchema:ke.properties.role,data:p};t===null?t=[l]:t.push(l),a++}}if(s.label!==void 0){let p=s.label;if(typeof p!="string"){let l={instancePath:e+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ke.properties.label.type,parentSchema:ke.properties.label,data:p};t===null?t=[l]:t.push(l),a++}}if(s.sub!==void 0){let p=s.sub;if(typeof p!="string"){let l={instancePath:e+"/sub",schemaPath:"#/properties/sub/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ke.properties.sub.type,parentSchema:ke.properties.sub,data:p};t===null?t=[l]:t.push(l),a++}}if(s.size!==void 0){let p=s.size;if(Array.isArray(p)){if(p.length>3){let f={instancePath:e+"/size",schemaPath:"#/$defs/size2or3/maxItems",keyword:"maxItems",params:{limit:3},message:"must NOT have more than 3 items",schema:3,parentSchema:rt,data:p};t===null?t=[f]:t.push(f),a++}if(p.length<2){let f={instancePath:e+"/size",schemaPath:"#/$defs/size2or3/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:rt,data:p};t===null?t=[f]:t.push(f),a++}let l=p.length;for(let f=0;f<l;f++){let m=p[f];if(typeof m=="number"){if(m<=0||isNaN(m)){let h={instancePath:e+"/size/"+f,schemaPath:"#/$defs/size2or3/items/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:rt.items,data:m};t===null?t=[h]:t.push(h),a++}}else{let h={instancePath:e+"/size/"+f,schemaPath:"#/$defs/size2or3/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:rt.items.type,parentSchema:rt.items,data:m};t===null?t=[h]:t.push(h),a++}}}else{let l={instancePath:e+"/size",schemaPath:"#/$defs/size2or3/type",keyword:"type",params:{type:"array"},message:"must be array",schema:rt.type,parentSchema:rt,data:p};t===null?t=[l]:t.push(l),a++}}if(s.z!==void 0){let p=s.z;if(typeof p!="number"){let l={instancePath:e+"/z",schemaPath:"#/properties/z/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ke.properties.z.type,parentSchema:ke.properties.z,data:p};t===null?t=[l]:t.push(l),a++}}if(s.deco!==void 0){let p=s.deco;if(Array.isArray(p)){let l=p.length;for(let f=0;f<l;f++){let m=p[f],h=a,y=!1,g=a;if(!(m==="envelope"||m==="bubble"||m==="file-lines"||m==="ghost"||m==="terminal")){let u={instancePath:e+"/deco/"+f,schemaPath:"#/$defs/deco/anyOf/0/enum",keyword:"enum",params:{allowedValues:ge.anyOf[0].enum},message:"must be equal to one of the allowed values",schema:ge.anyOf[0].enum,parentSchema:ge.anyOf[0],data:m};t===null?t=[u]:t.push(u),a++}var c=g===a;y=y||c;let k=a;if(m&&typeof m=="object"&&!Array.isArray(m)){if(Object.keys(m).length>1){let u={instancePath:e+"/deco/"+f,schemaPath:"#/$defs/deco/anyOf/1/maxProperties",keyword:"maxProperties",params:{limit:1},message:"must NOT have more than 1 properties",schema:1,parentSchema:ge.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}if(Object.keys(m).length<1){let u={instancePath:e+"/deco/"+f,schemaPath:"#/$defs/deco/anyOf/1/minProperties",keyword:"minProperties",params:{limit:1},message:"must NOT have fewer than 1 properties",schema:1,parentSchema:ge.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}for(let u in m)if(!(u==="terminal"||u==="icon"||u==="screen")){let b={instancePath:e+"/deco/"+f,schemaPath:"#/$defs/deco/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:u},message:"must NOT have additional properties",schema:!1,parentSchema:ge.anyOf[1],data:m};t===null?t=[b]:t.push(b),a++}if(m.terminal!==void 0){let u=m.terminal;if(!(typeof u=="number"&&!(u%1)&&!isNaN(u))){let b={instancePath:e+"/deco/"+f+"/terminal",schemaPath:"#/$defs/deco/anyOf/1/properties/terminal/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:ge.anyOf[1].properties.terminal.type,parentSchema:ge.anyOf[1].properties.terminal,data:u};t===null?t=[b]:t.push(b),a++}if(typeof u=="number"){if(u>8||isNaN(u)){let b={instancePath:e+"/deco/"+f+"/terminal",schemaPath:"#/$defs/deco/anyOf/1/properties/terminal/maximum",keyword:"maximum",params:{comparison:"<=",limit:8},message:"must be <= 8",schema:8,parentSchema:ge.anyOf[1].properties.terminal,data:u};t===null?t=[b]:t.push(b),a++}if(u<1||isNaN(u)){let b={instancePath:e+"/deco/"+f+"/terminal",schemaPath:"#/$defs/deco/anyOf/1/properties/terminal/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:ge.anyOf[1].properties.terminal,data:u};t===null?t=[b]:t.push(b),a++}}}if(m.icon!==void 0){let u=m.icon;if(typeof u=="string"){if(!Os.test(u)){let b={instancePath:e+"/deco/"+f+"/icon",schemaPath:"#/$defs/deco/anyOf/1/properties/icon/pattern",keyword:"pattern",params:{pattern:"^[a-z][a-z0-9-]*$"},message:'must match pattern "^[a-z][a-z0-9-]*$"',schema:"^[a-z][a-z0-9-]*$",parentSchema:ge.anyOf[1].properties.icon,data:u};t===null?t=[b]:t.push(b),a++}}else{let b={instancePath:e+"/deco/"+f+"/icon",schemaPath:"#/$defs/deco/anyOf/1/properties/icon/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ge.anyOf[1].properties.icon.type,parentSchema:ge.anyOf[1].properties.icon,data:u};t===null?t=[b]:t.push(b),a++}}if(m.screen!==void 0){let u=m.screen;if(typeof u=="string"){if(!Os.test(u)){let b={instancePath:e+"/deco/"+f+"/screen",schemaPath:"#/$defs/deco/anyOf/1/properties/screen/pattern",keyword:"pattern",params:{pattern:"^[a-z][a-z0-9-]*$"},message:'must match pattern "^[a-z][a-z0-9-]*$"',schema:"^[a-z][a-z0-9-]*$",parentSchema:ge.anyOf[1].properties.screen,data:u};t===null?t=[b]:t.push(b),a++}}else{let b={instancePath:e+"/deco/"+f+"/screen",schemaPath:"#/$defs/deco/anyOf/1/properties/screen/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ge.anyOf[1].properties.screen.type,parentSchema:ge.anyOf[1].properties.screen,data:u};t===null?t=[b]:t.push(b),a++}}}else{let u={instancePath:e+"/deco/"+f,schemaPath:"#/$defs/deco/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ge.anyOf[1].type,parentSchema:ge.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}var c=k===a;if(y=y||c,y)a=h,t!==null&&(h?t.length=h:t=null);else{let u={instancePath:e+"/deco/"+f,schemaPath:"#/$defs/deco/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:ge.anyOf,parentSchema:ge,data:m};t===null?t=[u]:t.push(u),a++}}}else{let l={instancePath:e+"/deco",schemaPath:"#/properties/deco/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ke.properties.deco.type,parentSchema:ke.properties.deco,data:p};t===null?t=[l]:t.push(l),a++}}if(s.ghost!==void 0){let p=s.ghost;if(typeof p!="boolean"){let l={instancePath:e+"/ghost",schemaPath:"#/properties/ghost/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:ke.properties.ghost.type,parentSchema:ke.properties.ghost,data:p};t===null?t=[l]:t.push(l),a++}}if(s.face!==void 0){let p=s.face;if(typeof p=="string"){if(!Os.test(p)){let l={instancePath:e+"/face",schemaPath:"#/properties/face/pattern",keyword:"pattern",params:{pattern:"^[a-z][a-z0-9-]*$"},message:'must match pattern "^[a-z][a-z0-9-]*$"',schema:"^[a-z][a-z0-9-]*$",parentSchema:ke.properties.face,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/face",schemaPath:"#/properties/face/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ke.properties.face.type,parentSchema:ke.properties.face,data:p};t===null?t=[l]:t.push(l),a++}}if(s.facing!==void 0){let p=s.facing;if(typeof p!="number"){let l={instancePath:e+"/facing",schemaPath:"#/properties/facing/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ke.properties.facing.type,parentSchema:ke.properties.facing,data:p};t===null?t=[l]:t.push(l),a++}}if(s["label-at"]!==void 0){let p=s["label-at"];if(p&&typeof p=="object"&&!Array.isArray(p)){for(let l in p)if(!(l==="side"||l==="dx"||l==="dy")){let f={instancePath:e+"/label-at",schemaPath:"#/properties/label-at/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:l},message:"must NOT have additional properties",schema:!1,parentSchema:ke.properties["label-at"],data:p};t===null?t=[f]:t.push(f),a++}if(p.side!==void 0){let l=p.side;if(!(l==="above"||l==="right"||l==="left"||l==="below")){let f={instancePath:e+"/label-at/side",schemaPath:"#/properties/label-at/properties/side/enum",keyword:"enum",params:{allowedValues:ke.properties["label-at"].properties.side.enum},message:"must be equal to one of the allowed values",schema:ke.properties["label-at"].properties.side.enum,parentSchema:ke.properties["label-at"].properties.side,data:l};t===null?t=[f]:t.push(f),a++}}if(p.dx!==void 0){let l=p.dx;if(typeof l!="number"){let f={instancePath:e+"/label-at/dx",schemaPath:"#/properties/label-at/properties/dx/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ke.properties["label-at"].properties.dx.type,parentSchema:ke.properties["label-at"].properties.dx,data:l};t===null?t=[f]:t.push(f),a++}}if(p.dy!==void 0){let l=p.dy;if(typeof l!="number"){let f={instancePath:e+"/label-at/dy",schemaPath:"#/properties/label-at/properties/dy/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ke.properties["label-at"].properties.dy.type,parentSchema:ke.properties["label-at"].properties.dy,data:l};t===null?t=[f]:t.push(f),a++}}}else{let l={instancePath:e+"/label-at",schemaPath:"#/properties/label-at/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ke.properties["label-at"].type,parentSchema:ke.properties["label-at"],data:p};t===null?t=[l]:t.push(l),a++}}if(s.motion!==void 0){let p=s.motion;if(p&&typeof p=="object"&&!Array.isArray(p)){if(Object.keys(p).length<1){let l={instancePath:e+"/motion",schemaPath:"#/$defs/motion/minProperties",keyword:"minProperties",params:{limit:1},message:"must NOT have fewer than 1 properties",schema:1,parentSchema:ue,data:p};t===null?t=[l]:t.push(l),a++}for(let l in p)if(!(l==="style"||l==="out"||l==="easing"||l==="from"||l==="delay"||l==="duration")){let f={instancePath:e+"/motion",schemaPath:"#/$defs/motion/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:l},message:"must NOT have additional properties",schema:!1,parentSchema:ue,data:p};t===null?t=[f]:t.push(f),a++}if(p.style!==void 0){let l=p.style;if(!(l==="edge"||l==="drop"||l==="rise"||l==="fly"||l==="pop"||l==="scatter"||l==="build"||l==="fade")){let f={instancePath:e+"/motion/style",schemaPath:"#/$defs/motion/properties/style/enum",keyword:"enum",params:{allowedValues:ue.properties.style.enum},message:"must be equal to one of the allowed values",schema:ue.properties.style.enum,parentSchema:ue.properties.style,data:l};t===null?t=[f]:t.push(f),a++}}if(p.out!==void 0){let l=p.out;if(!(l==="explode"||l==="lift-off"||l==="sink"||l==="scatter"||l==="fly-out"||l==="collapse"||l==="fade"||l==="reverse")){let f={instancePath:e+"/motion/out",schemaPath:"#/$defs/motion/properties/out/enum",keyword:"enum",params:{allowedValues:ue.properties.out.enum},message:"must be equal to one of the allowed values",schema:ue.properties.out.enum,parentSchema:ue.properties.out,data:l};t===null?t=[f]:t.push(f),a++}}if(p.easing!==void 0){let l=p.easing;if(!(l==="linear"||l==="ease"||l==="ease-in"||l==="ease-out"||l==="settle"||l==="spring"||l==="bounce")){let f={instancePath:e+"/motion/easing",schemaPath:"#/$defs/motion/properties/easing/enum",keyword:"enum",params:{allowedValues:ue.properties.easing.enum},message:"must be equal to one of the allowed values",schema:ue.properties.easing.enum,parentSchema:ue.properties.easing,data:l};t===null?t=[f]:t.push(f),a++}}if(p.from!==void 0){let l=p.from;if(!(l==="left"||l==="right"||l==="top"||l==="bottom")){let f={instancePath:e+"/motion/from",schemaPath:"#/$defs/motion/properties/from/enum",keyword:"enum",params:{allowedValues:ue.properties.from.enum},message:"must be equal to one of the allowed values",schema:ue.properties.from.enum,parentSchema:ue.properties.from,data:l};t===null?t=[f]:t.push(f),a++}}if(p.delay!==void 0){let l=p.delay;if(typeof l=="number"){if(l<0||isNaN(l)){let f={instancePath:e+"/motion/delay",schemaPath:"#/$defs/motion/properties/delay/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:ue.properties.delay,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/motion/delay",schemaPath:"#/$defs/motion/properties/delay/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ue.properties.delay.type,parentSchema:ue.properties.delay,data:l};t===null?t=[f]:t.push(f),a++}}if(p.duration!==void 0){let l=p.duration;if(typeof l=="number"){if(l<=0||isNaN(l)){let f={instancePath:e+"/motion/duration",schemaPath:"#/$defs/motion/properties/duration/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:ue.properties.duration,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/motion/duration",schemaPath:"#/$defs/motion/properties/duration/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ue.properties.duration.type,parentSchema:ue.properties.duration,data:l};t===null?t=[f]:t.push(f),a++}}}else{let l={instancePath:e+"/motion",schemaPath:"#/$defs/motion/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ue.type,parentSchema:ue,data:p};t===null?t=[l]:t.push(l),a++}}if(s.variants!==void 0&&(Ft(s.variants,{instancePath:e+"/variants",parentData:s,parentDataProperty:"variants",rootData:i,dynamicAnchors:o})||(t=t===null?Ft.errors:t.concat(Ft.errors),a=t.length)),s.nodes!==void 0){let p=s.nodes;if(Array.isArray(p)){let l=p.length;for(let f=0;f<l;f++)wi.validate(p[f],{instancePath:e+"/nodes/"+f,parentData:p,parentDataProperty:f,rootData:i,dynamicAnchors:o})||(t=t===null?wi.validate.errors:t.concat(wi.validate.errors),a=t.length)}else{let l={instancePath:e+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ke.properties.nodes.type,parentSchema:ke.properties.nodes,data:p};t===null?t=[l]:t.push(l),a++}}for(let p in s)if(p!=="id"&&p!=="asset"&&p!=="role"&&p!=="label"&&p!=="sub"&&p!=="size"&&p!=="z"&&p!=="deco"&&p!=="ghost"&&p!=="face"&&p!=="facing"&&p!=="label-at"&&p!=="motion"&&p!=="variants"&&p!=="nodes"&&p!=="in"&&p!=="at"&&p!=="right-of"&&p!=="left-of"&&p!=="below"&&p!=="behind"&&p!=="gap"&&p!=="align"&&p!=="shift"&&p!=="appears"&&p!=="disappears"){let l={instancePath:e,schemaPath:"#/unevaluatedProperties",keyword:"unevaluatedProperties",params:{unevaluatedProperty:p},message:"must NOT have unevaluated properties",schema:!1,parentSchema:ke,data:s};t===null?t=[l]:t.push(l),a++}}else{let p={instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ke.type,parentSchema:ke,data:s};t===null?t=[p]:t.push(p),a++}return jt.errors=t,a===0}jt.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};var ki={validate:fs};function fs(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=fs.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),Kt(s,{instancePath:e,parentData:r,parentDataProperty:n,rootData:i,dynamicAnchors:o})||(t=t===null?Kt.errors:t.concat(Kt.errors),a=t.length),s&&typeof s=="object"&&!Array.isArray(s)){if(s.id===void 0){let c={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'",schema:ce.required,parentSchema:ce,data:s};t===null?t=[c]:t.push(c),a++}if(s.kind===void 0){let c={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'",schema:ce.required,parentSchema:ce,data:s};t===null?t=[c]:t.push(c),a++}if(s.id!==void 0){let c=s.id;if(typeof c=="string"){if(!Ce.test(c)){let p={instancePath:e+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:c};t===null?t=[p]:t.push(p),a++}}else{let p={instancePath:e+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:c};t===null?t=[p]:t.push(p),a++}}if(s.kind!==void 0){let c=s.kind;if(!(c==="slab"||c==="pad"||c==="fence"||c==="vm"||c==="cloud"||c==="zone"||c==="platform"||c==="tunnel")){let p={instancePath:e+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:ce.properties.kind.enum},message:"must be equal to one of the allowed values",schema:ce.properties.kind.enum,parentSchema:ce.properties.kind,data:c};t===null?t=[p]:t.push(p),a++}}if(s.label!==void 0){let c=s.label;if(typeof c!="string"){let p={instancePath:e+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ce.properties.label.type,parentSchema:ce.properties.label,data:c};t===null?t=[p]:t.push(p),a++}}if(s["label-style"]!==void 0){let c=s["label-style"];if(!(c==="face"||c==="face-right"||c==="floor"||c==="none")){let p={instancePath:e+"/label-style",schemaPath:"#/properties/label-style/enum",keyword:"enum",params:{allowedValues:ce.properties["label-style"].enum},message:"must be equal to one of the allowed values",schema:ce.properties["label-style"].enum,parentSchema:ce.properties["label-style"],data:c};t===null?t=[p]:t.push(p),a++}}if(s.ghost!==void 0){let c=s.ghost;if(typeof c!="boolean"){let p={instancePath:e+"/ghost",schemaPath:"#/properties/ghost/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:ce.properties.ghost.type,parentSchema:ce.properties.ghost,data:c};t===null?t=[p]:t.push(p),a++}}if(s.role!==void 0){let c=s.role;if(typeof c!="string"){let p={instancePath:e+"/role",schemaPath:"#/properties/role/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ce.properties.role.type,parentSchema:ce.properties.role,data:c};t===null?t=[p]:t.push(p),a++}}if(s.size!==void 0){let c=s.size;if(Array.isArray(c)){if(c.length>3){let l={instancePath:e+"/size",schemaPath:"#/$defs/size2or3/maxItems",keyword:"maxItems",params:{limit:3},message:"must NOT have more than 3 items",schema:3,parentSchema:rt,data:c};t===null?t=[l]:t.push(l),a++}if(c.length<2){let l={instancePath:e+"/size",schemaPath:"#/$defs/size2or3/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:rt,data:c};t===null?t=[l]:t.push(l),a++}let p=c.length;for(let l=0;l<p;l++){let f=c[l];if(typeof f=="number"){if(f<=0||isNaN(f)){let m={instancePath:e+"/size/"+l,schemaPath:"#/$defs/size2or3/items/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:rt.items,data:f};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e+"/size/"+l,schemaPath:"#/$defs/size2or3/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:rt.items.type,parentSchema:rt.items,data:f};t===null?t=[m]:t.push(m),a++}}}else{let p={instancePath:e+"/size",schemaPath:"#/$defs/size2or3/type",keyword:"type",params:{type:"array"},message:"must be array",schema:rt.type,parentSchema:rt,data:c};t===null?t=[p]:t.push(p),a++}}if(s.padding!==void 0){let c=s.padding;if(typeof c=="number"){if(c<0||isNaN(c)){let p={instancePath:e+"/padding",schemaPath:"#/properties/padding/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:ce.properties.padding,data:c};t===null?t=[p]:t.push(p),a++}}else{let p={instancePath:e+"/padding",schemaPath:"#/properties/padding/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ce.properties.padding.type,parentSchema:ce.properties.padding,data:c};t===null?t=[p]:t.push(p),a++}}if(s.height!==void 0){let c=s.height;if(typeof c=="number"){if(c<=0||isNaN(c)){let p={instancePath:e+"/height",schemaPath:"#/properties/height/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:ce.properties.height,data:c};t===null?t=[p]:t.push(p),a++}}else{let p={instancePath:e+"/height",schemaPath:"#/properties/height/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ce.properties.height.type,parentSchema:ce.properties.height,data:c};t===null?t=[p]:t.push(p),a++}}if(s.z!==void 0){let c=s.z;if(typeof c!="number"){let p={instancePath:e+"/z",schemaPath:"#/properties/z/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ce.properties.z.type,parentSchema:ce.properties.z,data:c};t===null?t=[p]:t.push(p),a++}}if(s.flow!==void 0){let c=s.flow;if(!(c==="row"||c==="column")){let p={instancePath:e+"/flow",schemaPath:"#/properties/flow/enum",keyword:"enum",params:{allowedValues:ce.properties.flow.enum},message:"must be equal to one of the allowed values",schema:ce.properties.flow.enum,parentSchema:ce.properties.flow,data:c};t===null?t=[p]:t.push(p),a++}}if(s.gate!==void 0){let c=s.gate;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.side===void 0){let p={instancePath:e+"/gate",schemaPath:"#/properties/gate/required",keyword:"required",params:{missingProperty:"side"},message:"must have required property 'side'",schema:ce.properties.gate.required,parentSchema:ce.properties.gate,data:c};t===null?t=[p]:t.push(p),a++}for(let p in c)if(!(p==="side"||p==="at"||p==="width"||p==="height"||p==="node")){let l={instancePath:e+"/gate",schemaPath:"#/properties/gate/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties",schema:!1,parentSchema:ce.properties.gate,data:c};t===null?t=[l]:t.push(l),a++}if(c.side!==void 0){let p=c.side;if(!(p==="n"||p==="e"||p==="s"||p==="w")){let l={instancePath:e+"/gate/side",schemaPath:"#/$defs/side/enum",keyword:"enum",params:{allowedValues:gi.enum},message:"must be equal to one of the allowed values",schema:gi.enum,parentSchema:gi,data:p};t===null?t=[l]:t.push(l),a++}}if(c.at!==void 0){let p=c.at;if(typeof p=="number"){if(p>1||isNaN(p)){let l={instancePath:e+"/gate/at",schemaPath:"#/properties/gate/properties/at/maximum",keyword:"maximum",params:{comparison:"<=",limit:1},message:"must be <= 1",schema:1,parentSchema:ce.properties.gate.properties.at,data:p};t===null?t=[l]:t.push(l),a++}if(p<0||isNaN(p)){let l={instancePath:e+"/gate/at",schemaPath:"#/properties/gate/properties/at/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:ce.properties.gate.properties.at,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/gate/at",schemaPath:"#/properties/gate/properties/at/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ce.properties.gate.properties.at.type,parentSchema:ce.properties.gate.properties.at,data:p};t===null?t=[l]:t.push(l),a++}}if(c.width!==void 0){let p=c.width;if(typeof p=="number"){if(p<=0||isNaN(p)){let l={instancePath:e+"/gate/width",schemaPath:"#/properties/gate/properties/width/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:ce.properties.gate.properties.width,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/gate/width",schemaPath:"#/properties/gate/properties/width/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ce.properties.gate.properties.width.type,parentSchema:ce.properties.gate.properties.width,data:p};t===null?t=[l]:t.push(l),a++}}if(c.height!==void 0){let p=c.height;if(typeof p=="number"){if(p<=0||isNaN(p)){let l={instancePath:e+"/gate/height",schemaPath:"#/properties/gate/properties/height/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:ce.properties.gate.properties.height,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/gate/height",schemaPath:"#/properties/gate/properties/height/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ce.properties.gate.properties.height.type,parentSchema:ce.properties.gate.properties.height,data:p};t===null?t=[l]:t.push(l),a++}}if(c.node!==void 0){let p=c.node;if(typeof p=="string"){if(!Ce.test(p)){let l={instancePath:e+"/gate/node",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/gate/node",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:p};t===null?t=[l]:t.push(l),a++}}}else{let p={instancePath:e+"/gate",schemaPath:"#/properties/gate/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ce.properties.gate.type,parentSchema:ce.properties.gate,data:c};t===null?t=[p]:t.push(p),a++}}if(s.around!==void 0){let c=s.around;if(Array.isArray(c)){let p=c.length;for(let l=0;l<p;l++){let f=c[l];if(typeof f=="string"){if(!Ce.test(f)){let m={instancePath:e+"/around/"+l,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:f};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e+"/around/"+l,schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:f};t===null?t=[m]:t.push(m),a++}}}else{let p={instancePath:e+"/around",schemaPath:"#/properties/around/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ce.properties.around.type,parentSchema:ce.properties.around,data:c};t===null?t=[p]:t.push(p),a++}}if(s.regions!==void 0){let c=s.regions;if(Array.isArray(c)){let p=c.length;for(let l=0;l<p;l++)ki.validate(c[l],{instancePath:e+"/regions/"+l,parentData:c,parentDataProperty:l,rootData:i,dynamicAnchors:o})||(t=t===null?ki.validate.errors:t.concat(ki.validate.errors),a=t.length)}else{let p={instancePath:e+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ce.properties.regions.type,parentSchema:ce.properties.regions,data:c};t===null?t=[p]:t.push(p),a++}}if(s.motion!==void 0){let c=s.motion;if(c&&typeof c=="object"&&!Array.isArray(c)){if(Object.keys(c).length<1){let p={instancePath:e+"/motion",schemaPath:"#/$defs/motion/minProperties",keyword:"minProperties",params:{limit:1},message:"must NOT have fewer than 1 properties",schema:1,parentSchema:ue,data:c};t===null?t=[p]:t.push(p),a++}for(let p in c)if(!(p==="style"||p==="out"||p==="easing"||p==="from"||p==="delay"||p==="duration")){let l={instancePath:e+"/motion",schemaPath:"#/$defs/motion/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties",schema:!1,parentSchema:ue,data:c};t===null?t=[l]:t.push(l),a++}if(c.style!==void 0){let p=c.style;if(!(p==="edge"||p==="drop"||p==="rise"||p==="fly"||p==="pop"||p==="scatter"||p==="build"||p==="fade")){let l={instancePath:e+"/motion/style",schemaPath:"#/$defs/motion/properties/style/enum",keyword:"enum",params:{allowedValues:ue.properties.style.enum},message:"must be equal to one of the allowed values",schema:ue.properties.style.enum,parentSchema:ue.properties.style,data:p};t===null?t=[l]:t.push(l),a++}}if(c.out!==void 0){let p=c.out;if(!(p==="explode"||p==="lift-off"||p==="sink"||p==="scatter"||p==="fly-out"||p==="collapse"||p==="fade"||p==="reverse")){let l={instancePath:e+"/motion/out",schemaPath:"#/$defs/motion/properties/out/enum",keyword:"enum",params:{allowedValues:ue.properties.out.enum},message:"must be equal to one of the allowed values",schema:ue.properties.out.enum,parentSchema:ue.properties.out,data:p};t===null?t=[l]:t.push(l),a++}}if(c.easing!==void 0){let p=c.easing;if(!(p==="linear"||p==="ease"||p==="ease-in"||p==="ease-out"||p==="settle"||p==="spring"||p==="bounce")){let l={instancePath:e+"/motion/easing",schemaPath:"#/$defs/motion/properties/easing/enum",keyword:"enum",params:{allowedValues:ue.properties.easing.enum},message:"must be equal to one of the allowed values",schema:ue.properties.easing.enum,parentSchema:ue.properties.easing,data:p};t===null?t=[l]:t.push(l),a++}}if(c.from!==void 0){let p=c.from;if(!(p==="left"||p==="right"||p==="top"||p==="bottom")){let l={instancePath:e+"/motion/from",schemaPath:"#/$defs/motion/properties/from/enum",keyword:"enum",params:{allowedValues:ue.properties.from.enum},message:"must be equal to one of the allowed values",schema:ue.properties.from.enum,parentSchema:ue.properties.from,data:p};t===null?t=[l]:t.push(l),a++}}if(c.delay!==void 0){let p=c.delay;if(typeof p=="number"){if(p<0||isNaN(p)){let l={instancePath:e+"/motion/delay",schemaPath:"#/$defs/motion/properties/delay/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:ue.properties.delay,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/motion/delay",schemaPath:"#/$defs/motion/properties/delay/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ue.properties.delay.type,parentSchema:ue.properties.delay,data:p};t===null?t=[l]:t.push(l),a++}}if(c.duration!==void 0){let p=c.duration;if(typeof p=="number"){if(p<=0||isNaN(p)){let l={instancePath:e+"/motion/duration",schemaPath:"#/$defs/motion/properties/duration/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:ue.properties.duration,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/motion/duration",schemaPath:"#/$defs/motion/properties/duration/type",keyword:"type",params:{type:"number"},message:"must be number",schema:ue.properties.duration.type,parentSchema:ue.properties.duration,data:p};t===null?t=[l]:t.push(l),a++}}}else{let p={instancePath:e+"/motion",schemaPath:"#/$defs/motion/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ue.type,parentSchema:ue,data:c};t===null?t=[p]:t.push(p),a++}}if(s.variants!==void 0&&(Ft(s.variants,{instancePath:e+"/variants",parentData:s,parentDataProperty:"variants",rootData:i,dynamicAnchors:o})||(t=t===null?Ft.errors:t.concat(Ft.errors),a=t.length)),s.nodes!==void 0){let c=s.nodes;if(Array.isArray(c)){let p=c.length;for(let l=0;l<p;l++)jt(c[l],{instancePath:e+"/nodes/"+l,parentData:c,parentDataProperty:l,rootData:i,dynamicAnchors:o})||(t=t===null?jt.errors:t.concat(jt.errors),a=t.length)}else{let p={instancePath:e+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ce.properties.nodes.type,parentSchema:ce.properties.nodes,data:c};t===null?t=[p]:t.push(p),a++}}for(let c in s)if(c!=="id"&&c!=="kind"&&c!=="label"&&c!=="label-style"&&c!=="ghost"&&c!=="role"&&c!=="size"&&c!=="padding"&&c!=="height"&&c!=="z"&&c!=="flow"&&c!=="gate"&&c!=="around"&&c!=="regions"&&c!=="motion"&&c!=="variants"&&c!=="nodes"&&c!=="in"&&c!=="at"&&c!=="right-of"&&c!=="left-of"&&c!=="below"&&c!=="behind"&&c!=="gap"&&c!=="align"&&c!=="shift"&&c!=="appears"&&c!=="disappears"){let p={instancePath:e,schemaPath:"#/unevaluatedProperties",keyword:"unevaluatedProperties",params:{unevaluatedProperty:c},message:"must NOT have unevaluated properties",schema:!1,parentSchema:ce,data:s};t===null?t=[p]:t.push(p),a++}}else{let c={instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ce.type,parentSchema:ce,data:s};t===null?t=[c]:t.push(c),a++}return fs.errors=t,a===0}fs.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};var se={type:"object",required:["id","from","to"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},from:{$ref:"#/$defs/endpoint"},to:{$ref:"#/$defs/endpoint"},kind:{type:"string"},via:{type:"array",items:{anyOf:[{$ref:"#/$defs/point2"},{$ref:"#/$defs/endpoint"}]}},points:{type:"array",items:{type:"array",items:{type:"number"},minItems:2,maxItems:3},description:"exact polyline in grid units; skips the router"},lane:{type:"number"},arrow:{type:"boolean"},cross:{type:"boolean",description:"the route may pass through fence walls (it crosses a boundary)"},label:{anyOf:[{type:"string"},{type:"object",additionalProperties:!1,required:["text"],properties:{text:{type:"string"},along:{type:"integer",minimum:1},side:{enum:["left","right"]},at:{type:"array",items:{type:"number"},minItems:2,maxItems:3,description:"exact place [x, y] or [x, y, z]; skips placement"},dir:{enum:["x","y"]},anchor:{enum:["start","middle","end"]}}}]},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}},Bt={type:"string",pattern:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"},xi=new RegExp("^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$","u");function As(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=As.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),s&&typeof s=="object"&&!Array.isArray(s)){if(s.id===void 0){let m={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'",schema:se.required,parentSchema:se,data:s};t===null?t=[m]:t.push(m),a++}if(s.from===void 0){let m={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'",schema:se.required,parentSchema:se,data:s};t===null?t=[m]:t.push(m),a++}if(s.to===void 0){let m={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'",schema:se.required,parentSchema:se,data:s};t===null?t=[m]:t.push(m),a++}for(let m in s)if(!nr.call(se.properties,m)){let h={instancePath:e,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m},message:"must NOT have additional properties",schema:!1,parentSchema:se,data:s};t===null?t=[h]:t.push(h),a++}if(s.id!==void 0){let m=s.id;if(typeof m=="string"){if(!Ce.test(m)){let h={instancePath:e+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:m};t===null?t=[h]:t.push(h),a++}}else{let h={instancePath:e+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:m};t===null?t=[h]:t.push(h),a++}}if(s.from!==void 0){let m=s.from;if(typeof m=="string"){if(!xi.test(m)){let h={instancePath:e+"/from",schemaPath:"#/$defs/endpoint/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"',schema:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$",parentSchema:Bt,data:m};t===null?t=[h]:t.push(h),a++}}else{let h={instancePath:e+"/from",schemaPath:"#/$defs/endpoint/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Bt.type,parentSchema:Bt,data:m};t===null?t=[h]:t.push(h),a++}}if(s.to!==void 0){let m=s.to;if(typeof m=="string"){if(!xi.test(m)){let h={instancePath:e+"/to",schemaPath:"#/$defs/endpoint/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"',schema:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$",parentSchema:Bt,data:m};t===null?t=[h]:t.push(h),a++}}else{let h={instancePath:e+"/to",schemaPath:"#/$defs/endpoint/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Bt.type,parentSchema:Bt,data:m};t===null?t=[h]:t.push(h),a++}}if(s.kind!==void 0){let m=s.kind;if(typeof m!="string"){let h={instancePath:e+"/kind",schemaPath:"#/properties/kind/type",keyword:"type",params:{type:"string"},message:"must be string",schema:se.properties.kind.type,parentSchema:se.properties.kind,data:m};t===null?t=[h]:t.push(h),a++}}if(s.via!==void 0){let m=s.via;if(Array.isArray(m)){let h=m.length;for(let y=0;y<h;y++){let g=m[y],k=a,u=!1,b=a;if(Array.isArray(g)){if(g.length>2){let P={instancePath:e+"/via/"+y,schemaPath:"#/$defs/point2/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items",schema:2,parentSchema:Ne,data:g};t===null?t=[P]:t.push(P),a++}if(g.length<2){let P={instancePath:e+"/via/"+y,schemaPath:"#/$defs/point2/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:Ne,data:g};t===null?t=[P]:t.push(P),a++}let $=g.length;for(let P=0;P<$;P++){let T=g[P];if(typeof T!="number"){let M={instancePath:e+"/via/"+y+"/"+P,schemaPath:"#/$defs/point2/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Ne.items.type,parentSchema:Ne.items,data:T};t===null?t=[M]:t.push(M),a++}}}else{let $={instancePath:e+"/via/"+y,schemaPath:"#/$defs/point2/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Ne.type,parentSchema:Ne,data:g};t===null?t=[$]:t.push($),a++}var c=b===a;u=u||c;let x=a;if(typeof g=="string"){if(!xi.test(g)){let $={instancePath:e+"/via/"+y,schemaPath:"#/$defs/endpoint/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"',schema:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$",parentSchema:Bt,data:g};t===null?t=[$]:t.push($),a++}}else{let $={instancePath:e+"/via/"+y,schemaPath:"#/$defs/endpoint/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Bt.type,parentSchema:Bt,data:g};t===null?t=[$]:t.push($),a++}var c=x===a;if(u=u||c,u)a=k,t!==null&&(k?t.length=k:t=null);else{let $={instancePath:e+"/via/"+y,schemaPath:"#/properties/via/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:se.properties.via.items.anyOf,parentSchema:se.properties.via.items,data:g};t===null?t=[$]:t.push($),a++}}}else{let h={instancePath:e+"/via",schemaPath:"#/properties/via/type",keyword:"type",params:{type:"array"},message:"must be array",schema:se.properties.via.type,parentSchema:se.properties.via,data:m};t===null?t=[h]:t.push(h),a++}}if(s.points!==void 0){let m=s.points;if(Array.isArray(m)){let h=m.length;for(let y=0;y<h;y++){let g=m[y];if(Array.isArray(g)){if(g.length>3){let u={instancePath:e+"/points/"+y,schemaPath:"#/properties/points/items/maxItems",keyword:"maxItems",params:{limit:3},message:"must NOT have more than 3 items",schema:3,parentSchema:se.properties.points.items,data:g};t===null?t=[u]:t.push(u),a++}if(g.length<2){let u={instancePath:e+"/points/"+y,schemaPath:"#/properties/points/items/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:se.properties.points.items,data:g};t===null?t=[u]:t.push(u),a++}let k=g.length;for(let u=0;u<k;u++){let b=g[u];if(typeof b!="number"){let x={instancePath:e+"/points/"+y+"/"+u,schemaPath:"#/properties/points/items/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:se.properties.points.items.items.type,parentSchema:se.properties.points.items.items,data:b};t===null?t=[x]:t.push(x),a++}}}else{let k={instancePath:e+"/points/"+y,schemaPath:"#/properties/points/items/type",keyword:"type",params:{type:"array"},message:"must be array",schema:se.properties.points.items.type,parentSchema:se.properties.points.items,data:g};t===null?t=[k]:t.push(k),a++}}}else{let h={instancePath:e+"/points",schemaPath:"#/properties/points/type",keyword:"type",params:{type:"array"},message:"must be array",schema:se.properties.points.type,parentSchema:se.properties.points,data:m};t===null?t=[h]:t.push(h),a++}}if(s.lane!==void 0){let m=s.lane;if(typeof m!="number"){let h={instancePath:e+"/lane",schemaPath:"#/properties/lane/type",keyword:"type",params:{type:"number"},message:"must be number",schema:se.properties.lane.type,parentSchema:se.properties.lane,data:m};t===null?t=[h]:t.push(h),a++}}if(s.arrow!==void 0){let m=s.arrow;if(typeof m!="boolean"){let h={instancePath:e+"/arrow",schemaPath:"#/properties/arrow/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:se.properties.arrow.type,parentSchema:se.properties.arrow,data:m};t===null?t=[h]:t.push(h),a++}}if(s.cross!==void 0){let m=s.cross;if(typeof m!="boolean"){let h={instancePath:e+"/cross",schemaPath:"#/properties/cross/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:se.properties.cross.type,parentSchema:se.properties.cross,data:m};t===null?t=[h]:t.push(h),a++}}if(s.label!==void 0){let m=s.label,h=a,y=!1,g=a;if(typeof m!="string"){let u={instancePath:e+"/label",schemaPath:"#/properties/label/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:se.properties.label.anyOf[0].type,parentSchema:se.properties.label.anyOf[0],data:m};t===null?t=[u]:t.push(u),a++}var p=g===a;y=y||p;let k=a;if(m&&typeof m=="object"&&!Array.isArray(m)){if(m.text===void 0){let u={instancePath:e+"/label",schemaPath:"#/properties/label/anyOf/1/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'",schema:se.properties.label.anyOf[1].required,parentSchema:se.properties.label.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}for(let u in m)if(!(u==="text"||u==="along"||u==="side"||u==="at"||u==="dir"||u==="anchor")){let b={instancePath:e+"/label",schemaPath:"#/properties/label/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:u},message:"must NOT have additional properties",schema:!1,parentSchema:se.properties.label.anyOf[1],data:m};t===null?t=[b]:t.push(b),a++}if(m.text!==void 0){let u=m.text;if(typeof u!="string"){let b={instancePath:e+"/label/text",schemaPath:"#/properties/label/anyOf/1/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string",schema:se.properties.label.anyOf[1].properties.text.type,parentSchema:se.properties.label.anyOf[1].properties.text,data:u};t===null?t=[b]:t.push(b),a++}}if(m.along!==void 0){let u=m.along;if(!(typeof u=="number"&&!(u%1)&&!isNaN(u))){let b={instancePath:e+"/label/along",schemaPath:"#/properties/label/anyOf/1/properties/along/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:se.properties.label.anyOf[1].properties.along.type,parentSchema:se.properties.label.anyOf[1].properties.along,data:u};t===null?t=[b]:t.push(b),a++}if(typeof u=="number"&&(u<1||isNaN(u))){let b={instancePath:e+"/label/along",schemaPath:"#/properties/label/anyOf/1/properties/along/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:se.properties.label.anyOf[1].properties.along,data:u};t===null?t=[b]:t.push(b),a++}}if(m.side!==void 0){let u=m.side;if(!(u==="left"||u==="right")){let b={instancePath:e+"/label/side",schemaPath:"#/properties/label/anyOf/1/properties/side/enum",keyword:"enum",params:{allowedValues:se.properties.label.anyOf[1].properties.side.enum},message:"must be equal to one of the allowed values",schema:se.properties.label.anyOf[1].properties.side.enum,parentSchema:se.properties.label.anyOf[1].properties.side,data:u};t===null?t=[b]:t.push(b),a++}}if(m.at!==void 0){let u=m.at;if(Array.isArray(u)){if(u.length>3){let x={instancePath:e+"/label/at",schemaPath:"#/properties/label/anyOf/1/properties/at/maxItems",keyword:"maxItems",params:{limit:3},message:"must NOT have more than 3 items",schema:3,parentSchema:se.properties.label.anyOf[1].properties.at,data:u};t===null?t=[x]:t.push(x),a++}if(u.length<2){let x={instancePath:e+"/label/at",schemaPath:"#/properties/label/anyOf/1/properties/at/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:se.properties.label.anyOf[1].properties.at,data:u};t===null?t=[x]:t.push(x),a++}let b=u.length;for(let x=0;x<b;x++){let $=u[x];if(typeof $!="number"){let P={instancePath:e+"/label/at/"+x,schemaPath:"#/properties/label/anyOf/1/properties/at/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:se.properties.label.anyOf[1].properties.at.items.type,parentSchema:se.properties.label.anyOf[1].properties.at.items,data:$};t===null?t=[P]:t.push(P),a++}}}else{let b={instancePath:e+"/label/at",schemaPath:"#/properties/label/anyOf/1/properties/at/type",keyword:"type",params:{type:"array"},message:"must be array",schema:se.properties.label.anyOf[1].properties.at.type,parentSchema:se.properties.label.anyOf[1].properties.at,data:u};t===null?t=[b]:t.push(b),a++}}if(m.dir!==void 0){let u=m.dir;if(!(u==="x"||u==="y")){let b={instancePath:e+"/label/dir",schemaPath:"#/properties/label/anyOf/1/properties/dir/enum",keyword:"enum",params:{allowedValues:se.properties.label.anyOf[1].properties.dir.enum},message:"must be equal to one of the allowed values",schema:se.properties.label.anyOf[1].properties.dir.enum,parentSchema:se.properties.label.anyOf[1].properties.dir,data:u};t===null?t=[b]:t.push(b),a++}}if(m.anchor!==void 0){let u=m.anchor;if(!(u==="start"||u==="middle"||u==="end")){let b={instancePath:e+"/label/anchor",schemaPath:"#/properties/label/anyOf/1/properties/anchor/enum",keyword:"enum",params:{allowedValues:se.properties.label.anyOf[1].properties.anchor.enum},message:"must be equal to one of the allowed values",schema:se.properties.label.anyOf[1].properties.anchor.enum,parentSchema:se.properties.label.anyOf[1].properties.anchor,data:u};t===null?t=[b]:t.push(b),a++}}}else{let u={instancePath:e+"/label",schemaPath:"#/properties/label/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object",schema:se.properties.label.anyOf[1].type,parentSchema:se.properties.label.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}var p=k===a;if(y=y||p,y)a=h,t!==null&&(h?t.length=h:t=null);else{let u={instancePath:e+"/label",schemaPath:"#/properties/label/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:se.properties.label.anyOf,parentSchema:se.properties.label,data:m};t===null?t=[u]:t.push(u),a++}}if(s.appears!==void 0){let m=s.appears,h=a,y=!1,g=a;if(typeof m!="string"){let u={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ye.anyOf[0].type,parentSchema:ye.anyOf[0],data:m};t===null?t=[u]:t.push(u),a++}var l=g===a;y=y||l;let k=a;if(!(typeof m=="number"&&!(m%1)&&!isNaN(m))){let u={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/1/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:ye.anyOf[1].type,parentSchema:ye.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}if(typeof m=="number"&&(m<1||isNaN(m))){let u={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/1/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:ye.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}var l=k===a;if(y=y||l,y)a=h,t!==null&&(h?t.length=h:t=null);else{let u={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:ye.anyOf,parentSchema:ye,data:m};t===null?t=[u]:t.push(u),a++}}if(s.disappears!==void 0){let m=s.disappears,h=a,y=!1,g=a;if(typeof m!="string"){let u={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ye.anyOf[0].type,parentSchema:ye.anyOf[0],data:m};t===null?t=[u]:t.push(u),a++}var f=g===a;y=y||f;let k=a;if(!(typeof m=="number"&&!(m%1)&&!isNaN(m))){let u={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/1/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:ye.anyOf[1].type,parentSchema:ye.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}if(typeof m=="number"&&(m<1||isNaN(m))){let u={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/1/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:ye.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}var f=k===a;if(y=y||f,y)a=h,t!==null&&(h?t.length=h:t=null);else{let u={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:ye.anyOf,parentSchema:ye,data:m};t===null?t=[u]:t.push(u),a++}}}else{let m={instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:se.type,parentSchema:se,data:s};t===null?t=[m]:t.push(m),a++}return As.errors=t,a===0}As.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};var Pe={type:"object",additionalProperties:!1,properties:{floor:{type:"string"},face:{type:"string"},label:{type:"string"},sub:{type:"string"},at:{anyOf:[{$ref:"#/$defs/point2"},{type:"array",items:{type:"number"},minItems:3,maxItems:3}]},on:{$ref:"#/$defs/id",description:"a node, region or route; a note on a route dims and lights with it"},kind:{type:"string"},dir:{enum:["x","y"]},anchor:{enum:["start","middle","end"]},dx:{type:"number"},dy:{type:"number"},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}};function Ms(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=Ms.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),s&&typeof s=="object"&&!Array.isArray(s)){for(let m in s)if(!nr.call(Pe.properties,m)){let h={instancePath:e,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m},message:"must NOT have additional properties",schema:!1,parentSchema:Pe,data:s};t===null?t=[h]:t.push(h),a++}if(s.floor!==void 0){let m=s.floor;if(typeof m!="string"){let h={instancePath:e+"/floor",schemaPath:"#/properties/floor/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Pe.properties.floor.type,parentSchema:Pe.properties.floor,data:m};t===null?t=[h]:t.push(h),a++}}if(s.face!==void 0){let m=s.face;if(typeof m!="string"){let h={instancePath:e+"/face",schemaPath:"#/properties/face/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Pe.properties.face.type,parentSchema:Pe.properties.face,data:m};t===null?t=[h]:t.push(h),a++}}if(s.label!==void 0){let m=s.label;if(typeof m!="string"){let h={instancePath:e+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Pe.properties.label.type,parentSchema:Pe.properties.label,data:m};t===null?t=[h]:t.push(h),a++}}if(s.sub!==void 0){let m=s.sub;if(typeof m!="string"){let h={instancePath:e+"/sub",schemaPath:"#/properties/sub/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Pe.properties.sub.type,parentSchema:Pe.properties.sub,data:m};t===null?t=[h]:t.push(h),a++}}if(s.at!==void 0){let m=s.at,h=a,y=!1,g=a;if(Array.isArray(m)){if(m.length>2){let b={instancePath:e+"/at",schemaPath:"#/$defs/point2/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items",schema:2,parentSchema:Ne,data:m};t===null?t=[b]:t.push(b),a++}if(m.length<2){let b={instancePath:e+"/at",schemaPath:"#/$defs/point2/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:Ne,data:m};t===null?t=[b]:t.push(b),a++}let u=m.length;for(let b=0;b<u;b++){let x=m[b];if(typeof x!="number"){let $={instancePath:e+"/at/"+b,schemaPath:"#/$defs/point2/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Ne.items.type,parentSchema:Ne.items,data:x};t===null?t=[$]:t.push($),a++}}}else{let u={instancePath:e+"/at",schemaPath:"#/$defs/point2/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Ne.type,parentSchema:Ne,data:m};t===null?t=[u]:t.push(u),a++}var p=g===a;if(y=y||p,p)var c=!0;let k=a;if(Array.isArray(m)){if(m.length>3){let b={instancePath:e+"/at",schemaPath:"#/properties/at/anyOf/1/maxItems",keyword:"maxItems",params:{limit:3},message:"must NOT have more than 3 items",schema:3,parentSchema:Pe.properties.at.anyOf[1],data:m};t===null?t=[b]:t.push(b),a++}if(m.length<3){let b={instancePath:e+"/at",schemaPath:"#/properties/at/anyOf/1/minItems",keyword:"minItems",params:{limit:3},message:"must NOT have fewer than 3 items",schema:3,parentSchema:Pe.properties.at.anyOf[1],data:m};t===null?t=[b]:t.push(b),a++}let u=m.length;for(let b=0;b<u;b++){let x=m[b];if(typeof x!="number"){let $={instancePath:e+"/at/"+b,schemaPath:"#/properties/at/anyOf/1/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Pe.properties.at.anyOf[1].items.type,parentSchema:Pe.properties.at.anyOf[1].items,data:x};t===null?t=[$]:t.push($),a++}}}else{let u={instancePath:e+"/at",schemaPath:"#/properties/at/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Pe.properties.at.anyOf[1].type,parentSchema:Pe.properties.at.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}var p=k===a;if(y=y||p,p&&c!==!0&&(c=!0),y)a=h,t!==null&&(h?t.length=h:t=null);else{let u={instancePath:e+"/at",schemaPath:"#/properties/at/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:Pe.properties.at.anyOf,parentSchema:Pe.properties.at,data:m};t===null?t=[u]:t.push(u),a++}}if(s.on!==void 0){let m=s.on;if(typeof m=="string"){if(!Ce.test(m)){let h={instancePath:e+"/on",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:m};t===null?t=[h]:t.push(h),a++}}else{let h={instancePath:e+"/on",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:m};t===null?t=[h]:t.push(h),a++}}if(s.kind!==void 0){let m=s.kind;if(typeof m!="string"){let h={instancePath:e+"/kind",schemaPath:"#/properties/kind/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Pe.properties.kind.type,parentSchema:Pe.properties.kind,data:m};t===null?t=[h]:t.push(h),a++}}if(s.dir!==void 0){let m=s.dir;if(!(m==="x"||m==="y")){let h={instancePath:e+"/dir",schemaPath:"#/properties/dir/enum",keyword:"enum",params:{allowedValues:Pe.properties.dir.enum},message:"must be equal to one of the allowed values",schema:Pe.properties.dir.enum,parentSchema:Pe.properties.dir,data:m};t===null?t=[h]:t.push(h),a++}}if(s.anchor!==void 0){let m=s.anchor;if(!(m==="start"||m==="middle"||m==="end")){let h={instancePath:e+"/anchor",schemaPath:"#/properties/anchor/enum",keyword:"enum",params:{allowedValues:Pe.properties.anchor.enum},message:"must be equal to one of the allowed values",schema:Pe.properties.anchor.enum,parentSchema:Pe.properties.anchor,data:m};t===null?t=[h]:t.push(h),a++}}if(s.dx!==void 0){let m=s.dx;if(typeof m!="number"){let h={instancePath:e+"/dx",schemaPath:"#/properties/dx/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Pe.properties.dx.type,parentSchema:Pe.properties.dx,data:m};t===null?t=[h]:t.push(h),a++}}if(s.dy!==void 0){let m=s.dy;if(typeof m!="number"){let h={instancePath:e+"/dy",schemaPath:"#/properties/dy/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Pe.properties.dy.type,parentSchema:Pe.properties.dy,data:m};t===null?t=[h]:t.push(h),a++}}if(s.appears!==void 0){let m=s.appears,h=a,y=!1,g=a;if(typeof m!="string"){let u={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ye.anyOf[0].type,parentSchema:ye.anyOf[0],data:m};t===null?t=[u]:t.push(u),a++}var l=g===a;y=y||l;let k=a;if(!(typeof m=="number"&&!(m%1)&&!isNaN(m))){let u={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/1/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:ye.anyOf[1].type,parentSchema:ye.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}if(typeof m=="number"&&(m<1||isNaN(m))){let u={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf/1/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:ye.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}var l=k===a;if(y=y||l,y)a=h,t!==null&&(h?t.length=h:t=null);else{let u={instancePath:e+"/appears",schemaPath:"#/$defs/stepRef/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:ye.anyOf,parentSchema:ye,data:m};t===null?t=[u]:t.push(u),a++}}if(s.disappears!==void 0){let m=s.disappears,h=a,y=!1,g=a;if(typeof m!="string"){let u={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ye.anyOf[0].type,parentSchema:ye.anyOf[0],data:m};t===null?t=[u]:t.push(u),a++}var f=g===a;y=y||f;let k=a;if(!(typeof m=="number"&&!(m%1)&&!isNaN(m))){let u={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/1/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:ye.anyOf[1].type,parentSchema:ye.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}if(typeof m=="number"&&(m<1||isNaN(m))){let u={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf/1/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:ye.anyOf[1],data:m};t===null?t=[u]:t.push(u),a++}var f=k===a;if(y=y||f,y)a=h,t!==null&&(h?t.length=h:t=null);else{let u={instancePath:e+"/disappears",schemaPath:"#/$defs/stepRef/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:ye.anyOf,parentSchema:ye,data:m};t===null?t=[u]:t.push(u),a++}}}else{let m={instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Pe.type,parentSchema:Pe,data:s};t===null?t=[m]:t.push(m),a++}return Ms.errors=t,a===0}Ms.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};var Z={type:"object",required:["heading"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},number:{type:"integer",minimum:1,description:"the number shown; defaults to the position"},kind:{type:"string"},heading:{type:"string"},caption:{type:"string"},command:{type:"string"},animate:{type:"array",items:{$ref:"#/$defs/phase"}},pulse:{type:"array",items:{$ref:"#/$defs/id"}},highlight:{type:"array",items:{$ref:"#/$defs/id"}},focus:{type:"array",items:{$ref:"#/$defs/id"},description:"nodes or regions to zoom to for this step; the view eases back on steps without focus"},show:{type:"array",items:{$ref:"#/$defs/id"}},hide:{type:"array",items:{$ref:"#/$defs/id"}},say:{type:"array",items:{type:"object",additionalProperties:!1,required:["at","text"],properties:{at:{anyOf:[{$ref:"#/$defs/id"},{type:"array",items:{type:"number"},minItems:2,maxItems:3}],description:"a node (the callout sits above it) or a grid point [x, y, z]"},text:{type:"string"},kind:{type:"string"},dx:{type:"number"},dy:{type:"number"},anchor:{enum:["start","middle","end"]}}}},mark:{type:"array",items:{type:"object",additionalProperties:!1,properties:{on:{$ref:"#/$defs/id"},at:{type:"array",items:{type:"number"},minItems:2,maxItems:3}}}},badge:{anyOf:[{type:"boolean"},{$ref:"#/$defs/id"},{type:"array",items:{type:"number"},minItems:2,maxItems:3}],description:"false, a route or node id, or a grid point [x, y, z]"},duration:{anyOf:[{const:"auto"},{type:"integer",minimum:500}]}}},rn={anyOf:[{$ref:"#/$defs/routeRef"},{type:"array",items:{$ref:"#/$defs/routeRef"}}]},Ke={anyOf:[{type:"string"},{type:"object",minProperties:1,maxProperties:1,additionalProperties:{type:"string"}}]};function Ns(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=Ns.evaluated;d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0);let c=a,p=!1,l=a,f=a,m=!1,h=a;if(typeof s!="string"){let P={instancePath:e,schemaPath:"#/$defs/routeRef/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Ke.anyOf[0].type,parentSchema:Ke.anyOf[0],data:s};t===null?t=[P]:t.push(P),a++}var g=h===a;m=m||g;let y=a;if(s&&typeof s=="object"&&!Array.isArray(s)){if(Object.keys(s).length>1){let P={instancePath:e,schemaPath:"#/$defs/routeRef/anyOf/1/maxProperties",keyword:"maxProperties",params:{limit:1},message:"must NOT have more than 1 properties",schema:1,parentSchema:Ke.anyOf[1],data:s};t===null?t=[P]:t.push(P),a++}if(Object.keys(s).length<1){let P={instancePath:e,schemaPath:"#/$defs/routeRef/anyOf/1/minProperties",keyword:"minProperties",params:{limit:1},message:"must NOT have fewer than 1 properties",schema:1,parentSchema:Ke.anyOf[1],data:s};t===null?t=[P]:t.push(P),a++}for(let P in s){let T=s[P];if(typeof T!="string"){let M={instancePath:e+"/"+P.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/routeRef/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Ke.anyOf[1].additionalProperties.type,parentSchema:Ke.anyOf[1].additionalProperties,data:T};t===null?t=[M]:t.push(M),a++}}}else{let P={instancePath:e,schemaPath:"#/$defs/routeRef/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Ke.anyOf[1].type,parentSchema:Ke.anyOf[1],data:s};t===null?t=[P]:t.push(P),a++}var g=y===a;if(m=m||g,g)var k=!0;if(m)a=f,t!==null&&(f?t.length=f:t=null);else{let P={instancePath:e,schemaPath:"#/$defs/routeRef/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:Ke.anyOf,parentSchema:Ke,data:s};t===null?t=[P]:t.push(P),a++}var x=l===a;p=p||x;let u=a;if(Array.isArray(s)){let P=s.length;for(let T=0;T<P;T++){let M=s[T],B=a,E=!1,D=a;if(typeof M!="string"){let O={instancePath:e+"/"+T,schemaPath:"#/$defs/routeRef/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Ke.anyOf[0].type,parentSchema:Ke.anyOf[0],data:M};t===null?t=[O]:t.push(O),a++}var b=D===a;E=E||b;let v=a;if(M&&typeof M=="object"&&!Array.isArray(M)){if(Object.keys(M).length>1){let O={instancePath:e+"/"+T,schemaPath:"#/$defs/routeRef/anyOf/1/maxProperties",keyword:"maxProperties",params:{limit:1},message:"must NOT have more than 1 properties",schema:1,parentSchema:Ke.anyOf[1],data:M};t===null?t=[O]:t.push(O),a++}if(Object.keys(M).length<1){let O={instancePath:e+"/"+T,schemaPath:"#/$defs/routeRef/anyOf/1/minProperties",keyword:"minProperties",params:{limit:1},message:"must NOT have fewer than 1 properties",schema:1,parentSchema:Ke.anyOf[1],data:M};t===null?t=[O]:t.push(O),a++}for(let O in M){let S=M[O];if(typeof S!="string"){let N={instancePath:e+"/"+T+"/"+O.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/routeRef/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Ke.anyOf[1].additionalProperties.type,parentSchema:Ke.anyOf[1].additionalProperties,data:S};t===null?t=[N]:t.push(N),a++}}}else{let O={instancePath:e+"/"+T,schemaPath:"#/$defs/routeRef/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Ke.anyOf[1].type,parentSchema:Ke.anyOf[1],data:M};t===null?t=[O]:t.push(O),a++}var b=v===a;if(E=E||b,E)a=B,t!==null&&(B?t.length=B:t=null);else{let O={instancePath:e+"/"+T,schemaPath:"#/$defs/routeRef/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:Ke.anyOf,parentSchema:Ke,data:M};t===null?t=[O]:t.push(O),a++}}}else{let P={instancePath:e,schemaPath:"#/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array",schema:rn.anyOf[1].type,parentSchema:rn.anyOf[1],data:s};t===null?t=[P]:t.push(P),a++}var x=u===a;if(p=p||x,x)var $=!0;if(p)a=c,t!==null&&(c?t.length=c:t=null);else{let P={instancePath:e,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:rn.anyOf,parentSchema:rn,data:s};t===null?t=[P]:t.push(P),a++}return Ns.errors=t,d.props=k,d.items=$,a===0}Ns.evaluated={dynamicProps:!0,dynamicItems:!0};function zs(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=zs.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),s&&typeof s=="object"&&!Array.isArray(s)){if(s.heading===void 0){let f={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"heading"},message:"must have required property 'heading'",schema:Z.required,parentSchema:Z,data:s};t===null?t=[f]:t.push(f),a++}for(let f in s)if(!nr.call(Z.properties,f)){let m={instancePath:e,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:f},message:"must NOT have additional properties",schema:!1,parentSchema:Z,data:s};t===null?t=[m]:t.push(m),a++}if(s.id!==void 0){let f=s.id;if(typeof f=="string"){if(!Ce.test(f)){let m={instancePath:e+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:f};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:f};t===null?t=[m]:t.push(m),a++}}if(s.number!==void 0){let f=s.number;if(!(typeof f=="number"&&!(f%1)&&!isNaN(f))){let m={instancePath:e+"/number",schemaPath:"#/properties/number/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:Z.properties.number.type,parentSchema:Z.properties.number,data:f};t===null?t=[m]:t.push(m),a++}if(typeof f=="number"&&(f<1||isNaN(f))){let m={instancePath:e+"/number",schemaPath:"#/properties/number/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:Z.properties.number,data:f};t===null?t=[m]:t.push(m),a++}}if(s.kind!==void 0){let f=s.kind;if(typeof f!="string"){let m={instancePath:e+"/kind",schemaPath:"#/properties/kind/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Z.properties.kind.type,parentSchema:Z.properties.kind,data:f};t===null?t=[m]:t.push(m),a++}}if(s.heading!==void 0){let f=s.heading;if(typeof f!="string"){let m={instancePath:e+"/heading",schemaPath:"#/properties/heading/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Z.properties.heading.type,parentSchema:Z.properties.heading,data:f};t===null?t=[m]:t.push(m),a++}}if(s.caption!==void 0){let f=s.caption;if(typeof f!="string"){let m={instancePath:e+"/caption",schemaPath:"#/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Z.properties.caption.type,parentSchema:Z.properties.caption,data:f};t===null?t=[m]:t.push(m),a++}}if(s.command!==void 0){let f=s.command;if(typeof f!="string"){let m={instancePath:e+"/command",schemaPath:"#/properties/command/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Z.properties.command.type,parentSchema:Z.properties.command,data:f};t===null?t=[m]:t.push(m),a++}}if(s.animate!==void 0){let f=s.animate;if(Array.isArray(f)){let m=f.length;for(let h=0;h<m;h++)Ns(f[h],{instancePath:e+"/animate/"+h,parentData:f,parentDataProperty:h,rootData:i,dynamicAnchors:o})||(t=t===null?Ns.errors:t.concat(Ns.errors),a=t.length)}else{let m={instancePath:e+"/animate",schemaPath:"#/properties/animate/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.animate.type,parentSchema:Z.properties.animate,data:f};t===null?t=[m]:t.push(m),a++}}if(s.pulse!==void 0){let f=s.pulse;if(Array.isArray(f)){let m=f.length;for(let h=0;h<m;h++){let y=f[h];if(typeof y=="string"){if(!Ce.test(y)){let g={instancePath:e+"/pulse/"+h,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}else{let g={instancePath:e+"/pulse/"+h,schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}}else{let m={instancePath:e+"/pulse",schemaPath:"#/properties/pulse/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.pulse.type,parentSchema:Z.properties.pulse,data:f};t===null?t=[m]:t.push(m),a++}}if(s.highlight!==void 0){let f=s.highlight;if(Array.isArray(f)){let m=f.length;for(let h=0;h<m;h++){let y=f[h];if(typeof y=="string"){if(!Ce.test(y)){let g={instancePath:e+"/highlight/"+h,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}else{let g={instancePath:e+"/highlight/"+h,schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}}else{let m={instancePath:e+"/highlight",schemaPath:"#/properties/highlight/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.highlight.type,parentSchema:Z.properties.highlight,data:f};t===null?t=[m]:t.push(m),a++}}if(s.focus!==void 0){let f=s.focus;if(Array.isArray(f)){let m=f.length;for(let h=0;h<m;h++){let y=f[h];if(typeof y=="string"){if(!Ce.test(y)){let g={instancePath:e+"/focus/"+h,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}else{let g={instancePath:e+"/focus/"+h,schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}}else{let m={instancePath:e+"/focus",schemaPath:"#/properties/focus/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.focus.type,parentSchema:Z.properties.focus,data:f};t===null?t=[m]:t.push(m),a++}}if(s.show!==void 0){let f=s.show;if(Array.isArray(f)){let m=f.length;for(let h=0;h<m;h++){let y=f[h];if(typeof y=="string"){if(!Ce.test(y)){let g={instancePath:e+"/show/"+h,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}else{let g={instancePath:e+"/show/"+h,schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}}else{let m={instancePath:e+"/show",schemaPath:"#/properties/show/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.show.type,parentSchema:Z.properties.show,data:f};t===null?t=[m]:t.push(m),a++}}if(s.hide!==void 0){let f=s.hide;if(Array.isArray(f)){let m=f.length;for(let h=0;h<m;h++){let y=f[h];if(typeof y=="string"){if(!Ce.test(y)){let g={instancePath:e+"/hide/"+h,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}else{let g={instancePath:e+"/hide/"+h,schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:y};t===null?t=[g]:t.push(g),a++}}}else{let m={instancePath:e+"/hide",schemaPath:"#/properties/hide/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.hide.type,parentSchema:Z.properties.hide,data:f};t===null?t=[m]:t.push(m),a++}}if(s.say!==void 0){let f=s.say;if(Array.isArray(f)){let m=f.length;for(let h=0;h<m;h++){let y=f[h];if(y&&typeof y=="object"&&!Array.isArray(y)){if(y.at===void 0){let g={instancePath:e+"/say/"+h,schemaPath:"#/properties/say/items/required",keyword:"required",params:{missingProperty:"at"},message:"must have required property 'at'",schema:Z.properties.say.items.required,parentSchema:Z.properties.say.items,data:y};t===null?t=[g]:t.push(g),a++}if(y.text===void 0){let g={instancePath:e+"/say/"+h,schemaPath:"#/properties/say/items/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'",schema:Z.properties.say.items.required,parentSchema:Z.properties.say.items,data:y};t===null?t=[g]:t.push(g),a++}for(let g in y)if(!(g==="at"||g==="text"||g==="kind"||g==="dx"||g==="dy"||g==="anchor")){let k={instancePath:e+"/say/"+h,schemaPath:"#/properties/say/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties",schema:!1,parentSchema:Z.properties.say.items,data:y};t===null?t=[k]:t.push(k),a++}if(y.at!==void 0){let g=y.at,k=a,u=!1,b=a;if(typeof g=="string"){if(!Ce.test(g)){let $={instancePath:e+"/say/"+h+"/at",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:g};t===null?t=[$]:t.push($),a++}}else{let $={instancePath:e+"/say/"+h+"/at",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:g};t===null?t=[$]:t.push($),a++}var c=b===a;u=u||c;let x=a;if(Array.isArray(g)){if(g.length>3){let P={instancePath:e+"/say/"+h+"/at",schemaPath:"#/properties/say/items/properties/at/anyOf/1/maxItems",keyword:"maxItems",params:{limit:3},message:"must NOT have more than 3 items",schema:3,parentSchema:Z.properties.say.items.properties.at.anyOf[1],data:g};t===null?t=[P]:t.push(P),a++}if(g.length<2){let P={instancePath:e+"/say/"+h+"/at",schemaPath:"#/properties/say/items/properties/at/anyOf/1/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:Z.properties.say.items.properties.at.anyOf[1],data:g};t===null?t=[P]:t.push(P),a++}let $=g.length;for(let P=0;P<$;P++){let T=g[P];if(typeof T!="number"){let M={instancePath:e+"/say/"+h+"/at/"+P,schemaPath:"#/properties/say/items/properties/at/anyOf/1/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Z.properties.say.items.properties.at.anyOf[1].items.type,parentSchema:Z.properties.say.items.properties.at.anyOf[1].items,data:T};t===null?t=[M]:t.push(M),a++}}}else{let $={instancePath:e+"/say/"+h+"/at",schemaPath:"#/properties/say/items/properties/at/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.say.items.properties.at.anyOf[1].type,parentSchema:Z.properties.say.items.properties.at.anyOf[1],data:g};t===null?t=[$]:t.push($),a++}var c=x===a;if(u=u||c,u)a=k,t!==null&&(k?t.length=k:t=null);else{let $={instancePath:e+"/say/"+h+"/at",schemaPath:"#/properties/say/items/properties/at/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:Z.properties.say.items.properties.at.anyOf,parentSchema:Z.properties.say.items.properties.at,data:g};t===null?t=[$]:t.push($),a++}}if(y.text!==void 0){let g=y.text;if(typeof g!="string"){let k={instancePath:e+"/say/"+h+"/text",schemaPath:"#/properties/say/items/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Z.properties.say.items.properties.text.type,parentSchema:Z.properties.say.items.properties.text,data:g};t===null?t=[k]:t.push(k),a++}}if(y.kind!==void 0){let g=y.kind;if(typeof g!="string"){let k={instancePath:e+"/say/"+h+"/kind",schemaPath:"#/properties/say/items/properties/kind/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Z.properties.say.items.properties.kind.type,parentSchema:Z.properties.say.items.properties.kind,data:g};t===null?t=[k]:t.push(k),a++}}if(y.dx!==void 0){let g=y.dx;if(typeof g!="number"){let k={instancePath:e+"/say/"+h+"/dx",schemaPath:"#/properties/say/items/properties/dx/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Z.properties.say.items.properties.dx.type,parentSchema:Z.properties.say.items.properties.dx,data:g};t===null?t=[k]:t.push(k),a++}}if(y.dy!==void 0){let g=y.dy;if(typeof g!="number"){let k={instancePath:e+"/say/"+h+"/dy",schemaPath:"#/properties/say/items/properties/dy/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Z.properties.say.items.properties.dy.type,parentSchema:Z.properties.say.items.properties.dy,data:g};t===null?t=[k]:t.push(k),a++}}if(y.anchor!==void 0){let g=y.anchor;if(!(g==="start"||g==="middle"||g==="end")){let k={instancePath:e+"/say/"+h+"/anchor",schemaPath:"#/properties/say/items/properties/anchor/enum",keyword:"enum",params:{allowedValues:Z.properties.say.items.properties.anchor.enum},message:"must be equal to one of the allowed values",schema:Z.properties.say.items.properties.anchor.enum,parentSchema:Z.properties.say.items.properties.anchor,data:g};t===null?t=[k]:t.push(k),a++}}}else{let g={instancePath:e+"/say/"+h,schemaPath:"#/properties/say/items/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Z.properties.say.items.type,parentSchema:Z.properties.say.items,data:y};t===null?t=[g]:t.push(g),a++}}}else{let m={instancePath:e+"/say",schemaPath:"#/properties/say/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.say.type,parentSchema:Z.properties.say,data:f};t===null?t=[m]:t.push(m),a++}}if(s.mark!==void 0){let f=s.mark;if(Array.isArray(f)){let m=f.length;for(let h=0;h<m;h++){let y=f[h];if(y&&typeof y=="object"&&!Array.isArray(y)){for(let g in y)if(!(g==="on"||g==="at")){let k={instancePath:e+"/mark/"+h,schemaPath:"#/properties/mark/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties",schema:!1,parentSchema:Z.properties.mark.items,data:y};t===null?t=[k]:t.push(k),a++}if(y.on!==void 0){let g=y.on;if(typeof g=="string"){if(!Ce.test(g)){let k={instancePath:e+"/mark/"+h+"/on",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:g};t===null?t=[k]:t.push(k),a++}}else{let k={instancePath:e+"/mark/"+h+"/on",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:g};t===null?t=[k]:t.push(k),a++}}if(y.at!==void 0){let g=y.at;if(Array.isArray(g)){if(g.length>3){let u={instancePath:e+"/mark/"+h+"/at",schemaPath:"#/properties/mark/items/properties/at/maxItems",keyword:"maxItems",params:{limit:3},message:"must NOT have more than 3 items",schema:3,parentSchema:Z.properties.mark.items.properties.at,data:g};t===null?t=[u]:t.push(u),a++}if(g.length<2){let u={instancePath:e+"/mark/"+h+"/at",schemaPath:"#/properties/mark/items/properties/at/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:Z.properties.mark.items.properties.at,data:g};t===null?t=[u]:t.push(u),a++}let k=g.length;for(let u=0;u<k;u++){let b=g[u];if(typeof b!="number"){let x={instancePath:e+"/mark/"+h+"/at/"+u,schemaPath:"#/properties/mark/items/properties/at/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Z.properties.mark.items.properties.at.items.type,parentSchema:Z.properties.mark.items.properties.at.items,data:b};t===null?t=[x]:t.push(x),a++}}}else{let k={instancePath:e+"/mark/"+h+"/at",schemaPath:"#/properties/mark/items/properties/at/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.mark.items.properties.at.type,parentSchema:Z.properties.mark.items.properties.at,data:g};t===null?t=[k]:t.push(k),a++}}}else{let g={instancePath:e+"/mark/"+h,schemaPath:"#/properties/mark/items/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Z.properties.mark.items.type,parentSchema:Z.properties.mark.items,data:y};t===null?t=[g]:t.push(g),a++}}}else{let m={instancePath:e+"/mark",schemaPath:"#/properties/mark/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.mark.type,parentSchema:Z.properties.mark,data:f};t===null?t=[m]:t.push(m),a++}}if(s.badge!==void 0){let f=s.badge,m=a,h=!1,y=a;if(typeof f!="boolean"){let u={instancePath:e+"/badge",schemaPath:"#/properties/badge/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:Z.properties.badge.anyOf[0].type,parentSchema:Z.properties.badge.anyOf[0],data:f};t===null?t=[u]:t.push(u),a++}var p=y===a;h=h||p;let g=a;if(typeof f=="string"){if(!Ce.test(f)){let u={instancePath:e+"/badge",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:f};t===null?t=[u]:t.push(u),a++}}else{let u={instancePath:e+"/badge",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:f};t===null?t=[u]:t.push(u),a++}var p=g===a;h=h||p;let k=a;if(Array.isArray(f)){if(f.length>3){let b={instancePath:e+"/badge",schemaPath:"#/properties/badge/anyOf/2/maxItems",keyword:"maxItems",params:{limit:3},message:"must NOT have more than 3 items",schema:3,parentSchema:Z.properties.badge.anyOf[2],data:f};t===null?t=[b]:t.push(b),a++}if(f.length<2){let b={instancePath:e+"/badge",schemaPath:"#/properties/badge/anyOf/2/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:Z.properties.badge.anyOf[2],data:f};t===null?t=[b]:t.push(b),a++}let u=f.length;for(let b=0;b<u;b++){let x=f[b];if(typeof x!="number"){let $={instancePath:e+"/badge/"+b,schemaPath:"#/properties/badge/anyOf/2/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Z.properties.badge.anyOf[2].items.type,parentSchema:Z.properties.badge.anyOf[2].items,data:x};t===null?t=[$]:t.push($),a++}}}else{let u={instancePath:e+"/badge",schemaPath:"#/properties/badge/anyOf/2/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Z.properties.badge.anyOf[2].type,parentSchema:Z.properties.badge.anyOf[2],data:f};t===null?t=[u]:t.push(u),a++}var p=k===a;if(h=h||p,h)a=m,t!==null&&(m?t.length=m:t=null);else{let u={instancePath:e+"/badge",schemaPath:"#/properties/badge/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:Z.properties.badge.anyOf,parentSchema:Z.properties.badge,data:f};t===null?t=[u]:t.push(u),a++}}if(s.duration!==void 0){let f=s.duration,m=a,h=!1,y=a;if(f!=="auto"){let k={instancePath:e+"/duration",schemaPath:"#/properties/duration/anyOf/0/const",keyword:"const",params:{allowedValue:"auto"},message:"must be equal to constant",schema:"auto",parentSchema:Z.properties.duration.anyOf[0],data:f};t===null?t=[k]:t.push(k),a++}var l=y===a;h=h||l;let g=a;if(!(typeof f=="number"&&!(f%1)&&!isNaN(f))){let k={instancePath:e+"/duration",schemaPath:"#/properties/duration/anyOf/1/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:Z.properties.duration.anyOf[1].type,parentSchema:Z.properties.duration.anyOf[1],data:f};t===null?t=[k]:t.push(k),a++}if(typeof f=="number"&&(f<500||isNaN(f))){let k={instancePath:e+"/duration",schemaPath:"#/properties/duration/anyOf/1/minimum",keyword:"minimum",params:{comparison:">=",limit:500},message:"must be >= 500",schema:500,parentSchema:Z.properties.duration.anyOf[1],data:f};t===null?t=[k]:t.push(k),a++}var l=g===a;if(h=h||l,h)a=m,t!==null&&(m?t.length=m:t=null);else{let k={instancePath:e+"/duration",schemaPath:"#/properties/duration/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:Z.properties.duration.anyOf,parentSchema:Z.properties.duration,data:f};t===null?t=[k]:t.push(k),a++}}}else{let f={instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Z.type,parentSchema:Z,data:s};t===null?t=[f]:t.push(f),a++}return zs.errors=t,a===0}zs.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};function Is(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=Is.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),s&&typeof s=="object"&&!Array.isArray(s)){if(s.id===void 0){let l={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'",schema:Y.required,parentSchema:Y,data:s};t===null?t=[l]:t.push(l),a++}if(s.title===void 0){let l={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'",schema:Y.required,parentSchema:Y,data:s};t===null?t=[l]:t.push(l),a++}for(let l in s)if(!nr.call(Y.properties,l)){let f={instancePath:e,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:l},message:"must NOT have additional properties",schema:!1,parentSchema:Y,data:s};t===null?t=[f]:t.push(f),a++}if(s.id!==void 0){let l=s.id;if(typeof l=="string"){if(!Ce.test(l)){let f={instancePath:e+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},message:'must match pattern "^[A-Za-z][A-Za-z0-9_-]*$"',schema:"^[A-Za-z][A-Za-z0-9_-]*$",parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:H.type,parentSchema:H,data:l};t===null?t=[f]:t.push(f),a++}}if(s.title!==void 0){let l=s.title;if(typeof l!="string"){let f={instancePath:e+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Y.properties.title.type,parentSchema:Y.properties.title,data:l};t===null?t=[f]:t.push(f),a++}}if(s.ants!==void 0){let l=s.ants,f=a,m=!1,h=a;if(typeof l!="boolean"){let k={instancePath:e+"/ants",schemaPath:"#/properties/ants/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:Y.properties.ants.anyOf[0].type,parentSchema:Y.properties.ants.anyOf[0],data:l};t===null?t=[k]:t.push(k),a++}var c=h===a;m=m||c;let y=a;if(Array.isArray(l)){let k=l.length;for(let u=0;u<k;u++){let b=l[u];if(typeof b!="string"){let x={instancePath:e+"/ants/"+u,schemaPath:"#/properties/ants/anyOf/1/items/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Y.properties.ants.anyOf[1].items.type,parentSchema:Y.properties.ants.anyOf[1].items,data:b};t===null?t=[x]:t.push(x),a++}}}else{let k={instancePath:e+"/ants",schemaPath:"#/properties/ants/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.ants.anyOf[1].type,parentSchema:Y.properties.ants.anyOf[1],data:l};t===null?t=[k]:t.push(k),a++}var c=y===a;m=m||c;let g=a;if(l&&typeof l=="object"&&!Array.isArray(l)){for(let k in l)if(!(k==="ids"||k==="speed"||k==="dash")){let u={instancePath:e+"/ants",schemaPath:"#/properties/ants/anyOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:k},message:"must NOT have additional properties",schema:!1,parentSchema:Y.properties.ants.anyOf[2],data:l};t===null?t=[u]:t.push(u),a++}if(l.ids!==void 0){let k=l.ids;if(Array.isArray(k)){let u=k.length;for(let b=0;b<u;b++){let x=k[b];if(typeof x!="string"){let $={instancePath:e+"/ants/ids/"+b,schemaPath:"#/properties/ants/anyOf/2/properties/ids/items/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Y.properties.ants.anyOf[2].properties.ids.items.type,parentSchema:Y.properties.ants.anyOf[2].properties.ids.items,data:x};t===null?t=[$]:t.push($),a++}}}else{let u={instancePath:e+"/ants/ids",schemaPath:"#/properties/ants/anyOf/2/properties/ids/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.ants.anyOf[2].properties.ids.type,parentSchema:Y.properties.ants.anyOf[2].properties.ids,data:k};t===null?t=[u]:t.push(u),a++}}if(l.speed!==void 0){let k=l.speed;if(typeof k!="number"){let u={instancePath:e+"/ants/speed",schemaPath:"#/properties/ants/anyOf/2/properties/speed/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Y.properties.ants.anyOf[2].properties.speed.type,parentSchema:Y.properties.ants.anyOf[2].properties.speed,data:k};t===null?t=[u]:t.push(u),a++}}if(l.dash!==void 0){let k=l.dash;if(Array.isArray(k)){if(k.length>2){let b={instancePath:e+"/ants/dash",schemaPath:"#/properties/ants/anyOf/2/properties/dash/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items",schema:2,parentSchema:Y.properties.ants.anyOf[2].properties.dash,data:k};t===null?t=[b]:t.push(b),a++}if(k.length<2){let b={instancePath:e+"/ants/dash",schemaPath:"#/properties/ants/anyOf/2/properties/dash/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items",schema:2,parentSchema:Y.properties.ants.anyOf[2].properties.dash,data:k};t===null?t=[b]:t.push(b),a++}let u=k.length;for(let b=0;b<u;b++){let x=k[b];if(typeof x=="number"){if(x<=0||isNaN(x)){let $={instancePath:e+"/ants/dash/"+b,schemaPath:"#/properties/ants/anyOf/2/properties/dash/items/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:Y.properties.ants.anyOf[2].properties.dash.items,data:x};t===null?t=[$]:t.push($),a++}}else{let $={instancePath:e+"/ants/dash/"+b,schemaPath:"#/properties/ants/anyOf/2/properties/dash/items/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Y.properties.ants.anyOf[2].properties.dash.items.type,parentSchema:Y.properties.ants.anyOf[2].properties.dash.items,data:x};t===null?t=[$]:t.push($),a++}}}else{let u={instancePath:e+"/ants/dash",schemaPath:"#/properties/ants/anyOf/2/properties/dash/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.ants.anyOf[2].properties.dash.type,parentSchema:Y.properties.ants.anyOf[2].properties.dash,data:k};t===null?t=[u]:t.push(u),a++}}}else{let k={instancePath:e+"/ants",schemaPath:"#/properties/ants/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Y.properties.ants.anyOf[2].type,parentSchema:Y.properties.ants.anyOf[2],data:l};t===null?t=[k]:t.push(k),a++}var c=g===a;if(m=m||c,m)a=f,t!==null&&(f?t.length=f:t=null);else{let k={instancePath:e+"/ants",schemaPath:"#/properties/ants/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:Y.properties.ants.anyOf,parentSchema:Y.properties.ants,data:l};t===null?t=[k]:t.push(k),a++}}if(s.motion!==void 0){let l=s.motion;if(!(l&&typeof l=="object"&&!Array.isArray(l))){let f={instancePath:e+"/motion",schemaPath:"#/properties/motion/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Y.properties.motion.type,parentSchema:Y.properties.motion,data:l};t===null?t=[f]:t.push(f),a++}}if(s.caption!==void 0){let l=s.caption;if(typeof l!="string"){let f={instancePath:e+"/caption",schemaPath:"#/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Y.properties.caption.type,parentSchema:Y.properties.caption,data:l};t===null?t=[f]:t.push(f),a++}}if(s.aria!==void 0){let l=s.aria;if(typeof l!="string"){let f={instancePath:e+"/aria",schemaPath:"#/properties/aria/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Y.properties.aria.type,parentSchema:Y.properties.aria,data:l};t===null?t=[f]:t.push(f),a++}}if(s.gap!==void 0){let l=s.gap;if(typeof l=="number"){if(l<=0||isNaN(l)){let f={instancePath:e+"/gap",schemaPath:"#/properties/gap/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:Y.properties.gap,data:l};t===null?t=[f]:t.push(f),a++}}else{let f={instancePath:e+"/gap",schemaPath:"#/properties/gap/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Y.properties.gap.type,parentSchema:Y.properties.gap,data:l};t===null?t=[f]:t.push(f),a++}}if(s.flow!==void 0){let l=s.flow;if(!(l==="row"||l==="column")){let f={instancePath:e+"/flow",schemaPath:"#/properties/flow/enum",keyword:"enum",params:{allowedValues:Y.properties.flow.enum},message:"must be equal to one of the allowed values",schema:Y.properties.flow.enum,parentSchema:Y.properties.flow,data:l};t===null?t=[f]:t.push(f),a++}}if(s.regions!==void 0){let l=s.regions;if(Array.isArray(l)){let f=l.length;for(let m=0;m<f;m++)fs(l[m],{instancePath:e+"/regions/"+m,parentData:l,parentDataProperty:m,rootData:i,dynamicAnchors:o})||(t=t===null?fs.errors:t.concat(fs.errors),a=t.length)}else{let f={instancePath:e+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.regions.type,parentSchema:Y.properties.regions,data:l};t===null?t=[f]:t.push(f),a++}}if(s.nodes!==void 0){let l=s.nodes;if(Array.isArray(l)){let f=l.length;for(let m=0;m<f;m++)jt(l[m],{instancePath:e+"/nodes/"+m,parentData:l,parentDataProperty:m,rootData:i,dynamicAnchors:o})||(t=t===null?jt.errors:t.concat(jt.errors),a=t.length)}else{let f={instancePath:e+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.nodes.type,parentSchema:Y.properties.nodes,data:l};t===null?t=[f]:t.push(f),a++}}if(s.routes!==void 0){let l=s.routes;if(Array.isArray(l)){let f=l.length;for(let m=0;m<f;m++)As(l[m],{instancePath:e+"/routes/"+m,parentData:l,parentDataProperty:m,rootData:i,dynamicAnchors:o})||(t=t===null?As.errors:t.concat(As.errors),a=t.length)}else{let f={instancePath:e+"/routes",schemaPath:"#/properties/routes/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.routes.type,parentSchema:Y.properties.routes,data:l};t===null?t=[f]:t.push(f),a++}}if(s.notes!==void 0){let l=s.notes;if(Array.isArray(l)){let f=l.length;for(let m=0;m<f;m++)Ms(l[m],{instancePath:e+"/notes/"+m,parentData:l,parentDataProperty:m,rootData:i,dynamicAnchors:o})||(t=t===null?Ms.errors:t.concat(Ms.errors),a=t.length)}else{let f={instancePath:e+"/notes",schemaPath:"#/properties/notes/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.notes.type,parentSchema:Y.properties.notes,data:l};t===null?t=[f]:t.push(f),a++}}if(s.steps!==void 0){let l=s.steps;if(Array.isArray(l)){let f=l.length;for(let m=0;m<f;m++)zs(l[m],{instancePath:e+"/steps/"+m,parentData:l,parentDataProperty:m,rootData:i,dynamicAnchors:o})||(t=t===null?zs.errors:t.concat(zs.errors),a=t.length)}else{let f={instancePath:e+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.steps.type,parentSchema:Y.properties.steps,data:l};t===null?t=[f]:t.push(f),a++}}if(s.legend!==void 0){let l=s.legend,f=a,m=!1,h=a;if(l!=="auto"){let k={instancePath:e+"/legend",schemaPath:"#/properties/legend/anyOf/0/enum",keyword:"enum",params:{allowedValues:Y.properties.legend.anyOf[0].enum},message:"must be equal to one of the allowed values",schema:Y.properties.legend.anyOf[0].enum,parentSchema:Y.properties.legend.anyOf[0],data:l};t===null?t=[k]:t.push(k),a++}var p=h===a;m=m||p;let y=a;if(l!==!1){let k={instancePath:e+"/legend",schemaPath:"#/properties/legend/anyOf/1/const",keyword:"const",params:{allowedValue:!1},message:"must be equal to constant",schema:!1,parentSchema:Y.properties.legend.anyOf[1],data:l};t===null?t=[k]:t.push(k),a++}var p=y===a;m=m||p;let g=a;if(Array.isArray(l)){let k=l.length;for(let u=0;u<k;u++){let b=l[u];if(typeof b!="string"){let x={instancePath:e+"/legend/"+u,schemaPath:"#/properties/legend/anyOf/2/items/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Y.properties.legend.anyOf[2].items.type,parentSchema:Y.properties.legend.anyOf[2].items,data:b};t===null?t=[x]:t.push(x),a++}}}else{let k={instancePath:e+"/legend",schemaPath:"#/properties/legend/anyOf/2/type",keyword:"type",params:{type:"array"},message:"must be array",schema:Y.properties.legend.anyOf[2].type,parentSchema:Y.properties.legend.anyOf[2],data:l};t===null?t=[k]:t.push(k),a++}var p=g===a;if(m=m||p,m)a=f,t!==null&&(f?t.length=f:t=null);else{let k={instancePath:e+"/legend",schemaPath:"#/properties/legend/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:Y.properties.legend.anyOf,parentSchema:Y.properties.legend,data:l};t===null?t=[k]:t.push(k),a++}}if(s.badges!==void 0){let l=s.badges;if(typeof l!="boolean"){let f={instancePath:e+"/badges",schemaPath:"#/properties/badges/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:Y.properties.badges.type,parentSchema:Y.properties.badges,data:l};t===null?t=[f]:t.push(f),a++}}if(s.grid!==void 0){let l=s.grid;if(l&&typeof l=="object"&&!Array.isArray(l)){for(let f in l)if(!(f==="snap"||f==="show"||f==="step")){let m={instancePath:e+"/grid",schemaPath:"#/$defs/grid/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:f},message:"must NOT have additional properties",schema:!1,parentSchema:_e,data:l};t===null?t=[m]:t.push(m),a++}if(l.snap!==void 0){let f=l.snap;if(typeof f=="number"){if(f<=0||isNaN(f)){let m={instancePath:e+"/grid/snap",schemaPath:"#/$defs/grid/properties/snap/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:_e.properties.snap,data:f};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e+"/grid/snap",schemaPath:"#/$defs/grid/properties/snap/type",keyword:"type",params:{type:"number"},message:"must be number",schema:_e.properties.snap.type,parentSchema:_e.properties.snap,data:f};t===null?t=[m]:t.push(m),a++}}if(l.show!==void 0){let f=l.show;if(typeof f!="boolean"){let m={instancePath:e+"/grid/show",schemaPath:"#/$defs/grid/properties/show/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:_e.properties.show.type,parentSchema:_e.properties.show,data:f};t===null?t=[m]:t.push(m),a++}}if(l.step!==void 0){let f=l.step;if(typeof f=="number"){if(f<=0||isNaN(f)){let m={instancePath:e+"/grid/step",schemaPath:"#/$defs/grid/properties/step/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:_e.properties.step,data:f};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e+"/grid/step",schemaPath:"#/$defs/grid/properties/step/type",keyword:"type",params:{type:"number"},message:"must be number",schema:_e.properties.step.type,parentSchema:_e.properties.step,data:f};t===null?t=[m]:t.push(m),a++}}}else{let f={instancePath:e+"/grid",schemaPath:"#/$defs/grid/type",keyword:"type",params:{type:"object"},message:"must be object",schema:_e.type,parentSchema:_e,data:l};t===null?t=[f]:t.push(f),a++}}if(s.assemble!==void 0){let l=s.assemble;if(typeof l!="boolean"){let f={instancePath:e+"/assemble",schemaPath:"#/properties/assemble/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:Y.properties.assemble.type,parentSchema:Y.properties.assemble,data:l};t===null?t=[f]:t.push(f),a++}}if(s.loop!==void 0){let l=s.loop;if(typeof l!="boolean"){let f={instancePath:e+"/loop",schemaPath:"#/properties/loop/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:Y.properties.loop.type,parentSchema:Y.properties.loop,data:l};t===null?t=[f]:t.push(f),a++}}if(s.dim!==void 0){let l=s.dim;if(!(l==="flows"||l==="all")){let f={instancePath:e+"/dim",schemaPath:"#/properties/dim/enum",keyword:"enum",params:{allowedValues:Y.properties.dim.enum},message:"must be equal to one of the allowed values",schema:Y.properties.dim.enum,parentSchema:Y.properties.dim,data:l};t===null?t=[f]:t.push(f),a++}}if(s.after!==void 0){let l=s.after;if(typeof l!="string"){let f={instancePath:e+"/after",schemaPath:"#/properties/after/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Y.properties.after.type,parentSchema:Y.properties.after,data:l};t===null?t=[f]:t.push(f),a++}}}else{let l={instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Y.type,parentSchema:Y,data:s};t===null?t=[l]:t.push(l),a++}return Is.errors=t,a===0}Is.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};function nn(s,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:i=s,dynamicAnchors:o={}}={}){let t=null,a=0,d=nn.evaluated;if(d.dynamicProps&&(d.props=void 0),d.dynamicItems&&(d.items=void 0),s&&typeof s=="object"&&!Array.isArray(s)){if(s.isodiag===void 0){let c={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"isodiag"},message:"must have required property 'isodiag'",schema:$e.required,parentSchema:$e,data:s};t===null?t=[c]:t.push(c),a++}if(s.scenes===void 0){let c={instancePath:e,schemaPath:"#/required",keyword:"required",params:{missingProperty:"scenes"},message:"must have required property 'scenes'",schema:$e.required,parentSchema:$e,data:s};t===null?t=[c]:t.push(c),a++}for(let c in s)if(!nr.call($e.properties,c)){let p={instancePath:e,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:c},message:"must NOT have additional properties",schema:!1,parentSchema:$e,data:s};t===null?t=[p]:t.push(p),a++}if(s.isodiag!==void 0){let c=s.isodiag;if(c!==1){let p={instancePath:e+"/isodiag",schemaPath:"#/properties/isodiag/const",keyword:"const",params:{allowedValue:1},message:"must be equal to constant",schema:1,parentSchema:$e.properties.isodiag,data:c};t===null?t=[p]:t.push(p),a++}}if(s.title!==void 0){let c=s.title;if(typeof c!="string"){let p={instancePath:e+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string",schema:$e.properties.title.type,parentSchema:$e.properties.title,data:c};t===null?t=[p]:t.push(p),a++}}if(s.lede!==void 0){let c=s.lede;if(typeof c!="string"){let p={instancePath:e+"/lede",schemaPath:"#/properties/lede/type",keyword:"type",params:{type:"string"},message:"must be string",schema:$e.properties.lede.type,parentSchema:$e.properties.lede,data:c};t===null?t=[p]:t.push(p),a++}}if(s.pills!==void 0){let c=s.pills;if(Array.isArray(c)){let p=c.length;for(let l=0;l<p;l++){let f=c[l];if(typeof f!="string"){let m={instancePath:e+"/pills/"+l,schemaPath:"#/properties/pills/items/type",keyword:"type",params:{type:"string"},message:"must be string",schema:$e.properties.pills.items.type,parentSchema:$e.properties.pills.items,data:f};t===null?t=[m]:t.push(m),a++}}}else{let p={instancePath:e+"/pills",schemaPath:"#/properties/pills/type",keyword:"type",params:{type:"array"},message:"must be array",schema:$e.properties.pills.type,parentSchema:$e.properties.pills,data:c};t===null?t=[p]:t.push(p),a++}}if(s.theme!==void 0){let c=s.theme;if(typeof c!="string"){let p={instancePath:e+"/theme",schemaPath:"#/properties/theme/type",keyword:"type",params:{type:"string"},message:"must be string",schema:$e.properties.theme.type,parentSchema:$e.properties.theme,data:c};t===null?t=[p]:t.push(p),a++}}if(s.roles!==void 0){let c=s.roles;if(c&&typeof c=="object"&&!Array.isArray(c))for(let p in c){let l=c[p];if(l&&typeof l=="object"&&!Array.isArray(l)){if(l.h===void 0){let f={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/role/required",keyword:"required",params:{missingProperty:"h"},message:"must have required property 'h'",schema:Be.required,parentSchema:Be,data:l};t===null?t=[f]:t.push(f),a++}if(l.s===void 0){let f={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/role/required",keyword:"required",params:{missingProperty:"s"},message:"must have required property 's'",schema:Be.required,parentSchema:Be,data:l};t===null?t=[f]:t.push(f),a++}for(let f in l)if(!(f==="h"||f==="s"||f==="top"||f==="tint")){let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/role/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:f},message:"must NOT have additional properties",schema:!1,parentSchema:Be,data:l};t===null?t=[m]:t.push(m),a++}if(l.h!==void 0){let f=l.h;if(typeof f=="number"){if(f>360||isNaN(f)){let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/h",schemaPath:"#/$defs/role/properties/h/maximum",keyword:"maximum",params:{comparison:"<=",limit:360},message:"must be <= 360",schema:360,parentSchema:Be.properties.h,data:f};t===null?t=[m]:t.push(m),a++}if(f<0||isNaN(f)){let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/h",schemaPath:"#/$defs/role/properties/h/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:Be.properties.h,data:f};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/h",schemaPath:"#/$defs/role/properties/h/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Be.properties.h.type,parentSchema:Be.properties.h,data:f};t===null?t=[m]:t.push(m),a++}}if(l.s!==void 0){let f=l.s;if(typeof f=="number"){if(f>100||isNaN(f)){let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/s",schemaPath:"#/$defs/role/properties/s/maximum",keyword:"maximum",params:{comparison:"<=",limit:100},message:"must be <= 100",schema:100,parentSchema:Be.properties.s,data:f};t===null?t=[m]:t.push(m),a++}if(f<0||isNaN(f)){let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/s",schemaPath:"#/$defs/role/properties/s/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:Be.properties.s,data:f};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/s",schemaPath:"#/$defs/role/properties/s/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Be.properties.s.type,parentSchema:Be.properties.s,data:f};t===null?t=[m]:t.push(m),a++}}if(l.top!==void 0){let f=l.top;if(typeof f!="string"){let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/top",schemaPath:"#/$defs/role/properties/top/type",keyword:"type",params:{type:"string"},message:"must be string",schema:Be.properties.top.type,parentSchema:Be.properties.top,data:f};t===null?t=[m]:t.push(m),a++}}if(l.tint!==void 0){let f=l.tint;if(typeof f=="number"){if(f>100||isNaN(f)){let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/tint",schemaPath:"#/$defs/role/properties/tint/maximum",keyword:"maximum",params:{comparison:"<=",limit:100},message:"must be <= 100",schema:100,parentSchema:Be.properties.tint,data:f};t===null?t=[m]:t.push(m),a++}if(f<0||isNaN(f)){let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/tint",schemaPath:"#/$defs/role/properties/tint/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:Be.properties.tint,data:f};t===null?t=[m]:t.push(m),a++}}else{let m={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/tint",schemaPath:"#/$defs/role/properties/tint/type",keyword:"type",params:{type:"number"},message:"must be number",schema:Be.properties.tint.type,parentSchema:Be.properties.tint,data:f};t===null?t=[m]:t.push(m),a++}}}else{let f={instancePath:e+"/roles/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/role/type",keyword:"type",params:{type:"object"},message:"must be object",schema:Be.type,parentSchema:Be,data:l};t===null?t=[f]:t.push(f),a++}}else{let p={instancePath:e+"/roles",schemaPath:"#/properties/roles/type",keyword:"type",params:{type:"object"},message:"must be object",schema:$e.properties.roles.type,parentSchema:$e.properties.roles,data:c};t===null?t=[p]:t.push(p),a++}}if(s.kinds!==void 0){let c=s.kinds;if(c&&typeof c=="object"&&!Array.isArray(c))for(let p in c){let l=c[p];if(l&&typeof l=="object"&&!Array.isArray(l)){for(let f in l)if(!(f==="legend"||f==="like"||f==="color"||f==="dash")){let m={instancePath:e+"/kinds/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/kindDef/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:f},message:"must NOT have additional properties",schema:!1,parentSchema:ut,data:l};t===null?t=[m]:t.push(m),a++}if(l.legend!==void 0){let f=l.legend;if(typeof f!="string"){let m={instancePath:e+"/kinds/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/legend",schemaPath:"#/$defs/kindDef/properties/legend/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ut.properties.legend.type,parentSchema:ut.properties.legend,data:f};t===null?t=[m]:t.push(m),a++}}if(l.like!==void 0){let f=l.like;if(typeof f!="string"){let m={instancePath:e+"/kinds/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/like",schemaPath:"#/$defs/kindDef/properties/like/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ut.properties.like.type,parentSchema:ut.properties.like,data:f};t===null?t=[m]:t.push(m),a++}}if(l.color!==void 0){let f=l.color;if(typeof f!="string"){let m={instancePath:e+"/kinds/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/color",schemaPath:"#/$defs/kindDef/properties/color/type",keyword:"type",params:{type:"string"},message:"must be string",schema:ut.properties.color.type,parentSchema:ut.properties.color,data:f};t===null?t=[m]:t.push(m),a++}}if(l.dash!==void 0){let f=l.dash;if(!(f==="solid"||f==="dashed"||f==="dotted")){let m={instancePath:e+"/kinds/"+p.replace(/~/g,"~0").replace(/\//g,"~1")+"/dash",schemaPath:"#/$defs/kindDef/properties/dash/enum",keyword:"enum",params:{allowedValues:ut.properties.dash.enum},message:"must be equal to one of the allowed values",schema:ut.properties.dash.enum,parentSchema:ut.properties.dash,data:f};t===null?t=[m]:t.push(m),a++}}}else{let f={instancePath:e+"/kinds/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/kindDef/type",keyword:"type",params:{type:"object"},message:"must be object",schema:ut.type,parentSchema:ut,data:l};t===null?t=[f]:t.push(f),a++}}else{let p={instancePath:e+"/kinds",schemaPath:"#/properties/kinds/type",keyword:"type",params:{type:"object"},message:"must be object",schema:$e.properties.kinds.type,parentSchema:$e.properties.kinds,data:c};t===null?t=[p]:t.push(p),a++}}if(s.after!==void 0){let c=s.after;if(typeof c!="string"){let p={instancePath:e+"/after",schemaPath:"#/properties/after/type",keyword:"type",params:{type:"string"},message:"must be string",schema:$e.properties.after.type,parentSchema:$e.properties.after,data:c};t===null?t=[p]:t.push(p),a++}}if(s.grid!==void 0){let c=s.grid;if(c&&typeof c=="object"&&!Array.isArray(c)){for(let p in c)if(!(p==="snap"||p==="show"||p==="step")){let l={instancePath:e+"/grid",schemaPath:"#/$defs/grid/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties",schema:!1,parentSchema:_e,data:c};t===null?t=[l]:t.push(l),a++}if(c.snap!==void 0){let p=c.snap;if(typeof p=="number"){if(p<=0||isNaN(p)){let l={instancePath:e+"/grid/snap",schemaPath:"#/$defs/grid/properties/snap/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:_e.properties.snap,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/grid/snap",schemaPath:"#/$defs/grid/properties/snap/type",keyword:"type",params:{type:"number"},message:"must be number",schema:_e.properties.snap.type,parentSchema:_e.properties.snap,data:p};t===null?t=[l]:t.push(l),a++}}if(c.show!==void 0){let p=c.show;if(typeof p!="boolean"){let l={instancePath:e+"/grid/show",schemaPath:"#/$defs/grid/properties/show/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:_e.properties.show.type,parentSchema:_e.properties.show,data:p};t===null?t=[l]:t.push(l),a++}}if(c.step!==void 0){let p=c.step;if(typeof p=="number"){if(p<=0||isNaN(p)){let l={instancePath:e+"/grid/step",schemaPath:"#/$defs/grid/properties/step/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:_e.properties.step,data:p};t===null?t=[l]:t.push(l),a++}}else{let l={instancePath:e+"/grid/step",schemaPath:"#/$defs/grid/properties/step/type",keyword:"type",params:{type:"number"},message:"must be number",schema:_e.properties.step.type,parentSchema:_e.properties.step,data:p};t===null?t=[l]:t.push(l),a++}}}else{let p={instancePath:e+"/grid",schemaPath:"#/$defs/grid/type",keyword:"type",params:{type:"object"},message:"must be object",schema:_e.type,parentSchema:_e,data:c};t===null?t=[p]:t.push(p),a++}}if(s.assemble!==void 0){let c=s.assemble;if(typeof c!="boolean"){let p={instancePath:e+"/assemble",schemaPath:"#/properties/assemble/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:$e.properties.assemble.type,parentSchema:$e.properties.assemble,data:c};t===null?t=[p]:t.push(p),a++}}if(s.footer!==void 0){let c=s.footer;if(typeof c!="string"){let p={instancePath:e+"/footer",schemaPath:"#/properties/footer/type",keyword:"type",params:{type:"string"},message:"must be string",schema:$e.properties.footer.type,parentSchema:$e.properties.footer,data:c};t===null?t=[p]:t.push(p),a++}}if(s.treatment!==void 0){let c=s.treatment;if(c!=="mono"){let p={instancePath:e+"/treatment",schemaPath:"#/properties/treatment/enum",keyword:"enum",params:{allowedValues:$e.properties.treatment.enum},message:"must be equal to one of the allowed values",schema:$e.properties.treatment.enum,parentSchema:$e.properties.treatment,data:c};t===null?t=[p]:t.push(p),a++}}if(s.scenes!==void 0){let c=s.scenes;if(Array.isArray(c)){if(c.length<1){let l={instancePath:e+"/scenes",schemaPath:"#/properties/scenes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:$e.properties.scenes,data:c};t===null?t=[l]:t.push(l),a++}let p=c.length;for(let l=0;l<p;l++)Is(c[l],{instancePath:e+"/scenes/"+l,parentData:c,parentDataProperty:l,rootData:i,dynamicAnchors:o})||(t=t===null?Is.errors:t.concat(Is.errors),a=t.length)}else{let p={instancePath:e+"/scenes",schemaPath:"#/properties/scenes/type",keyword:"type",params:{type:"array"},message:"must be array",schema:$e.properties.scenes.type,parentSchema:$e.properties.scenes,data:c};t===null?t=[p]:t.push(p),a++}}}else{let c={instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:$e.type,parentSchema:$e,data:s};t===null?t=[c]:t.push(c),a++}return nn.errors=t,a===0}nn.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};function Pp(s){let e=JSON.stringify(s),r=2166136261;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,16777619)>>>0;return r.toString(16)+":"+e.length}var vp=new Map([["28016100:13106",bo]]);function $i(s){let e=vp.get(Pp(s));if(!e)throw new Error(`schema not precompiled into the page: ${s.$id??s.title??"?"}`);return e}var Si={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://isodiag.local/schema/isodiag-1.json",title:"isodiag diagram",description:"A page of isometric, animated diagrams. See docs/FORMAT.md.",type:"object",required:["isodiag","scenes"],additionalProperties:!1,properties:{isodiag:{const:1,description:"Format version. Always 1."},title:{type:"string"},lede:{type:"string"},pills:{type:"array",items:{type:"string"}},theme:{type:"string",description:"'default' or a path to a theme file"},roles:{type:"object",description:"Extra or changed colour roles for nodes and regions",additionalProperties:{$ref:"#/$defs/role"}},kinds:{type:"object",description:"Extra flow kinds, or new legend text for the standard ones",additionalProperties:{$ref:"#/$defs/kindDef"}},after:{type:"string",description:"Markdown shown after all scenes"},grid:{$ref:"#/$defs/grid"},assemble:{type:"boolean",description:"draw each scene by flying its parts in from the nearest edge, then play"},footer:{type:"string"},treatment:{enum:["mono"],description:"How a self-contained drawing (renderSvg, <isometric-diagram>) is painted: mono, black and white. A host may say otherwise. The page isodiag build writes is in colour."},scenes:{type:"array",minItems:1,items:{$ref:"#/$defs/scene"}}},$defs:{motion:{type:"object",additionalProperties:!1,minProperties:1,description:"how this piece (a region: its contents too) moves when the drawing assembles or disassembles",properties:{style:{enum:["edge","drop","rise","fly","pop","scatter","build","fade"],description:"how it arrives"},out:{enum:["explode","lift-off","sink","scatter","fly-out","collapse","fade","reverse"],description:"how it leaves"},easing:{enum:["linear","ease","ease-in","ease-out","settle","spring","bounce"]},from:{enum:["left","right","top","bottom"],description:"fly: the side it comes from"},delay:{type:"number",minimum:0,description:"ms after its turn"},duration:{type:"number",exclusiveMinimum:0,description:"ms its own move takes"}}},variants:{type:"object",minProperties:1,propertyNames:{$ref:"#/$defs/id"},description:"other looks of it, by name, for a motion to switch to (its box stays as it is)",additionalProperties:{type:"object",additionalProperties:!1,minProperties:1,properties:{role:{type:"string"},ghost:{type:"boolean"},label:{type:"string"},sub:{type:"string"},face:{type:"string",pattern:"^[a-z][a-z0-9-]*$"},deco:{type:"array",items:{$ref:"#/$defs/deco"}}}}},id:{type:"string",pattern:"^[A-Za-z][A-Za-z0-9_-]*$"},grid:{type:"object",additionalProperties:!1,properties:{snap:{type:"number",exclusiveMinimum:0,description:"round every placed edge and route waypoint to this step, in grid units"},show:{type:"boolean",description:"draw the floor grid when the page opens (the Grid button toggles it)"},step:{type:"number",exclusiveMinimum:0,description:"spacing of the drawn grid lines; default the snap step, or 1"}}},num:{type:"number"},point2:{type:"array",items:{type:"number"},minItems:2,maxItems:2},size2or3:{type:"array",items:{type:"number",exclusiveMinimum:0},minItems:2,maxItems:3},stepRef:{anyOf:[{type:"string"},{type:"integer",minimum:1}]},side:{enum:["n","e","s","w"]},align:{enum:["start","center","end"]},role:{type:"object",additionalProperties:!1,required:["h","s"],properties:{h:{type:"number",minimum:0,maximum:360,description:"hue"},s:{type:"number",minimum:0,maximum:100,description:"saturation, percent"},top:{type:"string",description:"CSS colour for the top face, overriding the computed one"},tint:{type:"number",minimum:0,maximum:100,description:"percent of the role colour mixed into the pad colour for the top face"}}},kindDef:{type:"object",additionalProperties:!1,properties:{legend:{type:"string"},like:{type:"string",description:"a standard kind whose colour and line style this one uses"},color:{type:"string"},dash:{enum:["solid","dashed","dotted"]}}},placement:{properties:{in:{$ref:"#/$defs/id"},at:{$ref:"#/$defs/point2"},"right-of":{$ref:"#/$defs/id"},"left-of":{$ref:"#/$defs/id"},below:{$ref:"#/$defs/id"},behind:{$ref:"#/$defs/id"},gap:{type:"number"},align:{$ref:"#/$defs/align"},shift:{$ref:"#/$defs/point2",description:"nudge after placement, grid units [dx, dy]"},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}},scene:{type:"object",required:["id","title"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},ants:{description:"its connectors march, showing which way they flow: all that may, these, or with a speed (units a second) and a dash",anyOf:[{type:"boolean"},{type:"array",items:{type:"string"}},{type:"object",additionalProperties:!1,properties:{ids:{type:"array",items:{type:"string"}},speed:{type:"number"},dash:{type:"array",items:{type:"number",exclusiveMinimum:0},minItems:2,maxItems:2}}}]},motion:{type:"object",description:"the scene's motion document (isomotion/1; its `isomotion: 1` may be left out)"},caption:{type:"string"},aria:{type:"string"},gap:{type:"number",exclusiveMinimum:0},flow:{enum:["row","column"]},regions:{type:"array",items:{$ref:"#/$defs/region"}},nodes:{type:"array",items:{$ref:"#/$defs/node"}},routes:{type:"array",items:{$ref:"#/$defs/route"}},notes:{type:"array",items:{$ref:"#/$defs/note"}},steps:{type:"array",items:{$ref:"#/$defs/step"}},legend:{anyOf:[{enum:["auto"]},{const:!1},{type:"array",items:{type:"string"}}]},badges:{type:"boolean"},grid:{$ref:"#/$defs/grid"},assemble:{type:"boolean",description:"draw the scene by flying its parts in from the nearest edge, then play"},loop:{type:"boolean",description:"the player wraps from the last step to the first (default true)"},dim:{enum:["flows","all"],description:"what a step dims: only flows, their labels and marks (default), or nodes too"},after:{type:"string"}}},region:{type:"object",required:["id","kind"],unevaluatedProperties:!1,allOf:[{$ref:"#/$defs/placement"}],properties:{id:{$ref:"#/$defs/id"},kind:{enum:["slab","pad","fence","vm","cloud","zone","platform","tunnel"]},label:{type:"string"},"label-style":{enum:["face","face-right","floor","none"]},ghost:{type:"boolean",description:"drawn as a dashed outline: not there yet, out of reach, or stopped"},role:{type:"string"},size:{$ref:"#/$defs/size2or3"},padding:{type:"number",minimum:0},height:{type:"number",exclusiveMinimum:0},z:{type:"number",description:"lift above the floor it stands on (tunnels)"},flow:{enum:["row","column"]},gate:{type:"object",additionalProperties:!1,required:["side"],properties:{side:{$ref:"#/$defs/side"},at:{type:"number",minimum:0,maximum:1,description:"centre of the gate along the wall, 0..1"},width:{type:"number",exclusiveMinimum:0},height:{type:"number",exclusiveMinimum:0},node:{$ref:"#/$defs/id"}}},around:{type:"array",items:{$ref:"#/$defs/id"},description:"tunnel: routes it wraps"},regions:{type:"array",items:{$ref:"#/$defs/region"}},motion:{$ref:"#/$defs/motion"},variants:{$ref:"#/$defs/variants"},nodes:{type:"array",items:{$ref:"#/$defs/node"}}}},deco:{anyOf:[{enum:["envelope","bubble","file-lines","ghost","terminal"]},{type:"object",additionalProperties:!1,minProperties:1,maxProperties:1,properties:{terminal:{type:"integer",minimum:1,maximum:8},icon:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"an icon the host registers (none by default); one nothing registers is drawn as a placeholder, with a warning"},screen:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"terminal, chat, desktop, tiles, or a face the host registers"}}}]},node:{type:"object",required:["id"],unevaluatedProperties:!1,allOf:[{$ref:"#/$defs/placement"}],properties:{id:{$ref:"#/$defs/id"},asset:{type:"string",description:"asset name from the library; default 'block'"},role:{type:"string",description:"colour role"},label:{type:"string"},sub:{type:"string"},size:{$ref:"#/$defs/size2or3"},z:{type:"number",description:"lift above the floor it stands on"},deco:{type:"array",items:{$ref:"#/$defs/deco"}},ghost:{type:"boolean"},face:{type:"string",pattern:"^[a-z][a-z0-9-]*$",description:"screen asset: what the screen shows: terminal, chat, desktop, tiles, or a face the host registers"},facing:{type:"number",description:"screen asset: rotation in degrees"},"label-at":{type:"object",additionalProperties:!1,properties:{side:{enum:["above","right","left","below"]},dx:{type:"number"},dy:{type:"number"}}},motion:{$ref:"#/$defs/motion"},variants:{$ref:"#/$defs/variants"},nodes:{type:"array",items:{$ref:"#/$defs/node"},description:"nodes standing on top of this one"}}},endpoint:{type:"string",pattern:"^[A-Za-z][A-Za-z0-9_-]*(\\.(n|e|s|w|top))?$"},route:{type:"object",required:["id","from","to"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},from:{$ref:"#/$defs/endpoint"},to:{$ref:"#/$defs/endpoint"},kind:{type:"string"},via:{type:"array",items:{anyOf:[{$ref:"#/$defs/point2"},{$ref:"#/$defs/endpoint"}]}},points:{type:"array",items:{type:"array",items:{type:"number"},minItems:2,maxItems:3},description:"exact polyline in grid units; skips the router"},lane:{type:"number"},arrow:{type:"boolean"},cross:{type:"boolean",description:"the route may pass through fence walls (it crosses a boundary)"},label:{anyOf:[{type:"string"},{type:"object",additionalProperties:!1,required:["text"],properties:{text:{type:"string"},along:{type:"integer",minimum:1},side:{enum:["left","right"]},at:{type:"array",items:{type:"number"},minItems:2,maxItems:3,description:"exact place [x, y] or [x, y, z]; skips placement"},dir:{enum:["x","y"]},anchor:{enum:["start","middle","end"]}}}]},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}},note:{type:"object",additionalProperties:!1,properties:{floor:{type:"string"},face:{type:"string"},label:{type:"string"},sub:{type:"string"},at:{anyOf:[{$ref:"#/$defs/point2"},{type:"array",items:{type:"number"},minItems:3,maxItems:3}]},on:{$ref:"#/$defs/id",description:"a node, region or route; a note on a route dims and lights with it"},kind:{type:"string"},dir:{enum:["x","y"]},anchor:{enum:["start","middle","end"]},dx:{type:"number"},dy:{type:"number"},appears:{$ref:"#/$defs/stepRef"},disappears:{$ref:"#/$defs/stepRef"}}},routeRef:{anyOf:[{type:"string"},{type:"object",minProperties:1,maxProperties:1,additionalProperties:{type:"string"}}]},phase:{anyOf:[{$ref:"#/$defs/routeRef"},{type:"array",items:{$ref:"#/$defs/routeRef"}}]},step:{type:"object",required:["heading"],additionalProperties:!1,properties:{id:{$ref:"#/$defs/id"},number:{type:"integer",minimum:1,description:"the number shown; defaults to the position"},kind:{type:"string"},heading:{type:"string"},caption:{type:"string"},command:{type:"string"},animate:{type:"array",items:{$ref:"#/$defs/phase"}},pulse:{type:"array",items:{$ref:"#/$defs/id"}},highlight:{type:"array",items:{$ref:"#/$defs/id"}},focus:{type:"array",items:{$ref:"#/$defs/id"},description:"nodes or regions to zoom to for this step; the view eases back on steps without focus"},show:{type:"array",items:{$ref:"#/$defs/id"}},hide:{type:"array",items:{$ref:"#/$defs/id"}},say:{type:"array",items:{type:"object",additionalProperties:!1,required:["at","text"],properties:{at:{anyOf:[{$ref:"#/$defs/id"},{type:"array",items:{type:"number"},minItems:2,maxItems:3}],description:"a node (the callout sits above it) or a grid point [x, y, z]"},text:{type:"string"},kind:{type:"string"},dx:{type:"number"},dy:{type:"number"},anchor:{enum:["start","middle","end"]}}}},mark:{type:"array",items:{type:"object",additionalProperties:!1,properties:{on:{$ref:"#/$defs/id"},at:{type:"array",items:{type:"number"},minItems:2,maxItems:3}}}},badge:{anyOf:[{type:"boolean"},{$ref:"#/$defs/id"},{type:"array",items:{type:"number"},minItems:2,maxItems:3}],description:"false, a route or node id, or a grid point [x, y, z]"},duration:{anyOf:[{const:"auto"},{type:"integer",minimum:500}]}}}}};function Ap(s,e){let r=s.length,n=e.length;if(!r)return n;if(!n)return r;let i=Array.from({length:r+1},(o,t)=>[t,...Array(n).fill(0)]);for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=r;o++)for(let t=1;t<=n;t++){let a=s[o-1]===e[t-1]?0:1;i[o][t]=Math.min(i[o-1][t]+1,i[o][t-1]+1,i[o-1][t-1]+a),o>1&&t>1&&s[o-1]===e[t-2]&&s[o-2]===e[t-1]&&(i[o][t]=Math.min(i[o][t],i[o-2][t-2]+1))}return i[r][n]}function Ye(s,e){let r,n=1/0,i=s.toLowerCase();for(let t of e){let a=Ap(i,t.toLowerCase());a<n&&(n=a,r=t)}if(r===void 0)return;let o=Math.max(1,Math.min(3,Math.floor(Math.max(s.length,r.length)/3)));return n<=o?r:void 0}var vi=[];function wo(s){vi.includes(s)||vi.push(s)}function Pi(s){for(let e of vi){let r=e(s);if(r!==void 0)return r}return s?"this item":"the file"}function on(s){return s===null?"nothing":Array.isArray(s)?"a list":typeof s=="object"?"a map":typeof s=="string"?`the text "${s}"`:`${typeof s} ${String(s)}`}var ko={string:"text",number:"a number",integer:"a whole number",boolean:"true or false",array:"a list",object:"a map"},ir=new Map;function xo(s,e){ir.set(s,e)}var Oi=new Map;function $o(s,e){Oi.set(s,(r,n)=>e(on(r),n))}var Ai=[];function So(s,e){Ai.some(([r])=>r===s)||Ai.push([s,e])}function Mp(s){let e=s.parentSchema,r=Object.keys(e?.properties??{});e?.$ref&&ir.has(e.$ref)&&r.push(...ir.get(e.$ref).filter(n=>!r.includes(n)));for(let n of e?.allOf??[])n.$ref&&ir.has(n.$ref)&&r.push(...ir.get(n.$ref));return r}function an(s,e){let r=s.propertyName??(s.keyword==="propertyNames"?s.params.propertyName:void 0);if(r!==void 0){let d=`${s.instancePath}/${r.replace(/~/g,"~0").replace(/\//g,"~1")}`,c=e.locate(d,{key:!0});return{severity:"error",message:`"${r}" can't be a name`,line:c.line,col:c.col,path:d,hint:"names are a lower-case letter, then lower-case letters, digits and -"}}let n=s.instancePath,i=s.message??"is not valid",o,t=e.locate(n),a=s.params;switch(s.keyword){case"required":i=`${Pi(n)} is missing "${a.missingProperty}"`;break;case"additionalProperties":case"unevaluatedProperties":{let c=String(a.additionalProperty??a.unevaluatedProperty),p=Mp(s),l=Ye(c,p);return i=`unknown key "${c}" in ${Pi(n)}`+(l?` (did you mean "${l}"?)`:""),!l&&p.length&&(o=`known keys: ${p.join(", ")}`),/\s/.test(c)&&(o='inside { \u2026 } a comma starts a new key: put text with commas in quotes, e.g. label: "read once, at launch"'),t=e.locate(`${n}/${c}`,{key:!0}),{severity:"error",message:i,line:t.line,col:t.col,path:`${n}/${c}`,hint:o}}case"enum":{let c=a.allowedValues.map(String),p=typeof s.data=="string"?Ye(s.data,c):void 0,l=n.split("/").pop();i=`${on(s.data)} is not a valid ${l&&!/^\d+$/.test(l)?`"${l}"`:"value"}`+(p?` (did you mean "${p}"?)`:""),o=`expected one of: ${c.join(", ")}`;break}case"const":i=Oi.has(n)?Oi.get(n)(s.data,a.allowedValue):`must be ${JSON.stringify(a.allowedValue)}`;break;case"type":i=`expected ${ko[String(a.type)]??a.type}, got ${on(s.data)}`;break;case"pattern":let d=Ai.find(([c])=>String(a.pattern).startsWith(c));d?{message:i,hint:o}=d[1](s.data):(i=`"${s.data}" is not a valid id`,o="ids start with a letter and use only letters, digits, - and _");break;case"minItems":case"maxItems":s.schema===2||s.parentSchema?.minItems===2?i=`expected a list of ${s.parentSchema.minItems===s.parentSchema.maxItems?s.parentSchema.minItems:`${s.parentSchema.minItems} to ${s.parentSchema.maxItems}`} numbers, got ${s.data.length}`:i=`list ${s.message}`;break;case"false schema":{let c=n.split("/").pop()??"",p=n.split("/").slice(0,-1).join("/");i=`"${c.replace(/~1/g,"/").replace(/~0/g,"~")}" can't be set on ${Pi(p)}`,t=e.locate(n,{key:!0});break}case"minimum":case"maximum":case"exclusiveMinimum":case"exclusiveMaximum":i=`${s.data} is out of range: ${s.message}`;break}return{severity:"error",message:i,line:t.line,col:t.col,path:n,hint:o}}function Po(s,e){let r=s.filter(t=>t.keyword==="anyOf"),n=new Set,i=[];for(let t of r){let a=t.schemaPath.replace(/\/anyOf$/,"/anyOf/"),d=s.filter(l=>l!==t&&l.schemaPath.startsWith(a)&&l.instancePath.startsWith(t.instancePath));if(d.forEach(l=>n.add(l)),n.add(t),r.some(l=>l!==t&&t.schemaPath.startsWith(l.schemaPath.replace(/\/anyOf$/,"/anyOf/"))&&l.instancePath===t.instancePath))continue;let c=d.filter(l=>l.instancePath.length>t.instancePath.length&&l.keyword!=="anyOf"),p=d.find(l=>l.keyword==="enum"&&l.instancePath===t.instancePath&&typeof t.data=="string");if(p)i.push(an(p,e));else if(c.length)i.push(...c.map(l=>an(l,e)));else{let l=d.filter(f=>f.instancePath===t.instancePath&&f.keyword!=="type"&&f.keyword!=="anyOf");if(l.length&&typeof t.data=="object"&&t.data!==null)i.push(...l.map(f=>an(f,e)));else{let f=[...new Set(d.filter(h=>h.keyword==="type").map(h=>ko[String(h.params.type)]??""))].filter(Boolean),m=e.locate(t.instancePath);i.push({severity:"error",message:`${on(t.data)} is not allowed here`+(f.length?`; expected ${f.join(" or ")}`:""),line:m.line,col:m.col,path:t.instancePath})}}}for(let t of s)n.has(t)||i.push(an(t,e));let o=new Set;return i.filter(t=>{let a=`${t.path}|${t.message}`;return o.has(a)?!1:(o.add(a),!0)}).sort((t,a)=>t.line-a.line||t.col-a.col)}var vo=$i(Si),Np=Object.keys(Si.$defs.placement.properties);xo("#/$defs/placement",Np);$o("/isodiag",s=>`"isodiag" must be 1 (the format version), got ${s}`);var zp={scene:"a scene",region:"a region",node:"a node",route:"a route",note:"a note",step:"a step"};wo(s=>{let e=/\/(scenes|regions|nodes|routes|notes|steps)\/\d+$/.exec(s);return e?zp[e[1].replace(/s$/,"")]??"this item":void 0});So("^[A-Za-z][A-Za-z0-9_-]*(",s=>({message:`"${s}" is not a node reference`,hint:"write an id, optionally with a side: worker, worker.e (sides: n, e, s, w, top)"}));function Oo(s){return s.data==null||typeof s.data!="object"||Array.isArray(s.data)?[{severity:"error",message:'the file must be a YAML map with "isodiag: 1" and "scenes:"',line:1,col:1,path:""}]:vo(s.data)?[]:Po(vo.errors??[],s)}var nt=(s,e)=>e!==void 0&&Object.hasOwn(s.regions,e)?s.regions[e]:void 0,ar=(s,e)=>s.nodes[e??s.defaultNode],ms=(s,e)=>ar(s,e)??s.nodes[s.defaultNode],Ao=s=>Object.values(s.regions).find(e=>e.shape==="walled")?.z[1]??.8,Mo=s=>Object.values(s.regions).map(e=>e.css??"").join("");var ss=.16,Mi=["right-of","left-of","below","behind"];function pn(s,e,r,n,i,o={},t){let a=[],d=(v,O,S,N=!1,I="error")=>{let L=r.locate(v,{key:N});a.push({severity:I,message:O,line:L.line,col:L.col,path:v,hint:S})},c=[],p=new Map,l=[],f=new Map,m=new Set([...Object.keys(n.roles),...Object.keys(o)]);function h(v,O){let S=p.get(v.id);if(S){let N=r.locate(S.path+"/id");return d(v.path+"/id",`duplicate id "${v.id}" (first used on line ${N.line})`),!1}return p.set(v.id,v),c.push(v),v.parent=O,O?O.children.push(v):l.push(v),!0}let y=()=>({x0:0,y0:0,z0:0,x1:0,y1:0,z1:0});function g(v,O,S){let N={id:v.id,type:"node",path:O,children:[],box:y(),floor:0,node:v,appears:v.appears,disappears:v.disappears};h(N,S)&&(v.nodes??[]).forEach((I,L)=>g(I,`${O}/nodes/${L}`,N))}function k(v,O,S){let N={id:v.id,type:"region",path:O,children:[],box:y(),floor:0,region:v,appears:v.appears,disappears:v.disappears};h(N,S)&&((v.nodes??[]).forEach((I,L)=>g(I,`${O}/nodes/${L}`,N)),(v.regions??[]).forEach((I,L)=>k(I,`${O}/regions/${L}`,N)))}(s.regions??[]).forEach((v,O)=>k(v,`${e}/regions/${O}`,void 0)),(s.nodes??[]).forEach((v,O)=>g(v,`${e}/nodes/${O}`,void 0));let u=()=>p.keys(),b=()=>c.filter(v=>v.type==="region").map(v=>v.id);for(let v of[...c]){let O=v.node??v.region;if(O.in!==void 0){let N=p.get(O.in);if(!N){d(v.path+"/in",`unknown region "${O.in}"`+or(O.in,b()));continue}if(N.type!=="region"){d(v.path+"/in",`"${O.in}" is a node, not a region; put nodes on a node with its own "nodes:" list`);continue}if(v.parent&&v.parent!==N){d(v.path+"/in",`"${v.id}" is written inside "${v.parent.id}" but says in: ${O.in}; use one or the other`);continue}for(let I=N;I;I=I.parent)if(I===v){d(v.path+"/in",`"${v.id}" cannot be inside itself`);continue}v.parent||(l.splice(l.indexOf(v),1),v.parent=N,N.children.push(v))}if(v.node){let N=v.node.asset;N!==void 0&&!ar(i,N)&&d(v.path+"/asset",`unknown asset "${N}"`+or(N,Object.keys(i.nodes)),`assets: ${Object.keys(i.nodes).join(", ")}`)}let S=(v.node??v.region).role;S!==void 0&&!m.has(S)&&d(v.path+"/role",`unknown colour role "${S}"`+or(S,m),`add it under "roles:" at the top of the file, or use one of: ${[...m].join(", ")}`)}for(let v of c){let O=v.region?.gate;if(!O?.node)continue;let S=p.get(O.node);if(!S){d(v.path+"/gate/node",`unknown node "${O.node}"`+or(O.node,u()));continue}if(S.type!=="node"){d(v.path+"/gate/node",`"${O.node}" is a region; a gate is a node`);continue}S.placedBy=v.id;let N=S.node;(N.at||Mi.some(I=>N[I]))&&d(S.path,`"${S.id}" is the gate of "${v.id}", which places it; its own placement is ignored`,void 0,!1,"warning")}let x=v=>v.gap??s.gap??2;function $(v){let O=v.node,S=ms(i,O.asset),N=O.size,I=S.size[0],L=S.size[1],X=S.size[2];if(N&&(I=N[0],L=N[1],N.length>2&&(X=N[2])),v.placedBy){let j=p.get(v.placedBy).region,A=j.gate,R=A.width??2,C=N?Math.min(I,L):.3;X=N&&N.length>2?X:A.height??(j.height??Ao(i))+.3,A.side==="e"||A.side==="w"?(I=C,L=R):(I=R,L=C)}return[I,L,X]}function P(v,O,S,N,I){for(let q of O)M(q);let L=O.filter(q=>!q.placedBy),X=new Set(L),j=new Set,A=[],R=new Set,C=q=>{let Q=q.node??q.region,Ae=[];for(let Me of Mi){let Ue=Q[Me];if(Ue===void 0)continue;let mt=p.get(Ue);if(!mt){d(`${q.path}/${Me}`,`unknown id "${Ue}"`+or(Ue,u()));continue}if(mt===q){d(`${q.path}/${Me}`,`"${q.id}" cannot be placed ${Me} itself`);continue}if(!X.has(mt)){let Ds=us=>us.parent?`"${us.parent.id}"`:"the scene";d(`${q.path}/${Me}`,`"${Ue}" is in ${Ds(mt)} but "${q.id}" is in ${Ds(q)}; relative placement works between items in the same region`,mt.placedBy?`"${Ue}" is a gate, placed by its ${p.get(mt.placedBy)?.region?.kind??"region"}`:`place "${q.id}" relative to something in ${Ds(q)}, or use "at:"`);continue}Ae.push(mt)}if(!Ae.length&&!Q.at){let Me=L.indexOf(q);Me>0&&Ae.push(L[Me-1])}return Ae},K=q=>{if(!j.has(q)){if(R.has(q)){d(q.path,`placement loop: "${q.id}" is placed relative to something placed relative to it`);return}R.add(q),C(q).forEach(K),R.delete(q),j.add(q),A.push(q)}};L.forEach(K);for(let q of A){let Q=q.node??q.region,Ae=f.get(q),Me=Mi.find(Ue=>Q[Ue]!==void 0&&p.get(Q[Ue])&&X.has(p.get(Q[Ue])));if(Q.at&&Me&&d(`${q.path}/at`,`"${q.id}" has both "at" and "${Me}"; "at" wins`,void 0,!0,"warning"),Q.at)Ae.x=Q.at[0],Ae.y=Q.at[1];else if(Me)T(Ae,f.get(p.get(Q[Me])),Me,x(Q),Q.align??"center");else{let Ue=L.indexOf(q);Ue>0?T(Ae,f.get(L[Ue-1]),N==="row"?"right-of":"below",x(Q),"center"):(Ae.x=S,Ae.y=S)}Q.shift&&(Ae.x+=Q.shift[0],Ae.y+=Q.shift[1])}if(I||!L.length)return{w:0,d:0};let W=1/0,ae=1/0,ee=-1/0,G=-1/0;for(let q of L){let Q=f.get(q);W=Math.min(W,Q.x),ae=Math.min(ae,Q.y),ee=Math.max(ee,Q.x+Q.w),G=Math.max(G,Q.y+Q.d)}let fe=Math.min(0,W-S),le=Math.min(0,ae-S);if(fe||le)for(let q of L){let Q=f.get(q);Q.x-=fe,Q.y-=le}return{w:ee-fe+S,d:G-le+S}}function T(v,O,S,N,I){let L=()=>{v.y=I==="start"?O.y:I==="end"?O.y+O.d-v.d:O.y+(O.d-v.d)/2},X=()=>{v.x=I==="start"?O.x:I==="end"?O.x+O.w-v.w:O.x+(O.w-v.w)/2};S==="right-of"?(v.x=O.x+O.w+N,L()):S==="left-of"?(v.x=O.x-N-v.w,L()):S==="below"?(v.y=O.y+O.d+N,X()):(v.y=O.y-N-v.d,X())}function M(v){if(v.type==="node"){let[A,R,C]=$(v);f.set(v,{x:0,y:0,w:A,d:R,h:C,z:v.node.z??0}),v.children.length&&P(v,v.children,0,"row",!0);return}let O=v.region,S=O.padding??nt(i,O.kind)?.pad,N=!!O.size,I=P(v,v.children,S,O.flow??"row",N),L=O.size?O.size[0]:Math.max(I.w,S*2+.5),X=O.size?O.size[1]:Math.max(I.d,S*2+.5);if(!O.size&&O.gate){let A=(O.gate.width??2)+1;O.gate.side==="e"||O.gate.side==="w"?X=Math.max(X,A):L=Math.max(L,A)}let j=O.size&&O.size.length>2?O.size[2]:O.height??nt(i,O.kind).z[1];f.set(v,{x:0,y:0,w:L,d:X,h:j,z:0})}P(void 0,l,0,s.flow??"row",!0);function B(v,O,S,N){let I=f.get(v),L=O+I.x,X=S+I.y;if(v.type==="region"){let j=nt(i,v.region.kind),[A]=j.z,R=j.floor,C=j.shape==="slab"&&nt(i,v.parent?.region?.kind)?.shape==="slab"?0:A,K=v.region.z??0,W=N+C+K,ae=N+I.h+K;v.box={x0:L,y0:X,z0:W,x1:L+I.w,y1:X+I.d,z1:ae},v.floor=R?ae:N}else{let j=N+I.z;v.box={x0:L,y0:X,z0:j,x1:L+I.w,y1:X+I.d,z1:j+I.h},v.floor=v.box.z1}for(let j of v.children)j.placedBy||B(j,L,X,v.floor)}for(let v of l)v.placedBy||B(v,0,0,0);if(t){let v=S=>Math.round(S/t)*t,O=S=>Math.round(S*1e9)/1e9;for(let S of c){if(S.placedBy)continue;let N=S.box,I=v(N.x0),L=v(N.x1),X=v(N.y0),j=v(N.y1);L-I<t&&(L=I+t),j-X<t&&(j=X+t),S.box={...N,x0:O(I),x1:O(L),y0:O(X),y1:O(j)};let A=S.node??S.region;A.at&&A.at.forEach((R,C)=>{let K=R/t;Math.abs(K-Math.round(K))>1e-6&&d(`${S.path}/at/${C}`,`${R} is not on the ${t} grid; it is drawn at ${O(v(R))}`,void 0,!1,"warning")})}}for(let v of c){let O=v.region?.gate;if(!O?.node)continue;let S=p.get(O.node);!S||S.placedBy!==v.id||(S.box=Ni(v,f.get(S).h,f.get(S).w,f.get(S).d),S.floor=S.box.z1)}for(let v of c){let O=v.children.filter(S=>!S.placedBy);for(let S=0;S<O.length;S++)for(let N=S+1;N<O.length;N++){let I=O[S],L=O[N];ln(I,i)||ln(L,i)||No(I.box,L.box)&&d(L.path,`"${L.id}" overlaps "${I.id}"`,'move one with "at", a relative placement, "gap" or "shift"',!1,"warning")}if(v.parent&&v.parent.type==="region"&&!v.placedBy){let S=v.parent.box,N=v.box,I=1e-6;(N.x0<S.x0-I||N.y0<S.y0-I||N.x1>S.x1+I||N.y1>S.y1+I)&&d(v.path,`"${v.id}" sticks out of region "${v.parent.id}"`,`make "${v.parent.id}" bigger, or leave out its "size" so it fits its contents`,!1,"warning")}}{let v=l.filter(O=>!O.placedBy);for(let O=0;O<v.length;O++)for(let S=O+1;S<v.length;S++){let N=v[O],I=v[S];No(N.box,I.box)&&!ln(N,i)&&!ln(I,i)&&d(I.path,`"${I.id}" overlaps "${N.id}"`,'move one with "at", a relative placement, "gap" or "shift"',!1,"warning")}}let E=new Set,D=a.filter(v=>{let O=v.path+v.message;return E.has(O)?!1:(E.add(O),!0)});return{items:c,byId:p,roots:l,diags:D,catalog:i}}var ln=(s,e)=>s.type==="region"&&["zone","tunnel"].includes(nt(e,s.region.kind)?.shape??"");function Ni(s,e,r,n){let i=s.region.gate,o=s.box,t=s.box.z0,a=i.at??.5,d=i.width??2;if(i.side==="w"||i.side==="e"){let l=i.side==="w"?o.x0+ss/2:o.x1-ss/2,f=o.y0+(o.y1-o.y0)*a;return{x0:l-r/2,x1:l+r/2,y0:f-d/2,y1:f+d/2,z0:t,z1:t+e}}let c=i.side==="n"?o.y0+ss/2:o.y1-ss/2,p=o.x0+(o.x1-o.x0)*a;return{x0:p-d/2,x1:p+d/2,y0:c-n/2,y1:c+n/2,z0:t,z1:t+e}}function No(s,e,r=1e-6){return s.x0<e.x1-r&&e.x0<s.x1-r&&s.y0<e.y1-r&&e.y0<s.y1-r}function or(s,e){let r=Ye(s,e);return r?` (did you mean "${r}"?)`:""}function cn(s){let e=yi(s);for(let r of["light","dark","kinds","roles"])if(!e||typeof e[r]!="object")throw new Error(`theme: missing "${r}"`);return e}function Es(s,e={},r={}){let n={...s.kinds};for(let[i,o]of Object.entries(r)){let t=n[o.like??i]??n.control;n[i]={color:o.color??t.color,dash:o.dash??t.dash,legend:o.legend??t.legend}}return{...s,roles:{...s.roles,...e},kinds:n}}var zo=s=>Object.entries(s).map(([e,r])=>`--${e}:${r}`).join(";");function Ts(s,e){return e in s.light?`var(--${e})`:e}function Io(s){let e="";for(let[r,n]of Object.entries(s.roles))e+=`.k-${r}{--h:${n.h};--s:${n.s}%}`,n.top?e+=`.k-${r} .top{fill:${n.top}}`:n.tint&&(e+=`.k-${r} .top{fill:color-mix(in srgb,hsl(${n.h} ${Math.min(100,n.s+15)}% 50%) ${n.tint}%,var(--pad-top))}`),e+=`
231
+ `;for(let[r,n]of Object.entries(s.kinds)){let i=Ts(s,n.color),o=n.dash==="dashed"?";stroke-dasharray:7 6;stroke-width:2.4":n.dash==="dotted"?";stroke-dasharray:3 6;stroke-width:2.4":"";e+=`.f-${r}{stroke:${i}${o}} .t-${r}{fill:${i}} .c-${r}{--c:${i}}
232
+ `}return{light:zo(s.light),dark:zo(s.dark),rest:e}}var Eo={sans700_13:{"0":.6787,"1":.5059,"2":.6372,"3":.6631,"4":.6812,"5":.6577,"6":.6777,"7":.6172,"8":.688,"9":.6777," ":.252,"!":.3506,'"':.563,"#":.6655,$:.6655,"%":1.0298,"&":.7388,"'":.3418,"(":.4229,")":.4229,"*":.4785,"+":.6655,",":.3418,"-":.4785,".":.3418,"/":.3286,":":.3418,";":.3418,"<":.6655,"=":.6655,">":.6655,"?":.5513,"@":.9214,A:.7266,B:.6875,C:.7354,D:.7417,E:.6162,F:.5918,G:.7544,H:.7773,I:.3125,J:.5952,K:.7036,L:.5889,M:.9009,N:.7622,O:.7808,P:.668,Q:.7808,R:.6885,S:.6694,T:.6543,U:.7544,V:.7153,W:1.0034,X:.7236,Y:.7021,Z:.6699,"[":.4229,"\\":.3286,"]":.4229,"^":.6655,_:.5845,"`":.4941,a:.584,b:.6455,c:.5815,d:.6455,e:.5952,f:.407,g:.6396,h:.6265,i:.2813,j:.2813,k:.5957,l:.2891,m:.9263,n:.6216,o:.6138,p:.6411,q:.6416,r:.4338,s:.5513,t:.4114,u:.6216,v:.5771,w:.8413,x:.5747,y:.5913,z:.5605,"{":.4229,"|":.2935,"}":.4229,"~":.6655,"\xB7":.3418,"\u2192":.9375,"\u2190":.9375,"\u2191":.8096,"\u2193":.8096,"\u2019":.3418,"\u2018":.3418,"\u201C":.5474,"\u201D":.5474,"\u2026":.9482,"\u2013":.6216,"\u2014":.9045,"\u2715":.7622,"\xD7":.6655,"\u2248":.6655,"\u2264":.6655,"\u2265":.6655,\u00E9:.5952},sans800_15:{"0":.687,"1":.5122,"2":.6406,"3":.6675,"4":.686,"5":.6626,"6":.6836,"7":.6191,"8":.6968,"9":.6836," ":.2344,"!":.3555,'"':.5835,"#":.6694,$:.6694,"%":1.0566,"&":.7397,"'":.3491,"(":.4287,")":.4287,"*":.4731,"+":.6694,",":.3491,"-":.4731,".":.3491,"/":.3286,":":.3491,";":.3491,"<":.6694,"=":.6694,">":.6694,"?":.5562,"@":.9146,A:.7363,B:.6899,C:.7339,D:.7388,E:.6147,F:.5903,G:.749,H:.7813,I:.3198,J:.6064,K:.7104,L:.5879,M:.9019,N:.7612,O:.7759,P:.6709,Q:.7759,R:.6924,S:.6719,T:.6533,U:.7524,V:.7212,W:1.0073,X:.731,Y:.71,Z:.6646,"[":.4287,"\\":.3286,"]":.4287,"^":.6694,_:.5889,"`":.4844,a:.5864,b:.6479,c:.5811,d:.6479,e:.5952,f:.4139,g:.6416,h:.6309,i:.2847,j:.2847,k:.605,l:.2935,m:.937,n:.626,o:.6138,p:.6436,q:.6445,r:.4406,s:.5557,t:.4198,u:.626,v:.5806,w:.856,x:.5835,y:.5996,z:.5601,"{":.4287,"|":.2974,"}":.4287,"~":.6694,"\xB7":.3491,"\u2192":.9404,"\u2190":.9404,"\u2191":.811,"\u2193":.811,"\u2019":.3491,"\u2018":.3491,"\u201C":.5688,"\u201D":.5688,"\u2026":.9883,"\u2013":.626,"\u2014":.9118,"\u2715":.7622,"\xD7":.6694,"\u2248":.6694,"\u2264":.6694,"\u2265":.6694,\u00E9:.5952},sans800_10_5:{"0":.7114,"1":.5366,"2":.665,"3":.6919,"4":.7104,"5":.687,"6":.708,"7":.6436,"8":.7212,"9":.708," ":.2588,"!":.3799,'"':.6079,"#":.6938,$:.6938,"%":1.0811,"&":.7642,"'":.3735,"(":.4531,")":.4531,"*":.4976,"+":.6938,",":.3735,"-":.4976,".":.3735,"/":.353,":":.3735,";":.3735,"<":.6938,"=":.6938,">":.6938,"?":.5806,"@":.939,A:.7607,B:.7144,C:.7583,D:.7632,E:.6392,F:.6147,G:.7734,H:.8057,I:.3442,J:.6309,K:.7349,L:.6123,M:.9263,N:.7856,O:.8003,P:.6953,Q:.8003,R:.7168,S:.6963,T:.6777,U:.7769,V:.7456,W:1.0317,X:.7554,Y:.7344,Z:.689,"[":.4531,"\\":.353,"]":.4531,"^":.6938,_:.6133,"`":.5088,a:.6108,b:.6724,c:.6055,d:.6724,e:.6196,f:.4383,g:.666,h:.6553,i:.3091,j:.3091,k:.6294,l:.3179,m:.9614,n:.6504,o:.6382,p:.668,q:.6689,r:.465,s:.5801,t:.4442,u:.6504,v:.605,w:.8804,x:.6079,y:.624,z:.5845,"{":.4531,"|":.3218,"}":.4531,"~":.6938,"\xB7":.3735,"\u2192":.9648,"\u2190":.9648,"\u2191":.8354,"\u2193":.8354,"\u2019":.3735,"\u2018":.3735,"\u201C":.5933,"\u201D":.5933,"\u2026":1.0127,"\u2013":.6504,"\u2014":.9204,"\u2715":.7622,"\xD7":.6938,"\u2248":.6938,"\u2264":.6938,"\u2265":.6938,\u00E9:.6196},sans600_12:{"0":.6665,"1":.4956,"2":.6299,"3":.6548,"4":.6724,"5":.6484,"6":.668,"7":.6113,"8":.6753,"9":.668," ":.2656,"!":.3413,'"':.5386,"#":.6577,$:.6577,"%":.999,"&":.7334,"'":.3306,"(":.4131,")":.4131,"*":.48,"+":.6577,",":.3306,"-":.48,".":.3306,"/":.3247,":":.3306,";":.3306,"<":.6577,"=":.6577,">":.6577,"?":.5425,"@":.9238,A:.7129,B:.6812,C:.7329,D:.7402,E:.6133,F:.5889,G:.7559,H:.7695,I:.3013,J:.5801,K:.6924,L:.5859,M:.8955,N:.7593,O:.7813,P:.6606,Q:.7813,R:.6807,S:.6626,T:.6514,U:.7524,V:.7056,W:.9956,X:.7124,Y:.6904,Z:.6709,"[":.4131,"\\":.3247,"]":.4131,"^":.6577,_:.5757,"`":.5,a:.5771,b:.6392,c:.5781,d:.6392,e:.5908,f:.3957,g:.6333,h:.6177,i:.2739,j:.2734,k:.582,l:.2808,m:.9116,n:.6128,o:.6099,p:.6348,q:.6348,r:.4232,s:.543,t:.3991,u:.6128,v:.5693,w:.8228,x:.562,y:.5791,z:.5571,"{":.4131,"|":.2856,"}":.4131,"~":.6577,"\xB7":.3306,"\u2192":.9307,"\u2190":.9307,"\u2191":.8037,"\u2193":.8037,"\u2019":.3306,"\u2018":.3306,"\u201C":.522,"\u201D":.522,"\u2026":.9043,"\u2013":.6128,"\u2014":.8957,"\u2715":.7622,"\xD7":.6577,"\u2248":.6577,"\u2264":.6577,"\u2265":.6577,\u00E9:.5908},sans800_12:{"0":.7026,"1":.5278,"2":.6563,"3":.6831,"4":.7017,"5":.6782,"6":.6992,"7":.6348,"8":.7124,"9":.6992," ":.25,"!":.3711,'"':.5991,"#":.6851,$:.6851,"%":1.0723,"&":.7554,"'":.3647,"(":.4443,")":.4443,"*":.4888,"+":.6851,",":.3647,"-":.4888,".":.3647,"/":.3442,":":.3647,";":.3647,"<":.6851,"=":.6851,">":.6851,"?":.5718,"@":.9302,A:.752,B:.7056,C:.7495,D:.7544,E:.6304,F:.606,G:.7646,H:.7969,I:.3354,J:.6221,K:.7261,L:.6035,M:.9175,N:.7769,O:.7915,P:.6865,Q:.7915,R:.708,S:.6875,T:.6689,U:.7681,V:.7368,W:1.0229,X:.7466,Y:.7256,Z:.6802,"[":.4443,"\\":.3442,"]":.4443,"^":.6851,_:.6045,"`":.5,a:.6021,b:.6636,c:.5967,d:.6636,e:.6108,f:.4295,g:.6572,h:.6465,i:.3003,j:.3003,k:.6206,l:.3091,m:.9526,n:.6416,o:.6294,p:.6592,q:.6602,r:.4562,s:.5713,t:.4354,u:.6416,v:.5962,w:.8716,x:.5991,y:.6152,z:.5757,"{":.4443,"|":.313,"}":.4443,"~":.6851,"\xB7":.3647,"\u2192":.9561,"\u2190":.9561,"\u2191":.8267,"\u2193":.8267,"\u2019":.3647,"\u2018":.3647,"\u201C":.5845,"\u201D":.5845,"\u2026":1.0039,"\u2013":.6416,"\u2014":.9173,"\u2715":.7622,"\xD7":.6851,"\u2248":.6851,"\u2264":.6851,"\u2265":.6851,\u00E9:.6108},sans800_11_5:{"0":.7056,"1":.5308,"2":.6592,"3":.686,"4":.7046,"5":.6812,"6":.7021,"7":.6377,"8":.7153,"9":.7021," ":.2529,"!":.374,'"':.6021,"#":.688,$:.688,"%":1.0752,"&":.7583,"'":.3677,"(":.4473,")":.4473,"*":.4917,"+":.688,",":.3677,"-":.4917,".":.3677,"/":.3472,":":.3677,";":.3677,"<":.688,"=":.688,">":.688,"?":.5747,"@":.9331,A:.7549,B:.7085,C:.7524,D:.7573,E:.6333,F:.6089,G:.7676,H:.7998,I:.3384,J:.625,K:.729,L:.6064,M:.9204,N:.7798,O:.7944,P:.6895,Q:.7944,R:.7109,S:.6904,T:.6719,U:.771,V:.7397,W:1.0259,X:.7495,Y:.7285,Z:.6831,"[":.4473,"\\":.3472,"]":.4473,"^":.688,_:.6074,"`":.5029,a:.605,b:.6665,c:.5996,d:.6665,e:.6138,f:.4325,g:.6602,h:.6494,i:.3032,j:.3032,k:.6235,l:.312,m:.9556,n:.6445,o:.6323,p:.6621,q:.6631,r:.4591,s:.5742,t:.4383,u:.6445,v:.5991,w:.8745,x:.6021,y:.6182,z:.5786,"{":.4473,"|":.3159,"}":.4473,"~":.688,"\xB7":.3677,"\u2192":.959,"\u2190":.959,"\u2191":.8296,"\u2193":.8296,"\u2019":.3677,"\u2018":.3677,"\u201C":.5874,"\u201D":.5874,"\u2026":1.0068,"\u2013":.6445,"\u2014":.9183,"\u2715":.7622,"\xD7":.688,"\u2248":.688,"\u2264":.688,"\u2265":.688,\u00E9:.6138},sans400_13:{"0":.624,"1":.458,"2":.5977,"3":.6211,"4":.6377,"5":.6123,"6":.6309,"7":.582,"8":.6328,"9":.6309," ":.2754,"!":.3052,'"':.4717,"#":.624,$:.624,"%":.9194,"&":.7056,"'":.291,"(":.376,")":.376,"*":.4658,"+":.624,",":.291,"-":.4658,".":.291,"/":.2988,":":.291,";":.291,"<":.624,"=":.624,">":.624,"?":.5068,"@":.9121,A:.668,B:.6514,C:.71,D:.7207,E:.5898,F:.5664,G:.7407,H:.7363,I:.2617,J:.5322,K:.6528,L:.562,M:.8682,N:.7363,O:.7656,P:.6294,Q:.7656,R:.6475,S:.6313,T:.6279,U:.7314,V:.668,W:.9619,X:.6729,Y:.6494,Z:.6558,"[":.376,"\\":.2988,"]":.376,"^":.624,_:.5405,"`":.4941,a:.5459,b:.6084,c:.5537,d:.6084,e:.5654,f:.356,g:.6035,h:.5825,i:.2412,j:.2407,k:.5371,l:.2471,m:.8643,n:.5776,o:.585,p:.6045,q:.6035,r:.3843,s:.5083,t:.3574,u:.5776,v:.5361,w:.7686,x:.5186,y:.5371,z:.5332,"{":.376,"|":.2529,"}":.376,"~":.624,"\xB7":.291,"\u2192":.8999,"\u2190":.8999,"\u2191":.7754,"\u2193":.7754,"\u2019":.291,"\u2018":.291,"\u201C":.4531,"\u201D":.4531,"\u2026":.7988,"\u2013":.5776,"\u2014":.872,"\u2715":.7622,"\xD7":.624,"\u2248":.624,"\u2264":.624,"\u2265":.624,\u00E9:.5654},mono400_11:{"0":.6021,"1":.6021,"2":.6021,"3":.6021,"4":.6021,"5":.6021,"6":.6021,"7":.6021,"8":.6021,"9":.6021," ":.6021,"!":.6021,'"':.6021,"#":.6021,$:.6021,"%":.6021,"&":.6021,"'":.6021,"(":.6021,")":.6021,"*":.6021,"+":.6021,",":.6021,"-":.6021,".":.6021,"/":.6021,":":.6021,";":.6021,"<":.6021,"=":.6021,">":.6021,"?":.6021,"@":.6021,A:.6021,B:.6021,C:.6021,D:.6021,E:.6021,F:.6021,G:.6021,H:.6021,I:.6021,J:.6021,K:.6021,L:.6021,M:.6021,N:.6021,O:.6021,P:.6021,Q:.6021,R:.6021,S:.6021,T:.6021,U:.6021,V:.6021,W:.6021,X:.6021,Y:.6021,Z:.6021,"[":.6021,"\\":.6021,"]":.6021,"^":.6021,_:.6021,"`":.6021,a:.6021,b:.6021,c:.6021,d:.6021,e:.6021,f:.6021,g:.6021,h:.6021,i:.6021,j:.6021,k:.6021,l:.6021,m:.6021,n:.6021,o:.6021,p:.6021,q:.6021,r:.6021,s:.6021,t:.6021,u:.6021,v:.6021,w:.6021,x:.6021,y:.6021,z:.6021,"{":.6021,"|":.6021,"}":.6021,"~":.6021,"\xB7":.6021,"\u2192":.6021,"\u2190":.6021,"\u2191":.6021,"\u2193":.6021,"\u2019":.6021,"\u2018":.6021,"\u201C":.6021,"\u201D":.6021,"\u2026":.6021,"\u2013":.6021,"\u2014":.6021,"\u2715":.6021,"\xD7":.6021,"\u2248":.6021,"\u2264":.6021,"\u2265":.6021,\u00E9:.6021},mono600_11:{"0":.6021,"1":.6021,"2":.6021,"3":.6021,"4":.6021,"5":.6021,"6":.6021,"7":.6021,"8":.6021,"9":.6021," ":.6021,"!":.6021,'"':.6021,"#":.6021,$:.6021,"%":.6021,"&":.6021,"'":.6021,"(":.6021,")":.6021,"*":.6021,"+":.6021,",":.6021,"-":.6021,".":.6021,"/":.6021,":":.6021,";":.6021,"<":.6021,"=":.6021,">":.6021,"?":.6021,"@":.6021,A:.6021,B:.6021,C:.6021,D:.6021,E:.6021,F:.6021,G:.6021,H:.6021,I:.6021,J:.6021,K:.6021,L:.6021,M:.6021,N:.6021,O:.6021,P:.6021,Q:.6021,R:.6021,S:.6021,T:.6021,U:.6021,V:.6021,W:.6021,X:.6021,Y:.6021,Z:.6021,"[":.6021,"\\":.6021,"]":.6021,"^":.6021,_:.6021,"`":.6021,a:.6021,b:.6021,c:.6021,d:.6021,e:.6021,f:.6021,g:.6021,h:.6021,i:.6021,j:.6021,k:.6021,l:.6021,m:.6021,n:.6021,o:.6021,p:.6021,q:.6021,r:.6021,s:.6021,t:.6021,u:.6021,v:.6021,w:.6021,x:.6021,y:.6021,z:.6021,"{":.6021,"|":.6021,"}":.6021,"~":.6021,"\xB7":.6021,"\u2192":.6021,"\u2190":.6021,"\u2191":.6021,"\u2193":.6021,"\u2019":.6021,"\u2018":.6021,"\u201C":.6021,"\u201D":.6021,"\u2026":.6021,"\u2013":.6021,"\u2014":.6021,"\u2715":.6021,"\xD7":.6021,"\u2248":.6021,"\u2264":.6021,"\u2265":.6021,\u00E9:.6021}};var Ve=34,it=Math.cos(Math.PI/6),re=(s,e,r=0)=>[(s-e)*it*Ve,(s+e)*.5*Ve-r*Ve],Ee=s=>{let e=Math.round(s*10)/10;return Object.is(e,-0)?"0":String(e)},pr=s=>`${Ee(s[0])},${Ee(s[1])}`,lr=s=>s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function ie(s,e={},r){let n="";for(let i in e){let o=e[i];o==null||o===!1||o===""||(n+=` ${i}="${lr(typeof o=="number"?Ee(o):o)}"`)}return r===void 0?`<${s}${n}/>`:`<${s}${n}>${r}</${s}>`}var Fe={lbl:{key:"sans700_13",size:13},sub:{key:"mono400_11",size:11},slabname:{key:"sans800_15",size:15,spacing:.12},sm:{key:"sans800_10_5",size:10.5,spacing:.1},floor:{key:"mono600_11",size:11,spacing:.01},say:{key:"sans600_12",size:12},tunname:{key:"sans800_12",size:12,spacing:.14},badge:{key:"sans800_11_5",size:11.5}},fn;function To(s,e){let r=fn;fn=s;try{return e()}finally{fn=r}}function rs(s,e){let r=fn?.widths[e.key]??Eo[e.key],n=e.key.startsWith("mono")?.6:.58,i=0;for(let o of s)i+=r[o]??n;return(i+(e.spacing??0)*[...s].length)*e.size}var zi=(s,e,r)=>[s[0]*e+s[2]*r+s[4],s[1]*e+s[3]*r+s[5]],Ii=s=>`matrix(${s.map(e=>Math.round(e*1e4)/1e4).join(" ")})`;function Ep(s,e){if(e==="left"){let[i,o]=re(s.x0,s.y1,s.z1);return{m:[it,.5,0,1,i,o],w:(s.x1-s.x0)*Ve,h:(s.z1-s.z0)*Ve}}if(e==="right"){let[i,o]=re(s.x1,s.y1,s.z1);return{m:[it,-.5,0,1,i,o],w:(s.y1-s.y0)*Ve,h:(s.z1-s.z0)*Ve}}let[r,n]=re(s.x0,s.y0,s.z1);return{m:[it,.5,-it,.5,r,n],w:(s.x1-s.x0)*Ve,h:(s.y1-s.y0)*Ve}}var Ei=class{x0=1/0;y0=1/0;x1=-1/0;y1=-1/0;add(e){e[0]<this.x0&&(this.x0=e[0]),e[0]>this.x1&&(this.x1=e[0]),e[1]<this.y0&&(this.y0=e[1]),e[1]>this.y1&&(this.y1=e[1])}addRect(e,r,n,i){this.add([e,r]),this.add([e+n,r+i])}get empty(){return this.x0===1/0}},mn=class{bounds=new Ei;texts=[];planes=[];planePolys=[];defs=new Map;poly(e,r,n={}){let i=e.map(o=>re(o[0],o[1],o[2]));return i.forEach(o=>this.bounds.add(o)),ie("polygon",{points:i.map(pr).join(" "),class:r,...n})}line3(e,r,n,i={}){let o=re(...e),t=re(...r);return this.bounds.add(o),this.bounds.add(t),ie("line",{x1:o[0],y1:o[1],x2:t[0],y2:t[1],class:n,...i})}blockFaces(e){let{x0:r,y0:n,x1:i,y1:o,z0:t,z1:a}=e;return this.poly([[r,o,t],[i,o,t],[i,o,a],[r,o,a]],"lft")+this.poly([[i,n,t],[i,o,t],[i,o,a],[i,n,a]],"rgt")+this.poly([[r,n,a],[i,n,a],[i,o,a],[r,o,a]],"top")}onFace(e,r,n,i){let o=Ep(e,r);for(let[t,a]of[[0,0],[o.w,0],[0,o.h],[o.w,o.h]])this.bounds.add(zi(o.m,t,a));return ie("g",{class:i,transform:Ii(o.m)},n(o.w,o.h))}onMatrix(e,r,n,i,o){for(let[t,a]of[[0,0],[r,0],[0,n],[r,n]])this.bounds.add(zi(e,t,a));return ie("g",{class:o,transform:Ii(e)},i(r,n))}text(e,r,n,i,o,t="middle",a={},d){let c=rs(n,o),l={x:t==="start"?e:t==="end"?e-c:e-c/2,y:r-o.size*.8,w:c,h:o.size*1.05,text:n,owner:d};return this.bounds.addRect(l.x-2,l.y-2,l.w+4,l.h+4),this.texts.push(l),ie("text",{x:e,y:r,class:i,"text-anchor":t==="start"?void 0:t,...a},lr(n))}planeText(e,r,n,i,o="start",t={}){let a=rs(r,i),d=o==="start"?0:o==="end"?-a:-a/2,c=[[d,-i.size*.8],[d+a,-i.size*.8],[d,i.size*.25],[d+a,i.size*.25]].map(([f,m])=>zi(e,f,m));c.forEach(f=>this.bounds.add(f));let p=c.map(f=>f[0]),l=c.map(f=>f[1]);return this.planePolys.push([c[0],c[1],c[3],c[2]]),this.planes.push({x:Math.min(...p),y:Math.min(...l),w:Math.max(...p)-Math.min(...p),h:Math.max(...l)-Math.min(...l)}),ie("text",{transform:Ii(e),class:n,"text-anchor":o==="start"?void 0:o,...t},lr(r))}floorText(e,r,n,i,o,t="x",a="start",d={}){let[c,p]=re(e,r,n),l=t==="x"?[it,.5,-it,.5,c,p]:[it,-.5,it,.5,c,p];return this.planeText(l,i,o,Fe.floor,a,d)}faceText(e,r,n,i,o,t,a="left",d="start",c={}){let[p,l]=re(e,r,n),f=a==="left"?[it,.5,0,1,p,l]:[it,-.5,0,1,p,l];return this.planeText(f,i,o,t,d,c)}def(e,r){this.defs.set(e,r)}},cr=s=>[(s.x0+s.x1)/2,(s.y0+s.y1)/2,s.z1];function Ti(s,e,r){let n="";for(let i=0;i<r;i++){let o=e.z1-(e.z1-e.z0)*(.28+i*.2),t=(e.x1-e.x0)*(i===r-1?.35:.62-i*.1);n+=s.line3([e.x0+.35,e.y1,o],[e.x0+.35+t,e.y1,o],"det")}return n}function jo(s,e){let n=e.z1,i=[e.x0+.55,e.y0+.55,n],o=[e.x1-.55,e.y0+.55,n],t=[e.x1-.55,e.y1-.55,n],a=[e.x0+.55,e.y1-.55,n],d=[(e.x0+e.x1)/2,(e.y0+e.y1)/2,n];return s.poly([i,o,t,a],"det")+s.line3(i,d,"det")+s.line3(d,o,"det")}function Ro(s,e){let n=e.z1,i=s.poly([[e.x0+.55,e.y0+.55,n],[e.x1-.55,e.y0+.55,n],[e.x1-.55,e.y1-.55,n],[e.x0+.55,e.y1-.55,n]],"det");for(let o=1;o<=2;o++){let t=e.y0+.55+(e.y1-e.y0-1.1)*o/3;i+=s.line3([e.x0+.55+.3,t,n],[e.x1-.55-.3-(o===2?.5:0),t,n],"det")}return i}function _o(s,e){let n=e.z1,i=(e.y0+e.y1)/2;return s.line3([e.x0+.3,i-.2,n],[e.x1-.3,i-.2,n],"det")+s.line3([e.x0+.3,i+.2,n],[e.x1-.3-.3,i+.2,n],"det")}function Co(s,e){let r=(e.x0+e.x1)/2,n=(e.y0+e.y1)/2,i=e.z1+.005,o=Math.min(e.x1-e.x0,e.y1-e.y0)*.16,t=[];for(let a=0;a<20;a++){let d=a/20*Math.PI*2;t.push([r-o*1.4+Math.cos(d)*o,n+Math.sin(d)*o,i])}return s.poly(t,"det")+s.line3([r-o*.4,n,i],[r+o*2.2,n,i],"det")+s.line3([r+o*1.7,n,i],[r+o*1.7,n+o*.8,i],"det")}function Lo(s,e){let r=(e.x0+e.x1)/2,n=(e.y0+e.y1)/2,i=e.z1+.005,o=Math.min(e.x1-e.x0,e.y1-e.y0)*.28,t=[];for(let a=0;a<24;a++){let d=a/24*Math.PI*2;t.push([r+Math.cos(d)*o,n+Math.sin(d)*o,i])}return s.poly(t,"det sock-hole")}var ds=(s,e,r,n,i,o=0)=>ie("rect",{class:s,x:e,y:r,width:n,height:i,rx:o||void 0}),ji={terminal(s,e){let r="",n=Math.max(2,Math.floor((e-12)/9));for(let i=0;i<n;i++){let o=10+i*9,t=(s-18)*[.7,.45,.6,.3,.55][i%5];r+=ie("line",{class:"ln",x1:8,y1:o,x2:8+t,y2:o})}return r},chat(s,e){return[[6,.62,"w"],[.3,.58,"m"],[6,.46,"w"],[.42,.5,"m"]].map((n,i)=>{let o=(s-14)*n[1],t=n[0]===6?7:s-7-o;return ds(n[2],t,8+i*(e-18)/4,o,(e-18)/4-4,3)}).join("")},desktop(s,e){return ds("wall",5,5,s-10,e-10,2)+ds("bar",5,5,s-10,6)+ds("win",s*.5,13,s*.38,e*.42,2)},tiles(s,e){let t=(s-12-5)/3,a=(e-12-2.5*1)/2,d="";for(let c=0;c<2;c++)for(let p=0;p<3;p++){let l=6+p*(t+2.5),f=6+c*(a+2.5);d+=ds("t",l,f,t,a,1.5),[.3,.52,.74].forEach((m,h)=>{d+=ie("line",{class:"ln",x1:l+2.5,y1:f+a*m,x2:l+2.5+(t-5)*[.8,.5,.65][(h+c+p)%3],y2:f+a*m})})}return d}};function Ri(s,e){let r=s/2,n=e/2,i=Math.min(s,e)*.22;return ds("unk",s*.2,e*.2,s*.6,e*.6,2)+ie("path",{class:"unk-q",d:`M${Ee(r-i*.5)},${Ee(n-i*.45)}a${Ee(i*.5)},${Ee(i*.5)} 0 1 1 ${Ee(i*.5)},${Ee(i*.55)}v${Ee(i*.3)}`})+ie("circle",{class:"unk-dot",cx:Ee(r),cy:Ee(n+i*.75),r:Ee(Math.max(.8,i*.1))})}function _i(s,e){return ds("glass",3,3,s-6,e-6,3)}var qo=Object.create(null),Tp=[];var Bo=()=>Tp.join(""),Ci=s=>Object.hasOwn(qo,s)?qo[s]:void 0,fr=s=>Object.hasOwn(ji,s)?ji[s]:void 0;function jp(s,e){let r=(e.x0+e.x1)/2,n=(e.y0+e.y1)/2,i=e.z1+.005,o=Math.min(.6,(e.x1-e.x0)*.24,(e.y1-e.y0)*.24),t=[[r-o,n-o,i],[r+o,n-o,i],[r+o,n+o,i],[r-o,n+o,i]];return s.poly(t,"ico-unknown")+s.line3([r-o*.3,n-o*.35,i],[r+o*.3,n-o*.35,i],"ico-unknown-q")+s.line3([r+o*.3,n-o*.35,i],[r,n+o*.1,i],"ico-unknown-q")+s.line3([r,n+o*.45,i],[r,n+o*.5,i],"ico-unknown-q")}function Rp(s,e,r){let n="";for(let i of r??[])i==="terminal"?n+=Ti(s,e,3):i==="envelope"?n+=jo(s,e):i==="bubble"?n+=Ro(s,e):i==="file-lines"?n+=_o(s,e):typeof i=="object"&&(i.terminal&&(n+=Ti(s,e,i.terminal)),i.icon&&(n+=(Ci(i.icon)??jp)(s,e)));return n}var _p=(s,e)=>(s.deco??e.deco??[]).filter(r=>r!=="ghost");function lt(s,e,r,n,i,o){let t={name:s,description:e,size:r,role:n,deco:i,draw:(a,d,c)=>a.blockFaces(d)+Rp(a,d,_p(c,t))+(o?o(a,d):"")};return t}function Li(s){let[e,r]=cr(s);return{x0:e-.75,y0:r-.75,x1:e+.75,y1:r+.75,z0:s.z0,z1:s.z0+.18}}function Cp(s,e){let r=Math.max(8,Math.min(s,e)*.18),n=r*.55,i=n,o=n,t=s-n,a=e-n,d=(c,p,l,f)=>{let m=Math.hypot(l-c,f-p),h=Math.max(1,Math.round(m/(r*1.7))),y="";for(let g=1;g<=h;g++){let k=c+(l-c)*g/h,u=p+(f-p)*g/h,b=m/h/2*1.08;y+=` A${b.toFixed(1)},${b.toFixed(1)} 0 0 1 ${k.toFixed(1)},${u.toFixed(1)}`}return y};return`M${i.toFixed(1)},${o.toFixed(1)}`+d(i,o,t,o)+d(t,o,t,a)+d(t,a,i,a)+d(i,a,i,o)+"Z"}function dn(s,e){let r={...e,z0:e.z1},n=a=>{let[d,c]=re(e.x0,e.y0,a);return[it,.5,-it,.5,d,c]},i=(e.x1-e.x0)*Ve,o=(e.y1-e.y0)*Ve,t=Cp(i,o);return s.onMatrix(n(e.z0),i,o,()=>ie("path",{d:t,class:"lft cloud-side"}))+s.onMatrix(n(e.z1),i,o,()=>ie("path",{d:t,class:"top cloud-top"}))}function Lp(s){let e=[re(s.x0,s.y0,s.z1),re(s.x1,s.y0,s.z0),re(s.x0,s.y1,s.z0),re(s.x1,s.y1,s.z0),re(s.x1,s.y1,s.z1),re(s.x0,s.y0,s.z0)],r=e.map(i=>i[0]),n=e.map(i=>i[1]);return[Math.min(...r),Math.min(...n),Math.max(...r),Math.max(...n)]}function Dp(s,e){let n=s.x1<=e.x0+1e-6,i=e.x1<=s.x0+1e-6,o=s.y1<=e.y0+1e-6,t=e.y1<=s.y0+1e-6,a=s.z1<=e.z0+1e-6,d=e.z1<=s.z0+1e-6,c=n||o||a,p=i||t||d;return c&&!p?-1:p&&!c?1:0}function Di(s){let e=s.length,r=s.map(c=>Lp(c.box)),n=c=>c.box.x0+c.box.y0+c.box.z0*.01,i=s.map(()=>[]),o=new Array(e).fill(0);for(let c=0;c<e;c++)for(let p=c+1;p<e;p++){let l=r[c],f=r[p];if(l[2]<=f[0]||f[2]<=l[0]||l[3]<=f[1]||f[3]<=l[1])continue;let m=Dp(s[c].box,s[p].box);m<0?(i[c].push(p),o[p]++):m>0&&(i[p].push(c),o[c]++)}let t=[],a=s.map((c,p)=>p).filter(c=>!o[c]),d=new Array(e).fill(!1);for(;t.length<e;){if(!a.length){let p=s.map((l,f)=>f).filter(l=>!d[l]).sort((l,f)=>n(s[l])-n(s[f]));a.push(p[0]),o[p[0]]=0}a.sort((p,l)=>n(s[p])-n(s[l])||p-l);let c=a.shift();if(!d[c]){d[c]=!0,t.push(s[c]);for(let p of i[c])!d[p]&&--o[p]===0&&a.push(p)}}return t}function Xe(s){return[re(s.x0,s.y0,s.z1),re(s.x1,s.y0,s.z1),re(s.x1,s.y0,s.z0),re(s.x1,s.y1,s.z0),re(s.x0,s.y1,s.z0),re(s.x0,s.y1,s.z1)]}function Vt(s){let e=s.map(o=>o[0]),r=s.map(o=>o[1]),n=Math.min(...e),i=Math.min(...r);return{x:n,y:i,w:Math.max(...e)-n,h:Math.max(...r)-i}}function un(s,e){let r=s,n=(a,d)=>{let c=[];for(let p=0;p<r.length;p++){let l=r[p],f=r[(p+1)%r.length],m=a(l),h=a(f);m&&c.push(l),m!==h&&c.push(d(l,f))}r=c},i=a=>(d,c)=>[a,d[1]+(c[1]-d[1])*(a-d[0])/(c[0]-d[0])],o=a=>(d,c)=>[d[0]+(c[0]-d[0])*(a-d[1])/(c[1]-d[1]),a];if(n(a=>a[0]>=e.x,i(e.x)),!r.length||(n(a=>a[0]<=e.x+e.w,i(e.x+e.w)),!r.length)||(n(a=>a[1]>=e.y,o(e.y)),!r.length)||(n(a=>a[1]<=e.y+e.h,o(e.y+e.h)),!r.length))return 0;let t=0;for(let a=0;a<r.length;a++){let d=r[a],c=r[(a+1)%r.length];t+=d[0]*c[1]-c[0]*d[1]}return Math.abs(t)/2}function qp(s,e){let r=Math.min(s.x+s.w,e.x+e.w)-Math.max(s.x,e.x),n=Math.min(s.y+s.h,e.y+e.h)-Math.max(s.y,e.y);return r>0&&n>0?r*n:0}var Zt=64,yn=class{cells=new Map;n=0;add(e,r,n,i,o){for(let t=Math.floor(r/Zt);t<=Math.floor(i/Zt);t++)for(let a=Math.floor(n/Zt);a<=Math.floor(o/Zt);a++){let d=t*1048576+a,c=this.cells.get(d);c||this.cells.set(d,c=[]),c[c.length-1]!==e&&c.push(e)}}query(e,r,n,i){let o=new Set;for(let t=Math.floor(e/Zt);t<=Math.floor(n/Zt);t++)for(let a=Math.floor(r/Zt);a<=Math.floor(i/Zt);a++){let d=this.cells.get(t*1048576+a);if(d)for(let c of d)o.add(c)}return[...o].sort((t,a)=>t-a)}},Bi=s=>{let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let[o,t]of s)o<e&&(e=o),o>n&&(n=o),t<r&&(r=t),t>i&&(i=t);return[e,r,n,i]},gn=new WeakMap;function ns(s,e){let r=gn.get(s);for((!r||r.n>s.length)&&gn.set(s,r=new yn);r.n<s.length;r.n++){let[n,i,o,t]=e(s[r.n]);r.add(r.n,n,i,o,t)}return r}function Ko(s){let e=gn.get(s);for((!e||e.n>s.length)&&gn.set(s,e=new yn);e.n<s.length;e.n++){let r=s[e.n].pts;for(let n=0;n+1<r.length;n++){let i=r[n],o=r[n+1],t=e.n*65536+n,a=Math.max(1,Math.ceil(Math.hypot(o[0]-i[0],o[1]-i[1])/(Zt/2)));for(let d=0;d<a;d++){let c=d/a,p=(d+1)/a,l=i[0]+(o[0]-i[0])*c,f=i[1]+(o[1]-i[1])*c,m=i[0]+(o[0]-i[0])*p,h=i[1]+(o[1]-i[1])*p;e.add(t,Math.min(l,m)-1,Math.min(f,h)-1,Math.max(l,m)+1,Math.max(f,h)+1)}}}return e}var Rt=(s,e,r,n,i)=>s.query(e,r,n,i),js=s=>Bi(s),hn=s=>[s.x,s.y,s.x+s.w,s.y+s.h];function Fo(s,e,r,[n,i,o,t]){let a=0,d=r-1;for(let c of[0,1]){let p=e[c]-s[c],l=c?i:n,f=c?t:o;if(Math.abs(p)<1e-12){if(s[c]<l||s[c]>f)return[1,0];continue}let m=(l-s[c])/p*r-.5,h=(f-s[c])/p*r-.5;m>h&&([m,h]=[h,m]),a=Math.max(a,Math.floor(m)-1),d=Math.min(d,Math.ceil(h)+1)}return[a,d]}var mr=class s{polys=[];rects=[];lines=[];solids=[];slants=[];budget={spots:1/0,over:!1,told:!1};hidden(e){let r=0;for(let n of Rt(ns(this.solids,js),...hn(e)))r+=un(this.solids[n],e);return r}hiddenPoly(e){let r=0;for(let n of Rt(ns(this.solids,js),...Bi(e)))r+=qi(e,this.solids[n]);return r}costPoly(e,r=1/0){let n=Bi(e),i=0;for(let o of Rt(ns(this.polys,t=>js(t.poly)),...n))i+=qi(e,this.polys[o].poly);for(let o of Rt(ns(this.rects,t=>hn(t.r)),...n))i+=un(e,this.rects[o].r)*2;for(let o of Rt(ns(this.slants,js),...n))i+=qi(e,this.slants[o])*2;if(i>=r)return i;for(let o of Rt(Ko(this.lines),...n)){if(i>=r)return i;let t=this.lines[Math.floor(o/65536)].pts,a=o%65536,d=t[a],c=t[a+1],p=Math.hypot(c[0]-d[0],c[1]-d[1]),l=Math.max(1,Math.ceil(p/4)),[f,m]=Fo(d,c,l,n);for(let h=f;h<=m;h++)Kp(e,[d[0]+(c[0]-d[0])*(h+.5)/l,d[1]+(c[1]-d[1])*(h+.5)/l])&&(i+=p/l*4*.6)}return i}cost(e,r,n=.6){let i=hn(e),o=0;for(let t of Rt(ns(this.polys,a=>js(a.poly)),...i)){let a=this.polys[t];o+=un(a.poly,e)*(a.owner===r?1.5:1)}for(let t of Rt(ns(this.rects,a=>hn(a.r)),...i)){let a=this.rects[t];(a.owner!==r||!r)&&(o+=qp(a.r,e)*2)}for(let t of Rt(ns(this.slants,js),...i))o+=un(this.slants[t],e)*2;if(n){let t=-1,a=0;for(let d of Rt(Ko(this.lines),...i)){let c=Math.floor(d/65536);c!==t&&(t>=0&&(o+=a*n),t=c,a=0);let p=this.lines[c].pts,l=d%65536,f=p[l],m=p[l+1],h=Math.hypot(m[0]-f[0],m[1]-f[1]),y=Math.max(1,Math.ceil(h/4)),[g,k]=Fo(f,m,y,i);for(let u=g;u<=k;u++){let b=f[0]+(m[0]-f[0])*(u+.5)/y,x=f[1]+(m[1]-f[1])*(u+.5)/y;b>=e.x&&b<=e.x+e.w&&x>=e.y&&x<=e.y+e.h&&(a+=h/y*4)}}t>=0&&(o+=a*n)}return o}fork(){let e=new s;return e.budget=this.budget,e.polys=this.polys,e.lines=this.lines,e.solids=this.solids,e.rects=[...this.rects],e.slants=this.slants,e}},Zo=14;function Fi(s,e,r,n){let i=Math.max(s.name?rs(s.name,Fe.lbl):0,s.sub?rs(s.sub,Fe.sub):0)+4,o=(s.name?1:0)+(s.sub?1:0),t=r-(s.name?11:9)-1,a=(o-1)*Zo+(s.name?11:9)+4;return{x:n==="start"?e-2:n==="end"?e-i+2:e-i/2,y:t,w:i,h:a}}function Zi(s,e,r,n,i,o){let t=Vt(r),a=re((e.x0+e.x1)/2,(e.y0+e.y1)/2,e.z1)[0],c=((s.name?1:0)+(s.sub?1:0)-1)*Zo+4,p=t.y-6-c,l=t.y+Math.min(t.h,60)*.45,f=[];o&&f.push({...o,pen:0}),f.push({x:a,y:p,anchor:"middle",pen:o?20:0});for(let y of[12,24,40])f.push({x:a,y:p-y,anchor:"middle",pen:20+y});for(let y of[-30,30,-60,60])f.push({x:a+y,y:p-4,anchor:"middle",pen:30+Math.abs(y)});f.push({x:t.x+t.w+8,y:l,anchor:"start",pen:120}),f.push({x:t.x-8,y:l,anchor:"end",pen:120}),f.push({x:a,y:t.y+t.h+14,anchor:"middle",pen:300});let m,h=1/0;for(let y of f){let g=Fi(s,y.x,y.y,y.anchor),k=n.cost(g,i,.15)*2+y.pen;k<h&&(h=k,m={x:y.x,y:y.y,anchor:y.anchor,rect:g})}return m}function Bp(s,e,r,n){return{x:(n==="start"?e:n==="end"?e-s:e-s/2)-2,y:r-14,w:s+4,h:28}}function Vo(s,e,r,n,i){let o=[{...n,pen:0}];for(let p of[-46,-66,-86,-106,-126,-146])for(let l of[0,-70,70,-140,140])o.push({x:e+l,y:r+p,anchor:"middle",pen:10+(-p-46)*.5+Math.abs(l)*.4});for(let p of[34,60,86])o.push({x:e,y:r+p,anchor:"middle",pen:60+p*.3});let t=n.x-e,a=n.y-r;for(let p of[-1,1])for(let l of[16,32,48])o.push({...n,y:r+a+p*l,x:e+t,pen:5+l});for(let p of[-1,1])for(let l of[30,60,90])for(let f of[0,16,-16])o.push({...n,x:e+t+p*l,y:r+a+f,pen:8+l*.6+Math.abs(f)});let d,c=1/0;for(let p of o){let l=Bp(s,p.x,p.y,p.anchor),f=i.cost(l,void 0,.05)*3+p.pen;f<c&&(c=f,d={x:p.x,y:p.y,anchor:p.anchor,rect:l})}return d}var Uo=s=>{let e=0;for(let r=0;r<s.length;r++){let n=s[r],i=s[(r+1)%s.length];e+=n[0]*i[1]-i[0]*n[1]}return e/2},Ki=s=>Uo(s)<0?[...s].reverse():s;function Kp(s,e){let r=Ki(s);for(let n=0;n<r.length;n++){let i=r[n],o=r[(n+1)%r.length];if((o[0]-i[0])*(e[1]-i[1])-(o[1]-i[1])*(e[0]-i[0])<0)return!1}return!0}function qi(s,e){let r=Ki(s),n=Ki(e);for(let i=0;i<n.length&&r.length;i++){let o=n[i],t=n[(i+1)%n.length],a=c=>(t[0]-o[0])*(c[1]-o[1])-(t[1]-o[1])*(c[0]-o[0]),d=r;r=[];for(let c=0;c<d.length;c++){let p=d[c],l=d[(c+1)%d.length],f=a(p),m=a(l);if(f>=0&&r.push(p),f>=0!=m>=0){let h=f/(f-m);r.push([p[0]+(l[0]-p[0])*h,p[1]+(l[1]-p[1])*h])}}}return r.length>=3?Math.abs(Uo(r)):0}var Ut=.2,bn=.05,Fp=.6,wn=.25,kn={n:[0,-1],s:[0,1],e:[1,0],w:[-1,0]};function dr(s){let e=/^(.*?)(?:\.(n|e|s|w|top))?$/.exec(s);return{id:e[1],side:e[2]}}var Yo=new WeakMap;function $n(s,e,r){let n=Yo.get(s);if(!n){n=[];for(let t of s.items){if(t.type!=="region"||!nt(s.catalog,t.region.kind)?.floor)continue;let a=0;for(let d=t.parent;d;d=d.parent)a++;n.push({r:t,d:a})}Yo.set(s,n)}let i=0,o=-1;for(let{r:t,d:a}of n){let d=t.box,c=1e-6;e>=d.x0-c&&e<=d.x1+c&&r>=d.y0-c&&r<=d.y1+c&&a>o&&(o=a,i=t.floor)}return i}function Zp(s,e){let r=[(s.x0+s.x1)/2,(s.y0+s.y1)/2],n=[(e.x0+e.x1)/2,(e.y0+e.y1)/2],i=n[0]-r[0],o=n[1]-r[1],t=Math.max(e.x0-s.x1,s.x0-e.x1),a=Math.max(e.y0-s.y1,s.y0-e.y1);return t>0&&(a<=0||t>=a)?i>0?"e":"w":a>0?o>0?"s":"n":Math.abs(i)>=Math.abs(o)?i>0?"e":"w":o>0?"s":"n"}var Wo=5e5;function Go(s,e,r,n,i,o){let t=[],a=(b,x,$,P="error")=>{let T=n.locate(b);t.push({severity:P,message:x,line:T.line,col:T.col,path:b,hint:$})},d=s.routes??[],c={left:Wo},p=0,l=()=>r.items.map(b=>b.id),f=new Map,m=[],h=[];d.forEach((b,x)=>{let $=`${e}/routes/${x}`;(f.has(b.id)||r.byId.has(b.id))&&a($+"/id",`duplicate id "${b.id}"`),f.set(b.id,x);let P=b.kind??"send";i.has(P)||a($+"/kind",`unknown flow kind "${P}"`+Vi(P,i),`kinds: ${[...i].join(", ")}; add one under "kinds:"`);let T={id:b.id,raw:b,path:$,kind:P,points:[]},M=(B,E)=>{let{id:D}=dr(B),v=r.byId.get(D);if(!v){a(`${$}/${E}`,`unknown node "${D}"`+Vi(D,l()));return}return v};T.from=M(b.from,"from"),T.to=M(b.to,"to"),m.push(T),h.push({r:T})});let y=new Map;for(let b of h){let{r:x}=b;if(!x.from||!x.to||x.raw.points)continue;let $=dr(x.raw.from).side,P=dr(x.raw.to).side,T=x.raw.via?.[0],M=x.raw.via?.[x.raw.via.length-1],B=(O,S)=>{if(Array.isArray(O))return{x0:O[0],x1:O[0],y0:O[1],y1:O[1],z0:0,z1:0};if(typeof O=="string"){let N=r.byId.get(dr(O).id);if(N)return N.box}return S.box},E=(O,S,N)=>{let I=S??Zp(O.box,N);return{node:O,side:I,explicit:!!S,p:[0,0],z:0}};b.a=E(x.from,$,B(T,x.to)),b.b=E(x.to,P,B(M,x.from));let D=B(T,x.to),v=B(M,x.from);for(let[O,S]of[[b.a,D],[b.b,v]]){let N=`${O.node.id}.${O.side}`;y.has(N)||y.set(N,[]),y.get(N).push({e:O,other:[(S.x0+S.x1)/2,(S.y0+S.y1)/2]})}}for(let[,b]of y){let x=b[0].e,$=x.node.box,P=x.side,T=P==="e"||P==="w"?1:0;b.sort((O,S)=>O.other[T]-S.other[T]);let M=T?$.y0:$.x0,B=T?$.y1:$.x1,E=(M+B)/2,D=Math.max(0,B-M-.3),v=b.length>1?Math.min(Fp,D/(b.length-1)):0;b.forEach((O,S)=>{let N=(S-(b.length-1)/2)*v,I=E+N,L=O.e.node.box.z0;if(P==="top"){O.e.p=[($.x0+$.x1)/2,($.y0+$.y1)/2],O.e.z=$.z1;return}let[X,j]=kn[P];O.e.p=T?[X>0?$.x1+bn:$.x0-bn,I]:[I,j>0?$.y1+bn:$.y0-bn],O.e.z=L})}let g=[];for(let b of r.items)b.type==="node"&&g.push(b.box);let k=[];for(let b of r.items.filter(x=>nt(r.catalog,x.region?.kind)?.shape==="walled")){let{x0:x,y0:$,x1:P,y1:T}=b.box,M=ss,B=b.region.gate,E=[[{x0:x,y0:$,x1:P,y1:$+M,z0:0,z1:0},"n"],[{x0:x,y0:T-M,x1:P,y1:T,z0:0,z1:0},"s"],[{x0:x,y0:$,x1:x+M,y1:T,z0:0,z1:0},"w"],[{x0:P-M,y0:$,x1:P,y1:T,z0:0,z1:0},"e"]];for(let[D,v]of E)if(B&&B.side===v){if(B.node)continue;let O=B.at??.5,S=B.width??2;if(v==="e"||v==="w"){let N=$+(T-$)*O;k.push({...D,y1:N-S/2},{...D,y0:N+S/2})}else{let N=x+(P-x)*O;k.push({...D,x1:N-S/2},{...D,x0:N+S/2})}}else k.push(D)}let u=new Map;for(let b of h){let{r:x,a:$,b:P}=b;if(x.raw.points){x.points=x.raw.points.map(I=>[I[0],I[1],I.length>2?I[2]:$n(r,I[0],I[1])+.01]);continue}if(!$||!P)continue;let T=[];(x.raw.via??[]).forEach((I,L)=>{if(Array.isArray(I))if(o){let X=j=>Math.round(Math.round(j/o)*o*1e9)/1e9;I.forEach((j,A)=>{Math.abs(j/o-Math.round(j/o))>1e-6&&a(`${x.path}/via/${L}/${A}`,`${j} is not on the ${o} grid; it is drawn at ${X(j)}`,void 0,"warning")}),T.push({p:[X(I[0]),X(I[1])]})}else T.push({p:[I[0],I[1]]});else{let{id:X,side:j}=dr(I),A=r.byId.get(X);if(!A){a(`${x.path}/via/${L}`,`unknown node "${X}"`+Vi(X,l()));return}let R=j&&j!=="top"?j:"n",[C,K]=kn[R],W=A.box;T.push({p:[C?C>0?W.x1+.4:W.x0-.4:(W.x0+W.x1)/2,K?K>0?W.y1+.4:W.y0-.4:(W.y0+W.y1)/2]})}});let B=g.filter(I=>I!==$.node.box&&I!==P.node.box).concat(x.raw.cross?[]:k).filter(I=>!xn($.node.box,I)&&!xn(P.node.box,I)&&!xn(I,$.node.box)&&!xn(I,P.node.box)),E=$.side==="top"?void 0:kn[$.side],D=P.side==="top"?void 0:kn[P.side],v=[$.p,...T.map(I=>I.p),P.p],O=[$.p],S=E,N=!0;for(let I=0;I+1<v.length;I++){let L=I+2===v.length,X=Up(v[I],v[I+1],B,u,S,L&&D?[-D[0],-D[1]]:void 0,c);if(!X){N=!1;break}O.push(...X.slice(1));let j=O.length;if(j>=2){let A=Math.sign(O[j-1][0]-O[j-2][0]),R=Math.sign(O[j-1][1]-O[j-2][1]);S=[A,R]}}!N&&c.left<=0?(p++,O=[$.p,[P.p[0],$.p[1]],P.p]):N||(a(x.path,`no path found for route "${x.id}" from "${$.node.id}" to "${P.node.id}"`,'add "via" points, or use "points" to draw it by hand',"warning"),O=[$.p,[P.p[0],$.p[1]],P.p]),O=Ui(O);for(let I=0;I+1<O.length;I++)Vp(u,O[I],O[I+1]);x.points=Jp(r,O,$,P)}return p&&a(e,`${p} of ${m.length} routes were drawn as plain elbows: the scene is too large to route them all around what stands in the way (${Wo.toLocaleString("en")} search steps)`,'split it into scenes, or give the busiest routes "via" points or "points"',"warning"),{routes:m,diags:t}}function xn(s,e){return e.x0>=s.x0-1e-6&&e.x1<=s.x1+1e-6&&e.y0>=s.y0-1e-6&&e.y1<=s.y1+1e-6&&e.z0>=s.z1-1e-6}var Jo=(s,e)=>`${Math.round(s/Ut)},${Math.round(e/Ut)}`;function Vp(s,e,r){let n=Math.max(1,Math.round(Math.hypot(r[0]-e[0],r[1]-e[1])/Ut));for(let i=0;i<=n;i++){let o=Jo(e[0]+(r[0]-e[0])*i/n,e[1]+(r[1]-e[1])*i/n);s.set(o,(s.get(o)??0)+1)}}function Ho(s,e,r){for(let n of r)if(s>n.x0-wn&&s<n.x1+wn&&e>n.y0-wn&&e<n.y1+wn)return!0;return!1}function Up(s,e,r,n,i,o,t={left:1/0}){if((Math.abs(s[0]-e[0])<1e-6||Math.abs(s[1]-e[1])<1e-6)&&Gp(s,e,r)){let A=[Math.sign(e[0]-s[0]),Math.sign(e[1]-s[1])],R=!i||i[0]===A[0]&&i[1]===A[1],C=!o||o[0]===A[0]&&o[1]===A[1];if(R&&C)return[s,e]}if(t.left<=0)return null;let a=A=>Math.round((A-s[0])/Ut),d=A=>Math.round((A-s[1])/Ut),c=A=>s[0]+A*Ut,p=A=>s[1]+A*Ut,l=a(e[0]),f=d(e[1]),m=30,h=Math.min(0,l)-m,y=Math.max(0,l)+m,g=Math.min(0,f)-m,k=Math.max(0,f)+m,u=1.2,b=Ut,x=.06,$=[[1,0],[-1,0],[0,1],[0,-1]],P=y-h+1,T=k-g+1,M=(A,R)=>(A-h)*T+(R-g),B=new Int8Array(P*T).fill(-1),E=new Float64Array(P*T).fill(-1),D=new Float64Array(P*T*4).fill(1/0),v=(A,R)=>{let C=M(A,R);return B[C]<0&&(B[C]=Ho(c(A),p(R),r)?1:0),B[C]===1},O=(A,R)=>{let C=M(A,R);return E[C]<0&&(E[C]=n.get(Jo(c(A),p(R)))??0),E[C]},S=Yp(),N=(A,R)=>(Math.abs(A-l)+Math.abs(R-f))*b,I=i?$.findIndex(A=>A[0]===i[0]&&A[1]===i[1]):-1;S.push({i:0,j:0,d:I,g:0,f:N(0,0),idx:0,hp:0});let L=(A,R)=>Math.abs(A)+Math.abs(R)<=2,X=(A,R)=>Math.abs(A-l)+Math.abs(R-f)<=2,j=0;for(;S.length()&&j++<2e5;){if(t.left--<=0)return null;let A=S.take();if(A.i===l&&A.j===f&&!(o&&A.d>=0&&($[A.d][0]!==o[0]||$[A.d][1]!==o[1]))){let R=[];for(let C=A;C;C=C.prev)R.push([c(C.i),p(C.j)]);return R.reverse(),R[0]=s,Wp(Ui(R),e)}for(let R=0;R<4;R++){let C=$[R];if(A.d>=0&&C[0]===-$[A.d][0]&&C[1]===-$[A.d][1])continue;let K=A.i+C[0],W=A.j+C[1];if(K<h||K>y||W<g||W>k||!L(K,W)&&!X(K,W)&&v(K,W))continue;if((L(K,W)||X(K,W))&&v(K,W)&&!(K===l&&W===f)){let fe=L(K,W)?i:o&&[-o[0],-o[1]];if(!fe||(L(K,W)?C[0]!==fe[0]||C[1]!==fe[1]:C[0]!==o[0]||C[1]!==o[1]))continue}let ae=A.d>=0&&A.d!==R?u:0,ee=A.g+b+ae+O(K,W)*x,G=M(K,W)*4+R;D[G]<=ee||(D[G]=ee,S.push({i:K,j:W,d:R,g:ee,f:ee+N(K,W),prev:A,idx:0,hp:0}))}}return null}function Yp(){let s=[],e=[],r=(t,a)=>t.f<a.f||t.f===a.f&&t.idx<a.idx,n=(t,a)=>{let d=e[t];e[t]=e[a],e[a]=d,e[t].hp=t,e[a].hp=a},i=t=>{for(;t>0;){let a=t-1>>1;if(!r(e[t],e[a]))break;n(t,a),t=a}},o=t=>{for(;;){let a=2*t+1,d=a+1,c=t;if(a<e.length&&r(e[a],e[c])&&(c=a),d<e.length&&r(e[d],e[c])&&(c=d),c===t)return;n(t,c),t=c}};return{length:()=>s.length,push(t){t.idx=s.length,s.push(t),t.hp=e.length,e.push(t),i(t.hp)},take(){let t=e[0],a=e.pop();e.length&&(e[0]=a,a.hp=0,o(0));let d=s.pop();return d!==t&&(s[t.idx]=d,d.idx=t.idx,i(d.hp)),t}}}function Wp(s,e){let r=s.map(o=>[o[0],o[1]]),n=r.length,i=r[n-1];if(n>=2){let o=r[n-2];Math.abs(o[1]-i[1])<1e-9?(o[1]=e[1],n>=3&&Math.abs(r[n-3][1]-i[1])<1e-9&&(r[n-3][1]=e[1])):Math.abs(o[0]-i[0])<1e-9&&(o[0]=e[0],n>=3&&Math.abs(r[n-3][0]-i[0])<1e-9&&(r[n-3][0]=e[0]))}return r[n-1]=e,Ui(r)}function Gp(s,e,r){let n=Math.max(1,Math.round(Math.hypot(e[0]-s[0],e[1]-s[1])/(Ut/2)));for(let i=2;i<n-1;i++)if(Ho(s[0]+(e[0]-s[0])*i/n,s[1]+(e[1]-s[1])*i/n,r))return!1;return!0}function Ui(s){let e=[];for(let r of s){let n=e.length;if(!(n&&Math.abs(e[n-1][0]-r[0])<1e-6&&Math.abs(e[n-1][1]-r[1])<1e-6)){if(n>=2){let i=e[n-2],o=e[n-1];if(Math.abs(i[0]-o[0])<1e-6&&Math.abs(o[0]-r[0])<1e-6||Math.abs(i[1]-o[1])<1e-6&&Math.abs(o[1]-r[1])<1e-6){e[n-1]=r;continue}}e.push(r)}}return e}function Jp(s,e,r,n){let i=new Set,o=new Set;for(let c of s.items)c.type!=="region"||!nt(s.catalog,c.region.kind)?.floor||(i.add(c.box.x0),i.add(c.box.x1),o.add(c.box.y0),o.add(c.box.y1));let t=[],a=(c,p)=>$n(s,c,p)+.01;for(let c=0;c+1<e.length;c++){let[p,l]=e[c],[f,m]=e[c+1],h=[0,1];if(Math.abs(l-m)<1e-6)for(let y of i){let g=(y-p)/(f-p);g>1e-6&&g<1-1e-6&&h.push(g)}else for(let y of o){let g=(y-l)/(m-l);g>1e-6&&g<1-1e-6&&h.push(g)}h.sort((y,g)=>y-g);for(let y=0;y+1<h.length;y++){let g=h[y],k=h[y+1],u=(g+k)/2,b=a(p+(f-p)*u,l+(m-l)*u),x=[p+(f-p)*g,l+(m-l)*g,b],$=[p+(f-p)*k,l+(m-l)*k,b],P=t[t.length-1];P&&(Math.abs(P[0]-x[0])>1e-6||Math.abs(P[1]-x[1])>1e-6||Math.abs(P[2]-x[2])>1e-6)?t.push(x):P||t.push(x),t.push($)}}t.length&&(t[0][2]=r.side==="top"?r.z:r.node.box.z0+.01,t[t.length-1][2]=n.side==="top"?n.z:n.node.box.z0+.01);let d=[];for(let c of t){let p=d.length;if(p>=2){let l=d[p-2],f=d[p-1],m=Math.abs(l[2]-f[2])<1e-9&&Math.abs(f[2]-c[2])<1e-9,h=Math.abs(l[0]-f[0])<1e-6&&Math.abs(f[0]-c[0])<1e-6||Math.abs(l[1]-f[1])<1e-6&&Math.abs(f[1]-c[1])<1e-6;if(m&&h){d[p-1]=c;continue}}d.push(c)}return d}function Vi(s,e){let r=Ye(s,e);return r?` (did you mean "${r}"?)`:""}var Sn=24;function Pn(s,e){let[r,n,i,o]=e,t=s.x+s.w/2,a=s.y+s.h/2,d=[["left",t-r],["right",r+i-t],["top",a-n],["bottom",n+o-a]];d.sort((p,l)=>p[1]-l[1]);let c=d[0][0];return c==="left"?{edge:c,dx:-(s.x+s.w-r)-Sn,dy:0}:c==="right"?{edge:c,dx:r+i-s.x+Sn,dy:0}:c==="top"?{edge:c,dx:0,dy:-(s.y+s.h-n)-Sn}:{edge:c,dx:0,dy:n+o-s.y+Sn}}function Xo(s,e,r){let n=x=>{let $=0;for(let P=x.parent;P;P=P.parent)$++;return $},i=x=>x.box.x0+x.box.y0+x.box.z0*.01,o=s.items.filter(x=>x.type==="region").sort((x,$)=>n(x)-n($)||i(x)-i($)),t=s.items.filter(x=>x.type==="node").sort((x,$)=>i(x)-i($)||x.box.z0-$.box.z0),a=[],d=Math.min(90,400/Math.max(1,o.length)),c=650;o.forEach((x,$)=>{let P=Vt(Xe(x.box));a.push({id:x.id,kind:"region",...Pn(P,r),delay:Math.round($*d),dur:c,bbox:P})});let p=250+Math.round(d*o.length),l=Math.min(70,700/Math.max(1,t.length)),f=600;t.forEach((x,$)=>{let P=Vt(Xe(x.box));a.push({id:x.id,kind:"node",...Pn(P,r),delay:Math.round(p+$*l),dur:f,bbox:P})});let m=t.length?p+(t.length-1)*l:p,h=Math.round(m+300),y=Math.min(30,300/Math.max(1,e.length)),g=400,k=e.filter(x=>x.points.length>=2).map((x,$)=>({id:x.id,delay:Math.round(h+$*y),dur:g})),u={delay:h+200,dur:400},b=Math.max(...a.map(x=>x.delay+x.dur),...k.map(x=>x.delay+x.dur),u.delay+u.dur);return{pieces:a,routes:k,labels:u,total:b}}var tl=(s,e)=>e.role??nt(s,e.kind)?.role,vn=(s,e)=>nt(s,e.region.kind)?.shape,pt=(s,e,r,n="item")=>r?ie("g",{[`data-${n}`]:s,"data-part":e},r):"";function On({scene:s,layout:e,routes:r,steps:n,theme:i,id:o,gridStep:t=1}){let a=new mn,d={base:"",floor:"",flows:"",blocks:[],air:"",labels:"",marks:"",badges:""},c=new mr;c.budget.spots=el;let p=S=>n.vis[S]?{"data-vis":"1"}:{},l=e.items.filter(S=>S.type==="region"),f=S=>{let N=0;for(let I=S.parent;I;I=I.parent)N++;return N},m=e.catalog,h=l.filter(S=>vn(m,S)!=="walled"&&vn(m,S)!=="tunnel"),y=Di(h.map(S=>({box:S.box,r:S}))).map(S=>S.r).sort((S,N)=>f(S)-f(N));for(let S of y)d.base+=Xp(a,m,S,p(S.id),t);for(let S of l.filter(N=>vn(m,N)==="walled")){for(let I of Qo(S))c.solids.push(Xe(I));for(let[I,L]of Qo(S).entries())d.blocks.push({box:L,svg:pt(S.id,`wall-${I+1}`,ie("g",{class:`blk k-${tl(m,S.region)} wall${S.region.ghost?" ghost":""}`,"data-id":S.id,"data-dim":"1",...p(S.id)},a.blockFaces(L)))});let N=S.region.gate;if(N&&!N.node){let I=Ni(S,N.height??(S.region.height??.8)+.3,.3,.3);c.solids.push(Xe(I)),d.blocks.push({box:I,svg:pt(S.id,"gate",ie("g",{class:"blk k-gate","data-id":S.id,...p(S.id)},a.blockFaces(I)))})}S.region.label&&(S.region["label-style"]??"face")!=="none"&&(d.labels+=pt(S.id,"name",a.faceText(S.box.x0+.3,S.box.y1,S.box.z0+.13,S.region.label,"slabname sm fz",Fe.sm,"left","start",{"data-id":S.id,...p(S.id)})))}for(let S of l.filter(N=>vn(m,N)==="tunnel"))d.air+=pt(S.id,"block",ec(a,S,p(S.id)));let g=e.items.filter(S=>S.type==="node");for(let S of g){let N=S.node,I=ms(m,N.asset),L=N.ghost||(N.deco??[]).includes("ghost"),X=["blk",`k-${N.role??I.role}`,I.cls,L?"ghost":""].filter(Boolean).join(" ");d.blocks.push({box:S.box,svg:pt(S.id,"block",ie("g",{class:X,"data-id":S.id,"data-dim":"1",...p(S.id)},I.draw(a,S.box,N)))}),c.polys.push({poly:Xe(S.box),owner:S.id}),c.solids.push(Xe(S.box))}let k=Di(d.blocks).map(S=>S.svg).join(""),u=new Set,b={};for(let S of r){if(S.points.length<2)continue;let N=S.points.map(X=>re(X[0],X[1],X[2]));N.forEach(X=>a.bounds.add(X));let I="M"+N.map(pr).join(" L");b[S.id]=I;let L=S.raw.arrow!==!1;L&&u.add(S.kind),d.flows+=pt(S.id,"line",ie("g",{"data-hl":S.id,"data-id":S.id,...p(S.id)},ie("path",{d:I,class:`flow f-${S.kind}`,"marker-end":L?`url(#ah-${o}-${S.kind})`:void 0})),"route"),c.lines.push({pts:N,owner:S.id})}for(let S of u)a.def(`ah-${o}-${S}`,ie("marker",{id:`ah-${o}-${S}`,viewBox:"0 0 10 10",refX:"7",refY:"5",markerWidth:"4.2",markerHeight:"4.2",orient:"auto-start-reverse"},ie("path",{d:"M0,0 L10,5 L0,10 z",style:`fill:${Ts(i,i.kinds[S]?.color??"control")}`})));for(let S of a.planePolys)c.slants.push(S);let x=g.filter(S=>S.node.label||S.node.sub).sort((S,N)=>(N.box.x1-N.box.x0)*(N.box.y1-N.box.y0)-(S.box.x1-S.box.x0)*(S.box.y1-S.box.y0));for(let S of x)d.labels+=pt(S.id,"label",Qp(a,m,S,c,p(S.id)));let $=[];for(let S of r)if(S.raw.label&&S.points.length>=2){let N=tc(a,S,c,p(S.id),e);d.floor+=pt(S.id,"label",N.svg,"route"),N.warning&&$.push({path:`${S.path}/label`,message:N.warning}),c.budget.over&&!c.budget.told&&(c.budget.told=!0,$.push({path:S.path,message:`from route "${S.id}" on, route labels were placed without weighing what other labels and lines cover: the scene is too large to search every spot (${el.toLocaleString("en")} spots); split it into scenes, or give the labels "along", "side" or "at"`}))}(s.notes??[]).forEach((S,N)=>{let I=pt(`${o}-note-${N}`,"note",sc(a,S,e,r,`${o}-note-${N}`));S.floor?d.floor+=I:d.labels+=I});let P=[],T=new Map;for(let S of n.says){let N=T.get(S.step)??c.fork();T.set(S.step,N);let I=rs(S.text,Fe.say)+18,L=Vo(I,S.ax,S.ay,{x:S.x,y:S.y,anchor:S.anchor},N);N.rects.push({r:L.rect,owner:""}),P.push({step:S.step,...L.rect,text:S.text});let X=L.rect.x+2;a.bounds.addRect(L.rect.x,L.rect.y,L.rect.w,L.rect.h);let j=Ts(i,i.kinds[S.kind]?.color??"control");d.marks+=ie("g",{class:"say","data-step":S.step},ie("rect",{x:X,y:L.y-12,width:I,height:24,rx:12,style:`stroke:${j}`})+ie("text",{x:X+I/2,y:L.y+4,"text-anchor":"middle",style:`fill:${j}`},lr(S.text)))}for(let S of n.marks){let[N,I]=re(...S.p);a.bounds.addRect(N-12,I-12,24,24),d.marks+=ie("g",{class:"xm","data-step":S.step,"data-hl":S.on},ie("circle",{cx:N,cy:I,r:10})+ie("path",{d:`M${Ee(N-4.5)},${Ee(I-4.5)} L${Ee(N+4.5)},${Ee(I+4.5)} M${Ee(N+4.5)},${Ee(I-4.5)} L${Ee(N-4.5)},${Ee(I+4.5)}`}))}for(let S of n.badges){let[N,I]=re(...S.p);a.bounds.addRect(N-13,I-13,26,26),d.badges+=ie("g",{class:`badge c-${S.kind}`,"data-go":S.step,"data-badge":S.step,tabindex:"0",role:"button","aria-label":`Step ${S.num}`},ie("circle",{cx:N,cy:I,r:11.5})+ie("text",{x:N,y:I+.5},String(S.num)))}let M=a.bounds,B=22,E=M.empty?[0,0,100,100]:[Math.floor(M.x0-B),Math.floor(M.y0-B),Math.ceil(M.x1-M.x0+B*2),Math.ceil(M.y1-M.y0+B*2)],D=[...a.defs.values()].join(""),v=(S,N)=>ie("g",{class:"g-"+S},N);return{svg:ie("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:E.join(" "),role:"img","aria-label":s.aria??s.title,"data-scene":o},ie("defs",{},D)+v("base",d.base)+v("floor",d.floor)+v("flows",d.flows)+v("blocks",k)+v("air",d.air)+v("labels",d.labels)+v("marks",d.marks)+v("badges",d.badges)+v("anim","")),viewBox:E,texts:a.texts,paths:b,warnings:$,callouts:P,assembly:Xo(e,r,E)}}function Hp(s,e){let r=s.z1+.002,n=1e-6,i=[],o=(t,a)=>{let d=re(t[0],t[1],r),c=re(a[0],a[1],r);i.push(`M${pr(d)}L${pr(c)}`)};for(let t=Math.ceil((s.x0+n)/e)*e;t<s.x1-n;t+=e)o([t,s.y0],[t,s.y1]);for(let t=Math.ceil((s.y0+n)/e)*e;t<s.y1-n;t+=e)o([s.x0,t],[s.x1,t]);return i.length?ie("path",{class:"grid",d:i.join("")}):""}function Xp(s,e,r,n,i=1){let o=r.region,t=r.box,a=tl(e,o),d=nt(e,o.kind),c=d?.shape,p={"data-id":r.id,"data-dim":"1",...n},l="";c==="cloud"?l=ie("g",{class:`blk k-${a} cloud`,...p},dn(s,t)):c==="zone"?l=ie("g",{class:`zone k-${a}`,...p},s.poly([[t.x0,t.y0,t.z1],[t.x1,t.y0,t.z1],[t.x1,t.y1,t.z1],[t.x0,t.y1,t.z1]])):l=ie("g",{class:`blk k-${a}${o.ghost?" ghost":""}`,...p},s.blockFaces(t)+Hp(t,i)),l=pt(r.id,"block",l);let f=o["label-style"]??d?.labelStyle;if(o.label&&f!=="none")if(f==="face"){let m=t.z1-t.z0,h=u=>u.size*.73/Ve,y=c==="slab"&&.28+h(Fe.slabname)+.08>m,g=c==="slab"&&!y,k=g?t.z0+.28:y?t.z0+Math.max(.02,(m-h(Fe.sm))/2):t.z0+Math.min(.1,m*.25);l+=pt(r.id,"name",ie("g",p,s.faceText(t.x0+(g?.6:.3),t.y1,k,o.label,g?"slabname":"slabname sm",g?Fe.slabname:Fe.sm,"left","start")))}else if(f==="face-right")l+=pt(r.id,"name",ie("g",p,s.faceText(t.x1,t.y0+.6,t.z0+Math.max(.14,(t.z1-t.z0)*.2),o.label,"slabname",Fe.slabname,"right","end")));else{let m=c==="cloud"?"middle":"start",h=c==="cloud"?(t.x0+t.x1)/2:t.x0+.35,y=c==="cloud"?(t.y0+t.y1)/2:t.y1-.35;l+=pt(r.id,"name",ie("g",p,s.floorText(h,y,t.z1+.01,o.label,"slabname sm","x",m)))}return l}function Qo(s){let{x0:e,y0:r,x1:n,y1:i,z0:o,z1:t}=s.box,a=ss,d=s.region.gate,c=[],p=f=>{f.x1-f.x0>1e-6&&f.y1-f.y0>1e-6&&c.push({...f,z0:o,z1:t})},l=(f,m,h)=>{if(!d||d.side!==h)return[[f,m]];let y=d.at??.5,g=d.width??2,k=h==="e"||h==="w"?r+(i-r)*y:e+(n-e)*y;return[[f,k-g/2],[k+g/2,m]]};for(let[f,m]of l(e,n,"n"))p({x0:f,y0:r,x1:m,y1:r+a});for(let[f,m]of l(r+a,i-a,"w"))p({x0:e,y0:f,x1:e+a,y1:m});for(let[f,m]of l(r+a,i-a,"e"))p({x0:n-a,y0:f,x1:n,y1:m});for(let[f,m]of l(e,n,"s"))p({x0:f,y0:i-a,x1:m,y1:i});return c}function Qp(s,e,r,n,i){let o=r.node,t=ms(e,o.asset),a=r.box,d={name:o.label,sub:o.sub},c=o["label-at"],p;if(c){let f=Vt(Xe(a)),m=c.side??"above",h=f.y+Math.min(f.h,60)*.45;m==="right"?p={x:f.x+f.w+8,y:h,anchor:"start"}:m==="left"?p={x:f.x-8,y:h,anchor:"end"}:m==="below"?p={x:f.x+f.w/2,y:f.y+f.h+14,anchor:"middle"}:p=Zi(d,a,Xe(a),new mr,r.id),p={...p,x:p.x+(c.dx??0),y:p.y+(c.dy??0)}}else{let f=t.label?t.label(a,o,!!o.sub):void 0;p=Zi(d,a,Xe(a),n,r.id,f)}n.rects.push({r:Fi(d,p.x,p.y,p.anchor),owner:""});let l="";return o.label&&(l+=s.text(p.x,p.y,o.label,"lbl",Fe.lbl,p.anchor,{},r.id)),o.sub&&(l+=s.text(p.x,o.label?p.y+14:p.y,o.sub,"sub mono",Fe.sub,p.anchor,{},r.id)),ie("g",{"data-id":r.id,"data-dim":"1",...i},l)}function ec(s,e,r){let{x0:n,y0:i,x1:o,y1:t,z0:a,z1:d}=e.box,c=s.blockFaces(e.box),p=o-n>=t-i,l=Math.max(1,Math.round((p?o-n:t-i)/1.6));for(let m=1;m<l;m++){let h=p?n+(o-n)*m/l:i+(t-i)*m/l;c+=s.poly(p?[[h,i,d],[h,t,d],[h,t,a]]:[[n,h,d],[o,h,d],[o,h,a]],"rib")}let f=e.region.label;return f&&e.region["label-style"]!=="none"&&(c+=p?s.faceText(n+.35,t,a+.14,f,"tunname",Fe.tunname,"left","start"):s.faceText(o,t-.35,a+.18,f,"tunname",Fe.tunname,"right","start")),ie("g",{class:"tunnel","data-id":e.id,"data-dim":"1",...r},c)}var el=2e4;function tc(s,e,r,n,i){let o=typeof e.raw.label=="string"?{text:e.raw.label}:e.raw.label,t=`floor mono t-${e.kind}`,a={"data-hl":e.id,...n},d=Fe.floor;if(o.at){let u=o.at.length>2?o.at[2]:e.points[0][2];return{svg:s.floorText(o.at[0],o.at[1],u,o.text,t,o.dir??"x",o.anchor??"start",a)}}let c=e.points,p=[];for(let u=0;u+1<c.length;u++){let b=c[u],x=c[u+1];Math.abs(b[2]-x[2])>1e-6||p.push({i:u,len:Math.hypot(x[0]-b[0],x[1]-b[1])})}if(!p.length)return{svg:"",warning:`label "${o.text}" of route "${e.id}" was dropped: the route has no level segment`};let l=o.along?p.filter(u=>u.i===Math.min(o.along-1,c.length-2)):[...p].sort((u,b)=>b.len-u.len),f=.22,m=11/Ve,h=u=>{let b=rs(u,d)/Ve,x,$=1/0,P=0;e:for(let T of l.length?l:p){let M=c[T.i],B=c[T.i+1],E=M[2],D=Math.abs(M[1]-B[1])<1e-6,v=D?Math.min(M[0],B[0]):Math.min(M[1],B[1]),O=D?Math.max(M[0],B[0]):Math.max(M[1],B[1]),S=D?M[1]:M[0],N=o.side==="left"?[-1]:o.side==="right"?[1]:[-1,1],I=[];for(let L=v+.3;L<=Math.max(v+.3,O-b-.2)+1e-9;L+=.4)I.push(L);for(let L=O-b-.2+.4;L<O+.5&&O-v<b+.5;L+=.6)I.push(L);for(let L of N)for(let X of I){if($<=P*.5)break e;let j=L<0?S-f:S+f+m,A,R,C;if(D?(A=X,R=j,C=[re(A,R-m,E),re(A+b,R-m,E),re(A+b,R,E),re(A,R,E)]):(A=j,R=X+b,C=[re(A-m,R,E),re(A-m,R-b,E),re(A,R-b,E),re(A,R,E)]),(D?[[A,R-m],[A+b,R-m],[A+b,R],[A,R]]:[[A-m,R],[A-m,R-b],[A,R-b],[A,R]]).some(([fe,le])=>Math.abs($n(i,fe,le)+.01-E)>.001)){P++;continue}let W=r.hiddenPoly(C),ae=W*50+P*.5,ee=r.budget.spots-- >0;ee||(r.budget.over=!0);let G=ae>=$?1/0:ee?ae+r.costPoly(C,$-ae):ae;P++,G<$&&($=G,x={x:A,y:R,z:E,dir:D?"x":"y",rect:Vt(C),poly:C,hidden:W})}}return x&&x.hidden<6?x:void 0},y=o.text,g=h(y),k;if(!g){let u=o.text.split(/(\s+)/);for(let b=u.length-1;b>0&&!g;b--){let x=u.slice(0,b).join("").trimEnd().replace(/[\s,;:·–-]+$/,"")+"\u2026";if(x.length<6)break;let $=h(x);$&&(g=$,y=x)}k=g?`label of route "${e.id}" shortened to "${y}": no clear floor for the whole text`:`label "${o.text}" of route "${e.id}" was dropped: blocks cover every spot beside it`,g?k+='; give it "along", "side" or "at", or move the nodes apart':k+='; give it "at: [x, y]", or move the nodes apart'}return g?(r.slants.push(g.poly),{svg:s.floorText(g.x,g.y,g.z+.01,y,t,g.dir,"start",a),warning:k}):{svg:"",warning:k}}function sc(s,e,r,n,i){let o=e.on?n.find(p=>p.id===e.on):void 0,t=e.on&&!o?r.byId.get(e.on):void 0,a=e.at,d={"data-id":i,"data-hl":o?.id,"data-dim":o?void 0:"1"},c=e.kind??o?.kind??"control";if(e.floor){let p=a&&a.length>2?a[2]:o?o.points[0][2]:t?t.floor:.36,[l,f]=a?[a[0],a[1]]:o?[o.points[0][0]+.35,o.points[0][1]-.25]:t?[t.box.x0+.3,t.box.y1-.3]:[0,0];return s.floorText(l,f,p+.01,e.floor,`floor mono t-${c}`,e.dir??"x",e.anchor??"start",d)}if(e.face){let p=t?.box,[l,f,m]=a?[a[0],a[1],a[2]??.45]:p?[p.x0+.3,p.y1,p.z0+.13]:[0,0,0];return s.faceText(l,f,m,e.face,"slabname sm",Fe.sm,"left",e.anchor??"start",d)}if(e.label||e.sub){let p=t?.box,l=a?[a[0],a[1],a[2]??.36]:p?[(p.x0+p.x1)/2,(p.y0+p.y1)/2,p.z1+.75]:[0,0,0],[f,m]=re(l[0],l[1],l[2]),h=f+(e.dx??0),y=m-18+(e.dy??0),g=e.anchor??"middle",k="";return e.label&&(k+=s.text(h,y,e.label,"lbl",Fe.lbl,g)),e.sub&&(k+=s.text(h,e.label?y+14:y,e.sub,"sub mono",Fe.sub,g)),ie("g",d,k)}return""}function rc(s){return Math.max(5600,Math.min(12500,2600+s.length*40))}function sl(s,e,r,n,i,o){let t=[],a=(E,D,v,O="error")=>{let S=i.locate(E);t.push({severity:O,message:D,line:S.line,col:S.col,path:E,hint:v})},d=s.steps??[],c=new Set(Object.keys(o.kinds)),p=new Map(n.map(E=>[E.id,E])),l=()=>[...r.byId.keys(),...p.keys()],f=new Map;d.forEach((E,D)=>{E.id&&(f.has(E.id)&&a(`${e}/steps/${D}/id`,`duplicate step id "${E.id}"`),f.set(E.id,D+1))});let m=d.length,h=(E,D)=>{if(typeof E=="number"){if(E<1||E>m){a(D,`there is no step ${E}; this scene has ${m} step(s)`);return}return E}let v=f.get(E);return v===void 0&&a(D,`unknown step "${E}"`+ht(E,f.keys())),v},y=E=>Ts(o,o.kinds[E]?.color??"control"),g=[],k=E=>{g.includes(E)||g.push(E)};for(let E of n)k(E.kind);let u={},b=(E,D,v,O)=>{if(D===void 0&&v===void 0)return;let S=D!==void 0?h(D,O+"/appears"):1,N=v!==void 0?h(v,O+"/disappears"):m+1;u[E]=Array.from({length:m},(I,L)=>L+1>=(S??1)&&L+1<(N??m+1))};for(let E of r.items)b(E.id,E.appears,E.disappears,E.path);for(let E of n)b(E.id,E.raw.appears,E.raw.disappears,E.path);let x=[],$=[],P=[],T=[],M=()=>{for(let E of n){if(E.raw.appears!==void 0||E.raw.disappears!==void 0)continue;let D=[E.from,E.to].map(v=>v&&(u[v.id]??B(v)));D.some(Boolean)&&(u[E.id]=Array.from({length:m},(v,O)=>D.every(S=>!S||S[O])))}},B=E=>{for(let D=E.parent;D;D=D.parent)if(u[D.id])return u[D.id]};return d.forEach((E,D)=>{let v=D+1,O=`${e}/steps/${D}`,S=E.kind??"control";c.has(S)||a(O+"/kind",`unknown flow kind "${S}"`+ht(S,c)),k(S);let N=new Set,I=[];(E.animate??[]).forEach((A,R)=>{let C=Array.isArray(A)?A:[A],K=[];C.forEach((W,ae)=>{let ee=Array.isArray(A)?`${O}/animate/${R}/${ae}`:`${O}/animate/${R}`,G,fe;if(typeof W=="string"){let Q=/^([^:\s]+)\s*(?::\s*(\S+))?$/.exec(W.trim());G=Q?Q[1]:W,fe=Q?.[2]}else{let Q=Object.entries(W)[0];G=Q[0],fe=Q[1]}let le=p.get(G);if(!le){a(ee,`unknown route "${G}"`+ht(G,p.keys()));return}if(fe&&!c.has(fe)){a(ee,`unknown flow kind "${fe}"`+ht(fe,c));return}let q=fe??le.kind;k(q),K.push({route:G,kind:q,color:y(q)}),N.add(G),le.from&&N.add(le.from.id),le.to&&N.add(le.to.id)}),K.length&&I.push(K)});let L=[];(E.pulse??[]).forEach((A,R)=>{let C=r.byId.get(A);if(!C){a(`${O}/pulse/${R}`,`unknown node "${A}"`+ht(A,r.byId.keys()));return}let K,W,ae,ee,G=C.node?ar(r.catalog,C.node.asset):void 0;if(G?.pulse)[K,W,ae,ee]=G.pulse(C.box);else{let q=C.box;K=(q.x0+q.x1)/2,W=(q.y0+q.y1)/2,ae=q.z1,ee=Math.max(22,Math.min(60,(q.x1-q.x0+q.y1-q.y0)*8.5))}let[fe,le]=re(K,W,ae);L.push([fe,le,ee*1.7,ee*.98]),N.add(A)}),(E.highlight??[]).forEach((A,R)=>{!r.byId.has(A)&&!p.has(A)&&a(`${O}/highlight/${R}`,`unknown id "${A}"`+ht(A,l())),N.add(A)});for(let[A,R]of[["show",!0],["hide",!1]])(E[A]??[]).forEach((C,K)=>{if(!r.byId.has(C)&&!p.has(C)){a(`${O}/${A}/${K}`,`unknown id "${C}"`+ht(C,l()));return}let W=u[C]??(u[C]=Array(m).fill(!R));for(let ae=D;ae<m;ae++)W[ae]=R});if((E.say??[]).forEach((A,R)=>{let C,K;if(Array.isArray(A.at))[C,K]=re(A.at[0],A.at[1],A.at[2]??.36);else{let ae=r.byId.get(A.at);if(!ae){a(`${O}/say/${R}/at`,`unknown node "${A.at}"`+ht(A.at,r.byId.keys()));return}let ee=ae.box;[C,K]=re((ee.x0+ee.x1)/2,(ee.y0+ee.y1)/2,ee.z1+.75)}let W=A.kind??S;c.has(W)||a(`${O}/say/${R}/kind`,`unknown flow kind "${W}"`+ht(W,c)),$.push({step:v,x:C+(A.dx??0),y:K+(A.dy??(Array.isArray(A.at)?0:-46)),ax:C,ay:K,text:A.text,kind:W,anchor:A.anchor??"middle"})}),(E.mark??[]).forEach((A,R)=>{if(A.at){P.push({step:v,p:[A.at[0],A.at[1],A.at[2]??.36]});return}let C=A.on?p.get(A.on):void 0;if(!C){a(`${O}/mark/${R}`,A.on?`unknown route "${A.on}"`+ht(A.on,p.keys()):'a mark needs "on: ROUTE" or "at: [x, y]"');return}let K=C.points[C.points.length-1];P.push({step:v,p:[K[0],K[1],K[2]+.6],on:C.id}),N.add(C.id)}),s.badges&&E.badge!==!1){let A=Array.isArray(E.badge)?[E.badge[0],E.badge[1],E.badge[2]??.36]:void 0,R=typeof E.badge=="string"?E.badge:I[0]?.[0]?.route,C=R?p.get(R):void 0;if(!A)if(C)A=nc(C.points);else if(R&&r.byId.get(R)){let K=r.byId.get(R).box;A=[(K.x0+K.x1)/2,(K.y0+K.y1)/2,K.z1+.3]}else typeof E.badge=="string"&&a(`${O}/badge`,`unknown id "${E.badge}"`+ht(E.badge,l()));A&&T.push({step:v,num:E.number??v,kind:S,p:A})}for(let A of[...N])for(let R=r.byId.get(A)?.parent;R;R=R.parent)N.add(R.id);for(let A of r.items)A.region?.kind==="tunnel"&&(A.region.around??[]).some(R=>N.has(R))&&N.add(A.id);let X;if(E.focus?.length){let A=1/0,R=1/0,C=-1/0,K=-1/0;E.focus.forEach((W,ae)=>{let ee=r.byId.get(W);if(!ee){a(`${O}/focus/${ae}`,`unknown node or region "${W}"`+ht(W,r.byId.keys()));return}let G=ee.box;for(let[fe,le,q]of[[G.x0,G.y0,G.z1],[G.x1,G.y0,G.z0],[G.x0,G.y1,G.z0],[G.x1,G.y1,G.z0],[G.x1,G.y0,G.z1],[G.x0,G.y1,G.z1]]){let[Q,Ae]=re(fe,le,q);A=Math.min(A,Q),R=Math.min(R,Ae),C=Math.max(C,Q),K=Math.max(K,Ae)}N.add(W)}),A<1/0&&(X=[Math.round(A-60),Math.round(R-70),Math.round(C+60),Math.round(K+40)])}let j=E.caption??"";x.push({n:v,num:E.number??v,kind:S,color:y(S),heading:E.heading,caption:j,command:E.command??"",phases:I,pulses:L,lit:[...N],duration:E.duration===void 0||E.duration==="auto"?rc(j):E.duration,...X?{focus:X}:{}})}),M(),{steps:x,says:$,marks:P,badges:T,vis:u,diags:t,kindsUsed:g}}function nc(s){let e=s.slice(1).map((n,i)=>Math.hypot(n[0]-s[i][0],n[1]-s[i][1],n[2]-s[i][2])),r=e.reduce((n,i)=>n+i,0)/2;for(let n=0;n<e.length;n++){if(r<=e[n]&&e[n]>0){let i=r/e[n],o=s[n],t=s[n+1];return[o[0]+(t[0]-o[0])*i,o[1]+(t[1]-o[1])*i,o[2]+(t[2]-o[2])*i]}r-=e[n]}return s[0]}function ht(s,e){let r=Ye(s,e);return r?` (did you mean "${r}"?)`:""}var ic=s=>({data:s,locate:()=>({line:0,col:0}),span:()=>{},diags:[]});function rl(s,e,r,n=ic(s),i,o={},t=[]){let a=Es(cn(e),s.roles,s.kinds),d=[],c=new Map;return s.scenes.forEach((p,l)=>{let f=`/scenes/${l}`;if(c.has(p.id)){let u=n.locate(f+"/id");t.push({severity:"error",message:`duplicate scene id "${p.id}"`,line:u.line,col:u.col,path:f+"/id"})}c.set(p.id,l);let m={...s.grid,...p.grid,...o.snap?{snap:o.snap}:{}},h=pn(p,f,n,a,r,s.roles,m.snap);t.push(...h.diags);let y=Go(p,f,h,n,new Set(Object.keys(a.kinds)),m.snap);t.push(...y.diags);let g=sl(p,f,h,y.routes,n,a);t.push(...g.diags),t.push(...ac(p,f,r,n));let k=On({scene:p,layout:h,routes:y.routes,steps:g,theme:a,id:p.id,gridStep:m.step??m.snap??1});for(let u of k.warnings){let b=n.locate(u.path);t.push({severity:"warning",message:u.message,line:b.line,col:b.col,path:u.path})}d.push({id:p.id,raw:p,layout:h,routes:y.routes,steps:g,rendered:k,grid:m,assemble:p.assemble??s.assemble??!1})}),t.sort((p,l)=>p.line-l.line||p.col-l.col),{ok:!t.some(p=>p.severity==="error"),diags:t,doc:s,theme:a,catalog:r,scenes:d,parsed:n,source:i}}function ac(s,e,r,n){let i=[],o=(a,d)=>{let c=n.locate(a);i.push({severity:"warning",message:d,line:c.line,col:c.col,path:a})},t=(a,d)=>{a.nodes?.forEach((c,p)=>{let l=`${d}/nodes/${p}`;(c.deco??ms(r,c.asset).deco??[]).forEach((f,m)=>{typeof f=="object"&&f.icon&&!Ci(f.icon)&&o(c.deco?`${l}/deco/${m}/icon`:l,`node "${c.id}": no icon "${f.icon}" is registered here, so it is drawn as a placeholder`)}),c.face!==void 0&&!fr(c.face)&&o(`${l}/face`,`node "${c.id}": no screen face "${c.face}" is registered here, so it is drawn as a placeholder`)}),a.regions?.forEach((c,p)=>t(c,`${d}/regions/${p}`))};return t(s,e),i}var al=new Set(["fill","stroke","stroke-width","stroke-dasharray","stroke-linecap","stroke-linejoin","opacity","fill-opacity","stroke-opacity","font-size","font-weight","font-family","letter-spacing","text-anchor","dominant-baseline","paint-order","display","stop-color","stop-opacity"]),oc=new Set("cursor pointer-events transition animation transform-box transform-origin user-select".split(" "));function lc(s,e){let r={classes:[],not:[],attrs:[],child:e},n=s,i=t=>{let a=t.exec(n);return a&&(n=n.slice(a[0].length)),a},o=i(/^[a-zA-Z][\w-]*/);for(o?r.tag=o[0]:i(/^\*/);n;){let t;if(t=i(/^\.([\w-]+)/))r.classes.push(t[1]);else if(t=i(/^:not\(\.([\w-]+)\)/))r.not.push(t[1]);else if(t=i(/^\[([\w-]+)(?:="([^"]*)")?\]/))r.attrs.push([t[1],t[2]]);else throw new Error(`resolve: a selector it doesn't know: ${s}`)}return r}function pc(s){let e=s.replace(/\/\*[\s\S]*?\*\//g,"").replace(/@keyframes[^{]*\{(?:[^{}]*\{[^}]*\})*[^{}]*\}/g,"").replace(/@media[^{]*\{(?:[^{}]*\{[^}]*\})*[^{}]*\}/g,"");if(/@/.test(e.replace(/"[^"]*"/g,"")))throw new Error("resolve: an at-rule it doesn't know");let r=[];for(let n of e.matchAll(/([^{}]+)\{([^{}]*)\}/g)){let i=n[2].split(";").map(o=>o.trim()).filter(Boolean).map(o=>{let t=o.indexOf(":"),a=o.slice(0,t).trim(),d=o.slice(t+1).trim();return[a,d.replace(/\s*!important$/,""),/!important$/.test(d)]});for(let o of i)if(!o[0].startsWith("--")&&!al.has(o[0])&&!oc.has(o[0]))throw new Error(`resolve: a property it doesn't know: ${o[0]}`);for(let o of n[1].split(",").map(t=>t.trim()).filter(Boolean)){if(o.includes(":root")||o.includes("::")||/^(html|body)\b/.test(o))continue;let a=o.replace(/\s*>\s*/g," >").split(/\s+/).map(c=>lc(c.replace(/^>/,""),c.startsWith(">"))),d=a.reduce((c,p)=>c+10*(p.classes.length+p.not.length+p.attrs.length)+(p.tag?1:0),0);r.push({parts:a,spec:d,order:r.length,decls:i})}}return r}function cc(s){let e={name:"#root",attrs:[],children:[]},r=e;for(let n of s.matchAll(/<\/[a-zA-Z][\w:-]*>|<([a-zA-Z][\w:-]*)((?:\s+[\w:-]+="[^"]*")*)\s*(\/?)>|([^<]+)/g)){if(n[4]!==void 0){r.children.push(n[4]);continue}if(n[1]===void 0){r=r.parent;continue}let i={name:n[1],attrs:[...n[2].matchAll(/([\w:-]+)="([^"]*)"/g)].map(o=>[o[1],o[2]]),children:[],parent:r};r.children.push(i),n[3]||(r=i)}return e.children[0]}var ol=s=>typeof s=="string"?s:`<${s.name}${s.attrs.map(([e,r])=>` ${e}="${r}"`).join("")}${s.children.length||s.name==="g"?`>${s.children.map(ol).join("")}</${s.name}>`:"/>"}`,ur=(s,e)=>s.attrs.find(r=>r[0]===e)?.[1],Rs=(s,e,r)=>{let n=s.attrs.find(i=>i[0]===e);n?n[1]=r:s.attrs.push([e,r])},fc=s=>(ur(s,"class")??"").split(/\s+/).filter(Boolean);function mc(s,e){if(e.tag&&e.tag!==s.name)return!1;let r=fc(s);return e.classes.every(n=>r.includes(n))&&!e.not.some(n=>r.includes(n))&&e.attrs.every(([n,i])=>{let o=ur(s,n);return o!==void 0&&(i===void 0||o===i)})}function Yi(s,e,r=e.length-1){if(!mc(s,e[r]))return!1;if(r===0)return!0;let n=s.parent;if(e[r].child)return!!n&&n.name!=="#root"&&Yi(n,e,r-1);for(;n&&n.name!=="#root";n=n.parent)if(Yi(n,e,r-1))return!0;return!1}var is=s=>s.endsWith("%")?parseFloat(s)/100:parseFloat(s);function dc(s,e,r,n){let i=(1-Math.abs(2*r-1))*e,o=(s%360+360)%360/60,t=i*(1-Math.abs(o%2-1)),a=r-i/2,[d,c,p]=o<1?[i,t,0]:o<2?[t,i,0]:o<3?[0,i,t]:o<4?[0,t,i]:o<5?[t,0,i]:[i,0,t];return[(d+a)*255,(c+a)*255,(p+a)*255,n]}function ll(s,e){let r=[],n=0,i="";for(let o of s)o==="("&&n++,o===")"&&n--,o===e&&n===0?(r.push(i.trim()),i=""):i+=o;return[...r,i.trim()].filter(Boolean)}var nl={transparent:[0,0,0,0],black:[0,0,0,1],white:[255,255,255,1]};function An(s){let e=s.trim();if(Object.hasOwn(nl,e))return nl[e];let r=/^#([0-9a-f]{3,8})$/i.exec(e);if(r){let n=r[1].length<6?[...r[1]].map(i=>i+i).join(""):r[1];return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),n.length===8?parseInt(n.slice(6),16)/255:1]}if(r=/^hsla?\((.*)\)$/.exec(e),r){let[n,i]=r[1].split("/").map(c=>c.trim()),[o,t,a,d]=n.split(/[\s,]+/);return dc(parseFloat(o),is(t),is(a),i!==void 0?is(i):d!==void 0?is(d):1)}if(r=/^rgba?\((.*)\)$/.exec(e),r){let[n,i,o,t]=r[1].split(/[\s,/]+/).filter(Boolean);return[is(n),is(i),is(o),t===void 0?1:is(t)]}if(r=/^color-mix\(in srgb\s*,(.*)\)$/.exec(e),r){let[n,i]=ll(r[1],",").map(p=>{let l=/^(.*?)\s+([\d.]+)%$/.exec(p);return l?{c:An(l[1]),p:Number(l[2])/100}:{c:An(p),p:void 0}});if(!n?.c||!i?.c)return;let o=n.p??(i.p===void 0?.5:1-i.p),t=i.p??1-o,a=o+t,d=(n.c[3]*o+i.c[3]*t)/a,c=p=>d===0?0:(n.c[p]*n.c[3]*o+i.c[p]*i.c[3]*t)/a/d;return[c(0),c(1),c(2),d*Math.min(1,a)]}}var il=s=>"#"+[s[0],s[1],s[2]].map(e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")).join(""),uc=s=>String(Math.round(s*1e4)/1e4);function Wi(s,e,r=0){if(r>20)throw new Error(`resolve: a custom property in a loop: ${s}`);let n=s.indexOf("var(");if(n<0)return s;let i=0,o=n+3;do s[o]==="("&&i++,s[o]===")"&&i--,o++;while(i>0&&o<s.length);let[t,...a]=ll(s.slice(n+4,o-1),","),d=e.get(t)??(a.length?a.join(","):void 0);if(d===void 0)throw new Error(`resolve: no value for ${t}`);return Wi(s.slice(0,n)+d+s.slice(o),e,r+1)}var hc=s=>new Map(s.split(";").filter(Boolean).map(e=>{let r=e.indexOf(":");return[e.slice(0,r).trim(),e.slice(r+1).trim()]})),Gi={sans:"system-ui, -apple-system, Segoe UI, Roboto, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"};function Mn(s,e){let r=Io(e.theme),n=e.fonts??Gi,i=pc(`.mono{font-family:${n.mono.replace(/"/g,"")}}
233
+ ${r.rest}
234
+ ${e.css}`),o=cc(s);Rs(o,"font-family",n.sans.replace(/"/g,""));let t=(a,d)=>{let c=d,p=new Map,l=(h,y,g)=>{let k=p.get(h);(!k||g[0]>k.rank[0]||g[0]===k.rank[0]&&(g[1]>k.rank[1]||g[1]===k.rank[1]&&g[2]>=k.rank[2]))&&p.set(h,{v:y,rank:g})};for(let h of i)if(Yi(a,h.parts))for(let[y,g,k]of h.decls)l(y,g,[k?1:0,h.spec,h.order]);let f=ur(a,"style");if(f){for(let h of f.split(";").map(y=>y.trim()).filter(Boolean)){let y=h.indexOf(":");l(h.slice(0,y).trim(),h.slice(y+1).trim(),[0,1e6,0])}a.attrs=a.attrs.filter(h=>h[0]!=="style")}for(let[h,y]of p)h.startsWith("--")&&(c===d&&(c=new Map(d)),c.set(h,y.v));let m={};for(let[h,y]of p){if(!al.has(h))continue;let g=Wi(y.v,c).trim();if(h==="fill"||h==="stroke"||h==="stop-color"){if(g==="none"||g==="currentColor"||g==="inherit"||g.startsWith("url(")){Rs(a,h,g);continue}let k=An(g);if(!k)throw new Error(`resolve: a colour it doesn't know: ${g}`);Rs(a,h,il(k)),k[3]!==1&&(m[h==="stop-color"?"stop":h]=k[3])}else Rs(a,h,h==="letter-spacing"||h==="font-size"||h==="stroke-width"?g:g.replace(/"/g,""))}for(let[h,y]of Object.entries(m))Rs(a,`${h}-opacity`,uc(y*Number(ur(a,`${h}-opacity`)??1)));ur(a,"opacity")==="0"&&(Rs(a,"display","none"),a.attrs=a.attrs.filter(h=>h[0]!=="opacity"));for(let h of a.attrs)if(/var\(|hsl\(|color-mix/.test(h[1])){let y=Wi(h[1],c),g=An(y);h[1]=g?il(g):y}for(let h of a.children)typeof h!="string"&&t(h,c)};return t(o,hc(e.mode==="dark"?`${r.light};${r.dark}`:r.light)),ol(o)}var cl=s=>{if(s&&typeof s=="object"){Object.freeze(s);for(let e of Object.values(s))cl(e)}return s},Nn=[86,81,76],yc=["send","reply","token","blocked","user","event","control","planned"],at=cl({light:{paper:"#ffffff",ink:"#141414",steps:[{top:"#f4f4f4",left:"#dcdcdc",right:"#c4c4c4",edge:"#3a3a3a"},{top:"#dedede",left:"#bfbfbf",right:"#a2a2a2",edge:"#2e2e2e"},{top:"#bcbcbc",left:"#9a9a9a",right:"#7e7e7e",edge:"#222222"},{top:"#8f8f8f",left:"#707070",right:"#565656",edge:"#141414"}]},dark:{paper:"#161616",ink:"#f2f2f2",steps:[{top:"#2a2a2a",left:"#222222",right:"#1b1b1b",edge:"#b8b8b8"},{top:"#454545",left:"#383838",right:"#2c2c2c",edge:"#c8c8c8"},{top:"#6a6a6a",left:"#565656",right:"#444444",edge:"#dadada"},{top:"#9c9c9c",left:"#808080",right:"#686868",edge:"#141414"}]},patterns:["none","hatch","hatch-wide","dots"],rhythms:[{dash:[],width:2.6},{dash:[9,4],width:2.4},{dash:[7,6],width:2.4},{dash:[3,6],width:2.4},{dash:[1.5,3.5],width:2.6},{dash:[10,3,2,3],width:2.4},{dash:[],width:1.4},{dash:[7,6],width:1.4},{dash:[3,3],width:1.6},{dash:[14,4],width:1.8}],kindOrder:yc,thresholds:Nn,darkWidthAdd:.4}),gc=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,bc=/^hsl\(\s*([+-]?(?:\d+\.?\d*|\.\d+))\s+([+-]?(?:\d+\.?\d*|\.\d+))%\s+([+-]?(?:\d+\.?\d*|\.\d+))%\s*\)$/i;function wc(s){if(typeof s!="string")throw new Error(`mono: invalid colour "${String(s)}"`);let e=s.trim(),r=gc.exec(e);if(r){let i=r[1];return i.length===3?[parseInt(i[0]+i[0],16)/255,parseInt(i[1]+i[1],16)/255,parseInt(i[2]+i[2],16)/255]:[parseInt(i.slice(0,2),16)/255,parseInt(i.slice(2,4),16)/255,parseInt(i.slice(4,6),16)/255]}let n=bc.exec(e);if(n){let i=Number(n[1]),o=Number(n[2]),t=Number(n[3]);if(!Number.isFinite(i)||o<0||o>100||t<0||t>100)throw new Error(`mono: invalid colour "${s}"`);let a=(i%360+360)%360,d=o/100,c=t/100,p=d*Math.min(c,1-c),l=f=>{let m=(f+a/30)%12;return c-p*Math.max(-1,Math.min(m-3,9-m,1))};return[l(0),l(8),l(4)]}throw new Error(`mono: invalid colour "${s}"`)}function Ji(s){let[e,r,n]=wc(s),i=o=>o<=.04045?o/12.92:((o+.055)/1.055)**2.4;return .2126*i(e)+.7152*i(r)+.0722*i(n)}function Hi(s){let e=Ji(s);return e>216/24389?116*Math.cbrt(e)-16:24389/27*e}function Xi(s,e){let r=Ji(s),n=Ji(e);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}var kc=new Set(at.patterns),xc=new Map(at.kindOrder.map((s,e)=>[s,e])),$c=(s,e)=>s<e?-1:s>e?1:0,pl=s=>[...new Set(s)].sort($c),Sc=s=>Math.round(s*100)/100;function Pc(s){return s>=Nn[0]?0:s>=Nn[1]?1:s>=Nn[2]?2:3}function vc(s){if(s.roles)for(let[e,r]of Object.entries(s.roles)){if(r.step!==void 0&&(typeof r.step!="number"||!Number.isInteger(r.step)||r.step<0||r.step>3))throw new Error(`mono: invalid step "${String(r.step)}" for role "${e}"`);if(r.pattern!==void 0&&(typeof r.pattern!="string"||!kc.has(r.pattern)))throw new Error(`mono: invalid pattern "${String(r.pattern)}" for role "${e}"`)}if(s.kinds)for(let[e,r]of Object.entries(s.kinds)){if(r.dash!==void 0&&(!Array.isArray(r.dash)||!r.dash.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>=0)))throw new Error(`mono: invalid dash "${String(r.dash)}" for kind "${e}"`);if(r.width!==void 0&&(typeof r.width!="number"||!Number.isFinite(r.width)||r.width<=0))throw new Error(`mono: invalid width "${String(r.width)}" for kind "${e}"`)}}function fl(s,e,r,n){if(e!=="light"&&e!=="dark")throw new Error(`mono: invalid mode "${String(e)}"`);n&&vc(n);let i=at[e],o=[],t=s.light["l-top"],a=pl(r?.roles??Object.keys(s.roles)),d=new Map,c=[[],[],[],[]];for(let g of a){let k=n?.roles?.[g]?.step,u;if(k!==void 0)u=k;else{let b=s.roles[g];if(!b)throw new Error(`mono: unknown role "${g}"`);if(typeof t!="string")throw new Error('mono: theme.light is missing "l-top"');u=Pc(Hi(`hsl(${b.h} ${b.s}% ${t})`))}d.set(g,u),c[u].push(g)}let p=new Map;for(let g=0;g<c.length;g++){let k=c[g];for(let u=0;u<k.length;u++){let b=k[u],x=n?.roles?.[b]?.pattern;if(x!==void 0)p.set(b,x);else{let $=u%at.patterns.length,P=at.patterns[$];if(p.set(b,P),u>=at.patterns.length){let T=k.slice(0,u).find(M=>p.get(M)===P);T!==void 0&&o.push(`role "${b}" wraps on step ${g} to pattern "${P}", matching "${T}"`)}}}}let l={};for(let g of a){let k=d.get(g),u=p.get(g),b=i.steps[k];l[g]={step:k,pattern:u,top:b.top,left:b.left,right:b.right,edge:b.edge}}let f=pl(r?.kinds??Object.keys(s.kinds)),m=e==="dark"?at.darkWidthAdd:0,h={},y=0;for(let g of f){let k=n?.kinds?.[g],u=xc.get(g),b;if(u!==void 0)b=u;else if(b=at.kindOrder.length+y,y++,b>=at.rhythms.length){let T=b%at.rhythms.length;(!k||k.dash===void 0||k.width===void 0)&&o.push(`kind "${g}" exceeds the ${at.rhythms.length} line rhythms; reusing rhythm ${T}`),b=T}let x=at.rhythms[b],$=k?.dash!==void 0?[...k.dash]:[...x.dash],P=k?.width!==void 0?k.width:Sc(x.width+m);h[g]={dash:$,width:P}}return{mode:e,paper:i.paper,ink:i.ink,roles:l,kinds:h,warnings:o}}var zn=s=>`${Math.round(parseInt(s.slice(1,3),16)/255*1e4)/100}%`,Qi=(s,e,r)=>{let[n,i]=[s,e].map(t=>parseInt(t.slice(1,3),16)),o=Math.round(n+(i-n)*r).toString(16).padStart(2,"0");return`#${o}${o}${o}`};function Oc(s,e,r){let n=new Set([...s.matchAll(/\sclass="([^"]*)"/g)].flatMap(i=>i[1].split(/\s+/)).filter(i=>i.startsWith("k-")).map(i=>i.slice(2)));return{roles:Object.keys(e.roles).filter(i=>n.has(i)),kinds:[...new Set(r)].filter(i=>i in e.kinds)}}function Ac(s,e){let r=at[e.mode].steps,n=(c,p)=>e.roles[c]??r[p],i={};for(let[c,p]of Object.entries(s.light))i[c]=/%$/.test(p)?p:e.ink;let o=n("slab",0),t=n("pad",0);Object.assign(i,{bg:e.paper,surface:e.paper,on:e.paper,ink:e.ink,muted:Qi(e.paper,e.ink,.72),line:Qi(e.paper,e.ink,.3),"code-bg":Qi(e.paper,e.ink,.06),"slab-top":o.top,"slab-l":o.left,"slab-r":o.right,"pad-top":t.top});let a=Object.fromEntries(Object.entries(s.roles).map(([c])=>[c,{h:0,s:0}])),d=Object.fromEntries(Object.entries(s.kinds).map(([c,p])=>[c,{...p,color:e.ink}]));return Es({...s,light:i,dark:i,roles:a,kinds:d})}function Mc(s){let e="";for(let[r,n]of Object.entries(s.roles))e+=`.k-${r}{--s:0%;--l-top:${zn(n.top)};--l-left:${zn(n.left)};--l-right:${zn(n.right)};--l-edge:${zn(n.edge)}}
235
+ `;for(let[r,n]of Object.entries(s.kinds))e+=`.flow.f-${r}{stroke-width:${n.width}${n.dash.length?`;stroke-dasharray:${n.dash.join(" ")}`:";stroke-dasharray:none"}}
236
+ `;return e}var Nc={hatch:{size:6,draw:(s,e)=>`<path d="M0,6L6,0M-1.5,1.5L1.5,-1.5M4.5,7.5L7.5,4.5" stroke="${s}" stroke-width="${e}" fill="none"/>`},"hatch-wide":{size:12,draw:(s,e)=>`<path d="M0,0L12,12M-3,9L3,15M9,-3L15,3" stroke="${s}" stroke-width="${e}" fill="none"/>`},dots:{size:8,draw:(s,e)=>`<circle cx="2" cy="2" r="${e+.2}" fill="${s}"/><circle cx="6" cy="6" r="${e+.2}" fill="${s}"/>`}},zc=s=>Math.round(s*100)/100,Ic=(s,e)=>Xi(s,e.ink)>=Xi(s,e.paper)?e.ink:e.paper;function ml(s,e,r){let n=new Map,i=(d,c)=>{let p=`${r}-mono-${d}-${c.slice(1)}`,l=Nc[d],f=e.mode==="dark"?1.2:.9;return n.has(p)||n.set(p,`<pattern id="${p}" width="${l.size}" height="${l.size}" patternUnits="userSpaceOnUse">${l.draw(c,zc(f))}</pattern>`),p},o=[],t="",a="";for(let d of s.matchAll(/<\/[a-zA-Z][\w:-]*>|<([a-zA-Z][\w:-]*)((?:\s+[\w:-]+="[^"]*")*)\s*(\/?)>|[^<]+/g)){if(t+=d[0],d[0].startsWith("</")){o.pop();continue}if(d[1]===void 0)continue;let c=(/\sclass="([^"]*)"/.exec(d[2])?.[1]??"").split(/\s+/);o.length===1&&(a=c.find(y=>y.startsWith("g-"))??"");let p=c.find(y=>y.startsWith("k-"))?.slice(2)??o.at(-1);if(d[3]||o.push(c.includes("ghost")?"":p),!d[3]||d[1]!=="polygon"&&d[1]!=="path"||!p||!c.some(y=>y==="top"||y==="lft"||y==="rgt")||a==="g-base"&&!c.includes("rgt"))continue;let l=Object.hasOwn(e.roles,p)?e.roles[p].pattern:"none",f=/\sfill="(#[0-9a-f]{6})"/.exec(d[2])?.[1],m=/\s(points|d)="[^"]*"/.exec(d[2])?.[0];if(l==="none"||!f||!m)continue;let h=/\sfill-opacity="[^"]*"/.exec(d[2])?.[0]??"";t+=`<${d[1]}${m} class="mono-pattern" fill="url(#${i(l,Ic(f,e))})" stroke="none"${h}/>`}return t=t.replace(/#([0-9a-f]{6})\b/g,(d,c)=>c.slice(0,2)===c.slice(2,4)&&c.slice(2,4)===c.slice(4,6)?d:Ec(d)),n.size&&(t=t.replace(/<defs\/>|<defs>/,d=>d==="<defs/>"?`<defs>${[...n.values()].join("")}</defs>`:d+[...n.values()].join(""))),t}function Ec(s){let e=Hi(s),r=e>8?((e+16)/116)**3:e/(24389/27),n=r<=.0031308?r*12.92:1.055*r**(1/2.4)-.055,i=Math.max(0,Math.min(255,Math.round(n*255))).toString(16).padStart(2,"0");return`#${i}${i}${i}`}function dl(s,e,r,n,i){let o=fl(e,r,Oc(s,e,n),i);return{look:o,theme:Ac(e,o),css:Mc(o)}}var ul=29.09090909090909,Tc={solid:[9,7],dashed:[7,6],dotted:[3,6]},jc=["blocked","planned"];function hl(s,e={}){return(e.still??jc).includes(s)?void 0:e.dash??e.kinds?.[s]?.ants??Tc[e.kinds?.[s]?.dash??"solid"]}function In(s){let e=s?.ants;return e?e===!0?{}:Array.isArray(e)?{ids:e}:e:void 0}var kl=["edge","drop","rise","fly","pop","scatter","build","fade"],xl=["explode","lift-off","sink","scatter","fly-out","collapse","fade","reverse"],$l=["by-depth","by-layer","by-region","by-flow","as-listed","random"];var yt=s=>Math.round(s*100)/100||0,Qe=s=>Math.round(s*1e4)/1e4||0;function na(s){let e=i=>{let o=0;for(let t=i.parent;t;t=t.parent)o++;return o},r=i=>{let o=[];for(let t=i;t;t=t.parent){let a=(t.region??t.node)?.motion;a&&o.unshift(a)}return o.length?Object.assign({},...o):void 0},n=new Set(s.layout.items.filter(i=>i.region&&s.layout.catalog&&s.rendered.svg.includes(`class="tunnel" data-id="${i.id}"`)).map(i=>i.id));return{viewBox:s.rendered.viewBox,pieces:s.layout.items.map(i=>{let o=i.box,t=re((o.x0+o.x1)/2,(o.y0+o.y1)/2,o.z0),a=r(i);return{id:i.id,kind:i.type,...i.parent?{parent:i.parent.id}:{},depth:e(i),layer:n.has(i.id)?2:i.type==="region"?0:1,key:yt(o.x0+o.y0+o.z0*.01),bbox:Vt(Xe(o)),foot:[yt(t[0]),yt(t[1])],base:[re(o.x0,o.y1,o.z0),re(o.x1,o.y1,o.z0),re(o.x1,o.y0,o.z0)].map(d=>[yt(d[0]),yt(d[1])]),...a?{motion:a}:{}}}),routes:s.routes.filter(i=>s.rendered.paths[i.id]).map(i=>({id:i.id,path:s.rendered.paths[i.id],...Rc(i.raw)})),notes:Object.fromEntries((s.raw.notes??[]).map((i,o)=>[`${s.id}-note-${o}`,i.on])),intro:s.rendered.assembly}}var yl=s=>typeof s=="string"?s.split(".")[0]:void 0,Rc=s=>{let e=yl(s.from),r=yl(s.to);return{...e?{from:e}:{},...r?{to:r}:{}}},En=(s,e,r,n)=>i=>{if(i<=0)return 0;if(i>=1)return 1;let o=(d,c,p)=>3*d*p*(1-p)**2+3*c*p*p*(1-p)+p**3,t=0,a=1;for(let d=0;d<40;d++){let c=(t+a)/2;o(s,r,c)<i?t=c:a=c}return o(e,n,(t+a)/2)},ea={linear:s=>s,ease:En(.42,0,.58,1),"ease-in":En(.42,0,1,1),"ease-out":En(0,0,.58,1),settle:En(.16,.84,.3,1),spring:s=>s<=0?0:s>=1?1:1-Math.exp(-6*s)*Math.cos(9.5*s)*(1-s),bounce:s=>{if(s<=0)return 0;if(s>=1)return 1;let e=7.5625,r=2.75;return s<1/r?e*s*s:s<2/r?e*(s-1.5/r)**2+.75:s<2.5/r?e*(s-2.25/r)**2+.9375:e*(s-2.625/r)**2+.984375}};function sa(s){let e=s>>>0;return()=>{e=e+1831565813>>>0;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}var gl=s=>{let e=2166136261;for(let r=0;r<s.length;r++)e^=s.charCodeAt(r),e=Math.imul(e,16777619);return e>>>0},vt=s=>Math.max(0,Math.min(1,s)),Tn=24;function ta(s,e,r){let[n,i,o,t]=e;return r==="left"?[-(s.x+s.w-n)-Tn,0]:r==="right"?[n+o-s.x+Tn,0]:r==="top"?[0,-(s.y+s.h-i)-Tn]:[0,i+t-s.y+Tn]}function _c(s,e,r={}){let n=s.pieces,i=new Map(n.map(y=>[y.id,y])),o=(y,g)=>y.depth-g.depth||y.key-g.key;if(e==="as-listed")return[...n];if(e==="random"){let y=sa(r.seed??1);return n.map(g=>[y(),g]).sort((g,k)=>g[0]-k[0]).map(g=>g[1])}if(e==="by-layer")return[...n].sort((y,g)=>y.layer-g.layer||o(y,g));if(e==="by-depth")return[...n].sort((y,g)=>y.key-g.key||y.depth-g.depth);let t=new Map;for(let y of[...n].sort(o)){let g=t.get(y.parent)??[];g.push(y),t.set(y.parent,g)}let a=[],d=new Set,c=y=>{if(d.has(y.id))return;let g=y.parent?i.get(y.parent):void 0;g&&c(g),d.add(y.id),a.push(y)};if(e==="by-region"){let y=g=>{for(let k of t.get(g)??[])c(k),y(k.id)};return y(),a}let p=new Map,l=new Set;for(let y of s.routes)y.from&&y.to&&(p.set(y.from,[...p.get(y.from)??[],y.to]),l.add(y.to));let f=r.source??s.routes.find(y=>y.from&&!l.has(y.from))?.from??s.routes[0]?.from,m=f?[f]:[],h=new Set(m);for(;m.length;){let y=m.shift(),g=i.get(y);g&&c(g);for(let k of p.get(y)??[])h.has(k)||(h.add(k),m.push(k))}for(let y of[...n].sort(o))c(y);return a}var Cc={edge:"settle",drop:"settle",rise:"ease-out",fly:"settle",pop:"spring",scatter:"settle",build:"ease-out",fade:"linear",explode:"ease-in","lift-off":"ease-in",sink:"ease-in","fly-out":"ease-in",collapse:"ease-in"},Lc={"lift-off":"lift",sink:"rise",scatter:"scatter","fly-out":"edge",fade:"fade",explode:"explode",collapse:"collapse"};function Sl(s,e,r={}){let n=r.seed??1,i=e==="disassemble",o=i&&r.style==="reverse",t=j=>{if(!i)return j.motion?.style??r.style??"edge";let A=j.motion?.out??r.style??"fly-out";return A==="reverse"?j.motion?.style??r.of??"edge":Lc[A]},a=j=>i?j.motion?.out??r.style??"fly-out":t(j),d=!i&&!r.order&&r.stagger===void 0&&r.piece===void 0&&r.overlap===void 0&&(r.style??"edge")==="edge",c=r.order??(r.style==="build"?"by-layer":"by-depth"),p=[],l,f,m=(j,A,R)=>{let C=t(j),K=j.motion?.easing??r.easing??Cc[i&&a(j)!=="reverse"?a(j):C]??"ease";return{p:j,delay:A+(j.motion?.delay??0),dur:Math.max(1,j.motion?.duration??R),style:C,curve:ea[K],from:j.motion?.from??r.from??"left"}};if(d){let j=new Map(s.pieces.map(A=>[A.id,A]));for(let A of s.intro.pieces){let R=j.get(A.id);R&&p.push(m(R,A.delay,A.dur))}l=s.intro.routes.map(A=>({...A})),f={...s.intro.labels}}else{let j=_c(s,c,{seed:n,source:r.source}),A=r.piece??600,R=r.stagger??Math.min(70,900/Math.max(1,j.length)),C=vt(r.overlap??.5),K=o||i?[...j].reverse():j,W=Math.min(30,300/Math.max(1,s.routes.length)),ae=400,ee=400;if(i){f={delay:0,dur:ee};let G=ee*(1-C);l=[...s.routes].reverse().map((q,Q)=>({id:q.id,delay:G+Q*W,dur:ae}));let fe=Math.max(G,...l.map(q=>q.delay+q.dur)),le=Math.max(0,fe-C*ae);K.forEach((q,Q)=>p.push(m(q,le+Q*R,A)))}else{K.forEach((q,Q)=>p.push(m(q,Q*R,A)));let G=Math.max(0,...p.map(q=>q.delay+q.dur)),fe=Math.max(0,G-C*A);l=s.routes.map((q,Q)=>({id:q.id,delay:fe+Q*W,dur:ae}));let le=Math.max(fe,...l.map(q=>q.delay+q.dur));f={delay:Math.max(0,le-C*ee),dur:ee}}}let h=r.pulses&&s.routes.length?700:0;if(h&&i)for(let j of[...p,...l,f])j.delay+=h;let y=Math.max(1,...p.map(j=>j.delay+j.dur),...l.map(j=>j.delay+j.dur),f.delay+f.dur),g=i?0:y;h&&!i&&(y+=h);let k=r.duration!==void 0?Math.max(1,r.duration)/y:1;for(let j of[...p,...l,f])j.delay=yt(j.delay*k),j.dur=Math.max(.01,yt(j.dur*k));let u=r.duration!==void 0?Math.max(1,r.duration):Math.max(1,yt(y)),b=new Map(p.map(j=>[j.p.id,j])),x=new Map(l.map(j=>[j.id,j])),[$,P,T,M]=s.viewBox,B=[$+T/2,P+M/2],E=j=>[j.x+j.w/2,j.y+j.h/2],D=(j,A)=>{let R=r.point;if(Array.isArray(R))return R;if(R==="region"||A==="collapse"&&R===void 0&&j.parent){let C=s.pieces.find(K=>K.id===j.parent);return C?C.foot:B}if(typeof R=="string"){let C=s.pieces.find(K=>K.id===R);if(C)return C.foot}return B};function v(j,A,R){let{p:C}=j,K=C.bbox,W=1-A,ae=(ee,G)=>({dx:yt(ee*W),dy:yt(G*W)});switch(j.style){case"drop":return ae(...ta(K,s.viewBox,"top"));case"lift":return ae(...ta(K,s.viewBox,"top"));case"fly":return ae(...ta(K,s.viewBox,j.from));case"rise":{let ee=K.h*W,[G,fe,le]=C.base,q=K.y-K.h-4;return{...ae(0,K.h),clip:[[G[0],G[1]-ee],[fe[0],fe[1]-ee],[le[0],le[1]-ee],[le[0]+2,q-ee],[G[0]-2,q-ee]].map(Q=>[yt(Q[0]),yt(Q[1])])}}case"pop":return{scale:Qe(Math.max(0,A)),about:C.foot,opacity:Qe(vt(R*4))};case"scatter":{let ee=sa((n^gl(C.id))>>>0),G=ee()*Math.PI*2,fe=.35+ee()*.65;return{...ae(Math.cos(G)*T*fe*.6,Math.sin(G)*M*fe*.6),opacity:Qe(vt(A*1.6))}}case"build":return{...ae(0,-18),opacity:Qe(vt(A))};case"fade":return{opacity:Qe(vt(A))};case"explode":{let ee=D(C,"explode"),G=E(K),fe=G[0]-ee[0],le=G[1]-ee[1],q=Math.hypot(fe,le),Q=sa((n^gl(C.id))>>>0),Ae=Q()*Math.PI*2,Me=q>1?[fe/q,le/q]:[Math.cos(Ae),Math.sin(Ae)],Ue=Math.hypot(T,M)+Math.max(K.w,K.h);return ae(Me[0]*Ue,Me[1]*Ue)}case"collapse":{let ee=D(C,"collapse");return{...ae(ee[0]-C.foot[0],ee[1]-C.foot[1]),scale:Qe(Math.max(0,A)),about:C.foot,opacity:Qe(vt(A*3))}}default:{let ee=Pn(K,s.viewBox);return ae(ee.dx,ee.dy)}}}let O=(j,A,R)=>{let C=vt((j-A)/R);return i?1-C:C},S={opacity:0},N=r.connectors??"draw",I=r.labels??"fade",L=[...s.pieces.map(j=>j.id),...s.routes.map(j=>j.id),...Object.keys(s.notes)];function X(j){let A=Math.max(0,Math.min(u,Number.isFinite(j)?j:0));if(i?A<=0:A>=u)return{};let R=i?A>=u:A<=0,C={},K={},W={};for(let le of p){let q=R?0:O(A,le.delay,le.dur);q<=0?C[le.p.id]=S:q<1&&(C[le.p.id]=v(le,i?1-le.curve(1-q):le.curve(q),q))}for(let le of s.routes){let q=x.get(le.id),Q=R||!q?0:O(A,q.delay,q.dur);Q<=0?K[le.id]={opacity:0,drawn:0}:Q<1&&(K[le.id]=N==="fade"?{opacity:Qe(Q)}:N==="grow"?{drawn:Qe(Q),by:"grow"}:{drawn:Qe(ea["ease-out"](Q))})}let ae=R?0:O(A,f.delay,f.dur),ee=ae<=0?S:ae>=1?void 0:I==="type"?{typed:Qe(ae)}:{opacity:Qe(ae)};for(let le of L){let q=ee;if(I==="with-piece"){let Q=Object.hasOwn(s.notes,le)?s.notes[le]:le,Ae=Q===void 0?void 0:b.get(Q)??x.get(Q);if(Ae){let Me=R?0:O(A,Ae.delay,Ae.dur);q=Me<=0?S:Me>=1?void 0:{opacity:Qe(Me)}}}q&&(W[le]=q)}let G=[];if(h&&!R){let le=(A-g*k)/(h*k);if(le>0&&le<1)for(let q of s.routes)G.push({route:q.id,at:Qe(ea.ease(le))})}let fe=le=>Object.keys(le).length>0;return{...fe(C)?{items:C}:{},...fe(W)?{labels:W}:{},...fe(K)?{routes:K}:{},...ae<1?{marks:{opacity:Qe(Math.max(0,ae))}}:{},...G.length?{tokens:G}:{}}}return{kind:e,duration:u,pieces:p.map(j=>({id:j.p.id,delay:j.delay,dur:j.dur,style:a(j.p)})),routes:l,labels:f,at:X}}var ze=s=>{let e=s.toFixed(2);return e==="-0.00"?"0":String(Number(e))},Dc=(s,e)=>`translate(${ze(s[0])} ${ze(s[1])}) scale(${Number(e.toFixed(4))}) translate(${ze(-s[0])} ${ze(-s[1])})`,ia=s=>[...s.matchAll(/(-?[\d.]+),(-?[\d.]+)/g)].map(e=>[Number(e[1]),Number(e[2])]),aa=s=>s.slice(1).reduce((e,r,n)=>e+Math.hypot(r[0]-s[n][0],r[1]-s[n][1]),0);function Pl(s,e){let r=ia(s),n=aa(r)*e;for(let i=0;i+1<r.length;i++){let o=Math.hypot(r[i+1][0]-r[i][0],r[i+1][1]-r[i][1]);if(n<=o&&o>0){let t=n/o;return[r[i][0]+(r[i+1][0]-r[i][0])*t,r[i][1]+(r[i+1][1]-r[i][1])*t]}n-=o}return r[r.length-1]??[0,0]}function qc(s,e){let r=ia(s),n=Pl(s,e),i=[],o=aa(r)*e;for(let t=0;t<r.length;t++){i.push(r[t]);let a=t+1<r.length?Math.hypot(r[t+1][0]-r[t][0],r[t+1][1]-r[t][1]):1/0;if(o<=a)break;o-=a}return"M"+[...i,n].map(t=>`${ze(t[0])},${ze(t[1])}`).join(" L")}var as=s=>String(Number(s.toFixed(4)));function Bc(s,e){let r=s.match(/&[^;\s]+;|[\s\S]/gu)??[];return r.slice(0,Math.round(r.length*e)).join("")}function Kc(s){let e=[];return(s.dx||s.dy)&&e.push(`translate(${ze(s.dx??0)} ${ze(s.dy??0)})`),s.scale!==void 0&&s.scale!==1&&e.push(Dc(s.about??[0,0],s.scale)),{attrs:{...s.opacity===void 0||s.opacity===1?{}:{opacity:as(s.opacity)},...e.length?{transform:e.join(" ")}:{}},clip:s.clip}}function Fc(s,e){let r={attrs:s.opacity===void 0||s.opacity===1?{}:{opacity:as(s.opacity)}};if(s.drawn!==void 0&&s.drawn<1&&e!==void 0){let n=vt(s.drawn),i=aa(ia(e));r.path=s.by==="grow"?{d:qc(e,n),head:!1}:{style:`stroke-dasharray:${ze(i)} ${ze(i)};stroke-dashoffset:${ze(i*(1-n))}`,head:!1}}else s.ants&&(r.path={style:`stroke-dasharray:${ze(s.ants.dash[0])} ${ze(s.ants.dash[1])};stroke-dashoffset:${ze(-s.ants.offset)}`,head:!0});return r}function Zc(s,e,r,n,i){if(n==="label"||n==="note"){let t=s.labels&&Object.hasOwn(s.labels,r)?s.labels[r]:void 0;return t&&{attrs:{...t.opacity===void 0||t.opacity===1?{}:{opacity:as(t.opacity)},...t.dx||t.dy?{transform:`translate(${ze(t.dx??0)} ${ze(t.dy??0)})`}:{}},...t.typed===void 0||t.typed>=1?{}:{typed:t.typed}}}if(e==="route"){let t=s.routes&&Object.hasOwn(s.routes,r)?s.routes[r]:void 0;return t&&Fc(t,i(r))}let o=s.items&&Object.hasOwn(s.items,r)?s.items[r]:void 0;return o&&Kc(o)}function Vc(s,e,r){let n=[];for(let i of s.outlines??[])n.push(["polygon",{points:i.points.map(o=>o.map(ze).join(",")).join(" "),class:"ring",fill:"none","stroke-width":"2.5","stroke-linejoin":"round",...i.opacity===void 0?{}:{opacity:as(i.opacity)},...r?{stroke:i.color??r.control}:{style:`stroke:${i.color??"var(--ring,var(--control,currentColor))"}`}}]);for(let i of s.pulses??[])n.push(["ellipse",{cx:ze(i.x),cy:ze(i.y),rx:ze(i.rx),ry:ze(i.ry),class:"ring",fill:"none","stroke-width":"2.5",...i.opacity===void 0?{}:{opacity:as(i.opacity)},...r?{stroke:i.color??r.control}:{style:`stroke:${i.color??"currentColor"}`}}]);for(let i of s.tokens??[]){let o=e(i.route);if(o===void 0)continue;let[t,a]=Pl(o,vt(i.at));n.push(["circle",{cx:ze(t),cy:ze(a),r:"7",class:"tok",...r?{fill:i.color??(i.kind!==void 0?r.kinds?.[i.kind]:void 0)??r.control,stroke:r.surface,"stroke-width":"2.5"}:{style:`fill:${i.color??(i.kind!==void 0?`var(--${i.kind},var(--control,currentColor))`:"var(--control,currentColor)")}`}}])}return n}var Uc=s=>Object.keys(s).every(e=>e==="morph"||s[e]===void 0),Yc=new Set(["marks","badges"]),bl=s=>s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;");function ra(s){let e=new Map,r=[];for(let n of s.matchAll(/<(\/?)([a-zA-Z]+)((?:\s+[\w:-]+="[^"]*")*)\s*(\/?)>/g)){if(n[1]){let t=r.pop();t?.key!==void 0&&e.set(t.key,[t.from,n.index]);continue}if(n[4])continue;let i=/\sdata-item="([^"]*)"/.exec(n[3])?.[1],o=/\sdata-part="([^"]*)"/.exec(n[3])?.[1];r.push({...r.length===2&&i!==void 0&&o!==void 0?{key:`${Ol(i)}
237
+ ${o}`}:{},from:n.index+n[0].length})}return e}var wl=new WeakMap;function Wc(s,e){let r=wl.get(s)??new Map;wl.set(s,r);let n=r.get(e);if(!n){r.set(e,n=new Map);let i=s.variants?.[e],o=ra(s.svg);if(i!==void 0)for(let[t,[a,d]]of ra(i)){let c=o.get(t);c&&s.looks?.[t.split(`
238
+ `)[0]]?.includes(e)&&s.svg.slice(...c)!==i.slice(a,d)&&n.set(t,i.slice(a,d))}}return n}function Gc(s,e,r,n){let i=[];for(let o of s.looks?.[e]??[]){let t=vt(n[o]??0),a=t>0?Wc(s,o).get(`${e}
239
+ ${r}`):void 0;a!==void 0&&i.push([a,t])}return i.length?{own:vt(1-i.reduce((o,[,t])=>o+t,0)),looks:i}:void 0}var Jc=(s,e)=>(e.own>0?`<g opacity="${as(e.own)}">${s}</g>`:"")+e.looks.map(([r,n])=>`<g opacity="${as(n)}">${r}</g>`).join("");function Hc(s,e){let r="",n=0;for(let[i,[o,t]]of[...ra(s.svg)].sort((a,d)=>a[1][0]-d[1][0])){let[a,d]=i.split(`
240
+ `),c=Object.hasOwn(e,a)?Gc(s,a,d,e[a]):void 0;c&&(r+=s.svg.slice(n,o)+Jc(s.svg.slice(o,t),c),n=t)}return r+s.svg.slice(n)}function vl(s,e){if(Uc(e))return s.rendered.svg;let r=e.variants?Hc(s.rendered,e.variants):s.rendered.svg,n=l=>Object.hasOwn(s.rendered.paths,l)?s.rendered.paths[l]:void 0,i=0,o="",t="",a=0,d,c=r.replace(/<(\/?)([a-zA-Z]+)((?:\s+[\w:-]+="[^"]*")*)\s*(\/?)>|([^<]+)/g,(l,f,m,h,y,g)=>{if(g!==void 0)return d?.w.typed===void 0?l:Bc(g,d.w.typed);if(f)return i--,d&&i===d.at&&(d=void 0),i===1&&(o=""),l;let k=i;y||i++;let u={};for(let[,b,x]of h.matchAll(/([\w:-]+)="([^"]*)"/g))u[b]=x;if(k===0){if(!e.camera)return l;u.viewBox=e.camera.map(ze).join(" ")}else if(k===1)if(o=m==="g"&&u.class?.startsWith("g-")?u.class.slice(2):"",Yc.has(o)&&e.marks&&e.marks.opacity!==1)u.opacity=as(e.marks.opacity);else return l;else if(k===2&&u["data-part"]!==void 0){let b=u["data-route"]===void 0?"item":"route",x=Ol(u["data-route"]??u["data-item"]??""),$=Zc(e,b,x,u["data-part"],n);if(!$)return l;for(let[P,T]of Object.entries($.attrs))u[P]=bl(T);if($.clip){let P=`${s.id}-mc${a++}`;t+=`<clipPath id="${P}"><polygon points="${$.clip.map(T=>T.join(",")).join(" ")}"/></clipPath>`,u["clip-path"]=`url(#${P})`}if(!y&&($.path||$.typed!==void 0)&&(d={at:k,w:$}),!Object.keys($.attrs).length&&!$.clip)return l}else if(d?.w.path&&m==="path"&&u.class?.split(" ")[0]==="flow"){let b=d.w.path;b.d!==void 0&&(u.d=b.d),b.style!==void 0&&(u.style=b.style),b.head||delete u["marker-end"]}else return l;return`<${m}${Object.entries(u).map(([b,x])=>` ${b}="${x}"`).join("")}${y?"/":""}>`});t&&(c=c.replace(/<defs>|<defs\/>/,l=>l==="<defs/>"?`<defs>${t}</defs>`:l+t));let p=Vc(e,n,s.rendered.inks);return p.length&&(c=c.replace('<g class="g-anim">',l=>l+p.map(([f,m])=>`<${f}${Object.entries(m).map(([h,y])=>` ${h}="${bl(y)}"`).join("")}/>`).join(""))),c}var Ol=s=>s.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&");function Al(s,e){if(!e)return s;let[r,n,i,o]=e,t=s[2]/s[3],a=i-r,d=o-n;a/d<t?a=d*t:d=a/t,a=Math.min(a,s[2]),d=Math.min(d,s[3]);let c=(r+i)/2,p=(n+o)/2,l=Math.max(s[0],Math.min(s[0]+s[2]-a,c-a/2)),f=Math.max(s[1],Math.min(s[1]+s[3]-d,p-d/2));return[l,f,a,d]}var Xc=["linear","ease","ease-in","ease-out","ease-in-out","settle","bounce"],Ml=["extend","clamp","wrap","identity"];function ct(s,e){if(typeof s=="number")return Number.isFinite(s)?s:void 0;if(typeof s!="string")return;let r=/^(-?\d+(?:\.\d+)?)(ms|s|f)?$/.exec(s.trim());if(!r)return;let n=Number(r[1]);return r[2]==="s"?n*1e3:r[2]==="f"?e?n/e*1e3:void 0:n}function la(s,e){let r=e===!0?{}:e,n=r.base??2600,i=r.perChar??40,o=r.min??5600,t=r.max??12500;return Math.max(o,Math.min(t,n+(s?.text??"").length*i))}var _s=(s,e,r,n)=>i=>{if(i<=0)return 0;if(i>=1)return 1;let o=(d,c,p)=>3*d*p*(1-p)**2+3*c*p*p*(1-p)+p**3,t=0,a=1;for(let d=0;d<50;d++){let c=(t+a)/2;o(s,r,c)<i?t=c:a=c}return o(e,n,(t+a)/2)},Qc=s=>{if(s<=0)return 0;if(s>=1)return 1;let e=7.5625,r=2.75;return s<1/r?e*s*s:s<2/r?e*(s-1.5/r)**2+.75:s<2.5/r?e*(s-2.25/r)**2+.9375:e*(s-2.625/r)**2+.984375},ef={linear:s=>s,ease:_s(.25,.1,.25,1),"ease-in":_s(.42,0,1,1),"ease-out":_s(0,0,.58,1),"ease-in-out":_s(.42,0,.58,1),settle:_s(.16,.84,.3,1),bounce:Qc};function jn(s,e={}){let r=e.mass??1,n=e.stiffness??100,i=e.damping??10,o=Math.max(0,s)/1e3,t=Math.sqrt(n/r),a=i/(2*Math.sqrt(n*r)),d;if(a<1){let c=t*Math.sqrt(1-a*a);d=1-Math.exp(-a*t*o)*(Math.cos(c*o)+a*t/c*Math.sin(c*o))}else d=1-Math.exp(-t*o)*(1+t*o);return e.overshootClamping?Math.min(1,d):d}function Yt(s,e,r="ease-in-out"){let n=s??r;return typeof n=="string"?ef[n]:"bezier"in n?_s(...n.bezier):i=>i<=0?0:i>=1?1:jn(i*e,n.spring)}function Rn(s,e,r){let n=s.times.map(l=>ct(l,r)),i=s.values,o=n.length;if(o===1)return i[0];let t=(l,f)=>{if(l==="clamp")return f?i[0]:i[o-1];if(l==="identity")return e;if(l==="wrap"){let m=n[o-1]-n[0];return Rn({...s,extrapolateLeft:"clamp",extrapolateRight:"clamp"},n[0]+((e-n[0])%m+m)%m,r)}};if(e<n[0]){let l=t(s.extrapolateLeft??"extend",!0);if(l!==void 0)return l}if(e>n[o-1]){let l=t(s.extrapolateRight??"extend",!1);if(l!==void 0)return l}let a=0;for(;a<o-2&&e>=n[a+1];)a++;let d=n[a+1]-n[a],c=(e-n[a])/d,p=c<0||c>1?c:Yt(s.easing,d,"linear")(c);return i[a]+(i[a+1]-i[a])*p}var oa=["sequence","series","layers","assemble","disassemble","travel","pulse","ants","draw","type","move","lift","focus","highlight","camera"],Nl={morph:"the 2D morph is a later version's",diff:"diffs are a later version's",switch:"a look is a beat's: its variants"},Ot=["from","duration","easing"],hr={sequence:[],series:[],layers:[],assemble:Ot,disassemble:Ot,travel:[...Ot,"each","hold","loop"],pulse:[...Ot,"loop"],ants:[...Ot,"speed","dash"],draw:[...Ot,"by","stagger"],type:Ot,move:["from","x","y","scale","opacity"],lift:[...Ot,"by","stagger","to","opacity"],focus:[...Ot,"fade"],highlight:[...Ot,"fade"],camera:Ot},tf=["name","from","offset","duration","loop","playbackRate","trimBefore","say","show","hide","focus","highlight","levels","variants","enter","ants","children","layers","series"],Te=s=>!!s&&typeof s=="object"&&!Array.isArray(s);function zl(s){let e=[],r=(u,b,x)=>{e.push({severity:"error",path:u,message:b,...x?{hint:x}:{}})},n=(u,b,x)=>{for(let $ of Object.keys(u))if(!b.includes($)){let P=Ye($,b);r(`${x}/${$}`,`unknown key "${$}"`,P?`did you mean "${P}"?`:void 0)}};if(!Te(s))return r("","a motion document is a map"),e;n(s,["isomotion","fps","seed","ambient","series","layers","markers"],""),s.isomotion!==1&&r("/isomotion","isomotion is 1");let i=typeof s.fps=="number"&&s.fps>0?s.fps:void 0;s.fps!==void 0&&i===void 0&&r("/fps","fps is a number over 0"),s.seed!==void 0&&!Number.isInteger(s.seed)&&r("/seed","seed is a whole number"),s.ambient!==void 0&&s.ambient!=="on"&&s.ambient!=="off"&&r("/ambient",'ambient is "on" or "off"');let o=(u,b,x={})=>{if(u===void 0)return;if(typeof u=="string"&&/f$/.test(u)&&i===void 0){r(b,`"${u}" is in frames: the document needs its fps`);return}let $=ct(u,i);$===void 0?r(b,`${JSON.stringify(u)} isn't a time (ms, "1.2s", "450ms", "30f")`):$<0&&!x.negative&&r(b,"a time can't be negative")},t=(u,b,x)=>{if(u!==void 0&&!b.includes(u)){let $=typeof u=="string"?Ye(u,b):void 0;r(x,`${JSON.stringify(u)} isn't one of ${b.join(", ")}`,$?`did you mean "${$}"?`:void 0)}},a=(u,b,x={})=>{u!==void 0&&(typeof u!="number"||!Number.isFinite(u)||x.min!==void 0&&u<x.min||x.max!==void 0&&u>x.max||x.over!==void 0&&u<=x.over)&&r(b,`${JSON.stringify(u)} isn't a number${x.over!==void 0?` over ${x.over}`:x.min!==void 0?` from ${x.min}${x.max!==void 0?` to ${x.max}`:""}`:""}`)},d=(u,b)=>{if(u!==void 0){if(!Array.isArray(u)){r(b,"a list of ids");return}u.forEach((x,$)=>{typeof x!="string"&&r(`${b}/${$}`,"an id")})}},c=(u,b,x=[])=>{if(!Te(u)){r(b,"a spring is a map");return}n(u,["mass","damping","stiffness","overshootClamping",...x],b);for(let $ of["mass","damping","stiffness"])a(u[$],`${b}/${$}`,{over:0});u.overshootClamping!==void 0&&typeof u.overshootClamping!="boolean"&&r(`${b}/overshootClamping`,"true or false")},p=(u,b)=>{if(u!==void 0){if(typeof u=="string"){t(u,Xc,b);return}if(Te(u)&&"bezier"in u){n(u,["bezier"],b),(!Array.isArray(u.bezier)||u.bezier.length!==4||u.bezier.some(x=>typeof x!="number"))&&r(`${b}/bezier`,"four numbers");return}if(Te(u)&&"spring"in u){n(u,["spring"],b),c(u.spring,`${b}/spring`);return}r(b,"an easing is a name, { bezier: [a, b, c, d] } or { spring: { \u2026 } }")}},l=(u,b)=>{if(u===void 0)return;if(!Te(u)){r(b,"a curve is { times, values }");return}n(u,["times","values","easing","extrapolateLeft","extrapolateRight"],b);let x=u.times,$=u.values;if(!Array.isArray(x)||!x.length)r(`${b}/times`,"a list of times");else{x.forEach((T,M)=>o(T,`${b}/times/${M}`,{negative:!0}));let P=x.map(T=>ct(T,i));for(let T=1;T<P.length;T++)P[T]!==void 0&&P[T-1]!==void 0&&P[T]<=P[T-1]&&r(`${b}/times/${T}`,"times go up")}!Array.isArray($)||$.some(P=>typeof P!="number")?r(`${b}/values`,"a list of numbers"):Array.isArray(x)&&$.length!==x.length&&r(`${b}/values`,`${$.length} values for ${x.length} times`),p(u.easing,`${b}/easing`),t(u.extrapolateLeft,Ml,`${b}/extrapolateLeft`),t(u.extrapolateRight,Ml,`${b}/extrapolateRight`)},f=(u,b)=>{if(u!==void 0){if(!Te(u)){r(b,"focus is { lit: [ids] }");return}n(u,["lit","scope","level","always"],b),u.lit===void 0&&r(`${b}/lit`,"what is lit"),d(u.lit,`${b}/lit`),d(u.always,`${b}/always`),t(u.scope,["all","links"],`${b}/scope`),a(u.level,`${b}/level`,{min:0,max:1})}},m=(u,b)=>{u!==void 0&&typeof u!="string"&&r(b,"text")},h=new Map;function y(u,b,x){if(!Te(u)){r(b,"a sequence is a map");return}if(n(u,tf,b),u.name!==void 0&&(typeof u.name!="string"||!/^[A-Za-z][\w-]*$/.test(u.name)?r(`${b}/name`,"a name is letters, digits, - and _, from a letter"):h.has(u.name)?r(`${b}/name`,`"${u.name}" is already a name (${h.get(u.name)})`):h.set(u.name,b)),x&&u.from!==void 0&&r(`${b}/from`,"in a series a sequence follows the one before","offset moves it"),!x&&u.offset!==void 0&&r(`${b}/offset`,"offset is for a series","use from"),o(u.from,`${b}/from`),o(u.offset,`${b}/offset`,{negative:!0}),o(u.trimBefore,`${b}/trimBefore`),Te(u.duration)){n(u.duration,["read"],`${b}/duration`);let $=u.duration.read;if($!==!0&&!Te($))r(`${b}/duration/read`,"true, or { base, perChar, min, max }");else if(Te($)){n($,["base","perChar","min","max"],`${b}/duration/read`);for(let P of["base","perChar","min","max"])a($[P],`${b}/duration/read/${P}`,{min:0})}}else o(u.duration,`${b}/duration`);if(u.loop!==void 0&&typeof u.loop!="boolean"&&!(Number.isInteger(u.loop)&&u.loop>=1)&&r(`${b}/loop`,"true, false, or how many times"),a(u.playbackRate,`${b}/playbackRate`,{over:0}),u.say!==void 0)if(!Te(u.say))r(`${b}/say`,"say is a map");else{let $=u.say;n($,["chapter","title","text","code","facts","color"],`${b}/say`);for(let P of["chapter","title","text","code","color"])m($[P],`${b}/say/${P}`);$.facts!==void 0&&(!Array.isArray($.facts)||$.facts.some(P=>!Array.isArray(P)||P.length!==2||P.some(T=>typeof T!="string")))&&r(`${b}/say/facts`,"a list of [name, value]")}for(let $ of["show","hide","highlight"])d(u[$],`${b}/${$}`);if(f(u.focus,`${b}/focus`),u.levels!==void 0)if(!Te(u.levels))r(`${b}/levels`,"levels is a map: an id, and how much of it");else for(let[$,P]of Object.entries(u.levels))a(P,`${b}/levels/${$}`,{min:0,max:1});if(u.variants!==void 0)if(!Te(u.variants))r(`${b}/variants`,"variants is a map: an id, and the name of its look");else for(let[$,P]of Object.entries(u.variants))typeof P!="string"&&r(`${b}/variants/${$}`,`a look's name, or "" for its own`);u.enter!==void 0&&(Te(u.enter)?(n(u.enter,["fade","easing"],`${b}/enter`),u.enter.fade===void 0&&r(`${b}/enter/fade`,"how long the fade is"),o(u.enter.fade,`${b}/enter/fade`),p(u.enter.easing,`${b}/enter/easing`)):r(`${b}/enter`,"enter is { fade }")),u.ants!==void 0&&typeof u.ants!="boolean"&&d(u.ants,`${b}/ants`);for(let $ of["children","layers"])u[$]!==void 0&&k(u[$],`${b}/${$}`);u.series!==void 0&&g(u.series,`${b}/series`)}function g(u,b){if(!Array.isArray(u)){r(b,"a series is a list");return}u.forEach((x,$)=>{let P=`${b}/${$}`;if(!Te(x)||Object.keys(x).length!==1||!("sequence"in x||"transition"in x)){r(P,"a series holds sequences and transitions");return}if("sequence"in x){y(x.sequence,`${P}/sequence`,!0);return}let T=x.transition,M=`${P}/transition`,B=E=>Te(u[E])&&"sequence"in u[E];if((!B($-1)||!B($+1))&&r(M,"a transition is between two sequences"),!Te(T)){r(M,"a transition is { presentation, timing }");return}n(T,["presentation","timing"],M),T.presentation===void 0?r(`${M}/presentation`,"a presentation"):t(T.presentation,["fade","none"],`${M}/presentation`),Te(T.timing)?"linear"in T.timing?(n(T.timing,["linear"],`${M}/timing`),o(T.timing.linear,`${M}/timing/linear`)):"spring"in T.timing?(n(T.timing,["spring"],`${M}/timing`),c(T.timing.spring,`${M}/timing/spring`,["duration"]),Te(T.timing.spring)&&o(T.timing.spring.duration,`${M}/timing/spring/duration`)):r(`${M}/timing`,"a timing is { linear } or { spring }"):r(`${M}/timing`,"a timing is { linear } or { spring }")})}function k(u,b){if(!Array.isArray(u)){r(b,"a list");return}u.forEach((x,$)=>{let P=`${b}/${$}`;if(!Te(x)){r(P,"a map");return}let T=oa.filter(D=>D in x);if(T.length!==1){let D=Object.keys(x).find(S=>S in Nl),v=Object.keys(x)[0],O=v?Ye(v,oa):void 0;r(P,D?`${D}: ${Nl[D]}`:T.length?`one of ${T.join(", ")}, not several`:`one of ${oa.join(", ")}`,!D&&!T.length&&O?`did you mean "${O}"?`:void 0);return}let M=T[0],B=x[M],E=`${P}/${M}`;n(x,[M,...hr[M]],P),hr[M].includes("from")&&o(x.from,`${P}/from`),hr[M].includes("duration")&&(o(x.duration,`${P}/duration`),p(x.easing,`${P}/easing`));for(let D of["each","hold","stagger","fade"])hr[M].includes(D)&&o(x[D],`${P}/${D}`);if(hr[M].includes("loop")&&x.loop!==void 0&&typeof x.loop!="boolean"&&r(`${P}/loop`,"true or false"),M==="sequence")y(B,E,!1);else if(M==="series")g(B,E);else if(M==="layers")k(B,E);else if(M==="assemble"||M==="disassemble")Te(B)?(t(B.style,M==="assemble"?kl:xl,`${E}/style`),t(B.order,$l,`${E}/order`),B.duration!==void 0&&r(`${E}/duration`,"its length is beside it","duration is the node's")):r(E,`${M} is a map (its options)`);else if(M==="travel")!Array.isArray(B)||!B.length?r(E,"a list of connectors"):B.forEach((D,v)=>{Array.isArray(D)?d(D,`${E}/${v}`):typeof D!="string"&&r(`${E}/${v}`,"a connector, or a list of them at once")});else if(M==="ants")B!==!0&&d(B,E),a(x.speed,`${P}/speed`),x.dash!==void 0&&(!Array.isArray(x.dash)||x.dash.length!==2||x.dash.some(D=>typeof D!="number"||D<=0))&&r(`${P}/dash`,"two numbers over 0: on, off");else if(M==="move"){typeof B!="string"&&r(E,"an id");for(let D of["x","y","scale","opacity"])l(x[D],`${P}/${D}`)}else if(M==="focus")f(B,E);else if(M==="camera"){if(B!=="fit")if(!Te(B))r(E,'"fit", or { focus, zoom, margin }');else{n(B,["focus","zoom","margin"],E),a(B.zoom,`${E}/zoom`,{over:0}),a(B.margin,`${E}/margin`);let D=B.focus;typeof D=="string"||Array.isArray(D)&&(D.every(v=>typeof v=="string")||D.length===4&&D.every(v=>typeof v=="number"))||r(`${E}/focus`,"an id, some ids, or a box [x, y, w, h]")}}else d(B,E);M==="draw"&&t(x.by,["stroke","grow"],`${P}/by`),M==="lift"&&(x.by===void 0&&r(`${P}/by`,"how far apart"),a(x.by,`${P}/by`),t(x.to,["up","down"],`${P}/to`),l(x.opacity,`${P}/opacity`))})}if(s.series!==void 0&&g(s.series,"/series"),s.layers!==void 0&&k(s.layers,"/layers"),s.markers!==void 0)if(!Te(s.markers))r("/markers","markers is a map");else for(let[u,b]of Object.entries(s.markers))if(typeof b=="string"&&/^[A-Za-z][\w-]*([+-].+)?$/.test(b)){let x=/^([A-Za-z][\w-]*?)(?:([+-])(\d.*))?$/.exec(b);if(x&&(h.has(x[1])?x[1]:void 0))x[3]!==void 0&&o(x[3],`/markers/${u}`);else if(!h.has(b)){let T=Ye(x?.[1]??b,h.keys());r(`/markers/${u}`,`no sequence is named "${x?.[1]??b}"`,T?`did you mean "${T}"?`:void 0)}}else o(b,`/markers/${u}`);return e}var ft=s=>Math.round(s*100)/100||0,We=s=>Math.round(s*1e4)/1e4||0,gt=s=>Math.max(0,Math.min(1,s)),Cs=(s,e,r)=>s+(e-s)*r,sf=250,pa=class{items=new Map;labels=new Map;routes=new Map;tokens=[];pulses=[];outlines=[];variants={};marks=1;at(e,r){let n=e.get(r);return n||e.set(r,n={}),n}item(e,r){let n=this.at(this.items,e);r.opacity!==void 0&&(n.opacity=(n.opacity??1)*r.opacity),r.dx&&(n.dx=(n.dx??0)+r.dx),r.dy&&(n.dy=(n.dy??0)+r.dy),r.scale!==void 0&&(n.scale=(n.scale??1)*r.scale,n.about=r.about??n.about),r.clip&&(n.clip=r.clip)}label(e,r){let n=this.at(this.labels,e);r.opacity!==void 0&&(n.opacity=(n.opacity??1)*r.opacity),r.dx&&(n.dx=(n.dx??0)+r.dx),r.dy&&(n.dy=(n.dy??0)+r.dy),r.typed!==void 0&&(n.typed=Math.min(n.typed??1,r.typed))}route(e,r){let n=this.at(this.routes,e);r.opacity!==void 0&&(n.opacity=(n.opacity??1)*r.opacity),r.drawn!==void 0&&r.drawn<(n.drawn??1)&&(n.drawn=r.drawn,n.by=r.by),r.ants&&(n.ants=r.ants)}add(e){for(let[r,n]of Object.entries(e.items??{}))this.item(r,n);for(let[r,n]of Object.entries(e.labels??{}))this.label(r,n);for(let[r,n]of Object.entries(e.routes??{}))this.route(r,n);e.marks&&(this.marks*=e.marks.opacity),this.tokens.push(...e.tokens??[]),this.pulses.push(...e.pulses??[])}state(e){let r={},n=(p,l)=>{let f={};for(let[m,h]of p){let y=l(h);Object.keys(y).length&&(f[m]=y)}return f},i=p=>Object.keys(p).length>0,o=p=>p===void 0||We(p)>=1?{}:{opacity:We(Math.max(0,p))},t=p=>({...ft(p.dx??0)?{dx:ft(p.dx)}:{},...ft(p.dy??0)?{dy:ft(p.dy)}:{}}),a=n(this.items,p=>({...o(p.opacity),...t(p),...p.scale!==void 0&&We(p.scale)!==1?{scale:We(p.scale),...p.about?{about:p.about}:{}}:{},...p.clip?{clip:p.clip}:{}})),d=n(this.labels,p=>({...o(p.opacity),...p.typed!==void 0&&p.typed<1?{typed:We(p.typed)}:{},...t(p)})),c=n(this.routes,p=>{let l=p.opacity!==void 0&&We(p.opacity)<=0,f=p.drawn!==void 0&&p.drawn<1;return{...o(p.opacity),...f?{drawn:We(p.drawn),...p.by?{by:p.by}:{}}:{},...p.ants&&!l&&!f?{ants:p.ants}:{}}});return i(a)&&(r.items=a),i(d)&&(r.labels=d),i(c)&&(r.routes=c),We(this.marks)<1&&(r.marks={opacity:We(this.marks)}),this.tokens.length&&(r.tokens=this.tokens),this.pulses.length&&(r.pulses=this.pulses),this.outlines.length&&(r.outlines=this.outlines),i(this.variants)&&(r.variants=this.variants),e&&(r.camera=e),r}};function rf(s){let e=In(s.raw),r=s.rendered.looks,n=na(s),i=Object.keys(n.notes).filter(o=>n.notes[o]===void 0);return{model:n,kinds:Object.fromEntries(s.routes.map(o=>[o.id,o.kind])),outlines:Object.fromEntries(s.layout.items.map(o=>[o.id,Xe(o.box).map(t=>[ft(t[0]),ft(t[1])])])),...r&&Object.keys(r).length?{looks:r}:{},...e?{ants:e}:{},...i.length?{free:i}:{}}}function _n(s,e,r={}){let n="model"in s?s:rf(s),i=n.free?{...n.model,notes:{...n.model.notes,...Object.fromEntries(n.free.map(w=>[w,void 0]))}}:n.model,o=zl(e),t=e.fps,a=n.ants,d=()=>({ok:!1,diags:o,duration:0,beats:[],markers:{},ambient:"on",loops:!1,at:()=>({}),cues:()=>{},beatAt:()=>{},startOf:()=>{}});if(o.length)return d();let c=(w,z,_)=>{o.push({severity:"error",path:w,message:z,..._?{hint:_}:{}})},p=(w,z)=>w===void 0?z:ct(w,t),l=new Map(i.pieces.map(w=>[w.id,w])),f=new Set(i.routes.map(w=>w.id)),m=new Set(Object.keys(i.notes)),h=new Map(Object.entries(n.kinds)),y=[...l.keys(),...f,...m],g=new Set(y),k=new Map;for(let[w,z]of Object.entries(i.notes))z!==void 0&&k.set(z,[...k.get(z)??[],w]);let u={any:g,thing:new Set(l.keys()),route:f},b={any:"thing, connector or note",thing:"thing",route:"connector"},x=(w,z,_="any")=>{if(!u[_].has(w)){let U=Ye(w,u[_]);c(z,`no ${b[_]} "${w}" in this drawing`,U?`did you mean "${U}"?`:void 0)}},$=(w,z,_="any")=>w?.forEach((U,V)=>x(U,`${z}/${V}`,_)),P=new Map(Object.entries(n.outlines)),T=new Map;function M(w,z){let _="from"in w?p(w.from,0):0,U="duration"in w?p(w.duration,NaN):NaN,V=Number.isFinite(U);if("sequence"in w){let J=w.sequence;return p(J.from,0)+v(J,`${z}/sequence`)}if("series"in w)return O(w.series,`${z}/series`).end;if("layers"in w)return Math.max(0,...w.layers.map((J,F)=>M(J,`${z}/layers/${F}`)));if("assemble"in w||"disassemble"in w){let J="assemble"in w?"assemble":"disassemble",F="assemble"in w?w.assemble:w.disassemble,oe=T.get(w);return oe||T.set(w,oe=Sl(i,J,{seed:e.seed??1,...F,...V?{duration:U}:{}})),_+oe.duration}return"draw"in w?_+(V?U:400)+Math.max(0,w.draw.length-1)*p(w.stagger,0):"lift"in w?_+Math.max(V?U:750,...w.opacity?.times.map(J=>ct(J,t))??[])+Math.max(0,w.lift.length-1)*p(w.stagger,0):V?_+U:"travel"in w?w.loop?_:_+w.travel.length*p(w.each,1150):"pulse"in w?w.loop?_:_+1500:"type"in w?_+400:"camera"in w?_+900:"move"in w?_+Math.max(0,...[w.x,w.y,w.scale,w.opacity].flatMap(J=>J?.times.map(F=>ct(F,t))??[])):_}let B=(w,z)=>Math.max(0,...(w.children??[]).map((_,U)=>M(_,`${z}/children/${U}`)),...(w.layers??[]).map((_,U)=>M(_,`${z}/layers/${U}`)),w.series?O(w.series,`${z}/series`).end:0),E=new Map;function D(w,z){let _=E.get(w);if(_!==void 0)return _;let U;return w.duration!==void 0&&typeof w.duration=="object"?U=la(w.say,w.duration.read):U=w.duration!==void 0?p(w.duration,0):B(w,z),w.duration===void 0&&U<=0&&w.say&&(U=la(w.say,!0)),U<=0&&c(`${z}/duration`,"how long is it? (nothing in it says)"),E.set(w,U),U}let v=(w,z)=>{let _=D(w,z),U=w.playbackRate??1;return w.loop===!0?_/U:(typeof w.loop=="number"?_*w.loop:_)/U};function O(w,z){let _=[],U=0,V;return w.forEach((J,F)=>{if("transition"in J){let me=J.transition,Se=me.timing,Ie=me.presentation==="none"?0:ca(Se,t);V={t:me,length:Ie};return}let oe=J.sequence,pe=`${z}/${F}/sequence`,he=v(oe,pe),we=Math.max(0,U+p(oe.offset,0)-(V?.length??0));V&&_.length&&V.length>Math.min(_[_.length-1].end-_[_.length-1].start,he)&&c(`${z}/${F-1}/transition/timing`,"a transition is no longer than either side of it"),_.push({s:oe,path:pe,start:we,end:we+he,...V?{into:V}:{}}),U=we+he,V=void 0}),{list:_,end:Math.max(0,..._.map(J=>J.end))}}let S=O(e.series??[],"/series"),N=Math.max(0,...(e.layers??[]).map((w,z)=>M(w,`/layers/${z}`))),I=Math.max(S.end,N);I<=0&&!o.length&&c("","a motion document has a series, or layers, that last");let L=new Map,X=[],j=i.viewBox,A=(w,z,_)=>{let U=_!==void 0?1/_:Math.max((w.w+z*2)/j[2],(w.h+z*2)/j[3]);return[w.x+w.w/2-j[2]*U/2,w.y+w.h/2-j[3]*U/2,j[2]*U,j[3]*U]};function R(w,z,_){let U=V=>_?{at:_.at+V/_.rate,rate:_.rate}:void 0;if("sequence"in w){K(w.sequence,`${z}/sequence`,U(p(w.sequence.from,0)),!1);return}if("series"in w){for(let V of O(w.series,`${z}/series`).list)K(V.s,V.path,U(V.start),!1);return}if("layers"in w){w.layers.forEach((V,J)=>R(V,`${z}/layers/${J}`,_));return}if("assemble"in w||"disassemble"in w){M(w,z);return}if("travel"in w)w.travel.forEach((V,J)=>(Array.isArray(V)?V:[V]).forEach((F,oe)=>x(F.split(":")[0],`${z}/travel/${J}${Array.isArray(V)?`/${oe}`:""}`,"route")));else if("pulse"in w)$(w.pulse,`${z}/pulse`,"thing");else if("ants"in w)w.ants!==!0&&$(w.ants,`${z}/ants`,"route");else if("draw"in w)$(w.draw,`${z}/draw`,"route");else if("type"in w)$(w.type,`${z}/type`);else if("move"in w)x(w.move,`${z}/move`,"thing");else if("lift"in w)$(w.lift,`${z}/lift`,"thing");else if("focus"in w)C(w.focus,`${z}/focus`);else if("highlight"in w)$(w.highlight,`${z}/highlight`,"thing");else if("camera"in w){let V=w.camera,J=p(w.duration,900);if(!_){c(`${z}/camera`,"a camera can't be in a loop");return}let F=j;if(V!=="fit"){let oe=V.focus;if(Array.isArray(oe)&&typeof oe[0]=="number")F=A({x:oe[0],y:oe[1],w:oe[2],h:oe[3]},V.margin??0,V.zoom);else{let pe=typeof oe=="string"?[oe]:oe;pe.forEach((we,me)=>x(we,`${z}/camera/focus${typeof oe=="string"?"":`/${me}`}`,"thing"));let he=pe.map(we=>l.get(we)?.bbox).filter(we=>!!we);if(he.length){let we=Math.min(...he.map(Se=>Se.x)),me=Math.min(...he.map(Se=>Se.y));F=A({x:we,y:me,w:Math.max(...he.map(Se=>Se.x+Se.w))-we,h:Math.max(...he.map(Se=>Se.y+Se.h))-me},V.margin??40,V.zoom)}}}X.push({at:_.at+p(w.from,0)/_.rate,over:J/_.rate,ease:Yt(w.easing,J,"settle"),to:F})}}let C=(w,z)=>{w&&($(w.lit,`${z}/lit`),$(w.always,`${z}/always`))};function K(w,z,_,U){if(w.name!==void 0&&_&&L.set(w.name,_.at),!U)for(let F of["show","hide","say","enter","focus","highlight","levels","variants","ants"])w[F]!==void 0&&c(`${z}/${F}`,`${F} is for a sequence of the document's own series`,F==="focus"||F==="highlight"||F==="ants"?`here, a child: { ${F}: \u2026 }`:void 0);$(w.show,`${z}/show`),$(w.hide,`${z}/hide`),$(w.highlight,`${z}/highlight`,"thing"),C(w.focus,`${z}/focus`);for(let F of Object.keys(w.levels??{}))F!=="*"&&x(F,`${z}/levels/${F}`);for(let[F,oe]of Object.entries(w.variants??{})){x(F,`${z}/variants/${F}`,"thing");let pe=n.looks?.[F]??[];if(l.has(F)&&oe!==""&&!pe.includes(oe)){let he=Ye(oe,pe);c(`${z}/variants/${F}`,pe.length?`${F} has no look "${oe}" (it has ${pe.join(", ")})`:`${F} declares no looks (variants: in the diagram)`,he?`did you mean "${he}"?`:void 0)}}Array.isArray(w.ants)&&$(w.ants,`${z}/ants`,"route");let V=w.playbackRate??1,J=_&&!w.loop?{at:_.at-p(w.trimBefore,0)/(_.rate*V),rate:_.rate*V}:void 0;if((w.children??[]).forEach((F,oe)=>R(F,`${z}/children/${oe}`,J)),(w.layers??[]).forEach((F,oe)=>R(F,`${z}/layers/${oe}`,J)),w.series)for(let F of O(w.series,`${z}/series`).list)K(F.s,F.path,J&&{at:J.at+F.start/J.rate,rate:J.rate},!1)}for(let w of S.list)K(w.s,w.path,{at:w.start,rate:1},!0);(e.layers??[]).forEach((w,z)=>R(w,`/layers/${z}`,{at:0,rate:1})),X.sort((w,z)=>w.at-z.at);let W={};for(let[w,z]of Object.entries(e.markers??{})){let _=ct(z,t);if(_!==void 0){W[w]=_;continue}let U=String(z),V=[...L.keys()].filter(oe=>U===oe||U.startsWith(oe+"+")||U.startsWith(oe+"-")).sort((oe,pe)=>pe.length-oe.length)[0];if(V===void 0){c(`/markers/${w}`,`"${U}" isn't a moment of this document`);continue}let J=U.slice(V.length),F=J?ct(J.slice(1),t):0;if(F===void 0){c(`/markers/${w}`,`"${J}" isn't a time`);continue}W[w]=L.get(V)+(J[0]==="-"?-F:F)}if(o.length)return d();let ae=S.list.map((w,z)=>({name:w.s.name??`beat-${z+1}`,index:z,start:w.start,end:w.end,...w.s.say?{say:w.s.say}:{}})),ee=new Map;for(let w of S.list){for(let z of w.s.show??[])ee.has(z)||ee.set(z,!1);for(let z of w.s.hide??[])ee.has(z)||ee.set(z,!0)}let G=[new Map(ee)];for(let w of S.list){let z=new Map(G[G.length-1]);for(let _ of w.s.show??[])z.set(_,!0);for(let _ of w.s.hide??[])z.set(_,!1);G.push(z)}let fe=[new Map];for(let w of S.list){let z=new Map(fe[fe.length-1]);for(let[_,U]of Object.entries(w.s.variants??{}))z.set(_,U);fe.push(z)}let le=(w,z)=>!w||w.lit.includes(z)||w.always?.includes(z)||w.scope==="links"&&l.has(z)?1:w.level??.12,q=(w,z)=>{let _=w<0?void 0:S.list[w].s.levels;return _?_[z]??_["*"]??1:1},Q=(w,z)=>(G[w+1].get(z)===!1?0:1)*(w<0?1:le(S.list[w].s.focus,z))*q(w,z),Ae=(w,z)=>{let _=i.notes[z];if(_===void 0)return Q(w,z);let U=w<0?void 0:S.list[w].s.levels?.[z];return Q(w,_)*(G[w+1].get(z)===!1?0:1)*(U??1)},Me=w=>{let z=-1;for(let _=0;_<S.list.length;_++)S.list[_].start<=w&&(z=_);return z},Ue=(w,z)=>{let _=S.list[w],U=z-_.start;if(_.into&&_.into.length>0)return fa(_.into.t.timing,U,_.into.length);let V=_.s.enter;if(!V)return 1;let J=p(V.fade,0);return J<=0?1:Yt(V.easing,J,"ease")(gt(U/J))};function mt(w,z,_,U,V){if("sequence"in w){let pe=w.sequence,he=p(pe.from,0);gr(pe,z-he,_-he,ql(pe,U-he),V);return}if("series"in w){for(let pe of O(w.series,"").list)gr(pe.s,z-pe.start,_-pe.start,pe.end-pe.start,V);return}if("layers"in w){for(let pe of w.layers)mt(pe,z,_,U,V);return}let J=p("from"in w?w.from:void 0,0),F=z-J;if("assemble"in w||"disassemble"in w){V.sum.add(T.get(w).at(F));return}if("draw"in w){let pe=Math.max(1,p(w.duration,400)),he=p(w.stagger,0),we=Yt(w.easing,pe,"ease-out");w.draw.forEach((me,Se)=>{let Ie=we(gt((F-Se*he)/pe));Ie<=0?(V.sum.route(me,{opacity:0,drawn:0}),V.sum.label(me,{opacity:0})):Ie<1&&(V.sum.route(me,{drawn:Ie,...w.by?{by:w.by}:{}}),V.sum.label(me,{opacity:Ie}))});return}if("type"in w){let pe=p(w.duration,400),he=Yt(w.easing,pe,"linear")(gt(F/Math.max(1,pe)));if(he<1)for(let we of w.type)V.sum.label(we,he<=0?{opacity:0}:{typed:he});return}if("move"in w){let pe=Ie=>Ie?Rn(Ie,F,t):void 0,he=pe(w.x)??0,we=pe(w.y)??0,me=pe(w.scale),Se=pe(w.opacity);V.sum.item(w.move,{dx:he,dy:we,...me===void 0?{}:{scale:me,about:l.get(w.move).foot},...Se===void 0?{}:{opacity:gt(Se)}});for(let Ie of[w.move,...k.get(w.move)??[]])V.sum.label(Ie,{dx:he,dy:we,...Se===void 0?{}:{opacity:gt(Se)}});return}if("lift"in w){let pe=p(w.stagger,0),he=Math.max(1,p(w.duration,750)),we=Yt(w.easing,he,"ease-out"),me=w.to==="down",Se=w.lift.length;w.lift.forEach((Ie,_t)=>{let ne=F-(me?Se-1-_t:_t)*pe,Oe=we(gt(ne/he)),Le=(_t+1)*w.by*(me?Oe:-Oe),De=w.opacity?gt(Rn(w.opacity,ne,t)):1;if(!(!Le&&De>=1)){V.sum.item(Ie,{dy:Le,opacity:De});for(let Wt of[Ie,...k.get(Ie)??[]])V.sum.label(Wt,{dy:Le,opacity:De})}});return}if("camera"in w)return;let oe=w.duration===void 0?Math.max(0,U-J):p(w.duration,0);if(!(F<0||F>oe)){if("focus"in w||"highlight"in w){let pe=Math.max(1,p(w.fade,sf)),he=gt(Math.min(F/pe,w.duration===void 0?1:(oe-F)/pe)),we=Yt(w.easing,pe,"linear")(he);if("focus"in w)Dl(w.focus,we,V.sum);else for(let me of w.highlight)V.shown(me)&&ka(me,we,V.sum);return}if("ants"in w){qn(w.ants===!0?[...f]:w.ants,V,w.speed,w.dash);return}if("pulse"in w){let he=w.loop?us(_-J,1500,V)/1500:F/Math.max(1,w.duration===void 0?1500:oe);if(he<0||he>=1)return;for(let we of w.pulse)if(V.shown(we)){let me=l.get(we),Se=me.bbox.w*.5*(.7+he*.6);V.sum.pulses.push({x:ft(me.foot[0]),y:ft(me.foot[1]),rx:ft(Se),ry:ft(Se*.58),opacity:We(1-he)})}return}if("travel"in w){let pe=p(w.each,1150),he=p(w.hold,w.loop?700:0),we=w.travel.length*pe+he,me=w.loop?us(_-J,we,V):F,Se=Math.floor(me/pe);if(Se>=w.travel.length)return;let Ie=(me-Se*pe)/pe,_t=Yt(w.easing,pe,"ease-in-out")(Ie),ne=w.travel[Se];for(let Oe of Array.isArray(ne)?ne:[ne]){let[Le,De]=Oe.split(":");V.shown(Le)&&V.sum.tokens.push({route:Le,at:We((De??h.get(Le))==="blocked"?Ds(Ie):_t),...De?{kind:De}:{}})}}}}let Ds=w=>w<.7?w/.7:1-(w-.7)/.3*.25,us=(w,z,_)=>_.off?0:(w%z+z)%z,ka=(w,z,_)=>{We(z)>0&&P.has(w)&&_.outlines.push({id:w,points:P.get(w),...We(z)<1?{opacity:We(z)}:{}})},Dl=(w,z,_)=>{for(let U of y){let V=m.has(U)&&!w.lit.includes(U)&&!w.always?.includes(U)?i.notes[U]:void 0,J=Cs(1,le(w,V??U),z);J>=1||(l.has(U)?(_.item(U,{opacity:J}),_.label(U,{opacity:J})):f.has(U)?(_.route(U,{opacity:J}),_.label(U,{opacity:J})):_.label(U,{opacity:J}))}},qn=(w,z,_=ul,U)=>{for(let V of w){let J=hl(h.get(V)??"",{dash:U,kinds:r.kinds,still:r.still});if(!J)continue;let F=J[0]+J[1],oe=us(_*z.A/1e3,F,z);z.sum.route(V,{ants:{dash:J,offset:ft(oe)}})}},ql=(w,z)=>w.loop===!0?Math.max(0,z):v(w,"");function gr(w,z,_,U,V){if(z<0||z>U||z===U&&U<I&&U>0&&w.loop)return;let J=w.playbackRate??1,F=D(w,""),oe=p(w.trimBefore,0),pe=w.loop&&F>0?z*J%F:z*J,he=pe+oe,we=_*J+oe;for(let me of w.children??[])mt(me,he,we,F+oe,V);for(let me of w.layers??[])mt(me,he,we,F+oe,V);if(w.series)for(let me of O(w.series,"").list)gr(me.s,he-me.start,we-me.start,me.end-me.start,V)}function Bl(w,z={}){let _=Math.max(0,Math.min(I,Number.isFinite(w)?w:0)),U=z.ambient==="off"||e.ambient==="off"&&z.ambient===void 0,V=typeof z.ambient=="number"?z.ambient:_,J=new pa,F=Me(_),oe=F<0?1:Ue(F,_),pe=(ne,Oe)=>F<0?Oe(-1,ne):oe>=1?Oe(F,ne):Cs(Oe(F-1,ne),Oe(F,ne),oe),he=ne=>(F<0?G[0]:G[F+1]).get(ne)!==!1;if(ee.size||S.list.some(ne=>ne.s.focus||ne.s.levels))for(let ne of y){let Oe=pe(ne,m.has(ne)?Ae:Q);Oe>=1||(l.has(ne)&&J.item(ne,{opacity:Oe}),f.has(ne)&&J.route(ne,{opacity:Oe}),J.label(ne,{opacity:Oe}))}if(F>=0)for(let ne of fe[fe.length-1].keys()){let Oe=fe[F].get(ne)??"",Le=fe[F+1].get(ne)??"",De={};Oe&&oe<1&&(De[Oe]=We(1-oe)),Le&&(De[Le]=We((De[Le]??0)+oe));for(let Wt of Object.keys(De))De[Wt]<=0&&delete De[Wt];Object.keys(De).length&&(J.variants[ne]=De)}if(F>=0){let ne=new Set(S.list[F].s.highlight??[]),Oe=new Set(F>0&&oe<1?S.list[F-1].s.highlight??[]:[]);for(let Le of new Set([...Oe,...ne]))ka(Le,Cs(Oe.has(Le)?1:0,ne.has(Le)?1:0,oe),J)}let we={sum:J,shown:he,off:U,A:V},me=F>=0?S.list[F].s.ants:void 0,Se=me===void 0?a:void 0;me?qn(me===!0?[...f]:me,we):Se&&qn(Se.ids??[...f],we,Se.speed,Se.dash),S.list.forEach((ne,Oe)=>{_>=ne.start&&(_<ne.end||Oe===F&&_<=ne.end)&&gr(ne.s,_-ne.start,V-ne.start,ne.end-ne.start,we)});for(let ne of e.layers??[])mt(ne,_,V,I,we);let Ie;for(let ne of X){if(ne.at>_)break;let Oe=ne.over<=0?1:ne.ease(gt((_-ne.at)/ne.over)),Le=Ie??j;if(Oe>=1){Ie=ne.to;continue}let De=Le[2],Wt=ne.to[2],wr=Math.exp(Cs(Math.log(De),Math.log(Wt),Oe)),$a=Math.abs(Wt-De)<1e-6?Oe:(wr-De)/(Wt-De),Fl=Cs(Le[0]+Le[2]/2,ne.to[0]+ne.to[2]/2,$a),Zl=Cs(Le[1]+Le[3]/2,ne.to[1]+ne.to[3]/2,$a),Sa=wr*j[3]/j[2];Ie=[Fl-wr/2,Zl-Sa/2,wr,Sa]}let _t=Ie?.map(ft);return J.state(_t&&_t.some((ne,Oe)=>Math.abs(ne-j[Oe])>.005)?_t:void 0)}let br=w=>{if(!w||typeof w!="object")return!1;if(Array.isArray(w))return w.some(br);let z=w;return z.ants!==void 0&&z.ants!==!1||z.loop===!0&&("travel"in z||"pulse"in z)?!0:Object.values(z).some(br)},Kl=a!==void 0||br(e.series)||br(e.layers),xa=w=>{let z=Me(Math.max(0,Math.min(I,w)));return z<0?void 0:ae[z]};return{ok:!0,diags:o,duration:I,beats:ae,markers:W,ambient:e.ambient??"on",loops:Kl,at:Bl,beatAt:xa,startOf:w=>L.get(w)??ae.find(z=>z.name===w)?.start,cues(w){let z=xa(w);if(!z)return;let _=Math.max(0,Math.min(I,w));return{beat:z.name,index:z.index,of:ae.length,progress:We(gt((_-z.start)/Math.max(1,z.end-z.start))),...z.say?{say:z.say,...z.say.chapter!==void 0?{chapter:z.say.chapter}:{},...z.say.color!==void 0?{color:z.say.color}:{}}:{}}}}}var ca=(s,e)=>"linear"in s?ct(s.linear,e)??0:ct(s.spring.duration,e)??nf(s.spring);function fa(s,e,r){return r<=0||e>=r?1:"spring"in s?gt(jn(e,{...s.spring,overshootClamping:!0})/jn(r,{...s.spring,overshootClamping:!0})):gt(e/r)}function nf(s){let e=s.mass??1,r=s.stiffness??100,n=s.damping??10,i=Math.sqrt(r/e),o=Math.min(1,n/(2*Math.sqrt(r*e)));return Math.ceil(Math.log(200)/(o*i)*1e3*(o>=1?1.6:1))}function Il(s){let{steps:e,vis:r}=s.steps,n=s.rendered.viewBox,i=!1,o=na(s),t=new Set([...o.pieces.map(p=>p.id),...o.routes.map(p=>p.id),...Object.keys(o.notes)]),a=p=>t.has(p),d=Object.keys(o.notes).filter(p=>o.notes[p]===void 0),c=e.map((p,l)=>{let f=[],m=[];for(let[u,b]of Object.entries(r))(l===0?!b.includes(!0):b[l-1]&&!b[l])?m.push(u):l>0&&b[l]&&!b[l-1]&&f.push(u);let h=[],y=u=>`${u.route}:${u.kind}`;p.phases.length&&h.push({travel:p.phases.map(u=>u.length===1?y(u[0]):u.map(y)),each:1150,hold:700,loop:!0});let g=(s.raw.steps??[])[l]?.pulse?.filter(u=>s.layout.byId.has(u))??[];if(g.length&&h.push({pulse:g,loop:!0}),p.focus){let[u,b,x,$]=Al(n,p.focus).map(ft);h.push({camera:{focus:[u,b,x,$]},duration:900,easing:"ease-in-out"}),i=!0}else i&&(h.push({camera:"fit",duration:900,easing:"ease-in-out"}),i=!1);let k={name:`step-${p.n}`,duration:p.duration,say:{title:p.heading,...p.caption?{text:p.caption}:{},...p.command?{code:p.command}:{}}};return f.length&&(k.show=f),m.length&&(k.hide=m),k.focus=s.raw.dim==="all"?{lit:p.lit.filter(a),scope:"all",level:.14}:{lit:p.lit.filter(a),scope:"links",level:.12,...d.length?{always:d}:{}},h.length&&(k.children=h),{sequence:k}});return{isomotion:1,...c.length?{series:c}:{}}}function El(s,e){let r={};for(let n of s.layout.items){let i=(n.region??n.node)?.variants;i&&(r[n.id]=Object.keys(i))}Object.keys(r).length&&(s.rendered.looks=r,s.rendered.variants=Object.fromEntries([...new Set(Object.values(r).flat())].map(n=>[n,On({scene:s.raw,routes:s.routes,steps:s.steps,theme:e,id:s.raw.id,gridStep:s.grid.step??s.grid.snap??1,layout:{...s.layout,items:s.layout.items.map(i=>{let o=(i.region??i.node)?.variants?.[n];return o?i.region?{...i,region:{...i.region,...o,deco:void 0}}:{...i,node:{...i.node,...o}}:i})}}).svg])))}var Tl=s=>af+Mo(s)+of+Bo(),af=`
241
+ /* blocks: hue per role, lightness per face and theme */
242
+ .blk .top{fill:hsl(var(--h) var(--s) var(--l-top))}
243
+ .blk .lft{fill:hsl(var(--h) var(--s) var(--l-left))}
244
+ .blk .rgt{fill:hsl(var(--h) var(--s) var(--l-right))}
245
+ .blk polygon,.blk path.top,.blk path.lft{stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:.8;stroke-linejoin:round}
246
+ .blk .det{stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:1.4;fill:none;stroke-linecap:round;opacity:.7}
247
+ .k-slab .top{fill:var(--slab-top)} .k-slab .lft{fill:var(--slab-l)} .k-slab .rgt{fill:var(--slab-r)}
248
+ .k-pad .top{fill:var(--pad-top)}
249
+ .wall polygon{fill-opacity:.34}
250
+ .zone polygon{fill:hsl(var(--h) var(--s) 50% / .12);stroke:hsl(var(--h) var(--s) 45% / .55);stroke-dasharray:5 4;stroke-width:1.2}
251
+ .ghost polygon{fill:transparent!important;stroke:var(--muted);stroke-dasharray:4 4;stroke-width:1.2}
252
+ .ghost .det{opacity:.45}
253
+ .blk polygon.ico-unknown{fill:none;stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:1.2;stroke-dasharray:3 2.5}
254
+ .blk .ico-unknown-q{stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:1.6;stroke-linecap:round;fill:none}
255
+ .blk polygon.sock-hole{fill:hsl(var(--h) var(--s) 18%);opacity:.8}
256
+ .scr .t{fill:#1d1f27;stroke:#3a3b44;stroke-width:.6}
257
+ .scr .ln{stroke:#8fd3b0;stroke-width:1.2;stroke-linecap:round}
258
+ .scr .bar{fill:#2a2c36}
259
+ .scr .win{fill:#e9e9ee}
260
+ .scr .wall{fill:#3b5bbd}
261
+ .scr .glass{fill:#0d0e12;stroke:#3a3b44;stroke-width:1}
262
+ .scr .w{fill:#f4f4f2}
263
+ .scr .d{fill:#0b0b0d}
264
+ .scr .m{fill:#3a3934}
265
+ .scr .unk{fill:none;stroke:#8a8d99;stroke-width:1;stroke-dasharray:3 2.5}
266
+ .scr .unk-q{fill:none;stroke:#8a8d99;stroke-width:1.4;stroke-linecap:round}
267
+ .scr .unk-dot{fill:#8a8d99}
268
+ .orb .ball{fill:url(#orbG);stroke:#8a8b93;stroke-width:.8}
269
+ .orb .shade{fill:#000;opacity:.18}
270
+ .orb .eye{fill:#0b0b0d}
271
+ .person .body{fill:hsl(var(--h) var(--s) var(--l-left));stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:.8}
272
+ .person .head{fill:hsl(var(--h) var(--s) var(--l-top));stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:.8}
273
+
274
+ /* text */
275
+ .lbl{font-size:13px;font-weight:700;fill:var(--ink);paint-order:stroke;stroke:var(--surface);stroke-width:4px;stroke-linejoin:round}
276
+ .sub{font-size:11px;fill:var(--muted);font-weight:400;paint-order:stroke;stroke:var(--surface);stroke-width:4px;stroke-linejoin:round}
277
+ .floor{font-size:11px;font-weight:600;letter-spacing:.01em}
278
+ .floor.t-control{fill:var(--muted)}
279
+ .slabname{font-size:15px;font-weight:800;fill:var(--muted);letter-spacing:.12em;opacity:.8}
280
+ .slabname.sm{font-size:10.5px;letter-spacing:.1em;opacity:1}
281
+ `,of=`.tunnel polygon{fill:hsl(205 85% 55% / .17);stroke:hsl(205 75% 45% / .8);stroke-width:1.3;stroke-linejoin:round}
282
+ .tunnel .top{fill:hsl(205 85% 65% / .22)}
283
+ .tunnel .rib{fill:none;stroke:hsl(205 75% 45% / .5);stroke-width:1}
284
+ .tunname{font-size:12px;font-weight:800;letter-spacing:.14em;fill:var(--tunnel-text);paint-order:stroke;stroke:var(--surface);stroke-width:3px;stroke-linejoin:round}
285
+
286
+ /* flows */
287
+ .flow{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
288
+ `;var ma=`
289
+ /* step marks */
290
+ .xm circle{fill:var(--surface);stroke:var(--blocked);stroke-width:2.5}
291
+ .xm path{stroke:var(--blocked);stroke-width:3;stroke-linecap:round}
292
+ .say rect{fill:var(--surface);stroke-width:1.5}
293
+ .say text{font-size:12px;font-weight:600}
294
+ .badge{cursor:pointer}
295
+ .badge circle{fill:var(--c);stroke:var(--surface);stroke-width:2.5}
296
+ .badge text{font-size:11.5px;font-weight:800;fill:var(--on);text-anchor:middle;dominant-baseline:central;pointer-events:none}
297
+ .tok{stroke:var(--surface);stroke-width:2.5}
298
+ .pulse{fill:none;stroke-width:2.5;transform-box:fill-box;transform-origin:center;animation:pulse 1.5s ease-out infinite}
299
+ @keyframes pulse{from{transform:scale(.35);opacity:.95}to{transform:scale(1.5);opacity:0}}
300
+ .sub{stroke-width:5px}
301
+
302
+ /* step focus: what a step does not touch dims; things that appear later are hidden */
303
+ [data-hl],[data-id],[data-step]{transition:opacity .25s}
304
+ svg.focus [data-hl]:not(.hl){opacity:.12}
305
+ svg.focus.dim-all [data-dim]:not(.hl){opacity:.14}
306
+ svg.focus .badge:not(.on){opacity:.14}
307
+ svg.all .badge{opacity:1}
308
+ svg.focus.all [data-hl]:not(.hl),svg.focus.all.dim-all [data-dim]:not(.hl){opacity:.9}
309
+ svg [data-step]:not(.on),svg.all [data-step]{opacity:0!important;pointer-events:none}
310
+ .pre{opacity:0!important;pointer-events:none}
311
+ `,lf=`
312
+ /* player */
313
+ .player{display:flex;align-items:flex-start;gap:10px 14px;padding:12px 16px;border-top:1px solid var(--line);flex-wrap:wrap}
314
+ .ctrls{display:flex;gap:6px;flex:none}
315
+ .pbtn{font:inherit;font-size:13px;font-weight:700;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:99px;padding:6px 14px;cursor:pointer}
316
+ .pbtn.icon{padding:6px 11px}
317
+ .pbtn:hover{border-color:var(--muted)}
318
+ .pbtn:disabled{opacity:.6;cursor:default}
319
+ .pbtn.primary{background:var(--ink);color:var(--surface);border-color:var(--ink);min-width:92px;justify-content:center}
320
+ .pbtn:focus-visible,.dot:focus-visible,.badge:focus-visible{outline:2px solid var(--send);outline-offset:2px}
321
+ .cap{flex:1 1 360px;min-width:0}
322
+ .cap-h{font-size:14.5px;font-weight:700;display:flex;align-items:center;gap:8px}
323
+ .cap-h .cnt{margin-left:auto;font-weight:500;color:var(--muted);font-size:12px;white-space:nowrap}
324
+ .num{flex:none;display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--c,var(--control));color:var(--on);font-size:11px;font-weight:800}
325
+ .cap-t{font-size:13.5px;color:var(--ink);margin:4px 0 0;max-width:92ch;min-height:3.1em}
326
+ .cap-c{margin:8px 0 0;background:var(--code-bg);border-radius:8px;padding:7px 10px;font-size:12px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;max-height:9.5em;overflow-y:auto;color:var(--ink)}
327
+ .cap-c:empty{display:none}
328
+ .prog{height:3px;background:var(--line);border-radius:3px;overflow:hidden;margin-top:9px}
329
+ .prog i{display:block;height:100%;width:0;background:var(--c,var(--ink))}
330
+ .dots{display:flex;gap:5px;flex-wrap:wrap;flex-basis:100%;padding-left:2px;order:4}
331
+ .dot{width:10px;height:10px;border-radius:50%;background:var(--line);border:0;padding:0;cursor:pointer}
332
+ .dot.on{background:var(--ink)} .dot.done{background:var(--muted)}
333
+ details.steps{margin:0 0 8px;font-size:13.5px}
334
+ details.steps summary{cursor:pointer;color:var(--muted);font-size:13px}
335
+ details.steps ol{margin:8px 0 0;padding-left:22px;max-width:92ch}
336
+ details.steps li{margin:6px 0}
337
+ details.steps li code{font-size:11.5px}
338
+ @media (prefers-reduced-motion:reduce){.pulse{animation:none;opacity:.8}}
339
+ @media (max-width:560px){.cap{flex-basis:100%}}
340
+ .still .pulse{animation:none;opacity:.85}
341
+ .still *,.still *::before{transition:none!important}
342
+ .still .prog{display:none}
343
+ .still .ctrls,.still .tools{display:none}
344
+ .tools{display:flex;gap:6px;flex:none;order:3;margin-left:auto}
345
+ .pbtn.small{font-size:12px;padding:4px 11px;font-weight:600;color:var(--muted)}
346
+ .pbtn.small[aria-pressed="true"]{color:var(--ink);border-color:var(--muted);background:var(--surface)}`,da=`
347
+ .grid{display:none;fill:none;stroke:var(--ink);stroke-width:.6;opacity:.16;pointer-events:none}
348
+ svg.show-grid .grid{display:inline}
349
+ svg.pre-assemble > g:not(.g-anim){opacity:0}
350
+ `,Kg=ma+lf+da;var pf={name:"volume",description:"Stored data that is kept: a drum with two bands (a volume, a room's history, an archive).",size:[1.8,1.8,1.3],role:"folder",draw(s,e){let[r,n]=cr(e),i=Math.min(e.x1-e.x0,e.y1-e.y0)/2,o=(p,l)=>[r+i*Math.cos(p*Math.PI/180),n+i*Math.sin(p*Math.PI/180),l],t=(p,l,f)=>Array.from({length:13},(m,h)=>o(p+(l-p)*h/12,f)),a=(p,l,f)=>s.poly([...t(p,l,e.z0),...t(p,l,e.z1).reverse()],f),d=e.z1-e.z0,c=p=>t(-45,135,p).slice(1).map((l,f,m)=>s.line3(f?m[f-1]:o(-45,p),l,"det")).join("");return a(45,135,"lft")+a(-45,45,"rgt")+c(e.z0+d*.36)+c(e.z0+d*.68)+s.poly(Array.from({length:32},(p,l)=>o(l*360/32,e.z1)),"top")}},cf={name:"orb",description:"An agent: a white sphere with two eyes, on a small plate.",size:[1.5,1.5,1.6],role:"lead",cls:"orb",draw(s,e){s.def("orbG",ie("radialGradient",{id:"orbG",cx:"0.36",cy:"0.30",r:"0.80"},ie("stop",{offset:"0",style:"stop-color:#ffffff"})+ie("stop",{offset:"0.62",style:"stop-color:#f6f6f4"})+ie("stop",{offset:"1",style:"stop-color:#cfd0d6"})));let r=Li(e),[n,i]=re((e.x0+e.x1)/2,(e.y0+e.y1)/2,r.z1),o=23,t=i-o+3;s.bounds.add([n-o,t-o]),s.bounds.add([n+o,t+o]);let a=(d,c,p,l)=>ie("rect",{class:"eye",x:n+d-p/2,y:t+c-l/2,width:p,height:l,rx:p/2,transform:`rotate(-24 ${(n+d).toFixed(1)} ${(t+c).toFixed(1)})`});return s.blockFaces(r)+ie("ellipse",{class:"shade",cx:n,cy:i+1,rx:o*.8,ry:o*.3})+ie("circle",{class:"ball",cx:n,cy:t,r:o})+a(3,-7,6.4,13.5)+a(14,-12,5.4,10.5)},label(s,e,r){let[n,i]=re((s.x0+s.x1)/2,(s.y0+s.y1)/2,s.z0+1.95);return{x:n,y:i-26+(r?0:14),anchor:"middle"}},pulse:s=>[(s.x0+s.x1)/2,(s.y0+s.y1)/2,s.z0+.8,26]},ff={name:"person",description:"A human: body and head on a small plate. The label sits to the right.",size:[1.5,1.5,1.6],role:"person",cls:"person",draw(s,e){let r=Li(e),[n,i]=re((e.x0+e.x1)/2,(e.y0+e.y1)/2,r.z1);s.bounds.add([n-13,i-50]);let o=t=>t.toFixed(1);return s.blockFaces(r)+ie("path",{class:"body",d:`M${o(n-13)},${o(i-4)} C${o(n-13)},${o(i-34)} ${o(n+13)},${o(i-34)} ${o(n+13)},${o(i-4)} Q${o(n)},${o(i+4)} ${o(n-13)},${o(i-4)}z`})+ie("circle",{class:"head",cx:n,cy:i-40,r:10})},label(s){let[e,r]=re((s.x0+s.x1)/2,(s.y0+s.y1)/2,s.z0);return{x:e+30,y:r+2,anchor:"start"}},pulse:s=>[(s.x0+s.x1)/2,(s.y0+s.y1)/2,s.z0+.9,26]},mf={name:"screen",description:"An upright screen or terminal panel. `face`: terminal, chat, desktop, tiles, or one the host registers. `facing`: turn in degrees.",size:[1.64,.3,1.75],role:"term",draw(s,e,r){let[n,i]=cr(e),o=(e.x1-e.x0)/2,t=e.z1-e.z0,a=.14,d=(r.facing??0)*Math.PI/180,c=Math.cos(d),p=Math.sin(d),l=Math.sin(d)*a,f=-Math.cos(d)*a,m=[n-c*o,i-p*o],h=[n+c*o,i+p*o],y=e.z0,g=e.z1,k=s.poly([[h[0],h[1],y],[h[0]+l,h[1]+f,y],[h[0]+l,h[1]+f,g],[h[0],h[1],g]],"rgt")+s.poly([[m[0],m[1],g],[h[0],h[1],g],[h[0]+l,h[1]+f,g],[m[0]+l,m[1]+f,g]],"top")+s.poly([[m[0],m[1],y],[h[0],h[1],y],[h[0],h[1],g],[m[0],m[1],g]],"lft"),u=re(m[0],m[1],g),b=re(h[0],h[1],g),x=2*o*Ve,$=t*Ve,P=[(b[0]-u[0])/x,(b[1]-u[1])/x,0,1,u[0],u[1]],T=fr(r.face??"terminal")??Ri;return k+=s.onMatrix(P,x,$,(M,B)=>_i(M,B)+T(M,B),"scr"),k}},df={name:"monitor",description:"A block with a screen painted on its front-left face. `face` as for screen.",size:[2.4,.8,1.8],role:"term",draw(s,e,r){let n=fr(r.face??"terminal")??Ri;return s.blockFaces(e)+s.onFace(e,"left",(i,o)=>_i(i,o)+n(i,o),"scr")}},uf={name:"cloud",description:"A cloud lying on the floor: the internet, or a hosted service.",size:[3,2.4,.3],role:"cloud",draw:(s,e)=>dn(s,e)},jl={block:lt("block","A box. Size and colour role are free; add decorations with `deco`.",[2.4,2.4,1.6],"grey"),session:lt("session","An agent session: a box with terminal lines (`deco: [terminal: 4]`; add an icon the host registers with `icon: NAME`).",[2.6,2.6,1.8],"work",[{terminal:4}]),terminal:lt("terminal","A box with terminal lines on its front.",[1.6,1.2,.8],"term",[{terminal:2}]),server:lt("server","A service or daemon: a low box with two terminal lines.",[3,2.2,.9],"doz",[{terminal:2}]),chat:lt("chat","A chat server or room: a box with a chat bubble on top.",[3.6,4.4,1.3],"chat",["bubble"]),mailbox:lt("mailbox","A room or inbox: terminal lines and an envelope on top.",[2.4,2.4,1.6],"mail",[{terminal:3},"envelope"]),file:lt("file","A file or document: a low box with lines on top.",[1.6,1.6,.6],"file",["file-lines"]),folder:lt("folder","A folder or directory: a flat box.",[1.6,1.6,.5],"folder"),key:lt("key","A secret: a low box with a key on top.",[1.6,1.6,.6],"key",[],(s,e)=>Co(s,e)),socket:lt("socket","A socket: a small box with a round opening on top.",[1.2,1.2,.5],"socket",[],(s,e)=>Lo(s,e)),gate:lt("gate","A gate or proxy: a narrow upright slab, usually set in a fence wall.",[.3,2,1.1],"gate"),placeholder:lt("placeholder","A placeholder value: a small low box with lines.",[1.2,1,.45],"placeholder",["file-lines"]),orb:cf,person:ff,screen:mf,monitor:df,cloud:uf,volume:pf};var hf="border-color:hsl(38 80% 45%);background:hsl(38 80% 55% / .2)",yf={slab:{shape:"slab",pad:1.2,z:[-.8,.35],floor:!0,role:"slab",labelStyle:"face"},pad:{shape:"block",pad:.6,z:[0,.2],floor:!0,role:"pad",labelStyle:"floor"},fence:{shape:"walled",pad:.7,z:[0,.8],floor:!1,role:"fence",labelStyle:"face",legend:{label:"Fence",swatch:hf,box:!0,auto:!0},css:`.fz{fill:var(--fence-text)!important;opacity:1!important}
351
+ `},vm:{shape:"block",pad:.6,z:[0,.45],floor:!0,role:"sandbox",labelStyle:"face",legend:{label:"Sandbox VM",swatch:"border-color:hsl(170 35% 40%);background:hsl(170 40% 50% / .2)",box:!0,auto:!0}},platform:{shape:"block",pad:.6,z:[0,.7],floor:!0,role:"server",labelStyle:"face-right"},cloud:{shape:"cloud",pad:.8,z:[0,.2],floor:!0,role:"cloud",labelStyle:"floor"},zone:{shape:"zone",pad:.5,z:[0,.005],floor:!1,role:"grey",labelStyle:"floor"},tunnel:{shape:"tunnel",pad:0,z:[0,.8],floor:!1,role:"socket",labelStyle:"none",legend:{label:"Tailscale tunnel",swatch:"border-color:hsl(205 70% 50%);border-top-width:9px;opacity:.35",box:!1,auto:!1}}},Ls={regions:yf,nodes:jl,defaultNode:"block"};var ua=class extends Error{diags;constructor(e){super(e.filter(r=>r.severity==="error").map(r=>`line ${r.line}: ${r.message}`).join(`
352
+ `)),this.name="CompileError",this.diags=e}};function Rl(s,e,r={}){if(r.font&&!r.resolveVars)throw new Error("font: a self-contained drawing's (resolveVars)");let n=To(r.font,()=>bf(s,e,r)),i=r.font&&{sans:r.font.sans,mono:r.font.mono??Gi.mono};if(!n.ok&&r.strict==="throw")throw new ua(n.diags);if(!n.ok&&r.strict&&(n.scenes=[]),r.stepMs!==void 0)for(let a of n.scenes)for(let d of a.steps.steps)d.duration=r.stepMs;if(r.treatment!==void 0&&r.treatment!=="mono"&&r.treatment!=="none")throw new Error(`treatment: there is "mono" (and "none"), and no ${JSON.stringify(r.treatment)}`);let o=(r.treatment??n.doc?.treatment)==="mono";if(r.treatment==="mono"&&!r.resolveVars)throw new Error("treatment: a self-contained drawing's (resolveVars)");let t=n.theme;if(r.resolveVars)for(let a of n.scenes){let d=r.mode??"light",c=Tl(Ls)+ma+da;if(o){gf(a,t,d,c,r.mono,i);continue}let p={mode:d,theme:n.theme,css:c,fonts:i};a.rendered.svg=Mn(a.rendered.svg,p),a.rendered.variants&&(a.rendered.variants=Object.fromEntries(Object.entries(a.rendered.variants).map(([l,f])=>[l,Mn(f,p)]))),a.rendered.inks={surface:n.theme[p.mode].surface??n.theme.light.surface,control:n.theme[p.mode].control??n.theme.light.control,kinds:Object.fromEntries(Object.entries(n.theme.kinds).map(([l,f])=>[l,n.theme[p.mode][f.color]??f.color]))}}if(r.font)for(let a of n.scenes){let d=r.font.name,c=p=>p.replace("<svg ",`<svg data-font="${d.replace(/[^\w-]/g,"")}" `);a.rendered.svg=c(a.rendered.svg),a.rendered.variants&&(a.rendered.variants=Object.fromEntries(Object.entries(a.rendered.variants).map(([p,l])=>[p,c(l)])))}return r.resolveVars&&o&&t&&(n.theme={...t,kinds:Object.fromEntries(Object.entries(t.kinds).map(([a,d])=>{let c=n.scenes.map(p=>p.rendered.mono?.kinds[a]?.dash).find(p=>p&&p.length>1);return[a,c?{...d,ants:[c[0],c[1]]}:d]}))}),n}function gf(s,e,r,n,i,o){let t=[s.rendered.svg,...Object.values(s.rendered.variants??{})],a=dl(t.join(""),e,r,[...s.routes.map(c=>c.kind),...s.steps.kindsUsed],i),d=c=>ml(Mn(c,{mode:r,theme:a.theme,css:n+a.css,fonts:o}),a.look,s.id);s.rendered.svg=d(s.rendered.svg),s.rendered.variants&&(s.rendered.variants=Object.fromEntries(Object.entries(s.rendered.variants).map(([c,p])=>[c,d(p)]))),s.rendered.inks={surface:a.look.paper,control:a.look.ink,kinds:Object.fromEntries(Object.keys(e.kinds).map(c=>[c,a.look.ink]))},s.rendered.mono=a.look;for(let c of a.look.warnings)s.rendered.warnings.push({path:"",message:`black and white: ${c}`})}function bf(s,e,r){let n=yo(s),i=[...n.diags];if(i.some(p=>p.severity==="error"))return{ok:!1,diags:i,catalog:Ls,scenes:[]};let o=Oo(n);i.push(...o);let t=n.data;if(o.length){try{let p=Es(cn(e),t.roles??{},t.kinds??{}),l=o.map(f=>f.path);(Array.isArray(t.scenes)?t.scenes:[]).forEach((f,m)=>{try{let h=pn(f,`/scenes/${m}`,n,p,Ls,t.roles??{});i.push(...h.diags.filter(y=>!l.some(g=>y.path===g||y.path.startsWith(g+"/"))))}catch{}})}catch{}return i.sort((p,l)=>p.line-l.line||p.col-l.col),{ok:!1,diags:i,catalog:Ls,scenes:[]}}let a=rl(t,e,Ls,n,s,{snap:r.snap},i),d=0,c=(p,l,f)=>{let m=n.locate(p);a.diags.push({severity:"error",message:l,line:m.line,col:m.col,path:p,...f?{hint:f}:{}}),d++};return a.scenes.forEach((p,l)=>{El(p,a.theme);let f=p.raw.ants,m=In(p.raw)?.ids,h=p.routes.map(u=>u.id);if((m??[]).forEach((u,b)=>{h.includes(u)||c(`/scenes/${l}/ants${Array.isArray(f)?"":"/ids"}/${b}`,`no connector "${u}" in this scene`,h.length?`its connectors: ${h.slice(0,8).join(", ")}${h.length>8?", \u2026":""}`:void 0)}),!p.raw.motion)return;let y={isomotion:1,...p.raw.motion},g=`/scenes/${l}/motion`,k=_n(p,y,{kinds:a.theme.kinds}).diags;for(let u of k){let b=n.locate(g+u.path);a.diags.push({severity:u.severity,message:u.message,line:b.line,col:b.col,path:g+u.path,...u.hint?{hint:u.hint}:{}})}d+=k.length,k.length||(p.motion=y)}),d&&(a.ok=!1,a.diags.sort((p,l)=>p.line-l.line||p.col-l.col)),a}var _l={sans700_13:{"0":.5562,"1":.5037,"2":.5562,"3":.5562,"4":.5562,"5":.5562,"6":.5562,"7":.5562,"8":.5562,"9":.5562," ":.2778,"!":.333,'"':.4741,"#":.5562,$:.5562,"%":.8892,"&":.7222,"'":.2378,"(":.333,")":.333,"*":.3892,"+":.584,",":.2778,"-":.333,".":.2778,"/":.2778,":":.333,";":.333,"<":.584,"=":.584,">":.584,"?":.6108,"@":.9751,A:.7222,B:.7222,C:.7222,D:.7222,E:.667,F:.6108,G:.7778,H:.7222,I:.2778,J:.5562,K:.7222,L:.6108,M:.833,N:.7222,O:.7778,P:.667,Q:.7778,R:.7222,S:.667,T:.6108,U:.7222,V:.667,W:.9438,X:.667,Y:.667,Z:.6108,"[":.333,"\\":.2778,"]":.333,"^":.584,_:.5562,"`":.333,a:.5562,b:.6108,c:.5562,d:.6108,e:.5562,f:.333,g:.6108,h:.6108,i:.2778,j:.2778,k:.5562,l:.2778,m:.8892,n:.6108,o:.6108,p:.6108,q:.6108,r:.3892,s:.5562,t:.333,u:.6108,v:.5562,w:.7778,x:.5562,y:.5562,z:.5,"{":.3892,"|":.2798,"}":.3892,"~":.584,"\xB7":.333,"\u2192":1,"\u2190":1,"\u2191":.5,"\u2193":.5,"\u2019":.2426,"\u2018":.2426,"\u201C":.5,"\u201D":.5,"\u2026":1,"\u2013":.5562,"\u2014":1,"\u2715":.7622,"\xD7":.584,"\u2248":.5488,"\u2264":.5488,"\u2265":.5488,\u00E9:.5562},sans800_15:{"0":.5562,"1":.5037,"2":.5562,"3":.5562,"4":.5562,"5":.5562,"6":.5562,"7":.5562,"8":.5562,"9":.5562," ":.2778,"!":.333,'"':.4741,"#":.5562,$:.5562,"%":.8892,"&":.7222,"'":.2378,"(":.333,")":.333,"*":.3892,"+":.584,",":.2778,"-":.333,".":.2778,"/":.2778,":":.333,";":.333,"<":.584,"=":.584,">":.584,"?":.6108,"@":.9751,A:.7222,B:.7222,C:.7222,D:.7222,E:.667,F:.6108,G:.7778,H:.7222,I:.2778,J:.5562,K:.7222,L:.6108,M:.833,N:.7222,O:.7778,P:.667,Q:.7778,R:.7222,S:.667,T:.6108,U:.7222,V:.667,W:.9438,X:.667,Y:.667,Z:.6108,"[":.333,"\\":.2778,"]":.333,"^":.584,_:.5562,"`":.333,a:.5562,b:.6108,c:.5562,d:.6108,e:.5562,f:.333,g:.6108,h:.6108,i:.2778,j:.2778,k:.5562,l:.2778,m:.8892,n:.6108,o:.6108,p:.6108,q:.6108,r:.3892,s:.5562,t:.333,u:.6108,v:.5562,w:.7778,x:.5562,y:.5562,z:.5,"{":.3892,"|":.2798,"}":.3892,"~":.584,"\xB7":.333,"\u2192":1,"\u2190":1,"\u2191":.5,"\u2193":.5,"\u2019":.2426,"\u2018":.2426,"\u201C":.5,"\u201D":.5,"\u2026":1,"\u2013":.5562,"\u2014":1,"\u2715":.7622,"\xD7":.584,"\u2248":.5488,"\u2264":.5488,"\u2265":.5488,\u00E9:.5562},sans800_10_5:{"0":.5562,"1":.5037,"2":.5562,"3":.5562,"4":.5562,"5":.5562,"6":.5562,"7":.5562,"8":.5562,"9":.5562," ":.2778,"!":.333,'"':.4741,"#":.5562,$:.5562,"%":.8892,"&":.7222,"'":.2378,"(":.333,")":.333,"*":.3892,"+":.584,",":.2778,"-":.333,".":.2778,"/":.2778,":":.333,";":.333,"<":.584,"=":.584,">":.584,"?":.6108,"@":.9751,A:.7222,B:.7222,C:.7222,D:.7222,E:.667,F:.6108,G:.7778,H:.7222,I:.2778,J:.5562,K:.7222,L:.6108,M:.833,N:.7222,O:.7778,P:.667,Q:.7778,R:.7222,S:.667,T:.6108,U:.7222,V:.667,W:.9438,X:.667,Y:.667,Z:.6108,"[":.333,"\\":.2778,"]":.333,"^":.584,_:.5562,"`":.333,a:.5562,b:.6108,c:.5562,d:.6108,e:.5562,f:.333,g:.6108,h:.6108,i:.2778,j:.2778,k:.5562,l:.2778,m:.8892,n:.6108,o:.6108,p:.6108,q:.6108,r:.3892,s:.5562,t:.333,u:.6108,v:.5562,w:.7778,x:.5562,y:.5562,z:.5,"{":.3892,"|":.2798,"}":.3892,"~":.584,"\xB7":.333,"\u2192":1,"\u2190":1,"\u2191":.5,"\u2193":.5,"\u2019":.2426,"\u2018":.2426,"\u201C":.5,"\u201D":.5,"\u2026":1,"\u2013":.5562,"\u2014":1,"\u2715":.7622,"\xD7":.584,"\u2248":.5488,"\u2264":.5488,"\u2265":.5488,\u00E9:.5562},sans600_12:{"0":.5562,"1":.4977,"2":.5562,"3":.5562,"4":.5562,"5":.5562,"6":.5562,"7":.5562,"8":.5562,"9":.5562," ":.2778,"!":.3146,'"':.4344,"#":.5562,$:.5562,"%":.8892,"&":.7038,"'":.2222,"(":.333,")":.333,"*":.3892,"+":.584,",":.2778,"-":.333,".":.2778,"/":.2778,":":.3146,";":.3146,"<":.584,"=":.584,">":.584,"?":.5926,"@":.9884,A:.7038,B:.7038,C:.7222,D:.7222,E:.667,F:.6108,G:.7778,H:.7222,I:.2778,J:.5374,K:.7038,L:.5926,M:.833,N:.7222,O:.7778,P:.667,Q:.7778,R:.7222,S:.667,T:.6108,U:.7222,V:.667,W:.9438,X:.667,Y:.667,Z:.6108,"[":.3146,"\\":.2778,"]":.3146,"^":.5457,_:.5562,"`":.333,a:.5562,b:.5926,c:.5374,d:.5926,e:.5562,f:.3089,g:.5926,h:.5926,i:.2593,j:.2593,k:.5374,l:.2593,m:.8704,n:.5926,o:.5926,p:.5926,q:.5926,r:.3704,s:.5374,t:.3146,u:.5926,v:.5374,w:.7593,x:.5374,y:.5374,z:.5,"{":.3708,"|":.2731,"}":.3708,"~":.584,"\xB7":.333,"\u2192":1,"\u2190":1,"\u2191":.5,"\u2193":.5,"\u2019":.2301,"\u2018":.2301,"\u201C":.4443,"\u201D":.4443,"\u2026":1,"\u2013":.5562,"\u2014":1,"\u2715":.7622,"\xD7":.584,"\u2248":.5488,"\u2264":.5488,"\u2265":.5488,\u00E9:.5562},sans800_12:{"0":.5562,"1":.5037,"2":.5562,"3":.5562,"4":.5562,"5":.5562,"6":.5562,"7":.5562,"8":.5562,"9":.5562," ":.2778,"!":.333,'"':.4741,"#":.5562,$:.5562,"%":.8892,"&":.7222,"'":.2378,"(":.333,")":.333,"*":.3892,"+":.584,",":.2778,"-":.333,".":.2778,"/":.2778,":":.333,";":.333,"<":.584,"=":.584,">":.584,"?":.6108,"@":.9751,A:.7222,B:.7222,C:.7222,D:.7222,E:.667,F:.6108,G:.7778,H:.7222,I:.2778,J:.5562,K:.7222,L:.6108,M:.833,N:.7222,O:.7778,P:.667,Q:.7778,R:.7222,S:.667,T:.6108,U:.7222,V:.667,W:.9438,X:.667,Y:.667,Z:.6108,"[":.333,"\\":.2778,"]":.333,"^":.584,_:.5562,"`":.333,a:.5562,b:.6108,c:.5562,d:.6108,e:.5562,f:.333,g:.6108,h:.6108,i:.2778,j:.2778,k:.5562,l:.2778,m:.8892,n:.6108,o:.6108,p:.6108,q:.6108,r:.3892,s:.5562,t:.333,u:.6108,v:.5562,w:.7778,x:.5562,y:.5562,z:.5,"{":.3892,"|":.2798,"}":.3892,"~":.584,"\xB7":.333,"\u2192":1,"\u2190":1,"\u2191":.5,"\u2193":.5,"\u2019":.2426,"\u2018":.2426,"\u201C":.5,"\u201D":.5,"\u2026":1,"\u2013":.5562,"\u2014":1,"\u2715":.7622,"\xD7":.584,"\u2248":.5488,"\u2264":.5488,"\u2265":.5488,\u00E9:.5562},sans800_11_5:{"0":.5562,"1":.5037,"2":.5562,"3":.5562,"4":.5562,"5":.5562,"6":.5562,"7":.5562,"8":.5562,"9":.5562," ":.2778,"!":.333,'"':.4741,"#":.5562,$:.5562,"%":.8892,"&":.7222,"'":.2378,"(":.333,")":.333,"*":.3892,"+":.584,",":.2778,"-":.333,".":.2778,"/":.2778,":":.333,";":.333,"<":.584,"=":.584,">":.584,"?":.6108,"@":.9751,A:.7222,B:.7222,C:.7222,D:.7222,E:.667,F:.6108,G:.7778,H:.7222,I:.2778,J:.5562,K:.7222,L:.6108,M:.833,N:.7222,O:.7778,P:.667,Q:.7778,R:.7222,S:.667,T:.6108,U:.7222,V:.667,W:.9438,X:.667,Y:.667,Z:.6108,"[":.333,"\\":.2778,"]":.333,"^":.584,_:.5562,"`":.333,a:.5562,b:.6108,c:.5562,d:.6108,e:.5562,f:.333,g:.6108,h:.6108,i:.2778,j:.2778,k:.5562,l:.2778,m:.8892,n:.6108,o:.6108,p:.6108,q:.6108,r:.3892,s:.5562,t:.333,u:.6108,v:.5562,w:.7778,x:.5562,y:.5562,z:.5,"{":.3892,"|":.2798,"}":.3892,"~":.584,"\xB7":.333,"\u2192":1,"\u2190":1,"\u2191":.5,"\u2193":.5,"\u2019":.2426,"\u2018":.2426,"\u201C":.5,"\u201D":.5,"\u2026":1,"\u2013":.5562,"\u2014":1,"\u2715":.7622,"\xD7":.584,"\u2248":.5488,"\u2264":.5488,"\u2265":.5488,\u00E9:.5562},sans400_13:{"0":.5562,"1":.4856,"2":.5562,"3":.5562,"4":.5562,"5":.5562,"6":.5562,"7":.5562,"8":.5562,"9":.5562," ":.2778,"!":.2778,'"':.355,"#":.5562,$:.5562,"%":.8892,"&":.667,"'":.1909,"(":.333,")":.333,"*":.3892,"+":.584,",":.2778,"-":.333,".":.2778,"/":.2778,":":.2778,";":.2778,"<":.584,"=":.584,">":.584,"?":.5562,"@":1.0151,A:.667,B:.667,C:.7222,D:.7222,E:.667,F:.6108,G:.7778,H:.7222,I:.2778,J:.5,K:.667,L:.5562,M:.833,N:.7222,O:.7778,P:.667,Q:.7778,R:.7222,S:.667,T:.6108,U:.7222,V:.667,W:.9438,X:.667,Y:.667,Z:.6108,"[":.2778,"\\":.2778,"]":.2778,"^":.4692,_:.5562,"`":.333,a:.5562,b:.5562,c:.5,d:.5562,e:.5562,f:.2607,g:.5562,h:.5562,i:.2222,j:.2222,k:.5,l:.2222,m:.833,n:.5562,o:.5562,p:.5562,q:.5562,r:.333,s:.5,t:.2778,u:.5562,v:.5,w:.7222,x:.5,y:.5,z:.5,"{":.334,"|":.2598,"}":.334,"~":.584,"\xB7":.333,"\u2192":1,"\u2190":1,"\u2191":.5,"\u2193":.5,"\u2019":.205,"\u2018":.205,"\u201C":.333,"\u201D":.333,"\u2026":1,"\u2013":.5562,"\u2014":1,"\u2715":.7622,"\xD7":.584,"\u2248":.5488,"\u2264":.5488,"\u2265":.5488,\u00E9:.5562}};var Cl={name:"arimo",sans:"Arimo, Arial, Helvetica, sans-serif",widths:_l};function Cn(s){if(s.font!==void 0&&s.font!=="arimo")throw new Error(`font: there is "arimo" (or none said: the system's), and no ${JSON.stringify(s.font)}`);let e=Rl(s.src,s.theme,{mode:s.mode??"light",resolveVars:!0,strict:"throw",...s.treatment?{treatment:s.treatment}:{},...s.font?{font:Cl}:{}}),r=s.scene===void 0?e.scenes[0]:e.scenes.find(o=>o.id===s.scene);if(!r)throw new Error(`no scene ${JSON.stringify(s.scene)} (there ${e.scenes.length===1?"is":"are"} ${e.scenes.map(o=>o.id).join(", ")})`);let n=s.motion??r.motion??(r.steps.steps.length?Il(r):void 0);if(!n)throw new Error("this drawing has no motion: no motion of its own, no steps, and none given");let i=_n(r,n,{kinds:e.theme.kinds});if(!i.ok)throw new Error(i.diags.map(o=>`${o.path}: ${o.message}${o.hint?` (${o.hint})`:""}`).join(`
353
+ `));return{compiled:e,scene:r,timeline:i}}var Ln=(s,e)=>s/e*1e3,yr=(s,e)=>Math.max(1,Math.ceil(s/1e3*e-1e-9));function ha(s,e,r,n={}){let i=vl(s.scene,s.timeline.at(Ln(e,r),n.ambient?{ambient:n.ambient}:{}));return n.prefix?kf(i,n.prefix):i}var ya=(s,e,r)=>s.timeline.cues(Ln(e,r)),kf=(s,e)=>s.replace(/(\sid=")([^"]+)"/g,`$1${e}$2"`).replace(/url\(#([^)]+)\)/g,`url(#${e}$1)`).replace(/(\shref="#)([^"]+)"/g,`$1${e}$2"`),xf=s=>{for(let e of["fps","width","height"])if(!(Number.isFinite(s[e])&&s[e]>0))throw new Error(`isometricMetadata: ${e} is a number over 0`);return({props:e})=>({...s,durationInFrames:yr(Cn(e).timeline.duration,s.fps)})};function $f(s){if(typeof s?.url!="string"||!s.url)throw new Error("isometricFonts: url is where your Arimo file is (the package has none)");return{family:"Arimo",url:s.url,weight:"400 700",...s.format?{format:s.format}:{}}}function Sf(s){let e=()=>new Error("isometricTiming: { linear: TIME } or { spring: { mass, damping, stiffness, duration } }, a time being ms, '1.2s' or '30f'");if(!s||typeof s!="object"||"linear"in s=="spring"in s)throw e();let r="linear"in s?s.linear:s.spring?.duration;if(("linear"in s||r!==void 0)&&!(ct(r,30)>0))throw e();if("spring"in s)for(let i of["mass","damping","stiffness"]){let o=s.spring?.[i];if(o!==void 0&&!(Number.isFinite(o)&&o>0))throw e()}let n=i=>ca(s,i);return{getDurationInFrames:({fps:i})=>yr(n(i),i),getProgress:({frame:i,fps:o})=>fa(s,Math.max(0,Ln(i,o)),n(o))}}function wa(s){let{src:e,theme:r,motion:n,scene:i,mode:o,treatment:t,font:a}=s;return ga(()=>Cn({src:e,theme:r,motion:n,scene:i,mode:o,treatment:t,font:a}),[e,r,n,i,o,t,a])}function Of(s){let e=Math.max(0,Math.min(1,s.presentationProgress)),r=s.presentationDirection==="entering"?e:s.passedProps.exiting==="stay"?1:1-e;return Dn("div",{style:{position:"absolute",inset:0,opacity:r}},s.children)}function xb(s={}){if(s.exiting!==void 0&&s.exiting!=="fade"&&s.exiting!=="stay")throw new Error(`isometricPresentation: exiting is "fade" or "stay", not ${JSON.stringify(s.exiting)}`);return{component:Of,props:s}}function $b(s){let e=Ll(),{fps:r}=ba(),n=Pf(),i=wa(s),o=s.prefix??`iso${n.replace(/[^\w-]/g,"")}-`,t=ga(()=>ha(i,e,r,{prefix:o,ambient:s.ambient}).replace("<svg ",'<svg width="100%" height="100%" '),[i,e,r,o,s.ambient]);return Dn("div",{className:s.className,style:{width:s.width??"100%",height:s.height??"100%",...s.style},dangerouslySetInnerHTML:{__html:t}})}function Sb(s){let e=Ll(),{fps:r}=ba(),n=wa(s);return ga(()=>ya(n,e,r),[n,e,r])}function Pb(s){let{fps:e}=ba(),r=wa(s);return Dn("div",{style:{display:"contents"}},...r.timeline.beats.map(n=>{let i=Math.ceil(n.start/1e3*e-1e-9),o=Math.max(i+1,yr(n.end,e));return Dn(vf,{key:n.name,name:n.say?.title??n.name,from:i,durationInFrames:o-i,layout:"none"},s.children(n))}))}var Mb=Pa;export{Mb as DEFAULT_THEME,$b as IsometricScene,Pb as IsometricSequences,ya as cueAt,Cn as drawingOf,ha as frameSvg,yr as framesOf,$f as isometricFonts,xf as isometricMetadata,xb as isometricPresentation,Sf as isometricTiming,Ln as timeOf,Sb as useIsometricCues};