@cardenelabs/dragon 0.35.1 → 0.36.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.
@@ -1,2 +1,2 @@
1
- "use strict";var DragonPlayer=(()=>{var Ye=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Ct=Object.getOwnPropertyNames;var Dt=Object.prototype.hasOwnProperty;var Rt=(e,r)=>{for(var i in r)Ye(e,i,{get:r[i],enumerable:!0})},Ft=(e,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ct(r))!Dt.call(e,a)&&a!==i&&Ye(e,a,{get:()=>r[a],enumerable:!(o=Nt(r,a))||o.enumerable});return e};var Bt=e=>Ft(Ye({},"__esModule",{value:!0}),e);var Lr={};Rt(Lr,{mountDiagram:()=>At});var be={ja:{cannotDraw:e=>`\u56F3\u3092\u63CF\u3051\u306A\u3044: ${e}`,overview:"\u5168\u4F53\u56F3",prev:"\u524D\u306E\u6BB5",pause:"\u6B62\u3081\u308B",play:"\u52D5\u304B\u3059",next:"\u6B21\u306E\u6BB5",steps:e=>`${e} \u306E\u6BB5`},en:{cannotDraw:e=>`Cannot draw the diagram: ${e}`,overview:"Overview",prev:"Previous step",pause:"Pause",play:"Play",next:"Next step",steps:e=>`Steps of ${e}`}};var st={clear:{name:"\u6F84\u3093\u3060\u8272",note:"\u767D\u3044\u5730\u306B\u3001\u4E2D\u304F\u3089\u3044\u306E\u660E\u308B\u3055\u306E\u9BAE\u3084\u304B\u306A 6 \u8272\u3002\u4ECA\u306E\u898B\u672C\u5E33\u306E\u8272",light:{page:"#f3f4f7",bg:"#ffffff",surf:"#ffffff",sunk:"#f5f6f8",ink:"#12141a",ink2:"#3f4451",mute:"#6b7180",hair:"#12141a1c",line:"#12141a40",sh:"#101828","on-c":"#ffffff","c-blue":"#467deb","t-blue":"#2e62ce","c-amber":"#d28008","t-amber":"#975b04","c-green":"#0ea886","t-green":"#07775e","c-violet":"#6c3bb2","t-violet":"#6c3bb2","c-rose":"#ba3e40","t-rose":"#b83c3f","c-slate":"#5d6677","t-slate":"#5d6677",coin:"#e9b114",coint:"#856300",coinin:"#a8740c",tint:"5%",edge:"20%",shA:".05",shB:".08",carry:"#65686f"},dark:{page:"#08090c",bg:"#0d0e12",surf:"#17191f",sunk:"#121419",ink:"#eceef3",ink2:"#c4c8d2",mute:"#9198a6",hair:"#eceef31f",line:"#eceef340",sh:"#000000","on-c":"#0d0e12","c-blue":"#7e7ef6","t-blue":"#989cfd","c-amber":"#c78135","t-amber":"#dd954b","c-green":"#20ac7a","t-green":"#35b986","c-violet":"#695b9f","t-violet":"#a79ae3","c-rose":"#bc434b","t-rose":"#fd7d81","c-slate":"#9ba3b2","t-slate":"#9da5b4",coin:"#f0c040",coint:"#f0c040",coinin:"#9a6a0c",tint:"6%",edge:"19%",shA:".45",shB:".35"}},paper:{name:"\u7D19\u3068\u58A8",note:"\u751F\u6210\u308A\u306E\u7D19\u306E\u5730\u306B\u3001\u85CD / \u9EC4\u571F / \u82D4 / \u8461\u8404 / \u6731 / \u920D\u306E\u304F\u3059\u3093\u3060 6 \u8272",light:{page:"#ece7dd",bg:"#f9f6f0",surf:"#fffcf6",sunk:"#f2ede4",ink:"#221e18",ink2:"#4b453b",mute:"#7b7366",hair:"#221e181f",line:"#221e1847",sh:"#3a2a10","on-c":"#fffcf6","c-blue":"#487dd5","t-blue":"#2d60b5","c-amber":"#c38405","t-amber":"#885a01","c-green":"#57a271","t-green":"#237143","c-violet":"#904698","t-violet":"#904698","c-rose":"#a9513e","t-rose":"#9f4836","c-slate":"#6a645a","t-slate":"#696359",coin:"#d4a52a",coint:"#7d5e05",coinin:"#9a7016",tint:"6%",edge:"22%",shA:".06",shB:".07",carry:"#68635c"},dark:{page:"#0e0d0b",bg:"#15130f",surf:"#1e1b17",sunk:"#191612",ink:"#ede6d8",ink2:"#cbc2b1",mute:"#9c9283",hair:"#ede6d81f",line:"#ede6d842",sh:"#000000","on-c":"#15130f","c-blue":"#5785d5","t-blue":"#76a6f9","c-amber":"#be8802","t-amber":"#d59e2f","c-green":"#52aa71","t-green":"#61b87e","c-violet":"#90529b","t-violet":"#d08edb","c-rose":"#bb4e3d","t-rose":"#f98672","c-slate":"#a9a295","t-slate":"#aca598",coin:"#dcb24e",coint:"#dcb24e",coinin:"#8a6a14",tint:"6%",edge:"19%",shA:".45",shB:".35"}},night:{name:"\u591C\u306E\u8A08\u5668",note:"\u9752\u307F\u306E\u9ED2\u306E\u5730\u306B\u3001\u5149\u308B\u6C34\u8272 / \u7425\u73C0 / \u82E5\u7DD1 / \u83EB / \u6843 \u306E 6 \u8272\u3002\u660E\u308B\u3044\u5074\u306F\u9752\u7070\u306E\u5730",light:{page:"#e9eef5",bg:"#f6f9fc",surf:"#ffffff",sunk:"#eef3f8",ink:"#0b1424",ink2:"#34425a",mute:"#64748b",hair:"#0b14241c",line:"#0b142440",sh:"#0b1424","on-c":"#ffffff","c-blue":"#0385cd","t-blue":"#086aa3","c-amber":"#ba8e0f","t-amber":"#7f5f04","c-green":"#0a8857","t-green":"#027449","c-violet":"#5839ba","t-violet":"#5839ba","c-rose":"#dd4a94","t-rose":"#b82375","c-slate":"#64748b","t-slate":"#56667c",coin:"#eab308",coint:"#7e6005",coinin:"#a16207",tint:"5%",edge:"22%",shA:".06",shB:".09",carry:"#596579"},dark:{page:"#060a12",bg:"#0a101c",surf:"#111a2a",sunk:"#0d1522",ink:"#e6edf7",ink2:"#b8c4d6",mute:"#8090a8",hair:"#e6edf71c",line:"#9fb3d145",sh:"#000000","on-c":"#0a101c","c-blue":"#3884b6","t-blue":"#62ace1","c-amber":"#be8533","t-amber":"#d59b4b","c-green":"#3ba774","t-green":"#4fb884","c-violet":"#7d4ecd","t-violet":"#b494fd","c-rose":"#bc3a74","t-rose":"#ff77ad","c-slate":"#96a3b5","t-slate":"#99a6b8",coin:"#facc15",coint:"#facc15",coinin:"#a16207",tint:"6%",edge:"19%",shA:".5",shB:".4"}}};var xe={sans:"Noto Sans JP Variable",mono:"JetBrains Mono Variable"},_t={0:590,1:590,2:590,3:590,4:590,5:590,6:590,7:590,8:590,9:590," ":228,"!":371,'"':575,"#":590,$:590,"%":963,"&":740,"'":325,"(":378,")":378,"*":507,"+":590,",":325,"-":371,".":325,"/":390,":":325,";":325,"<":590,"=":590,">":590,"?":514,"@":1007,A:642,B:682,C:657,D:715,E:616,F:586,G:718,H:758,I:330,J:568,K:686,L:579,M:854,N:750,O:771,P:668,Q:771,R:682,S:624,T:626,U:748,V:619,W:915,X:627,Y:581,Z:614,"[":378,"\\":390,"]":378,"^":590,_:568,"`":626,a:591,b:644,c:528,d:645,e:581,f:372,g:598,h:640,i:305,j:306,k:605,l:315,m:964,n:641,o:626,p:645,q:645,r:437,s:495,t:421,u:638,v:576,w:863,x:562,y:575,z:512,"{":378,"|":297,"}":378,"~":590,"\u2026":1e3,"\u2212":590,"\xD7":1e3,"\u2192":1e3,"\u2190":1e3,"\u2191":1e3,"\u2193":1e3,"\u2013":545,"\u2014":908,"\u2018":325,"\u2019":325,"\u201C":575,"\u201D":575,"\xB0":404,"\xB1":1e3,"\xB7":593,"\u2022":379},It=600,Gt=11904,$e=1e3;function it(e,r){return(e.codePointAt(0)??0)>=Gt?$e:r==="mono"?It:_t[e]??$e}var Wt="paper",ze=Object.fromEntries(Object.entries(st).map(([e,r])=>[e,{id:e,...r}]));function ke(e){return(e!==void 0&&Object.hasOwn(ze,e)?ze[e]:void 0)??ze[Wt]}function Pe(e,r){return Object.entries(e[r]).map(([i,o])=>`--${i}:${o}`).join(";")}var Me=`--sans:"${xe.sans}";--mono:"${xe.mono}"`,ve=["blue","amber","green","violet","rose"],W=(e,r,i="sans")=>({size:e,weight:r,family:i}),L={boxName:W(13,650),boxSub:W(11,500),boxSubStrong:W(11,700),regionName:W(12.5,700),regionNote:W(11,500),label:W(11,600,"mono"),labelJa:W(11,650),action:W(11,650),badge:W(10.5,700,"mono"),carrier:W(10.5,700,"mono"),carrierJa:W(10.5,700),stripTitle:W(12.5,700),fieldName:W(10.5,600),fieldValue:W(12,600,"mono"),fieldValueJa:W(12,600),tag:W(10.5,700),miniTitle:W(10.5,700),stepTitle:W(15,700),stepBody:W(13.5,500),stepNo:W(13,700,"mono"),button:W(14,700)},$={gap:10,margin:14,box:{h:72,minW:92,padX:12,radius:12,icon:24,iconRadius:7,iconY:-16,iconScale:.74,nameY:12,subY:27},region:{pad:18,gap:10,radius:14,inset:14,icon:24,iconRadius:7,iconScale:.68,nameY:58,line:16,minH:108},architecture:{columns:4,columnGap:56,maxColumnGap:160,rowGap:44,labelRoom:16},sequence:{columnGap:40,labelRoom:16,firstRow:22,rowGap:14,stepGap:8,minPitch:40,tail:18,selfW:34,selfH:18},edge:{inset:3,arrow:6,arrowHalf:3.5,parallel:5,ghostDash:5,flowDash:9},label:{h:20,padX:9,radius:10,offset:22,side:14,search:4,searchMax:400,soft:6},action:{h:22,padX:10,radius:11},badge:{r:9.5,ring:9,inset:4,along:14,short:44},carrier:{envW:24,envH:17,coinR:6.5,coinIn:3.8,tagH:18,tagPadX:8,samples:16},strip:{h:72,line:44,pad:12,icon:24,titleX:44,fieldGap:22,sepInset:14,tagGap:6,tagH:15,tagPadX:7,nameY:22,valueY:43},stroke:{hair:1,edge:1.7,edgeOn:2.25,arrow:1.5,flow:1.3,halo:7,on:1.75,glyph:2,lifeline:1.2,envelope:1.5,badgeRing:1.5},shadow:{near:.8,far:4,nearY:1,farY:3},mini:{w:168,pad:8,title:14,inset:12,radius:10},follow:{aspect:.75,minH:320,ease:.6},mix:{icon:14,regionIcon:16,regionIconEdge:34,cap:12,capEdge:42,badgePast:14,badgePastEdge:70,mini:62,miniBand:16,miniBandEdge:36,view:6},baseline:{label:3.8,badge:3.5,carrier:3.7,stripTitle:4.5,tag:3.6,action:3.8},rise:5,popFrom:.4,player:{gap:10,radius:12,button:36,hidden:1,focus:2}},D={intro:1.4,outro:4.6,tail:.6,stepBase:1.2,perChar:.025,stepMin:2.2,stepMax:5,dwell:1.2,edgeAt:.1,stagger:.5,draw:.55,drawCarry:.9,action:.9,change:.12,minShow:.8,labelDelay:.15,fade:.3,popFade:.4,untilFade:.2,still:.45},ot=10.5,K={inOut:"cubic-bezier(.65,0,.35,1)",out:"cubic-bezier(.22,1,.36,1)",pop:"cubic-bezier(.34,1.56,.64,1)"};var ue=e=>[...e].some(r=>(r.codePointAt(0)??0)>=11904);function Kt(e,r){return r==="mono"&&ue(e)?"sans":r}function B(e,r){let i=Kt(e,r.family),o=0;for(let a of e)o+=it(a,i);return o*r.size/$e}function He(e){return e.steps.flatMap((r,i)=>r.events.flatMap((o,a)=>o.type==="edge"?[{step:i,event:a,edge:o}]:[]))}function Se(e){let r=Xe(e),i=new Map;return e.boxes.forEach((o,a)=>{let t=o.region===void 0?void 0:r.get(o.region);i.set(o.id,o.color??t??ve[a%ve.length])}),i}function Xe(e){let r=new Map;return(e.regions??[]).forEach((i,o)=>r.set(i.id,i.color??ve[o%ve.length])),r}var Oe=(e,r)=>e.carry.kind==="coin"?"coin":r.get(e.from)??"slate";function qe(e,r,i){let o=e.boxes.find(t=>t.id===r);if(!o)return $.box.minW;let a=[B(o.name,L.boxName),B(o.sub??"",L.boxSub)];for(let t of e.steps)for(let n of t.events)n.type==="swap"&&n.box===r&&a.push(B(n.text,L.boxSubStrong)),i&&n.type==="action"&&n.box===r&&a.push(B(n.label,L.boxSubStrong));return Math.max($.box.minW,Math.max(...a)+$.box.padX*2)}function at(e,r){let i=Math.max(r.x-(e.x+e.w),e.x-(r.x+r.w)),o=Math.max(r.y-(e.y+e.h),e.y-(r.y+r.h));return Math.max(i,o)}function Yt(e){let r={a:e[0],b:e[1]??e[0],length:-1};for(let i=1;i<e.length;i++){let o=e[i-1],a=e[i],t=Math.hypot(a[0]-o[0],a[1]-o[1]);t>r.length&&(r={a:o,b:a,length:t})}return{a:r.a,b:r.b,vertical:Math.abs(r.b[0]-r.a[0])<Math.abs(r.b[1]-r.a[1])}}function Ue(e,r){let i=r;for(let o=1;o<e.length;o++){let a=e[o-1],t=e[o],n=Math.hypot(t[0]-a[0],t[1]-a[1]);if(i<=n&&n>0)return[a[0]+(t[0]-a[0])*i/n,a[1]+(t[1]-a[1])*i/n];i-=n}return e[e.length-1]}function Je(e){let r=0;for(let i=1;i<e.length;i++){let o=e[i-1],a=e[i];r+=Math.hypot(a[0]-o[0],a[1]-o[1])}return r}function Ee(e){let r=Je(e);return Ue(e,r<$.badge.short?r/2:$.badge.along)}var ye=e=>ue(e)?L.labelJa:L.label;function Le(e,r){let i=B(e.text,ye(e.text))+$.label.padX*2,o=$.label.h,a=Yt(e.points),t=(a.a[0]+a.b[0])/2,n=(a.a[1]+a.b[1])/2,s=e.side??(a.vertical?"right":"above"),{offset:l,side:c}=$.label,f=s==="above"?{x:t-i/2,y:n-l-o/2,w:i,h:o}:s==="below"?{x:t-i/2,y:n+l-o/2,w:i,h:o}:s==="left"?{x:t-c-i,y:n-o/2,w:i,h:o}:{x:t+c,y:n-o/2,w:i,h:o},h=s==="above"?[0,-1]:s==="below"?[0,1]:s==="left"?[-1,0]:[1,0],u=[Math.abs(h[1]),Math.abs(h[0])],p=s==="above"||s==="below"?i:o*4,d=w=>r.hard.every(b=>at(w,b)>=$.gap)&&r.soft.every(b=>at(w,b)>=$.label.soft),{search:x,searchMax:q}=$.label;for(let w=0;w<=q;w+=x)for(let b=0;b<=p;b+=x)for(let M of b===0?[1]:[1,-1]){let g={x:f.x+h[0]*w+u[0]*b*M,y:f.y+h[1]*w+u[1]*b*M,w:i,h:o};if(d(g))return{...g,step:e.step,event:e.event,text:e.text,family:ye(e.text).family,color:e.color}}return{...f,step:e.step,event:e.event,text:e.text,family:ye(e.text).family,color:e.color}}function lt(e,r){let i=0,o=0;for(let t of e.steps)for(let n of t.events)n.type!=="strip"||n.field!==r||(n.value!==void 0&&(i=Math.max(i,B(n.value,ue(n.value)?L.fieldValueJa:L.fieldValue))),n.tag!==void 0&&(o=Math.max(o,B(n.tag,L.tag)+$.strip.tagPadX*2)));let a=i+(o>0?(i>0?$.strip.tagGap:0)+o:0);return Math.max(B(r,L.fieldName),a)}function Te(e){if(!e.strip)return 0;let{titleX:r,fieldGap:i,pad:o}=$.strip;return r+B(e.strip.title,L.stripTitle)+i+e.strip.fields.reduce((t,n)=>t+lt(e,n)+i,0)-i+o}function je(e,r,i,o){if(!e.strip)return;let{titleX:a,fieldGap:t,pad:n,line:s,h:l}=$.strip,c=a+B(e.strip.title,L.stripTitle)+t,f=[],h=c,u=0;for(let p of e.strip.fields){let d=lt(e,p);h>c&&h+d>o-n&&(h=c,u++),f.push({name:p,x:r+h,y:i+u*s,w:d}),h+=d+t}return{x:r,y:i,w:o,h:l+u*s,title:e.strip.title,fields:f}}function Ae(e,r,i){let o=a=>{a.x+=r,a.y+=i};for(let a of e.boxes)o(a),a.cx+=r,a.cy+=i;for(let a of e.regions)a.y+=i,o(a.header);for(let a of e.lifelines)a.x+=r,a.y1+=i,a.y2+=i;for(let a of e.edges)a.points=a.points.map(([t,n])=>[t+r,n+i]),a.settle&&(a.settle=[a.settle[0]+r,a.settle[1]+i]);for(let a of e.labels)o(a);for(let a of e.actions)o(a);for(let a of e.badges)a.x+=r,a.y+=i;if(e.strip){e.strip.y+=i;for(let a of e.strip.fields)a.x+=r,a.y+=i}}function Ne(e,r,i){let{inset:o}=$.badge;for(let t of e){let n=t.type==="swap"||t.type==="action"?t.box:void 0,s=i.boxes.find(l=>l.id===n);if(s)return{step:r,x:s.x+o,y:s.y+o,color:s.color}}if(i.strip&&e.some(t=>t.type==="strip"))return{step:r,x:i.strip.x+o,y:i.strip.y+o,color:"slate"};let a=i.boxes[0];return{step:r,x:a.x+o,y:a.y+o,color:a.color}}function pt(e){let r=zt(e),i=Ht(e,r),o=r.map(()=>({top:0,bottom:0})),a=ct(e,r,i,o);for(let t=0;t<3&&Jt(a,r,i,o);t++)a=ct(e,r,i,o);return a}function zt(e){let r=e.regions??[],i=new Set(r.map(t=>t.id)),o=r.map(t=>({region:t,members:e.boxes.filter(n=>n.region===t.id).map(n=>n.id)})),a=e.boxes.filter(t=>t.region===void 0||!i.has(t.region)).map(t=>t.id);return a.length>0&&o.push({members:a}),o}var dt=e=>e==="left"||e==="right";function Ht(e,r){let i=$.architecture.columns,o=He(e).map(n=>n.edge),a=new Map;r.forEach((n,s)=>{let l=new Set(n.members),c=new Set,f=(w,b)=>w>=0&&w<i&&!c.has(`${w},${b}`),h=(w,b)=>{let M=Math.min(i-1,Math.max(0,w));for(let g=b;;g++)for(let T=0;T<i;T++)for(let j of[M+T,M-T])if(f(j,g))return[j,g]},u=(w,b,M)=>{a.set(w,{group:s,col:b,row:M}),c.add(`${b},${M}`)},p=1,d=w=>{for(let b of o){let M=b.from===w?b.to:b.to===w?b.from:void 0;if(M===void 0||!l.has(M)||a.has(M))continue;let g=a.get(w),[T,j]=dt(b.labelSide)?h(g.col,g.row+1):f(g.col+p,g.row)?[g.col+p,g.row]:h(g.col+p,g.row);u(M,T,j),d(M)}},x=w=>{for(let b=0;b<o.length;b++){let M=o[b],g=M?.from===w?M.to:M?.to===w?M.from:void 0,T=g===void 0?void 0:a.get(g);if(T&&T.group<s)return{order:b,col:T.col}}},q=0;for(;;){let w=n.members.filter(R=>!a.has(R));if(w.length===0)break;let b=w.map(R=>({id:R,anchor:x(R)})).filter(R=>R.anchor!==void 0);b.sort((R,_)=>(R.anchor?.order??0)-(_.anchor?.order??0));let M=b[0]??{id:w[0],anchor:void 0},g=M.anchor?.col??0;q===0&&(p=g>=(i-1)/2?-1:1);let[T,j]=f(g,0)?[g,0]:h(g,0);u(M.id,T,j),d(M.id),q++}});let t=[...new Set([...a.values()].map(n=>n.col))].sort((n,s)=>n-s);for(let n of a.values())n.col=t.indexOf(n.col);return a}function Xt(e){let r=[...e.matchAll(/ /g)].map(o=>o.index);if(r.length===0)return[e];let i=r.reduce((o,a)=>Math.abs(a-e.length/2)<Math.abs(o-e.length/2)?a:o);return[e.slice(0,i),e.slice(i+1)]}function Ut(e){let{icon:r,nameY:i,line:o,inset:a}=$.region,t=Xt(e.name),n=Math.max(r,...t.map(l=>B(l,L.regionName)),B(e.note??"",L.regionNote)),s=i-a+(t.length-1)*o+(e.note?o:0)+$.gap/2;return{w:n,h:s,lines:t}}function ct(e,r,i,o){let{box:a,region:t,architecture:n,margin:s,gap:l}=$,c=Se(e),f=Xe(e),h=He(e),u=Math.max(1,...[...i.values()].map(m=>m.col+1)),p=new Map(e.boxes.map(m=>[m.id,qe(e,m.id,!0)])),d=Array.from({length:u},(m,E)=>Math.max(a.minW,...[...i].filter(([,v])=>v.col===E).map(([v])=>p.get(v)??a.minW))),x=Array.from({length:Math.max(0,u-1)},()=>n.columnGap);for(let{edge:m}of h){let E=i.get(m.from),v=i.get(m.to);if(!E||!v||m.label===void 0||E.group!==v.group||E.row!==v.row||Math.abs(E.col-v.col)!==1||dt(m.labelSide))continue;let O=B(m.label,ye(m.label))+$.label.padX*2+n.labelRoom*2,V=Math.min(E.col,v.col);O<=n.maxColumnGap&&(x[V]=Math.max(x[V]??0,O))}let q=r.map(m=>m.region?Ut(m.region):void 0),w=Math.max(0,...q.map(m=>m?m.w+t.inset*2:0)),b=[];for(let m=0;m<u;m++)b.push(m===0?s+(w>0?w:t.pad):b[m-1]+d[m-1]+x[m-1]);let M=m=>b[m]+d[m]/2,g=[],T=[],j=s;r.forEach((m,E)=>{let v=Math.max(1,...m.members.map(ee=>(i.get(ee)?.row??0)+1)),O=o[E],V=j+t.pad+O.top;for(let ee of m.members){let ce=i.get(ee),N=e.boxes.find(he=>he.id===ee),A=p.get(ee)??a.minW,F=M(ce.col),J=V+ce.row*(a.h+n.rowGap);g.push({id:ee,name:N?.name??ee,...N?.sub!==void 0?{sub:N.sub}:{},...N?.icon!==void 0?{icon:N.icon}:{},color:c.get(ee)??"slate",x:F-A/2,y:J,w:A,h:a.h,cx:F,cy:J+a.h/2})}let X=V+v*a.h+(v-1)*n.rowGap,U=q[E],ne=Math.max(X+t.pad+O.bottom-j,U?U.h+t.inset*2:0,m.region?t.minH:0);T.push({group:E,y:j,h:ne,rows:v}),j+=ne+t.gap});let R=j-t.gap,_=new Map(g.map(m=>[m.id,m])),Y=m=>T[i.get(m)?.group??0],z=(m,E,v)=>g.some(O=>{if(O.id===E||O.id===v)return!1;let V=$.label.search;for(let X=1;X<m.length;X++){let[U,ne]=m[X-1],[ee,ce]=m[X];if(Math.min(U,ee)<=O.x+O.w+V&&Math.max(U,ee)>=O.x-V&&Math.min(ne,ce)<=O.y+O.h+V&&Math.max(ne,ce)>=O.y-V)return!0}return!1}),le=m=>{let E=_.get(m),v=Y(m);return(i.get(m)?.row??0)<v.rows-1?E.y+E.h+n.rowGap/2:Math.min(E.y+E.h+t.pad/2,v.y+v.h-$.edge.inset)},fe=m=>{let E=_.get(m),v=Y(m);return(i.get(m)?.row??0)>0?E.y-n.rowGap/2:Math.max(E.y-t.pad/2,v.y+$.edge.inset)},te=$.edge.inset,ie=(m,E)=>{let v=_.get(m),O=_.get(E),V=i.get(m),X=i.get(E);if(V.group===X.group&&V.row===X.row){let F=O.cx>v.cx,J=[[F?v.x+v.w:v.x,v.cy],[F?O.x-te:O.x+O.w+te,O.cy]];if(!z(J,m,E))return J;let he=le(m);return[[v.cx,v.y+v.h],[v.cx,he],[O.cx,he],[O.cx,O.y+O.h+te]]}let U=O.cy>v.cy,ne=[v.cx,U?v.y+v.h:v.y],ee=[O.cx,U?O.y-te:O.y+O.h+te];if(V.col===X.col){let F=[ne,ee];if(!z(F,m,E))return F;let J=v.x+v.w+(x[V.col]??n.columnGap)/2;return[[v.x+v.w,v.cy],[J,v.cy],[J,O.cy],[O.x+O.w+te,O.cy]]}let ce=O.cx>v.cx,N=U?le(m):fe(m),A=[[ne,[v.cx,O.cy],[ce?O.x-te:O.x+O.w+te,O.cy]],[[ce?v.x+v.w:v.x,v.cy],[O.cx,v.cy],ee],[ne,[v.cx,N],[O.cx,N],ee]];return A.find(F=>!z(F,m,E))??A[2]},y=h.map(({step:m,event:E,edge:v})=>{let O=_.get(v.to);return{step:m,event:E,from:v.from,to:v.to,points:ie(v.from,v.to),color:Oe(v,c),carry:v.carry,settle:[O.cx,O.cy+a.iconY]}});for(let m of y){if(m.points.length!==2||!y.some(U=>U.from===m.to&&U.to===m.from&&U.points.length===2))continue;let[v,O]=m.points,V=Math.abs(O[1]-v[1])<Math.abs(O[0]-v[0]),X=(m.from<m.to?1:-1)*$.edge.parallel;m.points=m.points.map(([U,ne])=>V?[U,ne+X]:[U+X,ne])}let S=[];r.forEach((m,E)=>{let v=T[E],O=q[E];!m.region||!O||S.push({id:m.region.id,lines:O.lines,...m.region.note!==void 0?{note:m.region.note}:{},...m.region.icon!==void 0?{icon:m.region.icon}:{},color:f.get(m.region.id)??"slate",x:s,y:v.y,w:0,h:v.h,header:{x:s+t.inset,y:v.y+t.inset,w:O.w,h:O.h}})});let k=[];for(let m of y){let E=e.steps[m.step]?.events[m.event];if(E?.type!=="edge"||E.label===void 0)continue;let v=[...S.map(O=>O.header),...k.filter(O=>O.step===m.step)];k.push(Le({step:m.step,event:m.event,text:E.label,points:m.points,color:m.color,...E.labelSide?{side:E.labelSide}:{}},{hard:g,soft:v}))}let C={kind:"architecture",width:0,height:0,regions:S,boxes:g,lifelines:[],edges:y,labels:k,actions:[],badges:[]},G=k.length>0?Math.max(0,s+$.label.soft-Math.min(...k.map(m=>m.x))):0;G>0&&Ae(C,G,0);let H=Math.max(...g.map(m=>m.x+m.w+t.pad),...k.map(m=>m.x+m.w+$.label.soft),...y.flatMap(m=>m.points.map(E=>E[0]+t.pad))),I=Math.max(H+s,Te(e)+s*2);for(let m of S)m.w=I-s*2;let re=je(e,s,R+l,I-s*2);return C.width=I,C.height=(re?re.y+re.h:R)+s,re&&(C.strip=re),C.badges=e.steps.map((m,E)=>{let v=y.find(X=>X.step===E);if(!v)return Ne(m.events,E,C);let[O,V]=Ee(v.points);return{step:E,x:O,y:V,color:v.color}}),C}function Jt(e,r,i,o){let a=!1,t=$.label.soft;for(let n of e.labels){let s=e.edges.find(d=>d.step===n.step&&d.event===n.event),l=s&&i.get(s.from),c=s&&i.get(s.to);if(!l||!c||l.group!==c.group||!r[l.group]?.region)continue;let f=e.regions.find(d=>d.id===r[l.group]?.region?.id),h=o[l.group];if(!f||!h)continue;let u=f.y+t-n.y,p=n.y+n.h-(f.y+f.h-t);u>0&&(h.top+=u,a=!0),p>0&&(h.bottom+=p,a=!0)}return a}function ft(e){let{box:r,sequence:i,label:o,margin:a,gap:t}=$,n=Se(e),s=e.sequence?.lifelines??[],l=[...s,...e.boxes.map(y=>y.id).filter(y=>!s.includes(y))],c=new Map(l.map((y,S)=>[y,S])),f=l.map(y=>qe(e,y,!1)),h=f.slice(1).map((y,S)=>f[S]/2+y/2+i.columnGap),u=[];for(let y of e.steps)for(let S of y.events){if(S.type!=="edge"||S.label===void 0)continue;let k=c.get(S.from)??0,C=c.get(S.to)??0,G=B(S.label,ye(S.label))+o.padX*2;k===C?k<h.length&&u.push({from:k,to:k+1,need:i.selfW+o.side+G+i.labelRoom}):u.push({from:Math.min(k,C),to:Math.max(k,C),need:G+i.labelRoom*2})}u.sort((y,S)=>y.to-y.from-(S.to-S.from));for(let{from:y,to:S,need:k}of u){let C=0;for(let H=y;H<S;H++)C+=h[H]??0;if(C>=k)continue;let G=(k-C)/(S-y);for(let H=y;H<S;H++)h[H]=(h[H]??0)+G}let p=[];l.forEach((y,S)=>p.push(S===0?a+f[0]/2:p[S-1]+h[S-1]));let d=l.map((y,S)=>{let k=e.boxes.find(H=>H.id===y),C=f[S],G=p[S];return{id:y,name:k?.name??y,...k?.sub!==void 0?{sub:k.sub}:{},...k?.icon!==void 0?{icon:k.icon}:{},color:n.get(y)??"slate",x:G-C/2,y:a,w:C,h:r.h,cx:G,cy:a+r.h/2}}),x=a+r.h,q=[],w=[],b=[],M=x+i.firstRow,g=0,T=!0;e.steps.forEach((y,S)=>{y.events.forEach((k,C)=>{if(k.type!=="edge"&&k.type!=="action")return;let G,H;if(k.type==="edge"){let I=k.labelSide??"above",re=k.from===k.to,m=k.label!==void 0;G=m&&I==="above"?o.offset+o.h/2:t,H=re?i.selfH+t:m&&I==="below"?o.offset+o.h/2:t}else G=$.action.h/2,H=$.action.h/2;if(M=T?M+G:M+Math.max(i.minPitch,g+i.rowGap+G)+(C===0&&S>0?i.stepGap:0),T=!1,g=H,k.type==="edge"){let I=p[c.get(k.from)??0],re=p[c.get(k.to)??0],m=Math.sign(re-I)||1,E=I===re?[[I,M],[I+i.selfW,M],[I+i.selfW,M+i.selfH],[I+$.edge.inset,M+i.selfH]]:[[I,M],[re-m*$.edge.inset,M]],v=Oe(k,n);q.push({step:S,event:C,from:k.from,to:k.to,points:E,color:v,carry:k.carry}),k.label!==void 0&&b.push({step:S,event:C,text:k.label,points:E,color:v,...k.labelSide?{side:k.labelSide}:I===re?{side:"right"}:{}})}else{let I=p[c.get(k.box)??0],re=B(k.label,L.action)+$.action.padX*2;w.push({step:S,event:C,box:k.box,text:k.label,color:n.get(k.box)??"slate",x:I+$.badge.r+4,y:M-$.action.h/2,w:re,h:$.action.h})}})});let j=(T?x:M+g)+i.tail,R=l.map((y,S)=>({id:y,x:p[S],y1:x,y2:j})),_=[];for(let y of b){let S=[..._.filter(k=>k.step===y.step),...w];_.push(Le(y,{hard:d,soft:S}))}let Y={kind:"sequence",width:0,height:0,regions:[],boxes:d,lifelines:R,edges:q,labels:_,actions:w,badges:[]},z=[...d.map(y=>y.x),..._.map(y=>y.x),...w.map(y=>y.x)],le=Math.max(0,a-Math.min(...z));le>0&&Ae(Y,le,0);let fe=[...d.map(y=>y.x+y.w),..._.map(y=>y.x+y.w),...w.map(y=>y.x+y.w),...q.flatMap(y=>y.points.map(S=>S[0]))],te=Math.max(Math.max(...fe)+a,Te(e)+a*2),ie=je(e,a,j+t,te-a*2);return Y.width=te,Y.height=(ie?ie.y+ie.h:j)+a,ie&&(Y.strip=ie),Y.badges=Qt(e,Y),Y}function Qt(e,r){return e.steps.map((i,o)=>{let a=r.edges.find(s=>s.step===o);if(a){let[s,l]=Ee(a.points);return{step:o,x:s,y:l,color:a.color}}let t=r.actions.find(s=>s.step===o),n=t&&r.lifelines.find(s=>s.id===t.box);return t&&n?{step:o,x:n.x,y:t.y+t.h/2,color:t.color}:Ne(i.events,o,r)})}var Zt={string:"\u6587\u5B57\u5217\u306B\u3059\u308B",integer:"\u6574\u6570\u306B\u3059\u308B",number:"\u6570\u306B\u3059\u308B",object:"\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u3059\u308B",array:"\u914D\u5217\u306B\u3059\u308B",boolean:"true \u304B false \u306B\u3059\u308B",null:"null \u306B\u3059\u308B"},er={string:"Use a string",integer:"Use an integer",number:"Use a number",object:"Use an object",array:"Use an array",boolean:"Use true or false",null:"Use null"},mt=(e,r)=>`${e} ${r}${e===1?"":"s"}`,tr={additionalProperties:e=>`${e} \u3068\u3044\u3046\u6B04\u306F\u66F8\u3051\u306A\u3044`,required:e=>`${e} \u306E\u6B04\u304C\u8981\u308B`,enum:e=>`${e.join(" / ")} \u306E\u3069\u308C\u304B\u306B\u3059\u308B`,type:e=>Zt[e]??`${e} \u306B\u3059\u308B`,minLength:e=>`${e} \u5B57\u4EE5\u4E0A\u66F8\u304F`,pattern:e=>e?`${e.space?"\u7A7A\u767D\u3068 ":""}${e.chars.join(" ")} \u306F\u4F7F\u3048\u306A\u3044`:"\u4F7F\u3048\u306A\u3044\u5B57\u304C\u5165\u3063\u3066\u3044\u308B",minItems:e=>`${e} \u3064\u4EE5\u4E0A\u66F8\u304F`,minimum:e=>`${e} \u4EE5\u4E0A\u306B\u3059\u308B`,const:e=>`${e} \u306B\u3059\u308B`,not:e=>e?`${e.field} \u306E\u6B04\u306F kind \u304C ${e.kind} \u306E\u6642\u3060\u3051\u66F8\u3051\u308B`:"\u3053\u306E\u6B04\u306E\u7D44\u307F\u5408\u308F\u305B\u306F\u66F8\u3051\u306A\u3044",anyOf:e=>e.length>0?`${e.join(" \u304B ")} \u306E${e.length===2?"\u3069\u3061\u3089\u304B":"\u3069\u308C\u304B"}\u306E\u6B04\u304C\u8981\u308B`:"\u66F8\u3051\u308B\u5F62\u306E\u3069\u308C\u306B\u3082\u5408\u308F\u306A\u3044",oneOf:"\u66F8\u3051\u308B\u5F62\u306E\u3069\u308C\u304B 1 \u3064\u3060\u3051\u306B\u5408\u308F\u305B\u308B",discriminator:(e,r)=>`${e} \u306F ${r.join(" / ")} \u306E\u3069\u308C\u304B\u306B\u3059\u308B`,newer:(e,r)=>`\u7248 ${e} \u306E\u56F3\u306F\u3001\u3053\u306E\u9053\u5177 (\u7248 ${r}) \u3088\u308A\u65B0\u3057\u3044\u306E\u3067\u8AAD\u3081\u306A\u3044\u3002\u9053\u5177\u3092\u65B0\u3057\u304F\u3059\u308B`},rr={additionalProperties:e=>`The ${e} field is not allowed`,required:e=>`The ${e} field is required`,enum:e=>`Use one of ${e.join(" / ")}`,type:e=>er[e]??`Use ${e}`,minLength:e=>`Write at least ${mt(e,"character")}`,pattern:e=>e?`Cannot contain ${e.space?"spaces or ":""}${e.chars.join(" ")}`:"Contains characters that are not allowed",minItems:e=>`Write at least ${mt(e,"item")}`,minimum:e=>`Use ${e} or greater`,const:e=>`Use ${e}`,not:e=>e?`The ${e.field} field is allowed only when kind is ${e.kind}`:"This combination of fields is not allowed",anyOf:e=>e.length>0?`Write one of the ${e.join(" or ")} fields`:"Does not match any of the allowed shapes",oneOf:"Match exactly one of the allowed shapes",discriminator:(e,r)=>`${e} is one of ${r.join(" / ")}`,newer:(e,r)=>`Version ${e} diagrams are newer than this tool (version ${r}) and cannot be read. Update the tool`},Ce={ja:tr,en:rr};function nr(e){let r=0;for(let i of e)r++;return r}var Ze=gt,Qe={title:"dragon \u306E\u56F3\u306E\u539F\u672C",description:"\u533A\u753B\u3001\u7BB1\u3001\u7DDA\u3001\u904B\u3076\u7269\u3001\u6BB5\u3001\u4E2D\u8EAB\u306E\u5E2F\u306E 6 \u90E8\u54C1\u3092\u5171\u901A\u306E\u9AA8\u7D44\u307F\u306B\u7F6E\u304D\u3001\u56F3\u306E\u7A2E\u985E\u3060\u3051\u306E\u7269\u306F\u7A2E\u985E\u306E\u6B04\u306B\u7F6E\u304F\u3002\u5EA7\u6A19\u306F\u6301\u305F\u306A\u3044\u3002",type:"object",additionalProperties:!1,required:["version","kind","title","boxes","steps"],properties:{version:{description:"\u5F62\u5F0F\u306E\u7248",type:"integer",minimum:1},kind:{description:"\u56F3\u306E\u7A2E\u985E",enum:["sequence","architecture"]},title:{$ref:"#/definitions/text"},view:{description:"\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059",enum:["fixed","follow"]},regions:{type:"array",items:{$ref:"#/definitions/region"}},boxes:{type:"array",minItems:1,items:{$ref:"#/definitions/box"}},strip:{$ref:"#/definitions/strip"},steps:{type:"array",minItems:1,items:{$ref:"#/definitions/step"}},sequence:{$ref:"#/definitions/sequence"}},if:{required:["kind"],properties:{kind:{const:"sequence"}}},then:{required:["sequence"]},else:{not:{required:["sequence"]}},definitions:{text:{type:"string",minLength:1},id:{type:"string",pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},color:{enum:["blue","amber","green","violet","rose","slate","coin"]},region:{type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},note:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},icon:{$ref:"#/definitions/text"}}},box:{type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},sub:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},icon:{$ref:"#/definitions/text"},region:{$ref:"#/definitions/id"}}},strip:{type:"object",additionalProperties:!1,required:["title","fields"],properties:{title:{$ref:"#/definitions/text"},fields:{type:"array",minItems:1,items:{$ref:"#/definitions/text"}}}},step:{type:"object",additionalProperties:!1,required:["title","body","events"],properties:{title:{$ref:"#/definitions/text"},body:{$ref:"#/definitions/text"},code:{$ref:"#/definitions/text"},events:{type:"array",items:{$ref:"#/definitions/event"}}}},event:{description:"\u6BB5\u306E\u4E2D\u3067\u8D77\u304D\u308B\u3053\u3068\u3002\u8D77\u304D\u308B\u9806\u306B\u4E26\u3079\u308B",type:"object",required:["type"],discriminator:{propertyName:"type"},oneOf:[{description:"\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B",type:"object",additionalProperties:!1,required:["type","from","to","carry"],properties:{type:{const:"edge"},from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"},carry:{$ref:"#/definitions/carry"},labelSide:{description:"\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)",enum:["above","below","left","right"]}}},{description:"\u7BB1\u306E\u4E2D\u306E\u51E6\u7406",type:"object",additionalProperties:!1,required:["type","box","label"],properties:{type:{const:"action"},box:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}},{description:"\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"swap"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"}}},{description:"\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D",type:"object",additionalProperties:!1,required:["type","field"],anyOf:[{required:["value"]},{required:["tag"]}],properties:{type:{const:"strip"},field:{$ref:"#/definitions/text"},value:{$ref:"#/definitions/text"},tag:{$ref:"#/definitions/text"}}}]},carry:{description:"\u7DDA\u306E\u4E0A\u3092\u8D70\u308B\u7269\u3002\u5C01\u7B52 (\u30E1\u30C3\u30BB\u30FC\u30B8\u3084\u8981\u6C42)\u3001\u672D (\u540D\u524D\u306E\u3042\u308B\u5024)\u3001\u786C\u8CA8 (\u4FA1\u5024)\u3001\u7121\u3057",type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["envelope","tag","coin","none"]},text:{$ref:"#/definitions/text"}},if:{required:["kind"],properties:{kind:{const:"tag"}}},then:{required:["text"]},else:{not:{required:["text"]}}},sequence:{description:"\u6642\u7CFB\u5217\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u751F\u5B58\u7DDA\u3092\u5DE6\u304B\u3089\u4E26\u3079\u308B\u9806",type:"object",additionalProperties:!1,required:["lifelines"],properties:{lifelines:{type:"array",minItems:1,items:{$ref:"#/definitions/id"}}}}}};var sr=Object.prototype.hasOwnProperty,Q=nr;var ut={enum:["blue","amber","green","violet","rose","slate","coin"]},ge=new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$","u");function De(e,{instancePath:r="",parentData:i,parentDataProperty:o,rootData:a=e}={}){let t=null,n=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.id===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};t===null?t=[s]:t.push(s),n++}if(e.name===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};t===null?t=[s]:t.push(s),n++}for(let s in e)if(!(s==="id"||s==="name"||s==="note"||s==="color"||s==="icon")){let l={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),n++}if(e.id!==void 0){let s=e.id;if(typeof s=="string"){if(!ge.test(s)){let l={instancePath:r+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.name!==void 0){let s=e.name;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.note!==void 0){let s=e.note;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/note",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.color!==void 0){let s=e.color;if(!(s==="blue"||s==="amber"||s==="green"||s==="violet"||s==="rose"||s==="slate"||s==="coin")){let l={instancePath:r+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:ut.enum},message:"must be equal to one of the allowed values"};t===null?t=[l]:t.push(l),n++}}if(e.icon!==void 0){let s=e.icon;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/icon",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/icon",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}}else{let s={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[s]:t.push(s),n++}return De.errors=t,n===0}function Re(e,{instancePath:r="",parentData:i,parentDataProperty:o,rootData:a=e}={}){let t=null,n=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.id===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};t===null?t=[s]:t.push(s),n++}if(e.name===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};t===null?t=[s]:t.push(s),n++}for(let s in e)if(!(s==="id"||s==="name"||s==="sub"||s==="color"||s==="icon"||s==="region")){let l={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),n++}if(e.id!==void 0){let s=e.id;if(typeof s=="string"){if(!ge.test(s)){let l={instancePath:r+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.name!==void 0){let s=e.name;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.sub!==void 0){let s=e.sub;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/sub",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/sub",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.color!==void 0){let s=e.color;if(!(s==="blue"||s==="amber"||s==="green"||s==="violet"||s==="rose"||s==="slate"||s==="coin")){let l={instancePath:r+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:ut.enum},message:"must be equal to one of the allowed values"};t===null?t=[l]:t.push(l),n++}}if(e.icon!==void 0){let s=e.icon;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/icon",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/icon",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.region!==void 0){let s=e.region;if(typeof s=="string"){if(!ge.test(s)){let l={instancePath:r+"/region",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/region",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}}else{let s={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[s]:t.push(s),n++}return Re.errors=t,n===0}function Fe(e,{instancePath:r="",parentData:i,parentDataProperty:o,rootData:a=e}={}){let t=null,n=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.title===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};t===null?t=[s]:t.push(s),n++}if(e.fields===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"fields"},message:"must have required property 'fields'"};t===null?t=[s]:t.push(s),n++}for(let s in e)if(!(s==="title"||s==="fields")){let l={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),n++}if(e.title!==void 0){let s=e.title;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.fields!==void 0){let s=e.fields;if(Array.isArray(s)){if(s.length<1){let c={instancePath:r+"/fields",schemaPath:"#/properties/fields/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};t===null?t=[c]:t.push(c),n++}let l=s.length;for(let c=0;c<l;c++){let f=s[c];if(typeof f=="string"){if(Q(f)<1){let h={instancePath:r+"/fields/"+c,schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[h]:t.push(h),n++}}else{let h={instancePath:r+"/fields/"+c,schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[h]:t.push(h),n++}}}else{let l={instancePath:r+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[l]:t.push(l),n++}}}else{let s={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[s]:t.push(s),n++}return Fe.errors=t,n===0}var ir={description:"\u6BB5\u306E\u4E2D\u3067\u8D77\u304D\u308B\u3053\u3068\u3002\u8D77\u304D\u308B\u9806\u306B\u4E26\u3079\u308B",type:"object",required:["type"],discriminator:{propertyName:"type"},oneOf:[{description:"\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B",type:"object",additionalProperties:!1,required:["type","from","to","carry"],properties:{type:{const:"edge"},from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"},carry:{$ref:"#/definitions/carry"},labelSide:{description:"\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)",enum:["above","below","left","right"]}}},{description:"\u7BB1\u306E\u4E2D\u306E\u51E6\u7406",type:"object",additionalProperties:!1,required:["type","box","label"],properties:{type:{const:"action"},box:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}},{description:"\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"swap"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"}}},{description:"\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D",type:"object",additionalProperties:!1,required:["type","field"],anyOf:[{required:["value"]},{required:["tag"]}],properties:{type:{const:"strip"},field:{$ref:"#/definitions/text"},value:{$ref:"#/definitions/text"},tag:{$ref:"#/definitions/text"}}}]},or={description:"\u7DDA\u306E\u4E0A\u3092\u8D70\u308B\u7269\u3002\u5C01\u7B52 (\u30E1\u30C3\u30BB\u30FC\u30B8\u3084\u8981\u6C42)\u3001\u672D (\u540D\u524D\u306E\u3042\u308B\u5024)\u3001\u786C\u8CA8 (\u4FA1\u5024)\u3001\u7121\u3057",type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["envelope","tag","coin","none"]},text:{$ref:"#/definitions/text"}},if:{required:["kind"],properties:{kind:{const:"tag"}}},then:{required:["text"]},else:{not:{required:["text"]}}};function Be(e,{instancePath:r="",parentData:i,parentDataProperty:o,rootData:a=e}={}){let t=null,n=0,s=n,l=!0,c=n;if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.kind===void 0&&(p="kind")){let d={};t===null?t=[d]:t.push(d),n++}else if(e.kind!==void 0&&e.kind!=="tag"){let d={};t===null?t=[d]:t.push(d),n++}}var f=c===n;n=s,t!==null&&(s?t.length=s:t=null);let h;if(f){let p=n;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.text===void 0){let x={instancePath:r,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};t===null?t=[x]:t.push(x),n++}var f=p===n;l=f,h="then"}else{let p=n,d=n,x=n;if(e&&typeof e=="object"&&!Array.isArray(e)){let w;if(e.text===void 0&&(w="text")){let b={};t===null?t=[b]:t.push(b),n++}}var u=x===n;if(u){let w={instancePath:r,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};t===null?t=[w]:t.push(w),n++}else n=d,t!==null&&(d?t.length=d:t=null);var f=p===n;l=f,h="else"}if(!l){let p={instancePath:r,schemaPath:"#/if",keyword:"if",params:{failingKeyword:h},message:'must match "'+h+'" schema'};t===null?t=[p]:t.push(p),n++}if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.kind===void 0){let p={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'"};t===null?t=[p]:t.push(p),n++}for(let p in e)if(!(p==="kind"||p==="text")){let d={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"};t===null?t=[d]:t.push(d),n++}if(e.kind!==void 0){let p=e.kind;if(!(p==="envelope"||p==="tag"||p==="coin"||p==="none")){let d={instancePath:r+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:or.properties.kind.enum},message:"must be equal to one of the allowed values"};t===null?t=[d]:t.push(d),n++}}if(e.text!==void 0){let p=e.text;if(typeof p=="string"){if(Q(p)<1){let d={instancePath:r+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[d]:t.push(d),n++}}else{let d={instancePath:r+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[d]:t.push(d),n++}}}else{let p={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[p]:t.push(p),n++}return Be.errors=t,n===0}function Ve(e,{instancePath:r="",parentData:i,parentDataProperty:o,rootData:a=e}={}){let t=null,n=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let c={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[c]:t.push(c),n++}let l=e.type;if(typeof l=="string")if(l==="edge")if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let c={instancePath:r,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[c]:t.push(c),n++}if(e.from===void 0){let c={instancePath:r,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};t===null?t=[c]:t.push(c),n++}if(e.to===void 0){let c={instancePath:r,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};t===null?t=[c]:t.push(c),n++}if(e.carry===void 0){let c={instancePath:r,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"carry"},message:"must have required property 'carry'"};t===null?t=[c]:t.push(c),n++}for(let c in e)if(!(c==="type"||c==="from"||c==="to"||c==="label"||c==="carry"||c==="labelSide")){let f={instancePath:r,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:c},message:"must NOT have additional properties"};t===null?t=[f]:t.push(f),n++}if(e.type!==void 0&&e.type!=="edge"){let c={instancePath:r+"/type",schemaPath:"#/oneOf/0/properties/type/const",keyword:"const",params:{allowedValue:"edge"},message:"must be equal to constant"};t===null?t=[c]:t.push(c),n++}if(e.from!==void 0){let c=e.from;if(typeof c=="string"){if(!ge.test(c)){let f={instancePath:r+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[f]:t.push(f),n++}}else{let f={instancePath:r+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),n++}}if(e.to!==void 0){let c=e.to;if(typeof c=="string"){if(!ge.test(c)){let f={instancePath:r+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[f]:t.push(f),n++}}else{let f={instancePath:r+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),n++}}if(e.label!==void 0){let c=e.label;if(typeof c=="string"){if(Q(c)<1){let f={instancePath:r+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[f]:t.push(f),n++}}else{let f={instancePath:r+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),n++}}if(e.carry!==void 0&&(Be(e.carry,{instancePath:r+"/carry",parentData:e,parentDataProperty:"carry",rootData:a})||(t=t===null?Be.errors:t.concat(Be.errors),n=t.length)),e.labelSide!==void 0){let c=e.labelSide;if(!(c==="above"||c==="below"||c==="left"||c==="right")){let f={instancePath:r+"/labelSide",schemaPath:"#/oneOf/0/properties/labelSide/enum",keyword:"enum",params:{allowedValues:ir.oneOf[0].properties.labelSide.enum},message:"must be equal to one of the allowed values"};t===null?t=[f]:t.push(f),n++}}}else{let c={instancePath:r,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[c]:t.push(c),n++}else if(l==="action")if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let c={instancePath:r,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[c]:t.push(c),n++}if(e.box===void 0){let c={instancePath:r,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};t===null?t=[c]:t.push(c),n++}if(e.label===void 0){let c={instancePath:r,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"label"},message:"must have required property 'label'"};t===null?t=[c]:t.push(c),n++}for(let c in e)if(!(c==="type"||c==="box"||c==="label")){let f={instancePath:r,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:c},message:"must NOT have additional properties"};t===null?t=[f]:t.push(f),n++}if(e.type!==void 0&&e.type!=="action"){let c={instancePath:r+"/type",schemaPath:"#/oneOf/1/properties/type/const",keyword:"const",params:{allowedValue:"action"},message:"must be equal to constant"};t===null?t=[c]:t.push(c),n++}if(e.box!==void 0){let c=e.box;if(typeof c=="string"){if(!ge.test(c)){let f={instancePath:r+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[f]:t.push(f),n++}}else{let f={instancePath:r+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),n++}}if(e.label!==void 0){let c=e.label;if(typeof c=="string"){if(Q(c)<1){let f={instancePath:r+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[f]:t.push(f),n++}}else{let f={instancePath:r+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),n++}}}else{let c={instancePath:r,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[c]:t.push(c),n++}else if(l==="swap")if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let c={instancePath:r,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[c]:t.push(c),n++}if(e.box===void 0){let c={instancePath:r,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};t===null?t=[c]:t.push(c),n++}if(e.text===void 0){let c={instancePath:r,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};t===null?t=[c]:t.push(c),n++}for(let c in e)if(!(c==="type"||c==="box"||c==="text")){let f={instancePath:r,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:c},message:"must NOT have additional properties"};t===null?t=[f]:t.push(f),n++}if(e.type!==void 0&&e.type!=="swap"){let c={instancePath:r+"/type",schemaPath:"#/oneOf/2/properties/type/const",keyword:"const",params:{allowedValue:"swap"},message:"must be equal to constant"};t===null?t=[c]:t.push(c),n++}if(e.box!==void 0){let c=e.box;if(typeof c=="string"){if(!ge.test(c)){let f={instancePath:r+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[f]:t.push(f),n++}}else{let f={instancePath:r+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),n++}}if(e.text!==void 0){let c=e.text;if(typeof c=="string"){if(Q(c)<1){let f={instancePath:r+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[f]:t.push(f),n++}}else{let f={instancePath:r+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),n++}}}else{let c={instancePath:r,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[c]:t.push(c),n++}else if(l==="strip"){let c=n,f=!1,h=n;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.value===void 0){let u={instancePath:r,schemaPath:"#/oneOf/3/anyOf/0/required",keyword:"required",params:{missingProperty:"value"},message:"must have required property 'value'"};t===null?t=[u]:t.push(u),n++}var s=h===n;if(f=f||s,!f){let u=n;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.tag===void 0){let d={instancePath:r,schemaPath:"#/oneOf/3/anyOf/1/required",keyword:"required",params:{missingProperty:"tag"},message:"must have required property 'tag'"};t===null?t=[d]:t.push(d),n++}var s=u===n;f=f||s}if(f)n=c,t!==null&&(c?t.length=c:t=null);else{let u={instancePath:r,schemaPath:"#/oneOf/3/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};t===null?t=[u]:t.push(u),n++}if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let u={instancePath:r,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[u]:t.push(u),n++}if(e.field===void 0){let u={instancePath:r,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"field"},message:"must have required property 'field'"};t===null?t=[u]:t.push(u),n++}for(let u in e)if(!(u==="type"||u==="field"||u==="value"||u==="tag")){let p={instancePath:r,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:u},message:"must NOT have additional properties"};t===null?t=[p]:t.push(p),n++}if(e.type!==void 0&&e.type!=="strip"){let u={instancePath:r+"/type",schemaPath:"#/oneOf/3/properties/type/const",keyword:"const",params:{allowedValue:"strip"},message:"must be equal to constant"};t===null?t=[u]:t.push(u),n++}if(e.field!==void 0){let u=e.field;if(typeof u=="string"){if(Q(u)<1){let p={instancePath:r+"/field",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[p]:t.push(p),n++}}else{let p={instancePath:r+"/field",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[p]:t.push(p),n++}}if(e.value!==void 0){let u=e.value;if(typeof u=="string"){if(Q(u)<1){let p={instancePath:r+"/value",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[p]:t.push(p),n++}}else{let p={instancePath:r+"/value",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[p]:t.push(p),n++}}if(e.tag!==void 0){let u=e.tag;if(typeof u=="string"){if(Q(u)<1){let p={instancePath:r+"/tag",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[p]:t.push(p),n++}}else{let p={instancePath:r+"/tag",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[p]:t.push(p),n++}}}else{let u={instancePath:r,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[u]:t.push(u),n++}}else{let c={instancePath:r,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"mapping",tag:"type",tagValue:l},message:'value of tag "type" must be in oneOf'};t===null?t=[c]:t.push(c),n++}else{let c={instancePath:r,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"tag",tag:"type",tagValue:l},message:'tag "type" must be string'};t===null?t=[c]:t.push(c),n++}}else{let l={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[l]:t.push(l),n++}return Ve.errors=t,n===0}function _e(e,{instancePath:r="",parentData:i,parentDataProperty:o,rootData:a=e}={}){let t=null,n=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.title===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};t===null?t=[s]:t.push(s),n++}if(e.body===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"body"},message:"must have required property 'body'"};t===null?t=[s]:t.push(s),n++}if(e.events===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"events"},message:"must have required property 'events'"};t===null?t=[s]:t.push(s),n++}for(let s in e)if(!(s==="title"||s==="body"||s==="code"||s==="events")){let l={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),n++}if(e.title!==void 0){let s=e.title;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.body!==void 0){let s=e.body;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/body",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/body",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.code!==void 0){let s=e.code;if(typeof s=="string"){if(Q(s)<1){let l={instancePath:r+"/code",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),n++}}else{let l={instancePath:r+"/code",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),n++}}if(e.events!==void 0){let s=e.events;if(Array.isArray(s)){let l=s.length;for(let c=0;c<l;c++)Ve(s[c],{instancePath:r+"/events/"+c,parentData:s,parentDataProperty:c,rootData:a})||(t=t===null?Ve.errors:t.concat(Ve.errors),n=t.length)}else{let l={instancePath:r+"/events",schemaPath:"#/properties/events/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[l]:t.push(l),n++}}}else{let s={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[s]:t.push(s),n++}return _e.errors=t,n===0}function Ie(e,{instancePath:r="",parentData:i,parentDataProperty:o,rootData:a=e}={}){let t=null,n=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.lifelines===void 0){let s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"lifelines"},message:"must have required property 'lifelines'"};t===null?t=[s]:t.push(s),n++}for(let s in e)if(s!=="lifelines"){let l={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),n++}if(e.lifelines!==void 0){let s=e.lifelines;if(Array.isArray(s)){if(s.length<1){let c={instancePath:r+"/lifelines",schemaPath:"#/properties/lifelines/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};t===null?t=[c]:t.push(c),n++}let l=s.length;for(let c=0;c<l;c++){let f=s[c];if(typeof f=="string"){if(!ge.test(f)){let h={instancePath:r+"/lifelines/"+c,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[h]:t.push(h),n++}}else{let h={instancePath:r+"/lifelines/"+c,schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[h]:t.push(h),n++}}}else{let l={instancePath:r+"/lifelines",schemaPath:"#/properties/lifelines/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[l]:t.push(l),n++}}}else{let s={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[s]:t.push(s),n++}return Ie.errors=t,n===0}function gt(e,{instancePath:r="",parentData:i,parentDataProperty:o,rootData:a=e}={}){let t=null,n=0,s=n,l=!0,c=n;if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.kind===void 0&&(p="kind")){let d={};t===null?t=[d]:t.push(d),n++}else if(e.kind!==void 0&&e.kind!=="sequence"){let d={};t===null?t=[d]:t.push(d),n++}}var f=c===n;n=s,t!==null&&(s?t.length=s:t=null);let h;if(f){let p=n;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.sequence===void 0){let x={instancePath:r,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"sequence"},message:"must have required property 'sequence'"};t===null?t=[x]:t.push(x),n++}var f=p===n;l=f,h="then"}else{let p=n,d=n,x=n;if(e&&typeof e=="object"&&!Array.isArray(e)){let w;if(e.sequence===void 0&&(w="sequence")){let b={};t===null?t=[b]:t.push(b),n++}}var u=x===n;if(u){let w={instancePath:r,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};t===null?t=[w]:t.push(w),n++}else n=d,t!==null&&(d?t.length=d:t=null);var f=p===n;l=f,h="else"}if(!l){let p={instancePath:r,schemaPath:"#/if",keyword:"if",params:{failingKeyword:h},message:'must match "'+h+'" schema'};t===null?t=[p]:t.push(p),n++}if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.version===void 0){let p={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"version"},message:"must have required property 'version'"};t===null?t=[p]:t.push(p),n++}if(e.kind===void 0){let p={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'"};t===null?t=[p]:t.push(p),n++}if(e.title===void 0){let p={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};t===null?t=[p]:t.push(p),n++}if(e.boxes===void 0){let p={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"boxes"},message:"must have required property 'boxes'"};t===null?t=[p]:t.push(p),n++}if(e.steps===void 0){let p={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"steps"},message:"must have required property 'steps'"};t===null?t=[p]:t.push(p),n++}for(let p in e)if(!sr.call(Qe.properties,p)){let d={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"};t===null?t=[d]:t.push(d),n++}if(e.version!==void 0){let p=e.version;if(!(typeof p=="number"&&!(p%1)&&!isNaN(p)&&isFinite(p))){let d={instancePath:r+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"integer"},message:"must be integer"};t===null?t=[d]:t.push(d),n++}if(typeof p=="number"&&isFinite(p)&&(p<1||isNaN(p))){let d={instancePath:r+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};t===null?t=[d]:t.push(d),n++}}if(e.kind!==void 0){let p=e.kind;if(!(p==="sequence"||p==="architecture")){let d={instancePath:r+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:Qe.properties.kind.enum},message:"must be equal to one of the allowed values"};t===null?t=[d]:t.push(d),n++}}if(e.title!==void 0){let p=e.title;if(typeof p=="string"){if(Q(p)<1){let d={instancePath:r+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[d]:t.push(d),n++}}else{let d={instancePath:r+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[d]:t.push(d),n++}}if(e.view!==void 0){let p=e.view;if(!(p==="fixed"||p==="follow")){let d={instancePath:r+"/view",schemaPath:"#/properties/view/enum",keyword:"enum",params:{allowedValues:Qe.properties.view.enum},message:"must be equal to one of the allowed values"};t===null?t=[d]:t.push(d),n++}}if(e.regions!==void 0){let p=e.regions;if(Array.isArray(p)){let d=p.length;for(let x=0;x<d;x++)De(p[x],{instancePath:r+"/regions/"+x,parentData:p,parentDataProperty:x,rootData:a})||(t=t===null?De.errors:t.concat(De.errors),n=t.length)}else{let d={instancePath:r+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[d]:t.push(d),n++}}if(e.boxes!==void 0){let p=e.boxes;if(Array.isArray(p)){if(p.length<1){let x={instancePath:r+"/boxes",schemaPath:"#/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};t===null?t=[x]:t.push(x),n++}let d=p.length;for(let x=0;x<d;x++)Re(p[x],{instancePath:r+"/boxes/"+x,parentData:p,parentDataProperty:x,rootData:a})||(t=t===null?Re.errors:t.concat(Re.errors),n=t.length)}else{let d={instancePath:r+"/boxes",schemaPath:"#/properties/boxes/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[d]:t.push(d),n++}}if(e.strip!==void 0&&(Fe(e.strip,{instancePath:r+"/strip",parentData:e,parentDataProperty:"strip",rootData:a})||(t=t===null?Fe.errors:t.concat(Fe.errors),n=t.length)),e.steps!==void 0){let p=e.steps;if(Array.isArray(p)){if(p.length<1){let x={instancePath:r+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};t===null?t=[x]:t.push(x),n++}let d=p.length;for(let x=0;x<d;x++)_e(p[x],{instancePath:r+"/steps/"+x,parentData:p,parentDataProperty:x,rootData:a})||(t=t===null?_e.errors:t.concat(_e.errors),n=t.length)}else{let d={instancePath:r+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[d]:t.push(d),n++}}e.sequence!==void 0&&(Ie(e.sequence,{instancePath:r+"/sequence",parentData:e,parentDataProperty:"sequence",rootData:a})||(t=t===null?Ie.errors:t.concat(Ie.errors),n=t.length))}else{let p={instancePath:r,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[p]:t.push(p),n++}return gt.errors=t,n===0}var ar=["edge","action","swap","strip"],lr={"":{field:"sequence",kind:"sequence"},carry:{field:"text",kind:"tag"}},et=e=>e.replaceAll("~","~0").replaceAll("/","~1");function cr(e){let r=/^\^\[\^(.+)\]\+\$$/u.exec(e)?.[1];if(r===void 0)return;let i=r.match(/\\.|[^\\]/gu)??[];return{space:i.includes("\\s"),chars:i.filter(o=>o!=="\\s").map(o=>o.replace(/^\\/u,""))}}var ht=(e,r)=>r.filter(i=>i!==e&&i.schemaPath.startsWith(`${e.schemaPath}/`)&&(i.instancePath===e.instancePath||i.instancePath.startsWith(`${e.instancePath}/`)));function pr(e,r,i){let o=e.params,a=e.instancePath;switch(e.keyword){case"additionalProperties":{let t=String(o.additionalProperty);return{pointer:`${a}/${et(t)}`,message:i.additionalProperties(t)}}case"required":{let t=String(o.missingProperty);return{pointer:`${a}/${et(t)}`,message:i.required(t)}}case"not":{let t=lr[a.slice(a.lastIndexOf("/")+1)];return{pointer:t?`${a}/${t.field}`:a,message:i.not(t)}}case"anyOf":{let t=ht(e,r),n=t.every(s=>s.keyword==="required")?t.map(s=>String(s.params.missingProperty)):[];return{pointer:a,message:i.anyOf(n)}}case"discriminator":{let t=String(o.tag);return{pointer:`${a}/${et(t)}`,message:i.discriminator(t,ar)}}case"enum":return{pointer:a,message:i.enum(o.allowedValues.map(String))};case"type":return{pointer:a,message:i.type(String(o.type))};case"minLength":return{pointer:a,message:i.minLength(Number(o.limit))};case"pattern":return{pointer:a,message:i.pattern(cr(String(o.pattern)))};case"minItems":return{pointer:a,message:i.minItems(Number(o.limit))};case"minimum":return{pointer:a,message:i.minimum(Number(o.limit))};case"const":return{pointer:a,message:i.const(String(o.allowedValue))};case"oneOf":return{pointer:a,message:i.oneOf};default:return{pointer:a,message:e.message??e.keyword}}}function yt(e,r={}){if(Ze(e))return{ok:!0};let i=Ze.errors??[],o=new Set(i.filter(n=>n.keyword==="anyOf").flatMap(n=>ht(n,i))),a=Ce[r.lang??"ja"];return{ok:!1,errors:i.filter(n=>n.keyword!=="if"&&!o.has(n)).map(n=>pr(n,i,a))}}var bt=1;function dr(e){if(typeof e!="object"||e===null)return;let r=e.version;return typeof r=="number"&&r>bt?r:void 0}var fr=(e,r)=>({pointer:"/version",message:Ce[r].newer(e,bt)});function xt(e,r={}){let i=dr(e);if(i!==void 0)return{ok:!1,errors:[fr(i,r.lang??"ja")]};let o=yt(e,r);return o.ok?{ok:!0,diagram:e,warnings:[]}:o}function mr(e){let r={edges:[],events:[],busy:0},i=D.edgeAt,o,a=0;return e.events.forEach((t,n)=>{if(t.type==="edge"){let s=t.carry.kind!=="none",l=i,c=l+(s?D.drawCarry:D.draw);r.edges.push({event:n,a:l,b:c,carries:s,coin:t.carry.kind==="coin",named:t.label!==void 0}),i=l+D.stagger,o=c,a=0,r.busy=Math.max(r.busy,c)}else if(t.type==="action")r.events.push({event:n,at:i}),r.busy=Math.max(r.busy,i+D.action),i+=D.action,a=0;else{let s=(o??i)+D.change*a++;r.events.push({event:n,at:s}),r.busy=Math.max(r.busy,s)}}),r}function vt(e){let r=e.steps.map(mr),i=[],o=D.intro;e.steps.forEach((d,x)=>{let q=Math.min(D.stepMax,Math.max(D.stepMin,D.stepBase+[...d.body].length*D.perChar)),w=Math.max(q,(r[x]?.busy??0)+D.dwell);i.push({start:o,end:o+w}),o+=w});let t=Math.ceil(o+D.outro),n=t-D.tail,s=[],l=[],c=[],f=[];r.forEach((d,x)=>{let q=i[x],w=[];for(let b of d.edges){let M=q.start+b.a;s.push({step:x,event:b.event,start:M,drawn:q.start+b.b,end:q.end}),b.carries&&f.push({step:x,event:b.event,who:b.coin?"coin":"main",a:M,b:q.start+b.b}),b.named&&w.push({step:x,event:b.event,start:M+D.labelDelay,end:q.end})}w.forEach((b,M)=>{let g=w[M+2];g&&(b.end=Math.min(b.end,g.start))}),l.push(...w);for(let b of d.events)c.push({step:x,event:b.event,at:q.start+b.at})});let h=i[0]?.start??0,u=f.some(d=>d.who==="main"),p=[];for(let d of["main","coin"]){let x=f.filter(q=>q.who===d);x.forEach((q,w)=>{let b=x[w+1],M=w===0&&(d==="main"||!u);p.push({step:q.step,event:q.event,who:d,depart:q.a,arrive:q.b,start:M?Math.min(h,q.a):q.a,end:b?Math.max(b.a,q.b):n})})}return p.sort((d,x)=>d.depart-x.depart),{total:t,last:n,steps:i,edges:s,carriers:p,labels:l,badges:i.map((d,x)=>({step:x,appears:d.start})),events:c,stills:i.map(d=>d.end-D.still)}}var Ge={app:"M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2 h22",router:"M -9 -4 h16 M 3 -8 l4 4 l-4 4 M 9 5 h-16 M -3 1 l-4 4 l4 4",on:"M -7 7 L 7 -7 M -1 -7 h8 v8",off:"M -7 -7 L 7 7 M 7 -1 v8 h-8",pool:"M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",db:"M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",exe:"M -5 -8 L 7 0 L -5 8 Z",idx:"M -9 -7 h18 M -9 -2 h18 M -9 3 h18 M -9 8 h11",sign:"M -9 4 c 3 -9 5 -9 6 0 s 3 7 6 -2 s 3 -6 6 0",env:"M -8 -5.5 h16 v11 h-16 z M -8 -5.5 l8 6 l8 -6",lock:"M -5.5 -1 h11 v8 h-11 z M -3.5 -1 v-3 a3.5 3.5 0 0 1 7 0 v3",check:"M -5 0 l3.5 3.5 l6.5 -7",x:"M -5 -5 l10 10 M 5 -5 l-10 10",chain:"M -1.5 4.5 l-2 2 a3.5 3.5 0 0 1 -5 -5 l3 -3 a3.5 3.5 0 0 1 5 0 M 1.5 -4.5 l2 -2 a3.5 3.5 0 0 1 5 5 l-3 3 a3.5 3.5 0 0 1 -5 0 M -2.5 2.5 l5 -5",net:"M -1.3 -4.6 L -5.8 3 M 1.3 -4.6 L 5.8 3 M -4.3 5.5 H 4.3 M -2.2 -7 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M -9.2 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M 4.8 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0",user:"M -4 -4.5 a4 4 0 1 0 8 0 a4 4 0 1 0 -8 0 M -8 9 c0 -5 3.6 -7.5 8 -7.5 s8 2.5 8 7.5",server:"M -9 -8 h18 v7 h-18 z M -9 1 h18 v7 h-18 z M -5 -4.5 h0.01 M -5 4.5 h0.01",key:"M -9 0 a3.5 3.5 0 1 0 7 0 a3.5 3.5 0 1 0 -7 0 M -2 0 h10 M 5 0 v3.5 M 8 0 v2.5",shield:"M 0 -9 l8 3 v5 c0 5 -3.5 8 -8 10 c-4.5 -2 -8 -5 -8 -10 v-5 z",globe:"M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M -9 0 h18 M 0 -9 c-4.5 4 -4.5 14 0 18 M 0 -9 c4.5 4 4.5 14 0 18",bolt:"M 2 -9 L -5 1 h5 l-2 8 l7 -10 h-5 z",doc:"M -6 -9 h8 l5 5 v13 h-13 z M 2 -9 v5 h5 M -3 1 h7 M -3 5 h5",box:"M -9 -4.5 l9 -4.5 l9 4.5 v9 l-9 4.5 l-9 -4.5 z M -9 -4.5 l9 4.5 l9 -4.5 M 0 0 v9",truck:"M -10 -6 h11 v10 h-11 z M 1 -2 h5 l3.5 3.5 v2.5 h-8.5 M -7.5 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0 M 3 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0",card:"M -9 -6.5 h18 a2 2 0 0 1 2 2 v9 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-9 a2 2 0 0 1 2 -2 z M -11 -2 h22 M -7 3 h5",cart:"M -10 -8 h3 l3 11 h11 l2.5 -8 h-15.5 M -4.5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0 M 5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0",clock:"M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M 0 -5 v5 l3.5 2.5",branch:"M -4 -4.5 v9 M 5 0.5 c0 4 -9 3 -9 6.5 M -6.2 -7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M -6.2 7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M 2.8 -2 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0",cloud:"M -7 6 h13 a4.5 4.5 0 0 0 0.5 -9 a6 6 0 0 0 -11.5 -1 a4.5 4.5 0 0 0 -2 10 z",refresh:"M 7 -3 a7.5 7.5 0 1 0 0.5 5 M 7.5 -8 v5 h-5",layers:"M 0 -8 l9 4.5 l-9 4.5 l-9 -4.5 z M -9 2.5 l9 4.5 l9 -4.5",code:"M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",paint:"M -8 8 c 0 -3 2 -5 4.5 -5 l 9 -9 l 3.5 3.5 l -9 9 c 0 2.5 -2 4.5 -5 4.5 z",block:"M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2.5 h22 M -6 2.5 h8"};var oe=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),P=e=>Math.round(e*100)/100,pe=e=>e==="coin"?"--c:var(--coin);--ct:var(--coint)":`--c:var(--c-${e});--ct:var(--t-${e})`;function tt(e,r,i,o,a="dg-gl"){let t=e===void 0?void 0:Ge[e];return t?`<path class="${a}" transform="translate(${P(r)} ${P(i)}) scale(${o})" d="${t}"/>`:""}var ur=e=>e.map(([r,i],o)=>`${o===0?"M":"L"} ${P(r)} ${P(i)}`).join(" ");function gr(e){let[r,i]=e[e.length-1],[o,a]=e[e.length-2],t=Math.hypot(r-o,i-a)||1,n=(r-o)/t,s=(i-a)/t,{arrow:l,arrowHalf:c}=$.edge;return`M ${P(r-n*l-s*c)} ${P(i-s*l+n*c)} L ${P(r)} ${P(i)} L ${P(r-n*l+s*c)} ${P(i-s*l-n*c)}`}function hr(e,r){let i=[[0,{opacity:0}]];for(let[o,a]of r)i.push([o,{opacity:0},K.out],[o+D.fade,{opacity:1}],[a-.1,{opacity:1},K.inOut],[a+.25,{opacity:0}]);return i.push([e.total,{opacity:0}]),e.kf(i)}function yr(e,r){let i=[];for(let o=0;o<r.length;){let a=o;for(;a+1<r.length&&r[a+1]===r[a]+1;)a++;i.push([e.t.steps[r[o]].start,e.t.steps[r[a]].end]),o=a+1}return hr(e.m,i)}function wt(e){let{radius:r,icon:i,iconRadius:o,iconScale:a,nameY:t,line:n}=$.region,{x:s,y:l}=e.header,c=e.lines.map((u,p)=>`<text class="dg-bz" x="${P(s)}" y="${P(e.y+t+p*n)}">${oe(u)}</text>`).join(""),f=e.note?`<text class="dg-bx" x="${P(s)}" y="${P(e.y+t+e.lines.length*n+1)}">${oe(e.note)}</text>`:"",h=e.icon&&Ge[e.icon]?`<rect class="dg-bi" x="${P(s)}" y="${P(l)}" width="${i}" height="${i}" rx="${o}"/>${tt(e.icon,s+i/2,l+i/2,a)}`:"";return`<g style="${pe(e.color)}"><rect class="dg-band" x="${P(e.x+.5)}" y="${P(e.y+.5)}" width="${P(e.w-1)}" height="${P(e.h-1)}" rx="${r}"/>${h}${c}${f}</g>`}function $t(e,r,i,o){let{m:a,sh:t}=r,{radius:n,icon:s,iconRadius:l,iconScale:c,iconY:f,nameY:h,subY:u}=$.box,p=[[0,e.sub??"","dg-ss"],...o],d=p.map(([b,M,g],T)=>{let j=p[T+1]?.[0],R=T===0?j===void 0?"":a.until(j-D.untilFade):j===void 0?a.rise(b):a.rise(b,j-D.untilFade);return M===""?"":`<g${R?` class="dg-a" style="${R}"`:""}><text class="${g}" x="${P(e.cx)}" y="${P(e.cy+u)}" text-anchor="middle">${oe(M)}</text></g>`}).join(""),x=i.length>0?yr(r,i):void 0,q=(b,M="")=>`<rect class="${b}" x="${P(e.x)}" y="${P(e.y)}" width="${P(e.w)}" height="${e.h}" rx="${n}"${M}/>`,w=e.icon&&Ge[e.icon]?`<rect class="dg-ic" x="${P(e.cx-s/2)}" y="${P(e.cy+f-s/2)}" width="${s}" height="${s}" rx="${l}"/>${tt(e.icon,e.cx,e.cy+f,c)}`:"";return`<g style="${pe(e.color)}">${x?`<g class="dg-a" style="${x}">${q("dg-halo")}</g>`:""}${q("dg-st",` ${t}`)}${x?`<g class="dg-a" style="${x}">${q("dg-on")}</g>`:""}${w}<text class="dg-sn" x="${P(e.cx)}" y="${P(e.cy+h)}" text-anchor="middle">${oe(e.name)}</text>${d}</g>`}function kt(e,r,i){return`<line class="dg-ll" x1="${P(e)}" y1="${P(r)}" x2="${P(e)}" y2="${P(i)}"/>`}function Pt(e,r,i){let{m:o}=i,a=ur(e.points),t=gr(e.points),{start:n,drawn:s,end:l}=r,c=[[l,{opacity:1},K.inOut],[l+.4,{opacity:.45}],[i.end+.3,{opacity:.45},K.inOut],[i.end+1,{opacity:.95}],[o.last,{opacity:.95},K.inOut],[o.total,{opacity:0}]],f=o.kf([[0,{opacity:0,"stroke-dashoffset":1}],[n,{opacity:0,"stroke-dashoffset":1},K.inOut],[n+.05,{opacity:1}],[s,{"stroke-dashoffset":0}],[o.last,{"stroke-dashoffset":0}],[o.total,{"stroke-dashoffset":1}],...c]),h=o.kf([[0,{opacity:0}],[s-.05,{opacity:0}],[s,{opacity:1}],...c]),u=-(l-s)*26,p=o.kf([[0,{opacity:0,"stroke-dashoffset":0}],[s,{opacity:0,"stroke-dashoffset":0}],[s+.25,{opacity:.9}],[l-.1,{opacity:.9},K.inOut],[l+.2,{opacity:0,"stroke-dashoffset":u}],[o.total,{opacity:0,"stroke-dashoffset":u}]]);return{base:`<path class="dg-e" d="${a}"/><path class="dg-eh" d="${t}"/>`,lit:`<g style="${pe(e.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${a}" style="${f}"/><path class="dg-eh-on dg-a" d="${t}" style="${h}"/><path class="dg-flow dg-a" d="${a}" style="${p}"/></g>`}}function Mt(e,r,i){let o=e.family==="sans"?" dg-capj":"",{radius:a}=$.label;return`<g class="dg-cap${o} dg-a" style="${pe(e.color)};${i.m.rise(r.start,r.end,!0)}"><rect x="${P(e.x)}" y="${P(e.y)}" width="${P(e.w)}" height="${e.h}" rx="${a}"/><text x="${P(e.x+e.w/2)}" y="${P(e.y+e.h/2+$.baseline.label)}" text-anchor="middle">${oe(e.text)}</text></g>`}function St(e,r,i,o){return`<g class="dg-act dg-a" style="${pe(e.color)};${o.m.rise(r,i,!0)}"><rect x="${P(e.x)}" y="${P(e.y)}" width="${P(e.w)}" height="${e.h}" rx="${$.action.radius}"/><text x="${P(e.x+e.w/2)}" y="${P(e.y+e.h/2+$.baseline.action)}" text-anchor="middle">${oe(e.text)}</text></g>`}function br(e,r){let i=$.carrier;if(e.carry.kind==="coin")return`<circle class="dg-coin" r="${i.coinR}"/><circle class="dg-coin-in" r="${i.coinIn}"/>`;if(e.carry.kind==="tag"){let o=e.carry.text,a=ue(o),t=B(o,a?L.carrierJa:L.carrier)+i.tagPadX*2;return`<rect class="dg-car" x="${P(-t/2)}" y="${-i.tagH/2}" width="${P(t)}" height="${i.tagH}" rx="${i.tagH/2}" ${r}/><text class="dg-car-t${a?" dg-car-tj":""}" y="${$.baseline.carrier}" text-anchor="middle">${oe(o)}</text>`}return`<rect class="dg-env" x="${-i.envW/2}" y="${-i.envH/2}" width="${i.envW}" height="${i.envH}" rx="3" ${r}/><path class="dg-env-in" d="M -8 -4.5 L 0 1.5 L 8 -4.5"/>`}var xr=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2;function Ot(e,r,i){let{m:o}=i,a=$.carrier.samples,t=Je(e.points),{depart:n,arrive:s,start:l,end:c}=r,f=[];for(let q=0;q<=a;q++){let[w,b]=Ue(e.points,xr(q/a)*t);f.push([n+(s-n)*q/a,w,b])}let h=f[0],u=f[f.length-1],p=e.settle??[u[1],u[2]],d=[[0,h[1],h[2]],...f];e.settle&&d.push([Math.min(s+.3,Math.max(c,s+.01)),p[0],p[1]]),d.push([c,p[0],p[1]],[o.total,p[0],p[1]]);let x=c<o.last?.05:.18;return`<g class="dg-a" style="${o.move(d,o.blink(l+.02,c,x))}">${br(e,i.sh)}</g>`}function qt(e,r){let{m:i}=r,o=r.t.steps[e.step],a=o.start,t=o.end,{r:n,ring:s}=$.badge,l=i.kf([[0,{opacity:0,transform:"scale(.5)"}],[a,{opacity:0,transform:"scale(.5)"},K.pop],[a+.35,{opacity:1,transform:"scale(1)"}],[t,{opacity:1,transform:"scale(1)"},K.inOut],[t+.4,{opacity:0,transform:"scale(1)"}],[i.total,{opacity:0,transform:"scale(.5)"}]]),c=i.kf([[0,{opacity:0}],[t,{opacity:0},K.inOut],[t+.4,{opacity:1}],[i.last,{opacity:1},K.inOut],[i.total,{opacity:0}]]),f=i.kf([[0,{opacity:0,transform:"scale(1)"}],[a+.05,{opacity:0,transform:"scale(1)"}],[a+.1,{opacity:.7,transform:"scale(1)"},K.out],[a+.9,{opacity:0,transform:"scale(2.3)"}],[i.total,{opacity:0,transform:"scale(1)"}]]),h=P(e.x),u=P(e.y),p=P(e.y+$.baseline.badge),d=e.step+1;return`<g class="dg-bd" data-step="${e.step}" style="${pe(e.color)}"><circle class="dg-bdr dg-popc dg-a" cx="${h}" cy="${u}" r="${s}" style="${f}"/><g class="dg-a" style="${c}"><circle class="dg-bdp" cx="${h}" cy="${u}" r="${s}"/><text class="dg-bdpt" x="${h}" y="${p}" text-anchor="middle">${d}</text></g><g class="dg-popc dg-a" style="${l}"><circle class="dg-bdf" cx="${h}" cy="${u}" r="${n}"/><text class="dg-bdft" x="${h}" y="${p}" text-anchor="middle">${d}</text></g></g>`}function Et(e,r,i){let{m:o,sh:a}=i,t=$.strip,n=e.y+t.h/2,s=[`<rect class="dg-strip" x="${P(e.x+.5)}" y="${P(e.y+.5)}" width="${P(e.w-1)}" height="${P(e.h-1)}" rx="${$.region.radius}" ${a}/>`,`<g style="${pe("slate")}"><rect class="dg-bi" x="${P(e.x+t.pad)}" y="${P(n-t.icon/2)}" width="${t.icon}" height="${t.icon}" rx="${$.box.iconRadius}"/>${tt("env",e.x+t.pad+t.icon/2,n,.78)}</g>`,`<text class="dg-sh" x="${P(e.x+t.titleX)}" y="${P(n+$.baseline.stripTitle)}">${oe(e.title)}</text>`];return e.fields.forEach((l,c)=>{let f=e.fields[c-1];if(f&&f.y===l.y){let d=l.x-t.fieldGap/2;s.push(`<line class="dg-sep" x1="${P(d)}" y1="${P(l.y+t.sepInset)}" x2="${P(d)}" y2="${P(l.y+t.h-t.sepInset)}"/>`)}s.push(`<text class="dg-fl" x="${P(l.x)}" y="${P(l.y+t.nameY)}">${oe(l.name)}</text>`);let h=r.get(l.name)??[],u=h.filter(d=>d.value!==void 0),p=h.filter(d=>d.tag!==void 0);u.forEach((d,x)=>{let q=u[x+1]?.at,w=d.value,b=q===void 0?o.rise(d.at):o.rise(d.at,q-D.untilFade);s.push(`<g class="dg-a" style="${b}"><text class="${ue(w)?"dg-fvj":"dg-fv"}" x="${P(l.x)}" y="${P(l.y+t.valueY)}">${oe(w)}</text></g>`)}),p.forEach((d,x)=>{let q=p[x+1]?.at,w=d.tag,b=[...u].reverse().find(j=>j.at<=d.at+1e-9)?.value,M=l.x+(b?B(b,ue(b)?L.fieldValueJa:L.fieldValue)+t.tagGap:0),g=B(w,L.tag)+t.tagPadX*2,T=l.y+t.valueY-t.tagH/2-$.baseline.tag;s.push(`<g class="dg-tg dg-popc dg-a" style="${pe(d.color)};${q===void 0?o.pop(d.at):o.pop(d.at,q-D.untilFade)}"><rect x="${P(M)}" y="${P(T)}" width="${P(g)}" height="${t.tagH}" rx="${t.tagH/2}"/><text x="${P(M+g/2)}" y="${P(T+t.tagH/2+$.baseline.tag)}" text-anchor="middle">${oe(w)}</text></g>`)})}),s.join("")}var Lt=e=>Math.round(e*100)/100,We=class{constructor(r,i,o){this.prefix=r;this.total=i;this.last=o}prefix;total;last;frames=[];count=0;pct(r){return+(Math.min(Math.max(r,0),this.total)/this.total*100).toFixed(3)}kf(r){let i=`${this.prefix}-${this.count++}`,o=new Map;for(let[t,n,s]of[...r].sort((l,c)=>l[0]-c[0])){let l=this.pct(t),c=o.get(l)??{props:{}};Object.assign(c.props,n),s&&(c.ease=s),o.set(l,c)}let a=[...o].map(([t,{props:n,ease:s}])=>{let l=Object.entries(n).map(([c,f])=>`${c}:${f}`);return s&&l.push(`animation-timing-function:${s}`),`${t}%{${l.join(";")}}`}).join("");return this.frames.push(`@keyframes ${i}{${a}}`),`animation-name:${i}`}vis(r,i=this.last,o={}){let a=o.f??D.fade,t=o.on??{},n=o.off??{},s=o.within?Math.max(r+a,i-a):i;return this.kf([[0,{opacity:0,...n}],[r,{opacity:0,...n},o.ein??K.out],[r+a,{opacity:1,...t}],[s,{opacity:1,...t},K.inOut],[Math.min(s+a,this.total),{opacity:0,...n}],[this.total,{opacity:0,...n}]])}rise(r,i=this.last,o=!1){return this.vis(r,i,{on:{transform:"translateY(0)"},off:{transform:`translateY(${$.rise}px)`},within:o})}pop(r,i=this.last){return this.vis(r,i,{f:D.popFade,ein:K.pop,on:{transform:"scale(1)"},off:{transform:`scale(${$.popFrom})`}})}until(r){let i=D.untilFade;return this.kf([[0,{opacity:1}],[r,{opacity:1},K.inOut],[r+i,{opacity:0}],[this.last,{opacity:0}],[this.total,{opacity:1}]])}move(r,i=[]){return this.kf(r.map(([o,a,t,n=1,s])=>[o,{transform:`translate(${Lt(a)}px,${Lt(t)}px) scale(${n})`},s]).concat(i))}blink(r,i,o){return[[0,{opacity:0}],[r-.01,{opacity:0}],[r,{opacity:1}],[i,{opacity:1}],[i+o,{opacity:0}],[this.total,{opacity:0}]]}};var Z=e=>`font:${e.weight} ${e.size}px var(--${e.family})`,me=(e,r="var(--surf)")=>`color-mix(in srgb,var(--c) ${e}%,${r})`,se=$.stroke,de=$.mix,vr=[".dg{display:block;width:100%;height:auto;overflow:visible}",".dg .dg-a{animation-duration:var(--T);animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both;animation-delay:calc(var(--at,0) * -1s);animation-play-state:var(--play,running)}",".dg .dg-popc{transform-box:fill-box;transform-origin:center}",".dg-bg{fill:var(--bg)}",".dg-band{fill:color-mix(in srgb,var(--c) var(--tint),var(--bg));stroke:color-mix(in srgb,var(--c) var(--edge),transparent)}",`.dg-bi{fill:${me(de.regionIcon)};stroke:${me(de.regionIconEdge,"transparent")}}`,`.dg-bz{${Z(L.regionName)};fill:var(--ct)}`,`.dg-bx{${Z(L.regionNote)};fill:var(--mute)}`,".dg-st{fill:var(--surf);stroke:var(--hair)}",`.dg-halo{fill:none;stroke:var(--c);stroke-width:${se.halo};stroke-opacity:.16}`,`.dg-on{fill:none;stroke:var(--c);stroke-width:${se.on}}`,`.dg-ic{fill:${me(de.icon)}}`,`.dg-gl{fill:none;stroke:var(--c);stroke-width:${se.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-sn{${Z(L.boxName)};fill:var(--ink)}`,`.dg-ss{${Z(L.boxSub)};fill:var(--mute)}`,`.dg-ss-ok{${Z(L.boxSubStrong)};fill:var(--ct)}`,`.dg-ss-act{${Z(L.boxSubStrong)};fill:var(--ink)}`,`.dg-ll{stroke:var(--line);stroke-width:${se.lifeline};stroke-dasharray:3 4}`,`.dg-e{fill:none;stroke:var(--line);stroke-width:${se.edge};stroke-linecap:round;stroke-dasharray:0 ${$.edge.ghostDash}}`,`.dg-eh{fill:none;stroke:var(--line);stroke-width:${se.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-e-on{fill:none;stroke:var(--c);stroke-width:${se.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${se.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,`.dg-flow{fill:none;stroke:var(--surf);stroke-width:${se.flow};stroke-linecap:round;stroke-dasharray:1.5 ${$.edge.flowDash}}`,".dg-bd{cursor:pointer}",".dg-bdf{fill:var(--c)}",`.dg-bdft{${Z(L.badge)};fill:var(--on-c)}`,`.dg-bdr{fill:none;stroke:var(--c);stroke-width:${se.badgeRing}}`,`.dg-bdp{fill:${me(de.badgePast)};stroke:${me(de.badgePastEdge,"transparent")};stroke-width:${se.hair}}`,`.dg-bdpt{${Z(L.badge)};fill:var(--ct)}`,`.dg-cap rect,.dg-act rect{fill:${me(de.cap)};stroke:${me(de.capEdge,"transparent")}}`,`.dg-cap text{${Z(L.label)};fill:var(--ct)}`,`.dg-capj text{${Z(L.labelJa)}}`,`.dg-act text{${Z(L.action)};fill:var(--ct)}`,".dg-car{fill:var(--carry,var(--ink))}",`.dg-car-t{${Z(L.carrier)};fill:var(--bg)}`,`.dg-car-tj{${Z(L.carrierJa)}}`,`.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${se.envelope}}`,`.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${se.flow};stroke-linejoin:round;stroke-linecap:round}`,".dg-coin{fill:var(--coin);stroke:var(--surf);stroke-width:1.2}",".dg-coin-in{fill:none;stroke:var(--coinin);stroke-width:1.1}",".dg-strip{fill:var(--surf);stroke:var(--hair)}",`.dg-sep{stroke:var(--hair);stroke-width:${se.hair}}`,`.dg-sh{${Z(L.stripTitle)};fill:var(--ink)}`,`.dg-fl{${Z(L.fieldName)};fill:var(--mute)}`,`.dg-fv{${Z(L.fieldValue)};fill:var(--ink)}`,`.dg-fvj{${Z(L.fieldValueJa)};fill:var(--ink)}`,".dg-tg rect{fill:var(--c)}",`.dg-tg text{${Z(L.tag)};fill:var(--on-c)}`,".dg-vp-bg{fill:var(--bg)}",".dg-vp-frame{fill:none;stroke:var(--hair)}",".dg-mm-bg{fill:var(--surf);stroke:var(--hair)}",`.dg-mm-t{${Z(L.miniTitle)};fill:var(--mute)}`,".dg-mm-world{fill:var(--sunk);stroke:var(--hair)}",`.dg-mm-band{fill:${me(de.miniBand)};stroke:${me(de.miniBandEdge,"transparent")};stroke-width:.6}`,`.dg-mm-card{fill:${me(de.mini)}}`,`.dg-mm-vp{fill:color-mix(in srgb,var(--ink) ${de.view}%,transparent);stroke:var(--ink);stroke-width:${se.badgeRing};vector-effect:non-scaling-stroke}`].join("");function wr(e){let r=2166136261;for(let i=0;i<e.length;i++)r^=e.charCodeAt(i),r=Math.imul(r,16777619);return(r>>>0).toString(36)}function $r(e){let r=new Map,i=(o,a)=>{r.set(o,(r.get(o)??new Set).add(a))};return e.steps.forEach((o,a)=>{for(let t of o.events)t.type==="edge"?(i(t.from,a),i(t.to,a)):(t.type==="action"||t.type==="swap")&&i(t.box,a)}),new Map([...r].map(([o,a])=>[o,[...a].sort((t,n)=>t-n)]))}function kr(e,r,i){let o=[],a=0;for(let n of r.events){let s=e.steps[n.step]?.events[n.event];s?.type==="swap"&&o.push({t:n.at,order:a++,box:s.box,set:s.text}),i&&s?.type==="action"&&(o.push({t:n.at,order:a++,box:s.box,act:s.label}),o.push({t:r.steps[n.step].end,order:a++,box:s.box,act:null}))}o.sort((n,s)=>n.t-s.t||n.order-s.order);let t=new Map;for(let n of e.boxes){let s=[n.sub??"","dg-ss"],l,c=s.join("|"),f=[];for(let u of o.filter(p=>p.box===n.id)){u.set!==void 0&&(s=[u.set,"dg-ss-ok"],l=void 0),u.act!==void 0&&(l=u.act??void 0);let p=l!==void 0?[l,"dg-ss-act"]:s;p.join("|")!==c&&(c=p.join("|"),f.push([u.t,p[0],p[1]]))}let h=f.filter((u,p)=>{let d=f[p+1];return d===void 0||d[0]-u[0]>=D.minShow});t.set(n.id,h)}return t}function Pr(e,r,i){let o=new Map;for(let a of r.events){let t=e.steps[a.step]?.events[a.event];if(t?.type!=="strip")continue;let n=i.badges[a.step]?.color??"slate",s=o.get(t.field)??[];s.push({at:a.at,color:n,...t.value!==void 0?{value:t.value}:{},...t.tag!==void 0?{tag:t.tag}:{}}),o.set(t.field,s)}return o}function rt(e,r,i,o,a,t){let n=wr(`${JSON.stringify(e)}|${o.id}|${a}|${t?`${t.width}|${t.lang}`:""}`),s=new We(`dg${n}`,i.total,i.last),l={m:s,t:i,sh:`filter="url(#dg-sh-${n})"`,end:i.steps[i.steps.length-1].end},c=$r(e),f=kr(e,i,r.kind==="architecture"),h={band:[],base:[],lit:[],node:[],badge:[],top:[]};for(let g of r.regions)h.band.push(wt(g));r.strip&&h.band.push(Et(r.strip,Pr(e,i,r),l));for(let g of r.lifelines)h.base.push(kt(g.x,g.y1,g.y2));for(let g of r.edges){let T=i.edges.find(R=>R.step===g.step&&R.event===g.event);if(!T)continue;let j=Pt(g,T,l);h.base.push(j.base),h.lit.push(j.lit)}for(let g of r.boxes)h.node.push($t(g,l,c.get(g.id)??[],f.get(g.id)??[]));for(let g of r.badges)h.badge.push(qt(g,l));for(let g of r.labels){let T=i.labels.find(j=>j.step===g.step&&j.event===g.event);T&&h.top.push(Mt(g,T,l))}for(let g of r.actions){let T=i.events.find(j=>j.step===g.step&&j.event===g.event);T&&h.top.push(St(g,T.at,i.steps[g.step].end,l))}for(let g of i.carriers){let T=r.edges.find(j=>j.step===g.step&&j.event===g.event);T&&h.top.push(Ot(T,g,l))}let u=Object.values(h).map(g=>g.join("")).join(""),{near:p,far:d,nearY:x,farY:q}=$.shadow,w=`<filter id="dg-sh-${n}" x="-20%" y="-30%" width="140%" height="180%"><feDropShadow dx="0" dy="${x}" stdDeviation="${p}" style="flood-color:var(--sh);flood-opacity:var(--shA)"/><feDropShadow dx="0" dy="${q}" stdDeviation="${d}" style="flood-color:var(--sh);flood-opacity:var(--shB)"/></filter>`,b=t?Sr(r,i,e,s,n,u,t):{body:`<rect class="dg-bg" width="${r.width}" height="${r.height}" rx="${$.region.radius}"/>${u}`,w:r.width,h:r.height},M=`.dg-${n}{${Me};--T:${i.total}s;${Pe(o,a)}}${vr}${s.frames.join("")}`;return`<svg xmlns="http://www.w3.org/2000/svg" class="dg dg-${n}" viewBox="0 0 ${Math.ceil(b.w)} ${Math.ceil(b.h)}" width="${Math.ceil(b.w)}" height="${Math.ceil(b.h)}" role="img" aria-label="${oe(e.title)}" data-dragon="figure" data-view="${t?"follow":"fixed"}"><style>${M}</style><defs>${w}</defs>${b.body}</svg>`}function Mr(e,r,i){let o=[];for(let n of e.edges.filter(s=>s.step===i)){let s=n.points.map(c=>c[0]),l=n.points.map(c=>c[1]);o.push({x:Math.min(...s),y:Math.min(...l),w:Math.max(...s)-Math.min(...s),h:Math.max(...l)-Math.min(...l)})}o.push(...e.labels.filter(n=>n.step===i),...e.actions.filter(n=>n.step===i));for(let n of r.steps[i]?.events??[]){let s=n.type==="edge"?[n.from,n.to]:n.type==="action"||n.type==="swap"?[n.box]:[];for(let l of s){let c=e.boxes.find(f=>f.id===l);c&&(e.kind==="architecture"||n.type==="swap")&&o.push(c)}}if(o.length===0)return;let a=Math.min(...o.map(n=>n.x)),t=Math.min(...o.map(n=>n.y));return{x:a,y:t,w:Math.max(...o.map(n=>n.x+n.w))-a,h:Math.max(...o.map(n=>n.y+n.h))-t}}function Sr(e,r,i,o,a,t,n){let s=$.follow,l=$.mini,c=Math.min(e.width,Math.max(1,n.width)),f=Math.min(e.height,Math.max(s.minH,c*s.aspect)),h=y=>Math.min(e.width-c/2,Math.max(c/2,y)),u=y=>Math.min(e.height-f/2,Math.max(f/2,y)),p=[e.width/2,e.height/2],d=r.steps.map((y,S)=>{let k=Mr(e,i,S);return p=k?[k.x+k.w/2,k.y+k.h/2]:p,[h(p[0]),u(p[1])]}),x=d[0],q=[[0,x[0],x[1]],[r.steps[0].start,x[0],x[1]]];d.forEach((y,S)=>{if(S===0)return;let k=d[S-1],C=r.steps[S].start;q.push([C,k[0],k[1],1,K.inOut],[C+s.ease,y[0],y[1]])});let w=d[d.length-1];q.push([r.last,w[0],w[1],1,K.inOut],[r.total,x[0],x[1]]);let b=o.move(q.map(([y,S,k,C,G])=>[y,c/2-S,f/2-k,C,G])),M=Math.min(l.w,c*.4,f*.4/e.height*e.width),g=M/e.width,T=e.height*g,j=be[n.lang].overview,R=Math.max(M,Math.ceil(B(j,L.miniTitle))),_=c-R-l.inset-l.pad,Y=_+(R-M)/2,z=l.inset+l.pad+l.title,le=[...e.regions.map(y=>`<rect class="dg-mm-band" style="${pe(y.color)}" x="${Y+y.x*g}" y="${z+y.y*g}" width="${y.w*g}" height="${y.h*g}" rx="3"/>`),...e.boxes.map(y=>`<rect class="dg-mm-card" style="${pe(y.color)}" x="${Y+y.x*g}" y="${z+y.y*g}" width="${y.w*g}" height="${y.h*g}" rx="1.5"/>`)].join(""),fe=o.move(q.map(([y,S,k,,C])=>[y,Y+(S-c/2)*g,z+(k-f/2)*g,1,C])),te=`<rect class="dg-mm-bg" x="${_-l.pad}" y="${z-l.pad-l.title}" width="${R+l.pad*2}" height="${T+l.pad*2+l.title}" rx="${l.radius}"/><text class="dg-mm-t" x="${_}" y="${z-l.pad+2}">${j}</text><g clip-path="url(#dg-mm-${a})"><rect class="dg-mm-world" x="${Y}" y="${z}" width="${M}" height="${T}"/>${le}<rect class="dg-mm-vp dg-a" width="${c*g}" height="${f*g}" rx="2" style="${fe}"/></g>`;return{body:`<defs><clipPath id="dg-vp-${a}"><rect width="${c}" height="${f}" rx="${$.region.radius}"/></clipPath><clipPath id="dg-mm-${a}"><rect x="${Y}" y="${z}" width="${M}" height="${T}" rx="4"/></clipPath></defs><g clip-path="url(#dg-vp-${a})"><rect class="dg-vp-bg" width="${c}" height="${f}"/><g class="dg-a" style="${b}">${t}</g></g><rect class="dg-vp-frame" x="0.5" y="0.5" width="${c-1}" height="${f-1}" rx="${$.region.radius}"/>${te}`,w:c,h:f}}function Tt(e,r={}){let i=r.lang??"ja",o=xt(e,{lang:i});if(!o.ok)throw new Error(be[i].cannotDraw(o.errors.map(c=>`${c.pointer} ${c.message}`).join(" / ")));let a=o.diagram,t=ke(r.palette),n=r.theme==="dark"?"dark":"light",s=a.kind==="sequence"?ft(a):pt(a),l=vt(a);return{svg:rt(a,s,l,t,n),palette:t.id,theme:n,...a.view?{view:a.view}:{},fonts:{...xe},layout:s,timeline:l,diagram:a}}function nt(e,r){let i=Math.max(0,r)/e.layout.width*L.boxName.size;return e.view?{mode:e.view,textPx:i}:{mode:i>=ot?"fixed":"follow",textPx:i}}var Ke=e=>`font:${e.weight} ${e.size}px var(--${e.family})`,ae=e=>`${e}px`;function Or(){let e=$.player,r=ae(e.hidden);return[`.dg-player{display:flex;flex-direction:column;gap:${ae(e.gap)};color:var(--ink)}`,`.dg-player .dg-frame{border-radius:${ae(e.radius)};overflow:hidden}`,`.dg-bar{display:flex;align-items:flex-start;gap:${ae(e.gap)}}`,`.dg-btns{display:flex;gap:${ae(e.gap/2)};flex:none}`,`.dg-btn{width:${ae(e.button)};height:${ae(e.button)};border-radius:${ae(e.radius)};border:${ae($.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${Ke(L.button)};cursor:pointer}`,`.dg-btn:focus-visible{outline:${ae(e.focus)} solid var(--c-blue);outline-offset:${ae(e.focus)}}`,`.dg-say{display:flex;gap:${ae(e.gap)};min-width:0}`,`.dg-no{${Ke(L.stepNo)};color:var(--mute);padding-top:${ae(e.focus)}}`,`.dg-tt{${Ke(L.stepTitle)};margin:0}`,`.dg-tb{${Ke(L.stepBody)};color:var(--ink2);margin:0;white-space:pre-line}`,`.dg-sr{position:absolute;width:${r};height:${r};margin:-${r};padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`].join("")}function qr(e){if(e.getElementById("dragon-player-css"))return;let r=e.createElement("style");r.id="dragon-player-css",r.textContent=Or(),e.head.appendChild(r)}var we={prev:"\u2039",pause:"\u275A\u275A",play:"\u25B6",next:"\u203A"},jt=e=>String(e).padStart(2,"0"),Er=(e,r)=>`${jt(e+1)}/${jt(r)}`;function At(e,r,i={}){let o=e.ownerDocument,a=o.defaultView,t=!!a?.matchMedia?.("(prefers-reduced-motion: reduce)").matches,n=Tt(r,i),s=i.lang??"ja",l=be[s],c=ke(n.palette),{timeline:f}=n,h=n.diagram.steps,u=h.length;qr(o);let p=o.createElement("div");p.className="dg-player",p.dataset.dragon="player",p.setAttribute("style",`${Me};${Pe(c,n.theme)}`);let d=o.createElement("div");d.className="dg-frame";let x=(N,A,F)=>{let J=o.createElement("button");return J.type="button",J.className="dg-btn",J.dataset.dragon=N,J.setAttribute("aria-label",A),J.textContent=F,J},q=x("prev",l.prev,we.prev),w=x("toggle",l.pause,we.pause),b=x("next",l.next,we.next),M=o.createElement("div");M.className="dg-btns",M.setAttribute("lang",s),M.append(q,w,b);let g=o.createElement("div");g.className="dg-say",g.setAttribute("aria-hidden","true");let T=o.createElement("div");T.className="dg-no",T.dataset.dragon="step-no";let j=o.createElement("div"),R=o.createElement("p");R.className="dg-tt",R.dataset.dragon="step-title";let _=o.createElement("p");_.className="dg-tb",_.dataset.dragon="step-body",j.append(R,_),g.append(T,j);let Y=o.createElement("div");Y.className="dg-bar",Y.append(M,g);let z=o.createElement("ol");z.className="dg-sr",z.dataset.dragon="steps",z.setAttribute("aria-label",l.steps(n.diagram.title));for(let N of h){let A=o.createElement("li"),F=o.createElement("strong");F.textContent=N.title,A.append(F);for(let J of N.body.split(`
2
- `)){let he=o.createElement("p");he.textContent=J,A.append(he)}z.append(A)}p.append(d,Y,z),e.append(p);let le=()=>d.clientWidth||e.clientWidth||n.layout.width,fe=nt(n,le()).mode,te=le(),ie=null,y=0,S=!t,k=t?f.stills[0]??0:0,C=Date.now(),G=N=>{let A;if(N!==void 0){let F=o.createElement("div");F.innerHTML=N,A=F.querySelector("svg")}else A=ie?ie.cloneNode(!0):null;A&&(A.setAttribute("aria-hidden","true"),A.removeAttribute("role"),A.removeAttribute("aria-label"),A.style.setProperty("--at",String(k)),A.style.setProperty("--play",S?"running":"paused"),A.dataset.motion=S?"play":"still",ie?ie.replaceWith(A):d.append(A),ie=A,C=Date.now())},H=()=>fe==="follow"?rt(n.diagram,n.layout,f,c,n.theme,{width:te,lang:s}):n.svg,I=()=>S?(k+(Date.now()-C)/1e3)%f.total:k,re=N=>{let A=0;return f.steps.forEach((F,J)=>{F.start<=N&&(A=J)}),A},m=()=>{let N=h[y];T.textContent=Er(y,u),R.textContent=N?.title??"",_.textContent=N?.body??"",w.setAttribute("aria-label",S?l.pause:l.play),w.textContent=S?we.pause:we.play},E=(N,A)=>{k=N,S=A,G(),m()},v=N=>{y=Math.min(u-1,Math.max(0,N));let A=f.steps[y];E(S?A.start:f.stills[y]??A.start,S)};G(H()),m();let O=a?.setInterval(()=>{if(!S)return;let N=re(I());N!==y&&(y=N,m())},120),V=()=>v(y-1),X=()=>v(y+1),U=()=>S?E(I(),!1):E(k,!0),ne=N=>{let A=N.target?.closest?.("[data-step]"),F=A?Number(A.getAttribute("data-step")):Number.NaN;Number.isInteger(F)&&v(F)};q.addEventListener("click",V),b.addEventListener("click",X),w.addEventListener("click",U),d.addEventListener("click",ne);let ee=a?.ResizeObserver,ce=ee?new ee(()=>{let N=le(),A=nt(n,N).mode;if(A===fe&&(fe==="fixed"||N===te))return;let F=I();fe=A,te=N,k=F,G(H())}):void 0;return ce?.observe(d),{get step(){return y},get playing(){return S},next:X,prev:V,play:()=>{S||E(k,!0)},pause:()=>{S&&E(I(),!1)},destroy:()=>{O!==void 0&&a?.clearInterval(O),ce?.disconnect(),q.removeEventListener("click",V),b.removeEventListener("click",X),w.removeEventListener("click",U),d.removeEventListener("click",ne),p.remove()}}}return Bt(Lr);})();
1
+ "use strict";var DragonPlayer=(()=>{var Xe=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Yt=Object.getOwnPropertyNames;var Ht=Object.prototype.hasOwnProperty;var Kt=(e,n)=>{for(var s in n)Xe(e,s,{get:n[s],enumerable:!0})},zt=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Yt(n))!Ht.call(e,o)&&o!==s&&Xe(e,o,{get:()=>n[o],enumerable:!(a=Gt(n,o))||a.enumerable});return e};var Xt=e=>zt(Xe({},"__esModule",{value:!0}),e);var Vn={};Kt(Vn,{mountDiagram:()=>Wt});var we={ja:{cannotDraw:e=>`\u56F3\u3092\u63CF\u3051\u306A\u3044: ${e}`,overview:"\u5168\u4F53\u56F3",prev:"\u524D\u306E\u6BB5",pause:"\u6B62\u3081\u308B",play:"\u52D5\u304B\u3059",next:"\u6B21\u306E\u6BB5",steps:e=>`${e} \u306E\u6BB5`},en:{cannotDraw:e=>`Cannot draw the diagram: ${e}`,overview:"Overview",prev:"Previous step",pause:"Pause",play:"Play",next:"Next step",steps:e=>`Steps of ${e}`}};var lt={clear:{name:"\u6F84\u3093\u3060\u8272",note:"\u767D\u3044\u5730\u306B\u3001\u4E2D\u304F\u3089\u3044\u306E\u660E\u308B\u3055\u306E\u9BAE\u3084\u304B\u306A 6 \u8272\u3002\u4ECA\u306E\u898B\u672C\u5E33\u306E\u8272",light:{page:"#f3f4f7",bg:"#ffffff",surf:"#ffffff",sunk:"#f5f6f8",ink:"#12141a",ink2:"#3f4451",mute:"#6b7180",hair:"#12141a1c",line:"#12141a40",sh:"#101828","on-c":"#ffffff","c-blue":"#467deb","t-blue":"#2e62ce","c-amber":"#d28008","t-amber":"#975b04","c-green":"#0ea886","t-green":"#07775e","c-violet":"#6c3bb2","t-violet":"#6c3bb2","c-rose":"#ba3e40","t-rose":"#b83c3f","c-slate":"#5d6677","t-slate":"#5d6677",coin:"#e9b114",coint:"#856300",coinin:"#a8740c",tint:"5%",edge:"20%",shA:".05",shB:".08",carry:"#65686f"},dark:{page:"#08090c",bg:"#0d0e12",surf:"#17191f",sunk:"#121419",ink:"#eceef3",ink2:"#c4c8d2",mute:"#9198a6",hair:"#eceef31f",line:"#eceef340",sh:"#000000","on-c":"#0d0e12","c-blue":"#7e7ef6","t-blue":"#989cfd","c-amber":"#c78135","t-amber":"#dd954b","c-green":"#20ac7a","t-green":"#35b986","c-violet":"#695b9f","t-violet":"#a79ae3","c-rose":"#bc434b","t-rose":"#fd7d81","c-slate":"#9ba3b2","t-slate":"#9da5b4",coin:"#f0c040",coint:"#f0c040",coinin:"#9a6a0c",tint:"6%",edge:"19%",shA:".45",shB:".35"}},paper:{name:"\u7D19\u3068\u58A8",note:"\u751F\u6210\u308A\u306E\u7D19\u306E\u5730\u306B\u3001\u85CD / \u9EC4\u571F / \u82D4 / \u8461\u8404 / \u6731 / \u920D\u306E\u304F\u3059\u3093\u3060 6 \u8272",light:{page:"#ece7dd",bg:"#f9f6f0",surf:"#fffcf6",sunk:"#f2ede4",ink:"#221e18",ink2:"#4b453b",mute:"#7b7366",hair:"#221e181f",line:"#221e1847",sh:"#3a2a10","on-c":"#fffcf6","c-blue":"#487dd5","t-blue":"#2d60b5","c-amber":"#c38405","t-amber":"#885a01","c-green":"#57a271","t-green":"#237143","c-violet":"#904698","t-violet":"#904698","c-rose":"#a9513e","t-rose":"#9f4836","c-slate":"#6a645a","t-slate":"#696359",coin:"#d4a52a",coint:"#7d5e05",coinin:"#9a7016",tint:"6%",edge:"22%",shA:".06",shB:".07",carry:"#68635c"},dark:{page:"#0e0d0b",bg:"#15130f",surf:"#1e1b17",sunk:"#191612",ink:"#ede6d8",ink2:"#cbc2b1",mute:"#9c9283",hair:"#ede6d81f",line:"#ede6d842",sh:"#000000","on-c":"#15130f","c-blue":"#5785d5","t-blue":"#76a6f9","c-amber":"#be8802","t-amber":"#d59e2f","c-green":"#52aa71","t-green":"#61b87e","c-violet":"#90529b","t-violet":"#d08edb","c-rose":"#bb4e3d","t-rose":"#f98672","c-slate":"#a9a295","t-slate":"#aca598",coin:"#dcb24e",coint:"#dcb24e",coinin:"#8a6a14",tint:"6%",edge:"19%",shA:".45",shB:".35"}},night:{name:"\u591C\u306E\u8A08\u5668",note:"\u9752\u307F\u306E\u9ED2\u306E\u5730\u306B\u3001\u5149\u308B\u6C34\u8272 / \u7425\u73C0 / \u82E5\u7DD1 / \u83EB / \u6843 \u306E 6 \u8272\u3002\u660E\u308B\u3044\u5074\u306F\u9752\u7070\u306E\u5730",light:{page:"#e9eef5",bg:"#f6f9fc",surf:"#ffffff",sunk:"#eef3f8",ink:"#0b1424",ink2:"#34425a",mute:"#64748b",hair:"#0b14241c",line:"#0b142440",sh:"#0b1424","on-c":"#ffffff","c-blue":"#0385cd","t-blue":"#086aa3","c-amber":"#ba8e0f","t-amber":"#7f5f04","c-green":"#0a8857","t-green":"#027449","c-violet":"#5839ba","t-violet":"#5839ba","c-rose":"#dd4a94","t-rose":"#b82375","c-slate":"#64748b","t-slate":"#56667c",coin:"#eab308",coint:"#7e6005",coinin:"#a16207",tint:"5%",edge:"22%",shA:".06",shB:".09",carry:"#596579"},dark:{page:"#060a12",bg:"#0a101c",surf:"#111a2a",sunk:"#0d1522",ink:"#e6edf7",ink2:"#b8c4d6",mute:"#8090a8",hair:"#e6edf71c",line:"#9fb3d145",sh:"#000000","on-c":"#0a101c","c-blue":"#3884b6","t-blue":"#62ace1","c-amber":"#be8533","t-amber":"#d59b4b","c-green":"#3ba774","t-green":"#4fb884","c-violet":"#7d4ecd","t-violet":"#b494fd","c-rose":"#bc3a74","t-rose":"#ff77ad","c-slate":"#96a3b5","t-slate":"#99a6b8",coin:"#facc15",coint:"#facc15",coinin:"#a16207",tint:"6%",edge:"19%",shA:".5",shB:".4"}}};var $e={sans:"Noto Sans JP Variable",mono:"JetBrains Mono Variable"},Jt={0:590,1:590,2:590,3:590,4:590,5:590,6:590,7:590,8:590,9:590," ":228,"!":371,'"':575,"#":590,$:590,"%":963,"&":740,"'":325,"(":378,")":378,"*":507,"+":590,",":325,"-":371,".":325,"/":390,":":325,";":325,"<":590,"=":590,">":590,"?":514,"@":1007,A:642,B:682,C:657,D:715,E:616,F:586,G:718,H:758,I:330,J:568,K:686,L:579,M:854,N:750,O:771,P:668,Q:771,R:682,S:624,T:626,U:748,V:619,W:915,X:627,Y:581,Z:614,"[":378,"\\":390,"]":378,"^":590,_:568,"`":626,a:591,b:644,c:528,d:645,e:581,f:372,g:598,h:640,i:305,j:306,k:605,l:315,m:964,n:641,o:626,p:645,q:645,r:437,s:495,t:421,u:638,v:576,w:863,x:562,y:575,z:512,"{":378,"|":297,"}":378,"~":590,"\u2026":1e3,"\u2212":590,"\xD7":1e3,"\u2192":1e3,"\u2190":1e3,"\u2191":1e3,"\u2193":1e3,"\u2013":545,"\u2014":908,"\u2018":325,"\u2019":325,"\u201C":575,"\u201D":575,"\xB0":404,"\xB1":1e3,"\xB7":593,"\u2022":379},Qt=600,Zt=11904,Me=1e3;function ct(e,n){return(e.codePointAt(0)??0)>=Zt?Me:n==="mono"?Qt:Jt[e]??Me}var en="paper",Ue=Object.fromEntries(Object.entries(lt).map(([e,n])=>[e,{id:e,...n}]));function Se(e){return(e!==void 0&&Object.hasOwn(Ue,e)?Ue[e]:void 0)??Ue[en]}function Oe(e,n){return Object.entries(e[n]).map(([s,a])=>`--${s}:${a}`).join(";")}var Ee=`--sans:"${$e.sans}";--mono:"${$e.mono}"`,ke=["blue","amber","green","violet","rose"],Q=(e,n,s="sans")=>({size:e,weight:n,family:s}),L={boxName:Q(13,650),boxSub:Q(11,500),boxSubStrong:Q(11,700),regionName:Q(12.5,700),regionNote:Q(11,500),label:Q(11,600,"mono"),labelJa:Q(11,650),action:Q(11,650),badge:Q(10.5,700,"mono"),carrier:Q(10.5,700,"mono"),carrierJa:Q(10.5,700),stripTitle:Q(12.5,700),fieldName:Q(10.5,600),fieldValue:Q(12,600,"mono"),fieldValueJa:Q(12,600),tag:Q(10.5,700),miniTitle:Q(10.5,700),stepTitle:Q(15,700),stepBody:Q(13.5,500),stepNo:Q(13,700,"mono"),button:Q(14,700)},b={gap:10,margin:14,box:{h:72,minW:92,padX:12,radius:12,icon:24,iconRadius:7,iconY:-16,iconScale:.74,nameY:12,subY:27},region:{pad:18,gap:10,radius:14,inset:14,icon:24,iconRadius:7,iconScale:.68,nameY:58,line:16,minH:108},architecture:{columns:4,columnGap:56,maxColumnGap:160,rowGap:44,labelRoom:16},sequence:{columnGap:40,labelRoom:16,firstRow:22,rowGap:14,stepGap:8,minPitch:40,tail:18,selfW:34,selfH:18},edge:{inset:3,arrow:6,arrowHalf:3.5,parallel:5,ghostDash:5,flowDash:9},label:{h:20,padX:9,radius:10,offset:22,side:14,search:4,searchMax:400,soft:6},action:{h:22,padX:10,radius:11},badge:{r:9.5,ring:9,inset:4,along:14,short:44},carrier:{envW:24,envH:17,coinR:6.5,coinIn:3.8,tagH:18,tagPadX:8,samples:16},strip:{h:72,line:44,pad:12,icon:24,titleX:44,fieldGap:22,sepInset:14,tagGap:6,tagH:15,tagPadX:7,nameY:22,valueY:43},stroke:{hair:1,edge:1.7,edgeOn:2.25,arrow:1.5,flow:1.3,halo:7,on:1.75,glyph:2,lifeline:1.2,envelope:1.5,badgeRing:1.5},shadow:{near:.8,far:4,nearY:1,farY:3},mini:{w:168,pad:8,title:14,inset:12,radius:10},follow:{aspect:.75,minH:320,fitMinH:160,ease:.6,narrow:440,badgeRoom:8,headRoom:10,head:{pad:8,h:40,nameY:17,subY:31}},mix:{icon:14,regionIcon:16,regionIconEdge:34,cap:12,capEdge:42,badgePast:14,badgePastEdge:70,mini:62,miniBand:16,miniBandEdge:36,view:6},baseline:{label:3.8,badge:3.5,carrier:3.7,stripTitle:4.5,tag:3.6,action:3.8},rise:5,popFrom:.4,player:{gap:10,radius:12,button:36,touch:44,hidden:1,focus:2,narrow:440}},Y={intro:1.4,outro:4.6,tail:.6,stepBase:1.2,perChar:.025,stepMin:2.2,stepMax:5,dwell:1.2,edgeAt:.1,stagger:.5,draw:.55,drawCarry:.9,action:.9,change:.12,minShow:.8,labelDelay:.15,fade:.3,popFade:.4,untilFade:.2,still:.45},pt=10.5,Z={inOut:"cubic-bezier(.65,0,.35,1)",out:"cubic-bezier(.22,1,.36,1)",pop:"cubic-bezier(.34,1.56,.64,1)"};var be=e=>[...e].some(n=>(n.codePointAt(0)??0)>=11904);function tn(e,n){return n==="mono"&&be(e)?"sans":n}function z(e,n){let s=tn(e,n.family),a=0;for(let o of e)a+=ct(o,s);return a*n.size/Me}function Je(e){return e.steps.flatMap((n,s)=>n.events.flatMap((a,o)=>a.type==="edge"?[{step:s,event:o,edge:a}]:[]))}function qe(e){let n=Qe(e),s=new Map;return e.boxes.forEach((a,o)=>{let t=a.region===void 0?void 0:n.get(a.region);s.set(a.id,a.color??t??ke[o%ke.length])}),s}function Qe(e){let n=new Map;return(e.regions??[]).forEach((s,a)=>n.set(s.id,s.color??ke[a%ke.length])),n}var Le=(e,n)=>e.carry.kind==="coin"?"coin":n.get(e.from)??"slate";function Te(e,n,s){let a=e.boxes.find(t=>t.id===n);if(!a)return b.box.minW;let o=[z(a.name,L.boxName),z(a.sub??"",L.boxSub)];for(let t of e.steps)for(let r of t.events)r.type==="swap"&&r.box===n&&o.push(z(r.text,L.boxSubStrong)),s&&r.type==="action"&&r.box===n&&o.push(z(r.label,L.boxSubStrong));return Math.max(b.box.minW,Math.max(...o)+b.box.padX*2)}function dt(e,n){let s=Math.max(n.x-(e.x+e.w),e.x-(n.x+n.w)),a=Math.max(n.y-(e.y+e.h),e.y-(n.y+n.h));return Math.max(s,a)}function nn(e){let n={a:e[0],b:e[1]??e[0],length:-1};for(let s=1;s<e.length;s++){let a=e[s-1],o=e[s],t=Math.hypot(o[0]-a[0],o[1]-a[1]);t>n.length&&(n={a,b:o,length:t})}return{a:n.a,b:n.b,vertical:Math.abs(n.b[0]-n.a[0])<Math.abs(n.b[1]-n.a[1])}}function Ze(e,n){let s=n;for(let a=1;a<e.length;a++){let o=e[a-1],t=e[a],r=Math.hypot(t[0]-o[0],t[1]-o[1]);if(s<=r&&r>0)return[o[0]+(t[0]-o[0])*s/r,o[1]+(t[1]-o[1])*s/r];s-=r}return e[e.length-1]}function et(e){let n=0;for(let s=1;s<e.length;s++){let a=e[s-1],o=e[s];n+=Math.hypot(o[0]-a[0],o[1]-a[1])}return n}function je(e){let n=et(e);return Ze(e,n<b.badge.short?n/2:b.badge.along)}var ve=e=>be(e)?L.labelJa:L.label;function Ne(e,n){let s=z(e.text,ve(e.text))+b.label.padX*2,a=b.label.h,o=nn(e.points),t=(o.a[0]+o.b[0])/2,r=(o.a[1]+o.b[1])/2,i=e.side??(o.vertical?"right":"above"),{offset:l,side:c}=b.label,f=i==="above"?{x:t-s/2,y:r-l-a/2,w:s,h:a}:i==="below"?{x:t-s/2,y:r+l-a/2,w:s,h:a}:i==="left"?{x:t-c-s,y:r-a/2,w:s,h:a}:{x:t+c,y:r-a/2,w:s,h:a},u=i==="above"?[0,-1]:i==="below"?[0,1]:i==="left"?[-1,0]:[1,0],g=[Math.abs(u[1]),Math.abs(u[0])],p=i==="above"||i==="below"?s:a*4,d=h=>n.hard.every(x=>dt(h,x)>=b.gap)&&n.soft.every(x=>dt(h,x)>=b.label.soft),{search:v,searchMax:E}=b.label;for(let h=0;h<=E;h+=v)for(let x=0;x<=p;x+=v)for(let w of x===0?[1]:[1,-1]){let T={x:f.x+u[0]*h+g[0]*x*w,y:f.y+u[1]*h+g[1]*x*w,w:s,h:a};if(d(T))return{...T,step:e.step,event:e.event,text:e.text,family:ve(e.text).family,color:e.color}}return{...f,step:e.step,event:e.event,text:e.text,family:ve(e.text).family,color:e.color}}function ft(e,n){let s=0,a=0;for(let t of e.steps)for(let r of t.events)r.type!=="strip"||r.field!==n||(r.value!==void 0&&(s=Math.max(s,z(r.value,be(r.value)?L.fieldValueJa:L.fieldValue))),r.tag!==void 0&&(a=Math.max(a,z(r.tag,L.tag)+b.strip.tagPadX*2)));let o=s+(a>0?(s>0?b.strip.tagGap:0)+a:0);return Math.max(z(n,L.fieldName),o)}function Ae(e){if(!e.strip)return 0;let{titleX:n,fieldGap:s,pad:a}=b.strip;return n+z(e.strip.title,L.stripTitle)+s+e.strip.fields.reduce((t,r)=>t+ft(e,r)+s,0)-s+a}function Ce(e,n,s,a){if(!e.strip)return;let{titleX:o,fieldGap:t,pad:r,line:i,h:l}=b.strip,c=o+z(e.strip.title,L.stripTitle)+t,f=[],u=c,g=0;for(let p of e.strip.fields){let d=ft(e,p);u>c&&u+d>a-r&&(u=c,g++),f.push({name:p,x:n+u,y:s+g*i,w:d}),u+=d+t}return{x:n,y:s,w:a,h:l+g*i,title:e.strip.title,fields:f}}function Re(e,n,s){let a=o=>{o.x+=n,o.y+=s};for(let o of e.boxes)a(o),o.cx+=n,o.cy+=s;for(let o of e.regions)o.y+=s,a(o.header);for(let o of e.lifelines)o.x+=n,o.y1+=s,o.y2+=s;for(let o of e.edges)o.points=o.points.map(([t,r])=>[t+n,r+s]),o.settle&&(o.settle=[o.settle[0]+n,o.settle[1]+s]);for(let o of e.labels)a(o);for(let o of e.actions)a(o);for(let o of e.badges)o.x+=n,o.y+=s;if(e.strip){e.strip.y+=s;for(let o of e.strip.fields)o.x+=n,o.y+=s}}function De(e,n,s){let{inset:a}=b.badge;for(let t of e){let r=t.type==="swap"||t.type==="action"?t.box:void 0,i=s.boxes.find(l=>l.id===r);if(i)return{step:n,x:i.x+a,y:i.y+a,color:i.color}}if(s.strip&&e.some(t=>t.type==="strip"))return{step:n,x:s.strip.x+a,y:s.strip.y+a,color:"slate"};let o=s.boxes[0];return{step:n,x:o.x+a,y:o.y+a,color:o.color}}function ut(e){let n=rn(e),s=sn(e,n),a=n.map(()=>({top:0,bottom:0})),o=mt(e,n,s,a);for(let t=0;t<3&&ln(o,n,s,a);t++)o=mt(e,n,s,a);return o}function rn(e){let n=e.regions??[],s=new Set(n.map(t=>t.id)),a=n.map(t=>({region:t,members:e.boxes.filter(r=>r.region===t.id).map(r=>r.id)})),o=e.boxes.filter(t=>t.region===void 0||!s.has(t.region)).map(t=>t.id);return o.length>0&&a.push({members:o}),a}var gt=e=>e==="left"||e==="right";function sn(e,n){let s=b.architecture.columns,a=Je(e).map(r=>r.edge),o=new Map;n.forEach((r,i)=>{let l=new Set(r.members),c=new Set,f=(h,x)=>h>=0&&h<s&&!c.has(`${h},${x}`),u=(h,x)=>{let w=Math.min(s-1,Math.max(0,h));for(let T=x;;T++)for(let k=0;k<s;k++)for(let A of[w+k,w-k])if(f(A,T))return[A,T]},g=(h,x,w)=>{o.set(h,{group:i,col:x,row:w}),c.add(`${x},${w}`)},p=1,d=h=>{for(let x of a){let w=x.from===h?x.to:x.to===h?x.from:void 0;if(w===void 0||!l.has(w)||o.has(w))continue;let T=o.get(h),[k,A]=gt(x.labelSide)?u(T.col,T.row+1):f(T.col+p,T.row)?[T.col+p,T.row]:u(T.col+p,T.row);g(w,k,A),d(w)}},v=h=>{for(let x=0;x<a.length;x++){let w=a[x],T=w?.from===h?w.to:w?.to===h?w.from:void 0,k=T===void 0?void 0:o.get(T);if(k&&k.group<i)return{order:x,col:k.col}}},E=0;for(;;){let h=r.members.filter(F=>!o.has(F));if(h.length===0)break;let x=h.map(F=>({id:F,anchor:v(F)})).filter(F=>F.anchor!==void 0);x.sort((F,H)=>(F.anchor?.order??0)-(H.anchor?.order??0));let w=x[0]??{id:h[0],anchor:void 0},T=w.anchor?.col??0;E===0&&(p=T>=(s-1)/2?-1:1);let[k,A]=f(T,0)?[T,0]:u(T,0);g(w.id,k,A),d(w.id),E++}});let t=[...new Set([...o.values()].map(r=>r.col))].sort((r,i)=>r-i);for(let r of o.values())r.col=t.indexOf(r.col);return o}function on(e){let n=[...e.matchAll(/ /g)].map(a=>a.index);if(n.length===0)return[e];let s=n.reduce((a,o)=>Math.abs(o-e.length/2)<Math.abs(a-e.length/2)?o:a);return[e.slice(0,s),e.slice(s+1)]}function an(e){let{icon:n,nameY:s,line:a,inset:o}=b.region,t=on(e.name),r=Math.max(n,...t.map(l=>z(l,L.regionName)),z(e.note??"",L.regionNote)),i=s-o+(t.length-1)*a+(e.note?a:0)+b.gap/2;return{w:r,h:i,lines:t}}function mt(e,n,s,a){let{box:o,region:t,architecture:r,margin:i,gap:l}=b,c=qe(e),f=Qe(e),u=Je(e),g=Math.max(1,...[...s.values()].map(m=>m.col+1)),p=new Map(e.boxes.map(m=>[m.id,Te(e,m.id,!0)])),d=Array.from({length:g},(m,S)=>Math.max(o.minW,...[...s].filter(([,y])=>y.col===S).map(([y])=>p.get(y)??o.minW))),v=Array.from({length:Math.max(0,g-1)},()=>r.columnGap);for(let{edge:m}of u){let S=s.get(m.from),y=s.get(m.to);if(!S||!y||m.label===void 0||S.group!==y.group||S.row!==y.row||Math.abs(S.col-y.col)!==1||gt(m.labelSide))continue;let P=z(m.label,ve(m.label))+b.label.padX*2+r.labelRoom*2,W=Math.min(S.col,y.col);P<=r.maxColumnGap&&(v[W]=Math.max(v[W]??0,P))}let E=n.map(m=>m.region?an(m.region):void 0),h=Math.max(0,...E.map(m=>m?m.w+t.inset*2:0)),x=[];for(let m=0;m<g;m++)x.push(m===0?i+(h>0?h:t.pad):x[m-1]+d[m-1]+v[m-1]);let w=m=>x[m]+d[m]/2,T=[],k=[],A=i;n.forEach((m,S)=>{let y=Math.max(1,...m.members.map(ne=>(s.get(ne)?.row??0)+1)),P=a[S],W=A+t.pad+P.top;for(let ne of m.members){let I=s.get(ne),V=e.boxes.find(j=>j.id===ne),C=p.get(ne)??o.minW,G=w(I.col),U=W+I.row*(o.h+r.rowGap);T.push({id:ne,name:V?.name??ne,...V?.sub!==void 0?{sub:V.sub}:{},...V?.icon!==void 0?{icon:V.icon}:{},color:c.get(ne)??"slate",x:G-C/2,y:U,w:C,h:o.h,cx:G,cy:U+o.h/2})}let J=W+y*o.h+(y-1)*r.rowGap,X=E[S],le=Math.max(J+t.pad+P.bottom-A,X?X.h+t.inset*2:0,m.region?t.minH:0);k.push({group:S,y:A,h:le,rows:y}),A+=le+t.gap});let F=A-t.gap,H=new Map(T.map(m=>[m.id,m])),_=m=>k[s.get(m)?.group??0],me=(m,S,y)=>T.some(P=>{if(P.id===S||P.id===y)return!1;let W=b.label.search;for(let J=1;J<m.length;J++){let[X,le]=m[J-1],[ne,I]=m[J];if(Math.min(X,ne)<=P.x+P.w+W&&Math.max(X,ne)>=P.x-W&&Math.min(le,I)<=P.y+P.h+W&&Math.max(le,I)>=P.y-W)return!0}return!1}),ge=m=>{let S=H.get(m),y=_(m);return(s.get(m)?.row??0)<y.rows-1?S.y+S.h+r.rowGap/2:Math.min(S.y+S.h+t.pad/2,y.y+y.h-b.edge.inset)},re=m=>{let S=H.get(m),y=_(m);return(s.get(m)?.row??0)>0?S.y-r.rowGap/2:Math.max(S.y-t.pad/2,y.y+b.edge.inset)},te=b.edge.inset,de=(m,S)=>{let y=H.get(m),P=H.get(S),W=s.get(m),J=s.get(S);if(W.group===J.group&&W.row===J.row){let G=P.cx>y.cx,U=[[G?y.x+y.w:y.x,y.cy],[G?P.x-te:P.x+P.w+te,P.cy]];if(!me(U,m,S))return U;let j=ge(m);return[[y.cx,y.y+y.h],[y.cx,j],[P.cx,j],[P.cx,P.y+P.h+te]]}let X=P.cy>y.cy,le=[y.cx,X?y.y+y.h:y.y],ne=[P.cx,X?P.y-te:P.y+P.h+te];if(W.col===J.col){let G=[le,ne];if(!me(G,m,S))return G;let U=y.x+y.w+(v[W.col]??r.columnGap)/2;return[[y.x+y.w,y.cy],[U,y.cy],[U,P.cy],[P.x+P.w+te,P.cy]]}let I=P.cx>y.cx,V=X?ge(m):re(m),C=[[le,[y.cx,P.cy],[I?P.x-te:P.x+P.w+te,P.cy]],[[I?y.x+y.w:y.x,y.cy],[P.cx,y.cy],ne],[le,[y.cx,V],[P.cx,V],ne]];return C.find(G=>!me(G,m,S))??C[2]},M=u.map(({step:m,event:S,edge:y})=>{let P=H.get(y.to);return{step:m,event:S,from:y.from,to:y.to,points:de(y.from,y.to),color:Le(y,c),carry:y.carry,settle:[P.cx,P.cy+o.iconY]}});for(let m of M){if(m.points.length!==2||!M.some(X=>X.from===m.to&&X.to===m.from&&X.points.length===2))continue;let[y,P]=m.points,W=Math.abs(P[1]-y[1])<Math.abs(P[0]-y[0]),J=(m.from<m.to?1:-1)*b.edge.parallel;m.points=m.points.map(([X,le])=>W?[X,le+J]:[X+J,le])}let q=[];n.forEach((m,S)=>{let y=k[S],P=E[S];!m.region||!P||q.push({id:m.region.id,lines:P.lines,...m.region.note!==void 0?{note:m.region.note}:{},...m.region.icon!==void 0?{icon:m.region.icon}:{},color:f.get(m.region.id)??"slate",x:i,y:y.y,w:0,h:y.h,header:{x:i+t.inset,y:y.y+t.inset,w:P.w,h:P.h}})});let O=[];for(let m of M){let S=e.steps[m.step]?.events[m.event];if(S?.type!=="edge"||S.label===void 0)continue;let y=[...q.map(P=>P.header),...O.filter(P=>P.step===m.step)];O.push(Ne({step:m.step,event:m.event,text:S.label,points:m.points,color:m.color,...S.labelSide?{side:S.labelSide}:{}},{hard:T,soft:y}))}let D={kind:"architecture",width:0,height:0,regions:q,boxes:T,lifelines:[],edges:M,labels:O,actions:[],badges:[]},B=O.length>0?Math.max(0,i+b.label.soft-Math.min(...O.map(m=>m.x))):0;B>0&&Re(D,B,0);let R=Math.max(...T.map(m=>m.x+m.w+t.pad),...O.map(m=>m.x+m.w+b.label.soft),...M.flatMap(m=>m.points.map(S=>S[0]+t.pad))),K=Math.max(R+i,Ae(e)+i*2);for(let m of q)m.w=K-i*2;let se=Ce(e,i,F+l,K-i*2);return D.width=K,D.height=(se?se.y+se.h:F)+i,se&&(D.strip=se),D.badges=e.steps.map((m,S)=>{let y=M.find(J=>J.step===S);if(!y)return De(m.events,S,D);let[P,W]=je(y.points);return{step:S,x:P,y:W,color:y.color}}),D}function ln(e,n,s,a){let o=!1,t=b.label.soft;for(let r of e.labels){let i=e.edges.find(d=>d.step===r.step&&d.event===r.event),l=i&&s.get(i.from),c=i&&s.get(i.to);if(!l||!c||l.group!==c.group||!n[l.group]?.region)continue;let f=e.regions.find(d=>d.id===n[l.group]?.region?.id),u=a[l.group];if(!f||!u)continue;let g=f.y+t-r.y,p=r.y+r.h-(f.y+f.h-t);g>0&&(u.top+=g,o=!0),p>0&&(u.bottom+=p,o=!0)}return o}function ht(e){let{box:n,sequence:s,label:a,margin:o,gap:t}=b,r=qe(e),i=e.sequence?.lifelines??[],l=[...i,...e.boxes.map(M=>M.id).filter(M=>!i.includes(M))],c=new Map(l.map((M,q)=>[M,q])),f=l.map(M=>Te(e,M,!1)),u=f.slice(1).map((M,q)=>f[q]/2+M/2+s.columnGap),g=[];for(let M of e.steps)for(let q of M.events){if(q.type!=="edge"||q.label===void 0)continue;let O=c.get(q.from)??0,D=c.get(q.to)??0,B=z(q.label,ve(q.label))+a.padX*2;O===D?O<u.length&&g.push({from:O,to:O+1,need:s.selfW+a.side+B+s.labelRoom}):g.push({from:Math.min(O,D),to:Math.max(O,D),need:B+s.labelRoom*2})}g.sort((M,q)=>M.to-M.from-(q.to-q.from));for(let{from:M,to:q,need:O}of g){let D=0;for(let R=M;R<q;R++)D+=u[R]??0;if(D>=O)continue;let B=(O-D)/(q-M);for(let R=M;R<q;R++)u[R]=(u[R]??0)+B}let p=[];l.forEach((M,q)=>p.push(q===0?o+f[0]/2:p[q-1]+u[q-1]));let d=l.map((M,q)=>{let O=e.boxes.find(R=>R.id===M),D=f[q],B=p[q];return{id:M,name:O?.name??M,...O?.sub!==void 0?{sub:O.sub}:{},...O?.icon!==void 0?{icon:O.icon}:{},color:r.get(M)??"slate",x:B-D/2,y:o,w:D,h:n.h,cx:B,cy:o+n.h/2}}),v=o+n.h,E=[],h=[],x=[],w=v+s.firstRow,T=0,k=!0;e.steps.forEach((M,q)=>{M.events.forEach((O,D)=>{if(O.type!=="edge"&&O.type!=="action")return;let B,R;if(O.type==="edge"){let K=O.labelSide??"above",se=O.from===O.to,m=O.label!==void 0;B=m&&K==="above"?a.offset+a.h/2:t,R=se?s.selfH+t:m&&K==="below"?a.offset+a.h/2:t}else B=b.action.h/2,R=b.action.h/2;if(w=k?w+B:w+Math.max(s.minPitch,T+s.rowGap+B)+(D===0&&q>0?s.stepGap:0),k=!1,T=R,O.type==="edge"){let K=p[c.get(O.from)??0],se=p[c.get(O.to)??0],m=Math.sign(se-K)||1,S=K===se?[[K,w],[K+s.selfW,w],[K+s.selfW,w+s.selfH],[K+b.edge.inset,w+s.selfH]]:[[K,w],[se-m*b.edge.inset,w]],y=Le(O,r);E.push({step:q,event:D,from:O.from,to:O.to,points:S,color:y,carry:O.carry}),O.label!==void 0&&x.push({step:q,event:D,text:O.label,points:S,color:y,...O.labelSide?{side:O.labelSide}:K===se?{side:"right"}:{}})}else{let K=p[c.get(O.box)??0],se=z(O.label,L.action)+b.action.padX*2;h.push({step:q,event:D,box:O.box,text:O.label,color:r.get(O.box)??"slate",x:K+b.badge.r+4,y:w-b.action.h/2,w:se,h:b.action.h})}})});let A=(k?v:w+T)+s.tail,F=l.map((M,q)=>({id:M,x:p[q],y1:v,y2:A})),H=[];for(let M of x){let q=[...H.filter(O=>O.step===M.step),...h];H.push(Ne(M,{hard:d,soft:q}))}let _={kind:"sequence",width:0,height:0,regions:[],boxes:d,lifelines:F,edges:E,labels:H,actions:h,badges:[]},me=[...d.map(M=>M.x),...H.map(M=>M.x),...h.map(M=>M.x)],ge=Math.max(0,o-Math.min(...me));ge>0&&Re(_,ge,0);let re=[...d.map(M=>M.x+M.w),...H.map(M=>M.x+M.w),...h.map(M=>M.x+M.w),...E.flatMap(M=>M.points.map(q=>q[0]))],te=Math.max(Math.max(...re)+o,Ae(e)+o*2),de=Ce(e,o,A+t,te-o*2);return _.width=te,_.height=(de?de.y+de.h:A)+o,de&&(_.strip=de),_.badges=cn(e,_),_}function cn(e,n){return e.steps.map((s,a)=>{let o=n.edges.find(i=>i.step===a);if(o){let[i,l]=je(o.points);return{step:a,x:i,y:l,color:o.color}}let t=n.actions.find(i=>i.step===a),r=t&&n.lifelines.find(i=>i.id===t.box);return t&&r?{step:a,x:r.x,y:t.y+t.h/2,color:t.color}:De(s.events,a,n)})}var pn={string:"\u6587\u5B57\u5217\u306B\u3059\u308B",integer:"\u6574\u6570\u306B\u3059\u308B",number:"\u6570\u306B\u3059\u308B",object:"\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u3059\u308B",array:"\u914D\u5217\u306B\u3059\u308B",boolean:"true \u304B false \u306B\u3059\u308B",null:"null \u306B\u3059\u308B"},dn={string:"Use a string",integer:"Use an integer",number:"Use a number",object:"Use an object",array:"Use an array",boolean:"Use true or false",null:"Use null"},yt=(e,n)=>`${e} ${n}${e===1?"":"s"}`,fn={additionalProperties:e=>`${e} \u3068\u3044\u3046\u6B04\u306F\u66F8\u3051\u306A\u3044`,required:e=>`${e} \u306E\u6B04\u304C\u8981\u308B`,enum:e=>`${e.join(" / ")} \u306E\u3069\u308C\u304B\u306B\u3059\u308B`,type:e=>pn[e]??`${e} \u306B\u3059\u308B`,minLength:e=>`${e} \u5B57\u4EE5\u4E0A\u66F8\u304F`,pattern:e=>e?`${e.space?"\u7A7A\u767D\u3068 ":""}${e.chars.join(" ")} \u306F\u4F7F\u3048\u306A\u3044`:"\u4F7F\u3048\u306A\u3044\u5B57\u304C\u5165\u3063\u3066\u3044\u308B",minItems:e=>`${e} \u3064\u4EE5\u4E0A\u66F8\u304F`,minimum:e=>`${e} \u4EE5\u4E0A\u306B\u3059\u308B`,const:e=>`${e} \u306B\u3059\u308B`,not:e=>e?`${e.field} \u306E\u6B04\u306F kind \u304C ${e.kind} \u306E\u6642\u3060\u3051\u66F8\u3051\u308B`:"\u3053\u306E\u6B04\u306E\u7D44\u307F\u5408\u308F\u305B\u306F\u66F8\u3051\u306A\u3044",anyOf:e=>e.length>0?`${e.join(" \u304B ")} \u306E${e.length===2?"\u3069\u3061\u3089\u304B":"\u3069\u308C\u304B"}\u306E\u6B04\u304C\u8981\u308B`:"\u66F8\u3051\u308B\u5F62\u306E\u3069\u308C\u306B\u3082\u5408\u308F\u306A\u3044",oneOf:"\u66F8\u3051\u308B\u5F62\u306E\u3069\u308C\u304B 1 \u3064\u3060\u3051\u306B\u5408\u308F\u305B\u308B",discriminator:(e,n)=>`${e} \u306F ${n.join(" / ")} \u306E\u3069\u308C\u304B\u306B\u3059\u308B`,newer:(e,n)=>`\u7248 ${e} \u306E\u56F3\u306F\u3001\u3053\u306E\u9053\u5177 (\u7248 ${n}) \u3088\u308A\u65B0\u3057\u3044\u306E\u3067\u8AAD\u3081\u306A\u3044\u3002\u9053\u5177\u3092\u65B0\u3057\u304F\u3059\u308B`},mn={additionalProperties:e=>`The ${e} field is not allowed`,required:e=>`The ${e} field is required`,enum:e=>`Use one of ${e.join(" / ")}`,type:e=>dn[e]??`Use ${e}`,minLength:e=>`Write at least ${yt(e,"character")}`,pattern:e=>e?`Cannot contain ${e.space?"spaces or ":""}${e.chars.join(" ")}`:"Contains characters that are not allowed",minItems:e=>`Write at least ${yt(e,"item")}`,minimum:e=>`Use ${e} or greater`,const:e=>`Use ${e}`,not:e=>e?`The ${e.field} field is allowed only when kind is ${e.kind}`:"This combination of fields is not allowed",anyOf:e=>e.length>0?`Write one of the ${e.join(" or ")} fields`:"Does not match any of the allowed shapes",oneOf:"Match exactly one of the allowed shapes",discriminator:(e,n)=>`${e} is one of ${n.join(" / ")}`,newer:(e,n)=>`Version ${e} diagrams are newer than this tool (version ${n}) and cannot be read. Update the tool`},Fe={ja:fn,en:mn};function un(e){let n=0;for(let s of e)n++;return n}var nt=xt,tt={title:"dragon \u306E\u56F3\u306E\u539F\u672C",description:"\u533A\u753B\u3001\u7BB1\u3001\u7DDA\u3001\u904B\u3076\u7269\u3001\u6BB5\u3001\u4E2D\u8EAB\u306E\u5E2F\u306E 6 \u90E8\u54C1\u3092\u5171\u901A\u306E\u9AA8\u7D44\u307F\u306B\u7F6E\u304D\u3001\u56F3\u306E\u7A2E\u985E\u3060\u3051\u306E\u7269\u306F\u7A2E\u985E\u306E\u6B04\u306B\u7F6E\u304F\u3002\u5EA7\u6A19\u306F\u6301\u305F\u306A\u3044\u3002",type:"object",additionalProperties:!1,required:["version","kind","title","boxes","steps"],properties:{version:{description:"\u5F62\u5F0F\u306E\u7248",type:"integer",minimum:1},kind:{description:"\u56F3\u306E\u7A2E\u985E",enum:["sequence","architecture"]},title:{$ref:"#/definitions/text"},view:{description:"\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059",enum:["fixed","follow"]},regions:{type:"array",items:{$ref:"#/definitions/region"}},boxes:{type:"array",minItems:1,items:{$ref:"#/definitions/box"}},strip:{$ref:"#/definitions/strip"},steps:{type:"array",minItems:1,items:{$ref:"#/definitions/step"}},sequence:{$ref:"#/definitions/sequence"}},if:{required:["kind"],properties:{kind:{const:"sequence"}}},then:{required:["sequence"]},else:{not:{required:["sequence"]}},definitions:{text:{type:"string",minLength:1},id:{type:"string",pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},color:{enum:["blue","amber","green","violet","rose","slate","coin"]},region:{type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},note:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},icon:{$ref:"#/definitions/text"}}},box:{type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},sub:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},icon:{$ref:"#/definitions/text"},region:{$ref:"#/definitions/id"}}},strip:{type:"object",additionalProperties:!1,required:["title","fields"],properties:{title:{$ref:"#/definitions/text"},fields:{type:"array",minItems:1,items:{$ref:"#/definitions/text"}}}},step:{type:"object",additionalProperties:!1,required:["title","body","events"],properties:{title:{$ref:"#/definitions/text"},body:{$ref:"#/definitions/text"},code:{$ref:"#/definitions/text"},events:{type:"array",items:{$ref:"#/definitions/event"}}}},event:{description:"\u6BB5\u306E\u4E2D\u3067\u8D77\u304D\u308B\u3053\u3068\u3002\u8D77\u304D\u308B\u9806\u306B\u4E26\u3079\u308B",type:"object",required:["type"],discriminator:{propertyName:"type"},oneOf:[{description:"\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B",type:"object",additionalProperties:!1,required:["type","from","to","carry"],properties:{type:{const:"edge"},from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"},carry:{$ref:"#/definitions/carry"},labelSide:{description:"\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)",enum:["above","below","left","right"]}}},{description:"\u7BB1\u306E\u4E2D\u306E\u51E6\u7406",type:"object",additionalProperties:!1,required:["type","box","label"],properties:{type:{const:"action"},box:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}},{description:"\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"swap"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"}}},{description:"\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D",type:"object",additionalProperties:!1,required:["type","field"],anyOf:[{required:["value"]},{required:["tag"]}],properties:{type:{const:"strip"},field:{$ref:"#/definitions/text"},value:{$ref:"#/definitions/text"},tag:{$ref:"#/definitions/text"}}}]},carry:{description:"\u7DDA\u306E\u4E0A\u3092\u8D70\u308B\u7269\u3002\u5C01\u7B52 (\u30E1\u30C3\u30BB\u30FC\u30B8\u3084\u8981\u6C42)\u3001\u672D (\u540D\u524D\u306E\u3042\u308B\u5024)\u3001\u786C\u8CA8 (\u4FA1\u5024)\u3001\u7121\u3057",type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["envelope","tag","coin","none"]},text:{$ref:"#/definitions/text"}},if:{required:["kind"],properties:{kind:{const:"tag"}}},then:{required:["text"]},else:{not:{required:["text"]}}},sequence:{description:"\u6642\u7CFB\u5217\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u751F\u5B58\u7DDA\u3092\u5DE6\u304B\u3089\u4E26\u3079\u308B\u9806",type:"object",additionalProperties:!1,required:["lifelines"],properties:{lifelines:{type:"array",minItems:1,items:{$ref:"#/definitions/id"}}}}}};var gn=Object.prototype.hasOwnProperty,oe=un;var bt={enum:["blue","amber","green","violet","rose","slate","coin"]},xe=new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$","u");function Be(e,{instancePath:n="",parentData:s,parentDataProperty:a,rootData:o=e}={}){let t=null,r=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.id===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};t===null?t=[i]:t.push(i),r++}if(e.name===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};t===null?t=[i]:t.push(i),r++}for(let i in e)if(!(i==="id"||i==="name"||i==="note"||i==="color"||i==="icon")){let l={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),r++}if(e.id!==void 0){let i=e.id;if(typeof i=="string"){if(!xe.test(i)){let l={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.name!==void 0){let i=e.name;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.note!==void 0){let i=e.note;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/note",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.color!==void 0){let i=e.color;if(!(i==="blue"||i==="amber"||i==="green"||i==="violet"||i==="rose"||i==="slate"||i==="coin")){let l={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:bt.enum},message:"must be equal to one of the allowed values"};t===null?t=[l]:t.push(l),r++}}if(e.icon!==void 0){let i=e.icon;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/icon",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/icon",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}}else{let i={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[i]:t.push(i),r++}return Be.errors=t,r===0}function Ie(e,{instancePath:n="",parentData:s,parentDataProperty:a,rootData:o=e}={}){let t=null,r=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.id===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};t===null?t=[i]:t.push(i),r++}if(e.name===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};t===null?t=[i]:t.push(i),r++}for(let i in e)if(!(i==="id"||i==="name"||i==="sub"||i==="color"||i==="icon"||i==="region")){let l={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),r++}if(e.id!==void 0){let i=e.id;if(typeof i=="string"){if(!xe.test(i)){let l={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.name!==void 0){let i=e.name;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.sub!==void 0){let i=e.sub;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/sub",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/sub",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.color!==void 0){let i=e.color;if(!(i==="blue"||i==="amber"||i==="green"||i==="violet"||i==="rose"||i==="slate"||i==="coin")){let l={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:bt.enum},message:"must be equal to one of the allowed values"};t===null?t=[l]:t.push(l),r++}}if(e.icon!==void 0){let i=e.icon;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/icon",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/icon",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.region!==void 0){let i=e.region;if(typeof i=="string"){if(!xe.test(i)){let l={instancePath:n+"/region",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/region",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}}else{let i={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[i]:t.push(i),r++}return Ie.errors=t,r===0}function Ve(e,{instancePath:n="",parentData:s,parentDataProperty:a,rootData:o=e}={}){let t=null,r=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.title===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};t===null?t=[i]:t.push(i),r++}if(e.fields===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"fields"},message:"must have required property 'fields'"};t===null?t=[i]:t.push(i),r++}for(let i in e)if(!(i==="title"||i==="fields")){let l={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),r++}if(e.title!==void 0){let i=e.title;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.fields!==void 0){let i=e.fields;if(Array.isArray(i)){if(i.length<1){let c={instancePath:n+"/fields",schemaPath:"#/properties/fields/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};t===null?t=[c]:t.push(c),r++}let l=i.length;for(let c=0;c<l;c++){let f=i[c];if(typeof f=="string"){if(oe(f)<1){let u={instancePath:n+"/fields/"+c,schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[u]:t.push(u),r++}}else{let u={instancePath:n+"/fields/"+c,schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[u]:t.push(u),r++}}}else{let l={instancePath:n+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[l]:t.push(l),r++}}}else{let i={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[i]:t.push(i),r++}return Ve.errors=t,r===0}var hn={description:"\u6BB5\u306E\u4E2D\u3067\u8D77\u304D\u308B\u3053\u3068\u3002\u8D77\u304D\u308B\u9806\u306B\u4E26\u3079\u308B",type:"object",required:["type"],discriminator:{propertyName:"type"},oneOf:[{description:"\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B",type:"object",additionalProperties:!1,required:["type","from","to","carry"],properties:{type:{const:"edge"},from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"},carry:{$ref:"#/definitions/carry"},labelSide:{description:"\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)",enum:["above","below","left","right"]}}},{description:"\u7BB1\u306E\u4E2D\u306E\u51E6\u7406",type:"object",additionalProperties:!1,required:["type","box","label"],properties:{type:{const:"action"},box:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}},{description:"\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"swap"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"}}},{description:"\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D",type:"object",additionalProperties:!1,required:["type","field"],anyOf:[{required:["value"]},{required:["tag"]}],properties:{type:{const:"strip"},field:{$ref:"#/definitions/text"},value:{$ref:"#/definitions/text"},tag:{$ref:"#/definitions/text"}}}]},yn={description:"\u7DDA\u306E\u4E0A\u3092\u8D70\u308B\u7269\u3002\u5C01\u7B52 (\u30E1\u30C3\u30BB\u30FC\u30B8\u3084\u8981\u6C42)\u3001\u672D (\u540D\u524D\u306E\u3042\u308B\u5024)\u3001\u786C\u8CA8 (\u4FA1\u5024)\u3001\u7121\u3057",type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["envelope","tag","coin","none"]},text:{$ref:"#/definitions/text"}},if:{required:["kind"],properties:{kind:{const:"tag"}}},then:{required:["text"]},else:{not:{required:["text"]}}};function _e(e,{instancePath:n="",parentData:s,parentDataProperty:a,rootData:o=e}={}){let t=null,r=0,i=r,l=!0,c=r;if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.kind===void 0&&(p="kind")){let d={};t===null?t=[d]:t.push(d),r++}else if(e.kind!==void 0&&e.kind!=="tag"){let d={};t===null?t=[d]:t.push(d),r++}}var f=c===r;r=i,t!==null&&(i?t.length=i:t=null);let u;if(f){let p=r;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.text===void 0){let v={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};t===null?t=[v]:t.push(v),r++}var f=p===r;l=f,u="then"}else{let p=r,d=r,v=r;if(e&&typeof e=="object"&&!Array.isArray(e)){let h;if(e.text===void 0&&(h="text")){let x={};t===null?t=[x]:t.push(x),r++}}var g=v===r;if(g){let h={instancePath:n,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};t===null?t=[h]:t.push(h),r++}else r=d,t!==null&&(d?t.length=d:t=null);var f=p===r;l=f,u="else"}if(!l){let p={instancePath:n,schemaPath:"#/if",keyword:"if",params:{failingKeyword:u},message:'must match "'+u+'" schema'};t===null?t=[p]:t.push(p),r++}if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.kind===void 0){let p={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'"};t===null?t=[p]:t.push(p),r++}for(let p in e)if(!(p==="kind"||p==="text")){let d={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"};t===null?t=[d]:t.push(d),r++}if(e.kind!==void 0){let p=e.kind;if(!(p==="envelope"||p==="tag"||p==="coin"||p==="none")){let d={instancePath:n+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:yn.properties.kind.enum},message:"must be equal to one of the allowed values"};t===null?t=[d]:t.push(d),r++}}if(e.text!==void 0){let p=e.text;if(typeof p=="string"){if(oe(p)<1){let d={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[d]:t.push(d),r++}}else{let d={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[d]:t.push(d),r++}}}else{let p={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[p]:t.push(p),r++}return _e.errors=t,r===0}function We(e,{instancePath:n="",parentData:s,parentDataProperty:a,rootData:o=e}={}){let t=null,r=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let c={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[c]:t.push(c),r++}let l=e.type;if(typeof l=="string")if(l==="edge")if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let c={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[c]:t.push(c),r++}if(e.from===void 0){let c={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};t===null?t=[c]:t.push(c),r++}if(e.to===void 0){let c={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};t===null?t=[c]:t.push(c),r++}if(e.carry===void 0){let c={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"carry"},message:"must have required property 'carry'"};t===null?t=[c]:t.push(c),r++}for(let c in e)if(!(c==="type"||c==="from"||c==="to"||c==="label"||c==="carry"||c==="labelSide")){let f={instancePath:n,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:c},message:"must NOT have additional properties"};t===null?t=[f]:t.push(f),r++}if(e.type!==void 0&&e.type!=="edge"){let c={instancePath:n+"/type",schemaPath:"#/oneOf/0/properties/type/const",keyword:"const",params:{allowedValue:"edge"},message:"must be equal to constant"};t===null?t=[c]:t.push(c),r++}if(e.from!==void 0){let c=e.from;if(typeof c=="string"){if(!xe.test(c)){let f={instancePath:n+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[f]:t.push(f),r++}}else{let f={instancePath:n+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),r++}}if(e.to!==void 0){let c=e.to;if(typeof c=="string"){if(!xe.test(c)){let f={instancePath:n+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[f]:t.push(f),r++}}else{let f={instancePath:n+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),r++}}if(e.label!==void 0){let c=e.label;if(typeof c=="string"){if(oe(c)<1){let f={instancePath:n+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[f]:t.push(f),r++}}else{let f={instancePath:n+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),r++}}if(e.carry!==void 0&&(_e(e.carry,{instancePath:n+"/carry",parentData:e,parentDataProperty:"carry",rootData:o})||(t=t===null?_e.errors:t.concat(_e.errors),r=t.length)),e.labelSide!==void 0){let c=e.labelSide;if(!(c==="above"||c==="below"||c==="left"||c==="right")){let f={instancePath:n+"/labelSide",schemaPath:"#/oneOf/0/properties/labelSide/enum",keyword:"enum",params:{allowedValues:hn.oneOf[0].properties.labelSide.enum},message:"must be equal to one of the allowed values"};t===null?t=[f]:t.push(f),r++}}}else{let c={instancePath:n,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[c]:t.push(c),r++}else if(l==="action")if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let c={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[c]:t.push(c),r++}if(e.box===void 0){let c={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};t===null?t=[c]:t.push(c),r++}if(e.label===void 0){let c={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"label"},message:"must have required property 'label'"};t===null?t=[c]:t.push(c),r++}for(let c in e)if(!(c==="type"||c==="box"||c==="label")){let f={instancePath:n,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:c},message:"must NOT have additional properties"};t===null?t=[f]:t.push(f),r++}if(e.type!==void 0&&e.type!=="action"){let c={instancePath:n+"/type",schemaPath:"#/oneOf/1/properties/type/const",keyword:"const",params:{allowedValue:"action"},message:"must be equal to constant"};t===null?t=[c]:t.push(c),r++}if(e.box!==void 0){let c=e.box;if(typeof c=="string"){if(!xe.test(c)){let f={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[f]:t.push(f),r++}}else{let f={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),r++}}if(e.label!==void 0){let c=e.label;if(typeof c=="string"){if(oe(c)<1){let f={instancePath:n+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[f]:t.push(f),r++}}else{let f={instancePath:n+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),r++}}}else{let c={instancePath:n,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[c]:t.push(c),r++}else if(l==="swap")if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let c={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[c]:t.push(c),r++}if(e.box===void 0){let c={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};t===null?t=[c]:t.push(c),r++}if(e.text===void 0){let c={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};t===null?t=[c]:t.push(c),r++}for(let c in e)if(!(c==="type"||c==="box"||c==="text")){let f={instancePath:n,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:c},message:"must NOT have additional properties"};t===null?t=[f]:t.push(f),r++}if(e.type!==void 0&&e.type!=="swap"){let c={instancePath:n+"/type",schemaPath:"#/oneOf/2/properties/type/const",keyword:"const",params:{allowedValue:"swap"},message:"must be equal to constant"};t===null?t=[c]:t.push(c),r++}if(e.box!==void 0){let c=e.box;if(typeof c=="string"){if(!xe.test(c)){let f={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[f]:t.push(f),r++}}else{let f={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),r++}}if(e.text!==void 0){let c=e.text;if(typeof c=="string"){if(oe(c)<1){let f={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[f]:t.push(f),r++}}else{let f={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[f]:t.push(f),r++}}}else{let c={instancePath:n,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[c]:t.push(c),r++}else if(l==="strip"){let c=r,f=!1,u=r;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.value===void 0){let g={instancePath:n,schemaPath:"#/oneOf/3/anyOf/0/required",keyword:"required",params:{missingProperty:"value"},message:"must have required property 'value'"};t===null?t=[g]:t.push(g),r++}var i=u===r;if(f=f||i,!f){let g=r;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.tag===void 0){let d={instancePath:n,schemaPath:"#/oneOf/3/anyOf/1/required",keyword:"required",params:{missingProperty:"tag"},message:"must have required property 'tag'"};t===null?t=[d]:t.push(d),r++}var i=g===r;f=f||i}if(f)r=c,t!==null&&(c?t.length=c:t=null);else{let g={instancePath:n,schemaPath:"#/oneOf/3/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};t===null?t=[g]:t.push(g),r++}if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.type===void 0){let g={instancePath:n,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};t===null?t=[g]:t.push(g),r++}if(e.field===void 0){let g={instancePath:n,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"field"},message:"must have required property 'field'"};t===null?t=[g]:t.push(g),r++}for(let g in e)if(!(g==="type"||g==="field"||g==="value"||g==="tag")){let p={instancePath:n,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"};t===null?t=[p]:t.push(p),r++}if(e.type!==void 0&&e.type!=="strip"){let g={instancePath:n+"/type",schemaPath:"#/oneOf/3/properties/type/const",keyword:"const",params:{allowedValue:"strip"},message:"must be equal to constant"};t===null?t=[g]:t.push(g),r++}if(e.field!==void 0){let g=e.field;if(typeof g=="string"){if(oe(g)<1){let p={instancePath:n+"/field",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[p]:t.push(p),r++}}else{let p={instancePath:n+"/field",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[p]:t.push(p),r++}}if(e.value!==void 0){let g=e.value;if(typeof g=="string"){if(oe(g)<1){let p={instancePath:n+"/value",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[p]:t.push(p),r++}}else{let p={instancePath:n+"/value",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[p]:t.push(p),r++}}if(e.tag!==void 0){let g=e.tag;if(typeof g=="string"){if(oe(g)<1){let p={instancePath:n+"/tag",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[p]:t.push(p),r++}}else{let p={instancePath:n+"/tag",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[p]:t.push(p),r++}}}else{let g={instancePath:n,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[g]:t.push(g),r++}}else{let c={instancePath:n,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"mapping",tag:"type",tagValue:l},message:'value of tag "type" must be in oneOf'};t===null?t=[c]:t.push(c),r++}else{let c={instancePath:n,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"tag",tag:"type",tagValue:l},message:'tag "type" must be string'};t===null?t=[c]:t.push(c),r++}}else{let l={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[l]:t.push(l),r++}return We.errors=t,r===0}function Ge(e,{instancePath:n="",parentData:s,parentDataProperty:a,rootData:o=e}={}){let t=null,r=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.title===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};t===null?t=[i]:t.push(i),r++}if(e.body===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"body"},message:"must have required property 'body'"};t===null?t=[i]:t.push(i),r++}if(e.events===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"events"},message:"must have required property 'events'"};t===null?t=[i]:t.push(i),r++}for(let i in e)if(!(i==="title"||i==="body"||i==="code"||i==="events")){let l={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),r++}if(e.title!==void 0){let i=e.title;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.body!==void 0){let i=e.body;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/body",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/body",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.code!==void 0){let i=e.code;if(typeof i=="string"){if(oe(i)<1){let l={instancePath:n+"/code",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[l]:t.push(l),r++}}else{let l={instancePath:n+"/code",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[l]:t.push(l),r++}}if(e.events!==void 0){let i=e.events;if(Array.isArray(i)){let l=i.length;for(let c=0;c<l;c++)We(i[c],{instancePath:n+"/events/"+c,parentData:i,parentDataProperty:c,rootData:o})||(t=t===null?We.errors:t.concat(We.errors),r=t.length)}else{let l={instancePath:n+"/events",schemaPath:"#/properties/events/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[l]:t.push(l),r++}}}else{let i={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[i]:t.push(i),r++}return Ge.errors=t,r===0}function Ye(e,{instancePath:n="",parentData:s,parentDataProperty:a,rootData:o=e}={}){let t=null,r=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.lifelines===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"lifelines"},message:"must have required property 'lifelines'"};t===null?t=[i]:t.push(i),r++}for(let i in e)if(i!=="lifelines"){let l={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};t===null?t=[l]:t.push(l),r++}if(e.lifelines!==void 0){let i=e.lifelines;if(Array.isArray(i)){if(i.length<1){let c={instancePath:n+"/lifelines",schemaPath:"#/properties/lifelines/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};t===null?t=[c]:t.push(c),r++}let l=i.length;for(let c=0;c<l;c++){let f=i[c];if(typeof f=="string"){if(!xe.test(f)){let u={instancePath:n+"/lifelines/"+c,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};t===null?t=[u]:t.push(u),r++}}else{let u={instancePath:n+"/lifelines/"+c,schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[u]:t.push(u),r++}}}else{let l={instancePath:n+"/lifelines",schemaPath:"#/properties/lifelines/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[l]:t.push(l),r++}}}else{let i={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[i]:t.push(i),r++}return Ye.errors=t,r===0}function xt(e,{instancePath:n="",parentData:s,parentDataProperty:a,rootData:o=e}={}){let t=null,r=0,i=r,l=!0,c=r;if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.kind===void 0&&(p="kind")){let d={};t===null?t=[d]:t.push(d),r++}else if(e.kind!==void 0&&e.kind!=="sequence"){let d={};t===null?t=[d]:t.push(d),r++}}var f=c===r;r=i,t!==null&&(i?t.length=i:t=null);let u;if(f){let p=r;if(e&&typeof e=="object"&&!Array.isArray(e)&&e.sequence===void 0){let v={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"sequence"},message:"must have required property 'sequence'"};t===null?t=[v]:t.push(v),r++}var f=p===r;l=f,u="then"}else{let p=r,d=r,v=r;if(e&&typeof e=="object"&&!Array.isArray(e)){let h;if(e.sequence===void 0&&(h="sequence")){let x={};t===null?t=[x]:t.push(x),r++}}var g=v===r;if(g){let h={instancePath:n,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};t===null?t=[h]:t.push(h),r++}else r=d,t!==null&&(d?t.length=d:t=null);var f=p===r;l=f,u="else"}if(!l){let p={instancePath:n,schemaPath:"#/if",keyword:"if",params:{failingKeyword:u},message:'must match "'+u+'" schema'};t===null?t=[p]:t.push(p),r++}if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.version===void 0){let p={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"version"},message:"must have required property 'version'"};t===null?t=[p]:t.push(p),r++}if(e.kind===void 0){let p={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'"};t===null?t=[p]:t.push(p),r++}if(e.title===void 0){let p={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};t===null?t=[p]:t.push(p),r++}if(e.boxes===void 0){let p={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"boxes"},message:"must have required property 'boxes'"};t===null?t=[p]:t.push(p),r++}if(e.steps===void 0){let p={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"steps"},message:"must have required property 'steps'"};t===null?t=[p]:t.push(p),r++}for(let p in e)if(!gn.call(tt.properties,p)){let d={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"};t===null?t=[d]:t.push(d),r++}if(e.version!==void 0){let p=e.version;if(!(typeof p=="number"&&!(p%1)&&!isNaN(p)&&isFinite(p))){let d={instancePath:n+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"integer"},message:"must be integer"};t===null?t=[d]:t.push(d),r++}if(typeof p=="number"&&isFinite(p)&&(p<1||isNaN(p))){let d={instancePath:n+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};t===null?t=[d]:t.push(d),r++}}if(e.kind!==void 0){let p=e.kind;if(!(p==="sequence"||p==="architecture")){let d={instancePath:n+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:tt.properties.kind.enum},message:"must be equal to one of the allowed values"};t===null?t=[d]:t.push(d),r++}}if(e.title!==void 0){let p=e.title;if(typeof p=="string"){if(oe(p)<1){let d={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};t===null?t=[d]:t.push(d),r++}}else{let d={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};t===null?t=[d]:t.push(d),r++}}if(e.view!==void 0){let p=e.view;if(!(p==="fixed"||p==="follow")){let d={instancePath:n+"/view",schemaPath:"#/properties/view/enum",keyword:"enum",params:{allowedValues:tt.properties.view.enum},message:"must be equal to one of the allowed values"};t===null?t=[d]:t.push(d),r++}}if(e.regions!==void 0){let p=e.regions;if(Array.isArray(p)){let d=p.length;for(let v=0;v<d;v++)Be(p[v],{instancePath:n+"/regions/"+v,parentData:p,parentDataProperty:v,rootData:o})||(t=t===null?Be.errors:t.concat(Be.errors),r=t.length)}else{let d={instancePath:n+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[d]:t.push(d),r++}}if(e.boxes!==void 0){let p=e.boxes;if(Array.isArray(p)){if(p.length<1){let v={instancePath:n+"/boxes",schemaPath:"#/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};t===null?t=[v]:t.push(v),r++}let d=p.length;for(let v=0;v<d;v++)Ie(p[v],{instancePath:n+"/boxes/"+v,parentData:p,parentDataProperty:v,rootData:o})||(t=t===null?Ie.errors:t.concat(Ie.errors),r=t.length)}else{let d={instancePath:n+"/boxes",schemaPath:"#/properties/boxes/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[d]:t.push(d),r++}}if(e.strip!==void 0&&(Ve(e.strip,{instancePath:n+"/strip",parentData:e,parentDataProperty:"strip",rootData:o})||(t=t===null?Ve.errors:t.concat(Ve.errors),r=t.length)),e.steps!==void 0){let p=e.steps;if(Array.isArray(p)){if(p.length<1){let v={instancePath:n+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};t===null?t=[v]:t.push(v),r++}let d=p.length;for(let v=0;v<d;v++)Ge(p[v],{instancePath:n+"/steps/"+v,parentData:p,parentDataProperty:v,rootData:o})||(t=t===null?Ge.errors:t.concat(Ge.errors),r=t.length)}else{let d={instancePath:n+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"};t===null?t=[d]:t.push(d),r++}}e.sequence!==void 0&&(Ye(e.sequence,{instancePath:n+"/sequence",parentData:e,parentDataProperty:"sequence",rootData:o})||(t=t===null?Ye.errors:t.concat(Ye.errors),r=t.length))}else{let p={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};t===null?t=[p]:t.push(p),r++}return xt.errors=t,r===0}var bn=["edge","action","swap","strip"],xn={"":{field:"sequence",kind:"sequence"},carry:{field:"text",kind:"tag"}},rt=e=>e.replaceAll("~","~0").replaceAll("/","~1");function vn(e){let n=/^\^\[\^(.+)\]\+\$$/u.exec(e)?.[1];if(n===void 0)return;let s=n.match(/\\.|[^\\]/gu)??[];return{space:s.includes("\\s"),chars:s.filter(a=>a!=="\\s").map(a=>a.replace(/^\\/u,""))}}var vt=(e,n)=>n.filter(s=>s!==e&&s.schemaPath.startsWith(`${e.schemaPath}/`)&&(s.instancePath===e.instancePath||s.instancePath.startsWith(`${e.instancePath}/`)));function wn(e,n,s){let a=e.params,o=e.instancePath;switch(e.keyword){case"additionalProperties":{let t=String(a.additionalProperty);return{pointer:`${o}/${rt(t)}`,message:s.additionalProperties(t)}}case"required":{let t=String(a.missingProperty);return{pointer:`${o}/${rt(t)}`,message:s.required(t)}}case"not":{let t=xn[o.slice(o.lastIndexOf("/")+1)];return{pointer:t?`${o}/${t.field}`:o,message:s.not(t)}}case"anyOf":{let t=vt(e,n),r=t.every(i=>i.keyword==="required")?t.map(i=>String(i.params.missingProperty)):[];return{pointer:o,message:s.anyOf(r)}}case"discriminator":{let t=String(a.tag);return{pointer:`${o}/${rt(t)}`,message:s.discriminator(t,bn)}}case"enum":return{pointer:o,message:s.enum(a.allowedValues.map(String))};case"type":return{pointer:o,message:s.type(String(a.type))};case"minLength":return{pointer:o,message:s.minLength(Number(a.limit))};case"pattern":return{pointer:o,message:s.pattern(vn(String(a.pattern)))};case"minItems":return{pointer:o,message:s.minItems(Number(a.limit))};case"minimum":return{pointer:o,message:s.minimum(Number(a.limit))};case"const":return{pointer:o,message:s.const(String(a.allowedValue))};case"oneOf":return{pointer:o,message:s.oneOf};default:return{pointer:o,message:e.message??e.keyword}}}function wt(e,n={}){if(nt(e))return{ok:!0};let s=nt.errors??[],a=new Set(s.filter(r=>r.keyword==="anyOf").flatMap(r=>vt(r,s))),o=Fe[n.lang??"ja"];return{ok:!1,errors:s.filter(r=>r.keyword!=="if"&&!a.has(r)).map(r=>wn(r,s,o))}}var $t=1;function $n(e){if(typeof e!="object"||e===null)return;let n=e.version;return typeof n=="number"&&n>$t?n:void 0}var kn=(e,n)=>({pointer:"/version",message:Fe[n].newer(e,$t)});function kt(e,n={}){let s=$n(e);if(s!==void 0)return{ok:!1,errors:[kn(s,n.lang??"ja")]};let a=wt(e,n);return a.ok?{ok:!0,diagram:e,warnings:[]}:a}function Pn(e){let n={edges:[],events:[],busy:0},s=Y.edgeAt,a,o=0;return e.events.forEach((t,r)=>{if(t.type==="edge"){let i=t.carry.kind!=="none",l=s,c=l+(i?Y.drawCarry:Y.draw);n.edges.push({event:r,a:l,b:c,carries:i,coin:t.carry.kind==="coin",named:t.label!==void 0}),s=l+Y.stagger,a=c,o=0,n.busy=Math.max(n.busy,c)}else if(t.type==="action")n.events.push({event:r,at:s}),n.busy=Math.max(n.busy,s+Y.action),s+=Y.action,o=0;else{let i=(a??s)+Y.change*o++;n.events.push({event:r,at:i}),n.busy=Math.max(n.busy,i)}}),n}function Pt(e){let n=e.steps.map(Pn),s=[],a=Y.intro;e.steps.forEach((d,v)=>{let E=Math.min(Y.stepMax,Math.max(Y.stepMin,Y.stepBase+[...d.body].length*Y.perChar)),h=Math.max(E,(n[v]?.busy??0)+Y.dwell);s.push({start:a,end:a+h}),a+=h});let t=Math.ceil(a+Y.outro),r=t-Y.tail,i=[],l=[],c=[],f=[];n.forEach((d,v)=>{let E=s[v],h=[];for(let x of d.edges){let w=E.start+x.a;i.push({step:v,event:x.event,start:w,drawn:E.start+x.b,end:E.end}),x.carries&&f.push({step:v,event:x.event,who:x.coin?"coin":"main",a:w,b:E.start+x.b}),x.named&&h.push({step:v,event:x.event,start:w+Y.labelDelay,end:E.end})}h.forEach((x,w)=>{let T=h[w+2];T&&(x.end=Math.min(x.end,T.start))}),l.push(...h);for(let x of d.events)c.push({step:v,event:x.event,at:E.start+x.at})});let u=s[0]?.start??0,g=f.some(d=>d.who==="main"),p=[];for(let d of["main","coin"]){let v=f.filter(E=>E.who===d);v.forEach((E,h)=>{let x=v[h+1],w=h===0&&(d==="main"||!g);p.push({step:E.step,event:E.event,who:d,depart:E.a,arrive:E.b,start:w?Math.min(u,E.a):E.a,end:x?Math.max(x.a,E.b):r})})}return p.sort((d,v)=>d.depart-v.depart),{total:t,last:r,steps:s,edges:i,carriers:p,labels:l,badges:s.map((d,v)=>({step:v,appears:d.start})),events:c,stills:s.map(d=>d.end-Y.still)}}var He={app:"M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2 h22",router:"M -9 -4 h16 M 3 -8 l4 4 l-4 4 M 9 5 h-16 M -3 1 l-4 4 l4 4",on:"M -7 7 L 7 -7 M -1 -7 h8 v8",off:"M -7 -7 L 7 7 M 7 -1 v8 h-8",pool:"M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",db:"M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",exe:"M -5 -8 L 7 0 L -5 8 Z",idx:"M -9 -7 h18 M -9 -2 h18 M -9 3 h18 M -9 8 h11",sign:"M -9 4 c 3 -9 5 -9 6 0 s 3 7 6 -2 s 3 -6 6 0",env:"M -8 -5.5 h16 v11 h-16 z M -8 -5.5 l8 6 l8 -6",lock:"M -5.5 -1 h11 v8 h-11 z M -3.5 -1 v-3 a3.5 3.5 0 0 1 7 0 v3",check:"M -5 0 l3.5 3.5 l6.5 -7",x:"M -5 -5 l10 10 M 5 -5 l-10 10",chain:"M -1.5 4.5 l-2 2 a3.5 3.5 0 0 1 -5 -5 l3 -3 a3.5 3.5 0 0 1 5 0 M 1.5 -4.5 l2 -2 a3.5 3.5 0 0 1 5 5 l-3 3 a3.5 3.5 0 0 1 -5 0 M -2.5 2.5 l5 -5",net:"M -1.3 -4.6 L -5.8 3 M 1.3 -4.6 L 5.8 3 M -4.3 5.5 H 4.3 M -2.2 -7 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M -9.2 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M 4.8 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0",user:"M -4 -4.5 a4 4 0 1 0 8 0 a4 4 0 1 0 -8 0 M -8 9 c0 -5 3.6 -7.5 8 -7.5 s8 2.5 8 7.5",server:"M -9 -8 h18 v7 h-18 z M -9 1 h18 v7 h-18 z M -5 -4.5 h0.01 M -5 4.5 h0.01",key:"M -9 0 a3.5 3.5 0 1 0 7 0 a3.5 3.5 0 1 0 -7 0 M -2 0 h10 M 5 0 v3.5 M 8 0 v2.5",shield:"M 0 -9 l8 3 v5 c0 5 -3.5 8 -8 10 c-4.5 -2 -8 -5 -8 -10 v-5 z",globe:"M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M -9 0 h18 M 0 -9 c-4.5 4 -4.5 14 0 18 M 0 -9 c4.5 4 4.5 14 0 18",bolt:"M 2 -9 L -5 1 h5 l-2 8 l7 -10 h-5 z",doc:"M -6 -9 h8 l5 5 v13 h-13 z M 2 -9 v5 h5 M -3 1 h7 M -3 5 h5",box:"M -9 -4.5 l9 -4.5 l9 4.5 v9 l-9 4.5 l-9 -4.5 z M -9 -4.5 l9 4.5 l9 -4.5 M 0 0 v9",truck:"M -10 -6 h11 v10 h-11 z M 1 -2 h5 l3.5 3.5 v2.5 h-8.5 M -7.5 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0 M 3 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0",card:"M -9 -6.5 h18 a2 2 0 0 1 2 2 v9 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-9 a2 2 0 0 1 2 -2 z M -11 -2 h22 M -7 3 h5",cart:"M -10 -8 h3 l3 11 h11 l2.5 -8 h-15.5 M -4.5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0 M 5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0",clock:"M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M 0 -5 v5 l3.5 2.5",branch:"M -4 -4.5 v9 M 5 0.5 c0 4 -9 3 -9 6.5 M -6.2 -7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M -6.2 7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M 2.8 -2 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0",cloud:"M -7 6 h13 a4.5 4.5 0 0 0 0.5 -9 a6 6 0 0 0 -11.5 -1 a4.5 4.5 0 0 0 -2 10 z",refresh:"M 7 -3 a7.5 7.5 0 1 0 0.5 5 M 7.5 -8 v5 h-5",layers:"M 0 -8 l9 4.5 l-9 4.5 l-9 -4.5 z M -9 2.5 l9 4.5 l9 -4.5",code:"M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",paint:"M -8 8 c 0 -3 2 -5 4.5 -5 l 9 -9 l 3.5 3.5 l -9 9 c 0 2.5 -2 4.5 -5 4.5 z",block:"M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2.5 h22 M -6 2.5 h8"};var fe=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),$=e=>Math.round(e*100)/100,ue=e=>e==="coin"?"--c:var(--coin);--ct:var(--coint)":`--c:var(--c-${e});--ct:var(--t-${e})`;function st(e,n,s,a,o="dg-gl"){let t=e===void 0?void 0:He[e];return t?`<path class="${o}" transform="translate(${$(n)} ${$(s)}) scale(${a})" d="${t}"/>`:""}var Mn=e=>e.map(([n,s],a)=>`${a===0?"M":"L"} ${$(n)} ${$(s)}`).join(" ");function Sn(e){let[n,s]=e[e.length-1],[a,o]=e[e.length-2],t=Math.hypot(n-a,s-o)||1,r=(n-a)/t,i=(s-o)/t,{arrow:l,arrowHalf:c}=b.edge;return`M ${$(n-r*l-i*c)} ${$(s-i*l+r*c)} L ${$(n)} ${$(s)} L ${$(n-r*l+i*c)} ${$(s-i*l-r*c)}`}function On(e,n){let s=[[0,{opacity:0}]];for(let[a,o]of n)s.push([a,{opacity:0},Z.out],[a+Y.fade,{opacity:1}],[o-.1,{opacity:1},Z.inOut],[o+.25,{opacity:0}]);return s.push([e.total,{opacity:0}]),e.kf(s)}function Mt(e,n){let s=[];for(let a=0;a<n.length;){let o=a;for(;o+1<n.length&&n[o+1]===n[o]+1;)o++;s.push([e.t.steps[n[a]].start,e.t.steps[n[o]].end]),a=o+1}return On(e.m,s)}function St(e){let{radius:n,icon:s,iconRadius:a,iconScale:o,nameY:t,line:r}=b.region,{x:i,y:l}=e.header,c=e.lines.map((g,p)=>`<text class="dg-bz" x="${$(i)}" y="${$(e.y+t+p*r)}">${fe(g)}</text>`).join(""),f=e.note?`<text class="dg-bx" x="${$(i)}" y="${$(e.y+t+e.lines.length*r+1)}">${fe(e.note)}</text>`:"",u=e.icon&&He[e.icon]?`<rect class="dg-bi" x="${$(i)}" y="${$(l)}" width="${s}" height="${s}" rx="${a}"/>${st(e.icon,i+s/2,l+s/2,o)}`:"";return`<g style="${ue(e.color)}"><rect class="dg-band" x="${$(e.x+.5)}" y="${$(e.y+.5)}" width="${$(e.w-1)}" height="${$(e.h-1)}" rx="${n}"/>${u}${c}${f}</g>`}function Ot(e,n,s,a){let o=[[0,e.sub??"","dg-ss"],...s];return o.map(([t,r,i],l)=>{let c=o[l+1]?.[0],f=l===0?c===void 0?"":n.until(c-Y.untilFade):c===void 0?n.rise(t):n.rise(t,c-Y.untilFade);return r===""?"":`<g${f?` class="dg-a" style="${f}"`:""}><text class="${i}" x="${$(e.cx)}" y="${$(a)}" text-anchor="middle">${fe(r)}</text></g>`}).join("")}function Et(e,n,s,a,o){let t=(r,i="")=>`<rect class="${r}" x="${$(e.x)}" y="${$(a)}" width="${$(e.w)}" height="${o}" rx="${b.box.radius}"${i}/>`;return`${s?`<g class="dg-a" style="${s}">${t("dg-halo")}</g>`:""}${t("dg-st",` ${n.sh}`)}${s?`<g class="dg-a" style="${s}">${t("dg-on")}</g>`:""}`}function qt(e,n,s,a){let{icon:o,iconRadius:t,iconScale:r,iconY:i,nameY:l,subY:c}=b.box,f=Ot(e,n.m,a,e.cy+c),u=s.length>0?Mt(n,s):void 0,g=e.icon&&He[e.icon]?`<rect class="dg-ic" x="${$(e.cx-o/2)}" y="${$(e.cy+i-o/2)}" width="${o}" height="${o}" rx="${t}"/>${st(e.icon,e.cx,e.cy+i,r)}`:"";return`<g style="${ue(e.color)}">${Et(e,n,u,e.y,e.h)}${g}<text class="dg-sn" x="${$(e.cx)}" y="${$(e.cy+l)}" text-anchor="middle">${fe(e.name)}</text>${f}</g>`}function Lt(e,n,s,a){let{pad:o,h:t,nameY:r,subY:i}=b.follow.head,l=Ot(e,n.m,a,o+i),c=s.length>0?Mt(n,s):void 0;return`<g style="${ue(e.color)}">${Et(e,n,c,o,t)}<text class="dg-sn" x="${$(e.cx)}" y="${$(o+r)}" text-anchor="middle">${fe(e.name)}</text>${l}</g>`}function Tt(e,n,s){return`<line class="dg-ll" x1="${$(e)}" y1="${$(n)}" x2="${$(e)}" y2="${$(s)}"/>`}function jt(e,n,s){let{m:a}=s,o=Mn(e.points),t=Sn(e.points),{start:r,drawn:i,end:l}=n,c=[[l,{opacity:1},Z.inOut],[l+.4,{opacity:.45}],[s.end+.3,{opacity:.45},Z.inOut],[s.end+1,{opacity:.95}],[a.last,{opacity:.95},Z.inOut],[a.total,{opacity:0}]],f=a.kf([[0,{opacity:0,"stroke-dashoffset":1}],[r,{opacity:0,"stroke-dashoffset":1},Z.inOut],[r+.05,{opacity:1}],[i,{"stroke-dashoffset":0}],[a.last,{"stroke-dashoffset":0}],[a.total,{"stroke-dashoffset":1}],...c]),u=a.kf([[0,{opacity:0}],[i-.05,{opacity:0}],[i,{opacity:1}],...c]),g=-(l-i)*26,p=a.kf([[0,{opacity:0,"stroke-dashoffset":0}],[i,{opacity:0,"stroke-dashoffset":0}],[i+.25,{opacity:.9}],[l-.1,{opacity:.9},Z.inOut],[l+.2,{opacity:0,"stroke-dashoffset":g}],[a.total,{opacity:0,"stroke-dashoffset":g}]]);return{base:`<path class="dg-e" d="${o}"/><path class="dg-eh" d="${t}"/>`,lit:`<g style="${ue(e.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${o}" style="${f}"/><path class="dg-eh-on dg-a" d="${t}" style="${u}"/><path class="dg-flow dg-a" d="${o}" style="${p}"/></g>`}}function Nt(e,n,s){let a=e.family==="sans"?" dg-capj":"",{radius:o}=b.label;return`<g class="dg-cap${a} dg-a" style="${ue(e.color)};${s.m.rise(n.start,n.end,!0)}"><rect x="${$(e.x)}" y="${$(e.y)}" width="${$(e.w)}" height="${e.h}" rx="${o}"/><text x="${$(e.x+e.w/2)}" y="${$(e.y+e.h/2+b.baseline.label)}" text-anchor="middle">${fe(e.text)}</text></g>`}function At(e,n,s,a){return`<g class="dg-act dg-a" style="${ue(e.color)};${a.m.rise(n,s,!0)}"><rect x="${$(e.x)}" y="${$(e.y)}" width="${$(e.w)}" height="${e.h}" rx="${b.action.radius}"/><text x="${$(e.x+e.w/2)}" y="${$(e.y+e.h/2+b.baseline.action)}" text-anchor="middle">${fe(e.text)}</text></g>`}function En(e,n){let s=b.carrier;if(e.carry.kind==="coin")return`<circle class="dg-coin" r="${s.coinR}"/><circle class="dg-coin-in" r="${s.coinIn}"/>`;if(e.carry.kind==="tag"){let a=e.carry.text,o=be(a),t=z(a,o?L.carrierJa:L.carrier)+s.tagPadX*2;return`<rect class="dg-car" x="${$(-t/2)}" y="${-s.tagH/2}" width="${$(t)}" height="${s.tagH}" rx="${s.tagH/2}" ${n}/><text class="dg-car-t${o?" dg-car-tj":""}" y="${b.baseline.carrier}" text-anchor="middle">${fe(a)}</text>`}return`<rect class="dg-env" x="${-s.envW/2}" y="${-s.envH/2}" width="${s.envW}" height="${s.envH}" rx="3" ${n}/><path class="dg-env-in" d="M -8 -4.5 L 0 1.5 L 8 -4.5"/>`}var qn=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2;function Ct(e,n,s){let{m:a}=s,o=b.carrier.samples,t=et(e.points),{depart:r,arrive:i,start:l,end:c}=n,f=[];for(let E=0;E<=o;E++){let[h,x]=Ze(e.points,qn(E/o)*t);f.push([r+(i-r)*E/o,h,x])}let u=f[0],g=f[f.length-1],p=e.settle??[g[1],g[2]],d=[[0,u[1],u[2]],...f];e.settle&&d.push([Math.min(i+.3,Math.max(c,i+.01)),p[0],p[1]]),d.push([c,p[0],p[1]],[a.total,p[0],p[1]]);let v=c<a.last?.05:.18;return`<g class="dg-a" style="${a.move(d,a.blink(l+.02,c,v))}">${En(e,s.sh)}</g>`}function Rt(e,n){let{m:s}=n,a=n.t.steps[e.step],o=a.start,t=a.end,{r,ring:i}=b.badge,l=s.kf([[0,{opacity:0,transform:"scale(.5)"}],[o,{opacity:0,transform:"scale(.5)"},Z.pop],[o+.35,{opacity:1,transform:"scale(1)"}],[t,{opacity:1,transform:"scale(1)"},Z.inOut],[t+.4,{opacity:0,transform:"scale(1)"}],[s.total,{opacity:0,transform:"scale(.5)"}]]),c=s.kf([[0,{opacity:0}],[t,{opacity:0},Z.inOut],[t+.4,{opacity:1}],[s.last,{opacity:1},Z.inOut],[s.total,{opacity:0}]]),f=s.kf([[0,{opacity:0,transform:"scale(1)"}],[o+.05,{opacity:0,transform:"scale(1)"}],[o+.1,{opacity:.7,transform:"scale(1)"},Z.out],[o+.9,{opacity:0,transform:"scale(2.3)"}],[s.total,{opacity:0,transform:"scale(1)"}]]),u=$(e.x),g=$(e.y),p=$(e.y+b.baseline.badge),d=e.step+1;return`<g class="dg-bd" data-step="${e.step}" style="${ue(e.color)}"><circle class="dg-bdr dg-popc dg-a" cx="${u}" cy="${g}" r="${i}" style="${f}"/><g class="dg-a" style="${c}"><circle class="dg-bdp" cx="${u}" cy="${g}" r="${i}"/><text class="dg-bdpt" x="${u}" y="${p}" text-anchor="middle">${d}</text></g><g class="dg-popc dg-a" style="${l}"><circle class="dg-bdf" cx="${u}" cy="${g}" r="${r}"/><text class="dg-bdft" x="${u}" y="${p}" text-anchor="middle">${d}</text></g></g>`}function Dt(e,n,s){let{m:a,sh:o}=s,t=b.strip,r=e.y+t.h/2,i=[`<rect class="dg-strip" x="${$(e.x+.5)}" y="${$(e.y+.5)}" width="${$(e.w-1)}" height="${$(e.h-1)}" rx="${b.region.radius}" ${o}/>`,`<g style="${ue("slate")}"><rect class="dg-bi" x="${$(e.x+t.pad)}" y="${$(r-t.icon/2)}" width="${t.icon}" height="${t.icon}" rx="${b.box.iconRadius}"/>${st("env",e.x+t.pad+t.icon/2,r,.78)}</g>`,`<text class="dg-sh" x="${$(e.x+t.titleX)}" y="${$(r+b.baseline.stripTitle)}">${fe(e.title)}</text>`];return e.fields.forEach((l,c)=>{let f=e.fields[c-1];if(f&&f.y===l.y){let d=l.x-t.fieldGap/2;i.push(`<line class="dg-sep" x1="${$(d)}" y1="${$(l.y+t.sepInset)}" x2="${$(d)}" y2="${$(l.y+t.h-t.sepInset)}"/>`)}i.push(`<text class="dg-fl" x="${$(l.x)}" y="${$(l.y+t.nameY)}">${fe(l.name)}</text>`);let u=n.get(l.name)??[],g=u.filter(d=>d.value!==void 0),p=u.filter(d=>d.tag!==void 0);g.forEach((d,v)=>{let E=g[v+1]?.at,h=d.value,x=E===void 0?a.rise(d.at):a.rise(d.at,E-Y.untilFade);i.push(`<g class="dg-a" style="${x}"><text class="${be(h)?"dg-fvj":"dg-fv"}" x="${$(l.x)}" y="${$(l.y+t.valueY)}">${fe(h)}</text></g>`)}),p.forEach((d,v)=>{let E=p[v+1]?.at,h=d.tag,x=[...g].reverse().find(A=>A.at<=d.at+1e-9)?.value,w=l.x+(x?z(x,be(x)?L.fieldValueJa:L.fieldValue)+t.tagGap:0),T=z(h,L.tag)+t.tagPadX*2,k=l.y+t.valueY-t.tagH/2-b.baseline.tag;i.push(`<g class="dg-tg dg-popc dg-a" style="${ue(d.color)};${E===void 0?a.pop(d.at):a.pop(d.at,E-Y.untilFade)}"><rect x="${$(w)}" y="${$(k)}" width="${$(T)}" height="${t.tagH}" rx="${t.tagH/2}"/><text x="${$(w+T/2)}" y="${$(k+t.tagH/2+b.baseline.tag)}" text-anchor="middle">${fe(h)}</text></g>`)})}),i.join("")}var Ft=e=>Math.round(e*100)/100,Ke=class{constructor(n,s,a){this.prefix=n;this.total=s;this.last=a}prefix;total;last;frames=[];count=0;pct(n){return+(Math.min(Math.max(n,0),this.total)/this.total*100).toFixed(3)}kf(n){let s=`${this.prefix}-${this.count++}`,a=new Map;for(let[t,r,i]of[...n].sort((l,c)=>l[0]-c[0])){let l=this.pct(t),c=a.get(l)??{props:{}};Object.assign(c.props,r),i&&(c.ease=i),a.set(l,c)}let o=[...a].map(([t,{props:r,ease:i}])=>{let l=Object.entries(r).map(([c,f])=>`${c}:${f}`);return i&&l.push(`animation-timing-function:${i}`),`${t}%{${l.join(";")}}`}).join("");return this.frames.push(`@keyframes ${s}{${o}}`),`animation-name:${s}`}vis(n,s=this.last,a={}){let o=a.f??Y.fade,t=a.on??{},r=a.off??{},i=a.within?Math.max(n+o,s-o):s;return this.kf([[0,{opacity:0,...r}],[n,{opacity:0,...r},a.ein??Z.out],[n+o,{opacity:1,...t}],[i,{opacity:1,...t},Z.inOut],[Math.min(i+o,this.total),{opacity:0,...r}],[this.total,{opacity:0,...r}]])}rise(n,s=this.last,a=!1){return this.vis(n,s,{on:{transform:"translateY(0)"},off:{transform:`translateY(${b.rise}px)`},within:a})}pop(n,s=this.last){return this.vis(n,s,{f:Y.popFade,ein:Z.pop,on:{transform:"scale(1)"},off:{transform:`scale(${b.popFrom})`}})}until(n){let s=Y.untilFade;return this.kf([[0,{opacity:1}],[n,{opacity:1},Z.inOut],[n+s,{opacity:0}],[this.last,{opacity:0}],[this.total,{opacity:1}]])}move(n,s=[]){return this.kf(n.map(([a,o,t,r=1,i])=>[a,{transform:`translate(${Ft(o)}px,${Ft(t)}px) scale(${r})`},i]).concat(s))}blink(n,s,a){return[[0,{opacity:0}],[n-.01,{opacity:0}],[n,{opacity:1}],[s,{opacity:1}],[s+a,{opacity:0}],[this.total,{opacity:0}]]}};var ae=e=>`font:${e.weight} ${e.size}px var(--${e.family})`,ye=(e,n="var(--surf)")=>`color-mix(in srgb,var(--c) ${e}%,${n})`,pe=b.stroke,he=b.mix,Ln=[".dg{display:block;width:100%;height:auto;overflow:visible}",".dg .dg-a{animation-duration:var(--T);animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both;animation-delay:calc(var(--at,0) * -1s);animation-play-state:var(--play,running)}",".dg .dg-popc{transform-box:fill-box;transform-origin:center}",".dg-bg{fill:var(--bg)}",".dg-band{fill:color-mix(in srgb,var(--c) var(--tint),var(--bg));stroke:color-mix(in srgb,var(--c) var(--edge),transparent)}",`.dg-bi{fill:${ye(he.regionIcon)};stroke:${ye(he.regionIconEdge,"transparent")}}`,`.dg-bz{${ae(L.regionName)};fill:var(--ct)}`,`.dg-bx{${ae(L.regionNote)};fill:var(--mute)}`,".dg-st{fill:var(--surf);stroke:var(--hair)}",`.dg-halo{fill:none;stroke:var(--c);stroke-width:${pe.halo};stroke-opacity:.16}`,`.dg-on{fill:none;stroke:var(--c);stroke-width:${pe.on}}`,`.dg-ic{fill:${ye(he.icon)}}`,`.dg-gl{fill:none;stroke:var(--c);stroke-width:${pe.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-sn{${ae(L.boxName)};fill:var(--ink)}`,`.dg-ss{${ae(L.boxSub)};fill:var(--mute)}`,`.dg-ss-ok{${ae(L.boxSubStrong)};fill:var(--ct)}`,`.dg-ss-act{${ae(L.boxSubStrong)};fill:var(--ink)}`,`.dg-ll{stroke:var(--line);stroke-width:${pe.lifeline};stroke-dasharray:3 4}`,`.dg-e{fill:none;stroke:var(--line);stroke-width:${pe.edge};stroke-linecap:round;stroke-dasharray:0 ${b.edge.ghostDash}}`,`.dg-eh{fill:none;stroke:var(--line);stroke-width:${pe.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-e-on{fill:none;stroke:var(--c);stroke-width:${pe.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${pe.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,`.dg-flow{fill:none;stroke:var(--surf);stroke-width:${pe.flow};stroke-linecap:round;stroke-dasharray:1.5 ${b.edge.flowDash}}`,".dg-bd{cursor:pointer}",".dg-bdf{fill:var(--c)}",`.dg-bdft{${ae(L.badge)};fill:var(--on-c)}`,`.dg-bdr{fill:none;stroke:var(--c);stroke-width:${pe.badgeRing}}`,`.dg-bdp{fill:${ye(he.badgePast)};stroke:${ye(he.badgePastEdge,"transparent")};stroke-width:${pe.hair}}`,`.dg-bdpt{${ae(L.badge)};fill:var(--ct)}`,`.dg-cap rect,.dg-act rect{fill:${ye(he.cap)};stroke:${ye(he.capEdge,"transparent")}}`,`.dg-cap text{${ae(L.label)};fill:var(--ct)}`,`.dg-capj text{${ae(L.labelJa)}}`,`.dg-act text{${ae(L.action)};fill:var(--ct)}`,".dg-car{fill:var(--carry,var(--ink))}",`.dg-car-t{${ae(L.carrier)};fill:var(--bg)}`,`.dg-car-tj{${ae(L.carrierJa)}}`,`.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${pe.envelope}}`,`.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${pe.flow};stroke-linejoin:round;stroke-linecap:round}`,".dg-coin{fill:var(--coin);stroke:var(--surf);stroke-width:1.2}",".dg-coin-in{fill:none;stroke:var(--coinin);stroke-width:1.1}",".dg-strip{fill:var(--surf);stroke:var(--hair)}",`.dg-sep{stroke:var(--hair);stroke-width:${pe.hair}}`,`.dg-sh{${ae(L.stripTitle)};fill:var(--ink)}`,`.dg-fl{${ae(L.fieldName)};fill:var(--mute)}`,`.dg-fv{${ae(L.fieldValue)};fill:var(--ink)}`,`.dg-fvj{${ae(L.fieldValueJa)};fill:var(--ink)}`,".dg-tg rect{fill:var(--c)}",`.dg-tg text{${ae(L.tag)};fill:var(--on-c)}`,".dg-vp-bg{fill:var(--bg)}",".dg-vp-frame{fill:none;stroke:var(--hair)}",".dg-hd-bg{fill:var(--bg)}",".dg-mm-bg{fill:var(--surf);stroke:var(--hair)}",`.dg-mm-t{${ae(L.miniTitle)};fill:var(--mute)}`,".dg-mm-world{fill:var(--sunk);stroke:var(--hair)}",`.dg-mm-band{fill:${ye(he.miniBand)};stroke:${ye(he.miniBandEdge,"transparent")};stroke-width:.6}`,`.dg-mm-card{fill:${ye(he.mini)}}`,`.dg-mm-vp{fill:color-mix(in srgb,var(--ink) ${he.view}%,transparent);stroke:var(--ink);stroke-width:${pe.badgeRing};vector-effect:non-scaling-stroke}`].join("");function Tn(e){let n=2166136261;for(let s=0;s<e.length;s++)n^=e.charCodeAt(s),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function jn(e){let n=new Map,s=(a,o)=>{n.set(a,(n.get(a)??new Set).add(o))};return e.steps.forEach((a,o)=>{for(let t of a.events)t.type==="edge"?(s(t.from,o),s(t.to,o)):(t.type==="action"||t.type==="swap")&&s(t.box,o)}),new Map([...n].map(([a,o])=>[a,[...o].sort((t,r)=>t-r)]))}function Nn(e,n,s){let a=[],o=0;for(let r of n.events){let i=e.steps[r.step]?.events[r.event];i?.type==="swap"&&a.push({t:r.at,order:o++,box:i.box,set:i.text}),s&&i?.type==="action"&&(a.push({t:r.at,order:o++,box:i.box,act:i.label}),a.push({t:n.steps[r.step].end,order:o++,box:i.box,act:null}))}a.sort((r,i)=>r.t-i.t||r.order-i.order);let t=new Map;for(let r of e.boxes){let i=[r.sub??"","dg-ss"],l,c=i.join("|"),f=[];for(let g of a.filter(p=>p.box===r.id)){g.set!==void 0&&(i=[g.set,"dg-ss-ok"],l=void 0),g.act!==void 0&&(l=g.act??void 0);let p=l!==void 0?[l,"dg-ss-act"]:i;p.join("|")!==c&&(c=p.join("|"),f.push([g.t,p[0],p[1]]))}let u=f.filter((g,p)=>{let d=f[p+1];return d===void 0||d[0]-g[0]>=Y.minShow});t.set(r.id,u)}return t}function An(e,n,s){let a=new Map;for(let o of n.events){let t=e.steps[o.step]?.events[o.event];if(t?.type!=="strip")continue;let r=s.badges[o.step]?.color??"slate",i=a.get(t.field)??[];i.push({at:o.at,color:r,...t.value!==void 0?{value:t.value}:{},...t.tag!==void 0?{tag:t.tag}:{}}),a.set(t.field,i)}return a}function it(e,n,s,a,o,t){let r=Tn(`${JSON.stringify(e)}|${a.id}|${o}|${t?`${t.width}|${t.lang}`:""}`),i=new Ke(`dg${r}`,s.total,s.last),l={m:i,t:s,sh:`filter="url(#dg-sh-${r})"`,end:s.steps[s.steps.length-1].end},c=jn(e),f=Nn(e,s,n.kind==="architecture"),u={band:[],base:[],lit:[],node:[],badge:[],top:[]};for(let k of n.regions)u.band.push(St(k));n.strip&&u.band.push(Dt(n.strip,An(e,s,n),l));for(let k of n.lifelines)u.base.push(Tt(k.x,k.y1,k.y2));for(let k of n.edges){let A=s.edges.find(H=>H.step===k.step&&H.event===k.event);if(!A)continue;let F=jt(k,A,l);u.base.push(F.base),u.lit.push(F.lit)}for(let k of n.boxes)u.node.push(qt(k,l,c.get(k.id)??[],f.get(k.id)??[]));for(let k of n.badges)u.badge.push(Rt(k,l));for(let k of n.labels){let A=s.labels.find(F=>F.step===k.step&&F.event===k.event);A&&u.top.push(Nt(k,A,l))}for(let k of n.actions){let A=s.events.find(F=>F.step===k.step&&F.event===k.event);A&&u.top.push(At(k,A.at,s.steps[k.step].end,l))}for(let k of s.carriers){let A=n.edges.find(F=>F.step===k.step&&F.event===k.event);A&&u.top.push(Ct(A,k,l))}let g=Object.values(u).map(k=>k.join("")).join(""),{near:p,far:d,nearY:v,farY:E}=b.shadow,h=`<filter id="dg-sh-${r}" x="-20%" y="-30%" width="140%" height="180%"><feDropShadow dx="0" dy="${v}" stdDeviation="${p}" style="flood-color:var(--sh);flood-opacity:var(--shA)"/><feDropShadow dx="0" dy="${E}" stdDeviation="${d}" style="flood-color:var(--sh);flood-opacity:var(--shB)"/></filter>`,x=t&&n.kind==="sequence"?n.boxes.map(k=>Lt(k,l,c.get(k.id)??[],f.get(k.id)??[])).join(""):"",w=t?Dn(n,s,e,i,r,g,t,x):{body:`<rect class="dg-bg" width="${n.width}" height="${n.height}" rx="${b.region.radius}"/>${g}`,w:n.width,h:n.height},T=`.dg-${r}{${Ee};--T:${s.total}s;${Oe(a,o)}}${Ln}${i.frames.join("")}`;return`<svg xmlns="http://www.w3.org/2000/svg" class="dg dg-${r}" viewBox="0 0 ${Math.ceil(w.w)} ${Math.ceil(w.h)}" width="${Math.ceil(w.w)}" height="${Math.ceil(w.h)}" role="img" aria-label="${fe(e.title)}" data-dragon="figure" data-view="${t?"follow":"fixed"}"><style>${T}</style><defs>${h}</defs>${w.body}</svg>`}function Bt(e){let n=Math.min(...e.map(a=>a.x)),s=Math.min(...e.map(a=>a.y));return{x:n,y:s,w:Math.max(...e.map(a=>a.x+a.w))-n,h:Math.max(...e.map(a=>a.y+a.h))-s}}function Cn(e,n,s){let a=It(e,n,s);return a.length===0?void 0:Bt(a)}function Rn(e,n,s,a){let o=b.badge.r+b.follow.badgeRoom,{x:t,y:r}=e,i=c=>Math.hypot(Math.max(0,c.x-t,t-c.x-c.w),Math.max(0,c.y-r,r-c.y-c.h)),l={x:t-o,y:r-o,w:o*2,h:o*2};for(let c of[...n].sort((f,u)=>i(f)-i(u))){let f=Bt([l,c]);f.w<=s&&f.h<=a&&(l=f)}return l}function It(e,n,s){let a=[];for(let o of e.edges.filter(t=>t.step===s)){let t=o.points.map(i=>i[0]),r=o.points.map(i=>i[1]);a.push({x:Math.min(...t),y:Math.min(...r),w:Math.max(...t)-Math.min(...t),h:Math.max(...r)-Math.min(...r)})}a.push(...e.labels.filter(o=>o.step===s),...e.actions.filter(o=>o.step===s));for(let o of n.steps[s]?.events??[]){let t=o.type==="edge"?[o.from,o.to]:o.type==="action"||o.type==="swap"?[o.box]:[];for(let r of t){let i=e.boxes.find(l=>l.id===r);i&&(e.kind==="architecture"||o.type==="swap")&&a.push(i)}}return a}function Dn(e,n,s,a,o,t,r,i){let l=b.follow,c=b.mini,f=Math.max(1,r.width),u=Math.min(e.width,f),g=we[r.lang].overview,p=I=>{let V=Math.min(c.w,u*.4,I*.4/e.height*e.width),C=V/e.width,G=e.height*C,U=Math.max(V,Math.ceil(z(g,L.miniTitle)));return{vh:I,mw:V,k:C,mh:G,bw:U,bgW:U+c.pad*2,bgH:G+c.pad*2+c.title,beside:G>V}},d=p(Math.min(e.height,Math.max(l.minH,u*l.aspect))),v=d.beside&&f<l.narrow,E=r.height===void 0?Number.POSITIVE_INFINITY:d.beside?r.height:r.height-d.bgH-c.inset,{vh:h,mw:x,k:w,mh:T,bw:k,bgW:A,bgH:F,beside:H}=E<d.vh?p(Math.max(l.fitMinH,E)):{...d,vh:Number.isFinite(E)?Math.min(e.height,E):d.vh},_=H&&!v?Math.min(e.width,f-A-c.inset):u,me=I=>Math.min(e.width-_/2,Math.max(_/2,I)),ge=i===""?0:Math.max(...e.boxes.map(I=>I.y+I.h))+l.headRoom,re=i===""?0:l.head.pad*2+l.head.h,te=h-re,de=I=>Math.min(e.height-te/2,Math.max(ge+te/2,I)),M=b.badge.r,q=[e.width/2,e.height/2],D=n.steps.map((I,V)=>{let C=Cn(e,s,V);q=C?[C.x+C.w/2,C.y+C.h/2]:q;let G=[me(q[0]),de(q[1])],U=e.badges.find(N=>N.step===V);if(!U||Math.abs(U.x-G[0])<=_/2-M&&Math.abs(U.y-G[1])<=te/2-M)return G;let j=Rn(U,It(e,s,V),_,te);return q=[j.x+j.w/2,j.y+j.h/2],[me(q[0]),de(q[1])]}).map(([I,V])=>[I,V-re/2]),B=D[0],R=[[0,B[0],B[1]],[n.steps[0].start,B[0],B[1]]];D.forEach((I,V)=>{if(V===0)return;let C=D[V-1],G=n.steps[V].start;R.push([G,C[0],C[1],1,Z.inOut],[G+l.ease,I[0],I[1]])});let K=D[D.length-1];R.push([n.last,K[0],K[1],1,Z.inOut],[n.total,B[0],B[1]]);let se=a.move(R.map(([I,V,C,G,U])=>[I,_/2-V,h/2-C,G,U])),m=H?_+c.inset:_-A-c.inset,S=H?0:h+c.inset,y=m+c.pad,P=y+(k-x)/2,W=S+c.pad+c.title,X=v?{clip:"",body:""}:(()=>{let I=[...e.regions.map(C=>`<rect class="dg-mm-band" style="${ue(C.color)}" x="${P+C.x*w}" y="${W+C.y*w}" width="${C.w*w}" height="${C.h*w}" rx="3"/>`),...e.boxes.map(C=>`<rect class="dg-mm-card" style="${ue(C.color)}" x="${P+C.x*w}" y="${W+C.y*w}" width="${C.w*w}" height="${C.h*w}" rx="1.5"/>`)].join(""),V=a.move(R.map(([C,G,U,,j])=>[C,P+(G-_/2)*w,W+(U-h/2)*w,1,j]));return{clip:`<clipPath id="dg-mm-${o}"><rect x="${P}" y="${W}" width="${x}" height="${T}" rx="4"/></clipPath>`,body:`<rect class="dg-mm-bg" x="${m}" y="${S}" width="${A}" height="${F}" rx="${c.radius}"/><text class="dg-mm-t" x="${y}" y="${W-c.pad+2}">${g}</text><g clip-path="url(#dg-mm-${o})"><rect class="dg-mm-world" x="${P}" y="${W}" width="${x}" height="${T}"/>${I}<rect class="dg-mm-vp dg-a"${re===0?"":` y="${re*w}"`} width="${_*w}" height="${(h-re)*w}" rx="2" style="${V}"/></g>`}})(),le=re===0?"":`<g class="dg-hd"><rect class="dg-hd-bg" width="${_}" height="${re}"/><line class="dg-sep" x1="0" y1="${re}" x2="${_}" y2="${re}"/><g class="dg-a" style="${a.move(R.map(([I,V,,C,G])=>[I,_/2-V,0,C,G]))}">${i}</g></g>`;return{body:`<defs><clipPath id="dg-vp-${o}"><rect width="${_}" height="${h}" rx="${b.region.radius}"/></clipPath>${X.clip}</defs><g clip-path="url(#dg-vp-${o})"><rect class="dg-vp-bg" width="${_}" height="${h}"/><g class="dg-a" style="${se}">${t}</g>${le}</g><rect class="dg-vp-frame" x="0.5" y="0.5" width="${_-1}" height="${h-1}" rx="${b.region.radius}"/>${X.body}`,w:H&&!v?_+c.inset+A:u,h:H?h:S+F}}function Vt(e,n={}){let s=n.lang??"ja",a=kt(e,{lang:s});if(!a.ok)throw new Error(we[s].cannotDraw(a.errors.map(c=>`${c.pointer} ${c.message}`).join(" / ")));let o=a.diagram,t=Se(n.palette),r=n.theme==="dark"?"dark":"light",i=o.kind==="sequence"?ht(o):ut(o),l=Pt(o);return{svg:it(o,i,l,t,r),palette:t.id,theme:r,...o.view?{view:o.view}:{},fonts:{...$e},layout:i,timeline:l,diagram:o}}function ot(e,n,s){let a=Math.max(0,n)/e.layout.width,t=(s===void 0?a:Math.min(a,Math.max(0,s)/e.layout.height))*L.boxName.size;return e.view?{mode:e.view,textPx:t}:{mode:t>=pt?"fixed":"follow",textPx:t}}var ze=e=>`font:${e.weight} ${e.size}px var(--${e.family})`,ee=e=>`${e}px`;function Fn(){let e=b.player,n=ee(e.hidden);return[`.dg-player{display:flex;flex-direction:column;gap:${ee(e.gap)};color:var(--ink)}`,`.dg-player .dg-frame{border-radius:${ee(e.radius)};overflow:hidden}`,".dg-bar{container:dg-bar/inline-size}",`.dg-row{display:flex;align-items:flex-start;gap:${ee(e.gap)}}`,`.dg-btns{display:flex;gap:${ee(e.gap/2)};flex:none}`,`.dg-btn{width:${ee(e.button)};height:${ee(e.button)};border-radius:${ee(e.radius)};border:${ee(b.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${ze(L.button)};cursor:pointer}`,`.dg-btn:focus-visible{outline:${ee(e.focus)} solid var(--c-blue);outline-offset:${ee(e.focus)}}`,`.dg-say{display:flex;gap:${ee(e.gap)};min-width:0}`,`.dg-no{${ze(L.stepNo)};color:var(--mute);padding-top:${ee(e.focus)}}`,".dg-txt{display:grid;grid-template-columns:minmax(0,1fr);min-width:0}",".dg-txt>*{grid-area:1/1}",".dg-room{visibility:hidden}",`.dg-tt{${ze(L.stepTitle)};margin:0}`,`.dg-tb{${ze(L.stepBody)};color:var(--ink2);margin:0;white-space:pre-line}`,`.dg-sr{position:absolute;width:${n};height:${n};margin:-${n};padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`,`@container dg-bar (width < ${ee(e.narrow)}){.dg-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:0 ${ee(e.gap)}}.dg-say,.dg-txt,.dg-txt>*{display:contents}.dg-btns{grid-area:1/1;margin-bottom:${ee(e.gap/2)}}.dg-btn{width:${ee(e.touch)};height:${ee(e.touch)}}.dg-no{grid-area:1/2;display:flex;align-items:center;min-height:${ee(e.touch)};padding-top:0}.dg-tt{grid-area:2/1/3/3}.dg-tb{grid-area:3/1/4/3}}`,`@media (pointer: coarse){.dg-btn{width:${ee(e.touch)};height:${ee(e.touch)}}}`].join("")}function Bn(e){if(e.getElementById("dragon-player-css"))return;let n=e.createElement("style");n.id="dragon-player-css",n.textContent=Fn(),e.head.appendChild(n)}var Pe={prev:"\u2039",pause:"\u275A\u275A",play:"\u25B6",next:"\u203A"},_t=e=>String(e).padStart(2,"0"),In=(e,n)=>`${_t(e+1)}/${_t(n)}`;function Wt(e,n,s={}){let a=e.ownerDocument,o=a.defaultView,t=!!o?.matchMedia?.("(prefers-reduced-motion: reduce)").matches,r=Vt(n,s),i=s.lang??"ja",l=we[i],c=Se(r.palette),{timeline:f}=r,u=r.diagram.steps,g=u.length;Bn(a);let p=a.createElement("div");p.className="dg-player",p.dataset.dragon="player",p.setAttribute("style",`${Ee};${Oe(c,r.theme)}`);let d=a.createElement("div");d.className="dg-frame";let v=(j,N,ie)=>{let ce=a.createElement("button");return ce.type="button",ce.className="dg-btn",ce.dataset.dragon=j,ce.setAttribute("aria-label",N),ce.textContent=ie,ce},E=v("prev",l.prev,Pe.prev),h=v("toggle",l.pause,Pe.pause),x=v("next",l.next,Pe.next),w=a.createElement("div");w.className="dg-btns",w.setAttribute("lang",i),w.append(E,h,x);let T=a.createElement("div");T.className="dg-say",T.setAttribute("aria-hidden","true");let k=a.createElement("div");k.className="dg-no",k.dataset.dragon="step-no";let A=a.createElement("div");A.className="dg-txt";let F=a.createElement("p");F.className="dg-tt",F.dataset.dragon="step-title";let H=a.createElement("p");H.className="dg-tb",H.dataset.dragon="step-body";let _=a.createElement("div");_.append(F,H),A.append(_);for(let j of u){let N=a.createElement("div");N.className="dg-room",N.dataset.dragon="caption-room";let ie=a.createElement("p");ie.className="dg-tt",ie.textContent=j.title;let ce=a.createElement("p");ce.className="dg-tb",ce.textContent=j.body,N.append(ie,ce),A.append(N)}T.append(k,A);for(let j of[k,F,H])j.setAttribute("aria-hidden","true");let me=a.createElement("div");me.className="dg-row",me.append(w,T);let ge=a.createElement("div");ge.className="dg-bar",ge.append(me);let re=a.createElement("ol");re.className="dg-sr",re.dataset.dragon="steps",re.setAttribute("aria-label",l.steps(r.diagram.title));for(let j of u){let N=a.createElement("li"),ie=a.createElement("strong");ie.textContent=j.title,N.append(ie);for(let ce of j.body.split(`
2
+ `)){let at=a.createElement("p");at.textContent=ce,N.append(at)}re.append(N)}p.append(d,ge,re),e.append(p);let te=()=>d.clientWidth||e.clientWidth||r.layout.width,de=()=>{if(!s.fitHeight||!o)return;let j=o.getComputedStyle(d),N=d.clientHeight-(Number.parseFloat(j.paddingTop)||0)-(Number.parseFloat(j.paddingBottom)||0);return N>0?N:void 0},M=ot(r,te(),de()).mode,q=te(),O=de(),D=null,B=0,R=!t,K=t?f.stills[0]??0:0,se=Date.now(),m=j=>{let N;if(j!==void 0){let ie=a.createElement("div");ie.innerHTML=j,N=ie.querySelector("svg")}else N=D?D.cloneNode(!0):null;N&&(N.setAttribute("aria-hidden","true"),N.removeAttribute("role"),N.removeAttribute("aria-label"),N.style.setProperty("--at",String(K)),N.style.setProperty("--play",R?"running":"paused"),N.dataset.motion=R?"play":"still",D?D.replaceWith(N):d.append(N),D=N,se=Date.now())},S=()=>M==="follow"?it(r.diagram,r.layout,f,c,r.theme,{width:q,...O===void 0?{}:{height:O},lang:i}):r.svg,y=()=>R?(K+(Date.now()-se)/1e3)%f.total:K,P=j=>{let N=0;return f.steps.forEach((ie,ce)=>{ie.start<=j&&(N=ce)}),N},W=()=>{let j=u[B];k.textContent=In(B,g),F.textContent=j?.title??"",H.textContent=j?.body??"",h.setAttribute("aria-label",R?l.pause:l.play),h.textContent=R?Pe.pause:Pe.play,s.onStep?.(B)},J=(j,N)=>{K=j,R=N,m(),W()},X=j=>{B=Math.min(g-1,Math.max(0,j));let N=f.steps[B];J(R?N.start:f.stills[B]??N.start,R)};m(S()),W();let le=o?.setInterval(()=>{if(!R)return;let j=P(y());j!==B&&(B=j,W())},120),ne=()=>X(B-1),I=()=>X(B+1),V=()=>R?J(y(),!1):J(K,!0),C=j=>{let N=j.target?.closest?.("[data-step]"),ie=N?Number(N.getAttribute("data-step")):Number.NaN;Number.isInteger(ie)&&X(ie)};E.addEventListener("click",ne),x.addEventListener("click",I),h.addEventListener("click",V),d.addEventListener("click",C);let G=o?.ResizeObserver,U=G?new G(()=>{let j=te(),N=de(),ie=ot(r,j,N).mode;if(ie===M&&(M==="fixed"||j===q&&N===O))return;let ce=y();M=ie,q=j,O=N,K=ce,m(S())}):void 0;return U?.observe(d),{get step(){return B},get playing(){return R},next:I,prev:ne,play:()=>{R||J(K,!0)},pause:()=>{R&&J(y(),!1)},destroy:()=>{le!==void 0&&o?.clearInterval(le),U?.disconnect(),E.removeEventListener("click",ne),x.removeEventListener("click",I),h.removeEventListener("click",V),d.removeEventListener("click",C),p.remove()}}}return Xt(Vn);})();