@nowline/embed 0.0.0-dev.20261014154114.g5da7d2a → 0.0.0-dev.20261015033109.g3d8b606

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.20261014154114.g5da7d2a sha=5da7d2a built=2026-10-14T15:35:52Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261015033109.g3d8b606 sha=3d8b606 built=2026-10-15T03:26:27Z */
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -40177,8 +40177,8 @@ function effectiveTheme(theme, systemTheme) {
40177
40177
  }
40178
40178
 
40179
40179
  // src/index.ts
40180
- var version = true ? "0.0.0-dev.20261014154114.g5da7d2a" : "0.0.0";
40181
- var sha = true ? "5da7d2a" : "unknown";
40180
+ var version = true ? "0.0.0-dev.20261015033109.g3d8b606" : "0.0.0";
40181
+ var sha = true ? "3d8b606" : "unknown";
40182
40182
  var DEFAULT_SELECTOR = "pre code.language-nowline, code.language-nowline";
40183
40183
  var initialConfig = {
40184
40184
  theme: "auto",
@@ -1,4 +1,4 @@
1
- /*! @nowline/embed 0.0.0-dev.20261014154114.g5da7d2a sha=5da7d2a built=2026-10-14T15:35:52Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261015033109.g3d8b606 sha=3d8b606 built=2026-10-15T03:26:27Z */
2
2
  "use strict";var nowline=(()=>{var qS=Object.create;var Ps=Object.defineProperty;var ZS=Object.getOwnPropertyDescriptor;var JS=Object.getOwnPropertyNames;var QS=Object.getPrototypeOf,eN=Object.prototype.hasOwnProperty;var tN=(e,t,n)=>t in e?Ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var nN=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Ls=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},yp=(e,t)=>{for(var n in t)Ps(e,n,{get:t[n],enumerable:!0})},Xx=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of JS(t))!eN.call(e,i)&&i!==n&&Ps(e,i,{get:()=>t[i],enumerable:!(r=ZS(t,i))||r.enumerable});return e};var xp=(e,t,n)=>(n=e!=null?qS(QS(e)):{},Xx(t||!e||!e.__esModule?Ps(n,"default",{value:e,enumerable:!0}):n,e)),rN=e=>Xx(Ps({},"__esModule",{value:!0}),e);var B=(e,t,n)=>tN(e,typeof t!="symbol"?t+"":t,n);var zh=Ls(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});var Wh;function Xh(){if(Wh===void 0)throw new Error("No runtime abstraction layer installed");return Wh}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Wh=n}e.install=t})(Xh||(Xh={}));Gh.default=Xh});var Hh=Ls(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.boolean=sD;On.string=f_;On.number=aD;On.error=lD;On.func=cD;On.array=d_;On.stringArray=uD;function sD(e){return e===!0||e===!1}function f_(e){return typeof e=="string"||e instanceof String}function aD(e){return typeof e=="number"||e instanceof Number}function lD(e){return e instanceof Error}function cD(e){return typeof e=="function"}function d_(e){return Array.isArray(e)}function uD(e){return d_(e)&&e.every(t=>f_(t))}});var Yh=Ls(br=>{"use strict";var fD=br&&br.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(br,"__esModule",{value:!0});br.Emitter=br.Event=void 0;var dD=fD(zh()),p_;(function(e){let t={dispose(){}};e.None=function(){return t}})(p_||(br.Event=p_={}));var jh=class{constructor(){B(this,"_callbacks");B(this,"_contexts")}add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,dD.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},_u=class _u{constructor(t){B(this,"_options");B(this,"_event");B(this,"_callbacks");this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new jh),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=_u._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};B(_u,"_noop",function(){});var Vh=_u;br.Emitter=Vh});var h_=Ls(vt=>{"use strict";var pD=vt&&vt.__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]})),hD=vt&&vt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),mD=vt&&vt.__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"&&pD(n,t,r[i]);return hD(n,t),n}})(),gD=vt&&vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vt,"__esModule",{value:!0});vt.CancellationTokenSource=vt.CancellationToken=void 0;var yD=gD(zh()),xD=mD(Hh()),Kh=Yh(),ku;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Kh.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Kh.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||xD.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(ku||(vt.CancellationToken=ku={}));var ED=Object.freeze(function(e,t){let n=(0,yD.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),Au=class{constructor(){B(this,"_isCancelled",!1);B(this,"_emitter")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ED:(this._emitter||(this._emitter=new Kh.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},qh=class{constructor(){B(this,"_token")}get token(){return this._token||(this._token=new Au),this._token}cancel(){this._token?this._token.cancel():this._token=ku.Cancelled}dispose(){this._token?this._token instanceof Au&&this._token.dispose():this._token=ku.None}};vt.CancellationTokenSource=qh});var g_=Ls(ee=>{"use strict";var wD=ee&&ee.__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]})),TD=ee&&ee.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),vD=ee&&ee.__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"&&wD(n,t,r[i]);return TD(n,t),n}})();Object.defineProperty(ee,"__esModule",{value:!0});ee.Message=ee.NotificationType9=ee.NotificationType8=ee.NotificationType7=ee.NotificationType6=ee.NotificationType5=ee.NotificationType4=ee.NotificationType3=ee.NotificationType2=ee.NotificationType1=ee.NotificationType0=ee.NotificationType=ee.RequestType9=ee.RequestType8=ee.RequestType7=ee.RequestType6=ee.RequestType5=ee.RequestType4=ee.RequestType3=ee.RequestType2=ee.RequestType1=ee.RequestType=ee.RequestType0=ee.AbstractMessageSignature=ee.ParameterStructures=ee.ResponseError=ee.ErrorCodes=void 0;var pi=vD(Hh()),Zh;(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})(Zh||(ee.ErrorCodes=Zh={}));var Jh=class e extends Error{constructor(n,r,i){super(r);B(this,"code");B(this,"data");this.code=pi.number(n)?n:Zh.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}};ee.ResponseError=Jh;var qt=class qt{constructor(t){B(this,"kind");this.kind=t}static is(t){return t===qt.auto||t===qt.byName||t===qt.byPosition}toString(){return this.kind}};B(qt,"auto",new qt("auto")),B(qt,"byPosition",new qt("byPosition")),B(qt,"byName",new qt("byName"));var Sr=qt;ee.ParameterStructures=Sr;var $e=class{constructor(t,n){B(this,"method");B(this,"numberOfParams");this.method=t,this.numberOfParams=n}get parameterStructures(){return Sr.auto}};ee.AbstractMessageSignature=$e;var Qh=class extends $e{constructor(n){super(n,0);B(this,"_")}};ee.RequestType0=Qh;var em=class extends $e{constructor(n,r=Sr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.RequestType=em;var tm=class extends $e{constructor(n,r=Sr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.RequestType1=tm;var nm=class extends $e{constructor(n){super(n,2);B(this,"_")}};ee.RequestType2=nm;var rm=class extends $e{constructor(n){super(n,3);B(this,"_")}};ee.RequestType3=rm;var im=class extends $e{constructor(n){super(n,4);B(this,"_")}};ee.RequestType4=im;var om=class extends $e{constructor(n){super(n,5);B(this,"_")}};ee.RequestType5=om;var sm=class extends $e{constructor(n){super(n,6);B(this,"_")}};ee.RequestType6=sm;var am=class extends $e{constructor(n){super(n,7);B(this,"_")}};ee.RequestType7=am;var lm=class extends $e{constructor(n){super(n,8);B(this,"_")}};ee.RequestType8=lm;var cm=class extends $e{constructor(n){super(n,9);B(this,"_")}};ee.RequestType9=cm;var um=class extends $e{constructor(n,r=Sr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.NotificationType=um;var fm=class extends $e{constructor(n){super(n,0);B(this,"_")}};ee.NotificationType0=fm;var dm=class extends $e{constructor(n,r=Sr.auto){super(n,1);B(this,"_parameterStructures");B(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ee.NotificationType1=dm;var pm=class extends $e{constructor(n){super(n,2);B(this,"_")}};ee.NotificationType2=pm;var hm=class extends $e{constructor(n){super(n,3);B(this,"_")}};ee.NotificationType3=hm;var mm=class extends $e{constructor(n){super(n,4);B(this,"_")}};ee.NotificationType4=mm;var gm=class extends $e{constructor(n){super(n,5);B(this,"_")}};ee.NotificationType5=gm;var ym=class extends $e{constructor(n){super(n,6);B(this,"_")}};ee.NotificationType6=ym;var xm=class extends $e{constructor(n){super(n,7);B(this,"_")}};ee.NotificationType7=xm;var Em=class extends $e{constructor(n){super(n,8);B(this,"_")}};ee.NotificationType8=Em;var wm=class extends $e{constructor(n){super(n,9);B(this,"_")}};ee.NotificationType9=wm;var m_;(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})(m_||(ee.Message=m_={}))});var PA={};yp(PA,{nodeReadFile:()=>oF});async function oF(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var LA=nN(()=>{});var vW={};yp(vW,{EmbedRenderError:()=>Ol,__resetForTests:()=>TW,init:()=>Dx,initialize:()=>yW,parse:()=>EW,render:()=>xW,run:()=>wW,sha:()=>mW,version:()=>hW});function Xe(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}function it(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}function $t(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function Gx(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}function Ui(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}var Bi=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(t){let n=this.types[t.container.$type];if(!n)throw new Error(`Type ${t.container.$type||"undefined"} not found.`);let r=n.properties[t.property]?.referenceType;if(!r)throw new Error(`Property ${t.property||"undefined"} of type ${t.container.$type} is not a reference.`);return r}getTypeMetaData(t){let n=this.types[t];return n||{name:t,properties:{},superTypes:[]}}isInstance(t,n){return Xe(t)&&this.isSubtype(t.$type,n)}isSubtype(t,n){if(t===n)return!0;let r=this.subtypes[t];r||(r=this.subtypes[t]={});let i=r[n];if(i!==void 0)return i;{let o=this.types[t],s=o?o.superTypes.some(a=>this.isSubtype(a,n)):!1;return r[n]=s,s}}getAllSubTypes(t){let n=this.allSubtypes[t];if(n)return n;{let r=this.getAllTypes(),i=[];for(let o of r)this.isSubtype(o,t)&&i.push(o);return this.allSubtypes[t]=i,i}}isComplete(t){let n=this.getTypeMetaData(t.$type);for(let r of Object.keys(n.properties)){let i=n.properties[r];if(i.optional)continue;let o=t[i.name];if(o==null)return!1}return!0}};function or(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}function Fl(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function Bl(e){return or(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 xt})}join(t=","){let n=this.iterator(),r="",i,o=!1;do i=n.next(),i.done||(o&&(r+=t),r+=oN(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?xt:{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 xt})}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(Ul(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(n.iterator);return xt})}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(Ul(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(r.iterator);return xt})}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?xt: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 xt})}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 oN(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function Ul(e){return!!e&&typeof e[Symbol.iterator]=="function"}var Xl=new zt(()=>{},()=>xt),xt=Object.freeze({done:!0,value:void 0});function ge(...e){if(e.length===1){let t=e[0];if(t instanceof zt)return t;if(Ul(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++]}:xt)}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++];Ul(n)?t.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(t.array=n)}}while(t.iterator||t.array||t.collIndex<e.length);return xt}):Xl}var sr=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 xt})}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),prune:()=>{t.state.pruned=!0},[Symbol.iterator]:()=>t};return t}},Wl;(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})(Wl||(Wl={}));function Gl(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,o)=>{Xe(i)&&(i.$container=e,i.$containerProperty=n,i.$containerIndex=o,t.deep&&Gl(i,t))}):Xe(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&Gl(r,t)))}function Wi(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function ct(e){let n=$s(e).$document;if(!n)throw new Error("AST node has no document.");return n}function $s(e){for(;e.$container;)e=e.$container;return e}function wp(e){return it(e)?e.ref?[e.ref]:[]:$t(e)?e.items.map(t=>t.ref):[]}function zl(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(Xe(o)){if(r.keyIndex++,Ep(o,n))return{done:!1,value:o}}else if(Array.isArray(o)){for(;r.arrayIndex<o.length;){let s=r.arrayIndex++,a=o[s];if(Xe(a)&&Ep(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return xt})}function on(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new sr(e,n=>zl(n,t))}function Et(e,t){if(e){if(t?.range&&!Ep(e,t.range))return new sr(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new sr(e,n=>zl(n,t),{includeRoot:!0})}function Ep(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?jx(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)||$t(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)||$t(o))return{done:!1,value:{reference:o,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return xt})}function zx(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]=Hx(i.defaultValue))}function Hx(e){return Array.isArray(e)?[...e.map(Hx)]:e}var It={$type:"AbstractElement",cardinality:"cardinality"};function tc(e){return pe.isInstance(e,It.$type)}var Yl={$type:"AbstractParserRule"};function lr(e){return pe.isInstance(e,Yl.$type)}var Hl={$type:"AbstractRule"};var Ht={$type:"AbstractType"};var Hr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function cr(e){return pe.isInstance(e,Hr.$type)}var Kl={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Np(e){return pe.isInstance(e,Kl.$type)}var Vx={$type:"ArrayLiteral",elements:"elements"};var vp={$type:"ArrayType",elementType:"elementType"};function Jx(e){return pe.isInstance(e,vp.$type)}var jr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function an(e){return pe.isInstance(e,jr.$type)}var _p={$type:"BooleanLiteral",true:"true"};function Qx(e){return pe.isInstance(e,_p.$type)}var Vr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function eE(e){return pe.isInstance(e,Vr.$type)}var Xi={$type:"Condition"};var ql={$type:"Conjunction",left:"left",right:"right"};function tE(e){return pe.isInstance(e,ql.$type)}var Yr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function ln(e){return pe.isInstance(e,Yr.$type)}var Zl={$type:"Disjunction",left:"left",right:"right"};function nE(e){return pe.isInstance(e,Zl.$type)}var kp={$type:"EndOfFile",cardinality:"cardinality"};function rE(e){return pe.isInstance(e,kp.$type)}var zr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var Yx={$type:"GrammarImport",path:"path"};var Gi={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Kr(e){return pe.isInstance(e,Gi.$type)}var Ap={$type:"InferredType",name:"name"};function nc(e){return pe.isInstance(e,Ap.$type)}var wn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qr(e){return pe.isInstance(e,wn.$type)}var Tp={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var Kx={$type:"InfixRuleOperators",precedences:"precedences"};var Ms={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function iE(e){return pe.isInstance(e,Ms.$type)}var Fs={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function jt(e){return pe.isInstance(e,Fs.$type)}var jl={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var zi={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function oE(e){return pe.isInstance(e,zi.$type)}var Ip={$type:"Negation",value:"value"};function sE(e){return pe.isInstance(e,Ip.$type)}var qx={$type:"NumberLiteral",value:"value"};var Vl={$type:"Parameter",name:"name"};var Rp={$type:"ParameterReference",parameter:"parameter"};function aE(e){return pe.isInstance(e,Rp.$type)}var sn={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function ut(e){return pe.isInstance(e,sn.$type)}var Jl={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function lE(e){return pe.isInstance(e,Jl.$type)}var Hi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function cE(e){return pe.isInstance(e,Hi.$type)}var bp={$type:"ReturnType",name:"name"};function uE(e){return pe.isInstance(e,bp.$type)}var ji={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function cn(e){return pe.isInstance(e,ji.$type)}var Bs={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Pp(e){return pe.isInstance(e,Bs.$type)}var Zx={$type:"StringLiteral",value:"value"};var Vi={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function fE(e){return pe.isInstance(e,Vi.$type)}var Ot={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Yi={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function dE(e){return pe.isInstance(e,Yi.$type)}var ar={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function wt(e){return pe.isInstance(e,ar.$type)}var Ki={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Lp(e){return pe.isInstance(e,Ki.$type)}var Ql={$type:"Type",name:"name",type:"type"};function $p(e){return pe.isInstance(e,Ql.$type)}var Os={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Cs={$type:"TypeDefinition"};var Sp={$type:"UnionType",types:"types"};function pE(e){return pe.isInstance(e,Sp.$type)}var ec={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Op(e){return pe.isInstance(e,ec.$type)}var qi={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function hE(e){return pe.isInstance(e,qi.$type)}var Ds={$type:"ValueLiteral"};var Us={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function mE(e){return pe.isInstance(e,Us.$type)}var Ws=class extends Bi{constructor(){super(...arguments),this.types={AbstractElement:{name:It.$type,properties:{cardinality:{name:It.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:Yl.$type,properties:{},superTypes:[Hl.$type,Ht.$type]},AbstractRule:{name:Hl.$type,properties:{},superTypes:[]},AbstractType:{name:Ht.$type,properties:{},superTypes:[]},Action:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality,optional:!0},feature:{name:Hr.feature,optional:!0},inferredType:{name:Hr.inferredType,optional:!0},operator:{name:Hr.operator,optional:!0},type:{name:Hr.type,referenceType:Ht.$type,optional:!0}},superTypes:[It.$type]},Alternatives:{name:Kl.$type,properties:{cardinality:{name:Kl.cardinality,optional:!0},elements:{name:Kl.elements,defaultValue:[]}},superTypes:[It.$type]},ArrayLiteral:{name:Vx.$type,properties:{elements:{name:Vx.elements,defaultValue:[]}},superTypes:[Ds.$type]},ArrayType:{name:vp.$type,properties:{elementType:{name:vp.elementType}},superTypes:[Cs.$type]},Assignment:{name:jr.$type,properties:{cardinality:{name:jr.cardinality,optional:!0},feature:{name:jr.feature},operator:{name:jr.operator},predicate:{name:jr.predicate,optional:!0},terminal:{name:jr.terminal}},superTypes:[It.$type]},BooleanLiteral:{name:_p.$type,properties:{true:{name:_p.true,defaultValue:!1}},superTypes:[Xi.$type,Ds.$type]},CharacterRange:{name:Vr.$type,properties:{cardinality:{name:Vr.cardinality,optional:!0},left:{name:Vr.left},lookahead:{name:Vr.lookahead,optional:!0},parenthesized:{name:Vr.parenthesized,defaultValue:!1,optional:!0},right:{name:Vr.right,optional:!0}},superTypes:[Ot.$type]},Condition:{name:Xi.$type,properties:{},superTypes:[]},Conjunction:{name:ql.$type,properties:{left:{name:ql.left},right:{name:ql.right}},superTypes:[Xi.$type]},CrossReference:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality,optional:!0},deprecatedSyntax:{name:Yr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Yr.isMulti,defaultValue:!1},terminal:{name:Yr.terminal,optional:!0},type:{name:Yr.type,referenceType:Ht.$type}},superTypes:[It.$type]},Disjunction:{name:Zl.$type,properties:{left:{name:Zl.left},right:{name:Zl.right}},superTypes:[Xi.$type]},EndOfFile:{name:kp.$type,properties:{cardinality:{name:kp.cardinality,optional:!0}},superTypes:[It.$type]},Grammar:{name:zr.$type,properties:{imports:{name:zr.imports,defaultValue:[]},interfaces:{name:zr.interfaces,defaultValue:[]},isDeclared:{name:zr.isDeclared,defaultValue:!1},name:{name:zr.name,optional:!0},rules:{name:zr.rules,defaultValue:[]},types:{name:zr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Yx.$type,properties:{path:{name:Yx.path}},superTypes:[]},Group:{name:Gi.$type,properties:{cardinality:{name:Gi.cardinality,optional:!0},elements:{name:Gi.elements,defaultValue:[]},guardCondition:{name:Gi.guardCondition,optional:!0},predicate:{name:Gi.predicate,optional:!0}},superTypes:[It.$type]},InferredType:{name:Ap.$type,properties:{name:{name:Ap.name}},superTypes:[Ht.$type]},InfixRule:{name:wn.$type,properties:{call:{name:wn.call},dataType:{name:wn.dataType,optional:!0},inferredType:{name:wn.inferredType,optional:!0},name:{name:wn.name},operators:{name:wn.operators},parameters:{name:wn.parameters,defaultValue:[]},returnType:{name:wn.returnType,referenceType:Ht.$type,optional:!0}},superTypes:[Yl.$type]},InfixRuleOperatorList:{name:Tp.$type,properties:{associativity:{name:Tp.associativity,optional:!0},operators:{name:Tp.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Kx.$type,properties:{precedences:{name:Kx.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Ms.$type,properties:{attributes:{name:Ms.attributes,defaultValue:[]},name:{name:Ms.name},superTypes:{name:Ms.superTypes,defaultValue:[],referenceType:Ht.$type}},superTypes:[Ht.$type]},Keyword:{name:Fs.$type,properties:{cardinality:{name:Fs.cardinality,optional:!0},predicate:{name:Fs.predicate,optional:!0},value:{name:Fs.value}},superTypes:[It.$type]},NamedArgument:{name:jl.$type,properties:{calledByName:{name:jl.calledByName,defaultValue:!1},parameter:{name:jl.parameter,referenceType:Vl.$type,optional:!0},value:{name:jl.value}},superTypes:[]},NegatedToken:{name:zi.$type,properties:{cardinality:{name:zi.cardinality,optional:!0},lookahead:{name:zi.lookahead,optional:!0},parenthesized:{name:zi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:zi.terminal}},superTypes:[Ot.$type]},Negation:{name:Ip.$type,properties:{value:{name:Ip.value}},superTypes:[Xi.$type]},NumberLiteral:{name:qx.$type,properties:{value:{name:qx.value}},superTypes:[Ds.$type]},Parameter:{name:Vl.$type,properties:{name:{name:Vl.name}},superTypes:[]},ParameterReference:{name:Rp.$type,properties:{parameter:{name:Rp.parameter,referenceType:Vl.$type}},superTypes:[Xi.$type]},ParserRule:{name:sn.$type,properties:{dataType:{name:sn.dataType,optional:!0},definition:{name:sn.definition},entry:{name:sn.entry,defaultValue:!1},fragment:{name:sn.fragment,defaultValue:!1},inferredType:{name:sn.inferredType,optional:!0},name:{name:sn.name},parameters:{name:sn.parameters,defaultValue:[]},returnType:{name:sn.returnType,referenceType:Ht.$type,optional:!0}},superTypes:[Yl.$type]},ReferenceType:{name:Jl.$type,properties:{isMulti:{name:Jl.isMulti,defaultValue:!1},referenceType:{name:Jl.referenceType}},superTypes:[Cs.$type]},RegexToken:{name:Hi.$type,properties:{cardinality:{name:Hi.cardinality,optional:!0},lookahead:{name:Hi.lookahead,optional:!0},parenthesized:{name:Hi.parenthesized,defaultValue:!1,optional:!0},regex:{name:Hi.regex}},superTypes:[Ot.$type]},ReturnType:{name:bp.$type,properties:{name:{name:bp.name}},superTypes:[]},RuleCall:{name:ji.$type,properties:{arguments:{name:ji.arguments,defaultValue:[]},cardinality:{name:ji.cardinality,optional:!0},predicate:{name:ji.predicate,optional:!0},rule:{name:ji.rule,referenceType:Hl.$type}},superTypes:[It.$type]},SimpleType:{name:Bs.$type,properties:{primitiveType:{name:Bs.primitiveType,optional:!0},stringType:{name:Bs.stringType,optional:!0},typeRef:{name:Bs.typeRef,referenceType:Ht.$type,optional:!0}},superTypes:[Cs.$type]},StringLiteral:{name:Zx.$type,properties:{value:{name:Zx.value}},superTypes:[Ds.$type]},TerminalAlternatives:{name:Vi.$type,properties:{cardinality:{name:Vi.cardinality,optional:!0},elements:{name:Vi.elements,defaultValue:[]},lookahead:{name:Vi.lookahead,optional:!0},parenthesized:{name:Vi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]},TerminalElement:{name:Ot.$type,properties:{cardinality:{name:Ot.cardinality,optional:!0},lookahead:{name:Ot.lookahead,optional:!0},parenthesized:{name:Ot.parenthesized,defaultValue:!1,optional:!0}},superTypes:[It.$type]},TerminalGroup:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality,optional:!0},elements:{name:Yi.elements,defaultValue:[]},lookahead:{name:Yi.lookahead,optional:!0},parenthesized:{name:Yi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]},TerminalRule:{name:ar.$type,properties:{definition:{name:ar.definition},fragment:{name:ar.fragment,defaultValue:!1},hidden:{name:ar.hidden,defaultValue:!1},name:{name:ar.name},type:{name:ar.type,optional:!0}},superTypes:[Hl.$type]},TerminalRuleCall:{name:Ki.$type,properties:{cardinality:{name:Ki.cardinality,optional:!0},lookahead:{name:Ki.lookahead,optional:!0},parenthesized:{name:Ki.parenthesized,defaultValue:!1,optional:!0},rule:{name:Ki.rule,referenceType:ar.$type}},superTypes:[Ot.$type]},Type:{name:Ql.$type,properties:{name:{name:Ql.name},type:{name:Ql.type}},superTypes:[Ht.$type]},TypeAttribute:{name:Os.$type,properties:{defaultValue:{name:Os.defaultValue,optional:!0},isOptional:{name:Os.isOptional,defaultValue:!1},name:{name:Os.name},type:{name:Os.type}},superTypes:[]},TypeDefinition:{name:Cs.$type,properties:{},superTypes:[]},UnionType:{name:Sp.$type,properties:{types:{name:Sp.types,defaultValue:[]}},superTypes:[Cs.$type]},UnorderedGroup:{name:ec.$type,properties:{cardinality:{name:ec.cardinality,optional:!0},elements:{name:ec.elements,defaultValue:[]}},superTypes:[It.$type]},UntilToken:{name:qi.$type,properties:{cardinality:{name:qi.cardinality,optional:!0},lookahead:{name:qi.lookahead,optional:!0},parenthesized:{name:qi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:qi.terminal}},superTypes:[Ot.$type]},ValueLiteral:{name:Ds.$type,properties:{},superTypes:[]},Wildcard:{name:Us.$type,properties:{cardinality:{name:Us.cardinality,optional:!0},lookahead:{name:Us.lookahead,optional:!0},parenthesized:{name:Us.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]}}}},pe=new Ws;function Xs(e){return new sr(e,t=>or(t)?t.content:[],{includeRoot:!0})}function xE(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function EE(e){return{start:{line:e.startLine-1,character:e.startColumn-1},end:{line:e.endLine-1,character:e.endColumn}}}function Gs(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 Zi(e){if(!e)return;let{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}var Tn;(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"})(Tn||(Tn={}));function sN(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return Tn.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Tn.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?Tn.Inside:n?Tn.OverlapBack:r?Tn.OverlapFront:Tn.Outside}function jx(e,t){return sN(e,t)>Tn.After}var wE=/^[\w\p{L}]$/u;function TE(e,t){if(e){let n=aN(e,!0);if(n&&yE(n,t))return n;if(Bl(e)){let r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){let o=e.content[i];if(yE(o,t))return o}}}}function yE(e,t){return Fl(e)&&t.includes(e.tokenType.name)}function aN(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 lc={};yp(lc,{findAssignment:()=>Vp,findNameAssignment:()=>sc,findNodeForKeyword:()=>Hp,findNodeForProperty:()=>Ks,findNodesForKeyword:()=>hN,findNodesForKeywordInternal:()=>jp,findNodesForProperty:()=>Gp,getActionAtElement:()=>SE,getActionType:()=>PE,getAllReachableRules:()=>Ys,getAllRulesUsedForCrossReferences:()=>pN,getCrossReferenceTerminal:()=>Wp,getEntryRule:()=>AE,getExplicitRuleType:()=>ac,getHiddenRules:()=>IE,getRuleType:()=>Yp,getRuleTypeName:()=>EN,getTypeName:()=>fr,isArrayCardinality:()=>gN,isArrayOperator:()=>yN,isCommentTerminal:()=>Xp,isDataType:()=>xN,isDataTypeRule:()=>qs,isOptionalCardinality:()=>mN,terminalRegex:()=>Qi});var zs=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 ur(e,t="Error: Got unexpected value."){throw new Error(typeof t=="string"?t:t())}function ie(e){return e.charCodeAt(0)}function rc(e,t){Array.isArray(e)?e.forEach(function(n){t.push(n)}):t.push(e)}function Ji(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 Hs(){throw Error("Internal Error - Should never get here!")}function Cp(e){return e.type==="Character"}var js=[];for(let e=ie("0");e<=ie("9");e++)js.push(e);var Vs=[ie("_")].concat(js);for(let e=ie("a");e<=ie("z");e++)Vs.push(e);for(let e=ie("A");e<=ie("Z");e++)Vs.push(e);var Dp=[ie(" "),ie("\f"),ie(`
3
3
  `),ie("\r"),ie(" "),ie("\v"),ie(" "),ie("\xA0"),ie("\u1680"),ie("\u2000"),ie("\u2001"),ie("\u2002"),ie("\u2003"),ie("\u2004"),ie("\u2005"),ie("\u2006"),ie("\u2007"),ie("\u2008"),ie("\u2009"),ie("\u200A"),ie("\u2028"),ie("\u2029"),ie("\u202F"),ie("\u205F"),ie("\u3000"),ie("\uFEFF")];var lN=/[0-9a-fA-F]/,ic=/[0-9]/,cN=/[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":Ji(r,"global");break;case"i":Ji(r,"ignoreCase");break;case"m":Ji(r,"multiLine");break;case"u":Ji(r,"unicode");break;case"y":Ji(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 Hs()}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):Hs()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ie(`
4
4
  `),ie("\r"),ie("\u2028"),ie("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,n=!1;switch(this.popChar()){case"d":t=js;break;case"D":t=js,n=!0;break;case"s":t=Dp;break;case"S":t=Dp,n=!0;break;case"w":t=Vs;break;case"W":t=Vs,n=!0;break}return Zr(t)?{type:"Set",value:t,complement:n}:Hs()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=ie("\f");break;case"n":t=ie(`
@@ -2916,5 +2916,5 @@ ${n}`),this.inline?`{${i}}`:i}};function UD(e,t,n){if(e==="linkplain"||e==="link
2916
2916
  }`));var SM={languageId:"nowline",fileExtensions:[".nowline"],caseInsensitive:!1,mode:"development"},jk={AstReflection:()=>new Da},Vk={Grammar:()=>Hk(),LanguageMetaData:()=>SM,parser:{}};var Yk={item:"an item",group:"a group",parallel:"a parallel block",swimlane:"a swimlane",anchor:"an anchor",milestone:"a milestone","floating-milestone":"a milestone without a date",wave:"a wave",label:"a label",size:"a size",status:"a status",person:"a person",team:"a team",footnote:"a footnote",roadmap:"the roadmap",style:"a style",symbol:"a symbol"},NM={item:"item",group:"group",parallel:"parallel block",swimlane:"swimlane",anchor:"anchor",milestone:"milestone","floating-milestone":"milestone",wave:"wave",label:"label",size:"size",status:"status",person:"person",team:"team",footnote:"footnote",roadmap:"roadmap",style:"style",symbol:"symbol"},ry=e=>e.charAt(0).toUpperCase()+e.slice(1);function gs(e){return e.kind==="parallel-block"?`the parallel block on line ${e.line}`:e.kind==="group-block"?`the group on line ${e.line}`:`${e.kind} "${e.name}"`}function Kk(e){return e.name||e.line===void 0?`"${e.name}"`:gs({kind:e.kind==="parallel"?"parallel-block":"group-block",line:e.line})}function iy(e,t=!0){if(e.name)return`${e.kind} "${e.name}"`;let n=e.kind==="parallel"?"parallel block":e.kind,r=t?"the ":"";return e.line===void 0?`${r}${n}`:`${r}${n} on line ${e.line}`}function qk(e){return e.name?`${ry(e.kind)} "${e.name}"`:ry(iy(e))}function Zk(e){return e===null?"has no start floor":`opens no earlier than ${e}`}function Jk(e){return e?e.title===void 0?` Did you mean wave:${e.id}?`:` Did you mean wave:${e.id} ("${e.title}")?`:""}function Qk(e){let t=e.slice(0,5).map(r=>`"${r}"`),n=e.length-t.length;return n>0?`${t.join(", ")} and ${n} more`:t.join(", ")}function Qf(e){return`[${e.join(", ")}]`}var eA={"NL.E0001":()=>"Config section must appear before roadmap.","NL.E0002":()=>"Include declarations must appear before the config section.","NL.E0003":()=>"Include declarations must appear before the roadmap section.","NL.E0004":()=>"At least one swimlane is required.","NL.E0005":e=>`Line ${e.line}: mixed tabs and spaces in indentation. Use either tabs or spaces consistently.`,"NL.E0100":e=>`Invalid version format "${e.version}". Expected format: v1, v2, etc.`,"NL.E0101":e=>`This file requires Nowline ${e.version}, but the parser only supports up to ${e.supported}.`,"NL.E0102":e=>`Unknown directive property "${e.key}". Allowed: ${e.allowed}.`,"NL.E0103":e=>`Duplicate directive property "${e.key}".`,"NL.E0104":e=>`Invalid locale "${e.value}". Use a BCP-47 tag like "en-US", "fr", or "fr-CA".`,"NL.E0200":e=>`Invalid include mode "${e.value}". Must be merge, ignore, or isolate.`,"NL.E0201":e=>`Duplicate "${e.key}" option on include.`,"NL.E0202":e=>{switch(e.reason){case"mismatch":return`Included "${e.path}" declares waves ${Qf(e.child)}, but this file's waves are ${Qf(e.parent)}. Every included roadmap must declare the same waves in the same order: copy this file's wave lines into "${e.path}".`;case"child-none":return`Included "${e.path}" declares no waves, but this file's waves are ${Qf(e.parent)}. Copy this file's wave lines into "${e.path}" so its work joins the waves.`;case"parent-none":return`Included "${e.path}" declares waves ${Qf(e.child)}, but this file declares none. Declare the same waves here so the barriers apply to the whole roadmap.`;case"floor":return`Wave "${e.id}" in "${e.path}" ${Zk(e.childFloor)}, but this file's wave "${e.id}" ${Zk(e.parentFloor)}. A wave must have the same start floor in every included roadmap.`}},"NL.E0300":e=>`Duplicate identifier "${e.name}". First declared at ${e.location}.`,"NL.E0301":e=>`${e.type} must have an identifier, a title, or both.`,"NL.E0400":e=>`Invalid duration "${e.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q. Use "size:NAME" to reference a declared size.`,"NL.E0401":e=>`Invalid size "${e.value}". Use the id of a declared size (e.g. xs, m, lg).`,"NL.E0402":e=>`Invalid effort "${e.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q.`,"NL.E0403":e=>`Invalid remaining value "${e.value}". Use a percentage like 30% or a duration literal like 1w, 0.5d.`,"NL.E0404":e=>`Remaining must be between 0% and 100%, got ${e.value}.`,"NL.E0405":e=>`Invalid ${e.key} "${e.value}". Use ISO 8601 format: YYYY-MM-DD.`,"NL.E0406":e=>`Invalid scale "${e.value}". Use a raw duration literal like 1w, 2w, 1q (no name lookup).`,"NL.E0407":e=>`Invalid calendar "${e.value}". Must be business, full, or custom.`,"NL.E0408":e=>`Property "${e.key}" requires at least one reference.`,"NL.E0410":e=>`"${e.key}:" accepts at most one inline date per direction; collapse the multiple dates to a single binding date or use a declared anchor.`,"NL.E0411":e=>`Inline date in "${e.key}:" is not allowed on ${e.type}. Allowed only on item, parallel, and group, and on a wave's after:; for a milestone use "date:" instead.`,"NL.E0412":e=>`Inline date "${e.date}" in "${e.key}:" requires the roadmap to declare "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0413":e=>`Inline date "${e.date}" in "${e.key}:" is before roadmap start ${e.start}.`,"NL.E0500":e=>`Anchor "${e.name}" requires a "date:" property.`,"NL.E0501":e=>`Anchor "${e.name}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0502":e=>`Anchor "${e.name}" date ${e.date} is before roadmap start ${e.start}.`,"NL.E0503":e=>`Milestone "${e.name}" requires at least one of "date:" or "after:".`,"NL.E0504":e=>`Milestone "${e.name}" date ${e.date} is before roadmap start ${e.start}.`,"NL.E0505":()=>'Footnote requires an "on:" property referencing one or more entities.',"NL.E0600":e=>`Item "${e.name}" requires a "size:" or "duration:" property.`,"NL.E0800":e=>`Invalid non-working value "${e.value}". Use hide or show.`,"NL.E0801":e=>`Invalid color "${e.value}" for "${e.key}". Use a named color, hex value, or "none".`,"NL.E0802":e=>`Invalid value "${e.value}" for "${e.key}". Allowed: ${e.allowed}.`,"NL.E0803":e=>`Unknown style property "${e.key}".`,"NL.E0804":e=>`Raw style property "${e.key}" is not allowed on ${e.entity}. Declare a named style in config and reference it via "style:id".`,"NL.E0805":e=>`Symbol id "${e.name}" collides with a built-in icon name. Reserved built-ins: ${e.builtins}.`,"NL.E0806":e=>`Symbol "${e.name}" requires a "unicode:" property (e.g. unicode:"\u{1F4B0}" or unicode:"\\u{1F464}").`,"NL.E0807":e=>`Symbol "${e.name}" unicode: must be a non-empty value.`,"NL.E0808":e=>`Symbol "${e.name}" ascii: must be 1-3 ASCII characters (got ${e.length} character${e.length===1?"":"s"}).`,"NL.E0809":e=>`Unknown symbol property "${e.key}". Allowed: unicode, ascii, link, description.`,"NL.E0810":e=>`Duplicate symbol id "${e.name}". First declared at ${e.location}.`,"NL.E0811":e=>`${e.key}: "${e.value}" is neither a built-in (${e.builtins}) nor a declared symbol. Add "symbol ${e.value} unicode:..." earlier in config or use a quoted Unicode literal.`,"NL.E0812":e=>`${e.key}: symbol "${e.value}" is referenced before its declaration. Move "symbol ${e.value}" above this entry.`,"NL.E0900":e=>`A ${e.kind} declaration takes date:, or start: and end:, or every: with optional start: and end:.`,"NL.E0901":e=>`Unknown ${e.kind} property "${e.key}". Allowed: date, start, end, every.`,"NL.E0902":e=>`${e.key}: on a ${e.kind} declaration takes one date, not a list.`,"NL.E0903":e=>`end: ${e.end} is before start: ${e.start}.`,"NL.E0904":e=>`Invalid weekday "${e.value}". Use sun, mon, tue, wed, thu, fri or sat.`,"NL.E0905":e=>`Weekday "${e.value}" is listed more than once.`,"NL.E0906":()=>"This leaves no working day in the week with no end date. Keep at least one weekday working.","NL.E0907":e=>`Duplicate ${e.kind} id "${e.name}".`,"NL.W0700":e=>`Unknown property "${e.key}" on ${e.entity}. The renderer ignores it.${e.suggested?` Did you mean "${e.suggested}"?`:""}`,"NL.W0701":e=>`Wave "${e.id}" in "${e.path}" differs from this file's definition (${e.fields.map(t=>`${t.field} ${t.there===""?"none":`"${t.there}"`} there, ${t.here===""?"none":`"${t.here}"`} here`).join("; ")}); this file's definition is used.`,"NL.W0702":e=>`"wave:" on ${e.target.kind==="default"?`"default ${e.target.entityType}"`:!e.target.name&&e.target.line!==void 0?`the ${e.target.kind==="parallel"?"parallel block":e.target.kind} on line ${e.target.line}`:`${e.target.kind} "${e.target.name}"`} is ignored: this roadmap declares no waves. Declare waves with "wave <id>" to use it, or remove the property.`,"NL.W0703":e=>`"${e.key}" on "default ${e.entityType}" is ignored: it is a roadmap-only style key. Set it on "default roadmap" instead.`,"NL.W0704":e=>`"timeline-position:${e.position}" draws no dates: "header-height:none" removes every timeline date strip. Set header-height to xs, sm, md, lg or xl to show them.`,"NL.W0705":e=>`days-per-week is ${e.daysPerWeek}, but the week leaves ${e.working} working days.`,"NL.E1100":e=>`Wave ${e.title===void 0?`on line ${e.line}`:`"${e.title}"`} needs an explicit identifier so work can reference it with wave:<id>, e.g. wave build "Build".`,"NL.E1101":e=>{switch(e.reason){case"list":return`"wave:" takes exactly one wave id; an item belongs to at most one wave. Got "${e.value}".`;case"unknown":return`Wave "${e.value}" is not declared. Declared waves: ${e.declared.length>0?e.declared.join(", "):"none"}. Add "wave ${e.value}" above the first swimlane that uses it.${Jk(e.suggestion)}`;case"forward":return`Wave "${e.value}" is used before its declaration on line ${e.line}. Declare waves above the swimlanes that use them.`;case"not-a-wave":return`"wave:" must name a wave, but "${e.value}" is ${Yk[e.kind]}.${Jk(e.suggestion)}`}},"NL.E1102":e=>`${ry(iy(e.entity))} has wave:${e.wave}, but its enclosing ${iy(e.container,!1)} has wave:${e.containerWave}. A container's wave applies to everything inside it; remove one of the two wave: properties.`,"NL.E1103":e=>{switch(e.reason){case"sequence":{let t=e.items.length>1,n=`${t?"Items":"Item"} ${e.items.map(i=>`"${i}"`).join(", ")} (wave "${e.itemWave}")`,r=typeof e.ref=="string"?`"${e.ref}"`:gs(e.ref);return`${n} ${t?"come":"comes"} after ${r} (wave "${e.refWave}") in ${gs(e.flow)}. Work in a lane or group runs in order, so it must also be ordered by wave: move ${r} below "${e.last}", or change their waves.`}case"join":return`Item "${e.name}" (wave "${e.wave}") comes after ${gs(e.block)} in ${gs(e.flow)}, and that block cannot end before its track "${e.track}" (wave "${e.trackWave}") does. Move "${e.name}" above the block or into a track of its own, or change one of their waves.`;case"after-item":return e.container?`${qk(e.container)} has after:${e.refId}, but "${e.ref}" is in later wave "${e.refWave}". Wave "${e.refWave}" cannot start until wave "${e.wave}" ends, so "${e.name}" (wave "${e.wave}") inside it could never start: move "${e.name}" to wave "${e.refWave}" or later, or remove the after:.`:`Item "${e.name}" (wave "${e.wave}") has after:${e.refId}, but "${e.ref}" is in later wave "${e.refWave}". Wave "${e.refWave}" cannot start until wave "${e.wave}" ends, so "${e.name}" could never start: move it to wave "${e.refWave}" or later, or remove the after:.`;case"after-wave":return e.container?`${qk(e.container)} (wave "${e.wave}") has after:${e.refId}, but work cannot wait for the end of its own wave or a later one. Use an earlier wave, or move the ${e.container.kind} to a later wave.`:`Item "${e.name}" (wave "${e.wave}") has after:${e.refId}, but work cannot wait for the end of its own wave or a later one. Use an earlier wave, or move "${e.name}" to a later wave.`;case"chain":return`Item "${e.name}" (wave "${e.wave}") could never start: through ${e.chain.join(" \u2192 ")}, it waits for work that cannot start until wave "${e.wave}" has ended. Move "${e.name}" to a later wave, or break the chain.`}},"NL.E1104":e=>{switch(e.reason){case"swimlane":return`"wave:" is not allowed on swimlane "${e.name}": a swimlane spans every wave. Put wave: on its items, or wrap them in "group wave:${e.value}".`;case"milestone":return`"wave:" is not allowed on milestone "${e.name}". To place a milestone at the end of a wave, use after:${e.value}.`;case"other":return`"wave:" is not allowed on ${NM[e.type]} "${e.name}"; only item, group, and parallel can belong to a wave.`}},"NL.E1105":e=>e.reason==="before"?`"before:" is not allowed on wave "${e.name}". A wave's end comes from its items; to give a wave a deadline, add a dated milestone: milestone ${e.name}-due date:<YYYY-MM-DD> after:${e.name}.`:`"${e.key}:" is not allowed on wave "${e.name}". A wave's span comes from its items; only after: (an anchor, a dated milestone, or one ISO date) can hold back a wave's start.`,"NL.E1106":e=>`Wave "${e.name}" has after:${e.ref}, but "${e.ref}" is ${Yk[e.kind]}. A wave's after: accepts only anchors, dated milestones, or one ISO date; to make a wave wait for work, put that work in an earlier wave.`,"NL.W1000":e=>`Now-line date ${e.date} is outside the roadmap window (${e.start} \u2013 ${e.end}); it will not be drawn.`,"NL.W1001":e=>`Item "${e.name}" is pinned to ${e.pin} (${e.key}:), but wave "${e.wave}" cannot start until ${e.start}; the item starts at the wave start.`,"NL.W1002":e=>`Wave barriers did not settle after ${e.passes} layout passes, so the drawn schedule may not respect the wave order. The roadmap probably has an ordering conflict that validation did not catch.`,"NL.W1100":e=>{let t=Kk(e);return e.reason==="item"?`before:${e.ref} on ${t} can never be met: ${t} is in wave "${e.wave}", which cannot start until "${e.ref}" (wave "${e.refWave}") has finished. The overrun will be painted.`:`before:${e.ref} on ${t} can never be met: ${t} is in wave "${e.wave}", which cannot finish before wave "${e.ref}" starts. The overrun will be painted.`},"NL.W1101":e=>{let t=Kk(e);switch(e.reason){case"forward-lane":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which is in a later swimlane ("${e.lane}"). Layout places swimlanes in order and ignores references to work it has not placed yet, so it ignores this ${e.key}:. Move swimlane "${e.lane}" above swimlane "${e.ownLane}", or remove the ${e.key}:.`;case"forward-flow":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which comes later in ${gs(e.flow)}. Layout ignores references to work it has not placed yet, so it ignores this ${e.key}:. Move "${e.ref}" above ${t}, or remove the ${e.key}:.`;case"ancestor":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which contains it. Layout ignores references to an enclosing group or parallel, so it ignores this ${e.key}:. Remove the ${e.key}:.`;case"floating-milestone":return`${e.key}:${e.ref} on ${t} refers to milestone "${e.ref}", which has no date. Floating milestones are placed after all work, so layout ignores this ${e.key}:. Reference the milestone's predecessors or a wave instead.`}},"NL.I1000":e=>`Title on item "${e.name}" is wider than its bar at this scale; it rendered to the right of the bar.`,"NL.I1001":e=>`Label chips on item "${e.name}" did not fit inside the bar; they rendered in a spill column to the right.`,"NL.I1002":e=>`Item "${e.name}" is too narrow to show its marker at this scale; decorations spilled beside the bar.`,"NL.I1003":e=>e.anchor?`Item "${e.name}" extends past its "before:" anchor "${e.anchor}".`:`Item "${e.name}" extends past its "before:" anchor.`,"NL.I1004":e=>`Swimlane "${e.lane}" packed into ${e.rows} rows to avoid overlap.`,"NL.I1005":e=>`Swimlane "${e.lane}" is over capacity in one or more periods (red utilization band).`,"NL.I1006":e=>{switch(e.reason){case"one":return`Wave "${e.name}" has no items, so it spans no time; it is drawn as a marker in the wave strip and listed in the wave legend.`;case"many":return`Waves ${Qk(e.names)} have no items, so they span no time; they are drawn as markers in the wave strip and listed in the wave legend.`;case"all":return`None of the declared waves (${Qk(e.names)}) has items yet. The wave strip shows a placeholder until work is assigned with wave:<id>.`}},"NL.I1007":e=>`Milestone "${e.name}" (${e.date}) is overrun: wave "${e.wave}" ends ${e.end}.`,"NL.I1008":e=>`Item "${e.name}" is pinned to ${e.pin} (${e.key}:), a non-working day; it starts on ${e.start}.`};var j=e=>`\xAB\xA0${e}\xA0\xBB`,tA={item:"un \xE9l\xE9ment",group:"un groupe",parallel:"un bloc parall\xE8le",swimlane:"une swimlane",anchor:"une ancre",milestone:"un jalon","floating-milestone":"un jalon sans date",wave:"une vague",label:"une \xE9tiquette",size:"une taille",status:"un statut",person:"une personne",team:"une \xE9quipe",footnote:"une note de bas de page",roadmap:"la roadmap",style:"un style",symbol:"un symbole"},PM={item:"l'\xE9l\xE9ment",group:"le groupe",parallel:"le bloc parall\xE8le",swimlane:"la swimlane",anchor:"l'ancre",milestone:"le jalon","floating-milestone":"le jalon",wave:"la vague",label:"l'\xE9tiquette",size:"la taille",status:"le statut",person:"la personne",team:"l'\xE9quipe",footnote:"la note de bas de page",roadmap:"la roadmap",style:"le style",symbol:"le symbole"},oy=e=>e.charAt(0).toUpperCase()+e.slice(1);function ys(e){return e.kind==="parallel-block"?`le bloc parall\xE8le \xE0 la ligne ${e.line}`:e.kind==="group-block"?`le groupe \xE0 la ligne ${e.line}`:`${e.kind==="group"?"le groupe":e.kind==="parallel"?"le bloc parall\xE8le":"la swimlane"} ${j(e.name)}`}function sy(e,t=!1){if(e.name||e.line===void 0)return t?`de ${j(e.name)}`:j(e.name);let n=ys({kind:e.kind==="parallel"?"parallel-block":"group-block",line:e.line});return t?`du ${n.slice(3)}`:n}function ay(e){let t=e.kind==="item"?"\xE9l\xE9ment":e.kind==="group"?"groupe":"bloc parall\xE8le",n=e.kind==="item"?"l'":"le ";return e.name?`${n}${t} ${j(e.name)}`:e.line===void 0?`${n}${t}`:`${n}${t} \xE0 la ligne ${e.line}`}function nA(e){let t=e.kind==="parallel"?"le bloc parall\xE8le":"le groupe";return e.name?`${t} ${j(e.name)}`:e.line===void 0?t:`${t} \xE0 la ligne ${e.line}`}function rA(e){return e?e.title===void 0?` Vouliez-vous dire wave:${e.id}\xA0?`:` Vouliez-vous dire wave:${e.id} (${j(e.title)})\xA0?`:""}function iA(e){let t=e.slice(0,5).map(j),n=e.length-t.length;return n>0?`${t.join(", ")} et ${n} autre${n>1?"s":""}`:t.join(", ")}function ed(e){return`[${e.join(", ")}]`}function oA(e){return e===null?"n'a pas de borne de d\xE9part":`ne s'ouvre pas avant ${e}`}function sA(e){return e===""?"aucun":j(e)}var LM={title:"titre",style:"style",labels:"\xE9tiquettes",link:"lien",description:"description"},aA={"NL.E0001":()=>"La section config doit pr\xE9c\xE9der la section roadmap.","NL.E0002":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section config.","NL.E0003":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section roadmap.","NL.E0004":()=>"Au moins une swimlane est requise.","NL.E0005":e=>`Ligne ${e.line}\xA0: tabulations et espaces m\xE9lang\xE9s dans l'indentation. Utilisez l'un ou l'autre, mais pas les deux.`,"NL.E0100":e=>`Format de version invalide \xAB\xA0${e.version}\xA0\xBB. Format attendu\xA0: v1, v2, etc.`,"NL.E0101":e=>`Ce fichier requiert Nowline ${e.version}, mais l'analyseur ne prend en charge que jusqu'\xE0 ${e.supported}.`,"NL.E0102":e=>`Propri\xE9t\xE9 de directive inconnue \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: ${e.allowed}.`,"NL.E0103":e=>`Propri\xE9t\xE9 de directive \xAB\xA0${e.key}\xA0\xBB en double.`,"NL.E0104":e=>`Locale invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez une \xE9tiquette BCP-47 telle que \xAB\xA0en-US\xA0\xBB, \xAB\xA0fr\xA0\xBB ou \xAB\xA0fr-CA\xA0\xBB.`,"NL.E0200":e=>`Mode d'include invalide \xAB\xA0${e.value}\xA0\xBB. Doit \xEAtre merge, ignore ou isolate.`,"NL.E0201":e=>`Option \xAB\xA0${e.key}\xA0\xBB en double sur include.`,"NL.E0202":e=>{switch(e.reason){case"mismatch":return`L'include ${j(e.path)} d\xE9clare les vagues ${ed(e.child)}, mais celles de ce fichier sont ${ed(e.parent)}. Chaque roadmap incluse doit d\xE9clarer les m\xEAmes vagues dans le m\xEAme ordre\xA0: copiez les lignes wave de ce fichier dans ${j(e.path)}.`;case"child-none":return`L'include ${j(e.path)} ne d\xE9clare aucune vague, mais celles de ce fichier sont ${ed(e.parent)}. Copiez les lignes wave de ce fichier dans ${j(e.path)} pour que son travail rejoigne les vagues.`;case"parent-none":return`L'include ${j(e.path)} d\xE9clare les vagues ${ed(e.child)}, mais ce fichier n'en d\xE9clare aucune. D\xE9clarez les m\xEAmes vagues ici pour que les barri\xE8res s'appliquent \xE0 toute la roadmap.`;case"floor":return`La vague ${j(e.id)} dans ${j(e.path)} ${oA(e.childFloor)}, mais la vague ${j(e.id)} de ce fichier ${oA(e.parentFloor)}. Une vague doit avoir la m\xEAme borne de d\xE9part dans chaque roadmap incluse.`}},"NL.E0300":e=>`Identifiant en double \xAB\xA0${e.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${e.location}.`,"NL.E0301":e=>`${e.type} doit comporter un identifiant, un titre, ou les deux.`,"NL.E0400":e=>`Dur\xE9e invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q. Utilisez \xAB\xA0size:NOM\xA0\xBB pour r\xE9f\xE9rencer une taille d\xE9clar\xE9e.`,"NL.E0401":e=>`Taille invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez l'identifiant d'une taille d\xE9clar\xE9e (p.\xA0ex. xs, m, lg).`,"NL.E0402":e=>`Effort invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q.`,"NL.E0403":e=>`Valeur restante invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un pourcentage tel que 30% ou un litt\xE9ral de dur\xE9e comme 1w, 0.5d.`,"NL.E0404":e=>`La valeur restante doit \xEAtre comprise entre 0 % et 100 %, re\xE7u ${e.value}.`,"NL.E0405":e=>`${e.key} invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez le format ISO 8601\xA0: AAAA-MM-JJ.`,"NL.E0406":e=>`\xC9chelle invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 1w, 2w, 1q (pas de recherche par nom).`,"NL.E0407":e=>`Calendrier invalide \xAB\xA0${e.value}\xA0\xBB. Doit \xEAtre business, full ou custom.`,"NL.E0408":e=>`La propri\xE9t\xE9 \xAB\xA0${e.key}\xA0\xBB exige au moins une r\xE9f\xE9rence.`,"NL.E0410":e=>`\xAB\xA0${e.key}:\xA0\xBB n'accepte qu'une seule date inline par direction\xA0; regroupez les dates en une seule date contraignante ou utilisez une ancre d\xE9clar\xE9e.`,"NL.E0411":e=>`Une date inline dans \xAB\xA0${e.key}:\xA0\xBB n'est pas autoris\xE9e sur ${e.type}. Autoris\xE9e seulement sur item, parallel et group, et sur le \xAB\xA0after:\xA0\xBB d'une vague\xA0; pour un milestone utilisez \xAB\xA0date:\xA0\xBB \xE0 la place.`,"NL.E0412":e=>`La date inline \xAB\xA0${e.date}\xA0\xBB dans \xAB\xA0${e.key}:\xA0\xBB exige que la roadmap d\xE9clare \xAB\xA0start:\xA0\xBB. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0413":e=>`La date inline \xAB\xA0${e.date}\xA0\xBB dans \xAB\xA0${e.key}:\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0500":e=>`L'ancre \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0date:\xA0\xBB.`,"NL.E0501":e=>`L'ancre \xAB\xA0${e.name}\xA0\xBB a une date, mais \xAB\xA0start:\xA0\xBB manque sur la roadmap. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0502":e=>`La date ${e.date} de l'ancre \xAB\xA0${e.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0503":e=>`Le jalon \xAB\xA0${e.name}\xA0\xBB exige au moins l'une des propri\xE9t\xE9s \xAB\xA0date:\xA0\xBB ou \xAB\xA0after:\xA0\xBB.`,"NL.E0504":e=>`La date ${e.date} du jalon \xAB\xA0${e.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0505":()=>"Une note de bas de page exige une propri\xE9t\xE9 \xAB\xA0on:\xA0\xBB r\xE9f\xE9ren\xE7ant au moins une entit\xE9.","NL.E0600":e=>`L'\xE9l\xE9ment \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0size:\xA0\xBB ou \xAB\xA0duration:\xA0\xBB.`,"NL.E0800":e=>`Valeur non-working invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez hide ou show.`,"NL.E0801":e=>`Couleur invalide \xAB\xA0${e.value}\xA0\xBB pour \xAB\xA0${e.key}\xA0\xBB. Utilisez une couleur nomm\xE9e, une valeur hexad\xE9cimale ou \xAB\xA0none\xA0\xBB.`,"NL.E0802":e=>`Valeur invalide \xAB\xA0${e.value}\xA0\xBB pour \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: ${e.allowed}.`,"NL.E0803":e=>`Propri\xE9t\xE9 de style inconnue \xAB\xA0${e.key}\xA0\xBB.`,"NL.E0804":e=>`La propri\xE9t\xE9 de style brute \xAB\xA0${e.key}\xA0\xBB n'est pas permise sur ${e.entity}. D\xE9clarez un style nomm\xE9 dans la config et r\xE9f\xE9rencez-le avec \xAB\xA0style:id\xA0\xBB.`,"NL.E0805":e=>`L'identifiant de symbole \xAB\xA0${e.name}\xA0\xBB entre en conflit avec le nom d'une ic\xF4ne int\xE9gr\xE9e. Noms r\xE9serv\xE9s\xA0: ${e.builtins}.`,"NL.E0806":e=>`Le symbole \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0unicode:\xA0\xBB (p.\xA0ex. unicode:"\u{1F4B0}" ou unicode:"\\u{1F464}").`,"NL.E0807":e=>`La propri\xE9t\xE9 \xAB\xA0unicode:\xA0\xBB du symbole \xAB\xA0${e.name}\xA0\xBB doit avoir une valeur non vide.`,"NL.E0808":e=>`La propri\xE9t\xE9 \xAB\xA0ascii:\xA0\xBB du symbole \xAB\xA0${e.name}\xA0\xBB doit compter de 1 \xE0 3 caract\xE8res ASCII (re\xE7u\xA0: ${e.length} caract\xE8re${e.length>1?"s":""}).`,"NL.E0809":e=>`Propri\xE9t\xE9 de symbole inconnue \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: unicode, ascii, link, description.`,"NL.E0810":e=>`Identifiant de symbole en double \xAB\xA0${e.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${e.location}.`,"NL.E0811":e=>`${e.key}: \xAB\xA0${e.value}\xA0\xBB n'est ni une ic\xF4ne int\xE9gr\xE9e (${e.builtins}) ni un symbole d\xE9clar\xE9. Ajoutez \xAB\xA0symbol ${e.value} unicode:...\xA0\xBB plus haut dans la config ou utilisez un litt\xE9ral Unicode entre guillemets.`,"NL.E0812":e=>`${e.key}: le symbole \xAB\xA0${e.value}\xA0\xBB est r\xE9f\xE9renc\xE9 avant sa d\xE9claration. D\xE9placez \xAB\xA0symbol ${e.value}\xA0\xBB au-dessus de cette entr\xE9e.`,"NL.E0900":e=>`Une d\xE9claration ${e.kind} prend date:, ou start: et end:, ou every: avec start: et end: facultatifs.`,"NL.E0901":e=>`Propri\xE9t\xE9 ${e.kind} inconnue \xAB\xA0${e.key}\xA0\xBB. Autoris\xE9es\xA0: date, start, end, every.`,"NL.E0902":e=>`${e.key}: sur une d\xE9claration ${e.kind} prend une seule date, pas une liste.`,"NL.E0903":e=>`end: ${e.end} pr\xE9c\xE8de start: ${e.start}.`,"NL.E0904":e=>`Jour de semaine invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez sun, mon, tue, wed, thu, fri ou sat.`,"NL.E0905":e=>`Le jour \xAB\xA0${e.value}\xA0\xBB appara\xEEt plusieurs fois.`,"NL.E0906":()=>"Il ne reste aucun jour ouvr\xE9 dans la semaine sans date de fin. Gardez au moins un jour ouvr\xE9.","NL.E0907":e=>`Identifiant ${e.kind} \xAB\xA0${e.name}\xA0\xBB en double.`,"NL.W0700":e=>`Propri\xE9t\xE9 inconnue \xAB\xA0${e.key}\xA0\xBB sur ${e.entity}. Le moteur de rendu l'ignore.${e.suggested?` Vouliez-vous dire \xAB\xA0${e.suggested}\xA0\xBB\xA0?`:""}`,"NL.W0701":e=>`La vague ${j(e.id)} dans ${j(e.path)} diff\xE8re de la d\xE9finition de ce fichier (${e.fields.map(t=>`${LM[t.field]} ${sA(t.there)} l\xE0-bas, ${sA(t.here)} ici`).join("\xA0; ")})\xA0; la d\xE9finition de ce fichier est utilis\xE9e.`,"NL.W0702":e=>`\xAB\xA0wave:\xA0\xBB sur ${e.target.kind==="default"?j(`default ${e.target.entityType}`):!e.target.name&&e.target.line!==void 0?e.target.kind==="item"||e.target.kind==="group"||e.target.kind==="parallel"?ay({kind:e.target.kind,name:"",line:e.target.line}):`${e.target.kind} \xE0 la ligne ${e.target.line}`:`${e.target.kind} ${j(e.target.name)}`} est ignor\xE9\xA0: cette roadmap ne d\xE9clare aucune vague. D\xE9clarez des vagues avec \xAB\xA0wave <id>\xA0\xBB pour l'utiliser, ou retirez la propri\xE9t\xE9.`,"NL.W0703":e=>`${j(e.key)} sur ${j(`default ${e.entityType}`)} est ignor\xE9\xA0: c'est une cl\xE9 de style propre \xE0 la roadmap. D\xE9finissez-la plut\xF4t sur \xAB\xA0default roadmap\xA0\xBB.`,"NL.W0704":e=>`${j(`timeline-position:${e.position}`)} n'affiche aucune date\xA0: ${j("header-height:none")} retire tous les bandeaux de dates de la frise. Donnez \xE0 header-height la valeur xs, sm, md, lg ou xl pour les afficher.`,"NL.W0705":e=>`days-per-week vaut ${e.daysPerWeek}, mais la semaine laisse ${e.working} jours ouvr\xE9s.`,"NL.E1100":e=>`La vague ${e.title===void 0?`\xE0 la ligne ${e.line}`:j(e.title)} exige un identifiant explicite pour que le travail puisse la r\xE9f\xE9rencer avec wave:<id>, p.\xA0ex. wave build "Build".`,"NL.E1101":e=>{switch(e.reason){case"list":return`\xAB\xA0wave:\xA0\xBB accepte exactement un identifiant de vague\xA0; un \xE9l\xE9ment appartient \xE0 une seule vague au plus. Re\xE7u ${j(e.value)}.`;case"unknown":return`La vague ${j(e.value)} n'est pas d\xE9clar\xE9e. Vagues d\xE9clar\xE9es\xA0: ${e.declared.length>0?e.declared.join(", "):"aucune"}. Ajoutez \xAB\xA0wave ${e.value}\xA0\xBB au-dessus de la premi\xE8re swimlane qui l'utilise.${rA(e.suggestion)}`;case"forward":return`La vague ${j(e.value)} est utilis\xE9e avant sa d\xE9claration \xE0 la ligne ${e.line}. D\xE9clarez les vagues au-dessus des swimlanes qui les utilisent.`;case"not-a-wave":return`\xAB\xA0wave:\xA0\xBB doit nommer une vague, mais ${j(e.value)} est ${tA[e.kind]}.${rA(e.suggestion)}`}},"NL.E1102":e=>`${oy(ay(e.entity))} a wave:${e.wave}, mais ${ay(e.container)} qui le contient a wave:${e.containerWave}. La vague d'un conteneur s'applique \xE0 tout ce qu'il contient\xA0; retirez l'une des deux propri\xE9t\xE9s wave:.`,"NL.E1103":e=>{switch(e.reason){case"sequence":{let t=e.items.length>1,n=`${t?"Les \xE9l\xE9ments":"L'\xE9l\xE9ment"} ${e.items.map(j).join(", ")} (vague ${j(e.itemWave)})`,r=typeof e.ref=="string"?j(e.ref):ys(e.ref);return`${n} ${t?"viennent":"vient"} apr\xE8s ${r} (vague ${j(e.refWave)}) dans ${ys(e.flow)}. Le travail d'une swimlane ou d'un groupe s'ex\xE9cute dans l'ordre, il doit donc aussi \xEAtre ordonn\xE9 par vague\xA0: d\xE9placez ${r} sous ${j(e.last)}, ou changez leurs vagues.`}case"join":return`L'\xE9l\xE9ment ${j(e.name)} (vague ${j(e.wave)}) vient apr\xE8s ${ys(e.block)} dans ${ys(e.flow)}, et ce bloc ne peut pas se terminer avant sa piste ${j(e.track)} (vague ${j(e.trackWave)}). D\xE9placez ${j(e.name)} au-dessus du bloc ou dans une piste distincte, ou changez l'une de leurs vagues.`;case"after-item":return e.container?`${oy(nA(e.container))} a after:${e.refId}, mais ${j(e.ref)} est dans la vague ult\xE9rieure ${j(e.refWave)}. La vague ${j(e.refWave)} ne peut pas d\xE9marrer avant la fin de la vague ${j(e.wave)}, donc ${j(e.name)} (vague ${j(e.wave)}) \xE0 l'int\xE9rieur ne pourrait jamais d\xE9marrer\xA0: d\xE9placez ${j(e.name)} dans la vague ${j(e.refWave)} ou une vague ult\xE9rieure, ou retirez le after:.`:`L'\xE9l\xE9ment ${j(e.name)} (vague ${j(e.wave)}) a after:${e.refId}, mais ${j(e.ref)} est dans la vague ult\xE9rieure ${j(e.refWave)}. La vague ${j(e.refWave)} ne peut pas d\xE9marrer avant la fin de la vague ${j(e.wave)}, donc ${j(e.name)} ne pourrait jamais d\xE9marrer\xA0: d\xE9placez-le dans la vague ${j(e.refWave)} ou une vague ult\xE9rieure, ou retirez le after:.`;case"after-wave":{let t=e.container?.kind==="parallel"?"bloc parall\xE8le":"groupe";return e.container?`${oy(nA(e.container))} (vague ${j(e.wave)}) a after:${e.refId}, mais le travail ne peut pas attendre la fin de sa propre vague ni d'une vague ult\xE9rieure. Utilisez une vague ant\xE9rieure, ou d\xE9placez le ${t} dans une vague ult\xE9rieure.`:`L'\xE9l\xE9ment ${j(e.name)} (vague ${j(e.wave)}) a after:${e.refId}, mais le travail ne peut pas attendre la fin de sa propre vague ni d'une vague ult\xE9rieure. Utilisez une vague ant\xE9rieure, ou d\xE9placez ${j(e.name)} dans une vague ult\xE9rieure.`}case"chain":return`L'\xE9l\xE9ment ${j(e.name)} (vague ${j(e.wave)}) ne pourrait jamais d\xE9marrer\xA0: via ${e.chain.join(" \u2192 ")}, il attend du travail qui ne peut pas d\xE9marrer avant la fin de la vague ${j(e.wave)}. D\xE9placez ${j(e.name)} dans une vague ult\xE9rieure, ou rompez la cha\xEEne.`}},"NL.E1104":e=>{switch(e.reason){case"swimlane":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur la swimlane ${j(e.name)}\xA0: une swimlane couvre toutes les vagues. Placez wave: sur ses \xE9l\xE9ments, ou regroupez-les dans \xAB\xA0group wave:${e.value}\xA0\xBB.`;case"milestone":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur le jalon ${j(e.name)}. Pour placer un jalon \xE0 la fin d'une vague, utilisez after:${e.value}.`;case"other":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur ${PM[e.type]} ${j(e.name)}\xA0; seuls item, group et parallel peuvent appartenir \xE0 une vague.`}},"NL.E1105":e=>e.reason==="before"?`\xAB\xA0before:\xA0\xBB n'est pas autoris\xE9 sur la vague ${j(e.name)}. La fin d'une vague d\xE9coule de ses \xE9l\xE9ments\xA0; pour donner une \xE9ch\xE9ance \xE0 une vague, ajoutez un jalon dat\xE9\xA0: milestone ${e.name}-due date:<AAAA-MM-JJ> after:${e.name}.`:`\xAB\xA0${e.key}:\xA0\xBB n'est pas autoris\xE9 sur la vague ${j(e.name)}. L'\xE9tendue d'une vague d\xE9coule de ses \xE9l\xE9ments\xA0; seul after: (une ancre, un jalon dat\xE9 ou une date ISO) peut retarder le d\xE9but d'une vague.`,"NL.E1106":e=>`La vague ${j(e.name)} a after:${e.ref}, mais ${j(e.ref)} est ${tA[e.kind]}. Le after: d'une vague accepte seulement des ancres, des jalons dat\xE9s ou une date ISO\xA0; pour qu'une vague attende du travail, placez ce travail dans une vague ant\xE9rieure.`,"NL.W1001":e=>`L'\xE9l\xE9ment ${j(e.name)} est \xE9pingl\xE9 \xE0 ${e.pin} (${e.key}:), mais la vague ${j(e.wave)} ne peut pas d\xE9marrer avant le ${e.start}\xA0; l'\xE9l\xE9ment d\xE9marre au d\xE9but de la vague.`,"NL.W1002":e=>`Les barri\xE8res de vagues ne se sont pas stabilis\xE9es apr\xE8s ${e.passes} passes de mise en page\xA0; le calendrier dessin\xE9 pourrait donc ne pas respecter l'ordre des vagues. La roadmap comporte probablement un conflit d'ordre que la validation n'a pas d\xE9tect\xE9.`,"NL.W1100":e=>{let t=sy(e);return e.reason==="item"?`before:${e.ref} sur ${t} ne peut jamais \xEAtre respect\xE9\xA0: ${t} est dans la vague ${j(e.wave)}, qui ne peut pas d\xE9marrer avant la fin de ${j(e.ref)} (vague ${j(e.refWave)}). Le d\xE9passement sera peint.`:`before:${e.ref} sur ${t} ne peut jamais \xEAtre respect\xE9\xA0: ${t} est dans la vague ${j(e.wave)}, qui ne peut pas se terminer avant le d\xE9but de la vague ${j(e.ref)}. Le d\xE9passement sera peint.`},"NL.W1101":e=>{let t=sy(e);switch(e.reason){case"forward-lane":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${j(e.ref)}, qui se trouve dans une swimlane ult\xE9rieure (${j(e.lane)}). La mise en page place les swimlanes dans l'ordre et ignore les r\xE9f\xE9rences \xE0 du travail qu'elle n'a pas encore plac\xE9, elle ignore donc ce ${e.key}:. D\xE9placez la swimlane ${j(e.lane)} au-dessus de la swimlane ${j(e.ownLane)}, ou retirez le ${e.key}:.`;case"forward-flow":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${j(e.ref)}, qui vient plus tard dans ${ys(e.flow)}. La mise en page ignore les r\xE9f\xE9rences \xE0 du travail qu'elle n'a pas encore plac\xE9, elle ignore donc ce ${e.key}:. D\xE9placez ${j(e.ref)} au-dessus ${sy(e,!0)}, ou retirez le ${e.key}:.`;case"ancestor":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${j(e.ref)}, qui le contient. La mise en page ignore les r\xE9f\xE9rences \xE0 un groupe ou un bloc parall\xE8le englobant, elle ignore donc ce ${e.key}:. Retirez le ${e.key}:.`;case"floating-milestone":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence le jalon ${j(e.ref)}, qui n'a pas de date. Les jalons sans date sont plac\xE9s apr\xE8s tout le travail, la mise en page ignore donc ce ${e.key}:. R\xE9f\xE9rencez plut\xF4t les pr\xE9d\xE9cesseurs du jalon ou une vague.`}},"NL.I1006":e=>{switch(e.reason){case"one":return`La vague ${j(e.name)} n'a aucun \xE9l\xE9ment, elle ne couvre donc aucune dur\xE9e\xA0; elle est dessin\xE9e comme un rep\xE8re dans la bande des vagues et list\xE9e dans la l\xE9gende des vagues.`;case"many":return`Les vagues ${iA(e.names)} n'ont aucun \xE9l\xE9ment, elles ne couvrent donc aucune dur\xE9e\xA0; elles sont dessin\xE9es comme des rep\xE8res dans la bande des vagues et list\xE9es dans la l\xE9gende des vagues.`;case"all":return`Aucune des vagues d\xE9clar\xE9es (${iA(e.names)}) n'a encore d'\xE9l\xE9ment. La bande des vagues affiche un espace r\xE9serv\xE9 jusqu'\xE0 ce que du travail soit affect\xE9 avec wave:<id>.`}},"NL.I1007":e=>`Le jalon ${j(e.name)} (${e.date}) est d\xE9pass\xE9\xA0: la vague ${j(e.wave)} se termine le ${e.end}.`,"NL.I1008":e=>`L'\xE9l\xE9ment ${j(e.name)} est \xE9pingl\xE9 \xE0 ${e.pin} (${e.key}:), un jour non ouvr\xE9\xA0; il d\xE9marre le ${e.start}.`};var lA={};var cA={};var $M=new Map([["en-US",eA],["fr",aA],["fr-CA",lA],["fr-FR",cA]]);function jn(e,t,...n){for(let r of OM(e)){let o=$M.get(r)?.[t];if(o)return o(...n)}return t}var uA="en-US";function OM(e){let t=[],n=CM(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(uA)||t.push(uA),t}function CM(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}var DM=/[\\/]/;function pA(e){for(let t=e.length-1;t>=0;t--){let n=e.charCodeAt(t);if(n===47||n===92)return t}return-1}function fA(...e){for(let t of e)if(t){if(t.includes("\\")&&!t.includes("/"))return"\\";if(t.includes("/"))return"/"}return"/"}function MM(e){return e?e[0]==="/"||e[0]==="\\"?!0:e.length>=3&&/^[A-Za-z]:[\\/]/.test(e):!1}function hA(e){let t=pA(e);return t<0?".":t===0?e[0]:t===2&&/^[A-Za-z]:[\\/]/.test(e)?e.slice(0,3):e.slice(0,t)}function xs(e){let t=pA(e);return t<0?e:e.slice(t+1)}function ly(e,t){if(MM(t))return dA(t,fA(t));let n=fA(e,t);return dA(`${e}${n}${t}`,n)}function dA(e,t){let n="",r=e,i=/^([A-Za-z]:)([\\/])?/.exec(r);i?(n=i[1]+(i[2]?t:""),r=r.slice(i[0].length)):(r[0]==="/"||r[0]==="\\")&&(n=t,r=r.replace(/^[\\/]+/,""));let o=[];for(let s of r.split(DM))if(!(s===""||s===".")){if(s===".."){o.length>0&&o[o.length-1]!==".."?o.pop():n||o.push("..");continue}o.push(s)}return n+o.join(t)}function At(e){return/[\r\n]/.test(e)?e.replace(/\s*[\r\n]+\s*/g," ").trim():e}function mA(e,t,n){if(e===t)return 0;let r=e.length,i=t.length;if(Math.abs(r-i)>n)return n+1;if(r===0)return i;if(i===0)return r;let o=new Array(i+1),s=new Array(i+1);for(let a=0;a<=i;a++)o[a]=a;for(let a=1;a<=r;a++){s[0]=a;let l=a;for(let u=1;u<=i;u++){let f=e.charCodeAt(a-1)===t.charCodeAt(u-1)?0:1;s[u]=Math.min(o[u]+1,s[u-1]+1,o[u-1]+f),s[u]<l&&(l=s[u])}if(l>n)return n+1;let c=o;o=s,s=c}return o[i]}function gA(e,t,n=2){let r,i=n+1;for(let o of t){let s=mA(e,o,n);if(s<i&&(r=o,i=s,s===0))break}return r}function yA(e,t,n=2){let r,i=n+1,o=!1;for(let s of t){let a=mA(e,s,n);a<i?(r=s,i=a,o=!1):a===i&&a<=n&&s!==r&&(o=!0)}return o?void 0:r}function Re(e){return e.name??(e.title===void 0?"<unnamed>":At(e.title))}function Mr(e){return e.$type==="NonWorkingDeclaration"?"non-working":e.$type.replace(/Declaration$|Block$/,"").toLowerCase()}function xl(e){let t=Mr(e),n=e.name??(e.title===void 0?void 0:At(e.title));return n?`${t} "${n}"`:t}function xn(e){let t=e.$cstNode;return t?t.range.start.line+1:0}function td(e,t){return`"${e}" cannot be set on "default ${t}". Identity-defining, sizing, sequencing, reference, and prose properties must be explicit on each entity.`}function nn(e){let t=new Set,n=[];for(let r of e.roadmapEntries)!_t(r)||!r.name||t.has(r.name)||(t.add(r.name),n.push(r));return n}function FM(e){let t=new Map;return nn(e).forEach((n,r)=>{t.set(n.name,r+1)}),t}function EA(e){return(e.properties??[]).filter(n=>q(n)==="wave")}function wA(e){return EA(e)[0]}function cy(e){return e.value!==void 0?e.value:e.values.length===1?e.values[0]:`[${e.values.join(", ")}]`}function BM(e){let t=e;for(;t?.$container&&!rs(t.$container);)t=t.$container;let n=t?.$container;if(!(!t||!n||!rs(n)))return{file:n,index:n.roadmapEntries.indexOf(t),waveDecls:TA(n)}}function TA(e){let t=new Map;return e.roadmapEntries.forEach((n,r)=>{_t(n)&&n.name&&!t.has(n.name)&&t.set(n.name,r)}),t}function uy(e,t,n,r=BM(t)){let i=cy(e);if(e.value===void 0&&e.values.length!==1)return{status:"list",value:i};let o=n.get(i);if(o===void 0)return{status:"missing",value:i};if(r){let s=r.waveDecls.get(i);if(s!==void 0&&(r.index<0||s>r.index))return{status:"forward",value:i,line:xn(r.file.roadmapEntries[s])}}return{status:"valid",id:i,index:o}}function UM(e){return Ce(e)||et(e)}function WM(e,t,n,r){let i=wA(e);if(!i)return t;let o=uy(i,e,n,r);if(o.status==="valid")return t??o.index}function nd(e,t){let n=new Map,r=new Map,i=new Map,o=(s,a,l)=>{let c=WM(s,a,t,l);c!==void 0&&n.set(s,c);let u=c;if(Ce(s)||et(s)){let f=[];for(let d of Mt(s))f.push(o(d,c,l));c===void 0&&(Ce(s)?u=f[0]:f.length>0&&!f.includes(void 0)&&(u=Math.min(...f)))}return u!==void 0&&r.set(s,u),u};for(let s of e){let a,l=s.$container;if(rs(l)){let c=i.get(l);c||(c=TA(l),i.set(l,c)),a={file:l,index:l.roadmapEntries.indexOf(s),waveDecls:c}}for(let c of Mt(s))o(c,void 0,a)}return{waveOf:n,leadOf:r}}function vA(e){return(e.properties??[]).find(n=>q(n)==="date")?.value}function Es(e){let t=Z0(e);return n=>t.get(n)}function wl(e,t){let n=null;for(let r of e.properties){if(q(r)!=="after")continue;let i=r.value!==void 0?[r.value]:r.values;for(let o of i){if(!o)continue;let s;if(st.test(o))s=o;else{let a=t(o);(ns(a)||hn(a))&&(s=vA(a))}s===void 0||!ze(s)||(n===null||s>n.date)&&(n={date:s,ref:o})}}return n}var _A=new Set(["before","date","start","length","duration","size","capacity","remaining","wave"]);function ws(e){return _t(e.$container)&&_A.has(q(e))}var XM={ItemDeclaration:"item",GroupBlock:"group",ParallelBlock:"parallel",SwimlaneDeclaration:"swimlane",AnchorDeclaration:"anchor",MilestoneDeclaration:"milestone",WaveDeclaration:"wave",LabelDeclaration:"label",SizeDeclaration:"size",StatusDeclaration:"status",PersonDeclaration:"person",TeamDeclaration:"team",FootnoteDeclaration:"footnote",RoadmapDeclaration:"roadmap",StyleDeclaration:"style",SymbolDeclaration:"symbol"};function El(e){return XM[e.$type]??Mr(e)}function GM(e,t){let n=[],r=Re(e),i=!e.name&&e.title===void 0;if(e.name||n.push({severity:"error",code:"NL.E1100",args:{...e.title===void 0?{}:{title:At(e.title)},line:xn(e)},node:e}),i)return n;for(let o of e.properties){let s=q(o);if(_A.has(s)){n.push({severity:"error",code:"NL.E1105",args:s==="before"?{reason:"before",name:r}:{reason:"other",key:s,name:r},node:o,property:"key"});continue}if(s!=="after")continue;let a=o.value!==void 0?[o.value]:o.values;for(let l of a){if(!l||st.test(l))continue;let c=t(l);if(!(!c||ns(c))){if(hn(c)){if(vA(c)!==void 0)continue;n.push({severity:"error",code:"NL.E1106",args:{name:r,ref:l,kind:"floating-milestone"},node:o});continue}n.push({severity:"error",code:"NL.E1106",args:{name:r,ref:l,kind:El(c)},node:o})}}}return n}function rd(e){let t=Es(e);return e.roadmapEntries.filter(_t).flatMap(n=>GM(n,t))}function zM(e){return[...Mn(e,{config:!0,roadmap:!0})].filter(t=>z0(t)?nt(t):!_t(t))}function HM(e,t){let n=e.toLowerCase(),r=t.filter(o=>o.title!==void 0&&At(o.title).toLowerCase()===n),i;if(r.length===1)i=r[0];else{let o=yA(e,t.map(s=>s.name));i=o===void 0?void 0:t.find(s=>s.name===o)}if(i)return i.title===void 0?{id:i.name}:{id:i.name,title:At(i.title)}}function jM(e,t,n){let r=n(t);if(r)return El(r);for(let i of e.configEntries)if((Dt(i)||xi(i))&&i.name===t)return El(i)}function VM(e,t){let n=e.$container;for(;UM(n);){let r=wA(n);if(r)return uy(r,n,t).status==="valid"?{container:n,prop:r}:void 0;n=n?.$container}}function xA(e,t){let n=t.name??(t.title===void 0?"":At(t.title));return n?{kind:e,name:n}:{kind:e,name:n,line:xn(t)}}function YM(e){if(nt(e))return{kind:"default",entityType:e.entityType};let t=e,n=t.name??(t.title===void 0?"":At(t.title)),r=El(e);return n?{kind:r,name:n}:{kind:r,name:n,line:xn(e)}}function KM(e,t,n,r,i,o){let s=uy(n,t,i);switch(s.status){case"list":return{severity:"error",code:"NL.E1101",args:{reason:"list",value:s.value},node:n};case"forward":return{severity:"error",code:"NL.E1101",args:{reason:"forward",value:s.value,line:s.line},node:n};case"missing":{let u=jM(e,s.value,o),f=HM(s.value,r);return{severity:"error",code:"NL.E1101",args:u===void 0?{reason:"unknown",value:s.value,declared:r.map(d=>d.name),...f?{suggestion:f}:{}}:{reason:"not-a-wave",value:s.value,kind:u,...f?{suggestion:f}:{}},node:n}}case"valid":break}let a=VM(t,i);if(!a)return;let l=cy(a.prop);if(l===s.id)return;let c=Qe(t)?"item":Ce(t)?"group":"parallel";return{severity:"error",code:"NL.E1102",args:{entity:xA(c,t),wave:s.id,container:xA(Ce(a.container)?"group":"parallel",a.container),containerWave:l},node:n}}function id(e){let t=nn(e),n=t.length>0,r=FM(e),i=Es(e),o=[];for(let s of zM(e)){let a=EA(s);if(a.length===0)continue;if(!n){for(let m of a)o.push({severity:"warning",code:"NL.W0702",args:{target:YM(s)},node:m,property:"key"});continue}if(nt(s)){for(let m of a)o.push({severity:"error",message:td("wave",s.entityType),node:m});continue}let l=s,c=Re(l);if(!l.name&&l.title===void 0&&!Qe(s)&&!Ce(s)&&!et(s))continue;if(Ye(s)||hn(s)){for(let m of a)o.push({severity:"error",code:"NL.E1104",args:{reason:Ye(s)?"swimlane":"milestone",name:c,value:cy(m)},node:m});continue}if(!Qe(s)&&!Ce(s)&&!et(s)){for(let m of a)o.push({severity:"error",code:"NL.E1104",args:{reason:"other",type:El(s),name:c},node:m});continue}let[f,...d]=a,p=KM(e,s,f,t,r,i);if(p&&o.push(p),d.length>0){let m=a.flatMap(g=>g.value!==void 0?[g.value]:g.values);for(let g of d)o.push({severity:"error",code:"NL.E1101",args:{reason:"list",value:`[${m.join(", ")}]`},node:g})}}return o}var qM=["after-wave","after-item","sequence","join"];function Pi(e){return e.name??(e.title===void 0?void 0:At(e.title))}function od(e){let t=Pi(e);if(Ye(e))return{kind:"swimlane",name:Re(e)};let n=Ce(e);return t?{kind:n?"group":"parallel",name:t}:{kind:n?"group-block":"parallel-block",line:xn(e)}}function kA(e){let t=Pi(e);return t!==void 0||e.$type==="ItemDeclaration"?t:{kind:Ce(e)?"group-block":"parallel-block",line:xn(e)}}function AA(e){return e.$type==="ItemDeclaration"||Pi(e)!==void 0?{name:Re(e)}:{name:"",kind:Ce(e)?"group":"parallel",line:xn(e)}}function ZM(e){let t=Ce(e)?"group":"parallel",n=Pi(e);return n?{kind:t,name:n}:{kind:t,name:"",line:xn(e)}}function fy(e){return(e.value!==void 0?[e.value]:e.values).filter(t=>!!t)}function JM(e){return hn(e)&&!e.properties.some(t=>q(t)==="date")}function QM(e){return e.$type!=="ItemDeclaration"?!1:e.properties.some(t=>{let n=q(t);return(n==="date"||n==="start")&&!!t.value&&st.test(t.value)})}function Ts(e,t,n={}){if(t.length===0)return[];let r=new Map;t.forEach((k,$)=>{k.name&&r.set(k.name,$+1)});let i=k=>t[k-1]?.name??"",{lanes:o,lookup:s}=e,{waveOf:a,leadOf:l}=nd(o,r),c=[],u=new Map,f=0,d=(k,$,W,G)=>{let J=c.length,Z={node:k,lane:$,parent:W,children:[],prev:G,start:f++,reg:-1,ew:a.get(k),lw:l.get(k),pinned:QM(k),after:[],afterWaves:[]};if(c.push(Z),Ce(k)||et(k)){let Q=-1;for(let oe of Mt(k))Q=d(oe,$,J,Ce(k)?Q:-1),Z.children.push(Q);Z.reg=f++}else Z.reg=Z.start;if(k.name){let Q=u.get(k.name)??[];Q.push(J),u.set(k.name,Q)}return J};o.forEach((k,$)=>{let W=-1;for(let G of Mt(k))W=d(G,$,-1,W)});let p=(k,$)=>{let W=u.get(k);if(W){for(let G=W.length-1;G>=0;G--)if(c[W[G]].reg<c[$].start)return W[G]}},m=[],g=n.suppressCycleRefs??!0?tF(c,o,s):()=>!1;for(let k=0;k<c.length;k++){let $=c[k],W=AA($.node);for(let G of $.node.properties){let J=q(G);if(!(J!=="after"&&J!=="before"))for(let Z of fy(G)){if(st.test(Z))continue;let Q=p(Z,k),oe=Q===void 0?r.get(Z):void 0;if(J==="after"&&!$.pinned&&(Q!==void 0?$.after.push({from:Q,prop:G,ref:Z}):oe!==void 0&&$.afterWaves.push({prop:G,ref:Z,j:oe})),Q!==void 0||oe!==void 0)continue;let me=u.get(Z)?.[0];if(me===void 0&&!JM(s(Z))||g($.node.name,J,Z))continue;let ce=!1;for(let ue=$.parent;ue>=0&&!ce;ue=c[ue].parent)ce=c[ue].node.name===Z;m.push({severity:"warning",code:"NL.W1101",args:me===void 0?{reason:"floating-milestone",key:J,ref:Z,...W}:ce?{reason:"ancestor",key:J,ref:Z,...W}:c[me].lane!==$.lane?{reason:"forward-lane",key:J,ref:Z,...W,lane:Re(o[c[me].lane]),ownLane:Re(o[$.lane])}:{reason:"forward-flow",key:J,ref:Z,...W,flow:od(eF(c,o,k,me))},node:G})}}}let w=new Array(c.length),x=new Array(c.length);for(let k=c.length-1;k>=0;k--){let $=c[k];if($.node.$type==="ItemDeclaration"){w[k]=$.ew,x[k]=$.ew;continue}for(let W of $.children){let G=w[W],J=x[W];G!==void 0&&(w[k]=Math.max(w[k]??G,G)),J!==void 0&&(x[k]=Math.min(x[k]??J,J))}}for(let k=0;k<c.length;k++){let $=w[k];if($===void 0)continue;let W=AA(c[k].node);for(let G of c[k].node.properties)if(q(G)==="before")for(let J of fy(G)){if(st.test(J))continue;let Z=p(J,k);if(Z!==void 0){let oe=x[Z];if(oe===void 0||$<=oe)continue;m.push({severity:"warning",code:"NL.W1100",args:{reason:"item",ref:J,...W,wave:i($),refWave:i(oe)},node:G});continue}let Q=r.get(J);Q===void 0||$<Q||m.push({severity:"warning",code:"NL.W1100",args:{reason:"wave",ref:J,...W,wave:i($)},node:G})}}let y=k=>c[k].node.$type!=="ItemDeclaration",E=k=>{let{parent:$,pinned:W}=c[k];return W||$<0?!1:et(c[$].node)||c[$].children[0]===k},T=new Array(c.length).fill(0),_=new Array(c.length).fill(0),P=k=>{let $=c[k],W=[];$.lw!==void 0&&W.push({term:{kind:$.ew!==void 0?"wave":"lead"},value:$.lw-1});for(let G of $.afterWaves)W.push({term:{kind:"after-wave",prop:G.prop,ref:G.ref},value:G.j});E(k)&&W.push({term:{kind:"parent",from:$.parent},value:T[$.parent]}),!$.pinned&&$.prev>=0&&W.push({term:{kind:"seq",from:$.prev},value:_[$.prev]});for(let G of $.after)W.push({term:{kind:"after",from:G.from,prop:G.prop,ref:G.ref},value:_[G.from]});return W},U=k=>{let $=T[k];for(let W of c[k].children)$=Math.max($,_[W]);return $},O=c.map((k,$)=>[2*$+1]),D=c.map(()=>[]);for(let k=0;k<c.length;k++){let $=c[k];E(k)&&O[$.parent].push(2*k),$.prev>=0&&D[$.prev].push(2*k);for(let W of $.after)D[W.from].push(2*k);$.parent>=0&&D[k].push(2*$.parent+1)}let Y=[],L=new Array(2*c.length).fill(!0);for(let k=0;k<c.length;k++)Y.push(2*k,2*k+1);for(let k=0;k<Y.length;k++){let $=Y[k];L[$]=!1;let W=$>>1,G=($&1)===1,J=G?U(W):Math.max(0,...P(W).map(Z=>Z.value));if(!(J<=(G?_[W]:T[W]))){G?_[W]=J:T[W]=J;for(let Z of G?D[W]:O[W])L[Z]||(L[Z]=!0,Y.push(Z))}}let S=(k,$)=>P(k).filter(W=>W.value===$).map(W=>W.term),R=(k,$)=>{if(!y(k))return[{kind:"start"}];let W=c[k].children.filter(G=>_[G]===$).map(G=>({kind:"child",from:G}));return W.length>0?Ce(c[k].node)?W.reverse():W:T[k]===$?[{kind:"start"}]:[]},C=(k,$)=>{let W=[{i:k,via:k}];for(;W.length>0;){let{i:G,via:J}=W.pop(),Z=R(G,$);for(let Q=Z.length-1;Q>=0;Q--){let oe=Z[Q];if(oe.kind==="start"){let me=c[G].ew;if(me!==void 0&&me-1===$)return{origin:G,via:J}}else oe.kind==="child"&&W.push({i:oe.from,via:G===k?oe.from:J})}}},v=(k,$)=>{let W=c[k].ew;return W!==void 0&&W-1===$},b=(k,$)=>{for(let W=k;!c[W].pinned;){let G=c[W].prev;if(G<0){if(!E(W))return;W=c[W].parent;continue}let J=c[G].ew;if(J!==void 0&&J>$)return G;W=G}},A=new Map,M=[],N=new Map,F=(k,$,W)=>`${k}:${c[k].node.properties.indexOf($)}:${W}`,z=(k,$)=>{let W=[],G=k;for(;;){let J=S(G,$);for(let Q of J)if(Q.kind==="after-wave")W.push({variant:"after-wave",owner:G,prop:Q.prop,ref:Q.ref});else if(Q.kind==="after")v(Q.from,$)&&W.push({variant:"after-item",owner:G,prop:Q.prop,ref:Q.ref});else if(Q.kind==="seq"){let oe=Q.from,me=c[oe].node;if(et(me)&&c[oe].ew===void 0){let ce=C(oe,$),ue=ce&&(Pi(c[ce.via].node)??Pi(c[ce.origin].node));ue&&W.push({variant:"join",owner:G,block:oe,track:ue})}else if(v(oe,$)){let ce=kA(me);ce&&W.push({variant:"sequence",owner:G,pred:oe,ref:ce})}}let Z=J.find(Q=>Q.kind==="parent");if(!Z)break;G=Z.from}for(let J of qM){let Z=W.find(Q=>Q.variant===J);if(Z)return Z}},X=(k,$)=>{let W=[{key:2*k,from:-1}],G=new Set([2*k]),J,Z=(Q,oe)=>{G.has(Q)||(G.add(Q),W.push({key:Q,from:oe}))};for(let Q=0;Q<W.length;Q++){let oe=W[Q].key>>1;if(oe!==k&&A.has(oe)){J??(J=oe);continue}if((W[Q].key&1)===1){for(let ue of R(oe,$))ue.kind==="start"?Z(2*oe,Q):ue.kind==="child"&&Z(2*ue.from+1,Q);continue}let me=S(oe,$),ce=me.find(ue=>ue.kind==="wave"||ue.kind==="lead")??me.find(ue=>ue.kind==="after-wave");if(ce){let ue=[];for(let gt=Q;gt>=0;gt=W[gt].from){let Pt=W[gt].key>>1;ue[ue.length-1]!==Pt&&ue.push(Pt)}let rt=Re(c[oe].node);return{path:ue,origin:ce.kind==="after-wave"?`${rt} (after:${ce.ref})`:`${rt} (wave "${i($+1)}")`}}for(let ue of me)ue.kind==="parent"?Z(2*ue.from,Q):(ue.kind==="seq"||ue.kind==="after")&&Z(2*ue.from+1,Q)}return{hit:J}},ne=(k,$,W,G)=>{let J=Re(c[$].node),Z=i(W),Q=i(G+1),oe=c[k.owner].node,me=k.owner===$?void 0:ZM(oe);switch(k.variant){case"after-wave":{let ce=c[k.owner].ew===void 0?void 0:me;return{node:k.prop,run:[$],build:()=>({reason:"after-wave",name:J,wave:Z,refId:k.ref,...ce?{container:ce}:{}})}}case"after-item":return{node:k.prop,run:[$],build:()=>({reason:"after-item",name:J,wave:Z,refId:k.ref,ref:k.ref,refWave:Q,...me?{container:me}:{}})};case"join":{let ce=c[k.block];return{node:c[$].node,run:[$],build:()=>({reason:"join",name:J,wave:Z,block:od(ce.node),flow:od(IA(c,o,k.block)),track:k.track,trackWave:Q})}}case"sequence":{let ce=k.pred,ue=c[ce].parent,rt=gt=>{if(ue<0)return c[gt].lane===c[ce].lane;for(let Pt=c[gt].parent;Pt>=0;Pt=c[Pt].parent)if(Pt===ue)return!0;return!1};return{node:c[$].node,run:[$],build:gt=>{let Pt=gt.filter(rt);return{reason:"sequence",items:Pt.map(yt=>Re(c[yt].node)),itemWave:Z,ref:k.ref,refWave:i(c[ce].ew??G+1),flow:od(IA(c,o,ce)),last:Re(c[Pt[Pt.length-1]].node)}},seq:{pred:ce,ref:k.ref,inFlow:rt}}}}},H=(k,$)=>(M.push($),k!==void 0&&N.set(k,$),$),te=(k,$,W,G)=>{let J=k.variant==="sequence"?`sequence:${k.pred}:${W}`:k.variant==="join"?`join:${k.block}:${W}`:`${k.variant}:${F(k.owner,k.prop,k.ref)}`,Z=N.get(J);return Z?(Z.run.push($),Z):H(J,ne(k,$,W,G))};for(let k=0;k<c.length;k++){let $=c[k],W=$.ew;if($.node.$type!=="ItemDeclaration"||W===void 0||T[k]<W)continue;let G=T[k],J=z(k,G),Z;if(J)Z=te(J,k,W,G);else{let Q=X(k,G);if("path"in Q){let oe=Q.path.slice(1).filter(rt=>!y(rt)||Pi(c[rt].node)!==void 0).map(rt=>Re(c[rt].node)),me=[Q.origin,...oe.filter((rt,gt)=>oe[gt-1]!==rt)],ce=Re($.node),ue=i(W);Z=H(void 0,{node:$.node,run:[k],build:()=>({reason:"chain",name:ce,wave:ue,chain:me})})}else{let oe=Q.hit===void 0?void 0:A.get(Q.hit),me=oe?.seq;if(me?.inFlow(k)){let ce=b(k,W),ue=ce===void 0?void 0:kA(c[ce].node),rt=ce!==void 0&&ue!==void 0?{variant:"sequence",owner:k,pred:ce,ref:ue}:{variant:"sequence",owner:k,pred:me.pred,ref:me.ref};Z=te(rt,k,W,G)}else Z=oe,Z?.run.push(k)}}Z&&A.set(k,Z)}for(let k of M)m.push({severity:"error",code:"NL.E1103",args:k.build(k.run),node:k.node});return m}function IA(e,t,n){let r=e[n].parent;return r<0?t[e[n].lane]:e[r].node}function eF(e,t,n,r){let i=new Set;for(let o=e[r].parent;o>=0;o=e[o].parent)i.add(o);for(let o=e[n].parent;o>=0;o=e[o].parent)if(i.has(o))return e[o].node;return t[e[n].lane]}function tF(e,t,n){let r=new Map,i=(c,u)=>{let f=r.get(c)??new Set;f.add(u),r.set(c,f)},o=[],s=(c,u)=>{if(c)for(let f of u){let d=q(f);if(!(d!=="after"&&d!=="before"))for(let p of fy(f))st.test(p)||(d==="after"?i(c,p):i(p,c),o.push(p))}};for(let c of t)s(c.name,c.properties);for(let c of e)s(c.node.name,c.node.properties);let a=new Set;for(;o.length>0;){let c=o.pop();if(a.has(c))continue;a.add(c);let u=n(c);hn(u)&&s(u.name,u.properties)}let l=(c,u)=>{let f=new Set([c]),d=[c];for(;d.length>0;){let p=d.pop();if(p===u)return!0;for(let m of r.get(p)??[])f.has(m)||(f.add(m),d.push(m))}return!1};return(c,u,f)=>c?u==="after"?l(f,c):l(c,f):!1}function vs(e){return t=>e.anchors.get(t)??e.milestones.get(t)??e.waves?.get(t)}function nF(e){let t=e.$document?.parseResult;return!!t&&(t.lexerErrors.length>0||t.parserErrors.length>0)}function bA(e,t,n){return n||nF(e)?!1:!!e.roadmapDecl||t.swimlanes.size>0||nn(e).length>0}function Li(e,t,n,r,...i){return{severity:e,message:jn("en-US",r,...i),sourcePath:t,...n===void 0?{}:{line:n},code:r,args:i,rule:"wave"}}function sd(e){return e.map(t=>t.name)}function RA(e){let t=n=>{let r=e.properties.find(i=>q(i)===n);return r?r.value??r.values.join(", "):""};return{title:e.title===void 0?"":At(e.title),style:t("style"),labels:t("labels"),link:t("link"),description:e.description?At(e.description.text):""}}var rF=["title","style","labels","link","description"];function SA(e,t,n){let r={diagnostics:[],failed:!1};if(n.mode==="ignore"||!n.participates||n.childFile.roadmapEntries.some(p=>_t(p)&&!p.name))return r;let i=n.parentAbs,o=n.inc.$cstNode?.range.start.line,s=n.childRelPath,a=nn(e),l=nn(n.childFile),c=p=>({diagnostics:[p],failed:!0});if(a.length===0&&l.length===0)return r;if(l.length===0)return c(Li("error",i,o,"NL.E0202",{reason:"child-none",path:s,parent:sd(a)}));if(a.length===0)return c(Li("error",i,o,"NL.E0202",{reason:"parent-none",path:s,child:sd(l)}));if(a.length!==l.length||a.some((p,m)=>p.name!==l[m].name))return c(Li("error",i,o,"NL.E0202",{reason:"mismatch",path:s,child:sd(l),parent:sd(a)}));let u=vs(t),f=vs(n.childContent);for(let p=0;p<a.length;p++){let m=wl(a[p],u)?.date??null,g=wl(l[p],f)?.date??null;if(m!==g)return c(Li("error",i,o,"NL.E0202",{reason:"floor",id:a[p].name,path:s,childFloor:g,parentFloor:m}))}let d=[];for(let p=0;p<a.length;p++){let m=RA(a[p]),g=RA(l[p]),w=rF.filter(x=>m[x]!==g[x]).map(x=>({field:x,there:g[x],here:m[x]}));w.length!==0&&d.push(Li("warning",i,o,"NL.W0701",{id:a[p].name,path:s,fields:w}))}return{diagnostics:d,failed:!1}}function iF(e){let t=e;for(;t&&!rs(t);)t=t.$container;return t}function NA(e){let{rootFile:t,rootAbs:n,rootContent:r,files:i,edges:o,failed:s}=e,a=[],l=new Set,c=_=>{let P=JSON.stringify([_.sourcePath,_.line,_.code,_.args,_.message]);l.has(P)||(l.add(P),a.push(_))},u=_=>{let P=iF(_);return P?i.get(P):void 0},f=(_,P)=>{let U=_.node.$cstNode?.range.start.line;return"message"in _?{severity:_.severity,message:_.message,sourcePath:P,...U===void 0?{}:{line:U},rule:"wave"}:Li(_.severity,P,U,_.code,_.args)},d=[],p=new Set([n]),m=_=>{for(let P of o.get(_)??[])P.mode==="ignore"||!P.participates||p.has(P.childAbs)||(p.add(P.childAbs),s.has(P.childAbs)||d.push({file:P.childFile,abs:P.childAbs}),m(P.childAbs))};m(n);let g=nn(t),w=new Map(g.map(_=>[_.name,_]));for(let{file:_,abs:P}of d){for(let O of rd(_))c(f(O,P));for(let O of id(_))c(f(O,P));if(w.size===0)continue;let U=(O,D)=>{let Y=O===void 0?void 0:w.get(O);if(!Y||_t(D))return;let L=Y.$cstNode?Y.$cstNode.range.start.line+1:0;c(Li("error",P,D.$cstNode?.range.start.line,"NL.E0300",{name:O,location:`${xs(n)}:${L}`}))};_.roadmapDecl&&U(_.roadmapDecl.name,_.roadmapDecl);for(let O of _.roadmapEntries)kf(O,U);for(let O of _.configEntries)Dt(O)&&U(O.name,O)}if(g.length===0)return a;let x=_=>"message"in _?_.message:`${_.code}\0${JSON.stringify(_.args)}`,y=new Map,E={lanes:t.roadmapEntries.filter(Ye),lookup:Es(t)};for(let _ of Ts(E,g,{suppressCycleRefs:!1})){let P=y.get(_.node)??new Set;P.add(x(_)),y.set(_.node,P)}let T=_=>{for(let P of _){if(y.get(P.node)?.has(x(P)))continue;let U=u(P.node);U===void 0||s.has(U)||c(f(P,U))}};T(Ts({lanes:[...r.swimlanes.values()],lookup:vs(r)},g,{suppressCycleRefs:!1}));for(let _ of r.isolatedRegions){let P=_.content.roadmap?u(_.content.roadmap):void 0;if(P!==void 0&&s.has(P))continue;let U=[..._.content.waves?.values()??[]];U.length!==0&&T(Ts({lanes:[..._.content.swimlanes.values()],lookup:vs(_.content)},U,{suppressCycleRefs:!1}))}return a}function $A(e){let t=e?.properties.find(n=>n.key==="start");if(!(!t?.value||!ze(t.value)))return t.value}function sF(e,t,n){return t&&n?`Included "${e}" declares start:${n}, which doesn't match this file's start:${t}. Both files must declare the same start date, or neither should.`:t?`Included "${e}" has no start:, but this file declares start:${t}. Both files must declare the same start date, or neither should.`:`Included "${e}" declares start:${n}, but this file has no start:. Both files must declare the same start date, or neither should.`}function Fr(e){return e.code!==void 0||e.rule==="wave"}function OA(){return{styles:new Map,defaults:new Map,symbols:new Map,calendarDeclarations:[]}}function CA(){return{persons:new Map,teams:new Map,anchors:new Map,labels:new Map,sizes:new Map,statuses:new Map,swimlanes:new Map,milestones:new Map,footnotes:new Map,isolatedRegions:[]}}async function py(e,t,n){let r=n.readFile??(async l=>{let{nodeReadFile:c}=await Promise.resolve().then(()=>(LA(),PA));return c(l)}),i={services:n.services,diagnostics:[],resolving:[],processed:new Map,readFile:r,files:new Map,edges:new Map,stubs:new Set,failedWaves:new Set},o=ly("",t),{config:s,content:a}=await FA(e,o,i);return i.diagnostics.push(...NA({rootFile:e,rootAbs:o,rootContent:a,files:i.files,edges:i.edges,failed:i.failedWaves})),{config:s,content:a,diagnostics:i.diagnostics,processedFiles:new Set(i.processed.keys())}}async function FA(e,t,n){if(n.processed.has(t))return n.processed.get(t);if(n.resolving.includes(t)){n.diagnostics.push({severity:"error",message:`Circular include detected: ${[...n.resolving,t].join(" \u2192 ")}`,sourcePath:t});let c={config:OA(),content:CA()};return n.stubs.add(c.content),n.processed.set(t,c),c}n.resolving.push(t),n.files.set(e,t);let r=OA(),i=CA();dF(r,e),gF(i,e);let o=nn(e);o.length>0&&(i.waves=new Map(o.map(c=>[c.name,c])));let s=[];n.edges.set(t,s);let a=new Set;for(let c of e.includes){let u=c.path,f=ly(hA(t),u);if(a.has(f)){n.diagnostics.push({severity:"error",message:`Duplicate include "${u}" in ${xs(t)}.`,sourcePath:t,line:c.$cstNode?.range.start.line});continue}a.add(f);let d=DA(c,"config")??"merge",p=DA(c,"roadmap")??"merge",m;try{let x=await n.readFile(f);m=await aF(n.services,x,f)}catch(x){n.diagnostics.push({severity:"error",message:`Could not read include "${u}": ${x.message}`,sourcePath:t,line:c.$cstNode?.range.start.line});continue}let{config:g,content:w}=await FA(m,f,n);if(s.push({parentAbs:t,inc:c,childRelPath:u,childAbs:f,mode:p,childFile:m,childContent:w,participates:bA(m,w,n.stubs.has(w))}),lF(r,g,d,f,n.diagnostics),cF(i,w,g,p,f,u,n.diagnostics),p==="isolate"&&!w.roadmap&&n.diagnostics.push({severity:"error",message:`Cannot isolate "${u}": it has no roadmap declaration.`,sourcePath:t,line:c.$cstNode?.range.start.line}),p!=="ignore"&&m.roadmapDecl){let x=$A(e.roadmapDecl),y=$A(m.roadmapDecl);x!==y&&n.diagnostics.push({severity:"error",message:sF(u,x,y),sourcePath:t,line:c.$cstNode?.range.start.line})}}i.waves&&mF(i,i.waves);for(let c of s){let{diagnostics:u,failed:f}=SA(e,i,c);n.diagnostics.push(...u),f&&n.failedWaves.add(c.childAbs)}n.resolving.pop();let l={config:r,content:i};return n.processed.set(t,l),l}function DA(e,t){let n=e.options.find(r=>r.key===t);if(n&&(n.value==="merge"||n.value==="ignore"||n.value==="isolate"))return n.value}async function aF(e,t,n){let r=Oe.file(n),o=e.shared.workspace.LangiumDocumentFactory.fromString(t,r);return await e.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function lF(e,t,n,r,i){if(n==="ignore"||n==="isolate")return;let o=(s,a)=>i.push({severity:"warning",message:`${a} "${s}" from ${xs(r)} is shadowed by the parent's definition.`,sourcePath:r});dy(e.styles,t.styles,s=>o(s,"Style")),dy(e.defaults,t.defaults,s=>o(s,"Default")),dy(e.symbols,t.symbols,s=>o(s,"Symbol")),uF(e.calendarDeclarations,t.calendarDeclarations,s=>o(s.name,fF(s))),t.scale&&!e.scale&&(e.scale=t.scale),t.calendar&&!e.calendar&&(e.calendar=t.calendar)}function cF(e,t,n,r,i,o,s){if(r==="ignore")return;if(r==="isolate"){t.roadmap&&e.isolatedRegions.push({sourcePath:o,config:n,content:t});return}let a=(l,c)=>s.push({severity:"warning",message:`${c} "${l}" from ${xs(i)} is shadowed by the parent's definition.`,sourcePath:i});Vn(e.persons,t.persons,l=>a(l,"Person")),Vn(e.teams,t.teams,l=>a(l,"Team")),Vn(e.anchors,t.anchors,l=>a(l,"Anchor")),Vn(e.labels,t.labels,l=>a(l,"Label")),Vn(e.sizes,t.sizes,l=>a(l,"Size")),Vn(e.statuses,t.statuses,l=>a(l,"Status")),Vn(e.swimlanes,t.swimlanes,l=>a(l,"Swimlane")),Vn(e.milestones,t.milestones,l=>a(l,"Milestone")),Vn(e.footnotes,t.footnotes,l=>a(l,"Footnote")),t.roadmap&&!e.roadmap&&(e.roadmap=t.roadmap)}function dy(e,t,n){for(let[r,i]of t){if(e.has(r)){e.get(r)!==i&&n(r);continue}e.set(r,i)}}function uF(e,t,n){let r=new Set(e),i=new Set(e.filter(o=>o.name).map(MA));for(let o of t)if(!r.has(o)){if(o.name&&i.has(MA(o))){n(o);continue}e.push(o),r.add(o)}}function MA(e){return`${e.$type}:${e.name}`}function fF(e){return $r(e)?"Non-working":"Working"}function Vn(e,t,n){let r=new Set(e.values());for(let[i,o]of t)if(!r.has(o)){if(!o.name&&o.title){e.set(hy(e,BA(o.title)),o);continue}if(e.has(i)){n(i);continue}e.set(i,o)}}function dF(e,t){for(let n of t.configEntries)pF(e,n)}function pF(e,t){H0(t)?e.scale||(e.scale=t):Ma(t)?e.calendar||(e.calendar=t):Dt(t)?t.name&&!e.styles.has(t.name)&&e.styles.set(t.name,t):xi(t)?t.name&&!e.symbols.has(t.name)&&e.symbols.set(t.name,t):nt(t)?e.defaults.has(t.entityType)||e.defaults.set(t.entityType,t):($r(t)||Xa(t))&&e.calendarDeclarations.push(t)}function hF(e){let t={swimlanes:new Set,persons:new Set,teams:new Set,anchors:new Set,labels:new Set,sizes:new Set,statuses:new Set,milestones:new Set,footnotes:new Set};for(let n of e){let r=n.name;if(r){if(Ye(n))t.swimlanes.add(r);else if(Ua(n))t.persons.add(r);else if(Dn(n))t.teams.add(r);else if(ns(n))t.anchors.add(r);else if(Ba(n))t.labels.add(r);else if(yi(n))t.sizes.add(r);else if(Wa(n))t.statuses.add(r);else if(hn(n))t.milestones.add(r);else if(rg(n))t.footnotes.add(r);else if(_t(n))for(let i of Object.values(t))i.add(r)}}return t}function mF(e,t){let n=[e.persons,e.teams,e.anchors,e.labels,e.sizes,e.statuses,e.swimlanes,e.milestones,e.footnotes],r=(i,o)=>t.has(i)&&!o.name&&!!o.title;for(let i of n){let o=[...i];if(!o.some(([a,l])=>r(a,l)))continue;let s=new Set([...i.keys(),...t.keys()]);i.clear();for(let[a,l]of o){let c=r(a,l)?hy(i,a,s):a;s.add(c),i.set(c,l)}}}function gF(e,t){t.roadmapDecl&&!e.roadmap&&(e.roadmap=t.roadmapDecl);let n=hF(t.roadmapEntries);for(let r of t.roadmapEntries)yF(e,r,n)}function BA(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"entity"}function hy(e,t,n){let r=o=>e.has(o)||(n?.has(o)??!1);if(!r(t))return t;let i=2;for(;r(`${t}-${i}`);)i++;return`${t}-${i}`}function Yn(e,t,n){t.name?e.has(t.name)||e.set(t.name,t):t.title&&e.set(hy(e,BA(t.title),n),t)}function yF(e,t,n){Ye(t)?Yn(e.swimlanes,t,n.swimlanes):Ua(t)?Yn(e.persons,t,n.persons):Dn(t)?Yn(e.teams,t,n.teams):ns(t)?Yn(e.anchors,t,n.anchors):Ba(t)?Yn(e.labels,t,n.labels):yi(t)?Yn(e.sizes,t,n.sizes):Wa(t)?Yn(e.statuses,t,n.statuses):hn(t)?Yn(e.milestones,t,n.milestones):rg(t)&&Yn(e.footnotes,t,n.footnotes)}function Tl(e){let t=e?.roadmapDecl?.properties.find(r=>q(r)==="start");if(!t)return{kind:"missing"};let n=t.value;return!n||!ze(n)?{kind:"invalid"}:{kind:"valid",iso:n,date:new Date(n)}}function K(e,t,n,r,...i){e(t,jn("en-US",r,...i),{...n,data:{code:r,args:i}})}function ad(e,t){let n={node:t.node,...t.property===void 0?{}:{property:t.property}};if("message"in t){e(t.severity,t.message,n);return}K(e,t.severity,n,t.code,t.args)}function $i(e){let t=e.$cstNode;return t?`line ${t.range.start.line+1}`:"unknown location"}function ld(e){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e)}var my="v1",cd=new Set(Rf),UA=new Set(Ei),gy=new Set(za),vl=new Set(["bg","fg","text","border","icon","shadow","font","weight","italic","text-size","padding","spacing","header-height","corner-radius","bracket","header-position","capacity-icon","timeline-position","minor-grid","non-working"]),WA=new Set(ek),XA=new Set(["header-height","header-position","timeline-position","minor-grid","non-working"]),ud="none",_l={border:new Set(["solid","dashed","dotted"]),shadow:new Set(["none","subtle","soft","hard"]),font:new Set(["sans","serif","mono"]),weight:new Set(["thin","light","normal","bold"]),italic:new Set(["true","false"]),"text-size":new Set(["none","xs","sm","md","lg","xl"]),padding:new Set(["none","xs","sm","md","lg","xl"]),spacing:new Set(["none","xs","sm","md","lg","xl"]),"header-height":new Set(["none","xs","sm","md","lg","xl"]),"corner-radius":new Set(["none","xs","sm","md","lg","xl","full"]),bracket:new Set(["none","solid","dashed"]),"header-position":new Set(["beside","above"]),"timeline-position":new Set(["top","bottom","both"]),"minor-grid":new Set(["true","false"])},GA=new Set(["red","blue","yellow","green","orange","purple","violet","gray","grey","navy","white","none"]),zA=new Set(["business","full","custom"]),fd=new Set(["days-per-week","days-per-month","days-per-quarter","days-per-year"]),yy=new Set(["name","label-every","label"]),xy=new Set(["item","label","swimlane","roadmap","milestone","footnote","anchor","parallel","group"]),HA={item:new Set(["size","duration","after","before","remaining","link","description","owner"]),milestone:new Set(["date","after","link","description"]),anchor:new Set(["date","link","description"]),footnote:new Set(["on","link","description"]),label:new Set(["link","description"]),swimlane:new Set(["capacity"]),roadmap:new Set,parallel:new Set,group:new Set},Ey=new Set(["labels","link","style","description"]),jA={RoadmapDeclaration:new Set(["author","start","length","scale","calendar","logo","logo-size"]),AnchorDeclaration:new Set(["date"]),SwimlaneDeclaration:new Set(["owner","capacity","utilization-warn-at","utilization-over-at","status","after","before"]),ItemDeclaration:new Set(["size","duration","status","owner","after","before","remaining","capacity","date","start"]),ParallelBlock:new Set(["owner","after","before","status"]),GroupBlock:new Set(["owner","after","before","status"]),MilestoneDeclaration:new Set(["date","after"]),FootnoteDeclaration:new Set(["on"]),PersonDeclaration:new Set,TeamDeclaration:new Set,LabelDeclaration:new Set,SizeDeclaration:new Set(["effort"]),StatusDeclaration:new Set,WaveDeclaration:new Set(["after"])},xF=[{keys:new Set(["progress","percent","percentage","pct","complete","completion"]),requires:"remaining",suggest:"status: + remaining:"}];function VA(e,t){let n=e.toLowerCase();for(let r of xF)if(r.keys.has(n)&&t.has(r.requires))return r.suggest}var Oi=/^\d+(?:\.\d+)?[dwmqy]$/,YA=/^\d+%$/,KA=/^#[0-9a-fA-F]{3,8}$/,qA=/^v\d+$/,wy=/^\d+$/,ZA=/^[dwmqy]$/,Ty=/^\d+(\.\d+)?$/,kl=/^\d+(\.\d+)?%$/,dd=/^\d+\.\d+$/,JA=/^\d+$/,QA=/^[\x20-\x7E]{1,3}$/,eI=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\d{3})?$/,tI=new Set(["merge","ignore","isolate"]),vy=new Set(["locale"]);function rI(e,t){let n=e.configEntries.filter(Ma),i=e.roadmapDecl?.properties.find(o=>q(o)==="calendar")?.value;if(n.length>0&&i!=="custom")for(let o of n)t("error",'A "calendar" config block is only valid when the roadmap declares calendar:custom.',{node:o});if(i==="custom"&&n.length===0&&t("error",'calendar:custom requires a "calendar" config block with days-per-week, days-per-month, days-per-quarter, and days-per-year.',{node:e.roadmapDecl,property:"properties"}),i==="custom"&&n.length>0)for(let o of n){let s=new Set(o.properties.map(a=>q(a)));for(let a of fd)s.has(a)||t("error",`calendar:custom requires "${a}" in the calendar config block.`,{node:o})}}function iI(e,t){let n=new Set;for(let r of e.properties){let i=q(r);if(!fd.has(i)){t("error",`Unknown calendar property "${i}". Allowed: ${[...fd].join(", ")}.`,{node:r,property:"key"});continue}n.has(i)&&t("error",`Duplicate calendar property "${i}".`,{node:r,property:"key"}),n.add(i),(!wy.test(r.value)||parseInt(r.value,10)<=0)&&t("error",`"${i}" must be a positive integer, got "${r.value}".`,{node:r,property:"value"})}}function oI(e,t){let n=new Set;for(let r of e.properties){let i=q(r);if(!yy.has(i)){t("error",`Unknown scale property "${i}". Allowed: ${[...yy].join(", ")}.`,{node:r,property:"key"});continue}n.has(i)&&t("error",`Duplicate scale property "${i}".`,{node:r,property:"key"}),n.add(i),i==="label-every"&&(!wy.test(r.value)||parseInt(r.value,10)<=0)&&t("error",`"label-every" must be a positive integer, got "${r.value}".`,{node:r,property:"value"})}}function sI(e,t){let n=Mr(e),r=Ga(e),{own:i}=r;for(let c of e.properties)cg.has(q(c))||K(t,"error",{node:c,property:"key"},"NL.E0901",{kind:n,key:q(c)});r.shape==="malformed"&&K(t,"error",{node:e},"NL.E0900",{kind:n});let o=i.get("date");o&&o.values.length>0&&o.values.forEach((c,u)=>{ze(c)||K(t,"error",{node:o,property:"values",index:u},"NL.E0405",{key:"date",value:c})});for(let c of["start","end"]){let u=i.get(c);u&&u.values.length>1?K(t,"error",{node:u},"NL.E0902",{kind:n,key:c}):u&&u.values.length===1&&!ze(u.values[0])&&K(t,"error",{node:u,property:"values",index:0},"NL.E0405",{key:c,value:u.values[0]})}let{start:s,end:a}=r;s&&a&&a<s&&K(t,"error",{node:i.get("end"),property:"value"},"NL.E0903",{start:s,end:a});let l=i.get("every");if(l){let c=new Set;(l.value!==void 0?[l.value]:l.values).forEach((f,d)=>{let p=l.values.length>0?{node:l,property:"values",index:d}:{node:l,property:"value"};lg(f)?c.has(f)&&K(t,"error",p,"NL.E0905",{value:f}):K(t,"error",p,"NL.E0904",{value:f}),c.add(f)})}}function aI(e,t){let n=e.roadmapDecl;if(!n)return;let r=e.configEntries.filter(cI),i=r.map(y=>({decl:y,facts:Ga(y)})).filter(({facts:y})=>y.wellFormed),o=y=>y.weekdays??[],s=i.filter(({facts:y})=>y.shape==="open-recurrence"),a=n.properties.find(y=>q(y)==="calendar"),l=e.configEntries.find(Ma),c=a?.value==="custom"&&l!==void 0,u=a?.value==="full",f=c?l.properties.find(y=>q(y)==="days-per-week"):void 0,d=parseInt(f?.value??"",10),p=c?Number.isFinite(d)&&d>0?d:nI:u?7:nI,m=Af(r),g=new Set(!c&&!u&&!m?[0,6]:[]);for(let{decl:y,facts:E}of s)if($r(y))for(let T of o(E))g.add(T);for(let{decl:y,facts:E}of s)if(Xa(y))for(let T of o(E))g.delete(T);if(g.size===7)for(let{decl:y}of s)$r(y)&&K(t,"error",{node:y},"NL.E0906");for(let{decl:y,facts:E}of i){if(!$r(y)||E.shape!=="half-bounded-recurrence")continue;new Set([...g,...o(E)]).size===7&&K(t,"error",{node:y},"NL.E0906")}let w=7-g.size;if(w===0||w===p)return;let x=c?f?{node:f,property:"value"}:{node:l}:a?{node:a}:s.length>0?{node:s[0].decl}:{node:n};K(t,"warning",x,"NL.W0705",{daysPerWeek:p,working:w})}function lI(e,t){let n=new Map;for(let r of e.configEntries){if(!cI(r)||!r.name)continue;let i=`${r.$type}:${r.name}`;n.has(i)?K(t,"error",{node:r,property:"name"},"NL.E0907",{kind:Mr(r),name:r.name}):n.set(i,r)}}var nI=5;function cI(e){return $r(e)||Xa(e)}function fI(e,t){e.properties.find(r=>q(r)==="date")||K(t,"error",{node:e},"NL.E0500",{name:Re(e)})}function dI(e,t){let n=e.properties.find(s=>q(s)==="date");if(!n?.value)return;let r=n.value;if(!ze(r))return;let i=new Date(r),o=Tl(e.$container);switch(o.kind){case"invalid":return;case"missing":K(t,"error",{node:n,property:"value"},"NL.E0501",{name:Re(e)});return;case"valid":i<o.date&&K(t,"error",{node:n,property:"value"},"NL.E0502",{name:Re(e),date:r,start:o.iso});return}}function pI(e,t){let n=e.properties.some(i=>q(i)==="date"),r=e.properties.some(i=>q(i)==="after");!n&&!r&&K(t,"error",{node:e},"NL.E0503",{name:Re(e)})}function hI(e,t){let n=e.properties.find(s=>q(s)==="date");if(!n?.value)return;let r=n.value;if(!ze(r))return;let i=new Date(r),o=Tl(e.$container);switch(o.kind){case"invalid":return;case"missing":t("error",`Milestone "${Re(e)}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,{node:n,property:"value"});return;case"valid":i<o.date&&K(t,"error",{node:n,property:"value"},"NL.E0504",{name:Re(e),date:r,start:o.iso});return}}function mI(e,t){e.properties.some(r=>q(r)==="on")||K(t,"error",{node:e},"NL.E0505")}function gI(e,t){for(let n of e.properties)q(n)==="footnote"&&t("error",`Property "footnote:" is not valid on ${xl(e)}. Footnotes attach via "on:" on the footnote declaration \u2014 declare \`footnote <id> on:<target-id>\` instead.`,{node:n})}function yI(e,t){let n=e.properties.some(i=>q(i)==="duration"),r=e.properties.some(i=>q(i)==="size");!n&&!r&&K(t,"error",{node:e},"NL.E0600",{name:Re(e)})}function xI(e,t){for(let n of e.properties){let r=q(n);(r==="size"||r==="duration"||r==="remaining"||r==="capacity")&&t("error",`"${r}" is not valid on ${e.$type==="ParallelBlock"?"parallel":"group"} (computed from children).`,{node:n})}}function EI(e,t){let n=e.content.filter(r=>!Fa(r));n.length===0?t("error","Parallel block must contain at least 2 children.",{node:e}):n.length===1&&t("warning","Parallel block has only 1 child. Use at least 2 for parallel execution.",{node:e})}function wI(e,t){e.content.filter(r=>!Fa(r)).length===0&&t("error","Group must contain at least 1 child.",{node:e})}function TI(e,t){e.properties.find(r=>q(r)==="effort")||t("error",`Size "${Re(e)}" requires an "effort:" property.`,{node:e}),e.name&&(Oi.test(e.name)||ZA.test(e.name))&&t("error",`Size id "${e.name}" collides with the raw duration pattern. Choose a different name (e.g. "xs", "small", "quarter").`,{node:e,property:"name"})}function vI(e,t){e.name&&cd.has(e.name)&&t("error",`Status id "${e.name}" collides with the built-in status value. Built-ins: ${Rf.join(", ")}.`,{node:e,property:"name"})}function _I(e,t){let n=new Map;for(let r of e.roadmapEntries)if(yi(r)&&r.name){let i=n.get(r.name);i?t("error",`Duplicate size id "${r.name}". First declared at ${$i(i)}.`,{node:r,property:"name"}):n.set(r.name,r)}}function kI(e,t){if(nt(e)&&e.entityType!=="swimlane")return;let n=e.properties.find(s=>q(s)==="utilization-warn-at"),r=e.properties.find(s=>q(s)==="utilization-over-at");if(!n||!r)return;let i=uI(n.value),o=uI(r.value);i===null||o===null||i>o&&t("error",`utilization-warn-at (${n.value}) must be \u2264 utilization-over-at (${r.value}). Warn fires below over; if both fire at the same point, the warn band collapses to zero.`,{node:n,property:"value"})}function AI(e,t){let n=new Map,r=o=>!!o.title||o.properties.length>0||o.description!==void 0,i=o=>{if(!o.name)return;let s=r(o);n.has(o.name)||n.set(o.name,[]),n.get(o.name).push({node:o,isDeclaration:s}),!s&&o.$container.$type==="NowlineFile"&&t("warning",`Bare "person ${o.name}" at roadmap top level has no declaration. Either add properties (title, link, etc.) or remove the line.`,{node:o})};for(let o of Mn(e))Ua(o)&&i(o);for(let[o,s]of n){let a=s.filter(l=>l.isDeclaration);if(a.length>1)for(let l=1;l<a.length;l++)t("error",`Person "${o}" is declared more than once. First declaration at ${$i(a[0].node)}.`,{node:a[l].node})}}function uI(e){if(!e||e===ud)return null;if(kl.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?t/100:null}if(dd.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}return null}function II(e,t){if(ws(e))return;let n=q(e),r=e.value,i=e.values,o=r?[r]:i;switch(n){case"status":break;case"duration":r&&!Oi.test(r)&&K(t,"error",{node:e,property:"value"},"NL.E0400",{value:r});break;case"size":r&&!ld(r)&&K(t,"error",{node:e,property:"value"},"NL.E0401",{value:r});break;case"effort":r&&!Oi.test(r)&&K(t,"error",{node:e,property:"value"},"NL.E0402",{value:r});break;case"remaining":{if(r)if(YA.test(r)){let s=parseFloat(r);(s<0||s>100)&&K(t,"error",{node:e,property:"value"},"NL.E0404",{value:r})}else Oi.test(r)||K(t,"error",{node:e,property:"value"},"NL.E0403",{value:r});break}case"date":case"start":case"end":r&&!ze(r)&&K(t,"error",{node:e,property:"value"},"NL.E0405",{key:n,value:r});break;case"scale":r&&!Oi.test(r)&&K(t,"error",{node:e,property:"value"},"NL.E0406",{value:r});break;case"calendar":r&&!zA.has(r)&&K(t,"error",{node:e,property:"value"},"NL.E0407",{value:r});break;case"on":case"after":case"before":o.length===0&&K(t,"error",{node:e},"NL.E0408",{key:n});break;case"capacity":{if(!r)break;let s=e.$container,a=TF(s);if(a==="invalid")break;a==="lane"?(!Ty.test(r)||parseFloat(r)<=0)&&t("error",`Invalid swimlane capacity "${r}". Use a positive integer (e.g. capacity:5) or decimal (e.g. capacity:1.5). Percent literals are not allowed on swimlanes.`,{node:e,property:"value"}):kl.test(r)?parseFloat(r)<=0&&t("error",`Item capacity "${r}" must be positive.`,{node:e,property:"value"}):Ty.test(r)?parseFloat(r)<=0&&t("error",`Item capacity "${r}" must be positive.`,{node:e,property:"value"}):t("error",`Invalid item capacity "${r}". Use a positive integer (capacity:2), decimal (capacity:0.5), or percent literal (capacity:50%).`,{node:e,property:"value"});break}case"overcapacity":{t("error",'"overcapacity:" was removed. Use "utilization-over-at:none" (and/or "utilization-warn-at:none") to suppress the lane utilization underline.',{node:e});break}case"utilization-warn-at":case"utilization-over-at":{if(!r)break;if(!vF(e.$container)){t("error",`"${n}:" is only valid on "swimlane" or "default swimlane".`,{node:e});break}if(r===ud)break;if(kl.test(r)){parseFloat(r)<=0&&t("error",`${n} value "${r}" must be positive.`,{node:e,property:"value"});break}if(dd.test(r)){parseFloat(r)<=0&&t("error",`${n} value "${r}" must be positive.`,{node:e,property:"value"});break}if(JA.test(r)){t("error",`Ambiguous ${n} value "${r}". Use the percent form ("${r}%") or the decimal-fraction form ("0.${r}") to make the intent explicit.`,{node:e,property:"value"});break}t("error",`Invalid ${n} value "${r}". Use a positive percent (e.g. 80%), a positive decimal fraction (e.g. 0.8), or "none" to opt out.`,{node:e,property:"value"});break}case"capacity-icon":break;case"icon":break;case"non-working":nt(e.$container)&&PI(r,e,t);break;default:if(vl.has(n)){if(n==="bg"||n==="fg"||n==="text")r&&!NI(r)&&K(t,"error",{node:e,property:"value"},"NL.E0801",{value:r,key:n});else if(n in _l){let s=_l[n];r&&!s.has(r)&&K(t,"error",{node:e,property:"value"},"NL.E0802",{value:r,key:n,allowed:[...s].join(", ")})}}break}}function RI(e,t){for(let n of e.properties){let r=q(n);vl.has(r)&&K(t,"error",{node:n},"NL.E0804",{key:r,entity:xl(e)})}}function bI(e,t){let n=jA[e.$type];if(!n)return;let r=e.$type==="ParallelBlock"||e.$type==="GroupBlock"?new Set(["size","duration","remaining","capacity"]):null;for(let i of e.properties){let o=q(i);if(n.has(o)||Ey.has(o)||vl.has(o)||o==="footnote"||r?.has(o)||o==="wave"||ws(i))continue;let s=[...n,...Ey],a=VA(o,n)??gA(o,s)??"";K(t,"warning",{node:i,property:"key"},"NL.W0700",{key:o,entity:xl(e),suggested:a})}}function SI(e,t){let n=q(e),r=e.value;if(n==="bg"||n==="fg"||n==="text")NI(r)||K(t,"error",{node:e,property:"value"},"NL.E0801",{value:r,key:n});else if(n==="non-working")PI(r,e,t);else if(n in _l){let i=_l[n];i.has(r)||K(t,"error",{node:e,property:"value"},"NL.E0802",{value:r,key:n,allowed:[...i].join(", ")})}else vl.has(n)||K(t,"error",{node:e,property:"key"},"NL.E0803",{key:n})}function NI(e){return GA.has(e)||KA.test(e)}function PI(e,t,n){e===void 0||WA.has(e)||K(n,"error",{node:t,property:"value"},"NL.E0800",{value:e})}function TF(e){return e?Ye(e)?"lane":Qe(e)?"item":nt(e)?e.entityType==="swimlane"?"lane":"item":"invalid":"invalid"}function vF(e){return e?!!(Ye(e)||nt(e)&&e.entityType==="swimlane"):!1}function LI(e,t){let n=new Map,r=new Map;for(let i=0;i<e.roadmapEntries.length;i++){let o=e.roadmapEntries[i];yi(o)&&o.name?n.has(o.name)||n.set(o.name,i):Wa(o)&&o.name&&(r.has(o.name)||r.set(o.name,i))}for(let i=0;i<e.roadmapEntries.length;i++){let o=e.roadmapEntries[i];sg(o,s=>{if(ws(s))return;let a=q(s);if(a==="size"&&s.value){let l=s.value,c=n.get(l);c===void 0?t("error",`Size "${l}" is not declared. Add "size ${l} effort:<literal>" earlier in the roadmap section.`,{node:s,property:"value"}):c>=i&&t("error",`Size "${l}" is referenced before its declaration. Move "size ${l}" above this entity.`,{node:s,property:"value"})}else if(a==="status"&&s.value){let l=s.value;if(cd.has(l))return;let c=r.get(l);c===void 0?t("error",`Status "${l}" is not a built-in and has no declaration. Add "status ${l}" earlier in the roadmap section.`,{node:s,property:"value"}):c>=i&&t("error",`Status "${l}" is referenced before its declaration. Move "status ${l}" above this entity.`,{node:s,property:"value"})}})}}function $I(e,t){let n=q0(e),r=i=>{sg(i,o=>{let s=q(o);if(s!=="after"&&s!=="before"&&s!=="on"||ws(o))return;let a=o.value?[o.value]:o.values;for(let l of a)l&&((s==="after"||s==="before")&&st.test(l)||n.has(l)||t("error",`${s}: reference "${l}" does not resolve to any declared entity in this file.`,{node:o}))})};for(let i of e.roadmapEntries)r(i)}function OI(e,t){let n=Tl(e),r=i=>{let o=i.properties??[],s=_t(i),a=Qe(i)||et(i)||Ce(i)||s;for(let l of o){let c=q(l);if(c!=="after"&&c!=="before"||s&&c==="before")continue;let f=(l.value?[l.value]:l.values).filter(d=>!!d&&st.test(d));if(f.length!==0){if(!a){K(t,"error",{node:l},"NL.E0411",{key:c,type:Mr(i)});continue}f.length>1&&K(t,"error",{node:l},"NL.E0410",{key:c});for(let d of f){if(!ze(d)){K(t,"error",l.value!==void 0?{node:l,property:"value"}:{node:l,property:"values",index:l.values.indexOf(d)},"NL.E0405",{key:c,value:d});continue}switch(n.kind){case"invalid":continue;case"missing":K(t,"error",{node:l},"NL.E0412",{key:c,date:d});continue;case"valid":{let p=Te(d);p&&p<n.date&&K(t,"error",{node:l},"NL.E0413",{key:c,date:d,start:n.iso})}}}}}};for(let i of Mn(e))DI(i)||r(i)}function CI(e,t){let n=new Map,r=(d,p)=>{n.has(d)||n.set(d,new Set),n.get(d).add(p)},i=(d,p,m)=>{if(d)for(let g of p){let w=q(g);if(w==="after"){let x=g.value?[g.value]:g.values;for(let y of x)y&&(st.test(y)||r(d,y))}else if(w==="before"){let x=g.value?[g.value]:g.values;for(let y of x)y&&(st.test(y)||r(y,d))}}},o=d=>{if(_t(d))return;let p=d.name,m=d.properties??[];i(p,m,e)};for(let d of Mn(e))DI(d)||o(d);let s=0,a=1,l=2,c=new Map;for(let d of n.keys())c.set(d,s);let u=new Set,f=(d,p)=>{c.set(d,a),p.push(d);for(let m of n.get(d)??[]){let g=c.get(m)??s;if(g===a){let w=p.indexOf(m),x=p.slice(w).concat(m),y=[...x].sort().join("\u2192");u.has(y)||(u.add(y),t("error",`Circular dependency detected: ${x.join(" \u2192 ")}.`,{node:e.roadmapDecl??e}))}else g===s&&f(m,p)}p.pop(),c.set(d,l)};for(let d of n.keys())(c.get(d)??s)===s&&f(d,[])}function DI(e){return Dn(e)&&Dn(e.$container)}function MI(e,t){let n=e.hasConfig?lc.findNodeForKeyword(e.$cstNode,"config")?.offset:void 0,r=e.roadmapDecl?.$cstNode?.offset;n!==void 0&&r!==void 0&&n>r&&K(t,"error",{node:e,property:"hasConfig"},"NL.E0001");for(let i of e.includes){let o=i.$cstNode?.offset??0;n!==void 0&&o>n&&K(t,"error",{node:i},"NL.E0002"),r!==void 0&&o>r&&K(t,"error",{node:i},"NL.E0003")}}function FI(e,t){if(!qA.test(e.version)){K(t,"error",{node:e,property:"version"},"NL.E0100",{version:e.version});return}let n=parseInt(e.version.slice(1),10),r=parseInt(my.slice(1),10);n>r&&K(t,"error",{node:e,property:"version"},"NL.E0101",{version:e.version,supported:my})}function BI(e,t){let n=new Set;for(let r of e.properties){let i=q(r);if(!vy.has(i)){K(t,"error",{node:r,property:"key"},"NL.E0102",{key:i,allowed:[...vy].join(", ")});continue}if(n.has(i)&&K(t,"error",{node:r,property:"key"},"NL.E0103",{key:i}),n.add(i),i==="locale"){let o=r.value;eI.test(o)||K(t,"error",{node:r,property:"value"},"NL.E0104",{value:o})}}}function UI(e,t){!e.name&&!e.title&&K(t,"error",{node:e},"NL.E0301",{type:e.$type})}function WI(e,t){let n=new Map,r=(i,o)=>{if(!i)return;let s=n.get(i);s?K(t,"error",{node:o},"NL.E0300",{name:i,location:$i(s)}):n.set(i,o)};e.roadmapDecl?.name&&r(e.roadmapDecl.name,e.roadmapDecl);for(let i of e.roadmapEntries)kf(i,r);for(let i of e.configEntries)Dt(i)&&i.name&&r(i.name,i)}function XI(e,t){let n=e.$document?.textDocument.getText()??e.$cstNode?.text;if(!n)return;let r=n.split(/\r?\n/);for(let i=0;i<r.length;i++){let o=r[i];if(o.length===0)continue;let s=o.match(/^([\t ]+)/);if(!s)continue;let a=s[1];if(a.includes(" ")&&a.includes(" ")){K(t,"error",{node:e},"NL.E0005",{line:i+1});return}}}function GI(e,t){let n=e.roadmapEntries.some(Ye);e.roadmapDecl&&!n&&K(t,"error",{node:e.roadmapDecl},"NL.E0004")}function zI(e,t){tI.has(e.value)||K(t,"error",{node:e,property:"value"},"NL.E0200",{value:e.value})}function HI(e,t){let n=new Set;for(let r of e.options){let i=q(r);n.has(i)&&K(t,"error",{node:r},"NL.E0201",{key:i}),n.add(i)}}function jI(e,t){if(!xy.has(e.entityType)){t("error",`"${e.entityType}" is not a supported entity type for default. Allowed: ${[...xy].join(", ")}.`,{node:e,property:"entityType"});return}let n=e.$container,r=-1;for(let o=0;o<n.configEntries.length;o++){let s=n.configEntries[o];if(nt(s)&&s.entityType===e.entityType){if(r<0)r=o;else if(s===e){t("error",`Duplicate "default ${e.entityType}" declaration. Only one is allowed per entity type per file.`,{node:e});break}}}let i=HA[e.entityType];if(i)for(let o of e.properties){let s=q(o);i.has(s)&&t("error",td(s,e.entityType),{node:o})}if(e.entityType!=="roadmap")for(let o of e.properties){let s=q(o);XA.has(s)&&K(t,"warning",{node:o,property:"key"},"NL.W0703",{key:s,entityType:e.entityType})}}function VI(e,t){let n=e.roadmapDecl;if(!n)return;let r=new Map,i=new Map;for(let c of e.configEntries)Dt(c)&&c.name&&!r.has(c.name)?r.set(c.name,c):nt(c)&&c.entityType==="roadmap"&&(i.has("roadmap")||i.set("roadmap",c));let o=new Map;for(let c of e.roadmapEntries)Ba(c)&&c.name&&!o.has(c.name)&&o.set(c.name,c);let s,a,l=c=>{for(let u of c){let f=q(u);f==="header-height"?s=u:f==="timeline-position"&&(a=u)}};for(let c of If("roadmap",n.properties,{styles:r,defaults:i,labels:o}))switch(c.level){case"inline":break;case"default":l(c.props);break;case"label":return;default:if(!c.decl)return;l(c.decl.properties)}s?.value==="none"&&(a?.value!=="bottom"&&a?.value!=="both"||K(t,"warning",{node:a,property:"value"},"NL.W0704",{position:a.value}))}function YI(e,t){e.name&&gy.has(e.name)&&K(t,"error",{node:e,property:"name"},"NL.E0805",{name:e.name,builtins:[...za].sort().join(", ")});let n=e.properties.find(i=>q(i)==="unicode");n?(!n.value||n.value.length===0)&&K(t,"error",{node:n,property:"value"},"NL.E0807",{name:Re(e)}):K(t,"error",{node:e},"NL.E0806",{name:Re(e)});let r=e.properties.find(i=>q(i)==="ascii");if(r){let i=r.value??"";QA.test(i)||K(t,"error",{node:r,property:"value"},"NL.E0808",{name:Re(e),length:i.length})}for(let i of e.properties){let o=q(i);o!=="unicode"&&o!=="ascii"&&o!=="link"&&o!=="description"&&K(t,"error",{node:i,property:"key"},"NL.E0809",{key:o})}}function KI(e,t){let n=new Map;for(let r of e.configEntries)if(xi(r)&&r.name){let i=n.get(r.name);i?K(t,"error",{node:r,property:"name"},"NL.E0810",{name:r.name,location:$i(i)}):n.set(r.name,r)}}function qI(e,t){let n=new Map;for(let i=0;i<e.configEntries.length;i++){let o=e.configEntries[i];xi(o)&&o.name&&(n.has(o.name)||n.set(o.name,i))}let r=(i,o,s,a)=>{if(o!=="icon"&&o!=="capacity-icon"||!s||!ld(s)||o==="capacity-icon"&&UA.has(s)||o==="icon"&&gy.has(s))return;let l=n.get(s);if(l===void 0){let c=o==="capacity-icon"?[...Ei].sort().join(", "):[...za].sort().join(", ");K(t,"error",{node:a,property:"value"},"NL.E0811",{key:o,value:s,builtins:c})}else l>=i&&K(t,"error",{node:a,property:"value"},"NL.E0812",{key:o,value:s})};for(let i=0;i<e.configEntries.length;i++){let o=e.configEntries[i];if(Dt(o))for(let s of o.properties)r(i,q(s),s.value,s);else if(nt(o))for(let s of o.properties)r(i,q(s),s.value,s)}}function ZI(e){let t=e.validation.ValidationRegistry,n=e.validation.NowlineValidator,r={NowlineFile:[n.checkFileStructure,n.checkUniqueIdentifiers,n.checkSwimlaneRequired,n.checkIndentationConsistency,n.checkRoadmapOnlyKeywordsPosition,n.checkForwardReferences,n.checkReferenceResolution,n.checkInlineDatePins,n.checkCircularDependencies,n.checkWaves,n.checkDuplicateSizeIds,n.checkCalendarBlockConsistency,n.checkHiddenTimelineStrip,n.checkPersonDeclarations,n.checkDuplicateSymbolIds,n.checkSymbolReferences,n.checkCalendarWeek,n.checkDuplicateCalendarDeclarationIds],NowlineDirective:[n.checkDirectiveVersion,n.checkDirectiveProperties],IncludeOption:[n.checkIncludeMode],IncludeDeclaration:[n.checkIncludeDuplicateOptions],EntityProperty:[n.checkPropertyValues],RoadmapDeclaration:[n.checkEntityIdOrTitle,n.checkRoadmapProperties,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],AnchorDeclaration:[n.checkEntityIdOrTitle,n.checkAnchorRequiredDate,n.checkAnchorAgainstStart,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],SwimlaneDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkUtilizationOrdering,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],ItemDeclaration:[n.checkEntityIdOrTitle,n.checkItemRequiredDuration,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],ParallelBlock:[n.checkParallelMinChildren,n.checkNoComputedProperties,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],GroupBlock:[n.checkGroupMinChildren,n.checkNoComputedProperties,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],MilestoneDeclaration:[n.checkEntityIdOrTitle,n.checkMilestoneRequirement,n.checkMilestoneAgainstStart,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],FootnoteDeclaration:[n.checkEntityIdOrTitle,n.checkFootnoteOn,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],PersonDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],TeamDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],StyleDeclaration:[n.checkEntityIdOrTitle],StyleProperty:[n.checkStylePropertyEnum],SymbolDeclaration:[n.checkEntityIdOrTitle,n.checkSymbolDeclaration],NonWorkingDeclaration:[n.checkCalendarDeclaration],WorkingDeclaration:[n.checkCalendarDeclaration],LabelDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],SizeDeclaration:[n.checkEntityIdOrTitle,n.checkSizeDeclaration,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],StatusDeclaration:[n.checkEntityIdOrTitle,n.checkStatusDeclaration,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],WaveDeclaration:[n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],DefaultDeclaration:[n.checkDefaultDeclaration,n.checkUtilizationOrdering],CalendarBlock:[n.checkCalendarBlock],ScaleBlock:[n.checkScaleBlock]};t.register(r,n)}var pd=class{checkFileStructure(t,n){MI(t,n)}checkRoadmapOnlyKeywordsPosition(t,n){}checkDirectiveVersion(t,n){FI(t,n)}checkDirectiveProperties(t,n){BI(t,n)}checkEntityIdOrTitle(t,n){UI(t,n)}checkUniqueIdentifiers(t,n){WI(t,n)}checkIndentationConsistency(t,n){XI(t,n)}checkSwimlaneRequired(t,n){GI(t,n)}checkIncludeMode(t,n){zI(t,n)}checkIncludeDuplicateOptions(t,n){HI(t,n)}checkPropertyValues(t,n){II(t,n)}checkAnchorRequiredDate(t,n){fI(t,n)}checkAnchorAgainstStart(t,n){dI(t,n)}checkMilestoneRequirement(t,n){pI(t,n)}checkMilestoneAgainstStart(t,n){hI(t,n)}checkFootnoteOn(t,n){mI(t,n)}checkNoFootnoteProperty(t,n){gI(t,n)}checkItemRequiredDuration(t,n){yI(t,n)}checkNoComputedProperties(t,n){xI(t,n)}checkParallelMinChildren(t,n){EI(t,n)}checkGroupMinChildren(t,n){wI(t,n)}checkNoRawStyleProperties(t,n){RI(t,n)}checkUnknownEntityProperties(t,n){bI(t,n)}checkRoadmapProperties(t,n){}checkStylePropertyEnum(t,n){SI(t,n)}checkSizeDeclaration(t,n){TI(t,n)}checkStatusDeclaration(t,n){vI(t,n)}checkWaves(t,n){for(let o of rd(t))ad(n,o);for(let o of id(t))ad(n,o);let r=nn(t);if(r.length===0)return;let i={lanes:t.roadmapEntries.filter(Ye),lookup:Es(t)};for(let o of Ts(i,r))ad(n,o)}checkDuplicateSizeIds(t,n){_I(t,n)}checkUtilizationOrdering(t,n){kI(t,n)}checkDefaultDeclaration(t,n){jI(t,n)}checkHiddenTimelineStrip(t,n){VI(t,n)}checkCalendarBlockConsistency(t,n){rI(t,n)}checkCalendarBlock(t,n){iI(t,n)}checkScaleBlock(t,n){oI(t,n)}checkForwardReferences(t,n){LI(t,n)}checkReferenceResolution(t,n){$I(t,n)}checkInlineDatePins(t,n){OI(t,n)}checkCircularDependencies(t,n){CI(t,n)}checkPersonDeclarations(t,n){AI(t,n)}checkSymbolDeclaration(t,n){YI(t,n)}checkDuplicateSymbolIds(t,n){KI(t,n)}checkCalendarDeclaration(t,n){sI(t,n)}checkCalendarWeek(t,n){aI(t,n)}checkDuplicateCalendarDeclarationIds(t,n){lI(t,n)}checkSymbolReferences(t,n){qI(t,n)}};var _y=class extends Lo{runConverter(t,n,r){return t.name==="PROPERTY_KEY_WITH_COLON"||t.name==="INCLUDE_OPTION_KEY"?n.endsWith(":")?n.slice(0,-1):n:super.runConverter(t,n,r)}},ky=class extends Na{isStartOfLine(t,n){if(!super.isStartOfLine(t,n))return!1;let r=n-1;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;for(;r>=0&&(t[r]==="\r"||t[r]===`
2917
2917
  `);)r--;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;return r<0||t[r]!=="\\"}},JI={parser:{TokenBuilder:()=>new ky({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:e=>new yf(e),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new _y},validation:{NowlineValidator:()=>new pd}};function Ay(e={}){let t=e.shared??Uo(gf(xf),jk),n=Uo(mf({shared:t}),Vk,JI);return t.ServiceRegistry.register(n),ZI(n),{shared:t,Nowline:n}}function Iy(e,t){return t.code===void 0?t.message:jn(e,t.code,...t.args??[])}function Ci(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=vs(t),o=n.map(u=>wl(u,i)),s=new WeakMap,a=new WeakMap,l=u=>{let f=nd(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=>Qe(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 Al="en-US",bF={"en-US":{nowLabel:"now",quarterPrefix:"Q",waveHeldBy:"held by",waveNoItems:"no items",waveBackgroundItem:"Background (no wave)",waveLegendBackground:"Background work (not in a wave)",waveLegendBoundary:"Wave boundary",waveLegendPrefix:"Waves:",wavesDeclaredPlaceholder:"Waves declared: {names} \u2014 no items assigned yet"},fr:{nowLabel:"maint.",quarterPrefix:"T",waveHeldBy:"retenue par",waveNoItems:"aucun \xE9l\xE9ment",waveBackgroundItem:"Travail de fond (hors vague)",waveLegendBackground:"Travail de fond (dans aucune vague)",waveLegendBoundary:"Limite de vague",waveLegendPrefix:"Vagues\xA0:",wavesDeclaredPlaceholder:"Vagues d\xE9clar\xE9es\xA0: {names} \u2014 aucun \xE9l\xE9ment affect\xE9 pour l\u2019instant"}};function QI(e,t){return t??e??Al}function Kn(e){let t={};for(let n of SF(e)){let r=bF[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 eR(e,t){return e.wavesDeclaredPlaceholder.replace("{names}",()=>t.join(", "))}function SF(e){let t=[],n=NF(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(Al)||t.push(Al),t}function NF(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}function hd(e){return e==="hide"||e==="show"}var tR={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},qn={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"},Ry={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...qn,headerHeight:"md",padding:"md"},swimlane:{...qn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...qn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...qn,bracket:"none",padding:"xs"},group:{...qn,bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...qn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...qn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...qn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...qn,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 nR={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Zn={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"},by={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Zn,headerHeight:"md",padding:"md"},swimlane:{...Zn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Zn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Zn,bracket:"none",padding:"xs"},group:{...Zn,bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Zn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Zn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Zn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Zn,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 rR={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Jn={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"},Sy={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Jn,headerHeight:"md",padding:"md"},swimlane:{...Jn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Jn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Jn,bracket:"none",padding:"xs"},group:{...Jn,bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Jn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Jn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Jn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Jn,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 iR=["light","dark","grayscale"],Ny={light:Sy,dark:Ry,grayscale:by};var PF={greyscale:"grayscale"};function Py(e){let t=e.toLowerCase(),n=PF[t]??t;return iR.find(r=>r===n)}var LF={grey:"gray",violet:"purple"};function Qn(e,t){if(e==="none")return"none";if(e.startsWith("#"))return e;let n=t.name==="dark"?tR:t.name==="grayscale"?nR:rR,r=LF[e]??e,i=n[r];return typeof i=="string"?i:e}function $F(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 oR(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=Il(n,"xl");break;case"padding":e.padding=Il(n,"xl");break;case"spacing":e.spacing=Il(n,"xl");break;case"header-height":e.headerHeight=Il(n,"xl");break;case"corner-radius":e.cornerRadius=Il(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":hd(n)&&(e.nonWorking=n);break;default:break}}function Il(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 OF(e,t,n){if(t)for(let r of t.properties)oR(e,q(r),r.value,n)}function CF(e,t,n){for(let r of t){let i=q(r);r.value!==void 0&&oR(e,i,r.value,n)}}function be(e,t,n){let r=n.theme.entities[e],i=$F(r,n.theme);for(let o of If(e,t,n))switch(o.level){case"default":case"inline":CF(i,o.props,n.theme);break;case"label":break;default:OF(i,o.decl,n.theme)}return i}function sR(e,t){return be("label",e.properties,t)}function lR(e,t){let r=ot(e.roadmapDecl?.properties??[],"scale")?.value,i="weeks",o,s;if(r)if(r==="days"||r==="weeks"||r==="months"||r==="quarters"||r==="years")i=r;else{let c=/^(\d+)([dwmqy])$/.exec(r);if(c){let u=Math.max(1,parseInt(c[1],10));switch(c[2]){case"d":i="days";break;case"w":i="weeks";break;case"m":i="months";break;case"q":i="quarters";break;case"y":i="years";break}o=md(i)*u,s=1}}let a=s??Nk[i]??4,l=c=>s===void 0&&!c?{labelEveryDefault:!0}:{};if(t){let u=ot(t.properties,"unit")?.value??i,f=ot(t.properties,"label-every"),d=ot(t.properties,"pixels-per-unit"),p=f&&parseInt(f.value,10)||0,m=p!==0?Math.max(1,p):a,g=d?Math.max(1,parseInt(d.value,10)||md(u)):o??md(u);return{unit:u,labelEvery:m,pixelsPerUnit:g,...l(p!==0)}}return{unit:i,labelEvery:a,pixelsPerUnit:o??md(i),...l(!1)}}function md(e){switch(e){case"days":return Ik;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}var DF=.5,Ly=.5,Rl=7;function Br(e){return e==="months"||e==="quarters"||e==="years"}function gd(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 MF(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 yd(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:We(i.dateAtWorkingIndex(e,o-1),1),l=Br(n)?aR(a,n):n==="weeks"?cR(a,e,i.weekStart):a;return i.workingIndexOf(e,l)}if(!Br(n))return Math.ceil(t/r)*r;let s=We(e,o);return kt(e,aR(s,n))}function aR(e,t){return MF(e,t)?e:gd(e,t)}function cR(e,t,n){let r=n===void 0?-kt(t,e):n-e.getUTCDay();return We(e,(r%Rl+Rl)%Rl)}function FF(e,t,n){return cR(We(e,1),t,n)}function xd(e,t,n,r=Al){if(e.calendar?.hasNonWorkingDays)return BF(e,t,e.calendar,r);if(Br(t.unit))return HF(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?Cy(t.unit,We(e.domain[0],u),c,r):void 0})}return l}function BF(e,t,n,r){let{unit:i}=t,[o,s]=e.domain,a=x=>Br(i)?gd(x,i):i==="weeks"?FF(x,o,n.weekStart):We(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&&!XF(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?WF(x,n,e.showsNonWorking):y%t.labelEvery===0,m=(e.showsNonWorking?uk(i):n.daysPerUnit(i))*e.pixelsPerDay,g=u.map(({date:x,x:y},E)=>{let T=(E+1<u.length?u[E+1].x:c)-y,_=d(x,E),P=_?Cy(i,x,E,r):void 0,U=P===void 0?0:ye(P,vi),O=Br(i)?E===0||E===u.length-1:T<m-DF,D=P!==void 0&&!(U>T&&O);return{x:y,columnPx:T,major:_,label:P,labelPx:U,isNarrowed:O,isShown:D}});Br(i)||UF(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 UF(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 WF(e,t,n){let r=t.weekStart;if(n)return e.getUTCDay()===r;let i=(e.getUTCDay()-r+Rl)%Rl;for(let o=1;o<=i;o++)if(t.isWorkingDay(We(e,-o)))return!1;return!0}function XF(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 $y(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=>zF(e,c,n));let l=c=>t.some(u=>Math.abs(u.x-c)<Ly&&(u.major||r));return o.map(c=>{let u=e.forward(c.from),f={x:u,width:e.forward(We(c.through,1))-u,from:c.from,through:c.through};c.titles.length>0&&(f.titles=c.titles,f.label=fR(c,i.workingWeekdays),f.cut=!0);let d=u-s>Ly&&a-u>Ly;return n==="days"&&d&&!l(u)&&(f.seam=!0),f})}function Oy(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:GF(r)}))}function GF(e){let t=kt(e.from,e.through)+1;return`${e.titles.join(", ")}${uR}+${t}d`}var uR=" \xB7 ";function fR(e,t){let n=0;for(let i=e.from;i<=e.through;i=We(i,1))t.has(i.getUTCDay())&&n++;let r=e.titles.join(", ");return n>0?`${r}${uR}${n}d`:r}function zF(e,t,n){let[r,i]=e.range,o=Math.max(r,e.forward(t.from)),s=Math.min(i,e.forward(We(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=fR(t,e.calendar.workingWeekdays))),(n==="days"||n==="weeks"||t.titles.length>0)&&(a.band=!0),a}function HF(e,t,n,r){let[i,o]=e.domain,s=[i];for(let c=gd(i,n);c<o;c=gd(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?Cy(n,c,u,r):void 0,g=u===0||u===l-1;return m!==void 0&&g&&ye(m,vi)>p&&(m=void 0),{x:f,labelX:f+p/2,major:d,label:m}})}function Cy(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`${Kn(r).quarterPrefix}${i} ${t.getUTCFullYear()}`}case"years":return`${t.getUTCFullYear()}`}}function dR(e,t,n){let r=n.theme??"light",i=Ny[r],o=QI(n.locale,VF(e)),s={theme:i,styles:t.config.styles,defaults:t.config.defaults,labels:t.content.labels},a=be("roadmap",e.roadmapDecl?.properties??[],s);return{themeName:r,theme:i,locale:o,styleCtx:s,roadmapStyle:a}}function pR(e,t,n,r,i){let{config:o,working:s}=Nf(e,t),a=lR(e,t.config.scale),{startDate:l,endDate:c}=jF(e,i,n.today,a),u=hd(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,kt(l,c)):d;return{cal:o,calendar:s,preset:a,schedule:i,startDate:l,naturalEndDate:c,spanDays:d,timelineDays:p,nonWorking:u}}function jF(e,t,n,r){let i=e.roadmapDecl?.properties??[],{config:o,working:s}=t.calendar,{startDate:a}=t,l=re(i,"length"),c=0;if(l){let m=os(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=lk(r.unit,o),d=yd(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 VF(e){return ot(e.directive?.properties??[],"locale")?.value}var My=class{constructor(t,n){B(this,"id");B(this,"anchor");this.id=t,this.anchor=n}place(t,n){let r=re(this.anchor.properties,"date"),i=Te(r);if(!i)return null;let o=t.scale.forwardWithinDomain(i);if(o===null)return null;let s=be("anchor",this.anchor.properties,t.styleCtx),a=t.markerRowPlacements.get(this.id),l=a?.centerY??t.timeline.markerRow.y,c={x:o,y:l},u=a?.labelBox??{x:o+6+6,y:l-4,width:0,height:12},f=a?.labelSide??"right";t.entityLeftEdges.set(this.id,o),t.entityRightEdges.set(this.id,o),t.entityMidpoints.set(this.id,c);let d={id:this.id,title:this.anchor.title??this.id,center:c,radius:6,style:s,predecessorPoints:[],cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f};return!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(i)&&(d.hiddenDate=Ti(i)),d}};function hR(e,t,n){let r=[];for(let[i,o]of e){let s=new My(i,o).place(t,n);s&&r.push(s)}return r}function _s(e){let t=0;for(let n of e)t=Math.max(t,mR(n.children)),n.nested.length>0&&(t=Math.max(t,_s(n.nested)));return t}function mR(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,mR(n.children));return t}var wd=class{constructor(t){B(this,"items");B(this,"brackets");this.items=t.itemBars,this.brackets=t.brackets}hasObstacle(t,n,r){let i=Math.min(n,r),o=Math.max(n,r);for(let s of this.items)if(!(t<=s.x||t>=s.x+s.width)&&!(s.y+s.height<=i||s.y>=o))return!0;return!1}bracketsNear(t,n,r,i){let o=Math.min(n,r),s=Math.max(n,r),a=[];for(let l of this.brackets)Math.abs(l.x-t)>i||l.yBottom<=o||l.yTop>=s||a.push(l);return a}};function gR(e,t){let n=[],r=[],i=s=>{if(s.kind==="item"){n.push(s.box);return}if(s.kind==="parallel"){if(s.style.bracket==="solid"||s.style.bracket==="dashed"){let c=s.box.y-12,u=s.box.y+s.box.height+12,f=s.box.x,d=s.box.x+s.box.width;r.push({x:f,yTop:c,yBottom:u}),r.push({x:d,yTop:c,yBottom:u}),r.push({x:f+4,yTop:c-1,yBottom:c+1}),r.push({x:f+4,yTop:u-1,yBottom:u+1}),r.push({x:d-4,yTop:c-1,yBottom:c+1}),r.push({x:d-4,yTop:u-1,yBottom:u+1})}for(let a of s.children)i(a);return}if(s.kind==="group"){!(s.style.bg!=="none"&&s.style.bg!=="#ffffff")&&s.style.bracket&&s.style.bracket!=="none"&&r.push({x:s.box.x,yTop:s.box.y,yBottom:s.box.y+s.box.height});for(let l of s.children)i(l);return}},o=s=>{for(let a of s.children)i(a);for(let a of s.nested)o(a)};for(let s of e)o(s);for(let s of t)for(let a of s.nestedSwimlanes)o(a);return{itemBars:n,brackets:r}}function KF(e,t){let{from:n,to:r}=e;if(Math.abs(n.y-r.y)<.5)return{x:(n.x+r.x)/2,underBar:!1,range:null};let i=Math.min(n.y,r.y),o=Math.max(n.y,r.y);if(n.x<=r.x){let a=n.x+6,l=r.x-6;if(a>l)return{x:r.x-6,underBar:!0,range:null};let c={minX:a,maxX:l},u=(n.x+r.x)/2,f=Math.max(a,Math.min(l,u));if(!t.hasObstacle(f,i,o))return{x:f,underBar:!1,range:c};let d=l-a;for(let p=1;p<=d;p++){let m=f-p;if(m>=a&&!t.hasObstacle(m,i,o))return{x:m,underBar:!1,range:c};let g=f+p;if(g<=l&&!t.hasObstacle(g,i,o))return{x:g,underBar:!1,range:c}}return{x:f,underBar:!0,range:c}}let s=[n.x+10,r.x-10];for(let a of s)if(a>0&&!t.hasObstacle(a,i,o))return{x:a,underBar:!1,range:null};return{x:n.x+10,underBar:!0,range:null}}function qF(e,t,n,r){let i=Math.min(n.from.y,n.to.y),o=Math.max(n.from.y,n.to.y),s=r.bracketsNear(e,i,o,4);if(s.length===0)return{x:e,forceUnderBar:!1};let a=s[0],l=Math.abs(s[0].x-e);for(let d=1;d<s.length;d++){let p=Math.abs(s[d].x-e);p<l&&(a=s[d],l=p)}let c=[a.x+4,a.x-4],u=4-.01;for(let d of c){if(t&&(d<t.minX||d>t.maxX))continue;let p=t?d:Math.max(Math.min(n.from.x,n.to.x)+1,Math.min(Math.max(n.from.x,n.to.x)-1,d));if(r.bracketsNear(p,i,o,u).length===0)return{x:p,forceUnderBar:!1}}return{x:t?Math.min(Math.max(e,t.minX),t.maxX):e,forceUnderBar:!0}}function ZF(e){let t=[...e].sort((i,o)=>Math.abs(i.channelX-o.channelX)>=1?i.channelX-o.channelX:i.orderIndex-o.orderIndex),n=new Map,r=0;for(;r<t.length;){let i=r+1;for(;i<t.length&&Math.abs(t[i].channelX-t[r].channelX)<1;)i++;let s=[...t.slice(r,i)].sort((l,c)=>{let u=Math.min(l.req.from.y,l.req.to.y),f=Math.min(c.req.from.y,c.req.to.y);return Math.abs(u-f)>.5?u-f:l.orderIndex-c.orderIndex}),a=[];for(let l of s){let c=Math.min(l.req.from.y,l.req.to.y),u=Math.max(l.req.from.y,l.req.to.y),f=-1;for(let d=0;d<a.length;d++)if(a[d]<=c){f=d,a[d]=u;break}f===-1&&(f=a.length,a.push(u)),n.set(l.orderIndex,f)}r=i}return n}function JF(e){if(e===0||e>4)return 0;let t=Math.ceil(e/2);return(e%2===1?1:-1)*t*3}function QF(e){let t=e.from.x>=e.to.x?{x:e.to.x-1,y:e.from.y}:e.from;return{fromId:e.fromId,toId:e.toId,waypoints:[t,e.to],underBar:!1}}function yR(e,t){let n=new Array(e.length),r=[];for(let o=0;o<e.length;o++){let s=e[o];if(s.isMarkerSource){n[o]=QF(s);continue}if(Math.abs(s.from.y-s.to.y)<.5&&s.to.x-s.from.x<20){n[o]={fromId:s.fromId,toId:s.toId,waypoints:[s.from,s.to],underBar:!1};continue}let{x:a,underBar:l,range:c}=KF(s,t),{x:u,forceUnderBar:f}=qF(a,c,s,t),d=l||f;r.push({req:s,channelX:u,underBar:d,orderIndex:o})}let i=ZF(r);for(let o of r){let s=JF(i.get(o.orderIndex)??0),a=o.channelX+s;n[o.orderIndex]={fromId:o.req.fromId,toId:o.req.toId,waypoints:e2(o.req.from,o.req.to,a),underBar:o.underBar}}return n}function e2(e,t,n){return Math.abs(e.y-t.y)<.5?[e,t]:[e,{x:n,y:e.y},{x:n,y:t.y},t]}function xR(e){return e.box.y+e.box.height-en/2}function ER(e,t){let{box:n}=e;return{x:n.x,y:n.y+t/2}}function wR(e,t){let{box:n}=e;return{x:n.x+n.width,y:e.textSpills?xR(e):n.y+t/2}}function TR(e,t){return e.textSpills?xR(e):e.box.y+t/2}function vR(e){let{box:t,afterDate:n,beforeDate:r,hasLinkIcon:i,footnoteCount:o}=e;if(!n&&!r)return[];let s=[],a=Un,l=t.y+Lk,c=Jg(t.width);if(n){let u=Qg(t.x,i),f=c?{x:t.x-Xn-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=ey(u,o),d=c?{x:u+Xn,y:l}:{x:f,y:l};s.push({side:"before",isoDate:r,glyphTopLeft:d,glyphSize:a,spilled:c})}return s}function Td(e){let{box:t,afterDate:n,beforeDate:r,row:i}=e;if(!n&&!r)return[];let o=[],s=Un,a,l,c;if(i.kind==="title-tab-row"){a=t.y+(_i-s)/2;let u=i.titleTabWidth!==void 0?t.x+i.titleTabWidth:void 0;l=u!==void 0?u+Wn:t.x+Si,c=u??t.x}else a=t.y-ps+(ps-s)/2,l=t.x+Si,c=i.title?Ni(t.x,i.titleInsetX,!!n)+ty(i.title):t.x;if(n&&(c=Math.max(c,l+s),o.push({side:"after",isoDate:n,glyphTopLeft:{x:l,y:a},glyphSize:s,spilled:!1})),r){let u=t.x+t.width-Zg-s;o.push({side:"before",isoDate:r,glyphTopLeft:{x:Math.max(u,c+Wn),y:a},glyphSize:s,spilled:!1})}return o}function Wt(e){for(let t of e)if(Te(t))return t}function En(e){let t;for(let r of["date","start"]){let i=re(e,r),o=Te(i);if(i!==void 0&&o){t={key:r,raw:i,date:o};break}}let n=Be(e,"after").map(r=>{let i=Te(r);return i?{raw:r,date:i}:{raw:r,ref:r}});return t?{pin:t,after:n}:{after:n}}function vd(e){return e.floors.map(t=>t?Te(t.date):null)}function _d(e,t,n,r,i=0){let o=n.map(l=>l??-1/0),s=[];for(let l=0;l<e;l++)s.push(_R(l===0?t:s[l-1],o[l],i));let a=[...s];for(let l=1;l<=e+1;l++){let c=r(s,a).memberEnd,u=[],f=[];for(let d=0;d<e;d++)u.push(d===0?s[0]:_R(f[d-1],o[d],i)),f.push(Math.max(u[d],c[d]??-1/0));if(kR(s,u)&&kR(a,f))return{S:s,E:a,passes:l,capped:!1};s=u,a=f}return r(s,a),{S:s,E:a,passes:e+1,capped:!0}}function _R(e,t,n){return t-e>n?t:e}function kR(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function AR(e,t,n){return vd(e).map(r=>r?n.workingIndexOf(t,r):null)}var Di=class{constructor(t,n){B(this,"plan");B(this,"S");B(this,"memberEnd");B(this,"binding");B(this,"memberCount");this.plan=t,this.S=n;let r=t.waves.length;this.memberEnd=new Array(r).fill(-1/0),this.binding=new Array(r).fill(void 0),this.memberCount=new Array(r).fill(0)}floor(t){let n=this.plan.waveOf.get(t),r=t.$type==="ItemDeclaration"?void 0:this.plan.leadOf.get(t),i;return n!==void 0&&(i=this.S[n-1]),r!==void 0&&(i=Math.max(i??-1/0,this.S[r-1])),i}apply(t,n){let r=this.floor(t);return r===void 0?n:Math.max(n,r)}accumulate(t,n){let r=this.plan.memberWave(t);r!==void 0&&(this.memberCount[r-1]++,n>this.memberEnd[r-1]&&(this.memberEnd[r-1]=n,this.binding[r-1]=t))}};function kd(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 lt=.5;function IR(e,t,n,r){let i=e.waves.map(()=>n);return{plan:e,ids:e.waves.map(o=>o.name),origin:n,floors:vd(e).map(o=>o?t.forward(o):null),S:i,E:i,pass:new Di(e,i),frozen:!1,backgroundTooltip:r}}function RR(e,t,n){e.S=t,e.E=n,e.pass=new Di(e.plan,t)}function bR(e,t){e.S=t.S,e.E=t.E,e.frozen=!0,e.solve=t}function Ad(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 SR(e,t,n){n.waves&&!n.waves.frozen&&n.waves.pass.accumulate(e,t)}function NR(e,t){if(t.waves)return t.waves.plan.memberWave(e)!==void 0?"member":"background"}function PR(e,t,n){let r=n.waves?.plan.waveOf.get(e);if(!n.waves||r===void 0)return;let{pin:i}=En(e.properties);if(!i)return;let o=n.scale.forwardWithinDomain(i.date),s=n.waves.pass.floor(e);if(!(o===null||s===void 0||s-o<lt)&&!(t-s>lt))return{wave:n.waves.ids[r-1],key:i.key,pin:i.raw,start:bl(s,n).toISOString().slice(0,10)}}function LR(e,t){for(let n of[...e.S,...e.E])if(!(Math.abs(n-e.origin)<lt)&&Math.abs(t-n)<lt)return!0;return!1}function Fy(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,We(r,n))}function bl(e,t){return t.calendar.dateAtWorkingIndex(t.timeline.startDate,Fy(e,t))}function $R(e,t,n){return Sf(n.calendar,n.timeline.startDate,Fy(e,n),Fy(t,n))}function Sl(e,t,n){return Ur(e,By(e.properties,t,n),n)}function By(e,t,n){let{pin:r,after:i}=En(e);if(r){let o=n.scale.forwardWithinDomain(r.date);if(o!==null)return o}if(i.length>0){let o=t;for(let s of i){if("date"in s){let l=n.scale.forwardWithinDomain(s.date);l!==null&&(o=Math.max(o,l));continue}let a=n.entityRightEdges.get(s.ref);a!==void 0&&(o=Math.max(o,a))}return o}return t}function OR(e,t,n){if(!n.calendar.hasNonWorkingDays)return;let r=t2(e);if(!r||n.calendar.isWorkingDay(r.date))return;let i=n.scale.forwardWithinDomain(r.date);if(!(i===null||Math.abs(t-i)>=lt))return{key:r.key,pin:r.raw,start:Ti(bl(t,n))}}function t2(e){let{pin:t,after:n}=En(e);if(t)return t;for(let r of n)if("date"in r)return{key:"after",raw:r.raw,date:r.date}}function Nl(e,t){return{x:e,y:t,height:0,maxX:e}}function CR(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 Id(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:ss(e.content.sizes,t.cal),labels:e.content.labels,teams:e.content.teams,persons:e.content.persons,symbols:e.config.symbols,footnoteIndex:r.footnotes?.index??new Map,footnoteHosts:r.footnotes?.hosts??new Map,timeline:t.timeline,scale:t.scale,calendar:t.calendar,bandScale:t.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,placedItems:new Map,itemFlowKey:new Map,currentFlowKey:"",slackCorridors:[],markerRowPlacements:r.markerRowPlacements??new Map,chartTopY:n.chartTopY,chartBottomY:n.chartBottomY,swimlaneBottomY:n.swimlaneBottomY,nextParallelId:0,nextGroupId:0,...t.waves?{waves:t.waves}:{}}}function DR(e,t,n){return e.scale.showsNonWorking?e.scale.advanceX(t,n)-t:n*e.timeline.pixelsPerDay}var n2=12,r2=4,Rd=13,i2=11;function o2(e,t){return(e?ye(e,i2):0)+t}function Uy(e){return Math.max(qa,e-2*mn)}function MR(e){if(!/[\r\n]/.test(e))return;let t=e.replace(/\r\n?/g,`
2918
2918
  `).split(`
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 s2(e,t,n,r=t){let i=e,o=MR(e);if(o){if(o.length>=2)return{textSpills:!(n<=t&&o.every((c,u)=>ye(c,Rd)<=(u===0?r:t))),titleLines:o};i=o[0]??""}let s=i.length>0&&ye(i,Rd)>r,a=n>t;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let l=ll(i,t,Rd,r);if(l.length>=2&&l.length<=jg&&l.every((c,u)=>ye(c,Rd)<=(u===0?r:t)))return{textSpills:!1,titleLines:l}}return{textSpills:!0,titleLines:[i]}}function FR(e,t,n){let r=MR(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function BR(e){let{visualWidth:t}=e,n=fs(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-n2),i=o2(e.metaText,e.metaTrailingWidth??0),o=Math.max(0,t-n-(e.titleFirstLineRightReservePx??dl({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1})));return{leftInset:n,fit:s2(e.title,r,i,o)}}var a2;function UR(e,t,n){a2?.(e,t,n)}var bd=class{constructor(t){B(this,"geometry");this.geometry=t}get id(){return this.geometry.id}measure(t){return{width:this.geometry.naturalWidth,height:t.bands.bandwidth()+this.geometry.barExtra}}place(t,n){let{visualWidth:r,caption:i,barExtra:o}=this.geometry,s=n.bands.bandwidth(),a=t.x+mn,l={x:a,y:t.y,width:r,height:o>0?s+o:s},{textSpills:c,titleLines:u}=i.fit,f=c?a+r+r2:a+i.leftInset;return{id:this.geometry.id,box:l,textX:f,textSpills:c,titleLines:u}}};function l2(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 c2(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 u2(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function f2(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function d2(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 Sd(e,t,n,r,i){let o=sR(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,l=kk[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:Dr}}}function p2(e,t){let n=ik(e,t.sizes,t.cal),r=nk(re(e,"remaining"),t.sizes,t.cal),i=re(e,"status"),o=l2(i),s=c2(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(re(e,"remaining")??"");return s===0&&o==="in-progress"&&a&&(s=1-Math.max(0,Math.min(100,parseInt(a[1],10)))/100),s===0&&o==="in-progress"&&r>0&&n>0&&(s=Math.max(0,Math.min(1,1-r/n))),{status:o,progress:s}}function h2(e,t,n,r,i,o){let s=re(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),l=n?n.title??n.name:"",c=a?s:l||void 0,u=re(e,"remaining"),f=u2(u,t),d=f2(re(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),T=p();m=T?`${T} \u2014 ${E}% remaining`:`${E}% remaining`}else(d||c)&&(m=p()||void 0);let g=re(e,"capacity"),w=Or(g),x=null,y=0;if(w!==null){let E=Ha(w),T=ja(o,t.symbols);x={value:w,text:E,icon:T};let _=11;y=(m?ye(" ",_):0)+wi(E,T,_)}return{metaText:m,ownerDisplay:d,capacity:x,capacityTrailingWidth:y}}function m2(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 g2(e,t,n){return dl({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Wt(n)!==void 0})}var y2={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function x2(e,t,n){let r=y2[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 E2(e,t,n,r,i){if(n===0)return 0;let o=r-en-Dr-zn,s;e&&t?s=Math.max(Ii,i)+zn:e?s=o:s=Math.max(o,i+zn);let l=s+(n-1)*Yf+Dr+zn+en;return Math.max(0,l-r)}function Nd(e,t,n){let r=e.properties,i=be("item",r,n.styleCtx),o=re(r,"size"),s=o?n.sizes.get(o)??null:null,a=CR(n,e),l=Be(r,"after"),c=Be(r,"before"),u=Math.max(qa,DR(n,t,a)),f=t+u,d=Uy(Math.max(qa,f-t)),p=d2(re(r,"link")),m=p.icon!=="none",g=Uy(u),w=Be(r,"labels"),x=[];for(let z of w){let X=n.labels.get(z);if(!X)continue;let ne=Sd(X,n.styleCtx,0,0);x.push({id:X,width:ne.box.width})}let y=0;for(let z=0;z<x.length;z+=1)z>0&&(y+=Hn),y+=x[z].width;let E=Math.max(0,g-2*Bn),T=x.length>0&&y>E,{status:_,progress:P}=p2(r,n),U=x2(i,_,n.styleCtx.theme),O=h2(r,n,s,_,P,U.capacityIcon),D=e.title??e.name??"",Y=m2(e.name,n),L=BR({title:D,visualWidth:d,metaText:O.metaText,metaTrailingWidth:O.capacityTrailingWidth,hasLinkIcon:m,hasAfterGlyph:Wt(l)!==void 0,titleFirstLineRightReservePx:g2(g,Y,c)}),S=m&&d<qg,R=L.fit.textSpills||S,C=FR(D,L.fit,S),v=T?Ok(x,d):null,b=v?v.rows.length:x.length>0?1:0,A=O.metaText!==void 0||O.capacity!==null,M=jf(C.length,A),N=Vg(C.length,A),F=E2(T,R,b,n.bandScale.bandwidth(),M);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:d,naturalVisualWidth:g,style:U,size:s,status:_,progress:P,meta:O,link:p,chips:{samples:x,outside:T,pack:v,rowCount:b},footnoteIndicators:Y,caption:{...L,title:D,iconSpills:S,lines:C,lastBaseline:M},barExtra:Math.max(N,F)}}function Pd(e,t,n,r){let i=e.properties,o=Be(i,"after"),s=Be(i,"before"),a=By(i,t.x,n),l;n.waves&&(a=Ur(e,a,n),l=PR(e,a,n));let c=l===void 0?OR(i,a,n):void 0,u=n.scale.startX(a),f=r??Nd(e,u,n);if(f.startX!==u)throw new Error(`layout: item "${e.name??e.title??"(unnamed)"}" was measured at x ${f.startX} but placed at x ${u}`);let{naturalWidth:d,style:p,status:m,progress:g,footnoteIndicators:w,caption:x}=f,{metaText:y,ownerDisplay:E,capacity:T,capacityTrailingWidth:_}=f.meta,P=f.link,U=P.icon!=="none",O=f.chips.samples,D=f.chips.outside,Y=u,L=u+d,S=!1,R,C;if(s.length>0){let Ke,ir;for(let Lt of s){let Ss=Te(Lt),Ns=Ss?n.scale.forwardWithinDomain(Ss)??void 0:n.entityLeftEdges.get(Lt);Ns!==void 0&&(Ke===void 0||Ns<Ke)&&(Ke=Ns,ir=Lt)}Ke!==void 0&&L>Ke&&(S=!0,R={x:Ke,y:t.y,width:L-Ke,height:n.bandScale.bandwidth()},C=ir)}let v=x.title,b=new bd(f),A={time:n.scale,bands:n.bandScale,style:p},M=b.place({x:Y,y:t.y},A),N=M.box,F=n.bandScale.bandwidth(),z=N.width<ds,X=x.iconSpills,ne=N.width<Vf,H=M.textSpills||X,te=x.lines,k=f.chips.pack,$=x.lastBaseline,W=f.barExtra,G=[],J=N.y+F-en-Dr-zn,Z=N.y+(D&&H?Math.max(Ii,$):$)+zn,oe=D&&H||!D&&O.length>0?Math.max(J,Z):J,me=D?N.x+N.width+Xn:N.x+Bn,ce=me;if(k)for(let Ke=0;Ke<k.rows.length;Ke+=1){let ir=oe+Ke*Yf,Lt=me;for(let Ns of k.rows[Ke]){let Wx=Sd(Ns.id,n.styleCtx,Lt,ir);G.push(Wx),Lt+=Wx.box.width+Hn}let Ss=Lt-Hn;Ss>ce&&(ce=Ss)}else{let Ke=me;for(let ir of O){let Lt=Sd(ir.id,n.styleCtx,Ke,oe);G.push(Lt),Ke+=Lt.box.width+Hn}ce=O.length>0?Ke-Hn:me}let ue=E??re(i,"owner"),rt=e.description?.text,gt=w.length>0&&ne,yt=N.x+N.width+Xn,rr=!1,hp=null;X&&(rr&&(yt+=Ut),hp=yt,yt=hp+Gn,rr=!0);let Mx=0;if(H){rr&&(yt+=Ut);let Ke=Math.max(...te.map(Lt=>ye(Lt,cl))),ir=(y?ye(y,11):0)+_;Mx=Math.max(Ke,ir),yt+=Mx,rr=!0}let Fx=null;gt&&(rr&&(yt+=Ut),Fx=yt,yt+=w.length*Bt,rr=!0);let mp=null;z&&(rr&&(yt+=Ut),mp=yt+yn,yt=mp+yn,rr=!0);let KS=Math.max(N.x+N.width,yt),bs=e.name;bs&&(n.entityLeftEdges.set(bs,Y),n.entityRightEdges.set(bs,L)),SR(e,N.x+N.width+mn,n);let Bx=bs??Wy(e);n.itemFlowKey.set(Bx,n.currentFlowKey),t.x=L,t.maxX=Math.max(t.maxX,t.x),t.height=Math.max(t.height,n.bandScale.step()+W);let Ux=vR({box:N,afterDate:Wt(o),beforeDate:Wt(s),hasLinkIcon:U,footnoteCount:w.length}),Xr={kind:"item",id:bs,title:v,...te.length>=2||te[0]!==v?{titleLines:te}:{},box:N,status:m,progressFraction:g,footnoteIndicators:w,labelChips:G,chipsOutside:D,chipsRightX:ce,linkIcon:P.icon,linkHref:P.href,hasOverflow:S,overflowBox:R,overflowAnchorId:C,owner:ue,description:rt,metaText:y,textSpills:H,dotSpills:z,iconSpills:X,footnoteSpills:gt,dotSpillCx:mp,iconSpillX:hp,footnoteSpillStartX:Fx,decorationsRightX:KS,capacity:T,size:f.size,style:p,inlineDatePins:Ux.length>0?Ux:void 0},gp=NR(e,n);return gp!==void 0&&(Xr.waveRole=gp),l!==void 0&&(Xr.wavePinOverride=l),c!==void 0&&(Xr.nonWorkingPin=c),gp==="background"&&n.waves&&(Xr.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(Bx,Xr),UR(b,A,Xr),Xr}function Wy(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function WR(e){let t=new Map;for(let n of V0(e))Qe(n)&&t.set(n.name??Wy(n),n);return t}function XR(e,t,n,r){let i=new wd(gR(t,n)),o=[],s=[],a=r.bandScale.bandwidth();for(let[u,f]of e){let d=Be(f.properties,"after"),p=r.placedItems.get(u);if(!p)continue;let m=ER(p,a);for(let g of d){let w=r.placedItems.get(g),x,y=w===void 0;if(w)x=wR(w,a);else{let E=r.entityMidpoints.get(g);if(!E)continue;x={x:E.x,y:m.y}}!y&&Math.abs(x.y-m.y)<.5&&m.x-x.x<20||(o.push({fromId:g,toId:u,from:x,to:m,isMarkerSource:y}),s.push({fromId:g,toId:u}))}}let l=yR(o,i),c=[];for(let u=0;u<l.length;u++){let f=l[u];c.push({fromId:s[u].fromId,toId:s[u].toId,waypoints:f.waypoints,kind:f.underBar?"underBar":"normal",style:be("item",[],r.styleCtx)})}return c}function GR(e){let t=new Map,n=new Map;return[...e.entries()].sort(([i],[o])=>i.localeCompare(o)).forEach(([i,o],s)=>{t.set(i,s+1),n.set(i,Be(o.properties,"on"))}),{index:t,hosts:n}}function zR(e,t,n,r){let i=[];return[...e.entries()].sort(([a],[l])=>a.localeCompare(l)).forEach(([a,l],c)=>{i.push({number:c+1,title:l.title??a,description:l.description?.text,style:be("footnote",l.properties,t.styleCtx)})}),{box:{x:tn,y:n+tn,width:r-2*tn,height:i.length===0?0:nl+i.length*rl+tn},entries:i}}var w2=.8,T2=1;function v2(e){let t=[];return jR(e,t),t}function jR(e,t){for(let n of e)if(n.kind==="item"){let r=_2(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")&&jR(n.children,t)}function _2(e){return e.capacity?e.capacity.value:e.size?1:0}function VR(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=v2(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:k2(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 k2(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function YR(e,t){let n=t.get("swimlane"),r=HR(re(e.properties,"utilization-warn-at"),n?re(n.properties,"utilization-warn-at"):void 0,w2),i=HR(re(e.properties,"utilization-over-at"),n?re(n.properties,"utilization-over-at"):void 0,T2);return{warn:r,over:i}}function HR(e,t,n){let i=R2(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var A2=/^\d+(?:\.\d+)?%$/,I2=/^\d+\.\d+$/;function R2(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(A2.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(I2.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}function Ld(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)Ld(n,t)}function $d(e,t){e.box.y+=t;for(let n of e.children)Ld(n,t);for(let n of e.nested)$d(n,t)}function KR(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)$d(n,t)}var Od=class{constructor(t){B(this,"rows");B(this,"opts");this.opts=t,this.rows=[{y:t.originY,height:t.minRowHeight,rightEdge:t.laneLeftX,spillX:t.laneLeftX,placedChildren:[]}]}placeItem(t){for(let r=0;r<this.rows.length;r+=1){let i=this.rows[r];if(!(t.desiredStart<i.rightEdge)&&!(t.desiredStart<i.spillX)&&!this.rowIntersectsCorridor(i,t))return{rowIndex:r,y:i.y}}let n=this.appendRow(Math.max(this.opts.minRowHeight,t.predictedHeight));return{rowIndex:this.rows.length-1,y:n.y}}placeBlock(){let t=this.rows[this.rows.length-1];if(t.rightEdge>this.opts.laneLeftX){let n=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:n.y}}return{rowIndex:this.rows.length-1,y:t.y}}commitItem(t){let n=this.rows[t.rowIndex],r=Math.max(t.placed.box.height,t.rowHeight??0);this.growRowHeight(t.rowIndex,r),n.rightEdge=t.logicalEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,n.placedChildren.push(t.placed)}commitBlock(t){let n=this.rows[t.rowIndex];this.growRowHeight(t.rowIndex,t.blockHeight),n.rightEdge=t.blockEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,n.placedChildren.push(t.placed)}usedHeight(){let t=this.rows[this.rows.length-1];return t.y+t.height-this.opts.originY}usedRightX(){let t=this.opts.laneLeftX;for(let n of this.rows)n.rightEdge>t&&(t=n.rightEdge),n.spillX>t&&(t=n.spillX);return t}rowIntersectsCorridor(t,n){return this.opts.slackCorridors.some(r=>r.y>=t.y&&r.y<t.y+t.height&&n.desiredStart<r.xEnd&&n.desiredEnd>r.xStart&&r.slackPredId!==n.childId)}appendRow(t){let n=this.rows[this.rows.length-1],r={y:n.y+n.height,height:t,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX,placedChildren:[]};return this.rows.push(r),r}growRowHeight(t,n){let r=this.rows[t],i=n-r.height;if(!(i<=0)){r.height=n;for(let o=t+1;o<this.rows.length;o+=1){let s=this.rows[o];s.y+=i;for(let a of s.placedChildren)Ld(a,i)}}}};function Cd(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new Od({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,l=[];for(let c of Mt(e)){if(!Qe(c)){let U=Sl(c,a,n),{rowIndex:O,y:D}=s.placeBlock(),Y=Nl(U,D),L=r.sequenceOne(c,Y,n);l.push(L);let S=L.box.x+L.box.width,R=Math.max(i,Y.height);s.commitBlock({rowIndex:O,placed:L,blockHeight:R,blockEnd:S,spillReservation:Mk(L)}),a=Math.max(a,S);continue}let u=c,f=Sl(u,a,n),d=n.scale.startX(f),p=Nd(u,d,n),m=d+p.naturalWidth,g=i+p.barExtra,{rowIndex:w,y:x}=s.placeItem({childId:u.name??"",desiredStart:d,desiredEnd:m,predictedHeight:g}),y=Nl(f,x),E=Pd(u,y,n,p);l.push(E);let T=E.box.x+E.box.width+mn;a=Math.max(a,T);let _=null;(E.textSpills||E.chipsOutside||E.dotSpills||E.iconSpills||E.footnoteSpills)&&(_=Math.max(E.decorationsRightX,E.chipsOutside?E.chipsRightX:0)+6),s.commitItem({rowIndex:w,placed:E,logicalEnd:T,spillReservation:_,rowHeight:g})}return{children:l,timeCursorX:a,packer:s}}var qR=10;function b2(e,t,n){let r=re(e.properties,"capacity"),i=Or(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Ha(i),s=ja(t.capacityIcon,n),a=wi(o,s,qR);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var S2=10,N2=38,P2=8;function L2(e,t,n){let r=e.title??e.name??"";if(!r)return 0;let i=re(e.properties,"owner");return ml(0,r,i??void 0,t,n).rightX}function $2(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 O2(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX(Sl(r,t,n))}var ks=class{constructor(t,n){B(this,"input");B(this,"helpers");this.input=t,this.helpers=n}get id(){return this.input.lane.name??""}place(t,n){let{lane:r,bandIndex:i}=this.input,{helpers:o}=this,s=be("swimlane",r.properties,n.styleCtx),a=t.x,l=n.bandScale.step(),c=n.currentFlowKey;n.currentFlowKey=`lane:${r.name??i}`;let{capacity:u,badgeWidthPx:f}=b2(r,s,n.symbols),d=$2(r,n),p=d.length>0?ye(d.join(","),qR):0,m=L2(r,f,p),g=O2(r,a,n),w=!r.title||g===void 0||g>=m+P2,x=t.y+(w?S2:N2),y=Cd(r,{leftX:a,firstRowY:x},n,o),{children:E}=y,T=x-t.y,_=Math.max(l+32,T+y.packer.usedHeight()+16),P=Math.max(y.packer.usedRightX(),m),U={x:0,y:t.y,width:0,height:_},O=re(r.properties,"owner"),D;if(O){let L=n.teams.get(O),S=n.persons.get(O);D=L?.title??S?.title??O}let Y=u?(()=>{let{warn:L,over:S}=YR(r,n.styleCtx.defaults);return VR({children:E,capacityValue:u.value,warnFraction:L,overFraction:S})})():null;return n.currentFlowKey=c,{positioned:{id:r.name,title:r.title??r.name??"",box:U,bandIndex:i,children:E,nested:[],style:s,owner:D,footnoteIndicators:d,capacity:u,utilization:Y},usedHeight:_,usedRightX:P}}};var C2=18,D2=14,M2=14,F2=16,B2=32;function Xy(e,t,n,r){let i=n+C2,o=[],s=!0;for(let a of e){s||(i+=F2),s=!1;let l=a.content.roadmap?.title??a.sourcePath,c=i+D2,u=Id(a,{theme:t.styleCtx.theme,cal:t.cal,schedule:t.schedule,timeline:t.timeline,scale:t.scale,calendar:t.calendar,bandScale:t.bandScale,waves:t.waves},{chartTopY:c,chartBottomY:c,swimlaneBottomY:c},{});t.waves&&Ad(t.waves,u.entityLeftEdges,u.entityRightEdges);let f=[],d=c,p=0;for(let y of a.content.swimlanes.values()){u.nextParallelId=0,u.nextGroupId=0;let{positioned:E,usedHeight:T}=new ks({lane:y,bandIndex:p},r).place({x:u.timeline.originX,y:d},u);f.push(E),d+=T,p++}let m=d,g=Math.max(t.bandScale.bandwidth(),m-i+M2),w={x:0,y:i,width:0,height:g},x={sourcePath:a.sourcePath,label:l,box:w,nestedSwimlanes:f,style:be("swimlane",[],t.styleCtx)};o.push(x),i+=g}return{regions:o,endY:i}}function ZR(e,t){let n=Dd(e,t);e.box.width=n;for(let r of e.nestedSwimlanes)r.box.width=n}function Dd(e,t){let n=e.box.x,{chromeRightX:r}=gl(n,e.label,e.sourcePath),i=_s(e.nestedSwimlanes),o=Math.max(r,i)+B2;return Math.min(t-n,o-n)}function JR(e,t,n){let r=[],i=(o,s,a)=>{let l=Te(re(s.properties,"date"));if(!l)return;let c=n.forwardWithinDomain(l);c!==null&&r.push({id:o,centerX:c,radius:6,title:s.title??o,fontSize:10,bold:a,date:l,isMilestone:a})};for(let[o,s]of e)i(o,s,!1);for(let[o,s]of t)i(o,s,!0);return r}function Md(e,t){return[...W2(e),...X2(t)]}function Fd(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 Hy(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function jy(e){return`working:${e.from.toISOString().slice(0,10)}`}function QR(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function W2(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(QR(Hy(n),n.x,n.label));return t}function X2(e){return(e??[]).map(t=>QR(jy(t),t.x,t.label))}function Bd(e,t,n,r){let i=n;for(let o of e){let s=eb(o,r),a=o.centerX+o.radius+6+s,l=o.centerX-o.radius-6-s;a>n&&l<t&&(i=Math.max(i,a+at))}return i}function eb(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function Ud(e,t,n,r){let i=[...e].sort((a,l)=>a.centerX-l.centerX),o=new Map,s=[];for(let a of i){let l=eb(a,r),c=a.centerX+a.radius+6,u=a.centerX-a.radius-6-l,f=c+l<=n,d=u>=t,p=a.centerX-a.radius,m=a.centerX+a.radius,g=U=>U==="right"?c:u,w=U=>U==="right"?f:d,x=(U,O)=>{let D=Math.min(p,U),Y=Math.max(m,U+l);return s[O].some(L=>L.left<Y&&L.right>D)},y=-1,E="right",T=c;e:for(let U=s.length-1;U>=0;U--)for(let O of["right","left"]){if(!w(O))continue;let D=g(O);if(!x(D,U)){y=U,E=O,T=D;break e}}if(y===-1){for(let[U,O]of o)o.set(U,{...O,rowIndex:O.rowIndex+1});s=[[],...s],y=0,E=f?"right":"left",T=g(E)}let _=Math.min(p,T),P=Math.max(m,T+l);s[y].push({left:_,right:P}),o.set(a.id,{rowIndex:y,labelBox:{x:T,y:0,width:l,height:12},labelSide:E})}return{placements:o,rowCount:s.length}}function Vy(e,t){let n=[];for(let r of e){let i=t.placedItems.get(r),o=i?i.box.x+i.box.width:t.entityRightEdges.get(r);if(o===void 0)continue;let s=i?TR(i,t.bandScale.bandwidth()):t.entityMidpoints.get(r)?.y??0;if(!i&&t.waves?.plan.index.has(r)){n.push({ref:r,x:o,y:s,flowKey:`wave:${r}`,wave:r});continue}let a=t.itemFlowKey.get(r)??`marker:${r}`;n.push({ref:r,x:o,y:s,flowKey:a})}return n}function Yy(e){let t=new Map;for(let n of e){let r=t.get(n.flowKey);(!r||n.x>r.x)&&t.set(n.flowKey,n)}return Array.from(t.values())}function tb(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.x>t.x)&&(t=n);return t}function G2(e,t){let n;for(let r of e)r.wave===void 0||r.x-t<lt||(!n||r.x>n.x)&&(n=r);return n?.wave}var Ky=class{constructor(t,n){B(this,"id");B(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=be("milestone",n.properties,t.styleCtx),i=re(n.properties,"date"),o=Be(n.properties,"after"),s=Te(i),a=t.timeline.markerRow.y,l=6,c=n.title??this.id,u=null,f=a,d=!1,p,m=!1,g;if(s){let y=t.scale.forwardWithinDomain(s);if(y===null)return null;u=y,d=!0;let E=t.markerRowPlacements.get(this.id);E&&(f=E.centerY);let T=Vy(o,t),_=Yy(T),P=tb(_);P&&P.x>y&&(m=!0,p=[{x:P.x,y:P.y>0?P.y:f}]),g=G2(_,y),g!==void 0&&(m=!0)}else if(o.length>0){let y=Vy(o,t),E=Yy(y);E.sort((P,U)=>U.x-P.x);let T=E[0]?.x??t.timeline.originX;u=T,d=!1;let _=[];for(let P=1;P<E.length;P++){let U=E[P];U.x<T&&U.y>0&&U.wave===void 0&&_.push({x:U.x,y:U.y})}_.length>0&&(p=_)}if(u===null)return null;let w={x:u,y:f};t.entityLeftEdges.set(this.id,w.x),t.entityRightEdges.set(this.id,w.x),t.entityMidpoints.set(this.id,w);let x={id:this.id,title:c,x:u,radius:l,fixed:d,slackArrows:p,isOverrun:m,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};return t.waves&&!m&&LR(t.waves,u)&&(x.onWaveBoundary=!0),g!==void 0&&s&&(x.overrunByWave=g,x.overrunDate=Ti(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(x.hiddenDate=Ti(s)),x}};function nb(e,t){let n=[];for(let[r,i]of e){let o=new Ky(r,i).place(t);o&&n.push(o)}return n}function rb(e,t){return e.map(n=>{let r=t.get(n.id);if(!r)throw new Error(`layout: milestone "${n.id}" has no marker-row placement`);let i={id:n.id,title:n.title,center:{x:n.x,y:r.centerY},radius:n.radius,fixed:n.fixed,slackArrows:n.slackArrows,isOverrun:n.isOverrun,style:n.style,cutTopY:n.cutTopY,cutBottomY:n.cutBottomY,labelBox:r.labelBox,labelSide:r.labelSide};return n.onWaveBoundary&&(i.onWaveBoundary=!0),n.overrunByWave!==void 0&&(i.overrunByWave=n.overrunByWave),n.overrunDate!==void 0&&(i.overrunDate=n.overrunDate),n.hiddenDate!==void 0&&(i.hiddenDate=n.hiddenDate),i})}function ib(e,t){let n=[];for(let[r,i]of e){let o=re(i.properties,"date"),s=Be(i.properties,"after"),a=Te(o),l=Vy(s,t),c=Yy(l);if(a){let f=t.scale.forwardWithinDomain(a);if(f===null)continue;let d=tb(c);d&&d.x>f&&d.y>0&&n.push({xStart:Math.min(d.x,f),xEnd:Math.max(d.x,f),y:d.y,slackPredId:d.ref,milestoneId:r});continue}if(c.length===0)continue;c.sort((f,d)=>d.x-f.x);let u=c[0].x;for(let f=1;f<c.length;f++){let d=c[f];d.x<u&&d.y>0&&d.wave===void 0&&n.push({xStart:d.x,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:r})}}return n}function ob(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=Kn(n).nowLabel,l=ye(a,tl),c=Math.max(_g,Math.ceil(l+2*cs)),u=t.timeline.originX-at,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:be("item",[],t.styleCtx)}}function Wd(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 sb(e){let[t,n,r]=Wd(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 Xd(e,t){let n=sb(e),r=sb(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var z2=4.5;function cb(e,t,n,r,i){if(!e.frozen||!e.solve)throw new Error("buildWaves: the wave barrier has not settled");let o=t.timeline.waveStrip;if(!o)throw new Error("buildWaves: the timeline has no wave strip");let s=kd(e.plan,e.solve,e.pass,e.origin,e.floors,lt),a=s.every(y=>y.memberCount===0),l=t.timeline.box.x,c=l+t.timeline.box.width,u=o.y+o.height/2,f=[],d=0,p=s.map((y,E)=>{let T=e.plan.waves[E],_=T.title??y.id,P=y.memberCount===0,U=bl(y.start,t),O=$R(y.start,y.end,t),D=P?void 0:d++,Y=H2(y.id,t),L=j2(T.properties,D,t),S=Math.max(y.start,l),R=Math.min(y.end,c),C=Math.max(0,R-S),v,b=!1;if(!P){if(Y.length>0){let ne=Y.length*Bt;v=ab(_,y.id,E+1,C,ne),b=v!==void 0}v??(v=ab(_,y.id,E+1,C,0))}let A=(S+R)/2,M;if(P&&(A=y.start,!a)){let ne=f.filter(H=>Math.abs(H-y.start)<lt).length;f.push(y.start),A=y.start+ne*Gg,M={x:A,y:u}}let N=P?qy(U):`${qy(U)} \u2013 ${qy(O)}`,F=[_,N];P?F.push(n.waveNoItems):y.heldBy!==void 0&&F.push(`${n.waveHeldBy} ${y.heldBy}`);let z,X=s[E-1];if(!a&&X!==void 0&&y.floorRef!==void 0&&y.start-X.end>lt){let ne=Math.max(X.end,l),H=Math.min(y.start,c);ye(y.floorRef,gn)+2*Fn<=H-ne&&(z={text:y.floorRef,x:(ne+H)/2})}return{id:y.id,title:_,index:E,...D!==void 0?{visibleOrdinal:D}:{},startX:y.start,endX:y.end,startDate:U,endDate:O,memberCount:y.memberCount,empty:P,...y.heldBy!==void 0?{heldBy:y.heldBy}:{},...y.floorRef!==void 0?{floorRef:y.floorRef}:{},columnBox:{x:y.start,y:t.chartTopY,width:y.end-y.start,height:t.swimlaneBottomY-t.chartTopY},strip:{box:{x:y.start,y:o.y,width:y.end-y.start,height:o.height},...v?{label:v.label}:{},labelKind:v?.kind??"none",labelX:A,tooltip:F.join(" \xB7 "),footnotesShown:b,...M?{marker:M}:{},...z?{gapLabel:z}:{}},style:L,footnoteIndicators:Y}}),m=a?[]:K2(p,e.origin,o.y,t),g=Zy(r),w=i.map(y=>Zy(y.nestedSwimlanes)),x={waves:p,boundaries:m,crossings:lb(g,m),regionCrossings:w.map(y=>lb(y,m)),hasBackground:g.length+w.flat().length>0};return a&&(x.placeholder=eR(n,p.map(y=>y.title))),x}function ab(e,t,n,r,i){let o=a=>ye(a,gn)*1.05+i+2*Fn<=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 H2(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 j2(e,t,n){let r=n.styleCtx.theme,i=new Map,o=re(e,"style"),s=o?n.styleCtx.styles.get(o):void 0;for(let d of s?.properties??[])i.set(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?V2(c,l,sl)??c:c,f=i.get("border");return{...l?{tint:l}:{},stripFill:c,text:a("text")??Y2(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var Gd=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function V2(e,t,n){if(!Gd.test(e)||!Gd.test(t))return;let r=Wd(e),i=Wd(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function Y2(e,t){let n=e.labelText;return!Gd.test(n)||!Gd.test(t)||Xd(n,t)>=z2?n:Xd(e.hatch,t)>=Xd(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function K2(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<lt;)a++;let l=i.slice(s,a);s=a;let c=l[0].x;if(Math.abs(c-t)<lt)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 Zy(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(...Zy(r.nested));return t}function lb(e,t){let n=[];for(let r of e){let i=r.box.x,o=r.box.x+r.box.width;for(let s of t)i<s.x&&s.x<o&&n.push({x:s.x,topY:r.box.y,bottomY:r.box.y+r.box.height,stroke:s.stroke})}return n}var q2="\u2070\xB9\xB2\xB3\u2074\u2075\u2076\u2077\u2078\u2079";function Z2(e){return String(e).replace(/[0-9]/g,t=>q2[Number(t)])}function ub(e,t,n,r,i){let{waves:o}=e,s=o.some(_=>!_.empty&&_.strip.labelKind!=="title"),a=o.some(_=>_.empty),l=o.some(_=>_.footnoteIndicators.length>0&&!_.strip.footnotesShown);if(!e.hasBackground&&!s&&!a&&!l)return;let c=gn,u=_=>ye(_,c),f=t.timeline.originX,d=Math.max(f,i-at),p=0,m=f,g=!1,w=0,x=_=>r+_*al+Gf,y=_=>{g&&m+Xf+_>d&&(p++,m=f,g=!1);let P=g?m+Xf:m;return m=P+_,g=!0,w=Math.max(w,m-f),P},E=[],T=(_,P)=>{let U=Uf+zg,O=y(U+u(P)),D=x(p);E.push({kind:_,text:P,swatch:{x:O,y:D-Gf+(al-Wf)/2,width:Uf,height:Wf},runs:[{text:P,x:O+U,y:D}]})};if(e.hasBackground&&T("background",n.waveLegendBackground),e.boundaries.length>0&&T("boundary",n.waveLegendBoundary),s||a||l){let _=o.map(D=>{let Y=`#${D.index+1} ${D.title}`;return D.footnoteIndicators.length>0&&!D.strip.footnotesShown&&(Y+=` ${D.footnoteIndicators.map(Z2).join(",")}`),D.empty&&(Y+=` (${n.waveNoItems})`),Y}),P=" \xB7 ",U=`${n.waveLegendPrefix} ${_[0]}`,O=[{text:U,x:y(u(U)),y:x(p)}];for(let D of _.slice(1)){let Y=O[O.length-1];m+u(P+D)<=d?(Y.text+=P+D,m+=u(P+D),w=Math.max(w,m-f)):(p++,m=f,g=!1,O.push({text:D,x:y(u(D)),y:x(p)}))}E.push({kind:"waves",text:`${n.waveLegendPrefix} ${_.join(P)}`,runs:O})}return{box:{x:f,y:r,width:w,height:(p+1)*al},entries:E}}function qy(e){return e.toISOString().slice(0,10)}var fb=1e-6,As=class{constructor(t){B(this,"domain");B(this,"range");B(this,"pixelsPerDay");B(this,"calendar");B(this,"nonWorking");this.domain=t.domain,this.range=t.range,this.calendar=t.calendar,this.nonWorking=t.nonWorking??"hide";let n=Math.max(1,this.showsNonWorking?kt(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):kt(this.domain[0],t)}dayAt(t){let n=(t-this.range[0])/this.pixelsPerDay;return{days:n,day:Math.floor(n+fb)}}forward(t){return this.showsNonWorking?this.range[0]+kt(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?We(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):We(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=We(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=We(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-fb)-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 zd=6,Q2=4,db=8,jd=class{constructor(t){B(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=eB(t,n,i),a=i?Math.max(Rg,i.height+20):Rg;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?db:a+db,minRowsBottomY:o?s.cardHeight+Q2: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:zd,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 eB(e,t,n){let r=Ig-32,i=ll(e,r,16),o=ll(t??"",r,11),s=0;for(let w of i)s=Math.max(s,ye(w,16));for(let w of o)s=Math.max(s,ye(w,11));let a=i.length>0||o.length>0,l=n?n.width+(a?12:0):0,c=s+32,u=Math.max(Rk-zd,Math.min(Ig-zd,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+zd;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:m,textCardHeight:p,logoSlot:l,boxWidth:g}}var tB=8;function mb(e,t,n,r,i){let{locale:o,styleCtx:s}=r,{calendar:a,preset:l,startDate:c,timelineDays:u,nonWorking:f}=i,d=i.naturalEndDate,p=i.schedule.plan,m=r.roadmapStyle,g=Za[m.headerHeight]??Za.md,w=g>0&&m.timelinePosition!=="bottom",x=g>0&&(m.timelinePosition==="bottom"||m.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",E=re(e.roadmapDecl?.properties??[],"author"),T=new jd({title:y,author:E,style:m,logo:Bk(e,n.logo)}),_=T.measure(),{chartLeftX:P}=_,U=vk({naturalPixelsPerDay:l.pixelsPerUnit/a.daysPerUnit(l.unit),dayCount:u,chromeWidth:P+2*at,maxWidth:n.width}),O=u*U,D=P+at,Y=O,S=n.today!==void 0&&n.today>=c&&n.today<=d?Ft:0,R=w?g:0,C=p?Dg:0,v=new As({domain:[c,d],range:[D,D+O],calendar:a,nonWorking:f}),b=Md($y(v,[],l.unit,!1),Oy(v)),A=t.content.anchors.size+t.content.milestones.size>0||b.length>0,M=D+Y+at,N=JR(t.content.anchors,t.content.milestones,v),F=[...N,...b],z=Ud(F,P,Bd(F,P,M,ye),ye),X=A?Math.max(1,z.rowCount):0,ne=X*26,H=S+R+C+ne,te=H+tB,k=nx(_,H),$=k+S,W=$+R,G=W+C,J=xd(v,l,a,o),Z={box:{x:D,y:k,width:O,height:0},ticks:J,pixelsPerDay:U,originX:D,startDate:c,endDate:d,labelStyle:be("roadmap",[],s),pillRowHeight:S,tickPanelY:$,tickPanelHeight:R,markerRow:{y:G+13,height:ne,collisionY:G-8},minorGrid:m.minorGrid,...p?{waveStrip:{y:W,height:C}}:{}};return rx(Z,v,l.unit),{header:_,headerNode:T,axis:{originX:D,ppd:U,naturalWidth:O,scale:v},naturalChartRightX:M,bands:{timelineY:k,pillRowHeight:S,tickPanelY:$,tickPanelHeight:R,waveStripY:W,markerRowY:G,estimatedMarkerRows:X,rowsHeight:H,chartTopY:k+te,bottomTickPanelHeight:x?g:0},timeline:Z,markers:{datePinned:N,placements:Fd(z.placements,G),hasEntities:A}}}function nx(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function rx(e,t,n){let r=$y(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=Oy(t);i&&(e.workingExceptions=i)}var gb=8,ix=class{constructor(t){B(this,"rightX");B(this,"frozen",!1);this.rightX=t}grow(t){if(this.frozen)throw new Error("layout: the canvas grew after it was frozen");return t<=this.rightX?!1:(this.rightX=t,!0)}freeze(){this.frozen=!0}get provisional(){return this.rightX}get final(){if(!this.frozen)throw new Error("layout: the canvas was read before it was final");return this.rightX}},nB;var Vd=class{constructor(t,n,r,i,o,s,a){B(this,"file");B(this,"resolved");B(this,"options");B(this,"scope");B(this,"window");B(this,"measured");B(this,"chart");B(this,"canvas");B(this,"chartY");B(this,"draft",{});B(this,"scaleIsFinal",!1);B(this,"band");B(this,"rowsTop");B(this,"rowsBottom");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new ix(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=rB(this.measured,this.options.today,this.finalScale())),this.rowsTop}headerRowsBottom(){if(this.rowsBottom===void 0)throw new Error("layout: the header rows bottom was read before the rows grew");return this.rowsBottom}setHeaderRowsBottom(t){if(this.rowsBottom!==void 0)throw new Error("layout: the header rows grew twice");this.rowsBottom=t}report(t,n){nB?.(t,n)}};function rB(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=nx(i,Ft+r.rowsHeight),a=s+Ft,l=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Ft,tickPanelY:a,markerRowY:r.markerRowY+l,shift:l}}function iB(e){return e.canvas.grow(e.chart.maxRightX+at)}function oB(e){let{swimlanes:t,includes:n,milestones:r}=e.chart,{calendar:i,preset:o,startDate:s,spanDays:a,nonWorking:l}=e.window,{originX:c,ppd:u}=e.measured.axis,f=e.measured.timeline,d=_s(t);for(let x of n)d=Math.max(d,_s(x.nestedSwimlanes));for(let x of e.measured.markers.datePinned)d=Math.max(d,x.centerX+x.radius);for(let x of r)d=Math.max(d,x.x+x.radius);let p=i.daysPerUnit(o.unit),m=e.scale.showsNonWorking?e.scale.indexAtX(d):(d-c)/u,g=m>0?yd(s,m,o.unit,p,i):0,w=!1;if(g>a){let x=i.dateAtWorkingIndex(s,g),y=e.scale.showsNonWorking?kt(s,x)*u:g*u,E=new As({domain:[s,x],range:[c,c+y],calendar:i,nonWorking:l});e.extendScale(E),f.endDate=x,f.box.width=y,f.ticks=xd(E,o,i,e.scope.locale),rx(f,E,o.unit),e.canvas.grow(c+y+at),w=!0}return e.settleScale(),w}function sB(e){let t=e.measured.timeline,n=e.measured.markers.datePinned.map(o=>({id:o.id,centerX:o.centerX,radius:o.radius,title:o.title,fontSize:o.fontSize,bold:o.bold}));for(let o of e.chart.milestones)o.fixed||n.push({id:o.id,centerX:o.x,radius:o.radius,title:o.title,fontSize:10,bold:!0});let r=Md(t.nonWorking,t.workingExceptions);n.push(...r),e.draft.markerEntries={all:n,calendarCount:r.length};let i=e.canvas.grow(Bd(n,e.measured.header.chartLeftX,e.canvas.provisional,ye));return e.canvas.freeze(),i}function aB(e){let t=e.canvas.final,n=e.measured.naturalChartRightX,r=e.chart.swimlanes.length>0&&t!==n;for(let i of e.chart.swimlanes)i.box.width=t;for(let i of e.chart.includes)Dd(i,t)!==Dd(i,n)&&(r=!0),ZR(i,t);return r}function lB(e){let t=Xt(e.draft.markerEntries,"the marker entries"),n=Ud(t.all,e.measured.header.chartLeftX,e.canvas.final,ye),r=Fd(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||!vB(a,l))&&(o=!0)}return o}function cB(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=rb(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(Hy(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(jy(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 uB(e){let t=e.markerBand(),n=e.headerRowsTop(),r=e.measured.bands,i=r.estimatedMarkerRows,s=e.ctx.timeline,a=!1;n.pillRowHeight!==r.pillRowHeight&&(s.box.height+=s.box.y-n.timelineY,s.box.y=n.timelineY,s.pillRowHeight=n.pillRowHeight,s.tickPanelY=n.tickPanelY,s.waveStrip&&(s.waveStrip.y+=n.shift),s.markerRow.y+=n.shift,s.markerRow.collisionY+=n.shift,a=!0);let l=n.shift;if(t.rowCount>i&&(l+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height),l===0)return a;s.box.height+=l,e.chartY.top+=l,e.chartY.bottom+=l,e.chartY.swimlaneBottom+=l;for(let c of e.chart.swimlanes)$d(c,l);for(let c of e.chart.includes)KR(c,l);for(let c of Xt(e.draft.milestones,"the milestones"))if(c.cutTopY=e.chartY.top,c.cutBottomY=e.chartY.swimlaneBottom,c.slackArrows)for(let u of c.slackArrows)u.y+=l;return!0}function fB(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+gb,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=gb+t,!0)}function dB(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=cb(t.waves,t,Kn(e.scope.locale),e.chart.swimlanes,e.chart.includes);return n.regionCrossings.forEach((r,i)=>{r.length>0&&(e.chart.includes[i].waveCrossings=r)}),n.placeholder!==void 0&&t.timeline.waveStrip&&(t.timeline.waveStrip.placeholder=n.placeholder),e.draft.waves=n,!0}function pB(e){e.finalScale(),e.markerBand();let t=new Set(Xt(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=hR(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function hB(e){let t=WR(e.chart.laneEntries),n=XR(t,e.chart.swimlanes,e.chart.includes,e.ctx);return e.draft.edges=n,n.length>0}function mB(e){e.finalScale();let t=ob(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function gB(e){let t=e.draft.waves;if(!t)return!1;let n=ub(t,e.ctx,Kn(e.scope.locale),e.chartY.bottom+Bf,e.canvas.final);return n?(e.chartY.bottom+=Bf+n.box.height,e.draft.waveLegend=n,!0):!1}function yB(e){let t=zR(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final);return e.draft.footnotes=t,t.entries.length>0}function xB(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 EB(e){let t=Xt(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-at-Lg,y:r+at,width:Lg,height:Sk};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+at,!0}var wB=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:iB},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:oB},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas"],writes:["markerEntries","canvas"],run:sB},{name:"fitWidths",reads:["placement","canvas"],writes:["laneWidths"],run:aB},{name:"packMarkers",reads:["canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:lB},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:cB},{name:"growHeaderRows",reads:["markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:uB},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:fB},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:dB},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:pB},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:hB},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:mB},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:gB},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:yB},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:xB},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:EB}];function yb(e,t=wB){for(let n of t)e.report(n.name,n.run(e));return TB(e)}function TB(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:Xt(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Xt(t.header,"the header"),attributionBox:Xt(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Xt(t.nowline,"the now-line"),swimlanes:i,anchors:Xt(t.anchors,"the anchors"),milestones:Xt(t.milestones,"the milestones"),edges:Xt(t.edges,"the edges"),footnotes:Xt(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 Xt(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function vB(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 Is=class extends Map{constructor(t,n=AB){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(_B(this,t),n)}delete(t){return super.delete(kB(this,t))}};function xb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function _B({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function kB({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function AB(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Yd(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 Kd(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 qd(){var e=new Is,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 Is;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 qd(t,n).unknown(r)},Kd.apply(i,arguments),i}function Pl(){var e=qd().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=Yd(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 Pl(t(),[r,i]).round(a).paddingInner(l).paddingOuter(c).align(u)},Kd.apply(f(),arguments)}var ox=class e{constructor(t,n,r){B(this,"bandwidthPx");B(this,"stepPx");B(this,"d3");this.bandwidthPx=t,this.stepPx=n,this.d3=r}static fixedRow(t){return new e(t.bandwidth,t.step)}static forRows(t){let n=Array.from({length:t.count},(i,o)=>String(o)),r=Pl().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}},IB={bandwidth:56,step:64};function wb(){return ox.fixedRow(IB)}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,bands:m}=r,g=Id(e,{theme:o,cal:a,schedule:c,timeline:p,scale:d,calendar:l,bandScale:wb(),waves:u?IR(u,d,f,Kn(t.locale).waveBackgroundItem):void 0},{chartTopY:m.chartTopY,chartBottomY:0,swimlaneBottomY:0},{footnotes:GR(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let A of r.markers.datePinned){let M=g.markerRowPlacements.get(A.id);M&&(g.entityLeftEdges.set(A.id,A.centerX),g.entityRightEdges.set(A.id,A.centerX),g.entityMidpoints.set(A.id,{x:A.centerX,y:M.centerY}))}let w=new Map(g.entityLeftEdges),x=new Map(g.entityRightEdges),y=new Map(g.entityMidpoints),E=()=>{g.entityLeftEdges=new Map(w),g.entityRightEdges=new Map(x),g.entityMidpoints=new Map(y),g.placedItems=new Map,g.itemFlowKey=new Map,g.currentFlowKey="",g.waves&&Ad(g.waves,g.entityLeftEdges,g.entityRightEdges)},T=[...e.content.swimlanes.values()],_=be("swimlane",[],s),P=_k[_.spacing]??0,U=()=>{g.nextParallelId=0,g.nextGroupId=0;let A=[],M=g.chartTopY,N=0,F=g.timeline.originX;for(let z of T){N>0&&(M+=P);let{positioned:X,usedHeight:ne,usedRightX:H}=new ks({lane:z,bandIndex:N},i).place({x:g.timeline.originX,y:M},g);A.push(X),M+=ne,H>F&&(F=H),N++}return{swimlanes:A,nextY:M,maxRightX:F}},O=e.content.isolatedRegions,D,Y,L=g.waves;if(L){let A,M=_d(L.ids.length,L.origin,L.floors,(N,F)=>(RR(L,N,F),E(),A=U(),O.length>0&&Xy(O,g,A.nextY+Tb,i),L.pass),lt);bR(L,M),Y={passes:M.passes,capped:M.capped},D=A}else D=U();let S=D.swimlanes,R=D.nextY,C=ib(e.content.milestones,g);C.length>0&&(E(),g.slackCorridors=C,D=U(),S=D.swimlanes,R=D.nextY);let v=[];if(O.length>0){let A=Xy(O,g,R+Tb,i);v=A.regions,R=A.endY}g.chartBottomY=R,g.swimlaneBottomY=R,p.box.height=g.chartBottomY-p.box.y;let b=nb(e.content.milestones,g);return{ctx:g,swimlanes:S,includes:v,milestones:b,laneEntries:T,maxRightX:D.maxRightX,bottomY:R,...Y?{waveSolve:Y}:{}}}var Zd=class{constructor(t,n){B(this,"node");B(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=be("group",r.properties,n.styleCtx),s=Ur(r,t.x,n),a=n.waves!==void 0&&r.title===void 0&&re(r.properties,"wave")!==void 0&&re(r.properties,"style")===void 0&&Be(r.properties,"labels").length===0,l=a?void 0:r.title??r.name,c=n.currentFlowKey;n.nextGroupId+=1,n.currentFlowKey=`${c}/group:${r.name??`group-${n.nextGroupId}`}`;let u=Wt(Be(r.properties,"after")),f=Wt(Be(r.properties,"before")),d=!!(u||f),p=ki(o.bg),g=p&&!!l||p&&d,w=g?_i+yg:0,x=g?Tg:0,y=hl(p,!!l,d),E=t.y+y,T=n.bandScale.step(),P=Cd(r,{leftX:s,firstRowY:E+w},n,i),{children:U,timeCursorX:O}=P,D=Math.max(T,P.packer.usedHeight()),Y=Math.max(O,P.packer.usedRightX()),L=n.scale.showsNonWorking?n.scale.startX(s):s,S=n.scale.showsNonWorking?Math.max(L,Y):Y,R={x:L,y:E,width:S-L,height:w+D+x};t.x=O+Qa,t.maxX=Math.max(t.maxX,t.x);let C=n.bandScale.step()-n.bandScale.bandwidth();t.height=Math.max(t.height,y+R.height+C);let v=r.name;v&&(n.entityLeftEdges.set(v,R.x),n.entityRightEdges.set(v,R.x+R.width)),n.currentFlowKey=c;let b=Td({box:R,afterDate:u,beforeDate:f,row:p?{kind:"title-tab-row",titleTabWidth:l?Ai(l):void 0}:{kind:"header-band",title:l,titleInsetX:hs}});return{kind:"group",id:v,title:l,box:R,children:U,style:o,inlineDatePins:b.length>0?b:void 0,...a?{waveOnly:!0}:{}}}};var Jd=class{constructor(t,n){B(this,"node");B(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=be("parallel",r.properties,n.styleCtx),s=Ur(r,t.x,n),a=Wt(Be(r.properties,"after")),l=Wt(Be(r.properties,"before")),c=r.title??r.name,u=Ck(!!(a||l)),f=t.y+u,d=n.scale.showsNonWorking?n.scale.startX(s):s,p=[],m=d,g=0,w=n.currentFlowKey;n.nextParallelId+=1;let x=r.name??`parallel-${n.nextParallelId}`,y=0;for(let P of r.content){if(P.$type==="DescriptionDirective")continue;n.currentFlowKey=`${w}/par:${x}#${y}`;let U=Nl(s,f+g),O=i.sequenceOne(P,U,n);p.push(O),g+=Math.max(n.bandScale.step(),U.height),m=Math.max(m,U.maxX),y++}n.currentFlowKey=w;let E={x:d,y:f,width:m-d,height:g};t.x=m+Qa,t.maxX=Math.max(t.maxX,t.x),t.height=Math.max(t.height,u+g);let T=r.name;T&&(n.entityLeftEdges.set(T,E.x),n.entityRightEdges.set(T,E.x+E.width));let _=Td({box:E,afterDate:a,beforeDate:l,row:{kind:"header-band",title:c,titleInsetX:ms}});return{kind:"parallel",id:T,title:c,box:E,children:p,style:o,inlineDatePins:_.length>0?_:void 0}}};function RB(e,t,n){return new Jd(e,{sequenceOne:Qd}).place(t,n)}function bB(e,t,n){return new Zd(e,{sequenceOne:Qd}).place(t,n)}function Qd(e,t,n){if(Qe(e))return Pd(e,t,n);if(et(e))return RB(e,t,n);if(Ce(e))return bB(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var ep=class{place(t,n,r,i){let o={sequenceOne:Qd},s=dR(t,n,r),a=pR(t,n,r,s,i),l=mb(t,n,r,s,a),c=vb(n,s,a,l,o);return yb(new Vd(t,n,r,s,a,l,c))}};function Ll(e,t,n={}){let r=Nf(e,t),{config:i,working:o}=r,s=ss(t.content.sizes,i),a=re(e.roadmapDecl?.properties??[],"start"),l=Te(a)??SB(n.today??new Date),c=R=>o.workingIndexOf(l,R),u=R=>o.dateAtWorkingIndex(l,R),f=(R,C)=>Sf(o,l,R,C),d=0,p=R=>{d=Math.max(d,R)},m=new Map,g=new Map,w=new Map,x=new Map,y=new WeakMap,E=new Map,T=new WeakMap,_=new Map;for(let[R,C]of t.content.anchors){let v=Te(re(C.properties,"date"));if(v){let b=c(v);g.set(R,b),_.set(R,v),p(b)}}let P=()=>({itemEnd:m,anchorEnd:g,milestoneEnd:w,sizes:s,itemResults:x,inByNode:!0}),U=(R,C,v)=>{let b=N=>{if("date"in N)return c(N.date);let F=N.ref;return R.itemEnd.has(F)?R.itemEnd.get(F):R.anchorEnd.has(F)?R.anchorEnd.get(F):R.milestoneEnd.has(F)?R.milestoneEnd.get(F):0},A=(N,F)=>{let z=F;for(let X of Mt(N))z=M(X,z),v(z);return z},M=(N,F)=>{if(Qe(N)){let z=rk(N.properties,R.sizes,i),{pin:X,after:ne}=En(N.properties),H=F;X?H=c(X.date):ne.length>0&&(H=Math.max(F,...ne.map(b))),C&&(H=C.apply(N,H));let te=H+z,k={start:u(H),end:f(H,te),days:z};return R.inByNode&&y.set(N,k),N.name&&(R.itemEnd.set(N.name,te),R.itemResults?.set(N.name,k)),C?.accumulate(N,te),te}if(et(N)){let{after:z}=En(N.properties),X=z.length>0?Math.max(F,...z.map(b)):F;C&&(X=C.apply(N,X));let ne=X;for(let H of Mt(N))ne=Math.max(ne,M(H,X));return ne}if(Ce(N)){let{after:z}=En(N.properties),X=z.length>0?Math.max(F,...z.map(b)):F;return C&&(X=C.apply(N,X)),A(N,X)}return F};return{walkLane:A,resolveAfterDay:b}},O=(R,C)=>{let v=Te(re(R.properties,"date"));if(v)return c(v);let{after:b}=En(R.properties);return b.length>0?Math.max(0,...b.map(C)):void 0},D=(R,C)=>{let v=new Map,b=new Map,A=new Map;for(let[F,z]of R.anchors){let X=Te(re(z.properties,"date"));if(X){let ne=c(X);b.set(F,ne),p(ne)}}let{walkLane:M,resolveAfterDay:N}=U({itemEnd:v,anchorEnd:b,milestoneEnd:A,sizes:ss(R.sizes,i),inByNode:C},void 0,p);for(let F of R.swimlanes.values())M(F,0);for(let[F,z]of R.milestones){let X=O(z,N);X!==void 0&&(A.set(F,X),p(X))}for(let F of R.isolatedRegions)D(F.content,!1)},Y=n.plan!==void 0?n.plan??void 0:Ci(t),L;if(Y){let R=Y.waves.map(N=>N.name),C=AR(Y,l,o),v,b=0,A=N=>{b=Math.max(b,N)},M=_d(R.length,0,C,(N,F)=>{let z=R.map((H,te)=>[H,F[te]]);m=new Map(z),x=new Map,y=new WeakMap,b=0;let X=new Di(Y,N),{walkLane:ne}=U(P(),X,A);for(let H of t.content.swimlanes.values())ne(H,0);for(let H of t.content.isolatedRegions){let te=U({itemEnd:new Map(z),anchorEnd:new Map,milestoneEnd:new Map,sizes:ss(H.content.sizes,i),inByNode:!0},X,A);for(let k of H.content.swimlanes.values())te.walkLane(k,0)}return v=X,X});p(Math.max(b,...M.S,...M.E.slice(-1))),L=new Map;for(let N of kd(Y,M,v,0,C))L.set(N.id,{index:N.index,start:u(N.start),end:f(N.start,N.end),memberCount:N.memberCount,...N.heldBy!==void 0?{heldBy:N.heldBy}:{},...N.floorRef!==void 0?{floorRef:N.floorRef}:{}})}else{let{walkLane:R}=U(P(),void 0,p);for(let C of t.content.swimlanes.values())R(C,0)}let{resolveAfterDay:S}=U(P(),void 0,p);for(let[R,C]of t.content.milestones){let v=O(C,S);if(v===void 0)continue;let b=Te(re(C.properties,"date"))??u(v);w.set(R,v),E.set(R,b),T.set(C,b),p(v)}if(!Y)for(let R of t.content.isolatedRegions)D(R.content,!0);return{startDate:l,calendar:r,items:x,byNode:y,milestones:E,milestoneByNode:T,anchors:_,...L?{waves:L}:{},...Y?{plan:Y}:{},resolved:t,extent:{contentEndDay:d}}}function SB(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function sx(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:Ll(e,t,{today:n.today,plan:Ci(t)??null});return new ep().place(e,t,n,r)}function tp(e){return e.toISOString().slice(0,10)}function ax(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 lx(e,t){for(let n of e)n.kind==="item"?t(n):lx(n.children,t)}function NB(e,t,n){let r=ax(e);e.textSpills&&n.push(Gt(t,"NL.I1000","info",{name:r},r)),e.chipsOutside&&n.push(Gt(t,"NL.I1001","info",{name:r},r)),(e.box.width<ds||e.dotSpills||e.iconSpills||e.footnoteSpills)&&n.push(Gt(t,"NL.I1002","info",{name:r},r)),e.hasOverflow&&n.push(Gt(t,"NL.I1003","info",{name:r,anchor:e.overflowAnchorId},r)),_b(e,t,n),kb(e,t,n)}function _b(e,t,n){let r=e.wavePinOverride;if(!r)return;let i=ax(e);n.push(Gt(t,"NL.W1001","warning",{name:i,pin:r.pin,key:r.key,wave:r.wave,start:r.start},i))}function kb(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=ax(e);n.push(Gt(t,"NL.I1008","info",{name:i,pin:r.pin,key:r.key,start:r.start},i))}function Gt(e,t,n,r,i){return{message:jn(e,t,r),severity:n,code:t,entityId:i,lspSeverity:n==="warning"?2:3,data:{code:t,args:r}}}function Ab(e,t,n){let r=e.id??e.title,i=[];lx(e.children,a=>i.push(a));for(let a of i)NB(a,t,n);let o=new Set(i.map(a=>a.box.y));o.size>1&&n.push(Gt(t,"NL.I1004","info",{lane:r,rows:o.size},r)),(e.utilization?.segments.some(a=>a.classification==="red")??!1)&&n.push(Gt(t,"NL.I1005","info",{lane:r},r));for(let a of e.nested)Ab(a,t,n)}function Ib(e,t,n){lx(e.children,r=>{_b(r,t,n),kb(r,t,n)});for(let r of e.nested)Ib(r,t,n)}function PB(e,t,n){e.waveSolve?.capped&&n.push(Gt(t,"NL.W1002","warning",{passes:e.waveSolve.passes}));let r=e.waves??[],i=r.filter(o=>o.empty).map(o=>o.id);if(i.length>0){let o=i.length===r.length?{reason:"all",names:i}:i.length===1?{reason:"one",name:i[0]}:{reason:"many",names:i};n.push(Gt(t,"NL.I1006","info",o,o.reason==="one"?o.name:void 0))}for(let o of e.milestones){if(o.overrunByWave===void 0||o.overrunDate===void 0)continue;let s=r.find(l=>l.id===o.overrunByWave);if(!s)continue;let a=o.id??o.title;n.push(Gt(t,"NL.I1007","info",{name:a,date:o.overrunDate,wave:s.id,end:tp(s.endDate)},a))}}function cx(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)Ab(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)Ib(o,n,r);if(PB(e,n,r),t.today){let i=t.today,o=e.timeline.startDate,s=e.timeline.endDate;(i<o||i>s)&&r.push(Gt(n,"NL.W1000","warning",{date:tp(i),start:tp(o),end:tp(s)}))}return r}var Mi=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function ux(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 Mi(`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 Mi(`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 np(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}))?)$/,bb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function Sb(e){return(st.test(e)||Rb.test(e)||bb.test(e))&&!ze(e.slice(0,10))}function fx(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(Sb(r))return;let i=Te(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 np(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 np(s,{kind:"offset",ms:f})}}return bb.test(r)?Te(r.slice(0,10))??void 0:void 0}return np(n(),t)}}function LB(e){return e===2?"warning":e===3?"info":"error"}function Nb(e,t){return{severity:LB(e.severity),code:ny(e),message:e.message,suggestion:Zf(e.message),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function Pb(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function Lb(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function $b(e,t){let n=e.line!==void 0?e.line+1:1;if(!Fr(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let r=t?Iy(t,e):e.message,i=Zf(r);return{severity:e.severity,code:e.code??Jf(e.message),message:r,...i===void 0?{}:{suggestion:i},file:e.sourcePath,line:n,column:1}}function Ob(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function Cb(e,t){return{severity:e.severity,code:e.code,message:e.message,file:t,line:1,column:1}}var Db="__nowline_browser_noop_include__";async function Mb(e){throw new Error(`${Db}: include "${e}" was skipped \u2014 running in single-file mode.`)}function dx(e){return e.includes(Db)}function Wb(e,t){let n=t==="image/png"?OB(e):t==="image/jpeg"?CB(e):DB(e);return n&&n.width>0&&n.height>0?n:void 0}var $B=[137,80,78,71,13,10,26,10];function px(e,t){return e[t]<<8|e[t+1]}function Fb(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Bb(e,t){return e[t]|e[t+1]<<8}function Ub(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function rp(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function OB(e){if(!(e.length<24||$B.some((t,n)=>e[n]!==t))&&rp(e,12,4)==="IHDR")return{width:Fb(e,16),height:Fb(e,20)}}function CB(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=px(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:px(e,t+7),height:px(e,t+5)};if(r<2)return;t+=2+r}}function DB(e){if(e.length<16||rp(e,0,4)!=="RIFF"||rp(e,8,4)!=="WEBP")return;let t=rp(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:Bb(e,26)&16383,height:Bb(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+Ub(e,24),height:1+Ub(e,27)}}}var MB=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"]),FB=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"]),BB=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"]),UB=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"]),WB=new Set(["none","normal","auto","initial","inherit","unset"]);function XB(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function GB(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var zB=new Set(["x","y","width","height"]);function Gb(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=HB(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}=jB(a);t.push({kind:s?"self":"open",name:l,attrs:c}),n=i+1}return t}function HB(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 jB(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 $l(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function VB(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 zb(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=Gb(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=YB(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($l(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"||GB(p)){d.kind==="open"&&f.push(!1);continue}if(!MB.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=KB(d.attrs??{},a,r),x=Object.keys(w).sort();for(let y of x){let E=w[y];if(g&&t.stripRootSize&&zB.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(XB(y)||y==="class")continue;if(!FB.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let _=VB(E,l);if(_===null){r(`sanitizer: dropping external href ${E}`);continue}m.push(` ${y}="${$l(_)}"`);continue}if(y==="id"){let _=l.get(E);_&&m.push(` id="${$l(_)}"`);continue}let T=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(E.replace(T,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(E)){let _=E.replace(T,(P,U)=>{let O=l.get(U);return O?`url(#${O})`:"none"});m.push(` ${y}="${$l(_)}"`);continue}m.push(` ${y}="${$l(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 Xb(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 ip(e){let t=Gb(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=Xb(n.width),i=Xb(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 Hb(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 YB(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:Hb(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function KB(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(...Hb(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)BB.has(s)?o[s]=a:!s.startsWith("-")&&!UB.has(s)&&!WB.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var qB={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function ZB(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function jb(e,t,n){if(!e||!t)return;let r=ZB(e),i=qB[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"?ip(new TextDecoder().decode(s)):Wb(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 JB=1,QB=0;function eU(){return Oe.parse(`memory:///stage-${++QB}.nowline`)}async function tU(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,eU());return await t.DocumentBuilder.build([n],{validation:!0}),n}function nU(e){return e.origin!=="validation"||e.diagnostic.severity===JB}async function hx(e){let t=await tU(e),n=yl(t);if(n.some(nU))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await py(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource}),o=e.isToleratedIncludeError??(()=>!1),s=i.diagnostics.filter(T=>T.severity==="error"&&!o(T)),a=i.diagnostics.filter(Fr),l=s.find(T=>!Fr(T));if(l)return{kind:"include-error",document:t,legacy:l,routed:[],resolved:i};if(s.length>0)return{kind:"include-error",document:t,routed:a,resolved:i};let c=[],u=await jb(qf(r),e.assetResolver,T=>c.push(T)),{theme:f,today:d,width:p,locale:m,nonWorking:g}=e.layout,w={theme:f,today:d,width:p,locale:m,nonWorking:g},x=Ci(i)??null,y=Ll(r,i,{today:d,plan:x}),E=sx(r,i,{...w,schedule:y,logo:u?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:a,logo:u,warnings:c,plan:x,schedule:y,model:E,layout:w}}var Wr={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"}},rU={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"}},Vb={...Wr,...rU};var roe={none:"",multiplier:"x",person:Wr.person.ascii,people:Wr.people.ascii,points:Wr.points.ascii,time:Wr.time.ascii};var op=class{constructor(t="nl"){B(this,"prefix");B(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};var Yb=/&/g,Kb=/</g,qb=/>/g,iU=/"/g,oU=/'/g;function tt(e){return e.replace(Yb,"&amp;").replace(Kb,"&lt;").replace(qb,"&gt;")}function er(e){return e.replace(Yb,"&amp;").replace(Kb,"&lt;").replace(qb,"&gt;").replace(iU,"&quot;").replace(oU,"&#39;")}function Rs(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}="${er(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function V(e,t,n){return n===void 0||n===""?`<${e}${Rs(t)}/>`:`<${e}${Rs(t)}>${n}</${e}>`}function fe(e,t){return`<text${Rs(e)}>${tt(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var sU={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 aU(e,t){let n=`${e}-shadow-${t}`,r=sU[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 V("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function Zb(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function Jb(e){return["subtle","soft","hard"].map(t=>aU(e,t)).join("")}var lU={thin:100,light:300,normal:400,bold:700};function cU(e){return ls[e]??14}function yx(e,t,n){return{"font-family":t[e.font],"font-size":n??cU(e.textSize),"font-weight":lU[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function uU(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function oS(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 fU(e,t){return oS(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function lp(e,t){return e.length*t*.58}function sS(e,t,n,r,i,o,s){let a=i*.58,l=t?lp(t,i):0,c=t?a:0,u=n+l+c,{text:f,icon:d}=e,p=lp(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return fe({x:h(u),y:h(r),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return fe({x:h(u),y:h(r),...m},`${f}\xD7`);if(d.kind==="builtin"){let w=Wr[d.name],x=fe({x:h(u),y:h(r),...m},f),y=i*.1,E=i,T=u+p+y,_=r-i*.85,P=`<svg x="${h(T)}" y="${h(_)}" width="${h(E)}" height="${h(E)}" viewBox="${w.viewBox}" style="color:${er(s)}" aria-hidden="true">${w.body}</svg>`;return x+P}let g=h(i*.1);return`<text x="${h(u)}" y="${h(r)}" font-family="${er(o)}" font-size="${i}" fill="${er(s)}">${tt(f)}<tspan dx="${g}">${tt(d.text)}</tspan></text>`}var Qb=.6,dU=.5;function pU(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 fe({x:h(r),y:h(i),...l},t);if(!t)return sS(n,void 0,r,i,o,s,a);let c=h(o*Qb),u=`<text x="${h(r)}" y="${h(i)}" font-family="${er(s)}" font-size="${o}" fill="${er(a)}">`,{text:f,icon:d}=n;if(!d)return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+tt(t)+`<tspan dx="${c}">${tt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let P=h(o*.1);return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan><tspan dx="${P}">${tt(d.text)}</tspan></text>`}let p=Wr[d.name],m=P=>P.length*o*dU,g=r+m(t)+o*Qb,w=o*.1,x=o,y=g+m(f)+w,E=i-o*.85,T=u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan></text>`,_=`<svg x="${h(y)}" y="${h(E)}" width="${h(x)}" height="${h(x)}" viewBox="${p.viewBox}" style="color:${er(a)}" aria-hidden="true">${p.body}</svg>`;return T+_}function hU(e,t){let n=Vb.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:${er(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${tt(e.isoDate)}</title>`;return V("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function xx(e,t){return!e||e.length===0?"":e.map(n=>hU(n,t)).join("")}function mU(e){return(e?.length??0)>0}function aS(e){return e?.some(t=>t.side==="after")??!1}function gU(e,t,n,r,i,o={}){let s=Math.min(Ka[i.cornerRadius]??4,r/2);return V("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":uU(i)??null,...o})}function yU(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=V("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:l,stroke:c,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`}),f=i+16+(e.textInset?.x??0),d=o+(e.textInset?.y??0),p=[];e.titleLines.forEach((E,T)=>{p.push(fe({x:h(f),y:h(d+26+T*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},E))});let m=p.join(""),g=d+26+Math.max(0,e.titleLines.length-1)*20,w=n.header.author,x=[];e.authorLines.forEach((E,T)=>{x.push(fe({x:h(f),y:h(g+18+T*14),"font-family":r[e.style.font],"font-size":11,fill:w},E))});let y=x.join("");return V("g",{"data-layer":"header","data-id":`${t}-header`},u+m+y)}function xU(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(V("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(V("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(V("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 V("g",{"data-layer":"grid"},f.join(""))}function lS(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?wx(a,r):a;!l||l.width<=0||l.height<=0||o.push(V("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":Cg}))}return o.length===0?"":V("g",{"data-layer":"non-working"},o.join(""))}function EU(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(V("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(eS(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(eS(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":V("g",{"data-layer":"non-working-label"},i.join(""))}function eS(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"),fe(a,e)}function wU(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(V("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(V("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(V("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(fe({x:h(w.labelX),y:h(a+Ja(l)),"font-family":n.sans,"font-size":vi,fill:o,"text-anchor":"middle"},w.label)),g&&s.push(fe({x:h(w.labelX),y:h(p+Ja(m)),"font-family":n.sans,"font-size":vi,fill:o,"text-anchor":"middle"},w.label))));return V("g",{"data-layer":"timeline"},s.join(""))}function TU(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=V("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Of}),s=vU(e,r),a=_U(e,i,n);return V("g",{"data-layer":"nowline"},o+s+a)}function cS(e){let t=Of/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function vU(e,t){let n=e.pillTopY,r=e.pillTopY+Ft,i=kg,o=e.pillWidth;if(e.pillMode==="center")return V("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Ft),rx:i,ry:i,fill:t});let s=cS(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 V("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 V("path",{d:l,fill:t})}function _U(e,t,n){let r=e.pillTopY+Ag,i=cS(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+cs,s="start"):(o=i-cs,s="end"),fe({x:h(o),y:h(r),"font-family":n.sans,"font-size":tl,"font-weight":700,fill:t,"text-anchor":s},e.label)}function kU(e,t,n,r,i){let o=[];e.waveTooltip!==void 0&&o.push(`<title>${tt(e.waveTooltip)}</title>`);let s=Zb(n,e.style.shadow);o.push(gU(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:s??null})),e.waveRole==="background"&&o.push(jU(e.box,e.style,n));let a=fU(e.style.bg,r),l={done:a.done,"in-progress":a.inProgress,"at-risk":a.atRisk,blocked:a.blocked,planned:a.planned,neutral:a.neutral},c=l[e.status]??l.neutral;if(e.progressFraction>0){let x=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));o.push(V("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-en),width:h(x),height:en,fill:e.style.fg,opacity:.55}))}let u=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-Ri;o.push(V("circle",{cx:h(u),cy:h(e.box.y+Yg),r:yn,fill:c})),o.push(xx(e.inlineDatePins,e.style.fg));let f;if(e.textSpills)f=e.box.x+e.box.width+Xn,e.iconSpills&&(f+=Gn+Ut);else{let x=!!e.linkIcon&&e.linkIcon!=="none",E=e.inlineDatePins?.find(T=>T.side==="after"&&!T.spilled)?fs(x,{barWidth:e.box.width}):fs(!t.noLinks&&x&&!e.iconSpills);f=e.box.x+E}let d=e.style.text,p=r.entities.item.text,m=e.textSpills?p:d,g=e.textSpills?p:e.style.fg,w=e.titleLines??(e.title?[e.title]:[]);if(w.forEach((x,y)=>{x!==""&&o.push(fe({x:h(f),y:h(e.box.y+zf+y*ul),"font-family":i[e.style.font],"font-size":cl,"font-weight":600,fill:m},x))}),(e.metaText||e.capacity)&&o.push(pU({metaText:e.metaText,capacity:e.capacity,x:f,baselineY:e.box.y+Hf(w.length),fontSize:Hg,fontFamily:i[e.style.font],color:g})),e.footnoteIndicators.length>0){let x=e.box.y+Kg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let y=e.footnoteSpillStartX;for(let E=0;E<e.footnoteIndicators.length;E++){let T=e.footnoteIndicators[E];o.push(fe({x:h(y),y:h(x),"font-family":i.sans,"font-size":fl,"font-weight":700,fill:p},String(T))),y+=Bt}}else{let y=e.box.x+e.box.width-us;for(let E=e.footnoteIndicators.length-1;E>=0;E--){let T=e.footnoteIndicators[E];o.push(fe({x:h(y),y:h(x),"font-family":i.sans,"font-size":fl,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(T))),y-=Bt}}}if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let x={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:r.item.linkIconFg},y=x[e.linkIcon]??x.generic,E=Gn,T=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+bi,_=e.box.y+bi,P=V("rect",{x:h(T),y:h(_),width:E,height:E,rx:2,ry:2,fill:y}),U=T,O=_,D=V("path",{d:`M${h(U+4)} ${h(O+10)} L${h(U+10)} ${h(O+4)} M${h(U+6)} ${h(O+4)} H${h(U+10)} V${h(O+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),Y=P+D,L=e.linkHref?V("a",{href:e.linkHref,target:"_blank",rel:"noopener"},Y):Y;o.push(L)}if(e.hasOverflow&&e.overflowBox){let x=r.item.overflowTailFill,y=r.item.overflowTailStroke,E=r.item.overflowCaption;o.push(V("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:x,stroke:y,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&o.push(fe({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:E,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}for(let x of e.labelChips){let y=Math.min(Ka[x.style.cornerRadius]??8,x.box.height/2);o.push(V("rect",{x:h(x.box.x),y:h(x.box.y),width:h(x.box.width),height:h(x.box.height),rx:h(y),ry:h(y),fill:x.style.bg==="none"?"transparent":x.style.bg,stroke:x.style.fg,"stroke-width":.5})),o.push(fe({x:h(x.box.x+x.box.width/2),y:h(x.box.y+x.box.height/2+3),...yx(x.style,i,ls.xs),"text-anchor":"middle"},x.text))}return V("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function AU(e,t,n,r,i){let o=[],s=ki(e.style.bg);if(s){if(o.push(V("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:e.style.bg,stroke:e.style.fg,"stroke-width":1,"fill-opacity":.18,filter:`url(#${n}-shadow-subtle)`})),e.title){let a=Ai(e.title),l=e.box.x,c=e.box.y,u=_i,f=6,d=`M${h(l+f)} ${h(c)}H${h(l+a)}V${h(c+u-f)}A${f} ${f} 0 0 1 ${h(l+a-f)} ${h(c+u)}H${h(l)}V${h(c+f)}A${f} ${f} 0 0 1 ${h(l+f)} ${h(c)}Z`;o.push(V("path",{d,fill:e.style.fg})),o.push(fe({x:h(l+el),y:h(c+xg),"font-family":i[e.style.font],"font-size":Eg,"font-weight":600,fill:"#ffffff"},e.title))}}else{let a=e.style.fg,l=hl(s,!!e.title,mU(e.inlineDatePins));if(e.style.bracket!=="none"&&!e.waveOnly){let u=e.box.y+e.box.height,f=e.style.bracket==="dashed"?"3 2":null,d=l>0?`M${h(e.box.x+4)} ${h(e.box.y-l)} L${h(e.box.x)} ${h(e.box.y-l)} L${h(e.box.x)} ${h(u)} L${h(e.box.x+4)} ${h(u)}`:`M${h(e.box.x)} ${h(e.box.y)} L${h(e.box.x)} ${h(u)} L${h(e.box.x+4)} ${h(u)}`;o.push(V("path",{d,fill:"none",stroke:a,"stroke-width":1,"stroke-dasharray":f}))}e.title&&o.push(fe({x:h(Ni(e.box.x,hs,aS(e.inlineDatePins))),y:h(e.box.y-Kf),...yx(e.style,i,pl),"fill-opacity":.7},e.title))}o.push(xx(e.inlineDatePins,e.style.fg));for(let a of e.children)o.push(Ex(a,t,n,r,i));return V("g",{"data-layer":"group","data-id":e.id??null},o.join(""))}function IU(e,t,n,r,i){let o=[];if(e.style.bracket==="solid"||e.style.bracket==="dashed"){let l=e.box.y-12,c=e.box.y+e.box.height+12,u=e.box.x,f=e.box.x+e.box.width,d=r.parallel.bracketStroke;o.push(V("path",{d:`M${h(u+4)} ${h(l)} H${h(u)} V${h(c)} H${h(u+4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":e.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),o.push(V("path",{d:`M${h(f-4)} ${h(l)} H${h(f)} V${h(c)} H${h(f-4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":e.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}e.title&&o.push(fe({x:h(Ni(e.box.x,ms,aS(e.inlineDatePins))),y:h(e.box.y-Kf),...yx(e.style,i,pl),"fill-opacity":.7},e.title)),o.push(xx(e.inlineDatePins,e.style.fg));for(let s of e.children)o.push(Ex(s,t,n,r,i));return V("g",{"data-layer":"parallel","data-id":e.id??null},o.join(""))}function Ex(e,t,n,r,i){return e.kind==="item"?kU(e,t,n,r,i):e.kind==="group"?AU(e,t,n,r,i):IU(e,t,n,r,i)}var tS=2;function RU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function bU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-tS,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":V("rect",{x:h(i.startX),y:h(n),width:h(o),height:tS,fill:RU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return V("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function SU(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return V("g",{"data-layer":"swimlane-bg","data-id":e.id??null},V("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 uS(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,l=r.swimlane.ownerText,c=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.capacity?wi(e.capacity.text,e.capacity.icon,10):0,p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=p?lp(p,10):0,g=ml(e.box.x,e.title,e.owner,d,m),w=Pf,x=e.box.y+10,y=x+Lf;u.push(V("rect",{x:h(g.tabX),y:h(x),width:h(g.tabW),height:h(w),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(fe({x:h(g.titleX),y:h(y),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(fe({x:h(g.ownerX),y:h(y),"font-family":i[e.style.font],"font-size":10,fill:l},`owner: ${e.owner}`)),e.capacity&&u.push(sS(e.capacity,void 0,g.badgeX,y,10,i[e.style.font],l)),p&&u.push(fe({x:h(g.footnoteRightX),y:h(x+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let f of e.children)u.push(Ex(f,t,n,r,i));return u.push(bU(e,r)),V("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function NU(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,l=V("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?fe(f,e.title):"";return V("g",{"data-layer":"anchor","data-id":e.id??null},fS(e.hiddenDate)+l+d)}function PU(e,t){let n=t.anchorDiamond.cutLine;return V("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 LU(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.fill,a=V("path",{d:`M${h(r)} ${h(i-o)} L${h(r+o)} ${h(i)} L${h(r)} ${h(i+o)} L${h(r-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),l=t.milestoneDiamond.label,c=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(c),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:l};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?fe(u,e.title):"";return V("g",{"data-layer":"milestone","data-id":e.id??null},fS(e.hiddenDate)+a+f)}function fS(e){return e===void 0?"":`<title>${tt(e)}</title>`}function $U(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(V("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":$f,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=n.milestoneDiamond.slack;for(let s of e.slackArrows)i.push(V("path",{d:`M${h(s.x)} ${h(s.y)} H${h(e.center.x-6)}`,fill:"none",stroke:o,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-arrow-dark)`}))}return i.join("")}function nS(e,t,n){let r=e.kind==="overflow"?n.dependency.overflowStroke:n.dependency.edgeStroke,i=e.waypoints;if(i.length<2)return"";let o=e.kind==="underBar"?.8:1.1;return V("path",{d:OU(i,$g),fill:"none",stroke:r,"stroke-width":o,"stroke-dasharray":e.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":`url(#${t}-arrow)`})}function OU(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 CU(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(V("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(fe({x:h(e.box.x+tn),y:h(e.box.y+bg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.y+nl+tn,d=e.box.x+tn,p=d+tn;return e.entries.forEach((m,g)=>{let w=f+g*rl;u.push(fe({x:h(d),y:h(w),"font-family":r.sans,"font-size":10,"font-weight":700,fill:c},String(m.number))),u.push(fe({x:h(p),y:h(w),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},m.title)),m.description&&u.push(fe({x:h(p+Math.max(120,m.title.length*6)),y:h(w),"font-family":r.sans,"font-size":11,fill:l},`\u2014 ${m.description}`))}),V("g",{"data-layer":"footnotes"},u.join(""))}function DU(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=V("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":$f}),E=Pf,T=gl(e.box.x,e.label,e.sourcePath),_=g-E/2,P=V("rect",{x:h(T.tabX),y:h(_),width:h(T.tabWidth),height:E,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),U=fe({x:h(T.tabLabelX),y:h(_+Lf),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),O=T.badgeX,D=T.badgeSize,Y=g-D/2,L=V("rect",{x:h(O),y:h(Y),width:D,height:D,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),S=V("path",{d:`M${h(O+7)} ${h(Y+4)} H${h(O+14)} V${h(Y+11)} M${h(O+4)} ${h(Y+7)} H${h(O+11)} V${h(Y+14)} H${h(O+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),R=9,C=g+4,v=V("rect",{x:h(T.sourceHaloX),y:h(C-R),width:h(T.sourceHaloWidth),height:R+6,fill:a}),b=fe({x:h(T.sourceTextX),y:h(C),"font-family":i.mono,"font-size":R,fill:p},e.sourcePath),A={x:m,y:g,width:w,height:x},M=o?lS(o.timeline,o.chartBox.y,r,A):"",N=o?.waves?mS(o.waves,A)+gS(o.waveBoundaries,A):"",F=o?.waves?yS(e.waveCrossings):"",z=e.nestedSwimlanes.map(X=>uS(X,t,n,r,i)).join("");return V("g",{"data-layer":"include"},y+M+N+z+F+P+U+L+S+v+b)}function MU(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=Cr,a=fe({x:"0",y:s,"font-family":t.sans,"font-size":Df,"font-weight":400,fill:n},Cf)+fe({x:ol,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":700,fill:n},"now")+V("rect",{x:Ng,y:12,width:Pg,height:Cr,fill:r})+fe({x:Mf,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":400,fill:n},"ine"),l=V("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(il)})`},a);return V("a",{href:Sg,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},V("g",{"data-layer":"attribution"},l))}async function FU(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??ip(d)??{width:a,height:l},m=new Set,g=zb(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(", ")}`),V("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=BU(c.bytes);return V("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 BU(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 UU=.24,sp=2,rS=3,WU=4,XU=8,GU=10;function dS(e){return e.bg==="none"?"transparent":e.bg}function cp(e){return oS(e)>=UU?"dark":"light"}function pS(e,t){return`url(#${e}-wave-hatch-${t})`}function zU(e,t,n){let r=Bg;return V("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},V("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":Ug,opacity:Fg}))}function HU(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&t.add(cp(dS(o.style))):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);return e.waveLegend?.entries.some(i=>i.kind==="background")&&t.add(cp(xS(e.palette))),["dark","light"].filter(i=>t.has(i))}function jU(e,t,n){let i=Math.min(Ka[t.cornerRadius]??4,e.height/2);return V("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(i),ry:h(i),fill:pS(n,cp(dS(t)))})}function wx(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 mx=4,ap=.5;function hS(e,t){if(e.empty)return;let n=ap;return wx({x:e.strip.box.x,y:e.strip.box.y+n,width:e.strip.box.width,height:e.strip.box.height-2*n},{x:t.box.x+n,y:e.strip.box.y,width:t.box.width-2*n,height:e.strip.box.height})}function VU(e,t){let n=Math.min(mx-ap,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+ap+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-ap-r?n:0}}function YU(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 gx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?V("path",{d:YU(t,n),...o}):V("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":sl}):i}function KU(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[V("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:mx,ry:mx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=hS(o,n);s&&i.push(V("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${gx(o,s,VU(s,n))}`))}return V("g",{"data-layer":"wave-strip"},i.join(""))}function mS(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?wx(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(V("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":Wg}))}return n.length===0?"":V("g",{"data-layer":"wave-bg"},n.join(""))}function gS(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(V("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":Ff,"stroke-dasharray":r.dash}))}return n.length===0?"":V("g",{"data-layer":"wave-boundary"},n.join(""))}function iS(e,t){let n=lp(e,gn);return t?n*1.05:n}function qU(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+WU,s=i.y+rS,a=i.height-2*rS,l=[],c=(u,f)=>{let d=iS(f,!1)+2*sp;return V("rect",{x:h(u-d/2),y:h(s),width:h(d),height:h(a),fill:t.timeline.panelFill})+fe({x:h(u),y:h(o),"font-family":n.sans,"font-size":gn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},f)};i.placeholder!==void 0&&l.push(c(r.box.x+r.box.width/2,i.placeholder));for(let u of e.waves){if(u.strip.gapLabel){let{text:m,x:g}=u.strip.gapLabel;l.push(c(g,m))}if(u.strip.marker){let{x:m,y:g}=u.strip.marker,w=Xg/2;l.push(V("path",{d:`M${h(m)} ${h(g-w)} L${h(m+w)} ${h(g)} L${h(m)} ${h(g+w)} L${h(m-w)} ${h(g)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${tt(u.strip.tooltip)}</title>`))}let f=hS(u,r);if(!f)continue;let d=f.x+f.width,p=u.strip.footnotesShown?u.footnoteIndicators.length*Bt:0;if(p){let m=d-Fn+sp,g=d-Fn-p-sp;l.push(gx(u,{x:g,y:s,width:m-g,height:a}))}if(u.strip.label!==void 0){let m=iS(u.strip.label,!0),g=p?Math.min(u.strip.labelX,d-Fn-p-m/2):u.strip.labelX,w=m+2*sp;l.push(gx(u,{x:g-w/2,y:s,width:w,height:a})),l.push(fe({x:h(g),y:h(o),"font-family":n.sans,"font-size":gn,"font-weight":600,fill:u.style.text,"text-anchor":"middle"},u.strip.label))}if(u.strip.footnotesShown){let m=d-Fn;for(let g=u.footnoteIndicators.length-1;g>=0;g--)l.push(fe({x:h(m),y:h(i.y+GU),"font-family":n.sans,"font-size":XU,"font-weight":700,fill:u.style.text,"text-anchor":"end"},String(u.footnoteIndicators[g]))),m-=Bt}}return l.length===0?"":V("g",{"data-layer":"wave-labels"},l.join(""))}function yS(e){if(!e||e.length===0)return"";let t=e.map(n=>V("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":Mg}));return V("g",{"data-layer":"wave-cross"},t.join(""))}function xS(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function ZU(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"){let a=xS(n),l={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(V("rect",{...l,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(V("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:pS(t,cp(a))}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(V("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":Ff}))}for(let a of o.runs)i.push(fe({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":gn,fill:n.wave.labelText},a.text))}return V("g",{"data-layer":"wave-legend"},i.join(""))}async function Tx(e,t={}){let r=new op(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??Og,s=[],a=i.arrowhead.neutral,l=i.arrowhead.light,c=i.arrowhead.dark,u=(p,m)=>`<marker id="${p}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${m}"/></marker>`,f=`<defs>${Jb(r)}`+u(`${r}-arrow`,a)+u(`${r}-arrow-light`,l)+u(`${r}-arrow-dark`,c)+HU(e).map(p=>zU(r,p,i)).join("")+"</defs>";s.push(f),s.push(V("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(wU(e.timeline,i,o)),s.push(KU(e,i));for(let p of e.swimlanes)s.push(SU(p,i));s.push(lS(e.timeline,e.chartBox.y,i)),e.waves&&s.push(mS(e.waves)),s.push(xU(e.timeline,e.chartBox.y,i)),s.push(gS(e.waveBoundaries)),s.push(qU(e,i,o));for(let p of e.edges)p.kind==="underBar"&&s.push(nS(p,r,i));for(let p of e.swimlanes)s.push(uS(p,t,r,i,o));for(let p of e.includes)s.push(DU(p,t,r,i,o,e));s.push(yS(e.waveCrossings));for(let p of e.edges)p.kind!=="underBar"&&s.push(nS(p,r,i));for(let p of e.anchors)s.push(PU(p,i));for(let p of e.milestones)s.push($U(p,r,i));s.push(EU(e.timeline,i,o));for(let p of e.anchors)s.push(NU(p,i,o));for(let p of e.milestones)s.push(LU(p,i,o));if(s.push(TU(e.nowline,i,o)),s.push(CU(e.footnotes,r,i,o)),s.push(ZU(e.waveLegend,r,i,o)),s.push(yU(e.header,r,i,o)),s.push(MU(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let p=await FU(e.header.logo,t.assetResolver,r,t);p&&s.push(p)}return`<svg${Rs({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 vx="/browser-source.nowline",JU={error:3,warning:2,info:1},QU={error:3,warning:2,info:1};function ES(e,t){return JU[e]>=QU[t]}var up,wS=0;function TS(){return up||(up=Ay()),up}function eW(){return Oe.parse(`memory:///nowline-browser-${++wS}.nowline`)}async function _x(e,t={}){let n=t.filePath??vx,r=TS(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,eW());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:vS(o,n)}}function vS(e,t){return _S(yl(e),t)}function _S(e,t){return e.map(n=>n.origin==="lexer"?Lb(n.error,t):n.origin==="parser"?Pb(n.error,t):Nb(n.diagnostic,t))}async function kx(e,t={}){let n=t.filePath??vx,r=TS(),i,o;if(t.timezone)try{i=ux(t.timezone)}catch(E){if(!(E instanceof Mi))throw E;o=E}let s=o?void 0:fx({now:t.today,zone:i}),a=await hx({source:e,sourcePath:n,services:r,readSource:t.readFile??Mb,assetResolver:t.assetResolver,isToleratedIncludeError:E=>dx(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:_S(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=vS(a.document,n);for(let E of a.resolved.diagnostics){if(E.severity==="error"&&dx(E.message)){t.onSkippedInclude?.({sourcePath:E.sourcePath,message:E.message});continue}l&&Fr(E)||c.push($b(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=cx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(E=>Cb(E,n)),g=t.showLinks!==!1,w=t.strict===!0,x=await Tx(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=>Ob(E,n,w?"error":"warning"))].filter(E=>ES(E.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function Ax(){up=void 0,wS=0}var kS="/embed.nowline",Ix=!1;async function AS(e){let{ast:t,diagnostics:n}=await _x(e,{filePath:kS});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function fp(e,t={}){let n={filePath:kS,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Ix||(Ix=!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 kx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ol(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ol=class extends Error{constructor(n,r){super(n);B(this,"details",r);this.name="EmbedRenderError"}};function IS(){Ix=!1,Ax()}var rn=Uint8Array,Nt=Uint16Array,Px=Int32Array,Lx=new rn([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]),$x=new rn([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]),RS=new rn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),PS=function(e,t){for(var n=new Nt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Px(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}},LS=PS(Lx,2),tW=LS.b,bx=LS.r;tW[28]=258,bx[258]=28;var $S=PS($x,0),Loe=$S.b,bS=$S.r,Sx=new Nt(32768);for(xe=0;xe<32768;++xe)tr=(xe&43690)>>1|(xe&21845)<<1,tr=(tr&52428)>>2|(tr&13107)<<2,tr=(tr&61680)>>4|(tr&3855)<<4,Sx[xe]=((tr&65280)>>8|(tr&255)<<8)>>1;var tr,xe,Ml=(function(e,t,n){for(var r=e.length,i=0,o=new Nt(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Nt(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Nt(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Sx[f]>>l]=c}else for(a=new Nt(r),i=0;i<r;++i)e[i]&&(a[i]=Sx[s[e[i]-1]++]>>15-e[i]);return a}),Fi=new rn(288);for(xe=0;xe<144;++xe)Fi[xe]=8;var xe;for(xe=144;xe<256;++xe)Fi[xe]=9;var xe;for(xe=256;xe<280;++xe)Fi[xe]=7;var xe;for(xe=280;xe<288;++xe)Fi[xe]=8;var xe,dp=new rn(32);for(xe=0;xe<32;++xe)dp[xe]=5;var xe,nW=Ml(Fi,9,0);var rW=Ml(dp,5,0);var OS=function(e){return(e+7)/8|0},iW=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new rn(e.subarray(t,n))};var nr=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Cl=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},Rx=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:DS,l:0};if(i==1){var s=new rn(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(_,P){return _.f-P.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Nt(d+1),m=Nx(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,x=1<<w;for(o.sort(function(P,U){return p[U.s]-p[P.s]||P.f-U.f});r<i;++r){var y=o[r].s;if(p[y]>t)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 T=o[r].s;p[T]==t&&(--p[T],++g)}m=t}return{t:new rn(p),l:m}},Nx=function(e,t,n){return e.s==-1?Math.max(Nx(e.l,t,n+1),Nx(e.r,t,n+1)):t[e.s]=n},SS=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Nt(++t),r=0,i=e[0],o=1,s=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},Dl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},CS=function(e,t,n){var r=n.length,i=OS(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},NS=function(e,t,n,r,i,o,s,a,l,c,u){nr(t,u++,n),++i[256];for(var f=Rx(i,15),d=f.t,p=f.l,m=Rx(o,15),g=m.t,w=m.l,x=SS(d),y=x.c,E=x.n,T=SS(g),_=T.c,P=T.n,U=new Nt(19),O=0;O<y.length;++O)++U[y[O]&31];for(var O=0;O<_.length;++O)++U[_[O]&31];for(var D=Rx(U,7),Y=D.t,L=D.l,S=19;S>4&&!Y[RS[S-1]];--S);var R=c+5<<3,C=Dl(i,Fi)+Dl(o,dp)+s,v=Dl(i,d)+Dl(o,g)+s+14+3*S+Dl(U,Y)+2*U[16]+3*U[17]+7*U[18];if(l>=0&&R<=C&&R<=v)return CS(t,u,e.subarray(l,l+c));var b,A,M,N;if(nr(t,u,1+(v<C)),u+=2,v<C){b=Ml(d,p,0),A=d,M=Ml(g,w,0),N=g;var F=Ml(Y,L,0);nr(t,u,E-257),nr(t,u+5,P-1),nr(t,u+10,S-4),u+=14;for(var O=0;O<S;++O)nr(t,u+3*O,Y[RS[O]]);u+=3*S;for(var z=[y,_],X=0;X<2;++X)for(var ne=z[X],O=0;O<ne.length;++O){var H=ne[O]&31;nr(t,u,F[H]),u+=Y[H],H>15&&(nr(t,u,ne[O]>>5&127),u+=ne[O]>>12)}}else b=nW,A=Fi,M=rW,N=dp;for(var O=0;O<a;++O){var te=r[O];if(te>255){var H=te>>18&31;Cl(t,u,b[H+257]),u+=A[H+257],H>7&&(nr(t,u,te>>23&31),u+=Lx[H]);var k=te&31;Cl(t,u,M[k]),u+=N[k],k>3&&(Cl(t,u,te>>5&8191),u+=$x[k])}else Cl(t,u,b[te]),u+=A[te]}return Cl(t,u,b[256]),u+A[256]},oW=new Px([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),DS=new rn(0),sW=function(e,t,n,r,i,o){var s=o.z||e.length,a=new rn(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=oW[t-1],d=f>>13,p=f&8191,m=(1<<n)-1,g=o.p||new Nt(32768),w=o.h||new Nt(m+1),x=Math.ceil(n/3),y=2*x,E=function(me){return(e[me]^e[me+1]<<x^e[me+2]<<y)&m},T=new Px(25e3),_=new Nt(288),P=new Nt(32),U=0,O=0,D=o.i||0,Y=0,L=o.w||0,S=0;D+2<s;++D){var R=E(D),C=D&32767,v=w[R];if(g[C]=v,w[R]=C,L<=D){var b=s-D;if((U>7e3||Y>24576)&&(b>423||!c)){u=NS(e,l,0,T,_,P,O,Y,S,D-S,u),Y=U=O=0,S=D;for(var A=0;A<286;++A)_[A]=0;for(var A=0;A<30;++A)P[A]=0}var M=2,N=0,F=p,z=C-v&32767;if(b>2&&R==E(D-z))for(var X=Math.min(d,b)-1,ne=Math.min(32767,D),H=Math.min(258,b);z<=ne&&--F&&C!=v;){if(e[D+M]==e[D+M-z]){for(var te=0;te<H&&e[D+te]==e[D+te-z];++te);if(te>M){if(M=te,N=z,te>X)break;for(var k=Math.min(z,te-2),$=0,A=0;A<k;++A){var W=D-z+A&32767,G=g[W],J=W-G&32767;J>$&&($=J,v=W)}}}C=v,v=g[C],z+=C-v&32767}if(N){T[Y++]=268435456|bx[M]<<18|bS[N];var Z=bx[M]&31,Q=bS[N]&31;O+=Lx[Z]+$x[Q],++_[257+Z],++P[Q],L=D+M,++U}else T[Y++]=e[D],++_[e[D]]}}for(D=Math.max(D,L);D<s;++D)T[Y++]=e[D],++_[e[D]];u=NS(e,l,c,T,_,P,O,Y,S,D-S,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=D,o.w=L)}else{for(var D=o.w||0;D<s+c;D+=65535){var oe=D+65535;oe>=s&&(l[u/8|0]=c,oe=s),u=CS(l,u+1,e.subarray(D,oe))}o.i=s}return iW(a,0,r+OS(u)+i)};var MS=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}}},aW=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new rn(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return sW(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 FS=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var lW=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=MS();i.p(t.dictionary),FS(e,2,i.d())}};function BS(e,t){t||(t={});var n=MS();n.p(e);var r=aW(e,t,t.dictionary?6:2,4);return lW(r,t),FS(r,r.length-4,n.d()),r}var cW=typeof TextDecoder<"u"&&new TextDecoder,uW=0;try{cW.decode(DS,{stream:!0}),uW=1}catch{}var XS="https://free.nowline.io/open";function US(e){let t=new TextEncoder().encode(e),n=BS(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 Ox({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&WS(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",US(e));let r=n===!0?XS:n,i=new URL(r);return t!==void 0&&WS(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${US(e)}`,i.toString()}function WS(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var GS=0;async function zS(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=++GS,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=fW(c);if(!u)continue;let f=dW(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(fp(f,p).then(y=>{if(pW(u,y),r++,m!==null){let E=Ox({source:f,sourceUrl:x,share:s});if(E!==null){let T=t.createElement("a");T.className="nowline-share",T.href=E,T.target="_blank",T.rel="noopener noreferrer",T.textContent="Share on Nowline",m.insertBefore(T,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function fW(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function dW(e){return e.textContent??""}function pW(e,t){e.outerHTML=t}function HS(){GS=0}function pp(){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 jS(e,t){return e&&e!=="auto"?Py(e)??t:t}var hW="0.0.0-dev.20261014154114.g5da7d2a",mW="5da7d2a",gW="pre code.language-nowline, code.language-nowline",VS={theme:"auto",startOnLoad:!0,selector:gW,systemTheme:pp(),share:!0},ke={...VS},Cx=!1;function yW(e={}){ke={theme:e.theme??ke.theme,startOnLoad:e.startOnLoad??ke.startOnLoad,selector:e.selector??ke.selector,locale:e.locale??ke.locale,width:e.width??ke.width,nonWorking:e.nonWorking??ke.nonWorking,today:e.today!==void 0?e.today:ke.today,timezone:e.timezone??ke.timezone,share:e.share??ke.share,sourceUrl:e.sourceUrl??ke.sourceUrl,systemTheme:pp()}}function YS(){return{theme:jS(ke.theme,ke.systemTheme),locale:ke.locale,width:ke.width,nonWorking:ke.nonWorking,today:ke.today,timezone:ke.timezone}}async function xW(e,t={}){let n={...YS(),...t};return fp(e,n)}async function EW(e){return AS(e)}async function Dx(e){let t={selector:e?.selector??ke.selector,theme:e?.theme??YS().theme,locale:e?.locale??ke.locale,width:e?.width??ke.width,nonWorking:e?.nonWorking??ke.nonWorking,today:e?.today!==void 0?e.today:ke.today,timezone:e?.timezone??ke.timezone,share:e?.share??ke.share,sourceUrl:e?.sourceUrl??ke.sourceUrl,document:e?.document};return zS(t)}var wW=Dx;if(typeof document<"u"&&!Cx){Cx=!0;let e=()=>{ke.startOnLoad&&Dx()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function TW(){ke={...VS,systemTheme:pp()},Cx=!1,IS(),HS()}return rN(vW);})();
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 s2(e,t,n,r=t){let i=e,o=MR(e);if(o){if(o.length>=2)return{textSpills:!(n<=t&&o.every((c,u)=>ye(c,Rd)<=(u===0?r:t))),titleLines:o};i=o[0]??""}let s=i.length>0&&ye(i,Rd)>r,a=n>t;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let l=ll(i,t,Rd,r);if(l.length>=2&&l.length<=jg&&l.every((c,u)=>ye(c,Rd)<=(u===0?r:t)))return{textSpills:!1,titleLines:l}}return{textSpills:!0,titleLines:[i]}}function FR(e,t,n){let r=MR(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function BR(e){let{visualWidth:t}=e,n=fs(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-n2),i=o2(e.metaText,e.metaTrailingWidth??0),o=Math.max(0,t-n-(e.titleFirstLineRightReservePx??dl({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1})));return{leftInset:n,fit:s2(e.title,r,i,o)}}var a2;function UR(e,t,n){a2?.(e,t,n)}var bd=class{constructor(t){B(this,"geometry");this.geometry=t}get id(){return this.geometry.id}measure(t){return{width:this.geometry.naturalWidth,height:t.bands.bandwidth()+this.geometry.barExtra}}place(t,n){let{visualWidth:r,caption:i,barExtra:o}=this.geometry,s=n.bands.bandwidth(),a=t.x+mn,l={x:a,y:t.y,width:r,height:o>0?s+o:s},{textSpills:c,titleLines:u}=i.fit,f=c?a+r+r2:a+i.leftInset;return{id:this.geometry.id,box:l,textX:f,textSpills:c,titleLines:u}}};function l2(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 c2(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 u2(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function f2(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function d2(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 Sd(e,t,n,r,i){let o=sR(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,l=kk[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:Dr}}}function p2(e,t){let n=ik(e,t.sizes,t.cal),r=nk(re(e,"remaining"),t.sizes,t.cal),i=re(e,"status"),o=l2(i),s=c2(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(re(e,"remaining")??"");return s===0&&o==="in-progress"&&a&&(s=1-Math.max(0,Math.min(100,parseInt(a[1],10)))/100),s===0&&o==="in-progress"&&r>0&&n>0&&(s=Math.max(0,Math.min(1,1-r/n))),{status:o,progress:s}}function h2(e,t,n,r,i,o){let s=re(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),l=n?n.title??n.name:"",c=a?s:l||void 0,u=re(e,"remaining"),f=u2(u,t),d=f2(re(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),T=p();m=T?`${T} \u2014 ${E}% remaining`:`${E}% remaining`}else(d||c)&&(m=p()||void 0);let g=re(e,"capacity"),w=Or(g),x=null,y=0;if(w!==null){let E=Ha(w),T=ja(o,t.symbols);x={value:w,text:E,icon:T};let _=11;y=(m?ye(" ",_):0)+wi(E,T,_)}return{metaText:m,ownerDisplay:d,capacity:x,capacityTrailingWidth:y}}function m2(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 g2(e,t,n){return dl({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Wt(n)!==void 0})}var y2={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function x2(e,t,n){let r=y2[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 E2(e,t,n,r,i){if(n===0)return 0;let o=r-en-Dr-zn,s;e&&t?s=Math.max(Ii,i)+zn:e?s=o:s=Math.max(o,i+zn);let l=s+(n-1)*Yf+Dr+zn+en;return Math.max(0,l-r)}function Nd(e,t,n){let r=e.properties,i=be("item",r,n.styleCtx),o=re(r,"size"),s=o?n.sizes.get(o)??null:null,a=CR(n,e),l=Be(r,"after"),c=Be(r,"before"),u=Math.max(qa,DR(n,t,a)),f=t+u,d=Uy(Math.max(qa,f-t)),p=d2(re(r,"link")),m=p.icon!=="none",g=Uy(u),w=Be(r,"labels"),x=[];for(let z of w){let X=n.labels.get(z);if(!X)continue;let ne=Sd(X,n.styleCtx,0,0);x.push({id:X,width:ne.box.width})}let y=0;for(let z=0;z<x.length;z+=1)z>0&&(y+=Hn),y+=x[z].width;let E=Math.max(0,g-2*Bn),T=x.length>0&&y>E,{status:_,progress:P}=p2(r,n),U=x2(i,_,n.styleCtx.theme),O=h2(r,n,s,_,P,U.capacityIcon),D=e.title??e.name??"",Y=m2(e.name,n),L=BR({title:D,visualWidth:d,metaText:O.metaText,metaTrailingWidth:O.capacityTrailingWidth,hasLinkIcon:m,hasAfterGlyph:Wt(l)!==void 0,titleFirstLineRightReservePx:g2(g,Y,c)}),S=m&&d<qg,R=L.fit.textSpills||S,C=FR(D,L.fit,S),v=T?Ok(x,d):null,b=v?v.rows.length:x.length>0?1:0,A=O.metaText!==void 0||O.capacity!==null,M=jf(C.length,A),N=Vg(C.length,A),F=E2(T,R,b,n.bandScale.bandwidth(),M);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:d,naturalVisualWidth:g,style:U,size:s,status:_,progress:P,meta:O,link:p,chips:{samples:x,outside:T,pack:v,rowCount:b},footnoteIndicators:Y,caption:{...L,title:D,iconSpills:S,lines:C,lastBaseline:M},barExtra:Math.max(N,F)}}function Pd(e,t,n,r){let i=e.properties,o=Be(i,"after"),s=Be(i,"before"),a=By(i,t.x,n),l;n.waves&&(a=Ur(e,a,n),l=PR(e,a,n));let c=l===void 0?OR(i,a,n):void 0,u=n.scale.startX(a),f=r??Nd(e,u,n);if(f.startX!==u)throw new Error(`layout: item "${e.name??e.title??"(unnamed)"}" was measured at x ${f.startX} but placed at x ${u}`);let{naturalWidth:d,style:p,status:m,progress:g,footnoteIndicators:w,caption:x}=f,{metaText:y,ownerDisplay:E,capacity:T,capacityTrailingWidth:_}=f.meta,P=f.link,U=P.icon!=="none",O=f.chips.samples,D=f.chips.outside,Y=u,L=u+d,S=!1,R,C;if(s.length>0){let Ke,ir;for(let Lt of s){let Ss=Te(Lt),Ns=Ss?n.scale.forwardWithinDomain(Ss)??void 0:n.entityLeftEdges.get(Lt);Ns!==void 0&&(Ke===void 0||Ns<Ke)&&(Ke=Ns,ir=Lt)}Ke!==void 0&&L>Ke&&(S=!0,R={x:Ke,y:t.y,width:L-Ke,height:n.bandScale.bandwidth()},C=ir)}let v=x.title,b=new bd(f),A={time:n.scale,bands:n.bandScale,style:p},M=b.place({x:Y,y:t.y},A),N=M.box,F=n.bandScale.bandwidth(),z=N.width<ds,X=x.iconSpills,ne=N.width<Vf,H=M.textSpills||X,te=x.lines,k=f.chips.pack,$=x.lastBaseline,W=f.barExtra,G=[],J=N.y+F-en-Dr-zn,Z=N.y+(D&&H?Math.max(Ii,$):$)+zn,oe=D&&H||!D&&O.length>0?Math.max(J,Z):J,me=D?N.x+N.width+Xn:N.x+Bn,ce=me;if(k)for(let Ke=0;Ke<k.rows.length;Ke+=1){let ir=oe+Ke*Yf,Lt=me;for(let Ns of k.rows[Ke]){let Wx=Sd(Ns.id,n.styleCtx,Lt,ir);G.push(Wx),Lt+=Wx.box.width+Hn}let Ss=Lt-Hn;Ss>ce&&(ce=Ss)}else{let Ke=me;for(let ir of O){let Lt=Sd(ir.id,n.styleCtx,Ke,oe);G.push(Lt),Ke+=Lt.box.width+Hn}ce=O.length>0?Ke-Hn:me}let ue=E??re(i,"owner"),rt=e.description?.text,gt=w.length>0&&ne,yt=N.x+N.width+Xn,rr=!1,hp=null;X&&(rr&&(yt+=Ut),hp=yt,yt=hp+Gn,rr=!0);let Mx=0;if(H){rr&&(yt+=Ut);let Ke=Math.max(...te.map(Lt=>ye(Lt,cl))),ir=(y?ye(y,11):0)+_;Mx=Math.max(Ke,ir),yt+=Mx,rr=!0}let Fx=null;gt&&(rr&&(yt+=Ut),Fx=yt,yt+=w.length*Bt,rr=!0);let mp=null;z&&(rr&&(yt+=Ut),mp=yt+yn,yt=mp+yn,rr=!0);let KS=Math.max(N.x+N.width,yt),bs=e.name;bs&&(n.entityLeftEdges.set(bs,Y),n.entityRightEdges.set(bs,L)),SR(e,N.x+N.width+mn,n);let Bx=bs??Wy(e);n.itemFlowKey.set(Bx,n.currentFlowKey),t.x=L,t.maxX=Math.max(t.maxX,t.x),t.height=Math.max(t.height,n.bandScale.step()+W);let Ux=vR({box:N,afterDate:Wt(o),beforeDate:Wt(s),hasLinkIcon:U,footnoteCount:w.length}),Xr={kind:"item",id:bs,title:v,...te.length>=2||te[0]!==v?{titleLines:te}:{},box:N,status:m,progressFraction:g,footnoteIndicators:w,labelChips:G,chipsOutside:D,chipsRightX:ce,linkIcon:P.icon,linkHref:P.href,hasOverflow:S,overflowBox:R,overflowAnchorId:C,owner:ue,description:rt,metaText:y,textSpills:H,dotSpills:z,iconSpills:X,footnoteSpills:gt,dotSpillCx:mp,iconSpillX:hp,footnoteSpillStartX:Fx,decorationsRightX:KS,capacity:T,size:f.size,style:p,inlineDatePins:Ux.length>0?Ux:void 0},gp=NR(e,n);return gp!==void 0&&(Xr.waveRole=gp),l!==void 0&&(Xr.wavePinOverride=l),c!==void 0&&(Xr.nonWorkingPin=c),gp==="background"&&n.waves&&(Xr.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(Bx,Xr),UR(b,A,Xr),Xr}function Wy(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function WR(e){let t=new Map;for(let n of V0(e))Qe(n)&&t.set(n.name??Wy(n),n);return t}function XR(e,t,n,r){let i=new wd(gR(t,n)),o=[],s=[],a=r.bandScale.bandwidth();for(let[u,f]of e){let d=Be(f.properties,"after"),p=r.placedItems.get(u);if(!p)continue;let m=ER(p,a);for(let g of d){let w=r.placedItems.get(g),x,y=w===void 0;if(w)x=wR(w,a);else{let E=r.entityMidpoints.get(g);if(!E)continue;x={x:E.x,y:m.y}}!y&&Math.abs(x.y-m.y)<.5&&m.x-x.x<20||(o.push({fromId:g,toId:u,from:x,to:m,isMarkerSource:y}),s.push({fromId:g,toId:u}))}}let l=yR(o,i),c=[];for(let u=0;u<l.length;u++){let f=l[u];c.push({fromId:s[u].fromId,toId:s[u].toId,waypoints:f.waypoints,kind:f.underBar?"underBar":"normal",style:be("item",[],r.styleCtx)})}return c}function GR(e){let t=new Map,n=new Map;return[...e.entries()].sort(([i],[o])=>i.localeCompare(o)).forEach(([i,o],s)=>{t.set(i,s+1),n.set(i,Be(o.properties,"on"))}),{index:t,hosts:n}}function zR(e,t,n,r){let i=[];return[...e.entries()].sort(([a],[l])=>a.localeCompare(l)).forEach(([a,l],c)=>{i.push({number:c+1,title:l.title??a,description:l.description?.text,style:be("footnote",l.properties,t.styleCtx)})}),{box:{x:tn,y:n+tn,width:r-2*tn,height:i.length===0?0:nl+i.length*rl+tn},entries:i}}var w2=.8,T2=1;function v2(e){let t=[];return jR(e,t),t}function jR(e,t){for(let n of e)if(n.kind==="item"){let r=_2(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")&&jR(n.children,t)}function _2(e){return e.capacity?e.capacity.value:e.size?1:0}function VR(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=v2(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:k2(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 k2(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function YR(e,t){let n=t.get("swimlane"),r=HR(re(e.properties,"utilization-warn-at"),n?re(n.properties,"utilization-warn-at"):void 0,w2),i=HR(re(e.properties,"utilization-over-at"),n?re(n.properties,"utilization-over-at"):void 0,T2);return{warn:r,over:i}}function HR(e,t,n){let i=R2(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var A2=/^\d+(?:\.\d+)?%$/,I2=/^\d+\.\d+$/;function R2(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(A2.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(I2.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}function Ld(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)Ld(n,t)}function $d(e,t){e.box.y+=t;for(let n of e.children)Ld(n,t);for(let n of e.nested)$d(n,t)}function KR(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)$d(n,t)}var Od=class{constructor(t){B(this,"rows");B(this,"opts");this.opts=t,this.rows=[{y:t.originY,height:t.minRowHeight,rightEdge:t.laneLeftX,spillX:t.laneLeftX,placedChildren:[]}]}placeItem(t){for(let r=0;r<this.rows.length;r+=1){let i=this.rows[r];if(!(t.desiredStart<i.rightEdge)&&!(t.desiredStart<i.spillX)&&!this.rowIntersectsCorridor(i,t))return{rowIndex:r,y:i.y}}let n=this.appendRow(Math.max(this.opts.minRowHeight,t.predictedHeight));return{rowIndex:this.rows.length-1,y:n.y}}placeBlock(){let t=this.rows[this.rows.length-1];if(t.rightEdge>this.opts.laneLeftX){let n=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:n.y}}return{rowIndex:this.rows.length-1,y:t.y}}commitItem(t){let n=this.rows[t.rowIndex],r=Math.max(t.placed.box.height,t.rowHeight??0);this.growRowHeight(t.rowIndex,r),n.rightEdge=t.logicalEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,n.placedChildren.push(t.placed)}commitBlock(t){let n=this.rows[t.rowIndex];this.growRowHeight(t.rowIndex,t.blockHeight),n.rightEdge=t.blockEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,n.placedChildren.push(t.placed)}usedHeight(){let t=this.rows[this.rows.length-1];return t.y+t.height-this.opts.originY}usedRightX(){let t=this.opts.laneLeftX;for(let n of this.rows)n.rightEdge>t&&(t=n.rightEdge),n.spillX>t&&(t=n.spillX);return t}rowIntersectsCorridor(t,n){return this.opts.slackCorridors.some(r=>r.y>=t.y&&r.y<t.y+t.height&&n.desiredStart<r.xEnd&&n.desiredEnd>r.xStart&&r.slackPredId!==n.childId)}appendRow(t){let n=this.rows[this.rows.length-1],r={y:n.y+n.height,height:t,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX,placedChildren:[]};return this.rows.push(r),r}growRowHeight(t,n){let r=this.rows[t],i=n-r.height;if(!(i<=0)){r.height=n;for(let o=t+1;o<this.rows.length;o+=1){let s=this.rows[o];s.y+=i;for(let a of s.placedChildren)Ld(a,i)}}}};function Cd(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new Od({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,l=[];for(let c of Mt(e)){if(!Qe(c)){let U=Sl(c,a,n),{rowIndex:O,y:D}=s.placeBlock(),Y=Nl(U,D),L=r.sequenceOne(c,Y,n);l.push(L);let S=L.box.x+L.box.width,R=Math.max(i,Y.height);s.commitBlock({rowIndex:O,placed:L,blockHeight:R,blockEnd:S,spillReservation:Mk(L)}),a=Math.max(a,S);continue}let u=c,f=Sl(u,a,n),d=n.scale.startX(f),p=Nd(u,d,n),m=d+p.naturalWidth,g=i+p.barExtra,{rowIndex:w,y:x}=s.placeItem({childId:u.name??"",desiredStart:d,desiredEnd:m,predictedHeight:g}),y=Nl(f,x),E=Pd(u,y,n,p);l.push(E);let T=E.box.x+E.box.width+mn;a=Math.max(a,T);let _=null;(E.textSpills||E.chipsOutside||E.dotSpills||E.iconSpills||E.footnoteSpills)&&(_=Math.max(E.decorationsRightX,E.chipsOutside?E.chipsRightX:0)+6),s.commitItem({rowIndex:w,placed:E,logicalEnd:T,spillReservation:_,rowHeight:g})}return{children:l,timeCursorX:a,packer:s}}var qR=10;function b2(e,t,n){let r=re(e.properties,"capacity"),i=Or(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Ha(i),s=ja(t.capacityIcon,n),a=wi(o,s,qR);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var S2=10,N2=38,P2=8;function L2(e,t,n){let r=e.title??e.name??"";if(!r)return 0;let i=re(e.properties,"owner");return ml(0,r,i??void 0,t,n).rightX}function $2(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 O2(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX(Sl(r,t,n))}var ks=class{constructor(t,n){B(this,"input");B(this,"helpers");this.input=t,this.helpers=n}get id(){return this.input.lane.name??""}place(t,n){let{lane:r,bandIndex:i}=this.input,{helpers:o}=this,s=be("swimlane",r.properties,n.styleCtx),a=t.x,l=n.bandScale.step(),c=n.currentFlowKey;n.currentFlowKey=`lane:${r.name??i}`;let{capacity:u,badgeWidthPx:f}=b2(r,s,n.symbols),d=$2(r,n),p=d.length>0?ye(d.join(","),qR):0,m=L2(r,f,p),g=O2(r,a,n),w=!r.title||g===void 0||g>=m+P2,x=t.y+(w?S2:N2),y=Cd(r,{leftX:a,firstRowY:x},n,o),{children:E}=y,T=x-t.y,_=Math.max(l+32,T+y.packer.usedHeight()+16),P=Math.max(y.packer.usedRightX(),m),U={x:0,y:t.y,width:0,height:_},O=re(r.properties,"owner"),D;if(O){let L=n.teams.get(O),S=n.persons.get(O);D=L?.title??S?.title??O}let Y=u?(()=>{let{warn:L,over:S}=YR(r,n.styleCtx.defaults);return VR({children:E,capacityValue:u.value,warnFraction:L,overFraction:S})})():null;return n.currentFlowKey=c,{positioned:{id:r.name,title:r.title??r.name??"",box:U,bandIndex:i,children:E,nested:[],style:s,owner:D,footnoteIndicators:d,capacity:u,utilization:Y},usedHeight:_,usedRightX:P}}};var C2=18,D2=14,M2=14,F2=16,B2=32;function Xy(e,t,n,r){let i=n+C2,o=[],s=!0;for(let a of e){s||(i+=F2),s=!1;let l=a.content.roadmap?.title??a.sourcePath,c=i+D2,u=Id(a,{theme:t.styleCtx.theme,cal:t.cal,schedule:t.schedule,timeline:t.timeline,scale:t.scale,calendar:t.calendar,bandScale:t.bandScale,waves:t.waves},{chartTopY:c,chartBottomY:c,swimlaneBottomY:c},{});t.waves&&Ad(t.waves,u.entityLeftEdges,u.entityRightEdges);let f=[],d=c,p=0;for(let y of a.content.swimlanes.values()){u.nextParallelId=0,u.nextGroupId=0;let{positioned:E,usedHeight:T}=new ks({lane:y,bandIndex:p},r).place({x:u.timeline.originX,y:d},u);f.push(E),d+=T,p++}let m=d,g=Math.max(t.bandScale.bandwidth(),m-i+M2),w={x:0,y:i,width:0,height:g},x={sourcePath:a.sourcePath,label:l,box:w,nestedSwimlanes:f,style:be("swimlane",[],t.styleCtx)};o.push(x),i+=g}return{regions:o,endY:i}}function ZR(e,t){let n=Dd(e,t);e.box.width=n;for(let r of e.nestedSwimlanes)r.box.width=n}function Dd(e,t){let n=e.box.x,{chromeRightX:r}=gl(n,e.label,e.sourcePath),i=_s(e.nestedSwimlanes),o=Math.max(r,i)+B2;return Math.min(t-n,o-n)}function JR(e,t,n){let r=[],i=(o,s,a)=>{let l=Te(re(s.properties,"date"));if(!l)return;let c=n.forwardWithinDomain(l);c!==null&&r.push({id:o,centerX:c,radius:6,title:s.title??o,fontSize:10,bold:a,date:l,isMilestone:a})};for(let[o,s]of e)i(o,s,!1);for(let[o,s]of t)i(o,s,!0);return r}function Md(e,t){return[...W2(e),...X2(t)]}function Fd(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 Hy(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function jy(e){return`working:${e.from.toISOString().slice(0,10)}`}function QR(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function W2(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(QR(Hy(n),n.x,n.label));return t}function X2(e){return(e??[]).map(t=>QR(jy(t),t.x,t.label))}function Bd(e,t,n,r){let i=n;for(let o of e){let s=eb(o,r),a=o.centerX+o.radius+6+s,l=o.centerX-o.radius-6-s;a>n&&l<t&&(i=Math.max(i,a+at))}return i}function eb(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function Ud(e,t,n,r){let i=[...e].sort((a,l)=>a.centerX-l.centerX),o=new Map,s=[];for(let a of i){let l=eb(a,r),c=a.centerX+a.radius+6,u=a.centerX-a.radius-6-l,f=c+l<=n,d=u>=t,p=a.centerX-a.radius,m=a.centerX+a.radius,g=U=>U==="right"?c:u,w=U=>U==="right"?f:d,x=(U,O)=>{let D=Math.min(p,U),Y=Math.max(m,U+l);return s[O].some(L=>L.left<Y&&L.right>D)},y=-1,E="right",T=c;e:for(let U=s.length-1;U>=0;U--)for(let O of["right","left"]){if(!w(O))continue;let D=g(O);if(!x(D,U)){y=U,E=O,T=D;break e}}if(y===-1){for(let[U,O]of o)o.set(U,{...O,rowIndex:O.rowIndex+1});s=[[],...s],y=0,E=f?"right":"left",T=g(E)}let _=Math.min(p,T),P=Math.max(m,T+l);s[y].push({left:_,right:P}),o.set(a.id,{rowIndex:y,labelBox:{x:T,y:0,width:l,height:12},labelSide:E})}return{placements:o,rowCount:s.length}}function Vy(e,t){let n=[];for(let r of e){let i=t.placedItems.get(r),o=i?i.box.x+i.box.width:t.entityRightEdges.get(r);if(o===void 0)continue;let s=i?TR(i,t.bandScale.bandwidth()):t.entityMidpoints.get(r)?.y??0;if(!i&&t.waves?.plan.index.has(r)){n.push({ref:r,x:o,y:s,flowKey:`wave:${r}`,wave:r});continue}let a=t.itemFlowKey.get(r)??`marker:${r}`;n.push({ref:r,x:o,y:s,flowKey:a})}return n}function Yy(e){let t=new Map;for(let n of e){let r=t.get(n.flowKey);(!r||n.x>r.x)&&t.set(n.flowKey,n)}return Array.from(t.values())}function tb(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.x>t.x)&&(t=n);return t}function G2(e,t){let n;for(let r of e)r.wave===void 0||r.x-t<lt||(!n||r.x>n.x)&&(n=r);return n?.wave}var Ky=class{constructor(t,n){B(this,"id");B(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=be("milestone",n.properties,t.styleCtx),i=re(n.properties,"date"),o=Be(n.properties,"after"),s=Te(i),a=t.timeline.markerRow.y,l=6,c=n.title??this.id,u=null,f=a,d=!1,p,m=!1,g;if(s){let y=t.scale.forwardWithinDomain(s);if(y===null)return null;u=y,d=!0;let E=t.markerRowPlacements.get(this.id);E&&(f=E.centerY);let T=Vy(o,t),_=Yy(T),P=tb(_);P&&P.x>y&&(m=!0,p=[{x:P.x,y:P.y>0?P.y:f}]),g=G2(_,y),g!==void 0&&(m=!0)}else if(o.length>0){let y=Vy(o,t),E=Yy(y);E.sort((P,U)=>U.x-P.x);let T=E[0]?.x??t.timeline.originX;u=T,d=!1;let _=[];for(let P=1;P<E.length;P++){let U=E[P];U.x<T&&U.y>0&&U.wave===void 0&&_.push({x:U.x,y:U.y})}_.length>0&&(p=_)}if(u===null)return null;let w={x:u,y:f};t.entityLeftEdges.set(this.id,w.x),t.entityRightEdges.set(this.id,w.x),t.entityMidpoints.set(this.id,w);let x={id:this.id,title:c,x:u,radius:l,fixed:d,slackArrows:p,isOverrun:m,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};return t.waves&&!m&&LR(t.waves,u)&&(x.onWaveBoundary=!0),g!==void 0&&s&&(x.overrunByWave=g,x.overrunDate=Ti(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(x.hiddenDate=Ti(s)),x}};function nb(e,t){let n=[];for(let[r,i]of e){let o=new Ky(r,i).place(t);o&&n.push(o)}return n}function rb(e,t){return e.map(n=>{let r=t.get(n.id);if(!r)throw new Error(`layout: milestone "${n.id}" has no marker-row placement`);let i={id:n.id,title:n.title,center:{x:n.x,y:r.centerY},radius:n.radius,fixed:n.fixed,slackArrows:n.slackArrows,isOverrun:n.isOverrun,style:n.style,cutTopY:n.cutTopY,cutBottomY:n.cutBottomY,labelBox:r.labelBox,labelSide:r.labelSide};return n.onWaveBoundary&&(i.onWaveBoundary=!0),n.overrunByWave!==void 0&&(i.overrunByWave=n.overrunByWave),n.overrunDate!==void 0&&(i.overrunDate=n.overrunDate),n.hiddenDate!==void 0&&(i.hiddenDate=n.hiddenDate),i})}function ib(e,t){let n=[];for(let[r,i]of e){let o=re(i.properties,"date"),s=Be(i.properties,"after"),a=Te(o),l=Vy(s,t),c=Yy(l);if(a){let f=t.scale.forwardWithinDomain(a);if(f===null)continue;let d=tb(c);d&&d.x>f&&d.y>0&&n.push({xStart:Math.min(d.x,f),xEnd:Math.max(d.x,f),y:d.y,slackPredId:d.ref,milestoneId:r});continue}if(c.length===0)continue;c.sort((f,d)=>d.x-f.x);let u=c[0].x;for(let f=1;f<c.length;f++){let d=c[f];d.x<u&&d.y>0&&d.wave===void 0&&n.push({xStart:d.x,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:r})}}return n}function ob(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=Kn(n).nowLabel,l=ye(a,tl),c=Math.max(_g,Math.ceil(l+2*cs)),u=t.timeline.originX-at,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:be("item",[],t.styleCtx)}}function Wd(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 sb(e){let[t,n,r]=Wd(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 Xd(e,t){let n=sb(e),r=sb(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var z2=4.5;function cb(e,t,n,r,i){if(!e.frozen||!e.solve)throw new Error("buildWaves: the wave barrier has not settled");let o=t.timeline.waveStrip;if(!o)throw new Error("buildWaves: the timeline has no wave strip");let s=kd(e.plan,e.solve,e.pass,e.origin,e.floors,lt),a=s.every(y=>y.memberCount===0),l=t.timeline.box.x,c=l+t.timeline.box.width,u=o.y+o.height/2,f=[],d=0,p=s.map((y,E)=>{let T=e.plan.waves[E],_=T.title??y.id,P=y.memberCount===0,U=bl(y.start,t),O=$R(y.start,y.end,t),D=P?void 0:d++,Y=H2(y.id,t),L=j2(T.properties,D,t),S=Math.max(y.start,l),R=Math.min(y.end,c),C=Math.max(0,R-S),v,b=!1;if(!P){if(Y.length>0){let ne=Y.length*Bt;v=ab(_,y.id,E+1,C,ne),b=v!==void 0}v??(v=ab(_,y.id,E+1,C,0))}let A=(S+R)/2,M;if(P&&(A=y.start,!a)){let ne=f.filter(H=>Math.abs(H-y.start)<lt).length;f.push(y.start),A=y.start+ne*Gg,M={x:A,y:u}}let N=P?qy(U):`${qy(U)} \u2013 ${qy(O)}`,F=[_,N];P?F.push(n.waveNoItems):y.heldBy!==void 0&&F.push(`${n.waveHeldBy} ${y.heldBy}`);let z,X=s[E-1];if(!a&&X!==void 0&&y.floorRef!==void 0&&y.start-X.end>lt){let ne=Math.max(X.end,l),H=Math.min(y.start,c);ye(y.floorRef,gn)+2*Fn<=H-ne&&(z={text:y.floorRef,x:(ne+H)/2})}return{id:y.id,title:_,index:E,...D!==void 0?{visibleOrdinal:D}:{},startX:y.start,endX:y.end,startDate:U,endDate:O,memberCount:y.memberCount,empty:P,...y.heldBy!==void 0?{heldBy:y.heldBy}:{},...y.floorRef!==void 0?{floorRef:y.floorRef}:{},columnBox:{x:y.start,y:t.chartTopY,width:y.end-y.start,height:t.swimlaneBottomY-t.chartTopY},strip:{box:{x:y.start,y:o.y,width:y.end-y.start,height:o.height},...v?{label:v.label}:{},labelKind:v?.kind??"none",labelX:A,tooltip:F.join(" \xB7 "),footnotesShown:b,...M?{marker:M}:{},...z?{gapLabel:z}:{}},style:L,footnoteIndicators:Y}}),m=a?[]:K2(p,e.origin,o.y,t),g=Zy(r),w=i.map(y=>Zy(y.nestedSwimlanes)),x={waves:p,boundaries:m,crossings:lb(g,m),regionCrossings:w.map(y=>lb(y,m)),hasBackground:g.length+w.flat().length>0};return a&&(x.placeholder=eR(n,p.map(y=>y.title))),x}function ab(e,t,n,r,i){let o=a=>ye(a,gn)*1.05+i+2*Fn<=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 H2(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 j2(e,t,n){let r=n.styleCtx.theme,i=new Map,o=re(e,"style"),s=o?n.styleCtx.styles.get(o):void 0;for(let d of s?.properties??[])i.set(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?V2(c,l,sl)??c:c,f=i.get("border");return{...l?{tint:l}:{},stripFill:c,text:a("text")??Y2(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var Gd=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function V2(e,t,n){if(!Gd.test(e)||!Gd.test(t))return;let r=Wd(e),i=Wd(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function Y2(e,t){let n=e.labelText;return!Gd.test(n)||!Gd.test(t)||Xd(n,t)>=z2?n:Xd(e.hatch,t)>=Xd(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function K2(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<lt;)a++;let l=i.slice(s,a);s=a;let c=l[0].x;if(Math.abs(c-t)<lt)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 Zy(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(...Zy(r.nested));return t}function lb(e,t){let n=[];for(let r of e){let i=r.box.x,o=r.box.x+r.box.width;for(let s of t)i<s.x&&s.x<o&&n.push({x:s.x,topY:r.box.y,bottomY:r.box.y+r.box.height,stroke:s.stroke})}return n}var q2="\u2070\xB9\xB2\xB3\u2074\u2075\u2076\u2077\u2078\u2079";function Z2(e){return String(e).replace(/[0-9]/g,t=>q2[Number(t)])}function ub(e,t,n,r,i){let{waves:o}=e,s=o.some(_=>!_.empty&&_.strip.labelKind!=="title"),a=o.some(_=>_.empty),l=o.some(_=>_.footnoteIndicators.length>0&&!_.strip.footnotesShown);if(!e.hasBackground&&!s&&!a&&!l)return;let c=gn,u=_=>ye(_,c),f=t.timeline.originX,d=Math.max(f,i-at),p=0,m=f,g=!1,w=0,x=_=>r+_*al+Gf,y=_=>{g&&m+Xf+_>d&&(p++,m=f,g=!1);let P=g?m+Xf:m;return m=P+_,g=!0,w=Math.max(w,m-f),P},E=[],T=(_,P)=>{let U=Uf+zg,O=y(U+u(P)),D=x(p);E.push({kind:_,text:P,swatch:{x:O,y:D-Gf+(al-Wf)/2,width:Uf,height:Wf},runs:[{text:P,x:O+U,y:D}]})};if(e.hasBackground&&T("background",n.waveLegendBackground),e.boundaries.length>0&&T("boundary",n.waveLegendBoundary),s||a||l){let _=o.map(D=>{let Y=`#${D.index+1} ${D.title}`;return D.footnoteIndicators.length>0&&!D.strip.footnotesShown&&(Y+=` ${D.footnoteIndicators.map(Z2).join(",")}`),D.empty&&(Y+=` (${n.waveNoItems})`),Y}),P=" \xB7 ",U=`${n.waveLegendPrefix} ${_[0]}`,O=[{text:U,x:y(u(U)),y:x(p)}];for(let D of _.slice(1)){let Y=O[O.length-1];m+u(P+D)<=d?(Y.text+=P+D,m+=u(P+D),w=Math.max(w,m-f)):(p++,m=f,g=!1,O.push({text:D,x:y(u(D)),y:x(p)}))}E.push({kind:"waves",text:`${n.waveLegendPrefix} ${_.join(P)}`,runs:O})}return{box:{x:f,y:r,width:w,height:(p+1)*al},entries:E}}function qy(e){return e.toISOString().slice(0,10)}var fb=1e-6,As=class{constructor(t){B(this,"domain");B(this,"range");B(this,"pixelsPerDay");B(this,"calendar");B(this,"nonWorking");this.domain=t.domain,this.range=t.range,this.calendar=t.calendar,this.nonWorking=t.nonWorking??"hide";let n=Math.max(1,this.showsNonWorking?kt(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):kt(this.domain[0],t)}dayAt(t){let n=(t-this.range[0])/this.pixelsPerDay;return{days:n,day:Math.floor(n+fb)}}forward(t){return this.showsNonWorking?this.range[0]+kt(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?We(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):We(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=We(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=We(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-fb)-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 zd=6,Q2=4,db=8,jd=class{constructor(t){B(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=eB(t,n,i),a=i?Math.max(Rg,i.height+20):Rg;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?db:a+db,minRowsBottomY:o?s.cardHeight+Q2: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:zd,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 eB(e,t,n){let r=Ig-32,i=ll(e,r,16),o=ll(t??"",r,11),s=0;for(let w of i)s=Math.max(s,ye(w,16));for(let w of o)s=Math.max(s,ye(w,11));let a=i.length>0||o.length>0,l=n?n.width+(a?12:0):0,c=s+32,u=Math.max(Rk-zd,Math.min(Ig-zd,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+zd;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:m,textCardHeight:p,logoSlot:l,boxWidth:g}}var tB=8;function mb(e,t,n,r,i){let{locale:o,styleCtx:s}=r,{calendar:a,preset:l,startDate:c,timelineDays:u,nonWorking:f}=i,d=i.naturalEndDate,p=i.schedule.plan,m=r.roadmapStyle,g=Za[m.headerHeight]??Za.md,w=g>0&&m.timelinePosition!=="bottom",x=g>0&&(m.timelinePosition==="bottom"||m.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",E=re(e.roadmapDecl?.properties??[],"author"),T=new jd({title:y,author:E,style:m,logo:Bk(e,n.logo)}),_=T.measure(),{chartLeftX:P}=_,U=vk({naturalPixelsPerDay:l.pixelsPerUnit/a.daysPerUnit(l.unit),dayCount:u,chromeWidth:P+2*at,maxWidth:n.width}),O=u*U,D=P+at,Y=O,S=n.today!==void 0&&n.today>=c&&n.today<=d?Ft:0,R=w?g:0,C=p?Dg:0,v=new As({domain:[c,d],range:[D,D+O],calendar:a,nonWorking:f}),b=Md($y(v,[],l.unit,!1),Oy(v)),A=t.content.anchors.size+t.content.milestones.size>0||b.length>0,M=D+Y+at,N=JR(t.content.anchors,t.content.milestones,v),F=[...N,...b],z=Ud(F,P,Bd(F,P,M,ye),ye),X=A?Math.max(1,z.rowCount):0,ne=X*26,H=S+R+C+ne,te=H+tB,k=nx(_,H),$=k+S,W=$+R,G=W+C,J=xd(v,l,a,o),Z={box:{x:D,y:k,width:O,height:0},ticks:J,pixelsPerDay:U,originX:D,startDate:c,endDate:d,labelStyle:be("roadmap",[],s),pillRowHeight:S,tickPanelY:$,tickPanelHeight:R,markerRow:{y:G+13,height:ne,collisionY:G-8},minorGrid:m.minorGrid,...p?{waveStrip:{y:W,height:C}}:{}};return rx(Z,v,l.unit),{header:_,headerNode:T,axis:{originX:D,ppd:U,naturalWidth:O,scale:v},naturalChartRightX:M,bands:{timelineY:k,pillRowHeight:S,tickPanelY:$,tickPanelHeight:R,waveStripY:W,markerRowY:G,estimatedMarkerRows:X,rowsHeight:H,chartTopY:k+te,bottomTickPanelHeight:x?g:0},timeline:Z,markers:{datePinned:N,placements:Fd(z.placements,G),hasEntities:A}}}function nx(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function rx(e,t,n){let r=$y(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=Oy(t);i&&(e.workingExceptions=i)}var gb=8,ix=class{constructor(t){B(this,"rightX");B(this,"frozen",!1);this.rightX=t}grow(t){if(this.frozen)throw new Error("layout: the canvas grew after it was frozen");return t<=this.rightX?!1:(this.rightX=t,!0)}freeze(){this.frozen=!0}get provisional(){return this.rightX}get final(){if(!this.frozen)throw new Error("layout: the canvas was read before it was final");return this.rightX}},nB;var Vd=class{constructor(t,n,r,i,o,s,a){B(this,"file");B(this,"resolved");B(this,"options");B(this,"scope");B(this,"window");B(this,"measured");B(this,"chart");B(this,"canvas");B(this,"chartY");B(this,"draft",{});B(this,"scaleIsFinal",!1);B(this,"band");B(this,"rowsTop");B(this,"rowsBottom");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new ix(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=rB(this.measured,this.options.today,this.finalScale())),this.rowsTop}headerRowsBottom(){if(this.rowsBottom===void 0)throw new Error("layout: the header rows bottom was read before the rows grew");return this.rowsBottom}setHeaderRowsBottom(t){if(this.rowsBottom!==void 0)throw new Error("layout: the header rows grew twice");this.rowsBottom=t}report(t,n){nB?.(t,n)}};function rB(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=nx(i,Ft+r.rowsHeight),a=s+Ft,l=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Ft,tickPanelY:a,markerRowY:r.markerRowY+l,shift:l}}function iB(e){return e.canvas.grow(e.chart.maxRightX+at)}function oB(e){let{swimlanes:t,includes:n,milestones:r}=e.chart,{calendar:i,preset:o,startDate:s,spanDays:a,nonWorking:l}=e.window,{originX:c,ppd:u}=e.measured.axis,f=e.measured.timeline,d=_s(t);for(let x of n)d=Math.max(d,_s(x.nestedSwimlanes));for(let x of e.measured.markers.datePinned)d=Math.max(d,x.centerX+x.radius);for(let x of r)d=Math.max(d,x.x+x.radius);let p=i.daysPerUnit(o.unit),m=e.scale.showsNonWorking?e.scale.indexAtX(d):(d-c)/u,g=m>0?yd(s,m,o.unit,p,i):0,w=!1;if(g>a){let x=i.dateAtWorkingIndex(s,g),y=e.scale.showsNonWorking?kt(s,x)*u:g*u,E=new As({domain:[s,x],range:[c,c+y],calendar:i,nonWorking:l});e.extendScale(E),f.endDate=x,f.box.width=y,f.ticks=xd(E,o,i,e.scope.locale),rx(f,E,o.unit),e.canvas.grow(c+y+at),w=!0}return e.settleScale(),w}function sB(e){let t=e.measured.timeline,n=e.measured.markers.datePinned.map(o=>({id:o.id,centerX:o.centerX,radius:o.radius,title:o.title,fontSize:o.fontSize,bold:o.bold}));for(let o of e.chart.milestones)o.fixed||n.push({id:o.id,centerX:o.x,radius:o.radius,title:o.title,fontSize:10,bold:!0});let r=Md(t.nonWorking,t.workingExceptions);n.push(...r),e.draft.markerEntries={all:n,calendarCount:r.length};let i=e.canvas.grow(Bd(n,e.measured.header.chartLeftX,e.canvas.provisional,ye));return e.canvas.freeze(),i}function aB(e){let t=e.canvas.final,n=e.measured.naturalChartRightX,r=e.chart.swimlanes.length>0&&t!==n;for(let i of e.chart.swimlanes)i.box.width=t;for(let i of e.chart.includes)Dd(i,t)!==Dd(i,n)&&(r=!0),ZR(i,t);return r}function lB(e){let t=Xt(e.draft.markerEntries,"the marker entries"),n=Ud(t.all,e.measured.header.chartLeftX,e.canvas.final,ye),r=Fd(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||!vB(a,l))&&(o=!0)}return o}function cB(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=rb(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(Hy(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(jy(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 uB(e){let t=e.markerBand(),n=e.headerRowsTop(),r=e.measured.bands,i=r.estimatedMarkerRows,s=e.ctx.timeline,a=!1;n.pillRowHeight!==r.pillRowHeight&&(s.box.height+=s.box.y-n.timelineY,s.box.y=n.timelineY,s.pillRowHeight=n.pillRowHeight,s.tickPanelY=n.tickPanelY,s.waveStrip&&(s.waveStrip.y+=n.shift),s.markerRow.y+=n.shift,s.markerRow.collisionY+=n.shift,a=!0);let l=n.shift;if(t.rowCount>i&&(l+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height),l===0)return a;s.box.height+=l,e.chartY.top+=l,e.chartY.bottom+=l,e.chartY.swimlaneBottom+=l;for(let c of e.chart.swimlanes)$d(c,l);for(let c of e.chart.includes)KR(c,l);for(let c of Xt(e.draft.milestones,"the milestones"))if(c.cutTopY=e.chartY.top,c.cutBottomY=e.chartY.swimlaneBottom,c.slackArrows)for(let u of c.slackArrows)u.y+=l;return!0}function fB(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+gb,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=gb+t,!0)}function dB(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=cb(t.waves,t,Kn(e.scope.locale),e.chart.swimlanes,e.chart.includes);return n.regionCrossings.forEach((r,i)=>{r.length>0&&(e.chart.includes[i].waveCrossings=r)}),n.placeholder!==void 0&&t.timeline.waveStrip&&(t.timeline.waveStrip.placeholder=n.placeholder),e.draft.waves=n,!0}function pB(e){e.finalScale(),e.markerBand();let t=new Set(Xt(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=hR(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function hB(e){let t=WR(e.chart.laneEntries),n=XR(t,e.chart.swimlanes,e.chart.includes,e.ctx);return e.draft.edges=n,n.length>0}function mB(e){e.finalScale();let t=ob(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function gB(e){let t=e.draft.waves;if(!t)return!1;let n=ub(t,e.ctx,Kn(e.scope.locale),e.chartY.bottom+Bf,e.canvas.final);return n?(e.chartY.bottom+=Bf+n.box.height,e.draft.waveLegend=n,!0):!1}function yB(e){let t=zR(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final);return e.draft.footnotes=t,t.entries.length>0}function xB(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 EB(e){let t=Xt(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-at-Lg,y:r+at,width:Lg,height:Sk};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+at,!0}var wB=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:iB},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:oB},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas"],writes:["markerEntries","canvas"],run:sB},{name:"fitWidths",reads:["placement","canvas"],writes:["laneWidths"],run:aB},{name:"packMarkers",reads:["canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:lB},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:cB},{name:"growHeaderRows",reads:["markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:uB},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:fB},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:dB},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:pB},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:hB},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:mB},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:gB},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:yB},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:xB},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:EB}];function yb(e,t=wB){for(let n of t)e.report(n.name,n.run(e));return TB(e)}function TB(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:Xt(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Xt(t.header,"the header"),attributionBox:Xt(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Xt(t.nowline,"the now-line"),swimlanes:i,anchors:Xt(t.anchors,"the anchors"),milestones:Xt(t.milestones,"the milestones"),edges:Xt(t.edges,"the edges"),footnotes:Xt(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 Xt(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function vB(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 Is=class extends Map{constructor(t,n=AB){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(_B(this,t),n)}delete(t){return super.delete(kB(this,t))}};function xb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function _B({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function kB({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function AB(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Yd(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 Kd(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 qd(){var e=new Is,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 Is;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 qd(t,n).unknown(r)},Kd.apply(i,arguments),i}function Pl(){var e=qd().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=Yd(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 Pl(t(),[r,i]).round(a).paddingInner(l).paddingOuter(c).align(u)},Kd.apply(f(),arguments)}var ox=class e{constructor(t,n,r){B(this,"bandwidthPx");B(this,"stepPx");B(this,"d3");this.bandwidthPx=t,this.stepPx=n,this.d3=r}static fixedRow(t){return new e(t.bandwidth,t.step)}static forRows(t){let n=Array.from({length:t.count},(i,o)=>String(o)),r=Pl().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}},IB={bandwidth:56,step:64};function wb(){return ox.fixedRow(IB)}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,bands:m}=r,g=Id(e,{theme:o,cal:a,schedule:c,timeline:p,scale:d,calendar:l,bandScale:wb(),waves:u?IR(u,d,f,Kn(t.locale).waveBackgroundItem):void 0},{chartTopY:m.chartTopY,chartBottomY:0,swimlaneBottomY:0},{footnotes:GR(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let A of r.markers.datePinned){let M=g.markerRowPlacements.get(A.id);M&&(g.entityLeftEdges.set(A.id,A.centerX),g.entityRightEdges.set(A.id,A.centerX),g.entityMidpoints.set(A.id,{x:A.centerX,y:M.centerY}))}let w=new Map(g.entityLeftEdges),x=new Map(g.entityRightEdges),y=new Map(g.entityMidpoints),E=()=>{g.entityLeftEdges=new Map(w),g.entityRightEdges=new Map(x),g.entityMidpoints=new Map(y),g.placedItems=new Map,g.itemFlowKey=new Map,g.currentFlowKey="",g.waves&&Ad(g.waves,g.entityLeftEdges,g.entityRightEdges)},T=[...e.content.swimlanes.values()],_=be("swimlane",[],s),P=_k[_.spacing]??0,U=()=>{g.nextParallelId=0,g.nextGroupId=0;let A=[],M=g.chartTopY,N=0,F=g.timeline.originX;for(let z of T){N>0&&(M+=P);let{positioned:X,usedHeight:ne,usedRightX:H}=new ks({lane:z,bandIndex:N},i).place({x:g.timeline.originX,y:M},g);A.push(X),M+=ne,H>F&&(F=H),N++}return{swimlanes:A,nextY:M,maxRightX:F}},O=e.content.isolatedRegions,D,Y,L=g.waves;if(L){let A,M=_d(L.ids.length,L.origin,L.floors,(N,F)=>(RR(L,N,F),E(),A=U(),O.length>0&&Xy(O,g,A.nextY+Tb,i),L.pass),lt);bR(L,M),Y={passes:M.passes,capped:M.capped},D=A}else D=U();let S=D.swimlanes,R=D.nextY,C=ib(e.content.milestones,g);C.length>0&&(E(),g.slackCorridors=C,D=U(),S=D.swimlanes,R=D.nextY);let v=[];if(O.length>0){let A=Xy(O,g,R+Tb,i);v=A.regions,R=A.endY}g.chartBottomY=R,g.swimlaneBottomY=R,p.box.height=g.chartBottomY-p.box.y;let b=nb(e.content.milestones,g);return{ctx:g,swimlanes:S,includes:v,milestones:b,laneEntries:T,maxRightX:D.maxRightX,bottomY:R,...Y?{waveSolve:Y}:{}}}var Zd=class{constructor(t,n){B(this,"node");B(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=be("group",r.properties,n.styleCtx),s=Ur(r,t.x,n),a=n.waves!==void 0&&r.title===void 0&&re(r.properties,"wave")!==void 0&&re(r.properties,"style")===void 0&&Be(r.properties,"labels").length===0,l=a?void 0:r.title??r.name,c=n.currentFlowKey;n.nextGroupId+=1,n.currentFlowKey=`${c}/group:${r.name??`group-${n.nextGroupId}`}`;let u=Wt(Be(r.properties,"after")),f=Wt(Be(r.properties,"before")),d=!!(u||f),p=ki(o.bg),g=p&&!!l||p&&d,w=g?_i+yg:0,x=g?Tg:0,y=hl(p,!!l,d),E=t.y+y,T=n.bandScale.step(),P=Cd(r,{leftX:s,firstRowY:E+w},n,i),{children:U,timeCursorX:O}=P,D=Math.max(T,P.packer.usedHeight()),Y=Math.max(O,P.packer.usedRightX()),L=n.scale.showsNonWorking?n.scale.startX(s):s,S=n.scale.showsNonWorking?Math.max(L,Y):Y,R={x:L,y:E,width:S-L,height:w+D+x};t.x=O+Qa,t.maxX=Math.max(t.maxX,t.x);let C=n.bandScale.step()-n.bandScale.bandwidth();t.height=Math.max(t.height,y+R.height+C);let v=r.name;v&&(n.entityLeftEdges.set(v,R.x),n.entityRightEdges.set(v,R.x+R.width)),n.currentFlowKey=c;let b=Td({box:R,afterDate:u,beforeDate:f,row:p?{kind:"title-tab-row",titleTabWidth:l?Ai(l):void 0}:{kind:"header-band",title:l,titleInsetX:hs}});return{kind:"group",id:v,title:l,box:R,children:U,style:o,inlineDatePins:b.length>0?b:void 0,...a?{waveOnly:!0}:{}}}};var Jd=class{constructor(t,n){B(this,"node");B(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=be("parallel",r.properties,n.styleCtx),s=Ur(r,t.x,n),a=Wt(Be(r.properties,"after")),l=Wt(Be(r.properties,"before")),c=r.title??r.name,u=Ck(!!(a||l)),f=t.y+u,d=n.scale.showsNonWorking?n.scale.startX(s):s,p=[],m=d,g=0,w=n.currentFlowKey;n.nextParallelId+=1;let x=r.name??`parallel-${n.nextParallelId}`,y=0;for(let P of r.content){if(P.$type==="DescriptionDirective")continue;n.currentFlowKey=`${w}/par:${x}#${y}`;let U=Nl(s,f+g),O=i.sequenceOne(P,U,n);p.push(O),g+=Math.max(n.bandScale.step(),U.height),m=Math.max(m,U.maxX),y++}n.currentFlowKey=w;let E={x:d,y:f,width:m-d,height:g};t.x=m+Qa,t.maxX=Math.max(t.maxX,t.x),t.height=Math.max(t.height,u+g);let T=r.name;T&&(n.entityLeftEdges.set(T,E.x),n.entityRightEdges.set(T,E.x+E.width));let _=Td({box:E,afterDate:a,beforeDate:l,row:{kind:"header-band",title:c,titleInsetX:ms}});return{kind:"parallel",id:T,title:c,box:E,children:p,style:o,inlineDatePins:_.length>0?_:void 0}}};function RB(e,t,n){return new Jd(e,{sequenceOne:Qd}).place(t,n)}function bB(e,t,n){return new Zd(e,{sequenceOne:Qd}).place(t,n)}function Qd(e,t,n){if(Qe(e))return Pd(e,t,n);if(et(e))return RB(e,t,n);if(Ce(e))return bB(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var ep=class{place(t,n,r,i){let o={sequenceOne:Qd},s=dR(t,n,r),a=pR(t,n,r,s,i),l=mb(t,n,r,s,a),c=vb(n,s,a,l,o);return yb(new Vd(t,n,r,s,a,l,c))}};function Ll(e,t,n={}){let r=Nf(e,t),{config:i,working:o}=r,s=ss(t.content.sizes,i),a=re(e.roadmapDecl?.properties??[],"start"),l=Te(a)??SB(n.today??new Date),c=R=>o.workingIndexOf(l,R),u=R=>o.dateAtWorkingIndex(l,R),f=(R,C)=>Sf(o,l,R,C),d=0,p=R=>{d=Math.max(d,R)},m=new Map,g=new Map,w=new Map,x=new Map,y=new WeakMap,E=new Map,T=new WeakMap,_=new Map;for(let[R,C]of t.content.anchors){let v=Te(re(C.properties,"date"));if(v){let b=c(v);g.set(R,b),_.set(R,v),p(b)}}let P=()=>({itemEnd:m,anchorEnd:g,milestoneEnd:w,sizes:s,itemResults:x,inByNode:!0}),U=(R,C,v)=>{let b=N=>{if("date"in N)return c(N.date);let F=N.ref;return R.itemEnd.has(F)?R.itemEnd.get(F):R.anchorEnd.has(F)?R.anchorEnd.get(F):R.milestoneEnd.has(F)?R.milestoneEnd.get(F):0},A=(N,F)=>{let z=F;for(let X of Mt(N))z=M(X,z),v(z);return z},M=(N,F)=>{if(Qe(N)){let z=rk(N.properties,R.sizes,i),{pin:X,after:ne}=En(N.properties),H=F;X?H=c(X.date):ne.length>0&&(H=Math.max(F,...ne.map(b))),C&&(H=C.apply(N,H));let te=H+z,k={start:u(H),end:f(H,te),days:z};return R.inByNode&&y.set(N,k),N.name&&(R.itemEnd.set(N.name,te),R.itemResults?.set(N.name,k)),C?.accumulate(N,te),te}if(et(N)){let{after:z}=En(N.properties),X=z.length>0?Math.max(F,...z.map(b)):F;C&&(X=C.apply(N,X));let ne=X;for(let H of Mt(N))ne=Math.max(ne,M(H,X));return ne}if(Ce(N)){let{after:z}=En(N.properties),X=z.length>0?Math.max(F,...z.map(b)):F;return C&&(X=C.apply(N,X)),A(N,X)}return F};return{walkLane:A,resolveAfterDay:b}},O=(R,C)=>{let v=Te(re(R.properties,"date"));if(v)return c(v);let{after:b}=En(R.properties);return b.length>0?Math.max(0,...b.map(C)):void 0},D=(R,C)=>{let v=new Map,b=new Map,A=new Map;for(let[F,z]of R.anchors){let X=Te(re(z.properties,"date"));if(X){let ne=c(X);b.set(F,ne),p(ne)}}let{walkLane:M,resolveAfterDay:N}=U({itemEnd:v,anchorEnd:b,milestoneEnd:A,sizes:ss(R.sizes,i),inByNode:C},void 0,p);for(let F of R.swimlanes.values())M(F,0);for(let[F,z]of R.milestones){let X=O(z,N);X!==void 0&&(A.set(F,X),p(X))}for(let F of R.isolatedRegions)D(F.content,!1)},Y=n.plan!==void 0?n.plan??void 0:Ci(t),L;if(Y){let R=Y.waves.map(N=>N.name),C=AR(Y,l,o),v,b=0,A=N=>{b=Math.max(b,N)},M=_d(R.length,0,C,(N,F)=>{let z=R.map((H,te)=>[H,F[te]]);m=new Map(z),x=new Map,y=new WeakMap,b=0;let X=new Di(Y,N),{walkLane:ne}=U(P(),X,A);for(let H of t.content.swimlanes.values())ne(H,0);for(let H of t.content.isolatedRegions){let te=U({itemEnd:new Map(z),anchorEnd:new Map,milestoneEnd:new Map,sizes:ss(H.content.sizes,i),inByNode:!0},X,A);for(let k of H.content.swimlanes.values())te.walkLane(k,0)}return v=X,X});p(Math.max(b,...M.S,...M.E.slice(-1))),L=new Map;for(let N of kd(Y,M,v,0,C))L.set(N.id,{index:N.index,start:u(N.start),end:f(N.start,N.end),memberCount:N.memberCount,...N.heldBy!==void 0?{heldBy:N.heldBy}:{},...N.floorRef!==void 0?{floorRef:N.floorRef}:{}})}else{let{walkLane:R}=U(P(),void 0,p);for(let C of t.content.swimlanes.values())R(C,0)}let{resolveAfterDay:S}=U(P(),void 0,p);for(let[R,C]of t.content.milestones){let v=O(C,S);if(v===void 0)continue;let b=Te(re(C.properties,"date"))??u(v);w.set(R,v),E.set(R,b),T.set(C,b),p(v)}if(!Y)for(let R of t.content.isolatedRegions)D(R.content,!0);return{startDate:l,calendar:r,items:x,byNode:y,milestones:E,milestoneByNode:T,anchors:_,...L?{waves:L}:{},...Y?{plan:Y}:{},resolved:t,extent:{contentEndDay:d}}}function SB(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function sx(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:Ll(e,t,{today:n.today,plan:Ci(t)??null});return new ep().place(e,t,n,r)}function tp(e){return e.toISOString().slice(0,10)}function ax(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 lx(e,t){for(let n of e)n.kind==="item"?t(n):lx(n.children,t)}function NB(e,t,n){let r=ax(e);e.textSpills&&n.push(Gt(t,"NL.I1000","info",{name:r},r)),e.chipsOutside&&n.push(Gt(t,"NL.I1001","info",{name:r},r)),(e.box.width<ds||e.dotSpills||e.iconSpills||e.footnoteSpills)&&n.push(Gt(t,"NL.I1002","info",{name:r},r)),e.hasOverflow&&n.push(Gt(t,"NL.I1003","info",{name:r,anchor:e.overflowAnchorId},r)),_b(e,t,n),kb(e,t,n)}function _b(e,t,n){let r=e.wavePinOverride;if(!r)return;let i=ax(e);n.push(Gt(t,"NL.W1001","warning",{name:i,pin:r.pin,key:r.key,wave:r.wave,start:r.start},i))}function kb(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=ax(e);n.push(Gt(t,"NL.I1008","info",{name:i,pin:r.pin,key:r.key,start:r.start},i))}function Gt(e,t,n,r,i){return{message:jn(e,t,r),severity:n,code:t,entityId:i,lspSeverity:n==="warning"?2:3,data:{code:t,args:r}}}function Ab(e,t,n){let r=e.id??e.title,i=[];lx(e.children,a=>i.push(a));for(let a of i)NB(a,t,n);let o=new Set(i.map(a=>a.box.y));o.size>1&&n.push(Gt(t,"NL.I1004","info",{lane:r,rows:o.size},r)),(e.utilization?.segments.some(a=>a.classification==="red")??!1)&&n.push(Gt(t,"NL.I1005","info",{lane:r},r));for(let a of e.nested)Ab(a,t,n)}function Ib(e,t,n){lx(e.children,r=>{_b(r,t,n),kb(r,t,n)});for(let r of e.nested)Ib(r,t,n)}function PB(e,t,n){e.waveSolve?.capped&&n.push(Gt(t,"NL.W1002","warning",{passes:e.waveSolve.passes}));let r=e.waves??[],i=r.filter(o=>o.empty).map(o=>o.id);if(i.length>0){let o=i.length===r.length?{reason:"all",names:i}:i.length===1?{reason:"one",name:i[0]}:{reason:"many",names:i};n.push(Gt(t,"NL.I1006","info",o,o.reason==="one"?o.name:void 0))}for(let o of e.milestones){if(o.overrunByWave===void 0||o.overrunDate===void 0)continue;let s=r.find(l=>l.id===o.overrunByWave);if(!s)continue;let a=o.id??o.title;n.push(Gt(t,"NL.I1007","info",{name:a,date:o.overrunDate,wave:s.id,end:tp(s.endDate)},a))}}function cx(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)Ab(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)Ib(o,n,r);if(PB(e,n,r),t.today){let i=t.today,o=e.timeline.startDate,s=e.timeline.endDate;(i<o||i>s)&&r.push(Gt(n,"NL.W1000","warning",{date:tp(i),start:tp(o),end:tp(s)}))}return r}var Mi=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function ux(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 Mi(`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 Mi(`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 np(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}))?)$/,bb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function Sb(e){return(st.test(e)||Rb.test(e)||bb.test(e))&&!ze(e.slice(0,10))}function fx(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(Sb(r))return;let i=Te(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 np(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 np(s,{kind:"offset",ms:f})}}return bb.test(r)?Te(r.slice(0,10))??void 0:void 0}return np(n(),t)}}function LB(e){return e===2?"warning":e===3?"info":"error"}function Nb(e,t){return{severity:LB(e.severity),code:ny(e),message:e.message,suggestion:Zf(e.message),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function Pb(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function Lb(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function $b(e,t){let n=e.line!==void 0?e.line+1:1;if(!Fr(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let r=t?Iy(t,e):e.message,i=Zf(r);return{severity:e.severity,code:e.code??Jf(e.message),message:r,...i===void 0?{}:{suggestion:i},file:e.sourcePath,line:n,column:1}}function Ob(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function Cb(e,t){return{severity:e.severity,code:e.code,message:e.message,file:t,line:1,column:1}}var Db="__nowline_browser_noop_include__";async function Mb(e){throw new Error(`${Db}: include "${e}" was skipped \u2014 running in single-file mode.`)}function dx(e){return e.includes(Db)}function Wb(e,t){let n=t==="image/png"?OB(e):t==="image/jpeg"?CB(e):DB(e);return n&&n.width>0&&n.height>0?n:void 0}var $B=[137,80,78,71,13,10,26,10];function px(e,t){return e[t]<<8|e[t+1]}function Fb(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Bb(e,t){return e[t]|e[t+1]<<8}function Ub(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function rp(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function OB(e){if(!(e.length<24||$B.some((t,n)=>e[n]!==t))&&rp(e,12,4)==="IHDR")return{width:Fb(e,16),height:Fb(e,20)}}function CB(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=px(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:px(e,t+7),height:px(e,t+5)};if(r<2)return;t+=2+r}}function DB(e){if(e.length<16||rp(e,0,4)!=="RIFF"||rp(e,8,4)!=="WEBP")return;let t=rp(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:Bb(e,26)&16383,height:Bb(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+Ub(e,24),height:1+Ub(e,27)}}}var MB=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"]),FB=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"]),BB=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"]),UB=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"]),WB=new Set(["none","normal","auto","initial","inherit","unset"]);function XB(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function GB(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var zB=new Set(["x","y","width","height"]);function Gb(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=HB(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}=jB(a);t.push({kind:s?"self":"open",name:l,attrs:c}),n=i+1}return t}function HB(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 jB(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 $l(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function VB(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 zb(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=Gb(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=YB(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($l(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"||GB(p)){d.kind==="open"&&f.push(!1);continue}if(!MB.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=KB(d.attrs??{},a,r),x=Object.keys(w).sort();for(let y of x){let E=w[y];if(g&&t.stripRootSize&&zB.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(XB(y)||y==="class")continue;if(!FB.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let _=VB(E,l);if(_===null){r(`sanitizer: dropping external href ${E}`);continue}m.push(` ${y}="${$l(_)}"`);continue}if(y==="id"){let _=l.get(E);_&&m.push(` id="${$l(_)}"`);continue}let T=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(E.replace(T,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(E)){let _=E.replace(T,(P,U)=>{let O=l.get(U);return O?`url(#${O})`:"none"});m.push(` ${y}="${$l(_)}"`);continue}m.push(` ${y}="${$l(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 Xb(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 ip(e){let t=Gb(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=Xb(n.width),i=Xb(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 Hb(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 YB(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:Hb(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function KB(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(...Hb(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)BB.has(s)?o[s]=a:!s.startsWith("-")&&!UB.has(s)&&!WB.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var qB={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function ZB(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function jb(e,t,n){if(!e||!t)return;let r=ZB(e),i=qB[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"?ip(new TextDecoder().decode(s)):Wb(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 JB=1,QB=0;function eU(){return Oe.parse(`memory:///stage-${++QB}.nowline`)}async function tU(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,eU());return await t.DocumentBuilder.build([n],{validation:!0}),n}function nU(e){return e.origin!=="validation"||e.diagnostic.severity===JB}async function hx(e){let t=await tU(e),n=yl(t);if(n.some(nU))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await py(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource}),o=e.isToleratedIncludeError??(()=>!1),s=i.diagnostics.filter(T=>T.severity==="error"&&!o(T)),a=i.diagnostics.filter(Fr),l=s.find(T=>!Fr(T));if(l)return{kind:"include-error",document:t,legacy:l,routed:[],resolved:i};if(s.length>0)return{kind:"include-error",document:t,routed:a,resolved:i};let c=[],u=await jb(qf(r),e.assetResolver,T=>c.push(T)),{theme:f,today:d,width:p,locale:m,nonWorking:g}=e.layout,w={theme:f,today:d,width:p,locale:m,nonWorking:g},x=Ci(i)??null,y=Ll(r,i,{today:d,plan:x}),E=sx(r,i,{...w,schedule:y,logo:u?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:a,logo:u,warnings:c,plan:x,schedule:y,model:E,layout:w}}var Wr={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"}},rU={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"}},Vb={...Wr,...rU};var roe={none:"",multiplier:"x",person:Wr.person.ascii,people:Wr.people.ascii,points:Wr.points.ascii,time:Wr.time.ascii};var op=class{constructor(t="nl"){B(this,"prefix");B(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};var Yb=/&/g,Kb=/</g,qb=/>/g,iU=/"/g,oU=/'/g;function tt(e){return e.replace(Yb,"&amp;").replace(Kb,"&lt;").replace(qb,"&gt;")}function er(e){return e.replace(Yb,"&amp;").replace(Kb,"&lt;").replace(qb,"&gt;").replace(iU,"&quot;").replace(oU,"&#39;")}function Rs(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}="${er(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function V(e,t,n){return n===void 0||n===""?`<${e}${Rs(t)}/>`:`<${e}${Rs(t)}>${n}</${e}>`}function fe(e,t){return`<text${Rs(e)}>${tt(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var sU={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 aU(e,t){let n=`${e}-shadow-${t}`,r=sU[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 V("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function Zb(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function Jb(e){return["subtle","soft","hard"].map(t=>aU(e,t)).join("")}var lU={thin:100,light:300,normal:400,bold:700};function cU(e){return ls[e]??14}function yx(e,t,n){return{"font-family":t[e.font],"font-size":n??cU(e.textSize),"font-weight":lU[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function uU(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function oS(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 fU(e,t){return oS(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function lp(e,t){return e.length*t*.58}function sS(e,t,n,r,i,o,s){let a=i*.58,l=t?lp(t,i):0,c=t?a:0,u=n+l+c,{text:f,icon:d}=e,p=lp(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return fe({x:h(u),y:h(r),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return fe({x:h(u),y:h(r),...m},`${f}\xD7`);if(d.kind==="builtin"){let w=Wr[d.name],x=fe({x:h(u),y:h(r),...m},f),y=i*.1,E=i,T=u+p+y,_=r-i*.85,P=`<svg x="${h(T)}" y="${h(_)}" width="${h(E)}" height="${h(E)}" viewBox="${w.viewBox}" style="color:${er(s)}" aria-hidden="true">${w.body}</svg>`;return x+P}let g=h(i*.1);return`<text x="${h(u)}" y="${h(r)}" font-family="${er(o)}" font-size="${i}" fill="${er(s)}">${tt(f)}<tspan dx="${g}">${tt(d.text)}</tspan></text>`}var Qb=.6,dU=.5;function pU(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 fe({x:h(r),y:h(i),...l},t);if(!t)return sS(n,void 0,r,i,o,s,a);let c=h(o*Qb),u=`<text x="${h(r)}" y="${h(i)}" font-family="${er(s)}" font-size="${o}" fill="${er(a)}">`,{text:f,icon:d}=n;if(!d)return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+tt(t)+`<tspan dx="${c}">${tt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let P=h(o*.1);return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan><tspan dx="${P}">${tt(d.text)}</tspan></text>`}let p=Wr[d.name],m=P=>P.length*o*dU,g=r+m(t)+o*Qb,w=o*.1,x=o,y=g+m(f)+w,E=i-o*.85,T=u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan></text>`,_=`<svg x="${h(y)}" y="${h(E)}" width="${h(x)}" height="${h(x)}" viewBox="${p.viewBox}" style="color:${er(a)}" aria-hidden="true">${p.body}</svg>`;return T+_}function hU(e,t){let n=Vb.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:${er(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${tt(e.isoDate)}</title>`;return V("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function xx(e,t){return!e||e.length===0?"":e.map(n=>hU(n,t)).join("")}function mU(e){return(e?.length??0)>0}function aS(e){return e?.some(t=>t.side==="after")??!1}function gU(e,t,n,r,i,o={}){let s=Math.min(Ka[i.cornerRadius]??4,r/2);return V("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":uU(i)??null,...o})}function yU(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=V("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:l,stroke:c,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`}),f=i+16+(e.textInset?.x??0),d=o+(e.textInset?.y??0),p=[];e.titleLines.forEach((E,T)=>{p.push(fe({x:h(f),y:h(d+26+T*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},E))});let m=p.join(""),g=d+26+Math.max(0,e.titleLines.length-1)*20,w=n.header.author,x=[];e.authorLines.forEach((E,T)=>{x.push(fe({x:h(f),y:h(g+18+T*14),"font-family":r[e.style.font],"font-size":11,fill:w},E))});let y=x.join("");return V("g",{"data-layer":"header","data-id":`${t}-header`},u+m+y)}function xU(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(V("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(V("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(V("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 V("g",{"data-layer":"grid"},f.join(""))}function lS(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?wx(a,r):a;!l||l.width<=0||l.height<=0||o.push(V("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":Cg}))}return o.length===0?"":V("g",{"data-layer":"non-working"},o.join(""))}function EU(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(V("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(eS(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(eS(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":V("g",{"data-layer":"non-working-label"},i.join(""))}function eS(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"),fe(a,e)}function wU(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(V("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(V("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(V("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(fe({x:h(w.labelX),y:h(a+Ja(l)),"font-family":n.sans,"font-size":vi,fill:o,"text-anchor":"middle"},w.label)),g&&s.push(fe({x:h(w.labelX),y:h(p+Ja(m)),"font-family":n.sans,"font-size":vi,fill:o,"text-anchor":"middle"},w.label))));return V("g",{"data-layer":"timeline"},s.join(""))}function TU(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=V("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Of}),s=vU(e,r),a=_U(e,i,n);return V("g",{"data-layer":"nowline"},o+s+a)}function cS(e){let t=Of/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function vU(e,t){let n=e.pillTopY,r=e.pillTopY+Ft,i=kg,o=e.pillWidth;if(e.pillMode==="center")return V("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Ft),rx:i,ry:i,fill:t});let s=cS(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 V("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 V("path",{d:l,fill:t})}function _U(e,t,n){let r=e.pillTopY+Ag,i=cS(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+cs,s="start"):(o=i-cs,s="end"),fe({x:h(o),y:h(r),"font-family":n.sans,"font-size":tl,"font-weight":700,fill:t,"text-anchor":s},e.label)}function kU(e,t,n,r,i){let o=[];e.waveTooltip!==void 0&&o.push(`<title>${tt(e.waveTooltip)}</title>`);let s=Zb(n,e.style.shadow);o.push(gU(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:s??null})),e.waveRole==="background"&&o.push(jU(e.box,e.style,n));let a=fU(e.style.bg,r),l={done:a.done,"in-progress":a.inProgress,"at-risk":a.atRisk,blocked:a.blocked,planned:a.planned,neutral:a.neutral},c=l[e.status]??l.neutral;if(e.progressFraction>0){let x=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));o.push(V("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-en),width:h(x),height:en,fill:e.style.fg,opacity:.55}))}let u=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-Ri;o.push(V("circle",{cx:h(u),cy:h(e.box.y+Yg),r:yn,fill:c})),o.push(xx(e.inlineDatePins,e.style.fg));let f;if(e.textSpills)f=e.box.x+e.box.width+Xn,e.iconSpills&&(f+=Gn+Ut);else{let x=!!e.linkIcon&&e.linkIcon!=="none",E=e.inlineDatePins?.find(T=>T.side==="after"&&!T.spilled)?fs(x,{barWidth:e.box.width}):fs(!t.noLinks&&x&&!e.iconSpills);f=e.box.x+E}let d=e.style.text,p=r.entities.item.text,m=e.textSpills?p:d,g=e.textSpills?p:e.style.fg,w=e.titleLines??(e.title?[e.title]:[]);if(w.forEach((x,y)=>{x!==""&&o.push(fe({x:h(f),y:h(e.box.y+zf+y*ul),"font-family":i[e.style.font],"font-size":cl,"font-weight":600,fill:m},x))}),(e.metaText||e.capacity)&&o.push(pU({metaText:e.metaText,capacity:e.capacity,x:f,baselineY:e.box.y+Hf(w.length),fontSize:Hg,fontFamily:i[e.style.font],color:g})),e.footnoteIndicators.length>0){let x=e.box.y+Kg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let y=e.footnoteSpillStartX;for(let E=0;E<e.footnoteIndicators.length;E++){let T=e.footnoteIndicators[E];o.push(fe({x:h(y),y:h(x),"font-family":i.sans,"font-size":fl,"font-weight":700,fill:p},String(T))),y+=Bt}}else{let y=e.box.x+e.box.width-us;for(let E=e.footnoteIndicators.length-1;E>=0;E--){let T=e.footnoteIndicators[E];o.push(fe({x:h(y),y:h(x),"font-family":i.sans,"font-size":fl,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(T))),y-=Bt}}}if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let x={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:r.item.linkIconFg},y=x[e.linkIcon]??x.generic,E=Gn,T=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+bi,_=e.box.y+bi,P=V("rect",{x:h(T),y:h(_),width:E,height:E,rx:2,ry:2,fill:y}),U=T,O=_,D=V("path",{d:`M${h(U+4)} ${h(O+10)} L${h(U+10)} ${h(O+4)} M${h(U+6)} ${h(O+4)} H${h(U+10)} V${h(O+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),Y=P+D,L=e.linkHref?V("a",{href:e.linkHref,target:"_blank",rel:"noopener"},Y):Y;o.push(L)}if(e.hasOverflow&&e.overflowBox){let x=r.item.overflowTailFill,y=r.item.overflowTailStroke,E=r.item.overflowCaption;o.push(V("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:x,stroke:y,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&o.push(fe({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:E,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}for(let x of e.labelChips){let y=Math.min(Ka[x.style.cornerRadius]??8,x.box.height/2);o.push(V("rect",{x:h(x.box.x),y:h(x.box.y),width:h(x.box.width),height:h(x.box.height),rx:h(y),ry:h(y),fill:x.style.bg==="none"?"transparent":x.style.bg,stroke:x.style.fg,"stroke-width":.5})),o.push(fe({x:h(x.box.x+x.box.width/2),y:h(x.box.y+x.box.height/2+3),...yx(x.style,i,ls.xs),"text-anchor":"middle"},x.text))}return V("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function AU(e,t,n,r,i){let o=[],s=ki(e.style.bg);if(s){if(o.push(V("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:e.style.bg,stroke:e.style.fg,"stroke-width":1,"fill-opacity":.18,filter:`url(#${n}-shadow-subtle)`})),e.title){let a=Ai(e.title),l=e.box.x,c=e.box.y,u=_i,f=6,d=`M${h(l+f)} ${h(c)}H${h(l+a)}V${h(c+u-f)}A${f} ${f} 0 0 1 ${h(l+a-f)} ${h(c+u)}H${h(l)}V${h(c+f)}A${f} ${f} 0 0 1 ${h(l+f)} ${h(c)}Z`;o.push(V("path",{d,fill:e.style.fg})),o.push(fe({x:h(l+el),y:h(c+xg),"font-family":i[e.style.font],"font-size":Eg,"font-weight":600,fill:"#ffffff"},e.title))}}else{let a=e.style.fg,l=hl(s,!!e.title,mU(e.inlineDatePins));if(e.style.bracket!=="none"&&!e.waveOnly){let u=e.box.y+e.box.height,f=e.style.bracket==="dashed"?"3 2":null,d=l>0?`M${h(e.box.x+4)} ${h(e.box.y-l)} L${h(e.box.x)} ${h(e.box.y-l)} L${h(e.box.x)} ${h(u)} L${h(e.box.x+4)} ${h(u)}`:`M${h(e.box.x)} ${h(e.box.y)} L${h(e.box.x)} ${h(u)} L${h(e.box.x+4)} ${h(u)}`;o.push(V("path",{d,fill:"none",stroke:a,"stroke-width":1,"stroke-dasharray":f}))}e.title&&o.push(fe({x:h(Ni(e.box.x,hs,aS(e.inlineDatePins))),y:h(e.box.y-Kf),...yx(e.style,i,pl),"fill-opacity":.7},e.title))}o.push(xx(e.inlineDatePins,e.style.fg));for(let a of e.children)o.push(Ex(a,t,n,r,i));return V("g",{"data-layer":"group","data-id":e.id??null},o.join(""))}function IU(e,t,n,r,i){let o=[];if(e.style.bracket==="solid"||e.style.bracket==="dashed"){let l=e.box.y-12,c=e.box.y+e.box.height+12,u=e.box.x,f=e.box.x+e.box.width,d=r.parallel.bracketStroke;o.push(V("path",{d:`M${h(u+4)} ${h(l)} H${h(u)} V${h(c)} H${h(u+4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":e.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"})),o.push(V("path",{d:`M${h(f-4)} ${h(l)} H${h(f)} V${h(c)} H${h(f-4)}`,fill:"none",stroke:d,"stroke-width":1.25,"stroke-dasharray":e.style.bracket==="dashed"?"3 3":null,"stroke-linejoin":"round"}))}e.title&&o.push(fe({x:h(Ni(e.box.x,ms,aS(e.inlineDatePins))),y:h(e.box.y-Kf),...yx(e.style,i,pl),"fill-opacity":.7},e.title)),o.push(xx(e.inlineDatePins,e.style.fg));for(let s of e.children)o.push(Ex(s,t,n,r,i));return V("g",{"data-layer":"parallel","data-id":e.id??null},o.join(""))}function Ex(e,t,n,r,i){return e.kind==="item"?kU(e,t,n,r,i):e.kind==="group"?AU(e,t,n,r,i):IU(e,t,n,r,i)}var tS=2;function RU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function bU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-tS,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":V("rect",{x:h(i.startX),y:h(n),width:h(o),height:tS,fill:RU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return V("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function SU(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return V("g",{"data-layer":"swimlane-bg","data-id":e.id??null},V("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 uS(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,l=r.swimlane.ownerText,c=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.capacity?wi(e.capacity.text,e.capacity.icon,10):0,p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=p?lp(p,10):0,g=ml(e.box.x,e.title,e.owner,d,m),w=Pf,x=e.box.y+10,y=x+Lf;u.push(V("rect",{x:h(g.tabX),y:h(x),width:h(g.tabW),height:h(w),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(fe({x:h(g.titleX),y:h(y),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(fe({x:h(g.ownerX),y:h(y),"font-family":i[e.style.font],"font-size":10,fill:l},`owner: ${e.owner}`)),e.capacity&&u.push(sS(e.capacity,void 0,g.badgeX,y,10,i[e.style.font],l)),p&&u.push(fe({x:h(g.footnoteRightX),y:h(x+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let f of e.children)u.push(Ex(f,t,n,r,i));return u.push(bU(e,r)),V("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function NU(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,l=V("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?fe(f,e.title):"";return V("g",{"data-layer":"anchor","data-id":e.id??null},fS(e.hiddenDate)+l+d)}function PU(e,t){let n=t.anchorDiamond.cutLine;return V("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 LU(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.fill,a=V("path",{d:`M${h(r)} ${h(i-o)} L${h(r+o)} ${h(i)} L${h(r)} ${h(i+o)} L${h(r-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),l=t.milestoneDiamond.label,c=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(c),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:l};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?fe(u,e.title):"";return V("g",{"data-layer":"milestone","data-id":e.id??null},fS(e.hiddenDate)+a+f)}function fS(e){return e===void 0?"":`<title>${tt(e)}</title>`}function $U(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(V("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":$f,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=n.milestoneDiamond.slack;for(let s of e.slackArrows)i.push(V("path",{d:`M${h(s.x)} ${h(s.y)} H${h(e.center.x-6)}`,fill:"none",stroke:o,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-arrow-dark)`}))}return i.join("")}function nS(e,t,n){let r=e.kind==="overflow"?n.dependency.overflowStroke:n.dependency.edgeStroke,i=e.waypoints;if(i.length<2)return"";let o=e.kind==="underBar"?.8:1.1;return V("path",{d:OU(i,$g),fill:"none",stroke:r,"stroke-width":o,"stroke-dasharray":e.kind==="overflow"?"4 2":null,"stroke-linejoin":"round","marker-end":`url(#${t}-arrow)`})}function OU(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 CU(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(V("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(fe({x:h(e.box.x+tn),y:h(e.box.y+bg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.y+nl+tn,d=e.box.x+tn,p=d+tn;return e.entries.forEach((m,g)=>{let w=f+g*rl;u.push(fe({x:h(d),y:h(w),"font-family":r.sans,"font-size":10,"font-weight":700,fill:c},String(m.number))),u.push(fe({x:h(p),y:h(w),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},m.title)),m.description&&u.push(fe({x:h(p+Math.max(120,m.title.length*6)),y:h(w),"font-family":r.sans,"font-size":11,fill:l},`\u2014 ${m.description}`))}),V("g",{"data-layer":"footnotes"},u.join(""))}function DU(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=V("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":$f}),E=Pf,T=gl(e.box.x,e.label,e.sourcePath),_=g-E/2,P=V("rect",{x:h(T.tabX),y:h(_),width:h(T.tabWidth),height:E,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),U=fe({x:h(T.tabLabelX),y:h(_+Lf),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),O=T.badgeX,D=T.badgeSize,Y=g-D/2,L=V("rect",{x:h(O),y:h(Y),width:D,height:D,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),S=V("path",{d:`M${h(O+7)} ${h(Y+4)} H${h(O+14)} V${h(Y+11)} M${h(O+4)} ${h(Y+7)} H${h(O+11)} V${h(Y+14)} H${h(O+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),R=9,C=g+4,v=V("rect",{x:h(T.sourceHaloX),y:h(C-R),width:h(T.sourceHaloWidth),height:R+6,fill:a}),b=fe({x:h(T.sourceTextX),y:h(C),"font-family":i.mono,"font-size":R,fill:p},e.sourcePath),A={x:m,y:g,width:w,height:x},M=o?lS(o.timeline,o.chartBox.y,r,A):"",N=o?.waves?mS(o.waves,A)+gS(o.waveBoundaries,A):"",F=o?.waves?yS(e.waveCrossings):"",z=e.nestedSwimlanes.map(X=>uS(X,t,n,r,i)).join("");return V("g",{"data-layer":"include"},y+M+N+z+F+P+U+L+S+v+b)}function MU(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=Cr,a=fe({x:"0",y:s,"font-family":t.sans,"font-size":Df,"font-weight":400,fill:n},Cf)+fe({x:ol,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":700,fill:n},"now")+V("rect",{x:Ng,y:12,width:Pg,height:Cr,fill:r})+fe({x:Mf,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":400,fill:n},"ine"),l=V("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(il)})`},a);return V("a",{href:Sg,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},V("g",{"data-layer":"attribution"},l))}async function FU(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??ip(d)??{width:a,height:l},m=new Set,g=zb(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(", ")}`),V("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=BU(c.bytes);return V("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 BU(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 UU=.24,sp=2,rS=3,WU=4,XU=8,GU=10;function dS(e){return e.bg==="none"?"transparent":e.bg}function cp(e){return oS(e)>=UU?"dark":"light"}function pS(e,t){return`url(#${e}-wave-hatch-${t})`}function zU(e,t,n){let r=Bg;return V("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},V("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":Ug,opacity:Fg}))}function HU(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&t.add(cp(dS(o.style))):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);return e.waveLegend?.entries.some(i=>i.kind==="background")&&t.add(cp(xS(e.palette))),["dark","light"].filter(i=>t.has(i))}function jU(e,t,n){let i=Math.min(Ka[t.cornerRadius]??4,e.height/2);return V("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(i),ry:h(i),fill:pS(n,cp(dS(t)))})}function wx(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 mx=4,ap=.5;function hS(e,t){if(e.empty)return;let n=ap;return wx({x:e.strip.box.x,y:e.strip.box.y+n,width:e.strip.box.width,height:e.strip.box.height-2*n},{x:t.box.x+n,y:e.strip.box.y,width:t.box.width-2*n,height:e.strip.box.height})}function VU(e,t){let n=Math.min(mx-ap,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+ap+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-ap-r?n:0}}function YU(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 gx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?V("path",{d:YU(t,n),...o}):V("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":sl}):i}function KU(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[V("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:mx,ry:mx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=hS(o,n);s&&i.push(V("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${gx(o,s,VU(s,n))}`))}return V("g",{"data-layer":"wave-strip"},i.join(""))}function mS(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?wx(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(V("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":Wg}))}return n.length===0?"":V("g",{"data-layer":"wave-bg"},n.join(""))}function gS(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(V("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":Ff,"stroke-dasharray":r.dash}))}return n.length===0?"":V("g",{"data-layer":"wave-boundary"},n.join(""))}function iS(e,t){let n=lp(e,gn);return t?n*1.05:n}function qU(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+WU,s=i.y+rS,a=i.height-2*rS,l=[],c=(u,f)=>{let d=iS(f,!1)+2*sp;return V("rect",{x:h(u-d/2),y:h(s),width:h(d),height:h(a),fill:t.timeline.panelFill})+fe({x:h(u),y:h(o),"font-family":n.sans,"font-size":gn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},f)};i.placeholder!==void 0&&l.push(c(r.box.x+r.box.width/2,i.placeholder));for(let u of e.waves){if(u.strip.gapLabel){let{text:m,x:g}=u.strip.gapLabel;l.push(c(g,m))}if(u.strip.marker){let{x:m,y:g}=u.strip.marker,w=Xg/2;l.push(V("path",{d:`M${h(m)} ${h(g-w)} L${h(m+w)} ${h(g)} L${h(m)} ${h(g+w)} L${h(m-w)} ${h(g)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${tt(u.strip.tooltip)}</title>`))}let f=hS(u,r);if(!f)continue;let d=f.x+f.width,p=u.strip.footnotesShown?u.footnoteIndicators.length*Bt:0;if(p){let m=d-Fn+sp,g=d-Fn-p-sp;l.push(gx(u,{x:g,y:s,width:m-g,height:a}))}if(u.strip.label!==void 0){let m=iS(u.strip.label,!0),g=p?Math.min(u.strip.labelX,d-Fn-p-m/2):u.strip.labelX,w=m+2*sp;l.push(gx(u,{x:g-w/2,y:s,width:w,height:a})),l.push(fe({x:h(g),y:h(o),"font-family":n.sans,"font-size":gn,"font-weight":600,fill:u.style.text,"text-anchor":"middle"},u.strip.label))}if(u.strip.footnotesShown){let m=d-Fn;for(let g=u.footnoteIndicators.length-1;g>=0;g--)l.push(fe({x:h(m),y:h(i.y+GU),"font-family":n.sans,"font-size":XU,"font-weight":700,fill:u.style.text,"text-anchor":"end"},String(u.footnoteIndicators[g]))),m-=Bt}}return l.length===0?"":V("g",{"data-layer":"wave-labels"},l.join(""))}function yS(e){if(!e||e.length===0)return"";let t=e.map(n=>V("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":Mg}));return V("g",{"data-layer":"wave-cross"},t.join(""))}function xS(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function ZU(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"){let a=xS(n),l={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(V("rect",{...l,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(V("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:pS(t,cp(a))}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(V("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":Ff}))}for(let a of o.runs)i.push(fe({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":gn,fill:n.wave.labelText},a.text))}return V("g",{"data-layer":"wave-legend"},i.join(""))}async function Tx(e,t={}){let r=new op(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??Og,s=[],a=i.arrowhead.neutral,l=i.arrowhead.light,c=i.arrowhead.dark,u=(p,m)=>`<marker id="${p}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${m}"/></marker>`,f=`<defs>${Jb(r)}`+u(`${r}-arrow`,a)+u(`${r}-arrow-light`,l)+u(`${r}-arrow-dark`,c)+HU(e).map(p=>zU(r,p,i)).join("")+"</defs>";s.push(f),s.push(V("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(wU(e.timeline,i,o)),s.push(KU(e,i));for(let p of e.swimlanes)s.push(SU(p,i));s.push(lS(e.timeline,e.chartBox.y,i)),e.waves&&s.push(mS(e.waves)),s.push(xU(e.timeline,e.chartBox.y,i)),s.push(gS(e.waveBoundaries)),s.push(qU(e,i,o));for(let p of e.edges)p.kind==="underBar"&&s.push(nS(p,r,i));for(let p of e.swimlanes)s.push(uS(p,t,r,i,o));for(let p of e.includes)s.push(DU(p,t,r,i,o,e));s.push(yS(e.waveCrossings));for(let p of e.edges)p.kind!=="underBar"&&s.push(nS(p,r,i));for(let p of e.anchors)s.push(PU(p,i));for(let p of e.milestones)s.push($U(p,r,i));s.push(EU(e.timeline,i,o));for(let p of e.anchors)s.push(NU(p,i,o));for(let p of e.milestones)s.push(LU(p,i,o));if(s.push(TU(e.nowline,i,o)),s.push(CU(e.footnotes,r,i,o)),s.push(ZU(e.waveLegend,r,i,o)),s.push(yU(e.header,r,i,o)),s.push(MU(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let p=await FU(e.header.logo,t.assetResolver,r,t);p&&s.push(p)}return`<svg${Rs({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 vx="/browser-source.nowline",JU={error:3,warning:2,info:1},QU={error:3,warning:2,info:1};function ES(e,t){return JU[e]>=QU[t]}var up,wS=0;function TS(){return up||(up=Ay()),up}function eW(){return Oe.parse(`memory:///nowline-browser-${++wS}.nowline`)}async function _x(e,t={}){let n=t.filePath??vx,r=TS(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,eW());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:vS(o,n)}}function vS(e,t){return _S(yl(e),t)}function _S(e,t){return e.map(n=>n.origin==="lexer"?Lb(n.error,t):n.origin==="parser"?Pb(n.error,t):Nb(n.diagnostic,t))}async function kx(e,t={}){let n=t.filePath??vx,r=TS(),i,o;if(t.timezone)try{i=ux(t.timezone)}catch(E){if(!(E instanceof Mi))throw E;o=E}let s=o?void 0:fx({now:t.today,zone:i}),a=await hx({source:e,sourcePath:n,services:r,readSource:t.readFile??Mb,assetResolver:t.assetResolver,isToleratedIncludeError:E=>dx(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:_S(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=vS(a.document,n);for(let E of a.resolved.diagnostics){if(E.severity==="error"&&dx(E.message)){t.onSkippedInclude?.({sourcePath:E.sourcePath,message:E.message});continue}l&&Fr(E)||c.push($b(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=cx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(E=>Cb(E,n)),g=t.showLinks!==!1,w=t.strict===!0,x=await Tx(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=>Ob(E,n,w?"error":"warning"))].filter(E=>ES(E.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function Ax(){up=void 0,wS=0}var kS="/embed.nowline",Ix=!1;async function AS(e){let{ast:t,diagnostics:n}=await _x(e,{filePath:kS});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function fp(e,t={}){let n={filePath:kS,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Ix||(Ix=!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 kx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ol(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ol=class extends Error{constructor(n,r){super(n);B(this,"details",r);this.name="EmbedRenderError"}};function IS(){Ix=!1,Ax()}var rn=Uint8Array,Nt=Uint16Array,Px=Int32Array,Lx=new rn([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]),$x=new rn([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]),RS=new rn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),PS=function(e,t){for(var n=new Nt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Px(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}},LS=PS(Lx,2),tW=LS.b,bx=LS.r;tW[28]=258,bx[258]=28;var $S=PS($x,0),Loe=$S.b,bS=$S.r,Sx=new Nt(32768);for(xe=0;xe<32768;++xe)tr=(xe&43690)>>1|(xe&21845)<<1,tr=(tr&52428)>>2|(tr&13107)<<2,tr=(tr&61680)>>4|(tr&3855)<<4,Sx[xe]=((tr&65280)>>8|(tr&255)<<8)>>1;var tr,xe,Ml=(function(e,t,n){for(var r=e.length,i=0,o=new Nt(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Nt(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Nt(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Sx[f]>>l]=c}else for(a=new Nt(r),i=0;i<r;++i)e[i]&&(a[i]=Sx[s[e[i]-1]++]>>15-e[i]);return a}),Fi=new rn(288);for(xe=0;xe<144;++xe)Fi[xe]=8;var xe;for(xe=144;xe<256;++xe)Fi[xe]=9;var xe;for(xe=256;xe<280;++xe)Fi[xe]=7;var xe;for(xe=280;xe<288;++xe)Fi[xe]=8;var xe,dp=new rn(32);for(xe=0;xe<32;++xe)dp[xe]=5;var xe,nW=Ml(Fi,9,0);var rW=Ml(dp,5,0);var OS=function(e){return(e+7)/8|0},iW=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new rn(e.subarray(t,n))};var nr=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Cl=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},Rx=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:DS,l:0};if(i==1){var s=new rn(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(_,P){return _.f-P.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Nt(d+1),m=Nx(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,x=1<<w;for(o.sort(function(P,U){return p[U.s]-p[P.s]||P.f-U.f});r<i;++r){var y=o[r].s;if(p[y]>t)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 T=o[r].s;p[T]==t&&(--p[T],++g)}m=t}return{t:new rn(p),l:m}},Nx=function(e,t,n){return e.s==-1?Math.max(Nx(e.l,t,n+1),Nx(e.r,t,n+1)):t[e.s]=n},SS=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Nt(++t),r=0,i=e[0],o=1,s=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},Dl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},CS=function(e,t,n){var r=n.length,i=OS(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},NS=function(e,t,n,r,i,o,s,a,l,c,u){nr(t,u++,n),++i[256];for(var f=Rx(i,15),d=f.t,p=f.l,m=Rx(o,15),g=m.t,w=m.l,x=SS(d),y=x.c,E=x.n,T=SS(g),_=T.c,P=T.n,U=new Nt(19),O=0;O<y.length;++O)++U[y[O]&31];for(var O=0;O<_.length;++O)++U[_[O]&31];for(var D=Rx(U,7),Y=D.t,L=D.l,S=19;S>4&&!Y[RS[S-1]];--S);var R=c+5<<3,C=Dl(i,Fi)+Dl(o,dp)+s,v=Dl(i,d)+Dl(o,g)+s+14+3*S+Dl(U,Y)+2*U[16]+3*U[17]+7*U[18];if(l>=0&&R<=C&&R<=v)return CS(t,u,e.subarray(l,l+c));var b,A,M,N;if(nr(t,u,1+(v<C)),u+=2,v<C){b=Ml(d,p,0),A=d,M=Ml(g,w,0),N=g;var F=Ml(Y,L,0);nr(t,u,E-257),nr(t,u+5,P-1),nr(t,u+10,S-4),u+=14;for(var O=0;O<S;++O)nr(t,u+3*O,Y[RS[O]]);u+=3*S;for(var z=[y,_],X=0;X<2;++X)for(var ne=z[X],O=0;O<ne.length;++O){var H=ne[O]&31;nr(t,u,F[H]),u+=Y[H],H>15&&(nr(t,u,ne[O]>>5&127),u+=ne[O]>>12)}}else b=nW,A=Fi,M=rW,N=dp;for(var O=0;O<a;++O){var te=r[O];if(te>255){var H=te>>18&31;Cl(t,u,b[H+257]),u+=A[H+257],H>7&&(nr(t,u,te>>23&31),u+=Lx[H]);var k=te&31;Cl(t,u,M[k]),u+=N[k],k>3&&(Cl(t,u,te>>5&8191),u+=$x[k])}else Cl(t,u,b[te]),u+=A[te]}return Cl(t,u,b[256]),u+A[256]},oW=new Px([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),DS=new rn(0),sW=function(e,t,n,r,i,o){var s=o.z||e.length,a=new rn(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=oW[t-1],d=f>>13,p=f&8191,m=(1<<n)-1,g=o.p||new Nt(32768),w=o.h||new Nt(m+1),x=Math.ceil(n/3),y=2*x,E=function(me){return(e[me]^e[me+1]<<x^e[me+2]<<y)&m},T=new Px(25e3),_=new Nt(288),P=new Nt(32),U=0,O=0,D=o.i||0,Y=0,L=o.w||0,S=0;D+2<s;++D){var R=E(D),C=D&32767,v=w[R];if(g[C]=v,w[R]=C,L<=D){var b=s-D;if((U>7e3||Y>24576)&&(b>423||!c)){u=NS(e,l,0,T,_,P,O,Y,S,D-S,u),Y=U=O=0,S=D;for(var A=0;A<286;++A)_[A]=0;for(var A=0;A<30;++A)P[A]=0}var M=2,N=0,F=p,z=C-v&32767;if(b>2&&R==E(D-z))for(var X=Math.min(d,b)-1,ne=Math.min(32767,D),H=Math.min(258,b);z<=ne&&--F&&C!=v;){if(e[D+M]==e[D+M-z]){for(var te=0;te<H&&e[D+te]==e[D+te-z];++te);if(te>M){if(M=te,N=z,te>X)break;for(var k=Math.min(z,te-2),$=0,A=0;A<k;++A){var W=D-z+A&32767,G=g[W],J=W-G&32767;J>$&&($=J,v=W)}}}C=v,v=g[C],z+=C-v&32767}if(N){T[Y++]=268435456|bx[M]<<18|bS[N];var Z=bx[M]&31,Q=bS[N]&31;O+=Lx[Z]+$x[Q],++_[257+Z],++P[Q],L=D+M,++U}else T[Y++]=e[D],++_[e[D]]}}for(D=Math.max(D,L);D<s;++D)T[Y++]=e[D],++_[e[D]];u=NS(e,l,c,T,_,P,O,Y,S,D-S,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=D,o.w=L)}else{for(var D=o.w||0;D<s+c;D+=65535){var oe=D+65535;oe>=s&&(l[u/8|0]=c,oe=s),u=CS(l,u+1,e.subarray(D,oe))}o.i=s}return iW(a,0,r+OS(u)+i)};var MS=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}}},aW=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new rn(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return sW(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 FS=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var lW=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=MS();i.p(t.dictionary),FS(e,2,i.d())}};function BS(e,t){t||(t={});var n=MS();n.p(e);var r=aW(e,t,t.dictionary?6:2,4);return lW(r,t),FS(r,r.length-4,n.d()),r}var cW=typeof TextDecoder<"u"&&new TextDecoder,uW=0;try{cW.decode(DS,{stream:!0}),uW=1}catch{}var XS="https://free.nowline.io/open";function US(e){let t=new TextEncoder().encode(e),n=BS(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 Ox({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&WS(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",US(e));let r=n===!0?XS:n,i=new URL(r);return t!==void 0&&WS(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${US(e)}`,i.toString()}function WS(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var GS=0;async function zS(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=++GS,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=fW(c);if(!u)continue;let f=dW(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(fp(f,p).then(y=>{if(pW(u,y),r++,m!==null){let E=Ox({source:f,sourceUrl:x,share:s});if(E!==null){let T=t.createElement("a");T.className="nowline-share",T.href=E,T.target="_blank",T.rel="noopener noreferrer",T.textContent="Share on Nowline",m.insertBefore(T,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function fW(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function dW(e){return e.textContent??""}function pW(e,t){e.outerHTML=t}function HS(){GS=0}function pp(){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 jS(e,t){return e&&e!=="auto"?Py(e)??t:t}var hW="0.0.0-dev.20261015033109.g3d8b606",mW="3d8b606",gW="pre code.language-nowline, code.language-nowline",VS={theme:"auto",startOnLoad:!0,selector:gW,systemTheme:pp(),share:!0},ke={...VS},Cx=!1;function yW(e={}){ke={theme:e.theme??ke.theme,startOnLoad:e.startOnLoad??ke.startOnLoad,selector:e.selector??ke.selector,locale:e.locale??ke.locale,width:e.width??ke.width,nonWorking:e.nonWorking??ke.nonWorking,today:e.today!==void 0?e.today:ke.today,timezone:e.timezone??ke.timezone,share:e.share??ke.share,sourceUrl:e.sourceUrl??ke.sourceUrl,systemTheme:pp()}}function YS(){return{theme:jS(ke.theme,ke.systemTheme),locale:ke.locale,width:ke.width,nonWorking:ke.nonWorking,today:ke.today,timezone:ke.timezone}}async function xW(e,t={}){let n={...YS(),...t};return fp(e,n)}async function EW(e){return AS(e)}async function Dx(e){let t={selector:e?.selector??ke.selector,theme:e?.theme??YS().theme,locale:e?.locale??ke.locale,width:e?.width??ke.width,nonWorking:e?.nonWorking??ke.nonWorking,today:e?.today!==void 0?e.today:ke.today,timezone:e?.timezone??ke.timezone,share:e?.share??ke.share,sourceUrl:e?.sourceUrl??ke.sourceUrl,document:e?.document};return zS(t)}var wW=Dx;if(typeof document<"u"&&!Cx){Cx=!0;let e=()=>{ke.startOnLoad&&Dx()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function TW(){ke={...VS,systemTheme:pp()},Cx=!1,IS(),HS()}return rN(vW);})();
2920
2920
  //# 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.20261014154114.g5da7d2a",
3
+ "version": "0.0.0-dev.20261015033109.g3d8b606",
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.20261014154114.g5da7d2a",
43
- "@nowline/core": "0.0.0-dev.20261014154114.g5da7d2a",
44
- "@nowline/layout": "0.0.0-dev.20261014154114.g5da7d2a",
45
- "@nowline/renderer": "0.0.0-dev.20261014154114.g5da7d2a",
46
- "@nowline/share-link": "0.0.0-dev.20261014154114.g5da7d2a",
42
+ "@nowline/browser": "0.0.0-dev.20261015033109.g3d8b606",
43
+ "@nowline/core": "0.0.0-dev.20261015033109.g3d8b606",
44
+ "@nowline/layout": "0.0.0-dev.20261015033109.g3d8b606",
45
+ "@nowline/renderer": "0.0.0-dev.20261015033109.g3d8b606",
46
+ "@nowline/share-link": "0.0.0-dev.20261015033109.g3d8b606",
47
47
  "langium": "~4.4.0"
48
48
  },
49
49
  "devDependencies": {