@nowline/embed 0.0.0-dev.20261026055950.g26802dd → 0.0.0-dev.20261031003627.g538fca0

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.20261026055950.g26802dd sha=26802dd built=2026-10-26T05:54:00Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261031003627.g538fca0 sha=538fca0 built=2026-10-31T00:31:13Z */
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -41037,8 +41037,8 @@ function effectiveTheme(theme, systemTheme) {
41037
41037
  }
41038
41038
 
41039
41039
  // src/index.ts
41040
- var version = true ? "0.0.0-dev.20261026055950.g26802dd" : "0.0.0";
41041
- var sha = true ? "26802dd" : "unknown";
41040
+ var version = true ? "0.0.0-dev.20261031003627.g538fca0" : "0.0.0";
41041
+ var sha = true ? "538fca0" : "unknown";
41042
41042
  var DEFAULT_SELECTOR = "pre code.language-nowline, code.language-nowline";
41043
41043
  var initialConfig = {
41044
41044
  theme: "auto",
@@ -1,4 +1,4 @@
1
- /*! @nowline/embed 0.0.0-dev.20261026055950.g26802dd sha=26802dd built=2026-10-26T05:54:00Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261031003627.g538fca0 sha=538fca0 built=2026-10-31T00:31:13Z */
2
2
  "use strict";var nowline=(()=>{var rL=Object.create;var Bs=Object.defineProperty;var iL=Object.getOwnPropertyDescriptor;var oL=Object.getOwnPropertyNames;var sL=Object.getPrototypeOf,aL=Object.prototype.hasOwnProperty;var lL=(e,t,n)=>t in e?Bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var cL=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Ws=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Gp=(e,t)=>{for(var n in t)Bs(e,n,{get:t[n],enumerable:!0})},wE=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oL(t))!aL.call(e,i)&&i!==n&&Bs(e,i,{get:()=>t[i],enumerable:!(r=iL(t,i))||r.enumerable});return e};var Hp=(e,t,n)=>(n=e!=null?rL(sL(e)):{},wE(t||!e||!e.__esModule?Bs(n,"default",{value:e,enumerable:!0}):n,e)),uL=e=>wE(Bs({},"__esModule",{value:!0}),e);var M=(e,t,n)=>lL(e,typeof t!="symbol"?t+"":t,n);var gm=Ws(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var pm;function hm(){if(pm===void 0)throw new Error("No runtime abstraction layer installed");return pm}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");pm=n}e.install=t})(hm||(hm={}));mm.default=hm});var ym=Ws($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.boolean=pM;$n.string=G_;$n.number=hM;$n.error=mM;$n.func=gM;$n.array=H_;$n.stringArray=yM;function pM(e){return e===!0||e===!1}function G_(e){return typeof e=="string"||e instanceof String}function hM(e){return typeof e=="number"||e instanceof Number}function mM(e){return e instanceof Error}function gM(e){return typeof e=="function"}function H_(e){return Array.isArray(e)}function yM(e){return H_(e)&&e.every(t=>G_(t))}});var wm=Ws(Ar=>{"use strict";var xM=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Emitter=Ar.Event=void 0;var EM=xM(gm()),z_;(function(e){let t={dispose(){}};e.None=function(){return t}})(z_||(Ar.Event=z_={}));var xm=class{constructor(){M(this,"_callbacks");M(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,EM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Wu=class Wu{constructor(t){M(this,"_options");M(this,"_event");M(this,"_callbacks");this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new xm),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=Wu._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)}};M(Wu,"_noop",function(){});var Em=Wu;Ar.Emitter=Em});var j_=Ws(wt=>{"use strict";var wM=wt&&wt.__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]})),TM=wt&&wt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),vM=wt&&wt.__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"&&wM(n,t,r[i]);return TM(n,t),n}})(),_M=wt&&wt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wt,"__esModule",{value:!0});wt.CancellationTokenSource=wt.CancellationToken=void 0;var AM=_M(gm()),kM=vM(ym()),Tm=wm(),Xu;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Tm.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Tm.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||kM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(Xu||(wt.CancellationToken=Xu={}));var IM=Object.freeze(function(e,t){let n=(0,AM.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),Uu=class{constructor(){M(this,"_isCancelled",!1);M(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?IM:(this._emitter||(this._emitter=new Tm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},vm=class{constructor(){M(this,"_token")}get token(){return this._token||(this._token=new Uu),this._token}cancel(){this._token?this._token.cancel():this._token=Xu.Cancelled}dispose(){this._token?this._token instanceof Uu&&this._token.dispose():this._token=Xu.None}};wt.CancellationTokenSource=vm});var V_=Ws(te=>{"use strict";var RM=te&&te.__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]})),SM=te&&te.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),bM=te&&te.__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"&&RM(n,t,r[i]);return SM(n,t),n}})();Object.defineProperty(te,"__esModule",{value:!0});te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;var pi=bM(ym()),_m;(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})(_m||(te.ErrorCodes=_m={}));var Am=class e extends Error{constructor(n,r,i){super(r);M(this,"code");M(this,"data");this.code=pi.number(n)?n:_m.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}};te.ResponseError=Am;var Zt=class Zt{constructor(t){M(this,"kind");this.kind=t}static is(t){return t===Zt.auto||t===Zt.byName||t===Zt.byPosition}toString(){return this.kind}};M(Zt,"auto",new Zt("auto")),M(Zt,"byPosition",new Zt("byPosition")),M(Zt,"byName",new Zt("byName"));var kr=Zt;te.ParameterStructures=kr;var Oe=class{constructor(t,n){M(this,"method");M(this,"numberOfParams");this.method=t,this.numberOfParams=n}get parameterStructures(){return kr.auto}};te.AbstractMessageSignature=Oe;var km=class extends Oe{constructor(n){super(n,0);M(this,"_")}};te.RequestType0=km;var Im=class extends Oe{constructor(n,r=kr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType=Im;var Rm=class extends Oe{constructor(n,r=kr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType1=Rm;var Sm=class extends Oe{constructor(n){super(n,2);M(this,"_")}};te.RequestType2=Sm;var bm=class extends Oe{constructor(n){super(n,3);M(this,"_")}};te.RequestType3=bm;var Nm=class extends Oe{constructor(n){super(n,4);M(this,"_")}};te.RequestType4=Nm;var Lm=class extends Oe{constructor(n){super(n,5);M(this,"_")}};te.RequestType5=Lm;var Pm=class extends Oe{constructor(n){super(n,6);M(this,"_")}};te.RequestType6=Pm;var Om=class extends Oe{constructor(n){super(n,7);M(this,"_")}};te.RequestType7=Om;var Cm=class extends Oe{constructor(n){super(n,8);M(this,"_")}};te.RequestType8=Cm;var $m=class extends Oe{constructor(n){super(n,9);M(this,"_")}};te.RequestType9=$m;var Dm=class extends Oe{constructor(n,r=kr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType=Dm;var Mm=class extends Oe{constructor(n){super(n,0);M(this,"_")}};te.NotificationType0=Mm;var Fm=class extends Oe{constructor(n,r=kr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=Fm;var Bm=class extends Oe{constructor(n){super(n,2);M(this,"_")}};te.NotificationType2=Bm;var Wm=class extends Oe{constructor(n){super(n,3);M(this,"_")}};te.NotificationType3=Wm;var Xm=class extends Oe{constructor(n){super(n,4);M(this,"_")}};te.NotificationType4=Xm;var Um=class extends Oe{constructor(n){super(n,5);M(this,"_")}};te.NotificationType5=Um;var Gm=class extends Oe{constructor(n){super(n,6);M(this,"_")}};te.NotificationType6=Gm;var Hm=class extends Oe{constructor(n){super(n,7);M(this,"_")}};te.NotificationType7=Hm;var zm=class extends Oe{constructor(n){super(n,8);M(this,"_")}};te.NotificationType8=zm;var jm=class extends Oe{constructor(n){super(n,9);M(this,"_")}};te.NotificationType9=jm;var Y_;(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})(Y_||(te.Message=Y_={}))});var Wy={};Gp(Wy,{nodeReadFile:()=>A2});async function A2(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var Xy=cL(()=>{});var KU={};Gp(KU,{EmbedRenderError:()=>Kl,__resetForTests:()=>VU,init:()=>gE,initialize:()=>HU,parse:()=>jU,render:()=>zU,run:()=>YU,sha:()=>UU,version:()=>XU});function Ue(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 Mt(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function TE(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 Ui=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 Ue(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 tr(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}function tc(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function nc(e){return tr(e)&&typeof e.fullText=="string"}var zt=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 gt})}join(t=","){let n=this.iterator(),r="",i,o=!1;do i=n.next(),i.done||(o&&(r+=t),r+=dL(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?gt:{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 gt})}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(rc(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(n.iterator);return gt})}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(rc(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(r.iterator);return gt})}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?gt: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 gt})}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 dL(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function rc(e){return!!e&&typeof e[Symbol.iterator]=="function"}var oc=new zt(()=>{},()=>gt),gt=Object.freeze({done:!0,value:void 0});function ye(...e){if(e.length===1){let t=e[0];if(t instanceof zt)return t;if(rc(t))return new zt(()=>t[Symbol.iterator](),n=>n.next());if(typeof t.length=="number")return new zt(()=>({index:0}),n=>n.index<t.length?{done:!1,value:t[n.index++]}:gt)}return e.length>1?new zt(()=>({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++];rc(n)?t.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(t.array=n)}}while(t.iterator||t.array||t.collIndex<e.length);return gt}):oc}var nr=class extends zt{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 gt})}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),prune:()=>{t.state.pruned=!0},[Symbol.iterator]:()=>t};return t}},ic;(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})(ic||(ic={}));function sc(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,o)=>{Ue(i)&&(i.$container=e,i.$containerProperty=n,i.$containerIndex=o,t.deep&&sc(i,t))}):Ue(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&sc(r,t)))}function Hi(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function st(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 jp(e){return it(e)?e.ref?[e.ref]:[]:Mt(e)?e.items.map(t=>t.ref):[]}function ac(e,t){if(!e)throw new Error("Node must be an AstNode.");let n=t?.range;return new zt(()=>({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(Ue(o)){if(r.keyIndex++,zp(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(Ue(a)&&zp(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return gt})}function cn(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new nr(e,n=>ac(n,t))}function yt(e,t){if(e){if(t?.range&&!zp(e,t.range))return new nr(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new nr(e,n=>ac(n,t),{includeRoot:!0})}function zp(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?AE(n,t):!1}function Gr(e){return new zt(()=>({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)||Mt(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)||Mt(o))return{done:!1,value:{reference:o,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return gt})}function vE(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]=_E(i.defaultValue))}function _E(e){return Array.isArray(e)?[...e.map(_E)]:e}var St={$type:"AbstractElement",cardinality:"cardinality"};function xc(e){return me.isInstance(e,St.$type)}var fc={$type:"AbstractParserRule"};function ir(e){return me.isInstance(e,fc.$type)}var lc={$type:"AbstractRule"};var jt={$type:"AbstractType"};var zr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function or(e){return me.isInstance(e,zr.$type)}var dc={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function nh(e){return me.isInstance(e,dc.$type)}var kE={$type:"ArrayLiteral",elements:"elements"};var Vp={$type:"ArrayType",elementType:"elementType"};function NE(e){return me.isInstance(e,Vp.$type)}var jr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function fn(e){return me.isInstance(e,jr.$type)}var Kp={$type:"BooleanLiteral",true:"true"};function LE(e){return me.isInstance(e,Kp.$type)}var Yr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function PE(e){return me.isInstance(e,Yr.$type)}var zi={$type:"Condition"};var pc={$type:"Conjunction",left:"left",right:"right"};function OE(e){return me.isInstance(e,pc.$type)}var Vr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function dn(e){return me.isInstance(e,Vr.$type)}var hc={$type:"Disjunction",left:"left",right:"right"};function CE(e){return me.isInstance(e,hc.$type)}var qp={$type:"EndOfFile",cardinality:"cardinality"};function $E(e){return me.isInstance(e,qp.$type)}var Hr={$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 me.isInstance(e,ji.$type)}var Zp={$type:"InferredType",name:"name"};function Ec(e){return me.isInstance(e,Zp.$type)}var Tn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qr(e){return me.isInstance(e,Tn.$type)}var Yp={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var RE={$type:"InfixRuleOperators",precedences:"precedences"};var zs={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function DE(e){return me.isInstance(e,zs.$type)}var js={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Yt(e){return me.isInstance(e,js.$type)}var cc={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var Yi={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function ME(e){return me.isInstance(e,Yi.$type)}var Jp={$type:"Negation",value:"value"};function FE(e){return me.isInstance(e,Jp.$type)}var SE={$type:"NumberLiteral",value:"value"};var uc={$type:"Parameter",name:"name"};var Qp={$type:"ParameterReference",parameter:"parameter"};function BE(e){return me.isInstance(e,Qp.$type)}var un={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function at(e){return me.isInstance(e,un.$type)}var mc={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function WE(e){return me.isInstance(e,mc.$type)}var Vi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function XE(e){return me.isInstance(e,Vi.$type)}var eh={$type:"ReturnType",name:"name"};function UE(e){return me.isInstance(e,eh.$type)}var Ki={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function pn(e){return me.isInstance(e,Ki.$type)}var Ys={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function rh(e){return me.isInstance(e,Ys.$type)}var bE={$type:"StringLiteral",value:"value"};var qi={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function GE(e){return me.isInstance(e,qi.$type)}var Ft={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Zi={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function HE(e){return me.isInstance(e,Zi.$type)}var rr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function xt(e){return me.isInstance(e,rr.$type)}var Ji={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function ih(e){return me.isInstance(e,Ji.$type)}var gc={$type:"Type",name:"name",type:"type"};function oh(e){return me.isInstance(e,gc.$type)}var Us={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Gs={$type:"TypeDefinition"};var th={$type:"UnionType",types:"types"};function zE(e){return me.isInstance(e,th.$type)}var yc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function sh(e){return me.isInstance(e,yc.$type)}var Qi={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function jE(e){return me.isInstance(e,Qi.$type)}var Hs={$type:"ValueLiteral"};var Vs={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function YE(e){return me.isInstance(e,Vs.$type)}var Ks=class extends Ui{constructor(){super(...arguments),this.types={AbstractElement:{name:St.$type,properties:{cardinality:{name:St.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:fc.$type,properties:{},superTypes:[lc.$type,jt.$type]},AbstractRule:{name:lc.$type,properties:{},superTypes:[]},AbstractType:{name:jt.$type,properties:{},superTypes:[]},Action:{name:zr.$type,properties:{cardinality:{name:zr.cardinality,optional:!0},feature:{name:zr.feature,optional:!0},inferredType:{name:zr.inferredType,optional:!0},operator:{name:zr.operator,optional:!0},type:{name:zr.type,referenceType:jt.$type,optional:!0}},superTypes:[St.$type]},Alternatives:{name:dc.$type,properties:{cardinality:{name:dc.cardinality,optional:!0},elements:{name:dc.elements,defaultValue:[]}},superTypes:[St.$type]},ArrayLiteral:{name:kE.$type,properties:{elements:{name:kE.elements,defaultValue:[]}},superTypes:[Hs.$type]},ArrayType:{name:Vp.$type,properties:{elementType:{name:Vp.elementType}},superTypes:[Gs.$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:[St.$type]},BooleanLiteral:{name:Kp.$type,properties:{true:{name:Kp.true,defaultValue:!1}},superTypes:[zi.$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:[Ft.$type]},Condition:{name:zi.$type,properties:{},superTypes:[]},Conjunction:{name:pc.$type,properties:{left:{name:pc.left},right:{name:pc.right}},superTypes:[zi.$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:jt.$type}},superTypes:[St.$type]},Disjunction:{name:hc.$type,properties:{left:{name:hc.left},right:{name:hc.right}},superTypes:[zi.$type]},EndOfFile:{name:qp.$type,properties:{cardinality:{name:qp.cardinality,optional:!0}},superTypes:[St.$type]},Grammar:{name:Hr.$type,properties:{imports:{name:Hr.imports,defaultValue:[]},interfaces:{name:Hr.interfaces,defaultValue:[]},isDeclared:{name:Hr.isDeclared,defaultValue:!1},name:{name:Hr.name,optional:!0},rules:{name:Hr.rules,defaultValue:[]},types:{name:Hr.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:[St.$type]},InferredType:{name:Zp.$type,properties:{name:{name:Zp.name}},superTypes:[jt.$type]},InfixRule:{name:Tn.$type,properties:{call:{name:Tn.call},dataType:{name:Tn.dataType,optional:!0},inferredType:{name:Tn.inferredType,optional:!0},name:{name:Tn.name},operators:{name:Tn.operators},parameters:{name:Tn.parameters,defaultValue:[]},returnType:{name:Tn.returnType,referenceType:jt.$type,optional:!0}},superTypes:[fc.$type]},InfixRuleOperatorList:{name:Yp.$type,properties:{associativity:{name:Yp.associativity,optional:!0},operators:{name:Yp.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:RE.$type,properties:{precedences:{name:RE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:zs.$type,properties:{attributes:{name:zs.attributes,defaultValue:[]},name:{name:zs.name},superTypes:{name:zs.superTypes,defaultValue:[],referenceType:jt.$type}},superTypes:[jt.$type]},Keyword:{name:js.$type,properties:{cardinality:{name:js.cardinality,optional:!0},predicate:{name:js.predicate,optional:!0},value:{name:js.value}},superTypes:[St.$type]},NamedArgument:{name:cc.$type,properties:{calledByName:{name:cc.calledByName,defaultValue:!1},parameter:{name:cc.parameter,referenceType:uc.$type,optional:!0},value:{name:cc.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:[Ft.$type]},Negation:{name:Jp.$type,properties:{value:{name:Jp.value}},superTypes:[zi.$type]},NumberLiteral:{name:SE.$type,properties:{value:{name:SE.value}},superTypes:[Hs.$type]},Parameter:{name:uc.$type,properties:{name:{name:uc.name}},superTypes:[]},ParameterReference:{name:Qp.$type,properties:{parameter:{name:Qp.parameter,referenceType:uc.$type}},superTypes:[zi.$type]},ParserRule:{name:un.$type,properties:{dataType:{name:un.dataType,optional:!0},definition:{name:un.definition},entry:{name:un.entry,defaultValue:!1},fragment:{name:un.fragment,defaultValue:!1},inferredType:{name:un.inferredType,optional:!0},name:{name:un.name},parameters:{name:un.parameters,defaultValue:[]},returnType:{name:un.returnType,referenceType:jt.$type,optional:!0}},superTypes:[fc.$type]},ReferenceType:{name:mc.$type,properties:{isMulti:{name:mc.isMulti,defaultValue:!1},referenceType:{name:mc.referenceType}},superTypes:[Gs.$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:[Ft.$type]},ReturnType:{name:eh.$type,properties:{name:{name:eh.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:lc.$type}},superTypes:[St.$type]},SimpleType:{name:Ys.$type,properties:{primitiveType:{name:Ys.primitiveType,optional:!0},stringType:{name:Ys.stringType,optional:!0},typeRef:{name:Ys.typeRef,referenceType:jt.$type,optional:!0}},superTypes:[Gs.$type]},StringLiteral:{name:bE.$type,properties:{value:{name:bE.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:[Ft.$type]},TerminalElement:{name:Ft.$type,properties:{cardinality:{name:Ft.cardinality,optional:!0},lookahead:{name:Ft.lookahead,optional:!0},parenthesized:{name:Ft.parenthesized,defaultValue:!1,optional:!0}},superTypes:[St.$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:[Ft.$type]},TerminalRule:{name:rr.$type,properties:{definition:{name:rr.definition},fragment:{name:rr.fragment,defaultValue:!1},hidden:{name:rr.hidden,defaultValue:!1},name:{name:rr.name},type:{name:rr.type,optional:!0}},superTypes:[lc.$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:rr.$type}},superTypes:[Ft.$type]},Type:{name:gc.$type,properties:{name:{name:gc.name},type:{name:gc.type}},superTypes:[jt.$type]},TypeAttribute:{name:Us.$type,properties:{defaultValue:{name:Us.defaultValue,optional:!0},isOptional:{name:Us.isOptional,defaultValue:!1},name:{name:Us.name},type:{name:Us.type}},superTypes:[]},TypeDefinition:{name:Gs.$type,properties:{},superTypes:[]},UnionType:{name:th.$type,properties:{types:{name:th.types,defaultValue:[]}},superTypes:[Gs.$type]},UnorderedGroup:{name:yc.$type,properties:{cardinality:{name:yc.cardinality,optional:!0},elements:{name:yc.elements,defaultValue:[]}},superTypes:[St.$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:[Ft.$type]},ValueLiteral:{name:Hs.$type,properties:{},superTypes:[]},Wildcard:{name:Vs.$type,properties:{cardinality:{name:Vs.cardinality,optional:!0},lookahead:{name:Vs.lookahead,optional:!0},parenthesized:{name:Vs.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ft.$type]}}}},me=new Ks;function qs(e){return new nr(e,t=>tr(t)?t.content:[],{includeRoot:!0})}function qE(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function ZE(e){return{start:{line:e.startLine-1,character:e.startColumn-1},end:{line:e.endLine-1,character:e.endColumn}}}function Zs(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 vn;(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"})(vn||(vn={}));function pL(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return vn.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return vn.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?vn.Inside:n?vn.OverlapBack:r?vn.OverlapFront:vn.Outside}function AE(e,t){return pL(e,t)>vn.After}var JE=/^[\w\p{L}]$/u;function QE(e,t){if(e){let n=hL(e,!0);if(n&&KE(n,t))return n;if(nc(e)){let r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){let o=e.content[i];if(KE(o,t))return o}}}}function KE(e,t){return tc(e)&&t.includes(e.tokenType.name)}function hL(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 kc={};Gp(kc,{findAssignment:()=>Eh,findNameAssignment:()=>_c,findNodeForKeyword:()=>yh,findNodeForProperty:()=>ra,findNodesForKeyword:()=>TL,findNodesForKeywordInternal:()=>xh,findNodesForProperty:()=>mh,getActionAtElement:()=>aw,getActionType:()=>cw,getAllReachableRules:()=>na,getAllRulesUsedForCrossReferences:()=>wL,getCrossReferenceTerminal:()=>ph,getEntryRule:()=>rw,getExplicitRuleType:()=>Ac,getHiddenRules:()=>iw,getRuleType:()=>wh,getRuleTypeName:()=>IL,getTypeName:()=>ar,isArrayCardinality:()=>_L,isArrayOperator:()=>AL,isCommentTerminal:()=>hh,isDataType:()=>kL,isDataTypeRule:()=>ia,isOptionalCardinality:()=>vL,terminalRegex:()=>no});var Js=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 sr(e,t="Error: Got unexpected value."){throw new Error(typeof t=="string"?t:t())}function oe(e){return e.charCodeAt(0)}function wc(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 Qs(){throw Error("Internal Error - Should never get here!")}function ah(e){return e.type==="Character"}var ea=[];for(let e=oe("0");e<=oe("9");e++)ea.push(e);var ta=[oe("_")].concat(ea);for(let e=oe("a");e<=oe("z");e++)ta.push(e);for(let e=oe("A");e<=oe("Z");e++)ta.push(e);var lh=[oe(" "),oe("\f"),oe(`
3
3
  `),oe("\r"),oe(" "),oe("\v"),oe(" "),oe("\xA0"),oe("\u1680"),oe("\u2000"),oe("\u2001"),oe("\u2002"),oe("\u2003"),oe("\u2004"),oe("\u2005"),oe("\u2006"),oe("\u2007"),oe("\u2008"),oe("\u2009"),oe("\u200A"),oe("\u2028"),oe("\u2029"),oe("\u202F"),oe("\u205F"),oe("\u3000"),oe("\uFEFF")];var mL=/[0-9a-fA-F]/,Tc=/[0-9]/,gL=/[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 Qs()}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):Qs()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[oe(`
4
4
  `),oe("\r"),oe("\u2028"),oe("\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=ea;break;case"D":t=ea,n=!0;break;case"s":t=lh;break;case"S":t=lh,n=!0;break;case"w":t=ta;break;case"W":t=ta,n=!0;break}return Zr(t)?{type:"Set",value:t,complement:n}:Qs()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=oe("\f");break;case"n":t=oe(`
@@ -2917,5 +2917,5 @@ ${n}`),this.inline?`{${i}}`:i}};function jM(e,t,n){if(e==="linkplain"||e==="link
2917
2917
  `);)r--;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;return r<0||t[r]!=="\\"}},ZR={parser:{TokenBuilder:()=>new tx({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:e=>new Cf(e),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new ex},validation:{NowlineValidator:()=>new Od}};function nx(e={}){let t=e.shared??Go(Of($f),Kk),n=Go(Pf({shared:t}),qk,ZR);return t.ServiceRegistry.register(n),qR(n),{shared:t,Nowline:n}}function rx(e,t){return t.code===void 0?t.message:Pt(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=ks(t),o=n.map(u=>Rl(u,i)),s=new WeakMap,a=new WeakMap,l=u=>{let f=vd(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=>Ve(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 Ol="en-US",Z2={"en-US":{nowLabel:"now",quarterPrefix:"Q",waveHeldBy:"held by",waveNoItems:"no items",waveBackgroundItem:"Background (no wave)",waveLegendBackground:"Background work (not in a wave)"},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)"}};function JR(e,t){return t??e??Ol}function jn(e){let t={};for(let n of J2(e)){let r=Z2[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 J2(e){let t=[],n=Q2(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(Ol)||t.push(Ol),t}function Q2(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}function Cd(e){return e==="hide"||e==="show"}var QR={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},Yn={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"},ix={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...Yn,headerHeight:"md",padding:"md"},swimlane:{...Yn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...Yn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...Yn,bg:"#8c84ff",bracket:"dashed",padding:"xs"},group:{...Yn,bg:"#f0a832",bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...Yn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...Yn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...Yn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...Yn,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 eS={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Vn={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"},ox={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Vn,headerHeight:"md",padding:"md"},swimlane:{...Vn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Vn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Vn,bg:"#9e9e9e",bracket:"dashed",padding:"xs"},group:{...Vn,bg:"#595959",bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Vn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Vn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Vn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Vn,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 tS={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Kn={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"},sx={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Kn,headerHeight:"md",padding:"md"},swimlane:{...Kn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Kn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Kn,bg:"#635cf1",bracket:"dashed",padding:"xs"},group:{...Kn,bg:"#ea9818",bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Kn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Kn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Kn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Kn,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 nS=["light","dark","grayscale"],ax={light:sx,dark:ix,grayscale:ox};var eB={greyscale:"grayscale"};function lx(e){let t=e.toLowerCase(),n=eB[t]??t;return nS.find(r=>r===n)}var tB={grey:"gray",violet:"purple"};function qn(e,t){if(e==="none")return"none";if(e.startsWith("#"))return e;let n=t.name==="dark"?QR:t.name==="grayscale"?eS:tS,r=tB[e]??e,i=n[r];return typeof i=="string"?i:e}function nB(e,t){return{bg:qn(e.bg,t),fg:qn(e.fg,t),text:qn(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 rS(e,t,n,r){switch(t){case"bg":e.bg=qn(n,r);break;case"fg":e.fg=qn(n,r);break;case"text":e.text=qn(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=Cl(n,"xl");break;case"padding":e.padding=Cl(n,"xl");break;case"spacing":e.spacing=Cl(n,"xl");break;case"header-height":e.headerHeight=Cl(n,"xl");break;case"corner-radius":e.cornerRadius=Cl(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":Cd(n)&&(e.nonWorking=n);break;default:break}}function Cl(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 rB(e,t,n){if(t)for(let r of t.properties)rS(e,Q(r),r.value,n)}function iB(e,t,n){for(let r of t){let i=Q(r);r.value!==void 0&&rS(e,i,r.value,n)}}function Se(e,t,n){let r=n.theme.entities[e],i=nB(r,n.theme);for(let o of Hf(e,t,n))switch(o.level){case"default":case"inline":iB(i,o.props,n.theme);break;case"label":break;default:rB(i,o.decl,n.theme)}return i}function iS(e,t){return Se("label",e.properties,t)}function sS(e,t){let r=_t(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=cx(i)*u,s=1}}let a=s??Rk[i]??4,l=c=>s===void 0&&!c?{labelEveryDefault:!0}:{};if(t){let c=_t(t.properties,"label-every"),u=c&&parseInt(c.value,10)||0,f=u!==0?Math.max(1,u):a;return{unit:i,labelEvery:f,pixelsPerUnit:o??cx(i),...l(u!==0)}}return{unit:i,labelEvery:a,pixelsPerUnit:o??cx(i),...l(!1)}}function cx(e){switch(e){case"days":return _k;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}var oB=.5,ux=.5,$l=7;function Br(e){return e==="months"||e==="quarters"||e==="years"}function $d(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 sB(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(!Br(n)&&o<=0)return 0;let a=o<=0?e:Xe(i.dateAtWorkingIndex(e,o-1),1),l=Br(n)?oS(a,n):n==="weeks"?aS(a,e,i.weekStart):a;return i.workingIndexOf(e,l)}if(!Br(n))return Math.ceil(t/r)*r;let s=Xe(e,o);return At(e,oS(s,n))}function oS(e,t){return sB(e,t)?e:$d(e,t)}function aS(e,t,n){let r=n===void 0?-At(t,e):n-e.getUTCDay();return Xe(e,(r%$l+$l)%$l)}function aB(e,t,n){return aS(Xe(e,1),t,n)}function Dd(e,t,n,r=Ol){if(e.calendar?.hasNonWorkingDays)return lB(e,t,e.calendar,r);if(Br(t.unit))return hB(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?px(t.unit,Xe(e.domain[0],u),c,r):void 0})}return l}function lB(e,t,n,r){let{unit:i}=t,[o,s]=e.domain,a=x=>Br(i)?$d(x,i):i==="weeks"?aB(x,o,n.weekStart):Xe(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&&!fB(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?uB(x,n,e.showsNonWorking):y%t.labelEvery===0,m=(e.showsNonWorking?nk(i):n.daysPerUnit(i))*e.pixelsPerDay,g=u.map(({date:x,x:y},E)=>{let _=(E+1<u.length?u[E+1].x:c)-y,T=d(x,E),I=T?px(i,x,E,r):void 0,B=I===void 0?0:se(I,Ri),$=Br(i)?E===0||E===u.length-1:_<m-oB,X=I!==void 0&&!(B>_&&$);return{x:y,columnPx:_,major:T,label:I,labelPx:B,isNarrowed:$,isShown:X}});Br(i)||cB(g);let w=g.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 cB(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 uB(e,t,n){let r=t.weekStart;if(n)return e.getUTCDay()===r;let i=(e.getUTCDay()-r+$l)%$l;for(let o=1;o<=i;o++)if(t.isWorkingDay(Xe(e,-o)))return!1;return!0}function fB(e,t,n,r){let i=e.calendar;if(!e.showsNonWorking||!i||!Br(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 fx(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=>pB(e,c,n));let l=c=>t.some(u=>Math.abs(u.x-c)<ux&&(u.major||r));return o.map(c=>{let u=e.forward(c.from),f={x:u,width:e.forward(Xe(c.through,1))-u,from:c.from,through:c.through};c.titles.length>0&&(f.titles=c.titles,f.label=cS(c,i.workingWeekdays),f.cut=!0);let d=u-s>ux&&a-u>ux;return n==="days"&&d&&!l(u)&&(f.seam=!0),f})}function dx(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:dB(r)}))}function dB(e){let t=At(e.from,e.through)+1;return`${e.titles.join(", ")}${lS}+${t}d`}var lS=" \xB7 ";function cS(e,t){let n=0;for(let i=e.from;i<=e.through;i=Xe(i,1))t.has(i.getUTCDay())&&n++;let r=e.titles.join(", ");return n>0?`${r}${lS}${n}d`:r}function pB(e,t,n){let[r,i]=e.range,o=Math.max(r,e.forward(t.from)),s=Math.min(i,e.forward(Xe(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=cS(t,e.calendar.workingWeekdays))),(n==="days"||n==="weeks"||t.titles.length>0)&&(a.band=!0),a}function hB(e,t,n,r){let[i,o]=e.domain,s=[i];for(let c=$d(i,n);c<o;c=$d(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,m=d?px(n,c,u,r):void 0,g=u===0||u===l-1;return m!==void 0&&g&&se(m,Ri)>p&&(m=void 0),{x:f,labelX:f+p/2,major:d,label:m}})}function px(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`${jn(r).quarterPrefix}${i} ${t.getUTCFullYear()}`}case"years":return`${t.getUTCFullYear()}`}}function uS(e,t,n){let r=n.theme??"light",i=ax[r],o=JR(n.locale,gB(e)),s={theme:i,styles:t.config.styles,defaults:t.config.defaults,labels:t.content.labels},a=Se("roadmap",e.roadmapDecl?.properties??[],s);return{themeName:r,theme:i,locale:o,styleCtx:s,roadmapStyle:a}}function fS(e,t,n,r,i){let{config:o,working:s}=Vf(e,t),a=sS(e,t.config.scale),{startDate:l,endDate:c}=mB(e,i,n.today,a),u=Cd(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,At(l,c)):d;return{cal:o,calendar:s,preset:a,schedule:i,startDate:l,naturalEndDate:c,spanDays:d,timelineDays:p,nonWorking:u}}function mB(e,t,n,r){let i=e.roadmapDecl?.properties??[],{config:o,working:s}=t.calendar,{startDate:a}=t,l=ie(i,"length"),c=0;if(l){let m=cs(l,o);m>0&&(c=m)}let u=t.extent.contentEndDay;if(n&&!(c>0)){let m=s.workingIndexOf(a,n);m>0&&(u=Math.max(u,m))}let f=ek(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 gB(e){return _t(e.directive?.properties??[],"locale")?.value}var yB=160,xB=64,EB=1e-6,Is=class{constructor(t,n){M(this,"scale");M(this,"startDate");M(this,"spanDays");M(this,"unit");M(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+EB}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)}}captionLimit(t){let{start:n,end:r}=this.captionColumn(t),i=this.xAt(n),o=r;for(let s=0;s<xB;s++){let a=this.nextBoundary(o);if(a<=o||this.xAt(a)-i>yB)break;o=a}return o}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.captionLimit(n))}};function dS(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)dS(n,t)}function Rs(e,t){e.box.y+=t;for(let n of e.children)dS(n,t);for(let n of e.nested)Rs(n,t)}function pS(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)Rs(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 hS(e,t,n){e.cutTopY+=n,e.cutBottomY+=n,e.slackArrows?.forEach((r,i)=>{let o=t.slackArrows?.[i];o&&"y"in o&&(r.y+=n)})}var hx=class{constructor(t,n){M(this,"id");M(this,"anchor");this.id=t,this.anchor=n}place(t,n){let r=ie(this.anchor.properties,"date"),i=_e(r);if(!i)return null;let o=t.scale.forwardWithinDomain(i);if(o===null)return null;let s=Se("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 Md(e,t,n){let r=[];for(let[i,o]of e){let s=new hx(i,o).place(t,n);s&&r.push(s)}return r}function Fl(e){if(e.kind==="item"){let n=e.textSpills||e.dotSpills||e.iconSpills||e.footnoteSpills;return Math.max(e.box.x+e.box.width,n?e.decorationsRightX:Number.NEGATIVE_INFINITY,e.chipsOutside?e.chipsRightX:Number.NEGATIVE_INFINITY)}let t=Math.max(e.box.x+e.box.width,Es(e));for(let n of e.children)t=Math.max(t,Fl(n));return t}function Wr(e){let t=0;for(let n of e)t=Math.max(t,mS(n.children)),n.nested.length>0&&(t=Math.max(t,Wr(n.nested)));return t}function mS(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,mS(n.children));return t}function Ss(e){let t=0;for(let n of e)t=Math.max(t,gS(n.children)),n.nested.length>0&&(t=Math.max(t,Ss(n.nested)));return t}function gS(e){let t=0;for(let n of e)n.kind==="item"?n.textSpills&&(t=Math.max(t,n.decorationsRightX)):t=Math.max(t,gS(n.children));return t}function TB(e){return e.box.y+e.box.height-rn/2}function mx(e,t){let{box:n}=e;return{startX:e.dateSpan.startX,endX:e.dateSpan.endX,paintedX:n.x,paintedWidth:n.width,top:n.y,bottom:n.y+n.height,rowY:n.y+t/2,exitY:gx(e,t)}}function yS(e){let{box:t}=e;return{startX:t.x,endX:t.x+t.width,paintedX:t.x,paintedWidth:t.width,top:t.y,bottom:t.y+t.height}}function gx(e,t){return e.textSpills?TB(e):e.box.y+t/2}function xS(e){let{box:t,afterDate:n,beforeDate:r,hasLinkIcon:i,footnoteCount:o}=e;if(!n&&!r)return[];let s=[],a=pt,l=t.y+gk,c=Vg(t.width);if(n){let u=Kg(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=qg(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 Fd(e){let{box:t,afterDate:n,beforeDate:r,title:i}=e;if(!n&&!r)return[];let o=[],s=pt,a=t.y+(wl-s)/2,l=i?xs(t.x,!!n)+Ay(i):t.x;if(n&&(l=Math.max(l,t.x+s),o.push({side:"after",isoDate:n,glyphTopLeft:{x:t.x,y:a},glyphSize:s,spilled:!1})),r){let c=t.x+t.width-Yg-s,u=l>t.x?l+nn:t.x;o.push({side:"before",isoDate:r,glyphTopLeft:{x:Math.max(c,u),y:a},glyphSize:s,spilled:!1})}return o}function Rt(e){for(let t of e)if(_e(t))return t}function Xr(e){return{after:Be(e,"after").map(n=>{let r=_e(n);return r?{raw:n,date:r}:{raw:n,ref:n}})}}function Bd(e){return e.floors.map(t=>t?_e(t.date):null)}function Wd(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=ES(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]:ES(d[p-1],s[p],i)),d.push(Math.max(f[p],u[p]??-1/0));if(wS(a,f)&&wS(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 ES(e,t,n){return t-e>n?t:e}function wS(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function TS(e,t,n){return Bd(e).map(r=>r?n.workingIndexOf(t,r):null)}var Fi=class{constructor(t,n){M(this,"plan");M(this,"S");M(this,"memberEnd");M(this,"binding");M(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 Xd(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 Ot=.5;function vS(e,t,n,r,i){let o=e.waves.map(()=>n);return{plan:e,ids:e.waves.map(s=>s.name),origin:n,floors:Bd(e).map(s=>s?t.forward(s):null),S:o,E:o,pass:new Fi(e,o),frozen:!1,backgroundTooltip:r,visible:i}}function _S(e,t,n){e.S=t,e.E=n,e.pass=new Fi(e.plan,t)}function AS(e,t){e.S=t.S,e.E=t.E,e.frozen=!0,e.solve=t}function Ud(e,t,n){e.ids.forEach((r,i)=>{t.set(r,e.S[i]),n.set(r,e.E[i])})}function Ur(e,t,n){return n.waves?n.waves.pass.apply(e,t):t}function kS(e,t,n){n.waves&&!n.waves.frozen&&n.waves.pass.accumulate(e,t)}function IS(e,t){if(t.waves?.visible)return t.waves.plan.memberWave(e)!==void 0?"member":"background"}function RS(e,t){for(let n of[...e.S,...e.E])if(!(Math.abs(n-e.origin)<Ot)&&Math.abs(t-n)<Ot)return!0;return!1}function yx(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,Xe(r,n))}function Gd(e,t){return t.calendar.dateAtWorkingIndex(t.timeline.startDate,yx(e,t))}function SS(e,t,n){return Yf(n.calendar,n.timeline.startDate,yx(e,n),yx(t,n))}function Bl(e,t,n){return Ur(e,Wl(e.properties,t,n),n)}var vB=!0;function bS(){return vB}function Wl(e,t,n){let{after:r}=Xr(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 NS(e,t,n){if(!n.calendar.hasNonWorkingDays)return;let r=_B(e);if(!r||n.calendar.isWorkingDay(r.date))return;let i=n.scale.forwardWithinDomain(r.date);if(!(i===null||Math.abs(t-i)>=Ot))return{key:r.key,pin:r.raw,start:Ti(Gd(t,n))}}function _B(e){let{after:t}=Xr(e);for(let n of t)if("date"in n)return{key:"after",raw:n.raw,date:n.date}}function xx(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 AB(e,t){return xx(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function LS(e,t,n){let r=AB(t,n),i={done:r.done,"in-progress":r.inProgress,"at-risk":r.atRisk,blocked:r.blocked,planned:r.planned,neutral:r.neutral};return i[e]??i.neutral}var kB=.24;function IB(e){return e==="none"?"transparent":e}function Hd(e){return xx(IB(e))>=kB?"dark":"light"}function bs(e,t,n){return e.scale.showsNonWorking?e.scale.advanceX(t,n)-t:n*e.timeline.pixelsPerDay}function Xl(e,t){return{x:e,startX:e,y:t,height:0}}function PS(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 RB(e){let t=new Map(e),n=r=>{for(let i of r.content)tn(i)&&(i.name&&!t.has(i.name)&&t.set(i.name,i),n(i))};for(let r of e.values())n(r);return t}function zd(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:us(e.content.sizes,t.cal),labels:e.content.labels,teams:RB(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,markerIds:new Set([...e.content.anchors.keys(),...e.content.milestones.keys()]),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 OS=12,SB=4,jd=13,bB=11;function NB(e,t){return(e?se(e,bB):0)+t}function Vd(e){return Math.max(0,Math.min(vk,(e-Jg)/2))}function Ex(e){return Math.max(Jg,e-2*Vd(e))}function CS(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 LB(e,t,n,r=t,i=r){let o=e,s=CS(e);if(s){if(s.length>=2)return{textSpills:!(n<=t&&s.every((u,f)=>se(u,jd)<=(f===0?i:t))),titleLines:s};o=s[0]??""}let a=o.length>0&&se(o,jd)>r,l=n>t;if(!a&&!l)return{textSpills:!1,titleLines:[o]};if(a&&!l)for(let c of[r,i]){let u=wi(o,t,jd,c);if(u.length>=2&&u.length<=Ug&&u.every((f,d)=>se(f,jd)<=(d===0?c:t)))return{textSpills:!1,titleLines:u}}return{textSpills:!0,titleLines:[o]}}function $S(e,t,n){let r=CS(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function DS(e){let{visualWidth:t}=e,n=ps(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-OS),i=NB(e.metaText,e.metaTrailingWidth??0),o=e.titleFirstLineRightReservePx??ul({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1}),s=Math.max(0,t-n-o),a=Math.max(s,t-n-Math.max(OS,o-Xt));return{leftInset:n,fit:LB(e.title,r,i,s,a)}}var PB;function MS(e,t,n){PB?.(e,t,n)}var Yd=class{constructor(t){M(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{naturalWidth:r,visualWidth:i,caption:o,barExtra:s}=this.geometry,a=n.bands.bandwidth(),l=t.x+Vd(r),c={x:l,y:t.y,width:i,height:s>0?a+s:a},{textSpills:u,titleLines:f}=o.fit,d=u?l+i+SB:l+o.leftInset;return{id:this.geometry.id,box:c,textX:d,textSpills:u,titleLines:f}}};function OB(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 CB(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 $B(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function DB(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function MB(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 Kd(e,t,n,r,i){let o=iS(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,l=wk[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:$r}}}function FB(e,t){let n=qA(e,t.sizes,t.cal),r=VA(ie(e,"remaining"),t.sizes,t.cal),i=ie(e,"status"),o=OB(i),s=CB(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(ie(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 BB(e,t,n,r,i,o){let s=ie(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),l=n?n.title??n.name:"",c=a?s:l||void 0,u=ie(e,"remaining"),f=$B(u,t),d=DB(ie(e,"owner"),t),p=()=>[c,d].filter(Boolean).join(" "),m;if(r==="in-progress"&&f){let E=p();m=E?`${E} \u2014 ${f} remaining`:`${f} remaining`}else if(r==="in-progress"&&i>0&&i<1){let E=Math.round((1-i)*100),_=p();m=_?`${_} \u2014 ${E}% remaining`:`${E}% remaining`}else(d||c)&&(m=p()||void 0);let g=ie(e,"capacity"),w=Nr(g),x=null,y=0;if(w!==null){let E=el(w),_=tl(o,t.symbols),T=11,I=rl(E,_,T,m);x={value:w,text:E,icon:_,...I!==void 0?{iconDxTerms:I}:{}};let B=I!==void 0?T*as:se(" ",T);y=(m?B:0)+nl(E,_,T)}return{metaText:m,ownerDisplay:d,capacity:x,capacityTrailingWidth:y}}function WB(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 XB(e,t,n){return ul({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Rt(n)!==void 0})}var UB={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function GB(e,t,n){let r=UB[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 HB(e,t,n,r,i){if(n===0)return 0;let o=r-rn-$r-Wn,s;e&&t?s=Math.max(vi,i)+Wn:e?s=o:s=Math.max(o,i+Wn);let l=s+(n-1)*Qf+$r+Wn+rn;return Math.max(0,l-r)}function zB(e,t,n){let r=n.axisColumns;if(!t.textSpills||!r)return{lines:e,truncated:!1};let i=Math.max(0,...e.map(g=>se(g,Pr))),{metaText:o,capacityTrailingWidth:s}=t.meta,a=(o?se(o,sl):0)+s,l=Math.max(i,a),c=Jf({barRightX:t.barRightX,iconSpills:t.iconSpills,captionWidth:l,footnoteCount:t.visualWidth<hs?t.footnoteCount:0,dotSpills:t.visualWidth<Cr}),u=r.captionCapX(t.barRightX);if(c.rightX<=u+jB||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(g=>{let w=zA(g,d,Pr);return w!==g&&(p=!0),w}),truncated:p}}var jB=1e-6;function qd(e,t,n){let r=e.properties,i=Se("item",r,n.styleCtx),o=ie(r,"size"),s=o?n.sizes.get(o)??null:null,a=PS(n,e),l=Be(r,"after"),c=Be(r,"before"),u=bs(n,t,a),f=Ex(u),d=MB(ie(r,"link")),p=d.icon!=="none",m=Ex(u),g=Be(r,"labels"),w=[];for(let j of g){let U=n.labels.get(j);if(!U)continue;let ee=Kd(U,n.styleCtx,0,0);w.push({id:U,width:ee.box.width})}let x=0;for(let j=0;j<w.length;j+=1)j>0&&(x+=Xn),x+=w[j].width;let y=Math.max(0,m-2*Fn),E=w.length>0&&x>y,{status:_,progress:T}=FB(r,n),I=GB(i,_,n.styleCtx.theme),B=BB(r,n,s,_,T,I.capacityIcon),$=e.title??e.name??"",X=WB(e.name,n),Y=DS({title:$,visualWidth:f,metaText:B.metaText,metaTrailingWidth:B.capacityTrailingWidth,hasLinkIcon:p,hasAfterGlyph:Rt(l)!==void 0,titleFirstLineRightReservePx:XB(m,X,c)}),D=p&&f<jg,R=Y.fit.textSpills||D,S=zB($S($,Y.fit,D),{textSpills:R,iconSpills:D,barRightX:t+Vd(u)+f,visualWidth:f,footnoteCount:X.length,meta:B},n),O=S.lines,k=E?xk(w,f):null,L=k?k.rows.length:w.length>0?1:0,v=B.metaText!==void 0||B.capacity!==null,P=Zf(O.length,v),b=Gg(O.length,v),F=HB(E,R,L,n.bandScale.bandwidth(),P);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:f,naturalVisualWidth:m,style:I,size:s,status:_,progress:T,meta:B,link:d,chips:{samples:w,outside:E,pack:k,rowCount:L},footnoteIndicators:X,caption:{...Y,title:$,iconSpills:D,lines:O,truncated:S.truncated,lastBaseline:P},barExtra:Math.max(b,F)}}function Zd(e,t,n,r){let i=e.properties,o=Be(i,"after"),s=Be(i,"before"),a=Wl(i,t.x,n);n.waves&&(a=Ur(e,a,n));let l=NS(i,a,n),c=n.scale.startX(a),u=r??qd(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:m,footnoteIndicators:g,caption:w}=u,{metaText:x,ownerDisplay:y,capacity:E,capacityTrailingWidth:_}=u.meta,T=u.link,I=T.icon!=="none",B=u.chips.samples,$=u.chips.outside,X=c,Y=c+f,D=c+bs(n,c,u.durationDays),R=!1,S,O;if(s.length>0){let qe,er;for(let Dt of s){let Ms=_e(Dt),Fs=Ms?n.scale.forwardWithinDomain(Ms)??void 0:n.entityLeftEdges.get(Dt);Fs!==void 0&&(qe===void 0||Fs<qe)&&(qe=Fs,er=Dt)}qe!==void 0&&D>qe&&(R=!0,S={x:qe,y:t.y,width:Y-qe,height:n.bandScale.bandwidth()},O=er)}let k=w.title,L=new Yd(u),v={time:n.scale,bands:n.bandScale,style:d},P=L.place({x:X,y:t.y},v),b=P.box,F=n.bandScale.bandwidth(),j=b.width<Cr,U=w.iconSpills,ee=b.width<hs,V=P.textSpills||U,ne=w.lines,A=u.chips.pack,C=w.lastBaseline,W=u.barExtra,G=[],K=b.y+F-rn-$r-Wn,q=b.y+($&&V?Math.max(vi,C):C)+Wn,re=$&&V||!$&&B.length>0?Math.max(K,q):K,le=$?b.x+b.width+Bn:b.x+Fn,ce=le;if(A)for(let qe=0;qe<A.rows.length;qe+=1){let er=re+qe*Qf,Dt=le;for(let Fs of A.rows[qe]){let EE=Kd(Fs.id,n.styleCtx,Dt,er);G.push(EE),Dt+=EE.box.width+Xn}let Ms=Dt-Xn;Ms>ce&&(ce=Ms)}else{let qe=le;for(let er of B){let Dt=Kd(er.id,n.styleCtx,qe,re);G.push(Dt),qe+=Dt.box.width+Xn}ce=B.length>0?qe-Xn:le}let pe=y??ie(i,"owner"),rt=e.description?.text,ht=g.length>0&&ee,mt=null;if(V){let qe=Math.max(...ne.map(Dt=>se(Dt,Pr))),er=(x?se(x,11):0)+_;mt=Math.max(qe,er)}let Ql=Jf({barRightX:b.x+b.width,iconSpills:U,captionWidth:mt,footnoteCount:ht?g.length:0,dotSpills:j}),{iconSpillX:QN,footnoteSpillStartX:eL,dotSpillCx:tL}=Ql,nL=Math.max(b.x+b.width,Ql.rightX),Ds=e.name;Ds&&(n.entityLeftEdges.set(Ds,X),n.entityRightEdges.set(Ds,D)),kS(e,D,n);let yE=Ds??wx(e);n.itemFlowKey.set(yE,n.currentFlowKey),t.startX=X,t.x=D,t.height=Math.max(t.height,n.bandScale.step()+W);let xE=xS({box:b,afterDate:Rt(o),beforeDate:Rt(s),hasLinkIcon:I,footnoteCount:g.length}),Qn={kind:"item",id:Ds,title:k,...ne.length>=2||ne[0]!==k?{titleLines:ne}:{},box:b,dateSpan:{startX:X,endX:Y},status:p,statusDotColor:LS(p,d.bg,n.styleCtx.theme),progressFraction:m,footnoteIndicators:g,labelChips:G,chipsOutside:$,chipsRightX:ce,linkIcon:T.icon,linkHref:T.href,hasOverflow:R,overflowBox:S,overflowAnchorId:O,owner:pe,description:rt,metaText:x,textSpills:V,dotSpills:j,iconSpills:U,footnoteSpills:ht,dotSpillCx:tL,iconSpillX:QN,footnoteSpillStartX:eL,decorationsRightX:nL,capacity:E,size:u.size,style:d,inlineDatePins:xE.length>0?xE:void 0},ec=IS(e,n);return ec!==void 0&&(Qn.waveRole=ec),ec==="background"&&(Qn.waveHatch=Hd(d.bg)),l!==void 0&&(Qn.nonWorkingPin=l),w.truncated&&(Qn.titleTruncated=!0),ec==="background"&&n.waves&&(Qn.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(yE,Qn),MS(L,v,Qn),Qn}function wx(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function Tx(e){let t=new Map;for(let n of kA(e))Ve(n)&&t.set(n.name??wx(n),n);return t}var YB=.01;function VB(e,t){let n={blocks:[],edges:[]},r=new Map,i=(a,l,c)=>{n.blocks.push({x:a,y:c,width:l,height:0})},o=(a,l)=>{let{box:c}=a;if(a.kind==="item"){n.blocks.push({...c,width:Fl(a)-c.x}),n.edges.push({x:c.x,top:c.y,bottom:c.y+c.height},{x:c.x+c.width,top:c.y,bottom:c.y+c.height});return}l&&a.id&&r.set(a.id,a),a.kind==="group"&&a.waveOnly||(a.headerHeight>0&&n.blocks.push({x:c.x,y:c.y,width:Math.max(c.width,Es(a)-c.x),height:a.headerHeight}),i(c.x,c.width,c.y+c.height),n.edges.push({x:c.x,top:c.y,bottom:c.y+c.height},{x:c.x+c.width,top:c.y,bottom:c.y+c.height}));for(let u of a.children)o(u,l)},s=(a,l)=>{i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let c of a.children)o(c,l);for(let c of a.nested)s(c,l)};for(let a of e)s(a,!0);for(let a of t){i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let l of a.nestedSwimlanes)s(l,!1)}return{obstacles:n,containers:r}}function vx(e,t,n,r){let{obstacles:i,containers:o}=VB(t,n),s=r.bandScale.bandwidth(),a=Se("item",[],r.styleCtx),l=[];for(let[p,m]of e){let g=r.placedItems.get(p);if(!g)continue;let w=mx(g,s);for(let x of Be(m.properties,"after")){let y=r.placedItems.get(x),E=y?void 0:o.get(x),_;if(y?_=mx(y,s):E&&(_=yS(E)),_){l.push({fromId:x,toId:p,source:_,target:w});continue}let T=r.entityMidpoints.get(x);if(!T||w.startX-T.x<=YB)continue;let I=w.rowY??w.top;l.push({fromId:x,toId:p,waypoints:[{x:T.x,y:I},{x:w.paintedX,y:I}],slack:!0,...ws(w.bottom-w.top),style:a})}}let c=l.filter(p=>p!==null&&"source"in p),u=Ok(c,i,r.scale.pixelsPerDay),f=new Map(c.map((p,m)=>[p,u[m]])),d=[];for(let p of l){if(!p)continue;if(!("source"in p)){d.push(p);continue}let m=f.get(p);m&&d.push({...m,style:a})}return d}function Qd(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 Jd=11,KB=120,qB=6,FS="\u2014 ";function WS(e,t,n,r,i=[]){let o=Ht,s=n+Ht,a=r-2*Ht,l=o+2*Ht,c=o+a-Ht,u=s+td+Ht,f=[],d=0,p=(g,w,x)=>{for(let[y,E]of g){let _=E.title??y,T=E.description?.text,I=ZB(_,T,l,c),B=u+d*gs,$=Y=>({x:Y.x,y:B+Y.row*gs,text:Y.text}),X={number:w.footnoteIndex.get(y)??f.length+1,y:B,title:_,titleLines:I.title.map($),description:T,style:Se("footnote",E.properties,w.styleCtx)};I.description.length>0&&(X.descriptionLines=I.description.map($)),x!==void 0&&(X.region=x),f.push(X),d+=I.rows}};p(e,t);for(let g of i){if(g.footnotes.size===0)continue;let w=u+d*gs;d+=1;let x=f.length;p(g.footnotes,g.ctx,g.title),f[x].regionHeadingY=w}return{box:{x:o,y:s,width:a,height:f.length===0?0:td+d*gs+Ht},entries:f}}function ZB(e,t,n,r){let i=r-n,o=BS(e,i,i),s=o.map((g,w)=>({x:n,row:w,text:g}));if(!t)return{title:s,description:[],rows:o.length};let a=se(FS,Jd),l=t.trim().split(/\s+/)[0]??"",c=n+Math.max(KB,e.length*qB),u=o.length===1&&a+se(l,Jd)<=r-c,f=u?c:n,d=u?o.length-1:o.length,p=BS(t,i,r-f-a),m=p.map((g,w)=>({x:w===0?f:n,row:d+w,text:w===0?`${FS}${g}`:g}));return{title:s,description:m,rows:d+p.length}}function BS(e,t,n){if(se(e,Jd)<=n)return[e];let r=wi(e,t,Jd,n);return r.length>0?r:[e]}function Ul(e,t,n){let r=[],i=(o,s,a)=>{let l=_e(ie(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 tp(e,t){return[...QB(e),...eW(t)]}function Ns(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 _x(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function Ax(e){return`working:${e.from.toISOString().slice(0,10)}`}function US(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function QB(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(US(_x(n),n.x,n.label));return t}function eW(e){return(e??[]).map(t=>US(Ax(t),t.x,t.label))}function Bi(e,t,n,r){let i=n;for(let o of e){let s=GS(o,r),a=o.centerX+o.radius+6+s,c=o.centerX-o.radius-6-s>=t&&o.slipFromX===void 0;a>n&&!c&&(i=Math.max(i,a+kt))}return i}function GS(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function np(e){let t=[];for(let n of e)for(let r of n.slackArrows??[])"marker"in r&&r.marker!==n.id&&t.push({from:r.marker,to:n.id});return t}function Ls(e,t,n,r,i=[]){let o=[...e].sort((u,f)=>u.centerX-f.centerX),s=new Map,a=[],l=new Map(e.map(u=>[u.id,u])),c=i.filter(u=>l.has(u.from)&&l.has(u.to));for(let u of o){let f=GS(u,r),d=u.centerX+u.radius+6,p=u.centerX-u.radius-6-f,m=d+f<=n,g=p>=t,w=u.centerX-u.radius,x=u.centerX+u.radius,y=v=>v==="right"?d:p,E=v=>v==="right"?m:g,_=u.slipFromX===void 0?[]:[{left:u.slipFromX-u.radius,right:u.centerX-u.radius}],T=c.filter(v=>v.from===u.id).map(v=>{let P=l.get(v.to);return{left:Math.min(u.centerX,P.centerX)+u.radius,right:Math.max(u.centerX,P.centerX)-P.radius}}).concat(_).filter(v=>v.right>v.left),I=-1,B=Number.POSITIVE_INFINITY;for(let v of c){if(v.to===u.id){let P=s.get(v.from);P&&(B=Math.min(B,P.rowIndex))}if(v.from===u.id){let P=s.get(v.to);P&&(I=Math.max(I,P.rowIndex))}}let $=v=>{let P=y(v);return T.some(b=>b.left<P+f&&b.right>P)},X=v=>E(v)&&!$(v),Y=X("right")||u.slipFromX!==void 0?"right":X("left")?"left":m?"right":"left",D=(v,P)=>{let b=Math.min(w,v),F=Math.max(x,v+f),j=[{left:b,right:F},...T];return a[P].some(U=>j.some(ee=>U.left<ee.right&&U.right>ee.left))},R=-1,S="right",O=d;e:for(let v=a.length-1;v>=0;v--)if(!(v<I||v>B))for(let P of["right","left"]){if(!X(P))continue;let b=y(P);if(!D(b,v)){R=v,S=P,O=b;break e}}if(R===-1&&I>=0&&I<B){let v=I+1;for(let[P,b]of s)b.rowIndex>=v&&s.set(P,{...b,rowIndex:b.rowIndex+1});a.splice(v,0,[]),R=v,S=Y,O=y(S)}else if(R===-1){for(let[v,P]of s)s.set(v,{...P,rowIndex:P.rowIndex+1});a=[[],...a],R=0,S=Y,O=y(S)}let k=Math.min(w,O),L=Math.max(x,O+f);a[R].push({left:k,right:L},...T),s.set(u.id,{rowIndex:R,labelBox:{x:O,y:0,width:f,height:12},labelSide:S})}return{placements:s,rowCount:a.length}}function kx(e,t){let n=[];for(let r of e){let i=t.placedItems.get(r),o=t.entityRightEdges.get(r);if(o===void 0)continue;let s=i?gx(i,t.bandScale.bandwidth()):void 0;if(!i&&t.waves?.plan.index.has(r)){n.push({ref:r,endX:o,y:s,flowKey:`wave:${r}`,wave:r});continue}let a=t.itemFlowKey.get(r)??`marker:${r}`;if(!i&&t.markerIds.has(r)){n.push({ref:r,endX:o,y:s,marker:!0,flowKey:a});continue}n.push({ref:r,endX:o,y:s,flowKey:a})}return n}function Ix(e){let t=new Map;for(let n of e){let r=t.get(n.flowKey);(!r||n.endX>r.endX)&&t.set(n.flowKey,n)}return Array.from(t.values())}function tW(e,t){return Math.abs(t-e.endX)<=12}function HS(e,t){return e.endX>=t||e.wave!==void 0?null:e.y!==void 0?{x:e.endX,y:e.y}:e.marker&&!tW(e,t)?{x:e.endX,marker:e.ref}:null}function nW(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.endX>t.endX)&&(t=n);return t}function rW(e,t){let n;for(let r of e)r.wave===void 0||r.endX-t<Ot||(!n||r.endX>n.endX)&&(n=r);return n}var Rx=class{constructor(t,n){M(this,"id");M(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=Se("milestone",n.properties,t.styleCtx),i=ie(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,m=!1,g,w;if(s){let _=t.scale.forwardWithinDomain(s);if(_===null)return null;u=_,d=!0;let T=t.markerRowPlacements.get(this.id);T&&(f=T.centerY);let I=kx(o,t),B=Ix(I),$=nW(B),X=rW(B,_);w=X?.wave;let Y=Math.max($&&$.endX>_?$.endX:_,X?.endX??_);Y>_&&(m=!0,Y-_>12&&(g=Y))}else if(o.length>0){let _=kx(o,t),T=Ix(_);T.sort(($,X)=>X.endX-$.endX);let I=T[0]?.endX??t.timeline.originX;u=I,d=!1;let B=[];for(let $=1;$<T.length;$++){let X=HS(T[$],I);X&&B.push(X)}B.length>0&&(p=B)}if(u===null)return null;let x={x:u,y:f};t.entityLeftEdges.set(this.id,x.x),t.entityRightEdges.set(this.id,x.x),t.entityMidpoints.set(this.id,x);let y={id:this.id,title:c,x:u,radius:l,fixed:d,slackArrows:p,isOverrun:m,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};g!==void 0&&(y.slipX=g);let E=g??u;return t.waves&&(g!==void 0||!m)&&RS(t.waves,E)&&(y.onWaveBoundary=!0),w!==void 0&&s&&(y.overrunByWave=w,y.overrunDate=Ti(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(y.hiddenDate=Ti(s)),y}};function rp(e,t){let n=[];for(let[r,i]of e){let o=new Rx(r,i).place(t);o&&n.push(o)}return n}function ip(e,t){let n=r=>{let i=t.get(r);if(!i)throw new Error(`layout: marker "${r}" has no marker-row placement`);return i};return e.map(r=>{let i=n(r.id),o={id:r.id,title:r.title,center:{x:r.x,y:i.centerY},radius:r.radius,fixed:r.fixed,slackArrows:r.slackArrows?.map(s=>"y"in s?{x:s.x,y:s.y}:{x:s.x,y:n(s.marker).centerY}),isOverrun:r.isOverrun,style:r.style,cutTopY:r.cutTopY,cutBottomY:r.cutBottomY,labelBox:i.labelBox,labelSide:i.labelSide};return r.slipX!==void 0&&(o.slip={x:r.slipX}),r.onWaveBoundary&&(o.onWaveBoundary=!0),r.overrunByWave!==void 0&&(o.overrunByWave=r.overrunByWave),r.overrunDate!==void 0&&(o.overrunDate=r.overrunDate),r.hiddenDate!==void 0&&(o.hiddenDate=r.hiddenDate),o})}function zS(e,t){let n=[];for(let[r,i]of e){if(_e(ie(i.properties,"date")))continue;let o=kx(Be(i.properties,"after"),t),s=Ix(o);if(s.length===0)continue;s.sort((l,c)=>c.endX-l.endX);let a=s[0].endX;for(let l=1;l<s.length;l++){let c=s[l],u=HS(c,a);u&&"y"in u&&n.push({xStart:c.endX,xEnd:a,y:u.y,slackPredId:c.ref,milestoneId:r})}}return n}var Gl=16,iW=8,oW=6;function YS(e,t,n,r,i,o){Sx(e.content.anchors,t);let s=rp(e.content.milestones,t),a=sW(e.content.anchors,s,t);if(a.length===0)return{anchors:[],milestones:[],laneShift:0};let l=Gl,c=Ls(a,l,Bi(a,l,o-Gl,se),se,np(s)),u=n+iW,f=u+c.rowCount*26+oW-r,d=i+f,p=Ns(c.placements,u);t.markerRowPlacements=p,t.chartTopY=r+f,t.swimlaneBottomY=d;let m=Md(e.content.anchors,t,new Set),g=ip(s.map(w=>({...w,cutTopY:t.chartTopY,cutBottomY:d,slackArrows:w.slackArrows?.map(x=>"y"in x?{x:x.x,y:x.y+f}:x)})),p);return{anchors:m,milestones:g,laneShift:f}}function VS(e,t){let n=[...(e.anchors??[]).map(i=>jS(i,!1)),...(e.milestones??[]).map(i=>jS(i,!0))];return n.length===0?t:Bi(n,e.box.x+Gl,t-Gl,se)+Gl}function KS(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 sW(e,t,n){let r=Ul(e,new Map,n.scale),i=o=>({id:o.id,centerX:o.slipX??o.x,radius:o.radius,title:o.title,fontSize:10,bold:!0,...o.slipX!==void 0?{slipFromX:o.x}:{}});return r.push(...t.filter(o=>o.fixed).map(i)),r.push(...t.filter(o=>!o.fixed).map(i)),r}function jS(e,t){let n="slip"in e?e.slip?.x:void 0;return{id:e.id??"",centerX:n??e.center.x,radius:e.radius,title:e.title,fontSize:10,bold:t,...n!==void 0?{slipFromX:e.center.x}:{}}}function Sx(e,t){for(let n of Ul(e,new Map,t.scale))t.entityLeftEdges.set(n.id,n.centerX),t.entityRightEdges.set(n.id,n.centerX)}var aW=.8,lW=1;function cW(e){let t=[];return ZS(e,t),t}function ZS(e,t){for(let n of e)if(n.kind==="item"){let r=uW(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")&&ZS(n.children,t)}function uW(e){return e.capacity?e.capacity.value:e.size?1:0}function JS(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=cW(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:fW(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 fW(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function QS(e,t){let n=t.get("swimlane"),r=qS(ie(e.properties,"utilization-warn-at"),n?ie(n.properties,"utilization-warn-at"):void 0,aW),i=qS(ie(e.properties,"utilization-over-at"),n?ie(n.properties,"utilization-over-at"):void 0,lW);return{warn:r,over:i}}function qS(e,t,n){let i=hW(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var dW=/^\d+(?:\.\d+)?%$/,pW=/^\d+\.\d+$/;function hW(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(dW.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(pW.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}var op=class{constructor(t){M(this,"rows");M(this,"opts");M(this,"paintedRightX");this.opts=t,this.paintedRightX=t.laneLeftX,this.rows=[{y:t.originY,height:t.minRowHeight,rightEdge:t.laneLeftX,spillX:t.laneLeftX,contentOffsetY:0}]}placeItem(t){let n=this.rows[this.rows.length-1],i=t.desiredStart>=n.rightEdge&&t.desiredStart>=n.spillX&&!this.rowIntersectsCorridor(n,t)&&!this.rowCrossesOwnCorridor(n,t)?n:this.appendRow(Math.max(this.opts.minRowHeight,t.predictedHeight));return{rowIndex:this.rows.length-1,y:i.y+i.contentOffsetY}}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];n.height=Math.max(n.height,n.contentOffsetY+Math.max(t.placed.box.height,t.rowHeight??0)),n.rightEdge=t.logicalEnd,n.spillX=t.spillReservation??this.opts.laneLeftX}commitBlock(t){let n=this.rows[t.rowIndex];n.height=Math.max(n.height,t.blockHeight),n.contentOffsetY=t.contentOffsetY??0,n.rightEdge=t.blockEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,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&&!n.pendingIds?.has(r.slackPredId))}rowCrossesOwnCorridor(t,n){return this.opts.slackCorridors.some(r=>r.slackPredId===n.childId&&r.xStart<n.desiredStart&&t.rightEdge>Math.max(r.xStart,this.opts.laneLeftX))}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,contentOffsetY:0};return this.rows.push(r),r}};function bx(e){return Ve(e)?e.name?[e.name]:[]:vt(e).flatMap(bx)}function sp(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new op({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,l=Number.POSITIVE_INFINITY,c=new Set(vt(e).flatMap(bx)),u=[];for(let f of vt(e)){for(let $ of bx(f))c.delete($);if(!Ve(f)){let $=Bl(f,a,n),{rowIndex:X,y:Y}=s.placeBlock(),D=Xl($,Y),R=r.sequenceOne(f,D,n);u.push(R);let S=R.box.x+R.box.width,O=Math.max(i,D.height),k=tb(R);s.commitBlock({rowIndex:X,placed:R,blockHeight:O,blockEnd:S,contentOffsetY:mW(R),spillReservation:k>S?k:null,paintedRight:Fl(R)}),l=Math.min(l,D.startX),a=Math.max(a,D.x);continue}let d=f,p=Bl(d,a,n),m=n.scale.startX(p),g=qd(d,m,n),w=m+g.naturalWidth,x=i+g.barExtra,{rowIndex:y,y:E}=s.placeItem({childId:d.name??"",desiredStart:m,desiredEnd:w,predictedHeight:x,pendingIds:c}),_=Xl(p,E),T=Zd(d,_,n,g);u.push(T),l=Math.min(l,_.startX);let I=Math.max(m+g.naturalWidth,T.box.x+T.box.width),B=m+bs(n,m,g.durationDays);a=Math.max(a,B),s.commitItem({rowIndex:y,placed:T,logicalEnd:I,spillReservation:eb(T),rowHeight:x})}return l===Number.POSITIVE_INFINITY&&(l=n.scale.startX(o)),{children:u,timeCursorX:a,timeStartX:l,packer:s}}function mW(e){return e.kind==="item"?0:(e.children[0]?.box.y??e.box.y)-e.box.y}function eb(e){return e.textSpills||e.chipsOutside||e.dotSpills||e.iconSpills||e.footnoteSpills?Math.max(e.decorationsRightX,e.chipsOutside?e.chipsRightX:0)+6:null}function tb(e){let t=e.box.x+e.box.width;if(e.kind==="item")return Math.max(t,eb(e)??t);let n=Es(e);return Math.max(t,n>t?n+Nk:t,...e.children.map(tb))}var Nx=10;function gW(e,t,n){let r=ie(e.properties,"capacity"),i=Nr(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=el(i),s=tl(t.capacityIcon,n),a=nl(o,s,Nx),l=rl(o,s,Nx);return{capacity:{value:i,text:o,icon:s,...l!==void 0?{iconDxTerms:l}:{}},badgeWidthPx:a}}var yW=10,xW=38,EW=8;function wW(e,t){let n=ie(e.properties,"owner");if(!n)return;let r=t.teams.get(n);if(r)return{text:r.title??n,kind:"team"};let i=t.persons.get(n);return i?{text:i.title??n,kind:"person"}:{text:n,kind:"team"}}function TW(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 vW(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX(Bl(r,t,n))}var Ps=class{constructor(t,n){M(this,"input");M(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=Se("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}=gW(r,s,n.symbols),d=TW(r,n),p=d.length>0?se(d.join(","),Nx):0,m=0,g=wW(r,n),w=r.title??r.name??"",x=w?Ry(m,w,g?.text,f,p):null,y=x?.rightX??0,E=vW(r,a,n),_=!r.title||E===void 0||E>=y+EW,T=t.y+(_?yW:xW),I=sp(r,{leftX:a,firstRowY:T},n,o),{children:B}=I,$=T-t.y,X=Math.max(l+32,$+I.packer.usedHeight()+16),Y=Math.max(I.packer.usedRightX(),y),D={x:m,y:t.y,width:0,height:X},R=u?(()=>{let{warn:S,over:O}=QS(r,n.styleCtx.defaults);return JS({children:B,capacityValue:u.value,warnFraction:S,overFraction:O})})():null;return n.currentFlowKey=c,{positioned:{id:r.name,title:w,box:D,bandIndex:i,children:B,nested:[],style:s,owner:g?.text,ownerKind:g?.kind,footnoteIndicators:d,capacity:u,tab:x,utilization:R},usedHeight:X,usedRightX:Y}}};var _W=18,AW=14,kW=14,IW=16,RW=24;function Lx(e,t,n,r,i){let o=n+_W,s=[],a=[],l=!0,c=t.footnoteIndex.size;for(let u of e){l||(o+=IW),l=!1;let f=u.content.roadmap?.title??u.sourcePath,d=o+AW,p=zd(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:Qd(u.content.footnotes,c)});c+=u.content.footnotes.size,t.waves?Ud(t.waves,p.entityLeftEdges,p.entityRightEdges):Sx(u.content.anchors,p);let m=[],g=d,w=0;for(let I of u.content.swimlanes.values()){p.nextParallelId=0,p.nextGroupId=0;let{positioned:B,usedHeight:$}=new Ps({lane:I,bandIndex:w},r).place({x:p.timeline.originX,y:g},p);m.push(B),g+=$,w++}let x=YS(u,p,o,d,g,i);if(x.laneShift!==0){for(let I of m)Rs(I,x.laneShift);g+=x.laneShift}let y=g,E=Math.max(t.bandScale.bandwidth(),y-o+kW),_={x:0,y:o,width:0,height:E},T={sourcePath:u.sourcePath,label:f,box:_,nestedSwimlanes:m,style:Se("swimlane",[],t.styleCtx)};x.anchors.length>0&&(T.anchors=x.anchors),x.milestones.length>0&&(T.milestones=x.milestones),s.push(T),a.push(p),o+=E}return{regions:s,contexts:a,endY:o}}function nb(e,t,n){let r=Hl(e,t,n);e.box.width=r;for(let i of e.nestedSwimlanes)i.box.width=r}function Hl(e,t,n){let r=e.box.x,{chromeRightX:i}=vl(r,e.label,e.sourcePath),o=Wr(e.nestedSwimlanes),s=Math.max(i,o,KS(e),n)+RW;return Math.min(t-r,s-r)}function rb(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=jn(n).nowLabel,l=se(a,gl),c=Math.max(Qg,Math.ceil(l+2*ms)),u=t.timeline.originX-kt,f=c/2,d;i-f<u?d="flag-right":i+f>r?d="flag-left":d="center";let p=t.timeline.bottomTickPanelY,m=t.timeline.bottomTickPanelHeight??0,g=p!==void 0&&m>0?p+m:t.swimlaneBottomY;return{x:i,topY:s,bottomY:g,pillTopY:o,pillMode:d,label:a,pillWidth:c,style:Se("item",[],t.styleCtx)}}function ap(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 ib(e){let[t,n,r]=ap(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 lp(e,t){let n=ib(e),r=ib(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var SW=4.5;function ab(e,t,n,r,i){if(!e.frozen||!e.solve)throw new Error("buildWaves: the wave barrier has not settled");let o=Xd(e.plan,e.solve,e.pass,e.origin,e.floors,Ot),s=o.every(y=>y.memberCount===0),a=t.timeline.waveStrip??{y:t.timeline.tickPanelY+t.timeline.tickPanelHeight,height:0};if(!t.timeline.waveStrip&&!s)throw new Error("buildWaves: the timeline has no wave strip");let l=t.timeline.box.x,c=l+t.timeline.box.width,u=a.y+ld,f=a.height-2*ld,d=0,p=o.map((y,E)=>{let _=e.plan.waves[E],T=_.title??y.id,I=y.memberCount===0,B=Gd(y.start,t),$=SS(y.start,y.end,t),X=I?void 0:d++,Y=NW(y.id,t),D=LW(_.properties,X,t),R=Math.max(y.start,l),S=Math.min(y.end,c),O=Math.max(0,S-R),k=Rt(e.plan.floors[E]?.ref!==void 0?[e.plan.floors[E].ref]:[]),L=k!==void 0&&O>=cl+pt+Gn,v=L?pt+nn:0,P,b=!1;if(!I){if(Y.length>0){let K=Y.length*Ut;P=ob(T,y.id,E+1,O,K+v),b=P!==void 0}P??(P=ob(T,y.id,E+1,O,v))}let F=I?y.start:(R+S)/2,j=I?Px(B):`${Px(B)} \u2013 ${Px($)}`,U=[T,j];I?U.push(n.waveNoItems):y.heldBy!==void 0&&U.push(`${n.waveHeldBy} ${y.heldBy}`);let ee,V=o[E-1];if(!s&&V!==void 0&&y.floorRef!==void 0&&y.start-V.end>Ot){let K=Math.max(V.end,l),q=Math.min(y.start,c),J=se(y.floorRef,Un);if(J+2*Gn<=q-K){let re=(K+q)/2,le=J+2*ys;ee={text:y.floorRef,x:re,halo:{x:re-le/2,y:u,width:le,height:f}}}}let ne={x:y.start,y:a.y,width:y.end-y.start,height:a.height},A=I?void 0:bW(ne,t.timeline.box),C,W,G;if(A){L&&k!==void 0&&(G={side:"after",isoDate:k,glyphTopLeft:{x:A.x+cl,y:a.y+(a.height-pt)/2},glyphSize:pt,spilled:!1});let K=A.x+A.width,q=b?Y.length*Ut:0;if(q){let J=K-Gn+ys,re=K-Gn-q-ys;W={rightX:K-Gn,halo:{x:re,y:u,width:J-re,height:f}}}if(P){let J=lb(P.label),re=q?Math.min(F,K-Gn-q-J/2):F,le=G?Math.max(re,G.glyphTopLeft.x+pt+nn+J/2):re,ce=J+2*ys;C={x:le,halo:{x:le-ce/2,y:u,width:ce,height:f}}}}return{id:y.id,title:T,index:E,...X!==void 0?{visibleOrdinal:X}:{},startX:y.start,endX:y.end,startDate:B,endDate:$,memberCount:y.memberCount,empty:I,...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:a.y,width:y.end-y.start,height:a.height},...P?{label:P.label}:{},labelKind:P?.kind??"none",labelX:F,...A?{cell:A}:{},...C?{labelDraw:C}:{},...G?{inlineDatePin:G}:{},...W?{superscripts:W}:{},tooltip:U.join(" \xB7 "),footnotesShown:b,...ee?{gapLabel:ee}:{}},style:D,footnoteIndicators:Y}}),m=s?[]:CW(p,e.origin,a.y,t),g=Ox(r),w=i.map(y=>Ox(y.nestedSwimlanes));return{waves:p,boundaries:m,crossings:sb(g,m),regionCrossings:w.map(y=>sb(y,m)),hasBackground:g.length+w.flat().length>0}}function bW(e,t){let n=Si,r={x:e.x,y:e.y+n,width:e.width,height:e.height-2*n},i={x:t.x+n,y:e.y,width:t.width-2*n,height:e.height},o=Math.max(r.x,i.x),s=Math.max(r.y,i.y),a=Math.min(r.x+r.width,i.x+i.width),l=Math.min(r.y+r.height,i.y+i.height);if(!(a<=o||l<=s))return{x:o,y:s,width:a-o,height:l-s}}function lb(e){return se(e,Un)*1.05}function ob(e,t,n,r,i){let o=a=>lb(a)+i+2*Gn<=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 NW(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 LW(e,t,n){let r=n.styleCtx.theme,i=new Map,o=ie(e,"style"),s=o?n.styleCtx.styles.get(o):void 0;for(let d of s?.properties??[])i.set(Q(d),d.value);let a=d=>{let p=i.get(d);if(p===void 0)return;let m=qn(p,r);return m==="none"?void 0:m},l=a("bg"),c=t!==void 0&&t%2===1?r.wave.stripFillAlt:r.wave.stripFill,u=l?PW(c,l,El)??c:c,f=i.get("border");return{...l?{tint:l}:{},stripFill:c,text:a("text")??OW(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var cp=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function PW(e,t,n){if(!cp.test(e)||!cp.test(t))return;let r=ap(e),i=ap(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function OW(e,t){let n=e.labelText;return!cp.test(n)||!cp.test(t)||lp(n,t)>=SW?n:lp(e.hatch,t)>=lp(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function CW(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<Ot;)a++;let l=i.slice(s,a);s=a;let c=l[0].x;if(Math.abs(c-t)<Ot)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 Ox(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(...Ox(r.nested));return t}function sb(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}function cb(e,t,n,r){if(!e.hasBackground)return;let i=t.timeline.originX,o=n.waveLegendBackground,s=cd+xy,a=s+se(o,Un),l={kind:"background",text:o,swatch:{x:i,y:r+(sd-ud)/2,width:cd,height:ud},hatch:Hd(t.styleCtx.theme.entities.item.bg),runs:[{text:o,x:i+s,y:r+Ey}]};return{box:{x:i,y:r,width:a,height:sd},entries:[l]}}function Px(e){return e.toISOString().slice(0,10)}var ub=1e-6,Os=class{constructor(t){M(this,"domain");M(this,"range");M(this,"pixelsPerDay");M(this,"calendar");M(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?At(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):At(this.domain[0],t)}dayAt(t){let n=(t-this.range[0])/this.pixelsPerDay;return{days:n,day:Math.floor(n+ub)}}forward(t){return this.showsNonWorking?this.range[0]+At(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?Xe(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):Xe(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=Xe(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=Xe(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-ub)-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 up=6,DW=4,fb=8,dp=class{constructor(t){M(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=MW(t,n,i),a=i?Math.max(ry,i.height+20):ry;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?fb:a+fb,minRowsBottomY:o?s.cardHeight+DW: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:up,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 MW(e,t,n){let r=ny-32,i=wi(e,r,16),o=wi(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(Ak-up,Math.min(ny-up,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,m=n?Math.max(p,n.height+20):p,g=u+up;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:m,textCardHeight:p,logoSlot:l,boxWidth:g}}function pp(e){for(let t of e.waves?.values()??[])if(t.memberCount>0)return!0;return!1}function zl(e,t,n={}){let r=Vf(e,t),{config:i,working:o}=r,s=us(t.content.sizes,i),a=ie(e.roadmapDecl?.properties??[],"start"),l=_e(a)??FW(n.today??new Date),c=S=>o.workingIndexOf(l,S),u=S=>o.dateAtWorkingIndex(l,S),f=(S,O)=>Yf(o,l,S,O),d=0,p=S=>{d=Math.max(d,S)},m=new Map,g=new Map,w=new Map,x=new Map,y=new WeakMap,E=new Map,_=new WeakMap,T=new Map;for(let[S,O]of t.content.anchors){let k=_e(ie(O.properties,"date"));if(k){let L=c(k);g.set(S,L),T.set(S,k),p(L)}}let I=()=>({itemEnd:m,anchorEnd:g,milestoneEnd:w,sizes:s,itemResults:x,inByNode:!0}),B=(S,O,k)=>{let L=b=>{if("date"in b)return c(b.date);let F=b.ref;return S.itemEnd.has(F)?S.itemEnd.get(F):S.anchorEnd.has(F)?S.anchorEnd.get(F):S.milestoneEnd.has(F)?S.milestoneEnd.get(F):0},v=(b,F)=>{let j=F;for(let U of vt(b))j=P(U,j),k(j);return j},P=(b,F)=>{if(Ve(b)){let j=KA(b.properties,S.sizes,i),{after:U}=Xr(b.properties),ee=U.length>0?Math.max(F,...U.map(L)):F;O&&(ee=O.apply(b,ee));let V=ee+j,ne={start:u(ee),end:f(ee,V),days:j};return S.inByNode&&y.set(b,ne),b.name&&(S.itemEnd.set(b.name,V),S.itemResults?.set(b.name,ne)),O?.accumulate(b,V),V}if(et(b)){let{after:j}=Xr(b.properties),U=j.length>0?Math.max(F,...j.map(L)):F;O&&(U=O.apply(b,U));let ee=U;for(let V of vt(b))ee=Math.max(ee,P(V,U));return b.name&&S.itemEnd.set(b.name,ee),ee}if($e(b)){let{after:j}=Xr(b.properties),U=j.length>0?Math.max(F,...j.map(L)):F;O&&(U=O.apply(b,U));let ee=v(b,U);return b.name&&S.itemEnd.set(b.name,ee),ee}return F};return{walkLane:v,resolveAfterDay:L}},$=(S,O)=>{let k=_e(ie(S.properties,"date"));if(k)return c(k);let{after:L}=Xr(S.properties);return L.length>0?Math.max(0,...L.map(O)):void 0},X=(S,O)=>{let k=new Map,L=new Map,v=new Map;for(let[F,j]of S.anchors){let U=_e(ie(j.properties,"date"));if(U){let ee=c(U);L.set(F,ee),p(ee)}}let{walkLane:P,resolveAfterDay:b}=B({itemEnd:k,anchorEnd:L,milestoneEnd:v,sizes:us(S.sizes,i),inByNode:O},void 0,p);for(let F of S.swimlanes.values())P(F,0);for(let[F,j]of S.milestones){let U=$(j,b);U!==void 0&&(v.set(F,U),p(U))}for(let F of S.isolatedRegions)X(F.content,!1)},Y=n.plan!==void 0?n.plan??void 0:Di(t),D;if(Y){let S=Y.waves.map(b=>b.name),O=TS(Y,l,o),k,L=0,v=b=>{L=Math.max(L,b)},P=Wd(S.length,0,O,(b,F)=>{let j=S.map((V,ne)=>[V,F[ne]]);m=new Map(j),x=new Map,y=new WeakMap,L=0;let U=new Fi(Y,b),{walkLane:ee}=B(I(),U,v);for(let V of t.content.swimlanes.values())ee(V,0);for(let V of t.content.isolatedRegions){let ne=B({itemEnd:new Map(j),anchorEnd:new Map,milestoneEnd:new Map,sizes:us(V.content.sizes,i),inByNode:!0},U,v);for(let A of V.content.swimlanes.values())ne.walkLane(A,0)}return k=U,U});p(Math.max(L,...P.S,...P.E.slice(-1))),D=new Map;for(let b of Xd(Y,P,k,0,O))D.set(b.id,{index:b.index,start:u(b.start),end:f(b.start,b.end),memberCount:b.memberCount,...b.heldBy!==void 0?{heldBy:b.heldBy}:{},...b.floorRef!==void 0?{floorRef:b.floorRef}:{}})}else{let{walkLane:S}=B(I(),void 0,p);for(let O of t.content.swimlanes.values())S(O,0)}let{resolveAfterDay:R}=B(I(),void 0,p);for(let[S,O]of t.content.milestones){let k=$(O,R);if(k===void 0)continue;let L=_e(ie(O.properties,"date"))??u(k);w.set(S,k),E.set(S,L),_.set(O,L),p(k)}if(!Y)for(let S of t.content.isolatedRegions)X(S.content,!0);return{startDate:l,calendar:r,items:x,byNode:y,milestones:E,milestoneByNode:_,anchors:T,...D?{waves:D}:{},...Y?{plan:Y}:{},resolved:t,extent:{contentEndDay:d}}}function FW(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}var BW=8;function hb(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=pp(i.schedule)?i.schedule.plan:void 0,m=r.roadmapStyle,g=fl[m.headerHeight]??fl.md,w=g>0&&m.timelinePosition!=="bottom",x=g>0&&(m.timelinePosition==="bottom"||m.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",E=ie(e.roadmapDecl?.properties??[],"author"),_=new dp({title:y,author:E,style:m,logo:Uk(e,n.logo)}),T=_.measure(),{chartLeftX:I}=T,B=hk({naturalPixelsPerDay:l.pixelsPerUnit/a.daysPerUnit(l.unit),dayCount:u,chromeWidth:I+2*kt,maxWidth:n.width}),$=u*B,X=I+kt,Y=$,R=n.today!==void 0&&n.today>=c&&n.today<=d?Gt:0,S=w?g:0,O=p?fy:0,k=new Os({domain:[c,d],range:[X,X+$],calendar:a,nonWorking:f}),L=tp(fx(k,[],l.unit,!1),dx(k)),v=t.content.anchors.size+t.content.milestones.size>0||L.length>0,P=X+Y+kt,b=Ul(t.content.anchors,t.content.milestones,k),F=[...b,...L],j=Ls(F,I,Bi(F,I,P,se),se),U=v?Math.max(1,j.rowCount):0,ee=U*26,V=R+S+O+ee,ne=V+BW,A=Fx(T,V),C=A+R,W=C+S,G=W+O,K=Dd(k,l,a,o),q={box:{x:X,y:A,width:$,height:0},ticks:K,pixelsPerDay:B,originX:X,startDate:c,endDate:d,labelStyle:Se("roadmap",[],s),pillRowHeight:R,tickPanelY:C,tickPanelHeight:S,markerRow:{y:G+13,height:ee,collisionY:G-8},minorGrid:m.minorGrid,...p?{waveStrip:{y:W,height:O}}:{}};return Bx(q,k,l.unit),{header:T,headerNode:_,axis:{originX:X,ppd:B,naturalWidth:$,scale:k},naturalChartRightX:P,bands:{timelineY:A,pillRowHeight:R,tickPanelY:C,tickPanelHeight:S,waveStripY:W,markerRowY:G,estimatedMarkerRows:U,rowsHeight:V,chartTopY:A+ne,bottomTickPanelHeight:x?g:0},timeline:q,markers:{datePinned:b,placements:Ns(j.placements,G),hasEntities:v}}}function Fx(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function Bx(e,t,n){let r=fx(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=dx(t);i&&(e.workingExceptions=i)}var mb=8,Wx=class{constructor(t){M(this,"rightX");M(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}},WW;var hp=class{constructor(t,n,r,i,o,s,a){M(this,"file");M(this,"resolved");M(this,"options");M(this,"scope");M(this,"window");M(this,"measured");M(this,"chart");M(this,"canvas");M(this,"chartY");M(this,"draft",{});M(this,"scaleIsFinal",!1);M(this,"band");M(this,"rowsTop");M(this,"rowsBottom");M(this,"why");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new Wx(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=XW(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}explain(t){this.why=t}report(t,n){WW?.(t,n,this.why),this.why=void 0}};function XW(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=Fx(i,Gt+r.rowsHeight),a=s+Gt,l=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Gt,tickPanelY:a,markerRowY:r.markerRowY+l,shift:l}}function UW(e){return e.canvas.grow(e.chart.maxRightX+kt)}function GW(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=Wr(t);for(let I of n)d=Math.max(d,Wr(I.nestedSwimlanes));let p=0;for(let I of e.measured.markers.datePinned)p=Math.max(p,I.centerX+I.radius);let m=0;for(let I of r)I.fixed?p=Math.max(p,I.x+I.radius):m=Math.max(m,I.x+I.radius);for(let I of n){for(let B of I.anchors??[])p=Math.max(p,B.center.x+B.radius);for(let B of I.milestones??[])B.fixed?p=Math.max(p,B.center.x+B.radius):m=Math.max(m,B.center.x+B.radius)}let g=Math.max(d,p,m),w=i.daysPerUnit(o.unit),x=e.scale.showsNonWorking?e.scale.indexAtX(g):(g-c)/u,y=x>0?Mi(s,x,o.unit,w,i):0,E=Ss(t);for(let I of n)E=Math.max(E,Ss(I.nestedSwimlanes));let _=new Is(e.window,e.scale);if(E>0){let I=Math.max(a,y);_.isPast(E,I)&&(y=Math.max(y,Math.min(_.boundaryAtOrAfterX(E),_.captionLimit(I))))}let T=!1;if(y>a){let I={bar:d,caption:E,datedMarker:p,afterMilestone:m};e.explain(Object.keys(I).filter(Y=>I[Y]>0&&_.isPast(I[Y],a)));let B=i.dateAtWorkingIndex(s,y),$=e.scale.showsNonWorking?At(s,B)*u:y*u,X=new Os({domain:[s,B],range:[c,c+$],calendar:i,nonWorking:l});e.extendScale(X),f.endDate=B,f.box.width=$,f.ticks=Dd(X,o,i,e.scope.locale),Bx(f,X,o.unit),e.canvas.grow(c+$+kt),T=!0}return e.settleScale(),T}function HW(e){let t=e.measured.timeline,n=new Map;for(let l of e.chart.milestones)l.slipX!==void 0&&n.set(l.id,l.slipX);let r=e.measured.markers.datePinned.map(l=>{let c=l.isMilestone?n.get(l.id):void 0;return{id:l.id,centerX:c??l.centerX,radius:l.radius,title:l.title,fontSize:l.fontSize,bold:l.bold,...c!==void 0?{slipFromX:l.centerX}:{}}});for(let l of e.chart.milestones)l.fixed||r.push({id:l.id,centerX:l.x,radius:l.radius,title:l.title,fontSize:10,bold:!0});let i=tp(t.nonWorking,t.workingExceptions);r.push(...i),e.draft.markerEntries={all:r,calendarCount:i.length};let o=Bi(r,e.measured.header.chartLeftX,e.canvas.provisional,se),s=gb(e,e.draft.markerEntries);for(let l of e.chart.includes)o=Math.max(o,VS(l,e.canvas.provisional)),o=Math.max(o,l.box.x+Hl(l,Number.POSITIVE_INFINITY,s));let a=e.canvas.grow(o);return e.canvas.freeze(),a}function gb(e,t){let{swimlanes:n,includes:r}=e.chart,i=Math.max(Wr(n),Ss(n));for(let s of r){i=Math.max(i,Wr(s.nestedSwimlanes),Ss(s.nestedSwimlanes));for(let a of[...s.anchors??[],...s.milestones??[]])i=Math.max(i,a.labelBox.x+a.labelBox.width)}if(t){let s=t.all.slice(0,t.all.length-t.calendarCount);for(let a of s){let l=se(a.title,a.fontSize)*(a.bold?1.05:1);i=Math.max(i,a.centerX+a.radius+6+l)}}let o=e.options.today?e.scale.forwardWithinDomain(e.options.today):null;return o!==null&&(i=Math.max(i,o)),i}function zW(e){let t=e.canvas.final,n=e.measured.naturalChartRightX,r=gb(e,Ct(e.draft.markerEntries,"the marker entries")),i=e.chart.swimlanes.length>0&&t!==n;for(let o of e.chart.swimlanes)o.box.width=t;for(let o of e.chart.includes)Hl(o,t,r)!==Hl(o,n,r)&&(i=!0),nb(o,t,r);return i}function jW(e){let t=Ct(e.draft.markerEntries,"the marker entries"),n=Ls(t.all,e.measured.header.chartLeftX,e.canvas.final,se,np(e.chart.milestones)),r=Ns(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||!sX(a,l))&&(o=!0)}return o}function YW(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=ip(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(_x(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(Ax(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 VW(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.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;t.rowCount>i&&(l+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height);let c=r.chartTopY+l;e.chartY.top=c,e.chartY.bottom+=c,e.chartY.swimlaneBottom+=c,s.box.height=e.chartY.bottom-s.box.y;for(let d of e.chart.swimlanes)Rs(d,c);for(let d of e.chart.includes)pS(d,c);let u=e.chart.milestones,f=Ct(e.draft.milestones,"the milestones");for(let d=0;d<f.length;d++)hS(f[d],u[d],c);return a}function KW(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+mb,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=mb+t,!0)}function qW(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=ab(t.waves,t,jn(e.scope.locale),e.chart.swimlanes,e.chart.includes);return n.regionCrossings.forEach((r,i)=>{r.length>0&&(e.chart.includes[i].waveCrossings=r)}),e.draft.waves=n,!0}function ZW(e){e.finalScale(),e.markerBand();let t=new Set(Ct(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=Md(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function JW(e){let t=Tx(e.chart.laneEntries),n=vx(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=vx(Tx([...i.content.swimlanes.values()]),s.nestedSwimlanes,[],a);l.length>0&&(s.edges=l),r+=l.length}),n.length+r>0}function QW(e){e.finalScale();let t=rb(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function eX(e){let t=e.draft.waves;if(!t)return!1;let n=cb(t,e.ctx,jn(e.scope.locale),e.chartY.bottom+ad);return n?(e.chartY.bottom+=ad+n.box.height,e.draft.waveLegend=n,!0):!1}function tX(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=WS(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final,t);return e.draft.footnotes=n,n.entries.length>0}function nX(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 rX(e){let t=Ct(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-kt-ly,y:r+kt,width:ly,height:Ik};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+kt,!0}var iX=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:UW},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:GW},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas","scale"],writes:["markerEntries","canvas"],run:HW},{name:"fitWidths",reads:["placement","canvas","markerEntries","scale"],writes:["laneWidths"],run:zW},{name:"packMarkers",reads:["placement","canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:jW},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:YW},{name:"growHeaderRows",reads:["placement","markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:VW},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:KW},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:qW},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:ZW},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:JW},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:QW},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:eX},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:tX},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:nX},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:rX}];function yb(e,t=iX){for(let n of t)e.report(n.name,n.run(e));return oX(e)}function oX(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:Ct(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Ct(t.header,"the header"),attributionBox:Ct(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Ct(t.nowline,"the now-line"),swimlanes:i,anchors:Ct(t.anchors,"the anchors"),milestones:Ct(t.milestones,"the milestones"),edges:Ct(t.edges,"the edges"),footnotes:Ct(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 Ct(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function sX(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=cX){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(xb(this,t))}has(t){return super.has(xb(this,t))}set(t,n){return super.set(aX(this,t),n)}delete(t){return super.delete(lX(this,t))}};function xb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function aX({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function lX({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function cX(e){return e!==null&&typeof e=="object"?e.valueOf():e}function mp(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 gp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var Eb=Symbol("implicit");function yp(){var e=new Cs,t=[],n=[],r=Eb;function i(o){let s=e.get(o);if(s===void 0){if(r!==Eb)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 yp(t,n).unknown(r)},gp.apply(i,arguments),i}function jl(){var e=yp().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,m=p?i:r,g=p?r:i;o=(g-m)/Math.max(1,d-l+c*2),a&&(o=Math.floor(o)),m+=(g-m-o*(d-l))*u,s=o*(1-l),a&&(m=Math.round(m),s=Math.round(s));var w=mp(d).map(function(x){return m+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 jl(t(),[r,i]).round(a).paddingInner(l).paddingOuter(c).align(u)},gp.apply(f(),arguments)}var Xx=class e{constructor(t,n,r){M(this,"bandwidthPx");M(this,"stepPx");M(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=jl().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}},uX={bandwidth:56,step:64};function wb(){return Xx.fixedRow(uX)}var Tb=8;function vb(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}=r,m=zd(e,{theme:o,cal:a,schedule:c,timeline:p,scale:d,calendar:l,axisColumns:new Is(n,d),bandScale:wb(),waves:u?vS(u,d,f,jn(t.locale).waveBackgroundItem,pp(c)):void 0},{chartTopY:0,chartBottomY:0,swimlaneBottomY:0},{footnotes:Qd(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let v of r.markers.datePinned){let P=m.markerRowPlacements.get(v.id);P&&(m.entityLeftEdges.set(v.id,v.centerX),m.entityRightEdges.set(v.id,v.centerX),m.entityMidpoints.set(v.id,{x:v.centerX,y:P.centerY}))}let g=new Map(m.entityLeftEdges),w=new Map(m.entityRightEdges),x=new Map(m.entityMidpoints),y=()=>{m.entityLeftEdges=new Map(g),m.entityRightEdges=new Map(w),m.entityMidpoints=new Map(x),m.placedItems=new Map,m.itemFlowKey=new Map,m.currentFlowKey="",m.waves&&Ud(m.waves,m.entityLeftEdges,m.entityRightEdges)},E=[...e.content.swimlanes.values()],_=Se("swimlane",[],s),T=Ek[_.spacing]??0,I=()=>{m.nextParallelId=0,m.nextGroupId=0;let v=[],P=m.chartTopY,b=0,F=m.timeline.originX;for(let j of E){b>0&&(P+=T);let{positioned:U,usedHeight:ee,usedRightX:V}=new Ps({lane:j,bandIndex:b},i).place({x:m.timeline.originX,y:P},m);v.push(U),P+=ee,V>F&&(F=V),b++}return{swimlanes:v,nextY:P,maxRightX:F}},B=e.content.isolatedRegions,$,X,Y=m.waves;if(Y){let v,P=bS()?fX(Y.ids,c,d):void 0,b=Wd(Y.ids.length,Y.origin,Y.floors,(F,j)=>(_S(Y,F,j),y(),v=I(),B.length>0&&Lx(B,m,v.nextY+Tb,i,r.naturalChartRightX),Y.pass),Ot,P);AS(Y,b),X={passes:b.passes,capped:b.capped},$=v}else $=I();let D=$.swimlanes,R=$.nextY,S=zS(e.content.milestones,m);S.length>0&&(y(),m.slackCorridors=S,$=I(),D=$.swimlanes,R=$.nextY);let O=[],k=[];if(B.length>0){let v=Lx(B,m,R+Tb,i,r.naturalChartRightX);O=v.regions,k=v.contexts,R=v.endY}m.chartBottomY=R,m.swimlaneBottomY=R;let L=rp(e.content.milestones,m);return{ctx:m,swimlanes:D,includes:O,regionContexts:k,milestones:L,laneEntries:E,maxRightX:$.maxRightX,bottomY:R,...X?{waveSolve:X}:{}}}function fX(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 xp=class{constructor(t,n){M(this,"node");M(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=Se("group",r.properties,n.styleCtx),s=Ur(r,Wl(r.properties,t.x,n),n),a=n.waves!==void 0&&r.title===void 0&&ie(r.properties,"wave")!==void 0&&ie(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=Rt(Be(r.properties,"after")),f=Rt(Be(r.properties,"before")),d=dd({drawn:!a,hasTitle:!!l,hasPins:!!(u||f),hasBracket:o.bracket!=="none"}),p=sp(r,{leftX:s,firstRowY:t.y+d.header+d.pad},n,i),{children:m,timeCursorX:g,timeStartX:w}=p,x=n.bandScale.step(),y=x-n.bandScale.bandwidth(),E=Math.max(x,p.packer.usedHeight())-y,_={x:w,y:t.y,width:g-w,height:d.header+d.pad+E+d.pad};t.startX=_.x,t.x=g,t.height=Math.max(t.height,_.height+y);let T=r.name;T&&(n.entityLeftEdges.set(T,_.x),n.entityRightEdges.set(T,g)),n.currentFlowKey=c;let I=a?[]:Fd({box:_,afterDate:u,beforeDate:f,title:l});return{kind:"group",id:T,title:l,box:_,headerHeight:d.header,children:m,style:o,inlineDatePins:I.length>0?I:void 0,...a?{waveOnly:!0}:{}}}};var Ep=class{constructor(t,n){M(this,"node");M(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=Se("parallel",r.properties,n.styleCtx),s=Ur(r,t.x,n),a=Rt(Be(r.properties,"after")),l=Rt(Be(r.properties,"before")),c=r.title??r.name,u=dd({drawn:!0,hasTitle:!!c,hasPins:!!(a||l),hasBracket:o.bracket!=="none"}),f=t.y+u.header+u.pad,d=[],p=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=0,w=n.currentFlowKey;n.nextParallelId+=1;let x=r.name??`parallel-${n.nextParallelId}`,y=0;for(let X of r.content){if(X.$type==="DescriptionDirective")continue;n.currentFlowKey=`${w}/par:${x}#${y}`;let Y=Xl(s,f+g),D=i.sequenceOne(X,Y,n);d.push(D),g+=Math.max(n.bandScale.step(),Y.height),p=Math.min(p,Y.startX),m=Math.max(m,Y.x),y++}n.currentFlowKey=w,d.length===0&&(p=n.scale.showsNonWorking?n.scale.startX(s):s,m=p);let E=n.bandScale.step(),_=E-n.bandScale.bandwidth(),T=Math.max(E,g)-_,I={x:p,y:t.y,width:m-p,height:u.header+u.pad+T+u.pad};t.startX=I.x,t.x=m,t.height=Math.max(t.height,I.height+_);let B=r.name;B&&(n.entityLeftEdges.set(B,I.x),n.entityRightEdges.set(B,m));let $=Fd({box:I,afterDate:a,beforeDate:l,title:c});return{kind:"parallel",id:B,title:c,box:I,headerHeight:u.header,children:d,style:o,inlineDatePins:$.length>0?$:void 0}}};function dX(e,t,n){return new Ep(e,{sequenceOne:wp}).place(t,n)}function pX(e,t,n){return new xp(e,{sequenceOne:wp}).place(t,n)}function wp(e,t,n){if(Ve(e))return Zd(e,t,n);if(et(e))return dX(e,t,n);if($e(e))return pX(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var Tp=class{place(t,n,r,i){let o={sequenceOne:wp},s=uS(t,n,r),a=fS(t,n,r,s,i),l=hb(t,n,r,s,a),c=vb(n,s,a,l,o);return yb(new hp(t,n,r,s,a,l,c))}};function Ux(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:zl(e,t,{today:n.today,plan:Di(t)??null});return new Tp().place(e,t,n,r)}function vp(e){return e.toISOString().slice(0,10)}function _b(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 Gx(e,t){for(let n of e)n.kind==="item"?t(n):Gx(n.children,t)}function hX(e,t,n){let r=_b(e);e.textSpills&&n.push(sn(t,"NL.I1000","info",{name:r},r)),e.chipsOutside&&n.push(sn(t,"NL.I1001","info",{name:r},r)),(e.box.width<Cr||e.dotSpills||e.iconSpills||e.footnoteSpills)&&n.push(sn(t,"NL.I1002","info",{name:r},r)),e.hasOverflow&&n.push(sn(t,"NL.I1003","info",{name:r,anchor:e.overflowAnchorId},r)),Ab(e,t,n)}function Ab(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=_b(e);n.push(sn(t,"NL.I1008","info",{name:i,pin:r.pin,key:r.key,start:r.start},i))}function sn(e,t,n,r,i){return{message:Pt(e,t,r),severity:n,code:t,entityId:i,lspSeverity:n==="warning"?2:3,data:{code:t,args:r}}}function kb(e,t,n){let r=e.id??e.title,i=[];Gx(e.children,a=>i.push(a));for(let a of i)hX(a,t,n);let o=new Set(i.map(a=>a.box.y));o.size>1&&n.push(sn(t,"NL.I1004","info",{lane:r,rows:o.size},r)),(e.utilization?.segments.some(a=>a.classification==="red")??!1)&&n.push(sn(t,"NL.I1005","info",{lane:r},r));for(let a of e.nested)kb(a,t,n)}function Ib(e,t,n){Gx(e.children,r=>{Ab(r,t,n)});for(let r of e.nested)Ib(r,t,n)}function mX(e,t,n){e.waveSolve?.capped&&n.push(sn(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={names:i};n.push(sn(t,"NL.I1006","info",o,i.length===1?i[0]: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(sn(t,"NL.I1007","info",{name:a,date:o.overrunDate,wave:s.id,end:vp(s.endDate)},a))}}function Hx(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)kb(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)Ib(o,n,r);if(mX(e,n,r),t.today){let i=t.today,o=e.timeline.startDate,s=e.timeline.endDate;(i<o||i>s)&&r.push(sn(n,"NL.W1000","warning",{date:vp(i),start:vp(o),end:vp(s)}))}return r}var Wi=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function zx(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 _p(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 Rb=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,Sb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function bb(e){return(ot.test(e)||Rb.test(e)||Sb.test(e))&&!He(e.slice(0,10))}function jx(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(bb(r))return;let i=_e(r);if(i)return i;let o=Rb.exec(r);if(o){let s=new Date(r);if(!Number.isNaN(s.getTime())){if(o[2]==="Z")return _p(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 _p(s,{kind:"offset",ms:f})}}return Sb.test(r)?_e(r.slice(0,10))??void 0:void 0}return _p(n(),t)}}function gX(e){return e===2?"warning":e===3?"info":"error"}function Nb(e,t){return{severity:gX(e.severity),code:by(e),message:e.message,suggestion:md(e.message,e.data),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function Yx(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function Vx(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function Lb(e,t){if(e.syntax?.origin==="lexer")return Vx(e.syntax.error,e.sourcePath);if(e.syntax?.origin==="parser")return Yx(e.syntax.error,e.sourcePath);let n=(e.range?.start.line??e.line??0)+1,r=(e.range?.start.character??0)+1;if(!Fr(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let i=t?rx(t,e):e.message,o=md(i,e.code===void 0?void 0:{code:e.code,args:e.args??[]});return{severity:e.severity,code:e.code??gd(e.message),message:i,...o===void 0?{}:{suggestion:o},file:e.sourcePath,line:n,column:r}}function Pb(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function Ob(e,t){return{severity:e.severity,code:e.code,message:e.message,file:t,line:1,column:1}}var Cb="__nowline_browser_noop_include__";async function $b(e){throw new Error(`${Cb}: include "${e}" was skipped \u2014 running in single-file mode.`)}function Kx(e){return e.includes(Cb)}function Bb(e,t){let n=t==="image/png"?xX(e):t==="image/jpeg"?EX(e):wX(e);return n&&n.width>0&&n.height>0?n:void 0}var yX=[137,80,78,71,13,10,26,10];function qx(e,t){return e[t]<<8|e[t+1]}function Db(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Mb(e,t){return e[t]|e[t+1]<<8}function Fb(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function Ap(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function xX(e){if(!(e.length<24||yX.some((t,n)=>e[n]!==t))&&Ap(e,12,4)==="IHDR")return{width:Db(e,16),height:Db(e,20)}}function EX(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=qx(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:qx(e,t+7),height:qx(e,t+5)};if(r<2)return;t+=2+r}}function wX(e){if(e.length<16||Ap(e,0,4)!=="RIFF"||Ap(e,8,4)!=="WEBP")return;let t=Ap(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:Mb(e,26)&16383,height:Mb(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+Fb(e,24),height:1+Fb(e,27)}}}var TX=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"]),vX=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"]),_X=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"]),AX=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"]),kX=new Set(["none","normal","auto","initial","inherit","unset"]);function IX(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function RX(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var SX=new Set(["x","y","width","height"]);function Xb(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=bX(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}=NX(a);t.push({kind:s?"self":"open",name:l,attrs:c}),n=i+1}return t}function bX(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 NX(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 Yl(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function LX(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 Ub(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=Xb(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=PX(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(Yl(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"||RX(p)){d.kind==="open"&&f.push(!1);continue}if(!TX.has(p)){r(`sanitizer: dropping unknown element <${p}>`),d.kind==="open"&&f.push(!1);continue}let m=[`<${p}`],g=p==="svg"&&f.length===0,w=OX(d.attrs??{},a,r),x=Object.keys(w).sort();for(let y of x){let E=w[y];if(g&&t.stripRootSize&&SX.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(IX(y)||y==="class")continue;if(!vX.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let T=LX(E,l);if(T===null){r(`sanitizer: dropping external href ${E}`);continue}m.push(` ${y}="${Yl(T)}"`);continue}if(y==="id"){let T=l.get(E);T&&m.push(` id="${Yl(T)}"`);continue}let _=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(E.replace(_,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(E)){let T=E.replace(_,(I,B)=>{let $=l.get(B);return $?`url(#${$})`:"none"});m.push(` ${y}="${Yl(T)}"`);continue}m.push(` ${y}="${Yl(E)}"`)}m.push(d.kind==="self"?"/>":">"),u.push(m.join("")),d.kind==="open"&&f.push(!0);continue}d.kind==="close"&&f.pop()&&u.push(`</${d.name}>`)}return u.join("")}function Wb(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 kp(e){let t=Xb(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=Wb(n.width),i=Wb(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 Gb(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 PX(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:Gb(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function OX(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(...Gb(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)_X.has(s)?o[s]=a:!s.startsWith("-")&&!AX.has(s)&&!kX.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var CX={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function $X(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function Hb(e,t,n){if(!e||!t)return;let r=$X(e),i=CX[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"?kp(new TextDecoder().decode(s)):Bb(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 DX=1,MX=0;function FX(){return Ce.parse(`memory:///stage-${++MX}.nowline`)}async function BX(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,FX());return await t.DocumentBuilder.build([n],{validation:!0}),n}function WX(e){return e.origin!=="validation"||e.diagnostic.severity===DX}async function Zx(e){let t=await BX(e),n=bi(t);if(n.some(WX))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await Hy(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource,includePolicy:e.includePolicy}),o=e.isToleratedIncludeError??(()=>!1),s=T=>T.severity!=="error"||!o(T),a=i.diagnostics.filter(T=>T.severity==="error"&&s(T)),l=i.diagnostics.filter(T=>Fr(T)&&s(T)),c=a.find(T=>!Fr(T));if(c)return{kind:"include-error",document:t,legacy:c,routed:[],resolved:i};if(a.length>0)return{kind:"include-error",document:t,routed:l,resolved:i};let u=[],f=await Hb(hd(r),e.assetResolver,T=>u.push(T)),{theme:d,today:p,width:m,locale:g,nonWorking:w}=e.layout,x={theme:d,today:p,width:m,locale:g,nonWorking:w},y=Di(i)??null,E=zl(r,i,{today:p,plan:y}),_=Ux(r,i,{...x,schedule:E,logo:f?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:l,logo:f,warnings:u,plan:y,schedule:E,model:_,layout:x}}var zb=/&/g,jb=/</g,Yb=/>/g,XX=/"/g,UX=/'/g;function tt(e){return e.replace(zb,"&amp;").replace(jb,"&lt;").replace(Yb,"&gt;")}function an(e){return e.replace(zb,"&amp;").replace(jb,"&lt;").replace(Yb,"&gt;").replace(XX,"&quot;").replace(UX,"&#39;")}function $s(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}="${an(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function z(e,t,n){return n===void 0||n===""?`<${e}${$s(t)}/>`:`<${e}${$s(t)}>${n}</${e}>`}function ae(e,t){return`<text${$s(e)}>${tt(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var zX="3 3";function Ip(e,t){let n=e.waypoints;if(n.length<2)return"";let r=t.dependency.edgeStroke,i=n[n.length-1],o=n[n.length-2],s=Math.hypot(i.x-o.x,i.y-o.y);if(s===0)return"";let a=(i.x-o.x)/s,l=(i.y-o.y)/s,c=e.headWidth/2,u=e.head==="dot"?c:e.headWidth*5/7,f=s>u?[...n.slice(0,-1),{x:i.x-a*u,y:i.y-l*u}]:n.slice(0,-1),d=[jX(f,e.slack,r)],p=t.arrowhead.neutral;if(e.head==="dot")d.push(z("circle",{cx:h(i.x-a*c),cy:h(i.y-l*c),r:h(c),fill:p}));else{let m=i.x-a*u,g=i.y-l*u;d.push(z("path",{d:`M${h(m-l*c)} ${h(g+a*c)} L${h(i.x)} ${h(i.y)} L${h(m+l*c)} ${h(g-a*c)} z`,fill:p}))}return z("g",{"data-layer":"dependency"},d.join(""))}function jX(e,t,n){if(e.length<2)return"";let r={fill:"none",stroke:n,"stroke-width":1.1,"stroke-linejoin":"round"};if(!t)return z("path",{d:VX(e,od),...r});let{solid:i,dotted:o}=YX(e,od);return(i?z("path",{d:i,...r}):"")+(o?z("path",{d:o,...r,"stroke-dasharray":zX,"stroke-linecap":"round"}):"")}function YX(e,t){let n=e.length,r=[],i=[],o=[];for(let a=1;a<n-1;a++){let l=e[a-1],c=e[a],u=e[a+1],f=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(u.x-c.x,u.y-c.y),p=Math.min(t,f/2,d/2),m={x:Math.sign(c.x-l.x),y:Math.sign(c.y-l.y)},g={x:Math.sign(u.x-c.x),y:Math.sign(u.y-c.y)};r[a]={x:c.x-m.x*p,y:c.y-m.y*p},i[a]={x:c.x+g.x*p,y:c.y+g.y*p},p>0&&o.push(`M${h(r[a].x)} ${h(r[a].y)} Q${h(c.x)} ${h(c.y)} ${h(i[a].x)} ${h(i[a].y)}`)}let s=[];for(let a=0;a<n-1;a++){let l=a===0?e[0]:i[a],c=a===n-2?e[n-1]:r[a+1],u=`M${h(l.x)} ${h(l.y)} L${h(c.x)} ${h(c.y)}`;Math.abs(e[a+1].y-e[a].y)<1e-9?s.push(u):o.push(u)}return{solid:o.join(" "),dotted:s.join(" ")}}function VX(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 m={x:o.x-a*p,y:o.y-l*p},g={x:o.x+c*p,y:o.y+u*p};n.push(`L${h(m.x)} ${h(m.y)}`),n.push(`Q${h(o.x)} ${h(o.y)} ${h(g.x)} ${h(g.y)}`)}return n.join(" ")}function Vb(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(z("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(ae({x:h(e.box.x+Ht),y:h(e.box.y+iy),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Ht;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(ae({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(ae({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(ae({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(ae({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:l},p.text))}return z("g",{"data-layer":"footnotes"},u.join(""))}function Kb(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=z("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,_)=>{p.push(ae({x:h(f),y:h(d+26+_*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},E))});let m=p.join(""),g=d+26+Math.max(0,e.titleLines.length-1)*20,w=n.header.author,x=[];e.authorLines.forEach((E,_)=>{x.push(ae({x:h(f),y:h(g+18+_*14),"font-family":r[e.style.font],"font-size":11,fill:w},E))});let y=x.join("");return z("g",{"data-layer":"header","data-id":`${t}-header`},u+m+y)}function qb(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=Dr,a=ae({x:"0",y:s,"font-family":t.sans,"font-size":rd,"font-weight":400,fill:n},nd)+ae({x:xl,y:s,"font-family":t.sans,"font-size":Dr,"font-weight":700,fill:n},"now")+z("rect",{x:sy,y:12,width:ay,height:Dr,fill:r})+ae({x:id,y:s,"font-family":t.sans,"font-size":Dr,"font-weight":400,fill:n},"ine"),l=z("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(yl)})`},a);return z("a",{href:oy,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},z("g",{"data-layer":"attribution"},l))}async function Zb(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??kp(d)??{width:a,height:l},m=new Set,g=Ub(d,{idPrefix:`${n}-logo`,onWarn:w=>m.add(w.replace(/^sanitizer: dropping /,"")),stripRootSize:!0});return m.size>0&&r.warn?.(`logo ${i}: removed unsupported SVG content: ${[...m].join(", ")}`),z("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"},g)}if(u==="image/png"||u==="image/jpeg"||u==="image/jpg"||u==="image/webp"){let d=KX(c.bytes);return z("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 KX(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 Rp=class{constructor(t="nl"){M(this,"prefix");M(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};function Sp(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,l=z("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?ae(f,e.title):"";return z("g",{"data-layer":"anchor","data-id":e.id??null},Jb(e.hiddenDate)+l+d)}function bp(e,t){let n=t.anchorDiamond.cutLine;return z("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 Np(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.cutLineOverrun,a=(m,g)=>z("path",{d:`M${h(m)} ${h(i-o)} L${h(m+o)} ${h(i)} L${h(m)} ${h(i+o)} L${h(m-o)} ${h(i)} Z`,fill:g,stroke:g,"stroke-width":1}),l=e.slip?.x,c;l!==void 0?c=a(r,s)+z("path",{d:`M${h(r+o)} ${h(i)} H${h(l-o)}`,fill:"none",stroke:s,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round"})+a(l,t.milestoneDiamond.fill):c=a(r,e.isOverrun?s:t.milestoneDiamond.fill);let u=e.isOverrun&&l===void 0?s:t.milestoneDiamond.label,f=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,d={x:h(f),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:u};e.labelSide==="left"&&(d["text-anchor"]="end");let p=e.title?ae(d,e.title):"";return z("g",{"data-layer":"milestone","data-id":e.id??null},Jb(e.hiddenDate)+c+p)}function Jb(e){return e===void 0?"":`<title>${tt(e)}</title>`}function Lp(e,t,n){let r=e.slip?.x??e.center.x,i=e.isOverrun&&e.slip===void 0?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,o=[];if(e.onWaveBoundary||o.push(z("line",{x1:h(r),y1:h(e.center.y+e.radius+1),x2:h(r),y2:h(e.cutBottomY),stroke:i,"stroke-width":2,"stroke-dasharray":ml,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0)for(let s of e.slackArrows)o.push(z("path",{d:`M${h(s.x)} ${h(s.y)} H${h(e.center.x-6)}`,fill:"none",stroke:n.milestoneDiamond.slack,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-arrow-dark)`}));return o.join("")}var wn={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"}},qX={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"}},Qb={...wn,...qX};var _ae={none:"",multiplier:"x",person:wn.person.ascii,people:wn.people.ascii,points:wn.points.ascii,time:wn.time.ascii};var ZX={thin:100,light:300,normal:400,bold:700};function JX(e){return ki[e]??14}function Pp(e,t,n){return{"font-family":t[e.font],"font-size":n??JX(e.textSize),"font-weight":ZX[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function QX(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function eN(e,t,n,r,i,o={}){let s=Math.min(Ii[i.cornerRadius]??4,r/2,n/2);return z("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":QX(i)??null,...o})}function Op(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 eU={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 tU(e,t){let n=`${e}-shadow-${t}`,r=eU[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 z("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function tN(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function nN(e){return["subtle","soft","hard"].map(t=>tU(e,t)).join("")}var nU=4,rU=8,iU=10;function rN(e,t){return`url(#${e}-wave-hatch-${t})`}function iN(e,t,n){let r=my;return z("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},z("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":gy,opacity:hy}))}function oN(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&o.waveHatch&&t.add(o.waveHatch):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);for(let i of e.waveLegend?.entries??[])t.add(i.hatch);return["dark","light"].filter(i=>t.has(i))}function sN(e,t,n,r){let o=Math.min(Ii[t.cornerRadius]??4,e.height/2);return z("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(o),ry:h(o),fill:rN(r,n)})}var Jx=4;function oU(e,t){let n=Math.min(Jx-Si,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+Si+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-Si-r?n:0}}function sU(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 Qx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?z("path",{d:sU(t,n),...o}):z("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":El}):i}function aN(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[z("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:Jx,ry:Jx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=o.strip.cell;s&&i.push(z("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${Qx(o,s,oU(s,n))}`))}return z("g",{"data-layer":"wave-strip"},i.join(""))}function Cp(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?Op(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(z("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":yy}))}return n.length===0?"":z("g",{"data-layer":"wave-bg"},n.join(""))}function $p(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(z("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":dy,"stroke-dasharray":r.dash}))}return n.length===0?"":z("g",{"data-layer":"wave-boundary"},n.join(""))}function lN(e,t,n){let i=e.timeline.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+nU,s=[],a=(l,c,u)=>z("rect",{x:h(u.x),y:h(u.y),width:h(u.width),height:h(u.height),fill:t.timeline.panelFill})+ae({x:h(l),y:h(o),"font-family":n.sans,"font-size":Un,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},c);for(let l of e.waves){if(l.strip.gapLabel){let{text:d,x:p,halo:m}=l.strip.gapLabel;s.push(a(p,d,m))}if(!l.strip.cell)continue;let{labelDraw:c,superscripts:u,inlineDatePin:f}=l.strip;if(f&&s.push(Vl([f],l.style.text)),u&&s.push(Qx(l,u.halo)),l.strip.label!==void 0&&c&&(s.push(Qx(l,c.halo)),s.push(ae({x:h(c.x),y:h(o),"font-family":n.sans,"font-size":Un,"font-weight":600,fill:l.style.text,"text-anchor":"middle"},l.strip.label))),u){let d=u.rightX;for(let p=l.footnoteIndicators.length-1;p>=0;p--)s.push(ae({x:h(d),y:h(i.y+iU),"font-family":n.sans,"font-size":rU,"font-weight":700,fill:l.style.text,"text-anchor":"end"},String(l.footnoteIndicators[p]))),d-=Ut}}return s.length===0?"":z("g",{"data-layer":"wave-labels"},s.join(""))}function Dp(e){if(!e||e.length===0)return"";let t=e.map(n=>z("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":py}));return z("g",{"data-layer":"wave-cross"},t.join(""))}function aU(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function cN(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch,a=aU(n),l={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(z("rect",{...l,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(z("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:rN(t,o.hatch)}));for(let c of o.runs)i.push(ae({x:h(c.x),y:h(c.y),"font-family":r.sans,"font-size":Un,fill:n.wave.labelText},c.text))}return z("g",{"data-layer":"wave-legend"},i.join(""))}function uN(e,t){let n=e;for(let r of t.iconDxTerms??[])n+=r;return n}function eE(e,t,n,r,i,o){let s=t,{text:a,icon:l}=e,c={"font-family":i,"font-size":r,fill:o};if(!l)return ae({x:h(s),y:h(n),...c},a);if(l.kind==="builtin"&&l.name==="multiplier")return ae({x:h(s),y:h(n),...c},`${a}\xD7`);if(l.kind==="builtin"){let f=wn[l.name],d=ae({x:h(s),y:h(n),...c},a),p=r,m=uN(t,e),g=n-r*.85,w=`<svg x="${h(m)}" y="${h(g)}" width="${h(p)}" height="${h(p)}" viewBox="${f.viewBox}" style="color:${an(o)}" aria-hidden="true">${f.body}</svg>`;return d+w}let u=h(r*.1);return`<text x="${h(s)}" y="${h(n)}" font-family="${an(i)}" font-size="${r}" fill="${an(o)}">${tt(a)}<tspan dx="${u}">${tt(l.text)}</tspan></text>`}function lU(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 ae({x:h(r),y:h(i),...l},t);if(!t)return eE(n,r,i,o,s,a);let c=h(o*as),u=`<text x="${h(r)}" y="${h(i)}" font-family="${an(s)}" font-size="${o}" fill="${an(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 T=h(o*.1);return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan><tspan dx="${T}">${tt(d.text)}</tspan></text>`}let p=n.iconDxTerms??[],m=r;for(let T of p.slice(0,2))m+=T;let g=wn[d.name],w=o,x=uN(r,n),y=i-o*.85,E=u+tt(t)+"</text>"+ae({x:h(m),y:h(i),...l},f),_=`<svg x="${h(x)}" y="${h(y)}" width="${h(w)}" height="${h(w)}" viewBox="${g.viewBox}" style="color:${an(a)}" aria-hidden="true">${g.body}</svg>`;return E+_}function cU(e,t){let n=Qb.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:${an(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${tt(e.isoDate)}</title>`;return z("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function Vl(e,t){return!e||e.length===0?"":e.map(n=>cU(n,t)).join("")}function fN(e){return e?.some(t=>t.side==="after")??!1}function uU(e){let t=[];return e.titleTruncated&&t.push(e.title),e.waveTooltip!==void 0&&t.push(e.waveTooltip),t.length>0?`<title>${tt(t.join(`
2920
- `))}</title>`:""}function fU(e,t){let n=[],r=tN(t,e.style.shadow);return n.push(eN(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:r??null})),e.waveRole==="background"&&e.waveHatch&&n.push(sN(e.box,e.style,e.waveHatch,t)),n.join("")}function dU(e){if(e.progressFraction>0){let t=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));return z("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-rn),width:h(t),height:rn,fill:e.style.fg,opacity:.55})}return""}function pU(e){let t=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-_i;return z("circle",{cx:h(t),cy:h(e.box.y+Hg),r:Lr,fill:e.statusDotColor})}function hU(e,t){let n;if(e.textSpills)n=e.box.x+e.box.width+Bn,e.iconSpills&&(n+=Or+Xt);else{let r=!!e.linkIcon&&e.linkIcon!=="none",o=e.inlineDatePins?.find(s=>s.side==="after"&&!s.spilled)?ps(r,{barWidth:e.box.width}):ps(!t.noLinks&&r&&!e.iconSpills);n=e.box.x+o}return n}function mU(e,t,n,r){let i=[],o=e.style.text,s=n.entities.item.text,a=e.textSpills?s:o,l=e.textSpills?s:e.style.fg,c=e.titleLines??(e.title?[e.title]:[]);return c.forEach((u,f)=>{u!==""&&i.push(ae({x:h(t),y:h(e.box.y+Kf+f*al),"font-family":r[e.style.font],"font-size":Pr,"font-weight":600,fill:a},u))}),(e.metaText||e.capacity)&&i.push(lU({metaText:e.metaText,capacity:e.capacity,x:t,baselineY:e.box.y+qf(c.length),fontSize:sl,fontFamily:r[e.style.font],color:l})),i.join("")}function gU(e,t,n){let r=[],i=t.entities.item.text;if(e.footnoteIndicators.length>0){let o=e.box.y+zg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let s=e.footnoteSpillStartX;for(let a=0;a<e.footnoteIndicators.length;a++){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":ll,"font-weight":700,fill:i},String(l))),s+=Ut}}else{let s=e.box.x+e.box.width-ds;for(let a=e.footnoteIndicators.length-1;a>=0;a--){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":ll,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(l))),s-=Ut}}}return r.join("")}function yU(e,t,n){let r=[];if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let i={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},o=i[e.linkIcon]??i.generic,s=Or,a=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,l=e.box.y+Ai,c=z("rect",{x:h(a),y:h(l),width:s,height:s,rx:2,ry:2,fill:o}),u=a,f=l,d=z("path",{d:`M${h(u+4)} ${h(f+10)} L${h(u+10)} ${h(f+4)} M${h(u+6)} ${h(f+4)} H${h(u+10)} V${h(f+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),p=c+d,m=e.linkHref?z("a",{href:e.linkHref,target:"_blank",rel:"noopener"},p):p;r.push(m)}return r.join("")}function xU(e,t,n){let r=[];if(e.hasOverflow&&e.overflowBox){let i=t.item.overflowTailFill,o=t.item.overflowTailStroke,s=t.item.overflowCaption;r.push(z("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:i,stroke:o,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&r.push(ae({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":n.sans,"font-size":9,"font-weight":700,fill:s,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}return r.join("")}function EU(e,t){let n=[];for(let r of e.labelChips){let i=Math.min(Ii[r.style.cornerRadius]??8,r.box.height/2);n.push(z("rect",{x:h(r.box.x),y:h(r.box.y),width:h(r.box.width),height:h(r.box.height),rx:h(i),ry:h(i),fill:r.style.bg==="none"?"transparent":r.style.bg,stroke:r.style.fg,"stroke-width":.5})),n.push(ae({x:h(r.box.x+r.box.width/2),y:h(r.box.y+r.box.height/2+3),...Pp(r.style,t,ki.xs),"text-anchor":"middle"},r.text))}return n.join("")}function dN(e,t,n,r,i){let o=[];return o.push(uU(e)),o.push(fU(e,n)),o.push(dU(e)),o.push(pU(e)),o.push(Vl(e.inlineDatePins,e.style.fg)),o.push(mU(e,hU(e,t),r,i)),o.push(gU(e,r,i)),o.push(yU(e,t,r)),o.push(xU(e,r,i)),o.push(EU(e,i)),z("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function wU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let l=e.box.y+e.headerHeight,c=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=_y;s.push(z("rect",{x:h(e.box.x),y:h(l),width:h(e.box.width),height:h(c),fill:f?e.style.bg:"none","fill-opacity":f?t===1?Ty:vy:null,stroke:f?null:e.style.bg,"stroke-opacity":f?null:.6,"stroke-width":f?null:1}))}let u=e.kind==="group"?e.style.fg:i.parallel.bracketStroke;if(e.headerHeight>0&&e.style.bracket!=="none"){let f=e.box.y+wl,d=e.box.x,p=e.box.x+e.box.width;s.push(z("path",{d:`M${h(d)} ${h(l)} V${h(f)} H${h(p)} V${h(l)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(ae({x:h(xs(e.box.x,fN(e.inlineDatePins))),y:h(e.box.y+wy),...Pp(e.style,o,fd),"font-weight":600,fill:u},e.title)),s.push(Vl(e.inlineDatePins,e.style.fg))}for(let l of e.children)s.push(hN(l,n,r,i,o,t));return z("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function hN(e,t,n,r,i,o=0){return e.kind==="item"?dN(e,t,n,r,i):wU(e,o+1,t,n,r,i)}var pN=2;function TU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function vU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-pN,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":z("rect",{x:h(i.startX),y:h(n),width:h(o),height:pN,fill:TU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return z("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function mN(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return z("g",{"data-layer":"swimlane-bg","data-id":e.id??null},z("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 Mp(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=[],f=e.tab;if(f){let p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=pl,g=e.box.y+10,w=g+hl;if(u.push(z("rect",{x:h(f.tabX),y:h(g),width:h(f.tabW),height:h(m),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(ae({x:h(f.titleX),y:h(w),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner){let x=wn[e.ownerKind==="person"?"person":"people"],y=Tl;u.push(`<svg x="${h(f.ownerX)}" y="${h(w-y*.85)}" width="${h(y)}" height="${h(y)}" viewBox="${x.viewBox}" style="color:${an(l)}" aria-hidden="true">${x.body}</svg>`),u.push(ae({x:h(f.ownerTextX),y:h(w),"font-family":i[e.style.font],"font-size":10,fill:l},e.owner))}e.capacity&&u.push(eE(e.capacity,f.badgeX,w,10,i[e.style.font],l)),p&&u.push(ae({x:h(f.footnoteRightX),y:h(g+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let d of e.children)u.push(hN(d,t,n,r,i));return u.push(vU(e,r)),z("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function yN(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(z("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(z("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(z("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 z("g",{"data-layer":"grid"},f.join(""))}function Fp(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?Op(a,r):a;!l||l.width<=0||l.height<=0||o.push(z("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":uy}))}return o.length===0?"":z("g",{"data-layer":"non-working"},o.join(""))}function xN(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(z("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(gN(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(gN(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":z("g",{"data-layer":"non-working-label"},i.join(""))}function gN(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"),ae(a,e)}function EN(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,m=e.bottomTickPanelHeight??0,g=p!==void 0&&m>0;c&&s.push(z("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(z("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})),g&&s.push(z("rect",{x:h(e.box.x),y:h(p),width:h(e.box.width),height:h(m),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(ae({x:h(w.labelX),y:h(a+dl(l)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},w.label)),g&&s.push(ae({x:h(w.labelX),y:h(p+dl(m)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},w.label))));return z("g",{"data-layer":"timeline"},s.join(""))}function wN(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,m=e.box.x+8,g=e.box.y,w=e.box.width-16,x=e.box.height,y=z("rect",{x:h(m),y:h(g),width:h(w),height:h(x),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":ml}),E=pl,_=vl(e.box.x,e.label,e.sourcePath),T=g-E/2,I=z("rect",{x:h(_.tabX),y:h(T),width:h(_.tabWidth),height:E,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),B=ae({x:h(_.tabLabelX),y:h(T+hl),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),$=_.badgeX,X=_.badgeSize,Y=g-X/2,D=z("rect",{x:h($),y:h(Y),width:X,height:X,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),R=z("path",{d:`M${h($+7)} ${h(Y+4)} H${h($+14)} V${h(Y+11)} M${h($+4)} ${h(Y+7)} H${h($+11)} V${h(Y+14)} H${h($+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),S=9,O=g+4,k=z("rect",{x:h(_.sourceHaloX),y:h(O-S),width:h(_.sourceHaloWidth),height:S+6,fill:a}),L=ae({x:h(_.sourceTextX),y:h(O),"font-family":i.mono,"font-size":S,fill:p},e.sourcePath),v={x:m,y:g,width:w,height:x},P=o?Fp(o.timeline,o.chartBox.y,r,v):"",b=o?.waves?Cp(o.waves,v)+$p(o.waveBoundaries,v):"",F=o?.waves?Dp(e.waveCrossings):"",j=e.nestedSwimlanes.map(A=>Mp(A,t,n,r,i)).join(""),U=(e.edges??[]).map(A=>Ip(A,r)).join(""),ee=e.anchors??[],V=e.milestones??[],ne=ee.map(A=>bp(A,r)).join("")+V.map(A=>Lp(A,n,r)).join("")+ee.map(A=>Sp(A,r,i)).join("")+V.map(A=>Np(A,r,i)).join("");return z("g",{"data-layer":"include"},y+P+b+U+j+F+ne+I+B+D+R+k+L)}function TN(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=z("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":ed}),s=_U(e,r),a=AU(e,i,n);return z("g",{"data-layer":"nowline"},o+s+a)}function vN(e){let t=ed/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function _U(e,t){let n=e.pillTopY,r=e.pillTopY+Gt,i=ey,o=e.pillWidth;if(e.pillMode==="center")return z("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Gt),rx:i,ry:i,fill:t});let s=vN(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 z("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 z("path",{d:l,fill:t})}function AU(e,t,n){let r=e.pillTopY+ty,i=vN(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+ms,s="start"):(o=i-ms,s="end"),ae({x:h(o),y:h(r),"font-family":n.sans,"font-size":gl,"font-weight":700,fill:t,"text-anchor":s},e.label)}async function tE(e,t={}){let r=new Rp(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??cy,s=[],a=(u,f)=>`<marker id="${u}" 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="${f}"/></marker>`,l=`<defs>${nN(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+oN(e).map(u=>iN(r,u,i)).join("")+"</defs>";s.push(l),s.push(z("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(EN(e.timeline,i,o)),s.push(aN(e,i));for(let u of e.swimlanes)s.push(mN(u,i));s.push(Fp(e.timeline,e.chartBox.y,i)),e.waves&&s.push(Cp(e.waves)),s.push(yN(e.timeline,e.chartBox.y,i)),s.push($p(e.waveBoundaries)),s.push(lN(e,i,o));for(let u of e.edges)s.push(Ip(u,i));for(let u of e.swimlanes)s.push(Mp(u,t,r,i,o));for(let u of e.includes)s.push(wN(u,t,r,i,o,e));s.push(Dp(e.waveCrossings));for(let u of e.anchors)s.push(bp(u,i));for(let u of e.milestones)s.push(Lp(u,r,i));s.push(xN(e.timeline,i,o));for(let u of e.anchors)s.push(Sp(u,i,o));for(let u of e.milestones)s.push(Np(u,i,o));if(s.push(TN(e.nowline,i,o)),s.push(Vb(e.footnotes,r,i,o)),s.push(cN(e.waveLegend,r,i,o)),s.push(Kb(e.header,r,i,o)),s.push(qb(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await Zb(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${$s({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 nE="/browser-source.nowline",kU={error:3,warning:2,info:1},IU={error:3,warning:2,info:1};function _N(e,t){return kU[e]>=IU[t]}var Bp,AN=0;function kN(){return Bp||(Bp=nx()),Bp}function RU(){return Ce.parse(`memory:///nowline-browser-${++AN}.nowline`)}async function rE(e,t={}){let n=t.filePath??nE,r=kN(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,RU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:IN(o,n)}}function IN(e,t){return RN(bi(e),t)}function RN(e,t){return e.map(n=>n.origin==="lexer"?Vx(n.error,t):n.origin==="parser"?Yx(n.error,t):Nb(n.diagnostic,t))}async function iE(e,t={}){let n=t.filePath??nE,r=kN(),i,o;if(t.timezone)try{i=zx(t.timezone)}catch(E){if(!(E instanceof Wi))throw E;o=E}let s=o?void 0:jx({now:t.today,zone:i}),a=await Zx({source:e,sourcePath:n,services:r,readSource:t.readFile??$b,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:RN(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=IN(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&&Fr(E)||c.push(Lb(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",m=Hx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(E=>Ob(E,n)),g=t.showLinks!==!1,w=t.strict===!0,x=await tE(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:w,warn:E=>u.push(E),fontFamilies:t.fontFamilies}),y=[...m,...u.map(E=>Pb(E,n,w?"error":"warning"))].filter(E=>_N(E.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function oE(){Bp=void 0,AN=0}var SN="/embed.nowline",sE=!1;async function bN(e){let{ast:t,diagnostics:n}=await rE(e,{filePath:SN});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Wp(e,t={}){let n={filePath:SN,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{sE||(sE=!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 iE(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Kl(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Kl=class extends Error{constructor(n,r){super(n);M(this,"details",r);this.name="EmbedRenderError"}};function NN(){sE=!1,oE()}var ln=Uint8Array,$t=Uint16Array,fE=Int32Array,dE=new ln([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]),pE=new ln([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]),LN=new ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$N=function(e,t){for(var n=new $t(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new fE(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}},DN=$N(dE,2),SU=DN.b,lE=DN.r;SU[28]=258,lE[258]=28;var MN=$N(pE,0),Fle=MN.b,PN=MN.r,cE=new $t(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,cE[xe]=((Zn&65280)>>8|(Zn&255)<<8)>>1;var Zn,xe,Jl=(function(e,t,n){for(var r=e.length,i=0,o=new $t(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new $t(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new $t(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[cE[f]>>l]=c}else for(a=new $t(r),i=0;i<r;++i)e[i]&&(a[i]=cE[s[e[i]-1]++]>>15-e[i]);return a}),Xi=new ln(288);for(xe=0;xe<144;++xe)Xi[xe]=8;var xe;for(xe=144;xe<256;++xe)Xi[xe]=9;var xe;for(xe=256;xe<280;++xe)Xi[xe]=7;var xe;for(xe=280;xe<288;++xe)Xi[xe]=8;var xe,Xp=new ln(32);for(xe=0;xe<32;++xe)Xp[xe]=5;var xe,bU=Jl(Xi,9,0);var NU=Jl(Xp,5,0);var FN=function(e){return(e+7)/8|0},LU=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new ln(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},ql=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},aE=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:WN,l:0};if(i==1){var s=new ln(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(T,I){return T.f-I.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 $t(d+1),m=uE(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,x=1<<w;for(o.sort(function(I,B){return p[B.s]-p[I.s]||I.f-B.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=x-(1<<m-p[y]),p[y]=t;else break}for(g>>=w;g>0;){var E=o[r].s;p[E]<t?g-=1<<t-p[E]++-1:++r}for(;r>=0&&g;--r){var _=o[r].s;p[_]==t&&(--p[_],++g)}m=t}return{t:new ln(p),l:m}},uE=function(e,t,n){return e.s==-1?Math.max(uE(e.l,t,n+1),uE(e.r,t,n+1)):t[e.s]=n},ON=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new $t(++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}},Zl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},BN=function(e,t,n){var r=n.length,i=FN(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},CN=function(e,t,n,r,i,o,s,a,l,c,u){Jn(t,u++,n),++i[256];for(var f=aE(i,15),d=f.t,p=f.l,m=aE(o,15),g=m.t,w=m.l,x=ON(d),y=x.c,E=x.n,_=ON(g),T=_.c,I=_.n,B=new $t(19),$=0;$<y.length;++$)++B[y[$]&31];for(var $=0;$<T.length;++$)++B[T[$]&31];for(var X=aE(B,7),Y=X.t,D=X.l,R=19;R>4&&!Y[LN[R-1]];--R);var S=c+5<<3,O=Zl(i,Xi)+Zl(o,Xp)+s,k=Zl(i,d)+Zl(o,g)+s+14+3*R+Zl(B,Y)+2*B[16]+3*B[17]+7*B[18];if(l>=0&&S<=O&&S<=k)return BN(t,u,e.subarray(l,l+c));var L,v,P,b;if(Jn(t,u,1+(k<O)),u+=2,k<O){L=Jl(d,p,0),v=d,P=Jl(g,w,0),b=g;var F=Jl(Y,D,0);Jn(t,u,E-257),Jn(t,u+5,I-1),Jn(t,u+10,R-4),u+=14;for(var $=0;$<R;++$)Jn(t,u+3*$,Y[LN[$]]);u+=3*R;for(var j=[y,T],U=0;U<2;++U)for(var ee=j[U],$=0;$<ee.length;++$){var V=ee[$]&31;Jn(t,u,F[V]),u+=Y[V],V>15&&(Jn(t,u,ee[$]>>5&127),u+=ee[$]>>12)}}else L=bU,v=Xi,P=NU,b=Xp;for(var $=0;$<a;++$){var ne=r[$];if(ne>255){var V=ne>>18&31;ql(t,u,L[V+257]),u+=v[V+257],V>7&&(Jn(t,u,ne>>23&31),u+=dE[V]);var A=ne&31;ql(t,u,P[A]),u+=b[A],A>3&&(ql(t,u,ne>>5&8191),u+=pE[A])}else ql(t,u,L[ne]),u+=v[ne]}return ql(t,u,L[256]),u+v[256]},PU=new fE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),WN=new ln(0),OU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new ln(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,m=(1<<n)-1,g=o.p||new $t(32768),w=o.h||new $t(m+1),x=Math.ceil(n/3),y=2*x,E=function(le){return(e[le]^e[le+1]<<x^e[le+2]<<y)&m},_=new fE(25e3),T=new $t(288),I=new $t(32),B=0,$=0,X=o.i||0,Y=0,D=o.w||0,R=0;X+2<s;++X){var S=E(X),O=X&32767,k=w[S];if(g[O]=k,w[S]=O,D<=X){var L=s-X;if((B>7e3||Y>24576)&&(L>423||!c)){u=CN(e,l,0,_,T,I,$,Y,R,X-R,u),Y=B=$=0,R=X;for(var v=0;v<286;++v)T[v]=0;for(var v=0;v<30;++v)I[v]=0}var P=2,b=0,F=p,j=O-k&32767;if(L>2&&S==E(X-j))for(var U=Math.min(d,L)-1,ee=Math.min(32767,X),V=Math.min(258,L);j<=ee&&--F&&O!=k;){if(e[X+P]==e[X+P-j]){for(var ne=0;ne<V&&e[X+ne]==e[X+ne-j];++ne);if(ne>P){if(P=ne,b=j,ne>U)break;for(var A=Math.min(j,ne-2),C=0,v=0;v<A;++v){var W=X-j+v&32767,G=g[W],K=W-G&32767;K>C&&(C=K,k=W)}}}O=k,k=g[O],j+=O-k&32767}if(b){_[Y++]=268435456|lE[P]<<18|PN[b];var q=lE[P]&31,J=PN[b]&31;$+=dE[q]+pE[J],++T[257+q],++I[J],D=X+P,++B}else _[Y++]=e[X],++T[e[X]]}}for(X=Math.max(X,D);X<s;++X)_[Y++]=e[X],++T[e[X]];u=CN(e,l,c,_,T,I,$,Y,R,X-R,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=X,o.w=D)}else{for(var X=o.w||0;X<s+c;X+=65535){var re=X+65535;re>=s&&(l[u/8|0]=c,re=s),u=BN(l,u+1,e.subarray(X,re))}o.i=s}return LU(a,0,r+FN(u)+i)};var XN=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}}},CU=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new ln(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return OU(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 UN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var $U=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=XN();i.p(t.dictionary),UN(e,2,i.d())}};function GN(e,t){t||(t={});var n=XN();n.p(e);var r=CU(e,t,t.dictionary?6:2,4);return $U(r,t),UN(r,r.length-4,n.d()),r}var DU=typeof TextDecoder<"u"&&new TextDecoder,MU=0;try{DU.decode(WN,{stream:!0}),MU=1}catch{}var jN="https://free.nowline.io/open";function HN(e){let t=new TextEncoder().encode(e),n=GN(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 hE({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&zN(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",HN(e));let r=n===!0?jN:n,i=new URL(r);return t!==void 0&&zN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${HN(e)}`,i.toString()}function zN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var YN=0;async function VN(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=++YN,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=FU(c);if(!u)continue;let f=BU(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},m=u.parentElement,g=u.nextSibling,x=c.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Wp(f,p).then(y=>{if(WU(u,y),r++,m!==null){let E=hE({source:f,sourceUrl:x,share:s});if(E!==null){let _=t.createElement("a");_.className="nowline-share",_.href=E,_.target="_blank",_.rel="noopener noreferrer",_.textContent="Share on Nowline",m.insertBefore(_,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function FU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function BU(e){return e.textContent??""}function WU(e,t){e.outerHTML=t}function KN(){YN=0}function Up(){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 qN(e,t){return e&&e!=="auto"?lx(e)??t:t}var XU="0.0.0-dev.20261026055950.g26802dd",UU="26802dd",GU="pre code.language-nowline, code.language-nowline",ZN={theme:"auto",startOnLoad:!0,selector:GU,systemTheme:Up(),share:!0},Ae={...ZN},mE=!1;function HU(e={}){Ae={theme:e.theme??Ae.theme,startOnLoad:e.startOnLoad??Ae.startOnLoad,selector:e.selector??Ae.selector,locale:e.locale??Ae.locale,width:e.width??Ae.width,nonWorking:e.nonWorking??Ae.nonWorking,today:e.today!==void 0?e.today:Ae.today,timezone:e.timezone??Ae.timezone,share:e.share??Ae.share,sourceUrl:e.sourceUrl??Ae.sourceUrl,systemTheme:Up()}}function JN(){return{theme:qN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function zU(e,t={}){let n={...JN(),...t};return Wp(e,n)}async function jU(e){return bN(e)}async function gE(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??JN().theme,locale:e?.locale??Ae.locale,width:e?.width??Ae.width,nonWorking:e?.nonWorking??Ae.nonWorking,today:e?.today!==void 0?e.today:Ae.today,timezone:e?.timezone??Ae.timezone,share:e?.share??Ae.share,sourceUrl:e?.sourceUrl??Ae.sourceUrl,document:e?.document};return VN(t)}var YU=gE;if(typeof document<"u"&&!mE){mE=!0;let e=()=>{Ae.startOnLoad&&gE()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function VU(){Ae={...ZN,systemTheme:Up()},mE=!1,NN(),KN()}return uL(KU);})();
2920
+ `))}</title>`:""}function fU(e,t){let n=[],r=tN(t,e.style.shadow);return n.push(eN(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:r??null})),e.waveRole==="background"&&e.waveHatch&&n.push(sN(e.box,e.style,e.waveHatch,t)),n.join("")}function dU(e){if(e.progressFraction>0){let t=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));return z("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-rn),width:h(t),height:rn,fill:e.style.fg,opacity:.55})}return""}function pU(e){let t=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-_i;return z("circle",{cx:h(t),cy:h(e.box.y+Hg),r:Lr,fill:e.statusDotColor})}function hU(e,t){let n;if(e.textSpills)n=e.box.x+e.box.width+Bn,e.iconSpills&&(n+=Or+Xt);else{let r=!!e.linkIcon&&e.linkIcon!=="none",o=e.inlineDatePins?.find(s=>s.side==="after"&&!s.spilled)?ps(r,{barWidth:e.box.width}):ps(!t.noLinks&&r&&!e.iconSpills);n=e.box.x+o}return n}function mU(e,t,n,r){let i=[],o=e.style.text,s=n.entities.item.text,a=e.textSpills?s:o,l=e.textSpills?s:e.style.fg,c=e.titleLines??(e.title?[e.title]:[]);return c.forEach((u,f)=>{u!==""&&i.push(ae({x:h(t),y:h(e.box.y+Kf+f*al),"font-family":r[e.style.font],"font-size":Pr,"font-weight":600,fill:a},u))}),(e.metaText||e.capacity)&&i.push(lU({metaText:e.metaText,capacity:e.capacity,x:t,baselineY:e.box.y+qf(c.length),fontSize:sl,fontFamily:r[e.style.font],color:l})),i.join("")}function gU(e,t,n){let r=[],i=t.entities.item.text;if(e.footnoteIndicators.length>0){let o=e.box.y+zg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let s=e.footnoteSpillStartX;for(let a=0;a<e.footnoteIndicators.length;a++){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":ll,"font-weight":700,fill:i},String(l))),s+=Ut}}else{let s=e.box.x+e.box.width-ds;for(let a=e.footnoteIndicators.length-1;a>=0;a--){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":ll,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(l))),s-=Ut}}}return r.join("")}function yU(e,t,n){let r=[];if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let i={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},o=i[e.linkIcon]??i.generic,s=Or,a=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,l=e.box.y+Ai,c=z("rect",{x:h(a),y:h(l),width:s,height:s,rx:2,ry:2,fill:o}),u=a,f=l,d=z("path",{d:`M${h(u+4)} ${h(f+10)} L${h(u+10)} ${h(f+4)} M${h(u+6)} ${h(f+4)} H${h(u+10)} V${h(f+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),p=c+d,m=e.linkHref?z("a",{href:e.linkHref,target:"_blank",rel:"noopener"},p):p;r.push(m)}return r.join("")}function xU(e,t,n){let r=[];if(e.hasOverflow&&e.overflowBox){let i=t.item.overflowTailFill,o=t.item.overflowTailStroke,s=t.item.overflowCaption;r.push(z("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:i,stroke:o,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&r.push(ae({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":n.sans,"font-size":9,"font-weight":700,fill:s,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}return r.join("")}function EU(e,t){let n=[];for(let r of e.labelChips){let i=Math.min(Ii[r.style.cornerRadius]??8,r.box.height/2);n.push(z("rect",{x:h(r.box.x),y:h(r.box.y),width:h(r.box.width),height:h(r.box.height),rx:h(i),ry:h(i),fill:r.style.bg==="none"?"transparent":r.style.bg,stroke:r.style.fg,"stroke-width":.5})),n.push(ae({x:h(r.box.x+r.box.width/2),y:h(r.box.y+r.box.height/2+3),...Pp(r.style,t,ki.xs),"text-anchor":"middle"},r.text))}return n.join("")}function dN(e,t,n,r,i){let o=[];return o.push(uU(e)),o.push(fU(e,n)),o.push(dU(e)),o.push(pU(e)),o.push(Vl(e.inlineDatePins,e.style.fg)),o.push(mU(e,hU(e,t),r,i)),o.push(gU(e,r,i)),o.push(yU(e,t,r)),o.push(xU(e,r,i)),o.push(EU(e,i)),z("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function wU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let l=e.box.y+e.headerHeight,c=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=_y;s.push(z("rect",{x:h(e.box.x),y:h(l),width:h(e.box.width),height:h(c),fill:f?e.style.bg:"none","fill-opacity":f?t===1?Ty:vy:null,stroke:f?null:e.style.bg,"stroke-opacity":f?null:.6,"stroke-width":f?null:1}))}let u=e.kind==="group"?e.style.fg:i.parallel.bracketStroke;if(e.headerHeight>0&&e.style.bracket!=="none"){let f=e.box.y+wl,d=e.box.x,p=e.box.x+e.box.width;s.push(z("path",{d:`M${h(d)} ${h(l)} V${h(f)} H${h(p)} V${h(l)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(ae({x:h(xs(e.box.x,fN(e.inlineDatePins))),y:h(e.box.y+wy),...Pp(e.style,o,fd),"font-weight":600,fill:u},e.title)),s.push(Vl(e.inlineDatePins,e.style.fg))}for(let l of e.children)s.push(hN(l,n,r,i,o,t));return z("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function hN(e,t,n,r,i,o=0){return e.kind==="item"?dN(e,t,n,r,i):wU(e,o+1,t,n,r,i)}var pN=2;function TU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function vU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-pN,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":z("rect",{x:h(i.startX),y:h(n),width:h(o),height:pN,fill:TU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return z("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function mN(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return z("g",{"data-layer":"swimlane-bg","data-id":e.id??null},z("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 Mp(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=[],f=e.tab;if(f){let p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=pl,g=e.box.y+10,w=g+hl;if(u.push(z("rect",{x:h(f.tabX),y:h(g),width:h(f.tabW),height:h(m),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(ae({x:h(f.titleX),y:h(w),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner){let x=wn[e.ownerKind==="person"?"person":"people"],y=Tl;u.push(`<svg x="${h(f.ownerX)}" y="${h(w-y*.85)}" width="${h(y)}" height="${h(y)}" viewBox="${x.viewBox}" style="color:${an(l)}" aria-hidden="true">${x.body}</svg>`),u.push(ae({x:h(f.ownerTextX),y:h(w),"font-family":i[e.style.font],"font-size":10,fill:l},e.owner))}e.capacity&&u.push(eE(e.capacity,f.badgeX,w,10,i[e.style.font],l)),p&&u.push(ae({x:h(f.footnoteRightX),y:h(g+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let d of e.children)u.push(hN(d,t,n,r,i));return u.push(vU(e,r)),z("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function yN(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(z("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(z("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(z("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 z("g",{"data-layer":"grid"},f.join(""))}function Fp(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?Op(a,r):a;!l||l.width<=0||l.height<=0||o.push(z("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":uy}))}return o.length===0?"":z("g",{"data-layer":"non-working"},o.join(""))}function xN(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(z("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(gN(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(gN(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":z("g",{"data-layer":"non-working-label"},i.join(""))}function gN(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"),ae(a,e)}function EN(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,m=e.bottomTickPanelHeight??0,g=p!==void 0&&m>0;c&&s.push(z("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(z("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})),g&&s.push(z("rect",{x:h(e.box.x),y:h(p),width:h(e.box.width),height:h(m),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(ae({x:h(w.labelX),y:h(a+dl(l)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},w.label)),g&&s.push(ae({x:h(w.labelX),y:h(p+dl(m)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},w.label))));return z("g",{"data-layer":"timeline"},s.join(""))}function wN(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,m=e.box.x+8,g=e.box.y,w=e.box.width-16,x=e.box.height,y=z("rect",{x:h(m),y:h(g),width:h(w),height:h(x),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":ml}),E=pl,_=vl(e.box.x,e.label,e.sourcePath),T=g-E/2,I=z("rect",{x:h(_.tabX),y:h(T),width:h(_.tabWidth),height:E,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),B=ae({x:h(_.tabLabelX),y:h(T+hl),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),$=_.badgeX,X=_.badgeSize,Y=g-X/2,D=z("rect",{x:h($),y:h(Y),width:X,height:X,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),R=z("path",{d:`M${h($+7)} ${h(Y+4)} H${h($+14)} V${h(Y+11)} M${h($+4)} ${h(Y+7)} H${h($+11)} V${h(Y+14)} H${h($+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),S=9,O=g+4,k=z("rect",{x:h(_.sourceHaloX),y:h(O-S),width:h(_.sourceHaloWidth),height:S+6,fill:a}),L=ae({x:h(_.sourceTextX),y:h(O),"font-family":i.mono,"font-size":S,fill:p},e.sourcePath),v={x:m,y:g,width:w,height:x},P=o?Fp(o.timeline,o.chartBox.y,r,v):"",b=o?.waves?Cp(o.waves,v)+$p(o.waveBoundaries,v):"",F=o?.waves?Dp(e.waveCrossings):"",j=e.nestedSwimlanes.map(A=>Mp(A,t,n,r,i)).join(""),U=(e.edges??[]).map(A=>Ip(A,r)).join(""),ee=e.anchors??[],V=e.milestones??[],ne=ee.map(A=>bp(A,r)).join("")+V.map(A=>Lp(A,n,r)).join("")+ee.map(A=>Sp(A,r,i)).join("")+V.map(A=>Np(A,r,i)).join("");return z("g",{"data-layer":"include"},y+P+b+U+j+F+ne+I+B+D+R+k+L)}function TN(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=z("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":ed}),s=_U(e,r),a=AU(e,i,n);return z("g",{"data-layer":"nowline"},o+s+a)}function vN(e){let t=ed/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function _U(e,t){let n=e.pillTopY,r=e.pillTopY+Gt,i=ey,o=e.pillWidth;if(e.pillMode==="center")return z("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Gt),rx:i,ry:i,fill:t});let s=vN(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 z("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 z("path",{d:l,fill:t})}function AU(e,t,n){let r=e.pillTopY+ty,i=vN(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+ms,s="start"):(o=i-ms,s="end"),ae({x:h(o),y:h(r),"font-family":n.sans,"font-size":gl,"font-weight":700,fill:t,"text-anchor":s},e.label)}async function tE(e,t={}){let r=new Rp(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??cy,s=[],a=(u,f)=>`<marker id="${u}" 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="${f}"/></marker>`,l=`<defs>${nN(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+oN(e).map(u=>iN(r,u,i)).join("")+"</defs>";s.push(l),s.push(z("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(EN(e.timeline,i,o)),s.push(aN(e,i));for(let u of e.swimlanes)s.push(mN(u,i));s.push(Fp(e.timeline,e.chartBox.y,i)),e.waves&&s.push(Cp(e.waves)),s.push(yN(e.timeline,e.chartBox.y,i)),s.push($p(e.waveBoundaries)),s.push(lN(e,i,o));for(let u of e.edges)s.push(Ip(u,i));for(let u of e.swimlanes)s.push(Mp(u,t,r,i,o));for(let u of e.includes)s.push(wN(u,t,r,i,o,e));s.push(Dp(e.waveCrossings));for(let u of e.anchors)s.push(bp(u,i));for(let u of e.milestones)s.push(Lp(u,r,i));s.push(xN(e.timeline,i,o));for(let u of e.anchors)s.push(Sp(u,i,o));for(let u of e.milestones)s.push(Np(u,i,o));if(s.push(TN(e.nowline,i,o)),s.push(Vb(e.footnotes,r,i,o)),s.push(cN(e.waveLegend,r,i,o)),s.push(Kb(e.header,r,i,o)),s.push(qb(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await Zb(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${$s({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 nE="/browser-source.nowline",kU={error:3,warning:2,info:1},IU={error:3,warning:2,info:1};function _N(e,t){return kU[e]>=IU[t]}var Bp,AN=0;function kN(){return Bp||(Bp=nx()),Bp}function RU(){return Ce.parse(`memory:///nowline-browser-${++AN}.nowline`)}async function rE(e,t={}){let n=t.filePath??nE,r=kN(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,RU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:IN(o,n)}}function IN(e,t){return RN(bi(e),t)}function RN(e,t){return e.map(n=>n.origin==="lexer"?Vx(n.error,t):n.origin==="parser"?Yx(n.error,t):Nb(n.diagnostic,t))}async function iE(e,t={}){let n=t.filePath??nE,r=kN(),i,o;if(t.timezone)try{i=zx(t.timezone)}catch(E){if(!(E instanceof Wi))throw E;o=E}let s=o?void 0:jx({now:t.today,zone:i}),a=await Zx({source:e,sourcePath:n,services:r,readSource:t.readFile??$b,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:RN(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=IN(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&&Fr(E)||c.push(Lb(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",m=Hx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(E=>Ob(E,n)),g=t.showLinks!==!1,w=t.strict===!0,x=await tE(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:w,warn:E=>u.push(E),fontFamilies:t.fontFamilies}),y=[...m,...u.map(E=>Pb(E,n,w?"error":"warning"))].filter(E=>_N(E.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function oE(){Bp=void 0,AN=0}var SN="/embed.nowline",sE=!1;async function bN(e){let{ast:t,diagnostics:n}=await rE(e,{filePath:SN});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Wp(e,t={}){let n={filePath:SN,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{sE||(sE=!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 iE(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Kl(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Kl=class extends Error{constructor(n,r){super(n);M(this,"details",r);this.name="EmbedRenderError"}};function NN(){sE=!1,oE()}var ln=Uint8Array,$t=Uint16Array,fE=Int32Array,dE=new ln([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]),pE=new ln([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]),LN=new ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$N=function(e,t){for(var n=new $t(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new fE(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}},DN=$N(dE,2),SU=DN.b,lE=DN.r;SU[28]=258,lE[258]=28;var MN=$N(pE,0),Fle=MN.b,PN=MN.r,cE=new $t(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,cE[xe]=((Zn&65280)>>8|(Zn&255)<<8)>>1;var Zn,xe,Jl=(function(e,t,n){for(var r=e.length,i=0,o=new $t(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new $t(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new $t(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[cE[f]>>l]=c}else for(a=new $t(r),i=0;i<r;++i)e[i]&&(a[i]=cE[s[e[i]-1]++]>>15-e[i]);return a}),Xi=new ln(288);for(xe=0;xe<144;++xe)Xi[xe]=8;var xe;for(xe=144;xe<256;++xe)Xi[xe]=9;var xe;for(xe=256;xe<280;++xe)Xi[xe]=7;var xe;for(xe=280;xe<288;++xe)Xi[xe]=8;var xe,Xp=new ln(32);for(xe=0;xe<32;++xe)Xp[xe]=5;var xe,bU=Jl(Xi,9,0);var NU=Jl(Xp,5,0);var FN=function(e){return(e+7)/8|0},LU=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new ln(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},ql=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},aE=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:WN,l:0};if(i==1){var s=new ln(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(T,I){return T.f-I.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 $t(d+1),m=uE(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,x=1<<w;for(o.sort(function(I,B){return p[B.s]-p[I.s]||I.f-B.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=x-(1<<m-p[y]),p[y]=t;else break}for(g>>=w;g>0;){var E=o[r].s;p[E]<t?g-=1<<t-p[E]++-1:++r}for(;r>=0&&g;--r){var _=o[r].s;p[_]==t&&(--p[_],++g)}m=t}return{t:new ln(p),l:m}},uE=function(e,t,n){return e.s==-1?Math.max(uE(e.l,t,n+1),uE(e.r,t,n+1)):t[e.s]=n},ON=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new $t(++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}},Zl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},BN=function(e,t,n){var r=n.length,i=FN(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},CN=function(e,t,n,r,i,o,s,a,l,c,u){Jn(t,u++,n),++i[256];for(var f=aE(i,15),d=f.t,p=f.l,m=aE(o,15),g=m.t,w=m.l,x=ON(d),y=x.c,E=x.n,_=ON(g),T=_.c,I=_.n,B=new $t(19),$=0;$<y.length;++$)++B[y[$]&31];for(var $=0;$<T.length;++$)++B[T[$]&31];for(var X=aE(B,7),Y=X.t,D=X.l,R=19;R>4&&!Y[LN[R-1]];--R);var S=c+5<<3,O=Zl(i,Xi)+Zl(o,Xp)+s,k=Zl(i,d)+Zl(o,g)+s+14+3*R+Zl(B,Y)+2*B[16]+3*B[17]+7*B[18];if(l>=0&&S<=O&&S<=k)return BN(t,u,e.subarray(l,l+c));var L,v,P,b;if(Jn(t,u,1+(k<O)),u+=2,k<O){L=Jl(d,p,0),v=d,P=Jl(g,w,0),b=g;var F=Jl(Y,D,0);Jn(t,u,E-257),Jn(t,u+5,I-1),Jn(t,u+10,R-4),u+=14;for(var $=0;$<R;++$)Jn(t,u+3*$,Y[LN[$]]);u+=3*R;for(var j=[y,T],U=0;U<2;++U)for(var ee=j[U],$=0;$<ee.length;++$){var V=ee[$]&31;Jn(t,u,F[V]),u+=Y[V],V>15&&(Jn(t,u,ee[$]>>5&127),u+=ee[$]>>12)}}else L=bU,v=Xi,P=NU,b=Xp;for(var $=0;$<a;++$){var ne=r[$];if(ne>255){var V=ne>>18&31;ql(t,u,L[V+257]),u+=v[V+257],V>7&&(Jn(t,u,ne>>23&31),u+=dE[V]);var A=ne&31;ql(t,u,P[A]),u+=b[A],A>3&&(ql(t,u,ne>>5&8191),u+=pE[A])}else ql(t,u,L[ne]),u+=v[ne]}return ql(t,u,L[256]),u+v[256]},PU=new fE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),WN=new ln(0),OU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new ln(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,m=(1<<n)-1,g=o.p||new $t(32768),w=o.h||new $t(m+1),x=Math.ceil(n/3),y=2*x,E=function(le){return(e[le]^e[le+1]<<x^e[le+2]<<y)&m},_=new fE(25e3),T=new $t(288),I=new $t(32),B=0,$=0,X=o.i||0,Y=0,D=o.w||0,R=0;X+2<s;++X){var S=E(X),O=X&32767,k=w[S];if(g[O]=k,w[S]=O,D<=X){var L=s-X;if((B>7e3||Y>24576)&&(L>423||!c)){u=CN(e,l,0,_,T,I,$,Y,R,X-R,u),Y=B=$=0,R=X;for(var v=0;v<286;++v)T[v]=0;for(var v=0;v<30;++v)I[v]=0}var P=2,b=0,F=p,j=O-k&32767;if(L>2&&S==E(X-j))for(var U=Math.min(d,L)-1,ee=Math.min(32767,X),V=Math.min(258,L);j<=ee&&--F&&O!=k;){if(e[X+P]==e[X+P-j]){for(var ne=0;ne<V&&e[X+ne]==e[X+ne-j];++ne);if(ne>P){if(P=ne,b=j,ne>U)break;for(var A=Math.min(j,ne-2),C=0,v=0;v<A;++v){var W=X-j+v&32767,G=g[W],K=W-G&32767;K>C&&(C=K,k=W)}}}O=k,k=g[O],j+=O-k&32767}if(b){_[Y++]=268435456|lE[P]<<18|PN[b];var q=lE[P]&31,J=PN[b]&31;$+=dE[q]+pE[J],++T[257+q],++I[J],D=X+P,++B}else _[Y++]=e[X],++T[e[X]]}}for(X=Math.max(X,D);X<s;++X)_[Y++]=e[X],++T[e[X]];u=CN(e,l,c,_,T,I,$,Y,R,X-R,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=X,o.w=D)}else{for(var X=o.w||0;X<s+c;X+=65535){var re=X+65535;re>=s&&(l[u/8|0]=c,re=s),u=BN(l,u+1,e.subarray(X,re))}o.i=s}return LU(a,0,r+FN(u)+i)};var XN=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}}},CU=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new ln(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return OU(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 UN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var $U=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=XN();i.p(t.dictionary),UN(e,2,i.d())}};function GN(e,t){t||(t={});var n=XN();n.p(e);var r=CU(e,t,t.dictionary?6:2,4);return $U(r,t),UN(r,r.length-4,n.d()),r}var DU=typeof TextDecoder<"u"&&new TextDecoder,MU=0;try{DU.decode(WN,{stream:!0}),MU=1}catch{}var jN="https://free.nowline.io/open";function HN(e){let t=new TextEncoder().encode(e),n=GN(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 hE({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&zN(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",HN(e));let r=n===!0?jN:n,i=new URL(r);return t!==void 0&&zN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${HN(e)}`,i.toString()}function zN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var YN=0;async function VN(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=++YN,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=FU(c);if(!u)continue;let f=BU(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},m=u.parentElement,g=u.nextSibling,x=c.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Wp(f,p).then(y=>{if(WU(u,y),r++,m!==null){let E=hE({source:f,sourceUrl:x,share:s});if(E!==null){let _=t.createElement("a");_.className="nowline-share",_.href=E,_.target="_blank",_.rel="noopener noreferrer",_.textContent="Share on Nowline",m.insertBefore(_,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function FU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function BU(e){return e.textContent??""}function WU(e,t){e.outerHTML=t}function KN(){YN=0}function Up(){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 qN(e,t){return e&&e!=="auto"?lx(e)??t:t}var XU="0.0.0-dev.20261031003627.g538fca0",UU="538fca0",GU="pre code.language-nowline, code.language-nowline",ZN={theme:"auto",startOnLoad:!0,selector:GU,systemTheme:Up(),share:!0},Ae={...ZN},mE=!1;function HU(e={}){Ae={theme:e.theme??Ae.theme,startOnLoad:e.startOnLoad??Ae.startOnLoad,selector:e.selector??Ae.selector,locale:e.locale??Ae.locale,width:e.width??Ae.width,nonWorking:e.nonWorking??Ae.nonWorking,today:e.today!==void 0?e.today:Ae.today,timezone:e.timezone??Ae.timezone,share:e.share??Ae.share,sourceUrl:e.sourceUrl??Ae.sourceUrl,systemTheme:Up()}}function JN(){return{theme:qN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function zU(e,t={}){let n={...JN(),...t};return Wp(e,n)}async function jU(e){return bN(e)}async function gE(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??JN().theme,locale:e?.locale??Ae.locale,width:e?.width??Ae.width,nonWorking:e?.nonWorking??Ae.nonWorking,today:e?.today!==void 0?e.today:Ae.today,timezone:e?.timezone??Ae.timezone,share:e?.share??Ae.share,sourceUrl:e?.sourceUrl??Ae.sourceUrl,document:e?.document};return VN(t)}var YU=gE;if(typeof document<"u"&&!mE){mE=!0;let e=()=>{Ae.startOnLoad&&gE()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function VU(){Ae={...ZN,systemTheme:Up()},mE=!1,NN(),KN()}return uL(KU);})();
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.20261026055950.g26802dd",
3
+ "version": "0.0.0-dev.20261031003627.g538fca0",
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.20261026055950.g26802dd",
43
- "@nowline/core": "0.0.0-dev.20261026055950.g26802dd",
44
- "@nowline/layout": "0.0.0-dev.20261026055950.g26802dd",
45
- "@nowline/renderer": "0.0.0-dev.20261026055950.g26802dd",
46
- "@nowline/share-link": "0.0.0-dev.20261026055950.g26802dd",
42
+ "@nowline/browser": "0.0.0-dev.20261031003627.g538fca0",
43
+ "@nowline/core": "0.0.0-dev.20261031003627.g538fca0",
44
+ "@nowline/layout": "0.0.0-dev.20261031003627.g538fca0",
45
+ "@nowline/renderer": "0.0.0-dev.20261031003627.g538fca0",
46
+ "@nowline/share-link": "0.0.0-dev.20261031003627.g538fca0",
47
47
  "langium": "~4.4.0"
48
48
  },
49
49
  "devDependencies": {