@nowline/embed 0.0.0-dev.20261016123749.g5260133 → 0.0.0-dev.20261016125632.gcdc768a

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,4 +1,4 @@
1
- /*! @nowline/embed 0.0.0-dev.20261016123749.g5260133 sha=5260133 built=2026-10-16T12:32:36Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261016125632.gcdc768a sha=cdc768a built=2026-10-16T12:51:05Z */
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -40567,8 +40567,8 @@ function effectiveTheme(theme, systemTheme) {
40567
40567
  }
40568
40568
 
40569
40569
  // src/index.ts
40570
- var version = true ? "0.0.0-dev.20261016123749.g5260133" : "0.0.0";
40571
- var sha = true ? "5260133" : "unknown";
40570
+ var version = true ? "0.0.0-dev.20261016125632.gcdc768a" : "0.0.0";
40571
+ var sha = true ? "cdc768a" : "unknown";
40572
40572
  var DEFAULT_SELECTOR = "pre code.language-nowline, code.language-nowline";
40573
40573
  var initialConfig = {
40574
40574
  theme: "auto",
@@ -1,4 +1,4 @@
1
- /*! @nowline/embed 0.0.0-dev.20261016123749.g5260133 sha=5260133 built=2026-10-16T12:32:36Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261016125632.gcdc768a sha=cdc768a built=2026-10-16T12:51:05Z */
2
2
  "use strict";var nowline=(()=>{var yN=Object.create;var Ws=Object.defineProperty;var xN=Object.getOwnPropertyDescriptor;var EN=Object.getOwnPropertyNames;var wN=Object.getPrototypeOf,TN=Object.prototype.hasOwnProperty;var vN=(e,t,n)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _N=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Us=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},bp=(e,t)=>{for(var n in t)Ws(e,n,{get:t[n],enumerable:!0})},Jx=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of EN(t))!TN.call(e,i)&&i!==n&&Ws(e,i,{get:()=>t[i],enumerable:!(r=xN(t,i))||r.enumerable});return e};var Sp=(e,t,n)=>(n=e!=null?yN(wN(e)):{},Jx(t||!e||!e.__esModule?Ws(n,"default",{value:e,enumerable:!0}):n,e)),kN=e=>Jx(Ws({},"__esModule",{value:!0}),e);var B=(e,t,n)=>vN(e,typeof t!="symbol"?t+"":t,n);var tm=Us(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var Jh;function Qh(){if(Jh===void 0)throw new Error("No runtime abstraction layer installed");return Jh}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Jh=n}e.install=t})(Qh||(Qh={}));em.default=Qh});var nm=Us(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.boolean=RD;Pn.string=T_;Pn.number=bD;Pn.error=SD;Pn.func=ND;Pn.array=v_;Pn.stringArray=PD;function RD(e){return e===!0||e===!1}function T_(e){return typeof e=="string"||e instanceof String}function bD(e){return typeof e=="number"||e instanceof Number}function SD(e){return e instanceof Error}function ND(e){return typeof e=="function"}function v_(e){return Array.isArray(e)}function PD(e){return v_(e)&&e.every(t=>T_(t))}});var om=Us(_r=>{"use strict";var LD=_r&&_r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_r,"__esModule",{value:!0});_r.Emitter=_r.Event=void 0;var $D=LD(tm()),__;(function(e){let t={dispose(){}};e.None=function(){return t}})(__||(_r.Event=__={}));var rm=class{constructor(){B(this,"_callbacks");B(this,"_contexts")}add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,$D.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Pu=class Pu{constructor(t){B(this,"_options");B(this,"_event");B(this,"_callbacks");this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new rm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=Pu._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};B(Pu,"_noop",function(){});var im=Pu;_r.Emitter=im});var k_=Us(Tt=>{"use strict";var OD=Tt&&Tt.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),CD=Tt&&Tt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),DD=Tt&&Tt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&OD(n,t,r[i]);return CD(n,t),n}})(),MD=Tt&&Tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.CancellationTokenSource=Tt.CancellationToken=void 0;var FD=MD(tm()),BD=DD(nm()),sm=om(),Lu;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:sm.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:sm.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||BD.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(Lu||(Tt.CancellationToken=Lu={}));var WD=Object.freeze(function(e,t){let n=(0,FD.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),$u=class{constructor(){B(this,"_isCancelled",!1);B(this,"_emitter")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?WD:(this._emitter||(this._emitter=new sm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},am=class{constructor(){B(this,"_token")}get token(){return this._token||(this._token=new $u),this._token}cancel(){this._token?this._token.cancel():this._token=Lu.Cancelled}dispose(){this._token?this._token instanceof $u&&this._token.dispose():this._token=Lu.None}};Tt.CancellationTokenSource=am});var I_=Us(ne=>{"use strict";var UD=ne&&ne.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),XD=ne&&ne.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),GD=ne&&ne.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&UD(n,t,r[i]);return XD(n,t),n}})();Object.defineProperty(ne,"__esModule",{value:!0});ne.Message=ne.NotificationType9=ne.NotificationType8=ne.NotificationType7=ne.NotificationType6=ne.NotificationType5=ne.NotificationType4=ne.NotificationType3=ne.NotificationType2=ne.NotificationType1=ne.NotificationType0=ne.NotificationType=ne.RequestType9=ne.RequestType8=ne.RequestType7=ne.RequestType6=ne.RequestType5=ne.RequestType4=ne.RequestType3=ne.RequestType2=ne.RequestType1=ne.RequestType=ne.RequestType0=ne.AbstractMessageSignature=ne.ParameterStructures=ne.ResponseError=ne.ErrorCodes=void 0;var pi=GD(nm()),lm;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(lm||(ne.ErrorCodes=lm={}));var cm=class e extends Error{constructor(n,r,i){super(r);B(this,"code");B(this,"data");this.code=pi.number(n)?n:lm.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,e.prototype)}toJson(){let n={code:this.code,message:this.message};return this.data!==void 0&&(n.data=this.data),n}};ne.ResponseError=cm;var Yt=class Yt{constructor(t){B(this,"kind");this.kind=t}static is(t){return t===Yt.auto||t===Yt.byName||t===Yt.byPosition}toString(){return this.kind}};B(Yt,"auto",new Yt("auto")),B(Yt,"byPosition",new Yt("byPosition")),B(Yt,"byName",new Yt("byName"));var kr=Yt;ne.ParameterStructures=kr;var $e=class{constructor(t,n){B(this,"method");B(this,"numberOfParams");this.method=t,this.numberOfParams=n}get parameterStructures(){return kr.auto}};ne.AbstractMessageSignature=$e;var um=class extends $e{constructor(n){super(n,0);B(this,"_")}};ne.RequestType0=um;var fm=class extends $e{constructor(n,r=kr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ne.RequestType=fm;var dm=class extends $e{constructor(n,r=kr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ne.RequestType1=dm;var pm=class extends $e{constructor(n){super(n,2);B(this,"_")}};ne.RequestType2=pm;var hm=class extends $e{constructor(n){super(n,3);B(this,"_")}};ne.RequestType3=hm;var mm=class extends $e{constructor(n){super(n,4);B(this,"_")}};ne.RequestType4=mm;var gm=class extends $e{constructor(n){super(n,5);B(this,"_")}};ne.RequestType5=gm;var ym=class extends $e{constructor(n){super(n,6);B(this,"_")}};ne.RequestType6=ym;var xm=class extends $e{constructor(n){super(n,7);B(this,"_")}};ne.RequestType7=xm;var Em=class extends $e{constructor(n){super(n,8);B(this,"_")}};ne.RequestType8=Em;var wm=class extends $e{constructor(n){super(n,9);B(this,"_")}};ne.RequestType9=wm;var Tm=class extends $e{constructor(n,r=kr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ne.NotificationType=Tm;var vm=class extends $e{constructor(n){super(n,0);B(this,"_")}};ne.NotificationType0=vm;var _m=class extends $e{constructor(n,r=kr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ne.NotificationType1=_m;var km=class extends $e{constructor(n){super(n,2);B(this,"_")}};ne.NotificationType2=km;var Am=class extends $e{constructor(n){super(n,3);B(this,"_")}};ne.NotificationType3=Am;var Im=class extends $e{constructor(n){super(n,4);B(this,"_")}};ne.NotificationType4=Im;var Rm=class extends $e{constructor(n){super(n,5);B(this,"_")}};ne.NotificationType5=Rm;var bm=class extends $e{constructor(n){super(n,6);B(this,"_")}};ne.NotificationType6=bm;var Sm=class extends $e{constructor(n){super(n,7);B(this,"_")}};ne.NotificationType7=Sm;var Nm=class extends $e{constructor(n){super(n,8);B(this,"_")}};ne.NotificationType8=Nm;var Pm=class extends $e{constructor(n){super(n,9);B(this,"_")}};ne.NotificationType9=Pm;var A_;(function(e){function t(i){let o=i;return o&&pi.string(o.method)&&(pi.string(o.id)||pi.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&pi.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(pi.string(o.id)||pi.number(o.id)||o.id===null)}e.isResponse=r})(A_||(ne.Message=A_={}))});var jA={};bp(jA,{nodeReadFile:()=>AF});async function AF(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var YA=_N(()=>{});var VU={};bp(VU,{EmbedRenderError:()=>Ul,__resetForTests:()=>YU,init:()=>Vx,initialize:()=>GU,parse:()=>HU,render:()=>zU,run:()=>jU,sha:()=>UU,version:()=>WU});function Xe(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}function it(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}function Lt(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function Qx(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}function Gi(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}var Xi=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(t){let n=this.types[t.container.$type];if(!n)throw new Error(`Type ${t.container.$type||"undefined"} not found.`);let r=n.properties[t.property]?.referenceType;if(!r)throw new Error(`Property ${t.property||"undefined"} of type ${t.container.$type} is not a reference.`);return r}getTypeMetaData(t){let n=this.types[t];return n||{name:t,properties:{},superTypes:[]}}isInstance(t,n){return Xe(t)&&this.isSubtype(t.$type,n)}isSubtype(t,n){if(t===n)return!0;let r=this.subtypes[t];r||(r=this.subtypes[t]={});let i=r[n];if(i!==void 0)return i;{let o=this.types[t],s=o?o.superTypes.some(a=>this.isSubtype(a,n)):!1;return r[n]=s,s}}getAllSubTypes(t){let n=this.allSubtypes[t];if(n)return n;{let r=this.getAllTypes(),i=[];for(let o of r)this.isSubtype(o,t)&&i.push(o);return this.allSubtypes[t]=i,i}}isComplete(t){let n=this.getTypeMetaData(t.$type);for(let r of Object.keys(n.properties)){let i=n.properties[r];if(i.optional)continue;let o=t[i.name];if(o==null)return!1}return!0}};function er(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}function jl(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function Yl(e){return er(e)&&typeof e.fullText=="string"}var Ut=class e{constructor(t,n){this.startFn=t,this.nextFn=n}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let t=this.iterator(),n=0,r=t.next();for(;!r.done;)n++,r=t.next();return n}toArray(){let t=[],n=this.iterator(),r;do r=n.next(),r.value!==void 0&&t.push(r.value);while(!r.done);return t}toSet(){return new Set(this)}toMap(t,n){let r=this.map(i=>[t?t(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(t){return new e(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return yt})}join(t=","){let n=this.iterator(),r="",i,o=!1;do i=n.next(),i.done||(o&&(r+=t),r+=IN(i.value)),o=!0;while(!i.done);return r}indexOf(t,n=0){let r=this.iterator(),i=0,o=r.next();for(;!o.done;){if(i>=n&&o.value===t)return i;o=r.next(),i++}return-1}every(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(!t(r.value))return!1;r=n.next()}return!0}some(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(t(r.value))return!0;r=n.next()}return!1}forEach(t){let n=this.iterator(),r=0,i=n.next();for(;!i.done;)t(i.value,r),i=n.next(),r++}map(t){return new e(this.startFn,n=>{let{done:r,value:i}=this.nextFn(n);return r?yt:{done:!1,value:t(i)}})}filter(t){return new e(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&t(r.value))return r;while(!r.done);return yt})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,n){let r=this.iterator(),i=n,o=r.next();for(;!o.done;)i===void 0?i=o.value:i=t(i,o.value),o=r.next();return i}reduceRight(t,n){return this.recursiveReduce(this.iterator(),t,n)}recursiveReduce(t,n,r){let i=t.next();if(i.done)return r;let o=this.recursiveReduce(t,n,r);return o===void 0?i.value:n(o,i.value)}find(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(t(r.value))return r.value;r=n.next()}}findIndex(t){let n=this.iterator(),r=0,i=n.next();for(;!i.done;){if(t(i.value))return r;i=n.next(),r++}return-1}includes(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(r.value===t)return!0;r=n.next()}return!1}flatMap(t){return new e(()=>({this:this.startFn()}),n=>{do{if(n.iterator){let o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}let{done:r,value:i}=this.nextFn(n.this);if(!r){let o=t(i);if(Vl(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(n.iterator);return yt})}flat(t){if(t===void 0&&(t=1),t<=0)return this;let n=t>1?this.flat(t-1):this;return new e(()=>({this:n.startFn()}),r=>{do{if(r.iterator){let s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}let{done:i,value:o}=n.nextFn(r.this);if(!i)if(Vl(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(r.iterator);return yt})}head(){let n=this.iterator().next();if(!n.done)return n.value}tail(t=1){return new e(()=>{let n=this.startFn();for(let r=0;r<t;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(t){return new e(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>t?yt:this.nextFn(n.state)))}distinct(t){return new e(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){let i=t?t(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return yt})}exclude(t,n){let r=new Set;for(let i of t){let o=n?n(i):i;r.add(o)}return this.filter(i=>{let o=n?n(i):i;return!r.has(o)})}};function IN(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function Vl(e){return!!e&&typeof e[Symbol.iterator]=="function"}var ql=new Ut(()=>{},()=>yt),yt=Object.freeze({done:!0,value:void 0});function ye(...e){if(e.length===1){let t=e[0];if(t instanceof Ut)return t;if(Vl(t))return new Ut(()=>t[Symbol.iterator](),n=>n.next());if(typeof t.length=="number")return new Ut(()=>({index:0}),n=>n.index<t.length?{done:!1,value:t[n.index++]}:yt)}return e.length>1?new Ut(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){let n=t.iterator.next();if(!n.done)return n;t.iterator=void 0}if(t.array){if(t.arrIndex<t.array.length)return{done:!1,value:t.array[t.arrIndex++]};t.array=void 0,t.arrIndex=0}if(t.collIndex<e.length){let n=e[t.collIndex++];Vl(n)?t.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(t.array=n)}}while(t.iterator||t.array||t.collIndex<e.length);return yt}):ql}var tr=class extends Ut{constructor(t,n,r){super(()=>({iterators:r?.includeRoot?[[t][Symbol.iterator]()]:[n(t)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(n(s.value)[Symbol.iterator]()),s}return yt})}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),prune:()=>{t.state.pruned=!0},[Symbol.iterator]:()=>t};return t}},Kl;(function(e){function t(o){return o.reduce((s,a)=>s+a,0)}e.sum=t;function n(o){return o.reduce((s,a)=>s*a,0)}e.product=n;function r(o){return o.reduce((s,a)=>Math.min(s,a))}e.min=r;function i(o){return o.reduce((s,a)=>Math.max(s,a))}e.max=i})(Kl||(Kl={}));function Zl(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,o)=>{Xe(i)&&(i.$container=e,i.$containerProperty=n,i.$containerIndex=o,t.deep&&Zl(i,t))}):Xe(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&Zl(r,t)))}function zi(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function at(e){let n=Xs(e).$document;if(!n)throw new Error("AST node has no document.");return n}function Xs(e){for(;e.$container;)e=e.$container;return e}function Pp(e){return it(e)?e.ref?[e.ref]:[]:Lt(e)?e.items.map(t=>t.ref):[]}function Jl(e,t){if(!e)throw new Error("Node must be an AstNode.");let n=t?.range;return new Ut(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){let i=r.keys[r.keyIndex];if(!i.startsWith("$")){let o=e[i];if(Xe(o)){if(r.keyIndex++,Np(o,n))return{done:!1,value:o}}else if(Array.isArray(o)){for(;r.arrayIndex<o.length;){let s=r.arrayIndex++,a=o[s];if(Xe(a)&&Np(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return yt})}function nn(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new tr(e,n=>Jl(n,t))}function xt(e,t){if(e){if(t?.range&&!Np(e,t.range))return new tr(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new tr(e,n=>Jl(n,t),{includeRoot:!0})}function Np(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?nE(n,t):!1}function Gr(e){return new Ut(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex<t.keys.length;){let n=t.keys[t.keyIndex];if(!n.startsWith("$")){let r=e[n];if(it(r)||Lt(r))return t.keyIndex++,{done:!1,value:{reference:r,container:e,property:n}};if(Array.isArray(r)){for(;t.arrayIndex<r.length;){let i=t.arrayIndex++,o=r[i];if(it(o)||Lt(o))return{done:!1,value:{reference:o,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return yt})}function eE(e,t){let n=e.getTypeMetaData(t.$type),r=t;for(let i of Object.values(n.properties))i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=tE(i.defaultValue))}function tE(e){return Array.isArray(e)?[...e.map(tE)]:e}var It={$type:"AbstractElement",cardinality:"cardinality"};function cc(e){return he.isInstance(e,It.$type)}var nc={$type:"AbstractParserRule"};function rr(e){return he.isInstance(e,nc.$type)}var Ql={$type:"AbstractRule"};var Xt={$type:"AbstractType"};var Hr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function ir(e){return he.isInstance(e,Hr.$type)}var rc={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Up(e){return he.isInstance(e,rc.$type)}var rE={$type:"ArrayLiteral",elements:"elements"};var $p={$type:"ArrayType",elementType:"elementType"};function lE(e){return he.isInstance(e,$p.$type)}var jr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function on(e){return he.isInstance(e,jr.$type)}var Op={$type:"BooleanLiteral",true:"true"};function cE(e){return he.isInstance(e,Op.$type)}var Yr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function uE(e){return he.isInstance(e,Yr.$type)}var Hi={$type:"Condition"};var ic={$type:"Conjunction",left:"left",right:"right"};function fE(e){return he.isInstance(e,ic.$type)}var Vr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function sn(e){return he.isInstance(e,Vr.$type)}var oc={$type:"Disjunction",left:"left",right:"right"};function dE(e){return he.isInstance(e,oc.$type)}var Cp={$type:"EndOfFile",cardinality:"cardinality"};function pE(e){return he.isInstance(e,Cp.$type)}var zr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var iE={$type:"GrammarImport",path:"path"};var ji={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Kr(e){return he.isInstance(e,ji.$type)}var Dp={$type:"InferredType",name:"name"};function uc(e){return he.isInstance(e,Dp.$type)}var yn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qr(e){return he.isInstance(e,yn.$type)}var Lp={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var oE={$type:"InfixRuleOperators",precedences:"precedences"};var js={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function hE(e){return he.isInstance(e,js.$type)}var Ys={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Gt(e){return he.isInstance(e,Ys.$type)}var ec={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var Yi={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function mE(e){return he.isInstance(e,Yi.$type)}var Mp={$type:"Negation",value:"value"};function gE(e){return he.isInstance(e,Mp.$type)}var sE={$type:"NumberLiteral",value:"value"};var tc={$type:"Parameter",name:"name"};var Fp={$type:"ParameterReference",parameter:"parameter"};function yE(e){return he.isInstance(e,Fp.$type)}var rn={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function lt(e){return he.isInstance(e,rn.$type)}var sc={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function xE(e){return he.isInstance(e,sc.$type)}var Vi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function EE(e){return he.isInstance(e,Vi.$type)}var Bp={$type:"ReturnType",name:"name"};function wE(e){return he.isInstance(e,Bp.$type)}var Ki={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function an(e){return he.isInstance(e,Ki.$type)}var Vs={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Xp(e){return he.isInstance(e,Vs.$type)}var aE={$type:"StringLiteral",value:"value"};var qi={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function TE(e){return he.isInstance(e,qi.$type)}var $t={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Zi={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function vE(e){return he.isInstance(e,Zi.$type)}var nr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Et(e){return he.isInstance(e,nr.$type)}var Ji={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Gp(e){return he.isInstance(e,Ji.$type)}var ac={$type:"Type",name:"name",type:"type"};function zp(e){return he.isInstance(e,ac.$type)}var Gs={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var zs={$type:"TypeDefinition"};var Wp={$type:"UnionType",types:"types"};function _E(e){return he.isInstance(e,Wp.$type)}var lc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Hp(e){return he.isInstance(e,lc.$type)}var Qi={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function kE(e){return he.isInstance(e,Qi.$type)}var Hs={$type:"ValueLiteral"};var Ks={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function AE(e){return he.isInstance(e,Ks.$type)}var qs=class extends Xi{constructor(){super(...arguments),this.types={AbstractElement:{name:It.$type,properties:{cardinality:{name:It.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:nc.$type,properties:{},superTypes:[Ql.$type,Xt.$type]},AbstractRule:{name:Ql.$type,properties:{},superTypes:[]},AbstractType:{name:Xt.$type,properties:{},superTypes:[]},Action:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality,optional:!0},feature:{name:Hr.feature,optional:!0},inferredType:{name:Hr.inferredType,optional:!0},operator:{name:Hr.operator,optional:!0},type:{name:Hr.type,referenceType:Xt.$type,optional:!0}},superTypes:[It.$type]},Alternatives:{name:rc.$type,properties:{cardinality:{name:rc.cardinality,optional:!0},elements:{name:rc.elements,defaultValue:[]}},superTypes:[It.$type]},ArrayLiteral:{name:rE.$type,properties:{elements:{name:rE.elements,defaultValue:[]}},superTypes:[Hs.$type]},ArrayType:{name:$p.$type,properties:{elementType:{name:$p.elementType}},superTypes:[zs.$type]},Assignment:{name:jr.$type,properties:{cardinality:{name:jr.cardinality,optional:!0},feature:{name:jr.feature},operator:{name:jr.operator},predicate:{name:jr.predicate,optional:!0},terminal:{name:jr.terminal}},superTypes:[It.$type]},BooleanLiteral:{name:Op.$type,properties:{true:{name:Op.true,defaultValue:!1}},superTypes:[Hi.$type,Hs.$type]},CharacterRange:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality,optional:!0},left:{name:Yr.left},lookahead:{name:Yr.lookahead,optional:!0},parenthesized:{name:Yr.parenthesized,defaultValue:!1,optional:!0},right:{name:Yr.right,optional:!0}},superTypes:[$t.$type]},Condition:{name:Hi.$type,properties:{},superTypes:[]},Conjunction:{name:ic.$type,properties:{left:{name:ic.left},right:{name:ic.right}},superTypes:[Hi.$type]},CrossReference:{name:Vr.$type,properties:{cardinality:{name:Vr.cardinality,optional:!0},deprecatedSyntax:{name:Vr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Vr.isMulti,defaultValue:!1},terminal:{name:Vr.terminal,optional:!0},type:{name:Vr.type,referenceType:Xt.$type}},superTypes:[It.$type]},Disjunction:{name:oc.$type,properties:{left:{name:oc.left},right:{name:oc.right}},superTypes:[Hi.$type]},EndOfFile:{name:Cp.$type,properties:{cardinality:{name:Cp.cardinality,optional:!0}},superTypes:[It.$type]},Grammar:{name:zr.$type,properties:{imports:{name:zr.imports,defaultValue:[]},interfaces:{name:zr.interfaces,defaultValue:[]},isDeclared:{name:zr.isDeclared,defaultValue:!1},name:{name:zr.name,optional:!0},rules:{name:zr.rules,defaultValue:[]},types:{name:zr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:iE.$type,properties:{path:{name:iE.path}},superTypes:[]},Group:{name:ji.$type,properties:{cardinality:{name:ji.cardinality,optional:!0},elements:{name:ji.elements,defaultValue:[]},guardCondition:{name:ji.guardCondition,optional:!0},predicate:{name:ji.predicate,optional:!0}},superTypes:[It.$type]},InferredType:{name:Dp.$type,properties:{name:{name:Dp.name}},superTypes:[Xt.$type]},InfixRule:{name:yn.$type,properties:{call:{name:yn.call},dataType:{name:yn.dataType,optional:!0},inferredType:{name:yn.inferredType,optional:!0},name:{name:yn.name},operators:{name:yn.operators},parameters:{name:yn.parameters,defaultValue:[]},returnType:{name:yn.returnType,referenceType:Xt.$type,optional:!0}},superTypes:[nc.$type]},InfixRuleOperatorList:{name:Lp.$type,properties:{associativity:{name:Lp.associativity,optional:!0},operators:{name:Lp.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:oE.$type,properties:{precedences:{name:oE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:js.$type,properties:{attributes:{name:js.attributes,defaultValue:[]},name:{name:js.name},superTypes:{name:js.superTypes,defaultValue:[],referenceType:Xt.$type}},superTypes:[Xt.$type]},Keyword:{name:Ys.$type,properties:{cardinality:{name:Ys.cardinality,optional:!0},predicate:{name:Ys.predicate,optional:!0},value:{name:Ys.value}},superTypes:[It.$type]},NamedArgument:{name:ec.$type,properties:{calledByName:{name:ec.calledByName,defaultValue:!1},parameter:{name:ec.parameter,referenceType:tc.$type,optional:!0},value:{name:ec.value}},superTypes:[]},NegatedToken:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality,optional:!0},lookahead:{name:Yi.lookahead,optional:!0},parenthesized:{name:Yi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Yi.terminal}},superTypes:[$t.$type]},Negation:{name:Mp.$type,properties:{value:{name:Mp.value}},superTypes:[Hi.$type]},NumberLiteral:{name:sE.$type,properties:{value:{name:sE.value}},superTypes:[Hs.$type]},Parameter:{name:tc.$type,properties:{name:{name:tc.name}},superTypes:[]},ParameterReference:{name:Fp.$type,properties:{parameter:{name:Fp.parameter,referenceType:tc.$type}},superTypes:[Hi.$type]},ParserRule:{name:rn.$type,properties:{dataType:{name:rn.dataType,optional:!0},definition:{name:rn.definition},entry:{name:rn.entry,defaultValue:!1},fragment:{name:rn.fragment,defaultValue:!1},inferredType:{name:rn.inferredType,optional:!0},name:{name:rn.name},parameters:{name:rn.parameters,defaultValue:[]},returnType:{name:rn.returnType,referenceType:Xt.$type,optional:!0}},superTypes:[nc.$type]},ReferenceType:{name:sc.$type,properties:{isMulti:{name:sc.isMulti,defaultValue:!1},referenceType:{name:sc.referenceType}},superTypes:[zs.$type]},RegexToken:{name:Vi.$type,properties:{cardinality:{name:Vi.cardinality,optional:!0},lookahead:{name:Vi.lookahead,optional:!0},parenthesized:{name:Vi.parenthesized,defaultValue:!1,optional:!0},regex:{name:Vi.regex}},superTypes:[$t.$type]},ReturnType:{name:Bp.$type,properties:{name:{name:Bp.name}},superTypes:[]},RuleCall:{name:Ki.$type,properties:{arguments:{name:Ki.arguments,defaultValue:[]},cardinality:{name:Ki.cardinality,optional:!0},predicate:{name:Ki.predicate,optional:!0},rule:{name:Ki.rule,referenceType:Ql.$type}},superTypes:[It.$type]},SimpleType:{name:Vs.$type,properties:{primitiveType:{name:Vs.primitiveType,optional:!0},stringType:{name:Vs.stringType,optional:!0},typeRef:{name:Vs.typeRef,referenceType:Xt.$type,optional:!0}},superTypes:[zs.$type]},StringLiteral:{name:aE.$type,properties:{value:{name:aE.value}},superTypes:[Hs.$type]},TerminalAlternatives:{name:qi.$type,properties:{cardinality:{name:qi.cardinality,optional:!0},elements:{name:qi.elements,defaultValue:[]},lookahead:{name:qi.lookahead,optional:!0},parenthesized:{name:qi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[$t.$type]},TerminalElement:{name:$t.$type,properties:{cardinality:{name:$t.cardinality,optional:!0},lookahead:{name:$t.lookahead,optional:!0},parenthesized:{name:$t.parenthesized,defaultValue:!1,optional:!0}},superTypes:[It.$type]},TerminalGroup:{name:Zi.$type,properties:{cardinality:{name:Zi.cardinality,optional:!0},elements:{name:Zi.elements,defaultValue:[]},lookahead:{name:Zi.lookahead,optional:!0},parenthesized:{name:Zi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[$t.$type]},TerminalRule:{name:nr.$type,properties:{definition:{name:nr.definition},fragment:{name:nr.fragment,defaultValue:!1},hidden:{name:nr.hidden,defaultValue:!1},name:{name:nr.name},type:{name:nr.type,optional:!0}},superTypes:[Ql.$type]},TerminalRuleCall:{name:Ji.$type,properties:{cardinality:{name:Ji.cardinality,optional:!0},lookahead:{name:Ji.lookahead,optional:!0},parenthesized:{name:Ji.parenthesized,defaultValue:!1,optional:!0},rule:{name:Ji.rule,referenceType:nr.$type}},superTypes:[$t.$type]},Type:{name:ac.$type,properties:{name:{name:ac.name},type:{name:ac.type}},superTypes:[Xt.$type]},TypeAttribute:{name:Gs.$type,properties:{defaultValue:{name:Gs.defaultValue,optional:!0},isOptional:{name:Gs.isOptional,defaultValue:!1},name:{name:Gs.name},type:{name:Gs.type}},superTypes:[]},TypeDefinition:{name:zs.$type,properties:{},superTypes:[]},UnionType:{name:Wp.$type,properties:{types:{name:Wp.types,defaultValue:[]}},superTypes:[zs.$type]},UnorderedGroup:{name:lc.$type,properties:{cardinality:{name:lc.cardinality,optional:!0},elements:{name:lc.elements,defaultValue:[]}},superTypes:[It.$type]},UntilToken:{name:Qi.$type,properties:{cardinality:{name:Qi.cardinality,optional:!0},lookahead:{name:Qi.lookahead,optional:!0},parenthesized:{name:Qi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Qi.terminal}},superTypes:[$t.$type]},ValueLiteral:{name:Hs.$type,properties:{},superTypes:[]},Wildcard:{name:Ks.$type,properties:{cardinality:{name:Ks.cardinality,optional:!0},lookahead:{name:Ks.lookahead,optional:!0},parenthesized:{name:Ks.parenthesized,defaultValue:!1,optional:!0}},superTypes:[$t.$type]}}}},he=new qs;function Zs(e){return new tr(e,t=>er(t)?t.content:[],{includeRoot:!0})}function bE(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function SE(e){return{start:{line:e.startLine-1,character:e.startColumn-1},end:{line:e.endLine-1,character:e.endColumn}}}function Js(e){let{startOffset:t,endOffset:n}=e;return typeof t=="number"&&Number.isFinite(t)&&t>=0&&typeof n=="number"&&Number.isFinite(n)&&n>=t}function eo(e){if(!e)return;let{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}var xn;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(xn||(xn={}));function RN(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return xn.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return xn.After;let n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.line<t.end.line||e.end.line===t.end.line&&e.end.character<=t.end.character;return n&&r?xn.Inside:n?xn.OverlapBack:r?xn.OverlapFront:xn.Outside}function nE(e,t){return RN(e,t)>xn.After}var NE=/^[\w\p{L}]$/u;function PE(e,t){if(e){let n=bN(e,!0);if(n&&RE(n,t))return n;if(Yl(e)){let r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){let o=e.content[i];if(RE(o,t))return o}}}}function RE(e,t){return jl(e)&&t.includes(e.tokenType.name)}function bN(e,t=!0){for(;e.container;){let n=e.container,r=n.content.indexOf(e);for(;r>0;){r--;let i=n.content[r];if(t||!i.hidden)return i}e=n}}var gc={};bp(gc,{findAssignment:()=>ih,findNameAssignment:()=>hc,findNodeForKeyword:()=>nh,findNodeForProperty:()=>ia,findNodesForKeyword:()=>CN,findNodesForKeywordInternal:()=>rh,findNodesForProperty:()=>eh,getActionAtElement:()=>BE,getActionType:()=>UE,getAllReachableRules:()=>ra,getAllRulesUsedForCrossReferences:()=>ON,getCrossReferenceTerminal:()=>Jp,getEntryRule:()=>CE,getExplicitRuleType:()=>mc,getHiddenRules:()=>DE,getRuleType:()=>oh,getRuleTypeName:()=>WN,getTypeName:()=>sr,isArrayCardinality:()=>MN,isArrayOperator:()=>FN,isCommentTerminal:()=>Qp,isDataType:()=>BN,isDataTypeRule:()=>oa,isOptionalCardinality:()=>DN,terminalRegex:()=>no});var Qs=class extends Error{constructor(t,n){let r=typeof n=="string"?n:n();super(t?`${r} at ${t.range.start.line}:${t.range.start.character}`:r)}};function or(e,t="Error: Got unexpected value."){throw new Error(typeof t=="string"?t:t())}function ie(e){return e.charCodeAt(0)}function fc(e,t){Array.isArray(e)?e.forEach(function(n){t.push(n)}):t.push(e)}function to(e,t){if(e[t]===!0)throw"duplicate flag "+t;let n=e[t];e[t]=!0}function Zr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function ea(){throw Error("Internal Error - Should never get here!")}function jp(e){return e.type==="Character"}var ta=[];for(let e=ie("0");e<=ie("9");e++)ta.push(e);var na=[ie("_")].concat(ta);for(let e=ie("a");e<=ie("z");e++)na.push(e);for(let e=ie("A");e<=ie("Z");e++)na.push(e);var Yp=[ie(" "),ie("\f"),ie(`
3
3
  `),ie("\r"),ie(" "),ie("\v"),ie(" "),ie("\xA0"),ie("\u1680"),ie("\u2000"),ie("\u2001"),ie("\u2002"),ie("\u2003"),ie("\u2004"),ie("\u2005"),ie("\u2006"),ie("\u2007"),ie("\u2008"),ie("\u2009"),ie("\u200A"),ie("\u2028"),ie("\u2029"),ie("\u202F"),ie("\u205F"),ie("\u3000"),ie("\uFEFF")];var SN=/[0-9a-fA-F]/,dc=/[0-9]/,NN=/[1-9]/,Jr=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");let n=this.disjunction();this.consumeChar("/");let r={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":to(r,"global");break;case"i":to(r,"ignoreCase");break;case"m":to(r,"multiLine");break;case"u":to(r,"unicode");break;case"y":to(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){let t=[],n=this.idx;for(t.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(n)}}alternative(){let t=[],n=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":n="Lookbehind";break;case"!":n="NegativeLookbehind"}break}}Zr(n);let r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(t)}}return ea()}quantifier(t=!1){let n,r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),n={atLeast:i,atMost:o}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(t===!0&&n===void 0)return;Zr(n);break}if(!(t===!0&&n===void 0)&&Zr(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let t,n=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group();break}return t===void 0&&this.isPatternCharacter()&&(t=this.patternCharacter()),Zr(t)?(t.loc=this.loc(n),this.isQuantifier()&&(t.quantifier=this.quantifier()),t):ea()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ie(`
4
4
  `),ie("\r"),ie("\u2028"),ie("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,n=!1;switch(this.popChar()){case"d":t=ta;break;case"D":t=ta,n=!0;break;case"s":t=Yp;break;case"S":t=Yp,n=!0;break;case"w":t=na;break;case"W":t=na,n=!0;break}return Zr(t)?{type:"Set",value:t,complement:n}:ea()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=ie("\f");break;case"n":t=ie(`
@@ -2917,5 +2917,5 @@ ${n}`),this.inline?`{${i}}`:i}};function aM(e,t,n){if(e==="linkplain"||e==="link
2917
2917
  `);)r--;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;return r<0||t[r]!=="\\"}},pR={parser:{TokenBuilder:()=>new Oy({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:e=>new Af(e),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new $y},validation:{NowlineValidator:()=>new vd}};function Cy(e={}){let t=e.shared??Go(kf(If),aA),n=Go(_f({shared:t}),lA,pR);return t.ServiceRegistry.register(n),dR(n),{shared:t,Nowline:n}}function Dy(e,t){return t.code===void 0?t.message:Xn(e,t.code,...t.args??[])}function Di(e){let{content:t}=e,n=[...t.waves?.values()??[]];if(n.length===0)return;let r=new Map;n.forEach((u,f)=>{r.set(u.name,f+1)});let i=Is(t),o=n.map(u=>Al(u,i)),s=new WeakMap,a=new WeakMap,l=u=>{let f=fd(u,r);for(let[d,p]of f.waveOf)s.set(d,p);for(let[d,p]of f.leadOf)a.set(d,p)};l([...t.swimlanes.values()]);for(let u of t.isolatedRegions)l([...u.content.swimlanes.values()]);let c=u=>Ye(u)?s.get(u):void 0;return{waves:n,index:r,floors:o,waveOf:s,leadOf:a,memberWave:c,isMember:(u,f)=>{let d=c(u);return d!==void 0&&(f===void 0||d===f)}}}var Nl="en-US",VF={"en-US":{nowLabel:"now",quarterPrefix:"Q",waveHeldBy:"held by",waveNoItems:"no items",waveBackgroundItem:"Background (no wave)",waveLegendBackground:"Background work (not in a wave)",waveLegendBoundary:"Wave boundary",waveLegendPrefix:"Waves:",wavesDeclaredPlaceholder:"Waves declared: {names} \u2014 no items assigned yet"},fr:{nowLabel:"maint.",quarterPrefix:"T",waveHeldBy:"retenue par",waveNoItems:"aucun \xE9l\xE9ment",waveBackgroundItem:"Travail de fond (hors vague)",waveLegendBackground:"Travail de fond (dans aucune vague)",waveLegendBoundary:"Limite de vague",waveLegendPrefix:"Vagues\xA0:",wavesDeclaredPlaceholder:"Vagues d\xE9clar\xE9es\xA0: {names} \u2014 aucun \xE9l\xE9ment affect\xE9 pour l\u2019instant"}};function hR(e,t){return t??e??Nl}function Hn(e){let t={};for(let n of KF(e)){let r=VF[n];if(r)for(let i of Object.keys(r))t[i]===void 0&&r[i]!==void 0&&(t[i]=r[i])}return t}function mR(e,t){return e.wavesDeclaredPlaceholder.replace("{names}",()=>t.join(", "))}function KF(e){let t=[],n=qF(e);for(;n.length>0;){t.includes(n)||t.push(n);let r=n.lastIndexOf("-");if(r<=0)break;n=n.slice(0,r)}return t.includes(Nl)||t.push(Nl),t}function qF(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}function _d(e){return e==="hide"||e==="show"}var gR={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},jn={bg:"none",fg:"#e2e8f0",text:"#e2e8f0",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},My={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...jn,headerHeight:"md",padding:"md"},swimlane:{...jn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...jn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...jn,bracket:"none",padding:"xs"},group:{...jn,bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...jn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...jn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...jn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...jn,bg:"#1e293b",fg:"#94a3b8",text:"#e2e8f0",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#111827",bandOdd:"#0f172a",separator:"#1f2937",frameTabText:"#e2e8f0",frameTabMuted:"#94a3b8",border:"#334155",tabFill:"#1e293b",tabStroke:"#475569",tabText:"#e2e8f0",ownerText:"#94a3b8",footnoteIndicator:"#f87171",rowTintEven:"#0f172a",rowTintOdd:"#1e293b",utilizationOk:"#34d399",utilizationWarn:"#fbbf24",utilizationOver:"#f87171"},timeline:{gridLine:"#475569",minorGridLine:"#334155",nonWorkingSeam:"#6b7a90",nonWorkingFill:"#94a3b8",tickMark:"#334155",labelText:"#cbd5e1",panelFill:"#0f172a",border:"#334155"},header:{cardBorder:"#475569",author:"#94a3b8"},item:{overflowX:"#f87171",linkIconFg:"#94a3b8",overflowTailFill:"#7f1d1d",overflowTailStroke:"#f87171",overflowCaption:"#fecaca"},parallel:{bracketStroke:"#cbd5e1"},anchorDiamond:{fill:"#0f172a",stroke:"#cbd5e1",label:"#cbd5e1",cutLine:"#94a3b8"},milestoneDiamond:{fill:"#e2e8f0",label:"#e2e8f0",cutLineNormal:"#a5b4fc",cutLineOverrun:"#ef4444",slack:"#cbd5e1"},footnotePanel:{fill:"#0f172a",border:"#334155",header:"#e2e8f0",title:"#e2e8f0",description:"#94a3b8",number:"#f87171"},nowline:{stroke:"#f87171",labelText:"#0b1220",labelBg:"#f87171"},milestone:{dashedInk:"#a5b4fc",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#cbd5e1",overflowStroke:"#ef5350"},footnote:{indicatorText:"#f87171",descriptionMuted:"#94a3b8"},includeRegion:{border:"#475569",label:"#cbd5e1",badge:"#94a3b8",fill:"#0b1220",tabFill:"#111827",tabStroke:"#475569",tabText:"#e2e8f0",badgeFill:"#1e293b",badgeStroke:"#475569",badgeText:"#94a3b8"},wave:{stripFill:"#042f2e",stripFillAlt:"#134e4a",labelText:"#99f6e4",labelMuted:"#5eead4",boundary:"#2dd4bf",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#94a3b8",light:"#64748b",dark:"#e2e8f0"},status:{done:"#34d399",inProgress:"#60a5fa",atRisk:"#facc15",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#052e16",inProgress:"#172554",atRisk:"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#cbd5e1",link:"#f87171"},diagnostic:{overlayBg:"#7f1d1d",errorText:"#fecaca"}};var yR={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Yn={bg:"none",fg:"#1a1a1a",text:"#1a1a1a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Fy={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Yn,headerHeight:"md",padding:"md"},swimlane:{...Yn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Yn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Yn,bracket:"none",padding:"xs"},group:{...Yn,bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Yn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Yn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Yn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Yn,bg:"#e8e8e8",fg:"#595959",text:"#595959",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f5f5f5",separator:"#d4d4d4",frameTabText:"#3a3a3a",frameTabMuted:"#737373",border:"#d4d4d4",tabFill:"#e8e8e8",tabStroke:"#bdbdbd",tabText:"#3a3a3a",ownerText:"#737373",footnoteIndicator:"#4a4a4a",rowTintEven:"#ffffff",rowTintOdd:"#f5f5f5",utilizationOk:"#8a8a8a",utilizationWarn:"#595959",utilizationOver:"#1a1a1a"},timeline:{gridLine:"#bdbdbd",minorGridLine:"#d4d4d4",nonWorkingSeam:"#9a9a9a",nonWorkingFill:"#737373",tickMark:"#bdbdbd",labelText:"#737373",panelFill:"#ffffff",border:"#d4d4d4"},header:{cardBorder:"#d4d4d4",author:"#737373"},item:{overflowX:"#1a1a1a",linkIconFg:"#1a1a1a",overflowTailFill:"#e8e8e8",overflowTailStroke:"#4a4a4a",overflowCaption:"#3a3a3a"},parallel:{bracketStroke:"#3a3a3a"},anchorDiamond:{fill:"#ffffff",stroke:"#3a3a3a",label:"#3a3a3a",cutLine:"#737373"},milestoneDiamond:{fill:"#1a1a1a",label:"#1a1a1a",cutLineNormal:"#2a2a2a",cutLineOverrun:"#4a4a4a",slack:"#1a1a1a"},footnotePanel:{fill:"#ffffff",border:"#d4d4d4",header:"#1a1a1a",title:"#1a1a1a",description:"#737373",number:"#4a4a4a"},nowline:{stroke:"#1a1a1a",labelText:"#ffffff",labelBg:"#1a1a1a"},milestone:{dashedInk:"#9e9e9e",overrun:"#4a4a4a"},anchor:{predecessorLine:"#9e9e9e"},dependency:{edgeStroke:"#595959",overflowStroke:"#1a1a1a"},footnote:{indicatorText:"#4a4a4a",descriptionMuted:"#737373"},includeRegion:{border:"#9e9e9e",label:"#3a3a3a",badge:"#737373",fill:"#f5f5f5",tabFill:"#ffffff",tabStroke:"#bdbdbd",tabText:"#1a1a1a",badgeFill:"#e8e8e8",badgeStroke:"#bdbdbd",badgeText:"#595959"},wave:{stripFill:"#fafafa",stripFillAlt:"#e0e0e0",labelText:"#212121",labelMuted:"#616161",boundary:"#616161",hatch:"#000000",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#595959",light:"#9e9e9e",dark:"#1a1a1a"},status:{done:"#8a8a8a",inProgress:"#595959",atRisk:"#737373",blocked:"#3a3a3a",planned:"#bdbdbd",neutral:"#bdbdbd"},statusTint:{done:"#ebebeb",inProgress:"#e4e4e4",atRisk:"#eeeeee",blocked:"#dcdcdc",planned:"#f5f5f5",neutral:"#f5f5f5"},statusDot:{onLight:{done:"#3a3a3a",inProgress:"#2a2a2a",atRisk:"#4a4a4a",blocked:"#1a1a1a",planned:"#595959",neutral:"#595959"},onDark:{done:"#d4d4d4",inProgress:"#e8e8e8",atRisk:"#c8c8c8",blocked:"#f0f0f0",planned:"#d4d4d4",neutral:"#d4d4d4"}},attribution:{mark:"#9e9e9e",link:"#1a1a1a"},diagnostic:{overlayBg:"#e8e8e8",errorText:"#1a1a1a"}};var xR={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Vn={bg:"none",fg:"#0f172a",text:"#0f172a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},By={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Vn,headerHeight:"md",padding:"md"},swimlane:{...Vn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Vn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Vn,bracket:"none",padding:"xs"},group:{...Vn,bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Vn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Vn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Vn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Vn,bg:"#f1f5f9",fg:"#475569",text:"#475569",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f8fafc",separator:"#e2e8f0",frameTabText:"#334155",frameTabMuted:"#64748b",border:"#e2e8f0",tabFill:"#f1f5f9",tabStroke:"#cbd5e1",tabText:"#334155",ownerText:"#64748b",footnoteIndicator:"#dc2626",rowTintEven:"#ffffff",rowTintOdd:"#f8fafc",utilizationOk:"#10b981",utilizationWarn:"#f59e0b",utilizationOver:"#ef4444"},timeline:{gridLine:"#cbd5e1",minorGridLine:"#e2e8f0",nonWorkingSeam:"#a0aec0",nonWorkingFill:"#64748b",tickMark:"#cbd5e1",labelText:"#64748b",panelFill:"#ffffff",border:"#e2e8f0"},header:{cardBorder:"#e2e8f0",author:"#64748b"},item:{overflowX:"#dc2626",linkIconFg:"#0f172a",overflowTailFill:"#fee2e2",overflowTailStroke:"#ef4444",overflowCaption:"#b91c1c"},parallel:{bracketStroke:"#334155"},anchorDiamond:{fill:"#ffffff",stroke:"#334155",label:"#334155",cutLine:"#64748b"},milestoneDiamond:{fill:"#0f172a",label:"#0f172a",cutLineNormal:"#1e1b4b",cutLineOverrun:"#b91c1c",slack:"#0f172a"},footnotePanel:{fill:"#ffffff",border:"#e2e8f0",header:"#0f172a",title:"#0f172a",description:"#64748b",number:"#dc2626"},nowline:{stroke:"#e53e3e",labelText:"#ffffff",labelBg:"#e53e3e"},milestone:{dashedInk:"#94a3b8",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#475569",overflowStroke:"#d32f2f"},footnote:{indicatorText:"#e53e3e",descriptionMuted:"#64748b"},includeRegion:{border:"#94a3b8",label:"#334155",badge:"#64748b",fill:"#f8fafc",tabFill:"#ffffff",tabStroke:"#cbd5e1",tabText:"#0f172a",badgeFill:"#e2e8f0",badgeStroke:"#cbd5e1",badgeText:"#475569"},wave:{stripFill:"#f0fdfa",stripFillAlt:"#ccfbf1",labelText:"#134e4a",labelMuted:"#0f766e",boundary:"#0d9488",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#475569",light:"#94a3b8",dark:"#0f172a"},status:{done:"#10b981",inProgress:"#3b82f6",atRisk:"#f59e0b",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#ecfdf5",inProgress:"#eff6ff",atRisk:"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#94a3b8",link:"#e53e3e"},diagnostic:{overlayBg:"#fee2e2",errorText:"#991b1b"}};var ER=["light","dark","grayscale"],Wy={light:By,dark:My,grayscale:Fy};var ZF={greyscale:"grayscale"};function Uy(e){let t=e.toLowerCase(),n=ZF[t]??t;return ER.find(r=>r===n)}var JF={grey:"gray",violet:"purple"};function Kn(e,t){if(e==="none")return"none";if(e.startsWith("#"))return e;let n=t.name==="dark"?gR:t.name==="grayscale"?yR:xR,r=JF[e]??e,i=n[r];return typeof i=="string"?i:e}function QF(e,t){return{bg:Kn(e.bg,t),fg:Kn(e.fg,t),text:Kn(e.text,t),border:e.border,icon:e.icon,shadow:e.shadow,font:e.font,weight:e.weight,italic:e.italic,textSize:e.textSize,padding:e.padding,spacing:e.spacing,headerHeight:e.headerHeight,cornerRadius:e.cornerRadius,bracket:e.bracket,headerPosition:"beside",capacityIcon:e.capacityIcon,timelinePosition:"top",minorGrid:!1,nonWorking:"hide"}}function wR(e,t,n,r){switch(t){case"bg":e.bg=Kn(n,r);break;case"fg":e.fg=Kn(n,r);break;case"text":e.text=Kn(n,r);break;case"border":(n==="solid"||n==="dashed"||n==="dotted")&&(e.border=n);break;case"icon":e.icon=n;break;case"shadow":(n==="none"||n==="subtle"||n==="soft"||n==="hard")&&(e.shadow=n);break;case"font":(n==="sans"||n==="serif"||n==="mono")&&(e.font=n);break;case"weight":(n==="thin"||n==="light"||n==="normal"||n==="bold")&&(e.weight=n);break;case"italic":e.italic=n==="true";break;case"text-size":e.textSize=Pl(n,"xl");break;case"padding":e.padding=Pl(n,"xl");break;case"spacing":e.spacing=Pl(n,"xl");break;case"header-height":e.headerHeight=Pl(n,"xl");break;case"corner-radius":e.cornerRadius=Pl(n,"full");break;case"bracket":(n==="none"||n==="solid"||n==="dashed")&&(e.bracket=n);break;case"header-position":(n==="beside"||n==="above")&&(e.headerPosition=n);break;case"capacity-icon":e.capacityIcon=n;break;case"timeline-position":(n==="top"||n==="bottom"||n==="both")&&(e.timelinePosition=n);break;case"minor-grid":e.minorGrid=n==="true";break;case"non-working":_d(n)&&(e.nonWorking=n);break;default:break}}function Pl(e,t){let n=["none","xs","sm","md","lg","xl","full"],r=n.indexOf(t),i=n.indexOf(e);return i<0?"md":i>r?n[r]:n[i]}function e2(e,t,n){if(t)for(let r of t.properties)wR(e,Z(r),r.value,n)}function t2(e,t,n){for(let r of t){let i=Z(r);r.value!==void 0&&wR(e,i,r.value,n)}}function be(e,t,n){let r=n.theme.entities[e],i=QF(r,n.theme);for(let o of Of(e,t,n))switch(o.level){case"default":case"inline":t2(i,o.props,n.theme);break;case"label":break;default:e2(i,o.decl,n.theme)}return i}function TR(e,t){return be("label",e.properties,t)}function _R(e,t){let r=ot(e.roadmapDecl?.properties??[],"scale")?.value,i="weeks",o,s;if(r)if(r==="days"||r==="weeks"||r==="months"||r==="quarters"||r==="years")i=r;else{let c=/^(\d+)([dwmqy])$/.exec(r);if(c){let u=Math.max(1,parseInt(c[1],10));switch(c[2]){case"d":i="days";break;case"w":i="weeks";break;case"m":i="months";break;case"q":i="quarters";break;case"y":i="years";break}o=kd(i)*u,s=1}}let a=s??zk[i]??4,l=c=>s===void 0&&!c?{labelEveryDefault:!0}:{};if(t){let u=ot(t.properties,"unit")?.value??i,f=ot(t.properties,"label-every"),d=ot(t.properties,"pixels-per-unit"),p=f&&parseInt(f.value,10)||0,g=p!==0?Math.max(1,p):a,m=d?Math.max(1,parseInt(d.value,10)||kd(u)):o??kd(u);return{unit:u,labelEvery:g,pixelsPerUnit:m,...l(p!==0)}}return{unit:i,labelEvery:a,pixelsPerUnit:o??kd(i),...l(!1)}}function kd(e){switch(e){case"days":return Wk;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}var n2=.5,Xy=.5,Ll=7;function Fr(e){return e==="months"||e==="quarters"||e==="years"}function Ad(e,t){let n=e.getUTCFullYear(),r=e.getUTCMonth();switch(t){case"months":return new Date(Date.UTC(n,r+1,1));case"quarters":return new Date(Date.UTC(n,r-r%3+3,1));case"years":return new Date(Date.UTC(n+1,0,1))}}function r2(e,t){if(e.getUTCDate()!==1)return!1;let n=e.getUTCMonth();switch(t){case"months":return!0;case"quarters":return n%3===0;case"years":return n===0}}function Mi(e,t,n,r,i){let o=Math.ceil(t-1e-6);if(i?.hasNonWorkingDays){if(!Fr(n)&&o<=0)return 0;let a=o<=0?e:Ue(i.dateAtWorkingIndex(e,o-1),1),l=Fr(n)?vR(a,n):n==="weeks"?kR(a,e,i.weekStart):a;return i.workingIndexOf(e,l)}if(!Fr(n))return Math.ceil(t/r)*r;let s=Ue(e,o);return _t(e,vR(s,n))}function vR(e,t){return r2(e,t)?e:Ad(e,t)}function kR(e,t,n){let r=n===void 0?-_t(t,e):n-e.getUTCDay();return Ue(e,(r%Ll+Ll)%Ll)}function i2(e,t,n){return kR(Ue(e,1),t,n)}function Id(e,t,n,r=Nl){if(e.calendar?.hasNonWorkingDays)return o2(e,t,e.calendar,r);if(Fr(t.unit))return f2(e,t,t.unit,r);let i=n.daysPerUnit(t.unit),o=i*e.pixelsPerDay,s=Math.max(1,Math.round(e.widthPx/e.pixelsPerDay)),a=Math.floor(s/i)+1,l=[];for(let c=0;c<a;c++){let u=c*i,f=e.originX+u*e.pixelsPerDay,d=c%t.labelEvery===0,p=c===a-1;l.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?Hy(t.unit,Ue(e.domain[0],u),c,r):void 0})}return l}function o2(e,t,n,r){let{unit:i}=t,[o,s]=e.domain,a=x=>Fr(i)?Ad(x,i):i==="weeks"?i2(x,o,n.weekStart):Ue(x,1),l=[o];for(let x=a(o);x<s;x=a(x))l.push(x);let c=e.forward(s),u=[];l.forEach((x,y)=>{let E=e.forward(x);(y+1<l.length?e.forward(l[y+1]):c)>E&&!l2(e,i,l,y)&&u.push({date:x,x:E})});let f=i==="days"&&t.labelEveryDefault===!0&&n.weekStart!==void 0,d=(x,y)=>f?a2(x,n,e.showsNonWorking):y%t.labelEvery===0,g=(e.showsNonWorking?kk(i):n.daysPerUnit(i))*e.pixelsPerDay,m=u.map(({date:x,x:y},E)=>{let T=(E+1<u.length?u[E+1].x:c)-y,v=d(x,E),P=v?Hy(i,x,E,r):void 0,U=P===void 0?0:se(P,vi),L=Fr(i)?E===0||E===u.length-1:T<g-n2,M=P!==void 0&&!(U>T&&L);return{x:y,columnPx:T,major:v,label:P,labelPx:U,isNarrowed:L,isShown:M}});Fr(i)||s2(m);let w=m.map(x=>({x:x.x,labelX:x.x+x.columnPx/2,major:x.major,label:x.isShown?x.label:void 0}));return s>o&&w.push({x:c,labelX:void 0,major:d(s,u.length),label:void 0}),w}function s2(e){let t=n=>{let r=e[n];return r===void 0||r.isShown?0:r.columnPx/2};e.forEach((n,r)=>{if(n.label===void 0||n.isShown||!n.isNarrowed||!(e[r-1]?.isNarrowed===!0||e[r+1]?.isNarrowed===!0))return;let o=n.labelPx/2,s=n.columnPx/2;n.isShown=o<=s+t(r-1)&&o<=s+t(r+1)})}function a2(e,t,n){let r=t.weekStart;if(n)return e.getUTCDay()===r;let i=(e.getUTCDay()-r+Ll)%Ll;for(let o=1;o<=i;o++)if(t.isWorkingDay(Ue(e,-o)))return!1;return!0}function l2(e,t,n,r){let i=e.calendar;if(!e.showsNonWorking||!i||!Fr(t)||r===0||r!==n.length-1)return!1;let[o,s]=e.domain;return i.workingIndexOf(o,n[r])>=i.workingIndexOf(o,s)}function Gy(e,t,n,r){let i=e.calendar;if(!i?.hasNonWorkingDays)return;let o=i.nonWorkingRuns(e.domain[0],e.domain[1]);if(o.length===0)return;let[s,a]=e.range;if(e.showsNonWorking)return o.map(c=>u2(e,c,n));let l=c=>t.some(u=>Math.abs(u.x-c)<Xy&&(u.major||r));return o.map(c=>{let u=e.forward(c.from),f={x:u,width:e.forward(Ue(c.through,1))-u,from:c.from,through:c.through};c.titles.length>0&&(f.titles=c.titles,f.label=IR(c,i.workingWeekdays),f.cut=!0);let d=u-s>Xy&&a-u>Xy;return n==="days"&&d&&!l(u)&&(f.seam=!0),f})}function zy(e){let t=e.calendar?.workingExceptionRuns(e.domain[0],e.domain[1])??[];if(t.length===0)return;let[n]=e.range;return t.map(r=>({x:Math.max(n,e.forward(r.from)),from:r.from,through:r.through,titles:r.titles,label:c2(r)}))}function c2(e){let t=_t(e.from,e.through)+1;return`${e.titles.join(", ")}${AR}+${t}d`}var AR=" \xB7 ";function IR(e,t){let n=0;for(let i=e.from;i<=e.through;i=Ue(i,1))t.has(i.getUTCDay())&&n++;let r=e.titles.join(", ");return n>0?`${r}${AR}${n}d`:r}function u2(e,t,n){let[r,i]=e.range,o=Math.max(r,e.forward(t.from)),s=Math.min(i,e.forward(Ue(t.through,1))),a={x:o,width:s-o,from:t.from,through:t.through};return t.titles.length>0&&(a.titles=t.titles,e.calendar&&(a.label=IR(t,e.calendar.workingWeekdays))),(n==="days"||n==="weeks"||t.titles.length>0)&&(a.band=!0),a}function f2(e,t,n,r){let[i,o]=e.domain,s=[i];for(let c=Ad(i,n);c<o;c=Ad(c,n))s.push(c);o>i&&s.push(o);let a=s.map(c=>e.forward(c)),l=s.length-1;return s.map((c,u)=>{let f=a[u],d=u%t.labelEvery===0;if(u===l)return{x:f,labelX:void 0,major:d,label:void 0};let p=a[u+1]-f,g=d?Hy(n,c,u,r):void 0,m=u===0||u===l-1;return g!==void 0&&m&&se(g,vi)>p&&(g=void 0),{x:f,labelX:f+p/2,major:d,label:g}})}function Hy(e,t,n,r){switch(e){case"days":return`${t.getUTCMonth()+1}/${t.getUTCDate()}`;case"weeks":{let i=t.toLocaleString(r,{month:"short",timeZone:"UTC"}),o=t.getUTCDate().toString().padStart(2,"0");return`${i} ${o}`}case"months":return t.toLocaleString(r,{month:"short",timeZone:"UTC"});case"quarters":{let i=Math.floor(t.getUTCMonth()/3)+1;return`${Hn(r).quarterPrefix}${i} ${t.getUTCFullYear()}`}case"years":return`${t.getUTCFullYear()}`}}function RR(e,t,n){let r=n.theme??"light",i=Wy[r],o=hR(n.locale,p2(e)),s={theme:i,styles:t.config.styles,defaults:t.config.defaults,labels:t.content.labels},a=be("roadmap",e.roadmapDecl?.properties??[],s);return{themeName:r,theme:i,locale:o,styleCtx:s,roadmapStyle:a}}function bR(e,t,n,r,i){let{config:o,working:s}=Ff(e,t),a=_R(e,t.config.scale),{startDate:l,endDate:c}=d2(e,i,n.today,a),u=_d(n.nonWorking)?n.nonWorking:r.roadmapStyle.nonWorking,f=u==="show"&&s.hasNonWorkingDays,d=Math.max(1,s.workingIndexOf(l,c)),p=f?Math.max(1,_t(l,c)):d;return{cal:o,calendar:s,preset:a,schedule:i,startDate:l,naturalEndDate:c,spanDays:d,timelineDays:p,nonWorking:u}}function d2(e,t,n,r){let i=e.roadmapDecl?.properties??[],{config:o,working:s}=t.calendar,{startDate:a}=t,l=re(i,"length"),c=0;if(l){let g=ls(l,o);g>0&&(c=g)}let u=t.extent.contentEndDay;if(n&&!(c>0)){let g=s.workingIndexOf(a,n);g>0&&(u=Math.max(u,g))}let f=vk(r.unit,o),d=Mi(a,u>0?u:4*o.daysPerWeek,r.unit,f,s),p=Math.max(c,d);return{startDate:a,endDate:s.dateAtWorkingIndex(a,Math.max(1,p))}}function p2(e){return ot(e.directive?.properties??[],"locale")?.value}var h2=1e-6,Rs=class{constructor(t,n){B(this,"scale");B(this,"startDate");B(this,"spanDays");B(this,"unit");B(this,"calendar");this.scale=n,this.startDate=t.startDate,this.spanDays=t.spanDays,this.unit=t.preset.unit,this.calendar=t.calendar}isPast(t,n){return this.scale.indexAtX(t)>n+h2}boundaryAtOrAfterX(t){return this.boundaryAtOrAfter(this.scale.indexAtX(t))}boundaryAtOrAfter(t){return Mi(this.startDate,t,this.unit,this.calendar.daysPerUnit(this.unit),this.calendar)}captionColumn(t){let n=this.boundaryAtOrAfter(t);return{start:n,end:this.nextBoundary(n)}}nextBoundary(t){return Mi(this.startDate,t+.5,this.unit,this.calendar.daysPerUnit(this.unit),this.calendar)}xAt(t){return this.scale.forward(this.calendar.dateAtWorkingIndex(this.startDate,t))}captionCapX(t){let n=this.isPast(t,this.spanDays)?Math.max(this.spanDays,this.boundaryAtOrAfterX(t)):this.spanDays;return this.xAt(this.captionColumn(n).end)}};var Yy=class{constructor(t,n){B(this,"id");B(this,"anchor");this.id=t,this.anchor=n}place(t,n){let r=re(this.anchor.properties,"date"),i=_e(r);if(!i)return null;let o=t.scale.forwardWithinDomain(i);if(o===null)return null;let s=be("anchor",this.anchor.properties,t.styleCtx),a=t.markerRowPlacements.get(this.id),l=a?.centerY??t.timeline.markerRow.y,c={x:o,y:l},u=a?.labelBox??{x:o+6+6,y:l-4,width:0,height:12},f=a?.labelSide??"right";t.entityLeftEdges.set(this.id,o),t.entityRightEdges.set(this.id,o),t.entityMidpoints.set(this.id,c);let d={id:this.id,title:this.anchor.title??this.id,center:c,radius:6,style:s,predecessorPoints:[],cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f};return!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(i)&&(d.hiddenDate=Ti(i)),d}};function bd(e,t,n){let r=[];for(let[i,o]of e){let s=new Yy(i,o).place(t,n);s&&r.push(s)}return r}function Vy(e){if(e.kind==="item")return Math.max(e.box.x+e.box.width,e.decorationsRightX,e.chipsOutside?e.chipsRightX:Number.NEGATIVE_INFINITY);let t=e.box.x+e.box.width;if(e.kind==="parallel")for(let n of e.children)t=Math.max(t,Vy(n));return t}function bs(e){let t=0;for(let n of e)t=Math.max(t,SR(n.children)),n.nested.length>0&&(t=Math.max(t,bs(n.nested)));return t}function SR(e){let t=0;for(let n of e)n.kind==="item"?t=Math.max(t,n.box.x+n.box.width):t=Math.max(t,SR(n.children));return t}function Sd(e){let t=0;for(let n of e)t=Math.max(t,NR(n.children)),n.nested.length>0&&(t=Math.max(t,Sd(n.nested)));return t}function NR(e){let t=0;for(let n of e)n.kind==="item"?n.textSpills&&(t=Math.max(t,n.decorationsRightX)):t=Math.max(t,NR(n.children));return t}var Nd=class{constructor(t){B(this,"items");B(this,"brackets");this.items=t.itemBars,this.brackets=t.brackets}hasObstacle(t,n,r){let i=Math.min(n,r),o=Math.max(n,r);for(let s of this.items)if(!(t<=s.x||t>=s.x+s.width)&&!(s.y+s.height<=i||s.y>=o))return!0;return!1}bracketsNear(t,n,r,i){let o=Math.min(n,r),s=Math.max(n,r),a=[];for(let l of this.brackets)Math.abs(l.x-t)>i||l.yBottom<=o||l.yTop>=s||a.push(l);return a}};function PR(e,t){let n=[],r=[],i=s=>{if(s.kind==="item"){n.push(s.box);return}if(s.kind==="parallel"){if(s.style.bracket==="solid"||s.style.bracket==="dashed"){let c=s.box.y-12,u=s.box.y+s.box.height+12,f=s.box.x,d=s.box.x+s.box.width;r.push({x:f,yTop:c,yBottom:u}),r.push({x:d,yTop:c,yBottom:u}),r.push({x:f+4,yTop:c-1,yBottom:c+1}),r.push({x:f+4,yTop:u-1,yBottom:u+1}),r.push({x:d-4,yTop:c-1,yBottom:c+1}),r.push({x:d-4,yTop:u-1,yBottom:u+1})}for(let a of s.children)i(a);return}if(s.kind==="group"){!(s.style.bg!=="none"&&s.style.bg!=="#ffffff")&&s.style.bracket&&s.style.bracket!=="none"&&r.push({x:s.box.x,yTop:s.box.y,yBottom:s.box.y+s.box.height});for(let l of s.children)i(l);return}},o=s=>{for(let a of s.children)i(a);for(let a of s.nested)o(a)};for(let s of e)o(s);for(let s of t)for(let a of s.nestedSwimlanes)o(a);return{itemBars:n,brackets:r}}function g2(e,t){let{from:n,to:r}=e;if(Math.abs(n.y-r.y)<.5)return{x:(n.x+r.x)/2,underBar:!1,range:null};let i=Math.min(n.y,r.y),o=Math.max(n.y,r.y);if(n.x<=r.x){let a=n.x+6,l=r.x-6;if(a>l)return{x:r.x-6,underBar:!0,range:null};let c={minX:a,maxX:l},u=(n.x+r.x)/2,f=Math.max(a,Math.min(l,u));if(!t.hasObstacle(f,i,o))return{x:f,underBar:!1,range:c};let d=l-a;for(let p=1;p<=d;p++){let g=f-p;if(g>=a&&!t.hasObstacle(g,i,o))return{x:g,underBar:!1,range:c};let m=f+p;if(m<=l&&!t.hasObstacle(m,i,o))return{x:m,underBar:!1,range:c}}return{x:f,underBar:!0,range:c}}let s=[n.x+10,r.x-10];for(let a of s)if(a>0&&!t.hasObstacle(a,i,o))return{x:a,underBar:!1,range:null};return{x:n.x+10,underBar:!0,range:null}}function y2(e,t,n,r){let i=Math.min(n.from.y,n.to.y),o=Math.max(n.from.y,n.to.y),s=r.bracketsNear(e,i,o,4);if(s.length===0)return{x:e,forceUnderBar:!1};let a=s[0],l=Math.abs(s[0].x-e);for(let d=1;d<s.length;d++){let p=Math.abs(s[d].x-e);p<l&&(a=s[d],l=p)}let c=[a.x+4,a.x-4],u=4-.01;for(let d of c){if(t&&(d<t.minX||d>t.maxX))continue;let p=t?d:Math.max(Math.min(n.from.x,n.to.x)+1,Math.min(Math.max(n.from.x,n.to.x)-1,d));if(r.bracketsNear(p,i,o,u).length===0)return{x:p,forceUnderBar:!1}}return{x:t?Math.min(Math.max(e,t.minX),t.maxX):e,forceUnderBar:!0}}function x2(e){let t=[...e].sort((i,o)=>Math.abs(i.channelX-o.channelX)>=1?i.channelX-o.channelX:i.orderIndex-o.orderIndex),n=new Map,r=0;for(;r<t.length;){let i=r+1;for(;i<t.length&&Math.abs(t[i].channelX-t[r].channelX)<1;)i++;let s=[...t.slice(r,i)].sort((l,c)=>{let u=Math.min(l.req.from.y,l.req.to.y),f=Math.min(c.req.from.y,c.req.to.y);return Math.abs(u-f)>.5?u-f:l.orderIndex-c.orderIndex}),a=[];for(let l of s){let c=Math.min(l.req.from.y,l.req.to.y),u=Math.max(l.req.from.y,l.req.to.y),f=-1;for(let d=0;d<a.length;d++)if(a[d]<=c){f=d,a[d]=u;break}f===-1&&(f=a.length,a.push(u)),n.set(l.orderIndex,f)}r=i}return n}function E2(e){if(e===0||e>4)return 0;let t=Math.ceil(e/2);return(e%2===1?1:-1)*t*3}function w2(e){let t=e.from.x>=e.to.x?{x:e.to.x-1,y:e.from.y}:e.from;return{fromId:e.fromId,toId:e.toId,waypoints:[t,e.to],underBar:!1}}function LR(e,t){let n=new Array(e.length),r=[];for(let o=0;o<e.length;o++){let s=e[o];if(s.isMarkerSource){n[o]=w2(s);continue}if(Math.abs(s.from.y-s.to.y)<.5&&s.to.x-s.from.x<20){n[o]={fromId:s.fromId,toId:s.toId,waypoints:[s.from,s.to],underBar:!1};continue}let{x:a,underBar:l,range:c}=g2(s,t),{x:u,forceUnderBar:f}=y2(a,c,s,t),d=l||f;r.push({req:s,channelX:u,underBar:d,orderIndex:o})}let i=x2(r);for(let o of r){let s=E2(i.get(o.orderIndex)??0),a=o.channelX+s;n[o.orderIndex]={fromId:o.req.fromId,toId:o.req.toId,waypoints:T2(o.req.from,o.req.to,a),underBar:o.underBar}}return n}function T2(e,t,n){return Math.abs(e.y-t.y)<.5?[e,t]:[e,{x:n,y:e.y},{x:n,y:t.y},t]}function $R(e){return e.box.y+e.box.height-Zt/2}function OR(e,t){let{box:n}=e;return{x:n.x,y:n.y+t/2}}function CR(e,t){let{box:n}=e;return{x:n.x+n.width,y:e.textSpills?$R(e):n.y+t/2}}function DR(e,t){return e.textSpills?$R(e):e.box.y+t/2}function MR(e){let{box:t,afterDate:n,beforeDate:r,hasLinkIcon:i,footnoteCount:o}=e;if(!n&&!r)return[];let s=[],a=Mn,l=t.y+Yk,c=ly(t.width);if(n){let u=cy(t.x,i),f=c?{x:t.x-Bn-a,y:l}:{x:u,y:l};s.push({side:"after",isoDate:n,glyphTopLeft:f,glyphSize:a,spilled:c})}if(r){let u=t.x+t.width,f=uy(u,o),d=c?{x:u+Bn,y:l}:{x:f,y:l};s.push({side:"before",isoDate:r,glyphTopLeft:d,glyphSize:a,spilled:c})}return s}function Pd(e){let{box:t,afterDate:n,beforeDate:r,row:i}=e;if(!n&&!r)return[];let o=[],s=Mn,a,l,c;if(i.kind==="title-tab-row"){a=t.y+(_i-s)/2;let u=i.titleTabWidth!==void 0?t.x+i.titleTabWidth:void 0;l=u!==void 0?u+Fn:t.x+Ni,c=u??t.x}else a=t.y-ys+(ys-s)/2,l=t.x+Ni,c=i.title?Pi(t.x,i.titleInsetX,!!n)+fy(i.title):t.x;if(n&&(c=Math.max(c,l+s),o.push({side:"after",isoDate:n,glyphTopLeft:{x:l,y:a},glyphSize:s,spilled:!1})),r){let u=t.x+t.width-ay-s;o.push({side:"before",isoDate:r,glyphTopLeft:{x:Math.max(u,c+Fn),y:a},glyphSize:s,spilled:!1})}return o}function Bt(e){for(let t of e)if(_e(t))return t}function Br(e){return{after:Be(e,"after").map(n=>{let r=_e(n);return r?{raw:n,date:r}:{raw:n,ref:n}})}}function Ld(e){return e.floors.map(t=>t?_e(t.date):null)}function $d(e,t,n,r,i=0,o){let s=n.map(c=>c??-1/0),a=[];for(let c=0;c<e;c++){let u=FR(c===0?t:a[c-1],s[c],i);a.push(c===0?u:Math.max(u,o?.S[c]??-1/0))}let l=a.map((c,u)=>Math.max(c,o?.E[u]??-1/0));for(let c=1;c<=e+1;c++){let u=r(a,l).memberEnd,f=[],d=[];for(let p=0;p<e;p++)f.push(p===0?a[0]:FR(d[p-1],s[p],i)),d.push(Math.max(f[p],u[p]??-1/0));if(BR(a,f)&&BR(l,d))return{S:a,E:l,passes:c,capped:!1};a=f,l=d}return r(a,l),{S:a,E:l,passes:e+1,capped:!0}}function FR(e,t,n){return t-e>n?t:e}function BR(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function WR(e,t,n){return Ld(e).map(r=>r?n.workingIndexOf(t,r):null)}var Fi=class{constructor(t,n){B(this,"plan");B(this,"S");B(this,"memberEnd");B(this,"binding");B(this,"memberCount");this.plan=t,this.S=n;let r=t.waves.length;this.memberEnd=new Array(r).fill(-1/0),this.binding=new Array(r).fill(void 0),this.memberCount=new Array(r).fill(0)}floor(t){let n=this.plan.waveOf.get(t),r=t.$type==="ItemDeclaration"?void 0:this.plan.leadOf.get(t),i;return n!==void 0&&(i=this.S[n-1]),r!==void 0&&(i=Math.max(i??-1/0,this.S[r-1])),i}apply(t,n){let r=this.floor(t);return r===void 0?n:Math.max(n,r)}accumulate(t,n){let r=this.plan.memberWave(t);r!==void 0&&(this.memberCount[r-1]++,n>this.memberEnd[r-1]&&(this.memberEnd[r-1]=n,this.binding[r-1]=t))}};function Od(e,t,n,r,i,o=0){return e.waves.map((s,a)=>{let l={id:s.name,index:a+1,start:t.S[a],end:t.E[a],memberCount:n.memberCount[a]},c=n.binding[a];if(c!==void 0&&n.memberEnd[a]===t.E[a]&&t.E[a]>t.S[a]){let p=c.name??c.title;p!==void 0&&(l.heldBy=p)}let u=i[a],f=e.floors[a]?.ref,d=a===0?r:t.E[a-1];return u!=null&&f!==void 0&&u-d>o&&(l.floorRef=f),l})}var At=.5;function UR(e,t,n,r){let i=e.waves.map(()=>n);return{plan:e,ids:e.waves.map(o=>o.name),origin:n,floors:Ld(e).map(o=>o?t.forward(o):null),S:i,E:i,pass:new Fi(e,i),frozen:!1,backgroundTooltip:r}}function XR(e,t,n){e.S=t,e.E=n,e.pass=new Fi(e.plan,t)}function GR(e,t){e.S=t.S,e.E=t.E,e.frozen=!0,e.solve=t}function Cd(e,t,n){e.ids.forEach((r,i)=>{t.set(r,e.S[i]),n.set(r,e.E[i])})}function Wr(e,t,n){return n.waves?n.waves.pass.apply(e,t):t}function zR(e,t,n){n.waves&&!n.waves.frozen&&n.waves.pass.accumulate(e,t)}function HR(e,t){if(t.waves)return t.waves.plan.memberWave(e)!==void 0?"member":"background"}function jR(e,t){for(let n of[...e.S,...e.E])if(!(Math.abs(n-e.origin)<At)&&Math.abs(t-n)<At)return!0;return!1}function Ky(e,t){let n=Math.round((e-t.timeline.originX)/t.timeline.pixelsPerDay);if(!t.scale.showsNonWorking)return n;let r=t.timeline.startDate;return t.calendar.workingIndexOf(r,Ue(r,n))}function Dd(e,t){return t.calendar.dateAtWorkingIndex(t.timeline.startDate,Ky(e,t))}function YR(e,t,n){return Mf(n.calendar,n.timeline.startDate,Ky(e,n),Ky(t,n))}function $l(e,t,n){let r=Wr(e,Ol(e.properties,t,n),n);return Ye(e)?qy(e,r,n):r}var VR=!0;function KR(){return VR}function qy(e,t,n){if(!VR)return t;let r=n.schedule.byNode.get(e);if(!r)return t;let i=n.scale.forwardWithinDomain(r.start);return i===null||n.scale.startX(t)>=i?t:i}function Ol(e,t,n){let{after:r}=Br(e);if(r.length>0){let i=t;for(let o of r){if("date"in o){let a=n.scale.forwardWithinDomain(o.date);a!==null&&(i=Math.max(i,a));continue}let s=n.entityRightEdges.get(o.ref);s!==void 0&&(i=Math.max(i,s))}return i}return t}function qR(e,t,n){if(!n.calendar.hasNonWorkingDays)return;let r=v2(e);if(!r||n.calendar.isWorkingDay(r.date))return;let i=n.scale.forwardWithinDomain(r.date);if(!(i===null||Math.abs(t-i)>=At))return{key:r.key,pin:r.raw,start:Ti(Dd(t,n))}}function v2(e){let{after:t}=Br(e);for(let n of t)if("date"in n)return{key:"after",raw:n.raw,date:n.date}}function Ss(e,t,n){return e.scale.showsNonWorking?e.scale.advanceX(t,n)-t:n*e.timeline.pixelsPerDay}function Cl(e,t){return{x:e,y:t,height:0,maxX:e}}function ZR(e,t){let n=e.schedule.byNode.get(t);if(!n)throw new Error(`layout: item "${t.name??t.title??"(unnamed)"}" is not in the day schedule`);return n.days}function Md(e,t,n,r){return{cal:t.cal,schedule:t.schedule,styleCtx:{theme:t.theme,styles:e.config.styles,defaults:e.config.defaults,labels:e.content.labels},sizes:cs(e.content.sizes,t.cal),labels:e.content.labels,teams:e.content.teams,persons:e.content.persons,symbols:e.config.symbols,footnoteIndex:r.footnotes?.index??new Map,footnoteHosts:r.footnotes?.hosts??new Map,timeline:t.timeline,scale:t.scale,calendar:t.calendar,...t.axisColumns?{axisColumns:t.axisColumns}:{},bandScale:t.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,placedItems:new Map,itemFlowKey:new Map,currentFlowKey:"",slackCorridors:[],markerRowPlacements:r.markerRowPlacements??new Map,chartTopY:n.chartTopY,chartBottomY:n.chartBottomY,swimlaneBottomY:n.swimlaneBottomY,nextParallelId:0,nextGroupId:0,...t.waves?{waves:t.waves}:{}}}var _2=12,k2=4,Fd=13,A2=11;function I2(e,t){return(e?se(e,A2):0)+t}function Zy(e){return Math.max(ol,e-2*pn)}function JR(e){if(!/[\r\n]/.test(e))return;let t=e.replace(/\r\n?/g,`
2918
2918
  `).split(`
2919
2919
  `).map(i=>i.trim()),n=0,r=t.length;for(;n<r&&t[n]==="";)n+=1;for(;r>n&&t[r-1]==="";)r-=1;return t.slice(n,r)}function R2(e,t,n,r=t){let i=e,o=JR(e);if(o){if(o.length>=2)return{textSpills:!(n<=t&&o.every((c,u)=>se(c,Fd)<=(u===0?r:t))),titleLines:o};i=o[0]??""}let s=i.length>0&&se(i,Fd)>r,a=n>t;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let l=Ii(i,t,Fd,r);if(l.length>=2&&l.length<=ny&&l.every((c,u)=>se(c,Fd)<=(u===0?r:t)))return{textSpills:!1,titleLines:l}}return{textSpills:!0,titleLines:[i]}}function QR(e,t,n){let r=JR(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function eb(e){let{visualWidth:t}=e,n=ms(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-_2),i=I2(e.metaText,e.metaTrailingWidth??0),o=Math.max(0,t-n-(e.titleFirstLineRightReservePx??yl({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1})));return{leftInset:n,fit:R2(e.title,r,i,o)}}var b2;function tb(e,t,n){b2?.(e,t,n)}var Bd=class{constructor(t){B(this,"geometry");this.geometry=t}get id(){return this.geometry.id}measure(t){return{width:this.geometry.naturalWidth,height:t.bands.bandwidth()+this.geometry.barExtra}}place(t,n){let{visualWidth:r,caption:i,barExtra:o}=this.geometry,s=n.bands.bandwidth(),a=t.x+pn,l={x:a,y:t.y,width:r,height:o>0?s+o:s},{textSpills:c,titleLines:u}=i.fit,f=c?a+r+k2:a+i.leftInset;return{id:this.geometry.id,box:l,textX:f,textSpills:c,titleLines:u}}};function S2(e){switch(e){case"done":case"completed":return"done";case"in-progress":case"active":return"in-progress";case"at-risk":case"blocked":case"planned":return e;case void 0:return"planned";default:return"neutral"}}function N2(e){if(!e)return 0;let t=/^(\d{1,3})%$/.exec(e);return t?Math.max(0,Math.min(100,parseInt(t[1],10)))/100:0}function P2(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function L2(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function $2(e){if(!e)return{icon:"none"};let t=e.toLowerCase();return t.includes("linear.app")?{icon:"linear",href:e}:t.includes("github.com")?{icon:"github",href:e}:t.includes("atlassian.net")||t.includes("jira.")?{icon:"jira",href:e}:{icon:"generic",href:e}}function Wd(e,t,n,r,i){let o=TR(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,l=Fk[a],c=Math.max(20,Math.round(s.length*5.5+l*2));return i!==void 0&&(c=Math.min(c,i)),{text:s,style:o,box:{x:n,y:r,width:c,height:Cr}}}function O2(e,t){let n=xk(e,t.sizes,t.cal),r=gk(re(e,"remaining"),t.sizes,t.cal),i=re(e,"status"),o=S2(i),s=N2(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(re(e,"remaining")??"");return s===0&&o==="in-progress"&&a&&(s=1-Math.max(0,Math.min(100,parseInt(a[1],10)))/100),s===0&&o==="in-progress"&&r>0&&n>0&&(s=Math.max(0,Math.min(1,1-r/n))),{status:o,progress:s}}function C2(e,t,n,r,i,o){let s=re(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),l=n?n.title??n.name:"",c=a?s:l||void 0,u=re(e,"remaining"),f=P2(u,t),d=L2(re(e,"owner"),t),p=()=>[c,d].filter(Boolean).join(" "),g;if(r==="in-progress"&&f){let E=p();g=E?`${E} \u2014 ${f} remaining`:`${f} remaining`}else if(r==="in-progress"&&i>0&&i<1){let E=Math.round((1-i)*100),T=p();g=T?`${T} \u2014 ${E}% remaining`:`${E}% remaining`}else(d||c)&&(g=p()||void 0);let m=re(e,"capacity"),w=Sr(m),x=null,y=0;if(w!==null){let E=el(w),T=tl(o,t.symbols);x={value:w,text:E,icon:T};let v=11;y=(g?se(" ",v):0)+wi(E,T,v)}return{metaText:g,ownerDisplay:d,capacity:x,capacityTrailingWidth:y}}function D2(e,t){let n=new Set;if(e){for(let[r,i]of t.footnoteHosts.entries())if(i.includes(e)){let o=t.footnoteIndex.get(r);o!==void 0&&n.add(o)}}return[...n].sort((r,i)=>r-i)}function M2(e,t,n){return yl({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Bt(n)!==void 0})}var F2={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function B2(e,t,n){let r=F2[t],i={...e};return i.bg===n.entities.item.bg&&(i.bg=n.statusTint[r]),i.fg===n.entities.item.fg&&(i.fg=n.status[r]),i}function W2(e,t,n,r,i){if(n===0)return 0;let o=r-Zt-Cr-Wn,s;e&&t?s=Math.max(Ri,i)+Wn:e?s=o:s=Math.max(o,i+Wn);let l=s+(n-1)*rd+Cr+Wn+Zt;return Math.max(0,l-r)}function U2(e,t,n){let r=n.axisColumns;if(!t.textSpills||!r)return{lines:e,truncated:!1};let i=Math.max(0,...e.map(m=>se(m,Lr))),{metaText:o,capacityTrailingWidth:s}=t.meta,a=(o?se(o,hl):0)+s,l=Math.max(i,a),c=nd({barRightX:t.barRightX,iconSpills:t.iconSpills,captionWidth:l,footnoteCount:t.visualWidth<gs?t.footnoteCount:0,dotSpills:t.visualWidth<Or}),u=r.captionCapX(t.barRightX);if(c.rightX<=u+X2||c.captionX===null)return{lines:e,truncated:!1};let f=c.rightX-(c.captionX+l),d=u-c.captionX-f,p=!1;return{lines:e.map(m=>{let w=Hk(m,d,Lr);return w!==m&&(p=!0),w}),truncated:p}}var X2=1e-6;function Ud(e,t,n){let r=e.properties,i=be("item",r,n.styleCtx),o=re(r,"size"),s=o?n.sizes.get(o)??null:null,a=ZR(n,e),l=Be(r,"after"),c=Be(r,"before"),u=Math.max(ol,Ss(n,t,a)),f=t+u,d=Zy(Math.max(ol,f-t)),p=$2(re(r,"link")),g=p.icon!=="none",m=Zy(u),w=Be(r,"labels"),x=[];for(let X of w){let Q=n.labels.get(X);if(!Q)continue;let H=Wd(Q,n.styleCtx,0,0);x.push({id:Q,width:H.box.width})}let y=0;for(let X=0;X<x.length;X+=1)X>0&&(y+=Un),y+=x[X].width;let E=Math.max(0,m-2*Dn),T=x.length>0&&y>E,{status:v,progress:P}=O2(r,n),U=B2(i,v,n.styleCtx.theme),L=C2(r,n,s,v,P,U.capacityIcon),M=e.title??e.name??"",j=D2(e.name,n),$=eb({title:M,visualWidth:d,metaText:L.metaText,metaTrailingWidth:L.capacityTrailingWidth,hasLinkIcon:g,hasAfterGlyph:Bt(l)!==void 0,titleFirstLineRightReservePx:M2(m,j,c)}),R=g&&d<sy,A=$.fit.textSpills||R,O=U2(QR(M,$.fit,R),{textSpills:A,iconSpills:R,barRightX:t+pn+d,visualWidth:d,footnoteCount:j.length,meta:L},n),_=O.lines,I=T?Kk(x,d):null,S=I?I.rows.length:x.length>0?1:0,F=L.metaText!==void 0||L.capacity!==null,N=td(_.length,F),W=ry(_.length,F),z=W2(T,A,S,n.bandScale.bandwidth(),N);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:d,naturalVisualWidth:m,style:U,size:s,status:v,progress:P,meta:L,link:p,chips:{samples:x,outside:T,pack:I,rowCount:S},footnoteIndicators:j,caption:{...$,title:M,iconSpills:R,lines:_,truncated:O.truncated,lastBaseline:N},barExtra:Math.max(W,z)}}function Xd(e,t,n,r){let i=e.properties,o=Be(i,"after"),s=Be(i,"before"),a=Ol(i,t.x,n);n.waves&&(a=Wr(e,a,n)),a=qy(e,a,n);let l=qR(i,a,n),c=n.scale.startX(a),u=r??Ud(e,c,n);if(u.startX!==c)throw new Error(`layout: item "${e.name??e.title??"(unnamed)"}" was measured at x ${u.startX} but placed at x ${c}`);let{naturalWidth:f,style:d,status:p,progress:g,footnoteIndicators:m,caption:w}=u,{metaText:x,ownerDisplay:y,capacity:E,capacityTrailingWidth:T}=u.meta,v=u.link,P=v.icon!=="none",U=u.chips.samples,L=u.chips.outside,M=c,j=c+f,$=c+Ss(n,c,u.durationDays),R=!1,A,O;if(s.length>0){let qe,Qn;for(let Pt of s){let Fs=_e(Pt),Bs=Fs?n.scale.forwardWithinDomain(Fs)??void 0:n.entityLeftEdges.get(Pt);Bs!==void 0&&(qe===void 0||Bs<qe)&&(qe=Bs,Qn=Pt)}qe!==void 0&&j>qe&&(R=!0,A={x:qe,y:t.y,width:j-qe,height:n.bandScale.bandwidth()},O=Qn)}let _=w.title,I=new Bd(u),S={time:n.scale,bands:n.bandScale,style:d},F=I.place({x:M,y:t.y},S),N=F.box,W=n.bandScale.bandwidth(),z=N.width<Or,X=w.iconSpills,Q=N.width<gs,H=F.textSpills||X,te=w.lines,k=u.chips.pack,C=w.lastBaseline,D=u.barExtra,G=[],J=N.y+W-Zt-Cr-Wn,q=N.y+(L&&H?Math.max(Ri,C):C)+Wn,oe=L&&H||!L&&U.length>0?Math.max(J,q):J,ge=L?N.x+N.width+Bn:N.x+Dn,fe=ge;if(k)for(let qe=0;qe<k.rows.length;qe+=1){let Qn=oe+qe*rd,Pt=ge;for(let Bs of k.rows[qe]){let Zx=Wd(Bs.id,n.styleCtx,Pt,Qn);G.push(Zx),Pt+=Zx.box.width+Un}let Fs=Pt-Un;Fs>fe&&(fe=Fs)}else{let qe=ge;for(let Qn of U){let Pt=Wd(Qn.id,n.styleCtx,qe,oe);G.push(Pt),qe+=Pt.box.width+Un}fe=U.length>0?qe-Un:ge}let de=y??re(i,"owner"),rt=e.description?.text,mt=m.length>0&&Q,gt=null;if(H){let qe=Math.max(...te.map(Pt=>se(Pt,Lr))),Qn=(x?se(x,11):0)+T;gt=Math.max(qe,Qn)}let Hl=nd({barRightX:N.x+N.width,iconSpills:X,captionWidth:gt,footnoteCount:mt?m.length:0,dotSpills:z}),{iconSpillX:pN,footnoteSpillStartX:hN,dotSpillCx:mN}=Hl,gN=Math.max(N.x+N.width,Hl.rightX),Ms=e.name;Ms&&(n.entityLeftEdges.set(Ms,M),n.entityRightEdges.set(Ms,$)),zR(e,$,n);let Kx=Ms??Jy(e);n.itemFlowKey.set(Kx,n.currentFlowKey),t.x=$,t.maxX=Math.max(t.maxX,j,$),t.height=Math.max(t.height,n.bandScale.step()+D);let qx=MR({box:N,afterDate:Bt(o),beforeDate:Bt(s),hasLinkIcon:P,footnoteCount:m.length}),Xr={kind:"item",id:Ms,title:_,...te.length>=2||te[0]!==_?{titleLines:te}:{},box:N,status:p,progressFraction:g,footnoteIndicators:m,labelChips:G,chipsOutside:L,chipsRightX:fe,linkIcon:v.icon,linkHref:v.href,hasOverflow:R,overflowBox:A,overflowAnchorId:O,owner:de,description:rt,metaText:x,textSpills:H,dotSpills:z,iconSpills:X,footnoteSpills:mt,dotSpillCx:mN,iconSpillX:pN,footnoteSpillStartX:hN,decorationsRightX:gN,capacity:E,size:u.size,style:d,inlineDatePins:qx.length>0?qx:void 0},Rp=HR(e,n);return Rp!==void 0&&(Xr.waveRole=Rp),l!==void 0&&(Xr.nonWorkingPin=l),w.truncated&&(Xr.titleTruncated=!0),Rp==="background"&&n.waves&&(Xr.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(Kx,Xr),tb(I,S,Xr),Xr}function Jy(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function Qy(e){let t=new Map;for(let n of rk(e))Ye(n)&&t.set(n.name??Jy(n),n);return t}function ex(e,t,n,r){let i=new Nd(PR(t,n)),o=[],s=[],a=r.bandScale.bandwidth();for(let[u,f]of e){let d=Be(f.properties,"after"),p=r.placedItems.get(u);if(!p)continue;let g=OR(p,a);for(let m of d){let w=r.placedItems.get(m),x,y=w===void 0;if(w)x=CR(w,a);else{let E=r.entityMidpoints.get(m);if(!E)continue;x={x:E.x,y:g.y}}!y&&Math.abs(x.y-g.y)<.5&&g.x-x.x<20||(o.push({fromId:m,toId:u,from:x,to:g,isMarkerSource:y}),s.push({fromId:m,toId:u}))}}let l=LR(o,i),c=[];for(let u=0;u<l.length;u++){let f=l[u];c.push({fromId:s[u].fromId,toId:s[u].toId,waypoints:f.waypoints,kind:f.underBar?"underBar":"normal",style:be("item",[],r.styleCtx)})}return c}function zd(e,t=0){let n=new Map,r=new Map;return[...e.entries()].forEach(([i,o],s)=>{n.set(i,t+s+1),r.set(i,Be(o.properties,"on"))}),{index:n,hosts:r}}var Gd=11,G2=120,z2=6,nb="\u2014 ";function ib(e,t,n,r,i=[]){let o=Ft,s=n+Ft,a=r-2*Ft,l=o+2*Ft,c=o+a-Ft,u=s+Gf+Ft,f=[],d=0,p=(m,w,x)=>{for(let[y,E]of m){let T=E.title??y,v=E.description?.text,P=H2(T,v,l,c),U=u+d*ps,L=j=>({x:j.x,y:U+j.row*ps,text:j.text}),M={number:w.footnoteIndex.get(y)??f.length+1,y:U,title:T,titleLines:P.title.map(L),description:v,style:be("footnote",E.properties,w.styleCtx)};P.description.length>0&&(M.descriptionLines=P.description.map(L)),x!==void 0&&(M.region=x),f.push(M),d+=P.rows}};p(e,t);for(let m of i){if(m.footnotes.size===0)continue;let w=u+d*ps;d+=1;let x=f.length;p(m.footnotes,m.ctx,m.title),f[x].regionHeadingY=w}return{box:{x:o,y:s,width:a,height:f.length===0?0:Gf+d*ps+Ft},entries:f}}function H2(e,t,n,r){let i=r-n,o=rb(e,i,i),s=o.map((m,w)=>({x:n,row:w,text:m}));if(!t)return{title:s,description:[],rows:o.length};let a=se(nb,Gd),l=t.trim().split(/\s+/)[0]??"",c=n+Math.max(G2,e.length*z2),u=o.length===1&&a+se(l,Gd)<=r-c,f=u?c:n,d=u?o.length-1:o.length,p=rb(t,i,r-f-a),g=p.map((m,w)=>({x:w===0?f:n,row:d+w,text:w===0?`${nb}${m}`:m}));return{title:s,description:g,rows:d+p.length}}function rb(e,t,n){if(se(e,Gd)<=n)return[e];let r=Ii(e,t,Gd,n);return r.length>0?r:[e]}function Hd(e,t){e.box.y+=t;for(let n of e.inlineDatePins??[])n.glyphTopLeft.y+=t;if(e.kind==="item"){for(let n of e.labelChips)n.box.y+=t;e.overflowBox&&(e.overflowBox.y+=t);return}for(let n of e.children)Hd(n,t)}function Ns(e,t){e.box.y+=t;for(let n of e.children)Hd(n,t);for(let n of e.nested)Ns(n,t)}function ob(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)Ns(n,t);for(let n of[...e.anchors??[],...e.milestones??[]])n.center.y+=t,n.labelBox.y+=t,n.cutTopY+=t,n.cutBottomY+=t;for(let n of e.milestones??[])for(let r of n.slackArrows??[])r.y+=t;for(let n of e.edges??[])for(let r of n.waypoints)r.y+=t}function Dl(e,t,n){let r=[],i=(o,s,a)=>{let l=_e(re(s.properties,"date"));if(!l)return;let c=n.forwardWithinDomain(l);c!==null&&r.push({id:o,centerX:c,radius:6,title:s.title??o,fontSize:10,bold:a,date:l,isMilestone:a})};for(let[o,s]of e)i(o,s,!1);for(let[o,s]of t)i(o,s,!0);return r}function Yd(e,t){return[...Y2(e),...V2(t)]}function Ps(e,t){let n=new Map;for(let[r,i]of e){let o=t+13+i.rowIndex*26;n.set(r,{rowIndex:i.rowIndex,centerY:o,labelBox:{...i.labelBox,y:o-4},labelSide:i.labelSide})}return n}function nx(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function rx(e){return`working:${e.from.toISOString().slice(0,10)}`}function sb(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function Y2(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(sb(nx(n),n.x,n.label));return t}function V2(e){return(e??[]).map(t=>sb(rx(t),t.x,t.label))}function Bi(e,t,n,r){let i=n;for(let o of e){let s=ab(o,r),a=o.centerX+o.radius+6+s,l=o.centerX-o.radius-6-s;a>n&&l<t&&(i=Math.max(i,a+st))}return i}function ab(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function Ls(e,t,n,r){let i=[...e].sort((a,l)=>a.centerX-l.centerX),o=new Map,s=[];for(let a of i){let l=ab(a,r),c=a.centerX+a.radius+6,u=a.centerX-a.radius-6-l,f=c+l<=n,d=u>=t,p=a.centerX-a.radius,g=a.centerX+a.radius,m=U=>U==="right"?c:u,w=U=>U==="right"?f:d,x=(U,L)=>{let M=Math.min(p,U),j=Math.max(g,U+l);return s[L].some($=>$.left<j&&$.right>M)},y=-1,E="right",T=c;e:for(let U=s.length-1;U>=0;U--)for(let L of["right","left"]){if(!w(L))continue;let M=m(L);if(!x(M,U)){y=U,E=L,T=M;break e}}if(y===-1){for(let[U,L]of o)o.set(U,{...L,rowIndex:L.rowIndex+1});s=[[],...s],y=0,E=f?"right":"left",T=m(E)}let v=Math.min(p,T),P=Math.max(g,T+l);s[y].push({left:v,right:P}),o.set(a.id,{rowIndex:y,labelBox:{x:T,y:0,width:l,height:12},labelSide:E})}return{placements:o,rowCount:s.length}}function ix(e,t){let n=[];for(let r of e){let i=t.placedItems.get(r),o=i?i.box.x+i.box.width:t.entityRightEdges.get(r);if(o===void 0)continue;let s=i?DR(i,t.bandScale.bandwidth()):t.entityMidpoints.get(r)?.y??0;if(!i&&t.waves?.plan.index.has(r)){n.push({ref:r,x:o,y:s,flowKey:`wave:${r}`,wave:r});continue}let a=t.itemFlowKey.get(r)??`marker:${r}`;n.push({ref:r,x:o,y:s,flowKey:a})}return n}function ox(e){let t=new Map;for(let n of e){let r=t.get(n.flowKey);(!r||n.x>r.x)&&t.set(n.flowKey,n)}return Array.from(t.values())}function lb(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.x>t.x)&&(t=n);return t}function K2(e,t){let n;for(let r of e)r.wave===void 0||r.x-t<At||(!n||r.x>n.x)&&(n=r);return n?.wave}var sx=class{constructor(t,n){B(this,"id");B(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=be("milestone",n.properties,t.styleCtx),i=re(n.properties,"date"),o=Be(n.properties,"after"),s=_e(i),a=t.timeline.markerRow.y,l=6,c=n.title??this.id,u=null,f=a,d=!1,p,g=!1,m;if(s){let y=t.scale.forwardWithinDomain(s);if(y===null)return null;u=y,d=!0;let E=t.markerRowPlacements.get(this.id);E&&(f=E.centerY);let T=ix(o,t),v=ox(T),P=lb(v);P&&P.x>y&&(g=!0,p=[{x:P.x,y:P.y>0?P.y:f}]),m=K2(v,y),m!==void 0&&(g=!0)}else if(o.length>0){let y=ix(o,t),E=ox(y);E.sort((P,U)=>U.x-P.x);let T=E[0]?.x??t.timeline.originX;u=T,d=!1;let v=[];for(let P=1;P<E.length;P++){let U=E[P];U.x<T&&U.y>0&&U.wave===void 0&&v.push({x:U.x,y:U.y})}v.length>0&&(p=v)}if(u===null)return null;let w={x:u,y:f};t.entityLeftEdges.set(this.id,w.x),t.entityRightEdges.set(this.id,w.x),t.entityMidpoints.set(this.id,w);let x={id:this.id,title:c,x:u,radius:l,fixed:d,slackArrows:p,isOverrun:g,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};return t.waves&&!g&&jR(t.waves,u)&&(x.onWaveBoundary=!0),m!==void 0&&s&&(x.overrunByWave=m,x.overrunDate=Ti(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(x.hiddenDate=Ti(s)),x}};function Vd(e,t){let n=[];for(let[r,i]of e){let o=new sx(r,i).place(t);o&&n.push(o)}return n}function Kd(e,t){return e.map(n=>{let r=t.get(n.id);if(!r)throw new Error(`layout: milestone "${n.id}" has no marker-row placement`);let i={id:n.id,title:n.title,center:{x:n.x,y:r.centerY},radius:n.radius,fixed:n.fixed,slackArrows:n.slackArrows,isOverrun:n.isOverrun,style:n.style,cutTopY:n.cutTopY,cutBottomY:n.cutBottomY,labelBox:r.labelBox,labelSide:r.labelSide};return n.onWaveBoundary&&(i.onWaveBoundary=!0),n.overrunByWave!==void 0&&(i.overrunByWave=n.overrunByWave),n.overrunDate!==void 0&&(i.overrunDate=n.overrunDate),n.hiddenDate!==void 0&&(i.hiddenDate=n.hiddenDate),i})}function cb(e,t){let n=[];for(let[r,i]of e){let o=re(i.properties,"date"),s=Be(i.properties,"after"),a=_e(o),l=ix(s,t),c=ox(l);if(a){let f=t.scale.forwardWithinDomain(a);if(f===null)continue;let d=lb(c);d&&d.x>f&&d.y>0&&n.push({xStart:Math.min(d.x,f),xEnd:Math.max(d.x,f),y:d.y,slackPredId:d.ref,milestoneId:r});continue}if(c.length===0)continue;c.sort((f,d)=>d.x-f.x);let u=c[0].x;for(let f=1;f<c.length;f++){let d=c[f];d.x<u&&d.y>0&&d.wave===void 0&&n.push({xStart:d.x,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:r})}}return n}var Ml=16,q2=8,Z2=6;function fb(e,t,n,r,i,o){ax(e.content.anchors,t);let s=Vd(e.content.milestones,t),a=J2(e.content.anchors,s,t);if(a.length===0)return{anchors:[],milestones:[],laneShift:0};let l=Ml,c=Ls(a,l,Bi(a,l,o-Ml,se),se),u=n+q2,f=u+c.rowCount*26+Z2-r,d=i+f,p=Ps(c.placements,u);t.markerRowPlacements=p,t.chartTopY=r+f,t.swimlaneBottomY=d;let g=bd(e.content.anchors,t,new Set),m=Kd(s.map(w=>({...w,cutTopY:t.chartTopY,cutBottomY:d,slackArrows:w.slackArrows?.map(x=>({x:x.x,y:x.y+f}))})),p);return{anchors:g,milestones:m,laneShift:f}}function db(e,t){let n=[...(e.anchors??[]).map(i=>ub(i,!1)),...(e.milestones??[]).map(i=>ub(i,!0))];return n.length===0?t:Bi(n,e.box.x+Ml,t-Ml,se)+Ml}function pb(e){let t=0;for(let n of[...e.anchors??[],...e.milestones??[]])t=Math.max(t,n.labelBox.x+n.labelBox.width);return t}function J2(e,t,n){let r=Dl(e,new Map,n.scale),i=o=>({id:o.id,centerX:o.x,radius:o.radius,title:o.title,fontSize:10,bold:!0});return r.push(...t.filter(o=>o.fixed).map(i)),r.push(...t.filter(o=>!o.fixed).map(i)),r}function ub(e,t){return{id:e.id??"",centerX:e.center.x,radius:e.radius,title:e.title,fontSize:10,bold:t}}function ax(e,t){for(let n of Dl(e,new Map,t.scale))t.entityLeftEdges.set(n.id,n.centerX),t.entityRightEdges.set(n.id,n.centerX)}var Q2=.8,eB=1;function tB(e){let t=[];return mb(e,t),t}function mb(e,t){for(let n of e)if(n.kind==="item"){let r=nB(n);r>0&&n.box.width>0&&t.push({startX:n.box.x,endX:n.box.x+n.box.width,load:r})}else(n.kind==="parallel"||n.kind==="group")&&mb(n.children,t)}function nB(e){return e.capacity?e.capacity.value:e.size?1:0}function gb(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=tB(e.children);if(t.length===0)return null;let n=new Set;for(let s of t)n.add(s.startX),n.add(s.endX);let r=Array.from(n).sort((s,a)=>s-a);if(r.length<2)return null;let i=[];for(let s=0;s<r.length-1;s++){let a=r[s],l=r[s+1],c=(a+l)/2,u=0;for(let f of t)f.startX<=c&&c<f.endX&&(u+=f.load);i.push({startX:a,endX:l,load:u,classification:rB(u,e.capacityValue,e.warnFraction,e.overFraction)})}let o=[];for(let s of i){let a=o[o.length-1];a&&a.classification===s.classification&&a.endX===s.startX?a.endX=s.endX:o.push({...s})}return{segments:o,capacityValue:e.capacityValue,warnFraction:e.warnFraction,overFraction:e.overFraction}}function rB(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function yb(e,t){let n=t.get("swimlane"),r=hb(re(e.properties,"utilization-warn-at"),n?re(n.properties,"utilization-warn-at"):void 0,Q2),i=hb(re(e.properties,"utilization-over-at"),n?re(n.properties,"utilization-over-at"):void 0,eB);return{warn:r,over:i}}function hb(e,t,n){let i=sB(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var iB=/^\d+(?:\.\d+)?%$/,oB=/^\d+\.\d+$/;function sB(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(iB.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(oB.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}var qd=class{constructor(t){B(this,"rows");B(this,"opts");B(this,"paintedRightX");this.opts=t,this.paintedRightX=t.laneLeftX,this.rows=[{y:t.originY,height:t.minRowHeight,rightEdge:t.laneLeftX,spillX:t.laneLeftX,placedChildren:[]}]}placeItem(t){for(let r=0;r<this.rows.length;r+=1){let i=this.rows[r];if(!(t.desiredStart<i.rightEdge)&&!(t.desiredStart<i.spillX)&&!this.rowIntersectsCorridor(i,t))return{rowIndex:r,y:i.y}}let n=this.appendRow(Math.max(this.opts.minRowHeight,t.predictedHeight));return{rowIndex:this.rows.length-1,y:n.y}}placeBlock(){let t=this.rows[this.rows.length-1];if(t.rightEdge>this.opts.laneLeftX){let n=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:n.y}}return{rowIndex:this.rows.length-1,y:t.y}}commitItem(t){let n=this.rows[t.rowIndex],r=Math.max(t.placed.box.height,t.rowHeight??0);this.growRowHeight(t.rowIndex,r),n.rightEdge=t.logicalEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,n.placedChildren.push(t.placed)}commitBlock(t){let n=this.rows[t.rowIndex];this.growRowHeight(t.rowIndex,t.blockHeight),n.rightEdge=t.blockEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,n.placedChildren.push(t.placed),t.paintedRight!==void 0&&t.paintedRight>this.paintedRightX&&(this.paintedRightX=t.paintedRight)}usedHeight(){let t=this.rows[this.rows.length-1];return t.y+t.height-this.opts.originY}usedRightX(){let t=this.paintedRightX;for(let n of this.rows)n.rightEdge>t&&(t=n.rightEdge),n.spillX>t&&(t=n.spillX);return t}rowIntersectsCorridor(t,n){return this.opts.slackCorridors.some(r=>r.y>=t.y&&r.y<t.y+t.height&&n.desiredStart<r.xEnd&&n.desiredEnd>r.xStart&&r.slackPredId!==n.childId)}appendRow(t){let n=this.rows[this.rows.length-1],r={y:n.y+n.height,height:t,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX,placedChildren:[]};return this.rows.push(r),r}growRowHeight(t,n){let r=this.rows[t],i=n-r.height;if(!(i<=0)){r.height=n;for(let o=t+1;o<this.rows.length;o+=1){let s=this.rows[o];s.y+=i;for(let a of s.placedChildren)Hd(a,i)}}}};function Zd(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new qd({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,l=o,c=[];for(let u of Dt(e)){if(!Ye(u)){let M=$l(u,a,n),{rowIndex:j,y:$}=s.placeBlock(),R=Cl(M,$),A=r.sequenceOne(u,R,n);c.push(A);let O=A.box.x+A.box.width,_=Math.max(i,R.height);s.commitBlock({rowIndex:j,placed:A,blockHeight:_,blockEnd:O,spillReservation:Jk(A),paintedRight:Vy(A)}),a=Math.max(a,R.x),l=Math.max(l,R.maxX);continue}let f=u,d=$l(f,a,n),p=n.scale.startX(d),g=Ud(f,p,n),m=p+g.naturalWidth,w=i+g.barExtra,{rowIndex:x,y}=s.placeItem({childId:f.name??"",desiredStart:p,desiredEnd:m,predictedHeight:w}),E=Cl(d,y),T=Xd(f,E,n,g);c.push(T);let v=T.box.x+T.box.width+pn,P=p+Ss(n,p,g.durationDays);a=Math.max(a,P),l=Math.max(l,v,P);let U=null;(T.textSpills||T.chipsOutside||T.dotSpills||T.iconSpills||T.footnoteSpills)&&(U=Math.max(T.decorationsRightX,T.chipsOutside?T.chipsRightX:0)+6),s.commitItem({rowIndex:x,placed:T,logicalEnd:v,spillReservation:U,rowHeight:w})}return{children:c,timeCursorX:a,barRightX:l,packer:s}}var xb=10;function aB(e,t,n){let r=re(e.properties,"capacity"),i=Sr(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=el(i),s=tl(t.capacityIcon,n),a=wi(o,s,xb);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var lB=10,cB=38,uB=8;function fB(e,t,n){let r=e.title??e.name??"";if(!r)return 0;let i=re(e.properties,"owner");return wl(0,r,i??void 0,t,n).rightX}function dB(e,t){if(!e.name)return[];let n=[];for(let[r,i]of t.footnoteHosts.entries())if(i.includes(e.name)){let o=t.footnoteIndex.get(r);o!==void 0&&n.push(o)}return n.sort((r,i)=>r-i),n}function pB(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX($l(r,t,n))}var $s=class{constructor(t,n){B(this,"input");B(this,"helpers");this.input=t,this.helpers=n}get id(){return this.input.lane.name??""}place(t,n){let{lane:r,bandIndex:i}=this.input,{helpers:o}=this,s=be("swimlane",r.properties,n.styleCtx),a=t.x,l=n.bandScale.step(),c=n.currentFlowKey;n.currentFlowKey=`lane:${r.name??i}`;let{capacity:u,badgeWidthPx:f}=aB(r,s,n.symbols),d=dB(r,n),p=d.length>0?se(d.join(","),xb):0,g=fB(r,f,p),m=pB(r,a,n),w=!r.title||m===void 0||m>=g+uB,x=t.y+(w?lB:cB),y=Zd(r,{leftX:a,firstRowY:x},n,o),{children:E}=y,T=x-t.y,v=Math.max(l+32,T+y.packer.usedHeight()+16),P=Math.max(y.packer.usedRightX(),g),U={x:0,y:t.y,width:0,height:v},L=re(r.properties,"owner"),M;if(L){let $=n.teams.get(L),R=n.persons.get(L);M=$?.title??R?.title??L}let j=u?(()=>{let{warn:$,over:R}=yb(r,n.styleCtx.defaults);return gb({children:E,capacityValue:u.value,warnFraction:$,overFraction:R})})():null;return n.currentFlowKey=c,{positioned:{id:r.name,title:r.title??r.name??"",box:U,bandIndex:i,children:E,nested:[],style:s,owner:M,footnoteIndicators:d,capacity:u,utilization:j},usedHeight:v,usedRightX:P}}};var hB=18,mB=14,gB=14,yB=16,xB=32;function lx(e,t,n,r,i){let o=n+hB,s=[],a=[],l=!0,c=t.footnoteIndex.size;for(let u of e){l||(o+=yB),l=!1;let f=u.content.roadmap?.title??u.sourcePath,d=o+mB,p=Md(u,{theme:t.styleCtx.theme,cal:t.cal,schedule:t.schedule,timeline:t.timeline,scale:t.scale,calendar:t.calendar,axisColumns:t.axisColumns,bandScale:t.bandScale,waves:t.waves},{chartTopY:d,chartBottomY:d,swimlaneBottomY:d},{footnotes:zd(u.content.footnotes,c)});c+=u.content.footnotes.size,t.waves?Cd(t.waves,p.entityLeftEdges,p.entityRightEdges):ax(u.content.anchors,p);let g=[],m=d,w=0;for(let P of u.content.swimlanes.values()){p.nextParallelId=0,p.nextGroupId=0;let{positioned:U,usedHeight:L}=new $s({lane:P,bandIndex:w},r).place({x:p.timeline.originX,y:m},p);g.push(U),m+=L,w++}let x=fb(u,p,o,d,m,i);if(x.laneShift!==0){for(let P of g)Ns(P,x.laneShift);m+=x.laneShift}let y=m,E=Math.max(t.bandScale.bandwidth(),y-o+gB),T={x:0,y:o,width:0,height:E},v={sourcePath:u.sourcePath,label:f,box:T,nestedSwimlanes:g,style:be("swimlane",[],t.styleCtx)};x.anchors.length>0&&(v.anchors=x.anchors),x.milestones.length>0&&(v.milestones=x.milestones),s.push(v),a.push(p),o+=E}return{regions:s,contexts:a,endY:o}}function Eb(e,t){let n=Jd(e,t);e.box.width=n;for(let r of e.nestedSwimlanes)r.box.width=n}function Jd(e,t){let n=e.box.x,{chromeRightX:r}=Tl(n,e.label,e.sourcePath),i=bs(e.nestedSwimlanes),o=Math.max(r,i,pb(e))+xB;return Math.min(t-n,o-n)}function wb(e,t,n,r){if(!e)return null;let i=t.scale.forwardWithinDomain(e);if(i===null)return null;let o=t.timeline.box.y,s=t.timeline.tickPanelY,a=Hn(n).nowLabel,l=se(a,cl),c=Math.max(Og,Math.ceil(l+2*ds)),u=t.timeline.originX-st,f=c/2,d;i-f<u?d="flag-right":i+f>r?d="flag-left":d="center";let p=t.timeline.bottomTickPanelY,g=t.timeline.bottomTickPanelHeight??0,m=p!==void 0&&g>0?p+g:t.swimlaneBottomY;return{x:i,topY:s,bottomY:m,pillTopY:o,pillMode:d,label:a,pillWidth:c,style:be("item",[],t.styleCtx)}}function Qd(e){let t=e.trim().replace(/^#/,"");if(t.length===3&&(t=t.split("").map(n=>n+n).join("")),!/^[0-9a-fA-F]{6}$/.test(t))throw new Error(`Unsupported hex colour: ${e}`);return[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]}function Tb(e){let[t,n,r]=Qd(e).map(i=>{let o=i/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r}function ep(e,t){let n=Tb(e),r=Tb(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var EB=4.5;function kb(e,t,n,r,i){if(!e.frozen||!e.solve)throw new Error("buildWaves: the wave barrier has not settled");let o=t.timeline.waveStrip;if(!o)throw new Error("buildWaves: the timeline has no wave strip");let s=Od(e.plan,e.solve,e.pass,e.origin,e.floors,At),a=s.every(y=>y.memberCount===0),l=t.timeline.box.x,c=l+t.timeline.box.width,u=o.y+o.height/2,f=[],d=0,p=s.map((y,E)=>{let T=e.plan.waves[E],v=T.title??y.id,P=y.memberCount===0,U=Dd(y.start,t),L=YR(y.start,y.end,t),M=P?void 0:d++,j=wB(y.id,t),$=TB(T.properties,M,t),R=Math.max(y.start,l),A=Math.min(y.end,c),O=Math.max(0,A-R),_,I=!1;if(!P){if(j.length>0){let Q=j.length*Jt;_=vb(v,y.id,E+1,O,Q),I=_!==void 0}_??(_=vb(v,y.id,E+1,O,0))}let S=(R+A)/2,F;if(P&&(S=y.start,!a)){let Q=f.filter(H=>Math.abs(H-y.start)<At).length;f.push(y.start),S=y.start+Q*ey,F={x:S,y:u}}let N=P?cx(U):`${cx(U)} \u2013 ${cx(L)}`,W=[v,N];P?W.push(n.waveNoItems):y.heldBy!==void 0&&W.push(`${n.waveHeldBy} ${y.heldBy}`);let z,X=s[E-1];if(!a&&X!==void 0&&y.floorRef!==void 0&&y.start-X.end>At){let Q=Math.max(X.end,l),H=Math.min(y.start,c);se(y.floorRef,hn)+2*Cn<=H-Q&&(z={text:y.floorRef,x:(Q+H)/2})}return{id:y.id,title:v,index:E,...M!==void 0?{visibleOrdinal:M}:{},startX:y.start,endX:y.end,startDate:U,endDate:L,memberCount:y.memberCount,empty:P,...y.heldBy!==void 0?{heldBy:y.heldBy}:{},...y.floorRef!==void 0?{floorRef:y.floorRef}:{},columnBox:{x:y.start,y:t.chartTopY,width:y.end-y.start,height:t.swimlaneBottomY-t.chartTopY},strip:{box:{x:y.start,y:o.y,width:y.end-y.start,height:o.height},..._?{label:_.label}:{},labelKind:_?.kind??"none",labelX:S,tooltip:W.join(" \xB7 "),footnotesShown:I,...F?{marker:F}:{},...z?{gapLabel:z}:{}},style:$,footnoteIndicators:j}}),g=a?[]:kB(p,e.origin,o.y,t),m=ux(r),w=i.map(y=>ux(y.nestedSwimlanes)),x={waves:p,boundaries:g,crossings:_b(m,g),regionCrossings:w.map(y=>_b(y,g)),hasBackground:m.length+w.flat().length>0};return a&&(x.placeholder=mR(n,p.map(y=>y.title))),x}function vb(e,t,n,r,i){let o=a=>se(a,hn)*1.05+i+2*Cn<=r;if(o(e))return{kind:"title",label:e};if(t!==e&&o(t))return{kind:"id",label:t};for(let a=e.length-1;a>=3;a--){let l=e.slice(0,a).trimEnd();if(l.length<3)break;let c=`${l}\u2026`;if(o(c))return{kind:"ellipsis",label:c}}let s=`#${n}`;if(o(s))return{kind:"ordinal",label:s}}function wB(e,t){let n=[];for(let[r,i]of t.footnoteHosts.entries()){if(!i.includes(e))continue;let o=t.footnoteIndex.get(r);o!==void 0&&n.push(o)}return n.sort((r,i)=>r-i)}function TB(e,t,n){let r=n.styleCtx.theme,i=new Map,o=re(e,"style"),s=o?n.styleCtx.styles.get(o):void 0;for(let d of s?.properties??[])i.set(Z(d),d.value);let a=d=>{let p=i.get(d);if(p===void 0)return;let g=Kn(p,r);return g==="none"?void 0:g},l=a("bg"),c=t!==void 0&&t%2===1?r.wave.stripFillAlt:r.wave.stripFill,u=l?vB(c,l,dl)??c:c,f=i.get("border");return{...l?{tint:l}:{},stripFill:c,text:a("text")??_B(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var tp=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function vB(e,t,n){if(!tp.test(e)||!tp.test(t))return;let r=Qd(e),i=Qd(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function _B(e,t){let n=e.labelText;return!tp.test(n)||!tp.test(t)||ep(n,t)>=EB?n:ep(e.hatch,t)>=ep(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function kB(e,t,n,r){let i=[];for(let a of e)a.empty||(i.push({x:a.startX,wave:a,opening:!0}),i.push({x:a.endX,wave:a,opening:!1}));i.sort((a,l)=>a.x-l.x);let o=[],s=0;for(;s<i.length;){let a=s;for(;a<i.length&&i[a].x-i[s].x<At;)a++;let l=i.slice(s,a);s=a;let c=l[0].x;if(Math.abs(c-t)<At)continue;let u=(l.find(f=>f.opening)??l[0]).wave;o.push({x:c,topY:n,bottomY:r.swimlaneBottomY,stroke:u.style.boundary,dash:u.style.boundaryDash})}return o}function ux(e){let t=[],n=r=>{for(let i of r)i.kind==="item"?i.waveRole==="background"&&t.push(i):n(i.children)};for(let r of e)n(r.children),t.push(...ux(r.nested));return t}function _b(e,t){let n=[];for(let r of e){let i=r.box.x,o=r.box.x+r.box.width;for(let s of t)i<s.x&&s.x<o&&n.push({x:s.x,topY:r.box.y,bottomY:r.box.y+r.box.height,stroke:s.stroke})}return n}var AB="\u2070\xB9\xB2\xB3\u2074\u2075\u2076\u2077\u2078\u2079";function IB(e){return String(e).replace(/[0-9]/g,t=>AB[Number(t)])}function Ab(e,t,n,r,i){let{waves:o}=e,s=o.some(v=>!v.empty&&v.strip.labelKind!=="title"),a=o.some(v=>v.empty),l=o.some(v=>v.footnoteIndicators.length>0&&!v.strip.footnotesShown);if(!e.hasBackground&&!s&&!a&&!l)return;let c=hn,u=v=>se(v,c),f=t.timeline.originX,d=Math.max(f,i-st),p=0,g=f,m=!1,w=0,x=v=>r+v*pl+Jf,y=v=>{m&&g+Zf+v>d&&(p++,g=f,m=!1);let P=m?g+Zf:g;return g=P+v,m=!0,w=Math.max(w,g-f),P},E=[],T=(v,P)=>{let U=Kf+ty,L=y(U+u(P)),M=x(p);E.push({kind:v,text:P,swatch:{x:L,y:M-Jf+(pl-qf)/2,width:Kf,height:qf},runs:[{text:P,x:L+U,y:M}]})};if(e.hasBackground&&T("background",n.waveLegendBackground),e.boundaries.length>0&&T("boundary",n.waveLegendBoundary),s||a||l){let v=o.map(M=>{let j=`#${M.index+1} ${M.title}`;return M.footnoteIndicators.length>0&&!M.strip.footnotesShown&&(j+=` ${M.footnoteIndicators.map(IB).join(",")}`),M.empty&&(j+=` (${n.waveNoItems})`),j}),P=" \xB7 ",U=`${n.waveLegendPrefix} ${v[0]}`,L=[{text:U,x:y(u(U)),y:x(p)}];for(let M of v.slice(1)){let j=L[L.length-1];g+u(P+M)<=d?(j.text+=P+M,g+=u(P+M),w=Math.max(w,g-f)):(p++,g=f,m=!1,L.push({text:M,x:y(u(M)),y:x(p)}))}E.push({kind:"waves",text:`${n.waveLegendPrefix} ${v.join(P)}`,runs:L})}return{box:{x:f,y:r,width:w,height:(p+1)*pl},entries:E}}function cx(e){return e.toISOString().slice(0,10)}var Ib=1e-6,Os=class{constructor(t){B(this,"domain");B(this,"range");B(this,"pixelsPerDay");B(this,"calendar");B(this,"nonWorking");this.domain=t.domain,this.range=t.range,this.calendar=t.calendar,this.nonWorking=t.nonWorking??"hide";let n=Math.max(1,this.showsNonWorking?_t(t.domain[0],t.domain[1]):this.indexOf(t.domain[1]));this.pixelsPerDay=(t.range[1]-t.range[0])/n}get showsNonWorking(){return this.nonWorking==="show"&&this.calendar?.hasNonWorkingDays===!0}indexOf(t){return this.calendar?this.calendar.workingIndexOf(this.domain[0],t):_t(this.domain[0],t)}dayAt(t){let n=(t-this.range[0])/this.pixelsPerDay;return{days:n,day:Math.floor(n+Ib)}}forward(t){return this.showsNonWorking?this.range[0]+_t(this.domain[0],t)*this.pixelsPerDay:this.range[0]+this.indexOf(t)*this.pixelsPerDay}forwardWithinDomain(t){return t<this.domain[0]||t>this.domain[1]?null:this.forward(t)}invert(t){let n=Math.round((t-this.range[0])/this.pixelsPerDay);return this.showsNonWorking?Ue(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):Ue(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=Ue(this.domain[0],r),o=this.calendar.workingIndexOf(this.domain[0],i);return this.calendar.isWorkingDay(i)?o+Math.max(0,n-r):o}startX(t){if(!this.showsNonWorking||!this.calendar)return t;let n=Ue(this.domain[0],this.dayAt(t).day);if(this.calendar.isWorkingDay(n))return t;let r=this.calendar.workingIndexOf(this.domain[0],n);return this.forward(this.calendar.dateAtWorkingIndex(this.domain[0],r))}advanceX(t,n){if(!this.showsNonWorking||!this.calendar)return t+n*this.pixelsPerDay;let r=this.startX(t);if(n<=0)return r;let i=this.indexAtX(r)+n,o=Math.ceil(i-Ib)-1,s=i-o,a=this.calendar.dateAtWorkingIndex(this.domain[0],o);return this.forward(a)+s*this.pixelsPerDay}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};var np=6,bB=4,Rb=8,ip=class{constructor(t){B(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=SB(t,n,i),a=i?Math.max(Fg,i.height+20):Fg;return{position:r.headerPosition,titleLines:s.titleLines,authorLines:s.authorLines,cardWidth:s.cardWidth,cardHeight:s.cardHeight,textCardHeight:s.textCardHeight,logoSlot:s.logoSlot,...i?{logo:i}:{},chartLeftX:o?s.boxWidth:0,aboveHeight:a,chartTopY:o?Rb:a+Rb,minRowsBottomY:o?s.cardHeight+bB:0}}place(t,n){let{title:r,author:i,style:o}=this.input,s=t.position==="beside",a=s?{x:0,y:0,width:t.chartLeftX,height:n.chartBottomY}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},l=s?{x:np,y:n.rowsBottomY-t.cardHeight,width:t.cardWidth,height:t.cardHeight}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},c,u;return t.logo&&(c={box:{x:a.x+l.x+16,y:a.y+l.y+(l.height-t.logo.height)/2,width:t.logo.width,height:t.logo.height},assetRef:t.logo.assetRef,intrinsic:t.logo.intrinsic},u={x:t.logoSlot,y:Math.max(0,(l.height-t.textCardHeight)/2)}),{box:a,position:o.headerPosition,title:r,author:i,titleLines:t.titleLines,authorLines:t.authorLines,cardBox:l,logo:c,...u?{textInset:u}:{},style:o}}};function SB(e,t,n){let r=Mg-32,i=Ii(e,r,16),o=Ii(t??"",r,11),s=0;for(let w of i)s=Math.max(s,se(w,16));for(let w of o)s=Math.max(s,se(w,11));let a=i.length>0||o.length>0,l=n?n.width+(a?12:0):0,c=s+32,u=Math.max(Uk-np,Math.min(Mg-np,c)+l),f=i.length>0?(i.length-1)*20:0,d=o.length>0?18+(o.length-1)*14:0,p=26+f+d+14,g=n?Math.max(p,n.height+20):p,m=u+np;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:g,textCardHeight:p,logoSlot:l,boxWidth:m}}var NB=8;function Nb(e,t,n,r,i){let{locale:o,styleCtx:s}=r,{calendar:a,preset:l,startDate:c,timelineDays:u,nonWorking:f}=i,d=i.naturalEndDate,p=i.schedule.plan,g=r.roadmapStyle,m=sl[g.headerHeight]??sl.md,w=m>0&&g.timelinePosition!=="bottom",x=m>0&&(g.timelinePosition==="bottom"||g.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",E=re(e.roadmapDecl?.properties??[],"author"),T=new ip({title:y,author:E,style:g,logo:eA(e,n.logo)}),v=T.measure(),{chartLeftX:P}=v,U=Dk({naturalPixelsPerDay:l.pixelsPerUnit/a.daysPerUnit(l.unit),dayCount:u,chromeWidth:P+2*st,maxWidth:n.width}),L=u*U,M=P+st,j=L,R=n.today!==void 0&&n.today>=c&&n.today<=d?Mt:0,A=w?m:0,O=p?Yg:0,_=new Os({domain:[c,d],range:[M,M+L],calendar:a,nonWorking:f}),I=Yd(Gy(_,[],l.unit,!1),zy(_)),S=t.content.anchors.size+t.content.milestones.size>0||I.length>0,F=M+j+st,N=Dl(t.content.anchors,t.content.milestones,_),W=[...N,...I],z=Ls(W,P,Bi(W,P,F,se),se),X=S?Math.max(1,z.rowCount):0,Q=X*26,H=R+A+O+Q,te=H+NB,k=mx(v,H),C=k+R,D=C+A,G=D+O,J=Id(_,l,a,o),q={box:{x:M,y:k,width:L,height:0},ticks:J,pixelsPerDay:U,originX:M,startDate:c,endDate:d,labelStyle:be("roadmap",[],s),pillRowHeight:R,tickPanelY:C,tickPanelHeight:A,markerRow:{y:G+13,height:Q,collisionY:G-8},minorGrid:g.minorGrid,...p?{waveStrip:{y:D,height:O}}:{}};return gx(q,_,l.unit),{header:v,headerNode:T,axis:{originX:M,ppd:U,naturalWidth:L,scale:_},naturalChartRightX:F,bands:{timelineY:k,pillRowHeight:R,tickPanelY:C,tickPanelHeight:A,waveStripY:D,markerRowY:G,estimatedMarkerRows:X,rowsHeight:H,chartTopY:k+te,bottomTickPanelHeight:x?m:0},timeline:q,markers:{datePinned:N,placements:Ps(z.placements,G),hasEntities:S}}}function mx(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function gx(e,t,n){let r=Gy(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=zy(t);i&&(e.workingExceptions=i)}var Pb=8,yx=class{constructor(t){B(this,"rightX");B(this,"frozen",!1);this.rightX=t}grow(t){if(this.frozen)throw new Error("layout: the canvas grew after it was frozen");return t<=this.rightX?!1:(this.rightX=t,!0)}freeze(){this.frozen=!0}get provisional(){return this.rightX}get final(){if(!this.frozen)throw new Error("layout: the canvas was read before it was final");return this.rightX}},PB;var op=class{constructor(t,n,r,i,o,s,a){B(this,"file");B(this,"resolved");B(this,"options");B(this,"scope");B(this,"window");B(this,"measured");B(this,"chart");B(this,"canvas");B(this,"chartY");B(this,"draft",{});B(this,"scaleIsFinal",!1);B(this,"band");B(this,"rowsTop");B(this,"rowsBottom");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new yx(s.naturalChartRightX);let l=a.ctx;this.chartY={get top(){return l.chartTopY},set top(c){l.chartTopY=c},get swimlaneBottom(){return l.swimlaneBottomY},set swimlaneBottom(c){l.swimlaneBottomY=c},get bottom(){return l.chartBottomY},set bottom(c){l.chartBottomY=c}}}get ctx(){return this.chart.ctx}get scale(){return this.chart.ctx.scale}finalScale(){if(!this.scaleIsFinal)throw new Error("layout: the final scale was read before the timeline extension");return this.chart.ctx.scale}extendScale(t){if(this.scaleIsFinal)throw new Error("layout: the scale was extended after it was final");this.chart.ctx.scale=t}settleScale(){this.scaleIsFinal=!0}markerBand(){if(!this.band)throw new Error("layout: the marker band was read before the final pack");return this.band}setMarkerBand(t){if(this.band)throw new Error("layout: the marker band was packed twice");this.band=t,this.chart.ctx.markerRowPlacements=t.placements}headerRowsTop(){return this.rowsTop||(this.rowsTop=LB(this.measured,this.options.today,this.finalScale())),this.rowsTop}headerRowsBottom(){if(this.rowsBottom===void 0)throw new Error("layout: the header rows bottom was read before the rows grew");return this.rowsBottom}setHeaderRowsBottom(t){if(this.rowsBottom!==void 0)throw new Error("layout: the header rows grew twice");this.rowsBottom=t}report(t,n){PB?.(t,n)}};function LB(e,t,n){let{bands:r,header:i}=e;if(!(r.pillRowHeight===0&&t!==void 0&&n.forwardWithinDomain(t)!==null))return{timelineY:r.timelineY,pillRowHeight:r.pillRowHeight,tickPanelY:r.tickPanelY,markerRowY:r.markerRowY,shift:0};let s=mx(i,Mt+r.rowsHeight),a=s+Mt,l=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Mt,tickPanelY:a,markerRowY:r.markerRowY+l,shift:l}}function $B(e){return e.canvas.grow(e.chart.maxRightX+st)}function OB(e){let{swimlanes:t,includes:n,milestones:r}=e.chart,{calendar:i,preset:o,startDate:s,spanDays:a,nonWorking:l}=e.window,{originX:c,ppd:u}=e.measured.axis,f=e.measured.timeline,d=bs(t);for(let y of n)d=Math.max(d,bs(y.nestedSwimlanes));for(let y of e.measured.markers.datePinned)d=Math.max(d,y.centerX+y.radius);for(let y of r)d=Math.max(d,y.x+y.radius);let p=i.daysPerUnit(o.unit),g=e.scale.showsNonWorking?e.scale.indexAtX(d):(d-c)/u,m=g>0?Mi(s,g,o.unit,p,i):0,w=Sd(t);for(let y of n)w=Math.max(w,Sd(y.nestedSwimlanes));if(w>0){let y=new Rs(e.window,e.scale),E=Math.max(a,m);y.isPast(w,E)&&(m=Math.max(m,Math.min(y.boundaryAtOrAfterX(w),y.captionColumn(E).end)))}let x=!1;if(m>a){let y=i.dateAtWorkingIndex(s,m),E=e.scale.showsNonWorking?_t(s,y)*u:m*u,T=new Os({domain:[s,y],range:[c,c+E],calendar:i,nonWorking:l});e.extendScale(T),f.endDate=y,f.box.width=E,f.ticks=Id(T,o,i,e.scope.locale),gx(f,T,o.unit),e.canvas.grow(c+E+st),x=!0}return e.settleScale(),x}function CB(e){let t=e.measured.timeline,n=e.measured.markers.datePinned.map(s=>({id:s.id,centerX:s.centerX,radius:s.radius,title:s.title,fontSize:s.fontSize,bold:s.bold}));for(let s of e.chart.milestones)s.fixed||n.push({id:s.id,centerX:s.x,radius:s.radius,title:s.title,fontSize:10,bold:!0});let r=Yd(t.nonWorking,t.workingExceptions);n.push(...r),e.draft.markerEntries={all:n,calendarCount:r.length};let i=Bi(n,e.measured.header.chartLeftX,e.canvas.provisional,se);for(let s of e.chart.includes)i=Math.max(i,db(s,e.canvas.provisional));let o=e.canvas.grow(i);return e.canvas.freeze(),o}function DB(e){let t=e.canvas.final,n=e.measured.naturalChartRightX,r=e.chart.swimlanes.length>0&&t!==n;for(let i of e.chart.swimlanes)i.box.width=t;for(let i of e.chart.includes)Jd(i,t)!==Jd(i,n)&&(r=!0),Eb(i,t);return r}function MB(e){let t=Wt(e.draft.markerEntries,"the marker entries"),n=Ls(t.all,e.measured.header.chartLeftX,e.canvas.final,se),r=Ps(n.placements,e.headerRowsTop().markerRowY),i=e.measured.markers.hasEntities||t.calendarCount>0?Math.max(1,n.rowCount):0;e.setMarkerBand({rowCount:i,placements:r});let o=!1;for(let[s,a]of e.measured.markers.placements){let l=r.get(s);(!l||!ZB(a,l))&&(o=!0)}return o}function FB(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=Kd(e.chart.milestones,t.placements),o=i.some(s=>n.entityMidpoints.get(s.id??"")?.y!==s.center.y);for(let s of r.nonWorking??[]){if(s.label===void 0)continue;let a=t.placements.get(nx(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(rx(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of e.measured.markers.datePinned){let a=t.placements.get(s.id);a&&n.entityMidpoints.set(s.id,{x:s.centerX,y:a.centerY})}for(let s of i)s.fixed||n.entityMidpoints.set(s.id??"",{x:s.center.x,y:s.center.y});return e.draft.milestones=i,o}function BB(e){let t=e.markerBand(),n=e.headerRowsTop(),r=e.measured.bands,i=r.estimatedMarkerRows,s=e.ctx.timeline,a=!1;n.pillRowHeight!==r.pillRowHeight&&(s.box.height+=s.box.y-n.timelineY,s.box.y=n.timelineY,s.pillRowHeight=n.pillRowHeight,s.tickPanelY=n.tickPanelY,s.waveStrip&&(s.waveStrip.y+=n.shift),s.markerRow.y+=n.shift,s.markerRow.collisionY+=n.shift,a=!0);let l=n.shift;if(t.rowCount>i&&(l+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height),l===0)return a;s.box.height+=l,e.chartY.top+=l,e.chartY.bottom+=l,e.chartY.swimlaneBottom+=l;for(let c of e.chart.swimlanes)Ns(c,l);for(let c of e.chart.includes)ob(c,l);for(let c of Wt(e.draft.milestones,"the milestones"))if(c.cutTopY=e.chartY.top,c.cutBottomY=e.chartY.swimlaneBottom,c.slackArrows)for(let u of c.slackArrows)u.y+=l;return!0}function WB(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+Pb,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=Pb+t,!0)}function UB(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=kb(t.waves,t,Hn(e.scope.locale),e.chart.swimlanes,e.chart.includes);return n.regionCrossings.forEach((r,i)=>{r.length>0&&(e.chart.includes[i].waveCrossings=r)}),n.placeholder!==void 0&&t.timeline.waveStrip&&(t.timeline.waveStrip.placeholder=n.placeholder),e.draft.waves=n,!0}function XB(e){e.finalScale(),e.markerBand();let t=new Set(Wt(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=bd(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function GB(e){let t=Qy(e.chart.laneEntries),n=ex(t,e.chart.swimlanes,e.chart.includes,e.ctx);e.draft.edges=n;let r=0;return e.resolved.content.isolatedRegions.forEach((i,o)=>{let s=e.chart.includes[o],a=e.chart.regionContexts[o];if(!s||!a)return;let l=ex(Qy([...i.content.swimlanes.values()]),s.nestedSwimlanes,[],a);l.length>0&&(s.edges=l),r+=l.length}),n.length+r>0}function zB(e){e.finalScale();let t=wb(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function HB(e){let t=e.draft.waves;if(!t)return!1;let n=Ab(t,e.ctx,Hn(e.scope.locale),e.chartY.bottom+Vf,e.canvas.final);return n?(e.chartY.bottom+=Vf+n.box.height,e.draft.waveLegend=n,!0):!1}function jB(e){let t=e.resolved.content.isolatedRegions.flatMap((r,i)=>{let o=e.chart.regionContexts[i],s=e.chart.includes[i];return o&&s?[{title:s.label,footnotes:r.content.footnotes,ctx:o}]:[]}),n=ib(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final,t);return e.draft.footnotes=n,n.entries.length>0}function YB(e){let{header:t,headerNode:n}=e.measured;return e.draft.header=n.place(t,{rowsBottomY:e.headerRowsBottom(),chartBottomY:e.chartY.bottom,canvasRightX:e.canvas.final}),t.position==="beside"}function VB(e){let t=Wt(e.draft.footnotes,"the footnote panel"),n=e.canvas.final,r=t.entries.length>0?t.box.y+t.box.height:e.chartY.bottom,i={x:n-st-Gg,y:r+st,width:Gg,height:Gk};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+st,!0}var KB=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:$B},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:OB},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas"],writes:["markerEntries","canvas"],run:CB},{name:"fitWidths",reads:["placement","canvas"],writes:["laneWidths"],run:DB},{name:"packMarkers",reads:["canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:MB},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:FB},{name:"growHeaderRows",reads:["markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:BB},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:WB},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:UB},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:XB},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:GB},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:zB},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:HB},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:jB},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:YB},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:VB}];function Lb(e,t=KB){for(let n of t)e.report(n.name,n.run(e));return qB(e)}function qB(e){let{draft:t}=e,{themeName:n,theme:r}=e.scope,{swimlanes:i,includes:o,waveSolve:s}=e.chart,a=e.canvas.final,l=e.measured.header.chartLeftX,c=t.waves,u=t.waveLegend;return{width:a,height:Wt(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Wt(t.header,"the header"),attributionBox:Wt(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Wt(t.nowline,"the now-line"),swimlanes:i,anchors:Wt(t.anchors,"the anchors"),milestones:Wt(t.milestones,"the milestones"),edges:Wt(t.edges,"the edges"),footnotes:Wt(t.footnotes,"the footnote panel"),includes:o,chartBox:{x:l,y:e.chartY.top,width:a-l,height:e.chartY.bottom-e.chartY.top},...s?{waveSolve:s}:{},...c?{waves:c.waves}:{},...c&&c.boundaries.length>0?{waveBoundaries:c.boundaries}:{},...c&&c.crossings.length>0?{waveCrossings:c.crossings}:{},...u?{waveLegend:u}:{}}}function Wt(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function ZB(e,t){return e.rowIndex===t.rowIndex&&e.centerY===t.centerY&&e.labelSide===t.labelSide&&e.labelBox.x===t.labelBox.x&&e.labelBox.y===t.labelBox.y&&e.labelBox.width===t.labelBox.width&&e.labelBox.height===t.labelBox.height}var Cs=class extends Map{constructor(t,n=eW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let[r,i]of t)this.set(r,i)}get(t){return super.get($b(this,t))}has(t){return super.has($b(this,t))}set(t,n){return super.set(JB(this,t),n)}delete(t){return super.delete(QB(this,t))}};function $b({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function JB({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function QB({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function eW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function sp(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function ap(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var Ob=Symbol("implicit");function lp(){var e=new Cs,t=[],n=[],r=Ob;function i(o){let s=e.get(o);if(s===void 0){if(r!==Ob)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Cs;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return lp(t,n).unknown(r)},ap.apply(i,arguments),i}function Fl(){var e=lp().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete e.unknown;function f(){var d=t().length,p=i<r,g=p?i:r,m=p?r:i;o=(m-g)/Math.max(1,d-l+c*2),a&&(o=Math.floor(o)),g+=(m-g-o*(d-l))*u,s=o*(1-l),a&&(g=Math.round(g),s=Math.round(s));var w=sp(d).map(function(x){return g+o*x});return n(p?w.reverse():w)}return e.domain=function(d){return arguments.length?(t(d),f()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(d){return arguments.length?(a=!!d,f()):a},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),f()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),f()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,f()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},e.copy=function(){return Fl(t(),[r,i]).round(a).paddingInner(l).paddingOuter(c).align(u)},ap.apply(f(),arguments)}var xx=class e{constructor(t,n,r){B(this,"bandwidthPx");B(this,"stepPx");B(this,"d3");this.bandwidthPx=t,this.stepPx=n,this.d3=r}static fixedRow(t){return new e(t.bandwidth,t.step)}static forRows(t){let n=Array.from({length:t.count},(i,o)=>String(o)),r=Fl().domain(n).range(t.range).paddingInner(t.paddingInner??0).paddingOuter(t.paddingOuter??0);return new e(r.bandwidth(),r.step(),r)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(t){if(!this.d3)throw new Error("BandScale.forward is only available on closed-domain bands (BandScale.forRows)");let n=this.d3(t);if(n===void 0)throw new Error(`BandScale: unknown band id "${t}"`);return n}},tW={bandwidth:56,step:64};function Cb(){return xx.fixedRow(tW)}var Db=8;function Mb(e,t,n,r,i){let{theme:o,styleCtx:s}=t,{cal:a,calendar:l,schedule:c}=n,u=c.plan,{originX:f,scale:d}=r.axis,{timeline:p,bands:g}=r,m=Md(e,{theme:o,cal:a,schedule:c,timeline:p,scale:d,calendar:l,axisColumns:new Rs(n,d),bandScale:Cb(),waves:u?UR(u,d,f,Hn(t.locale).waveBackgroundItem):void 0},{chartTopY:g.chartTopY,chartBottomY:0,swimlaneBottomY:0},{footnotes:zd(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let F of r.markers.datePinned){let N=m.markerRowPlacements.get(F.id);N&&(m.entityLeftEdges.set(F.id,F.centerX),m.entityRightEdges.set(F.id,F.centerX),m.entityMidpoints.set(F.id,{x:F.centerX,y:N.centerY}))}let w=new Map(m.entityLeftEdges),x=new Map(m.entityRightEdges),y=new Map(m.entityMidpoints),E=()=>{m.entityLeftEdges=new Map(w),m.entityRightEdges=new Map(x),m.entityMidpoints=new Map(y),m.placedItems=new Map,m.itemFlowKey=new Map,m.currentFlowKey="",m.waves&&Cd(m.waves,m.entityLeftEdges,m.entityRightEdges)},T=[...e.content.swimlanes.values()],v=be("swimlane",[],s),P=Mk[v.spacing]??0,U=()=>{m.nextParallelId=0,m.nextGroupId=0;let F=[],N=m.chartTopY,W=0,z=m.timeline.originX;for(let X of T){W>0&&(N+=P);let{positioned:Q,usedHeight:H,usedRightX:te}=new $s({lane:X,bandIndex:W},i).place({x:m.timeline.originX,y:N},m);F.push(Q),N+=H,te>z&&(z=te),W++}return{swimlanes:F,nextY:N,maxRightX:z}},L=e.content.isolatedRegions,M,j,$=m.waves;if($){let F,N=KR()?nW($.ids,c,d):void 0,W=$d($.ids.length,$.origin,$.floors,(z,X)=>(XR($,z,X),E(),F=U(),L.length>0&&lx(L,m,F.nextY+Db,i,r.naturalChartRightX),$.pass),At,N);GR($,W),j={passes:W.passes,capped:W.capped},M=F}else M=U();let R=M.swimlanes,A=M.nextY,O=cb(e.content.milestones,m);O.length>0&&(E(),m.slackCorridors=O,M=U(),R=M.swimlanes,A=M.nextY);let _=[],I=[];if(L.length>0){let F=lx(L,m,A+Db,i,r.naturalChartRightX);_=F.regions,I=F.contexts,A=F.endY}m.chartBottomY=A,m.swimlaneBottomY=A,p.box.height=m.chartBottomY-p.box.y;let S=Vd(e.content.milestones,m);return{ctx:m,swimlanes:R,includes:_,regionContexts:I,milestones:S,laneEntries:T,maxRightX:M.maxRightX,bottomY:A,...j?{waveSolve:j}:{}}}function nW(e,t,n){let r=e.map(i=>t.waves?.get(i));return{S:r.map(i=>i?n.forward(i.start):null),E:r.map(i=>i?n.forward(i.end):null)}}var cp=class{constructor(t,n){B(this,"node");B(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=be("group",r.properties,n.styleCtx),s=Wr(r,Ol(r.properties,t.x,n),n),a=n.waves!==void 0&&r.title===void 0&&re(r.properties,"wave")!==void 0&&re(r.properties,"style")===void 0&&Be(r.properties,"labels").length===0,l=a?void 0:r.title??r.name,c=n.currentFlowKey;n.nextGroupId+=1,n.currentFlowKey=`${c}/group:${r.name??`group-${n.nextGroupId}`}`;let u=Bt(Be(r.properties,"after")),f=Bt(Be(r.properties,"before")),d=!!(u||f),p=ki(o.bg),m=p&&!!l||p&&d,w=m?_i+bg:0,x=m?Lg:0,y=El(p,!!l,d),E=t.y+y,T=n.bandScale.step(),P=Zd(r,{leftX:s,firstRowY:E+w},n,i),{children:U,timeCursorX:L,barRightX:M}=P,j=Math.max(T,P.packer.usedHeight()),$=Math.max(L,P.packer.usedRightX()),R=n.scale.showsNonWorking?n.scale.startX(s):s,A=n.scale.showsNonWorking?Math.max(R,$):$,O={x:R,y:E,width:A-R,height:w+j+x};t.x=L,t.maxX=Math.max(t.maxX,M,L);let _=n.bandScale.step()-n.bandScale.bandwidth();t.height=Math.max(t.height,y+O.height+_);let I=r.name;I&&(n.entityLeftEdges.set(I,O.x),n.entityRightEdges.set(I,L)),n.currentFlowKey=c;let S=Pd({box:O,afterDate:u,beforeDate:f,row:p?{kind:"title-tab-row",titleTabWidth:l?Ai(l):void 0}:{kind:"header-band",title:l,titleInsetX:xs}});return{kind:"group",id:I,title:l,box:O,children:U,style:o,inlineDatePins:S.length>0?S:void 0,...a?{waveOnly:!0}:{}}}};var up=class{constructor(t,n){B(this,"node");B(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=be("parallel",r.properties,n.styleCtx),s=Wr(r,t.x,n),a=Bt(Be(r.properties,"after")),l=Bt(Be(r.properties,"before")),c=r.title??r.name,u=qk(!!(a||l)),f=t.y+u,d=n.scale.showsNonWorking?n.scale.startX(s):s,p=[],g=d,m=d,w=0,x=n.currentFlowKey;n.nextParallelId+=1;let y=r.name??`parallel-${n.nextParallelId}`,E=0;for(let U of r.content){if(U.$type==="DescriptionDirective")continue;n.currentFlowKey=`${x}/par:${y}#${E}`;let L=Cl(s,f+w),M=i.sequenceOne(U,L,n);p.push(M),w+=Math.max(n.bandScale.step(),L.height),g=Math.max(g,L.x),m=Math.max(m,L.maxX,L.x),E++}n.currentFlowKey=x;let T={x:d,y:f,width:m-d,height:w};t.x=g,t.maxX=Math.max(t.maxX,m),t.height=Math.max(t.height,u+w);let v=r.name;v&&(n.entityLeftEdges.set(v,T.x),n.entityRightEdges.set(v,g));let P=Pd({box:T,afterDate:a,beforeDate:l,row:{kind:"header-band",title:c,titleInsetX:Es}});return{kind:"parallel",id:v,title:c,box:T,children:p,style:o,inlineDatePins:P.length>0?P:void 0}}};function rW(e,t,n){return new up(e,{sequenceOne:fp}).place(t,n)}function iW(e,t,n){return new cp(e,{sequenceOne:fp}).place(t,n)}function fp(e,t,n){if(Ye(e))return Xd(e,t,n);if(et(e))return rW(e,t,n);if(Ce(e))return iW(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var dp=class{place(t,n,r,i){let o={sequenceOne:fp},s=RR(t,n,r),a=bR(t,n,r,s,i),l=Nb(t,n,r,s,a),c=Mb(n,s,a,l,o);return Lb(new op(t,n,r,s,a,l,c))}};function Bl(e,t,n={}){let r=Ff(e,t),{config:i,working:o}=r,s=cs(t.content.sizes,i),a=re(e.roadmapDecl?.properties??[],"start"),l=_e(a)??oW(n.today??new Date),c=A=>o.workingIndexOf(l,A),u=A=>o.dateAtWorkingIndex(l,A),f=(A,O)=>Mf(o,l,A,O),d=0,p=A=>{d=Math.max(d,A)},g=new Map,m=new Map,w=new Map,x=new Map,y=new WeakMap,E=new Map,T=new WeakMap,v=new Map;for(let[A,O]of t.content.anchors){let _=_e(re(O.properties,"date"));if(_){let I=c(_);m.set(A,I),v.set(A,_),p(I)}}let P=()=>({itemEnd:g,anchorEnd:m,milestoneEnd:w,sizes:s,itemResults:x,inByNode:!0}),U=(A,O,_)=>{let I=N=>{if("date"in N)return c(N.date);let W=N.ref;return A.itemEnd.has(W)?A.itemEnd.get(W):A.anchorEnd.has(W)?A.anchorEnd.get(W):A.milestoneEnd.has(W)?A.milestoneEnd.get(W):0},S=(N,W)=>{let z=W;for(let X of Dt(N))z=F(X,z),_(z);return z},F=(N,W)=>{if(Ye(N)){let z=yk(N.properties,A.sizes,i),{after:X}=Br(N.properties),Q=X.length>0?Math.max(W,...X.map(I)):W;O&&(Q=O.apply(N,Q));let H=Q+z,te={start:u(Q),end:f(Q,H),days:z};return A.inByNode&&y.set(N,te),N.name&&(A.itemEnd.set(N.name,H),A.itemResults?.set(N.name,te)),O?.accumulate(N,H),H}if(et(N)){let{after:z}=Br(N.properties),X=z.length>0?Math.max(W,...z.map(I)):W;O&&(X=O.apply(N,X));let Q=X;for(let H of Dt(N))Q=Math.max(Q,F(H,X));return N.name&&A.itemEnd.set(N.name,Q),Q}if(Ce(N)){let{after:z}=Br(N.properties),X=z.length>0?Math.max(W,...z.map(I)):W;O&&(X=O.apply(N,X));let Q=S(N,X);return N.name&&A.itemEnd.set(N.name,Q),Q}return W};return{walkLane:S,resolveAfterDay:I}},L=(A,O)=>{let _=_e(re(A.properties,"date"));if(_)return c(_);let{after:I}=Br(A.properties);return I.length>0?Math.max(0,...I.map(O)):void 0},M=(A,O)=>{let _=new Map,I=new Map,S=new Map;for(let[W,z]of A.anchors){let X=_e(re(z.properties,"date"));if(X){let Q=c(X);I.set(W,Q),p(Q)}}let{walkLane:F,resolveAfterDay:N}=U({itemEnd:_,anchorEnd:I,milestoneEnd:S,sizes:cs(A.sizes,i),inByNode:O},void 0,p);for(let W of A.swimlanes.values())F(W,0);for(let[W,z]of A.milestones){let X=L(z,N);X!==void 0&&(S.set(W,X),p(X))}for(let W of A.isolatedRegions)M(W.content,!1)},j=n.plan!==void 0?n.plan??void 0:Di(t),$;if(j){let A=j.waves.map(N=>N.name),O=WR(j,l,o),_,I=0,S=N=>{I=Math.max(I,N)},F=$d(A.length,0,O,(N,W)=>{let z=A.map((H,te)=>[H,W[te]]);g=new Map(z),x=new Map,y=new WeakMap,I=0;let X=new Fi(j,N),{walkLane:Q}=U(P(),X,S);for(let H of t.content.swimlanes.values())Q(H,0);for(let H of t.content.isolatedRegions){let te=U({itemEnd:new Map(z),anchorEnd:new Map,milestoneEnd:new Map,sizes:cs(H.content.sizes,i),inByNode:!0},X,S);for(let k of H.content.swimlanes.values())te.walkLane(k,0)}return _=X,X});p(Math.max(I,...F.S,...F.E.slice(-1))),$=new Map;for(let N of Od(j,F,_,0,O))$.set(N.id,{index:N.index,start:u(N.start),end:f(N.start,N.end),memberCount:N.memberCount,...N.heldBy!==void 0?{heldBy:N.heldBy}:{},...N.floorRef!==void 0?{floorRef:N.floorRef}:{}})}else{let{walkLane:A}=U(P(),void 0,p);for(let O of t.content.swimlanes.values())A(O,0)}let{resolveAfterDay:R}=U(P(),void 0,p);for(let[A,O]of t.content.milestones){let _=L(O,R);if(_===void 0)continue;let I=_e(re(O.properties,"date"))??u(_);w.set(A,_),E.set(A,I),T.set(O,I),p(_)}if(!j)for(let A of t.content.isolatedRegions)M(A.content,!0);return{startDate:l,calendar:r,items:x,byNode:y,milestones:E,milestoneByNode:T,anchors:v,...$?{waves:$}:{},...j?{plan:j}:{},resolved:t,extent:{contentEndDay:d}}}function oW(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function Ex(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:Bl(e,t,{today:n.today,plan:Di(t)??null});return new dp().place(e,t,n,r)}function pp(e){return e.toISOString().slice(0,10)}function Fb(e){return e.id!==void 0?e.id:/[\r\n]/.test(e.title)?e.title.replace(/\s*[\r\n]+\s*/g," ").trim():e.title}function wx(e,t){for(let n of e)n.kind==="item"?t(n):wx(n.children,t)}function sW(e,t,n){let r=Fb(e);e.textSpills&&n.push(en(t,"NL.I1000","info",{name:r},r)),e.chipsOutside&&n.push(en(t,"NL.I1001","info",{name:r},r)),(e.box.width<Or||e.dotSpills||e.iconSpills||e.footnoteSpills)&&n.push(en(t,"NL.I1002","info",{name:r},r)),e.hasOverflow&&n.push(en(t,"NL.I1003","info",{name:r,anchor:e.overflowAnchorId},r)),Bb(e,t,n)}function Bb(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=Fb(e);n.push(en(t,"NL.I1008","info",{name:i,pin:r.pin,key:r.key,start:r.start},i))}function en(e,t,n,r,i){return{message:Xn(e,t,r),severity:n,code:t,entityId:i,lspSeverity:n==="warning"?2:3,data:{code:t,args:r}}}function Wb(e,t,n){let r=e.id??e.title,i=[];wx(e.children,a=>i.push(a));for(let a of i)sW(a,t,n);let o=new Set(i.map(a=>a.box.y));o.size>1&&n.push(en(t,"NL.I1004","info",{lane:r,rows:o.size},r)),(e.utilization?.segments.some(a=>a.classification==="red")??!1)&&n.push(en(t,"NL.I1005","info",{lane:r},r));for(let a of e.nested)Wb(a,t,n)}function Ub(e,t,n){wx(e.children,r=>{Bb(r,t,n)});for(let r of e.nested)Ub(r,t,n)}function aW(e,t,n){e.waveSolve?.capped&&n.push(en(t,"NL.W1002","warning",{passes:e.waveSolve.passes}));let r=e.waves??[],i=r.filter(o=>o.empty).map(o=>o.id);if(i.length>0){let o=i.length===r.length?{reason:"all",names:i}:i.length===1?{reason:"one",name:i[0]}:{reason:"many",names:i};n.push(en(t,"NL.I1006","info",o,o.reason==="one"?o.name:void 0))}for(let o of e.milestones){if(o.overrunByWave===void 0||o.overrunDate===void 0)continue;let s=r.find(l=>l.id===o.overrunByWave);if(!s)continue;let a=o.id??o.title;n.push(en(t,"NL.I1007","info",{name:a,date:o.overrunDate,wave:s.id,end:pp(s.endDate)},a))}}function Tx(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)Wb(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)Ub(o,n,r);if(aW(e,n,r),t.today){let i=t.today,o=e.timeline.startDate,s=e.timeline.endDate;(i<o||i>s)&&r.push(en(n,"NL.W1000","warning",{date:pp(i),start:pp(o),end:pp(s)}))}return r}var Wi=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function vx(e){if(!e||e.toLowerCase()==="local")return{kind:"local"};if(e.toUpperCase()==="UTC")return{kind:"utc"};if(e==="Z")return{kind:"offset",ms:0};let t=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(e);if(t){let n=t[1]==="+"?1:-1,r=parseInt(t[2],10),i=t[3]!==void 0?parseInt(t[3],10):0;if(r>23||i>59)throw new Wi(`nowline: invalid timezone offset "${e}". Hours must be 0\u201323 and minutes 0\u201359.`);return{kind:"offset",ms:n*(r*60+i)*6e4}}try{return{kind:"iana",name:Intl.DateTimeFormat(void 0,{timeZone:e}).resolvedOptions().timeZone}}catch{throw new Wi(`nowline: unrecognised timezone "${e}". Use "local", "UTC", an ISO 8601 offset (e.g. "+05:30", "-07:00", "Z"), or an IANA timezone name (e.g. "America/Los_Angeles", "Asia/Kolkata").`)}}function hp(e,t){switch(t.kind){case"local":return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()));case"utc":return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));case"offset":{let n=new Date(e.getTime()+t.ms);return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))}case"iana":{let n=new Intl.DateTimeFormat("en-CA",{timeZone:t.name,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=0,i=0,o=0;for(let s of n)s.type==="year"?r=parseInt(s.value,10):s.type==="month"?i=parseInt(s.value,10)-1:s.type==="day"&&(o=parseInt(s.value,10));return new Date(Date.UTC(r,i,o))}}}var Xb=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,Gb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function zb(e){return(ht.test(e)||Xb.test(e)||Gb.test(e))&&!ze(e.slice(0,10))}function _x(e={}){let t=e.zone??{kind:"local"},n=e.clock??(()=>new Date),r=e.now;if(!(r==="-"||r===null)){if(r instanceof Date)return r;if(r!==void 0){if(zb(r))return;let i=_e(r);if(i)return i;let o=Xb.exec(r);if(o){let s=new Date(r);if(!Number.isNaN(s.getTime())){if(o[2]==="Z")return hp(s,{kind:"utc"});let l=o[3]==="+"?1:-1,c=parseInt(o[4],10),u=o[5]!==void 0?parseInt(o[5],10):0,f=l*(c*60+u)*6e4;return hp(s,{kind:"offset",ms:f})}}return Gb.test(r)?_e(r.slice(0,10))??void 0:void 0}return hp(n(),t)}}function lW(e){return e===2?"warning":e===3?"info":"error"}function Hb(e,t){return{severity:lW(e.severity),code:dy(e),message:e.message,suggestion:sd(e.message),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function jb(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function Yb(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function Vb(e,t){let n=e.line!==void 0?e.line+1:1;if(!Mr(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let r=t?Dy(t,e):e.message,i=sd(r);return{severity:e.severity,code:e.code??ad(e.message),message:r,...i===void 0?{}:{suggestion:i},file:e.sourcePath,line:n,column:1}}function Kb(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function qb(e,t){return{severity:e.severity,code:e.code,message:e.message,file:t,line:1,column:1}}var Zb="__nowline_browser_noop_include__";async function Jb(e){throw new Error(`${Zb}: include "${e}" was skipped \u2014 running in single-file mode.`)}function kx(e){return e.includes(Zb)}function nS(e,t){let n=t==="image/png"?uW(e):t==="image/jpeg"?fW(e):dW(e);return n&&n.width>0&&n.height>0?n:void 0}var cW=[137,80,78,71,13,10,26,10];function Ax(e,t){return e[t]<<8|e[t+1]}function Qb(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function eS(e,t){return e[t]|e[t+1]<<8}function tS(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function mp(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function uW(e){if(!(e.length<24||cW.some((t,n)=>e[n]!==t))&&mp(e,12,4)==="IHDR")return{width:Qb(e,16),height:Qb(e,20)}}function fW(e){if(e.length<4||e[0]!==255||e[1]!==216)return;let t=2;for(;t+3<e.length;){if(e[t]!==255)return;let n=e[t+1];if(n===255){t+=1;continue}if(n===1||n>=208&&n<=217){t+=2;continue}let r=Ax(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:Ax(e,t+7),height:Ax(e,t+5)};if(r<2)return;t+=2+r}}function dW(e){if(e.length<16||mp(e,0,4)!=="RIFF"||mp(e,8,4)!=="WEBP")return;let t=mp(e,12,4),n=t==="VP8L"?25:30;if(!(e.length<n)){if(t==="VP8 ")return e[23]!==157||e[24]!==1||e[25]!==42?void 0:{width:eS(e,26)&16383,height:eS(e,28)&16383};if(t==="VP8L"){if(e[20]!==47)return;let r=e[21],i=e[22],o=e[23],s=e[24];return{width:1+(r|(i&63)<<8),height:1+(i>>6|o<<2|(s&15)<<10)}}if(t==="VP8X")return{width:1+tS(e,24),height:1+tS(e,27)}}}var pW=new Set(["svg","g","defs","symbol","use","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","linearGradient","radialGradient","stop","clipPath","mask","pattern","filter","feGaussianBlur","feColorMatrix","feOffset","feMerge","feMergeNode","feFlood","feComposite","feBlend","feDropShadow","image"]),hW=new Set(["d","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","viewBox","preserveAspectRatio","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","transform","points","id","clip-path","mask","filter","font-family","font-size","font-weight","font-style","text-anchor","dx","dy","rotate","letter-spacing","word-spacing","xmlns","href","xlink:href","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","maskUnits","maskContentUnits","stdDeviation","values","in","in2","mode","type","result","flood-color","flood-opacity","patternUnits","patternContentUnits","role","aria-label","display","visibility","clip-rule","color","font-variant","font-stretch","text-decoration","dominant-baseline","alignment-baseline","baseline-shift","writing-mode","paint-order","vector-effect","shape-rendering","text-rendering","image-rendering","color-interpolation","color-interpolation-filters"]),mW=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","clip-path","clip-rule","mask","filter","font-family","font-size","font-weight","font-style","font-variant","font-stretch","text-anchor","text-decoration","letter-spacing","word-spacing","dominant-baseline","alignment-baseline","baseline-shift","writing-mode","stop-color","stop-opacity","flood-color","flood-opacity","display","visibility","color","paint-order","vector-effect","shape-rendering","text-rendering","image-rendering","color-interpolation","color-interpolation-filters"]),gW=new Set(["line-height","text-align","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-alternates","font-feature-settings","font-variation-settings","font-kerning","white-space","text-orientation","overflow","isolation","solid-color","solid-opacity","enable-background","color-rendering"]),yW=new Set(["none","normal","auto","initial","inherit","unset"]);function xW(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function EW(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var wW=new Set(["x","y","width","height"]);function iS(e){let t=[],n=0,r=e.length;for(;n<r;){if(e[n]!=="<"){let u=n;for(;n<r&&e[n]!=="<";)n++;let f=e.slice(u,n);f.trim().length>0?t.push({kind:"text",text:f}):f.length>0&&t.push({kind:"text",text:f});continue}if(e.startsWith("<!--",n)){let u=e.indexOf("-->",n+4);if(u<0)break;t.push({kind:"comment",text:e.slice(n+4,u)}),n=u+3;continue}if(e.startsWith("<![CDATA[",n)){let u=e.indexOf("]]>",n+9);if(u<0)break;t.push({kind:"cdata",text:e.slice(n+9,u)}),n=u+3;continue}if(e.startsWith("<?",n)){let u=e.indexOf("?>",n+2);if(u<0)break;t.push({kind:"decl",text:e.slice(n+2,u)}),n=u+2;continue}if(e.startsWith("<!",n)){let u=e.indexOf(">",n+2);if(u<0)break;t.push({kind:"decl",text:e.slice(n+2,u)}),n=u+1;continue}if(e[n+1]==="/"){let u=e.indexOf(">",n+2);if(u<0)break;let f=e.slice(n+2,u).trim();t.push({kind:"close",name:f}),n=u+1;continue}let i=TW(e,n);if(i<0)break;let o=e.slice(n+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:l,attrs:c}=vW(a);t.push({kind:s?"self":"open",name:l,attrs:c}),n=i+1}return t}function TW(e,t){let n=t+1,r=null;for(;n<e.length;){let i=e[n];if(r)i===r&&(r=null);else if(i==='"'||i==="'")r=i;else if(i===">")return n;n++}return-1}function vW(e){let t=0;for(;t<e.length&&/\s/.test(e[t]);)t++;let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.slice(n,t),i={};for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;let o=t;for(;t<e.length&&e[t]!=="="&&!/\s/.test(e[t]);)t++;let s=e.slice(o,t);if(t>=e.length||e[t]!=="="){s&&(i[s]="");continue}if(t++,t>=e.length)break;let a=e[t];if(a!=='"'&&a!=="'"){let c=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;i[s]=e.slice(c,t);continue}t++;let l=t;for(;t<e.length&&e[t]!==a;)t++;i[s]=e.slice(l,t),t<e.length&&t++}return{name:r,attrs:i}}function Wl(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function _W(e,t){if(e.startsWith("#")){let n=t.get(e.slice(1));return n?`#${n}`:null}if(/^url\(#[^)]+\)$/.test(e)){let n=e.slice(5,-1),r=t.get(n);return r?`url(#${r})`:null}return null}function oS(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=iS(e),o="",s=0;for(let d of i)d.kind==="open"&&d.name==="style"?s++:d.kind==="close"&&d.name==="style"?s=Math.max(0,s-1):s>0&&(d.kind==="text"||d.kind==="cdata")&&(o+=d.text??"");let a=kW(o,d=>r(`sanitizer: dropping ${d}`)),l=new Map,c=0;for(let d of i)if((d.kind==="open"||d.kind==="self")&&d.attrs&&"id"in d.attrs){let p=d.attrs.id;p&&!l.has(p)&&l.set(p,`${n}-${c++}`)}let u=[],f=[];for(let d of i)if(d.kind!=="comment"&&d.kind!=="decl"){if(d.kind==="cdata"){f[f.length-1]&&u.push(Wl(d.text??""));continue}if(d.kind==="text"){if(f.length===0||f[f.length-1]){let p=(d.text??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");u.push(p)}continue}if(d.kind==="open"||d.kind==="self"){let p=d.name??"";if(p==="script"||p==="foreignObject"||p==="animate"||p==="animateTransform"||p==="animateMotion"||p==="set"){r(`sanitizer: dropping <${p}>`),d.kind==="open"&&f.push(!1);continue}if(p==="style"||EW(p)){d.kind==="open"&&f.push(!1);continue}if(!pW.has(p)){r(`sanitizer: dropping unknown element <${p}>`),d.kind==="open"&&f.push(!1);continue}let g=[`<${p}`],m=p==="svg"&&f.length===0,w=AW(d.attrs??{},a,r),x=Object.keys(w).sort();for(let y of x){let E=w[y];if(m&&t.stripRootSize&&wW.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(xW(y)||y==="class")continue;if(!hW.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let v=_W(E,l);if(v===null){r(`sanitizer: dropping external href ${E}`);continue}g.push(` ${y}="${Wl(v)}"`);continue}if(y==="id"){let v=l.get(E);v&&g.push(` id="${Wl(v)}"`);continue}let T=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(E.replace(T,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(E)){let v=E.replace(T,(P,U)=>{let L=l.get(U);return L?`url(#${L})`:"none"});g.push(` ${y}="${Wl(v)}"`);continue}g.push(` ${y}="${Wl(E)}"`)}g.push(d.kind==="self"?"/>":">"),u.push(g.join("")),d.kind==="open"&&f.push(!0);continue}d.kind==="close"&&f.pop()&&u.push(`</${d.name}>`)}return u.join("")}function rS(e){if(e===void 0)return;let t=/^\s*([0-9]*\.?[0-9]+(?:e[+-]?[0-9]+)?)\s*(px)?\s*$/i.exec(e);if(!t)return;let n=Number(t[1]);return n>0&&Number.isFinite(n)?n:void 0}function gp(e){let t=iS(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=rS(n.width),i=rS(n.height);if(r!==void 0&&i!==void 0)return{width:r,height:i};let o=(n.viewBox??"").trim().split(/[\s,]+/).map(Number);if(o.length===4&&o.every(Number.isFinite)&&o[2]>0&&o[3]>0)return{width:o[2],height:o[3]}}function sS(e){let t=[];for(let n of e.split(";")){let r=n.indexOf(":");if(r<0)continue;let i=n.slice(0,r).trim().toLowerCase(),o=n.slice(r+1).replace(/!\s*important\s*$/i,"").trim();i&&o&&t.push({property:i,value:o})}return t}function kW(e,t){let n=[],r=e.replace(/\/\*[\s\S]*?\*\//g,""),i=/([^{}]+)\{([^{}]*)\}/g;for(let o of r.matchAll(i)){let s=o[1].trim(),a=s.split(",").map(l=>l.trim());if(s.startsWith("@")||!a.every(l=>/^\.[A-Za-z_][\w-]*$/.test(l))){t(`<style> rule ${s}`);continue}n.push({classes:a.map(l=>l.slice(1)),declarations:sS(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function AW(e,t,n){let r=new Set((e.class??"").split(/\s+/).filter(Boolean)),i=[];for(let s of t)s.classes.some(a=>r.has(a))&&i.push(...s.declarations);if(e.style!==void 0&&i.push(...sS(e.style)),i.length===0&&e.style===void 0)return e;let o={...e};delete o.style;for(let{property:s,value:a}of i)mW.has(s)?o[s]=a:!s.startsWith("-")&&!gW.has(s)&&!yW.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var IW={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function RW(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function aS(e,t,n){if(!e||!t)return;let r=RW(e),i=IW[r];if(!i){n(`unsupported logo format: ${r||"(none)"} (${e})`);return}let o;try{o=await t(e)}catch(l){let c=l instanceof Error?l.message:String(l);n(`logo file not found: ${e} (${c})`);return}let s=o.bytes,a=i==="image/svg+xml"?gp(new TextDecoder().decode(s)):nS(s,i);if(!a){let l=i==="image/svg+xml"?"no viewBox and no pixel width/height on the root <svg>":`not a readable ${r.slice(1).toUpperCase()} header`;n(`logo could not be parsed: ${e} (${l})`);return}return{ref:e,dimensions:a,asset:o}}var bW=1,SW=0;function NW(){return Oe.parse(`memory:///stage-${++SW}.nowline`)}async function PW(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,NW());return await t.DocumentBuilder.build([n],{validation:!0}),n}function LW(e){return e.origin!=="validation"||e.diagnostic.severity===bW}async function Ix(e){let t=await PW(e),n=vl(t);if(n.some(LW))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await _y(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource}),o=e.isToleratedIncludeError??(()=>!1),s=i.diagnostics.filter(T=>T.severity==="error"&&!o(T)),a=i.diagnostics.filter(Mr),l=s.find(T=>!Mr(T));if(l)return{kind:"include-error",document:t,legacy:l,routed:[],resolved:i};if(s.length>0)return{kind:"include-error",document:t,routed:a,resolved:i};let c=[],u=await aS(od(r),e.assetResolver,T=>c.push(T)),{theme:f,today:d,width:p,locale:g,nonWorking:m}=e.layout,w={theme:f,today:d,width:p,locale:g,nonWorking:m},x=Di(i)??null,y=Bl(r,i,{today:d,plan:x}),E=Ex(r,i,{...w,schedule:y,logo:u?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:a,logo:u,warnings:c,plan:x,schedule:y,model:E,layout:w}}var Ur={person:{viewBox:"0 0 24 24",body:'<circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 21a8 8 0 0 1 16 0" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"p"},people:{viewBox:"0 0 24 24",body:'<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9" cy="7" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M22 21v-2a4 4 0 0 0-3-3.87" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 3.13a4 4 0 0 1 0 7.75" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"P"},points:{viewBox:"0 0 24 24",body:'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="currentColor" stroke-width="1" stroke-linejoin="round"/>',ascii:"*"},time:{viewBox:"0 0 24 24",body:'<line x1="10" x2="14" y1="2" y2="2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="12" x2="15" y1="14" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="14" r="8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"t"}},$W={calendar:{viewBox:"0 0 24 24",body:'<rect x="3" y="4" width="18" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="16" x2="16" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="8" x2="8" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="3" x2="21" y1="10" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"d"}},lS={...Ur,...$W};var Koe={none:"",multiplier:"x",person:Ur.person.ascii,people:Ur.people.ascii,points:Ur.points.ascii,time:Ur.time.ascii};var yp=class{constructor(t="nl"){B(this,"prefix");B(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};var cS=/&/g,uS=/</g,fS=/>/g,OW=/"/g,CW=/'/g;function tt(e){return e.replace(cS,"&amp;").replace(uS,"&lt;").replace(fS,"&gt;")}function qn(e){return e.replace(cS,"&amp;").replace(uS,"&lt;").replace(fS,"&gt;").replace(OW,"&quot;").replace(CW,"&#39;")}function Ds(e){let t=Object.keys(e).sort(),n=[];for(let r of t){let i=e[r];i==null||i===!1||(i===!0?n.push(r):n.push(`${r}="${qn(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function Y(e,t,n){return n===void 0||n===""?`<${e}${Ds(t)}/>`:`<${e}${Ds(t)}>${n}</${e}>`}function ue(e,t){return`<text${Ds(e)}>${tt(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var DW={none:{dx:0,dy:0,stdDeviation:0,opacity:0},subtle:{dx:0,dy:1,stdDeviation:1.5,opacity:.2},soft:{dx:0,dy:3,stdDeviation:5,opacity:.3},hard:{dx:2,dy:2,stdDeviation:0,opacity:.45}};function MW(e,t){let n=`${e}-shadow-${t}`,r=DW[t],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${r.stdDeviation}"/><feOffset dx="${r.dx}" dy="${r.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${r.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return Y("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function dS(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function pS(e){return["subtle","soft","hard"].map(t=>MW(e,t)).join("")}var FW={thin:100,light:300,normal:400,bold:700};function BW(e){return fs[e]??14}function Sx(e,t,n){return{"font-family":t[e.font],"font-size":n??BW(e.textSize),"font-weight":FW[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function WW(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function ES(e){if(!e||e==="none"||e==="transparent")return 1;let t=e.startsWith("#")?e.slice(1):e;if(t.length===3&&(t=t.split("").map(s=>s+s).join("")),t.length!==6)return 1;let n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(r)+.0722*o(i)}function UW(e,t){return ES(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function wp(e,t){return e.length*t*.58}function wS(e,t,n,r,i,o,s){let a=i*.58,l=t?wp(t,i):0,c=t?a:0,u=n+l+c,{text:f,icon:d}=e,p=wp(f,i),g={"font-family":o,"font-size":i,fill:s};if(!d)return ue({x:h(u),y:h(r),...g},f);if(d.kind==="builtin"&&d.name==="multiplier")return ue({x:h(u),y:h(r),...g},`${f}\xD7`);if(d.kind==="builtin"){let w=Ur[d.name],x=ue({x:h(u),y:h(r),...g},f),y=i*.1,E=i,T=u+p+y,v=r-i*.85,P=`<svg x="${h(T)}" y="${h(v)}" width="${h(E)}" height="${h(E)}" viewBox="${w.viewBox}" style="color:${qn(s)}" aria-hidden="true">${w.body}</svg>`;return x+P}let m=h(i*.1);return`<text x="${h(u)}" y="${h(r)}" font-family="${qn(o)}" font-size="${i}" fill="${qn(s)}">${tt(f)}<tspan dx="${m}">${tt(d.text)}</tspan></text>`}var hS=.6,XW=.5;function GW(e){let{metaText:t,capacity:n,x:r,baselineY:i,fontSize:o,fontFamily:s,color:a}=e;if(!t&&!n)return"";let l={"font-family":s,"font-size":o,fill:a};if(!n)return ue({x:h(r),y:h(i),...l},t);if(!t)return wS(n,void 0,r,i,o,s,a);let c=h(o*hS),u=`<text x="${h(r)}" y="${h(i)}" font-family="${qn(s)}" font-size="${o}" fill="${qn(a)}">`,{text:f,icon:d}=n;if(!d)return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+tt(t)+`<tspan dx="${c}">${tt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let P=h(o*.1);return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan><tspan dx="${P}">${tt(d.text)}</tspan></text>`}let p=Ur[d.name],g=P=>P.length*o*XW,m=r+g(t)+o*hS,w=o*.1,x=o,y=m+g(f)+w,E=i-o*.85,T=u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan></text>`,v=`<svg x="${h(y)}" y="${h(E)}" width="${h(x)}" height="${h(x)}" viewBox="${p.viewBox}" style="color:${qn(a)}" aria-hidden="true">${p.body}</svg>`;return T+v}function zW(e,t){let n=lS.calendar,r=`<svg x="${h(e.glyphTopLeft.x)}" y="${h(e.glyphTopLeft.y)}" width="${h(e.glyphSize)}" height="${h(e.glyphSize)}" viewBox="${n.viewBox}" style="color:${qn(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${tt(e.isoDate)}</title>`;return Y("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function Nx(e,t){return!e||e.length===0?"":e.map(n=>zW(n,t)).join("")}function HW(e){return(e?.length??0)>0}function TS(e){return e?.some(t=>t.side==="after")??!1}function jW(e,t,n,r,i,o={}){let s=Math.min(il[i.cornerRadius]??4,r/2);return Y("rect",{x:h(e),y:h(t),width:h(n),height:h(r),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":WW(i)??null,...o})}function YW(e,t,n,r){let i=e.box.x+e.cardBox.x,o=e.box.y+e.cardBox.y,s=e.cardBox.width,a=e.cardBox.height,l=e.style.bg==="none"?n.surface.headerBox:e.style.bg,c=n.header.cardBorder,u=Y("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:l,stroke:c,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`}),f=i+16+(e.textInset?.x??0),d=o+(e.textInset?.y??0),p=[];e.titleLines.forEach((E,T)=>{p.push(ue({x:h(f),y:h(d+26+T*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},E))});let g=p.join(""),m=d+26+Math.max(0,e.titleLines.length-1)*20,w=n.header.author,x=[];e.authorLines.forEach((E,T)=>{x.push(ue({x:h(f),y:h(m+18+T*14),"font-family":r[e.style.font],"font-size":11,fill:w},E))});let y=x.join("");return Y("g",{"data-layer":"header","data-id":`${t}-header`},u+g+y)}function VW(e,t,n){let r=n.timeline.gridLine,i=n.timeline.minorGridLine,o=e.bottomTickPanelHeight??0,s=e.bottomTickPanelY!==void 0&&o>0,a=e.tickPanelY,l=s?e.bottomTickPanelY+o:e.box.y+e.box.height,c=t,u=e.box.y+e.box.height,f=[];for(let d of e.ticks)if(d.major)f.push(Y("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(l),stroke:r,"stroke-width":1}));else if(e.minorGrid){if(d.labelX===void 0)continue;f.push(Y("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}for(let d of e.nonWorking??[])d.seam&&f.push(Y("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:n.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"}));return Y("g",{"data-layer":"grid"},f.join(""))}function vS(e,t,n,r){let i=e.box.y+e.box.height,o=[];for(let s of e.nonWorking??[]){if(!s.band)continue;let a={x:s.x,y:t,width:s.width,height:i-t},l=r?Lx(a,r):a;!l||l.width<=0||l.height<=0||o.push(Y("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":jg}))}return o.length===0?"":Y("g",{"data-layer":"non-working"},o.join(""))}function KW(e,t,n){let r=e.box.y+e.box.height,i=[];for(let o of e.nonWorking??[])o.label===void 0||!o.labelBox||(o.cut&&i.push(Y("line",{x1:h(o.x),y1:h(o.labelBox.y+4),x2:h(o.x),y2:h(r),stroke:t.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"})),i.push(mS(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(mS(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":Y("g",{"data-layer":"non-working-label"},i.join(""))}function mS(e,t,n,r,i){let o=n==="left",s=t.y+4,a={x:h(o?t.x+t.width:t.x),y:h(s+4),"font-family":i.sans,"font-size":10,fill:r.timeline.labelText};return o&&(a["text-anchor"]="end"),ue(a,e)}function qW(e,t,n){let r=t.timeline.panelFill,i=t.timeline.border,o=t.timeline.labelText,s=[],a=e.tickPanelY,l=e.tickPanelHeight,c=l>0,u=e.markerRow.height>0,f=e.waveStrip?e.waveStrip.y+e.waveStrip.height:a+l,d=e.markerRow.height,p=e.bottomTickPanelY,g=e.bottomTickPanelHeight??0,m=p!==void 0&&g>0;c&&s.push(Y("rect",{x:h(e.box.x),y:h(a),width:h(e.box.width),height:h(l),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),u&&s.push(Y("rect",{x:h(e.box.x),y:h(f),width:h(e.box.width),height:h(d),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),m&&s.push(Y("rect",{x:h(e.box.x),y:h(p),width:h(e.box.width),height:h(g),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1}));for(let w of e.ticks)w.major&&(!w.label||w.labelX===void 0||(c&&s.push(ue({x:h(w.labelX),y:h(a+al(l)),"font-family":n.sans,"font-size":vi,fill:o,"text-anchor":"middle"},w.label)),m&&s.push(ue({x:h(w.labelX),y:h(p+al(g)),"font-family":n.sans,"font-size":vi,fill:o,"text-anchor":"middle"},w.label))));return Y("g",{"data-layer":"timeline"},s.join(""))}function ZW(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=Y("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Xf}),s=JW(e,r),a=QW(e,i,n);return Y("g",{"data-layer":"nowline"},o+s+a)}function _S(e){let t=Xf/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function JW(e,t){let n=e.pillTopY,r=e.pillTopY+Mt,i=Cg,o=e.pillWidth;if(e.pillMode==="center")return Y("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Mt),rx:i,ry:i,fill:t});let s=_S(e);if(e.pillMode==="flag-right"){let c=s+o,u=[`M ${h(s)} ${h(n)}`,`L ${h(c-i)} ${h(n)}`,`A ${i} ${i} 0 0 1 ${h(c)} ${h(n+i)}`,`L ${h(c)} ${h(r-i)}`,`A ${i} ${i} 0 0 1 ${h(c-i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return Y("path",{d:u,fill:t})}let a=s-o,l=[`M ${h(s)} ${h(n)}`,`L ${h(a+i)} ${h(n)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(n+i)}`,`L ${h(a)} ${h(r-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return Y("path",{d:l,fill:t})}function QW(e,t,n){let r=e.pillTopY+Dg,i=_S(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+ds,s="start"):(o=i-ds,s="end"),ue({x:h(o),y:h(r),"font-family":n.sans,"font-size":cl,"font-weight":700,fill:t,"text-anchor":s},e.label)}function eU(e,t,n,r,i){let o=[],s=[];e.titleTruncated&&s.push(e.title),e.waveTooltip!==void 0&&s.push(e.waveTooltip),s.length>0&&o.push(`<title>${tt(s.join(`
2920
- `))}</title>`);let a=dS(n,e.style.shadow);o.push(jW(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:a??null})),e.waveRole==="background"&&o.push(xU(e.box,e.style,n));let l=UW(e.style.bg,r),c={done:l.done,"in-progress":l.inProgress,"at-risk":l.atRisk,blocked:l.blocked,planned:l.planned,neutral:l.neutral},u=c[e.status]??c.neutral;if(e.progressFraction>0){let y=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));o.push(Y("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-Zt),width:h(y),height:Zt,fill:e.style.fg,opacity:.55}))}let f=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-bi;o.push(Y("circle",{cx:h(f),cy:h(e.box.y+iy),r:Pr,fill:u})),o.push(Nx(e.inlineDatePins,e.style.fg));let d;if(e.textSpills)d=e.box.x+e.box.width+Bn,e.iconSpills&&(d+=$r+mn);else{let y=!!e.linkIcon&&e.linkIcon!=="none",T=e.inlineDatePins?.find(v=>v.side==="after"&&!v.spilled)?ms(y,{barWidth:e.box.width}):ms(!t.noLinks&&y&&!e.iconSpills);d=e.box.x+T}let p=e.style.text,g=r.entities.item.text,m=e.textSpills?g:p,w=e.textSpills?g:e.style.fg,x=e.titleLines??(e.title?[e.title]:[]);if(x.forEach((y,E)=>{y!==""&&o.push(ue({x:h(d),y:h(e.box.y+Qf+E*ml),"font-family":i[e.style.font],"font-size":Lr,"font-weight":600,fill:m},y))}),(e.metaText||e.capacity)&&o.push(GW({metaText:e.metaText,capacity:e.capacity,x:d,baselineY:e.box.y+ed(x.length),fontSize:hl,fontFamily:i[e.style.font],color:w})),e.footnoteIndicators.length>0){let y=e.box.y+oy;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let E=e.footnoteSpillStartX;for(let T=0;T<e.footnoteIndicators.length;T++){let v=e.footnoteIndicators[T];o.push(ue({x:h(E),y:h(y),"font-family":i.sans,"font-size":gl,"font-weight":700,fill:g},String(v))),E+=Jt}}else{let E=e.box.x+e.box.width-hs;for(let T=e.footnoteIndicators.length-1;T>=0;T--){let v=e.footnoteIndicators[T];o.push(ue({x:h(E),y:h(y),"font-family":i.sans,"font-size":gl,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(v))),E-=Jt}}}if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let y={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:r.item.linkIconFg},E=y[e.linkIcon]??y.generic,T=$r,v=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Si,P=e.box.y+Si,U=Y("rect",{x:h(v),y:h(P),width:T,height:T,rx:2,ry:2,fill:E}),L=v,M=P,j=Y("path",{d:`M${h(L+4)} ${h(M+10)} L${h(L+10)} ${h(M+4)} M${h(L+6)} ${h(M+4)} H${h(L+10)} V${h(M+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),$=U+j,R=e.linkHref?Y("a",{href:e.linkHref,target:"_blank",rel:"noopener"},$):$;o.push(R)}if(e.hasOverflow&&e.overflowBox){let y=r.item.overflowTailFill,E=r.item.overflowTailStroke,T=r.item.overflowCaption;o.push(Y("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:y,stroke:E,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&o.push(ue({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:T,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}for(let y of e.labelChips){let E=Math.min(il[y.style.cornerRadius]??8,y.box.height/2);o.push(Y("rect",{x:h(y.box.x),y:h(y.box.y),width:h(y.box.width),height:h(y.box.height),rx:h(E),ry:h(E),fill:y.style.bg==="none"?"transparent":y.style.bg,stroke:y.style.fg,"stroke-width":.5})),o.push(ue({x:h(y.box.x+y.box.width/2),y:h(y.box.y+y.box.height/2+3),...Sx(y.style,i,fs.xs),"text-anchor":"middle"},y.text))}return Y("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function tU(e,t,n,r,i){let o=[],s=ki(e.style.bg);if(s){if(o.push(Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:e.style.bg,stroke:e.style.fg,"stroke-width":1,"fill-opacity":.18,filter:`url(#${n}-shadow-subtle)`})),e.title){let a=Ai(e.title),l=e.box.x,c=e.box.y,u=_i,f=6,d=`M${h(l+f)} ${h(c)}H${h(l+a)}V${h(c+u-f)}A${f} ${f} 0 0 1 ${h(l+a-f)} ${h(c+u)}H${h(l)}V${h(c+f)}A${f} ${f} 0 0 1 ${h(l+f)} ${h(c)}Z`;o.push(Y("path",{d,fill:e.style.fg})),o.push(ue({x:h(l+ll),y:h(c+Sg),"font-family":i[e.style.font],"font-size":Ng,"font-weight":600,fill:"#ffffff"},e.title))}}else{let a=e.style.fg,l=El(s,!!e.title,HW(e.inlineDatePins));if(e.style.bracket!=="none"&&!e.waveOnly){let u=e.box.y+e.box.height,f=e.style.bracket==="dashed"?"3 2":null,d=l>0?`M${h(e.box.x+4)} ${h(e.box.y-l)} L${h(e.box.x)} ${h(e.box.y-l)} L${h(e.box.x)} ${h(u)} L${h(e.box.x+4)} ${h(u)}`:`M${h(e.box.x)} ${h(e.box.y)} L${h(e.box.x)} ${h(u)} L${h(e.box.x+4)} ${h(u)}`;o.push(Y("path",{d,fill:"none",stroke:a,"stroke-width":1,"stroke-dasharray":f}))}e.title&&o.push(ue({x:h(Pi(e.box.x,xs,TS(e.inlineDatePins))),y:h(e.box.y-id),...Sx(e.style,i,xl),"fill-opacity":.7},e.title))}o.push(Nx(e.inlineDatePins,e.style.fg));for(let a of e.children)o.push(Px(a,t,n,r,i));return Y("g",{"data-layer":"group","data-id":e.id??null},o.join(""))}function nU(e,t,n,r,i){let o=[];if(e.style.bracket==="solid"||e.style.bracket==="dashed"){let l=e.box.y-12,c=e.box.y+e.box.height+12,u=e.box.x,f=e.box.x+e.box.width,d=r.parallel.bracketStroke;o.push(Y("path",{d:`M${h(u+4)} ${h(l)} H${h(u)} V${h(c)} H${h(u+4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":e.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),o.push(Y("path",{d:`M${h(f-4)} ${h(l)} H${h(f)} V${h(c)} H${h(f-4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":e.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}e.title&&o.push(ue({x:h(Pi(e.box.x,Es,TS(e.inlineDatePins))),y:h(e.box.y-id),...Sx(e.style,i,xl),"fill-opacity":.7},e.title)),o.push(Nx(e.inlineDatePins,e.style.fg));for(let s of e.children)o.push(Px(s,t,n,r,i));return Y("g",{"data-layer":"parallel","data-id":e.id??null},o.join(""))}function Px(e,t,n,r,i){return e.kind==="item"?eU(e,t,n,r,i):e.kind==="group"?tU(e,t,n,r,i):nU(e,t,n,r,i)}var gS=2;function rU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function iU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-gS,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":Y("rect",{x:h(i.startX),y:h(n),width:h(o),height:gS,fill:rU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return Y("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function oU(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return Y("g",{"data-layer":"swimlane-bg","data-id":e.id??null},Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),fill:n,stroke:r,"stroke-width":1}))}function kS(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,l=r.swimlane.ownerText,c=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.capacity?wi(e.capacity.text,e.capacity.icon,10):0,p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",g=p?wp(p,10):0,m=wl(e.box.x,e.title,e.owner,d,g),w=Bf,x=e.box.y+10,y=x+Wf;u.push(Y("rect",{x:h(m.tabX),y:h(x),width:h(m.tabW),height:h(w),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(ue({x:h(m.titleX),y:h(y),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(ue({x:h(m.ownerX),y:h(y),"font-family":i[e.style.font],"font-size":10,fill:l},`owner: ${e.owner}`)),e.capacity&&u.push(wS(e.capacity,void 0,m.badgeX,y,10,i[e.style.font],l)),p&&u.push(ue({x:h(m.footnoteRightX),y:h(x+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let f of e.children)u.push(Px(f,t,n,r,i));return u.push(iU(e,r)),Y("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function AS(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,l=Y("path",{d:`M${h(i)} ${h(o-r)} L${h(i+r)} ${h(o)} L${h(i)} ${h(o+r)} L${h(i-r)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),c=t.anchorDiamond.label,u=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,f={x:h(u),y:h(o+4),"font-family":n.sans,"font-size":10,fill:c};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?ue(f,e.title):"";return Y("g",{"data-layer":"anchor","data-id":e.id??null},bS(e.hiddenDate)+l+d)}function IS(e,t){let n=t.anchorDiamond.cutLine;return Y("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:n,"stroke-width":1,"stroke-dasharray":"1 3"})}function RS(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.fill,a=Y("path",{d:`M${h(r)} ${h(i-o)} L${h(r+o)} ${h(i)} L${h(r)} ${h(i+o)} L${h(r-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),l=t.milestoneDiamond.label,c=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(c),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:l};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?ue(u,e.title):"";return Y("g",{"data-layer":"milestone","data-id":e.id??null},bS(e.hiddenDate)+a+f)}function bS(e){return e===void 0?"":`<title>${tt(e)}</title>`}function SS(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(Y("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":Uf,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=n.milestoneDiamond.slack;for(let s of e.slackArrows)i.push(Y("path",{d:`M${h(s.x)} ${h(s.y)} H${h(e.center.x-6)}`,fill:"none",stroke:o,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-arrow-dark)`}))}return i.join("")}function Tp(e,t,n){let r=e.kind==="overflow"?n.dependency.overflowStroke:n.dependency.edgeStroke,i=e.waypoints;if(i.length<2)return"";let o=e.kind==="underBar"?.8:1.1;return Y("path",{d:sU(i,zg),fill:"none",stroke:r,"stroke-width":o,"stroke-dasharray":e.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":`url(#${t}-arrow)`})}function sU(e,t){if(e.length<2)return"";let n=[`M${h(e[0].x)} ${h(e[0].y)}`];for(let r=1;r<e.length;r++){let i=e[r-1],o=e[r];if(r===e.length-1){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=e[r+1],a=Math.sign(o.x-i.x),l=Math.sign(o.y-i.y),c=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(t,f/2,d/2);if(p<=0||a!==0&&c!==0||l!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let g={x:o.x-a*p,y:o.y-l*p},m={x:o.x+c*p,y:o.y+u*p};n.push(`L${h(g.x)} ${h(g.y)}`),n.push(`Q${h(o.x)} ${h(o.y)} ${h(m.x)} ${h(m.y)}`)}return n.join(" ")}function aU(e,t,n,r){if(e.entries.length===0)return"";let i=n.footnotePanel.fill,o=n.footnotePanel.border,s=n.footnotePanel.header,a=n.footnotePanel.title,l=n.footnotePanel.description,c=n.footnotePanel.number,u=[];u.push(Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`})),u.push(ue({x:h(e.box.x+Ft),y:h(e.box.y+Bg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Ft;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(ue({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(ue({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:c},String(d.number)));for(let p of d.titleLines)u.push(ue({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},p.text));for(let p of d.descriptionLines??[])u.push(ue({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:l},p.text))}return Y("g",{"data-layer":"footnotes"},u.join(""))}function lU(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,l=r.includeRegion.tabFill,c=r.includeRegion.tabStroke,u=r.includeRegion.tabText,f=r.includeRegion.badgeFill,d=r.includeRegion.badgeStroke,p=r.includeRegion.badgeText,g=e.box.x+8,m=e.box.y,w=e.box.width-16,x=e.box.height,y=Y("rect",{x:h(g),y:h(m),width:h(w),height:h(x),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":Uf}),E=Bf,T=Tl(e.box.x,e.label,e.sourcePath),v=m-E/2,P=Y("rect",{x:h(T.tabX),y:h(v),width:h(T.tabWidth),height:E,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),U=ue({x:h(T.tabLabelX),y:h(v+Wf),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),L=T.badgeX,M=T.badgeSize,j=m-M/2,$=Y("rect",{x:h(L),y:h(j),width:M,height:M,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),R=Y("path",{d:`M${h(L+7)} ${h(j+4)} H${h(L+14)} V${h(j+11)} M${h(L+4)} ${h(j+7)} H${h(L+11)} V${h(j+14)} H${h(L+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),A=9,O=m+4,_=Y("rect",{x:h(T.sourceHaloX),y:h(O-A),width:h(T.sourceHaloWidth),height:A+6,fill:a}),I=ue({x:h(T.sourceTextX),y:h(O),"font-family":i.mono,"font-size":A,fill:p},e.sourcePath),S={x:g,y:m,width:w,height:x},F=o?vS(o.timeline,o.chartBox.y,r,S):"",N=o?.waves?$S(o.waves,S)+OS(o.waveBoundaries,S):"",W=o?.waves?CS(e.waveCrossings):"",z=e.nestedSwimlanes.map(D=>kS(D,t,n,r,i)).join(""),X=e.edges??[],Q=X.filter(D=>D.kind==="underBar").map(D=>Tp(D,n,r)).join(""),H=X.filter(D=>D.kind!=="underBar").map(D=>Tp(D,n,r)).join(""),te=e.anchors??[],k=e.milestones??[],C=te.map(D=>IS(D,r)).join("")+k.map(D=>SS(D,n,r)).join("")+te.map(D=>AS(D,r,i)).join("")+k.map(D=>RS(D,r,i)).join("");return Y("g",{"data-layer":"include"},y+F+N+Q+z+W+H+C+P+U+$+R+_+I)}function cU(e,t){let n=e.palette.attribution.mark,r=e.palette.attribution.link;if(e.swimlanes.length===0)return"";let i=e.header.attributionBox.x,o=e.header.attributionBox.y,s=Nr,a=ue({x:"0",y:s,"font-family":t.sans,"font-size":Hf,"font-weight":400,fill:n},zf)+ue({x:fl,y:s,"font-family":t.sans,"font-size":Nr,"font-weight":700,fill:n},"now")+Y("rect",{x:Ug,y:12,width:Xg,height:Nr,fill:r})+ue({x:jf,y:s,"font-family":t.sans,"font-size":Nr,"font-weight":400,fill:n},"ine"),l=Y("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(ul)})`},a);return Y("a",{href:Wg,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},Y("g",{"data-layer":"attribution"},l))}async function uU(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:l}=e.box,c;try{if(r.logo&&r.logo.ref===i)c=r.logo.asset;else if(t)c=await t(i);else return""}catch(d){let p=`logo file not found: ${i} (${d instanceof Error?d.message:String(d)})`;if(r.strict)throw d;return r.warn?.(p),""}let u=(c.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(c.bytes),p=e.intrinsic??gp(d)??{width:a,height:l},g=new Set,m=oS(d,{idPrefix:`${n}-logo`,onWarn:w=>g.add(w.replace(/^sanitizer: dropping /,"")),stripRootSize:!0});return g.size>0&&r.warn?.(`logo ${i}: removed unsupported SVG content: ${[...g].join(", ")}`),Y("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(l),viewBox:`0 0 ${h(p.width)} ${h(p.height)}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden"},m)}if(u==="image/png"||u==="image/jpeg"||u==="image/jpg"||u==="image/webp"){let d=fU(c.bytes);return Y("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(l),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function fU(e){if(typeof btoa<"u"){let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}let t=globalThis;if(t.Buffer)return t.Buffer.from(e).toString("base64");throw new Error("renderer: no base64 encoder available")}var dU=.24,xp=2,yS=3,pU=4,hU=8,mU=10;function NS(e){return e.bg==="none"?"transparent":e.bg}function vp(e){return ES(e)>=dU?"dark":"light"}function PS(e,t){return`url(#${e}-wave-hatch-${t})`}function gU(e,t,n){let r=qg;return Y("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},Y("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":Zg,opacity:Kg}))}function yU(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&t.add(vp(NS(o.style))):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);return e.waveLegend?.entries.some(i=>i.kind==="background")&&t.add(vp(DS(e.palette))),["dark","light"].filter(i=>t.has(i))}function xU(e,t,n){let i=Math.min(il[t.cornerRadius]??4,e.height/2);return Y("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(i),ry:h(i),fill:PS(n,vp(NS(t)))})}function Lx(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),i=Math.min(e.x+e.width,t.x+t.width),o=Math.min(e.y+e.height,t.y+t.height);if(!(i<=n||o<=r))return{x:n,y:r,width:i-n,height:o-r}}var Rx=4,Ep=.5;function LS(e,t){if(e.empty)return;let n=Ep;return Lx({x:e.strip.box.x,y:e.strip.box.y+n,width:e.strip.box.width,height:e.strip.box.height-2*n},{x:t.box.x+n,y:e.strip.box.y,width:t.box.width-2*n,height:e.strip.box.height})}function EU(e,t){let n=Math.min(Rx-Ep,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+Ep+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-Ep-r?n:0}}function wU(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,l,c)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(l)} ${h(c)}`:"";return`M${h(n+t.left)} ${h(r)} H${h(n+i-t.right)}`+s(t.right,n+i,r+t.right)+` V${h(r+o-t.right)}`+s(t.right,n+i-t.right,r+o)+` H${h(n+t.left)}`+s(t.left,n,r+o-t.left)+` V${h(r+t.left)}`+s(t.left,n+t.left,r)+" Z"}function bx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?Y("path",{d:wU(t,n),...o}):Y("rect",{x:h(t.x),y:h(t.y),width:h(t.width),height:h(t.height),...o}),i=r({fill:e.style.stripFill});return e.style.tint?i+r({fill:e.style.tint,"fill-opacity":dl}):i}function TU(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[Y("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:Rx,ry:Rx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=LS(o,n);s&&i.push(Y("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${bx(o,s,EU(s,n))}`))}return Y("g",{"data-layer":"wave-strip"},i.join(""))}function $S(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?Lx(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(Y("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":Jg}))}return n.length===0?"":Y("g",{"data-layer":"wave-bg"},n.join(""))}function OS(e,t){let n=[];for(let r of e??[]){let i=r.topY,o=r.bottomY;t&&(r.x<=t.x||r.x>=t.x+t.width||(i=Math.max(i,t.y),o=Math.min(o,t.y+t.height),o<=i))||n.push(Y("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":Yf,"stroke-dasharray":r.dash}))}return n.length===0?"":Y("g",{"data-layer":"wave-boundary"},n.join(""))}function xS(e,t){let n=wp(e,hn);return t?n*1.05:n}function vU(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+pU,s=i.y+yS,a=i.height-2*yS,l=[],c=(u,f)=>{let d=xS(f,!1)+2*xp;return Y("rect",{x:h(u-d/2),y:h(s),width:h(d),height:h(a),fill:t.timeline.panelFill})+ue({x:h(u),y:h(o),"font-family":n.sans,"font-size":hn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},f)};i.placeholder!==void 0&&l.push(c(r.box.x+r.box.width/2,i.placeholder));for(let u of e.waves){if(u.strip.gapLabel){let{text:g,x:m}=u.strip.gapLabel;l.push(c(m,g))}if(u.strip.marker){let{x:g,y:m}=u.strip.marker,w=Qg/2;l.push(Y("path",{d:`M${h(g)} ${h(m-w)} L${h(g+w)} ${h(m)} L${h(g)} ${h(m+w)} L${h(g-w)} ${h(m)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${tt(u.strip.tooltip)}</title>`))}let f=LS(u,r);if(!f)continue;let d=f.x+f.width,p=u.strip.footnotesShown?u.footnoteIndicators.length*Jt:0;if(p){let g=d-Cn+xp,m=d-Cn-p-xp;l.push(bx(u,{x:m,y:s,width:g-m,height:a}))}if(u.strip.label!==void 0){let g=xS(u.strip.label,!0),m=p?Math.min(u.strip.labelX,d-Cn-p-g/2):u.strip.labelX,w=g+2*xp;l.push(bx(u,{x:m-w/2,y:s,width:w,height:a})),l.push(ue({x:h(m),y:h(o),"font-family":n.sans,"font-size":hn,"font-weight":600,fill:u.style.text,"text-anchor":"middle"},u.strip.label))}if(u.strip.footnotesShown){let g=d-Cn;for(let m=u.footnoteIndicators.length-1;m>=0;m--)l.push(ue({x:h(g),y:h(i.y+mU),"font-family":n.sans,"font-size":hU,"font-weight":700,fill:u.style.text,"text-anchor":"end"},String(u.footnoteIndicators[m]))),g-=Jt}}return l.length===0?"":Y("g",{"data-layer":"wave-labels"},l.join(""))}function CS(e){if(!e||e.length===0)return"";let t=e.map(n=>Y("line",{x1:h(n.x),y1:h(n.topY),x2:h(n.x),y2:h(n.bottomY),stroke:n.stroke,"stroke-width":1,"stroke-dasharray":Vg}));return Y("g",{"data-layer":"wave-cross"},t.join(""))}function DS(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function _U(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"){let a=DS(n),l={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(Y("rect",{...l,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(Y("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:PS(t,vp(a))}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(Y("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":Yf}))}for(let a of o.runs)i.push(ue({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":hn,fill:n.wave.labelText},a.text))}return Y("g",{"data-layer":"wave-legend"},i.join(""))}async function $x(e,t={}){let r=new yp(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??Hg,s=[],a=i.arrowhead.neutral,l=i.arrowhead.light,c=i.arrowhead.dark,u=(p,g)=>`<marker id="${p}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${g}"/></marker>`,f=`<defs>${pS(r)}`+u(`${r}-arrow`,a)+u(`${r}-arrow-light`,l)+u(`${r}-arrow-dark`,c)+yU(e).map(p=>gU(r,p,i)).join("")+"</defs>";s.push(f),s.push(Y("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(qW(e.timeline,i,o)),s.push(TU(e,i));for(let p of e.swimlanes)s.push(oU(p,i));s.push(vS(e.timeline,e.chartBox.y,i)),e.waves&&s.push($S(e.waves)),s.push(VW(e.timeline,e.chartBox.y,i)),s.push(OS(e.waveBoundaries)),s.push(vU(e,i,o));for(let p of e.edges)p.kind==="underBar"&&s.push(Tp(p,r,i));for(let p of e.swimlanes)s.push(kS(p,t,r,i,o));for(let p of e.includes)s.push(lU(p,t,r,i,o,e));s.push(CS(e.waveCrossings));for(let p of e.edges)p.kind!=="underBar"&&s.push(Tp(p,r,i));for(let p of e.anchors)s.push(IS(p,i));for(let p of e.milestones)s.push(SS(p,r,i));s.push(KW(e.timeline,i,o));for(let p of e.anchors)s.push(AS(p,i,o));for(let p of e.milestones)s.push(RS(p,i,o));if(s.push(ZW(e.nowline,i,o)),s.push(aU(e.footnotes,r,i,o)),s.push(_U(e.waveLegend,r,i,o)),s.push(YW(e.header,r,i,o)),s.push(cU(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let p=await uU(e.header.logo,t.assetResolver,r,t);p&&s.push(p)}return`<svg${Ds({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(e.width)} ${h(e.height)}`,width:h(e.width),height:h(e.height),"data-theme":e.theme,"data-generator":"nowline"})}>${s.join("")}</svg>`}var Ox="/browser-source.nowline",kU={error:3,warning:2,info:1},AU={error:3,warning:2,info:1};function MS(e,t){return kU[e]>=AU[t]}var _p,FS=0;function BS(){return _p||(_p=Cy()),_p}function IU(){return Oe.parse(`memory:///nowline-browser-${++FS}.nowline`)}async function Cx(e,t={}){let n=t.filePath??Ox,r=BS(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,IU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:WS(o,n)}}function WS(e,t){return US(vl(e),t)}function US(e,t){return e.map(n=>n.origin==="lexer"?Yb(n.error,t):n.origin==="parser"?jb(n.error,t):Hb(n.diagnostic,t))}async function Dx(e,t={}){let n=t.filePath??Ox,r=BS(),i,o;if(t.timezone)try{i=vx(t.timezone)}catch(E){if(!(E instanceof Wi))throw E;o=E}let s=o?void 0:_x({now:t.today,zone:i}),a=await Ix({source:e,sourcePath:n,services:r,readSource:t.readFile??Jb,assetResolver:t.assetResolver,isToleratedIncludeError:E=>kx(E.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:US(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=WS(a.document,n);for(let E of a.resolved.diagnostics){if(E.severity==="error"&&kx(E.message)){t.onSkippedInclude?.({sourcePath:E.sourcePath,message:E.message});continue}l&&Mr(E)||c.push(Vb(E))}if(a.kind==="include-error"||c.some(E=>E.severity==="error"))return{kind:"diagnostics",diagnostics:c};if(o)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:o.message,file:n,line:1,column:1}]};let u=[...a.warnings],{logo:f,model:d}=a,p=t.diagnosticLevel??"error",g=Tx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(E=>qb(E,n)),m=t.showLinks!==!1,w=t.strict===!0,x=await $x(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!m,strict:w,warn:E=>u.push(E),fontFamilies:t.fontFamilies}),y=[...g,...u.map(E=>Kb(E,n,w?"error":"warning"))].filter(E=>MS(E.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function Mx(){_p=void 0,FS=0}var XS="/embed.nowline",Fx=!1;async function GS(e){let{ast:t,diagnostics:n}=await Cx(e,{filePath:XS});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function kp(e,t={}){let n={filePath:XS,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Fx||(Fx=!0,console.warn("nowline: `include` directives are skipped in the browser embed (single-file mode). Render multi-file roadmaps with the CLI or the GitHub Action."))}},r=await Dx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ul(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ul=class extends Error{constructor(n,r){super(n);B(this,"details",r);this.name="EmbedRenderError"}};function zS(){Fx=!1,Mx()}var tn=Uint8Array,Nt=Uint16Array,Gx=Int32Array,zx=new tn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Hx=new tn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),HS=new tn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),KS=function(e,t){for(var n=new Nt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Gx(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},qS=KS(zx,2),RU=qS.b,Wx=qS.r;RU[28]=258,Wx[258]=28;var ZS=KS(Hx,0),kse=ZS.b,jS=ZS.r,Ux=new Nt(32768);for(xe=0;xe<32768;++xe)Zn=(xe&43690)>>1|(xe&21845)<<1,Zn=(Zn&52428)>>2|(Zn&13107)<<2,Zn=(Zn&61680)>>4|(Zn&3855)<<4,Ux[xe]=((Zn&65280)>>8|(Zn&255)<<8)>>1;var Zn,xe,zl=(function(e,t,n){for(var r=e.length,i=0,o=new Nt(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Nt(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Nt(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Ux[f]>>l]=c}else for(a=new Nt(r),i=0;i<r;++i)e[i]&&(a[i]=Ux[s[e[i]-1]++]>>15-e[i]);return a}),Ui=new tn(288);for(xe=0;xe<144;++xe)Ui[xe]=8;var xe;for(xe=144;xe<256;++xe)Ui[xe]=9;var xe;for(xe=256;xe<280;++xe)Ui[xe]=7;var xe;for(xe=280;xe<288;++xe)Ui[xe]=8;var xe,Ap=new tn(32);for(xe=0;xe<32;++xe)Ap[xe]=5;var xe,bU=zl(Ui,9,0);var SU=zl(Ap,5,0);var JS=function(e){return(e+7)/8|0},NU=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new tn(e.subarray(t,n))};var Jn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Xl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Bx=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:eN,l:0};if(i==1){var s=new tn(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(v,P){return v.f-P.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Nt(d+1),g=Xx(n[u-1],p,0);if(g>t){var r=0,m=0,w=g-t,x=1<<w;for(o.sort(function(P,U){return p[U.s]-p[P.s]||P.f-U.f});r<i;++r){var y=o[r].s;if(p[y]>t)m+=x-(1<<g-p[y]),p[y]=t;else break}for(m>>=w;m>0;){var E=o[r].s;p[E]<t?m-=1<<t-p[E]++-1:++r}for(;r>=0&&m;--r){var T=o[r].s;p[T]==t&&(--p[T],++m)}g=t}return{t:new tn(p),l:g}},Xx=function(e,t,n){return e.s==-1?Math.max(Xx(e.l,t,n+1),Xx(e.r,t,n+1)):t[e.s]=n},YS=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Nt(++t),r=0,i=e[0],o=1,s=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},Gl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},QS=function(e,t,n){var r=n.length,i=JS(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},VS=function(e,t,n,r,i,o,s,a,l,c,u){Jn(t,u++,n),++i[256];for(var f=Bx(i,15),d=f.t,p=f.l,g=Bx(o,15),m=g.t,w=g.l,x=YS(d),y=x.c,E=x.n,T=YS(m),v=T.c,P=T.n,U=new Nt(19),L=0;L<y.length;++L)++U[y[L]&31];for(var L=0;L<v.length;++L)++U[v[L]&31];for(var M=Bx(U,7),j=M.t,$=M.l,R=19;R>4&&!j[HS[R-1]];--R);var A=c+5<<3,O=Gl(i,Ui)+Gl(o,Ap)+s,_=Gl(i,d)+Gl(o,m)+s+14+3*R+Gl(U,j)+2*U[16]+3*U[17]+7*U[18];if(l>=0&&A<=O&&A<=_)return QS(t,u,e.subarray(l,l+c));var I,S,F,N;if(Jn(t,u,1+(_<O)),u+=2,_<O){I=zl(d,p,0),S=d,F=zl(m,w,0),N=m;var W=zl(j,$,0);Jn(t,u,E-257),Jn(t,u+5,P-1),Jn(t,u+10,R-4),u+=14;for(var L=0;L<R;++L)Jn(t,u+3*L,j[HS[L]]);u+=3*R;for(var z=[y,v],X=0;X<2;++X)for(var Q=z[X],L=0;L<Q.length;++L){var H=Q[L]&31;Jn(t,u,W[H]),u+=j[H],H>15&&(Jn(t,u,Q[L]>>5&127),u+=Q[L]>>12)}}else I=bU,S=Ui,F=SU,N=Ap;for(var L=0;L<a;++L){var te=r[L];if(te>255){var H=te>>18&31;Xl(t,u,I[H+257]),u+=S[H+257],H>7&&(Jn(t,u,te>>23&31),u+=zx[H]);var k=te&31;Xl(t,u,F[k]),u+=N[k],k>3&&(Xl(t,u,te>>5&8191),u+=Hx[k])}else Xl(t,u,I[te]),u+=S[te]}return Xl(t,u,I[256]),u+S[256]},PU=new Gx([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),eN=new tn(0),LU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new tn(r+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(r,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var f=PU[t-1],d=f>>13,p=f&8191,g=(1<<n)-1,m=o.p||new Nt(32768),w=o.h||new Nt(g+1),x=Math.ceil(n/3),y=2*x,E=function(ge){return(e[ge]^e[ge+1]<<x^e[ge+2]<<y)&g},T=new Gx(25e3),v=new Nt(288),P=new Nt(32),U=0,L=0,M=o.i||0,j=0,$=o.w||0,R=0;M+2<s;++M){var A=E(M),O=M&32767,_=w[A];if(m[O]=_,w[A]=O,$<=M){var I=s-M;if((U>7e3||j>24576)&&(I>423||!c)){u=VS(e,l,0,T,v,P,L,j,R,M-R,u),j=U=L=0,R=M;for(var S=0;S<286;++S)v[S]=0;for(var S=0;S<30;++S)P[S]=0}var F=2,N=0,W=p,z=O-_&32767;if(I>2&&A==E(M-z))for(var X=Math.min(d,I)-1,Q=Math.min(32767,M),H=Math.min(258,I);z<=Q&&--W&&O!=_;){if(e[M+F]==e[M+F-z]){for(var te=0;te<H&&e[M+te]==e[M+te-z];++te);if(te>F){if(F=te,N=z,te>X)break;for(var k=Math.min(z,te-2),C=0,S=0;S<k;++S){var D=M-z+S&32767,G=m[D],J=D-G&32767;J>C&&(C=J,_=D)}}}O=_,_=m[O],z+=O-_&32767}if(N){T[j++]=268435456|Wx[F]<<18|jS[N];var q=Wx[F]&31,ee=jS[N]&31;L+=zx[q]+Hx[ee],++v[257+q],++P[ee],$=M+F,++U}else T[j++]=e[M],++v[e[M]]}}for(M=Math.max(M,$);M<s;++M)T[j++]=e[M],++v[e[M]];u=VS(e,l,c,T,v,P,L,j,R,M-R,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=w,o.p=m,o.i=M,o.w=$)}else{for(var M=o.w||0;M<s+c;M+=65535){var oe=M+65535;oe>=s&&(l[u/8|0]=c,oe=s),u=QS(l,u+1,e.subarray(M,oe))}o.i=s}return NU(a,0,r+JS(u)+i)};var tN=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},$U=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new tn(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return LU(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)};var nN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var OU=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=tN();i.p(t.dictionary),nN(e,2,i.d())}};function rN(e,t){t||(t={});var n=tN();n.p(e);var r=$U(e,t,t.dictionary?6:2,4);return OU(r,t),nN(r,r.length-4,n.d()),r}var CU=typeof TextDecoder<"u"&&new TextDecoder,DU=0;try{CU.decode(eN,{stream:!0}),DU=1}catch{}var sN="https://free.nowline.io/open";function iN(e){let t=new TextEncoder().encode(e),n=rN(t),r=32768,i="";for(let o=0;o<n.length;o+=r)i+=String.fromCharCode(...n.subarray(o,o+r));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function jx({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&oN(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",iN(e));let r=n===!0?sN:n,i=new URL(r);return t!==void 0&&oN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${iN(e)}`,i.toString()}function oN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var aN=0;async function lN(e){let t=e.document??globalThis.document;if(!t)return{rendered:0,failed:0};let n=t.querySelectorAll(e.selector),r=0,i=0,o=++aN,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=MU(c);if(!u)continue;let f=FU(c),d=`nl-r${o}-${l++}`,p={theme:e.theme,locale:e.locale,width:e.width,nonWorking:e.nonWorking,today:e.today,timezone:e.timezone,idPrefix:d},g=u.parentElement,m=u.nextSibling,x=c.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(kp(f,p).then(y=>{if(BU(u,y),r++,g!==null){let E=jx({source:f,sourceUrl:x,share:s});if(E!==null){let T=t.createElement("a");T.className="nowline-share",T.href=E,T.target="_blank",T.rel="noopener noreferrer",T.textContent="Share on Nowline",g.insertBefore(T,m)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function MU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function FU(e){return e.textContent??""}function BU(e,t){e.outerHTML=t}function cN(){aN=0}function Ip(){if(typeof globalThis>"u")return"light";let e=globalThis.matchMedia;if(typeof e!="function")return"light";try{return e("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function uN(e,t){return e&&e!=="auto"?Uy(e)??t:t}var WU="0.0.0-dev.20261016123749.g5260133",UU="5260133",XU="pre code.language-nowline, code.language-nowline",fN={theme:"auto",startOnLoad:!0,selector:XU,systemTheme:Ip(),share:!0},ke={...fN},Yx=!1;function GU(e={}){ke={theme:e.theme??ke.theme,startOnLoad:e.startOnLoad??ke.startOnLoad,selector:e.selector??ke.selector,locale:e.locale??ke.locale,width:e.width??ke.width,nonWorking:e.nonWorking??ke.nonWorking,today:e.today!==void 0?e.today:ke.today,timezone:e.timezone??ke.timezone,share:e.share??ke.share,sourceUrl:e.sourceUrl??ke.sourceUrl,systemTheme:Ip()}}function dN(){return{theme:uN(ke.theme,ke.systemTheme),locale:ke.locale,width:ke.width,nonWorking:ke.nonWorking,today:ke.today,timezone:ke.timezone}}async function zU(e,t={}){let n={...dN(),...t};return kp(e,n)}async function HU(e){return GS(e)}async function Vx(e){let t={selector:e?.selector??ke.selector,theme:e?.theme??dN().theme,locale:e?.locale??ke.locale,width:e?.width??ke.width,nonWorking:e?.nonWorking??ke.nonWorking,today:e?.today!==void 0?e.today:ke.today,timezone:e?.timezone??ke.timezone,share:e?.share??ke.share,sourceUrl:e?.sourceUrl??ke.sourceUrl,document:e?.document};return lN(t)}var jU=Vx;if(typeof document<"u"&&!Yx){Yx=!0;let e=()=>{ke.startOnLoad&&Vx()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function YU(){ke={...fN,systemTheme:Ip()},Yx=!1,zS(),cN()}return kN(VU);})();
2920
+ `))}</title>`);let a=dS(n,e.style.shadow);o.push(jW(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:a??null})),e.waveRole==="background"&&o.push(xU(e.box,e.style,n));let l=UW(e.style.bg,r),c={done:l.done,"in-progress":l.inProgress,"at-risk":l.atRisk,blocked:l.blocked,planned:l.planned,neutral:l.neutral},u=c[e.status]??c.neutral;if(e.progressFraction>0){let y=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));o.push(Y("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-Zt),width:h(y),height:Zt,fill:e.style.fg,opacity:.55}))}let f=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-bi;o.push(Y("circle",{cx:h(f),cy:h(e.box.y+iy),r:Pr,fill:u})),o.push(Nx(e.inlineDatePins,e.style.fg));let d;if(e.textSpills)d=e.box.x+e.box.width+Bn,e.iconSpills&&(d+=$r+mn);else{let y=!!e.linkIcon&&e.linkIcon!=="none",T=e.inlineDatePins?.find(v=>v.side==="after"&&!v.spilled)?ms(y,{barWidth:e.box.width}):ms(!t.noLinks&&y&&!e.iconSpills);d=e.box.x+T}let p=e.style.text,g=r.entities.item.text,m=e.textSpills?g:p,w=e.textSpills?g:e.style.fg,x=e.titleLines??(e.title?[e.title]:[]);if(x.forEach((y,E)=>{y!==""&&o.push(ue({x:h(d),y:h(e.box.y+Qf+E*ml),"font-family":i[e.style.font],"font-size":Lr,"font-weight":600,fill:m},y))}),(e.metaText||e.capacity)&&o.push(GW({metaText:e.metaText,capacity:e.capacity,x:d,baselineY:e.box.y+ed(x.length),fontSize:hl,fontFamily:i[e.style.font],color:w})),e.footnoteIndicators.length>0){let y=e.box.y+oy;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let E=e.footnoteSpillStartX;for(let T=0;T<e.footnoteIndicators.length;T++){let v=e.footnoteIndicators[T];o.push(ue({x:h(E),y:h(y),"font-family":i.sans,"font-size":gl,"font-weight":700,fill:g},String(v))),E+=Jt}}else{let E=e.box.x+e.box.width-hs;for(let T=e.footnoteIndicators.length-1;T>=0;T--){let v=e.footnoteIndicators[T];o.push(ue({x:h(E),y:h(y),"font-family":i.sans,"font-size":gl,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(v))),E-=Jt}}}if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let y={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:r.item.linkIconFg},E=y[e.linkIcon]??y.generic,T=$r,v=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Si,P=e.box.y+Si,U=Y("rect",{x:h(v),y:h(P),width:T,height:T,rx:2,ry:2,fill:E}),L=v,M=P,j=Y("path",{d:`M${h(L+4)} ${h(M+10)} L${h(L+10)} ${h(M+4)} M${h(L+6)} ${h(M+4)} H${h(L+10)} V${h(M+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),$=U+j,R=e.linkHref?Y("a",{href:e.linkHref,target:"_blank",rel:"noopener"},$):$;o.push(R)}if(e.hasOverflow&&e.overflowBox){let y=r.item.overflowTailFill,E=r.item.overflowTailStroke,T=r.item.overflowCaption;o.push(Y("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:y,stroke:E,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&o.push(ue({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:T,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}for(let y of e.labelChips){let E=Math.min(il[y.style.cornerRadius]??8,y.box.height/2);o.push(Y("rect",{x:h(y.box.x),y:h(y.box.y),width:h(y.box.width),height:h(y.box.height),rx:h(E),ry:h(E),fill:y.style.bg==="none"?"transparent":y.style.bg,stroke:y.style.fg,"stroke-width":.5})),o.push(ue({x:h(y.box.x+y.box.width/2),y:h(y.box.y+y.box.height/2+3),...Sx(y.style,i,fs.xs),"text-anchor":"middle"},y.text))}return Y("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function tU(e,t,n,r,i){let o=[],s=ki(e.style.bg);if(s){if(o.push(Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:e.style.bg,stroke:e.style.fg,"stroke-width":1,"fill-opacity":.18,filter:`url(#${n}-shadow-subtle)`})),e.title){let a=Ai(e.title),l=e.box.x,c=e.box.y,u=_i,f=6,d=`M${h(l+f)} ${h(c)}H${h(l+a)}V${h(c+u-f)}A${f} ${f} 0 0 1 ${h(l+a-f)} ${h(c+u)}H${h(l)}V${h(c+f)}A${f} ${f} 0 0 1 ${h(l+f)} ${h(c)}Z`;o.push(Y("path",{d,fill:e.style.fg})),o.push(ue({x:h(l+ll),y:h(c+Sg),"font-family":i[e.style.font],"font-size":Ng,"font-weight":600,fill:"#ffffff"},e.title))}}else{let a=e.style.fg,l=El(s,!!e.title,HW(e.inlineDatePins));if(e.style.bracket!=="none"&&!e.waveOnly){let u=e.box.y+e.box.height,f=e.style.bracket==="dashed"?"3 2":null,d=l>0?`M${h(e.box.x+4)} ${h(e.box.y-l)} L${h(e.box.x)} ${h(e.box.y-l)} L${h(e.box.x)} ${h(u)} L${h(e.box.x+4)} ${h(u)}`:`M${h(e.box.x)} ${h(e.box.y)} L${h(e.box.x)} ${h(u)} L${h(e.box.x+4)} ${h(u)}`;o.push(Y("path",{d,fill:"none",stroke:a,"stroke-width":1,"stroke-dasharray":f}))}e.title&&o.push(ue({x:h(Pi(e.box.x,xs,TS(e.inlineDatePins))),y:h(e.box.y-id),...Sx(e.style,i,xl),"fill-opacity":.7},e.title))}o.push(Nx(e.inlineDatePins,e.style.fg));for(let a of e.children)o.push(Px(a,t,n,r,i));return Y("g",{"data-layer":"group","data-id":e.id??null},o.join(""))}function nU(e,t,n,r,i){let o=[];if(e.style.bracket==="solid"||e.style.bracket==="dashed"){let l=e.box.y-12,c=e.box.y+e.box.height+12,u=e.box.x,f=e.box.x+e.box.width,d=r.parallel.bracketStroke;o.push(Y("path",{d:`M${h(u+4)} ${h(l)} H${h(u)} V${h(c)} H${h(u+4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":e.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),o.push(Y("path",{d:`M${h(f-4)} ${h(l)} H${h(f)} V${h(c)} H${h(f-4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":e.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}e.title&&o.push(ue({x:h(Pi(e.box.x,Es,TS(e.inlineDatePins))),y:h(e.box.y-id),...Sx(e.style,i,xl),"fill-opacity":.7},e.title)),o.push(Nx(e.inlineDatePins,e.style.fg));for(let s of e.children)o.push(Px(s,t,n,r,i));return Y("g",{"data-layer":"parallel","data-id":e.id??null},o.join(""))}function Px(e,t,n,r,i){return e.kind==="item"?eU(e,t,n,r,i):e.kind==="group"?tU(e,t,n,r,i):nU(e,t,n,r,i)}var gS=2;function rU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function iU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-gS,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":Y("rect",{x:h(i.startX),y:h(n),width:h(o),height:gS,fill:rU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return Y("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function oU(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return Y("g",{"data-layer":"swimlane-bg","data-id":e.id??null},Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),fill:n,stroke:r,"stroke-width":1}))}function kS(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,l=r.swimlane.ownerText,c=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.capacity?wi(e.capacity.text,e.capacity.icon,10):0,p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",g=p?wp(p,10):0,m=wl(e.box.x,e.title,e.owner,d,g),w=Bf,x=e.box.y+10,y=x+Wf;u.push(Y("rect",{x:h(m.tabX),y:h(x),width:h(m.tabW),height:h(w),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(ue({x:h(m.titleX),y:h(y),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(ue({x:h(m.ownerX),y:h(y),"font-family":i[e.style.font],"font-size":10,fill:l},`owner: ${e.owner}`)),e.capacity&&u.push(wS(e.capacity,void 0,m.badgeX,y,10,i[e.style.font],l)),p&&u.push(ue({x:h(m.footnoteRightX),y:h(x+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let f of e.children)u.push(Px(f,t,n,r,i));return u.push(iU(e,r)),Y("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function AS(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,l=Y("path",{d:`M${h(i)} ${h(o-r)} L${h(i+r)} ${h(o)} L${h(i)} ${h(o+r)} L${h(i-r)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),c=t.anchorDiamond.label,u=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,f={x:h(u),y:h(o+4),"font-family":n.sans,"font-size":10,fill:c};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?ue(f,e.title):"";return Y("g",{"data-layer":"anchor","data-id":e.id??null},bS(e.hiddenDate)+l+d)}function IS(e,t){let n=t.anchorDiamond.cutLine;return Y("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:n,"stroke-width":1,"stroke-dasharray":"1 3"})}function RS(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.fill,a=Y("path",{d:`M${h(r)} ${h(i-o)} L${h(r+o)} ${h(i)} L${h(r)} ${h(i+o)} L${h(r-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),l=t.milestoneDiamond.label,c=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(c),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:l};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?ue(u,e.title):"";return Y("g",{"data-layer":"milestone","data-id":e.id??null},bS(e.hiddenDate)+a+f)}function bS(e){return e===void 0?"":`<title>${tt(e)}</title>`}function SS(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(Y("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":Uf,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=n.milestoneDiamond.slack;for(let s of e.slackArrows)i.push(Y("path",{d:`M${h(s.x)} ${h(s.y)} H${h(e.center.x-6)}`,fill:"none",stroke:o,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-arrow-dark)`}))}return i.join("")}function Tp(e,t,n){let r=e.kind==="overflow"?n.dependency.overflowStroke:n.dependency.edgeStroke,i=e.waypoints;if(i.length<2)return"";let o=e.kind==="underBar"?.8:1.1;return Y("path",{d:sU(i,zg),fill:"none",stroke:r,"stroke-width":o,"stroke-dasharray":e.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":`url(#${t}-arrow)`})}function sU(e,t){if(e.length<2)return"";let n=[`M${h(e[0].x)} ${h(e[0].y)}`];for(let r=1;r<e.length;r++){let i=e[r-1],o=e[r];if(r===e.length-1){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=e[r+1],a=Math.sign(o.x-i.x),l=Math.sign(o.y-i.y),c=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(t,f/2,d/2);if(p<=0||a!==0&&c!==0||l!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let g={x:o.x-a*p,y:o.y-l*p},m={x:o.x+c*p,y:o.y+u*p};n.push(`L${h(g.x)} ${h(g.y)}`),n.push(`Q${h(o.x)} ${h(o.y)} ${h(m.x)} ${h(m.y)}`)}return n.join(" ")}function aU(e,t,n,r){if(e.entries.length===0)return"";let i=n.footnotePanel.fill,o=n.footnotePanel.border,s=n.footnotePanel.header,a=n.footnotePanel.title,l=n.footnotePanel.description,c=n.footnotePanel.number,u=[];u.push(Y("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`})),u.push(ue({x:h(e.box.x+Ft),y:h(e.box.y+Bg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Ft;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(ue({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(ue({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:c},String(d.number)));for(let p of d.titleLines)u.push(ue({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},p.text));for(let p of d.descriptionLines??[])u.push(ue({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:l},p.text))}return Y("g",{"data-layer":"footnotes"},u.join(""))}function lU(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,l=r.includeRegion.tabFill,c=r.includeRegion.tabStroke,u=r.includeRegion.tabText,f=r.includeRegion.badgeFill,d=r.includeRegion.badgeStroke,p=r.includeRegion.badgeText,g=e.box.x+8,m=e.box.y,w=e.box.width-16,x=e.box.height,y=Y("rect",{x:h(g),y:h(m),width:h(w),height:h(x),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":Uf}),E=Bf,T=Tl(e.box.x,e.label,e.sourcePath),v=m-E/2,P=Y("rect",{x:h(T.tabX),y:h(v),width:h(T.tabWidth),height:E,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),U=ue({x:h(T.tabLabelX),y:h(v+Wf),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),L=T.badgeX,M=T.badgeSize,j=m-M/2,$=Y("rect",{x:h(L),y:h(j),width:M,height:M,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),R=Y("path",{d:`M${h(L+7)} ${h(j+4)} H${h(L+14)} V${h(j+11)} M${h(L+4)} ${h(j+7)} H${h(L+11)} V${h(j+14)} H${h(L+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),A=9,O=m+4,_=Y("rect",{x:h(T.sourceHaloX),y:h(O-A),width:h(T.sourceHaloWidth),height:A+6,fill:a}),I=ue({x:h(T.sourceTextX),y:h(O),"font-family":i.mono,"font-size":A,fill:p},e.sourcePath),S={x:g,y:m,width:w,height:x},F=o?vS(o.timeline,o.chartBox.y,r,S):"",N=o?.waves?$S(o.waves,S)+OS(o.waveBoundaries,S):"",W=o?.waves?CS(e.waveCrossings):"",z=e.nestedSwimlanes.map(D=>kS(D,t,n,r,i)).join(""),X=e.edges??[],Q=X.filter(D=>D.kind==="underBar").map(D=>Tp(D,n,r)).join(""),H=X.filter(D=>D.kind!=="underBar").map(D=>Tp(D,n,r)).join(""),te=e.anchors??[],k=e.milestones??[],C=te.map(D=>IS(D,r)).join("")+k.map(D=>SS(D,n,r)).join("")+te.map(D=>AS(D,r,i)).join("")+k.map(D=>RS(D,r,i)).join("");return Y("g",{"data-layer":"include"},y+F+N+Q+z+W+H+C+P+U+$+R+_+I)}function cU(e,t){let n=e.palette.attribution.mark,r=e.palette.attribution.link;if(e.swimlanes.length===0)return"";let i=e.header.attributionBox.x,o=e.header.attributionBox.y,s=Nr,a=ue({x:"0",y:s,"font-family":t.sans,"font-size":Hf,"font-weight":400,fill:n},zf)+ue({x:fl,y:s,"font-family":t.sans,"font-size":Nr,"font-weight":700,fill:n},"now")+Y("rect",{x:Ug,y:12,width:Xg,height:Nr,fill:r})+ue({x:jf,y:s,"font-family":t.sans,"font-size":Nr,"font-weight":400,fill:n},"ine"),l=Y("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(ul)})`},a);return Y("a",{href:Wg,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},Y("g",{"data-layer":"attribution"},l))}async function uU(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:l}=e.box,c;try{if(r.logo&&r.logo.ref===i)c=r.logo.asset;else if(t)c=await t(i);else return""}catch(d){let p=`logo file not found: ${i} (${d instanceof Error?d.message:String(d)})`;if(r.strict)throw d;return r.warn?.(p),""}let u=(c.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(c.bytes),p=e.intrinsic??gp(d)??{width:a,height:l},g=new Set,m=oS(d,{idPrefix:`${n}-logo`,onWarn:w=>g.add(w.replace(/^sanitizer: dropping /,"")),stripRootSize:!0});return g.size>0&&r.warn?.(`logo ${i}: removed unsupported SVG content: ${[...g].join(", ")}`),Y("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(l),viewBox:`0 0 ${h(p.width)} ${h(p.height)}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden"},m)}if(u==="image/png"||u==="image/jpeg"||u==="image/jpg"||u==="image/webp"){let d=fU(c.bytes);return Y("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(l),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function fU(e){if(typeof btoa<"u"){let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}let t=globalThis;if(t.Buffer)return t.Buffer.from(e).toString("base64");throw new Error("renderer: no base64 encoder available")}var dU=.24,xp=2,yS=3,pU=4,hU=8,mU=10;function NS(e){return e.bg==="none"?"transparent":e.bg}function vp(e){return ES(e)>=dU?"dark":"light"}function PS(e,t){return`url(#${e}-wave-hatch-${t})`}function gU(e,t,n){let r=qg;return Y("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},Y("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":Zg,opacity:Kg}))}function yU(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&t.add(vp(NS(o.style))):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);return e.waveLegend?.entries.some(i=>i.kind==="background")&&t.add(vp(DS(e.palette))),["dark","light"].filter(i=>t.has(i))}function xU(e,t,n){let i=Math.min(il[t.cornerRadius]??4,e.height/2);return Y("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(i),ry:h(i),fill:PS(n,vp(NS(t)))})}function Lx(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),i=Math.min(e.x+e.width,t.x+t.width),o=Math.min(e.y+e.height,t.y+t.height);if(!(i<=n||o<=r))return{x:n,y:r,width:i-n,height:o-r}}var Rx=4,Ep=.5;function LS(e,t){if(e.empty)return;let n=Ep;return Lx({x:e.strip.box.x,y:e.strip.box.y+n,width:e.strip.box.width,height:e.strip.box.height-2*n},{x:t.box.x+n,y:e.strip.box.y,width:t.box.width-2*n,height:e.strip.box.height})}function EU(e,t){let n=Math.min(Rx-Ep,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+Ep+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-Ep-r?n:0}}function wU(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,l,c)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(l)} ${h(c)}`:"";return`M${h(n+t.left)} ${h(r)} H${h(n+i-t.right)}`+s(t.right,n+i,r+t.right)+` V${h(r+o-t.right)}`+s(t.right,n+i-t.right,r+o)+` H${h(n+t.left)}`+s(t.left,n,r+o-t.left)+` V${h(r+t.left)}`+s(t.left,n+t.left,r)+" Z"}function bx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?Y("path",{d:wU(t,n),...o}):Y("rect",{x:h(t.x),y:h(t.y),width:h(t.width),height:h(t.height),...o}),i=r({fill:e.style.stripFill});return e.style.tint?i+r({fill:e.style.tint,"fill-opacity":dl}):i}function TU(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[Y("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:Rx,ry:Rx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=LS(o,n);s&&i.push(Y("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${bx(o,s,EU(s,n))}`))}return Y("g",{"data-layer":"wave-strip"},i.join(""))}function $S(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?Lx(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(Y("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":Jg}))}return n.length===0?"":Y("g",{"data-layer":"wave-bg"},n.join(""))}function OS(e,t){let n=[];for(let r of e??[]){let i=r.topY,o=r.bottomY;t&&(r.x<=t.x||r.x>=t.x+t.width||(i=Math.max(i,t.y),o=Math.min(o,t.y+t.height),o<=i))||n.push(Y("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":Yf,"stroke-dasharray":r.dash}))}return n.length===0?"":Y("g",{"data-layer":"wave-boundary"},n.join(""))}function xS(e,t){let n=wp(e,hn);return t?n*1.05:n}function vU(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+pU,s=i.y+yS,a=i.height-2*yS,l=[],c=(u,f)=>{let d=xS(f,!1)+2*xp;return Y("rect",{x:h(u-d/2),y:h(s),width:h(d),height:h(a),fill:t.timeline.panelFill})+ue({x:h(u),y:h(o),"font-family":n.sans,"font-size":hn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},f)};i.placeholder!==void 0&&l.push(c(r.box.x+r.box.width/2,i.placeholder));for(let u of e.waves){if(u.strip.gapLabel){let{text:g,x:m}=u.strip.gapLabel;l.push(c(m,g))}if(u.strip.marker){let{x:g,y:m}=u.strip.marker,w=Qg/2;l.push(Y("path",{d:`M${h(g)} ${h(m-w)} L${h(g+w)} ${h(m)} L${h(g)} ${h(m+w)} L${h(g-w)} ${h(m)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${tt(u.strip.tooltip)}</title>`))}let f=LS(u,r);if(!f)continue;let d=f.x+f.width,p=u.strip.footnotesShown?u.footnoteIndicators.length*Jt:0;if(p){let g=d-Cn+xp,m=d-Cn-p-xp;l.push(bx(u,{x:m,y:s,width:g-m,height:a}))}if(u.strip.label!==void 0){let g=xS(u.strip.label,!0),m=p?Math.min(u.strip.labelX,d-Cn-p-g/2):u.strip.labelX,w=g+2*xp;l.push(bx(u,{x:m-w/2,y:s,width:w,height:a})),l.push(ue({x:h(m),y:h(o),"font-family":n.sans,"font-size":hn,"font-weight":600,fill:u.style.text,"text-anchor":"middle"},u.strip.label))}if(u.strip.footnotesShown){let g=d-Cn;for(let m=u.footnoteIndicators.length-1;m>=0;m--)l.push(ue({x:h(g),y:h(i.y+mU),"font-family":n.sans,"font-size":hU,"font-weight":700,fill:u.style.text,"text-anchor":"end"},String(u.footnoteIndicators[m]))),g-=Jt}}return l.length===0?"":Y("g",{"data-layer":"wave-labels"},l.join(""))}function CS(e){if(!e||e.length===0)return"";let t=e.map(n=>Y("line",{x1:h(n.x),y1:h(n.topY),x2:h(n.x),y2:h(n.bottomY),stroke:n.stroke,"stroke-width":1,"stroke-dasharray":Vg}));return Y("g",{"data-layer":"wave-cross"},t.join(""))}function DS(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function _U(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"){let a=DS(n),l={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(Y("rect",{...l,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(Y("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:PS(t,vp(a))}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(Y("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":Yf}))}for(let a of o.runs)i.push(ue({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":hn,fill:n.wave.labelText},a.text))}return Y("g",{"data-layer":"wave-legend"},i.join(""))}async function $x(e,t={}){let r=new yp(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??Hg,s=[],a=i.arrowhead.neutral,l=i.arrowhead.light,c=i.arrowhead.dark,u=(p,g)=>`<marker id="${p}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${g}"/></marker>`,f=`<defs>${pS(r)}`+u(`${r}-arrow`,a)+u(`${r}-arrow-light`,l)+u(`${r}-arrow-dark`,c)+yU(e).map(p=>gU(r,p,i)).join("")+"</defs>";s.push(f),s.push(Y("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(qW(e.timeline,i,o)),s.push(TU(e,i));for(let p of e.swimlanes)s.push(oU(p,i));s.push(vS(e.timeline,e.chartBox.y,i)),e.waves&&s.push($S(e.waves)),s.push(VW(e.timeline,e.chartBox.y,i)),s.push(OS(e.waveBoundaries)),s.push(vU(e,i,o));for(let p of e.edges)p.kind==="underBar"&&s.push(Tp(p,r,i));for(let p of e.swimlanes)s.push(kS(p,t,r,i,o));for(let p of e.includes)s.push(lU(p,t,r,i,o,e));s.push(CS(e.waveCrossings));for(let p of e.edges)p.kind!=="underBar"&&s.push(Tp(p,r,i));for(let p of e.anchors)s.push(IS(p,i));for(let p of e.milestones)s.push(SS(p,r,i));s.push(KW(e.timeline,i,o));for(let p of e.anchors)s.push(AS(p,i,o));for(let p of e.milestones)s.push(RS(p,i,o));if(s.push(ZW(e.nowline,i,o)),s.push(aU(e.footnotes,r,i,o)),s.push(_U(e.waveLegend,r,i,o)),s.push(YW(e.header,r,i,o)),s.push(cU(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let p=await uU(e.header.logo,t.assetResolver,r,t);p&&s.push(p)}return`<svg${Ds({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(e.width)} ${h(e.height)}`,width:h(e.width),height:h(e.height),"data-theme":e.theme,"data-generator":"nowline"})}>${s.join("")}</svg>`}var Ox="/browser-source.nowline",kU={error:3,warning:2,info:1},AU={error:3,warning:2,info:1};function MS(e,t){return kU[e]>=AU[t]}var _p,FS=0;function BS(){return _p||(_p=Cy()),_p}function IU(){return Oe.parse(`memory:///nowline-browser-${++FS}.nowline`)}async function Cx(e,t={}){let n=t.filePath??Ox,r=BS(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,IU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:WS(o,n)}}function WS(e,t){return US(vl(e),t)}function US(e,t){return e.map(n=>n.origin==="lexer"?Yb(n.error,t):n.origin==="parser"?jb(n.error,t):Hb(n.diagnostic,t))}async function Dx(e,t={}){let n=t.filePath??Ox,r=BS(),i,o;if(t.timezone)try{i=vx(t.timezone)}catch(E){if(!(E instanceof Wi))throw E;o=E}let s=o?void 0:_x({now:t.today,zone:i}),a=await Ix({source:e,sourcePath:n,services:r,readSource:t.readFile??Jb,assetResolver:t.assetResolver,isToleratedIncludeError:E=>kx(E.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:US(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=WS(a.document,n);for(let E of a.resolved.diagnostics){if(E.severity==="error"&&kx(E.message)){t.onSkippedInclude?.({sourcePath:E.sourcePath,message:E.message});continue}l&&Mr(E)||c.push(Vb(E))}if(a.kind==="include-error"||c.some(E=>E.severity==="error"))return{kind:"diagnostics",diagnostics:c};if(o)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:o.message,file:n,line:1,column:1}]};let u=[...a.warnings],{logo:f,model:d}=a,p=t.diagnosticLevel??"error",g=Tx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(E=>qb(E,n)),m=t.showLinks!==!1,w=t.strict===!0,x=await $x(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!m,strict:w,warn:E=>u.push(E),fontFamilies:t.fontFamilies}),y=[...g,...u.map(E=>Kb(E,n,w?"error":"warning"))].filter(E=>MS(E.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function Mx(){_p=void 0,FS=0}var XS="/embed.nowline",Fx=!1;async function GS(e){let{ast:t,diagnostics:n}=await Cx(e,{filePath:XS});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function kp(e,t={}){let n={filePath:XS,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Fx||(Fx=!0,console.warn("nowline: `include` directives are skipped in the browser embed (single-file mode). Render multi-file roadmaps with the CLI or the GitHub Action."))}},r=await Dx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ul(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ul=class extends Error{constructor(n,r){super(n);B(this,"details",r);this.name="EmbedRenderError"}};function zS(){Fx=!1,Mx()}var tn=Uint8Array,Nt=Uint16Array,Gx=Int32Array,zx=new tn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Hx=new tn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),HS=new tn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),KS=function(e,t){for(var n=new Nt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Gx(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},qS=KS(zx,2),RU=qS.b,Wx=qS.r;RU[28]=258,Wx[258]=28;var ZS=KS(Hx,0),kse=ZS.b,jS=ZS.r,Ux=new Nt(32768);for(xe=0;xe<32768;++xe)Zn=(xe&43690)>>1|(xe&21845)<<1,Zn=(Zn&52428)>>2|(Zn&13107)<<2,Zn=(Zn&61680)>>4|(Zn&3855)<<4,Ux[xe]=((Zn&65280)>>8|(Zn&255)<<8)>>1;var Zn,xe,zl=(function(e,t,n){for(var r=e.length,i=0,o=new Nt(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Nt(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Nt(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Ux[f]>>l]=c}else for(a=new Nt(r),i=0;i<r;++i)e[i]&&(a[i]=Ux[s[e[i]-1]++]>>15-e[i]);return a}),Ui=new tn(288);for(xe=0;xe<144;++xe)Ui[xe]=8;var xe;for(xe=144;xe<256;++xe)Ui[xe]=9;var xe;for(xe=256;xe<280;++xe)Ui[xe]=7;var xe;for(xe=280;xe<288;++xe)Ui[xe]=8;var xe,Ap=new tn(32);for(xe=0;xe<32;++xe)Ap[xe]=5;var xe,bU=zl(Ui,9,0);var SU=zl(Ap,5,0);var JS=function(e){return(e+7)/8|0},NU=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new tn(e.subarray(t,n))};var Jn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Xl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Bx=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:eN,l:0};if(i==1){var s=new tn(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(v,P){return v.f-P.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Nt(d+1),g=Xx(n[u-1],p,0);if(g>t){var r=0,m=0,w=g-t,x=1<<w;for(o.sort(function(P,U){return p[U.s]-p[P.s]||P.f-U.f});r<i;++r){var y=o[r].s;if(p[y]>t)m+=x-(1<<g-p[y]),p[y]=t;else break}for(m>>=w;m>0;){var E=o[r].s;p[E]<t?m-=1<<t-p[E]++-1:++r}for(;r>=0&&m;--r){var T=o[r].s;p[T]==t&&(--p[T],++m)}g=t}return{t:new tn(p),l:g}},Xx=function(e,t,n){return e.s==-1?Math.max(Xx(e.l,t,n+1),Xx(e.r,t,n+1)):t[e.s]=n},YS=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Nt(++t),r=0,i=e[0],o=1,s=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},Gl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},QS=function(e,t,n){var r=n.length,i=JS(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},VS=function(e,t,n,r,i,o,s,a,l,c,u){Jn(t,u++,n),++i[256];for(var f=Bx(i,15),d=f.t,p=f.l,g=Bx(o,15),m=g.t,w=g.l,x=YS(d),y=x.c,E=x.n,T=YS(m),v=T.c,P=T.n,U=new Nt(19),L=0;L<y.length;++L)++U[y[L]&31];for(var L=0;L<v.length;++L)++U[v[L]&31];for(var M=Bx(U,7),j=M.t,$=M.l,R=19;R>4&&!j[HS[R-1]];--R);var A=c+5<<3,O=Gl(i,Ui)+Gl(o,Ap)+s,_=Gl(i,d)+Gl(o,m)+s+14+3*R+Gl(U,j)+2*U[16]+3*U[17]+7*U[18];if(l>=0&&A<=O&&A<=_)return QS(t,u,e.subarray(l,l+c));var I,S,F,N;if(Jn(t,u,1+(_<O)),u+=2,_<O){I=zl(d,p,0),S=d,F=zl(m,w,0),N=m;var W=zl(j,$,0);Jn(t,u,E-257),Jn(t,u+5,P-1),Jn(t,u+10,R-4),u+=14;for(var L=0;L<R;++L)Jn(t,u+3*L,j[HS[L]]);u+=3*R;for(var z=[y,v],X=0;X<2;++X)for(var Q=z[X],L=0;L<Q.length;++L){var H=Q[L]&31;Jn(t,u,W[H]),u+=j[H],H>15&&(Jn(t,u,Q[L]>>5&127),u+=Q[L]>>12)}}else I=bU,S=Ui,F=SU,N=Ap;for(var L=0;L<a;++L){var te=r[L];if(te>255){var H=te>>18&31;Xl(t,u,I[H+257]),u+=S[H+257],H>7&&(Jn(t,u,te>>23&31),u+=zx[H]);var k=te&31;Xl(t,u,F[k]),u+=N[k],k>3&&(Xl(t,u,te>>5&8191),u+=Hx[k])}else Xl(t,u,I[te]),u+=S[te]}return Xl(t,u,I[256]),u+S[256]},PU=new Gx([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),eN=new tn(0),LU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new tn(r+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(r,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var f=PU[t-1],d=f>>13,p=f&8191,g=(1<<n)-1,m=o.p||new Nt(32768),w=o.h||new Nt(g+1),x=Math.ceil(n/3),y=2*x,E=function(ge){return(e[ge]^e[ge+1]<<x^e[ge+2]<<y)&g},T=new Gx(25e3),v=new Nt(288),P=new Nt(32),U=0,L=0,M=o.i||0,j=0,$=o.w||0,R=0;M+2<s;++M){var A=E(M),O=M&32767,_=w[A];if(m[O]=_,w[A]=O,$<=M){var I=s-M;if((U>7e3||j>24576)&&(I>423||!c)){u=VS(e,l,0,T,v,P,L,j,R,M-R,u),j=U=L=0,R=M;for(var S=0;S<286;++S)v[S]=0;for(var S=0;S<30;++S)P[S]=0}var F=2,N=0,W=p,z=O-_&32767;if(I>2&&A==E(M-z))for(var X=Math.min(d,I)-1,Q=Math.min(32767,M),H=Math.min(258,I);z<=Q&&--W&&O!=_;){if(e[M+F]==e[M+F-z]){for(var te=0;te<H&&e[M+te]==e[M+te-z];++te);if(te>F){if(F=te,N=z,te>X)break;for(var k=Math.min(z,te-2),C=0,S=0;S<k;++S){var D=M-z+S&32767,G=m[D],J=D-G&32767;J>C&&(C=J,_=D)}}}O=_,_=m[O],z+=O-_&32767}if(N){T[j++]=268435456|Wx[F]<<18|jS[N];var q=Wx[F]&31,ee=jS[N]&31;L+=zx[q]+Hx[ee],++v[257+q],++P[ee],$=M+F,++U}else T[j++]=e[M],++v[e[M]]}}for(M=Math.max(M,$);M<s;++M)T[j++]=e[M],++v[e[M]];u=VS(e,l,c,T,v,P,L,j,R,M-R,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=w,o.p=m,o.i=M,o.w=$)}else{for(var M=o.w||0;M<s+c;M+=65535){var oe=M+65535;oe>=s&&(l[u/8|0]=c,oe=s),u=QS(l,u+1,e.subarray(M,oe))}o.i=s}return NU(a,0,r+JS(u)+i)};var tN=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},$U=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new tn(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return LU(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)};var nN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var OU=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=tN();i.p(t.dictionary),nN(e,2,i.d())}};function rN(e,t){t||(t={});var n=tN();n.p(e);var r=$U(e,t,t.dictionary?6:2,4);return OU(r,t),nN(r,r.length-4,n.d()),r}var CU=typeof TextDecoder<"u"&&new TextDecoder,DU=0;try{CU.decode(eN,{stream:!0}),DU=1}catch{}var sN="https://free.nowline.io/open";function iN(e){let t=new TextEncoder().encode(e),n=rN(t),r=32768,i="";for(let o=0;o<n.length;o+=r)i+=String.fromCharCode(...n.subarray(o,o+r));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function jx({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&oN(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",iN(e));let r=n===!0?sN:n,i=new URL(r);return t!==void 0&&oN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${iN(e)}`,i.toString()}function oN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var aN=0;async function lN(e){let t=e.document??globalThis.document;if(!t)return{rendered:0,failed:0};let n=t.querySelectorAll(e.selector),r=0,i=0,o=++aN,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=MU(c);if(!u)continue;let f=FU(c),d=`nl-r${o}-${l++}`,p={theme:e.theme,locale:e.locale,width:e.width,nonWorking:e.nonWorking,today:e.today,timezone:e.timezone,idPrefix:d},g=u.parentElement,m=u.nextSibling,x=c.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(kp(f,p).then(y=>{if(BU(u,y),r++,g!==null){let E=jx({source:f,sourceUrl:x,share:s});if(E!==null){let T=t.createElement("a");T.className="nowline-share",T.href=E,T.target="_blank",T.rel="noopener noreferrer",T.textContent="Share on Nowline",g.insertBefore(T,m)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function MU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function FU(e){return e.textContent??""}function BU(e,t){e.outerHTML=t}function cN(){aN=0}function Ip(){if(typeof globalThis>"u")return"light";let e=globalThis.matchMedia;if(typeof e!="function")return"light";try{return e("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function uN(e,t){return e&&e!=="auto"?Uy(e)??t:t}var WU="0.0.0-dev.20261016125632.gcdc768a",UU="cdc768a",XU="pre code.language-nowline, code.language-nowline",fN={theme:"auto",startOnLoad:!0,selector:XU,systemTheme:Ip(),share:!0},ke={...fN},Yx=!1;function GU(e={}){ke={theme:e.theme??ke.theme,startOnLoad:e.startOnLoad??ke.startOnLoad,selector:e.selector??ke.selector,locale:e.locale??ke.locale,width:e.width??ke.width,nonWorking:e.nonWorking??ke.nonWorking,today:e.today!==void 0?e.today:ke.today,timezone:e.timezone??ke.timezone,share:e.share??ke.share,sourceUrl:e.sourceUrl??ke.sourceUrl,systemTheme:Ip()}}function dN(){return{theme:uN(ke.theme,ke.systemTheme),locale:ke.locale,width:ke.width,nonWorking:ke.nonWorking,today:ke.today,timezone:ke.timezone}}async function zU(e,t={}){let n={...dN(),...t};return kp(e,n)}async function HU(e){return GS(e)}async function Vx(e){let t={selector:e?.selector??ke.selector,theme:e?.theme??dN().theme,locale:e?.locale??ke.locale,width:e?.width??ke.width,nonWorking:e?.nonWorking??ke.nonWorking,today:e?.today!==void 0?e.today:ke.today,timezone:e?.timezone??ke.timezone,share:e?.share??ke.share,sourceUrl:e?.sourceUrl??ke.sourceUrl,document:e?.document};return lN(t)}var jU=Vx;if(typeof document<"u"&&!Yx){Yx=!0;let e=()=>{ke.startOnLoad&&Vx()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function YU(){ke={...fN,systemTheme:Ip()},Yx=!1,zS(),cN()}return kN(VU);})();
2921
2921
  //# sourceMappingURL=nowline.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nowline/embed",
3
- "version": "0.0.0-dev.20261016123749.g5260133",
3
+ "version": "0.0.0-dev.20261016125632.gcdc768a",
4
4
  "description": "Browser embed bundle for Nowline. Drop a <script> tag and ```nowline``` blocks render in place.",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -39,11 +39,11 @@
39
39
  "cdn"
40
40
  ],
41
41
  "dependencies": {
42
- "@nowline/browser": "0.0.0-dev.20261016123749.g5260133",
43
- "@nowline/core": "0.0.0-dev.20261016123749.g5260133",
44
- "@nowline/layout": "0.0.0-dev.20261016123749.g5260133",
45
- "@nowline/renderer": "0.0.0-dev.20261016123749.g5260133",
46
- "@nowline/share-link": "0.0.0-dev.20261016123749.g5260133",
42
+ "@nowline/browser": "0.0.0-dev.20261016125632.gcdc768a",
43
+ "@nowline/core": "0.0.0-dev.20261016125632.gcdc768a",
44
+ "@nowline/layout": "0.0.0-dev.20261016125632.gcdc768a",
45
+ "@nowline/renderer": "0.0.0-dev.20261016125632.gcdc768a",
46
+ "@nowline/share-link": "0.0.0-dev.20261016125632.gcdc768a",
47
47
  "langium": "~4.4.0"
48
48
  },
49
49
  "devDependencies": {